diff --git a/.github/workflows/delete_pr_built_doc.yml b/.github/workflows/delete_pr_built_doc.yml new file mode 100644 index 000000000..44452162c --- /dev/null +++ b/.github/workflows/delete_pr_built_doc.yml @@ -0,0 +1,42 @@ +name: Delete docs built with PR + +on: + pull_request: + branches: [ "3.9" ] + types: + - closed # PR closed + +jobs: + delete_pr_docs: + runs-on: ubuntu-latest + + steps: + - name: Prepare environment variables + run: | + ref=${GITHUB_REF#refs/pull/} + pr_num=${ref%/merge} + + echo "::set-env name=PR_NUM::${pr_num}" + echo "::set-env name=PR_BUILD_ID::${GITHUB_BASE_REF}/${pr_num}" + echo "::set-env name=DOCS_BASE_DIR::build/html" + echo "::set-env name=DOCS_OUTPUT_DIR::build/html/${GITHUB_BASE_REF}/${pr_num}" + + - name: Checkout GitHub Pages + uses: actions/checkout@v2 + with: + ref: gh-pages + path: build/html + + - name: Delete docs + run: | + cd ${GITHUB_WORKSPACE}/${DOCS_BASE_DIR} + pwd + git rm -r ${GITHUB_WORKSPACE}/${DOCS_OUTPUT_DIR} + git config --local user.name "Autobuild bot on GitHub Actions" + git config --local user.email "githubaction-build-bot@example.com" + pwd + git add . + # if [ $(git status -s | wc -l) -eq 0 ]; then echo "nothing to commit"; exit 0; fi + git commit -m "Delete docs, branch: ${GITHUB_BASE_REF} pr_num: ${PR_NUM}" + git push --quiet "https://$%7B%7B%20secrets.GITHUB_TOKEN%20%7D%7D@github.com/$%7BGITHUB_REPOSITORY%7D.git" gh-pages:gh-pages + diff --git a/.github/workflows/lint-and-built.yml b/.github/workflows/lint-and-built.yml deleted file mode 100644 index d655617f3..000000000 --- a/.github/workflows/lint-and-built.yml +++ /dev/null @@ -1,62 +0,0 @@ -# From python-docs-translations/transifex-automations -# Orignals: https://github.com/python-docs-translations/transifex-automations/tree/main/sample-workflows -name: Linting and Building Workflow - -on: - schedule: - - cron: '34 12 * * SAT' - push: - branches: - - '*' - workflow_dispatch: - -jobs: - build-translation: - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - version: [ '3.14', '3.13' ] - format: [ html ] - steps: - - uses: actions/setup-python@master - with: - python-version: 3.12 # pinned for Sphinx 3.4.3 to build 3.10 - - uses: actions/checkout@master - with: - repository: python/cpython - ref: ${{ matrix.version }} - - run: make venv - working-directory: ./Doc - - uses: actions/checkout@master - with: - ref: ${{ matrix.version }} - path: Doc/locales/ja/LC_MESSAGES - - run: git pull - working-directory: ./Doc/locales/ja/LC_MESSAGES - - uses: sphinx-doc/github-problem-matcher@v1.1 - - run: make -e SPHINXOPTS="--color -D language='ja' -W --keep-going" ${{ matrix.format }} - working-directory: ./Doc - - uses: actions/upload-artifact@master - if: success() || failure() - with: - name: build-${{ matrix.version }}-${{ matrix.format }} - path: Doc/build/${{ matrix.format }} - - lint: - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - version: [ '3.14', '3.13' ] - continue-on-error: true - steps: - - uses: actions/setup-python@master - with: - python-version: 3 - - run: pip install sphinx-lint - - uses: actions/checkout@master - with: - ref: ${{ matrix.version }} - - uses: rffontenelle/sphinx-lint-problem-matcher@v1.0.0 - - run: sphinx-lint diff --git a/.github/workflows/pr_build.yml b/.github/workflows/pr_build.yml new file mode 100644 index 000000000..5a80f70bd --- /dev/null +++ b/.github/workflows/pr_build.yml @@ -0,0 +1,72 @@ +name: PR build for ver 3.8 + +on: + pull_request: + branches: [ "3.9" ] + types: + - opened # open PR + - synchronize # update the branch which pulled from + - reopened # re-open PR + +jobs: + pr_build: + runs-on: ubuntu-latest + + steps: + - name: Prepare environment variables + run: | + ref=${GITHUB_REF#refs/pull/} + pr_num=${ref%/merge} + + echo "::set-env name=PR_BUILD_ID::${GITHUB_BASE_REF}/${pr_num}" + echo "::set-env name=DOCS_BASE_DIR::build/html" + echo "::set-env name=DOCS_OUTPUT_DIR::build/html/${GITHUB_BASE_REF}/${pr_num}" + + - name: Checkout cpython repository + uses: actions/checkout@v2 + with: + repository: python-doc-ja/cpython-doc-catalog + ref: catalog-3.8 + path: cpython + + + - name: Checkout PR branch + uses: actions/checkout@v2 + with: + ref: ${{ github.ref }} + path: cpython/Doc/locales/ja/LC_MESSAGES + + - name: Checkout GitHub Pages + uses: actions/checkout@v2 + with: + ref: gh-pages + path: build/html + + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y --no-install-recommends python3-venv + + - name: Build docs + run: | + cd cpython/Doc + make venv + rm -rf ${DOCS_OUTPUT_DIR} + make build ALLSPHINXOPTS="-b html -D language=ja -D gettext_compact=0 -E -d build/doctrees . ${GITHUB_WORKSPACE}/${DOCS_OUTPUT_DIR}" + ls -l ${GITHUB_WORKSPACE}/${DOCS_OUTPUT_DIR} + + - name: Publish docs + run: | + cd ${GITHUB_WORKSPACE}/${DOCS_BASE_DIR} + git config --local user.name "Autobuild bot on GitHub Actions" + git config --local user.email "githubaction-build-bot@example.com" + git add . + if [ $(git status -s | wc -l) -eq 0 ]; then echo "nothing to commit"; exit 0; fi + git commit -m 'update html' + git push --quiet "https://$%7B%7B%20secrets.GITHUB_TOKEN%20%7D%7D@github.com/$%7BGITHUB_REPOSITORY%7D.git" gh-pages:gh-pages + + - name: Notify the URL of the built docs + uses: thollander/actions-comment-pull-request@master + with: + message: 'Please check the built documentation!!! https://python.github.io/python-docs-ja/${{ env.PR_BUILD_ID }}' + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml deleted file mode 100644 index 0864c4ee1..000000000 --- a/.github/workflows/update.yml +++ /dev/null @@ -1,118 +0,0 @@ -# Modification along rffontenelle/python-docs-pt-br -name: Update translations - -on: - workflow_dispatch: - schedule: - - cron: '40 23 * * *' - #push: - # paths: - # - '.github/workflows/update.yml' - # - 'scripts/update.sh' - # branches: - # - '3.11' - -env: - CPYTHON_BRANCH: '3.14' - LANGUAGE: 'ja' - -jobs: - update: - # Job to pull translation from Transifex platform, and commit & push changes - runs-on: ubuntu-latest - steps: - - name: Check out ${{ github.repository }} - uses: actions/checkout@v4 - - name: Check out CPython - uses: actions/checkout@v4 - with: - repository: python/cpython - persist-credentials: false - ref: ${{ env.CPYTHON_BRANCH }} - path: cpython - - name: Set up Python - uses: actions/setup-python@v5 - with: - cache: 'pip' - cache-dependency-path: '**/requirements*.txt' - - name: Install Transifex CLI - run: | - curl -o- https://raw.githubusercontent.com/transifex/cli/master/install.sh | bash - working-directory: /usr/local/bin - - name: Install dependencies - run: | - sudo apt-get update -y && sudo apt-get install gettext -y - pip install --upgrade pip - pip install -r requirements.txt -r cpython/Doc/requirements.txt - - name: Update translations - run: | - sh scripts/update.sh - env: - TX_TOKEN: ${{ secrets.TX_TOKEN }} - LANGUAGE: ${{ env.LANGUAGE }} - - name: Wrap catalog message files - run: | - powrap --modified - - name: Commit and push changes - if: github.repository == 'python/python-docs-ja' - run: | - git config user.name github-actions - git config user.email github-actions@github.com - git status - git add -A - git diff-index --quiet HEAD || ( git commit -m "Update translations from Transifex" && git push ) - - merge: - # Merge translations previously updated into older branches to make sure - # older versions of Python Docs gets translated as well. - # 'overwrite=true' means strings previously translated will get overwritten; - # other branches will preserve translated strings, only filling in new - # translations. - name: merge into ${{ matrix.branch }} - needs: [update] - strategy: - matrix: - branch: [ "3.13", "3.12", "3.11" ] - - runs-on: ubuntu-latest - steps: - - name: Check out source branch (${{ env.CPYTHON_BRANCH }}) - uses: actions/checkout@v4 - with: - path: ${{ env.CPYTHON_BRANCH }} - - - name: Check out target branch (${{ matrix.branch }}) - uses: actions/checkout@v4 - with: - ref: ${{ matrix.branch }} - path: ${{ matrix.branch }} - - - name: Set up Python - uses: actions/setup-python@v5 - with: - cache: 'pip' - cache-dependency-path: '**/requirements*.txt' - - - name: Install dependencies - run: | - sudo apt-get update -y && sudo apt-get install gettext -y - pip install pomerge powrap - - - name: Merge overwriting on stable release branch - run: | - pomerge --from "${{ env.CPYTHON_BRANCH }}"/**/*.po --to "${{ matrix.branch }}"/**/*.po - - - name: Wrap catalog message files - run: | - powrap --modified -C "${{ matrix.branch }}" - - - name: Commit and push changes - if: github.repository == 'python/python-docs-ja' - run: | - cd "${{ matrix.branch }}" - git config user.name github-actions - git config user.email github-actions@github.com - git status - git add -A - git diff-index --quiet HEAD || ( git commit -m "Merge ${{ env.CPYTHON_BRANCH }} into ${{ matrix.branch }}" && git push ) - diff --git a/.gitignore b/.gitignore index 74581d6ed..ed3e15c6d 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -cpython +secrets_3.9.tar diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..449d75afe --- /dev/null +++ b/.travis.yml @@ -0,0 +1,30 @@ +dist: bionic +language: python +python: '3.8' +branches: + only: + - 3.9 +env: + global: + # branch name of python-docs-ja repository + - DOCS_BRANCH=3.9 + # branch name of cpython repository + - CPYTHON_BRANCH=3.9 + # branch name of cpython-doc-catalog repository + - CATALOG_BRANCH=catalog-3.9 + # Transifex project name + - TRANSIFEX_PROJECT=python-39 + # Directory where repositories are cloned + - BASEDIR="$(dirname ${TRAVIS_BUILD_DIR})" + # Number of parent commits + - NUM_PARENTS=$(git log --pretty=%P -n 1 HEAD | awk '{ print NF }') +install: + - pip install sphinx + - pip install blurb + - pip install transifex-client + - pip install sphinx-intl +before_script: + - build_type=$(bash ${TRAVIS_BUILD_DIR}/scripts/determine-build-type) + - export build_type +script: + - bash ${TRAVIS_BUILD_DIR}/scripts/${build_type}/main.sh diff --git a/.tx/config b/.tx/config deleted file mode 100644 index 2462906c5..000000000 --- a/.tx/config +++ /dev/null @@ -1,4163 +0,0 @@ -[main] -host = https://www.transifex.com - -[o:python-doc:p:python-newest:r:about] -file_filter = .//LC_MESSAGES/about.po -source_file = pot/about.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:bugs] -file_filter = .//LC_MESSAGES/bugs.po -source_file = pot/bugs.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:c-api--abstract] -file_filter = .//LC_MESSAGES/c-api/abstract.po -source_file = pot/c-api/abstract.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:c-api--allocation] -file_filter = .//LC_MESSAGES/c-api/allocation.po -source_file = pot/c-api/allocation.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:c-api--apiabiversion] -file_filter = .//LC_MESSAGES/c-api/apiabiversion.po -source_file = pot/c-api/apiabiversion.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:c-api--arg] -file_filter = .//LC_MESSAGES/c-api/arg.po -source_file = pot/c-api/arg.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:c-api--bool] -file_filter = .//LC_MESSAGES/c-api/bool.po -source_file = pot/c-api/bool.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:c-api--buffer] -file_filter = .//LC_MESSAGES/c-api/buffer.po -source_file = pot/c-api/buffer.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:c-api--bytearray] -file_filter = .//LC_MESSAGES/c-api/bytearray.po -source_file = pot/c-api/bytearray.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:c-api--bytes] -file_filter = .//LC_MESSAGES/c-api/bytes.po -source_file = pot/c-api/bytes.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:c-api--call] -file_filter = .//LC_MESSAGES/c-api/call.po -source_file = pot/c-api/call.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:c-api--capsule] -file_filter = .//LC_MESSAGES/c-api/capsule.po -source_file = pot/c-api/capsule.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:c-api--cell] -file_filter = .//LC_MESSAGES/c-api/cell.po -source_file = pot/c-api/cell.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:c-api--code] -file_filter = .//LC_MESSAGES/c-api/code.po -source_file = pot/c-api/code.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:c-api--codec] -file_filter = .//LC_MESSAGES/c-api/codec.po -source_file = pot/c-api/codec.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:c-api--complex] -file_filter = .//LC_MESSAGES/c-api/complex.po -source_file = pot/c-api/complex.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:c-api--concrete] -file_filter = .//LC_MESSAGES/c-api/concrete.po -source_file = pot/c-api/concrete.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:c-api--contextvars] -file_filter = .//LC_MESSAGES/c-api/contextvars.po -source_file = pot/c-api/contextvars.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:c-api--conversion] -file_filter = .//LC_MESSAGES/c-api/conversion.po -source_file = pot/c-api/conversion.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:c-api--coro] -file_filter = .//LC_MESSAGES/c-api/coro.po -source_file = pot/c-api/coro.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:c-api--datetime] -file_filter = .//LC_MESSAGES/c-api/datetime.po -source_file = pot/c-api/datetime.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:c-api--descriptor] -file_filter = .//LC_MESSAGES/c-api/descriptor.po -source_file = pot/c-api/descriptor.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:c-api--dict] -file_filter = .//LC_MESSAGES/c-api/dict.po -source_file = pot/c-api/dict.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:c-api--exceptions] -file_filter = .//LC_MESSAGES/c-api/exceptions.po -source_file = pot/c-api/exceptions.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:c-api--extension-modules] -file_filter = .//LC_MESSAGES/c-api/extension-modules.po -source_file = pot/c-api/extension-modules.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:c-api--file] -file_filter = .//LC_MESSAGES/c-api/file.po -source_file = pot/c-api/file.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:c-api--float] -file_filter = .//LC_MESSAGES/c-api/float.po -source_file = pot/c-api/float.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:c-api--frame] -file_filter = .//LC_MESSAGES/c-api/frame.po -source_file = pot/c-api/frame.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:c-api--function] -file_filter = .//LC_MESSAGES/c-api/function.po -source_file = pot/c-api/function.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:c-api--gcsupport] -file_filter = .//LC_MESSAGES/c-api/gcsupport.po -source_file = pot/c-api/gcsupport.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:c-api--gen] -file_filter = .//LC_MESSAGES/c-api/gen.po -source_file = pot/c-api/gen.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:c-api--hash] -file_filter = .//LC_MESSAGES/c-api/hash.po -source_file = pot/c-api/hash.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:c-api--import] -file_filter = .//LC_MESSAGES/c-api/import.po -source_file = pot/c-api/import.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:c-api--index] -file_filter = .//LC_MESSAGES/c-api/index.po -source_file = pot/c-api/index.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:c-api--init] -file_filter = .//LC_MESSAGES/c-api/init.po -source_file = pot/c-api/init.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:c-api--init_config] -file_filter = .//LC_MESSAGES/c-api/init_config.po -source_file = pot/c-api/init_config.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:c-api--intro] -file_filter = .//LC_MESSAGES/c-api/intro.po -source_file = pot/c-api/intro.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:c-api--iter] -file_filter = .//LC_MESSAGES/c-api/iter.po -source_file = pot/c-api/iter.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:c-api--iterator] -file_filter = .//LC_MESSAGES/c-api/iterator.po -source_file = pot/c-api/iterator.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:c-api--lifecycle] -file_filter = .//LC_MESSAGES/c-api/lifecycle.po -source_file = pot/c-api/lifecycle.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:c-api--list] -file_filter = .//LC_MESSAGES/c-api/list.po -source_file = pot/c-api/list.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:c-api--long] -file_filter = .//LC_MESSAGES/c-api/long.po -source_file = pot/c-api/long.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:c-api--mapping] -file_filter = .//LC_MESSAGES/c-api/mapping.po -source_file = pot/c-api/mapping.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:c-api--marshal] -file_filter = .//LC_MESSAGES/c-api/marshal.po -source_file = pot/c-api/marshal.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:c-api--memory] -file_filter = .//LC_MESSAGES/c-api/memory.po -source_file = pot/c-api/memory.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:c-api--memoryview] -file_filter = .//LC_MESSAGES/c-api/memoryview.po -source_file = pot/c-api/memoryview.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:c-api--method] -file_filter = .//LC_MESSAGES/c-api/method.po -source_file = pot/c-api/method.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:c-api--module] -file_filter = .//LC_MESSAGES/c-api/module.po -source_file = pot/c-api/module.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:c-api--monitoring] -file_filter = .//LC_MESSAGES/c-api/monitoring.po -source_file = pot/c-api/monitoring.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:c-api--none] -file_filter = .//LC_MESSAGES/c-api/none.po -source_file = pot/c-api/none.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:c-api--number] -file_filter = .//LC_MESSAGES/c-api/number.po -source_file = pot/c-api/number.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:c-api--object] -file_filter = .//LC_MESSAGES/c-api/object.po -source_file = pot/c-api/object.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:c-api--objimpl] -file_filter = .//LC_MESSAGES/c-api/objimpl.po -source_file = pot/c-api/objimpl.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:c-api--perfmaps] -file_filter = .//LC_MESSAGES/c-api/perfmaps.po -source_file = pot/c-api/perfmaps.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:c-api--refcounting] -file_filter = .//LC_MESSAGES/c-api/refcounting.po -source_file = pot/c-api/refcounting.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:c-api--reflection] -file_filter = .//LC_MESSAGES/c-api/reflection.po -source_file = pot/c-api/reflection.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:c-api--sequence] -file_filter = .//LC_MESSAGES/c-api/sequence.po -source_file = pot/c-api/sequence.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:c-api--set] -file_filter = .//LC_MESSAGES/c-api/set.po -source_file = pot/c-api/set.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:c-api--slice] -file_filter = .//LC_MESSAGES/c-api/slice.po -source_file = pot/c-api/slice.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:c-api--stable] -file_filter = .//LC_MESSAGES/c-api/stable.po -source_file = pot/c-api/stable.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:c-api--structures] -file_filter = .//LC_MESSAGES/c-api/structures.po -source_file = pot/c-api/structures.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:c-api--sys] -file_filter = .//LC_MESSAGES/c-api/sys.po -source_file = pot/c-api/sys.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:c-api--time] -file_filter = .//LC_MESSAGES/c-api/time.po -source_file = pot/c-api/time.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:c-api--tuple] -file_filter = .//LC_MESSAGES/c-api/tuple.po -source_file = pot/c-api/tuple.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:c-api--type] -file_filter = .//LC_MESSAGES/c-api/type.po -source_file = pot/c-api/type.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:c-api--typehints] -file_filter = .//LC_MESSAGES/c-api/typehints.po -source_file = pot/c-api/typehints.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:c-api--typeobj] -file_filter = .//LC_MESSAGES/c-api/typeobj.po -source_file = pot/c-api/typeobj.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:c-api--unicode] -file_filter = .//LC_MESSAGES/c-api/unicode.po -source_file = pot/c-api/unicode.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:c-api--utilities] -file_filter = .//LC_MESSAGES/c-api/utilities.po -source_file = pot/c-api/utilities.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:c-api--veryhigh] -file_filter = .//LC_MESSAGES/c-api/veryhigh.po -source_file = pot/c-api/veryhigh.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:c-api--weakref] -file_filter = .//LC_MESSAGES/c-api/weakref.po -source_file = pot/c-api/weakref.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:contents] -file_filter = .//LC_MESSAGES/contents.po -source_file = pot/contents.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:copyright] -file_filter = .//LC_MESSAGES/copyright.po -source_file = pot/copyright.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:deprecations--c-api-pending-removal-in-3_14] -file_filter = .//LC_MESSAGES/deprecations/c-api-pending-removal-in-3.14.po -source_file = pot/deprecations/c-api-pending-removal-in-3.14.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:deprecations--c-api-pending-removal-in-3_15] -file_filter = .//LC_MESSAGES/deprecations/c-api-pending-removal-in-3.15.po -source_file = pot/deprecations/c-api-pending-removal-in-3.15.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:deprecations--c-api-pending-removal-in-3_18] -file_filter = .//LC_MESSAGES/deprecations/c-api-pending-removal-in-3.18.po -source_file = pot/deprecations/c-api-pending-removal-in-3.18.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:deprecations--c-api-pending-removal-in-future] -file_filter = .//LC_MESSAGES/deprecations/c-api-pending-removal-in-future.po -source_file = pot/deprecations/c-api-pending-removal-in-future.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:deprecations--index] -file_filter = .//LC_MESSAGES/deprecations/index.po -source_file = pot/deprecations/index.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:deprecations--pending-removal-in-3_13] -file_filter = .//LC_MESSAGES/deprecations/pending-removal-in-3.13.po -source_file = pot/deprecations/pending-removal-in-3.13.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:deprecations--pending-removal-in-3_14] -file_filter = .//LC_MESSAGES/deprecations/pending-removal-in-3.14.po -source_file = pot/deprecations/pending-removal-in-3.14.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:deprecations--pending-removal-in-3_15] -file_filter = .//LC_MESSAGES/deprecations/pending-removal-in-3.15.po -source_file = pot/deprecations/pending-removal-in-3.15.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:deprecations--pending-removal-in-3_16] -file_filter = .//LC_MESSAGES/deprecations/pending-removal-in-3.16.po -source_file = pot/deprecations/pending-removal-in-3.16.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:deprecations--pending-removal-in-3_17] -file_filter = .//LC_MESSAGES/deprecations/pending-removal-in-3.17.po -source_file = pot/deprecations/pending-removal-in-3.17.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:deprecations--pending-removal-in-3_19] -file_filter = .//LC_MESSAGES/deprecations/pending-removal-in-3.19.po -source_file = pot/deprecations/pending-removal-in-3.19.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:deprecations--pending-removal-in-future] -file_filter = .//LC_MESSAGES/deprecations/pending-removal-in-future.po -source_file = pot/deprecations/pending-removal-in-future.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:distributing--index] -file_filter = .//LC_MESSAGES/distributing/index.po -source_file = pot/distributing/index.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:extending--building] -file_filter = .//LC_MESSAGES/extending/building.po -source_file = pot/extending/building.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:extending--embedding] -file_filter = .//LC_MESSAGES/extending/embedding.po -source_file = pot/extending/embedding.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:extending--extending] -file_filter = .//LC_MESSAGES/extending/extending.po -source_file = pot/extending/extending.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:extending--index] -file_filter = .//LC_MESSAGES/extending/index.po -source_file = pot/extending/index.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:extending--newtypes] -file_filter = .//LC_MESSAGES/extending/newtypes.po -source_file = pot/extending/newtypes.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:extending--newtypes_tutorial] -file_filter = .//LC_MESSAGES/extending/newtypes_tutorial.po -source_file = pot/extending/newtypes_tutorial.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:extending--windows] -file_filter = .//LC_MESSAGES/extending/windows.po -source_file = pot/extending/windows.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:faq--design] -file_filter = .//LC_MESSAGES/faq/design.po -source_file = pot/faq/design.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:faq--extending] -file_filter = .//LC_MESSAGES/faq/extending.po -source_file = pot/faq/extending.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:faq--general] -file_filter = .//LC_MESSAGES/faq/general.po -source_file = pot/faq/general.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:faq--gui] -file_filter = .//LC_MESSAGES/faq/gui.po -source_file = pot/faq/gui.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:faq--index] -file_filter = .//LC_MESSAGES/faq/index.po -source_file = pot/faq/index.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:faq--installed] -file_filter = .//LC_MESSAGES/faq/installed.po -source_file = pot/faq/installed.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:faq--library] -file_filter = .//LC_MESSAGES/faq/library.po -source_file = pot/faq/library.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:faq--programming] -file_filter = .//LC_MESSAGES/faq/programming.po -source_file = pot/faq/programming.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:faq--windows] -file_filter = .//LC_MESSAGES/faq/windows.po -source_file = pot/faq/windows.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:glossary_] -file_filter = .//LC_MESSAGES/glossary.po -source_file = pot/glossary.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:howto--annotations] -file_filter = .//LC_MESSAGES/howto/annotations.po -source_file = pot/howto/annotations.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:howto--argparse] -file_filter = .//LC_MESSAGES/howto/argparse.po -source_file = pot/howto/argparse.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:howto--argparse-optparse] -file_filter = .//LC_MESSAGES/howto/argparse-optparse.po -source_file = pot/howto/argparse-optparse.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:howto--clinic] -file_filter = .//LC_MESSAGES/howto/clinic.po -source_file = pot/howto/clinic.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:howto--cporting] -file_filter = .//LC_MESSAGES/howto/cporting.po -source_file = pot/howto/cporting.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:howto--curses] -file_filter = .//LC_MESSAGES/howto/curses.po -source_file = pot/howto/curses.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:howto--descriptor] -file_filter = .//LC_MESSAGES/howto/descriptor.po -source_file = pot/howto/descriptor.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:howto--enum] -file_filter = .//LC_MESSAGES/howto/enum.po -source_file = pot/howto/enum.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:howto--free-threading-extensions] -file_filter = .//LC_MESSAGES/howto/free-threading-extensions.po -source_file = pot/howto/free-threading-extensions.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:howto--free-threading-python] -file_filter = .//LC_MESSAGES/howto/free-threading-python.po -source_file = pot/howto/free-threading-python.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:howto--functional] -file_filter = .//LC_MESSAGES/howto/functional.po -source_file = pot/howto/functional.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:howto--gdb_helpers] -file_filter = .//LC_MESSAGES/howto/gdb_helpers.po -source_file = pot/howto/gdb_helpers.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:howto--index] -file_filter = .//LC_MESSAGES/howto/index.po -source_file = pot/howto/index.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:howto--instrumentation] -file_filter = .//LC_MESSAGES/howto/instrumentation.po -source_file = pot/howto/instrumentation.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:howto--ipaddress] -file_filter = .//LC_MESSAGES/howto/ipaddress.po -source_file = pot/howto/ipaddress.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:howto--isolating-extensions] -file_filter = .//LC_MESSAGES/howto/isolating-extensions.po -source_file = pot/howto/isolating-extensions.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:howto--logging] -file_filter = .//LC_MESSAGES/howto/logging.po -source_file = pot/howto/logging.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:howto--logging-cookbook] -file_filter = .//LC_MESSAGES/howto/logging-cookbook.po -source_file = pot/howto/logging-cookbook.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:howto--mro] -file_filter = .//LC_MESSAGES/howto/mro.po -source_file = pot/howto/mro.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:howto--perf_profiling] -file_filter = .//LC_MESSAGES/howto/perf_profiling.po -source_file = pot/howto/perf_profiling.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:howto--pyporting] -file_filter = .//LC_MESSAGES/howto/pyporting.po -source_file = pot/howto/pyporting.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:howto--regex] -file_filter = .//LC_MESSAGES/howto/regex.po -source_file = pot/howto/regex.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:howto--remote_debugging] -file_filter = .//LC_MESSAGES/howto/remote_debugging.po -source_file = pot/howto/remote_debugging.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:howto--sockets] -file_filter = .//LC_MESSAGES/howto/sockets.po -source_file = pot/howto/sockets.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:howto--sorting] -file_filter = .//LC_MESSAGES/howto/sorting.po -source_file = pot/howto/sorting.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:howto--timerfd] -file_filter = .//LC_MESSAGES/howto/timerfd.po -source_file = pot/howto/timerfd.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:howto--unicode] -file_filter = .//LC_MESSAGES/howto/unicode.po -source_file = pot/howto/unicode.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:howto--urllib2] -file_filter = .//LC_MESSAGES/howto/urllib2.po -source_file = pot/howto/urllib2.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:installing--index] -file_filter = .//LC_MESSAGES/installing/index.po -source_file = pot/installing/index.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--__future__] -file_filter = .//LC_MESSAGES/library/__future__.po -source_file = pot/library/__future__.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--__main__] -file_filter = .//LC_MESSAGES/library/__main__.po -source_file = pot/library/__main__.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--_thread] -file_filter = .//LC_MESSAGES/library/_thread.po -source_file = pot/library/_thread.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--abc] -file_filter = .//LC_MESSAGES/library/abc.po -source_file = pot/library/abc.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--aifc] -file_filter = .//LC_MESSAGES/library/aifc.po -source_file = pot/library/aifc.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--allos] -file_filter = .//LC_MESSAGES/library/allos.po -source_file = pot/library/allos.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--annotationlib] -file_filter = .//LC_MESSAGES/library/annotationlib.po -source_file = pot/library/annotationlib.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--archiving] -file_filter = .//LC_MESSAGES/library/archiving.po -source_file = pot/library/archiving.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--argparse] -file_filter = .//LC_MESSAGES/library/argparse.po -source_file = pot/library/argparse.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--array] -file_filter = .//LC_MESSAGES/library/array.po -source_file = pot/library/array.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--ast] -file_filter = .//LC_MESSAGES/library/ast.po -source_file = pot/library/ast.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--asynchat] -file_filter = .//LC_MESSAGES/library/asynchat.po -source_file = pot/library/asynchat.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--asyncio] -file_filter = .//LC_MESSAGES/library/asyncio.po -source_file = pot/library/asyncio.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--asyncio-api-index] -file_filter = .//LC_MESSAGES/library/asyncio-api-index.po -source_file = pot/library/asyncio-api-index.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--asyncio-dev] -file_filter = .//LC_MESSAGES/library/asyncio-dev.po -source_file = pot/library/asyncio-dev.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--asyncio-eventloop] -file_filter = .//LC_MESSAGES/library/asyncio-eventloop.po -source_file = pot/library/asyncio-eventloop.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--asyncio-exceptions] -file_filter = .//LC_MESSAGES/library/asyncio-exceptions.po -source_file = pot/library/asyncio-exceptions.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--asyncio-extending] -file_filter = .//LC_MESSAGES/library/asyncio-extending.po -source_file = pot/library/asyncio-extending.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--asyncio-future] -file_filter = .//LC_MESSAGES/library/asyncio-future.po -source_file = pot/library/asyncio-future.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--asyncio-graph] -file_filter = .//LC_MESSAGES/library/asyncio-graph.po -source_file = pot/library/asyncio-graph.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--asyncio-llapi-index] -file_filter = .//LC_MESSAGES/library/asyncio-llapi-index.po -source_file = pot/library/asyncio-llapi-index.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--asyncio-platforms] -file_filter = .//LC_MESSAGES/library/asyncio-platforms.po -source_file = pot/library/asyncio-platforms.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--asyncio-policy] -file_filter = .//LC_MESSAGES/library/asyncio-policy.po -source_file = pot/library/asyncio-policy.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--asyncio-protocol] -file_filter = .//LC_MESSAGES/library/asyncio-protocol.po -source_file = pot/library/asyncio-protocol.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--asyncio-queue] -file_filter = .//LC_MESSAGES/library/asyncio-queue.po -source_file = pot/library/asyncio-queue.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--asyncio-runner] -file_filter = .//LC_MESSAGES/library/asyncio-runner.po -source_file = pot/library/asyncio-runner.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--asyncio-stream] -file_filter = .//LC_MESSAGES/library/asyncio-stream.po -source_file = pot/library/asyncio-stream.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--asyncio-subprocess] -file_filter = .//LC_MESSAGES/library/asyncio-subprocess.po -source_file = pot/library/asyncio-subprocess.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--asyncio-sync] -file_filter = .//LC_MESSAGES/library/asyncio-sync.po -source_file = pot/library/asyncio-sync.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--asyncio-task] -file_filter = .//LC_MESSAGES/library/asyncio-task.po -source_file = pot/library/asyncio-task.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--asyncore] -file_filter = .//LC_MESSAGES/library/asyncore.po -source_file = pot/library/asyncore.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--atexit] -file_filter = .//LC_MESSAGES/library/atexit.po -source_file = pot/library/atexit.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--audioop] -file_filter = .//LC_MESSAGES/library/audioop.po -source_file = pot/library/audioop.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--audit_events] -file_filter = .//LC_MESSAGES/library/audit_events.po -source_file = pot/library/audit_events.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--base64] -file_filter = .//LC_MESSAGES/library/base64.po -source_file = pot/library/base64.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--bdb] -file_filter = .//LC_MESSAGES/library/bdb.po -source_file = pot/library/bdb.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--binary] -file_filter = .//LC_MESSAGES/library/binary.po -source_file = pot/library/binary.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--binascii] -file_filter = .//LC_MESSAGES/library/binascii.po -source_file = pot/library/binascii.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--bisect] -file_filter = .//LC_MESSAGES/library/bisect.po -source_file = pot/library/bisect.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--builtins] -file_filter = .//LC_MESSAGES/library/builtins.po -source_file = pot/library/builtins.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--bz2] -file_filter = .//LC_MESSAGES/library/bz2.po -source_file = pot/library/bz2.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--calendar] -file_filter = .//LC_MESSAGES/library/calendar.po -source_file = pot/library/calendar.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--cgi] -file_filter = .//LC_MESSAGES/library/cgi.po -source_file = pot/library/cgi.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--cgitb] -file_filter = .//LC_MESSAGES/library/cgitb.po -source_file = pot/library/cgitb.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--chunk] -file_filter = .//LC_MESSAGES/library/chunk.po -source_file = pot/library/chunk.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--cmath] -file_filter = .//LC_MESSAGES/library/cmath.po -source_file = pot/library/cmath.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--cmd] -file_filter = .//LC_MESSAGES/library/cmd.po -source_file = pot/library/cmd.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--cmdline] -file_filter = .//LC_MESSAGES/library/cmdline.po -source_file = pot/library/cmdline.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--cmdlinelibs] -file_filter = .//LC_MESSAGES/library/cmdlinelibs.po -source_file = pot/library/cmdlinelibs.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--code] -file_filter = .//LC_MESSAGES/library/code.po -source_file = pot/library/code.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--codecs] -file_filter = .//LC_MESSAGES/library/codecs.po -source_file = pot/library/codecs.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--codeop] -file_filter = .//LC_MESSAGES/library/codeop.po -source_file = pot/library/codeop.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--collections] -file_filter = .//LC_MESSAGES/library/collections.po -source_file = pot/library/collections.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--collections_abc] -file_filter = .//LC_MESSAGES/library/collections.abc.po -source_file = pot/library/collections.abc.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--colorsys] -file_filter = .//LC_MESSAGES/library/colorsys.po -source_file = pot/library/colorsys.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--compileall] -file_filter = .//LC_MESSAGES/library/compileall.po -source_file = pot/library/compileall.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--compression] -file_filter = .//LC_MESSAGES/library/compression.po -source_file = pot/library/compression.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--compression_zstd] -file_filter = .//LC_MESSAGES/library/compression.zstd.po -source_file = pot/library/compression.zstd.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--concurrency] -file_filter = .//LC_MESSAGES/library/concurrency.po -source_file = pot/library/concurrency.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--concurrent] -file_filter = .//LC_MESSAGES/library/concurrent.po -source_file = pot/library/concurrent.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--concurrent_futures] -file_filter = .//LC_MESSAGES/library/concurrent.futures.po -source_file = pot/library/concurrent.futures.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--concurrent_interpreters] -file_filter = .//LC_MESSAGES/library/concurrent.interpreters.po -source_file = pot/library/concurrent.interpreters.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--configparser] -file_filter = .//LC_MESSAGES/library/configparser.po -source_file = pot/library/configparser.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--constants] -file_filter = .//LC_MESSAGES/library/constants.po -source_file = pot/library/constants.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--contextlib] -file_filter = .//LC_MESSAGES/library/contextlib.po -source_file = pot/library/contextlib.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--contextvars] -file_filter = .//LC_MESSAGES/library/contextvars.po -source_file = pot/library/contextvars.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--copy] -file_filter = .//LC_MESSAGES/library/copy.po -source_file = pot/library/copy.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--copyreg] -file_filter = .//LC_MESSAGES/library/copyreg.po -source_file = pot/library/copyreg.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--crypt] -file_filter = .//LC_MESSAGES/library/crypt.po -source_file = pot/library/crypt.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--crypto] -file_filter = .//LC_MESSAGES/library/crypto.po -source_file = pot/library/crypto.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--csv] -file_filter = .//LC_MESSAGES/library/csv.po -source_file = pot/library/csv.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--ctypes] -file_filter = .//LC_MESSAGES/library/ctypes.po -source_file = pot/library/ctypes.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--curses] -file_filter = .//LC_MESSAGES/library/curses.po -source_file = pot/library/curses.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--curses_ascii] -file_filter = .//LC_MESSAGES/library/curses.ascii.po -source_file = pot/library/curses.ascii.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--curses_panel] -file_filter = .//LC_MESSAGES/library/curses.panel.po -source_file = pot/library/curses.panel.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--custominterp] -file_filter = .//LC_MESSAGES/library/custominterp.po -source_file = pot/library/custominterp.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--dataclasses] -file_filter = .//LC_MESSAGES/library/dataclasses.po -source_file = pot/library/dataclasses.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--datatypes] -file_filter = .//LC_MESSAGES/library/datatypes.po -source_file = pot/library/datatypes.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--datetime] -file_filter = .//LC_MESSAGES/library/datetime.po -source_file = pot/library/datetime.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--dbm] -file_filter = .//LC_MESSAGES/library/dbm.po -source_file = pot/library/dbm.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--debug] -file_filter = .//LC_MESSAGES/library/debug.po -source_file = pot/library/debug.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--decimal] -file_filter = .//LC_MESSAGES/library/decimal.po -source_file = pot/library/decimal.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--development] -file_filter = .//LC_MESSAGES/library/development.po -source_file = pot/library/development.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--devmode] -file_filter = .//LC_MESSAGES/library/devmode.po -source_file = pot/library/devmode.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--dialog] -file_filter = .//LC_MESSAGES/library/dialog.po -source_file = pot/library/dialog.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--difflib] -file_filter = .//LC_MESSAGES/library/difflib.po -source_file = pot/library/difflib.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--dis] -file_filter = .//LC_MESSAGES/library/dis.po -source_file = pot/library/dis.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--distribution] -file_filter = .//LC_MESSAGES/library/distribution.po -source_file = pot/library/distribution.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--distutils] -file_filter = .//LC_MESSAGES/library/distutils.po -source_file = pot/library/distutils.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--doctest] -file_filter = .//LC_MESSAGES/library/doctest.po -source_file = pot/library/doctest.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--email] -file_filter = .//LC_MESSAGES/library/email.po -source_file = pot/library/email.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--email_charset] -file_filter = .//LC_MESSAGES/library/email.charset.po -source_file = pot/library/email.charset.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--email_compat32-message] -file_filter = .//LC_MESSAGES/library/email.compat32-message.po -source_file = pot/library/email.compat32-message.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--email_contentmanager] -file_filter = .//LC_MESSAGES/library/email.contentmanager.po -source_file = pot/library/email.contentmanager.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--email_encoders] -file_filter = .//LC_MESSAGES/library/email.encoders.po -source_file = pot/library/email.encoders.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--email_errors] -file_filter = .//LC_MESSAGES/library/email.errors.po -source_file = pot/library/email.errors.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--email_examples] -file_filter = .//LC_MESSAGES/library/email.examples.po -source_file = pot/library/email.examples.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--email_generator] -file_filter = .//LC_MESSAGES/library/email.generator.po -source_file = pot/library/email.generator.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--email_header] -file_filter = .//LC_MESSAGES/library/email.header.po -source_file = pot/library/email.header.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--email_headerregistry] -file_filter = .//LC_MESSAGES/library/email.headerregistry.po -source_file = pot/library/email.headerregistry.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--email_iterators] -file_filter = .//LC_MESSAGES/library/email.iterators.po -source_file = pot/library/email.iterators.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--email_message] -file_filter = .//LC_MESSAGES/library/email.message.po -source_file = pot/library/email.message.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--email_mime] -file_filter = .//LC_MESSAGES/library/email.mime.po -source_file = pot/library/email.mime.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--email_parser] -file_filter = .//LC_MESSAGES/library/email.parser.po -source_file = pot/library/email.parser.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--email_policy] -file_filter = .//LC_MESSAGES/library/email.policy.po -source_file = pot/library/email.policy.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--email_utils] -file_filter = .//LC_MESSAGES/library/email.utils.po -source_file = pot/library/email.utils.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--ensurepip] -file_filter = .//LC_MESSAGES/library/ensurepip.po -source_file = pot/library/ensurepip.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--enum] -file_filter = .//LC_MESSAGES/library/enum.po -source_file = pot/library/enum.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--errno] -file_filter = .//LC_MESSAGES/library/errno.po -source_file = pot/library/errno.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--exceptions] -file_filter = .//LC_MESSAGES/library/exceptions.po -source_file = pot/library/exceptions.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--faulthandler] -file_filter = .//LC_MESSAGES/library/faulthandler.po -source_file = pot/library/faulthandler.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--fcntl] -file_filter = .//LC_MESSAGES/library/fcntl.po -source_file = pot/library/fcntl.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--filecmp] -file_filter = .//LC_MESSAGES/library/filecmp.po -source_file = pot/library/filecmp.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--fileformats] -file_filter = .//LC_MESSAGES/library/fileformats.po -source_file = pot/library/fileformats.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--fileinput] -file_filter = .//LC_MESSAGES/library/fileinput.po -source_file = pot/library/fileinput.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--filesys] -file_filter = .//LC_MESSAGES/library/filesys.po -source_file = pot/library/filesys.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--fnmatch] -file_filter = .//LC_MESSAGES/library/fnmatch.po -source_file = pot/library/fnmatch.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--fractions] -file_filter = .//LC_MESSAGES/library/fractions.po -source_file = pot/library/fractions.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--frameworks] -file_filter = .//LC_MESSAGES/library/frameworks.po -source_file = pot/library/frameworks.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--ftplib] -file_filter = .//LC_MESSAGES/library/ftplib.po -source_file = pot/library/ftplib.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--functional] -file_filter = .//LC_MESSAGES/library/functional.po -source_file = pot/library/functional.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--functions] -file_filter = .//LC_MESSAGES/library/functions.po -source_file = pot/library/functions.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--functools] -file_filter = .//LC_MESSAGES/library/functools.po -source_file = pot/library/functools.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--gc] -file_filter = .//LC_MESSAGES/library/gc.po -source_file = pot/library/gc.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--getopt] -file_filter = .//LC_MESSAGES/library/getopt.po -source_file = pot/library/getopt.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--getpass] -file_filter = .//LC_MESSAGES/library/getpass.po -source_file = pot/library/getpass.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--gettext] -file_filter = .//LC_MESSAGES/library/gettext.po -source_file = pot/library/gettext.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--glob] -file_filter = .//LC_MESSAGES/library/glob.po -source_file = pot/library/glob.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--graphlib] -file_filter = .//LC_MESSAGES/library/graphlib.po -source_file = pot/library/graphlib.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--grp] -file_filter = .//LC_MESSAGES/library/grp.po -source_file = pot/library/grp.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--gzip] -file_filter = .//LC_MESSAGES/library/gzip.po -source_file = pot/library/gzip.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--hashlib] -file_filter = .//LC_MESSAGES/library/hashlib.po -source_file = pot/library/hashlib.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--heapq] -file_filter = .//LC_MESSAGES/library/heapq.po -source_file = pot/library/heapq.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--hmac] -file_filter = .//LC_MESSAGES/library/hmac.po -source_file = pot/library/hmac.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--html] -file_filter = .//LC_MESSAGES/library/html.po -source_file = pot/library/html.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--html_entities] -file_filter = .//LC_MESSAGES/library/html.entities.po -source_file = pot/library/html.entities.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--html_parser] -file_filter = .//LC_MESSAGES/library/html.parser.po -source_file = pot/library/html.parser.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--http] -file_filter = .//LC_MESSAGES/library/http.po -source_file = pot/library/http.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--http_client] -file_filter = .//LC_MESSAGES/library/http.client.po -source_file = pot/library/http.client.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--http_cookiejar] -file_filter = .//LC_MESSAGES/library/http.cookiejar.po -source_file = pot/library/http.cookiejar.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--http_cookies] -file_filter = .//LC_MESSAGES/library/http.cookies.po -source_file = pot/library/http.cookies.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--http_server] -file_filter = .//LC_MESSAGES/library/http.server.po -source_file = pot/library/http.server.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--i18n] -file_filter = .//LC_MESSAGES/library/i18n.po -source_file = pot/library/i18n.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--idle] -file_filter = .//LC_MESSAGES/library/idle.po -source_file = pot/library/idle.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--imaplib] -file_filter = .//LC_MESSAGES/library/imaplib.po -source_file = pot/library/imaplib.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--imghdr] -file_filter = .//LC_MESSAGES/library/imghdr.po -source_file = pot/library/imghdr.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--imp] -file_filter = .//LC_MESSAGES/library/imp.po -source_file = pot/library/imp.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--importlib] -file_filter = .//LC_MESSAGES/library/importlib.po -source_file = pot/library/importlib.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--importlib_metadata] -file_filter = .//LC_MESSAGES/library/importlib.metadata.po -source_file = pot/library/importlib.metadata.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--importlib_resources] -file_filter = .//LC_MESSAGES/library/importlib.resources.po -source_file = pot/library/importlib.resources.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--importlib_resources_abc] -file_filter = .//LC_MESSAGES/library/importlib.resources.abc.po -source_file = pot/library/importlib.resources.abc.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--index] -file_filter = .//LC_MESSAGES/library/index.po -source_file = pot/library/index.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--inspect] -file_filter = .//LC_MESSAGES/library/inspect.po -source_file = pot/library/inspect.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--internet] -file_filter = .//LC_MESSAGES/library/internet.po -source_file = pot/library/internet.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--intro] -file_filter = .//LC_MESSAGES/library/intro.po -source_file = pot/library/intro.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--io] -file_filter = .//LC_MESSAGES/library/io.po -source_file = pot/library/io.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--ipaddress] -file_filter = .//LC_MESSAGES/library/ipaddress.po -source_file = pot/library/ipaddress.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--ipc] -file_filter = .//LC_MESSAGES/library/ipc.po -source_file = pot/library/ipc.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--itertools] -file_filter = .//LC_MESSAGES/library/itertools.po -source_file = pot/library/itertools.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--json] -file_filter = .//LC_MESSAGES/library/json.po -source_file = pot/library/json.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--keyword] -file_filter = .//LC_MESSAGES/library/keyword.po -source_file = pot/library/keyword.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--language] -file_filter = .//LC_MESSAGES/library/language.po -source_file = pot/library/language.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--linecache] -file_filter = .//LC_MESSAGES/library/linecache.po -source_file = pot/library/linecache.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--locale] -file_filter = .//LC_MESSAGES/library/locale.po -source_file = pot/library/locale.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--logging] -file_filter = .//LC_MESSAGES/library/logging.po -source_file = pot/library/logging.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--logging_config] -file_filter = .//LC_MESSAGES/library/logging.config.po -source_file = pot/library/logging.config.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--logging_handlers] -file_filter = .//LC_MESSAGES/library/logging.handlers.po -source_file = pot/library/logging.handlers.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--lzma] -file_filter = .//LC_MESSAGES/library/lzma.po -source_file = pot/library/lzma.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--mailbox] -file_filter = .//LC_MESSAGES/library/mailbox.po -source_file = pot/library/mailbox.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--mailcap] -file_filter = .//LC_MESSAGES/library/mailcap.po -source_file = pot/library/mailcap.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--markup] -file_filter = .//LC_MESSAGES/library/markup.po -source_file = pot/library/markup.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--marshal] -file_filter = .//LC_MESSAGES/library/marshal.po -source_file = pot/library/marshal.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--math] -file_filter = .//LC_MESSAGES/library/math.po -source_file = pot/library/math.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--mimetypes] -file_filter = .//LC_MESSAGES/library/mimetypes.po -source_file = pot/library/mimetypes.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--mm] -file_filter = .//LC_MESSAGES/library/mm.po -source_file = pot/library/mm.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--mmap] -file_filter = .//LC_MESSAGES/library/mmap.po -source_file = pot/library/mmap.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--modulefinder] -file_filter = .//LC_MESSAGES/library/modulefinder.po -source_file = pot/library/modulefinder.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--modules] -file_filter = .//LC_MESSAGES/library/modules.po -source_file = pot/library/modules.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--msilib] -file_filter = .//LC_MESSAGES/library/msilib.po -source_file = pot/library/msilib.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--msvcrt] -file_filter = .//LC_MESSAGES/library/msvcrt.po -source_file = pot/library/msvcrt.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--multiprocessing] -file_filter = .//LC_MESSAGES/library/multiprocessing.po -source_file = pot/library/multiprocessing.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--multiprocessing_shared_memory] -file_filter = .//LC_MESSAGES/library/multiprocessing.shared_memory.po -source_file = pot/library/multiprocessing.shared_memory.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--netdata] -file_filter = .//LC_MESSAGES/library/netdata.po -source_file = pot/library/netdata.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--netrc] -file_filter = .//LC_MESSAGES/library/netrc.po -source_file = pot/library/netrc.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--nis] -file_filter = .//LC_MESSAGES/library/nis.po -source_file = pot/library/nis.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--nntplib] -file_filter = .//LC_MESSAGES/library/nntplib.po -source_file = pot/library/nntplib.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--numbers] -file_filter = .//LC_MESSAGES/library/numbers.po -source_file = pot/library/numbers.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--numeric] -file_filter = .//LC_MESSAGES/library/numeric.po -source_file = pot/library/numeric.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--operator] -file_filter = .//LC_MESSAGES/library/operator.po -source_file = pot/library/operator.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--optparse] -file_filter = .//LC_MESSAGES/library/optparse.po -source_file = pot/library/optparse.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--os] -file_filter = .//LC_MESSAGES/library/os.po -source_file = pot/library/os.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--os_path] -file_filter = .//LC_MESSAGES/library/os.path.po -source_file = pot/library/os.path.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--ossaudiodev] -file_filter = .//LC_MESSAGES/library/ossaudiodev.po -source_file = pot/library/ossaudiodev.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--pathlib] -file_filter = .//LC_MESSAGES/library/pathlib.po -source_file = pot/library/pathlib.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--pdb] -file_filter = .//LC_MESSAGES/library/pdb.po -source_file = pot/library/pdb.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--persistence] -file_filter = .//LC_MESSAGES/library/persistence.po -source_file = pot/library/persistence.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--pickle] -file_filter = .//LC_MESSAGES/library/pickle.po -source_file = pot/library/pickle.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--pickletools] -file_filter = .//LC_MESSAGES/library/pickletools.po -source_file = pot/library/pickletools.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--pipes] -file_filter = .//LC_MESSAGES/library/pipes.po -source_file = pot/library/pipes.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--pkgutil] -file_filter = .//LC_MESSAGES/library/pkgutil.po -source_file = pot/library/pkgutil.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--platform] -file_filter = .//LC_MESSAGES/library/platform.po -source_file = pot/library/platform.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--plistlib] -file_filter = .//LC_MESSAGES/library/plistlib.po -source_file = pot/library/plistlib.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--poplib] -file_filter = .//LC_MESSAGES/library/poplib.po -source_file = pot/library/poplib.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--posix] -file_filter = .//LC_MESSAGES/library/posix.po -source_file = pot/library/posix.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--pprint] -file_filter = .//LC_MESSAGES/library/pprint.po -source_file = pot/library/pprint.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--profile] -file_filter = .//LC_MESSAGES/library/profile.po -source_file = pot/library/profile.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--pty] -file_filter = .//LC_MESSAGES/library/pty.po -source_file = pot/library/pty.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--pwd] -file_filter = .//LC_MESSAGES/library/pwd.po -source_file = pot/library/pwd.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--py_compile] -file_filter = .//LC_MESSAGES/library/py_compile.po -source_file = pot/library/py_compile.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--pyclbr] -file_filter = .//LC_MESSAGES/library/pyclbr.po -source_file = pot/library/pyclbr.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--pydoc] -file_filter = .//LC_MESSAGES/library/pydoc.po -source_file = pot/library/pydoc.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--pyexpat] -file_filter = .//LC_MESSAGES/library/pyexpat.po -source_file = pot/library/pyexpat.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--python] -file_filter = .//LC_MESSAGES/library/python.po -source_file = pot/library/python.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--queue] -file_filter = .//LC_MESSAGES/library/queue.po -source_file = pot/library/queue.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--quopri] -file_filter = .//LC_MESSAGES/library/quopri.po -source_file = pot/library/quopri.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--random] -file_filter = .//LC_MESSAGES/library/random.po -source_file = pot/library/random.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--re] -file_filter = .//LC_MESSAGES/library/re.po -source_file = pot/library/re.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--readline] -file_filter = .//LC_MESSAGES/library/readline.po -source_file = pot/library/readline.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--removed] -file_filter = .//LC_MESSAGES/library/removed.po -source_file = pot/library/removed.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--reprlib] -file_filter = .//LC_MESSAGES/library/reprlib.po -source_file = pot/library/reprlib.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--resource] -file_filter = .//LC_MESSAGES/library/resource.po -source_file = pot/library/resource.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--rlcompleter] -file_filter = .//LC_MESSAGES/library/rlcompleter.po -source_file = pot/library/rlcompleter.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--runpy] -file_filter = .//LC_MESSAGES/library/runpy.po -source_file = pot/library/runpy.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--sched] -file_filter = .//LC_MESSAGES/library/sched.po -source_file = pot/library/sched.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--secrets] -file_filter = .//LC_MESSAGES/library/secrets.po -source_file = pot/library/secrets.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--security_warnings] -file_filter = .//LC_MESSAGES/library/security_warnings.po -source_file = pot/library/security_warnings.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--select] -file_filter = .//LC_MESSAGES/library/select.po -source_file = pot/library/select.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--selectors] -file_filter = .//LC_MESSAGES/library/selectors.po -source_file = pot/library/selectors.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--shelve] -file_filter = .//LC_MESSAGES/library/shelve.po -source_file = pot/library/shelve.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--shlex] -file_filter = .//LC_MESSAGES/library/shlex.po -source_file = pot/library/shlex.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--shutil] -file_filter = .//LC_MESSAGES/library/shutil.po -source_file = pot/library/shutil.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--signal] -file_filter = .//LC_MESSAGES/library/signal.po -source_file = pot/library/signal.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--site] -file_filter = .//LC_MESSAGES/library/site.po -source_file = pot/library/site.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--smtpd] -file_filter = .//LC_MESSAGES/library/smtpd.po -source_file = pot/library/smtpd.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--smtplib] -file_filter = .//LC_MESSAGES/library/smtplib.po -source_file = pot/library/smtplib.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--sndhdr] -file_filter = .//LC_MESSAGES/library/sndhdr.po -source_file = pot/library/sndhdr.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--socket] -file_filter = .//LC_MESSAGES/library/socket.po -source_file = pot/library/socket.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--socketserver] -file_filter = .//LC_MESSAGES/library/socketserver.po -source_file = pot/library/socketserver.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--spwd] -file_filter = .//LC_MESSAGES/library/spwd.po -source_file = pot/library/spwd.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--sqlite3] -file_filter = .//LC_MESSAGES/library/sqlite3.po -source_file = pot/library/sqlite3.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--ssl] -file_filter = .//LC_MESSAGES/library/ssl.po -source_file = pot/library/ssl.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--stat] -file_filter = .//LC_MESSAGES/library/stat.po -source_file = pot/library/stat.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--statistics] -file_filter = .//LC_MESSAGES/library/statistics.po -source_file = pot/library/statistics.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--stdtypes] -file_filter = .//LC_MESSAGES/library/stdtypes.po -source_file = pot/library/stdtypes.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--string] -file_filter = .//LC_MESSAGES/library/string.po -source_file = pot/library/string.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--stringprep] -file_filter = .//LC_MESSAGES/library/stringprep.po -source_file = pot/library/stringprep.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--struct] -file_filter = .//LC_MESSAGES/library/struct.po -source_file = pot/library/struct.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--subprocess] -file_filter = .//LC_MESSAGES/library/subprocess.po -source_file = pot/library/subprocess.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--sunau] -file_filter = .//LC_MESSAGES/library/sunau.po -source_file = pot/library/sunau.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--superseded] -file_filter = .//LC_MESSAGES/library/superseded.po -source_file = pot/library/superseded.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--symtable] -file_filter = .//LC_MESSAGES/library/symtable.po -source_file = pot/library/symtable.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--sys] -file_filter = .//LC_MESSAGES/library/sys.po -source_file = pot/library/sys.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--sys_monitoring] -file_filter = .//LC_MESSAGES/library/sys.monitoring.po -source_file = pot/library/sys.monitoring.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--sys_path_init] -file_filter = .//LC_MESSAGES/library/sys_path_init.po -source_file = pot/library/sys_path_init.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--sysconfig] -file_filter = .//LC_MESSAGES/library/sysconfig.po -source_file = pot/library/sysconfig.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--syslog] -file_filter = .//LC_MESSAGES/library/syslog.po -source_file = pot/library/syslog.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--tabnanny] -file_filter = .//LC_MESSAGES/library/tabnanny.po -source_file = pot/library/tabnanny.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--tarfile] -file_filter = .//LC_MESSAGES/library/tarfile.po -source_file = pot/library/tarfile.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--telnetlib] -file_filter = .//LC_MESSAGES/library/telnetlib.po -source_file = pot/library/telnetlib.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--tempfile] -file_filter = .//LC_MESSAGES/library/tempfile.po -source_file = pot/library/tempfile.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--termios] -file_filter = .//LC_MESSAGES/library/termios.po -source_file = pot/library/termios.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--test] -file_filter = .//LC_MESSAGES/library/test.po -source_file = pot/library/test.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--text] -file_filter = .//LC_MESSAGES/library/text.po -source_file = pot/library/text.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--textwrap] -file_filter = .//LC_MESSAGES/library/textwrap.po -source_file = pot/library/textwrap.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--threading] -file_filter = .//LC_MESSAGES/library/threading.po -source_file = pot/library/threading.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--time] -file_filter = .//LC_MESSAGES/library/time.po -source_file = pot/library/time.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--timeit] -file_filter = .//LC_MESSAGES/library/timeit.po -source_file = pot/library/timeit.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--tk] -file_filter = .//LC_MESSAGES/library/tk.po -source_file = pot/library/tk.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--tkinter] -file_filter = .//LC_MESSAGES/library/tkinter.po -source_file = pot/library/tkinter.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--tkinter_colorchooser] -file_filter = .//LC_MESSAGES/library/tkinter.colorchooser.po -source_file = pot/library/tkinter.colorchooser.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--tkinter_dnd] -file_filter = .//LC_MESSAGES/library/tkinter.dnd.po -source_file = pot/library/tkinter.dnd.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--tkinter_font] -file_filter = .//LC_MESSAGES/library/tkinter.font.po -source_file = pot/library/tkinter.font.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--tkinter_messagebox] -file_filter = .//LC_MESSAGES/library/tkinter.messagebox.po -source_file = pot/library/tkinter.messagebox.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--tkinter_scrolledtext] -file_filter = .//LC_MESSAGES/library/tkinter.scrolledtext.po -source_file = pot/library/tkinter.scrolledtext.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--tkinter_ttk] -file_filter = .//LC_MESSAGES/library/tkinter.ttk.po -source_file = pot/library/tkinter.ttk.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--token] -file_filter = .//LC_MESSAGES/library/token.po -source_file = pot/library/token.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--tokenize] -file_filter = .//LC_MESSAGES/library/tokenize.po -source_file = pot/library/tokenize.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--tomllib] -file_filter = .//LC_MESSAGES/library/tomllib.po -source_file = pot/library/tomllib.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--trace] -file_filter = .//LC_MESSAGES/library/trace.po -source_file = pot/library/trace.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--traceback] -file_filter = .//LC_MESSAGES/library/traceback.po -source_file = pot/library/traceback.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--tracemalloc] -file_filter = .//LC_MESSAGES/library/tracemalloc.po -source_file = pot/library/tracemalloc.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--tty] -file_filter = .//LC_MESSAGES/library/tty.po -source_file = pot/library/tty.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--turtle] -file_filter = .//LC_MESSAGES/library/turtle.po -source_file = pot/library/turtle.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--types] -file_filter = .//LC_MESSAGES/library/types.po -source_file = pot/library/types.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--typing] -file_filter = .//LC_MESSAGES/library/typing.po -source_file = pot/library/typing.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--unicodedata] -file_filter = .//LC_MESSAGES/library/unicodedata.po -source_file = pot/library/unicodedata.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--unittest] -file_filter = .//LC_MESSAGES/library/unittest.po -source_file = pot/library/unittest.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--unittest_mock] -file_filter = .//LC_MESSAGES/library/unittest.mock.po -source_file = pot/library/unittest.mock.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--unittest_mock-examples] -file_filter = .//LC_MESSAGES/library/unittest.mock-examples.po -source_file = pot/library/unittest.mock-examples.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--unix] -file_filter = .//LC_MESSAGES/library/unix.po -source_file = pot/library/unix.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--urllib] -file_filter = .//LC_MESSAGES/library/urllib.po -source_file = pot/library/urllib.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--urllib_error] -file_filter = .//LC_MESSAGES/library/urllib.error.po -source_file = pot/library/urllib.error.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--urllib_parse] -file_filter = .//LC_MESSAGES/library/urllib.parse.po -source_file = pot/library/urllib.parse.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--urllib_request] -file_filter = .//LC_MESSAGES/library/urllib.request.po -source_file = pot/library/urllib.request.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--urllib_robotparser] -file_filter = .//LC_MESSAGES/library/urllib.robotparser.po -source_file = pot/library/urllib.robotparser.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--uu] -file_filter = .//LC_MESSAGES/library/uu.po -source_file = pot/library/uu.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--uuid] -file_filter = .//LC_MESSAGES/library/uuid.po -source_file = pot/library/uuid.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--venv] -file_filter = .//LC_MESSAGES/library/venv.po -source_file = pot/library/venv.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--warnings] -file_filter = .//LC_MESSAGES/library/warnings.po -source_file = pot/library/warnings.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--wave] -file_filter = .//LC_MESSAGES/library/wave.po -source_file = pot/library/wave.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--weakref] -file_filter = .//LC_MESSAGES/library/weakref.po -source_file = pot/library/weakref.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--webbrowser] -file_filter = .//LC_MESSAGES/library/webbrowser.po -source_file = pot/library/webbrowser.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--windows] -file_filter = .//LC_MESSAGES/library/windows.po -source_file = pot/library/windows.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--winreg] -file_filter = .//LC_MESSAGES/library/winreg.po -source_file = pot/library/winreg.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--winsound] -file_filter = .//LC_MESSAGES/library/winsound.po -source_file = pot/library/winsound.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--wsgiref] -file_filter = .//LC_MESSAGES/library/wsgiref.po -source_file = pot/library/wsgiref.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--xdrlib] -file_filter = .//LC_MESSAGES/library/xdrlib.po -source_file = pot/library/xdrlib.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--xml] -file_filter = .//LC_MESSAGES/library/xml.po -source_file = pot/library/xml.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--xml_dom] -file_filter = .//LC_MESSAGES/library/xml.dom.po -source_file = pot/library/xml.dom.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--xml_dom_minidom] -file_filter = .//LC_MESSAGES/library/xml.dom.minidom.po -source_file = pot/library/xml.dom.minidom.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--xml_dom_pulldom] -file_filter = .//LC_MESSAGES/library/xml.dom.pulldom.po -source_file = pot/library/xml.dom.pulldom.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--xml_etree_elementtree] -file_filter = .//LC_MESSAGES/library/xml.etree.elementtree.po -source_file = pot/library/xml.etree.elementtree.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--xml_sax] -file_filter = .//LC_MESSAGES/library/xml.sax.po -source_file = pot/library/xml.sax.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--xml_sax_handler] -file_filter = .//LC_MESSAGES/library/xml.sax.handler.po -source_file = pot/library/xml.sax.handler.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--xml_sax_reader] -file_filter = .//LC_MESSAGES/library/xml.sax.reader.po -source_file = pot/library/xml.sax.reader.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--xml_sax_utils] -file_filter = .//LC_MESSAGES/library/xml.sax.utils.po -source_file = pot/library/xml.sax.utils.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--xmlrpc] -file_filter = .//LC_MESSAGES/library/xmlrpc.po -source_file = pot/library/xmlrpc.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--xmlrpc_client] -file_filter = .//LC_MESSAGES/library/xmlrpc.client.po -source_file = pot/library/xmlrpc.client.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--xmlrpc_server] -file_filter = .//LC_MESSAGES/library/xmlrpc.server.po -source_file = pot/library/xmlrpc.server.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--zipapp] -file_filter = .//LC_MESSAGES/library/zipapp.po -source_file = pot/library/zipapp.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--zipfile] -file_filter = .//LC_MESSAGES/library/zipfile.po -source_file = pot/library/zipfile.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--zipimport] -file_filter = .//LC_MESSAGES/library/zipimport.po -source_file = pot/library/zipimport.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--zlib] -file_filter = .//LC_MESSAGES/library/zlib.po -source_file = pot/library/zlib.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:library--zoneinfo] -file_filter = .//LC_MESSAGES/library/zoneinfo.po -source_file = pot/library/zoneinfo.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:license] -file_filter = .//LC_MESSAGES/license.po -source_file = pot/license.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:reference--compound_stmts] -file_filter = .//LC_MESSAGES/reference/compound_stmts.po -source_file = pot/reference/compound_stmts.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:reference--datamodel] -file_filter = .//LC_MESSAGES/reference/datamodel.po -source_file = pot/reference/datamodel.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:reference--executionmodel] -file_filter = .//LC_MESSAGES/reference/executionmodel.po -source_file = pot/reference/executionmodel.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:reference--expressions] -file_filter = .//LC_MESSAGES/reference/expressions.po -source_file = pot/reference/expressions.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:reference--grammar] -file_filter = .//LC_MESSAGES/reference/grammar.po -source_file = pot/reference/grammar.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:reference--import] -file_filter = .//LC_MESSAGES/reference/import.po -source_file = pot/reference/import.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:reference--index] -file_filter = .//LC_MESSAGES/reference/index.po -source_file = pot/reference/index.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:reference--introduction] -file_filter = .//LC_MESSAGES/reference/introduction.po -source_file = pot/reference/introduction.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:reference--lexical_analysis] -file_filter = .//LC_MESSAGES/reference/lexical_analysis.po -source_file = pot/reference/lexical_analysis.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:reference--simple_stmts] -file_filter = .//LC_MESSAGES/reference/simple_stmts.po -source_file = pot/reference/simple_stmts.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:reference--toplevel_components] -file_filter = .//LC_MESSAGES/reference/toplevel_components.po -source_file = pot/reference/toplevel_components.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:sphinx] -file_filter = .//LC_MESSAGES/sphinx.po -source_file = pot/sphinx.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:tutorial--appendix] -file_filter = .//LC_MESSAGES/tutorial/appendix.po -source_file = pot/tutorial/appendix.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:tutorial--appetite] -file_filter = .//LC_MESSAGES/tutorial/appetite.po -source_file = pot/tutorial/appetite.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:tutorial--classes] -file_filter = .//LC_MESSAGES/tutorial/classes.po -source_file = pot/tutorial/classes.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:tutorial--controlflow] -file_filter = .//LC_MESSAGES/tutorial/controlflow.po -source_file = pot/tutorial/controlflow.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:tutorial--datastructures] -file_filter = .//LC_MESSAGES/tutorial/datastructures.po -source_file = pot/tutorial/datastructures.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:tutorial--errors] -file_filter = .//LC_MESSAGES/tutorial/errors.po -source_file = pot/tutorial/errors.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:tutorial--floatingpoint] -file_filter = .//LC_MESSAGES/tutorial/floatingpoint.po -source_file = pot/tutorial/floatingpoint.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:tutorial--index] -file_filter = .//LC_MESSAGES/tutorial/index.po -source_file = pot/tutorial/index.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:tutorial--inputoutput] -file_filter = .//LC_MESSAGES/tutorial/inputoutput.po -source_file = pot/tutorial/inputoutput.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:tutorial--interactive] -file_filter = .//LC_MESSAGES/tutorial/interactive.po -source_file = pot/tutorial/interactive.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:tutorial--interpreter] -file_filter = .//LC_MESSAGES/tutorial/interpreter.po -source_file = pot/tutorial/interpreter.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:tutorial--introduction] -file_filter = .//LC_MESSAGES/tutorial/introduction.po -source_file = pot/tutorial/introduction.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:tutorial--modules] -file_filter = .//LC_MESSAGES/tutorial/modules.po -source_file = pot/tutorial/modules.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:tutorial--stdlib] -file_filter = .//LC_MESSAGES/tutorial/stdlib.po -source_file = pot/tutorial/stdlib.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:tutorial--stdlib2] -file_filter = .//LC_MESSAGES/tutorial/stdlib2.po -source_file = pot/tutorial/stdlib2.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:tutorial--venv] -file_filter = .//LC_MESSAGES/tutorial/venv.po -source_file = pot/tutorial/venv.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:tutorial--whatnow] -file_filter = .//LC_MESSAGES/tutorial/whatnow.po -source_file = pot/tutorial/whatnow.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:using--android] -file_filter = .//LC_MESSAGES/using/android.po -source_file = pot/using/android.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:using--cmdline] -file_filter = .//LC_MESSAGES/using/cmdline.po -source_file = pot/using/cmdline.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:using--configure] -file_filter = .//LC_MESSAGES/using/configure.po -source_file = pot/using/configure.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:using--editors] -file_filter = .//LC_MESSAGES/using/editors.po -source_file = pot/using/editors.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:using--index] -file_filter = .//LC_MESSAGES/using/index.po -source_file = pot/using/index.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:using--ios] -file_filter = .//LC_MESSAGES/using/ios.po -source_file = pot/using/ios.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:using--mac] -file_filter = .//LC_MESSAGES/using/mac.po -source_file = pot/using/mac.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:using--unix] -file_filter = .//LC_MESSAGES/using/unix.po -source_file = pot/using/unix.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:using--windows] -file_filter = .//LC_MESSAGES/using/windows.po -source_file = pot/using/windows.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:whatsnew--2_0] -file_filter = .//LC_MESSAGES/whatsnew/2.0.po -source_file = pot/whatsnew/2.0.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:whatsnew--2_1] -file_filter = .//LC_MESSAGES/whatsnew/2.1.po -source_file = pot/whatsnew/2.1.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:whatsnew--2_2] -file_filter = .//LC_MESSAGES/whatsnew/2.2.po -source_file = pot/whatsnew/2.2.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:whatsnew--2_3] -file_filter = .//LC_MESSAGES/whatsnew/2.3.po -source_file = pot/whatsnew/2.3.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:whatsnew--2_4] -file_filter = .//LC_MESSAGES/whatsnew/2.4.po -source_file = pot/whatsnew/2.4.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:whatsnew--2_5] -file_filter = .//LC_MESSAGES/whatsnew/2.5.po -source_file = pot/whatsnew/2.5.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:whatsnew--2_6] -file_filter = .//LC_MESSAGES/whatsnew/2.6.po -source_file = pot/whatsnew/2.6.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:whatsnew--2_7] -file_filter = .//LC_MESSAGES/whatsnew/2.7.po -source_file = pot/whatsnew/2.7.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:whatsnew--3_0] -file_filter = .//LC_MESSAGES/whatsnew/3.0.po -source_file = pot/whatsnew/3.0.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:whatsnew--3_1] -file_filter = .//LC_MESSAGES/whatsnew/3.1.po -source_file = pot/whatsnew/3.1.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:whatsnew--3_10] -file_filter = .//LC_MESSAGES/whatsnew/3.10.po -source_file = pot/whatsnew/3.10.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:whatsnew--3_11] -file_filter = .//LC_MESSAGES/whatsnew/3.11.po -source_file = pot/whatsnew/3.11.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:whatsnew--3_12] -file_filter = .//LC_MESSAGES/whatsnew/3.12.po -source_file = pot/whatsnew/3.12.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:whatsnew--3_13] -file_filter = .//LC_MESSAGES/whatsnew/3.13.po -source_file = pot/whatsnew/3.13.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:whatsnew--3_14] -file_filter = .//LC_MESSAGES/whatsnew/3.14.po -source_file = pot/whatsnew/3.14.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:whatsnew--3_2] -file_filter = .//LC_MESSAGES/whatsnew/3.2.po -source_file = pot/whatsnew/3.2.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:whatsnew--3_3] -file_filter = .//LC_MESSAGES/whatsnew/3.3.po -source_file = pot/whatsnew/3.3.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:whatsnew--3_4] -file_filter = .//LC_MESSAGES/whatsnew/3.4.po -source_file = pot/whatsnew/3.4.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:whatsnew--3_5] -file_filter = .//LC_MESSAGES/whatsnew/3.5.po -source_file = pot/whatsnew/3.5.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:whatsnew--3_6] -file_filter = .//LC_MESSAGES/whatsnew/3.6.po -source_file = pot/whatsnew/3.6.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:whatsnew--3_7] -file_filter = .//LC_MESSAGES/whatsnew/3.7.po -source_file = pot/whatsnew/3.7.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:whatsnew--3_8] -file_filter = .//LC_MESSAGES/whatsnew/3.8.po -source_file = pot/whatsnew/3.8.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:whatsnew--3_9] -file_filter = .//LC_MESSAGES/whatsnew/3.9.po -source_file = pot/whatsnew/3.9.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:whatsnew--changelog] -file_filter = .//LC_MESSAGES/whatsnew/changelog.po -source_file = pot/whatsnew/changelog.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - -[o:python-doc:p:python-newest:r:whatsnew--index] -file_filter = .//LC_MESSAGES/whatsnew/index.po -source_file = pot/whatsnew/index.pot -type = PO -minimum_perc = 0 -replace_edited_strings = false -keep_translations = false - diff --git a/Makefile b/Makefile deleted file mode 100644 index fa8aeba09..000000000 --- a/Makefile +++ /dev/null @@ -1,141 +0,0 @@ -# Makefile for ja Python Documentation -# -# Here is what you can do: -# -# - make # Automatically build an HTML local version -# - make todo # To list remaining tasks and show current progression -# - make verifs # To check for correctness: wrapping, spelling -# - make wrap # To rewrap modified files -# - make spell # To check for spelling -# - make clean # To remove build artifacts -# - make fuzzy # To find fuzzy strings -# -# Modes are: autobuild-stable, autobuild-dev, and autobuild-html - -# Configuration - -# The CPYTHON_CURRENT_COMMIT is the commit, in the cpython repository, -# from which we generated our po files. We use it here so when we -# test build, we're building with the .rst files that generated our -# .po files. - -CPYTHON_CURRENT_COMMIT := 16187b58bff9ccf6f800ba908ad5dae441fcb6a1 -LANGUAGE := ja -BRANCH := 3.14 - -EXCLUDED := \ - whatsnew/2.?.po \ - whatsnew/3.[0-10].po - -# Internal variables - -UPSTREAM := https://github.com/python/cpython - -PYTHON := $(shell which python3) -MODE := html -POSPELL_TMP_DIR := .pospell/ -JOBS := auto -ADDITIONAL_ARGS := --keep-going --color -SPHINXERRORHANDLING = -W - -# Detect OS - -ifeq '$(findstring ;,$(PATH))' ';' - detected_OS := Windows -else - detected_OS := $(shell uname 2>/dev/null || echo Unknown) - detected_OS := $(patsubst CYGWIN%,Cygwin,$(detected_OS)) - detected_OS := $(patsubst MSYS%,MSYS,$(detected_OS)) - detected_OS := $(patsubst MINGW%,MSYS,$(detected_OS)) -endif - -ifeq ($(detected_OS),Darwin) # Mac OS X - CP_CMD := gcp # accessible with `brew install coreutils` or `brew upgrade coreutils` -else - CP_CMD := cp -endif - -.PHONY: all -all: ensure_prerequisites - git -C venv/cpython checkout $(CPYTHON_CURRENT_COMMIT) || (git -C venv/cpython fetch && git -C venv/cpython checkout $(CPYTHON_CURRENT_COMMIT)) - mkdir -p locales/$(LANGUAGE)/LC_MESSAGES/ - $(CP_CMD) -u --parents *.po */*.po locales/$(LANGUAGE)/LC_MESSAGES/ - $(MAKE) -C venv/cpython/Doc/ \ - JOBS='$(JOBS)' \ - SPHINXOPTS='-D locale_dirs=$(abspath locales) \ - -D language=$(LANGUAGE) \ - -D gettext_compact=0 \ - -D latex_engine=xelatex \ - -D latex_elements.inputenc= \ - -D latex_elements.fontenc= \ - $(ADDITIONAL_ARGS)' \ - SPHINXERRORHANDLING=$(SPHINXERRORHANDLING) \ - $(MODE) - @echo "Build success, open file://$(abspath venv/cpython/)/Doc/build/html/index.html or run 'make htmlview' to see them." - - -# We clone cpython/ inside venv/ because venv/ is the only directory -# excluded by cpython' Sphinx configuration. -venv/cpython/.git/HEAD: - git clone https://github.com/python/cpython venv/cpython - - -.PHONY: ensure_prerequisites -ensure_prerequisites: venv/cpython/.git/HEAD - @if ! (blurb help >/dev/null 2>&1 && sphinx-build --version >/dev/null 2>&1); then \ - git -C venv/cpython/ checkout $(BRANCH); \ - echo "You're missing dependencies please install:"; \ - echo ""; \ - echo " python -m pip install -r venv/cpython/Doc/requirements.txt"; \ - exit 1; \ - fi - -.PHONY: htmlview -htmlview: MODE=htmlview -htmlview: all - -.PHONY: todo -todo: ensure_prerequisites - potodo --exclude venv .venv $(EXCLUDED) - -.PHONY: wrap -wrap: ensure_prerequisites - @echo "Re wrapping modified files" - powrap -m - -SRCS = $(shell git diff --name-only $(BRANCH) | grep '.po$$') -# foo/bar.po => $(POSPELL_TMP_DIR)/foo/bar.po.out -DESTS = $(addprefix $(POSPELL_TMP_DIR)/,$(addsuffix .out,$(SRCS))) - -.PHONY: spell -spell: ensure_prerequisites $(DESTS) - -.PHONY: line-length -line-length: - @echo "Searching for long lines..." - @awk '{if (length(gensub(/శ్రీనివాస్/, ".", "g", $$0)) > 80 && length(gensub(/[^ ]/, "", "g")) > 1) {print FILENAME ":" FNR, "line too long:", $$0; ERRORS+=1}} END {if (ERRORS>0) {exit 1}}' *.po */*.po - -.PHONY: sphinx-lint -sphinx-lint: - @echo "Checking all files using sphinx-lint..." - @sphinx-lint --enable all --disable line-too-long *.po */*.po - -$(POSPELL_TMP_DIR)/%.po.out: %.po dict - @echo "Pospell checking $<..." - @mkdir -p $(@D) - pospell -p dict -l tr_TR $< && touch $@ - -.PHONY: fuzzy -fuzzy: ensure_prerequisites - potodo -f --exclude venv .venv $(EXCLUDED) - -.PHONY: verifs -verifs: spell line-length sphinx-lint - -.PHONY: clean -clean: - @echo "Cleaning *.mo and $(POSPELL_TMP_DIR)" - rm -rf $(POSPELL_TMP_DIR) locales/$(LANGUAGE)/LC_MESSAGES/ - find -name '*.mo' -delete - @echo "Cleaning build directory" - $(MAKE) -C venv/cpython/Doc/ clean diff --git a/about.po b/about.po index f82b38521..24acca23c 100644 --- a/about.po +++ b/about.po @@ -1,23 +1,22 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. -# +# # Translators: -# tomo, 2021 -# yaakiyu, 2022 -# Inada Naoki , 2025 -# +# 秘湯 , 2017 +# Inada Naoki , 2017 +# tomo, 2017 +# #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-13 14:21+0000\n" -"PO-Revision-Date: 2021-06-28 00:47+0000\n" -"Last-Translator: Inada Naoki , 2025\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" -"ja/)\n" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 17:31+0000\n" +"Last-Translator: tomo, 2017\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/ja/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -25,64 +24,58 @@ msgstr "" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../about.rst:3 -msgid "About this documentation" +msgid "About these documents" msgstr "このドキュメントについて" #: ../../about.rst:6 msgid "" -"Python's documentation is generated from `reStructuredText`_ sources using " -"`Sphinx`_, a documentation generator originally created for Python and now " -"maintained as an independent project." +"These documents are generated from `reStructuredText`_ sources by `Sphinx`_," +" a document processor specifically written for the Python documentation." msgstr "" -"Pythonのドキュメントは、`Sphinx`_ を使って、`reStructuredText`_ のソースから" -"生成されています。 Sphinx はもともとPythonのために作られ、現在は独立したプロ" -"ジェクトとして保守されています。" +"このドキュメントは、 Python のドキュメントを主要な目的として作られた ドキュメントプロセッサの `Sphinx`_ を利用して、 " +"`reStructuredText`_ 形式のソースから生成されました。" -#: ../../about.rst:16 +#: ../../about.rst:15 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 " -"look at the :ref:`reporting-bugs` page for information on how to do so. New " -"volunteers are always welcome!" +"look at the :ref:`reporting-bugs` page for information on how to do so. New" +" volunteers are always welcome!" msgstr "" -"ドキュメントとそのツール群の開発は、Python 自身と同様に完全にボランティアの努" -"力です。\n" -"もしあなたが貢献したいなら、どのようにすればよいかについて :ref:`reporting-" -"bugs` ページをご覧下さい。 新しいボランティアはいつでも歓迎です!\n" -"(訳注: 日本語訳の問題については、 GitHub 上の `Issue Tracker `_ で報告をお願いします。)" +"ドキュメントとそのツール群の開発は、Python 自身と同様に完全にボランティアの努力です。\n" +"もしあなたが貢献したいなら、どのようにすればよいかについて :ref:`reporting-bugs` ページをご覧下さい。 新しいボランティアはいつでも歓迎です!\n" +"(訳注: 日本語訳の問題については、 GitHub 上の `Issue Tracker `_ で報告をお願いします。)" -#: ../../about.rst:21 +#: ../../about.rst:20 msgid "Many thanks go to:" msgstr "多大な感謝を:" -#: ../../about.rst:23 +#: ../../about.rst:22 msgid "" -"Fred L. Drake, Jr., the creator of the original Python documentation toolset " -"and author of much of the content;" -msgstr "" -"Fred L. Drake, Jr., オリジナルの Python ドキュメントツールセットの作成者で、" -"ドキュメントの多くを書きました。" +"Fred L. Drake, Jr., the creator of the original Python documentation toolset" +" and writer of much of the content;" +msgstr "Fred L. Drake, Jr., オリジナルの Python ドキュメントツールセットの作成者で、ドキュメントの多くを書きました。" -#: ../../about.rst:25 +#: ../../about.rst:24 msgid "" -"the `Docutils `_ project for creating " +"the `Docutils `_ project for creating " "reStructuredText and the Docutils suite;" msgstr "" -"`Docutils `_ プロジェクトは、 " -"reStructuredText と Docutils ツールセットを作成しました。" +"`Docutils `_ プロジェクト. reStructuredText と " +"docutils ツールセットを作成しました。" -#: ../../about.rst:27 +#: ../../about.rst:26 msgid "" -"Fredrik Lundh for his Alternative Python Reference project from which Sphinx " -"got many good ideas." +"Fredrik Lundh for his `Alternative Python Reference " +"`_ project from which Sphinx got many good" +" ideas." msgstr "" -"Fredrik Lundh の Alternative Python Reference プロジェクトから Sphinx は多く" -"のアイデアを得ました。" +"Fredrik Lundh の `Alternative Python Reference " +"`_ プロジェクトから Sphinx は多くのアイデアを得ました。" #: ../../about.rst:32 -msgid "Contributors to the Python documentation" -msgstr "Pythonドキュメントへの貢献者" +msgid "Contributors to the Python Documentation" +msgstr "Pythonドキュメント 貢献者" #: ../../about.rst:34 msgid "" @@ -90,14 +83,11 @@ msgid "" "library, and the Python documentation. See :source:`Misc/ACKS` in the " "Python source distribution for a partial list of contributors." msgstr "" -"多くの方々が Python 言語、Python 標準ライブラリ、そして Python ドキュメンテー" -"ションに貢献してくれています。ソース配布物の :source:`Misc/ACKS` に、それら貢" -"献してくれた人々を部分的にではありますがリストアップしてあります。" +"多くの方々が Python 言語、Python 標準ライブラリ、そして Python ドキュメンテーションに貢献してくれています。ソース配布物の " +":source:`Misc/ACKS` に、それら貢献してくれた人々を部分的にではありますがリストアップしてあります。" #: ../../about.rst:38 msgid "" "It is only with the input and contributions of the Python community that " "Python has such wonderful documentation -- Thank You!" -msgstr "" -"Python コミュニティからの情報提供と貢献がなければこの素晴らしいドキュメントは" -"生まれませんでした -- ありがとう!" +msgstr "Python コミュニティからの情報提供と貢献がなければこの素晴らしいドキュメンテーションは生まれませんでした -- ありがとう!" diff --git a/bugs.po b/bugs.po index 891e3bc99..137a7b500 100644 --- a/bugs.po +++ b/bugs.po @@ -1,25 +1,25 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. -# +# # Translators: -# tomo, 2022 -# yaakiyu, 2022 -# Takanori Suzuki , 2023 -# souma987, 2023 -# Taichi Haradaguchi, 2024 -# +# Takayuki Hirai, 2017 +# E. Kawashima, 2017 +# Arihiro TAKASE, 2017 +# Inada Naoki , 2019 +# MS_H, 2019 +# tomo, 2020 +# #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:47+0000\n" -"Last-Translator: Taichi Haradaguchi, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" -"ja/)\n" +"POT-Creation-Date: 2021-08-08 07:11+0000\n" +"PO-Revision-Date: 2017-02-16 17:31+0000\n" +"Last-Translator: tomo, 2020\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/ja/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -36,17 +36,16 @@ msgid "" "for stability. In order to maintain this reputation, the developers would " "like to know of any deficiencies you find in Python." msgstr "" -"Python は安定性について高い評価を得た、成熟した言語です。この評価を守るため" -"に、開発者たちはあなたが見つけた Python の不備を知りたいと思っています。" +"Python は安定性について高い評価を得た、成熟した言語です。この評価を守るために、開発者たちはあなたが見つけた Python " +"の不備を知りたいと思っています。" #: ../../bugs.rst:11 msgid "" "It can be sometimes faster to fix bugs yourself and contribute patches to " -"Python as it streamlines the process and involves less people. Learn how to :" -"ref:`contribute `." +"Python as it streamlines the process and involves less people. Learn how to " +":ref:`contribute `." msgstr "" -"バグを自分で直して Python にパッチを送る方が、やり取りに無駄が無く関わる人数" -"も少なく済むこともあります。\n" +"バグを自分で直して Python にパッチを送る方が、やり取りに無駄が無く関わる人数も少なく済むこともあります。\n" "ぜひ :ref:`貢献 ` する方法を学んでください。" #: ../../bugs.rst:16 @@ -56,195 +55,150 @@ msgstr "ドキュメントの不備" #: ../../bugs.rst:18 msgid "" "If you find a bug in this documentation or would like to propose an " -"improvement, please submit a bug report on the :ref:`issue tracker `. If you have a suggestion on how to fix it, include that as " -"well." +"improvement, please submit a bug report on the :ref:`tracker `. If you have a suggestion on how to fix it, include that as well." msgstr "" +"このドキュメントの不備を発見したとき、または、改善を提案したいときは、問題点を :ref:`tracker ` に報告してください。修正方法の案があるならば、それも含めて。\n" +"(訳注: 日本語訳の問題については、 GitHub 上の `Issue Tracker `_ で報告をお願いします。)" #: ../../bugs.rst:22 msgid "" -"You can also open a discussion item on our `Documentation Discourse forum " -"`_." +"If you're short on time, you can also email documentation bug reports to " +"docs@python.org (behavioral bugs can be sent to python-list@python.org). " +"'docs@' is a mailing list run by volunteers; your request will be noticed, " +"though it may take a while to be processed." msgstr "" -"または `Documentation Discourse forum `_ でディスカッションを行うこともできます。" +"時間がない場合、ドキュメントの問題を docs@python.org 宛て、メールで報告することもできます。 (Python の動作に関するバグ報告は python-list@python.org 宛になります。)\n" +"'docs@' はボランティアで運営されているメーリングリストです。\n" +"報告が伝わっていても、対応への時間がかかることもあります。" -#: ../../bugs.rst:25 -msgid "" -"If you find a bug in the theme (HTML / CSS / JavaScript) of the " -"documentation, please submit a bug report on the `python-doc-theme issue " -"tracker `_." -msgstr "" - -#: ../../bugs.rst:31 +#: ../../bugs.rst:30 msgid "`Documentation bugs`_" -msgstr "`ドキュメントのバグ`_" +msgstr "`Documentation bugs`_" -#: ../../bugs.rst:32 +#: ../../bugs.rst:30 msgid "" "A list of documentation bugs that have been submitted to the Python issue " "tracker." msgstr "Python issue tracker に出されたドキュメントバグのリスト。" -#: ../../bugs.rst:34 +#: ../../bugs.rst:33 msgid "`Issue Tracking `_" -msgstr "`イシュートラッカー `_" +msgstr "`Issue Tracking `_" -#: ../../bugs.rst:35 +#: ../../bugs.rst:33 msgid "" "Overview of the process involved in reporting an improvement on the tracker." msgstr "issue tracker への改善報告に関する作業過程の概観。" -#: ../../bugs.rst:37 +#: ../../bugs.rst:35 msgid "" -"`Helping with Documentation `_" +"`Helping with Documentation `_" msgstr "" -"`ドキュメントを手伝う `_" +"`Helping with Documentation `_" -#: ../../bugs.rst:38 +#: ../../bugs.rst:36 msgid "" "Comprehensive guide for individuals that are interested in contributing to " "Python documentation." msgstr "Python ドキュメントへの貢献に興味がある個人へ向けた包括的なガイド。" -#: ../../bugs.rst:40 -msgid "" -"`Documentation Translations `_" -msgstr "" -"`ドキュメントの翻訳 `_" - #: ../../bugs.rst:41 -msgid "" -"A list of GitHub pages for documentation translation and their primary " -"contacts." -msgstr "ドキュメントの翻訳とその連絡先の載った GitHub pages のリスト。" - -#: ../../bugs.rst:47 msgid "Using the Python issue tracker" msgstr "Python の課題管理システムを使う" -#: ../../bugs.rst:49 +#: ../../bugs.rst:43 msgid "" -"Issue reports for Python itself should be submitted via the GitHub issues " -"tracker (https://github.com/python/cpython/issues). The GitHub issues " -"tracker offers a web form which allows pertinent information to be entered " -"and submitted to the developers." +"Bug reports for Python itself should be submitted via the Python Bug Tracker" +" (https://bugs.python.org/). The bug tracker offers a Web form which allows" +" pertinent information to be entered and submitted to the developers." msgstr "" -"Python 自体に関する問題は Githubのissue tracker (https://github.com/python/" -"cpython/issues) で報告してください。このGithub issue trackerは、関連情報を入" -"力して開発者に報告するための Web フォームを提供しています。" +"Python の動作に関するバグは Python Bug Tracker (https://bugs.python.org/) " +"で報告してください。このバグトラッカーは、関連情報を入力して開発者に報告するための Web フォームを提供しています。" -#: ../../bugs.rst:54 +#: ../../bugs.rst:47 msgid "" "The first step in filing a report is to determine whether the problem has " "already been reported. The advantage in doing so, aside from saving the " -"developers' time, is that you learn what has been done to fix it; it may be " +"developers time, is that you learn what has been done to fix it; it may be " "that the problem has already been fixed for the next release, or additional " "information is needed (in which case you are welcome to provide it if you " -"can!). To do this, search the tracker using the search box at the top of the " -"page." +"can!). To do this, search the bug database using the search box on the top " +"of the page." msgstr "" -"レポートを書くには、初めにその問題が既にレポートされていないか確認します。こ" -"れにより、開発者の時間が無駄にならないだけでなく、あなたが、問題に対して為さ" -"れた対処について知ることもできます。次のリリースに向けて問題が修正されたのか" -"もしれませんし、追加の情報が必要とされているのかもしれません(この場合は是非" -"情報を提供してください)。確認のためにはページの上の検索ボックスを利用してく" -"ださい。" +"報告ではまず、その問題が既に報告済みかどうかを判断してください。そうすることで、開発者の時間を節約できるほか、問題解決に係る経緯を知ることができます。と言うのは、その問題は次のリリースでは解決済みとなっているか、または、さらに情報を必要としているかもしれません。 (そういったとき、可能なら是非、提供をお願いします!)\n" +"判断するには、ページ先頭の検索ボックスでバグデータベースを検索してください。" -#: ../../bugs.rst:61 -msgid "" -"If the problem you're reporting is not already in the list, log in to " -"GitHub. If you don't already have a GitHub account, create a new account " -"using the \"Sign up\" link. It is not possible to submit a bug report " -"anonymously." -msgstr "" -"報告しようとしている問題がまだリストにない場合は、GitHub にログインしてくださ" -"い。GitHubのアカウントをまだお持ちでない場合は、「Sign up」リンクから新しいア" -"カウントを作成してください。匿名でバグレポートを提出することはできません。" - -#: ../../bugs.rst:66 -msgid "" -"Being now logged in, you can submit an issue. Click on the \"New issue\" " -"button in the top bar to report a new issue." -msgstr "" -"ログインした状態で、課題を送信することができます。トップバーの「New issue」ボ" -"タンをクリックして、新しい課題を報告してください。" - -#: ../../bugs.rst:69 -msgid "The submission form has two fields, \"Title\" and \"Comment\"." -msgstr "" -"報告のフォームには、「Title」と「Comment」の2つのフィールドがあります。" - -#: ../../bugs.rst:71 +#: ../../bugs.rst:54 msgid "" -"For the \"Title\" field, enter a *very* short description of the problem; " -"fewer than ten words is good." +"If the problem you're reporting is not already in the bug tracker, go back " +"to the Python Bug Tracker and log in. If you don't already have a tracker " +"account, select the \"Register\" link or, if you use OpenID, one of the " +"OpenID provider logos in the sidebar. It is not possible to submit a bug " +"report anonymously." msgstr "" -"「Title」フィールドには、問題の *とても* 短い説明を(訳注: 英語で)入力してく" -"ださい。10語以内が望ましいです。" +"問題がまだバグトラッカーに登録されていない場合は、Python Bug Tracker " +"のトップページに戻ってログインしてください。まだトラッカーのアカウントをもっていない場合は、サイドバーの \"Register\" " +"リンクを選んでください。また、OpenID を使っている場合はサイドバーの OpenID " +"プロバイダのロゴをクリックしてください。匿名での問題報告はできません。" -#: ../../bugs.rst:74 +#: ../../bugs.rst:59 msgid "" -"In the \"Comment\" field, describe the problem in detail, including what you " -"expected to happen and what did happen. Be sure to include whether any " -"extension modules were involved, and what hardware and software platform you " -"were using (including version information as appropriate)." -msgstr "" -"\"Comment\" フィールドで、あなたが期待した結果と実際の結果も含め、問題の詳細" -"を説明してください。拡張モジュールが関与しているかどうかと、使用しているハー" -"ドウェアとソフトウェアプラットフォームも (必要に応じてバージョン情報も) 必ず" -"報告に含めてください。" +"Being now logged in, you can submit a bug. Select the \"Create New\" link " +"in the sidebar to open the bug reporting form." +msgstr "ログインできたら、バグを登録できます。サイドバーの \"Create New\" リンクからバグ報告フォームを開きます。" -#: ../../bugs.rst:79 +#: ../../bugs.rst:62 msgid "" -"Each issue report will be reviewed by a developer who will determine what " -"needs to be done to correct the problem. You will receive an update each " -"time an action is taken on the issue." +"The submission form has a number of fields. For the \"Title\" field, enter " +"a *very* short description of the problem; less than ten words is good. In " +"the \"Type\" field, select the type of your problem; also select the " +"\"Component\" and \"Versions\" to which the bug relates." msgstr "" -"各問題レポートは開発者によってレビューされ、問題を修正するために何が必要かを" -"判断します。issueで何らかの行動があるたびに、最新情報を通知します。" +"バグ報告フォームには幾つかのフィールドがあります。\"Title\" フィールドには、問題の説明を *非常に* " +"簡潔に書いてください。10語以下くらいが目安です。\"Type\" フィールドでは、問題の種類を選択してください。バグに関係する " +"\"Component\" と \"Versions\" も選択してください。" -#: ../../bugs.rst:86 +#: ../../bugs.rst:67 msgid "" -"`How to Report Bugs Effectively `_" +"In the \"Comment\" field, describe the problem in detail, including what you" +" expected to happen and what did happen. Be sure to include whether any " +"extension modules were involved, and what hardware and software platform you" +" were using (including version information as appropriate)." msgstr "" -"`How to Report Bugs Effectively `_" +"\"Comment\" " +"フィールドで、あなたが期待した結果と実際の結果も含め、問題の詳細を説明してください。拡張モジュールが関与しているかどうかと、使用しているハードウェアとソフトウェアプラットフォームも" +" (必要に応じてバージョン情報も) 必ず報告に含めてください。" -#: ../../bugs.rst:87 +#: ../../bugs.rst:72 msgid "" -"Article which goes into some detail about how to create a useful bug report. " -"This describes what kind of information is useful and why it is useful." +"Each bug report will be assigned to a developer who will determine what " +"needs to be done to correct the problem. You will receive an update each " +"time action is taken on the bug." msgstr "" -"有益なバグ報告について詳しく説明した記事です。どんな情報が、なぜ有益なのかを" -"説明しています。" +"各バグ報告は開発者に割り当てられ、その問題を解決するのに何が必要かが決定されます。そのバグ報告に対して何かアクションがあるたびに、更新情報があなたに届きます。" -#: ../../bugs.rst:90 +#: ../../bugs.rst:80 msgid "" -"`Bug Writing Guidelines `_" +"`How to Report Bugs Effectively " +"`_" msgstr "" -"`Bug Writing Guidelines `_" +"`How to Report Bugs Effectively " +"`_" -#: ../../bugs.rst:91 +#: ../../bugs.rst:80 msgid "" -"Information about writing a good bug report. Some of this is specific to " -"the Mozilla project, but describes general good practices." -msgstr "" -"良いバグ報告を書くための情報です。この情報の一部はMozillaプロジェクト独自のも" -"のですが、一般的に良い習慣を解説しています。" +"Article which goes into some detail about how to create a useful bug report." +" This describes what kind of information is useful and why it is useful." +msgstr "有益なバグ報告について詳しく説明した記事です。どんな情報が、なぜ有益なのかを説明しています。" -#: ../../bugs.rst:97 +#: ../../bugs.rst:86 msgid "Getting started contributing to Python yourself" msgstr "Python への貢献をはじめる" -#: ../../bugs.rst:99 +#: ../../bugs.rst:88 msgid "" "Beyond just reporting bugs that you find, you are also welcome to submit " "patches to fix them. You can find more information on how to get started " @@ -252,7 +206,6 @@ msgid "" "the `core-mentorship mailing list`_ is a friendly place to get answers to " "any and all questions pertaining to the process of fixing issues in Python." msgstr "" -"見つけたバグの報告だけでなく、修正パッチの提出も歓迎します。`Python " -"Developer's Guide`_ には Python へのパッチの始め方について詳しい情報がありま" -"す。疑問があれば、`core-mentorship mailing list`_ は Python の問題解決の過程" -"に関するありとあらゆる疑問への答えを得ることが出来るフレンドリーな場所です。" +"見つけたバグの報告だけでなく、修正パッチの提出も歓迎します。`Python Developer's Guide`_ には Python " +"へのパッチの始め方について詳しい情報があります。疑問があれば、`core-mentorship mailing list`_ は Python " +"の問題解決の過程に関するありとあらゆる疑問への答えを得ることが出来るフレンドリーな場所です。" diff --git a/c-api/abstract.po b/c-api/abstract.po index 071c36385..24a3b89d3 100644 --- a/c-api/abstract.po +++ b/c-api/abstract.po @@ -1,31 +1,31 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 -# Taichi Haradaguchi, 2024 +# Arihiro TAKASE, 2017 +# tomo, 2018 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-06 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:47+0000\n" -"Last-Translator: Taichi Haradaguchi, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 17:32+0000\n" +"Last-Translator: tomo, 2018\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/abstract.rst:7 msgid "Abstract Objects Layer" -msgstr "抽象オブジェクトレイヤ (Abstract Objects Layer)" +msgstr "抽象オブジェクトレイヤ (abstract objects layer)" #: ../../c-api/abstract.rst:9 msgid "" diff --git a/c-api/allocation.po b/c-api/allocation.po index 37abcf215..63fd38da5 100644 --- a/c-api/allocation.po +++ b/c-api/allocation.po @@ -1,25 +1,28 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2025 +# Inada Naoki , 2017 +# Nozomu Kaneko , 2017 +# Arihiro TAKASE, 2017 +# Osamu NAKAMURA, 2017 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-30 14:22+0000\n" -"PO-Revision-Date: 2021-06-28 00:47+0000\n" -"Last-Translator: tomo, 2025\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 17:32+0000\n" +"Last-Translator: Osamu NAKAMURA, 2017\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/allocation.rst:6 @@ -28,29 +31,19 @@ msgstr "オブジェクトをヒープ上にメモリ確保する" #: ../../c-api/allocation.rst:17 msgid "" -"Initialize a newly allocated object *op* with its type and initial " -"reference. Returns the initialized object. Other fields of the object are " -"not initialized. Despite its name, this function is unrelated to the " -"object's :meth:`~object.__init__` method (:c:member:`~PyTypeObject.tp_init` " -"slot). Specifically, this function does **not** call the object's :meth:`!" -"__init__` method." -msgstr "" - -#: ../../c-api/allocation.rst:24 -msgid "" -"In general, consider this function to be a low-level routine. Use :c:member:" -"`~PyTypeObject.tp_alloc` where possible. For implementing :c:member:`!" -"tp_alloc` for your type, prefer :c:func:`PyType_GenericAlloc` or :c:func:" -"`PyObject_New`." +"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." msgstr "" +"新たにメモリ確保されたオブジェクト *op* に対し、型と初期状態での参照 " +"(initial reference) を初期化します。初期化されたオブジェクトを返します。" +"*type* からそのオブジェクトが循環参照ガベージ検出の機能を有する場合、検出機構" +"が監視対象とするオブジェクトのセットに追加されます。オブジェクトの他のフィー" +"ルドには影響を及ぼしません。" -#: ../../c-api/allocation.rst:31 -msgid "" -"This function only initializes the object's memory corresponding to the " -"initial :c:type:`PyObject` structure. It does not zero the rest." -msgstr "" - -#: ../../c-api/allocation.rst:37 +#: ../../c-api/allocation.rst:26 msgid "" "This does everything :c:func:`PyObject_Init` does, and also initializes the " "length information for a variable-size object." @@ -58,136 +51,55 @@ msgstr "" ":c:func:`PyObject_Init` の全ての処理を行い、可変サイズオブジェクトの場合には" "長さ情報も初期化します。" -#: ../../c-api/allocation.rst:42 -msgid "" -"This function only initializes some of the object's memory. It does not " -"zero the rest." -msgstr "" - -#: ../../c-api/allocation.rst:48 -msgid "" -"Allocates a new Python object using the C structure type *TYPE* and the " -"Python type object *typeobj* (``PyTypeObject*``) by calling :c:func:" -"`PyObject_Malloc` to allocate memory and initializing it like :c:func:" -"`PyObject_Init`. The caller will own the only reference to the object (i.e. " -"its reference count will be one)." -msgstr "" - -#: ../../c-api/allocation.rst:54 ../../c-api/allocation.rst:107 -msgid "" -"Avoid calling this directly to allocate memory for an object; call the " -"type's :c:member:`~PyTypeObject.tp_alloc` slot instead." -msgstr "" - -#: ../../c-api/allocation.rst:57 ../../c-api/allocation.rst:110 -msgid "" -"When populating a type's :c:member:`~PyTypeObject.tp_alloc` slot, :c:func:" -"`PyType_GenericAlloc` is preferred over a custom function that simply calls " -"this macro." -msgstr "" - -#: ../../c-api/allocation.rst:61 -msgid "" -"This macro does not call :c:member:`~PyTypeObject.tp_alloc`, :c:member:" -"`~PyTypeObject.tp_new` (:meth:`~object.__new__`), or :c:member:" -"`~PyTypeObject.tp_init` (:meth:`~object.__init__`)." -msgstr "" - -#: ../../c-api/allocation.rst:65 -msgid "" -"This cannot be used for objects with :c:macro:`Py_TPFLAGS_HAVE_GC` set in :c:" -"member:`~PyTypeObject.tp_flags`; use :c:macro:`PyObject_GC_New` instead." -msgstr "" - -#: ../../c-api/allocation.rst:68 -msgid "" -"Memory allocated by this macro must be freed with :c:func:`PyObject_Free` " -"(usually called via the object's :c:member:`~PyTypeObject.tp_free` slot)." -msgstr "" - -#: ../../c-api/allocation.rst:73 ../../c-api/allocation.rst:123 -msgid "" -"The returned memory is not guaranteed to have been completely zeroed before " -"it was initialized." -msgstr "" - -#: ../../c-api/allocation.rst:78 ../../c-api/allocation.rst:128 -msgid "" -"This macro does not construct a fully initialized object of the given type; " -"it merely allocates memory and prepares it for further initialization by :c:" -"member:`~PyTypeObject.tp_init`. To construct a fully initialized object, " -"call *typeobj* instead. For example::" -msgstr "" - -#: ../../c-api/allocation.rst:83 -msgid "PyObject *foo = PyObject_CallNoArgs((PyObject *)&PyFoo_Type);" -msgstr "" - -#: ../../c-api/allocation.rst:87 ../../c-api/allocation.rst:137 -msgid ":c:func:`PyObject_Free`" -msgstr ":c:func:`PyObject_Free`" - -#: ../../c-api/allocation.rst:88 -msgid ":c:macro:`PyObject_GC_New`" -msgstr "" - -#: ../../c-api/allocation.rst:89 ../../c-api/allocation.rst:139 -msgid ":c:func:`PyType_GenericAlloc`" -msgstr "" - -#: ../../c-api/allocation.rst:90 ../../c-api/allocation.rst:140 -msgid ":c:member:`~PyTypeObject.tp_alloc`" -msgstr ":c:member:`~PyTypeObject.tp_alloc`" - -#: ../../c-api/allocation.rst:95 -msgid "Like :c:macro:`PyObject_New` except:" -msgstr "" - -#: ../../c-api/allocation.rst:97 -msgid "" -"It allocates enough memory for the *TYPE* structure plus *size* " -"(``Py_ssize_t``) fields of the size given by the :c:member:`~PyTypeObject." -"tp_itemsize` field of *typeobj*." -msgstr "" - -#: ../../c-api/allocation.rst:100 -msgid "The memory is initialized like :c:func:`PyObject_InitVar`." -msgstr "" - -#: ../../c-api/allocation.rst:102 -msgid "" -"This is useful for implementing objects like tuples, which are able to " -"determine their size at construction time. Embedding the array of fields " -"into the same allocation decreases the number of allocations, improving the " -"memory management efficiency." -msgstr "" - -#: ../../c-api/allocation.rst:114 -msgid "" -"This cannot be used for objects with :c:macro:`Py_TPFLAGS_HAVE_GC` set in :c:" -"member:`~PyTypeObject.tp_flags`; use :c:macro:`PyObject_GC_NewVar` instead." -msgstr "" - -#: ../../c-api/allocation.rst:118 -msgid "" -"Memory allocated by this function must be freed with :c:func:`PyObject_Free` " -"(usually called via the object's :c:member:`~PyTypeObject.tp_free` slot)." -msgstr "" - -#: ../../c-api/allocation.rst:133 -msgid "" -"PyObject *list_instance = PyObject_CallNoArgs((PyObject *)&PyList_Type);" -msgstr "" - -#: ../../c-api/allocation.rst:138 -msgid ":c:macro:`PyObject_GC_NewVar`" -msgstr "" - -#: ../../c-api/allocation.rst:145 -msgid "Same as :c:func:`PyObject_Free`." -msgstr "" - -#: ../../c-api/allocation.rst:149 +#: ../../c-api/allocation.rst:32 +msgid "" +"Allocate a new Python object using the C structure type *TYPE* and the " +"Python type object *type*. Fields not defined by the Python object header " +"are not initialized; the object's reference count will be one. The size of " +"the memory allocation is determined from the :c:member:`~PyTypeObject." +"tp_basicsize` field of the type object." +msgstr "" +"C 構造体型 *TYPE* と Python型オブジェクト *type* を使って、新しい Python オブ" +"ジェクトをメモリ上に確保します。Pythonオブジェクトヘッダで定義されていない" +"フィールドは初期化されません; オブジェクトの参照カウントは 1 になります。確保" +"するメモリのサイズは型オブジェクトの :c:member:`~PyTypeObject.tp_basicsize` " +"フィールドで決まります。" + +#: ../../c-api/allocation.rst:41 +msgid "" +"Allocate a new Python object using the C structure type *TYPE* and the " +"Python type object *type*. Fields not defined by the Python object header " +"are not initialized. The allocated memory allows for the *TYPE* structure " +"plus *size* fields of the size given by the :c:member:`~PyTypeObject." +"tp_itemsize` field of *type*. This is useful for implementing objects like " +"tuples, which are able to determine their size at construction time. " +"Embedding the array of fields into the same allocation decreases the number " +"of allocations, improving the memory management efficiency." +msgstr "" +"C 構造体型 *TYPE* と Python 型オブジェクト *type* を使って新しい Python オブ" +"ジェクトをメモリ上に確保します。 Python オブジェクトヘッダで定義されていない" +"フィールドは初期化されません。確保されたメモリは、 *TYPE* 構造体に加え、" +"*type* の :c:member:`~PyTypeObject.tp_itemsize` フィールドで指定されているサ" +"イズを *size* 個分の大きさを格納できます。この関数は、例えばタプルのように生" +"成時にサイズを決定できるオブジェクトを実装する際に便利です。一連の複数の" +"フィールドのメモリ割り当てを一度で行うことでアロケーション回数を減らし、メモ" +"リ管理の効率が向上します。" + +#: ../../c-api/allocation.rst:53 +msgid "" +"Releases memory allocated to an object using :c:func:`PyObject_New` or :c:" +"func:`PyObject_NewVar`. This is normally called from the :c:member:" +"`~PyTypeObject.tp_dealloc` handler specified in the object's type. The " +"fields of the object should not be accessed after this call as the memory is " +"no longer a valid Python object." +msgstr "" +":c:func:`PyObject_New` や :c:func:`PyObject_NewVar` で 確保したメモリを解放し" +"ます。通常、この関数はオブジェクトの型に指定されている :c:member:" +"`~PyTypeObject.tp_dealloc` ハンドラから呼び出されます。 この関数を呼び出した" +"後は、メモリ領域はもはや有効な Python オブジェクトを表現していないので、オブ" +"ジェクトのフィールド に対してアクセスしてはなりません。" + +#: ../../c-api/allocation.rst:62 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 " @@ -197,10 +109,10 @@ msgstr "" "ブジェクトへのポインタを評価する :c:macro:`Py_None` マクロを使わなければなり" "ません。" -#: ../../c-api/allocation.rst:156 -msgid ":ref:`moduleobjects`" -msgstr "" +#: ../../c-api/allocation.rst:69 +msgid ":c:func:`PyModule_Create`" +msgstr ":c:func:`PyModule_Create`" -#: ../../c-api/allocation.rst:157 +#: ../../c-api/allocation.rst:70 msgid "To allocate and create extension modules." msgstr "拡張モジュールのアロケートと生成。" diff --git a/c-api/apiabiversion.po b/c-api/apiabiversion.po index f9d5c2a3e..db54e736b 100644 --- a/c-api/apiabiversion.po +++ b/c-api/apiabiversion.po @@ -1,295 +1,128 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Skydelta, 2024 -# tomo, 2025 +# Inada Naoki , 2017 +# 秘湯 , 2017 +# Arihiro TAKASE, 2017 +# Osamu NAKAMURA, 2017 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:47+0000\n" -"Last-Translator: tomo, 2025\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 17:33+0000\n" +"Last-Translator: Osamu NAKAMURA, 2017\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/apiabiversion.rst:7 msgid "API and ABI Versioning" msgstr "API と ABI のバージョニング" -#: ../../c-api/apiabiversion.rst:11 -msgid "Build-time version constants" -msgstr "" - -#: ../../c-api/apiabiversion.rst:13 -msgid "" -"CPython exposes its version number in the following macros. Note that these " -"correspond to the version code is **built** with. See :c:var:`Py_Version` " -"for the version used at **run time**." -msgstr "" - -#: ../../c-api/apiabiversion.rst:17 -msgid "" -"See :ref:`stable` for a discussion of API and ABI stability across versions." -msgstr "" -"バージョン間の API と ABI の安定性については :ref:`stable` を参照してくださ" -"い。" - -#: ../../c-api/apiabiversion.rst:21 -msgid "The ``3`` in ``3.4.1a2``." -msgstr "``3.4.1a2`` の ``3`` 。" - -#: ../../c-api/apiabiversion.rst:25 -msgid "The ``4`` in ``3.4.1a2``." -msgstr "``3.4.1a2`` の ``4`` 。" - -#: ../../c-api/apiabiversion.rst:29 -msgid "The ``1`` in ``3.4.1a2``." -msgstr "``3.4.1a2`` の ``1`` 。" - -#: ../../c-api/apiabiversion.rst:33 -msgid "" -"The ``a`` in ``3.4.1a2``. This can be ``0xA`` for alpha, ``0xB`` for beta, " -"``0xC`` for release candidate or ``0xF`` for final." -msgstr "" -"``3.4.1a2`` の ``a`` 。アルファでは ``0xA`` 、ベータでは ``0xB`` 、リリース候" -"補では ``0xC`` 、最終版では ``0xF`` となります。" - -#: ../../c-api/apiabiversion.rst:39 -msgid "The ``2`` in ``3.4.1a2``. Zero for final releases." -msgstr "``3.4.1a2`` の ``2`` 。最終リリースでは 0 になります。" - -#: ../../c-api/apiabiversion.rst:43 -msgid "" -"The Python version number encoded in a single integer. See :c:func:" -"`Py_PACK_FULL_VERSION` for the encoding details." -msgstr "" - -#: ../../c-api/apiabiversion.rst:46 -msgid "" -"Use this for numeric comparisons, for example, ``#if PY_VERSION_HEX >= ...``." -msgstr "" - -#: ../../c-api/apiabiversion.rst:51 -msgid "Run-time version" -msgstr "" - -#: ../../c-api/apiabiversion.rst:55 -msgid "" -"The Python runtime version number encoded in a single constant integer. See :" -"c:func:`Py_PACK_FULL_VERSION` for the encoding details. This contains the " -"Python version used at run time." -msgstr "" - -#: ../../c-api/apiabiversion.rst:59 +#: ../../c-api/apiabiversion.rst:9 msgid "" -"Use this for numeric comparisons, for example, ``if (Py_Version >= ...)``." +"``PY_VERSION_HEX`` is the Python version number encoded in a single integer." msgstr "" +"``PY_VERSION_HEX`` は、Python のバージョン番号を単一の整数に符号化したもので" +"す。" -#: ../../c-api/apiabiversion.rst:65 -msgid "Bit-packing macros" -msgstr "" - -#: ../../c-api/apiabiversion.rst:69 +#: ../../c-api/apiabiversion.rst:11 msgid "" -"Return the given version, encoded as a single 32-bit integer with the " -"following structure:" -msgstr "" - -#: ../../c-api/apiabiversion.rst:75 -msgid "Argument" -msgstr "" - -#: ../../c-api/apiabiversion.rst:73 -msgid "No. of bits" -msgstr "" - -#: ../../c-api/apiabiversion.rst:75 -msgid "Bit mask" -msgstr "" - -#: ../../c-api/apiabiversion.rst:75 -msgid "Bit shift" -msgstr "" - -#: ../../c-api/apiabiversion.rst:73 -msgid "Example values" +"For example if the ``PY_VERSION_HEX`` is set to ``0x030401a2``, the " +"underlying version information can be found by treating it as a 32 bit " +"number in the following manner:" msgstr "" +"例えば、``PY_VERSION_HEX`` に ``0x030401a2`` が設定されていれば、その値を下記" +"のように32ビットの値として扱うことで、バージョン情報を得ることができます:" -#: ../../c-api/apiabiversion.rst:75 ../../c-api/apiabiversion.rst:93 -msgid "``3.4.1a2``" -msgstr "" +#: ../../c-api/apiabiversion.rst:16 +msgid "Bytes" +msgstr "bytes" -#: ../../c-api/apiabiversion.rst:75 ../../c-api/apiabiversion.rst:95 -msgid "``3.10.0``" -msgstr "" +#: ../../c-api/apiabiversion.rst:16 +msgid "Bits (big endian order)" +msgstr "ビット (ビッグエンディアンオーダ)" -#: ../../c-api/apiabiversion.rst:77 -msgid "*major*" -msgstr "" +#: ../../c-api/apiabiversion.rst:16 +msgid "Meaning" +msgstr "意味" -#: ../../c-api/apiabiversion.rst:77 ../../c-api/apiabiversion.rst:79 -#: ../../c-api/apiabiversion.rst:81 -msgid "8" -msgstr "8" +#: ../../c-api/apiabiversion.rst:18 +msgid "``1``" +msgstr "``1``" -#: ../../c-api/apiabiversion.rst:77 -msgid "``0xFF000000``" -msgstr "" +#: ../../c-api/apiabiversion.rst:18 +msgid "``1-8``" +msgstr "``1-8``" -#: ../../c-api/apiabiversion.rst:77 -msgid "24" -msgstr "" +#: ../../c-api/apiabiversion.rst:18 +msgid "``PY_MAJOR_VERSION`` (the ``3`` in ``3.4.1a2``)" +msgstr "``PY_MAJOR_VERSION`` (``3.4.1a2`` 中の ``3``)" -#: ../../c-api/apiabiversion.rst:77 -msgid "``0x03``" -msgstr "``0x03``" - -#: ../../c-api/apiabiversion.rst:79 -msgid "*minor*" -msgstr "" - -#: ../../c-api/apiabiversion.rst:79 -msgid "``0x00FF0000``" -msgstr "" - -#: ../../c-api/apiabiversion.rst:79 -msgid "16" -msgstr "16" - -#: ../../c-api/apiabiversion.rst:79 -msgid "``0x04``" -msgstr "``0x04``" - -#: ../../c-api/apiabiversion.rst:79 -msgid "``0x0A``" -msgstr "" - -#: ../../c-api/apiabiversion.rst:81 -msgid "*micro*" -msgstr "" - -#: ../../c-api/apiabiversion.rst:81 -msgid "``0x0000FF00``" -msgstr "" - -#: ../../c-api/apiabiversion.rst:81 -msgid "``0x01``" -msgstr "``0x01``" - -#: ../../c-api/apiabiversion.rst:81 -msgid "``0x00``" -msgstr "" - -#: ../../c-api/apiabiversion.rst:83 -msgid "*release_level*" -msgstr "" - -#: ../../c-api/apiabiversion.rst:83 ../../c-api/apiabiversion.rst:85 -msgid "4" -msgstr "4" - -#: ../../c-api/apiabiversion.rst:83 -msgid "``0x000000F0``" -msgstr "" - -#: ../../c-api/apiabiversion.rst:83 -msgid "``0xA``" -msgstr "``0xA``" - -#: ../../c-api/apiabiversion.rst:83 -msgid "``0xF``" -msgstr "" - -#: ../../c-api/apiabiversion.rst:85 -msgid "*release_serial*" -msgstr "" - -#: ../../c-api/apiabiversion.rst:85 -msgid "``0x0000000F``" -msgstr "" - -#: ../../c-api/apiabiversion.rst:85 -msgid "0" -msgstr "0" +#: ../../c-api/apiabiversion.rst:21 +msgid "``2``" +msgstr "``2``" -#: ../../c-api/apiabiversion.rst:85 -msgid "``0x2``" -msgstr "``0x2``" +#: ../../c-api/apiabiversion.rst:21 +msgid "``9-16``" +msgstr "``9-16``" -#: ../../c-api/apiabiversion.rst:85 -msgid "``0x0``" -msgstr "" +#: ../../c-api/apiabiversion.rst:21 +msgid "``PY_MINOR_VERSION`` (the ``4`` in ``3.4.1a2``)" +msgstr "``PY_MINOR_VERSION`` (``3.4.1a2`` 中の ``4``)" -#: ../../c-api/apiabiversion.rst:88 -msgid "For example:" -msgstr "例えば:" +#: ../../c-api/apiabiversion.rst:24 +msgid "``3``" +msgstr "``3``" -#: ../../c-api/apiabiversion.rst:91 -msgid "Version" -msgstr "Version" +#: ../../c-api/apiabiversion.rst:24 +msgid "``17-24``" +msgstr "``17-24``" -#: ../../c-api/apiabiversion.rst:91 -msgid "``Py_PACK_FULL_VERSION`` arguments" -msgstr "" +#: ../../c-api/apiabiversion.rst:24 +msgid "``PY_MICRO_VERSION`` (the ``1`` in ``3.4.1a2``)" +msgstr "``PY_MICRO_VERSION`` (``3.4.1a2`` 中の ``1``)" -#: ../../c-api/apiabiversion.rst:91 -msgid "Encoded version" -msgstr "" +#: ../../c-api/apiabiversion.rst:27 +msgid "``4``" +msgstr "``4``" -#: ../../c-api/apiabiversion.rst:93 -msgid "``(3, 4, 1, 0xA, 2)``" -msgstr "" +#: ../../c-api/apiabiversion.rst:27 +msgid "``25-28``" +msgstr "``25-28``" -#: ../../c-api/apiabiversion.rst:93 -msgid "``0x030401a2``" -msgstr "" - -#: ../../c-api/apiabiversion.rst:95 -msgid "``(3, 10, 0, 0xF, 0)``" -msgstr "" - -#: ../../c-api/apiabiversion.rst:95 -msgid "``0x030a00f0``" -msgstr "" - -#: ../../c-api/apiabiversion.rst:98 +#: ../../c-api/apiabiversion.rst:27 msgid "" -"Out-of range bits in the arguments are ignored. That is, the macro can be " -"defined as:" +"``PY_RELEASE_LEVEL`` (``0xA`` for alpha, ``0xB`` for beta, ``0xC`` for " +"release candidate and ``0xF`` for final), in this case it is alpha." msgstr "" +"``PY_RELEASE_LEVEL`` (アルファ版では ``0xA``、ベータ版では ``0xB``、リリース" +"候補版では ``0xC``、そして最終版は ``0xF``)、この例ではアルファ版を意味してい" +"ます。" -#: ../../c-api/apiabiversion.rst:101 -msgid "" -"#ifndef Py_PACK_FULL_VERSION\n" -"#define Py_PACK_FULL_VERSION(X, Y, Z, LEVEL, SERIAL) ( \\\n" -" (((X) & 0xff) << 24) | \\\n" -" (((Y) & 0xff) << 16) | \\\n" -" (((Z) & 0xff) << 8) | \\\n" -" (((LEVEL) & 0xf) << 4) | \\\n" -" (((SERIAL) & 0xf) << 0))\n" -"#endif" -msgstr "" +#: ../../c-api/apiabiversion.rst:32 +msgid "``29-32``" +msgstr "``29-32``" -#: ../../c-api/apiabiversion.rst:112 +#: ../../c-api/apiabiversion.rst:32 msgid "" -"``Py_PACK_FULL_VERSION`` is primarily a macro, intended for use in ``#if`` " -"directives, but it is also available as an exported function." -msgstr "" +"``PY_RELEASE_SERIAL`` (the ``2`` in ``3.4.1a2``, zero for final releases)" +msgstr "``PY_RELEASE_SERIAL`` (``3.4.1a2`` 中の ``2``、最終リリースでは 0)" -#: ../../c-api/apiabiversion.rst:119 -msgid "" -"Equivalent to ``Py_PACK_FULL_VERSION(major, minor, 0, 0, 0)``. The result " -"does not correspond to any Python release, but is useful in numeric " -"comparisons." -msgstr "" +#: ../../c-api/apiabiversion.rst:36 +msgid "Thus ``3.4.1a2`` is hexversion ``0x030401a2``." +msgstr "従って、``3.4.1a2`` は hexversionで ``0x030401a2`` です。" + +#: ../../c-api/apiabiversion.rst:38 +msgid "All the given macros are defined in :source:`Include/patchlevel.h`." +msgstr "これらのマクロは :source:`Include/patchlevel.h` で定義されています。" diff --git a/c-api/arg.po b/c-api/arg.po index dd4ca8d6b..485cfb952 100644 --- a/c-api/arg.po +++ b/c-api/arg.po @@ -1,28 +1,33 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Arihiro TAKASE, 2023 -# tomo, 2024 -# 石井明久, 2024 -# Taichi Haradaguchi, 2025 +# Nozomu Kaneko , 2017 +# Arihiro TAKASE, 2017 +# 秘湯 , 2017 +# Kenji Noguchi , 2017 +# Inada Naoki , 2017 +# Osamu NAKAMURA, 2018 +# 永田 大和 , 2019 +# tomo, 2020 +# Mikami Akiko, 2021 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-06 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:47+0000\n" -"Last-Translator: Taichi Haradaguchi, 2025\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 17:33+0000\n" +"Last-Translator: Mikami Akiko, 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/arg.rst:6 @@ -31,10 +36,12 @@ msgstr "引数の解釈と値の構築" #: ../../c-api/arg.rst:8 msgid "" -"These functions are useful when creating your own extension functions and " +"These functions are useful when creating your own extensions functions and " "methods. Additional information and examples are available in :ref:" "`extending-index`." msgstr "" +"これらの関数は独自の拡張モジュール用の関数やメソッドを作成する際に便利です。" +"詳しい情報や用例は :ref:`extending-index` にあります。" #: ../../c-api/arg.rst:12 msgid "" @@ -73,23 +80,11 @@ msgstr "" "書式単位に対応する Python のオブジェクト型です; [角] 括弧は値をアドレス渡しす" "る際に使う C の変数型です。" -#: ../../c-api/arg.rst:33 +#: ../../c-api/arg.rst:31 msgid "Strings and buffers" msgstr "文字列とバッファ" -#: ../../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 "" -"Python 3.12 以前では、以下で説明された全ての ``#`` の種類 (``s#``, ``y#`` な" -"ど) を使用するために :c:macro:`!PY_SSIZE_T_CLEAN` マクロを :file:`Python.h` " -"のインクルードの前に定義しなければなりません。これは Python 3.13 以降では不要" -"です。" - -#: ../../c-api/arg.rst:42 +#: ../../c-api/arg.rst:33 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." @@ -98,60 +93,74 @@ msgstr "" "めのものです。返される unicode や bytes のために生のストレージを用意する必要" "はありません。" -#: ../../c-api/arg.rst:46 -msgid "Unless otherwise stated, buffers are not NUL-terminated." -msgstr "特に言及されていない場合、バッファーは NUL 終端されていません。" - -#: ../../c-api/arg.rst:48 -msgid "There are three ways strings and buffers can be converted to C:" -msgstr "" - -#: ../../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 " -"buffer even inside a :c:type:`Py_BEGIN_ALLOW_THREADS` block without the risk " -"of mutable data being resized or destroyed. As a result, **you have to " -"call** :c:func:`PyBuffer_Release` after you have finished processing the " -"data (or in any early abort case)." -msgstr "" - -#: ../../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:63 +#: ../../c-api/arg.rst:37 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 " -"buffer. In this case the buffer is \"borrowed\": it is managed by the " -"corresponding Python object, and shares the lifetime of this object. You " -"won't have to release any memory yourself." +"In general, when a format sets a pointer to a buffer, the buffer is managed " +"by the corresponding Python object, and the buffer shares the lifetime of " +"this object. You won't have to release any memory yourself. The only " +"exceptions are ``es``, ``es#``, ``et`` and ``et#``." msgstr "" +"一般に、フォーマットがバッファにポインタをセットする時は、そのバッファは対応" +"する Python オブジェクトにより管理され、バッファはそのオブジェクトのライフタ" +"イムを共有します。自分自身でメモリを解放する必要はありません。この例外は、 " +"``es``, ``es#``, ``et``, ``et#`` だけです。" -#: ../../c-api/arg.rst:70 +#: ../../c-api/arg.rst:42 msgid "" -"To ensure that the underlying buffer may be safely borrowed, the object's :c:" -"member:`PyBufferProcs.bf_releasebuffer` field must be ``NULL``. This " -"disallows common mutable objects such as :class:`bytearray`, but also some " -"read-only objects such as :class:`memoryview` of :class:`bytes`." -msgstr "" +"However, when a :c:type:`Py_buffer` structure gets filled, the underlying " +"buffer is locked so that the caller can subsequently use the buffer even " +"inside a :c:type:`Py_BEGIN_ALLOW_THREADS` block without the risk of mutable " +"data being resized or destroyed. As a result, **you have to call** :c:func:" +"`PyBuffer_Release` after you have finished processing the data (or in any " +"early abort case)." +msgstr "" +"ただし、 :c:type:`Py_buffer` 構造体に格納されたバッファーはロックされて、呼び" +"出し側はそのバッファーを :c:type:`Py_BEGIN_ALLOW_THREADS` ブロック内でも、 " +"mutable なデータが破棄されたりリサイズされたりするリスク無しに利用することが" +"できます。そのかわりに、そのデータに対する処理が終わった場合 (もしくは処理せ" +"ずに中断した場合) には **必ず** :c:func:`PyBuffer_Release` を呼ばなければなり" +"ません。" -#: ../../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:49 +msgid "Unless otherwise stated, buffers are not NUL-terminated." +msgstr "特に言及されていない場合、バッファーは NUL 終端されていません。" -#: ../../c-api/arg.rst:80 +#: ../../c-api/arg.rst:51 +msgid "" +"Some formats require a read-only :term:`bytes-like object`, and set a " +"pointer instead of a buffer structure. They work by checking that the " +"object's :c:member:`PyBufferProcs.bf_releasebuffer` field is ``NULL``, which " +"disallows mutable objects such as :class:`bytearray`." +msgstr "" +"いくつかのフォーマットは読み込み専用の :term:`bytes-like オブジェクト ` を必要とし、バッファ構造体の代わりにポインタをセットします。そ" +"れらは、オブジェクトの :c:member:`PyBufferProcs.bf_releasebuffer` フィールド" +"が ``NULL`` であることをチェックして動きます。これは :class:`bytearray` など" +"の変更可能オブジェクトを禁止します。" + +#: ../../c-api/arg.rst:58 +msgid "" +"For all ``#`` variants of formats (``s#``, ``y#``, etc.), the type of the " +"length argument (int or :c:type:`Py_ssize_t`) is controlled by defining the " +"macro :c:macro:`PY_SSIZE_T_CLEAN` before including :file:`Python.h`. If the " +"macro was defined, length is a :c:type:`Py_ssize_t` rather than an :c:type:" +"`int`. This behavior will change in a future Python version to only support :" +"c:type:`Py_ssize_t` and drop :c:type:`int` support. It is best to always " +"define :c:macro:`PY_SSIZE_T_CLEAN`." +msgstr "" +"全ての ``#`` 型のフォーマット (``s#``, ``y#``, など) において、length 引数の" +"型 (int か :c:type:`Py_ssize_t`) は :file:`Python.h` を include する前に :c:" +"macro:`PY_SSIZE_T_CLEAN` マクロを定義することで制御します。マクロが定義されて" +"いる場合、 length は :c:type:`int` 型ではなく :c:type:`Py_ssize_t` 型になりま" +"す。この挙動は将来の Python バージョンで変更され、 :c:type:`Py_ssize_t` のみ" +"がサポートされて :c:type:`int` はサポートされなくなるでしょう。常に :c:macro:" +"`PY_SSIZE_T_CLEAN` を定義したほうが良いです。" + +#: ../../c-api/arg.rst:85 msgid "``s`` (:class:`str`) [const char \\*]" msgstr "``s`` (:class:`str`) [const char \\*]" -#: ../../c-api/arg.rst:81 +#: ../../c-api/arg.rst:68 msgid "" "Convert a Unicode object to a C pointer to a character string. A pointer to " "an existing string is stored in the character pointer variable whose address " @@ -168,7 +177,7 @@ msgstr "" "``'utf-8'`` を使って C 文字列に変換されます。変換に失敗すると :exc:" "`UnicodeError` を送出します。" -#: ../../c-api/arg.rst:90 +#: ../../c-api/arg.rst:77 msgid "" "This format does not accept :term:`bytes-like objects `. " "If you want to accept filesystem paths and convert them to C character " @@ -181,7 +190,7 @@ msgstr "" "フォーマットを、\n" "*converter* に :c:func:`PyUnicode_FSConverter` を指定して利用すると良いです。" -#: ../../c-api/arg.rst:96 +#: ../../c-api/arg.rst:83 ../../c-api/arg.rst:150 msgid "" "Previously, :exc:`TypeError` was raised when embedded null code points were " "encountered in the Python string." @@ -189,11 +198,11 @@ msgstr "" "以前は Python 文字列に null コードポイントが埋め込まれていたときに :exc:" "`TypeError` を送出していました。" -#: ../../c-api/arg.rst:100 +#: ../../c-api/arg.rst:91 msgid "``s*`` (:class:`str` or :term:`bytes-like object`) [Py_buffer]" msgstr "``s*`` (:class:`str` または :term:`bytes-like object`) [Py_buffer]" -#: ../../c-api/arg.rst:101 +#: ../../c-api/arg.rst:88 msgid "" "This format accepts Unicode objects as well as bytes-like objects. It fills " "a :c:type:`Py_buffer` structure provided by the caller. In this case the " @@ -206,76 +215,86 @@ msgstr "" "Unicode オブジェクトは ``'utf-8'`` エンコーディングで C 文字列に変換されま" "す。" -#: ../../c-api/arg.rst:106 +#: ../../c-api/arg.rst:98 msgid "" -"``s#`` (:class:`str`, read-only :term:`bytes-like object`) [const char \\*, :" -"c:type:`Py_ssize_t`]" +"``s#`` (:class:`str`, read-only :term:`bytes-like object`) [const char \\*, " +"int or :c:type:`Py_ssize_t`]" msgstr "" -"``s#`` (:class:`str`, 読み取り専用の :term:`bytes-like object`) [const char " -"\\*, :c:type:`Py_ssize_t`]" +"``s#`` (:class:`str`, 読み出し専用の :term:`bytes-like object`) [const char " +"\\*, int or :c:type:`Py_ssize_t`]" -#: ../../c-api/arg.rst:107 +#: ../../c-api/arg.rst:94 msgid "" -"Like ``s*``, except that it provides a :ref:`borrowed buffer `. The result is stored into two C variables, the first one a pointer " -"to a C string, the second one its length. The string may contain embedded " -"null bytes. Unicode objects are converted to C strings using ``'utf-8'`` " -"encoding." +"Like ``s*``, except that it doesn't accept mutable objects. The result is " +"stored into two C variables, the first one a pointer to a C string, the " +"second one its length. The string may contain embedded null bytes. Unicode " +"objects are converted to C strings using ``'utf-8'`` encoding." msgstr "" +"``s*`` と同じですが、 mutable なオブジェクトを受け取りません。結果は2つのC変" +"数に格納されます。1つ目はC文字列へのポインターで、2つ目はその長さです。受け" +"取った文字列は null バイトを含むかもしれません。 Unicode オブジェクトは " +"``'utf-8'`` エンコーディングを利用して C 文字列に変換されます。" -#: ../../c-api/arg.rst:113 ../../c-api/arg.rst:629 +#: ../../c-api/arg.rst:102 ../../c-api/arg.rst:566 msgid "``z`` (:class:`str` or ``None``) [const char \\*]" msgstr "``z`` (:class:`str` または ``None``) [const char \\*]" -#: ../../c-api/arg.rst:114 +#: ../../c-api/arg.rst:101 msgid "" "Like ``s``, but the Python object may also be ``None``, in which case the C " -"pointer is set to ``NULL``. It is the same as ``s?`` with the C pointer was " -"initialized to ``NULL``." +"pointer is set to ``NULL``." msgstr "" +"``s`` に似ていますが、Python オブジェクトは ``None`` でもよく、その場合には " +"C のポインタは ``NULL`` にセットされます。" -#: ../../c-api/arg.rst:118 +#: ../../c-api/arg.rst:106 msgid "" "``z*`` (:class:`str`, :term:`bytes-like object` or ``None``) [Py_buffer]" msgstr "" "``z*`` (:class:`str`, :term:`bytes-like object` または ``None``) [Py_buffer]" -#: ../../c-api/arg.rst:119 +#: ../../c-api/arg.rst:105 msgid "" "Like ``s*``, but the Python object may also be ``None``, in which case the " -"``buf`` member of the :c:type:`Py_buffer` structure is set to ``NULL``. It " -"is the same as ``s*?`` with the ``buf`` member of the :c:type:`Py_buffer` " -"structure was initialized to ``NULL``." +"``buf`` member of the :c:type:`Py_buffer` structure is set to ``NULL``." msgstr "" +"``s*`` と同じですが、 Python の ``None`` オブジェクトを受け取ることができま" +"す。その場合、 :c:type:`Py_buffer` 構造体の ``buf`` メンバーは ``NULL`` にな" +"ります。" -#: ../../c-api/arg.rst:124 +#: ../../c-api/arg.rst:110 msgid "" "``z#`` (:class:`str`, read-only :term:`bytes-like object` or ``None``) " -"[const char \\*, :c:type:`Py_ssize_t`]" +"[const char \\*, int or :c:type:`Py_ssize_t`]" msgstr "" "``z#`` (:class:`str`, 読み出し専用の :term:`bytes-like object` または " -"``None``) [const char \\*, :c:type:`Py_ssize_t`]" +"``None``) [const char \\*, int or :c:type:`Py_ssize_t`]" -#: ../../c-api/arg.rst:125 +#: ../../c-api/arg.rst:109 msgid "" "Like ``s#``, but the Python object may also be ``None``, in which case the C " -"pointer is set to ``NULL``. It is the same as ``s#?`` with the C pointer was " -"initialized to ``NULL``." +"pointer is set to ``NULL``." msgstr "" +"``s#`` に似ていますが、Python オブジェクトは ``None`` でもよく、その場合には " +"C のポインタは ``NULL`` にセットされます。" -#: ../../c-api/arg.rst:129 +#: ../../c-api/arg.rst:120 msgid "``y`` (read-only :term:`bytes-like object`) [const char \\*]" msgstr "``y`` (読み出し専用の :term:`bytes-like object`) [const char \\*]" -#: ../../c-api/arg.rst:130 +#: ../../c-api/arg.rst:113 msgid "" -"This format converts a bytes-like object to a C pointer to a :ref:`borrowed " -"` character string; it does not accept Unicode " -"objects. The bytes buffer must not contain embedded null bytes; if it does, " -"a :exc:`ValueError` exception is raised." +"This format converts a bytes-like object to a C pointer to a character " +"string; it does not accept Unicode objects. The bytes buffer must not " +"contain embedded null bytes; if it does, a :exc:`ValueError` exception is " +"raised." msgstr "" +"このフォーマットは bytes-like object をキャラクタ文字列を指す C のポインタに" +"変換します; Unicode オブジェクトを受け付けません。バイトバッファは null バイ" +"トを含むべきではありません; null バイトを含む場合は :exc:`ValueError` 例外を" +"送出します。" -#: ../../c-api/arg.rst:136 +#: ../../c-api/arg.rst:118 msgid "" "Previously, :exc:`TypeError` was raised when embedded null bytes were " "encountered in the bytes buffer." @@ -283,11 +302,11 @@ msgstr "" "以前は bytes バッファにヌルバイトが埋め込まれていたときに :exc:`TypeError` を" "送出していました。" -#: ../../c-api/arg.rst:140 +#: ../../c-api/arg.rst:125 msgid "``y*`` (:term:`bytes-like object`) [Py_buffer]" msgstr "``y*`` (:term:`bytes-like object`) [Py_buffer]" -#: ../../c-api/arg.rst:141 +#: ../../c-api/arg.rst:123 msgid "" "This variant on ``s*`` doesn't accept Unicode objects, only bytes-like " "objects. **This is the recommended way to accept binary data.**" @@ -297,15 +316,15 @@ msgstr "" "**バイナリデータを受け付ける目的には、このフォーマットを使うことを推奨しま" "す。**" -#: ../../c-api/arg.rst:145 +#: ../../c-api/arg.rst:129 msgid "" -"``y#`` (read-only :term:`bytes-like object`) [const char \\*, :c:type:" +"``y#`` (read-only :term:`bytes-like object`) [const char \\*, int or :c:type:" "`Py_ssize_t`]" msgstr "" -"``y#`` (読み出し専用の :term:`bytes-like object`) [const char \\*, :c:type:" -"`Py_ssize_t`]" +"``y#`` (読み出し専用の :term:`bytes-like object`) [const char \\*, int or :c:" +"type:`Py_ssize_t`]" -#: ../../c-api/arg.rst:146 +#: ../../c-api/arg.rst:128 msgid "" "This variant on ``s#`` doesn't accept Unicode objects, only bytes-like " "objects." @@ -313,55 +332,130 @@ msgstr "" "``s#`` の変形で、 Unicode オブジェクトを受け付けず、bytes-like object だけを" "受け付けます。" -#: ../../c-api/arg.rst:149 +#: ../../c-api/arg.rst:134 msgid "``S`` (:class:`bytes`) [PyBytesObject \\*]" msgstr "``S`` (:class:`bytes`) [PyBytesObject \\*]" -#: ../../c-api/arg.rst:150 +#: ../../c-api/arg.rst:132 msgid "" "Requires that the Python object is a :class:`bytes` object, without " "attempting any conversion. Raises :exc:`TypeError` if the object is not a " -"bytes object. The C variable may also be declared as :c:expr:`PyObject*`." +"bytes object. The C variable may also be declared as :c:type:`PyObject*`." msgstr "" "Pythonオブジェクトとして、 :class:`bytes` オブジェクトを要求し、いかなる変換" "も行いません。オブジェクトが bytes オブジェクトでなければ、 :exc:`TypeError` " -"を送出します。C 変数は :c:expr:`PyObject*` と宣言しても構いません。" +"を送出します。C 変数は :c:type:`PyObject*` と宣言しても構いません。" -#: ../../c-api/arg.rst:154 +#: ../../c-api/arg.rst:139 msgid "``Y`` (:class:`bytearray`) [PyByteArrayObject \\*]" msgstr "``Y`` (:class:`bytearray`) [PyByteArrayObject \\*]" -#: ../../c-api/arg.rst:155 +#: ../../c-api/arg.rst:137 msgid "" "Requires that the Python object is a :class:`bytearray` object, without " "attempting any conversion. Raises :exc:`TypeError` if the object is not a :" -"class:`bytearray` object. The C variable may also be declared as :c:expr:" +"class:`bytearray` object. The C variable may also be declared as :c:type:" "`PyObject*`." msgstr "" "Python オブジェクトとして :class:`bytearray` オブジェクトを要求し、いかなる変" "換もおこないません。 もしオブジェクトが :class:`bytearray` でなければ、 :exc:" -"`TypeError` を送出します。C 変数は :c:expr:`PyObject*` として宣言しても構いま" +"`TypeError` を送出します。C 変数は :c:type:`PyObject*` として宣言しても構いま" "せん。" +#: ../../c-api/arg.rst:156 +msgid "``u`` (:class:`str`) [const Py_UNICODE \\*]" +msgstr "``u`` (:class:`str`) [const Py_UNICODE \\*]" + +#: ../../c-api/arg.rst:142 +msgid "" +"Convert a Python Unicode object to a C pointer to a NUL-terminated buffer of " +"Unicode characters. You must pass the address of a :c:type:`Py_UNICODE` " +"pointer variable, which will be filled with the pointer to an existing " +"Unicode buffer. Please note that the width of a :c:type:`Py_UNICODE` " +"character depends on compilation options (it is either 16 or 32 bits). The " +"Python string must not contain embedded null code points; if it does, a :exc:" +"`ValueError` exception is raised." +msgstr "" +"Python Unicodeオブジェクトを NUL終端されたUnicode文字バッファへのポインタに変" +"換します。 :c:type:`Py_UNICODE` ポインタ変数へのアドレスを渡さなければなら" +"ず、このアドレスに存在する Unicode バッファへのポインタが格納されます。 :c:" +"type:`Py_UNICODE` 文字のバイト幅はコンパイルオプション(16 または32ビットのど" +"ちらか)に依存することに注意してください。Python 文字列は null コードポイント" +"を含んではなりません; null コードポイントを含む場合、 :exc:`ValueError` 例外" +"が送出されます。" + +#: ../../c-api/arg.rst:157 ../../c-api/arg.rst:166 ../../c-api/arg.rst:174 +#: ../../c-api/arg.rst:182 +msgid "" +"Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using :c:" +"func:`PyUnicode_AsWideCharString`." +msgstr "" +"古いスタイルの :c:type:`Py_UNICODE` APIの一部です。:c:func:" +"`PyUnicode_AsWideCharString` を使用するように移行してください。" + +#: ../../c-api/arg.rst:165 +msgid "" +"``u#`` (:class:`str`) [const Py_UNICODE \\*, int or :c:type:`Py_ssize_t`]" +msgstr "" +"``u#`` (:class:`str`) [const Py_UNICODE \\*, int または :c:type:`Py_ssize_t`]" + #: ../../c-api/arg.rst:159 +msgid "" +"This variant on ``u`` stores into two C variables, the first one a pointer " +"to a Unicode data buffer, the second one its length. This variant allows " +"null code points." +msgstr "" +"これは ``u`` のバリエーションで、値を二つの変数に記録します。一つ目の変数は " +"Unicode データバッファへのポインタで、二つ目はその長さです。このフォーマット" +"は null コードポイントを含むことができます。" + +#: ../../c-api/arg.rst:173 +msgid "``Z`` (:class:`str` or ``None``) [const Py_UNICODE \\*]" +msgstr "``Z`` (:class:`str` または ``None``) [const Py_UNICODE \\*]" + +#: ../../c-api/arg.rst:168 +msgid "" +"Like ``u``, but the Python object may also be ``None``, in which case the :c:" +"type:`Py_UNICODE` pointer is set to ``NULL``." +msgstr "" +"``u`` に似ていますが、Python オブジェクトは ``None`` でもよく、その場合には :" +"c:type:`Py_UNICODE` ポインタは ``NULL`` にセットされます。" + +#: ../../c-api/arg.rst:181 +msgid "" +"``Z#`` (:class:`str` or ``None``) [const Py_UNICODE \\*, int or :c:type:" +"`Py_ssize_t`]" +msgstr "" +"``Z#`` (:class:`str` または ``None``) [const Py_UNICODE \\*, int または :c:" +"type:`Py_ssize_t`]" + +#: ../../c-api/arg.rst:176 +msgid "" +"Like ``u#``, but the Python object may also be ``None``, in which case the :" +"c:type:`Py_UNICODE` pointer is set to ``NULL``." +msgstr "" +"``u#`` に似ていますが、 Python オブジェクトは ``None`` でもよく、その場合に" +"は :c:type:`Py_UNICODE` ポインタは ``NULL`` にセットされます。" + +#: ../../c-api/arg.rst:186 msgid "``U`` (:class:`str`) [PyObject \\*]" msgstr "``U`` (:class:`str`) [PyObject \\*]" -#: ../../c-api/arg.rst:160 +#: ../../c-api/arg.rst:184 msgid "" "Requires that the Python object is a Unicode object, without attempting any " "conversion. Raises :exc:`TypeError` if the object is not a Unicode object. " -"The C variable may also be declared as :c:expr:`PyObject*`." +"The C variable may also be declared as :c:type:`PyObject*`." msgstr "" "Python オブジェクトとして Unicode オブジェクトを要求し、いかなる変換も行いま" "せん。オブジェクトが Unicode オブジェクトではない場合、 :exc:`TypeError` が送" -"出されます。C変数は :c:expr:`PyObject*` として宣言しても構いません。" +"出されます。C変数は :c:type:`PyObject*` として宣言しても構いません。" -#: ../../c-api/arg.rst:164 +#: ../../c-api/arg.rst:192 msgid "``w*`` (read-write :term:`bytes-like object`) [Py_buffer]" msgstr "``w*`` (読み書き可能な :term:`bytes-like object`) [Py_buffer]" -#: ../../c-api/arg.rst:165 +#: ../../c-api/arg.rst:189 msgid "" "This format accepts any object which implements the read-write buffer " "interface. It fills a :c:type:`Py_buffer` structure provided by the caller. " @@ -373,11 +467,11 @@ msgstr "" "ます。バッファは nullバイトを含むかもしれず、呼び出し元はバッファを使い終わっ" "たら :c:func:`PyBuffer_Release` を呼び出さなければなりません。" -#: ../../c-api/arg.rst:170 +#: ../../c-api/arg.rst:209 msgid "``es`` (:class:`str`) [const char \\*encoding, char \\*\\*buffer]" msgstr "``es`` (:class:`str`) [const char \\*encoding, char \\*\\*buffer]" -#: ../../c-api/arg.rst:171 +#: ../../c-api/arg.rst:195 msgid "" "This variant on ``s`` is used for encoding Unicode into a character buffer. " "It only works for encoded data without embedded NUL bytes." @@ -385,25 +479,25 @@ msgstr "" "これは ``s`` の変化形で、Unicodeをキャラクタ型バッファにエンコードするために" "用いられます。NULバイトが埋め込まれていないデータでのみ動作します。" -#: ../../c-api/arg.rst:174 +#: ../../c-api/arg.rst:198 msgid "" "This format requires two arguments. The first is only used as input, and " -"must be a :c:expr:`const char*` which points to the name of an encoding as a " +"must be a :c:type:`const char*` which points to the name of an encoding as a " "NUL-terminated string, or ``NULL``, in which case ``'utf-8'`` encoding is " "used. An exception is raised if the named encoding is not known to Python. " -"The second argument must be a :c:expr:`char**`; the value of the pointer it " +"The second argument must be a :c:type:`char**`; the value of the pointer it " "references will be set to a buffer with the contents of the argument text. " "The text will be encoded in the encoding specified by the first argument." msgstr "" "この書式には二つの引数が必要です。一つ目は入力にのみ用いられ、 NUL で終端され" -"たエンコード名文字列を指す :c:expr:`const char*` 型または、 ``'utf-8'`` が使" +"たエンコード名文字列を指す :c:type:`const char*` 型または、 ``'utf-8'`` が使" "われることを表す ``NULL`` でなければなりません。指定したエンコード名を " -"Python が理解できない場合には例外を送出します。第二の引数は :c:expr:`char**` " +"Python が理解できない場合には例外を送出します。第二の引数は :c:type:`char**` " "でなければなりません; この引数が参照しているポインタの値は、引数に指定したテ" "キストの内容が入ったバッファへのポインタになります。テキストは最初の引数に指" "定したエンコード方式でエンコードされます。" -#: ../../c-api/arg.rst:182 +#: ../../c-api/arg.rst:206 msgid "" ":c:func:`PyArg_ParseTuple` will allocate a buffer of the needed size, copy " "the encoded data into this buffer and adjust *\\*buffer* to reference the " @@ -415,7 +509,7 @@ msgstr "" "憶領域を指すように変更します。呼び出し側には、確保されたバッファを使い終わっ" "た後に :c:func:`PyMem_Free` で解放する責任があります。" -#: ../../c-api/arg.rst:187 +#: ../../c-api/arg.rst:214 msgid "" "``et`` (:class:`str`, :class:`bytes` or :class:`bytearray`) [const char " "\\*encoding, char \\*\\*buffer]" @@ -423,7 +517,7 @@ msgstr "" "``et`` (:class:`str`, :class:`bytes` または :class:`bytearray`) [const char " "\\*encoding, char \\*\\*buffer]" -#: ../../c-api/arg.rst:188 +#: ../../c-api/arg.rst:212 msgid "" "Same as ``es`` except that byte string objects are passed through without " "recoding them. Instead, the implementation assumes that the byte string " @@ -433,15 +527,15 @@ msgstr "" "ます。その代わり、実装ではバイト文字列オブジェクトがパラメタに渡したエンコー" "ドを使っているものと仮定します。" -#: ../../c-api/arg.rst:192 +#: ../../c-api/arg.rst:245 msgid "" -"``es#`` (:class:`str`) [const char \\*encoding, char \\*\\*buffer, :c:type:" -"`Py_ssize_t` \\*buffer_length]" +"``es#`` (:class:`str`) [const char \\*encoding, char \\*\\*buffer, int or :c:" +"type:`Py_ssize_t` \\*buffer_length]" msgstr "" -"``es#`` (:class:`str`) [const char \\*encoding, char \\*\\*buffer, :c:type:" -"`Py_ssize_t` \\*buffer_length]" +"``es#`` (:class:`str`) [const char \\*encoding, char \\*\\*buffer, int また" +"は :c:type:`Py_ssize_t` \\*buffer_length]" -#: ../../c-api/arg.rst:193 +#: ../../c-api/arg.rst:217 msgid "" "This variant on ``s#`` is used for encoding Unicode into a character buffer. " "Unlike the ``es`` format, this variant allows input data which contains NUL " @@ -451,33 +545,33 @@ msgstr "" "れます。``es`` 書式違って、この変化形はバイトが埋め込まれていてもかまいませ" "ん。" -#: ../../c-api/arg.rst:197 +#: ../../c-api/arg.rst:221 msgid "" "It requires three arguments. The first is only used as input, and must be " -"a :c:expr:`const char*` which points to the name of an encoding as a NUL-" +"a :c:type:`const char*` which points to the name of an encoding as a NUL-" "terminated string, or ``NULL``, in which case ``'utf-8'`` encoding is used. " "An exception is raised if the named encoding is not known to Python. The " -"second argument must be a :c:expr:`char**`; the value of the pointer it " +"second argument must be a :c:type:`char**`; the value of the pointer it " "references will be set to a buffer with the contents of the argument text. " "The text will be encoded in the encoding specified by the first argument. " "The third argument must be a pointer to an integer; the referenced integer " "will be set to the number of bytes in the output buffer." msgstr "" "この書式には三つの引数が必要です。一つ目は入力にのみ用いられ、 NUL で終端され" -"たエンコード名文字列を指す :c:expr:`const char*` 型か ``NULL`` でなければなり" -"ません。 ``NULL`` の場合には ``'utf-8'`` を使います。指定したエンコード名を " -"Python が理解できない場合には例外を送出します。第二の引数は :c:expr:`char**` " -"でなければなりません; この引数が参照しているポインタの値は、引数に指定したテ" -"キストの内容が入ったバッファへのポインタになります。テキストは最初の引数に指" -"定したエンコード方式でエンコードされます。第三の引数は整数へのポインタでなけ" -"ればなりません; ポインタが参照している整数の値は出力バッファ内のバイト数に" -"セットされます。" - -#: ../../c-api/arg.rst:207 +"たエンコード名文字列を指す :c:type:`const char\\*` 型か ``NULL`` でなければな" +"りません。 ``NULL`` の場合には ``'utf-8'`` を使います。指定したエンコード名" +"を Python が理解できない場合には例外を送出します。第二の引数は :c:type:" +"`char**` でなければなりません; この引数が参照しているポインタの値は、引数に指" +"定したテキストの内容が入ったバッファへのポインタになります。テキストは最初の" +"引数に指定したエンコード方式でエンコードされます。第三の引数は整数へのポイン" +"タでなければなりません; ポインタが参照している整数の値は出力バッファ内のバイ" +"ト数にセットされます。" + +#: ../../c-api/arg.rst:231 msgid "There are two modes of operation:" msgstr "この書式の処理には二つのモードがあります:" -#: ../../c-api/arg.rst:209 +#: ../../c-api/arg.rst:233 msgid "" "If *\\*buffer* points a ``NULL`` pointer, the function will allocate a " "buffer of the needed size, copy the encoded data into this buffer and set " @@ -490,7 +584,7 @@ msgstr "" "この新たに確保された記憶領域を指すように変更します。呼び出し側には、確保され" "たバッファを使い終わった後に :c:func:`PyMem_Free` で解放する責任があります。" -#: ../../c-api/arg.rst:214 +#: ../../c-api/arg.rst:238 msgid "" "If *\\*buffer* points to a non-``NULL`` pointer (an already allocated " "buffer), :c:func:`PyArg_ParseTuple` will use this location as the buffer and " @@ -504,7 +598,7 @@ msgstr "" "PyArg_ParseTuple は次にエンコード済みのデータをバッファにコピーして、NUL で終" "端します。バッファの大きさが足りなければ :exc:`ValueError` がセットされます。" -#: ../../c-api/arg.rst:220 +#: ../../c-api/arg.rst:244 msgid "" "In both cases, *\\*buffer_length* is set to the length of the encoded data " "without the trailing NUL byte." @@ -512,15 +606,16 @@ msgstr "" "どちらの場合も、 *\\*buffer_length* は終端の NUL バイトを含まないエンコード済" "みデータの長さにセットされます。" -#: ../../c-api/arg.rst:223 +#: ../../c-api/arg.rst:250 msgid "" "``et#`` (:class:`str`, :class:`bytes` or :class:`bytearray`) [const char " -"\\*encoding, char \\*\\*buffer, :c:type:`Py_ssize_t` \\*buffer_length]" +"\\*encoding, char \\*\\*buffer, int or :c:type:`Py_ssize_t` \\*buffer_length]" msgstr "" "``et#`` (:class:`str`, :class:`bytes` または :class:`bytearray`) [const char " -"\\*encoding, char \\*\\*buffer, :c:type:`Py_ssize_t` \\*buffer_length]" +"\\*encoding, char \\*\\*buffer, int または :c:type:`Py_ssize_t` " +"\\*buffer_length]" -#: ../../c-api/arg.rst:224 +#: ../../c-api/arg.rst:248 msgid "" "Same as ``es#`` except that byte string objects are passed through without " "recoding them. Instead, the implementation assumes that the byte string " @@ -530,290 +625,264 @@ msgstr "" "します。その代わり、実装ではバイト文字列オブジェクトがパラメタに渡したエン" "コードを使っているものと仮定します。" -#: ../../c-api/arg.rst:228 -msgid "" -"``u``, ``u#``, ``Z``, and ``Z#`` are removed because they used a legacy " -"``Py_UNICODE*`` representation." -msgstr "" - -#: ../../c-api/arg.rst:234 +#: ../../c-api/arg.rst:253 msgid "Numbers" msgstr "数" -#: ../../c-api/arg.rst:236 -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:242 -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:248 +#: ../../c-api/arg.rst:257 msgid "``b`` (:class:`int`) [unsigned char]" msgstr "``b`` (:class:`int`) [unsigned char]" -#: ../../c-api/arg.rst:249 +#: ../../c-api/arg.rst:256 msgid "" -"Convert a nonnegative Python integer to an unsigned tiny integer, stored in " -"a C :c:expr:`unsigned char`." +"Convert a nonnegative Python integer to an unsigned tiny int, stored in a C :" +"c:type:`unsigned char`." msgstr "" +"Python の非負の整数を、 C の :c:type:`unsigned char` 型の小さな符号無し整数に" +"変換します。" -#: ../../c-api/arg.rst:252 ../../c-api/arg.rst:663 +#: ../../c-api/arg.rst:261 ../../c-api/arg.rst:600 msgid "``B`` (:class:`int`) [unsigned char]" msgstr "``B`` (:class:`int`) [unsigned char]" -#: ../../c-api/arg.rst:253 +#: ../../c-api/arg.rst:260 msgid "" -"Convert a Python integer to a tiny integer without overflow checking, stored " -"in a C :c:expr:`unsigned char`." +"Convert a Python integer to a tiny int without overflow checking, stored in " +"a C :c:type:`unsigned char`." msgstr "" +"Python の整数を、オーバフローチェックを行わずに、 C の :c:type:`unsigned " +"char` 型の小さな整数に変換します。" -#: ../../c-api/arg.rst:256 ../../c-api/arg.rst:657 +#: ../../c-api/arg.rst:264 ../../c-api/arg.rst:594 msgid "``h`` (:class:`int`) [short int]" msgstr "``h`` (:class:`int`) [short int]" -#: ../../c-api/arg.rst:257 -msgid "Convert a Python integer to a C :c:expr:`short int`." -msgstr "Python の整数を、 C の :c:expr:`short int` 型に変換します。" +#: ../../c-api/arg.rst:264 +msgid "Convert a Python integer to a C :c:type:`short int`." +msgstr "Python の整数を、 C の :c:type:`short int` 型に変換します。" -#: ../../c-api/arg.rst:259 ../../c-api/arg.rst:666 +#: ../../c-api/arg.rst:268 ../../c-api/arg.rst:603 msgid "``H`` (:class:`int`) [unsigned short int]" msgstr "``H`` (:class:`int`) [unsigned short int]" -#: ../../c-api/arg.rst:260 +#: ../../c-api/arg.rst:267 msgid "" -"Convert a Python integer to a C :c:expr:`unsigned short int`, without " +"Convert a Python integer to a C :c:type:`unsigned short int`, without " "overflow checking." msgstr "" -"Python の整数を、オーバフローチェックを行わずに、 C の :c:expr:`unsigned " +"Python の整数を、オーバフローチェックを行わずに、 C の :c:type:`unsigned " "short int` 型に変換します。" -#: ../../c-api/arg.rst:263 ../../c-api/arg.rst:651 +#: ../../c-api/arg.rst:271 ../../c-api/arg.rst:588 msgid "``i`` (:class:`int`) [int]" msgstr "``i`` (:class:`int`) [int]" -#: ../../c-api/arg.rst:264 -msgid "Convert a Python integer to a plain C :c:expr:`int`." -msgstr "Python の整数を、 C の :c:expr:`int` 型に変換します。" +#: ../../c-api/arg.rst:271 +msgid "Convert a Python integer to a plain C :c:type:`int`." +msgstr "Python の整数を、 C の :c:type:`int` 型に変換します。" -#: ../../c-api/arg.rst:266 ../../c-api/arg.rst:669 +#: ../../c-api/arg.rst:275 ../../c-api/arg.rst:606 msgid "``I`` (:class:`int`) [unsigned int]" msgstr "``I`` (:class:`int`) [unsigned int]" -#: ../../c-api/arg.rst:267 +#: ../../c-api/arg.rst:274 msgid "" -"Convert a Python integer to a C :c:expr:`unsigned int`, without overflow " +"Convert a Python integer to a C :c:type:`unsigned int`, without overflow " "checking." msgstr "" -"Python の整数を、オーバフローチェックを行わずに、 C の :c:expr:`unsigned " +"Python の整数を、オーバフローチェックを行わずに、 C の :c:type:`unsigned " "int` 型に変換します。" -#: ../../c-api/arg.rst:270 ../../c-api/arg.rst:660 +#: ../../c-api/arg.rst:278 ../../c-api/arg.rst:597 msgid "``l`` (:class:`int`) [long int]" msgstr "``l`` (:class:`int`) [long int]" -#: ../../c-api/arg.rst:271 -msgid "Convert a Python integer to a C :c:expr:`long int`." -msgstr "Python の整数を、 C の :c:expr:`long int` 型に変換します。" +#: ../../c-api/arg.rst:278 +msgid "Convert a Python integer to a C :c:type:`long int`." +msgstr "Python の整数を、 C の :c:type:`long int` 型に変換します。" -#: ../../c-api/arg.rst:273 ../../c-api/arg.rst:672 +#: ../../c-api/arg.rst:282 ../../c-api/arg.rst:609 msgid "``k`` (:class:`int`) [unsigned long]" msgstr "``k`` (:class:`int`) [unsigned long]" -#: ../../c-api/arg.rst:274 +#: ../../c-api/arg.rst:281 msgid "" -"Convert a Python integer to a C :c:expr:`unsigned long` without overflow " +"Convert a Python integer to a C :c:type:`unsigned long` without overflow " "checking." msgstr "" -"Python の整数を、オーバフローチェックを行わずに、 C の :c:expr:`unsigned " +"Python の整数を、オーバフローチェックを行わずに、 C の :c:type:`unsigned " "long` 型に変換します。" -#: ../../c-api/arg.rst:277 ../../c-api/arg.rst:287 -msgid "Use :meth:`~object.__index__` if available." -msgstr "可能であれば :meth:`~object.__index__` を使うようになりました。" - -#: ../../c-api/arg.rst:280 ../../c-api/arg.rst:675 +#: ../../c-api/arg.rst:285 ../../c-api/arg.rst:612 msgid "``L`` (:class:`int`) [long long]" msgstr "``L`` (:class:`int`) [long long]" -#: ../../c-api/arg.rst:281 -msgid "Convert a Python integer to a C :c:expr:`long long`." -msgstr "Python の整数を、 C の :c:expr:`long long` 型に変換します。" +#: ../../c-api/arg.rst:285 +msgid "Convert a Python integer to a C :c:type:`long long`." +msgstr "PythonのintをC :c:type:`long long` へ変換する。" -#: ../../c-api/arg.rst:283 ../../c-api/arg.rst:680 +#: ../../c-api/arg.rst:289 ../../c-api/arg.rst:615 msgid "``K`` (:class:`int`) [unsigned long long]" msgstr "``K`` (:class:`int`) [unsigned long long]" -#: ../../c-api/arg.rst:284 +#: ../../c-api/arg.rst:288 msgid "" -"Convert a Python integer to a C :c:expr:`unsigned long long` without " +"Convert a Python integer to a C :c:type:`unsigned long long` without " "overflow checking." msgstr "" -"PythonのintをC :c:expr:`unsigned long long` へオーバーフローの確認をせず変換" +"PythonのintをC :c:type:`unsigned long long` へオーバーフローの確認をせず変換" "する" -#: ../../c-api/arg.rst:290 ../../c-api/arg.rst:683 -msgid "``n`` (:class:`int`) [:c:type:`Py_ssize_t`]" -msgstr "``n`` (:class:`int`) [:c:type:`Py_ssize_t`]" +#: ../../c-api/arg.rst:292 ../../c-api/arg.rst:618 +msgid "``n`` (:class:`int`) [Py_ssize_t]" +msgstr "``n`` (:class:`int`) [Py_ssize_t]" -#: ../../c-api/arg.rst:291 +#: ../../c-api/arg.rst:292 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:293 +#: ../../c-api/arg.rst:299 msgid "``c`` (:class:`bytes` or :class:`bytearray` of length 1) [char]" msgstr "``c`` (長さ 1 の、 :class:`bytes` または :class:`bytearray`) [char]" -#: ../../c-api/arg.rst:294 +#: ../../c-api/arg.rst:295 msgid "" "Convert a Python byte, represented as a :class:`bytes` or :class:`bytearray` " -"object of length 1, to a C :c:expr:`char`." +"object of length 1, to a C :c:type:`char`." msgstr "" "長さ 1 の :class:`bytes` または :class:`bytearray` オブジェクトとして表現され" -"ている Python バイトを C の :c:expr:`char` 型に変換します。" +"ている Python バイトを C の :c:type:`char` 型に変換します。" -#: ../../c-api/arg.rst:297 +#: ../../c-api/arg.rst:298 msgid "Allow :class:`bytearray` objects." msgstr ":class:`bytearray` を受け付けるようになりました。" -#: ../../c-api/arg.rst:300 ../../c-api/arg.rst:695 +#: ../../c-api/arg.rst:303 ../../c-api/arg.rst:626 msgid "``C`` (:class:`str` of length 1) [int]" msgstr "``C`` (長さ 1 の :class:`str`) [int]" -#: ../../c-api/arg.rst:301 +#: ../../c-api/arg.rst:302 msgid "" "Convert a Python character, represented as a :class:`str` object of length " -"1, to a C :c:expr:`int`." +"1, to a C :c:type:`int`." msgstr "" "長さ 1 の :class:`str` オブジェクトとして表現されている Python キャラクタを " -"C の :c:expr:`int` 型に変換します。" +"C の :c:type:`int` 型に変換します。" -#: ../../c-api/arg.rst:304 ../../c-api/arg.rst:702 +#: ../../c-api/arg.rst:306 ../../c-api/arg.rst:632 msgid "``f`` (:class:`float`) [float]" msgstr "``f`` (:class:`float`) [float]" -#: ../../c-api/arg.rst:305 -msgid "Convert a Python floating-point number to a C :c:expr:`float`." -msgstr "" +#: ../../c-api/arg.rst:306 +msgid "Convert a Python floating point number to a C :c:type:`float`." +msgstr "Python の浮動小数点型を、 C の :c:type:`float` 型に変換します。" -#: ../../c-api/arg.rst:307 ../../c-api/arg.rst:699 +#: ../../c-api/arg.rst:309 ../../c-api/arg.rst:629 msgid "``d`` (:class:`float`) [double]" msgstr "``d`` (:class:`float`) [double]" -#: ../../c-api/arg.rst:308 -msgid "Convert a Python floating-point number to a C :c:expr:`double`." -msgstr "" +#: ../../c-api/arg.rst:309 +msgid "Convert a Python floating point number to a C :c:type:`double`." +msgstr "Python の浮動小数点型を、 C の :c:type:`double` 型に変換します。" -#: ../../c-api/arg.rst:310 +#: ../../c-api/arg.rst:312 msgid "``D`` (:class:`complex`) [Py_complex]" msgstr "``D`` (:class:`complex`) [Py_complex]" -#: ../../c-api/arg.rst:311 +#: ../../c-api/arg.rst:312 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:314 +#: ../../c-api/arg.rst:315 msgid "Other objects" msgstr "その他のオブジェクト" -#: ../../c-api/arg.rst:316 ../../c-api/arg.rst:708 +#: ../../c-api/arg.rst:320 ../../c-api/arg.rst:643 msgid "``O`` (object) [PyObject \\*]" msgstr "``O`` (object) [PyObject \\*]" -#: ../../c-api/arg.rst:317 +#: ../../c-api/arg.rst:318 msgid "" "Store a Python object (without any conversion) in a C object pointer. The C " -"program thus receives the actual object that was passed. A new :term:" -"`strong reference` to the object is not created (i.e. its reference count is " -"not increased). The pointer stored is not ``NULL``." +"program thus receives the actual object that was passed. The object's " +"reference count is not increased. The pointer stored is not ``NULL``." msgstr "" +"Python オブジェクトを (一切変換を行わずに) C の Python オブジェクト型ポインタ" +"に保存します。これにより、C プログラムは実際のオブジェクトを受け渡しされま" +"す。オブジェクトの参照カウントは増加しません。保存されるポインタが ``NULL`` " +"になることはありません。" -#: ../../c-api/arg.rst:323 +#: ../../c-api/arg.rst:327 msgid "``O!`` (object) [*typeobject*, PyObject \\*]" msgstr "``O!`` (object) [*typeobject*, PyObject \\*]" -#: ../../c-api/arg.rst:324 +#: ../../c-api/arg.rst:323 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 " -"second is the address of the C variable (of type :c:expr:`PyObject*`) into " +"second is the address of the C variable (of type :c:type:`PyObject*`) into " "which the object pointer is stored. If the Python object does not have the " "required type, :exc:`TypeError` is raised." msgstr "" "Python オブジェクトを C の Python オブジェクト型ポインタに保存します。 ``O`` " "に似ていますが、二つの C の引数をとります: 一つ目の引数は Python の型オブジェ" "クトへのアドレスで、二つ目の引数はオブジェクトへのポインタが保存されている (:" -"c:expr:`PyObject*` の) C の変数へのアドレスです。Python オブジェクトが指定し" +"c:type:`PyObject*` の) C の変数へのアドレスです。Python オブジェクトが指定し" "た型ではない場合、 :exc:`TypeError` を送出します。" -#: ../../c-api/arg.rst:332 -msgid "``O&`` (object) [*converter*, *address*]" -msgstr "" +#: ../../c-api/arg.rst:352 ../../c-api/arg.rst:657 +msgid "``O&`` (object) [*converter*, *anything*]" +msgstr "``O&`` (object) [*converter*, *anything*]" -#: ../../c-api/arg.rst:333 +#: ../../c-api/arg.rst:332 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 " -"of a C variable (of arbitrary type), converted to :c:expr:`void *`. The " +"of a C variable (of arbitrary type), converted to :c:type:`void *`. The " "*converter* function in turn is called as follows::" msgstr "" "Python オブジェクトを *converter* 関数を介して C の変数に変換します。二つの引" "数をとります: 一つ目は関数で、二つ目は (任意の型の) C 変数へのアドレスを :c:" -"expr:`void *` 型に変換したものです。 *converter* は以下のようにして呼び出され" +"type:`void *` 型に変換したものです。 *converter* は以下のようにして呼び出され" "ます::" -#: ../../c-api/arg.rst:338 -msgid "status = converter(object, address);" -msgstr "" - -#: ../../c-api/arg.rst:340 +#: ../../c-api/arg.rst:339 msgid "" "where *object* is the Python object to be converted and *address* is the :c:" -"expr:`void*` argument that was passed to the ``PyArg_Parse*`` function. The " -"returned *status* should be ``1`` for a successful conversion and ``0`` if " -"the conversion has failed. When the conversion fails, the *converter* " -"function should raise an exception and leave the content of *address* " -"unmodified." -msgstr "" -"ここで *object* は変換対象の Python オブジェクトで、 *address* は " -"``PyArg_Parse*`` に渡した :c:expr:`void*` 型の引数です。戻り値 *status* は変" +"type:`void*` argument that was passed to the :c:func:`PyArg_Parse\\*` " +"function. The returned *status* should be ``1`` for a successful conversion " +"and ``0`` if the conversion has failed. When the conversion fails, the " +"*converter* function should raise an exception and leave the content of " +"*address* unmodified." +msgstr "" +"ここで *object* は変換対象の Python オブジェクトで、 *address* は :c:func:" +"`PyArg_Parse\\*` に渡した :c:type:`void*` 型の引数です。戻り値 *status* は変" "換に成功した際に ``1``,失敗した場合には ``0`` になります。変換に失敗した場" "合、 *converter* 関数は *address* の内容を変更せずに例外を送出しなくてはなり" "ません。" -#: ../../c-api/arg.rst:349 -msgid "" -"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:355 +#: ../../c-api/arg.rst:345 msgid "" -"Examples of converters: :c:func:`PyUnicode_FSConverter` and :c:func:" -"`PyUnicode_FSDecoder`." +"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." msgstr "" +"もし *converter* が ``Py_CLEANUP_SUPPORTED`` を返すと、引数のパースが失敗した" +"際に、コンバーターをもう一度呼び出し、すでに割り当てたメモリを開放するチャン" +"スを与えます。二度目の呼び出しでは *object* 引数は ``NULL`` になり、" +"*address* は最初の呼び出しと同じ値になります。" -#: ../../c-api/arg.rst:358 -msgid ":c:macro:`!Py_CLEANUP_SUPPORTED` was added." -msgstr "" +#: ../../c-api/arg.rst:351 +msgid "``Py_CLEANUP_SUPPORTED`` was added." +msgstr "``Py_CLEANUP_SUPPORTED`` の追加。" -#: ../../c-api/arg.rst:361 ../../c-api/arg.rst:686 +#: ../../c-api/arg.rst:361 msgid "``p`` (:class:`bool`) [int]" msgstr "``p`` (:class:`bool`) [int]" -#: ../../c-api/arg.rst:362 +#: ../../c-api/arg.rst:355 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 " @@ -828,52 +897,36 @@ msgstr "" "Pythonが値の真偽をどのように判定するかを知りたければ、 :ref:`truth` を参照し" "てください。" -#: ../../c-api/arg.rst:370 -msgid "``(items)`` (sequence) [*matching-items*]" -msgstr "" - -#: ../../c-api/arg.rst:371 -msgid "" -"The object must be a Python sequence (except :class:`str`, :class:`bytes` " -"or :class:`bytearray`) 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:376 -msgid "" -"If *items* contains format units which store a :ref:`borrowed buffer ` (``s``, ``s#``, ``z``, ``z#``, ``y``, or ``y#``) or a :" -"term:`borrowed reference` (``S``, ``Y``, ``U``, ``O``, or ``O!``), the " -"object must be a Python tuple. The *converter* for the ``O&`` format unit in " -"*items* must not store a borrowed buffer or a borrowed reference." -msgstr "" - -#: ../../c-api/arg.rst:383 -msgid "" -":class:`str` and :class:`bytearray` objects no longer accepted as a sequence." -msgstr "" +#: ../../c-api/arg.rst:366 ../../c-api/arg.rst:660 +msgid "``(items)`` (:class:`tuple`) [*matching-items*]" +msgstr "``(items)`` (:class:`tuple`) [*matching-items*]" -#: ../../c-api/arg.rst:386 +#: ../../c-api/arg.rst:364 msgid "" -"Non-tuple sequences are deprecated if *items* contains format units which " -"store a borrowed buffer or a borrowed reference." -msgstr "" - -#: ../../c-api/arg.rst:390 -msgid "``unit?`` (anything or ``None``) [*matching-variable(s)*]" +"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 "" +"オブジェクトは *items* に入っている書式単位の数だけの長さを持つ Python のシー" +"ケンス型でなければなりません。各 C 引数は *items* 内の個々の書式単位に対応づ" +"けできなければなりません。シーケンスの書式単位は入れ子構造にできます。" -#: ../../c-api/arg.rst:391 +#: ../../c-api/arg.rst:368 msgid "" -"``?`` modifies the behavior of the preceding format unit. The C variable(s) " -"corresponding to that parameter should be initialized to their default value " -"--- when the argument is ``None``, :c:func:`PyArg_ParseTuple` does not touch " -"the contents of the corresponding C variable(s). If the argument is not " -"``None``, it is parsed according to the specified format unit." +"It is possible to pass \"long\" integers (integers whose value exceeds the " +"platform's :const:`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 "" +"\"長\" 整数 (プラットフォームの :const:`LONG_MAX` を超える値の整数) を渡すの" +"は可能です; しかしながら、適切な値域チェックはまったく行われません --- 値を受" +"け取るためのフィールドが、値全てを受け取るには小さすぎる場合、上桁のビット群" +"は暗黙のうちに切り詰められます (実際のところ、このセマンティクスは C のダウン" +"キャスト (downcast) から継承しています --- その恩恵は人それぞれかもしれません" +"が)。" -#: ../../c-api/arg.rst:401 +#: ../../c-api/arg.rst:374 msgid "" "A few other characters have a meaning in a format string. These may not " "occur inside nested parentheses. They are:" @@ -881,11 +934,11 @@ msgstr "" "その他、書式文字列において意味を持つ文字がいくつかあります。それらの文字は括" "弧による入れ子内には使えません。以下に文字を示します:" -#: ../../c-api/arg.rst:404 +#: ../../c-api/arg.rst:382 msgid "``|``" msgstr "``|``" -#: ../../c-api/arg.rst:405 +#: ../../c-api/arg.rst:378 msgid "" "Indicates that the remaining arguments in the Python argument list are " "optional. The C variables corresponding to optional arguments should be " @@ -898,11 +951,11 @@ msgstr "" "ません --- オプションの引数が省略された場合、 :c:func:`PyArg_ParseTuple` は対" "応する C 変数の内容に手を加えません。" -#: ../../c-api/arg.rst:411 +#: ../../c-api/arg.rst:391 msgid "``$``" msgstr "``$``" -#: ../../c-api/arg.rst:412 +#: ../../c-api/arg.rst:385 msgid "" ":c:func:`PyArg_ParseTupleAndKeywords` only: Indicates that the remaining " "arguments in the Python argument list are keyword-only. Currently, all " @@ -914,11 +967,11 @@ msgstr "" "現在、すべてのキーワード専用引数は任意の引数でなければならず、そのため フォー" "マット文字列中の ``|`` は常に ``$`` より前に指定されなければなりません。" -#: ../../c-api/arg.rst:420 +#: ../../c-api/arg.rst:396 msgid "``:``" msgstr "``:``" -#: ../../c-api/arg.rst:421 +#: ../../c-api/arg.rst:394 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 " @@ -928,11 +981,11 @@ msgstr "" "ラーメッセージにおける関数名 (:c:func:`PyArg_ParseTuple` が送出する例外の " "\"付属値 (associated value)\") として使われます。" -#: ../../c-api/arg.rst:425 +#: ../../c-api/arg.rst:401 msgid "``;``" msgstr "``;``" -#: ../../c-api/arg.rst:426 +#: ../../c-api/arg.rst:399 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 ``;" @@ -942,14 +995,16 @@ msgstr "" "は、デフォルトエラーメッセージを *置き換える* エラーメッセージとして使われま" "す。 ``:`` と ``;`` は相互に排他の文字です。" -#: ../../c-api/arg.rst:430 +#: ../../c-api/arg.rst:403 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)!" +"*borrowed* references; do not decrement their reference count!" msgstr "" +"呼び出し側に提供されるオブジェクトへの参照はすべて *借用* 参照 (borrowed " +"reference) になります; これらのオブジェクトの参照カウントをデクリメントしては" +"なりません!" -#: ../../c-api/arg.rst:434 +#: ../../c-api/arg.rst:406 msgid "" "Additional arguments passed to these functions must be addresses of " "variables whose type is determined by the format string; these are used to " @@ -964,27 +1019,28 @@ msgstr "" "助引数を入力値として使う場合がいくつかあります; その場合、対応する書式単位の" "指定する形式に従うようにしなければなりません。" -#: ../../c-api/arg.rst:440 +#: ../../c-api/arg.rst:412 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 " -"return true, otherwise they return false and raise an appropriate exception. " -"When the ``PyArg_Parse*`` functions fail due to conversion failure in one of " -"the format units, the variables at the addresses corresponding to that and " -"the following format units are left untouched." +"the format must be exhausted. On success, the :c:func:`PyArg_Parse\\*` " +"functions return true, otherwise they return false and raise an appropriate " +"exception. When the :c:func:`PyArg_Parse\\*` functions fail due to " +"conversion failure in one of the format units, the variables at the " +"addresses corresponding to that and the following format units are left " +"untouched." msgstr "" "変換を正しく行うためには、 *arg* オブジェクトは書式文字に一致しなければなら" "ず、かつ書式文字列内の書式単位に全て値が入るようにしなければなりません。成功" -"すると、 ``PyArg_Parse*`` 関数は真を返します。それ以外の場合には偽を返し、適" -"切な例外を送出します。書式単位のどれかの変換失敗により ``PyArg_Parse*`` が失" -"敗した場合、失敗した書式単位に対応するアドレスとそれ以降のアドレスの内容は変" -"更されません。" +"すると、 :c:func:`PyArg_Parse\\*` 関数は真を返します。それ以外の場合には偽を" +"返し、適切な例外を送出します。書式単位のどれかの変換失敗により :c:func:" +"`PyArg_Parse\\*` が失敗した場合、失敗した書式単位に対応するアドレスとそれ以降" +"のアドレスの内容は変更されません。" -#: ../../c-api/arg.rst:449 +#: ../../c-api/arg.rst:421 msgid "API Functions" msgstr "API 関数" -#: ../../c-api/arg.rst:453 +#: ../../c-api/arg.rst:425 msgid "" "Parse the parameters of a function that takes only positional parameters " "into local variables. Returns true on success; on failure, it returns false " @@ -993,7 +1049,7 @@ msgstr "" "位置引数のみを引数にとる関数のパラメタを解釈して、ローカルな変数に変換しま" "す。成功すると真を返します;失敗すると偽を返し、適切な例外を送出します。" -#: ../../c-api/arg.rst:460 +#: ../../c-api/arg.rst:432 msgid "" "Identical to :c:func:`PyArg_ParseTuple`, except that it accepts a va_list " "rather than a variable number of arguments." @@ -1001,37 +1057,26 @@ msgstr "" ":c:func:`PyArg_ParseTuple` と同じですが、可変長の引数ではなく *va_list* を引" "数にとります。" -#: ../../c-api/arg.rst:466 +#: ../../c-api/arg.rst:438 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 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." +"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." msgstr "" +"位置引数とキーワード引数の両者を取る関数の引数を解釈します。\n" +"*keywords* 引数は ``NULL`` で終端されたキーワード名の配列です。\n" +"空の名前は :ref:`位置専用引数 ` を示します。\n" +"成功した場合、真を返します。失敗した場合は偽を返し、適切な例外を送出します。" -#: ../../c-api/arg.rst:477 -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:481 +#: ../../c-api/arg.rst:445 msgid "" "Added support for :ref:`positional-only parameters `." msgstr ":ref:`位置専用引数 ` を追加した。" -#: ../../c-api/arg.rst:485 -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:494 +#: ../../c-api/arg.rst:452 msgid "" "Identical to :c:func:`PyArg_ParseTupleAndKeywords`, except that it accepts a " "va_list rather than a variable number of arguments." @@ -1039,7 +1084,7 @@ msgstr "" ":c:func:`PyArg_ParseTupleAndKeywords` と同じですが、可変長の引数ではなく " "*va_list* を引数にとります。" -#: ../../c-api/arg.rst:500 +#: ../../c-api/arg.rst:458 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 " @@ -1049,72 +1094,62 @@ msgstr "" "は :c:func:`PyArg_ParseTupleAndKeywords` を使用しないときにのみ必要で、その理" "由は後者の関数は同様のチェックを実施するためです。" -#: ../../c-api/arg.rst:509 -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:513 -msgid "Example::" -msgstr "以下はプログラム例です::" - -#: ../../c-api/arg.rst:515 +#: ../../c-api/arg.rst:468 msgid "" -"// 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" -"}" +"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." msgstr "" +"\"旧スタイル\" の関数における引数リストを分析するために使われる関数です --- " +"旧スタイルの関数は、引数解釈手法に、Python 3 で削除された :const:" +"`METH_OLDARGS` を使います。新たに書かれるコードでのパラメタ解釈にはこの関数の" +"使用は奨められず、標準のインタプリタにおけるほとんどのコードがもはや引数解釈" +"のためにこの関数を使わないように変更済みです。この関数を残しているのは、この" +"関数が依然として引数以外のタプルを分析する上で便利だからですが、この目的にお" +"いては将来も使われつづけるかもしれません。" -#: ../../c-api/arg.rst:529 +#: ../../c-api/arg.rst:479 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 " -"retrieve their parameters should be declared as :c:macro:`METH_VARARGS` in " +"retrieve their parameters should be declared as :const:`METH_VARARGS` in " "function or method tables. The tuple containing the actual parameters " "should be passed as *args*; it must actually be a tuple. The length of the " "tuple must be at least *min* and no more than *max*; *min* and *max* may be " "equal. Additional arguments must be passed to the function, each of which " -"should be a pointer to a :c:expr:`PyObject*` variable; these will be filled " -"in with the values from *args*; they will contain :term:`borrowed references " -"`. The variables which correspond to optional parameters " -"not given by *args* will not be filled in; these should be initialized by " -"the caller. This function returns true on success and false if *args* is not " -"a tuple or contains the wrong number of elements; an exception will be set " -"if there was a failure." -msgstr "" - -#: ../../c-api/arg.rst:544 +"should be a pointer to a :c:type:`PyObject*` variable; these will be filled " +"in with the values from *args*; they will contain borrowed references. The " +"variables which correspond to optional parameters not given by *args* will " +"not be filled in; these should be initialized by the caller. This function " +"returns true on success and false if *args* is not a tuple or contains the " +"wrong number of elements; an exception will be set if there was a failure." +msgstr "" +"パラメータ取得を簡単にした形式で、引数の型を指定する書式文字列を使いません。" +"パラメタの取得にこの手法を使う関数は、関数宣言テーブル、またはメソッド宣言" +"テーブル内で :const:`METH_VARARGS` として宣言しなければなりません。実引数の" +"入ったタプルは *args* に渡します; このタプルは本当のタプルでなければなりませ" +"ん。タプルの長さは少なくとも *min* で、 *max* を超えてはなりません; *min* と " +"*max* が等しくてもかまいません。補助引数を関数に渡さなければならず、各補助引" +"数は :c:type:`PyObject*` 変数へのポインタでなければなりません; これらの補助引" +"数には、 *args* の値が入ります; 値の参照は借用参照です。オプションのパラメタ" +"に対応する変数のうち、 *args* に指定していないものには値が入りません; 呼び出" +"し側はそれらの値を初期化しておかなければなりません。この関数は成功すると真を" +"返し、 *args* がタプルでない場合や間違った数の要素が入っている場合に偽を返し" +"ます; 何らかの失敗が起きた場合には例外をセットします。" + +#: ../../c-api/arg.rst:493 msgid "" "This is an example of the use of this function, taken from the sources for " -"the :mod:`!_weakref` helper module for weak references::" +"the :mod:`_weakref` helper module for weak references::" msgstr "" +"この関数の使用例を以下に示します。この例は、弱参照のための :mod:`_weakref` 補" +"助モジュールのソースコードからとったものです::" -#: ../../c-api/arg.rst:547 -msgid "" -"static PyObject *\n" -"weakref_ref(PyObject *self, PyObject *args)\n" -"{\n" -" PyObject *object;\n" -" PyObject *callback = NULL;\n" -" PyObject *result = NULL;\n" -"\n" -" if (PyArg_UnpackTuple(args, \"ref\", 1, 2, &object, &callback)) {\n" -" result = PyWeakref_NewRef(object, callback);\n" -" }\n" -" return result;\n" -"}" -msgstr "" - -#: ../../c-api/arg.rst:560 +#: ../../c-api/arg.rst:509 msgid "" "The call to :c:func:`PyArg_UnpackTuple` in this example is entirely " "equivalent to this call to :c:func:`PyArg_ParseTuple`::" @@ -1122,35 +1157,22 @@ msgstr "" "この例における :c:func:`PyArg_UnpackTuple` 呼び出しは、 :c:func:" "`PyArg_ParseTuple` を使った以下の呼び出しと全く等価です::" -#: ../../c-api/arg.rst:563 -msgid "PyArg_ParseTuple(args, \"O|O:ref\", &object, &callback)" -msgstr "" - -#: ../../c-api/arg.rst:567 -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:581 +#: ../../c-api/arg.rst:517 msgid "Building values" msgstr "値の構築" -#: ../../c-api/arg.rst:585 +#: ../../c-api/arg.rst:521 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 " -"value or ``NULL`` in the case of an error; an exception will be raised if " -"``NULL`` is returned." +"Create a new value based on a format string similar to those accepted by " +"the :c:func:`PyArg_Parse\\*` family of functions and a sequence of values. " +"Returns the value or ``NULL`` in the case of an error; an exception will be " +"raised if ``NULL`` is returned." msgstr "" -"``PyArg_Parse*`` ファミリの関数が受け取るのと似た形式の書式文字列および値列に" -"基づいて、新たな値を生成します。生成した値を返します。エラーの場合には " -"``NULL`` を返します; ``NULL`` を返す場合、例外を送出するでしょう。" +":c:func:`PyArg_Parse\\*` ファミリの関数が受け取るのと似た形式の書式文字列およ" +"び値列に基づいて、新たな値を生成します。生成した値を返します。エラーの場合に" +"は ``NULL`` を返します; ``NULL`` を返す場合、例外を送出するでしょう。" -#: ../../c-api/arg.rst:590 +#: ../../c-api/arg.rst:526 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 " @@ -1164,7 +1186,7 @@ msgstr "" "合、書式単位で指定されている何らかのオブジェクト単体を返します。サイズがゼロ" "や 1 のタプルを返すように強制するには、丸括弧で囲われた書式文字列を使います。" -#: ../../c-api/arg.rst:596 +#: ../../c-api/arg.rst:532 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. " @@ -1182,7 +1204,7 @@ msgstr "" "ド内で :c:func:`Py_BuildValue` が返った後で :c:func:`free` を呼び出す責任があ" "るということです。" -#: ../../c-api/arg.rst:604 +#: ../../c-api/arg.rst:540 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 " @@ -1193,7 +1215,7 @@ msgstr "" "単位が返す Python のオブジェクト型です; [角] 括弧は関数に渡す値の C 変数型で" "す。" -#: ../../c-api/arg.rst:608 +#: ../../c-api/arg.rst:544 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 " @@ -1203,11 +1225,11 @@ msgstr "" "よびコンマは無視されます。これらの文字を使うと、長い書式文字列をちょっとだけ" "読みやすくできます。" -#: ../../c-api/arg.rst:612 +#: ../../c-api/arg.rst:550 msgid "``s`` (:class:`str` or ``None``) [const char \\*]" msgstr "``s`` (:class:`str` または ``None``) [const char \\*]" -#: ../../c-api/arg.rst:613 +#: ../../c-api/arg.rst:549 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." @@ -1216,12 +1238,15 @@ msgstr "" "class:`str` オブジェクトに変換します。もし C 文字列ポインタが ``NULL`` の場" "合、 ``None`` になります。" -#: ../../c-api/arg.rst:616 +#: ../../c-api/arg.rst:555 msgid "" -"``s#`` (:class:`str` or ``None``) [const char \\*, :c:type:`Py_ssize_t`]" +"``s#`` (:class:`str` or ``None``) [const char \\*, int or :c:type:" +"`Py_ssize_t`]" msgstr "" +"``s#`` (:class:`str` または ``None``) [const char \\*, int または :c:type:" +"`Py_ssize_t`]" -#: ../../c-api/arg.rst:617 +#: ../../c-api/arg.rst:553 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 " @@ -1231,11 +1256,11 @@ msgstr "" "`str` オブジェクトに変換します。C 文字列ポインタが ``NULL`` の場合、長さは無" "視され、 ``None`` になります。" -#: ../../c-api/arg.rst:621 +#: ../../c-api/arg.rst:559 msgid "``y`` (:class:`bytes`) [const char \\*]" msgstr "``y`` (:class:`bytes`) [const char \\*]" -#: ../../c-api/arg.rst:622 +#: ../../c-api/arg.rst:558 msgid "" "This converts a C string to a Python :class:`bytes` object. If the C string " "pointer is ``NULL``, ``None`` is returned." @@ -1243,11 +1268,12 @@ msgstr "" "C 文字列をPython :class:`bytes` オブジェクトに変換します。もしC 文字列ポイン" "タが ``NULL`` だった場合、``None`` を返します。" -#: ../../c-api/arg.rst:625 -msgid "``y#`` (:class:`bytes`) [const char \\*, :c:type:`Py_ssize_t`]" +#: ../../c-api/arg.rst:563 +msgid "``y#`` (:class:`bytes`) [const char \\*, int or :c:type:`Py_ssize_t`]" msgstr "" +"``y#`` (:class:`bytes`) [const char \\*, int または :c:type:`Py_ssize_t`]" -#: ../../c-api/arg.rst:626 +#: ../../c-api/arg.rst:562 msgid "" "This converts a C string and its lengths to a Python object. If the C " "string pointer is ``NULL``, ``None`` is returned." @@ -1255,25 +1281,27 @@ msgstr "" "これは C 文字列とその長さから Python オブジェクトに変換します。C 文字列ポイン" "タが ``NULL`` の場合、長さは無視され ``None`` になります。" -#: ../../c-api/arg.rst:630 ../../c-api/arg.rst:646 +#: ../../c-api/arg.rst:566 ../../c-api/arg.rst:582 msgid "Same as ``s``." msgstr "``s`` と同じです。" -#: ../../c-api/arg.rst:632 +#: ../../c-api/arg.rst:569 msgid "" -"``z#`` (:class:`str` or ``None``) [const char \\*, :c:type:`Py_ssize_t`]" +"``z#`` (:class:`str` or ``None``) [const char \\*, int or :c:type:" +"`Py_ssize_t`]" msgstr "" -"``z#`` (:class:`str` または ``None``) [const char \\*, :c:type:`Py_ssize_t`]" +"``z#`` (:class:`str` または ``None``) [const char \\*, int または :c:type:" +"`Py_ssize_t`]" -#: ../../c-api/arg.rst:633 ../../c-api/arg.rst:649 +#: ../../c-api/arg.rst:569 ../../c-api/arg.rst:585 msgid "Same as ``s#``." msgstr "``s#`` と同じです。" -#: ../../c-api/arg.rst:635 +#: ../../c-api/arg.rst:574 msgid "``u`` (:class:`str`) [const wchar_t \\*]" msgstr "``u`` (:class:`str`) [const wchar_t \\*]" -#: ../../c-api/arg.rst:636 +#: ../../c-api/arg.rst:572 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 " @@ -1283,11 +1311,12 @@ msgstr "" "ファから Python Unicode オブジェクトに変換します。 Unicode バッファポインタ" "が ``NULL`` の場合、 ``None`` になります。" -#: ../../c-api/arg.rst:640 -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:579 +msgid "``u#`` (:class:`str`) [const wchar_t \\*, int or :c:type:`Py_ssize_t`]" +msgstr "" +"``u#`` (:class:`str`) [const wchar_t \\*, int または :c:type:`Py_ssize_t`]" -#: ../../c-api/arg.rst:641 +#: ../../c-api/arg.rst:577 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 " @@ -1297,178 +1326,177 @@ msgstr "" "オブジェクトに変換します。 Unicode バッファポインタが ``NULL`` の場合、長さは" "無視され ``None`` になります。" -#: ../../c-api/arg.rst:645 +#: ../../c-api/arg.rst:582 msgid "``U`` (:class:`str` or ``None``) [const char \\*]" msgstr "``U`` (:class:`str` または ``None``) [const char \\*]" -#: ../../c-api/arg.rst:648 +#: ../../c-api/arg.rst:585 msgid "" -"``U#`` (:class:`str` or ``None``) [const char \\*, :c:type:`Py_ssize_t`]" +"``U#`` (:class:`str` or ``None``) [const char \\*, int or :c:type:" +"`Py_ssize_t`]" msgstr "" -"``U#`` (:class:`str` または ``None``) [const char \\*, :c:type:`Py_ssize_t`]" +"``U#`` (:class:`str` または ``None``) [const char \\*, int または :c:type:" +"`Py_ssize_t`]" -#: ../../c-api/arg.rst:652 -msgid "Convert a plain C :c:expr:`int` to a Python integer object." -msgstr "通常の C の :c:expr:`int` を Python の整数オブジェクトに変換します。" +#: ../../c-api/arg.rst:588 +msgid "Convert a plain C :c:type:`int` to a Python integer object." +msgstr "通常の C の :c:type:`int` を Python の整数オブジェクトに変換します。" -#: ../../c-api/arg.rst:654 +#: ../../c-api/arg.rst:591 msgid "``b`` (:class:`int`) [char]" msgstr "``b`` (:class:`int`) [char]" -#: ../../c-api/arg.rst:655 -msgid "Convert a plain C :c:expr:`char` to a Python integer object." -msgstr "通常のC の :c:expr:`char` を Python の整数オブジェクトに変換します。" +#: ../../c-api/arg.rst:591 +msgid "Convert a plain C :c:type:`char` to a Python integer object." +msgstr "通常のC の :c:type:`char` を Python の整数オブジェクトに変換します。" -#: ../../c-api/arg.rst:658 -msgid "Convert a plain C :c:expr:`short int` to a Python integer object." +#: ../../c-api/arg.rst:594 +msgid "Convert a plain C :c:type:`short int` to a Python integer object." msgstr "" -"通常のC の :c:expr:`short int` を Python の整数オブジェクトに変換します。" +"通常のC の :c:type:`short int` を Python の整数オブジェクトに変換します。" -#: ../../c-api/arg.rst:661 -msgid "Convert a C :c:expr:`long int` to a Python integer object." -msgstr "C の :c:expr:`long int` を Python の整数オブジェクトに変換します。" +#: ../../c-api/arg.rst:597 +msgid "Convert a C :c:type:`long int` to a Python integer object." +msgstr "C の :c:type:`long int` を Python の整数オブジェクトに変換します。" -#: ../../c-api/arg.rst:664 -msgid "Convert a C :c:expr:`unsigned char` to a Python integer object." +#: ../../c-api/arg.rst:600 +msgid "Convert a C :c:type:`unsigned char` to a Python integer object." msgstr "" -"C の :c:expr:`unsigned char` を Python の整数オブジェクトに変換します。" +"C の :c:type:`unsigned char` を Python の整数オブジェクトに変換します。" -#: ../../c-api/arg.rst:667 -msgid "Convert a C :c:expr:`unsigned short int` to a Python integer object." +#: ../../c-api/arg.rst:603 +msgid "Convert a C :c:type:`unsigned short int` to a Python integer object." msgstr "" -"C の :c:expr:`unsigned short int` を Python の整数オブジェクトに変換します。" +"C の :c:type:`unsigned short int` を Python の整数オブジェクトに変換します。" -#: ../../c-api/arg.rst:670 -msgid "Convert a C :c:expr:`unsigned int` to a Python integer object." -msgstr "C の :c:expr:`unsigned int` を Python の整数オブジェクトに変換します。" +#: ../../c-api/arg.rst:606 +msgid "Convert a C :c:type:`unsigned int` to a Python integer object." +msgstr "C の :c:type:`unsigned int` を Python の整数オブジェクトに変換します。" -#: ../../c-api/arg.rst:673 -msgid "Convert a C :c:expr:`unsigned long` to a Python integer object." +#: ../../c-api/arg.rst:609 +msgid "Convert a C :c:type:`unsigned long` to a Python integer object." msgstr "" -"C の :c:expr:`unsigned long` を Python の整数オブジェクトに変換します。" +"C の :c:type:`unsigned long` を Python の整数オブジェクトに変換します。" -#: ../../c-api/arg.rst:676 -msgid "Convert a C :c:expr:`long long` to a Python integer object." -msgstr "C の :c:expr:`long long` を Python の整数オブジェクトに変換します。" +#: ../../c-api/arg.rst:612 +msgid "Convert a C :c:type:`long long` to a Python integer object." +msgstr "C :c:type:`long long` をPythonのintオブジェクトへ変換する。" -#: ../../c-api/arg.rst:681 -msgid "Convert a C :c:expr:`unsigned long long` to a Python integer object." -msgstr "C :c:expr:`unsigned long long` をPythonのintオブジェクトへ変換する。" +#: ../../c-api/arg.rst:615 +msgid "Convert a C :c:type:`unsigned long long` to a Python integer object." +msgstr "C :c:type:`unsigned long long` をPythonのintオブジェクトへ変換する。" -#: ../../c-api/arg.rst:684 +#: ../../c-api/arg.rst:618 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:687 -msgid "Convert a C :c:expr:`int` to a Python :class:`bool` object." -msgstr "" - -#: ../../c-api/arg.rst:691 +#: ../../c-api/arg.rst:622 msgid "``c`` (:class:`bytes` of length 1) [char]" msgstr "``c`` (長さが 1 の :class:`bytes`) [char]" -#: ../../c-api/arg.rst:692 +#: ../../c-api/arg.rst:621 msgid "" -"Convert a C :c:expr:`int` representing a byte to a Python :class:`bytes` " +"Convert a C :c:type:`int` representing a byte to a Python :class:`bytes` " "object of length 1." msgstr "" -"バイトを表す通常の C の :c:expr:`int` を、長さ 1 の Python の :class:`bytes` " +"バイトを表す通常の C の :c:type:`int` を、長さ 1 の Python の :class:`bytes` " "オブジェクトに変換します。" -#: ../../c-api/arg.rst:696 +#: ../../c-api/arg.rst:625 msgid "" -"Convert a C :c:expr:`int` representing a character to Python :class:`str` " +"Convert a C :c:type:`int` representing a character to Python :class:`str` " "object of length 1." msgstr "" -"文字を表す通常の C の :c:expr:`int` を、長さ 1 の Python の :class:`str` オブ" +"文字を表す通常の C の :c:type:`int` を、長さ 1 の Python の :class:`str` オブ" "ジェクトに変換します。" -#: ../../c-api/arg.rst:700 -msgid "Convert a C :c:expr:`double` to a Python floating-point number." -msgstr "" +#: ../../c-api/arg.rst:629 +msgid "Convert a C :c:type:`double` to a Python floating point number." +msgstr "C の :c:type:`double` を Python の浮動小数点数に変換します。" -#: ../../c-api/arg.rst:703 -msgid "Convert a C :c:expr:`float` to a Python floating-point number." -msgstr "" +#: ../../c-api/arg.rst:632 +msgid "Convert a C :c:type:`float` to a Python floating point number." +msgstr "C の :c:type:`float` を Python の浮動小数点数に変換します。" -#: ../../c-api/arg.rst:705 +#: ../../c-api/arg.rst:635 msgid "``D`` (:class:`complex`) [Py_complex \\*]" msgstr "``D`` (:class:`complex`) [Py_complex \\*]" -#: ../../c-api/arg.rst:706 +#: ../../c-api/arg.rst:635 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:709 +#: ../../c-api/arg.rst:638 msgid "" -"Pass a Python object untouched but create a new :term:`strong reference` to " -"it (i.e. its reference count is incremented by one). If the object passed in " -"is a ``NULL`` pointer, it is assumed that this was caused because the call " -"producing the argument found an error and set an exception. Therefore, :c:" -"func:`Py_BuildValue` will return ``NULL`` but won't raise an exception. If " -"no exception has been raised yet, :exc:`SystemError` is set." +"Pass a Python object untouched (except for its reference count, which is " +"incremented by one). If the object passed in is a ``NULL`` pointer, it is " +"assumed that this was caused because the call producing the argument found " +"an error and set an exception. Therefore, :c:func:`Py_BuildValue` will " +"return ``NULL`` but won't raise an exception. If no exception has been " +"raised yet, :exc:`SystemError` is set." msgstr "" +"Python オブジェクトを手を加えずに渡します (ただし、参照カウントは 1 インクリ" +"メントします)。渡したオブジェクトが ``NULL`` ポインタの場合、この引数を生成す" +"るのに使った何らかの呼び出しがエラーになったのが原因であると仮定して、例外を" +"セットします。従ってこのとき :c:func:`Py_BuildValue` は ``NULL`` を返しますが" +"例外は送出しません。例外をまだ送出していなければ :exc:`SystemError` をセット" +"します。" -#: ../../c-api/arg.rst:718 +#: ../../c-api/arg.rst:646 msgid "``S`` (object) [PyObject \\*]" msgstr "``S`` (object) [PyObject \\*]" -#: ../../c-api/arg.rst:719 +#: ../../c-api/arg.rst:646 msgid "Same as ``O``." msgstr "``O`` と同じです。" -#: ../../c-api/arg.rst:721 +#: ../../c-api/arg.rst:651 msgid "``N`` (object) [PyObject \\*]" msgstr "``N`` (object) [PyObject \\*]" -#: ../../c-api/arg.rst:722 +#: ../../c-api/arg.rst:649 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." +"Same as ``O``, except it doesn't increment the reference count on the " +"object. Useful when the object is created by a call to an object constructor " +"in the argument list." msgstr "" +"``O`` と同じです。ただし、オブジェクトの参照カウントをインクリメントしませ" +"ん。オブジェクトが引数リスト内のオブジェクトコンストラクタ呼び出しによって生" +"成されている場合に便利です。" -#: ../../c-api/arg.rst:726 -msgid "``O&`` (object) [*converter*, *anything*]" -msgstr "``O&`` (object) [*converter*, *anything*]" - -#: ../../c-api/arg.rst:727 +#: ../../c-api/arg.rst:654 msgid "" "Convert *anything* to a Python object through a *converter* function. The " -"function is called with *anything* (which should be compatible with :c:expr:" +"function is called with *anything* (which should be compatible with :c:type:" "`void*`) as its argument and should return a \"new\" Python object, or " "``NULL`` if an error occurred." msgstr "" "*anything* を *converter* 関数を介して Python オブジェクトに変換します。この" -"関数は *anything* (:c:expr:`void*` と互換の型でなければなりません) を引数にし" +"関数は *anything* (:c:type:`void*` と互換の型でなければなりません) を引数にし" "て呼び出され、\"新たな\" オブジェクトを返すか、失敗した場合には ``NULL`` を返" "すようにしなければなりません。" -#: ../../c-api/arg.rst:732 -msgid "``(items)`` (:class:`tuple`) [*matching-items*]" -msgstr "``(items)`` (:class:`tuple`) [*matching-items*]" - -#: ../../c-api/arg.rst:733 +#: ../../c-api/arg.rst:660 msgid "" "Convert a sequence of C values to a Python tuple with the same number of " "items." msgstr "C の値からなる配列を、同じ要素数を持つ Python のタプルに変換します。" -#: ../../c-api/arg.rst:735 +#: ../../c-api/arg.rst:663 msgid "``[items]`` (:class:`list`) [*matching-items*]" msgstr "``[items]`` (:class:`list`) [*matching-items*]" -#: ../../c-api/arg.rst:736 +#: ../../c-api/arg.rst:663 msgid "" "Convert a sequence of C values to a Python list with the same number of " "items." msgstr "C の値からなる配列を、同じ要素数を持つ Python のリストに変換します。" -#: ../../c-api/arg.rst:738 +#: ../../c-api/arg.rst:668 msgid "``{items}`` (:class:`dict`) [*matching-items*]" msgstr "``{items}`` (:class:`dict`) [*matching-items*]" -#: ../../c-api/arg.rst:739 +#: ../../c-api/arg.rst:666 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 " @@ -1477,7 +1505,7 @@ msgstr "" "C の値からなる配列を Python の辞書に変換します。一連のペアからなる C の値が、" "それぞれキーおよび値となって辞書に追加されます。" -#: ../../c-api/arg.rst:743 +#: ../../c-api/arg.rst:670 msgid "" "If there is an error in the format string, the :exc:`SystemError` exception " "is set and ``NULL`` returned." @@ -1485,7 +1513,7 @@ msgstr "" "書式文字列に関するエラーが生じると、 :exc:`SystemError` 例外をセットして " "``NULL`` を返します。" -#: ../../c-api/arg.rst:748 +#: ../../c-api/arg.rst:675 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 4989ddaaf..0029ab78d 100644 --- a/c-api/bool.po +++ b/c-api/bool.po @@ -1,28 +1,26 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 +# Arihiro TAKASE, 2017 # Tetsuo Koyama , 2021 -# Taichi Haradaguchi, 2024 -# 石井明久, 2024 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-13 14:21+0000\n" -"PO-Revision-Date: 2021-06-28 00:47+0000\n" -"Last-Translator: 石井明久, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-07 05:06+0000\n" +"PO-Revision-Date: 2017-02-16 17:33+0000\n" +"Last-Translator: Tetsuo Koyama , 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/bool.rst:6 @@ -32,66 +30,59 @@ msgstr "Boolean オブジェクト" #: ../../c-api/bool.rst:8 msgid "" "Booleans in Python are implemented as a subclass of integers. There are " -"only two booleans, :c:data:`Py_False` and :c:data:`Py_True`. As such, the " +"only two booleans, :const:`Py_False` and :const:`Py_True`. As such, the " "normal creation and deletion functions don't apply to booleans. The " "following macros are available, however." msgstr "" "Python の Bool 型は整数のサブクラスとして実装されています。ブール型の値は、 :" -"c:data:`Py_False` と :c:data:`Py_True` の 2 つしかありません。従って、通常の" -"生成/削除関数はブール型にはあてはまりません。とはいえ、以下のマクロが利用で" -"きます。" +"const:`Py_False` と :const:`Py_True` の 2 つしかありません。従って、通常の生" +"成/削除関数はブール型にはあてはまりません。とはいえ、以下のマクロが利用でき" +"ます。" #: ../../c-api/bool.rst:16 msgid "" -"This instance of :c:type:`PyTypeObject` represents the Python boolean type; " -"it is the same object as :class:`bool` in the Python layer." -msgstr "" -"この :c:type:`PyTypeObject` のインスタンスは Python の boolean 型を表現しま" -"す; Python レイヤにおける :class:`bool` と同じオブジェクトです。" - -#: ../../c-api/bool.rst:22 -msgid "" "Return true if *o* is of type :c:data:`PyBool_Type`. This function always " "succeeds." msgstr "" "*o* が :c:data:`PyBool_Type` 型の場合に真を返します。この関数は常に成功しま" "す。" -#: ../../c-api/bool.rst:28 +#: ../../c-api/bool.rst:22 msgid "" -"The Python ``False`` object. This object has no methods and is :term:" -"`immortal`." +"The Python ``False`` object. This object has no methods. It needs to be " +"treated just like any other object with respect to reference counts." msgstr "" -"Python の ``False`` オブジェクト。このオブジェクトはメソッドを持たず、 :term:" -"`immortal` です。" +"Python における ``False`` オブジェクトです。このオブジェクトはメソッドを持ち" +"ません。参照カウントの点では、他のオブジェクトと同様に扱う必要があります。" -#: ../../c-api/bool.rst:31 -msgid ":c:data:`Py_False` is :term:`immortal`." -msgstr ":c:data:`Py_False` は :term:`immortal` です。" +#: ../../c-api/bool.rst:28 +msgid "" +"The Python ``True`` object. This object has no methods. It needs to be " +"treated just like any other object with respect to reference counts." +msgstr "" +"Python における ``True`` オブジェクトです。このオブジェクトはメソッドを持ちま" +"せん。参照カウントの点では、他のオブジェクトと同様に扱う必要があります。" -#: ../../c-api/bool.rst:37 +#: ../../c-api/bool.rst:34 msgid "" -"The Python ``True`` object. This object has no methods and is :term:" -"`immortal`." +"Return :const:`Py_False` from a function, properly incrementing its " +"reference count." msgstr "" -"Python の ``True`` オブジェクト。このオブジェクトはメソッドを持たず、 :term:" -"`immortal` です。" +":const:`Py_False` に適切な参照カウントのインクリメントを行って、関数から返す" +"ためのマクロです。" #: ../../c-api/bool.rst:40 -msgid ":c:data:`Py_True` is :term:`immortal`." -msgstr ":c:data:`Py_True` は :term:`immortal` です。" +msgid "" +"Return :const:`Py_True` from a function, properly incrementing its reference " +"count." +msgstr "" +":const:`Py_True` に適切な参照カウントのインクリメントを行って、関数から返すた" +"めのマクロです。" #: ../../c-api/bool.rst:46 -msgid "Return :c:data:`Py_False` from a function." -msgstr "関数から :c:data:`Py_False` を返します。" - -#: ../../c-api/bool.rst:51 -msgid "Return :c:data:`Py_True` from a function." -msgstr "関数から :c:data:`Py_True` を返します。" - -#: ../../c-api/bool.rst:56 msgid "" -"Return :c:data:`Py_True` or :c:data:`Py_False`, depending on the truth value " -"of *v*." +"Return a new reference to :const:`Py_True` or :const:`Py_False` depending on " +"the truth value of *v*." msgstr "" -"*v* の真理値に応じて :c:data:`Py_True` または :c:data:`Py_False` を返します。" +"*v* の値に応じて :const:`Py_True` または :const:`Py_False` への新しい参照を返" +"します。" diff --git a/c-api/buffer.po b/c-api/buffer.po index e34000515..6f6b21cc9 100644 --- a/c-api/buffer.po +++ b/c-api/buffer.po @@ -1,31 +1,34 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: +# E. Kawashima, 2017 +# Nozomu Kaneko , 2017 +# Ikuru K , 2017 +# Yusuke Miyazaki , 2017 +# Inada Naoki , 2017 +# Arihiro TAKASE, 2017 +# tomo, 2020 +# mollinaca, 2020 +# 秘湯 , 2020 # Osamu NAKAMURA, 2021 -# 秘湯 , 2021 -# mollinaca, 2021 -# Arihiro TAKASE, 2023 -# tomo, 2023 -# Taichi Haradaguchi, 2024 -# 石井明久, 2024 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-06 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:47+0000\n" -"Last-Translator: 石井明久, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 17:33+0000\n" +"Last-Translator: Osamu NAKAMURA, 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/buffer.rst:11 @@ -59,26 +62,31 @@ msgstr "" #: ../../c-api/buffer.rst:29 msgid "" -"Python provides such a facility at the C and Python level in the form of " -"the :ref:`buffer protocol `. This protocol has two sides:" +"Python provides such a facility at the C level in the form of the :ref:" +"`buffer protocol `. This protocol has two sides:" msgstr "" +"Pythonは :ref:`buffer protocol ` の形式で C レベルの仕組みを提" +"供します。このプロトコルには二つの側面があります:" #: ../../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`; for Python " -"see :ref:`python-buffer-protocol`." +"This interface is described in the section :ref:`buffer-structs`;" msgstr "" +"提供する側では、ある型は、そのオブジェクトの下層にあるバッファに関する情報を" +"提供できる \"buffer インターフェース\" をエクスポートすることができます。この" +"インターフェースは :ref:`buffer-structs` の節で説明します。" -#: ../../c-api/buffer.rst:39 +#: ../../c-api/buffer.rst:38 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). For " -"Python see :class:`memoryview`." +"raw underlying data of an object (for example a method parameter)." msgstr "" +"利用する側では、オブジェクトの下層にある生データへのポインタを得るいくつかの" +"手段が利用できます(たとえばメソッド引数)。" -#: ../../c-api/buffer.rst:43 +#: ../../c-api/buffer.rst:41 msgid "" "Simple objects such as :class:`bytes` and :class:`bytearray` expose their " "underlying buffer in byte-oriented form. Other forms are possible; for " @@ -90,11 +98,11 @@ msgstr "" "バイト列以外の形式も利用可能です。例えば、 :class:`array.array` が公開する要" "素はマルチバイト値になることがあります。" -#: ../../c-api/buffer.rst:47 +#: ../../c-api/buffer.rst:45 msgid "" "An example consumer of the buffer interface is the :meth:`~io.BufferedIOBase." "write` method of file objects: any object that can export a series of bytes " -"through the buffer interface can be written to a file. While :meth:`!write` " +"through the buffer interface can be written to a file. While :meth:`write` " "only needs read-only access to the internal contents of the object passed to " "it, other methods such as :meth:`~io.BufferedIOBase.readinto` need write " "access to the contents of their argument. The buffer interface allows " @@ -104,13 +112,13 @@ msgstr "" "bufferインターフェースの利用者の一例は、ファイルオブジェクトの :meth:`~io." "BufferedIOBase.write` メソッドです: bufferインターフェースを通して一連のバイ" "ト列を提供できるどんなオブジェクトでもファイルに書き込むことができます。 :" -"meth:`!write` は、その引数として渡されたオブジェクトの内部要素に対する読み出" -"し専用アクセスのみを必要としますが、 :meth:`~io.BufferedIOBase.readinto` のよ" -"うな他のメソッドでは、その引数の内容に対する書き込みアクセスが必要です。" -"bufferインターフェースにより、オブジェクトは読み書き両方、読み出し専用バッ" -"ファへのアクセスを許可するかそれとも拒否するか選択することができます。" +"meth:`write` は、その引数として渡されたオブジェクトの内部要素に対する読み出し" +"専用アクセスのみを必要としますが、 :meth:`~io.BufferedIOBase.readinto` のよう" +"な他のメソッドでは、その引数の内容に対する書き込みアクセスが必要です。buffer" +"インターフェースにより、オブジェクトは読み書き両方、読み出し専用バッファへの" +"アクセスを許可するかそれとも拒否するか選択することができます。" -#: ../../c-api/buffer.rst:55 +#: ../../c-api/buffer.rst:53 msgid "" "There are two ways for a consumer of the buffer interface to acquire a " "buffer over a target object:" @@ -118,11 +126,11 @@ msgstr "" "bufferインターフェースの利用者には、対象となるオブジェクトのバッファを得る二" "つの方法があります:" -#: ../../c-api/buffer.rst:58 +#: ../../c-api/buffer.rst:56 msgid "call :c:func:`PyObject_GetBuffer` with the right parameters;" msgstr "正しい引数で :c:func:`PyObject_GetBuffer` を呼び出す;" -#: ../../c-api/buffer.rst:60 +#: ../../c-api/buffer.rst:58 msgid "" "call :c:func:`PyArg_ParseTuple` (or one of its siblings) with one of the " "``y*``, ``w*`` or ``s*`` :ref:`format codes `." @@ -130,7 +138,7 @@ msgstr "" ":c:func:`PyArg_ParseTuple` (またはその同族のひとつ) を ``y*`` 、 ``w*`` また" "は ``s*`` :ref:`format codes ` のいずれかとともに呼び出す。" -#: ../../c-api/buffer.rst:63 +#: ../../c-api/buffer.rst:61 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 " @@ -141,16 +149,10 @@ 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 "buffer 構造体" -#: ../../c-api/buffer.rst:77 +#: ../../c-api/buffer.rst:71 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 " @@ -169,7 +171,7 @@ msgstr "" "渡す前のメモリブロックかもしれませんし、構造化データをネイティブのインメモリ" "形式受け渡すのに使用されるかもしれません。" -#: ../../c-api/buffer.rst:86 +#: ../../c-api/buffer.rst:80 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 " @@ -182,7 +184,7 @@ msgstr "" "ピーが非常に簡単に行えます。バッファの一般的なラッパーが必要なときは、 :ref:" "`memoryview ` オブジェクトが作成されます。" -#: ../../c-api/buffer.rst:92 +#: ../../c-api/buffer.rst:86 msgid "" "For short instructions how to write an exporting object, see :ref:`Buffer " "Object Structures `. For obtaining a buffer, see :c:func:" @@ -192,7 +194,7 @@ msgstr "" "Structures ` を参照してください。バッファを取得するには、 :c:" "func:`PyObject_GetBuffer` を参照してください。" -#: ../../c-api/buffer.rst:100 +#: ../../c-api/buffer.rst:94 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 " @@ -205,22 +207,25 @@ msgstr "" "例えば :c:member:`~Py_buffer.strides` が負だと、この値はメモリブロックの末尾" "かもしれません。" -#: ../../c-api/buffer.rst:105 +#: ../../c-api/buffer.rst:99 msgid "" "For :term:`contiguous` arrays, the value points to the beginning of the " "memory block." msgstr "" ":term:`連続 ` 配列の場合この値はメモリブロックの先頭を指します。" -#: ../../c-api/buffer.rst:110 +#: ../../c-api/buffer.rst:104 msgid "" "A new reference to the exporting object. The reference is owned by the " -"consumer and automatically released (i.e. reference count decremented) and " -"set to ``NULL`` by :c:func:`PyBuffer_Release`. The field is the equivalent " -"of the return value of any standard C-API function." +"consumer and automatically decremented and set to ``NULL`` by :c:func:" +"`PyBuffer_Release`. The field is the equivalent of the return value of any " +"standard C-API function." msgstr "" +"エクスポートされているオブジェクトの新しい参照。参照は消費者によって所有さ" +"れ、:c:func:`PyBuffer_Release` によって自動的にデクリメントされて ``NULL`` に" +"設定されます。このフィールドは標準的なC-API 関数の戻り値と等価です。" -#: ../../c-api/buffer.rst:117 +#: ../../c-api/buffer.rst:109 msgid "" "As a special case, for *temporary* buffers that are wrapped by :c:func:" "`PyMemoryView_FromBuffer` or :c:func:`PyBuffer_FillInfo` this field is " @@ -231,7 +236,7 @@ msgstr "" "``NULL`` です。一般的に、エクスポートオブジェクトはこの方式を使用してはなりま" "せん。" -#: ../../c-api/buffer.rst:124 +#: ../../c-api/buffer.rst:116 msgid "" "``product(shape) * itemsize``. For contiguous arrays, this is the length of " "the underlying memory block. For non-contiguous arrays, it is the length " @@ -242,7 +247,7 @@ msgstr "" "になります。非contiguous 配列では、contiguous表現にコピーされた場合に論理構造" "がもつ長さです。" -#: ../../c-api/buffer.rst:129 +#: ../../c-api/buffer.rst:121 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 " @@ -255,7 +260,7 @@ msgstr "" "多くの場合に、そのようなリクエストは :c:macro:`PyBUF_SIMPLE` または :c:macro:" "`PyBUF_WRITABLE` です。" -#: ../../c-api/buffer.rst:135 +#: ../../c-api/buffer.rst:127 msgid "" "An indicator of whether the buffer is read-only. This field is controlled by " "the :c:macro:`PyBUF_WRITABLE` flag." @@ -263,7 +268,7 @@ msgstr "" "バッファが読み出し専用であるか示します。このフィールドは :c:macro:" "`PyBUF_WRITABLE` フラグで制御できます。" -#: ../../c-api/buffer.rst:140 +#: ../../c-api/buffer.rst:132 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." @@ -272,7 +277,7 @@ msgstr "" ":func:`struct.calcsize` を非 ``NULL`` の :c:member:`~Py_buffer.format` 値に対" "して呼び出した結果と同じです。" -#: ../../c-api/buffer.rst:143 +#: ../../c-api/buffer.rst:135 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 " @@ -284,7 +289,7 @@ msgstr "" "しかし :c:member:`~Py_buffer.itemsize` は元のフォーマットに従った値を保持しま" "す。" -#: ../../c-api/buffer.rst:148 +#: ../../c-api/buffer.rst:140 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." @@ -294,7 +299,7 @@ msgstr "" "len`` の等式が守られ、利用者は :c:member:`~Py_buffer.itemsize` を buffer を読" "むために利用できます。" -#: ../../c-api/buffer.rst:152 +#: ../../c-api/buffer.rst:144 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 " @@ -305,27 +310,45 @@ msgstr "" "`~Py_buffer.itemsize` を無視して ``itemsize == 1`` と見なさなければなりませ" "ん。" -#: ../../c-api/buffer.rst:158 +#: ../../c-api/buffer.rst:150 msgid "" -"A *NULL* terminated string in :mod:`struct` module style syntax describing " +"A *NUL* 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 "" +"要素一つ分の内容を指定する、 :mod:`struct` モジュールスタイル文法の、 *NUL* " +"終端文字列。 このポインタの値が ``NULL`` なら、 ``\"B\"`` (符号無しバイト) と" +"して扱われます。" -#: ../../c-api/buffer.rst:162 +#: ../../c-api/buffer.rst:154 msgid "This field is controlled by the :c:macro:`PyBUF_FORMAT` flag." msgstr "このフィールドは :c:macro:`PyBUF_FORMAT` フラグによって制御されます。" -#: ../../c-api/buffer.rst:166 +#: ../../c-api/buffer.rst:158 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 " "a scalar. In this case, :c:member:`~Py_buffer.shape`, :c:member:`~Py_buffer." -"strides` and :c:member:`~Py_buffer.suboffsets` MUST be ``NULL``. The maximum " -"number of dimensions is given by :c:macro:`PyBUF_MAX_NDIM`." +"strides` and :c:member:`~Py_buffer.suboffsets` MUST be ``NULL``." msgstr "" +"メモリがN次元配列を表している時の次元数。\n" +"``0`` の場合、 :c:member:`~Py_buffer.buf` はスカラ値を表す1つの要素を指してい" +"ます。\n" +"この場合、 :c:member:`~Py_buffer.shape`, :c:member:`~Py_buffer.strides`, :c:" +"member:`~Py_buffer.suboffsets` は ``NULL`` でなければなりません。" -#: ../../c-api/buffer.rst:174 +#: ../../c-api/buffer.rst:163 +msgid "" +"The macro :c:macro:`PyBUF_MAX_NDIM` limits the maximum number of dimensions " +"to 64. Exporters MUST respect this limit, consumers of multi-dimensional " +"buffers SHOULD be able to handle up to :c:macro:`PyBUF_MAX_NDIM` dimensions." +msgstr "" +":c:macro:`PyBUF_MAX_NDIM` は次元数の最大値を64に制限しています。\n" +"提供側はこの制限を尊重しなければなりません。\n" +"多次元配列の消費側は :c:macro:`PyBUF_MAX_NDIM` 次元までを扱えるようにするべき" +"です。" + +#: ../../c-api/buffer.rst:169 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 " @@ -337,7 +360,7 @@ msgstr "" "``shape[0] * ... * shape[ndim-1] * itemsize`` は :c:member:`~Py_buffer.len` " "と等しくなければなりません。" -#: ../../c-api/buffer.rst:179 +#: ../../c-api/buffer.rst:174 msgid "" "Shape values are restricted to ``shape[n] >= 0``. The case ``shape[n] == 0`` " "requires special attention. See `complex arrays`_ for further information." @@ -346,11 +369,11 @@ msgstr "" "に注意が必要です。\n" "詳細は `complex arrays`_ を参照してください。" -#: ../../c-api/buffer.rst:183 +#: ../../c-api/buffer.rst:178 msgid "The shape array is read-only for the consumer." msgstr "shepe (形状) 配列は利用者からは読み出し専用です。" -#: ../../c-api/buffer.rst:187 +#: ../../c-api/buffer.rst:182 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." @@ -358,7 +381,7 @@ msgstr "" "各次元において新しい値を得るためにスキップするバイト数を示す、長さ :c:member:" "`~Py_buffer.ndim` の :c:type:`Py_ssize_t` の配列。" -#: ../../c-api/buffer.rst:191 +#: ../../c-api/buffer.rst:186 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] <= " @@ -368,11 +391,11 @@ msgstr "" "いけば有効です。しかし利用者は、``strides[n] <= 0`` のケースを処理することが" "できる必要があります。詳細については `complex arrays`_ を参照してください。" -#: ../../c-api/buffer.rst:195 +#: ../../c-api/buffer.rst:190 msgid "The strides array is read-only for the consumer." msgstr "消費者にとって、この strides 配列は読み出し専用です。" -#: ../../c-api/buffer.rst:199 +#: ../../c-api/buffer.rst:194 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 " @@ -388,7 +411,7 @@ msgstr "" "suboffset の値が負の数の場合は、ポインタの参照解決は不要 (連続したメモリブ" "ロック内に直接配置されいる) ということになります。" -#: ../../c-api/buffer.rst:206 +#: ../../c-api/buffer.rst:201 msgid "" "If all suboffsets are negative (i.e. no de-referencing is needed), then this " "field must be ``NULL`` (the default value)." @@ -396,7 +419,7 @@ msgstr "" "全ての suboffset が負数の場合 (つまり参照解決が不要) な場合、このフィールド" "は ``NULL`` (デフォルト値) でなければなりません。" -#: ../../c-api/buffer.rst:209 +#: ../../c-api/buffer.rst:204 msgid "" "This type of array representation is used by the Python Imaging Library " "(PIL). See `complex arrays`_ for further information how to access elements " @@ -406,11 +429,11 @@ msgstr "" "このような配列で要素にアクセスする方法についてさらに詳しことは `complex " "arrays`_ を参照してください。" -#: ../../c-api/buffer.rst:213 +#: ../../c-api/buffer.rst:208 msgid "The suboffsets array is read-only for the consumer." msgstr "消費者にとって、suboffsets 配列は読み出し専用です。" -#: ../../c-api/buffer.rst:217 +#: ../../c-api/buffer.rst:212 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 " @@ -423,22 +446,11 @@ msgstr "" "ことができるでしょう。バッファを受け取る側は、この値を決して変更してはなりま" "せん。" -#: ../../c-api/buffer.rst:224 -msgid "Constants:" -msgstr "" - -#: ../../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:237 +#: ../../c-api/buffer.rst:221 msgid "Buffer request types" msgstr "バッファリクエストのタイプ" -#: ../../c-api/buffer.rst:239 +#: ../../c-api/buffer.rst:223 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 " @@ -450,18 +462,18 @@ msgstr "" "の複雑性は多岐にわたるため、消費者は *flags* 引数を使って、自身が扱えるバッ" "ファの種類を指定します。" -#: ../../c-api/buffer.rst:244 +#: ../../c-api/buffer.rst:228 msgid "" -"All :c:type:`Py_buffer` fields are unambiguously defined by the request type." +"All :c:data:`Py_buffer` fields are unambiguously defined by the request type." msgstr "" -":c:type:`Py_buffer` の全フィールドは、リクエストの種類によって曖昧さを残さず" +":c:data:`Py_buffer` の全フィールドは、リクエストの種類によって曖昧さを残さず" "に定義されます。" -#: ../../c-api/buffer.rst:248 +#: ../../c-api/buffer.rst:232 msgid "request-independent fields" msgstr "リクエストに依存しないフィールド" -#: ../../c-api/buffer.rst:249 +#: ../../c-api/buffer.rst:233 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:" @@ -472,20 +484,24 @@ msgstr "" "c:member:`~Py_buffer.obj`, :c:member:`~Py_buffer.buf`, :c:member:`~Py_buffer." "len`, :c:member:`~Py_buffer.itemsize`, :c:member:`~Py_buffer.ndim`." -#: ../../c-api/buffer.rst:254 +#: ../../c-api/buffer.rst:239 msgid "readonly, format" msgstr "readonly, format" -#: ../../c-api/buffer.rst:258 +#: ../../c-api/buffer.rst:243 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. For example, :c:expr:`PyBUF_SIMPLE | " -"PyBUF_WRITABLE` can be used to request a simple writable buffer." +"MUST be consistent for all consumers." msgstr "" +":c:member:`~Py_buffer.readonly` フィールドを制御します。もしこのフラグが設定" +"されている場合、exporter は、書き込み可能なバッファを提供するか、さもなければ" +"失敗を報告しなければなりません。フラグが設定されていない場合、exporterは、読" +"み出し専用と書き込み可能なバッファのどちらを提供しても構いませんが、どちらで" +"提供するかどうかは全ての消費者に対して一貫性がなければなりません。" -#: ../../c-api/buffer.rst:266 +#: ../../c-api/buffer.rst:250 msgid "" "Controls the :c:member:`~Py_buffer.format` field. If set, this field MUST be " "filled in correctly. Otherwise, this field MUST be ``NULL``." @@ -494,7 +510,7 @@ msgstr "" "いれば、このフィールドを正しく埋めなければなりません。フラグが設定されていな" "ければ、このフィールドを ``NULL`` に設定しなければなりません。" -#: ../../c-api/buffer.rst:270 +#: ../../c-api/buffer.rst:254 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:" @@ -507,18 +523,20 @@ msgstr "" "`PyBUF_WRITABLE` は単純な書き込み可能なバッファを要求する単独のフラグとして使" "えます。" -#: ../../c-api/buffer.rst:274 +#: ../../c-api/buffer.rst:258 msgid "" -":c:macro:`PyBUF_FORMAT` must be \\|'d to any of the flags except :c:macro:" -"`PyBUF_SIMPLE`, because the latter already implies format ``B`` (unsigned " -"bytes). :c:macro:`!PyBUF_FORMAT` cannot be used on its own." +":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)." msgstr "" +":c:macro:`PyBUF_FORMAT` は、:c:macro:`PyBUF_SIMPLE` 以外のどのフラグとも \\| " +"を取ってかまいません。\n" +"後者のフラグは ``B`` (符号なしバイト) フォーマットを既に指示しています。" -#: ../../c-api/buffer.rst:280 +#: ../../c-api/buffer.rst:263 msgid "shape, strides, suboffsets" msgstr "shape, strides, suboffsets" -#: ../../c-api/buffer.rst:282 +#: ../../c-api/buffer.rst:265 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 " @@ -528,57 +546,57 @@ msgstr "" "す。個々のフラグは、それより下に記載されたフラグのすべてのビットを含むことに" "注意してください。" -#: ../../c-api/buffer.rst:289 ../../c-api/buffer.rst:313 -#: ../../c-api/buffer.rst:338 +#: ../../c-api/buffer.rst:272 ../../c-api/buffer.rst:296 +#: ../../c-api/buffer.rst:321 msgid "Request" msgstr "リクエスト" -#: ../../c-api/buffer.rst:289 ../../c-api/buffer.rst:313 -#: ../../c-api/buffer.rst:338 +#: ../../c-api/buffer.rst:272 ../../c-api/buffer.rst:296 +#: ../../c-api/buffer.rst:321 msgid "shape" msgstr "shape" -#: ../../c-api/buffer.rst:289 ../../c-api/buffer.rst:313 -#: ../../c-api/buffer.rst:338 +#: ../../c-api/buffer.rst:272 ../../c-api/buffer.rst:296 +#: ../../c-api/buffer.rst:321 msgid "strides" msgstr "strides" -#: ../../c-api/buffer.rst:289 ../../c-api/buffer.rst:313 -#: ../../c-api/buffer.rst:338 +#: ../../c-api/buffer.rst:272 ../../c-api/buffer.rst:296 +#: ../../c-api/buffer.rst:321 msgid "suboffsets" msgstr "suboffsets" -#: ../../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 +#: ../../c-api/buffer.rst:274 ../../c-api/buffer.rst:276 +#: ../../c-api/buffer.rst:278 ../../c-api/buffer.rst:298 +#: ../../c-api/buffer.rst:300 ../../c-api/buffer.rst:302 +#: ../../c-api/buffer.rst:304 ../../c-api/buffer.rst:323 +#: ../../c-api/buffer.rst:325 ../../c-api/buffer.rst:327 +#: ../../c-api/buffer.rst:329 ../../c-api/buffer.rst:331 +#: ../../c-api/buffer.rst:333 ../../c-api/buffer.rst:335 +#: ../../c-api/buffer.rst:337 msgid "yes" msgstr "yes" -#: ../../c-api/buffer.rst:291 ../../c-api/buffer.rst:340 -#: ../../c-api/buffer.rst:342 +#: ../../c-api/buffer.rst:274 ../../c-api/buffer.rst:323 +#: ../../c-api/buffer.rst:325 msgid "if needed" msgstr "必要な場合" -#: ../../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 +#: ../../c-api/buffer.rst:276 ../../c-api/buffer.rst:278 +#: ../../c-api/buffer.rst:280 ../../c-api/buffer.rst:298 +#: ../../c-api/buffer.rst:300 ../../c-api/buffer.rst:302 +#: ../../c-api/buffer.rst:304 ../../c-api/buffer.rst:327 +#: ../../c-api/buffer.rst:329 ../../c-api/buffer.rst:331 +#: ../../c-api/buffer.rst:333 ../../c-api/buffer.rst:335 +#: ../../c-api/buffer.rst:337 msgid "NULL" msgstr "NULL" -#: ../../c-api/buffer.rst:304 +#: ../../c-api/buffer.rst:287 msgid "contiguity requests" msgstr "隣接性のリクエスト" -#: ../../c-api/buffer.rst:306 +#: ../../c-api/buffer.rst:289 msgid "" "C or Fortran :term:`contiguity ` can be explicitly requested, " "with and without stride information. Without stride information, the buffer " @@ -588,32 +606,32 @@ msgstr "" "` が明確に要求される可能性があります。\n" "ストライド情報なしに、バッファーは C と隣接している必要があります。" -#: ../../c-api/buffer.rst:313 ../../c-api/buffer.rst:338 +#: ../../c-api/buffer.rst:296 ../../c-api/buffer.rst:321 msgid "contig" msgstr "contig" -#: ../../c-api/buffer.rst:315 ../../c-api/buffer.rst:321 -#: ../../c-api/buffer.rst:352 ../../c-api/buffer.rst:354 +#: ../../c-api/buffer.rst:298 ../../c-api/buffer.rst:304 +#: ../../c-api/buffer.rst:335 ../../c-api/buffer.rst:337 msgid "C" msgstr "C" -#: ../../c-api/buffer.rst:317 +#: ../../c-api/buffer.rst:300 msgid "F" msgstr "F" -#: ../../c-api/buffer.rst:319 +#: ../../c-api/buffer.rst:302 msgid "C or F" msgstr "C か F" -#: ../../c-api/buffer.rst:321 +#: ../../c-api/buffer.rst:304 msgid ":c:macro:`PyBUF_ND`" msgstr ":c:macro:`PyBUF_ND`" -#: ../../c-api/buffer.rst:326 +#: ../../c-api/buffer.rst:309 msgid "compound requests" msgstr "複合リクエスト" -#: ../../c-api/buffer.rst:328 +#: ../../c-api/buffer.rst:311 msgid "" "All possible requests are fully defined by some combination of the flags in " "the previous section. For convenience, the buffer protocol provides " @@ -624,7 +642,7 @@ msgstr "" "便利なように、バッファープロトコルでは頻繁に使用される組み合わせを単一のフラ" "グとして提供してます。" -#: ../../c-api/buffer.rst:332 +#: ../../c-api/buffer.rst:315 msgid "" "In the following table *U* stands for undefined contiguity. The consumer " "would have to call :c:func:`PyBuffer_IsContiguous` to determine contiguity." @@ -633,39 +651,39 @@ msgstr "" "利用者は :c:func:`PyBuffer_IsContiguous` を呼び出して連続性を判定する必要があ" "るでしょう。" -#: ../../c-api/buffer.rst:338 +#: ../../c-api/buffer.rst:321 msgid "readonly" msgstr "readonly" -#: ../../c-api/buffer.rst:338 +#: ../../c-api/buffer.rst:321 msgid "format" msgstr "format" -#: ../../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:323 ../../c-api/buffer.rst:325 +#: ../../c-api/buffer.rst:327 ../../c-api/buffer.rst:329 +#: ../../c-api/buffer.rst:331 ../../c-api/buffer.rst:333 msgid "U" msgstr "U" -#: ../../c-api/buffer.rst:340 ../../c-api/buffer.rst:344 -#: ../../c-api/buffer.rst:348 ../../c-api/buffer.rst:352 +#: ../../c-api/buffer.rst:323 ../../c-api/buffer.rst:327 +#: ../../c-api/buffer.rst:331 ../../c-api/buffer.rst:335 msgid "0" msgstr "0" -#: ../../c-api/buffer.rst:342 ../../c-api/buffer.rst:346 -#: ../../c-api/buffer.rst:350 ../../c-api/buffer.rst:354 +#: ../../c-api/buffer.rst:325 ../../c-api/buffer.rst:329 +#: ../../c-api/buffer.rst:333 ../../c-api/buffer.rst:337 msgid "1 or 0" msgstr "1 か 0" -#: ../../c-api/buffer.rst:359 +#: ../../c-api/buffer.rst:342 msgid "Complex arrays" msgstr "複雑な配列" -#: ../../c-api/buffer.rst:362 +#: ../../c-api/buffer.rst:345 msgid "NumPy-style: shape and strides" msgstr "NumPy スタイル: shape, strides" -#: ../../c-api/buffer.rst:364 +#: ../../c-api/buffer.rst:347 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." @@ -675,7 +693,7 @@ msgstr "" "member:`~Py_buffer.ndim`, :c:member:`~Py_buffer.shape`, :c:member:" "`~Py_buffer.strides` で定義されます。" -#: ../../c-api/buffer.rst:367 +#: ../../c-api/buffer.rst:350 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 " @@ -687,7 +705,7 @@ msgstr "" "この場合、 :c:member:`~Py_buffer.shape` と :c:member:`~Py_buffer.strides` の" "両方とも ``NULL`` です。" -#: ../../c-api/buffer.rst:371 +#: ../../c-api/buffer.rst:354 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-" @@ -698,14 +716,7 @@ msgstr "" "そうでない場合は、利用者は次のように n 次元配列にアクセスしなければなりませ" "ん:" -#: ../../c-api/buffer.rst:375 -msgid "" -"ptr = (char *)buf + indices[0] * strides[0] + ... + indices[n-1] * " -"strides[n-1];\n" -"item = *((typeof(item) *)ptr);" -msgstr "" - -#: ../../c-api/buffer.rst:381 +#: ../../c-api/buffer.rst:364 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 " @@ -715,40 +726,11 @@ msgstr "" "すことが可能です。エクスポーターはこの関数を使用することによってバッファの妥" "当性を確認出来ます。" -#: ../../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" -" the bounds of the allocated memory:\n" -" char *mem: start of the physical memory block\n" -" memlen: length of the physical memory block\n" -" offset: (char *)buf - mem\n" -" \"\"\"\n" -" if offset % itemsize:\n" -" return False\n" -" if offset < 0 or offset+itemsize > memlen:\n" -" return False\n" -" if any(v % itemsize for v in strides):\n" -" return False\n" -"\n" -" if ndim <= 0:\n" -" return ndim == 0 and not shape and not strides\n" -" if 0 in shape:\n" -" return True\n" -"\n" -" imin = sum(strides[j]*(shape[j]-1) for j in range(ndim)\n" -" if strides[j] <= 0)\n" -" imax = sum(strides[j]*(shape[j]-1) for j in range(ndim)\n" -" if strides[j] > 0)\n" -"\n" -" return 0 <= offset+imin and offset+imax+itemsize <= memlen" -msgstr "" - -#: ../../c-api/buffer.rst:415 +#: ../../c-api/buffer.rst:398 msgid "PIL-style: shape, strides and suboffsets" msgstr "PIL スタイル: shape, strides, suboffsets" -#: ../../c-api/buffer.rst:417 +#: ../../c-api/buffer.rst:400 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 " @@ -766,7 +748,7 @@ msgstr "" "頭に埋め込め、メモリのどこにでも配置できる 2 つの ``char x[2][3]`` 配列を指し" "ます。" -#: ../../c-api/buffer.rst:426 +#: ../../c-api/buffer.rst:409 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`` " @@ -775,27 +757,11 @@ msgstr "" "次の例は、 strides も suboffsets も ``NULL`` でない場合の、N 次元インデックス" "によって指されている N 次元配列内の要素へのポインタを返す関数です::" -#: ../../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" -" char *pointer = (char*)buf;\n" -" int i;\n" -" for (i = 0; i < ndim; i++) {\n" -" pointer += strides[i] * indices[i];\n" -" if (suboffsets[i] >=0 ) {\n" -" pointer = *((char**)pointer) + suboffsets[i];\n" -" }\n" -" }\n" -" return (void*)pointer;\n" -"}" -msgstr "" - -#: ../../c-api/buffer.rst:445 +#: ../../c-api/buffer.rst:428 msgid "Buffer-related functions" msgstr "バッファ関連の関数" -#: ../../c-api/buffer.rst:449 +#: ../../c-api/buffer.rst:432 msgid "" "Return ``1`` if *obj* supports the buffer interface otherwise ``0``. When " "``1`` is returned, it doesn't guarantee that :c:func:`PyObject_GetBuffer` " @@ -807,18 +773,18 @@ msgstr "" "れません。\n" "この関数は常に成功します。" -#: ../../c-api/buffer.rst:456 +#: ../../c-api/buffer.rst:439 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``." +"the exporter cannot provide a buffer of the exact type, it MUST raise :c:" +"data:`PyExc_BufferError`, set ``view->obj`` to ``NULL`` and return ``-1``." msgstr "" -"*exporter* に *flags* で指定された方法で *view* を埋めるように要求します。も" -"し exporter が指定されたとおりにバッファを提供できない場合、 :exc:" -"`BufferError` を送出し、 ``view->obj`` を ``NULL`` に設定した上で、 ``-1`` を" -"返さなければなりません。" +"*exporter* に *flags* で指定された方法で *view* を埋めるように要求します。\n" +"もし exporter が指定されたとおりにバッファを提供できない場合、 :c:data:" +"`PyExc_BufferError` を送出し、 ``view->obj`` を ``NULL`` に設定した上で、 " +"``-1`` を返さなければなりません。" -#: ../../c-api/buffer.rst:461 +#: ../../c-api/buffer.rst:444 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 " @@ -831,7 +797,7 @@ msgstr "" "このオブジェクトを参照します (:ref:`バッファオブジェクト構造体 ` を参照してください)。" -#: ../../c-api/buffer.rst:466 +#: ../../c-api/buffer.rst:449 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:" @@ -844,15 +810,17 @@ msgstr "" "従って、バッファの利用が済んだら :c:func:`PyBuffer_Release` が厳密に1回だけ呼" "び出されなければなりません。" -#: ../../c-api/buffer.rst:474 +#: ../../c-api/buffer.rst:457 msgid "" -"Release the buffer *view* and release the :term:`strong reference` (i.e. " -"decrement the reference count) to the view's supporting object, ``view-" +"Release the buffer *view* and decrement the reference count for ``view-" ">obj``. This function MUST be called when the buffer is no longer being " "used, otherwise reference leaks may occur." msgstr "" +"バッファ *view* を解放し、 ``view->obj`` の参照カウントを1つ減らします。\n" +"この関数はバッファが使われることがなくなったときに呼び出さなければならず、そ" +"うしないと参照のリークが起こり得ます。" -#: ../../c-api/buffer.rst:479 +#: ../../c-api/buffer.rst:461 msgid "" "It is an error to call this function on a buffer that was not obtained via :" "c:func:`PyObject_GetBuffer`." @@ -860,13 +828,13 @@ msgstr "" ":c:func:`PyObject_GetBuffer` を通して取得していないバッファに対してこの関数を" "呼び出すのは間違いです。" -#: ../../c-api/buffer.rst:485 +#: ../../c-api/buffer.rst:467 msgid "" -"Return the implied :c:member:`~Py_buffer.itemsize` from :c:member:" -"`~Py_buffer.format`. On error, raise an exception and return -1." +"Return the implied :c:data:`~Py_buffer.itemsize` from :c:data:`~Py_buffer." +"format`. On error, raise an exception and return -1." msgstr "" -#: ../../c-api/buffer.rst:493 +#: ../../c-api/buffer.rst:475 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 " @@ -879,7 +847,7 @@ msgstr "" "それ以外の場合は ``0`` を返します。\n" "この関数は常に成功します。" -#: ../../c-api/buffer.rst:500 +#: ../../c-api/buffer.rst:482 msgid "" "Get the memory area pointed to by the *indices* inside the given *view*. " "*indices* must point to an array of ``view->ndim`` indices." @@ -888,7 +856,7 @@ msgstr "" "*indices* は ``view->ndim`` 個のインデックスからなる配列を指していなければな" "りません。" -#: ../../c-api/buffer.rst:506 +#: ../../c-api/buffer.rst:488 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 " @@ -898,7 +866,7 @@ msgstr "" "``'C'`` か ``'F'`` を指定できます(それぞれC言語スタイルとFortranスタイルの順" "序を表します)。成功時には ``0``、エラー時には ``-1`` を返します。" -#: ../../c-api/buffer.rst:513 +#: ../../c-api/buffer.rst:495 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 " @@ -909,21 +877,11 @@ msgstr "" "Fortran スタイル順序またはそれ以外) が指定できます。\n" "成功したら ``0`` が返り、エラーなら ``-1`` が返ります。" -#: ../../c-api/buffer.rst:517 +#: ../../c-api/buffer.rst:499 msgid "This function fails if *len* != *src->len*." msgstr "*len* != *src->len* の場合、この関数は失敗します。" -#: ../../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:525 -msgid "``0`` is returned on success, ``-1`` on error." -msgstr "成功したら ``0`` が、エラー時には ``-1`` が返されます。" - -#: ../../c-api/buffer.rst:529 +#: ../../c-api/buffer.rst:504 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 " @@ -933,7 +891,7 @@ msgstr "" "た :term:`連続な ` (*order* が ``'C'`` なら C-style 、 ``'F'`` な" "ら Fortran-style の) 多次元配列として埋める。" -#: ../../c-api/buffer.rst:536 +#: ../../c-api/buffer.rst:511 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 " @@ -943,7 +901,7 @@ msgstr "" "バッファリクエストを処理します。\n" "*buf* は符号無しバイトの列として解釈されます。" -#: ../../c-api/buffer.rst:540 +#: ../../c-api/buffer.rst:515 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-" @@ -954,14 +912,18 @@ msgstr "" "`PyBUF_WRITABLE` が設定されていない限り、常にフラグに指定された通りに *view* " "を埋めます。" -#: ../../c-api/buffer.rst:544 +#: ../../c-api/buffer.rst:519 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``;" +"Otherwise, raise :c:data:`PyExc_BufferError`, set ``view->obj`` to ``NULL`` " +"and return ``-1``;" msgstr "" +"成功したときは、 ``view->obj`` に *exporter* への新しい参照を設定し、 0 を返" +"します。\n" +"失敗したときは、 :c:data:`PyExc_BufferError` を送出し、 ``view->obj`` に " +"``NULL`` を設定し、 ``-1`` を返します;" -#: ../../c-api/buffer.rst:548 +#: ../../c-api/buffer.rst:523 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 " @@ -971,35 +933,3 @@ msgstr "" "*exporter* はエクスポートするオブジェクトに設定しなければならず、さらに " "*flags* は変更せずに渡さなければなりません。\n" "そうでない場合は、 *exporter* は ``NULL`` でなければなりません。" - -#: ../../c-api/buffer.rst:3 -msgid "buffer protocol" -msgstr "buffer protocol" - -#: ../../c-api/buffer.rst:3 -msgid "buffer interface" -msgstr "" - -#: ../../c-api/buffer.rst:3 -msgid "(see buffer protocol)" -msgstr "" - -#: ../../c-api/buffer.rst:3 -msgid "buffer object" -msgstr "" - -#: ../../c-api/buffer.rst:32 -msgid "PyBufferProcs (C type)" -msgstr "" - -#: ../../c-api/buffer.rst:301 -msgid "contiguous" -msgstr "contiguous" - -#: ../../c-api/buffer.rst:301 -msgid "C-contiguous" -msgstr "" - -#: ../../c-api/buffer.rst:301 -msgid "Fortran contiguous" -msgstr "" diff --git a/c-api/bytearray.po b/c-api/bytearray.po index 7abdb0cae..dc5fdea73 100644 --- a/c-api/bytearray.po +++ b/c-api/bytearray.po @@ -1,27 +1,27 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Arihiro TAKASE, 2023 -# Nozomu Kaneko , 2023 -# tomo, 2023 +# shirou - しろう , 2017 +# Arihiro TAKASE, 2017 +# tomo, 2021 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:47+0000\n" -"Last-Translator: tomo, 2023\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-07 05:06+0000\n" +"PO-Revision-Date: 2017-02-16 17:33+0000\n" +"Last-Translator: tomo, 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/bytearray.rst:6 @@ -75,25 +75,24 @@ msgstr "" ":ref:`buffer protocol ` を実装した任意のオブジェクト *o* か" "ら、新しいbytearrayオブジェクトを作成し、返します。" -#: ../../c-api/bytearray.rst:45 ../../c-api/bytearray.rst:52 -#: ../../c-api/bytearray.rst:59 -msgid "On failure, return ``NULL`` with an exception set." -msgstr "" - #: ../../c-api/bytearray.rst:50 -msgid "Create a new bytearray object from *string* and its length, *len*." +msgid "" +"Create a new bytearray object from *string* and its length, *len*. On " +"failure, ``NULL`` is returned." msgstr "" +"*string* とその長さ *len* から新しい bytearray オブジェクトを返します。失敗し" +"た場合は ``NULL`` を返します。" -#: ../../c-api/bytearray.rst:57 +#: ../../c-api/bytearray.rst:56 msgid "" "Concat bytearrays *a* and *b* and return a new bytearray with the result." msgstr "bytearray *a* と *b* を連結した結果を新しい bytearray として返します。" -#: ../../c-api/bytearray.rst:64 +#: ../../c-api/bytearray.rst:61 msgid "Return the size of *bytearray* after checking for a ``NULL`` pointer." msgstr "``NULL`` ポインタチェックの後に *bytearray* のサイズを返します。" -#: ../../c-api/bytearray.rst:69 +#: ../../c-api/bytearray.rst:66 msgid "" "Return the contents of *bytearray* as a char array after checking for a " "``NULL`` pointer. The returned array always has an extra null byte appended." @@ -102,41 +101,24 @@ msgstr "" "す。\n" "返される配列には、常に余分な null バイトが追加されます。" -#: ../../c-api/bytearray.rst:76 -msgid "" -"Resize the internal buffer of *bytearray* to *len*. Failure is a ``-1`` " -"return with an exception set." -msgstr "" - -#: ../../c-api/bytearray.rst:79 -msgid "" -"A negative *len* will now result in an exception being set and -1 returned." -msgstr "" +#: ../../c-api/bytearray.rst:73 +msgid "Resize the internal buffer of *bytearray* to *len*." +msgstr "*bytearray* の内部バッファを *len* へリサイズします。" -#: ../../c-api/bytearray.rst:84 +#: ../../c-api/bytearray.rst:76 msgid "Macros" msgstr "マクロ" -#: ../../c-api/bytearray.rst:86 +#: ../../c-api/bytearray.rst:78 msgid "These macros trade safety for speed and they don't check pointers." msgstr "" "以下のマクロは、ポインタのチェックをしないことにより安全性を犠牲にしてスピー" "ドを優先しています。" -#: ../../c-api/bytearray.rst:90 -msgid "Similar to :c:func:`PyByteArray_AsString`, but without error checking." -msgstr "" -":c:func:`PyByteArray_AsString` に似ていますが、エラーチェックを行いません。" - -#: ../../c-api/bytearray.rst:95 -msgid "Similar to :c:func:`PyByteArray_Size`, but without error checking." -msgstr "" -":c:func:`PyByteArray_Size` に似ていますが、エラーチェックを行いません。" - -#: ../../c-api/bytearray.rst:8 -msgid "object" -msgstr "object" +#: ../../c-api/bytearray.rst:82 +msgid "Macro version of :c:func:`PyByteArray_AsString`." +msgstr ":c:func:`PyByteArray_AsString` のマクロバージョン。" -#: ../../c-api/bytearray.rst:8 -msgid "bytearray" -msgstr "bytearray" +#: ../../c-api/bytearray.rst:87 +msgid "Macro version of :c:func:`PyByteArray_Size`." +msgstr ":c:func:`PyByteArray_Size` のマクロバージョン。" diff --git a/c-api/bytes.po b/c-api/bytes.po index c801bbe29..83194b421 100644 --- a/c-api/bytes.po +++ b/c-api/bytes.po @@ -1,27 +1,29 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Arihiro TAKASE, 2023 -# tomo, 2023 -# Taichi Haradaguchi, 2024 +# Nozomu Kaneko , 2017 +# 秘湯 , 2017 +# Osamu NAKAMURA, 2017 +# Arihiro TAKASE, 2017 +# tomo, 2021 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:47+0000\n" -"Last-Translator: Taichi Haradaguchi, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-07 05:06+0000\n" +"PO-Revision-Date: 2017-02-16 17:33+0000\n" +"Last-Translator: tomo, 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/bytes.rst:6 @@ -31,7 +33,7 @@ msgstr "バイトオブジェクト" #: ../../c-api/bytes.rst:8 msgid "" "These functions raise :exc:`TypeError` when expecting a bytes parameter and " -"called with a non-bytes parameter." +"are called with a non-bytes parameter." msgstr "" "下記の関数は、バイトオブジェクトを期待している引数にバイトオブジェクトでない" "パラメタを指定して呼び出されると、 :exc:`TypeError` を送出します。" @@ -100,148 +102,148 @@ msgstr "" "ず、 *format* 文字列中のフォーマット文字と厳密に関連付けられていなければなり" "ません。下記のフォーマット文字が使用できます:" -#: ../../c-api/bytes.rst:65 +#: ../../c-api/bytes.rst:68 msgid "Format Characters" msgstr "書式指定文字" -#: ../../c-api/bytes.rst:65 +#: ../../c-api/bytes.rst:68 msgid "Type" msgstr "型" -#: ../../c-api/bytes.rst:65 +#: ../../c-api/bytes.rst:68 msgid "Comment" msgstr "備考" -#: ../../c-api/bytes.rst:67 -msgid "``%%``" -msgstr "``%%``" +#: ../../c-api/bytes.rst:70 +msgid ":attr:`%%`" +msgstr ":attr:`%%`" -#: ../../c-api/bytes.rst:67 +#: ../../c-api/bytes.rst:70 msgid "*n/a*" msgstr "*n/a*" -#: ../../c-api/bytes.rst:67 +#: ../../c-api/bytes.rst:70 msgid "The literal % character." msgstr "リテラルの % 文字" -#: ../../c-api/bytes.rst:69 -msgid "``%c``" -msgstr "``%c``" +#: ../../c-api/bytes.rst:72 +msgid ":attr:`%c`" +msgstr ":attr:`%c`" -#: ../../c-api/bytes.rst:69 ../../c-api/bytes.rst:72 ../../c-api/bytes.rst:90 -#: ../../c-api/bytes.rst:93 +#: ../../c-api/bytes.rst:72 ../../c-api/bytes.rst:75 ../../c-api/bytes.rst:93 +#: ../../c-api/bytes.rst:96 msgid "int" msgstr "int" -#: ../../c-api/bytes.rst:69 +#: ../../c-api/bytes.rst:72 msgid "A single byte, represented as a C int." msgstr "C の整数型で表現される単一のバイト。" -#: ../../c-api/bytes.rst:72 -msgid "``%d``" -msgstr "``%d``" +#: ../../c-api/bytes.rst:75 +msgid ":attr:`%d`" +msgstr ":attr:`%d`" -#: ../../c-api/bytes.rst:72 +#: ../../c-api/bytes.rst:75 msgid "Equivalent to ``printf(\"%d\")``. [1]_" msgstr "``printf(\"%d\")`` と同等。 [1]_" -#: ../../c-api/bytes.rst:75 -msgid "``%u``" -msgstr "``%u``" +#: ../../c-api/bytes.rst:78 +msgid ":attr:`%u`" +msgstr ":attr:`%u`" -#: ../../c-api/bytes.rst:75 +#: ../../c-api/bytes.rst:78 msgid "unsigned int" msgstr "unsigned int" -#: ../../c-api/bytes.rst:75 +#: ../../c-api/bytes.rst:78 msgid "Equivalent to ``printf(\"%u\")``. [1]_" msgstr "``printf(\"%u\")`` と同等。 [1]_" -#: ../../c-api/bytes.rst:78 -msgid "``%ld``" -msgstr "``%ld``" +#: ../../c-api/bytes.rst:81 +msgid ":attr:`%ld`" +msgstr ":attr:`%ld`" -#: ../../c-api/bytes.rst:78 +#: ../../c-api/bytes.rst:81 msgid "long" msgstr "long" -#: ../../c-api/bytes.rst:78 +#: ../../c-api/bytes.rst:81 msgid "Equivalent to ``printf(\"%ld\")``. [1]_" msgstr "``printf(\"%ld\")`` と同等。 [1]_" -#: ../../c-api/bytes.rst:81 -msgid "``%lu``" -msgstr "``%lu``" +#: ../../c-api/bytes.rst:84 +msgid ":attr:`%lu`" +msgstr ":attr:`%lu`" -#: ../../c-api/bytes.rst:81 +#: ../../c-api/bytes.rst:84 msgid "unsigned long" msgstr "unsigned long" -#: ../../c-api/bytes.rst:81 +#: ../../c-api/bytes.rst:84 msgid "Equivalent to ``printf(\"%lu\")``. [1]_" msgstr "``printf(\"%lu\")`` と同等。 [1]_" -#: ../../c-api/bytes.rst:84 -msgid "``%zd``" -msgstr "``%zd``" +#: ../../c-api/bytes.rst:87 +msgid ":attr:`%zd`" +msgstr ":attr:`%zd`" -#: ../../c-api/bytes.rst:84 -msgid ":c:type:`\\ Py_ssize_t`" -msgstr ":c:type:`\\ Py_ssize_t`" +#: ../../c-api/bytes.rst:87 +msgid "Py_ssize_t" +msgstr "Py_ssize_t" -#: ../../c-api/bytes.rst:84 +#: ../../c-api/bytes.rst:87 msgid "Equivalent to ``printf(\"%zd\")``. [1]_" msgstr "``printf(\"%zd\")`` と同等。 [1]_" -#: ../../c-api/bytes.rst:87 -msgid "``%zu``" -msgstr "``%zu``" +#: ../../c-api/bytes.rst:90 +msgid ":attr:`%zu`" +msgstr ":attr:`%zu`" -#: ../../c-api/bytes.rst:87 +#: ../../c-api/bytes.rst:90 msgid "size_t" msgstr "size_t" -#: ../../c-api/bytes.rst:87 +#: ../../c-api/bytes.rst:90 msgid "Equivalent to ``printf(\"%zu\")``. [1]_" msgstr "``printf(\"%zu\")`` と同等。 [1]_" -#: ../../c-api/bytes.rst:90 -msgid "``%i``" -msgstr "``%i``" +#: ../../c-api/bytes.rst:93 +msgid ":attr:`%i`" +msgstr ":attr:`%i`" -#: ../../c-api/bytes.rst:90 +#: ../../c-api/bytes.rst:93 msgid "Equivalent to ``printf(\"%i\")``. [1]_" msgstr "``printf(\"%i\")`` と同等。 [1]_" -#: ../../c-api/bytes.rst:93 -msgid "``%x``" -msgstr "``%x``" +#: ../../c-api/bytes.rst:96 +msgid ":attr:`%x`" +msgstr ":attr:`%x`" -#: ../../c-api/bytes.rst:93 +#: ../../c-api/bytes.rst:96 msgid "Equivalent to ``printf(\"%x\")``. [1]_" msgstr "``printf(\"%x\")`` と同等。 [1]_" -#: ../../c-api/bytes.rst:96 -msgid "``%s``" -msgstr "``%s``" +#: ../../c-api/bytes.rst:99 +msgid ":attr:`%s`" +msgstr ":attr:`%s`" -#: ../../c-api/bytes.rst:96 +#: ../../c-api/bytes.rst:99 msgid "const char\\*" msgstr "const char\\*" -#: ../../c-api/bytes.rst:96 +#: ../../c-api/bytes.rst:99 msgid "A null-terminated C character array." msgstr "null で終端された C の文字列。" -#: ../../c-api/bytes.rst:99 -msgid "``%p``" -msgstr "``%p``" +#: ../../c-api/bytes.rst:102 +msgid ":attr:`%p`" +msgstr ":attr:`%p`" -#: ../../c-api/bytes.rst:99 +#: ../../c-api/bytes.rst:102 msgid "const void\\*" msgstr "const void\\*" -#: ../../c-api/bytes.rst:99 +#: ../../c-api/bytes.rst:102 msgid "" "The hex representation of a C pointer. Mostly equivalent to " "``printf(\"%p\")`` except that it is guaranteed to start with the literal " @@ -251,7 +253,7 @@ msgstr "" "フォームにおける ``printf`` の定義に関わりなく先頭にリテラル ``0x`` が付きま" "す。" -#: ../../c-api/bytes.rst:108 +#: ../../c-api/bytes.rst:111 msgid "" "An unrecognized format character causes all the rest of the format string to " "be copied as-is to the result object, and any extra arguments discarded." @@ -259,7 +261,7 @@ msgstr "" "識別できない書式指定文字があった場合、残りの書式文字列はそのまま結果のオブ" "ジェクトにコピーされ、残りの引数は無視されます。" -#: ../../c-api/bytes.rst:111 +#: ../../c-api/bytes.rst:114 msgid "" "For integer specifiers (d, u, ld, lu, zd, zu, i, x): the 0-conversion flag " "has effect even when a precision is given." @@ -267,7 +269,7 @@ msgstr "" "整数指定子 (d, u, ld, lu, zd, zu, i, x): 精度が与えられていても、0指定子は有" "効です。" -#: ../../c-api/bytes.rst:117 +#: ../../c-api/bytes.rst:120 msgid "" "Identical to :c:func:`PyBytes_FromFormat` except that it takes exactly two " "arguments." @@ -275,21 +277,23 @@ msgstr "" "ちょうど2つの引数を取ることを除いて、 :c:func:`PyBytes_FromFormat` と同じで" "す。" -#: ../../c-api/bytes.rst:123 +#: ../../c-api/bytes.rst:126 msgid "" "Return the bytes representation of object *o* that implements the buffer " "protocol." msgstr "バッファプロトコルを実装するオブジェクト *o* のバイト表現を返します。" -#: ../../c-api/bytes.rst:129 +#: ../../c-api/bytes.rst:132 msgid "Return the length of the bytes in bytes object *o*." msgstr "バイトオブジェクト *o* のバイト単位の長さを返します。" -#: ../../c-api/bytes.rst:134 -msgid "Similar to :c:func:`PyBytes_Size`, but without error checking." -msgstr ":c:func:`PyBytes_Size` に似ていますが、エラーチェックを行いません。" +#: ../../c-api/bytes.rst:137 +msgid "Macro form of :c:func:`PyBytes_Size` but without error checking." +msgstr "" +":c:func:`PyBytes_Size` をマクロで実装したもので、エラーチェックをを行いませ" +"ん。" -#: ../../c-api/bytes.rst:139 +#: ../../c-api/bytes.rst:142 msgid "" "Return a pointer to the contents of *o*. The pointer refers to the internal " "buffer of *o*, which consists of ``len(o) + 1`` bytes. The last byte in the " @@ -309,18 +313,21 @@ msgstr "" "もし、 *o* が bytes オブジェクトでなければ、 :c:func:`PyBytes_AsString` は " "``NULL`` を返し :exc:`TypeError` を送出します。" -#: ../../c-api/bytes.rst:151 -msgid "Similar to :c:func:`PyBytes_AsString`, but without error checking." +#: ../../c-api/bytes.rst:154 +msgid "Macro form of :c:func:`PyBytes_AsString` but without error checking." msgstr "" -":c:func:`PyBytes_AsString` に似ていますが、エラーチェックを行いません。" +":c:func:`PyBytes_AsString` をマクロで実装したもので、エラーチェックを行いませ" +"ん。" -#: ../../c-api/bytes.rst:156 +#: ../../c-api/bytes.rst:159 msgid "" "Return the null-terminated contents of the object *obj* through the output " -"variables *buffer* and *length*. Returns ``0`` on success." +"variables *buffer* and *length*." msgstr "" +"*obj* のnull 終端された中身を、出力用の変数 *buffer* と *length* を介して返し" +"ます。" -#: ../../c-api/bytes.rst:160 +#: ../../c-api/bytes.rst:162 msgid "" "If *length* is ``NULL``, the bytes object may not contain embedded null " "bytes; if it does, the function returns ``-1`` and a :exc:`ValueError` is " @@ -330,7 +337,7 @@ msgstr "" "可能性があります。その場合、関数は ``-1`` を返し、 :exc:`ValueError` を送出し" "ます。" -#: ../../c-api/bytes.rst:164 +#: ../../c-api/bytes.rst:166 msgid "" "The buffer refers to an internal buffer of *obj*, which includes an " "additional null byte at the end (not counted in *length*). The data must " @@ -347,7 +354,7 @@ msgstr "" "*obj* が bytes オブジェクトでなかった場合は、 :c:func:" "`PyBytes_AsStringAndSize` は ``-1`` を返し :exc:`TypeError` を送出します。" -#: ../../c-api/bytes.rst:171 +#: ../../c-api/bytes.rst:173 msgid "" "Previously, :exc:`TypeError` was raised when embedded null bytes were " "encountered in the bytes object." @@ -355,7 +362,7 @@ msgstr "" "以前は bytes オブジェクトにヌルバイトが埋め込まれていたときに :exc:" "`TypeError` を送出していました。" -#: ../../c-api/bytes.rst:178 +#: ../../c-api/bytes.rst:180 msgid "" "Create a new bytes object in *\\*bytes* containing the contents of *newpart* " "appended to *bytes*; the caller will own the new reference. The reference " @@ -369,52 +376,41 @@ msgstr "" "もし新しいオブジェクトが生成できない場合、古い *bytes* の参照は放棄され、 " "*\\*bytes* の値は ``NULL`` に設定されます; 適切な例外が設定されます。" -#: ../../c-api/bytes.rst:187 +#: ../../c-api/bytes.rst:189 msgid "" "Create a new bytes object in *\\*bytes* containing the contents of *newpart* " -"appended to *bytes*. This version releases the :term:`strong reference` to " -"*newpart* (i.e. decrements its reference count)." -msgstr "" - -#: ../../c-api/bytes.rst:194 -msgid "Similar to ``sep.join(iterable)`` in Python." +"appended to *bytes*. This version decrements the reference count of " +"*newpart*." msgstr "" +"*newpart* の内容を *bytes* の後ろに連結した新しいバイトオブジェクトを " +"*\\*bytes* に生成します; この関数は、 *newpart* の参照カウントをデクリメント" +"します。" #: ../../c-api/bytes.rst:196 msgid "" -"*sep* must be Python :class:`bytes` object. (Note that :c:func:" -"`PyUnicode_Join` accepts ``NULL`` separator and treats it as a space, " -"whereas :c:func:`PyBytes_Join` doesn't accept ``NULL`` separator.)" -msgstr "" - -#: ../../c-api/bytes.rst:201 -msgid "" -"*iterable* must be an iterable object yielding objects that implement the :" -"ref:`buffer protocol `." +"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." msgstr "" - -#: ../../c-api/bytes.rst:204 -msgid "" -"On success, return a new :class:`bytes` object. On error, set an exception " -"and return ``NULL``." -msgstr "" - -#: ../../c-api/bytes.rst:212 -msgid "" -"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 -msgid "object" -msgstr "object" - -#: ../../c-api/bytes.rst:11 -msgid "bytes" -msgstr "bytes" +"本来 \"変更不可能 (immutable)\" なバイトオブジェクトをリサイズする方法で" +"す。\n" +"作成されたばかりのバイトオブジェクトにのみこれをしようしてください; 他のコー" +"ドですでに使用されている可能性のあるバイトオブジェクトに使用してはいけませ" +"ん。\n" +"入力されたバイトオブジェクトの参照カウントが 1 でない場合、この関数はエラーに" +"なります。\n" +"左辺値として存在する (つまり書き込み可能な) バイトオブジェクトのアドレスを受" +"け取り、新しいサイズを要求します。\n" +"成功時には、*\\*bytes* はリサイズされたバイトオブジェクトを保持し、``0`` が返" +"されます; *\\*bytes* のアドレスは入力された際のアドレスと異なるかもしれませ" +"ん。\n" +"再割り当て (reallocation) が失敗した場合、 *\\*bytes* が元々指してしたバイト" +"オブジェクトを解放し、*\\*bytes* を ``NULL`` に設定し、 :exc:`MemoryError` を" +"設定し、そして ``-1`` が返されます。" diff --git a/c-api/call.po b/c-api/call.po index 2c969340e..9e405efef 100644 --- a/c-api/call.po +++ b/c-api/call.po @@ -1,35 +1,31 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Takanori Suzuki , 2024 -# Nozomu Kaneko , 2024 -# Rafael Fontenelle , 2024 -# Arihiro TAKASE, 2024 -# tomo, 2024 -# Taichi Haradaguchi, 2024 +# Nozomu Kaneko , 2020 +# tomo, 2020 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-13 14:21+0000\n" -"PO-Revision-Date: 2021-06-28 00:47+0000\n" -"Last-Translator: Taichi Haradaguchi, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2020-05-31 09:28+0000\n" +"Last-Translator: tomo, 2020\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/call.rst:6 msgid "Call Protocol" -msgstr "Call プロトコル" +msgstr "Call Protocol" #: ../../c-api/call.rst:8 msgid "" @@ -46,11 +42,6 @@ msgid "" "callable. The signature of the slot is::" msgstr "" -#: ../../c-api/call.rst:17 -msgid "" -"PyObject *tp_call(PyObject *callable, PyObject *args, PyObject *kwargs);" -msgstr "" - #: ../../c-api/call.rst:19 msgid "" "A call is made using a tuple for the positional arguments and a dict for the " @@ -67,8 +58,8 @@ msgstr "" #: ../../c-api/call.rst:29 msgid "" -"To call an object, use :c:func:`PyObject_Call` or another :ref:`call API " -"`." +"To call an object, use :c:func:`PyObject_Call` or other :ref:`call API `." msgstr "" #: ../../c-api/call.rst:36 @@ -99,17 +90,7 @@ msgid "" "`~PyTypeObject.tp_call` with the same semantics." msgstr "" -#: ../../c-api/call.rst:62 -msgid "" -"The :c:macro:`Py_TPFLAGS_HAVE_VECTORCALL` flag is now removed from a class " -"when the class's :py:meth:`~object.__call__` method is reassigned. (This " -"internally sets :c:member:`~PyTypeObject.tp_call` only, and thus may make it " -"behave differently than the vectorcall function.) In earlier Python " -"versions, vectorcall should only be used with :c:macro:`immutable " -"` or static types." -msgstr "" - -#: ../../c-api/call.rst:69 +#: ../../c-api/call.rst:60 msgid "" "A class should not implement vectorcall if that would be slower than " "*tp_call*. For example, if the callee needs to convert the arguments to an " @@ -117,52 +98,52 @@ msgid "" "vectorcall." msgstr "" -#: ../../c-api/call.rst:74 +#: ../../c-api/call.rst:65 msgid "" -"Classes can implement the vectorcall protocol by enabling the :c:macro:" +"Classes can implement the vectorcall protocol by enabling the :const:" "`Py_TPFLAGS_HAVE_VECTORCALL` flag and setting :c:member:`~PyTypeObject." "tp_vectorcall_offset` to the offset inside the object structure where a " "*vectorcallfunc* appears. This is a pointer to a function with the following " "signature:" msgstr "" -#: ../../c-api/call.rst:82 +#: ../../c-api/call.rst:73 msgid "*callable* is the object being called." msgstr "" -#: ../../c-api/call.rst:83 +#: ../../c-api/call.rst:75 msgid "" "*args* is a C array consisting of the positional arguments followed by the" msgstr "" -#: ../../c-api/call.rst:84 +#: ../../c-api/call.rst:75 msgid "" "values of the keyword arguments. This can be *NULL* if there are no " "arguments." msgstr "" -#: ../../c-api/call.rst:86 +#: ../../c-api/call.rst:79 msgid "*nargsf* is the number of positional arguments plus possibly the" msgstr "" -#: ../../c-api/call.rst:87 +#: ../../c-api/call.rst:78 msgid "" -":c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET` flag. To get the actual number of " +":const:`PY_VECTORCALL_ARGUMENTS_OFFSET` flag. To get the actual number of " "positional arguments from *nargsf*, use :c:func:`PyVectorcall_NARGS`." msgstr "" -#: ../../c-api/call.rst:90 +#: ../../c-api/call.rst:85 msgid "*kwnames* is a tuple containing the names of the keyword arguments;" msgstr "" -#: ../../c-api/call.rst:91 +#: ../../c-api/call.rst:82 msgid "" "in other words, the keys of the kwargs dict. These names must be strings " "(instances of ``str`` or a subclass) and they must be unique. If there are " "no keyword arguments, then *kwnames* can instead be *NULL*." msgstr "" -#: ../../c-api/call.rst:98 +#: ../../c-api/call.rst:89 msgid "" "If this flag is set in a vectorcall *nargsf* argument, the callee is allowed " "to temporarily change ``args[-1]``. In other words, *args* points to " @@ -170,66 +151,80 @@ msgid "" "value of ``args[-1]`` before returning." msgstr "" -#: ../../c-api/call.rst:103 +#: ../../c-api/call.rst:94 msgid "" "For :c:func:`PyObject_VectorcallMethod`, this flag means instead that " "``args[0]`` may be changed." msgstr "" -#: ../../c-api/call.rst:106 +#: ../../c-api/call.rst:97 msgid "" "Whenever they can do so cheaply (without additional allocation), callers are " -"encouraged to use :c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET`. Doing so will " +"encouraged to use :const:`PY_VECTORCALL_ARGUMENTS_OFFSET`. Doing so will " "allow callables such as bound methods to make their onward calls (which " "include a prepended *self* argument) very efficiently." msgstr "" -#: ../../c-api/call.rst:113 +#: ../../c-api/call.rst:102 msgid "" "To call an object that implements vectorcall, use a :ref:`call API ` function as with any other callable. :c:func:`PyObject_Vectorcall` " "will usually be most efficient." msgstr "" -#: ../../c-api/call.rst:119 +#: ../../c-api/call.rst:109 +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 "" + +#: ../../c-api/call.rst:121 msgid "Recursion Control" msgstr "再帰の管理" -#: ../../c-api/call.rst:121 +#: ../../c-api/call.rst:123 msgid "" "When using *tp_call*, callees do not need to worry about :ref:`recursion " "`: CPython uses :c:func:`Py_EnterRecursiveCall` and :c:func:" "`Py_LeaveRecursiveCall` for calls made using *tp_call*." msgstr "" -#: ../../c-api/call.rst:126 +#: ../../c-api/call.rst:128 msgid "" "For efficiency, this is not the case for calls done using vectorcall: the " "callee should use *Py_EnterRecursiveCall* and *Py_LeaveRecursiveCall* if " "needed." msgstr "" -#: ../../c-api/call.rst:132 +#: ../../c-api/call.rst:134 msgid "Vectorcall Support API" msgstr "" -#: ../../c-api/call.rst:136 +#: ../../c-api/call.rst:138 msgid "" "Given a vectorcall *nargsf* argument, return the actual number of arguments. " "Currently equivalent to::" msgstr "" -#: ../../c-api/call.rst:140 -msgid "(Py_ssize_t)(nargsf & ~PY_VECTORCALL_ARGUMENTS_OFFSET)" -msgstr "" - -#: ../../c-api/call.rst:142 +#: ../../c-api/call.rst:144 msgid "" "However, the function ``PyVectorcall_NARGS`` should be used to allow for " "future extensions." msgstr "" -#: ../../c-api/call.rst:149 +#: ../../c-api/call.rst:147 ../../c-api/call.rst:161 ../../c-api/call.rst:175 +#: ../../c-api/call.rst:259 ../../c-api/call.rst:346 ../../c-api/call.rst:360 +#: ../../c-api/call.rst:375 ../../c-api/call.rst:391 ../../c-api/call.rst:413 +msgid "This function is not part of the :ref:`limited API `." +msgstr "" + +#: ../../c-api/call.rst:153 msgid "" "If *op* does not support the vectorcall protocol (either because the type " "does not or because the specific instance does not), return *NULL*. " @@ -237,165 +232,165 @@ msgid "" "function never raises an exception." msgstr "" -#: ../../c-api/call.rst:154 +#: ../../c-api/call.rst:158 msgid "" "This is mostly useful to check whether or not *op* supports vectorcall, " "which can be done by checking ``PyVectorcall_Function(op) != NULL``." msgstr "" -#: ../../c-api/call.rst:161 +#: ../../c-api/call.rst:167 msgid "" "Call *callable*'s :c:type:`vectorcallfunc` with positional and keyword " "arguments given in a tuple and dict, respectively." msgstr "" -#: ../../c-api/call.rst:164 +#: ../../c-api/call.rst:170 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``. " -"It does not check the :c:macro:`Py_TPFLAGS_HAVE_VECTORCALL` flag and it does " +"It does not check the :const:`Py_TPFLAGS_HAVE_VECTORCALL` flag and it does " "not fall back to ``tp_call``." msgstr "" -#: ../../c-api/call.rst:175 +#: ../../c-api/call.rst:183 msgid "Object Calling API" msgstr "" -#: ../../c-api/call.rst:177 +#: ../../c-api/call.rst:185 msgid "" "Various functions are available for calling a Python object. Each converts " "its arguments to a convention supported by the called object – either " -"*tp_call* or vectorcall. In order to do as little conversion as possible, " +"*tp_call* or vectorcall. In order to do as litle conversion as possible, " "pick one that best fits the format of data you have available." msgstr "" -#: ../../c-api/call.rst:183 +#: ../../c-api/call.rst:191 msgid "" "The following table summarizes the available functions; please see " "individual documentation for details." msgstr "" -#: ../../c-api/call.rst:187 +#: ../../c-api/call.rst:195 msgid "Function" msgstr "関数" -#: ../../c-api/call.rst:187 +#: ../../c-api/call.rst:195 msgid "callable" msgstr "callable" -#: ../../c-api/call.rst:187 +#: ../../c-api/call.rst:195 msgid "args" msgstr "``args``" -#: ../../c-api/call.rst:187 +#: ../../c-api/call.rst:195 msgid "kwargs" msgstr "``kwargs``" -#: ../../c-api/call.rst:189 +#: ../../c-api/call.rst:197 msgid ":c:func:`PyObject_Call`" msgstr ":c:func:`PyObject_Call`" -#: ../../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 +#: ../../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:209 +#: ../../c-api/call.rst:217 ../../c-api/call.rst:219 msgid "``PyObject *``" msgstr "``PyObject *``" -#: ../../c-api/call.rst:189 +#: ../../c-api/call.rst:197 msgid "tuple" msgstr "tuple" -#: ../../c-api/call.rst:189 ../../c-api/call.rst:211 +#: ../../c-api/call.rst:197 ../../c-api/call.rst:219 msgid "dict/``NULL``" msgstr "" -#: ../../c-api/call.rst:191 +#: ../../c-api/call.rst:199 msgid ":c:func:`PyObject_CallNoArgs`" msgstr ":c:func:`PyObject_CallNoArgs`" -#: ../../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 +#: ../../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 ../../c-api/call.rst:209 +#: ../../c-api/call.rst:211 ../../c-api/call.rst:213 ../../c-api/call.rst:215 msgid "---" msgstr "---" -#: ../../c-api/call.rst:193 +#: ../../c-api/call.rst:201 msgid ":c:func:`PyObject_CallOneArg`" msgstr ":c:func:`PyObject_CallOneArg`" -#: ../../c-api/call.rst:193 ../../c-api/call.rst:207 +#: ../../c-api/call.rst:201 ../../c-api/call.rst:215 msgid "1 object" msgstr "" -#: ../../c-api/call.rst:195 +#: ../../c-api/call.rst:203 msgid ":c:func:`PyObject_CallObject`" msgstr ":c:func:`PyObject_CallObject`" -#: ../../c-api/call.rst:195 +#: ../../c-api/call.rst:203 msgid "tuple/``NULL``" msgstr "" -#: ../../c-api/call.rst:197 +#: ../../c-api/call.rst:205 msgid ":c:func:`PyObject_CallFunction`" msgstr ":c:func:`PyObject_CallFunction`" -#: ../../c-api/call.rst:197 ../../c-api/call.rst:199 +#: ../../c-api/call.rst:205 ../../c-api/call.rst:207 msgid "format" msgstr "format" -#: ../../c-api/call.rst:199 +#: ../../c-api/call.rst:207 msgid ":c:func:`PyObject_CallMethod`" msgstr ":c:func:`PyObject_CallMethod`" -#: ../../c-api/call.rst:199 +#: ../../c-api/call.rst:207 msgid "obj + ``char*``" msgstr "" -#: ../../c-api/call.rst:201 +#: ../../c-api/call.rst:209 msgid ":c:func:`PyObject_CallFunctionObjArgs`" msgstr ":c:func:`PyObject_CallFunctionObjArgs`" -#: ../../c-api/call.rst:201 ../../c-api/call.rst:203 +#: ../../c-api/call.rst:209 ../../c-api/call.rst:211 msgid "variadic" msgstr "" -#: ../../c-api/call.rst:203 +#: ../../c-api/call.rst:211 msgid ":c:func:`PyObject_CallMethodObjArgs`" msgstr ":c:func:`PyObject_CallMethodObjArgs`" -#: ../../c-api/call.rst:203 ../../c-api/call.rst:205 ../../c-api/call.rst:207 +#: ../../c-api/call.rst:211 ../../c-api/call.rst:213 ../../c-api/call.rst:215 msgid "obj + name" msgstr "" -#: ../../c-api/call.rst:205 +#: ../../c-api/call.rst:213 msgid ":c:func:`PyObject_CallMethodNoArgs`" msgstr ":c:func:`PyObject_CallMethodNoArgs`" -#: ../../c-api/call.rst:207 +#: ../../c-api/call.rst:215 msgid ":c:func:`PyObject_CallMethodOneArg`" msgstr ":c:func:`PyObject_CallMethodOneArg`" -#: ../../c-api/call.rst:209 +#: ../../c-api/call.rst:217 msgid ":c:func:`PyObject_Vectorcall`" msgstr ":c:func:`PyObject_Vectorcall`" -#: ../../c-api/call.rst:209 ../../c-api/call.rst:211 ../../c-api/call.rst:213 +#: ../../c-api/call.rst:217 ../../c-api/call.rst:219 ../../c-api/call.rst:221 msgid "vectorcall" msgstr "" -#: ../../c-api/call.rst:211 +#: ../../c-api/call.rst:219 msgid ":c:func:`PyObject_VectorcallDict`" msgstr ":c:func:`PyObject_VectorcallDict`" -#: ../../c-api/call.rst:213 +#: ../../c-api/call.rst:221 msgid ":c:func:`PyObject_VectorcallMethod`" msgstr ":c:func:`PyObject_VectorcallMethod`" -#: ../../c-api/call.rst:213 +#: ../../c-api/call.rst:221 msgid "arg + name" msgstr "" -#: ../../c-api/call.rst:219 +#: ../../c-api/call.rst:227 msgid "" "Call a callable Python object *callable*, with arguments given by the tuple " "*args*, and named arguments given by the dictionary *kwargs*." @@ -403,7 +398,7 @@ msgstr "" "呼び出し可能な Python のオブジェクト *callable* を、タプル *args* として与え" "られる引数と辞書 *kwargs* として与えられる名前付き引数とともに呼び出します。" -#: ../../c-api/call.rst:222 +#: ../../c-api/call.rst:230 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*." @@ -412,35 +407,35 @@ msgstr "" "ください。\n" "*kwargs* は *NULL* でも構いません。" -#: ../../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 +#: ../../c-api/call.rst:233 ../../c-api/call.rst:245 ../../c-api/call.rst:256 +#: ../../c-api/call.rst:269 ../../c-api/call.rst:281 ../../c-api/call.rst:301 +#: ../../c-api/call.rst:320 ../../c-api/call.rst:334 ../../c-api/call.rst:343 +#: ../../c-api/call.rst:357 ../../c-api/call.rst:372 ../../c-api/call.rst:410 msgid "" "Return the result of the call on success, or raise an exception and return " "*NULL* on failure." msgstr "" "成功したら呼び出しの結果を返し、失敗したら例外を送出し *NULL* を返します。" -#: ../../c-api/call.rst:228 +#: ../../c-api/call.rst:236 msgid "" "This is the equivalent of the Python expression: ``callable(*args, " "**kwargs)``." msgstr "これは次の Python の式と同等です: ``callable(*args, **kwargs)`` 。" -#: ../../c-api/call.rst:234 +#: ../../c-api/call.rst:242 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." msgstr "" -#: ../../c-api/call.rst:245 +#: ../../c-api/call.rst:253 msgid "" "Call a callable Python object *callable* with exactly 1 positional argument " "*arg* and no keyword arguments." msgstr "" -#: ../../c-api/call.rst:256 +#: ../../c-api/call.rst:266 msgid "" "Call a callable Python object *callable*, with arguments given by the tuple " "*args*. If no arguments are needed, then *args* can be *NULL*." @@ -449,11 +444,11 @@ msgstr "" "られる引数とともに呼び出します。\n" "引数が必要な場合は、 *args* は *NULL* で構いません。" -#: ../../c-api/call.rst:262 ../../c-api/call.rst:274 +#: ../../c-api/call.rst:272 ../../c-api/call.rst:284 msgid "This is the equivalent of the Python expression: ``callable(*args)``." msgstr "これは次の Python の式と同等です: ``callable(*args)`` 。" -#: ../../c-api/call.rst:267 +#: ../../c-api/call.rst:277 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` " @@ -464,22 +459,19 @@ msgstr "" "出します。\n" "C 引数は :c:func:`Py_BuildValue` 形式のフォーマット文字列を使って記述しま" "す。\n" -"*format* は *NULL* かもしれず、与える引数がないことを表します。" +" *format* は *NULL* かもしれず、与える引数がないことを表します。" -#: ../../c-api/call.rst:276 +#: ../../c-api/call.rst:286 msgid "" -"Note that if you only pass :c:expr:`PyObject *` args, :c:func:" +"Note that if you only pass :c:type:`PyObject *` args, :c:func:" "`PyObject_CallFunctionObjArgs` is a faster alternative." msgstr "" -":c:expr:`PyObject *` args だけを引数に渡す場合は、 :c:func:" -"`PyObject_CallFunctionObjArgs` がより速い方法であることを覚えておいてくださ" -"い。 " -#: ../../c-api/call.rst:279 +#: ../../c-api/call.rst:289 msgid "The type of *format* was changed from ``char *``." msgstr "*format* の型が ``char *`` から変更されました。" -#: ../../c-api/call.rst:285 +#: ../../c-api/call.rst:295 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` " @@ -490,85 +482,75 @@ msgstr "" "C 引数はタプルを生成する :c:func:`Py_BuildValue` 形式のフォーマット文字列で記" "述されています。" -#: ../../c-api/call.rst:289 +#: ../../c-api/call.rst:299 msgid "The format can be *NULL*, indicating that no arguments are provided." msgstr "*format* は *NULL* でもよく、引数が与えられないことを表します。 " -#: ../../c-api/call.rst:294 +#: ../../c-api/call.rst:304 msgid "" "This is the equivalent of the Python expression: ``obj.name(arg1, " "arg2, ...)``." msgstr "これは次の Python の式と同等です: ``obj.name(arg1, arg2, ...)`` 。" -#: ../../c-api/call.rst:297 +#: ../../c-api/call.rst:307 msgid "" -"Note that if you only pass :c:expr:`PyObject *` args, :c:func:" +"Note that if you only pass :c:type:`PyObject *` args, :c:func:" "`PyObject_CallMethodObjArgs` is a faster alternative." msgstr "" -":c:expr:`PyObject *` args だけを引数に渡す場合は、 :c:func:" -"`PyObject_CallMethodObjArgs` がより速い方法であることを覚えておいてくださ" -"い。 " -#: ../../c-api/call.rst:300 +#: ../../c-api/call.rst:310 msgid "The types of *name* and *format* were changed from ``char *``." msgstr "*name* と *format* の型が ``char *`` から変更されました。" -#: ../../c-api/call.rst:306 +#: ../../c-api/call.rst:316 msgid "" -"Call a callable Python object *callable*, with a variable number of :c:expr:" +"Call a callable Python object *callable*, with a variable number of :c:type:" "`PyObject *` arguments. The arguments are provided as a variable number of " "parameters followed by *NULL*." msgstr "" -"呼び出し可能な Python オブジェクト *callable* を可変数個の :c:expr:`PyObject " -"*` 引数とともに呼び出します。引数列は末尾に *NULL* がついた可変数個のパラメタ" -"として与えます。" -#: ../../c-api/call.rst:313 +#: ../../c-api/call.rst:323 msgid "" "This is the equivalent of the Python expression: ``callable(arg1, " "arg2, ...)``." msgstr "これは次の Python の式と同等です: ``callable(arg1, arg2, ...)`` 。" -#: ../../c-api/call.rst:319 +#: ../../c-api/call.rst:329 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 " -"number of :c:expr:`PyObject *` arguments. The arguments are provided as a " +"number of :c:type:`PyObject *` arguments. The arguments are provided as a " "variable number of parameters followed by *NULL*." msgstr "" -"Python オブジェクト *obj* のメソッドを呼び出します、メソッド名は Python 文字" -"列オブジェクト *name* で与えます。可変数個の :c:expr:`PyObject *` 引数と共に" -"呼び出されます. 引数列は末尾に *NULL* がついた可変数個のパラメタとして与えま" -"す。" -#: ../../c-api/call.rst:330 +#: ../../c-api/call.rst:340 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*." msgstr "" -#: ../../c-api/call.rst:341 +#: ../../c-api/call.rst:353 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 " "*name*." msgstr "" -#: ../../c-api/call.rst:353 +#: ../../c-api/call.rst:367 msgid "" "Call a callable Python object *callable*. The arguments are the same as for :" "c:type:`vectorcallfunc`. If *callable* supports vectorcall_, this directly " "calls the vectorcall function stored in *callable*." msgstr "" -#: ../../c-api/call.rst:365 +#: ../../c-api/call.rst:381 msgid "" "Call *callable* with positional arguments passed exactly as in the " "vectorcall_ protocol, but with keyword arguments passed as a dictionary " "*kwdict*. The *args* array contains only the positional arguments." msgstr "" -#: ../../c-api/call.rst:369 +#: ../../c-api/call.rst:385 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 " @@ -576,29 +558,29 @@ msgid "" "tuple for the positional arguments." msgstr "" -#: ../../c-api/call.rst:379 +#: ../../c-api/call.rst:397 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 " "is *args[0]*, and the *args* array starting at *args[1]* represents the " "arguments of the call. There must be at least one positional argument. " -"*nargsf* is the number of positional arguments including *args[0]*, plus :c:" -"macro:`PY_VECTORCALL_ARGUMENTS_OFFSET` if the value of ``args[0]`` may " +"*nargsf* is the number of positional arguments including *args[0]*, plus :" +"const:`PY_VECTORCALL_ARGUMENTS_OFFSET` if the value of ``args[0]`` may " "temporarily be changed. Keyword arguments can be passed just like in :c:func:" "`PyObject_Vectorcall`." msgstr "" -#: ../../c-api/call.rst:388 +#: ../../c-api/call.rst:406 msgid "" -"If the object has the :c:macro:`Py_TPFLAGS_METHOD_DESCRIPTOR` feature, this " +"If the object has the :const:`Py_TPFLAGS_METHOD_DESCRIPTOR` feature, this " "will call the unbound method object with the full *args* vector as arguments." msgstr "" -#: ../../c-api/call.rst:399 +#: ../../c-api/call.rst:419 msgid "Call Support API" msgstr "" -#: ../../c-api/call.rst:403 +#: ../../c-api/call.rst:423 msgid "" "Determine if the object *o* is callable. Return ``1`` if the object is " "callable and ``0`` otherwise. This function always succeeds." diff --git a/c-api/capsule.po b/c-api/capsule.po index 2eef1e14f..fd9f0d7e3 100644 --- a/c-api/capsule.po +++ b/c-api/capsule.po @@ -1,27 +1,27 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# 石井明久, 2024 -# Arihiro TAKASE, 2024 -# tomo, 2024 +# 秘湯 , 2017 +# Arihiro TAKASE, 2017 +# tomo, 2021 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-13 14:21+0000\n" -"PO-Revision-Date: 2021-06-28 00:47+0000\n" -"Last-Translator: tomo, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-07 05:06+0000\n" +"PO-Revision-Date: 2017-02-16 17:33+0000\n" +"Last-Translator: tomo, 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/capsule.rst:6 @@ -38,14 +38,14 @@ msgstr "" #: ../../c-api/capsule.rst:17 msgid "" "This subtype of :c:type:`PyObject` represents an opaque value, useful for C " -"extension modules who need to pass an opaque value (as a :c:expr:`void*` " +"extension modules who need to pass an opaque value (as a :c:type:`void*` " "pointer) through Python code to other C code. It is often used to make a C " "function pointer defined in one module available to other modules, so the " "regular import mechanism can be used to access C APIs defined in dynamically " "loaded modules." msgstr "" "この :c:type:`PyObject` のサブタイプは、任意の値を表し、C拡張モジュールから " -"Pythonコードを経由して他のC言語のコードに任意の値を(:c:expr:`void*` ポインタ" +"Pythonコードを経由して他のC言語のコードに任意の値を(:c:type:`void*` ポインタ" "の形で)渡す必要があるときに有用です。あるモジュール内で定義されているC言語関" "数のポインタを、他のモジュールに渡してそこから呼び出せるようにするためによく" "使われます。これにより、動的にロードされるモジュールの中の C API に通常の " @@ -55,10 +55,6 @@ msgstr "" msgid "The type of a destructor callback for a capsule. Defined as::" msgstr "カプセルに対するデストラクタコールバック型. 次のように定義されます::" -#: ../../c-api/capsule.rst:29 -msgid "typedef void (*PyCapsule_Destructor)(PyObject *);" -msgstr "" - #: ../../c-api/capsule.rst:31 msgid "" "See :c:func:`PyCapsule_New` for the semantics of PyCapsule_Destructor " @@ -126,9 +122,13 @@ msgstr "" msgid "" "The *name* parameter must compare exactly to the name stored in the capsule. " "If the name stored in the capsule is ``NULL``, the *name* passed in must " -"also be ``NULL``. Python uses the C function :c:func:`!strcmp` to compare " +"also be ``NULL``. Python uses the C function :c:func:`strcmp` to compare " "capsule names." msgstr "" +"*name* 引数はカプセルに保存されている名前と正確に一致しなければなりません。も" +"しカプセルに格納されている name が ``NULL`` なら、この関数の *name* 引数も同" +"じく ``NULL`` でなければなりません。 Python は C言語の :c:func:`strcmp` を" +"使ってこの name を比較します。" #: ../../c-api/capsule.rst:73 msgid "" @@ -189,10 +189,19 @@ msgid "" "Import a pointer to a C object from a capsule attribute in a module. The " "*name* parameter should specify the full name to the attribute, as in " "``module.attribute``. The *name* stored in the capsule must match this " -"string exactly." +"string exactly. If *no_block* is true, import the module without blocking " +"(using :c:func:`PyImport_ImportModuleNoBlock`). If *no_block* is false, " +"import the module conventionally (using :c:func:`PyImport_ImportModule`)." msgstr "" - -#: ../../c-api/capsule.rst:108 +"モジュールのカプセル属性から Cオブジェクトへのポインタをインポートします。 " +"*name* 引数はその属性の完全名を ``module.attribute`` のように指定しなければな" +"りません。カプセルに格納されている *name* はこの文字列に正確に一致しなければ" +"なりません。 *no_block* が真の時、モジュールを(:c:func:" +"`PyImport_ImportModuleNoBlock` を使って) ブロックせずにインポートします。 " +"*no_block* が偽の時、モジュールは (:c:func:`PyImport_ImportModule` を使って) " +"通常の方法でインポートされます。" + +#: ../../c-api/capsule.rst:110 msgid "" "Return the capsule's internal *pointer* on success. On failure, set an " "exception and return ``NULL``." @@ -200,11 +209,7 @@ msgstr "" "成功した場合、カプセルの内部 *ポインタ* を返します。失敗した場合、例外を設定" "して ``NULL`` を返します。" -#: ../../c-api/capsule.rst:111 -msgid "*no_block* has no effect anymore." -msgstr "" - -#: ../../c-api/capsule.rst:117 +#: ../../c-api/capsule.rst:116 msgid "" "Determines whether or not *capsule* is a valid capsule. A valid capsule is " "non-``NULL``, passes :c:func:`PyCapsule_CheckExact`, has a non-``NULL`` " @@ -217,14 +222,16 @@ msgstr "" "ポインタを格納していて、内部の name が引数 *name* とマッチします。 (name の比" "較方法については :c:func:`PyCapsule_GetPointer` を参照)" -#: ../../c-api/capsule.rst:123 +#: ../../c-api/capsule.rst:122 msgid "" "In other words, if :c:func:`PyCapsule_IsValid` returns a true value, calls " -"to any of the accessors (any function starting with ``PyCapsule_Get``) are " -"guaranteed to succeed." +"to any of the accessors (any function starting with :c:func:`PyCapsule_Get`) " +"are guaranteed to succeed." msgstr "" +"言い換えると、 :c:func:`PyCapsule_IsValid` が真を返す場合、全てのアクセッサ " +"(:c:func:`PyCapsule_Get` で始まる全ての関数) が成功することが保証されます。" -#: ../../c-api/capsule.rst:127 +#: ../../c-api/capsule.rst:126 msgid "" "Return a nonzero value if the object is valid and matches the name passed " "in. Return ``0`` otherwise. This function will not fail." @@ -232,21 +239,21 @@ msgstr "" "オブジェクトが有効で name がマッチした場合に非 ``0`` を、それ以外の場合に " "``0`` を返します。この関数は絶対に失敗しません。" -#: ../../c-api/capsule.rst:133 +#: ../../c-api/capsule.rst:132 msgid "Set the context pointer inside *capsule* to *context*." msgstr "*capsule* 内部のコンテキストポインタを *context* に設定します。" -#: ../../c-api/capsule.rst:135 ../../c-api/capsule.rst:142 -#: ../../c-api/capsule.rst:151 ../../c-api/capsule.rst:159 +#: ../../c-api/capsule.rst:134 ../../c-api/capsule.rst:141 +#: ../../c-api/capsule.rst:150 ../../c-api/capsule.rst:158 msgid "" "Return ``0`` on success. Return nonzero and set an exception on failure." msgstr "成功したら ``0`` を、失敗したら例外を設定して非 ``0`` を返します。" -#: ../../c-api/capsule.rst:140 +#: ../../c-api/capsule.rst:139 msgid "Set the destructor inside *capsule* to *destructor*." msgstr "*capsule* 内部のデストラクタを *destructor* に設定します。" -#: ../../c-api/capsule.rst:147 +#: ../../c-api/capsule.rst:146 msgid "" "Set the name inside *capsule* to *name*. If non-``NULL``, the name must " "outlive the capsule. If the previous *name* stored in the capsule was not " @@ -256,18 +263,10 @@ msgstr "" "れは *capsule* よりも長い寿命を持つ必要があります。もしすでに *capsule* に非 " "``NULL`` の *name* が保存されていた場合、それに対する解放は行われません。" -#: ../../c-api/capsule.rst:156 +#: ../../c-api/capsule.rst:155 msgid "" "Set the void pointer inside *capsule* to *pointer*. The pointer may not be " "``NULL``." msgstr "" "*capsule* 内部のポインタを *pointer* に設定します。*pointer* は ``NULL`` で" "あってはなりません。" - -#: ../../c-api/capsule.rst:8 -msgid "object" -msgstr "オブジェクト" - -#: ../../c-api/capsule.rst:8 -msgid "Capsule" -msgstr "Capsule" diff --git a/c-api/cell.po b/c-api/cell.po index 3bf17b36b..95cac307b 100644 --- a/c-api/cell.po +++ b/c-api/cell.po @@ -1,26 +1,27 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Tetsuo Koyama , 2024 -# tomo, 2024 +# Arihiro TAKASE, 2017 +# tomo, 2020 +# Tetsuo Koyama , 2021 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-06 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:47+0000\n" -"Last-Translator: tomo, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-07 05:06+0000\n" +"PO-Revision-Date: 2017-02-16 17:33+0000\n" +"Last-Translator: Tetsuo Koyama , 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/cell.rst:6 @@ -73,12 +74,10 @@ msgstr "" "引数を ``NULL`` にしてもかまいません。" #: ../../c-api/cell.rst:42 -msgid "" -"Return the contents of the cell *cell*, which can be ``NULL``. If *cell* is " -"not a cell object, returns ``NULL`` with an exception set." -msgstr "" +msgid "Return the contents of the cell *cell*." +msgstr "*cell* の内容を返します。" -#: ../../c-api/cell.rst:48 +#: ../../c-api/cell.rst:47 msgid "" "Return the contents of the cell *cell*, but without checking that *cell* is " "non-``NULL`` and a cell object." @@ -86,20 +85,21 @@ msgstr "" "*cell* の内容を返しますが、*cell* が非 ``NULL`` かつセルオブジェクトであるか" "どうかはチェックしません。" -#: ../../c-api/cell.rst:54 +#: ../../c-api/cell.rst:53 msgid "" "Set the contents of the cell object *cell* to *value*. This releases the " "reference to any current content of the cell. *value* may be ``NULL``. " -"*cell* must be non-``NULL``." -msgstr "" - -#: ../../c-api/cell.rst:58 -msgid "" -"On success, return ``0``. If *cell* is not a cell object, set an exception " -"and return ``-1``." +"*cell* must be non-``NULL``; if it is not a cell object, ``-1`` will be " +"returned. On success, ``0`` will be returned." msgstr "" +"セルオブジェクト *cell* の内容を *value* に設定します。\n" +"この関数は現在のセルの全ての内容に対する参照を解放します。\n" +"*value* は ``NULL`` でもかまいません。\n" +"*cell* は非 ``NULL`` でなければなりません。*cell* がセルオブジェクトでない場" +"合、``-1`` を返します。\n" +"成功すると ``0`` を返します。" -#: ../../c-api/cell.rst:64 +#: ../../c-api/cell.rst:61 msgid "" "Sets the value of the cell object *cell* to *value*. No reference counts " "are adjusted, and no checks are made for safety; *cell* must be non-``NULL`` " diff --git a/c-api/code.po b/c-api/code.po index 79d579168..81275ad6b 100644 --- a/c-api/code.po +++ b/c-api/code.po @@ -1,28 +1,26 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# 秘湯 , 2024 -# 石井明久, 2024 -# tomo, 2024 -# Taichi Haradaguchi, 2024 +# Arihiro TAKASE, 2017 +# tomo, 2021 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-30 14:22+0000\n" -"PO-Revision-Date: 2021-06-28 00:48+0000\n" -"Last-Translator: Taichi Haradaguchi, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-07 05:06+0000\n" +"PO-Revision-Date: 2017-02-16 17:34+0000\n" +"Last-Translator: tomo, 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/code.rst:8 @@ -48,333 +46,50 @@ msgstr "" #: ../../c-api/code.rst:24 msgid "" -"This is an instance of :c:type:`PyTypeObject` representing the Python :ref:" -"`code object `." +"This is an instance of :c:type:`PyTypeObject` representing the Python :class:" +"`code` type." msgstr "" +"これは Python の :class:`code` 型を表現する :c:type:`PyTypeObject` のインスタ" +"ンスです。" #: ../../c-api/code.rst:30 msgid "" -"Return true if *co* is a :ref:`code object `. This function " -"always succeeds." +"Return true if *co* is a :class:`code` object. This function always " +"succeeds." msgstr "" +"*co* が :class:`code` オブジェクトの場合に真を返します。この関数は常に成功し" +"ます。" -#: ../../c-api/code.rst:35 -msgid "" -"Return the number of :term:`free (closure) variables ` in " -"a code object." -msgstr "" +#: ../../c-api/code.rst:34 +msgid "Return the number of free variables in *co*." +msgstr "*co* 内の自由変数(free variables)の数を返します。" -#: ../../c-api/code.rst:40 +#: ../../c-api/code.rst:38 msgid "" -"Return the position of the first :term:`free (closure) variable ` in a code object." +"Return a new code object. If you need a dummy code object to create a " +"frame, use :c:func:`PyCode_NewEmpty` instead. Calling :c:func:`PyCode_New` " +"directly can bind you to a precise Python version since the definition of " +"the bytecode changes often." msgstr "" +"新しいコードオブジェクトを返します。フレームを作成するためにダミーのコードオ" +"ブジェクトが必要な場合は、代わりに :c:func:`PyCode_NewEmpty` を利用してくださ" +"い。バイトコードは頻繁に変更されるため、 :c:func:`PyCode_New` を直接呼び出す" +"と、 Python の詳細バージョンに依存してしまうことがあります。" #: ../../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." +"Similar to :c:func:`PyCode_New`, but with an extra \"posonlyargcount\" for " +"positional-only arguments." msgstr "" +":c:func:`PyCode_New` に似ていますが、位置専用引数のための " +"\"posonlyargcount\" が追加されています。" #: ../../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: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: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:61 -msgid "Added ``qualname`` and ``exceptiontable`` parameters." -msgstr "" - -#: ../../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: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:79 -msgid "as ``PyCode_NewWithPosOnlyArgs``" -msgstr "" - -#: ../../c-api/code.rst:81 -msgid "Added ``qualname`` and ``exceptiontable`` parameters." -msgstr "" - -#: ../../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: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: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." +"and first line number. It is illegal to :func:`exec` or :func:`eval` the " +"resulting code object." msgstr "" - -#: ../../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: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:110 -msgid "Returns ``1`` if the function succeeds and 0 otherwise." -msgstr "" - -#: ../../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: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: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: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 " -"variables that are referenced by nested functions. On error, ``NULL`` is " -"returned and an exception is raised." -msgstr "" - -#: ../../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 :term:" -"`free (closure) variables `. On error, ``NULL`` is " -"returned and an exception is raised." -msgstr "" - -#: ../../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 " -"of error (e.g. no more watcher IDs available), return ``-1`` and set an " -"exception." -msgstr "" - -#: ../../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 " -"``-1`` and set an exception on error (e.g. if the given *watcher_id* was " -"never registered.)" -msgstr "" - -#: ../../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:182 -msgid "Type of a code object watcher callback function." -msgstr "" - -#: ../../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 " -"the destruction of *co* takes place, so the prior state of *co* can be " -"inspected." -msgstr "" - -#: ../../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 " -"from being freed at this time. When the resurrected object is destroyed " -"later, any watcher callbacks active at that time will be called again." -msgstr "" - -#: ../../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 " -"and timing of creation and destruction of code objects. While changes in " -"these details may result in differences observable by watchers (including " -"whether a callback is invoked or not), it does not change the semantics of " -"the Python code being executed." -msgstr "" - -#: ../../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: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 " -"set. This means the callback may not call any other API that can set an " -"exception unless it saves and clears the exception state first, and restores " -"it before returning." -msgstr "" - -#: ../../c-api/code.rst:215 -msgid "Extra information" -msgstr "" - -#: ../../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: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:227 -msgid "Return a new an opaque index value used to adding data to code objects." -msgstr "" - -#: ../../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: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:239 -msgid "as ``_PyEval_RequestCodeExtraIndex``" -msgstr "" - -#: ../../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: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: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:257 -msgid "as ``_PyCode_GetExtra``" -msgstr "" - -#: ../../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: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:272 -msgid "as ``_PyCode_SetExtra``" -msgstr "" - -#: ../../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." -msgstr "" - -#: ../../c-api/code.rst:3 -msgid "object" -msgstr "オブジェクト" - -#: ../../c-api/code.rst:3 -msgid "code" -msgstr "コード" - -#: ../../c-api/code.rst:3 -msgid "code object" -msgstr "コードオブジェクト" - -#: ../../c-api/code.rst:64 -msgid "PyCode_New (C function)" -msgstr "PyCode_New (C 関数)" - -#: ../../c-api/code.rst:77 -msgid "PyCode_NewWithPosOnlyArgs (C function)" -msgstr "PyCode_NewWithPosOnlyArgs (C 関数)" - -#: ../../c-api/code.rst:237 -msgid "_PyEval_RequestCodeExtraIndex (C function)" -msgstr "_PyEval_RequestCodeExtraIndex (C 関数)" - -#: ../../c-api/code.rst:255 -msgid "_PyCode_GetExtra (C function)" -msgstr "_PyCode_GetExtra (C 関数)" - -#: ../../c-api/code.rst:270 -msgid "_PyCode_SetExtra (C function)" -msgstr "_PyCode_SetExtra (C 関数)" +"新しい空のコードオブジェクトを、指定されたファイル名、関数名、開始行番号で作" +"成します。返されたコードオブジェクトに対しての :func:`exec` や :func:`eval` " +"は許されていません。" diff --git a/c-api/codec.po b/c-api/codec.po index 6ef5a5228..7d22bfd22 100644 --- a/c-api/codec.po +++ b/c-api/codec.po @@ -1,26 +1,26 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# 石井明久, 2024 -# tomo, 2024 +# Arihiro TAKASE, 2017 +# tomo, 2020 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:48+0000\n" -"Last-Translator: tomo, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 17:34+0000\n" +"Last-Translator: tomo, 2020\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/codec.rst:4 @@ -33,21 +33,14 @@ msgstr "新しい codec 検索関数を登録します。" #: ../../c-api/codec.rst:10 msgid "" -"As side effect, this tries to load the :mod:`!encodings` package, if not yet " +"As side effect, this tries to load the :mod:`encodings` package, if not yet " "done, to make sure that it is always first in the list of search functions." msgstr "" -"副作用として、この関数は :mod:`!encodings` パッケージが常に検索関数の先頭に来" +"副作用として、この関数は :mod:`encodings` パッケージが常に検索関数の先頭に来" "るように、まだロードされていない場合はロードします。" #: ../../c-api/codec.rst:15 msgid "" -"Unregister a codec search function and clear the registry's cache. If the " -"search function is not registered, do nothing. Return 0 on success. Raise an " -"exception and return -1 on error." -msgstr "" - -#: ../../c-api/codec.rst:23 -msgid "" "Return ``1`` or ``0`` depending on whether there is a registered codec for " "the given *encoding*. This function always succeeds." msgstr "" @@ -55,11 +48,11 @@ msgstr "" "``0`` を返します。\n" "この関数は常に成功します。" -#: ../../c-api/codec.rst:28 +#: ../../c-api/codec.rst:20 msgid "Generic codec based encoding API." msgstr "汎用の codec ベースの encode API." -#: ../../c-api/codec.rst:30 +#: ../../c-api/codec.rst:22 msgid "" "*object* is passed through the encoder function found for the given " "*encoding* using the error handling method defined by *errors*. *errors* " @@ -72,11 +65,11 @@ msgstr "" "利用されます。\n" "エンコーダが見つからなかった場合は :exc:`LookupError` を発生させます。" -#: ../../c-api/codec.rst:37 +#: ../../c-api/codec.rst:29 msgid "Generic codec based decoding API." msgstr "汎用の codec ベースのデコード API." -#: ../../c-api/codec.rst:39 +#: ../../c-api/codec.rst:31 msgid "" "*object* is passed through the decoder function found for the given " "*encoding* using the error handling method defined by *errors*. *errors* " @@ -89,11 +82,11 @@ msgstr "" "利用されます。\n" "デコーダが見つからなかった場合は :exc:`LookupError` を発生させます。" -#: ../../c-api/codec.rst:46 +#: ../../c-api/codec.rst:38 msgid "Codec lookup API" msgstr "コーデック検索API" -#: ../../c-api/codec.rst:48 +#: ../../c-api/codec.rst:40 msgid "" "In the following functions, the *encoding* string is looked up converted to " "all lower-case characters, which makes encodings looked up through this " @@ -105,29 +98,29 @@ msgstr "" "コーデックが見つからない場合、 :exc:`KeyError` を設定して ``NULL`` を返しま" "す。" -#: ../../c-api/codec.rst:55 +#: ../../c-api/codec.rst:47 msgid "Get an encoder function for the given *encoding*." msgstr "与えられた *encoding* のエンコーダ関数を返します。" -#: ../../c-api/codec.rst:59 +#: ../../c-api/codec.rst:51 msgid "Get a decoder function for the given *encoding*." msgstr "与えられた *encoding* のデコーダ関数を返します。" -#: ../../c-api/codec.rst:63 +#: ../../c-api/codec.rst:55 msgid "" "Get an :class:`~codecs.IncrementalEncoder` object for the given *encoding*." msgstr "" "与えられた *encoding* の :class:`~codecs.IncrementalEncoder` オブジェクトを返" "します。" -#: ../../c-api/codec.rst:67 +#: ../../c-api/codec.rst:59 msgid "" "Get an :class:`~codecs.IncrementalDecoder` object for the given *encoding*." msgstr "" "与えられた *encoding* の :class:`~codecs.IncrementalDecoder` オブジェクトを返" "します。" -#: ../../c-api/codec.rst:71 +#: ../../c-api/codec.rst:63 msgid "" "Get a :class:`~codecs.StreamReader` factory function for the given " "*encoding*." @@ -135,7 +128,7 @@ msgstr "" "与えられた *encoding* の :class:`~codecs.StreamReader` ファクトリ関数を返しま" "す。" -#: ../../c-api/codec.rst:75 +#: ../../c-api/codec.rst:67 msgid "" "Get a :class:`~codecs.StreamWriter` factory function for the given " "*encoding*." @@ -143,11 +136,11 @@ msgstr "" "与えられた *encoding* の :class:`~codecs.StreamWriter` ファクトリ関数を返しま" "す。" -#: ../../c-api/codec.rst:79 +#: ../../c-api/codec.rst:71 msgid "Registry API for Unicode encoding error handlers" msgstr "Unicode エラーハンドラ用レジストリ API" -#: ../../c-api/codec.rst:83 +#: ../../c-api/codec.rst:75 msgid "" "Register the error handling callback function *error* under the given " "*name*. This callback function will be called by a codec when it encounters " @@ -159,7 +152,7 @@ msgstr "" "に遭遇した時に、そのエンコード/デコード関数の呼び出しで *name* が指定されてい" "たら呼び出されます。" -#: ../../c-api/codec.rst:88 +#: ../../c-api/codec.rst:80 msgid "" "The callback gets a single argument, an instance of :exc:" "`UnicodeEncodeError`, :exc:`UnicodeDecodeError` or :exc:" @@ -179,11 +172,11 @@ msgstr "" "を発生させるか、2要素のタプルに問題のシーケンスの代替と、 encode/decode を再" "開する元の文字列中のオフセットとなる整数を格納して返します。" -#: ../../c-api/codec.rst:98 +#: ../../c-api/codec.rst:90 msgid "Return ``0`` on success, ``-1`` on error." msgstr "成功したら ``0`` を、エラー時は ``-1`` を返します。" -#: ../../c-api/codec.rst:102 +#: ../../c-api/codec.rst:94 msgid "" "Lookup the error handling callback function registered under *name*. As a " "special case ``NULL`` can be passed, in which case the error handling " @@ -193,23 +186,23 @@ msgstr "" "特別な場合として、``NULL`` が渡された場合、\"strict\" のエラーハンドリング" "コールバック関数を返します。" -#: ../../c-api/codec.rst:108 +#: ../../c-api/codec.rst:100 msgid "Raise *exc* as an exception." msgstr "*exc* を例外として発生させます。" -#: ../../c-api/codec.rst:112 +#: ../../c-api/codec.rst:104 msgid "Ignore the unicode error, skipping the faulty input." msgstr "unicode エラーを無視し、問題の入力をスキップします。" -#: ../../c-api/codec.rst:116 +#: ../../c-api/codec.rst:108 msgid "Replace the unicode encode error with ``?`` or ``U+FFFD``." msgstr "unicode エラーを ``?`` か ``U+FFFD`` で置き換えます。" -#: ../../c-api/codec.rst:120 +#: ../../c-api/codec.rst:112 msgid "Replace the unicode encode error with XML character references." msgstr "unicode encode エラーを XML文字参照で置き換えます。" -#: ../../c-api/codec.rst:124 +#: ../../c-api/codec.rst:116 msgid "" "Replace the unicode encode error with backslash escapes (``\\x``, ``\\u`` " "and ``\\U``)." @@ -217,6 +210,6 @@ msgstr "" "unicode encode エラーをバックスラッシュエスケープ (``\\x``, ``\\u``, " "``\\U``) で置き換えます。" -#: ../../c-api/codec.rst:129 +#: ../../c-api/codec.rst:121 msgid "Replace the unicode encode error with ``\\N{...}`` escapes." msgstr "unicode encode エラーを ``\\N{...}`` で置き換えます。" diff --git a/c-api/complex.po b/c-api/complex.po index 6a70f122a..bb2bcb022 100644 --- a/c-api/complex.po +++ b/c-api/complex.po @@ -1,32 +1,31 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Arihiro TAKASE, 2023 -# tomo, 2023 -# Taichi Haradaguchi, 2024 +# Arihiro TAKASE, 2017 +# tomo, 2021 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:48+0000\n" -"Last-Translator: Taichi Haradaguchi, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-06-17 06:39+0000\n" +"PO-Revision-Date: 2017-02-16 17:34+0000\n" +"Last-Translator: tomo, 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/complex.rst:6 msgid "Complex Number Objects" -msgstr "複素数オブジェクト" +msgstr "複素数オブジェクト (complex number object)" #: ../../c-api/complex.rst:10 msgid "" @@ -59,87 +58,74 @@ msgid "" "The C structure which corresponds to the value portion of a Python complex " "number object. Most of the functions for dealing with complex number " "objects use structures of this type as input or output values, as " -"appropriate." -msgstr "" - -#: ../../c-api/complex.rst:33 -msgid "The structure is defined as::" -msgstr "" - -#: ../../c-api/complex.rst:35 -msgid "" -"typedef struct {\n" -" double real;\n" -" double imag;\n" -"} Py_complex;" +"appropriate. It is defined as::" msgstr "" +"Python 複素数オブジェクトの値の部分に対応する C の構造体です。複素数オブジェ" +"クトを扱うほとんどの関数は、この型の構造体を場合に応じて入力や出力として使い" +"ます。構造体は以下のように定義されています::" -#: ../../c-api/complex.rst:43 +#: ../../c-api/complex.rst:39 msgid "" "Return the sum of two complex numbers, using the C :c:type:`Py_complex` " "representation." msgstr "二つの複素数の和を C の :c:type:`Py_complex` 型で返します。" -#: ../../c-api/complex.rst:49 +#: ../../c-api/complex.rst:45 msgid "" "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 +#: ../../c-api/complex.rst:51 msgid "" "Return the negation of the complex number *num*, using the C :c:type:" "`Py_complex` representation." msgstr "複素数 *num* の符号反転 C の :c:type:`Py_complex` 型で返します。" -#: ../../c-api/complex.rst:61 +#: ../../c-api/complex.rst:57 msgid "" "Return the product of two complex numbers, using the C :c:type:`Py_complex` " "representation." msgstr "二つの複素数の積を C の :c:type:`Py_complex` 型で返します。" -#: ../../c-api/complex.rst:67 +#: ../../c-api/complex.rst:63 msgid "" "Return the quotient of two complex numbers, using the C :c:type:`Py_complex` " "representation." msgstr "二つの複素数の商を C の :c:type:`Py_complex` 型で返します。" -#: ../../c-api/complex.rst:70 +#: ../../c-api/complex.rst:66 msgid "" "If *divisor* is null, this method returns zero and sets :c:data:`errno` to :" -"c:macro:`!EDOM`." +"c:data:`EDOM`." msgstr "" "*divisor* が null の場合は、このメソッドはゼロを返し、 :c:data:`errno` に :c:" -"macro:`!EDOM` をセットします。" +"data:`EDOM` をセットします。" -#: ../../c-api/complex.rst:76 +#: ../../c-api/complex.rst:72 msgid "" "Return the exponentiation of *num* by *exp*, using the C :c:type:" "`Py_complex` representation." msgstr "指数 *exp* の *num* 乗を C の :c:type:`Py_complex` 型で返します。" -#: ../../c-api/complex.rst:79 +#: ../../c-api/complex.rst:75 msgid "" "If *num* is null and *exp* is not a positive real number, this method " -"returns zero and sets :c:data:`errno` to :c:macro:`!EDOM`." +"returns zero and sets :c:data:`errno` to :c:data:`EDOM`." msgstr "" "*num* が null で *exp* が正の実数でない場合は、このメソッドはゼロを返し、 :c:" -"data:`errno` に :c:macro:`!EDOM` をセットします。" +"data:`errno` に :c:data:`EDOM` をセットします。" -#: ../../c-api/complex.rst:82 -msgid "Set :c:data:`errno` to :c:macro:`!ERANGE` on overflows." -msgstr "" - -#: ../../c-api/complex.rst:86 +#: ../../c-api/complex.rst:80 msgid "Complex Numbers as Python Objects" msgstr "Python オブジェクトとしての複素数型" -#: ../../c-api/complex.rst:91 +#: ../../c-api/complex.rst:85 msgid "" "This subtype of :c:type:`PyObject` represents a Python complex number object." msgstr "この :c:type:`PyObject` のサブタイプは Python の複素数型を表現します。" -#: ../../c-api/complex.rst:96 +#: ../../c-api/complex.rst:90 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." @@ -147,7 +133,7 @@ msgstr "" "この :c:type:`PyTypeObject` のインスタンスは Python の複素数型を表現します。 " "Pythonレイヤの :class:`complex` と同じオブジェクトです。" -#: ../../c-api/complex.rst:102 +#: ../../c-api/complex.rst:96 msgid "" "Return true if its argument is a :c:type:`PyComplexObject` or a subtype of :" "c:type:`PyComplexObject`. This function always succeeds." @@ -155,7 +141,7 @@ msgstr "" "引数が :c:type:`PyComplexObject` か :c:type:`PyComplexObject` のサブタイプで" "あるときに真を返します。この関数は常に成功します。" -#: ../../c-api/complex.rst:108 +#: ../../c-api/complex.rst:102 msgid "" "Return true if its argument is a :c:type:`PyComplexObject`, but not a " "subtype of :c:type:`PyComplexObject`. This function always succeeds." @@ -163,81 +149,48 @@ msgstr "" "引数が :c:type:`PyComplexObject` であるが :c:type:`PyComplexObject` のサブタ" "イプでないときに真を返します。この関数は常に成功します。" -#: ../../c-api/complex.rst:114 +#: ../../c-api/complex.rst:108 msgid "" "Create a new Python complex number object from a C :c:type:`Py_complex` " -"value. Return ``NULL`` with an exception set on error." -msgstr "" - -#: ../../c-api/complex.rst:120 -msgid "" -"Return a new :c:type:`PyComplexObject` object from *real* and *imag*. Return " -"``NULL`` with an exception set on error." -msgstr "" +"value." +msgstr "C の :c:type:`Py_complex` 型から Python の複素数値を生成します。" -#: ../../c-api/complex.rst:126 -msgid "Return the real part of *op* as a C :c:expr:`double`." -msgstr "*op* の実数部分を C の :c:expr:`double` 型で返します。" - -#: ../../c-api/complex.rst:128 -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 "" - -#: ../../c-api/complex.rst:134 ../../c-api/complex.rst:150 -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 "" - -#: ../../c-api/complex.rst:137 ../../c-api/complex.rst:153 -msgid "Use :meth:`~object.__complex__` if available." +#: ../../c-api/complex.rst:113 +msgid "Return a new :c:type:`PyComplexObject` object from *real* and *imag*." msgstr "" +"新たな :c:type:`PyComplexObject` オブジェクトを *real* と *imag* から生成しま" +"す。" -#: ../../c-api/complex.rst:142 -msgid "Return the imaginary part of *op* as a C :c:expr:`double`." -msgstr "*op* の虚数部分を C の :c:expr:`double` 型で返します。" +#: ../../c-api/complex.rst:118 +msgid "Return the real part of *op* as a C :c:type:`double`." +msgstr "*op* の実数部分を C の :c:type:`double` 型で返します。" -#: ../../c-api/complex.rst:144 -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 "" +#: ../../c-api/complex.rst:123 +msgid "Return the imaginary part of *op* as a C :c:type:`double`." +msgstr "*op* の虚数部分を C の :c:type:`double` 型で返します。" -#: ../../c-api/complex.rst:158 +#: ../../c-api/complex.rst:128 msgid "Return the :c:type:`Py_complex` value of the complex number *op*." msgstr "複素数値 *op* から :c:type:`Py_complex` 型を生成します。" -#: ../../c-api/complex.rst:160 -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__`." -msgstr "" - -#: ../../c-api/complex.rst:166 -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." -msgstr "" - -#: ../../c-api/complex.rst:170 -msgid "Use :meth:`~object.__index__` if available." -msgstr "可能であれば :meth:`~object.__index__` を使うようになりました。" - -#: ../../c-api/complex.rst:8 -msgid "object" -msgstr "object" - -#: ../../c-api/complex.rst:8 -msgid "complex number" -msgstr "complex number" +#: ../../c-api/complex.rst:130 +msgid "" +"If *op* is not a Python complex number object but has a :meth:`__complex__` " +"method, this method will first be called to convert *op* to a Python complex " +"number object. If ``__complex__()`` is not defined then it falls back to :" +"meth:`__float__`. If ``__float__()`` is not defined then it falls back to :" +"meth:`__index__`. Upon failure, this method returns ``-1.0`` as a real " +"value." +msgstr "" +"*op* が Python の複素数オブジェクトではないが、 :meth:`__complex__` メソッド" +"を持っていた場合、このメソッドが最初に呼ばれ、 *op* が Python の複素数オブ" +"ジェクトに変換されます。\n" +"``__complex__()`` が定義されていない場合は、 :meth:`__float__` にフォールバッ" +"クされます。\n" +"``__float__()`` が定義されていない場合は、 :meth:`__index__` にフォールバック" +"されます。\n" +"処理が失敗した場合は、このメソッドは実数の ``-1.0`` を返します。" + +#: ../../c-api/complex.rst:137 +msgid "Use :meth:`__index__` if available." +msgstr "可能であれば :meth:`__index__` を使うようになりました。" diff --git a/c-api/concrete.po b/c-api/concrete.po index f48bdb208..f0670f1b3 100644 --- a/c-api/concrete.po +++ b/c-api/concrete.po @@ -1,26 +1,27 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Nozomu Kaneko , 2023 -# tomo, 2023 +# E. Kawashima, 2017 +# Arihiro TAKASE, 2017 +# tomo, 2019 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-30 14:22+0000\n" -"PO-Revision-Date: 2021-06-28 00:48+0000\n" -"Last-Translator: tomo, 2023\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 17:34+0000\n" +"Last-Translator: tomo, 2019\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/concrete.rst:8 @@ -98,20 +99,3 @@ msgstr "Function オブジェクト" #: ../../c-api/concrete.rst:102 msgid "Other Objects" msgstr "その他のオブジェクト" - -#: ../../c-api/concrete.rst:43 ../../c-api/concrete.rst:58 -#: ../../c-api/concrete.rst:80 -msgid "object" -msgstr "object" - -#: ../../c-api/concrete.rst:43 -msgid "numeric" -msgstr "数値" - -#: ../../c-api/concrete.rst:58 -msgid "sequence" -msgstr "sequence" - -#: ../../c-api/concrete.rst:80 -msgid "mapping" -msgstr "mapping" diff --git a/c-api/contextvars.po b/c-api/contextvars.po index 6c2c8b329..8ff16f58c 100644 --- a/c-api/contextvars.po +++ b/c-api/contextvars.po @@ -1,34 +1,32 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 -# yaakiyu, 2023 -# Arihiro TAKASE, 2024 +# tomo, 2020 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:48+0000\n" -"Last-Translator: Arihiro TAKASE, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-04-29 06:12+0000\n" +"PO-Revision-Date: 2018-06-29 21:01+0000\n" +"Last-Translator: tomo, 2020\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/contextvars.rst:6 msgid "Context Variables Objects" msgstr "コンテキスト変数オブジェクト" -#: ../../c-api/contextvars.rst:15 +#: ../../c-api/contextvars.rst:13 msgid "" "In Python 3.7.1 the signatures of all context variables C APIs were " "**changed** to use :c:type:`PyObject` pointers instead of :c:type:" @@ -38,16 +36,7 @@ msgstr "" "`PyContext`, :c:type:`PyContextVar`, :c:type:`PyContextToken` の代わりに :c:" "type:`PyObject` ポインタを使うように **変更** されました。例えば::" -#: ../../c-api/contextvars.rst:20 -msgid "" -"// in 3.7.0:\n" -"PyContext *PyContext_New(void);\n" -"\n" -"// in 3.7.1+:\n" -"PyObject *PyContext_New(void);" -msgstr "" - -#: ../../c-api/contextvars.rst:26 +#: ../../c-api/contextvars.rst:24 msgid "See :issue:`34762` for more details." msgstr "詳細は :issue:`34762` を参照してください。" @@ -162,73 +151,23 @@ msgstr "" "ンテキストに復元します。\n" "成功したら ``0`` を、失敗したら ``-1`` を返します。" -#: ../../c-api/contextvars.rst:106 -msgid "" -"Register *callback* as a context object watcher for the current interpreter. " -"Return an ID which may be passed to :c:func:`PyContext_ClearWatcher`. In " -"case of error (e.g. no more watcher IDs available), return ``-1`` and set an " -"exception." -msgstr "" - -#: ../../c-api/contextvars.rst:115 -msgid "" -"Clear watcher identified by *watcher_id* previously returned from :c:func:" -"`PyContext_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/contextvars.rst:124 -msgid "Enumeration of possible context object watcher events:" -msgstr "" - -#: ../../c-api/contextvars.rst:126 -msgid "" -"``Py_CONTEXT_SWITCHED``: The :term:`current context` has switched to a " -"different context. The object passed to the watch callback is the now-" -"current :class:`contextvars.Context` object, or None if no context is " -"current." -msgstr "" - -#: ../../c-api/contextvars.rst:135 -msgid "" -"Context object watcher callback function. The object passed to the callback " -"is event-specific; see :c:type:`PyContextEvent` for details." -msgstr "" - -#: ../../c-api/contextvars.rst:138 -msgid "" -"If the callback returns with an exception set, it must return ``-1``; this " -"exception will be printed as an unraisable exception using :c:func:" -"`PyErr_FormatUnraisable`. Otherwise it should return ``0``." -msgstr "" - -#: ../../c-api/contextvars.rst:142 -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 " -"set. This means the callback may not call any other API that can set an " -"exception unless it saves and clears the exception state first, and restores " -"it before returning." -msgstr "" - -#: ../../c-api/contextvars.rst:151 +#: ../../c-api/contextvars.rst:105 msgid "Context variable functions:" msgstr "コンテキスト変数の関数:" -#: ../../c-api/contextvars.rst:155 +#: ../../c-api/contextvars.rst:109 msgid "" "Create a new ``ContextVar`` object. The *name* parameter is used for " "introspection and debug purposes. The *def* parameter specifies a default " "value for the context variable, or ``NULL`` for no default. If an error has " "occurred, this function returns ``NULL``." msgstr "" -"新しい ``ContextVar`` オブジェクトを作成します。*name* 引数は内部走査とデバッ" -"グの目的で使われます。*def* 引数はコンテキスト変数のデフォルト値を指定する" -"か、デフォルトがない場合は ``NULL`` です。エラーが起きた場合は、関数は " -"``NULL`` を返します。" +"新しい``ContextVar``オブジェクトをさくせいします。*name* 引数は内部走査とデ" +"バッグの目的で使われます。*def* 引数はコンテキスト変数のデフォルト値を指定す" +"るか、デフォルトがない場合は``NULL``です。エラーが起きた場合は、関数は" +"``NULL``を返します。" -#: ../../c-api/contextvars.rst:162 +#: ../../c-api/contextvars.rst:116 msgid "" "Get the value of a context variable. Returns ``-1`` if an error has " "occurred during lookup, and ``0`` if no error occurred, whether or not a " @@ -238,7 +177,7 @@ msgstr "" "取得中にエラーが起きた場合は ``-1`` を、値が見付かっても見付からなくてもエ" "ラーが起きなかった場合は ``0`` を返します。" -#: ../../c-api/contextvars.rst:166 +#: ../../c-api/contextvars.rst:120 msgid "" "If the context variable was found, *value* will be a pointer to it. If the " "context variable was *not* found, *value* will point to:" @@ -248,23 +187,23 @@ msgstr "" "コンテキスト変数が見付から *なかった* 場合は、 *value* が指すものは次のように" "なっています:" -#: ../../c-api/contextvars.rst:169 +#: ../../c-api/contextvars.rst:123 msgid "*default_value*, if not ``NULL``;" msgstr "(``NULL`` でなければ) *default_value*" -#: ../../c-api/contextvars.rst:170 +#: ../../c-api/contextvars.rst:124 msgid "the default value of *var*, if not ``NULL``;" msgstr "(``NULL`` でなければ) *var* のデフォルト値" -#: ../../c-api/contextvars.rst:171 +#: ../../c-api/contextvars.rst:125 msgid "``NULL``" msgstr "``NULL``" -#: ../../c-api/contextvars.rst:173 +#: ../../c-api/contextvars.rst:127 msgid "Except for ``NULL``, the function returns a new reference." -msgstr "``NULL`` を除けば、この関数は新しい参照を返します。" +msgstr "``NULL``を除けば、この関数は新しい参照を返します。" -#: ../../c-api/contextvars.rst:177 +#: ../../c-api/contextvars.rst:131 msgid "" "Set the value of *var* to *value* in the current context. Returns a new " "token object for this change, or ``NULL`` if an error has occurred." @@ -272,7 +211,7 @@ msgstr "" "現在のコンテキストにおいて *var* の値を *value* にセットします。この変更によ" "る新しいトークンオブジェクトか、エラーが起こった場合は``NULL``を返します。" -#: ../../c-api/contextvars.rst:182 +#: ../../c-api/contextvars.rst:136 msgid "" "Reset the state of the *var* context variable to that it was in before :c:" "func:`PyContextVar_Set` that returned the *token* was called. This function " diff --git a/c-api/conversion.po b/c-api/conversion.po index 73e115222..5ec331308 100644 --- a/c-api/conversion.po +++ b/c-api/conversion.po @@ -1,26 +1,27 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 -# Arihiro TAKASE, 2023 +# 秘湯 , 2017 +# Arihiro TAKASE, 2017 +# tomo, 2020 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:48+0000\n" -"Last-Translator: Arihiro TAKASE, 2023\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-02-20 05:29+0000\n" +"PO-Revision-Date: 2017-02-16 17:34+0000\n" +"Last-Translator: tomo, 2020\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/conversion.rst:6 @@ -65,18 +66,26 @@ msgstr "" msgid "" "The wrappers ensure that ``str[size-1]`` is always ``'\\0'`` upon return. " "They never write more than *size* bytes (including the trailing ``'\\0'``) " -"into str. Both functions require that ``str != NULL``, ``size > 0``, " -"``format != NULL`` and ``size < INT_MAX``. Note that this means there is no " -"equivalent to the C99 ``n = snprintf(NULL, 0, ...)`` which would determine " -"the necessary buffer size." +"into str. Both functions require that ``str != NULL``, ``size > 0`` and " +"``format != NULL``." msgstr "" -#: ../../c-api/conversion.rst:34 +#: ../../c-api/conversion.rst:33 +msgid "" +"If the platform doesn't have :c:func:`vsnprintf` and the buffer size needed " +"to avoid truncation exceeds *size* by more than 512 bytes, Python aborts " +"with a :c:func:`Py_FatalError`." +msgstr "" +"もし :c:func:`vsnprintf` のないプラットフォームで、切り捨てを避けるために必要" +"なバッファサイズが *size* を512バイトより大きく超過していれば、 Python は :c:" +"func:`Py_FatalError` で abort します。" + +#: ../../c-api/conversion.rst:37 msgid "" "The return value (*rv*) for these functions should be interpreted as follows:" msgstr "これらの関数の戻り値 (以下では *rv* とします) は以下の意味を持ちます:" -#: ../../c-api/conversion.rst:36 +#: ../../c-api/conversion.rst:39 msgid "" "When ``0 <= rv < size``, the output conversion was successful and *rv* " "characters were written to *str* (excluding the trailing ``'\\0'`` byte at " @@ -85,7 +94,7 @@ msgstr "" "``0 <= rv < size`` のとき、変換出力は成功して、(最後の ``str[rv]`` にある " "``'\\0'`` を除いて) *rv* 文字が *str* に出力された。" -#: ../../c-api/conversion.rst:40 +#: ../../c-api/conversion.rst:43 msgid "" "When ``rv >= size``, the output conversion was truncated and a buffer with " "``rv + 1`` bytes would have been needed to succeed. ``str[size-1]`` is " @@ -94,7 +103,7 @@ msgstr "" "``rv >= size`` のとき、変換出力は切り詰められており、成功するためには ``rv + " "1`` バイトが必要だったことを示します。``str[size-1]`` は ``'\\0'`` です。" -#: ../../c-api/conversion.rst:44 +#: ../../c-api/conversion.rst:47 msgid "" "When ``rv < 0``, \"something bad happened.\" ``str[size-1]`` is ``'\\0'`` in " "this case too, but the rest of *str* is undefined. The exact cause of the " @@ -104,71 +113,26 @@ msgstr "" "``str[size-1]`` は ``'\\0'`` ですが、*str* のそれ以外の部分は未定義です。エ" "ラーの正確な原因はプラットフォーム依存です。" -#: ../../c-api/conversion.rst:49 +#: ../../c-api/conversion.rst:51 msgid "" "The following functions provide locale-independent string to number " "conversions." msgstr "以下の関数は locale 非依存な文字列から数値への変換を行ないます。" -#: ../../c-api/conversion.rst:53 +#: ../../c-api/conversion.rst:56 msgid "" -"Convert the initial part of the string in ``str`` to an :c:expr:`unsigned " -"long` value according to the given ``base``, which must be between ``2`` and " -"``36`` inclusive, or be the special value ``0``." -msgstr "" - -#: ../../c-api/conversion.rst:57 -msgid "" -"Leading white space and case of characters are ignored. If ``base`` is zero " -"it looks for a leading ``0b``, ``0o`` or ``0x`` to tell which base. If " -"these are absent it defaults to ``10``. Base must be 0 or between 2 and 36 " -"(inclusive). If ``ptr`` is non-``NULL`` it will contain a pointer to the " -"end of the scan." -msgstr "" - -#: ../../c-api/conversion.rst:63 -msgid "" -"If the converted value falls out of range of corresponding return type, " -"range error occurs (:c:data:`errno` is set to :c:macro:`!ERANGE`) and :c:" -"macro:`!ULONG_MAX` is returned. If no conversion can be performed, ``0`` is " -"returned." -msgstr "" - -#: ../../c-api/conversion.rst:68 -msgid "See also the Unix man page :manpage:`strtoul(3)`." -msgstr "" - -#: ../../c-api/conversion.rst:75 -msgid "" -"Convert the initial part of the string in ``str`` to an :c:expr:`long` value " -"according to the given ``base``, which must be between ``2`` and ``36`` " -"inclusive, or be the special value ``0``." -msgstr "" - -#: ../../c-api/conversion.rst:79 -msgid "" -"Same as :c:func:`PyOS_strtoul`, but return a :c:expr:`long` value instead " -"and :c:macro:`LONG_MAX` on overflows." -msgstr "" - -#: ../../c-api/conversion.rst:82 -msgid "See also the Unix man page :manpage:`strtol(3)`." -msgstr "" - -#: ../../c-api/conversion.rst:89 -msgid "" -"Convert a string ``s`` to a :c:expr:`double`, raising a Python exception on " +"Convert a string ``s`` to a :c:type:`double`, raising a Python exception on " "failure. The set of accepted strings corresponds to the set of strings " "accepted by Python's :func:`float` constructor, except that ``s`` must not " "have leading or trailing whitespace. The conversion is independent of the " "current locale." msgstr "" -"文字列 ``s`` を :c:expr:`double` に変換します。失敗したときは Python の例外を" +"文字列 ``s`` を :c:type:`double` に変換します。失敗したときは Python の例外を" "発生させます。受け入れられる文字列は、 Python の :func:`float` コンストラクタ" "が受け付ける文字列に準拠しますが、 ``s`` の先頭と末尾に空白文字があってはなら" "ないという部分が異なります。この変換は現在のロケールに依存しません。" -#: ../../c-api/conversion.rst:95 +#: ../../c-api/conversion.rst:62 msgid "" "If ``endptr`` is ``NULL``, convert the whole string. Raise :exc:" "`ValueError` and return ``-1.0`` if the string is not a valid representation " @@ -178,7 +142,7 @@ msgstr "" "しい浮動小数点数の表現になっていない場合は ``-1.0`` を返して :exc:" "`ValueError` を発生させます。" -#: ../../c-api/conversion.rst:99 +#: ../../c-api/conversion.rst:66 msgid "" "If endptr is not ``NULL``, convert as much of the string as possible and set " "``*endptr`` to point to the first unconverted character. If no initial " @@ -191,18 +155,25 @@ msgstr "" "数点数の表現が無かった場合、``*endptr`` を文字列の先頭に設定して、ValueError " "を発生させ、``-1.0`` を返します。" -#: ../../c-api/conversion.rst:106 +#: ../../c-api/conversion.rst:73 msgid "" "If ``s`` represents a value that is too large to store in a float (for " "example, ``\"1e500\"`` is such a string on many platforms) then if " -"``overflow_exception`` is ``NULL`` return ``Py_INFINITY`` (with an " +"``overflow_exception`` is ``NULL`` return ``Py_HUGE_VAL`` (with an " "appropriate sign) and don't set any exception. Otherwise, " "``overflow_exception`` must point to a Python exception object; raise that " "exception and return ``-1.0``. In both cases, set ``*endptr`` to point to " "the first character after the converted value." msgstr "" - -#: ../../c-api/conversion.rst:114 +"``s`` が float に格納し切れないほど大きい値を表現していた場合、(例えば、" +"``\"1e500\"`` は多くのプラットフォームで表現できません) " +"``overflow_exception`` が ``NULL`` なら ``Py_HUGE_VAL`` に適切な符号を付けて" +"返します。他の場合は ``overflow_exception`` は Python の例外オブジェクトへの" +"ポインタでなければならず、その例外を発生させて ``-1.0`` を返します。どちらの" +"場合でも、``*endptr`` には変換された値の直後の最初の文字へのポインタが設定さ" +"れます。" + +#: ../../c-api/conversion.rst:81 msgid "" "If any other error occurs during the conversion (for example an out-of-" "memory error), set the appropriate Python exception and return ``-1.0``." @@ -210,15 +181,15 @@ msgstr "" "それ以外のエラーが変換中に発生した場合(例えば out-of-memory エラー)、適切な " "Python の例外を設定して ``-1.0`` を返します。" -#: ../../c-api/conversion.rst:123 +#: ../../c-api/conversion.rst:90 msgid "" -"Convert a :c:expr:`double` *val* to a string using supplied *format_code*, " +"Convert a :c:type:`double` *val* to a string using supplied *format_code*, " "*precision*, and *flags*." msgstr "" -":c:expr:`double` *val* を指定された *format_code*, *precision*, *flags* に基" +":c:type:`double` *val* を指定された *format_code*, *precision*, *flags* に基" "づいて文字列に変換します。" -#: ../../c-api/conversion.rst:126 +#: ../../c-api/conversion.rst:93 msgid "" "*format_code* must be one of ``'e'``, ``'E'``, ``'f'``, ``'F'``, ``'g'``, " "``'G'`` or ``'r'``. For ``'r'``, the supplied *precision* must be 0 and is " @@ -229,7 +200,7 @@ msgstr "" "ければならず、無視されます。 ``'r'`` フォーマットコードは標準の :func:`repr` " "フォーマットを指定しています。" -#: ../../c-api/conversion.rst:131 +#: ../../c-api/conversion.rst:98 msgid "" "*flags* can be zero or more of the values ``Py_DTSF_SIGN``, " "``Py_DTSF_ADD_DOT_0``, or ``Py_DTSF_ALT``, or-ed together:" @@ -237,7 +208,7 @@ msgstr "" "*flags* は 0 か、 ``Py_DTSF_SIGN``, ``Py_DTSF_ADD_DOT_0``, ``Py_DTSF_ALT`` " "か、これらの or を取ったものです:" -#: ../../c-api/conversion.rst:134 +#: ../../c-api/conversion.rst:101 msgid "" "``Py_DTSF_SIGN`` means to always precede the returned string with a sign " "character, even if *val* is non-negative." @@ -245,13 +216,13 @@ msgstr "" "``Py_DTSF_SIGN`` は、*val* が負で無いときも常に符号文字を先頭につけることを意" "味します。" -#: ../../c-api/conversion.rst:137 +#: ../../c-api/conversion.rst:104 msgid "" "``Py_DTSF_ADD_DOT_0`` means to ensure that the returned string will not look " "like an integer." msgstr "``Py_DTSF_ADD_DOT_0`` は文字列が整数のように見えないことを保証します。" -#: ../../c-api/conversion.rst:140 +#: ../../c-api/conversion.rst:107 msgid "" "``Py_DTSF_ALT`` means to apply \"alternate\" formatting rules. See the " "documentation for the :c:func:`PyOS_snprintf` ``'#'`` specifier for details." @@ -260,7 +231,7 @@ msgstr "" "す。\n" "詳細は :c:func:`PyOS_snprintf` の ``'#'`` 指定を参照してください。" -#: ../../c-api/conversion.rst:144 +#: ../../c-api/conversion.rst:111 msgid "" "If *ptype* is non-``NULL``, then the value it points to will be set to one " "of ``Py_DTST_FINITE``, ``Py_DTST_INFINITE``, or ``Py_DTST_NAN``, signifying " @@ -271,7 +242,7 @@ msgstr "" "て、``Py_DTST_FINITE``, ``Py_DTST_INFINITE``, ``Py_DTST_NAN`` のいずれかに設" "定されます。" -#: ../../c-api/conversion.rst:148 +#: ../../c-api/conversion.rst:115 msgid "" "The return value is a pointer to *buffer* with the converted string or " "``NULL`` if the conversion failed. The caller is responsible for freeing the " @@ -282,14 +253,18 @@ msgstr "" "呼び出し側は、返された文字列を :c:func:`PyMem_Free` を使って解放する責任があ" "ります。" -#: ../../c-api/conversion.rst:157 +#: ../../c-api/conversion.rst:124 msgid "" "Case insensitive comparison of strings. The function works almost " -"identically to :c:func:`!strcmp` except that it ignores the case." +"identically to :c:func:`strcmp` except that it ignores the case." msgstr "" +"大文字/小文字を区別しない文字列比較。大文字/小文字を無視する以外は、 :c:func:" +"`strcmp` と同じ動作をします。" -#: ../../c-api/conversion.rst:163 +#: ../../c-api/conversion.rst:130 msgid "" "Case insensitive comparison of strings. The function works almost " -"identically to :c:func:`!strncmp` except that it ignores the case." +"identically to :c:func:`strncmp` except that it ignores the case." msgstr "" +"大文字/小文字を区別しない文字列比較。大文字/小文字を無視する以外は、 :c:func:" +"`strncmp` と同じ動作をします。" diff --git a/c-api/coro.po b/c-api/coro.po index 1c07e45d8..e2f1ae9f5 100644 --- a/c-api/coro.po +++ b/c-api/coro.po @@ -1,26 +1,26 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 -# Takanori Suzuki , 2021 +# Inada Naoki , 2017 +# tomo, 2019 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-30 14:22+0000\n" -"PO-Revision-Date: 2021-06-28 00:48+0000\n" -"Last-Translator: Takanori Suzuki , 2021\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-07 05:06+0000\n" +"PO-Revision-Date: 2017-02-16 17:34+0000\n" +"Last-Translator: tomo, 2019\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/coro.rst:6 diff --git a/c-api/datetime.po b/c-api/datetime.po index 36ad34d6e..0315b1674 100644 --- a/c-api/datetime.po +++ b/c-api/datetime.po @@ -1,28 +1,27 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 -# yaakiyu, 2022 -# Arihiro TAKASE, 2023 -# Taichi Haradaguchi, 2024 +# Arihiro TAKASE, 2017 +# Osamu NAKAMURA, 2019 +# tomo, 2020 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:48+0000\n" -"Last-Translator: Taichi Haradaguchi, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-07 05:06+0000\n" +"PO-Revision-Date: 2017-02-16 17:34+0000\n" +"Last-Translator: tomo, 2020\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/datetime.rst:6 @@ -34,109 +33,45 @@ msgid "" "Various date and time objects are supplied by the :mod:`datetime` module. " "Before using any of these functions, the header file :file:`datetime.h` must " "be included in your source (note that this is not included by :file:`Python." -"h`), and the macro :c:macro:`!PyDateTime_IMPORT` must be invoked, usually as " +"h`), and the macro :c:macro:`PyDateTime_IMPORT` must be invoked, usually as " "part of the module initialisation function. The macro puts a pointer to a C " -"structure into a static variable, :c:data:`!PyDateTimeAPI`, that is used by " +"structure into a static variable, :c:data:`PyDateTimeAPI`, that is used by " "the following macros." msgstr "" ":mod:`datetime` モジュールでは、様々な日付オブジェクトや時刻オブジェクトを提" "供しています。以下に示す関数を使う場合には、あらかじめヘッダファイル :file:" "`datetime.h` をソースに include し (:file:`Python.h` はこのファイルを " -"include しません)、 :c:macro:`!PyDateTime_IMPORT` マクロを、通常はモジュール" -"初期化関数から、起動しておく必要があります。このマクロは以下のマクロで使われ" -"る静的変数 :c:data:`!PyDateTimeAPI` に C 構造体へのポインタを入れます。" - -#: ../../c-api/datetime.rst:18 -msgid "This subtype of :c:type:`PyObject` represents a Python date object." -msgstr "" -"この :c:type:`PyObject` のサブタイプは、Pythonの日付オブジェクトを表します。" - -#: ../../c-api/datetime.rst:22 -msgid "This subtype of :c:type:`PyObject` represents a Python datetime object." -msgstr "" -"この :c:type:`PyObject` のサブタイプは Python の datetime オブジェクトを表し" -"ます。" - -#: ../../c-api/datetime.rst:26 -msgid "This subtype of :c:type:`PyObject` represents a Python time object." -msgstr "" -"この :c:type:`PyObject` のサブタイプは Python の time オブジェクトを表現しま" -"す。" - -#: ../../c-api/datetime.rst:30 -msgid "" -"This subtype of :c:type:`PyObject` represents the difference between two " -"datetime values." -msgstr "" -"この :c:type:`PyObject` のサブタイプは二つの datetime の値の差分を表します。" - -#: ../../c-api/datetime.rst:34 -msgid "" -"This instance of :c:type:`PyTypeObject` represents the Python date type; it " -"is the same object as :class:`datetime.date` in the Python layer." -msgstr "" -"この :c:type:`PyTypeObject` のインスタンスは Python の date 型を表します; " -"Python レイヤにおける :class:`datetime.date` と同じオブジェクトです。" - -#: ../../c-api/datetime.rst:39 -msgid "" -"This instance of :c:type:`PyTypeObject` represents the Python datetime type; " -"it is the same object as :class:`datetime.datetime` in the Python layer." -msgstr "" -"この :c:type:`PyTypeObject` のインスタンスは Python の datetime 型を表現しま" -"す; Python レイヤにおける :class:`datetime.datetime` と同じオブジェクトです。" - -#: ../../c-api/datetime.rst:44 -msgid "" -"This instance of :c:type:`PyTypeObject` represents the Python time type; it " -"is the same object as :class:`datetime.time` in the Python layer." -msgstr "" -"この :c:type:`PyTypeObject` のインスタンスは Python の time 型を表します; " -"Python レイヤにおける :class:`datetime.time` と同じオブジェクトです。" - -#: ../../c-api/datetime.rst:49 -msgid "" -"This instance of :c:type:`PyTypeObject` represents Python type for the " -"difference between two datetime values; it is the same object as :class:" -"`datetime.timedelta` in the Python layer." -msgstr "" - -#: ../../c-api/datetime.rst:55 -msgid "" -"This instance of :c:type:`PyTypeObject` represents the Python time zone info " -"type; it is the same object as :class:`datetime.tzinfo` in the Python layer." -msgstr "" -"この :c:type:`PyTypeObject` のインスタンスは Python の タイムゾーン情報型を表" -"します; Python レイヤにおける :class:`datetime.tzinfo` と同じオブジェクトで" -"す。" +"include しません)、 :c:macro:`PyDateTime_IMPORT` マクロを、通常はモジュール初" +"期化関数から、起動しておく必要があります。このマクロは以下のマクロで使われる" +"静的変数 :c:data:`PyDateTimeAPI` に C 構造体へのポインタを入れます。" -#: ../../c-api/datetime.rst:59 +#: ../../c-api/datetime.rst:16 msgid "Macro for access to the UTC singleton:" msgstr "UTCシングルトンにアクセスするためのマクロ:" -#: ../../c-api/datetime.rst:63 +#: ../../c-api/datetime.rst:20 msgid "" "Returns the time zone singleton representing UTC, the same object as :attr:" "`datetime.timezone.utc`." msgstr "" -"UTCタイムゾーンに相当するシングルトンを返します。これは :attr:`datetime." -"timezone.utc` と同じオブジェクトです。" +"UTCタイムゾーンに相当するシングルトンを返します。\n" +"これは :attr:`datetime.timezon.utc` と同じオブジェクトです。" -#: ../../c-api/datetime.rst:69 +#: ../../c-api/datetime.rst:26 msgid "Type-check macros:" msgstr "型チェックマクロ:" -#: ../../c-api/datetime.rst:73 +#: ../../c-api/datetime.rst:30 msgid "" "Return true if *ob* is of type :c:data:`PyDateTime_DateType` or a subtype " -"of :c:data:`!PyDateTime_DateType`. *ob* must not be ``NULL``. This " -"function always succeeds." +"of :c:data:`PyDateTime_DateType`. *ob* must not be ``NULL``. This function " +"always succeeds." msgstr "" -"*ob* が :c:data:`PyDateTime_DateType` 型か :c:data:`!PyDateTime_DateType` 型" -"のサブタイプのオブジェクトの場合に真を返します; *ob* は ``NULL`` であってはな" -"りません。この関数は常に成功します。" +"Return true if *ob* is of type :c:data:`PyDateTime_DateType` or a subtype " +"of :c:data:`PyDateTime_DateType`. *ob* must not be ``NULL``. This function " +"always succeeds." -#: ../../c-api/datetime.rst:80 +#: ../../c-api/datetime.rst:37 msgid "" "Return true if *ob* is of type :c:data:`PyDateTime_DateType`. *ob* must not " "be ``NULL``. This function always succeeds." @@ -144,17 +79,17 @@ msgstr "" "*ob* が :c:data:`PyDateTime_DateType` の場合に真を返します。\n" "*ob* は ``NULL`` であってはなりません。この関数は常に成功します。" -#: ../../c-api/datetime.rst:86 +#: ../../c-api/datetime.rst:43 msgid "" "Return true if *ob* is of type :c:data:`PyDateTime_DateTimeType` or a " -"subtype of :c:data:`!PyDateTime_DateTimeType`. *ob* must not be ``NULL``. " +"subtype of :c:data:`PyDateTime_DateTimeType`. *ob* must not be ``NULL``. " "This function always succeeds." msgstr "" -"*ob* が :c:data:`PyDateTime_DateTimeType` 型か :c:data:`!" -"PyDateTime_DateTimeType` 型のサブタイプのオブジェクトの場合に真を返します; " +"*ob* が :c:data:`PyDateTime_DateTimeType` 型か :c:data:" +"`PyDateTime_DateTimeType` 型のサブタイプのオブジェクトの場合に真を返します; " "*ob* は ``NULL`` であってはなりません。この関数は常に成功します。" -#: ../../c-api/datetime.rst:93 +#: ../../c-api/datetime.rst:50 msgid "" "Return true if *ob* is of type :c:data:`PyDateTime_DateTimeType`. *ob* must " "not be ``NULL``. This function always succeeds." @@ -162,17 +97,17 @@ msgstr "" "*ob* が :c:data:`PyDateTime_DateTimeType` の場合に真を返します。\n" "*ob* は ``NULL`` であってはなりません。この関数は常に成功します。" -#: ../../c-api/datetime.rst:99 +#: ../../c-api/datetime.rst:56 msgid "" "Return true if *ob* is of type :c:data:`PyDateTime_TimeType` or a subtype " -"of :c:data:`!PyDateTime_TimeType`. *ob* must not be ``NULL``. This " -"function always succeeds." +"of :c:data:`PyDateTime_TimeType`. *ob* must not be ``NULL``. This function " +"always succeeds." msgstr "" -"*ob* が :c:data:`PyDateTime_TimeType` 型か :c:data:`!PyDateTime_TimeType` 型" -"のサブタイプのオブジェクトの場合に真を返します; *ob* は ``NULL`` であってはな" -"りません。この関数は常に成功します。" +"*ob* が :c:data:`PyDateTime_TimeType` 型か :c:data:`PyDateTime_TimeType` 型の" +"サブタイプのオブジェクトの場合に真を返します; *ob* は ``NULL`` であってはなり" +"ません。この関数は常に成功します。" -#: ../../c-api/datetime.rst:106 +#: ../../c-api/datetime.rst:63 msgid "" "Return true if *ob* is of type :c:data:`PyDateTime_TimeType`. *ob* must not " "be ``NULL``. This function always succeeds." @@ -180,17 +115,17 @@ msgstr "" "*ob* が :c:data:`PyDateTime_TimeType` の場合に真を返します。\n" "*ob* は ``NULL`` であってはなりません。この関数は常に成功します。" -#: ../../c-api/datetime.rst:112 +#: ../../c-api/datetime.rst:69 msgid "" "Return true if *ob* is of type :c:data:`PyDateTime_DeltaType` or a subtype " -"of :c:data:`!PyDateTime_DeltaType`. *ob* must not be ``NULL``. This " +"of :c:data:`PyDateTime_DeltaType`. *ob* must not be ``NULL``. This " "function always succeeds." msgstr "" -"*ob* が :c:data:`PyDateTime_DeltaType` 型か :c:data:`!PyDateTime_DeltaType` " -"型のサブタイプのオブジェクトの場合に真を返します; *ob* は ``NULL`` であっては" -"なりません。この関数は常に成功します。" +"*ob* が :c:data:`PyDateTime_DeltaType` 型か :c:data:`PyDateTime_DeltaType` 型" +"のサブタイプのオブジェクトの場合に真を返します; *ob* は ``NULL`` であってはな" +"りません。この関数は常に成功します。" -#: ../../c-api/datetime.rst:119 +#: ../../c-api/datetime.rst:76 msgid "" "Return true if *ob* is of type :c:data:`PyDateTime_DeltaType`. *ob* must not " "be ``NULL``. This function always succeeds." @@ -198,17 +133,17 @@ msgstr "" "*ob* が :c:data:`PyDateTime_DeltaType` の場合に真を返します。\n" "*ob* は ``NULL`` であってはなりません。この関数は常に成功します。" -#: ../../c-api/datetime.rst:125 +#: ../../c-api/datetime.rst:82 msgid "" "Return true if *ob* is of type :c:data:`PyDateTime_TZInfoType` or a subtype " -"of :c:data:`!PyDateTime_TZInfoType`. *ob* must not be ``NULL``. This " +"of :c:data:`PyDateTime_TZInfoType`. *ob* must not be ``NULL``. This " "function always succeeds." msgstr "" -"*ob* が :c:data:`PyDateTime_TZInfoType` 型か :c:data:`!" -"PyDateTime_TZInfoType` 型のサブタイプのオブジェクトの場合に真を返します; " -"*ob* は ``NULL`` であってはなりません。この関数は常に成功します。" +"*ob* が :c:data:`PyDateTime_TZInfoType` 型か :c:data:`PyDateTime_TZInfoType` " +"型のサブタイプのオブジェクトの場合に真を返します; *ob* は ``NULL`` であっては" +"なりません。この関数は常に成功します。" -#: ../../c-api/datetime.rst:132 +#: ../../c-api/datetime.rst:89 msgid "" "Return true if *ob* is of type :c:data:`PyDateTime_TZInfoType`. *ob* must " "not be ``NULL``. This function always succeeds." @@ -216,17 +151,17 @@ msgstr "" "*ob* が :c:data:`PyDateTime_TZInfoType` の場合に真を返します。\n" "*ob* は ``NULL`` であってはなりません。この関数は常に成功します。" -#: ../../c-api/datetime.rst:136 +#: ../../c-api/datetime.rst:93 msgid "Macros to create objects:" msgstr "以下はオブジェクトを作成するためのマクロです:" -#: ../../c-api/datetime.rst:140 +#: ../../c-api/datetime.rst:97 msgid "" "Return a :class:`datetime.date` object with the specified year, month and " "day." msgstr "指定した年、月、日の :class:`datetime.date` オブジェクトを返します。" -#: ../../c-api/datetime.rst:145 +#: ../../c-api/datetime.rst:102 msgid "" "Return a :class:`datetime.datetime` object with the specified year, month, " "day, hour, minute, second and microsecond." @@ -234,7 +169,7 @@ msgstr "" "指定した年、月、日、時、分、秒、マイクロ秒の :class:`datetime.datetime` オブ" "ジェクトを返します。" -#: ../../c-api/datetime.rst:151 +#: ../../c-api/datetime.rst:108 msgid "" "Return a :class:`datetime.datetime` object with the specified year, month, " "day, hour, minute, second, microsecond and fold." @@ -242,7 +177,7 @@ msgstr "" "指定された年、月、日、時、分、秒、マイクロ秒、fold の :class:`datetime." "datetime` オブジェクトを返します。" -#: ../../c-api/datetime.rst:159 +#: ../../c-api/datetime.rst:116 msgid "" "Return a :class:`datetime.time` object with the specified hour, minute, " "second and microsecond." @@ -250,7 +185,7 @@ msgstr "" "指定された時、分、秒、マイクロ秒の :class:`datetime.time` オブジェクトを返し" "ます。" -#: ../../c-api/datetime.rst:165 +#: ../../c-api/datetime.rst:122 msgid "" "Return a :class:`datetime.time` object with the specified hour, minute, " "second, microsecond and fold." @@ -258,7 +193,7 @@ msgstr "" "指定された時、分、秒、マイクロ秒、fold の :class:`datetime.time` オブジェクト" "を返します。" -#: ../../c-api/datetime.rst:173 +#: ../../c-api/datetime.rst:130 msgid "" "Return a :class:`datetime.timedelta` object representing the given number of " "days, seconds and microseconds. Normalization is performed so that the " @@ -269,7 +204,7 @@ msgstr "" "ます。マイクロ秒と秒が :class:`datetime.timedelta` オブジェクトで定義されてい" "る範囲に入るように正規化を行います。" -#: ../../c-api/datetime.rst:181 +#: ../../c-api/datetime.rst:137 msgid "" "Return a :class:`datetime.timezone` object with an unnamed fixed offset " "represented by the *offset* argument." @@ -277,7 +212,7 @@ msgstr "" "*offset* 引数で指定した固定オフセットを持つ、名前のない :class:`datetime." "timezone` オブジェクトを返します。" -#: ../../c-api/datetime.rst:189 +#: ../../c-api/datetime.rst:144 msgid "" "Return a :class:`datetime.timezone` object with a fixed offset represented " "by the *offset* argument and with tzname *name*." @@ -285,110 +220,104 @@ msgstr "" "*offset*引数で指定した固定のオフセットと、*name* のタイムゾーン名を持つ :" "class:`datetime.timezone` オブジェクトを返します。" -#: ../../c-api/datetime.rst:195 +#: ../../c-api/datetime.rst:150 msgid "" "Macros to extract fields from date objects. The argument must be an " -"instance of :c:type:`PyDateTime_Date`, including subclasses (such as :c:type:" +"instance of :c:data:`PyDateTime_Date`, including subclasses (such as :c:data:" "`PyDateTime_DateTime`). The argument must not be ``NULL``, and the type is " "not checked:" msgstr "" "以下のマクロは date オブジェクトからフィールド値を取り出すためのものです。引" -"数は :c:type:`PyDateTime_Date` またはそのサブクラス (例えば :c:type:" +"数は :c:data:`PyDateTime_Date` またはそのサブクラス (例えば :c:data:" "`PyDateTime_DateTime`)の インスタンスでなければなりません。引数を ``NULL`` " "にしてはならず、型チェックは行いません:" -#: ../../c-api/datetime.rst:202 +#: ../../c-api/datetime.rst:157 msgid "Return the year, as a positive int." msgstr "年を正の整数で返します。" -#: ../../c-api/datetime.rst:207 +#: ../../c-api/datetime.rst:162 msgid "Return the month, as an int from 1 through 12." msgstr "月を 1 から 12 の間の整数で返します。" -#: ../../c-api/datetime.rst:212 +#: ../../c-api/datetime.rst:167 msgid "Return the day, as an int from 1 through 31." msgstr "日を 1 から 31 の間の整数で返します。" -#: ../../c-api/datetime.rst:215 +#: ../../c-api/datetime.rst:170 msgid "" "Macros to extract fields from datetime objects. The argument must be an " -"instance of :c:type:`PyDateTime_DateTime`, including subclasses. The " +"instance of :c:data:`PyDateTime_DateTime`, including subclasses. The " "argument must not be ``NULL``, and the type is not checked:" msgstr "" "以下のマクロは datetime オブジェクトからフィールド値を取り出すためのもので" -"す。引数は :c:type:`PyDateTime_DateTime` またはそのサブクラスのインスタンスで" +"す。引数は :c:data:`PyDateTime_DateTime` またはそのサブクラスのインスタンスで" "なければなりません。引数を ``NULL`` にしてはならず、型チェックは行いません:" -#: ../../c-api/datetime.rst:221 ../../c-api/datetime.rst:259 +#: ../../c-api/datetime.rst:176 ../../c-api/datetime.rst:200 msgid "Return the hour, as an int from 0 through 23." msgstr "時を 0 から 23 の間の整数で返します。" -#: ../../c-api/datetime.rst:226 ../../c-api/datetime.rst:264 +#: ../../c-api/datetime.rst:181 ../../c-api/datetime.rst:205 msgid "Return the minute, as an int from 0 through 59." msgstr "分を 0 から 59 の間の整数で返します。" -#: ../../c-api/datetime.rst:231 ../../c-api/datetime.rst:269 +#: ../../c-api/datetime.rst:186 ../../c-api/datetime.rst:210 msgid "Return the second, as an int from 0 through 59." msgstr "秒を 0 から 59 の間の整数で返します。" -#: ../../c-api/datetime.rst:236 ../../c-api/datetime.rst:274 +#: ../../c-api/datetime.rst:191 ../../c-api/datetime.rst:215 msgid "Return the microsecond, as an int from 0 through 999999." msgstr "マイクロ秒を 0 から 999999 の間の整数で返します。" -#: ../../c-api/datetime.rst:241 ../../c-api/datetime.rst:279 -msgid "Return the fold, as an int from 0 through 1." -msgstr "" -"フォールド(訳注: サマータイムによる時間のずれのこと)を 0 から 1 までの整数で" -"返します。" - -#: ../../c-api/datetime.rst:248 ../../c-api/datetime.rst:286 -msgid "Return the tzinfo (which may be ``None``)." -msgstr "" - -#: ../../c-api/datetime.rst:253 +#: ../../c-api/datetime.rst:194 msgid "" "Macros to extract fields from time objects. The argument must be an " -"instance of :c:type:`PyDateTime_Time`, including subclasses. The argument " +"instance of :c:data:`PyDateTime_Time`, including subclasses. The argument " "must not be ``NULL``, and the type is not checked:" msgstr "" "以下のマクロは time オブジェクトからフィールド値を取り出すためのものです。引" -"数は :c:type:`PyDateTime_Time` またはそのサブクラスのインスタンスでなければな" +"数は :c:data:`PyDateTime_Time` またはそのサブクラスのインスタンスでなければな" "りません。引数を ``NULL`` にしてはならず、型チェックは行いません:" -#: ../../c-api/datetime.rst:291 +#: ../../c-api/datetime.rst:218 msgid "" "Macros to extract fields from time delta objects. The argument must be an " -"instance of :c:type:`PyDateTime_Delta`, including subclasses. The argument " +"instance of :c:data:`PyDateTime_Delta`, including subclasses. The argument " "must not be ``NULL``, and the type is not checked:" msgstr "" "以下のマクロは time delta オブジェクトからフィールド値をとりだすためのもので" -"す。引数は :c:type:`PyDateTime_Delta` かそのサブクラスのインスタンスでなけれ" +"す。引数は :c:data:`PyDateTime_Delta` かそのサブクラスのインスタンスでなけれ" "ばなりません。引数を ``NULL`` にしてはならず、型チェックは行いません:" -#: ../../c-api/datetime.rst:297 +#: ../../c-api/datetime.rst:224 msgid "Return the number of days, as an int from -999999999 to 999999999." msgstr "日数を -999999999 から 999999999 の間の整数で返します。" -#: ../../c-api/datetime.rst:304 +#: ../../c-api/datetime.rst:231 msgid "Return the number of seconds, as an int from 0 through 86399." msgstr "秒数を 0 から 86399 の間の整数で返します。" -#: ../../c-api/datetime.rst:311 +#: ../../c-api/datetime.rst:238 msgid "Return the number of microseconds, as an int from 0 through 999999." msgstr "マイクロ秒を 0 から 999999 の間の整数で返します。" -#: ../../c-api/datetime.rst:316 +#: ../../c-api/datetime.rst:243 msgid "Macros for the convenience of modules implementing the DB API:" msgstr "以下のマクロは DB API を実装する上での便宜用です:" -#: ../../c-api/datetime.rst:320 +#: ../../c-api/datetime.rst:247 msgid "" "Create and return a new :class:`datetime.datetime` object given an argument " -"tuple suitable for passing to :meth:`datetime.datetime.fromtimestamp`." +"tuple suitable for passing to :meth:`datetime.datetime.fromtimestamp()`." msgstr "" +":meth:`dateitme.datetime.fromtimestamp()` に渡すのに適した引数タプルから新た" +"な :class:`datetime.datetime` オブジェクトを生成して返します。" -#: ../../c-api/datetime.rst:326 +#: ../../c-api/datetime.rst:253 msgid "" "Create and return a new :class:`datetime.date` object given an argument " -"tuple suitable for passing to :meth:`datetime.date.fromtimestamp`." +"tuple suitable for passing to :meth:`datetime.date.fromtimestamp()`." msgstr "" +":meth:`dateitme.date.fromtimestamp()` に渡すのに適した引数タプルから新たな :" +"class:`datetime.date` オブジェクトを生成して返します。" diff --git a/c-api/descriptor.po b/c-api/descriptor.po index 251c845dc..50c6eb122 100644 --- a/c-api/descriptor.po +++ b/c-api/descriptor.po @@ -1,25 +1,25 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 +# Arihiro TAKASE, 2017 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-30 14:22+0000\n" -"PO-Revision-Date: 2021-06-28 00:48+0000\n" -"Last-Translator: tomo, 2021\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 17:34+0000\n" +"Last-Translator: Arihiro TAKASE, 2017\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/descriptor.rst:6 @@ -41,10 +41,10 @@ msgstr "組み込みデスクリプタ型の型オブジェクトです。" #: ../../c-api/descriptor.rst:35 msgid "" -"Return non-zero if the descriptor objects *descr* describes a data " -"attribute, or ``0`` if it describes a method. *descr* must be a descriptor " -"object; there is no error checking." +"Return true if the descriptor objects *descr* describes a data attribute, or " +"false if it describes a method. *descr* must be a descriptor object; there " +"is no error checking." msgstr "" -"デスクリプタオブジェクト *descr* がデータ属性のデスクリプタの場合には非ゼロ値" -"を、メソッドデスクリプタの場合には ``0`` を返します。*descr* はデスクリプタオ" -"ブジェクトでなければなりません。エラーチェックは行いません。" +"デスクリプタオブジェクト *descr* がデータ属性のデスクリプタの場合には真を、メ" +"ソッドデスクリプタの場合には偽を返します。*descr* はデスクリプタオブジェクト" +"でなければなりません; エラーチェックは行いません。" diff --git a/c-api/dict.po b/c-api/dict.po index 7a29c02f1..dc919e278 100644 --- a/c-api/dict.po +++ b/c-api/dict.po @@ -1,27 +1,29 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Arihiro TAKASE, 2023 -# Nozomu Kaneko , 2023 -# tomo, 2024 +# Shun Sakurai, 2017 +# Nozomu Kaneko , 2017 +# 秘湯 , 2017 +# Arihiro TAKASE, 2017 +# tomo, 2020 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:48+0000\n" -"Last-Translator: tomo, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-07 05:06+0000\n" +"PO-Revision-Date: 2017-02-16 17:35+0000\n" +"Last-Translator: tomo, 2020\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/dict.rst:6 @@ -91,17 +93,10 @@ msgstr "" "返します。この関数は Python の式 ``key in p`` と等価です。" #: ../../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 "*p* と同じキーと値のペアが入った新たな辞書を返します。" -#: ../../c-api/dict.rst:74 +#: ../../c-api/dict.rst:65 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`` " @@ -114,77 +109,52 @@ msgstr "" "成功した場合には ``0`` を、失敗した場合には ``-1`` を返します。\n" "この関数は *val* への参照を盗み取り *ません*。" -#: ../../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*`." -msgstr "" - -#: ../../c-api/dict.rst:89 +#: ../../c-api/dict.rst:75 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." +"Insert *val* into the dictionary *p* using *key* as a key. *key* should be " +"a :c:type:`const char*`. The key object is created using " +"``PyUnicode_FromString(key)``. Return ``0`` on success or ``-1`` on " +"failure. This function *does not* steal a reference to *val*." msgstr "" -"辞書 *p* から *key* をキーとするエントリを除去します。 *key* は :term:`ハッ" -"シュ可能 ` でなければなりません; ハッシュ可能でない場合、 :exc:" -"`TypeError` を送出します。*key* が辞書になければ、:exc:`KeyError` を送出しま" -"す。成功した場合には ``0`` を、失敗した場合には ``-1`` を返します。" -#: ../../c-api/dict.rst:97 +#: ../../c-api/dict.rst:83 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*`." +"Remove the entry in dictionary *p* with key *key*. *key* must be 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:104 +#: ../../c-api/dict.rst:91 msgid "" -"Return a new :term:`strong reference` to the object from dictionary *p* " -"which has a key *key*:" +"Remove the entry in dictionary *p* which has a key specified by the string " +"*key*. If *key* is not in the dictionary, :exc:`KeyError` is raised. Return " +"``0`` on success or ``-1`` on failure." msgstr "" +"辞書 *p* から文字列 *key* をキーとするエントリを除去します。*key* が辞書にな" +"ければ、:exc:`KeyError` を送出します。成功した場合には ``0`` を、失敗した場合" +"には ``-1`` を返します。" -#: ../../c-api/dict.rst:107 +#: ../../c-api/dict.rst:98 msgid "" -"If the key is present, set *\\*result* to a new :term:`strong reference` to " -"the value and return ``1``." -msgstr "" - -#: ../../c-api/dict.rst:109 -msgid "If the key is missing, set *\\*result* to ``NULL`` and return ``0``." +"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." msgstr "" +"辞書 *p* 内で *key* をキーとするオブジェクトを返します。\n" +"キー *key* が存在しない場合には ``NULL`` を返しますが、例外をセット *しません" +"*。" -#: ../../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-api/dict.rst:119 +#: ../../c-api/dict.rst:101 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." +"Note that exceptions which occur while calling :meth:`__hash__` and :meth:" +"`__eq__` methods will get suppressed. To get error reporting use :c:func:" +"`PyDict_GetItemWithError()` instead." msgstr "" +":meth:`__hash__` メソッドや :meth:`__eq__` メソッドの呼び出し中に起こる例外は" +"抑制されることに注意してください。\n" +"エラーを報告させるには、代わりに :c:func:`PyDict_GetItemWithError()` を使って" +"ください。" -#: ../../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 an :term:`attached thread state` had been allowed " -"for historical reason. It is no longer allowed." -msgstr "" - -#: ../../c-api/dict.rst:136 +#: ../../c-api/dict.rst:108 msgid "" "Variant of :c:func:`PyDict_GetItem` that does not suppress exceptions. " "Return ``NULL`` **with** an exception set if an exception occurred. Return " @@ -194,28 +164,24 @@ msgstr "" "例外が発生した場合は、例外をセット **した上で** ``NULL`` を返します。\n" "キーが存在しなかった場合は、例外をセット **せずに** ``NULL`` を返します。" -#: ../../c-api/dict.rst:144 +#: ../../c-api/dict.rst:116 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*`." +"type:`const char*`, rather than a :c:type:`PyObject*`." msgstr "" -#: ../../c-api/dict.rst:150 -msgid "" -"Exceptions that occur while this calls :meth:`~object.__hash__` and :meth:" -"`~object.__eq__` methods or while creating the temporary :class:`str` object " -"are silently ignored. Prefer using the :c:func:`PyDict_GetItemWithError` " -"function with your own :c:func:`PyUnicode_FromString` *key* instead." -msgstr "" - -#: ../../c-api/dict.rst:159 +#: ../../c-api/dict.rst:119 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*`." +"Note that exceptions which occur while calling :meth:`__hash__` and :meth:" +"`__eq__` methods and creating a temporary string object will get suppressed. " +"To get error reporting use :c:func:`PyDict_GetItemWithError()` instead." msgstr "" +":meth:`__hash__` メソッドや :meth:`__eq__` メソッドの呼び出し中や、一時的な文" +"字列オブジェクトの作成中に起こる例外は抑制されることに注意してください。\n" +"エラーを報告させるには、代わりに :c:func:`PyDict_GetItemWithError()` を使って" +"ください。" -#: ../../c-api/dict.rst:168 +#: ../../c-api/dict.rst:127 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 " @@ -230,121 +196,48 @@ msgstr "" "この関数は、 *key* のハッシュ値を検索と挿入ごとに別々に評価するのではなく、一" "度だけしか評価しません。" -#: ../../c-api/dict.rst:179 -msgid "" -"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:189 -msgid "" -"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: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 +#: ../../c-api/dict.rst:137 msgid "" "Return a :c:type:`PyListObject` containing all the items from the dictionary." msgstr "辞書内の全ての要素対が入った :c:type:`PyListObject` を返します。" -#: ../../c-api/dict.rst:231 +#: ../../c-api/dict.rst:142 msgid "" "Return a :c:type:`PyListObject` containing all the keys from the dictionary." msgstr "辞書内の全てのキーが入った :c:type:`PyListObject` を返します。" -#: ../../c-api/dict.rst:236 +#: ../../c-api/dict.rst:147 msgid "" "Return a :c:type:`PyListObject` containing all the values from the " "dictionary *p*." msgstr "辞書 *p* 内の全ての値が入った :c:type:`PyListObject` を返します。" -#: ../../c-api/dict.rst:244 +#: ../../c-api/dict.rst:155 msgid "" "Return the number of items in the dictionary. This is equivalent to " "``len(p)`` on a dictionary." msgstr "" "辞書内の要素の数を返します。辞書に対して ``len(p)`` を実行するのと同じです。" -#: ../../c-api/dict.rst:250 +#: ../../c-api/dict.rst:161 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:" +"reported. The parameters *pkey* and *pvalue* should either point to :c:type:" "`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 "" -"辞書 *p* 内の全てのキー/値のペアにわたる反復処理を行います。\n" -"*ppos* が参照している :c:type:`Py_ssize_t` 型は、この関数で反復処理を開始する" -"際に、最初に関数を呼び出すよりも前に ``0`` に初期化しておかなければなりませ" -"ん。この関数は辞書内の各ペアを取り上げるごとに真を返し、全てのペアを取り上げ" -"たことが分かると偽を返します。\n" -"パラメーター *pkey* および *pvalue* には、それぞれ辞書の各々のキーと値が埋め" -"られた :c:expr:`PyObject*` 変数を指すポインタか、または ``NULL`` が入りま" -"す。\n" -"この関数から返される参照はすべて借用参照になります。\n" -"反復処理中に *ppos* を変更してはなりません。\n" -"この値は内部的な辞書構造体のオフセットを表現しており、構造体はスパースなの" -"で、オフセットの値に一貫性がないためです。" -#: ../../c-api/dict.rst:261 +#: ../../c-api/dict.rst:172 msgid "For example::" msgstr "例えば::" -#: ../../c-api/dict.rst:263 -msgid "" -"PyObject *key, *value;\n" -"Py_ssize_t pos = 0;\n" -"\n" -"while (PyDict_Next(self->dict, &pos, &key, &value)) {\n" -" /* do something interesting with the values... */\n" -" ...\n" -"}" -msgstr "" - -#: ../../c-api/dict.rst:271 +#: ../../c-api/dict.rst:182 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 " @@ -354,44 +247,7 @@ msgstr "" "応する値を変更しても大丈夫になりましたが、キーの集合を変更しないことが前提で" "す。以下に例を示します::" -#: ../../c-api/dict.rst:275 -msgid "" -"PyObject *key, *value;\n" -"Py_ssize_t pos = 0;\n" -"\n" -"while (PyDict_Next(self->dict, &pos, &key, &value)) {\n" -" long i = PyLong_AsLong(value);\n" -" if (i == -1 && PyErr_Occurred()) {\n" -" return -1;\n" -" }\n" -" PyObject *o = PyLong_FromLong(i + 1);\n" -" if (o == NULL)\n" -" return -1;\n" -" if (PyDict_SetItem(self->dict, key, o) < 0) {\n" -" Py_DECREF(o);\n" -" return -1;\n" -" }\n" -" Py_DECREF(o);\n" -"}" -msgstr "" - -#: ../../c-api/dict.rst:293 -msgid "" -"The function is not thread-safe in the :term:`free-threaded ` build without external synchronization. You can use :c:macro:" -"`Py_BEGIN_CRITICAL_SECTION` to lock the dictionary while iterating over it::" -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 "" - -#: ../../c-api/dict.rst:307 +#: ../../c-api/dict.rst:207 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` " @@ -408,7 +264,7 @@ msgstr "" "行います。成功した場合には ``0`` を返し、例外が送出された場合には ``-1`` を返" "します。" -#: ../../c-api/dict.rst:317 +#: ../../c-api/dict.rst:217 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 " @@ -421,7 +277,7 @@ msgstr "" "性を持たない場合にキー/値ペアのシーケンスを反復することはありません。成功した" "場合には ``0`` を返し、例外が送出された場合には ``-1`` を返します。" -#: ../../c-api/dict.rst:326 +#: ../../c-api/dict.rst:226 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, " @@ -436,124 +292,3 @@ msgstr "" "出現したキーを使います。成功した場合には ``0`` を返し、例外が送出された場合に" "は ``-1`` を返します。(戻り値以外は) 等価な Python コードを書くと、以下のよう" "になります::" - -#: ../../c-api/dict.rst:333 -msgid "" -"def PyDict_MergeFromSeq2(a, seq2, override):\n" -" for key, value in seq2:\n" -" if override or key not in a:\n" -" a[key] = value" -msgstr "" - -#: ../../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 " -"of error (e.g. no more watcher IDs available), return ``-1`` and set an " -"exception." -msgstr "" - -#: ../../c-api/dict.rst:349 -msgid "" -"Clear watcher identified by *watcher_id* previously returned from :c:func:" -"`PyDict_AddWatcher`. Return ``0`` on success, ``-1`` on error (e.g. if the " -"given *watcher_id* was never registered.)" -msgstr "" - -#: ../../c-api/dict.rst:357 -msgid "" -"Mark dictionary *dict* as watched. The callback granted *watcher_id* by :c:" -"func:`PyDict_AddWatcher` will be called when *dict* is modified or " -"deallocated. Return ``0`` on success or ``-1`` on error." -msgstr "" - -#: ../../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 " -"*dict* is modified or deallocated. The dict must previously have been " -"watched by this watcher. Return ``0`` on success or ``-1`` on error." -msgstr "" - -#: ../../c-api/dict.rst:374 -msgid "" -"Enumeration of possible dictionary watcher events: ``PyDict_EVENT_ADDED``, " -"``PyDict_EVENT_MODIFIED``, ``PyDict_EVENT_DELETED``, " -"``PyDict_EVENT_CLONED``, ``PyDict_EVENT_CLEARED``, or " -"``PyDict_EVENT_DEALLOCATED``." -msgstr "" - -#: ../../c-api/dict.rst:382 -msgid "Type of a dict watcher callback function." -msgstr "" - -#: ../../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`` " -"or ``PyDict_EVENT_MODIFIED``, *new_value* will be the new value for *key*. " -"If *event* is ``PyDict_EVENT_DELETED``, *key* is being deleted from the " -"dictionary and *new_value* will be ``NULL``." -msgstr "" - -#: ../../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 " -"``PyDict_EVENT_ADDED`` events are not issued in this case; instead a single " -"``PyDict_EVENT_CLONED`` is issued, and *key* will be the source dictionary." -msgstr "" - -#: ../../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: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 " -"prevent it from being freed at this time. When the resurrected object is " -"destroyed later, any watcher callbacks active at that time will be called " -"again." -msgstr "" - -#: ../../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: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``." -msgstr "" - -#: ../../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 " -"set. This means the callback may not call any other API that can set an " -"exception unless it saves and clears the exception state first, and restores " -"it before returning." -msgstr "" - -#: ../../c-api/dict.rst:8 -msgid "object" -msgstr "object" - -#: ../../c-api/dict.rst:8 -msgid "dictionary" -msgstr "dictionary" - -#: ../../c-api/dict.rst:242 -msgid "built-in function" -msgstr "組み込み関数" - -#: ../../c-api/dict.rst:242 -msgid "len" -msgstr "len" diff --git a/c-api/exceptions.po b/c-api/exceptions.po index 22306b2cd..40475a6dd 100644 --- a/c-api/exceptions.po +++ b/c-api/exceptions.po @@ -1,30 +1,30 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Tetsuo Koyama , 2022 -# Arihiro TAKASE, 2023 -# Osamu NAKAMURA, 2023 -# tomo, 2023 -# Taichi Haradaguchi, 2024 -# 石井明久, 2025 +# Nozomu Kaneko , 2017 +# Masato HASHIMOTO , 2017 +# E. Kawashima, 2017 +# Arihiro TAKASE, 2017 +# Osamu NAKAMURA, 2021 +# tomo, 2021 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-13 14:21+0000\n" -"PO-Revision-Date: 2021-06-28 00:48+0000\n" -"Last-Translator: 石井明久, 2025\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 17:35+0000\n" +"Last-Translator: tomo, 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/exceptions.rst:8 @@ -40,8 +40,8 @@ msgid "" "occurred. Most C API functions don't clear this on success, but will set it " "to indicate the cause of the error on failure. Most C API functions also " "return an error indicator, usually ``NULL`` if they are supposed to return a " -"pointer, or ``-1`` if they return an integer (exception: the ``PyArg_*`` " -"functions return ``1`` for success and ``0`` for failure)." +"pointer, or ``-1`` if they return an integer (exception: the :c:func:" +"`PyArg_\\*` functions return ``1`` for success and ``0`` for failure)." msgstr "" "この章で説明する関数を使うと、 Python の例外の処理や例外の送出ができるように" "なります。 Python の例外処理の基本をいくらか理解することが大切です。例外は " @@ -50,8 +50,8 @@ msgstr "" "合にはほとんどの C API 関数がこれをクリアしませんが、失敗したときにはエラーの" "原因を示すために設定します。ほとんどの C API 関数はエラーインジケータも返し、" "通常は関数がポインタを返すことになっている場合は ``NULL`` であり、関数が整数" -"を返す場合は ``-1`` です。(例外: ``PyArg_*`` 関数は実行に成功したときに " -"``1`` を返し、失敗したときに ``0`` を返します)." +"を返す場合は ``-1`` です。(例外: :c:func:`PyArg_\\*` 関数は実行に成功したとき" +"に ``1`` を返し、失敗したときに ``0`` を返します)." #: ../../c-api/exceptions.rst:20 msgid "" @@ -91,11 +91,15 @@ msgstr "" #: ../../c-api/exceptions.rst:37 msgid "" -"The error indicator is **not** the result of :func:`sys.exc_info`. The " +"The error indicator is **not** the result of :func:`sys.exc_info()`. The " "former corresponds to an exception that is not yet caught (and is therefore " "still propagating), while the latter returns an exception after it is caught " "(and has therefore stopped propagating)." msgstr "" +"エラー識別子は :func:`sys.exc_info()` の結果 **ではありません**。エラー識別子" +"はまだ捕捉されていない例外 (したがってまだ伝播します) に対応しているのに対" +"し、 sys.exc_info() の結果は捕捉された後の例外を返します (したがってもう伝播" +"しません)。" #: ../../c-api/exceptions.rst:44 msgid "Printing and clearing" @@ -133,75 +137,54 @@ msgstr "" #: ../../c-api/exceptions.rst:63 msgid "" -"If *set_sys_last_vars* is nonzero, the variable :data:`sys.last_exc` is set " -"to the printed exception. For backwards compatibility, the deprecated " -"variables :data:`sys.last_type`, :data:`sys.last_value` and :data:`sys." -"last_traceback` are also set to the type, value and traceback of this " -"exception, respectively." -msgstr "" - -#: ../../c-api/exceptions.rst:69 -msgid "The setting of :data:`sys.last_exc` was added." +"If *set_sys_last_vars* is nonzero, the variables :data:`sys.last_type`, :" +"data:`sys.last_value` and :data:`sys.last_traceback` will be set to the " +"type, value and traceback of the printed exception, respectively." msgstr "" +"*set_sys_last_vars* が非ゼロであれば、 :data:`sys.last_type`, :data:`sys." +"last_value`, :data:`sys.last_traceback` 変数が、表示される例外のタイプ、値、" +"トレースバックそれぞれに反映されます。" -#: ../../c-api/exceptions.rst:75 +#: ../../c-api/exceptions.rst:70 msgid "Alias for ``PyErr_PrintEx(1)``." msgstr "``PyErr_PrintEx(1)`` のエイリアスです。" -#: ../../c-api/exceptions.rst:80 +#: ../../c-api/exceptions.rst:75 msgid "" "Call :func:`sys.unraisablehook` using the current exception and *obj* " "argument." msgstr "現在の例外と *obj* 引数で :func:`sys.unraisablehook` を呼び出します。" -#: ../../c-api/exceptions.rst:83 +#: ../../c-api/exceptions.rst:78 msgid "" "This utility function prints a warning message to ``sys.stderr`` when an " "exception has been set but it is impossible for the interpreter to actually " "raise the exception. It is used, for example, when an exception occurs in " -"an :meth:`~object.__del__` method." +"an :meth:`__del__` method." msgstr "" +"例外が設定されているがインタプリタが実際に例外を発生させることができないとき" +"に、このユーティリティ関数は警告メッセージを ``sys.stderr`` へ出力します。例" +"えば、例外が :meth:`__del__` メソッドで発生したときに使われます。" -#: ../../c-api/exceptions.rst:88 +#: ../../c-api/exceptions.rst:83 msgid "" "The function is called with a single argument *obj* that identifies the " "context in which the unraisable exception occurred. If possible, the repr of " -"*obj* will be printed in the warning message. If *obj* is ``NULL``, only the " -"traceback is printed." +"*obj* will be printed in the warning message." msgstr "" +"発生させられない例外が起きたコンテキストを指し示す単一の引数 *obj* で関数が呼" +"び出されます。\n" +"可能な場合は、 *obj* の repr 文字列が警告メッセージに出力されます。" -#: ../../c-api/exceptions.rst:93 +#: ../../c-api/exceptions.rst:87 msgid "An exception must be set when calling this function." msgstr "この関数を呼び出すときには、例外がセットされていなければなりません。" -#: ../../c-api/exceptions.rst:95 -msgid "Print a traceback. Print only traceback if *obj* is ``NULL``." -msgstr "" - -#: ../../c-api/exceptions.rst:98 -msgid "Use :func:`sys.unraisablehook`." -msgstr "" - -#: ../../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:123 +#: ../../c-api/exceptions.rst:91 msgid "Raising exceptions" msgstr "例外の送出" -#: ../../c-api/exceptions.rst:125 +#: ../../c-api/exceptions.rst:93 msgid "" "These functions help you set the current thread's error indicator. For " "convenience, some of these functions will always return a ``NULL`` pointer " @@ -211,16 +194,20 @@ msgstr "" "ため、これらの関数のいくつかは、 ``return`` 文で利用できるように常に " "``NULL`` ポインタを返します。" -#: ../../c-api/exceptions.rst:132 +#: ../../c-api/exceptions.rst:100 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, " -"e.g. :c:data:`PyExc_RuntimeError`. You need not create a new :term:`strong " -"reference` to it (e.g. with :c:func:`Py_INCREF`). The second argument is an " -"error message; it is decoded from ``'utf-8'``." +"e.g. :c:data:`PyExc_RuntimeError`. You need not increment its reference " +"count. The second argument is an error message; it is decoded from " +"``'utf-8``'." msgstr "" +"これはエラーインジケータを設定するための最も一般的な方法です。第一引数は例外" +"の型を指定します。通常は標準例外の一つ、例えば :c:data:`PyExc_RuntimeError` " +"です。その参照カウントを増加させる必要はありません。第二引数はエラーメッセー" +"ジで、 ``'utf-8'`` からデコードされます。" -#: ../../c-api/exceptions.rst:141 +#: ../../c-api/exceptions.rst:108 msgid "" "This function is similar to :c:func:`PyErr_SetString` but lets you specify " "an arbitrary Python object for the \"value\" of the exception." @@ -228,7 +215,7 @@ msgstr "" "この関数は :c:func:`PyErr_SetString` に似ていますが、例外の \"値(value)\" と" "して任意のPythonオブジェクトを指定することができます。" -#: ../../c-api/exceptions.rst:147 +#: ../../c-api/exceptions.rst:114 msgid "" "This function sets the error indicator and returns ``NULL``. *exception* " "should be a Python exception class. The *format* and subsequent parameters " @@ -240,7 +227,7 @@ msgstr "" "るためのもので, :c:func:`PyUnicode_FromFormat` の引数と同じ意味を持っていま" "す。 *format* は ASCII エンコードされた文字列です。" -#: ../../c-api/exceptions.rst:156 +#: ../../c-api/exceptions.rst:123 msgid "" "Same as :c:func:`PyErr_Format`, but taking a :c:type:`va_list` argument " "rather than a variable number of arguments." @@ -248,11 +235,11 @@ msgstr "" ":c:func:`PyErr_Format` と同じですが、可変長引数の代わりに :c:type:`va_list` " "引数を受け取ります。" -#: ../../c-api/exceptions.rst:164 +#: ../../c-api/exceptions.rst:131 msgid "This is a shorthand for ``PyErr_SetObject(type, Py_None)``." msgstr "これは ``PyErr_SetObject(type, Py_None)`` を省略したものです。" -#: ../../c-api/exceptions.rst:169 +#: ../../c-api/exceptions.rst:136 msgid "" "This is a shorthand for ``PyErr_SetString(PyExc_TypeError, message)``, where " "*message* indicates that a built-in operation was invoked with an illegal " @@ -262,7 +249,7 @@ msgstr "" "で *message* は組み込み操作が不正な引数で呼び出されたということを表していま" "す。主に内部で使用するためのものです。" -#: ../../c-api/exceptions.rst:176 +#: ../../c-api/exceptions.rst:143 msgid "" "This is a shorthand for ``PyErr_SetNone(PyExc_MemoryError)``; it returns " "``NULL`` so an object allocation function can write ``return " @@ -272,29 +259,44 @@ msgstr "" "ます。したがって、メモリ不足になったとき、オブジェクト割り当て関数は " "``return PyErr_NoMemory();`` と書くことができます。" -#: ../../c-api/exceptions.rst:185 +#: ../../c-api/exceptions.rst:152 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 " "constructs a tuple object whose first item is the integer :c:data:`errno` " "value and whose second item is the corresponding error message (gotten from :" -"c:func:`!strerror`), and then calls ``PyErr_SetObject(type, object)``. On " -"Unix, when the :c:data:`errno` value is :c:macro:`!EINTR`, indicating an " +"c:func:`strerror`), and then calls ``PyErr_SetObject(type, object)``. On " +"Unix, when the :c:data:`errno` value is :const:`EINTR`, indicating an " "interrupted system call, this calls :c:func:`PyErr_CheckSignals`, and if " "that set the error indicator, leaves it set to that. The function always " "returns ``NULL``, so a wrapper function around a system call can write " "``return PyErr_SetFromErrno(type);`` when the system call returns an error." msgstr "" +"Cライブラリ関数がエラーを返してC変数 :c:data:`errno` を設定したときに、これは" +"例外を発生させるために便利な関数です。第一要素が整数 :c:data:`errno` 値で、第" +"二要素が (:c:func:`strerror` から得られる)対応するエラーメッセージであるタプ" +"ルオブジェクトを構成します。それから、 ``PyErr_SetObject(type, object)`` を呼" +"び出します。 Unixでは、 :c:data:`errno` 値が :const:`EINTR` であるとき、すな" +"わち割り込まれたシステムコールを表しているとき、これは :c:func:" +"`PyErr_CheckSignals` を呼び出し、それがエラーインジケータを設定した場合は設定" +"されたままにしておきます。関数は常に ``NULL`` を返します。したがって、システ" +"ムコールがエラーを返したとき、システムコールのラッパー関数は ``return " +"PyErr_SetFromErrno(type);`` と書くことができます。" -#: ../../c-api/exceptions.rst:199 +#: ../../c-api/exceptions.rst:166 msgid "" "Similar to :c:func:`PyErr_SetFromErrno`, with the additional behavior that " "if *filenameObject* is not ``NULL``, it is passed to the constructor of " "*type* as a third parameter. In the case of :exc:`OSError` exception, this " -"is used to define the :attr:`!filename` attribute of the exception instance." +"is used to define the :attr:`filename` attribute of the exception instance." msgstr "" +":c:func:`PyErr_SetFromErrno` に似ていますが、 *filenameObject* が ``NULL`` で" +"ない場合に、 *type* のコンストラクタに第三引数として渡すというふるまいが追加" +"されています。\n" +":exc:`OSError` 例外の場合では、 *filenameObject* が例外インスタンスの :attr:" +"`filename` 属性を定義するのに使われます。" -#: ../../c-api/exceptions.rst:208 +#: ../../c-api/exceptions.rst:175 msgid "" "Similar to :c:func:`PyErr_SetFromErrnoWithFilenameObject`, but takes a " "second filename object, for raising errors when a function that takes two " @@ -304,38 +306,45 @@ msgstr "" "取る関数が失敗したときに例外を送出するために、2つ目のファイル名オブジェクトを" "受け取ります。" -#: ../../c-api/exceptions.rst:217 +#: ../../c-api/exceptions.rst:184 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`." +"is given as a C string. *filename* is decoded from the filesystem encoding " +"(:func:`os.fsdecode`)." msgstr "" ":c:func:`PyErr_SetFromErrnoWithFilenameObject` に似ていますが、ファイル名は " "C 文字列として与えられます。\n" -"*filename* は :term:`ファイルシステムのエンコーディングとエラーハンドラ " -"` でデコードされます。" - -#: ../../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:`!" -"GetLastError` is used instead. It calls the Win32 function :c:func:`!" -"FormatMessage` to retrieve the Windows description of error code given by " -"*ierr* or :c:func:`!GetLastError`, then it constructs a :exc:`OSError` " -"object with the :attr:`~OSError.winerror` attribute set to the error code, " -"the :attr:`~OSError.strerror` attribute set to the corresponding error " -"message (gotten from :c:func:`!FormatMessage`), and then calls " -"``PyErr_SetObject(PyExc_OSError, object)``. This function always returns " -"``NULL``." -msgstr "" - -#: ../../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:239 +"*filename* はファイルシステムのエンコーディング (:func:`os.fsdecode`) でデ" +"コードされます。" + +#: ../../c-api/exceptions.rst:191 +msgid "" +"This is a convenience function to raise :exc:`WindowsError`. If called with " +"*ierr* of :c:data:`0`, the error code returned by a call to :c:func:" +"`GetLastError` is used instead. It calls the Win32 function :c:func:" +"`FormatMessage` to retrieve the Windows description of error code given by " +"*ierr* or :c:func:`GetLastError`, then it constructs a tuple object whose " +"first item is the *ierr* value and whose second item is the corresponding " +"error message (gotten from :c:func:`FormatMessage`), and then calls " +"``PyErr_SetObject(PyExc_WindowsError, object)``. This function always " +"returns ``NULL``." +msgstr "" +"これは :exc:`WindowsError` を発生させるために便利な関数です。 :c:data:`0` の " +"*ierr* とともに呼び出された場合、 :c:func:`GetLastError` が返すエラーコードが" +"代りに使われます。 *ierr* あるいは :c:func:`GetLastError` によって与えられる" +"エラーコードのWindows用の説明を取り出すために、Win32関数 :c:func:" +"`FormatMessage` を呼び出します。それから、第一要素が *ierr* 値で第二要素が(:" +"c:func:`FormatMessage` から得られる) 対応するエラーメッセージであるタプルオブ" +"ジェクトを構成します。そして、 ``PyErr_SetObject(PyExc_WindowsError, " +"object)`` を呼び出します。この関数は常に ``NULL`` を返します。" + +#: ../../c-api/exceptions.rst:200 ../../c-api/exceptions.rst:208 +#: ../../c-api/exceptions.rst:217 ../../c-api/exceptions.rst:225 +#: ../../c-api/exceptions.rst:234 ../../c-api/exceptions.rst:243 +msgid ":ref:`Availability `: Windows." +msgstr ":ref:`利用可能な環境 `: Windows 。" + +#: ../../c-api/exceptions.rst:205 msgid "" "Similar to :c:func:`PyErr_SetFromWindowsErr`, with an additional parameter " "specifying the exception type to be raised." @@ -343,24 +352,26 @@ msgstr "" ":c:func:`PyErr_SetFromWindowsErr` に似ていますが、送出する例外の型を指定する" "引数が追加されています。" -#: ../../c-api/exceptions.rst:247 +#: ../../c-api/exceptions.rst:213 msgid "" -"Similar to :c:func:`PyErr_SetFromWindowsErr`, with the additional behavior " -"that if *filename* is not ``NULL``, it is decoded from the filesystem " -"encoding (:func:`os.fsdecode`) and passed to the constructor of :exc:" -"`OSError` as a third parameter to be used to define the :attr:`!filename` " -"attribute of the exception instance." +"Similar to :c:func:`PyErr_SetFromWindowsErrWithFilenameObject`, but the " +"filename is given as a C string. *filename* is decoded from the filesystem " +"encoding (:func:`os.fsdecode`)." msgstr "" +":c:func:`PyErr_SetFromWindowsErrWithFilenameObject` に似ていますが、ファイル" +"名は C 文字列として与えられます。\n" +"*filename* はファイルシステムのエンコーディング (:func:`os.fsdecode`) でデ" +"コードされます。" -#: ../../c-api/exceptions.rst:258 +#: ../../c-api/exceptions.rst:222 msgid "" -"Similar to :c:func:`PyErr_SetExcFromWindowsErr`, with the additional " -"behavior that if *filename* is not ``NULL``, it is passed to the constructor " -"of :exc:`OSError` as a third parameter to be used to define the :attr:`!" -"filename` attribute of the exception instance." +"Similar to :c:func:`PyErr_SetFromWindowsErrWithFilenameObject`, with an " +"additional parameter specifying the exception type to be raised." msgstr "" +":c:func:`PyErr_SetFromWindowsErrWithFilenameObject` に似ていますが、送出する" +"例外の型を指定する引数が追加されています。" -#: ../../c-api/exceptions.rst:268 +#: ../../c-api/exceptions.rst:230 msgid "" "Similar to :c:func:`PyErr_SetExcFromWindowsErrWithFilenameObject`, but " "accepts a second filename object." @@ -368,7 +379,7 @@ msgstr "" ":c:func:`PyErr_SetExcFromWindowsErrWithFilenameObject` に似てますが、2つ目の" "ファイル名オブジェクトを受け取ります。" -#: ../../c-api/exceptions.rst:278 +#: ../../c-api/exceptions.rst:240 msgid "" "Similar to :c:func:`PyErr_SetFromWindowsErrWithFilename`, with an additional " "parameter specifying the exception type to be raised." @@ -376,7 +387,7 @@ msgstr "" ":c:func:`PyErr_SetFromWindowsErrWithFilename` に似ていますが、送出する例外の" "型を指定する引数が追加されています。" -#: ../../c-api/exceptions.rst:286 +#: ../../c-api/exceptions.rst:248 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 " @@ -388,15 +399,7 @@ msgstr "" "く、それぞれ :exc:`ImportError` の ``name`` 属性と ``path`` 属性としてセット" "されます。" -#: ../../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:func:`PyErr_SetImportError` とよく似ていますが、この関数は送出する例外とし" -"て、 :exc:`ImportError` のサブクラスを指定できます。" - -#: ../../c-api/exceptions.rst:304 +#: ../../c-api/exceptions.rst:258 msgid "" "Set file, line, and offset information for the current exception. If the " "current exception is not a :exc:`SyntaxError`, then it sets additional " @@ -407,24 +410,24 @@ msgstr "" "現在の例外が :exc:`SyntaxError` でない場合は、例外を表示するサブシステムが、" "例外が :exc:`SyntaxError` であると思えるように属性を追加します。" -#: ../../c-api/exceptions.rst:314 +#: ../../c-api/exceptions.rst:268 msgid "" "Like :c:func:`PyErr_SyntaxLocationObject`, but *filename* is a byte string " -"decoded from the :term:`filesystem encoding and error handler`." +"decoded from the filesystem encoding (:func:`os.fsdecode`)." msgstr "" -":c:func:`PyErr_SyntaxLocationObject` と似ていますが、 *filename* は :term:`" -"ファイルシステムのエンコーディングとエラーハンドラ ` でデコードされたバイト文字列です。" +":c:func:`PyErr_SyntaxLocationObject` と似ていますが、 *filename* はファイルシ" +"ステムのエンコーディングでデコードされた (:func:`os.fsdecode`) バイト文字列で" +"す。" -#: ../../c-api/exceptions.rst:322 +#: ../../c-api/exceptions.rst:276 msgid "" -"Like :c:func:`PyErr_SyntaxLocationEx`, but the *col_offset* parameter is " +"Like :c:func:`PyErr_SyntaxLocationEx`, but the col_offset parameter is " "omitted." msgstr "" -":c:func:`PyErr_SyntaxLocationEx` と似ていますが、 *col_offset* 引数が除去され" -"ています。" +":c:func:`PyErr_SyntaxLocationEx` と似ていますが、 col_offset 引数が除去されて" +"います。" -#: ../../c-api/exceptions.rst:328 +#: ../../c-api/exceptions.rst:282 msgid "" "This is a shorthand for ``PyErr_SetString(PyExc_SystemError, message)``, " "where *message* indicates that an internal operation (e.g. a Python/C API " @@ -435,11 +438,11 @@ msgstr "" "*message* は内部操作(例えば、Python/C API関数)が不正な引数とともに呼び出され" "たということを示しています。主に内部で使用するためのものです。" -#: ../../c-api/exceptions.rst:335 +#: ../../c-api/exceptions.rst:289 msgid "Issuing warnings" msgstr "警告" -#: ../../c-api/exceptions.rst:337 +#: ../../c-api/exceptions.rst:291 msgid "" "Use these functions to issue warnings from C code. They mirror similar " "functions exported by the Python :mod:`warnings` module. They normally " @@ -468,7 +471,7 @@ msgstr "" "例外が送出された場合、呼び出し元は通常の例外処理を行います (例えば、保持して" "いた参照に対し :c:func:`Py_DECREF` を行い、エラー値を返します)。" -#: ../../c-api/exceptions.rst:352 +#: ../../c-api/exceptions.rst:306 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. " @@ -484,7 +487,7 @@ msgstr "" "`PyErr_WarnEx` を呼び出している関数が、2 だとその上の関数が Warning の発行元" "になります。" -#: ../../c-api/exceptions.rst:359 +#: ../../c-api/exceptions.rst:313 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 " @@ -498,7 +501,7 @@ msgstr "" "標準の Python 警告カテゴリは、 :ref:`standardwarningcategories` で名前が列挙" "されているグローバル変数として利用可能です。" -#: ../../c-api/exceptions.rst:365 +#: ../../c-api/exceptions.rst:319 msgid "" "For information about warning control, see the documentation for the :mod:" "`warnings` module and the :option:`-W` option in the command line " @@ -508,11 +511,19 @@ msgstr "" "キュメンテーションとコマンドライン・ドキュメンテーションの :option:`-W` オプ" "ションを参照してください。警告コントロールのためのC APIはありません。" -#: ../../c-api/exceptions.rst:372 +#: ../../c-api/exceptions.rst:325 +msgid "" +"Much like :c:func:`PyErr_SetImportError` but this function allows for " +"specifying a subclass of :exc:`ImportError` to raise." +msgstr "" +":c:func:`PyErr_SetImportError` とよく似ていますが、この関数は送出する例外とし" +"て、 :exc:`ImportError` のサブクラスを指定できます。" + +#: ../../c-api/exceptions.rst:333 msgid "" "Issue a warning message with explicit control over all warning attributes. " "This is a straightforward wrapper around the Python function :func:`warnings." -"warn_explicit`; see there for more information. The *module* and *registry* " +"warn_explicit`, see there for more information. The *module* and *registry* " "arguments may be set to ``NULL`` to get the default effect described there." msgstr "" "すべての警告の属性を明示的に制御した警告メッセージを出します。これは Python " @@ -520,18 +531,17 @@ msgstr "" "はそちらを参照してください。そこに説明されているデフォルトの効果を得るため" "に、 *module* と *registry* 引数は ``NULL`` に設定することができます。" -#: ../../c-api/exceptions.rst:383 +#: ../../c-api/exceptions.rst:344 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`." +"*module* are UTF-8 encoded strings, and *filename* is decoded from the " +"filesystem encoding (:func:`os.fsdecode`)." msgstr "" ":c:func:`PyErr_WarnExplicitObject` に似ていますが、 *message* と *module* が " -"UTF-8 エンコードされた文字列であるところが異なり、 *filename* は :term:`ファ" -"イルシステムのエンコーディングとエラーハンドラ ` でデコードされます。" +"UTF-8 エンコードされた文字列であるところが異なり、 *filename* はファイルシス" +"テムのエンコーディング (:func:`os.fsdecode`) でデコードされます。" -#: ../../c-api/exceptions.rst:390 +#: ../../c-api/exceptions.rst:351 msgid "" "Function similar to :c:func:`PyErr_WarnEx`, but use :c:func:" "`PyUnicode_FromFormat` to format the warning message. *format* is an ASCII-" @@ -541,36 +551,38 @@ msgstr "" "るのに :c:func:`PyUnicode_FromFormat` を使用します。 *format* は ASCII にエン" "コードされた文字列です。" -#: ../../c-api/exceptions.rst:399 +#: ../../c-api/exceptions.rst:360 msgid "" "Function similar to :c:func:`PyErr_WarnFormat`, but *category* is :exc:" -"`ResourceWarning` and it passes *source* to :class:`!warnings." -"WarningMessage`." +"`ResourceWarning` and it passes *source* to :func:`warnings.WarningMessage`." msgstr "" +":c:func:`PyErr_WarnFormat` に似た関数ですが、*category* は :exc:" +"`ResourceWarning` になり、*source* は :func:`warnings.WarningMessage` に渡さ" +"れます。" -#: ../../c-api/exceptions.rst:406 +#: ../../c-api/exceptions.rst:367 msgid "Querying the error indicator" msgstr "エラーインジケータの問い合わせ" -#: ../../c-api/exceptions.rst:410 +#: ../../c-api/exceptions.rst:371 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*`` " -"functions or to :c:func:`PyErr_Restore`). If not set, return ``NULL``. You " -"do not own a reference to the return value, so you do not need to :c:func:" -"`Py_DECREF` it." +"*type* (the first argument to the last call to one of the :c:func:" +"`PyErr_Set\\*` functions or to :c:func:`PyErr_Restore`). If not set, return " +"``NULL``. You do not own a reference to the return value, so you do not " +"need to :c:func:`Py_DECREF` it." msgstr "" "エラーインジケータが設定されているかテストします。設定されている場合は、例外" -"の *型* (``PyErr_Set*`` 関数の一つあるいは :c:func:`PyErr_Restore` への最も新" -"しい呼び出しに対する第一引数)を返します。設定されていない場合は ``NULL`` を返" -"します。あなたは戻り値への参照を持っていませんので、それに :c:func:" -"`Py_DECREF` する必要はありません。" +"の *型* (:c:func:`PyErr_Set\\*` 関数の一つあるいは :c:func:`PyErr_Restore` へ" +"の最も新しい呼び出しに対する第一引数)を返します。設定されていない場合は " +"``NULL`` を返します。あなたは戻り値への参照を持っていませんので、それに :c:" +"func:`Py_DECREF` する必要はありません。" -#: ../../c-api/exceptions.rst:416 -msgid "The caller must have an :term:`attached thread state`." -msgstr "" +#: ../../c-api/exceptions.rst:377 +msgid "The caller must hold the GIL." +msgstr "呼び出し側はGILを獲得する必要があります" -#: ../../c-api/exceptions.rst:420 +#: ../../c-api/exceptions.rst:381 msgid "" "Do not compare the return value to a specific exception; use :c:func:" "`PyErr_ExceptionMatches` instead, shown below. (The comparison could easily " @@ -582,7 +594,7 @@ msgstr "" "ぜなら、例外はクラスではなくインスタンスかもしれないし、あるいは、クラス例外" "の場合は期待される例外のサブクラスかもしれないからです。)" -#: ../../c-api/exceptions.rst:428 +#: ../../c-api/exceptions.rst:389 msgid "" "Equivalent to ``PyErr_GivenExceptionMatches(PyErr_Occurred(), exc)``. This " "should only be called when an exception is actually set; a memory access " @@ -592,7 +604,7 @@ msgstr "" "定されたときにだけ、これを呼び出だすべきです。例外が発生していないならば、メ" "モリアクセス違反が起きるでしょう。" -#: ../../c-api/exceptions.rst:435 +#: ../../c-api/exceptions.rst:396 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 " @@ -605,65 +617,7 @@ msgstr "" "*exc* がタプルの場合は、タプルにある (およびそのサブタプルに再帰的にある) す" "べての例外型が適合するか調べられます。" -#: ../../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 "" -"現在発生している例外を返し、同時にエラーインジケータを消去します。エラーイン" -"ジケータが設定されていない場合は ``NULL`` を返します。" - -#: ../../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:449 ../../c-api/exceptions.rst:493 -msgid "For example::" -msgstr "例えば::" - -#: ../../c-api/exceptions.rst:451 -msgid "" -"{\n" -" PyObject *exc = PyErr_GetRaisedException();\n" -"\n" -" /* ... code that might produce other errors ... */\n" -"\n" -" PyErr_SetRaisedException(exc);\n" -"}" -msgstr "" -"{\n" -" PyObject *exc = PyErr_GetRaisedException();\n" -"\n" -" /* ... 他のエラーを発生させる可能性があるコード ... */\n" -"\n" -" PyErr_SetRaisedException(exc);\n" -"}" - -#: ../../c-api/exceptions.rst:459 -msgid "" -":c:func:`PyErr_GetHandledException`, to save the exception currently being " -"handled." -msgstr "" - -#: ../../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:472 -msgid "This call steals a reference to *exc*, which must be a valid exception." -msgstr "" - -#: ../../c-api/exceptions.rst:481 -msgid "Use :c:func:`PyErr_GetRaisedException` instead." -msgstr "" - -#: ../../c-api/exceptions.rst:483 +#: ../../c-api/exceptions.rst:404 msgid "" "Retrieve the error indicator into three variables whose addresses are " "passed. If the error indicator is not set, set all three variables to " @@ -677,55 +631,50 @@ msgstr "" "れのオブジェクトへの参照を持つことになります。型オブジェクトが ``NULL`` でな" "いときでさえ、その値とトレースバックオブジェクトは ``NULL`` かもしれません。" -#: ../../c-api/exceptions.rst:490 +#: ../../c-api/exceptions.rst:411 msgid "" -"This function is normally only used by legacy code that needs to catch " -"exceptions or save and restore the error indicator temporarily." +"This function is normally only used by code that needs to catch exceptions " +"or by code that needs to save and restore the error indicator temporarily, e." +"g.::" msgstr "" +"通常、この関数は例外を捕捉する必要のあるコードや、エラーインジケータを一時的" +"に保存して復元する必要のあるコードでのみ使います。" -#: ../../c-api/exceptions.rst:495 +#: ../../c-api/exceptions.rst:426 msgid "" -"{\n" -" PyObject *type, *value, *traceback;\n" -" PyErr_Fetch(&type, &value, &traceback);\n" -"\n" -" /* ... code that might produce other errors ... */\n" -"\n" -" PyErr_Restore(type, value, traceback);\n" -"}" +"Set the error indicator from the three objects. If the error indicator is " +"already set, it is cleared first. If the objects are ``NULL``, the error " +"indicator is cleared. Do not pass a ``NULL`` type and non-``NULL`` value or " +"traceback. The exception type should be a class. Do not pass an invalid " +"exception type or value. (Violating these rules will cause subtle problems " +"later.) This call takes away a reference to each object: you must own a " +"reference to each object before the call and after the call you no longer " +"own these references. (If you don't understand this, don't use this " +"function. I warned you.)" msgstr "" +"三つのオブジェクトからエラーインジケータを設定します。エラーインジケータがす" +"でに設定されている場合は、最初にクリアされます。オブジェクトが ``NULL`` なら" +"ば、エラーインジケータがクリアされます。``NULL`` のtypeと非 ``NULL`` のvalue" +"あるいは tracebackを渡してはいけません。例外の型(type)はクラスであるべきで" +"す。無効な例外の型(type)あるいは値(value)を渡してはいけません。(これらの規則" +"を破ると後で気付きにくい問題の原因となるでしょう。) この呼び出しはそれぞれの" +"オブジェクトへの参照を取り除きます: あなたは呼び出しの前にそれぞれのオブジェ" +"クトへの参照を持たなければならないのであり、また呼び出しの後にはもはやこれら" +"の参照を持っていません。(これを理解していない場合は、この関数を使ってはいけま" +"せん。注意しておきます。)" -#: ../../c-api/exceptions.rst:509 -msgid "Use :c:func:`PyErr_SetRaisedException` instead." -msgstr "" - -#: ../../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 " -"are ``NULL``, the error indicator is cleared. Do not pass a ``NULL`` type " -"and non-``NULL`` value or traceback. The exception type should be a class. " -"Do not pass an invalid exception type or value. (Violating these rules will " -"cause subtle problems later.) This call takes away a reference to each " -"object: you must own a reference to each object before the call and after " -"the call you no longer own these references. (If you don't understand this, " -"don't use this function. I warned you.)" -msgstr "" - -#: ../../c-api/exceptions.rst:525 +#: ../../c-api/exceptions.rst:438 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." +"This function is normally only used by code that needs to save and restore " +"the error indicator temporarily. Use :c:func:`PyErr_Fetch` to save the " +"current error indicator." msgstr "" +"通常、この関数はエラーインジケータを一時的に保存し復元する必要のあるコードで" +"のみ使います。\n" +"現在のエラーインジケータを保存するためには :c:func:`PyErr_Fetch` を使ってくだ" +"さい。" -#: ../../c-api/exceptions.rst:534 -msgid "" -"Use :c:func:`PyErr_GetRaisedException` instead, to avoid any possible de-" -"normalization." -msgstr "" - -#: ../../c-api/exceptions.rst:537 +#: ../../c-api/exceptions.rst:445 msgid "" "Under certain circumstances, the values returned by :c:func:`PyErr_Fetch` " "below can be \"unnormalized\", meaning that ``*exc`` is a class object but " @@ -741,70 +690,30 @@ msgstr "" "は何も起きません。遅延正規化はパフォーマンスを改善するために実装されていま" "す。" -#: ../../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:550 -msgid "" -"if (tb != NULL) {\n" -" PyException_SetTraceback(val, tb);\n" -"}" -msgstr "" - -#: ../../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 " -"exception that was freshly raised. Returns a new reference to the exception " -"or ``NULL``. Does not modify the interpreter's exception state." -msgstr "" - -#: ../../c-api/exceptions.rst:564 +#: ../../c-api/exceptions.rst:453 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 " -"state temporarily. Use :c:func:`PyErr_SetHandledException` to restore or " -"clear the exception state." -msgstr "" -"この関数は、通常は例外を扱うコードでは使用されません。正確に言うと、これは例" -"外の状態を一時的に保存し、元に戻す必要があるコードで使用することができます。" -"例外の状態を元に戻す、もしくはクリアするには :c:func:" -"`PyErr_SetHandledException` を使ってください。" - -#: ../../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: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 " -"state temporarily. Use :c:func:`PyErr_GetHandledException` to get the " -"exception state." +"This function *does not* implicitly set the ``__traceback__`` attribute on " +"the exception value. If setting the traceback appropriately is desired, the " +"following additional snippet is needed::" msgstr "" -"この関数は、通常は例外を扱うコードでは使用されません。正確に言うと、これは例" -"外の状態を一時的に保存し、元に戻す必要があるコードで使用することができます。" -"例外の状態を取得するには :c:func:`PyErr_GetHandledException` を使ってくださ" -"い。" +"この関数は例外値に暗黙的に ``__traceback__`` 属性を設定 *しません* 。\n" +"トレースバックを適切に設定する必要がある場合は、次の追加のコード片が必要で" +"す::" -#: ../../c-api/exceptions.rst:589 +#: ../../c-api/exceptions.rst:464 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*, " -"not to an exception that was freshly raised. Returns new references for the " -"three objects, any of which may be ``NULL``. Does not modify the exception " -"info state. This function is kept for backwards compatibility. Prefer " -"using :c:func:`PyErr_GetHandledException`." +"Retrieve 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 raised. Returns new references for the three objects, any of which " +"may be ``NULL``. Does not modify the exception info state." msgstr "" +"``sys.exc_info()`` で得られる例外情報を取得します。\n" +"これは *既に捕まえた* 例外を参照するもので、新たに送出された例外への参照は" +"持っていません。\n" +"新しい3つのオブジェクトへの参照を返しますが、その中には ``NULL`` があるかもし" +"れません。この関数は例外情報の状態を変更しません。" -#: ../../c-api/exceptions.rst:598 +#: ../../c-api/exceptions.rst:471 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 " @@ -816,17 +725,24 @@ msgstr "" "例外の状態を元に戻す、もしくはクリアするには :c:func:`PyErr_SetExcInfo` を" "使ってください。" -#: ../../c-api/exceptions.rst:608 +#: ../../c-api/exceptions.rst:481 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 " "raised. This function steals the references of the arguments. To clear the " -"exception state, pass ``NULL`` for all three arguments. This function is " -"kept for backwards compatibility. Prefer using :c:func:" -"`PyErr_SetHandledException`." -msgstr "" +"exception state, pass ``NULL`` for all three arguments. For general rules " +"about the three arguments, see :c:func:`PyErr_Restore`." +msgstr "" +"``sys.exc_info()`` で得られる例外情報を設定します。\n" +"これは *既に捕まえた* 例外を参照するもので、新たに送出された例外への参照は" +"持っていません。\n" +"この関数は引数への参照を盗みます。\n" +"例外の状態をクリアしたい場合は、3 つ全ての引数に ``NULL`` を渡してくださ" +"い。\n" +"3 つの引数についての一般的な規則は、 :c:func:`PyErr_Restore` を参照してくださ" +"い。" -#: ../../c-api/exceptions.rst:617 +#: ../../c-api/exceptions.rst:489 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 " @@ -837,100 +753,49 @@ msgstr "" "外の状態を一時的に保存し、元に戻す必要があるコードで使用することができます。" "例外の状態を取得するには :c:func:`PyErr_GetExcInfo` を使ってください。" -#: ../../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:632 +#: ../../c-api/exceptions.rst:498 msgid "Signal Handling" msgstr "シグナルハンドリング" -#: ../../c-api/exceptions.rst:642 -msgid "This function interacts with Python's signal handling." -msgstr "" - -#: ../../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 " -"if so, invokes the corresponding signal handler. If the :mod:`signal` " -"module is supported, this can invoke a signal handler written in Python." -msgstr "" - -#: ../../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 " -"is set and the function returns ``-1`` immediately (such that other pending " -"signals may not have been handled yet: they will be on the next :c:func:" -"`PyErr_CheckSignals()` invocation)." -msgstr "" - -#: ../../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: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:662 -msgid "" -"The default Python signal handler for :c:macro:`!SIGINT` raises the :exc:" -"`KeyboardInterrupt` exception." -msgstr "" - -#: ../../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:677 ../../c-api/exceptions.rst:704 -msgid "" -"This function is async-signal-safe. It can be called without an :term:" -"`attached thread state` and from a C signal handler." -msgstr "" - -#: ../../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 "" -"シグナルが到達した効果をシミュレートします。\n" -"次に :c:func:`PyErr_CheckSignals` が呼ばれたとき、与えられたシグナル番号用の " +#: ../../c-api/exceptions.rst:508 +msgid "" +"This function interacts with Python's signal handling. It checks whether a " +"signal has been sent to the processes and if so, invokes the corresponding " +"signal handler. If the :mod:`signal` module is supported, this can invoke a " +"signal handler written in Python. In all cases, the default effect for :" +"const:`SIGINT` is to raise the :exc:`KeyboardInterrupt` exception. If an " +"exception is raised the error indicator is set and the function returns " +"``-1``; otherwise the function returns ``0``. The error indicator may or " +"may not be cleared if it was previously set." +msgstr "" +"この関数はPythonのシグナル処理とやりとりすることができます。シグナルがそのプ" +"ロセスへ送られたかどうかチェックし、そうならば対応するシグナルハンドラを呼び" +"出します。 :mod:`signal` モジュールがサポートされている場合は、これはPythonで" +"書かれたシグナルハンドラを呼び出せます。すべての場合で、 :const:`SIGINT` のデ" +"フォルトの効果は :exc:`KeyboardInterrupt` 例外を発生させることです。例外が発" +"生した場合、エラーインジケータが設定され、関数は ``-1`` を返します。そうでな" +"ければ、関数は ``0`` を返します。エラーインジケータが以前に設定されている場合" +"は、それがクリアされるかどうかわからない。" + +#: ../../c-api/exceptions.rst:524 +msgid "" +"Simulate the effect of a :const:`SIGINT` signal arriving. The next time :c:" +"func:`PyErr_CheckSignals` is called, the Python signal handler for :const:" +"`SIGINT` will be called." +msgstr "" +":const:`SIGINT` シグナルが到達した効果をシミュレートします。\n" +"次に :c:func:`PyErr_CheckSignals` が呼ばれたとき、 :const:`SIGINT` 用の " "Python のシグナルハンドラが呼び出されます。" -#: ../../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 " -"interruption is requested (for example when the user presses Ctrl-C to " -"interrupt an operation)." -msgstr "" - -#: ../../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:699 +#: ../../c-api/exceptions.rst:528 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." +"If :const:`SIGINT` isn't handled by Python (it was set to :data:`signal." +"SIG_DFL` or :data:`signal.SIG_IGN`), this function does nothing." msgstr "" +":const:`SIGINT` が Python に対処されなかった (:data:`signal.SIG_DFL` または :" +"data:`signal.SIG_IGN` に設定されていた) 場合、この関数は何もしません。" -#: ../../c-api/exceptions.rst:712 +#: ../../c-api/exceptions.rst:534 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-" @@ -941,7 +806,7 @@ msgstr "" "*fd* はノンブロッキングでなければなりません。\n" "この関数は、1つ前のファイル記述子を返します。" -#: ../../c-api/exceptions.rst:716 +#: ../../c-api/exceptions.rst:538 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 " @@ -954,15 +819,15 @@ msgstr "" "*fd* は有効なファイル記述子であるべきです。\n" "この関数はメインスレッドからのみ呼び出されるべきです。" -#: ../../c-api/exceptions.rst:721 +#: ../../c-api/exceptions.rst:543 msgid "On Windows, the function now also supports socket handles." msgstr "Windowsで、この関数はソケットハンドルをサポートするようになりました。" -#: ../../c-api/exceptions.rst:726 +#: ../../c-api/exceptions.rst:548 msgid "Exception Classes" msgstr "例外クラス" -#: ../../c-api/exceptions.rst:730 +#: ../../c-api/exceptions.rst:552 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 " @@ -976,17 +841,22 @@ msgstr "" "組み込み名 :exc:`Exception` (Cでは :c:data:`PyExc_Exception` としてアクセス可" "能)をルートとして派生したクラスオブジェクトを作成します。" -#: ../../c-api/exceptions.rst:736 +#: ../../c-api/exceptions.rst:558 msgid "" -"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 " +"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 " "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 "" +"新しいクラスの :attr:`__module__` 属性は *name* 引数の前半部分(最後のドットま" +"で)に設定され、クラス名は後半部分(最後のドットの後)に設定されます。 *base* 引" +"数は代わりのベースクラスを指定するために使えます; 一つのクラスでも、クラスの" +"タプルでも構いません。 *dict* 引数はクラス変数とメソッドの辞書を指定するため" +"に使えます。" -#: ../../c-api/exceptions.rst:745 +#: ../../c-api/exceptions.rst:567 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 " @@ -996,21 +866,21 @@ msgstr "" "docstring を設定できます。 *doc* が ``NULL`` で無い場合、それが例外クラスの " "docstring になります。" -#: ../../c-api/exceptions.rst:753 +#: ../../c-api/exceptions.rst:575 msgid "Exception Objects" msgstr "例外オブジェクト" -#: ../../c-api/exceptions.rst:757 +#: ../../c-api/exceptions.rst:579 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``." +"accessible from Python through :attr:`__traceback__`. If there is no " +"traceback associated, this returns ``NULL``." msgstr "" -"Python で :attr:`~BaseException.__traceback__` 属性からアクセスできるものと同" -"じ、例外に関する traceback の新しい参照を返します。関係する traceback が無い" -"場合は、 ``NULL`` を返します。" +"Python で :attr:`__traceback__` 属性からアクセスできるものと同じ、例外に関す" +"る traceback の新しい参照を返します。関係する traceback が無い場合は、 " +"``NULL`` を返します。" -#: ../../c-api/exceptions.rst:765 +#: ../../c-api/exceptions.rst:586 msgid "" "Set the traceback associated with the exception to *tb*. Use ``Py_None`` to " "clear it." @@ -1018,15 +888,18 @@ msgstr "" "その例外に関する traceback に *tb* をセットします。クリアするには " "``Py_None`` を使用してください。" -#: ../../c-api/exceptions.rst:771 +#: ../../c-api/exceptions.rst:592 msgid "" "Return the context (another exception instance during whose handling *ex* " "was raised) associated with the exception as a new reference, as accessible " -"from Python through the :attr:`~BaseException.__context__` attribute. If " -"there is no context associated, this returns ``NULL``." +"from Python through :attr:`__context__`. If there is no context associated, " +"this returns ``NULL``." msgstr "" +"Python で :attr:`__context__` 属性からアクセスできるものと同じ、例外に関する" +"コンテキスト (*ex* が送出されたときに処理していた別の例外インスタンス) の新し" +"い参照を返します。関係するコンテキストが無い場合は、 ``NULL`` を返します。" -#: ../../c-api/exceptions.rst:779 +#: ../../c-api/exceptions.rst:600 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 " @@ -1036,59 +909,47 @@ msgstr "" "用してください。*ctx* が例外インスタンスかどうかを確かめる型チェックは行われ" "ません。これは *ctx* への参照を盗みます。" -#: ../../c-api/exceptions.rst:786 +#: ../../c-api/exceptions.rst:607 msgid "" -"Return the cause (either an exception instance, or ``None``, set by " +"Return the cause (either an exception instance, or :const:`None`, set by " "``raise ... from ...``) associated with the exception as a new reference, as " -"accessible from Python through the :attr:`~BaseException.__cause__` " -"attribute." +"accessible from Python through :attr:`__cause__`." msgstr "" +"Python で :attr:`__cause__` 属性からアクセスできるものと同じ、例外に関する原" +"因 (``raise ... from ...`` によってセットされる例外インスタンス、もしくは :" +"const:`None`) の新しい参照を返します。" -#: ../../c-api/exceptions.rst:794 +#: ../../c-api/exceptions.rst:614 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*." +"exception instance or :const:`None`. This steals a reference to *cause*." msgstr "" +"例外に関係する原因に *cause* をセットします。\n" +"クリアするには ``NULL`` を使用してください。\n" +"*cause* が例外インスタンスか :const:`None` のどちらかであることを確かめる型" +"チェックは行われません。\n" +"これは *cause* への参照を盗みます。" -#: ../../c-api/exceptions.rst:798 +#: ../../c-api/exceptions.rst:618 msgid "" -"The :attr:`~BaseException.__suppress_context__` attribute is implicitly set " -"to ``True`` by this function." +":attr:`__suppress_context__` is implicitly set to ``True`` by this function." msgstr "" +"この関数によって暗黙的に :attr:`__suppress_context__` に ``True`` がセットさ" +"れます。" -#: ../../c-api/exceptions.rst:804 -msgid "Return :attr:`~BaseException.args` of exception *ex*." -msgstr "" - -#: ../../c-api/exceptions.rst:809 -msgid "Set :attr:`~BaseException.args` of exception *ex* to *args*." -msgstr "" - -#: ../../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 " -"the exceptions that need to be raised. This list contains the unhandled part " -"of *orig*, if any, as well as the exceptions that were raised from the :" -"keyword:`!except*` clauses (so they have a different traceback from *orig*) " -"and those that were reraised (and have the same traceback as *orig*). Return " -"the :exc:`ExceptionGroup` that needs to be reraised in the end, or ``None`` " -"if there is nothing to reraise." -msgstr "" - -#: ../../c-api/exceptions.rst:827 +#: ../../c-api/exceptions.rst:624 msgid "Unicode Exception Objects" msgstr "Unicode 例外オブジェクト" -#: ../../c-api/exceptions.rst:829 +#: ../../c-api/exceptions.rst:626 msgid "" "The following functions are used to create and modify Unicode exceptions " "from C." msgstr "" "以下の関数は C言語から Unicode 例外を作ったり修正したりするために利用します。" -#: ../../c-api/exceptions.rst:833 +#: ../../c-api/exceptions.rst:630 msgid "" "Create a :class:`UnicodeDecodeError` object with the attributes *encoding*, " "*object*, *length*, *start*, *end* and *reason*. *encoding* and *reason* are " @@ -1098,15 +959,50 @@ msgstr "" "`UnicodeDecodeError` オブジェクトを作成します。 *encoding* および *reason* " "は UTF-8 エンコードされた文字列です。" -#: ../../c-api/exceptions.rst:840 +#: ../../c-api/exceptions.rst:636 +msgid "" +"Create a :class:`UnicodeEncodeError` object with the attributes *encoding*, " +"*object*, *length*, *start*, *end* and *reason*. *encoding* and *reason* are " +"UTF-8 encoded strings." +msgstr "" +"*encoding*, *object*, *length*, *start*, *end*, *reason* 属性を持った :class:" +"`UnicodeEncodeError` オブジェクトを作成します。 *encoding* および *reason* " +"は UTF-8 エンコードされた文字列です。" + +#: ../../c-api/exceptions.rst:640 ../../c-api/exceptions.rst:650 +msgid "3.11" +msgstr "3.11" + +#: ../../c-api/exceptions.rst:642 +msgid "" +"``Py_UNICODE`` is deprecated since Python 3.3. Please migrate to " +"``PyObject_CallFunction(PyExc_UnicodeEncodeError, \"sOnns\", ...)``." +msgstr "" + +#: ../../c-api/exceptions.rst:647 +msgid "" +"Create a :class:`UnicodeTranslateError` object with the attributes *object*, " +"*length*, *start*, *end* and *reason*. *reason* is a UTF-8 encoded string." +msgstr "" +"*object*, *length*, *start*, *end*, *reason* 属性を持った :class:" +"`UnicodeTranslateError` オブジェクトを作成します。\n" +"*reason* は UTF-8 エンコードされた文字列です。" + +#: ../../c-api/exceptions.rst:652 +msgid "" +"``Py_UNICODE`` is deprecated since Python 3.3. Please migrate to " +"``PyObject_CallFunction(PyExc_UnicodeTranslateError, \"Onns\", ...)``." +msgstr "" + +#: ../../c-api/exceptions.rst:658 msgid "Return the *encoding* attribute of the given exception object." msgstr "与えられた例外オブジェクトの *encoding* 属性を返します。" -#: ../../c-api/exceptions.rst:846 +#: ../../c-api/exceptions.rst:664 msgid "Return the *object* attribute of the given exception object." msgstr "与えられた例外オブジェクトの *object* 属性を返します。" -#: ../../c-api/exceptions.rst:852 +#: ../../c-api/exceptions.rst:670 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`` " @@ -1116,29 +1012,15 @@ msgstr "" "*start* は ``NULL`` であってはなりません。成功したら ``0`` を、失敗したら " "``-1`` を返します。" -#: ../../c-api/exceptions.rst:856 +#: ../../c-api/exceptions.rst:678 msgid "" -"If the :attr:`UnicodeError.object` is an empty sequence, the resulting " -"*start* is ``0``. Otherwise, it is clipped to ``[0, len(object) - 1]``." -msgstr "" - -#: ../../c-api/exceptions.rst:859 -msgid ":attr:`UnicodeError.start`" -msgstr "" - -#: ../../c-api/exceptions.rst:865 -msgid "" -"Set the *start* attribute of the given exception object to *start*. Return " +"Set the *start* attribute of the given exception object to *start*. Return " "``0`` on success, ``-1`` on failure." msgstr "" +"渡された例外オブジェクトの *start* 属性を *start* に設定します。成功したら " +"``0`` を、失敗したら ``-1`` を返します。" -#: ../../c-api/exceptions.rst:870 -msgid "" -"While passing a negative *start* does not raise an exception, the " -"corresponding getters will not consider it as a relative offset." -msgstr "" - -#: ../../c-api/exceptions.rst:878 +#: ../../c-api/exceptions.rst:685 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 " @@ -1148,13 +1030,7 @@ msgstr "" "*end* は ``NULL`` であってはなりません。成功したら ``0`` を、失敗したら " "``-1`` を返します。" -#: ../../c-api/exceptions.rst:882 -msgid "" -"If the :attr:`UnicodeError.object` is an empty sequence, the resulting *end* " -"is ``0``. Otherwise, it is clipped to ``[1, len(object)]``." -msgstr "" - -#: ../../c-api/exceptions.rst:889 +#: ../../c-api/exceptions.rst:693 msgid "" "Set the *end* attribute of the given exception object to *end*. Return " "``0`` on success, ``-1`` on failure." @@ -1162,15 +1038,11 @@ msgstr "" "渡された例外オブジェクトの *end* 属性を *end* に設定します。成功したら ``0`` " "を、失敗したら ``-1`` を返します。" -#: ../../c-api/exceptions.rst:892 -msgid ":attr:`UnicodeError.end`" -msgstr "" - -#: ../../c-api/exceptions.rst:898 +#: ../../c-api/exceptions.rst:700 msgid "Return the *reason* attribute of the given exception object." msgstr "渡された例外オブジェクトの *reason* 属性を返します。" -#: ../../c-api/exceptions.rst:904 +#: ../../c-api/exceptions.rst:706 msgid "" "Set the *reason* attribute of the given exception object to *reason*. " "Return ``0`` on success, ``-1`` on failure." @@ -1178,11 +1050,11 @@ msgstr "" "渡された例外オブジェクトの *reason* 属性を *reason* に設定します。成功したら " "``0`` を、失敗したら ``-1`` を返します。" -#: ../../c-api/exceptions.rst:911 +#: ../../c-api/exceptions.rst:713 msgid "Recursion Control" msgstr "再帰の管理" -#: ../../c-api/exceptions.rst:913 +#: ../../c-api/exceptions.rst:715 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 " @@ -1192,18 +1064,33 @@ msgid "" "recursion handling." msgstr "" -#: ../../c-api/exceptions.rst:922 +#: ../../c-api/exceptions.rst:724 msgid "Marks a point where a recursive C-level call is about to be performed." msgstr "C レベルの再帰呼び出しをしようとしているところに印を付けます。" -#: ../../c-api/exceptions.rst:924 +#: ../../c-api/exceptions.rst:726 +msgid "" +"If :const:`USE_STACKCHECK` is defined, this function checks if the OS stack " +"overflowed using :c:func:`PyOS_CheckStack`. In this is the case, it sets a :" +"exc:`MemoryError` and returns a nonzero value." +msgstr "" +":const:`USE_STACKCHECK` が定義されている場合、 OS のスタックがオーバーフロー" +"がしたかどうかを :c:func:`PyOS_CheckStack` を使ってチェックします。もしオー" +"バーフローしているなら、 :exc:`MemoryError` をセットしゼロでない値を返しま" +"す。" + +#: ../../c-api/exceptions.rst:730 msgid "" -"The function then checks if the stack limit is reached. If this is the " +"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 "" +"次にこの関数は再帰の上限に達していないかをチェックします。\n" +"上限に達している場合、 :exc:`RecursionError` をセットしゼロでない値を返しま" +"す。\n" +"そうでない場合はゼロを返します。" -#: ../../c-api/exceptions.rst:928 +#: ../../c-api/exceptions.rst:734 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 " @@ -1213,13 +1100,11 @@ msgstr "" "して、再帰の深さの限界に達したことで送出される :exc:`RecursionError` のメッ" "セージに連結できるようにすべきです。" -#: ../../c-api/exceptions.rst:932 ../../c-api/exceptions.rst:940 -msgid "" -"This function is now also available in the :ref:`limited API `." +#: ../../c-api/exceptions.rst:738 ../../c-api/exceptions.rst:746 +msgid "This function is now also available in the limited API." msgstr "" -#: ../../c-api/exceptions.rst:937 +#: ../../c-api/exceptions.rst:743 msgid "" "Ends a :c:func:`Py_EnterRecursiveCall`. Must be called once for each " "*successful* invocation of :c:func:`Py_EnterRecursiveCall`." @@ -1228,7 +1113,7 @@ msgstr "" "`Py_EnterRecursiveCall` の *成功した* 呼び出しに対し 1 回呼ばなければなりませ" "ん。" -#: ../../c-api/exceptions.rst:943 +#: ../../c-api/exceptions.rst:749 msgid "" "Properly implementing :c:member:`~PyTypeObject.tp_repr` for container types " "requires special recursion handling. In addition to protecting the stack, :" @@ -1242,7 +1127,7 @@ msgstr "" "の 2 つの関数はその機能を容易にします。実質的には、これらは :func:`reprlib." "recursive_repr` と同等な C の実装です。" -#: ../../c-api/exceptions.rst:951 +#: ../../c-api/exceptions.rst:757 msgid "" "Called at the beginning of the :c:member:`~PyTypeObject.tp_repr` " "implementation to detect cycles." @@ -1250,7 +1135,7 @@ msgstr "" "循環処理を検知するために、 :c:member:`~PyTypeObject.tp_repr` の実装の先頭で呼" "び出します。" -#: ../../c-api/exceptions.rst:954 +#: ../../c-api/exceptions.rst:760 msgid "" "If the object has already been processed, the function returns a positive " "integer. In that case the :c:member:`~PyTypeObject.tp_repr` implementation " @@ -1262,7 +1147,7 @@ msgstr "" "ブジェクトを返すべきです。例えば、 :class:`dict` オブジェクトは ``{...}`` を" "返しますし、 :class:`list` オブジェクトは ``[...]`` を返します。" -#: ../../c-api/exceptions.rst:960 +#: ../../c-api/exceptions.rst:766 msgid "" "The function will return a negative integer if the recursion limit is " "reached. In that case the :c:member:`~PyTypeObject.tp_repr` implementation " @@ -1271,7 +1156,7 @@ msgstr "" "再帰回数の上限に達した場合は、この関数は負の整数を返します。この場合、 :c:" "member:`~PyTypeObject.tp_repr` の実装は一般的には ``NULL`` を返すべきです。" -#: ../../c-api/exceptions.rst:964 +#: ../../c-api/exceptions.rst:770 msgid "" "Otherwise, the function returns zero and the :c:member:`~PyTypeObject." "tp_repr` implementation can continue normally." @@ -1279,7 +1164,7 @@ msgstr "" "それ以外の場合は、関数はゼロを返し、 :c:member:`~PyTypeObject.tp_repr` の実装" "は通常どおり処理を続けてかまいません。" -#: ../../c-api/exceptions.rst:969 +#: ../../c-api/exceptions.rst:775 msgid "" "Ends a :c:func:`Py_ReprEnter`. Must be called once for each invocation of :" "c:func:`Py_ReprEnter` that returns zero." @@ -1287,482 +1172,467 @@ msgstr "" ":c:func:`Py_ReprEnter` を終了させます。 0 を返した :c:func:`Py_ReprEnter` の" "呼び出しに対し 1 回呼ばなければなりません。" -#: ../../c-api/exceptions.rst:976 +#: ../../c-api/exceptions.rst:782 msgid "Standard Exceptions" msgstr "標準例外" -#: ../../c-api/exceptions.rst:978 +#: ../../c-api/exceptions.rst:784 msgid "" "All standard Python exceptions are available as global variables whose names " "are ``PyExc_`` followed by the Python exception name. These have the type :" -"c:expr:`PyObject*`; they are all class objects. For completeness, here are " +"c:type:`PyObject*`; they are all class objects. For completeness, here are " "all the variables:" msgstr "" -"``PyExc_`` の後ろにPythonの例外名が続く名前をもつグローバル変数として、すべて" -"の標準Python例外が利用可能です。これらは型 :c:expr:`PyObject*` を持ち、すべて" -"クラスオブジェクトです。完璧を期するために、すべての変数を以下に列挙します:" -#: ../../c-api/exceptions.rst:1041 ../../c-api/exceptions.rst:1181 -#: ../../c-api/exceptions.rst:1227 +#: ../../c-api/exceptions.rst:845 ../../c-api/exceptions.rst:978 +#: ../../c-api/exceptions.rst:1023 msgid "C Name" msgstr "C名" -#: ../../c-api/exceptions.rst:1041 ../../c-api/exceptions.rst:1227 +#: ../../c-api/exceptions.rst:845 ../../c-api/exceptions.rst:1023 msgid "Python Name" msgstr "Python名" -#: ../../c-api/exceptions.rst:1041 ../../c-api/exceptions.rst:1181 -#: ../../c-api/exceptions.rst:1227 +#: ../../c-api/exceptions.rst:845 ../../c-api/exceptions.rst:978 +#: ../../c-api/exceptions.rst:1023 msgid "Notes" msgstr "注釈" -#: ../../c-api/exceptions.rst:1043 +#: ../../c-api/exceptions.rst:847 msgid ":c:data:`PyExc_BaseException`" msgstr ":c:data:`PyExc_BaseException`" -#: ../../c-api/exceptions.rst:1043 +#: ../../c-api/exceptions.rst:847 msgid ":exc:`BaseException`" msgstr ":exc:`BaseException`" -#: ../../c-api/exceptions.rst:1043 ../../c-api/exceptions.rst:1045 -#: ../../c-api/exceptions.rst:1047 ../../c-api/exceptions.rst:1049 -#: ../../c-api/exceptions.rst:1095 ../../c-api/exceptions.rst:1107 -msgid "[1]_" -msgstr "[1]_" +#: ../../c-api/exceptions.rst:847 ../../c-api/exceptions.rst:849 +#: ../../c-api/exceptions.rst:851 ../../c-api/exceptions.rst:897 +#: ../../c-api/exceptions.rst:909 ../../c-api/exceptions.rst:1025 +msgid "\\(1)" +msgstr "\\(1)" -#: ../../c-api/exceptions.rst:1045 -msgid ":c:data:`PyExc_BaseExceptionGroup`" -msgstr "" - -#: ../../c-api/exceptions.rst:1045 -msgid ":exc:`BaseExceptionGroup`" -msgstr "" - -#: ../../c-api/exceptions.rst:1047 +#: ../../c-api/exceptions.rst:849 msgid ":c:data:`PyExc_Exception`" msgstr ":c:data:`PyExc_Exception`" -#: ../../c-api/exceptions.rst:1047 +#: ../../c-api/exceptions.rst:849 msgid ":exc:`Exception`" msgstr ":exc:`Exception`" -#: ../../c-api/exceptions.rst:1049 +#: ../../c-api/exceptions.rst:851 msgid ":c:data:`PyExc_ArithmeticError`" msgstr ":c:data:`PyExc_ArithmeticError`" -#: ../../c-api/exceptions.rst:1049 +#: ../../c-api/exceptions.rst:851 msgid ":exc:`ArithmeticError`" msgstr ":exc:`ArithmeticError`" -#: ../../c-api/exceptions.rst:1051 +#: ../../c-api/exceptions.rst:853 msgid ":c:data:`PyExc_AssertionError`" msgstr ":c:data:`PyExc_AssertionError`" -#: ../../c-api/exceptions.rst:1051 +#: ../../c-api/exceptions.rst:853 msgid ":exc:`AssertionError`" msgstr ":exc:`AssertionError`" -#: ../../c-api/exceptions.rst:1053 +#: ../../c-api/exceptions.rst:855 msgid ":c:data:`PyExc_AttributeError`" msgstr ":c:data:`PyExc_AttributeError`" -#: ../../c-api/exceptions.rst:1053 +#: ../../c-api/exceptions.rst:855 msgid ":exc:`AttributeError`" msgstr ":exc:`AttributeError`" -#: ../../c-api/exceptions.rst:1055 +#: ../../c-api/exceptions.rst:857 msgid ":c:data:`PyExc_BlockingIOError`" msgstr ":c:data:`PyExc_BlockingIOError`" -#: ../../c-api/exceptions.rst:1055 +#: ../../c-api/exceptions.rst:857 msgid ":exc:`BlockingIOError`" msgstr ":exc:`BlockingIOError`" -#: ../../c-api/exceptions.rst:1057 +#: ../../c-api/exceptions.rst:859 msgid ":c:data:`PyExc_BrokenPipeError`" msgstr ":c:data:`PyExc_BrokenPipeError`" -#: ../../c-api/exceptions.rst:1057 +#: ../../c-api/exceptions.rst:859 msgid ":exc:`BrokenPipeError`" msgstr ":exc:`BrokenPipeError`" -#: ../../c-api/exceptions.rst:1059 +#: ../../c-api/exceptions.rst:861 msgid ":c:data:`PyExc_BufferError`" msgstr ":c:data:`PyExc_BufferError`" -#: ../../c-api/exceptions.rst:1059 +#: ../../c-api/exceptions.rst:861 msgid ":exc:`BufferError`" msgstr ":exc:`BufferError`" -#: ../../c-api/exceptions.rst:1061 +#: ../../c-api/exceptions.rst:863 msgid ":c:data:`PyExc_ChildProcessError`" msgstr ":c:data:`PyExc_ChildProcessError`" -#: ../../c-api/exceptions.rst:1061 +#: ../../c-api/exceptions.rst:863 msgid ":exc:`ChildProcessError`" msgstr ":exc:`ChildProcessError`" -#: ../../c-api/exceptions.rst:1063 +#: ../../c-api/exceptions.rst:865 msgid ":c:data:`PyExc_ConnectionAbortedError`" msgstr ":c:data:`PyExc_ConnectionAbortedError`" -#: ../../c-api/exceptions.rst:1063 +#: ../../c-api/exceptions.rst:865 msgid ":exc:`ConnectionAbortedError`" msgstr ":exc:`ConnectionAbortedError`" -#: ../../c-api/exceptions.rst:1065 +#: ../../c-api/exceptions.rst:867 msgid ":c:data:`PyExc_ConnectionError`" msgstr ":c:data:`PyExc_ConnectionError`" -#: ../../c-api/exceptions.rst:1065 +#: ../../c-api/exceptions.rst:867 msgid ":exc:`ConnectionError`" msgstr ":exc:`ConnectionError`" -#: ../../c-api/exceptions.rst:1067 +#: ../../c-api/exceptions.rst:869 msgid ":c:data:`PyExc_ConnectionRefusedError`" msgstr ":c:data:`PyExc_ConnectionRefusedError`" -#: ../../c-api/exceptions.rst:1067 +#: ../../c-api/exceptions.rst:869 msgid ":exc:`ConnectionRefusedError`" msgstr ":exc:`ConnectionRefusedError`" -#: ../../c-api/exceptions.rst:1069 +#: ../../c-api/exceptions.rst:871 msgid ":c:data:`PyExc_ConnectionResetError`" msgstr ":c:data:`PyExc_ConnectionResetError`" -#: ../../c-api/exceptions.rst:1069 +#: ../../c-api/exceptions.rst:871 msgid ":exc:`ConnectionResetError`" msgstr ":exc:`ConnectionResetError`" -#: ../../c-api/exceptions.rst:1071 +#: ../../c-api/exceptions.rst:873 msgid ":c:data:`PyExc_EOFError`" msgstr ":c:data:`PyExc_EOFError`" -#: ../../c-api/exceptions.rst:1071 +#: ../../c-api/exceptions.rst:873 msgid ":exc:`EOFError`" msgstr ":exc:`EOFError`" -#: ../../c-api/exceptions.rst:1073 +#: ../../c-api/exceptions.rst:875 msgid ":c:data:`PyExc_FileExistsError`" msgstr ":c:data:`PyExc_FileExistsError`" -#: ../../c-api/exceptions.rst:1073 +#: ../../c-api/exceptions.rst:875 msgid ":exc:`FileExistsError`" msgstr ":exc:`FileExistsError`" -#: ../../c-api/exceptions.rst:1075 +#: ../../c-api/exceptions.rst:877 msgid ":c:data:`PyExc_FileNotFoundError`" msgstr ":c:data:`PyExc_FileNotFoundError`" -#: ../../c-api/exceptions.rst:1075 +#: ../../c-api/exceptions.rst:877 msgid ":exc:`FileNotFoundError`" msgstr ":exc:`FileNotFoundError`" -#: ../../c-api/exceptions.rst:1077 +#: ../../c-api/exceptions.rst:879 msgid ":c:data:`PyExc_FloatingPointError`" msgstr ":c:data:`PyExc_FloatingPointError`" -#: ../../c-api/exceptions.rst:1077 +#: ../../c-api/exceptions.rst:879 msgid ":exc:`FloatingPointError`" msgstr ":exc:`FloatingPointError`" -#: ../../c-api/exceptions.rst:1079 +#: ../../c-api/exceptions.rst:881 msgid ":c:data:`PyExc_GeneratorExit`" msgstr ":c:data:`PyExc_GeneratorExit`" -#: ../../c-api/exceptions.rst:1079 +#: ../../c-api/exceptions.rst:881 msgid ":exc:`GeneratorExit`" msgstr ":exc:`GeneratorExit`" -#: ../../c-api/exceptions.rst:1081 +#: ../../c-api/exceptions.rst:883 msgid ":c:data:`PyExc_ImportError`" msgstr ":c:data:`PyExc_ImportError`" -#: ../../c-api/exceptions.rst:1081 +#: ../../c-api/exceptions.rst:883 msgid ":exc:`ImportError`" msgstr ":exc:`ImportError`" -#: ../../c-api/exceptions.rst:1083 +#: ../../c-api/exceptions.rst:885 msgid ":c:data:`PyExc_IndentationError`" msgstr ":c:data:`PyExc_IndentationError`" -#: ../../c-api/exceptions.rst:1083 +#: ../../c-api/exceptions.rst:885 msgid ":exc:`IndentationError`" msgstr ":exc:`IndentationError`" -#: ../../c-api/exceptions.rst:1085 +#: ../../c-api/exceptions.rst:887 msgid ":c:data:`PyExc_IndexError`" msgstr ":c:data:`PyExc_IndexError`" -#: ../../c-api/exceptions.rst:1085 +#: ../../c-api/exceptions.rst:887 msgid ":exc:`IndexError`" msgstr ":exc:`IndexError`" -#: ../../c-api/exceptions.rst:1087 +#: ../../c-api/exceptions.rst:889 msgid ":c:data:`PyExc_InterruptedError`" msgstr ":c:data:`PyExc_InterruptedError`" -#: ../../c-api/exceptions.rst:1087 +#: ../../c-api/exceptions.rst:889 msgid ":exc:`InterruptedError`" msgstr ":exc:`InterruptedError`" -#: ../../c-api/exceptions.rst:1089 +#: ../../c-api/exceptions.rst:891 msgid ":c:data:`PyExc_IsADirectoryError`" msgstr ":c:data:`PyExc_IsADirectoryError`" -#: ../../c-api/exceptions.rst:1089 +#: ../../c-api/exceptions.rst:891 msgid ":exc:`IsADirectoryError`" msgstr ":exc:`IsADirectoryError`" -#: ../../c-api/exceptions.rst:1091 +#: ../../c-api/exceptions.rst:893 msgid ":c:data:`PyExc_KeyError`" msgstr ":c:data:`PyExc_KeyError`" -#: ../../c-api/exceptions.rst:1091 +#: ../../c-api/exceptions.rst:893 msgid ":exc:`KeyError`" msgstr ":exc:`KeyError`" -#: ../../c-api/exceptions.rst:1093 +#: ../../c-api/exceptions.rst:895 msgid ":c:data:`PyExc_KeyboardInterrupt`" msgstr ":c:data:`PyExc_KeyboardInterrupt`" -#: ../../c-api/exceptions.rst:1093 +#: ../../c-api/exceptions.rst:895 msgid ":exc:`KeyboardInterrupt`" msgstr ":exc:`KeyboardInterrupt`" -#: ../../c-api/exceptions.rst:1095 +#: ../../c-api/exceptions.rst:897 msgid ":c:data:`PyExc_LookupError`" msgstr ":c:data:`PyExc_LookupError`" -#: ../../c-api/exceptions.rst:1095 +#: ../../c-api/exceptions.rst:897 msgid ":exc:`LookupError`" msgstr ":exc:`LookupError`" -#: ../../c-api/exceptions.rst:1097 +#: ../../c-api/exceptions.rst:899 msgid ":c:data:`PyExc_MemoryError`" msgstr ":c:data:`PyExc_MemoryError`" -#: ../../c-api/exceptions.rst:1097 +#: ../../c-api/exceptions.rst:899 msgid ":exc:`MemoryError`" msgstr ":exc:`MemoryError`" -#: ../../c-api/exceptions.rst:1099 +#: ../../c-api/exceptions.rst:901 msgid ":c:data:`PyExc_ModuleNotFoundError`" msgstr ":c:data:`PyExc_ModuleNotFoundError`" -#: ../../c-api/exceptions.rst:1099 +#: ../../c-api/exceptions.rst:901 msgid ":exc:`ModuleNotFoundError`" msgstr ":exc:`ModuleNotFoundError`" -#: ../../c-api/exceptions.rst:1101 +#: ../../c-api/exceptions.rst:903 msgid ":c:data:`PyExc_NameError`" msgstr ":c:data:`PyExc_NameError`" -#: ../../c-api/exceptions.rst:1101 +#: ../../c-api/exceptions.rst:903 msgid ":exc:`NameError`" msgstr ":exc:`NameError`" -#: ../../c-api/exceptions.rst:1103 +#: ../../c-api/exceptions.rst:905 msgid ":c:data:`PyExc_NotADirectoryError`" msgstr ":c:data:`PyExc_NotADirectoryError`" -#: ../../c-api/exceptions.rst:1103 +#: ../../c-api/exceptions.rst:905 msgid ":exc:`NotADirectoryError`" msgstr ":exc:`NotADirectoryError`" -#: ../../c-api/exceptions.rst:1105 +#: ../../c-api/exceptions.rst:907 msgid ":c:data:`PyExc_NotImplementedError`" msgstr ":c:data:`PyExc_NotImplementedError`" -#: ../../c-api/exceptions.rst:1105 +#: ../../c-api/exceptions.rst:907 msgid ":exc:`NotImplementedError`" msgstr ":exc:`NotImplementedError`" -#: ../../c-api/exceptions.rst:1107 +#: ../../c-api/exceptions.rst:909 msgid ":c:data:`PyExc_OSError`" msgstr ":c:data:`PyExc_OSError`" -#: ../../c-api/exceptions.rst:1107 +#: ../../c-api/exceptions.rst:909 msgid ":exc:`OSError`" msgstr ":exc:`OSError`" -#: ../../c-api/exceptions.rst:1109 +#: ../../c-api/exceptions.rst:911 msgid ":c:data:`PyExc_OverflowError`" msgstr ":c:data:`PyExc_OverflowError`" -#: ../../c-api/exceptions.rst:1109 +#: ../../c-api/exceptions.rst:911 msgid ":exc:`OverflowError`" msgstr ":exc:`OverflowError`" -#: ../../c-api/exceptions.rst:1111 +#: ../../c-api/exceptions.rst:913 msgid ":c:data:`PyExc_PermissionError`" msgstr ":c:data:`PyExc_PermissionError`" -#: ../../c-api/exceptions.rst:1111 +#: ../../c-api/exceptions.rst:913 msgid ":exc:`PermissionError`" msgstr ":exc:`PermissionError`" -#: ../../c-api/exceptions.rst:1113 +#: ../../c-api/exceptions.rst:915 msgid ":c:data:`PyExc_ProcessLookupError`" msgstr ":c:data:`PyExc_ProcessLookupError`" -#: ../../c-api/exceptions.rst:1113 +#: ../../c-api/exceptions.rst:915 msgid ":exc:`ProcessLookupError`" msgstr ":exc:`ProcessLookupError`" -#: ../../c-api/exceptions.rst:1115 -msgid ":c:data:`PyExc_PythonFinalizationError`" -msgstr ":c:data:`PyExc_PythonFinalizationError`" - -#: ../../c-api/exceptions.rst:1115 -msgid ":exc:`PythonFinalizationError`" -msgstr ":exc:`PythonFinalizationError`" - -#: ../../c-api/exceptions.rst:1117 +#: ../../c-api/exceptions.rst:917 msgid ":c:data:`PyExc_RecursionError`" msgstr ":c:data:`PyExc_RecursionError`" -#: ../../c-api/exceptions.rst:1117 +#: ../../c-api/exceptions.rst:917 msgid ":exc:`RecursionError`" msgstr ":exc:`RecursionError`" -#: ../../c-api/exceptions.rst:1119 +#: ../../c-api/exceptions.rst:919 msgid ":c:data:`PyExc_ReferenceError`" msgstr ":c:data:`PyExc_ReferenceError`" -#: ../../c-api/exceptions.rst:1119 +#: ../../c-api/exceptions.rst:919 msgid ":exc:`ReferenceError`" msgstr ":exc:`ReferenceError`" -#: ../../c-api/exceptions.rst:1121 +#: ../../c-api/exceptions.rst:919 +msgid "\\(2)" +msgstr "\\(2)" + +#: ../../c-api/exceptions.rst:921 msgid ":c:data:`PyExc_RuntimeError`" msgstr ":c:data:`PyExc_RuntimeError`" -#: ../../c-api/exceptions.rst:1121 +#: ../../c-api/exceptions.rst:921 msgid ":exc:`RuntimeError`" msgstr ":exc:`RuntimeError`" -#: ../../c-api/exceptions.rst:1123 +#: ../../c-api/exceptions.rst:923 msgid ":c:data:`PyExc_StopAsyncIteration`" msgstr ":c:data:`PyExc_StopAsyncIteration`" -#: ../../c-api/exceptions.rst:1123 +#: ../../c-api/exceptions.rst:923 msgid ":exc:`StopAsyncIteration`" msgstr ":exc:`StopAsyncIteration`" -#: ../../c-api/exceptions.rst:1125 +#: ../../c-api/exceptions.rst:925 msgid ":c:data:`PyExc_StopIteration`" msgstr ":c:data:`PyExc_StopIteration`" -#: ../../c-api/exceptions.rst:1125 +#: ../../c-api/exceptions.rst:925 msgid ":exc:`StopIteration`" msgstr ":exc:`StopIteration`" -#: ../../c-api/exceptions.rst:1127 +#: ../../c-api/exceptions.rst:927 msgid ":c:data:`PyExc_SyntaxError`" msgstr ":c:data:`PyExc_SyntaxError`" -#: ../../c-api/exceptions.rst:1127 +#: ../../c-api/exceptions.rst:927 msgid ":exc:`SyntaxError`" msgstr ":exc:`SyntaxError`" -#: ../../c-api/exceptions.rst:1129 +#: ../../c-api/exceptions.rst:929 msgid ":c:data:`PyExc_SystemError`" msgstr ":c:data:`PyExc_SystemError`" -#: ../../c-api/exceptions.rst:1129 +#: ../../c-api/exceptions.rst:929 msgid ":exc:`SystemError`" msgstr ":exc:`SystemError`" -#: ../../c-api/exceptions.rst:1131 +#: ../../c-api/exceptions.rst:931 msgid ":c:data:`PyExc_SystemExit`" msgstr ":c:data:`PyExc_SystemExit`" -#: ../../c-api/exceptions.rst:1131 +#: ../../c-api/exceptions.rst:931 msgid ":exc:`SystemExit`" msgstr ":exc:`SystemExit`" -#: ../../c-api/exceptions.rst:1133 +#: ../../c-api/exceptions.rst:933 msgid ":c:data:`PyExc_TabError`" msgstr ":c:data:`PyExc_TabError`" -#: ../../c-api/exceptions.rst:1133 +#: ../../c-api/exceptions.rst:933 msgid ":exc:`TabError`" msgstr ":exc:`TabError`" -#: ../../c-api/exceptions.rst:1135 +#: ../../c-api/exceptions.rst:935 msgid ":c:data:`PyExc_TimeoutError`" msgstr ":c:data:`PyExc_TimeoutError`" -#: ../../c-api/exceptions.rst:1135 +#: ../../c-api/exceptions.rst:935 msgid ":exc:`TimeoutError`" msgstr ":exc:`TimeoutError`" -#: ../../c-api/exceptions.rst:1137 +#: ../../c-api/exceptions.rst:937 msgid ":c:data:`PyExc_TypeError`" msgstr ":c:data:`PyExc_TypeError`" -#: ../../c-api/exceptions.rst:1137 +#: ../../c-api/exceptions.rst:937 msgid ":exc:`TypeError`" msgstr ":exc:`TypeError`" -#: ../../c-api/exceptions.rst:1139 +#: ../../c-api/exceptions.rst:939 msgid ":c:data:`PyExc_UnboundLocalError`" msgstr ":c:data:`PyExc_UnboundLocalError`" -#: ../../c-api/exceptions.rst:1139 +#: ../../c-api/exceptions.rst:939 msgid ":exc:`UnboundLocalError`" msgstr ":exc:`UnboundLocalError`" -#: ../../c-api/exceptions.rst:1141 +#: ../../c-api/exceptions.rst:941 msgid ":c:data:`PyExc_UnicodeDecodeError`" msgstr ":c:data:`PyExc_UnicodeDecodeError`" -#: ../../c-api/exceptions.rst:1141 +#: ../../c-api/exceptions.rst:941 msgid ":exc:`UnicodeDecodeError`" msgstr ":exc:`UnicodeDecodeError`" -#: ../../c-api/exceptions.rst:1143 +#: ../../c-api/exceptions.rst:943 msgid ":c:data:`PyExc_UnicodeEncodeError`" msgstr ":c:data:`PyExc_UnicodeEncodeError`" -#: ../../c-api/exceptions.rst:1143 +#: ../../c-api/exceptions.rst:943 msgid ":exc:`UnicodeEncodeError`" msgstr ":exc:`UnicodeEncodeError`" -#: ../../c-api/exceptions.rst:1145 +#: ../../c-api/exceptions.rst:945 msgid ":c:data:`PyExc_UnicodeError`" msgstr ":c:data:`PyExc_UnicodeError`" -#: ../../c-api/exceptions.rst:1145 +#: ../../c-api/exceptions.rst:945 msgid ":exc:`UnicodeError`" msgstr ":exc:`UnicodeError`" -#: ../../c-api/exceptions.rst:1147 +#: ../../c-api/exceptions.rst:947 msgid ":c:data:`PyExc_UnicodeTranslateError`" msgstr ":c:data:`PyExc_UnicodeTranslateError`" -#: ../../c-api/exceptions.rst:1147 +#: ../../c-api/exceptions.rst:947 msgid ":exc:`UnicodeTranslateError`" msgstr ":exc:`UnicodeTranslateError`" -#: ../../c-api/exceptions.rst:1149 +#: ../../c-api/exceptions.rst:949 msgid ":c:data:`PyExc_ValueError`" msgstr ":c:data:`PyExc_ValueError`" -#: ../../c-api/exceptions.rst:1149 +#: ../../c-api/exceptions.rst:949 msgid ":exc:`ValueError`" msgstr ":exc:`ValueError`" -#: ../../c-api/exceptions.rst:1151 +#: ../../c-api/exceptions.rst:951 msgid ":c:data:`PyExc_ZeroDivisionError`" msgstr ":c:data:`PyExc_ZeroDivisionError`" -#: ../../c-api/exceptions.rst:1151 +#: ../../c-api/exceptions.rst:951 msgid ":exc:`ZeroDivisionError`" msgstr ":exc:`ZeroDivisionError`" -#: ../../c-api/exceptions.rst:1154 +#: ../../c-api/exceptions.rst:954 msgid "" ":c:data:`PyExc_BlockingIOError`, :c:data:`PyExc_BrokenPipeError`, :c:data:" "`PyExc_ChildProcessError`, :c:data:`PyExc_ConnectionError`, :c:data:" @@ -1782,52 +1652,48 @@ msgstr "" "data:`PyExc_PermissionError` 、 :c:data:`PyExc_ProcessLookupError` 、 :c:" "data:`PyExc_TimeoutError` は :pep:`3151` により導入されました。" -#: ../../c-api/exceptions.rst:1164 +#: ../../c-api/exceptions.rst:964 msgid ":c:data:`PyExc_StopAsyncIteration` and :c:data:`PyExc_RecursionError`." msgstr "" ":c:data:`PyExc_StopAsyncIteration` および :c:data:`PyExc_RecursionError` 。" -#: ../../c-api/exceptions.rst:1167 +#: ../../c-api/exceptions.rst:967 msgid ":c:data:`PyExc_ModuleNotFoundError`." msgstr ":c:data:`PyExc_ModuleNotFoundError`." -#: ../../c-api/exceptions.rst:1170 -msgid ":c:data:`PyExc_BaseExceptionGroup`." -msgstr "" - -#: ../../c-api/exceptions.rst:1173 +#: ../../c-api/exceptions.rst:970 msgid "These are compatibility aliases to :c:data:`PyExc_OSError`:" msgstr "これらは互換性のある :c:data:`PyExc_OSError` のエイリアスです:" -#: ../../c-api/exceptions.rst:1183 -msgid ":c:data:`!PyExc_EnvironmentError`" -msgstr ":c:data:`!PyExc_EnvironmentError`" +#: ../../c-api/exceptions.rst:980 +msgid ":c:data:`PyExc_EnvironmentError`" +msgstr ":c:data:`PyExc_EnvironmentError`" -#: ../../c-api/exceptions.rst:1185 -msgid ":c:data:`!PyExc_IOError`" -msgstr ":c:data:`!PyExc_IOError`" +#: ../../c-api/exceptions.rst:982 +msgid ":c:data:`PyExc_IOError`" +msgstr ":c:data:`PyExc_IOError`" -#: ../../c-api/exceptions.rst:1187 -msgid ":c:data:`!PyExc_WindowsError`" -msgstr ":c:data:`!PyExc_WindowsError`" +#: ../../c-api/exceptions.rst:984 +msgid ":c:data:`PyExc_WindowsError`" +msgstr ":c:data:`PyExc_WindowsError`" -#: ../../c-api/exceptions.rst:1187 -msgid "[2]_" -msgstr "[2]_" +#: ../../c-api/exceptions.rst:984 +msgid "\\(3)" +msgstr "\\(3)" -#: ../../c-api/exceptions.rst:1190 +#: ../../c-api/exceptions.rst:987 msgid "These aliases used to be separate exception types." msgstr "これらのエイリアスは例外の種類を分けるために使われます。" -#: ../../c-api/exceptions.rst:1193 ../../c-api/exceptions.rst:1260 +#: ../../c-api/exceptions.rst:990 ../../c-api/exceptions.rst:1051 msgid "Notes:" msgstr "注釈:" -#: ../../c-api/exceptions.rst:1196 +#: ../../c-api/exceptions.rst:993 msgid "This is a base class for other standard exceptions." msgstr "これは別の標準例外のためのベースクラスです。" -#: ../../c-api/exceptions.rst:1199 +#: ../../c-api/exceptions.rst:996 msgid "" "Only defined on Windows; protect code that uses this by testing that the " "preprocessor macro ``MS_WINDOWS`` is defined." @@ -1835,433 +1701,110 @@ msgstr "" "Windowsでのみ定義されています。プリプロセッサマクロ ``MS_WINDOWS`` が定義され" "ているかテストすることで、これを使うコードを保護してください。" -#: ../../c-api/exceptions.rst:1205 +#: ../../c-api/exceptions.rst:1002 msgid "Standard Warning Categories" msgstr "標準警告カテゴリ" -#: ../../c-api/exceptions.rst:1207 +#: ../../c-api/exceptions.rst:1004 msgid "" "All standard Python warning categories are available as global variables " "whose names are ``PyExc_`` followed by the Python exception name. These have " -"the type :c:expr:`PyObject*`; they are all class objects. For completeness, " +"the type :c:type:`PyObject*`; they are all class objects. For completeness, " "here are all the variables:" msgstr "" -"``PyExc_`` の後ろにPythonの例外名が続く名前をもつグローバル変数として、すべて" -"の標準Python警告カテゴリが利用可能です。これらは型 :c:expr:`PyObject*` を持" -"ち、すべてクラスオブジェクトです。完璧を期するために、すべての変数を以下に列" -"挙します:" -#: ../../c-api/exceptions.rst:1229 +#: ../../c-api/exceptions.rst:1025 msgid ":c:data:`PyExc_Warning`" msgstr ":c:data:`PyExc_Warning`" -#: ../../c-api/exceptions.rst:1229 +#: ../../c-api/exceptions.rst:1025 msgid ":exc:`Warning`" msgstr ":exc:`Warning`" -#: ../../c-api/exceptions.rst:1229 -msgid "[3]_" -msgstr "[3]_" - -#: ../../c-api/exceptions.rst:1231 +#: ../../c-api/exceptions.rst:1027 msgid ":c:data:`PyExc_BytesWarning`" msgstr ":c:data:`PyExc_BytesWarning`" -#: ../../c-api/exceptions.rst:1231 +#: ../../c-api/exceptions.rst:1027 msgid ":exc:`BytesWarning`" msgstr ":exc:`BytesWarning`" -#: ../../c-api/exceptions.rst:1233 +#: ../../c-api/exceptions.rst:1029 msgid ":c:data:`PyExc_DeprecationWarning`" msgstr ":c:data:`PyExc_DeprecationWarning`" -#: ../../c-api/exceptions.rst:1233 +#: ../../c-api/exceptions.rst:1029 msgid ":exc:`DeprecationWarning`" msgstr ":exc:`DeprecationWarning`" -#: ../../c-api/exceptions.rst:1235 -msgid ":c:data:`PyExc_EncodingWarning`" -msgstr "" - -#: ../../c-api/exceptions.rst:1235 -msgid ":exc:`EncodingWarning`" -msgstr "" - -#: ../../c-api/exceptions.rst:1237 +#: ../../c-api/exceptions.rst:1031 msgid ":c:data:`PyExc_FutureWarning`" msgstr ":c:data:`PyExc_FutureWarning`" -#: ../../c-api/exceptions.rst:1237 +#: ../../c-api/exceptions.rst:1031 msgid ":exc:`FutureWarning`" msgstr ":exc:`FutureWarning`" -#: ../../c-api/exceptions.rst:1239 +#: ../../c-api/exceptions.rst:1033 msgid ":c:data:`PyExc_ImportWarning`" msgstr ":c:data:`PyExc_ImportWarning`" -#: ../../c-api/exceptions.rst:1239 +#: ../../c-api/exceptions.rst:1033 msgid ":exc:`ImportWarning`" msgstr ":exc:`ImportWarning`" -#: ../../c-api/exceptions.rst:1241 +#: ../../c-api/exceptions.rst:1035 msgid ":c:data:`PyExc_PendingDeprecationWarning`" msgstr ":c:data:`PyExc_PendingDeprecationWarning`" -#: ../../c-api/exceptions.rst:1241 +#: ../../c-api/exceptions.rst:1035 msgid ":exc:`PendingDeprecationWarning`" msgstr ":exc:`PendingDeprecationWarning`" -#: ../../c-api/exceptions.rst:1243 +#: ../../c-api/exceptions.rst:1037 msgid ":c:data:`PyExc_ResourceWarning`" msgstr ":c:data:`PyExc_ResourceWarning`" -#: ../../c-api/exceptions.rst:1243 +#: ../../c-api/exceptions.rst:1037 msgid ":exc:`ResourceWarning`" msgstr ":exc:`ResourceWarning`" -#: ../../c-api/exceptions.rst:1245 +#: ../../c-api/exceptions.rst:1039 msgid ":c:data:`PyExc_RuntimeWarning`" msgstr ":c:data:`PyExc_RuntimeWarning`" -#: ../../c-api/exceptions.rst:1245 +#: ../../c-api/exceptions.rst:1039 msgid ":exc:`RuntimeWarning`" msgstr ":exc:`RuntimeWarning`" -#: ../../c-api/exceptions.rst:1247 +#: ../../c-api/exceptions.rst:1041 msgid ":c:data:`PyExc_SyntaxWarning`" msgstr ":c:data:`PyExc_SyntaxWarning`" -#: ../../c-api/exceptions.rst:1247 +#: ../../c-api/exceptions.rst:1041 msgid ":exc:`SyntaxWarning`" msgstr ":exc:`SyntaxWarning`" -#: ../../c-api/exceptions.rst:1249 +#: ../../c-api/exceptions.rst:1043 msgid ":c:data:`PyExc_UnicodeWarning`" msgstr ":c:data:`PyExc_UnicodeWarning`" -#: ../../c-api/exceptions.rst:1249 +#: ../../c-api/exceptions.rst:1043 msgid ":exc:`UnicodeWarning`" msgstr ":exc:`UnicodeWarning`" -#: ../../c-api/exceptions.rst:1251 +#: ../../c-api/exceptions.rst:1045 msgid ":c:data:`PyExc_UserWarning`" msgstr ":c:data:`PyExc_UserWarning`" -#: ../../c-api/exceptions.rst:1251 +#: ../../c-api/exceptions.rst:1045 msgid ":exc:`UserWarning`" msgstr ":exc:`UserWarning`" -#: ../../c-api/exceptions.rst:1254 +#: ../../c-api/exceptions.rst:1048 msgid ":c:data:`PyExc_ResourceWarning`." msgstr ":c:data:`PyExc_ResourceWarning`." -#: ../../c-api/exceptions.rst:1257 -msgid ":c:data:`PyExc_EncodingWarning`." -msgstr "" - -#: ../../c-api/exceptions.rst:1263 +#: ../../c-api/exceptions.rst:1054 msgid "This is a base class for other standard warning categories." msgstr "これは別の標準警告カテゴリのためのベースクラスです。" - -#: ../../c-api/exceptions.rst:183 -msgid "strerror (C function)" -msgstr "" - -#: ../../c-api/exceptions.rst:637 ../../c-api/exceptions.rst:668 -#: ../../c-api/exceptions.rst:683 -msgid "module" -msgstr "module" - -#: ../../c-api/exceptions.rst:637 ../../c-api/exceptions.rst:668 -#: ../../c-api/exceptions.rst:683 -msgid "signal" -msgstr "signal" - -#: ../../c-api/exceptions.rst:637 ../../c-api/exceptions.rst:668 -msgid "SIGINT (C macro)" -msgstr "" - -#: ../../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:983 -msgid "PyExc_BaseException (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:983 -msgid "PyExc_BaseExceptionGroup (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:983 -msgid "PyExc_Exception (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:983 -msgid "PyExc_ArithmeticError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:983 -msgid "PyExc_AssertionError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:983 -msgid "PyExc_AttributeError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:983 -msgid "PyExc_BlockingIOError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:983 -msgid "PyExc_BrokenPipeError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:983 -msgid "PyExc_BufferError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:983 -msgid "PyExc_ChildProcessError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:983 -msgid "PyExc_ConnectionAbortedError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:983 -msgid "PyExc_ConnectionError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:983 -msgid "PyExc_ConnectionRefusedError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:983 -msgid "PyExc_ConnectionResetError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:983 -msgid "PyExc_EOFError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:983 -msgid "PyExc_FileExistsError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:983 -msgid "PyExc_FileNotFoundError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:983 -msgid "PyExc_FloatingPointError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:983 -msgid "PyExc_GeneratorExit (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:983 -msgid "PyExc_ImportError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:983 -msgid "PyExc_IndentationError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:983 -msgid "PyExc_IndexError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:983 -msgid "PyExc_InterruptedError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:983 -msgid "PyExc_IsADirectoryError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:983 -msgid "PyExc_KeyError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:983 -msgid "PyExc_KeyboardInterrupt (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:983 -msgid "PyExc_LookupError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:983 -msgid "PyExc_MemoryError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:983 -msgid "PyExc_ModuleNotFoundError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:983 -msgid "PyExc_NameError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:983 -msgid "PyExc_NotADirectoryError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:983 -msgid "PyExc_NotImplementedError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:983 -msgid "PyExc_OSError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:983 -msgid "PyExc_OverflowError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:983 -msgid "PyExc_PermissionError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:983 -msgid "PyExc_ProcessLookupError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:983 -msgid "PyExc_PythonFinalizationError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:983 -msgid "PyExc_RecursionError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:983 -msgid "PyExc_ReferenceError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:983 -msgid "PyExc_RuntimeError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:983 -msgid "PyExc_StopAsyncIteration (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:983 -msgid "PyExc_StopIteration (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:983 -msgid "PyExc_SyntaxError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:983 -msgid "PyExc_SystemError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:983 -msgid "PyExc_SystemExit (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:983 -msgid "PyExc_TabError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:983 -msgid "PyExc_TimeoutError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:983 -msgid "PyExc_TypeError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:983 -msgid "PyExc_UnboundLocalError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:983 -msgid "PyExc_UnicodeDecodeError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:983 -msgid "PyExc_UnicodeEncodeError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:983 -msgid "PyExc_UnicodeError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:983 -msgid "PyExc_UnicodeTranslateError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:983 -msgid "PyExc_ValueError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:983 -msgid "PyExc_ZeroDivisionError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:1175 -msgid "PyExc_EnvironmentError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:1175 -msgid "PyExc_IOError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:1175 -msgid "PyExc_WindowsError (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:1212 -msgid "PyExc_Warning (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:1212 -msgid "PyExc_BytesWarning (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:1212 -msgid "PyExc_DeprecationWarning (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:1212 -msgid "PyExc_EncodingWarning (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:1212 -msgid "PyExc_FutureWarning (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:1212 -msgid "PyExc_ImportWarning (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:1212 -msgid "PyExc_PendingDeprecationWarning (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:1212 -msgid "PyExc_ResourceWarning (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:1212 -msgid "PyExc_RuntimeWarning (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:1212 -msgid "PyExc_SyntaxWarning (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:1212 -msgid "PyExc_UnicodeWarning (C var)" -msgstr "" - -#: ../../c-api/exceptions.rst:1212 -msgid "PyExc_UserWarning (C var)" -msgstr "" diff --git a/c-api/file.po b/c-api/file.po index e4e1cce70..0ff467a2d 100644 --- a/c-api/file.po +++ b/c-api/file.po @@ -1,31 +1,27 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Arihiro TAKASE, 2023 -# Masato HASHIMOTO , 2023 -# Osamu NAKAMURA, 2023 -# tomo, 2023 -# Taichi Haradaguchi, 2024 -# 石井明久, 2024 -# Takanori Suzuki , 2024 +# Osamu NAKAMURA, 2017 +# Arihiro TAKASE, 2017 +# tomo, 2021 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-13 14:21+0000\n" -"PO-Revision-Date: 2021-06-28 00:48+0000\n" -"Last-Translator: Takanori Suzuki , 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-03-02 05:36+0000\n" +"PO-Revision-Date: 2017-02-16 17:35+0000\n" +"Last-Translator: tomo, 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/file.rst:6 @@ -35,7 +31,7 @@ msgstr "ファイルオブジェクト" #: ../../c-api/file.rst:10 msgid "" "These APIs are a minimal emulation of the Python 2 C API for built-in file " -"objects, which used to rely on the buffered I/O (:c:expr:`FILE*`) support " +"objects, which used to rely on the buffered I/O (:c:type:`FILE*`) support " "from the C standard library. In Python 3, files and streams use the new :" "mod:`io` module, which defines several layers over the low-level unbuffered " "I/O of the operating system. The functions described below are convenience " @@ -45,7 +41,7 @@ msgid "" msgstr "" "これらの API は、 Python 2 の組み込みのファイルオブジェクトの C API を最低限" "エミュレートするためのものです。それらは、標準 C ライブラリでサポートされてい" -"るバッファ付き I/O (:c:expr:`FILE*`) に頼るために使われます。 Python 3 では、" +"るバッファ付き I/O (:c:type:`FILE*`) に頼るために使われます。 Python 3 では、" "ファイルとストリームは新しい :mod:`io` モジュールを使用され、そこに OS の低レ" "ベルなバッファ付き I/O の上にいくつかの層が定義されています。下で解説されてい" "る関数は、それらの新しい API の便利な C ラッパーであり、インタプリタでの内部" @@ -87,13 +83,13 @@ msgstr "*name* 属性の無視。" #: ../../c-api/file.rst:41 msgid "" -"Return the file descriptor associated with *p* as an :c:expr:`int`. If the " +"Return the file descriptor associated with *p* as an :c:type:`int`. If the " "object is an integer, its value is returned. If not, the object's :meth:" "`~io.IOBase.fileno` method is called if it exists; the method must return an " "integer, which is returned as the file descriptor value. Sets an exception " "and returns ``-1`` on failure." msgstr "" -"*p* に関連づけられる ファイルディスクリプタを :c:expr:`int` として返します。" +"*p* に関連づけられる ファイルディスクリプタを :c:type:`int` として返します。" "オブジェクトが整数なら、その値を返します。 整数でない場合、オブジェクトに :" "meth:`~io.IOBase.fileno` メソッドがあれば呼び出します; このメソッドの返り値" "は、ファイル記述子の値として返される整数でなければなりません。失敗すると例外" @@ -129,18 +125,14 @@ msgstr "" "たハンドラで渡します。" #: ../../c-api/file.rst:68 -msgid "The *handler* is a function of type:" -msgstr "ハンドラーは次の型の関数です。" - -#: ../../c-api/file.rst:73 msgid "" -"Equivalent of :c:expr:`PyObject *(\\*)(PyObject *path, void *userData)`, " -"where *path* is guaranteed to be :c:type:`PyUnicodeObject`." +"The handler is a function of type :c:type:`PyObject *(\\*)(PyObject *path, " +"void *userData)`, where *path* is guaranteed to be :c:type:`PyUnicodeObject`." msgstr "" -":c:expr:`PyObject *(\\*)(PyObject *path, void *userData)` と等価で、 *path* " -"は :c:type:`PyUnicodeObject` であることが保証されています。" +"ハンドラは :c:type:`PyObject *(\\*)(PyObject *path, void *userData)` 型の関数" +"で、 *path* は :c:type:`PyUnicodeObject` であることが保証されています。" -#: ../../c-api/file.rst:77 +#: ../../c-api/file.rst:71 msgid "" "The *userData* pointer is passed into the hook function. Since hook " "functions may be called from different runtimes, this pointer should not " @@ -150,7 +142,7 @@ msgstr "" "フック関数は別なランタイムから呼び出されるかもしれないので、このポインタは直" "接 Python の状態を参照すべきではありません。" -#: ../../c-api/file.rst:81 +#: ../../c-api/file.rst:75 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 " @@ -161,7 +153,7 @@ msgstr "" "ことが分かっている場合を除いては、フック関数の実行中に新しいモジュールをイン" "ポートするのは避けてください。" -#: ../../c-api/file.rst:85 +#: ../../c-api/file.rst:79 msgid "" "Once a hook has been set, it cannot be removed or replaced, and later calls " "to :c:func:`PyFile_SetOpenCodeHook` will fail. On failure, the function " @@ -172,50 +164,34 @@ msgstr "" "この関数が失敗したときは、インタープリタが初期化されていた場合、 -1 を返して" "例外をセットします。" -#: ../../c-api/file.rst:89 +#: ../../c-api/file.rst:83 msgid "This function is safe to call before :c:func:`Py_Initialize`." msgstr "この関数は :c:func:`Py_Initialize` より前に呼び出しても安全です。" -#: ../../c-api/file.rst:91 +#: ../../c-api/file.rst:85 msgid "" "Raises an :ref:`auditing event ` ``setopencodehook`` with no " "arguments." msgstr "" "引数無しで :ref:`監査イベント ` ``setopencodehook`` を送出します。 " -#: ../../c-api/file.rst:101 +#: ../../c-api/file.rst:95 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 " -"written instead of the :func:`repr`. Return ``0`` on success or ``-1`` on " -"failure; the appropriate exception will be set." +"is :const:`Py_PRINT_RAW`; if given, the :func:`str` of the object is written " +"instead of the :func:`repr`. Return ``0`` on success or ``-1`` on failure; " +"the appropriate exception will be set." msgstr "" "オブジェクト *obj* をファイルオブジェクト *p* に書き込みます。 *flags* がサ" -"ポートするフラグは :c:macro:`Py_PRINT_RAW` だけです; このフラグを指定すると、" -"オブジェクトに :func:`repr` ではなく :func:`str` を適用した結果をファイルに書" -"き出します。成功した場合には ``0`` を返し、失敗すると ``-1`` を返して適切な例" -"外をセットします。" +"ポートするフラグは :const:`Py_PRINT_RAW` だけです; このフラグを指定すると、オ" +"ブジェクトに :func:`repr` ではなく :func:`str` を適用した結果をファイルに書き" +"出します。成功した場合には ``0`` を返し、失敗すると ``-1`` を返して適切な例外" +"をセットします。" -#: ../../c-api/file.rst:109 +#: ../../c-api/file.rst:103 msgid "" "Write string *s* to file object *p*. Return ``0`` on success or ``-1`` on " "failure; the appropriate exception will be set." msgstr "" "文字列 *s* をファイルオブジェクト *p* に書き出します。成功した場合には ``0`` " "を返し、失敗すると ``-1`` を返して適切な例外をセットします。" - -#: ../../c-api/file.rst:8 -msgid "object" -msgstr "object" - -#: ../../c-api/file.rst:8 -msgid "file" -msgstr "ファイル" - -#: ../../c-api/file.rst:50 -msgid "EOFError (built-in exception)" -msgstr "EOFError (組み込み例外)" - -#: ../../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 a33d69416..140f6f0c3 100644 --- a/c-api/float.po +++ b/c-api/float.po @@ -1,44 +1,46 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Arihiro TAKASE, 2023 -# tomo, 2023 -# Taichi Haradaguchi, 2024 -# Takeshi Nakazato, 2024 +# Arihiro TAKASE, 2017 +# tomo, 2021 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:48+0000\n" -"Last-Translator: Takeshi Nakazato, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-07 05:06+0000\n" +"PO-Revision-Date: 2017-02-16 17:35+0000\n" +"Last-Translator: tomo, 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/float.rst:6 -msgid "Floating-Point Objects" -msgstr "" +msgid "Floating Point Objects" +msgstr "浮動小数点型オブジェクト (floating point object)" #: ../../c-api/float.rst:13 msgid "" -"This subtype of :c:type:`PyObject` represents a Python floating-point object." +"This subtype of :c:type:`PyObject` represents a Python floating point object." msgstr "" +"この :c:type:`PyObject` のサブタイプは Python 浮動小数点オブジェクトを表現し" +"ます。" #: ../../c-api/float.rst:18 msgid "" -"This instance of :c:type:`PyTypeObject` represents the Python floating-point " +"This instance of :c:type:`PyTypeObject` represents the Python floating point " "type. This is the same object as :class:`float` in the Python layer." msgstr "" +"この :c:type:`PyTypeObject` のインスタンスは Python 浮動小数点型を表現しま" +"す。これは Python レイヤにおける :class:`float` と同じオブジェクトです。" #: ../../c-api/float.rst:24 msgid "" @@ -73,24 +75,32 @@ msgstr "" #: ../../c-api/float.rst:47 msgid "" -"Return a C :c:expr:`double` representation of the contents of *pyfloat*. If " -"*pyfloat* is not a Python floating-point object but has a :meth:`~object." -"__float__` method, this method will first be called to convert *pyfloat* " -"into a float. If :meth:`!__float__` is not defined then it falls back to :" -"meth:`~object.__index__`. This method returns ``-1.0`` upon failure, so one " -"should call :c:func:`PyErr_Occurred` to check for errors." -msgstr "" +"Return a C :c:type:`double` representation of the contents of *pyfloat*. If " +"*pyfloat* is not a Python floating point object but has a :meth:`__float__` " +"method, this method will first be called to convert *pyfloat* into a float. " +"If ``__float__()`` is not defined then it falls back to :meth:`__index__`. " +"This method returns ``-1.0`` upon failure, so one should call :c:func:" +"`PyErr_Occurred` to check for errors." +msgstr "" +"*pyfloat* の指す値を、 C の :c:type:`double` 型表現で返します。 *pyfloat* が " +"Python 浮動小数点オブジェクトではなく、かつ :meth:`__float__` メソッドを持っ" +"ていれば、 *pyfloat* を浮動小数点に変換するためにこのメソッドが最初に呼ばれま" +"す。\n" +" ``__float__()`` が定義されていない場合は、 :meth:`__float__` にフォールバッ" +"クされます。\n" +"このメソッドは失敗した場合 ``-1.0`` を返します。そのため呼び出し元は :c:func:" +"`PyErr_Occurred` を呼んでエラーをチェックすべきです。" #: ../../c-api/float.rst:54 -msgid "Use :meth:`~object.__index__` if available." -msgstr "可能であれば :meth:`~object.__index__` を使うようになりました。" +msgid "Use :meth:`__index__` if available." +msgstr "可能であれば :meth:`__index__` を使うようになりました。" #: ../../c-api/float.rst:60 msgid "" -"Return a C :c:expr:`double` representation of the contents of *pyfloat*, but " +"Return a C :c:type:`double` representation of the contents of *pyfloat*, but " "without error checking." msgstr "" -"*pyfloat* の指す値を、 C の :c:expr:`double` 型表現で返しますが、エラーチェッ" +"*pyfloat* の指す値を、 C の :c:type:`double` 型表現で返しますが、エラーチェッ" "クを行いません。" #: ../../c-api/float.rst:66 @@ -104,145 +114,15 @@ msgstr "" #: ../../c-api/float.rst:73 msgid "" -"Return the maximum representable finite float *DBL_MAX* as C :c:expr:" +"Return the maximum representable finite float *DBL_MAX* as C :c:type:" "`double`." msgstr "" -"float の表現できる最大限解値 *DBL_MAX* を C の :c:expr:`double` 型で返しま" +"float の表現できる最大限解値 *DBL_MAX* を C の :c:type:`double` 型で返しま" "す。" #: ../../c-api/float.rst:78 msgid "" -"Return the minimum normalized positive float *DBL_MIN* as C :c:expr:`double`." +"Return the minimum normalized positive float *DBL_MIN* as C :c:type:`double`." msgstr "" -"float の正規化された最小の正の値 *DBL_MIN* を C の :c:expr:`double` 型で返し" +"float の正規化された最小の正の値 *DBL_MIN* を C の :c:type:`double` 型で返し" "ます。" - -#: ../../c-api/float.rst:82 -msgid "Pack and Unpack functions" -msgstr "" - -#: ../../c-api/float.rst:84 -msgid "" -"The pack and unpack functions provide an efficient platform-independent way " -"to store floating-point values as byte strings. The Pack routines produce a " -"bytes string from a C :c:expr:`double`, and the Unpack routines produce a C :" -"c:expr:`double` from such a bytes string. The suffix (2, 4 or 8) specifies " -"the number of bytes in the bytes string." -msgstr "" - -#: ../../c-api/float.rst:90 -msgid "" -"On platforms that appear to use IEEE 754 formats these functions work by " -"copying bits. On other platforms, the 2-byte format is identical to the IEEE " -"754 binary16 half-precision format, the 4-byte format (32-bit) is identical " -"to the IEEE 754 binary32 single precision format, and the 8-byte format to " -"the IEEE 754 binary64 double precision format, although the packing of INFs " -"and NaNs (if such things exist on the platform) isn't handled correctly, and " -"attempting to unpack a bytes string containing an IEEE INF or NaN will raise " -"an exception." -msgstr "" - -#: ../../c-api/float.rst:99 -msgid "" -"Note that NaNs type may not be preserved on IEEE platforms (silent NaN " -"become quiet), for example on x86 systems in 32-bit mode." -msgstr "" - -#: ../../c-api/float.rst:102 -msgid "" -"On non-IEEE platforms with more precision, or larger dynamic range, than " -"IEEE 754 supports, not all values can be packed; on non-IEEE platforms with " -"less precision, or smaller dynamic range, not all values can be unpacked. " -"What happens in such cases is partly accidental (alas)." -msgstr "" - -#: ../../c-api/float.rst:110 -msgid "Pack functions" -msgstr "" - -#: ../../c-api/float.rst:112 -msgid "" -"The pack routines write 2, 4 or 8 bytes, starting at *p*. *le* is an :c:expr:" -"`int` argument, non-zero if you want the bytes string in little-endian " -"format (exponent last, at ``p+1``, ``p+3``, or ``p+6`` ``p+7``), zero if you " -"want big-endian format (exponent first, at *p*). The :c:macro:" -"`PY_BIG_ENDIAN` constant can be used to use the native endian: it is equal " -"to ``1`` on big endian processor, or ``0`` on little endian processor." -msgstr "" - -#: ../../c-api/float.rst:119 -msgid "" -"Return value: ``0`` if all is OK, ``-1`` if error (and an exception is set, " -"most likely :exc:`OverflowError`)." -msgstr "" - -#: ../../c-api/float.rst:122 -msgid "There are two problems on non-IEEE platforms:" -msgstr "" - -#: ../../c-api/float.rst:124 -msgid "What this does is undefined if *x* is a NaN or infinity." -msgstr "" - -#: ../../c-api/float.rst:125 -msgid "``-0.0`` and ``+0.0`` produce the same bytes string." -msgstr "" - -#: ../../c-api/float.rst:129 -msgid "Pack a C double as the IEEE 754 binary16 half-precision format." -msgstr "" - -#: ../../c-api/float.rst:133 -msgid "Pack a C double as the IEEE 754 binary32 single precision format." -msgstr "" - -#: ../../c-api/float.rst:137 -msgid "Pack a C double as the IEEE 754 binary64 double precision format." -msgstr "" - -#: ../../c-api/float.rst:141 -msgid "Unpack functions" -msgstr "" - -#: ../../c-api/float.rst:143 -msgid "" -"The unpack routines read 2, 4 or 8 bytes, starting at *p*. *le* is an :c:" -"expr:`int` argument, non-zero if the bytes string is in little-endian format " -"(exponent last, at ``p+1``, ``p+3`` or ``p+6`` and ``p+7``), zero if big-" -"endian (exponent first, at *p*). The :c:macro:`PY_BIG_ENDIAN` constant can " -"be used to use the native endian: it is equal to ``1`` on big endian " -"processor, or ``0`` on little endian processor." -msgstr "" - -#: ../../c-api/float.rst:150 -msgid "" -"Return value: The unpacked double. On error, this is ``-1.0`` and :c:func:" -"`PyErr_Occurred` is true (and an exception is set, most likely :exc:" -"`OverflowError`)." -msgstr "" - -#: ../../c-api/float.rst:154 -msgid "" -"Note that on a non-IEEE platform this will refuse to unpack a bytes string " -"that represents a NaN or infinity." -msgstr "" - -#: ../../c-api/float.rst:159 -msgid "Unpack the IEEE 754 binary16 half-precision format as a C double." -msgstr "" - -#: ../../c-api/float.rst:163 -msgid "Unpack the IEEE 754 binary32 single precision format as a C double." -msgstr "" - -#: ../../c-api/float.rst:167 -msgid "Unpack the IEEE 754 binary64 double precision format as a C double." -msgstr "" - -#: ../../c-api/float.rst:8 -msgid "object" -msgstr "object" - -#: ../../c-api/float.rst:8 -msgid "floating-point" -msgstr "浮動小数点" diff --git a/c-api/frame.po b/c-api/frame.po deleted file mode 100644 index 38aee2adc..000000000 --- a/c-api/frame.po +++ /dev/null @@ -1,223 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation -# This file is distributed under the same license as the Python package. -# FIRST AUTHOR , YEAR. -# -# Translators: -# tomo, 2022 -# Arihiro TAKASE, 2023 -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: Python 3.14\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-13 14:21+0000\n" -"PO-Revision-Date: 2022-11-05 19:48+0000\n" -"Last-Translator: Arihiro TAKASE, 2023\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" -"ja/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#: ../../c-api/frame.rst:4 -msgid "Frame Objects" -msgstr "フレーム (frame) オブジェクト" - -#: ../../c-api/frame.rst:8 -msgid "The C structure of the objects used to describe frame objects." -msgstr "" -"フレームオブジェクトを記述する際に用いられる、オブジェクトを表す C 構造体で" -"す。" - -#: ../../c-api/frame.rst:10 -msgid "There are no public members in this structure." -msgstr "" - -#: ../../c-api/frame.rst:12 -msgid "" -"The members of this structure were removed from the public C API. Refer to " -"the :ref:`What's New entry ` for details." -msgstr "" - -#: ../../c-api/frame.rst:17 -msgid "" -"The :c:func:`PyEval_GetFrame` and :c:func:`PyThreadState_GetFrame` functions " -"can be used to get a frame object." -msgstr "" - -#: ../../c-api/frame.rst:20 -msgid "See also :ref:`Reflection `." -msgstr "" - -#: ../../c-api/frame.rst:24 -msgid "" -"The type of frame objects. It is the same object as :py:class:`types." -"FrameType` in the Python layer." -msgstr "" - -#: ../../c-api/frame.rst:29 -msgid "" -"Previously, this type was only available after including ````." -msgstr "" - -#: ../../c-api/frame.rst:34 -msgid "Return non-zero if *obj* is a frame object." -msgstr "" - -#: ../../c-api/frame.rst:38 -msgid "" -"Previously, this function was only available after including ````." -msgstr "" - -#: ../../c-api/frame.rst:43 -msgid "Get the *frame* next outer frame." -msgstr "" - -#: ../../c-api/frame.rst:45 -msgid "" -"Return a :term:`strong reference`, or ``NULL`` if *frame* has no outer frame." -msgstr "" - -#: ../../c-api/frame.rst:53 -msgid "Get the *frame*'s :attr:`~frame.f_builtins` attribute." -msgstr "" - -#: ../../c-api/frame.rst:55 ../../c-api/frame.rst:86 -msgid "Return a :term:`strong reference`. The result cannot be ``NULL``." -msgstr "" - -#: ../../c-api/frame.rst:62 -msgid "Get the *frame* code." -msgstr "" - -#: ../../c-api/frame.rst:64 ../../c-api/frame.rst:130 -msgid "Return a :term:`strong reference`." -msgstr "" - -#: ../../c-api/frame.rst:66 -msgid "The result (frame code) cannot be ``NULL``." -msgstr "" - -#: ../../c-api/frame.rst:73 -msgid "" -"Get the generator, coroutine, or async generator that owns this frame, or " -"``NULL`` if this frame is not owned by a generator. Does not raise an " -"exception, even if the return value is ``NULL``." -msgstr "" - -#: ../../c-api/frame.rst:77 -msgid "Return a :term:`strong reference`, or ``NULL``." -msgstr "" - -#: ../../c-api/frame.rst:84 -msgid "Get the *frame*'s :attr:`~frame.f_globals` attribute." -msgstr "" - -#: ../../c-api/frame.rst:93 -msgid "Get the *frame*'s :attr:`~frame.f_lasti` attribute." -msgstr "" - -#: ../../c-api/frame.rst:95 -msgid "Returns -1 if ``frame.f_lasti`` is ``None``." -msgstr "" - -#: ../../c-api/frame.rst:102 -msgid "Get the variable *name* of *frame*." -msgstr "" - -#: ../../c-api/frame.rst:104 -msgid "Return a :term:`strong reference` to the variable value on success." -msgstr "" - -#: ../../c-api/frame.rst:105 -msgid "" -"Raise :exc:`NameError` and return ``NULL`` if the variable does not exist." -msgstr "" - -#: ../../c-api/frame.rst:106 -msgid "Raise an exception and return ``NULL`` on error." -msgstr "" - -#: ../../c-api/frame.rst:108 -msgid "*name* type must be a :class:`str`." -msgstr "" - -#: ../../c-api/frame.rst:115 -msgid "" -"Similar to :c:func:`PyFrame_GetVar`, but the variable name is a C string " -"encoded in UTF-8." -msgstr "" - -#: ../../c-api/frame.rst:123 -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:140 -msgid "Return the line number that *frame* is currently executing." -msgstr "*frame* が現在実行している行番号を返します。" - -#: ../../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:167 -msgid "Unless using :pep:`523`, you will not need this." -msgstr "" - -#: ../../c-api/frame.rst:171 -msgid "The interpreter's internal frame representation." -msgstr "" - -#: ../../c-api/frame.rst:177 -msgid "Return a :term:`strong reference` to the code object for the frame." -msgstr "" - -#: ../../c-api/frame.rst:184 -msgid "Return the byte offset into the last executed instruction." -msgstr "" - -#: ../../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 399245e03..cfa1c41cf 100644 --- a/c-api/function.po +++ b/c-api/function.po @@ -1,26 +1,27 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2023 -# Taichi Haradaguchi, 2024 +# Arihiro TAKASE, 2017 +# Osamu NAKAMURA, 2017 +# tomo, 2021 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-30 14:22+0000\n" -"PO-Revision-Date: 2021-06-28 00:48+0000\n" -"Last-Translator: Taichi Haradaguchi, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-07 05:06+0000\n" +"PO-Revision-Date: 2017-02-16 17:35+0000\n" +"Last-Translator: tomo, 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/function.rst:6 @@ -65,61 +66,56 @@ 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. " +"*__module__* is retrieved from *globals*. The argument defaults, annotations " +"and closure are set to ``NULL``. *__qualname__* is set to the same value as " +"the function's name." msgstr "" "関数のドキュメント文字列と名前はコードオブジェクトから取得されます。\n" -":attr:`~function.__module__` は *globals* から取得されます。\n" -"引数のデフォルト値やアノテーション、クロージャは ``NULL`` に設定されます。 :" -"attr:`~function.__qualname__` はコードオブジェクトの :attr:`~codeobject." -"co_qualname` フィールドと同じ値に設定されます。" +"*__module__* は *globals* から取得されます。\n" +"引数のデフォルト値やアノテーション、クロージャは ``NULL`` に設定されます。 " +"*__qualname__* は関数名と同じ値に設定されます。" -#: ../../c-api/function.rst:46 +#: ../../c-api/function.rst:44 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 " +"``__qualname__`` attribute. *qualname* should be a unicode object or " +"``NULL``; if ``NULL``, the ``__qualname__`` attribute is set to the same " +"value as its ``__name__`` attribute." msgstr "" -":c:func:`PyFunction_New` に似ていますが、関数オブジェクトの :attr:`~function." -"__qualname__` 属性に値をセットできます。\n" +":c:func:`PyFunction_New` に似ていますが、関数オブジェクトの ``__qualname__`` " +"属性に値をセットできます。\n" "*qualname* はユニコードオブジェクトか ``NULL`` でなくてはなりません。" -"``NULL`` だった場合、 :attr:`!__qualname__` 属性にはコードオブジェクトの :" -"attr:`~codeobject.co_qualname` フィールドと同じ値がセットされます。" +"``NULL`` だった場合、 ``__qualname__`` 属性には ``__name__`` 属性と同じ値が" +"セットされます。" -#: ../../c-api/function.rst:57 +#: ../../c-api/function.rst:54 msgid "Return the code object associated with the function object *op*." msgstr "関数オブジェクト *op* に関連付けられたコードオブジェクトを返します。" -#: ../../c-api/function.rst:62 +#: ../../c-api/function.rst:59 msgid "Return the globals dictionary associated with the function object *op*." msgstr "関数オブジェクト *op* に関連付けられたglobals辞書を返します。" -#: ../../c-api/function.rst:67 +#: ../../c-api/function.rst:64 msgid "" -"Return a :term:`borrowed reference` to the :attr:`~function.__module__` " -"attribute of the :ref:`function object ` *op*. It can be " -"*NULL*." +"Return the *__module__* attribute of the function object *op*. This is " +"normally a string containing the module name, but can be set to any other " +"object by Python code." msgstr "" +"関数オブジェクト *op* の *__module__* 属性を返します。これには普通はモジュー" +"ル名の文字列が入っていますが、Python コードから他のオブジェクトをセットされる" +"こともあります。" #: ../../c-api/function.rst:71 msgid "" -"This is normally a :class:`string ` containing the module name, but can " -"be set to any other object by Python code." -msgstr "" - -#: ../../c-api/function.rst:77 -msgid "" "Return the argument default values of the function object *op*. This can be " "a tuple of arguments or ``NULL``." msgstr "" "関数オブジェクト *op* の引数のデフォルト値を返します。\n" "引数のタプルか ``NULL`` になります。" -#: ../../c-api/function.rst:83 +#: ../../c-api/function.rst:77 msgid "" "Set the argument default values for the function object *op*. *defaults* " "must be ``Py_None`` or a tuple." @@ -127,22 +123,12 @@ msgstr "" "関数オブジェクト *op* の引数のデフォルト値を設定します。\n" "*defaults* は ``Py_None`` かタプルでなければいけません。" -#: ../../c-api/function.rst:86 ../../c-api/function.rst:109 -#: ../../c-api/function.rst:123 +#: ../../c-api/function.rst:80 ../../c-api/function.rst:94 +#: ../../c-api/function.rst:108 msgid "Raises :exc:`SystemError` and returns ``-1`` on failure." msgstr "失敗した時は、 :exc:`SystemError` を発生させ、 ``-1`` を返します。" -#: ../../c-api/function.rst:91 -msgid "Set the vectorcall field of a given function object *func*." -msgstr "" - -#: ../../c-api/function.rst:93 -msgid "" -"Warning: extensions using this API must preserve the behavior of the " -"unaltered (default) vectorcall function!" -msgstr "" - -#: ../../c-api/function.rst:100 +#: ../../c-api/function.rst:85 msgid "" "Return the closure associated with the function object *op*. This can be " "``NULL`` or a tuple of cell objects." @@ -150,7 +136,7 @@ msgstr "" "関数オブジェクト *op* に設定されたクロージャを返します。\n" "``NULL`` か cell オブジェクトのタプルです。" -#: ../../c-api/function.rst:106 +#: ../../c-api/function.rst:91 msgid "" "Set the closure associated with the function object *op*. *closure* must be " "``Py_None`` or a tuple of cell objects." @@ -159,7 +145,7 @@ msgstr "" "*closure* は、``Py_None`` もしくは cell オブジェクトのタプルでなければなりま" "せん。" -#: ../../c-api/function.rst:114 +#: ../../c-api/function.rst:99 msgid "" "Return the annotations of the function object *op*. This can be a mutable " "dictionary or ``NULL``." @@ -167,116 +153,10 @@ msgstr "" "関数オブジェクト *op* のアノテーションを返します。\n" "返り値は修正可能な辞書か ``NULL`` になります。" -#: ../../c-api/function.rst:120 +#: ../../c-api/function.rst:105 msgid "" "Set the annotations for the function object *op*. *annotations* must be a " "dictionary or ``Py_None``." msgstr "" "関数オブジェクト *op* のアノテーションを設定します。\n" "*annotations* は辞書か、``Py_None`` でなければなりません。" - -#: ../../c-api/function.rst:128 -msgid "" -"Register *callback* as a function watcher for the current interpreter. " -"Return an ID which may be passed to :c:func:`PyFunction_ClearWatcher`. In " -"case of error (e.g. no more watcher IDs available), return ``-1`` and set an " -"exception." -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.)" -msgstr "" - -#: ../../c-api/function.rst:148 -msgid "Enumeration of possible function watcher events:" -msgstr "" - -#: ../../c-api/function.rst:150 -msgid "``PyFunction_EVENT_CREATE``" -msgstr "" - -#: ../../c-api/function.rst:151 -msgid "``PyFunction_EVENT_DESTROY``" -msgstr "" - -#: ../../c-api/function.rst:152 -msgid "``PyFunction_EVENT_MODIFY_CODE``" -msgstr "" - -#: ../../c-api/function.rst:153 -msgid "``PyFunction_EVENT_MODIFY_DEFAULTS``" -msgstr "" - -#: ../../c-api/function.rst:154 -msgid "``PyFunction_EVENT_MODIFY_KWDEFAULTS``" -msgstr "" - -#: ../../c-api/function.rst:161 -msgid "Type of a function watcher callback function." -msgstr "" - -#: ../../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." -msgstr "" - -#: ../../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:171 -msgid "" -"If *event* is ``PyFunction_EVENT_CREATE``, then the callback is invoked " -"after *func* has been fully initialized. Otherwise, the callback is invoked " -"before the modification to *func* takes place, so the prior state of *func* " -"can be inspected. The runtime is permitted to optimize away the creation of " -"function objects when possible. In such cases no event will be emitted. " -"Although this creates the possibility of an observable difference of runtime " -"behavior depending on optimization decisions, it does not change the " -"semantics of the Python code being executed." -msgstr "" - -#: ../../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 " -"it from being freed at this time. When the resurrected object is destroyed " -"later, any watcher callbacks active at that time will be called again." -msgstr "" - -#: ../../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``." -msgstr "" - -#: ../../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 " -"set. This means the callback may not call any other API that can set an " -"exception unless it saves and clears the exception state first, and restores " -"it before returning." -msgstr "" - -#: ../../c-api/function.rst:8 -msgid "object" -msgstr "object" - -#: ../../c-api/function.rst:8 -msgid "function" -msgstr "関数" - -#: ../../c-api/function.rst:20 -msgid "MethodType (in module types)" -msgstr "MethodType (in module types)" diff --git a/c-api/gcsupport.po b/c-api/gcsupport.po index 020f221d5..4cab9424d 100644 --- a/c-api/gcsupport.po +++ b/c-api/gcsupport.po @@ -1,25 +1,27 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2025 +# Nozomu Kaneko , 2017 +# Arihiro TAKASE, 2017 +# tomo, 2020 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-06 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:48+0000\n" -"Last-Translator: tomo, 2025\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-05-29 06:28+0000\n" +"PO-Revision-Date: 2017-02-16 17:35+0000\n" +"Last-Translator: tomo, 2020\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/gcsupport.rst:6 @@ -45,17 +47,18 @@ msgstr "" #: ../../c-api/gcsupport.rst:15 msgid "" "To create a container type, the :c:member:`~PyTypeObject.tp_flags` field of " -"the type object must include the :c:macro:`Py_TPFLAGS_HAVE_GC` and provide " -"an implementation of the :c:member:`~PyTypeObject.tp_traverse` handler. If " +"the type object must include the :const:`Py_TPFLAGS_HAVE_GC` and provide an " +"implementation of the :c:member:`~PyTypeObject.tp_traverse` handler. If " "instances of the type are mutable, a :c:member:`~PyTypeObject.tp_clear` " "implementation must also be provided." msgstr "" +"コンテナ型を作るには、型オブジェクトの :c:member:`~PyTypeObject.tp_flags` " +"フィールドに :const:`Py_TPFLAGS_HAVE_GC` フラグが立っており、 :c:member:" +"`~PyTypeObject.tp_traverse` ハンドラの実装を提供しなければなりません。実装す" +"る型のインスタンスが変更可能な場合は、 :c:member:`~PyTypeObject.tp_clear` の" +"実装も提供しなければなりません。" -#: ../../c-api/gcsupport.rst:21 -msgid ":c:macro:`Py_TPFLAGS_HAVE_GC`" -msgstr "" - -#: ../../c-api/gcsupport.rst:22 +#: ../../c-api/gcsupport.rst:24 msgid "" "Objects with a type with this flag set must conform with the rules " "documented here. For convenience these objects will be referred to as " @@ -65,18 +68,20 @@ msgstr "" "なりません。簡単のため、このフラグをセットした型のオブジェクトをコンテナオブ" "ジェクトと呼びます。" -#: ../../c-api/gcsupport.rst:26 +#: ../../c-api/gcsupport.rst:28 msgid "Constructors for container types must conform to two rules:" msgstr "" "コンテナ型のコンストラクタは以下の二つの規則に適合しなければなりません:" -#: ../../c-api/gcsupport.rst:28 +#: ../../c-api/gcsupport.rst:30 msgid "" -"The memory for the object must be allocated using :c:macro:`PyObject_GC_New` " -"or :c:macro:`PyObject_GC_NewVar`." +"The memory for the object must be allocated using :c:func:`PyObject_GC_New` " +"or :c:func:`PyObject_GC_NewVar`." msgstr "" +"オブジェクトのメモリは :c:func:`PyObject_GC_New` または :c:func:" +"`PyObject_GC_NewVar` で確保しなければなりません。" -#: ../../c-api/gcsupport.rst:31 +#: ../../c-api/gcsupport.rst:33 msgid "" "Once all the fields which may contain references to other containers are " "initialized, it must call :c:func:`PyObject_GC_Track`." @@ -84,36 +89,14 @@ msgstr "" "他のコンテナへの参照が入るかもしれないフィールドが全て初期化されたら、すぐ" "に :c:func:`PyObject_GC_Track` を呼び出さなければなりません。" -#: ../../c-api/gcsupport.rst:34 -msgid "" -"Similarly, the deallocator for the object must conform to a similar pair of " -"rules:" -msgstr "" -"同様に、オブジェクトのメモリ解放関数も以下の二つの規則に適合しなければなりま" -"せん:" - #: ../../c-api/gcsupport.rst:37 msgid "" -"Before fields which refer to other containers are invalidated, :c:func:" -"`PyObject_GC_UnTrack` must be called." -msgstr "" -"他のコンテナを参照しているフィールドを無効化する前に、 :c:func:" -"`PyObject_GC_UnTrack` を呼び出さなければなりません。" - -#: ../../c-api/gcsupport.rst:40 -msgid "" -"The object's memory must be deallocated using :c:func:`PyObject_GC_Del`." -msgstr "" -"オブジェクトのメモリは :c:func:`PyObject_GC_Del` で解放しなければなりません。" - -#: ../../c-api/gcsupport.rst:43 -msgid "" "If a type adds the Py_TPFLAGS_HAVE_GC, then it *must* implement at least a :" "c:member:`~PyTypeObject.tp_traverse` handler or explicitly use one from its " "subclass or subclasses." msgstr "" -#: ../../c-api/gcsupport.rst:47 +#: ../../c-api/gcsupport.rst:41 msgid "" "When calling :c:func:`PyType_Ready` or some of the APIs that indirectly call " "it like :c:func:`PyType_FromSpecWithBases` or :c:func:`PyType_FromSpec` the " @@ -121,104 +104,36 @@ msgid "" "tp_flags`, :c:member:`~PyTypeObject.tp_traverse` and :c:member:" "`~PyTypeObject.tp_clear` fields if the type inherits from a class that " "implements the garbage collector protocol and the child class does *not* " -"include the :c:macro:`Py_TPFLAGS_HAVE_GC` flag." -msgstr "" - -#: ../../c-api/gcsupport.rst:57 -msgid "" -"Analogous to :c:macro:`PyObject_New` but for container objects with the :c:" -"macro:`Py_TPFLAGS_HAVE_GC` flag set." -msgstr "" - -#: ../../c-api/gcsupport.rst:60 ../../c-api/gcsupport.rst:84 -msgid "" -"Do not call this directly to allocate memory for an object; call the type's :" -"c:member:`~PyTypeObject.tp_alloc` slot instead." -msgstr "" - -#: ../../c-api/gcsupport.rst:63 ../../c-api/gcsupport.rst:87 -msgid "" -"When populating a type's :c:member:`~PyTypeObject.tp_alloc` slot, :c:func:" -"`PyType_GenericAlloc` is preferred over a custom function that simply calls " -"this macro." -msgstr "" - -#: ../../c-api/gcsupport.rst:67 ../../c-api/gcsupport.rst:91 -msgid "" -"Memory allocated by this macro must be freed with :c:func:`PyObject_GC_Del` " -"(usually called via the object's :c:member:`~PyTypeObject.tp_free` slot)." -msgstr "" - -#: ../../c-api/gcsupport.rst:73 ../../c-api/gcsupport.rst:97 -msgid ":c:func:`PyObject_GC_Del`" -msgstr "" - -#: ../../c-api/gcsupport.rst:74 -msgid ":c:macro:`PyObject_New`" -msgstr "" - -#: ../../c-api/gcsupport.rst:75 ../../c-api/gcsupport.rst:99 -#: ../../c-api/gcsupport.rst:193 -msgid ":c:func:`PyType_GenericAlloc`" -msgstr "" - -#: ../../c-api/gcsupport.rst:76 ../../c-api/gcsupport.rst:100 -msgid ":c:member:`~PyTypeObject.tp_alloc`" -msgstr ":c:member:`~PyTypeObject.tp_alloc`" - -#: ../../c-api/gcsupport.rst:81 -msgid "" -"Analogous to :c:macro:`PyObject_NewVar` but for container objects with the :" -"c:macro:`Py_TPFLAGS_HAVE_GC` flag set." -msgstr "" - -#: ../../c-api/gcsupport.rst:98 -msgid ":c:macro:`PyObject_NewVar`" -msgstr "" - -#: ../../c-api/gcsupport.rst:105 -msgid "" -"Analogous to :c:macro:`PyObject_GC_New` but allocates *extra_size* bytes at " -"the end of the object (at offset :c:member:`~PyTypeObject.tp_basicsize`). " -"The allocated memory is initialized to zeros, except for the :c:type:`Python " -"object header `." -msgstr "" - -#: ../../c-api/gcsupport.rst:111 -msgid "" -"The extra data will be deallocated with the object, but otherwise it is not " -"managed by Python." -msgstr "" - -#: ../../c-api/gcsupport.rst:114 -msgid "" -"Memory allocated by this function must be freed with :c:func:" -"`PyObject_GC_Del` (usually called via the object's :c:member:`~PyTypeObject." -"tp_free` slot)." +"include the :const:`Py_TPFLAGS_HAVE_GC` flag." msgstr "" -#: ../../c-api/gcsupport.rst:119 +#: ../../c-api/gcsupport.rst:51 msgid "" -"The function is marked as unstable because the final mechanism for reserving " -"extra data after an instance is not yet decided. For allocating a variable " -"number of fields, prefer using :c:type:`PyVarObject` and :c:member:" -"`~PyTypeObject.tp_itemsize` instead." +"Analogous to :c:func:`PyObject_New` but for container objects with the :" +"const:`Py_TPFLAGS_HAVE_GC` flag set." msgstr "" +":c:func:`PyObject_New` に似ていますが、 :const:`Py_TPFLAGS_HAVE_GC` のセット" +"されたコンテナオブジェクト用です。" -#: ../../c-api/gcsupport.rst:130 +#: ../../c-api/gcsupport.rst:57 msgid "" -"Resize an object allocated by :c:macro:`PyObject_NewVar`. Returns the " -"resized object of type ``TYPE*`` (refers to any C type) or ``NULL`` on " -"failure." +"Analogous to :c:func:`PyObject_NewVar` but for container objects with the :" +"const:`Py_TPFLAGS_HAVE_GC` flag set." msgstr "" +":c:func:`PyObject_NewVar` に似ていますが、 :const:`Py_TPFLAGS_HAVE_GC` のセッ" +"トされたコンテナオブジェクト用です。" -#: ../../c-api/gcsupport.rst:134 +#: ../../c-api/gcsupport.rst:63 msgid "" -"*op* must be of type :c:expr:`PyVarObject *` and must not be tracked by the " -"collector yet. *newsize* must be of type :c:type:`Py_ssize_t`." +"Resize an object allocated by :c:func:`PyObject_NewVar`. Returns the " +"resized object or ``NULL`` on failure. *op* must not be tracked by the " +"collector yet." msgstr "" +":c:func:`PyObject_NewVar` が確保したオブジェクトのメモリをリサイズします。\n" +"リサイズされたオブジェクトを返します。失敗すると ``NULL`` を返します。\n" +"*op* はコレクタに追跡されていてはなりません。" -#: ../../c-api/gcsupport.rst:141 +#: ../../c-api/gcsupport.rst:69 msgid "" "Adds the object *op* to the set of container objects tracked by the " "collector. The collector can run at unexpected times so objects must be " @@ -232,74 +147,69 @@ msgstr "" "対象となる全てのフィールドが正しい状態になってすぐに、たいていはコンストラク" "タの末尾付近で、呼び出すべきです。" -#: ../../c-api/gcsupport.rst:150 +#: ../../c-api/gcsupport.rst:78 msgid "" "Returns non-zero if the object implements the garbage collector protocol, " "otherwise returns 0." msgstr "" -#: ../../c-api/gcsupport.rst:153 +#: ../../c-api/gcsupport.rst:81 msgid "" "The object cannot be tracked by the garbage collector if this function " "returns 0." msgstr "" -#: ../../c-api/gcsupport.rst:158 +#: ../../c-api/gcsupport.rst:86 msgid "" "Returns 1 if the object type of *op* implements the GC protocol and *op* is " "being currently tracked by the garbage collector and 0 otherwise." msgstr "" -#: ../../c-api/gcsupport.rst:161 +#: ../../c-api/gcsupport.rst:89 msgid "This is analogous to the Python function :func:`gc.is_tracked`." msgstr "" -#: ../../c-api/gcsupport.rst:168 +#: ../../c-api/gcsupport.rst:96 msgid "" "Returns 1 if the object type of *op* implements the GC protocol and *op* has " "been already finalized by the garbage collector and 0 otherwise." msgstr "" -#: ../../c-api/gcsupport.rst:171 +#: ../../c-api/gcsupport.rst:99 msgid "This is analogous to the Python function :func:`gc.is_finalized`." msgstr "" -#: ../../c-api/gcsupport.rst:178 +#: ../../c-api/gcsupport.rst:103 msgid "" -"Releases memory allocated to an object using :c:macro:`PyObject_GC_New` or :" -"c:macro:`PyObject_GC_NewVar`." +"Similarly, the deallocator for the object must conform to a similar pair of " +"rules:" msgstr "" +"同様に、オブジェクトのメモリ解放関数も以下の二つの規則に適合しなければなりま" +"せん:" -#: ../../c-api/gcsupport.rst:181 +#: ../../c-api/gcsupport.rst:106 msgid "" -"Do not call this directly to free an object's memory; call the type's :c:" -"member:`~PyTypeObject.tp_free` slot instead." +"Before fields which refer to other containers are invalidated, :c:func:" +"`PyObject_GC_UnTrack` must be called." msgstr "" +"他のコンテナを参照しているフィールドを無効化する前に、 :c:func:" +"`PyObject_GC_UnTrack` を呼び出さなければなりません。" -#: ../../c-api/gcsupport.rst:184 +#: ../../c-api/gcsupport.rst:109 msgid "" -"Do not use this for memory allocated by :c:macro:`PyObject_New`, :c:macro:" -"`PyObject_NewVar`, or related allocation functions; use :c:func:" -"`PyObject_Free` instead." -msgstr "" - -#: ../../c-api/gcsupport.rst:190 -msgid ":c:func:`PyObject_Free` is the non-GC equivalent of this function." -msgstr "" - -#: ../../c-api/gcsupport.rst:191 -msgid ":c:macro:`PyObject_GC_New`" +"The object's memory must be deallocated using :c:func:`PyObject_GC_Del`." msgstr "" +"オブジェクトのメモリは :c:func:`PyObject_GC_Del` で解放しなければなりません。" -#: ../../c-api/gcsupport.rst:192 -msgid ":c:macro:`PyObject_GC_NewVar`" +#: ../../c-api/gcsupport.rst:114 +msgid "" +"Releases memory allocated to an object using :c:func:`PyObject_GC_New` or :c:" +"func:`PyObject_GC_NewVar`." msgstr "" +":c:func:`PyObject_GC_New` や :c:func:`PyObject_GC_NewVar` を使って確保された" +"メモリを解放します。" -#: ../../c-api/gcsupport.rst:194 -msgid ":c:member:`~PyTypeObject.tp_free`" -msgstr ":c:member:`~PyTypeObject.tp_free`" - -#: ../../c-api/gcsupport.rst:199 +#: ../../c-api/gcsupport.rst:120 msgid "" "Remove the object *op* from the set of container objects tracked by the " "collector. Note that :c:func:`PyObject_GC_Track` can be called again on " @@ -315,13 +225,15 @@ msgstr "" "ケータ (:c:member:`~PyTypeObject.tp_dealloc` ハンドラ) はオブジェクトに対し" "て、この関数を呼び出すべきです。" -#: ../../c-api/gcsupport.rst:208 +#: ../../c-api/gcsupport.rst:129 msgid "" -"The :c:func:`!_PyObject_GC_TRACK` and :c:func:`!_PyObject_GC_UNTRACK` macros " +"The :c:func:`_PyObject_GC_TRACK` and :c:func:`_PyObject_GC_UNTRACK` macros " "have been removed from the public C API." msgstr "" +":c:func:`_PyObject_GC_TRACK` マクロと :c:func:`_PyObject_GC_UNTRACK` マクロは" +"公開 C API から外されました。" -#: ../../c-api/gcsupport.rst:211 +#: ../../c-api/gcsupport.rst:132 msgid "" "The :c:member:`~PyTypeObject.tp_traverse` handler accepts a function " "parameter of this type:" @@ -329,7 +241,7 @@ msgstr "" ":c:member:`~PyTypeObject.tp_traverse` ハンドラはこの型の関数パラメータを受け" "取ります:" -#: ../../c-api/gcsupport.rst:216 +#: ../../c-api/gcsupport.rst:137 msgid "" "Type of the visitor function passed to the :c:member:`~PyTypeObject." "tp_traverse` handler. The function should be called with an object to " @@ -345,7 +257,7 @@ msgstr "" "循環参照を検出する仕組みを実装します; ユーザが自身のためにビジター関数を書く" "必要が出てくることはないでしょう。" -#: ../../c-api/gcsupport.rst:223 +#: ../../c-api/gcsupport.rst:144 msgid "" "The :c:member:`~PyTypeObject.tp_traverse` handler must have the following " "type:" @@ -353,7 +265,7 @@ msgstr "" ":c:member:`~PyTypeObject.tp_traverse` ハンドラは次の型を持っていなければなり" "ません:" -#: ../../c-api/gcsupport.rst:228 +#: ../../c-api/gcsupport.rst:149 msgid "" "Traversal function for a container object. Implementations must call the " "*visit* function for each object directly contained by *self*, with the " @@ -371,7 +283,7 @@ msgstr "" "*visit* が非ゼロの値を返す場合、エラーが発生し、戻り値をそのまま返すようにし" "なければなりません。" -#: ../../c-api/gcsupport.rst:235 +#: ../../c-api/gcsupport.rst:156 msgid "" "To simplify writing :c:member:`~PyTypeObject.tp_traverse` handlers, a :c:" "func:`Py_VISIT` macro is provided. In order to use this macro, the :c:" @@ -383,26 +295,19 @@ msgstr "" "`~PyTypeObject.tp_traverse` の実装関数の引数は、一文字も違わず *visit* と " "*arg* でなければなりません:" -#: ../../c-api/gcsupport.rst:242 -msgid "" -"If the :c:expr:`PyObject *` *o* is not ``NULL``, call the *visit* callback, " -"with arguments *o* and *arg*. If *visit* returns a non-zero value, then " -"return it. Using this macro, :c:member:`~PyTypeObject.tp_traverse` handlers " -"look like::" -msgstr "" - -#: ../../c-api/gcsupport.rst:247 +#: ../../c-api/gcsupport.rst:163 msgid "" -"static int\n" -"my_traverse(Noddy *self, visitproc visit, void *arg)\n" -"{\n" -" Py_VISIT(self->foo);\n" -" Py_VISIT(self->bar);\n" -" return 0;\n" -"}" +"If *o* is not ``NULL``, call the *visit* callback, with arguments *o* and " +"*arg*. If *visit* returns a non-zero value, then return it. Using this " +"macro, :c:member:`~PyTypeObject.tp_traverse` handlers look like::" msgstr "" +"*o* が ``NULL`` でなければ、 *o* と *arg* を引数にして *visit* コールバックを" +"呼び出します。\n" +"*visit* がゼロでない値を返した場合、その値を返します。\n" +"このマクロを使うと、 :c:member:`~PyTypeObject.tp_traverse` ハンドラは次のよう" +"になります::" -#: ../../c-api/gcsupport.rst:255 +#: ../../c-api/gcsupport.rst:176 msgid "" "The :c:member:`~PyTypeObject.tp_clear` handler must be of the :c:type:" "`inquiry` type, or ``NULL`` if the object is immutable." @@ -410,7 +315,7 @@ msgstr "" ":c:member:`~PyTypeObject.tp_clear` ハンドラは :c:type:`inquiry` 型であるか、" "オブジェクトが不変 (immutable) な場合は ``NULL`` でなければなりません。" -#: ../../c-api/gcsupport.rst:261 +#: ../../c-api/gcsupport.rst:182 msgid "" "Drop references that may have created reference cycles. Immutable objects " "do not have to define this method since they can never directly create " @@ -425,83 +330,3 @@ msgstr "" "いので注意してください (参照に対して :c:func:`Py_DECREF` を呼ぶだけにしないで" "ください)。ガベージコレクタは、オブジェクトが循環参照を形成していることを検出" "した際にこのメソッドを呼び出します。" - -#: ../../c-api/gcsupport.rst:270 -msgid "Controlling the Garbage Collector State" -msgstr "" - -#: ../../c-api/gcsupport.rst:272 -msgid "" -"The C-API provides the following functions for controlling garbage " -"collection runs." -msgstr "" - -#: ../../c-api/gcsupport.rst:277 -msgid "" -"Perform a full garbage collection, if the garbage collector is enabled. " -"(Note that :func:`gc.collect` runs it unconditionally.)" -msgstr "" - -#: ../../c-api/gcsupport.rst:280 -msgid "" -"Returns the number of collected + unreachable objects which cannot be " -"collected. If the garbage collector is disabled or already collecting, " -"returns ``0`` immediately. Errors during garbage collection are passed to :" -"data:`sys.unraisablehook`. This function does not raise exceptions." -msgstr "" - -#: ../../c-api/gcsupport.rst:290 -msgid "" -"Enable the garbage collector: similar to :func:`gc.enable`. Returns the " -"previous state, 0 for disabled and 1 for enabled." -msgstr "" - -#: ../../c-api/gcsupport.rst:298 -msgid "" -"Disable the garbage collector: similar to :func:`gc.disable`. Returns the " -"previous state, 0 for disabled and 1 for enabled." -msgstr "" - -#: ../../c-api/gcsupport.rst:306 -msgid "" -"Query the state of the garbage collector: similar to :func:`gc.isenabled`. " -"Returns the current state, 0 for disabled and 1 for enabled." -msgstr "" - -#: ../../c-api/gcsupport.rst:313 -msgid "Querying Garbage Collector State" -msgstr "" - -#: ../../c-api/gcsupport.rst:315 -msgid "" -"The C-API provides the following interface for querying information about " -"the garbage collector." -msgstr "" - -#: ../../c-api/gcsupport.rst:320 -msgid "" -"Run supplied *callback* on all live GC-capable objects. *arg* is passed " -"through to all invocations of *callback*." -msgstr "" - -#: ../../c-api/gcsupport.rst:324 -msgid "" -"If new objects are (de)allocated by the callback it is undefined if they " -"will be visited." -msgstr "" - -#: ../../c-api/gcsupport.rst:327 -msgid "" -"Garbage collection is disabled during operation. Explicitly running a " -"collection in the callback may lead to undefined behaviour e.g. visiting the " -"same objects multiple times or not at all." -msgstr "" - -#: ../../c-api/gcsupport.rst:335 -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 ``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 a5212883a..6482cf235 100644 --- a/c-api/gen.po +++ b/c-api/gen.po @@ -1,25 +1,28 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: +# E. Kawashima, 2017 +# Arihiro TAKASE, 2017 +# 秘湯 , 2017 # tomo, 2021 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-30 14:22+0000\n" -"PO-Revision-Date: 2021-06-28 00:48+0000\n" +"POT-Creation-Date: 2021-01-07 05:06+0000\n" +"PO-Revision-Date: 2017-02-16 17:35+0000\n" "Last-Translator: tomo, 2021\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/gen.rst:6 diff --git a/c-api/hash.po b/c-api/hash.po deleted file mode 100644 index e9e4f015f..000000000 --- a/c-api/hash.po +++ /dev/null @@ -1,128 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation -# This file is distributed under the same license as the Python package. -# FIRST AUTHOR , YEAR. -# -# Translators: -# Taichi Haradaguchi, 2024 -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: Python 3.14\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2024-02-23 14:15+0000\n" -"Last-Translator: Taichi Haradaguchi, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" -"ja/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#: ../../c-api/hash.rst:4 -msgid "PyHash API" -msgstr "PyHash API" - -#: ../../c-api/hash.rst:6 -msgid "" -"See also the :c:member:`PyTypeObject.tp_hash` member and :ref:`numeric-hash`." -msgstr "" - -#: ../../c-api/hash.rst:10 -msgid "Hash value type: signed integer." -msgstr "" - -#: ../../c-api/hash.rst:16 -msgid "Hash value type: unsigned integer." -msgstr "" - -#: ../../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-api/hash.rst:60 -msgid "Hash function name (UTF-8 encoded string)." -msgstr "" - -#: ../../c-api/hash.rst:64 -msgid "Internal size of the hash value in bits." -msgstr "" - -#: ../../c-api/hash.rst:68 -msgid "Size of seed input in bits." -msgstr "" - -#: ../../c-api/hash.rst:75 -msgid "Get the hash function definition." -msgstr "" - -#: ../../c-api/hash.rst:78 -msgid ":pep:`456` \"Secure and interchangeable hash algorithm\"." -msgstr "" - -#: ../../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:95 -msgid "" -"Compute and return the hash value of a buffer of *len* bytes starting at " -"address *ptr*. The hash is guaranteed to match that of :class:`bytes`, :" -"class:`memoryview`, and other built-in objects that implement the :ref:" -"`buffer protocol `." -msgstr "" - -#: ../../c-api/hash.rst:100 -msgid "" -"Use this function to implement hashing for immutable objects whose :c:member:" -"`~PyTypeObject.tp_richcompare` function compares to another object's buffer." -msgstr "" - -#: ../../c-api/hash.rst:104 -msgid "*len* must be greater than or equal to ``0``." -msgstr "" - -#: ../../c-api/hash.rst:106 -msgid "This function always succeeds." -msgstr "" - -#: ../../c-api/hash.rst:113 -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:118 -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 cfc1df8c1..1dcb6ece3 100644 --- a/c-api/import.po +++ b/c-api/import.po @@ -1,32 +1,31 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: +# Takeshi Mizumoto , 2017 +# Arihiro TAKASE, 2017 +# Nozomu Kaneko , 2017 +# mollinaca, 2020 # Osamu NAKAMURA, 2021 -# mollinaca, 2021 +# tomo, 2021 # Shin Saito, 2021 -# Arihiro TAKASE, 2023 -# tomo, 2023 -# Takeshi Mizumoto , 2023 -# Nozomu Kaneko , 2023 -# Masato HASHIMOTO , 2023 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:48+0000\n" -"Last-Translator: Masato HASHIMOTO , 2023\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-06-24 06:41+0000\n" +"PO-Revision-Date: 2017-02-16 17:35+0000\n" +"Last-Translator: Shin Saito, 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/import.rst:6 @@ -35,16 +34,42 @@ msgstr "モジュールのインポート" #: ../../c-api/import.rst:16 msgid "" -"This is a wrapper around :c:func:`PyImport_Import()` which takes a :c:expr:" -"`const char *` as an argument instead of a :c:expr:`PyObject *`." -msgstr "" +"This is a simplified interface to :c:func:`PyImport_ImportModuleEx` below, " +"leaving the *globals* and *locals* arguments set to ``NULL`` and *level* set " +"to 0. When the *name* argument contains a dot (when it specifies a " +"submodule of a package), the *fromlist* argument is set to the list " +"``['*']`` so that the return value is the named module rather than the top-" +"level package containing it as would otherwise be the case. (Unfortunately, " +"this has an additional side effect when *name* in fact specifies a " +"subpackage instead of a submodule: the submodules specified in the package's " +"``__all__`` variable are loaded.) Return a new reference to the imported " +"module, or ``NULL`` with an exception set on failure. A failing import of a " +"module doesn't leave the module in :data:`sys.modules`." +msgstr "" +"この関数は下で述べる :c:func:`PyImport_ImportModuleEx` を単純化したインター" +"フェースで、 *globals* および *locals* 引数を ``NULL`` のままにし、 *level* " +"を 0 にしたものです。\n" +"*name* 引数にドットが含まれる場合 (あるパッケージのサブモジュールを指定してい" +"る場合)、 *fromlist* 引数がリスト ``['*']`` に追加され、戻り値がモジュールを" +"含むトップレベルパッケージではなく名前つきモジュール (named module) になるよ" +"うにします。\n" +"(残念ながらこのやり方には、 *name* が実際にはサブモジュールでなくサブパッケー" +"ジを指定している場合、パッケージの ``__all__`` 変数に指定されているサブモ" +"ジュールがロードされてしまうという副作用があります。)\n" +"インポートされたモジュールへの新たな参照を返します。\n" +"失敗した場合には例外をセットし、 ``NULL`` を返します。インポートに失敗したモ" +"ジュールは :data:`sys.modules` に残りません。" + +#: ../../c-api/import.rst:28 ../../c-api/import.rst:89 +msgid "This function always uses absolute imports." +msgstr "この関数は常に絶対インポートを使用します。" -#: ../../c-api/import.rst:21 +#: ../../c-api/import.rst:33 msgid "This function is a deprecated alias of :c:func:`PyImport_ImportModule`." msgstr "" "この関数は、 :c:func:`PyImport_ImportModule` の廃止予定のエイリアスです。" -#: ../../c-api/import.rst:23 +#: ../../c-api/import.rst:35 msgid "" "This function used to fail immediately when the import lock was held by " "another thread. In Python 3.3 though, the locking scheme switched to per-" @@ -56,11 +81,7 @@ msgstr "" "モジュールごとのロックに移行したので、この関数の特別な振る舞いはもはや必要で" "はありません。" -#: ../../c-api/import.rst:29 -msgid "Use :c:func:`PyImport_ImportModule` instead." -msgstr "" - -#: ../../c-api/import.rst:37 +#: ../../c-api/import.rst:46 msgid "" "Import a module. This is best described by referring to the built-in Python " "function :func:`__import__`." @@ -68,7 +89,7 @@ msgstr "" "モジュールをインポートします。モジュールのインポートについては組み込みの " "Python 関数 :func:`__import__` を読むとよくわかります。" -#: ../../c-api/import.rst:40 ../../c-api/import.rst:56 +#: ../../c-api/import.rst:49 ../../c-api/import.rst:65 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:" @@ -81,7 +102,7 @@ msgstr "" "は、空でない *fromlist* を渡された時以外は、トップレベルのパッケージを返しま" "す。" -#: ../../c-api/import.rst:46 +#: ../../c-api/import.rst:55 msgid "" "Failing imports remove incomplete module objects, like with :c:func:" "`PyImport_ImportModule`." @@ -89,7 +110,7 @@ msgstr "" "インポートが失敗した場合は、:c:func:`PyImport_ImportModule` と同様に不完全な" "モジュールのオブジェクトを削除します。" -#: ../../c-api/import.rst:52 +#: ../../c-api/import.rst:61 msgid "" "Import a module. This is best described by referring to the built-in Python " "function :func:`__import__`, as the standard :func:`__import__` function " @@ -99,7 +120,7 @@ msgstr "" "Python 関数 :func:`__import__` を読むとよく分かります。というのも、標準の :" "func:`__import__` はこの関数を直接呼び出しているからです。" -#: ../../c-api/import.rst:66 +#: ../../c-api/import.rst:75 msgid "" "Similar to :c:func:`PyImport_ImportModuleLevelObject`, but the name is a " "UTF-8 encoded string instead of a Unicode object." @@ -107,11 +128,11 @@ msgstr "" ":c:func:`PyImport_ImportModuleLevelObject` と似ていますが、name が Unicode オ" "ブジェクトではなく UTF-8 でエンコードされた文字列である点で異なります。" -#: ../../c-api/import.rst:69 +#: ../../c-api/import.rst:78 msgid "Negative values for *level* are no longer accepted." msgstr "*level* にはもはや負の値は使用できません。" -#: ../../c-api/import.rst:74 +#: ../../c-api/import.rst:83 msgid "" "This is a higher-level interface that calls the current \"import hook " "function\" (with an explicit *level* of 0, meaning absolute import). It " @@ -125,11 +146,7 @@ msgstr "" "ます。すなわち、現在の環境にインストールされているインポートフック使ってイン" "ポートを行います。" -#: ../../c-api/import.rst:80 -msgid "This function always uses absolute imports." -msgstr "この関数は常に絶対インポートを使用します。" - -#: ../../c-api/import.rst:85 +#: ../../c-api/import.rst:94 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)." @@ -139,78 +156,88 @@ msgstr "" "失敗した場合には例外をセットし、``NULL`` を返します (その場合でも、モジュール" "は生成されている場合があります)。" -#: ../../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 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." +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." msgstr "" +"モジュール名に対応するモジュールオブジェクトを返します。*name* 引数は " +"``package.module`` の形式でもかまいません。\n" +"まずモジュール辞書に該当するモジュールがあるかどうか調べ、なければ新たなモ" +"ジュールを生成してモジュール辞書に挿入します。\n" +"失敗した場合には例外をセットして ``NULL`` を返します。" -#: ../../c-api/import.rst:102 +#: ../../c-api/import.rst:107 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:func:" +"`PyImport_ImportModule` やその別形式を使ってモジュールをインポートしてくださ" +"い。ドット名表記で指定した *name* が存在しない場合、パッケージ構造は作成され" +"ません。" -#: ../../c-api/import.rst:113 -msgid "" -"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:121 +#: ../../c-api/import.rst:117 msgid "" -"Similar to :c:func:`PyImport_AddModuleRef`, but return a :term:`borrowed " -"reference`." +"Similar to :c:func:`PyImport_AddModuleObject`, but the name is a UTF-8 " +"encoded string instead of a Unicode object." msgstr "" +":c:func:`PyImport_AddModuleObject` と似ていますが、name が UTF-8 でエンコード" +"された文字列ではなく Unicode オブジェクトを使用する点で異なります。" -#: ../../c-api/import.rst:129 +#: ../../c-api/import.rst:125 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 " "function :func:`compile`, load the module. Return a new reference to the " "module object, or ``NULL`` with an exception set if an error occurred. " -"*name* is removed from :data:`sys.modules` in error cases, even if *name* " -"was already in :data:`sys.modules` on entry to :c:func:" +"*name* is removed from :attr:`sys.modules` in error cases, even if *name* " +"was already in :attr:`sys.modules` on entry to :c:func:" "`PyImport_ExecCodeModule`. Leaving incompletely initialized modules in :" -"data:`sys.modules` is dangerous, as imports of such modules have no way to " +"attr:`sys.modules` is dangerous, as imports of such modules have no way to " "know that the module object is an unknown (and probably damaged with respect " "to the module author's intents) state." msgstr "" +"モジュール名 (``package.module`` 形式でも構いません) および Python のバイト" +"コードファイルや組み込み関数 :func:`compile` で得られたコードオブジェクトを" +"元にモジュールをロードします。\n" +"モジュールオブジェクトへの新たな参照を返します。\n" +"失敗した場合には例外をセットし、 ``NULL`` を返します。たとえ :c:func:" +"`PyImport_ExecCodeModule` の処理に入った時に *name* が :attr:`sys.modules` に" +"入っていたとしても、インポートに失敗したモジュールは :attr:`sys.modules` に残" +"りません。\n" +"初期化の不完全なモジュールを :attr:`sys.modules` に残すのは危険であり、そのよ" +"うなモジュールをインポートするコードにとっては、モジュールの状態がわからない " +"(モジュール作者の意図から外れた壊れた状態かもしれない) からです。" -#: ../../c-api/import.rst:139 +#: ../../c-api/import.rst:135 msgid "" -"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." +"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:" +"`SourceFileLoader` otherwise." msgstr "" +"モジュールの :attr:`__spec__` と :attr:`__loader__` がまだ設定されていなけれ" +"ば、適切な値が設定されます。spec の ローダーは、モジュールの ``__loader__`` " +"が (もし設定されていれば) それに設定され、そうでなければ :class:" +"`SourceFileLoader` のインスタンスに設定されます。" -#: ../../c-api/import.rst:144 +#: ../../c-api/import.rst:140 msgid "" -"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." +"The module's :attr:`__file__` attribute will be set to the code object's :c:" +"member:`co_filename`. If applicable, :attr:`__cached__` will also be set." msgstr "" +"モジュールの :attr:`__file__` 属性はコードオブジェクトの :c:member:" +"`co_filename` へ設定されます。もし適切な場合は、 :attr:`__cached__` へも設定" +"されます。" -#: ../../c-api/import.rst:148 +#: ../../c-api/import.rst:144 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." @@ -219,7 +246,7 @@ msgstr "" "す。意図的にモジュールの再ロードを行う方法は :c:func:`PyImport_ReloadModule` " "を参照してください。" -#: ../../c-api/import.rst:151 +#: ../../c-api/import.rst:147 msgid "" "If *name* points to a dotted name of the form ``package.module``, any " "package structures not already created will still not be created." @@ -227,7 +254,7 @@ msgstr "" "*name* が ``package.module`` 形式のドット名表記であった場合、まだ作成されてい" "ないパッケージ構造はその作成されないままになります。" -#: ../../c-api/import.rst:154 +#: ../../c-api/import.rst:150 msgid "" "See also :c:func:`PyImport_ExecCodeModuleEx` and :c:func:" "`PyImport_ExecCodeModuleWithPathnames`." @@ -235,36 +262,31 @@ msgstr "" ":c:func:`PyImport_ExecCodeModuleEx` と :c:func:" "`PyImport_ExecCodeModuleWithPathnames` も参照してください。" -#: ../../c-api/import.rst:157 +#: ../../c-api/import.rst:156 msgid "" -"The setting of :attr:`~module.__cached__` and :attr:`~module.__loader__` is " -"deprecated. See :class:`~importlib.machinery.ModuleSpec` for alternatives." +"Like :c:func:`PyImport_ExecCodeModule`, but the :attr:`__file__` attribute " +"of the module object is set to *pathname* if it is non-``NULL``." msgstr "" +":c:func:`PyImport_ExecCodeModule` と似ていますが、*pathname* が ``NULL`` でな" +"い場合にモジュールオブジェクトの :attr:`__file__` 属性に *pathname* が設定さ" +"れる点が異なります。" -#: ../../c-api/import.rst:165 -msgid "" -"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:168 +#: ../../c-api/import.rst:159 msgid "See also :c:func:`PyImport_ExecCodeModuleWithPathnames`." msgstr ":c:func:`PyImport_ExecCodeModuleWithPathnames` も参照してください。" -#: ../../c-api/import.rst:173 +#: ../../c-api/import.rst:164 msgid "" -"Like :c:func:`PyImport_ExecCodeModuleEx`, but the :attr:`~module.__cached__` " +"Like :c:func:`PyImport_ExecCodeModuleEx`, but the :attr:`__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:func:`PyImport_ExecCodeModuleEx` と似ていますが、*cpathname* が ``NULL`` " +"でない場合にモジュールオブジェクトの :attr:`__cached__` 属性に *cpathname* が" +"設定される点が異なります。これらの 3 つの関数のうち、この関数の使用が望ましい" +"です。" -#: ../../c-api/import.rst:179 -msgid "" -"Setting :attr:`~module.__cached__` is deprecated. See :class:`~importlib." -"machinery.ModuleSpec` for alternatives." -msgstr "" - -#: ../../c-api/import.rst:186 +#: ../../c-api/import.rst:173 msgid "" "Like :c:func:`PyImport_ExecCodeModuleObject`, but *name*, *pathname* and " "*cpathname* are UTF-8 encoded strings. Attempts are also made to figure out " @@ -276,17 +298,15 @@ msgstr "" "す。もし *pathname* が ``NULL`` の場合、*cpathname* から、*pathname* どのよう" "な値になるべきかを知る試みもなされます。" -#: ../../c-api/import.rst:192 +#: ../../c-api/import.rst:179 msgid "" -"Uses :func:`!imp.source_from_cache` in calculating the source path if only " +"Uses :func:`imp.source_from_cache()` in calculating the source path if only " "the bytecode path is provided." msgstr "" +"バイトコードのパスが与えられた場合にのみ :func:`imp.source_from_cache()` が" +"ソースパスの計算に使用されます。" -#: ../../c-api/import.rst:195 -msgid "No longer uses the removed :mod:`!imp` module." -msgstr "" - -#: ../../c-api/import.rst:201 +#: ../../c-api/import.rst:186 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 " @@ -296,11 +316,11 @@ msgstr "" "返します。マジックナンバーはバイトコードファイルの最初の4バイトに、リトルエン" "ディアンバイトオーダーで現れるべきです。エラーの場合は ``-1`` を返します。" -#: ../../c-api/import.rst:205 +#: ../../c-api/import.rst:190 msgid "Return value of ``-1`` upon failure." msgstr "失敗した場合は ``-1`` の値を返します。" -#: ../../c-api/import.rst:211 +#: ../../c-api/import.rst:196 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 " @@ -310,7 +330,7 @@ msgstr "" "で返します。``sys.implementation.cache_tag`` の値が信頼でき、かつこの関数の代" "わりに使用すべきであることを肝に命じましょう。" -#: ../../c-api/import.rst:219 +#: ../../c-api/import.rst:204 msgid "" "Return the dictionary used for the module administration (a.k.a. ``sys." "modules``). Note that this is a per-interpreter variable." @@ -318,7 +338,7 @@ msgstr "" "モジュール管理のための辞書 (いわゆる ``sys.modules``)を返します。この辞書はイ" "ンタプリタごとに一つだけある変数なので注意してください。" -#: ../../c-api/import.rst:224 +#: ../../c-api/import.rst:209 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. " @@ -329,9 +349,9 @@ msgstr "" "はセットしません。\n" "モジュールの検索に失敗した場合は、 ``NULL`` を返し、エラーをセットします。" -#: ../../c-api/import.rst:232 +#: ../../c-api/import.rst:217 msgid "" -"Return a finder object for a :data:`sys.path`/:attr:`!pkg.__path__` item " +"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` " "dict. If it wasn't yet cached, traverse :data:`sys.path_hooks` until a hook " "is found that can handle the path item. Return ``None`` if no hook could; " @@ -339,8 +359,18 @@ msgid "" "finder for this path item. Cache the result in :data:`sys." "path_importer_cache`. Return a new reference to the finder object." msgstr "" +":data:`sys.path` もしくは :attr:`pkg.__path__` の要素である *path* を見付ける" +"ためのオブジェクトを返します。場合によっては :data:`sys.path_importer_cache` " +"辞書から取得することもあります。\n" +"もしまだオブジェクトがキャッシュされていなかった場合は、 path 要素を扱える" +"フックが見付かるまで :data:`sys.path_hooks` を走査します。\n" +"どのフックも path 要素を扱えない場合は ``None`` を返します; これにより、 :" +"term:`path based finder` がこの path 要素を見付けるためのオブジェクトが得られ" +"なかったことを呼び出し元に伝えます。\n" +"最終的に得られたオブジェクトを :data:`sys.path_importer_cache` へキャッシュ" +"し、オブジェクトへの新たな参照を返します。" -#: ../../c-api/import.rst:243 +#: ../../c-api/import.rst:228 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 " @@ -355,11 +385,11 @@ msgstr "" "数はいささか誤解を招く名前です --- この関数はモジュールがすでにインポートされ" "ていたらリロードしてしまいます。)" -#: ../../c-api/import.rst:251 +#: ../../c-api/import.rst:236 msgid "The ``__file__`` attribute is no longer set on the module." msgstr "``__file__`` 属性はもうモジュールにセットされません。" -#: ../../c-api/import.rst:257 +#: ../../c-api/import.rst:242 msgid "" "Similar to :c:func:`PyImport_ImportFrozenModuleObject`, but the name is a " "UTF-8 encoded string instead of a Unicode object." @@ -368,7 +398,7 @@ msgstr "" "エンコードされた文字列の代わりに、 Unicode オブジェクトを使用する点が異なりま" "す。" -#: ../../c-api/import.rst:265 +#: ../../c-api/import.rst:250 msgid "" "This is the structure type definition for frozen module descriptors, as " "generated by the :program:`freeze` utility (see :file:`Tools/freeze/` in the " @@ -380,37 +410,21 @@ msgstr "" "してください) この構造体の定義は :file:`Include/import.h` にあり、以下のよう" "になっています::" -#: ../../c-api/import.rst:270 -msgid "" -"struct _frozen {\n" -" const char *name;\n" -" const unsigned char *code;\n" -" int size;\n" -" bool is_package;\n" -"};" -msgstr "" - -#: ../../c-api/import.rst:277 +#: ../../c-api/import.rst:264 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:283 -msgid "" -"This pointer is initialized to point to an array of :c:struct:`_frozen` " +"This pointer is initialized to point to an array of :c:type:`struct _frozen` " "records, terminated by one whose members are all ``NULL`` or zero. When a " "frozen module is imported, it is searched in this table. Third-party code " "could play tricks with this to provide a dynamically created collection of " "frozen modules." msgstr "" -"このポインタは :c:struct:`_frozen` のレコードからなり、終端の要素のメンバが " -"``NULL`` かゼロになっているような配列を指すよう初期化されます。\n" +"このポインタは :c:type:`struct _frozen` のレコードからなり、終端の要素のメン" +"バが ``NULL`` かゼロになっているような配列を指すよう初期化されます。\n" "フリーズされたモジュールをインポートするとき、このテーブルを検索します。\n" "サードパーティ製のコードからこのポインタに仕掛けを講じて、動的に生成されたフ" "リーズ化モジュールの集合を提供するようにできます。" -#: ../../c-api/import.rst:291 +#: ../../c-api/import.rst:272 msgid "" "Add a single module to the existing table of built-in modules. This is a " "convenience wrapper around :c:func:`PyImport_ExtendInittab`, returning " @@ -425,34 +439,42 @@ msgstr "" "ポートでき、最初にインポートを試みた際に呼び出される関数として *initfunc* を" "使います。 :c:func:`Py_Initialize` よりも前に呼び出さなければなりません。" -#: ../../c-api/import.rst:301 +#: ../../c-api/import.rst:282 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 " -"conjunction with :c:func:`PyImport_ExtendInittab` to provide additional " -"built-in modules. The structure consists of two members:" +"Structure describing a single entry in the list of built-in modules. Each " +"of these structures gives the name and initialization function for a module " +"built into the interpreter. The name is an ASCII encoded string. Programs " +"which embed Python may use an array of these structures in conjunction with :" +"c:func:`PyImport_ExtendInittab` to provide additional built-in modules. The " +"structure is defined in :file:`Include/import.h` as::" msgstr "" +"組み込みモジュールリスト内の一つのエントリを記述している構造体です。リスト内" +"の各構造体には、インタプリタ内に組み込まれているモジュールの名前と初期化関数" +"が指定されています。 Python を埋め込むようなプログラムは、この構造体の配列" +"と :c:func:`PyImport_ExtendInittab` を組み合わせて、追加の組み込みモジュール" +"を提供できます。構造体は :file:`Include/import.h` で以下のように定義されてい" +"ます::" -#: ../../c-api/import.rst:309 -msgid "The module name, as an ASCII encoded string." -msgstr "" - -#: ../../c-api/import.rst:313 -msgid "Initialization function for a module built into the interpreter." -msgstr "" - -#: ../../c-api/import.rst:318 +#: ../../c-api/import.rst:297 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:" -"member:`~_inittab.name` field; failure to provide the sentinel value can " -"result in a memory fault. Returns ``0`` on success or ``-1`` if insufficient " -"memory could be allocated to extend the internal table. In the event of " -"failure, no modules are added to the internal table. This must be called " -"before :c:func:`Py_Initialize`." -msgstr "" - -#: ../../c-api/import.rst:325 +"array must end with a sentinel entry which contains ``NULL`` for the :attr:" +"`name` field; failure to provide the sentinel value can result in a memory " +"fault. Returns ``0`` on success or ``-1`` if insufficient memory could be " +"allocated to extend the internal table. In the event of failure, no modules " +"are added to the internal table. This must be called before :c:func:" +"`Py_Initialize`." +msgstr "" +"組み込みモジュールのテーブルに一群のモジュールを追加します。\n" +"配列 *newtab* は :attr:`name` フィールドが ``NULL`` になっているセンチネル " +"(sentinel) エントリで終端されていなければなりません。センチネル値を与えられな" +"かった場合にはメモリ違反になるかもしれません。\n" +"成功すると ``0`` を、内部テーブルを拡張するのに十分なメモリを確保できなかった" +"場合には ``-1`` を返します。\n" +"操作が失敗した場合、モジュールは一切内部テーブルに追加されません。\n" +":c:func:`Py_Initialize` よりも前に呼び出さなければなりません。" + +#: ../../c-api/import.rst:304 msgid "" "If Python is initialized multiple times, :c:func:`PyImport_AppendInittab` " "or :c:func:`PyImport_ExtendInittab` must be called before each Python " @@ -461,57 +483,3 @@ msgstr "" "Python が複数回初期化される場合、:c:func:`PyImport_AppendInittab` または :c:" "func:`PyImport_ExtendInittab` は、それぞれの初期化の前に呼び出される必要があ" "ります。" - -#: ../../c-api/import.rst:332 -msgid "Import the module *mod_name* and get its attribute *attr_name*." -msgstr "" - -#: ../../c-api/import.rst:334 -msgid "Names must be Python :class:`str` objects." -msgstr "" - -#: ../../c-api/import.rst:336 -msgid "" -"Helper function combining :c:func:`PyImport_Import` and :c:func:" -"`PyObject_GetAttr`. For example, it can raise :exc:`ImportError` if the " -"module is not found, and :exc:`AttributeError` if the attribute doesn't " -"exist." -msgstr "" - -#: ../../c-api/import.rst:345 -msgid "" -"Similar to :c:func:`PyImport_ImportModuleAttr`, but names are UTF-8 encoded " -"strings instead of Python :class:`str` objects." -msgstr "" - -#: ../../c-api/import.rst:11 -msgid "package variable" -msgstr "" - -#: ../../c-api/import.rst:11 -msgid "__all__" -msgstr "__all__" - -#: ../../c-api/import.rst:11 -msgid "__all__ (package variable)" -msgstr "" - -#: ../../c-api/import.rst:11 -msgid "modules (in module sys)" -msgstr "modules (in module sys)" - -#: ../../c-api/import.rst:35 ../../c-api/import.rst:127 -msgid "built-in function" -msgstr "組み込み関数" - -#: ../../c-api/import.rst:35 -msgid "__import__" -msgstr "__import__" - -#: ../../c-api/import.rst:127 -msgid "compile" -msgstr "コンパイル" - -#: ../../c-api/import.rst:263 -msgid "freeze utility" -msgstr "凍結ユーティリティ" diff --git a/c-api/index.po b/c-api/index.po index 37b566732..f44aad33b 100644 --- a/c-api/index.po +++ b/c-api/index.po @@ -1,25 +1,25 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 +# Arihiro TAKASE, 2017 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-30 14:22+0000\n" -"PO-Revision-Date: 2021-06-28 00:48+0000\n" -"Last-Translator: tomo, 2021\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 17:35+0000\n" +"Last-Translator: Arihiro TAKASE, 2017\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/index.rst:5 diff --git a/c-api/init.po b/c-api/init.po index 1189e2031..96f7a42ed 100644 --- a/c-api/init.po +++ b/c-api/init.po @@ -1,33 +1,30 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# mollinaca, 2021 -# Nozomu Kaneko , 2023 -# Masato HASHIMOTO , 2023 -# Osamu NAKAMURA, 2023 -# Takeshi Nakazato, 2024 -# tomo, 2024 -# Arihiro TAKASE, 2024 -# Tetsuo Koyama , 2024 -# Takanori Suzuki , 2024 +# 秘湯 , 2017 +# Nozomu Kaneko , 2017 +# Arihiro TAKASE, 2017 +# tomo, 2020 +# mollinaca, 2020 +# Osamu NAKAMURA, 2021 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-13 14:21+0000\n" -"PO-Revision-Date: 2021-06-28 00:49+0000\n" -"Last-Translator: Takanori Suzuki , 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-03-02 05:36+0000\n" +"PO-Revision-Date: 2017-02-16 17:36+0000\n" +"Last-Translator: Osamu NAKAMURA, 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/init.rst:8 @@ -35,16 +32,14 @@ msgid "Initialization, Finalization, and Threads" msgstr "初期化 (initialization)、終了処理 (finalization)、スレッド" #: ../../c-api/init.rst:10 -msgid "" -"See :ref:`Python Initialization Configuration ` for details on " -"how to configure the interpreter prior to initialization." -msgstr "" +msgid "See also :ref:`Python Initialization Configuration `." +msgstr ":ref:`Python 初期化設定 ` も参照してください。" -#: ../../c-api/init.rst:16 +#: ../../c-api/init.rst:15 msgid "Before Python Initialization" msgstr "Python 初期化以前" -#: ../../c-api/init.rst:18 +#: ../../c-api/init.rst:17 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 " @@ -55,179 +50,150 @@ msgstr "" "に :c:func:`Py_Initialize` 関数を呼ばなければなりません。これには例外として、" "いくつかの関数と :ref:`グローバルな設定変数 ` があります。" -#: ../../c-api/init.rst:23 +#: ../../c-api/init.rst:22 msgid "" "The following functions can be safely called before Python is initialized:" msgstr "次の関数は Python の初期化の前でも安全に呼び出せます:" -#: ../../c-api/init.rst:25 -msgid "Functions that initialize the interpreter:" -msgstr "" - -#: ../../c-api/init.rst:27 -msgid ":c:func:`Py_Initialize`" -msgstr "" - -#: ../../c-api/init.rst:28 -msgid ":c:func:`Py_InitializeEx`" -msgstr "" - -#: ../../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-api/init.rst:32 -msgid "the runtime pre-initialization functions covered in :ref:`init-config`" -msgstr "" - -#: ../../c-api/init.rst:34 +#: ../../c-api/init.rst:24 msgid "Configuration functions:" msgstr "設定関数:" -#: ../../c-api/init.rst:36 +#: ../../c-api/init.rst:26 msgid ":c:func:`PyImport_AppendInittab`" msgstr ":c:func:`PyImport_AppendInittab`" -#: ../../c-api/init.rst:37 +#: ../../c-api/init.rst:27 msgid ":c:func:`PyImport_ExtendInittab`" msgstr ":c:func:`PyImport_ExtendInittab`" -#: ../../c-api/init.rst:38 -msgid ":c:func:`!PyInitFrozenExtensions`" -msgstr "" +#: ../../c-api/init.rst:28 +msgid ":c:func:`PyInitFrozenExtensions`" +msgstr ":c:func:`PyInitFrozenExtensions`" -#: ../../c-api/init.rst:39 +#: ../../c-api/init.rst:29 msgid ":c:func:`PyMem_SetAllocator`" msgstr ":c:func:`PyMem_SetAllocator`" -#: ../../c-api/init.rst:40 +#: ../../c-api/init.rst:30 msgid ":c:func:`PyMem_SetupDebugHooks`" msgstr ":c:func:`PyMem_SetupDebugHooks`" -#: ../../c-api/init.rst:41 +#: ../../c-api/init.rst:31 msgid ":c:func:`PyObject_SetArenaAllocator`" msgstr ":c:func:`PyObject_SetArenaAllocator`" -#: ../../c-api/init.rst:42 +#: ../../c-api/init.rst:32 +msgid ":c:func:`Py_SetPath`" +msgstr ":c:func:`Py_SetPath`" + +#: ../../c-api/init.rst:33 msgid ":c:func:`Py_SetProgramName`" msgstr ":c:func:`Py_SetProgramName`" -#: ../../c-api/init.rst:43 +#: ../../c-api/init.rst:34 msgid ":c:func:`Py_SetPythonHome`" msgstr ":c:func:`Py_SetPythonHome`" -#: ../../c-api/init.rst:44 +#: ../../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 msgid ":c:func:`PySys_ResetWarnOptions`" msgstr ":c:func:`PySys_ResetWarnOptions`" -#: ../../c-api/init.rst:45 -msgid "the configuration functions covered in :ref:`init-config`" -msgstr "" - -#: ../../c-api/init.rst:47 +#: ../../c-api/init.rst:40 msgid "Informative functions:" msgstr "情報取得の関数:" -#: ../../c-api/init.rst:49 ../../c-api/init.rst:57 +#: ../../c-api/init.rst:42 msgid ":c:func:`Py_IsInitialized`" msgstr ":c:func:`Py_IsInitialized`" -#: ../../c-api/init.rst:50 +#: ../../c-api/init.rst:43 msgid ":c:func:`PyMem_GetAllocator`" msgstr ":c:func:`PyMem_GetAllocator`" -#: ../../c-api/init.rst:51 +#: ../../c-api/init.rst:44 msgid ":c:func:`PyObject_GetArenaAllocator`" msgstr ":c:func:`PyObject_GetArenaAllocator`" -#: ../../c-api/init.rst:52 +#: ../../c-api/init.rst:45 msgid ":c:func:`Py_GetBuildInfo`" msgstr ":c:func:`Py_GetBuildInfo`" -#: ../../c-api/init.rst:53 +#: ../../c-api/init.rst:46 msgid ":c:func:`Py_GetCompiler`" msgstr ":c:func:`Py_GetCompiler`" -#: ../../c-api/init.rst:54 +#: ../../c-api/init.rst:47 msgid ":c:func:`Py_GetCopyright`" msgstr ":c:func:`Py_GetCopyright`" -#: ../../c-api/init.rst:55 +#: ../../c-api/init.rst:48 msgid ":c:func:`Py_GetPlatform`" msgstr ":c:func:`Py_GetPlatform`" -#: ../../c-api/init.rst:56 +#: ../../c-api/init.rst:49 msgid ":c:func:`Py_GetVersion`" msgstr ":c:func:`Py_GetVersion`" -#: ../../c-api/init.rst:59 +#: ../../c-api/init.rst:51 msgid "Utilities:" msgstr "ユーティリティ:" -#: ../../c-api/init.rst:61 +#: ../../c-api/init.rst:53 msgid ":c:func:`Py_DecodeLocale`" msgstr ":c:func:`Py_DecodeLocale`" -#: ../../c-api/init.rst:62 -msgid "" -"the status reporting and utility functions covered in :ref:`init-config`" -msgstr "" - -#: ../../c-api/init.rst:64 +#: ../../c-api/init.rst:55 msgid "Memory allocators:" msgstr "メモリアロケータ:" -#: ../../c-api/init.rst:66 +#: ../../c-api/init.rst:57 msgid ":c:func:`PyMem_RawMalloc`" msgstr ":c:func:`PyMem_RawMalloc`" -#: ../../c-api/init.rst:67 +#: ../../c-api/init.rst:58 msgid ":c:func:`PyMem_RawRealloc`" msgstr ":c:func:`PyMem_RawRealloc`" -#: ../../c-api/init.rst:68 +#: ../../c-api/init.rst:59 msgid ":c:func:`PyMem_RawCalloc`" msgstr ":c:func:`PyMem_RawCalloc`" -#: ../../c-api/init.rst:69 +#: ../../c-api/init.rst:60 msgid ":c:func:`PyMem_RawFree`" msgstr ":c:func:`PyMem_RawFree`" -#: ../../c-api/init.rst:71 -msgid "Synchronization:" -msgstr "" - -#: ../../c-api/init.rst:73 -msgid ":c:func:`PyMutex_Lock`" -msgstr "" - -#: ../../c-api/init.rst:74 -msgid ":c:func:`PyMutex_Unlock`" -msgstr "" - -#: ../../c-api/init.rst:78 +#: ../../c-api/init.rst:64 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:" +"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`, :c:func:`PyEval_InitThreads`, and :c:func:`Py_RunMain`." +"`Py_GetProgramName` and :c:func:`PyEval_InitThreads`." msgstr "" +"次の関数は :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`, :c:func:`PyEval_InitThreads` 。" -#: ../../c-api/init.rst:90 +#: ../../c-api/init.rst:74 msgid "Global configuration variables" msgstr "グローバルな設定変数" -#: ../../c-api/init.rst:92 +#: ../../c-api/init.rst:76 msgid "" "Python has variables for the global configuration to control different " "features and options. By default, these flags are controlled by :ref:" @@ -238,7 +204,7 @@ msgstr "" "デフォルトでは、これらのフラグは :ref:`コマンドラインオプション ` で制御されます。" -#: ../../c-api/init.rst:96 +#: ../../c-api/init.rst:80 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:" @@ -250,14 +216,7 @@ msgstr "" "例えば、 ``-b`` では :c:data:`Py_BytesWarningFlag` が 1 に設定され、 ``-bb`` " "では :c:data:`Py_BytesWarningFlag` が 2 に設定されます。" -#: ../../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 `." -msgstr "" - -#: ../../c-api/init.rst:106 +#: ../../c-api/init.rst:86 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 " @@ -267,18 +226,11 @@ msgstr "" "は、 :class:`bytes` を :class:`int` と比較した場合に警告を発生させます。\n" "``2`` 以上の値を設定している場合は、エラーを発生させます。" -#: ../../c-api/init.rst:110 +#: ../../c-api/init.rst:90 msgid "Set by the :option:`-b` option." msgstr ":option:`-b` オプションで設定します。" -#: ../../c-api/init.rst:116 -msgid "" -"This API is kept for backward compatibility: setting :c:member:`PyConfig." -"parser_debug` should be used instead, see :ref:`Python Initialization " -"Configuration `." -msgstr "" - -#: ../../c-api/init.rst:120 +#: ../../c-api/init.rst:94 msgid "" "Turn on parser debugging output (for expert only, depending on compilation " "options)." @@ -286,20 +238,13 @@ msgstr "" "パーサーのデバッグ出力を有効にします。(専門家専用です。コンパイルオプションに" "依存します)。" -#: ../../c-api/init.rst:123 +#: ../../c-api/init.rst:97 msgid "" "Set by the :option:`-d` option and the :envvar:`PYTHONDEBUG` environment " "variable." msgstr ":option:`-d` オプションと :envvar:`PYTHONDEBUG` 環境変数で設定します。" -#: ../../c-api/init.rst:130 -msgid "" -"This API is kept for backward compatibility: setting :c:member:`PyConfig." -"write_bytecode` should be used instead, see :ref:`Python Initialization " -"Configuration `." -msgstr "" - -#: ../../c-api/init.rst:134 +#: ../../c-api/init.rst:102 msgid "" "If set to non-zero, Python won't try to write ``.pyc`` files on the import " "of source modules." @@ -307,7 +252,7 @@ msgstr "" "非ゼロに設定した場合、Python はソースモジュールのインポート時に ``.pyc`` ファ" "イルの作成を試みません。" -#: ../../c-api/init.rst:137 +#: ../../c-api/init.rst:105 msgid "" "Set by the :option:`-B` option and the :envvar:`PYTHONDONTWRITEBYTECODE` " "environment variable." @@ -315,14 +260,7 @@ msgstr "" ":option:`-B` オプションと :envvar:`PYTHONDONTWRITEBYTECODE` 環境変数で設定し" "ます。" -#: ../../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 `." -msgstr "" - -#: ../../c-api/init.rst:148 +#: ../../c-api/init.rst:110 msgid "" "Suppress error messages when calculating the module search path in :c:func:" "`Py_GetPath`." @@ -330,20 +268,13 @@ msgstr "" ":c:func:`Py_GetPath` の中でモジュール検索パスを割り出しているときのエラーメッ" "セージを抑制します。" -#: ../../c-api/init.rst:151 -msgid "Private flag used by ``_freeze_module`` and ``frozenmain`` programs." -msgstr "" -"``_freeze_module`` プログラムと ``frozenmain`` プログラムが使用する非公開フラ" -"グです。" - -#: ../../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, " -"see :ref:`Python Initialization Configuration `." +#: ../../c-api/init.rst:113 +msgid "Private flag used by ``_freeze_importlib`` and ``frozenmain`` programs." msgstr "" +"``_freeze_importlib`` プログラムと ``frozenmain`` プログラムが使用する非公開" +"フラグです。" -#: ../../c-api/init.rst:162 +#: ../../c-api/init.rst:117 msgid "" "Set to ``1`` if the :envvar:`PYTHONHASHSEED` environment variable is set to " "a non-empty string." @@ -351,7 +282,7 @@ msgstr "" ":envvar:`PYTHONHASHSEED` 環境変数が空でない文字列に設定された場合に、 ``1`` " "が設定されます。" -#: ../../c-api/init.rst:165 +#: ../../c-api/init.rst:120 msgid "" "If the flag is non-zero, read the :envvar:`PYTHONHASHSEED` environment " "variable to initialize the secret hash seed." @@ -359,31 +290,19 @@ msgstr "" "フラグがゼロでない場合、 :envvar:`PYTHONHASHSEED` 環境変数を読みシークレット" "ハッシュシードを初期化します。" -#: ../../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 `." -msgstr "" - -#: ../../c-api/init.rst:176 +#: ../../c-api/init.rst:125 msgid "" -"Ignore all :envvar:`!PYTHON*` environment variables, e.g. :envvar:" +"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:179 +#: ../../c-api/init.rst:128 msgid "Set by the :option:`-E` and :option:`-I` options." msgstr ":option:`-E` オプションと :option:`-I` オプションで設定します。" -#: ../../c-api/init.rst:185 -msgid "" -"This API is kept for backward compatibility: setting :c:member:`PyConfig." -"inspect` should be used instead, see :ref:`Python Initialization " -"Configuration `." -msgstr "" - -#: ../../c-api/init.rst:189 +#: ../../c-api/init.rst:132 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 " @@ -393,32 +312,18 @@ msgstr "" "際に、 :data:`sys.stdin` がターミナルに出力されないときであっても、スクリプト" "かコマンドを実行した後にインタラクティブモードに入ります。" -#: ../../c-api/init.rst:193 +#: ../../c-api/init.rst:136 msgid "" "Set by the :option:`-i` option and the :envvar:`PYTHONINSPECT` environment " "variable." msgstr "" ":option:`-i` オプションと :envvar:`PYTHONINSPECT` 環境変数で設定します。" -#: ../../c-api/init.rst:200 -msgid "" -"This API is kept for backward compatibility: setting :c:member:`PyConfig." -"interactive` should be used instead, see :ref:`Python Initialization " -"Configuration `." -msgstr "" - -#: ../../c-api/init.rst:204 +#: ../../c-api/init.rst:141 msgid "Set by the :option:`-i` option." msgstr ":option:`-i` オプションで設定します。" -#: ../../c-api/init.rst:210 -msgid "" -"This API is kept for backward compatibility: setting :c:member:`PyConfig." -"isolated` should be used instead, see :ref:`Python Initialization " -"Configuration `." -msgstr "" - -#: ../../c-api/init.rst:214 +#: ../../c-api/init.rst:145 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." @@ -427,25 +332,19 @@ msgstr "" "隔離モードでは :data:`sys.path` はスクリプトのディレクトリやユーザのサイト" "パッケージのディレクトリを含みません。" -#: ../../c-api/init.rst:217 +#: ../../c-api/init.rst:148 msgid "Set by the :option:`-I` option." msgstr ":option:`-I` オプションで設定します。" -#: ../../c-api/init.rst:225 -msgid "" -"This API is kept for backward compatibility: setting :c:member:`PyPreConfig." -"legacy_windows_fs_encoding` should be used instead, see :ref:`Python " -"Initialization Configuration `." -msgstr "" - -#: ../../c-api/init.rst:229 +#: ../../c-api/init.rst:154 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`." +"If the flag is non-zero, use the ``mbcs`` encoding instead of the UTF-8 " +"encoding for the filesystem encoding." msgstr "" +"フラグがゼロでない場合は、ファイルシステムエンコーディングに UTF-8 エンコー" +"ディングの代わりに ``mbcs`` エンコーディングが使われます。" -#: ../../c-api/init.rst:233 +#: ../../c-api/init.rst:157 msgid "" "Set to ``1`` if the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` environment " "variable is set to a non-empty string." @@ -453,28 +352,23 @@ msgstr "" ":envvar:`PYTHONLEGACYWINDOWSFSENCODING` 環境変数が空でない文字列に設定された" "場合に、 ``1`` に設定されます。" -#: ../../c-api/init.rst:236 +#: ../../c-api/init.rst:160 msgid "See :pep:`529` for more details." msgstr "より詳しくは :pep:`529` を参照してください。" -#: ../../c-api/init.rst:238 ../../c-api/init.rst:256 -msgid "Availability" -msgstr "" - -#: ../../c-api/init.rst:244 -msgid "" -"This API is kept for backward compatibility: setting :c:member:`PyConfig." -"legacy_windows_stdio` should be used instead, see :ref:`Python " -"Initialization Configuration `." -msgstr "" +#: ../../c-api/init.rst:162 ../../c-api/init.rst:174 +msgid ":ref:`Availability `: Windows." +msgstr ":ref:`利用可能な環境 `: Windows 。" -#: ../../c-api/init.rst:248 +#: ../../c-api/init.rst:166 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:" +"`WindowsConsoleIO` for :mod:`sys` standard streams." msgstr "" +"フラグがゼロでない場合、 :class:`WindowsConsoleIO` の代わりに :class:`io." +"FileIO` を :mod:`sys` の標準ストリームとして使います。" -#: ../../c-api/init.rst:251 +#: ../../c-api/init.rst:169 msgid "" "Set to ``1`` if the :envvar:`PYTHONLEGACYWINDOWSSTDIO` environment variable " "is set to a non-empty string." @@ -482,18 +376,11 @@ msgstr "" ":envvar:`PYTHONLEGACYWINDOWSSTDIO` 環境変数が空でない文字列に設定された場合" "に、 ``1`` に設定されます。" -#: ../../c-api/init.rst:254 +#: ../../c-api/init.rst:172 msgid "See :pep:`528` for more details." msgstr "より詳しくは :pep:`528` を参照してください。" -#: ../../c-api/init.rst:262 -msgid "" -"This API is kept for backward compatibility: setting :c:member:`PyConfig." -"site_import` should be used instead, see :ref:`Python Initialization " -"Configuration `." -msgstr "" - -#: ../../c-api/init.rst:266 +#: ../../c-api/init.rst:178 msgid "" "Disable the import of the module :mod:`site` and the site-dependent " "manipulations of :data:`sys.path` that it entails. Also disable these " @@ -505,18 +392,11 @@ msgstr "" "import しても、これらの操作は実行されません (実行したい場合は、 :func:`site." "main` を呼び出してください)。" -#: ../../c-api/init.rst:271 +#: ../../c-api/init.rst:183 msgid "Set by the :option:`-S` option." msgstr ":option:`-S` オプションで設定します。" -#: ../../c-api/init.rst:277 -msgid "" -"This API is kept for backward compatibility: setting :c:member:`PyConfig." -"user_site_directory` should be used instead, see :ref:`Python Initialization " -"Configuration `." -msgstr "" - -#: ../../c-api/init.rst:281 +#: ../../c-api/init.rst:187 msgid "" "Don't add the :data:`user site-packages directory ` to :data:" "`sys.path`." @@ -524,7 +404,7 @@ msgstr "" ":data:`ユーザのサイトパッケージのディレクトリ ` を :data:" "`sys.path` に追加しません。" -#: ../../c-api/init.rst:284 +#: ../../c-api/init.rst:190 msgid "" "Set by the :option:`-s` and :option:`-I` options, and the :envvar:" "`PYTHONNOUSERSITE` environment variable." @@ -532,63 +412,35 @@ msgstr "" ":option:`-s` オプション、 :option:`-I` 、 :envvar:`PYTHONNOUSERSITE` 環境変数" "で設定します。" -#: ../../c-api/init.rst:291 -msgid "" -"This API is kept for backward compatibility: setting :c:member:`PyConfig." -"optimization_level` should be used instead, see :ref:`Python Initialization " -"Configuration `." -msgstr "" - -#: ../../c-api/init.rst:295 +#: ../../c-api/init.rst:195 msgid "" "Set by the :option:`-O` option and the :envvar:`PYTHONOPTIMIZE` environment " "variable." msgstr "" ":option:`-O` オプションと :envvar:`PYTHONOPTIMIZE` 環境変数で設定します。" -#: ../../c-api/init.rst:302 -msgid "" -"This API is kept for backward compatibility: setting :c:member:`PyConfig." -"quiet` should be used instead, see :ref:`Python Initialization Configuration " -"`." -msgstr "" - -#: ../../c-api/init.rst:306 +#: ../../c-api/init.rst:200 msgid "" "Don't display the copyright and version messages even in interactive mode." msgstr "" "インタラクティブモードでも copyright とバージョンのメッセージを表示しません。" -#: ../../c-api/init.rst:308 +#: ../../c-api/init.rst:202 msgid "Set by the :option:`-q` option." msgstr ":option:`-q` オプションで設定します。" -#: ../../c-api/init.rst:316 -msgid "" -"This API is kept for backward compatibility: setting :c:member:`PyConfig." -"buffered_stdio` should be used instead, see :ref:`Python Initialization " -"Configuration `." -msgstr "" - -#: ../../c-api/init.rst:320 +#: ../../c-api/init.rst:208 msgid "Force the stdout and stderr streams to be unbuffered." msgstr "標準出力と標準エラーをバッファリングしないように強制します。" -#: ../../c-api/init.rst:322 +#: ../../c-api/init.rst:210 msgid "" "Set by the :option:`-u` option and the :envvar:`PYTHONUNBUFFERED` " "environment variable." msgstr "" ":option:`-u` オプションと :envvar:`PYTHONUNBUFFERED` 環境変数で設定します。" -#: ../../c-api/init.rst:329 -msgid "" -"This API is kept for backward compatibility: setting :c:member:`PyConfig." -"verbose` should be used instead, see :ref:`Python Initialization " -"Configuration `." -msgstr "" - -#: ../../c-api/init.rst:333 +#: ../../c-api/init.rst:215 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 " @@ -601,18 +453,18 @@ msgstr "" "セージを出力します。また、終了時のモジュールクリーンアップに関する情報も提供" "します。" -#: ../../c-api/init.rst:338 +#: ../../c-api/init.rst:220 msgid "" "Set by the :option:`-v` option and the :envvar:`PYTHONVERBOSE` environment " "variable." msgstr "" ":option:`-v` オプションと :envvar:`PYTHONVERBOSE` 環境変数で設定します。" -#: ../../c-api/init.rst:345 +#: ../../c-api/init.rst:225 msgid "Initializing and finalizing the interpreter" msgstr "インタープリタの初期化と終了処理" -#: ../../c-api/init.rst:360 +#: ../../c-api/init.rst:243 msgid "" "Initialize the Python interpreter. In an application embedding Python, " "this should be called before using any other Python/C API functions; see :" @@ -623,24 +475,23 @@ msgstr "" "するよりも前にこの関数を呼び出さなければなりません。いくつかの例外について" "は :ref:`Python 初期化以前 ` を参照してください。" -#: ../../c-api/init.rst:364 +#: ../../c-api/init.rst:247 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 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." +"``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." msgstr "" +"この関数はロード済みモジュールのテーブル (``sys.modules``) を初期化し、基盤と" +"なるモジュール群、 :mod:`builtins`, :mod:`__main__`, :mod:`sys` を生成しま" +"す。また、モジュール検索パス (``sys.path``) も初期化します。 ``sys.argv`` の" +"設定は行いません。設定するには、 :c:func:`PySys_SetArgvEx` を使ってください。" +"この関数を (:c:func:`Py_FinalizeEx` を呼ばずに) 再度呼び出しても何も行いませ" +"ん。戻り値はありません。初期化が失敗すれば、それは致命的なエラーです。" -#: ../../c-api/init.rst:372 ../../c-api/init.rst:386 -msgid "" -"Use :c:func:`Py_InitializeFromConfig` to customize the :ref:`Python " -"Initialization Configuration `." -msgstr "" - -#: ../../c-api/init.rst:376 +#: ../../c-api/init.rst:256 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." @@ -649,28 +500,18 @@ msgstr "" "が、これはその C ランタイムを使っているコンソールでの Python 以外の使い勝手に" "も影響を及ぼします。" -#: ../../c-api/init.rst:382 +#: ../../c-api/init.rst:262 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 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: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." +"handlers, which might be useful when Python is embedded." msgstr "" +"*initsigs* に ``1`` を指定した場合、この関数は :c:func:`Py_Initialize` と同じ" +"ように動作します。\n" +"*initsigs* に ``0`` を指定した場合、初期化時のシグナルハンドラの登録をスキッ" +"プすることができ、これは Python の埋め込みで便利でしょう。" -#: ../../c-api/init.rst:402 +#: ../../c-api/init.rst:269 msgid "" "Return true (nonzero) when the Python interpreter has been initialized, " "false (zero) if not. After :c:func:`Py_FinalizeEx` is called, this returns " @@ -680,45 +521,29 @@ msgstr "" "します。:c:func:`Py_FinalizeEx` を呼び出した後は、:c:func:`Py_Initialize` を" "再び呼び出すまで、この関数は偽を返します。" -#: ../../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 +#: ../../c-api/init.rst:276 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`. This is a no-op when called for a " -"second time (without calling :c:func:`Py_Initialize` again first)." -msgstr "" - -#: ../../c-api/init.rst:423 -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." -msgstr "" - -#: ../../c-api/init.rst:428 -msgid "" -"Normally the return value is ``0``. If there were errors during finalization " +"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). Normally " +"the return value is ``0``. If there were errors during finalization " "(flushing buffered data), ``-1`` is returned." msgstr "" +":c:func:`Py_Initialize` とそれ以後の Python/C API 関数で行った全ての初期化処" +"理を取り消し、最後の :c:func:`Py_Initialize` 呼び出し以後に Python インタプ" +"リタが生成した全てのサブインタプリタ (sub-interpreter, 下記の :c:func:" +"`Py_NewInterpreter` を参照) を消去します。\n" +"理想的な状況では、この関数によって Python インタプリタが確保したメモリは全て" +"解放されます。\n" +"この関数を (:c:func:`Py_Initialize` を呼ばずに) 再度呼び出しても何も行いませ" +"ん。\n" +"通常は返り値は ``0`` です。終了処理中 (バッファリングされたデータの書き出し) " +"のエラーがあった場合は ``-1`` が返されます。" -#: ../../c-api/init.rst:432 -msgid "" -"Note that Python will do a best effort at freeing all memory allocated by " -"the Python interpreter. Therefore, any C-Extension should make sure to " -"correctly clean up all of the preveiously allocated PyObjects before using " -"them in subsequent calls to :c:func:`Py_Initialize`. Otherwise it could " -"introduce vulnerabilities and incorrect behavior." -msgstr "" - -#: ../../c-api/init.rst:438 +#: ../../c-api/init.rst:285 msgid "" "This function is provided for a number of reasons. An embedding application " "might want to restart Python without having to restart the application " @@ -736,27 +561,33 @@ msgstr "" "ン内で起きているメモリリークを追跡する際に、開発者は Python が確保したメモリ" "をアプリケーションの終了前に解放させたいと思う場合もあります。" -#: ../../c-api/init.rst:446 +#: ../../c-api/init.rst:293 msgid "" "**Bugs and caveats:** The destruction of modules and objects in modules is " -"done in random order; this may cause destructors (:meth:`~object.__del__` " -"methods) to fail when they depend on other objects (even functions) or " -"modules. Dynamically loaded extension modules loaded by Python are not " -"unloaded. Small amounts of memory allocated by the Python interpreter may " -"not be freed (if you find a leak, please report it). Memory tied up in " -"circular references between objects is not freed. Interned strings will all " -"be deallocated regardless of their reference count. Some memory allocated by " -"extension modules may not be freed. Some extensions may not work properly " -"if their initialization routine is called more than once; this can happen if " -"an application calls :c:func:`Py_Initialize` and :c:func:`Py_FinalizeEx` " -"more than once. :c:func:`Py_FinalizeEx` must not be called recursively from " -"within itself. Therefore, it must not be called by any code that may be run " -"as part of the interpreter shutdown process, such as :py:mod:`atexit` " -"handlers, object finalizers, or any code that may be run while flushing the " -"stdout and stderr files." -msgstr "" - -#: ../../c-api/init.rst:462 +"done in random order; this may cause destructors (:meth:`__del__` methods) " +"to fail when they depend on other objects (even functions) or modules. " +"Dynamically loaded extension modules loaded by Python are not unloaded. " +"Small amounts of memory allocated by the Python interpreter may not be freed " +"(if you find a leak, please report it). Memory tied up in circular " +"references between objects is not freed. Some memory allocated by extension " +"modules may not be freed. Some extensions may not work properly if their " +"initialization routine is called more than once; this can happen if an " +"application calls :c:func:`Py_Initialize` and :c:func:`Py_FinalizeEx` more " +"than once." +msgstr "" +"**バグおよび注意事項:** モジュールやモジュール内のオブジェクトはランダムな順" +"番で削除されます。このため、他のオブジェクト(関数オブジェクトも含みます) やモ" +"ジュールに依存するデストラクタ (:meth:`__del__` メソッド) が失敗してしまうこ" +"とがあります。動的にロードされるようになっている拡張モジュールが Python に" +"よってロードされていた場合、アンロードされません。 Python が確保したメモリが" +"わずかながら解放されないかもしれません (メモリリークを発見したら、どうか報告" +"してください)。オブジェクト間の循環参照に捕捉されているメモリは解放されないこ" +"とがあります。拡張モジュールが確保したメモリは解放されないことがあります。拡" +"張モジュールによっては、初期化ルーチンを 2 度以上呼び出すと正しく動作しないこ" +"とがあります。こうした状況は、 :c:func:`Py_Initialize` や :c:func:" +"`Py_FinalizeEx` を 2 度以上呼び出すと起こり得ます。" + +#: ../../c-api/init.rst:304 msgid "" "Raises an :ref:`auditing event ` ``cpython." "_PySys_ClearAuditHooks`` with no arguments." @@ -764,7 +595,7 @@ msgstr "" "引数無しで :ref:`監査イベント ` ``cpython._PySys_ClearAuditHooks`` " "を送出します。 " -#: ../../c-api/init.rst:469 +#: ../../c-api/init.rst:310 msgid "" "This is a backwards-compatible version of :c:func:`Py_FinalizeEx` that " "disregards the return value." @@ -772,143 +603,62 @@ msgstr "" "この関数は :c:func:`Py_FinalizeEx` の後方互換性バージョンで、戻り値がありませ" "ん。" -#: ../../c-api/init.rst:475 -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:484 -msgid "" -"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:490 -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:494 -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:501 -msgid "" -"The return value is ``2`` if the argument list does not represent a valid " -"Python command line, and otherwise the same as :c:func:`Py_RunMain`." -msgstr "" - -#: ../../c-api/init.rst:504 -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:508 -msgid "" -"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:516 -msgid "" -"In normal usage, an embedding application will call this function *instead* " -"of calling :c:func:`Py_Initialize`, :c:func:`Py_InitializeEx` or :c:func:" -"`Py_InitializeFromConfig` directly, and all settings will be applied as " -"described elsewhere in this documentation. If this function is instead " -"called *after* a preceding runtime initialization API call, then exactly " -"which environmental and command line configuration settings will be updated " -"is version dependent (as it depends on which settings correctly support " -"being modified after they have already been set once when the runtime was " -"first initialized)." -msgstr "" - -#: ../../c-api/init.rst:529 -msgid "Executes the main module in a fully configured CPython runtime." -msgstr "" - -#: ../../c-api/init.rst:531 -msgid "" -"Executes the command (:c:member:`PyConfig.run_command`), the script (:c:" -"member:`PyConfig.run_filename`) or the module (:c:member:`PyConfig." -"run_module`) specified on the command line or in the configuration. If none " -"of these values are set, runs the interactive Python prompt (REPL) using the " -"``__main__`` module's global namespace." -msgstr "" +#: ../../c-api/init.rst:315 +msgid "Process-wide parameters" +msgstr "プロセスワイドのパラメータ" -#: ../../c-api/init.rst:537 +#: ../../c-api/init.rst:325 msgid "" -"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), the exit status of an unhandled :exc:`SystemExit`, or ``1`` for " -"any other unhandled exception." +"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`." msgstr "" +"もし :c:func:`Py_Initialize` が呼ばれるなら、この関数はその前に呼ばなければな" +"りません。標準の IO において、どのエンコーディングおよびどんなエラー処理を使" +"うかを、 :func:`str.encode` と同様の意味で指定します。" -#: ../../c-api/init.rst:542 +#: ../../c-api/init.rst:329 msgid "" -"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: ``0``, ``1``, or the " -"status of a :exc:`SystemExit`, as specified above." +"It overrides :envvar:`PYTHONIOENCODING` values, and allows embedding code to " +"control IO encoding when the environment variable does not work." msgstr "" +"これは、環境変数が働かない時に :envvar:`PYTHONIOENCODING` の値を上書きし、埋" +"め込みコードが IO エンコーディングをコントロールできるようにします。" -#: ../../c-api/init.rst:550 +#: ../../c-api/init.rst:332 msgid "" -"This function always finalizes the Python interpreter before it returns." +"*encoding* and/or *errors* may be ``NULL`` to use :envvar:`PYTHONIOENCODING` " +"and/or default values (depending on other settings)." msgstr "" +"*encoding* と *errors* のどちらかまたは両方を ``NULL`` にすることで、 :" +"envvar:`PYTHONIOENCODING` とデフォルト値のどちらかまたは両方を使うことができ" +"ます (他の設定に依存します)。" -#: ../../c-api/init.rst:552 +#: ../../c-api/init.rst:336 msgid "" -"See :ref:`Python Configuration ` for an example of a " -"customized Python that always runs in isolated mode using :c:func:" -"`Py_RunMain`." +"Note that :data:`sys.stderr` always uses the \"backslashreplace\" error " +"handler, regardless of this (or any other) setting." msgstr "" +"この設定 (あるいは他の設定) に関わらず、 :data:`sys.stderr` は常に " +"\"backslashreplace\" エラーハンドラを使うことに注意してください。" -#: ../../c-api/init.rst:558 +#: ../../c-api/init.rst:339 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:562 -msgid "There must be an :term:`attached thread state` for *interp*." +"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`." msgstr "" +":c:func:`Py_FinalizeEx` を呼び出した場合は、:c:func:`Py_Initialize` を呼び出" +"す前に、この関数を再度呼び出す必要があるでしょう。" -#: ../../c-api/init.rst:567 -msgid "Process-wide parameters" -msgstr "プロセスワイドのパラメータ" - -#: ../../c-api/init.rst:577 +#: ../../c-api/init.rst:342 msgid "" -"This API is kept for backward compatibility: setting :c:member:`PyConfig." -"program_name` should be used instead, see :ref:`Python Initialization " -"Configuration `." +"Returns ``0`` if successful, a nonzero value on error (e.g. calling after " +"the interpreter has already been initialized)." msgstr "" +"成功したら ``0`` を、エラーの場合は ``0`` でない値を返します (例えば、インタ" +"プリタが初期化された後に、この関数が呼び出された場合)。" -#: ../../c-api/init.rst:581 +#: ../../c-api/init.rst:355 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 " @@ -931,75 +681,74 @@ msgstr "" "はプログラムの実行中に変更してはなりません。 Python インタプリタ内のコード" "で、この記憶領域の内容を変更するものは一切ありません。" -#: ../../c-api/init.rst:592 ../../c-api/init.rst:840 ../../c-api/init.rst:876 -#: ../../c-api/init.rst:902 +#: ../../c-api/init.rst:366 ../../c-api/init.rst:480 ../../c-api/init.rst:586 +#: ../../c-api/init.rst:613 ../../c-api/init.rst:630 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:type:" +"`wchar_*` string." msgstr "" +"バイト文字列を :c:type:`wchar_*` 文字列にデコードするには :c:func:" +"`Py_DecodeLocale` を使ってください。" -#: ../../c-api/init.rst:600 +#: ../../c-api/init.rst:374 msgid "" -"Return the program name set with :c:member:`PyConfig.program_name`, or the " +"Return the program name set with :c:func:`Py_SetProgramName`, or the " "default. The returned string points into static storage; the caller should " "not modify its value." msgstr "" +":c:func:`Py_SetProgramName` で設定されたプログラム名か、デフォルトのプログラ" +"ム名を返します。関数が返す文字列ポインタは静的な記憶領域を返します。関数の呼" +"び出し側はこの値を変更できません。" -#: ../../c-api/init.rst:604 ../../c-api/init.rst:627 ../../c-api/init.rst:675 -#: ../../c-api/init.rst:699 ../../c-api/init.rst:726 ../../c-api/init.rst:914 -msgid "" -"This function should not be called before :c:func:`Py_Initialize`, otherwise " -"it returns ``NULL``." -msgstr "" - -#: ../../c-api/init.rst:607 ../../c-api/init.rst:630 ../../c-api/init.rst:678 -#: ../../c-api/init.rst:702 ../../c-api/init.rst:731 ../../c-api/init.rst:917 -msgid "It now returns ``NULL`` if called before :c:func:`Py_Initialize`." -msgstr "" - -#: ../../c-api/init.rst:610 ../../c-api/init.rst:705 -msgid "" -"Use :c:func:`PyConfig_Get(\"executable\") ` (:data:`sys." -"executable`) instead." -msgstr "" - -#: ../../c-api/init.rst:617 +#: ../../c-api/init.rst:381 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:member:`PyConfig.program_name` and some environment variables; for " +"with :c:func:`Py_SetProgramName` 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.base_prefix``. It is only useful on Unix. " -"See also the next function." -msgstr "" - -#: ../../c-api/init.rst:633 -msgid "" -"Use :c:func:`PyConfig_Get(\"base_prefix\") ` (:data:`sys." -"base_prefix`) instead. Use :c:func:`PyConfig_Get(\"prefix\") ` " -"(:data:`sys.prefix`) if :ref:`virtual environments ` need to be " -"handled." -msgstr "" - -#: ../../c-api/init.rst:642 +"variable in the top-level :file:`Makefile` and the ``--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." +msgstr "" +"プラットフォーム非依存のファイル群がインストールされている場所である " +"*prefix* を返します。この値は :c:func:`Py_SetProgramName` でセットされたプロ" +"グラム名やいくつかの環境変数をもとに、数々の複雑な規則から導出されます。例え" +"ば、プログラム名が ``'/usr/local/bin/python'`` の場合、prefix は ``'/usr/" +"local'`` になります。関数が返す文字列ポインタは静的な記憶領域を返します; 関数" +"の呼び出し側はこの値を変更できません。この値はトップレベルの :file:" +"`Makefile` に指定されている変数 :makevar:`prefix` や、ビルド値に :program:" +"`configure` スクリプトに指定した ``--prefix`` 引数に対応しています。この値は " +"Python コードからは ``sys.prefix`` として利用できます。これはUnixでのみ有用で" +"す。次に説明する関数も参照してください。" + +#: ../../c-api/init.rst:394 msgid "" "Return the *exec-prefix* for installed platform-*dependent* files. This is " "derived through a number of complicated rules from the program name set " -"with :c:member:`PyConfig.program_name` and some environment variables; for " +"with :c:func:`Py_SetProgramName` and some environment variables; for " "example, if the program name is ``'/usr/local/bin/python'``, the exec-prefix " "is ``'/usr/local'``. The returned string points into static storage; the " "caller should not modify its value. This corresponds to the :makevar:" "`exec_prefix` variable in the top-level :file:`Makefile` and the ``--exec-" "prefix`` argument to the :program:`configure` script at build time. The " -"value is available to Python code as ``sys.base_exec_prefix``. It is only " -"useful on Unix." -msgstr "" - -#: ../../c-api/init.rst:653 +"value is available to Python code as ``sys.exec_prefix``. It is only useful " +"on Unix." +msgstr "" +"プラットフォーム *依存* のファイルがインストールされている場所である *exec-" +"prefix* を返します。この値は :c:func:`Py_SetProgramName` でセットされたプログ" +"ラム名やいくつかの環境変数をもとに、数々の複雑な規則から導出されます。例え" +"ば、プログラム名が ``'/usr/local/bin/python'`` の場合、exec-prefix は ``'/" +"usr/local'`` になります。関数が返す文字列ポインタは静的な記憶領域を返します; " +"関数の呼び出し側はこの値を変更できません。この値はトップレベルの :file:" +"`Makefile` に指定されている変数 :makevar:`exec_prefix` や、ビルド値に :" +"program:`configure` スクリプトに指定した ``--exec-prefix`` 引数に対応していま" +"す。この値は Python コードからは ``sys.exec_prefix`` として利用できます。 " +"Unixのみで有用です。" + +#: ../../c-api/init.rst:404 msgid "" "Background: The exec-prefix differs from the prefix when platform dependent " "files (such as executables and shared libraries) are installed in a " @@ -1013,7 +762,7 @@ msgstr "" "usr/local` に収められる一方、プラットフォーム依存のファイルは :file:`/usr/" "local/plat` サブツリーに収められます。" -#: ../../c-api/init.rst:659 +#: ../../c-api/init.rst:410 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 " @@ -1038,7 +787,7 @@ msgstr "" "ムに依存しないので注意してください (ただし、どのバージョンの Python でコンパ" "イルされたかには依存します!)。" -#: ../../c-api/init.rst:670 +#: ../../c-api/init.rst:421 msgid "" "System administrators will know how to configure the :program:`mount` or :" "program:`automount` programs to share :file:`/usr/local` between platforms " @@ -1050,43 +799,84 @@ msgstr "" "に置き、プラットフォーム間で :file:`/usr/local` を共有するための設定方法を" "知っているでしょう。" -#: ../../c-api/init.rst:681 -msgid "" -"Use :c:func:`PyConfig_Get(\"base_exec_prefix\") ` (:data:`sys." -"base_exec_prefix`) instead. Use :c:func:`PyConfig_Get(\"exec_prefix\") " -"` (:data:`sys.exec_prefix`) if :ref:`virtual environments " -"` need to be handled." -msgstr "" - -#: ../../c-api/init.rst:693 +#: ../../c-api/init.rst:433 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:member:`PyConfig.program_name`). The returned string points " +"name (set by :c:func:`Py_SetProgramName` above). 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 "" +"Python 実行可能形式の完全なプログラム名を返します; この値はデフォルトのモ" +"ジュール検索パスを (前述の :c:func:`Py_SetProgramName` で設定された) プログ" +"ラム名から導出する際に副作用的に計算されます。関数が返す文字列ポインタは静的" +"な記憶領域を返します; 関数の呼び出し側はこの値を変更できません。この値は " +"Python コードからは ``sys.executable`` として利用できます。" -#: ../../c-api/init.rst:716 +#: ../../c-api/init.rst:447 msgid "" "Return the default module search path; this is computed from the program " -"name (set by :c:member:`PyConfig.program_name`) and some environment " +"name (set by :c:func:`Py_SetProgramName` above) 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 " +"character is ``':'`` on Unix and Mac OS X, ``';'`` on Windows. The returned " "string points into static storage; the caller should not modify its value. " "The list :data:`sys.path` is initialized with this value on interpreter " "startup; it can be (and usually is) modified later to change the search path " "for loading modules." msgstr "" +"デフォルトのモジュール検索パスを返します; パスは (上の :c:func:" +"`Py_SetProgramName` で設定された) プログラム名と、いくつかの環境変数から計算" +"されます。戻り値となる文字列は、プラットフォーム依存のパス区切り文字で分割さ" +"れた一連のディレクトリ名からなります。区切り文字は Unix と Mac OS X では " +"``':'``, Windows では ``';'`` です。関数が返す文字列ポインタは静的な記憶領域" +"を返します; 関数の呼び出し側はこの値を変更できません。 :data:`sys.path` はイ" +"ンタプリタによってこの値で初期化され、その後にモジュールをロードする際の検索" +"パスを変更するために修正することが可能で、たいていそうされます。" + +#: ../../c-api/init.rst:467 +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 Mac OS X, " +"``';'`` on Windows." +msgstr "" +"デフォルトのモジュール検索パスを設定します。この関数が :c:func:" +"`Py_Initialize` より前に呼び出された場合、 :c:func:`Py_GetPath` はデフォルト" +"の検索パスを計算しようとせず、代わりにこの関数が与えた検索パスを返します。こ" +"れは、 Python がアプリケーションに組み込まれていて、そのアプリケーションが全" +"てのモジュールの場所を完全に把握しているときに便利です。パスはプラットフォー" +"ム依存の区切り文字で分割されている必要があります。区切り文字は Unix と Mac " +"OS X では ``':'`` 、Windows では ``';'`` です。" + +#: ../../c-api/init.rst:475 +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:483 +msgid "" +"The path argument is copied internally, so the caller may free it after the " +"call completes." +msgstr "" +"パス引数は内部でコピーされます。したがって、呼び出し完了後に呼び出し元は引数" +"を解放できます。" -#: ../../c-api/init.rst:734 +#: ../../c-api/init.rst:486 msgid "" -"Use :c:func:`PyConfig_Get(\"module_search_paths\") ` (:data:" -"`sys.path`) instead." +"The program full path is now used for :data:`sys.executable`, instead of the " +"program name." msgstr "" +"プログラムの名前に代わって、プログラムのフルパスが:data:`sys.executable` に使" +"われるようになりました。" -#: ../../c-api/init.rst:740 +#: ../../c-api/init.rst:493 msgid "" "Return the version of this Python interpreter. This is a string that looks " "something like ::" @@ -1094,58 +884,50 @@ msgstr "" "Python インタプリタのバージョンを返します。バージョンは、次のような形式の文字" "列です ::" -#: ../../c-api/init.rst:743 -msgid "\"3.0a5+ (py3k:63103M, May 12 2008, 00:53:55) \\n[GCC 4.2.3]\"" -msgstr "" - -#: ../../c-api/init.rst:747 +#: ../../c-api/init.rst:500 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`." +"version; the first three 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`." msgstr "" "第一ワード (最初のスペース文字まで) は、現在の Python のバージョンです; 最初" -"の文字は、ピリオドで区切られたメジャーバージョンとマイナーバージョンです。関" -"数が返す文字列ポインタは静的な記憶領域を返します; 関数の呼び出し側はこの値を" -"変更できません。この値は Python コードからは :data:`sys.version` として利用で" -"きます。" - -#: ../../c-api/init.rst:752 -msgid "See also the :c:var:`Py_Version` constant." -msgstr "" +"の三文字は、ピリオドで区切られたメジャーバージョンとマイナーバージョンです。" +"関数が返す文字列ポインタは静的な記憶領域を返します; 関数の呼び出し側はこの値" +"を変更できません。この値は Python コードからは :data:`sys.version` として利用" +"できます。" -#: ../../c-api/init.rst:759 +#: ../../c-api/init.rst:510 msgid "" "Return the platform identifier for the current platform. On Unix, this is " "formed from the \"official\" name of the operating system, converted to " "lower case, followed by the major revision number; e.g., for Solaris 2.x, " -"which is also known as SunOS 5.x, the value is ``'sunos5'``. On macOS, it " -"is ``'darwin'``. On Windows, it is ``'win'``. The returned string points " -"into static storage; the caller should not modify its value. The value is " -"available to Python code as ``sys.platform``." +"which is also known as SunOS 5.x, the value is ``'sunos5'``. On Mac OS X, " +"it is ``'darwin'``. On Windows, it is ``'win'``. The returned string " +"points into static storage; the caller should not modify its value. The " +"value is available to Python code as ``sys.platform``." msgstr "" "現在のプラットフォームのプラットフォーム識別文字列を返します。Unixでは、オペ" "レーティングシステムの \"公式の\" 名前を小文字に変換し、後ろにメジャーリビ" "ジョン番号を付けた構成になっています。例えば Solaris 2.x は、SunOS 5.x, とし" -"ても知られていますが、``'sunos5'`` になります。macOS では ``'darwin'`` です。" -"Windows では ``'win'`` です。関数が返す文字列ポインタは静的な記憶領域を返しま" -"す; 関数の呼び出し側はこの値を変更できません。この値は Python コードからは " -"``sys.platform`` として利用できます。" +"ても知られていますが、``'sunos5'`` になります。Mac OS X では ``'darwin'`` で" +"す。Windows では ``'win'`` です。関数が返す文字列ポインタは静的な記憶領域を返" +"します; 関数の呼び出し側はこの値を変更できません。この値は Python コードから" +"は ``sys.platform`` として利用できます。" -#: ../../c-api/init.rst:770 +#: ../../c-api/init.rst:521 msgid "" "Return the official copyright string for the current Python version, for " "example" msgstr "" "現在の Python バージョンに対する公式の著作権表示文字列を返します。例えば" -#: ../../c-api/init.rst:772 +#: ../../c-api/init.rst:523 msgid "``'Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam'``" msgstr "``'Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam'``" -#: ../../c-api/init.rst:776 +#: ../../c-api/init.rst:527 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``." @@ -1154,7 +936,7 @@ msgstr "" "を変更できません。この値は Python コードからは ``sys.copyright`` として利用で" "きます。" -#: ../../c-api/init.rst:782 +#: ../../c-api/init.rst:533 msgid "" "Return an indication of the compiler used to build the current Python " "version, in square brackets, for example::" @@ -1162,11 +944,7 @@ msgstr "" "現在使っているバージョンの Python をビルドする際に用いたコンパイラを示す文字" "列を、角括弧で囲った文字列を返します。例えば::" -#: ../../c-api/init.rst:785 -msgid "\"[GCC 2.7.2.2]\"" -msgstr "" - -#: ../../c-api/init.rst:789 ../../c-api/init.rst:803 +#: ../../c-api/init.rst:540 ../../c-api/init.rst:554 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 " @@ -1176,7 +954,7 @@ msgstr "" "を変更できません。この値は Python コードからは ``sys.version`` の一部として取" "り出せます。" -#: ../../c-api/init.rst:796 +#: ../../c-api/init.rst:547 msgid "" "Return information about the sequence number and build date and time of the " "current Python interpreter instance, for example ::" @@ -1184,19 +962,7 @@ msgstr "" "現在使っている Python インタプリタインスタンスの、シーケンス番号とビルド日時" "に関する情報を返します。例えば ::" -#: ../../c-api/init.rst:799 -msgid "\"#67, Aug 1 1997, 22:34:28\"" -msgstr "" - -#: ../../c-api/init.rst:815 -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 `." -msgstr "" - -#: ../../c-api/init.rst:820 +#: ../../c-api/init.rst:566 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 " @@ -1213,7 +979,7 @@ msgstr "" "の最初の要素は空文字列にしてもかまいません。この関数が :data:`sys.argv` の初" "期化に失敗した場合、致命的エラーを :c:func:`Py_FatalError` で知らせます。" -#: ../../c-api/init.rst:828 +#: ../../c-api/init.rst:574 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 " @@ -1223,7 +989,7 @@ msgstr "" "*updatepath* が 0 でない場合、この関数は :data:`sys.path` を以下のアルゴリズ" "ムに基づいて修正します:" -#: ../../c-api/init.rst:832 +#: ../../c-api/init.rst:578 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." @@ -1232,7 +998,7 @@ msgstr "" "存在するスクリプトの名前が ``argv[0]`` に渡された場合、そのスクリプトがある場" "所の絶対パスを :data:`sys.path` の先頭に追加します。" -#: ../../c-api/init.rst:835 +#: ../../c-api/init.rst:581 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 " @@ -1242,20 +1008,20 @@ msgstr "" "指していない場合)、 :data:`sys.path` の先頭に空の文字列を追加します。\n" "これは現在の作業ディレクトリ (``\".\"``) を先頭に追加するのと同じです。" -#: ../../c-api/init.rst:843 ../../c-api/init.rst:879 -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:847 +#: ../../c-api/init.rst:590 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`." +"and update :data:`sys.path` themselves if desired. See `CVE-2008-5983 " +"`_." msgstr "" +"単一のスクリプトを実行する以外の目的でPython インタプリタを埋め込んでいるアプ" +"リケーションでは、 *updatepath* に ``0`` を渡して、必要な場合は自分で :data:" +"`sys.path` を更新することをおすすめします。\n" +"`CVE-2008-5983 `_ を参照してください。" -#: ../../c-api/init.rst:852 +#: ../../c-api/init.rst:595 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:" @@ -1265,18 +1031,7 @@ msgstr "" "に :data:`sys.path` の先頭の要素を取り出すことで、同じ効果が得られます。例え" "ばこのように使います::" -#: ../../c-api/init.rst:856 -msgid "PyRun_SimpleString(\"import sys; sys.path.pop(0)\\n\");" -msgstr "" - -#: ../../c-api/init.rst:868 -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 `." -msgstr "" - -#: ../../c-api/init.rst:872 +#: ../../c-api/init.rst:609 msgid "" "This function works like :c:func:`PySys_SetArgvEx` with *updatepath* set to " "``1`` unless the :program:`python` interpreter was started with the :option:" @@ -1286,18 +1041,11 @@ msgstr "" "行されている場合を除き :c:func:`PySys_SetArgvEx` の *updatepath* に ``1`` を" "設定したのと同じように動作します。" -#: ../../c-api/init.rst:882 +#: ../../c-api/init.rst:616 msgid "The *updatepath* value depends on :option:`-I`." msgstr "*updatepath* の値は :option:`-I` オプションに依存します。" -#: ../../c-api/init.rst:889 -msgid "" -"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:893 +#: ../../c-api/init.rst:621 msgid "" "Set the default \"home\" directory, that is, the location of the standard " "Python libraries. See :envvar:`PYTHONHOME` for the meaning of the argument " @@ -1306,7 +1054,7 @@ msgstr "" "Python の標準ライブラリがある、デフォルトの \"home\" ディレクトリを設定しま" "す。引数の文字列の意味については :envvar:`PYTHONHOME` を参照してください。" -#: ../../c-api/init.rst:897 +#: ../../c-api/init.rst:625 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 " @@ -1317,29 +1065,24 @@ msgstr "" "終端の文字列であるべきです。Python インタプリタはこのストレージの内容を変更し" "ません。" -#: ../../c-api/init.rst:910 +#: ../../c-api/init.rst:636 msgid "" -"Return the default \"home\", that is, the value set by :c:member:`PyConfig." -"home`, or the value of the :envvar:`PYTHONHOME` environment variable if it " -"is set." +"Return the default \"home\", that is, the value set by a previous call to :c:" +"func:`Py_SetPythonHome`, or the value of the :envvar:`PYTHONHOME` " +"environment variable if it is set." msgstr "" +"前回の :c:func:`Py_SetPythonHome` 呼び出しで設定されたデフォルトの \"home\" " +"か、 :envvar:`PYTHONHOME` 環境変数が設定されていればその値を返します。" -#: ../../c-api/init.rst:920 -msgid "" -"Use :c:func:`PyConfig_Get(\"home\") ` or the :envvar:" -"`PYTHONHOME` environment variable instead." -msgstr "" - -#: ../../c-api/init.rst:928 +#: ../../c-api/init.rst:644 msgid "Thread State and the Global Interpreter Lock" msgstr "" "スレッド状態 (thread state) とグローバルインタプリタロック (global " "interpreter lock)" -#: ../../c-api/init.rst:935 +#: ../../c-api/init.rst:651 msgid "" -"Unless on a :term:`free-threaded ` build of :term:`CPython`, " -"the Python interpreter is not fully thread-safe. In order to support multi-" +"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 " "interpreter lock` or :term:`GIL`, that must be held by the current thread " "before it can safely access Python objects. Without the lock, even the " @@ -1348,8 +1091,17 @@ msgid "" "the same object, the reference count could end up being incremented only " "once instead of twice." msgstr "" +"Python インタプリタは完全にはスレッドセーフではありません。マルチスレッドの " +"Python プログラムをサポートするために、 :term:`グローバルインタプリタロック " +"` あるいは :term:`GIL` と呼ばれるグローバルなロック" +"が存在していて、現在のスレッドが Python オブジェクトに安全にアクセスする前に" +"必ずロックを獲得しなければならなくなっています。ロック機構がなければ、単純な" +"操作でさえ、マルチスレッドプログラムの実行に問題を引き起こす可能性がありま" +"す。たとえば、二つのスレッドが同じオブジェクトの参照カウントを同時にインクリ" +"メントすると、結果的に参照カウントは二回でなく一回だけしかインクリメントされ" +"ないかもしれません。" -#: ../../c-api/init.rst:946 +#: ../../c-api/init.rst:661 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 " @@ -1365,66 +1117,36 @@ msgstr "" "る I/O 操作の付近でも解放・獲得され、 I/O を要求するスレッドが I/O 操作の完了" "を待つ間、他のスレッドが動作できるようにしています。" -#: ../../c-api/init.rst:956 +#: ../../c-api/init.rst:672 msgid "" "The Python interpreter keeps some thread-specific bookkeeping information " -"inside a data structure called :c:type:`PyThreadState`, known as a :term:" -"`thread state`. Each OS thread has a thread-local pointer to a :c:type:" -"`PyThreadState`; a thread state referenced by this pointer is considered to " -"be :term:`attached `." -msgstr "" - -#: ../../c-api/init.rst:961 -msgid "" -"A thread can only have one :term:`attached thread state` at a time. An " -"attached thread state is typically analogous with holding the :term:`GIL`, " -"except on :term:`free-threaded ` builds. On builds with " -"the :term:`GIL` enabled, :term:`attaching ` a thread " -"state will block until the :term:`GIL` can be acquired. However, even on " -"builds with the :term:`GIL` disabled, it is still required to have an " -"attached thread state to call most of the C API." +"inside a data structure called :c:type:`PyThreadState`. There's also one " +"global variable pointing to the current :c:type:`PyThreadState`: it can be " +"retrieved using :c:func:`PyThreadState_Get`." msgstr "" +"Python インタプリタはスレッドごとに必要な情報を :c:type:`PyThreadState` と呼" +"ばれるデータ構造の中に保存します。そしてグローバル変数として現在の :c:type:" +"`PyThreadState` を指すポインタを1つ持ちます。このグローバル変数は :c:func:" +"`PyThreadState_Get` を使って取得できます。" -#: ../../c-api/init.rst:968 -msgid "" -"In general, there will always be an :term:`attached thread state` when using " -"Python's C API. Only in some specific cases (such as in a :c:macro:" -"`Py_BEGIN_ALLOW_THREADS` block) will the thread not have an attached thread " -"state. If uncertain, check if :c:func:`PyThreadState_GetUnchecked` returns " -"``NULL``." -msgstr "" - -#: ../../c-api/init.rst:974 -msgid "Detaching the thread state from extension code" -msgstr "" - -#: ../../c-api/init.rst:976 -msgid "" -"Most extension code manipulating the :term:`thread state` has the following " -"simple structure::" -msgstr "" +#: ../../c-api/init.rst:678 +msgid "Releasing the GIL from extension code" +msgstr "拡張コード内で GIL を解放する" -#: ../../c-api/init.rst:979 +#: ../../c-api/init.rst:680 msgid "" -"Save the thread state in a local variable.\n" -"... Do some blocking I/O operation ...\n" -"Restore the thread state from the local variable." +"Most extension code manipulating the :term:`GIL` has the following simple " +"structure::" msgstr "" +":term:`GIL` を操作するほとんどのコードは、次のような単純な構造になります::" -#: ../../c-api/init.rst:983 +#: ../../c-api/init.rst:689 msgid "This is so common that a pair of macros exists to simplify it::" msgstr "" "この構造は非常に一般的なので、作業を単純にするために2つのマクロが用意されてい" "ます::" -#: ../../c-api/init.rst:985 -msgid "" -"Py_BEGIN_ALLOW_THREADS\n" -"... Do some blocking I/O operation ...\n" -"Py_END_ALLOW_THREADS" -msgstr "" - -#: ../../c-api/init.rst:993 +#: ../../c-api/init.rst:699 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 " @@ -1433,84 +1155,80 @@ msgstr "" ":c:macro:`Py_BEGIN_ALLOW_THREADS` マクロは新たなブロックを開始し、隠しローカ" "ル変数を宣言します; :c:macro:`Py_END_ALLOW_THREADS` はブロックを閉じます。" -#: ../../c-api/init.rst:997 +#: ../../c-api/init.rst:703 msgid "The block above expands to the following code::" msgstr "上のブロックは次のコードに展開されます::" -#: ../../c-api/init.rst:999 -msgid "" -"PyThreadState *_save;\n" -"\n" -"_save = PyEval_SaveThread();\n" -"... Do some blocking I/O operation ...\n" -"PyEval_RestoreThread(_save);" -msgstr "" - -#: ../../c-api/init.rst:1009 -msgid "Here is how these functions work:" -msgstr "" - -#: ../../c-api/init.rst:1011 -msgid "" -"The :term:`attached thread state` holds the :term:`GIL` for the entire " -"interpreter. When detaching the :term:`attached thread state`, the :term:" -"`GIL` is released, allowing other threads to attach a thread state to their " -"own thread, thus getting the :term:`GIL` and can start executing. The " -"pointer to the prior :term:`attached thread state` is stored as a local " -"variable. Upon reaching :c:macro:`Py_END_ALLOW_THREADS`, the thread state " -"that was previously :term:`attached ` is passed to :c:" -"func:`PyEval_RestoreThread`. This function will block until another releases " -"its :term:`thread state `, thus allowing the old :" -"term:`thread state ` to get re-attached and the C API " -"can be called again." -msgstr "" - -#: ../../c-api/init.rst:1021 -msgid "" -"For :term:`free-threaded ` builds, the :term:`GIL` is " -"normally out of the question, but detaching the :term:`thread state " -"` is still required for blocking I/O and long " -"operations. The difference is that threads don't have to wait for the :term:" -"`GIL` to be released to attach their thread state, allowing true multi-core " -"parallelism." -msgstr "" - -#: ../../c-api/init.rst:1027 -msgid "" -"Calling system I/O functions is the most common use case for detaching the :" -"term:`thread state `, but it can also be useful " -"before calling long-running computations which don't need access to Python " -"objects, such as compression or cryptographic functions operating over " -"memory buffers. For example, the standard :mod:`zlib` and :mod:`hashlib` " -"modules detach the :term:`thread state ` when " +#: ../../c-api/init.rst:715 +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 " +"and saving the thread state, the current thread state pointer must be " +"retrieved before the lock is released (since another thread could " +"immediately acquire the lock and store its own thread state in the global " +"variable). Conversely, when acquiring the lock and restoring the thread " +"state, the lock must be acquired before storing the thread state pointer." +msgstr "" +"これらの関数の動作を説明します。GIL は現在のスレッド状態を指すポインタを保護" +"するために使われます。ロックを解放してスレッド状態を退避する際、ロックを解放" +"する前に現在のスレッド状態ポインタを取得しておかなければなりません (他のス" +"レッドがすぐさまロックを獲得して、自らのスレッド状態をグローバル変数に保存し" +"てしまうかもしれないからです)。逆に、ロックを獲得してスレッド状態を復帰する際" +"には、グローバル変数にスレッド状態ポインタを保存する前にロックを獲得しておか" +"なければなりません。" + +#: ../../c-api/init.rst:724 +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 " +"which don't need access to Python objects, such as compression or " +"cryptographic functions operating over memory buffers. For example, the " +"standard :mod:`zlib` and :mod:`hashlib` modules release the GIL when " "compressing or hashing data." msgstr "" +"GIL を解放するのはほとんどがシステムのI/O関数を呼び出す時ですが、メモリバッ" +"ファに対する圧縮や暗号化のように、 Python のオブジェクトにアクセスしない長時" +"間かかる計算処理を呼び出すときも GIL を解放することは有益です。例えば、 :mod:" +"`zlib` や :mod:`hashlib` モジュールは圧縮やハッシュ計算の前に GIL を解放しま" +"す。" -#: ../../c-api/init.rst:1038 +#: ../../c-api/init.rst:735 msgid "Non-Python created threads" msgstr "Python 以外で作られたスレッド" -#: ../../c-api/init.rst:1040 +#: ../../c-api/init.rst:737 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 " -"management), they don't hold the :term:`GIL`, because they don't have an :" -"term:`attached thread state`." +"management), they don't hold the GIL, nor is there a thread state structure " +"for them." msgstr "" +"Python API を通して作られたスレッド (:mod:`threading` モジュールなど) では自" +"動的にスレッド状態が割り当てられて、上記のコードは正しく動きます。しかし、(自" +"前でスレッド管理を行う外部のライブラリなどにより)C言語でスレッドを生成した場" +"合、そのスレッドには GIL がなく、スレッド状態データ構造体もないことに注意する" +"必要があります。" -#: ../../c-api/init.rst:1047 +#: ../../c-api/init.rst:744 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 " -"must first register these threads with the interpreter by creating an :term:" -"`attached thread state` before you can start using the Python/C API. When " -"you are done, you should detach the :term:`thread state `, and finally free it." -msgstr "" +"must first register these threads with the interpreter by creating a thread " +"state data structure, then acquiring the GIL, and finally storing their " +"thread state pointer, before you can start using the Python/C API. When you " +"are done, you should reset the thread state pointer, release the GIL, and " +"finally free the thread state data structure." +msgstr "" +"このようなスレッドから Python コードを呼び出す必要がある場合 (外部のライブラ" +"リからコールバックするAPIなどがよくある例です)、Python/C API を呼び出す前に、" +"スレッド状態データ構造体を生成し、GIL を獲得し、スレッド状態ポインタを保存す" +"ることで、スレッドをインタプリタに登録しなければなりません。スレッドが作業を" +"終えたら、スレッド状態ポインタをリセットして、ロックを解放し、最後にスレッド" +"状態データ構造体のメモリを解放しなければなりません。" -#: ../../c-api/init.rst:1054 +#: ../../c-api/init.rst:752 msgid "" "The :c:func:`PyGILState_Ensure` and :c:func:`PyGILState_Release` functions " "do all of the above automatically. The typical idiom for calling into " @@ -1520,73 +1238,25 @@ msgstr "" "的に行います。 Cのスレッドから Python を呼び出す典型的な方法は以下のとおりで" "す::" -#: ../../c-api/init.rst:1058 -msgid "" -"PyGILState_STATE gstate;\n" -"gstate = PyGILState_Ensure();\n" -"\n" -"/* Perform Python actions here. */\n" -"result = CallSomeFunction();\n" -"/* evaluate result or handle exception */\n" -"\n" -"/* Release the thread. No Python API allowed beyond this point. */\n" -"PyGILState_Release(gstate);" -msgstr "" - -#: ../../c-api/init.rst:1068 -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. This is because :c:func:" -"`PyGILState_Ensure` and similar functions default to :term:`attaching " -"` a :term:`thread state` for the main interpreter, " -"meaning that the thread can't safely interact with the calling " -"subinterpreter." -msgstr "" - -#: ../../c-api/init.rst:1078 -msgid "Supporting subinterpreters in non-Python threads" -msgstr "" - -#: ../../c-api/init.rst:1080 -msgid "" -"If you would like to support subinterpreters with non-Python created " -"threads, you must use the ``PyThreadState_*`` API instead of the traditional " -"``PyGILState_*`` API." -msgstr "" - -#: ../../c-api/init.rst:1084 +#: ../../c-api/init.rst:766 msgid "" -"In particular, you must store the interpreter state from the calling " -"function and pass it to :c:func:`PyThreadState_New`, which will ensure that " -"the :term:`thread state` is targeting the correct interpreter::" +"Note that the :c:func:`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 :c:func:" +"`PyGILState_\\*` API is unsupported." msgstr "" +":c:func:`PyGILState_\\*` 関数は、(:c:func:`Py_Initialize` によって自動的に作" +"られる) グローバルインタプリタ1つだけが存在すると仮定する事に気をつけて下さ" +"い。 Python は (:c:func:`Py_NewInterpreter` を使って) 追加のインタプリタを作" +"成できることに変わりはありませんが、複数インタプリタと :c:func:" +"`PyGILState_\\*` API を混ぜて使うことはサポートされていません。" -#: ../../c-api/init.rst:1088 -msgid "" -"/* The return value of PyInterpreterState_Get() from the\n" -" function that created this thread. */\n" -"PyInterpreterState *interp = ThreadData->interp;\n" -"PyThreadState *tstate = PyThreadState_New(interp);\n" -"PyThreadState_Swap(tstate);\n" -"\n" -"/* GIL of the subinterpreter is now held.\n" -" Perform Python actions here. */\n" -"result = CallSomeFunction();\n" -"/* evaluate result or handle exception */\n" -"\n" -"/* Destroy the thread state. No Python API allowed beyond this point. */\n" -"PyThreadState_Clear(tstate);\n" -"PyThreadState_DeleteCurrent();" -msgstr "" - -#: ../../c-api/init.rst:1106 +#: ../../c-api/init.rst:776 msgid "Cautions about fork()" msgstr "" -#: ../../c-api/init.rst:1108 +#: ../../c-api/init.rst:778 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 " @@ -1595,7 +1265,7 @@ msgid "" "CPython's runtime." msgstr "" -#: ../../c-api/init.rst:1114 +#: ../../c-api/init.rst:784 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` " @@ -1603,7 +1273,7 @@ msgid "" "them afterwards. In addition, it resets any :ref:`lock-objects` in the " "child. When extending or embedding Python, there is no way to inform Python " "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 " +"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 " @@ -1612,7 +1282,7 @@ msgid "" "locks, but is not always able to." msgstr "" -#: ../../c-api/init.rst:1129 +#: ../../c-api/init.rst:799 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 " @@ -1625,48 +1295,11 @@ msgid "" "called immediately after." msgstr "" -#: ../../c-api/init.rst:1143 -msgid "Cautions regarding runtime finalization" -msgstr "" - -#: ../../c-api/init.rst:1145 -msgid "" -"In the late stage of :term:`interpreter shutdown`, after attempting to wait " -"for non-daemon threads to exit (though this can be interrupted by :class:" -"`KeyboardInterrupt`) and running the :mod:`atexit` functions, the runtime is " -"marked as *finalizing*: :c:func:`Py_IsFinalizing` and :func:`sys." -"is_finalizing` return true. At this point, only the *finalization thread* " -"that initiated finalization (typically the main thread) is allowed to " -"acquire the :term:`GIL`." -msgstr "" - -#: ../../c-api/init.rst:1153 -msgid "" -"If any thread, other than the finalization thread, attempts to attach a :" -"term:`thread state` during finalization, either explicitly or implicitly, " -"the thread enters **a permanently blocked state** where it remains until the " -"program exits. In most cases this is harmless, but this can result in " -"deadlock if a later stage of finalization attempts to acquire a lock owned " -"by the blocked thread, or otherwise waits on the blocked thread." -msgstr "" - -#: ../../c-api/init.rst:1160 -msgid "" -"Gross? Yes. This prevents random crashes and/or unexpectedly skipped C++ " -"finalizations further up the call stack when such threads were forcibly " -"exited here in CPython 3.13 and earlier. The CPython runtime :term:`thread " -"state` C APIs have never had any error reporting or handling expectations " -"at :term:`thread state` attachment time that would've allowed for graceful " -"exit from this situation. Changing that would require new stable C APIs and " -"rewriting the majority of C code in the CPython ecosystem to use those with " -"error handling." -msgstr "" - -#: ../../c-api/init.rst:1170 +#: ../../c-api/init.rst:812 msgid "High-level API" msgstr "高レベルAPI" -#: ../../c-api/init.rst:1172 +#: ../../c-api/init.rst:814 msgid "" "These are the most commonly used types and functions when writing C " "extension code, or when embedding the Python interpreter:" @@ -1674,7 +1307,7 @@ msgstr "" "C拡張を書いたりPythonインタプリタを埋め込むときに最も一般的に使われる型や関数" "は次のとおりです:" -#: ../../c-api/init.rst:1177 +#: ../../c-api/init.rst:819 msgid "" "This data structure represents the state shared by a number of cooperating " "threads. Threads belonging to the same interpreter share their module " @@ -1686,7 +1319,7 @@ msgstr "" "内部的な情報を共有しています。この構造体には公開 (public) のメンバはありませ" "ん。" -#: ../../c-api/init.rst:1182 +#: ../../c-api/init.rst:824 msgid "" "Threads belonging to different interpreters initially share nothing, except " "process state like available memory, open file descriptors and such. The " @@ -1698,30 +1331,27 @@ msgstr "" "いません。GILもまた、スレッドがどのインタプリタに属しているかに関わらずすべて" "のスレッドで共有されています。" -#: ../../c-api/init.rst:1190 +#: ../../c-api/init.rst:832 msgid "" "This data structure represents the state of a single thread. The only " -"public data member is:" +"public data member is :attr:`interp` (:c:type:`PyInterpreterState *`), which " +"points to this thread's interpreter state." msgstr "" -#: ../../c-api/init.rst:1195 -msgid "This thread's interpreter state." -msgstr "" - -#: ../../c-api/init.rst:1206 +#: ../../c-api/init.rst:845 msgid "Deprecated function which does nothing." msgstr "" -#: ../../c-api/init.rst:1208 +#: ../../c-api/init.rst:847 msgid "" "In Python 3.6 and older, this function created the GIL if it didn't exist." msgstr "" -#: ../../c-api/init.rst:1210 +#: ../../c-api/init.rst:849 msgid "The function now does nothing." msgstr "" -#: ../../c-api/init.rst:1213 +#: ../../c-api/init.rst:852 msgid "" "This function is now called by :c:func:`Py_Initialize()`, so you don't have " "to call it yourself anymore." @@ -1729,85 +1359,88 @@ msgstr "" "この関数は :c:func:`Py_Initialize()` から呼び出されるようになり、わざわざ呼び" "出す必要はもう無くなりました。" -#: ../../c-api/init.rst:1217 +#: ../../c-api/init.rst:856 msgid "" "This function cannot be called before :c:func:`Py_Initialize()` anymore." msgstr "" "この関数は :c:func:`Py_Initialize()` より前に呼び出すことができなくなりまし" "た。" -#: ../../c-api/init.rst:1227 -msgid "" -"Detach the :term:`attached thread state` and return it. The thread will have " -"no :term:`thread state` upon returning." -msgstr "" - -#: ../../c-api/init.rst:1233 -msgid "" -"Set the :term:`attached thread state` to *tstate*. The passed :term:`thread " -"state` **should not** be :term:`attached `, otherwise " -"deadlock ensues. *tstate* will be attached upon returning." -msgstr "" - -#: ../../c-api/init.rst:1238 ../../c-api/init.rst:1609 +#: ../../c-api/init.rst:866 msgid "" -"Calling this function from a thread when the runtime is finalizing will hang " -"the thread until the program exits, even if the thread was not created by " -"Python. Refer to :ref:`cautions-regarding-runtime-finalization` for more " -"details." +"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:func:`PyEval_InitThreads` をすでに呼び出している場合は真 (非ゼロ) を返しま" +"す。この関数は、GILを獲得せずに呼び出すことができますので、シングルスレッドで" +"実行している場合にはロック関連のAPI呼び出しを避けるために使うことができます。" -#: ../../c-api/init.rst:1243 ../../c-api/init.rst:1314 -#: ../../c-api/init.rst:1619 -msgid "" -"Hangs the current thread, rather than terminating it, if called while the " -"interpreter is finalizing." +#: ../../c-api/init.rst:870 +msgid "The :term:`GIL` is now initialized by :c:func:`Py_Initialize()`." msgstr "" +":term:`GIL` が :c:func:`Py_Initialize()` で初期化されるようになりました。" -#: ../../c-api/init.rst:1249 +#: ../../c-api/init.rst:878 msgid "" -"Return the :term:`attached thread state`. If the thread has no attached " -"thread state, (such as when inside of :c:macro:`Py_BEGIN_ALLOW_THREADS` " -"block), then this issues a fatal error (so that the caller needn't check for " -"``NULL``)." +"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 " +"``NULL``). If the lock has been created, the current thread must have " +"acquired it." msgstr "" +"(GIL が生成されている場合) GILを解放して、スレッドの状態を ``NULL`` にし、以" +"前のスレッド状態 (``NULL`` にはなりません) を返します。\n" +"ロックがすでに生成されている場合、現在のスレッドがロックを獲得していなければ" +"なりません。" -#: ../../c-api/init.rst:1254 -msgid "See also :c:func:`PyThreadState_GetUnchecked`." -msgstr "" - -#: ../../c-api/init.rst:1258 +#: ../../c-api/init.rst:886 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." +"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 " +"created, the current thread must not have acquired it, otherwise deadlock " +"ensues." msgstr "" +"(GIL が生成されている場合) GIL を獲得して、現在のスレッド状態を *tstate* に設" +"定します。 *tstate* は ``NULL`` であってはなりません。 GIL が生成されていて、" +"この関数を呼び出したスレッドがすでにロックを獲得している場合、デッドロックに" +"陥ります。" -#: ../../c-api/init.rst:1262 +#: ../../c-api/init.rst:892 ../../c-api/init.rst:938 ../../c-api/init.rst:1197 +#: ../../c-api/init.rst:1235 msgid "" -"In Python 3.5 to 3.12, the function was private and known as " -"``_PyThreadState_UncheckedGet()``." +"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 "" +"ランタイムが終了処理をしているときに、スレッドからこの関数を呼び出すと、その" +"スレッドが Python によって作成されたものではなかったとしても終了させられま" +"す。\n" +":c:func:`_Py_IsFinalizing` や :func:`sys.is_finalizing` を使うと、この関数を" +"呼び出す前にインタプリタが終了される過程の途中なのか確認でき、望まないスレッ" +"ドの終了が避けられます。" -#: ../../c-api/init.rst:1269 +#: ../../c-api/init.rst:900 msgid "" -"Set the :term:`attached thread state` to *tstate*, and return the :term:" -"`thread state` that was attached prior to calling." +"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 "" +"現在のスレッド状態を返します。GIL を保持していなければなりません。現在のス" +"レッド状態が ``NULL`` なら、(呼び出し側が ``NULL`` チェックをしなくてすむよう" +"に) この関数は致命的エラーを起こすようになっています。" -#: ../../c-api/init.rst:1272 +#: ../../c-api/init.rst:907 msgid "" -"This function is safe to call without an :term:`attached thread state`; it " -"will simply return ``NULL`` indicating that there was no prior thread state." +"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 "" +"現在のスレッド状態を *tstate* に指定したスレッド状態と入れ変えます。*tstate* " +"は ``NULL`` の場合があります。GIL を保持していなければならず、解放しません。" -#: ../../c-api/init.rst:1279 -msgid "" -"Similar to :c:func:`PyGILState_Ensure`, this function will hang the thread " -"if the runtime is finalizing." -msgstr "" - -#: ../../c-api/init.rst:1283 +#: ../../c-api/init.rst:912 msgid "" "The following functions use thread-local storage, and are not compatible " "with sub-interpreters:" @@ -1815,45 +1448,51 @@ msgstr "" "以下の関数はスレッドローカルストレージを利用していて、サブインタプリタとの互" "換性がありません:" -#: ../../c-api/init.rst:1288 +#: ../../c-api/init.rst:917 msgid "" "Ensure that the current thread is ready to call the Python C API regardless " -"of the current state of Python, or of the :term:`attached thread state`. " -"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 " +"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." msgstr "" +"Pythonの状態やGILに関わらず、実行中スレッドでPython C APIの呼び出しが可能とな" +"るようにします。この関数はスレッド内で何度でも呼び出すことができますが、必ず" +"全ての呼び出しに対応して :c:func:`PyGILState_Release` を呼び出す必要がありま" +"す。通常、 :c:func:`PyGILState_Ensure` 呼び出しと :c:func:" +"`PyGILState_Release` 呼び出しの間でこれ以外のスレッド関連API を使用することが" +"できますが、Release()の前にスレッド状態は復元されていなければなりません。例え" +"ば、通常の :c:macro:`Py_BEGIN_ALLOW_THREADS` マクロと :c:macro:" +"`Py_END_ALLOW_THREADS` は使用することができます。" -#: ../../c-api/init.rst:1298 +#: ../../c-api/init.rst:927 msgid "" -"The return value is an opaque \"handle\" to the :term:`attached 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:func:`PyGILState_Ensure` 呼び出し時のスレッド状態を隠蔽した\"ハン" +"ドル\"で、 :c:func:`PyGILState_Release` に渡してPythonを同じ状態に保たなけれ" +"ばなりません。再起呼び出しも可能ですが、ハンドルを共有することは *できません" +"* - それぞれの :c:func:`PyGILState_Ensure` 呼び出しでハンドルを保存し、対応す" +"る :c:func:`PyGILState_Release` 呼び出しで渡してください。" -#: ../../c-api/init.rst:1305 +#: ../../c-api/init.rst:934 msgid "" -"When the function returns, there will be an :term:`attached thread state` " -"and the thread will be able to call arbitrary Python code. Failure is a " -"fatal error." +"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 "" +"関数から復帰したとき、実行中のスレッドはGILを所有していて、任意の Python コー" +"ドを実行できます。処理の失敗は致命的なエラーです。" -#: ../../c-api/init.rst:1309 -msgid "" -"Calling this function when the runtime is finalizing is unsafe. Doing so " -"will either hang the thread until the program ends, or fully crash the " -"interpreter in rare cases. Refer to :ref:`cautions-regarding-runtime-" -"finalization` for more details." -msgstr "" - -#: ../../c-api/init.rst:1320 +#: ../../c-api/init.rst:946 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:" @@ -1865,7 +1504,7 @@ msgstr "" "態は呼び出し元でははわかりませんので、GILState APIを利用するようにしてくださ" "い)。" -#: ../../c-api/init.rst:1325 +#: ../../c-api/init.rst:951 msgid "" "Every call to :c:func:`PyGILState_Ensure` must be matched by a call to :c:" "func:`PyGILState_Release` on the same thread." @@ -1873,42 +1512,38 @@ msgstr "" ":c:func:`PyGILState_Ensure` を呼び出す場合は、必ず同一スレッド内で対応する :" "c:func:`PyGILState_Release` を呼び出してください。" -#: ../../c-api/init.rst:1330 -msgid "" -"Get the :term:`attached thread state` for this thread. May return ``NULL`` " -"if no GILState API has been used on the current thread. Note that the main " -"thread always has such a thread-state, even if no auto-thread-state call has " -"been made on the main thread. This is mainly a helper/diagnostic function." -msgstr "" - -#: ../../c-api/init.rst:1336 +#: ../../c-api/init.rst:957 msgid "" -"This function does not account for :term:`thread states ` " -"created by something other than :c:func:`PyGILState_Ensure` (such as :c:func:" -"`PyThreadState_New`). Prefer :c:func:`PyThreadState_Get` or :c:func:" -"`PyThreadState_GetUnchecked` for most cases." +"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 " +"always has such a thread-state, even if no auto-thread-state call has been " +"made on the main thread. This is mainly a helper/diagnostic function." msgstr "" +"このスレッドの現在のスレッドの状態を取得します。これまで現在のスレッドで " +"GILState API を使ったことが無い場合は、``NULL`` が返ります。メインスレッドで" +"自身のスレッド状態に関する呼び出しを全くしないとしても、メインスレッドは常に" +"スレッド状態の情報を持っていることに注意してください。こうなっている目的は主" +"にヘルパ機能もしくは診断機能のためです。" -#: ../../c-api/init.rst:1345 +#: ../../c-api/init.rst:965 msgid "" -"Return ``1`` if the current thread is holding the :term:`GIL` and ``0`` " -"otherwise. This function can be called from any thread at any time. Only if " -"it has had its :term:`thread state ` initialized via :" -"c:func:`PyGILState_Ensure` will it return ``1``. This is mainly a helper/" -"diagnostic function. It can be useful for example in callback contexts or " -"memory allocation functions when knowing that the :term:`GIL` is locked can " -"allow the caller to perform sensitive actions or otherwise behave " -"differently." +"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 " +"its Python thread state initialized and currently is holding the GIL will it " +"return ``1``. This is mainly a helper/diagnostic function. It can be useful " +"for example in callback contexts or memory allocation functions when knowing " +"that the GIL is locked can allow the caller to perform sensitive actions or " +"otherwise behave differently." msgstr "" +"現在のスレッドが GILを保持しているならば ``1`` を、そうでなければ ``0`` を返" +"します。この関数はいつでもどのスレッドからでも呼び出すことができます。 " +"Python スレッドの状態が初期化されており、現在 GIL を保持している場合にのみ " +"``1`` を返します。これは主にヘルパー/診断用の関数です。この関数は、例えばコー" +"ルバックのコンテキストやメモリ割り当て機能で有益でしょう。なぜなら、 GIL が" +"ロックされていると知っていれば、呼び出し元は sensitive な行動を実行することが" +"でき、そうでなければ異なるやりかたで振る舞うことができるからです。" -#: ../../c-api/init.rst:1355 -msgid "" -"If the current Python process has ever created a subinterpreter, this " -"function will *always* return ``1``. Prefer :c:func:" -"`PyThreadState_GetUnchecked` for most cases." -msgstr "" - -#: ../../c-api/init.rst:1362 +#: ../../c-api/init.rst:977 msgid "" "The following macros are normally used without a trailing semicolon; look " "for example usage in the Python source distribution." @@ -1916,7 +1551,7 @@ msgstr "" "以下のマクロは、通常末尾にセミコロンを付けずに使います; Python ソース配布物内" "の使用例を見てください。" -#: ../../c-api/init.rst:1368 +#: ../../c-api/init.rst:983 msgid "" "This macro expands to ``{ PyThreadState *_save; _save = PyEval_SaveThread();" "``. Note that it contains an opening brace; it must be matched with a " @@ -1928,7 +1563,7 @@ msgstr "" "弧は後で :c:macro:`Py_END_ALLOW_THREADS` マクロと対応させなければなりません。" "マクロについての詳しい議論は上記を参照してください。" -#: ../../c-api/init.rst:1376 +#: ../../c-api/init.rst:991 msgid "" "This macro expands to ``PyEval_RestoreThread(_save); }``. Note that it " "contains a closing brace; it must be matched with an earlier :c:macro:" @@ -1940,7 +1575,7 @@ msgstr "" "`Py_BEGIN_ALLOW_THREADS` マクロと対応していなければなりません。マクロについて" "の詳しい議論は上記を参照してください。" -#: ../../c-api/init.rst:1384 +#: ../../c-api/init.rst:999 msgid "" "This macro expands to ``PyEval_RestoreThread(_save);``: it is equivalent to :" "c:macro:`Py_END_ALLOW_THREADS` without the closing brace." @@ -1948,7 +1583,7 @@ msgstr "" "このマクロを展開すると ``PyEval_RestoreThread(_save);`` になります: 閉じ波括" "弧のない :c:macro:`Py_END_ALLOW_THREADS` と同じです。" -#: ../../c-api/init.rst:1390 +#: ../../c-api/init.rst:1005 msgid "" "This macro expands to ``_save = PyEval_SaveThread();``: it is equivalent to :" "c:macro:`Py_BEGIN_ALLOW_THREADS` without the opening brace and variable " @@ -1957,30 +1592,32 @@ msgstr "" "このマクロを展開すると ``_save = PyEval_SaveThread();`` になります: 開き波括" "弧のない :c:macro:`Py_BEGIN_ALLOW_THREADS` と同じです。" -#: ../../c-api/init.rst:1396 +#: ../../c-api/init.rst:1011 msgid "Low-level API" msgstr "低レベルAPI" -#: ../../c-api/init.rst:1398 +#: ../../c-api/init.rst:1013 msgid "" "All of the following functions must be called after :c:func:`Py_Initialize`." msgstr "" "次の全ての関数は :c:func:`Py_Initialize` の後に呼び出さなければなりません。" -#: ../../c-api/init.rst:1400 -msgid "" -":c:func:`Py_Initialize()` now initializes the :term:`GIL` and sets an :term:" -"`attached thread state`." +#: ../../c-api/init.rst:1015 +msgid ":c:func:`Py_Initialize()` now initializes the :term:`GIL`." msgstr "" +":c:func:`Py_Initialize()` は :term:`GIL` を初期化するようになりました。" -#: ../../c-api/init.rst:1407 +#: ../../c-api/init.rst:1021 msgid "" -"Create a new interpreter state object. An :term:`attached thread state` is " -"not needed, but may optionally exist if it is necessary to serialize calls " -"to this function." +"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 "" +"新しいインタプリタ状態オブジェクトを生成します。GIL を保持しておく必要はあり" +"ませんが、この関数を次々に呼び出す必要がある場合には保持しておいたほうがよい" +"でしょう。" -#: ../../c-api/init.rst:1411 +#: ../../c-api/init.rst:1025 msgid "" "Raises an :ref:`auditing event ` ``cpython." "PyInterpreterState_New`` with no arguments." @@ -1988,13 +1625,15 @@ msgstr "" "引数無しで :ref:`監査イベント ` ``cpython.PyInterpreterState_New`` " "を送出します。 " -#: ../../c-api/init.rst:1416 +#: ../../c-api/init.rst:1030 msgid "" -"Reset all information in an interpreter state object. There must be an :" -"term:`attached thread state` for the the interpreter." +"Reset all information in an interpreter state object. The global " +"interpreter lock must be held." msgstr "" +"インタプリタ状態オブジェクト内の全ての情報をリセットします。GIL を保持してい" +"なければなりません。" -#: ../../c-api/init.rst:1419 +#: ../../c-api/init.rst:1033 msgid "" "Raises an :ref:`auditing event ` ``cpython." "PyInterpreterState_Clear`` with no arguments." @@ -2002,116 +1641,101 @@ msgstr "" "引数無しで :ref:`監査イベント ` ``cpython." "PyInterpreterState_Clear`` を送出します。 " -#: ../../c-api/init.rst:1424 +#: ../../c-api/init.rst:1038 msgid "" -"Destroy an interpreter state object. There **should not** be an :term:" -"`attached thread state` for the target interpreter. The interpreter state " -"must have been reset with a previous call to :c:func:" -"`PyInterpreterState_Clear`." +"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 "" +"インタプリタ状態オブジェクトを破壊します。GIL を保持しておく必要はありませ" +"ん。インタプリタ状態は :c:func:`PyInterpreterState_Clear` であらかじめリセッ" +"トしておかなければなりません。" -#: ../../c-api/init.rst:1431 +#: ../../c-api/init.rst:1045 msgid "" "Create a new thread state object belonging to the given interpreter object. " -"An :term:`attached thread state` is not needed." +"The global interpreter lock need not be held, but may be held if it is " +"necessary to serialize calls to this function." msgstr "" +"指定したインタプリタオブジェクトに属する新たなスレッド状態オブジェクトを生成" +"します。GIL を保持しておく必要はありませんが、この関数を次々に呼び出す必要が" +"ある場合には保持しておいたほうがよいでしょう。" -#: ../../c-api/init.rst:1436 +#: ../../c-api/init.rst:1052 msgid "" -"Reset all information in a :term:`thread state` object. *tstate* must be :" -"term:`attached `" +"Reset all information in a thread state object. The global interpreter lock " +"must be held." msgstr "" +"スレッド状態オブジェクト内の全ての情報をリセットします。GIL を保持していなけ" +"ればなりません。" -#: ../../c-api/init.rst:1439 +#: ../../c-api/init.rst:1055 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:1443 -msgid "The :c:member:`PyThreadState.on_delete` callback was removed." -msgstr "" - -#: ../../c-api/init.rst:1449 -msgid "" -"Destroy a :term:`thread state` object. *tstate* should not be :term:" -"`attached ` to any thread. *tstate* must have been " -"reset with a previous call to :c:func:`PyThreadState_Clear`." -msgstr "" - -#: ../../c-api/init.rst:1457 +#: ../../c-api/init.rst:1062 msgid "" -"Detach the :term:`attached thread state` (which must have been reset with a " -"previous call to :c:func:`PyThreadState_Clear`) and then destroy it." +"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`." msgstr "" +"スレッド状態オブジェクトを破壊します。GIL を保持する必要はありません。スレッ" +"ド状態は :c:func:`PyThreadState_Clear` であらかじめリセットしておかなければな" +"りません。" -#: ../../c-api/init.rst:1460 +#: ../../c-api/init.rst:1069 msgid "" -"No :term:`thread state` will be :term:`attached ` " -"upon returning." +"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`." msgstr "" -#: ../../c-api/init.rst:1465 +#: ../../c-api/init.rst:1077 msgid "Get the current frame of the Python thread state *tstate*." msgstr "" -#: ../../c-api/init.rst:1467 +#: ../../c-api/init.rst:1079 msgid "" -"Return a :term:`strong reference`. Return ``NULL`` if no frame is currently " +"Return a strong reference. Return ``NULL`` if no frame is currently " "executing." msgstr "" -#: ../../c-api/init.rst:1470 +#: ../../c-api/init.rst:1082 msgid "See also :c:func:`PyEval_GetFrame`." msgstr "" -#: ../../c-api/init.rst:1472 ../../c-api/init.rst:1481 -#: ../../c-api/init.rst:1490 -msgid "" -"*tstate* must not be ``NULL``, and must be :term:`attached `." +#: ../../c-api/init.rst:1084 ../../c-api/init.rst:1093 +#: ../../c-api/init.rst:1102 +msgid "*tstate* must not be ``NULL``." msgstr "" -#: ../../c-api/init.rst:1479 +#: ../../c-api/init.rst:1091 msgid "" -"Get the unique :term:`thread state` identifier of the Python thread state " -"*tstate*." +"Get the unique thread state identifier of the Python thread state *tstate*." msgstr "" -#: ../../c-api/init.rst:1488 +#: ../../c-api/init.rst:1100 msgid "Get the interpreter of the Python thread state *tstate*." msgstr "" -#: ../../c-api/init.rst:1497 -msgid "Suspend tracing and profiling in the Python thread state *tstate*." -msgstr "" - -#: ../../c-api/init.rst:1499 -msgid "Resume them using the :c:func:`PyThreadState_LeaveTracing` function." -msgstr "" - -#: ../../c-api/init.rst:1506 -msgid "" -"Resume tracing and profiling in the Python thread state *tstate* suspended " -"by the :c:func:`PyThreadState_EnterTracing` function." -msgstr "" - -#: ../../c-api/init.rst:1509 -msgid "" -"See also :c:func:`PyEval_SetTrace` and :c:func:`PyEval_SetProfile` functions." -msgstr "" - -#: ../../c-api/init.rst:1517 +#: ../../c-api/init.rst:1109 msgid "Get the current interpreter." msgstr "" -#: ../../c-api/init.rst:1519 +#: ../../c-api/init.rst:1111 msgid "" -"Issue a fatal error if there no :term:`attached thread state`. It cannot " -"return NULL." +"Issue a fatal error if there no current Python thread state or no current " +"interpreter. It cannot return NULL." msgstr "" -#: ../../c-api/init.rst:1527 +#: ../../c-api/init.rst:1114 ../../c-api/init.rst:1124 +msgid "The caller must hold the GIL." +msgstr "呼び出し側はGILを獲得する必要があります" + +#: ../../c-api/init.rst:1121 msgid "" "Return the interpreter's unique ID. If there was any error in doing so then " "``-1`` is returned and an error is set." @@ -2119,13 +1743,7 @@ msgstr "" "インタプリタの一意な ID を返します。\n" "処理中に何かエラーが起きたら、 ``-1`` が返され、エラーがセットされます。" -#: ../../c-api/init.rst:1530 ../../c-api/init.rst:2117 -#: ../../c-api/init.rst:2124 ../../c-api/init.rst:2143 -#: ../../c-api/init.rst:2150 -msgid "The caller must have an :term:`attached thread state`." -msgstr "" - -#: ../../c-api/init.rst:1537 +#: ../../c-api/init.rst:1131 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 " @@ -2135,7 +1753,7 @@ msgstr "" "この関数が ``NULL`` を返した場合は、ここまでで例外は送出されておらず、呼び出" "し側はインタプリタ固有の辞書は利用できないと考えなければなりません。" -#: ../../c-api/init.rst:1541 +#: ../../c-api/init.rst:1135 msgid "" "This is not a replacement for :c:func:`PyModule_GetState()`, which " "extensions should use to store interpreter-specific state information." @@ -2143,87 +1761,93 @@ msgstr "" "この関数は :c:func:`PyModule_GetState()` を置き換えるものではなく、拡張モ" "ジュールがインタプリタ固有の状態情報を格納するのに使うべきものです。" -#: ../../c-api/init.rst:1549 +#: ../../c-api/init.rst:1142 msgid "Type of a frame evaluation function." msgstr "" -#: ../../c-api/init.rst:1551 +#: ../../c-api/init.rst:1144 msgid "" "The *throwflag* parameter is used by the ``throw()`` method of generators: " "if non-zero, handle the current exception." msgstr "" -#: ../../c-api/init.rst:1554 +#: ../../c-api/init.rst:1147 msgid "The function now takes a *tstate* parameter." msgstr "" -#: ../../c-api/init.rst:1557 -msgid "" -"The *frame* parameter changed from ``PyFrameObject*`` to " -"``_PyInterpreterFrame*``." -msgstr "" - -#: ../../c-api/init.rst:1562 +#: ../../c-api/init.rst:1152 msgid "Get the frame evaluation function." msgstr "" -#: ../../c-api/init.rst:1564 ../../c-api/init.rst:1572 +#: ../../c-api/init.rst:1154 ../../c-api/init.rst:1162 msgid "See the :pep:`523` \"Adding a frame evaluation API to CPython\"." msgstr "" -#: ../../c-api/init.rst:1570 +#: ../../c-api/init.rst:1160 msgid "Set the frame evaluation function." msgstr "" -#: ../../c-api/init.rst:1579 +#: ../../c-api/init.rst:1169 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 " -"in the dictionary. It is okay to call this function when no :term:`thread " -"state` is :term:`attached `. If this function returns " -"``NULL``, no exception has been raised and the caller should assume no " -"thread state is attached." +"in the dictionary. It is okay to call this function when no current thread " +"state is available. If this function returns ``NULL``, no exception has been " +"raised and the caller should assume no current thread state is available." msgstr "" +"拡張モジュールがスレッド固有の状態情報を保存できるような辞書を返します。各々" +"の拡張モジュールが辞書に状態情報を保存するためには唯一のキーを使わなければな" +"りません。現在のスレッド状態がない時にこの関数を呼び出してもかまいません。こ" +"の関数が ``NULL`` を返す場合、例外はまったく送出されず、呼び出し側は現在のス" +"レッド状態が利用できないと考えなければなりません。" -#: ../../c-api/init.rst:1589 +#: ../../c-api/init.rst:1178 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. " "This function does not steal any references to *exc*. To prevent naive " "misuse, you must write your own C extension to call this. Must be called " -"with an :term:`attached thread state`. Returns the number of thread states " -"modified; this is normally one, but will be zero if the thread id isn't " -"found. If *exc* is ``NULL``, the pending exception (if any) for the thread " -"is cleared. This raises no exceptions." -msgstr "" - -#: ../../c-api/init.rst:1597 -msgid "" -"The type of the *id* parameter changed from :c:expr:`long` to :c:expr:" +"with the GIL held. Returns the number of thread states modified; this is " +"normally one, but will be zero if the thread id isn't found. If *exc* is :" +"const:`NULL`, the pending exception (if any) for the thread is cleared. This " +"raises no exceptions." +msgstr "" +"スレッド内で非同期的に例外を送出します。 *id* 引数はターゲットとなるスレッド" +"のスレッド id です; *exc* は送出する例外オブジェクトです。この関数は *exc* に" +"対する参照を一切盗み取りません。安直な間違いを防ぐため、この関数を呼び出すに" +"は独自に C 拡張モジュールを書かなければなりません。 GIL を保持した状態で呼び" +"出さなければなりません。状態が変更されたスレッドの数を返します; 通常は 1 です" +"が、スレッドが見付からなかった場合は 0 になることもあります。 *exc* が :" +"const:`NULL` の場合は、このスレッドのまだ送出されていない例外は (何であれ) 消" +"去されます。この場合は例外を送出しません。" + +#: ../../c-api/init.rst:1186 +msgid "" +"The type of the *id* parameter changed from :c:type:`long` to :c:type:" "`unsigned long`." msgstr "" -"*id* 引数の型が :c:expr:`long` から :c:expr:`unsigned long` へ変更されまし" +"*id* 引数の型が :c:type:`long` から :c:type:`unsigned long` へ変更されまし" "た。" -#: ../../c-api/init.rst:1603 +#: ../../c-api/init.rst:1192 msgid "" -":term:`Attach ` *tstate* to the current thread, which " -"must not be ``NULL`` or already :term:`attached `." +"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 "" +"GIL を獲得し、現在のスレッド状態を *tstate* に設定します。 *tstate* は " +"``NULL`` であってはなりません。ロックはあらかじめ作成されていなければなりませ" +"ん。この関数を呼び出したスレッドがすでにロックを獲得している場合、デッドロッ" +"クに陥ります。" -#: ../../c-api/init.rst:1606 -msgid "" -"The calling thread must not already have an :term:`attached thread state`." -msgstr "" - -#: ../../c-api/init.rst:1614 +#: ../../c-api/init.rst:1203 ../../c-api/init.rst:1241 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." msgstr "" -#: ../../c-api/init.rst:1623 +#: ../../c-api/init.rst:1208 msgid "" ":c:func:`PyEval_RestoreThread` is a higher-level function which is always " "available (even when threads have not been initialized)." @@ -2231,14 +1855,21 @@ msgstr "" ":c:func:`PyEval_RestoreThread` はいつでも (スレッドが初期化されたいないときで" "も) 利用可能な高レベル関数です。" -#: ../../c-api/init.rst:1629 +#: ../../c-api/init.rst:1214 msgid "" -"Detach the :term:`attached thread state`. The *tstate* argument, which must " -"not be ``NULL``, is only used to check that it represents the :term:" -"`attached thread state` --- if it isn't, a fatal error is reported." +"Reset the current thread state to ``NULL`` and release the global " +"interpreter lock. The lock must have been created earlier and must be held " +"by the current thread. The *tstate* argument, which must not be ``NULL``, " +"is only used to check that it represents the current thread state --- if it " +"isn't, a fatal error is reported." msgstr "" +"現在のスレッド状態をリセットして ``NULL`` にし、GIL を解放します。ロックはあ" +"らかじめ作成されていなければならず、かつ現在のスレッドが保持していなければな" +"りません。*tstate* は ``NULL`` であってはなりませんが、その値が現在のスレッド" +"状態を表現しているかどうかを調べるためにだけ使われます --- もしそうでなけれ" +"ば、致命的エラーが報告されます。" -#: ../../c-api/init.rst:1634 +#: ../../c-api/init.rst:1220 msgid "" ":c:func:`PyEval_SaveThread` is a higher-level function which is always " "available (even when threads have not been initialized)." @@ -2246,11 +1877,43 @@ msgstr "" ":c:func:`PyEval_SaveThread` はより高レベルな関数で常に (スレッドが初期化され" "ていないときでも) 利用できます。" -#: ../../c-api/init.rst:1641 +#: ../../c-api/init.rst:1226 +msgid "" +"Acquire the global interpreter lock. The lock must have been created " +"earlier. If this thread already has the lock, a deadlock ensues." +msgstr "" +"GILを獲得します。ロックは前もって作成されていなければなりません。この関数を呼" +"び出したスレッドがすでにロックを獲得している場合、デッドロックに陥ります。" + +#: ../../c-api/init.rst:1229 +msgid "" +"This function does not update the current thread state. Please use :c:func:" +"`PyEval_RestoreThread` or :c:func:`PyEval_AcquireThread` instead." +msgstr "" +"この関数は現在のスレッドの状態を更新しません。代わりに :c:func:" +"`PyEval_RestoreThread` もしくは :c:func:`PyEval_AcquireThread` を使用してくだ" +"さい。" + +#: ../../c-api/init.rst:1249 +msgid "" +"Release the global interpreter lock. The lock must have been created " +"earlier." +msgstr "GILを解放します。ロックは前もって作成されていなければなりません。" + +#: ../../c-api/init.rst:1251 +msgid "" +"This function does not update the current thread state. Please use :c:func:" +"`PyEval_SaveThread` or :c:func:`PyEval_ReleaseThread` instead." +msgstr "" +"この関数は現在のスレッドの状態を更新しません。代わりに :c:func:" +"`PyEval_SaveThread` もしくは :c:func:`PyEval_ReleaseThread` を使用してくださ" +"い。" + +#: ../../c-api/init.rst:1260 msgid "Sub-interpreter support" msgstr "サブインタプリタサポート" -#: ../../c-api/init.rst:1643 +#: ../../c-api/init.rst:1262 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 " @@ -2262,7 +1925,7 @@ msgstr "" "る必要があります。\n" "これを可能にするのがサブインタプリタです。" -#: ../../c-api/init.rst:1648 +#: ../../c-api/init.rst:1267 msgid "" "The \"main\" interpreter is the first one created when the runtime " "initializes. It is usually the only Python interpreter in a process. Unlike " @@ -2281,7 +1944,7 @@ msgstr "" ":c:func:`PyInterpreterState_Main` 関数は、メインインタプリタの状態へのポイン" "タを返します。" -#: ../../c-api/init.rst:1655 +#: ../../c-api/init.rst:1274 msgid "" "You can switch between sub-interpreters using the :c:func:" "`PyThreadState_Swap` function. You can create and destroy them using the " @@ -2290,108 +1953,7 @@ msgstr "" "サブインタプリタを切り替えが :c:func:`PyThreadState_Swap` 関数でできます。\n" "次の関数を使ってサブインタプリタの作成と削除が行えます:" -#: ../../c-api/init.rst:1661 -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:1667 -msgid "Structure fields:" -msgstr "構造体フィールド:" - -#: ../../c-api/init.rst:1671 -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:1675 -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`." -msgstr "" - -#: ../../c-api/init.rst:1683 -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:1687 -msgid "" -"Note that the :mod:`subprocess` module still works when fork is disallowed." -msgstr "" - -#: ../../c-api/init.rst:1692 -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:1697 -msgid "" -"Note that the :mod:`subprocess` module still works when exec is disallowed." -msgstr "" - -#: ../../c-api/init.rst:1702 -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:1708 -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)." -msgstr "" - -#: ../../c-api/init.rst:1715 -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`.)" -msgstr "" - -#: ../../c-api/init.rst:1722 -msgid "" -"This must be ``1`` (non-zero) if :c:member:`~PyInterpreterConfig." -"use_main_obmalloc` is ``0``." -msgstr "" - -#: ../../c-api/init.rst:1727 -msgid "" -"This determines the operation of the GIL for the sub-interpreter. It may be " -"one of the following:" -msgstr "" - -#: ../../c-api/init.rst:1734 -msgid "Use the default selection (:c:macro:`PyInterpreterConfig_SHARED_GIL`)." -msgstr "" - -#: ../../c-api/init.rst:1738 -msgid "Use (share) the main interpreter's GIL." -msgstr "" - -#: ../../c-api/init.rst:1742 -msgid "Use the sub-interpreter's own GIL." -msgstr "" - -#: ../../c-api/init.rst:1744 -msgid "" -"If this is :c:macro:`PyInterpreterConfig_OWN_GIL` then :c:member:" -"`PyInterpreterConfig.use_main_obmalloc` must be ``0``." -msgstr "" - -#: ../../c-api/init.rst:1758 +#: ../../c-api/init.rst:1288 msgid "" "Create a new sub-interpreter. This is an (almost) totally separate " "environment for the execution of Python code. In particular, the new " @@ -2414,73 +1976,36 @@ msgstr "" "stdout``, ``sys.stderr`` を持ちます (とはいえ、これらのストリームは根底にある" "同じファイル記述子を参照しています)。" -#: ../../c-api/init.rst:1768 -msgid "" -"The given *config* controls the options with which the interpreter is " -"initialized." -msgstr "" - -#: ../../c-api/init.rst:1771 -msgid "" -"Upon success, *tstate_p* will be set to the first :term:`thread state` " -"created in the new sub-interpreter. This thread state is :term:`attached " -"`. Note that no actual thread is created; see the " -"discussion of thread states below. If creation of the new interpreter is " -"unsuccessful, *tstate_p* is set to ``NULL``; no exception is set since the " -"exception state is stored in the :term:`attached thread state`, which might " -"not exist." -msgstr "" - -#: ../../c-api/init.rst:1780 -msgid "" -"Like all other Python/C API functions, an :term:`attached thread state` must " -"be present before calling this function, but it might be detached upon " -"returning. On success, the returned thread state will be :term:`attached " -"`. If the sub-interpreter is created with its own :" -"term:`GIL` then the :term:`attached thread state` of the calling interpreter " -"will be detached. When the function returns, the new interpreter's :term:" -"`thread state` will be :term:`attached ` to the " -"current thread and the previous interpreter's :term:`attached thread state` " -"will remain detached." -msgstr "" - -#: ../../c-api/init.rst:1791 -msgid "" -"Sub-interpreters are most effective when isolated from each other, with " -"certain functionality restricted::" -msgstr "" - -#: ../../c-api/init.rst:1794 -msgid "" -"PyInterpreterConfig config = {\n" -" .use_main_obmalloc = 0,\n" -" .allow_fork = 0,\n" -" .allow_exec = 0,\n" -" .allow_threads = 1,\n" -" .allow_daemon_threads = 0,\n" -" .check_multi_interp_extensions = 1,\n" -" .gil = PyInterpreterConfig_OWN_GIL,\n" -"};\n" -"PyThreadState *tstate = NULL;\n" -"PyStatus status = Py_NewInterpreterFromConfig(&tstate, &config);\n" -"if (PyStatus_Exception(status)) {\n" -" Py_ExitStatusException(status);\n" -"}" -msgstr "" - -#: ../../c-api/init.rst:1809 +#: ../../c-api/init.rst:1298 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`." -msgstr "" - -#: ../../c-api/init.rst:1818 +"The return value points to the first thread state created in the new sub-" +"interpreter. This thread state is made in the current thread state. Note " +"that no actual thread is created; see the discussion of thread states " +"below. If creation of the new interpreter is unsuccessful, ``NULL`` is " +"returned; no exception is set since the exception state is stored in the " +"current thread state and there may not be a current thread state. (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; however, " +"unlike most other Python/C API functions, there needn't be a current thread " +"state on entry.)" +msgstr "" +"戻り値は、新たなサブインタプリタが生成したスレッド状態 (thread state) オブ" +"ジェクトのうち、最初のものを指しています。このスレッド状態が現在のスレッド状" +"態 (current thread state) になります。実際のスレッドが生成されるわけではない" +"ので注意してください; 下記のスレッド状態に関する議論を参照してください。新た" +"なインタプリタの生成に失敗すると、``NULL`` を返します; 例外状態はセットされま" +"せんが、これは例外状態が現在のスレッド状態に保存されることになっていて、現在" +"のスレッド状態なるものが存在しないことがあるからです。(他の Python/C API 関数" +"のように、この関数を呼び出す前にはGILが保持されていなければならず、関数が処理" +"を戻した際にも保持されたままになります; しかし、他の Python/C API 関数とは違" +"い、関数から戻ったときの現在のスレッド状態が関数に入るときと同じとは限らない" +"ので注意してください。)" + +#: ../../c-api/init.rst:1313 msgid "Extension modules are shared between (sub-)interpreters as follows:" msgstr "" -#: ../../c-api/init.rst:1820 +#: ../../c-api/init.rst:1315 msgid "" "For modules using multi-phase initialization, e.g. :c:func:" "`PyModule_FromDefAndSpec`, a separate module object is created and " @@ -2488,7 +2013,7 @@ msgid "" "are shared between these module objects." msgstr "" -#: ../../c-api/init.rst:1826 +#: ../../c-api/init.rst:1321 msgid "" "For modules using single-phase initialization, e.g. :c:func:" "`PyModule_Create`, the first time a particular extension is imported, it is " @@ -2500,7 +2025,7 @@ msgid "" "might cause unwanted behavior (see `Bugs and caveats`_ below)." msgstr "" -#: ../../c-api/init.rst:1837 +#: ../../c-api/init.rst:1332 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:" @@ -2510,82 +2035,30 @@ msgid "" "shared between these modules." msgstr "" -#: ../../c-api/init.rst:1857 -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." -msgstr "" - -#: ../../c-api/init.rst:1869 -msgid "" -"Destroy the (sub-)interpreter represented by the given :term:`thread state`. " -"The given thread state must be :term:`attached `. " -"When the call returns, there will be no :term:`attached thread state`. All " -"thread states associated with this interpreter are destroyed." -msgstr "" - -#: ../../c-api/init.rst:1874 +#: ../../c-api/init.rst:1346 msgid "" -":c:func:`Py_FinalizeEx` will destroy all sub-interpreters that haven't been " -"explicitly destroyed at that point." +"Destroy the (sub-)interpreter represented by the given thread state. The " +"given thread state must be the current thread state. See the discussion of " +"thread states below. When the call returns, the current thread state is " +"``NULL``. All thread states associated with this interpreter are " +"destroyed. (The global interpreter lock must be held before calling this " +"function and is still held when it returns.) :c:func:`Py_FinalizeEx` will " +"destroy all sub-interpreters that haven't been explicitly destroyed at that " +"point." msgstr "" +"指定されたスレッド状態 *tstate* で表現される (サブ) インタプリタを抹消しま" +"す。 *tstate* は現在のスレッド状態でなければなりません。下記のスレッド状態に" +"関する議論を参照してください。関数呼び出しが戻ったとき、現在のスレッド状態は " +"``NULL`` になっています。このインタプリタに関連付けられた全てのスレッド状態は" +"抹消されます。 (この関数を呼び出す前にはGILを保持しておかなければならず、ロッ" +"クは関数が戻ったときも保持されています。) :c:func:`Py_FinalizeEx` は、その時" +"点で明示的に抹消されていない全てのサブインタプリタを抹消します。" -#: ../../c-api/init.rst:1879 -msgid "A Per-Interpreter GIL" -msgstr "" - -#: ../../c-api/init.rst:1881 -msgid "" -"Using :c:func:`Py_NewInterpreterFromConfig` you can create a sub-interpreter " -"that is completely isolated from other interpreters, including having its " -"own GIL. The most important benefit of this isolation is that such an " -"interpreter can execute Python code without being blocked by other " -"interpreters or blocking any others. Thus a single Python process can truly " -"take advantage of multiple CPU cores when running Python code. The " -"isolation also encourages a different approach to concurrency than that of " -"just using threads. (See :pep:`554`.)" -msgstr "" - -#: ../../c-api/init.rst:1891 -msgid "" -"Using an isolated interpreter requires vigilance in preserving that " -"isolation. That especially means not sharing any objects or mutable state " -"without guarantees about thread-safety. Even objects that are otherwise " -"immutable (e.g. ``None``, ``(1, 5)``) can't normally be shared because of " -"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 :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:1902 -msgid "" -"If you preserve isolation then you will have access to proper multi-core " -"computing without the complications that come with free-threading. Failure " -"to preserve isolation will expose you to the full consequences of free-" -"threading, including races and hard-to-debug crashes." -msgstr "" - -#: ../../c-api/init.rst:1907 -msgid "" -"Aside from that, one of the main challenges of using multiple isolated " -"interpreters is how to communicate between them safely (not break isolation) " -"and efficiently. The runtime and stdlib do not provide any standard " -"approach to this yet. A future stdlib module would help mitigate the effort " -"of preserving isolation and expose effective tools for communicating (and " -"sharing) data between interpreters." -msgstr "" - -#: ../../c-api/init.rst:1918 +#: ../../c-api/init.rst:1356 msgid "Bugs and caveats" msgstr "バグと注意事項" -#: ../../c-api/init.rst:1920 +#: ../../c-api/init.rst:1358 msgid "" "Because sub-interpreters (and the main interpreter) are part of the same " "process, the insulation between them isn't perfect --- for example, using " @@ -2598,7 +2071,7 @@ msgid "" "should be avoided if possible." msgstr "" -#: ../../c-api/init.rst:1930 +#: ../../c-api/init.rst:1368 msgid "" "Special care should be taken to avoid sharing user-defined functions, " "methods, instances or classes between sub-interpreters, since import " @@ -2607,31 +2080,31 @@ msgid "" "objects from which the above are reachable." msgstr "" -#: ../../c-api/init.rst:1936 +#: ../../c-api/init.rst:1374 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-" +"Also note that combining this functionality with :c:func:`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." msgstr "" -"サブインタプリタを ``PyGILState_*`` API と組み合わせるのが難しいことにも注意" -"してください。これらのAPIはPythonのスレッド状態とOSレベルスレッドが1対1で対応" -"していることを前提にしていて、サブインタプリタが存在するとその前提が崩れるか" -"らです。対応する :c:func:`PyGILState_Ensure` と :c:func:`PyGILState_Release` " -"の呼び出しのペアの間では、サブインタプリタの切り替えを行わないことを強く推奨" -"します。さらに、(:mod:`ctypes` のような)これらのAPIを使ってPythonの外で作られ" -"たスレッドから Pythonコードを実行している拡張モジュールはサブインタプリタを使" -"うと壊れる可能性があります。" +"サブインタプリタを :c:func:`PyGILState_\\*` API と組み合わせるのが難しいこと" +"にも注意してください。これらのAPIはPythonのスレッド状態とOSレベルスレッドが1" +"対1で対応していることを前提にしていて、サブインタプリタが存在するとその前提が" +"崩れるからです。対応する :c:func:`PyGILState_Ensure` と :c:func:" +"`PyGILState_Release` の呼び出しのペアの間では、サブインタプリタの切り替えを行" +"わないことを強く推奨します。さらに、(:mod:`ctypes` のような)これらのAPIを使っ" +"てPythonの外で作られたスレッドから Pythonコードを実行している拡張モジュールは" +"サブインタプリタを使うと壊れる可能性があります。" -#: ../../c-api/init.rst:1947 +#: ../../c-api/init.rst:1385 msgid "Asynchronous Notifications" msgstr "非同期通知" -#: ../../c-api/init.rst:1949 +#: ../../c-api/init.rst:1387 msgid "" "A mechanism is provided to make asynchronous notifications to the main " "interpreter thread. These notifications take the form of a function pointer " @@ -2640,7 +2113,7 @@ msgstr "" "インタプリタのメインスレッドに非同期な通知を行うために提供されている仕組みで" "す。これらの通知は関数ポインタと void ポインタ引数という形態を取ります。" -#: ../../c-api/init.rst:1956 +#: ../../c-api/init.rst:1396 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 " @@ -2650,7 +2123,7 @@ msgstr "" "``0`` が返り、*func* はメインスレッドの呼び出しキューに詰められます。失敗する" "と、例外をセットせずに ``-1`` が返ります。" -#: ../../c-api/init.rst:1960 +#: ../../c-api/init.rst:1400 msgid "" "When successfully queued, *func* will be *eventually* called from the main " "interpreter thread with the argument *arg*. It will be called " @@ -2662,33 +2135,46 @@ msgstr "" "Python コードに対して非同期に呼び出されますが、次の両方の条件に合致したときに" "呼び出されます:" -#: ../../c-api/init.rst:1965 +#: ../../c-api/init.rst:1405 msgid "on a :term:`bytecode` boundary;" msgstr ":term:`bytecode` 境界上にいるとき、" -#: ../../c-api/init.rst:1966 +#: ../../c-api/init.rst:1406 msgid "" -"with the main thread holding an :term:`attached thread state` (*func* can " +"with the main thread holding the :term:`global interpreter lock` (*func* can " "therefore use the full C API)." msgstr "" +"メインスレッドが :term:`global interpreter lock` を保持している (すなわち " +"*func* が全ての C API を呼び出せる) とき。" -#: ../../c-api/init.rst:1969 +#: ../../c-api/init.rst:1409 msgid "" "*func* must return ``0`` on success, or ``-1`` on failure with an exception " "set. *func* won't be interrupted to perform another asynchronous " "notification recursively, but it can still be interrupted to switch threads " -"if the :term:`thread state ` is detached." +"if the global interpreter lock is released." msgstr "" +"成功したら *func* は ``0`` を返さねばならず、失敗したら ``-1`` を返し例外を" +"セットしなければいけません。*func* は、他の非同期通知を行うために、さらに割り" +"込まれることはありませんが、グローバルインタプリタロックが解放された場合は、" +"スレッドの切り替えによって割り込まれる可能性が残っています。" -#: ../../c-api/init.rst:1974 +#: ../../c-api/init.rst:1414 msgid "" -"This function doesn't need an :term:`attached thread state`. However, to " -"call this function in a subinterpreter, the caller must have an :term:" -"`attached thread state`. Otherwise, the function *func* can be scheduled to " -"be called from the wrong interpreter." +"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:1979 +#: ../../c-api/init.rst:1417 +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:1422 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 " @@ -2704,7 +2190,7 @@ msgstr "" "には **向きません** 。これの代わりに、 :ref:`PyGILState API` を使用" "してください。" -#: ../../c-api/init.rst:1988 +#: ../../c-api/init.rst:1429 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 " @@ -2712,11 +2198,11 @@ msgid "" "scheduled calls." msgstr "" -#: ../../c-api/init.rst:1997 +#: ../../c-api/init.rst:1440 msgid "Profiling and Tracing" msgstr "プロファイルとトレース (profiling and tracing)" -#: ../../c-api/init.rst:2002 +#: ../../c-api/init.rst:1445 msgid "" "The Python interpreter provides some low-level support for attaching " "profiling and execution tracing facilities. These are used for profiling, " @@ -2727,7 +2213,7 @@ msgstr "" "ポートは、プロファイルやデバッグ、適用範囲分析 (coverage analysis) ツールなど" "に使われます。" -#: ../../c-api/init.rst:2006 +#: ../../c-api/init.rst:1449 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 " @@ -2743,80 +2229,86 @@ msgstr "" "ルでき、トレース関数に報告される基本イベント (basic event) は以前のバージョン" "において Python レベルのトレース関数で報告されていたものと同じです。" -#: ../../c-api/init.rst:2016 +#: ../../c-api/init.rst:1459 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*:" -msgstr "" - -#: ../../c-api/init.rst:2025 +"event pertains, *what* is one of the constants :const:`PyTrace_CALL`, :const:" +"`PyTrace_EXCEPTION`, :const:`PyTrace_LINE`, :const:`PyTrace_RETURN`, :const:" +"`PyTrace_C_CALL`, :const:`PyTrace_C_EXCEPTION`, :const:`PyTrace_C_RETURN`, " +"or :const:`PyTrace_OPCODE`, and *arg* depends on the value of *what*:" +msgstr "" +":c:func:`PyEval_SetProfile` および :c:func:`PyEval_SetTrace` を使って登録でき" +"るトレース関数の形式です。最初のパラメタはオブジェクトで、登録関数に *obj* と" +"して渡されます。 *frame* はイベントが属している実行フレームオブジェクトで、 " +"*what* は定数 :const:`PyTrace_CALL`, :const:`PyTrace_EXCEPTION`, :const:" +"`PyTrace_LINE`, :const:`PyTrace_RETURN`, :const:`PyTrace_C_CALL`, :const:" +"`PyTrace_C_RETURN`, :const:`PyTrace_OPCODE` のいずれかで、 *arg* は *what* の" +"値によって以下のように異なります:" + +#: ../../c-api/init.rst:1468 msgid "Value of *what*" msgstr "*what* の値" -#: ../../c-api/init.rst:2025 +#: ../../c-api/init.rst:1468 msgid "Meaning of *arg*" msgstr "*arg* の意味" -#: ../../c-api/init.rst:2027 -msgid ":c:data:`PyTrace_CALL`" -msgstr "" +#: ../../c-api/init.rst:1470 +msgid ":const:`PyTrace_CALL`" +msgstr ":const:`PyTrace_CALL`" -#: ../../c-api/init.rst:2027 ../../c-api/init.rst:2032 -#: ../../c-api/init.rst:2043 +#: ../../c-api/init.rst:1470 ../../c-api/init.rst:1475 +#: ../../c-api/init.rst:1486 msgid "Always :c:data:`Py_None`." msgstr "常に :c:data:`Py_None` 。" -#: ../../c-api/init.rst:2029 -msgid ":c:data:`PyTrace_EXCEPTION`" -msgstr "" +#: ../../c-api/init.rst:1472 +msgid ":const:`PyTrace_EXCEPTION`" +msgstr ":const:`PyTrace_EXCEPTION`" -#: ../../c-api/init.rst:2029 +#: ../../c-api/init.rst:1472 msgid "Exception information as returned by :func:`sys.exc_info`." msgstr ":func:`sys.exc_info` の返す例外情報です。" -#: ../../c-api/init.rst:2032 -msgid ":c:data:`PyTrace_LINE`" -msgstr "" +#: ../../c-api/init.rst:1475 +msgid ":const:`PyTrace_LINE`" +msgstr ":const:`PyTrace_LINE`" -#: ../../c-api/init.rst:2034 -msgid ":c:data:`PyTrace_RETURN`" -msgstr "" +#: ../../c-api/init.rst:1477 +msgid ":const:`PyTrace_RETURN`" +msgstr ":const:`PyTrace_RETURN`" -#: ../../c-api/init.rst:2034 +#: ../../c-api/init.rst:1477 msgid "" "Value being returned to the caller, or ``NULL`` if caused by an exception." msgstr "" "呼び出し側に返される予定の値か、例外によって関数を抜ける場合は ``NULL`` で" "す。" -#: ../../c-api/init.rst:2037 -msgid ":c:data:`PyTrace_C_CALL`" -msgstr "" +#: ../../c-api/init.rst:1480 +msgid ":const:`PyTrace_C_CALL`" +msgstr ":const:`PyTrace_C_CALL`" -#: ../../c-api/init.rst:2037 ../../c-api/init.rst:2039 -#: ../../c-api/init.rst:2041 +#: ../../c-api/init.rst:1480 ../../c-api/init.rst:1482 +#: ../../c-api/init.rst:1484 msgid "Function object being called." msgstr "呼び出される関数オブジェクト。" -#: ../../c-api/init.rst:2039 -msgid ":c:data:`PyTrace_C_EXCEPTION`" -msgstr "" +#: ../../c-api/init.rst:1482 +msgid ":const:`PyTrace_C_EXCEPTION`" +msgstr ":const:`PyTrace_C_EXCEPTION`" -#: ../../c-api/init.rst:2041 -msgid ":c:data:`PyTrace_C_RETURN`" -msgstr "" +#: ../../c-api/init.rst:1484 +msgid ":const:`PyTrace_C_RETURN`" +msgstr ":const:`PyTrace_C_RETURN`" -#: ../../c-api/init.rst:2043 -msgid ":c:data:`PyTrace_OPCODE`" -msgstr "" +#: ../../c-api/init.rst:1486 +msgid ":const:`PyTrace_OPCODE`" +msgstr ":const:`PyTrace_OPCODE`" -#: ../../c-api/init.rst:2048 +#: ../../c-api/init.rst:1491 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 " @@ -2830,7 +2322,7 @@ msgstr "" "制御の委譲 (control transfer) が起こらないため報告されないので注意してくださ" "い。" -#: ../../c-api/init.rst:2057 +#: ../../c-api/init.rst:1500 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 " @@ -2848,15 +2340,19 @@ msgstr "" "から処理が戻るごとにコールバック関数が呼び出されます。トレース関数だけがこれ" "らのイベントを受け取ります; プロファイラはこの種のイベントを必要としません。" -#: ../../c-api/init.rst:2068 +#: ../../c-api/init.rst:1511 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:`f_trace_lines` to " +"*0* on that frame." msgstr "" +"行番号イベントを報告するときに、 (プロファイル関数ではなく) :c:type:" +"`Py_tracefunc` 関数に *what* 引数として渡す値です。\n" +":attr:`f_trace_lines` が *0* に設定されたフレームでは無効化されていることもあ" +"ります。" -#: ../../c-api/init.rst:2076 +#: ../../c-api/init.rst:1518 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " "a call is about to return." @@ -2864,7 +2360,7 @@ msgstr "" "呼び出しが返るときに :c:type:`Py_tracefunc` 関数に *what* 引数として渡す値で" "す。" -#: ../../c-api/init.rst:2082 +#: ../../c-api/init.rst:1524 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " "a C function is about to be called." @@ -2872,7 +2368,7 @@ msgstr "" "C関数を呼び出す直前に :c:type:`Py_tracefunc` 関数の *what* 引数として渡す値で" "す。" -#: ../../c-api/init.rst:2088 +#: ../../c-api/init.rst:1530 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " "a C function has raised an exception." @@ -2880,7 +2376,7 @@ msgstr "" "C関数が例外を送出したときに :c:type:`Py_tracefunc` 関数の *what* 引数として渡" "す値です。" -#: ../../c-api/init.rst:2094 +#: ../../c-api/init.rst:1536 msgid "" "The value for the *what* parameter to :c:type:`Py_tracefunc` functions when " "a C function has returned." @@ -2888,146 +2384,80 @@ msgstr "" "C関数から戻るときに :c:type:`Py_tracefunc` 関数の *what* 引数として渡す値で" "す。" -#: ../../c-api/init.rst:2100 +#: ../../c-api/init.rst:1542 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." +"attr:`f_trace_opcodes` to *1* on the frame." msgstr "" +"新しい opcode が実行されるときに、 (プロファイル関数ではなく) :c:type:" +"`Py_tracefunc` 関数に *what* 引数として渡す値です。\n" +"デフォルトではイベントは発火しません。フレーム上で :attr:`f_trace_lines` を " +"*1* に設定して、明示的に要請しなければなりません。" -#: ../../c-api/init.rst:2108 +#: ../../c-api/init.rst:1550 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`." -msgstr "" - -#: ../../c-api/init.rst:2115 -msgid "See also the :func:`sys.setprofile` function." -msgstr ":func:`sys.setprofile` 関数も参照してください。" - -#: ../../c-api/init.rst:2121 -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 "" +"it. The profile function is called for all monitored events except :const:" +"`PyTrace_LINE` :const:`PyTrace_OPCODE` and :const:`PyTrace_EXCEPTION`." +msgstr "" +"プロファイル関数を *func* に設定します。\n" +"*obj* パラメタは関数の第一引数として渡されるもので、何らかの Python オブジェ" +"クトあるいは ``NULL`` です。\n" +"プロファイル関数がスレッド状態を維持する必要があるなら、各々のスレッドに異な" +"る *obj* を使うことで、状態を記憶しておく便利でスレッドセーフな場所を提供でき" +"ます。\n" +"プロファイル関数は、モニタされているイベントのうち、 :const:`PyTrace_LINE` :" +"const:`PyTrace_OPCODE`, :const:`PyTrace_EXCEPTION` を除く全てのイベントに対し" +"て呼び出されます。" + +#: ../../c-api/init.rst:1557 ../../c-api/init.rst:1569 +msgid "The caller must hold the :term:`GIL`." +msgstr "呼び出し側は :term:`GIL` を獲得しなければなりません。" -#: ../../c-api/init.rst:2126 -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:2134 +#: ../../c-api/init.rst:1562 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." -msgstr "" - -#: ../../c-api/init.rst:2141 -msgid "See also the :func:`sys.settrace` function." -msgstr ":func:`sys.settrace` 関数も参照してください。" - -#: ../../c-api/init.rst:2147 -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:2152 -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:2158 -msgid "Reference tracing" -msgstr "" - -#: ../../c-api/init.rst:2164 -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:2174 -msgid "" -"The value for the *event* parameter to :c:type:`PyRefTracer` functions when " -"a Python object has been created." -msgstr "" - -#: ../../c-api/init.rst:2179 -msgid "" -"The value for the *event* parameter to :c:type:`PyRefTracer` functions when " -"a Python object has been destroyed." -msgstr "" - -#: ../../c-api/init.rst:2184 -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:2190 -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. A :term:`thread state` will be " -"active every time the tracer function is called." -msgstr "" - -#: ../../c-api/init.rst:2195 ../../c-api/init.rst:2206 -msgid "" -"There must be an :term:`attached thread state` when calling this function." -msgstr "" - -#: ../../c-api/init.rst:2201 -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:2213 +"`PyEval_SetTrace` will not receive :const:`PyTrace_C_CALL`, :const:" +"`PyTrace_C_EXCEPTION` or :const:`PyTrace_C_RETURN` as a value for the *what* " +"parameter." +msgstr "" +"トレース関数を *func* に設定します。\n" +"この関数は :c:func:`PyEval_SetProfile` と同じですが、トレース関数は行番号イベ" +"ントおよび opcode イベントを受け取り、呼び出された C 関数オブジェクトと関係す" +"る任意のイベントを受け取らないところが異なっています。\n" +":c:func:`PyEval_SetTrace` で登録されたトレース関数は、*what* 引数の値として :" +"const:`PyTrace_C_CALL`, :const:`PyTrace_C_EXCEPTION`, :const:" +"`PyTrace_C_RETURN` を受け取りません。" + +#: ../../c-api/init.rst:1575 msgid "Advanced Debugger Support" msgstr "高度なデバッガサポート (advanced debugger support)" -#: ../../c-api/init.rst:2218 +#: ../../c-api/init.rst:1580 msgid "" "These functions are only intended to be used by advanced debugging tools." msgstr "以下の関数は高度なデバッグツールでの使用のためだけのものです。" -#: ../../c-api/init.rst:2223 +#: ../../c-api/init.rst:1585 msgid "" "Return the interpreter state object at the head of the list of all such " "objects." msgstr "" "インタプリタ状態オブジェクトからなるリストのうち、先頭にあるものを返します。" -#: ../../c-api/init.rst:2228 +#: ../../c-api/init.rst:1590 msgid "Return the main interpreter state object." msgstr "メインインタプリタの状態オブジェクトを返します。" -#: ../../c-api/init.rst:2233 +#: ../../c-api/init.rst:1595 msgid "" "Return the next interpreter state object after *interp* from the list of all " "such objects." @@ -3035,7 +2465,7 @@ msgstr "" "インタプリタ状態オブジェクトからなるリストのうち、*interp* の次にあるものを返" "します。" -#: ../../c-api/init.rst:2239 +#: ../../c-api/init.rst:1601 msgid "" "Return the pointer to the first :c:type:`PyThreadState` object in the list " "of threads associated with the interpreter *interp*." @@ -3043,7 +2473,7 @@ msgstr "" "インタプリタ *interp* に関連付けられているスレッドからなるリストのうち、先頭" "にある :c:type:`PyThreadState` オブジェクトを返します。" -#: ../../c-api/init.rst:2245 +#: ../../c-api/init.rst:1607 msgid "" "Return the next thread state object after *tstate* from the list of all such " "objects belonging to the same :c:type:`PyInterpreterState` object." @@ -3051,33 +2481,29 @@ msgstr "" "*tstate* と同じ :c:type:`PyInterpreterState` オブジェクトに属しているスレッド" "状態オブジェクトのうち、 *tstate* の次にあるものを返します。" -#: ../../c-api/init.rst:2252 +#: ../../c-api/init.rst:1614 msgid "Thread Local Storage Support" msgstr "スレッドローカルストレージのサポート" -#: ../../c-api/init.rst:2256 +#: ../../c-api/init.rst:1618 msgid "" "The Python interpreter provides low-level support for thread-local storage " "(TLS) which wraps the underlying native TLS implementation to support the " "Python-level thread local storage API (:class:`threading.local`). The " "CPython C level APIs are similar to those offered by pthreads and Windows: " -"use a thread key and functions to associate a :c:expr:`void*` value per " +"use a thread key and functions to associate a :c:type:`void*` value per " "thread." msgstr "" -"Python インタプリタは、スレッドローカルストレージ (thread-local storage, " -"TLS) の低レベルサポートを提供していて、ネイティブの TLS 実装を内部にラップし" -"て Python レベルのスレッドローカルストレージ API (:class:`threading.local`) " -"をサポートしています。\n" -"CPython の C レベル API は pthreads や Windows で与えられる TLS と同様です: " -"スレッドキーとスレッドごとに :c:expr:`void*` 値を関係付ける関数を使います。" -#: ../../c-api/init.rst:2263 +#: ../../c-api/init.rst:1625 msgid "" -"A :term:`thread state` does *not* need to be :term:`attached ` when calling these functions; they suppl their own locking." +"The GIL does *not* need to be held when calling these functions; they supply " +"their own locking." msgstr "" +"API で使われる関数を呼ぶときは、 GIL を取得する必要は *ありません* 。関数自身" +"のロックがサポートされています。" -#: ../../c-api/init.rst:2266 +#: ../../c-api/init.rst:1628 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." @@ -3086,40 +2512,35 @@ msgstr "" "を使うには :file:`pythread.h` を include する必要があることに注意してくださ" "い。" -#: ../../c-api/init.rst:2270 +#: ../../c-api/init.rst:1632 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 " +"type:`void*` values. You need to allocate and deallocate them yourself. If " +"the :c:type:`void*` values happen to be :c:type:`PyObject*`, these functions " "don't do refcount operations on them either." msgstr "" -"この API 関数はどれも :c:expr:`void*` 値の代わりにメモリ管理を行うことはしま" -"せん。\n" -"メモリの確保と解放は自前で行う必要があります。\n" -":c:expr:`void*` 値がたまたま :c:expr:`PyObject*` だった場合は、 API 関数はそ" -"れぞれの値の参照カウントの操作は行いません。" -#: ../../c-api/init.rst:2278 +#: ../../c-api/init.rst:1640 msgid "Thread Specific Storage (TSS) API" msgstr "スレッド固有ストレージ (Thread Specific Storage, TSS) API" -#: ../../c-api/init.rst:2280 +#: ../../c-api/init.rst:1642 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." +"instead of :c:type:`int` to represent thread keys." msgstr "" "TSS API は、 CPython インタプリタに含まれている既存の TLS API を置き換えるた" "めに導入されました。\n" -"この API は、スレッドキーの表現に :c:expr:`int` の代わりに新しい型 :c:type:" +"この API は、スレッドキーの表現に :c:type:`int` の代わりに新しい型 :c:type:" "`Py_tss_t` を使います。" -#: ../../c-api/init.rst:2286 +#: ../../c-api/init.rst:1648 msgid "\"A New C-API for Thread-Local Storage in CPython\" (:pep:`539`)" msgstr "" "\"CPython のスレッドローカルストレージのための新しい C API\" (:pep:`539`)" -#: ../../c-api/init.rst:2291 +#: ../../c-api/init.rst:1653 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 " @@ -3130,7 +2551,7 @@ msgstr "" "底の TLS 実装に依存し、キーの初期化状態を表現する内部フィールドを持ちます。\n" "この構造体には公開 (public) のメンバはありません。" -#: ../../c-api/init.rst:2296 +#: ../../c-api/init.rst:1658 msgid "" "When :ref:`Py_LIMITED_API ` is not defined, static allocation of " "this type by :c:macro:`Py_tss_NEEDS_INIT` is allowed." @@ -3138,7 +2559,7 @@ msgstr "" ":ref:`Py_LIMITED_API ` が定義されていないときは、この型の :c:macro:" "`Py_tss_NEEDS_INIT` による静的メモリ確保ができます。" -#: ../../c-api/init.rst:2302 +#: ../../c-api/init.rst:1664 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 `." @@ -3146,11 +2567,11 @@ msgstr "" "このマクロは :c:type:`Py_tss_t` 変数の初期化子に展開されます。\n" "このマクロは :ref:`Py_LIMITED_API ` があるときは定義されません。" -#: ../../c-api/init.rst:2307 +#: ../../c-api/init.rst:1669 msgid "Dynamic Allocation" msgstr "動的メモリ確保" -#: ../../c-api/init.rst:2309 +#: ../../c-api/init.rst:1671 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 " @@ -3160,29 +2581,29 @@ msgstr "" "ルドされた拡張モジュールで必要になりますが、その実装がビルド時に不透明なため" "に、この型の静的なメモリ確保は不可能です。" -#: ../../c-api/init.rst:2316 +#: ../../c-api/init.rst:1678 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." msgstr "" -#: ../../c-api/init.rst:2323 +#: ../../c-api/init.rst:1685 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``." +"have been unassigned. This is a no-op if the *key* argument is `NULL`." msgstr "" -#: ../../c-api/init.rst:2329 +#: ../../c-api/init.rst:1691 msgid "" -"A freed key becomes a dangling pointer. You should reset the key to ``NULL``." +"A freed key becomes a dangling pointer, you should reset the key to `NULL`." msgstr "" -#: ../../c-api/init.rst:2334 +#: ../../c-api/init.rst:1696 msgid "Methods" msgstr "メソッド" -#: ../../c-api/init.rst:2336 +#: ../../c-api/init.rst:1698 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 " @@ -3190,13 +2611,13 @@ msgid "" "func:`PyThread_tss_create`." msgstr "" -#: ../../c-api/init.rst:2344 +#: ../../c-api/init.rst:1706 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:2350 +#: ../../c-api/init.rst:1712 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 " @@ -3205,7 +2626,7 @@ msgid "" "no-op and immediately returns success." msgstr "" -#: ../../c-api/init.rst:2359 +#: ../../c-api/init.rst:1721 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 " @@ -3214,31 +2635,31 @@ msgid "" "key -- calling it on an already destroyed key is a no-op." msgstr "" -#: ../../c-api/init.rst:2368 +#: ../../c-api/init.rst:1730 msgid "" -"Return a zero value to indicate successfully associating a :c:expr:`void*` " +"Return a zero value to indicate successfully associating a :c:type:`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." +"mapping of the key to a :c:type:`void*` value." msgstr "" -#: ../../c-api/init.rst:2375 +#: ../../c-api/init.rst:1737 msgid "" -"Return the :c:expr:`void*` value associated with a TSS key in the current " +"Return the :c:type:`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:2383 +#: ../../c-api/init.rst:1745 msgid "Thread Local Storage (TLS) API" msgstr "スレッドローカルストレージ (TLS) API" -#: ../../c-api/init.rst:2385 +#: ../../c-api/init.rst:1747 msgid "" "This API is superseded by :ref:`Thread Specific Storage (TSS) API `." msgstr "" -#: ../../c-api/init.rst:2390 +#: ../../c-api/init.rst:1752 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 " @@ -3247,334 +2668,10 @@ msgid "" "platforms." msgstr "" -#: ../../c-api/init.rst:2395 +#: ../../c-api/init.rst:1757 msgid "" "Due to the compatibility problem noted above, this version of the API should " "not be used in new code." msgstr "" "前述の互換性の問題により、このバージョンのAPIは新規のコードで利用すべきではあ" "りません。" - -#: ../../c-api/init.rst:2406 -msgid "Synchronization Primitives" -msgstr "同期プリミティブ" - -#: ../../c-api/init.rst:2408 -msgid "The C-API provides a basic mutual exclusion lock." -msgstr "" - -#: ../../c-api/init.rst:2412 -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:2415 -msgid "PyMutex mutex = {0};" -msgstr "" - -#: ../../c-api/init.rst:2417 -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:2423 -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:2431 -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 detach the :term:`thread state ` if one " -"exists." -msgstr "" - -#: ../../c-api/init.rst:2439 -msgid "" -"Unlock mutex *m*. The mutex must be locked --- otherwise, the function will " -"issue a fatal error." -msgstr "" - -#: ../../c-api/init.rst:2447 -msgid "Python Critical Section API" -msgstr "" - -#: ../../c-api/init.rst:2449 -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:2454 -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:2461 -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:2468 -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:2474 -msgid "Example usage::" -msgstr "使用例::" - -#: ../../c-api/init.rst:2476 -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:2485 -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:2493 -msgid "" -"Acquires the per-object lock for the object *op* and begins a critical " -"section." -msgstr "" - -#: ../../c-api/init.rst:2496 ../../c-api/init.rst:2510 -#: ../../c-api/init.rst:2525 ../../c-api/init.rst:2539 -msgid "In the free-threaded build, this macro expands to::" -msgstr "" - -#: ../../c-api/init.rst:2498 -msgid "" -"{\n" -" PyCriticalSection _py_cs;\n" -" PyCriticalSection_Begin(&_py_cs, (PyObject*)(op))" -msgstr "" - -#: ../../c-api/init.rst:2502 ../../c-api/init.rst:2531 -msgid "In the default build, this macro expands to ``{``." -msgstr "" - -#: ../../c-api/init.rst:2508 -msgid "Ends the critical section and releases the per-object lock." -msgstr "" - -#: ../../c-api/init.rst:2512 -msgid "" -" PyCriticalSection_End(&_py_cs);\n" -"}" -msgstr "" - -#: ../../c-api/init.rst:2515 ../../c-api/init.rst:2544 -msgid "In the default build, this macro expands to ``}``." -msgstr "" - -#: ../../c-api/init.rst:2521 -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:2527 -msgid "" -"{\n" -" PyCriticalSection2 _py_cs2;\n" -" PyCriticalSection2_Begin(&_py_cs2, (PyObject*)(a), (PyObject*)(b))" -msgstr "" - -#: ../../c-api/init.rst:2537 -msgid "Ends the critical section and releases the per-object locks." -msgstr "" - -#: ../../c-api/init.rst:2541 -msgid "" -" PyCriticalSection2_End(&_py_cs2);\n" -"}" -msgstr "" - -#: ../../c-api/init.rst:350 -msgid "PyEval_InitThreads()" -msgstr "PyEval_InitThreads()" - -#: ../../c-api/init.rst:350 -msgid "modules (in module sys)" -msgstr "modules (in module sys)" - -#: ../../c-api/init.rst:350 ../../c-api/init.rst:712 -msgid "path (in module sys)" -msgstr "path (sys モジュール)" - -#: ../../c-api/init.rst:350 ../../c-api/init.rst:712 ../../c-api/init.rst:1222 -#: ../../c-api/init.rst:1750 ../../c-api/init.rst:1849 -msgid "module" -msgstr "module" - -#: ../../c-api/init.rst:350 ../../c-api/init.rst:1750 ../../c-api/init.rst:1849 -msgid "builtins" -msgstr "builtins" - -#: ../../c-api/init.rst:350 ../../c-api/init.rst:1750 ../../c-api/init.rst:1849 -msgid "__main__" -msgstr "__main__" - -#: ../../c-api/init.rst:350 ../../c-api/init.rst:1750 ../../c-api/init.rst:1849 -msgid "sys" -msgstr "sys" - -#: ../../c-api/init.rst:350 ../../c-api/init.rst:712 -msgid "search" -msgstr "検索" - -#: ../../c-api/init.rst:350 ../../c-api/init.rst:712 -msgid "path" -msgstr "パス" - -#: ../../c-api/init.rst:350 ../../c-api/init.rst:1814 ../../c-api/init.rst:1867 -msgid "Py_FinalizeEx (C function)" -msgstr "" - -#: ../../c-api/init.rst:572 -msgid "Py_Initialize()" -msgstr "Py_Initialize()" - -#: ../../c-api/init.rst:572 ../../c-api/init.rst:810 -msgid "main()" -msgstr "main()" - -#: ../../c-api/init.rst:572 -msgid "Py_GetPath()" -msgstr "Py_GetPath()" - -#: ../../c-api/init.rst:690 -msgid "executable (in module sys)" -msgstr "executable (in module sys)" - -#: ../../c-api/init.rst:745 ../../c-api/init.rst:787 ../../c-api/init.rst:801 -msgid "version (in module sys)" -msgstr "version (in module sys)" - -#: ../../c-api/init.rst:757 -msgid "platform (in module sys)" -msgstr "platform (in module sys)" - -#: ../../c-api/init.rst:774 -msgid "copyright (in module sys)" -msgstr "copyright (in module sys)" - -#: ../../c-api/init.rst:810 -msgid "Py_FatalError()" -msgstr "Py_FatalError()" - -#: ../../c-api/init.rst:810 -msgid "argv (in module sys)" -msgstr "argv (in module sys)" - -#: ../../c-api/init.rst:930 -msgid "global interpreter lock" -msgstr "global interpreter lock" - -#: ../../c-api/init.rst:930 -msgid "interpreter lock" -msgstr "interpreter lock" - -#: ../../c-api/init.rst:930 -msgid "lock, interpreter" -msgstr "lock, interpreter" - -#: ../../c-api/init.rst:944 -msgid "setswitchinterval (in module sys)" -msgstr "" - -#: ../../c-api/init.rst:953 -msgid "PyThreadState (C type)" -msgstr "" - -#: ../../c-api/init.rst:989 -msgid "Py_BEGIN_ALLOW_THREADS (C macro)" -msgstr "" - -#: ../../c-api/init.rst:989 -msgid "Py_END_ALLOW_THREADS (C macro)" -msgstr "" - -#: ../../c-api/init.rst:1005 -msgid "PyEval_RestoreThread (C function)" -msgstr "" - -#: ../../c-api/init.rst:1005 -msgid "PyEval_SaveThread (C function)" -msgstr "" - -#: ../../c-api/init.rst:1200 -msgid "PyEval_AcquireThread()" -msgstr "PyEval_AcquireThread()" - -#: ../../c-api/init.rst:1200 -msgid "PyEval_ReleaseThread()" -msgstr "PyEval_ReleaseThread()" - -#: ../../c-api/init.rst:1200 -msgid "PyEval_SaveThread()" -msgstr "PyEval_SaveThread()" - -#: ../../c-api/init.rst:1200 -msgid "PyEval_RestoreThread()" -msgstr "PyEval_RestoreThread()" - -#: ../../c-api/init.rst:1222 -msgid "_thread" -msgstr "_thread" - -#: ../../c-api/init.rst:1750 ../../c-api/init.rst:1849 -msgid "stdout (in module sys)" -msgstr "stdout (sys モジュール)" - -#: ../../c-api/init.rst:1750 ../../c-api/init.rst:1849 -msgid "stderr (in module sys)" -msgstr "stderr (sys モジュール)" - -#: ../../c-api/init.rst:1750 ../../c-api/init.rst:1849 -msgid "stdin (in module sys)" -msgstr "stdin (sys モジュール)" - -#: ../../c-api/init.rst:1814 -msgid "Py_Initialize (C function)" -msgstr "" - -#: ../../c-api/init.rst:1844 -msgid "close (in module os)" -msgstr "" diff --git a/c-api/init_config.po b/c-api/init_config.po index e95e4ebe3..5a6c277ae 100644 --- a/c-api/init_config.po +++ b/c-api/init_config.po @@ -1,2976 +1,996 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: +# tomo, 2019 +# Naoki Nakamura , 2020 +# yuhutuge, 2020 +# Tetsuo Koyama , 2020 # Osamu NAKAMURA, 2021 -# Tetsuo Koyama , 2021 -# Ryuji TSUTSUI , 2022 -# yaakiyu, 2023 -# tomo, 2025 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:49+0000\n" -"Last-Translator: tomo, 2025\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-06-24 06:41+0000\n" +"PO-Revision-Date: 2019-09-01 14:43+0000\n" +"Last-Translator: Osamu NAKAMURA, 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/init_config.rst:7 msgid "Python Initialization Configuration" msgstr "Python 初期化設定 " -#: ../../c-api/init_config.rst:13 -msgid "PyInitConfig C API" -msgstr "" - -#: ../../c-api/init_config.rst:17 -msgid "Python can be initialized with :c:func:`Py_InitializeFromInitConfig`." -msgstr "" - -#: ../../c-api/init_config.rst:19 ../../c-api/init_config.rst:650 -msgid "" -"The :c:func:`Py_RunMain` function can be used to write a customized Python " -"program." -msgstr "" +#: ../../c-api/init_config.rst:11 +msgid "Structures:" +msgstr "構造体:" -#: ../../c-api/init_config.rst:22 ../../c-api/init_config.rst:653 -msgid "" -"See also :ref:`Initialization, Finalization, and Threads `." -msgstr "" -":ref:`Initialization, Finalization, and Threads ` も参照して" -"ください。" +#: ../../c-api/init_config.rst:13 +msgid ":c:type:`PyConfig`" +msgstr ":c:type:`PyConfig`" -#: ../../c-api/init_config.rst:25 -msgid ":pep:`741` \"Python Configuration C API\"." -msgstr "" +#: ../../c-api/init_config.rst:14 +msgid ":c:type:`PyPreConfig`" +msgstr ":c:type:`PyPreConfig`" -#: ../../c-api/init_config.rst:29 ../../c-api/init_config.rst:660 -msgid "Example" -msgstr "使用例" +#: ../../c-api/init_config.rst:15 +msgid ":c:type:`PyStatus`" +msgstr ":c:type:`PyStatus`" -#: ../../c-api/init_config.rst:31 -msgid "" -"Example of customized Python always running with the :ref:`Python " -"Development Mode ` enabled; return ``-1`` on error:" -msgstr "" +#: ../../c-api/init_config.rst:16 +msgid ":c:type:`PyWideStringList`" +msgstr ":c:type:`PyWideStringList`" -#: ../../c-api/init_config.rst:34 -msgid "" -"int init_python(void)\n" -"{\n" -" PyInitConfig *config = PyInitConfig_Create();\n" -" if (config == NULL) {\n" -" printf(\"PYTHON INIT ERROR: memory allocation failed\\n\");\n" -" return -1;\n" -" }\n" -"\n" -" // Enable the Python Development Mode\n" -" if (PyInitConfig_SetInt(config, \"dev_mode\", 1) < 0) {\n" -" goto error;\n" -" }\n" -"\n" -" // Initialize Python with the configuration\n" -" if (Py_InitializeFromInitConfig(config) < 0) {\n" -" goto error;\n" -" }\n" -" PyInitConfig_Free(config);\n" -" return 0;\n" -"\n" -"error:\n" -" {\n" -" // Display the error message.\n" -" //\n" -" // This uncommon braces style is used, because you cannot make\n" -" // goto targets point to variable declarations.\n" -" const char *err_msg;\n" -" (void)PyInitConfig_GetError(config, &err_msg);\n" -" printf(\"PYTHON INIT ERROR: %s\\n\", err_msg);\n" -" PyInitConfig_Free(config);\n" -" return -1;\n" -" }\n" -"}" -msgstr "" - -#: ../../c-api/init_config.rst:71 -msgid "Create Config" -msgstr "" - -#: ../../c-api/init_config.rst:75 -msgid "Opaque structure to configure the Python initialization." -msgstr "" +#: ../../c-api/init_config.rst:18 +msgid "Functions:" +msgstr "関数:" -#: ../../c-api/init_config.rst:80 -msgid "" -"Create a new initialization configuration using :ref:`Isolated Configuration " -"` default values." -msgstr "" +#: ../../c-api/init_config.rst:20 +msgid ":c:func:`PyConfig_Clear`" +msgstr ":c:func:`PyConfig_Clear`" -#: ../../c-api/init_config.rst:83 -msgid "It must be freed by :c:func:`PyInitConfig_Free`." -msgstr "" +#: ../../c-api/init_config.rst:21 +msgid ":c:func:`PyConfig_InitIsolatedConfig`" +msgstr ":c:func:`PyConfig_InitIsolatedConfig`" -#: ../../c-api/init_config.rst:85 -msgid "Return ``NULL`` on memory allocation failure." -msgstr "" +#: ../../c-api/init_config.rst:22 +msgid ":c:func:`PyConfig_InitPythonConfig`" +msgstr ":c:func:`PyConfig_InitPythonConfig`" -#: ../../c-api/init_config.rst:90 -msgid "Free memory of the initialization configuration *config*." -msgstr "" +#: ../../c-api/init_config.rst:23 +msgid ":c:func:`PyConfig_Read`" +msgstr ":c:func:`PyConfig_Read`" -#: ../../c-api/init_config.rst:92 -msgid "If *config* is ``NULL``, no operation is performed." -msgstr "" +#: ../../c-api/init_config.rst:24 +msgid ":c:func:`PyConfig_SetArgv`" +msgstr ":c:func:`PyConfig_SetArgv`" -#: ../../c-api/init_config.rst:96 -msgid "Error Handling" -msgstr "エラー処理" +#: ../../c-api/init_config.rst:25 +msgid ":c:func:`PyConfig_SetBytesArgv`" +msgstr ":c:func:`PyConfig_SetBytesArgv`" -#: ../../c-api/init_config.rst:100 -msgid "Get the *config* error message." -msgstr "" +#: ../../c-api/init_config.rst:26 +msgid ":c:func:`PyConfig_SetBytesString`" +msgstr ":c:func:`PyConfig_SetBytesString`" -#: ../../c-api/init_config.rst:102 -msgid "Set *\\*err_msg* and return ``1`` if an error is set." -msgstr "" +#: ../../c-api/init_config.rst:27 +msgid ":c:func:`PyConfig_SetString`" +msgstr ":c:func:`PyConfig_SetString`" -#: ../../c-api/init_config.rst:103 -msgid "Set *\\*err_msg* to ``NULL`` and return ``0`` otherwise." -msgstr "" +#: ../../c-api/init_config.rst:28 +msgid ":c:func:`PyConfig_SetWideStringList`" +msgstr ":c:func:`PyConfig_SetWideStringList`" -#: ../../c-api/init_config.rst:105 -msgid "An error message is an UTF-8 encoded string." -msgstr "" +#: ../../c-api/init_config.rst:29 +msgid ":c:func:`PyPreConfig_InitIsolatedConfig`" +msgstr ":c:func:`PyPreConfig_InitIsolatedConfig`" -#: ../../c-api/init_config.rst:107 -msgid "If *config* has an exit code, format the exit code as an error message." -msgstr "" +#: ../../c-api/init_config.rst:30 +msgid ":c:func:`PyPreConfig_InitPythonConfig`" +msgstr ":c:func:`PyPreConfig_InitPythonConfig`" -#: ../../c-api/init_config.rst:110 -msgid "" -"The error message remains valid until another ``PyInitConfig`` function is " -"called with *config*. The caller doesn't have to free the error message." -msgstr "" +#: ../../c-api/init_config.rst:31 +msgid ":c:func:`PyStatus_Error`" +msgstr ":c:func:`PyStatus_Error`" -#: ../../c-api/init_config.rst:117 -msgid "Get the *config* exit code." -msgstr "" +#: ../../c-api/init_config.rst:32 +msgid ":c:func:`PyStatus_Exception`" +msgstr ":c:func:`PyStatus_Exception`" -#: ../../c-api/init_config.rst:119 -msgid "Set *\\*exitcode* and return ``1`` if *config* has an exit code set." -msgstr "" +#: ../../c-api/init_config.rst:33 +msgid ":c:func:`PyStatus_Exit`" +msgstr ":c:func:`PyStatus_Exit`" -#: ../../c-api/init_config.rst:120 -msgid "Return ``0`` if *config* has no exit code set." -msgstr "" +#: ../../c-api/init_config.rst:34 +msgid ":c:func:`PyStatus_IsError`" +msgstr ":c:func:`PyStatus_IsError`" -#: ../../c-api/init_config.rst:122 -msgid "" -"Only the ``Py_InitializeFromInitConfig()`` function can set an exit code if " -"the ``parse_argv`` option is non-zero." -msgstr "" +#: ../../c-api/init_config.rst:35 +msgid ":c:func:`PyStatus_IsExit`" +msgstr ":c:func:`PyStatus_IsExit`" -#: ../../c-api/init_config.rst:125 -msgid "" -"An exit code can be set when parsing the command line failed (exit code " -"``2``) or when a command line option asks to display the command line help " -"(exit code ``0``)." -msgstr "" +#: ../../c-api/init_config.rst:36 +msgid ":c:func:`PyStatus_NoMemory`" +msgstr ":c:func:`PyStatus_NoMemory`" -#: ../../c-api/init_config.rst:131 -msgid "Get Options" -msgstr "" +#: ../../c-api/init_config.rst:37 +msgid ":c:func:`PyStatus_Ok`" +msgstr ":c:func:`PyStatus_Ok`" -#: ../../c-api/init_config.rst:133 ../../c-api/init_config.rst:187 -#: ../../c-api/init_config.rst:559 -msgid "" -"The configuration option *name* parameter must be a non-NULL null-terminated " -"UTF-8 encoded string. See :ref:`Configuration Options `." -msgstr "" +#: ../../c-api/init_config.rst:38 +msgid ":c:func:`PyWideStringList_Append`" +msgstr ":c:func:`PyWideStringList_Append`" -#: ../../c-api/init_config.rst:138 -msgid "Test if the configuration has an option called *name*." -msgstr "" +#: ../../c-api/init_config.rst:39 +msgid ":c:func:`PyWideStringList_Insert`" +msgstr ":c:func:`PyWideStringList_Insert`" -#: ../../c-api/init_config.rst:140 -msgid "Return ``1`` if the option exists, or return ``0`` otherwise." -msgstr "" +#: ../../c-api/init_config.rst:40 +msgid ":c:func:`Py_ExitStatusException`" +msgstr ":c:func:`Py_ExitStatusException`" -#: ../../c-api/init_config.rst:145 -msgid "Get an integer configuration option." -msgstr "" +#: ../../c-api/init_config.rst:41 +msgid ":c:func:`Py_InitializeFromConfig`" +msgstr ":c:func:`Py_InitializeFromConfig`" -#: ../../c-api/init_config.rst:147 ../../c-api/init_config.rst:156 -msgid "Set *\\*value*, and return ``0`` on success." -msgstr "" +#: ../../c-api/init_config.rst:42 +msgid ":c:func:`Py_PreInitialize`" +msgstr ":c:func:`Py_PreInitialize`" -#: ../../c-api/init_config.rst:148 ../../c-api/init_config.rst:157 -#: ../../c-api/init_config.rst:172 ../../c-api/init_config.rst:200 -#: ../../c-api/init_config.rst:209 ../../c-api/init_config.rst:218 -#: ../../c-api/init_config.rst:233 ../../c-api/init_config.rst:249 -msgid "Set an error in *config* and return ``-1`` on error." -msgstr "" +#: ../../c-api/init_config.rst:43 +msgid ":c:func:`Py_PreInitializeFromArgs`" +msgstr ":c:func:`Py_PreInitializeFromArgs`" -#: ../../c-api/init_config.rst:153 -msgid "" -"Get a string configuration option as a null-terminated UTF-8 encoded string." -msgstr "" +#: ../../c-api/init_config.rst:44 +msgid ":c:func:`Py_PreInitializeFromBytesArgs`" +msgstr ":c:func:`Py_PreInitializeFromBytesArgs`" -#: ../../c-api/init_config.rst:159 -msgid "" -"*\\*value* can be set to ``NULL`` if the option is an optional string and " -"the option is unset." -msgstr "" +#: ../../c-api/init_config.rst:45 +msgid ":c:func:`Py_RunMain`" +msgstr ":c:func:`Py_RunMain`" -#: ../../c-api/init_config.rst:162 -msgid "" -"On success, the string must be released with ``free(value)`` if it's not " -"``NULL``." -msgstr "" +#: ../../c-api/init_config.rst:46 +msgid ":c:func:`Py_GetArgcArgv`" +msgstr ":c:func:`Py_GetArgcArgv`" -#: ../../c-api/init_config.rst:168 +#: ../../c-api/init_config.rst:48 msgid "" -"Get a string list configuration option as an array of null-terminated UTF-8 " -"encoded strings." -msgstr "" - -#: ../../c-api/init_config.rst:171 -msgid "Set *\\*length* and *\\*value*, and return ``0`` on success." +"The preconfiguration (``PyPreConfig`` type) is stored in ``_PyRuntime." +"preconfig`` and the configuration (``PyConfig`` type) is stored in " +"``PyInterpreterState.config``." msgstr "" -#: ../../c-api/init_config.rst:174 +#: ../../c-api/init_config.rst:52 msgid "" -"On success, the string list must be released with " -"``PyInitConfig_FreeStrList(length, items)``." -msgstr "" - -#: ../../c-api/init_config.rst:180 -msgid "Free memory of a string list created by ``PyInitConfig_GetStrList()``." -msgstr "" - -#: ../../c-api/init_config.rst:185 -msgid "Set Options" +"See also :ref:`Initialization, Finalization, and Threads `." msgstr "" +":ref:`Initialization, Finalization, and Threads ` も参照して" +"ください。" -#: ../../c-api/init_config.rst:190 -msgid "" -"Some configuration options have side effects on other options. This logic is " -"only implemented when ``Py_InitializeFromInitConfig()`` is called, not by " -"the \"Set\" functions below. For example, setting ``dev_mode`` to ``1`` does " -"not set ``faulthandler`` to ``1``." -msgstr "" +#: ../../c-api/init_config.rst:55 +msgid ":pep:`587` \"Python Initialization Configuration\"." +msgstr ":pep:`587` \"Python 初期化設定\"" -#: ../../c-api/init_config.rst:197 -msgid "Set an integer configuration option." -msgstr "" +#: ../../c-api/init_config.rst:59 +msgid "PyWideStringList" +msgstr "PyWideStringList" -#: ../../c-api/init_config.rst:199 ../../c-api/init_config.rst:208 -#: ../../c-api/init_config.rst:217 ../../c-api/init_config.rst:232 -#: ../../c-api/init_config.rst:248 ../../c-api/init_config.rst:591 -msgid "Return ``0`` on success." -msgstr "" +#: ../../c-api/init_config.rst:63 +msgid "List of ``wchar_t*`` strings." +msgstr "``wchar_t*`` 文字列のリスト。" -#: ../../c-api/init_config.rst:205 +#: ../../c-api/init_config.rst:65 msgid "" -"Set a string configuration option from a null-terminated UTF-8 encoded " -"string. The string is copied." +"If *length* is non-zero, *items* must be non-``NULL`` and all strings must " +"be non-``NULL``." msgstr "" +"*length* が非ゼロの場合は、*items* は非 ``NULL`` かつすべての文字列は非 " +"``NULL`` でなければなりません。" -#: ../../c-api/init_config.rst:214 -msgid "" -"Set a string list configuration option from an array of null-terminated " -"UTF-8 encoded strings. The string list is copied." -msgstr "" +#: ../../c-api/init_config.rst:68 +msgid "Methods:" +msgstr "メソッド:" -#: ../../c-api/init_config.rst:222 -msgid "Module" -msgstr "" +#: ../../c-api/init_config.rst:72 +msgid "Append *item* to *list*." +msgstr "*item* を *list* に追加します。" -#: ../../c-api/init_config.rst:226 -msgid "Add a built-in extension module to the table of built-in modules." +#: ../../c-api/init_config.rst:74 ../../c-api/init_config.rst:85 +msgid "Python must be preinitialized to call this function." msgstr "" -#: ../../c-api/init_config.rst:228 -msgid "" -"The new module can be imported by the name *name*, and uses the function " -"*initfunc* as the initialization function called on the first attempted " -"import." -msgstr "" +#: ../../c-api/init_config.rst:78 +msgid "Insert *item* into *list* at *index*." +msgstr "*item* を *list* の *index* の位置に挿入します。" -#: ../../c-api/init_config.rst:235 +#: ../../c-api/init_config.rst:80 msgid "" -"If Python is initialized multiple times, ``PyInitConfig_AddModule()`` must " -"be called at each Python initialization." -msgstr "" - -#: ../../c-api/init_config.rst:238 -msgid "Similar to the :c:func:`PyImport_AppendInittab` function." -msgstr "" - -#: ../../c-api/init_config.rst:242 -msgid "Initialize Python" -msgstr "" - -#: ../../c-api/init_config.rst:246 -msgid "Initialize Python from the initialization configuration." -msgstr "" - -#: ../../c-api/init_config.rst:250 -msgid "Set an exit code in *config* and return ``-1`` if Python wants to exit." -msgstr "" - -#: ../../c-api/init_config.rst:253 -msgid "See ``PyInitConfig_GetExitcode()`` for the exit code case." -msgstr "" - -#: ../../c-api/init_config.rst:259 -msgid "Configuration Options" -msgstr "" - -#: ../../c-api/init_config.rst:264 -msgid "Option" -msgstr "オプション" - -#: ../../c-api/init_config.rst:265 -msgid "PyConfig/PyPreConfig member" -msgstr "" - -#: ../../c-api/init_config.rst:266 -msgid "Type" -msgstr "型" - -#: ../../c-api/init_config.rst:267 -msgid "Visibility" -msgstr "可視性" - -#: ../../c-api/init_config.rst:268 -msgid "``\"allocator\"``" -msgstr "" - -#: ../../c-api/init_config.rst:269 -msgid ":c:member:`allocator `" -msgstr "" - -#: ../../c-api/init_config.rst:270 ../../c-api/init_config.rst:294 -#: ../../c-api/init_config.rst:322 ../../c-api/init_config.rst:358 -#: ../../c-api/init_config.rst:366 ../../c-api/init_config.rst:378 -#: ../../c-api/init_config.rst:406 ../../c-api/init_config.rst:494 -#: ../../c-api/init_config.rst:522 ../../c-api/init_config.rst:576 -msgid "``int``" -msgstr "``int``" - -#: ../../c-api/init_config.rst:271 ../../c-api/init_config.rst:291 -#: ../../c-api/init_config.rst:299 ../../c-api/init_config.rst:303 -#: ../../c-api/init_config.rst:307 ../../c-api/init_config.rst:311 -#: ../../c-api/init_config.rst:315 ../../c-api/init_config.rst:319 -#: ../../c-api/init_config.rst:327 ../../c-api/init_config.rst:331 -#: ../../c-api/init_config.rst:335 ../../c-api/init_config.rst:347 -#: ../../c-api/init_config.rst:351 ../../c-api/init_config.rst:355 -#: ../../c-api/init_config.rst:359 ../../c-api/init_config.rst:363 -#: ../../c-api/init_config.rst:367 ../../c-api/init_config.rst:375 -#: ../../c-api/init_config.rst:387 ../../c-api/init_config.rst:391 -#: ../../c-api/init_config.rst:395 ../../c-api/init_config.rst:399 -#: ../../c-api/init_config.rst:411 ../../c-api/init_config.rst:415 -#: ../../c-api/init_config.rst:423 ../../c-api/init_config.rst:427 -#: ../../c-api/init_config.rst:439 ../../c-api/init_config.rst:451 -#: ../../c-api/init_config.rst:455 ../../c-api/init_config.rst:459 -#: ../../c-api/init_config.rst:463 ../../c-api/init_config.rst:467 -#: ../../c-api/init_config.rst:471 ../../c-api/init_config.rst:475 -#: ../../c-api/init_config.rst:479 ../../c-api/init_config.rst:483 -#: ../../c-api/init_config.rst:487 ../../c-api/init_config.rst:495 -#: ../../c-api/init_config.rst:503 ../../c-api/init_config.rst:507 -#: ../../c-api/init_config.rst:511 ../../c-api/init_config.rst:515 -#: ../../c-api/init_config.rst:519 ../../c-api/init_config.rst:527 -#: ../../c-api/init_config.rst:543 -msgid "Read-only" -msgstr "読み出し専用" - -#: ../../c-api/init_config.rst:272 -msgid "``\"argv\"``" -msgstr "" - -#: ../../c-api/init_config.rst:273 -msgid ":c:member:`argv `" -msgstr "" - -#: ../../c-api/init_config.rst:274 ../../c-api/init_config.rst:402 -#: ../../c-api/init_config.rst:410 ../../c-api/init_config.rst:530 -#: ../../c-api/init_config.rst:578 -msgid "``list[str]``" -msgstr "" - -#: ../../c-api/init_config.rst:275 ../../c-api/init_config.rst:279 -#: ../../c-api/init_config.rst:283 ../../c-api/init_config.rst:287 -#: ../../c-api/init_config.rst:295 ../../c-api/init_config.rst:323 -#: ../../c-api/init_config.rst:339 ../../c-api/init_config.rst:343 -#: ../../c-api/init_config.rst:371 ../../c-api/init_config.rst:379 -#: ../../c-api/init_config.rst:383 ../../c-api/init_config.rst:403 -#: ../../c-api/init_config.rst:407 ../../c-api/init_config.rst:419 -#: ../../c-api/init_config.rst:431 ../../c-api/init_config.rst:435 -#: ../../c-api/init_config.rst:443 ../../c-api/init_config.rst:447 -#: ../../c-api/init_config.rst:491 ../../c-api/init_config.rst:499 -#: ../../c-api/init_config.rst:523 ../../c-api/init_config.rst:531 -#: ../../c-api/init_config.rst:535 ../../c-api/init_config.rst:539 -msgid "Public" -msgstr "" - -#: ../../c-api/init_config.rst:276 -msgid "``\"base_exec_prefix\"``" -msgstr "" - -#: ../../c-api/init_config.rst:277 -msgid ":c:member:`base_exec_prefix `" -msgstr "" - -#: ../../c-api/init_config.rst:278 ../../c-api/init_config.rst:282 -#: ../../c-api/init_config.rst:286 ../../c-api/init_config.rst:298 -#: ../../c-api/init_config.rst:334 ../../c-api/init_config.rst:338 -#: ../../c-api/init_config.rst:342 ../../c-api/init_config.rst:350 -#: ../../c-api/init_config.rst:354 ../../c-api/init_config.rst:362 -#: ../../c-api/init_config.rst:430 ../../c-api/init_config.rst:434 -#: ../../c-api/init_config.rst:438 ../../c-api/init_config.rst:442 -#: ../../c-api/init_config.rst:450 ../../c-api/init_config.rst:454 -#: ../../c-api/init_config.rst:458 ../../c-api/init_config.rst:462 -#: ../../c-api/init_config.rst:482 ../../c-api/init_config.rst:486 -#: ../../c-api/init_config.rst:490 ../../c-api/init_config.rst:577 -msgid "``str``" -msgstr "``str``" - -#: ../../c-api/init_config.rst:280 -msgid "``\"base_executable\"``" -msgstr "" - -#: ../../c-api/init_config.rst:281 -msgid ":c:member:`base_executable `" -msgstr "" - -#: ../../c-api/init_config.rst:284 -msgid "``\"base_prefix\"``" -msgstr "" - -#: ../../c-api/init_config.rst:285 -msgid ":c:member:`base_prefix `" -msgstr "" - -#: ../../c-api/init_config.rst:288 -msgid "``\"buffered_stdio\"``" -msgstr "" - -#: ../../c-api/init_config.rst:289 -msgid ":c:member:`buffered_stdio `" -msgstr "" - -#: ../../c-api/init_config.rst:290 ../../c-api/init_config.rst:302 -#: ../../c-api/init_config.rst:306 ../../c-api/init_config.rst:310 -#: ../../c-api/init_config.rst:314 ../../c-api/init_config.rst:318 -#: ../../c-api/init_config.rst:326 ../../c-api/init_config.rst:330 -#: ../../c-api/init_config.rst:346 ../../c-api/init_config.rst:370 -#: ../../c-api/init_config.rst:374 ../../c-api/init_config.rst:382 -#: ../../c-api/init_config.rst:386 ../../c-api/init_config.rst:390 -#: ../../c-api/init_config.rst:394 ../../c-api/init_config.rst:398 -#: ../../c-api/init_config.rst:414 ../../c-api/init_config.rst:418 -#: ../../c-api/init_config.rst:422 ../../c-api/init_config.rst:426 -#: ../../c-api/init_config.rst:446 ../../c-api/init_config.rst:466 -#: ../../c-api/init_config.rst:470 ../../c-api/init_config.rst:474 -#: ../../c-api/init_config.rst:478 ../../c-api/init_config.rst:498 -#: ../../c-api/init_config.rst:502 ../../c-api/init_config.rst:506 -#: ../../c-api/init_config.rst:510 ../../c-api/init_config.rst:514 -#: ../../c-api/init_config.rst:518 ../../c-api/init_config.rst:526 -#: ../../c-api/init_config.rst:534 ../../c-api/init_config.rst:542 -#: ../../c-api/init_config.rst:575 -msgid "``bool``" -msgstr "``bool``" - -#: ../../c-api/init_config.rst:292 -msgid "``\"bytes_warning\"``" -msgstr "" - -#: ../../c-api/init_config.rst:293 -msgid ":c:member:`bytes_warning `" -msgstr "" - -#: ../../c-api/init_config.rst:296 -msgid "``\"check_hash_pycs_mode\"``" -msgstr "" - -#: ../../c-api/init_config.rst:297 -msgid ":c:member:`check_hash_pycs_mode `" -msgstr "" - -#: ../../c-api/init_config.rst:300 -msgid "``\"code_debug_ranges\"``" -msgstr "" - -#: ../../c-api/init_config.rst:301 -msgid ":c:member:`code_debug_ranges `" -msgstr "" - -#: ../../c-api/init_config.rst:304 -msgid "``\"coerce_c_locale\"``" -msgstr "" - -#: ../../c-api/init_config.rst:305 -msgid ":c:member:`coerce_c_locale `" -msgstr "" - -#: ../../c-api/init_config.rst:308 -msgid "``\"coerce_c_locale_warn\"``" +"If *index* is greater than or equal to *list* length, append *item* to " +"*list*." msgstr "" +"*index* が *list* の長さ以上の場合、*item* を *list* の末尾に追加します。" -#: ../../c-api/init_config.rst:309 -msgid ":c:member:`coerce_c_locale_warn `" -msgstr "" +#: ../../c-api/init_config.rst:83 +msgid "*index* must be greater than or equal to 0." +msgstr "*index* は、0以上でなければなりません。" -#: ../../c-api/init_config.rst:312 -msgid "``\"configure_c_stdio\"``" -msgstr "" +#: ../../c-api/init_config.rst:87 ../../c-api/init_config.rst:107 +#: ../../c-api/init_config.rst:210 ../../c-api/init_config.rst:417 +msgid "Structure fields:" +msgstr "構造体フィールド:" -#: ../../c-api/init_config.rst:313 -msgid ":c:member:`configure_c_stdio `" -msgstr "" +#: ../../c-api/init_config.rst:91 +msgid "List length." +msgstr "リストの長さ。" -#: ../../c-api/init_config.rst:316 -msgid "``\"configure_locale\"``" -msgstr "" +#: ../../c-api/init_config.rst:95 +msgid "List items." +msgstr "リストの要素。" -#: ../../c-api/init_config.rst:317 -msgid ":c:member:`configure_locale `" -msgstr "" +#: ../../c-api/init_config.rst:98 +msgid "PyStatus" +msgstr "PyStatus" -#: ../../c-api/init_config.rst:320 -msgid "``\"cpu_count\"``" -msgstr "" +#: ../../c-api/init_config.rst:102 +msgid "" +"Structure to store an initialization function status: success, error or exit." +msgstr "初期化関数のステータス(成功、エラー、終了)を格納する構造体です。" -#: ../../c-api/init_config.rst:321 -msgid ":c:member:`cpu_count `" -msgstr "" +#: ../../c-api/init_config.rst:105 +msgid "For an error, it can store the C function name which created the error." +msgstr "エラー時には、エラーを生成したC関数の名前を格納できます。" -#: ../../c-api/init_config.rst:324 -msgid "``\"dev_mode\"``" -msgstr "" +#: ../../c-api/init_config.rst:111 +msgid "Exit code. Argument passed to ``exit()``." +msgstr "終了コード。``exit()`` の引数として渡されます。" -#: ../../c-api/init_config.rst:325 -msgid ":c:member:`dev_mode `" -msgstr "" +#: ../../c-api/init_config.rst:115 +msgid "Error message." +msgstr "エラーメッセージ。" -#: ../../c-api/init_config.rst:328 -msgid "``\"dump_refs\"``" -msgstr "" +#: ../../c-api/init_config.rst:119 +msgid "Name of the function which created an error, can be ``NULL``." +msgstr "エラーを生成した関数の名前で、``NULL`` になりえます。" -#: ../../c-api/init_config.rst:329 -msgid ":c:member:`dump_refs `" -msgstr "" +#: ../../c-api/init_config.rst:121 +msgid "Functions to create a status:" +msgstr "ステータスを生成する関数:" -#: ../../c-api/init_config.rst:332 -msgid "``\"dump_refs_file\"``" -msgstr "" +#: ../../c-api/init_config.rst:125 +msgid "Success." +msgstr "成功。" -#: ../../c-api/init_config.rst:333 -msgid ":c:member:`dump_refs_file `" -msgstr "" +#: ../../c-api/init_config.rst:129 +msgid "Initialization error with a message." +msgstr "メッセージとともにエラーを初期化します。" -#: ../../c-api/init_config.rst:336 -msgid "``\"exec_prefix\"``" -msgstr "" +#: ../../c-api/init_config.rst:133 +msgid "Memory allocation failure (out of memory)." +msgstr "メモリ割り当ての失敗(メモリ不足)。" -#: ../../c-api/init_config.rst:337 -msgid ":c:member:`exec_prefix `" -msgstr "" +#: ../../c-api/init_config.rst:137 +msgid "Exit Python with the specified exit code." +msgstr "指定した終了コードでPythonを終了します。" -#: ../../c-api/init_config.rst:340 -msgid "``\"executable\"``" -msgstr "" +#: ../../c-api/init_config.rst:139 +msgid "Functions to handle a status:" +msgstr "ステータスを扱う関数:" -#: ../../c-api/init_config.rst:341 -msgid ":c:member:`executable `" +#: ../../c-api/init_config.rst:143 +msgid "" +"Is the status an error or an exit? If true, the exception must be handled; " +"by calling :c:func:`Py_ExitStatusException` for example." msgstr "" -#: ../../c-api/init_config.rst:344 -msgid "``\"faulthandler\"``" +#: ../../c-api/init_config.rst:148 +msgid "Is the result an error?" msgstr "" -#: ../../c-api/init_config.rst:345 -msgid ":c:member:`faulthandler `" +#: ../../c-api/init_config.rst:152 +msgid "Is the result an exit?" msgstr "" -#: ../../c-api/init_config.rst:348 -msgid "``\"filesystem_encoding\"``" +#: ../../c-api/init_config.rst:156 +msgid "" +"Call ``exit(exitcode)`` if *status* is an exit. Print the error message and " +"exit with a non-zero exit code if *status* is an error. Must only be called " +"if ``PyStatus_Exception(status)`` is non-zero." msgstr "" -#: ../../c-api/init_config.rst:349 -msgid ":c:member:`filesystem_encoding `" +#: ../../c-api/init_config.rst:161 +msgid "" +"Internally, Python uses macros which set ``PyStatus.func``, whereas " +"functions to create a status set ``func`` to ``NULL``." msgstr "" -#: ../../c-api/init_config.rst:352 -msgid "``\"filesystem_errors\"``" -msgstr "" +#: ../../c-api/init_config.rst:164 +msgid "Example::" +msgstr "以下はプログラム例です::" -#: ../../c-api/init_config.rst:353 -msgid ":c:member:`filesystem_errors `" -msgstr "" +#: ../../c-api/init_config.rst:188 +msgid "PyPreConfig" +msgstr "PyPreConfig" -#: ../../c-api/init_config.rst:356 -msgid "``\"hash_seed\"``" +#: ../../c-api/init_config.rst:192 +msgid "Structure used to preinitialize Python:" msgstr "" -#: ../../c-api/init_config.rst:357 -msgid ":c:member:`hash_seed `" +#: ../../c-api/init_config.rst:194 +msgid "Set the Python memory allocator" msgstr "" -#: ../../c-api/init_config.rst:360 -msgid "``\"home\"``" +#: ../../c-api/init_config.rst:195 +msgid "Configure the LC_CTYPE locale" msgstr "" -#: ../../c-api/init_config.rst:361 -msgid ":c:member:`home `" +#: ../../c-api/init_config.rst:196 +msgid "Set the UTF-8 mode" msgstr "" -#: ../../c-api/init_config.rst:364 -msgid "``\"import_time\"``" +#: ../../c-api/init_config.rst:198 +msgid "Function to initialize a preconfiguration:" msgstr "" -#: ../../c-api/init_config.rst:365 -msgid ":c:member:`import_time `" +#: ../../c-api/init_config.rst:202 +msgid "" +"Initialize the preconfiguration with :ref:`Python Configuration `." msgstr "" -#: ../../c-api/init_config.rst:368 -msgid "``\"inspect\"``" +#: ../../c-api/init_config.rst:207 +msgid "" +"Initialize the preconfiguration with :ref:`Isolated Configuration `." msgstr "" -#: ../../c-api/init_config.rst:369 -msgid ":c:member:`inspect `" -msgstr "" - -#: ../../c-api/init_config.rst:372 -msgid "``\"install_signal_handlers\"``" -msgstr "" - -#: ../../c-api/init_config.rst:373 -msgid ":c:member:`install_signal_handlers `" -msgstr "" - -#: ../../c-api/init_config.rst:376 -msgid "``\"int_max_str_digits\"``" -msgstr "" - -#: ../../c-api/init_config.rst:377 -msgid ":c:member:`int_max_str_digits `" -msgstr "" - -#: ../../c-api/init_config.rst:380 -msgid "``\"interactive\"``" -msgstr "" - -#: ../../c-api/init_config.rst:381 -msgid ":c:member:`interactive `" -msgstr "" - -#: ../../c-api/init_config.rst:384 -msgid "``\"isolated\"``" -msgstr "" - -#: ../../c-api/init_config.rst:385 -msgid ":c:member:`isolated `" -msgstr "" - -#: ../../c-api/init_config.rst:388 -msgid "``\"legacy_windows_fs_encoding\"``" -msgstr "" - -#: ../../c-api/init_config.rst:389 -msgid "" -":c:member:`legacy_windows_fs_encoding `" -msgstr "" - -#: ../../c-api/init_config.rst:392 -msgid "``\"legacy_windows_stdio\"``" -msgstr "" - -#: ../../c-api/init_config.rst:393 -msgid ":c:member:`legacy_windows_stdio `" -msgstr "" - -#: ../../c-api/init_config.rst:396 -msgid "``\"malloc_stats\"``" -msgstr "" - -#: ../../c-api/init_config.rst:397 -msgid ":c:member:`malloc_stats `" -msgstr "" - -#: ../../c-api/init_config.rst:400 -msgid "``\"module_search_paths\"``" -msgstr "" - -#: ../../c-api/init_config.rst:401 -msgid ":c:member:`module_search_paths `" -msgstr "" - -#: ../../c-api/init_config.rst:404 -msgid "``\"optimization_level\"``" -msgstr "" - -#: ../../c-api/init_config.rst:405 -msgid ":c:member:`optimization_level `" -msgstr "" - -#: ../../c-api/init_config.rst:408 -msgid "``\"orig_argv\"``" -msgstr "" - -#: ../../c-api/init_config.rst:409 -msgid ":c:member:`orig_argv `" -msgstr "" - -#: ../../c-api/init_config.rst:412 -msgid "``\"parse_argv\"``" -msgstr "" - -#: ../../c-api/init_config.rst:413 -msgid ":c:member:`parse_argv `" -msgstr "" - -#: ../../c-api/init_config.rst:416 -msgid "``\"parser_debug\"``" -msgstr "" - -#: ../../c-api/init_config.rst:417 -msgid ":c:member:`parser_debug `" -msgstr "" - -#: ../../c-api/init_config.rst:420 -msgid "``\"pathconfig_warnings\"``" -msgstr "" - -#: ../../c-api/init_config.rst:421 -msgid ":c:member:`pathconfig_warnings `" -msgstr "" - -#: ../../c-api/init_config.rst:424 -msgid "``\"perf_profiling\"``" -msgstr "" - -#: ../../c-api/init_config.rst:425 -msgid ":c:member:`perf_profiling `" -msgstr "" - -#: ../../c-api/init_config.rst:428 -msgid "``\"platlibdir\"``" -msgstr "" - -#: ../../c-api/init_config.rst:429 -msgid ":c:member:`platlibdir `" -msgstr "" - -#: ../../c-api/init_config.rst:432 -msgid "``\"prefix\"``" -msgstr "" - -#: ../../c-api/init_config.rst:433 -msgid ":c:member:`prefix `" -msgstr "" - -#: ../../c-api/init_config.rst:436 -msgid "``\"program_name\"``" -msgstr "" - -#: ../../c-api/init_config.rst:437 -msgid ":c:member:`program_name `" -msgstr "" - -#: ../../c-api/init_config.rst:440 -msgid "``\"pycache_prefix\"``" -msgstr "" - -#: ../../c-api/init_config.rst:441 -msgid ":c:member:`pycache_prefix `" -msgstr "" - -#: ../../c-api/init_config.rst:444 -msgid "``\"quiet\"``" -msgstr "" - -#: ../../c-api/init_config.rst:445 -msgid ":c:member:`quiet `" -msgstr "" - -#: ../../c-api/init_config.rst:448 -msgid "``\"run_command\"``" -msgstr "" - -#: ../../c-api/init_config.rst:449 -msgid ":c:member:`run_command `" -msgstr "" - -#: ../../c-api/init_config.rst:452 -msgid "``\"run_filename\"``" -msgstr "" - -#: ../../c-api/init_config.rst:453 -msgid ":c:member:`run_filename `" -msgstr "" - -#: ../../c-api/init_config.rst:456 -msgid "``\"run_module\"``" -msgstr "" - -#: ../../c-api/init_config.rst:457 -msgid ":c:member:`run_module `" -msgstr "" - -#: ../../c-api/init_config.rst:460 -msgid "``\"run_presite\"``" -msgstr "" - -#: ../../c-api/init_config.rst:461 -msgid ":c:member:`run_presite `" -msgstr "" - -#: ../../c-api/init_config.rst:464 -msgid "``\"safe_path\"``" -msgstr "" - -#: ../../c-api/init_config.rst:465 -msgid ":c:member:`safe_path `" -msgstr "" - -#: ../../c-api/init_config.rst:468 -msgid "``\"show_ref_count\"``" -msgstr "" - -#: ../../c-api/init_config.rst:469 -msgid ":c:member:`show_ref_count `" -msgstr "" - -#: ../../c-api/init_config.rst:472 -msgid "``\"site_import\"``" -msgstr "" - -#: ../../c-api/init_config.rst:473 -msgid ":c:member:`site_import `" -msgstr "" - -#: ../../c-api/init_config.rst:476 -msgid "``\"skip_source_first_line\"``" -msgstr "" - -#: ../../c-api/init_config.rst:477 -msgid ":c:member:`skip_source_first_line `" -msgstr "" - -#: ../../c-api/init_config.rst:480 -msgid "``\"stdio_encoding\"``" -msgstr "" - -#: ../../c-api/init_config.rst:481 -msgid ":c:member:`stdio_encoding `" -msgstr "" - -#: ../../c-api/init_config.rst:484 -msgid "``\"stdio_errors\"``" -msgstr "" - -#: ../../c-api/init_config.rst:485 -msgid ":c:member:`stdio_errors `" -msgstr "" - -#: ../../c-api/init_config.rst:488 -msgid "``\"stdlib_dir\"``" -msgstr "" - -#: ../../c-api/init_config.rst:489 -msgid ":c:member:`stdlib_dir `" -msgstr "" - -#: ../../c-api/init_config.rst:492 -msgid "``\"tracemalloc\"``" -msgstr "" - -#: ../../c-api/init_config.rst:493 -msgid ":c:member:`tracemalloc `" -msgstr "" - -#: ../../c-api/init_config.rst:496 -msgid "``\"use_environment\"``" -msgstr "" - -#: ../../c-api/init_config.rst:497 -msgid ":c:member:`use_environment `" -msgstr "" - -#: ../../c-api/init_config.rst:500 -msgid "``\"use_frozen_modules\"``" -msgstr "" - -#: ../../c-api/init_config.rst:501 -msgid ":c:member:`use_frozen_modules `" -msgstr "" - -#: ../../c-api/init_config.rst:504 -msgid "``\"use_hash_seed\"``" -msgstr "" - -#: ../../c-api/init_config.rst:505 -msgid ":c:member:`use_hash_seed `" -msgstr "" - -#: ../../c-api/init_config.rst:508 -msgid "``\"use_system_logger\"``" -msgstr "" - -#: ../../c-api/init_config.rst:509 -msgid ":c:member:`use_system_logger `" -msgstr "" - -#: ../../c-api/init_config.rst:512 -msgid "``\"user_site_directory\"``" -msgstr "" - -#: ../../c-api/init_config.rst:513 -msgid ":c:member:`user_site_directory `" -msgstr "" - -#: ../../c-api/init_config.rst:516 -msgid "``\"utf8_mode\"``" -msgstr "" - -#: ../../c-api/init_config.rst:517 -msgid ":c:member:`utf8_mode `" -msgstr "" - -#: ../../c-api/init_config.rst:520 -msgid "``\"verbose\"``" -msgstr "" - -#: ../../c-api/init_config.rst:521 -msgid ":c:member:`verbose `" -msgstr "" - -#: ../../c-api/init_config.rst:524 -msgid "``\"warn_default_encoding\"``" -msgstr "" - -#: ../../c-api/init_config.rst:525 -msgid ":c:member:`warn_default_encoding `" -msgstr "" - -#: ../../c-api/init_config.rst:528 -msgid "``\"warnoptions\"``" -msgstr "" - -#: ../../c-api/init_config.rst:529 -msgid ":c:member:`warnoptions `" -msgstr "" - -#: ../../c-api/init_config.rst:532 -msgid "``\"write_bytecode\"``" -msgstr "" - -#: ../../c-api/init_config.rst:533 -msgid ":c:member:`write_bytecode `" -msgstr "" - -#: ../../c-api/init_config.rst:536 -msgid "``\"xoptions\"``" -msgstr "" - -#: ../../c-api/init_config.rst:537 -msgid ":c:member:`xoptions `" -msgstr "" - -#: ../../c-api/init_config.rst:538 ../../c-api/init_config.rst:579 -msgid "``dict[str, str]``" -msgstr "" - -#: ../../c-api/init_config.rst:540 -msgid "``\"_pystats\"``" -msgstr "" - -#: ../../c-api/init_config.rst:541 -msgid ":c:member:`_pystats `" -msgstr "" - -#: ../../c-api/init_config.rst:545 -msgid "Visibility:" -msgstr "" - -#: ../../c-api/init_config.rst:547 -msgid "" -"Public: Can by get by :c:func:`PyConfig_Get` and set by :c:func:" -"`PyConfig_Set`." -msgstr "" - -#: ../../c-api/init_config.rst:549 -msgid "" -"Read-only: Can by get by :c:func:`PyConfig_Get`, but cannot be set by :c:" -"func:`PyConfig_Set`." -msgstr "" - -#: ../../c-api/init_config.rst:554 -msgid "Runtime Python configuration API" -msgstr "" - -#: ../../c-api/init_config.rst:556 -msgid "" -"At runtime, it's possible to get and set configuration options using :c:func:" -"`PyConfig_Get` and :c:func:`PyConfig_Set` functions." -msgstr "" - -#: ../../c-api/init_config.rst:562 -msgid "" -"Some options are read from the :mod:`sys` attributes. For example, the " -"option ``\"argv\"`` is read from :data:`sys.argv`." -msgstr "" - -#: ../../c-api/init_config.rst:568 -msgid "" -"Get the current runtime value of a configuration option as a Python object." -msgstr "" - -#: ../../c-api/init_config.rst:570 ../../c-api/init_config.rst:601 -msgid "Return a new reference on success." -msgstr "" - -#: ../../c-api/init_config.rst:571 ../../c-api/init_config.rst:602 -msgid "Set an exception and return ``NULL`` on error." -msgstr "" - -#: ../../c-api/init_config.rst:573 -msgid "The object type depends on the configuration option. It can be:" -msgstr "" - -#: ../../c-api/init_config.rst:581 ../../c-api/init_config.rst:604 -#: ../../c-api/init_config.rst:619 -msgid "" -"The caller must have an :term:`attached thread state`. The function cannot " -"be called before Python initialization nor after Python finalization." -msgstr "" - -#: ../../c-api/init_config.rst:589 -msgid "Similar to :c:func:`PyConfig_Get`, but get the value as a C int." -msgstr "" - -#: ../../c-api/init_config.rst:592 -msgid "Set an exception and return ``-1`` on error." -msgstr "" - -#: ../../c-api/init_config.rst:599 -msgid "Get all configuration option names as a ``frozenset``." -msgstr "" - -#: ../../c-api/init_config.rst:612 -msgid "Set the current runtime value of a configuration option." -msgstr "" - -#: ../../c-api/init_config.rst:614 -msgid "Raise a :exc:`ValueError` if there is no option *name*." -msgstr "" - -#: ../../c-api/init_config.rst:615 -msgid "Raise a :exc:`ValueError` if *value* is an invalid value." -msgstr "" - -#: ../../c-api/init_config.rst:616 -msgid "Raise a :exc:`ValueError` if the option is read-only (cannot be set)." -msgstr "" - -#: ../../c-api/init_config.rst:617 -msgid "Raise a :exc:`TypeError` if *value* has not the proper type." -msgstr "" - -#: ../../c-api/init_config.rst:622 -msgid "" -"Raises an :ref:`auditing event ` ``cpython.PyConfig_Set`` with " -"arguments ``name``, ``value``." -msgstr "" - -#: ../../c-api/init_config.rst:630 -msgid "PyConfig C API" -msgstr "" - -#: ../../c-api/init_config.rst:634 -msgid "" -"Python can be initialized with :c:func:`Py_InitializeFromConfig` and the :c:" -"type:`PyConfig` structure. It can be preinitialized with :c:func:" -"`Py_PreInitialize` and the :c:type:`PyPreConfig` structure." -msgstr "" -"Pythonは :c:func:`Py_InitializeFromConfig` と :c:type:`PyConfig` 構造体を" -"使って初期化できます。:c:func:`Py_PreInitialize` と :c:type:`PyPreConfig` " -"構造体によって事前に初期化できます。" - -#: ../../c-api/init_config.rst:638 -msgid "There are two kinds of configuration:" -msgstr "設定には二つの種類があります:" - -#: ../../c-api/init_config.rst:640 -msgid "" -"The :ref:`Python Configuration ` can be used to build a " -"customized Python which behaves as the regular Python. For example, " -"environment variables and command line arguments are used to configure " -"Python." -msgstr "" -":ref:`Python Configuration ` は、通常の Python と同じ振る" -"舞いをするカスタマイズされた Python を構築するために使用されます。例えば、環" -"境変数やコマンドライン引数がPythonを設定するために使用されます。" - -#: ../../c-api/init_config.rst:645 -msgid "" -"The :ref:`Isolated Configuration ` can be used to embed " -"Python into an application. It isolates Python from the system. For example, " -"environment variables are ignored, the LC_CTYPE locale is left unchanged and " -"no signal handler is registered." -msgstr "" - -#: ../../c-api/init_config.rst:656 -msgid ":pep:`587` \"Python Initialization Configuration\"." -msgstr ":pep:`587` \"Python 初期化設定\"" - -#: ../../c-api/init_config.rst:662 -msgid "Example of customized Python always running in isolated mode::" -msgstr "" - -#: ../../c-api/init_config.rst:664 -msgid "" -"int main(int argc, char **argv)\n" -"{\n" -" PyStatus status;\n" -"\n" -" PyConfig config;\n" -" PyConfig_InitPythonConfig(&config);\n" -" config.isolated = 1;\n" -"\n" -" /* Decode command line arguments.\n" -" Implicitly preinitialize Python (in isolated mode). */\n" -" status = PyConfig_SetBytesArgv(&config, argc, argv);\n" -" if (PyStatus_Exception(status)) {\n" -" goto exception;\n" -" }\n" -"\n" -" status = Py_InitializeFromConfig(&config);\n" -" if (PyStatus_Exception(status)) {\n" -" goto exception;\n" -" }\n" -" PyConfig_Clear(&config);\n" -"\n" -" return Py_RunMain();\n" -"\n" -"exception:\n" -" PyConfig_Clear(&config);\n" -" if (PyStatus_IsExit(status)) {\n" -" return status.exitcode;\n" -" }\n" -" /* Display the error message and exit the process with\n" -" non-zero exit code */\n" -" Py_ExitStatusException(status);\n" -"}" -msgstr "" - -#: ../../c-api/init_config.rst:699 -msgid "PyWideStringList" -msgstr "PyWideStringList" - -#: ../../c-api/init_config.rst:703 -msgid "List of ``wchar_t*`` strings." -msgstr "``wchar_t*`` 文字列のリスト。" - -#: ../../c-api/init_config.rst:705 -msgid "" -"If *length* is non-zero, *items* must be non-``NULL`` and all strings must " -"be non-``NULL``." -msgstr "" -"*length* が非ゼロの場合は、*items* は非 ``NULL`` かつすべての文字列は非 " -"``NULL`` でなければなりません。" - -#: ../../c-api/init_config.rst:710 -msgid "Methods:" -msgstr "メソッド:" - -#: ../../c-api/init_config.rst:714 -msgid "Append *item* to *list*." -msgstr "*item* を *list* に追加します。" - -#: ../../c-api/init_config.rst:716 ../../c-api/init_config.rst:727 -msgid "Python must be preinitialized to call this function." -msgstr "" - -#: ../../c-api/init_config.rst:720 -msgid "Insert *item* into *list* at *index*." -msgstr "*item* を *list* の *index* の位置に挿入します。" - -#: ../../c-api/init_config.rst:722 -msgid "" -"If *index* is greater than or equal to *list* length, append *item* to " -"*list*." -msgstr "" -"*index* が *list* の長さ以上の場合、*item* を *list* の末尾に追加します。" - -#: ../../c-api/init_config.rst:725 -msgid "*index* must be greater than or equal to ``0``." -msgstr "" - -#: ../../c-api/init_config.rst:731 ../../c-api/init_config.rst:751 -#: ../../c-api/init_config.rst:858 ../../c-api/init_config.rst:1177 -msgid "Structure fields:" -msgstr "構造体フィールド:" - -#: ../../c-api/init_config.rst:735 -msgid "List length." -msgstr "リストの長さ。" - -#: ../../c-api/init_config.rst:739 -msgid "List items." -msgstr "リストの要素。" - -#: ../../c-api/init_config.rst:742 -msgid "PyStatus" -msgstr "PyStatus" - -#: ../../c-api/init_config.rst:746 -msgid "" -"Structure to store an initialization function status: success, error or exit." -msgstr "初期化関数のステータス(成功、エラー、終了)を格納する構造体です。" - -#: ../../c-api/init_config.rst:749 -msgid "For an error, it can store the C function name which created the error." -msgstr "エラー時には、エラーを生成したC関数の名前を格納できます。" - -#: ../../c-api/init_config.rst:755 -msgid "Exit code. Argument passed to ``exit()``." -msgstr "終了コード。``exit()`` の引数として渡されます。" - -#: ../../c-api/init_config.rst:759 -msgid "Error message." -msgstr "エラーメッセージ。" - -#: ../../c-api/init_config.rst:763 -msgid "Name of the function which created an error, can be ``NULL``." -msgstr "エラーを生成した関数の名前で、``NULL`` になりえます。" - -#: ../../c-api/init_config.rst:767 -msgid "Functions to create a status:" -msgstr "ステータスを生成する関数:" - -#: ../../c-api/init_config.rst:771 -msgid "Success." -msgstr "成功。" - -#: ../../c-api/init_config.rst:775 -msgid "Initialization error with a message." -msgstr "メッセージとともにエラーを初期化します。" - -#: ../../c-api/init_config.rst:777 -msgid "*err_msg* must not be ``NULL``." -msgstr "" - -#: ../../c-api/init_config.rst:781 -msgid "Memory allocation failure (out of memory)." -msgstr "メモリ割り当ての失敗(メモリ不足)。" - -#: ../../c-api/init_config.rst:785 -msgid "Exit Python with the specified exit code." -msgstr "指定した終了コードでPythonを終了します。" - -#: ../../c-api/init_config.rst:787 -msgid "Functions to handle a status:" -msgstr "ステータスを扱う関数:" - -#: ../../c-api/init_config.rst:791 -msgid "" -"Is the status an error or an exit? If true, the exception must be handled; " -"by calling :c:func:`Py_ExitStatusException` for example." -msgstr "" - -#: ../../c-api/init_config.rst:796 -msgid "Is the result an error?" -msgstr "" - -#: ../../c-api/init_config.rst:800 -msgid "Is the result an exit?" -msgstr "" - -#: ../../c-api/init_config.rst:804 -msgid "" -"Call ``exit(exitcode)`` if *status* is an exit. Print the error message and " -"exit with a non-zero exit code if *status* is an error. Must only be called " -"if ``PyStatus_Exception(status)`` is non-zero." -msgstr "" - -#: ../../c-api/init_config.rst:809 -msgid "" -"Internally, Python uses macros which set ``PyStatus.func``, whereas " -"functions to create a status set ``func`` to ``NULL``." -msgstr "" - -#: ../../c-api/init_config.rst:812 -msgid "Example::" -msgstr "以下はプログラム例です::" - -#: ../../c-api/init_config.rst:814 -msgid "" -"PyStatus alloc(void **ptr, size_t size)\n" -"{\n" -" *ptr = PyMem_RawMalloc(size);\n" -" if (*ptr == NULL) {\n" -" return PyStatus_NoMemory();\n" -" }\n" -" return PyStatus_Ok();\n" -"}\n" -"\n" -"int main(int argc, char **argv)\n" -"{\n" -" void *ptr;\n" -" PyStatus status = alloc(&ptr, 16);\n" -" if (PyStatus_Exception(status)) {\n" -" Py_ExitStatusException(status);\n" -" }\n" -" PyMem_Free(ptr);\n" -" return 0;\n" -"}" -msgstr "" - -#: ../../c-api/init_config.rst:836 -msgid "PyPreConfig" -msgstr "PyPreConfig" - -#: ../../c-api/init_config.rst:840 -msgid "Structure used to preinitialize Python." -msgstr "" - -#: ../../c-api/init_config.rst:844 -msgid "Function to initialize a preconfiguration:" -msgstr "" - -#: ../../c-api/init_config.rst:848 -msgid "" -"Initialize the preconfiguration with :ref:`Python Configuration `." -msgstr "" - -#: ../../c-api/init_config.rst:853 -msgid "" -"Initialize the preconfiguration with :ref:`Isolated Configuration `." -msgstr "" - -#: ../../c-api/init_config.rst:862 -msgid "Name of the Python memory allocators:" -msgstr "" - -#: ../../c-api/init_config.rst:864 -msgid "" -"``PYMEM_ALLOCATOR_NOT_SET`` (``0``): don't change memory allocators (use " -"defaults)." -msgstr "" - -#: ../../c-api/init_config.rst:866 -msgid "" -"``PYMEM_ALLOCATOR_DEFAULT`` (``1``): :ref:`default memory allocators " -"`." -msgstr "" - -#: ../../c-api/init_config.rst:868 -msgid "" -"``PYMEM_ALLOCATOR_DEBUG`` (``2``): :ref:`default memory allocators ` with :ref:`debug hooks `." -msgstr "" - -#: ../../c-api/init_config.rst:871 -msgid "``PYMEM_ALLOCATOR_MALLOC`` (``3``): use ``malloc()`` of the C library." -msgstr "" - -#: ../../c-api/init_config.rst:872 -msgid "" -"``PYMEM_ALLOCATOR_MALLOC_DEBUG`` (``4``): force usage of ``malloc()`` with :" -"ref:`debug hooks `." -msgstr "" - -#: ../../c-api/init_config.rst:874 -msgid "" -"``PYMEM_ALLOCATOR_PYMALLOC`` (``5``): :ref:`Python pymalloc memory allocator " -"`." -msgstr "" - -#: ../../c-api/init_config.rst:876 -msgid "" -"``PYMEM_ALLOCATOR_PYMALLOC_DEBUG`` (``6``): :ref:`Python pymalloc memory " -"allocator ` with :ref:`debug hooks `." -msgstr "" - -#: ../../c-api/init_config.rst:879 -msgid "" -"``PYMEM_ALLOCATOR_MIMALLOC`` (``6``): use ``mimalloc``, a fast malloc " -"replacement." -msgstr "" - -#: ../../c-api/init_config.rst:881 -msgid "" -"``PYMEM_ALLOCATOR_MIMALLOC_DEBUG`` (``7``): use ``mimalloc``, a fast malloc " -"replacement with :ref:`debug hooks `." -msgstr "" - -#: ../../c-api/init_config.rst:885 -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:889 -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:894 -msgid "See :ref:`Memory Management `." -msgstr "" - -#: ../../c-api/init_config.rst:896 -msgid "Default: ``PYMEM_ALLOCATOR_NOT_SET``." -msgstr "" - -#: ../../c-api/init_config.rst:900 -msgid "Set the LC_CTYPE locale to the user preferred locale." -msgstr "" - -#: ../../c-api/init_config.rst:902 -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:905 ../../c-api/init_config.rst:916 -msgid "See the :term:`locale encoding`." -msgstr "" - -#: ../../c-api/init_config.rst:907 ../../c-api/init_config.rst:962 -#: ../../c-api/init_config.rst:1333 -msgid "Default: ``1`` in Python config, ``0`` in isolated config." -msgstr "" - -#: ../../c-api/init_config.rst:911 -msgid "If equals to ``2``, coerce the C locale." -msgstr "" - -#: ../../c-api/init_config.rst:913 -msgid "" -"If equals to ``1``, read the LC_CTYPE locale to decide if it should be " -"coerced." -msgstr "" - -#: ../../c-api/init_config.rst:918 ../../c-api/init_config.rst:924 -msgid "Default: ``-1`` in Python config, ``0`` in isolated config." -msgstr "" - -#: ../../c-api/init_config.rst:922 -msgid "If non-zero, emit a warning if the C locale is coerced." -msgstr "" - -#: ../../c-api/init_config.rst:928 -msgid "" -":ref:`Python Development Mode `: see :c:member:`PyConfig.dev_mode`." -msgstr "" - -#: ../../c-api/init_config.rst:931 ../../c-api/init_config.rst:1342 -#: ../../c-api/init_config.rst:1398 ../../c-api/init_config.rst:1892 -msgid "Default: ``-1`` in Python mode, ``0`` in isolated mode." -msgstr "" - -#: ../../c-api/init_config.rst:935 -msgid "Isolated mode: see :c:member:`PyConfig.isolated`." -msgstr "" - -#: ../../c-api/init_config.rst:937 ../../c-api/init_config.rst:1569 -msgid "Default: ``0`` in Python mode, ``1`` in isolated mode." -msgstr "" - -#: ../../c-api/init_config.rst:941 -msgid "If non-zero:" -msgstr "" - -#: ../../c-api/init_config.rst:943 -msgid "Set :c:member:`PyPreConfig.utf8_mode` to ``0``," -msgstr "" - -#: ../../c-api/init_config.rst:944 -msgid "Set :c:member:`PyConfig.filesystem_encoding` to ``\"mbcs\"``," -msgstr "" - -#: ../../c-api/init_config.rst:945 -msgid "Set :c:member:`PyConfig.filesystem_errors` to ``\"replace\"``." -msgstr "" - -#: ../../c-api/init_config.rst:947 -msgid "" -"Initialized from the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` environment " -"variable value." -msgstr "" - -#: ../../c-api/init_config.rst:950 ../../c-api/init_config.rst:1583 -msgid "" -"Only available on Windows. ``#ifdef MS_WINDOWS`` macro can be used for " -"Windows specific code." -msgstr "" - -#: ../../c-api/init_config.rst:953 ../../c-api/init_config.rst:1281 -#: ../../c-api/init_config.rst:1288 ../../c-api/init_config.rst:1355 -#: ../../c-api/init_config.rst:1487 ../../c-api/init_config.rst:1505 -#: ../../c-api/init_config.rst:1519 ../../c-api/init_config.rst:1586 -#: ../../c-api/init_config.rst:1600 ../../c-api/init_config.rst:1660 -#: ../../c-api/init_config.rst:1712 ../../c-api/init_config.rst:1774 -#: ../../c-api/init_config.rst:1828 ../../c-api/init_config.rst:1857 -#: ../../c-api/init_config.rst:1971 ../../c-api/init_config.rst:2018 -msgid "Default: ``0``." -msgstr "" - -#: ../../c-api/init_config.rst:957 -msgid "" -"If non-zero, :c:func:`Py_PreInitializeFromArgs` and :c:func:" -"`Py_PreInitializeFromBytesArgs` parse their ``argv`` argument the same way " -"the regular Python parses command line arguments: see :ref:`Command Line " -"Arguments `." -msgstr "" - -#: ../../c-api/init_config.rst:966 -msgid "" -"Use :ref:`environment variables `? See :c:member:`PyConfig." -"use_environment`." -msgstr "" - -#: ../../c-api/init_config.rst:969 ../../c-api/init_config.rst:1933 -msgid "Default: ``1`` in Python config and ``0`` in isolated config." -msgstr "" - -#: ../../c-api/init_config.rst:973 -msgid "If non-zero, enable the :ref:`Python UTF-8 Mode `." -msgstr "" - -#: ../../c-api/init_config.rst:975 -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:978 -msgid "Also set to ``1`` if the ``LC_CTYPE`` locale is ``C`` or ``POSIX``." -msgstr "" - -#: ../../c-api/init_config.rst:980 -msgid "Default: ``-1`` in Python config and ``0`` in isolated config." -msgstr "" - -#: ../../c-api/init_config.rst:986 -msgid "Preinitialize Python with PyPreConfig" -msgstr "" - -#: ../../c-api/init_config.rst:988 -msgid "The preinitialization of Python:" -msgstr "" - -#: ../../c-api/init_config.rst:990 -msgid "Set the Python memory allocators (:c:member:`PyPreConfig.allocator`)" -msgstr "" - -#: ../../c-api/init_config.rst:991 -msgid "Configure the LC_CTYPE locale (:term:`locale encoding`)" -msgstr "" - -#: ../../c-api/init_config.rst:992 -msgid "" -"Set the :ref:`Python UTF-8 Mode ` (:c:member:`PyPreConfig." -"utf8_mode`)" -msgstr "" - -#: ../../c-api/init_config.rst:995 -msgid "" -"The current preconfiguration (``PyPreConfig`` type) is stored in " -"``_PyRuntime.preconfig``." -msgstr "" - -#: ../../c-api/init_config.rst:998 -msgid "Functions to preinitialize Python:" -msgstr "" - -#: ../../c-api/init_config.rst:1002 ../../c-api/init_config.rst:1008 -#: ../../c-api/init_config.rst:1017 -msgid "Preinitialize Python from *preconfig* preconfiguration." -msgstr "" - -#: ../../c-api/init_config.rst:1004 ../../c-api/init_config.rst:1013 -#: ../../c-api/init_config.rst:1022 -msgid "*preconfig* must not be ``NULL``." -msgstr "" - -#: ../../c-api/init_config.rst:1010 -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:1019 -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:1024 ../../c-api/init_config.rst:2041 -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:1027 -msgid "" -"For :ref:`Python Configuration ` (:c:func:" -"`PyPreConfig_InitPythonConfig`), if Python is initialized with command line " -"arguments, the command line arguments must also be passed to preinitialize " -"Python, since they have an effect on the pre-configuration like encodings. " -"For example, the :option:`-X utf8 <-X>` command line option enables the :ref:" -"`Python UTF-8 Mode `." -msgstr "" - -#: ../../c-api/init_config.rst:1034 -msgid "" -"``PyMem_SetAllocator()`` can be called after :c:func:`Py_PreInitialize` and " -"before :c:func:`Py_InitializeFromConfig` to install a custom memory " -"allocator. It can be called before :c:func:`Py_PreInitialize` if :c:member:" -"`PyPreConfig.allocator` is set to ``PYMEM_ALLOCATOR_NOT_SET``." -msgstr "" - -#: ../../c-api/init_config.rst:1039 -msgid "" -"Python memory allocation functions like :c:func:`PyMem_RawMalloc` must not " -"be used before the Python preinitialization, whereas calling directly " -"``malloc()`` and ``free()`` is always safe. :c:func:`Py_DecodeLocale` must " -"not be called before the Python preinitialization." -msgstr "" - -#: ../../c-api/init_config.rst:1044 -msgid "" -"Example using the preinitialization to enable the :ref:`Python UTF-8 Mode " -"`::" -msgstr "" - -#: ../../c-api/init_config.rst:1047 -msgid "" -"PyStatus status;\n" -"PyPreConfig preconfig;\n" -"PyPreConfig_InitPythonConfig(&preconfig);\n" -"\n" -"preconfig.utf8_mode = 1;\n" -"\n" -"status = Py_PreInitialize(&preconfig);\n" -"if (PyStatus_Exception(status)) {\n" -" Py_ExitStatusException(status);\n" -"}\n" -"\n" -"/* at this point, Python speaks UTF-8 */\n" -"\n" -"Py_Initialize();\n" -"/* ... use Python API here ... */\n" -"Py_Finalize();" -msgstr "" - -#: ../../c-api/init_config.rst:1066 -msgid "PyConfig" -msgstr "" - -#: ../../c-api/init_config.rst:1070 -msgid "Structure containing most parameters to configure Python." -msgstr "" - -#: ../../c-api/init_config.rst:1072 -msgid "" -"When done, the :c:func:`PyConfig_Clear` function must be used to release the " -"configuration memory." -msgstr "" - -#: ../../c-api/init_config.rst:1077 -msgid "Structure methods:" -msgstr "" - -#: ../../c-api/init_config.rst:1081 -msgid "" -"Initialize configuration with the :ref:`Python Configuration `." -msgstr "" - -#: ../../c-api/init_config.rst:1086 -msgid "" -"Initialize configuration with the :ref:`Isolated Configuration `." -msgstr "" - -#: ../../c-api/init_config.rst:1091 -msgid "Copy the wide character string *str* into ``*config_str``." -msgstr "" - -#: ../../c-api/init_config.rst:1093 ../../c-api/init_config.rst:1100 -#: ../../c-api/init_config.rst:1107 ../../c-api/init_config.rst:1115 -#: ../../c-api/init_config.rst:1121 ../../c-api/init_config.rst:1138 -msgid ":ref:`Preinitialize Python ` if needed." -msgstr "" - -#: ../../c-api/init_config.rst:1097 -msgid "" -"Decode *str* using :c:func:`Py_DecodeLocale` and set the result into " -"``*config_str``." -msgstr "" - -#: ../../c-api/init_config.rst:1104 -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:1111 -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:1119 -msgid "Set the list of wide strings *list* to *length* and *items*." -msgstr "" - -#: ../../c-api/init_config.rst:1125 -msgid "Read all Python configuration." -msgstr "" - -#: ../../c-api/init_config.rst:1127 -msgid "Fields which are already initialized are left unchanged." -msgstr "" - -#: ../../c-api/init_config.rst:1129 -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:1132 ../../c-api/init_config.rst:1689 -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 " -"arguments are parsed. Since Python arguments are stripped from :c:member:" -"`PyConfig.argv`, parsing arguments twice would parse the application options " -"as Python options." -msgstr "" - -#: ../../c-api/init_config.rst:1140 -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:1146 -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:1154 -msgid "Release configuration memory." -msgstr "" - -#: ../../c-api/init_config.rst:1156 -msgid "" -"Most ``PyConfig`` methods :ref:`preinitialize Python ` if needed. " -"In that case, the Python preinitialization configuration (:c:type:" -"`PyPreConfig`) in based on the :c:type:`PyConfig`. If configuration fields " -"which are in common with :c:type:`PyPreConfig` are tuned, they must be set " -"before calling a :c:type:`PyConfig` method:" -msgstr "" - -#: ../../c-api/init_config.rst:1162 -msgid ":c:member:`PyConfig.dev_mode`" -msgstr "" - -#: ../../c-api/init_config.rst:1163 -msgid ":c:member:`PyConfig.isolated`" -msgstr "" - -#: ../../c-api/init_config.rst:1164 -msgid ":c:member:`PyConfig.parse_argv`" -msgstr "" - -#: ../../c-api/init_config.rst:1165 -msgid ":c:member:`PyConfig.use_environment`" -msgstr "" - -#: ../../c-api/init_config.rst:1167 -msgid "" -"Moreover, if :c:func:`PyConfig_SetArgv` or :c:func:`PyConfig_SetBytesArgv` " -"is used, this method must be called before other methods, since the " -"preinitialization configuration depends on command line arguments (if :c:" -"member:`~PyConfig.parse_argv` is non-zero)." -msgstr "" - -#: ../../c-api/init_config.rst:1172 -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:1185 -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:1193 -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:1198 -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:1201 ../../c-api/init_config.rst:1228 -#: ../../c-api/init_config.rst:1242 ../../c-api/init_config.rst:1252 -#: ../../c-api/init_config.rst:1363 ../../c-api/init_config.rst:1372 -#: ../../c-api/init_config.rst:1383 ../../c-api/init_config.rst:1474 -#: ../../c-api/init_config.rst:1630 ../../c-api/init_config.rst:1731 -#: ../../c-api/init_config.rst:1750 ../../c-api/init_config.rst:1765 -#: ../../c-api/init_config.rst:1782 ../../c-api/init_config.rst:1795 -#: ../../c-api/init_config.rst:1803 ../../c-api/init_config.rst:1817 -#: ../../c-api/init_config.rst:1920 -msgid "Default: ``NULL``." -msgstr "" - -#: ../../c-api/init_config.rst:1203 -msgid "See also the :c:member:`~PyConfig.orig_argv` member." -msgstr "" - -#: ../../c-api/init_config.rst:1207 -msgid "" -"If equals to zero, ``Py_RunMain()`` prepends a potentially unsafe path to :" -"data:`sys.path` at startup:" -msgstr "" - -#: ../../c-api/init_config.rst:1210 -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:1212 -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:1214 -msgid "" -"Otherwise (``python -c code`` and ``python``), prepend an empty string, " -"which means the current working directory." -msgstr "" - -#: ../../c-api/init_config.rst:1217 -msgid "" -"Set to ``1`` by the :option:`-P` command line option and the :envvar:" -"`PYTHONSAFEPATH` environment variable." -msgstr "" - -#: ../../c-api/init_config.rst:1220 -msgid "Default: ``0`` in Python config, ``1`` in isolated config." -msgstr "" - -#: ../../c-api/init_config.rst:1226 -msgid ":data:`sys.base_exec_prefix`." -msgstr ":data:`sys.base_exec_prefix`." - -#: ../../c-api/init_config.rst:1230 ../../c-api/init_config.rst:1244 -#: ../../c-api/init_config.rst:1254 ../../c-api/init_config.rst:1374 -#: ../../c-api/init_config.rst:1385 ../../c-api/init_config.rst:1647 -#: ../../c-api/init_config.rst:1733 -msgid "Part of the :ref:`Python Path Configuration ` output." -msgstr "" - -#: ../../c-api/init_config.rst:1232 -msgid "See also :c:member:`PyConfig.exec_prefix`." -msgstr "" - -#: ../../c-api/init_config.rst:1236 -msgid "Python base executable: :data:`sys._base_executable`." -msgstr "" - -#: ../../c-api/init_config.rst:1238 -msgid "Set by the :envvar:`__PYVENV_LAUNCHER__` environment variable." -msgstr "" - -#: ../../c-api/init_config.rst:1240 -msgid "Set from :c:member:`PyConfig.executable` if ``NULL``." -msgstr "" - -#: ../../c-api/init_config.rst:1246 -msgid "See also :c:member:`PyConfig.executable`." -msgstr "" - -#: ../../c-api/init_config.rst:1250 -msgid ":data:`sys.base_prefix`." -msgstr ":data:`sys.base_prefix`." - -#: ../../c-api/init_config.rst:1256 -msgid "See also :c:member:`PyConfig.prefix`." -msgstr "" - -#: ../../c-api/init_config.rst:1260 -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:1263 -msgid "" -"Set to ``0`` by the :option:`-u` command line option and the :envvar:" -"`PYTHONUNBUFFERED` environment variable." -msgstr "" - -#: ../../c-api/init_config.rst:1266 -msgid "stdin is always opened in buffered mode." -msgstr "" - -#: ../../c-api/init_config.rst:1268 ../../c-api/init_config.rst:1301 -#: ../../c-api/init_config.rst:1845 ../../c-api/init_config.rst:2003 -msgid "Default: ``1``." -msgstr "" - -#: ../../c-api/init_config.rst:1272 -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:1276 -msgid "" -"If equal or greater to ``2``, raise a :exc:`BytesWarning` exception in these " -"cases." -msgstr "" - -#: ../../c-api/init_config.rst:1279 -msgid "Incremented by the :option:`-b` command line option." -msgstr "" - -#: ../../c-api/init_config.rst:1285 -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:1294 -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:1298 -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:1307 -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:1310 -msgid "Valid values:" -msgstr "" - -#: ../../c-api/init_config.rst:1312 -msgid "" -"``L\"always\"``: Hash the source file for invalidation regardless of value " -"of the 'check_source' flag." -msgstr "" - -#: ../../c-api/init_config.rst:1314 -msgid "``L\"never\"``: Assume that hash-based pycs always are valid." -msgstr "" - -#: ../../c-api/init_config.rst:1315 -msgid "" -"``L\"default\"``: The 'check_source' flag in hash-based pycs determines " -"invalidation." -msgstr "" - -#: ../../c-api/init_config.rst:1318 -msgid "Default: ``L\"default\"``." -msgstr "" - -#: ../../c-api/init_config.rst:1320 -msgid "See also :pep:`552` \"Deterministic pycs\"." -msgstr "" - -#: ../../c-api/init_config.rst:1324 -msgid "If non-zero, configure C standard streams:" -msgstr "" - -#: ../../c-api/init_config.rst:1326 -msgid "" -"On Windows, set the binary mode (``O_BINARY``) on stdin, stdout and stderr." -msgstr "" - -#: ../../c-api/init_config.rst:1328 -msgid "" -"If :c:member:`~PyConfig.buffered_stdio` equals zero, disable buffering of " -"stdin, stdout and stderr streams." -msgstr "" - -#: ../../c-api/init_config.rst:1330 -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:1337 -msgid "If non-zero, enable the :ref:`Python Development Mode `." -msgstr "" - -#: ../../c-api/init_config.rst:1339 -msgid "" -"Set to ``1`` by the :option:`-X dev <-X>` option and the :envvar:" -"`PYTHONDEVMODE` environment variable." -msgstr "" - -#: ../../c-api/init_config.rst:1346 -msgid "Dump Python references?" -msgstr "" - -#: ../../c-api/init_config.rst:1348 -msgid "If non-zero, dump all objects which are still alive at exit." -msgstr "" - -#: ../../c-api/init_config.rst:1350 -msgid "Set to ``1`` by the :envvar:`PYTHONDUMPREFS` environment variable." -msgstr "" - -#: ../../c-api/init_config.rst:1352 -msgid "" -"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:1359 -msgid "Filename where to dump Python references." -msgstr "" - -#: ../../c-api/init_config.rst:1361 -msgid "Set by the :envvar:`PYTHONDUMPREFSFILE` environment variable." -msgstr "" - -#: ../../c-api/init_config.rst:1369 -msgid "" -"The site-specific directory prefix where the platform-dependent Python files " -"are installed: :data:`sys.exec_prefix`." -msgstr "" - -#: ../../c-api/init_config.rst:1376 -msgid "See also :c:member:`PyConfig.base_exec_prefix`." -msgstr "" - -#: ../../c-api/init_config.rst:1380 -msgid "" -"The absolute path of the executable binary for the Python interpreter: :data:" -"`sys.executable`." -msgstr "" - -#: ../../c-api/init_config.rst:1387 -msgid "See also :c:member:`PyConfig.base_executable`." -msgstr "" - -#: ../../c-api/init_config.rst:1391 -msgid "Enable faulthandler?" -msgstr "" - -#: ../../c-api/init_config.rst:1393 -msgid "If non-zero, call :func:`faulthandler.enable` at startup." -msgstr "" - -#: ../../c-api/init_config.rst:1395 -msgid "" -"Set to ``1`` by :option:`-X faulthandler <-X>` and the :envvar:" -"`PYTHONFAULTHANDLER` environment variable." -msgstr "" - -#: ../../c-api/init_config.rst:1402 -msgid "" -":term:`Filesystem encoding `: :func:" -"`sys.getfilesystemencoding`." -msgstr "" - -#: ../../c-api/init_config.rst:1405 -msgid "On macOS, Android and VxWorks: use ``\"utf-8\"`` by default." -msgstr "" - -#: ../../c-api/init_config.rst:1407 -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:1411 -msgid "Default encoding on other platforms:" -msgstr "" - -#: ../../c-api/init_config.rst:1413 -msgid "``\"utf-8\"`` if :c:member:`PyPreConfig.utf8_mode` is non-zero." -msgstr "" - -#: ../../c-api/init_config.rst:1414 -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:1417 -msgid "``\"utf-8\"`` if ``nl_langinfo(CODESET)`` returns an empty string." -msgstr "" - -#: ../../c-api/init_config.rst:1418 -msgid "" -"Otherwise, use the :term:`locale encoding`: ``nl_langinfo(CODESET)`` result." -msgstr "" - -#: ../../c-api/init_config.rst:1421 -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:1424 -msgid "See also the :c:member:`~PyConfig.filesystem_errors` member." -msgstr "" - -#: ../../c-api/init_config.rst:1428 -msgid "" -":term:`Filesystem error handler `: :" -"func:`sys.getfilesystemencodeerrors`." -msgstr "" - -#: ../../c-api/init_config.rst:1431 -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:1435 -msgid "On other platforms: use ``\"surrogateescape\"`` by default." -msgstr "" - -#: ../../c-api/init_config.rst:1437 -msgid "Supported error handlers:" -msgstr "" - -#: ../../c-api/init_config.rst:1439 -msgid "``\"strict\"``" -msgstr "" - -#: ../../c-api/init_config.rst:1440 -msgid "``\"surrogateescape\"``" -msgstr "" - -#: ../../c-api/init_config.rst:1441 -msgid "``\"surrogatepass\"`` (only supported with the UTF-8 encoding)" -msgstr "" - -#: ../../c-api/init_config.rst:1443 -msgid "See also the :c:member:`~PyConfig.filesystem_encoding` member." -msgstr "" - -#: ../../c-api/init_config.rst:1447 -msgid "If non-zero, use frozen modules." -msgstr "" - -#: ../../c-api/init_config.rst:1449 -msgid "Set by the :envvar:`PYTHON_FROZEN_MODULES` environment variable." -msgstr "" - -#: ../../c-api/init_config.rst:1451 -msgid "" -"Default: ``1`` in a release build, or ``0`` in a :ref:`debug build `." -msgstr "" - -#: ../../c-api/init_config.rst:1457 -msgid "Randomized hash function seed." -msgstr "" - -#: ../../c-api/init_config.rst:1459 -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:1462 -msgid "Set by the :envvar:`PYTHONHASHSEED` environment variable." -msgstr "" - -#: ../../c-api/init_config.rst:1464 -msgid "" -"Default *use_hash_seed* value: ``-1`` in Python mode, ``0`` in isolated mode." -msgstr "" - -#: ../../c-api/init_config.rst:1469 -msgid "" -"Set the default Python \"home\" directory, that is, the location of the " -"standard Python libraries (see :envvar:`PYTHONHOME`)." -msgstr "" - -#: ../../c-api/init_config.rst:1472 -msgid "Set by the :envvar:`PYTHONHOME` environment variable." -msgstr "" - -#: ../../c-api/init_config.rst:1476 ../../c-api/init_config.rst:1612 -#: ../../c-api/init_config.rst:1632 ../../c-api/init_config.rst:1721 -#: ../../c-api/init_config.rst:1752 -msgid "Part of the :ref:`Python Path Configuration ` input." -msgstr "" - -#: ../../c-api/init_config.rst:1480 -msgid "" -"If ``1``, profile import time. If ``2``, include additional output that " -"indicates when an imported module has already been loaded." -msgstr "" - -#: ../../c-api/init_config.rst:1484 -msgid "" -"Set by the :option:`-X importtime <-X>` option and the :envvar:" -"`PYTHONPROFILEIMPORTTIME` environment variable." -msgstr "" - -#: ../../c-api/init_config.rst:1491 -msgid "Added support for ``import_time = 2``" -msgstr "" - -#: ../../c-api/init_config.rst:1495 -msgid "Enter interactive mode after executing a script or a command." -msgstr "" - -#: ../../c-api/init_config.rst:1497 -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 " -"the script or the command, even when :data:`sys.stdin` does not appear to be " -"a terminal." -msgstr "" - -#: ../../c-api/init_config.rst:1502 -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:1509 -msgid "Install Python signal handlers?" -msgstr "" - -#: ../../c-api/init_config.rst:1511 ../../c-api/init_config.rst:1695 -#: ../../c-api/init_config.rst:1719 ../../c-api/init_config.rst:1955 -msgid "Default: ``1`` in Python mode, ``0`` in isolated mode." +#: ../../c-api/init_config.rst:214 +msgid "Name of the memory allocator:" msgstr "" -#: ../../c-api/init_config.rst:1515 -msgid "If greater than ``0``, enable the interactive mode (REPL)." +#: ../../c-api/init_config.rst:216 +msgid "" +"``PYMEM_ALLOCATOR_NOT_SET`` (``0``): don't change memory allocators (use " +"defaults)" msgstr "" -#: ../../c-api/init_config.rst:1517 -msgid "Incremented by the :option:`-i` command line option." +#: ../../c-api/init_config.rst:218 +msgid "``PYMEM_ALLOCATOR_DEFAULT`` (``1``): default memory allocators" msgstr "" -#: ../../c-api/init_config.rst:1523 +#: ../../c-api/init_config.rst:219 msgid "" -"Configures the :ref:`integer string conversion length limitation " -"`. An initial value of ``-1`` means the value will be " -"taken from the command line or environment or otherwise default to 4300 (:" -"data:`sys.int_info.default_max_str_digits`). A value of ``0`` disables the " -"limitation. Values greater than zero but less than 640 (:data:`sys.int_info." -"str_digits_check_threshold`) are unsupported and will produce an error." +"``PYMEM_ALLOCATOR_DEBUG`` (``2``): default memory allocators with debug hooks" msgstr "" -#: ../../c-api/init_config.rst:1531 -msgid "" -"Configured by the :option:`-X int_max_str_digits <-X>` command line flag or " -"the :envvar:`PYTHONINTMAXSTRDIGITS` environment variable." +#: ../../c-api/init_config.rst:221 +msgid "``PYMEM_ALLOCATOR_MALLOC`` (``3``): force usage of ``malloc()``" msgstr "" -#: ../../c-api/init_config.rst:1534 +#: ../../c-api/init_config.rst:222 msgid "" -"Default: ``-1`` in Python mode. 4300 (:data:`sys.int_info." -"default_max_str_digits`) in isolated mode." +"``PYMEM_ALLOCATOR_MALLOC_DEBUG`` (``4``): force usage of ``malloc()`` with " +"debug hooks" msgstr "" -#: ../../c-api/init_config.rst:1541 +#: ../../c-api/init_config.rst:224 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`." +"``PYMEM_ALLOCATOR_PYMALLOC`` (``5``): :ref:`Python pymalloc memory allocator " +"`" msgstr "" -#: ../../c-api/init_config.rst:1545 +#: ../../c-api/init_config.rst:226 msgid "" -"Configured by the :samp:`-X cpu_count={n|default}` command line flag or the :" -"envvar:`PYTHON_CPU_COUNT` environment variable." +"``PYMEM_ALLOCATOR_PYMALLOC_DEBUG`` (``6``): :ref:`Python pymalloc memory " +"allocator ` with debug hooks" msgstr "" -#: ../../c-api/init_config.rst:1548 ../../c-api/init_config.rst:1909 -msgid "Default: ``-1``." +#: ../../c-api/init_config.rst:229 +msgid "" +"``PYMEM_ALLOCATOR_PYMALLOC`` and ``PYMEM_ALLOCATOR_PYMALLOC_DEBUG`` are not " +"supported if Python is configured using ``--without-pymalloc``" msgstr "" -#: ../../c-api/init_config.rst:1554 -msgid "If greater than ``0``, enable isolated mode:" +#: ../../c-api/init_config.rst:232 +msgid "See :ref:`Memory Management `." msgstr "" -#: ../../c-api/init_config.rst:1556 +#: ../../c-api/init_config.rst:236 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." +"Set the LC_CTYPE locale to the user preferred locale? If equals to 0, set :c:" +"member:`coerce_c_locale` and :c:member:`coerce_c_locale_warn` to 0." msgstr "" -#: ../../c-api/init_config.rst:1560 +#: ../../c-api/init_config.rst:241 msgid "" -"Set :c:member:`~PyConfig.use_environment` to ``0``: ignore ``PYTHON`` " -"environment variables." +"If equals to 2, coerce the C locale; if equals to 1, read the LC_CTYPE " +"locale to decide if it should be coerced." msgstr "" -#: ../../c-api/init_config.rst:1562 -msgid "" -"Set :c:member:`~PyConfig.user_site_directory` to ``0``: don't add the user " -"site directory to :data:`sys.path`." +#: ../../c-api/init_config.rst:246 +msgid "If non-zero, emit a warning if the C locale is coerced." msgstr "" -#: ../../c-api/init_config.rst:1564 -msgid "" -"Python REPL doesn't import :mod:`readline` nor enable default readline " -"configuration on interactive prompts." +#: ../../c-api/init_config.rst:250 +msgid "See :c:member:`PyConfig.dev_mode`." msgstr "" -#: ../../c-api/init_config.rst:1567 -msgid "Set to ``1`` by the :option:`-I` command line option." +#: ../../c-api/init_config.rst:254 +msgid "See :c:member:`PyConfig.isolated`." msgstr "" -#: ../../c-api/init_config.rst:1571 +#: ../../c-api/init_config.rst:258 msgid "" -"See also the :ref:`Isolated Configuration ` and :c:" -"member:`PyPreConfig.isolated`." +"If non-zero, disable UTF-8 Mode, set the Python filesystem encoding to " +"``mbcs``, set the filesystem error handler to ``replace``." msgstr "" -#: ../../c-api/init_config.rst:1576 +#: ../../c-api/init_config.rst:261 ../../c-api/init_config.rst:555 msgid "" -"If non-zero, use :class:`io.FileIO` instead of :class:`!io." -"_WindowsConsoleIO` for :data:`sys.stdin`, :data:`sys.stdout` and :data:`sys." -"stderr`." +"Only available on Windows. ``#ifdef MS_WINDOWS`` macro can be used for " +"Windows specific code." msgstr "" -#: ../../c-api/init_config.rst:1580 +#: ../../c-api/init_config.rst:266 msgid "" -"Set to ``1`` if the :envvar:`PYTHONLEGACYWINDOWSSTDIO` environment variable " -"is set to a non-empty string." -msgstr "" -":envvar:`PYTHONLEGACYWINDOWSSTDIO` 環境変数が空でない文字列に設定された場合" -"に、 ``1`` に設定されます。" - -#: ../../c-api/init_config.rst:1588 -msgid "See also the :pep:`528` (Change Windows console encoding to UTF-8)." +"If non-zero, :c:func:`Py_PreInitializeFromArgs` and :c:func:" +"`Py_PreInitializeFromBytesArgs` parse their ``argv`` argument the same way " +"the regular Python parses command line arguments: see :ref:`Command Line " +"Arguments `." msgstr "" -#: ../../c-api/init_config.rst:1592 -msgid "" -"If non-zero, dump statistics on :ref:`Python pymalloc memory allocator " -"` at exit." +#: ../../c-api/init_config.rst:273 +msgid "See :c:member:`PyConfig.use_environment`." msgstr "" -#: ../../c-api/init_config.rst:1595 -msgid "Set to ``1`` by the :envvar:`PYTHONMALLOCSTATS` environment variable." +#: ../../c-api/init_config.rst:277 +msgid "If non-zero, enable the UTF-8 mode." msgstr "" -#: ../../c-api/init_config.rst:1597 -msgid "" -"The option is ignored if Python is :option:`configured using the --without-" -"pymalloc option <--without-pymalloc>`." +#: ../../c-api/init_config.rst:280 +msgid "Preinitialization with PyPreConfig" msgstr "" -#: ../../c-api/init_config.rst:1604 -msgid "Platform library directory name: :data:`sys.platlibdir`." +#: ../../c-api/init_config.rst:282 +msgid "Functions to preinitialize Python:" msgstr "" -#: ../../c-api/init_config.rst:1606 -msgid "Set by the :envvar:`PYTHONPLATLIBDIR` environment variable." +#: ../../c-api/init_config.rst:286 +msgid "Preinitialize Python from *preconfig* preconfiguration." msgstr "" -#: ../../c-api/init_config.rst:1608 +#: ../../c-api/init_config.rst:290 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)." +"Preinitialize Python from *preconfig* preconfiguration and command line " +"arguments (bytes strings)." msgstr "" -#: ../../c-api/init_config.rst:1616 +#: ../../c-api/init_config.rst:295 msgid "" -"This macro is now used on Windows to locate the standard library extension " -"modules, typically under ``DLLs``. However, for compatibility, note that " -"this value is ignored for any non-standard layouts, including in-tree builds " -"and virtual environments." +"Preinitialize Python from *preconfig* preconfiguration and command line " +"arguments (wide strings)." msgstr "" -#: ../../c-api/init_config.rst:1625 +#: ../../c-api/init_config.rst:298 ../../c-api/init_config.rst:730 msgid "" -"Module search paths (:data:`sys.path`) as a string separated by ``DELIM`` (:" -"data:`os.pathsep`)." -msgstr "" - -#: ../../c-api/init_config.rst:1628 -msgid "Set by the :envvar:`PYTHONPATH` environment variable." +"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:1637 -msgid "Module search paths: :data:`sys.path`." +#: ../../c-api/init_config.rst:301 +msgid "" +"For :ref:`Python Configuration ` (:c:func:" +"`PyPreConfig_InitPythonConfig`), if Python is initialized with command line " +"arguments, the command line arguments must also be passed to preinitialize " +"Python, since they have an effect on the pre-configuration like encodings. " +"For example, the :option:`-X utf8 <-X>` command line option enables the " +"UTF-8 Mode." msgstr "" -#: ../../c-api/init_config.rst:1639 +#: ../../c-api/init_config.rst:308 msgid "" -"If :c:member:`~PyConfig.module_search_paths_set` is equal to ``0``, :c:func:" -"`Py_InitializeFromConfig` will replace :c:member:`~PyConfig." -"module_search_paths` and sets :c:member:`~PyConfig.module_search_paths_set` " -"to ``1``." +"``PyMem_SetAllocator()`` can be called after :c:func:`Py_PreInitialize` and " +"before :c:func:`Py_InitializeFromConfig` to install a custom memory " +"allocator. It can be called before :c:func:`Py_PreInitialize` if :c:member:" +"`PyPreConfig.allocator` is set to ``PYMEM_ALLOCATOR_NOT_SET``." msgstr "" -#: ../../c-api/init_config.rst:1644 +#: ../../c-api/init_config.rst:313 msgid "" -"Default: empty list (``module_search_paths``) and ``0`` " -"(``module_search_paths_set``)." +"Python memory allocation functions like :c:func:`PyMem_RawMalloc` must not " +"be used before Python preinitialization, whereas calling directly " +"``malloc()`` and ``free()`` is always safe. :c:func:`Py_DecodeLocale` must " +"not be called before the preinitialization." msgstr "" -#: ../../c-api/init_config.rst:1651 -msgid "Compilation optimization level:" +#: ../../c-api/init_config.rst:318 +msgid "Example using the preinitialization to enable the UTF-8 Mode::" msgstr "" -#: ../../c-api/init_config.rst:1653 -msgid "``0``: Peephole optimizer, set ``__debug__`` to ``True``." +#: ../../c-api/init_config.rst:339 +msgid "PyConfig" msgstr "" -#: ../../c-api/init_config.rst:1654 -msgid "``1``: Level 0, remove assertions, set ``__debug__`` to ``False``." +#: ../../c-api/init_config.rst:343 +msgid "Structure containing most parameters to configure Python." msgstr "" -#: ../../c-api/init_config.rst:1655 -msgid "``2``: Level 1, strip docstrings." +#: ../../c-api/init_config.rst:345 +msgid "Structure methods:" msgstr "" -#: ../../c-api/init_config.rst:1657 +#: ../../c-api/init_config.rst:349 msgid "" -"Incremented by the :option:`-O` command line option. Set to the :envvar:" -"`PYTHONOPTIMIZE` environment variable value." +"Initialize configuration with :ref:`Python Configuration `." msgstr "" -#: ../../c-api/init_config.rst:1664 +#: ../../c-api/init_config.rst:354 msgid "" -"The list of the original command line arguments passed to the Python " -"executable: :data:`sys.orig_argv`." +"Initialize configuration with :ref:`Isolated Configuration `." msgstr "" -#: ../../c-api/init_config.rst:1667 -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` " -"copies :c:member:`~PyConfig.argv` into :c:member:`~PyConfig.orig_argv` " -"before modifying :c:member:`~PyConfig.argv` (if :c:member:`~PyConfig." -"parse_argv` is non-zero)." +#: ../../c-api/init_config.rst:359 +msgid "Copy the wide character string *str* into ``*config_str``." msgstr "" -#: ../../c-api/init_config.rst:1674 -msgid "" -"See also the :c:member:`~PyConfig.argv` member and the :c:func:" -"`Py_GetArgcArgv` function." +#: ../../c-api/init_config.rst:361 ../../c-api/init_config.rst:367 +#: ../../c-api/init_config.rst:373 ../../c-api/init_config.rst:379 +#: ../../c-api/init_config.rst:385 ../../c-api/init_config.rst:393 +msgid "Preinitialize Python if needed." msgstr "" -#: ../../c-api/init_config.rst:1677 ../../c-api/init_config.rst:1990 -#: ../../c-api/init_config.rst:2009 -msgid "Default: empty list." +#: ../../c-api/init_config.rst:365 +msgid "" +"Decode *str* using ``Py_DecodeLocale()`` and set the result into " +"``*config_str``." msgstr "" -#: ../../c-api/init_config.rst:1683 -msgid "Parse command line arguments?" +#: ../../c-api/init_config.rst:371 +msgid "Set command line arguments from wide character strings." msgstr "" -#: ../../c-api/init_config.rst:1685 +#: ../../c-api/init_config.rst:377 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`." +"Set command line arguments: decode bytes using :c:func:`Py_DecodeLocale`." msgstr "" -#: ../../c-api/init_config.rst:1697 -msgid "" -"The :c:member:`PyConfig.argv` arguments are now only parsed if :c:member:" -"`PyConfig.parse_argv` equals to ``1``." +#: ../../c-api/init_config.rst:383 +msgid "Set the list of wide strings *list* to *length* and *items*." msgstr "" -#: ../../c-api/init_config.rst:1703 -msgid "" -"Parser debug mode. If greater than ``0``, turn on parser debugging output " -"(for expert only, depending on compilation options)." +#: ../../c-api/init_config.rst:389 +msgid "Read all Python configuration." msgstr "" -#: ../../c-api/init_config.rst:1706 -msgid "" -"Incremented by the :option:`-d` command line option. Set to the :envvar:" -"`PYTHONDEBUG` environment variable value." +#: ../../c-api/init_config.rst:391 +msgid "Fields which are already initialized are left unchanged." msgstr "" -#: ../../c-api/init_config.rst:1709 ../../c-api/init_config.rst:1814 -msgid "" -"Needs a :ref:`debug build of Python ` (the ``Py_DEBUG`` macro " -"must be defined)." +#: ../../c-api/init_config.rst:397 +msgid "Release configuration memory." msgstr "" -#: ../../c-api/init_config.rst:1716 +#: ../../c-api/init_config.rst:399 msgid "" -"If non-zero, calculation of path configuration is allowed to log warnings " -"into ``stderr``. If equals to ``0``, suppress these warnings." +"Most ``PyConfig`` methods preinitialize Python if needed. In that case, the " +"Python preinitialization configuration in based on the :c:type:`PyConfig`. " +"If configuration fields which are in common with :c:type:`PyPreConfig` are " +"tuned, they must be set before calling a :c:type:`PyConfig` method:" msgstr "" -#: ../../c-api/init_config.rst:1723 -msgid "Now also applies on Windows." -msgstr "" +#: ../../c-api/init_config.rst:404 +msgid ":c:member:`~PyConfig.dev_mode`" +msgstr ":c:member:`~PyConfig.dev_mode`" -#: ../../c-api/init_config.rst:1728 -msgid "" -"The site-specific directory prefix where the platform independent Python " -"files are installed: :data:`sys.prefix`." -msgstr "" +#: ../../c-api/init_config.rst:405 +msgid ":c:member:`~PyConfig.isolated`" +msgstr ":c:member:`~PyConfig.isolated`" -#: ../../c-api/init_config.rst:1735 -msgid "See also :c:member:`PyConfig.base_prefix`." -msgstr "" +#: ../../c-api/init_config.rst:406 +msgid ":c:member:`~PyConfig.parse_argv`" +msgstr ":c:member:`~PyConfig.parse_argv`" -#: ../../c-api/init_config.rst:1739 -msgid "" -"Program name used to initialize :c:member:`~PyConfig.executable` and in " -"early error messages during Python initialization." -msgstr "" +#: ../../c-api/init_config.rst:407 +msgid ":c:member:`~PyConfig.use_environment`" +msgstr ":c:member:`~PyConfig.use_environment`" -#: ../../c-api/init_config.rst:1742 -msgid "On macOS, use :envvar:`PYTHONEXECUTABLE` environment variable if set." +#: ../../c-api/init_config.rst:409 +msgid "" +"Moreover, if :c:func:`PyConfig_SetArgv` or :c:func:`PyConfig_SetBytesArgv` " +"is used, this method must be called first, before other methods, since the " +"preinitialization configuration depends on command line arguments (if :c:" +"member:`parse_argv` is non-zero)." msgstr "" -#: ../../c-api/init_config.rst:1743 +#: ../../c-api/init_config.rst:414 msgid "" -"If the ``WITH_NEXT_FRAMEWORK`` macro is defined, use :envvar:" -"`__PYVENV_LAUNCHER__` environment variable if set." +"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:1745 +#: ../../c-api/init_config.rst:421 msgid "" -"Use ``argv[0]`` of :c:member:`~PyConfig.argv` if available and non-empty." +"Command line arguments, :data:`sys.argv`. See :c:member:`~PyConfig." +"parse_argv` to parse :c:member:`~PyConfig.argv` the same way the regular " +"Python parses Python command line arguments. 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:1747 +#: ../../c-api/init_config.rst:429 +msgid ":data:`sys.base_exec_prefix`." +msgstr ":data:`sys.base_exec_prefix`." + +#: ../../c-api/init_config.rst:433 msgid "" -"Otherwise, use ``L\"python\"`` on Windows, or ``L\"python3\"`` on other " -"platforms." +":data:`sys._base_executable`: ``__PYVENV_LAUNCHER__`` environment variable " +"value, or copy of :c:member:`PyConfig.executable`." msgstr "" -#: ../../c-api/init_config.rst:1756 +#: ../../c-api/init_config.rst:438 +msgid ":data:`sys.base_prefix`." +msgstr ":data:`sys.base_prefix`." + +#: ../../c-api/init_config.rst:442 msgid "" -"Directory where cached ``.pyc`` files are written: :data:`sys." -"pycache_prefix`." +":data:`sys.platlibdir`: platform library directory name, set at configure " +"time by ``--with-platlibdir``, overrideable by the ``PYTHONPLATLIBDIR`` " +"environment variable." msgstr "" -#: ../../c-api/init_config.rst:1759 +#: ../../c-api/init_config.rst:450 msgid "" -"Set by the :option:`-X pycache_prefix=PATH <-X>` command line option and " -"the :envvar:`PYTHONPYCACHEPREFIX` environment variable. The command-line " -"option takes precedence." +"If equals to 0, enable unbuffered mode, making the stdout and stderr streams " +"unbuffered." msgstr "" -#: ../../c-api/init_config.rst:1763 -msgid "If ``NULL``, :data:`sys.pycache_prefix` is set to ``None``." +#: ../../c-api/init_config.rst:453 +msgid "stdin is always opened in buffered mode." msgstr "" -#: ../../c-api/init_config.rst:1769 +#: ../../c-api/init_config.rst:457 msgid "" -"Quiet mode. If greater than ``0``, don't display the copyright and version " -"at Python startup in interactive mode." +"If equals to 1, issue a warning when comparing :class:`bytes` or :class:" +"`bytearray` with :class:`str`, or comparing :class:`bytes` with :class:" +"`int`. If equal or greater to 2, raise a :exc:`BytesWarning` exception." msgstr "" -#: ../../c-api/init_config.rst:1772 -msgid "Incremented by the :option:`-q` command line option." +#: ../../c-api/init_config.rst:464 +msgid "" +"Control the validation behavior of hash-based ``.pyc`` files (see :pep:" +"`552`): :option:`--check-hash-based-pycs` command line option value." msgstr "" -#: ../../c-api/init_config.rst:1778 -msgid "Value of the :option:`-c` command line option." +#: ../../c-api/init_config.rst:467 +msgid "Valid values: ``always``, ``never`` and ``default``." msgstr "" -#: ../../c-api/init_config.rst:1780 ../../c-api/init_config.rst:1801 -msgid "Used by :c:func:`Py_RunMain`." +#: ../../c-api/init_config.rst:469 +msgid "The default value is: ``default``." msgstr "" -#: ../../c-api/init_config.rst:1786 +#: ../../c-api/init_config.rst:473 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." +"If non-zero, configure C standard streams (``stdio``, ``stdout``, " +"``stdout``). For example, set their mode to ``O_BINARY`` on Windows." msgstr "" -#: ../../c-api/init_config.rst:1790 -msgid "" -"For example, it is set to ``script.py`` by the ``python3 script.py arg`` " -"command line." +#: ../../c-api/init_config.rst:478 +msgid "If non-zero, enable the :ref:`Python Development Mode `." msgstr "" -#: ../../c-api/init_config.rst:1793 -msgid "See also the :c:member:`PyConfig.skip_source_first_line` option." +#: ../../c-api/init_config.rst:482 +msgid "If non-zero, dump all objects which are still alive at exit." msgstr "" -#: ../../c-api/init_config.rst:1799 -msgid "Value of the :option:`-m` command line option." +#: ../../c-api/init_config.rst:484 +msgid "``Py_TRACE_REFS`` macro must be defined in build." msgstr "" -#: ../../c-api/init_config.rst:1807 -msgid "" -"``package.module`` path to module that should be imported before ``site.py`` " -"is run." +#: ../../c-api/init_config.rst:488 +msgid ":data:`sys.exec_prefix`." +msgstr ":data:`sys.exec_prefix`." + +#: ../../c-api/init_config.rst:492 +msgid ":data:`sys.executable`." +msgstr ":data:`sys.executable`." + +#: ../../c-api/init_config.rst:496 +msgid "If non-zero, call :func:`faulthandler.enable` at startup." msgstr "" -#: ../../c-api/init_config.rst:1810 -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." +#: ../../c-api/init_config.rst:500 +msgid "Filesystem encoding, :func:`sys.getfilesystemencoding`." msgstr "" -#: ../../c-api/init_config.rst:1821 -msgid "" -"Show total reference count at exit (excluding :term:`immortal` objects)?" +#: ../../c-api/init_config.rst:504 +msgid "Filesystem encoding errors, :func:`sys.getfilesystemencodeerrors`." msgstr "" -#: ../../c-api/init_config.rst:1823 -msgid "Set to ``1`` by :option:`-X showrefcount <-X>` command line option." +#: ../../c-api/init_config.rst:509 +msgid "Randomized hash function seed." msgstr "" -#: ../../c-api/init_config.rst:1825 +#: ../../c-api/init_config.rst:511 msgid "" -"Needs a :ref:`debug build of Python ` (the ``Py_REF_DEBUG`` " -"macro must be defined)." +"If :c:member:`~PyConfig.use_hash_seed` is zero, a seed is chosen randomly at " +"Pythonstartup, and :c:member:`~PyConfig.hash_seed` is ignored." msgstr "" -#: ../../c-api/init_config.rst:1832 -msgid "Import the :mod:`site` module at startup?" +#: ../../c-api/init_config.rst:516 +msgid "Python home directory." msgstr "" -#: ../../c-api/init_config.rst:1834 +#: ../../c-api/init_config.rst:518 msgid "" -"If equal to zero, disable the import of the module site and the site-" -"dependent manipulations of :data:`sys.path` that it entails." +"Initialized from :envvar:`PYTHONHOME` environment variable value by default." msgstr "" -#: ../../c-api/init_config.rst:1837 -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)." +#: ../../c-api/init_config.rst:523 +msgid "If non-zero, profile import time." msgstr "" -#: ../../c-api/init_config.rst:1840 -msgid "Set to ``0`` by the :option:`-S` command line option." +#: ../../c-api/init_config.rst:527 +msgid "Enter interactive mode after executing a script or a command." msgstr "" -#: ../../c-api/init_config.rst:1842 -msgid "" -":data:`sys.flags.no_site ` is set to the inverted value of :c:" -"member:`~PyConfig.site_import`." +#: ../../c-api/init_config.rst:531 +msgid "Install signal handlers?" msgstr "" -#: ../../c-api/init_config.rst:1849 -msgid "" -"If non-zero, skip the first line of the :c:member:`PyConfig.run_filename` " -"source." +#: ../../c-api/init_config.rst:535 +msgid "Interactive mode." msgstr "" -#: ../../c-api/init_config.rst:1852 -msgid "" -"It allows the usage of non-Unix forms of ``#!cmd``. This is intended for a " -"DOS specific hack only." +#: ../../c-api/init_config.rst:539 +msgid "If greater than 0, enable isolated mode:" msgstr "" -#: ../../c-api/init_config.rst:1855 -msgid "Set to ``1`` by the :option:`-x` command line option." +#: ../../c-api/init_config.rst:541 +msgid "" +":data:`sys.path` contains neither the script's directory (computed from " +"``argv[0]`` or the current directory) nor the user's site-packages directory." msgstr "" -#: ../../c-api/init_config.rst:1862 +#: ../../c-api/init_config.rst:544 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)." +"Python REPL doesn't import :mod:`readline` nor enable default readline " +"configuration on interactive prompts." msgstr "" -#: ../../c-api/init_config.rst:1866 +#: ../../c-api/init_config.rst:546 msgid "" -"Use the :envvar:`PYTHONIOENCODING` environment variable if it is non-empty." +"Set :c:member:`~PyConfig.use_environment` and :c:member:`~PyConfig." +"user_site_directory` to 0." msgstr "" -#: ../../c-api/init_config.rst:1869 -msgid "Default encoding:" +#: ../../c-api/init_config.rst:551 +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:1871 -msgid "``\"UTF-8\"`` if :c:member:`PyPreConfig.utf8_mode` is non-zero." +#: ../../c-api/init_config.rst:560 +msgid "" +"If non-zero, dump statistics on :ref:`Python pymalloc memory allocator " +"` at exit." msgstr "" -#: ../../c-api/init_config.rst:1872 -msgid "Otherwise, use the :term:`locale encoding`." +#: ../../c-api/init_config.rst:563 +msgid "The option is ignored if Python is built using ``--without-pymalloc``." msgstr "" -#: ../../c-api/init_config.rst:1874 -msgid "Default error handler:" +#: ../../c-api/init_config.rst:567 +msgid "" +"Module search paths as a string separated by ``DELIM`` (:data:`os.path." +"pathsep`)." msgstr "" -#: ../../c-api/init_config.rst:1876 -msgid "On Windows: use ``\"surrogateescape\"``." +#: ../../c-api/init_config.rst:570 +msgid "" +"Initialized from :envvar:`PYTHONPATH` environment variable value by default." msgstr "" -#: ../../c-api/init_config.rst:1877 +#: ../../c-api/init_config.rst:576 msgid "" -"``\"surrogateescape\"`` if :c:member:`PyPreConfig.utf8_mode` is non-zero, or " -"if the LC_CTYPE locale is \"C\" or \"POSIX\"." +":data:`sys.path`. If :c:member:`~PyConfig.module_search_paths_set` is equal " +"to 0, the :c:member:`~PyConfig.module_search_paths` is overridden by the " +"function calculating the :ref:`Path Configuration `." msgstr "" -#: ../../c-api/init_config.rst:1879 -msgid "``\"strict\"`` otherwise." +#: ../../c-api/init_config.rst:583 +msgid "Compilation optimization level:" msgstr "" -#: ../../c-api/init_config.rst:1881 -msgid "See also :c:member:`PyConfig.legacy_windows_stdio`." +#: ../../c-api/init_config.rst:585 +msgid "0: Peephole optimizer (and ``__debug__`` is set to ``True``)" msgstr "" -#: ../../c-api/init_config.rst:1885 -msgid "Enable tracemalloc?" +#: ../../c-api/init_config.rst:586 +msgid "1: Remove assertions, set ``__debug__`` to ``False``" msgstr "" -#: ../../c-api/init_config.rst:1887 -msgid "If non-zero, call :func:`tracemalloc.start` at startup." +#: ../../c-api/init_config.rst:587 +msgid "2: Strip docstrings" msgstr "" -#: ../../c-api/init_config.rst:1889 +#: ../../c-api/init_config.rst:591 msgid "" -"Set by :option:`-X tracemalloc=N <-X>` command line option and by the :" -"envvar:`PYTHONTRACEMALLOC` environment variable." -msgstr "" - -#: ../../c-api/init_config.rst:1896 -msgid "Enable the Linux ``perf`` profiler support?" +"If non-zero, parse :c:member:`~PyConfig.argv` the same way the regular " +"Python command line arguments, and strip Python arguments from :c:member:" +"`~PyConfig.argv`: see :ref:`Command Line Arguments `." msgstr "" -#: ../../c-api/init_config.rst:1898 -msgid "If equals to ``1``, enable support for the Linux ``perf`` profiler." -msgstr "" - -#: ../../c-api/init_config.rst:1900 +#: ../../c-api/init_config.rst:598 msgid "" -"If equals to ``2``, enable support for the Linux ``perf`` profiler with " -"DWARF JIT support." +"If non-zero, turn on parser debugging output (for expert only, depending on " +"compilation options)." msgstr "" -#: ../../c-api/init_config.rst:1903 +#: ../../c-api/init_config.rst:603 msgid "" -"Set to ``1`` by :option:`-X perf <-X>` command-line option and the :envvar:" -"`PYTHONPERFSUPPORT` environment variable." +"If equal to 0, suppress warnings when calculating the :ref:`Path " +"Configuration ` (Unix only, Windows does not log any " +"warning). Otherwise, warnings are written into ``stderr``." msgstr "" -#: ../../c-api/init_config.rst:1906 -msgid "" -"Set to ``2`` by the :option:`-X perf_jit <-X>` command-line option and the :" -"envvar:`PYTHON_PERF_JIT_SUPPORT` environment variable." -msgstr "" +#: ../../c-api/init_config.rst:609 +msgid ":data:`sys.prefix`." +msgstr ":data:`sys.prefix`." -#: ../../c-api/init_config.rst:1912 -msgid "See :ref:`perf_profiling` for more information." +#: ../../c-api/init_config.rst:613 +msgid "" +"Program name. Used to initialize :c:member:`~PyConfig.executable`, and in " +"early error messages." msgstr "" -#: ../../c-api/init_config.rst:1918 -msgid "Directory of the Python standard library." +#: ../../c-api/init_config.rst:618 +msgid ":data:`sys.pycache_prefix`: ``.pyc`` cache prefix." msgstr "" -#: ../../c-api/init_config.rst:1926 -msgid "Use :ref:`environment variables `?" +#: ../../c-api/init_config.rst:620 +msgid "If ``NULL``, :data:`sys.pycache_prefix` is set to ``None``." msgstr "" -#: ../../c-api/init_config.rst:1928 +#: ../../c-api/init_config.rst:624 msgid "" -"If equals to zero, ignore the :ref:`environment variables `." +"Quiet mode. For example, don't display the copyright and version messages in " +"interactive mode." msgstr "" -#: ../../c-api/init_config.rst:1931 -msgid "Set to ``0`` by the :option:`-E` environment variable." +#: ../../c-api/init_config.rst:629 +msgid "``python3 -c COMMAND`` argument. Used by :c:func:`Py_RunMain`." msgstr "" -#: ../../c-api/init_config.rst:1937 -msgid "" -"If non-zero, ``stdout`` and ``stderr`` will be redirected to the system log." +#: ../../c-api/init_config.rst:633 +msgid "``python3 FILENAME`` argument. Used by :c:func:`Py_RunMain`." msgstr "" -#: ../../c-api/init_config.rst:1940 -msgid "Only available on macOS 10.12 and later, and on iOS." +#: ../../c-api/init_config.rst:637 +msgid "``python3 -m MODULE`` argument. Used by :c:func:`Py_RunMain`." msgstr "" -#: ../../c-api/init_config.rst:1942 -msgid "" -"Default: ``0`` (don't use the system log) on macOS; ``1`` on iOS (use the " -"system log)." +#: ../../c-api/init_config.rst:641 +msgid "Show total reference count at exit?" msgstr "" -#: ../../c-api/init_config.rst:1949 -msgid "If non-zero, add the user site directory to :data:`sys.path`." +#: ../../c-api/init_config.rst:643 +msgid "Set to 1 by :option:`-X showrefcount <-X>` command line option." msgstr "" -#: ../../c-api/init_config.rst:1951 -msgid "Set to ``0`` by the :option:`-s` and :option:`-I` command line options." +#: ../../c-api/init_config.rst:645 +msgid "Need a debug build of Python (``Py_REF_DEBUG`` macro must be defined)." msgstr "" -#: ../../c-api/init_config.rst:1953 -msgid "Set to ``0`` by the :envvar:`PYTHONNOUSERSITE` environment variable." +#: ../../c-api/init_config.rst:649 +msgid "Import the :mod:`site` module at startup?" msgstr "" -#: ../../c-api/init_config.rst:1959 -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." +#: ../../c-api/init_config.rst:653 +msgid "Skip the first line of the source?" msgstr "" -#: ../../c-api/init_config.rst:1963 +#: ../../c-api/init_config.rst:658 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:1967 -msgid "Incremented by the :option:`-v` command line option." +"Encoding and encoding errors of :data:`sys.stdin`, :data:`sys.stdout` and :" +"data:`sys.stderr`." msgstr "" -#: ../../c-api/init_config.rst:1969 -msgid "Set by the :envvar:`PYTHONVERBOSE` environment variable value." +#: ../../c-api/init_config.rst:663 +msgid "If non-zero, call :func:`tracemalloc.start` at startup." msgstr "" -#: ../../c-api/init_config.rst:1975 -msgid "" -"Options of the :mod:`warnings` module to build warnings filters, lowest to " -"highest priority: :data:`sys.warnoptions`." +#: ../../c-api/init_config.rst:667 +msgid "If greater than 0, use :ref:`environment variables `." msgstr "" -#: ../../c-api/init_config.rst:1978 -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)." +#: ../../c-api/init_config.rst:671 +msgid "If non-zero, add user site directory to :data:`sys.path`." msgstr "" -#: ../../c-api/init_config.rst:1983 -msgid "" -"The :option:`-W` command line options adds its value to :c:member:`~PyConfig." -"warnoptions`, it can be used multiple times." +#: ../../c-api/init_config.rst:675 +msgid "If non-zero, enable verbose mode." msgstr "" -#: ../../c-api/init_config.rst:1986 +#: ../../c-api/init_config.rst:679 msgid "" -"The :envvar:`PYTHONWARNINGS` environment variable can also be used to add " -"warning options. Multiple options can be specified, separated by commas (``," -"``)." +":data:`sys.warnoptions`: options of the :mod:`warnings` module to build " +"warnings filters: lowest to highest priority." msgstr "" -#: ../../c-api/init_config.rst:1994 +#: ../../c-api/init_config.rst:682 msgid "" -"If equal to ``0``, Python won't try to write ``.pyc`` files on the import of " -"source modules." +"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:1997 -msgid "" -"Set to ``0`` by the :option:`-B` command line option and the :envvar:" -"`PYTHONDONTWRITEBYTECODE` environment variable." +#: ../../c-api/init_config.rst:689 +msgid "If non-zero, write ``.pyc`` files." msgstr "" -#: ../../c-api/init_config.rst:2000 +#: ../../c-api/init_config.rst:691 msgid "" ":data:`sys.dont_write_bytecode` is initialized to the inverted value of :c:" "member:`~PyConfig.write_bytecode`." msgstr "" -#: ../../c-api/init_config.rst:2007 -msgid "Values of the :option:`-X` command line options: :data:`sys._xoptions`." +#: ../../c-api/init_config.rst:696 +msgid ":data:`sys._xoptions`." msgstr "" -#: ../../c-api/init_config.rst:2013 -msgid "If non-zero, write performance statistics at Python exit." +#: ../../c-api/init_config.rst:700 +msgid "Enable PEG parser? Default: 1." msgstr "" -#: ../../c-api/init_config.rst:2015 -msgid "" -"Need a special build with the ``Py_STATS`` macro: see :option:`--enable-" -"pystats`." +#: ../../c-api/init_config.rst:702 +msgid "Set to 0 by :option:`-X oldparser <-X>` and :envvar:`PYTHONOLDPARSER`." +msgstr "" + +#: ../../c-api/init_config.rst:704 +msgid "See also :pep:`617`." msgstr "" -#: ../../c-api/init_config.rst:2020 +#: ../../c-api/init_config.rst:708 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 " -"line arguments `, and Python arguments are stripped from :" -"c:member:`~PyConfig.argv`." +"If ``parse_argv`` is non-zero, ``argv`` arguments are parsed the same way " +"the regular Python parses command line arguments, and Python arguments are " +"stripped from ``argv``: see :ref:`Command Line Arguments `." msgstr "" -#: ../../c-api/init_config.rst:2025 +#: ../../c-api/init_config.rst:713 msgid "" -"The :c:member:`~PyConfig.xoptions` options are parsed to set other options: " -"see the :option:`-X` command line option." +"The ``xoptions`` options are parsed to set other options: see :option:`-X` " +"option." msgstr "" -#: ../../c-api/init_config.rst:2030 +#: ../../c-api/init_config.rst:718 msgid "The ``show_alloc_count`` field has been removed." msgstr "" -#: ../../c-api/init_config.rst:2036 +#: ../../c-api/init_config.rst:722 msgid "Initialization with PyConfig" msgstr "" -#: ../../c-api/init_config.rst:2038 -msgid "" -"Initializing the interpreter from a populated configuration struct is " -"handled by calling :c:func:`Py_InitializeFromConfig`." +#: ../../c-api/init_config.rst:724 +msgid "Function to initialize Python:" +msgstr "" + +#: ../../c-api/init_config.rst:728 +msgid "Initialize Python from *config* configuration." msgstr "" -#: ../../c-api/init_config.rst:2044 +#: ../../c-api/init_config.rst:733 msgid "" "If :c:func:`PyImport_FrozenModules`, :c:func:`PyImport_AppendInittab` or :c:" "func:`PyImport_ExtendInittab` are used, they must be set or called after " @@ -2979,237 +999,149 @@ msgid "" "`PyImport_ExtendInittab` must be called before each Python initialization." msgstr "" -#: ../../c-api/init_config.rst:2051 -msgid "" -"The current configuration (``PyConfig`` type) is stored in " -"``PyInterpreterState.config``." -msgstr "" - -#: ../../c-api/init_config.rst:2054 +#: ../../c-api/init_config.rst:740 msgid "Example setting the program name::" msgstr "" -#: ../../c-api/init_config.rst:2056 -msgid "" -"void init_python(void)\n" -"{\n" -" PyStatus status;\n" -"\n" -" PyConfig config;\n" -" PyConfig_InitPythonConfig(&config);\n" -"\n" -" /* Set the program name. Implicitly preinitialize Python. */\n" -" status = PyConfig_SetString(&config, &config.program_name,\n" -" L\"/path/to/my_program\");\n" -" if (PyStatus_Exception(status)) {\n" -" goto exception;\n" -" }\n" -"\n" -" status = Py_InitializeFromConfig(&config);\n" -" if (PyStatus_Exception(status)) {\n" -" goto exception;\n" -" }\n" -" PyConfig_Clear(&config);\n" -" return;\n" -"\n" -"exception:\n" -" PyConfig_Clear(&config);\n" -" Py_ExitStatusException(status);\n" -"}" -msgstr "" - -#: ../../c-api/init_config.rst:2082 +#: ../../c-api/init_config.rst:768 msgid "" "More complete example modifying the default configuration, read the " -"configuration, and then override some parameters. Note that since 3.11, many " -"parameters are not calculated until initialization, and so values cannot be " -"read from the configuration structure. Any values set before initialize is " -"called will be left unchanged by initialization::" -msgstr "" - -#: ../../c-api/init_config.rst:2089 -msgid "" -"PyStatus init_python(const char *program_name)\n" -"{\n" -" PyStatus status;\n" -"\n" -" PyConfig config;\n" -" PyConfig_InitPythonConfig(&config);\n" -"\n" -" /* Set the program name before reading the configuration\n" -" (decode byte string from the locale encoding).\n" -"\n" -" Implicitly preinitialize Python. */\n" -" status = PyConfig_SetBytesString(&config, &config.program_name,\n" -" program_name);\n" -" if (PyStatus_Exception(status)) {\n" -" goto done;\n" -" }\n" -"\n" -" /* Read all configuration at once */\n" -" status = PyConfig_Read(&config);\n" -" if (PyStatus_Exception(status)) {\n" -" goto done;\n" -" }\n" -"\n" -" /* Specify sys.path explicitly */\n" -" /* If you want to modify the default set of paths, finish\n" -" initialization first and then use PySys_GetObject(\"path\") */\n" -" config.module_search_paths_set = 1;\n" -" status = PyWideStringList_Append(&config.module_search_paths,\n" -" L\"/path/to/stdlib\");\n" -" if (PyStatus_Exception(status)) {\n" -" goto done;\n" -" }\n" -" status = PyWideStringList_Append(&config.module_search_paths,\n" -" L\"/path/to/more/modules\");\n" -" if (PyStatus_Exception(status)) {\n" -" goto done;\n" -" }\n" -"\n" -" /* Override executable computed by PyConfig_Read() */\n" -" status = PyConfig_SetString(&config, &config.executable,\n" -" L\"/path/to/my_executable\");\n" -" if (PyStatus_Exception(status)) {\n" -" goto done;\n" -" }\n" -"\n" -" status = Py_InitializeFromConfig(&config);\n" -"\n" -"done:\n" -" PyConfig_Clear(&config);\n" -" return status;\n" -"}" -msgstr "" - -#: ../../c-api/init_config.rst:2145 +"configuration, and then override some parameters::" +msgstr "" + +#: ../../c-api/init_config.rst:819 msgid "Isolated Configuration" msgstr "" -#: ../../c-api/init_config.rst:2147 +#: ../../c-api/init_config.rst:821 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:2152 +#: ../../c-api/init_config.rst:826 msgid "" -"This configuration ignores global configuration variables, environment " +"This configuration ignores global configuration variables, environments " "variables, command line arguments (:c:member:`PyConfig.argv` is not parsed) " "and user site directory. The C standard streams (ex: ``stdout``) and the " "LC_CTYPE locale are left unchanged. Signal handlers are not installed." msgstr "" -#: ../../c-api/init_config.rst:2157 +#: ../../c-api/init_config.rst:831 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." +"Configuration files are still used with this configuration. Set the :ref:" +"`Path Configuration ` (\"output fields\") to ignore these " +"configuration files and avoid the function computing the default path " +"configuration." msgstr "" -#: ../../c-api/init_config.rst:2165 +#: ../../c-api/init_config.rst:840 msgid "Python Configuration" msgstr "" -#: ../../c-api/init_config.rst:2167 +#: ../../c-api/init_config.rst:842 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:2171 +#: ../../c-api/init_config.rst:846 msgid "" "Environments variables and command line arguments are used to configure " "Python, whereas global configuration variables are ignored." msgstr "" -#: ../../c-api/init_config.rst:2174 +#: ../../c-api/init_config.rst:849 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." +"This function enables C locale coercion (:pep:`538`) and UTF-8 Mode (:pep:" +"`540`) depending on the LC_CTYPE locale, :envvar:`PYTHONUTF8` and :envvar:" +"`PYTHONCOERCECLOCALE` environment variables." +msgstr "" + +#: ../../c-api/init_config.rst:853 +msgid "Example of customized Python always running in isolated mode::" msgstr "" -#: ../../c-api/init_config.rst:2183 -msgid "Python Path Configuration" +#: ../../c-api/init_config.rst:892 +msgid "Path Configuration" msgstr "" -#: ../../c-api/init_config.rst:2185 +#: ../../c-api/init_config.rst:894 msgid ":c:type:`PyConfig` contains multiple fields for the path configuration:" msgstr "" -#: ../../c-api/init_config.rst:2187 +#: ../../c-api/init_config.rst:896 msgid "Path configuration inputs:" msgstr "" -#: ../../c-api/init_config.rst:2189 +#: ../../c-api/init_config.rst:898 msgid ":c:member:`PyConfig.home`" msgstr "" -#: ../../c-api/init_config.rst:2190 +#: ../../c-api/init_config.rst:899 msgid ":c:member:`PyConfig.platlibdir`" msgstr "" -#: ../../c-api/init_config.rst:2191 +#: ../../c-api/init_config.rst:900 msgid ":c:member:`PyConfig.pathconfig_warnings`" msgstr "" -#: ../../c-api/init_config.rst:2192 +#: ../../c-api/init_config.rst:901 msgid ":c:member:`PyConfig.program_name`" msgstr "" -#: ../../c-api/init_config.rst:2193 +#: ../../c-api/init_config.rst:902 msgid ":c:member:`PyConfig.pythonpath_env`" msgstr "" -#: ../../c-api/init_config.rst:2194 +#: ../../c-api/init_config.rst:903 msgid "current working directory: to get absolute paths" msgstr "" -#: ../../c-api/init_config.rst:2195 +#: ../../c-api/init_config.rst:904 msgid "" "``PATH`` environment variable to get the program full path (from :c:member:" "`PyConfig.program_name`)" msgstr "" -#: ../../c-api/init_config.rst:2197 +#: ../../c-api/init_config.rst:906 msgid "``__PYVENV_LAUNCHER__`` environment variable" msgstr "" -#: ../../c-api/init_config.rst:2198 +#: ../../c-api/init_config.rst:907 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:2202 +#: ../../c-api/init_config.rst:911 msgid "Path configuration output fields:" msgstr "" -#: ../../c-api/init_config.rst:2204 +#: ../../c-api/init_config.rst:913 msgid ":c:member:`PyConfig.base_exec_prefix`" msgstr ":c:member:`PyConfig.base_exec_prefix`" -#: ../../c-api/init_config.rst:2205 +#: ../../c-api/init_config.rst:914 msgid ":c:member:`PyConfig.base_executable`" msgstr ":c:member:`PyConfig.base_executable`" -#: ../../c-api/init_config.rst:2206 +#: ../../c-api/init_config.rst:915 msgid ":c:member:`PyConfig.base_prefix`" msgstr ":c:member:`PyConfig.base_prefix`" -#: ../../c-api/init_config.rst:2207 +#: ../../c-api/init_config.rst:916 msgid ":c:member:`PyConfig.exec_prefix`" msgstr ":c:member:`PyConfig.exec_prefix`" -#: ../../c-api/init_config.rst:2208 +#: ../../c-api/init_config.rst:917 msgid ":c:member:`PyConfig.executable`" msgstr ":c:member:`PyConfig.executable`" -#: ../../c-api/init_config.rst:2209 +#: ../../c-api/init_config.rst:918 msgid "" ":c:member:`PyConfig.module_search_paths_set`, :c:member:`PyConfig." "module_search_paths`" @@ -3217,75 +1149,75 @@ msgstr "" ":c:member:`PyConfig.module_search_paths_set`, :c:member:`PyConfig." "module_search_paths`" -#: ../../c-api/init_config.rst:2211 +#: ../../c-api/init_config.rst:920 msgid ":c:member:`PyConfig.prefix`" msgstr ":c:member:`PyConfig.prefix`" -#: ../../c-api/init_config.rst:2213 +#: ../../c-api/init_config.rst:922 msgid "" "If at least one \"output field\" is not set, Python calculates the path " "configuration to fill unset fields. If :c:member:`~PyConfig." -"module_search_paths_set` is equal to ``0``, :c:member:`~PyConfig." +"module_search_paths_set` is equal to 0, :c:member:`~PyConfig." "module_search_paths` is overridden and :c:member:`~PyConfig." -"module_search_paths_set` is set to ``1``." +"module_search_paths_set` is set to 1." msgstr "" -#: ../../c-api/init_config.rst:2219 +#: ../../c-api/init_config.rst:928 msgid "" "It is possible to completely ignore the function calculating the default " "path configuration by setting explicitly all path configuration output " "fields listed above. A string is considered as set even if it is non-empty. " "``module_search_paths`` is considered as set if ``module_search_paths_set`` " -"is set to ``1``. In this case, ``module_search_paths`` will be used without " -"modification." +"is set to 1. In this case, path configuration input fields are ignored as " +"well." msgstr "" -#: ../../c-api/init_config.rst:2226 +#: ../../c-api/init_config.rst:935 msgid "" -"Set :c:member:`~PyConfig.pathconfig_warnings` to ``0`` to suppress warnings " -"when calculating the path configuration (Unix only, Windows does not log any " +"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:2229 +#: ../../c-api/init_config.rst:938 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:2233 +#: ../../c-api/init_config.rst:942 msgid ":c:func:`Py_RunMain` and :c:func:`Py_Main` modify :data:`sys.path`:" msgstr "" -#: ../../c-api/init_config.rst:2235 +#: ../../c-api/init_config.rst:944 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:2238 +#: ../../c-api/init_config.rst:947 msgid "If :c:member:`~PyConfig.isolated` is zero:" msgstr "" -#: ../../c-api/init_config.rst:2240 +#: ../../c-api/init_config.rst:949 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:2242 +#: ../../c-api/init_config.rst:951 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:2244 +#: ../../c-api/init_config.rst:953 msgid "Otherwise, prepend an empty string to :data:`sys.path`." msgstr "" -#: ../../c-api/init_config.rst:2246 +#: ../../c-api/init_config.rst:955 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." @@ -3294,100 +1226,177 @@ msgid "" "data:`sys.path`." msgstr "" -#: ../../c-api/init_config.rst:2252 +#: ../../c-api/init_config.rst:961 msgid "The following configuration files are used by the path configuration:" msgstr "" -#: ../../c-api/init_config.rst:2254 +#: ../../c-api/init_config.rst:963 msgid "``pyvenv.cfg``" msgstr "``pyvenv.cfg``" -#: ../../c-api/init_config.rst:2255 -msgid "``._pth`` file (ex: ``python._pth``)" +#: ../../c-api/init_config.rst:964 +msgid "``python._pth`` (Windows only)" msgstr "" -#: ../../c-api/init_config.rst:2256 +#: ../../c-api/init_config.rst:965 msgid "``pybuilddir.txt`` (Unix only)" msgstr "" -#: ../../c-api/init_config.rst:2258 -msgid "If a ``._pth`` file is present:" +#: ../../c-api/init_config.rst:967 +msgid "" +"The ``__PYVENV_LAUNCHER__`` environment variable is used to set :c:member:" +"`PyConfig.base_executable`" +msgstr "" + +#: ../../c-api/init_config.rst:972 +msgid "Py_RunMain()" +msgstr "Py_RunMain()" + +#: ../../c-api/init_config.rst:976 +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." +msgstr "" + +#: ../../c-api/init_config.rst:981 +msgid "By default and when if :option:`-i` option is used, run the REPL." +msgstr "" + +#: ../../c-api/init_config.rst:983 +msgid "" +"Finally, finalizes Python and returns an exit status that can be passed to " +"the ``exit()`` function." +msgstr "" + +#: ../../c-api/init_config.rst:986 +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:992 +msgid "Py_GetArgcArgv()" +msgstr "Py_GetArgcArgv()" + +#: ../../c-api/init_config.rst:996 +msgid "Get the original command line arguments, before Python modified them." +msgstr "" + +#: ../../c-api/init_config.rst:1000 +msgid "Multi-Phase Initialization Private Provisional API" +msgstr "" + +#: ../../c-api/init_config.rst:1002 +msgid "" +"This section is a private provisional API introducing multi-phase " +"initialization, the core feature of the :pep:`432`:" msgstr "" -#: ../../c-api/init_config.rst:2260 -msgid "Set :c:member:`~PyConfig.isolated` to ``1``." +#: ../../c-api/init_config.rst:1005 +msgid "\"Core\" initialization phase, \"bare minimum Python\":" msgstr "" -#: ../../c-api/init_config.rst:2261 -msgid "Set :c:member:`~PyConfig.use_environment` to ``0``." +#: ../../c-api/init_config.rst:1007 +msgid "Builtin types;" msgstr "" -#: ../../c-api/init_config.rst:2262 -msgid "Set :c:member:`~PyConfig.site_import` to ``0``." +#: ../../c-api/init_config.rst:1008 +msgid "Builtin exceptions;" msgstr "" -#: ../../c-api/init_config.rst:2263 -msgid "Set :c:member:`~PyConfig.safe_path` to ``1``." +#: ../../c-api/init_config.rst:1009 +msgid "Builtin and frozen modules;" msgstr "" -#: ../../c-api/init_config.rst:2265 +#: ../../c-api/init_config.rst:1010 msgid "" -"If :c:member:`~PyConfig.home` is not set and a ``pyvenv.cfg`` file is " -"present in the same directory as :c:member:`~PyConfig.executable`, or its " -"parent, :c:member:`~PyConfig.prefix` and :c:member:`~PyConfig.exec_prefix` " -"are set that location. When this happens, :c:member:`~PyConfig.base_prefix` " -"and :c:member:`~PyConfig.base_exec_prefix` still keep their value, pointing " -"to the base installation. See :ref:`sys-path-init-virtual-environments` for " -"more information." +"The :mod:`sys` module is only partially initialized (ex: :data:`sys.path` " +"doesn't exist yet)." +msgstr "" + +#: ../../c-api/init_config.rst:1013 +msgid "\"Main\" initialization phase, Python is fully initialized:" msgstr "" -#: ../../c-api/init_config.rst:2273 +#: ../../c-api/init_config.rst:1015 +msgid "Install and configure :mod:`importlib`;" +msgstr "" + +#: ../../c-api/init_config.rst:1016 +msgid "Apply the :ref:`Path Configuration `;" +msgstr "" + +#: ../../c-api/init_config.rst:1017 +msgid "Install signal handlers;" +msgstr "" + +#: ../../c-api/init_config.rst:1018 msgid "" -"The ``__PYVENV_LAUNCHER__`` environment variable is used to set :c:member:" -"`PyConfig.base_executable`." +"Finish :mod:`sys` module initialization (ex: create :data:`sys.stdout` and :" +"data:`sys.path`);" msgstr "" -#: ../../c-api/init_config.rst:2278 +#: ../../c-api/init_config.rst:1020 msgid "" -":c:member:`~PyConfig.prefix`, and :c:member:`~PyConfig.exec_prefix`, are now " -"set to the ``pyvenv.cfg`` directory. This was previously done by :mod:" -"`site`, therefore affected by :option:`-S`." +"Enable optional features like :mod:`faulthandler` and :mod:`tracemalloc`;" msgstr "" -#: ../../c-api/init_config.rst:2284 -msgid "Py_GetArgcArgv()" -msgstr "Py_GetArgcArgv()" +#: ../../c-api/init_config.rst:1021 +msgid "Import the :mod:`site` module;" +msgstr "" -#: ../../c-api/init_config.rst:2288 -msgid "Get the original command line arguments, before Python modified them." +#: ../../c-api/init_config.rst:1022 +msgid "etc." +msgstr "" + +#: ../../c-api/init_config.rst:1024 +msgid "Private provisional API:" +msgstr "" + +#: ../../c-api/init_config.rst:1026 +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:2290 -msgid "See also :c:member:`PyConfig.orig_argv` member." +#: ../../c-api/init_config.rst:1028 +msgid "" +":c:member:`PyConfig._isolated_interpreter`: if non-zero, disallow threads, " +"subprocesses and fork." msgstr "" -#: ../../c-api/init_config.rst:2293 -msgid "Delaying main module execution" +#: ../../c-api/init_config.rst:1033 +msgid "" +"Move to the \"Main\" initialization phase, finish the Python initialization." msgstr "" -#: ../../c-api/init_config.rst:2295 +#: ../../c-api/init_config.rst:1035 msgid "" -"In some embedding use cases, it may be desirable to separate interpreter " -"initialization from the execution of the main module." +"No module is imported during the \"Core\" phase and the ``importlib`` module " +"is not configured: the :ref:`Path Configuration ` is only " +"applied during the \"Main\" phase. It may allow to customize Python in " +"Python to override or tune the :ref:`Path Configuration `, " +"maybe install a custom :data:`sys.meta_path` importer or an import hook, etc." msgstr "" -#: ../../c-api/init_config.rst:2298 +#: ../../c-api/init_config.rst:1041 msgid "" -"This separation can be achieved by setting ``PyConfig.run_command`` to the " -"empty string during initialization (to prevent the interpreter from dropping " -"into the interactive prompt), and then subsequently executing the desired " -"main module code using ``__main__.__dict__`` as the global namespace." +"It may become possible to calculatin 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:1181 -msgid "main()" -msgstr "main()" +#: ../../c-api/init_config.rst:1045 +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 " +"private and provisional: the API can be modified or even be removed anytime " +"until a proper public API is designed." +msgstr "" -#: ../../c-api/init_config.rst:1181 -msgid "argv (in module sys)" -msgstr "argv (in module sys)" +#: ../../c-api/init_config.rst:1050 +msgid "" +"Example running Python code between \"Core\" and \"Main\" initialization " +"phases::" +msgstr "" diff --git a/c-api/intro.po b/c-api/intro.po index 9ed04a595..b46a3654b 100644 --- a/c-api/intro.po +++ b/c-api/intro.po @@ -1,30 +1,30 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: +# 秘湯 , 2017 +# Arihiro TAKASE, 2017 +# Osamu NAKAMURA, 2017 +# Inada Naoki , 2017 +# tomo, 2020 # Yusuke Miyazaki , 2021 -# Osamu NAKAMURA, 2023 -# Masato HASHIMOTO , 2023 -# Nozomu Kaneko , 2024 -# Arihiro TAKASE, 2024 -# tomo, 2025 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-30 14:22+0000\n" -"PO-Revision-Date: 2021-06-28 00:49+0000\n" -"Last-Translator: tomo, 2025\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 17:36+0000\n" +"Last-Translator: Yusuke Miyazaki , 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/intro.rst:8 @@ -83,24 +83,10 @@ msgstr "" "のはよい考えだと思います。" #: ../../c-api/intro.rst:34 -msgid "Language version compatibility" -msgstr "" - -#: ../../c-api/intro.rst:36 -msgid "Python's C API is compatible with C11 and C++11 versions of C and C++." -msgstr "" - -#: ../../c-api/intro.rst:38 -msgid "" -"This is a lower limit: the C API does not require features from later C/C++ " -"versions. You do *not* need to enable your compiler's \"c11 mode\"." -msgstr "" - -#: ../../c-api/intro.rst:44 msgid "Coding standards" msgstr "コーディング基準" -#: ../../c-api/intro.rst:46 +#: ../../c-api/intro.rst:36 msgid "" "If you're writing C code for inclusion in CPython, you **must** follow the " "guidelines and standards defined in :PEP:`7`. These guidelines apply " @@ -115,11 +101,11 @@ msgstr "" "自身のサードパーティーのモジュールでは、それをいつか Python にコントリビュー" "トするつもりでなければ、この慣習に従う必要はありません。" -#: ../../c-api/intro.rst:56 +#: ../../c-api/intro.rst:46 msgid "Include Files" msgstr "インクルードファイル" -#: ../../c-api/intro.rst:58 +#: ../../c-api/intro.rst:48 msgid "" "All function, type and macro definitions needed to use the Python/C API are " "included in your code by the following line::" @@ -127,13 +113,7 @@ msgstr "" "Python/C API を使うために必要な、関数、型およびマクロの全ての定義をインクルー" "ドするには、以下の行::" -#: ../../c-api/intro.rst:61 -msgid "" -"#define PY_SSIZE_T_CLEAN\n" -"#include " -msgstr "" - -#: ../../c-api/intro.rst:64 +#: ../../c-api/intro.rst:54 msgid "" "This implies inclusion of the following standard headers: ````, " "````, ````, ````, ```` and ````, ````, ````, ````, ```` を (利用できれば) インクルードします。" -#: ../../c-api/intro.rst:70 +#: ../../c-api/intro.rst:60 msgid "" "Since Python may define some pre-processor definitions which affect the " "standard headers on some systems, you *must* include :file:`Python.h` before " @@ -153,7 +133,7 @@ msgstr "" "義を行っているので、 :file:`Python.h` をいずれの標準ヘッダよりも前にインク" "ルード *せねばなりません* 。" -#: ../../c-api/intro.rst:74 +#: ../../c-api/intro.rst:64 msgid "" "It is recommended to always define ``PY_SSIZE_T_CLEAN`` before including " "``Python.h``. See :ref:`arg-parsing` for a description of this macro." @@ -162,7 +142,7 @@ msgstr "" "が推奨されます。\n" "このマクロの解説については :ref:`arg-parsing` を参照してください。" -#: ../../c-api/intro.rst:77 +#: ../../c-api/intro.rst:67 msgid "" "All user visible names defined by Python.h (except those defined by the " "included standard headers) have one of the prefixes ``Py`` or ``_Py``. " @@ -176,7 +156,7 @@ msgstr "" "モジュールの作者は使ってはなりません。構造体のメンバには予約済みの接頭文字列" "はありません。" -#: ../../c-api/intro.rst:84 +#: ../../c-api/intro.rst:74 msgid "" "User code should never define names that begin with ``Py`` or ``_Py``. This " "confuses the reader, and jeopardizes the portability of the user code to " @@ -188,55 +168,54 @@ msgstr "" "後からコードを読む人を混乱させたり、将来の Python のバージョンで同じ名前が定" "義されて、ユーザの書いたコードの可搬性を危うくする可能性があります。" -#: ../../c-api/intro.rst:89 +#: ../../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 " +"`{exec_prefix}/include/pythonversion/`, where :envvar:`prefix` and :envvar:" +"`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 :envvar:`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>` は Python をビルドする際の :program:" -"`configure` スクリプトに与えたパラメタに対応し、 *version* は ``'%d.%d' % " -"sys.version_info[:2]`` に対応します。 Windows では、ヘッダは :file:`{prefix}/" -"include` に置かれます。 ``prefix`` はインストーラに指定したインストールディレ" -"クトリです。" +"pythonversion/` に置かれます。 :envvar:`prefix` と :envvar:`exec_prefix` は " +"Python をビルドする際の :program:`configure` スクリプトに与えたパラメタに対応" +"し、 *version* は ``'%d.%d' % sys.version_info[:2]`` に対応します。 Windows " +"では、ヘッダは :file:`{prefix}/include` に置かれます。 :envvar:`prefix` はイ" +"ンストーラに指定したインストールディレクトリです。" -#: ../../c-api/intro.rst:98 +#: ../../c-api/intro.rst:88 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>`." +"envvar:`prefix` include the platform specific headers from :envvar:" +"`exec_prefix`." msgstr "" "ヘッダをインクルードするには、各ヘッダの入ったディレクトリ (別々のディレクト" "リの場合は両方) を、コンパイラがインクルードファイルを検索するためのパスに入" "れます。親ディレクトリをサーチパスに入れて、 ``#include `` のようにしては *なりません* ; :option:`prefix <--prefix>` 内のプラット" -"フォームに依存しないヘッダは、 :option:`exec_prefix <--exec-prefix>` からプ" -"ラットフォーム依存のヘッダをインクルードしているので、このような操作を行うと" -"複数のプラットフォームでのビルドができなくなります。" +"h>`` のようにしては *なりません* ; :envvar:`prefix` 内のプラットフォームに依" +"存しないヘッダは、 :envvar:`exec_prefix` からプラットフォーム依存のヘッダをイ" +"ンクルードしているので、このような操作を行うと複数のプラットフォームでのビル" +"ドができなくなります。" -#: ../../c-api/intro.rst:105 +#: ../../c-api/intro.rst:95 msgid "" "C++ users should note that although the API is defined entirely using C, the " "header files properly declare the entry points to be ``extern \"C\"``. As a " "result, there is no need to do anything special to use the API from C++." msgstr "" -#: ../../c-api/intro.rst:111 +#: ../../c-api/intro.rst:101 msgid "Useful macros" msgstr "便利なマクロ" -#: ../../c-api/intro.rst:113 +#: ../../c-api/intro.rst:103 msgid "" "Several useful macros are defined in the Python header files. Many are " "defined closer to where they are useful (e.g. :c:macro:`Py_RETURN_NONE`). " @@ -250,76 +229,60 @@ msgstr "" "います。\n" "ただし、ここで完全に列挙されているとは限りません。" -#: ../../c-api/intro.rst:120 +#: ../../c-api/intro.rst:110 msgid "" -"Declare an extension module ``PyInit`` initialization function. The function " -"return type is :c:expr:`PyObject*`. The macro declares any special linkage " -"declarations required by the platform, and for C++ declares the function as " -"``extern \"C\"``." +"Use this when you have a code path that cannot be reached by design. For " +"example, in the ``default:`` clause in a ``switch`` statement for which all " +"possible values are covered in ``case`` statements. Use this in places " +"where you might be tempted to put an ``assert(0)`` or ``abort()`` call." msgstr "" -#: ../../c-api/intro.rst:125 +#: ../../c-api/intro.rst:115 msgid "" -"The initialization function must be named :samp:`PyInit_{name}`, where " -"*name* is the name of the module, and should be the only non-\\ ``static`` " -"item defined in the module file. Example::" +"In release mode, the macro helps the compiler to optimize the code, and " +"avoids a warning about unreachable code. For example, the macro is " +"implemented with ``__builtin_unreachable()`` on GCC in release mode." msgstr "" -#: ../../c-api/intro.rst:129 +#: ../../c-api/intro.rst:119 msgid "" -"static struct PyModuleDef spam_module = {\n" -" .m_base = PyModuleDef_HEAD_INIT,\n" -" .m_name = \"spam\",\n" -" ...\n" -"};\n" -"\n" -"PyMODINIT_FUNC\n" -"PyInit_spam(void)\n" -"{\n" -" return PyModuleDef_Init(&spam_module);\n" -"}" +"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 "" -#: ../../c-api/intro.rst:144 -msgid "Return the absolute value of ``x``." -msgstr "``x`` の絶対値を返します。" - -#: ../../c-api/intro.rst:150 +#: ../../c-api/intro.rst:122 msgid "" -"Ask the compiler to always inline a static inline function. The compiler can " -"ignore it and decide to not inline the function." +"If a code path is very unlikely code but can be reached under exceptional " +"case, this macro must not be used. For example, under low memory condition " +"or if a system call returns a value out of the expected range. In this " +"case, it's better to report the error to the caller. If the error cannot be " +"reported to caller, :c:func:`Py_FatalError` can be used." msgstr "" -#: ../../c-api/intro.rst:153 -msgid "" -"It can be used to inline performance critical static inline functions when " -"building Python in debug mode with function inlining disabled. For example, " -"MSC disables function inlining when building in debug mode." -msgstr "" +#: ../../c-api/intro.rst:132 +msgid "Return the absolute value of ``x``." +msgstr "``x`` の絶対値を返します。" -#: ../../c-api/intro.rst:157 -msgid "" -"Marking blindly a static inline function with Py_ALWAYS_INLINE can result in " -"worse performances (due to increased code size for example). The compiler is " -"usually smarter than the developer for the cost/benefit analysis." -msgstr "" +#: ../../c-api/intro.rst:138 +msgid "Return the minimum value between ``x`` and ``y``." +msgstr "``x`` と ``y`` の最小値を返します。" -#: ../../c-api/intro.rst:161 -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." -msgstr "" +#: ../../c-api/intro.rst:144 +msgid "Return the maximum value between ``x`` and ``y``." +msgstr "``x`` と ``y`` の最大値を返します。" -#: ../../c-api/intro.rst:164 -msgid "It must be specified before the function return type. Usage::" +#: ../../c-api/intro.rst:150 +msgid "" +"Convert ``x`` to a C string. E.g. ``Py_STRINGIFY(123)`` returns ``\"123\"``." msgstr "" +"``x`` を C 文字列へ変換します。\n" +"例えば、 ``Py_STRINGIFY(123)`` は ``\"123\"`` を返します。" -#: ../../c-api/intro.rst:166 -msgid "static inline Py_ALWAYS_INLINE int random(void) { return 4; }" -msgstr "" +#: ../../c-api/intro.rst:157 +msgid "Return the size of a structure (``type``) ``member`` in bytes." +msgstr "(``type``) 構造体の ``member`` のサイズをバイト単位で返します。" -#: ../../c-api/intro.rst:172 +#: ../../c-api/intro.rst:163 msgid "" "Argument must be a character or an integer in the range [-128, 127] or [0, " "255]. This macro returns ``c`` cast to an ``unsigned char``." @@ -328,175 +291,79 @@ msgstr "" "ん。\n" "このマクロは ``符号なし文字`` にキャストした ``c`` を返します。" -#: ../../c-api/intro.rst:177 -msgid "" -"Use this for deprecated declarations. The macro must be placed before the " -"symbol name." -msgstr "" - -#: ../../c-api/intro.rst:180 ../../c-api/intro.rst:266 -#: ../../c-api/intro.rst:284 -msgid "Example::" -msgstr "以下はプログラム例です::" - -#: ../../c-api/intro.rst:182 -msgid "Py_DEPRECATED(3.8) PyAPI_FUNC(int) Py_OldFunction(void);" -msgstr "" - -#: ../../c-api/intro.rst:184 -msgid "MSVC support was added." -msgstr "MSVC サポートが追加されました。" - -#: ../../c-api/intro.rst:189 +#: ../../c-api/intro.rst:168 msgid "" "Like ``getenv(s)``, but returns ``NULL`` if :option:`-E` was passed on the " -"command line (see :c:member:`PyConfig.use_environment`)." +"command line (i.e. if ``Py_IgnoreEnvironmentFlag`` is set)." msgstr "" +"``getenv(s)`` に似ていますが、コマンドラインで :option:`-E` が渡された場合 " +"(つまり ``Py_IgnoreEnvironmentFlag`` が設定された場合) ``NULL`` を返します。" -#: ../../c-api/intro.rst:194 -msgid "Return the maximum value between ``x`` and ``y``." -msgstr "``x`` と ``y`` の最大値を返します。" - -#: ../../c-api/intro.rst:200 -msgid "Return the size of a structure (``type``) ``member`` in bytes." -msgstr "(``type``) 構造体の ``member`` のサイズをバイト単位で返します。" - -#: ../../c-api/intro.rst:206 -msgid "Return the minimum value between ``x`` and ``y``." -msgstr "``x`` と ``y`` の最小値を返します。" - -#: ../../c-api/intro.rst:212 -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`)." -msgstr "" - -#: ../../c-api/intro.rst:216 -msgid "Usage::" -msgstr "使い方::" - -#: ../../c-api/intro.rst:218 -msgid "Py_NO_INLINE static int random(void) { return 4; }" -msgstr "" - -#: ../../c-api/intro.rst:224 +#: ../../c-api/intro.rst:173 msgid "" -"Convert ``x`` to a C string. E.g. ``Py_STRINGIFY(123)`` returns ``\"123\"``." -msgstr "" -"``x`` を C 文字列へ変換します。\n" -"例えば、 ``Py_STRINGIFY(123)`` は ``\"123\"`` を返します。" - -#: ../../c-api/intro.rst:231 -msgid "" -"Use this when you have a code path that cannot be reached by design. For " -"example, in the ``default:`` clause in a ``switch`` statement for which all " -"possible values are covered in ``case`` statements. Use this in places " -"where you might be tempted to put an ``assert(0)`` or ``abort()`` call." -msgstr "" - -#: ../../c-api/intro.rst:236 -msgid "" -"In release mode, the macro helps the compiler to optimize the code, and " -"avoids a warning about unreachable code. For example, the macro is " -"implemented with ``__builtin_unreachable()`` on GCC in release mode." +"Use this for unused arguments in a function definition to silence compiler " +"warnings. Example: ``int func(int a, int Py_UNUSED(b)) { return a; }``." msgstr "" -#: ../../c-api/intro.rst:240 +#: ../../c-api/intro.rst:180 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`." +"Use this for deprecated declarations. The macro must be placed before the " +"symbol name." msgstr "" -#: ../../c-api/intro.rst:243 -msgid "" -"If a code path is very unlikely code but can be reached under exceptional " -"case, this macro must not be used. For example, under low memory condition " -"or if a system call returns a value out of the expected range. In this " -"case, it's better to report the error to the caller. If the error cannot be " -"reported to caller, :c:func:`Py_FatalError` can be used." -msgstr "" +#: ../../c-api/intro.rst:183 ../../c-api/intro.rst:198 +#: ../../c-api/intro.rst:216 +msgid "Example::" +msgstr "以下はプログラム例です::" -#: ../../c-api/intro.rst:253 -msgid "" -"Use this for unused arguments in a function definition to silence compiler " -"warnings. Example: ``int func(int a, int Py_UNUSED(b)) { return a; }``." -msgstr "" +#: ../../c-api/intro.rst:187 +msgid "MSVC support was added." +msgstr "MSVC サポートが追加されました。" -#: ../../c-api/intro.rst:260 +#: ../../c-api/intro.rst:192 msgid "" "Creates a variable with name ``name`` that can be used in docstrings. If " "Python is built without docstrings, the value will be empty." msgstr "" -#: ../../c-api/intro.rst:263 +#: ../../c-api/intro.rst:195 msgid "" "Use :c:macro:`PyDoc_STRVAR` for docstrings to support building Python " "without docstrings, as specified in :pep:`7`." msgstr "" -#: ../../c-api/intro.rst:268 -msgid "" -"PyDoc_STRVAR(pop_doc, \"Remove and return the rightmost element.\");\n" -"\n" -"static PyMethodDef deque_methods[] = {\n" -" // ...\n" -" {\"pop\", (PyCFunction)deque_pop, METH_NOARGS, pop_doc},\n" -" // ...\n" -"}" -msgstr "" - -#: ../../c-api/intro.rst:278 +#: ../../c-api/intro.rst:210 msgid "" "Creates a docstring for the given input string or an empty string if " "docstrings are disabled." msgstr "" -#: ../../c-api/intro.rst:281 +#: ../../c-api/intro.rst:213 msgid "" "Use :c:macro:`PyDoc_STR` in specifying docstrings to support building Python " "without docstrings, as specified in :pep:`7`." msgstr "" -#: ../../c-api/intro.rst:286 -msgid "" -"static PyMethodDef pysqlite_row_methods[] = {\n" -" {\"keys\", (PyCFunction)pysqlite_row_keys, METH_NOARGS,\n" -" PyDoc_STR(\"Returns the keys of the row.\")},\n" -" {NULL, NULL}\n" -"};" -msgstr "" - -#: ../../c-api/intro.rst:296 +#: ../../c-api/intro.rst:227 msgid "Objects, Types and Reference Counts" msgstr "オブジェクト、型および参照カウント" -#: ../../c-api/intro.rst:300 +#: ../../c-api/intro.rst:231 msgid "" "Most Python/C API functions have one or more arguments as well as a return " -"value of type :c:expr:`PyObject*`. This type is a pointer to an opaque data " +"value of type :c:type:`PyObject*`. This type is a pointer to an opaque data " "type representing an arbitrary Python object. Since all Python object types " "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 " +"c:type:`PyObject`, only pointer variables of type :c:type:`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 "" -"Python/C API 関数は、 :c:expr:`PyObject*` 型の一つ以上の引数と戻り値を持ちま" -"す。この型は、任意の Python オブジェクトを表現する不透明 (opaque) なデータ型" -"へのポインタです。 Python 言語は、全ての Python オブジェクト型をほとんどの状" -"況 (例えば代入、スコープ規則 (scope rule)、引数渡し) で同様に扱います。ほとん" -"ど全ての Python オブジェクトはヒープ (heap) 上に置かれます: このため、 :c:" -"type:`PyObject` 型のオブジェクトは、自動記憶 (automatic) としても静的記憶 " -"(static) としても宣言できません。 :c:expr:`PyObject*` 型のポインタ変数のみ宣" -"言できます。唯一の例外は、型オブジェクトです; 型オブジェクトはメモリ解放 " -"(deallocate) してはならないので、通常は静的記憶の :c:type:`PyTypeObject` オブ" -"ジェクトにします。" -#: ../../c-api/intro.rst:311 +#: ../../c-api/intro.rst:242 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." @@ -514,88 +381,134 @@ msgstr "" "か調べられます; 例えば、 ``PyList_Check(a)`` は、 *a* で示されたオブジェクト" "が Python リスト型のとき (かつそのときに限り) 真値を返します。" -#: ../../c-api/intro.rst:322 +#: ../../c-api/intro.rst:253 msgid "Reference Counts" msgstr "参照カウント法" -#: ../../c-api/intro.rst:324 +#: ../../c-api/intro.rst:255 msgid "" "The reference count is important because today's computers have a finite " -"(and often severely limited) memory size; it counts how many different " -"places there are that have a :term:`strong reference` to an object. Such a " -"place could be another object, or a global (or static) C variable, or a " -"local variable in some C function. When the last :term:`strong reference` to " -"an object is released (i.e. its reference count becomes zero), the object is " -"deallocated. If it contains references to other objects, those references " -"are released. Those other objects may be deallocated in turn, if there are " -"no more references to them, and so on. (There's an obvious problem with " -"objects that reference each other here; for now, the solution is \"don't do " -"that.\")" -msgstr "" - -#: ../../c-api/intro.rst:341 -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:" +"(and often severely limited) memory size; it counts how many different " +"places there are that have a reference to an object. Such a place could be " +"another object, or a global (or static) C variable, or a local variable in " +"some C function. When an object's reference count becomes zero, the object " +"is deallocated. If it contains references to other objects, their " +"reference count is decremented. Those other objects may be deallocated in " +"turn, if this decrement makes their reference count become zero, and so on. " +"(There's an obvious problem with objects that reference each other here; " +"for now, the solution is \"don't do that.\")" +msgstr "" +"今日の計算機は有限の (しばしば非常に限られた) メモリサイズしか持たないので、" +"参照カウントは重要な概念です; 参照カウントは、あるオブジェクトに対して参照を" +"行っている場所が何箇所あるかを数える値です。参照を行っている場所とは、別のオ" +"ブジェクトであったり、グローバルな (あるいは静的な) C 変数であったり、何らか" +"の C 関数内にあるローカルな変数だったりします。あるオブジェクトの参照カウント" +"がゼロになると、そのオブジェクトは解放されます。そのオブジェクトに他のオブ" +"ジェクトへの参照が入っていれば、他のオブジェクトの参照カウントはデクリメント" +"されます。デクリメントの結果、他のオブジェクトの参照カウントがゼロになると、" +"今度はそのオブジェクトが解放される、といった具合に以後続きます。(言うまでもな" +"く、互いを参照しあうオブジェクトについて問題があります; 現状では、解決策は " +"\"何もしない\" です。)" + +#: ../../c-api/intro.rst:270 +msgid "" +"Reference counts are always manipulated explicitly. The normal way is to " +"use the macro :c:func:`Py_INCREF` to increment an object's reference count " +"by one, and :c:func:`Py_DECREF` to decrement it 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 " +"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-api/intro.rst:357 -msgid "" -"It is not necessary to hold a :term:`strong reference` (i.e. increment the " -"reference count) for every local variable that contains a pointer to an " -"object. In theory, the object's reference count goes up by one when the " -"variable is made to point to it and it goes down by one when the variable " -"goes out of scope. However, these two cancel each other out, so at the end " -"the reference count hasn't changed. The only real reason to use the " -"reference count is to prevent the object from being deallocated as long as " -"our variable is pointing to it. If we know that there is at least one " -"other reference to the object that lives at least as long as our variable, " -"there is no need to take a new :term:`strong reference` (i.e. increment the " -"reference count) temporarily. An important situation where this arises is in " -"objects that are passed as arguments to C functions in an extension module " -"that are called from Python; the call mechanism guarantees to hold a " -"reference to every argument for the duration of the call." -msgstr "" - -#: ../../c-api/intro.rst:373 +"takes care of decrementing the reference counts 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` マクロでオブジェクトの参照を 1 インクリメントし、 :c:func:" +"`Py_DECREF` マクロで 1 デクリメントします。 :c:func:`Py_DECREF` マクロは、" +"incref よりもかなり複雑です。というのは、 Py_DECREF マクロは参照カウントがゼ" +"ロになったかどうかを調べて、なった場合にはオブジェクトのメモリ解放関数 " +"(deallocator) を呼び出さなければならないからです。メモリ解放関数とは、オブ" +"ジェクトの型を定義している構造体内にある関数へのポインタです。型固有のメモリ" +"解放関数は、その型が複合オブジェクト (compound object) 型である場合には、オブ" +"ジェクト内の他のオブジェクトに対する参照カウントをデクリメントするよう気を配" +"るとともに、その他の必要なファイナライズ (finalize) 処理を実行します。参照カ" +"ウントがオーバフローすることはありません; というのも、仮想メモリ空間には、" +"(``sizeof(Py_ssize_t) >= sizeof(void*)`` と仮定した場合) 少なくとも参照カウン" +"トの記憶に使われるビット数と同じだけのメモリ上の位置があるからです。従って、" +"参照カウントのインクリメントは単純な操作になります。" + +#: ../../c-api/intro.rst:284 msgid "" -"However, a common pitfall is to extract an object from a list and hold on to " -"it for a while without taking a new reference. Some other operation might " -"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." -msgstr "" +"It is not necessary to increment an object's reference count for every " +"local variable that contains a pointer to an object. In theory, the " +"object's reference count goes up by one when the variable is made to point " +"to it and it goes down by one when the variable goes out of scope. " +"However, these two cancel each other out, so at the end the reference count " +"hasn't changed. The only real reason to use the reference count is to " +"prevent the object from being deallocated as long as our variable is " +"pointing to it. If we know that there is at least one other reference to " +"the object that lives at least as long as our variable, there is no need to " +"increment the reference count temporarily. An important situation where " +"this arises is in objects that are passed as arguments to C functions in an " +"extension module that are called from Python; the call mechanism guarantees " +"to hold a reference to every argument for the duration of the call." +msgstr "" +"オブジェクトへのポインタが入っているローカルな変数全てについて、オブジェクト" +"の参照カウントを必ずインクリメントしなければならないわけではありません。理論" +"上は、オブジェクトの参照カウントは、オブジェクトを指し示す変数が生成されたと" +"きに 1 増やされ、その変数がスコープから出て行った際に 1 減らされます。しかし" +"この場合、二つの操作は互いに相殺するので、結果的に参照カウントは変化しませ" +"ん。参照カウントを使う真の意義とは、手持ちの何らかの変数がオブジェクトを指し" +"ている間はオブジェクトがデアロケートされないようにすることにあります。オブ" +"ジェクトに対して、一つでも別の参照が行われていて、その参照が手持ちの変数と同" +"じ間維持されるのなら、参照カウントを一時的に増やす必要はありません。参照カウ" +"ント操作の必要性が浮き彫りになる重要な局面とは、Python から呼び出された拡張モ" +"ジュール内の C 関数にオブジェクトを引数として渡すときです; 呼び出しメカニズム" +"は、呼び出しの間全ての引数に対する参照を保証します。" -#: ../../c-api/intro.rst:381 +#: ../../c-api/intro.rst:298 +msgid "" +"However, a common pitfall is to extract an object from a list and hold on to " +"it for a while without incrementing its reference count. Some other " +"operation might conceivably remove the object from the list, decrementing " +"its reference count 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." +msgstr "" +"しかしながら、よく陥る過ちとして、あるオブジェクトをリストから得たときに、参" +"照カウントをインクリメントせずにしばらく放っておくというのがあります。他の操" +"作がオブジェクトをリストから除去してしまい、参照カウントがデクリメントされて" +"デアロケートされてしまうことが考えられます。本当に危険なのは、まったく無害そ" +"うにみえる操作が、上記の動作を引き起こす何らかの Python コードを呼び出しかね" +"ないということです; :c:func:`Py_DECREF` からユーザへ制御を戻せるようなコード" +"パスが存在するため、ほとんど全ての操作が潜在的に危険をはらむことになります。" + +#: ../../c-api/intro.rst:306 msgid "" "A safe approach is to always use the generic operations (functions whose " "name begins with ``PyObject_``, ``PyNumber_``, ``PySequence_`` or " -"``PyMapping_``). These operations always create a new :term:`strong " -"reference` (i.e. increment the reference count) of the object they return. " -"This leaves the caller with the responsibility to call :c:func:`Py_DECREF` " -"when they are done with the result; this soon becomes second nature." -msgstr "" - -#: ../../c-api/intro.rst:392 +"``PyMapping_``). These operations always increment the reference count of " +"the object they return. This leaves the caller with the responsibility to " +"call :c:func:`Py_DECREF` when they are done with the result; this soon " +"becomes second nature." +msgstr "" +"安全に参照カウントを操作するアプローチは、汎用の操作 (関数名が " +"``PyObject_``, ``PyNumber_``, ``PySequence_``, および ``PyMapping_`` で始ま" +"る関数) の利用です。これらの操作は常に戻り値となるオブジェクトの参照カウント" +"をインクリメントします。ユーザには戻り値が不要になったら :c:func:`Py_DECREF` " +"を呼ぶ責任が残されています; とはいえ、すぐにその習慣は身に付くでしょう。" + +#: ../../c-api/intro.rst:316 msgid "Reference Count Details" msgstr "参照カウントの詳細" -#: ../../c-api/intro.rst:394 +#: ../../c-api/intro.rst:318 msgid "" "The reference count behavior of functions in the Python/C API is best " "explained in terms of *ownership of references*. Ownership pertains to " @@ -603,16 +516,28 @@ 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 " +"reference then becomes responsible for eventually decref'ing 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 "" - -#: ../../c-api/intro.rst:407 +"said to *borrow* the reference. Nothing needs to be done for a borrowed " +"reference." +msgstr "" +"Python/C API の各関数における参照カウントの振る舞いは、説明するには、 *参照の" +"所有権 (ownership of references)* という言葉でうまく説明できます。所有権は参" +"照に対するもので、オブジェクトに対するものではありません (オブジェクトは誰に" +"も所有されず、常に共有されています)。ある \"参照の所有\" は、その参照が必要な" +"くなった時点で Py_DECREF を呼び出す役割を担うことを意味します。所有権は委譲で" +"き、あるコードが委譲によって所有権を得ると、今度はそのコードが参照が必要なく" +"なった際に最終的に :c:func:`Py_DECREF` や :c:func:`Py_XDECREF` を呼び出して、" +"参照カウンタを1つ減らす役割を担います --- あるいは、その役割を (通常はコード" +"を呼び出した元に) 受け渡します。ある関数が、関数の呼び出し側に対して参照の所" +"有権を渡すと、呼び出し側は *新たな* 参照 (new reference) を得る、と言います。" +"所有権が渡されない場合、呼び出し側は参照を *借りる* (borrow) といいます。借り" +"た参照に対しては、何もする必要はありません。" + +#: ../../c-api/intro.rst:331 msgid "" "Conversely, when a calling function passes in a reference to an object, " "there are two possibilities: the function *steals* a reference to the " @@ -626,7 +551,7 @@ msgstr "" "所有者がその関数になったと仮定し、関数の呼び出し元には所有権がなくなるという" "ことです。" -#: ../../c-api/intro.rst:417 +#: ../../c-api/intro.rst:341 msgid "" "Few functions steal references; the two notable exceptions are :c:func:" "`PyList_SetItem` and :c:func:`PyTuple_SetItem`, which steal a reference to " @@ -646,17 +571,7 @@ msgstr "" "コードは以下のようになります (とりあえず例外処理のことは忘れておきます; もっ" "とよい書き方を後で示します)::" -#: ../../c-api/intro.rst:425 -msgid "" -"PyObject *t;\n" -"\n" -"t = PyTuple_New(3);\n" -"PyTuple_SetItem(t, 0, PyLong_FromLong(1L));\n" -"PyTuple_SetItem(t, 1, PyLong_FromLong(2L));\n" -"PyTuple_SetItem(t, 2, PyUnicode_FromString(\"three\"));" -msgstr "" - -#: ../../c-api/intro.rst:432 +#: ../../c-api/intro.rst:356 msgid "" "Here, :c:func:`PyLong_FromLong` returns a new reference which is immediately " "stolen by :c:func:`PyTuple_SetItem`. When you want to keep using an object " @@ -668,7 +583,7 @@ msgstr "" "い場合は、参照盗む関数を呼び出す前に、 :c:func:`Py_INCREF` を利用してもう一つ" "の参照を取得してください。" -#: ../../c-api/intro.rst:437 +#: ../../c-api/intro.rst:361 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 " @@ -681,7 +596,7 @@ msgstr "" "タプルの値を入れていくつもりなら、 :c:func:`PyTuple_SetItem` だけしか使えませ" "ん。" -#: ../../c-api/intro.rst:442 +#: ../../c-api/intro.rst:366 msgid "" "Equivalent code for populating a list can be written using :c:func:" "`PyList_New` and :c:func:`PyList_SetItem`." @@ -689,7 +604,7 @@ msgstr "" "同じく、リストに値を入れていくコードは :c:func:`PyList_New` と :c:func:" "`PyList_SetItem` で書けます。" -#: ../../c-api/intro.rst:445 +#: ../../c-api/intro.rst:369 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:" @@ -703,50 +618,23 @@ msgstr "" "基づいて C の値から生成できます。例えば、上の二種類のコードブロックは、以下の" "ように置き換えられます (エラーチェックにも配慮しています)::" -#: ../../c-api/intro.rst:451 -msgid "" -"PyObject *tuple, *list;\n" -"\n" -"tuple = Py_BuildValue(\"(iis)\", 1, 2, \"three\");\n" -"list = Py_BuildValue(\"[iis]\", 1, 2, \"three\");" -msgstr "" - -#: ../../c-api/intro.rst:456 +#: ../../c-api/intro.rst:380 msgid "" "It is much more common to use :c:func:`PyObject_SetItem` and friends with " "items whose references you are only borrowing, like arguments that were " "passed in to the function you are writing. In that case, their behaviour " -"regarding references is much saner, since you don't have to take a new " -"reference just so you can give that reference away (\"have it be stolen\"). " +"regarding reference counts is much saner, since you don't have to increment " +"a reference count so you can give a reference away (\"have it be stolen\"). " "For example, this function sets all items of a list (actually, any mutable " "sequence) to a given item::" msgstr "" +"自作の関数に渡す引数のように、単に参照を借りるだけの要素に対しては、 :c:func:" +"`PyObject_SetItem` とその仲間を使うのがはるかに一般的です。その場合、参照カウ" +"ントをインクリメントする必要がなく、参照を引き渡せる (\"参照を盗み取らせられ" +"る\") ので、参照カウントに関する動作はより健全になります。例えば、以下の関数" +"は与えられた要素をリスト中の全ての要素の値にセットします::" -#: ../../c-api/intro.rst:463 -msgid "" -"int\n" -"set_all(PyObject *target, PyObject *item)\n" -"{\n" -" Py_ssize_t i, n;\n" -"\n" -" n = PyObject_Length(target);\n" -" if (n < 0)\n" -" return -1;\n" -" for (i = 0; i < n; i++) {\n" -" PyObject *index = PyLong_FromSsize_t(i);\n" -" if (!index)\n" -" return -1;\n" -" if (PyObject_SetItem(target, index, item) < 0) {\n" -" Py_DECREF(index);\n" -" return -1;\n" -" }\n" -" Py_DECREF(index);\n" -" }\n" -" return 0;\n" -"}" -msgstr "" - -#: ../../c-api/intro.rst:486 +#: ../../c-api/intro.rst:410 msgid "" "The situation is slightly different for function return values. While " "passing a reference to most functions does not change your ownership " @@ -767,7 +655,7 @@ msgstr "" "`PySequence_GetItem` のように、オブジェクトに対する参照を返す汎用の関数は、常" "に新たな参照を返します (呼び出し側が参照の所有者になります)。" -#: ../../c-api/intro.rst:495 +#: ../../c-api/intro.rst:419 msgid "" "It is important to realize that whether you own a reference returned by a " "function depends on which function you call only --- *the plumage* (the type " @@ -785,7 +673,7 @@ msgstr "" "この関数は全く同じ引数をとります) を使って取り出すと、返されたオブジェクトに" "対する参照を得ます。" -#: ../../c-api/intro.rst:507 +#: ../../c-api/intro.rst:431 msgid "" "Here is an example of how you could write a function that computes the sum " "of the items in a list of integers; once using :c:func:`PyList_GetItem`, " @@ -795,96 +683,26 @@ msgstr "" "書けるかを示した例です; 一つは :c:func:`PyList_GetItem` を使っていて、もう一" "つは :c:func:`PySequence_GetItem` を使っています。 ::" -#: ../../c-api/intro.rst:511 -msgid "" -"long\n" -"sum_list(PyObject *list)\n" -"{\n" -" Py_ssize_t i, n;\n" -" long total = 0, value;\n" -" PyObject *item;\n" -"\n" -" n = PyList_Size(list);\n" -" if (n < 0)\n" -" return -1; /* Not a list */\n" -" for (i = 0; i < n; i++) {\n" -" item = PyList_GetItem(list, i); /* Can't fail */\n" -" if (!PyLong_Check(item)) continue; /* Skip non-integers */\n" -" value = PyLong_AsLong(item);\n" -" if (value == -1 && PyErr_Occurred())\n" -" /* Integer too big to fit in a C long, bail out */\n" -" return -1;\n" -" total += value;\n" -" }\n" -" return total;\n" -"}" -msgstr "" - -#: ../../c-api/intro.rst:537 -msgid "" -"long\n" -"sum_sequence(PyObject *sequence)\n" -"{\n" -" Py_ssize_t i, n;\n" -" long total = 0, value;\n" -" PyObject *item;\n" -" n = PySequence_Length(sequence);\n" -" if (n < 0)\n" -" return -1; /* Has no length */\n" -" for (i = 0; i < n; i++) {\n" -" item = PySequence_GetItem(sequence, i);\n" -" if (item == NULL)\n" -" return -1; /* Not a sequence, or other failure */\n" -" if (PyLong_Check(item)) {\n" -" value = PyLong_AsLong(item);\n" -" Py_DECREF(item);\n" -" if (value == -1 && PyErr_Occurred())\n" -" /* Integer too big to fit in a C long, bail out */\n" -" return -1;\n" -" total += value;\n" -" }\n" -" else {\n" -" Py_DECREF(item); /* Discard reference ownership */\n" -" }\n" -" }\n" -" return total;\n" -"}" -msgstr "" - -#: ../../c-api/intro.rst:571 +#: ../../c-api/intro.rst:495 msgid "Types" msgstr "型" -#: ../../c-api/intro.rst:573 +#: ../../c-api/intro.rst:497 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 " +"API; most are simple C types such as :c:type:`int`, :c:type:`long`, :c:type:" +"`double` and :c:type:`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:expr:`int`, :c:expr:`long`, :c:expr:`double`, および :c:expr:" -"`char*` といった、単なる C のデータ型です。また、モジュールで公開している関数" -"を列挙する際に用いられる静的なテーブルや、新しいオブジェクト型におけるデータ" -"属性を記述したり、複素数の値を記述したりするために構造体をいくつか使っていま" -"す。これらの型については、その型を使う関数とともに説明してゆきます。" - -#: ../../c-api/intro.rst:583 -msgid "" -"A signed integral type such that ``sizeof(Py_ssize_t) == sizeof(size_t)``. " -"C99 doesn't define such a thing directly (size_t is an unsigned integral " -"type). See :pep:`353` for details. ``PY_SSIZE_T_MAX`` is the largest " -"positive value of type :c:type:`Py_ssize_t`." -msgstr "" -#: ../../c-api/intro.rst:592 +#: ../../c-api/intro.rst:509 msgid "Exceptions" msgstr "例外" -#: ../../c-api/intro.rst:594 +#: ../../c-api/intro.rst:511 msgid "" "The Python programmer only needs to deal with exceptions if specific error " "handling is required; unhandled exceptions are automatically propagated to " @@ -897,7 +715,7 @@ msgstr "" "具合に、トップレベルのインタプリタ層まで自動的に伝播します。インタプリタ層" "は、スタックトレースバックと合わせて例外をユーザに報告します。" -#: ../../c-api/intro.rst:602 +#: ../../c-api/intro.rst:519 msgid "" "For C programmers, however, error checking always has to be explicit. All " "functions in the Python/C API can raise exceptions, unless an explicit claim " @@ -922,7 +740,7 @@ msgstr "" "で、 :c:func:`PyErr_Occurred` で明示的にエラーテストを行う必要があります。こ" "れらの例外は常に明示的にドキュメント化されます。" -#: ../../c-api/intro.rst:617 +#: ../../c-api/intro.rst:534 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 " @@ -945,7 +763,7 @@ msgstr "" "い) 例外を設定するための関数で、 :c:func:`PyErr_Clear` は例外状態情報を消し去" "る関数です。" -#: ../../c-api/intro.rst:627 +#: ../../c-api/intro.rst:544 msgid "" "The full exception state consists of three objects (all of which can be " "``NULL``): the exception type, the corresponding exception value, and the " @@ -967,7 +785,7 @@ msgstr "" "ンタプリタのメインループに到達するまで、例外が関数の間で受け渡しされている間" "だけです。" -#: ../../c-api/intro.rst:639 +#: ../../c-api/intro.rst:556 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." @@ -991,7 +809,7 @@ msgstr "" "グを抑止しています; また、トレースバック内のスタックフレームで参照されている" "オブジェクトがしばしば不必要に寿命を永らえていたのをなくしています。" -#: ../../c-api/intro.rst:650 +#: ../../c-api/intro.rst:567 msgid "" "As a general principle, a function that calls another function to perform " "some task should check whether the called function raised an exception, and " @@ -1009,76 +827,25 @@ msgstr "" "送出されたばかりの例外を上書きしてしまい、エラーの原因そのものに関する重要な" "情報を失うことになります。" -#: ../../c-api/intro.rst:659 +#: ../../c-api/intro.rst:576 msgid "" "A simple example of detecting exceptions and passing them on is shown in " -"the :c:func:`!sum_sequence` example above. It so happens that this example " +"the :c:func:`sum_sequence` example above. It so happens that this example " "doesn't need to clean up any owned references when it detects an error. The " "following example function shows some error cleanup. First, to remind you " "why you like Python, we show the equivalent Python code::" msgstr "" +"例外を検出して渡す例は、上の :c:func:`sum_sequence` で示しています。偶然に" +"も、この例ではエラーを検出した際に何ら参照を放棄する必要がありません。以下の" +"関数の例では、エラーに対する後始末について示しています。まず、どうして " +"Python で書くのが好きか思い出してもらうために、等価な Python コードを示しま" +"す::" -#: ../../c-api/intro.rst:665 -msgid "" -"def incr_item(dict, key):\n" -" try:\n" -" item = dict[key]\n" -" except KeyError:\n" -" item = 0\n" -" dict[key] = item + 1" -msgstr "" - -#: ../../c-api/intro.rst:674 +#: ../../c-api/intro.rst:591 msgid "Here is the corresponding C code, in all its glory::" msgstr "以下は対応するコードを C で完璧に書いたものです::" -#: ../../c-api/intro.rst:676 -msgid "" -"int\n" -"incr_item(PyObject *dict, PyObject *key)\n" -"{\n" -" /* Objects all initialized to NULL for Py_XDECREF */\n" -" PyObject *item = NULL, *const_one = NULL, *incremented_item = NULL;\n" -" int rv = -1; /* Return value initialized to -1 (failure) */\n" -"\n" -" item = PyObject_GetItem(dict, key);\n" -" if (item == NULL) {\n" -" /* Handle KeyError only: */\n" -" if (!PyErr_ExceptionMatches(PyExc_KeyError))\n" -" goto error;\n" -"\n" -" /* Clear the error and use zero: */\n" -" PyErr_Clear();\n" -" item = PyLong_FromLong(0L);\n" -" if (item == NULL)\n" -" goto error;\n" -" }\n" -" const_one = PyLong_FromLong(1L);\n" -" if (const_one == NULL)\n" -" goto error;\n" -"\n" -" incremented_item = PyNumber_Add(item, const_one);\n" -" if (incremented_item == NULL)\n" -" goto error;\n" -"\n" -" if (PyObject_SetItem(dict, key, incremented_item) < 0)\n" -" goto error;\n" -" rv = 0; /* Success */\n" -" /* Continue with cleanup code */\n" -"\n" -" error:\n" -" /* Cleanup code, shared by success and failure path */\n" -"\n" -" /* Use Py_XDECREF() to ignore NULL references */\n" -" Py_XDECREF(item);\n" -" Py_XDECREF(const_one);\n" -" Py_XDECREF(incremented_item);\n" -"\n" -" return rv; /* -1 for error, 0 for success */\n" -"}" -msgstr "" - -#: ../../c-api/intro.rst:726 +#: ../../c-api/intro.rst:643 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:" @@ -1101,11 +868,11 @@ msgstr "" "敗) で初期化しておいて、最後の関数呼び出しまでうまくいった場合にのみ ``0`` " "(成功) に設定します。" -#: ../../c-api/intro.rst:740 +#: ../../c-api/intro.rst:657 msgid "Embedding Python" msgstr "Python の埋め込み" -#: ../../c-api/intro.rst:742 +#: ../../c-api/intro.rst:659 msgid "" "The one important task that only embedders (as opposed to extension writers) " "of the Python interpreter have to worry about is the initialization, and " @@ -1117,7 +884,7 @@ msgstr "" "(initialization)、そしておそらくは終了処理 (finalization) です。インタプリタ" "のほとんどの機能は、インタプリタの起動後しか使えません。" -#: ../../c-api/intro.rst:755 +#: ../../c-api/intro.rst:672 msgid "" "The basic initialization function is :c:func:`Py_Initialize`. This " "initializes the table of loaded modules, and creates the fundamental " @@ -1129,15 +896,20 @@ msgstr "" "`builtins`, :mod:`__main__`, および :mod:`sys` を作成します。また、モジュール" "検索パス (``sys.path``) の初期化も行います。" -#: ../../c-api/intro.rst:760 +#: ../../c-api/intro.rst:679 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 `." +"later, it must be set explicitly with a call to ``PySys_SetArgvEx(argc, " +"argv, updatepath)`` after the call to :c:func:`Py_Initialize`." msgstr "" +":c:func:`Py_Initialize` の中では、 \"スクリプトへの引数リスト\" (script " +"argument list, ``sys.argv`` のこと) を設定しません。この変数が後に実行される " +"Python コード中で必要なら、 :c:func:`Py_Initialize` の後で " +"``PySys_SetArgvEx(argc, argv, updatepath)`` を呼び出して明示的に設定しなけれ" +"ばなりません。" -#: ../../c-api/intro.rst:765 +#: ../../c-api/intro.rst:684 msgid "" "On most systems (in particular, on Unix and Windows, although the details " "are slightly different), :c:func:`Py_Initialize` calculates the module " @@ -1157,7 +929,7 @@ msgstr "" "レクトリからの相対で、 :file:`lib/python{X.Y}` という名前のディレクトリを探し" "ます。" -#: ../../c-api/intro.rst:774 +#: ../../c-api/intro.rst:693 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/" @@ -1168,25 +940,34 @@ msgid "" "in front of the standard path by setting :envvar:`PYTHONPATH`." msgstr "" "例えば、 Python 実行形式が :file:`/usr/local/bin/python` で見つかったとする" -"と、ライブラリが :file:`/usr/local/lib/python{X.Y}` にあるものと仮定します。 " -"(実際には、このパスは \"フォールバック (fallback)\" のライブラリ位置でもあ" -"り、 :file:`python` が :envvar:`PATH` 上に無い場合に使われます。) ユーザは :" -"envvar:`PYTHONHOME` を設定することでこの動作をオーバーライドしたり、 :envvar:" -"`PYTHONPATH` を設定して追加のディレクトリを標準モジュール検索パスの前に挿入し" -"たりできます。" - -#: ../../c-api/intro.rst:788 -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:" +"と、 :c:func:`Py_Initialize` はライブラリが :file:`/usr/local/lib/python{X.Y}" +"` にあるものと仮定します。 (実際には、このパスは \"フォールバック " +"(fallback)\" のライブラリ位置でもあり、 :file:`python` が :envvar:`PATH` 上に" +"無い場合に使われます。) ユーザは :envvar:`PYTHONHOME` を設定することでこの動" +"作をオーバライドしたり、 :envvar:`PYTHONPATH` を設定して追加のディレクトリを" +"標準モジュール検索パスの前に挿入したりできます。" + +#: ../../c-api/intro.rst:708 +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`)." msgstr "" +"埋め込みを行うアプリケーションでは、 :c:func:`Py_Initialize` を呼び出す *前に" +"* ``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-api/intro.rst:799 +#: ../../c-api/intro.rst:718 msgid "" "Sometimes, it is desirable to \"uninitialize\" Python. For instance, the " "application may want to start over (make another call to :c:func:" @@ -1210,11 +991,11 @@ msgstr "" "モリを *解放するわけではない* ことに注意してください。例えば、拡張モジュール" "によって確保されたメモリは、現在のところ解放する事ができません。" -#: ../../c-api/intro.rst:813 +#: ../../c-api/intro.rst:732 msgid "Debugging Builds" msgstr "デバッグ版ビルド (Debugging Builds)" -#: ../../c-api/intro.rst:815 +#: ../../c-api/intro.rst:734 msgid "" "Python can be built with several macros to enable extra checks of the " "interpreter and extension modules. These checks tend to add a large amount " @@ -1225,13 +1006,13 @@ msgstr "" "大きなオーバーヘッドを生じる傾向があります。なので、デフォルトでは有効にされ" "ていません。" -#: ../../c-api/intro.rst:819 +#: ../../c-api/intro.rst:738 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 " +"most frequently-used builds will be described in the remainder of this " "section." msgstr "" "Pythonデバッグ版ビルドの全ての種類のリストが、Pythonソース配布(source " @@ -1240,246 +1021,102 @@ msgstr "" "ロファイリングが利用可能です。よく使われるビルドについてのみ、この節の残りの" "部分で説明します。" -#: ../../c-api/intro.rst:827 -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." -msgstr "" - -#: ../../c-api/intro.rst:835 +#: ../../c-api/intro.rst:744 msgid "" -"In addition to the reference count debugging described below, extra checks " -"are performed, see :ref:`Python Debug Build `." +"Compiling the interpreter with the :c:macro:`Py_DEBUG` macro defined " +"produces what is generally meant by \"a debug build\" of Python. :c:macro:" +"`Py_DEBUG` is enabled in the Unix build by adding ``--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` マクロを有効にしてコンパイルすると、一般的" +"に「デバッグビルド」といわれるPythonができます。 Unix では、 :file:`./" +"configure` コマンドに ``--with-pydebug`` を追加することで、 :c:macro:" +"`Py_DEBUG` が有効になります。その場合、暗黙的にPython専用ではない :c:macro:" +"`_DEBUG` も有効になります。 Unix ビルドでは、 :c:macro:`Py_DEBUG` が有効な場" +"合、コンパイラの最適化が無効になります。" -#: ../../c-api/intro.rst:838 +#: ../../c-api/intro.rst:751 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.)" +"In addition to the reference count debugging described below, the following " +"extra checks are performed:" msgstr "" -":c:macro:`Py_TRACE_REFS` を宣言すると、参照トレースが有効になります (:option:" -"`configure --with-trace-refs オプション <--with-trace-refs>` を参照してくださ" -"い)。全ての :c:type:`PyObject` に二つのフィールドを追加することで、使用中のオ" -"ブジェクトの循環二重連結リストが管理されます。全ての割り当て(allocation)がト" -"レースされます。終了時に、全ての残っているオブジェクトが表示されます。 (イン" -"タラクティブモードでは、インタプリタによる文の実行のたびに表示されます。)" +"あとで説明する参照カウントデバッグの他に、以下の追加チェックも有効になります:" -#: ../../c-api/intro.rst:845 -msgid "" -"Please refer to :file:`Misc/SpecialBuilds.txt` in the Python source " -"distribution for more detailed information." -msgstr "" -"より詳しい情報については、Pythonのソース配布(source distribution)の中の :" -"file:`Misc/SpecialBuilds.txt` を参照してください。" +#: ../../c-api/intro.rst:754 +msgid "Extra checks are added to the object allocator." +msgstr "object allocator に対する追加チェック。" -#: ../../c-api/intro.rst:852 -msgid "Recommended third party tools" -msgstr "おすすめのサードパーティツール" +#: ../../c-api/intro.rst:756 +msgid "Extra checks are added to the parser and compiler." +msgstr "パーサーとコンパイラに対する追加チェック。" -#: ../../c-api/intro.rst:854 +#: ../../c-api/intro.rst:758 msgid "" -"The following third party tools offer both simpler and more sophisticated " -"approaches to creating C, C++ and Rust extensions for Python:" -msgstr "" - -#: ../../c-api/intro.rst:857 -msgid "`Cython `_" -msgstr "" - -#: ../../c-api/intro.rst:858 -msgid "`cffi `_" -msgstr "" - -#: ../../c-api/intro.rst:859 -msgid "`HPy `_" -msgstr "" - -#: ../../c-api/intro.rst:860 -msgid "`nanobind `_ (C++)" -msgstr "" - -#: ../../c-api/intro.rst:861 -msgid "`Numba `_" -msgstr "" - -#: ../../c-api/intro.rst:862 -msgid "`pybind11 `_ (C++)" -msgstr "" - -#: ../../c-api/intro.rst:863 -msgid "`PyO3 `_ (Rust)" -msgstr "" - -#: ../../c-api/intro.rst:864 -msgid "`SWIG `_" +"Downcasts from wide types to narrow types are checked for loss of " +"information." msgstr "" +"情報損失のために、大きい型から小さい型へのダウンキャストに対するチェック。" -#: ../../c-api/intro.rst:866 +#: ../../c-api/intro.rst:760 msgid "" -"Using tools such as these can help avoid writing code that is tightly bound " -"to a particular version of CPython, avoid reference counting errors, and " -"focus more on your own code than on using the CPython API. In general, new " -"versions of Python can be supported by updating the tool, and your code will " -"often use newer and more efficient APIs automatically. Some tools also " -"support compiling for other implementations of Python from a single set of " -"sources." +"A number of assertions are added to the dictionary and set implementations. " +"In addition, the set object acquires a :meth:`test_c_api` method." msgstr "" +"辞書(dict)と集合(set)の実装に対する、いくつもの assertion の追加。加えて、集" +"合オブジェクトに :meth:`test_c_api` メソッドが追加されます。" -#: ../../c-api/intro.rst:873 -msgid "" -"These projects are not supported by the same people who maintain Python, and " -"issues need to be raised with the projects directly. Remember to check that " -"the project is still maintained and supported, as the list above may become " -"outdated." -msgstr "" +#: ../../c-api/intro.rst:763 +msgid "Sanity checks of the input arguments are added to frame creation." +msgstr "フレームを作成する時の、引数の健全性チェック。" -#: ../../c-api/intro.rst:880 +#: ../../c-api/intro.rst:765 msgid "" -"`Python Packaging User Guide: Binary Extensions `_" +"The storage for ints is initialized with a known invalid pattern to catch " +"reference to uninitialized digits." msgstr "" -"`Python Packaging User Guide: Binary Extensions `_" +"初期化されていない数に対する参照を検出するために、整数のストレージが特定の妥" +"当でないパターンで初期化されます。" -#: ../../c-api/intro.rst:881 +#: ../../c-api/intro.rst:768 msgid "" -"The Python Packaging User Guide not only covers several available tools that " -"simplify the creation of binary extensions, but also discusses the various " -"reasons why creating an extension module may be desirable in the first place." -msgstr "" -"Python Packaging User Guideはバイナリ拡張の作成が簡単になる便利なツールをカ" -"バーしているだけではなく、まず始めになぜ拡張モジュールを作ることが望ましいか" -"の様々な理由について議論しています。" +"Low-level tracing and extra exception checking are added to the runtime " +"virtual machine." +msgstr "低レベルトレースと追加例外チェックがVM runtimeに追加されます。" -#: ../../c-api/intro.rst:298 -msgid "object" -msgstr "object" +#: ../../c-api/intro.rst:771 +msgid "Extra checks are added to the memory arena implementation." +msgstr "メモリアリーナ(memory arena)の実装に対する追加チェック。" -#: ../../c-api/intro.rst:298 -msgid "type" -msgstr "type" +#: ../../c-api/intro.rst:773 +msgid "Extra debugging is added to the thread module." +msgstr "threadモジュールに対する追加デバッグ機能." -#: ../../c-api/intro.rst:337 -msgid "Py_INCREF (C function)" -msgstr "" +#: ../../c-api/intro.rst:775 +msgid "There may be additional checks not mentioned here." +msgstr "ここで言及されていない追加チェックもあるでしょう。" -#: ../../c-api/intro.rst:337 -msgid "Py_DECREF (C function)" -msgstr "" - -#: ../../c-api/intro.rst:413 -msgid "PyList_SetItem (C function)" -msgstr "" - -#: ../../c-api/intro.rst:413 -msgid "PyTuple_SetItem (C function)" -msgstr "" - -#: ../../c-api/intro.rst:484 -msgid "set_all()" -msgstr "set_all()" - -#: ../../c-api/intro.rst:503 -msgid "PyList_GetItem (C function)" -msgstr "" - -#: ../../c-api/intro.rst:503 -msgid "PySequence_GetItem (C function)" -msgstr "" - -#: ../../c-api/intro.rst:533 -msgid "sum_list()" -msgstr "sum_list()" - -#: ../../c-api/intro.rst:565 ../../c-api/intro.rst:657 -msgid "sum_sequence()" -msgstr "sum_sequence()" - -#: ../../c-api/intro.rst:600 -msgid "PyErr_Occurred (C function)" -msgstr "" - -#: ../../c-api/intro.rst:613 -msgid "PyErr_SetString (C function)" -msgstr "" - -#: ../../c-api/intro.rst:613 ../../c-api/intro.rst:721 -msgid "PyErr_Clear (C function)" -msgstr "" - -#: ../../c-api/intro.rst:637 -msgid "exc_info (in module sys)" -msgstr "exc_info (sys モジュール)" - -#: ../../c-api/intro.rst:672 ../../c-api/intro.rst:719 -msgid "incr_item()" -msgstr "incr_item()" - -#: ../../c-api/intro.rst:721 -msgid "PyErr_ExceptionMatches (C function)" -msgstr "" - -#: ../../c-api/intro.rst:721 -msgid "Py_XDECREF (C function)" -msgstr "" - -#: ../../c-api/intro.rst:747 -msgid "Py_Initialize (C function)" -msgstr "" - -#: ../../c-api/intro.rst:747 -msgid "module" -msgstr "module" - -#: ../../c-api/intro.rst:747 -msgid "builtins" -msgstr "builtins" - -#: ../../c-api/intro.rst:747 -msgid "__main__" -msgstr "__main__" - -#: ../../c-api/intro.rst:747 -msgid "sys" -msgstr "sys" - -#: ../../c-api/intro.rst:747 -msgid "search" -msgstr "検索" - -#: ../../c-api/intro.rst:747 -msgid "path" -msgstr "パス" - -#: ../../c-api/intro.rst:747 -msgid "path (in module sys)" -msgstr "path (sys モジュール)" - -#: ../../c-api/intro.rst:782 -msgid "Py_GetPath (C function)" -msgstr "" - -#: ../../c-api/intro.rst:782 -msgid "Py_GetPrefix (C function)" -msgstr "" - -#: ../../c-api/intro.rst:782 -msgid "Py_GetExecPrefix (C function)" -msgstr "" - -#: ../../c-api/intro.rst:782 -msgid "Py_GetProgramFullPath (C function)" +#: ../../c-api/intro.rst:777 +msgid "" +"Defining :c:macro:`Py_TRACE_REFS` enables reference tracing. 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.) Implied by :c:" +"macro:`Py_DEBUG`." msgstr "" +":c:macro:`Py_TRACE_REFS` を宣言すると、参照トレースが有効になります。全ての :" +"c:type:`PyObject` に二つのフィールドを追加することで、使用中のオブジェクトの" +"循環二重連結リストが管理されます。全ての割り当て(allocation)がトレースされま" +"す。終了時に、全ての残っているオブジェクトが表示されます。 (インタラクティブ" +"モードでは、インタプリタによる文の実行のたびに表示されます) Py_TRACE_REFS " +"は :c:macro:`Py_DEBUG` によって暗黙的に有効になります。" -#: ../../c-api/intro.rst:797 -msgid "Py_IsInitialized (C function)" +#: ../../c-api/intro.rst:783 +msgid "" +"Please refer to :file:`Misc/SpecialBuilds.txt` in the Python source " +"distribution for more detailed information." msgstr "" +"より詳しい情報については、Pythonのソース配布(source distribution)の中の :" +"file:`Misc/SpecialBuilds.txt` を参照してください。" diff --git a/c-api/iter.po b/c-api/iter.po index 5cce71271..1759b6635 100644 --- a/c-api/iter.po +++ b/c-api/iter.po @@ -1,25 +1,27 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 +# Osamu NAKAMURA, 2017 +# Arihiro TAKASE, 2017 +# tomo, 2019 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:49+0000\n" -"Last-Translator: tomo, 2021\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-07 05:06+0000\n" +"PO-Revision-Date: 2017-02-16 17:36+0000\n" +"Last-Translator: tomo, 2019\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/iter.rst:6 @@ -32,60 +34,26 @@ msgstr "イテレータを扱うための固有の関数は二つあります。 #: ../../c-api/iter.rst:12 msgid "" -"Return non-zero if the object *o* can be safely passed to :c:func:" -"`PyIter_NextItem` and ``0`` otherwise. This function always succeeds." +"Return true if the object *o* supports the iterator protocol. This function " +"always succeeds." msgstr "" #: ../../c-api/iter.rst:18 msgid "" -"Return non-zero if the object *o* provides the :class:`AsyncIterator` " -"protocol, and ``0`` otherwise. This function always succeeds." -msgstr "" - -#: ../../c-api/iter.rst:25 -msgid "" -"Return ``1`` and set *item* to a :term:`strong reference` of the next value " -"of the iterator *iter* on success. Return ``0`` and set *item* to ``NULL`` " -"if there are no remaining values. Return ``-1``, set *item* to ``NULL`` and " -"set an exception on error." -msgstr "" - -#: ../../c-api/iter.rst:34 -msgid "" -"This is an older version of :c:func:`!PyIter_NextItem`, which is retained " -"for backwards compatibility. Prefer :c:func:`PyIter_NextItem`." -msgstr "" - -#: ../../c-api/iter.rst:38 -msgid "" -"Return the next value from the iterator *o*. The object must be an iterator " -"according to :c:func:`PyIter_Check` (it is up to the caller to check this). " -"If there are no remaining values, returns ``NULL`` with no exception set. If " -"an error occurs while retrieving the item, returns ``NULL`` and passes along " -"the exception." -msgstr "" - -#: ../../c-api/iter.rst:46 -msgid "" -"The enum value used to represent different results of :c:func:`PyIter_Send`." -msgstr "" - -#: ../../c-api/iter.rst:53 -msgid "Sends the *arg* value into the iterator *iter*. Returns:" -msgstr "" - -#: ../../c-api/iter.rst:55 -msgid "" -"``PYGEN_RETURN`` if iterator returns. Return value is returned via *presult*." -msgstr "" - -#: ../../c-api/iter.rst:56 -msgid "" -"``PYGEN_NEXT`` if iterator yields. Yielded value is returned via *presult*." +"Return the next value from the iteration *o*. The object must be an " +"iterator (it is up to the caller to check this). If there are no remaining " +"values, returns ``NULL`` with no exception set. If an error occurs while " +"retrieving the item, returns ``NULL`` and passes along the exception." msgstr "" +"反復処理 *o* における次の値を返します。オブジェクトはイテレータでなければなり" +"ません (これをチェックするのは呼び出し側の責任です)。要素が何も残っていない場" +"合は、例外がセットされていない状態で ``NULL`` を返します。要素を取り出す際に" +"エラーが生じた場合は、 ``NULL`` を返し、発生した例外を送出します。" -#: ../../c-api/iter.rst:57 +#: ../../c-api/iter.rst:23 msgid "" -"``PYGEN_ERROR`` if iterator has raised and exception. *presult* is set to " -"``NULL``." +"To write a loop which iterates over an iterator, the C code should look " +"something like this::" msgstr "" +"イテレータの返す要素にわたって反復処理を行うループを書くと、C のコードは以下" +"のようになるはずです::" diff --git a/c-api/iterator.po b/c-api/iterator.po index 59a0b1714..d4cfdf172 100644 --- a/c-api/iterator.po +++ b/c-api/iterator.po @@ -1,26 +1,26 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: +# Arihiro TAKASE, 2017 # tomo, 2021 -# Taichi Haradaguchi, 2024 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:49+0000\n" -"Last-Translator: Taichi Haradaguchi, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-07 05:06+0000\n" +"PO-Revision-Date: 2017-02-16 17:36+0000\n" +"Last-Translator: tomo, 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/iterator.rst:6 @@ -30,14 +30,14 @@ msgstr "イテレータオブジェクト (iterator object)" #: ../../c-api/iterator.rst:8 msgid "" "Python provides two general-purpose iterator objects. The first, a sequence " -"iterator, works with an arbitrary sequence supporting the :meth:`~object." -"__getitem__` method. The second works with a callable object and a sentinel " -"value, calling the callable for each item in the sequence, and ending the " -"iteration when the sentinel value is returned." +"iterator, works with an arbitrary sequence supporting the :meth:" +"`__getitem__` method. The second works with a callable object and a " +"sentinel value, calling the callable for each item in the sequence, and " +"ending the iteration when the sentinel value is returned." msgstr "" "Python では二種類のイテレータオブジェクトを提供しています。一つ目はシーケンス" -"イテレータで、 :meth:`~object.__getitem__` メソッドをサポートする任意のシーケ" -"ンスを取り扱います。二つ目は呼び出し可能オブジェクトと番兵 (sentinel value) " +"イテレータで、 :meth:`__getitem__` メソッドをサポートする任意のシーケンスを取" +"り扱います。二つ目は呼び出し可能オブジェクトとセンチネル値 (sentinel value) " "を扱い、シーケンス内の要素ごとに呼び出し可能オブジェクトを呼び出して、センチ" "ネル値が返されたときに反復処理を終了します。" diff --git a/c-api/lifecycle.po b/c-api/lifecycle.po deleted file mode 100644 index caf6b350c..000000000 --- a/c-api/lifecycle.po +++ /dev/null @@ -1,364 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation -# This file is distributed under the same license as the Python package. -# FIRST AUTHOR , YEAR. -# -# Translators: -# tomo, 2025 -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: Python 3.14\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-06 14:20+0000\n" -"PO-Revision-Date: 2025-05-23 14:21+0000\n" -"Last-Translator: tomo, 2025\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" -"ja/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#: ../../c-api/lifecycle.rst:6 -msgid "Object Life Cycle" -msgstr "" - -#: ../../c-api/lifecycle.rst:8 -msgid "" -"This section explains how a type's slots relate to each other throughout the " -"life of an object. It is not intended to be a complete canonical reference " -"for the slots; instead, refer to the slot-specific documentation in :ref:" -"`type-structs` for details about a particular slot." -msgstr "" - -#: ../../c-api/lifecycle.rst:15 -msgid "Life Events" -msgstr "" - -#: ../../c-api/lifecycle.rst:17 -msgid "" -"The figure below illustrates the order of events that can occur throughout " -"an object's life. An arrow from *A* to *B* indicates that event *B* can " -"occur after event *A* has occurred, with the arrow's label indicating the " -"condition that must be true for *B* to occur after *A*." -msgstr "" - -#: ../../c-api/lifecycle.rst:55 ../../c-api/lifecycle.rst:62 -msgid "Diagram showing events in an object's life. Explained in detail below." -msgstr "" - -#: ../../c-api/lifecycle.rst:70 -msgid "Explanation:" -msgstr "" - -#: ../../c-api/lifecycle.rst:72 -msgid "When a new object is constructed by calling its type:" -msgstr "" - -#: ../../c-api/lifecycle.rst:74 -msgid ":c:member:`~PyTypeObject.tp_new` is called to create a new object." -msgstr "" - -#: ../../c-api/lifecycle.rst:75 -msgid "" -":c:member:`~PyTypeObject.tp_alloc` is directly called by :c:member:" -"`~PyTypeObject.tp_new` to allocate the memory for the new object." -msgstr "" - -#: ../../c-api/lifecycle.rst:78 -msgid "" -":c:member:`~PyTypeObject.tp_init` initializes the newly created object. :c:" -"member:`!tp_init` can be called again to re-initialize an object, if " -"desired. The :c:member:`!tp_init` call can also be skipped entirely, for " -"example by Python code calling :py:meth:`~object.__new__`." -msgstr "" - -#: ../../c-api/lifecycle.rst:83 -msgid "After :c:member:`!tp_init` completes, the object is ready to use." -msgstr "" - -#: ../../c-api/lifecycle.rst:84 -msgid "Some time after the last reference to an object is removed:" -msgstr "" - -#: ../../c-api/lifecycle.rst:86 -msgid "" -"If an object is not marked as *finalized*, it might be finalized by marking " -"it as *finalized* and calling its :c:member:`~PyTypeObject.tp_finalize` " -"function. Python does *not* finalize an object when the last reference to " -"it is deleted; use :c:func:`PyObject_CallFinalizerFromDealloc` to ensure " -"that :c:member:`~PyTypeObject.tp_finalize` is always called." -msgstr "" - -#: ../../c-api/lifecycle.rst:92 -msgid "" -"If the object is marked as finalized, :c:member:`~PyTypeObject.tp_clear` " -"might be called by the garbage collector to clear references held by the " -"object. It is *not* called when the object's reference count reaches zero." -msgstr "" - -#: ../../c-api/lifecycle.rst:96 -msgid "" -":c:member:`~PyTypeObject.tp_dealloc` is called to destroy the object. To " -"avoid code duplication, :c:member:`~PyTypeObject.tp_dealloc` typically calls " -"into :c:member:`~PyTypeObject.tp_clear` to free up the object's references." -msgstr "" - -#: ../../c-api/lifecycle.rst:100 -msgid "" -"When :c:member:`~PyTypeObject.tp_dealloc` finishes object destruction, it " -"directly calls :c:member:`~PyTypeObject.tp_free` (usually set to :c:func:" -"`PyObject_Free` or :c:func:`PyObject_GC_Del` automatically as appropriate " -"for the type) to deallocate the memory." -msgstr "" - -#: ../../c-api/lifecycle.rst:105 -msgid "" -"The :c:member:`~PyTypeObject.tp_finalize` function is permitted to add a " -"reference to the object if desired. If it does, the object is " -"*resurrected*, preventing its pending destruction. (Only :c:member:`!" -"tp_finalize` is allowed to resurrect an object; :c:member:`~PyTypeObject." -"tp_clear` and :c:member:`~PyTypeObject.tp_dealloc` cannot without calling " -"into :c:member:`!tp_finalize`.) Resurrecting an object may or may not cause " -"the object's *finalized* mark to be removed. Currently, Python does not " -"remove the *finalized* mark from a resurrected object if it supports garbage " -"collection (i.e., the :c:macro:`Py_TPFLAGS_HAVE_GC` flag is set) but does " -"remove the mark if the object does not support garbage collection; either or " -"both of these behaviors may change in the future." -msgstr "" - -#: ../../c-api/lifecycle.rst:118 -msgid "" -":c:member:`~PyTypeObject.tp_dealloc` can optionally call :c:member:" -"`~PyTypeObject.tp_finalize` via :c:func:`PyObject_CallFinalizerFromDealloc` " -"if it wishes to reuse that code to help with object destruction. This is " -"recommended because it guarantees that :c:member:`!tp_finalize` is always " -"called before destruction. See the :c:member:`~PyTypeObject.tp_dealloc` " -"documentation for example code." -msgstr "" - -#: ../../c-api/lifecycle.rst:125 -msgid "" -"If the object is a member of a :term:`cyclic isolate` and either :c:member:" -"`~PyTypeObject.tp_clear` fails to break the reference cycle or the cyclic " -"isolate is not detected (perhaps :func:`gc.disable` was called, or the :c:" -"macro:`Py_TPFLAGS_HAVE_GC` flag was erroneously omitted in one of the " -"involved types), the objects remain indefinitely uncollectable (they " -"\"leak\"). See :data:`gc.garbage`." -msgstr "" - -#: ../../c-api/lifecycle.rst:132 -msgid "" -"If the object is marked as supporting garbage collection (the :c:macro:" -"`Py_TPFLAGS_HAVE_GC` flag is set in :c:member:`~PyTypeObject.tp_flags`), the " -"following events are also possible:" -msgstr "" - -#: ../../c-api/lifecycle.rst:136 -msgid "" -"The garbage collector occasionally calls :c:member:`~PyTypeObject." -"tp_traverse` to identify :term:`cyclic isolates `." -msgstr "" - -#: ../../c-api/lifecycle.rst:139 -msgid "" -"When the garbage collector discovers a :term:`cyclic isolate`, it finalizes " -"one of the objects in the group by marking it as *finalized* and calling " -"its :c:member:`~PyTypeObject.tp_finalize` function, if it has one. This " -"repeats until the cyclic isolate doesn't exist or all of the objects have " -"been finalized." -msgstr "" - -#: ../../c-api/lifecycle.rst:144 -msgid "" -":c:member:`~PyTypeObject.tp_finalize` is permitted to resurrect the object " -"by adding a reference from outside the :term:`cyclic isolate`. The new " -"reference causes the group of objects to no longer form a cyclic isolate " -"(the reference cycle may still exist, but if it does the objects are no " -"longer isolated)." -msgstr "" - -#: ../../c-api/lifecycle.rst:149 -msgid "" -"When the garbage collector discovers a :term:`cyclic isolate` and all of the " -"objects in the group have already been marked as *finalized*, the garbage " -"collector clears one or more of the uncleared objects in the group (possibly " -"concurrently) by calling each's :c:member:`~PyTypeObject.tp_clear` " -"function. This repeats as long as the cyclic isolate still exists and not " -"all of the objects have been cleared." -msgstr "" - -#: ../../c-api/lifecycle.rst:158 -msgid "Cyclic Isolate Destruction" -msgstr "" - -#: ../../c-api/lifecycle.rst:160 -msgid "" -"Listed below are the stages of life of a hypothetical :term:`cyclic isolate` " -"that continues to exist after each member object is finalized or cleared. " -"It is a memory leak if a cyclic isolate progresses through all of these " -"stages; it should vanish once all objects are cleared, if not sooner. A " -"cyclic isolate can vanish either because the reference cycle is broken or " -"because the objects are no longer isolated due to finalizer resurrection " -"(see :c:member:`~PyTypeObject.tp_finalize`)." -msgstr "" - -#: ../../c-api/lifecycle.rst:168 -msgid "" -"**Reachable** (not yet a cyclic isolate): All objects are in their normal, " -"reachable state. A reference cycle could exist, but an external reference " -"means the objects are not yet isolated." -msgstr "" - -#: ../../c-api/lifecycle.rst:171 -msgid "" -"**Unreachable but consistent:** The final reference from outside the cyclic " -"group of objects has been removed, causing the objects to become isolated " -"(thus a cyclic isolate is born). None of the group's objects have been " -"finalized or cleared yet. The cyclic isolate remains at this stage until " -"some future run of the garbage collector (not necessarily the next run " -"because the next run might not scan every object)." -msgstr "" - -#: ../../c-api/lifecycle.rst:177 -msgid "" -"**Mix of finalized and not finalized:** Objects in a cyclic isolate are " -"finalized one at a time, which means that there is a period of time when the " -"cyclic isolate is composed of a mix of finalized and non-finalized objects. " -"Finalization order is unspecified, so it can appear random. A finalized " -"object must behave in a sane manner when non-finalized objects interact with " -"it, and a non-finalized object must be able to tolerate the finalization of " -"an arbitrary subset of its referents." -msgstr "" - -#: ../../c-api/lifecycle.rst:184 -msgid "" -"**All finalized:** All objects in a cyclic isolate are finalized before any " -"of them are cleared." -msgstr "" - -#: ../../c-api/lifecycle.rst:186 -msgid "" -"**Mix of finalized and cleared:** The objects can be cleared serially or " -"concurrently (but with the :term:`GIL` held); either way, some will finish " -"before others. A finalized object must be able to tolerate the clearing of " -"a subset of its referents. :pep:`442` calls this stage \"cyclic trash\"." -msgstr "" - -#: ../../c-api/lifecycle.rst:190 -msgid "" -"**Leaked:** If a cyclic isolate still exists after all objects in the group " -"have been finalized and cleared, then the objects remain indefinitely " -"uncollectable (see :data:`gc.garbage`). It is a bug if a cyclic isolate " -"reaches this stage---it means the :c:member:`~PyTypeObject.tp_clear` methods " -"of the participating objects have failed to break the reference cycle as " -"required." -msgstr "" - -#: ../../c-api/lifecycle.rst:197 -msgid "" -"If :c:member:`~PyTypeObject.tp_clear` did not exist, then Python would have " -"no way to safely break a reference cycle. Simply destroying an object in a " -"cyclic isolate would result in a dangling pointer, triggering undefined " -"behavior when an object referencing the destroyed object is itself " -"destroyed. The clearing step makes object destruction a two-phase process: " -"first :c:member:`~PyTypeObject.tp_clear` is called to partially destroy the " -"objects enough to detangle them from each other, then :c:member:" -"`~PyTypeObject.tp_dealloc` is called to complete the destruction." -msgstr "" - -#: ../../c-api/lifecycle.rst:206 -msgid "" -"Unlike clearing, finalization is not a phase of destruction. A finalized " -"object must still behave properly by continuing to fulfill its design " -"contracts. An object's finalizer is allowed to execute arbitrary Python " -"code, and is even allowed to prevent the impending destruction by adding a " -"reference. The finalizer is only related to destruction by call order---if " -"it runs, it runs before destruction, which starts with :c:member:" -"`~PyTypeObject.tp_clear` (if called) and concludes with :c:member:" -"`~PyTypeObject.tp_dealloc`." -msgstr "" - -#: ../../c-api/lifecycle.rst:214 -msgid "" -"The finalization step is not necessary to safely reclaim the objects in a " -"cyclic isolate, but its existence makes it easier to design types that " -"behave in a sane manner when objects are cleared. Clearing an object might " -"necessarily leave it in a broken, partially destroyed state---it might be " -"unsafe to call any of the cleared object's methods or access any of its " -"attributes. With finalization, only finalized objects can possibly interact " -"with cleared objects; non-finalized objects are guaranteed to interact with " -"only non-cleared (but potentially finalized) objects." -msgstr "" - -#: ../../c-api/lifecycle.rst:223 -msgid "To summarize the possible interactions:" -msgstr "" - -#: ../../c-api/lifecycle.rst:225 -msgid "" -"A non-finalized object might have references to or from non-finalized and " -"finalized objects, but not to or from cleared objects." -msgstr "" - -#: ../../c-api/lifecycle.rst:227 -msgid "" -"A finalized object might have references to or from non-finalized, " -"finalized, and cleared objects." -msgstr "" - -#: ../../c-api/lifecycle.rst:229 -msgid "" -"A cleared object might have references to or from finalized and cleared " -"objects, but not to or from non-finalized objects." -msgstr "" - -#: ../../c-api/lifecycle.rst:232 -msgid "" -"Without any reference cycles, an object can be simply destroyed once its " -"last reference is deleted; the finalization and clearing steps are not " -"necessary to safely reclaim unused objects. However, it can be useful to " -"automatically call :c:member:`~PyTypeObject.tp_finalize` and :c:member:" -"`~PyTypeObject.tp_clear` before destruction anyway because type design is " -"simplified when all objects always experience the same series of events " -"regardless of whether they participated in a cyclic isolate. Python " -"currently only calls :c:member:`~PyTypeObject.tp_finalize` and :c:member:" -"`~PyTypeObject.tp_clear` as needed to destroy a cyclic isolate; this may " -"change in a future version." -msgstr "" - -#: ../../c-api/lifecycle.rst:244 -msgid "Functions" -msgstr "関数" - -#: ../../c-api/lifecycle.rst:246 -msgid "To allocate and free memory, see :ref:`allocating-objects`." -msgstr "" - -#: ../../c-api/lifecycle.rst:251 -msgid "" -"Finalizes the object as described in :c:member:`~PyTypeObject.tp_finalize`. " -"Call this function (or :c:func:`PyObject_CallFinalizerFromDealloc`) instead " -"of calling :c:member:`~PyTypeObject.tp_finalize` directly because this " -"function may deduplicate multiple calls to :c:member:`!tp_finalize`. " -"Currently, calls are only deduplicated if the type supports garbage " -"collection (i.e., the :c:macro:`Py_TPFLAGS_HAVE_GC` flag is set); this may " -"change in the future." -msgstr "" - -#: ../../c-api/lifecycle.rst:262 -msgid "" -"Same as :c:func:`PyObject_CallFinalizer` but meant to be called at the " -"beginning of the object's destructor (:c:member:`~PyTypeObject.tp_dealloc`). " -"There must not be any references to the object. If the object's finalizer " -"resurrects the object, this function returns -1; no further destruction " -"should happen. Otherwise, this function returns 0 and destruction can " -"continue normally." -msgstr "" - -#: ../../c-api/lifecycle.rst:271 -msgid ":c:member:`~PyTypeObject.tp_dealloc` for example code." -msgstr "" diff --git a/c-api/list.po b/c-api/list.po index 451c6ef02..0bada76d6 100644 --- a/c-api/list.po +++ b/c-api/list.po @@ -1,27 +1,29 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Arihiro TAKASE, 2023 -# Nozomu Kaneko , 2023 -# tomo, 2023 +# Nozomu Kaneko , 2017 +# 秘湯 , 2017 +# Osamu NAKAMURA, 2017 +# Arihiro TAKASE, 2017 +# tomo, 2021 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-13 14:21+0000\n" -"PO-Revision-Date: 2021-06-28 00:49+0000\n" -"Last-Translator: tomo, 2023\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-07 05:06+0000\n" +"PO-Revision-Date: 2017-02-16 17:36+0000\n" +"Last-Translator: tomo, 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/list.rst:6 @@ -67,15 +69,16 @@ msgstr "" #: ../../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` or :c:func:" -"`PyList_SET_ITEM()`. The following APIs are safe APIs before the list is " -"fully initialized: :c:func:`PyList_SetItem()` and :c:func:" -"`PyList_SET_ITEM()`." +"``NULL``. Thus you cannot use abstract API functions such as :c:func:" +"`PySequence_SetItem` or expose the object to Python code before setting all " +"items to a real object with :c:func:`PyList_SetItem`." msgstr "" +"*len* が0より大きいとき、返されるリストオブジェクトの要素には ``NULL`` がセッ" +"トされています。なので、 :c:func:`PyList_SetItem` で本当にオブジェクトをセッ" +"トするまでは、Pythonコードにこのオブジェクトを渡したり、 :c:func:" +"`PySequence_SetItem` のような抽象APIを利用してはいけません。" -#: ../../c-api/list.rst:53 +#: ../../c-api/list.rst:50 msgid "" "Return the length of the list object in *list*; this is equivalent to " "``len(list)`` on a list object." @@ -83,29 +86,31 @@ msgstr "" "リストオブジェクト *list* の長さを返します; リストオブジェクトにおける " "``len(list)`` と同じです。" -#: ../../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:56 +msgid "Macro form of :c:func:`PyList_Size` without error checking." +msgstr "" +"マクロ形式でできた :c:func:`PyList_Size` で、エラーチェックをしません。" -#: ../../c-api/list.rst:64 +#: ../../c-api/list.rst:61 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 (:code:`<0 or >=len(list)`), return " -"``NULL`` and set an :exc:`IndexError` exception." +"supported. If *index* is out of bounds (<0 or >=len(list)), return ``NULL`` " +"and set an :exc:`IndexError` exception." msgstr "" +"*list* の指すリストオブジェクト内の、位置 *index* にあるオブジェクトを返しま" +"す。\n" +"位置は非負である必要があり、リスト終端からのインデックスはサポートされていま" +"せん。\n" +"*index* が範囲を超えている場合、 ``NULL`` を返して :exc:`IndexError` 例外を" +"セットします。" -#: ../../c-api/list.rst:74 -msgid "" -"Like :c:func:`PyList_GetItemRef`, but returns a :term:`borrowed reference` " -"instead of a :term:`strong reference`." +#: ../../c-api/list.rst:69 +msgid "Macro form of :c:func:`PyList_GetItem` without error checking." msgstr "" +"マクロ形式でできた :c:func:`PyList_GetItem` で、エラーチェックをしません。" -#: ../../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:85 +#: ../../c-api/list.rst:74 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` " @@ -116,7 +121,7 @@ msgstr "" "*index* が範囲を越えている場合、 ``-1`` を返して :exc:`IndexError` をセットし" "ます。" -#: ../../c-api/list.rst:91 +#: ../../c-api/list.rst:80 msgid "" "This function \"steals\" a reference to *item* and discards a reference to " "an item already in the list at the affected position." @@ -124,7 +129,7 @@ msgstr "" "この関数は *item* への参照を \"盗み取り\" ます。また、変更先のインデクスにす" "でに別の要素が入っている場合、その要素に対する参照を放棄します。" -#: ../../c-api/list.rst:97 +#: ../../c-api/list.rst:86 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." @@ -133,13 +138,7 @@ msgstr "" "のマクロは、新たなリストのまだ要素を入れたことのない位置に要素を入れるときに" "のみ使います。" -#: ../../c-api/list.rst:100 -msgid "" -"Bounds checking is performed as an assertion if Python is built in :ref:" -"`debug mode ` or :option:`with assertions <--with-assertions>`." -msgstr "" - -#: ../../c-api/list.rst:106 +#: ../../c-api/list.rst:91 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 " @@ -150,7 +149,7 @@ msgstr "" "への参照を放棄 *しません* ; その結果、 *list* 中の位置 *i* で参照されていたオ" "ブジェクトがメモリリークを引き起こします。" -#: ../../c-api/list.rst:114 +#: ../../c-api/list.rst:99 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. " @@ -160,7 +159,7 @@ msgstr "" "と ``0`` を返します。失敗すると ``-1`` を返し、例外をセットします。``list." "insert(index, item)`` に類似した機能です。" -#: ../../c-api/list.rst:121 +#: ../../c-api/list.rst:106 msgid "" "Append the object *item* at the end of list *list*. Return ``0`` if " "successful; return ``-1`` and set an exception if unsuccessful. Analogous " @@ -170,7 +169,7 @@ msgstr "" "す; 失敗すると ``-1`` を返し、例外をセットします。``list.append(item)`` に類" "似した機能です。" -#: ../../c-api/list.rst:128 +#: ../../c-api/list.rst:113 msgid "" "Return a list of the objects in *list* containing the objects *between* " "*low* and *high*. Return ``NULL`` and set an exception if unsuccessful. " @@ -183,7 +182,7 @@ msgstr "" "``list[low:high]`` に類似した機能です。\n" "ただし、リストの末尾からのインデックスはサポートされていません。" -#: ../../c-api/list.rst:135 +#: ../../c-api/list.rst:120 msgid "" "Set the slice of *list* between *low* and *high* to the contents of " "*itemlist*. Analogous to ``list[low:high] = itemlist``. The *itemlist* may " @@ -198,33 +197,7 @@ msgstr "" "成功した場合には ``0`` を、失敗した場合には ``-1`` を返します。\n" "ただし、リストの末尾からのインデックスはサポートされていません。" -#: ../../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 +#: ../../c-api/list.rst:129 msgid "" "Sort the items of *list* in place. Return ``0`` on success, ``-1`` on " "failure. This is equivalent to ``list.sort()``." @@ -232,7 +205,7 @@ msgstr "" "*list* の内容をインプレースでソートします。成功した場合には ``0`` を、失敗し" "た場合には ``-1`` を返します。``list.sort()`` と同じです。" -#: ../../c-api/list.rst:174 +#: ../../c-api/list.rst:135 msgid "" "Reverse the items of *list* in place. Return ``0`` on success, ``-1`` on " "failure. This is the equivalent of ``list.reverse()``." @@ -240,30 +213,10 @@ msgstr "" "*list* の要素をインプレースで反転します。成功した場合には ``0`` を、失敗した" "場合には ``-1`` を返します。``list.reverse()`` と同じです。" -#: ../../c-api/list.rst:182 +#: ../../c-api/list.rst:143 msgid "" "Return a new tuple object containing the contents of *list*; equivalent to " "``tuple(list)``." msgstr "" "*list* の内容が入った新たなタプルオブジェクトを返します; ``tuple(list)`` と同" "じです。" - -#: ../../c-api/list.rst:8 -msgid "object" -msgstr "object" - -#: ../../c-api/list.rst:8 -msgid "list" -msgstr "list" - -#: ../../c-api/list.rst:51 ../../c-api/list.rst:180 -msgid "built-in function" -msgstr "組み込み関数" - -#: ../../c-api/list.rst:51 -msgid "len" -msgstr "len" - -#: ../../c-api/list.rst:180 -msgid "tuple" -msgstr "tuple" diff --git a/c-api/long.po b/c-api/long.po index 4f13d2cb1..486563bf0 100644 --- a/c-api/long.po +++ b/c-api/long.po @@ -1,28 +1,27 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Arihiro TAKASE, 2023 -# Osamu NAKAMURA, 2023 -# Taichi Haradaguchi, 2024 -# tomo, 2024 +# Arihiro TAKASE, 2017 +# Osamu NAKAMURA, 2017 +# tomo, 2020 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:49+0000\n" -"Last-Translator: tomo, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-07 05:06+0000\n" +"PO-Revision-Date: 2017-02-16 17:36+0000\n" +"Last-Translator: tomo, 2020\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/long.rst:6 @@ -82,19 +81,19 @@ msgstr "" #: ../../c-api/long.rst:43 msgid "" "The current implementation keeps an array of integer objects for all " -"integers between ``-5`` and ``256``. When you create an int in that range " +"integers between ``-5`` and ``256``, when you create an int in that range " "you actually just get back a reference to the existing object." msgstr "" "現在の実装では、``-5`` から ``256`` までの全ての整数に対する整数オブジェクト" -"の配列を保持します。この範囲の数を生成すると、実際には既存のオブジェクトに対" -"する参照が返るようになっています。" +"の配列を保持するようにしており、この範囲の数を生成すると、実際には既存のオブ" +"ジェクトに対する参照が返るようになっています。" #: ../../c-api/long.rst:50 msgid "" -"Return a new :c:type:`PyLongObject` object from a C :c:expr:`unsigned long`, " +"Return a new :c:type:`PyLongObject` object from a C :c:type:`unsigned long`, " "or ``NULL`` on failure." msgstr "" -"Cの :c:expr:`unsigned long` から新たな :c:type:`PyLongObject` オブジェクトを" +"Cの :c:type:`unsigned long` から新たな :c:type:`PyLongObject` オブジェクトを" "生成して返します。失敗した際には ``NULL`` を返します。" #: ../../c-api/long.rst:56 @@ -115,34 +114,21 @@ msgstr "" #: ../../c-api/long.rst:68 msgid "" -"Return a new :c:type:`PyLongObject` object from a C :c:expr:`long long`, or " +"Return a new :c:type:`PyLongObject` object from a C :c:type:`long long`, or " "``NULL`` on failure." msgstr "" -"C の :c:expr:`long long` 型から新たな :c:type:`PyLongObject` オブジェクトを生" +"C の :c:type:`long long` 型から新たな :c:type:`PyLongObject` オブジェクトを生" "成して返します。失敗のときには ``NULL`` を返します。" -#: ../../c-api/long.rst:75 -msgid "" -"Return a new :c:type:`PyLongObject` object from a signed C :c:expr:`int32_t` " -"or :c:expr:`int64_t`, or ``NULL`` with an exception set on failure." -msgstr "" - -#: ../../c-api/long.rst:84 +#: ../../c-api/long.rst:74 msgid "" -"Return a new :c:type:`PyLongObject` object from a C :c:expr:`unsigned long " +"Return a new :c:type:`PyLongObject` object from a C :c:type:`unsigned long " "long`, or ``NULL`` on failure." msgstr "" -"C の :c:expr:`unsigned long long` 型から新たな :c:type:`PyLongObject` オブ" +"C の :c:type:`unsigned long long` 型から新たな :c:type:`PyLongObject` オブ" "ジェクトを生成して返します。失敗のときには ``NULL`` を返します。" -#: ../../c-api/long.rst:91 -msgid "" -"Return a new :c:type:`PyLongObject` object from an unsigned C :c:expr:" -"`uint32_t` or :c:expr:`uint64_t`, or ``NULL`` with an exception set on " -"failure." -msgstr "" - -#: ../../c-api/long.rst:100 +#: ../../c-api/long.rst:80 msgid "" "Return a new :c:type:`PyLongObject` object from the integer part of *v*, or " "``NULL`` on failure." @@ -150,35 +136,50 @@ msgstr "" "*v* の整数部から新たな :c:type:`PyLongObject` オブジェクトを生成して返しま" "す。失敗のときには ``NULL`` を返します。" -#: ../../c-api/long.rst:106 +#: ../../c-api/long.rst:86 msgid "" "Return a new :c:type:`PyLongObject` based on the string value in *str*, " -"which is interpreted according to the radix in *base*, or ``NULL`` on " -"failure. If *pend* is non-``NULL``, *\\*pend* will point to the end of " -"*str* on success or to the first character that could not be processed on " -"error. If *base* is ``0``, *str* is interpreted using the :ref:`integers` " -"definition; in this case, leading zeros in a non-zero decimal number raises " -"a :exc:`ValueError`. If *base* is not ``0``, it must be between ``2`` and " -"``36``, inclusive. Leading and trailing whitespace and single underscores " -"after a base specifier and between digits are ignored. If there are no " -"digits or *str* is not NULL-terminated following the digits and trailing " -"whitespace, :exc:`ValueError` will be raised." -msgstr "" - -#: ../../c-api/long.rst:117 -msgid "" -":c:func:`PyLong_AsNativeBytes()` and :c:func:`PyLong_FromNativeBytes()` " -"functions can be used to convert a :c:type:`PyLongObject` to/from an array " -"of bytes in base ``256``." -msgstr "" - -#: ../../c-api/long.rst:124 +"which is interpreted according to the radix in *base*. If *pend* is non-" +"``NULL``, *\\*pend* will point to the first character in *str* which follows " +"the representation of the number. If *base* is ``0``, *str* is interpreted " +"using the :ref:`integers` definition; in this case, leading zeros in a non-" +"zero decimal number raises a :exc:`ValueError`. If *base* is not ``0``, it " +"must be between ``2`` and ``36``, inclusive. Leading spaces and single " +"underscores after a base specifier and between digits are ignored. If there " +"are no digits, :exc:`ValueError` will be raised." +msgstr "" +"*str* の文字列値に基づいて、新たな :c:type:`PyLongObject` を返します。\n" +"このとき *base* を基数として文字列を解釈します。\n" +"*pend* が ``NULL`` でない場合は、 *\\*pend* は *str* 中で数が表現されている部" +"分以降の先頭文字のアドレスを指しています。\n" +"*base* が ``0`` の場合は、 *str* は :ref:`integers` の定義を使って解釈されま" +"す; この場合では、先頭に 0 がある 0 でない十進数は :exc:`ValueError` を送出し" +"ます。\n" +"*base* が ``0`` でなければ、 *base* は ``2`` 以上 ``36`` 以下の数でなければな" +"りません。\n" +"先頭の空白、基数の指定の後や数字の間にある単一のアンダースコアは無視されま" +"す。\n" +"数字が全くない場合、 :exc:`ValueError` が送出されます。" + +#: ../../c-api/long.rst:99 +msgid "Convert a sequence of Unicode digits to a Python integer value." +msgstr "" + +#: ../../c-api/long.rst:103 +msgid "" +"Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using :c:" +"func:`PyLong_FromUnicodeObject`." +msgstr "" +"古いスタイルの :c:type:`Py_UNICODE` APIの一部です; :c:func:" +"`PyLong_FromUnicodeObject` を使用するように移行してください。" + +#: ../../c-api/long.rst:108 msgid "" "Convert a sequence of Unicode digits in the string *u* to a Python integer " "value." msgstr "" -#: ../../c-api/long.rst:132 +#: ../../c-api/long.rst:116 msgid "" "Create a Python integer from the pointer *p*. The pointer value can be " "retrieved from the resulting value using :c:func:`PyLong_AsVoidPtr`." @@ -186,115 +187,86 @@ msgstr "" "ポインタ *p* から Python 整数値を生成します。ポインタの値は :c:func:" "`PyLong_AsVoidPtr` を適用した結果から取得されます。" -#: ../../c-api/long.rst:138 -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:141 -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:152 +#: ../../c-api/long.rst:127 ../../c-api/long.rst:146 msgid "" -"Create a Python integer from the value contained in the first *n_bytes* of " -"*buffer*, interpreted as an unsigned number." +"Return a C :c:type:`long` representation of *obj*. If *obj* is not an " +"instance of :c:type:`PyLongObject`, first call its :meth:`__index__` or :" +"meth:`__int__` method (if present) to convert it to a :c:type:`PyLongObject`." msgstr "" +"*obj* が表す、Cの :c:type:`long` 表現を返します。もし *obj* が :c:type:" +"`PyLongObject` のインスタンスでなければ、まず、その :meth:`__index__` メソッ" +"ドあるいは :meth:`__int__` メソッドを (もしあれば) 呼び出して、オブジェクト" +"を :c:type:`PyLongObject` に変換します。" -#: ../../c-api/long.rst:155 -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:168 ../../c-api/long.rst:204 -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:172 +#: ../../c-api/long.rst:132 msgid "" "Raise :exc:`OverflowError` if the value of *obj* is out of range for a :c:" -"expr:`long`." +"type:`long`." msgstr "" -"もし *obj* の値が :c:expr:`long` の範囲外であれば、 :exc:`OverflowError` を送" +"もし *obj* の値が :c:type:`long` の範囲外であれば、 :exc:`OverflowError` を送" "出します。" -#: ../../c-api/long.rst:175 ../../c-api/long.rst:213 ../../c-api/long.rst:234 -#: ../../c-api/long.rst:254 ../../c-api/long.rst:277 +#: ../../c-api/long.rst:135 ../../c-api/long.rst:156 ../../c-api/long.rst:178 +#: ../../c-api/long.rst:199 ../../c-api/long.rst:222 msgid "Returns ``-1`` on error. Use :c:func:`PyErr_Occurred` to disambiguate." msgstr "" "エラーが起きたときに ``-1`` を返します。\n" "見分けを付けるためには :c:func:`PyErr_Occurred` を使ってください。" -#: ../../c-api/long.rst:177 ../../c-api/long.rst:215 ../../c-api/long.rst:236 -#: ../../c-api/long.rst:258 ../../c-api/long.rst:342 ../../c-api/long.rst:362 -msgid "Use :meth:`~object.__index__` if available." -msgstr "可能であれば :meth:`~object.__index__` を使うようになりました。" - -#: ../../c-api/long.rst:180 ../../c-api/long.rst:218 ../../c-api/long.rst:239 -#: ../../c-api/long.rst:261 ../../c-api/long.rst:345 ../../c-api/long.rst:365 -msgid "This function will no longer use :meth:`~object.__int__`." -msgstr "" - -#: ../../c-api/long.rst:187 -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:137 ../../c-api/long.rst:158 ../../c-api/long.rst:180 +#: ../../c-api/long.rst:203 ../../c-api/long.rst:288 ../../c-api/long.rst:308 +msgid "Use :meth:`__index__` if available." +msgstr "可能であれば :meth:`__index__` を使うようになりました。" -#: ../../c-api/long.rst:191 -msgid "The function is soft deprecated." -msgstr "" - -#: ../../c-api/long.rst:196 -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:140 ../../c-api/long.rst:161 ../../c-api/long.rst:183 +#: ../../c-api/long.rst:206 ../../c-api/long.rst:291 ../../c-api/long.rst:311 +msgid "Using :meth:`__int__` is deprecated." +msgstr ":meth:`__int__` の使用は非推奨です。" -#: ../../c-api/long.rst:208 +#: ../../c-api/long.rst:151 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 " -"return ``-1``; otherwise, set *\\*overflow* to ``0``. If any other " -"exception occurs set *\\*overflow* to ``0`` and return ``-1`` as usual." +"If the value of *obj* is greater than :const:`LONG_MAX` or less than :const:" +"`LONG_MIN`, set *\\*overflow* to ``1`` or ``-1``, respectively, and return " +"``-1``; otherwise, set *\\*overflow* to ``0``. If any other exception " +"occurs set *\\*overflow* to ``0`` and return ``-1`` as usual." msgstr "" +"もし、 *obj* の値が :const:`LONG_MAX` より大きいか、 :const:`LONG_MIN` より小" +"さければ、 *\\*overflow* は、それぞれ ``1`` か ``-1`` に設定され、 ``-1`` を" +"返します; さもなければ *\\*overflow* は ``0`` に設定されます。もし、ほかの例" +"外が発生した場合は *\\*overflow* が ``0`` に設定され ``-1`` を返します。" -#: ../../c-api/long.rst:227 ../../c-api/long.rst:245 +#: ../../c-api/long.rst:170 ../../c-api/long.rst:189 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`." +"Return a C :c:type:`long long` representation of *obj*. If *obj* is not an " +"instance of :c:type:`PyLongObject`, first call its :meth:`__index__` or :" +"meth:`__int__` method (if present) to convert it to a :c:type:`PyLongObject`." msgstr "" +"*obj* が表す、Cの :c:type:`long long` 表現を返します。\n" +"もし *obj* が :c:type:`PyLongObject` のインスタンスでなければ、まず、その :" +"meth:`__index__` メソッドあるいは :meth:`__int__` メソッドを (もしあれば) 呼" +"び出して、オブジェクトを :c:type:`PyLongObject` に変換します。" -#: ../../c-api/long.rst:231 +#: ../../c-api/long.rst:175 msgid "" "Raise :exc:`OverflowError` if the value of *obj* is out of range for a :c:" -"expr:`long long`." +"type:`long long`." msgstr "" -"もし *obj* の値が :c:expr:`long long` の範囲外であれば、 :exc:" +"もし *obj* の値が :c:type:`long long` の範囲外であれば、 :exc:" "`OverflowError` を送出します。" -#: ../../c-api/long.rst:249 +#: ../../c-api/long.rst:194 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 " -"return ``-1``; otherwise, set *\\*overflow* to ``0``. If any other " -"exception occurs set *\\*overflow* to ``0`` and return ``-1`` as usual." +"If the value of *obj* is greater than :const:`LLONG_MAX` or less than :const:" +"`LLONG_MIN`, set *\\*overflow* to ``1`` or ``-1``, respectively, and return " +"``-1``; otherwise, set *\\*overflow* to ``0``. If any other exception " +"occurs set *\\*overflow* to ``0`` and return ``-1`` as usual." msgstr "" +"もし、 *obj* の値が :const:`LLONG_MAX` より大きいか、 :const:`LLONG_MIN` より" +"小さければ、 *\\*overflow* は、それぞれ ``1`` か ``-1`` に設定され、 ``-1`` " +"を返します; さもなければ *\\*overflow* は ``0`` に設定されます。もし、ほかの" +"例外が発生した場合は *\\*overflow* が ``0`` に設定され ``-1`` を返します。" -#: ../../c-api/long.rst:271 +#: ../../c-api/long.rst:216 msgid "" "Return a C :c:type:`Py_ssize_t` representation of *pylong*. *pylong* must " "be an instance of :c:type:`PyLongObject`." @@ -302,7 +274,7 @@ msgstr "" "*pylong* を表す C の :c:type:`Py_ssize_t` を返します。 *pylong* は :c:type:" "`PyLongObject` のインスタンスでなければなりません。" -#: ../../c-api/long.rst:274 +#: ../../c-api/long.rst:219 msgid "" "Raise :exc:`OverflowError` if the value of *pylong* is out of range for a :c:" "type:`Py_ssize_t`." @@ -310,23 +282,23 @@ msgstr "" "もし *pylong* の値が :c:type:`Py_ssize_t` の範囲外であれば、 :exc:" "`OverflowError` を送出します。" -#: ../../c-api/long.rst:286 +#: ../../c-api/long.rst:231 msgid "" -"Return a C :c:expr:`unsigned long` representation of *pylong*. *pylong* " +"Return a C :c:type:`unsigned long` representation of *pylong*. *pylong* " "must be an instance of :c:type:`PyLongObject`." msgstr "" -"*pylong* を表す C の :c:expr:`unsigned long` を返します。 *pylong* は :c:" +"*pylong* を表す C の :c:type:`unsigned long` を返します。 *pylong* は :c:" "type:`PyLongObject` のインスタンスでなければなりません。" -#: ../../c-api/long.rst:289 +#: ../../c-api/long.rst:234 msgid "" "Raise :exc:`OverflowError` if the value of *pylong* is out of range for a :c:" -"expr:`unsigned long`." +"type:`unsigned long`." msgstr "" -"もし *pylong* の値が :c:expr:`unsigned long` の範囲外であれば、 :exc:" +"もし *pylong* の値が :c:type:`unsigned long` の範囲外であれば、 :exc:" "`OverflowError` を送出します。" -#: ../../c-api/long.rst:292 +#: ../../c-api/long.rst:237 msgid "" "Returns ``(unsigned long)-1`` on error. Use :c:func:`PyErr_Occurred` to " "disambiguate." @@ -334,7 +306,7 @@ msgstr "" "エラーが起きたときに ``(unsigned long)-1`` を返します。\n" "見分けを付けるためには :c:func:`PyErr_Occurred` を使ってください。" -#: ../../c-api/long.rst:302 +#: ../../c-api/long.rst:247 msgid "" "Return a C :c:type:`size_t` representation of *pylong*. *pylong* must be an " "instance of :c:type:`PyLongObject`." @@ -342,7 +314,7 @@ msgstr "" "*pylong* を表す C の :c:type:`size_t` を返します。 *pylong* は :c:type:" "`PyLongObject` のインスタンスでなければなりません。" -#: ../../c-api/long.rst:305 +#: ../../c-api/long.rst:250 msgid "" "Raise :exc:`OverflowError` if the value of *pylong* is out of range for a :c:" "type:`size_t`." @@ -350,7 +322,7 @@ msgstr "" "もし *pylong* の値が :c:type:`size_t` の範囲外であれば、 :exc:" "`OverflowError` を送出します。" -#: ../../c-api/long.rst:308 +#: ../../c-api/long.rst:253 msgid "" "Returns ``(size_t)-1`` on error. Use :c:func:`PyErr_Occurred` to " "disambiguate." @@ -358,23 +330,23 @@ msgstr "" "エラーが起きたときに ``(size_t)-1`` を返します。\n" "見分けを付けるためには :c:func:`PyErr_Occurred` を使ってください。" -#: ../../c-api/long.rst:317 +#: ../../c-api/long.rst:262 msgid "" -"Return a C :c:expr:`unsigned long long` representation of *pylong*. " +"Return a C :c:type:`unsigned long long` representation of *pylong*. " "*pylong* must be an instance of :c:type:`PyLongObject`." msgstr "" -"*pylong* を表す C の :c:expr:`unsigned long long` を返します。 *pylong* は :" +"*pylong* を表す C の :c:type:`unsigned long long` を返します。 *pylong* は :" "c:type:`PyLongObject` のインスタンスでなければなりません。" -#: ../../c-api/long.rst:320 +#: ../../c-api/long.rst:265 msgid "" "Raise :exc:`OverflowError` if the value of *pylong* is out of range for an :" -"c:expr:`unsigned long long`." +"c:type:`unsigned long long`." msgstr "" -"もし *pylong* の値が :c:expr:`unsigned long long` の範囲外であれば、 :exc:" +"もし *pylong* の値が :c:type:`unsigned long long` の範囲外であれば、 :exc:" "`OverflowError` を送出します。" -#: ../../c-api/long.rst:323 +#: ../../c-api/long.rst:268 msgid "" "Returns ``(unsigned long long)-1`` on error. Use :c:func:`PyErr_Occurred` to " "disambiguate." @@ -382,29 +354,33 @@ msgstr "" "エラーが起きたときに ``(unsigned long long)-1`` を返します。\n" "見分けを付けるためには :c:func:`PyErr_Occurred` を使ってください。" -#: ../../c-api/long.rst:326 +#: ../../c-api/long.rst:271 msgid "" "A negative *pylong* now raises :exc:`OverflowError`, not :exc:`TypeError`." msgstr "" "負 *pylong* を指定した際に :exc:`TypeError` ではなく、 :exc:`OverflowError` " "を送出するようになりました。" -#: ../../c-api/long.rst:332 +#: ../../c-api/long.rst:277 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`." +"Return a C :c:type:`unsigned long` representation of *obj*. If *obj* is not " +"an instance of :c:type:`PyLongObject`, first call its :meth:`__index__` or :" +"meth:`__int__` method (if present) to convert it to a :c:type:`PyLongObject`." msgstr "" +"*obj* が表す、Cの :c:type:`unsigned long` 表現を返します。\n" +"もし *obj* が :c:type:`PyLongObject` のインスタンスでなければ、まず、その :" +"meth:`__index__` メソッドあるいは :meth:`__int__` メソッドを (もしあれば) 呼" +"び出して、オブジェクトを :c:type:`PyLongObject` に変換します。" -#: ../../c-api/long.rst:336 +#: ../../c-api/long.rst:282 msgid "" -"If the value of *obj* is out of range for an :c:expr:`unsigned long`, return " +"If the value of *obj* is out of range for an :c:type:`unsigned long`, return " "the reduction of that value modulo ``ULONG_MAX + 1``." msgstr "" -"*obj* の値が :c:expr:`unsigned long` の範囲から外れていた場合は、 " +"*obj* の値が :c:type:`unsigned long` の範囲から外れていた場合は、 " "``ULONG_MAX + 1`` を法とした剰余を返します。" -#: ../../c-api/long.rst:339 +#: ../../c-api/long.rst:285 msgid "" "Returns ``(unsigned long)-1`` on error. Use :c:func:`PyErr_Occurred` to " "disambiguate." @@ -412,22 +388,27 @@ msgstr "" "エラーが起きたときに ``(unsigned long)-1`` を返します。\n" "見分けを付けるためには :c:func:`PyErr_Occurred` を使ってください。" -#: ../../c-api/long.rst:351 +#: ../../c-api/long.rst:297 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`." +"Return a C :c:type:`unsigned long long` representation of *obj*. If *obj* " +"is not an instance of :c:type:`PyLongObject`, first call its :meth:" +"`__index__` or :meth:`__int__` method (if present) to convert it to a :c:" +"type:`PyLongObject`." msgstr "" +"*obj* が表す、Cの :c:type:`unsigned long long` 表現を返します。\n" +"もし *obj* が :c:type:`PyLongObject` のインスタンスでなければ、まず、その :" +"meth:`__index__` メソッドあるいは :meth:`__int__` メソッドを (もしあれば) 呼" +"び出して、オブジェクトを :c:type:`PyLongObject` に変換します。" -#: ../../c-api/long.rst:356 +#: ../../c-api/long.rst:302 msgid "" -"If the value of *obj* is out of range for an :c:expr:`unsigned long long`, " +"If the value of *obj* is out of range for an :c:type:`unsigned long long`, " "return the reduction of that value modulo ``ULLONG_MAX + 1``." msgstr "" -"*obj* の値が :c:expr:`unsigned long long` の範囲から外れていた場合は、 " +"*obj* の値が :c:type:`unsigned long long` の範囲から外れていた場合は、 " "``ULLONG_MAX + 1`` を法とした剰余を返します。" -#: ../../c-api/long.rst:359 +#: ../../c-api/long.rst:305 msgid "" "Returns ``(unsigned long long)-1`` on error. Use :c:func:`PyErr_Occurred` " "to disambiguate." @@ -435,664 +416,44 @@ msgstr "" "エラーが起きたときに ``(unsigned long long)-1`` を返します。\n" "見分けを付けるためには :c:func:`PyErr_Occurred` を使ってください。" -#: ../../c-api/long.rst:372 -msgid "" -"Set *\\*value* to a signed C :c:expr:`int32_t` or :c:expr:`int64_t` " -"representation of *obj*." -msgstr "" - -#: ../../c-api/long.rst:375 ../../c-api/long.rst:396 -msgid "If the *obj* value is out of range, raise an :exc:`OverflowError`." -msgstr "" - -#: ../../c-api/long.rst:377 ../../c-api/long.rst:398 -msgid "" -"Set *\\*value* and return ``0`` on success. Set an exception and return " -"``-1`` on error." -msgstr "" - -#: ../../c-api/long.rst:380 ../../c-api/long.rst:401 -msgid "*value* must not be ``NULL``." -msgstr "" - -#: ../../c-api/long.rst:388 -msgid "" -"Set *\\*value* to an unsigned C :c:expr:`uint32_t` or :c:expr:`uint64_t` " -"representation of *obj*." -msgstr "" - -#: ../../c-api/long.rst:391 -msgid "" -"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:395 -msgid "If *obj* is negative, raise a :exc:`ValueError`." -msgstr "" - -#: ../../c-api/long.rst:408 +#: ../../c-api/long.rst:317 msgid "" -"Return a C :c:expr:`double` representation of *pylong*. *pylong* must be an " +"Return a C :c:type:`double` representation of *pylong*. *pylong* must be an " "instance of :c:type:`PyLongObject`." msgstr "" -"*pylong* を表す C の :c:expr:`double` を返します。 *pylong* は :c:type:" +"*pylong* を表す C の :c:type:`double` を返します。 *pylong* は :c:type:" "`PyLongObject` のインスタンスでなければなりません。" -#: ../../c-api/long.rst:411 +#: ../../c-api/long.rst:320 msgid "" "Raise :exc:`OverflowError` if the value of *pylong* is out of range for a :c:" -"expr:`double`." +"type:`double`." msgstr "" -"もし *pylong* の値が :c:expr:`double` の範囲外であれば、 :exc:" +"もし *pylong* の値が :c:type:`double` の範囲外であれば、 :exc:" "`OverflowError` を送出します。" -#: ../../c-api/long.rst:414 +#: ../../c-api/long.rst:323 msgid "" "Returns ``-1.0`` on error. Use :c:func:`PyErr_Occurred` to disambiguate." msgstr "" "エラーが起きたときに ``-1.0`` を返します。\n" "見分けを付けるためには :c:func:`PyErr_Occurred` を使ってください。" -#: ../../c-api/long.rst:419 +#: ../../c-api/long.rst:328 msgid "" -"Convert a Python integer *pylong* to a C :c:expr:`void` pointer. If *pylong* " +"Convert a Python integer *pylong* to a C :c:type:`void` pointer. If *pylong* " "cannot be converted, an :exc:`OverflowError` will be raised. This is only " -"assured to produce a usable :c:expr:`void` pointer for values created with :" +"assured to produce a usable :c:type:`void` pointer for values created with :" "c:func:`PyLong_FromVoidPtr`." msgstr "" -"Python の整数型を指す *pylong* を、 C の :c:expr:`void` ポインタに変換しま" +"Python の整数型を指す *pylong* を、 C の :c:type:`void` ポインタに変換しま" "す。 *pylong* を変換できなければ、 :exc:`OverflowError` を送出します。この関" -"数は :c:func:`PyLong_FromVoidPtr` で値を生成するときに使うような :c:expr:" +"数は :c:func:`PyLong_FromVoidPtr` で値を生成するときに使うような :c:type:" "`void` ポインタ型を生成できるだけです。" -#: ../../c-api/long.rst:424 +#: ../../c-api/long.rst:333 msgid "" "Returns ``NULL`` on error. Use :c:func:`PyErr_Occurred` to disambiguate." msgstr "" "エラーが起きたときに ``NULL`` を返します。\n" "見分けを付けるためには :c:func:`PyErr_Occurred` を使ってください。" - -#: ../../c-api/long.rst:429 -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:433 -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:437 -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:442 -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:449 -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:452 -msgid "``0`` will never be returned." -msgstr "" - -#: ../../c-api/long.rst:454 -msgid "Values are always copied as two's-complement." -msgstr "" - -#: ../../c-api/long.rst:456 -msgid "Usage example::" -msgstr "" - -#: ../../c-api/long.rst:458 -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:472 -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:479 -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:482 -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:485 -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:513 -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:518 -msgid "" -"Currently, ``-1`` corresponds to ``Py_ASNATIVEBYTES_NATIVE_ENDIAN | " -"Py_ASNATIVEBYTES_UNSIGNED_BUFFER``." -msgstr "" - -#: ../../c-api/long.rst:524 -msgid "Flag" -msgstr "Flag" - -#: ../../c-api/long.rst:524 -msgid "Value" -msgstr "値" - -#: ../../c-api/long.rst:526 -msgid "``-1``" -msgstr "" - -#: ../../c-api/long.rst:527 -msgid "``0``" -msgstr "``0``" - -#: ../../c-api/long.rst:528 -msgid "``1``" -msgstr "``1``" - -#: ../../c-api/long.rst:529 -msgid "``3``" -msgstr "``3``" - -#: ../../c-api/long.rst:530 -msgid "``4``" -msgstr "``4``" - -#: ../../c-api/long.rst:531 -msgid "``8``" -msgstr "``8``" - -#: ../../c-api/long.rst:532 -msgid "``16``" -msgstr "" - -#: ../../c-api/long.rst:535 -msgid "" -"Specifying ``Py_ASNATIVEBYTES_NATIVE_ENDIAN`` will override any other endian " -"flags. Passing ``2`` is reserved." -msgstr "" - -#: ../../c-api/long.rst:538 -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:542 -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:549 -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:554 -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:563 -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:574 -msgid "Get the sign of the integer object *obj*." -msgstr "" - -#: ../../c-api/long.rst:576 -msgid "" -"On success, set *\\*sign* to the integer sign (0, -1 or +1 for zero, " -"negative or positive integer, respectively) and return 0." -msgstr "" - -#: ../../c-api/long.rst:579 -msgid "" -"On failure, return -1 with an exception set. This function always succeeds " -"if *obj* is a :c:type:`PyLongObject` or its subtype." -msgstr "" - -#: ../../c-api/long.rst:587 -msgid "Check if the integer object *obj* is positive (``obj > 0``)." -msgstr "" - -#: ../../c-api/long.rst:589 -msgid "" -"If *obj* is an instance of :c:type:`PyLongObject` or its subtype, return " -"``1`` when it's positive and ``0`` otherwise. Else set an exception and " -"return ``-1``." -msgstr "" - -#: ../../c-api/long.rst:598 -msgid "Check if the integer object *obj* is negative (``obj < 0``)." -msgstr "" - -#: ../../c-api/long.rst:600 -msgid "" -"If *obj* is an instance of :c:type:`PyLongObject` or its subtype, return " -"``1`` when it's negative and ``0`` otherwise. Else set an exception and " -"return ``-1``." -msgstr "" - -#: ../../c-api/long.rst:609 -msgid "Check if the integer object *obj* is zero." -msgstr "" - -#: ../../c-api/long.rst:611 -msgid "" -"If *obj* is an instance of :c:type:`PyLongObject` or its subtype, return " -"``1`` when it's zero and ``0`` otherwise. Else set an exception and return " -"``-1``." -msgstr "" - -#: ../../c-api/long.rst:620 -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:624 -msgid "On failure, return ``NULL`` with an exception set." -msgstr "" - -#: ../../c-api/long.rst:631 -msgid "Return 1 if *op* is compact, 0 otherwise." -msgstr "" - -#: ../../c-api/long.rst:633 -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:`PyLong_AsNativeBytes`." -msgstr "" - -#: ../../c-api/long.rst:639 -msgid "The speedup is expected to be negligible for most users." -msgstr "" - -#: ../../c-api/long.rst:641 -msgid "" -"Exactly what values are considered compact is an implementation detail and " -"is subject to change." -msgstr "" - -#: ../../c-api/long.rst:649 -msgid "" -"If *op* is compact, as determined by :c:func:`PyUnstable_Long_IsCompact`, " -"return its value." -msgstr "" - -#: ../../c-api/long.rst:652 -msgid "Otherwise, the return value is undefined." -msgstr "" - -#: ../../c-api/long.rst:658 -msgid "Export API" -msgstr "" - -#: ../../c-api/long.rst:664 -msgid "" -"Layout of an array of \"digits\" (\"limbs\" in the GMP terminology), used to " -"represent absolute value for arbitrary precision integers." -msgstr "" - -#: ../../c-api/long.rst:667 -msgid "" -"Use :c:func:`PyLong_GetNativeLayout` to get the native layout of Python :" -"class:`int` objects, used internally for integers with \"big enough\" " -"absolute value." -msgstr "" - -#: ../../c-api/long.rst:671 -msgid "" -"See also :data:`sys.int_info` which exposes similar information in Python." -msgstr "" - -#: ../../c-api/long.rst:675 -msgid "" -"Bits per digit. For example, a 15 bit digit means that bits 0-14 contain " -"meaningful information." -msgstr "" - -#: ../../c-api/long.rst:680 -msgid "" -"Digit size in bytes. For example, a 15 bit digit will require at least 2 " -"bytes." -msgstr "" - -#: ../../c-api/long.rst:685 -msgid "Digits order:" -msgstr "" - -#: ../../c-api/long.rst:687 -msgid "``1`` for most significant digit first" -msgstr "" - -#: ../../c-api/long.rst:688 -msgid "``-1`` for least significant digit first" -msgstr "" - -#: ../../c-api/long.rst:692 -msgid "Digit endianness:" -msgstr "" - -#: ../../c-api/long.rst:694 -msgid "``1`` for most significant byte first (big endian)" -msgstr "" - -#: ../../c-api/long.rst:695 -msgid "``-1`` for least significant byte first (little endian)" -msgstr "" - -#: ../../c-api/long.rst:700 -msgid "Get the native layout of Python :class:`int` objects." -msgstr "" - -#: ../../c-api/long.rst:702 -msgid "See the :c:struct:`PyLongLayout` structure." -msgstr "" - -#: ../../c-api/long.rst:704 -msgid "" -"The function must not be called before Python initialization nor after " -"Python finalization. The returned layout is valid until Python is finalized. " -"The layout is the same for all Python sub-interpreters in a process, and so " -"it can be cached." -msgstr "" - -#: ../../c-api/long.rst:712 -msgid "Export of a Python :class:`int` object." -msgstr "" - -#: ../../c-api/long.rst:714 -msgid "There are two cases:" -msgstr "" - -#: ../../c-api/long.rst:716 -msgid "" -"If :c:member:`digits` is ``NULL``, only use the :c:member:`value` member." -msgstr "" - -#: ../../c-api/long.rst:717 -msgid "" -"If :c:member:`digits` is not ``NULL``, use :c:member:`negative`, :c:member:" -"`ndigits` and :c:member:`digits` members." -msgstr "" - -#: ../../c-api/long.rst:722 -msgid "" -"The native integer value of the exported :class:`int` object. Only valid if :" -"c:member:`digits` is ``NULL``." -msgstr "" - -#: ../../c-api/long.rst:727 -msgid "" -"``1`` if the number is negative, ``0`` otherwise. Only valid if :c:member:" -"`digits` is not ``NULL``." -msgstr "" - -#: ../../c-api/long.rst:732 -msgid "" -"Number of digits in :c:member:`digits` array. Only valid if :c:member:" -"`digits` is not ``NULL``." -msgstr "" - -#: ../../c-api/long.rst:737 -msgid "Read-only array of unsigned digits. Can be ``NULL``." -msgstr "" - -#: ../../c-api/long.rst:742 -msgid "Export a Python :class:`int` object." -msgstr "" - -#: ../../c-api/long.rst:744 -msgid "" -"*export_long* must point to a :c:struct:`PyLongExport` structure allocated " -"by the caller. It must not be ``NULL``." -msgstr "" - -#: ../../c-api/long.rst:747 -msgid "" -"On success, fill in *\\*export_long* and return ``0``. On error, set an " -"exception and return ``-1``." -msgstr "" - -#: ../../c-api/long.rst:750 -msgid "" -":c:func:`PyLong_FreeExport` must be called when the export is no longer " -"needed." -msgstr "" - -#: ../../c-api/long.rst:754 -msgid "" -"This function always succeeds if *obj* is a Python :class:`int` object or a " -"subclass." -msgstr "" - -#: ../../c-api/long.rst:760 -msgid "Release the export *export_long* created by :c:func:`PyLong_Export`." -msgstr "" - -#: ../../c-api/long.rst:763 -msgid "" -"Calling :c:func:`PyLong_FreeExport` is optional if *export_long->digits* is " -"``NULL``." -msgstr "" - -#: ../../c-api/long.rst:768 -msgid "PyLongWriter API" -msgstr "" - -#: ../../c-api/long.rst:770 -msgid "The :c:type:`PyLongWriter` API can be used to import an integer." -msgstr "" - -#: ../../c-api/long.rst:776 -msgid "A Python :class:`int` writer instance." -msgstr "" - -#: ../../c-api/long.rst:778 -msgid "" -"The instance must be destroyed by :c:func:`PyLongWriter_Finish` or :c:func:" -"`PyLongWriter_Discard`." -msgstr "" - -#: ../../c-api/long.rst:784 -msgid "Create a :c:type:`PyLongWriter`." -msgstr "" - -#: ../../c-api/long.rst:786 -msgid "" -"On success, allocate *\\*digits* and return a writer. On error, set an " -"exception and return ``NULL``." -msgstr "" - -#: ../../c-api/long.rst:789 -msgid "*negative* is ``1`` if the number is negative, or ``0`` otherwise." -msgstr "" - -#: ../../c-api/long.rst:791 -msgid "" -"*ndigits* is the number of digits in the *digits* array. It must be greater " -"than 0." -msgstr "" - -#: ../../c-api/long.rst:794 -msgid "*digits* must not be NULL." -msgstr "" - -#: ../../c-api/long.rst:796 -msgid "" -"After a successful call to this function, the caller should fill in the " -"array of digits *digits* and then call :c:func:`PyLongWriter_Finish` to get " -"a Python :class:`int`. The layout of *digits* is described by :c:func:" -"`PyLong_GetNativeLayout`." -msgstr "" - -#: ../../c-api/long.rst:801 -msgid "" -"Digits must be in the range [``0``; ``(1 << bits_per_digit) - 1``] (where " -"the :c:struct:`~PyLongLayout.bits_per_digit` is the number of bits per " -"digit). Any unused most significant digits must be set to ``0``." -msgstr "" - -#: ../../c-api/long.rst:806 -msgid "" -"Alternately, call :c:func:`PyLongWriter_Discard` to destroy the writer " -"instance without creating an :class:`~int` object." -msgstr "" - -#: ../../c-api/long.rst:812 -msgid "" -"Finish a :c:type:`PyLongWriter` created by :c:func:`PyLongWriter_Create`." -msgstr "" - -#: ../../c-api/long.rst:814 -msgid "" -"On success, return a Python :class:`int` object. On error, set an exception " -"and return ``NULL``." -msgstr "" - -#: ../../c-api/long.rst:817 -msgid "" -"The function takes care of normalizing the digits and converts the object to " -"a compact integer if needed." -msgstr "" - -#: ../../c-api/long.rst:820 ../../c-api/long.rst:829 -msgid "The writer instance and the *digits* array are invalid after the call." -msgstr "" - -#: ../../c-api/long.rst:825 -msgid "" -"Discard a :c:type:`PyLongWriter` created by :c:func:`PyLongWriter_Create`." -msgstr "" - -#: ../../c-api/long.rst:827 -msgid "If *writer* is ``NULL``, no operation is performed." -msgstr "" - -#: ../../c-api/long.rst:8 -msgid "object" -msgstr "object" - -#: ../../c-api/long.rst:8 -msgid "long integer" -msgstr "long integer" - -#: ../../c-api/long.rst:8 -msgid "integer" -msgstr "整数" - -#: ../../c-api/long.rst:164 -msgid "LONG_MAX (C macro)" -msgstr "" - -#: ../../c-api/long.rst:164 ../../c-api/long.rst:224 ../../c-api/long.rst:267 -#: ../../c-api/long.rst:282 ../../c-api/long.rst:298 ../../c-api/long.rst:314 -msgid "OverflowError (built-in exception)" -msgstr "OverflowError (組み込み例外)" - -#: ../../c-api/long.rst:267 -msgid "PY_SSIZE_T_MAX (C macro)" -msgstr "" - -#: ../../c-api/long.rst:282 -msgid "ULONG_MAX (C macro)" -msgstr "" - -#: ../../c-api/long.rst:298 -msgid "SIZE_MAX (C macro)" -msgstr "" diff --git a/c-api/mapping.po b/c-api/mapping.po index 7dd514c26..19ae91abf 100644 --- a/c-api/mapping.po +++ b/c-api/mapping.po @@ -1,26 +1,26 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2023 -# Nozomu Kaneko , 2023 +# Arihiro TAKASE, 2017 +# tomo, 2020 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-06 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:49+0000\n" -"Last-Translator: Nozomu Kaneko , 2023\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 17:37+0000\n" +"Last-Translator: tomo, 2020\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/mapping.rst:6 @@ -37,12 +37,17 @@ msgstr "" #: ../../c-api/mapping.rst:14 msgid "" -"Return ``1`` if the object provides the mapping protocol or supports " -"slicing, and ``0`` otherwise. Note that it returns ``1`` for Python classes " -"with a :meth:`~object.__getitem__` method, since in general it is impossible " -"to determine what type of keys the class supports. This function always " -"succeeds." +"Return ``1`` if the object provides mapping protocol or supports slicing, " +"and ``0`` otherwise. Note that it returns ``1`` for Python classes with a :" +"meth:`__getitem__` method since in general case it is impossible to " +"determine what type of keys it supports. This function always succeeds." msgstr "" +"オブジェクトがマップ型プロトコルを提供しているか、スライスをサポートしている" +"場合は ``1`` を、そうでない場合は ``0`` を返します。\n" +":meth:`__getitem__` メソッドを持つ Python クラスについては ``1`` を返すのに注" +"意してください。そうなる理由は、一般的なケースではオブジェクトがどの種類の" +"キーをサポートしているかを判別するのが不可能だからです。\n" +"この関数は常に成功します。" #: ../../c-api/mapping.rst:25 msgid "" @@ -54,66 +59,49 @@ msgstr "" #: ../../c-api/mapping.rst:31 msgid "" -"This is the same as :c:func:`PyObject_GetItem`, but *key* is specified as a :" -"c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:" -"`PyObject*`." +"Return element of *o* corresponding to the string *key* or ``NULL`` on " +"failure. This is the equivalent of the Python expression ``o[key]``. See " +"also :c:func:`PyObject_GetItem`." msgstr "" +"文字列 *key* に対応する *o* の要素を返します。失敗すると ``NULL`` を返しま" +"す。\n" +"Python の式 ``o[key]`` と同じです。\n" +":c:func:`PyObject_GetItem` も参照してください。" #: ../../c-api/mapping.rst:38 msgid "" -"Variant of :c:func:`PyObject_GetItem` which doesn't raise :exc:`KeyError` if " -"the key is not found." +"Map the string *key* to the value *v* in object *o*. Returns ``-1`` on " +"failure. This is the equivalent of the Python statement ``o[key] = v``. See " +"also :c:func:`PyObject_SetItem`. This function *does not* steal a reference " +"to *v*." msgstr "" +"オブジェクト *o* 上で文字列 *key* を値 *v* に対応付けます。失敗すると ``-1`` " +"を返します。\n" +"Python の文 ``o[key] = v`` と同じです。\n" +":c:func:`PyObject_SetItem` も参照してください。\n" +"この関数は *v* への参照を盗み取り *ません*。" -#: ../../c-api/mapping.rst:41 +#: ../../c-api/mapping.rst:46 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``." +"Remove the mapping for the object *key* from the object *o*. Return ``-1`` " +"on failure. This is equivalent to the Python statement ``del o[key]``. This " +"is an alias of :c:func:`PyObject_DelItem`." msgstr "" +"オブジェクト *o* から、オブジェクト *key* に関する対応付けを削除します。\n" +"失敗すると ``-1`` を返します。\n" +"Python の文 ``del o[key]`` と同じです。\n" +"この関数は :c:func:`PyObject_DelItem` の別名です。" #: ../../c-api/mapping.rst:53 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-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*`." -msgstr "" - -#: ../../c-api/mapping.rst:69 -msgid "This is an alias of :c:func:`PyObject_DelItem`." -msgstr "" - -#: ../../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:" -"`PyObject*`." -msgstr "" - -#: ../../c-api/mapping.rst:81 -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 "" - -#: ../../c-api/mapping.rst:90 -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*`." +"Remove the mapping for the string *key* from the object *o*. Return ``-1`` " +"on failure. This is equivalent to the Python statement ``del o[key]``." msgstr "" +"オブジェクト *o* から、文字列 *key* に関する対応付けを削除します。\n" +"失敗すると ``-1`` を返します。\n" +"Python の文 ``del o[key]`` と同じです。" -#: ../../c-api/mapping.rst:99 +#: ../../c-api/mapping.rst:59 ../../c-api/mapping.rst:70 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 " @@ -123,31 +111,29 @@ msgstr "" "は ``0`` を返します。これは、Python の式 ``key in o`` と等価です。この関数呼" "び出しは常に成功します。" -#: ../../c-api/mapping.rst:105 +#: ../../c-api/mapping.rst:63 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:" +"Note that exceptions which occur while calling the :meth:`__getitem__` " +"method will get suppressed. To get error reporting use :c:func:" "`PyObject_GetItem()` instead." msgstr "" +":meth:`__getitem__` メソッドの呼び出し中に起こる例外は抑制されることに注意し" +"てください。\n" +"エラーを報告させるには、代わりに :c:func:`PyObject_GetItem()` を使ってくださ" +"い。" -#: ../../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:" -"`PyObject*`." -msgstr "" - -#: ../../c-api/mapping.rst:119 +#: ../../c-api/mapping.rst:74 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_HasKeyStringWithError`, :c:" -"func:`PyMapping_GetOptionalItemString` or :c:func:`PyMapping_GetItemString` " -"instead." +"Note that exceptions which occur while calling the :meth:`__getitem__` " +"method and creating a temporary string object will get suppressed. To get " +"error reporting use :c:func:`PyMapping_GetItemString()` instead." msgstr "" +":meth:`__getitem__` メソッドの呼び出し中や、一時的な文字列オブジェクトの作成" +"中に起こる例外は抑制されることに注意してください。\n" +"エラーを報告させるには、代わりに :c:func:`PyMapping_GetItemString()` を使って" +"ください。" -#: ../../c-api/mapping.rst:129 +#: ../../c-api/mapping.rst:81 msgid "" "On success, return a list of the keys in object *o*. On failure, return " "``NULL``." @@ -155,12 +141,12 @@ msgstr "" "成功するとオブジェクト *o* のキーからなるリストを返します。\n" "失敗すると ``NULL`` を返します。" -#: ../../c-api/mapping.rst:132 ../../c-api/mapping.rst:141 -#: ../../c-api/mapping.rst:150 +#: ../../c-api/mapping.rst:84 ../../c-api/mapping.rst:93 +#: ../../c-api/mapping.rst:102 msgid "Previously, the function returned a list or a tuple." msgstr "以前は、関数はリストもしくはタプルを返していました。" -#: ../../c-api/mapping.rst:138 +#: ../../c-api/mapping.rst:90 msgid "" "On success, return a list of the values in object *o*. On failure, return " "``NULL``." @@ -168,7 +154,7 @@ msgstr "" "成功するとオブジェクト *o* の値からなるリストを返します。\n" "失敗すると ``NULL`` を返します。" -#: ../../c-api/mapping.rst:147 +#: ../../c-api/mapping.rst:99 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``." @@ -176,11 +162,3 @@ msgstr "" "成功するとオブジェクト *o* の要素からなるリストを返し、各要素はキーと値のペア" "が入ったタプルになっています。\n" "失敗すると ``NULL`` を返します。" - -#: ../../c-api/mapping.rst:23 -msgid "built-in function" -msgstr "組み込み関数" - -#: ../../c-api/mapping.rst:23 -msgid "len" -msgstr "len" diff --git a/c-api/marshal.po b/c-api/marshal.po index a2a7fec50..cd9d31aa7 100644 --- a/c-api/marshal.po +++ b/c-api/marshal.po @@ -1,27 +1,27 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 -# Arihiro TAKASE, 2023 -# Taichi Haradaguchi, 2024 +# Arihiro TAKASE, 2017 +# Yoshikazu KARASAWA , 2017 +# tomo, 2019 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:49+0000\n" -"Last-Translator: Taichi Haradaguchi, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 17:37+0000\n" +"Last-Translator: tomo, 2019\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/marshal.rst:6 @@ -47,33 +47,28 @@ msgstr "数値は最小桁が先にくるように記録されます。" #: ../../c-api/marshal.rst:16 msgid "" -"The module supports several versions of the data format; see the :py:mod:" -"`Python module documentation ` for details." +"The module supports two versions of the data format: version 0 is the " +"historical version, version 1 shares interned strings in the file, and upon " +"unmarshalling. Version 2 uses a binary format for floating point numbers. " +"``Py_MARSHAL_VERSION`` indicates the current file format (currently 2)." msgstr "" +"このモジュールでは、3つのバージョンのデータ形式をサポートしています。バージョ" +"ン 0 は従来のもので、バージョン 1 は intern 化された文字列をファイル内で共有" +"し、逆マーシャル化の時にも共有されるようにします。バージョン2は、浮動小数点数" +"に対してバイナリフォーマットを利用します。 ``Py_MARSHAL_VERSION`` は現在の" +"バージョン (バージョン 2) を示します。" -#: ../../c-api/marshal.rst:21 -msgid "The current format version. See :py:data:`marshal.version`." -msgstr "" - -#: ../../c-api/marshal.rst:25 +#: ../../c-api/marshal.rst:24 msgid "" -"Marshal a :c:expr:`long` integer, *value*, to *file*. This will only write " +"Marshal a :c:type:`long` integer, *value*, to *file*. This will only write " "the least-significant 32 bits of *value*; regardless of the size of the " -"native :c:expr:`long` type. *version* indicates the file format." +"native :c:type:`long` type. *version* indicates the file format." msgstr "" -":c:expr:`long` 型の整数値 *value* を *file* へ整列化します。この関数は " -"*value* の下桁 32 ビットを書き込むだけです; ネイティブの :c:expr:`long` 型サ" +":c:type:`long` 型の整数値 *value* を *file* へ整列化します。この関数は " +"*value* の下桁 32 ビットを書き込むだけです; ネイティブの :c:type:`long` 型サ" "イズには関知しません。 *version* はファイルフォーマットを示します。" -#: ../../c-api/marshal.rst:29 ../../c-api/marshal.rst:37 -msgid "" -"This function can fail, in which case it sets the error indicator. Use :c:" -"func:`PyErr_Occurred` to check for that." -msgstr "" -"この関数は失敗することがあり、その場合はエラー指示子を設定します。それを確認" -"するために :c:func:`PyErr_Occurred` を使います。" - -#: ../../c-api/marshal.rst:34 +#: ../../c-api/marshal.rst:31 msgid "" "Marshal a Python object, *value*, to *file*. *version* indicates the file " "format." @@ -81,7 +76,7 @@ msgstr "" "Python オブジェクト *value* を *file* へ整列化します。*version* はファイル" "フォーマットを示します。" -#: ../../c-api/marshal.rst:42 +#: ../../c-api/marshal.rst:37 msgid "" "Return a bytes object containing the marshalled representation of *value*. " "*version* indicates the file format." @@ -89,57 +84,49 @@ msgstr "" "*value* の整列化表現が入ったバイト列オブジェクトを返します。*version* はファ" "イルフォーマットを示します。" -#: ../../c-api/marshal.rst:46 +#: ../../c-api/marshal.rst:41 msgid "The following functions allow marshalled values to be read back in." msgstr "以下の関数を使うと、整列化された値を読み戻せます。" -#: ../../c-api/marshal.rst:51 +#: ../../c-api/marshal.rst:46 msgid "" -"Return a C :c:expr:`long` from the data stream in a :c:expr:`FILE*` opened " +"Return a C :c:type:`long` from the data stream in a :c:type:`FILE*` opened " "for reading. Only a 32-bit value can be read in using this function, " -"regardless of the native size of :c:expr:`long`." +"regardless of the native size of :c:type:`long`." msgstr "" -"読み出し用に開かれた :c:expr:`FILE*` 内のデータストリームから、 C の :c:expr:" -"`long` 型データを読み出して返します。この関数は、ネイティブの :c:expr:`long` " -"のサイズに関係なく、 32 ビットの値だけを読み出せます。" -#: ../../c-api/marshal.rst:55 ../../c-api/marshal.rst:65 +#: ../../c-api/marshal.rst:50 ../../c-api/marshal.rst:60 msgid "" "On error, sets the appropriate exception (:exc:`EOFError`) and returns " "``-1``." msgstr "" "エラーの場合、適切な例外 (:exc:`EOFError`) を設定し ``-1`` を返します。" -#: ../../c-api/marshal.rst:61 +#: ../../c-api/marshal.rst:56 msgid "" -"Return a C :c:expr:`short` from the data stream in a :c:expr:`FILE*` opened " +"Return a C :c:type:`short` from the data stream in a :c:type:`FILE*` opened " "for reading. Only a 16-bit value can be read in using this function, " -"regardless of the native size of :c:expr:`short`." +"regardless of the native size of :c:type:`short`." msgstr "" -"読み出し用に開かれた :c:expr:`FILE*` 内のデータストリームから、 C の :c:expr:" -"`short` 型データを読み出して返します。この関数は、ネイティブの :c:expr:" -"`short` のサイズに関係なく、 16 ビットの値だけを読み出せます。" -#: ../../c-api/marshal.rst:71 +#: ../../c-api/marshal.rst:66 msgid "" -"Return a Python object from the data stream in a :c:expr:`FILE*` opened for " +"Return a Python object from the data stream in a :c:type:`FILE*` opened for " "reading." msgstr "" -"読み出し用に開かれた :c:expr:`FILE*` 内のデータストリームから Python オブジェ" -"クトを返します。" -#: ../../c-api/marshal.rst:74 ../../c-api/marshal.rst:88 -#: ../../c-api/marshal.rst:97 +#: ../../c-api/marshal.rst:69 ../../c-api/marshal.rst:83 +#: ../../c-api/marshal.rst:92 msgid "" "On error, sets the appropriate exception (:exc:`EOFError`, :exc:`ValueError` " "or :exc:`TypeError`) and returns ``NULL``." msgstr "" -"エラーの場合、適切な例外 (:exc:`EOFError`, :exc:`ValueError`, :exc:" +"エラーの場合、適切な例外 (:exc:`EOFError`, :exc:`ValueError`, exc:" "`TypeError`) を設定し ``NULL`` を返します。" -#: ../../c-api/marshal.rst:80 +#: ../../c-api/marshal.rst:75 msgid "" -"Return a Python object from the data stream in a :c:expr:`FILE*` opened for " +"Return a Python object from the data stream in a :c:type:`FILE*` opened for " "reading. Unlike :c:func:`PyMarshal_ReadObjectFromFile`, this function " "assumes that no further objects will be read from the file, allowing it to " "aggressively load file data into memory so that the de-serialization can " @@ -147,15 +134,8 @@ msgid "" "file. Only use these variant if you are certain that you won't be reading " "anything else from the file." msgstr "" -"読み出し用に開かれた :c:expr:`FILE*` 内のデータストリームから、 Python オブ" -"ジェクトを読み出して返します。 :c:func:`PyMarshal_ReadObjectFromFile` と違" -"い、この関数はファイル中に後続のオブジェクトが存在しないと仮定し、ファイルか" -"らメモリ上にファイルデータを一気にメモリにロードして、逆整列化機構がファイル" -"から一バイトづつ読み出す代わりにメモリ上のデータを操作できるようにします。対" -"象のファイルから他に何も読み出さないと分かっている場合にのみ、この関数を使っ" -"てください。" -#: ../../c-api/marshal.rst:94 +#: ../../c-api/marshal.rst:89 msgid "" "Return a Python object from the data stream in a byte buffer containing " "*len* bytes pointed to by *data*." diff --git a/c-api/memory.po b/c-api/memory.po index e3cf2dd6f..2b9566c53 100644 --- a/c-api/memory.po +++ b/c-api/memory.po @@ -1,28 +1,32 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# mollinaca, 2021 -# yaakiyu, 2022 -# Arihiro TAKASE, 2023 -# tomo, 2025 +# Nozomu Kaneko , 2017 +# 秘湯 , 2017 +# E. Kawashima, 2017 +# Arihiro TAKASE, 2017 +# Inada Naoki , 2017 +# Osamu NAKAMURA, 2017 +# tomo, 2020 +# mollinaca, 2020 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-06 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:49+0000\n" -"Last-Translator: tomo, 2025\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-03-10 05:40+0000\n" +"PO-Revision-Date: 2017-02-16 17:37+0000\n" +"Last-Translator: mollinaca, 2020\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/memory.rst:8 @@ -110,19 +114,6 @@ msgstr "" "メモリ操作関数を使って安全にメモリを確保したり解放したりできます。例えば、以" "下がそのような例です::" -#: ../../c-api/memory.rst:58 -msgid "" -"PyObject *res;\n" -"char *buf = (char *) malloc(BUFSIZ); /* for I/O */\n" -"\n" -"if (buf == NULL)\n" -" return PyErr_NoMemory();\n" -"...Do some I/O operation involving buf...\n" -"res = PyBytes_FromString(buf);\n" -"free(buf); /* malloc'ed */\n" -"return res;" -msgstr "" - #: ../../c-api/memory.rst:68 msgid "" "In this example, the memory request for the I/O buffer is handled by the C " @@ -141,7 +132,7 @@ msgid "" "extended with new object types written in C. Another reason for using the " "Python heap is the desire to *inform* the Python memory manager about the " "memory needs of the extension module. Even when the requested memory is used " -"exclusively for internal, highly specific purposes, delegating all memory " +"exclusively for internal, highly-specific purposes, delegating all memory " "requests to the Python memory manager causes the interpreter to have a more " "accurate image of its memory footprint as a whole. Consequently, under " "certain circumstances, the Python memory manager may or may not trigger " @@ -182,99 +173,41 @@ msgstr "" "生成される時と、シャットダウン時に :ref:`pymalloc メモリアロケータ " "` の統計情報を表示できます。" -#: ../../c-api/memory.rst:96 -msgid "Allocator Domains" -msgstr "" - -#: ../../c-api/memory.rst:100 -msgid "" -"All allocating functions belong to one of three different \"domains\" (see " -"also :c:type:`PyMemAllocatorDomain`). These domains represent different " -"allocation strategies and are optimized for different purposes. The specific " -"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 `. 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:109 -msgid "The three allocation domains are:" -msgstr "" - -#: ../../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 an :term:`attached thread state`. The memory " -"is requested directly from the system. See :ref:`Raw Memory Interface `." -msgstr "" - -#: ../../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 " -"an :term:`attached thread state`. The memory is taken from the Python " -"private heap. See :ref:`Memory Interface `." -msgstr "" - -#: ../../c-api/memory.rst:121 -msgid "" -"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 "" -"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: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 +#: ../../c-api/memory.rst:97 msgid "Raw Memory Interface" msgstr "生メモリインターフェース" -#: ../../c-api/memory.rst:141 +#: ../../c-api/memory.rst:99 msgid "" "The following function sets are wrappers to the system allocator. These " -"functions are thread-safe, so a :term:`thread state` does not need to be :" -"term:`attached `." +"functions are thread-safe, the :term:`GIL ` does " +"not need to be held." msgstr "" +"以下の関数群はシステムのアロケータをラップします。\n" +"これらの関数はスレッドセーフで、 :term:`GIL ` を保持" +"していなくても呼び出すことができます。" -#: ../../c-api/memory.rst:145 +#: ../../c-api/memory.rst:103 msgid "" "The :ref:`default raw memory allocator ` uses the " "following functions: :c:func:`malloc`, :c:func:`calloc`, :c:func:`realloc` " -"and :c:func:`!free`; call ``malloc(1)`` (or ``calloc(1, 1)``) when " -"requesting zero bytes." +"and :c:func:`free`; call ``malloc(1)`` (or ``calloc(1, 1)``) when requesting " +"zero bytes." msgstr "" +"デフォルトの :ref:`生メモリアロケーター ` は次の関" +"数を利用します: :c:func:`malloc`, :c:func:`calloc`, :c:func:`realloc`, :c:" +"func:`free`\n" +"0バイトを要求されたときには ``malloc(1)`` (あるいは ``calloc(1, 1)``) を呼び" +"ます。" -#: ../../c-api/memory.rst:154 ../../c-api/memory.rst:224 -#: ../../c-api/memory.rst:333 +#: ../../c-api/memory.rst:112 ../../c-api/memory.rst:183 +#: ../../c-api/memory.rst:285 msgid "" -"Allocates *n* bytes and returns a pointer of type :c:expr:`void*` to the " +"Allocates *n* bytes and returns a pointer of type :c:type:`void*` to the " "allocated memory, or ``NULL`` if the request fails." msgstr "" -"*n* バイトを割り当て、そのメモリを指す :c:expr:`void*` 型のポインタを返しま" -"す。要求が失敗した場合 ``NULL`` を返します。" -#: ../../c-api/memory.rst:157 +#: ../../c-api/memory.rst:115 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 " @@ -284,18 +217,15 @@ msgstr "" "なら ``NULL`` でないユニークなポインタを返します。確保されたメモリーにはいか" "なる初期化も行われません。" -#: ../../c-api/memory.rst:164 ../../c-api/memory.rst:234 -#: ../../c-api/memory.rst:343 +#: ../../c-api/memory.rst:122 ../../c-api/memory.rst:193 +#: ../../c-api/memory.rst:295 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 " +"a pointer of type :c:type:`void*` to the allocated memory, or ``NULL`` if " "the request fails. The memory is initialized to zeros." msgstr "" -"各要素が *elsize* バイトの要素 *nelem* 個分のメモリーを確保し、そのメモリーを" -"指す :c:expr:`void*` 型のポインタを返します。アロケートに失敗した場合は " -"``NULL`` を返します。確保されたメモリー領域はゼロで初期化されます。" -#: ../../c-api/memory.rst:168 +#: ../../c-api/memory.rst:126 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 " @@ -304,8 +234,8 @@ msgstr "" "要素数か要素のサイズが0バイトの要求に対しては、可能なら ``PyMem_RawCalloc(1, " "1)`` が呼ばれたのと同じように、ユニークな ``NULL`` でないポインタを返します。" -#: ../../c-api/memory.rst:177 ../../c-api/memory.rst:247 -#: ../../c-api/memory.rst:356 +#: ../../c-api/memory.rst:135 ../../c-api/memory.rst:206 +#: ../../c-api/memory.rst:308 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." @@ -313,7 +243,7 @@ msgstr "" "*p* が指すメモリブロックを *n* バイトにリサイズします。古いサイズと新しいサイ" "ズの小さい方までの内容は変更されません。" -#: ../../c-api/memory.rst:180 +#: ../../c-api/memory.rst:138 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 " @@ -323,7 +253,7 @@ msgstr "" "く、 *n* がゼロに等しい場合、メモリブロックはリサイズされますが解放されませ" "ん。返されたポインタは非 ``NULL`` です。" -#: ../../c-api/memory.rst:184 +#: ../../c-api/memory.rst:142 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:" @@ -333,7 +263,7 @@ msgstr "" "func:`PyMem_RawRealloc`, :c:func:`PyMem_RawCalloc` の呼び出しにより返されなけ" "ればなりません。" -#: ../../c-api/memory.rst:188 +#: ../../c-api/memory.rst:146 msgid "" "If the request fails, :c:func:`PyMem_RawRealloc` returns ``NULL`` and *p* " "remains a valid pointer to the previous memory area." @@ -341,7 +271,7 @@ msgstr "" "要求が失敗した場合 :c:func:`PyMem_RawRealloc` は ``NULL`` を返し、 *p* は前の" "メモリエリアをさす有効なポインタのままです。" -#: ../../c-api/memory.rst:194 +#: ../../c-api/memory.rst:152 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:" @@ -353,16 +283,16 @@ msgstr "" "返した値でなければなりません。それ以外の場合や ``PyMem_RawFree(p)`` を呼び出" "した後だった場合、未定義の動作になります。" -#: ../../c-api/memory.rst:199 ../../c-api/memory.rst:268 -#: ../../c-api/memory.rst:377 +#: ../../c-api/memory.rst:157 ../../c-api/memory.rst:227 +#: ../../c-api/memory.rst:329 msgid "If *p* is ``NULL``, no operation is performed." msgstr "*p* が ``NULL`` の場合何もしません。" -#: ../../c-api/memory.rst:205 +#: ../../c-api/memory.rst:163 msgid "Memory Interface" msgstr "メモリインターフェース" -#: ../../c-api/memory.rst:207 ../../c-api/memory.rst:314 +#: ../../c-api/memory.rst:165 ../../c-api/memory.rst:271 msgid "" "The following function sets, modeled after the ANSI C standard, but " "specifying behavior when requesting zero bytes, are available for allocating " @@ -372,25 +302,28 @@ msgstr "" "ます。これらの関数は ANSI C 標準に従ってモデル化されていますが、0 バイトを要" "求した際の動作についても定義しています:" -#: ../../c-api/memory.rst:211 +#: ../../c-api/memory.rst:169 msgid "" "The :ref:`default memory allocator ` uses the :" "ref:`pymalloc memory allocator `." msgstr "" -#: ../../c-api/memory.rst:216 ../../c-api/memory.rst:329 +#: ../../c-api/memory.rst:174 ../../c-api/memory.rst:280 msgid "" -"There must be an :term:`attached thread state` when using these functions." +"The :term:`GIL ` must be held when using these " +"functions." msgstr "" +"これらの関数を呼ぶときには、 :term:`GIL ` を保持して" +"おく必要があります。" -#: ../../c-api/memory.rst:220 +#: ../../c-api/memory.rst:179 msgid "" "The default allocator is now pymalloc instead of system :c:func:`malloc`." msgstr "" "デフォルトのアロケータがシステムの :c:func:`malloc` から pymalloc になりまし" "た。" -#: ../../c-api/memory.rst:227 +#: ../../c-api/memory.rst:186 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 " @@ -400,7 +333,7 @@ msgstr "" "ら ``NULL`` でないユニークなポインタを返します。\n" "確保されたメモリーにはいかなる初期化も行われません。" -#: ../../c-api/memory.rst:238 +#: ../../c-api/memory.rst:197 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 " @@ -409,7 +342,7 @@ msgstr "" "要素数か要素のサイズが0バイトの要求に対しては、可能なら ``PyMem_Calloc(1, " "1)`` が呼ばれたのと同じように、ユニークな ``NULL`` でないポインタを返します。" -#: ../../c-api/memory.rst:250 +#: ../../c-api/memory.rst:209 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 " @@ -419,7 +352,7 @@ msgstr "" "く、 *n* がゼロに等しい場合、メモリブロックはリサイズされますが解放されませ" "ん。返されたポインタは非 ``NULL`` です。" -#: ../../c-api/memory.rst:254 +#: ../../c-api/memory.rst:213 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`." @@ -428,7 +361,7 @@ msgstr "" "func:`PyMem_Realloc` または :c:func:`PyMem_Calloc` の呼び出しにより返されなけ" "ればなりません。" -#: ../../c-api/memory.rst:257 +#: ../../c-api/memory.rst:216 msgid "" "If the request fails, :c:func:`PyMem_Realloc` returns ``NULL`` and *p* " "remains a valid pointer to the previous memory area." @@ -436,7 +369,7 @@ msgstr "" "要求が失敗した場合 :c:func:`PyMem_Realloc` は ``NULL`` を返し、 *p* は前のメ" "モリエリアをさす有効なポインタのままです。" -#: ../../c-api/memory.rst:263 +#: ../../c-api/memory.rst:222 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:" @@ -448,7 +381,7 @@ msgstr "" "した値でなければなりません。それ以外の場合や ``PyMem_Free(p)`` を呼び出した後" "だった場合、未定義の動作になります。" -#: ../../c-api/memory.rst:270 +#: ../../c-api/memory.rst:229 msgid "" "The following type-oriented macros are provided for convenience. Note that " "*TYPE* refers to any C type." @@ -456,22 +389,22 @@ msgstr "" "以下に挙げる型対象のマクロは利便性のために提供されているものです。*TYPE* は任" "意の C の型を表します。" -#: ../../c-api/memory.rst:276 +#: ../../c-api/memory.rst:235 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." +"of memory. Returns a pointer cast to :c:type:`TYPE*`. The memory will not " +"have been initialized in any way." msgstr "" -#: ../../c-api/memory.rst:283 +#: ../../c-api/memory.rst:242 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* " -"will be a pointer to the new memory area, or ``NULL`` in the event of " -"failure." +"sizeof(TYPE))`` bytes. Returns a pointer cast to :c:type:`TYPE*`. On " +"return, *p* will be a pointer to the new memory area, or ``NULL`` in the " +"event of failure." msgstr "" -#: ../../c-api/memory.rst:288 +#: ../../c-api/memory.rst:247 msgid "" "This is a C preprocessor macro; *p* is always reassigned. Save the original " "value of *p* to avoid losing memory when handling errors." @@ -479,11 +412,11 @@ msgstr "" "これは C プリプロセッサマクロです。*p* は常に再代入されます。エラー処理時にメ" "モリを失うのを避けるには *p* の元の値を保存してください。" -#: ../../c-api/memory.rst:294 +#: ../../c-api/memory.rst:253 msgid "Same as :c:func:`PyMem_Free`." msgstr ":c:func:`PyMem_Free` と同じです。" -#: ../../c-api/memory.rst:296 +#: ../../c-api/memory.rst:255 msgid "" "In addition, the following macro sets are provided for calling the Python " "memory allocator directly, without involving the C API functions listed " @@ -495,49 +428,41 @@ msgstr "" "バージョン間でのバイナリ互換性を保てず、それゆえに拡張モジュールでは撤廃され" "ているので注意してください。" -#: ../../c-api/memory.rst:301 +#: ../../c-api/memory.rst:260 msgid "``PyMem_MALLOC(size)``" msgstr "``PyMem_MALLOC(size)``" -#: ../../c-api/memory.rst:302 +#: ../../c-api/memory.rst:261 msgid "``PyMem_NEW(type, size)``" msgstr "``PyMem_NEW(type, size)``" -#: ../../c-api/memory.rst:303 +#: ../../c-api/memory.rst:262 msgid "``PyMem_REALLOC(ptr, size)``" msgstr "``PyMem_REALLOC(ptr, size)``" -#: ../../c-api/memory.rst:304 +#: ../../c-api/memory.rst:263 msgid "``PyMem_RESIZE(ptr, type, size)``" msgstr "``PyMem_RESIZE(ptr, type, size)``" -#: ../../c-api/memory.rst:305 +#: ../../c-api/memory.rst:264 msgid "``PyMem_FREE(ptr)``" msgstr "``PyMem_FREE(ptr)``" -#: ../../c-api/memory.rst:306 +#: ../../c-api/memory.rst:265 msgid "``PyMem_DEL(ptr)``" msgstr "``PyMem_DEL(ptr)``" -#: ../../c-api/memory.rst:312 +#: ../../c-api/memory.rst:269 msgid "Object allocators" msgstr "オブジェクトアロケータ" -#: ../../c-api/memory.rst:319 -msgid "" -"There is no guarantee that the memory returned by these allocators can be " -"successfully cast to a Python object when intercepting the allocating " -"functions in this domain by the methods described in the :ref:`Customize " -"Memory Allocators ` section." -msgstr "" - -#: ../../c-api/memory.rst:324 +#: ../../c-api/memory.rst:275 msgid "" "The :ref:`default object allocator ` uses the :" "ref:`pymalloc memory allocator `." msgstr "" -#: ../../c-api/memory.rst:336 +#: ../../c-api/memory.rst:288 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 " @@ -547,7 +472,7 @@ msgstr "" "なら ``NULL`` でないユニークなポインタを返します。\n" "確保されたメモリーにはいかなる初期化も行われません。" -#: ../../c-api/memory.rst:347 +#: ../../c-api/memory.rst:299 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 " @@ -556,7 +481,7 @@ msgstr "" "要素数か要素のサイズが0バイトの要求に対しては、可能なら ``PyObject_Calloc(1, " "1)`` が呼ばれたのと同じように、ユニークな ``NULL`` でないポインタを返します。" -#: ../../c-api/memory.rst:359 +#: ../../c-api/memory.rst:311 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 " @@ -566,7 +491,7 @@ msgstr "" "く、 *n* がゼロに等しい場合、メモリブロックはリサイズされますが解放されませ" "ん。返されたポインタは非 ``NULL`` です。" -#: ../../c-api/memory.rst:363 +#: ../../c-api/memory.rst:315 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:" @@ -576,7 +501,7 @@ msgstr "" "func:`PyObject_Realloc` または :c:func:`PyObject_Calloc` の呼び出しにより返さ" "れなければなりません。" -#: ../../c-api/memory.rst:366 +#: ../../c-api/memory.rst:318 msgid "" "If the request fails, :c:func:`PyObject_Realloc` returns ``NULL`` and *p* " "remains a valid pointer to the previous memory area." @@ -584,7 +509,7 @@ msgstr "" "要求が失敗した場合 :c:func:`PyObject_Realloc` は ``NULL`` を返し、 *p* は前の" "メモリエリアをさす有効なポインタのままです。" -#: ../../c-api/memory.rst:372 +#: ../../c-api/memory.rst:324 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:" @@ -596,280 +521,243 @@ msgstr "" "`PyObject_Calloc` の返した値でなければなりません。それ以外の場合や " "``PyObject_Free(p)`` を呼び出した後だった場合、未定義の動作になります。" -#: ../../c-api/memory.rst:379 -msgid "" -"Do not call this directly to free an object's memory; call the type's :c:" -"member:`~PyTypeObject.tp_free` slot instead." -msgstr "" - -#: ../../c-api/memory.rst:382 -msgid "" -"Do not use this for memory allocated by :c:macro:`PyObject_GC_New` or :c:" -"macro:`PyObject_GC_NewVar`; use :c:func:`PyObject_GC_Del` instead." -msgstr "" - -#: ../../c-api/memory.rst:387 -msgid "" -":c:func:`PyObject_GC_Del` is the equivalent of this function for memory " -"allocated by types that support garbage collection." -msgstr "" - -#: ../../c-api/memory.rst:389 ../../c-api/memory.rst:486 -msgid ":c:func:`PyObject_Malloc`" -msgstr ":c:func:`PyObject_Malloc`" - -#: ../../c-api/memory.rst:390 ../../c-api/memory.rst:487 -msgid ":c:func:`PyObject_Realloc`" -msgstr ":c:func:`PyObject_Realloc`" - -#: ../../c-api/memory.rst:391 ../../c-api/memory.rst:488 -msgid ":c:func:`PyObject_Calloc`" -msgstr ":c:func:`PyObject_Calloc`" - -#: ../../c-api/memory.rst:392 -msgid ":c:macro:`PyObject_New`" -msgstr "" - -#: ../../c-api/memory.rst:393 -msgid ":c:macro:`PyObject_NewVar`" -msgstr "" - -#: ../../c-api/memory.rst:394 -msgid ":c:func:`PyType_GenericAlloc`" -msgstr "" - -#: ../../c-api/memory.rst:395 -msgid ":c:member:`~PyTypeObject.tp_free`" -msgstr ":c:member:`~PyTypeObject.tp_free`" - -#: ../../c-api/memory.rst:401 +#: ../../c-api/memory.rst:335 msgid "Default Memory Allocators" msgstr "" -#: ../../c-api/memory.rst:403 +#: ../../c-api/memory.rst:337 msgid "Default memory allocators:" msgstr "" -#: ../../c-api/memory.rst:406 +#: ../../c-api/memory.rst:340 msgid "Configuration" msgstr "Configuration" -#: ../../c-api/memory.rst:406 +#: ../../c-api/memory.rst:340 msgid "Name" msgstr "名前" -#: ../../c-api/memory.rst:406 +#: ../../c-api/memory.rst:340 msgid "PyMem_RawMalloc" msgstr "PyMem_RawMalloc" -#: ../../c-api/memory.rst:406 +#: ../../c-api/memory.rst:340 msgid "PyMem_Malloc" msgstr "PyMem_Malloc" -#: ../../c-api/memory.rst:406 +#: ../../c-api/memory.rst:340 msgid "PyObject_Malloc" msgstr "PyObject_Malloc" -#: ../../c-api/memory.rst:408 +#: ../../c-api/memory.rst:342 msgid "Release build" msgstr "リリースビルド" -#: ../../c-api/memory.rst:408 +#: ../../c-api/memory.rst:342 msgid "``\"pymalloc\"``" msgstr "``\"pymalloc\"``" -#: ../../c-api/memory.rst:408 ../../c-api/memory.rst:410 +#: ../../c-api/memory.rst:342 ../../c-api/memory.rst:344 msgid "``malloc``" msgstr "``malloc``" -#: ../../c-api/memory.rst:408 +#: ../../c-api/memory.rst:342 msgid "``pymalloc``" msgstr "``pymalloc``" -#: ../../c-api/memory.rst:409 +#: ../../c-api/memory.rst:343 msgid "Debug build" msgstr "デバッグビルド" -#: ../../c-api/memory.rst:409 +#: ../../c-api/memory.rst:343 msgid "``\"pymalloc_debug\"``" msgstr "``\"pymalloc_debug\"``" -#: ../../c-api/memory.rst:409 ../../c-api/memory.rst:411 +#: ../../c-api/memory.rst:343 ../../c-api/memory.rst:345 msgid "``malloc`` + debug" msgstr "``malloc`` + debug" -#: ../../c-api/memory.rst:409 +#: ../../c-api/memory.rst:343 msgid "``pymalloc`` + debug" msgstr "``pymalloc`` + debug" -#: ../../c-api/memory.rst:410 +#: ../../c-api/memory.rst:344 msgid "Release build, without pymalloc" msgstr "pymalloc 無しのリリースビルド" -#: ../../c-api/memory.rst:410 +#: ../../c-api/memory.rst:344 msgid "``\"malloc\"``" msgstr "``\"malloc\"``" -#: ../../c-api/memory.rst:411 +#: ../../c-api/memory.rst:345 msgid "Debug build, without pymalloc" msgstr "pymalloc 無しのデバッグビルド" -#: ../../c-api/memory.rst:411 +#: ../../c-api/memory.rst:345 msgid "``\"malloc_debug\"``" msgstr "``\"malloc_debug\"``" -#: ../../c-api/memory.rst:414 +#: ../../c-api/memory.rst:348 msgid "Legend:" msgstr "説明:" -#: ../../c-api/memory.rst:416 -msgid "Name: value for :envvar:`PYTHONMALLOC` environment variable." -msgstr "" +#: ../../c-api/memory.rst:350 +msgid "Name: value for :envvar:`PYTHONMALLOC` environment variable" +msgstr "名前: :envvar:`PYTHONMALLOC` 環境変数の値" -#: ../../c-api/memory.rst:417 +#: ../../c-api/memory.rst:351 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:419 -msgid "``pymalloc``: :ref:`pymalloc memory allocator `." +"func:`malloc`, :c:func:`calloc`, :c:func:`realloc` and :c:func:`free`" msgstr "" +"``malloc``: 標準 C ライブラリのシステムアロケータ、C 関数: :c:func:" +"`malloc`, :c:func:`calloc`, :c:func:`realloc`, :c:func:`free`" -#: ../../c-api/memory.rst:420 -msgid "" -"``mimalloc``: :ref:`mimalloc memory allocator `. The pymalloc " -"allocator will be used if mimalloc support isn't available." -msgstr "" +#: ../../c-api/memory.rst:353 +msgid "``pymalloc``: :ref:`pymalloc memory allocator `" +msgstr "``pymalloc``: :ref:`pymalloc メモリアロケータ `" -#: ../../c-api/memory.rst:422 +#: ../../c-api/memory.rst:354 msgid "" -"\"+ debug\": with :ref:`debug hooks on the Python memory allocators `." +"\"+ debug\": with debug hooks installed by :c:func:`PyMem_SetupDebugHooks`" msgstr "" +"\"+ debug\": :c:func:`PyMem_SetupDebugHooks` で設置されるデバッグフックとの組" +"み合わせ" -#: ../../c-api/memory.rst:424 -msgid "\"Debug build\": :ref:`Python build in debug mode `." -msgstr "" - -#: ../../c-api/memory.rst:429 +#: ../../c-api/memory.rst:358 msgid "Customize Memory Allocators" msgstr "メモリアロケータをカスタマイズする" -#: ../../c-api/memory.rst:435 +#: ../../c-api/memory.rst:364 msgid "" -"Structure used to describe a memory block allocator. The structure has the " -"following fields:" +"Structure used to describe a memory block allocator. The structure has four " +"fields:" msgstr "" +"メモリブロックアロケータを記述するための構造体です。4つのフィールドを持ちま" +"す:" -#: ../../c-api/memory.rst:439 ../../c-api/memory.rst:686 +#: ../../c-api/memory.rst:368 ../../c-api/memory.rst:513 msgid "Field" msgstr "フィールド" -#: ../../c-api/memory.rst:439 ../../c-api/memory.rst:686 +#: ../../c-api/memory.rst:368 ../../c-api/memory.rst:513 msgid "Meaning" msgstr "意味" -#: ../../c-api/memory.rst:441 ../../c-api/memory.rst:688 +#: ../../c-api/memory.rst:370 ../../c-api/memory.rst:515 msgid "``void *ctx``" msgstr "``void *ctx``" -#: ../../c-api/memory.rst:441 ../../c-api/memory.rst:688 +#: ../../c-api/memory.rst:370 ../../c-api/memory.rst:515 msgid "user context passed as first argument" msgstr "第一引数として渡されるユーザコンテキスト" -#: ../../c-api/memory.rst:443 +#: ../../c-api/memory.rst:372 msgid "``void* malloc(void *ctx, size_t size)``" msgstr "``void* malloc(void *ctx, size_t size)``" -#: ../../c-api/memory.rst:443 +#: ../../c-api/memory.rst:372 msgid "allocate a memory block" msgstr "メモリブロックを割り当てます" -#: ../../c-api/memory.rst:445 +#: ../../c-api/memory.rst:374 msgid "``void* calloc(void *ctx, size_t nelem, size_t elsize)``" msgstr "``void* calloc(void *ctx, size_t nelem, size_t elsize)``" -#: ../../c-api/memory.rst:445 +#: ../../c-api/memory.rst:374 msgid "allocate a memory block initialized with zeros" msgstr "0で初期化されたメモリブロックを割り当てます" -#: ../../c-api/memory.rst:448 +#: ../../c-api/memory.rst:377 msgid "``void* realloc(void *ctx, void *ptr, size_t new_size)``" msgstr "``void* realloc(void *ctx, void *ptr, size_t new_size)``" -#: ../../c-api/memory.rst:448 +#: ../../c-api/memory.rst:377 msgid "allocate or resize a memory block" msgstr "メモリブロックを割り当てるかリサイズします" -#: ../../c-api/memory.rst:450 +#: ../../c-api/memory.rst:379 msgid "``void free(void *ctx, void *ptr)``" msgstr "``void free(void *ctx, void *ptr)``" -#: ../../c-api/memory.rst:450 +#: ../../c-api/memory.rst:379 msgid "free a memory block" msgstr "メモリブロックを解放する" -#: ../../c-api/memory.rst:453 +#: ../../c-api/memory.rst:382 msgid "" -"The :c:type:`!PyMemAllocator` structure was renamed to :c:type:" +"The :c:type:`PyMemAllocator` structure was renamed to :c:type:" "`PyMemAllocatorEx` and a new ``calloc`` field was added." msgstr "" +":c:type:`PyMemAllocator` 構造体が :c:type:`PyMemAllocatorEx` にリネームされた" +"上で ``calloc`` フィールドが追加されました。" -#: ../../c-api/memory.rst:460 +#: ../../c-api/memory.rst:389 msgid "Enum used to identify an allocator domain. Domains:" msgstr "アロケータドメインを同定するための列挙型です。ドメインは:" -#: ../../c-api/memory.rst:466 ../../c-api/memory.rst:475 -#: ../../c-api/memory.rst:484 +#: ../../c-api/memory.rst:393 ../../c-api/memory.rst:402 +#: ../../c-api/memory.rst:411 msgid "Functions:" msgstr "関数:" -#: ../../c-api/memory.rst:468 +#: ../../c-api/memory.rst:395 msgid ":c:func:`PyMem_RawMalloc`" msgstr ":c:func:`PyMem_RawMalloc`" -#: ../../c-api/memory.rst:469 +#: ../../c-api/memory.rst:396 msgid ":c:func:`PyMem_RawRealloc`" msgstr ":c:func:`PyMem_RawRealloc`" -#: ../../c-api/memory.rst:470 +#: ../../c-api/memory.rst:397 msgid ":c:func:`PyMem_RawCalloc`" msgstr ":c:func:`PyMem_RawCalloc`" -#: ../../c-api/memory.rst:471 +#: ../../c-api/memory.rst:398 msgid ":c:func:`PyMem_RawFree`" msgstr ":c:func:`PyMem_RawFree`" -#: ../../c-api/memory.rst:477 +#: ../../c-api/memory.rst:404 msgid ":c:func:`PyMem_Malloc`," msgstr ":c:func:`PyMem_Malloc`," -#: ../../c-api/memory.rst:478 +#: ../../c-api/memory.rst:405 msgid ":c:func:`PyMem_Realloc`" msgstr ":c:func:`PyMem_Realloc`" -#: ../../c-api/memory.rst:479 +#: ../../c-api/memory.rst:406 msgid ":c:func:`PyMem_Calloc`" msgstr ":c:func:`PyMem_Calloc`" -#: ../../c-api/memory.rst:480 +#: ../../c-api/memory.rst:407 msgid ":c:func:`PyMem_Free`" msgstr ":c:func:`PyMem_Free`" -#: ../../c-api/memory.rst:489 +#: ../../c-api/memory.rst:413 +msgid ":c:func:`PyObject_Malloc`" +msgstr ":c:func:`PyObject_Malloc`" + +#: ../../c-api/memory.rst:414 +msgid ":c:func:`PyObject_Realloc`" +msgstr ":c:func:`PyObject_Realloc`" + +#: ../../c-api/memory.rst:415 +msgid ":c:func:`PyObject_Calloc`" +msgstr ":c:func:`PyObject_Calloc`" + +#: ../../c-api/memory.rst:416 msgid ":c:func:`PyObject_Free`" msgstr ":c:func:`PyObject_Free`" -#: ../../c-api/memory.rst:493 +#: ../../c-api/memory.rst:420 msgid "Get the memory block allocator of the specified domain." msgstr "指定されたドメインのメモリブロックアロケータを取得します。" -#: ../../c-api/memory.rst:498 +#: ../../c-api/memory.rst:425 msgid "Set the memory block allocator of the specified domain." msgstr "指定されたドメインのメモリブロックアロケータを設定します。" -#: ../../c-api/memory.rst:500 +#: ../../c-api/memory.rst:427 msgid "" "The new allocator must return a distinct non-``NULL`` pointer when " "requesting zero bytes." @@ -877,21 +765,17 @@ msgstr "" "新しいアロケータは、0バイトを要求されたときユニークな ``NULL`` でないポインタ" "を返さなければなりません。" -#: ../../c-api/memory.rst:503 +#: ../../c-api/memory.rst:430 msgid "" -"For the :c:macro:`PYMEM_DOMAIN_RAW` domain, the allocator must be thread-" -"safe: a :term:`thread state` is not :term:`attached ` " -"when the allocator is called." +"For the :c:data:`PYMEM_DOMAIN_RAW` domain, the allocator must be thread-" +"safe: the :term:`GIL ` is not held when the " +"allocator is called." msgstr "" +":c:data:`PYMEM_DOMAIN_RAW` ドメインでは、アロケータはスレッドセーフでなければ" +"なりません: アロケータが呼び出されたとき :term:`GIL ` は保持されていません。" -#: ../../c-api/memory.rst:507 -msgid "" -"For the remaining domains, the allocator must also be thread-safe: the " -"allocator may be called in different interpreters that do not share a :term:" -"`GIL`." -msgstr "" - -#: ../../c-api/memory.rst:511 +#: ../../c-api/memory.rst:434 msgid "" "If the new allocator is not a hook (does not call the previous allocator), " "the :c:func:`PyMem_SetupDebugHooks` function must be called to reinstall the " @@ -901,105 +785,45 @@ msgstr "" "func:`PyMem_SetupDebugHooks` 関数を呼び出して、新しいアロケータの上にデバッグ" "フックを再度設置しなければなりません。" -#: ../../c-api/memory.rst:515 -msgid "" -"See also :c:member:`PyPreConfig.allocator` and :ref:`Preinitialize Python " -"with PyPreConfig `." -msgstr "" - -#: ../../c-api/memory.rst:520 -msgid ":c:func:`PyMem_SetAllocator` does have the following contract:" -msgstr "" - -#: ../../c-api/memory.rst:522 -msgid "" -"It can be called after :c:func:`Py_PreInitialize` and before :c:func:" -"`Py_InitializeFromConfig` to install a custom memory allocator. There are no " -"restrictions over the installed allocator other than the ones imposed by the " -"domain (for instance, the Raw Domain allows the allocator to be called " -"without an :term:`attached thread state`). See :ref:`the section on " -"allocator domains ` for more information." -msgstr "" - -#: ../../c-api/memory.rst:530 -msgid "" -"If called after Python has finish initializing (after :c:func:" -"`Py_InitializeFromConfig` has been called) the allocator **must** wrap the " -"existing allocator. Substituting the current allocator for some other " -"arbitrary one is **not supported**." -msgstr "" - -#: ../../c-api/memory.rst:535 -msgid "All allocators must be thread-safe." -msgstr "" - -#: ../../c-api/memory.rst:541 -msgid "" -"Setup :ref:`debug hooks in the Python memory allocators ` " -"to detect memory errors." -msgstr "" - -#: ../../c-api/memory.rst:548 -msgid "Debug hooks on the Python memory allocators" -msgstr "" - -#: ../../c-api/memory.rst:550 -msgid "" -"When :ref:`Python is built in debug mode `, the :c:func:" -"`PyMem_SetupDebugHooks` function is called at the :ref:`Python " -"preinitialization ` to setup debug hooks on Python memory " -"allocators to detect memory errors." -msgstr "" - -#: ../../c-api/memory.rst:555 -msgid "" -"The :envvar:`PYTHONMALLOC` environment variable can be used to install debug " -"hooks on a Python compiled in release mode (ex: ``PYTHONMALLOC=debug``)." -msgstr "" +#: ../../c-api/memory.rst:441 +msgid "Setup hooks to detect bugs in the Python memory allocator functions." +msgstr "Python メモリアロケータ関数のバグを検出するためのフックを設定します。" -#: ../../c-api/memory.rst:558 -msgid "" -"The :c:func:`PyMem_SetupDebugHooks` function can be used to set debug hooks " -"after calling :c:func:`PyMem_SetAllocator`." -msgstr "" - -#: ../../c-api/memory.rst:561 +#: ../../c-api/memory.rst:443 msgid "" -"These debug hooks fill dynamically allocated memory blocks with special, " -"recognizable bit patterns. Newly allocated memory is filled with the byte " -"``0xCD`` (``PYMEM_CLEANBYTE``), freed memory is filled with the byte " -"``0xDD`` (``PYMEM_DEADBYTE``). Memory blocks are surrounded by \"forbidden " -"bytes\" filled with the byte ``0xFD`` (``PYMEM_FORBIDDENBYTE``). Strings of " -"these bytes are unlikely to be valid addresses, floats, or ASCII strings." +"Newly allocated memory is filled with the byte ``0xCD`` (``CLEANBYTE``), " +"freed memory is filled with the byte ``0xDD`` (``DEADBYTE``). Memory blocks " +"are surrounded by \"forbidden bytes\" (``FORBIDDENBYTE``: byte ``0xFD``)." msgstr "" -#: ../../c-api/memory.rst:568 +#: ../../c-api/memory.rst:447 msgid "Runtime checks:" msgstr "実行時チェック:" -#: ../../c-api/memory.rst:570 +#: ../../c-api/memory.rst:449 msgid "" -"Detect API violations. For example, detect if :c:func:`PyObject_Free` is " -"called on a memory block allocated by :c:func:`PyMem_Malloc`." +"Detect API violations, ex: :c:func:`PyObject_Free` called on a buffer " +"allocated by :c:func:`PyMem_Malloc`" msgstr "" +"API 違反を検出します。例: :c:func:`PyMem_Malloc` が割り当てたバッファに対し" +"て :c:func:`PyObject_Free` を呼びだした。" -#: ../../c-api/memory.rst:572 -msgid "Detect write before the start of the buffer (buffer underflow)." -msgstr "" +#: ../../c-api/memory.rst:451 +msgid "Detect write before the start of the buffer (buffer underflow)" +msgstr "バッファの開始前の書き込み (バッファアンダーフロー) を検出します" -#: ../../c-api/memory.rst:573 -msgid "Detect write after the end of the buffer (buffer overflow)." -msgstr "" +#: ../../c-api/memory.rst:452 +msgid "Detect write after the end of the buffer (buffer overflow)" +msgstr "バッファ終了後の書き込み (バッファオーバーフロー) を検出します" -#: ../../c-api/memory.rst:574 +#: ../../c-api/memory.rst:453 msgid "" -"Check that there is an :term:`attached thread state` when allocator " -"functions of :c:macro:`PYMEM_DOMAIN_OBJ` (ex: :c:func:`PyObject_Malloc`) " -"and :c:macro:`PYMEM_DOMAIN_MEM` (ex: :c:func:`PyMem_Malloc`) domains are " -"called." +"Check that the :term:`GIL ` is held when allocator " +"functions of :c:data:`PYMEM_DOMAIN_OBJ` (ex: :c:func:`PyObject_Malloc`) and :" +"c:data:`PYMEM_DOMAIN_MEM` (ex: :c:func:`PyMem_Malloc`) domains are called" msgstr "" -#: ../../c-api/memory.rst:579 +#: ../../c-api/memory.rst:458 msgid "" "On error, the debug hooks use the :mod:`tracemalloc` module to get the " "traceback where a memory block was allocated. The traceback is only " @@ -1007,251 +831,142 @@ msgid "" "memory block was traced." msgstr "" -#: ../../c-api/memory.rst:584 -msgid "" -"Let *S* = ``sizeof(size_t)``. ``2*S`` bytes are added at each end of each " -"block of *N* bytes requested. The memory layout is like so, where p " -"represents the address returned by a malloc-like or realloc-like function " -"(``p[i:j]`` means the slice of bytes from ``*(p+i)`` inclusive up to " -"``*(p+j)`` exclusive; note that the treatment of negative indices differs " -"from a Python slice):" -msgstr "" - -#: ../../c-api/memory.rst:590 -msgid "``p[-2*S:-S]``" -msgstr "" - -#: ../../c-api/memory.rst:591 -msgid "" -"Number of bytes originally asked for. This is a size_t, big-endian (easier " -"to read in a memory dump)." -msgstr "" - -#: ../../c-api/memory.rst:593 -msgid "``p[-S]``" -msgstr "" - -#: ../../c-api/memory.rst:594 -msgid "API identifier (ASCII character):" -msgstr "" - -#: ../../c-api/memory.rst:596 -msgid "``'r'`` for :c:macro:`PYMEM_DOMAIN_RAW`." -msgstr "" - -#: ../../c-api/memory.rst:597 -msgid "``'m'`` for :c:macro:`PYMEM_DOMAIN_MEM`." -msgstr "" - -#: ../../c-api/memory.rst:598 -msgid "``'o'`` for :c:macro:`PYMEM_DOMAIN_OBJ`." -msgstr "" - -#: ../../c-api/memory.rst:600 -msgid "``p[-S+1:0]``" -msgstr "" - -#: ../../c-api/memory.rst:601 -msgid "Copies of PYMEM_FORBIDDENBYTE. Used to catch under- writes and reads." -msgstr "" - -#: ../../c-api/memory.rst:603 -msgid "``p[0:N]``" -msgstr "" - -#: ../../c-api/memory.rst:604 +#: ../../c-api/memory.rst:463 msgid "" -"The requested memory, filled with copies of PYMEM_CLEANBYTE, used to catch " -"reference to uninitialized memory. When a realloc-like function is called " -"requesting a larger memory block, the new excess bytes are also filled with " -"PYMEM_CLEANBYTE. When a free-like function is called, these are overwritten " -"with PYMEM_DEADBYTE, to catch reference to freed memory. When a realloc- " -"like function is called requesting a smaller memory block, the excess old " -"bytes are also filled with PYMEM_DEADBYTE." -msgstr "" - -#: ../../c-api/memory.rst:612 -msgid "``p[N:N+S]``" -msgstr "" - -#: ../../c-api/memory.rst:613 -msgid "Copies of PYMEM_FORBIDDENBYTE. Used to catch over- writes and reads." -msgstr "" - -#: ../../c-api/memory.rst:615 -msgid "``p[N+S:N+2*S]``" +"These hooks are :ref:`installed by default ` if " +"Python is compiled in debug mode. The :envvar:`PYTHONMALLOC` environment " +"variable can be used to install debug hooks on a Python compiled in release " +"mode." msgstr "" -#: ../../c-api/memory.rst:616 -msgid "" -"Only used if the ``PYMEM_DEBUG_SERIALNO`` macro is defined (not defined by " -"default)." -msgstr "" - -#: ../../c-api/memory.rst:619 -msgid "" -"A serial number, incremented by 1 on each call to a malloc-like or realloc-" -"like function. Big-endian :c:type:`size_t`. If \"bad memory\" is detected " -"later, the serial number gives an excellent way to set a breakpoint on the " -"next run, to capture the instant at which this block was passed out. The " -"static function bumpserialno() in obmalloc.c is the only place the serial " -"number is incremented, and exists so you can set such a breakpoint easily." -msgstr "" - -#: ../../c-api/memory.rst:626 -msgid "" -"A realloc-like or free-like function first checks that the " -"PYMEM_FORBIDDENBYTE bytes at each end are intact. If they've been altered, " -"diagnostic output is written to stderr, and the program is aborted via " -"Py_FatalError(). The other main failure mode is provoking a memory error " -"when a program reads up one of the special bit patterns and tries to use it " -"as an address. If you get in a debugger then and look at the object, you're " -"likely to see that it's entirely filled with PYMEM_DEADBYTE (meaning freed " -"memory is getting used) or PYMEM_CLEANBYTE (meaning uninitialized memory is " -"getting used)." -msgstr "" - -#: ../../c-api/memory.rst:635 +#: ../../c-api/memory.rst:468 msgid "" -"The :c:func:`PyMem_SetupDebugHooks` function now also works on Python " -"compiled in release mode. On error, the debug hooks now use :mod:" -"`tracemalloc` to get the traceback where a memory block was allocated. The " -"debug hooks now also check if there is an :term:`attached thread state` when " -"functions of :c:macro:`PYMEM_DOMAIN_OBJ` and :c:macro:`PYMEM_DOMAIN_MEM` " -"domains are called." +"This function now also works on Python compiled in release mode. On error, " +"the debug hooks now use :mod:`tracemalloc` to get the traceback where a " +"memory block was allocated. The debug hooks now also check if the GIL is " +"held when functions of :c:data:`PYMEM_DOMAIN_OBJ` and :c:data:" +"`PYMEM_DOMAIN_MEM` domains are called." msgstr "" -#: ../../c-api/memory.rst:643 +#: ../../c-api/memory.rst:475 msgid "" -"Byte patterns ``0xCB`` (``PYMEM_CLEANBYTE``), ``0xDB`` (``PYMEM_DEADBYTE``) " -"and ``0xFB`` (``PYMEM_FORBIDDENBYTE``) have been replaced with ``0xCD``, " -"``0xDD`` and ``0xFD`` to use the same values than Windows CRT debug " -"``malloc()`` and ``free()``." +"Byte patterns ``0xCB`` (``CLEANBYTE``), ``0xDB`` (``DEADBYTE``) and ``0xFB`` " +"(``FORBIDDENBYTE``) have been replaced with ``0xCD``, ``0xDD`` and ``0xFD`` " +"to use the same values than Windows CRT debug ``malloc()`` and ``free()``." msgstr "" -#: ../../c-api/memory.rst:653 +#: ../../c-api/memory.rst:485 msgid "The pymalloc allocator" msgstr "pymalloc アロケータ" -#: ../../c-api/memory.rst:655 +#: ../../c-api/memory.rst:487 msgid "" "Python has a *pymalloc* allocator optimized for small objects (smaller or " "equal to 512 bytes) with a short lifetime. It uses memory mappings called " -"\"arenas\" with a fixed size of either 256 KiB on 32-bit platforms or 1 MiB " -"on 64-bit platforms. It falls back to :c:func:`PyMem_RawMalloc` and :c:func:" -"`PyMem_RawRealloc` for allocations larger than 512 bytes." +"\"arenas\" with a fixed size of 256 KiB. It falls back to :c:func:" +"`PyMem_RawMalloc` and :c:func:`PyMem_RawRealloc` for allocations larger than " +"512 bytes." msgstr "" +"Python には、寿命の短いの小さな(512バイト以下の)オブジェクトに最適化された " +"*pymalloc* アロケータがあります。 *pymalloc* は、256 KiBの固定サイズの \"ア" +"リーナ\" と呼びれるメモリマッピングを使います。512バイトよりも大きな割り当て" +"では、 :c:func:`PyMem_RawMalloc` と :c:func:`PyMem_RawRealloc` にフォールバッ" +"クします。" -#: ../../c-api/memory.rst:661 +#: ../../c-api/memory.rst:492 msgid "" "*pymalloc* is the :ref:`default allocator ` of " -"the :c:macro:`PYMEM_DOMAIN_MEM` (ex: :c:func:`PyMem_Malloc`) and :c:macro:" +"the :c:data:`PYMEM_DOMAIN_MEM` (ex: :c:func:`PyMem_Malloc`) and :c:data:" "`PYMEM_DOMAIN_OBJ` (ex: :c:func:`PyObject_Malloc`) domains." msgstr "" +"*pymalloc* は、:c:data:`PYMEM_DOMAIN_MEM` (ex: :c:func:`PyMem_Malloc`) と :c:" +"data:`PYMEM_DOMAIN_OBJ` (ex: :c:func:`PyObject_Malloc`) ドメインの :ref:`既定" +"のアロケータ ` です。" -#: ../../c-api/memory.rst:665 +#: ../../c-api/memory.rst:496 msgid "The arena allocator uses the following functions:" msgstr "アリーナアロケータは、次の関数を使います:" -#: ../../c-api/memory.rst:667 -msgid ":c:func:`!VirtualAlloc` and :c:func:`!VirtualFree` on Windows," -msgstr "" +#: ../../c-api/memory.rst:498 +msgid ":c:func:`VirtualAlloc` and :c:func:`VirtualFree` on Windows," +msgstr "Windows では :c:func:`VirtualAlloc` と :c:func:`VirtualFree`、" -#: ../../c-api/memory.rst:668 -msgid ":c:func:`!mmap` and :c:func:`!munmap` if available," -msgstr "" +#: ../../c-api/memory.rst:499 +msgid ":c:func:`mmap` and :c:func:`munmap` if available," +msgstr "利用できる場合、:c:func:`mmap` と :c:func:`munmap`、" -#: ../../c-api/memory.rst:669 +#: ../../c-api/memory.rst:500 msgid ":c:func:`malloc` and :c:func:`free` otherwise." msgstr "それ以外の場合は :c:func:`malloc` と :c:func:`free`。" -#: ../../c-api/memory.rst:671 -msgid "" -"This allocator is disabled if Python is configured with the :option:`--" -"without-pymalloc` option. It can also be disabled at runtime using the :" -"envvar:`PYTHONMALLOC` environment variable (ex: ``PYTHONMALLOC=malloc``)." -msgstr "" - -#: ../../c-api/memory.rst:676 +#: ../../c-api/memory.rst:503 msgid "Customize pymalloc Arena Allocator" msgstr "pymalloc アリーナアロケータのカスタマイズ" -#: ../../c-api/memory.rst:682 +#: ../../c-api/memory.rst:509 msgid "" "Structure used to describe an arena allocator. The structure has three " "fields:" msgstr "" "アリーナアロケータを記述するための構造体です。3つのフィールドを持ちます:" -#: ../../c-api/memory.rst:690 +#: ../../c-api/memory.rst:517 msgid "``void* alloc(void *ctx, size_t size)``" msgstr "``void* alloc(void *ctx, size_t size)``" -#: ../../c-api/memory.rst:690 +#: ../../c-api/memory.rst:517 msgid "allocate an arena of size bytes" msgstr "size バイトのアリーナを割り当てます" -#: ../../c-api/memory.rst:692 +#: ../../c-api/memory.rst:519 msgid "``void free(void *ctx, void *ptr, size_t size)``" msgstr "" -#: ../../c-api/memory.rst:692 +#: ../../c-api/memory.rst:519 msgid "free an arena" msgstr "アリーナを解放します" -#: ../../c-api/memory.rst:697 +#: ../../c-api/memory.rst:524 msgid "Get the arena allocator." msgstr "アリーナアロケータを取得します。" -#: ../../c-api/memory.rst:701 +#: ../../c-api/memory.rst:528 msgid "Set the arena allocator." msgstr "アリーナアロケータを設定します。" -#: ../../c-api/memory.rst:706 -msgid "The mimalloc allocator" -msgstr "" - -#: ../../c-api/memory.rst:710 -msgid "" -"Python supports the mimalloc allocator when the underlying platform support " -"is available. mimalloc \"is a general purpose allocator with excellent " -"performance characteristics. Initially developed by Daan Leijen for the " -"runtime systems of the Koka and Lean languages.\"" -msgstr "" - -#: ../../c-api/memory.rst:715 +#: ../../c-api/memory.rst:532 msgid "tracemalloc C API" msgstr "tracemalloc C API" -#: ../../c-api/memory.rst:721 +#: ../../c-api/memory.rst:538 msgid "Track an allocated memory block in the :mod:`tracemalloc` module." msgstr "" -#: ../../c-api/memory.rst:723 +#: ../../c-api/memory.rst:540 msgid "" "Return ``0`` on success, return ``-1`` on error (failed to allocate memory " "to store the trace). Return ``-2`` if tracemalloc is disabled." msgstr "" -#: ../../c-api/memory.rst:726 +#: ../../c-api/memory.rst:543 msgid "If memory block is already tracked, update the existing trace." msgstr "" -#: ../../c-api/memory.rst:730 +#: ../../c-api/memory.rst:547 msgid "" "Untrack an allocated memory block in the :mod:`tracemalloc` module. Do " "nothing if the block was not tracked." msgstr "" -#: ../../c-api/memory.rst:733 +#: ../../c-api/memory.rst:550 msgid "Return ``-2`` if tracemalloc is disabled, otherwise return ``0``." msgstr "" -#: ../../c-api/memory.rst:739 +#: ../../c-api/memory.rst:556 msgid "Examples" msgstr "使用例" -#: ../../c-api/memory.rst:741 +#: ../../c-api/memory.rst:558 msgid "" "Here is the example from section :ref:`memoryoverview`, rewritten so that " "the I/O buffer is allocated from the Python heap by using the first function " @@ -1260,37 +975,11 @@ msgstr "" "最初に述べた関数セットを使って、 :ref:`memoryoverview` 節の例を Python ヒープ" "に I/O バッファをメモリ確保するように書き換えたものを以下に示します::" -#: ../../c-api/memory.rst:744 -msgid "" -"PyObject *res;\n" -"char *buf = (char *) PyMem_Malloc(BUFSIZ); /* for I/O */\n" -"\n" -"if (buf == NULL)\n" -" return PyErr_NoMemory();\n" -"/* ...Do some I/O operation involving buf... */\n" -"res = PyBytes_FromString(buf);\n" -"PyMem_Free(buf); /* allocated with PyMem_Malloc */\n" -"return res;" -msgstr "" - -#: ../../c-api/memory.rst:754 +#: ../../c-api/memory.rst:571 msgid "The same code using the type-oriented function set::" msgstr "同じコードを型対象の関数セットで書いたものを以下に示します::" -#: ../../c-api/memory.rst:756 -msgid "" -"PyObject *res;\n" -"char *buf = PyMem_New(char, BUFSIZ); /* for I/O */\n" -"\n" -"if (buf == NULL)\n" -" return PyErr_NoMemory();\n" -"/* ...Do some I/O operation involving buf... */\n" -"res = PyBytes_FromString(buf);\n" -"PyMem_Free(buf); /* allocated with PyMem_New */\n" -"return res;" -msgstr "" - -#: ../../c-api/memory.rst:766 +#: ../../c-api/memory.rst:583 msgid "" "Note that in the two examples above, the buffer is always manipulated via " "functions belonging to the same set. Indeed, it is required to use the same " @@ -1306,44 +995,20 @@ msgstr "" "操作する別のメモリ操作関数を混用しているので *致命的 (Fatal)* とラベルづけを" "しています。 ::" -#: ../../c-api/memory.rst:773 -msgid "" -"char *buf1 = PyMem_New(char, BUFSIZ);\n" -"char *buf2 = (char *) malloc(BUFSIZ);\n" -"char *buf3 = (char *) PyMem_Malloc(BUFSIZ);\n" -"...\n" -"PyMem_Del(buf3); /* Wrong -- should be PyMem_Free() */\n" -"free(buf2); /* Right -- allocated via malloc() */\n" -"free(buf1); /* Fatal -- should be PyMem_Free() */" -msgstr "" - -#: ../../c-api/memory.rst:781 +#: ../../c-api/memory.rst:598 msgid "" "In addition to the functions aimed at handling raw memory blocks from the " -"Python heap, objects in Python are allocated and released with :c:macro:" -"`PyObject_New`, :c:macro:`PyObject_NewVar` and :c:func:`PyObject_Free`." +"Python heap, objects in Python are allocated and released with :c:func:" +"`PyObject_New`, :c:func:`PyObject_NewVar` and :c:func:`PyObject_Del`." msgstr "" +"素のメモリブロックを Python ヒープ上で操作する関数に加え、 :c:func:" +"`PyObject_New` 、 :c:func:`PyObject_NewVar` 、および :c:func:`PyObject_Del` " +"を使うと、 Python におけるオブジェクトをメモリ確保したり解放したりできます。" -#: ../../c-api/memory.rst:785 +#: ../../c-api/memory.rst:602 msgid "" "These will be explained in the next chapter on defining and implementing new " "object types in C." msgstr "" "これらの関数については、次章の C による新しいオブジェクト型の定義や実装に関す" "る記述の中で説明します。" - -#: ../../c-api/memory.rst:43 -msgid "malloc (C function)" -msgstr "" - -#: ../../c-api/memory.rst:43 -msgid "calloc (C function)" -msgstr "" - -#: ../../c-api/memory.rst:43 -msgid "realloc (C function)" -msgstr "" - -#: ../../c-api/memory.rst:43 -msgid "free (C function)" -msgstr "" diff --git a/c-api/memoryview.po b/c-api/memoryview.po index bd378e5bb..8f9d78702 100644 --- a/c-api/memoryview.po +++ b/c-api/memoryview.po @@ -1,27 +1,28 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# mollinaca, 2021 -# tomo, 2023 -# Osamu NAKAMURA, 2023 +# Arihiro TAKASE, 2017 +# Osamu NAKAMURA, 2017 +# mollinaca, 2020 +# tomo, 2021 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-06 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:49+0000\n" -"Last-Translator: Osamu NAKAMURA, 2023\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-07 05:06+0000\n" +"PO-Revision-Date: 2017-02-16 17:37+0000\n" +"Last-Translator: tomo, 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/memoryview.rst:9 @@ -50,15 +51,7 @@ msgstr "" "ら、その memoryview オブジェクトは読み書き可能です。そうでなければ読出しのみ" "になるか、エクスポーターの分別にもとづいて読み書きが可能となります。" -#: ../../c-api/memoryview.rst:26 -msgid "Flag to request a readonly buffer." -msgstr "" - -#: ../../c-api/memoryview.rst:31 -msgid "Flag to request a writable buffer." -msgstr "" - -#: ../../c-api/memoryview.rst:36 +#: ../../c-api/memoryview.rst:25 msgid "" "Create a memoryview object using *mem* as the underlying buffer. *flags* can " "be one of :c:macro:`PyBUF_READ` or :c:macro:`PyBUF_WRITE`." @@ -66,7 +59,7 @@ msgstr "" "*mem* を配下のバッファとしてmemoryview オブジェクトを作成します。 *flags* " "は :c:macro:`PyBUF_READ` か :c:macro:`PyBUF_WRITE` のどちらかになります。" -#: ../../c-api/memoryview.rst:43 +#: ../../c-api/memoryview.rst:32 msgid "" "Create a memoryview object wrapping the given buffer structure *view*. For " "simple byte buffers, :c:func:`PyMemoryView_FromMemory` is the preferred " @@ -76,7 +69,7 @@ msgstr "" "します。単なるバイトバッファ向けには、 :c:func:`PyMemoryView_FromMemory` の" "ほうが望ましいです。" -#: ../../c-api/memoryview.rst:49 +#: ../../c-api/memoryview.rst:38 msgid "" "Create a memoryview object to a :term:`contiguous` chunk of memory (in " "either 'C' or 'F'ortran *order*) from an object that defines the buffer " @@ -90,12 +83,7 @@ msgstr "" "メモリを参照します。それ以外の場合、メモリはコピーされて、 memoryview オブ" "ジェクトは新しい bytes オブジェクトを参照します。" -#: ../../c-api/memoryview.rst:55 -msgid "" -"*buffertype* can be one of :c:macro:`PyBUF_READ` or :c:macro:`PyBUF_WRITE`." -msgstr "" - -#: ../../c-api/memoryview.rst:60 +#: ../../c-api/memoryview.rst:47 msgid "" "Return true if the object *obj* is a memoryview object. It is not currently " "allowed to create subclasses of :class:`memoryview`. This function always " @@ -105,7 +93,7 @@ msgstr "" "`memoryview` のサブクラスの作成は許可されていません。この関数は常に成功しま" "す。" -#: ../../c-api/memoryview.rst:67 +#: ../../c-api/memoryview.rst:54 msgid "" "Return a pointer to the memoryview's private copy of the exporter's buffer. " "*mview* **must** be a memoryview instance; this macro doesn't check its " @@ -117,7 +105,7 @@ msgstr "" "このマクロは型をチェックしないので自前で型チェックしなければならず、それを怠" "るとクラッシュする恐れがあります。" -#: ../../c-api/memoryview.rst:73 +#: ../../c-api/memoryview.rst:60 msgid "" "Return either a pointer to the exporting object that the memoryview is based " "on or ``NULL`` if the memoryview has been created by one of the functions :c:" @@ -128,11 +116,3 @@ msgstr "" "memoryview が :c:func:`PyMemoryView_FromMemory` か :c:func:" "`PyMemoryView_FromBuffer` のどちらかで作成されていた場合、 ``NULL`` を返しま" "す。" - -#: ../../c-api/memoryview.rst:5 -msgid "object" -msgstr "object" - -#: ../../c-api/memoryview.rst:5 -msgid "memoryview" -msgstr "memoryview" diff --git a/c-api/method.po b/c-api/method.po index d61bbcbfd..533f08156 100644 --- a/c-api/method.po +++ b/c-api/method.po @@ -1,26 +1,28 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Arihiro TAKASE, 2023 -# tomo, 2023 +# Yoshikazu KARASAWA , 2017 +# Arihiro TAKASE, 2017 +# Nozomu Kaneko , 2017 +# tomo, 2021 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-06 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:49+0000\n" -"Last-Translator: tomo, 2023\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-07 05:06+0000\n" +"PO-Revision-Date: 2017-02-16 17:37+0000\n" +"Last-Translator: tomo, 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/method.rst:6 @@ -29,10 +31,13 @@ msgstr "インスタンスメソッドオブジェクト(Instance Method Objects #: ../../c-api/method.rst:10 msgid "" -"An instance method is a wrapper for a :c:type:`PyCFunction` and the new way " -"to bind a :c:type:`PyCFunction` to a class object. It replaces the former " +"An instance method is a wrapper for a :c:data:`PyCFunction` and the new way " +"to bind a :c:data:`PyCFunction` to a class object. It replaces the former " "call ``PyMethod_New(func, NULL, class)``." msgstr "" +"インスタンスメソッドとは :c:data:`PyCFunction` のためのラッパーであり、 :c:" +"data:`PyCFunction` をクラスオブジェクトにバインドするための新しいやり方です。" +"これは以前の ``PyMethod_New(func, NULL, class)`` の呼び出しを置き換えます。" #: ../../c-api/method.rst:17 msgid "" @@ -54,13 +59,13 @@ msgstr "" #: ../../c-api/method.rst:30 msgid "" -"Return a new instance method object, with *func* being any callable object. " +"Return a new instance method object, with *func* being any callable object " "*func* is the function that will be called when the instance method is " "called." msgstr "" -"任意の呼び出し可能オブジェクト *func* を使った新たなインスタンスメソッドオブ" -"ジェクトを返します。*func* はインスタンスメソッドが呼び出されたときに呼び出さ" -"れる関数です。" +"任意の呼び出し可能オブジェクト *func* を使った新たなメソッドオブジェクトを返" +"します。関数 *func* はメソッドが呼び出されたときに呼び出されるオブジェクトで" +"す。" #: ../../c-api/method.rst:37 msgid "Return the function object associated with the instance method *im*." @@ -132,19 +137,3 @@ msgstr "メソッド *meth* に関連付けられたインスタンスを返し #: ../../c-api/method.rst:95 msgid "Macro version of :c:func:`PyMethod_Self` which avoids error checking." msgstr ":c:func:`PyMethod_Self` のマクロ版で、エラーチェックを行いません。" - -#: ../../c-api/method.rst:8 ../../c-api/method.rst:50 -msgid "object" -msgstr "object" - -#: ../../c-api/method.rst:8 -msgid "instancemethod" -msgstr "instancemethod" - -#: ../../c-api/method.rst:50 -msgid "method" -msgstr "メソッド" - -#: ../../c-api/method.rst:59 -msgid "MethodType (in module types)" -msgstr "MethodType (in module types)" diff --git a/c-api/module.po b/c-api/module.po index def61f6ee..f17030741 100644 --- a/c-api/module.po +++ b/c-api/module.po @@ -1,28 +1,29 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Arihiro TAKASE, 2023 -# tomo, 2023 -# Nozomu Kaneko , 2023 -# 石井明久, 2024 +# 秘湯 , 2017 +# E. Kawashima, 2017 +# Arihiro TAKASE, 2017 +# Inada Naoki , 2017 +# tomo, 2020 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-06 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:49+0000\n" -"Last-Translator: 石井明久, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-08-05 07:09+0000\n" +"PO-Revision-Date: 2017-02-16 17:37+0000\n" +"Last-Translator: tomo, 2020\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/module.rst:6 @@ -56,25 +57,24 @@ msgstr "" #: ../../c-api/module.rst:40 msgid "" -"Return a new module object with :attr:`module.__name__` set to *name*. The " -"module's :attr:`!__name__`, :attr:`~module.__doc__`, :attr:`~module." -"__package__` and :attr:`~module.__loader__` attributes are filled in (all " -"but :attr:`!__name__` are set to ``None``). The caller is responsible for " -"setting a :attr:`~module.__file__` attribute." -msgstr "" - -#: ../../c-api/module.rst:46 ../../c-api/module.rst:272 -#: ../../c-api/module.rst:492 -msgid "Return ``NULL`` with an exception set on error." +"Return a new module object with the :attr:`__name__` attribute set to " +"*name*. The module's :attr:`__name__`, :attr:`__doc__`, :attr:`__package__`, " +"and :attr:`__loader__` attributes are filled in (all but :attr:`__name__` " +"are set to ``None``); the caller is responsible for providing a :attr:" +"`__file__` attribute." msgstr "" +":attr:`__name__` 属性に *name* が設定された新しいモジュールオブジェクトを返し" +"ます。\n" +"モジュールの :attr:`__name__`, :attr:`__doc__`, :attr:`__package__`, :attr:" +"`__loader__` 属性に値が入っています (:attr:`__name__` 以外は全て ``None`` で" +"す);\n" +":attr:`__file__` 属性に値を入れるのは呼び出し側の責任です。" -#: ../../c-api/module.rst:50 -msgid "" -":attr:`~module.__package__` and :attr:`~module.__loader__` are now set to " -"``None``." -msgstr "" +#: ../../c-api/module.rst:48 +msgid ":attr:`__package__` and :attr:`__loader__` are set to ``None``." +msgstr ":attr:`__package__` と :attr:`__loader__` は ``None`` に設定されます。" -#: ../../c-api/module.rst:57 +#: ../../c-api/module.rst:54 msgid "" "Similar to :c:func:`PyModule_NewObject`, but the name is a UTF-8 encoded " "string instead of a Unicode object." @@ -82,7 +82,7 @@ msgstr "" ":c:func:`PyModule_NewObject` に似ていますが、 name は Unicode オブジェクトで" "はなく UTF-8 でエンコードされた文字列です。" -#: ../../c-api/module.rst:65 +#: ../../c-api/module.rst:62 msgid "" "Return the dictionary object that implements *module*'s namespace; this " "object is the same as the :attr:`~object.__dict__` attribute of the module " @@ -95,23 +95,27 @@ msgstr "" "*module* がモジュールオブジェクト (もしくはモジュールオブジェクトのサブタイ" "プ) でない場合は、 :exc:`SystemError` が送出され ``NULL`` が返されます。" -#: ../../c-api/module.rst:70 +#: ../../c-api/module.rst:67 msgid "" -"It is recommended extensions use other ``PyModule_*`` and ``PyObject_*`` " -"functions rather than directly manipulate a module's :attr:`~object." -"__dict__`." +"It is recommended extensions use other :c:func:`PyModule_\\*` and :c:func:" +"`PyObject_\\*` functions rather than directly manipulate a module's :attr:" +"`~object.__dict__`." msgstr "" "拡張モジュールでは、モジュールの :attr:`~object.__dict__` を直接操作するより" -"も、 ``PyModule_*`` および ``PyObject_*`` 関数を使う方が推奨されます。" +"も、 :c:func:`PyModule_\\*` および :c:func:`PyObject_\\*` 関数を使う方が推奨" +"されます。" -#: ../../c-api/module.rst:81 +#: ../../c-api/module.rst:78 msgid "" -"Return *module*'s :attr:`~module.__name__` value. If the module does not " -"provide one, or if it is not a string, :exc:`SystemError` is raised and " -"``NULL`` is returned." +"Return *module*'s :attr:`__name__` value. If the module does not provide " +"one, or if it is not a string, :exc:`SystemError` is raised and ``NULL`` is " +"returned." msgstr "" +"*module* の :attr:`__name__` の値を返します。モジュールがこの属性を提供してい" +"ない場合や文字列型でない場合、 :exc:`SystemError` を送出して ``NULL`` を返し" +"ます。" -#: ../../c-api/module.rst:90 +#: ../../c-api/module.rst:86 msgid "" "Similar to :c:func:`PyModule_GetNameObject` but return the name encoded to " "``'utf-8'``." @@ -119,7 +123,7 @@ msgstr "" ":c:func:`PyModule_GetNameObject` に似ていますが、 ``'utf-8'`` でエンコードさ" "れた name を返します。" -#: ../../c-api/module.rst:95 +#: ../../c-api/module.rst:91 msgid "" "Return the \"state\" of the module, that is, a pointer to the block of " "memory allocated at module creation time, or ``NULL``. See :c:member:" @@ -129,7 +133,7 @@ msgstr "" "クへのポインター) か、なければ ``NULL`` を返します。 :c:member:`PyModuleDef." "m_size` を参照してください。" -#: ../../c-api/module.rst:102 +#: ../../c-api/module.rst:98 msgid "" "Return a pointer to the :c:type:`PyModuleDef` struct from which the module " "was created, or ``NULL`` if the module wasn't created from a definition." @@ -138,15 +142,19 @@ msgstr "" "ます。\n" "モジュールが定義によって作られていなかった場合は ``NULL`` を返します。" -#: ../../c-api/module.rst:112 +#: ../../c-api/module.rst:108 msgid "" "Return the name of the file from which *module* was loaded using *module*'s :" -"attr:`~module.__file__` attribute. If this is not defined, or if it is not " -"a string, raise :exc:`SystemError` and return ``NULL``; otherwise return a " -"reference to a Unicode object." +"attr:`__file__` attribute. If this is not defined, or if it is not a " +"unicode string, raise :exc:`SystemError` and return ``NULL``; otherwise " +"return a reference to a Unicode object." msgstr "" +"*module* の :attr:`__file__` 属性をもとに *module* がロードされたもとのファイ" +"ル名を返します。もしファイル名が定義されていない場合や、 Unicode 文字列ではな" +"い場合、 :exc:`SystemError` を発生させて ``NULL`` を返します。それ以外の場合" +"は Unicode オブジェクトへの参照を返します。" -#: ../../c-api/module.rst:122 +#: ../../c-api/module.rst:118 msgid "" "Similar to :c:func:`PyModule_GetFilenameObject` but return the filename " "encoded to 'utf-8'." @@ -154,20 +162,20 @@ msgstr "" ":c:func:`PyModule_GetFilenameObject` と似ていますが、 'utf-8' でエンコードさ" "れたファイル名を返します。" -#: ../../c-api/module.rst:125 +#: ../../c-api/module.rst:121 msgid "" -":c:func:`PyModule_GetFilename` raises :exc:`UnicodeEncodeError` on " +":c:func:`PyModule_GetFilename` raises :c:type:`UnicodeEncodeError` on " "unencodable filenames, use :c:func:`PyModule_GetFilenameObject` instead." msgstr "" -":c:func:`PyModule_GetFilename` はエンコードできないファイル名に対しては :exc:" -"`UnicodeEncodeError` を送出します。これの代わりに :c:func:" +":c:func:`PyModule_GetFilename` はエンコードできないファイル名に対しては :c:" +"type:`UnicodeEncodeError` を送出します。これの代わりに :c:func:" "`PyModule_GetFilenameObject` を使用してください。" -#: ../../c-api/module.rst:133 +#: ../../c-api/module.rst:129 msgid "Initializing C modules" msgstr "Cモジュールの初期化" -#: ../../c-api/module.rst:135 +#: ../../c-api/module.rst:131 msgid "" "Modules objects are usually created from extension modules (shared libraries " "which export an initialization function), or compiled-in modules (where the " @@ -181,7 +189,7 @@ msgstr "" "詳細については :ref:`building` または :ref:`extending-with-embedding` を見て" "ください。" -#: ../../c-api/module.rst:140 +#: ../../c-api/module.rst:136 msgid "" "The initialization function can either pass a module definition instance to :" "c:func:`PyModule_Create`, and return the resulting module object, or request " @@ -191,7 +199,7 @@ msgstr "" "て出来上がったモジュールオブジェクトを返してもよいですし、もしくは定義構造体" "そのものを返し\"多段階初期化\"を要求しても構いません。" -#: ../../c-api/module.rst:146 +#: ../../c-api/module.rst:142 msgid "" "The module definition struct, which holds all information needed to create a " "module object. There is usually only one statically initialized variable of " @@ -202,16 +210,16 @@ msgstr "" "通常は、それぞれのモジュールごとに静的に初期化されたこの型の変数が1つだけ存在" "します。" -#: ../../c-api/module.rst:152 -msgid "Always initialize this member to :c:macro:`PyModuleDef_HEAD_INIT`." +#: ../../c-api/module.rst:148 +msgid "Always initialize this member to :const:`PyModuleDef_HEAD_INIT`." msgstr "" -"このメンバーは常に :c:macro:`PyModuleDef_HEAD_INIT` で初期化してください。" +"このメンバーは常に :const:`PyModuleDef_HEAD_INIT` で初期化してください。" -#: ../../c-api/module.rst:156 +#: ../../c-api/module.rst:152 msgid "Name for the new module." msgstr "新しいモジュールの名前。" -#: ../../c-api/module.rst:160 +#: ../../c-api/module.rst:156 msgid "" "Docstring for the module; usually a docstring variable created with :c:macro:" "`PyDoc_STRVAR` is used." @@ -219,7 +227,7 @@ msgstr "" "モジュールの docstring。たいてい docstring は :c:macro:`PyDoc_STRVAR` を利用" "して生成されます。" -#: ../../c-api/module.rst:165 +#: ../../c-api/module.rst:161 msgid "" "Module state may be kept in a per-module memory area that can be retrieved " "with :c:func:`PyModule_GetState`, rather than in static globals. This makes " @@ -230,17 +238,17 @@ msgstr "" "とがあります。\n" "これによってモジュールは複数のサブ・インタプリターで安全に使えます。" -#: ../../c-api/module.rst:169 +#: ../../c-api/module.rst:165 msgid "" "This memory area is allocated based on *m_size* on module creation, and " -"freed when the module object is deallocated, after the :c:member:" -"`~PyModuleDef.m_free` function has been called, if present." +"freed when the module object is deallocated, after the :c:member:`m_free` " +"function has been called, if present." msgstr "" "このメモリ領域は *m_size* に基づいてモジュール作成時に確保され、モジュールオ" -"ブジェクトが破棄されるときに、 :c:member:`~PyModuleDef.m_free` 関数があればそ" -"れが呼ばれた後で解放されます。" +"ブジェクトが破棄されるときに、 :c:member:`m_free` 関数があればそれが呼ばれた" +"後で解放されます。" -#: ../../c-api/module.rst:173 +#: ../../c-api/module.rst:169 msgid "" "Setting ``m_size`` to ``-1`` means that the module does not support sub-" "interpreters, because it has global state." @@ -248,7 +256,7 @@ msgstr "" "``m_size`` に ``-1`` を設定すると、そのモジュールはグローバルな状態を持つため" "にサブ・インタープリターをサポートしていないということになります。" -#: ../../c-api/module.rst:176 +#: ../../c-api/module.rst:172 msgid "" "Setting it to a non-negative value means that the module can be re-" "initialized and specifies the additional amount of memory it requires for " @@ -259,11 +267,11 @@ msgstr "" "必要となる追加のメモリ量を指定できるということになります。\n" "非負の ``m_size`` は多段階初期化で必要になります。" -#: ../../c-api/module.rst:181 +#: ../../c-api/module.rst:177 msgid "See :PEP:`3121` for more details." msgstr "詳細は :PEP:`3121` を参照。" -#: ../../c-api/module.rst:185 +#: ../../c-api/module.rst:181 msgid "" "A pointer to a table of module-level functions, described by :c:type:" "`PyMethodDef` values. Can be ``NULL`` if no functions are present." @@ -271,7 +279,7 @@ msgstr "" ":c:type:`PyMethodDef` で定義される、モジュールレベル関数のテーブルへのポイン" "ター。関数が存在しない場合は ``NULL`` を設定することが可能。" -#: ../../c-api/module.rst:190 +#: ../../c-api/module.rst:186 msgid "" "An array of slot definitions for multi-phase initialization, terminated by a " "``{0, NULL}`` entry. When using single-phase initialization, *m_slots* must " @@ -281,7 +289,7 @@ msgstr "" "す。\n" "一段階初期化を使うときは、 *m_slots* は ``NULL`` でなければなりません。" -#: ../../c-api/module.rst:196 +#: ../../c-api/module.rst:192 msgid "" "Prior to version 3.5, this member was always set to ``NULL``, and was " "defined as:" @@ -289,7 +297,7 @@ msgstr "" "バージョン 3.5 より前は、このメンバは常に ``NULL`` に設定されていて、次のもの" "として定義されていました:" -#: ../../c-api/module.rst:203 +#: ../../c-api/module.rst:199 msgid "" "A traversal function to call during GC traversal of the module object, or " "``NULL`` if not needed." @@ -297,23 +305,23 @@ msgstr "" "GC走査がモジュールオブジェクトを走査する際に呼び出される走査関数。必要ない場" "合は ``NULL``." -#: ../../c-api/module.rst:206 ../../c-api/module.rst:221 -#: ../../c-api/module.rst:242 +#: ../../c-api/module.rst:202 ../../c-api/module.rst:217 +#: ../../c-api/module.rst:238 msgid "" "This function is not called if the module state was requested but is not " "allocated yet. This is the case immediately after the module is created and " "before the module is executed (:c:data:`Py_mod_exec` function). More " -"precisely, this function is not called if :c:member:`~PyModuleDef.m_size` is " -"greater than 0 and the module state (as returned by :c:func:" -"`PyModule_GetState`) is ``NULL``." +"precisely, this function is not called if :c:member:`m_size` is greater than " +"0 and the module state (as returned by :c:func:`PyModule_GetState`) is " +"``NULL``." msgstr "" -#: ../../c-api/module.rst:213 ../../c-api/module.rst:234 -#: ../../c-api/module.rst:249 +#: ../../c-api/module.rst:209 ../../c-api/module.rst:230 +#: ../../c-api/module.rst:245 msgid "No longer called before the module state is allocated." msgstr "" -#: ../../c-api/module.rst:218 +#: ../../c-api/module.rst:214 msgid "" "A clear function to call during GC clearing of the module object, or " "``NULL`` if not needed." @@ -321,7 +329,7 @@ msgstr "" "GCがこのモジュールオブジェクトをクリアーする時に呼び出されるクリアー関数。必" "要ない場合は、``NULL``." -#: ../../c-api/module.rst:228 +#: ../../c-api/module.rst:224 msgid "" "Like :c:member:`PyTypeObject.tp_clear`, this function is not *always* called " "before a module is deallocated. For example, when reference counting is " @@ -330,7 +338,7 @@ msgid "" "directly." msgstr "" -#: ../../c-api/module.rst:239 +#: ../../c-api/module.rst:235 msgid "" "A function to call during deallocation of the module object, or ``NULL`` if " "not needed." @@ -338,11 +346,11 @@ msgstr "" "GCがこのモジュールオブジェクトを解放するときに呼び出される関数。必要ない場合" "は ``NULL``." -#: ../../c-api/module.rst:253 +#: ../../c-api/module.rst:249 msgid "Single-phase initialization" msgstr "一段階初期化" -#: ../../c-api/module.rst:255 +#: ../../c-api/module.rst:251 msgid "" "The module initialization function may create and return the module object " "directly. This is referred to as \"single-phase initialization\", and uses " @@ -353,14 +361,17 @@ msgstr "" "これは\"一段階初期化\"と呼ばれ、次の2つのモジュール生成関数のどちらか1つを使" "います:" -#: ../../c-api/module.rst:261 +#: ../../c-api/module.rst:257 msgid "" "Create a new module object, given the definition in *def*. This behaves " -"like :c:func:`PyModule_Create2` with *module_api_version* set to :c:macro:" +"like :c:func:`PyModule_Create2` with *module_api_version* set to :const:" "`PYTHON_API_VERSION`." msgstr "" +"*def* での定義に従って新しいモジュールオブジェクトを生成します。\n" +"これは :c:func:`PyModule_Create2` の *module_api_version* に :const:" +"`PYTHON_API_VERSION` を設定したときのように振る舞います。" -#: ../../c-api/module.rst:268 +#: ../../c-api/module.rst:264 msgid "" "Create a new module object, given the definition in *def*, assuming the API " "version *module_api_version*. If that version does not match the version of " @@ -371,7 +382,7 @@ msgstr "" "もし指定されたバージョンが実行しているインタープリターのバージョンと異なる場" "合は、 :exc:`RuntimeWarning` を発生させます。" -#: ../../c-api/module.rst:276 +#: ../../c-api/module.rst:270 msgid "" "Most uses of this function should be using :c:func:`PyModule_Create` " "instead; only use this if you are sure you need it." @@ -379,74 +390,73 @@ msgstr "" "ほとんどの場合、この関数ではなく :c:func:`PyModule_Create` を利用するべきで" "す。この関数は、この関数の必要性を理解しているときにだけ利用してください。" -#: ../../c-api/module.rst:279 +#: ../../c-api/module.rst:273 msgid "" "Before it is returned from in the initialization function, the resulting " "module object is typically populated using functions like :c:func:" -"`PyModule_AddObjectRef`." +"`PyModule_AddObject`." msgstr "" "モジュールオブジェクトが初期化関数から返される前に、たいていは :c:func:" -"`PyModule_AddObjectRef` などの関数を使ってモジュールオブジェクトにメンバを所" -"属させます。" +"`PyModule_AddObject` などの関数を使ってモジュールオブジェクトにメンバを所属さ" +"せます。" -#: ../../c-api/module.rst:285 +#: ../../c-api/module.rst:279 msgid "Multi-phase initialization" msgstr "多段階初期化" -#: ../../c-api/module.rst:287 +#: ../../c-api/module.rst:281 msgid "" "An alternate way to specify extensions is to request \"multi-phase " "initialization\". Extension modules created this way behave more like Python " "modules: the initialization is split between the *creation phase*, when the " "module object is created, and the *execution phase*, when it is populated. " -"The distinction is similar to the :py:meth:`~object.__new__` and :py:meth:" -"`~object.__init__` methods of classes." +"The distinction is similar to the :py:meth:`__new__` and :py:meth:`__init__` " +"methods of classes." msgstr "" +"拡張を直接生成するもう1つのやり方は、\"多段階初期化\"を要求する方法です。\n" +"この方法で作られる拡張モジュールは、よりPythonモジュールに近い振る舞いをしま" +"す:\n" +"初期化処理は、モジュールオブジェクトを生成する *生成段階* とメンバを所属させ" +"る *実行段階* に分割されます。\n" +"この区別はクラスの :py:meth:`__new__` メソッドと :py:meth:`__init__` メソッド" +"に似ています。" -#: ../../c-api/module.rst:294 +#: ../../c-api/module.rst:288 msgid "" "Unlike modules created using single-phase initialization, these modules are " -"not singletons. For example, if the :py:attr:`sys.modules` entry is removed " -"and the module is re-imported, a new module object is created, and typically " -"populated with fresh method and type objects. The old module is subject to " -"normal garbage collection. This mirrors the behavior of pure-Python modules." -msgstr "" - -#: ../../c-api/module.rst:302 -msgid "" -"Additional module instances may be created in :ref:`sub-interpreters ` or after after Python runtime reinitialization (:c:" -"func:`Py_Finalize` and :c:func:`Py_Initialize`). In these cases, sharing " -"Python objects between module instances would likely cause crashes or " -"undefined behavior." -msgstr "" - -#: ../../c-api/module.rst:309 -msgid "" -"To avoid such issues, each instance of an extension module should be " -"*isolated*: changes to one instance should not implicitly affect the others, " -"and all state, including references to Python objects, should be specific to " -"a particular module instance. See :ref:`isolating-extensions-howto` for more " -"details and a practical guide." -msgstr "" - -#: ../../c-api/module.rst:315 -msgid "" -"A simpler way to avoid these issues is :ref:`raising an error on repeated " -"initialization `." -msgstr "" - -#: ../../c-api/module.rst:318 +"not singletons: if the *sys.modules* entry is removed and the module is re-" +"imported, a new module object is created, and the old module is subject to " +"normal garbage collection -- as with Python modules. By default, multiple " +"modules created from the same definition should be independent: changes to " +"one should not affect the others. This means that all state should be " +"specific to the module object (using e.g. using :c:func:" +"`PyModule_GetState`), or its contents (such as the module's :attr:`__dict__` " +"or individual classes created with :c:func:`PyType_FromSpec`)." +msgstr "" +"一段階初期化で生成されたモジュールと違い、多段階初期化で生成されたモジュール" +"はシングルトンではありません:\n" +"*sys.modules* のエントリーが削除されモジュールが再インポートされた場合、新し" +"いモジュールオブジェクトが生成され、古いモジュールはPythonモジュールと同じよ" +"うに通常のガベージコレクションで処理されることになります。\n" +"デフォルトでは、同じ定義から作られた複数のモジュールは独立であるべきです: あ" +"るインスタンスに加えた変更は別のインスタンスに影響しません。\n" +"これは、(例えば :c:func:`PyModule_GetState` を使って取得できる) 全ての状態" +"や、(モジュールの :attr:`__dict__` や :c:func:`PyType_FromSpec` で生成された" +"個々のクラスのような) モジュールに所属するものは、特定のモジュールオブジェク" +"ト特有のものであるべきということです。" + +#: ../../c-api/module.rst:298 msgid "" "All modules created using multi-phase initialization are expected to " -"support :ref:`sub-interpreters `, or otherwise " -"explicitly signal a lack of support. This is usually achieved by isolation " -"or blocking repeated initialization, as above. A module may also be limited " -"to the main interpreter using the :c:data:`Py_mod_multiple_interpreters` " -"slot." +"support :ref:`sub-interpreters `. Making sure " +"multiple modules are independent is typically enough to achieve this." msgstr "" +"多段階初期化を使って生成される全てのモジュールは :ref:`サブ・インタプリター " +"` をサポートすることが求められます。\n" +"複数のモジュールが独立していることを保証するのには、たいていはこのサポートを" +"するだけで十分です。" -#: ../../c-api/module.rst:326 +#: ../../c-api/module.rst:302 msgid "" "To request multi-phase initialization, the initialization function " "(PyInit_modulename) returns a :c:type:`PyModuleDef` instance with non-empty :" @@ -458,7 +468,7 @@ msgstr "" "これを返す前に、 ``PyModuleDef`` インスタンスは次の関数で初期化されなくてはい" "けません:" -#: ../../c-api/module.rst:333 +#: ../../c-api/module.rst:309 msgid "" "Ensures a module definition is a properly initialized Python object that " "correctly reports its type and reference count." @@ -466,13 +476,13 @@ msgstr "" "モジュール定義が型と参照カウントを正しく報告する、適切に初期化された Python " "オブジェクトであること保証します。" -#: ../../c-api/module.rst:336 +#: ../../c-api/module.rst:312 msgid "Returns *def* cast to ``PyObject*``, or ``NULL`` if an error occurred." msgstr "" "``PyObject*`` にキャストされた *def* を返します。エラーが発生した場合 " "``NULL`` を返します。" -#: ../../c-api/module.rst:340 +#: ../../c-api/module.rst:316 msgid "" "The *m_slots* member of the module definition must point to an array of " "``PyModuleDef_Slot`` structures:" @@ -480,23 +490,23 @@ msgstr "" "モジュール定義の *m_slots* メンバは ``PyModuleDef_Slot`` 構造体の配列を指さな" "ければなりません:" -#: ../../c-api/module.rst:347 +#: ../../c-api/module.rst:323 msgid "A slot ID, chosen from the available values explained below." msgstr "スロット ID で、以下で説明されている利用可能な値から選ばれます。" -#: ../../c-api/module.rst:351 +#: ../../c-api/module.rst:327 msgid "Value of the slot, whose meaning depends on the slot ID." msgstr "スロットの値で、意味はスロット ID に依存します。" -#: ../../c-api/module.rst:355 +#: ../../c-api/module.rst:331 msgid "The *m_slots* array must be terminated by a slot with id 0." msgstr "*m_slots* 配列はID 0 のスロットで終端されていなければなりません。" -#: ../../c-api/module.rst:357 +#: ../../c-api/module.rst:333 msgid "The available slot types are:" msgstr "利用可能なスロットの型は以下です:" -#: ../../c-api/module.rst:361 +#: ../../c-api/module.rst:337 msgid "" "Specifies a function that is called to create the module object itself. The " "*value* pointer of this slot must point to a function of the signature:" @@ -505,7 +515,7 @@ msgstr "" "このスロットの *value* ポインタは次のシグネチャを持つ関数を指していなくてはい" "けません:" -#: ../../c-api/module.rst:368 +#: ../../c-api/module.rst:342 msgid "" "The function receives a :py:class:`~importlib.machinery.ModuleSpec` " "instance, as defined in :PEP:`451`, and the module definition. It should " @@ -516,7 +526,7 @@ msgstr "" "これは新しいモジュールオブジェクトを返すか、エラーを設定して ``NULL`` を返す" "べきです。" -#: ../../c-api/module.rst:373 +#: ../../c-api/module.rst:347 msgid "" "This function should be kept minimal. In particular, it should not call " "arbitrary Python code, as trying to import the same module again may result " @@ -526,7 +536,7 @@ msgstr "" "特に任意のPythonコードを呼び出すべきではなく、同じモジュールをインポートしよ" "うとすると無限ループに陥るでしょう。" -#: ../../c-api/module.rst:377 +#: ../../c-api/module.rst:351 msgid "" "Multiple ``Py_mod_create`` slots may not be specified in one module " "definition." @@ -534,7 +544,7 @@ msgstr "" "複数の ``Py_mod_create`` スロットを1つのモジュール定義に設定しない方がよいで" "す。" -#: ../../c-api/module.rst:380 +#: ../../c-api/module.rst:354 msgid "" "If ``Py_mod_create`` is not specified, the import machinery will create a " "normal module object using :c:func:`PyModule_New`. The name is taken from " @@ -548,7 +558,7 @@ msgstr "" "ルが動的にモジュール階層における位置を調整できたり、シンボリックリンクを通し" "て同一のモジュール定義を共有しつつ別の名前でインポートできたりします。" -#: ../../c-api/module.rst:386 +#: ../../c-api/module.rst:360 msgid "" "There is no requirement for the returned object to be an instance of :c:type:" "`PyModule_Type`. Any type can be used, as long as it supports setting and " @@ -565,7 +575,7 @@ msgstr "" "のスロットを持つ場合は、 ``PyModule_Type`` インスタンスのみが返されるでしょ" "う。" -#: ../../c-api/module.rst:395 +#: ../../c-api/module.rst:369 msgid "" "Specifies a function that is called to *execute* the module. This is " "equivalent to executing the code of a Python module: typically, this " @@ -577,7 +587,7 @@ msgstr "" "この関数はたいていはクラスと定数をモジュールにします。\n" "この関数のシグネチャは以下です:" -#: ../../c-api/module.rst:404 +#: ../../c-api/module.rst:376 msgid "" "If multiple ``Py_mod_exec`` slots are specified, they are processed in the " "order they appear in the *m_slots* array." @@ -585,82 +595,15 @@ msgstr "" "複数の ``Py_mod_exec`` スロットが設定されていた場合は、 *m_slots* 配列に現れ" "た順に処理されていきます。" -#: ../../c-api/module.rst:409 ../../c-api/module.rst:442 -msgid "Specifies one of the following values:" -msgstr "" - -#: ../../c-api/module.rst:415 -msgid "The module does not support being imported in subinterpreters." -msgstr "" - -#: ../../c-api/module.rst:419 -msgid "" -"The module supports being imported in subinterpreters, but only when they " -"share the main interpreter's GIL. (See :ref:`isolating-extensions-howto`.)" -msgstr "" - -#: ../../c-api/module.rst:425 -msgid "" -"The module supports being imported in subinterpreters, even when they have " -"their own GIL. (See :ref:`isolating-extensions-howto`.)" -msgstr "" - -#: ../../c-api/module.rst:429 -msgid "" -"This slot determines whether or not importing this module in a " -"subinterpreter will fail." -msgstr "" - -#: ../../c-api/module.rst:432 -msgid "" -"Multiple ``Py_mod_multiple_interpreters`` slots may not be specified in one " -"module definition." -msgstr "" - -#: ../../c-api/module.rst:435 -msgid "" -"If ``Py_mod_multiple_interpreters`` is not specified, the import machinery " -"defaults to ``Py_MOD_MULTIPLE_INTERPRETERS_SUPPORTED``." -msgstr "" - -#: ../../c-api/module.rst:448 -msgid "" -"The module depends on the presence of the global interpreter lock (GIL), and " -"may access global state without synchronization." -msgstr "" - -#: ../../c-api/module.rst:453 -msgid "The module is safe to run without an active GIL." -msgstr "" - -#: ../../c-api/module.rst:455 -msgid "" -"This slot is ignored by Python builds not configured with :option:`--disable-" -"gil`. Otherwise, it determines whether or not importing this module will " -"cause the GIL to be automatically enabled. See :ref:`whatsnew313-free-" -"threaded-cpython` for more detail." -msgstr "" - -#: ../../c-api/module.rst:460 -msgid "" -"Multiple ``Py_mod_gil`` slots may not be specified in one module definition." -msgstr "" - -#: ../../c-api/module.rst:462 -msgid "" -"If ``Py_mod_gil`` is not specified, the import machinery defaults to " -"``Py_MOD_GIL_USED``." -msgstr "" - -#: ../../c-api/module.rst:467 +#: ../../c-api/module.rst:379 msgid "See :PEP:`489` for more details on multi-phase initialization." msgstr "多段階初期化についてより詳しくは :PEP:`489` を見てください。" -#: ../../c-api/module.rst:470 +#: ../../c-api/module.rst:382 msgid "Low-level module creation functions" msgstr "低水準モジュール作成関数" -#: ../../c-api/module.rst:472 +#: ../../c-api/module.rst:384 msgid "" "The following functions are called under the hood when using multi-phase " "initialization. They can be used directly, for example when creating module " @@ -673,26 +616,31 @@ msgstr "" "``PyModule_FromDefAndSpec`` および ``PyModule_ExecDef`` のどちらも、呼び出し" "た後にはモジュールが完全に初期化されていなければなりません。" -#: ../../c-api/module.rst:479 +#: ../../c-api/module.rst:391 msgid "" -"Create a new module object, given the definition in *def* and the ModuleSpec " -"*spec*. This behaves like :c:func:`PyModule_FromDefAndSpec2` with " -"*module_api_version* set to :c:macro:`PYTHON_API_VERSION`." +"Create a new module object, given the definition in *module* and the " +"ModuleSpec *spec*. This behaves like :c:func:`PyModule_FromDefAndSpec2` " +"with *module_api_version* set to :const:`PYTHON_API_VERSION`." msgstr "" +"*module* と ModuleSpec オブジェクトの *spec* で定義されたとおりに新しいモ" +"ジュールオブジェクトを生成します。\n" +"この関数は、 :c:func:`PyModule_FromDefAndSpec2` 関数の *module_api_version* " +"に :const:`PYTHON_API_VERSION` を指定した時とおなじようにふるまいます。" -#: ../../c-api/module.rst:487 +#: ../../c-api/module.rst:399 msgid "" -"Create a new module object, given the definition in *def* and the ModuleSpec " -"*spec*, assuming the API version *module_api_version*. If that version does " -"not match the version of the running interpreter, a :exc:`RuntimeWarning` is " -"emitted." +"Create a new module object, given the definition in *module* and the " +"ModuleSpec *spec*, assuming the API version *module_api_version*. If that " +"version does not match the version of the running interpreter, a :exc:" +"`RuntimeWarning` is emitted." msgstr "" -"APIバージョンを *module_api_version* として、 *def* と ModuleSpec オブジェク" -"トの *spec* で定義されたとおりに新しいモジュールオブジェクトを生成します。\n" +"APIバージョンを *module_api_version* として、 *module* と ModuleSpec オブジェ" +"クトの *spec* で定義されたとおりに新しいモジュールオブジェクトを生成しま" +"す。\n" "もし指定されたバージョンが実行しているインタープリターのバージョンと異なる場" "合は、 :exc:`RuntimeWarning` を発生させます。" -#: ../../c-api/module.rst:496 +#: ../../c-api/module.rst:406 msgid "" "Most uses of this function should be using :c:func:`PyModule_FromDefAndSpec` " "instead; only use this if you are sure you need it." @@ -701,12 +649,12 @@ msgstr "" "べきです。\n" "この関数は、この関数の必要性を理解しているときにだけ利用してください。" -#: ../../c-api/module.rst:503 +#: ../../c-api/module.rst:413 msgid "Process any execution slots (:c:data:`Py_mod_exec`) given in *def*." msgstr "" "*def* で与えられた任意の実行スロット (:c:data:`Py_mod_exec`) を実行します。" -#: ../../c-api/module.rst:509 +#: ../../c-api/module.rst:419 msgid "" "Set the docstring for *module* to *docstring*. This function is called " "automatically when creating a module from ``PyModuleDef``, using either " @@ -717,7 +665,7 @@ msgstr "" "``PyModule_FromDefAndSpec`` を使ってモジュールを生成するときに自動的に呼び出" "されます。" -#: ../../c-api/module.rst:518 +#: ../../c-api/module.rst:428 msgid "" "Add the functions from the ``NULL`` terminated *functions* array to " "*module*. Refer to the :c:type:`PyMethodDef` documentation for details on " @@ -738,11 +686,11 @@ msgstr "" "``PyModule_FromDefAndSpec`` を使ってモジュールを生成するときに自動的に呼び出" "されます。" -#: ../../c-api/module.rst:530 +#: ../../c-api/module.rst:440 msgid "Support functions" msgstr "サポート関数" -#: ../../c-api/module.rst:532 +#: ../../c-api/module.rst:442 msgid "" "The module initialization function (if using single phase initialization) or " "a function called from a module execution slot (if using multi-phase " @@ -753,207 +701,79 @@ msgstr "" "ロットから呼び出される関数 (多段階初期化を使う場合) は次の関数を使うと、モ" "ジュールの state の初期化を簡単にできます:" -#: ../../c-api/module.rst:539 +#: ../../c-api/module.rst:449 msgid "" "Add an object to *module* as *name*. This is a convenience function which " -"can be used from the module's initialization function." -msgstr "" -"*module* にオブジェクトを *name* として追加します。\n" -"この関数はモジュールの初期化関数から利用される便利関数です。" - -#: ../../c-api/module.rst:542 -msgid "" -"On success, return ``0``. On error, raise an exception and return ``-1``." -msgstr "" -"成功すると ``0`` を返し、エラーになると例外を送出して ``-1`` を返します。" - -#: ../../c-api/module.rst:544 ../../c-api/module.rst:595 -#: ../../c-api/module.rst:622 -msgid "Example usage::" -msgstr "使用例::" - -#: ../../c-api/module.rst:546 -msgid "" -"static int\n" -"add_spam(PyObject *module, int value)\n" -"{\n" -" PyObject *obj = PyLong_FromLong(value);\n" -" if (obj == NULL) {\n" -" return -1;\n" -" }\n" -" int res = PyModule_AddObjectRef(module, \"spam\", obj);\n" -" Py_DECREF(obj);\n" -" return res;\n" -" }" -msgstr "" - -#: ../../c-api/module.rst:558 -msgid "" -"To be convenient, the function accepts ``NULL`` *value* with an exception " -"set. In this case, return ``-1`` and just leave the raised exception " -"unchanged." -msgstr "" - -#: ../../c-api/module.rst:562 -msgid "" -"The example can also be written without checking explicitly if *obj* is " -"``NULL``::" -msgstr "" -"この例は、明示的に *obj* が ``NULL`` であることを確認せずに書くこともできま" -"す::" - -#: ../../c-api/module.rst:565 -msgid "" -"static int\n" -"add_spam(PyObject *module, int value)\n" -"{\n" -" PyObject *obj = PyLong_FromLong(value);\n" -" int res = PyModule_AddObjectRef(module, \"spam\", obj);\n" -" Py_XDECREF(obj);\n" -" return res;\n" -" }" -msgstr "" - -#: ../../c-api/module.rst:574 -msgid "" -"Note that ``Py_XDECREF()`` should be used instead of ``Py_DECREF()`` in this " -"case, since *obj* can be ``NULL``." -msgstr "" -"この場合は、 *obj* が ``NULL`` でありうるため、 ``Py_DECREF()`` の代わりに " -"``Py_XDECREF()`` を呼び出す必要があることに注意してください。" - -#: ../../c-api/module.rst:577 -msgid "" -"The number of different *name* strings passed to this function should be " -"kept small, usually by only using statically allocated strings as *name*. " -"For names that aren't known at compile time, prefer calling :c:func:" -"`PyUnicode_FromString` and :c:func:`PyObject_SetAttr` directly. For more " -"details, see :c:func:`PyUnicode_InternFromString`, which may be used " -"internally to create a key object." -msgstr "" - -#: ../../c-api/module.rst:590 -msgid "" -"Similar to :c:func:`PyModule_AddObjectRef`, but \"steals\" a reference to " -"*value*. It can be called with a result of function that returns a new " -"reference without bothering to check its result or even saving it to a " -"variable." -msgstr "" - -#: ../../c-api/module.rst:597 -msgid "" -"if (PyModule_Add(module, \"spam\", PyBytes_FromString(value)) < 0) {\n" -" goto error;\n" -"}" -msgstr "" - -#: ../../c-api/module.rst:606 -msgid "" -"Similar to :c:func:`PyModule_AddObjectRef`, but steals a reference to " -"*value* on success (if it returns ``0``)." -msgstr "" - -#: ../../c-api/module.rst:609 -msgid "" -"The new :c:func:`PyModule_Add` or :c:func:`PyModule_AddObjectRef` functions " -"are recommended, since it is easy to introduce reference leaks by misusing " -"the :c:func:`PyModule_AddObject` function." +"can be used from the module's initialization function. This steals a " +"reference to *value* on success. Return ``-1`` on error, ``0`` on success." msgstr "" -#: ../../c-api/module.rst:616 +#: ../../c-api/module.rst:455 msgid "" "Unlike other functions that steal references, ``PyModule_AddObject()`` only " -"releases the reference to *value* **on success**." +"decrements the reference count of *value* **on success**." msgstr "" -#: ../../c-api/module.rst:619 +#: ../../c-api/module.rst:458 msgid "" "This means that its return value must be checked, and calling code must :c:" -"func:`Py_XDECREF` *value* manually on error." +"func:`Py_DECREF` *value* manually on error. Example usage::" msgstr "" -#: ../../c-api/module.rst:624 -msgid "" -"PyObject *obj = PyBytes_FromString(value);\n" -"if (PyModule_AddObject(module, \"spam\", obj) < 0) {\n" -" // If 'obj' is not NULL and PyModule_AddObject() failed,\n" -" // 'obj' strong reference must be deleted with Py_XDECREF().\n" -" // If 'obj' is NULL, Py_XDECREF() does nothing.\n" -" Py_XDECREF(obj);\n" -" goto error;\n" -"}\n" -"// PyModule_AddObject() stole a reference to obj:\n" -"// Py_XDECREF(obj) is not needed here." -msgstr "" - -#: ../../c-api/module.rst:637 -msgid ":c:func:`PyModule_AddObject` is :term:`soft deprecated`." -msgstr "" - -#: ../../c-api/module.rst:642 +#: ../../c-api/module.rst:470 msgid "" "Add an integer constant to *module* as *name*. This convenience function " -"can be used from the module's initialization function. Return ``-1`` with an " -"exception set on error, ``0`` on success." -msgstr "" - -#: ../../c-api/module.rst:646 -msgid "" -"This is a convenience function that calls :c:func:`PyLong_FromLong` and :c:" -"func:`PyModule_AddObjectRef`; see their documentation for details." +"can be used from the module's initialization function. Return ``-1`` on " +"error, ``0`` on success." msgstr "" +"*module* に整数定数を *name* として追加します。この便宜関数はモジュールの初期" +"化関数から利用されています。エラーのときには ``-1`` を、成功したときには " +"``0`` を返します。" -#: ../../c-api/module.rst:652 +#: ../../c-api/module.rst:477 msgid "" "Add a string constant to *module* as *name*. This convenience function can " "be used from the module's initialization function. The string *value* must " -"be ``NULL``-terminated. Return ``-1`` with an exception set on error, ``0`` " -"on success." +"be ``NULL``-terminated. Return ``-1`` on error, ``0`` on success." msgstr "" +"*module* に文字列定数を *name* として追加します。\n" +"この便利関数はモジュールの初期化関数から利用されています。\n" +"文字列 *value* は ``NULL`` 終端されていなければなりません。\n" +"エラーのときには ``-1`` を、成功したときには ``0`` を返します。" -#: ../../c-api/module.rst:657 -msgid "" -"This is a convenience function that calls :c:func:" -"`PyUnicode_InternFromString` and :c:func:`PyModule_AddObjectRef`; see their " -"documentation for details." -msgstr "" - -#: ../../c-api/module.rst:664 +#: ../../c-api/module.rst:484 msgid "" "Add an int constant to *module*. The name and the value are taken from " "*macro*. For example ``PyModule_AddIntMacro(module, AF_INET)`` adds the int " -"constant *AF_INET* with the value of *AF_INET* to *module*. Return ``-1`` " -"with an exception set on error, ``0`` on success." +"constant *AF_INET* with the value of *AF_INET* to *module*. Return ``-1`` on " +"error, ``0`` on success." msgstr "" +"*module* に int 定数を追加します。名前と値は *macro* から取得されます。例え" +"ば、 ``PyModule_AddIntMacro(module, AF_INET)`` とすると、 *AF_INET* という名" +"前の int 型定数を *AF_INET* の値で *module* に追加します。エラー時には " +"``-1`` を、成功時には ``0`` を返します。" -#: ../../c-api/module.rst:672 +#: ../../c-api/module.rst:492 msgid "Add a string constant to *module*." msgstr "文字列定数を *module* に追加します。" -#: ../../c-api/module.rst:676 +#: ../../c-api/module.rst:496 msgid "" "Add a type object to *module*. The type object is finalized by calling " "internally :c:func:`PyType_Ready`. The name of the type object is taken from " "the last component of :c:member:`~PyTypeObject.tp_name` after dot. Return " -"``-1`` with an exception set on error, ``0`` on success." +"``-1`` on error, ``0`` on success." msgstr "" +"型オブジェクトを *module* に追加します。型オブジェクトは内部で :c:func:" +"`PyType_Ready` を呼び出してファイナライズされます。型オブジェクトの名前は、 :" +"c:member:`~PyTypeObject.tp_name` のドットの後の最後の部分から取られます。エ" +"ラー時には ``-1`` を、成功時には ``0`` を返します。" -#: ../../c-api/module.rst:686 -msgid "" -"Indicate that *module* does or does not support running without the global " -"interpreter lock (GIL), using one of the values from :c:macro:`Py_mod_gil`. " -"It must be called during *module*'s initialization function. If this " -"function is not called during module initialization, the import machinery " -"assumes the module does not support running without the GIL. This function " -"is only available in Python builds configured with :option:`--disable-gil`. " -"Return ``-1`` with an exception set on error, ``0`` on success." -msgstr "" - -#: ../../c-api/module.rst:699 +#: ../../c-api/module.rst:506 msgid "Module lookup" msgstr "モジュール検索" -#: ../../c-api/module.rst:701 +#: ../../c-api/module.rst:508 msgid "" "Single-phase initialization creates singleton modules that can be looked up " "in the context of the current interpreter. This allows the module object to " @@ -964,7 +784,7 @@ msgstr "" "これによって、後からモジュール定義への参照だけでモジュールオブジェクトが取得" "できます。" -#: ../../c-api/module.rst:705 +#: ../../c-api/module.rst:512 msgid "" "These functions will not work on modules created using multi-phase " "initialization, since multiple such modules can be created from a single " @@ -973,7 +793,7 @@ msgstr "" "多段階初期化を使うと単一の定義から複数のモジュールが作成できるので、これらの" "関数は多段階初期化を使って作成されたモジュールには使えません。" -#: ../../c-api/module.rst:710 +#: ../../c-api/module.rst:517 msgid "" "Returns the module object that was created from *def* for the current " "interpreter. This method requires that the module object has been attached " @@ -987,7 +807,7 @@ msgstr "" "ジュールオブジェクトが見付からない、もしくは事前にインタプリタの state に連結" "されていない場合は、 ``NULL`` を返します。" -#: ../../c-api/module.rst:717 +#: ../../c-api/module.rst:524 msgid "" "Attaches the module object passed to the function to the interpreter state. " "This allows the module object to be accessible via :c:func:" @@ -997,11 +817,11 @@ msgstr "" "の関数を使うことで :c:func:`PyState_FindModule` からモジュールオブジェクトに" "アクセスできるようになります。" -#: ../../c-api/module.rst:720 +#: ../../c-api/module.rst:527 msgid "Only effective on modules created using single-phase initialization." msgstr "一段階初期化を使って作成されたモジュールにのみ有効です。" -#: ../../c-api/module.rst:722 +#: ../../c-api/module.rst:529 msgid "" "Python calls ``PyState_AddModule`` automatically after importing a module, " "so it is unnecessary (but harmless) to call it from module initialization " @@ -1012,56 +832,18 @@ msgid "" "state updates)." msgstr "" -#: ../../c-api/module.rst:730 ../../c-api/module.rst:741 -msgid "The caller must have an :term:`attached thread state`." -msgstr "" +#: ../../c-api/module.rst:537 ../../c-api/module.rst:548 +msgid "The caller must hold the GIL." +msgstr "呼び出し側はGILを獲得する必要があります" -#: ../../c-api/module.rst:732 -msgid "Return ``-1`` with an exception set on error, ``0`` on success." -msgstr "" +#: ../../c-api/module.rst:539 +msgid "Return 0 on success or -1 on failure." +msgstr "成功したら 0 を、失敗したら -1 を返します。" -#: ../../c-api/module.rst:738 +#: ../../c-api/module.rst:545 msgid "" "Removes the module object created from *def* from the interpreter state. " -"Return ``-1`` with an exception set on error, ``0`` on success." +"Return 0 on success or -1 on failure." msgstr "" - -#: ../../c-api/module.rst:8 -msgid "object" -msgstr "object" - -#: ../../c-api/module.rst:8 -msgid "module" -msgstr "module" - -#: ../../c-api/module.rst:13 -msgid "ModuleType (in module types)" -msgstr "ModuleType (in module types)" - -#: ../../c-api/module.rst:33 ../../c-api/module.rst:77 -msgid "__name__ (module attribute)" -msgstr "__name__ (モジュール属性)" - -#: ../../c-api/module.rst:33 -msgid "__doc__ (module attribute)" -msgstr "__doc__ (モジュール属性)" - -#: ../../c-api/module.rst:33 ../../c-api/module.rst:108 -msgid "__file__ (module attribute)" -msgstr "__file__ (モジュール属性)" - -#: ../../c-api/module.rst:33 -msgid "__package__ (module attribute)" -msgstr "" - -#: ../../c-api/module.rst:33 -msgid "__loader__ (module attribute)" -msgstr "" - -#: ../../c-api/module.rst:63 -msgid "__dict__ (module attribute)" -msgstr "__dict__ (モジュール属性)" - -#: ../../c-api/module.rst:77 ../../c-api/module.rst:108 -msgid "SystemError (built-in exception)" -msgstr "SystemError (組み込み例外)" +"*def* から作られたモジュールオブジェクトをインタプリタ state から削除します。" +"成功したら 0 を、失敗したら -1 を返します。" diff --git a/c-api/monitoring.po b/c-api/monitoring.po deleted file mode 100644 index 1d317eb57..000000000 --- a/c-api/monitoring.po +++ /dev/null @@ -1,308 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation -# This file is distributed under the same license as the Python package. -# FIRST AUTHOR , YEAR. -# -# Translators: -# tomo, 2024 -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: Python 3.14\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2024-05-11 01:07+0000\n" -"Last-Translator: tomo, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" -"ja/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#: ../../c-api/monitoring.rst:6 -msgid "Monitoring C API" -msgstr "" - -#: ../../c-api/monitoring.rst:8 -msgid "Added in version 3.13." -msgstr "" - -#: ../../c-api/monitoring.rst:10 -msgid "" -"An extension may need to interact with the event monitoring system. " -"Subscribing to events and registering callbacks can be done via the Python " -"API exposed in :mod:`sys.monitoring`." -msgstr "" - -#: ../../c-api/monitoring.rst:15 -msgid "Generating Execution Events" -msgstr "" - -#: ../../c-api/monitoring.rst:17 -msgid "" -"The functions below make it possible for an extension to fire monitoring " -"events as it emulates the execution of Python code. Each of these functions " -"accepts a ``PyMonitoringState`` struct which contains concise information " -"about the activation state of events, as well as the event arguments, which " -"include a ``PyObject*`` representing the code object, the instruction offset " -"and sometimes additional, event-specific arguments (see :mod:`sys." -"monitoring` for details about the signatures of the different event " -"callbacks). The ``codelike`` argument should be an instance of :class:`types." -"CodeType` or of a type that emulates it." -msgstr "" - -#: ../../c-api/monitoring.rst:27 -msgid "" -"The VM disables tracing when firing an event, so there is no need for user " -"code to do that." -msgstr "" - -#: ../../c-api/monitoring.rst:30 -msgid "" -"Monitoring functions should not be called with an exception set, except " -"those listed below as working with the current exception." -msgstr "" - -#: ../../c-api/monitoring.rst:35 -msgid "" -"Representation of the state of an event type. It is allocated by the user " -"while its contents are maintained by the monitoring API functions described " -"below." -msgstr "" - -#: ../../c-api/monitoring.rst:39 -msgid "" -"All of the functions below return 0 on success and -1 (with an exception " -"set) on error." -msgstr "" - -#: ../../c-api/monitoring.rst:41 -msgid "See :mod:`sys.monitoring` for descriptions of the events." -msgstr "" - -#: ../../c-api/monitoring.rst:45 -msgid "Fire a ``PY_START`` event." -msgstr "" - -#: ../../c-api/monitoring.rst:50 -msgid "Fire a ``PY_RESUME`` event." -msgstr "" - -#: ../../c-api/monitoring.rst:55 -msgid "Fire a ``PY_RETURN`` event." -msgstr "" - -#: ../../c-api/monitoring.rst:60 -msgid "Fire a ``PY_YIELD`` event." -msgstr "" - -#: ../../c-api/monitoring.rst:65 -msgid "Fire a ``CALL`` event." -msgstr "" - -#: ../../c-api/monitoring.rst:70 -msgid "Fire a ``LINE`` event." -msgstr "" - -#: ../../c-api/monitoring.rst:75 -msgid "Fire a ``JUMP`` event." -msgstr "" - -#: ../../c-api/monitoring.rst:80 -msgid "Fire a ``BRANCH_LEFT`` event." -msgstr "" - -#: ../../c-api/monitoring.rst:85 -msgid "Fire a ``BRANCH_RIGHT`` event." -msgstr "" - -#: ../../c-api/monitoring.rst:90 -msgid "Fire a ``C_RETURN`` event." -msgstr "" - -#: ../../c-api/monitoring.rst:95 -msgid "" -"Fire a ``PY_THROW`` event with the current exception (as returned by :c:func:" -"`PyErr_GetRaisedException`)." -msgstr "" - -#: ../../c-api/monitoring.rst:101 -msgid "" -"Fire a ``RAISE`` event with the current exception (as returned by :c:func:" -"`PyErr_GetRaisedException`)." -msgstr "" - -#: ../../c-api/monitoring.rst:107 -msgid "" -"Fire a ``C_RAISE`` event with the current exception (as returned by :c:func:" -"`PyErr_GetRaisedException`)." -msgstr "" - -#: ../../c-api/monitoring.rst:113 -msgid "" -"Fire a ``RERAISE`` event with the current exception (as returned by :c:func:" -"`PyErr_GetRaisedException`)." -msgstr "" - -#: ../../c-api/monitoring.rst:119 -msgid "" -"Fire an ``EXCEPTION_HANDLED`` event with the current exception (as returned " -"by :c:func:`PyErr_GetRaisedException`)." -msgstr "" - -#: ../../c-api/monitoring.rst:125 -msgid "" -"Fire a ``PY_UNWIND`` event with the current exception (as returned by :c:" -"func:`PyErr_GetRaisedException`)." -msgstr "" - -#: ../../c-api/monitoring.rst:131 -msgid "" -"Fire a ``STOP_ITERATION`` event. If ``value`` is an instance of :exc:" -"`StopIteration`, it is used. Otherwise, a new :exc:`StopIteration` instance " -"is created with ``value`` as its argument." -msgstr "" - -#: ../../c-api/monitoring.rst:136 -msgid "Managing the Monitoring State" -msgstr "" - -#: ../../c-api/monitoring.rst:138 -msgid "" -"Monitoring states can be managed with the help of monitoring scopes. A scope " -"would typically correspond to a python function." -msgstr "" - -#: ../../c-api/monitoring.rst:143 -msgid "" -"Enter a monitored scope. ``event_types`` is an array of the event IDs for " -"events that may be fired from the scope. For example, the ID of a " -"``PY_START`` event is the value ``PY_MONITORING_EVENT_PY_START``, which is " -"numerically equal to the base-2 logarithm of ``sys.monitoring.events." -"PY_START``. ``state_array`` is an array with a monitoring state entry for " -"each event in ``event_types``, it is allocated by the user but populated by :" -"c:func:`!PyMonitoring_EnterScope` with information about the activation " -"state of the event. The size of ``event_types`` (and hence also of " -"``state_array``) is given in ``length``." -msgstr "" - -#: ../../c-api/monitoring.rst:153 -msgid "" -"The ``version`` argument is a pointer to a value which should be allocated " -"by the user together with ``state_array`` and initialized to 0, and then set " -"only by :c:func:`!PyMonitoring_EnterScope` itself. It allows this function " -"to determine whether event states have changed since the previous call, and " -"to return quickly if they have not." -msgstr "" - -#: ../../c-api/monitoring.rst:159 -msgid "" -"The scopes referred to here are lexical scopes: a function, class or " -"method. :c:func:`!PyMonitoring_EnterScope` should be called whenever the " -"lexical scope is entered. Scopes can be reentered, reusing the same " -"*state_array* and *version*, in situations like when emulating a recursive " -"Python function. When a code-like's execution is paused, such as when " -"emulating a generator, the scope needs to be exited and re-entered." -msgstr "" - -#: ../../c-api/monitoring.rst:166 -msgid "The macros for *event_types* are:" -msgstr "" - -#: ../../c-api/monitoring.rst:174 -msgid "Macro" -msgstr "" - -#: ../../c-api/monitoring.rst:174 -msgid "Event" -msgstr "Event" - -#: ../../c-api/monitoring.rst:176 -msgid ":monitoring-event:`BRANCH_LEFT`" -msgstr "" - -#: ../../c-api/monitoring.rst:177 -msgid ":monitoring-event:`BRANCH_RIGHT`" -msgstr "" - -#: ../../c-api/monitoring.rst:178 -msgid ":monitoring-event:`CALL`" -msgstr "" - -#: ../../c-api/monitoring.rst:179 -msgid ":monitoring-event:`C_RAISE`" -msgstr "" - -#: ../../c-api/monitoring.rst:180 -msgid ":monitoring-event:`C_RETURN`" -msgstr "" - -#: ../../c-api/monitoring.rst:181 -msgid ":monitoring-event:`EXCEPTION_HANDLED`" -msgstr "" - -#: ../../c-api/monitoring.rst:182 -msgid ":monitoring-event:`INSTRUCTION`" -msgstr "" - -#: ../../c-api/monitoring.rst:183 -msgid ":monitoring-event:`JUMP`" -msgstr "" - -#: ../../c-api/monitoring.rst:184 -msgid ":monitoring-event:`LINE`" -msgstr "" - -#: ../../c-api/monitoring.rst:185 -msgid ":monitoring-event:`PY_RESUME`" -msgstr "" - -#: ../../c-api/monitoring.rst:186 -msgid ":monitoring-event:`PY_RETURN`" -msgstr "" - -#: ../../c-api/monitoring.rst:187 -msgid ":monitoring-event:`PY_START`" -msgstr "" - -#: ../../c-api/monitoring.rst:188 -msgid ":monitoring-event:`PY_THROW`" -msgstr "" - -#: ../../c-api/monitoring.rst:189 -msgid ":monitoring-event:`PY_UNWIND`" -msgstr "" - -#: ../../c-api/monitoring.rst:190 -msgid ":monitoring-event:`PY_YIELD`" -msgstr "" - -#: ../../c-api/monitoring.rst:191 -msgid ":monitoring-event:`RAISE`" -msgstr "" - -#: ../../c-api/monitoring.rst:192 -msgid ":monitoring-event:`RERAISE`" -msgstr "" - -#: ../../c-api/monitoring.rst:193 -msgid ":monitoring-event:`STOP_ITERATION`" -msgstr "" - -#: ../../c-api/monitoring.rst:198 -msgid "" -"Exit the last scope that was entered with :c:func:`!PyMonitoring_EnterScope`." -msgstr "" - -#: ../../c-api/monitoring.rst:203 -msgid "" -"Return true if the event corresponding to the event ID *ev* is a :ref:`local " -"event `." -msgstr "" - -#: ../../c-api/monitoring.rst:210 -msgid "This function is :term:`soft deprecated`." -msgstr "" diff --git a/c-api/none.po b/c-api/none.po index 54133eab7..16099a886 100644 --- a/c-api/none.po +++ b/c-api/none.po @@ -1,26 +1,26 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2023 -# 石井明久, 2024 +# Osamu NAKAMURA, 2017 +# tomo, 2017 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-13 14:21+0000\n" -"PO-Revision-Date: 2021-06-28 00:49+0000\n" -"Last-Translator: 石井明久, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 17:37+0000\n" +"Last-Translator: tomo, 2017\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/none.rst:6 @@ -31,34 +31,28 @@ msgstr "``None`` オブジェクト" msgid "" "Note that the :c:type:`PyTypeObject` for ``None`` is not directly exposed in " "the Python/C API. Since ``None`` is a singleton, testing for object " -"identity (using ``==`` in C) is sufficient. There is no :c:func:`!" -"PyNone_Check` function for the same reason." +"identity (using ``==`` in C) is sufficient. There is no :c:func:" +"`PyNone_Check` function for the same reason." msgstr "" "``None`` に対する :c:type:`PyTypeObject` は、 Python/C API では直接公開されて" "いないので注意してください。 ``None`` は単量子 (singleton) なので、オブジェク" "トの同一性テスト (C では ``==``) を使うだけで十分だからです。同じ理由から、 :" -"c:func:`!PyNone_Check` 関数はありません。" +"c:func:`PyNone_Check` 関数はありません。" #: ../../c-api/none.rst:18 msgid "" "The Python ``None`` object, denoting lack of value. This object has no " -"methods and is :term:`immortal`." +"methods. It needs to be treated just like any other object with respect to " +"reference counts." msgstr "" -"値の欠如を示す、 Python の ``None`` オブジェクト。このオブジェクトはメソッド" -"を持たず、 :term:`immortal` です。" - -#: ../../c-api/none.rst:21 -msgid ":c:data:`Py_None` is :term:`immortal`." -msgstr ":c:data:`Py_None` は :term:`immortal` です。" - -#: ../../c-api/none.rst:26 -msgid "Return :c:data:`Py_None` from a function." -msgstr "関数から :c:data:`Py_None` を返します。" +"Python における ``None`` オブジェクトで、値がないことを表します。このオブジェ" +"クトにはメソッドがありません。参照カウントについては、このオブジェクトも他の" +"オブジェクトと同様に扱う必要があります。" -#: ../../c-api/none.rst:8 -msgid "object" -msgstr "オブジェクト" - -#: ../../c-api/none.rst:8 -msgid "None" -msgstr "None" +#: ../../c-api/none.rst:25 +msgid "" +"Properly handle returning :c:data:`Py_None` from within a C function (that " +"is, increment the reference count of ``None`` and return it.)" +msgstr "" +"C 関数からの :c:data:`Py_None` の返却を適切に扱います。\n" +"(これは ``None`` の参照カウントをインクリメントして返します。)" diff --git a/c-api/number.po b/c-api/number.po index 9766f8204..8150ac0b6 100644 --- a/c-api/number.po +++ b/c-api/number.po @@ -1,27 +1,27 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Nozomu Kaneko , 2024 -# Arihiro TAKASE, 2024 -# tomo, 2024 +# Arihiro TAKASE, 2017 +# tomo, 2020 +# Tetsuo Koyama , 2020 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-13 14:21+0000\n" -"PO-Revision-Date: 2021-06-28 00:49+0000\n" -"Last-Translator: tomo, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 17:37+0000\n" +"Last-Translator: Tetsuo Koyama , 2020\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/number.rst:6 @@ -76,18 +76,24 @@ msgstr "" #: ../../c-api/number.rst:46 msgid "" "Return the floor of *o1* divided by *o2*, or ``NULL`` on failure. This is " -"the equivalent of the Python expression ``o1 // o2``." +"equivalent to the \"classic\" division of integers." msgstr "" +"成功すると *o1* を *o2* で除算した切捨て値を返し、失敗すると ``NULL`` を返し" +"ます。\"旧仕様の\" 整数間での除算と同じです。" #: ../../c-api/number.rst:52 msgid "" "Return a reasonable approximation for the mathematical value of *o1* divided " "by *o2*, or ``NULL`` on failure. The return value is \"approximate\" " -"because binary floating-point numbers are approximate; it is not possible to " -"represent all real numbers in base two. This function can return a floating-" -"point value when passed two integers. This is the equivalent of the Python " -"expression ``o1 / o2``." +"because binary floating point numbers are approximate; it is not possible to " +"represent all real numbers in base two. This function can return a floating " +"point value when passed two integers." msgstr "" +"成功すると、数学的な *o1* の *o2* による除算値に対する妥当な近似 (reasonable " +"approximation) を返し、失敗すると ``NULL`` を返します。全ての実数を 2 を基数" +"として表現するのは不可能なため、二進の浮動小数点数は \"近似値\" しか表現でき" +"ません。このため、戻り値も近似になります。この関数に二つの整数を渡した際、浮" +"動小数点の値を返すことがあります。" #: ../../c-api/number.rst:61 msgid "" @@ -245,14 +251,19 @@ msgstr "" msgid "" "Return a reasonable approximation for the mathematical value of *o1* divided " "by *o2*, or ``NULL`` on failure. The return value is \"approximate\" " -"because binary floating-point numbers are approximate; it is not possible to " -"represent all real numbers in base two. This function can return a floating-" +"because binary floating point numbers are approximate; it is not possible to " +"represent all real numbers in base two. This function can return a floating " "point value when passed two integers. The operation is done *in-place* when " -"*o1* supports it. This is the equivalent of the Python statement ``o1 /= " -"o2``." +"*o1* supports it." msgstr "" +"成功すると、数学的な *o1* の *o2* による除算値に対する妥当な近似 (reasonable " +"approximation) を返し、失敗すると ``NULL`` を返します。全ての実数を 2 を基数" +"として表現するのは不可能なため、二進の浮動小数点数は \"近似値\" しか表現でき" +"ません。このため、戻り値も近似になります。この関数に二つの整数を渡した際、浮" +"動小数点の値を返すことがあります。*o1* が *in-place* 演算をサポートする場合、" +"in-place 演算を行います。" -#: ../../c-api/number.rst:188 +#: ../../c-api/number.rst:187 msgid "" "Returns the remainder of dividing *o1* by *o2*, or ``NULL`` on failure. The " "operation is done *in-place* when *o1* supports it. This is the equivalent " @@ -262,7 +273,7 @@ msgstr "" "す。*o1* が *in-place* 演算をサポートする場合、in-place 演算を行います。" "Python の文 ``o1 %= o2`` と同じです。" -#: ../../c-api/number.rst:197 +#: ../../c-api/number.rst:196 msgid "" "See the built-in function :func:`pow`. Returns ``NULL`` on failure. The " "operation is done *in-place* when *o1* supports it. This is the equivalent " @@ -278,7 +289,7 @@ msgstr "" "なら、 :c:data:`Py_None` を入れてください (*o3* に ``NULL`` を渡すと、不正な" "メモリアクセスを引き起こすことがあります)。" -#: ../../c-api/number.rst:206 +#: ../../c-api/number.rst:205 msgid "" "Returns the result of left shifting *o1* by *o2* on success, or ``NULL`` on " "failure. The operation is done *in-place* when *o1* supports it. This is " @@ -288,7 +299,7 @@ msgstr "" "します。*o1* が *in-place* 演算をサポートする場合、in-place 演算を行います。" "Python の文 ``o1 <<= o2`` と同じです。" -#: ../../c-api/number.rst:213 +#: ../../c-api/number.rst:212 msgid "" "Returns the result of right shifting *o1* by *o2* on success, or ``NULL`` on " "failure. The operation is done *in-place* when *o1* supports it. This is " @@ -298,7 +309,7 @@ msgstr "" "します。*o1* が *in-place* 演算をサポートする場合、in-place 演算を行います。" "Python の文 ``o1 >>= o2`` と同じです。" -#: ../../c-api/number.rst:220 +#: ../../c-api/number.rst:219 msgid "" "Returns the \"bitwise and\" of *o1* and *o2* on success and ``NULL`` on " "failure. The operation is done *in-place* when *o1* supports it. This is " @@ -308,7 +319,7 @@ msgstr "" "ると ``NULL`` を返します。*o1* が *in-place* 演算をサポートする場合、in-" "place 演算を行います。Python の文 ``o1 &= o2`` と同じです。" -#: ../../c-api/number.rst:227 +#: ../../c-api/number.rst:226 msgid "" "Returns the \"bitwise exclusive or\" of *o1* by *o2* on success, or ``NULL`` " "on failure. The operation is done *in-place* when *o1* supports it. This " @@ -318,7 +329,7 @@ msgstr "" "or)\" を返し、失敗すると ``NULL`` を返します。*o1* が *in-place* 演算をサポー" "トする場合、in-place 演算を行います。Python の文 ``o1 ^= o2`` と同じです。" -#: ../../c-api/number.rst:234 +#: ../../c-api/number.rst:233 msgid "" "Returns the \"bitwise or\" of *o1* and *o2* on success, or ``NULL`` on " "failure. The operation is done *in-place* when *o1* supports it. This is " @@ -328,7 +339,7 @@ msgstr "" "と ``NULL`` を返します。*o1* が *in-place* 演算をサポートする場合、in-place " "演算を行います。Python の文 ``o1 |= o2`` と同じです。" -#: ../../c-api/number.rst:243 +#: ../../c-api/number.rst:242 msgid "" "Returns the *o* converted to an integer object on success, or ``NULL`` on " "failure. This is the equivalent of the Python expression ``int(o)``." @@ -336,7 +347,7 @@ msgstr "" "成功すると *o* を整数に変換したものを返し、失敗すると ``NULL`` を返します。" "Python の式 ``int(o)`` と同じです。" -#: ../../c-api/number.rst:251 +#: ../../c-api/number.rst:250 msgid "" "Returns the *o* converted to a float object on success, or ``NULL`` on " "failure. This is the equivalent of the Python expression ``float(o)``." @@ -344,7 +355,7 @@ msgstr "" "成功すると *o* を浮動小数点数に変換したものを返し、失敗すると ``NULL`` を返し" "ます。Python の式 ``float(o)`` と同じです。" -#: ../../c-api/number.rst:257 +#: ../../c-api/number.rst:256 msgid "" "Returns the *o* converted to a Python int on success or ``NULL`` with a :exc:" "`TypeError` exception raised on failure." @@ -352,15 +363,7 @@ msgstr "" "*o* をPythonのint型に変換し、成功したらその値を返します。失敗したら ``NULL`` " "が返され、 :exc:`TypeError` 例外が送出されます。" -#: ../../c-api/number.rst:260 -msgid "" -"The result always has exact type :class:`int`. Previously, the result could " -"have been an instance of a subclass of ``int``." -msgstr "" -"結果は常に厳密な :class:`int` 型です。\n" -"以前は、結果は ``int`` のサブクラスのインスタンスのこともありました。" - -#: ../../c-api/number.rst:267 +#: ../../c-api/number.rst:262 msgid "" "Returns the integer *n* converted to base *base* as a string. The *base* " "argument must be one of 2, 8, 10, or 16. For base 2, 8, or 16, the returned " @@ -374,63 +377,35 @@ msgstr "" "付与されます。 もし *n* が Python のint型でなければ、まず :c:func:" "`PyNumber_Index` で変換されます。" -#: ../../c-api/number.rst:276 +#: ../../c-api/number.rst:271 msgid "" -"Returns *o* converted to a :c:type:`Py_ssize_t` value if *o* can be " -"interpreted as an integer. If the call fails, an exception is raised and " -"``-1`` is returned." +"Returns *o* converted to a Py_ssize_t value if *o* can be interpreted as an " +"integer. If the call fails, an exception is raised and ``-1`` is returned." msgstr "" -"*o* を整数として解釈可能だった場合、:c:type:`Py_ssize_t` 型の値に変換して返し" -"ます。呼び出しが失敗したら、例外が送出され、 ``-1`` が返されます。" +"*o* を整数として解釈可能だった場合、Py_ssize_t型の値に変換して返します。呼び" +"出しが失敗したら、例外が送出され、 ``-1`` が返されます。" -#: ../../c-api/number.rst:279 +#: ../../c-api/number.rst:274 msgid "" -"If *o* can be converted to a Python int but the attempt to convert to a :c:" -"type:`Py_ssize_t` value would raise an :exc:`OverflowError`, then the *exc* " +"If *o* can be converted to a Python int but the attempt to convert to a " +"Py_ssize_t value would raise an :exc:`OverflowError`, then the *exc* " "argument is the type of exception that will be raised (usually :exc:" "`IndexError` or :exc:`OverflowError`). If *exc* is ``NULL``, then the " "exception is cleared and the value is clipped to ``PY_SSIZE_T_MIN`` for a " "negative integer or ``PY_SSIZE_T_MAX`` for a positive integer." msgstr "" -"もし *o* がPythonのintに変換できたのに、:c:type:`Py_ssize_t` への変換が :exc:" +"もし *o* がPythonのintに変換できたのに、Py_ssize_tへの変換が :exc:" "`OverflowError` になる場合は、 *exc* 引数で渡された型 (普通は :exc:" "`IndexError` か :exc:`OverflowError`) の例外を送出します。もし、 *exc* が " "``NULL`` なら、例外はクリアされて、値が負の場合は ``PY_SSIZE_T_MIN`` へ、正の" "場合は ``PY_SSIZE_T_MAX`` へと制限されます。" -#: ../../c-api/number.rst:289 +#: ../../c-api/number.rst:284 msgid "" -"Returns ``1`` if *o* is an index integer (has the ``nb_index`` slot of the " -"``tp_as_number`` structure filled in), and ``0`` otherwise. This function " -"always succeeds." +"Returns ``1`` if *o* is an index integer (has the nb_index slot of the " +"tp_as_number structure filled in), and ``0`` otherwise. This function always " +"succeeds." msgstr "" -"*o* がインデックス整数である場合 (``tp_as_number`` 構造体の ``nb_index`` ス" -"ロットが埋まっている場合) に ``1`` を返し、そうでない場合に ``0`` を返しま" -"す。\n" +"*o* がインデックス整数である場合 (tp_as_number構造体のnb_indexスロットが埋" +"まっている場合) に ``1`` を返し、そうでない場合に ``0`` を返します。\n" "この関数は常に成功します。" - -#: ../../c-api/number.rst:67 ../../c-api/number.rst:75 -#: ../../c-api/number.rst:97 ../../c-api/number.rst:195 -#: ../../c-api/number.rst:241 ../../c-api/number.rst:249 -msgid "built-in function" -msgstr "組み込み関数" - -#: ../../c-api/number.rst:67 -msgid "divmod" -msgstr "divmod" - -#: ../../c-api/number.rst:75 ../../c-api/number.rst:195 -msgid "pow" -msgstr "pow" - -#: ../../c-api/number.rst:97 -msgid "abs" -msgstr "abs" - -#: ../../c-api/number.rst:241 -msgid "int" -msgstr "int" - -#: ../../c-api/number.rst:249 -msgid "float" -msgstr "浮動小数点数" diff --git a/c-api/objbuffer.po b/c-api/objbuffer.po index f24e8a3c8..de6bdb2d0 100644 --- a/c-api/objbuffer.po +++ b/c-api/objbuffer.po @@ -1,21 +1,22 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2024, Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 -# mollinaca, 2021 +# Arihiro TAKASE, 2017 +# tomo, 2019 +# mollinaca, 2020 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.12\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-04 01:27+0000\n" -"PO-Revision-Date: 2021-07-29 13:25+0000\n" -"Last-Translator: mollinaca, 2021\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 17:38+0000\n" +"Last-Translator: mollinaca, 2020\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" "Language: ja\n" "MIME-Version: 1.0\n" diff --git a/c-api/object.po b/c-api/object.po index 8565c5549..78cb85881 100644 --- a/c-api/object.po +++ b/c-api/object.po @@ -1,29 +1,28 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Rafael Fontenelle , 2024 -# Arihiro TAKASE, 2024 -# Osamu NAKAMURA, 2024 -# Nozomu Kaneko , 2024 -# tomo, 2024 +# Osamu NAKAMURA, 2017 +# Arihiro TAKASE, 2017 +# Nozomu Kaneko , 2017 +# tomo, 2020 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:49+0000\n" -"Last-Translator: tomo, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-06-20 06:40+0000\n" +"PO-Revision-Date: 2017-02-16 17:38+0000\n" +"Last-Translator: tomo, 2020\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/object.rst:6 @@ -31,129 +30,6 @@ msgid "Object Protocol" msgstr "オブジェクトプロトコル (object protocol)" #: ../../c-api/object.rst:11 -msgid "Get a :term:`strong reference` to a constant." -msgstr "" - -#: ../../c-api/object.rst:13 -msgid "Set an exception and return ``NULL`` if *constant_id* is invalid." -msgstr "" - -#: ../../c-api/object.rst:15 -msgid "*constant_id* must be one of these constant identifiers:" -msgstr "" - -#: ../../c-api/object.rst:20 -msgid "Constant Identifier" -msgstr "" - -#: ../../c-api/object.rst:20 -msgid "Value" -msgstr "値" - -#: ../../c-api/object.rst:20 -msgid "Returned object" -msgstr "" - -#: ../../c-api/object.rst:22 ../../c-api/object.rst:27 -msgid "``0``" -msgstr "``0``" - -#: ../../c-api/object.rst:22 -msgid ":py:data:`None`" -msgstr "" - -#: ../../c-api/object.rst:23 ../../c-api/object.rst:28 -msgid "``1``" -msgstr "``1``" - -#: ../../c-api/object.rst:23 -msgid ":py:data:`False`" -msgstr "" - -#: ../../c-api/object.rst:24 -msgid "``2``" -msgstr "``2``" - -#: ../../c-api/object.rst:24 -msgid ":py:data:`True`" -msgstr "" - -#: ../../c-api/object.rst:25 -msgid "``3``" -msgstr "``3``" - -#: ../../c-api/object.rst:25 -msgid ":py:data:`Ellipsis`" -msgstr "" - -#: ../../c-api/object.rst:26 -msgid "``4``" -msgstr "``4``" - -#: ../../c-api/object.rst:26 -msgid ":py:data:`NotImplemented`" -msgstr "" - -#: ../../c-api/object.rst:27 -msgid "``5``" -msgstr "``5``" - -#: ../../c-api/object.rst:28 -msgid "``6``" -msgstr "``6``" - -#: ../../c-api/object.rst:29 -msgid "``7``" -msgstr "``7``" - -#: ../../c-api/object.rst:29 -msgid "``''``" -msgstr "" - -#: ../../c-api/object.rst:30 -msgid "``8``" -msgstr "``8``" - -#: ../../c-api/object.rst:30 -msgid "``b''``" -msgstr "" - -#: ../../c-api/object.rst:31 -msgid "``9``" -msgstr "``9``" - -#: ../../c-api/object.rst:31 -msgid "``()``" -msgstr "" - -#: ../../c-api/object.rst:34 -msgid "" -"Numeric values are only given for projects which cannot use the constant " -"identifiers." -msgstr "" - -#: ../../c-api/object.rst:42 -msgid "In CPython, all of these constants are :term:`immortal`." -msgstr "" - -#: ../../c-api/object.rst:47 -msgid "" -"Similar to :c:func:`Py_GetConstant`, but return a :term:`borrowed reference`." -msgstr "" - -#: ../../c-api/object.rst:50 -msgid "" -"This function is primarily intended for backwards compatibility: using :c:" -"func:`Py_GetConstant` is recommended for new code." -msgstr "" - -#: ../../c-api/object.rst:53 -msgid "" -"The reference is borrowed from the interpreter, and is valid until the " -"interpreter finalization." -msgstr "" - -#: ../../c-api/object.rst:61 msgid "" "The ``NotImplemented`` singleton, used to signal that an operation is not " "implemented for the given type combination." @@ -161,74 +37,63 @@ msgstr "" "与えられたオブジェクトとメソッドの引数の型の組み合わせの処理が未実装である印" "として使われる、 ``未実装 (NotImplemented)`` シングルトン。" -#: ../../c-api/object.rst:67 +#: ../../c-api/object.rst:17 msgid "" "Properly handle returning :c:data:`Py_NotImplemented` from within a C " -"function (that is, create a new :term:`strong reference` to :const:" -"`NotImplemented` and return it)." +"function (that is, increment the reference count of NotImplemented and " +"return it)." msgstr "" +"C 関数から :c:data:`Py_NotImplemented` を返す処理を適切に行います (すなわ" +"ち、 NotImplemented シングルトンの参照カウントを増やし、返却します) 。" -#: ../../c-api/object.rst:74 -msgid "" -"Flag to be used with multiple functions that print the object (like :c:func:" -"`PyObject_Print` and :c:func:`PyFile_WriteObject`). If passed, these " -"function would use the :func:`str` of the object instead of the :func:`repr`." -msgstr "" - -#: ../../c-api/object.rst:82 +#: ../../c-api/object.rst:24 msgid "" "Print an object *o*, on file *fp*. Returns ``-1`` on error. The flags " "argument is used to enable certain printing options. The only option " -"currently supported is :c:macro:`Py_PRINT_RAW`; if given, the :func:`str` of " +"currently supported is :const:`Py_PRINT_RAW`; if given, the :func:`str` of " "the object is written instead of the :func:`repr`." msgstr "" +"オブジェクト *o* をファイル *fp* に出力します。失敗すると ``-1`` を返しま" +"す。 *flags* 引数は何らかの出力オプションを有効にする際に使います。現在サポー" +"トされている唯一のオプションは :const:`Py_PRINT_RAW` です; このオプションを指" +"定すると、 :func:`repr` の代わりに :func:`str` を使ってオブジェクトを書き込み" +"ます。" -#: ../../c-api/object.rst:90 -msgid "" -"Returns ``1`` if *o* has the attribute *attr_name*, and ``0`` otherwise. " -"This is equivalent to the Python expression ``hasattr(o, attr_name)``. On " -"failure, return ``-1``." -msgstr "" - -#: ../../c-api/object.rst:99 +#: ../../c-api/object.rst:32 ../../c-api/object.rst:43 msgid "" -"This is the same as :c:func:`PyObject_HasAttrWithError`, but *attr_name* is " -"specified as a :c:expr:`const char*` UTF-8 encoded bytes string, rather than " -"a :c:expr:`PyObject*`." +"Returns ``1`` if *o* has the attribute *attr_name*, and ``0`` otherwise. " +"This is equivalent to the Python expression ``hasattr(o, attr_name)``. This " +"function always succeeds." msgstr "" +"*o* が属性 *attr_name* を持つときに ``1`` を、それ以外のときに ``0`` を返しま" +"す。この関数は Python の式 ``hasattr(o, attr_name)`` と同じです。この関数は常" +"に成功します。" -#: ../../c-api/object.rst:108 +#: ../../c-api/object.rst:36 msgid "" -"Returns ``1`` if *o* has the attribute *attr_name*, and ``0`` otherwise. " -"This function always succeeds." +"Note that exceptions which occur while calling :meth:`__getattr__` and :meth:" +"`__getattribute__` methods will get suppressed. To get error reporting use :" +"c:func:`PyObject_GetAttr()` instead." msgstr "" +":meth:`__getattr__` メソッドや :meth:`__getattribute__` メソッドの呼び出し中" +"に起こる例外は抑制されることに注意してください。\n" +"エラーを報告させるには、代わりに :c:func:`PyObject_GetAttr()` を使ってくださ" +"い。" -#: ../../c-api/object.rst:113 -msgid "" -"Exceptions that occur when this calls :meth:`~object.__getattr__` and :meth:" -"`~object.__getattribute__` methods aren't propagated, but instead given to :" -"func:`sys.unraisablehook`. For proper error handling, use :c:func:" -"`PyObject_HasAttrWithError`, :c:func:`PyObject_GetOptionalAttr` or :c:func:" -"`PyObject_GetAttr` instead." -msgstr "" - -#: ../../c-api/object.rst:122 -msgid "" -"This is the same as :c:func:`PyObject_HasAttr`, but *attr_name* is specified " -"as a :c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:" -"`PyObject*`." -msgstr "" - -#: ../../c-api/object.rst:128 +#: ../../c-api/object.rst:47 msgid "" -"Exceptions that occur when this calls :meth:`~object.__getattr__` and :meth:" -"`~object.__getattribute__` methods or while creating the temporary :class:" -"`str` object are silently ignored. For proper error handling, use :c:func:" -"`PyObject_HasAttrStringWithError`, :c:func:`PyObject_GetOptionalAttrString` " -"or :c:func:`PyObject_GetAttrString` instead." +"Note that exceptions which occur while calling :meth:`__getattr__` and :meth:" +"`__getattribute__` methods and creating a temporary string object will get " +"suppressed. To get error reporting use :c:func:`PyObject_GetAttrString()` " +"instead." msgstr "" +":meth:`__getattr__` メソッドや :meth:`__getattribute__` メソッドの呼び出し中" +"や、一時的な文字列オブジェクトの作成中に起こる例外は抑制されることに注意して" +"ください。\n" +"エラーを報告させるには、代わりに :c:func:`PyObject_GetAttrString()` を使って" +"ください。" -#: ../../c-api/object.rst:138 +#: ../../c-api/object.rst:55 msgid "" "Retrieve an attribute named *attr_name* from object *o*. Returns the " "attribute value on success, or ``NULL`` on failure. This is the equivalent " @@ -238,48 +103,17 @@ msgstr "" "を返し失敗すると ``NULL`` を返します。この関数は Python の式 ``o.attr_name`` " "と同じです。" -#: ../../c-api/object.rst:142 -msgid "" -"If the missing attribute should not be treated as a failure, you can use :c:" -"func:`PyObject_GetOptionalAttr` instead." -msgstr "" - -#: ../../c-api/object.rst:148 -msgid "" -"This is the same as :c:func:`PyObject_GetAttr`, but *attr_name* is specified " -"as a :c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:" -"`PyObject*`." -msgstr "" - -#: ../../c-api/object.rst:152 -msgid "" -"If the missing attribute should not be treated as a failure, you can use :c:" -"func:`PyObject_GetOptionalAttrString` instead." -msgstr "" - -#: ../../c-api/object.rst:158 +#: ../../c-api/object.rst:62 msgid "" -"Variant of :c:func:`PyObject_GetAttr` which doesn't raise :exc:" -"`AttributeError` if the attribute is not found." -msgstr "" - -#: ../../c-api/object.rst:161 -msgid "" -"If the attribute is found, return ``1`` and set *\\*result* to a new :term:" -"`strong reference` to the attribute. If the attribute is not found, return " -"``0`` and set *\\*result* to ``NULL``; the :exc:`AttributeError` is " -"silenced. If an error other than :exc:`AttributeError` is raised, return " -"``-1`` and set *\\*result* to ``NULL``." -msgstr "" - -#: ../../c-api/object.rst:173 -msgid "" -"This is the same as :c:func:`PyObject_GetOptionalAttr`, but *attr_name* is " -"specified as a :c:expr:`const char*` UTF-8 encoded bytes string, rather than " -"a :c:expr:`PyObject*`." +"Retrieve an attribute named *attr_name* from object *o*. Returns the " +"attribute value on success, or ``NULL`` on failure. This is the equivalent " +"of the Python expression ``o.attr_name``." msgstr "" +"オブジェクト *o* から、名前 *attr_name* の属性を取得します。成功すると属性値" +"を返し失敗すると ``NULL`` を返します。この関数は Python の式 ``o.attr_name`` " +"と同じです。" -#: ../../c-api/object.rst:181 +#: ../../c-api/object.rst:69 msgid "" "Generic attribute getter function that is meant to be put into a type " "object's ``tp_getattro`` slot. It looks for a descriptor in the dictionary " @@ -295,7 +129,7 @@ msgstr "" "はインスタンスの属性より優先され、非データデスクリプタは後回しにされます。見" "付からなかった場合は :exc:`AttributeError` を送出します。" -#: ../../c-api/object.rst:191 +#: ../../c-api/object.rst:79 ../../c-api/object.rst:90 msgid "" "Set the value of the attribute named *attr_name*, for object *o*, to the " "value *v*. Raise an exception and return ``-1`` on failure; return ``0`` on " @@ -305,42 +139,23 @@ msgstr "" "失敗すると例外を送出し ``-1`` を返します; 成功すると ``0`` を返します。\n" "この関数は Python の式 ``o.attr_name = v`` と同じです。" -#: ../../c-api/object.rst:196 -msgid "" -"If *v* is ``NULL``, the attribute is deleted. This behaviour is deprecated " -"in favour of using :c:func:`PyObject_DelAttr`, but there are currently no " -"plans to remove it." -msgstr "" -"*v* が ``NULL`` のとき、アトリビュートは削除されます。この動作は :c:func:" -"`PyObject_DelAttr` のため、非推奨となっていますが、削除される予定はありませ" -"ん。" - -#: ../../c-api/object.rst:203 +#: ../../c-api/object.rst:84 msgid "" -"This is the same as :c:func:`PyObject_SetAttr`, but *attr_name* is specified " -"as a :c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:" -"`PyObject*`." +"If *v* is ``NULL``, the attribute is deleted, however this feature is " +"deprecated in favour of using :c:func:`PyObject_DelAttr`." msgstr "" +"*v* が ``NULL`` の場合は属性が削除されますが、この機能は非推奨であり :c:func:" +"`PyObject_DelAttr` を使うのが望ましいです。" -#: ../../c-api/object.rst:207 +#: ../../c-api/object.rst:95 msgid "" -"If *v* is ``NULL``, the attribute is deleted, but this feature is deprecated " -"in favour of using :c:func:`PyObject_DelAttrString`." +"If *v* is ``NULL``, the attribute is deleted, however this feature is " +"deprecated in favour of using :c:func:`PyObject_DelAttrString`." msgstr "" "*v* が ``NULL`` の場合は属性が削除されますが、この機能は非推奨であり :c:func:" "`PyObject_DelAttrString` を使うのが望ましいです。" -#: ../../c-api/object.rst:210 -msgid "" -"The number of different attribute names passed to this function should be " -"kept small, usually by using a statically allocated string as *attr_name*. " -"For attribute names that aren't known at compile time, prefer calling :c:" -"func:`PyUnicode_FromString` and :c:func:`PyObject_SetAttr` directly. For " -"more details, see :c:func:`PyUnicode_InternFromString`, which may be used " -"internally to create a key object." -msgstr "" - -#: ../../c-api/object.rst:220 +#: ../../c-api/object.rst:101 msgid "" "Generic attribute setter and deleter function that is meant to be put into a " "type object's :c:member:`~PyTypeObject.tp_setattro` slot. It looks for a " @@ -360,7 +175,7 @@ msgstr "" "成功すると ``0`` が返され、そうでない場合は :exc:`AttributeError` が送出され " "``-1`` が返されます。" -#: ../../c-api/object.rst:232 +#: ../../c-api/object.rst:113 ../../c-api/object.rst:119 msgid "" "Delete attribute named *attr_name*, for object *o*. Returns ``-1`` on " "failure. This is the equivalent of the Python statement ``del o.attr_name``." @@ -368,24 +183,7 @@ msgstr "" "オブジェクト *o* の *attr_name* という名の属性を削除します。失敗すると " "``-1`` を返します。この関数は Python の文 ``del o.attr_name`` と同じです。" -#: ../../c-api/object.rst:238 -msgid "" -"This is the same as :c:func:`PyObject_DelAttr`, but *attr_name* is specified " -"as a :c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:" -"`PyObject*`." -msgstr "" - -#: ../../c-api/object.rst:242 -msgid "" -"The number of different attribute names passed to this function should be " -"kept small, usually by using a statically allocated string as *attr_name*. " -"For attribute names that aren't known at compile time, prefer calling :c:" -"func:`PyUnicode_FromString` and :c:func:`PyObject_DelAttr` directly. For " -"more details, see :c:func:`PyUnicode_InternFromString`, which may be used " -"internally to create a key object for lookup." -msgstr "" - -#: ../../c-api/object.rst:253 +#: ../../c-api/object.rst:125 msgid "" "A generic implementation for the getter of a ``__dict__`` descriptor. It " "creates the dictionary if necessary." @@ -393,20 +191,7 @@ msgstr "" "``__dict__`` デスクリプタの getter の総称的な実装です。必要な場合は、辞書を作" "成します。" -#: ../../c-api/object.rst:256 -msgid "" -"This function may also be called to get the :py:attr:`~object.__dict__` of " -"the object *o*. Pass ``NULL`` for *context* when calling it. Since this " -"function may need to allocate memory for the dictionary, it may be more " -"efficient to call :c:func:`PyObject_GetAttr` when accessing an attribute on " -"the object." -msgstr "" - -#: ../../c-api/object.rst:262 -msgid "On failure, returns ``NULL`` with an exception set." -msgstr "" - -#: ../../c-api/object.rst:269 +#: ../../c-api/object.rst:133 msgid "" "A generic implementation for the setter of a ``__dict__`` descriptor. This " "implementation does not allow the dictionary to be deleted." @@ -414,57 +199,50 @@ msgstr "" "``__dict__`` デスクリプタの setter の総称的な実装です。この実装では辞書を削除" "することは許されていません。" -#: ../../c-api/object.rst:277 -msgid "" -"Return a pointer to :py:attr:`~object.__dict__` of the object *obj*. If " -"there is no ``__dict__``, return ``NULL`` without setting an exception." -msgstr "" - -#: ../../c-api/object.rst:280 -msgid "" -"This function may need to allocate memory for the dictionary, so it may be " -"more efficient to call :c:func:`PyObject_GetAttr` when accessing an " -"attribute on the object." -msgstr "" - -#: ../../c-api/object.rst:287 +#: ../../c-api/object.rst:141 msgid "" "Compare the values of *o1* and *o2* using the operation specified by *opid*, " -"which must be one of :c:macro:`Py_LT`, :c:macro:`Py_LE`, :c:macro:`Py_EQ`, :" -"c:macro:`Py_NE`, :c:macro:`Py_GT`, or :c:macro:`Py_GE`, corresponding to " -"``<``, ``<=``, ``==``, ``!=``, ``>``, or ``>=`` respectively. This is the " -"equivalent of the Python expression ``o1 op o2``, where ``op`` is the " -"operator corresponding to *opid*. Returns the value of the comparison on " -"success, or ``NULL`` on failure." +"which must be one of :const:`Py_LT`, :const:`Py_LE`, :const:`Py_EQ`, :const:" +"`Py_NE`, :const:`Py_GT`, or :const:`Py_GE`, corresponding to ``<``, ``<=``, " +"``==``, ``!=``, ``>``, or ``>=`` respectively. This is the equivalent of the " +"Python expression ``o1 op o2``, where ``op`` is the operator corresponding " +"to *opid*. Returns the value of the comparison on success, or ``NULL`` on " +"failure." msgstr "" +"*o1* と *o2* を *opid* に指定した演算によって比較します。 *opid* は :const:" +"`Py_LT`, :const:`Py_LE`, :const:`Py_EQ`, :const:`Py_NE`, :const:`Py_GT`, また" +"は :const:`Py_GE`, のいずれかでなければならず、それぞれ ``<``, ``<=``, " +"``==``, ``!=``, ``>``, および ``>=`` に対応します。この関数は Python の式 " +"``o1 op o2`` と同じで、 ``op`` が *opid* に対応する演算子です。成功すると比較" +"結果の値を返し失敗すると ``NULL`` を返します。" -#: ../../c-api/object.rst:297 +#: ../../c-api/object.rst:151 msgid "" "Compare the values of *o1* and *o2* using the operation specified by *opid*, " -"like :c:func:`PyObject_RichCompare`, but returns ``-1`` on error, ``0`` if " -"the result is false, ``1`` otherwise." -msgstr "" - -#: ../../c-api/object.rst:302 +"which must be one of :const:`Py_LT`, :const:`Py_LE`, :const:`Py_EQ`, :const:" +"`Py_NE`, :const:`Py_GT`, or :const:`Py_GE`, corresponding to ``<``, ``<=``, " +"``==``, ``!=``, ``>``, or ``>=`` respectively. Returns ``-1`` on error, " +"``0`` if the result is false, ``1`` otherwise. This is the equivalent of the " +"Python expression ``o1 op o2``, where ``op`` is the operator corresponding " +"to *opid*." +msgstr "" +"*o1* と *o2* を *opid* に指定した演算によって比較します。 *opid* は :const:" +"`Py_LT`, :const:`Py_LE`, :const:`Py_EQ`, :const:`Py_NE`, :const:`Py_GT`, また" +"は :const:`Py_GE`, のいずれかでなければならず、それぞれ ``<``, ``<=``, " +"``==``, ``!=``, ``>``, および ``>=`` に対応します。比較結果が真ならば ``1`` " +"を、偽ならば ``0`` を、エラーが発生すると ``-1`` を返します。この関数は " +"Python の式 ``o1 op o2`` と同じで、 ``op`` が *opid* に対応する演算子です。" + +#: ../../c-api/object.rst:160 msgid "" "If *o1* and *o2* are the same object, :c:func:`PyObject_RichCompareBool` " -"will always return ``1`` for :c:macro:`Py_EQ` and ``0`` for :c:macro:`Py_NE`." -msgstr "" - -#: ../../c-api/object.rst:307 -msgid "" -"Format *obj* using *format_spec*. This is equivalent to the Python " -"expression ``format(obj, format_spec)``." -msgstr "" - -#: ../../c-api/object.rst:310 -msgid "" -"*format_spec* may be ``NULL``. In this case the call is equivalent to " -"``format(obj)``. Returns the formatted string on success, ``NULL`` on " -"failure." +"will always return ``1`` for :const:`Py_EQ` and ``0`` for :const:`Py_NE`." msgstr "" +"*o1* と *o2* が同一のオブジェクトである場合、 :c:func:" +"`PyObject_RichCompareBool` は :const:`Py_EQ` に対して常に ``1`` を返し、 :" +"const:`Py_NE` に対して常に ``0`` を返します。" -#: ../../c-api/object.rst:318 +#: ../../c-api/object.rst:167 msgid "" "Compute a string representation of object *o*. Returns the string " "representation on success, ``NULL`` on failure. This is the equivalent of " @@ -475,7 +253,7 @@ msgstr "" "ると ``NULL`` を返します。 Python 式 ``repr(o)`` と同じです。この関数は組み込" "み関数 :func:`repr` の処理で呼び出されます。" -#: ../../c-api/object.rst:322 ../../c-api/object.rst:346 +#: ../../c-api/object.rst:171 ../../c-api/object.rst:195 msgid "" "This function now includes a debug assertion to help ensure that it does not " "silently discard an active exception." @@ -483,7 +261,7 @@ msgstr "" "アクティブな例外を黙って捨てないことを保証するのに便利なように、この関数はデ" "バッグアサーションを含むようになりました。" -#: ../../c-api/object.rst:330 +#: ../../c-api/object.rst:179 msgid "" "As :c:func:`PyObject_Repr`, compute a string representation of object *o*, " "but escape the non-ASCII characters in the string returned by :c:func:" @@ -497,7 +275,7 @@ msgstr "" "は Pythoh 2 の :c:func:`PyObject_Repr` が返す文字列と同じ文字列を生成しま" "す。 :func:`ascii` によって呼び出されます。" -#: ../../c-api/object.rst:341 +#: ../../c-api/object.rst:190 msgid "" "Compute a string representation of object *o*. Returns the string " "representation on success, ``NULL`` on failure. This is the equivalent of " @@ -508,7 +286,7 @@ msgstr "" "ると ``NULL`` を返します。 Python 式 ``str(o)`` と同じです。この関数は組み込" "み関数 :func:`str` や、 :func:`print` 関数の処理で呼び出されます。" -#: ../../c-api/object.rst:355 +#: ../../c-api/object.rst:204 msgid "" "Compute a bytes representation of object *o*. ``NULL`` is returned on " "failure and a bytes object on success. This is equivalent to the Python " @@ -521,7 +299,7 @@ msgstr "" "``bytes(o)`` と同じです。 ``bytes(o)`` と違って、 *o* が整数のときには、ゼロ" "で初期化された bytes オブジェクトを返すのではなく TypeError が送出されます。" -#: ../../c-api/object.rst:364 +#: ../../c-api/object.rst:213 msgid "" "Return ``1`` if the class *derived* is identical to or derived from the " "class *cls*, otherwise return ``0``. In case of an error, return ``-1``." @@ -530,7 +308,7 @@ msgstr "" "場合は ``1`` を返し、そうでない場合は ``0`` を返します。\n" "エラーが起きた場合は ``-1`` を返します。" -#: ../../c-api/object.rst:367 ../../c-api/object.rst:386 +#: ../../c-api/object.rst:216 ../../c-api/object.rst:235 msgid "" "If *cls* is a tuple, the check will be done against every entry in *cls*. " "The result will be ``1`` when at least one of the checks returns ``1``, " @@ -540,22 +318,30 @@ msgstr "" "少なくとも1つのチェックで ``1`` が返ったとき、結果は ``1`` となり、それ以外の" "とき ``0`` になります。" -#: ../../c-api/object.rst:371 +#: ../../c-api/object.rst:220 msgid "" -"If *cls* has a :meth:`~type.__subclasscheck__` method, it will be called to " +"If *cls* has a :meth:`~class.__subclasscheck__` method, it will be called to " "determine the subclass status as described in :pep:`3119`. Otherwise, " "*derived* is a subclass of *cls* if it is a direct or indirect subclass, i." -"e. contained in :attr:`cls.__mro__ `." +"e. contained in ``cls.__mro__``." msgstr "" +"*cls* に :meth:`~class.__subclasscheck__` メソッドがある場合は、子クラスの状" +"態が :pep:`3119` にある通りかどうかを判定するために呼ばれます。\n" +"そうでないとき *derived* が *cls* の子クラスになるのは、直接的あるいは間接的" +"な子クラスである場合、つまり ``cls.__mro__`` に含まれる場合です。" -#: ../../c-api/object.rst:376 +#: ../../c-api/object.rst:225 msgid "" "Normally only class objects, i.e. instances of :class:`type` or a derived " "class, are considered classes. However, objects can override this by having " -"a :attr:`~type.__bases__` attribute (which must be a tuple of base classes)." +"a :attr:`__bases__` attribute (which must be a tuple of base classes)." msgstr "" +"通常は、クラスオブジェクト、つまり :class:`type` のインスタンスやそこから派生" +"したクラスだけがクラスと見なされます。\n" +"しかし、オブジェクトに属性 :attr:`__bases__` (これは基底クラスのタプルでなけ" +"ればならない) を持たせることで上書きできます。" -#: ../../c-api/object.rst:383 +#: ../../c-api/object.rst:232 msgid "" "Return ``1`` if *inst* is an instance of the class *cls* or a subclass of " "*cls*, or ``0`` if not. On error, returns ``-1`` and sets an exception." @@ -564,27 +350,36 @@ msgstr "" "``1`` を返し、そうでない場合に ``0`` を返します。\n" "エラーが起きると ``-1`` を返し例外を設定します。" -#: ../../c-api/object.rst:390 +#: ../../c-api/object.rst:239 msgid "" -"If *cls* has a :meth:`~type.__instancecheck__` method, it will be called to " +"If *cls* has a :meth:`~class.__instancecheck__` method, it will be called to " "determine the subclass status as described in :pep:`3119`. Otherwise, " "*inst* is an instance of *cls* if its class is a subclass of *cls*." msgstr "" +"*cls* に :meth:`~class.__instancecheck__` メソッドがある場合は、子クラスの状" +"態が :pep:`3119` にある通りかどうかを判定するために呼ばれます。 \n" +"そうでないとき *inst* が *cls* のインスタンスになるのは、そのクラスが *cls* " +"の子クラスである場合です。" -#: ../../c-api/object.rst:394 +#: ../../c-api/object.rst:243 msgid "" "An instance *inst* can override what is considered its class by having a :" -"attr:`~object.__class__` attribute." +"attr:`__class__` attribute." msgstr "" +"インスタンス *inst* に属性 :attr:`__class__` を持たせることで、そのクラスと見" +"なされるものを上書きできます。" -#: ../../c-api/object.rst:397 +#: ../../c-api/object.rst:246 msgid "" "An object *cls* can override if it is considered a class, and what its base " -"classes are, by having a :attr:`~type.__bases__` attribute (which must be a " -"tuple of base classes)." +"classes are, by having a :attr:`__bases__` attribute (which must be a tuple " +"of base classes)." msgstr "" +"オブジェクト *cls* とその基底クラスがクラスと見なされる場合、属性 :attr:" +"`__bases__` (これは基底クラスのタプルでなければならない) を持たせることで上書" +"きできます。" -#: ../../c-api/object.rst:406 +#: ../../c-api/object.rst:255 msgid "" "Compute and return the hash value of an object *o*. On failure, return " "``-1``. This is the equivalent of the Python expression ``hash(o)``." @@ -592,23 +387,27 @@ msgstr "" "オブジェクト *o* のハッシュ値を計算して返します。失敗すると ``-1`` を返しま" "す。 Python の式 ``hash(o)`` と同じです。" -#: ../../c-api/object.rst:409 +#: ../../c-api/object.rst:258 msgid "" -"The return type is now Py_hash_t. This is a signed integer the same size " -"as :c:type:`Py_ssize_t`." +"The return type is now Py_hash_t. This is a signed integer the same size as " +"Py_ssize_t." msgstr "" -"返り値の型が Py_hash_t になりました。この型は、 :c:type:`Py_ssize_t` と同じサ" -"イズをもつ符号付き整数です。" +"返り値の型が Py_hash_t になりました。この型は、 Py_ssize_t と同じサイズをもつ" +"符号付き整数です。" -#: ../../c-api/object.rst:416 +#: ../../c-api/object.rst:265 msgid "" -"Set a :exc:`TypeError` indicating that ``type(o)`` is not :term:`hashable` " -"and return ``-1``. This function receives special treatment when stored in a " +"Set a :exc:`TypeError` indicating that ``type(o)`` is not hashable and " +"return ``-1``. This function receives special treatment when stored in a " "``tp_hash`` slot, allowing a type to explicitly indicate to the interpreter " "that it is not hashable." msgstr "" +"``type(o)`` がハッシュ不可能であることを示す :exc:`TypeError` を設定し、 " +"``-1`` を返します。この関数は ``tp_hash`` スロットに格納されたときには特別な" +"扱いを受け、その type がハッシュ不可能であることをインタプリタに明示的に示し" +"ます。" -#: ../../c-api/object.rst:424 +#: ../../c-api/object.rst:273 msgid "" "Returns ``1`` if the object *o* is considered to be true, and ``0`` " "otherwise. This is equivalent to the Python expression ``not not o``. On " @@ -617,7 +416,7 @@ msgstr "" "*o* が真を表すとみなせる場合には ``1`` を、そうでないときには ``0`` を返しま" "す。 Python の式 ``not not o`` と同じです。失敗すると ``-1`` を返します。" -#: ../../c-api/object.rst:431 +#: ../../c-api/object.rst:280 msgid "" "Returns ``0`` if the object *o* is considered to be true, and ``1`` " "otherwise. This is equivalent to the Python expression ``not o``. On " @@ -626,24 +425,26 @@ msgstr "" "*o* が真を表すとみなせる場合には ``0`` を、そうでないときには ``1`` を返しま" "す。 Python の式 ``not o`` と同じです。失敗すると ``-1`` を返します。" -#: ../../c-api/object.rst:440 +#: ../../c-api/object.rst:289 msgid "" "When *o* is non-``NULL``, returns a type object corresponding to the object " "type of object *o*. On failure, raises :exc:`SystemError` and returns " "``NULL``. This is equivalent to the Python expression ``type(o)``. This " -"function creates a new :term:`strong reference` to the return value. There's " -"really no reason to use this function instead of the :c:func:`Py_TYPE()` " -"function, which returns a pointer of type :c:expr:`PyTypeObject*`, except " -"when a new :term:`strong reference` is needed." +"function increments the reference count of the return value. There's really " +"no reason to use this function instead of the common expression ``o-" +">ob_type``, which returns a pointer of type :c:type:`PyTypeObject*`, except " +"when the incremented reference count is needed." msgstr "" -#: ../../c-api/object.rst:452 +#: ../../c-api/object.rst:300 msgid "" -"Return non-zero if the object *o* is of type *type* or a subtype of *type*, " -"and ``0`` otherwise. Both parameters must be non-``NULL``." +"Return true if the object *o* is of type *type* or a subtype of *type*. " +"Both parameters must be non-``NULL``." msgstr "" +"オブジェクト *o* が、 *type* か *type* のサブタイプであるときに真を返します。" +"どちらのパラメタも ``NULL`` であってはなりません。" -#: ../../c-api/object.rst:461 +#: ../../c-api/object.rst:309 msgid "" "Return the length of object *o*. If the object *o* provides either the " "sequence and mapping protocols, the sequence length is returned. On error, " @@ -654,7 +455,7 @@ msgstr "" "型プロトコルの両方を提供している場合、シーケンスとしての長さを返します。エ" "ラーが生じると ``-1`` を返します。 Python の式 ``len(o)`` と同じです。" -#: ../../c-api/object.rst:468 +#: ../../c-api/object.rst:316 msgid "" "Return an estimated length for the object *o*. First try to return its " "actual length, then an estimate using :meth:`~object.__length_hint__`, and " @@ -667,7 +468,7 @@ msgstr "" "を、そして最後にデフォルトの値を返そうとします。\n" "この関数は Python の式 ``operator.length_hint(o, defaultvalue)`` と同じです。" -#: ../../c-api/object.rst:478 +#: ../../c-api/object.rst:326 msgid "" "Return element of *o* corresponding to the object *key* or ``NULL`` on " "failure. This is the equivalent of the Python expression ``o[key]``." @@ -675,7 +476,7 @@ msgstr "" "オブジェクト *key* に対応する *o* の要素を返します。失敗すると ``NULL`` を返" "します。Python の式 ``o[key]`` と同じです。" -#: ../../c-api/object.rst:484 +#: ../../c-api/object.rst:332 msgid "" "Map the object *key* to the value *v*. Raise an exception and return ``-1`` " "on failure; return ``0`` on success. This is the equivalent of the Python " @@ -686,7 +487,7 @@ msgstr "" "これは Python の文 ``o[key] = v`` と同等です。\n" "この関数は *v* への参照を *盗み取りません* 。" -#: ../../c-api/object.rst:492 +#: ../../c-api/object.rst:340 msgid "" "Remove the mapping for the object *key* from the object *o*. Return ``-1`` " "on failure. This is equivalent to the Python statement ``del o[key]``." @@ -694,14 +495,7 @@ msgstr "" "オブジェクト *o* から *key* に関する対応付けを削除します。失敗すると ``-1`` " "を返します。Python の文 ``del o[key]`` と同じです。" -#: ../../c-api/object.rst:498 -msgid "" -"This is the same as :c:func:`PyObject_DelItem`, but *key* is specified as a :" -"c:expr:`const char*` UTF-8 encoded bytes string, rather than a :c:expr:" -"`PyObject*`." -msgstr "" - -#: ../../c-api/object.rst:505 +#: ../../c-api/object.rst:346 msgid "" "This is equivalent to the Python expression ``dir(o)``, returning a " "(possibly empty) list of strings appropriate for the object argument, or " @@ -716,7 +510,7 @@ msgstr "" "様に、現在のローカルな名前を返します; この場合、アクティブな実行フレームがな" "ければ ``NULL`` を返しますが、 :c:func:`PyErr_Occurred` は偽を返します。" -#: ../../c-api/object.rst:514 +#: ../../c-api/object.rst:355 msgid "" "This is equivalent to the Python expression ``iter(o)``. It returns a new " "iterator for the object argument, or the object itself if the object is " @@ -727,330 +521,3 @@ msgstr "" "テレータか、オブジェクトがすでにイテレータの場合にはオブジェクト自身を返しま" "す。オブジェクトが反復処理不可能であった場合には :exc:`TypeError` を送出して " "``NULL`` を返します。" - -#: ../../c-api/object.rst:522 -msgid "" -"This is equivalent to the Python ``__iter__(self): return self`` method. It " -"is intended for :term:`iterator` types, to be used in the :c:member:" -"`PyTypeObject.tp_iter` slot." -msgstr "" - -#: ../../c-api/object.rst:528 -msgid "" -"This is the equivalent to the Python expression ``aiter(o)``. Takes an :" -"class:`AsyncIterable` object and returns an :class:`AsyncIterator` for it. " -"This is typically a new iterator but if the argument is an :class:" -"`AsyncIterator`, this returns itself. Raises :exc:`TypeError` and returns " -"``NULL`` if the object cannot be iterated." -msgstr "" - -#: ../../c-api/object.rst:538 -msgid "Get a pointer to subclass-specific data reserved for *cls*." -msgstr "" - -#: ../../c-api/object.rst:540 -msgid "" -"The object *o* must be an instance of *cls*, and *cls* must have been " -"created using negative :c:member:`PyType_Spec.basicsize`. Python does not " -"check this." -msgstr "" - -#: ../../c-api/object.rst:544 -msgid "On error, set an exception and return ``NULL``." -msgstr "" - -#: ../../c-api/object.rst:550 -msgid "" -"Return the size of the instance memory space reserved for *cls*, i.e. the " -"size of the memory :c:func:`PyObject_GetTypeData` returns." -msgstr "" - -#: ../../c-api/object.rst:553 -msgid "" -"This may be larger than requested using :c:member:`-PyType_Spec.basicsize " -"`; it is safe to use this larger size (e.g. with :c:" -"func:`!memset`)." -msgstr "" - -#: ../../c-api/object.rst:556 -msgid "" -"The type *cls* **must** have been created using negative :c:member:" -"`PyType_Spec.basicsize`. Python does not check this." -msgstr "" - -#: ../../c-api/object.rst:560 -msgid "On error, set an exception and return a negative value." -msgstr "" - -#: ../../c-api/object.rst:566 -msgid "" -"Get a pointer to per-item data for a class with :c:macro:" -"`Py_TPFLAGS_ITEMS_AT_END`." -msgstr "" - -#: ../../c-api/object.rst:569 -msgid "" -"On error, set an exception and return ``NULL``. :py:exc:`TypeError` is " -"raised if *o* does not have :c:macro:`Py_TPFLAGS_ITEMS_AT_END` set." -msgstr "" - -#: ../../c-api/object.rst:577 -msgid "Visit the managed dictionary of *obj*." -msgstr "" - -#: ../../c-api/object.rst:579 ../../c-api/object.rst:588 -msgid "" -"This function must only be called in a traverse function of the type which " -"has the :c:macro:`Py_TPFLAGS_MANAGED_DICT` flag set." -msgstr "" - -#: ../../c-api/object.rst:586 -msgid "Clear the managed dictionary of *obj*." -msgstr "" - -#: ../../c-api/object.rst:595 -msgid "" -"Enable `deferred reference counting `_ on *obj*, if supported by the runtime. In " -"the :term:`free-threaded ` build, this allows the " -"interpreter to avoid reference count adjustments to *obj*, which may improve " -"multi-threaded performance. The tradeoff is that *obj* will only be " -"deallocated by the tracing garbage collector." -msgstr "" - -#: ../../c-api/object.rst:601 -msgid "" -"This function returns ``1`` if deferred reference counting is enabled on " -"*obj* (including when it was enabled before the call), and ``0`` if deferred " -"reference counting is not supported or if the hint was ignored by the " -"runtime. This function is thread-safe, and cannot fail." -msgstr "" - -#: ../../c-api/object.rst:606 -msgid "" -"This function does nothing on builds with the :term:`GIL` enabled, which do " -"not support deferred reference counting. This also does nothing if *obj* is " -"not an object tracked by the garbage collector (see :func:`gc.is_tracked` " -"and :c:func:`PyObject_GC_IsTracked`)." -msgstr "" - -#: ../../c-api/object.rst:611 -msgid "" -"This function is intended to be used soon after *obj* is created, by the " -"code that creates it." -msgstr "" - -#: ../../c-api/object.rst:618 -msgid "" -"Check if *obj* is a unique temporary object. Returns ``1`` if *obj* is known " -"to be a unique temporary object, and ``0`` otherwise. This function cannot " -"fail, but the check is conservative, and may return ``0`` in some cases even " -"if *obj* is a unique temporary object." -msgstr "" - -#: ../../c-api/object.rst:624 -msgid "" -"If an object is a unique temporary, it is guaranteed that the current code " -"has the only reference to the object. For arguments to C functions, this " -"should be used instead of checking if the reference count is ``1``. Starting " -"with Python 3.14, the interpreter internally avoids some reference count " -"modifications when loading objects onto the operands stack by :term:" -"`borrowing ` references when possible, which means that " -"a reference count of ``1`` by itself does not guarantee that a function " -"argument uniquely referenced." -msgstr "" - -#: ../../c-api/object.rst:633 -msgid "" -"In the example below, ``my_func`` is called with a unique temporary object " -"as its argument::" -msgstr "" - -#: ../../c-api/object.rst:636 -msgid "my_func([1, 2, 3])" -msgstr "" - -#: ../../c-api/object.rst:638 -msgid "" -"In the example below, ``my_func`` is **not** called with a unique temporary " -"object as its argument, even if its refcount is ``1``::" -msgstr "" - -#: ../../c-api/object.rst:641 -msgid "" -"my_list = [1, 2, 3]\n" -"my_func(my_list)" -msgstr "" - -#: ../../c-api/object.rst:644 -msgid "See also the function :c:func:`Py_REFCNT`." -msgstr "" - -#: ../../c-api/object.rst:650 -msgid "" -"This function returns non-zero if *obj* is :term:`immortal`, and zero " -"otherwise. This function cannot fail." -msgstr "" - -#: ../../c-api/object.rst:655 -msgid "" -"Objects that are immortal in one CPython version are not guaranteed to be " -"immortal in another." -msgstr "" - -#: ../../c-api/object.rst:662 -msgid "" -"Increments the reference count of *obj* if it is not zero. Returns ``1`` if " -"the object's reference count was successfully incremented. Otherwise, this " -"function returns ``0``." -msgstr "" - -#: ../../c-api/object.rst:666 -msgid "" -":c:func:`PyUnstable_EnableTryIncRef` must have been called earlier on *obj* " -"or this function may spuriously return ``0`` in the :term:`free threading` " -"build." -msgstr "" - -#: ../../c-api/object.rst:670 -msgid "" -"This function is logically equivalent to the following C code, except that " -"it behaves atomically in the :term:`free threading` build::" -msgstr "" - -#: ../../c-api/object.rst:673 -msgid "" -"if (Py_REFCNT(op) > 0) {\n" -" Py_INCREF(op);\n" -" return 1;\n" -"}\n" -"return 0;" -msgstr "" - -#: ../../c-api/object.rst:679 -msgid "" -"This is intended as a building block for managing weak references without " -"the overhead of a Python :ref:`weak reference object `." -msgstr "" - -#: ../../c-api/object.rst:682 -msgid "" -"Typically, correct use of this function requires support from *obj*'s " -"deallocator (:c:member:`~PyTypeObject.tp_dealloc`). For example, the " -"following sketch could be adapted to implement a \"weakmap\" that works like " -"a :py:class:`~weakref.WeakValueDictionary` for a specific type:" -msgstr "" - -#: ../../c-api/object.rst:688 -msgid "" -"PyMutex mutex;\n" -"\n" -"PyObject *\n" -"add_entry(weakmap_key_type *key, PyObject *value)\n" -"{\n" -" PyUnstable_EnableTryIncRef(value);\n" -" weakmap_type weakmap = ...;\n" -" PyMutex_Lock(&mutex);\n" -" weakmap_add_entry(weakmap, key, value);\n" -" PyMutex_Unlock(&mutex);\n" -" Py_RETURN_NONE;\n" -"}\n" -"\n" -"PyObject *\n" -"get_value(weakmap_key_type *key)\n" -"{\n" -" weakmap_type weakmap = ...;\n" -" PyMutex_Lock(&mutex);\n" -" PyObject *result = weakmap_find(weakmap, key);\n" -" if (PyUnstable_TryIncRef(result)) {\n" -" // `result` is safe to use\n" -" PyMutex_Unlock(&mutex);\n" -" return result;\n" -" }\n" -" // if we get here, `result` is starting to be garbage-collected,\n" -" // but has not been removed from the weakmap yet\n" -" PyMutex_Unlock(&mutex);\n" -" return NULL;\n" -"}\n" -"\n" -"// tp_dealloc function for weakmap values\n" -"void\n" -"value_dealloc(PyObject *value)\n" -"{\n" -" weakmap_type weakmap = ...;\n" -" PyMutex_Lock(&mutex);\n" -" weakmap_remove_value(weakmap, value);\n" -"\n" -" ...\n" -" PyMutex_Unlock(&mutex);\n" -"}" -msgstr "" - -#: ../../c-api/object.rst:736 -msgid "" -"Enables subsequent uses of :c:func:`PyUnstable_TryIncRef` on *obj*. The " -"caller must hold a :term:`strong reference` to *obj* when calling this." -msgstr "" - -#: ../../c-api/object.rst:743 -msgid "Determine if *op* only has one reference." -msgstr "" - -#: ../../c-api/object.rst:745 -msgid "" -"On GIL-enabled builds, this function is equivalent to :c:expr:`Py_REFCNT(op) " -"== 1`." -msgstr "" - -#: ../../c-api/object.rst:748 -msgid "" -"On a :term:`free threaded ` build, this checks if *op*'s :" -"term:`reference count` is equal to one and additionally checks if *op* is " -"only used by this thread. :c:expr:`Py_REFCNT(op) == 1` is **not** thread-" -"safe on free threaded builds; prefer this function." -msgstr "" - -#: ../../c-api/object.rst:753 -msgid "" -"The caller must hold an :term:`attached thread state`, despite the fact that " -"this function doesn't call into the Python interpreter. This function cannot " -"fail." -msgstr "" - -#: ../../c-api/object.rst:316 ../../c-api/object.rst:328 -#: ../../c-api/object.rst:353 ../../c-api/object.rst:404 -#: ../../c-api/object.rst:438 ../../c-api/object.rst:459 -msgid "built-in function" -msgstr "組み込み関数" - -#: ../../c-api/object.rst:316 -msgid "repr" -msgstr "repr" - -#: ../../c-api/object.rst:328 -msgid "ascii" -msgstr "ascii" - -#: ../../c-api/object.rst:336 -msgid "string" -msgstr "string" - -#: ../../c-api/object.rst:336 -msgid "PyObject_Str (C function)" -msgstr "PyObject_Str (C 関数)" - -#: ../../c-api/object.rst:353 -msgid "bytes" -msgstr "bytes" - -#: ../../c-api/object.rst:404 -msgid "hash" -msgstr "hash" - -#: ../../c-api/object.rst:438 -msgid "type" -msgstr "type" - -#: ../../c-api/object.rst:459 -msgid "len" -msgstr "len" diff --git a/c-api/objimpl.po b/c-api/objimpl.po index e527ad04a..2d30dd050 100644 --- a/c-api/objimpl.po +++ b/c-api/objimpl.po @@ -1,25 +1,26 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2024 +# Arihiro TAKASE, 2017 +# tomo, 2018 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:49+0000\n" -"Last-Translator: tomo, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 17:38+0000\n" +"Last-Translator: tomo, 2018\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/objimpl.rst:7 diff --git a/c-api/perfmaps.po b/c-api/perfmaps.po deleted file mode 100644 index c7c90673f..000000000 --- a/c-api/perfmaps.po +++ /dev/null @@ -1,91 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 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.14\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-13 14:21+0000\n" -"PO-Revision-Date: 2023-05-24 13:07+0000\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" -"ja/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#: ../../c-api/perfmaps.rst:6 -msgid "Support for Perf Maps" -msgstr "" - -#: ../../c-api/perfmaps.rst:8 -msgid "" -"On supported platforms (as of this writing, only Linux), the runtime can " -"take advantage of *perf map files* to make Python functions visible to an " -"external profiling tool (such as `perf `_). A running process may create a file in the ``/tmp`` " -"directory, which contains entries that can map a section of executable code " -"to a name. This interface is described in the `documentation of the Linux " -"Perf tool `_." -msgstr "" - -#: ../../c-api/perfmaps.rst:16 -msgid "" -"In Python, these helper APIs can be used by libraries and features that rely " -"on generating machine code on the fly." -msgstr "" - -#: ../../c-api/perfmaps.rst:19 -msgid "" -"Note that holding an :term:`attached thread state` is not required for these " -"APIs." -msgstr "" - -#: ../../c-api/perfmaps.rst:23 -msgid "" -"Open the ``/tmp/perf-$pid.map`` file, unless it's already opened, and create " -"a lock to ensure thread-safe writes to the file (provided the writes are " -"done through :c:func:`PyUnstable_WritePerfMapEntry`). Normally, there's no " -"need to call this explicitly; just use :c:func:" -"`PyUnstable_WritePerfMapEntry` and it will initialize the state on first " -"call." -msgstr "" - -#: ../../c-api/perfmaps.rst:29 -msgid "" -"Returns ``0`` on success, ``-1`` on failure to create/open the perf map " -"file, or ``-2`` on failure to create a lock. Check ``errno`` for more " -"information about the cause of a failure." -msgstr "" - -#: ../../c-api/perfmaps.rst:35 -msgid "" -"Write one single entry to the ``/tmp/perf-$pid.map`` file. This function is " -"thread safe. Here is what an example entry looks like::" -msgstr "" - -#: ../../c-api/perfmaps.rst:38 -msgid "" -"# address size name\n" -"7f3529fcf759 b py::bar:/run/t.py" -msgstr "" - -#: ../../c-api/perfmaps.rst:41 -msgid "" -"Will call :c:func:`PyUnstable_PerfMapState_Init` before writing the entry, " -"if the perf map file is not already opened. Returns ``0`` on success, or the " -"same error codes as :c:func:`PyUnstable_PerfMapState_Init` on failure." -msgstr "" - -#: ../../c-api/perfmaps.rst:47 -msgid "" -"Close the perf map file opened by :c:func:`PyUnstable_PerfMapState_Init`. " -"This is called by the runtime itself during interpreter shut-down. In " -"general, there shouldn't be a reason to explicitly call this, except to " -"handle specific scenarios such as forking." -msgstr "" diff --git a/c-api/refcounting.po b/c-api/refcounting.po index 3a6e2d32c..5620e5bcb 100644 --- a/c-api/refcounting.po +++ b/c-api/refcounting.po @@ -1,27 +1,27 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 -# Arihiro TAKASE, 2023 -# 石井明久, 2024 +# Nozomu Kaneko , 2017 +# Arihiro TAKASE, 2017 +# tomo, 2020 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:50+0000\n" -"Last-Translator: 石井明久, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 17:38+0000\n" +"Last-Translator: tomo, 2020\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/refcounting.rst:8 @@ -30,299 +30,120 @@ msgstr "参照カウント" #: ../../c-api/refcounting.rst:10 msgid "" -"The functions and macros in this section are used for managing reference " -"counts of Python objects." +"The macros in this section are used for managing reference counts of Python " +"objects." msgstr "" -"このセクションにある関数とマクロは、 Python オブジェクトの参照カウントの管理" -"に使用されます。" +"この節のマクロはPythonオブジェクトの参照カウントを管理するために使われます。" #: ../../c-api/refcounting.rst:16 -msgid "Get the reference count of the Python object *o*." -msgstr "Python オブジェクト *o* の参照カウントを取得します。" - -#: ../../c-api/refcounting.rst:18 msgid "" -"Note that the returned value may not actually reflect how many references to " -"the object are actually held. For example, some objects are :term:" -"`immortal` and have a very high refcount that does not reflect the actual " -"number of references. Consequently, do not rely on the returned value to be " -"accurate, other than a value of 0 or 1." +"Increment the reference count for object *o*. The object must not be " +"``NULL``; if you aren't sure that it isn't ``NULL``, use :c:func:" +"`Py_XINCREF`." msgstr "" -"戻り値は、実際に保持されているオブジェクトの参照の数を実際に反映しているとは" -"限らないことに注意してください。例えば、一部のオブジェクトは永続 (:term:" -"`immortal`) であり、実際の参照の数を反映しない非常に高い参照数を持ちます。し" -"たがって、 0 か 1 の値以外では、正確な戻り値に頼らないでください。" +"オブジェクト *o* に対する参照カウントを一つ増やします。\n" +"オブジェクトが ``NULL`` であってはいけません。\n" +"それが ``NULL`` ではないと確信が持てないならば、 :c:func:`Py_XINCREF` を使っ" +"てください。" -#: ../../c-api/refcounting.rst:24 +#: ../../c-api/refcounting.rst:22 msgid "" -"Use the :c:func:`Py_SET_REFCNT()` function to set an object reference count." +"Increment the reference count for object *o*. The object may be ``NULL``, " +"in which case the macro has no effect." msgstr "" -"オブジェクトの参照カウントを設定するためには、 :c:func:`Py_SET_REFCNT()` 関数" -"を使用してください。" +"オブジェクト *o* に対する参照カウントを一つ増やします。\n" +"オブジェクトが ``NULL`` であってもよく、その場合マクロは何の影響も与えませ" +"ん。" #: ../../c-api/refcounting.rst:28 msgid "" -"On :term:`free threaded ` builds of Python, returning 1 " -"isn't sufficient to determine if it's safe to treat *o* as having no access " -"by other threads. Use :c:func:`PyUnstable_Object_IsUniquelyReferenced` for " -"that instead." -msgstr "" - -#: ../../c-api/refcounting.rst:33 -msgid "" -"See also the function :c:func:" -"`PyUnstable_Object_IsUniqueReferencedTemporary()`." +"Decrement the reference count for object *o*. The object must not be " +"``NULL``; if you aren't sure that it isn't ``NULL``, use :c:func:" +"`Py_XDECREF`. If the reference count reaches zero, the object's type's " +"deallocation function (which must not be ``NULL``) is invoked." msgstr "" +"オブジェクト *o* に対する参照カウントを一つ減らします。\n" +"オブジェクトが ``NULL`` であってはいけません。\n" +"それが ``NULL`` ではないと確信が持てないならば、 :c:func:`Py_XDECREF` を使っ" +"てください。\n" +"参照カウントがゼロになったら、オブジェクトの型のメモリ解放関数 (``NULL`` で" +"あってはならない) が呼ばれます。" #: ../../c-api/refcounting.rst:35 -msgid ":c:func:`Py_REFCNT()` is changed to the inline static function." -msgstr ":c:func:`Py_REFCNT()` は static なインライン関数に変更されました。" - -#: ../../c-api/refcounting.rst:38 -msgid "The parameter type is no longer :c:expr:`const PyObject*`." -msgstr "引数の型は :c:expr:`const PyObject*` ではなくなりました。" - -#: ../../c-api/refcounting.rst:44 -msgid "Set the object *o* reference counter to *refcnt*." -msgstr "オブジェクト *o* の参照カウントを *refcnt* に設定します。" - -#: ../../c-api/refcounting.rst:46 -msgid "" -"On :ref:`Python build with Free Threading `, if " -"*refcnt* is larger than ``UINT32_MAX``, the object is made :term:`immortal`." -msgstr "" -":ref:`フリースレッドな Python ビルド ` では、 *refcnt* " -"が ``UINT32_MAX`` より大きい場合、オブジェクトは永続 (:term:`immortal`) とな" -"ります。" - -#: ../../c-api/refcounting.rst:49 ../../c-api/refcounting.rst:62 -#: ../../c-api/refcounting.rst:128 -msgid "This function has no effect on :term:`immortal` objects." -msgstr "この関数は永続 (:term:`immortal`) オブジェクトには何もしません。" - -#: ../../c-api/refcounting.rst:53 ../../c-api/refcounting.rst:77 -#: ../../c-api/refcounting.rst:156 -msgid "Immortal objects are not modified." -msgstr "永続オブジェクトは変更されません。" - -#: ../../c-api/refcounting.rst:59 -msgid "" -"Indicate taking a new :term:`strong reference` to object *o*, indicating it " -"is in use and should not be destroyed." -msgstr "" -"オブジェクト *o* への新しい :term:`強参照 ` を取得し、それ" -"が使用中で破棄されてはならないことを示します。" - -#: ../../c-api/refcounting.rst:64 -msgid "" -"This function is usually used to convert a :term:`borrowed reference` to a :" -"term:`strong reference` in-place. The :c:func:`Py_NewRef` function can be " -"used to create a new :term:`strong reference`." -msgstr "" - -#: ../../c-api/refcounting.rst:68 -msgid "When done using the object, release is by calling :c:func:`Py_DECREF`." -msgstr "" - -#: ../../c-api/refcounting.rst:70 -msgid "" -"The object must not be ``NULL``; if you aren't sure that it isn't ``NULL``, " -"use :c:func:`Py_XINCREF`." -msgstr "" -"オブジェクトが ``NULL`` であってはいけません。それが ``NULL`` ではないと確信" -"が持てないならば、 :c:func:`Py_XINCREF` を使ってください。" - -#: ../../c-api/refcounting.rst:73 -msgid "" -"Do not expect this function to actually modify *o* in any way. For at least :" -"pep:`some objects <0683>`, this function has no effect." -msgstr "" - -#: ../../c-api/refcounting.rst:83 -msgid "" -"Similar to :c:func:`Py_INCREF`, but the object *o* can be ``NULL``, in which " -"case this has no effect." -msgstr "" - -#: ../../c-api/refcounting.rst:86 -msgid "See also :c:func:`Py_XNewRef`." -msgstr "" - -#: ../../c-api/refcounting.rst:91 -msgid "" -"Create a new :term:`strong reference` to an object: call :c:func:`Py_INCREF` " -"on *o* and return the object *o*." -msgstr "" - -#: ../../c-api/refcounting.rst:94 -msgid "" -"When the :term:`strong reference` is no longer needed, :c:func:`Py_DECREF` " -"should be called on it to release the reference." -msgstr "" - -#: ../../c-api/refcounting.rst:97 -msgid "" -"The object *o* must not be ``NULL``; use :c:func:`Py_XNewRef` if *o* can be " -"``NULL``." -msgstr "" - -#: ../../c-api/refcounting.rst:100 -msgid "For example::" -msgstr "例えば::" - -#: ../../c-api/refcounting.rst:102 -msgid "" -"Py_INCREF(obj);\n" -"self->attr = obj;" -msgstr "" - -#: ../../c-api/refcounting.rst:105 -msgid "can be written as::" -msgstr "" - -#: ../../c-api/refcounting.rst:107 -msgid "self->attr = Py_NewRef(obj);" -msgstr "" - -#: ../../c-api/refcounting.rst:109 -msgid "See also :c:func:`Py_INCREF`." -msgstr "" - -#: ../../c-api/refcounting.rst:116 -msgid "Similar to :c:func:`Py_NewRef`, but the object *o* can be NULL." -msgstr "" - -#: ../../c-api/refcounting.rst:118 -msgid "If the object *o* is ``NULL``, the function just returns ``NULL``." -msgstr "" - -#: ../../c-api/refcounting.rst:125 -msgid "" -"Release a :term:`strong reference` to object *o*, indicating the reference " -"is no longer used." -msgstr "" - -#: ../../c-api/refcounting.rst:130 -msgid "" -"Once the last :term:`strong reference` is released (i.e. the object's " -"reference count reaches 0), the object's type's deallocation function (which " -"must not be ``NULL``) is invoked." -msgstr "" - -#: ../../c-api/refcounting.rst:135 -msgid "" -"This function is usually used to delete a :term:`strong reference` before " -"exiting its scope." -msgstr "" - -#: ../../c-api/refcounting.rst:138 -msgid "" -"The object must not be ``NULL``; if you aren't sure that it isn't ``NULL``, " -"use :c:func:`Py_XDECREF`." -msgstr "" -"オブジェクトが ``NULL`` であってはいけません。それが ``NULL`` ではないと確信" -"が持てないならば、 :c:func:`Py_XDECREF` を使ってください。" - -#: ../../c-api/refcounting.rst:141 -msgid "" -"Do not expect this function to actually modify *o* in any way. For at least :" -"pep:`some objects <683>`, this function has no effect." -msgstr "" - -#: ../../c-api/refcounting.rst:147 msgid "" "The deallocation function can cause arbitrary Python code to be invoked (e." -"g. when a class instance with a :meth:`~object.__del__` method is " -"deallocated). While exceptions in such code are not propagated, the " -"executed code has free access to all Python global variables. This means " -"that any object that is reachable from a global variable should be in a " -"consistent state before :c:func:`Py_DECREF` is invoked. For example, code " -"to delete an object from a list should copy a reference to the deleted " -"object in a temporary variable, update the list data structure, and then " -"call :c:func:`Py_DECREF` for the temporary variable." -msgstr "" - -#: ../../c-api/refcounting.rst:162 -msgid "" -"Similar to :c:func:`Py_DECREF`, but the object *o* can be ``NULL``, in which " -"case this has no effect. The same warning from :c:func:`Py_DECREF` applies " -"here as well." -msgstr "" +"g. when a class instance with a :meth:`__del__` method is deallocated). " +"While exceptions in such code are not propagated, the executed code has free " +"access to all Python global variables. This means that any object that is " +"reachable from a global variable should be in a consistent state before :c:" +"func:`Py_DECREF` is invoked. For example, code to delete an object from a " +"list should copy a reference to the deleted object in a temporary variable, " +"update the list data structure, and then call :c:func:`Py_DECREF` for the " +"temporary variable." +msgstr "" +"(例えば :meth:`__del__` メソッドをもつクラスインスタンスがメモリ解放されたと" +"きに)メモリ解放関数は任意のPythonコードを呼び出すことができます。このような" +"コードでは例外は伝播しませんが、実行されたコードはすべてのPythonグローバル変" +"数に自由にアクセスできます。これが意味するのは、 :c:func:`Py_DECREF` が呼び出" +"されるより前では、グローバル変数から到達可能などんなオブジェクトも一貫した状" +"態にあるべきであるということです。例えば、リストからオブジェクトを削除する" +"コードは削除するオブジェクトへの参照を一時変数にコピーし、リストデータ構造を" +"更新し、それから一時変数に対して :c:func:`Py_DECREF` を呼び出すべきです。" + +#: ../../c-api/refcounting.rst:47 +msgid "" +"Decrement the reference count for object *o*. The object may be ``NULL``, " +"in which case the macro has no effect; otherwise the effect is the same as " +"for :c:func:`Py_DECREF`, and the same warning applies." +msgstr "" +"オブジェクト *o* への参照カウントを一つ減らします。\n" +"オブジェクトは ``NULL`` でもかまいませんが、その場合マクロは何の影響も与えま" +"せん。\n" +"それ以外の場合、結果は :c:func:`Py_DECREF` と同じです。\n" +"また、注意すべきことも同じです。" + +#: ../../c-api/refcounting.rst:54 +msgid "" +"Decrement the reference count for object *o*. The object may be ``NULL``, " +"in which case the macro has no effect; otherwise the effect is the same as " +"for :c:func:`Py_DECREF`, except that the argument is also set to ``NULL``. " +"The warning for :c:func:`Py_DECREF` does not apply with respect to the " +"object passed because the macro carefully uses a temporary variable and sets " +"the argument to ``NULL`` before decrementing its reference count." +msgstr "" +"*o* の参照カウントを減らします。\n" +"オブジェクトは ``NULL`` でもよく、その場合このマクロは何も行いません。\n" +"オブジェクトが ``NULL`` でなければ、引数を ``NULL`` にした :c:func:" +"`Py_DECREF` と同じ効果をもたらします。\n" +"このマクロは一時変数を使って、参照カウントをデクリメントする前に引数を " +"``NULL`` にセットしてくれるので、 :c:func:`Py_DECREF` に使うときの警告を気に" +"しなくてすみます。" + +#: ../../c-api/refcounting.rst:61 +msgid "" +"It is a good idea to use this macro whenever decrementing the reference " +"count of an object that might be traversed during garbage collection." +msgstr "" +"ガベージコレクション中に追跡される可能性のあるオブジェクトの参照カウントのデ" +"クリメントを行うには、このマクロを使うのがよいでしょう。" + +#: ../../c-api/refcounting.rst:65 +msgid "" +"The following functions are for runtime dynamic embedding of Python: " +"``Py_IncRef(PyObject *o)``, ``Py_DecRef(PyObject *o)``. They are simply " +"exported function versions of :c:func:`Py_XINCREF` and :c:func:`Py_XDECREF`, " +"respectively." +msgstr "" +"以下の関数: ``Py_IncRef(PyObject *o)``, ``Py_DecRef(PyObject *o)``, は、実行" +"時の動的な Python 埋め込みで使われる関数です。これらの関数はそれぞれ :c:func:" +"`Py_XINCREF` および :c:func:`Py_XDECREF` をエクスポートしただけです。" -#: ../../c-api/refcounting.rst:169 -msgid "" -"Release a :term:`strong reference` for object *o*. The object may be " -"``NULL``, in which case the macro has no effect; otherwise the effect is the " -"same as for :c:func:`Py_DECREF`, except that the argument is also set to " -"``NULL``. The warning for :c:func:`Py_DECREF` does not apply with respect " -"to the object passed because the macro carefully uses a temporary variable " -"and sets the argument to ``NULL`` before releasing the reference." -msgstr "" - -#: ../../c-api/refcounting.rst:177 -msgid "" -"It is a good idea to use this macro whenever releasing a reference to an " -"object that might be traversed during garbage collection." -msgstr "" - -#: ../../c-api/refcounting.rst:180 -msgid "" -"The macro argument is now only evaluated once. If the argument has side " -"effects, these are no longer duplicated." -msgstr "" - -#: ../../c-api/refcounting.rst:187 -msgid "" -"Indicate taking a new :term:`strong reference` to object *o*. A function " -"version of :c:func:`Py_XINCREF`. It can be used for runtime dynamic " -"embedding of Python." -msgstr "" - -#: ../../c-api/refcounting.rst:194 -msgid "" -"Release a :term:`strong reference` to object *o*. A function version of :c:" -"func:`Py_XDECREF`. It can be used for runtime dynamic embedding of Python." -msgstr "" - -#: ../../c-api/refcounting.rst:201 -msgid "" -"Macro safely releasing a :term:`strong reference` to object *dst* and " -"setting *dst* to *src*." -msgstr "" - -#: ../../c-api/refcounting.rst:204 -msgid "As in case of :c:func:`Py_CLEAR`, \"the obvious\" code can be deadly::" -msgstr "" - -#: ../../c-api/refcounting.rst:206 -msgid "" -"Py_DECREF(dst);\n" -"dst = src;" -msgstr "" - -#: ../../c-api/refcounting.rst:209 -msgid "The safe way is::" -msgstr "" - -#: ../../c-api/refcounting.rst:211 -msgid "Py_SETREF(dst, src);" -msgstr "" - -#: ../../c-api/refcounting.rst:213 -msgid "" -"That arranges to set *dst* to *src* _before_ releasing the reference to the " -"old value of *dst*, so that any code triggered as a side-effect of *dst* " -"getting torn down no longer believes *dst* points to a valid object." -msgstr "" - -#: ../../c-api/refcounting.rst:220 ../../c-api/refcounting.rst:232 -msgid "" -"The macro arguments are now only evaluated once. If an argument has side " -"effects, these are no longer duplicated." -msgstr "" - -#: ../../c-api/refcounting.rst:227 +#: ../../c-api/refcounting.rst:70 msgid "" -"Variant of :c:macro:`Py_SETREF` macro that uses :c:func:`Py_XDECREF` instead " -"of :c:func:`Py_DECREF`." +"The following functions or macros are only for use within the interpreter " +"core: :c:func:`_Py_Dealloc`, :c:func:`_Py_ForgetReference`, :c:func:" +"`_Py_NewReference`, as well as the global variable :c:data:`_Py_RefTotal`." msgstr "" +"以下の関数やマクロ: :c:func:`_Py_Dealloc`, :c:func:`_Py_ForgetReference`, :c:" +"func:`_Py_NewReference` は、インタプリタのコアの内部においてのみ使用するため" +"のものです。また、グローバル変数 :c:data:`_Py_RefTotal` も同様です。" diff --git a/c-api/reflection.po b/c-api/reflection.po index 01e68d8e4..921733fb4 100644 --- a/c-api/reflection.po +++ b/c-api/reflection.po @@ -1,36 +1,33 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 +# Arihiro TAKASE, 2017 +# tomo, 2020 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:50+0000\n" -"Last-Translator: tomo, 2021\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 17:38+0000\n" +"Last-Translator: tomo, 2020\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/reflection.rst:6 msgid "Reflection" msgstr "リフレクション" -#: ../../c-api/reflection.rst:12 -msgid "Use :c:func:`PyEval_GetFrameBuiltins` instead." -msgstr "" - -#: ../../c-api/reflection.rst:14 ../../c-api/reflection.rst:66 +#: ../../c-api/reflection.rst:10 msgid "" "Return a dictionary of the builtins in the current execution frame, or the " "interpreter of the thread state if no frame is currently executing." @@ -38,89 +35,64 @@ msgstr "" "現在の実行フレーム内のビルトインの辞書か、もし実行中のフレームがなければス" "レッド状態のインタプリタのビルトイン辞書を返します。" -#: ../../c-api/reflection.rst:22 +#: ../../c-api/reflection.rst:16 msgid "" -"Use either :c:func:`PyEval_GetFrameLocals` to obtain the same behaviour as " -"calling :func:`locals` in Python code, or else call :c:func:" -"`PyFrame_GetLocals` on the result of :c:func:`PyEval_GetFrame` to access " -"the :attr:`~frame.f_locals` attribute of the currently executing frame." -msgstr "" - -#: ../../c-api/reflection.rst:27 -msgid "" -"Return a mapping providing access to the local variables in the current " -"execution frame, or ``NULL`` if no frame is currently executing." +"Return a dictionary of the local variables in the current execution frame, " +"or ``NULL`` if no frame is currently executing." msgstr "" +"現在の実行フレーム内のローカル変数の辞書か、実行中のフレームがなければ " +"``NULL`` を返します。" -#: ../../c-api/reflection.rst:30 +#: ../../c-api/reflection.rst:22 msgid "" -"Refer to :func:`locals` for details of the mapping returned at different " -"scopes." +"Return a dictionary of the global variables in the current execution frame, " +"or ``NULL`` if no frame is currently executing." msgstr "" +"現在の実行フレーム内のグローバル変数の辞書か、実行中のフレームがなければ " +"``NULL`` を返します。" -#: ../../c-api/reflection.rst:32 +#: ../../c-api/reflection.rst:28 msgid "" -"As this function returns a :term:`borrowed reference`, the dictionary " -"returned for :term:`optimized scopes ` is cached on the " -"frame object and will remain alive as long as the frame object does. Unlike :" -"c:func:`PyEval_GetFrameLocals` and :func:`locals`, subsequent calls to this " -"function in the same frame will update the contents of the cached dictionary " -"to reflect changes in the state of the local variables rather than returning " -"a new snapshot." +"Return the current thread state's frame, which is ``NULL`` if no frame is " +"currently executing." msgstr "" +"現在のスレッド状態のフレームを返します。現在実行中のフレームがなければ " +"``NULL`` を返します。" -#: ../../c-api/reflection.rst:39 -msgid "" -"As part of :pep:`667`, :c:func:`PyFrame_GetLocals`, :func:`locals`, and :" -"attr:`FrameType.f_locals ` no longer make use of the shared " -"cache dictionary. Refer to the :ref:`What's New entry ` for additional details." +#: ../../c-api/reflection.rst:31 +msgid "See also :c:func:`PyThreadState_GetFrame`." msgstr "" -#: ../../c-api/reflection.rst:50 -msgid "Use :c:func:`PyEval_GetFrameGlobals` instead." +#: ../../c-api/reflection.rst:36 +msgid "Get the *frame* next outer frame." msgstr "" -#: ../../c-api/reflection.rst:52 -msgid "" -"Return a dictionary of the global variables in the current execution frame, " -"or ``NULL`` if no frame is currently executing." +#: ../../c-api/reflection.rst:38 +msgid "Return a strong reference, or ``NULL`` if *frame* has no outer frame." msgstr "" -"現在の実行フレーム内のグローバル変数の辞書か、実行中のフレームがなければ " -"``NULL`` を返します。" -#: ../../c-api/reflection.rst:58 -msgid "" -"Return the :term:`attached thread state`'s frame, which is ``NULL`` if no " -"frame is currently executing." +#: ../../c-api/reflection.rst:40 ../../c-api/reflection.rst:60 +msgid "*frame* must not be ``NULL``." msgstr "" -#: ../../c-api/reflection.rst:61 -msgid "See also :c:func:`PyThreadState_GetFrame`." +#: ../../c-api/reflection.rst:47 +msgid "Get the *frame* code." msgstr "" -#: ../../c-api/reflection.rst:74 -msgid "" -"Return a dictionary of the local variables in the current execution frame, " -"or ``NULL`` if no frame is currently executing. Equivalent to calling :func:" -"`locals` in Python code." +#: ../../c-api/reflection.rst:49 +msgid "Return a strong reference." msgstr "" -#: ../../c-api/reflection.rst:78 +#: ../../c-api/reflection.rst:51 msgid "" -"To access :attr:`~frame.f_locals` on the current frame without making an " -"independent snapshot in :term:`optimized scopes `, call :c:" -"func:`PyFrame_GetLocals` on the result of :c:func:`PyEval_GetFrame`." +"*frame* must not be ``NULL``. The result (frame code) cannot be ``NULL``." msgstr "" -#: ../../c-api/reflection.rst:87 -msgid "" -"Return a dictionary of the global variables in the current execution frame, " -"or ``NULL`` if no frame is currently executing. Equivalent to calling :func:" -"`globals` in Python code." -msgstr "" +#: ../../c-api/reflection.rst:58 +msgid "Return the line number that *frame* is currently executing." +msgstr "*frame* が現在実行している行番号を返します。" -#: ../../c-api/reflection.rst:96 +#: ../../c-api/reflection.rst:65 msgid "" "Return the name of *func* if it is a function, class or instance object, " "else the name of *func*\\s type." @@ -128,7 +100,7 @@ msgstr "" "*func* が関数、クラス、インスタンスオブジェクトであればその名前を、そうでなけ" "れば *func* の型を返します。" -#: ../../c-api/reflection.rst:102 +#: ../../c-api/reflection.rst:71 msgid "" "Return a description string, depending on the type of *func*. Return values " "include \"()\" for functions and methods, \" constructor\", \" instance\", " diff --git a/c-api/sequence.po b/c-api/sequence.po index 14d7bf89b..1639be3f6 100644 --- a/c-api/sequence.po +++ b/c-api/sequence.po @@ -1,27 +1,28 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Arihiro TAKASE, 2023 -# tomo, 2023 -# Nozomu Kaneko , 2023 +# Arihiro TAKASE, 2017 +# Nakamura Masahito , 2018 +# Osamu NAKAMURA, 2019 +# tomo, 2021 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:50+0000\n" -"Last-Translator: Nozomu Kaneko , 2023\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 17:38+0000\n" +"Last-Translator: tomo, 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/sequence.rst:6 @@ -30,12 +31,19 @@ msgstr "シーケンス型プロトコル (sequence protocol)" #: ../../c-api/sequence.rst:11 msgid "" -"Return ``1`` if the object provides the sequence protocol, and ``0`` " -"otherwise. Note that it returns ``1`` for Python classes with a :meth:" -"`~object.__getitem__` method, unless they are :class:`dict` subclasses, " -"since in general it is impossible to determine what type of keys the class " -"supports. This function always succeeds." +"Return ``1`` if the object provides sequence protocol, and ``0`` otherwise. " +"Note that it returns ``1`` for Python classes with a :meth:`__getitem__` " +"method unless they are :class:`dict` subclasses since in general case it is " +"impossible to determine what the type of keys it supports. This function " +"always succeeds." msgstr "" +"オブジェクトがシーケンス型プロトコルを提供している場合は ``1`` を、そうでない" +"場合は ``0`` を返します。\n" +":meth:`__getitem__` メソッドを持つ Python クラスについては、それらが :class:" +"`dict` のサブクラスでない限り、 ``1`` を返すのに注意してください。そうなる理" +"由は、一般的なケースではオブジェクトがどの種類のキーをサポートしているかを判" +"別するのが不可能だからです。 \n" +"この関数は常に成功します。" #: ../../c-api/sequence.rst:23 msgid "" @@ -113,8 +121,8 @@ msgstr "" #: ../../c-api/sequence.rst:72 msgid "" -"If *v* is ``NULL``, the element is deleted, but this feature is deprecated " -"in favour of using :c:func:`PySequence_DelItem`." +"If *v* is ``NULL``, the element is deleted, however this feature is " +"deprecated in favour of using :c:func:`PySequence_DelItem`." msgstr "" "*v* が ``NULL`` の場合はその要素が削除されますが、この機能は非推奨であり、 :" "c:func:`PyObject_DelAttr` を使うのが望ましいです。" @@ -164,16 +172,6 @@ msgstr "" "生すると ``-1`` を返します。Python の式 ``value in o`` と同じです。" #: ../../c-api/sequence.rst:110 -msgid "Alias for :c:func:`PySequence_Contains`." -msgstr "" - -#: ../../c-api/sequence.rst:112 -msgid "" -"The function is :term:`soft deprecated` and should no longer be used to " -"write new code." -msgstr "" - -#: ../../c-api/sequence.rst:119 msgid "" "Return the first index *i* for which ``o[i] == value``. On error, return " "``-1``. This is equivalent to the Python expression ``o.index(value)``." @@ -181,7 +179,7 @@ msgstr "" "``o[i] == value`` となる最初に見つかったインデクス *i* を返します。エラーが発" "生すると ``-1`` を返します。Python の式 ``o.index(value)`` と同じです。" -#: ../../c-api/sequence.rst:125 +#: ../../c-api/sequence.rst:116 msgid "" "Return a list object with the same contents as the sequence or iterable *o*, " "or ``NULL`` on failure. The returned list is guaranteed to be new. This is " @@ -193,7 +191,7 @@ msgstr "" "返されるリストは新しく作られたことが保証されています。\n" "これは Python の式 ``list(o)`` と同等です。" -#: ../../c-api/sequence.rst:134 +#: ../../c-api/sequence.rst:125 msgid "" "Return a tuple object with the same contents as the sequence or iterable " "*o*, or ``NULL`` on failure. If *o* is a tuple, a new reference will be " @@ -206,19 +204,19 @@ msgstr "" "それ以外の場合、適切な内容が入ったタプルを構築して返します。\n" "Pythonの式 ``tuple(o)`` と同等です。" -#: ../../c-api/sequence.rst:142 +#: ../../c-api/sequence.rst:133 msgid "" "Return the sequence or iterable *o* as an object usable by the other " "``PySequence_Fast*`` family of functions. If the object is not a sequence or " "iterable, raises :exc:`TypeError` with *m* as the message text. Returns " "``NULL`` on failure." msgstr "" -"シーケンスまたはイテラブルの *o* を ``PySequence_Fast*`` ファミリの関数で利用" +"シーケンスまたはイテラブルの *o* を``PySequence_Fast*`` ファミリの関数で利用" "できるオブジェクトとして返します。オブジェクトがシーケンスでもイテラブルでも" -"ない場合は、メッセージ *m* を持つ、 :exc:`TypeError` を送出します。失敗した" +"ない場合は、メッセージ *m* を持つ、 :exec:`TypeError` を送出します。失敗した" "ら ``NULL`` を返します。" -#: ../../c-api/sequence.rst:147 +#: ../../c-api/sequence.rst:138 msgid "" "The ``PySequence_Fast*`` functions are thus named because they assume *o* is " "a :c:type:`PyTupleObject` or a :c:type:`PyListObject` and access the data " @@ -228,7 +226,7 @@ msgstr "" "は :c:type:`PyListObject` と仮定し、*o* のデータフィールドに直接アクセスする" "ため、そのように名付けられています。" -#: ../../c-api/sequence.rst:151 +#: ../../c-api/sequence.rst:142 msgid "" "As a CPython implementation detail, if *o* is already a sequence or list, it " "will be returned." @@ -236,11 +234,11 @@ msgstr "" "CPythonの実装では、もし *o* が 既にシーケンスかタプルであれば、*o* そのものを" "返します。" -#: ../../c-api/sequence.rst:157 +#: ../../c-api/sequence.rst:148 msgid "" "Returns the length of *o*, assuming that *o* was returned by :c:func:" -"`PySequence_Fast` and that *o* is not ``NULL``. The size can also be " -"retrieved by calling :c:func:`PySequence_Size` on *o*, but :c:func:" +"`PySequence_Fast` and that *o* is not ``NULL``. The size can also be gotten " +"by calling :c:func:`PySequence_Size` on *o*, but :c:func:" "`PySequence_Fast_GET_SIZE` is faster because it can assume *o* is a list or " "tuple." msgstr "" @@ -249,7 +247,7 @@ msgstr "" "を呼び出しても得られますが、 :c:func:`PySequence_Fast_GET_SIZE` の方が *o* を" "リストかタプルであると仮定して処理するため、より高速です。" -#: ../../c-api/sequence.rst:166 +#: ../../c-api/sequence.rst:157 msgid "" "Return the *i*\\ th element of *o*, assuming that *o* was returned by :c:" "func:`PySequence_Fast`, *o* is not ``NULL``, and that *i* is within bounds." @@ -258,7 +256,7 @@ msgstr "" "り、かつ *i* がインデクスの範囲内にあると仮定して、 *o* の *i* 番目の要素を返" "します。" -#: ../../c-api/sequence.rst:172 +#: ../../c-api/sequence.rst:163 msgid "" "Return the underlying array of PyObject pointers. Assumes that *o* was " "returned by :c:func:`PySequence_Fast` and *o* is not ``NULL``." @@ -267,7 +265,7 @@ msgstr "" "`PySequence_Fast` の返したオブジェクトであり、 ``NULL`` でないものと仮定して" "います。" -#: ../../c-api/sequence.rst:175 +#: ../../c-api/sequence.rst:166 msgid "" "Note, if a list gets resized, the reallocation may relocate the items array. " "So, only use the underlying array pointer in contexts where the sequence " @@ -277,7 +275,7 @@ msgstr "" "ないことに注意してください。そのため、シーケンスの変更が発生しないコンテキス" "トでのみ背後にあるポインタを使ってください。" -#: ../../c-api/sequence.rst:182 +#: ../../c-api/sequence.rst:173 msgid "" "Return the *i*\\ th element of *o* or ``NULL`` on failure. Faster form of :c:" "func:`PySequence_GetItem` but without checking that :c:func:" @@ -287,15 +285,3 @@ msgstr "" "*o* の *i* 番目の要素を返し、失敗すると ``NULL`` を返します。 :c:func:" "`PySequence_GetItem` の高速版であり、:c:func:`PySequence_Check` で *o* が真を" "返すかどうかの検証や、負の添え字の調整を行いません。 " - -#: ../../c-api/sequence.rst:21 ../../c-api/sequence.rst:132 -msgid "built-in function" -msgstr "組み込み関数" - -#: ../../c-api/sequence.rst:21 -msgid "len" -msgstr "len" - -#: ../../c-api/sequence.rst:132 -msgid "tuple" -msgstr "tuple" diff --git a/c-api/set.po b/c-api/set.po index 97d3c6447..36e855f01 100644 --- a/c-api/set.po +++ b/c-api/set.po @@ -1,27 +1,28 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Arihiro TAKASE, 2023 -# tomo, 2023 -# Nozomu Kaneko , 2023 +# Nozomu Kaneko , 2017 +# Osamu NAKAMURA, 2017 +# Arihiro TAKASE, 2017 +# tomo, 2020 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-30 14:22+0000\n" -"PO-Revision-Date: 2021-06-28 00:50+0000\n" -"Last-Translator: Nozomu Kaneko , 2023\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-07 05:06+0000\n" +"PO-Revision-Date: 2017-02-16 17:38+0000\n" +"Last-Translator: tomo, 2020\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/set.rst:6 @@ -31,14 +32,14 @@ msgstr "Set オブジェクト" #: ../../c-api/set.rst:15 msgid "" "This section details the public API for :class:`set` and :class:`frozenset` " -"objects. Any functionality not listed below is best accessed using either " -"the abstract object protocol (including :c:func:`PyObject_CallMethod`, :c:" -"func:`PyObject_RichCompareBool`, :c:func:`PyObject_Hash`, :c:func:" -"`PyObject_Repr`, :c:func:`PyObject_IsTrue`, :c:func:`PyObject_Print`, and :c:" -"func:`PyObject_GetIter`) or the abstract number protocol (including :c:func:" -"`PyNumber_And`, :c:func:`PyNumber_Subtract`, :c:func:`PyNumber_Or`, :c:func:" -"`PyNumber_Xor`, :c:func:`PyNumber_InPlaceAnd`, :c:func:" -"`PyNumber_InPlaceSubtract`, :c:func:`PyNumber_InPlaceOr`, and :c:func:" +"objects. Any functionality not listed below is best accessed using the " +"either the abstract object protocol (including :c:func:" +"`PyObject_CallMethod`, :c:func:`PyObject_RichCompareBool`, :c:func:" +"`PyObject_Hash`, :c:func:`PyObject_Repr`, :c:func:`PyObject_IsTrue`, :c:func:" +"`PyObject_Print`, and :c:func:`PyObject_GetIter`) or the abstract number " +"protocol (including :c:func:`PyNumber_And`, :c:func:`PyNumber_Subtract`, :c:" +"func:`PyNumber_Or`, :c:func:`PyNumber_Xor`, :c:func:`PyNumber_InPlaceAnd`, :" +"c:func:`PyNumber_InPlaceSubtract`, :c:func:`PyNumber_InPlaceOr`, and :c:func:" "`PyNumber_InPlaceXor`)." msgstr "" "このセクションでは :class:`set` と :class:`frozenset` の公開 API について詳し" @@ -58,17 +59,17 @@ msgid "" "`PyDictObject` in that it is a fixed size for small sets (much like tuple " "storage) and will point to a separate, variable sized block of memory for " "medium and large sized sets (much like list storage). None of the fields of " -"this structure should be considered public and all are subject to change. " -"All access should be done through the documented API rather than by " -"manipulating the values in the structure." +"this structure should be considered public and are subject to change. All " +"access should be done through the documented API rather than by manipulating " +"the values in the structure." msgstr "" "この :c:type:`PyObject` を継承した型は、 :class:`set` と :class:`frozenset` " "両方の内部データを保存するのに用いられます。 :c:type:`PyDictObject` と同じよ" "うに、小さい集合(set)に対しては(タプルのように)固定サイズであり、そうでない集" "合に対しては(リストと同じように)可変長のメモリブロックを用います。この構造体" -"のどのフィールドも、公開されていると考えるべきではなく、変更される可能性があ" -"ります。すべてのアクセスは、構造体の中の値を直接操作するのではなく、ドキュメ" -"ントされた API を用いて行うべきです。" +"のどのフィールドも、非公開で変更される可能性があると考えて下さい。すべてのア" +"クセスは、構造体の中の値を直接操作するのではなく、ドキュメントされた API を用" +"いて行うべきです。" #: ../../c-api/set.rst:40 msgid "" @@ -119,15 +120,7 @@ msgstr "" "*p* が :class:`set` か :class:`frozenset` 、あるいはそのサブタイプのオブジェ" "クトであれば、true を返します。この関数は常に成功します。" -#: ../../c-api/set.rst:70 -msgid "" -"Return true if *p* is a :class:`set` object but not an instance of a " -"subtype. This function always succeeds." -msgstr "" -"*p* が :class:`set` オブジェクトだがサブタイプのインスタンスでない場合に真を" -"返します。この関数は常に成功します。" - -#: ../../c-api/set.rst:77 +#: ../../c-api/set.rst:71 msgid "" "Return true if *p* is a :class:`set` object or a :class:`frozenset` object " "but not an instance of a subtype. This function always succeeds." @@ -136,7 +129,7 @@ msgstr "" "に true を返します。サブタイプのオブジェクトは含みません。この関数は常に成功" "します。" -#: ../../c-api/set.rst:83 +#: ../../c-api/set.rst:77 msgid "" "Return true if *p* is a :class:`frozenset` object but not an instance of a " "subtype. This function always succeeds." @@ -144,7 +137,7 @@ msgstr "" "*p* が :class:`frozenset` オブジェクトだがサブタイプのインスタンスでない場合" "に真を返します。この関数は常に成功します。" -#: ../../c-api/set.rst:89 +#: ../../c-api/set.rst:83 msgid "" "Return a new :class:`set` containing objects returned by the *iterable*. " "The *iterable* may be ``NULL`` to create a new empty set. Return the new " @@ -158,7 +151,7 @@ msgstr "" "*iterable* がイテレート可能でない場合は、 :exc:`TypeError` を送出します。\n" "このコンストラクタは set をコピーするときにも使えます (``c=set(s)``)。" -#: ../../c-api/set.rst:98 +#: ../../c-api/set.rst:92 msgid "" "Return a new :class:`frozenset` containing objects returned by the " "*iterable*. The *iterable* may be ``NULL`` to create a new empty frozenset. " @@ -170,7 +163,7 @@ msgstr "" "成功時には新しい set を、失敗時には ``NULL`` を返します。\n" "*iterable* がイテレート可能でない場合は、 :exc:`TypeError` を送出します。" -#: ../../c-api/set.rst:104 +#: ../../c-api/set.rst:98 msgid "" "The following functions and macros are available for instances of :class:" "`set` or :class:`frozenset` or instances of their subtypes." @@ -178,31 +171,42 @@ msgstr "" "以降の関数やマクロは、 :class:`set` と :class:`frozenset` とそのサブタイプの" "インスタンスに対して利用できます。" -#: ../../c-api/set.rst:112 +#: ../../c-api/set.rst:106 msgid "" "Return the length of a :class:`set` or :class:`frozenset` object. Equivalent " -"to ``len(anyset)``. Raises a :exc:`SystemError` if *anyset* is not a :class:" -"`set`, :class:`frozenset`, or an instance of a subtype." +"to ``len(anyset)``. Raises a :exc:`PyExc_SystemError` if *anyset* is not a :" +"class:`set`, :class:`frozenset`, or an instance of a subtype." msgstr "" +":class:`set` や :class:`frozenset` のオブジェクトの長さを返します。 " +"``len(anyset)`` と同じです。 *anyset* が :class:`set` 、 :class:`frozenset` " +"およびそのサブタイプのオブジェクトでない場合は、 :exc:`PyExc_SystemError` を" +"送出します。" -#: ../../c-api/set.rst:119 +#: ../../c-api/set.rst:113 msgid "Macro form of :c:func:`PySet_Size` without error checking." msgstr "エラーチェックを行わない、 :c:func:`PySet_Size` のマクロ形式。" -#: ../../c-api/set.rst:124 +#: ../../c-api/set.rst:118 msgid "" "Return ``1`` if found, ``0`` if not found, and ``-1`` if an error is " -"encountered. Unlike the Python :meth:`~object.__contains__` method, this " -"function does not automatically convert unhashable sets into temporary " -"frozensets. Raise a :exc:`TypeError` if the *key* is unhashable. Raise :exc:" -"`SystemError` if *anyset* is not a :class:`set`, :class:`frozenset`, or an " -"instance of a subtype." +"encountered. Unlike the Python :meth:`__contains__` method, this function " +"does not automatically convert unhashable sets into temporary frozensets. " +"Raise a :exc:`TypeError` if the *key* is unhashable. Raise :exc:" +"`PyExc_SystemError` if *anyset* is not a :class:`set`, :class:`frozenset`, " +"or an instance of a subtype." msgstr "" +"見つかったら ``1`` を、見つからなかったら ``0`` を、エラーが発生した場合は " +"``-1`` を返します。\n" +"Python の :meth:`__contains__` メソッドと違って、この関数は非ハッシュ set を" +"一時的な frozenset に自動で変換しません。\n" +"*key* がハッシュ可能で無い場合、 :exc:`TypeError` を送出します。\n" +"*anyset* が :class:`set`, :class:`frozenset` 及びそのサブタイプのオブジェクト" +"で無い場合は :exc:`PyExc_SystemError` を送出します。" -#: ../../c-api/set.rst:133 +#: ../../c-api/set.rst:127 msgid "" "Add *key* to a :class:`set` instance. Also works with :class:`frozenset` " -"instances (like :c:func:`PyTuple_SetItem` it can be used to fill in the " +"instances (like :c:func:`PyTuple_SetItem` it can be used to fill-in the " "values of brand new frozensets before they are exposed to other code). " "Return ``0`` on success or ``-1`` on failure. Raise a :exc:`TypeError` if " "the *key* is unhashable. Raise a :exc:`MemoryError` if there is no room to " @@ -218,7 +222,7 @@ msgstr "" "*set* が :class:`set` かそのサブタイプのインスタンスでない場合は、 :exc:" "`SystemError` を送出します。" -#: ../../c-api/set.rst:142 +#: ../../c-api/set.rst:136 msgid "" "The following functions are available for instances of :class:`set` or its " "subtypes but not for instances of :class:`frozenset` or its subtypes." @@ -226,17 +230,27 @@ msgstr "" "以降の関数は、 :class:`set` とそのサブタイプに対して利用可能です。 :class:" "`frozenset` とそのサブタイプには利用できません。" -#: ../../c-api/set.rst:148 +#: ../../c-api/set.rst:142 msgid "" "Return ``1`` if found and removed, ``0`` if not found (no action taken), and " "``-1`` if an error is encountered. Does not raise :exc:`KeyError` for " "missing keys. Raise a :exc:`TypeError` if the *key* is unhashable. Unlike " -"the Python :meth:`~frozenset.discard` method, this function does not " -"automatically convert unhashable sets into temporary frozensets. Raise :exc:" -"`SystemError` if *set* is not an instance of :class:`set` or its subtype." +"the Python :meth:`~set.discard` method, this function does not automatically " +"convert unhashable sets into temporary frozensets. Raise :exc:" +"`PyExc_SystemError` if *set* is not an instance of :class:`set` or its " +"subtype." msgstr "" +"*key* が見つかって、値を削除したら ``1`` を返します。\n" +"見つからなかったら (何もせずに) ``0`` を返します。\n" +"エラーが発生した場合は ``-1`` を返します。\n" +"*key* が無くても :exc:`KeyError` を送出しません。\n" +"*key* がハッシュ可能でない場合は :exc:`TypeError` を送出します。\n" +"Python の :meth:`~set.discard` メソッドと違って、この関数は非ハッシュ set を" +"一時的な frozenset に変換しません。\n" +"*set* が :class:`set` かそのサブタイプのインスタンスでないときは、 :exc:" +"`PyExc_SystemError` を送出します。" -#: ../../c-api/set.rst:158 +#: ../../c-api/set.rst:152 msgid "" "Return a new reference to an arbitrary object in the *set*, and removes the " "object from the *set*. Return ``NULL`` on failure. Raise :exc:`KeyError` " @@ -250,29 +264,6 @@ msgstr "" "*set* が :class:`set` とそのサブタイプのインスタンスでない場合は、 :exc:" "`SystemError` を送出します。" -#: ../../c-api/set.rst:166 -msgid "" -"Empty an existing set of all elements. Return ``0`` on success. Return " -"``-1`` and raise :exc:`SystemError` if *set* is not an instance of :class:" -"`set` or its subtype." -msgstr "" - -#: ../../c-api/set.rst:11 -msgid "object" -msgstr "object" - -#: ../../c-api/set.rst:11 -msgid "set" -msgstr "集合" - -#: ../../c-api/set.rst:11 -msgid "frozenset" -msgstr "frozenset" - -#: ../../c-api/set.rst:110 -msgid "built-in function" -msgstr "組み込み関数" - -#: ../../c-api/set.rst:110 -msgid "len" -msgstr "len" +#: ../../c-api/set.rst:160 +msgid "Empty an existing set of all elements." +msgstr "set を空にします。" diff --git a/c-api/slice.po b/c-api/slice.po index 6eb0eed29..082220bb3 100644 --- a/c-api/slice.po +++ b/c-api/slice.po @@ -1,27 +1,27 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 -# Arihiro TAKASE, 2023 -# 石井明久, 2024 +# Arihiro TAKASE, 2017 +# Osamu NAKAMURA, 2017 +# tomo, 2020 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-30 14:22+0000\n" -"PO-Revision-Date: 2021-06-28 00:50+0000\n" -"Last-Translator: 石井明久, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-07 05:06+0000\n" +"PO-Revision-Date: 2017-02-16 17:38+0000\n" +"Last-Translator: tomo, 2020\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/slice.rst:6 @@ -49,16 +49,16 @@ msgid "" "Return a new slice object with the given values. The *start*, *stop*, and " "*step* parameters are used as the values of the slice object attributes of " "the same names. Any of the values may be ``NULL``, in which case the " -"``None`` will be used for the corresponding attribute." -msgstr "" - -#: ../../c-api/slice.rst:28 -msgid "" -"Return ``NULL`` with an exception set if the new object could not be " -"allocated." +"``None`` will be used for the corresponding attribute. Return ``NULL`` if " +"the new object could not be allocated." msgstr "" +"指定した値から新たなスライスオブジェクトを返します。パラメタ *start*, " +"*stop*, および *step* はスライスオブジェクトにおける同名の属性として用いられ" +"ます。これらの値はいずれも ``NULL`` にでき、対応する値には ``None`` が使われ" +"ます。新たなオブジェクトをアロケーションできない場合には ``NULL`` を返しま" +"す。" -#: ../../c-api/slice.rst:34 +#: ../../c-api/slice.rst:32 msgid "" "Retrieve the start, stop and step indices from the slice object *slice*, " "assuming a sequence of length *length*. Treats indices greater than *length* " @@ -68,23 +68,27 @@ msgstr "" "クス値を取得します。このときシーケンスの長さを *length* と仮定します。" "*length* よりも大きなインデクスになるとエラーとして扱います。" -#: ../../c-api/slice.rst:38 +#: ../../c-api/slice.rst:36 msgid "" "Returns ``0`` on success and ``-1`` on error with no exception set (unless " -"one of the indices was not ``None`` and failed to be converted to an " +"one of the indices was not :const:`None` and failed to be converted to an " "integer, in which case ``-1`` is returned with an exception set)." msgstr "" +"成功のときには ``0`` を、エラーのときには例外をセットせずに ``-1`` を返しま" +"す (ただし、指定インデクスのいずれか一つが :const:`None` ではなく、かつ整数に" +"変換できなかった場合を除きます。この場合、 ``-1`` を返して例外をセットしま" +"す)。" -#: ../../c-api/slice.rst:42 +#: ../../c-api/slice.rst:40 msgid "You probably do not want to use this function." msgstr "おそらく、あなたはこの関数を使いたくないでしょう。" -#: ../../c-api/slice.rst:44 ../../c-api/slice.rst:75 +#: ../../c-api/slice.rst:42 ../../c-api/slice.rst:73 msgid "" "The parameter type for the *slice* parameter was ``PySliceObject*`` before." msgstr "以前は、*slice* 引数の型は ``PySliceObject*`` でした。" -#: ../../c-api/slice.rst:51 +#: ../../c-api/slice.rst:49 msgid "" "Usable replacement for :c:func:`PySlice_GetIndices`. Retrieve the start, " "stop, and step indices from the slice object *slice* assuming a sequence of " @@ -97,38 +101,23 @@ msgstr "" "*length* 、スライスの長さを *slicelength* に格納します。境界外のインデクスは" "通常のスライスと一貫した方法でクリップされます。" -#: ../../c-api/slice.rst:57 -msgid "Return ``0`` on success and ``-1`` on error with an exception set." +#: ../../c-api/slice.rst:55 +msgid "Returns ``0`` on success and ``-1`` on error with exception set." msgstr "" +"成功のときには ``0`` を、エラーのときには例外をセットして ``-1`` を返します。" -#: ../../c-api/slice.rst:60 +#: ../../c-api/slice.rst:58 msgid "" "This function is considered not safe for resizable sequences. Its invocation " "should be replaced by a combination of :c:func:`PySlice_Unpack` and :c:func:" "`PySlice_AdjustIndices` where ::" msgstr "" -#: ../../c-api/slice.rst:64 -msgid "" -"if (PySlice_GetIndicesEx(slice, length, &start, &stop, &step, &slicelength) " -"< 0) {\n" -" // return error\n" -"}" -msgstr "" - -#: ../../c-api/slice.rst:68 +#: ../../c-api/slice.rst:66 msgid "is replaced by ::" msgstr "" -#: ../../c-api/slice.rst:70 -msgid "" -"if (PySlice_Unpack(slice, &start, &stop, &step) < 0) {\n" -" // return error\n" -"}\n" -"slicelength = PySlice_AdjustIndices(length, &start, &stop, step);" -msgstr "" - -#: ../../c-api/slice.rst:79 +#: ../../c-api/slice.rst:77 msgid "" "If ``Py_LIMITED_API`` is not set or set to the value between ``0x03050400`` " "and ``0x03060000`` (not including) or ``0x03060100`` or higher :c:func:`!" @@ -137,14 +126,14 @@ msgid "" "*stop* and *step* are evaluated more than once." msgstr "" -#: ../../c-api/slice.rst:86 +#: ../../c-api/slice.rst:84 msgid "" "If ``Py_LIMITED_API`` is set to the value less than ``0x03050400`` or " "between ``0x03060000`` and ``0x03060100`` (not including) :c:func:`!" "PySlice_GetIndicesEx` is a deprecated function." msgstr "" -#: ../../c-api/slice.rst:94 +#: ../../c-api/slice.rst:92 msgid "" "Extract the start, stop and step data members from a slice object as C " "integers. Silently reduce values larger than ``PY_SSIZE_T_MAX`` to " @@ -153,42 +142,34 @@ msgid "" "less than ``-PY_SSIZE_T_MAX`` to ``-PY_SSIZE_T_MAX``." msgstr "" -#: ../../c-api/slice.rst:100 -msgid "Return ``-1`` with an exception set on error, ``0`` on success." +#: ../../c-api/slice.rst:98 +msgid "Return ``-1`` on error, ``0`` on success." msgstr "" -#: ../../c-api/slice.rst:107 +#: ../../c-api/slice.rst:105 msgid "" "Adjust start/end slice indices assuming a sequence of the specified length. " "Out of bounds indices are clipped in a manner consistent with the handling " "of normal slices." msgstr "" -#: ../../c-api/slice.rst:111 +#: ../../c-api/slice.rst:109 msgid "" "Return the length of the slice. Always successful. Doesn't call Python " "code." msgstr "" -#: ../../c-api/slice.rst:118 +#: ../../c-api/slice.rst:116 msgid "Ellipsis Object" msgstr "Ellipsis オブジェクト" -#: ../../c-api/slice.rst:123 +#: ../../c-api/slice.rst:121 msgid "" -"The type of Python :const:`Ellipsis` object. Same as :class:`types." -"EllipsisType` in the Python layer." +"The Python ``Ellipsis`` object. This object has no methods. It needs to be " +"treated just like any other object with respect to reference counts. Like :" +"c:data:`Py_None` it is a singleton object." msgstr "" - -#: ../../c-api/slice.rst:129 -msgid "" -"The Python ``Ellipsis`` object. This object has no methods. Like :c:data:" -"`Py_None`, it is an :term:`immortal` singleton object." -msgstr "" -"Python の ``Ellipsis`` オブジェクト。このオブジェクトにはメソッドがありませ" -"ん。 :c:data:`Py_None` と同様、これは :term:`immortal` でシングルトンなオブ" -"ジェクトです。" - -#: ../../c-api/slice.rst:132 -msgid ":c:data:`Py_Ellipsis` is immortal." -msgstr ":c:data:`Py_Ellipsis` は immortal です。" +"Python における ``Ellipsis`` オブジェクトです。\n" +"このオブジェクトはメソッドを持ちません。\n" +"参照カウントの点では、他のオブジェクトと同様に扱う必要があります。 \n" +":c:data:`Py_None` のように、これもシングルトンオブジェクトです。" diff --git a/c-api/stable.po b/c-api/stable.po index bd0be79b6..38fd230e4 100644 --- a/c-api/stable.po +++ b/c-api/stable.po @@ -1,376 +1,99 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 -# Skydelta, 2023 -# 石井明久, 2024 +# E. Kawashima, 2017 +# Nozomu Kaneko , 2017 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-06 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:50+0000\n" -"Last-Translator: 石井明久, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 17:39+0000\n" +"Last-Translator: Nozomu Kaneko , 2017\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/stable.rst:7 -msgid "C API Stability" -msgstr "C API の安定性" +msgid "Stable Application Binary Interface" +msgstr "安定 ABI (Stable Appliction Binary Interface)" #: ../../c-api/stable.rst:9 msgid "" -"Unless documented otherwise, Python's C API is covered by the Backwards " -"Compatibility Policy, :pep:`387`. Most changes to it are source-compatible " -"(typically by only adding new API). Changing existing API or removing API is " -"only done after a deprecation period or to fix serious issues." -msgstr "" - -#: ../../c-api/stable.rst:15 -msgid "" -"CPython's Application Binary Interface (ABI) is forward- and backwards-" -"compatible across a minor release (if these are compiled the same way; see :" -"ref:`stable-abi-platform` below). So, code compiled for Python 3.10.0 will " -"work on 3.10.8 and vice versa, but will need to be compiled separately for " -"3.9.x and 3.11.x." -msgstr "" - -#: ../../c-api/stable.rst:21 -msgid "There are two tiers of C API with different stability expectations:" -msgstr "" +"Traditionally, the C API of Python will change with every release. Most " +"changes will be source-compatible, typically by only adding API, rather than " +"changing existing API or removing API (although some interfaces do get " +"removed after being deprecated first)." +msgstr "" +"伝統的に Python の C API はリリース毎に変更されます。多くの変更はソース互換性" +"を保っていて、既存の API を変更したり取り除いたりすることはありません (ただ" +"し、いくつかの API は、一旦非推奨と指定された後に、削除されます)。" + +#: ../../c-api/stable.rst:14 +msgid "" +"Unfortunately, the API compatibility does not extend to binary compatibility " +"(the ABI). The reason is primarily the evolution of struct definitions, " +"where addition of a new field, or changing the type of a field, might not " +"break the API, but can break the ABI. As a consequence, extension modules " +"need to be recompiled for every Python release (although an exception is " +"possible on Unix when none of the affected interfaces are used). In " +"addition, on Windows, extension modules link with a specific pythonXY.dll " +"and need to be recompiled to link with a newer one." +msgstr "" +"残念ながら API の互換性はバイナリレベルの互換性 (ABI) までには適用されませ" +"ん。その理由は主に、構造体フィールドの新規追加や型の変更によって、たとえ API " +"は壊れなくても ABI は壊れてしまうからです。その結果として、拡張モジュールを " +"Python のリリース毎に再コンパイルする必要があります (Unix でその影響を受ける" +"インターフェイスが使用されていない場合は例外かもしれませんが)。また、 " +"Windows では、何らかの pythonXY.dll とリンクしている拡張モジュールは、再コン" +"パイルした後に新しい dll とリンクし直す必要があります。" #: ../../c-api/stable.rst:23 msgid "" -":ref:`Unstable API `, may change in minor versions without a " -"deprecation period. It is marked by the ``PyUnstable`` prefix in names." -msgstr "" - -#: ../../c-api/stable.rst:25 -msgid "" -":ref:`Limited API `, is compatible across several minor " -"releases. When :c:macro:`Py_LIMITED_API` is defined, only this subset is " -"exposed from ``Python.h``." +"Since Python 3.2, a subset of the API has been declared to guarantee a " +"stable ABI. Extension modules wishing to use this API (called \"limited " +"API\") need to define ``Py_LIMITED_API``. A number of interpreter details " +"then become hidden from the extension module; in return, a module is built " +"that works on any 3.x version (x>=2) without recompilation." msgstr "" +"Python 3.2 以降では、安定 ABI を保証するための API サブセットが宣言されていま" +"す。拡張モジュールでこのAPI (\"limited API\" と呼ばれます) を使うには " +"``Py_LIMITED_API`` を定義してください。拡張モジュールの細部は大部分隠蔽され、" +"代わりに再コンパイルなしにバージョン 3.x (x>=2) 上で動くモジュールがビルドさ" +"れます。" #: ../../c-api/stable.rst:29 -msgid "These are discussed in more detail below." -msgstr "" - -#: ../../c-api/stable.rst:31 -msgid "" -"Names prefixed by an underscore, such as ``_Py_InternalState``, are private " -"API that can change without notice even in patch releases. If you need to " -"use this API, consider reaching out to `CPython developers `_ to discuss adding public API for your use " -"case." -msgstr "" - -#: ../../c-api/stable.rst:40 -msgid "Unstable C API" -msgstr "" - -#: ../../c-api/stable.rst:44 -msgid "" -"Any API named with the ``PyUnstable`` prefix exposes CPython implementation " -"details, and may change in every minor release (e.g. from 3.9 to 3.10) " -"without any deprecation warnings. However, it will not change in a bugfix " -"release (e.g. from 3.10.0 to 3.10.1)." -msgstr "" - -#: ../../c-api/stable.rst:49 -msgid "" -"It is generally intended for specialized, low-level tools like debuggers." -msgstr "" - -#: ../../c-api/stable.rst:51 -msgid "" -"Projects that use this API are expected to follow CPython development and " -"spend extra effort adjusting to changes." -msgstr "" - -#: ../../c-api/stable.rst:57 -msgid "Stable Application Binary Interface" -msgstr "安定 ABI (Stable Appliction Binary Interface)" - -#: ../../c-api/stable.rst:59 -msgid "" -"For simplicity, this document talks about *extensions*, but the Limited API " -"and Stable ABI work the same way for all uses of the API – for example, " -"embedding Python." -msgstr "" - -#: ../../c-api/stable.rst:66 -msgid "Limited C API" -msgstr "" - -#: ../../c-api/stable.rst:68 -msgid "" -"Python 3.2 introduced the *Limited API*, a subset of Python's C API. " -"Extensions that only use the Limited API can be compiled once and be loaded " -"on multiple versions of Python. Contents of the Limited API are :ref:`listed " -"below `." -msgstr "" - -#: ../../c-api/stable.rst:75 -msgid "" -"Define this macro before including ``Python.h`` to opt in to only use the " -"Limited API, and to select the Limited API version." -msgstr "" -"このマクロを ``Python.h`` をインクルードする前に定義することで、 Limited API " -"のみを使用することを選択し、 Limited API バージョンを選択することができます。" - -#: ../../c-api/stable.rst:78 -msgid "" -"Define ``Py_LIMITED_API`` to the value of :c:macro:`PY_VERSION_HEX` " -"corresponding to the lowest Python version your extension supports. The " -"extension will be ABI-compatible with all Python 3 releases from the " -"specified one onward, and can use Limited API introduced up to that version." -msgstr "" - -#: ../../c-api/stable.rst:84 -msgid "" -"Rather than using the ``PY_VERSION_HEX`` macro directly, hardcode a minimum " -"minor version (e.g. ``0x030A0000`` for Python 3.10) for stability when " -"compiling with future Python versions." -msgstr "" -"``PY_VERSION_HEX`` マクロを直接使うのではなく、将来の Python のバージョンでコ" -"ンパイルするときの安定性のために、最小のマイナーバージョン(例えば、 Python " -"3.10なら ``0x030A0000`` )をハードコードします。" - -#: ../../c-api/stable.rst:88 -msgid "" -"You can also define ``Py_LIMITED_API`` to ``3``. This works the same as " -"``0x03020000`` (Python 3.2, the version that introduced Limited API)." -msgstr "" -"また、 ``Py_LIMITED_API`` を ``3`` に定義することができます。これは " -"``0x03020000`` (Python 3.2, Limited API が導入されたバージョン)と同じように動" -"作します。" - -#: ../../c-api/stable.rst:95 -msgid "Stable ABI" -msgstr "Stable ABI" - -#: ../../c-api/stable.rst:97 -msgid "" -"To enable this, Python provides a *Stable ABI*: a set of symbols that will " -"remain ABI-compatible across Python 3.x versions." -msgstr "" - -#: ../../c-api/stable.rst:102 -msgid "" -"The Stable ABI prevents ABI issues, like linker errors due to missing " -"symbols or data corruption due to changes in structure layouts or function " -"signatures. However, other changes in Python can change the *behavior* of " -"extensions. See Python's Backwards Compatibility Policy (:pep:`387`) for " -"details." -msgstr "" - -#: ../../c-api/stable.rst:108 -msgid "" -"The Stable ABI contains symbols exposed in the :ref:`Limited API `, but also other ones – for example, functions necessary to support " -"older versions of the Limited API." -msgstr "" - -#: ../../c-api/stable.rst:112 -msgid "" -"On Windows, extensions that use the Stable ABI should be linked against " -"``python3.dll`` rather than a version-specific library such as ``python39." -"dll``." -msgstr "" -"Windows では、 Stable ABI を使用する拡張機能は、 ``python39.dll`` のような" -"バージョン固有のライブラリではなく、 ``python3.dll`` に対してリンクする必要が" -"あります。" - -#: ../../c-api/stable.rst:116 -msgid "" -"On some platforms, Python will look for and load shared library files named " -"with the ``abi3`` tag (e.g. ``mymodule.abi3.so``). It does not check if such " -"extensions conform to a Stable ABI. The user (or their packaging tools) need " -"to ensure that, for example, extensions built with the 3.10+ Limited API are " -"not installed for lower versions of Python." -msgstr "" -"いくつかのプラットフォームでは、 Python は ``abi3`` タグで名付けられた共有ラ" -"イブラリファイルを探して読み込みます(例: ``mymodule.abi3.so``)。このような拡" -"張モジュールが Stable ABI に適合しているかどうかはチェックされません。ユー" -"ザー(またはそのパッケージングツール)は、たとえば 3.10+ Limited API でビルドさ" -"れた拡張モジュールが、それ以下のバージョンの Python にインストールされないこ" -"とを確認する必要があります。" - -#: ../../c-api/stable.rst:123 -msgid "" -"All functions in the Stable ABI are present as functions in Python's shared " -"library, not solely as macros. This makes them usable from languages that " -"don't use the C preprocessor." -msgstr "" -"Stable ABI に含まれるすべての関数は、マクロとしてだけでなく、 Python の共有ラ" -"イブラリの関数として存在します。そのため、Cプリプロセッサを使用しない言語から" -"使用することができます。" - -#: ../../c-api/stable.rst:129 -msgid "Limited API Scope and Performance" -msgstr "APIスコープとパフォーマンスの制限" - -#: ../../c-api/stable.rst:131 msgid "" -"The goal for the Limited API is to allow everything that is possible with " -"the full C API, but possibly with a performance penalty." -msgstr "" -"Limited API の目標は、フル C API で可能なすべてのことを実現することですが、お" -"そらく性能上の制約があります。" - -#: ../../c-api/stable.rst:134 -msgid "" -"For example, while :c:func:`PyList_GetItem` is available, its “unsafe” macro " -"variant :c:func:`PyList_GET_ITEM` is not. The macro can be faster because it " -"can rely on version-specific implementation details of the list object." -msgstr "" -"例えば、 :c:func:`PyList_GetItem` は利用可能ですが、その “unsafe” マクロの変" -"種 :c:func:`PyList_GET_ITEM` は利用できません。このマクロは、リストオブジェク" -"トのバージョン固有の実装の詳細に依存することができるため、より高速に処理する" -"ことができます。" - -#: ../../c-api/stable.rst:139 -msgid "" -"Without ``Py_LIMITED_API`` defined, some C API functions are inlined or " -"replaced by macros. Defining ``Py_LIMITED_API`` disables this inlining, " -"allowing stability as Python's data structures are improved, but possibly " -"reducing performance." -msgstr "" -"``Py_LIMITED_API`` を定義しないと、いくつかの C API 関数がインライン化された" -"り、マクロに置き換わったりします。``Py_LIMITED_API`` を定義すると、このインラ" -"イン化が無効になり、 Python のデータ構造が改善されても安定した動作が可能にな" -"りますが、性能が低下する可能性があります。" - -#: ../../c-api/stable.rst:144 -msgid "" -"By leaving out the ``Py_LIMITED_API`` definition, it is possible to compile " -"a Limited API extension with a version-specific ABI. This can improve " -"performance for that Python version, but will limit compatibility. Compiling " -"with ``Py_LIMITED_API`` will then yield an extension that can be distributed " -"where a version-specific one is not available – for example, for prereleases " -"of an upcoming Python version." -msgstr "" -"``Py_LIMITED_API`` の定義を省くことで、 Limited API 拡張をバージョン固有の " -"ABI でコンパイルすることが可能です。これにより、その Python のバージョンでパ" -"フォーマンスを向上させることができますが、互換性は制限されます。" -"``Py_LIMITED_API`` でコンパイルすると、バージョンに依存しない拡張機能が利用で" -"きない場合、例えば、次期 Python バージョンのプレリリースに対応した拡張モ" -"ジュールを配布することができるようになります。" - -#: ../../c-api/stable.rst:153 -msgid "Limited API Caveats" -msgstr "制限付きAPIの注意点" - -#: ../../c-api/stable.rst:155 -msgid "" -"Note that compiling with ``Py_LIMITED_API`` is *not* a complete guarantee " -"that code conforms to the :ref:`Limited API ` or the :ref:" -"`Stable ABI `. ``Py_LIMITED_API`` only covers definitions, but " -"an API also includes other issues, such as expected semantics." -msgstr "" - -#: ../../c-api/stable.rst:160 -msgid "" -"One issue that ``Py_LIMITED_API`` does not guard against is calling a " -"function with arguments that are invalid in a lower Python version. For " -"example, consider a function that starts accepting ``NULL`` for an argument. " -"In Python 3.9, ``NULL`` now selects a default behavior, but in Python 3.8, " -"the argument will be used directly, causing a ``NULL`` dereference and " -"crash. A similar argument works for fields of structs." -msgstr "" -"``Py_LIMITED_API`` が防げない問題の1つは、 Python の下位バージョンでは無効な" -"引数を持つ関数を呼び出すことです。例えば、引数に ``NULL`` を受け取る関数を考" -"えてみましょう。Python 3.9 では ``NULL`` はデフォルトの挙動を選択しますが、" -"Python 3.8 ではこの引数は直接使用され、 ``NULL`` の参照外れを起こしクラッシュ" -"します。同様の引数は、構造体のフィールドに対しても機能します。" - -#: ../../c-api/stable.rst:167 -msgid "" -"Another issue is that some struct fields are currently not hidden when " -"``Py_LIMITED_API`` is defined, even though they're part of the Limited API." -msgstr "" -"もう一つの問題は、一部の構造体フィールドがLimited APIの一部であるにもかかわら" -"ず、 ``Py_LIMITED_API`` が定義されたときに現在非表示になっていないことです。" - -#: ../../c-api/stable.rst:170 -msgid "" -"For these reasons, we recommend testing an extension with *all* minor Python " -"versions it supports, and preferably to build with the *lowest* such version." -msgstr "" -"これらの理由から、私たちは拡張モジュールがサポートする *すべての* マイナーな " -"Python バージョンでテストすること、そしてできれば *最も低い* バージョンでビル" -"ドすることを推奨します。" - -#: ../../c-api/stable.rst:173 -msgid "" -"We also recommend reviewing documentation of all used API to check if it is " -"explicitly part of the Limited API. Even with ``Py_LIMITED_API`` defined, a " -"few private declarations are exposed for technical reasons (or even " -"unintentionally, as bugs)." -msgstr "" -"また、使用するすべての API のドキュメントを確認し、それが明示的に Limited " -"API の一部であるかどうかをチェックすることをお勧めします。``Py_LIMITED_API`` " -"が定義されていても、技術的な理由で(あるいはバグとして意図せず)いくつかのプラ" -"イベート宣言が公開されることがあります。" - -#: ../../c-api/stable.rst:178 -msgid "" -"Also note that the Limited API is not necessarily stable: compiling with " -"``Py_LIMITED_API`` with Python 3.8 means that the extension will run with " -"Python 3.12, but it will not necessarily *compile* with Python 3.12. In " -"particular, parts of the Limited API may be deprecated and removed, provided " -"that the Stable ABI stays stable." -msgstr "" -"Python 3.8 で ``Py_LIMITED_API`` をコンパイルすると、その拡張モジュールは " -"Python 3.12 で動作しますが、必ずしも Python 3.12 で *コンパイル* できるとは限" -"らないことに注意してください。特に、Limited API の一部は、 Stable ABI が安定" -"している限り、非推奨で削除されるかもしれません。" - -#: ../../c-api/stable.rst:188 -msgid "Platform Considerations" -msgstr "プラットフォームで考慮すべき点" - -#: ../../c-api/stable.rst:190 -msgid "" -"ABI stability depends not only on Python, but also on the compiler used, " -"lower-level libraries and compiler options. For the purposes of the :ref:" -"`Stable ABI `, these details define a “platform”. They usually " -"depend on the OS type and processor architecture" -msgstr "" - -#: ../../c-api/stable.rst:195 -msgid "" -"It is the responsibility of each particular distributor of Python to ensure " -"that all Python versions on a particular platform are built in a way that " -"does not break the Stable ABI. This is the case with Windows and macOS " -"releases from ``python.org`` and many third-party distributors." -msgstr "" -"特定のプラットフォーム上のすべての Python バージョンが安定版 ABI を破壊しない" -"方法でビルドされていることを保証するのは、 Python の各特定配布者の責任です。" -"これは ``python.org`` や多くのサードパーティーの配布元からの Windows と " -"macOS のリリースの場合です。" - -#: ../../c-api/stable.rst:205 -msgid "Contents of Limited API" -msgstr "限定版APIの内容" - -#: ../../c-api/stable.rst:208 -msgid "" -"Currently, the :ref:`Limited API ` includes the following " -"items:" -msgstr "" - -#: ../../c-api/stable.rst:42 -msgid "PyUnstable" -msgstr "" +"In some cases, the stable ABI needs to be extended with new functions. " +"Extension modules wishing to use these new APIs need to set " +"``Py_LIMITED_API`` to the ``PY_VERSION_HEX`` value (see :ref:" +"`apiabiversion`) of the minimum Python version they want to support (e.g. " +"``0x03030000`` for Python 3.3). Such modules will work on all subsequent " +"Python releases, but fail to load (because of missing symbols) on the older " +"releases." +msgstr "" +"いくつかのケースでは、安定 ABI を新しい関数で拡張する必要があります。これらの" +"新しい API を使用したい拡張モジュールは、 ``Py_LIMITED_API`` にサポートしたい" +"最小の Python バージョンの ``PY_VERSION_HEX`` の値 (:ref:`apiabiversion` を" +"参照) を設定してください。 (例えば Python3.3 なら ``0x03030000``)。 モジュー" +"ルは後続のすべての Pythonリリースで動作しますが、 (シンボルが存在しないため) " +"古いリリースでは動作しません。" + +#: ../../c-api/stable.rst:36 +msgid "" +"As of Python 3.2, the set of functions available to the limited API is " +"documented in :pep:`384`. In the C API documentation, API elements that are " +"not part of the limited API are marked as \"Not part of the limited API.\"" +msgstr "" +"Python 3.2 からは limited API は :pep:`384` に文書化されています。 C API のド" +"キュメントでは、 limited API の一部でない API は、 \"Not part of the limited " +"API\" とマークされています。" diff --git a/c-api/structures.po b/c-api/structures.po index ffcb852d5..fe10b828b 100644 --- a/c-api/structures.po +++ b/c-api/structures.po @@ -1,29 +1,30 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: +# 秘湯 , 2017 +# Arihiro TAKASE, 2017 +# E. Kawashima, 2017 +# Nozomu Kaneko , 2017 +# tomo, 2020 # Osamu NAKAMURA, 2021 -# yaakiyu, 2022 -# Nozomu Kaneko , 2023 -# Arihiro TAKASE, 2023 -# tomo, 2023 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:50+0000\n" -"Last-Translator: tomo, 2023\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-08-03 07:07+0000\n" +"PO-Revision-Date: 2017-02-16 17:39+0000\n" +"Last-Translator: Osamu NAKAMURA, 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/structures.rst:6 @@ -49,19 +50,23 @@ msgid "" "beginning of the object's representation in memory. These are represented " "by the :c:type:`PyObject` and :c:type:`PyVarObject` types, which are " "defined, in turn, by the expansions of some macros also used, whether " -"directly or indirectly, in the definition of all other Python objects. " -"Additional macros can be found under :ref:`reference counting " -"`." +"directly or indirectly, in the definition of all other Python objects." msgstr "" +"全ての Python オブジェクトは、オブジェクトのメモリ内表現の先頭部分にある少数" +"のフィールドを完全に共有しています。\n" +"このフィールドは :c:type:`PyObject` 型および :c:type:`PyVarObject` 型で表現さ" +"れます。\n" +"これらの型もまた、他の全ての Python オブジェクトの定義で直接または間接的に使" +"われているマクロを使って定義されています。" -#: ../../c-api/structures.rst:26 +#: ../../c-api/structures.rst:25 msgid "" "All object types are extensions of this type. This is a type which contains " "the information Python needs to treat a pointer to an object as an object. " "In a normal \"release\" build, it contains only the object's reference count " "and a pointer to the corresponding type object. Nothing is actually declared " "to be a :c:type:`PyObject`, but every pointer to a Python object can be cast " -"to a :c:expr:`PyObject*`. Access to the members must be done by using the " +"to a :c:type:`PyObject*`. Access to the members must be done by using the " "macros :c:macro:`Py_REFCNT` and :c:macro:`Py_TYPE`." msgstr "" "全てのオブジェクト型はこの型を拡張したものです。\n" @@ -70,20 +75,27 @@ msgstr "" "通常の \"リリース\" ビルドでは、この構造体にはオブジェクトの参照カウントとオ" "ブジェクトに対応する型オブジェクトだけが入っています。\n" "実際には :c:type:`PyObject` であることは宣言されていませんが、全ての Python " -"オブジェクトへのポインタは :c:expr:`PyObject*` へキャストできます。\n" +"オブジェクトへのポインタは :c:type:`PyObject*` へキャストできます。\n" "メンバにアクセスするには :c:macro:`Py_REFCNT` マクロと :c:macro:`Py_TYPE` マ" "クロを使わなければなりません。" -#: ../../c-api/structures.rst:38 +#: ../../c-api/structures.rst:37 msgid "" -"This is an extension of :c:type:`PyObject` that adds the :c:member:" -"`~PyVarObject.ob_size` field. This is only used for objects that have some " -"notion of *length*. This type does not often appear in the Python/C API. " -"Access to the members must be done by using the macros :c:macro:" -"`Py_REFCNT`, :c:macro:`Py_TYPE`, and :c:macro:`Py_SIZE`." +"This is an extension of :c:type:`PyObject` that adds the :attr:`ob_size` " +"field. This is only used for objects that have some notion of *length*. " +"This type does not often appear in the Python/C API. Access to the members " +"must be done by using the macros :c:macro:`Py_REFCNT`, :c:macro:`Py_TYPE`, " +"and :c:macro:`Py_SIZE`." msgstr "" +":c:type:`PyObject` を拡張して、 :attr:`ob_size` フィールドを追加したもので" +"す。\n" +"この構造体は、 *長さ (length)* の概念を持つオブジェクトだけに対して使いま" +"す。\n" +"この型が Python/C API で使われることはほとんどありません。\n" +"メンバにアクセスするには :c:macro:`Py_REFCNT` マクロ、 :c:macro:`Py_TYPE` マ" +"クロ、 :c:macro:`Py_SIZE` マクロを使わなければなりません。" -#: ../../c-api/structures.rst:47 +#: ../../c-api/structures.rst:46 msgid "" "This is a macro used when declaring new types which represent objects " "without a varying length. The PyObject_HEAD macro expands to::" @@ -92,15 +104,11 @@ msgstr "" "です。\n" "PyObject_HEAD マクロは次のように展開されます::" -#: ../../c-api/structures.rst:50 -msgid "PyObject ob_base;" -msgstr "" - -#: ../../c-api/structures.rst:52 +#: ../../c-api/structures.rst:51 msgid "See documentation of :c:type:`PyObject` above." msgstr "上にある :c:type:`PyObject` のドキュメントを参照してください。" -#: ../../c-api/structures.rst:57 +#: ../../c-api/structures.rst:56 msgid "" "This is a macro used when declaring new types which represent objects with a " "length that varies from instance to instance. The PyObject_VAR_HEAD macro " @@ -110,89 +118,56 @@ msgstr "" "きに使うマクロです。\n" "PyObject_VAR_HEAD マクロは次のように展開されます::" -#: ../../c-api/structures.rst:61 -msgid "PyVarObject ob_base;" -msgstr "" - -#: ../../c-api/structures.rst:63 +#: ../../c-api/structures.rst:62 msgid "See documentation of :c:type:`PyVarObject` above." msgstr "上にある :c:type:`PyVarObject` のドキュメントを参照してください。" -#: ../../c-api/structures.rst:68 -msgid "" -"The base class of all other objects, the same as :class:`object` in Python." -msgstr "" - -#: ../../c-api/structures.rst:73 -msgid "" -"Test if the *x* object is the *y* object, the same as ``x is y`` in Python." -msgstr "" - -#: ../../c-api/structures.rst:80 -msgid "" -"Test if an object is the ``None`` singleton, the same as ``x is None`` in " -"Python." -msgstr "" - -#: ../../c-api/structures.rst:88 -msgid "" -"Test if an object is the ``True`` singleton, the same as ``x is True`` in " -"Python." -msgstr "" - -#: ../../c-api/structures.rst:96 -msgid "" -"Test if an object is the ``False`` singleton, the same as ``x is False`` in " -"Python." -msgstr "" - -#: ../../c-api/structures.rst:104 -msgid "Get the type of the Python object *o*." -msgstr "" - -#: ../../c-api/structures.rst:106 -msgid "Return a :term:`borrowed reference`." -msgstr "" - -#: ../../c-api/structures.rst:108 -msgid "Use the :c:func:`Py_SET_TYPE` function to set an object type." -msgstr "" - -#: ../../c-api/structures.rst:110 +#: ../../c-api/structures.rst:67 msgid "" -":c:func:`Py_TYPE()` is changed to an inline static function. The parameter " -"type is no longer :c:expr:`const PyObject*`." +"This macro is used to access the :attr:`ob_type` member of a Python object. " +"It expands to::" msgstr "" +"Python オブジェクトの :attr:`ob_type` メンバにアクセスするのに使うマクロで" +"す。\n" +"これは次のように展開されます::" -#: ../../c-api/structures.rst:117 +#: ../../c-api/structures.rst:75 msgid "" "Return non-zero if the object *o* type is *type*. Return zero otherwise. " "Equivalent to: ``Py_TYPE(o) == type``." msgstr "" -#: ../../c-api/structures.rst:125 +#: ../../c-api/structures.rst:83 msgid "Set the object *o* type to *type*." msgstr "" -#: ../../c-api/structures.rst:132 -msgid "Get the size of the Python object *o*." +#: ../../c-api/structures.rst:90 +msgid "" +"This macro is used to access the :attr:`ob_refcnt` member of a Python " +"object. It expands to::" msgstr "" +"Python オブジェクトの :attr:`ob_refcnt` メンバにアクセスするのに使うマクロで" +"す。\n" +"これは次のように展開されます::" -#: ../../c-api/structures.rst:134 -msgid "Use the :c:func:`Py_SET_SIZE` function to set an object size." -msgstr "" +#: ../../c-api/structures.rst:99 +msgid "Set the object *o* reference counter to *refcnt*." +msgstr "オブジェクト *o* の参照カウントを *refcnt* に設定します。" -#: ../../c-api/structures.rst:136 +#: ../../c-api/structures.rst:106 msgid "" -":c:func:`Py_SIZE()` is changed to an inline static function. The parameter " -"type is no longer :c:expr:`const PyVarObject*`." +"This macro is used to access the :attr:`ob_size` member of a Python object. " +"It expands to::" msgstr "" +"Python オブジェクトの :attr:`ob_size` メンバにアクセスするのに使うマクロで" +"す。\n" +"これは次のように展開されます::" -#: ../../c-api/structures.rst:143 +#: ../../c-api/structures.rst:114 msgid "Set the object *o* size to *size*." msgstr "" -#: ../../c-api/structures.rst:150 +#: ../../c-api/structures.rst:121 msgid "" "This is a macro which expands to initialization values for a new :c:type:" "`PyObject` type. This macro expands to::" @@ -200,108 +175,59 @@ msgstr "" "新しい :c:type:`PyObject` 型のための初期値に展開するマクロです。このマクロは" "次のように展開されます。 ::" -#: ../../c-api/structures.rst:153 -msgid "" -"_PyObject_EXTRA_INIT\n" -"1, type," -msgstr "" - -#: ../../c-api/structures.rst:159 +#: ../../c-api/structures.rst:130 msgid "" "This is a macro which expands to initialization values for a new :c:type:" -"`PyVarObject` type, including the :c:member:`~PyVarObject.ob_size` field. " -"This macro expands to::" -msgstr "" - -#: ../../c-api/structures.rst:163 -msgid "" -"_PyObject_EXTRA_INIT\n" -"1, type, size," +"`PyVarObject` type, including the :attr:`ob_size` field. This macro expands " +"to::" msgstr "" +"新しい、 :attr:`ob_size` フィールドを含む :c:type:`PyVarObject` 型のための初" +"期値に展開するマクロです。このマクロは次のように展開されます。 ::" -#: ../../c-api/structures.rst:168 +#: ../../c-api/structures.rst:139 msgid "Implementing functions and methods" msgstr "" -#: ../../c-api/structures.rst:172 +#: ../../c-api/structures.rst:143 msgid "" "Type of the functions used to implement most Python callables in C. " -"Functions of this type take two :c:expr:`PyObject*` parameters and return " +"Functions of this type take two :c:type:`PyObject*` parameters and return " "one such value. If the return value is ``NULL``, an exception shall have " "been set. If not ``NULL``, the return value is interpreted as the return " "value of the function as exposed in Python. The function must return a new " "reference." msgstr "" -#: ../../c-api/structures.rst:179 +#: ../../c-api/structures.rst:150 msgid "The function signature is::" msgstr "関数のシグネチャは次のとおりです ::" -#: ../../c-api/structures.rst:181 -msgid "" -"PyObject *PyCFunction(PyObject *self,\n" -" PyObject *args);" -msgstr "" - -#: ../../c-api/structures.rst:186 +#: ../../c-api/structures.rst:157 msgid "" "Type of the functions used to implement Python callables in C with " -"signature :ref:`METH_VARARGS | METH_KEYWORDS `. " -"The function signature is::" -msgstr "" - -#: ../../c-api/structures.rst:190 -msgid "" -"PyObject *PyCFunctionWithKeywords(PyObject *self,\n" -" PyObject *args,\n" -" PyObject *kwargs);" +"signature :const:`METH_VARARGS | METH_KEYWORDS`. The function signature is::" msgstr "" -#: ../../c-api/structures.rst:197 +#: ../../c-api/structures.rst:168 msgid "" "Type of the functions used to implement Python callables in C with " -"signature :c:macro:`METH_FASTCALL`. The function signature is::" +"signature :const:`METH_FASTCALL`. The function signature is::" msgstr "" -#: ../../c-api/structures.rst:201 -msgid "" -"PyObject *PyCFunctionFast(PyObject *self,\n" -" PyObject *const *args,\n" -" Py_ssize_t nargs);" -msgstr "" - -#: ../../c-api/structures.rst:207 +#: ../../c-api/structures.rst:178 msgid "" "Type of the functions used to implement Python callables in C with " -"signature :ref:`METH_FASTCALL | METH_KEYWORDS `. The function signature is::" +"signature :const:`METH_FASTCALL | METH_KEYWORDS`. The function signature is::" msgstr "" -#: ../../c-api/structures.rst:211 -msgid "" -"PyObject *PyCFunctionFastWithKeywords(PyObject *self,\n" -" PyObject *const *args,\n" -" Py_ssize_t nargs,\n" -" PyObject *kwnames);" -msgstr "" - -#: ../../c-api/structures.rst:218 +#: ../../c-api/structures.rst:189 msgid "" "Type of the functions used to implement Python callables in C with " -"signature :ref:`METH_METHOD | METH_FASTCALL | METH_KEYWORDS `. The function signature is::" -msgstr "" - -#: ../../c-api/structures.rst:222 -msgid "" -"PyObject *PyCMethod(PyObject *self,\n" -" PyTypeObject *defining_class,\n" -" PyObject *const *args,\n" -" Py_ssize_t nargs,\n" -" PyObject *kwnames)" +"signature :const:`METH_METHOD | METH_FASTCALL | METH_KEYWORDS`. The function " +"signature is::" msgstr "" -#: ../../c-api/structures.rst:233 +#: ../../c-api/structures.rst:204 msgid "" "Structure used to describe a method of an extension type. This structure " "has four fields:" @@ -309,73 +235,101 @@ msgstr "" "拡張型のメソッドを記述する際に用いる構造体です。この構造体には 4 つのフィール" "ドがあります:" -#: ../../c-api/structures.rst:238 -msgid "Name of the method." -msgstr "" +#: ../../c-api/structures.rst:208 ../../c-api/structures.rst:364 +#: ../../c-api/structures.rst:460 +msgid "Field" +msgstr "フィールド" -#: ../../c-api/structures.rst:242 -msgid "Pointer to the C implementation." -msgstr "" +#: ../../c-api/structures.rst:208 ../../c-api/structures.rst:364 +#: ../../c-api/structures.rst:460 +msgid "C Type" +msgstr "C の型" -#: ../../c-api/structures.rst:246 -msgid "Flags bits indicating how the call should be constructed." -msgstr "" +#: ../../c-api/structures.rst:208 ../../c-api/structures.rst:364 +#: ../../c-api/structures.rst:460 +msgid "Meaning" +msgstr "意味" -#: ../../c-api/structures.rst:250 -msgid "Points to the contents of the docstring." +#: ../../c-api/structures.rst:210 +msgid ":attr:`ml_name`" +msgstr ":attr:`ml_name`" + +#: ../../c-api/structures.rst:210 ../../c-api/structures.rst:218 +#: ../../c-api/structures.rst:366 ../../c-api/structures.rst:379 +#: ../../c-api/structures.rst:395 ../../c-api/structures.rst:462 +#: ../../c-api/structures.rst:470 +msgid "const char \\*" msgstr "" -#: ../../c-api/structures.rst:252 +#: ../../c-api/structures.rst:210 +msgid "name of the method" +msgstr "メソッド名" + +#: ../../c-api/structures.rst:212 +msgid ":attr:`ml_meth`" +msgstr ":attr:`ml_meth`" + +#: ../../c-api/structures.rst:212 +msgid "PyCFunction" +msgstr "PyCFunction" + +#: ../../c-api/structures.rst:212 +msgid "pointer to the C implementation" +msgstr "C 実装へのポインタ" + +#: ../../c-api/structures.rst:215 +msgid ":attr:`ml_flags`" +msgstr ":attr:`ml_flags`" + +#: ../../c-api/structures.rst:215 ../../c-api/structures.rst:368 +#: ../../c-api/structures.rst:375 ../../c-api/structures.rst:391 +msgid "int" +msgstr "int" + +#: ../../c-api/structures.rst:215 +msgid "flag bits indicating how the call should be constructed" +msgstr "呼び出しをどのように行うかを示すフラグビット" + +#: ../../c-api/structures.rst:218 +msgid ":attr:`ml_doc`" +msgstr ":attr:`ml_doc`" + +#: ../../c-api/structures.rst:218 ../../c-api/structures.rst:379 +msgid "points to the contents of the docstring" +msgstr "docstring の内容を指すポインタ" + +#: ../../c-api/structures.rst:222 msgid "" -"The :c:member:`~PyMethodDef.ml_meth` is a C function pointer. The functions " -"may be of different types, but they always return :c:expr:`PyObject*`. If " -"the function is not of the :c:type:`PyCFunction`, the compiler will require " -"a cast in the method table. Even though :c:type:`PyCFunction` defines the " -"first parameter as :c:expr:`PyObject*`, it is common that the method " +"The :attr:`ml_meth` is a C function pointer. The functions may be of " +"different types, but they always return :c:type:`PyObject*`. If the " +"function is not of the :c:type:`PyCFunction`, the compiler will require a " +"cast in the method table. Even though :c:type:`PyCFunction` defines the " +"first parameter as :c:type:`PyObject*`, it is common that the method " "implementation uses the specific C type of the *self* object." msgstr "" -#: ../../c-api/structures.rst:260 +#: ../../c-api/structures.rst:229 msgid "" -"The :c:member:`~PyMethodDef.ml_flags` field is a bitfield which can include " -"the following flags. The individual flags indicate either a calling " -"convention or a binding convention." +"The :attr:`ml_flags` field is a bitfield which can include the following " +"flags. The individual flags indicate either a calling convention or a " +"binding convention." msgstr "" -#: ../../c-api/structures.rst:265 +#: ../../c-api/structures.rst:233 msgid "There are these calling conventions:" msgstr "" -#: ../../c-api/structures.rst:269 +#: ../../c-api/structures.rst:237 msgid "" "This is the typical calling convention, where the methods have the type :c:" -"type:`PyCFunction`. The function expects two :c:expr:`PyObject*` values. The " +"type:`PyCFunction`. The function expects two :c:type:`PyObject*` values. The " "first one is the *self* object for methods; for module functions, it is the " "module object. The second parameter (often called *args*) is a tuple object " "representing all arguments. This parameter is typically processed using :c:" "func:`PyArg_ParseTuple` or :c:func:`PyArg_UnpackTuple`." msgstr "" -":c:type:`PyCFunction` 型のメソッドで典型的に使われる呼び出し規約です。関数" -"は :c:expr:`PyObject*` 型の引数値を二つ要求します。最初の引数はメソッドの " -"*self* オブジェクトです; モジュール関数の場合、これはモジュールオブジェクトで" -"す。第二のパラメタ (よく *args* と呼ばれます) は、全ての引数を表現するタプル" -"オブジェクトです。パラメタは通常、 :c:func:`PyArg_ParseTuple` や :c:func:" -"`PyArg_UnpackTuple` で処理されます。" - -#: ../../c-api/structures.rst:279 -msgid "" -"Can only be used in certain combinations with other flags: :ref:" -"`METH_VARARGS | METH_KEYWORDS `, :ref:" -"`METH_FASTCALL | METH_KEYWORDS ` and :ref:" -"`METH_METHOD | METH_FASTCALL | METH_KEYWORDS `." -msgstr "" -#: ../../c-api/structures.rst:287 -msgid ":c:expr:`METH_VARARGS | METH_KEYWORDS`" -msgstr "" - -#: ../../c-api/structures.rst:288 +#: ../../c-api/structures.rst:247 msgid "" "Methods with these flags must be of type :c:type:`PyCFunctionWithKeywords`. " "The function expects three parameters: *self*, *args*, *kwargs* where " @@ -384,85 +338,69 @@ msgid "" "using :c:func:`PyArg_ParseTupleAndKeywords`." msgstr "" -#: ../../c-api/structures.rst:297 +#: ../../c-api/structures.rst:256 msgid "" "Fast calling convention supporting only positional arguments. The methods " -"have the type :c:type:`PyCFunctionFast`. The first parameter is *self*, the " -"second parameter is a C array of :c:expr:`PyObject*` values indicating the " +"have the type :c:type:`_PyCFunctionFast`. The first parameter is *self*, the " +"second parameter is a C array of :c:type:`PyObject*` values indicating the " "arguments and the third parameter is the number of arguments (the length of " "the array)." msgstr "" -#: ../../c-api/structures.rst:307 -msgid "``METH_FASTCALL`` is now part of the :ref:`stable ABI `." +#: ../../c-api/structures.rst:262 ../../c-api/structures.rst:279 +msgid "This is not part of the :ref:`limited API `." msgstr "" -#: ../../c-api/structures.rst:312 -msgid ":c:expr:`METH_FASTCALL | METH_KEYWORDS`" -msgstr "" - -#: ../../c-api/structures.rst:313 -msgid "" -"Extension of :c:macro:`METH_FASTCALL` supporting also keyword arguments, " -"with methods of type :c:type:`PyCFunctionFastWithKeywords`. Keyword " -"arguments are passed the same way as in the :ref:`vectorcall protocol " -"`: there is an additional fourth :c:expr:`PyObject*` parameter " -"which is a tuple representing the names of the keyword arguments (which are " -"guaranteed to be strings) or possibly ``NULL`` if there are no keywords. " -"The values of the keyword arguments are stored in the *args* array, after " -"the positional arguments." -msgstr "" - -#: ../../c-api/structures.rst:328 +#: ../../c-api/structures.rst:269 msgid "" -"Can only be used in the combination with other flags: :ref:`METH_METHOD | " -"METH_FASTCALL | METH_KEYWORDS `." +"Extension of :const:`METH_FASTCALL` supporting also keyword arguments, with " +"methods of type :c:type:`_PyCFunctionFastWithKeywords`. Keyword arguments " +"are passed the same way as in the :ref:`vectorcall protocol `: " +"there is an additional fourth :c:type:`PyObject*` parameter which is a tuple " +"representing the names of the keyword arguments (which are guaranteed to be " +"strings) or possibly ``NULL`` if there are no keywords. The values of the " +"keyword arguments are stored in the *args* array, after the positional " +"arguments." msgstr "" -#: ../../c-api/structures.rst:334 -msgid ":c:expr:`METH_METHOD | METH_FASTCALL | METH_KEYWORDS`" -msgstr "" - -#: ../../c-api/structures.rst:335 +#: ../../c-api/structures.rst:286 msgid "" -"Extension of :ref:`METH_FASTCALL | METH_KEYWORDS ` supporting the *defining class*, that is, the class that " -"contains the method in question. The defining class might be a superclass of " -"``Py_TYPE(self)``." +"Extension of :const:`METH_FASTCALL | METH_KEYWORDS` supporting the *defining " +"class*, that is, the class that contains the method in question. The " +"defining class might be a superclass of ``Py_TYPE(self)``." msgstr "" -#: ../../c-api/structures.rst:340 +#: ../../c-api/structures.rst:290 msgid "" "The method needs to be of type :c:type:`PyCMethod`, the same as for " "``METH_FASTCALL | METH_KEYWORDS`` with ``defining_class`` argument added " "after ``self``." msgstr "" -#: ../../c-api/structures.rst:349 +#: ../../c-api/structures.rst:299 msgid "" "Methods without parameters don't need to check whether arguments are given " -"if they are listed with the :c:macro:`METH_NOARGS` flag. They need to be of " +"if they are listed with the :const:`METH_NOARGS` flag. They need to be of " "type :c:type:`PyCFunction`. The first parameter is typically named *self* " "and will hold a reference to the module or object instance. In all cases " "the second parameter will be ``NULL``." msgstr "" +"引数のないメソッドは、 :const:`METH_NOARGS` フラグをつけた場合、必要な引数が" +"指定されているかをチェックしなくなります。こうしたメソッドは :c:type:" +"`PyCFunction` 型でなくてはなりません。第一のパラメタは *self* になり、モ" +"ジュールかオブジェクトインスタンスへの参照を保持することになります。いずれに" +"せよ、第二のパラメタは ``NULL`` になります。" -#: ../../c-api/structures.rst:355 -msgid "" -"The function must have 2 parameters. Since the second parameter is unused, :" -"c:macro:`Py_UNUSED` can be used to prevent a compiler warning." -msgstr "" - -#: ../../c-api/structures.rst:361 +#: ../../c-api/structures.rst:308 msgid "" -"Methods with a single object argument can be listed with the :c:macro:" -"`METH_O` flag, instead of invoking :c:func:`PyArg_ParseTuple` with a " -"``\"O\"`` argument. They have the type :c:type:`PyCFunction`, with the " -"*self* parameter, and a :c:expr:`PyObject*` parameter representing the " -"single argument." +"Methods with a single object argument can be listed with the :const:`METH_O` " +"flag, instead of invoking :c:func:`PyArg_ParseTuple` with a ``\"O\"`` " +"argument. They have the type :c:type:`PyCFunction`, with the *self* " +"parameter, and a :c:type:`PyObject*` parameter representing the single " +"argument." msgstr "" -#: ../../c-api/structures.rst:367 +#: ../../c-api/structures.rst:314 msgid "" "These two constants are not used to indicate the calling convention but the " "binding when use with methods of classes. These may not be used for " @@ -473,7 +411,7 @@ msgstr "" "う際の束縛方式を示すものです。モジュールに対して定義された関数で用いてはなり" "ません。メソッドに対しては、最大で一つしかこのフラグをセットできません。" -#: ../../c-api/structures.rst:377 +#: ../../c-api/structures.rst:324 msgid "" "The method will be passed the type object as the first parameter rather than " "an instance of the type. This is used to create *class methods*, similar to " @@ -483,7 +421,7 @@ msgstr "" "す。このフラグは組み込み関数 :func:`classmethod` を使って生成するのと同じ *ク" "ラスメソッド (class method)* を生成するために使われます。" -#: ../../c-api/structures.rst:387 +#: ../../c-api/structures.rst:334 msgid "" "The method will be passed ``NULL`` as the first parameter rather than an " "instance of the type. This is used to create *static methods*, similar to " @@ -493,7 +431,7 @@ msgstr "" "のフラグは、 :func:`staticmethod` を使って生成するのと同じ *静的メソッド " "(static method)* を生成するために使われます。" -#: ../../c-api/structures.rst:391 +#: ../../c-api/structures.rst:338 msgid "" "One other constant controls whether a method is loaded in place of another " "definition with the same method name." @@ -501,574 +439,356 @@ msgstr "" "もう一つの定数は、あるメソッドを同名の別のメソッド定義と置き換えるかどうかを" "制御します。" -#: ../../c-api/structures.rst:397 +#: ../../c-api/structures.rst:344 msgid "" "The method will be loaded in place of existing definitions. Without " "*METH_COEXIST*, the default is to skip repeated definitions. Since slot " "wrappers are loaded before the method table, the existence of a " "*sq_contains* slot, for example, would generate a wrapped method named :meth:" -"`~object.__contains__` and preclude the loading of a corresponding " -"PyCFunction with the same name. With the flag defined, the PyCFunction will " -"be loaded in place of the wrapper object and will co-exist with the slot. " -"This is helpful because calls to PyCFunctions are optimized more than " -"wrapper object calls." -msgstr "" - -#: ../../c-api/structures.rst:409 -msgid "" -"Turn *ml* into a Python :term:`callable` object. The caller must ensure that " -"*ml* outlives the :term:`callable`. Typically, *ml* is defined as a static " -"variable." -msgstr "" - -#: ../../c-api/structures.rst:413 -msgid "" -"The *self* parameter will be passed as the *self* argument to the C function " -"in ``ml->ml_meth`` when invoked. *self* can be ``NULL``." -msgstr "" - -#: ../../c-api/structures.rst:417 -msgid "" -"The :term:`callable` object's ``__module__`` attribute can be set from the " -"given *module* argument. *module* should be a Python string, which will be " -"used as name of the module the function is defined in. If unavailable, it " -"can be set to :const:`None` or ``NULL``." -msgstr "" - -#: ../../c-api/structures.rst:423 -msgid ":attr:`function.__module__`" -msgstr "" - -#: ../../c-api/structures.rst:425 -msgid "" -"The *cls* parameter will be passed as the *defining_class* argument to the C " -"function. Must be set if :c:macro:`METH_METHOD` is set on ``ml->ml_flags``." -msgstr "" - -#: ../../c-api/structures.rst:434 -msgid "Equivalent to ``PyCMethod_New(ml, self, module, NULL)``." -msgstr "" - -#: ../../c-api/structures.rst:439 -msgid "Equivalent to ``PyCMethod_New(ml, self, NULL, NULL)``." -msgstr "" - -#: ../../c-api/structures.rst:443 +"`__contains__` and preclude the loading of a corresponding PyCFunction with " +"the same name. With the flag defined, the PyCFunction will be loaded in " +"place of the wrapper object and will co-exist with the slot. This is " +"helpful because calls to PyCFunctions are optimized more than wrapper object " +"calls." +msgstr "" +"メソッドを既存の定義を置き換える形でロードします。 *METH_COEXIST* を指定しな" +"ければ、デフォルトの設定にしたがって、定義が重複しないようスキップします。ス" +"ロットラッパーはメソッドテーブルよりも前にロードされるので、例えば " +"*sq_contains* スロットはラップしているメソッド :meth:`__contains__` を生成" +"し、同名の PyCFunction のロードを阻止します。このフラグを定義すると、 " +"PyCFunction はラッパーオブジェクトを置き換える形でロードされ、スロットと連立" +"します。 PyCFunctions の呼び出しはラッパーオブジェクトの呼び出しよりも最適化" +"されているので、こうした仕様が便利になります。" + +#: ../../c-api/structures.rst:356 msgid "Accessing attributes of extension types" msgstr "" -#: ../../c-api/structures.rst:447 +#: ../../c-api/structures.rst:360 msgid "" "Structure which describes an attribute of a type which corresponds to a C " -"struct member. When defining a class, put a NULL-terminated array of these " -"structures in the :c:member:`~PyTypeObject.tp_members` slot." -msgstr "" - -#: ../../c-api/structures.rst:452 -msgid "Its fields are, in order:" -msgstr "" - -#: ../../c-api/structures.rst:456 -msgid "" -"Name of the member. A NULL value marks the end of a ``PyMemberDef[]`` array." -msgstr "" - -#: ../../c-api/structures.rst:459 -msgid "The string should be static, no copy is made of it." -msgstr "" - -#: ../../c-api/structures.rst:463 -msgid "" -"The type of the member in the C struct. See :ref:`PyMemberDef-types` for the " -"possible values." -msgstr "" - -#: ../../c-api/structures.rst:468 -msgid "" -"The offset in bytes that the member is located on the type’s object struct." -msgstr "" - -#: ../../c-api/structures.rst:472 -msgid "" -"Zero or more of the :ref:`PyMemberDef-flags`, combined using bitwise OR." -msgstr "" - -#: ../../c-api/structures.rst:476 -msgid "" -"The docstring, or NULL. The string should be static, no copy is made of it. " -"Typically, it is defined using :c:macro:`PyDoc_STR`." -msgstr "" - -#: ../../c-api/structures.rst:480 -msgid "" -"By default (when :c:member:`~PyMemberDef.flags` is ``0``), members allow " -"both read and write access. Use the :c:macro:`Py_READONLY` flag for read-" -"only access. Certain types, like :c:macro:`Py_T_STRING`, imply :c:macro:" -"`Py_READONLY`. Only :c:macro:`Py_T_OBJECT_EX` (and legacy :c:macro:" -"`T_OBJECT`) members can be deleted." -msgstr "" - -#: ../../c-api/structures.rst:489 -msgid "" -"For heap-allocated types (created using :c:func:`PyType_FromSpec` or " -"similar), ``PyMemberDef`` may contain a definition for the special member " -"``\"__vectorcalloffset__\"``, corresponding to :c:member:`~PyTypeObject." -"tp_vectorcall_offset` in type objects. This member must be defined with " -"``Py_T_PYSSIZET``, and either ``Py_READONLY`` or ``Py_READONLY | " -"Py_RELATIVE_OFFSET``. For example::" -msgstr "" - -#: ../../c-api/structures.rst:496 -msgid "" -"static PyMemberDef spam_type_members[] = {\n" -" {\"__vectorcalloffset__\", Py_T_PYSSIZET,\n" -" offsetof(Spam_object, vectorcall), Py_READONLY},\n" -" {NULL} /* Sentinel */\n" -"};" -msgstr "" - -#: ../../c-api/structures.rst:502 -msgid "(You may need to ``#include `` for :c:func:`!offsetof`.)" -msgstr "" - -#: ../../c-api/structures.rst:504 -msgid "" -"The legacy offsets :c:member:`~PyTypeObject.tp_dictoffset` and :c:member:" -"`~PyTypeObject.tp_weaklistoffset` can be defined similarly using " -"``\"__dictoffset__\"`` and ``\"__weaklistoffset__\"`` members, but " -"extensions are strongly encouraged to use :c:macro:`Py_TPFLAGS_MANAGED_DICT` " -"and :c:macro:`Py_TPFLAGS_MANAGED_WEAKREF` instead." -msgstr "" - -#: ../../c-api/structures.rst:512 -msgid "" -"``PyMemberDef`` is always available. Previously, it required including " -"``\"structmember.h\"``." -msgstr "" - -#: ../../c-api/structures.rst:517 -msgid "" -":c:macro:`Py_RELATIVE_OFFSET` is now allowed for " -"``\"__vectorcalloffset__\"``, ``\"__dictoffset__\"`` and " -"``\"__weaklistoffset__\"``." -msgstr "" - -#: ../../c-api/structures.rst:523 -msgid "" -"Get an attribute belonging to the object at address *obj_addr*. The " -"attribute is described by ``PyMemberDef`` *m*. Returns ``NULL`` on error." -msgstr "" - -#: ../../c-api/structures.rst:529 -msgid "" -"``PyMember_GetOne`` is always available. Previously, it required including " -"``\"structmember.h\"``." -msgstr "" - -#: ../../c-api/structures.rst:534 -msgid "" -"Set an attribute belonging to the object at address *obj_addr* to object " -"*o*. The attribute to set is described by ``PyMemberDef`` *m*. Returns " -"``0`` if successful and a negative value on failure." +"struct member. Its fields are:" msgstr "" +"type の C 構造体のメンバとして格納されている、ある型の属性を表す構造体です。" +"この構造体のフィールドは以下のとおりです:" -#: ../../c-api/structures.rst:540 -msgid "" -"``PyMember_SetOne`` is always available. Previously, it required including " -"``\"structmember.h\"``." -msgstr "" +#: ../../c-api/structures.rst:366 +msgid ":attr:`name`" +msgstr ":attr:`name`" -#: ../../c-api/structures.rst:546 -msgid "Member flags" -msgstr "" +#: ../../c-api/structures.rst:366 +msgid "name of the member" +msgstr "メンバ名" -#: ../../c-api/structures.rst:548 -msgid "The following flags can be used with :c:member:`PyMemberDef.flags`:" -msgstr "" +#: ../../c-api/structures.rst:368 +msgid ":attr:`!type`" +msgstr ":attr:`!type`" -#: ../../c-api/structures.rst:552 -msgid "Not writable." -msgstr "" +#: ../../c-api/structures.rst:368 +msgid "the type of the member in the C struct" +msgstr "C 構造体の中のメンバの型" -#: ../../c-api/structures.rst:556 -msgid "" -"Emit an ``object.__getattr__`` :ref:`audit event ` before " -"reading." -msgstr "" - -#: ../../c-api/structures.rst:561 -msgid "" -"Indicates that the :c:member:`~PyMemberDef.offset` of this ``PyMemberDef`` " -"entry indicates an offset from the subclass-specific data, rather than from " -"``PyObject``." -msgstr "" +#: ../../c-api/structures.rst:371 +msgid ":attr:`offset`" +msgstr ":attr:`offset`" -#: ../../c-api/structures.rst:565 -msgid "" -"Can only be used as part of :c:member:`Py_tp_members ` :c:type:`slot ` when creating a class using " -"negative :c:member:`~PyType_Spec.basicsize`. It is mandatory in that case." -msgstr "" - -#: ../../c-api/structures.rst:570 -msgid "" -"This flag is only used in :c:type:`PyType_Slot`. When setting :c:member:" -"`~PyTypeObject.tp_members` during class creation, Python clears it and sets :" -"c:member:`PyMemberDef.offset` to the offset from the ``PyObject`` struct." -msgstr "" +#: ../../c-api/structures.rst:371 ../../c-api/structures.rst:407 +msgid "Py_ssize_t" +msgstr "Py_ssize_t" -#: ../../c-api/structures.rst:582 +#: ../../c-api/structures.rst:371 msgid "" -"The :c:macro:`!RESTRICTED`, :c:macro:`!READ_RESTRICTED` and :c:macro:`!" -"WRITE_RESTRICTED` macros available with ``#include \"structmember.h\"`` are " -"deprecated. :c:macro:`!READ_RESTRICTED` and :c:macro:`!RESTRICTED` are " -"equivalent to :c:macro:`Py_AUDIT_READ`; :c:macro:`!WRITE_RESTRICTED` does " -"nothing." -msgstr "" +"the offset in bytes that the member is located on the type's object struct" +msgstr "そのメンバの type object 構造体中の場所の offset バイト数" -#: ../../c-api/structures.rst:593 -msgid "" -"The :c:macro:`!READONLY` macro was renamed to :c:macro:`Py_READONLY`. The :c:" -"macro:`!PY_AUDIT_READ` macro was renamed with the ``Py_`` prefix. The new " -"names are now always available. Previously, these required ``#include " -"\"structmember.h\"``. The header is still available and it provides the old " -"names." -msgstr "" +#: ../../c-api/structures.rst:375 +msgid ":attr:`flags`" +msgstr ":attr:`flags`" -#: ../../c-api/structures.rst:602 -msgid "Member types" -msgstr "" +#: ../../c-api/structures.rst:375 +msgid "flag bits indicating if the field should be read-only or writable" +msgstr "フィールドが読み出し専用か書込み可能なのかを示すビットフラグ" -#: ../../c-api/structures.rst:604 -msgid "" -":c:member:`PyMemberDef.type` can be one of the following macros " -"corresponding to various C types. When the member is accessed in Python, it " -"will be converted to the equivalent Python type. When it is set from Python, " -"it will be converted back to the C type. If that is not possible, an " -"exception such as :exc:`TypeError` or :exc:`ValueError` is raised." -msgstr "" +#: ../../c-api/structures.rst:379 +msgid ":attr:`doc`" +msgstr ":attr:`doc`" -#: ../../c-api/structures.rst:612 +#: ../../c-api/structures.rst:383 msgid "" -"Unless marked (D), attributes defined this way cannot be deleted using e.g. :" -"keyword:`del` or :py:func:`delattr`." +":attr:`!type` can be one of many ``T_`` macros corresponding to various C " +"types. When the member is accessed in Python, it will be converted to the " +"equivalent Python type." msgstr "" +":attr:`!type` はたくさんのCの型を意味する ``T_`` マクロのうちの1つです。メン" +"バが Python からアクセスされるとき、そのメンバは対応する Python の型に変換さ" +"れます。" -#: ../../c-api/structures.rst:616 +#: ../../c-api/structures.rst:388 msgid "Macro name" msgstr "マクロ名" -#: ../../c-api/structures.rst:616 +#: ../../c-api/structures.rst:388 msgid "C type" msgstr "C の型" -#: ../../c-api/structures.rst:616 -msgid "Python type" -msgstr "Python の型" - -#: ../../c-api/structures.rst:618 -msgid ":c:expr:`char`" -msgstr ":c:expr:`char`" - -#: ../../c-api/structures.rst:618 ../../c-api/structures.rst:619 -#: ../../c-api/structures.rst:620 ../../c-api/structures.rst:621 -#: ../../c-api/structures.rst:622 ../../c-api/structures.rst:623 -#: ../../c-api/structures.rst:624 ../../c-api/structures.rst:625 -#: ../../c-api/structures.rst:626 ../../c-api/structures.rst:627 -#: ../../c-api/structures.rst:628 -msgid ":py:class:`int`" -msgstr "" - -#: ../../c-api/structures.rst:619 -msgid ":c:expr:`short`" -msgstr ":c:expr:`short`" - -#: ../../c-api/structures.rst:620 -msgid ":c:expr:`int`" -msgstr ":c:expr:`int`" - -#: ../../c-api/structures.rst:621 -msgid ":c:expr:`long`" -msgstr ":c:expr:`long`" - -#: ../../c-api/structures.rst:622 -msgid ":c:expr:`long long`" -msgstr "" - -#: ../../c-api/structures.rst:623 -msgid ":c:expr:`unsigned char`" -msgstr ":c:expr:`unsigned char`" - -#: ../../c-api/structures.rst:624 -msgid ":c:expr:`unsigned int`" -msgstr ":c:expr:`unsigned int`" - -#: ../../c-api/structures.rst:625 -msgid ":c:expr:`unsigned short`" -msgstr ":c:expr:`unsigned short`" - -#: ../../c-api/structures.rst:626 -msgid ":c:expr:`unsigned long`" -msgstr ":c:expr:`unsigned long`" +#: ../../c-api/structures.rst:390 +msgid "T_SHORT" +msgstr "T_SHORT" -#: ../../c-api/structures.rst:627 -msgid ":c:expr:`unsigned long long`" -msgstr "" +#: ../../c-api/structures.rst:390 +msgid "short" +msgstr "short" -#: ../../c-api/structures.rst:628 -msgid ":c:expr:`Py_ssize_t`" -msgstr "" +#: ../../c-api/structures.rst:391 +msgid "T_INT" +msgstr "T_INT" -#: ../../c-api/structures.rst:629 -msgid ":c:expr:`float`" -msgstr ":c:expr:`float`" +#: ../../c-api/structures.rst:392 +msgid "T_LONG" +msgstr "T_LONG" -#: ../../c-api/structures.rst:629 ../../c-api/structures.rst:630 -msgid ":py:class:`float`" -msgstr "" +#: ../../c-api/structures.rst:392 +msgid "long" +msgstr "long" -#: ../../c-api/structures.rst:630 -msgid ":c:expr:`double`" -msgstr ":c:expr:`double`" +#: ../../c-api/structures.rst:393 +msgid "T_FLOAT" +msgstr "T_FLOAT" -#: ../../c-api/structures.rst:631 -msgid ":c:expr:`char` (written as 0 or 1)" -msgstr "" +#: ../../c-api/structures.rst:393 +msgid "float" +msgstr "浮動小数点数" -#: ../../c-api/structures.rst:631 -msgid ":py:class:`bool`" -msgstr "" +#: ../../c-api/structures.rst:394 +msgid "T_DOUBLE" +msgstr "T_DOUBLE" -#: ../../c-api/structures.rst:633 -msgid ":c:expr:`const char *` (*)" -msgstr "" +#: ../../c-api/structures.rst:394 +msgid "double" +msgstr "double" -#: ../../c-api/structures.rst:633 ../../c-api/structures.rst:634 -msgid ":py:class:`str` (RO)" -msgstr "" +#: ../../c-api/structures.rst:395 +msgid "T_STRING" +msgstr "T_STRING" -#: ../../c-api/structures.rst:634 -msgid ":c:expr:`const char[]` (*)" -msgstr "" +#: ../../c-api/structures.rst:396 +msgid "T_OBJECT" +msgstr "T_OBJECT" -#: ../../c-api/structures.rst:635 -msgid ":c:expr:`char` (0-127)" -msgstr "" +#: ../../c-api/structures.rst:396 ../../c-api/structures.rst:397 +msgid "PyObject \\*" +msgstr "PyObject \\*" -#: ../../c-api/structures.rst:635 -msgid ":py:class:`str` (**)" -msgstr "" - -#: ../../c-api/structures.rst:636 -msgid ":c:expr:`PyObject *`" -msgstr "" - -#: ../../c-api/structures.rst:636 -msgid ":py:class:`object` (D)" -msgstr "" +#: ../../c-api/structures.rst:397 +msgid "T_OBJECT_EX" +msgstr "T_OBJECT_EX" + +#: ../../c-api/structures.rst:398 +msgid "T_CHAR" +msgstr "T_CHAR" + +#: ../../c-api/structures.rst:398 ../../c-api/structures.rst:399 +#: ../../c-api/structures.rst:404 +msgid "char" +msgstr "char" + +#: ../../c-api/structures.rst:399 +msgid "T_BYTE" +msgstr "T_BYTE" + +#: ../../c-api/structures.rst:400 +msgid "T_UBYTE" +msgstr "T_UBYTE" + +#: ../../c-api/structures.rst:400 +msgid "unsigned char" +msgstr "unsigned char" + +#: ../../c-api/structures.rst:401 +msgid "T_UINT" +msgstr "T_UINT" + +#: ../../c-api/structures.rst:401 +msgid "unsigned int" +msgstr "unsigned int" + +#: ../../c-api/structures.rst:402 +msgid "T_USHORT" +msgstr "T_USHORT" + +#: ../../c-api/structures.rst:402 +msgid "unsigned short" +msgstr "unsigned short" + +#: ../../c-api/structures.rst:403 +msgid "T_ULONG" +msgstr "T_ULONG" + +#: ../../c-api/structures.rst:403 +msgid "unsigned long" +msgstr "unsigned long" + +#: ../../c-api/structures.rst:404 +msgid "T_BOOL" +msgstr "T_BOOL" + +#: ../../c-api/structures.rst:405 +msgid "T_LONGLONG" +msgstr "T_LONGLONG" + +#: ../../c-api/structures.rst:405 +msgid "long long" +msgstr "long long" + +#: ../../c-api/structures.rst:406 +msgid "T_ULONGLONG" +msgstr "T_ULONGLONG" + +#: ../../c-api/structures.rst:406 +msgid "unsigned long long" +msgstr "unsigned long long" + +#: ../../c-api/structures.rst:407 +msgid "T_PYSSIZET" +msgstr "T_PYSSIZET" + +#: ../../c-api/structures.rst:410 +msgid "" +":c:macro:`T_OBJECT` and :c:macro:`T_OBJECT_EX` differ in that :c:macro:" +"`T_OBJECT` returns ``None`` if the member is ``NULL`` and :c:macro:" +"`T_OBJECT_EX` raises an :exc:`AttributeError`. Try to use :c:macro:" +"`T_OBJECT_EX` over :c:macro:`T_OBJECT` because :c:macro:`T_OBJECT_EX` " +"handles use of the :keyword:`del` statement on that attribute more correctly " +"than :c:macro:`T_OBJECT`." +msgstr "" +":c:macro:`T_OBJECT` と :c:macro:`T_OBJECT_EX` が異なっているのは、 :c:macro:" +"`T_OBJECT` はメンバが ``NULL`` だったときに ``None`` を返すのに対し、 :c:" +"macro:`T_OBJECT_EX` は :exc:`AttributeError` を送出する点です。\n" +":c:macro:`T_OBJECT_EX` は :c:macro:`T_OBJECT` より属性に対する :keyword:" +"`del` 文を正しくあつかうので、できれば :c:macro:`T_OBJECT` ではなく :c:macro:" +"`T_OBJECT_EX` を使ってください。" -#: ../../c-api/structures.rst:639 +#: ../../c-api/structures.rst:417 msgid "" -"(*): Zero-terminated, UTF8-encoded C string. With :c:macro:`!Py_T_STRING` " -"the C representation is a pointer; with :c:macro:`!Py_T_STRING_INPLACE` the " -"string is stored directly in the structure." -msgstr "" - -#: ../../c-api/structures.rst:644 -msgid "(**): String of length 1. Only ASCII is accepted." +":attr:`flags` can be ``0`` for write and read access or :c:macro:`READONLY` " +"for read-only access. Using :c:macro:`T_STRING` for :attr:`type` implies :c:" +"macro:`READONLY`. :c:macro:`T_STRING` data is interpreted as UTF-8. Only :c:" +"macro:`T_OBJECT` and :c:macro:`T_OBJECT_EX` members can be deleted. (They " +"are set to ``NULL``)." msgstr "" -#: ../../c-api/structures.rst:646 -msgid "(RO): Implies :c:macro:`Py_READONLY`." -msgstr "" - -#: ../../c-api/structures.rst:648 +#: ../../c-api/structures.rst:425 msgid "" -"(D): Can be deleted, in which case the pointer is set to ``NULL``. Reading a " -"``NULL`` pointer raises :py:exc:`AttributeError`." +"Heap allocated types (created using :c:func:`PyType_FromSpec` or similar), " +"``PyMemberDef`` may contain definitions for the special members " +"``__dictoffset__``, ``__weaklistoffset__`` and ``__vectorcalloffset__``, " +"corresponding to :c:member:`~PyTypeObject.tp_dictoffset`, :c:member:" +"`~PyTypeObject.tp_weaklistoffset` and :c:member:`~PyTypeObject." +"tp_vectorcall_offset` in type objects. These must be defined with " +"``T_PYSSIZET`` and ``READONLY``, for example::" msgstr "" -#: ../../c-api/structures.rst:674 +#: ../../c-api/structures.rst:442 msgid "" -"In previous versions, the macros were only available with ``#include " -"\"structmember.h\"`` and were named without the ``Py_`` prefix (e.g. as " -"``T_INT``). The header is still available and contains the old names, along " -"with the following deprecated types:" +"Get an attribute belonging to the object at address *obj_addr*. The " +"attribute is described by ``PyMemberDef`` *m*. Returns ``NULL`` on error." msgstr "" -#: ../../c-api/structures.rst:682 +#: ../../c-api/structures.rst:449 msgid "" -"Like ``Py_T_OBJECT_EX``, but ``NULL`` is converted to ``None``. This results " -"in surprising behavior in Python: deleting the attribute effectively sets it " -"to ``None``." -msgstr "" - -#: ../../c-api/structures.rst:688 -msgid "Always ``None``. Must be used with :c:macro:`Py_READONLY`." -msgstr "" - -#: ../../c-api/structures.rst:691 -msgid "Defining Getters and Setters" +"Set an attribute belonging to the object at address *obj_addr* to object " +"*o*. The attribute to set is described by ``PyMemberDef`` *m*. Returns " +"``0`` if successful and a negative value on failure." msgstr "" -#: ../../c-api/structures.rst:695 +#: ../../c-api/structures.rst:456 msgid "" "Structure to define property-like access for a type. See also description of " "the :c:member:`PyTypeObject.tp_getset` slot." msgstr "" -"型のプロパティのようなアクセスを定義するための構造体です。 :c:member:" +"型のプロパティのようなアクセスを定義するための構造体です。 c:member:" "`PyTypeObject.tp_getset` スロットの説明も参照してください。" -#: ../../c-api/structures.rst:700 +#: ../../c-api/structures.rst:462 +msgid "name" +msgstr "name" + +#: ../../c-api/structures.rst:462 msgid "attribute name" msgstr "属性名" -#: ../../c-api/structures.rst:704 -msgid "C function to get the attribute." +#: ../../c-api/structures.rst:464 +msgid "get" +msgstr "get" + +#: ../../c-api/structures.rst:464 +msgid "getter" +msgstr "getter" + +#: ../../c-api/structures.rst:464 +msgid "C Function to get the attribute" msgstr "" -#: ../../c-api/structures.rst:708 +#: ../../c-api/structures.rst:466 +msgid "set" +msgstr "集合" + +#: ../../c-api/structures.rst:466 +msgid "setter" +msgstr "setter" + +#: ../../c-api/structures.rst:466 msgid "" -"Optional C function to set or delete the attribute. If ``NULL``, the " -"attribute is read-only." +"optional C function to set or delete the attribute, if omitted the attribute " +"is readonly" msgstr "" +"属性をセット/削除する任意のC言語関数。省略された場合、属性は読み取り専用にな" +"ります。" + +#: ../../c-api/structures.rst:470 +msgid "doc" +msgstr "doc" -#: ../../c-api/structures.rst:713 +#: ../../c-api/structures.rst:470 msgid "optional docstring" msgstr "任意のドキュメンテーション文字列" -#: ../../c-api/structures.rst:717 +#: ../../c-api/structures.rst:472 +msgid "closure" +msgstr "closure" + +#: ../../c-api/structures.rst:472 +msgid "void \\*" +msgstr "void \\*" + +#: ../../c-api/structures.rst:472 msgid "" -"Optional user data pointer, providing additional data for getter and setter." -msgstr "" +"optional function pointer, providing additional data for getter and setter" +msgstr "getterとsetterの追加データを提供する、オプションの関数ポインタ。" -#: ../../c-api/structures.rst:721 +#: ../../c-api/structures.rst:477 msgid "" -"The ``get`` function takes one :c:expr:`PyObject*` parameter (the instance) " -"and a user data pointer (the associated ``closure``):" +"The ``get`` function takes one :c:type:`PyObject*` parameter (the instance) " +"and a function pointer (the associated ``closure``)::" msgstr "" -#: ../../c-api/structures.rst:724 +#: ../../c-api/structures.rst:482 msgid "" "It should return a new reference on success or ``NULL`` with a set exception " "on failure." msgstr "" "成功または失敗時に ``NULL`` と例外の集合にされたときは新しい参照を返します。" -#: ../../c-api/structures.rst:729 +#: ../../c-api/structures.rst:485 msgid "" -"``set`` functions take two :c:expr:`PyObject*` parameters (the instance and " -"the value to be set) and a user data pointer (the associated ``closure``):" +"``set`` functions take two :c:type:`PyObject*` parameters (the instance and " +"the value to be set) and a function pointer (the associated ``closure``)::" msgstr "" -#: ../../c-api/structures.rst:732 +#: ../../c-api/structures.rst:490 msgid "" "In case the attribute should be deleted the second parameter is ``NULL``. " "Should return ``0`` on success or ``-1`` with a set exception on failure." msgstr "" "属性を削除する場合は、2 番目のパラメータに ``NULL`` を指定します。成功した場" "合は ``0`` を、失敗した場合は ``-1`` を例外として返します。" - -#: ../../c-api/structures.rst:375 ../../c-api/structures.rst:385 -msgid "built-in function" -msgstr "組み込み関数" - -#: ../../c-api/structures.rst:375 -msgid "classmethod" -msgstr "クラスメソッド" - -#: ../../c-api/structures.rst:385 -msgid "staticmethod" -msgstr "静的メソッド" - -#: ../../c-api/structures.rst:575 -msgid "READ_RESTRICTED (C macro)" -msgstr "" - -#: ../../c-api/structures.rst:575 -msgid "WRITE_RESTRICTED (C macro)" -msgstr "" - -#: ../../c-api/structures.rst:575 -msgid "RESTRICTED (C macro)" -msgstr "" - -#: ../../c-api/structures.rst:588 -msgid "READONLY (C macro)" -msgstr "" - -#: ../../c-api/structures.rst:651 -msgid "T_BYTE (C macro)" -msgstr "" - -#: ../../c-api/structures.rst:651 -msgid "T_SHORT (C macro)" -msgstr "" - -#: ../../c-api/structures.rst:651 -msgid "T_INT (C macro)" -msgstr "" - -#: ../../c-api/structures.rst:651 -msgid "T_LONG (C macro)" -msgstr "" - -#: ../../c-api/structures.rst:651 -msgid "T_LONGLONG (C macro)" -msgstr "" - -#: ../../c-api/structures.rst:651 -msgid "T_UBYTE (C macro)" -msgstr "" - -#: ../../c-api/structures.rst:651 -msgid "T_USHORT (C macro)" -msgstr "" - -#: ../../c-api/structures.rst:651 -msgid "T_UINT (C macro)" -msgstr "" - -#: ../../c-api/structures.rst:651 -msgid "T_ULONG (C macro)" -msgstr "" - -#: ../../c-api/structures.rst:651 -msgid "T_ULONGULONG (C macro)" -msgstr "" - -#: ../../c-api/structures.rst:651 -msgid "T_PYSSIZET (C macro)" -msgstr "" - -#: ../../c-api/structures.rst:651 -msgid "T_FLOAT (C macro)" -msgstr "" - -#: ../../c-api/structures.rst:651 -msgid "T_DOUBLE (C macro)" -msgstr "" - -#: ../../c-api/structures.rst:651 -msgid "T_BOOL (C macro)" -msgstr "" - -#: ../../c-api/structures.rst:651 -msgid "T_CHAR (C macro)" -msgstr "" - -#: ../../c-api/structures.rst:651 -msgid "T_STRING (C macro)" -msgstr "" - -#: ../../c-api/structures.rst:651 -msgid "T_STRING_INPLACE (C macro)" -msgstr "" - -#: ../../c-api/structures.rst:651 -msgid "T_OBJECT_EX (C macro)" -msgstr "" - -#: ../../c-api/structures.rst:651 -msgid "structmember.h" -msgstr "" diff --git a/c-api/sys.po b/c-api/sys.po index 4d2c71bcc..d9b88ae28 100644 --- a/c-api/sys.po +++ b/c-api/sys.po @@ -1,58 +1,68 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Tetsuo Koyama , 2021 -# Arihiro TAKASE, 2023 -# tomo, 2023 +# E. Kawashima, 2017 +# Arihiro TAKASE, 2017 +# tomo, 2020 +# Tetsuo Koyama , 2020 +# mollinaca, 2020 +# Osamu NAKAMURA, 2021 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:50+0000\n" -"Last-Translator: tomo, 2023\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-03-02 05:36+0000\n" +"PO-Revision-Date: 2017-02-16 17:39+0000\n" +"Last-Translator: Osamu NAKAMURA, 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/sys.rst:6 msgid "Operating System Utilities" msgstr "オペレーティングシステム関連のユーティリティ" -#: ../../c-api/sys.rst:11 +#: ../../c-api/sys.rst:10 msgid "" "Return the file system representation for *path*. If the object is a :class:" -"`str` or :class:`bytes` object, then a new :term:`strong reference` is " -"returned. If the object implements the :class:`os.PathLike` interface, then :" -"meth:`~os.PathLike.__fspath__` is returned as long as it is a :class:`str` " -"or :class:`bytes` object. Otherwise :exc:`TypeError` is raised and ``NULL`` " -"is returned." +"`str` or :class:`bytes` object, then its reference count is incremented. If " +"the object implements the :class:`os.PathLike` interface, then :meth:`~os." +"PathLike.__fspath__` is returned as long as it is a :class:`str` or :class:" +"`bytes` object. Otherwise :exc:`TypeError` is raised and ``NULL`` is " +"returned." msgstr "" +"*path* のファイルシステム表現を返します。オブジェクトが :class:`str` か :" +"class:`bytes` の場合は、その参照カウンタがインクリメントされます。オブジェク" +"トが :class:`os.PathLike` インターフェースを実装している場合、:meth:`~os." +"PathLike.__fspath__` が呼び出され、その結果が :class:`str` が :class:`bytes` " +"であればその値が返されます。さもなければ、:exc:`TypeError` が送出され、" +"``NULL`` が返されます。" -#: ../../c-api/sys.rst:24 +#: ../../c-api/sys.rst:22 msgid "" "Return true (nonzero) if the standard I/O file *fp* with name *filename* is " "deemed interactive. This is the case for files for which " -"``isatty(fileno(fp))`` is true. If the :c:member:`PyConfig.interactive` is " -"non-zero, this function also returns true if the *filename* pointer is " -"``NULL`` or if the name is equal to one of the strings ``''`` or " -"``'???'``." -msgstr "" - -#: ../../c-api/sys.rst:30 -msgid "This function must not be called before Python is initialized." +"``isatty(fileno(fp))`` is true. If the global flag :c:data:" +"`Py_InteractiveFlag` is true, this function also returns true if the " +"*filename* pointer is ``NULL`` or if the name is equal to one of the strings " +"``''`` or ``'???'``." msgstr "" +"*filename* という名前の標準 I/O ファイル *fp* が対話的 (interactive) であると" +"考えられる場合に真 (非ゼロ) を返します。これは ``isatty(fileno(fp))`` が真に" +"なるファイルの場合です。グローバルなフラグ :c:data:`Py_InteractiveFlag` が真" +"の場合には、 *filename* ポインタが ``NULL`` か、名前が ``''`` または " +"``'???'`` のいずれかに等しい場合にも真を返します。" -#: ../../c-api/sys.rst:35 +#: ../../c-api/sys.rst:31 msgid "" "Function to prepare some internal state before a process fork. This should " "be called before calling :c:func:`fork` or any similar function that clones " @@ -64,14 +74,14 @@ msgstr "" "数を呼びださなければなりません。:c:func:`fork` が定義されているシステムでのみ" "利用できます。" -#: ../../c-api/sys.rst:41 +#: ../../c-api/sys.rst:37 msgid "" "The C :c:func:`fork` call should only be made from the :ref:`\"main\" thread " "` (of the :ref:`\"main\" interpreter `). The same is true for ``PyOS_BeforeFork()``." msgstr "" -#: ../../c-api/sys.rst:51 +#: ../../c-api/sys.rst:47 msgid "" "Function to update some internal state after a process fork. This should be " "called from the parent process after calling :c:func:`fork` or any similar " @@ -84,14 +94,14 @@ msgstr "" "製が成功したかどうかにかかわらず、親プロセスからこの関数を呼び出さなければな" "りません。:c:func:`fork` が定義されているシステムでのみ利用できます。" -#: ../../c-api/sys.rst:58 +#: ../../c-api/sys.rst:54 msgid "" "The C :c:func:`fork` call should only be made from the :ref:`\"main\" thread " "` (of the :ref:`\"main\" interpreter `). The same is true for ``PyOS_AfterFork_Parent()``." msgstr "" -#: ../../c-api/sys.rst:68 +#: ../../c-api/sys.rst:64 msgid "" "Function to update internal interpreter state after a process fork. This " "must be called from the child process after calling :c:func:`fork`, or any " @@ -100,14 +110,14 @@ msgid "" "systems where :c:func:`fork` is defined." msgstr "" -#: ../../c-api/sys.rst:75 +#: ../../c-api/sys.rst:71 msgid "" "The C :c:func:`fork` call should only be made from the :ref:`\"main\" thread " "` (of the :ref:`\"main\" interpreter `). The same is true for ``PyOS_AfterFork_Child()``." msgstr "" -#: ../../c-api/sys.rst:83 +#: ../../c-api/sys.rst:79 msgid "" ":func:`os.register_at_fork` allows registering custom Python functions to be " "called by :c:func:`PyOS_BeforeFork()`, :c:func:`PyOS_AfterFork_Parent` and :" @@ -117,7 +127,7 @@ msgstr "" "func:`PyOS_AfterFork_Parent` :c:func:`PyOS_AfterFork_Child` によって呼び出さ" "れるカスタムのPython関数を登録できます。" -#: ../../c-api/sys.rst:90 +#: ../../c-api/sys.rst:86 msgid "" "Function to update some internal state after a process fork; this should be " "called in the new process if the Python interpreter will continue to be " @@ -129,65 +139,94 @@ msgstr "" "ん。新たなプロセスに新たな実行可能物をロードする場合、この関数を呼び出す必要" "はありません。" -#: ../../c-api/sys.rst:95 +#: ../../c-api/sys.rst:91 msgid "This function is superseded by :c:func:`PyOS_AfterFork_Child()`." msgstr "" "この関数は :c:func:`PyOS_AfterFork_Child()` によって置き換えられました。" -#: ../../c-api/sys.rst:103 +#: ../../c-api/sys.rst:97 msgid "" "Return true when the interpreter runs out of stack space. This is a " -"reliable check, but is only available when :c:macro:`!USE_STACKCHECK` is " -"defined (currently on certain versions of Windows using the Microsoft Visual " -"C++ compiler). :c:macro:`!USE_STACKCHECK` will be defined automatically; you " -"should never change the definition in your own code." +"reliable check, but is only available when :const:`USE_STACKCHECK` is " +"defined (currently on Windows using the Microsoft Visual C++ compiler). :" +"const:`USE_STACKCHECK` will be defined automatically; you should never " +"change the definition in your own code." msgstr "" +"インタプリタがスタック空間を使い尽くしたときに真を返します。このチェック関数" +"には信頼性がありますが、 :const:`USE_STACKCHECK` が定義されている場合 (現状で" +"は Microsoft Visual C++ コンパイラでビルドした Windows 版) にしか利用できませ" +"ん . :const:`USE_STACKCHECK` は自動的に定義されます; 自前のコードでこの定義を" +"変更してはなりません。" -#: ../../c-api/sys.rst:115 +#: ../../c-api/sys.rst:106 msgid "" "Return the current signal handler for signal *i*. This is a thin wrapper " -"around either :c:func:`!sigaction` or :c:func:`!signal`. Do not call those " -"functions directly!" +"around either :c:func:`sigaction` or :c:func:`signal`. Do not call those " +"functions directly! :c:type:`PyOS_sighandler_t` is a typedef alias for :c:" +"type:`void (\\*)(int)`." msgstr "" +"シグナル *i* に対する現在のシグナルハンドラを返します。この関数は :c:func:" +"`sigaction` または :c:func:`signal` のいずれかに対する薄いラッパーです。 :c:" +"func:`sigaction` や :c:func:`signal` を直接呼び出してはなりません! :c:type:" +"`PyOS_sighandler_t` は :c:type:`void (\\*)(int)` の typedef による別名です。" -#: ../../c-api/sys.rst:122 +#: ../../c-api/sys.rst:114 msgid "" "Set the signal handler for signal *i* to be *h*; return the old signal " -"handler. This is a thin wrapper around either :c:func:`!sigaction` or :c:" -"func:`!signal`. Do not call those functions directly!" -msgstr "" +"handler. This is a thin wrapper around either :c:func:`sigaction` or :c:func:" +"`signal`. Do not call those functions directly! :c:type:" +"`PyOS_sighandler_t` is a typedef alias for :c:type:`void (\\*)(int)`." +msgstr "" +"シグナル *i* に対する現在のシグナルハンドラを *h* に設定します; 以前のシグナ" +"ルハンドラを返します。この関数は :c:func:`sigaction` または :c:func:`signal` " +"のいずれかに対する薄いラッパーです。 :c:func:`sigaction` や :c:func:`signal` " +"を直接呼び出してはなりません! :c:type:`PyOS_sighandler_t` は :c:type:`void " +"(\\*)(int)` の typedef による別名です。" + +#: ../../c-api/sys.rst:121 +msgid "" +"Decode a byte string from the locale encoding with the :ref:`surrogateescape " +"error handler `: undecodable bytes are decoded as " +"characters in range U+DC80..U+DCFF. If a byte sequence can be decoded as a " +"surrogate character, escape the bytes using the surrogateescape error " +"handler instead of decoding them." +msgstr "" +":ref:`surrogateescape エラーハンドラ ` を使って、ロケールエ" +"ンコーディングのバイト文字列をデコードします:\n" +"デコードできないバイトは U+DC80 から U+DCFF までの範囲の文字としてデコードさ" +"れます。\n" +"バイト列がサロゲート文字としてデコードされる場合は、そのままデコードするので" +"はなく surrogateescape エラーハンドラを使ってバイト列をエスケープします。" -#: ../../c-api/sys.rst:129 -msgid "" -"This function should not be called directly: use the :c:type:`PyConfig` API " -"with the :c:func:`PyConfig_SetBytesString` function which ensures that :ref:" -"`Python is preinitialized `." +#: ../../c-api/sys.rst:127 ../../c-api/sys.rst:173 +msgid "Encoding, highest priority to lowest priority:" +msgstr "エンコーディング(優先度の高い順から):" + +#: ../../c-api/sys.rst:129 ../../c-api/sys.rst:175 +msgid "``UTF-8`` on macOS, Android, and VxWorks;" msgstr "" -#: ../../c-api/sys.rst:133 ../../c-api/sys.rst:200 +#: ../../c-api/sys.rst:130 ../../c-api/sys.rst:176 msgid "" -"This function must not be called before :ref:`Python is preinitialized ` and so that the LC_CTYPE locale is properly configured: see the :c:" -"func:`Py_PreInitialize` function." +"``UTF-8`` on Windows if :c:data:`Py_LegacyWindowsFSEncodingFlag` is zero;" msgstr "" -#: ../../c-api/sys.rst:137 +#: ../../c-api/sys.rst:131 ../../c-api/sys.rst:177 +msgid "``UTF-8`` if the Python UTF-8 mode is enabled;" +msgstr "``UTF-8`` Python UTF-8モードが有効な場合" + +#: ../../c-api/sys.rst:132 ../../c-api/sys.rst:178 msgid "" -"Decode a byte string from the :term:`filesystem encoding and error handler`. " -"If the error handler is :ref:`surrogateescape error handler " -"`, undecodable bytes are decoded as characters in range " -"U+DC80..U+DCFF; and if a byte sequence can be decoded as a surrogate " -"character, the bytes are escaped using the surrogateescape error handler " -"instead of decoding them." +"``ASCII`` if the ``LC_CTYPE`` locale is ``\"C\"``, ``nl_langinfo(CODESET)`` " +"returns the ``ASCII`` encoding (or an alias), and :c:func:`mbstowcs` and :c:" +"func:`wcstombs` functions uses the ``ISO-8859-1`` encoding." msgstr "" -":term:`ファイルシステムのエンコーディングとエラーハンドラ ` からバイト文字列をデコードします。エラーハンドラ" -"が :ref:`surrogateescape エラーハンドラ ` なら、\n" -"デコードできないバイトは U+DC80 から U+DCFF までの範囲の文字としてデコードさ" -"れ、バイト列がサロゲート文字としてデコードできる場合は、デコードするのではな" -"く surrogateescape エラーハンドラを使ってバイト列がエスケープされます。" -#: ../../c-api/sys.rst:144 +#: ../../c-api/sys.rst:136 ../../c-api/sys.rst:182 +msgid "the current locale encoding." +msgstr "現在のロケールエンコーディング" + +#: ../../c-api/sys.rst:138 msgid "" "Return a pointer to a newly allocated wide character string, use :c:func:" "`PyMem_RawFree` to free the memory. If size is not ``NULL``, write the " @@ -198,7 +237,7 @@ msgstr "" "引数 size が ``NULL`` でない場合は、 null 文字以外のワイドキャラクターの数を " "``*size`` へ書き込みます。" -#: ../../c-api/sys.rst:148 +#: ../../c-api/sys.rst:142 msgid "" "Return ``NULL`` on decoding error or memory allocation error. If *size* is " "not ``NULL``, ``*size`` is set to ``(size_t)-1`` on memory error or set to " @@ -208,19 +247,12 @@ msgstr "" "*size* が ``NULL`` でない場合は、メモリエラーのときは ``(size_t)-1`` を、デ" "コードでのエラーのときは ``(size_t)-2`` を ``*size`` に設定します。" -#: ../../c-api/sys.rst:152 ../../c-api/sys.rst:192 -msgid "" -"The :term:`filesystem encoding and error handler` are selected by :c:func:" -"`PyConfig_Read`: see :c:member:`~PyConfig.filesystem_encoding` and :c:member:" -"`~PyConfig.filesystem_errors` members of :c:type:`PyConfig`." -msgstr "" - -#: ../../c-api/sys.rst:156 +#: ../../c-api/sys.rst:146 msgid "" "Decoding errors should never happen, unless there is a bug in the C library." msgstr "C ライブラリーにバグがない限り、デコードでのエラーは起こりえません。" -#: ../../c-api/sys.rst:159 +#: ../../c-api/sys.rst:149 msgid "" "Use the :c:func:`Py_EncodeLocale` function to encode the character string " "back to a byte string." @@ -228,7 +260,7 @@ msgstr "" "キャラクター文字列をバイト文字列に戻すには :c:func:`Py_EncodeLocale` 関数を" "使ってください。" -#: ../../c-api/sys.rst:164 +#: ../../c-api/sys.rst:154 msgid "" "The :c:func:`PyUnicode_DecodeFSDefaultAndSize` and :c:func:" "`PyUnicode_DecodeLocaleAndSize` functions." @@ -236,50 +268,49 @@ msgstr "" ":c:func:`PyUnicode_DecodeFSDefaultAndSize` および :c:func:" "`PyUnicode_DecodeLocaleAndSize` 関数。" -#: ../../c-api/sys.rst:169 ../../c-api/sys.rst:211 -msgid "" -"The function now uses the UTF-8 encoding in the :ref:`Python UTF-8 Mode " -"`." +#: ../../c-api/sys.rst:159 ../../c-api/sys.rst:203 +msgid "The function now uses the UTF-8 encoding in the UTF-8 mode." msgstr "" -"この関数は、:ref:`Python UTF-8 Mode ` ではUTF-8エンコーディングを" -"利用するようになりました。" +"この関数は、UTF-8モードではUTF-8エンコーディングを利用するようになりました。" -#: ../../c-api/sys.rst:173 +#: ../../c-api/sys.rst:162 ../../c-api/sys.rst:206 msgid "" -"The function now uses the UTF-8 encoding on Windows if :c:member:" -"`PyPreConfig.legacy_windows_fs_encoding` is zero;" +"The function now uses the UTF-8 encoding on Windows if :c:data:" +"`Py_LegacyWindowsFSEncodingFlag` is zero;" msgstr "" -#: ../../c-api/sys.rst:180 +#: ../../c-api/sys.rst:169 msgid "" -"Encode a wide character string to the :term:`filesystem encoding and error " -"handler`. If the error handler is :ref:`surrogateescape error handler " -"`, surrogate characters in the range U+DC80..U+DCFF are " -"converted to bytes 0x80..0xFF." +"Encode a wide character string to the locale encoding with the :ref:" +"`surrogateescape error handler `: surrogate characters in " +"the range U+DC80..U+DCFF are converted to bytes 0x80..0xFF." msgstr "" -"ワイドキャラクター文字列を :term:`ファイルシステムのエンコーディングとエラー" -"ハンドラ ` にエンコードします。エラー" -"ハンドラが :ref:`surrogateescape エラーハンドラ ` なら、\n" +":ref:`surrogateescape エラーハンドラ ` を使って、ワイドキャ" +"ラクター文字列をロケールエンコーディングにエンコードします:\n" "U+DC80 から U+DCFF までの範囲のサロゲート文字は 0x80 から 0xFF までのバイトに" "変換されます。" -#: ../../c-api/sys.rst:185 +#: ../../c-api/sys.rst:184 +msgid "The function uses the UTF-8 encoding in the Python UTF-8 mode." +msgstr "この関数は、Python UTF-8モードではUTF-8エンコーディングを使います。" + +#: ../../c-api/sys.rst:186 msgid "" "Return a pointer to a newly allocated byte string, use :c:func:`PyMem_Free` " "to free the memory. Return ``NULL`` on encoding error or memory allocation " -"error." +"error" msgstr "" "新しくメモリ確保されたバイト文字列へのポインタを返します。\n" "このメモリを解放するのには :c:func:`PyMem_Free` を使ってください。\n" "エンコードエラーかメモリ確保エラーのときは ``NULL`` を返します。" -#: ../../c-api/sys.rst:189 +#: ../../c-api/sys.rst:190 msgid "" "If error_pos is not ``NULL``, ``*error_pos`` is set to ``(size_t)-1`` on " "success, or set to the index of the invalid character on encoding error." msgstr "" -#: ../../c-api/sys.rst:196 +#: ../../c-api/sys.rst:193 msgid "" "Use the :c:func:`Py_DecodeLocale` function to decode the bytes string back " "to a wide character string." @@ -287,7 +318,7 @@ msgstr "" "バイト文字列をワイドキャラクター文字列に戻すには :c:func:`Py_DecodeLocale` 関" "数を使ってください。" -#: ../../c-api/sys.rst:206 +#: ../../c-api/sys.rst:198 msgid "" "The :c:func:`PyUnicode_EncodeFSDefault` and :c:func:`PyUnicode_EncodeLocale` " "functions." @@ -295,60 +326,11 @@ msgstr "" ":c:func:`PyUnicode_EncodeFSDefault` および :c:func:`PyUnicode_EncodeLocale` " "関数。" -#: ../../c-api/sys.rst:215 -msgid "" -"The function now uses the UTF-8 encoding on Windows if :c:member:" -"`PyPreConfig.legacy_windows_fs_encoding` is zero." -msgstr "" - -#: ../../c-api/sys.rst:221 -msgid "" -"Similar to :c:func:`!fopen`, but *path* is a Python object and an exception " -"is set on error." -msgstr "" - -#: ../../c-api/sys.rst:224 -msgid "" -"*path* must be a :class:`str` object, a :class:`bytes` object, or a :term:" -"`path-like object`." -msgstr "" - -#: ../../c-api/sys.rst:227 -msgid "" -"On success, return the new file pointer. On error, set an exception and " -"return ``NULL``." -msgstr "" - -#: ../../c-api/sys.rst:230 -msgid "" -"The file must be closed by :c:func:`Py_fclose` rather than calling directly :" -"c:func:`!fclose`." -msgstr "" - -#: ../../c-api/sys.rst:233 -msgid "The file descriptor is created non-inheritable (:pep:`446`)." -msgstr "" - -#: ../../c-api/sys.rst:235 -msgid "The caller must have an :term:`attached thread state`." -msgstr "" - -#: ../../c-api/sys.rst:242 -msgid "Close a file that was opened by :c:func:`Py_fopen`." -msgstr "" - -#: ../../c-api/sys.rst:244 -msgid "" -"On success, return ``0``. On error, return ``EOF`` and ``errno`` is set to " -"indicate the error. In either case, any further access (including another " -"call to :c:func:`Py_fclose`) to the stream results in undefined behavior." -msgstr "" - -#: ../../c-api/sys.rst:255 +#: ../../c-api/sys.rst:214 msgid "System Functions" msgstr "システム関数" -#: ../../c-api/sys.rst:257 +#: ../../c-api/sys.rst:216 msgid "" "These are utility functions that make functionality from the :mod:`sys` " "module accessible to C code. They all work with the current interpreter " @@ -359,7 +341,7 @@ msgstr "" "すべての関数は現在のインタプリタスレッドの :mod:`sys` モジュールの辞書に対し" "て動作します。この辞書は内部のスレッド状態構造体に格納されています。" -#: ../../c-api/sys.rst:263 +#: ../../c-api/sys.rst:222 msgid "" "Return the object *name* from the :mod:`sys` module or ``NULL`` if it does " "not exist, without setting an exception." @@ -367,7 +349,7 @@ msgstr "" ":mod:`sys` モジュールの *name* オブジェクトを返すか、存在しなければ例外を設定" "せずに ``NULL`` を返します。" -#: ../../c-api/sys.rst:268 +#: ../../c-api/sys.rst:227 msgid "" "Set *name* in the :mod:`sys` module to *v* unless *v* is ``NULL``, in which " "case *name* is deleted from the sys module. Returns ``0`` on success, ``-1`` " @@ -377,17 +359,42 @@ msgstr "" "す。 *v* が ``NULL`` なら、 sys モジュールから *name* を削除します。成功した" "ら ``0`` を、エラー時は ``-1`` を返します。" -#: ../../c-api/sys.rst:274 +#: ../../c-api/sys.rst:233 msgid "" "Reset :data:`sys.warnoptions` to an empty list. This function may be called " "prior to :c:func:`Py_Initialize`." msgstr "" -#: ../../c-api/sys.rst:277 -msgid "Clear :data:`sys.warnoptions` and :data:`!warnings.filters` instead." +#: ../../c-api/sys.rst:238 +msgid "" +"Append *s* to :data:`sys.warnoptions`. This function must be called prior " +"to :c:func:`Py_Initialize` in order to affect the warnings filter list." +msgstr "" + +#: ../../c-api/sys.rst:243 +msgid "Append *unicode* to :data:`sys.warnoptions`." +msgstr ":data:`sys.warnoptions` に *unicode* を追加します。" + +#: ../../c-api/sys.rst:245 +msgid "" +"Note: this function is not currently usable from outside the CPython " +"implementation, as it must be called prior to the implicit import of :mod:" +"`warnings` in :c:func:`Py_Initialize` to be effective, but can't be called " +"until enough of the runtime has been initialized to permit the creation of " +"Unicode objects." +msgstr "" + +#: ../../c-api/sys.rst:253 +msgid "" +"Set :data:`sys.path` to a list object of paths found in *path* which should " +"be a list of paths separated with the platform's search path delimiter (``:" +"`` on Unix, ``;`` on Windows)." msgstr "" +":data:`sys.path` を *path* に含まれるパスの、リストオブジェクトに設定しま" +"す。 *path* はプラットフォームの検索パスデリミタ(Unixでは ``:``, Windows で" +"は ``;``) で区切られたパスのリストでなければなりません。" -#: ../../c-api/sys.rst:282 +#: ../../c-api/sys.rst:259 msgid "" "Write the output string described by *format* to :data:`sys.stdout`. No " "exceptions are raised, even if truncation occurs (see below)." @@ -395,7 +402,7 @@ msgstr "" "*format* で指定された出力文字列を :data:`sys.stdout` に出力します。切り詰めが" "起こった場合を含め、例外は一切発生しません (後述)。" -#: ../../c-api/sys.rst:285 +#: ../../c-api/sys.rst:262 msgid "" "*format* should limit the total size of the formatted output string to 1000 " "bytes or less -- after 1000 bytes, the output string is truncated. In " @@ -412,7 +419,7 @@ msgstr "" "いように設定するべきです。同じように \"%f\" にも気を付ける必要があります。非" "常に大きい数値に対して、数百の数字を出力する可能性があります。" -#: ../../c-api/sys.rst:293 +#: ../../c-api/sys.rst:270 msgid "" "If a problem occurs, or :data:`sys.stdout` is unset, the formatted message " "is written to the real (C level) *stdout*." @@ -420,7 +427,7 @@ msgstr "" "問題が発生したり、 :data:`sys.stdout` が設定されていなかった場合、フォーマッ" "ト後のメッセージは本物の(Cレベルの) *stdout* に出力されます。" -#: ../../c-api/sys.rst:298 +#: ../../c-api/sys.rst:275 msgid "" "As :c:func:`PySys_WriteStdout`, but write to :data:`sys.stderr` or *stderr* " "instead." @@ -428,7 +435,7 @@ msgstr "" ":c:func:`PySys_WriteStdout` と同じですが、 :data:`sys.stderr` もしくは " "*stderr* に出力します。" -#: ../../c-api/sys.rst:303 +#: ../../c-api/sys.rst:280 msgid "" "Function similar to PySys_WriteStdout() but format the message using :c:func:" "`PyUnicode_FromFormatV` and don't truncate the message to an arbitrary " @@ -438,7 +445,7 @@ msgstr "" "てメッセージをフォーマットし、メッセージを任意の長さに切り詰めたりはしませ" "ん。" -#: ../../c-api/sys.rst:311 +#: ../../c-api/sys.rst:288 msgid "" "As :c:func:`PySys_FormatStdout`, but write to :data:`sys.stderr` or *stderr* " "instead." @@ -446,7 +453,14 @@ msgstr "" ":c:func:`PySys_FormatStdout` と同じですが、 :data:`sys.stderr` もしくは " "*stderr* に出力します。" -#: ../../c-api/sys.rst:318 +#: ../../c-api/sys.rst:295 +msgid "" +"Parse *s* as a set of :option:`-X` options and add them to the current " +"options mapping as returned by :c:func:`PySys_GetXOptions`. This function " +"may be called prior to :c:func:`Py_Initialize`." +msgstr "" + +#: ../../c-api/sys.rst:303 msgid "" "Return the current dictionary of :option:`-X` options, similarly to :data:" "`sys._xoptions`. On error, ``NULL`` is returned and an exception is set." @@ -454,66 +468,48 @@ msgstr "" ":data:`sys._xoptions` と同様、 :option:`-X` オプションの現在の辞書を返しま" "す。エラーが起きると、 ``NULL`` が返され、例外がセットされます。" -#: ../../c-api/sys.rst:327 +#: ../../c-api/sys.rst:312 msgid "" "Raise an auditing event with any active hooks. Return zero for success and " "non-zero with an exception set on failure." msgstr "" -#: ../../c-api/sys.rst:330 -msgid "The *event* string argument must not be *NULL*." -msgstr "" - -#: ../../c-api/sys.rst:332 +#: ../../c-api/sys.rst:315 msgid "" "If any hooks have been added, *format* and other arguments will be used to " "construct a tuple to pass. Apart from ``N``, the same format characters as " "used in :c:func:`Py_BuildValue` are available. If the built value is not a " -"tuple, it will be added into a single-element tuple." -msgstr "" - -#: ../../c-api/sys.rst:337 -msgid "" -"The ``N`` format option must not be used. It consumes a reference, but since " -"there is no way to know whether arguments to this function will be consumed, " -"using it may cause reference leaks." +"tuple, it will be added into a single-element tuple. (The ``N`` format " +"option consumes a reference, but since there is no way to know whether " +"arguments to this function will be consumed, using it may cause reference " +"leaks.)" msgstr "" -#: ../../c-api/sys.rst:341 +#: ../../c-api/sys.rst:323 msgid "" -"Note that ``#`` format characters should always be treated as :c:type:" -"`Py_ssize_t`, regardless of whether ``PY_SSIZE_T_CLEAN`` was defined." +"Note that ``#`` format characters should always be treated as " +"``Py_ssize_t``, regardless of whether ``PY_SSIZE_T_CLEAN`` was defined." msgstr "" -#: ../../c-api/sys.rst:344 +#: ../../c-api/sys.rst:326 msgid ":func:`sys.audit` performs the same function from Python code." msgstr "" -#: ../../c-api/sys.rst:346 -msgid "See also :c:func:`PySys_AuditTuple`." -msgstr "" - -#: ../../c-api/sys.rst:352 +#: ../../c-api/sys.rst:332 msgid "" -"Require :c:type:`Py_ssize_t` for ``#`` format characters. Previously, an " +"Require ``Py_ssize_t`` for ``#`` format characters. Previously, an " "unavoidable deprecation warning was raised." msgstr "" -#: ../../c-api/sys.rst:358 -msgid "" -"Similar to :c:func:`PySys_Audit`, but pass arguments as a Python object. " -"*args* must be a :class:`tuple`. To pass no arguments, *args* can be *NULL*." -msgstr "" - -#: ../../c-api/sys.rst:366 +#: ../../c-api/sys.rst:338 msgid "" "Append the callable *hook* to the list of active auditing hooks. Return zero " -"on success and non-zero on failure. If the runtime has been initialized, " +"for success and non-zero on failure. If the runtime has been initialized, " "also set an error on failure. Hooks added through this API are called for " "all interpreters created by the runtime." msgstr "" -#: ../../c-api/sys.rst:372 +#: ../../c-api/sys.rst:344 msgid "" "The *userData* pointer is passed into the hook function. Since hook " "functions may be called from different runtimes, this pointer should not " @@ -523,7 +519,7 @@ msgstr "" "フック関数は別なランタイムから呼び出されるかもしれないので、このポインタは直" "接 Python の状態を参照すべきではありません。" -#: ../../c-api/sys.rst:376 +#: ../../c-api/sys.rst:348 msgid "" "This function is safe to call before :c:func:`Py_Initialize`. When called " "after runtime initialization, existing audit hooks are notified and may " @@ -531,62 +527,70 @@ msgid "" "`Exception` (other errors will not be silenced)." msgstr "" -#: ../../c-api/sys.rst:381 +#: ../../c-api/sys.rst:353 msgid "" -"The hook function is always called with an :term:`attached thread state` by " -"the Python interpreter that raised the event." +"The hook function is of type :c:type:`int (*)(const char *event, PyObject " +"*args, void *userData)`, where *args* is guaranteed to be a :c:type:" +"`PyTupleObject`. The hook function is always called with the GIL held by the " +"Python interpreter that raised the event." msgstr "" -#: ../../c-api/sys.rst:384 +#: ../../c-api/sys.rst:358 msgid "" "See :pep:`578` for a detailed description of auditing. Functions in the " "runtime and standard library that raise events are listed in the :ref:`audit " "events table `. Details are in each function's documentation." msgstr "" -#: ../../c-api/sys.rst:389 ../../c-api/sys.rst:391 +#: ../../c-api/sys.rst:363 +msgid "" +"Raises an :ref:`auditing event ` ``sys.addaudithook`` with no " +"arguments." +msgstr "" +"引数無しで :ref:`監査イベント ` ``sys.addaudithook`` を送出しま" +"す。 " + +#: ../../c-api/sys.rst:365 msgid "" -"If the interpreter is initialized, this function raises an auditing event " +"If the interpreter is initialized, this function raises a auditing event " "``sys.addaudithook`` with no arguments. If any existing hooks raise an " "exception derived from :class:`Exception`, the new hook will not be added " "and the exception is cleared. As a result, callers cannot assume that their " "hook has been added unless they control all existing hooks." msgstr "" -#: ../../c-api/sys.rst:400 -msgid "" -"The type of the hook function. *event* is the C string event argument passed " -"to :c:func:`PySys_Audit` or :c:func:`PySys_AuditTuple`. *args* is guaranteed " -"to be a :c:type:`PyTupleObject`. *userData* is the argument passed to " -"PySys_AddAuditHook()." -msgstr "" - -#: ../../c-api/sys.rst:412 +#: ../../c-api/sys.rst:377 msgid "Process Control" msgstr "プロセス制御" -#: ../../c-api/sys.rst:419 +#: ../../c-api/sys.rst:384 msgid "" "Print a fatal error message and kill the process. No cleanup is performed. " "This function should only be invoked when a condition is detected that would " "make it dangerous to continue using the Python interpreter; e.g., when the " "object administration appears to be corrupted. On Unix, the standard C " -"library function :c:func:`!abort` is called which will attempt to produce a :" +"library function :c:func:`abort` is called which will attempt to produce a :" "file:`core` file." msgstr "" +"致命的エラーメッセージ (fatal error message) を出力してプロセスを強制終了 " +"(kill) します。後始末処理は行われません。この関数は、Python インタプリタを使" +"い続けるのが危険であるような状況が検出されたとき; 例えば、オブジェクト管理が" +"崩壊していると思われるときにのみ、呼び出されるようにしなければなりません。" +"Unixでは、標準 C ライブラリ関数 :c:func:`abort` を呼び出して :file:`core` を" +"生成しようと試みます。" -#: ../../c-api/sys.rst:426 +#: ../../c-api/sys.rst:391 msgid "" "The ``Py_FatalError()`` function is replaced with a macro which logs " "automatically the name of the current function, unless the " "``Py_LIMITED_API`` macro is defined." msgstr "" -#: ../../c-api/sys.rst:430 +#: ../../c-api/sys.rst:395 msgid "Log the function name automatically." msgstr "" -#: ../../c-api/sys.rst:440 +#: ../../c-api/sys.rst:405 msgid "" "Exit the current process. This calls :c:func:`Py_FinalizeEx` and then calls " "the standard C library function ``exit(status)``. If :c:func:" @@ -596,11 +600,11 @@ msgstr "" "ブラリ関数の ``exit(status)`` を呼び出します。:c:func:`Py_FinalizeEx` がエ" "ラーになった場合、終了ステータスは 120に設定されます。" -#: ../../c-api/sys.rst:444 +#: ../../c-api/sys.rst:409 msgid "Errors from finalization no longer ignored." msgstr "終了処理のエラーは無視されなくなりました。" -#: ../../c-api/sys.rst:454 +#: ../../c-api/sys.rst:419 msgid "" "Register a cleanup function to be called by :c:func:`Py_FinalizeEx`. The " "cleanup function will be called with no arguments and should return no " @@ -618,27 +622,3 @@ msgstr "" "た後始末処理関数から先に呼び出されます。各関数は高々一度しか呼び出されませ" "ん。 Python の内部的な終了処理は後始末処理関数より以前に完了しているので、 " "*func* からはいかなる Python API も呼び出してはなりません。" - -#: ../../c-api/sys.rst:464 -msgid ":c:func:`PyUnstable_AtExit` for passing a ``void *data`` argument." -msgstr "" - -#: ../../c-api/sys.rst:101 -msgid "USE_STACKCHECK (C macro)" -msgstr "" - -#: ../../c-api/sys.rst:417 -msgid "abort (C function)" -msgstr "" - -#: ../../c-api/sys.rst:436 ../../c-api/sys.rst:450 -msgid "Py_FinalizeEx (C function)" -msgstr "" - -#: ../../c-api/sys.rst:436 -msgid "exit (C function)" -msgstr "" - -#: ../../c-api/sys.rst:450 -msgid "cleanup functions" -msgstr "cleanup functions" diff --git a/c-api/time.po b/c-api/time.po deleted file mode 100644 index 0ef64e109..000000000 --- a/c-api/time.po +++ /dev/null @@ -1,173 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation -# This file is distributed under the same license as the Python package. -# FIRST AUTHOR , YEAR. -# -# Translators: -# tomo, 2024 -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: Python 3.14\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2024-05-11 01:07+0000\n" -"Last-Translator: tomo, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" -"ja/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#: ../../c-api/time.rst:6 -msgid "PyTime C API" -msgstr "" - -#: ../../c-api/time.rst:10 -msgid "" -"The clock C API provides access to system clocks. It is similar to the " -"Python :mod:`time` module." -msgstr "" - -#: ../../c-api/time.rst:13 -msgid "" -"For C API related to the :mod:`datetime` module, see :ref:`datetimeobjects`." -msgstr "" - -#: ../../c-api/time.rst:17 -msgid "Types" -msgstr "型" - -#: ../../c-api/time.rst:21 -msgid "" -"A timestamp or duration in nanoseconds, represented as a signed 64-bit " -"integer." -msgstr "" - -#: ../../c-api/time.rst:24 -msgid "" -"The reference point for timestamps depends on the clock used. For example, :" -"c:func:`PyTime_Time` returns timestamps relative to the UNIX epoch." -msgstr "" - -#: ../../c-api/time.rst:27 -msgid "" -"The supported range is around [-292.3 years; +292.3 years]. Using the Unix " -"epoch (January 1st, 1970) as reference, the supported date range is around " -"[1677-09-21; 2262-04-11]. The exact limits are exposed as constants:" -msgstr "" - -#: ../../c-api/time.rst:34 -msgid "Minimum value of :c:type:`PyTime_t`." -msgstr "" - -#: ../../c-api/time.rst:38 -msgid "Maximum value of :c:type:`PyTime_t`." -msgstr "" - -#: ../../c-api/time.rst:42 -msgid "Clock Functions" -msgstr "" - -#: ../../c-api/time.rst:44 -msgid "" -"The following functions take a pointer to a :c:expr:`PyTime_t` that they set " -"to the value of a particular clock. Details of each clock are given in the " -"documentation of the corresponding Python function." -msgstr "" - -#: ../../c-api/time.rst:49 -msgid "" -"The functions return ``0`` on success, or ``-1`` (with an exception set) on " -"failure." -msgstr "" - -#: ../../c-api/time.rst:52 -msgid "" -"On integer overflow, they set the :c:data:`PyExc_OverflowError` exception " -"and set ``*result`` to the value clamped to the ``[PyTime_MIN; PyTime_MAX]`` " -"range. (On current systems, integer overflows are likely caused by " -"misconfigured system time.)" -msgstr "" - -#: ../../c-api/time.rst:58 -msgid "" -"As any other C API (unless otherwise specified), the functions must be " -"called with an :term:`attached thread state`." -msgstr "" - -#: ../../c-api/time.rst:63 -msgid "" -"Read the monotonic clock. See :func:`time.monotonic` for important details " -"on this clock." -msgstr "" - -#: ../../c-api/time.rst:68 -msgid "" -"Read the performance counter. See :func:`time.perf_counter` for important " -"details on this clock." -msgstr "" - -#: ../../c-api/time.rst:73 -msgid "" -"Read the “wall clock” time. See :func:`time.time` for details important on " -"this clock." -msgstr "" - -#: ../../c-api/time.rst:78 -msgid "Raw Clock Functions" -msgstr "" - -#: ../../c-api/time.rst:80 -msgid "" -"Similar to clock functions, but don't set an exception on error and don't " -"require the caller to have an :term:`attached thread state`." -msgstr "" - -#: ../../c-api/time.rst:83 -msgid "On success, the functions return ``0``." -msgstr "" - -#: ../../c-api/time.rst:85 -msgid "" -"On failure, they set ``*result`` to ``0`` and return ``-1``, *without* " -"setting an exception. To get the cause of the error, :term:`attach ` a :term:`thread state`, and call the regular (non-``Raw``) " -"function. Note that the regular function may succeed after the ``Raw`` one " -"failed." -msgstr "" - -#: ../../c-api/time.rst:92 -msgid "" -"Similar to :c:func:`PyTime_Monotonic`, but don't set an exception on error " -"and don't require an :term:`attached thread state`." -msgstr "" - -#: ../../c-api/time.rst:97 -msgid "" -"Similar to :c:func:`PyTime_PerfCounter`, but don't set an exception on error " -"and don't require an :term:`attached thread state`." -msgstr "" - -#: ../../c-api/time.rst:102 -msgid "" -"Similar to :c:func:`PyTime_Time`, but don't set an exception on error and " -"don't require an :term:`attached thread state`." -msgstr "" - -#: ../../c-api/time.rst:107 -msgid "Conversion functions" -msgstr "" - -#: ../../c-api/time.rst:111 -msgid "Convert a timestamp to a number of seconds as a C :c:expr:`double`." -msgstr "" - -#: ../../c-api/time.rst:113 -msgid "" -"The function cannot fail, but note that :c:expr:`double` has limited " -"accuracy for large values." -msgstr "" diff --git a/c-api/tuple.po b/c-api/tuple.po index afc69e99e..ffa97916a 100644 --- a/c-api/tuple.po +++ b/c-api/tuple.po @@ -1,27 +1,30 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# yaakiyu, 2022 -# Arihiro TAKASE, 2023 -# tomo, 2023 +# 秘湯 , 2017 +# E. Kawashima, 2017 +# Arihiro TAKASE, 2017 +# Nozomu Kaneko , 2017 +# Osamu NAKAMURA, 2017 +# tomo, 2020 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:50+0000\n" -"Last-Translator: tomo, 2023\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-07 05:06+0000\n" +"PO-Revision-Date: 2017-02-16 17:39+0000\n" +"Last-Translator: tomo, 2020\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/tuple.rst:6 @@ -59,66 +62,61 @@ msgstr "" "を返します。この関数は常に成功します。" #: ../../c-api/tuple.rst:36 -msgid "" -"Return a new tuple object of size *len*, or ``NULL`` with an exception set " -"on failure." +msgid "Return a new tuple object of size *len*, or ``NULL`` on failure." msgstr "" +"サイズが *len* の新たなタプルオブジェクトを返します。失敗すると ``NULL`` を返" +"します。" -#: ../../c-api/tuple.rst:42 +#: ../../c-api/tuple.rst:41 msgid "" -"Return a new tuple object of size *n*, or ``NULL`` with an exception set on " -"failure. The tuple values are initialized to the subsequent *n* C arguments " -"pointing to Python objects. ``PyTuple_Pack(2, a, b)`` is equivalent to " +"Return a new tuple object of size *n*, or ``NULL`` on failure. The tuple " +"values are initialized to the subsequent *n* C arguments pointing to Python " +"objects. ``PyTuple_Pack(2, a, b)`` is equivalent to " "``Py_BuildValue(\"(OO)\", a, b)``." msgstr "" +"サイズが *n* の新たなタプルオブジェクトを返します。失敗すると ``NULL`` を返し" +"ます。タプルの値は後続の *n* 個の Python オブジェクトを指す C 引数になりま" +"す。``PyTuple_Pack(2, a, b)`` は ``Py_BuildValue(\"(OO)\", a, b)`` と同じで" +"す。" -#: ../../c-api/tuple.rst:50 -msgid "" -"Take a pointer to a tuple object, and return the size of that tuple. On " -"error, return ``-1`` and with an exception set." -msgstr "" - -#: ../../c-api/tuple.rst:56 -msgid "Like :c:func:`PyTuple_Size`, but without error checking." +#: ../../c-api/tuple.rst:48 +msgid "Take a pointer to a tuple object, and return the size of that tuple." msgstr "" +"タプルオブジェクトへのポインタを引数にとり、そのタプルのサイズを返します。" -#: ../../c-api/tuple.rst:61 +#: ../../c-api/tuple.rst:53 msgid "" -"Return the object at position *pos* in the tuple pointed to by *p*. If " -"*pos* is negative or out of bounds, return ``NULL`` and set an :exc:" -"`IndexError` exception." +"Return the size of the tuple *p*, which must be non-``NULL`` and point to a " +"tuple; no error checking is performed." msgstr "" -"*p* の指すタプルオブジェクト内の、位置 *pos* にあるオブジェクトを返します。 " -"*pos* が負であるか範囲を超えている場合、 ``NULL`` を返して :exc:`IndexError` " -"例外をセットします。" +"タプル *p* のサイズを返しますが、*p* は非 ``NULL`` でなくてはならず、タプルオ" +"ブジェクトを指していなければなりません; この関数はエラーチェックを行いませ" +"ん。" -#: ../../c-api/tuple.rst:64 +#: ../../c-api/tuple.rst:59 msgid "" -"The returned reference is borrowed from the tuple *p* (that is: it is only " -"valid as long as you hold a reference to *p*). To get a :term:`strong " -"reference`, use :c:func:`Py_NewRef(PyTuple_GetItem(...)) ` or :c:" -"func:`PySequence_GetItem`." +"Return the object at position *pos* in the tuple pointed to by *p*. If " +"*pos* is out of bounds, return ``NULL`` and set an :exc:`IndexError` " +"exception." msgstr "" -#: ../../c-api/tuple.rst:73 +#: ../../c-api/tuple.rst:65 msgid "Like :c:func:`PyTuple_GetItem`, but does no checking of its arguments." msgstr "" ":c:func:`PyTuple_GetItem` に似ていますが、引数に対するエラーチェックを行いま" "せん。" -#: ../../c-api/tuple.rst:78 +#: ../../c-api/tuple.rst:70 msgid "" "Return the slice of the tuple pointed to by *p* between *low* and *high*, or " -"``NULL`` with an exception set on failure." -msgstr "" - -#: ../../c-api/tuple.rst:81 -msgid "" -"This is the equivalent of the Python expression ``p[low:high]``. Indexing " -"from the end of the tuple is not supported." +"``NULL`` on failure. This is the equivalent of the Python expression " +"``p[low:high]``. Indexing from the end of the list is not supported." msgstr "" +"成功すると *p* の *low* から *high* までの間を指し示すタプルのスライスを返" +"し、失敗すると ``NULL`` を返します。Python の式 ``p[low:high]`` と同じです。" +"リストの終端からのインデックスはサポートされていません。" -#: ../../c-api/tuple.rst:87 +#: ../../c-api/tuple.rst:77 msgid "" "Insert a reference to object *o* at position *pos* of the tuple pointed to " "by *p*. Return ``0`` on success. If *pos* is out of bounds, return ``-1`` " @@ -128,7 +126,7 @@ msgstr "" "ます。成功すれば ``0`` を返します。 *pos* が範囲を超えている場合、 ``-1`` を" "返して :exc:`IndexError` 例外をセットします。" -#: ../../c-api/tuple.rst:93 +#: ../../c-api/tuple.rst:83 msgid "" "This function \"steals\" a reference to *o* and discards a reference to an " "item already in the tuple at the affected position." @@ -136,7 +134,7 @@ msgstr "" "この関数は *o* への参照を \"盗み取り\" ます。また、変更先のインデクスにすでに" "別の要素が入っている場合、その要素に対する参照を放棄します。" -#: ../../c-api/tuple.rst:99 +#: ../../c-api/tuple.rst:89 msgid "" "Like :c:func:`PyTuple_SetItem`, but does no error checking, and should " "*only* be used to fill in brand new tuples." @@ -144,32 +142,14 @@ msgstr "" ":c:func:`PyTuple_SetItem` に似ていますが、エラーチェックを行わず、新たなタプ" "ルに値を入れるとき *以外には使ってはなりません* 。" -#: ../../c-api/tuple.rst:102 ../../c-api/tuple.rst:224 -#: ../../c-api/tuple.rst:242 +#: ../../c-api/tuple.rst:94 msgid "" -"Bounds checking is performed as an assertion if Python is built in :ref:" -"`debug mode ` or :option:`with assertions <--with-assertions>`." -msgstr "" - -#: ../../c-api/tuple.rst:107 -msgid "" -"This function \"steals\" a reference to *o*, and, unlike :c:func:" +"This macro \"steals\" a reference to *o*, and, unlike :c:func:" "`PyTuple_SetItem`, does *not* discard a reference to any item that is being " "replaced; any reference in the tuple at position *pos* will be leaked." msgstr "" -"この関数は *o* への参照を \"盗み取り\" ます。また、 :c:func:" -"`PyTuple_SetItem` と違って、要素の置き換えが生じても置き換えられるオブジェク" -"トへの参照を放棄 *しません* ; その結果、タプル中の位置 *pos* で参照されていた" -"オブジェクトがメモリリークを引き起こします。" - -#: ../../c-api/tuple.rst:114 -msgid "" -"This macro should *only* be used on tuples that are newly created. Using " -"this macro on a tuple that is already in use (or in other words, has a " -"refcount > 1) could lead to undefined behavior." -msgstr "" -#: ../../c-api/tuple.rst:121 +#: ../../c-api/tuple.rst:102 msgid "" "Can be used to resize a tuple. *newsize* will be the new length of the " "tuple. Because tuples are *supposed* to be immutable, this should only be " @@ -193,11 +173,11 @@ msgstr "" "ます。失敗すると ``-1`` を返し、 ``*p`` を ``NULL`` に設定して、 :exc:" "`MemoryError` または :exc:`SystemError` を送出します。" -#: ../../c-api/tuple.rst:136 +#: ../../c-api/tuple.rst:115 msgid "Struct Sequence Objects" msgstr "Struct Sequence オブジェクト" -#: ../../c-api/tuple.rst:138 +#: ../../c-api/tuple.rst:117 msgid "" "Struct sequence objects are the C equivalent of :func:`~collections." "namedtuple` objects, i.e. a sequence whose items can also be accessed " @@ -209,7 +189,7 @@ msgstr "" "きるシーケンスです。 struct sequence を生成するには、まず特定のstruct " "sequence 型を生成しなければなりません。" -#: ../../c-api/tuple.rst:145 +#: ../../c-api/tuple.rst:124 msgid "" "Create a new struct sequence type from the data in *desc*, described below. " "Instances of the resulting type can be created with :c:func:" @@ -218,71 +198,110 @@ msgstr "" "後述の *desc* 中のデータから新しい struct sequence 型を生成します。返される型" "のインスタンスは :c:func:`PyStructSequence_New` で生成できます。" -#: ../../c-api/tuple.rst:148 ../../c-api/tuple.rst:217 -msgid "Return ``NULL`` with an exception set on failure." -msgstr "" - -#: ../../c-api/tuple.rst:153 +#: ../../c-api/tuple.rst:130 msgid "Initializes a struct sequence type *type* from *desc* in place." msgstr "" "struct sequence 型である *type* を *desc* をもとにその場で初期化します。" -#: ../../c-api/tuple.rst:158 +#: ../../c-api/tuple.rst:135 msgid "" -"Like :c:func:`PyStructSequence_InitType`, but returns ``0`` on success and " -"``-1`` with an exception set on failure." +"The same as ``PyStructSequence_InitType``, but returns ``0`` on success and " +"``-1`` on failure." msgstr "" +"``PyStructSequence_InitType`` と同じですが、成功した場合には ``0`` を、失敗し" +"た場合には ``-1`` を返します。" -#: ../../c-api/tuple.rst:166 +#: ../../c-api/tuple.rst:143 msgid "Contains the meta information of a struct sequence type to create." msgstr "生成するstruct sequence 型のメタデータを保持します。" -#: ../../c-api/tuple.rst:170 -msgid "" -"Fully qualified name of the type; null-terminated UTF-8 encoded. The name " -"must contain the module name." -msgstr "" +#: ../../c-api/tuple.rst:146 ../../c-api/tuple.rst:169 +msgid "Field" +msgstr "フィールド" -#: ../../c-api/tuple.rst:175 -msgid "Pointer to docstring for the type or ``NULL`` to omit." -msgstr "" +#: ../../c-api/tuple.rst:146 ../../c-api/tuple.rst:169 +msgid "C Type" +msgstr "C の型" -#: ../../c-api/tuple.rst:179 -msgid "Pointer to ``NULL``-terminated array with field names of the new type." -msgstr "" +#: ../../c-api/tuple.rst:146 ../../c-api/tuple.rst:169 +msgid "Meaning" +msgstr "意味" -#: ../../c-api/tuple.rst:183 -msgid "Number of fields visible to the Python side (if used as tuple)." -msgstr "" +#: ../../c-api/tuple.rst:148 ../../c-api/tuple.rst:171 +msgid "``name``" +msgstr "``name``" + +#: ../../c-api/tuple.rst:148 ../../c-api/tuple.rst:150 +#: ../../c-api/tuple.rst:171 ../../c-api/tuple.rst:176 +msgid "``const char *``" +msgstr "``const char *``" + +#: ../../c-api/tuple.rst:148 +msgid "name of the struct sequence type" +msgstr "生成するstruct sequence 型の名前" + +#: ../../c-api/tuple.rst:150 ../../c-api/tuple.rst:176 +msgid "``doc``" +msgstr "``doc``" + +#: ../../c-api/tuple.rst:150 +msgid "pointer to docstring for the type or ``NULL`` to omit" +msgstr "生成する型のdocstringへのポインタ、または省略する場合は ``NULL``" + +#: ../../c-api/tuple.rst:153 +msgid "``fields``" +msgstr "``fields``" + +#: ../../c-api/tuple.rst:153 +msgid "``PyStructSequence_Field *``" +msgstr "``PyStructSequence_Field *``" + +#: ../../c-api/tuple.rst:153 +msgid "pointer to ``NULL``-terminated array with field names of the new type" +msgstr "新しい型のフィールド名を格納した ``NULL`` 終端された配列へのポインタ" + +#: ../../c-api/tuple.rst:156 +msgid "``n_in_sequence``" +msgstr "``n_in_sequence``" + +#: ../../c-api/tuple.rst:156 +msgid "``int``" +msgstr "``int``" -#: ../../c-api/tuple.rst:188 +#: ../../c-api/tuple.rst:156 +msgid "number of fields visible to the Python side (if used as tuple)" +msgstr "Python 側で可視となるフィールドの数 (もしタプルとして使用する場合)" + +#: ../../c-api/tuple.rst:163 msgid "" "Describes a field of a struct sequence. As a struct sequence is modeled as a " -"tuple, all fields are typed as :c:expr:`PyObject*`. The index in the :c:" -"member:`~PyStructSequence_Desc.fields` array of the :c:type:" -"`PyStructSequence_Desc` determines which field of the struct sequence is " -"described." +"tuple, all fields are typed as :c:type:`PyObject*`. The index in the :attr:" +"`fields` array of the :c:type:`PyStructSequence_Desc` determines which field " +"of the struct sequence is described." msgstr "" -#: ../../c-api/tuple.rst:196 +#: ../../c-api/tuple.rst:171 msgid "" -"Name for the field or ``NULL`` to end the list of named fields, set to :c:" -"data:`PyStructSequence_UnnamedField` to leave unnamed." +"name for the field or ``NULL`` to end the list of named fields, set to :c:" +"data:`PyStructSequence_UnnamedField` to leave unnamed" msgstr "" +"フィールドの名前。もし名前づけされたフィールドのリストの終端を表す場合は " +"``NULL``。名前がないままにする場合は、:c:data:" +"`PyStructSequence_UnnamedField` を設定します" -#: ../../c-api/tuple.rst:201 -msgid "Field docstring or ``NULL`` to omit." -msgstr "" +#: ../../c-api/tuple.rst:176 +msgid "field docstring or ``NULL`` to omit" +msgstr "フィールドのdocstring、省略する場合は ``NULL``" -#: ../../c-api/tuple.rst:206 +#: ../../c-api/tuple.rst:182 msgid "Special value for a field name to leave it unnamed." msgstr "フィールド名を名前がないままするための特殊な値。" -#: ../../c-api/tuple.rst:208 +#: ../../c-api/tuple.rst:184 msgid "The type was changed from ``char *``." msgstr "型が ``char *`` から変更されました。" -#: ../../c-api/tuple.rst:214 +#: ../../c-api/tuple.rst:190 msgid "" "Creates an instance of *type*, which must have been created with :c:func:" "`PyStructSequence_NewType`." @@ -290,20 +309,19 @@ msgstr "" "*type* のインスタンスを生成します。 *type* は :c:func:" "`PyStructSequence_NewType` によって事前に生成していなければなりません。" -#: ../../c-api/tuple.rst:222 +#: ../../c-api/tuple.rst:196 msgid "" -"Return the object at position *pos* in the struct sequence pointed to by *p*." -msgstr "" - -#: ../../c-api/tuple.rst:230 -msgid "Alias to :c:func:`PyStructSequence_GetItem`." +"Return the object at position *pos* in the struct sequence pointed to by " +"*p*. No bounds checking is performed." msgstr "" +"*p* の指すstruct sequence内の、位置 *pos* にあるオブジェクトを返します。境界" +"チェックを行いません。" -#: ../../c-api/tuple.rst:232 -msgid "Now implemented as an alias to :c:func:`PyStructSequence_GetItem`." -msgstr "" +#: ../../c-api/tuple.rst:202 +msgid "Macro equivalent of :c:func:`PyStructSequence_GetItem`." +msgstr ":c:func:`PyStructSequence_GetItem` と同等のマクロです。" -#: ../../c-api/tuple.rst:238 +#: ../../c-api/tuple.rst:207 msgid "" "Sets the field at index *pos* of the struct sequence *p* to value *o*. " "Like :c:func:`PyTuple_SET_ITEM`, this should only be used to fill in brand " @@ -313,22 +331,10 @@ msgstr "" "func:`PyTuple_SET_ITEM` のように、生成したてのインスタンスに対してのみ使用す" "べきです。" -#: ../../c-api/tuple.rst:247 +#: ../../c-api/tuple.rst:213 ../../c-api/tuple.rst:222 msgid "This function \"steals\" a reference to *o*." msgstr "この関数は *o* への参照を \"盗み取り\" ます。" -#: ../../c-api/tuple.rst:252 -msgid "Alias to :c:func:`PyStructSequence_SetItem`." -msgstr "" - -#: ../../c-api/tuple.rst:254 -msgid "Now implemented as an alias to :c:func:`PyStructSequence_SetItem`." -msgstr "" - -#: ../../c-api/tuple.rst:8 -msgid "object" -msgstr "object" - -#: ../../c-api/tuple.rst:8 -msgid "tuple" -msgstr "tuple" +#: ../../c-api/tuple.rst:218 +msgid "Macro equivalent of :c:func:`PyStructSequence_SetItem`." +msgstr ":c:func:`PyStructSequence_SetItem` と同等のマクロ。" diff --git a/c-api/type.po b/c-api/type.po index b11b978be..8a00a62e0 100644 --- a/c-api/type.po +++ b/c-api/type.po @@ -1,26 +1,29 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2023 -# 石井明久, 2024 +# E. Kawashima, 2017 +# DaYeah Kim , 2017 +# Arihiro TAKASE, 2017 +# Tetsuo Koyama , 2020 +# tomo, 2020 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-06 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:50+0000\n" -"Last-Translator: 石井明久, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-05-29 06:28+0000\n" +"PO-Revision-Date: 2017-02-16 17:39+0000\n" +"Last-Translator: tomo, 2020\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/type.rst:6 @@ -36,7 +39,7 @@ msgid "" "This is the type object for type objects; it is the same object as :class:" "`type` in the Python layer." msgstr "" -"型オブジェクト自身の型オブジェクトです。Python レイヤにおける :class:`type` " +"型オブジェクト自身の型オブジェクトです; Python レイヤにおける :class:`type` " "と同じオブジェクトです。" #: ../../c-api/type.rst:24 @@ -60,11 +63,14 @@ msgstr "内部の検索キャッシュをクリアします。現在のバージ #: ../../c-api/type.rst:42 msgid "" "Return the :c:member:`~PyTypeObject.tp_flags` member of *type*. This " -"function is primarily meant for use with ``Py_LIMITED_API``; the individual " +"function is primarily meant for use with `Py_LIMITED_API`; the individual " "flag bits are guaranteed to be stable across Python releases, but access to :" -"c:member:`~PyTypeObject.tp_flags` itself is not part of the :ref:`limited " -"API `." +"c:member:`~PyTypeObject.tp_flags` itself is not part of the limited API." msgstr "" +"*type* のメンバーである :c:member:`~PyTypeObject.tp_flags` を返します。この関" +"数は基本的に `Py_LIMITED_API` を定義して使うことを想定しています。それぞれの" +"フラグはpythonの異なるリリースで安定していることが保証されていますが、 :c:" +"member:`~PyTypeObject.tp_flags` 自体は限定されたAPIの一部ではありません。" #: ../../c-api/type.rst:49 msgid "The return type is now ``unsigned long`` rather than ``long``." @@ -72,27 +78,6 @@ msgstr "返り値の型が ``long`` ではなく ``unsigned long`` になりま #: ../../c-api/type.rst:55 msgid "" -"Return the type object's internal namespace, which is otherwise only exposed " -"via a read-only proxy (:attr:`cls.__dict__ `). This is a " -"replacement for accessing :c:member:`~PyTypeObject.tp_dict` directly. The " -"returned dictionary must be treated as read-only." -msgstr "" - -#: ../../c-api/type.rst:61 -msgid "" -"This function is meant for specific embedding and language-binding cases, " -"where direct access to the dict is necessary and indirect access (e.g. via " -"the proxy or :c:func:`PyObject_GetAttr`) isn't adequate." -msgstr "" - -#: ../../c-api/type.rst:65 -msgid "" -"Extension modules should continue to use ``tp_dict``, directly or " -"indirectly, when setting up their own types." -msgstr "" - -#: ../../c-api/type.rst:73 -msgid "" "Invalidate the internal lookup cache for the type and all of its subtypes. " "This function must be called after any manual modification of the attributes " "or base classes of the type." @@ -101,118 +86,55 @@ msgstr "" "この関数は type の属性や基底クラス列を変更したあとに手動で呼び出さなければな" "りません。" -#: ../../c-api/type.rst:80 -msgid "" -"Register *callback* as a type watcher. Return a non-negative integer ID " -"which must be passed to future calls to :c:func:`PyType_Watch`. In case of " -"error (e.g. no more watcher IDs available), return ``-1`` and set an " -"exception." -msgstr "" - -#: ../../c-api/type.rst:85 -msgid "" -"In free-threaded builds, :c:func:`PyType_AddWatcher` is not thread-safe, so " -"it must be called at start up (before spawning the first thread)." -msgstr "" - -#: ../../c-api/type.rst:93 -msgid "" -"Clear watcher identified by *watcher_id* (previously returned from :c:func:" -"`PyType_AddWatcher`). Return ``0`` on success, ``-1`` on error (e.g. if " -"*watcher_id* was never registered.)" -msgstr "" - -#: ../../c-api/type.rst:97 -msgid "" -"An extension should never call ``PyType_ClearWatcher`` with a *watcher_id* " -"that was not returned to it by a previous call to :c:func:" -"`PyType_AddWatcher`." -msgstr "" - -#: ../../c-api/type.rst:106 -msgid "" -"Mark *type* as watched. The callback granted *watcher_id* by :c:func:" -"`PyType_AddWatcher` will be called whenever :c:func:`PyType_Modified` " -"reports a change to *type*. (The callback may be called only once for a " -"series of consecutive modifications to *type*, if :c:func:`!_PyType_Lookup` " -"is not called on *type* between the modifications; this is an implementation " -"detail and subject to change.)" -msgstr "" - -#: ../../c-api/type.rst:113 -msgid "" -"An extension should never call ``PyType_Watch`` with a *watcher_id* that was " -"not returned to it by a previous call to :c:func:`PyType_AddWatcher`." -msgstr "" - -#: ../../c-api/type.rst:121 -msgid "Type of a type-watcher callback function." -msgstr "" - -#: ../../c-api/type.rst:123 -msgid "" -"The callback must not modify *type* or cause :c:func:`PyType_Modified` to be " -"called on *type* or any type in its MRO; violating this rule could cause " -"infinite recursion." -msgstr "" - -#: ../../c-api/type.rst:132 +#: ../../c-api/type.rst:62 msgid "" "Return non-zero if the type object *o* sets the feature *feature*. Type " "features are denoted by single bit flags." msgstr "" -#: ../../c-api/type.rst:138 +#: ../../c-api/type.rst:68 msgid "" "Return true if the type object includes support for the cycle detector; this " -"tests the type flag :c:macro:`Py_TPFLAGS_HAVE_GC`." +"tests the type flag :const:`Py_TPFLAGS_HAVE_GC`." msgstr "" +"型オブジェクトが *o* が循環参照検出をサポートしている場合に真を返します; この" +"関数は型機能フラグ :const:`Py_TPFLAGS_HAVE_GC` の設定状態をチェックします。" -#: ../../c-api/type.rst:144 +#: ../../c-api/type.rst:74 msgid "Return true if *a* is a subtype of *b*." msgstr "*a* が *b* のサブタイプの場合に真を返します。" -#: ../../c-api/type.rst:146 +#: ../../c-api/type.rst:76 msgid "" -"This function only checks for actual subtypes, which means that :meth:`~type." -"__subclasscheck__` is not called on *b*. Call :c:func:`PyObject_IsSubclass` " -"to do the same check that :func:`issubclass` would do." +"This function only checks for actual subtypes, which means that :meth:" +"`~class.__subclasscheck__` is not called on *b*. Call :c:func:" +"`PyObject_IsSubclass` to do the same check that :func:`issubclass` would do." msgstr "" +"この関数は実際のサブクラスをチェックするだけです。つまり、 :meth:`~class." +"__subclasscheck__` は *b* に対し呼ばれません。 :func:`issubclass` と同じ" +"チェックをするには :c:func:`PyObject_IsSubclass` を呼んでください。" -#: ../../c-api/type.rst:154 +#: ../../c-api/type.rst:84 msgid "" "Generic handler for the :c:member:`~PyTypeObject.tp_alloc` slot of a type " -"object. Uses Python's default memory allocation mechanism to allocate " -"memory for a new instance, zeros the memory, then initializes the memory as " -"if by calling :c:func:`PyObject_Init` or :c:func:`PyObject_InitVar`." -msgstr "" - -#: ../../c-api/type.rst:159 -msgid "" -"Do not call this directly to allocate memory for an object; call the type's :" -"c:member:`~PyTypeObject.tp_alloc` slot instead." -msgstr "" - -#: ../../c-api/type.rst:162 -msgid "" -"For types that support garbage collection (i.e., the :c:macro:" -"`Py_TPFLAGS_HAVE_GC` flag is set), this function behaves like :c:macro:" -"`PyObject_GC_New` or :c:macro:`PyObject_GC_NewVar` (except the memory is " -"guaranteed to be zeroed before initialization), and should be paired with :c:" -"func:`PyObject_GC_Del` in :c:member:`~PyTypeObject.tp_free`. Otherwise, it " -"behaves like :c:macro:`PyObject_New` or :c:macro:`PyObject_NewVar` (except " -"the memory is guaranteed to be zeroed before initialization) and should be " -"paired with :c:func:`PyObject_Free` in :c:member:`~PyTypeObject.tp_free`." +"object. Use Python's default memory allocation mechanism to allocate a new " +"instance and initialize all its contents to ``NULL``." msgstr "" +"型オブジェクトの :c:member:`~PyTypeObject.tp_alloc` に対するジェネリックハン" +"ドラです。 Python のデフォルトのメモリアロケートメカニズムを使って新しいイン" +"スタンスをアロケートし、すべての内容を ``NULL`` で初期化します。" -#: ../../c-api/type.rst:174 +#: ../../c-api/type.rst:90 msgid "" "Generic handler for the :c:member:`~PyTypeObject.tp_new` slot of a type " -"object. Creates a new instance using the type's :c:member:`~PyTypeObject." -"tp_alloc` slot and returns the resulting object." +"object. Create a new instance using the type's :c:member:`~PyTypeObject." +"tp_alloc` slot." msgstr "" +"型オブジェクトの :c:member:`~PyTypeObject.tp_new` に対するジェネリックハンド" +"ラです。型の :c:member:`~PyTypeObject.tp_alloc` スロットを使って新しいインス" +"タンスを作成します。" -#: ../../c-api/type.rst:180 +#: ../../c-api/type.rst:95 msgid "" "Finalize a type object. This should be called on all type objects to finish " "their initialization. This function is responsible for adding inherited " @@ -224,43 +146,17 @@ msgstr "" "継承したスロットを型オブジェクトに追加する役割があります。成功した場合には " "``0`` を返し、エラーの場合には ``-1`` を返して例外情報を設定します。" -#: ../../c-api/type.rst:186 +#: ../../c-api/type.rst:101 msgid "" "If some of the base classes implements the GC protocol and the provided type " -"does not include the :c:macro:`Py_TPFLAGS_HAVE_GC` in its flags, then the GC " +"does not include the :const:`Py_TPFLAGS_HAVE_GC` in its flags, then the GC " "protocol will be automatically implemented from its parents. On the " -"contrary, if the type being created does include :c:macro:" -"`Py_TPFLAGS_HAVE_GC` in its flags then it **must** implement the GC protocol " -"itself by at least implementing the :c:member:`~PyTypeObject.tp_traverse` " -"handle." +"contrary, if the type being created does include :const:`Py_TPFLAGS_HAVE_GC` " +"in its flags then it **must** implement the GC protocol itself by at least " +"implementing the :c:member:`~PyTypeObject.tp_traverse` handle." msgstr "" -#: ../../c-api/type.rst:196 -msgid "" -"Return the type's name. Equivalent to getting the type's :attr:`~type." -"__name__` attribute." -msgstr "" - -#: ../../c-api/type.rst:203 -msgid "" -"Return the type's qualified name. Equivalent to getting the type's :attr:" -"`~type.__qualname__` attribute." -msgstr "" - -#: ../../c-api/type.rst:210 -msgid "" -"Return the type's fully qualified name. Equivalent to ``f\"{type.__module__}." -"{type.__qualname__}\"``, or :attr:`type.__qualname__` if :attr:`type." -"__module__` is not a string or is equal to ``\"builtins\"``." -msgstr "" - -#: ../../c-api/type.rst:218 -msgid "" -"Return the type's module name. Equivalent to getting the :attr:`type." -"__module__` attribute." -msgstr "" - -#: ../../c-api/type.rst:225 +#: ../../c-api/type.rst:111 msgid "" "Return the function pointer stored in the given slot. If the result is " "``NULL``, this indicates that either the slot is ``NULL``, or that the " @@ -271,357 +167,141 @@ msgstr "" "の場合は、スロットが ``NULL`` か、関数が不正な引数で呼ばれたことを示します。" "通常、呼び出し側は返り値のポインタを適切な関数型にキャストします。" -#: ../../c-api/type.rst:231 +#: ../../c-api/type.rst:117 msgid "" "See :c:member:`PyType_Slot.slot` for possible values of the *slot* argument." msgstr "" -#: ../../c-api/type.rst:235 -msgid "" -":c:func:`PyType_GetSlot` can now accept all types. Previously, it was " -"limited to :ref:`heap types `." +#: ../../c-api/type.rst:119 +msgid "An exception is raised if *type* is not a heap type." msgstr "" -#: ../../c-api/type.rst:241 +#: ../../c-api/type.rst:125 msgid "" "Return the module object associated with the given type when the type was " "created using :c:func:`PyType_FromModuleAndSpec`." msgstr "" -#: ../../c-api/type.rst:244 ../../c-api/type.rst:264 +#: ../../c-api/type.rst:128 ../../c-api/type.rst:146 msgid "" "If no module is associated with the given type, sets :py:class:`TypeError` " "and returns ``NULL``." msgstr "" -#: ../../c-api/type.rst:247 +#: ../../c-api/type.rst:131 msgid "" "This function is usually used to get the module in which a method is " "defined. Note that in such a method, ``PyType_GetModule(Py_TYPE(self))`` may " "not return the intended result. ``Py_TYPE(self)`` may be a *subclass* of the " "intended class, and subclasses are not necessarily defined in the same " "module as their superclass. See :c:type:`PyCMethod` to get the class that " -"defines the method. See :c:func:`PyType_GetModuleByDef` for cases when :c:" -"type:`!PyCMethod` cannot be used." +"defines the method." msgstr "" -#: ../../c-api/type.rst:260 +#: ../../c-api/type.rst:142 msgid "" "Return the state of the module object associated with the given type. This " "is a shortcut for calling :c:func:`PyModule_GetState()` on the result of :c:" "func:`PyType_GetModule`." msgstr "" -#: ../../c-api/type.rst:267 +#: ../../c-api/type.rst:149 msgid "" "If the *type* has an associated module but its state is ``NULL``, returns " "``NULL`` without setting an exception." msgstr "" -#: ../../c-api/type.rst:274 -msgid "" -"Find the first superclass whose module was created from the given :c:type:" -"`PyModuleDef` *def*, and return that module." -msgstr "" - -#: ../../c-api/type.rst:277 -msgid "" -"If no module is found, raises a :py:class:`TypeError` and returns ``NULL``." -msgstr "" - -#: ../../c-api/type.rst:279 -msgid "" -"This function is intended to be used together with :c:func:" -"`PyModule_GetState()` to get module state from slot methods (such as :c:" -"member:`~PyTypeObject.tp_init` or :c:member:`~PyNumberMethods.nb_add`) and " -"other places where a method's defining class cannot be passed using the :c:" -"type:`PyCMethod` calling convention." -msgstr "" - -#: ../../c-api/type.rst:289 -msgid "" -"Find the first superclass in *type*'s :term:`method resolution order` whose :" -"c:macro:`Py_tp_token` token is equal to the given one." -msgstr "" - -#: ../../c-api/type.rst:292 -msgid "" -"If found, set *\\*result* to a new :term:`strong reference` to it and return " -"``1``." -msgstr "" - -#: ../../c-api/type.rst:294 -msgid "If not found, set *\\*result* to ``NULL`` and return ``0``." -msgstr "" - -#: ../../c-api/type.rst:295 -msgid "" -"On error, set *\\*result* to ``NULL`` and return ``-1`` with an exception " -"set." -msgstr "" - -#: ../../c-api/type.rst:298 -msgid "" -"The *result* argument may be ``NULL``, in which case *\\*result* is not set. " -"Use this if you need only the return value." -msgstr "" - -#: ../../c-api/type.rst:301 -msgid "The *token* argument may not be ``NULL``." -msgstr "" - -#: ../../c-api/type.rst:307 -msgid "Attempt to assign a version tag to the given type." -msgstr "" - -#: ../../c-api/type.rst:309 -msgid "" -"Returns 1 if the type already had a valid version tag or a new one was " -"assigned, or 0 if a new tag could not be assigned." -msgstr "" - -#: ../../c-api/type.rst:316 +#: ../../c-api/type.rst:156 msgid "Creating Heap-Allocated Types" msgstr "" -#: ../../c-api/type.rst:318 +#: ../../c-api/type.rst:158 msgid "" "The following functions and structs are used to create :ref:`heap types " "`." msgstr "" -#: ../../c-api/type.rst:323 -msgid "" -"Create and return a :ref:`heap type ` from the *spec* (see :c:" -"macro:`Py_TPFLAGS_HEAPTYPE`)." -msgstr "" - -#: ../../c-api/type.rst:326 +#: ../../c-api/type.rst:163 msgid "" -"The metaclass *metaclass* is used to construct the resulting type object. " -"When *metaclass* is ``NULL``, the metaclass is derived from *bases* (or " -"*Py_tp_base[s]* slots if *bases* is ``NULL``, see below)." +"Creates and returns a heap type object from the *spec* (:const:" +"`Py_TPFLAGS_HEAPTYPE`)." msgstr "" -#: ../../c-api/type.rst:330 +#: ../../c-api/type.rst:166 msgid "" -"Metaclasses that override :c:member:`~PyTypeObject.tp_new` are not " -"supported, except if ``tp_new`` is ``NULL``." +"If *bases* is a tuple, the created heap type contains all types contained in " +"it as base types." msgstr "" -#: ../../c-api/type.rst:333 +#: ../../c-api/type.rst:169 msgid "" -"The *bases* argument can be used to specify base classes; it can either be " -"only one class or a tuple of classes. If *bases* is ``NULL``, the " -"*Py_tp_bases* slot is used instead. If that also is ``NULL``, the " -"*Py_tp_base* slot is used instead. If that also is ``NULL``, the new type " -"derives from :class:`object`." +"If *bases* is ``NULL``, the *Py_tp_bases* slot is used instead. If that also " +"is ``NULL``, the *Py_tp_base* slot is used instead. If that also is " +"``NULL``, the new type derives from :class:`object`." msgstr "" -#: ../../c-api/type.rst:339 +#: ../../c-api/type.rst:173 msgid "" "The *module* argument can be used to record the module in which the new " "class is defined. It must be a module object or ``NULL``. If not ``NULL``, " -"the module is associated with the new type and can later be retrieved with :" +"the module is associated with the new type and can later be retreived with :" "c:func:`PyType_GetModule`. The associated module is not inherited by " "subclasses; it must be specified for each class individually." msgstr "" -#: ../../c-api/type.rst:346 +#: ../../c-api/type.rst:180 msgid "This function calls :c:func:`PyType_Ready` on the new type." msgstr "" -#: ../../c-api/type.rst:348 -msgid "" -"Note that this function does *not* fully match the behavior of calling :py:" -"class:`type() ` or using the :keyword:`class` statement. With user-" -"provided base types or metaclasses, prefer :ref:`calling ` :py:" -"class:`type` (or the metaclass) over ``PyType_From*`` functions. " -"Specifically:" -msgstr "" - -#: ../../c-api/type.rst:355 -msgid "" -":py:meth:`~object.__new__` is not called on the new class (and it must be " -"set to ``type.__new__``)." -msgstr "" - -#: ../../c-api/type.rst:357 -msgid ":py:meth:`~object.__init__` is not called on the new class." -msgstr "" - -#: ../../c-api/type.rst:358 -msgid ":py:meth:`~object.__init_subclass__` is not called on any bases." -msgstr "" - -#: ../../c-api/type.rst:359 -msgid ":py:meth:`~object.__set_name__` is not called on new descriptors." -msgstr "" - -#: ../../c-api/type.rst:365 -msgid "Equivalent to ``PyType_FromMetaclass(NULL, module, spec, bases)``." -msgstr "" - -#: ../../c-api/type.rst:371 -msgid "" -"The function now accepts a single class as the *bases* argument and ``NULL`` " -"as the ``tp_doc`` slot." -msgstr "" - -#: ../../c-api/type.rst:376 ../../c-api/type.rst:397 -msgid "" -"The function now finds and uses a metaclass corresponding to the provided " -"base classes. Previously, only :class:`type` instances were returned." -msgstr "" - -#: ../../c-api/type.rst:379 ../../c-api/type.rst:400 ../../c-api/type.rst:420 -msgid "" -"The :c:member:`~PyTypeObject.tp_new` of the metaclass is *ignored*. which " -"may result in incomplete initialization. Creating classes whose metaclass " -"overrides :c:member:`~PyTypeObject.tp_new` is deprecated." -msgstr "" - -#: ../../c-api/type.rst:386 ../../c-api/type.rst:407 ../../c-api/type.rst:427 -msgid "" -"Creating classes whose metaclass overrides :c:member:`~PyTypeObject.tp_new` " -"is no longer allowed." -msgstr "" - -#: ../../c-api/type.rst:391 -msgid "Equivalent to ``PyType_FromMetaclass(NULL, NULL, spec, bases)``." -msgstr "" - -#: ../../c-api/type.rst:412 -msgid "Equivalent to ``PyType_FromMetaclass(NULL, NULL, spec, NULL)``." -msgstr "" - -#: ../../c-api/type.rst:416 -msgid "" -"The function now finds and uses a metaclass corresponding to the base " -"classes provided in *Py_tp_base[s]* slots. Previously, only :class:`type` " -"instances were returned." -msgstr "" - -#: ../../c-api/type.rst:432 -msgid "" -"Make a type immutable: set the :c:macro:`Py_TPFLAGS_IMMUTABLETYPE` flag." -msgstr "" - -#: ../../c-api/type.rst:434 -msgid "All base classes of *type* must be immutable." +#: ../../c-api/type.rst:186 +msgid "Equivalent to ``PyType_FromModuleAndSpec(NULL, spec, bases)``." msgstr "" -#: ../../c-api/type.rst:436 -msgid "On success, return ``0``. On error, set an exception and return ``-1``." +#: ../../c-api/type.rst:192 +msgid "Equivalent to ``PyType_FromSpecWithBases(spec, NULL)``." msgstr "" -#: ../../c-api/type.rst:439 -msgid "" -"The type must not be used before it's made immutable. For example, type " -"instances must not be created before the type is made immutable." -msgstr "" - -#: ../../c-api/type.rst:455 +#: ../../c-api/type.rst:196 msgid "Structure defining a type's behavior." msgstr "" -#: ../../c-api/type.rst:459 +#: ../../c-api/type.rst:200 msgid "Name of the type, used to set :c:member:`PyTypeObject.tp_name`." msgstr "" -#: ../../c-api/type.rst:463 -msgid "" -"If positive, specifies the size of the instance in bytes. It is used to set :" -"c:member:`PyTypeObject.tp_basicsize`." -msgstr "" - -#: ../../c-api/type.rst:466 -msgid "" -"If zero, specifies that :c:member:`~PyTypeObject.tp_basicsize` should be " -"inherited." -msgstr "" - -#: ../../c-api/type.rst:469 -msgid "" -"If negative, the absolute value specifies how much space instances of the " -"class need *in addition* to the superclass. Use :c:func:" -"`PyObject_GetTypeData` to get a pointer to subclass-specific memory reserved " -"this way. For negative :c:member:`!basicsize`, Python will insert padding " -"when needed to meet :c:member:`~PyTypeObject.tp_basicsize`'s alignment " -"requirements." -msgstr "" - -#: ../../c-api/type.rst:479 -msgid "Previously, this field could not be negative." -msgstr "" - -#: ../../c-api/type.rst:483 +#: ../../c-api/type.rst:205 msgid "" -"Size of one element of a variable-size type, in bytes. Used to set :c:member:" -"`PyTypeObject.tp_itemsize`. See ``tp_itemsize`` documentation for caveats." +"Size of the instance in bytes, used to set :c:member:`PyTypeObject." +"tp_basicsize` and :c:member:`PyTypeObject.tp_itemsize`." msgstr "" -#: ../../c-api/type.rst:487 -msgid "" -"If zero, :c:member:`~PyTypeObject.tp_itemsize` is inherited. Extending " -"arbitrary variable-sized classes is dangerous, since some types use a fixed " -"offset for variable-sized memory, which can then overlap fixed-sized memory " -"used by a subclass. To help prevent mistakes, inheriting ``itemsize`` is " -"only possible in the following situations:" -msgstr "" - -#: ../../c-api/type.rst:494 -msgid "" -"The base is not variable-sized (its :c:member:`~PyTypeObject.tp_itemsize`)." -msgstr "" - -#: ../../c-api/type.rst:496 -msgid "" -"The requested :c:member:`PyType_Spec.basicsize` is positive, suggesting that " -"the memory layout of the base class is known." -msgstr "" - -#: ../../c-api/type.rst:498 -msgid "" -"The requested :c:member:`PyType_Spec.basicsize` is zero, suggesting that the " -"subclass does not access the instance's memory directly." -msgstr "" - -#: ../../c-api/type.rst:501 -msgid "With the :c:macro:`Py_TPFLAGS_ITEMS_AT_END` flag." -msgstr "" - -#: ../../c-api/type.rst:505 +#: ../../c-api/type.rst:211 msgid "Type flags, used to set :c:member:`PyTypeObject.tp_flags`." msgstr "" -#: ../../c-api/type.rst:507 +#: ../../c-api/type.rst:213 msgid "" "If the ``Py_TPFLAGS_HEAPTYPE`` flag is not set, :c:func:" "`PyType_FromSpecWithBases` sets it automatically." msgstr "" -#: ../../c-api/type.rst:512 +#: ../../c-api/type.rst:218 msgid "" "Array of :c:type:`PyType_Slot` structures. Terminated by the special slot " "value ``{0, NULL}``." msgstr "" -#: ../../c-api/type.rst:515 -msgid "Each slot ID should be specified at most once." -msgstr "" - -#: ../../c-api/type.rst:525 +#: ../../c-api/type.rst:223 msgid "" "Structure defining optional functionality of a type, containing a slot ID " "and a value pointer." msgstr "" -#: ../../c-api/type.rst:530 +#: ../../c-api/type.rst:228 msgid "A slot ID." msgstr "" -#: ../../c-api/type.rst:532 +#: ../../c-api/type.rst:230 msgid "" "Slot IDs are named like the field names of the structures :c:type:" "`PyTypeObject`, :c:type:`PyNumberMethods`, :c:type:`PySequenceMethods`, :c:" @@ -629,171 +309,97 @@ msgid "" "prefix. For example, use:" msgstr "" -#: ../../c-api/type.rst:538 +#: ../../c-api/type.rst:236 msgid "``Py_tp_dealloc`` to set :c:member:`PyTypeObject.tp_dealloc`" msgstr "" -#: ../../c-api/type.rst:539 +#: ../../c-api/type.rst:237 msgid "``Py_nb_add`` to set :c:member:`PyNumberMethods.nb_add`" msgstr "" -#: ../../c-api/type.rst:540 +#: ../../c-api/type.rst:238 msgid "``Py_sq_length`` to set :c:member:`PySequenceMethods.sq_length`" msgstr "" -#: ../../c-api/type.rst:542 -msgid "" -"An additional slot is supported that does not correspond to a :c:type:`!" -"PyTypeObject` struct field:" -msgstr "" - -#: ../../c-api/type.rst:545 -msgid ":c:data:`Py_tp_token`" -msgstr "" - -#: ../../c-api/type.rst:547 -msgid "" -"The following “offset” fields cannot be set using :c:type:`PyType_Slot`:" -msgstr "" - -#: ../../c-api/type.rst:549 -msgid "" -":c:member:`~PyTypeObject.tp_weaklistoffset` (use :c:macro:" -"`Py_TPFLAGS_MANAGED_WEAKREF` instead if possible)" -msgstr "" - -#: ../../c-api/type.rst:551 -msgid "" -":c:member:`~PyTypeObject.tp_dictoffset` (use :c:macro:" -"`Py_TPFLAGS_MANAGED_DICT` instead if possible)" -msgstr "" - -#: ../../c-api/type.rst:553 -msgid "" -":c:member:`~PyTypeObject.tp_vectorcall_offset` (use " -"``\"__vectorcalloffset__\"`` in :ref:`PyMemberDef `)" -msgstr "" - -#: ../../c-api/type.rst:557 -msgid "" -"If it is not possible to switch to a ``MANAGED`` flag (for example, for " -"vectorcall or to support Python older than 3.12), specify the offset in :c:" -"member:`Py_tp_members `. See :ref:`PyMemberDef " -"documentation ` for details." -msgstr "" - -#: ../../c-api/type.rst:563 -msgid "" -"The following internal fields cannot be set at all when creating a heap type:" -msgstr "" - -#: ../../c-api/type.rst:566 +#: ../../c-api/type.rst:240 msgid "" -":c:member:`~PyTypeObject.tp_dict`, :c:member:`~PyTypeObject.tp_mro`, :c:" -"member:`~PyTypeObject.tp_cache`, :c:member:`~PyTypeObject.tp_subclasses`, " -"and :c:member:`~PyTypeObject.tp_weaklist`." +"The following fields cannot be set at all using :c:type:`PyType_Spec` and :c:" +"type:`PyType_Slot`:" msgstr "" -#: ../../c-api/type.rst:572 -msgid "" -"Setting :c:data:`Py_tp_bases` or :c:data:`Py_tp_base` may be problematic on " -"some platforms. To avoid issues, use the *bases* argument of :c:func:" -"`PyType_FromSpecWithBases` instead." -msgstr "" +#: ../../c-api/type.rst:243 +msgid ":c:member:`~PyTypeObject.tp_dict`" +msgstr ":c:member:`~PyTypeObject.tp_dict`" -#: ../../c-api/type.rst:577 -msgid "Slots in :c:type:`PyBufferProcs` may be set in the unlimited API." +#: ../../c-api/type.rst:244 +msgid ":c:member:`~PyTypeObject.tp_mro`" msgstr "" -#: ../../c-api/type.rst:580 -msgid "" -":c:member:`~PyBufferProcs.bf_getbuffer` and :c:member:`~PyBufferProcs." -"bf_releasebuffer` are now available under the :ref:`limited API `." +#: ../../c-api/type.rst:245 +msgid ":c:member:`~PyTypeObject.tp_cache`" msgstr "" -#: ../../c-api/type.rst:585 -msgid "" -"The field :c:member:`~PyTypeObject.tp_vectorcall` can now set using " -"``Py_tp_vectorcall``. See the field's documentation for details." +#: ../../c-api/type.rst:246 +msgid ":c:member:`~PyTypeObject.tp_subclasses`" msgstr "" -#: ../../c-api/type.rst:592 -msgid "" -"The desired value of the slot. In most cases, this is a pointer to a " -"function." -msgstr "" - -#: ../../c-api/type.rst:595 -msgid "*pfunc* values may not be ``NULL``, except for the following slots:" +#: ../../c-api/type.rst:247 +msgid ":c:member:`~PyTypeObject.tp_weaklist`" msgstr "" -#: ../../c-api/type.rst:597 -msgid "``Py_tp_doc``" -msgstr "" +#: ../../c-api/type.rst:248 +msgid ":c:member:`~PyTypeObject.tp_vectorcall`" +msgstr ":c:member:`~PyTypeObject.tp_vectorcall`" -#: ../../c-api/type.rst:598 +#: ../../c-api/type.rst:249 msgid "" -":c:data:`Py_tp_token` (for clarity, prefer :c:data:`Py_TP_USE_SPEC` rather " -"than ``NULL``)" +":c:member:`~PyTypeObject.tp_weaklistoffset` (see :ref:`PyMemberDef " +"`)" msgstr "" -#: ../../c-api/type.rst:603 +#: ../../c-api/type.rst:251 msgid "" -"A :c:member:`~PyType_Slot.slot` that records a static memory layout ID for a " -"class." +":c:member:`~PyTypeObject.tp_dictoffset` (see :ref:`PyMemberDef `)" msgstr "" -#: ../../c-api/type.rst:606 +#: ../../c-api/type.rst:253 msgid "" -"If the :c:type:`PyType_Spec` of the class is statically allocated, the token " -"can be set to the spec using the special value :c:data:`Py_TP_USE_SPEC`:" +":c:member:`~PyTypeObject.tp_vectorcall_offset` (see :ref:`PyMemberDef " +"`)" msgstr "" -#: ../../c-api/type.rst:610 +#: ../../c-api/type.rst:256 msgid "" -"static PyType_Slot foo_slots[] = {\n" -" {Py_tp_token, Py_TP_USE_SPEC}," +"The following fields cannot be set using :c:type:`PyType_Spec` and :c:type:" +"`PyType_Slot` under the limited API:" msgstr "" -#: ../../c-api/type.rst:615 -msgid "It can also be set to an arbitrary pointer, but you must ensure that:" -msgstr "" +#: ../../c-api/type.rst:259 +msgid ":c:member:`~PyBufferProcs.bf_getbuffer`" +msgstr ":c:member:`~PyBufferProcs.bf_getbuffer`" -#: ../../c-api/type.rst:617 -msgid "" -"The pointer outlives the class, so it's not reused for something else while " -"the class exists." -msgstr "" +#: ../../c-api/type.rst:260 +msgid ":c:member:`~PyBufferProcs.bf_releasebuffer`" +msgstr ":c:member:`~PyBufferProcs.bf_releasebuffer`" -#: ../../c-api/type.rst:619 +#: ../../c-api/type.rst:262 msgid "" -"It \"belongs\" to the extension module where the class lives, so it will not " -"clash with other extensions." +"Setting :c:data:`Py_tp_bases` or :c:data:`Py_tp_base` may be problematic on " +"some platforms. To avoid issues, use the *bases* argument of :py:func:" +"`PyType_FromSpecWithBases` instead." msgstr "" -#: ../../c-api/type.rst:622 -msgid "" -"Use :c:func:`PyType_GetBaseByToken` to check if a class's superclass has a " -"given token -- that is, check whether the memory layout is compatible." +#: ../../c-api/type.rst:269 +msgid "Slots in :c:type:`PyBufferProcs` in may be set in the unlimited API." msgstr "" -#: ../../c-api/type.rst:625 +#: ../../c-api/type.rst:273 msgid "" -"To get the token for a given class (without considering superclasses), use :" -"c:func:`PyType_GetSlot` with ``Py_tp_token``." +"The desired value of the slot. In most cases, this is a pointer to a " +"function." msgstr "" -#: ../../c-api/type.rst:634 -msgid "" -"Used as a value with :c:data:`Py_tp_token` to set the token to the class's :" -"c:type:`PyType_Spec`. Expands to ``NULL``." +#: ../../c-api/type.rst:276 +msgid "May not be ``NULL``." msgstr "" - -#: ../../c-api/type.rst:8 -msgid "object" -msgstr "object" - -#: ../../c-api/type.rst:8 -msgid "type" -msgstr "type" diff --git a/c-api/typehints.po b/c-api/typehints.po index aeaf07cad..623d813e0 100644 --- a/c-api/typehints.po +++ b/c-api/typehints.po @@ -1,26 +1,21 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # -# Translators: -# Takeshi Nakazato, 2021 -# Arihiro TAKASE, 2023 -# #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-13 14:21+0000\n" -"PO-Revision-Date: 2021-06-28 00:50+0000\n" -"Last-Translator: Arihiro TAKASE, 2023\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-06-17 06:39+0000\n" +"PO-Revision-Date: 2021-06-17 06:42+0000\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/typehints.rst:6 @@ -29,18 +24,17 @@ msgstr "型ヒントのためのオブジェクト" #: ../../c-api/typehints.rst:8 msgid "" -"Various built-in types for type hinting are provided. Currently, two types " -"exist -- :ref:`GenericAlias ` and :ref:`Union `. Only ``GenericAlias`` is exposed to C." +"Various built-in types for type hinting are provided. Only :ref:" +"`GenericAlias ` is exposed to C." msgstr "" -#: ../../c-api/typehints.rst:14 +#: ../../c-api/typehints.rst:13 msgid "" "Create a :ref:`GenericAlias ` object. Equivalent to " "calling the Python class :class:`types.GenericAlias`. The *origin* and " "*args* arguments set the ``GenericAlias``\\ 's ``__origin__`` and " -"``__args__`` attributes respectively. *origin* should be a :c:expr:" -"`PyTypeObject*`, and *args* can be a :c:expr:`PyTupleObject*` or any " +"``__args__`` attributes respectively. *origin* should be a :c:type:" +"`PyTypeObject*`, and *args* can be a :c:type:`PyTupleObject*` or any " "``PyObject*``. If *args* passed is not a tuple, a 1-tuple is automatically " "constructed and ``__args__`` is set to ``(args,)``. Minimal checking is done " "for the arguments, so the function will succeed even if *origin* is not a " @@ -48,38 +42,16 @@ msgid "" "lazily from ``__args__``. On failure, an exception is raised and ``NULL`` " "is returned." msgstr "" -":ref:`GenericAlias ` オブジェクトを生成します。Pythonクラ" -"ス :class:`types.GenericAlias` を呼び出すことと同等です。引数 *origin* と " -"*args* は ``GenericAlias`` の ``__origin__`` および ``__args__`` 属性をそれぞ" -"れ設定します。 *origin* は :c:expr:`PyTypeObject*` でなければならず、 *args* " -"は :c:expr:`PyTupleObject*` または任意の ``PyObject*`` です。 *args* がタプル" -"でない場合には1タプルが自動的に生成され、``__args__`` には ``(args,)`` が設定" -"されます。引数チェックは最小限なため、たとえ *origin* が型を示すオブジェクト" -"でなくても関数呼び出しは成功します。``GenericAlias`` の ``__parameters__`` 属" -"性は ``__args__`` から必要に応じて遅延生成されます。失敗した場合、例外が送出" -"されて ``NULL`` を返します。" -#: ../../c-api/typehints.rst:28 +#: ../../c-api/typehints.rst:27 msgid "Here's an example of how to make an extension type generic::" msgstr "以下は拡張の型をジェネリックにする例です。" -#: ../../c-api/typehints.rst:30 -msgid "" -"...\n" -"static PyMethodDef my_obj_methods[] = {\n" -" // Other methods.\n" -" ...\n" -" {\"__class_getitem__\", Py_GenericAlias, METH_O|METH_CLASS, \"See PEP " -"585\"}\n" -" ...\n" -"}" -msgstr "" - -#: ../../c-api/typehints.rst:38 -msgid "The data model method :meth:`~object.__class_getitem__`." -msgstr "" +#: ../../c-api/typehints.rst:37 +msgid "The data model method :meth:`__class_getitem__`." +msgstr "データモデルメソッド :meth:`__class_getitem__` 。" -#: ../../c-api/typehints.rst:44 +#: ../../c-api/typehints.rst:43 msgid "" "The C type of the object returned by :c:func:`Py_GenericAlias`. Equivalent " "to :class:`types.GenericAlias` in Python." diff --git a/c-api/typeobj.po b/c-api/typeobj.po index 36e173227..6111c91c0 100644 --- a/c-api/typeobj.po +++ b/c-api/typeobj.po @@ -1,52 +1,53 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# mollinaca, 2021 +# E. Kawashima, 2017 +# DaYeah Kim , 2017 +# Arihiro TAKASE, 2017 +# 秘湯 , 2019 +# tomo, 2020 +# mollinaca, 2020 # Osamu NAKAMURA, 2021 -# 菊池 健志, 2023 -# Nozomu Kaneko , 2023 -# Arihiro TAKASE, 2024 -# tomo, 2025 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-13 14:21+0000\n" -"PO-Revision-Date: 2021-06-28 00:50+0000\n" -"Last-Translator: tomo, 2025\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-08-05 07:09+0000\n" +"PO-Revision-Date: 2017-02-16 17:39+0000\n" +"Last-Translator: Osamu NAKAMURA, 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/typeobj.rst:6 -msgid "Type Object Structures" -msgstr "" +msgid "Type Objects" +msgstr "型オブジェクト" #: ../../c-api/typeobj.rst:8 msgid "" "Perhaps one of the most important structures of the Python object system is " "the structure that defines a new type: the :c:type:`PyTypeObject` " -"structure. Type objects can be handled using any of the ``PyObject_*`` or " -"``PyType_*`` functions, but do not offer much that's interesting to most " -"Python applications. These objects are fundamental to how objects behave, so " -"they are very important to the interpreter itself and to any extension " -"module that implements new types." +"structure. Type objects can be handled using any of the :c:func:" +"`PyObject_\\*` or :c:func:`PyType_\\*` functions, but do not offer much " +"that's interesting to most Python applications. These objects are " +"fundamental to how objects behave, so they are very important to the " +"interpreter itself and to any extension module that implements new types." msgstr "" "新スタイルの型を定義する構造体: :c:type:`PyTypeObject` 構造体は、おそらく " "Python オブジェクトシステムの中で最も重要な構造体の1つでしょう。型オブジェク" -"トは ``PyObject_*`` 系や ``PyType_*`` 系の関数で扱えますが、ほとんどの " -"Python アプリケーションにとって、さして面白みのある機能を提供しません。型オブ" -"ジェクトはオブジェクトがどのように振舞うかを決める基盤ですから、インタプリタ" -"自体や新たな型を定義する拡張モジュールでは非常に重要な存在です。" +"トは :c:func:`PyObject_\\*` 系や :c:func:`PyType_\\*` 系の関数で扱えますが、" +"ほとんどの Python アプリケーションにとって、さして面白みのある機能を提供しま" +"せん。型オブジェクトはオブジェクトがどのように振舞うかを決める基盤ですから、" +"インタプリタ自体や新たな型を定義する拡張モジュールでは非常に重要な存在です。" #: ../../c-api/typeobj.rst:16 msgid "" @@ -84,7 +85,7 @@ msgstr "tp スロット" msgid "PyTypeObject Slot [#slots]_" msgstr "PyTypeObject スロット [#slots]_" -#: ../../c-api/typeobj.rst:40 ../../c-api/typeobj.rst:201 +#: ../../c-api/typeobj.rst:40 ../../c-api/typeobj.rst:193 msgid ":ref:`Type `" msgstr ":ref:`型 `" @@ -116,8 +117,8 @@ msgstr "I" msgid " :c:member:`~PyTypeObject.tp_name`" msgstr " :c:member:`~PyTypeObject.tp_name`" -#: ../../c-api/typeobj.rst:0 ../../c-api/typeobj.rst:44 -#: ../../c-api/typeobj.rst:86 +#: ../../c-api/typeobj.rst:44 ../../c-api/typeobj.rst:86 +#: ../../c-api/typeobj.rst:0 msgid "const char *" msgstr "const char *" @@ -148,12 +149,12 @@ msgstr "X" msgid ":c:member:`~PyTypeObject.tp_basicsize`" msgstr ":c:member:`~PyTypeObject.tp_basicsize`" -#: ../../c-api/typeobj.rst:0 ../../c-api/typeobj.rst:46 -#: ../../c-api/typeobj.rst:48 ../../c-api/typeobj.rst:52 -#: ../../c-api/typeobj.rst:99 ../../c-api/typeobj.rst:120 -#: ../../c-api/typeobj.rst:417 -msgid ":c:type:`Py_ssize_t`" -msgstr "" +#: ../../c-api/typeobj.rst:46 ../../c-api/typeobj.rst:48 +#: ../../c-api/typeobj.rst:52 ../../c-api/typeobj.rst:99 +#: ../../c-api/typeobj.rst:120 ../../c-api/typeobj.rst:0 +#: ../../c-api/typeobj.rst:406 +msgid "Py_ssize_t" +msgstr "Py_ssize_t" #: ../../c-api/typeobj.rst:48 msgid ":c:member:`~PyTypeObject.tp_itemsize`" @@ -164,7 +165,7 @@ msgid ":c:member:`~PyTypeObject.tp_dealloc`" msgstr ":c:member:`~PyTypeObject.tp_dealloc`" #: ../../c-api/typeobj.rst:50 ../../c-api/typeobj.rst:142 -#: ../../c-api/typeobj.rst:146 ../../c-api/typeobj.rst:347 +#: ../../c-api/typeobj.rst:146 ../../c-api/typeobj.rst:336 msgid ":c:type:`destructor`" msgstr ":c:type:`destructor`" @@ -176,7 +177,7 @@ msgstr ":c:member:`~PyTypeObject.tp_vectorcall_offset`" msgid "(:c:member:`~PyTypeObject.tp_getattr`)" msgstr "(:c:member:`~PyTypeObject.tp_getattr`)" -#: ../../c-api/typeobj.rst:54 ../../c-api/typeobj.rst:371 +#: ../../c-api/typeobj.rst:54 ../../c-api/typeobj.rst:360 msgid ":c:type:`getattrfunc`" msgstr ":c:type:`getattrfunc`" @@ -195,7 +196,7 @@ msgstr "G" msgid "(:c:member:`~PyTypeObject.tp_setattr`)" msgstr "(:c:member:`~PyTypeObject.tp_setattr`)" -#: ../../c-api/typeobj.rst:57 ../../c-api/typeobj.rst:376 +#: ../../c-api/typeobj.rst:57 ../../c-api/typeobj.rst:365 msgid ":c:type:`setattrfunc`" msgstr ":c:type:`setattrfunc`" @@ -213,7 +214,6 @@ msgstr ":c:type:`PyAsyncMethods` *" #: ../../c-api/typeobj.rst:60 ../../c-api/typeobj.rst:64 #: ../../c-api/typeobj.rst:66 ../../c-api/typeobj.rst:68 -#: ../../c-api/typeobj.rst:82 msgid ":ref:`sub-slots`" msgstr ":ref:`sub-slots`" @@ -228,7 +228,7 @@ msgid ":c:member:`~PyTypeObject.tp_repr`" msgstr ":c:member:`~PyTypeObject.tp_repr`" #: ../../c-api/typeobj.rst:62 ../../c-api/typeobj.rst:74 -#: ../../c-api/typeobj.rst:369 +#: ../../c-api/typeobj.rst:358 msgid ":c:type:`reprfunc`" msgstr ":c:type:`reprfunc`" @@ -264,7 +264,7 @@ msgstr ":c:type:`PyMappingMethods` *" msgid ":c:member:`~PyTypeObject.tp_hash`" msgstr ":c:member:`~PyTypeObject.tp_hash`" -#: ../../c-api/typeobj.rst:70 ../../c-api/typeobj.rst:405 +#: ../../c-api/typeobj.rst:70 ../../c-api/typeobj.rst:394 msgid ":c:type:`hashfunc`" msgstr ":c:type:`hashfunc`" @@ -276,8 +276,8 @@ msgstr "__hash__" msgid ":c:member:`~PyTypeObject.tp_call`" msgstr ":c:member:`~PyTypeObject.tp_call`" -#: ../../c-api/typeobj.rst:72 ../../c-api/typeobj.rst:237 -#: ../../c-api/typeobj.rst:240 ../../c-api/typeobj.rst:441 +#: ../../c-api/typeobj.rst:72 ../../c-api/typeobj.rst:227 +#: ../../c-api/typeobj.rst:230 ../../c-api/typeobj.rst:430 msgid ":c:type:`ternaryfunc`" msgstr ":c:type:`ternaryfunc`" @@ -297,7 +297,7 @@ msgstr "__str__" msgid ":c:member:`~PyTypeObject.tp_getattro`" msgstr ":c:member:`~PyTypeObject.tp_getattro`" -#: ../../c-api/typeobj.rst:76 ../../c-api/typeobj.rst:382 +#: ../../c-api/typeobj.rst:76 ../../c-api/typeobj.rst:371 msgid ":c:type:`getattrofunc`" msgstr ":c:type:`getattrofunc`" @@ -305,7 +305,7 @@ msgstr ":c:type:`getattrofunc`" msgid ":c:member:`~PyTypeObject.tp_setattro`" msgstr ":c:member:`~PyTypeObject.tp_setattro`" -#: ../../c-api/typeobj.rst:79 ../../c-api/typeobj.rst:387 +#: ../../c-api/typeobj.rst:79 ../../c-api/typeobj.rst:376 msgid ":c:type:`setattrofunc`" msgstr ":c:type:`setattrofunc`" @@ -344,7 +344,7 @@ msgstr "__doc__" msgid ":c:member:`~PyTypeObject.tp_traverse`" msgstr ":c:member:`~PyTypeObject.tp_traverse`" -#: ../../c-api/typeobj.rst:88 ../../c-api/typeobj.rst:351 +#: ../../c-api/typeobj.rst:88 ../../c-api/typeobj.rst:340 msgid ":c:type:`traverseproc`" msgstr ":c:type:`traverseproc`" @@ -353,7 +353,7 @@ msgid ":c:member:`~PyTypeObject.tp_clear`" msgstr ":c:member:`~PyTypeObject.tp_clear`" #: ../../c-api/typeobj.rst:90 ../../c-api/typeobj.rst:130 -#: ../../c-api/typeobj.rst:248 ../../c-api/typeobj.rst:430 +#: ../../c-api/typeobj.rst:238 ../../c-api/typeobj.rst:419 msgid ":c:type:`inquiry`" msgstr ":c:type:`inquiry`" @@ -361,7 +361,7 @@ msgstr ":c:type:`inquiry`" msgid ":c:member:`~PyTypeObject.tp_richcompare`" msgstr ":c:member:`~PyTypeObject.tp_richcompare`" -#: ../../c-api/typeobj.rst:92 ../../c-api/typeobj.rst:407 +#: ../../c-api/typeobj.rst:92 ../../c-api/typeobj.rst:396 msgid ":c:type:`richcmpfunc`" msgstr ":c:type:`richcmpfunc`" @@ -370,14 +370,14 @@ msgid "__lt__, __le__, __eq__, __ne__, __gt__, __ge__" msgstr "__lt__, __le__, __eq__, __ne__, __gt__, __ge__" #: ../../c-api/typeobj.rst:99 -msgid "(:c:member:`~PyTypeObject.tp_weaklistoffset`)" -msgstr "" +msgid ":c:member:`~PyTypeObject.tp_weaklistoffset`" +msgstr ":c:member:`~PyTypeObject.tp_weaklistoffset`" #: ../../c-api/typeobj.rst:101 msgid ":c:member:`~PyTypeObject.tp_iter`" msgstr ":c:member:`~PyTypeObject.tp_iter`" -#: ../../c-api/typeobj.rst:101 ../../c-api/typeobj.rst:413 +#: ../../c-api/typeobj.rst:101 ../../c-api/typeobj.rst:402 msgid ":c:type:`getiterfunc`" msgstr ":c:type:`getiterfunc`" @@ -389,7 +389,7 @@ msgstr "__iter__" msgid ":c:member:`~PyTypeObject.tp_iternext`" msgstr ":c:member:`~PyTypeObject.tp_iternext`" -#: ../../c-api/typeobj.rst:103 ../../c-api/typeobj.rst:415 +#: ../../c-api/typeobj.rst:103 ../../c-api/typeobj.rst:404 msgid ":c:type:`iternextfunc`" msgstr ":c:type:`iternextfunc`" @@ -425,7 +425,7 @@ msgstr ":c:type:`PyGetSetDef` []" msgid ":c:member:`~PyTypeObject.tp_base`" msgstr ":c:member:`~PyTypeObject.tp_base`" -#: ../../c-api/typeobj.rst:0 ../../c-api/typeobj.rst:111 +#: ../../c-api/typeobj.rst:111 ../../c-api/typeobj.rst:0 msgid ":c:type:`PyTypeObject` *" msgstr ":c:type:`PyTypeObject` *" @@ -437,18 +437,17 @@ msgstr "__base__" msgid ":c:member:`~PyTypeObject.tp_dict`" msgstr ":c:member:`~PyTypeObject.tp_dict`" -#: ../../c-api/typeobj.rst:0 ../../c-api/typeobj.rst:113 -#: ../../c-api/typeobj.rst:132 ../../c-api/typeobj.rst:134 -#: ../../c-api/typeobj.rst:136 ../../c-api/typeobj.rst:140 -#: ../../c-api/typeobj.rst:342 ../../c-api/typeobj.rst:347 -#: ../../c-api/typeobj.rst:357 ../../c-api/typeobj.rst:369 -#: ../../c-api/typeobj.rst:371 ../../c-api/typeobj.rst:382 -#: ../../c-api/typeobj.rst:393 ../../c-api/typeobj.rst:405 -#: ../../c-api/typeobj.rst:407 ../../c-api/typeobj.rst:413 -#: ../../c-api/typeobj.rst:415 ../../c-api/typeobj.rst:417 -#: ../../c-api/typeobj.rst:430 ../../c-api/typeobj.rst:432 -#: ../../c-api/typeobj.rst:436 ../../c-api/typeobj.rst:441 -#: ../../c-api/typeobj.rst:447 +#: ../../c-api/typeobj.rst:113 ../../c-api/typeobj.rst:132 +#: ../../c-api/typeobj.rst:134 ../../c-api/typeobj.rst:136 +#: ../../c-api/typeobj.rst:138 ../../c-api/typeobj.rst:140 +#: ../../c-api/typeobj.rst:331 ../../c-api/typeobj.rst:0 +#: ../../c-api/typeobj.rst:346 ../../c-api/typeobj.rst:358 +#: ../../c-api/typeobj.rst:360 ../../c-api/typeobj.rst:371 +#: ../../c-api/typeobj.rst:382 ../../c-api/typeobj.rst:394 +#: ../../c-api/typeobj.rst:396 ../../c-api/typeobj.rst:402 +#: ../../c-api/typeobj.rst:404 ../../c-api/typeobj.rst:406 +#: ../../c-api/typeobj.rst:421 ../../c-api/typeobj.rst:425 +#: ../../c-api/typeobj.rst:430 ../../c-api/typeobj.rst:436 msgid ":c:type:`PyObject` *" msgstr ":c:type:`PyObject` *" @@ -460,7 +459,7 @@ msgstr "__dict__" msgid ":c:member:`~PyTypeObject.tp_descr_get`" msgstr ":c:member:`~PyTypeObject.tp_descr_get`" -#: ../../c-api/typeobj.rst:115 ../../c-api/typeobj.rst:393 +#: ../../c-api/typeobj.rst:115 ../../c-api/typeobj.rst:382 msgid ":c:type:`descrgetfunc`" msgstr ":c:type:`descrgetfunc`" @@ -472,7 +471,7 @@ msgstr "__get__" msgid ":c:member:`~PyTypeObject.tp_descr_set`" msgstr ":c:member:`~PyTypeObject.tp_descr_set`" -#: ../../c-api/typeobj.rst:117 ../../c-api/typeobj.rst:399 +#: ../../c-api/typeobj.rst:117 ../../c-api/typeobj.rst:388 msgid ":c:type:`descrsetfunc`" msgstr ":c:type:`descrsetfunc`" @@ -481,14 +480,14 @@ msgid "__set__, __delete__" msgstr "__set__, __delete__" #: ../../c-api/typeobj.rst:120 -msgid "(:c:member:`~PyTypeObject.tp_dictoffset`)" -msgstr "" +msgid ":c:member:`~PyTypeObject.tp_dictoffset`" +msgstr ":c:member:`~PyTypeObject.tp_dictoffset`" #: ../../c-api/typeobj.rst:122 msgid ":c:member:`~PyTypeObject.tp_init`" msgstr ":c:member:`~PyTypeObject.tp_init`" -#: ../../c-api/typeobj.rst:122 ../../c-api/typeobj.rst:363 +#: ../../c-api/typeobj.rst:122 ../../c-api/typeobj.rst:352 msgid ":c:type:`initproc`" msgstr ":c:type:`initproc`" @@ -500,7 +499,7 @@ msgstr "__init__" msgid ":c:member:`~PyTypeObject.tp_alloc`" msgstr ":c:member:`~PyTypeObject.tp_alloc`" -#: ../../c-api/typeobj.rst:124 ../../c-api/typeobj.rst:342 +#: ../../c-api/typeobj.rst:124 ../../c-api/typeobj.rst:331 msgid ":c:type:`allocfunc`" msgstr ":c:type:`allocfunc`" @@ -508,7 +507,7 @@ msgstr ":c:type:`allocfunc`" msgid ":c:member:`~PyTypeObject.tp_new`" msgstr ":c:member:`~PyTypeObject.tp_new`" -#: ../../c-api/typeobj.rst:126 ../../c-api/typeobj.rst:357 +#: ../../c-api/typeobj.rst:126 ../../c-api/typeobj.rst:346 msgid ":c:type:`newfunc`" msgstr ":c:type:`newfunc`" @@ -520,7 +519,7 @@ msgstr "__new__" msgid ":c:member:`~PyTypeObject.tp_free`" msgstr ":c:member:`~PyTypeObject.tp_free`" -#: ../../c-api/typeobj.rst:128 ../../c-api/typeobj.rst:349 +#: ../../c-api/typeobj.rst:128 ../../c-api/typeobj.rst:338 msgid ":c:type:`freefunc`" msgstr ":c:type:`freefunc`" @@ -556,11 +555,6 @@ msgstr "[:c:member:`~PyTypeObject.tp_cache`]" msgid "[:c:member:`~PyTypeObject.tp_subclasses`]" msgstr "[:c:member:`~PyTypeObject.tp_subclasses`]" -#: ../../c-api/typeobj.rst:0 ../../c-api/typeobj.rst:138 -#: ../../c-api/typeobj.rst:279 ../../c-api/typeobj.rst:349 -msgid "void *" -msgstr "void *" - #: ../../c-api/typeobj.rst:138 msgid "__subclasses__" msgstr "__subclasses__" @@ -597,570 +591,519 @@ msgstr ":c:member:`~PyTypeObject.tp_vectorcall`" msgid ":c:type:`vectorcallfunc`" msgstr ":c:type:`vectorcallfunc`" -#: ../../c-api/typeobj.rst:150 -msgid "[:c:member:`~PyTypeObject.tp_watched`]" -msgstr "" - -#: ../../c-api/typeobj.rst:150 -msgid "unsigned char" -msgstr "unsigned char" - -#: ../../c-api/typeobj.rst:155 +#: ../../c-api/typeobj.rst:152 msgid "" -"**()**: A slot name in parentheses indicates it is (effectively) deprecated." +"A slot name in parentheses indicates it is (effectively) deprecated. Names " +"in angle brackets should be treated as read-only. Names in square brackets " +"are for internal use only. \"\" (as a prefix) means the field is required " +"(must be non-``NULL``)." msgstr "" +"丸括弧で囲われているスロット名は、それが (実質的に) 非推奨であることを示して" +"います。\n" +"山括弧で囲われているスロット名は、読み出し専用として扱われるべきです。\n" +"角括弧で囲われているスロット名は、内部でのみ使われます。\n" +"(接頭辞としての) \"\" は、このフィールドが必須であること (``NULL`` でない" +"こと) を意味します。" -#: ../../c-api/typeobj.rst:157 -msgid "" -"**<>**: Names in angle brackets should be initially set to ``NULL`` and " -"treated as read-only." -msgstr "" - -#: ../../c-api/typeobj.rst:160 -msgid "**[]**: Names in square brackets are for internal use only." -msgstr "" - -#: ../../c-api/typeobj.rst:162 -msgid "" -"**** (as a prefix) means the field is required (must be non-``NULL``)." -msgstr "" - -#: ../../c-api/typeobj.rst:164 +#: ../../c-api/typeobj.rst:156 msgid "Columns:" msgstr "列:" -#: ../../c-api/typeobj.rst:166 -msgid "**\"O\"**: set on :c:data:`PyBaseObject_Type`" +#: ../../c-api/typeobj.rst:158 +msgid "**\"O\"**: set on :c:type:`PyBaseObject_Type`" msgstr "" -#: ../../c-api/typeobj.rst:168 -msgid "**\"T\"**: set on :c:data:`PyType_Type`" +#: ../../c-api/typeobj.rst:160 +msgid "**\"T\"**: set on :c:type:`PyType_Type`" msgstr "" -#: ../../c-api/typeobj.rst:170 +#: ../../c-api/typeobj.rst:162 msgid "**\"D\"**: default (if slot is set to ``NULL``)" msgstr "" #: ../../c-api/typeobj.rst:172 -msgid "" -"X - PyType_Ready sets this value if it is NULL\n" -"~ - PyType_Ready always sets this value (it should be NULL)\n" -"? - PyType_Ready may set this value depending on other slots\n" -"\n" -"Also see the inheritance column (\"I\")." -msgstr "" - -#: ../../c-api/typeobj.rst:180 msgid "**\"I\"**: inheritance" msgstr "" -#: ../../c-api/typeobj.rst:182 -msgid "" -"X - type slot is inherited via *PyType_Ready* if defined with a *NULL* " -"value\n" -"% - the slots of the sub-struct are inherited individually\n" -"G - inherited, but only in combination with other slots; see the slot's " -"description\n" -"? - it's complicated; see the slot's description" -msgstr "" - -#: ../../c-api/typeobj.rst:189 +#: ../../c-api/typeobj.rst:181 msgid "" "Note that some slots are effectively inherited through the normal attribute " "lookup chain." msgstr "" -#: ../../c-api/typeobj.rst:195 +#: ../../c-api/typeobj.rst:187 msgid "sub-slots" msgstr "sub-slots" -#: ../../c-api/typeobj.rst:201 +#: ../../c-api/typeobj.rst:193 msgid "Slot" msgstr "Slot" -#: ../../c-api/typeobj.rst:201 +#: ../../c-api/typeobj.rst:193 msgid "special methods" msgstr "特殊メソッド" -#: ../../c-api/typeobj.rst:204 +#: ../../c-api/typeobj.rst:196 msgid ":c:member:`~PyAsyncMethods.am_await`" msgstr ":c:member:`~PyAsyncMethods.am_await`" -#: ../../c-api/typeobj.rst:204 ../../c-api/typeobj.rst:206 -#: ../../c-api/typeobj.rst:208 ../../c-api/typeobj.rst:242 -#: ../../c-api/typeobj.rst:244 ../../c-api/typeobj.rst:246 -#: ../../c-api/typeobj.rst:250 ../../c-api/typeobj.rst:277 -#: ../../c-api/typeobj.rst:281 ../../c-api/typeobj.rst:291 -#: ../../c-api/typeobj.rst:432 +#: ../../c-api/typeobj.rst:196 ../../c-api/typeobj.rst:198 +#: ../../c-api/typeobj.rst:200 ../../c-api/typeobj.rst:232 +#: ../../c-api/typeobj.rst:234 ../../c-api/typeobj.rst:236 +#: ../../c-api/typeobj.rst:240 ../../c-api/typeobj.rst:267 +#: ../../c-api/typeobj.rst:271 ../../c-api/typeobj.rst:281 +#: ../../c-api/typeobj.rst:421 msgid ":c:type:`unaryfunc`" msgstr ":c:type:`unaryfunc`" -#: ../../c-api/typeobj.rst:204 +#: ../../c-api/typeobj.rst:196 msgid "__await__" msgstr "__await__" -#: ../../c-api/typeobj.rst:206 +#: ../../c-api/typeobj.rst:198 msgid ":c:member:`~PyAsyncMethods.am_aiter`" msgstr ":c:member:`~PyAsyncMethods.am_aiter`" -#: ../../c-api/typeobj.rst:206 +#: ../../c-api/typeobj.rst:198 msgid "__aiter__" msgstr "__aiter__" -#: ../../c-api/typeobj.rst:208 +#: ../../c-api/typeobj.rst:200 msgid ":c:member:`~PyAsyncMethods.am_anext`" msgstr ":c:member:`~PyAsyncMethods.am_anext`" -#: ../../c-api/typeobj.rst:208 +#: ../../c-api/typeobj.rst:200 msgid "__anext__" msgstr "__anext__" -#: ../../c-api/typeobj.rst:210 -msgid ":c:member:`~PyAsyncMethods.am_send`" -msgstr "" - -#: ../../c-api/typeobj.rst:210 -msgid ":c:type:`sendfunc`" -msgstr "" - -#: ../../c-api/typeobj.rst:214 +#: ../../c-api/typeobj.rst:204 msgid ":c:member:`~PyNumberMethods.nb_add`" msgstr ":c:member:`~PyNumberMethods.nb_add`" +#: ../../c-api/typeobj.rst:204 ../../c-api/typeobj.rst:207 +#: ../../c-api/typeobj.rst:209 ../../c-api/typeobj.rst:212 #: ../../c-api/typeobj.rst:214 ../../c-api/typeobj.rst:217 #: ../../c-api/typeobj.rst:219 ../../c-api/typeobj.rst:222 -#: ../../c-api/typeobj.rst:224 ../../c-api/typeobj.rst:227 -#: ../../c-api/typeobj.rst:229 ../../c-api/typeobj.rst:232 -#: ../../c-api/typeobj.rst:234 ../../c-api/typeobj.rst:252 +#: ../../c-api/typeobj.rst:224 ../../c-api/typeobj.rst:242 +#: ../../c-api/typeobj.rst:245 ../../c-api/typeobj.rst:247 +#: ../../c-api/typeobj.rst:250 ../../c-api/typeobj.rst:252 #: ../../c-api/typeobj.rst:255 ../../c-api/typeobj.rst:257 #: ../../c-api/typeobj.rst:260 ../../c-api/typeobj.rst:262 -#: ../../c-api/typeobj.rst:265 ../../c-api/typeobj.rst:267 -#: ../../c-api/typeobj.rst:270 ../../c-api/typeobj.rst:272 -#: ../../c-api/typeobj.rst:275 ../../c-api/typeobj.rst:283 -#: ../../c-api/typeobj.rst:285 ../../c-api/typeobj.rst:287 -#: ../../c-api/typeobj.rst:289 ../../c-api/typeobj.rst:293 -#: ../../c-api/typeobj.rst:296 ../../c-api/typeobj.rst:302 -#: ../../c-api/typeobj.rst:311 ../../c-api/typeobj.rst:322 -#: ../../c-api/typeobj.rst:436 +#: ../../c-api/typeobj.rst:265 ../../c-api/typeobj.rst:273 +#: ../../c-api/typeobj.rst:275 ../../c-api/typeobj.rst:277 +#: ../../c-api/typeobj.rst:279 ../../c-api/typeobj.rst:283 +#: ../../c-api/typeobj.rst:286 ../../c-api/typeobj.rst:292 +#: ../../c-api/typeobj.rst:301 ../../c-api/typeobj.rst:312 +#: ../../c-api/typeobj.rst:425 msgid ":c:type:`binaryfunc`" msgstr ":c:type:`binaryfunc`" -#: ../../c-api/typeobj.rst:214 +#: ../../c-api/typeobj.rst:204 msgid "__add__ __radd__" msgstr "__add__ __radd__" -#: ../../c-api/typeobj.rst:217 +#: ../../c-api/typeobj.rst:207 msgid ":c:member:`~PyNumberMethods.nb_inplace_add`" msgstr ":c:member:`~PyNumberMethods.nb_inplace_add`" -#: ../../c-api/typeobj.rst:217 ../../c-api/typeobj.rst:322 +#: ../../c-api/typeobj.rst:207 ../../c-api/typeobj.rst:312 msgid "__iadd__" msgstr "__iadd__" -#: ../../c-api/typeobj.rst:219 +#: ../../c-api/typeobj.rst:209 msgid ":c:member:`~PyNumberMethods.nb_subtract`" msgstr ":c:member:`~PyNumberMethods.nb_subtract`" -#: ../../c-api/typeobj.rst:219 +#: ../../c-api/typeobj.rst:209 msgid "__sub__ __rsub__" msgstr "__sub__ __rsub__" -#: ../../c-api/typeobj.rst:222 +#: ../../c-api/typeobj.rst:212 msgid ":c:member:`~PyNumberMethods.nb_inplace_subtract`" msgstr ":c:member:`~PyNumberMethods.nb_inplace_subtract`" -#: ../../c-api/typeobj.rst:222 -msgid "__isub__" -msgstr "" +#: ../../c-api/typeobj.rst:212 +msgid "__sub__" +msgstr "__sub__" -#: ../../c-api/typeobj.rst:224 +#: ../../c-api/typeobj.rst:214 msgid ":c:member:`~PyNumberMethods.nb_multiply`" msgstr ":c:member:`~PyNumberMethods.nb_multiply`" -#: ../../c-api/typeobj.rst:224 +#: ../../c-api/typeobj.rst:214 msgid "__mul__ __rmul__" msgstr "__mul__ __rmul__" -#: ../../c-api/typeobj.rst:227 +#: ../../c-api/typeobj.rst:217 msgid ":c:member:`~PyNumberMethods.nb_inplace_multiply`" msgstr ":c:member:`~PyNumberMethods.nb_inplace_multiply`" -#: ../../c-api/typeobj.rst:227 ../../c-api/typeobj.rst:324 -msgid "__imul__" -msgstr "__imul__" +#: ../../c-api/typeobj.rst:217 ../../c-api/typeobj.rst:303 +msgid "__mul__" +msgstr "__mul__" -#: ../../c-api/typeobj.rst:229 +#: ../../c-api/typeobj.rst:219 msgid ":c:member:`~PyNumberMethods.nb_remainder`" msgstr ":c:member:`~PyNumberMethods.nb_remainder`" -#: ../../c-api/typeobj.rst:229 +#: ../../c-api/typeobj.rst:219 msgid "__mod__ __rmod__" msgstr "__mod__ __rmod__" -#: ../../c-api/typeobj.rst:232 +#: ../../c-api/typeobj.rst:222 msgid ":c:member:`~PyNumberMethods.nb_inplace_remainder`" msgstr ":c:member:`~PyNumberMethods.nb_inplace_remainder`" -#: ../../c-api/typeobj.rst:232 -msgid "__imod__" -msgstr "" +#: ../../c-api/typeobj.rst:222 +msgid "__mod__" +msgstr "__mod__" -#: ../../c-api/typeobj.rst:234 +#: ../../c-api/typeobj.rst:224 msgid ":c:member:`~PyNumberMethods.nb_divmod`" msgstr ":c:member:`~PyNumberMethods.nb_divmod`" -#: ../../c-api/typeobj.rst:234 +#: ../../c-api/typeobj.rst:224 msgid "__divmod__ __rdivmod__" msgstr "__divmod__ __rdivmod__" -#: ../../c-api/typeobj.rst:237 +#: ../../c-api/typeobj.rst:227 msgid ":c:member:`~PyNumberMethods.nb_power`" msgstr ":c:member:`~PyNumberMethods.nb_power`" -#: ../../c-api/typeobj.rst:237 +#: ../../c-api/typeobj.rst:227 msgid "__pow__ __rpow__" msgstr "__pow__ __rpow__" -#: ../../c-api/typeobj.rst:240 +#: ../../c-api/typeobj.rst:230 msgid ":c:member:`~PyNumberMethods.nb_inplace_power`" msgstr ":c:member:`~PyNumberMethods.nb_inplace_power`" -#: ../../c-api/typeobj.rst:240 -msgid "__ipow__" -msgstr "" +#: ../../c-api/typeobj.rst:230 +msgid "__pow__" +msgstr "__pow__" -#: ../../c-api/typeobj.rst:242 +#: ../../c-api/typeobj.rst:232 msgid ":c:member:`~PyNumberMethods.nb_negative`" msgstr ":c:member:`~PyNumberMethods.nb_negative`" -#: ../../c-api/typeobj.rst:242 +#: ../../c-api/typeobj.rst:232 msgid "__neg__" msgstr "__neg__" -#: ../../c-api/typeobj.rst:244 +#: ../../c-api/typeobj.rst:234 msgid ":c:member:`~PyNumberMethods.nb_positive`" msgstr ":c:member:`~PyNumberMethods.nb_positive`" -#: ../../c-api/typeobj.rst:244 +#: ../../c-api/typeobj.rst:234 msgid "__pos__" msgstr "__pos__" -#: ../../c-api/typeobj.rst:246 +#: ../../c-api/typeobj.rst:236 msgid ":c:member:`~PyNumberMethods.nb_absolute`" msgstr ":c:member:`~PyNumberMethods.nb_absolute`" -#: ../../c-api/typeobj.rst:246 +#: ../../c-api/typeobj.rst:236 msgid "__abs__" msgstr "__abs__" -#: ../../c-api/typeobj.rst:248 +#: ../../c-api/typeobj.rst:238 msgid ":c:member:`~PyNumberMethods.nb_bool`" msgstr ":c:member:`~PyNumberMethods.nb_bool`" -#: ../../c-api/typeobj.rst:248 +#: ../../c-api/typeobj.rst:238 msgid "__bool__" msgstr "__bool__" -#: ../../c-api/typeobj.rst:250 +#: ../../c-api/typeobj.rst:240 msgid ":c:member:`~PyNumberMethods.nb_invert`" msgstr ":c:member:`~PyNumberMethods.nb_invert`" -#: ../../c-api/typeobj.rst:250 +#: ../../c-api/typeobj.rst:240 msgid "__invert__" msgstr "__invert__" -#: ../../c-api/typeobj.rst:252 +#: ../../c-api/typeobj.rst:242 msgid ":c:member:`~PyNumberMethods.nb_lshift`" msgstr ":c:member:`~PyNumberMethods.nb_lshift`" -#: ../../c-api/typeobj.rst:252 +#: ../../c-api/typeobj.rst:242 msgid "__lshift__ __rlshift__" msgstr "__lshift__ __rlshift__" -#: ../../c-api/typeobj.rst:255 +#: ../../c-api/typeobj.rst:245 msgid ":c:member:`~PyNumberMethods.nb_inplace_lshift`" msgstr ":c:member:`~PyNumberMethods.nb_inplace_lshift`" -#: ../../c-api/typeobj.rst:255 -msgid "__ilshift__" -msgstr "" +#: ../../c-api/typeobj.rst:245 +msgid "__lshift__" +msgstr "__lshift__" -#: ../../c-api/typeobj.rst:257 +#: ../../c-api/typeobj.rst:247 msgid ":c:member:`~PyNumberMethods.nb_rshift`" msgstr ":c:member:`~PyNumberMethods.nb_rshift`" -#: ../../c-api/typeobj.rst:257 +#: ../../c-api/typeobj.rst:247 msgid "__rshift__ __rrshift__" msgstr "__rshift__ __rrshift__" -#: ../../c-api/typeobj.rst:260 +#: ../../c-api/typeobj.rst:250 msgid ":c:member:`~PyNumberMethods.nb_inplace_rshift`" msgstr ":c:member:`~PyNumberMethods.nb_inplace_rshift`" -#: ../../c-api/typeobj.rst:260 -msgid "__irshift__" -msgstr "" +#: ../../c-api/typeobj.rst:250 +msgid "__rshift__" +msgstr "__rshift__" -#: ../../c-api/typeobj.rst:262 +#: ../../c-api/typeobj.rst:252 msgid ":c:member:`~PyNumberMethods.nb_and`" msgstr ":c:member:`~PyNumberMethods.nb_and`" -#: ../../c-api/typeobj.rst:262 +#: ../../c-api/typeobj.rst:252 msgid "__and__ __rand__" msgstr "__and__ __rand__" -#: ../../c-api/typeobj.rst:265 +#: ../../c-api/typeobj.rst:255 msgid ":c:member:`~PyNumberMethods.nb_inplace_and`" msgstr ":c:member:`~PyNumberMethods.nb_inplace_and`" -#: ../../c-api/typeobj.rst:265 -msgid "__iand__" -msgstr "" +#: ../../c-api/typeobj.rst:255 +msgid "__and__" +msgstr "__and__" -#: ../../c-api/typeobj.rst:267 +#: ../../c-api/typeobj.rst:257 msgid ":c:member:`~PyNumberMethods.nb_xor`" msgstr ":c:member:`~PyNumberMethods.nb_xor`" -#: ../../c-api/typeobj.rst:267 +#: ../../c-api/typeobj.rst:257 msgid "__xor__ __rxor__" msgstr "__xor__ __rxor__" -#: ../../c-api/typeobj.rst:270 +#: ../../c-api/typeobj.rst:260 msgid ":c:member:`~PyNumberMethods.nb_inplace_xor`" msgstr ":c:member:`~PyNumberMethods.nb_inplace_xor`" -#: ../../c-api/typeobj.rst:270 -msgid "__ixor__" -msgstr "" +#: ../../c-api/typeobj.rst:260 +msgid "__xor__" +msgstr "__xor__" -#: ../../c-api/typeobj.rst:272 +#: ../../c-api/typeobj.rst:262 msgid ":c:member:`~PyNumberMethods.nb_or`" msgstr ":c:member:`~PyNumberMethods.nb_or`" -#: ../../c-api/typeobj.rst:272 +#: ../../c-api/typeobj.rst:262 msgid "__or__ __ror__" msgstr "__or__ __ror__" -#: ../../c-api/typeobj.rst:275 +#: ../../c-api/typeobj.rst:265 msgid ":c:member:`~PyNumberMethods.nb_inplace_or`" msgstr ":c:member:`~PyNumberMethods.nb_inplace_or`" -#: ../../c-api/typeobj.rst:275 -msgid "__ior__" -msgstr "" +#: ../../c-api/typeobj.rst:265 +msgid "__or__" +msgstr "__or__" -#: ../../c-api/typeobj.rst:277 +#: ../../c-api/typeobj.rst:267 msgid ":c:member:`~PyNumberMethods.nb_int`" msgstr ":c:member:`~PyNumberMethods.nb_int`" -#: ../../c-api/typeobj.rst:277 +#: ../../c-api/typeobj.rst:267 msgid "__int__" msgstr "__int__" -#: ../../c-api/typeobj.rst:279 +#: ../../c-api/typeobj.rst:269 msgid ":c:member:`~PyNumberMethods.nb_reserved`" msgstr ":c:member:`~PyNumberMethods.nb_reserved`" -#: ../../c-api/typeobj.rst:281 +#: ../../c-api/typeobj.rst:269 ../../c-api/typeobj.rst:336 +#: ../../c-api/typeobj.rst:338 ../../c-api/typeobj.rst:0 +#: ../../c-api/typeobj.rst:419 +msgid "void *" +msgstr "void *" + +#: ../../c-api/typeobj.rst:271 msgid ":c:member:`~PyNumberMethods.nb_float`" msgstr ":c:member:`~PyNumberMethods.nb_float`" -#: ../../c-api/typeobj.rst:281 +#: ../../c-api/typeobj.rst:271 msgid "__float__" msgstr "__float__" -#: ../../c-api/typeobj.rst:283 +#: ../../c-api/typeobj.rst:273 msgid ":c:member:`~PyNumberMethods.nb_floor_divide`" msgstr ":c:member:`~PyNumberMethods.nb_floor_divide`" -#: ../../c-api/typeobj.rst:283 +#: ../../c-api/typeobj.rst:273 ../../c-api/typeobj.rst:275 msgid "__floordiv__" msgstr "__floordiv__" -#: ../../c-api/typeobj.rst:285 +#: ../../c-api/typeobj.rst:275 msgid ":c:member:`~PyNumberMethods.nb_inplace_floor_divide`" msgstr ":c:member:`~PyNumberMethods.nb_inplace_floor_divide`" -#: ../../c-api/typeobj.rst:285 -msgid "__ifloordiv__" -msgstr "" - -#: ../../c-api/typeobj.rst:287 +#: ../../c-api/typeobj.rst:277 msgid ":c:member:`~PyNumberMethods.nb_true_divide`" msgstr ":c:member:`~PyNumberMethods.nb_true_divide`" -#: ../../c-api/typeobj.rst:287 +#: ../../c-api/typeobj.rst:277 ../../c-api/typeobj.rst:279 msgid "__truediv__" msgstr "__truediv__" -#: ../../c-api/typeobj.rst:289 +#: ../../c-api/typeobj.rst:279 msgid ":c:member:`~PyNumberMethods.nb_inplace_true_divide`" msgstr ":c:member:`~PyNumberMethods.nb_inplace_true_divide`" -#: ../../c-api/typeobj.rst:289 -msgid "__itruediv__" -msgstr "" - -#: ../../c-api/typeobj.rst:291 +#: ../../c-api/typeobj.rst:281 msgid ":c:member:`~PyNumberMethods.nb_index`" msgstr ":c:member:`~PyNumberMethods.nb_index`" -#: ../../c-api/typeobj.rst:291 +#: ../../c-api/typeobj.rst:281 msgid "__index__" msgstr "__index__" -#: ../../c-api/typeobj.rst:293 +#: ../../c-api/typeobj.rst:283 msgid ":c:member:`~PyNumberMethods.nb_matrix_multiply`" msgstr ":c:member:`~PyNumberMethods.nb_matrix_multiply`" -#: ../../c-api/typeobj.rst:293 +#: ../../c-api/typeobj.rst:283 msgid "__matmul__ __rmatmul__" msgstr "__matmul__ __rmatmul__" -#: ../../c-api/typeobj.rst:296 +#: ../../c-api/typeobj.rst:286 msgid ":c:member:`~PyNumberMethods.nb_inplace_matrix_multiply`" msgstr ":c:member:`~PyNumberMethods.nb_inplace_matrix_multiply`" -#: ../../c-api/typeobj.rst:296 -msgid "__imatmul__" -msgstr "" +#: ../../c-api/typeobj.rst:286 +msgid "__matmul__" +msgstr "__matmul__" -#: ../../c-api/typeobj.rst:300 +#: ../../c-api/typeobj.rst:290 msgid ":c:member:`~PyMappingMethods.mp_length`" msgstr ":c:member:`~PyMappingMethods.mp_length`" -#: ../../c-api/typeobj.rst:300 ../../c-api/typeobj.rst:309 -#: ../../c-api/typeobj.rst:417 +#: ../../c-api/typeobj.rst:290 ../../c-api/typeobj.rst:299 +#: ../../c-api/typeobj.rst:406 msgid ":c:type:`lenfunc`" msgstr ":c:type:`lenfunc`" -#: ../../c-api/typeobj.rst:300 ../../c-api/typeobj.rst:309 +#: ../../c-api/typeobj.rst:290 ../../c-api/typeobj.rst:299 msgid "__len__" msgstr "__len__" -#: ../../c-api/typeobj.rst:302 +#: ../../c-api/typeobj.rst:292 msgid ":c:member:`~PyMappingMethods.mp_subscript`" msgstr ":c:member:`~PyMappingMethods.mp_subscript`" -#: ../../c-api/typeobj.rst:302 ../../c-api/typeobj.rst:315 +#: ../../c-api/typeobj.rst:292 ../../c-api/typeobj.rst:305 msgid "__getitem__" msgstr "__getitem__" -#: ../../c-api/typeobj.rst:304 +#: ../../c-api/typeobj.rst:294 msgid ":c:member:`~PyMappingMethods.mp_ass_subscript`" msgstr ":c:member:`~PyMappingMethods.mp_ass_subscript`" -#: ../../c-api/typeobj.rst:304 ../../c-api/typeobj.rst:463 +#: ../../c-api/typeobj.rst:294 ../../c-api/typeobj.rst:451 msgid ":c:type:`objobjargproc`" msgstr ":c:type:`objobjargproc`" -#: ../../c-api/typeobj.rst:304 +#: ../../c-api/typeobj.rst:294 msgid "__setitem__, __delitem__" msgstr "__setitem__, __delitem__" -#: ../../c-api/typeobj.rst:309 +#: ../../c-api/typeobj.rst:299 msgid ":c:member:`~PySequenceMethods.sq_length`" msgstr ":c:member:`~PySequenceMethods.sq_length`" -#: ../../c-api/typeobj.rst:311 +#: ../../c-api/typeobj.rst:301 msgid ":c:member:`~PySequenceMethods.sq_concat`" msgstr ":c:member:`~PySequenceMethods.sq_concat`" -#: ../../c-api/typeobj.rst:311 +#: ../../c-api/typeobj.rst:301 msgid "__add__" msgstr "__add__" -#: ../../c-api/typeobj.rst:313 +#: ../../c-api/typeobj.rst:303 msgid ":c:member:`~PySequenceMethods.sq_repeat`" msgstr ":c:member:`~PySequenceMethods.sq_repeat`" -#: ../../c-api/typeobj.rst:313 ../../c-api/typeobj.rst:315 -#: ../../c-api/typeobj.rst:324 ../../c-api/typeobj.rst:447 +#: ../../c-api/typeobj.rst:303 ../../c-api/typeobj.rst:305 +#: ../../c-api/typeobj.rst:314 ../../c-api/typeobj.rst:436 msgid ":c:type:`ssizeargfunc`" msgstr ":c:type:`ssizeargfunc`" -#: ../../c-api/typeobj.rst:313 -msgid "__mul__" -msgstr "__mul__" - -#: ../../c-api/typeobj.rst:315 +#: ../../c-api/typeobj.rst:305 msgid ":c:member:`~PySequenceMethods.sq_item`" msgstr ":c:member:`~PySequenceMethods.sq_item`" -#: ../../c-api/typeobj.rst:317 +#: ../../c-api/typeobj.rst:307 msgid ":c:member:`~PySequenceMethods.sq_ass_item`" msgstr ":c:member:`~PySequenceMethods.sq_ass_item`" -#: ../../c-api/typeobj.rst:317 ../../c-api/typeobj.rst:452 +#: ../../c-api/typeobj.rst:307 ../../c-api/typeobj.rst:441 msgid ":c:type:`ssizeobjargproc`" msgstr ":c:type:`ssizeobjargproc`" -#: ../../c-api/typeobj.rst:317 +#: ../../c-api/typeobj.rst:307 msgid "__setitem__ __delitem__" msgstr "__setitem__ __delitem__" -#: ../../c-api/typeobj.rst:320 +#: ../../c-api/typeobj.rst:310 msgid ":c:member:`~PySequenceMethods.sq_contains`" msgstr ":c:member:`~PySequenceMethods.sq_contains`" -#: ../../c-api/typeobj.rst:320 ../../c-api/typeobj.rst:458 +#: ../../c-api/typeobj.rst:310 ../../c-api/typeobj.rst:446 msgid ":c:type:`objobjproc`" msgstr ":c:type:`objobjproc`" -#: ../../c-api/typeobj.rst:320 +#: ../../c-api/typeobj.rst:310 msgid "__contains__" msgstr "__contains__" -#: ../../c-api/typeobj.rst:322 +#: ../../c-api/typeobj.rst:312 msgid ":c:member:`~PySequenceMethods.sq_inplace_concat`" msgstr ":c:member:`~PySequenceMethods.sq_inplace_concat`" -#: ../../c-api/typeobj.rst:324 +#: ../../c-api/typeobj.rst:314 msgid ":c:member:`~PySequenceMethods.sq_inplace_repeat`" msgstr ":c:member:`~PySequenceMethods.sq_inplace_repeat`" -#: ../../c-api/typeobj.rst:328 +#: ../../c-api/typeobj.rst:314 +msgid "__imul__" +msgstr "__imul__" + +#: ../../c-api/typeobj.rst:318 msgid ":c:member:`~PyBufferProcs.bf_getbuffer`" msgstr ":c:member:`~PyBufferProcs.bf_getbuffer`" -#: ../../c-api/typeobj.rst:328 +#: ../../c-api/typeobj.rst:318 msgid ":c:func:`getbufferproc`" msgstr ":c:func:`getbufferproc`" -#: ../../c-api/typeobj.rst:328 -msgid "__buffer__" -msgstr "" - -#: ../../c-api/typeobj.rst:330 +#: ../../c-api/typeobj.rst:320 msgid ":c:member:`~PyBufferProcs.bf_releasebuffer`" msgstr ":c:member:`~PyBufferProcs.bf_releasebuffer`" -#: ../../c-api/typeobj.rst:330 +#: ../../c-api/typeobj.rst:320 msgid ":c:func:`releasebufferproc`" msgstr ":c:func:`releasebufferproc`" -#: ../../c-api/typeobj.rst:330 -msgid "__release_\\ buffer\\__" -msgstr "" - -#: ../../c-api/typeobj.rst:337 +#: ../../c-api/typeobj.rst:326 msgid "slot typedefs" msgstr "スロットの定義型 (typedef)" -#: ../../c-api/typeobj.rst:340 +#: ../../c-api/typeobj.rst:329 msgid "typedef" msgstr "定義型 (typedef)" -#: ../../c-api/typeobj.rst:340 +#: ../../c-api/typeobj.rst:329 msgid "Parameter Types" msgstr "引数型" -#: ../../c-api/typeobj.rst:340 +#: ../../c-api/typeobj.rst:329 msgid "Return Type" msgstr "返り値型" -#: ../../c-api/typeobj.rst:347 ../../c-api/typeobj.rst:349 -#: ../../c-api/typeobj.rst:425 +#: ../../c-api/typeobj.rst:336 ../../c-api/typeobj.rst:338 +#: ../../c-api/typeobj.rst:414 msgid "void" msgstr "void" @@ -1168,20 +1111,20 @@ msgstr "void" msgid ":c:type:`visitproc`" msgstr ":c:type:`visitproc`" -#: ../../c-api/typeobj.rst:0 ../../c-api/typeobj.rst:351 -#: ../../c-api/typeobj.rst:363 ../../c-api/typeobj.rst:376 -#: ../../c-api/typeobj.rst:387 ../../c-api/typeobj.rst:399 -#: ../../c-api/typeobj.rst:419 ../../c-api/typeobj.rst:430 -#: ../../c-api/typeobj.rst:452 ../../c-api/typeobj.rst:458 -#: ../../c-api/typeobj.rst:463 +#: ../../c-api/typeobj.rst:340 ../../c-api/typeobj.rst:352 +#: ../../c-api/typeobj.rst:365 ../../c-api/typeobj.rst:376 +#: ../../c-api/typeobj.rst:388 ../../c-api/typeobj.rst:0 +#: ../../c-api/typeobj.rst:408 ../../c-api/typeobj.rst:419 +#: ../../c-api/typeobj.rst:441 ../../c-api/typeobj.rst:446 +#: ../../c-api/typeobj.rst:451 msgid "int" msgstr "int" -#: ../../c-api/typeobj.rst:405 +#: ../../c-api/typeobj.rst:394 msgid "Py_hash_t" msgstr "Py_hash_t" -#: ../../c-api/typeobj.rst:419 +#: ../../c-api/typeobj.rst:408 msgid ":c:type:`getbufferproc`" msgstr ":c:type:`getbufferproc`" @@ -1189,189 +1132,124 @@ msgstr ":c:type:`getbufferproc`" msgid ":c:type:`Py_buffer` *" msgstr ":c:type:`Py_buffer` *" -#: ../../c-api/typeobj.rst:425 +#: ../../c-api/typeobj.rst:414 msgid ":c:type:`releasebufferproc`" msgstr ":c:type:`releasebufferproc`" -#: ../../c-api/typeobj.rst:470 +#: ../../c-api/typeobj.rst:458 msgid "See :ref:`slot-typedefs` below for more detail." msgstr "" -#: ../../c-api/typeobj.rst:474 +#: ../../c-api/typeobj.rst:462 msgid "PyTypeObject Definition" msgstr "PyTypeObject 定義" -#: ../../c-api/typeobj.rst:476 +#: ../../c-api/typeobj.rst:464 msgid "" "The structure definition for :c:type:`PyTypeObject` can be found in :file:" -"`Include/cpython/object.h`. For convenience of reference, this repeats the " +"`Include/object.h`. For convenience of reference, this repeats the " "definition found there:" msgstr "" +":c:type:`PyTypeObject` の構造体定義は :file:`Include/object.h` で見つけられる" +"はずです。参照の手間を省くために、ここでは定義を繰り返します:" -#: ../../c-api/typeobj.rst:482 -msgid "" -"typedef struct _typeobject {\n" -" PyObject_VAR_HEAD\n" -" const char *tp_name; /* For printing, in format \".\" */\n" -" Py_ssize_t tp_basicsize, tp_itemsize; /* For allocation */\n" -"\n" -" /* Methods to implement standard operations */\n" -"\n" -" destructor tp_dealloc;\n" -" Py_ssize_t tp_vectorcall_offset;\n" -" getattrfunc tp_getattr;\n" -" setattrfunc tp_setattr;\n" -" PyAsyncMethods *tp_as_async; /* formerly known as tp_compare (Python 2)\n" -" or tp_reserved (Python 3) */\n" -" reprfunc tp_repr;\n" -"\n" -" /* Method suites for standard classes */\n" -"\n" -" PyNumberMethods *tp_as_number;\n" -" PySequenceMethods *tp_as_sequence;\n" -" PyMappingMethods *tp_as_mapping;\n" -"\n" -" /* More standard operations (here for binary compatibility) */\n" -"\n" -" hashfunc tp_hash;\n" -" ternaryfunc tp_call;\n" -" reprfunc tp_str;\n" -" getattrofunc tp_getattro;\n" -" setattrofunc tp_setattro;\n" -"\n" -" /* Functions to access object as input/output buffer */\n" -" PyBufferProcs *tp_as_buffer;\n" -"\n" -" /* Flags to define presence of optional/expanded features */\n" -" unsigned long tp_flags;\n" -"\n" -" const char *tp_doc; /* Documentation string */\n" -"\n" -" /* Assigned meaning in release 2.0 */\n" -" /* call function for all accessible objects */\n" -" traverseproc tp_traverse;\n" -"\n" -" /* delete references to contained objects */\n" -" inquiry tp_clear;\n" -"\n" -" /* Assigned meaning in release 2.1 */\n" -" /* rich comparisons */\n" -" richcmpfunc tp_richcompare;\n" -"\n" -" /* weak reference enabler */\n" -" Py_ssize_t tp_weaklistoffset;\n" -"\n" -" /* Iterators */\n" -" getiterfunc tp_iter;\n" -" iternextfunc tp_iternext;\n" -"\n" -" /* Attribute descriptor and subclassing stuff */\n" -" PyMethodDef *tp_methods;\n" -" PyMemberDef *tp_members;\n" -" PyGetSetDef *tp_getset;\n" -" // Strong reference on a heap type, borrowed reference on a static type\n" -" PyTypeObject *tp_base;\n" -" PyObject *tp_dict;\n" -" descrgetfunc tp_descr_get;\n" -" descrsetfunc tp_descr_set;\n" -" Py_ssize_t tp_dictoffset;\n" -" initproc tp_init;\n" -" allocfunc tp_alloc;\n" -" newfunc tp_new;\n" -" freefunc tp_free; /* Low-level free-memory routine */\n" -" inquiry tp_is_gc; /* For PyObject_IS_GC */\n" -" PyObject *tp_bases;\n" -" PyObject *tp_mro; /* method resolution order */\n" -" PyObject *tp_cache; /* no longer used */\n" -" void *tp_subclasses; /* for static builtin types this is an index */\n" -" PyObject *tp_weaklist; /* not used for static builtin types */\n" -" destructor tp_del;\n" -"\n" -" /* Type attribute cache version tag. Added in version 2.6.\n" -" * If zero, the cache is invalid and must be initialized.\n" -" */\n" -" unsigned int tp_version_tag;\n" -"\n" -" destructor tp_finalize;\n" -" vectorcallfunc tp_vectorcall;\n" -"\n" -" /* bitset of which type-watchers care about this type */\n" -" unsigned char tp_watched;\n" -"\n" -" /* Number of tp_version_tag values used.\n" -" * Set to _Py_ATTR_CACHE_UNUSED if the attribute cache is\n" -" * disabled for this type (e.g. due to custom MRO entries).\n" -" * Otherwise, limited to MAX_VERSIONS_PER_CLASS (defined elsewhere).\n" -" */\n" -" uint16_t tp_versions_used;\n" -"} PyTypeObject;\n" -msgstr "" - -#: ../../c-api/typeobj.rst:486 +#: ../../c-api/typeobj.rst:474 msgid "PyObject Slots" msgstr "PyObject スロット" -#: ../../c-api/typeobj.rst:488 +#: ../../c-api/typeobj.rst:476 msgid "" "The type object structure extends the :c:type:`PyVarObject` structure. The :" -"c:member:`~PyVarObject.ob_size` field is used for dynamic types (created by :" -"c:func:`!type_new`, usually called from a class statement). Note that :c:" -"data:`PyType_Type` (the metatype) initializes :c:member:`~PyTypeObject." +"attr:`ob_size` field is used for dynamic types (created by :func:" +"`type_new`, usually called from a class statement). Note that :c:data:" +"`PyType_Type` (the metatype) initializes :c:member:`~PyTypeObject." "tp_itemsize`, which means that its instances (i.e. type objects) *must* have " -"the :c:member:`~PyVarObject.ob_size` field." +"the :attr:`ob_size` field." msgstr "" +"型オブジェクト構造体は :c:type:`PyVarObject` 構造体を拡張したものです。 :" +"attr:`ob_size` フィールドは、(通常 class 文が呼び出す :func:`type_new` で生成" +"される) 動的な型に使います。 :c:data:`PyType_Type` (メタタイプ) は :c:member:" +"`~PyTypeObject.tp_itemsize` を初期化するので注意してください。すなわち、 イン" +"スタンス (つまり型オブジェクト) には :attr:`ob_size` フィールドが存在しなけれ" +"ば *なりません* 。" -#: ../../c-api/typeobj.rst:497 +#: ../../c-api/typeobj.rst:486 msgid "" -"This is the type object's reference count, initialized to ``1`` by the " -"``PyObject_HEAD_INIT`` macro. Note that for :ref:`statically allocated type " -"objects `, the type's instances (objects whose :c:member:" -"`~PyObject.ob_type` points back to the type) do *not* count as references. " -"But for :ref:`dynamically allocated type objects `, the " -"instances *do* count as references." -msgstr "" - -#: ../../c-api/typeobj.rst:504 ../../c-api/typeobj.rst:527 -#: ../../c-api/typeobj.rst:544 ../../c-api/typeobj.rst:588 -#: ../../c-api/typeobj.rst:666 ../../c-api/typeobj.rst:808 -#: ../../c-api/typeobj.rst:853 ../../c-api/typeobj.rst:870 -#: ../../c-api/typeobj.rst:887 ../../c-api/typeobj.rst:905 -#: ../../c-api/typeobj.rst:929 ../../c-api/typeobj.rst:946 -#: ../../c-api/typeobj.rst:958 ../../c-api/typeobj.rst:970 -#: ../../c-api/typeobj.rst:1003 ../../c-api/typeobj.rst:1025 -#: ../../c-api/typeobj.rst:1045 ../../c-api/typeobj.rst:1066 -#: ../../c-api/typeobj.rst:1092 ../../c-api/typeobj.rst:1111 -#: ../../c-api/typeobj.rst:1127 ../../c-api/typeobj.rst:1167 -#: ../../c-api/typeobj.rst:1178 ../../c-api/typeobj.rst:1188 -#: ../../c-api/typeobj.rst:1198 ../../c-api/typeobj.rst:1212 -#: ../../c-api/typeobj.rst:1230 ../../c-api/typeobj.rst:1253 -#: ../../c-api/typeobj.rst:1271 ../../c-api/typeobj.rst:1284 -#: ../../c-api/typeobj.rst:1306 ../../c-api/typeobj.rst:1350 -#: ../../c-api/typeobj.rst:1371 ../../c-api/typeobj.rst:1390 -#: ../../c-api/typeobj.rst:1420 ../../c-api/typeobj.rst:1442 -#: ../../c-api/typeobj.rst:1468 ../../c-api/typeobj.rst:1559 -#: ../../c-api/typeobj.rst:1703 ../../c-api/typeobj.rst:1768 -#: ../../c-api/typeobj.rst:1804 ../../c-api/typeobj.rst:1829 -#: ../../c-api/typeobj.rst:1852 ../../c-api/typeobj.rst:1865 -#: ../../c-api/typeobj.rst:1880 ../../c-api/typeobj.rst:1894 -#: ../../c-api/typeobj.rst:1924 ../../c-api/typeobj.rst:1956 -#: ../../c-api/typeobj.rst:1982 ../../c-api/typeobj.rst:2000 -#: ../../c-api/typeobj.rst:2029 ../../c-api/typeobj.rst:2073 -#: ../../c-api/typeobj.rst:2090 ../../c-api/typeobj.rst:2130 -#: ../../c-api/typeobj.rst:2153 ../../c-api/typeobj.rst:2191 -#: ../../c-api/typeobj.rst:2219 ../../c-api/typeobj.rst:2232 -#: ../../c-api/typeobj.rst:2242 ../../c-api/typeobj.rst:2259 -#: ../../c-api/typeobj.rst:2276 ../../c-api/typeobj.rst:2290 -#: ../../c-api/typeobj.rst:2432 ../../c-api/typeobj.rst:2490 +"These fields are only present when the macro ``Py_TRACE_REFS`` is defined. " +"Their initialization to ``NULL`` is taken care of by the " +"``PyObject_HEAD_INIT`` macro. For statically allocated objects, these " +"fields always remain ``NULL``. For dynamically allocated objects, these two " +"fields are used to link the object into a doubly-linked list of *all* live " +"objects on the heap. This could be used for various debugging purposes; " +"currently the only use is to print the objects that are still alive at the " +"end of a run when the environment variable :envvar:`PYTHONDUMPREFS` is set." +msgstr "" +"これらのフィールドはマクロ ``Py_TRACE_REFS`` が定義されている場合のみ存在しま" +"す。 ``PyObject_HEAD_INIT`` マクロを使うと、フィールドを ``NULL`` に初期化し" +"ます。静的にメモリ確保されているオブジェクトでは、これらのフィールドは常に " +"``NULL`` のままです。動的にメモリ確保されるオブジェクトの場合、これら二つの" +"フィールドは、ヒープ上の *全ての* 存続中のオブジェクトからなる二重リンクリス" +"トでオブジェクトをリンクする際に使われます。このことは様々なデバッグ目的に利" +"用できます; 現状では、環境変数 :envvar:`PYTHONDUMPREFS` が設定されているとき" +"に、プログラムの実行終了時点で存続しているオブジェクトを出力するのが唯一の用" +"例です。" + +#: ../../c-api/typeobj.rst:495 ../../c-api/typeobj.rst:508 +#: ../../c-api/typeobj.rst:531 ../../c-api/typeobj.rst:544 +#: ../../c-api/typeobj.rst:586 ../../c-api/typeobj.rst:629 +#: ../../c-api/typeobj.rst:675 ../../c-api/typeobj.rst:719 +#: ../../c-api/typeobj.rst:738 ../../c-api/typeobj.rst:755 +#: ../../c-api/typeobj.rst:773 ../../c-api/typeobj.rst:797 +#: ../../c-api/typeobj.rst:814 ../../c-api/typeobj.rst:826 +#: ../../c-api/typeobj.rst:838 ../../c-api/typeobj.rst:871 +#: ../../c-api/typeobj.rst:889 ../../c-api/typeobj.rst:909 +#: ../../c-api/typeobj.rst:930 ../../c-api/typeobj.rst:956 +#: ../../c-api/typeobj.rst:975 ../../c-api/typeobj.rst:991 +#: ../../c-api/typeobj.rst:1028 ../../c-api/typeobj.rst:1039 +#: ../../c-api/typeobj.rst:1049 ../../c-api/typeobj.rst:1059 +#: ../../c-api/typeobj.rst:1073 ../../c-api/typeobj.rst:1092 +#: ../../c-api/typeobj.rst:1115 ../../c-api/typeobj.rst:1162 +#: ../../c-api/typeobj.rst:1177 ../../c-api/typeobj.rst:1245 +#: ../../c-api/typeobj.rst:1312 ../../c-api/typeobj.rst:1371 +#: ../../c-api/typeobj.rst:1401 ../../c-api/typeobj.rst:1433 +#: ../../c-api/typeobj.rst:1456 ../../c-api/typeobj.rst:1469 +#: ../../c-api/typeobj.rst:1484 ../../c-api/typeobj.rst:1498 +#: ../../c-api/typeobj.rst:1528 ../../c-api/typeobj.rst:1548 +#: ../../c-api/typeobj.rst:1574 ../../c-api/typeobj.rst:1592 +#: ../../c-api/typeobj.rst:1632 ../../c-api/typeobj.rst:1683 +#: ../../c-api/typeobj.rst:1700 ../../c-api/typeobj.rst:1738 +#: ../../c-api/typeobj.rst:1759 ../../c-api/typeobj.rst:1791 +#: ../../c-api/typeobj.rst:1808 ../../c-api/typeobj.rst:1819 +#: ../../c-api/typeobj.rst:1829 ../../c-api/typeobj.rst:1838 +#: ../../c-api/typeobj.rst:1848 ../../c-api/typeobj.rst:1862 +#: ../../c-api/typeobj.rst:1900 ../../c-api/typeobj.rst:1917 msgid "**Inheritance:**" msgstr "**継承:**" -#: ../../c-api/typeobj.rst:506 ../../c-api/typeobj.rst:546 -#: ../../c-api/typeobj.rst:590 +#: ../../c-api/typeobj.rst:497 +msgid "These fields are not inherited by subtypes." +msgstr "サブタイプはこのフィールドを継承しません。" + +#: ../../c-api/typeobj.rst:502 +msgid "" +"This is the type object's reference count, initialized to ``1`` by the " +"``PyObject_HEAD_INIT`` macro. Note that for statically allocated type " +"objects, the type's instances (objects whose :attr:`ob_type` points back to " +"the type) do *not* count as references. But for dynamically allocated type " +"objects, the instances *do* count as references." +msgstr "" +"型オブジェクトの参照カウントで、 ``PyObject_HEAD_INIT`` はこの値を ``1`` に初" +"期化します。静的にメモリ確保された型オブジェクトでは、型のインスタンス (:" +"attr:`ob_type` が該当する型を指しているオブジェクト) は参照をカウントする対象" +"には *なりません* 。動的にメモリ確保される型オブジェクトの場合、インスタンス" +"は参照カウントの対象に *なります* 。" + +#: ../../c-api/typeobj.rst:510 ../../c-api/typeobj.rst:546 +#: ../../c-api/typeobj.rst:588 msgid "This field is not inherited by subtypes." msgstr "サブタイプはこのフィールドを継承しません。" -#: ../../c-api/typeobj.rst:511 +#: ../../c-api/typeobj.rst:515 msgid "" "This is the type's type, in other words its metatype. It is initialized by " "the argument to the ``PyObject_HEAD_INIT`` macro, and its value should " @@ -1390,47 +1268,41 @@ msgstr "" "にモジュールの初期化関数で明示的にこのフィールドを初期化することになっていま" "す。この操作は以下のように行います::" -#: ../../c-api/typeobj.rst:520 -msgid "Foo_Type.ob_type = &PyType_Type;" -msgstr "" - -#: ../../c-api/typeobj.rst:522 +#: ../../c-api/typeobj.rst:526 msgid "" "This should be done before any instances of the type are created. :c:func:" -"`PyType_Ready` checks if :c:member:`~PyObject.ob_type` is ``NULL``, and if " -"so, initializes it to the :c:member:`~PyObject.ob_type` field of the base " -"class. :c:func:`PyType_Ready` will not change this field if it is non-zero." -msgstr "" - -#: ../../c-api/typeobj.rst:529 ../../c-api/typeobj.rst:810 -#: ../../c-api/typeobj.rst:931 ../../c-api/typeobj.rst:1027 -#: ../../c-api/typeobj.rst:1047 ../../c-api/typeobj.rst:1831 -#: ../../c-api/typeobj.rst:1854 ../../c-api/typeobj.rst:1984 -#: ../../c-api/typeobj.rst:2002 ../../c-api/typeobj.rst:2075 -#: ../../c-api/typeobj.rst:2193 ../../c-api/typeobj.rst:2434 +"`PyType_Ready` checks if :attr:`ob_type` is ``NULL``, and if so, initializes " +"it to the :attr:`ob_type` field of the base class. :c:func:`PyType_Ready` " +"will not change this field if it is non-zero." +msgstr "" +"上の操作は、該当する型のいかなるインスタンス生成よりも前にしておかなければな" +"りません。 :c:func:`PyType_Ready` は :attr:`ob_type` が ``NULL`` かどうか調" +"べ、 ``NULL`` の場合には基底クラスの :attr:`ob_type` フィールドで初期化しま" +"す。 ob_type フィールドがゼロでない場合、 :c:func:`PyType_Ready` はこのフィー" +"ルドを変更しません。" + +#: ../../c-api/typeobj.rst:533 ../../c-api/typeobj.rst:677 +#: ../../c-api/typeobj.rst:799 ../../c-api/typeobj.rst:891 +#: ../../c-api/typeobj.rst:911 ../../c-api/typeobj.rst:1435 +#: ../../c-api/typeobj.rst:1458 ../../c-api/typeobj.rst:1576 +#: ../../c-api/typeobj.rst:1594 ../../c-api/typeobj.rst:1685 +#: ../../c-api/typeobj.rst:1793 ../../c-api/typeobj.rst:1902 msgid "This field is inherited by subtypes." msgstr "サブタイプはこのフィールドを継承します。" -#: ../../c-api/typeobj.rst:533 +#: ../../c-api/typeobj.rst:537 msgid "PyVarObject Slots" msgstr "PyVarObject スロット" -#: ../../c-api/typeobj.rst:537 -msgid "" -"For :ref:`statically allocated type objects `, this should be " -"initialized to zero. For :ref:`dynamically allocated type objects `, this field has a special internal meaning." -msgstr "" -":ref:`静的にメモリ確保されている型オブジェクト ` の場合、この" -"フィールドはゼロに初期化されます。:ref:`動的にメモリ確保されている型オブジェ" -"クト ` の場合、このフィールドは内部使用される特殊な意味を持ちま" -"す。" - #: ../../c-api/typeobj.rst:541 msgid "" -"This field should be accessed using the :c:func:`Py_SIZE()` and :c:func:" -"`Py_SET_SIZE()` macros." +"For statically allocated type objects, this should be initialized to zero. " +"For dynamically allocated type objects, this field has a special internal " +"meaning." msgstr "" +"静的にメモリ確保されている型オブジェクトの場合、このフィールドはゼロに初期化" +"されます。動的にメモリ確保されている型オブジェクトの場合、このフィールドは内" +"部使用される特殊な意味を持ちます。" #: ../../c-api/typeobj.rst:550 msgid "PyTypeObject Slots" @@ -1440,8 +1312,8 @@ msgstr "PyTypeObject スロット" msgid "" "Each slot has a section describing inheritance. If :c:func:`PyType_Ready` " "may set a value when the field is set to ``NULL`` then there will also be a " -"\"Default\" section. (Note that many fields set on :c:data:" -"`PyBaseObject_Type` and :c:data:`PyType_Type` effectively act as defaults.)" +"\"Default\" section. (Note that many fields set on :c:type:" +"`PyBaseObject_Type` and :c:type:`PyType_Type` effectively act as defaults.)" msgstr "" #: ../../c-api/typeobj.rst:559 @@ -1451,472 +1323,336 @@ msgid "" "module name, followed by a dot, followed by the type name; for built-in " "types, it should be just the type name. If the module is a submodule of a " "package, the full package name is part of the full module name. For " -"example, a type named :class:`!T` defined in module :mod:`!M` in subpackage :" -"mod:`!Q` in package :mod:`!P` should have the :c:member:`~PyTypeObject." +"example, a type named :class:`T` defined in module :mod:`M` in subpackage :" +"mod:`Q` in package :mod:`P` should have the :c:member:`~PyTypeObject." "tp_name` initializer ``\"P.Q.M.T\"``." msgstr "" +"型の名前が入っている NUL 終端された文字列へのポインタです。モジュールのグロー" +"バル変数としてアクセスできる型の場合、この文字列は完全なモジュール名、ドッ" +"ト、そして型の名前と続く文字列になります; 組み込み型の場合、ただの型の名前で" +"す。モジュールがあるパッケージのサブモジュールの場合、完全なパッケージ名が完" +"全なモジュール名の一部になっています。例えば、パッケージ :mod:`P` 内のサブモ" +"ジュール :mod:`Q` に入っているモジュール :mod:`M` 内で定義されている :class:" +"`T` は、 :c:member:`~PyTypeObject.tp_name` を ``\"P.Q.M.T\"`` に初期化しま" +"す。" #: ../../c-api/typeobj.rst:567 msgid "" -"For :ref:`dynamically allocated type objects `, this should just " -"be the type name, and the module name explicitly stored in the type dict as " -"the value for key ``'__module__'``." +"For dynamically allocated type objects, this should just be the type name, " +"and the module name explicitly stored in the type dict as the value for key " +"``'__module__'``." msgstr "" -":ref:`動的にメモリ確保される型オブジェクト ` の場合、このフィール" -"ドは単に型の名前になり、モジュール名は型の辞書内でキー ``'__module__'`` に対" -"する値として明示的に保存されます。" +"動的にメモリ確保される型オブジェクトの場合、このフィールドは単に型の名前にな" +"り、モジュール名は型の辞書内でキー ``'__module__'`` に対する値として明示的に" +"保存されます。" -#: ../../c-api/typeobj.rst:572 +#: ../../c-api/typeobj.rst:571 msgid "" -"For :ref:`statically allocated type objects `, the *tp_name* " -"field should contain a dot. Everything before the last dot is made " -"accessible as the :attr:`~type.__module__` attribute, and everything after " -"the last dot is made accessible as the :attr:`~type.__name__` attribute." +"For statically allocated type objects, the tp_name field should contain a " +"dot. Everything before the last dot is made accessible as the :attr:" +"`__module__` attribute, and everything after the last dot is made accessible " +"as the :attr:`~definition.__name__` attribute." msgstr "" +"静的にメモリ確保される型オブジェクトの場合、 tp_name フィールドにはドットが含" +"まれているはずです。\n" +"最後のドットよりも前にある部分文字列全体は :attr:`__module__` 属性として、ま" +"たドットよりも後ろにある部分は :attr:`~definition.__name__` 属性としてアクセ" +"スできます。" -#: ../../c-api/typeobj.rst:578 +#: ../../c-api/typeobj.rst:576 msgid "" "If no dot is present, the entire :c:member:`~PyTypeObject.tp_name` field is " -"made accessible as the :attr:`~type.__name__` attribute, and the :attr:" -"`~type.__module__` attribute is undefined (unless explicitly set in the " +"made accessible as the :attr:`~definition.__name__` attribute, and the :attr:" +"`__module__` attribute is undefined (unless explicitly set in the " "dictionary, as explained above). This means your type will be impossible to " "pickle. Additionally, it will not be listed in module documentations " "created with pydoc." msgstr "" +"ドットが入っていない場合、 :c:member:`~PyTypeObject.tp_name` フィールドの内容" +"全てが :attr:`~definition.__name__` 属性になり、 :attr:`__module__` 属性は " +"(前述のように型の辞書内で明示的にセットしないかぎり) 未定義になります。\n" +"このため、その型は pickle 化できないことになります。\n" +"さらに、 pydoc が作成するモジュールドキュメントのリストにも載らなくなります。" -#: ../../c-api/typeobj.rst:584 +#: ../../c-api/typeobj.rst:582 msgid "" "This field must not be ``NULL``. It is the only required field in :c:func:" "`PyTypeObject` (other than potentially :c:member:`~PyTypeObject." "tp_itemsize`)." msgstr "" -#: ../../c-api/typeobj.rst:596 +#: ../../c-api/typeobj.rst:594 msgid "" "These fields allow calculating the size in bytes of instances of the type." msgstr "" "これらのフィールドは、型インスタンスのバイトサイズを計算できるようにします。" -#: ../../c-api/typeobj.rst:598 +#: ../../c-api/typeobj.rst:596 msgid "" "There are two kinds of types: types with fixed-length instances have a zero :" -"c:member:`!tp_itemsize` field, types with variable-length instances have a " -"non-zero :c:member:`!tp_itemsize` field. For a type with fixed-length " -"instances, all instances have the same size, given in :c:member:`!" -"tp_basicsize`. (Exceptions to this rule can be made using :c:func:" -"`PyUnstable_Object_GC_NewWithExtraData`.)" -msgstr "" +"c:member:`~PyTypeObject.tp_itemsize` field, types with variable-length " +"instances have a non-zero :c:member:`~PyTypeObject.tp_itemsize` field. For " +"a type with fixed-length instances, all instances have the same size, given " +"in :c:member:`~PyTypeObject.tp_basicsize`." +msgstr "" +"型には二つの種類があります: 固定長インスタンスの型は、 :c:member:" +"`~PyTypeObject.tp_itemsize` フィールドがゼロで、可変長インスタンスの方は :c:" +"member:`~PyTypeObject.tp_itemsize` フィールドが非ゼロの値になります。固定長イ" +"ンスタンスの型の場合、全てのインスタンスは等しく :c:member:`~PyTypeObject." +"tp_basicsize` で与えられたサイズになります。" + +#: ../../c-api/typeobj.rst:601 +msgid "" +"For a type with variable-length instances, the instances must have an :attr:" +"`ob_size` field, and the instance size is :c:member:`~PyTypeObject." +"tp_basicsize` plus N times :c:member:`~PyTypeObject.tp_itemsize`, where N is " +"the \"length\" of the object. The value of N is typically stored in the " +"instance's :attr:`ob_size` field. There are exceptions: for example, ints " +"use a negative :attr:`ob_size` to indicate a negative number, and N is " +"``abs(ob_size)`` there. Also, the presence of an :attr:`ob_size` field in " +"the instance layout doesn't mean that the instance structure is variable-" +"length (for example, the structure for the list type has fixed-length " +"instances, yet those instances have a meaningful :attr:`ob_size` field)." +msgstr "" +"可変長インスタンスの型の場合、インスタンスには :attr:`ob_size` フィールドが" +"なくてはならず、インスタンスのサイズは N をオブジェクトの \"長さ\" として、 :" +"c:member:`~PyTypeObject.tp_basicsize` と :c:member:`~PyTypeObject." +"tp_itemsize` の N 倍を足したものになります。 N の値は通常、インスタンスの :" +"attr:`ob_size` フィールドに記憶されます。ただし例外がいくつかあります: 例え" +"ば、整数では負の値を :attr:`ob_size` に使って、インスタンスの表す値が負である" +"ことを示し、 N 自体は ``abs(ob_size)`` になります。また、 :attr:`ob_size` " +"フィールドがあるからといって、必ずしもインスタンスが可変長であることを意味し" +"ません (例えば、 リスト型の構造体は固定長のインスタンスになるにもかかわらず、" +"インスタンスにはちゃんと意味を持った :attr:`ob_size` フィールドがあります)。" + +#: ../../c-api/typeobj.rst:612 +msgid "" +"The basic size includes the fields in the instance declared by the macro :c:" +"macro:`PyObject_HEAD` or :c:macro:`PyObject_VAR_HEAD` (whichever is used to " +"declare the instance struct) and this in turn includes the :attr:`_ob_prev` " +"and :attr:`_ob_next` fields if they are present. This means that the only " +"correct way to get an initializer for the :c:member:`~PyTypeObject." +"tp_basicsize` is to use the ``sizeof`` operator on the struct used to " +"declare the instance layout. The basic size does not include the GC header " +"size." +msgstr "" +"基本サイズには、 :c:macro:`PyObject_HEAD` マクロまたは :c:macro:" +"`PyObject_VAR_HEAD` マクロ (インスタンス構造体を宣言するのに使ったどちらかの" +"マクロ) で宣言されているフィールドが入っています。さらに、 :attr:`_ob_prev` " +"および :attr:`_ob_next` フィールドがある場合、これらのフィールドもサイズに加" +"算されます。従って、 :c:member:`~PyTypeObject.tp_basicsize` の正しい初期化値" +"を得るには、インスタンスデータのレイアウトを宣言するのに使う構造体に対して " +"``sizeof`` 演算子を使うしかありません。基本サイズには、GC ヘッダサイズは入っ" +"ていません。" -#: ../../c-api/typeobj.rst:605 +#: ../../c-api/typeobj.rst:620 msgid "" -"For a type with variable-length instances, the instances must have an :c:" -"member:`~PyVarObject.ob_size` field, and the instance size is :c:member:`!" -"tp_basicsize` plus N times :c:member:`!tp_itemsize`, where N is the " -"\"length\" of the object." +"A note about alignment: if the variable items require a particular " +"alignment, this should be taken care of by the value of :c:member:" +"`~PyTypeObject.tp_basicsize`. Example: suppose a type implements an array " +"of ``double``. :c:member:`~PyTypeObject.tp_itemsize` is ``sizeof(double)``. " +"It is the programmer's responsibility that :c:member:`~PyTypeObject." +"tp_basicsize` is a multiple of ``sizeof(double)`` (assuming this is the " +"alignment requirement for ``double``)." +msgstr "" +"アラインメントに関する注釈: 変数の各要素を配置する際に特定のアラインメントが" +"必要となる場合、 :c:member:`~PyTypeObject.tp_basicsize` の値に気をつけなけれ" +"ばなりません。例: ある型が ``double`` の配列を実装しているとします。 :c:" +"member:`~PyTypeObject.tp_itemsize` は ``sizeof(double)`` です。 :c:member:" +"`~PyTypeObject.tp_basicsize` が ``sizeof(double)`` (ここではこれを " +"``double`` のアラインメントが要求するサイズと仮定する) の個数分のサイズになる" +"ようにするのはプログラマの責任です。" + +#: ../../c-api/typeobj.rst:627 +msgid "" +"For any type with variable-length instances, this field must not be ``NULL``." +msgstr "" + +#: ../../c-api/typeobj.rst:631 +msgid "" +"These fields are inherited separately by subtypes. If the base type has a " +"non-zero :c:member:`~PyTypeObject.tp_itemsize`, it is generally not safe to " +"set :c:member:`~PyTypeObject.tp_itemsize` to a different non-zero value in a " +"subtype (though this depends on the implementation of the base type)." +msgstr "" +"これらのフィールドはサブタイプに別々に継承されます。基底タイプが 0 でない :c:" +"member:`~PyTypeObject.tp_itemsize` を持っていた場合、基底タイプの実装に依存し" +"ますが、一般的にはサブタイプで別の 0 で無い値を :c:member:`~PyTypeObject." +"tp_itemsize` に設定するのは安全ではありません。" + +#: ../../c-api/typeobj.rst:639 +msgid "" +"A pointer to the instance destructor function. This function must be " +"defined unless the type guarantees that its instances will never be " +"deallocated (as is the case for the singletons ``None`` and ``Ellipsis``). " +"The function signature is::" +msgstr "" +"インスタンスのデストラクタ関数へのポインタです。この関数は (単量子 ``None`` " +"や ``Ellipsis`` の場合のように) インスタンスが決してメモリ解放されない型でな" +"い限り必ず定義しなければなりません。シグネチャは次の通りです::" + +#: ../../c-api/typeobj.rst:645 +msgid "" +"The destructor function is called by the :c:func:`Py_DECREF` and :c:func:" +"`Py_XDECREF` macros when the new reference count is zero. At this point, " +"the instance is still in existence, but there are no references to it. The " +"destructor function should free all references which the instance owns, free " +"all memory buffers owned by the instance (using the freeing function " +"corresponding to the allocation function used to allocate the buffer), and " +"call the type's :c:member:`~PyTypeObject.tp_free` function. If the type is " +"not subtypable (doesn't have the :const:`Py_TPFLAGS_BASETYPE` flag bit set), " +"it is permissible to call the object deallocator directly instead of via :c:" +"member:`~PyTypeObject.tp_free`. The object deallocator should be the one " +"used to allocate the instance; this is normally :c:func:`PyObject_Del` if " +"the instance was allocated using :c:func:`PyObject_New` or :c:func:" +"`PyObject_VarNew`, or :c:func:`PyObject_GC_Del` if the instance was " +"allocated using :c:func:`PyObject_GC_New` or :c:func:`PyObject_GC_NewVar`." +msgstr "" +"デストラクタ関数は、参照カウントが新たにゼロになった際に :c:func:`Py_DECREF` " +"や :c:func:`Py_XDECREF` マクロから呼び出されます。呼び出された時点では、イン" +"スタンスはまだ存在しますが、インスタンスに対する参照は全くない状態です。デス" +"トラクタ関数はインスタンスが保持している全ての参照を解放し、インスタンスが確" +"保している全てのメモリバッファを (バッファの確保時に使った関数に対応するメモ" +"リ解放関数を使って) 解放し、その型の :c:member:`~PyTypeObject.tp_free` 関数" +"を呼び出します。ある型がサブタイプを作成できない (:const:" +"`Py_TPFLAGS_BASETYPE` フラグがセットされていない) 場合、 :c:member:" +"`~PyTypeObject.tp_free` の代わりにオブジェクトのメモリ解放関数 (deallocator) " +"を直接呼び出してもかまいません。オブジェクトのメモリ解放関数は、インスタンス" +"のメモリ確保を行う際に使った関数に対応したものでなければなりません; インスタ" +"ンスを :c:func:`PyObject_New` や :c:func:`PyObject_VarNew` でメモリ 確保した" +"場合には、通常 :c:func:`PyObject_Del` を使い、 :c:func:`PyObject_GC_New` や :" +"c:func:`PyObject_GC_NewVar` で確保した場合には :c:func:`PyObject_GC_Del` を使" +"います。" + +#: ../../c-api/typeobj.rst:660 +msgid "" +"Finally, if the type is heap allocated (:const:`Py_TPFLAGS_HEAPTYPE`), the " +"deallocator should decrement the reference count for its type object after " +"calling the type deallocator. In order to avoid dangling pointers, the " +"recommended way to achieve this is:" msgstr "" -#: ../../c-api/typeobj.rst:610 +#: ../../c-api/typeobj.rst:682 msgid "" -"Functions like :c:func:`PyObject_NewVar` will take the value of N as an " -"argument, and store in the instance's :c:member:`~PyVarObject.ob_size` " -"field. Note that the :c:member:`~PyVarObject.ob_size` field may later be " -"used for other purposes. For example, :py:type:`int` instances use the bits " -"of :c:member:`~PyVarObject.ob_size` in an implementation-defined way; the " -"underlying storage and its size should be accessed using :c:func:" -"`PyLong_Export`." +"An optional offset to a per-instance function that implements calling the " +"object using the :ref:`vectorcall protocol `, a more efficient " +"alternative of the simpler :c:member:`~PyTypeObject.tp_call`." msgstr "" -#: ../../c-api/typeobj.rst:620 +#: ../../c-api/typeobj.rst:687 msgid "" -"The :c:member:`~PyVarObject.ob_size` field should be accessed using the :c:" -"func:`Py_SIZE()` and :c:func:`Py_SET_SIZE()` macros." +"This field is only used if the flag :const:`Py_TPFLAGS_HAVE_VECTORCALL` is " +"set. If so, this must be a positive integer containing the offset in the " +"instance of a :c:type:`vectorcallfunc` pointer." msgstr "" -#: ../../c-api/typeobj.rst:623 +#: ../../c-api/typeobj.rst:691 msgid "" -"Also, the presence of an :c:member:`~PyVarObject.ob_size` field in the " -"instance layout doesn't mean that the instance structure is variable-length. " -"For example, the :py:type:`list` type has fixed-length instances, yet those " -"instances have a :c:member:`~PyVarObject.ob_size` field. (As with :py:type:" -"`int`, avoid reading lists' :c:member:`!ob_size` directly. Call :c:func:" -"`PyList_Size` instead.)" +"The *vectorcallfunc* pointer may be ``NULL``, in which case the instance " +"behaves as if :const:`Py_TPFLAGS_HAVE_VECTORCALL` was not set: calling the " +"instance falls back to :c:member:`~PyTypeObject.tp_call`." msgstr "" -#: ../../c-api/typeobj.rst:630 +#: ../../c-api/typeobj.rst:695 msgid "" -"The :c:member:`!tp_basicsize` includes size needed for data of the type's :c:" -"member:`~PyTypeObject.tp_base`, plus any extra data needed by each instance." +"Any class that sets ``Py_TPFLAGS_HAVE_VECTORCALL`` must also set :c:member:" +"`~PyTypeObject.tp_call` and make sure its behaviour is consistent with the " +"*vectorcallfunc* function. This can be done by setting *tp_call* to :c:func:" +"`PyVectorcall_Call`." msgstr "" -#: ../../c-api/typeobj.rst:634 +#: ../../c-api/typeobj.rst:702 msgid "" -"The correct way to set :c:member:`!tp_basicsize` is to use the ``sizeof`` " -"operator on the struct used to declare the instance layout. This struct must " -"include the struct used to declare the base type. In other words, :c:member:" -"`!tp_basicsize` must be greater than or equal to the base's :c:member:`!" -"tp_basicsize`." +"It is not recommended for :ref:`heap types ` to implement the " +"vectorcall protocol. When a user sets :attr:`__call__` in Python code, only " +"*tp_call* is updated, likely making it inconsistent with the vectorcall " +"function." msgstr "" -#: ../../c-api/typeobj.rst:640 +#: ../../c-api/typeobj.rst:709 msgid "" -"Since every type is a subtype of :py:type:`object`, this struct must " -"include :c:type:`PyObject` or :c:type:`PyVarObject` (depending on whether :c:" -"member:`~PyVarObject.ob_size` should be included). These are usually defined " -"by the macro :c:macro:`PyObject_HEAD` or :c:macro:`PyObject_VAR_HEAD`, " -"respectively." +"The semantics of the ``tp_vectorcall_offset`` slot are provisional and " +"expected to be finalized in Python 3.9. If you use vectorcall, plan for " +"updating your code for Python 3.9." msgstr "" -#: ../../c-api/typeobj.rst:646 +#: ../../c-api/typeobj.rst:715 msgid "" -"The basic size does not include the GC header size, as that header is not " -"part of :c:macro:`PyObject_HEAD`." +"Before version 3.8, this slot was named ``tp_print``. In Python 2.x, it was " +"used for printing to a file. In Python 3.0 to 3.7, it was unused." msgstr "" -#: ../../c-api/typeobj.rst:649 +#: ../../c-api/typeobj.rst:721 msgid "" -"For cases where struct used to declare the base type is unknown, see :c:" -"member:`PyType_Spec.basicsize` and :c:func:`PyType_FromMetaclass`." +"This field is always inherited. However, the :const:" +"`Py_TPFLAGS_HAVE_VECTORCALL` flag is not always inherited. If it's not, then " +"the subclass won't use :ref:`vectorcall `, except when :c:func:" +"`PyVectorcall_Call` is explicitly called. This is in particular the case for " +"`heap types`_ (including subclasses defined in Python)." msgstr "" -#: ../../c-api/typeobj.rst:652 -msgid "Notes about alignment:" -msgstr "" +#: ../../c-api/typeobj.rst:732 +msgid "An optional pointer to the get-attribute-string function." +msgstr "オプションのポインタで、get-attribute-string を行う関数を指します。" -#: ../../c-api/typeobj.rst:654 +#: ../../c-api/typeobj.rst:734 msgid "" -":c:member:`!tp_basicsize` must be a multiple of ``_Alignof(PyObject)``. When " -"using ``sizeof`` on a ``struct`` that includes :c:macro:`PyObject_HEAD`, as " -"recommended, the compiler ensures this. When not using a C ``struct``, or " -"when using compiler extensions like ``__attribute__((packed))``, it is up to " -"you." +"This field is deprecated. When it is defined, it should point to a function " +"that acts the same as the :c:member:`~PyTypeObject.tp_getattro` function, " +"but taking a C string instead of a Python string object to give the " +"attribute name." msgstr "" +"このフィールドは非推奨です。\n" +"このフィールドを定義するときは、 :c:member:`~PyTypeObject.tp_getattro` 関数と" +"同じように動作し、属性名は Python 文字列 オブジェクトではなく C 文字列で指定" +"するような関数を指すようにしなければなりません。" -#: ../../c-api/typeobj.rst:659 -msgid "" -"If the variable items require a particular alignment, :c:member:`!" -"tp_basicsize` and :c:member:`!tp_itemsize` must each be a multiple of that " -"alignment. For example, if a type's variable part stores a ``double``, it is " -"your responsibility that both fields are a multiple of ``_Alignof(double)``." +#: ../../c-api/typeobj.rst:740 ../../c-api/typeobj.rst:932 +msgid "Group: :attr:`tp_getattr`, :attr:`tp_getattro`" msgstr "" -#: ../../c-api/typeobj.rst:668 +#: ../../c-api/typeobj.rst:742 msgid "" -"These fields are inherited separately by subtypes. (That is, if the field is " -"set to zero, :c:func:`PyType_Ready` will copy the value from the base type, " -"indicating that the instances do not need additional storage.)" +"This field is inherited by subtypes together with :c:member:`~PyTypeObject." +"tp_getattro`: a subtype inherits both :c:member:`~PyTypeObject.tp_getattr` " +"and :c:member:`~PyTypeObject.tp_getattro` from its base type when the " +"subtype's :c:member:`~PyTypeObject.tp_getattr` and :c:member:`~PyTypeObject." +"tp_getattro` are both ``NULL``." msgstr "" +"このフィールドは :c:member:`~PyTypeObject.tp_getattro` と共にサブタイプに継承" +"されます: すなわち、サブタイプの :c:member:`~PyTypeObject.tp_getattr` およ" +"び :c:member:`~PyTypeObject.tp_getattro` が共に ``NULL`` の場合、サブタイプは" +"基底タイプから :c:member:`~PyTypeObject.tp_getattr` と :c:member:" +"`~PyTypeObject.tp_getattro` を両方とも継承します。" -#: ../../c-api/typeobj.rst:673 +#: ../../c-api/typeobj.rst:749 ../../c-api/typeobj.rst:945 msgid "" -"If the base type has a non-zero :c:member:`~PyTypeObject.tp_itemsize`, it is " -"generally not safe to set :c:member:`~PyTypeObject.tp_itemsize` to a " -"different non-zero value in a subtype (though this depends on the " -"implementation of the base type)." -msgstr "" +"An optional pointer to the function for setting and deleting attributes." +msgstr "オプションのポインタで、属性の設定と削除を行う関数を指します。" -#: ../../c-api/typeobj.rst:680 +#: ../../c-api/typeobj.rst:751 msgid "" -"A pointer to the instance destructor function. The function signature is::" -msgstr "" - -#: ../../c-api/typeobj.rst:682 -msgid "void tp_dealloc(PyObject *self);" +"This field is deprecated. When it is defined, it should point to a function " +"that acts the same as the :c:member:`~PyTypeObject.tp_setattro` function, " +"but taking a C string instead of a Python string object to give the " +"attribute name." msgstr "" +"このフィールドは非推奨です。\n" +"このフィールドを定義するときは、 :c:member:`~PyTypeObject.tp_setattro` 関数と" +"同じように動作し、属性名は Python 文字列 オブジェクトではなく C 文字列で指定" +"するような関数を指すようにしなければなりません。" -#: ../../c-api/typeobj.rst:684 -msgid "" -"The destructor function should remove all references which the instance owns " -"(e.g., call :c:func:`Py_CLEAR`), free all memory buffers owned by the " -"instance, and call the type's :c:member:`~PyTypeObject.tp_free` function to " -"free the object itself." +#: ../../c-api/typeobj.rst:757 ../../c-api/typeobj.rst:958 +msgid "Group: :attr:`tp_setattr`, :attr:`tp_setattro`" msgstr "" -#: ../../c-api/typeobj.rst:689 +#: ../../c-api/typeobj.rst:759 msgid "" -"If you may call functions that may set the error indicator, you must use :c:" -"func:`PyErr_GetRaisedException` and :c:func:`PyErr_SetRaisedException` to " -"ensure you don't clobber a preexisting error indicator (the deallocation " -"could have occurred while processing a different error):" -msgstr "" - -#: ../../c-api/typeobj.rst:694 -msgid "" -"static void\n" -"foo_dealloc(foo_object *self)\n" -"{\n" -" PyObject *et, *ev, *etb;\n" -" PyObject *exc = PyErr_GetRaisedException();\n" -" ...\n" -" PyErr_SetRaisedException(exc);\n" -"}" -msgstr "" - -#: ../../c-api/typeobj.rst:705 -msgid "" -"The dealloc handler itself must not raise an exception; if it hits an error " -"case it should call :c:func:`PyErr_FormatUnraisable` to log (and clear) an " -"unraisable exception." -msgstr "" - -#: ../../c-api/typeobj.rst:709 -msgid "No guarantees are made about when an object is destroyed, except:" -msgstr "" - -#: ../../c-api/typeobj.rst:711 -msgid "" -"Python will destroy an object immediately or some time after the final " -"reference to the object is deleted, unless its finalizer (:c:member:" -"`~PyTypeObject.tp_finalize`) subsequently resurrects the object." -msgstr "" - -#: ../../c-api/typeobj.rst:715 -msgid "" -"An object will not be destroyed while it is being automatically finalized (:" -"c:member:`~PyTypeObject.tp_finalize`) or automatically cleared (:c:member:" -"`~PyTypeObject.tp_clear`)." -msgstr "" - -#: ../../c-api/typeobj.rst:719 -msgid "" -"CPython currently destroys an object immediately from :c:func:`Py_DECREF` " -"when the new reference count is zero, but this may change in a future " -"version." -msgstr "" - -#: ../../c-api/typeobj.rst:723 -msgid "" -"It is recommended to call :c:func:`PyObject_CallFinalizerFromDealloc` at the " -"beginning of :c:member:`!tp_dealloc` to guarantee that the object is always " -"finalized before destruction." -msgstr "" - -#: ../../c-api/typeobj.rst:727 -msgid "" -"If the type supports garbage collection (the :c:macro:`Py_TPFLAGS_HAVE_GC` " -"flag is set), the destructor should call :c:func:`PyObject_GC_UnTrack` " -"before clearing any member fields." -msgstr "" - -#: ../../c-api/typeobj.rst:731 -msgid "" -"It is permissible to call :c:member:`~PyTypeObject.tp_clear` from :c:member:" -"`!tp_dealloc` to reduce code duplication and to guarantee that the object is " -"always cleared before destruction. Beware that :c:member:`!tp_clear` might " -"have already been called." -msgstr "" - -#: ../../c-api/typeobj.rst:736 -msgid "" -"If the type is heap allocated (:c:macro:`Py_TPFLAGS_HEAPTYPE`), the " -"deallocator should release the owned reference to its type object (via :c:" -"func:`Py_DECREF`) after calling the type deallocator. See the example code " -"below.::" -msgstr "" - -#: ../../c-api/typeobj.rst:741 -msgid "" -"static void\n" -"foo_dealloc(PyObject *op)\n" -"{\n" -" foo_object *self = (foo_object *) op;\n" -" PyObject_GC_UnTrack(self);\n" -" Py_CLEAR(self->ref);\n" -" Py_TYPE(self)->tp_free(self);\n" -"}" -msgstr "" - -#: ../../c-api/typeobj.rst:750 -msgid "" -":c:member:`!tp_dealloc` must leave the exception status unchanged. If it " -"needs to call something that might raise an exception, the exception state " -"must be backed up first and restored later (after logging any exceptions " -"with :c:func:`PyErr_WriteUnraisable`)." -msgstr "" - -#: ../../c-api/typeobj.rst:755 -msgid "Example::" -msgstr "以下はプログラム例です::" - -#: ../../c-api/typeobj.rst:757 -msgid "" -"static void\n" -"foo_dealloc(PyObject *self)\n" -"{\n" -" PyObject *exc = PyErr_GetRaisedException();\n" -"\n" -" if (PyObject_CallFinalizerFromDealloc(self) < 0) {\n" -" // self was resurrected.\n" -" goto done;\n" -" }\n" -"\n" -" PyTypeObject *tp = Py_TYPE(self);\n" -"\n" -" if (tp->tp_flags & Py_TPFLAGS_HAVE_GC) {\n" -" PyObject_GC_UnTrack(self);\n" -" }\n" -"\n" -" // Optional, but convenient to avoid code duplication.\n" -" if (tp->tp_clear && tp->tp_clear(self) < 0) {\n" -" PyErr_WriteUnraisable(self);\n" -" }\n" -"\n" -" // Any additional destruction goes here.\n" -"\n" -" tp->tp_free(self);\n" -" self = NULL; // In case PyErr_WriteUnraisable() is called below.\n" -"\n" -" if (tp->tp_flags & Py_TPFLAGS_HEAPTYPE) {\n" -" Py_CLEAR(tp);\n" -" }\n" -"\n" -"done:\n" -" // Optional, if something was called that might have raised an\n" -" // exception.\n" -" if (PyErr_Occurred()) {\n" -" PyErr_WriteUnraisable(self);\n" -" }\n" -" PyErr_SetRaisedException(exc);\n" -"}" -msgstr "" - -#: ../../c-api/typeobj.rst:796 -msgid "" -":c:member:`!tp_dealloc` may be called from any Python thread, not just the " -"thread which created the object (if the object becomes part of a refcount " -"cycle, that cycle might be collected by a garbage collection on any " -"thread). This is not a problem for Python API calls, since the thread on " -"which :c:member:`!tp_dealloc` is called with an :term:`attached thread " -"state`. However, if the object being destroyed in turn destroys objects " -"from some other C library, care should be taken to ensure that destroying " -"those objects on the thread which called :c:member:`!tp_dealloc` will not " -"violate any assumptions of the library." -msgstr "" - -#: ../../c-api/typeobj.rst:814 ../../c-api/typeobj.rst:1714 -#: ../../c-api/typeobj.rst:2447 -msgid "" -":ref:`life-cycle` for details about how this slot relates to other slots." -msgstr "" - -#: ../../c-api/typeobj.rst:819 -msgid "" -"An optional offset to a per-instance function that implements calling the " -"object using the :ref:`vectorcall protocol `, a more efficient " -"alternative of the simpler :c:member:`~PyTypeObject.tp_call`." -msgstr "" - -#: ../../c-api/typeobj.rst:824 -msgid "" -"This field is only used if the flag :c:macro:`Py_TPFLAGS_HAVE_VECTORCALL` is " -"set. If so, this must be a positive integer containing the offset in the " -"instance of a :c:type:`vectorcallfunc` pointer." -msgstr "" - -#: ../../c-api/typeobj.rst:828 -msgid "" -"The *vectorcallfunc* pointer may be ``NULL``, in which case the instance " -"behaves as if :c:macro:`Py_TPFLAGS_HAVE_VECTORCALL` was not set: calling the " -"instance falls back to :c:member:`~PyTypeObject.tp_call`." -msgstr "" - -#: ../../c-api/typeobj.rst:832 -msgid "" -"Any class that sets ``Py_TPFLAGS_HAVE_VECTORCALL`` must also set :c:member:" -"`~PyTypeObject.tp_call` and make sure its behaviour is consistent with the " -"*vectorcallfunc* function. This can be done by setting *tp_call* to :c:func:" -"`PyVectorcall_Call`." -msgstr "" - -#: ../../c-api/typeobj.rst:839 -msgid "" -"Before version 3.8, this slot was named ``tp_print``. In Python 2.x, it was " -"used for printing to a file. In Python 3.0 to 3.7, it was unused." -msgstr "" - -#: ../../c-api/typeobj.rst:845 -msgid "" -"Before version 3.12, it was not recommended for :ref:`mutable heap types " -"` to implement the vectorcall protocol. When a user sets :attr:" -"`~object.__call__` in Python code, only *tp_call* is updated, likely making " -"it inconsistent with the vectorcall function. Since 3.12, setting " -"``__call__`` will disable vectorcall optimization by clearing the :c:macro:" -"`Py_TPFLAGS_HAVE_VECTORCALL` flag." -msgstr "" - -#: ../../c-api/typeobj.rst:855 -msgid "" -"This field is always inherited. However, the :c:macro:" -"`Py_TPFLAGS_HAVE_VECTORCALL` flag is not always inherited. If it's not set, " -"then the subclass won't use :ref:`vectorcall `, except when :c:" -"func:`PyVectorcall_Call` is explicitly called." -msgstr "" - -#: ../../c-api/typeobj.rst:864 -msgid "An optional pointer to the get-attribute-string function." -msgstr "オプションのポインタで、get-attribute-string を行う関数を指します。" - -#: ../../c-api/typeobj.rst:866 -msgid "" -"This field is deprecated. When it is defined, it should point to a function " -"that acts the same as the :c:member:`~PyTypeObject.tp_getattro` function, " -"but taking a C string instead of a Python string object to give the " -"attribute name." -msgstr "" -"このフィールドは非推奨です。\n" -"このフィールドを定義するときは、 :c:member:`~PyTypeObject.tp_getattro` 関数と" -"同じように動作し、属性名は Python 文字列 オブジェクトではなく C 文字列で指定" -"するような関数を指すようにしなければなりません。" - -#: ../../c-api/typeobj.rst:872 ../../c-api/typeobj.rst:1068 -msgid "" -"Group: :c:member:`~PyTypeObject.tp_getattr`, :c:member:`~PyTypeObject." -"tp_getattro`" -msgstr "" - -#: ../../c-api/typeobj.rst:874 -msgid "" -"This field is inherited by subtypes together with :c:member:`~PyTypeObject." -"tp_getattro`: a subtype inherits both :c:member:`~PyTypeObject.tp_getattr` " -"and :c:member:`~PyTypeObject.tp_getattro` from its base type when the " -"subtype's :c:member:`~PyTypeObject.tp_getattr` and :c:member:`~PyTypeObject." -"tp_getattro` are both ``NULL``." -msgstr "" -"このフィールドは :c:member:`~PyTypeObject.tp_getattro` と共にサブタイプに継承" -"されます: すなわち、サブタイプの :c:member:`~PyTypeObject.tp_getattr` およ" -"び :c:member:`~PyTypeObject.tp_getattro` が共に ``NULL`` の場合、サブタイプは" -"基底タイプから :c:member:`~PyTypeObject.tp_getattr` と :c:member:" -"`~PyTypeObject.tp_getattro` を両方とも継承します。" - -#: ../../c-api/typeobj.rst:881 ../../c-api/typeobj.rst:1081 -msgid "" -"An optional pointer to the function for setting and deleting attributes." -msgstr "オプションのポインタで、属性の設定と削除を行う関数を指します。" - -#: ../../c-api/typeobj.rst:883 -msgid "" -"This field is deprecated. When it is defined, it should point to a function " -"that acts the same as the :c:member:`~PyTypeObject.tp_setattro` function, " -"but taking a C string instead of a Python string object to give the " -"attribute name." -msgstr "" -"このフィールドは非推奨です。\n" -"このフィールドを定義するときは、 :c:member:`~PyTypeObject.tp_setattro` 関数と" -"同じように動作し、属性名は Python 文字列 オブジェクトではなく C 文字列で指定" -"するような関数を指すようにしなければなりません。" - -#: ../../c-api/typeobj.rst:889 ../../c-api/typeobj.rst:1094 -msgid "" -"Group: :c:member:`~PyTypeObject.tp_setattr`, :c:member:`~PyTypeObject." -"tp_setattro`" -msgstr "" - -#: ../../c-api/typeobj.rst:891 -msgid "" -"This field is inherited by subtypes together with :c:member:`~PyTypeObject." -"tp_setattro`: a subtype inherits both :c:member:`~PyTypeObject.tp_setattr` " -"and :c:member:`~PyTypeObject.tp_setattro` from its base type when the " -"subtype's :c:member:`~PyTypeObject.tp_setattr` and :c:member:`~PyTypeObject." -"tp_setattro` are both ``NULL``." +"This field is inherited by subtypes together with :c:member:`~PyTypeObject." +"tp_setattro`: a subtype inherits both :c:member:`~PyTypeObject.tp_setattr` " +"and :c:member:`~PyTypeObject.tp_setattro` from its base type when the " +"subtype's :c:member:`~PyTypeObject.tp_setattr` and :c:member:`~PyTypeObject." +"tp_setattro` are both ``NULL``." msgstr "" "このフィールドは :c:member:`~PyTypeObject.tp_setattro` と共にサブタイプに継承" "されます: すなわち、サブタイプの :c:member:`~PyTypeObject.tp_setattr` およ" @@ -1924,7 +1660,7 @@ msgstr "" "基底タイプから :c:member:`~PyTypeObject.tp_setattr` と :c:member:" "`~PyTypeObject.tp_setattro` を両方とも継承します。" -#: ../../c-api/typeobj.rst:898 +#: ../../c-api/typeobj.rst:766 msgid "" "Pointer to an additional structure that contains fields relevant only to " "objects which implement :term:`awaitable` and :term:`asynchronous iterator` " @@ -1936,11 +1672,11 @@ msgstr "" "す。\n" "詳しいことは :ref:`async-structs` を参照してください。" -#: ../../c-api/typeobj.rst:902 +#: ../../c-api/typeobj.rst:770 msgid "Formerly known as ``tp_compare`` and ``tp_reserved``." msgstr "以前は ``tp_compare`` や ``tp_reserved`` として知られていました。" -#: ../../c-api/typeobj.rst:907 +#: ../../c-api/typeobj.rst:775 msgid "" "The :c:member:`~PyTypeObject.tp_as_async` field is not inherited, but the " "contained fields are inherited individually." @@ -1948,7 +1684,7 @@ msgstr "" ":c:member:`~PyTypeObject.tp_as_async` フィールドは継承されませんが、これに含" "まれるフィールドが個別に継承されます。" -#: ../../c-api/typeobj.rst:915 +#: ../../c-api/typeobj.rst:783 msgid "" "An optional pointer to a function that implements the built-in function :" "func:`repr`." @@ -1956,15 +1692,11 @@ msgstr "" "オプションのポインタで、組み込み関数 :func:`repr` を実装している関数を指しま" "す。" -#: ../../c-api/typeobj.rst:918 +#: ../../c-api/typeobj.rst:786 msgid "The signature is the same as for :c:func:`PyObject_Repr`::" msgstr "" -#: ../../c-api/typeobj.rst:920 -msgid "PyObject *tp_repr(PyObject *self);" -msgstr "" - -#: ../../c-api/typeobj.rst:922 +#: ../../c-api/typeobj.rst:790 msgid "" "The function must return a string or a Unicode object. Ideally, this " "function should return a string that, when passed to :func:`eval`, given a " @@ -1978,18 +1710,17 @@ msgstr "" "には、オブジェクトの型と値から導出した内容の入った ``'<'`` から始まって " "``'>'`` で終わる文字列を返さなければなりません。" -#: ../../c-api/typeobj.rst:933 ../../c-api/typeobj.rst:1012 -#: ../../c-api/typeobj.rst:1049 ../../c-api/typeobj.rst:1074 -#: ../../c-api/typeobj.rst:1100 ../../c-api/typeobj.rst:1142 -#: ../../c-api/typeobj.rst:1777 ../../c-api/typeobj.rst:1811 -#: ../../c-api/typeobj.rst:1928 ../../c-api/typeobj.rst:1961 -#: ../../c-api/typeobj.rst:2036 ../../c-api/typeobj.rst:2077 -#: ../../c-api/typeobj.rst:2097 ../../c-api/typeobj.rst:2136 -#: ../../c-api/typeobj.rst:2164 ../../c-api/typeobj.rst:2195 +#: ../../c-api/typeobj.rst:801 ../../c-api/typeobj.rst:913 +#: ../../c-api/typeobj.rst:938 ../../c-api/typeobj.rst:964 +#: ../../c-api/typeobj.rst:1006 ../../c-api/typeobj.rst:1380 +#: ../../c-api/typeobj.rst:1532 ../../c-api/typeobj.rst:1553 +#: ../../c-api/typeobj.rst:1651 ../../c-api/typeobj.rst:1687 +#: ../../c-api/typeobj.rst:1705 ../../c-api/typeobj.rst:1743 +#: ../../c-api/typeobj.rst:1764 ../../c-api/typeobj.rst:1795 msgid "**Default:**" msgstr "**デフォルト**" -#: ../../c-api/typeobj.rst:935 +#: ../../c-api/typeobj.rst:803 msgid "" "When this field is not set, a string of the form ``<%s object at %p>`` is " "returned, where ``%s`` is replaced by the type name, and ``%p`` by the " @@ -1999,7 +1730,7 @@ msgstr "" "列が返されます。 ``%s`` は型の名前に、 ``%p`` はオブジェクトのメモリアドレス" "に置き換えられます。" -#: ../../c-api/typeobj.rst:942 +#: ../../c-api/typeobj.rst:810 msgid "" "Pointer to an additional structure that contains fields relevant only to " "objects which implement the number protocol. These fields are documented " @@ -2008,7 +1739,7 @@ msgstr "" "数値プロトコルを実装した追加の構造体を指すポインタです。これらのフィールドに" "ついては :ref:`number-structs` で説明されています。" -#: ../../c-api/typeobj.rst:948 +#: ../../c-api/typeobj.rst:816 msgid "" "The :c:member:`~PyTypeObject.tp_as_number` field is not inherited, but the " "contained fields are inherited individually." @@ -2016,7 +1747,7 @@ msgstr "" ":c:member:`~PyTypeObject.tp_as_number` フィールドは継承されませんが、そこの含" "まれるフィールドが個別に継承されます。" -#: ../../c-api/typeobj.rst:954 +#: ../../c-api/typeobj.rst:822 msgid "" "Pointer to an additional structure that contains fields relevant only to " "objects which implement the sequence protocol. These fields are documented " @@ -2025,7 +1756,7 @@ msgstr "" "シーケンスプロトコルを実装した追加の構造体を指すポインタです。これらのフィー" "ルドについては :ref:`sequence-structs` で説明されています。" -#: ../../c-api/typeobj.rst:960 +#: ../../c-api/typeobj.rst:828 msgid "" "The :c:member:`~PyTypeObject.tp_as_sequence` field is not inherited, but the " "contained fields are inherited individually." @@ -2033,7 +1764,7 @@ msgstr "" ":c:member:`~PyTypeObject.tp_as_sequence` フィールドは継承されませんが、これに" "含まれるフィールドが個別に継承されます。" -#: ../../c-api/typeobj.rst:966 +#: ../../c-api/typeobj.rst:834 msgid "" "Pointer to an additional structure that contains fields relevant only to " "objects which implement the mapping protocol. These fields are documented " @@ -2042,7 +1773,7 @@ msgstr "" "マッピングプロトコルを実装した追加の構造体を指すポインタです。これらのフィー" "ルドについては :ref:`mapping-structs` で説明されています。" -#: ../../c-api/typeobj.rst:972 +#: ../../c-api/typeobj.rst:840 msgid "" "The :c:member:`~PyTypeObject.tp_as_mapping` field is not inherited, but the " "contained fields are inherited individually." @@ -2050,7 +1781,7 @@ msgstr "" ":c:member:`~PyTypeObject.tp_as_mapping` フィールドは継承されませんが、これに" "含まれるフィールドが個別に継承されます。" -#: ../../c-api/typeobj.rst:980 +#: ../../c-api/typeobj.rst:848 msgid "" "An optional pointer to a function that implements the built-in function :" "func:`hash`." @@ -2058,32 +1789,28 @@ msgstr "" "オプションのポインタで、組み込み関数 :func:`hash` を実装している関数を指しま" "す。" -#: ../../c-api/typeobj.rst:983 +#: ../../c-api/typeobj.rst:851 msgid "The signature is the same as for :c:func:`PyObject_Hash`::" msgstr "" -#: ../../c-api/typeobj.rst:985 -msgid "Py_hash_t tp_hash(PyObject *);" -msgstr "" - -#: ../../c-api/typeobj.rst:987 +#: ../../c-api/typeobj.rst:855 msgid "" "The value ``-1`` should not be returned as a normal return value; when an " "error occurs during the computation of the hash value, the function should " "set an exception and return ``-1``." msgstr "" -"通常時には ``-1`` を戻り値にしてはなりません; ハッシュ値の計算中にエラーが生" -"じた場合、関数は例外をセットして ``-1`` を返さねばなりません。" +"この関数は C の :c:type:`long` 型の値を返さねばなりません。通常時には ``-1`` " +"を戻り値にしてはなりません; ハッシュ値の計算中にエラーが生じた場合、関数は例" +"外をセットして ``-1`` を返さねばなりません。" -#: ../../c-api/typeobj.rst:991 +#: ../../c-api/typeobj.rst:859 msgid "" -"When this field is not set (*and* :c:member:`~PyTypeObject.tp_richcompare` " -"is not set), an attempt to take the hash of the object raises :exc:" -"`TypeError`. This is the same as setting it to :c:func:" -"`PyObject_HashNotImplemented`." +"When this field is not set (*and* :attr:`tp_richcompare` is not set), an " +"attempt to take the hash of the object raises :exc:`TypeError`. This is the " +"same as setting it to :c:func:`PyObject_HashNotImplemented`." msgstr "" -#: ../../c-api/typeobj.rst:995 +#: ../../c-api/typeobj.rst:863 msgid "" "This field can be set explicitly to :c:func:`PyObject_HashNotImplemented` to " "block inheritance of the hash method from a parent type. This is interpreted " @@ -2101,13 +1828,11 @@ msgstr "" "ことで ``tp_hash`` スロットは :c:func:`PyObject_HashNotImplemented` に設定さ" "れます。" -#: ../../c-api/typeobj.rst:1005 ../../c-api/typeobj.rst:1770 -msgid "" -"Group: :c:member:`~PyTypeObject.tp_hash`, :c:member:`~PyTypeObject." -"tp_richcompare`" +#: ../../c-api/typeobj.rst:873 ../../c-api/typeobj.rst:1373 +msgid "Group: :attr:`tp_hash`, :attr:`tp_richcompare`" msgstr "" -#: ../../c-api/typeobj.rst:1007 +#: ../../c-api/typeobj.rst:875 msgid "" "This field is inherited by subtypes together with :c:member:`~PyTypeObject." "tp_richcompare`: a subtype inherits both of :c:member:`~PyTypeObject." @@ -2121,11 +1846,7 @@ msgstr "" "のとき、サブタイプは基底タイプから :c:member:`~PyTypeObject.tp_richcompare` " "と :c:member:`~PyTypeObject.tp_hash` を両方とも継承します。" -#: ../../c-api/typeobj.rst:1014 -msgid ":c:data:`PyBaseObject_Type` uses :c:func:`PyObject_GenericHash`." -msgstr "" - -#: ../../c-api/typeobj.rst:1019 +#: ../../c-api/typeobj.rst:883 msgid "" "An optional pointer to a function that implements calling the object. This " "should be ``NULL`` if the object is not callable. The signature is the same " @@ -2135,11 +1856,7 @@ msgstr "" "オブジェクトが呼び出し可能でない場合には ``NULL`` にしなければなりません。シ" "グネチャは :c:func:`PyObject_Call` と同じです。" -#: ../../c-api/typeobj.rst:1023 -msgid "PyObject *tp_call(PyObject *self, PyObject *args, PyObject *kwargs);" -msgstr "" - -#: ../../c-api/typeobj.rst:1032 +#: ../../c-api/typeobj.rst:896 msgid "" "An optional pointer to a function that implements the built-in operation :" "func:`str`. (Note that :class:`str` is a type now, and :func:`str` calls " @@ -2153,15 +1870,11 @@ msgstr "" "行う上で :c:func:`PyObject_Str` を呼び出し、さらに :c:func:`PyObject_Str` が" "このハンドラを呼び出すことになります。)" -#: ../../c-api/typeobj.rst:1037 +#: ../../c-api/typeobj.rst:901 msgid "The signature is the same as for :c:func:`PyObject_Str`::" msgstr "" -#: ../../c-api/typeobj.rst:1039 -msgid "PyObject *tp_str(PyObject *self);" -msgstr "" - -#: ../../c-api/typeobj.rst:1041 +#: ../../c-api/typeobj.rst:905 msgid "" "The function must return a string or a Unicode object. It should be a " "\"friendly\" string representation of the object, as this is the " @@ -2173,7 +1886,7 @@ msgstr "" "ません。というのは、この文字列はとりわけ :func:`print` 関数で使われることにな" "る表記だからです。" -#: ../../c-api/typeobj.rst:1051 +#: ../../c-api/typeobj.rst:915 msgid "" "When this field is not set, :c:func:`PyObject_Repr` is called to return a " "string representation." @@ -2181,19 +1894,15 @@ msgstr "" "このフィールドが設定されていない場合、文字列表現を返すためには :c:func:" "`PyObject_Repr` が呼び出されます。" -#: ../../c-api/typeobj.rst:1057 +#: ../../c-api/typeobj.rst:921 msgid "An optional pointer to the get-attribute function." msgstr "オプションのポインタで、get-attribute を実装している関数を指します。" -#: ../../c-api/typeobj.rst:1059 +#: ../../c-api/typeobj.rst:923 msgid "The signature is the same as for :c:func:`PyObject_GetAttr`::" msgstr "" -#: ../../c-api/typeobj.rst:1061 -msgid "PyObject *tp_getattro(PyObject *self, PyObject *attr);" -msgstr "" - -#: ../../c-api/typeobj.rst:1063 +#: ../../c-api/typeobj.rst:927 msgid "" "It is usually convenient to set this field to :c:func:" "`PyObject_GenericGetAttr`, which implements the normal way of looking for " @@ -2202,7 +1911,7 @@ msgstr "" "通常の属性検索を実装している :c:func:`PyObject_GenericGetAttr` をこのフィー" "ルドに設定しておくとたいていの場合は便利です。" -#: ../../c-api/typeobj.rst:1070 +#: ../../c-api/typeobj.rst:934 msgid "" "This field is inherited by subtypes together with :c:member:`~PyTypeObject." "tp_getattr`: a subtype inherits both :c:member:`~PyTypeObject.tp_getattr` " @@ -2216,19 +1925,15 @@ msgstr "" "基底タイプから :c:member:`~PyTypeObject.tp_getattr` と :c:member:" "`~PyTypeObject.tp_getattro` を両方とも継承します。" -#: ../../c-api/typeobj.rst:1076 -msgid ":c:data:`PyBaseObject_Type` uses :c:func:`PyObject_GenericGetAttr`." +#: ../../c-api/typeobj.rst:940 +msgid ":c:type:`PyBaseObject_Type` uses :c:func:`PyObject_GenericGetAttr`." msgstr "" -#: ../../c-api/typeobj.rst:1083 +#: ../../c-api/typeobj.rst:947 msgid "The signature is the same as for :c:func:`PyObject_SetAttr`::" msgstr "" -#: ../../c-api/typeobj.rst:1085 -msgid "int tp_setattro(PyObject *self, PyObject *attr, PyObject *value);" -msgstr "" - -#: ../../c-api/typeobj.rst:1087 +#: ../../c-api/typeobj.rst:951 msgid "" "In addition, setting *value* to ``NULL`` to delete an attribute must be " "supported. It is usually convenient to set this field to :c:func:" @@ -2240,7 +1945,7 @@ msgstr "" "通常のオブジェクト属性設定を実装している :c:func:`PyObject_GenericSetAttr` " "をこのフィールドに設定しておくとたいていの場合は便利です。" -#: ../../c-api/typeobj.rst:1096 +#: ../../c-api/typeobj.rst:960 msgid "" "This field is inherited by subtypes together with :c:member:`~PyTypeObject." "tp_setattr`: a subtype inherits both :c:member:`~PyTypeObject.tp_setattr` " @@ -2254,11 +1959,11 @@ msgstr "" "基底タイプから :c:member:`~PyTypeObject.tp_setattr` と :c:member:" "`~PyTypeObject.tp_setattro` を両方とも継承します。" -#: ../../c-api/typeobj.rst:1102 -msgid ":c:data:`PyBaseObject_Type` uses :c:func:`PyObject_GenericSetAttr`." +#: ../../c-api/typeobj.rst:966 +msgid ":c:type:`PyBaseObject_Type` uses :c:func:`PyObject_GenericSetAttr`." msgstr "" -#: ../../c-api/typeobj.rst:1107 +#: ../../c-api/typeobj.rst:971 msgid "" "Pointer to an additional structure that contains fields relevant only to " "objects which implement the buffer interface. These fields are documented " @@ -2268,7 +1973,7 @@ msgstr "" "フィールド群が入った別の構造体を指すポインタです。構造体内の各フィールドは :" "ref:`buffer-structs` で説明します。" -#: ../../c-api/typeobj.rst:1113 +#: ../../c-api/typeobj.rst:977 msgid "" "The :c:member:`~PyTypeObject.tp_as_buffer` field is not inherited, but the " "contained fields are inherited individually." @@ -2276,7 +1981,7 @@ msgstr "" ":c:member:`~PyTypeObject.tp_as_buffer` フィールド自体は継承されませんが、これ" "に含まれるフィールドは個別に継承されます。" -#: ../../c-api/typeobj.rst:1119 +#: ../../c-api/typeobj.rst:983 msgid "" "This field is a bit mask of various flags. Some flags indicate variant " "semantics for certain situations; others are used to indicate that certain " @@ -2297,32 +2002,43 @@ msgstr "" "がクリアされていれば、フラグが保護しているフィールドにはアクセスしない代わり" "に、その値はゼロか ``NULL`` になっているとみなさなければなりません。" -#: ../../c-api/typeobj.rst:1129 +#: ../../c-api/typeobj.rst:993 msgid "" "Inheritance of this field is complicated. Most flag bits are inherited " "individually, i.e. if the base type has a flag bit set, the subtype inherits " "this flag bit. The flag bits that pertain to extension structures are " "strictly inherited if the extension structure is inherited, i.e. the base " "type's value of the flag bit is copied into the subtype together with a " -"pointer to the extension structure. The :c:macro:`Py_TPFLAGS_HAVE_GC` flag " +"pointer to the extension structure. The :const:`Py_TPFLAGS_HAVE_GC` flag " "bit is inherited together with the :c:member:`~PyTypeObject.tp_traverse` " -"and :c:member:`~PyTypeObject.tp_clear` fields, i.e. if the :c:macro:" +"and :c:member:`~PyTypeObject.tp_clear` fields, i.e. if the :const:" "`Py_TPFLAGS_HAVE_GC` flag bit is clear in the subtype and the :c:member:" "`~PyTypeObject.tp_traverse` and :c:member:`~PyTypeObject.tp_clear` fields in " "the subtype exist and have ``NULL`` values." msgstr "" - -#: ../../c-api/typeobj.rst:1144 -msgid "" -":c:data:`PyBaseObject_Type` uses ``Py_TPFLAGS_DEFAULT | " +"このフィールドの継承は込み入っています。ほとんどのフラグは個別に継承されま" +"す。すなわち、基底タイプのフラグビットが設定されていたら、サブタイプのフラグ" +"ビットもそれを引き継ぎます。拡張機能構造体が継承される場合は、拡張機能構造体" +"に関係するフラグビットは厳密に継承されます。すなわち、基底タイプのフラグビッ" +"トの値は、拡張機能構造体へのポインタと共に、サブタイプにコピーされます。 :" +"const:`Py_TPFLAGS_HAVE_GC` フラグビットは :c:member:`~PyTypeObject." +"tp_traverse` フィールドと :c:member:`~PyTypeObject.tp_clear` フィールドと共に" +"継承されます。すなわち、サブタイプにおいて、 :const:`Py_TPFLAGS_HAVE_GC` フラ" +"グビットがクリアされていて、 :c:member:`~PyTypeObject.tp_traverse` フィールド" +"と :c:member:`~PyTypeObject.tp_clear` フィールドが存在し ``NULL`` になってい" +"る場合に継承されます。" + +#: ../../c-api/typeobj.rst:1008 +msgid "" +":c:type:`PyBaseObject_Type` uses ``Py_TPFLAGS_DEFAULT | " "Py_TPFLAGS_BASETYPE``." msgstr "" -#: ../../c-api/typeobj.rst:1147 +#: ../../c-api/typeobj.rst:1011 msgid "**Bit Masks:**" msgstr "" -#: ../../c-api/typeobj.rst:1151 +#: ../../c-api/typeobj.rst:1013 msgid "" "The following bit masks are currently defined; these can be ORed together " "using the ``|`` operator to form the value of the :c:member:`~PyTypeObject." @@ -2335,26 +2051,24 @@ msgstr "" "す。 :c:func:`PyType_HasFeature` マクロは型とフラグ値、 *tp* および *f* をと" "り、 ``tp->tp_flags & f`` が非ゼロかどうか調べます。" -#: ../../c-api/typeobj.rst:1158 +#: ../../c-api/typeobj.rst:1020 msgid "" "This bit is set when the type object itself is allocated on the heap, for " "example, types created dynamically using :c:func:`PyType_FromSpec`. In this " -"case, the :c:member:`~PyObject.ob_type` field of its instances is considered " -"a reference to the type, and the type object is INCREF'ed when a new " -"instance is created, and DECREF'ed when an instance is destroyed (this does " -"not apply to instances of subtypes; only the type referenced by the " -"instance's ob_type gets INCREF'ed or DECREF'ed). Heap types should also :ref:" -"`support garbage collection ` as they can form a " -"reference cycle with their own module object." -msgstr "" - -#: ../../c-api/typeobj.rst:1169 ../../c-api/typeobj.rst:1180 -#: ../../c-api/typeobj.rst:1190 ../../c-api/typeobj.rst:1200 -#: ../../c-api/typeobj.rst:1232 +"case, the :attr:`ob_type` field of its instances is considered a reference " +"to the type, and the type object is INCREF'ed when a new instance is " +"created, and DECREF'ed when an instance is destroyed (this does not apply to " +"instances of subtypes; only the type referenced by the instance's ob_type " +"gets INCREF'ed or DECREF'ed)." +msgstr "" + +#: ../../c-api/typeobj.rst:1030 ../../c-api/typeobj.rst:1041 +#: ../../c-api/typeobj.rst:1051 ../../c-api/typeobj.rst:1061 +#: ../../c-api/typeobj.rst:1094 msgid "???" msgstr "" -#: ../../c-api/typeobj.rst:1174 +#: ../../c-api/typeobj.rst:1035 msgid "" "This bit is set when the type can be used as the base type of another type. " "If this bit is clear, the type cannot be subtyped (similar to a \"final\" " @@ -2364,7 +2078,7 @@ msgstr "" "クリアならば、この型のサブタイプは生成できません (Java における \"final\" ク" "ラスに似たクラスになります)。" -#: ../../c-api/typeobj.rst:1185 +#: ../../c-api/typeobj.rst:1046 msgid "" "This bit is set when the type object has been fully initialized by :c:func:" "`PyType_Ready`." @@ -2372,7 +2086,7 @@ msgstr "" "型オブジェクトが :c:func:`PyType_Ready` で完全に初期化されるとセットされる" "ビットです。" -#: ../../c-api/typeobj.rst:1195 +#: ../../c-api/typeobj.rst:1056 msgid "" "This bit is set while :c:func:`PyType_Ready` is in the process of " "initializing the type object." @@ -2380,133 +2094,84 @@ msgstr "" ":c:func:`PyType_Ready` による型オブジェクトの初期化処理中にセットされるビット" "です。" -#: ../../c-api/typeobj.rst:1205 +#: ../../c-api/typeobj.rst:1066 msgid "" "This bit is set when the object supports garbage collection. If this bit is " -"set, memory for new instances (see :c:member:`~PyTypeObject.tp_alloc`) must " -"be allocated using :c:macro:`PyObject_GC_New` or :c:func:" -"`PyType_GenericAlloc` and deallocated (see :c:member:`~PyTypeObject." -"tp_free`) using :c:func:`PyObject_GC_Del`. More information in section :ref:" -"`supporting-cycle-detection`." +"set, instances must be created using :c:func:`PyObject_GC_New` and destroyed " +"using :c:func:`PyObject_GC_Del`. More information in section :ref:" +"`supporting-cycle-detection`. This bit also implies that the GC-related " +"fields :c:member:`~PyTypeObject.tp_traverse` and :c:member:`~PyTypeObject." +"tp_clear` are present in the type object." msgstr "" +"オブジェクトがガベージコレクション (GC) をサポートする場合にセットされるビッ" +"トです。このビットがセットされている場合、インスタンスは :c:func:" +"`PyObject_GC_New` を使って生成し、 :c:func:`PyObject_GC_Del` を使って破棄しな" +"ければなりません。詳しい情報は :ref:`supporting-cycle-detection` にあります。" +"このビットは、GC に関連するフィールド :c:member:`~PyTypeObject.tp_traverse` " +"および :c:member:`~PyTypeObject.tp_clear` が型オブジェクト内に存在することも" +"示しています。" -#: ../../c-api/typeobj.rst:1214 ../../c-api/typeobj.rst:1561 -#: ../../c-api/typeobj.rst:1705 +#: ../../c-api/typeobj.rst:1075 ../../c-api/typeobj.rst:1247 +#: ../../c-api/typeobj.rst:1314 msgid "" -"Group: :c:macro:`Py_TPFLAGS_HAVE_GC`, :c:member:`~PyTypeObject." -"tp_traverse`, :c:member:`~PyTypeObject.tp_clear`" +"Group: :const:`Py_TPFLAGS_HAVE_GC`, :attr:`tp_traverse`, :attr:`tp_clear`" msgstr "" -#: ../../c-api/typeobj.rst:1216 +#: ../../c-api/typeobj.rst:1077 msgid "" -"The :c:macro:`Py_TPFLAGS_HAVE_GC` flag bit is inherited together with the :c:" -"member:`~PyTypeObject.tp_traverse` and :c:member:`~PyTypeObject.tp_clear` " -"fields, i.e. if the :c:macro:`Py_TPFLAGS_HAVE_GC` flag bit is clear in the " -"subtype and the :c:member:`~PyTypeObject.tp_traverse` and :c:member:" -"`~PyTypeObject.tp_clear` fields in the subtype exist and have ``NULL`` " -"values." +"The :const:`Py_TPFLAGS_HAVE_GC` flag bit is inherited together with the :" +"attr:`tp_traverse` and :attr:`tp_clear` fields, i.e. if the :const:" +"`Py_TPFLAGS_HAVE_GC` flag bit is clear in the subtype and the :attr:" +"`tp_traverse` and :attr:`tp_clear` fields in the subtype exist and have " +"``NULL`` values." msgstr "" -#: ../../c-api/typeobj.rst:1226 +#: ../../c-api/typeobj.rst:1087 msgid "" "This is a bitmask of all the bits that pertain to the existence of certain " "fields in the type object and its extension structures. Currently, it " -"includes the following bits: :c:macro:`Py_TPFLAGS_HAVE_STACKLESS_EXTENSION`." +"includes the following bits: :const:`Py_TPFLAGS_HAVE_STACKLESS_EXTENSION`, :" +"const:`Py_TPFLAGS_HAVE_VERSION_TAG`." msgstr "" +"型オブジェクトおよび拡張機能構造体の特定のフィールドの存在の有無に関連する全" +"てのビットからなるビットマスクです。現状では、このビットマスクには以下のビッ" +"ト: :const:`Py_TPFLAGS_HAVE_STACKLESS_EXTENSION` および :const:" +"`Py_TPFLAGS_HAVE_VERSION_TAG` が入っています。" -#: ../../c-api/typeobj.rst:1237 +#: ../../c-api/typeobj.rst:1099 msgid "This bit indicates that objects behave like unbound methods." msgstr "" -#: ../../c-api/typeobj.rst:1239 +#: ../../c-api/typeobj.rst:1101 msgid "If this flag is set for ``type(meth)``, then:" msgstr "" -#: ../../c-api/typeobj.rst:1241 +#: ../../c-api/typeobj.rst:1103 msgid "" "``meth.__get__(obj, cls)(*args, **kwds)`` (with ``obj`` not None) must be " "equivalent to ``meth(obj, *args, **kwds)``." msgstr "" -#: ../../c-api/typeobj.rst:1244 +#: ../../c-api/typeobj.rst:1106 msgid "" "``meth.__get__(None, cls)(*args, **kwds)`` must be equivalent to " "``meth(*args, **kwds)``." msgstr "" -#: ../../c-api/typeobj.rst:1247 +#: ../../c-api/typeobj.rst:1109 msgid "" "This flag enables an optimization for typical method calls like ``obj." "meth()``: it avoids creating a temporary \"bound method\" object for ``obj." "meth``." msgstr "" -#: ../../c-api/typeobj.rst:1255 -msgid "" -"This flag is never inherited by types without the :c:macro:" -"`Py_TPFLAGS_IMMUTABLETYPE` flag set. For extension types, it is inherited " -"whenever :c:member:`~PyTypeObject.tp_descr_get` is inherited." -msgstr "" - -#: ../../c-api/typeobj.rst:1261 -msgid "" -"This bit indicates that instances of the class have a :attr:`~object." -"__dict__` attribute, and that the space for the dictionary is managed by the " -"VM." -msgstr "" - -#: ../../c-api/typeobj.rst:1264 -msgid "If this flag is set, :c:macro:`Py_TPFLAGS_HAVE_GC` should also be set." -msgstr "" - -#: ../../c-api/typeobj.rst:1266 -msgid "" -"The type traverse function must call :c:func:`PyObject_VisitManagedDict` and " -"its clear function must call :c:func:`PyObject_ClearManagedDict`." -msgstr "" - -#: ../../c-api/typeobj.rst:1273 -msgid "" -"This flag is inherited unless the :c:member:`~PyTypeObject.tp_dictoffset` " -"field is set in a superclass." -msgstr "" - -#: ../../c-api/typeobj.rst:1279 -msgid "" -"This bit indicates that instances of the class should be weakly " -"referenceable." -msgstr "" - -#: ../../c-api/typeobj.rst:1286 -msgid "" -"This flag is inherited unless the :c:member:`~PyTypeObject." -"tp_weaklistoffset` field is set in a superclass." -msgstr "" - -#: ../../c-api/typeobj.rst:1292 -msgid "" -"Only usable with variable-size types, i.e. ones with non-zero :c:member:" -"`~PyTypeObject.tp_itemsize`." -msgstr "" - -#: ../../c-api/typeobj.rst:1295 -msgid "" -"Indicates that the variable-sized portion of an instance of this type is at " -"the end of the instance's memory area, at an offset of ``Py_TYPE(obj)-" -">tp_basicsize`` (which may be different in each subclass)." -msgstr "" - -#: ../../c-api/typeobj.rst:1300 +#: ../../c-api/typeobj.rst:1117 msgid "" -"When setting this flag, be sure that all superclasses either use this memory " -"layout, or are not variable-sized. Python does not check this." -msgstr "" - -#: ../../c-api/typeobj.rst:1308 -msgid "This flag is inherited." +"This flag is never inherited by heap types. For extension types, it is " +"inherited whenever :c:member:`~PyTypeObject.tp_descr_get` is inherited." msgstr "" -#: ../../c-api/typeobj.rst:1322 +#: ../../c-api/typeobj.rst:1134 msgid "" "These flags are used by functions such as :c:func:`PyLong_Check` to quickly " "determine if a type is a subclass of a built-in type; such specific checks " @@ -2523,7 +2188,7 @@ msgstr "" "設定すべきで、そうしないとその型が関わるコードでは、どんなチェックの方法が使" "われるかによって振る舞いが異なってしまうでしょう。" -#: ../../c-api/typeobj.rst:1333 +#: ../../c-api/typeobj.rst:1145 msgid "" "This bit is set when the :c:member:`~PyTypeObject.tp_finalize` slot is " "present in the type structure." @@ -2531,156 +2196,48 @@ msgstr "" "型構造体に :c:member:`~PyTypeObject.tp_finalize` スロットが存在しているときに" "セットされるビットです。" -#: ../../c-api/typeobj.rst:1338 +#: ../../c-api/typeobj.rst:1150 msgid "" "This flag isn't necessary anymore, as the interpreter assumes the :c:member:" "`~PyTypeObject.tp_finalize` slot is always present in the type structure." msgstr "" -#: ../../c-api/typeobj.rst:1346 +#: ../../c-api/typeobj.rst:1158 msgid "" "This bit is set when the class implements the :ref:`vectorcall protocol " "`. See :c:member:`~PyTypeObject.tp_vectorcall_offset` for " "details." msgstr "" -#: ../../c-api/typeobj.rst:1352 -msgid "" -"This bit is inherited if :c:member:`~PyTypeObject.tp_call` is also inherited." -msgstr "" - -#: ../../c-api/typeobj.rst:1359 +#: ../../c-api/typeobj.rst:1164 msgid "" -"This flag is now removed from a class when the class's :py:meth:`~object." -"__call__` method is reassigned." -msgstr "" - -#: ../../c-api/typeobj.rst:1362 -msgid "This flag can now be inherited by mutable classes." +"This bit is inherited for *static* subtypes if :c:member:`~PyTypeObject." +"tp_call` is also inherited. `Heap types`_ do not inherit " +"``Py_TPFLAGS_HAVE_VECTORCALL``." msgstr "" -#: ../../c-api/typeobj.rst:1366 -msgid "" -"This bit is set for type objects that are immutable: type attributes cannot " -"be set nor deleted." -msgstr "" - -#: ../../c-api/typeobj.rst:1368 -msgid "" -":c:func:`PyType_Ready` automatically applies this flag to :ref:`static types " -"`." -msgstr "" - -#: ../../c-api/typeobj.rst:1373 -msgid "This flag is not inherited." -msgstr "" - -#: ../../c-api/typeobj.rst:1379 -msgid "" -"Disallow creating instances of the type: set :c:member:`~PyTypeObject." -"tp_new` to NULL and don't create the ``__new__`` key in the type dictionary." -msgstr "" - -#: ../../c-api/typeobj.rst:1383 -msgid "" -"The flag must be set before creating the type, not after. For example, it " -"must be set before :c:func:`PyType_Ready` is called on the type." -msgstr "" - -#: ../../c-api/typeobj.rst:1386 -msgid "" -"The flag is set automatically on :ref:`static types ` if :c:" -"member:`~PyTypeObject.tp_base` is NULL or ``&PyBaseObject_Type`` and :c:" -"member:`~PyTypeObject.tp_new` is NULL." -msgstr "" - -#: ../../c-api/typeobj.rst:1392 -msgid "" -"This flag is not inherited. However, subclasses will not be instantiable " -"unless they provide a non-NULL :c:member:`~PyTypeObject.tp_new` (which is " -"only possible via the C API)." -msgstr "" - -#: ../../c-api/typeobj.rst:1399 -msgid "" -"To disallow instantiating a class directly but allow instantiating its " -"subclasses (e.g. for an :term:`abstract base class`), do not use this flag. " -"Instead, make :c:member:`~PyTypeObject.tp_new` only succeed for subclasses." -msgstr "" - -#: ../../c-api/typeobj.rst:1410 -msgid "" -"This bit indicates that instances of the class may match mapping patterns " -"when used as the subject of a :keyword:`match` block. It is automatically " -"set when registering or subclassing :class:`collections.abc.Mapping`, and " -"unset when registering :class:`collections.abc.Sequence`." -msgstr "" - -#: ../../c-api/typeobj.rst:1417 ../../c-api/typeobj.rst:1439 -msgid "" -":c:macro:`Py_TPFLAGS_MAPPING` and :c:macro:`Py_TPFLAGS_SEQUENCE` are " -"mutually exclusive; it is an error to enable both flags simultaneously." -msgstr "" - -#: ../../c-api/typeobj.rst:1422 -msgid "" -"This flag is inherited by types that do not already set :c:macro:" -"`Py_TPFLAGS_SEQUENCE`." -msgstr "" - -#: ../../c-api/typeobj.rst:1425 ../../c-api/typeobj.rst:1447 -msgid ":pep:`634` -- Structural Pattern Matching: Specification" -msgstr ":pep:`634` -- 構造的パターンマッチ: 仕様" - -#: ../../c-api/typeobj.rst:1432 -msgid "" -"This bit indicates that instances of the class may match sequence patterns " -"when used as the subject of a :keyword:`match` block. It is automatically " -"set when registering or subclassing :class:`collections.abc.Sequence`, and " -"unset when registering :class:`collections.abc.Mapping`." -msgstr "" - -#: ../../c-api/typeobj.rst:1444 -msgid "" -"This flag is inherited by types that do not already set :c:macro:" -"`Py_TPFLAGS_MAPPING`." -msgstr "" - -#: ../../c-api/typeobj.rst:1454 -msgid "" -"Internal. Do not set or unset this flag. To indicate that a class has " -"changed call :c:func:`PyType_Modified`" -msgstr "" - -#: ../../c-api/typeobj.rst:1458 -msgid "" -"This flag is present in header files, but is not be used. It will be removed " -"in a future version of CPython" -msgstr "" - -#: ../../c-api/typeobj.rst:1464 +#: ../../c-api/typeobj.rst:1173 msgid "" "An optional pointer to a NUL-terminated C string giving the docstring for " -"this type object. This is exposed as the :attr:`~type.__doc__` attribute on " -"the type and instances of the type." +"this type object. This is exposed as the :attr:`__doc__` attribute on the " +"type and instances of the type." msgstr "" +"オプションのポインタで、この型オブジェクトの docstring を与える NUL 終端され" +"た C の文字列を指します。この値は型オブジェクトと型のインスタンスにおける :" +"attr:`__doc__` 属性として公開されます。" -#: ../../c-api/typeobj.rst:1470 +#: ../../c-api/typeobj.rst:1179 msgid "This field is *not* inherited by subtypes." msgstr "サブタイプはこのフィールドを継承 *しません* 。" -#: ../../c-api/typeobj.rst:1475 +#: ../../c-api/typeobj.rst:1184 msgid "" "An optional pointer to a traversal function for the garbage collector. This " -"is only used if the :c:macro:`Py_TPFLAGS_HAVE_GC` flag bit is set. The " +"is only used if the :const:`Py_TPFLAGS_HAVE_GC` flag bit is set. The " "signature is::" msgstr "" -#: ../../c-api/typeobj.rst:1478 -msgid "int tp_traverse(PyObject *self, visitproc visit, void *arg);" -msgstr "" - -#: ../../c-api/typeobj.rst:1480 ../../c-api/typeobj.rst:1700 +#: ../../c-api/typeobj.rst:1189 ../../c-api/typeobj.rst:1309 msgid "" "More information about Python's garbage collection scheme can be found in " "section :ref:`supporting-cycle-detection`." @@ -2688,30 +2245,17 @@ msgstr "" "Pythonのガベージコレクションの仕組みについての詳細は、 :ref:`supporting-" "cycle-detection` にあります。" -#: ../../c-api/typeobj.rst:1483 +#: ../../c-api/typeobj.rst:1192 msgid "" "The :c:member:`~PyTypeObject.tp_traverse` pointer is used by the garbage " "collector to detect reference cycles. A typical implementation of a :c:" "member:`~PyTypeObject.tp_traverse` function simply calls :c:func:`Py_VISIT` " "on each of the instance's members that are Python objects that the instance " -"owns. For example, this is function :c:func:`!local_traverse` from the :mod:" -"`!_thread` extension module::" +"owns. For example, this is function :c:func:`local_traverse` from the :mod:" +"`_thread` extension module::" msgstr "" -#: ../../c-api/typeobj.rst:1489 -msgid "" -"static int\n" -"local_traverse(PyObject *op, visitproc visit, void *arg)\n" -"{\n" -" localobject *self = (localobject *) op;\n" -" Py_VISIT(self->args);\n" -" Py_VISIT(self->kw);\n" -" Py_VISIT(self->dict);\n" -" return 0;\n" -"}" -msgstr "" - -#: ../../c-api/typeobj.rst:1499 +#: ../../c-api/typeobj.rst:1207 msgid "" "Note that :c:func:`Py_VISIT` is called only on those members that can " "participate in reference cycles. Although there is also a ``self->key`` " @@ -2722,7 +2266,7 @@ msgstr "" "に注目してください。 ``self->key`` メンバもありますが、それは ``NULL`` か " "Python文字列なので、循環参照の一部になることはありません。" -#: ../../c-api/typeobj.rst:1503 +#: ../../c-api/typeobj.rst:1211 msgid "" "On the other hand, even if you know a member can never be part of a cycle, " "as a debugging aid you may want to visit it anyway just so the :mod:`gc` " @@ -2732,244 +2276,97 @@ msgstr "" "たい場合があるかもしれないので、 :mod:`gc` モジュールの :func:`~gc." "get_referents` 関数は循環参照になり得ないメンバも返します。" -#: ../../c-api/typeobj.rst:1507 -msgid "" -"Heap types (:c:macro:`Py_TPFLAGS_HEAPTYPE`) must visit their type with::" -msgstr "" - -#: ../../c-api/typeobj.rst:1509 -msgid "Py_VISIT(Py_TYPE(self));" -msgstr "" - -#: ../../c-api/typeobj.rst:1511 -msgid "" -"It is only needed since Python 3.9. To support Python 3.8 and older, this " -"line must be conditional::" -msgstr "" - -#: ../../c-api/typeobj.rst:1514 -msgid "" -"#if PY_VERSION_HEX >= 0x03090000\n" -" Py_VISIT(Py_TYPE(self));\n" -"#endif" -msgstr "" - -#: ../../c-api/typeobj.rst:1518 -msgid "" -"If the :c:macro:`Py_TPFLAGS_MANAGED_DICT` bit is set in the :c:member:" -"`~PyTypeObject.tp_flags` field, the traverse function must call :c:func:" -"`PyObject_VisitManagedDict` like this::" -msgstr "" - -#: ../../c-api/typeobj.rst:1522 -msgid "PyObject_VisitManagedDict((PyObject*)self, visit, arg);" -msgstr "" - -#: ../../c-api/typeobj.rst:1525 +#: ../../c-api/typeobj.rst:1216 msgid "" "When implementing :c:member:`~PyTypeObject.tp_traverse`, only the members " -"that the instance *owns* (by having :term:`strong references ` to them) must be visited. For instance, if an object supports " -"weak references via the :c:member:`~PyTypeObject.tp_weaklist` slot, the " -"pointer supporting the linked list (what *tp_weaklist* points to) must " -"**not** be visited as the instance does not directly own the weak references " -"to itself (the weakreference list is there to support the weak reference " -"machinery, but the instance has no strong reference to the elements inside " -"it, as they are allowed to be removed even if the instance is still alive)." +"that the instance *owns* (by having strong references to them) must be " +"visited. For instance, if an object supports weak references via the :c:" +"member:`~PyTypeObject.tp_weaklist` slot, the pointer supporting the linked " +"list (what *tp_weaklist* points to) must **not** be visited as the instance " +"does not directly own the weak references to itself (the weakreference list " +"is there to support the weak reference machinery, but the instance has no " +"strong reference to the elements inside it, as they are allowed to be " +"removed even if the instance is still alive)." msgstr "" -#: ../../c-api/typeobj.rst:1536 +#: ../../c-api/typeobj.rst:1226 msgid "" "Note that :c:func:`Py_VISIT` requires the *visit* and *arg* parameters to :c:" -"func:`!local_traverse` to have these specific names; don't name them just " +"func:`local_traverse` to have these specific names; don't name them just " "anything." msgstr "" +":c:func:`Py_VISIT` は :c:func:`local_traverse` が *visit* と *arg* という決" +"まった名前の引数を持つことを要求します。" -#: ../../c-api/typeobj.rst:1540 +#: ../../c-api/typeobj.rst:1230 msgid "" -"Instances of :ref:`heap-allocated types ` hold a reference to " -"their type. Their traversal function must therefore either visit :c:func:" +"Heap-allocated types (:const:`Py_TPFLAGS_HEAPTYPE`, such as those created " +"with :c:func:`PyType_FromSpec` and similar APIs) hold a reference to their " +"type. Their traversal function must therefore either visit :c:func:" "`Py_TYPE(self) `, or delegate this responsibility by calling " "``tp_traverse`` of another heap-allocated type (such as a heap-allocated " "superclass). If they do not, the type object may not be garbage-collected." msgstr "" -#: ../../c-api/typeobj.rst:1549 -msgid "" -"The :c:member:`~PyTypeObject.tp_traverse` function can be called from any " -"thread." -msgstr "" - -#: ../../c-api/typeobj.rst:1554 +#: ../../c-api/typeobj.rst:1240 msgid "" "Heap-allocated types are expected to visit ``Py_TYPE(self)`` in " "``tp_traverse``. In earlier versions of Python, due to `bug 40217 `_, doing this may lead to crashes in subclasses." msgstr "" -#: ../../c-api/typeobj.rst:1563 +#: ../../c-api/typeobj.rst:1249 msgid "" "This field is inherited by subtypes together with :c:member:`~PyTypeObject." -"tp_clear` and the :c:macro:`Py_TPFLAGS_HAVE_GC` flag bit: the flag bit, :c:" +"tp_clear` and the :const:`Py_TPFLAGS_HAVE_GC` flag bit: the flag bit, :c:" "member:`~PyTypeObject.tp_traverse`, and :c:member:`~PyTypeObject.tp_clear` " "are all inherited from the base type if they are all zero in the subtype." msgstr "" +"このフィールドは :c:member:`~PyTypeObject.tp_clear` および :const:" +"`Py_TPFLAGS_HAVE_GC` フラグビットと共にサブタイプに継承されます: すなわち、サ" +"ブタイプの :c:member:`~PyTypeObject.tp_traverse` および :c:member:" +"`~PyTypeObject.tp_clear` が両方ともゼロの場合、サブタイプは基底タイプから :c:" +"member:`~PyTypeObject.tp_traverse` と :c:member:`~PyTypeObject.tp_clear` を両" +"方とも継承します。" -#: ../../c-api/typeobj.rst:1571 -msgid "An optional pointer to a clear function. The signature is::" -msgstr "" - -#: ../../c-api/typeobj.rst:1573 -msgid "int tp_clear(PyObject *);" -msgstr "" - -#: ../../c-api/typeobj.rst:1575 -msgid "" -"The purpose of this function is to break reference cycles that are causing " -"a :term:`cyclic isolate` so that the objects can be safely destroyed. A " -"cleared object is a partially destroyed object; the object is not obligated " -"to satisfy design invariants held during normal use." -msgstr "" - -#: ../../c-api/typeobj.rst:1580 -msgid "" -":c:member:`!tp_clear` does not need to delete references to objects that " -"can't participate in reference cycles, such as Python strings or Python " -"integers. However, it may be convenient to clear all references, and write " -"the type's :c:member:`~PyTypeObject.tp_dealloc` function to invoke :c:member:" -"`!tp_clear` to avoid code duplication. (Beware that :c:member:`!tp_clear` " -"might have already been called. Prefer calling idempotent functions like :c:" -"func:`Py_CLEAR`.)" -msgstr "" - -#: ../../c-api/typeobj.rst:1588 -msgid "" -"Any non-trivial cleanup should be performed in :c:member:`~PyTypeObject." -"tp_finalize` instead of :c:member:`!tp_clear`." -msgstr "" - -#: ../../c-api/typeobj.rst:1593 -msgid "" -"If :c:member:`!tp_clear` fails to break a reference cycle then the objects " -"in the :term:`cyclic isolate` may remain indefinitely uncollectable " -"(\"leak\"). See :data:`gc.garbage`." -msgstr "" - -#: ../../c-api/typeobj.rst:1599 -msgid "" -"Referents (direct and indirect) might have already been cleared; they are " -"not guaranteed to be in a consistent state." -msgstr "" - -#: ../../c-api/typeobj.rst:1604 -msgid "" -"The :c:member:`~PyTypeObject.tp_clear` function can be called from any " -"thread." -msgstr "" - -#: ../../c-api/typeobj.rst:1609 -msgid "" -"An object is not guaranteed to be automatically cleared before its " -"destructor (:c:member:`~PyTypeObject.tp_dealloc`) is called." -msgstr "" - -#: ../../c-api/typeobj.rst:1612 -msgid "" -"This function differs from the destructor (:c:member:`~PyTypeObject." -"tp_dealloc`) in the following ways:" -msgstr "" - -#: ../../c-api/typeobj.rst:1615 -msgid "" -"The purpose of clearing an object is to remove references to other objects " -"that might participate in a reference cycle. The purpose of the destructor, " -"on the other hand, is a superset: it must release *all* resources it owns, " -"including references to objects that cannot participate in a reference cycle " -"(e.g., integers) as well as the object's own memory (by calling :c:member:" -"`~PyTypeObject.tp_free`)." -msgstr "" - -#: ../../c-api/typeobj.rst:1621 -msgid "" -"When :c:member:`!tp_clear` is called, other objects might still hold " -"references to the object being cleared. Because of this, :c:member:`!" -"tp_clear` must not deallocate the object's own memory (:c:member:" -"`~PyTypeObject.tp_free`). The destructor, on the other hand, is only called " -"when no (strong) references exist, and as such, must safely destroy the " -"object itself by deallocating it." -msgstr "" - -#: ../../c-api/typeobj.rst:1627 -msgid "" -":c:member:`!tp_clear` might never be automatically called. An object's " -"destructor, on the other hand, will be automatically called some time after " -"the object becomes unreachable (i.e., either there are no references to the " -"object or the object is a member of a :term:`cyclic isolate`)." -msgstr "" - -#: ../../c-api/typeobj.rst:1632 -msgid "" -"No guarantees are made about when, if, or how often Python automatically " -"clears an object, except:" -msgstr "" - -#: ../../c-api/typeobj.rst:1635 +#: ../../c-api/typeobj.rst:1257 msgid "" -"Python will not automatically clear an object if it is reachable, i.e., " -"there is a reference to it and it is not a member of a :term:`cyclic " -"isolate`." -msgstr "" - -#: ../../c-api/typeobj.rst:1638 -msgid "" -"Python will not automatically clear an object if it has not been " -"automatically finalized (see :c:member:`~PyTypeObject.tp_finalize`). (If " -"the finalizer resurrected the object, the object may or may not be " -"automatically finalized again before it is cleared.)" -msgstr "" - -#: ../../c-api/typeobj.rst:1642 -msgid "" -"If an object is a member of a :term:`cyclic isolate`, Python will not " -"automatically clear it if any member of the cyclic isolate has not yet been " -"automatically finalized (:c:member:`~PyTypeObject.tp_finalize`)." -msgstr "" - -#: ../../c-api/typeobj.rst:1645 -msgid "" -"Python will not destroy an object until after any automatic calls to its :c:" -"member:`!tp_clear` function have returned. This ensures that the act of " -"breaking a reference cycle does not invalidate the ``self`` pointer while :c:" -"member:`!tp_clear` is still executing." -msgstr "" - -#: ../../c-api/typeobj.rst:1649 -msgid "" -"Python will not automatically call :c:member:`!tp_clear` multiple times " -"concurrently." -msgstr "" - -#: ../../c-api/typeobj.rst:1652 -msgid "" -"CPython currently only automatically clears objects as needed to break " -"reference cycles in a :term:`cyclic isolate`, but future versions might " -"clear objects regularly before their destruction." +"An optional pointer to a clear function for the garbage collector. This is " +"only used if the :const:`Py_TPFLAGS_HAVE_GC` flag bit is set. The signature " +"is::" msgstr "" - -#: ../../c-api/typeobj.rst:1656 -msgid "" -"Taken together, all :c:member:`~PyTypeObject.tp_clear` functions in the " -"system must combine to break all reference cycles. This is subtle, and if " -"in any doubt supply a :c:member:`~PyTypeObject.tp_clear` function. For " -"example, the tuple type does not implement a :c:member:`~PyTypeObject." -"tp_clear` function, because it's possible to prove that no reference cycle " -"can be composed entirely of tuples. Therefore the :c:member:`~PyTypeObject." -"tp_clear` functions of other types are responsible for breaking any cycle " +"オプションのポインタで、ガベージコレクタにおける消去関数 (clear function) を" +"指します。 :const:`Py_TPFLAGS_HAVE_GC` がセットされている場合にのみ使われま" +"す。シグネチャは次の通りです::" + +#: ../../c-api/typeobj.rst:1262 +msgid "" +"The :c:member:`~PyTypeObject.tp_clear` member function is used to break " +"reference cycles in cyclic garbage detected by the garbage collector. Taken " +"together, all :c:member:`~PyTypeObject.tp_clear` functions in the system " +"must combine to break all reference cycles. This is subtle, and if in any " +"doubt supply a :c:member:`~PyTypeObject.tp_clear` function. For example, " +"the tuple type does not implement a :c:member:`~PyTypeObject.tp_clear` " +"function, because it's possible to prove that no reference cycle can be " +"composed entirely of tuples. Therefore the :c:member:`~PyTypeObject." +"tp_clear` functions of other types must be sufficient to break any cycle " "containing a tuple. This isn't immediately obvious, and there's rarely a " "good reason to avoid implementing :c:member:`~PyTypeObject.tp_clear`." msgstr "" - -#: ../../c-api/typeobj.rst:1667 +":c:member:`~PyTypeObject.tp_clear` メンバ関数は GC が検出した循環しているゴミ" +"の循環参照を壊すために用いられます。総合的な視点で考えると、システム内の全て" +"の :c:member:`~PyTypeObject.tp_clear` 関数が連携して、全ての循環参照を破壊し" +"なければなりません。 (訳注: ある型が :c:member:`~PyTypeObject.tp_clear` を実" +"装しなくても全ての循環参照が破壊できるのであれば実装しなくても良い) これはと" +"ても繊細で、もし少しでも不確かな部分があるのであれば、 :c:member:" +"`~PyTypeObject.tp_clear` 関数を提供するべきです。例えば、タプルは :c:member:" +"`~PyTypeObject.tp_clear` を実装しません。なぜなら、タプルだけで構成された循環" +"参照がみつかることは無いからです。従って、タプル以外の型の :c:member:" +"`~PyTypeObject.tp_clear` 関数だけで、タプルを含むどんな循環参照も必ず破壊でき" +"ることになります。これは簡単に判ることではなく、 :c:member:`~PyTypeObject." +"tp_clear` の実装を避ける良い理由はめったにありません。" + +#: ../../c-api/typeobj.rst:1272 msgid "" "Implementations of :c:member:`~PyTypeObject.tp_clear` should drop the " "instance's references to those of its members that may be Python objects, " @@ -2980,71 +2377,81 @@ msgstr "" "スから Python オブジェクトだと思われるメンバへの参照を外し、それらのメンバへ" "のポインタに ``NULL`` をセットすべきです::" -#: ../../c-api/typeobj.rst:1671 -msgid "" -"static int\n" -"local_clear(PyObject *op)\n" -"{\n" -" localobject *self = (localobject *) op;\n" -" Py_CLEAR(self->key);\n" -" Py_CLEAR(self->args);\n" -" Py_CLEAR(self->kw);\n" -" Py_CLEAR(self->dict);\n" -" return 0;\n" -"}" -msgstr "" - -#: ../../c-api/typeobj.rst:1682 +#: ../../c-api/typeobj.rst:1286 msgid "" "The :c:func:`Py_CLEAR` macro should be used, because clearing references is " -"delicate: the reference to the contained object must not be released (via :" -"c:func:`Py_DECREF`) until after the pointer to the contained object is set " -"to ``NULL``. This is because releasing the reference may cause the " -"contained object to become trash, triggering a chain of reclamation activity " -"that may include invoking arbitrary Python code (due to finalizers, or " -"weakref callbacks, associated with the contained object). If it's possible " -"for such code to reference *self* again, it's important that the pointer to " -"the contained object be ``NULL`` at that time, so that *self* knows the " -"contained object can no longer be used. The :c:func:`Py_CLEAR` macro " -"performs the operations in a safe order." -msgstr "" - -#: ../../c-api/typeobj.rst:1694 -msgid "" -"If the :c:macro:`Py_TPFLAGS_MANAGED_DICT` bit is set in the :c:member:" -"`~PyTypeObject.tp_flags` field, the traverse function must call :c:func:" -"`PyObject_ClearManagedDict` like this::" -msgstr "" - -#: ../../c-api/typeobj.rst:1698 -msgid "PyObject_ClearManagedDict((PyObject*)self);" -msgstr "" - -#: ../../c-api/typeobj.rst:1707 +"delicate: the reference to the contained object must not be decremented " +"until after the pointer to the contained object is set to ``NULL``. This is " +"because decrementing the reference count may cause the contained object to " +"become trash, triggering a chain of reclamation activity that may include " +"invoking arbitrary Python code (due to finalizers, or weakref callbacks, " +"associated with the contained object). If it's possible for such code to " +"reference *self* again, it's important that the pointer to the contained " +"object be ``NULL`` at that time, so that *self* knows the contained object " +"can no longer be used. The :c:func:`Py_CLEAR` macro performs the operations " +"in a safe order." +msgstr "" +"参照のクリアはデリケートなので、 :c:func:`Py_CLEAR` マクロを使うべきです: ポ" +"インタを ``NULL`` にセットするまで、そのオブジェクトの参照カウントをデクリメ" +"ントしてはいけません。参照カウントのデクリメントすると、そのオブジェクトが破" +"棄されるかもしれず、 (そのオブジェクトに関連付けられたファイナライザ、弱参照" +"のコールバックにより) 任意のPythonコードの実行を含む後片付け処理が実行される" +"かもしれないからです。もしそういったコードが再び *self* を参照することがあれ" +"ば、すでに持っていたオブジェクトへのポインタは ``NULL`` になっているので、 " +"*self* は所有していたオブジェクトをもう利用できないことを認識できます。 :c:" +"func:`Py_CLEAR` マクロはその手続きを安全な順番で実行します。" + +#: ../../c-api/typeobj.rst:1297 +msgid "" +"Note that :c:member:`~PyTypeObject.tp_clear` is not *always* called before " +"an instance is deallocated. For example, when reference counting is enough " +"to determine that an object is no longer used, the cyclic garbage collector " +"is not involved and :c:member:`~PyTypeObject.tp_dealloc` is called directly." +msgstr "" + +#: ../../c-api/typeobj.rst:1303 +msgid "" +"Because the goal of :c:member:`~PyTypeObject.tp_clear` functions is to break " +"reference cycles, it's not necessary to clear contained objects like Python " +"strings or Python integers, which can't participate in reference cycles. On " +"the other hand, it may be convenient to clear all contained Python objects, " +"and write the type's :c:member:`~PyTypeObject.tp_dealloc` function to " +"invoke :c:member:`~PyTypeObject.tp_clear`." +msgstr "" +":c:member:`~PyTypeObject.tp_clear` 関数の目的は参照カウントを破壊することなの" +"で、 Python 文字列や Python 整数のような、循環参照に含むことのできないオブ" +"ジェクトをクリアする必要はありません。一方、所有する全ての Python オブジェク" +"トをクリアするようにし、その型の :c:member:`~PyTypeObject.tp_dealloc` 関数" +"が :c:member:`~PyTypeObject.tp_clear` 関数を実行するようにすると実装が楽にな" +"るでしょう。" + +#: ../../c-api/typeobj.rst:1316 msgid "" "This field is inherited by subtypes together with :c:member:`~PyTypeObject." -"tp_traverse` and the :c:macro:`Py_TPFLAGS_HAVE_GC` flag bit: the flag bit, :" -"c:member:`~PyTypeObject.tp_traverse`, and :c:member:`~PyTypeObject.tp_clear` " +"tp_traverse` and the :const:`Py_TPFLAGS_HAVE_GC` flag bit: the flag bit, :c:" +"member:`~PyTypeObject.tp_traverse`, and :c:member:`~PyTypeObject.tp_clear` " "are all inherited from the base type if they are all zero in the subtype." msgstr "" +"このフィールドは :c:member:`~PyTypeObject.tp_traverse` および :const:" +"`Py_TPFLAGS_HAVE_GC` フラグビットと共にサブタイプに継承されます: すなわち、サ" +"ブタイプの :c:member:`~PyTypeObject.tp_traverse` および :c:member:" +"`~PyTypeObject.tp_clear` が両方ともゼロの場合、サブタイプは基底タイプから :c:" +"member:`~PyTypeObject.tp_traverse` と :c:member:`~PyTypeObject.tp_clear` を両" +"方とも継承します。" -#: ../../c-api/typeobj.rst:1719 +#: ../../c-api/typeobj.rst:1324 msgid "" "An optional pointer to the rich comparison function, whose signature is::" msgstr "" "オプションのポインタで、拡張比較関数を指します。シグネチャは次の通りです::" -#: ../../c-api/typeobj.rst:1721 -msgid "PyObject *tp_richcompare(PyObject *self, PyObject *other, int op);" -msgstr "" - -#: ../../c-api/typeobj.rst:1723 +#: ../../c-api/typeobj.rst:1328 msgid "" "The first parameter is guaranteed to be an instance of the type that is " "defined by :c:type:`PyTypeObject`." msgstr "" -#: ../../c-api/typeobj.rst:1726 +#: ../../c-api/typeobj.rst:1331 msgid "" "The function should return the result of the comparison (usually ``Py_True`` " "or ``Py_False``). If the comparison is undefined, it must return " @@ -3055,7 +2462,7 @@ msgstr "" "す。) 比較が未定義の場合は、``Py_NotImplemented`` を、それ以外のエラーが発生" "した場合には例外状態をセットして ``NULL`` を返さなければなりません。" -#: ../../c-api/typeobj.rst:1731 +#: ../../c-api/typeobj.rst:1336 msgid "" "The following constants are defined to be used as the third argument for :c:" "member:`~PyTypeObject.tp_richcompare` and for :c:func:`PyObject_RichCompare`:" @@ -3064,66 +2471,90 @@ msgstr "" "`PyObject_RichCompare` 関数の第三引数に使うための定数としては以下が定義されて" "います:" -#: ../../c-api/typeobj.rst:1737 +#: ../../c-api/typeobj.rst:1340 msgid "Constant" msgstr "定数" -#: ../../c-api/typeobj.rst:1737 +#: ../../c-api/typeobj.rst:1340 msgid "Comparison" msgstr "比較" -#: ../../c-api/typeobj.rst:1739 +#: ../../c-api/typeobj.rst:1342 +msgid ":const:`Py_LT`" +msgstr ":const:`Py_LT`" + +#: ../../c-api/typeobj.rst:1342 msgid "``<``" msgstr "``<``" -#: ../../c-api/typeobj.rst:1741 +#: ../../c-api/typeobj.rst:1344 +msgid ":const:`Py_LE`" +msgstr ":const:`Py_LE`" + +#: ../../c-api/typeobj.rst:1344 msgid "``<=``" msgstr "``<=``" -#: ../../c-api/typeobj.rst:1743 +#: ../../c-api/typeobj.rst:1346 +msgid ":const:`Py_EQ`" +msgstr ":const:`Py_EQ`" + +#: ../../c-api/typeobj.rst:1346 msgid "``==``" msgstr "``==``" -#: ../../c-api/typeobj.rst:1745 +#: ../../c-api/typeobj.rst:1348 +msgid ":const:`Py_NE`" +msgstr ":const:`Py_NE`" + +#: ../../c-api/typeobj.rst:1348 msgid "``!=``" msgstr "``!=``" -#: ../../c-api/typeobj.rst:1747 +#: ../../c-api/typeobj.rst:1350 +msgid ":const:`Py_GT`" +msgstr ":const:`Py_GT`" + +#: ../../c-api/typeobj.rst:1350 msgid "``>``" msgstr "``>``" -#: ../../c-api/typeobj.rst:1749 +#: ../../c-api/typeobj.rst:1352 +msgid ":const:`Py_GE`" +msgstr ":const:`Py_GE`" + +#: ../../c-api/typeobj.rst:1352 msgid "``>=``" msgstr "``>=``" -#: ../../c-api/typeobj.rst:1752 +#: ../../c-api/typeobj.rst:1355 msgid "" "The following macro is defined to ease writing rich comparison functions:" msgstr "" "拡張比較関数(rich comparison functions)を簡単に記述するためのマクロが定義され" "ています:" -#: ../../c-api/typeobj.rst:1756 +#: ../../c-api/typeobj.rst:1359 msgid "" "Return ``Py_True`` or ``Py_False`` from the function, depending on the " "result of a comparison. VAL_A and VAL_B must be orderable by C comparison " "operators (for example, they may be C ints or floats). The third argument " "specifies the requested operation, as for :c:func:`PyObject_RichCompare`." msgstr "" -"比較した結果に応じて ``Py_True`` か ``Py_False`` を返します。\n" +"比較した結果に応じて ``Py_True` か `Py_False` を返します。\n" "VAL_A と VAL_B は C の比較演算によって順序付け可能でなければなりません(例え" "ばこれらは C言語の整数か浮動小数点数になるでしょう)。三番目の引数には :c:" "func:`PyObject_RichCompare` と同様に要求された演算を指定します。" -#: ../../c-api/typeobj.rst:1762 -msgid "The returned value is a new :term:`strong reference`." -msgstr "" +#: ../../c-api/typeobj.rst:1365 +msgid "The return value's reference count is properly incremented." +msgstr "返り値の参照カウントは適切にインクリメントされます。" -#: ../../c-api/typeobj.rst:1764 +#: ../../c-api/typeobj.rst:1367 msgid "On error, sets an exception and returns ``NULL`` from the function." msgstr "エラー時には例外を設定して、関数から ``NULL`` でリターンします。" -#: ../../c-api/typeobj.rst:1772 +#: ../../c-api/typeobj.rst:1375 msgid "" "This field is inherited by subtypes together with :c:member:`~PyTypeObject." "tp_hash`: a subtype inherits :c:member:`~PyTypeObject.tp_richcompare` and :c:" @@ -3136,38 +2567,25 @@ msgstr "" "基底タイプから :c:member:`~PyTypeObject.tp_richcompare` と :c:member:" "`~PyTypeObject.tp_hash` を両方とも継承します。" -#: ../../c-api/typeobj.rst:1779 -msgid "" -":c:data:`PyBaseObject_Type` provides a :c:member:`~PyTypeObject." -"tp_richcompare` implementation, which may be inherited. However, if only :c:" -"member:`~PyTypeObject.tp_hash` is defined, not even the inherited function " -"is used and instances of the type will not be able to participate in any " -"comparisons." -msgstr "" - -#: ../../c-api/typeobj.rst:1788 +#: ../../c-api/typeobj.rst:1382 msgid "" -"While this field is still supported, :c:macro:`Py_TPFLAGS_MANAGED_WEAKREF` " -"should be used instead, if at all possible." +":c:type:`PyBaseObject_Type` provides a :attr:`tp_richcompare` " +"implementation, which may be inherited. However, if only :attr:`tp_hash` is " +"defined, not even the inherited function is used and instances of the type " +"will not be able to participate in any comparisons." msgstr "" -#: ../../c-api/typeobj.rst:1791 +#: ../../c-api/typeobj.rst:1391 msgid "" "If the instances of this type are weakly referenceable, this field is " "greater than zero and contains the offset in the instance structure of the " "weak reference list head (ignoring the GC header, if present); this offset " -"is used by :c:func:`PyObject_ClearWeakRefs` and the ``PyWeakref_*`` " -"functions. The instance structure needs to include a field of type :c:expr:" +"is used by :c:func:`PyObject_ClearWeakRefs` and the :c:func:`PyWeakref_\\*` " +"functions. The instance structure needs to include a field of type :c:type:" "`PyObject*` which is initialized to ``NULL``." msgstr "" -"型のインスタンスが弱参照可能な場合、このフィールドはゼロよりも大きな数にな" -"り、インスタンス構造体における弱参照リストの先頭を示すオフセットが入ります " -"(GC ヘッダがある場合には無視します); このオフセット値は :c:func:" -"`PyObject_ClearWeakRefs` および ``PyWeakref_*`` 関数が利用します。インスタン" -"ス構造体には、 ``NULL`` に初期化された :c:expr:`PyObject*` 型のフィールドが" -"入っていなければなりません。" -#: ../../c-api/typeobj.rst:1798 +#: ../../c-api/typeobj.rst:1398 msgid "" "Do not confuse this field with :c:member:`~PyTypeObject.tp_weaklist`; that " "is the list head for weak references to the type object itself." @@ -3175,13 +2593,7 @@ msgstr "" "このフィールドを :c:member:`~PyTypeObject.tp_weaklist` と混同しないようにして" "ください; これは型オブジェクト自身への弱参照からなるリストの先頭です。" -#: ../../c-api/typeobj.rst:1801 -msgid "" -"It is an error to set both the :c:macro:`Py_TPFLAGS_MANAGED_WEAKREF` bit " -"and :c:member:`~PyTypeObject.tp_weaklistoffset`." -msgstr "" - -#: ../../c-api/typeobj.rst:1806 +#: ../../c-api/typeobj.rst:1403 msgid "" "This field is inherited by subtypes, but see the rules listed below. A " "subtype may override this offset; this means that the subtype uses a " @@ -3195,46 +2607,65 @@ msgstr "" "に :c:member:`~PyTypeObject.tp_weaklistoffset` で分かるはずなので、このことは" "問題にはならないはずです。" -#: ../../c-api/typeobj.rst:1813 +#: ../../c-api/typeobj.rst:1408 msgid "" -"If the :c:macro:`Py_TPFLAGS_MANAGED_WEAKREF` bit is set in the :c:member:" -"`~PyTypeObject.tp_flags` field, then :c:member:`~PyTypeObject." -"tp_weaklistoffset` will be set to a negative value, to indicate that it is " -"unsafe to use this field." +"When a type defined by a class statement has no :attr:`~object.__slots__` " +"declaration, and none of its base types are weakly referenceable, the type " +"is made weakly referenceable by adding a weak reference list head slot to " +"the instance layout and setting the :c:member:`~PyTypeObject." +"tp_weaklistoffset` of that slot's offset." msgstr "" +":keyword:`class` 文で定義された型に :attr:`~object.__slots__` 宣言が全くな" +"く、かつ基底タイプが弱参照可能でない場合、その型を弱参照可能にするには弱参照" +"リストの先頭を表すスロットをインスタンスデータレイアウト構造体に追加し、ス" +"ロットのオフセットを :c:member:`~PyTypeObject.tp_weaklistoffset` に設定しま" +"す。" -#: ../../c-api/typeobj.rst:1821 +#: ../../c-api/typeobj.rst:1413 msgid "" -"An optional pointer to a function that returns an :term:`iterator` for the " -"object. Its presence normally signals that the instances of this type are :" -"term:`iterable` (although sequences may be iterable without this function)." +"When a type's :attr:`__slots__` declaration contains a slot named :attr:" +"`__weakref__`, that slot becomes the weak reference list head for instances " +"of the type, and the slot's offset is stored in the type's :c:member:" +"`~PyTypeObject.tp_weaklistoffset`." msgstr "" -"オプションの変数で、そのオブジェクトの :term:`イテレータ ` を返す関" -"数へのポインタです。この値が存在することは、通常この型のインスタンスが :term:" -"`イテレート可能 ` であることを示しています (しかし、シーケンスはこ" -"の関数がなくてもイテレート可能です)。" - -#: ../../c-api/typeobj.rst:1825 -msgid "This function has the same signature as :c:func:`PyObject_GetIter`::" -msgstr "この関数は :c:func:`PyObject_GetIter` と同じシグネチャを持っています::" +"型の :attr:`__slots__` の宣言に :attr:`__weakref__` という名前のスロットが含" +"まれているとき、スロットはその型のインスタンスにおける弱参照リストの先頭を表" +"すスロットになり、スロットのオフセットが型の :c:member:`~PyTypeObject." +"tp_weaklistoffset` に入ります。" -#: ../../c-api/typeobj.rst:1827 -msgid "PyObject *tp_iter(PyObject *self);" +#: ../../c-api/typeobj.rst:1418 +msgid "" +"When a type's :attr:`__slots__` declaration does not contain a slot named :" +"attr:`__weakref__`, the type inherits its :c:member:`~PyTypeObject." +"tp_weaklistoffset` from its base type." msgstr "" +"型の :attr:`__slots__` 宣言が :attr:`__weakref__` という名前のスロットを含ん" +"でいないとき、その型は基底タイプから :c:member:`~PyTypeObject." +"tp_weaklistoffset` を継承します。" -#: ../../c-api/typeobj.rst:1836 +#: ../../c-api/typeobj.rst:1425 msgid "" -"An optional pointer to a function that returns the next item in an :term:" -"`iterator`. The signature is::" +"An optional pointer to a function that returns an iterator for the object. " +"Its presence normally signals that the instances of this type are iterable " +"(although sequences may be iterable without this function)." msgstr "" -"オプションのポインタで、:term:`イテレーター ` の次の要素を返す関数" -"を指します。シグネチャは次の通りです::" +"オプションの変数で、そのオブジェクトのイテレータを返す関数へのポインタです。" +"この値が存在することは、通常この型のインスタンスがイテレート可能であることを" +"示しています (しかし、シーケンスはこの関数がなくてもイテレート可能です)。" -#: ../../c-api/typeobj.rst:1839 -msgid "PyObject *tp_iternext(PyObject *self);" +#: ../../c-api/typeobj.rst:1429 +msgid "This function has the same signature as :c:func:`PyObject_GetIter`::" +msgstr "この関数は :c:func:`PyObject_GetIter` と同じシグネチャを持っています::" + +#: ../../c-api/typeobj.rst:1440 +msgid "" +"An optional pointer to a function that returns the next item in an iterator. " +"The signature is::" msgstr "" +"オプションのポインタで、イテレーターの次の要素を返す関数を指します。シグネ" +"チャは次の通りです::" -#: ../../c-api/typeobj.rst:1841 +#: ../../c-api/typeobj.rst:1445 msgid "" "When the iterator is exhausted, it must return ``NULL``; a :exc:" "`StopIteration` exception may or may not be set. When another error occurs, " @@ -3246,7 +2677,7 @@ msgstr "" "が発生したときも、 ``NULL`` を返さなければなりません。このフィールドがある" "と、この型のインスタンスがイテレータであることを示します。" -#: ../../c-api/typeobj.rst:1846 +#: ../../c-api/typeobj.rst:1450 msgid "" "Iterator types should also define the :c:member:`~PyTypeObject.tp_iter` " "function, and that function should return the iterator instance itself (not " @@ -3256,11 +2687,11 @@ msgstr "" "ばならず、その関数は (新たなイテレータインスタンスではなく) イテレータインス" "タンス自体を返さねばなりません。" -#: ../../c-api/typeobj.rst:1850 +#: ../../c-api/typeobj.rst:1454 msgid "This function has the same signature as :c:func:`PyIter_Next`." msgstr "この関数のシグネチャは :c:func:`PyIter_Next` と同じです。" -#: ../../c-api/typeobj.rst:1859 +#: ../../c-api/typeobj.rst:1463 msgid "" "An optional pointer to a static ``NULL``-terminated array of :c:type:" "`PyMethodDef` structures, declaring regular methods of this type." @@ -3269,7 +2700,7 @@ msgstr "" "type:`PyMethodDef` 構造体からなる、 ``NULL`` で終端された静的な配列を指しま" "す。" -#: ../../c-api/typeobj.rst:1862 +#: ../../c-api/typeobj.rst:1466 msgid "" "For each entry in the array, an entry is added to the type's dictionary " "(see :c:member:`~PyTypeObject.tp_dict` below) containing a method descriptor." @@ -3277,7 +2708,7 @@ msgstr "" "配列の各要素ごとに、メソッドデスクリプタの入った、要素が型の辞書 (下記の :c:" "member:`~PyTypeObject.tp_dict` 参照) に追加されます。" -#: ../../c-api/typeobj.rst:1867 +#: ../../c-api/typeobj.rst:1471 msgid "" "This field is not inherited by subtypes (methods are inherited through a " "different mechanism)." @@ -3285,7 +2716,7 @@ msgstr "" "サブタイプはこのフィールドを継承しません (メソッドは別個のメカニズムで継承さ" "れています)。" -#: ../../c-api/typeobj.rst:1873 +#: ../../c-api/typeobj.rst:1477 msgid "" "An optional pointer to a static ``NULL``-terminated array of :c:type:" "`PyMemberDef` structures, declaring regular data members (fields or slots) " @@ -3295,7 +2726,7 @@ msgstr "" "ロット) を宣言している :c:type:`PyMemberDef` 構造体からなる、 ``NULL`` で終端" "された静的な配列を指します。" -#: ../../c-api/typeobj.rst:1877 +#: ../../c-api/typeobj.rst:1481 msgid "" "For each entry in the array, an entry is added to the type's dictionary " "(see :c:member:`~PyTypeObject.tp_dict` below) containing a member descriptor." @@ -3303,7 +2734,7 @@ msgstr "" "配列の各要素ごとに、メンバデスクリプタの入った要素が型の辞書 (下記の :c:" "member:`~PyTypeObject.tp_dict` 参照) に追加されます。" -#: ../../c-api/typeobj.rst:1882 +#: ../../c-api/typeobj.rst:1486 msgid "" "This field is not inherited by subtypes (members are inherited through a " "different mechanism)." @@ -3311,7 +2742,7 @@ msgstr "" "サブタイプはこのフィールドを継承しません (メンバは別個のメカニズムで継承され" "ています)。" -#: ../../c-api/typeobj.rst:1888 +#: ../../c-api/typeobj.rst:1492 msgid "" "An optional pointer to a static ``NULL``-terminated array of :c:type:" "`PyGetSetDef` structures, declaring computed attributes of instances of this " @@ -3321,7 +2752,7 @@ msgstr "" "ている :c:type:`PyGetSetDef` 構造体からなる、 ``NULL`` で終端された静的な配列" "を指します。" -#: ../../c-api/typeobj.rst:1891 +#: ../../c-api/typeobj.rst:1495 msgid "" "For each entry in the array, an entry is added to the type's dictionary " "(see :c:member:`~PyTypeObject.tp_dict` below) containing a getset descriptor." @@ -3329,7 +2760,7 @@ msgstr "" "配列の各要素ごとに、 getter/setter デスクリプタの入った、要素が型の辞書 (下記" "の :c:member:`~PyTypeObject.tp_dict` 参照) に追加されます。" -#: ../../c-api/typeobj.rst:1896 +#: ../../c-api/typeobj.rst:1500 msgid "" "This field is not inherited by subtypes (computed attributes are inherited " "through a different mechanism)." @@ -3337,7 +2768,7 @@ msgstr "" "サブタイプはこのフィールドを継承しません (算出属性は別個のメカニズムで継承さ" "れています)。" -#: ../../c-api/typeobj.rst:1902 +#: ../../c-api/typeobj.rst:1506 msgid "" "An optional pointer to a base type from which type properties are " "inherited. At this level, only single inheritance is supported; multiple " @@ -3349,7 +2780,7 @@ msgstr "" "います; 多重継承はメタタイプの呼び出しによる動的な型オブジェクトの生成を必要" "とします。" -#: ../../c-api/typeobj.rst:1910 +#: ../../c-api/typeobj.rst:1514 msgid "" "Slot initialization is subject to the rules of initializing globals. C99 " "requires the initializers to be \"address constants\". Function designators " @@ -3357,25 +2788,25 @@ msgid "" "valid C99 address constants." msgstr "" -#: ../../c-api/typeobj.rst:1915 +#: ../../c-api/typeobj.rst:1519 msgid "" "However, the unary '&' operator applied to a non-static variable like :c:" -"data:`PyBaseObject_Type` is not required to produce an address constant. " +"func:`PyBaseObject_Type` is not required to produce an address constant. " "Compilers may support this (gcc does), MSVC does not. Both compilers are " "strictly standard conforming in this particular behavior." msgstr "" -#: ../../c-api/typeobj.rst:1921 +#: ../../c-api/typeobj.rst:1525 msgid "" "Consequently, :c:member:`~PyTypeObject.tp_base` should be set in the " "extension module's init function." msgstr "" -#: ../../c-api/typeobj.rst:1926 +#: ../../c-api/typeobj.rst:1530 msgid "This field is not inherited by subtypes (obviously)." msgstr "(当たり前ですが) サブタイプはこのフィールドを継承しません。" -#: ../../c-api/typeobj.rst:1930 +#: ../../c-api/typeobj.rst:1534 msgid "" "This field defaults to ``&PyBaseObject_Type`` (which to Python programmers " "is known as the type :class:`object`)." @@ -3383,36 +2814,26 @@ msgstr "" "このフィールドのデフォルト値は (Python プログラマは :class:`object` 型として" "知っている) ``&PyBaseObject_Type`` になります。" -#: ../../c-api/typeobj.rst:1936 +#: ../../c-api/typeobj.rst:1540 msgid "The type's dictionary is stored here by :c:func:`PyType_Ready`." msgstr "" "型の辞書は :c:func:`PyType_Ready` によってこのフィールドに収められます。" -#: ../../c-api/typeobj.rst:1938 +#: ../../c-api/typeobj.rst:1542 msgid "" "This field should normally be initialized to ``NULL`` before PyType_Ready is " "called; it may also be initialized to a dictionary containing initial " "attributes for the type. Once :c:func:`PyType_Ready` has initialized the " "type, extra attributes for the type may be added to this dictionary only if " -"they don't correspond to overloaded operations (like :meth:`~object." -"__add__`). Once initialization for the type has finished, this field should " -"be treated as read-only." -msgstr "" - -#: ../../c-api/typeobj.rst:1946 -msgid "" -"Some types may not store their dictionary in this slot. Use :c:func:" -"`PyType_GetDict` to retrieve the dictionary for an arbitrary type." -msgstr "" - -#: ../../c-api/typeobj.rst:1952 -msgid "" -"Internals detail: For static builtin types, this is always ``NULL``. " -"Instead, the dict for such types is stored on ``PyInterpreterState``. Use :c:" -"func:`PyType_GetDict` to get the dict for an arbitrary type." +"they don't correspond to overloaded operations (like :meth:`__add__`)." msgstr "" +"このフィールドは通常、 :c:func:`PyType_Ready` を呼び出す前に ``NULL`` に初期" +"化しておかなければなりません; あるいは、型の初期属性の入った辞書で初期化して" +"おいてもかまいません。 :c:func:`PyType_Ready` が型をひとたび初期化すると、型" +"の新たな属性をこの辞書に追加できるのは、属性が (:meth:`__add__` のような) " +"オーバロード用演算でないときだけです。" -#: ../../c-api/typeobj.rst:1958 +#: ../../c-api/typeobj.rst:1550 msgid "" "This field is not inherited by subtypes (though the attributes defined in " "here are inherited through a different mechanism)." @@ -3420,13 +2841,13 @@ msgstr "" "サブタイプはこのフィールドを継承しません (が、この辞書内で定義されている属性" "は異なるメカニズムで継承されます)。" -#: ../../c-api/typeobj.rst:1963 +#: ../../c-api/typeobj.rst:1555 msgid "" "If this field is ``NULL``, :c:func:`PyType_Ready` will assign a new " "dictionary to it." msgstr "" -#: ../../c-api/typeobj.rst:1968 +#: ../../c-api/typeobj.rst:1560 msgid "" "It is not safe to use :c:func:`PyDict_SetItem` on or otherwise modify :c:" "member:`~PyTypeObject.tp_dict` with the dictionary C-API." @@ -3434,42 +2855,28 @@ msgstr "" ":c:member:`~PyTypeObject.tp_dict` に :c:func:`PyDict_SetItem` を使ったり、辞" "書 C-API で編集するのは安全ではありません。" -#: ../../c-api/typeobj.rst:1974 +#: ../../c-api/typeobj.rst:1566 msgid "An optional pointer to a \"descriptor get\" function." msgstr "オプションのポインタで、デスクリプタの get 関数を指します。" -#: ../../c-api/typeobj.rst:1976 ../../c-api/typeobj.rst:1992 -#: ../../c-api/typeobj.rst:2056 ../../c-api/typeobj.rst:2086 -#: ../../c-api/typeobj.rst:2109 +#: ../../c-api/typeobj.rst:1568 ../../c-api/typeobj.rst:1584 +#: ../../c-api/typeobj.rst:1666 ../../c-api/typeobj.rst:1696 +#: ../../c-api/typeobj.rst:1720 msgid "The function signature is::" msgstr "関数のシグネチャは次のとおりです ::" -#: ../../c-api/typeobj.rst:1978 -msgid "PyObject * tp_descr_get(PyObject *self, PyObject *obj, PyObject *type);" -msgstr "" - -#: ../../c-api/typeobj.rst:1989 +#: ../../c-api/typeobj.rst:1581 msgid "" "An optional pointer to a function for setting and deleting a descriptor's " "value." msgstr "" "オプションのポインタで、デスクリプタの値の設定と削除を行う関数を指します。" -#: ../../c-api/typeobj.rst:1994 -msgid "int tp_descr_set(PyObject *self, PyObject *obj, PyObject *value);" -msgstr "" - -#: ../../c-api/typeobj.rst:1996 +#: ../../c-api/typeobj.rst:1588 msgid "The *value* argument is set to ``NULL`` to delete the value." msgstr "値を削除するには、*value* 引数に ``NULL`` を設定します。" -#: ../../c-api/typeobj.rst:2007 -msgid "" -"While this field is still supported, :c:macro:`Py_TPFLAGS_MANAGED_DICT` " -"should be used instead, if at all possible." -msgstr "" - -#: ../../c-api/typeobj.rst:2010 +#: ../../c-api/typeobj.rst:1599 msgid "" "If the instances of this type have a dictionary containing instance " "variables, this field is non-zero and contains the offset in the instances " @@ -3481,7 +2888,7 @@ msgstr "" "オフセットが入ります; このオフセット値は :c:func:`PyObject_GenericGetAttr` が" "使います。" -#: ../../c-api/typeobj.rst:2015 +#: ../../c-api/typeobj.rst:1604 msgid "" "Do not confuse this field with :c:member:`~PyTypeObject.tp_dict`; that is " "the dictionary for attributes of the type object itself." @@ -3489,73 +2896,136 @@ msgstr "" "このフィールドを :c:member:`~PyTypeObject.tp_dict` と混同しないようにしてくだ" "さい; これは型オブジェクト自身の属性の辞書です。" -#: ../../c-api/typeobj.rst:2018 -msgid "" -"The value specifies the offset of the dictionary from the start of the " -"instance structure." -msgstr "" - -#: ../../c-api/typeobj.rst:2020 +#: ../../c-api/typeobj.rst:1607 +msgid "" +"If the value of this field is greater than zero, it specifies the offset " +"from the start of the instance structure. If the value is less than zero, " +"it specifies the offset from the *end* of the instance structure. A " +"negative offset is more expensive to use, and should only be used when the " +"instance structure contains a variable-length part. This is used for " +"example to add an instance variable dictionary to subtypes of :class:`str` " +"or :class:`tuple`. Note that the :c:member:`~PyTypeObject.tp_basicsize` " +"field should account for the dictionary added to the end in that case, even " +"though the dictionary is not included in the basic object layout. On a " +"system with a pointer size of 4 bytes, :c:member:`~PyTypeObject." +"tp_dictoffset` should be set to ``-4`` to indicate that the dictionary is at " +"the very end of the structure." +msgstr "" +"このフィールドの値がゼロより大きければ、値はインスタンス構造体の先頭からの オ" +"フセットを表します。値がゼロより小さければ、インスタンス構造体の *末尾* から" +"のオフセットを表します。負のオフセットを使うコストは比較的高くつくので、 イン" +"スタンス構造体に可変長部分があるときのみ使うべきです。例えば、 :class:`str` " +"や :class:`tuple` のサブタイプにインスタンス変数の辞書を追加する場合には、負" +"のオフセットを使います。この場合、たとえ辞書が基本のオブジェクトレイアウトに" +"含まれていなくても、 :c:member:`~PyTypeObject.tp_basicsize` フィールドは追加" +"された辞書を考慮にいれなければならないことに注意してください。ポインタサイズ" +"が 4 バイトのシステムでは、 構造体の最後尾に辞書が宣言されていることを示す場" +"合、 :c:member:`~PyTypeObject.tp_dictoffset` を ``-4`` にしなければなりませ" +"ん。" + +#: ../../c-api/typeobj.rst:1619 +msgid "" +"The real dictionary offset in an instance can be computed from a negative :c:" +"member:`~PyTypeObject.tp_dictoffset` as follows::" +msgstr "" +"負の :c:member:`~PyTypeObject.tp_dictoffset` から、インスタンスでの実際のオフ" +"セットを計算するには以下のようにします::" + +#: ../../c-api/typeobj.rst:1626 +msgid "" +"where :c:member:`~PyTypeObject.tp_basicsize`, :c:member:`~PyTypeObject." +"tp_itemsize` and :c:member:`~PyTypeObject.tp_dictoffset` are taken from the " +"type object, and :attr:`ob_size` is taken from the instance. The absolute " +"value is taken because ints use the sign of :attr:`ob_size` to store the " +"sign of the number. (There's never a need to do this calculation yourself; " +"it is done for you by :c:func:`_PyObject_GetDictPtr`.)" +msgstr "" +"ここで、 :c:member:`~PyTypeObject.tp_basicsize`、 :c:member:`~PyTypeObject." +"tp_itemsize` および :c:member:`~PyTypeObject.tp_dictoffset` は型オブジェクト" +"から取り出され、 :attr:`ob_size` はインスタンスから取り出されます。\n" +"絶対値を取っているのは、整数は符号を記憶するのに :attr:`ob_size` の符号を使う" +"ためです。\n" +"(この計算を自分で行う必要はまったくありません; 計算は :c:func:" +"`_PyObject_GetDictPtr` がやってくれます。)" + +#: ../../c-api/typeobj.rst:1634 msgid "" -"The :c:member:`~PyTypeObject.tp_dictoffset` should be regarded as write-" -"only. To get the pointer to the dictionary call :c:func:" -"`PyObject_GenericGetDict`. Calling :c:func:`PyObject_GenericGetDict` may " -"need to allocate memory for the dictionary, so it is may be more efficient " -"to call :c:func:`PyObject_GetAttr` when accessing an attribute on the object." +"This field is inherited by subtypes, but see the rules listed below. A " +"subtype may override this offset; this means that the subtype instances " +"store the dictionary at a difference offset than the base type. Since the " +"dictionary is always found via :c:member:`~PyTypeObject.tp_dictoffset`, this " +"should not be a problem." msgstr "" +"このフィールドはサブタイプに継承されますが、以下の規則を読んでください。サブ" +"タイプはこのオフセット値をオーバライドすることがあります; 従って、サブタイプ" +"では辞書のオフセットが基底タイプとは異なる場合があります。辞書のオフセットは" +"常に :c:member:`~PyTypeObject.tp_dictoffset` で分かるはずなので、このことは問" +"題にはならないはずです。" -#: ../../c-api/typeobj.rst:2026 +#: ../../c-api/typeobj.rst:1639 msgid "" -"It is an error to set both the :c:macro:`Py_TPFLAGS_MANAGED_DICT` bit and :c:" -"member:`~PyTypeObject.tp_dictoffset`." +"When a type defined by a class statement has no :attr:`~object.__slots__` " +"declaration, and none of its base types has an instance variable dictionary, " +"a dictionary slot is added to the instance layout and the :c:member:" +"`~PyTypeObject.tp_dictoffset` is set to that slot's offset." msgstr "" +":keyword:`class` 文で定義された型に :attr:`~object.__slots__` 宣言がなく、か" +"つ基底タイプの全てにインスタンス変数辞書がない場合、辞書のスロットをインスタ" +"ンスデータレイアウト構造体に追加し、スロットのオフセットを :c:member:" +"`~PyTypeObject.tp_dictoffset` に設定します。" -#: ../../c-api/typeobj.rst:2031 +#: ../../c-api/typeobj.rst:1644 msgid "" -"This field is inherited by subtypes. A subtype should not override this " -"offset; doing so could be unsafe, if C code tries to access the dictionary " -"at the previous offset. To properly support inheritance, use :c:macro:" -"`Py_TPFLAGS_MANAGED_DICT`." +"When a type defined by a class statement has a :attr:`__slots__` " +"declaration, the type inherits its :c:member:`~PyTypeObject.tp_dictoffset` " +"from its base type." msgstr "" +":keyword:`class` 文で定義された型に :attr:`__slots__` 宣言がある場合、この型" +"は基底タイプから :c:member:`~PyTypeObject.tp_dictoffset` を継承します。" -#: ../../c-api/typeobj.rst:2038 +#: ../../c-api/typeobj.rst:1647 msgid "" -"This slot has no default. For :ref:`static types `, if the " -"field is ``NULL`` then no :attr:`~object.__dict__` gets created for " -"instances." +"(Adding a slot named :attr:`~object.__dict__` to the :attr:`__slots__` " +"declaration does not have the expected effect, it just causes confusion. " +"Maybe this should be added as a feature just like :attr:`__weakref__` " +"though.)" msgstr "" +"(:attr:`~object.__dict__` という名前のスロットを :attr:`__slots__` 宣言に追加" +"しても、期待どおりの効果は得られず、単に混乱を招くだけになります。とはいえ、" +"これは将来 :attr:`__weakref__` のように追加されるはずです。)" -#: ../../c-api/typeobj.rst:2041 +#: ../../c-api/typeobj.rst:1653 msgid "" -"If the :c:macro:`Py_TPFLAGS_MANAGED_DICT` bit is set in the :c:member:" -"`~PyTypeObject.tp_flags` field, then :c:member:`~PyTypeObject.tp_dictoffset` " -"will be set to ``-1``, to indicate that it is unsafe to use this field." +"This slot has no default. For static types, if the field is ``NULL`` then " +"no :attr:`__dict__` gets created for instances." msgstr "" -#: ../../c-api/typeobj.rst:2049 +#: ../../c-api/typeobj.rst:1659 msgid "An optional pointer to an instance initialization function." msgstr "オプションのポインタで、インスタンス初期化関数を指します。" -#: ../../c-api/typeobj.rst:2051 +#: ../../c-api/typeobj.rst:1661 msgid "" -"This function corresponds to the :meth:`~object.__init__` method of " -"classes. Like :meth:`!__init__`, it is possible to create an instance " -"without calling :meth:`!__init__`, and it is possible to reinitialize an " -"instance by calling its :meth:`!__init__` method again." -msgstr "" - -#: ../../c-api/typeobj.rst:2058 -msgid "int tp_init(PyObject *self, PyObject *args, PyObject *kwds);" +"This function corresponds to the :meth:`__init__` method of classes. Like :" +"meth:`__init__`, it is possible to create an instance without calling :meth:" +"`__init__`, and it is possible to reinitialize an instance by calling its :" +"meth:`__init__` method again." msgstr "" +"この関数はクラスにおける :meth:`__init__` メソッドに対応します。 :meth:" +"`__init__` と同様、 :meth:`__init__` を呼び出さずにインスタンスを作成できま" +"す。また、 :meth:`__init__` を再度呼び出してインスタンスの再初期化もできま" +"す。" -#: ../../c-api/typeobj.rst:2060 +#: ../../c-api/typeobj.rst:1670 msgid "" "The self argument is the instance to be initialized; the *args* and *kwds* " "arguments represent positional and keyword arguments of the call to :meth:" -"`~object.__init__`." +"`__init__`." msgstr "" +"*self* 引数は初期化するインスタンスです; *args* および *kwds* 引数は、 :meth:" +"`__init__` を呼び出す際の位置引数およびキーワード引数です。" -#: ../../c-api/typeobj.rst:2064 +#: ../../c-api/typeobj.rst:1674 msgid "" "The :c:member:`~PyTypeObject.tp_init` function, if not ``NULL``, is called " "when an instance is created normally by calling its type, after the type's :" @@ -3574,53 +3044,43 @@ msgstr "" "`~PyTypeObject.tp_new` が元の型のサブタイプのインスタンスを返す場合、サブタイ" "プの :c:member:`~PyTypeObject.tp_init` が呼び出されます。" -#: ../../c-api/typeobj.rst:2071 +#: ../../c-api/typeobj.rst:1681 msgid "Returns ``0`` on success, ``-1`` and sets an exception on error." msgstr "" "成功のときには ``0`` を、エラー時には例外をセットして ``-1`` を返します。" -#: ../../c-api/typeobj.rst:2079 -msgid "" -"For :ref:`static types ` this field does not have a default." +#: ../../c-api/typeobj.rst:1689 +msgid "For static types this field does not have a default." msgstr "" -#: ../../c-api/typeobj.rst:2084 +#: ../../c-api/typeobj.rst:1694 msgid "An optional pointer to an instance allocation function." msgstr "オプションのポインタで、インスタンスのメモリ確保関数を指します。" -#: ../../c-api/typeobj.rst:2088 -msgid "PyObject *tp_alloc(PyTypeObject *self, Py_ssize_t nitems);" -msgstr "" - -#: ../../c-api/typeobj.rst:2092 +#: ../../c-api/typeobj.rst:1702 msgid "" -"Static subtypes inherit this slot, which will be :c:func:" -"`PyType_GenericAlloc` if inherited from :class:`object`." +"This field is inherited by static subtypes, but not by dynamic subtypes " +"(subtypes created by a class statement)." msgstr "" -#: ../../c-api/typeobj.rst:2095 ../../c-api/typeobj.rst:2162 -msgid ":ref:`Heap subtypes ` do not inherit this slot." -msgstr "" - -#: ../../c-api/typeobj.rst:2099 +#: ../../c-api/typeobj.rst:1707 msgid "" -"For heap subtypes, this field is always set to :c:func:`PyType_GenericAlloc`." +"For dynamic subtypes, this field is always set to :c:func:" +"`PyType_GenericAlloc`, to force a standard heap allocation strategy." msgstr "" -#: ../../c-api/typeobj.rst:2102 ../../c-api/typeobj.rst:2170 -msgid "For static subtypes, this slot is inherited (see above)." +#: ../../c-api/typeobj.rst:1711 +msgid "" +"For static subtypes, :c:type:`PyBaseObject_Type` uses :c:func:" +"`PyType_GenericAlloc`. That is the recommended value for all statically " +"defined types." msgstr "" -#: ../../c-api/typeobj.rst:2107 +#: ../../c-api/typeobj.rst:1718 msgid "An optional pointer to an instance creation function." msgstr "オプションのポインタで、インスタンス生成関数を指します。" -#: ../../c-api/typeobj.rst:2111 -msgid "" -"PyObject *tp_new(PyTypeObject *subtype, PyObject *args, PyObject *kwds);" -msgstr "" - -#: ../../c-api/typeobj.rst:2113 +#: ../../c-api/typeobj.rst:1724 msgid "" "The *subtype* argument is the type of the object being created; the *args* " "and *kwds* arguments represent positional and keyword arguments of the call " @@ -3633,7 +3093,7 @@ msgstr "" "`~PyTypeObject.tp_new` 関数を呼び出すときに使う型と同じである必要はないことに" "注意してください; その型の (無関係ではない) サブタイプのこともあります。" -#: ../../c-api/typeobj.rst:2119 +#: ../../c-api/typeobj.rst:1730 msgid "" "The :c:member:`~PyTypeObject.tp_new` function should call ``subtype-" ">tp_alloc(subtype, nitems)`` to allocate space for the object, and then do " @@ -3652,131 +3112,114 @@ msgstr "" "tp_new` で行い、一方、変更可能な型ではほとんどの初期化を :c:member:" "`~PyTypeObject.tp_init` に回すべきです。" -#: ../../c-api/typeobj.rst:2127 -msgid "" -"Set the :c:macro:`Py_TPFLAGS_DISALLOW_INSTANTIATION` flag to disallow " -"creating instances of the type in Python." -msgstr "" - -#: ../../c-api/typeobj.rst:2132 +#: ../../c-api/typeobj.rst:1740 msgid "" -"This field is inherited by subtypes, except it is not inherited by :ref:" -"`static types ` whose :c:member:`~PyTypeObject.tp_base` is " -"``NULL`` or ``&PyBaseObject_Type``." +"This field is inherited by subtypes, except it is not inherited by static " +"types whose :c:member:`~PyTypeObject.tp_base` is ``NULL`` or " +"``&PyBaseObject_Type``." msgstr "" "サブタイプはこのフィールドを継承します。例外として、 :c:member:" -"`~PyTypeObject.tp_base` が ``NULL`` か ``&PyBaseObject_Type`` になっている :" -"ref:`静的な型 ` では継承しません。" +"`~PyTypeObject.tp_base` が ``NULL`` か ``&PyBaseObject_Type`` になっている静" +"的な型では継承しません。" -#: ../../c-api/typeobj.rst:2138 +#: ../../c-api/typeobj.rst:1745 msgid "" -"For :ref:`static types ` this field has no default. This means " -"if the slot is defined as ``NULL``, the type cannot be called to create new " -"instances; presumably there is some other way to create instances, like a " -"factory function." +"For static types this field has no default. This means if the slot is " +"defined as ``NULL``, the type cannot be called to create new instances; " +"presumably there is some other way to create instances, like a factory " +"function." msgstr "" -#: ../../c-api/typeobj.rst:2146 +#: ../../c-api/typeobj.rst:1753 msgid "" "An optional pointer to an instance deallocation function. Its signature is::" msgstr "" "オプションのポインタで、インスタンスのメモリ解放関数を指します。シグネチャは" "以下の通りです::" -#: ../../c-api/typeobj.rst:2148 -msgid "void tp_free(void *self);" -msgstr "" +#: ../../c-api/typeobj.rst:1757 +msgid "" +"An initializer that is compatible with this signature is :c:func:" +"`PyObject_Free`." +msgstr "このシグネチャと互換性のある初期化子は :c:func:`PyObject_Free` です。" -#: ../../c-api/typeobj.rst:2150 +#: ../../c-api/typeobj.rst:1761 msgid "" -"This function must free the memory allocated by :c:member:`~PyTypeObject." -"tp_alloc`." +"This field is inherited by static subtypes, but not by dynamic subtypes " +"(subtypes created by a class statement)" msgstr "" -#: ../../c-api/typeobj.rst:2155 +#: ../../c-api/typeobj.rst:1766 msgid "" -"Static subtypes inherit this slot, which will be :c:func:`PyObject_Free` if " -"inherited from :class:`object`. Exception: If the type supports garbage " -"collection (i.e., the :c:macro:`Py_TPFLAGS_HAVE_GC` flag is set in :c:member:" -"`~PyTypeObject.tp_flags`) and it would inherit :c:func:`PyObject_Free`, then " -"this slot is not inherited but instead defaults to :c:func:`PyObject_GC_Del`." +"In dynamic subtypes, this field is set to a deallocator suitable to match :c:" +"func:`PyType_GenericAlloc` and the value of the :const:`Py_TPFLAGS_HAVE_GC` " +"flag bit." msgstr "" -#: ../../c-api/typeobj.rst:2166 -msgid "" -"For :ref:`heap subtypes `, this slot defaults to a deallocator " -"suitable to match :c:func:`PyType_GenericAlloc` and the value of the :c:" -"macro:`Py_TPFLAGS_HAVE_GC` flag." +#: ../../c-api/typeobj.rst:1770 +msgid "For static subtypes, :c:type:`PyBaseObject_Type` uses PyObject_Del." msgstr "" -#: ../../c-api/typeobj.rst:2175 +#: ../../c-api/typeobj.rst:1775 msgid "An optional pointer to a function called by the garbage collector." msgstr "" "オプションのポインタで、ガベージコレクタから呼び出される関数を指します。" -#: ../../c-api/typeobj.rst:2177 +#: ../../c-api/typeobj.rst:1777 msgid "" "The garbage collector needs to know whether a particular object is " "collectible or not. Normally, it is sufficient to look at the object's " -"type's :c:member:`~PyTypeObject.tp_flags` field, and check the :c:macro:" +"type's :c:member:`~PyTypeObject.tp_flags` field, and check the :const:" "`Py_TPFLAGS_HAVE_GC` flag bit. But some types have a mixture of statically " "and dynamically allocated instances, and the statically allocated instances " "are not collectible. Such types should define this function; it should " "return ``1`` for a collectible instance, and ``0`` for a non-collectible " "instance. The signature is::" msgstr "" +"ガベージコレクタは、オブジェクトを回収して良いかどうかを知る必要があります。" +"通常は、オブジェクトの型の :c:member:`~PyTypeObject.tp_flags` フィールドを見" +"て、 :const:`Py_TPFLAGS_HAVE_GC` フラグビットを調べるだけで十分です。しかし、" +"ある型では静的にメモリ確保されたインスタンスと動的にメモリ確保されたインスタ" +"ンスが混じっていて、静的にメモリ確保されたインスタンスは回収できません。こう" +"した型では、関数を定義しなければなりません; 関数はインスタンスが回収可能の場" +"合には ``1`` を、回収不能の場合には ``0`` を返さねばなりません。シグネチャ" +"は::" -#: ../../c-api/typeobj.rst:2185 -msgid "int tp_is_gc(PyObject *self);" -msgstr "" - -#: ../../c-api/typeobj.rst:2187 +#: ../../c-api/typeobj.rst:1787 msgid "" "(The only example of this are types themselves. The metatype, :c:data:" -"`PyType_Type`, defines this function to distinguish between statically and :" -"ref:`dynamically allocated types `.)" +"`PyType_Type`, defines this function to distinguish between statically and " +"dynamically allocated types.)" msgstr "" "(上記のような型の例は、型オブジェクト自体です。メタタイプ :c:data:" -"`PyType_Type` は、型のメモリ確保が静的か :ref:`動的 ` かを区別す" -"るためにこの関数を定義しています。)" +"`PyType_Type` は、型のメモリ確保が静的か動的かを区別するためにこの関数を定義" +"しています。)" -#: ../../c-api/typeobj.rst:2197 +#: ../../c-api/typeobj.rst:1797 msgid "" -"This slot has no default. If this field is ``NULL``, :c:macro:" +"This slot has no default. If this field is ``NULL``, :const:" "`Py_TPFLAGS_HAVE_GC` is used as the functional equivalent." msgstr "" -#: ../../c-api/typeobj.rst:2203 +#: ../../c-api/typeobj.rst:1803 msgid "Tuple of base types." msgstr "基底型からなるタプルです。" -#: ../../c-api/typeobj.rst:2205 ../../c-api/typeobj.rst:2229 -msgid "" -"This field should be set to ``NULL`` and treated as read-only. Python will " -"fill it in when the type is :c:func:`initialized `." -msgstr "" - -#: ../../c-api/typeobj.rst:2208 -msgid "" -"For dynamically created classes, the ``Py_tp_bases`` :c:type:`slot " -"` can be used instead of the *bases* argument of :c:func:" -"`PyType_FromSpecWithBases`. The argument form is preferred." -msgstr "" - -#: ../../c-api/typeobj.rst:2215 +#: ../../c-api/typeobj.rst:1805 msgid "" -"Multiple inheritance does not work well for statically defined types. If you " -"set ``tp_bases`` to a tuple, Python will not raise an error, but some slots " -"will only be inherited from the first base." +"This is set for types created by a class statement. It should be ``NULL`` " +"for statically defined types." msgstr "" +":keyword:`class` 文で生成されたクラスの場合このフィールドがセットされます。静" +"的に定義されている型の場合には、このフィールドは ``NULL`` になります。" -#: ../../c-api/typeobj.rst:2221 ../../c-api/typeobj.rst:2244 -#: ../../c-api/typeobj.rst:2261 ../../c-api/typeobj.rst:2278 -#: ../../c-api/typeobj.rst:2292 +#: ../../c-api/typeobj.rst:1810 ../../c-api/typeobj.rst:1831 +#: ../../c-api/typeobj.rst:1840 ../../c-api/typeobj.rst:1850 +#: ../../c-api/typeobj.rst:1864 msgid "This field is not inherited." msgstr "このフィールドは継承されません。" -#: ../../c-api/typeobj.rst:2226 +#: ../../c-api/typeobj.rst:1815 msgid "" "Tuple containing the expanded set of base types, starting with the type " "itself and ending with :class:`object`, in Method Resolution Order." @@ -3785,7 +3228,7 @@ msgstr "" "じまり、 :class:`object` で終わります。メソッド解決順序 (Method Resolution " "Order) に従って並んでいます。" -#: ../../c-api/typeobj.rst:2234 +#: ../../c-api/typeobj.rst:1821 msgid "" "This field is not inherited; it is calculated fresh by :c:func:" "`PyType_Ready`." @@ -3793,410 +3236,177 @@ msgstr "" "このフィールドは継承されません; フィールドの値は :c:func:`PyType_Ready` で毎" "回計算されます。" -#: ../../c-api/typeobj.rst:2240 +#: ../../c-api/typeobj.rst:1827 msgid "Unused. Internal use only." msgstr "未使用のフィールドです。内部でのみ利用されます。" -#: ../../c-api/typeobj.rst:2249 -msgid "" -"A collection of subclasses. Internal use only. May be an invalid pointer." -msgstr "" - -#: ../../c-api/typeobj.rst:2251 -msgid "" -"To get a list of subclasses, call the Python method :py:meth:`~type." -"__subclasses__`." -msgstr "" - -#: ../../c-api/typeobj.rst:2256 -msgid "" -"For some types, this field does not hold a valid :c:expr:`PyObject*`. The " -"type was changed to :c:expr:`void*` to indicate this." +#: ../../c-api/typeobj.rst:1836 +msgid "List of weak references to subclasses. Internal use only." msgstr "" +"サブクラスへの弱参照からなるリストです。内部で使用するためだけのものです。" -#: ../../c-api/typeobj.rst:2266 +#: ../../c-api/typeobj.rst:1845 msgid "" "Weak reference list head, for weak references to this type object. Not " "inherited. Internal use only." msgstr "この型オブジェクトに対する弱参照からなるリストの先頭です。" -#: ../../c-api/typeobj.rst:2271 -msgid "" -"Internals detail: For the static builtin types this is always ``NULL``, even " -"if weakrefs are added. Instead, the weakrefs for each are stored on " -"``PyInterpreterState``. Use the public C-API or the internal " -"``_PyObject_GET_WEAKREFS_LISTPTR()`` macro to avoid the distinction." -msgstr "" - -#: ../../c-api/typeobj.rst:2283 +#: ../../c-api/typeobj.rst:1855 msgid "" "This field is deprecated. Use :c:member:`~PyTypeObject.tp_finalize` instead." msgstr "" "このフィールドは廃止されました。:c:member:`~PyTypeObject.tp_finalize` を代わ" "りに利用してください。" -#: ../../c-api/typeobj.rst:2288 +#: ../../c-api/typeobj.rst:1860 msgid "Used to index into the method cache. Internal use only." msgstr "" "メソッドキャッシュへのインデックスとして使われます。内部使用だけのための関数" "です。" -#: ../../c-api/typeobj.rst:2297 -msgid "" -"An optional pointer to an instance finalization function. This is the C " -"implementation of the :meth:`~object.__del__` special method. Its signature " -"is::" -msgstr "" - -#: ../../c-api/typeobj.rst:2301 -msgid "void tp_finalize(PyObject *self);" -msgstr "" - -#: ../../c-api/typeobj.rst:2303 -msgid "" -"The primary purpose of finalization is to perform any non-trivial cleanup " -"that must be performed before the object is destroyed, while the object and " -"any other objects it directly or indirectly references are still in a " -"consistent state. The finalizer is allowed to execute arbitrary Python code." -msgstr "" - -#: ../../c-api/typeobj.rst:2309 -msgid "" -"Before Python automatically finalizes an object, some of the object's direct " -"or indirect referents might have themselves been automatically finalized. " -"However, none of the referents will have been automatically cleared (:c:" -"member:`~PyTypeObject.tp_clear`) yet." -msgstr "" - -#: ../../c-api/typeobj.rst:2314 -msgid "" -"Other non-finalized objects might still be using a finalized object, so the " -"finalizer must leave the object in a sane state (e.g., invariants are still " -"met)." -msgstr "" - -#: ../../c-api/typeobj.rst:2320 -msgid "" -"After Python automatically finalizes an object, Python might start " -"automatically clearing (:c:member:`~PyTypeObject.tp_clear`) the object and " -"its referents (direct and indirect). Cleared objects are not guaranteed to " -"be in a consistent state; a finalized object must be able to tolerate " -"cleared referents." -msgstr "" - -#: ../../c-api/typeobj.rst:2328 -msgid "" -"An object is not guaranteed to be automatically finalized before its " -"destructor (:c:member:`~PyTypeObject.tp_dealloc`) is called. It is " -"recommended to call :c:func:`PyObject_CallFinalizerFromDealloc` at the " -"beginning of :c:member:`!tp_dealloc` to guarantee that the object is always " -"finalized before destruction." -msgstr "" - -#: ../../c-api/typeobj.rst:2336 -msgid "" -"The :c:member:`~PyTypeObject.tp_finalize` function can be called from any " -"thread, although the :term:`GIL` will be held." -msgstr "" - -#: ../../c-api/typeobj.rst:2341 -msgid "" -"The :c:member:`!tp_finalize` function can be called during shutdown, after " -"some global variables have been deleted. See the documentation of the :meth:" -"`~object.__del__` method for details." -msgstr "" - -#: ../../c-api/typeobj.rst:2345 +#: ../../c-api/typeobj.rst:1869 msgid "" -"When Python finalizes an object, it behaves like the following algorithm:" +"An optional pointer to an instance finalization function. Its signature is::" msgstr "" +"オプションのポインタで、インスタンスの終了処理関数を指します。シグネチャは以" +"下の通りです::" -#: ../../c-api/typeobj.rst:2347 -msgid "" -"Python might mark the object as *finalized*. Currently, Python always marks " -"objects whose type supports garbage collection (i.e., the :c:macro:" -"`Py_TPFLAGS_HAVE_GC` flag is set in :c:member:`~PyTypeObject.tp_flags`) and " -"never marks other types of objects; this might change in a future version." -msgstr "" - -#: ../../c-api/typeobj.rst:2352 -msgid "" -"If the object is not marked as *finalized* and its :c:member:`!tp_finalize` " -"finalizer function is non-``NULL``, the finalizer function is called." -msgstr "" - -#: ../../c-api/typeobj.rst:2355 -msgid "" -"If the finalizer function was called and the finalizer made the object " -"reachable (i.e., there is a reference to the object and it is not a member " -"of a :term:`cyclic isolate`), then the finalizer is said to have " -"*resurrected* the object. It is unspecified whether the finalizer can also " -"resurrect the object by adding a new reference to the object that does not " -"make it reachable, i.e., the object is (still) a member of a cyclic isolate." -msgstr "" - -#: ../../c-api/typeobj.rst:2362 -msgid "" -"If the finalizer resurrected the object, the object's pending destruction is " -"canceled and the object's *finalized* mark might be removed if present. " -"Currently, Python never removes the *finalized* mark; this might change in a " -"future version." -msgstr "" - -#: ../../c-api/typeobj.rst:2367 -msgid "" -"*Automatic finalization* refers to any finalization performed by Python " -"except via calls to :c:func:`PyObject_CallFinalizer` or :c:func:" -"`PyObject_CallFinalizerFromDealloc`. No guarantees are made about when, if, " -"or how often an object is automatically finalized, except:" -msgstr "" - -#: ../../c-api/typeobj.rst:2372 -msgid "" -"Python will not automatically finalize an object if it is reachable, i.e., " -"there is a reference to it and it is not a member of a :term:`cyclic " -"isolate`." -msgstr "" - -#: ../../c-api/typeobj.rst:2375 -msgid "" -"Python will not automatically finalize an object if finalizing it would not " -"mark the object as *finalized*. Currently, this applies to objects whose " -"type does not support garbage collection, i.e., the :c:macro:" -"`Py_TPFLAGS_HAVE_GC` flag is not set. Such objects can still be manually " -"finalized by calling :c:func:`PyObject_CallFinalizer` or :c:func:" -"`PyObject_CallFinalizerFromDealloc`." -msgstr "" - -#: ../../c-api/typeobj.rst:2381 -msgid "" -"Python will not automatically finalize any two members of a :term:`cyclic " -"isolate` concurrently." -msgstr "" - -#: ../../c-api/typeobj.rst:2383 -msgid "" -"Python will not automatically finalize an object after it has automatically " -"cleared (:c:member:`~PyTypeObject.tp_clear`) the object." -msgstr "" - -#: ../../c-api/typeobj.rst:2385 -msgid "" -"If an object is a member of a :term:`cyclic isolate`, Python will not " -"automatically finalize it after automatically clearing (see :c:member:" -"`~PyTypeObject.tp_clear`) any other member." -msgstr "" - -#: ../../c-api/typeobj.rst:2388 -msgid "" -"Python will automatically finalize every member of a :term:`cyclic isolate` " -"before it automatically clears (see :c:member:`~PyTypeObject.tp_clear`) any " -"of them." -msgstr "" - -#: ../../c-api/typeobj.rst:2391 -msgid "" -"If Python is going to automatically clear an object (:c:member:" -"`~PyTypeObject.tp_clear`), it will automatically finalize the object first." -msgstr "" - -#: ../../c-api/typeobj.rst:2395 -msgid "" -"Python currently only automatically finalizes objects that are members of a :" -"term:`cyclic isolate`, but future versions might finalize objects regularly " -"before their destruction." -msgstr "" - -#: ../../c-api/typeobj.rst:2399 -msgid "" -"To manually finalize an object, do not call this function directly; call :c:" -"func:`PyObject_CallFinalizer` or :c:func:`PyObject_CallFinalizerFromDealloc` " -"instead." -msgstr "" - -#: ../../c-api/typeobj.rst:2403 -msgid "" -":c:member:`~PyTypeObject.tp_finalize` should leave the current exception " -"status unchanged. The recommended way to write a non-trivial finalizer is " -"to back up the exception at the beginning by calling :c:func:" -"`PyErr_GetRaisedException` and restore the exception at the end by calling :" -"c:func:`PyErr_SetRaisedException`. If an exception is encountered in the " -"middle of the finalizer, log and clear it with :c:func:" -"`PyErr_WriteUnraisable` or :c:func:`PyErr_FormatUnraisable`. For example::" -msgstr "" - -#: ../../c-api/typeobj.rst:2412 -msgid "" -"static void\n" -"foo_finalize(PyObject *self)\n" -"{\n" -" // Save the current exception, if any.\n" -" PyObject *exc = PyErr_GetRaisedException();\n" -"\n" -" // ...\n" -"\n" -" if (do_something_that_might_raise() != success_indicator) {\n" -" PyErr_WriteUnraisable(self);\n" -" goto done;\n" -" }\n" -"\n" -"done:\n" -" // Restore the saved exception. This silently discards any exception\n" -" // raised above, so be sure to call PyErr_WriteUnraisable first if\n" -" // necessary.\n" -" PyErr_SetRaisedException(exc);\n" -"}" -msgstr "" - -#: ../../c-api/typeobj.rst:2440 -msgid "" -"Before version 3.8 it was necessary to set the :c:macro:" -"`Py_TPFLAGS_HAVE_FINALIZE` flags bit in order for this field to be used. " -"This is no longer required." -msgstr "" - -#: ../../c-api/typeobj.rst:2446 -msgid ":pep:`442`: \"Safe object finalization\"" -msgstr "" - -#: ../../c-api/typeobj.rst:2449 -msgid ":c:func:`PyObject_CallFinalizer`" -msgstr "" - -#: ../../c-api/typeobj.rst:2450 -msgid ":c:func:`PyObject_CallFinalizerFromDealloc`" -msgstr "" - -#: ../../c-api/typeobj.rst:2455 -msgid "" -"A :ref:`vectorcall function ` to use for calls of this type " -"object (rather than instances). In other words, ``tp_vectorcall`` can be " -"used to optimize ``type.__call__``, which typically returns a new instance " -"of *type*." -msgstr "" - -#: ../../c-api/typeobj.rst:2460 -msgid "" -"As with any vectorcall function, if ``tp_vectorcall`` is ``NULL``, the " -"*tp_call* protocol (``Py_TYPE(type)->tp_call``) is used instead." -msgstr "" - -#: ../../c-api/typeobj.rst:2465 +#: ../../c-api/typeobj.rst:1873 msgid "" -"The :ref:`vectorcall protocol ` requires that the vectorcall " -"function has the same behavior as the corresponding ``tp_call``. This means " -"that ``type->tp_vectorcall`` must match the behavior of ``Py_TYPE(type)-" -">tp_call``." +"If :c:member:`~PyTypeObject.tp_finalize` is set, the interpreter calls it " +"once when finalizing an instance. It is called either from the garbage " +"collector (if the instance is part of an isolated reference cycle) or just " +"before the object is deallocated. Either way, it is guaranteed to be called " +"before attempting to break reference cycles, ensuring that it finds the " +"object in a sane state." msgstr "" +":c:member:`~PyTypeObject.tp_finalize` が設定されている場合、インスタンスを" +"ファイナライズするときに、インタプリタがこの関数を1回呼び出します。\n" +"ガベージコレクタ (このインスタンスが孤立した循環参照の一部だった場合) やオブ" +"ジェクトが破棄される直前にもこの関数は呼び出されます。\n" +"どちらの場合でも、循環参照を破壊しようとする前に呼び出されることが保証されて" +"いて、確実にオブジェクトが正常な状態にあるようにします。" -#: ../../c-api/typeobj.rst:2470 +#: ../../c-api/typeobj.rst:1880 msgid "" -"Specifically, if *type* uses the default metaclass, ``type->tp_vectorcall`` " -"must behave the same as :c:expr:`PyType_Type->tp_call`, which:" -msgstr "" - -#: ../../c-api/typeobj.rst:2474 -msgid "calls ``type->tp_new``," +":c:member:`~PyTypeObject.tp_finalize` should not mutate the current " +"exception status; therefore, a recommended way to write a non-trivial " +"finalizer is::" msgstr "" +":c:member:`~PyTypeObject.tp_finalize` は現在の例外状態を変更すべきではありま" +"せん; 従って、単純でないファイナライザを書くには次の方法が推奨されます::" -#: ../../c-api/typeobj.rst:2476 +#: ../../c-api/typeobj.rst:1897 msgid "" -"if the result is a subclass of *type*, calls ``type->tp_init`` on the result " -"of ``tp_new``, and" +"For this field to be taken into account (even through inheritance), you must " +"also set the :const:`Py_TPFLAGS_HAVE_FINALIZE` flags bit." msgstr "" +"このフィールドを (継承した場合も含めて) 考慮から漏らさないように、 :const:" +"`Py_TPFLAGS_HAVE_FINALIZE` フラグビットも設定しなければなりません。" -#: ../../c-api/typeobj.rst:2479 -msgid "returns the result of ``tp_new``." -msgstr "" +#: ../../c-api/typeobj.rst:1906 +msgid "\"Safe object finalization\" (:pep:`442`)" +msgstr "\"オブジェクトの安全な終了処理\" (:pep:`442`)" -#: ../../c-api/typeobj.rst:2481 +#: ../../c-api/typeobj.rst:1911 msgid "" -"Typically, ``tp_vectorcall`` is overridden to optimize this process for " -"specific :c:member:`~PyTypeObject.tp_new` and :c:member:`~PyTypeObject." -"tp_init`. When doing this for user-subclassable types, note that both can be " -"overridden (using :py:func:`~object.__new__` and :py:func:`~object." -"__init__`, respectively)." +"Vectorcall function to use for calls of this type object. In other words, it " +"is used to implement :ref:`vectorcall ` for ``type.__call__``. " +"If ``tp_vectorcall`` is ``NULL``, the default call implementation using :" +"attr:`__new__` and :attr:`__init__` is used." msgstr "" -#: ../../c-api/typeobj.rst:2492 +#: ../../c-api/typeobj.rst:1919 msgid "This field is never inherited." msgstr "このフィールドは決して継承されません。" -#: ../../c-api/typeobj.rst:2494 +#: ../../c-api/typeobj.rst:1921 msgid "(the field exists since 3.8 but it's only used since 3.9)" -msgstr "" -"(このフィールドは3.8から存在していますが、3.9以降でしか利用できません)" - -#: ../../c-api/typeobj.rst:2499 -msgid "Internal. Do not use." -msgstr "" +msgstr "(このフィールドは3.8から存在しませんが、3.9以降でしか利用できません)" + +#: ../../c-api/typeobj.rst:1924 +msgid "" +"Also, note that, in a garbage collected Python, :c:member:`~PyTypeObject." +"tp_dealloc` may be called from any Python thread, not just the thread which " +"created the object (if the object becomes part of a refcount cycle, that " +"cycle might be collected by a garbage collection on any thread). This is " +"not a problem for Python API calls, since the thread on which tp_dealloc is " +"called will own the Global Interpreter Lock (GIL). However, if the object " +"being destroyed in turn destroys objects from some other C or C++ library, " +"care should be taken to ensure that destroying those objects on the thread " +"which called tp_dealloc will not violate any assumptions of the library." +msgstr "" +"また、 Python のガベージコレクションでは、 :c:member:`~PyTypeObject." +"tp_dealloc` を呼び出すのはオブジェクトを生成したスレッドだけではなく、任意の " +"Python スレッドかもしれないという点にも注意して下さい。 (オブジェクトが循環参" +"照の一部の場合、任意のスレッドのガベージコレクションによって解放されてしまう" +"かもしれません)。Python API 側からみれば、 *tp_dealloc* を呼び出すスレッドは" +"グローバルインタプリタロック (GIL: Global Interpreter Lock) を獲得するので、" +"これは問題ではありません。しかしながら、削除されようとしているオブジェクトが" +"何らかの C や C++ ライブラリ由来のオブジェクトを削除する場合、 *tp_dealloc* " +"を呼び出すスレッドのオブジェクトを削除することで、ライブラリの仮定している何" +"らかの規約に違反しないように気を付ける必要があります。" -#: ../../c-api/typeobj.rst:2507 -msgid "Static Types" +#: ../../c-api/typeobj.rst:1938 +msgid "Heap Types" msgstr "" -#: ../../c-api/typeobj.rst:2509 +#: ../../c-api/typeobj.rst:1940 msgid "" "Traditionally, types defined in C code are *static*, that is, a static :c:" "type:`PyTypeObject` structure is defined directly in code and initialized " "using :c:func:`PyType_Ready`." msgstr "" -#: ../../c-api/typeobj.rst:2513 +#: ../../c-api/typeobj.rst:1944 msgid "" "This results in types that are limited relative to types defined in Python:" msgstr "" -#: ../../c-api/typeobj.rst:2515 +#: ../../c-api/typeobj.rst:1946 msgid "" "Static types are limited to one base, i.e. they cannot use multiple " "inheritance." msgstr "" -#: ../../c-api/typeobj.rst:2517 +#: ../../c-api/typeobj.rst:1948 msgid "" "Static type objects (but not necessarily their instances) are immutable. It " "is not possible to add or modify the type object's attributes from Python." msgstr "" -#: ../../c-api/typeobj.rst:2519 +#: ../../c-api/typeobj.rst:1950 msgid "" "Static type objects are shared across :ref:`sub-interpreters `, so they should not include any subinterpreter-" "specific state." msgstr "" -#: ../../c-api/typeobj.rst:2523 +#: ../../c-api/typeobj.rst:1954 msgid "" -"Also, since :c:type:`PyTypeObject` is only part of the :ref:`Limited API " -"` as an opaque struct, any extension modules using static " -"types must be compiled for a specific Python minor version." -msgstr "" - -#: ../../c-api/typeobj.rst:2531 -msgid "Heap Types" +"Also, since :c:type:`PyTypeObject` is not part of the :ref:`stable ABI " +"`, any extension modules using static types must be compiled for a " +"specific Python minor version." msgstr "" -#: ../../c-api/typeobj.rst:2533 +#: ../../c-api/typeobj.rst:1958 msgid "" -"An alternative to :ref:`static types ` is *heap-allocated " -"types*, or *heap types* for short, which correspond closely to classes " -"created by Python's ``class`` statement. Heap types have the :c:macro:" -"`Py_TPFLAGS_HEAPTYPE` flag set." +"An alternative to static types is *heap-allocated types*, or *heap types* " +"for short, which correspond closely to classes created by Python's ``class`` " +"statement." msgstr "" -#: ../../c-api/typeobj.rst:2538 +#: ../../c-api/typeobj.rst:1962 msgid "" "This is done by filling a :c:type:`PyType_Spec` structure and calling :c:" -"func:`PyType_FromSpec`, :c:func:`PyType_FromSpecWithBases`, :c:func:" -"`PyType_FromModuleAndSpec`, or :c:func:`PyType_FromMetaclass`." +"func:`PyType_FromSpecWithBases`." msgstr "" -#: ../../c-api/typeobj.rst:2546 +#: ../../c-api/typeobj.rst:1969 msgid "Number Object Structures" msgstr "数値オブジェクト構造体" -#: ../../c-api/typeobj.rst:2553 +#: ../../c-api/typeobj.rst:1976 msgid "" "This structure holds pointers to the functions which an object uses to " "implement the number protocol. Each function is used by the function of " @@ -4207,57 +3417,11 @@ msgstr "" "以下のそれぞれの関数は :ref:`number` で解説されている似た名前の関数から利用さ" "れます。" -#: ../../c-api/typeobj.rst:2559 ../../c-api/typeobj.rst:2883 +#: ../../c-api/typeobj.rst:1982 ../../c-api/typeobj.rst:2306 msgid "Here is the structure definition::" msgstr "以下は構造体の定義です::" -#: ../../c-api/typeobj.rst:2561 -msgid "" -"typedef struct {\n" -" binaryfunc nb_add;\n" -" binaryfunc nb_subtract;\n" -" binaryfunc nb_multiply;\n" -" binaryfunc nb_remainder;\n" -" binaryfunc nb_divmod;\n" -" ternaryfunc nb_power;\n" -" unaryfunc nb_negative;\n" -" unaryfunc nb_positive;\n" -" unaryfunc nb_absolute;\n" -" inquiry nb_bool;\n" -" unaryfunc nb_invert;\n" -" binaryfunc nb_lshift;\n" -" binaryfunc nb_rshift;\n" -" binaryfunc nb_and;\n" -" binaryfunc nb_xor;\n" -" binaryfunc nb_or;\n" -" unaryfunc nb_int;\n" -" void *nb_reserved;\n" -" unaryfunc nb_float;\n" -"\n" -" binaryfunc nb_inplace_add;\n" -" binaryfunc nb_inplace_subtract;\n" -" binaryfunc nb_inplace_multiply;\n" -" binaryfunc nb_inplace_remainder;\n" -" ternaryfunc nb_inplace_power;\n" -" binaryfunc nb_inplace_lshift;\n" -" binaryfunc nb_inplace_rshift;\n" -" binaryfunc nb_inplace_and;\n" -" binaryfunc nb_inplace_xor;\n" -" binaryfunc nb_inplace_or;\n" -"\n" -" binaryfunc nb_floor_divide;\n" -" binaryfunc nb_true_divide;\n" -" binaryfunc nb_inplace_floor_divide;\n" -" binaryfunc nb_inplace_true_divide;\n" -"\n" -" unaryfunc nb_index;\n" -"\n" -" binaryfunc nb_matrix_multiply;\n" -" binaryfunc nb_inplace_matrix_multiply;\n" -"} PyNumberMethods;" -msgstr "" - -#: ../../c-api/typeobj.rst:2606 +#: ../../c-api/typeobj.rst:2029 msgid "" "Binary and ternary functions must check the type of all their operands, and " "implement the necessary conversions (at least one of the operands is an " @@ -4272,18 +3436,19 @@ msgstr "" "ば、二項関数と三項関数は ``Py_NotImplemented`` を返さなければならず、他のエ" "ラーが起こった場合は、``NULL`` を返して例外を設定しなければなりません。" -#: ../../c-api/typeobj.rst:2615 +#: ../../c-api/typeobj.rst:2038 msgid "" -"The :c:member:`~PyNumberMethods.nb_reserved` field should always be " -"``NULL``. It was previously called :c:member:`!nb_long`, and was renamed in " -"Python 3.0.1." +"The :c:data:`nb_reserved` field should always be ``NULL``. It was " +"previously called :c:data:`nb_long`, and was renamed in Python 3.0.1." msgstr "" +":c:data:`nb_reserved` フィールドは常に ``NULL`` でなければなりません。以前" +"は :c:data:`nb_long` と呼ばれていて、 Python 3.0.1 で名前が変更されました。" -#: ../../c-api/typeobj.rst:2660 +#: ../../c-api/typeobj.rst:2083 msgid "Mapping Object Structures" msgstr "マップオブジェクト構造体" -#: ../../c-api/typeobj.rst:2667 +#: ../../c-api/typeobj.rst:2090 msgid "" "This structure holds pointers to the functions which an object uses to " "implement the mapping protocol. It has three members:" @@ -4292,7 +3457,7 @@ msgstr "" "持しています。\n" "以下の3つのメンバを持っています:" -#: ../../c-api/typeobj.rst:2672 +#: ../../c-api/typeobj.rst:2095 msgid "" "This function is used by :c:func:`PyMapping_Size` and :c:func:" "`PyObject_Size`, and has the same signature. This slot may be set to " @@ -4302,7 +3467,7 @@ msgstr "" "それらと同じシグネチャを持っています。オブジェクトが定義された長さを持たない" "場合は、このスロットは ``NULL`` に設定されることがあります。" -#: ../../c-api/typeobj.rst:2678 +#: ../../c-api/typeobj.rst:2101 msgid "" "This function is used by :c:func:`PyObject_GetItem` and :c:func:" "`PySequence_GetSlice`, and has the same signature as :c:func:`!" @@ -4310,25 +3475,30 @@ msgid "" "`PyMapping_Check` function to return ``1``, it can be ``NULL`` otherwise." msgstr "" "この関数は :c:func:`PyObject_GetItem` および :c:func:`PySequence_GetSlice` か" -"ら利用され、:c:func:`!PyObject_GetItem` と同じシグネチャを持っています。この" -"スロットは :c:func:`PyMapping_Check` が ``1`` を返すためには必要で、そうでな" -"ければ ``NULL`` の場合があります。" +"ら利用され、:c:func:`PySequence_GetSlice` と同じシグネチャを持っています。こ" +"のスロットは :c:func:`PyMapping_Check` が ``1`` を返すためには必要で、そうで" +"なければ ``NULL`` の場合があります。" -#: ../../c-api/typeobj.rst:2686 +#: ../../c-api/typeobj.rst:2109 msgid "" "This function is used by :c:func:`PyObject_SetItem`, :c:func:" -"`PyObject_DelItem`, :c:func:`PySequence_SetSlice` and :c:func:" -"`PySequence_DelSlice`. It has the same signature as :c:func:`!" +"`PyObject_DelItem`, :c:func:`PyObject_SetSlice` and :c:func:" +"`PyObject_DelSlice`. It has the same signature as :c:func:`!" "PyObject_SetItem`, but *v* can also be set to ``NULL`` to delete an item. " "If this slot is ``NULL``, the object does not support item assignment and " "deletion." msgstr "" +"この関数は :c:func:`PyObject_SetItem`、:c:func:`PyObject_DelItem`、:c:func:" +"`PyObject_SetSlice` および :c:func:`PyObject_DelSlice` から利用されます。\n" +":c:func:`!PyObject_SetItem` と同じシグネチャを持ちますが、 *v* に ``NULL`` を" +"設定して要素の削除もできます。このスロットが ``NULL`` の場合は、このオブジェ" +"クトはアイテムの代入と削除をサポートしません。" -#: ../../c-api/typeobj.rst:2697 +#: ../../c-api/typeobj.rst:2120 msgid "Sequence Object Structures" msgstr "シーケンスオブジェクト構造体" -#: ../../c-api/typeobj.rst:2704 +#: ../../c-api/typeobj.rst:2127 msgid "" "This structure holds pointers to the functions which an object uses to " "implement the sequence protocol." @@ -4336,7 +3506,7 @@ msgstr "" "この構造体はシーケンス型プロトコルを実装するために使われる関数群へのポインタ" "を保持しています。" -#: ../../c-api/typeobj.rst:2709 +#: ../../c-api/typeobj.rst:2132 msgid "" "This function is used by :c:func:`PySequence_Size` and :c:func:" "`PyObject_Size`, and has the same signature. It is also used for handling " @@ -4344,7 +3514,7 @@ msgid "" "member:`~PySequenceMethods.sq_ass_item` slots." msgstr "" -#: ../../c-api/typeobj.rst:2716 +#: ../../c-api/typeobj.rst:2139 msgid "" "This function is used by :c:func:`PySequence_Concat` and has the same " "signature. It is also used by the ``+`` operator, after trying the numeric " @@ -4354,7 +3524,7 @@ msgstr "" "す。また、 ``+`` 演算子でも、 :c:member:`~PyNumberMethods.nb_add` スロットに" "よる数値加算を試した後に利用されます。" -#: ../../c-api/typeobj.rst:2722 +#: ../../c-api/typeobj.rst:2145 msgid "" "This function is used by :c:func:`PySequence_Repeat` and has the same " "signature. It is also used by the ``*`` operator, after trying numeric " @@ -4364,7 +3534,7 @@ msgstr "" "す。また、 ``*`` 演算でも、 :c:member:`~PyNumberMethods.nb_multiply` スロット" "による数値乗算を試したあとに利用されます。" -#: ../../c-api/typeobj.rst:2728 +#: ../../c-api/typeobj.rst:2151 msgid "" "This function is used by :c:func:`PySequence_GetItem` and has the same " "signature. It is also used by :c:func:`PyObject_GetItem`, after trying the " @@ -4373,16 +3543,19 @@ msgid "" "``1``, it can be ``NULL`` otherwise." msgstr "" -#: ../../c-api/typeobj.rst:2734 +#: ../../c-api/typeobj.rst:2157 msgid "" -"Negative indexes are handled as follows: if the :c:member:" -"`~PySequenceMethods.sq_length` slot is filled, it is called and the sequence " -"length is used to compute a positive index which is passed to :c:member:" -"`~PySequenceMethods.sq_item`. If :c:member:`!sq_length` is ``NULL``, the " -"index is passed as is to the function." +"Negative indexes are handled as follows: if the :attr:`sq_length` slot is " +"filled, it is called and the sequence length is used to compute a positive " +"index which is passed to :attr:`sq_item`. If :attr:`sq_length` is ``NULL``, " +"the index is passed as is to the function." msgstr "" +"負のインデックスは次のように処理されます: :attr:`sq_length` スロットが埋めら" +"れていれば、それを呼び出してシーケンスの長さから正のインデックスを計算し、 :" +"attr:`sq_item` に渡します。 :attr:`sq_length` が ``NULL`` の場合は、インデッ" +"クスはそのままこの関数に渡されます。" -#: ../../c-api/typeobj.rst:2741 +#: ../../c-api/typeobj.rst:2164 msgid "" "This function is used by :c:func:`PySequence_SetItem` and has the same " "signature. It is also used by :c:func:`PyObject_SetItem` and :c:func:" @@ -4391,7 +3564,7 @@ msgid "" "``NULL`` if the object does not support item assignment and deletion." msgstr "" -#: ../../c-api/typeobj.rst:2750 +#: ../../c-api/typeobj.rst:2173 msgid "" "This function may be used by :c:func:`PySequence_Contains` and has the same " "signature. This slot may be left to ``NULL``, in this case :c:func:`!" @@ -4402,7 +3575,7 @@ msgstr "" "PySequence_Contains` はシンプルにマッチするオブジェクトを見つけるまでシーケン" "スを巡回します。" -#: ../../c-api/typeobj.rst:2757 +#: ../../c-api/typeobj.rst:2180 msgid "" "This function is used by :c:func:`PySequence_InPlaceConcat` and has the same " "signature. It should modify its first operand, and return it. This slot " @@ -4412,7 +3585,7 @@ msgid "" "c:member:`~PyNumberMethods.nb_inplace_add` slot." msgstr "" -#: ../../c-api/typeobj.rst:2766 +#: ../../c-api/typeobj.rst:2189 msgid "" "This function is used by :c:func:`PySequence_InPlaceRepeat` and has the same " "signature. It should modify its first operand, and return it. This slot " @@ -4422,11 +3595,11 @@ msgid "" "via the :c:member:`~PyNumberMethods.nb_inplace_multiply` slot." msgstr "" -#: ../../c-api/typeobj.rst:2777 +#: ../../c-api/typeobj.rst:2200 msgid "Buffer Object Structures" msgstr "バッファオブジェクト構造体 (buffer object structure)" -#: ../../c-api/typeobj.rst:2785 +#: ../../c-api/typeobj.rst:2208 msgid "" "This structure holds pointers to the functions required by the :ref:`Buffer " "protocol `. The protocol defines how an exporter object can " @@ -4437,17 +3610,13 @@ msgstr "" "そのプロトコルは、エクスポーターオブジェクトが如何にして、その内部データをコ" "ンシューマオブジェクトに渡すかを定義します。" -#: ../../c-api/typeobj.rst:2791 ../../c-api/typeobj.rst:2840 -#: ../../c-api/typeobj.rst:2894 ../../c-api/typeobj.rst:2905 -#: ../../c-api/typeobj.rst:2917 ../../c-api/typeobj.rst:2927 +#: ../../c-api/typeobj.rst:2214 ../../c-api/typeobj.rst:2263 +#: ../../c-api/typeobj.rst:2316 ../../c-api/typeobj.rst:2327 +#: ../../c-api/typeobj.rst:2338 msgid "The signature of this function is::" msgstr "この関数のシグネチャは以下の通りです::" -#: ../../c-api/typeobj.rst:2793 -msgid "int (PyObject *exporter, Py_buffer *view, int flags);" -msgstr "" - -#: ../../c-api/typeobj.rst:2795 +#: ../../c-api/typeobj.rst:2218 msgid "" "Handle a request to *exporter* to fill in *view* as specified by *flags*. " "Except for point (3), an implementation of this function MUST take these " @@ -4457,32 +3626,35 @@ msgstr "" "求を処理します。ステップ(3) を除いて、この関数の実装では以下のステップを行わ" "なければなりません:" -#: ../../c-api/typeobj.rst:2799 +#: ../../c-api/typeobj.rst:2222 msgid "" -"Check if the request can be met. If not, raise :exc:`BufferError`, set :c:" -"expr:`view->obj` to ``NULL`` and return ``-1``." +"Check if the request can be met. If not, raise :c:data:`PyExc_BufferError`, " +"set :c:data:`view->obj` to ``NULL`` and return ``-1``." msgstr "" +"リクエストが合致するか確認します。\n" +"合致しない場合は、 :c:data:`PyExc_BufferError` を送出し、 :c:data:`view-" +">obj` に ``NULL`` を設定し ``-1`` を返します。" -#: ../../c-api/typeobj.rst:2802 +#: ../../c-api/typeobj.rst:2225 msgid "Fill in the requested fields." msgstr "要求されたフィールドを埋めます。" -#: ../../c-api/typeobj.rst:2804 +#: ../../c-api/typeobj.rst:2227 msgid "Increment an internal counter for the number of exports." msgstr "エクスポートした回数を保持する内部カウンタをインクリメントします。" -#: ../../c-api/typeobj.rst:2806 +#: ../../c-api/typeobj.rst:2229 msgid "" -"Set :c:expr:`view->obj` to *exporter* and increment :c:expr:`view->obj`." +"Set :c:data:`view->obj` to *exporter* and increment :c:data:`view->obj`." msgstr "" -":c:expr:`view->obj` に *exporter* を設定し、 :c:expr:`view->obj` をインクリメ" +":c:data:`view->obj` に *exporter* を設定し、 :c:data:`view->obj` をインクリメ" "ントします。" -#: ../../c-api/typeobj.rst:2808 +#: ../../c-api/typeobj.rst:2231 msgid "Return ``0``." msgstr "``0`` を返します。" -#: ../../c-api/typeobj.rst:2810 +#: ../../c-api/typeobj.rst:2233 msgid "" "If *exporter* is part of a chain or tree of buffer providers, two main " "schemes can be used:" @@ -4490,24 +3662,24 @@ msgstr "" "*exporter* がバッファプロバイダのチェインかツリーの一部であれば、2つの主要な" "方式が使用できます:" -#: ../../c-api/typeobj.rst:2813 +#: ../../c-api/typeobj.rst:2236 msgid "" "Re-export: Each member of the tree acts as the exporting object and sets :c:" -"expr:`view->obj` to a new reference to itself." +"data:`view->obj` to a new reference to itself." msgstr "" "再エクスポート: ツリーの各要素がエクスポートされるオブジェクトとして振る舞" -"い、自身への新しい参照を :c:expr:`view->obj` へセットします。" +"い、自身への新しい参照を :c:data:`view->obj` へセットします。" -#: ../../c-api/typeobj.rst:2816 +#: ../../c-api/typeobj.rst:2239 msgid "" "Redirect: The buffer request is redirected to the root object of the tree. " -"Here, :c:expr:`view->obj` will be a new reference to the root object." +"Here, :c:data:`view->obj` will be a new reference to the root object." msgstr "" "リダイレクト: バッファ要求がツリーのルートオブジェクトにリダイレクトされま" -"す。ここでは、 :c:expr:`view->obj` はルートオブジェクトへの新しい参照になりま" +"す。ここでは、 :c:data:`view->obj` はルートオブジェクトへの新しい参照になりま" "す。" -#: ../../c-api/typeobj.rst:2820 +#: ../../c-api/typeobj.rst:2243 msgid "" "The individual fields of *view* are described in section :ref:`Buffer " "structure `, the rules how an exporter must react to " @@ -4518,7 +3690,7 @@ msgstr "" "明されており、エクスポートが特定の要求に対しどう対応しなければならないかの規" "則は、 :ref:`バッファ要求のタイプ ` の節にあります。" -#: ../../c-api/typeobj.rst:2825 +#: ../../c-api/typeobj.rst:2248 msgid "" "All memory pointed to in the :c:type:`Py_buffer` structure belongs to the " "exporter and must remain valid until there are no consumers left. :c:member:" @@ -4532,7 +3704,7 @@ msgstr "" "strides` 、 :c:member:`~Py_buffer.suboffsets` 、 :c:member:`~Py_buffer." "internal` はコンシューマからは読み出し専用です。" -#: ../../c-api/typeobj.rst:2832 +#: ../../c-api/typeobj.rst:2255 msgid "" ":c:func:`PyBuffer_FillInfo` provides an easy way of exposing a simple bytes " "buffer while dealing correctly with all request types." @@ -4540,7 +3712,7 @@ msgstr "" ":c:func:`PyBuffer_FillInfo` は、全てのリクエストタイプを正しく扱う際に、単純" "なバイトバッファを公開する簡単な方法を提供します。" -#: ../../c-api/typeobj.rst:2835 +#: ../../c-api/typeobj.rst:2258 msgid "" ":c:func:`PyObject_GetBuffer` is the interface for the consumer that wraps " "this function." @@ -4548,11 +3720,7 @@ msgstr "" ":c:func:`PyObject_GetBuffer` は、この関数をラップするコンシューマ向けのイン" "ターフェースです。" -#: ../../c-api/typeobj.rst:2842 -msgid "void (PyObject *exporter, Py_buffer *view);" -msgstr "" - -#: ../../c-api/typeobj.rst:2844 +#: ../../c-api/typeobj.rst:2267 msgid "" "Handle a request to release the resources of the buffer. If no resources " "need to be released, :c:member:`PyBufferProcs.bf_releasebuffer` may be " @@ -4564,16 +3732,16 @@ msgstr "" "構いません。そうでない場合は、この関数の標準的な実装は、以下の任意の処理手順 " "(optional step) を行います:" -#: ../../c-api/typeobj.rst:2849 +#: ../../c-api/typeobj.rst:2272 msgid "Decrement an internal counter for the number of exports." msgstr "エクスポートした回数を保持する内部カウンタをデクリメントします。" -#: ../../c-api/typeobj.rst:2851 +#: ../../c-api/typeobj.rst:2274 msgid "If the counter is ``0``, free all memory associated with *view*." msgstr "" "カウンタが ``0`` の場合は、*view* に関連付けられた全てのメモリを解放します。" -#: ../../c-api/typeobj.rst:2853 +#: ../../c-api/typeobj.rst:2276 msgid "" "The exporter MUST use the :c:member:`~Py_buffer.internal` field to keep " "track of buffer-specific resources. This field is guaranteed to remain " @@ -4585,17 +3753,17 @@ msgstr "" "コンシューマが *view* 引数としてオリジナルのバッファのコピーを渡しているであ" "ろう間、変わらないことが保証されています。" -#: ../../c-api/typeobj.rst:2859 +#: ../../c-api/typeobj.rst:2282 msgid "" -"This function MUST NOT decrement :c:expr:`view->obj`, since that is done " +"This function MUST NOT decrement :c:data:`view->obj`, since that is done " "automatically in :c:func:`PyBuffer_Release` (this scheme is useful for " "breaking reference cycles)." msgstr "" -"この関数は、:c:expr:`view->obj` をデクリメントしてはいけません、なぜならそれ" +"この関数は、:c:data:`view->obj` をデクリメントしてはいけません、なぜならそれ" "は :c:func:`PyBuffer_Release` で自動的に行われるからです(この方式は参照の循環" "を防ぐのに有用です)。" -#: ../../c-api/typeobj.rst:2864 +#: ../../c-api/typeobj.rst:2287 msgid "" ":c:func:`PyBuffer_Release` is the interface for the consumer that wraps this " "function." @@ -4603,11 +3771,11 @@ msgstr "" ":c:func:`PyBuffer_Release` は、この関数をラップするコンシューマ向けのインター" "フェースです。" -#: ../../c-api/typeobj.rst:2872 +#: ../../c-api/typeobj.rst:2295 msgid "Async Object Structures" msgstr "async オブジェクト構造体" -#: ../../c-api/typeobj.rst:2880 +#: ../../c-api/typeobj.rst:2303 msgid "" "This structure holds pointers to the functions required to implement :term:" "`awaitable` and :term:`asynchronous iterator` objects." @@ -4615,47 +3783,30 @@ msgstr "" "この構造体は :term:`awaitable` オブジェクトと :term:`asynchronous iterator` " "オブジェクトを実装するのに必要な関数へのポインタを保持しています。" -#: ../../c-api/typeobj.rst:2885 -msgid "" -"typedef struct {\n" -" unaryfunc am_await;\n" -" unaryfunc am_aiter;\n" -" unaryfunc am_anext;\n" -" sendfunc am_send;\n" -"} PyAsyncMethods;" -msgstr "" - -#: ../../c-api/typeobj.rst:2896 -msgid "PyObject *am_await(PyObject *self);" -msgstr "" - -#: ../../c-api/typeobj.rst:2898 +#: ../../c-api/typeobj.rst:2320 msgid "" -"The returned object must be an :term:`iterator`, i.e. :c:func:`PyIter_Check` " -"must return ``1`` for it." +"The returned object must be an iterator, i.e. :c:func:`PyIter_Check` must " +"return ``1`` for it." msgstr "" -"返されるオブジェクトは :term:`イテレータ ` でなければなりません。\n" +"返されるオブジェクトはイテレータでなければなりません。\n" "つまりこのオブジェクトに対して :c:func:`PyIter_Check` が ``1`` を返さなければ" "なりません。" -#: ../../c-api/typeobj.rst:2901 +#: ../../c-api/typeobj.rst:2323 msgid "" "This slot may be set to ``NULL`` if an object is not an :term:`awaitable`." msgstr "" "オブジェクトが :term:`awaitable` でない場合、このスロットを ``NULL`` に設定し" "ます。" -#: ../../c-api/typeobj.rst:2907 -msgid "PyObject *am_aiter(PyObject *self);" -msgstr "" - -#: ../../c-api/typeobj.rst:2909 +#: ../../c-api/typeobj.rst:2331 msgid "" -"Must return an :term:`asynchronous iterator` object. See :meth:`~object." -"__anext__` for details." +"Must return an :term:`awaitable` object. See :meth:`__anext__` for details." msgstr "" +":term:`awaitable` オブジェクトを返さなければなりません。\n" +"詳しいことは :meth:`__anext__` を参照してください。" -#: ../../c-api/typeobj.rst:2912 +#: ../../c-api/typeobj.rst:2333 msgid "" "This slot may be set to ``NULL`` if an object does not implement " "asynchronous iteration protocol." @@ -4663,44 +3814,43 @@ msgstr "" "オブジェクトが非同期反復処理のプロトコルを実装していない場合、このスロットを " "``NULL`` に設定します。" -#: ../../c-api/typeobj.rst:2919 -msgid "PyObject *am_anext(PyObject *self);" -msgstr "" - -#: ../../c-api/typeobj.rst:2921 -msgid "" -"Must return an :term:`awaitable` object. See :meth:`~object.__anext__` for " -"details. This slot may be set to ``NULL``." -msgstr "" - -#: ../../c-api/typeobj.rst:2929 -msgid "PySendResult am_send(PyObject *self, PyObject *arg, PyObject **result);" -msgstr "" - -#: ../../c-api/typeobj.rst:2931 +#: ../../c-api/typeobj.rst:2342 msgid "" -"See :c:func:`PyIter_Send` for details. This slot may be set to ``NULL``." +"Must return an :term:`awaitable` object. See :meth:`__anext__` for details. " +"This slot may be set to ``NULL``." msgstr "" +":term:`awaitable` オブジェクトを返さなければなりません。\n" +"詳しいことは :meth:`__anext__` を参照してください。\n" +"このスロットは ``NULL`` に設定されていることもあります。" -#: ../../c-api/typeobj.rst:2940 +#: ../../c-api/typeobj.rst:2349 msgid "Slot Type typedefs" msgstr "Slot Type typedefs" -#: ../../c-api/typeobj.rst:2944 +#: ../../c-api/typeobj.rst:2353 msgid "" "The purpose of this function is to separate memory allocation from memory " "initialization. It should return a pointer to a block of memory of adequate " "length for the instance, suitably aligned, and initialized to zeros, but " -"with :c:member:`~PyObject.ob_refcnt` set to ``1`` and :c:member:`~PyObject." -"ob_type` set to the type argument. If the type's :c:member:`~PyTypeObject." -"tp_itemsize` is non-zero, the object's :c:member:`~PyVarObject.ob_size` " -"field should be initialized to *nitems* and the length of the allocated " -"memory block should be ``tp_basicsize + nitems*tp_itemsize``, rounded up to " -"a multiple of ``sizeof(void*)``; otherwise, *nitems* is not used and the " -"length of the block should be :c:member:`~PyTypeObject.tp_basicsize`." -msgstr "" - -#: ../../c-api/typeobj.rst:2954 +"with :attr:`ob_refcnt` set to ``1`` and :attr:`ob_type` set to the type " +"argument. If the type's :c:member:`~PyTypeObject.tp_itemsize` is non-zero, " +"the object's :attr:`ob_size` field should be initialized to *nitems* and the " +"length of the allocated memory block should be ``tp_basicsize + " +"nitems*tp_itemsize``, rounded up to a multiple of ``sizeof(void*)``; " +"otherwise, *nitems* is not used and the length of the block should be :c:" +"member:`~PyTypeObject.tp_basicsize`." +msgstr "" +"この関数の目的は、メモリ確保をメモリ初期化から分離することにあります。この関" +"数は、インスタンス用の的確なサイズ、適切なアラインメント、ゼロによる初期化が" +"なされ、 :attr:`ob_refcnt` を ``1`` に、 :attr:`ob_type` を型引数 (type " +"argument) にセットしたメモリブロックへのポインタを返さねばなりません。型の :" +"c:member:`~PyTypeObject.tp_itemsize` がゼロでない場合、オブジェクトの :attr:" +"`ob_size` フィールドは *nitems* に初期化され、確保されるメモリブロックの長さ" +"は ``tp_basicsize + nitems*tp_itemsize`` を ``sizeof(void*)`` の倍数に切り上" +"げた値になるはずです; それ以外の場合、 *nitems* の値は使われず、メモリブロッ" +"クの長さは :c:member:`~PyTypeObject.tp_basicsize` になるはずです。" + +#: ../../c-api/typeobj.rst:2363 msgid "" "This function should not do any other instance initialization, not even to " "allocate additional memory; that should be done by :c:member:`~PyTypeObject." @@ -4710,27 +3860,27 @@ msgstr "" "割り当てすらも行ってはなりません。そのような処理は :c:member:`~PyTypeObject." "tp_new` で行われるべきです。" -#: ../../c-api/typeobj.rst:2961 +#: ../../c-api/typeobj.rst:2370 msgid "See :c:member:`~PyTypeObject.tp_free`." msgstr ":c:member:`~PyTypeObject.tp_free` を参照してください。" -#: ../../c-api/typeobj.rst:2965 +#: ../../c-api/typeobj.rst:2374 msgid "See :c:member:`~PyTypeObject.tp_new`." msgstr ":c:member:`~PyTypeObject.tp_new` を参照してください。" -#: ../../c-api/typeobj.rst:2969 +#: ../../c-api/typeobj.rst:2378 msgid "See :c:member:`~PyTypeObject.tp_init`." msgstr ":c:member:`~PyTypeObject.tp_init` を参照してください。" -#: ../../c-api/typeobj.rst:2973 +#: ../../c-api/typeobj.rst:2382 msgid "See :c:member:`~PyTypeObject.tp_repr`." msgstr ":c:member:`~PyTypeObject.tp_repr` を参照してください。" -#: ../../c-api/typeobj.rst:2977 ../../c-api/typeobj.rst:2986 +#: ../../c-api/typeobj.rst:2386 ../../c-api/typeobj.rst:2395 msgid "Return the value of the named attribute for the object." msgstr "オブジェクトの属性の値を返します。" -#: ../../c-api/typeobj.rst:2981 ../../c-api/typeobj.rst:2992 +#: ../../c-api/typeobj.rst:2390 ../../c-api/typeobj.rst:2401 msgid "" "Set the value of the named attribute for the object. The value argument is " "set to ``NULL`` to delete the attribute." @@ -4738,47 +3888,43 @@ msgstr "" "オブジェクトの属性に値を設定します。属性を削除するには、 value (実) 引数に " "``NULL`` を設定します。" -#: ../../c-api/typeobj.rst:2988 +#: ../../c-api/typeobj.rst:2397 msgid "See :c:member:`~PyTypeObject.tp_getattro`." msgstr ":c:member:`~PyTypeObject.tp_getattro` を参照してください。" -#: ../../c-api/typeobj.rst:2995 +#: ../../c-api/typeobj.rst:2404 msgid "See :c:member:`~PyTypeObject.tp_setattro`." msgstr ":c:member:`~PyTypeObject.tp_setattro` を参照してください。" -#: ../../c-api/typeobj.rst:2999 -msgid "See :c:member:`~PyTypeObject.tp_descr_get`." -msgstr ":c:member:`~PyTypeObject.tp_descr_get` を参照してください。" +#: ../../c-api/typeobj.rst:2408 +msgid "See :c:member:`~PyTypeObject.tp_descrget`." +msgstr ":c:member:`~PyTypeObject.tp_descrget` を参照してください。" -#: ../../c-api/typeobj.rst:3003 -msgid "See :c:member:`~PyTypeObject.tp_descr_set`." -msgstr ":c:member:`~PyTypeObject.tp_descr_set` を参照してください。" +#: ../../c-api/typeobj.rst:2412 +msgid "See :c:member:`~PyTypeObject.tp_descrset`." +msgstr ":c:member:`~PyTypeObject.tp_descrset` を参照してください。" -#: ../../c-api/typeobj.rst:3007 +#: ../../c-api/typeobj.rst:2416 msgid "See :c:member:`~PyTypeObject.tp_hash`." msgstr ":c:member:`~PyTypeObject.tp_hash` を参照してください。" -#: ../../c-api/typeobj.rst:3011 +#: ../../c-api/typeobj.rst:2420 msgid "See :c:member:`~PyTypeObject.tp_richcompare`." msgstr ":c:member:`~PyTypeObject.tp_richcompare` を参照してください。" -#: ../../c-api/typeobj.rst:3015 +#: ../../c-api/typeobj.rst:2424 msgid "See :c:member:`~PyTypeObject.tp_iter`." msgstr ":c:member:`~PyTypeObject.tp_iter` を参照してください。" -#: ../../c-api/typeobj.rst:3019 +#: ../../c-api/typeobj.rst:2428 msgid "See :c:member:`~PyTypeObject.tp_iternext`." msgstr ":c:member:`~PyTypeObject.tp_iternext` を参照してください。" -#: ../../c-api/typeobj.rst:3033 -msgid "See :c:member:`~PyAsyncMethods.am_send`." -msgstr ":c:member:`~PyAsyncMethods.am_send` を参照してください。" - -#: ../../c-api/typeobj.rst:3049 +#: ../../c-api/typeobj.rst:2454 msgid "Examples" msgstr "使用例" -#: ../../c-api/typeobj.rst:3051 +#: ../../c-api/typeobj.rst:2456 msgid "" "The following are simple examples of Python type definitions. They include " "common usage you may encounter. Some demonstrate tricky corner cases. For " @@ -4790,29 +3936,11 @@ msgstr "" "ケースを実演しています。より多くの例や実践的な情報、チュートリアルが必要な" "ら、:ref:`defining-new-types` や :ref:`new-types-topics` を参照してください。" -#: ../../c-api/typeobj.rst:3056 -msgid "A basic :ref:`static type `::" -msgstr "" - -#: ../../c-api/typeobj.rst:3058 -msgid "" -"typedef struct {\n" -" PyObject_HEAD\n" -" const char *data;\n" -"} MyObject;\n" -"\n" -"static PyTypeObject MyObject_Type = {\n" -" PyVarObject_HEAD_INIT(NULL, 0)\n" -" .tp_name = \"mymod.MyObject\",\n" -" .tp_basicsize = sizeof(MyObject),\n" -" .tp_doc = PyDoc_STR(\"My objects\"),\n" -" .tp_new = myobj_new,\n" -" .tp_dealloc = (destructor)myobj_dealloc,\n" -" .tp_repr = (reprfunc)myobj_repr,\n" -"};" -msgstr "" +#: ../../c-api/typeobj.rst:2461 +msgid "A basic static type::" +msgstr "基本的な静的型::" -#: ../../c-api/typeobj.rst:3073 +#: ../../c-api/typeobj.rst:2478 msgid "" "You may also find older code (especially in the CPython code base) with a " "more verbose initializer::" @@ -4820,151 +3948,22 @@ msgstr "" "より冗長な初期化子を用いた古いコードを(特にCPythonのコードベース中で)見かけ" "ることがあるかもしれません::" -#: ../../c-api/typeobj.rst:3076 -msgid "" -"static PyTypeObject MyObject_Type = {\n" -" PyVarObject_HEAD_INIT(NULL, 0)\n" -" \"mymod.MyObject\", /* tp_name */\n" -" sizeof(MyObject), /* tp_basicsize */\n" -" 0, /* tp_itemsize */\n" -" (destructor)myobj_dealloc, /* tp_dealloc */\n" -" 0, /* tp_vectorcall_offset */\n" -" 0, /* tp_getattr */\n" -" 0, /* tp_setattr */\n" -" 0, /* tp_as_async */\n" -" (reprfunc)myobj_repr, /* tp_repr */\n" -" 0, /* tp_as_number */\n" -" 0, /* tp_as_sequence */\n" -" 0, /* tp_as_mapping */\n" -" 0, /* tp_hash */\n" -" 0, /* tp_call */\n" -" 0, /* tp_str */\n" -" 0, /* tp_getattro */\n" -" 0, /* tp_setattro */\n" -" 0, /* tp_as_buffer */\n" -" 0, /* tp_flags */\n" -" PyDoc_STR(\"My objects\"), /* tp_doc */\n" -" 0, /* tp_traverse */\n" -" 0, /* tp_clear */\n" -" 0, /* tp_richcompare */\n" -" 0, /* tp_weaklistoffset */\n" -" 0, /* tp_iter */\n" -" 0, /* tp_iternext */\n" -" 0, /* tp_methods */\n" -" 0, /* tp_members */\n" -" 0, /* tp_getset */\n" -" 0, /* tp_base */\n" -" 0, /* tp_dict */\n" -" 0, /* tp_descr_get */\n" -" 0, /* tp_descr_set */\n" -" 0, /* tp_dictoffset */\n" -" 0, /* tp_init */\n" -" 0, /* tp_alloc */\n" -" myobj_new, /* tp_new */\n" -"};" -msgstr "" - -#: ../../c-api/typeobj.rst:3117 +#: ../../c-api/typeobj.rst:2522 msgid "A type that supports weakrefs, instance dicts, and hashing::" msgstr "弱参照やインスタンス辞書、ハッシュをサポートする型::" -#: ../../c-api/typeobj.rst:3119 -msgid "" -"typedef struct {\n" -" PyObject_HEAD\n" -" const char *data;\n" -"} MyObject;\n" -"\n" -"static PyTypeObject MyObject_Type = {\n" -" PyVarObject_HEAD_INIT(NULL, 0)\n" -" .tp_name = \"mymod.MyObject\",\n" -" .tp_basicsize = sizeof(MyObject),\n" -" .tp_doc = PyDoc_STR(\"My objects\"),\n" -" .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE |\n" -" Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_MANAGED_DICT |\n" -" Py_TPFLAGS_MANAGED_WEAKREF,\n" -" .tp_new = myobj_new,\n" -" .tp_traverse = (traverseproc)myobj_traverse,\n" -" .tp_clear = (inquiry)myobj_clear,\n" -" .tp_alloc = PyType_GenericNew,\n" -" .tp_dealloc = (destructor)myobj_dealloc,\n" -" .tp_repr = (reprfunc)myobj_repr,\n" -" .tp_hash = (hashfunc)myobj_hash,\n" -" .tp_richcompare = PyBaseObject_Type.tp_richcompare,\n" -"};" -msgstr "" - -#: ../../c-api/typeobj.rst:3142 +#: ../../c-api/typeobj.rst:2549 msgid "" "A str subclass that cannot be subclassed and cannot be called to create " -"instances (e.g. uses a separate factory func) using :c:macro:" -"`Py_TPFLAGS_DISALLOW_INSTANTIATION` flag::" +"instances (e.g. uses a separate factory func)::" msgstr "" +"サブクラス化を許可せず、インスタンスを生成するのに呼び出せない(つまり、別の" +"ファクトリー関数を呼び出す必要のある)str のサブクラス::" -#: ../../c-api/typeobj.rst:3146 -msgid "" -"typedef struct {\n" -" PyUnicodeObject raw;\n" -" char *extra;\n" -"} MyStr;\n" -"\n" -"static PyTypeObject MyStr_Type = {\n" -" PyVarObject_HEAD_INIT(NULL, 0)\n" -" .tp_name = \"mymod.MyStr\",\n" -" .tp_basicsize = sizeof(MyStr),\n" -" .tp_base = NULL, // set to &PyUnicode_Type in module init\n" -" .tp_doc = PyDoc_STR(\"my custom str\"),\n" -" .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_DISALLOW_INSTANTIATION,\n" -" .tp_repr = (reprfunc)myobj_repr,\n" -"};" -msgstr "" - -#: ../../c-api/typeobj.rst:3161 -msgid "" -"The simplest :ref:`static type ` with fixed-length instances::" -msgstr "" - -#: ../../c-api/typeobj.rst:3163 -msgid "" -"typedef struct {\n" -" PyObject_HEAD\n" -"} MyObject;\n" -"\n" -"static PyTypeObject MyObject_Type = {\n" -" PyVarObject_HEAD_INIT(NULL, 0)\n" -" .tp_name = \"mymod.MyObject\",\n" -"};" -msgstr "" - -#: ../../c-api/typeobj.rst:3172 -msgid "" -"The simplest :ref:`static type ` with variable-length " -"instances::" -msgstr "" - -#: ../../c-api/typeobj.rst:3174 -msgid "" -"typedef struct {\n" -" PyObject_VAR_HEAD\n" -" const char *data[1];\n" -"} MyObject;\n" -"\n" -"static PyTypeObject MyObject_Type = {\n" -" PyVarObject_HEAD_INIT(NULL, 0)\n" -" .tp_name = \"mymod.MyObject\",\n" -" .tp_basicsize = sizeof(MyObject) - sizeof(char *),\n" -" .tp_itemsize = sizeof(char *),\n" -"};" -msgstr "" - -#: ../../c-api/typeobj.rst:913 ../../c-api/typeobj.rst:978 -msgid "built-in function" -msgstr "組み込み関数" - -#: ../../c-api/typeobj.rst:913 -msgid "repr" -msgstr "repr" +#: ../../c-api/typeobj.rst:2568 +msgid "The simplest static type (with fixed-length instances)::" +msgstr "もっとも単純な静的型(固定長のインスタンス)::" -#: ../../c-api/typeobj.rst:978 -msgid "hash" -msgstr "hash" +#: ../../c-api/typeobj.rst:2579 +msgid "The simplest static type (with variable-length instances)::" +msgstr "もっとも単純な静的型(可変長インスタンス)::" diff --git a/c-api/unicode.po b/c-api/unicode.po index ffd4b6e26..0f535ac2b 100644 --- a/c-api/unicode.po +++ b/c-api/unicode.po @@ -1,29 +1,31 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# 秘湯 , 2023 -# Arihiro TAKASE, 2023 -# Taichi Haradaguchi, 2024 -# tomo, 2024 -# 石井明久, 2024 +# Hiroki Kimura , 2017 +# Nozomu Kaneko , 2017 +# 秘湯 , 2017 +# Arihiro TAKASE, 2017 +# Osamu NAKAMURA, 2017 +# tomo, 2020 +# mollinaca, 2020 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-13 14:21+0000\n" -"PO-Revision-Date: 2021-06-28 00:50+0000\n" -"Last-Translator: 石井明久, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-03-16 05:43+0000\n" +"PO-Revision-Date: 2017-02-16 17:39+0000\n" +"Last-Translator: mollinaca, 2020\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/unicode.rst:6 @@ -46,44 +48,61 @@ msgstr "" "Python3.3 の :pep:`393` 実装から、メモリ効率を維持しながらUnicode文字の完全な" "範囲を扱えるように、Unicodeオブジェクトは内部的に多様な表現形式を用いていま" "す。すべてのコードポイントが128、256または65536以下の文字列に対して特別なケー" -"スが存在しますが、それ以外ではコードポイントは1114112以下 (これはすべての" -"Unicode範囲です) でなければなりません。" +"スが存在しますが、それ以外ではコードポイントは1114112以下(これはすべての" +"Unicode範囲です)でなければなりません。" #: ../../c-api/unicode.rst:20 msgid "" -"UTF-8 representation is created on demand and cached in the Unicode object." +":c:type:`Py_UNICODE*` and UTF-8 representations are created on demand and " +"cached in the Unicode object. The :c:type:`Py_UNICODE*` representation is " +"deprecated and inefficient." msgstr "" -#: ../../c-api/unicode.rst:23 +#: ../../c-api/unicode.rst:24 msgid "" -"The :c:type:`Py_UNICODE` representation has been removed since Python 3.12 " -"with deprecated APIs. See :pep:`623` for more information." +"Due to the transition between the old APIs and the new APIs, Unicode objects " +"can internally be in two states depending on how they were created:" msgstr "" +"古いAPIから新しいAPIへの移行の影響で、 Unicode オブジェクトの内部の状態は2通" +"りあります。これはオブジェクトの作られ方によって決まります。" -#: ../../c-api/unicode.rst:29 -msgid "Unicode Type" -msgstr "Unicode 型" +#: ../../c-api/unicode.rst:27 +msgid "" +"\"canonical\" Unicode objects are all objects created by a non-deprecated " +"Unicode API. They use the most efficient representation allowed by the " +"implementation." +msgstr "" +"\"正統な\" Unicode オブジェクトは、非推奨ではないUnicode APIで作成されたすべ" +"てのオブジェクトです。これらのオブジェクトは実装が許すかぎり最も効率の良い表" +"現形式を使用します。" #: ../../c-api/unicode.rst:31 msgid "" -"These are the basic Unicode object types used for the Unicode implementation " -"in Python:" +"\"legacy\" Unicode objects have been created through one of the deprecated " +"APIs (typically :c:func:`PyUnicode_FromUnicode`) and only bear the :c:type:" +"`Py_UNICODE*` representation; you will have to call :c:func:" +"`PyUnicode_READY` on them before calling any other API." msgstr "" -"以下は Python の Unicode 実装に用いられている基本 Unicode オブジェクト型です:" -#: ../../c-api/unicode.rst:36 +#: ../../c-api/unicode.rst:37 msgid "" -"This instance of :c:type:`PyTypeObject` represents the Python Unicode type. " -"It is exposed to Python code as :py:class:`str`." +"The \"legacy\" Unicode object will be removed in Python 3.12 with deprecated " +"APIs. All Unicode objects will be \"canonical\" since then. See :pep:`623` " +"for more information." msgstr "" -#: ../../c-api/unicode.rst:42 +#: ../../c-api/unicode.rst:43 +msgid "Unicode Type" +msgstr "Unicode 型" + +#: ../../c-api/unicode.rst:45 msgid "" -"This instance of :c:type:`PyTypeObject` represents the Python Unicode " -"iterator type. It is used to iterate over Unicode string objects." +"These are the basic Unicode object types used for the Unicode implementation " +"in Python:" msgstr "" +"以下は Python の Unicode 実装に用いられている基本 Unicode オブジェクト型です:" -#: ../../c-api/unicode.rst:50 +#: ../../c-api/unicode.rst:52 msgid "" "These types are typedefs for unsigned integer types wide enough to contain " "characters of 32 bits, 16 bits and 8 bits, respectively. When dealing with " @@ -95,6 +114,24 @@ msgstr "" #: ../../c-api/unicode.rst:61 msgid "" +"This is a typedef of :c:type:`wchar_t`, which is a 16-bit type or 32-bit " +"type depending on the platform." +msgstr "" +"これは、:c:type:`wchar_t` のtypedef で、プラットフォームに依存して16ビットか" +"32ビットの型になります。" + +#: ../../c-api/unicode.rst:64 +msgid "" +"In previous versions, this was a 16-bit type or a 32-bit type depending on " +"whether you selected a \"narrow\" or \"wide\" Unicode version of Python at " +"build time." +msgstr "" +"以前のバージョンでは、Pythonをビルドした際に \"narrow\" または \"wide\" " +"Unicode バージョンのどちらを選択したかによって、 16ビットか32ビットのどちらか" +"の型になっていました。" + +#: ../../c-api/unicode.rst:74 +msgid "" "These subtypes of :c:type:`PyObject` represent a Python Unicode object. In " "almost all cases, they shouldn't be used directly, since all API functions " "that deal with Unicode objects take and return :c:type:`PyObject` pointers." @@ -105,99 +142,126 @@ msgstr "" "受け取って PyObject へのポインタを返すので、ほとんどの場合、これらの型を直接" "使うべきではありません。" -#: ../../c-api/unicode.rst:68 +#: ../../c-api/unicode.rst:83 msgid "" -"The following APIs are C macros and static inlined functions for fast checks " -"and access to internal read-only data of Unicode objects:" +"This instance of :c:type:`PyTypeObject` represents the Python Unicode type. " +"It is exposed to Python code as ``str``." msgstr "" +"この :c:type:`PyTypeObject` のインスタンスは、Python Unicode型を表します。こ" +"れは、Pythonコードに ``str`` として露出されます。" -#: ../../c-api/unicode.rst:73 +#: ../../c-api/unicode.rst:87 msgid "" -"Return true if the object *obj* is a Unicode object or an instance of a " +"The following APIs are really C macros and can be used to do fast checks and " +"to access internal read-only data of Unicode objects:" +msgstr "" +"以下の API は実際には C マクロで、Unicode オブジェクト内部の読み取り専用デー" +"タに対するチェックやアクセスを高速に行います:" + +#: ../../c-api/unicode.rst:92 +msgid "" +"Return true if the object *o* is a Unicode object or an instance of a " "Unicode subtype. This function always succeeds." msgstr "" -"オブジェクト *obj* が Unicode オブジェクトか Unicode 型のサブタイプのインスタ" -"ンスである場合に真を返します。この関数は常に成功します。" +"オブジェクト *o* が Unicode オブジェクトか Unicode 型のサブタイプのインスタン" +"スである場合に真を返します。この関数は常に成功します。" + +#: ../../c-api/unicode.rst:98 +msgid "" +"Return true if the object *o* is a Unicode object, but not an instance of a " +"subtype. This function always succeeds." +msgstr "" +"オブジェクト *o* が Unicode オブジェクトだがサブタイプのインスタンスでない場" +"合に真を返します。この関数は常に成功します。" + +#: ../../c-api/unicode.rst:104 +msgid "" +"Ensure the string object *o* is in the \"canonical\" representation. This " +"is required before using any of the access macros described below." +msgstr "" +"文字列オブジェクト *o* が \"正統な\" 表現形式であることを保証します。\n" +"このマクロは、下で説明しているどのアクセスマクロを使うときも必要となります。" -#: ../../c-api/unicode.rst:79 +#: ../../c-api/unicode.rst:109 msgid "" -"Return true if the object *obj* is a Unicode object, but not an instance of " -"a subtype. This function always succeeds." +"Returns ``0`` on success and ``-1`` with an exception set on failure, which " +"in particular happens if memory allocation fails." +msgstr "" +"成功のときには ``0`` を返し、失敗のときには例外を設定し ``-1`` を返します。\n" +"後者は、メモリ確保に失敗したときに特に起きやすいです。" + +#: ../../c-api/unicode.rst:115 +msgid "This API will be removed with :c:func:`PyUnicode_FromUnicode`." msgstr "" -"オブジェクト *obj* が Unicode オブジェクトだがサブタイプのインスタンスでない" -"場合に真を返します。この関数は常に成功します。" -#: ../../c-api/unicode.rst:85 +#: ../../c-api/unicode.rst:120 msgid "" -"Return the length of the Unicode string, in code points. *unicode* has to " -"be a Unicode object in the \"canonical\" representation (not checked)." +"Return the length of the Unicode string, in code points. *o* has to be a " +"Unicode object in the \"canonical\" representation (not checked)." msgstr "" "Unicode 文字列のコードポイントでの長さを返します。\n" -"*unicode* は \"正統な\" 表現形式の Unicode オブジェクトでなければなりません " -"(ただしチェックはしません)。" +"*o* は \"正統な\" 表現形式の Unicode オブジェクトでなければなりません (ただし" +"チェックはしません)。" -#: ../../c-api/unicode.rst:95 +#: ../../c-api/unicode.rst:130 msgid "" "Return a pointer to the canonical representation cast to UCS1, UCS2 or UCS4 " "integer types for direct character access. No checks are performed if the " "canonical representation has the correct character size; use :c:func:" -"`PyUnicode_KIND` to select the right function." +"`PyUnicode_KIND` to select the right macro. Make sure :c:func:" +"`PyUnicode_READY` has been called before accessing this." msgstr "" "文字に直接アクセスするために、 UCS1, UCS2, UCS4 のいずれかの整数型にキャスト" "された正統な表現形式へのポインタを返します。\n" "正統な表現が適正な文字サイズになっているかどうかのチェックはしません;\n" -":c:func:`PyUnicode_KIND` を使って正しい関数を選んでください。" +":c:func:`PyUnicode_KIND` を使って正しいマクロを選んでください。\n" +"このオブジェクトにアクセスする前に、忘れずに :c:func:`PyUnicode_READY` を呼び" +"出してください。" -#: ../../c-api/unicode.rst:107 +#: ../../c-api/unicode.rst:144 msgid "Return values of the :c:func:`PyUnicode_KIND` macro." msgstr ":c:func:`PyUnicode_KIND` マクロの返り値です。" -#: ../../c-api/unicode.rst:111 -msgid "``PyUnicode_WCHAR_KIND`` has been removed." -msgstr "``PyUnicode_WCHAR_KIND`` は削除されました。" +#: ../../c-api/unicode.rst:149 +msgid "``PyUnicode_WCHAR_KIND`` is deprecated." +msgstr "" -#: ../../c-api/unicode.rst:117 +#: ../../c-api/unicode.rst:154 msgid "" "Return one of the PyUnicode kind constants (see above) that indicate how " -"many bytes per character this Unicode object uses to store its data. " -"*unicode* has to be a Unicode object in the \"canonical\" representation " -"(not checked)." +"many bytes per character this Unicode object uses to store its data. *o* " +"has to be a Unicode object in the \"canonical\" representation (not checked)." msgstr "" "この Unicode がデータを保存するのに1文字あたり何バイト使っているかを示す " "PyUnicode 種別の定数 (上を読んでください) のうち1つを返します。\n" -"*unicode* は \"正統な\" 表現形式の Unicode オブジェクトでなければなりません " -"(ただしチェックはしません)。" - -#: ../../c-api/unicode.rst:126 -msgid "" -"Return a void pointer to the raw Unicode buffer. *unicode* has to be a " -"Unicode object in the \"canonical\" representation (not checked)." -msgstr "" -"生の Unicode バッファへの void ポインタを返します。\n" -"*unicode* は \"正統な\" 表現形式の Unicode オブジェクトでなければなりません " -"(ただしチェックはしません)。" - -#: ../../c-api/unicode.rst:135 -msgid "" -"Write the code point *value* to the given zero-based *index* in a string." -msgstr "" +"*o* は \"正統な\" 表現形式の Unicode オブジェクトでなければなりません (ただし" +"チェックはしません)。" -#: ../../c-api/unicode.rst:137 +#: ../../c-api/unicode.rst:165 msgid "" -"The *kind* value and *data* pointer must have been obtained from a string " -"using :c:func:`PyUnicode_KIND` and :c:func:`PyUnicode_DATA` respectively. " -"You must hold a reference to that string while calling :c:func:`!" -"PyUnicode_WRITE`. All requirements of :c:func:`PyUnicode_WriteChar` also " -"apply." +"Return a void pointer to the raw Unicode buffer. *o* has to be a Unicode " +"object in the \"canonical\" representation (not checked)." msgstr "" -#: ../../c-api/unicode.rst:143 +#: ../../c-api/unicode.rst:174 msgid "" -"The function performs no checks for any of its requirements, and is intended " -"for usage in loops." +"Write into a canonical representation *data* (as obtained with :c:func:" +"`PyUnicode_DATA`). This macro does not do any sanity checks and is intended " +"for usage in loops. The caller should cache the *kind* value and *data* " +"pointer as obtained from other macro calls. *index* is the index in the " +"string (starts at 0) and *value* is the new code point value which should be " +"written to that location." msgstr "" +"正統な表現形式となっている (:c:func:`PyUnicode_DATA` で取得した) *data* に書" +"き込みます。\n" +"このマクロは正常性のチェックを一切行わない、ループで使われるためのもので" +"す。\n" +"呼び出し側は、他のマクロを呼び出して取得した *kind* 値と *data* ポインタを" +"キャッシュすべきです。\n" +"*index* は文字列の (0始まりの) インデックスで、 *value* はその場所に書き込ま" +"れることになる新しいコードポイントの値です。" -#: ../../c-api/unicode.rst:152 +#: ../../c-api/unicode.rst:186 msgid "" "Read a code point from a canonical representation *data* (as obtained with :" "c:func:`PyUnicode_DATA`). No checks or ready calls are performed." @@ -206,29 +270,95 @@ msgstr "" "コードポイントを読み取ります。\n" "チェックや事前確認のマクロ呼び出しは一切行われません。" -#: ../../c-api/unicode.rst:160 +#: ../../c-api/unicode.rst:194 msgid "" -"Read a character from a Unicode object *unicode*, which must be in the " +"Read a character from a Unicode object *o*, which must be in the " "\"canonical\" representation. This is less efficient than :c:func:" "`PyUnicode_READ` if you do multiple consecutive reads." msgstr "" -"Unicode オブジェクト *unicode* から文字を読み取ります。\n" +"Unicode オブジェクト *o* から文字を読み取ります。\n" "この Unicode オブジェクトは \"正統な\" 表現形式でなければなりません。\n" "何度も連続して読み取る場合には、このマクロは :c:func:`PyUnicode_READ` よりも" "非効率的です。" -#: ../../c-api/unicode.rst:169 +#: ../../c-api/unicode.rst:203 msgid "" "Return the maximum code point that is suitable for creating another string " -"based on *unicode*, which must be in the \"canonical\" representation. This " -"is always an approximation but more efficient than iterating over the string." +"based on *o*, which must be in the \"canonical\" representation. This is " +"always an approximation but more efficient than iterating over the string." msgstr "" -"*unicode* に基づいて他の文字列を作るのに適した最大のコードポイントを返しま" -"す。\n" +"*o* に基づいて他の文字列を作るのに適した最大のコードポイントを返します。\n" "この Unicode オブジェクトは \"正統な\" 表現形式でなければなりません。\n" "この値は常に概算値ですが、文字列全体を調べるよりも効率的です。" -#: ../../c-api/unicode.rst:178 +#: ../../c-api/unicode.rst:212 +msgid "" +"Return the size of the deprecated :c:type:`Py_UNICODE` representation, in " +"code units (this includes surrogate pairs as 2 units). *o* has to be a " +"Unicode object (not checked)." +msgstr "" +"非推奨の :c:type:`Py_UNICODE` 表現形式のサイズをコード単位で返します (サロ" +"ゲートペアを2つとしています)。\n" +"*o* は Unicode オブジェクトでなければなりません (ただしチェックはしません)。" + +#: ../../c-api/unicode.rst:218 ../../c-api/unicode.rst:228 +#: ../../c-api/unicode.rst:772 +msgid "" +"Part of the old-style Unicode API, please migrate to using :c:func:" +"`PyUnicode_GET_LENGTH`." +msgstr "" +"古いスタイルの Unicode APIの一部なので、 :c:func:`PyUnicode_GET_LENGTH` を使" +"用するように移行してください。" + +#: ../../c-api/unicode.rst:223 +msgid "" +"Return the size of the deprecated :c:type:`Py_UNICODE` representation in " +"bytes. *o* has to be a Unicode object (not checked)." +msgstr "" +"非推奨の :c:type:`Py_UNICODE` 表現形式のサイズをバイト単位で返します。\n" +"*o* は Unicode オブジェクトでなければなりません (ただしチェックはしません)。" + +#: ../../c-api/unicode.rst:234 +msgid "" +"Return a pointer to a :c:type:`Py_UNICODE` representation of the object. " +"The returned buffer is always terminated with an extra null code point. It " +"may also contain embedded null code points, which would cause the string to " +"be truncated when used in most C functions. The ``AS_DATA`` form casts the " +"pointer to :c:type:`const char *`. The *o* argument has to be a Unicode " +"object (not checked)." +msgstr "" +"与えられたオブジェクトの :c:type:`Py_UNICODE` 表現形式へのポインタを返しま" +"す。\n" +"返されるバッファは常に終端に null コードポイントが1つ余分に付いています。\n" +"それとは別の null コードポイントがバッファに含まれることもあるかもしれません" +"が、たいていの C 関数ではそのような文字列は切り詰められてしまうでしょう。\n" +"``AS_DATA`` の方はポインタを :c:type:`const char *` にキャストしています。\n" +"引数 *o* は Unicode オブジェクトでなければなりません (ただしチェックはしませ" +"ん)。" + +#: ../../c-api/unicode.rst:241 +msgid "" +"This macro is now inefficient -- because in many cases the :c:type:" +"`Py_UNICODE` representation does not exist and needs to be created -- and " +"can fail (return ``NULL`` with an exception set). Try to port the code to " +"use the new :c:func:`PyUnicode_nBYTE_DATA` macros or use :c:func:" +"`PyUnicode_WRITE` or :c:func:`PyUnicode_READ`." +msgstr "" +"このマクロは今では非効率なものになりました。\n" +"というのも、多くのケースで :c:type:`Py_UNICODE` 表現形式が登場せず、作成され" +"ず、そして失敗し得ます (例外を設定して ``NULL`` を返します)。\n" +"コードを修正して、 :c:func:`PyUnicode_nBYTE_DATA` マクロを使うか :c:func:" +"`PyUnicode_WRITE` や :c:func:`PyUnicode_READ` を使うようにしてください。" + +#: ../../c-api/unicode.rst:250 +msgid "" +"Part of the old-style Unicode API, please migrate to using the :c:func:" +"`PyUnicode_nBYTE_DATA` family of macros." +msgstr "" +"古いスタイルの Unicode APIの一部なので、 :c:func:`PyUnicode_nBYTE_DATA` 系の" +"マクロを使用するように移行してください。" + +#: ../../c-api/unicode.rst:255 msgid "" "Return ``1`` if the string is a valid identifier according to the language " "definition, section :ref:`identifiers`. Return ``0`` otherwise." @@ -236,23 +366,17 @@ msgstr "" "文字列が、 :ref:`identifiers` 節の言語定義における有効な識別子であれば ``1`` " "を返します。それ以外の場合は ``0`` を返します。" -#: ../../c-api/unicode.rst:181 +#: ../../c-api/unicode.rst:258 msgid "" "The function does not call :c:func:`Py_FatalError` anymore if the string is " "not ready." msgstr "" -#: ../../c-api/unicode.rst:188 -msgid "" -"Return true if the string only contains ASCII characters. Equivalent to :py:" -"meth:`str.isascii`." -msgstr "" - -#: ../../c-api/unicode.rst:195 +#: ../../c-api/unicode.rst:264 msgid "Unicode Character Properties" msgstr "Unicode 文字プロパティ" -#: ../../c-api/unicode.rst:197 +#: ../../c-api/unicode.rst:266 msgid "" "Unicode provides many different character properties. The most often needed " "ones are available through these macros which are mapped to C functions " @@ -262,131 +386,154 @@ msgstr "" "す。よく使われる文字プロパティは、以下のマクロで利用できます。これらのマクロ" "は Python の設定に応じて、各々 C の関数に対応付けられています。" -#: ../../c-api/unicode.rst:204 +#: ../../c-api/unicode.rst:273 msgid "" "Return ``1`` or ``0`` depending on whether *ch* is a whitespace character." msgstr "*ch* が空白文字かどうかに応じて ``1`` または ``0`` を返します。" -#: ../../c-api/unicode.rst:209 +#: ../../c-api/unicode.rst:278 msgid "" "Return ``1`` or ``0`` depending on whether *ch* is a lowercase character." msgstr "*ch* が小文字かどうかに応じて ``1`` または ``0`` を返します。" -#: ../../c-api/unicode.rst:214 +#: ../../c-api/unicode.rst:283 msgid "" "Return ``1`` or ``0`` depending on whether *ch* is an uppercase character." msgstr "*ch* が大文字かどうかに応じて ``1`` または ``0`` を返します。" -#: ../../c-api/unicode.rst:219 +#: ../../c-api/unicode.rst:288 msgid "" "Return ``1`` or ``0`` depending on whether *ch* is a titlecase character." msgstr "" "*ch* がタイトルケース文字 (titlecase character) かどうかに応じて ``1`` また" "は ``0`` を返します。" -#: ../../c-api/unicode.rst:224 +#: ../../c-api/unicode.rst:293 msgid "" "Return ``1`` or ``0`` depending on whether *ch* is a linebreak character." msgstr "*ch* が改行文字かどうかに応じて ``1`` または ``0`` を返します。" -#: ../../c-api/unicode.rst:229 +#: ../../c-api/unicode.rst:298 msgid "Return ``1`` or ``0`` depending on whether *ch* is a decimal character." msgstr "*ch* が decimal 文字かどうかに応じて ``1`` または ``0`` を返します。" -#: ../../c-api/unicode.rst:234 +#: ../../c-api/unicode.rst:303 msgid "Return ``1`` or ``0`` depending on whether *ch* is a digit character." msgstr "*ch* が digit 文字かどうかに応じて ``1`` または ``0`` を返します。" -#: ../../c-api/unicode.rst:239 +#: ../../c-api/unicode.rst:308 msgid "Return ``1`` or ``0`` depending on whether *ch* is a numeric character." msgstr "" "*ch* が数字 (numeric) 文字かどうかに応じて ``1`` または ``0`` を返します。" -#: ../../c-api/unicode.rst:244 +#: ../../c-api/unicode.rst:313 msgid "" "Return ``1`` or ``0`` depending on whether *ch* is an alphabetic character." msgstr "" "*ch* がアルファベット文字かどうかに応じて ``1`` または ``0`` を返します。" -#: ../../c-api/unicode.rst:249 +#: ../../c-api/unicode.rst:318 msgid "" "Return ``1`` or ``0`` depending on whether *ch* is an alphanumeric character." msgstr "*ch* が英数文字かどうかに応じて ``1`` または ``0`` を返します。" -#: ../../c-api/unicode.rst:254 +#: ../../c-api/unicode.rst:323 msgid "" -"Return ``1`` or ``0`` depending on whether *ch* is a printable character, in " -"the sense of :meth:`str.isprintable`." +"Return ``1`` or ``0`` depending on whether *ch* is a printable character. " +"Nonprintable characters are those characters defined in the Unicode " +"character database as \"Other\" or \"Separator\", excepting the ASCII space " +"(0x20) which is considered printable. (Note that printable characters in " +"this context are those which should not be escaped when :func:`repr` is " +"invoked on a string. It has no bearing on the handling of strings written " +"to :data:`sys.stdout` or :data:`sys.stderr`.)" msgstr "" +"*ch* が文字が印字可能な文字かどうかに基づいて ``1`` または ``0`` を返しま" +"す。\n" +"非印字可能文字は、 Unicode 文字データベースで \"Other\" または \"Separator\" " +"と定義されている文字の、印字可能と見なされる ASCII space (0x20) 以外のもので" +"す。\n" +"(なお、この文脈での印字可能文字は、文字列に :func:`repr` が呼び出されるときに" +"エスケープすべきでない文字のことです。これは :data:`sys.stdout` や :data:" +"`sys.stderr` に書き込まれる文字列の操作とは関係ありません。)" -#: ../../c-api/unicode.rst:258 +#: ../../c-api/unicode.rst:332 msgid "These APIs can be used for fast direct character conversions:" msgstr "以下の API は、高速に直接文字変換を行うために使われます:" -#: ../../c-api/unicode.rst:263 +#: ../../c-api/unicode.rst:337 msgid "Return the character *ch* converted to lower case." msgstr "*ch* を小文字に変換したものを返します。" -#: ../../c-api/unicode.rst:268 +#: ../../c-api/unicode.rst:339 ../../c-api/unicode.rst:347 +#: ../../c-api/unicode.rst:355 +msgid "This function uses simple case mappings." +msgstr "この関数は単純な大文字小文字変換を使ってます。" + +#: ../../c-api/unicode.rst:345 msgid "Return the character *ch* converted to upper case." msgstr "*ch* を大文字に変換したものを返します。" -#: ../../c-api/unicode.rst:273 +#: ../../c-api/unicode.rst:353 msgid "Return the character *ch* converted to title case." msgstr "*ch* をタイトルケース文字に変換したものを返します。" -#: ../../c-api/unicode.rst:278 +#: ../../c-api/unicode.rst:361 msgid "" "Return the character *ch* converted to a decimal positive integer. Return " -"``-1`` if this is not possible. This function does not raise exceptions." +"``-1`` if this is not possible. This macro does not raise exceptions." msgstr "" +"*ch* を 10 進の正の整数に変換したものを返します。不可能ならば ``-1`` を返しま" +"す。このマクロは例外を送出しません。" -#: ../../c-api/unicode.rst:284 +#: ../../c-api/unicode.rst:367 msgid "" "Return the character *ch* converted to a single digit integer. Return ``-1`` " -"if this is not possible. This function does not raise exceptions." +"if this is not possible. This macro does not raise exceptions." msgstr "" +"*ch* を一桁の 2 進整数に変換したものを返します。不可能ならば ``-1`` を返しま" +"す。このマクロは例外を送出しません。" -#: ../../c-api/unicode.rst:290 +#: ../../c-api/unicode.rst:373 msgid "" "Return the character *ch* converted to a double. Return ``-1.0`` if this is " -"not possible. This function does not raise exceptions." +"not possible. This macro does not raise exceptions." msgstr "" -"*ch* を double に変換したものを返します。不可能ならば ``-1.0`` を返します。こ" -"の関数は例外を送出しません。" +"*ch* を :c:type:`double` に変換したものを返します。不可能ならば ``-1.0`` を返" +"します。このマクロは例外を送出しません。" -#: ../../c-api/unicode.rst:294 +#: ../../c-api/unicode.rst:377 msgid "These APIs can be used to work with surrogates:" msgstr "これらの API はサロゲートにも使えます:" -#: ../../c-api/unicode.rst:298 +#: ../../c-api/unicode.rst:381 msgid "Check if *ch* is a surrogate (``0xD800 <= ch <= 0xDFFF``)." msgstr "" "*ch* がサロゲートかどうか (``0xD800 <= ch <= 0xDFFF``) をチェックします。" -#: ../../c-api/unicode.rst:302 +#: ../../c-api/unicode.rst:385 msgid "Check if *ch* is a high surrogate (``0xD800 <= ch <= 0xDBFF``)." msgstr "" "*ch* が上位サロゲートかどうか (``0xD800 <= ch <= 0xDBFF``) をチェックします。" -#: ../../c-api/unicode.rst:306 +#: ../../c-api/unicode.rst:389 msgid "Check if *ch* is a low surrogate (``0xDC00 <= ch <= 0xDFFF``)." msgstr "" "*ch* が下位サロゲートかどうか (``0xDC00 <= ch <= 0xDFFF``) をチェックします。" -#: ../../c-api/unicode.rst:310 +#: ../../c-api/unicode.rst:393 msgid "" -"Join two surrogate code points and return a single :c:type:`Py_UCS4` value. " -"*high* and *low* are respectively the leading and trailing surrogates in a " -"surrogate pair. *high* must be in the range [0xD800; 0xDBFF] and *low* must " -"be in the range [0xDC00; 0xDFFF]." +"Join two surrogate characters and return a single Py_UCS4 value. *high* and " +"*low* are respectively the leading and trailing surrogates in a surrogate " +"pair." msgstr "" +"2つのサロゲート文字を組み合わせて単一の Py_UCS4 値を返します。\n" +"*high* と *low* はそれぞれサロゲートペアの前半分と後半分です。" -#: ../../c-api/unicode.rst:317 +#: ../../c-api/unicode.rst:399 msgid "Creating and accessing Unicode strings" msgstr "Unicode 文字列の生成とアクセス" -#: ../../c-api/unicode.rst:319 +#: ../../c-api/unicode.rst:401 msgid "" "To create Unicode objects and access their basic sequence properties, use " "these APIs:" @@ -394,7 +541,7 @@ msgstr "" "Unicode オブジェクトを生成したり、Unicode のシーケンスとしての基本的なプロパ" "ティにアクセスしたりするには、以下の API を使ってください:" -#: ../../c-api/unicode.rst:324 +#: ../../c-api/unicode.rst:406 msgid "" "Create a new Unicode object. *maxchar* should be the true maximum code " "point to be placed in the string. As an approximation, it can be rounded up " @@ -405,51 +552,15 @@ msgstr "" "その値は概算値として 127, 255, 65535, 1114111 の一番近い値に切り上げられま" "す。" -#: ../../c-api/unicode.rst:328 -msgid "On error, set an exception and return ``NULL``." -msgstr "" - -#: ../../c-api/unicode.rst:330 -msgid "" -"After creation, the string can be filled by :c:func:`PyUnicode_WriteChar`, :" -"c:func:`PyUnicode_CopyCharacters`, :c:func:`PyUnicode_Fill`, :c:func:" -"`PyUnicode_WRITE` or similar. Since strings are supposed to be immutable, " -"take care to not “use” the result while it is being modified. In particular, " -"before it's filled with its final contents, a string:" -msgstr "" - -#: ../../c-api/unicode.rst:337 -msgid "must not be hashed," -msgstr "" - -#: ../../c-api/unicode.rst:338 -msgid "" -"must not be :c:func:`converted to UTF-8 `, or " -"another non-\"canonical\" representation," -msgstr "" - -#: ../../c-api/unicode.rst:340 -msgid "must not have its reference count changed," -msgstr "" - -#: ../../c-api/unicode.rst:341 -msgid "must not be shared with code that might do one of the above." -msgstr "" - -#: ../../c-api/unicode.rst:343 -msgid "" -"This list is not exhaustive. Avoiding these uses is your responsibility; " -"Python does not always check these requirements." -msgstr "" - -#: ../../c-api/unicode.rst:346 +#: ../../c-api/unicode.rst:410 msgid "" -"To avoid accidentally exposing a partially-written string object, prefer " -"using the :c:type:`PyUnicodeWriter` API, or one of the ``PyUnicode_From*`` " -"functions below." +"This is the recommended way to allocate a new Unicode object. Objects " +"created using this function are not resizable." msgstr "" +"これは新しい Unicode オブジェクトを生成する推奨された方法です。\n" +"この関数を使って生成されたオブジェクトはサイズ変更は不可能です。" -#: ../../c-api/unicode.rst:357 +#: ../../c-api/unicode.rst:419 msgid "" "Create a new Unicode object with the given *kind* (possible values are :c:" "macro:`PyUnicode_1BYTE_KIND` etc., as returned by :c:func:" @@ -461,297 +572,236 @@ msgstr "" "*buffer* は、与えられた kind に従って1文字あたり 1, 2, 4 バイトのいずれかを単" "位として、長さ *size* の配列へのポインタでなければなりません。" -#: ../../c-api/unicode.rst:362 -msgid "" -"If necessary, the input *buffer* is copied and transformed into the " -"canonical representation. For example, if the *buffer* is a UCS4 string (:c:" -"macro:`PyUnicode_4BYTE_KIND`) and it consists only of codepoints in the UCS1 " -"range, it will be transformed into UCS1 (:c:macro:`PyUnicode_1BYTE_KIND`)." -msgstr "" - -#: ../../c-api/unicode.rst:373 +#: ../../c-api/unicode.rst:429 msgid "" -"Create a Unicode object from the char buffer *str*. The bytes will be " +"Create a Unicode object from the char buffer *u*. The bytes will be " "interpreted as being UTF-8 encoded. The buffer is copied into the new " -"object. The return value might be a shared object, i.e. modification of the " -"data is not allowed." +"object. If the buffer is not ``NULL``, the return value might be a shared " +"object, i.e. modification of the data is not allowed." msgstr "" +"char 型バッファ *u* から Unicode オブジェクトを生成します。\n" +"*u* の内容は UTF-8 でエンコードされているものとします。\n" +"バッファの内容は新たなオブジェクトにコピーされます。\n" +"バッファが ``NULL`` でない場合、帰り値は共有されたオブジェクトになることがあ" +"ります。\n" +"つまり、この関数が返す Unicode オブジェクトの変更は許されていません。" -#: ../../c-api/unicode.rst:379 -msgid "This function raises :exc:`SystemError` when:" -msgstr "" - -#: ../../c-api/unicode.rst:381 -msgid "*size* < 0," -msgstr "" - -#: ../../c-api/unicode.rst:382 -msgid "*str* is ``NULL`` and *size* > 0" -msgstr "" - -#: ../../c-api/unicode.rst:384 -msgid "*str* == ``NULL`` with *size* > 0 is not allowed anymore." +#: ../../c-api/unicode.rst:434 +msgid "" +"If *u* is ``NULL``, this function behaves like :c:func:" +"`PyUnicode_FromUnicode` with the buffer set to ``NULL``. This usage is " +"deprecated in favor of :c:func:`PyUnicode_New`, and will be removed in " +"Python 3.12." msgstr "" -#: ../../c-api/unicode.rst:390 +#: ../../c-api/unicode.rst:441 msgid "" -"Create a Unicode object from a UTF-8 encoded null-terminated char buffer " -"*str*." +"Create a Unicode object from a UTF-8 encoded null-terminated char buffer *u*." msgstr "" -"UTF-8 エンコードされたnull終端のchar 型バッファ *str* から Unicode オブジェク" -"トを生成します。" +"UTF-8 エンコードされたnull終端のchar 型バッファ *u* から Unicode オブジェクト" +"を生成します。" -#: ../../c-api/unicode.rst:396 +#: ../../c-api/unicode.rst:447 msgid "" "Take a C :c:func:`printf`\\ -style *format* string and a variable number of " "arguments, calculate the size of the resulting Python Unicode string and " "return a string with the values formatted into it. The variable arguments " "must be C types and must correspond exactly to the format characters in the " -"*format* ASCII-encoded string." -msgstr "" - -#: ../../c-api/unicode.rst:402 -msgid "" -"A conversion specifier contains two or more characters and has the following " -"components, which must occur in this order:" -msgstr "" -"一つの変換指定子は 2 またはそれ以上の文字を含み、その構成要素は以下からなりま" -"すが、示した順に出現しなければなりません:" - -#: ../../c-api/unicode.rst:405 -msgid "The ``'%'`` character, which marks the start of the specifier." -msgstr "指定子の開始を示す文字 ``'%'`` 。" - -#: ../../c-api/unicode.rst:407 -msgid "" -"Conversion flags (optional), which affect the result of some conversion " -"types." -msgstr "変換フラグ (オプション)。一部の変換型の結果に影響します。" - -#: ../../c-api/unicode.rst:410 -msgid "" -"Minimum field width (optional). If specified as an ``'*'`` (asterisk), the " -"actual width is given in the next argument, which must be of type :c:expr:" -"`int`, and the object to convert comes after the minimum field width and " -"optional precision." -msgstr "" - -#: ../../c-api/unicode.rst:415 -msgid "" -"Precision (optional), given as a ``'.'`` (dot) followed by the precision. If " -"specified as ``'*'`` (an asterisk), the actual precision is given in the " -"next argument, which must be of type :c:expr:`int`, and the value to convert " -"comes after the precision." +"*format* ASCII-encoded string. The following format characters are allowed:" msgstr "" -#: ../../c-api/unicode.rst:420 -msgid "Length modifier (optional)." -msgstr "精度長変換子 (オプション)。" - -#: ../../c-api/unicode.rst:422 -msgid "Conversion type." -msgstr "変換型。" +#: ../../c-api/unicode.rst:462 +msgid "Format Characters" +msgstr "書式指定文字" -#: ../../c-api/unicode.rst:424 -msgid "The conversion flag characters are:" -msgstr "変換フラグ文字を以下に示します:" - -#: ../../c-api/unicode.rst:429 -msgid "Flag" -msgstr "Flag" +#: ../../c-api/unicode.rst:462 +msgid "Type" +msgstr "型" -#: ../../c-api/unicode.rst:429 -msgid "Meaning" -msgstr "意味" +#: ../../c-api/unicode.rst:462 +msgid "Comment" +msgstr "備考" -#: ../../c-api/unicode.rst:431 -msgid "``0``" -msgstr "``0``" +#: ../../c-api/unicode.rst:464 +msgid ":attr:`%%`" +msgstr ":attr:`%%`" -#: ../../c-api/unicode.rst:431 -msgid "The conversion will be zero padded for numeric values." -msgstr "数値型に対してゼロによるパディングを行います。" +#: ../../c-api/unicode.rst:464 +msgid "*n/a*" +msgstr "*n/a*" -#: ../../c-api/unicode.rst:433 -msgid "``-``" -msgstr "" +#: ../../c-api/unicode.rst:464 +msgid "The literal % character." +msgstr "リテラルの % 文字" -#: ../../c-api/unicode.rst:433 -msgid "" -"The converted value is left adjusted (overrides the ``0`` flag if both are " -"given)." -msgstr "" +#: ../../c-api/unicode.rst:466 +msgid ":attr:`%c`" +msgstr ":attr:`%c`" -#: ../../c-api/unicode.rst:437 -msgid "" -"The length modifiers for following integer conversions (``d``, ``i``, ``o``, " -"``u``, ``x``, or ``X``) specify the type of the argument (:c:expr:`int` by " -"default):" -msgstr "" +#: ../../c-api/unicode.rst:466 ../../c-api/unicode.rst:469 +#: ../../c-api/unicode.rst:502 ../../c-api/unicode.rst:505 +msgid "int" +msgstr "int" -#: ../../c-api/unicode.rst:444 -msgid "Modifier" -msgstr "修飾子" +#: ../../c-api/unicode.rst:466 +msgid "A single character, represented as a C int." +msgstr "C の整数型で表現される単一の文字。" -#: ../../c-api/unicode.rst:444 -msgid "Types" -msgstr "型" +#: ../../c-api/unicode.rst:469 +msgid ":attr:`%d`" +msgstr ":attr:`%d`" -#: ../../c-api/unicode.rst:446 -msgid "``l``" -msgstr "``l``" +#: ../../c-api/unicode.rst:469 +msgid "Equivalent to ``printf(\"%d\")``. [1]_" +msgstr "``printf(\"%d\")`` と同等。 [1]_" -#: ../../c-api/unicode.rst:446 -msgid ":c:expr:`long` or :c:expr:`unsigned long`" -msgstr ":c:expr:`long` または :c:expr:`unsigned long`" +#: ../../c-api/unicode.rst:472 +msgid ":attr:`%u`" +msgstr ":attr:`%u`" -#: ../../c-api/unicode.rst:448 -msgid "``ll``" -msgstr "``ll``" +#: ../../c-api/unicode.rst:472 +msgid "unsigned int" +msgstr "unsigned int" -#: ../../c-api/unicode.rst:448 -msgid ":c:expr:`long long` or :c:expr:`unsigned long long`" -msgstr ":c:expr:`long long` または :c:expr:`unsigned long long`" +#: ../../c-api/unicode.rst:472 +msgid "Equivalent to ``printf(\"%u\")``. [1]_" +msgstr "``printf(\"%u\")`` と同等。 [1]_" -#: ../../c-api/unicode.rst:450 -msgid "``j``" -msgstr "" +#: ../../c-api/unicode.rst:475 +msgid ":attr:`%ld`" +msgstr ":attr:`%ld`" -#: ../../c-api/unicode.rst:450 -msgid ":c:type:`intmax_t` or :c:type:`uintmax_t`" -msgstr "" +#: ../../c-api/unicode.rst:475 ../../c-api/unicode.rst:478 +msgid "long" +msgstr "long" -#: ../../c-api/unicode.rst:452 -msgid "``z``" -msgstr "" +#: ../../c-api/unicode.rst:475 +msgid "Equivalent to ``printf(\"%ld\")``. [1]_" +msgstr "``printf(\"%ld\")`` と同等。 [1]_" -#: ../../c-api/unicode.rst:452 -msgid ":c:type:`size_t` or :c:type:`ssize_t`" -msgstr "" +#: ../../c-api/unicode.rst:478 +msgid ":attr:`%li`" +msgstr ":attr:`%li`" -#: ../../c-api/unicode.rst:454 -msgid "``t``" -msgstr "``t``" +#: ../../c-api/unicode.rst:478 +msgid "Equivalent to ``printf(\"%li\")``. [1]_" +msgstr "``printf(\"%li\")`` と同等。 [1]_" -#: ../../c-api/unicode.rst:454 -msgid ":c:type:`ptrdiff_t`" -msgstr ":c:type:`ptrdiff_t`" +#: ../../c-api/unicode.rst:481 +msgid ":attr:`%lu`" +msgstr ":attr:`%lu`" -#: ../../c-api/unicode.rst:457 -msgid "" -"The length modifier ``l`` for following conversions ``s`` or ``V`` specify " -"that the type of the argument is :c:expr:`const wchar_t*`." -msgstr "" +#: ../../c-api/unicode.rst:481 +msgid "unsigned long" +msgstr "unsigned long" -#: ../../c-api/unicode.rst:460 -msgid "The conversion specifiers are:" -msgstr "" +#: ../../c-api/unicode.rst:481 +msgid "Equivalent to ``printf(\"%lu\")``. [1]_" +msgstr "``printf(\"%lu\")`` と同等。 [1]_" -#: ../../c-api/unicode.rst:466 -msgid "Conversion Specifier" -msgstr "" +#: ../../c-api/unicode.rst:484 +msgid ":attr:`%lld`" +msgstr ":attr:`%lld`" -#: ../../c-api/unicode.rst:467 -msgid "Type" -msgstr "型" +#: ../../c-api/unicode.rst:484 ../../c-api/unicode.rst:487 +msgid "long long" +msgstr "long long" -#: ../../c-api/unicode.rst:468 -msgid "Comment" -msgstr "備考" +#: ../../c-api/unicode.rst:484 +msgid "Equivalent to ``printf(\"%lld\")``. [1]_" +msgstr "``printf(\"%lld\")`` と同等。 [1]_" -#: ../../c-api/unicode.rst:470 -msgid "``%``" -msgstr "``%``" +#: ../../c-api/unicode.rst:487 +msgid ":attr:`%lli`" +msgstr ":attr:`%lli`" -#: ../../c-api/unicode.rst:471 -msgid "*n/a*" -msgstr "*n/a*" +#: ../../c-api/unicode.rst:487 +msgid "Equivalent to ``printf(\"%lli\")``. [1]_" +msgstr "``printf(\"%lli\")`` と同等。 [1]_" -#: ../../c-api/unicode.rst:472 -msgid "The literal ``%`` character." -msgstr "" +#: ../../c-api/unicode.rst:490 +msgid ":attr:`%llu`" +msgstr ":attr:`%llu`" -#: ../../c-api/unicode.rst:474 -msgid "``d``, ``i``" -msgstr "" +#: ../../c-api/unicode.rst:490 +msgid "unsigned long long" +msgstr "unsigned long long" -#: ../../c-api/unicode.rst:475 ../../c-api/unicode.rst:479 -#: ../../c-api/unicode.rst:483 ../../c-api/unicode.rst:487 -#: ../../c-api/unicode.rst:491 -msgid "Specified by the length modifier" -msgstr "" +#: ../../c-api/unicode.rst:490 +msgid "Equivalent to ``printf(\"%llu\")``. [1]_" +msgstr "``printf(\"%llu\")`` と同等。 [1]_" -#: ../../c-api/unicode.rst:476 -msgid "The decimal representation of a signed C integer." -msgstr "" +#: ../../c-api/unicode.rst:493 +msgid ":attr:`%zd`" +msgstr ":attr:`%zd`" -#: ../../c-api/unicode.rst:478 -msgid "``u``" -msgstr "``u``" +#: ../../c-api/unicode.rst:493 ../../c-api/unicode.rst:496 +msgid "Py_ssize_t" +msgstr "Py_ssize_t" -#: ../../c-api/unicode.rst:480 -msgid "The decimal representation of an unsigned C integer." -msgstr "" +#: ../../c-api/unicode.rst:493 +msgid "Equivalent to ``printf(\"%zd\")``. [1]_" +msgstr "``printf(\"%zd\")`` と同等。 [1]_" -#: ../../c-api/unicode.rst:482 -msgid "``o``" -msgstr "``o``" +#: ../../c-api/unicode.rst:496 +msgid ":attr:`%zi`" +msgstr ":attr:`%zi`" -#: ../../c-api/unicode.rst:484 -msgid "The octal representation of an unsigned C integer." -msgstr "" +#: ../../c-api/unicode.rst:496 +msgid "Equivalent to ``printf(\"%zi\")``. [1]_" +msgstr "``printf(\"%zi\")`` と同等。 [1]_" -#: ../../c-api/unicode.rst:486 -msgid "``x``" -msgstr "``x``" +#: ../../c-api/unicode.rst:499 +msgid ":attr:`%zu`" +msgstr ":attr:`%zu`" -#: ../../c-api/unicode.rst:488 -msgid "The hexadecimal representation of an unsigned C integer (lowercase)." -msgstr "" +#: ../../c-api/unicode.rst:499 +msgid "size_t" +msgstr "size_t" -#: ../../c-api/unicode.rst:490 -msgid "``X``" -msgstr "``X``" +#: ../../c-api/unicode.rst:499 +msgid "Equivalent to ``printf(\"%zu\")``. [1]_" +msgstr "``printf(\"%zu\")`` と同等。 [1]_" -#: ../../c-api/unicode.rst:492 -msgid "The hexadecimal representation of an unsigned C integer (uppercase)." -msgstr "" +#: ../../c-api/unicode.rst:502 +msgid ":attr:`%i`" +msgstr ":attr:`%i`" -#: ../../c-api/unicode.rst:494 -msgid "``c``" -msgstr "``c``" +#: ../../c-api/unicode.rst:502 +msgid "Equivalent to ``printf(\"%i\")``. [1]_" +msgstr "``printf(\"%i\")`` と同等。 [1]_" -#: ../../c-api/unicode.rst:495 -msgid ":c:expr:`int`" -msgstr ":c:expr:`int`" +#: ../../c-api/unicode.rst:505 +msgid ":attr:`%x`" +msgstr ":attr:`%x`" -#: ../../c-api/unicode.rst:496 -msgid "A single character." -msgstr "" +#: ../../c-api/unicode.rst:505 +msgid "Equivalent to ``printf(\"%x\")``. [1]_" +msgstr "``printf(\"%x\")`` と同等。 [1]_" -#: ../../c-api/unicode.rst:498 -msgid "``s``" -msgstr "``s``" +#: ../../c-api/unicode.rst:508 +msgid ":attr:`%s`" +msgstr ":attr:`%s`" -#: ../../c-api/unicode.rst:499 -msgid ":c:expr:`const char*` or :c:expr:`const wchar_t*`" -msgstr ":c:expr:`const char*` または :c:expr:`const wchar_t*`" +#: ../../c-api/unicode.rst:508 +msgid "const char\\*" +msgstr "const char\\*" -#: ../../c-api/unicode.rst:500 +#: ../../c-api/unicode.rst:508 msgid "A null-terminated C character array." msgstr "null で終端された C の文字列。" -#: ../../c-api/unicode.rst:502 -msgid "``p``" -msgstr "``p``" +#: ../../c-api/unicode.rst:511 +msgid ":attr:`%p`" +msgstr ":attr:`%p`" -#: ../../c-api/unicode.rst:503 -msgid ":c:expr:`const void*`" -msgstr ":c:expr:`const void*`" +#: ../../c-api/unicode.rst:511 +msgid "const void\\*" +msgstr "const void\\*" -#: ../../c-api/unicode.rst:504 +#: ../../c-api/unicode.rst:511 msgid "" -"The hex representation of a C pointer. Mostly equivalent to " +"The hex representation of a C pointer. Mostly equivalent to " "``printf(\"%p\")`` except that it is guaranteed to start with the literal " "``0x`` regardless of what the platform's ``printf`` yields." msgstr "" @@ -759,129 +809,90 @@ msgstr "" "フォームにおける ``printf`` の定義に関わりなく先頭にリテラル ``0x`` が付きま" "す。" -#: ../../c-api/unicode.rst:509 -msgid "``A``" -msgstr "``A``" +#: ../../c-api/unicode.rst:519 +msgid ":attr:`%A`" +msgstr ":attr:`%A`" -#: ../../c-api/unicode.rst:510 ../../c-api/unicode.rst:514 -#: ../../c-api/unicode.rst:524 ../../c-api/unicode.rst:528 -#: ../../c-api/unicode.rst:532 ../../c-api/unicode.rst:537 -msgid ":c:expr:`PyObject*`" -msgstr ":c:expr:`PyObject*`" +#: ../../c-api/unicode.rst:519 ../../c-api/unicode.rst:522 +#: ../../c-api/unicode.rst:531 ../../c-api/unicode.rst:534 +msgid "PyObject\\*" +msgstr "PyObject\\*" -#: ../../c-api/unicode.rst:511 +#: ../../c-api/unicode.rst:519 msgid "The result of calling :func:`ascii`." msgstr ":func:`ascii` の戻り値。" -#: ../../c-api/unicode.rst:513 -msgid "``U``" -msgstr "``U``" +#: ../../c-api/unicode.rst:522 +msgid ":attr:`%U`" +msgstr ":attr:`%U`" -#: ../../c-api/unicode.rst:515 +#: ../../c-api/unicode.rst:522 msgid "A Unicode object." msgstr "Unicode オブジェクト。" -#: ../../c-api/unicode.rst:517 -msgid "``V``" -msgstr "``V``" +#: ../../c-api/unicode.rst:524 +msgid ":attr:`%V`" +msgstr ":attr:`%V`" -#: ../../c-api/unicode.rst:518 -msgid ":c:expr:`PyObject*`, :c:expr:`const char*` or :c:expr:`const wchar_t*`" -msgstr "" +#: ../../c-api/unicode.rst:524 +msgid "PyObject\\*, const char\\*" +msgstr "PyObject\\*, const char\\*" -#: ../../c-api/unicode.rst:519 +#: ../../c-api/unicode.rst:524 msgid "" "A Unicode object (which may be ``NULL``) and a null-terminated C character " "array as a second parameter (which will be used, if the first parameter is " "``NULL``)." msgstr "" -#: ../../c-api/unicode.rst:523 -msgid "``S``" -msgstr "" +#: ../../c-api/unicode.rst:531 +msgid ":attr:`%S`" +msgstr ":attr:`%S`" -#: ../../c-api/unicode.rst:525 +#: ../../c-api/unicode.rst:531 msgid "The result of calling :c:func:`PyObject_Str`." msgstr ":c:func:`PyObject_Str` の戻り値。" -#: ../../c-api/unicode.rst:527 -msgid "``R``" -msgstr "" +#: ../../c-api/unicode.rst:534 +msgid ":attr:`%R`" +msgstr ":attr:`%R`" -#: ../../c-api/unicode.rst:529 +#: ../../c-api/unicode.rst:534 msgid "The result of calling :c:func:`PyObject_Repr`." msgstr ":c:func:`PyObject_Repr` の戻り値。" -#: ../../c-api/unicode.rst:531 -msgid "``T``" -msgstr "" - -#: ../../c-api/unicode.rst:533 -msgid "" -"Get the fully qualified name of an object type; call :c:func:" -"`PyType_GetFullyQualifiedName`." -msgstr "" - -#: ../../c-api/unicode.rst:536 -msgid "``#T``" -msgstr "" - #: ../../c-api/unicode.rst:538 msgid "" -"Similar to ``T`` format, but use a colon (``:``) as separator between the " -"module name and the qualified name." -msgstr "" - -#: ../../c-api/unicode.rst:541 -msgid "``N``" -msgstr "``N``" - -#: ../../c-api/unicode.rst:542 ../../c-api/unicode.rst:547 -msgid ":c:expr:`PyTypeObject*`" -msgstr "" - -#: ../../c-api/unicode.rst:543 -msgid "" -"Get the fully qualified name of a type; call :c:func:" -"`PyType_GetFullyQualifiedName`." -msgstr "" - -#: ../../c-api/unicode.rst:546 -msgid "``#N``" -msgstr "" - -#: ../../c-api/unicode.rst:548 -msgid "" -"Similar to ``N`` format, but use a colon (``:``) as separator between the " -"module name and the qualified name." +"An unrecognized format character causes all the rest of the format string to " +"be copied as-is to the result string, and any extra arguments discarded." msgstr "" +"識別できない書式指定文字があった場合、残りの書式文字列はそのまま出力文字列に" +"コピーされ、残りの引数は無視されます。" -#: ../../c-api/unicode.rst:552 +#: ../../c-api/unicode.rst:542 msgid "" "The width formatter unit is number of characters rather than bytes. The " -"precision formatter unit is number of bytes or :c:type:`wchar_t` items (if " -"the length modifier ``l`` is used) for ``\"%s\"`` and ``\"%V\"`` (if the " -"``PyObject*`` argument is ``NULL``), and a number of characters for " +"precision formatter unit is number of bytes for ``\"%s\"`` and ``\"%V\"`` " +"(if the ``PyObject*`` argument is ``NULL``), and a number of characters for " "``\"%A\"``, ``\"%U\"``, ``\"%S\"``, ``\"%R\"`` and ``\"%V\"`` (if the " "``PyObject*`` argument is not ``NULL``)." msgstr "" -#: ../../c-api/unicode.rst:560 +#: ../../c-api/unicode.rst:548 msgid "" -"Unlike to C :c:func:`printf` the ``0`` flag has effect even when a precision " -"is given for integer conversions (``d``, ``i``, ``u``, ``o``, ``x``, or " -"``X``)." +"For integer specifiers (d, u, ld, li, lu, lld, lli, llu, zd, zi, zu, i, x): " +"the 0-conversion flag has effect even when a precision is given." msgstr "" -#: ../../c-api/unicode.rst:564 +#: ../../c-api/unicode.rst:551 msgid "Support for ``\"%lld\"`` and ``\"%llu\"`` added." msgstr "``\"%lld\"``, ``\"%llu\"`` のサポートが追加されました。" -#: ../../c-api/unicode.rst:567 +#: ../../c-api/unicode.rst:554 msgid "Support for ``\"%li\"``, ``\"%lli\"`` and ``\"%zi\"`` added." msgstr "``\"%li\"``, ``\"%lli\"``, ``\"%zi\"`` のサポートが追加されました。" -#: ../../c-api/unicode.rst:570 +#: ../../c-api/unicode.rst:557 msgid "" "Support width and precision formatter for ``\"%s\"``, ``\"%A\"``, " "``\"%U\"``, ``\"%V\"``, ``\"%S\"``, ``\"%R\"`` added." @@ -889,27 +900,7 @@ msgstr "" "``\"%s\"``, ``\"%A\"``, ``\"%U\"``, ``\"%V\"``, ``\"%S\"``, ``\"%R\"`` での幅" "フォーマッタおよび精度フォーマッタのサポートが追加されました。" -#: ../../c-api/unicode.rst:574 -msgid "" -"Support for conversion specifiers ``o`` and ``X``. Support for length " -"modifiers ``j`` and ``t``. Length modifiers are now applied to all integer " -"conversions. Length modifier ``l`` is now applied to conversion specifiers " -"``s`` and ``V``. Support for variable width and precision ``*``. Support for " -"flag ``-``." -msgstr "" - -#: ../../c-api/unicode.rst:582 -msgid "" -"An unrecognized format character now sets a :exc:`SystemError`. In previous " -"versions it caused all the rest of the format string to be copied as-is to " -"the result string, and any extra arguments discarded." -msgstr "" - -#: ../../c-api/unicode.rst:586 -msgid "Support for ``%T``, ``%#T``, ``%N`` and ``%#N`` formats added." -msgstr "" - -#: ../../c-api/unicode.rst:592 +#: ../../c-api/unicode.rst:564 msgid "" "Identical to :c:func:`PyUnicode_FromFormat` except that it takes exactly two " "arguments." @@ -917,40 +908,16 @@ msgstr "" "ちょうど2つの引数を取ることを除いて、 :c:func:`PyUnicode_FromFormat` と同じ" "です。" -#: ../../c-api/unicode.rst:598 -msgid "" -"Copy an instance of a Unicode subtype to a new true Unicode object if " -"necessary. If *obj* is already a true Unicode object (not a subtype), return " -"a new :term:`strong reference` to the object." -msgstr "" +#: ../../c-api/unicode.rst:571 +msgid "Decode an encoded object *obj* to a Unicode object." +msgstr "エンコードされている *obj* を Unicode オブジェクトにデコードします。" -#: ../../c-api/unicode.rst:602 +#: ../../c-api/unicode.rst:573 msgid "" -"Objects other than Unicode or its subtypes will cause a :exc:`TypeError`." -msgstr "" -"Unicode やそのサブタイプ以外のオブジェクトでは :exc:`TypeError` が引き起こさ" -"れます。" - -#: ../../c-api/unicode.rst:607 -msgid "Create a Unicode Object from the given Unicode code point *ordinal*." -msgstr "" - -#: ../../c-api/unicode.rst:609 -msgid "" -"The ordinal must be in ``range(0x110000)``. A :exc:`ValueError` is raised in " -"the case it is not." -msgstr "" - -#: ../../c-api/unicode.rst:616 -msgid "Decode an encoded object *obj* to a Unicode object." -msgstr "エンコードされている *obj* を Unicode オブジェクトにデコードします。" - -#: ../../c-api/unicode.rst:618 -msgid "" -":class:`bytes`, :class:`bytearray` and other :term:`bytes-like objects " -"` are decoded according to the given *encoding* and using " -"the error handling defined by *errors*. Both can be ``NULL`` to have the " -"interface use the default values (see :ref:`builtincodecs` for details)." +":class:`bytes`, :class:`bytearray` and other :term:`bytes-like objects " +"` are decoded according to the given *encoding* and using " +"the error handling defined by *errors*. Both can be ``NULL`` to have the " +"interface use the default values (see :ref:`builtincodecs` for details)." msgstr "" ":class:`bytes` や :class:`bytearray` や他の :term:`bytes-like objects ` は、与えられた *encoding* に従ってデコードされ、 *errors* で定" @@ -958,7 +925,7 @@ msgstr "" "これらの引数は両方とも ``NULL`` にでき、その場合この API はデフォルト値を使い" "ます (詳しことは :ref:`builtincodecs` を参照してください)。" -#: ../../c-api/unicode.rst:624 +#: ../../c-api/unicode.rst:579 msgid "" "All other objects, including Unicode objects, cause a :exc:`TypeError` to be " "set." @@ -966,7 +933,7 @@ msgstr "" "その他のUnicodeオブジェクトを含むオブジェクトは :exc:`TypeError` 例外を引き起" "こします。" -#: ../../c-api/unicode.rst:627 +#: ../../c-api/unicode.rst:582 msgid "" "The API returns ``NULL`` if there was an error. The caller is responsible " "for decref'ing the returned objects." @@ -974,184 +941,279 @@ msgstr "" "この API は、エラーが生じたときには ``NULL`` を返します。呼び出し側は返された" "オブジェクトに対し参照カウンタを 1 つ減らす (decref) する責任があります。" -#: ../../c-api/unicode.rst:633 +#: ../../c-api/unicode.rst:588 +msgid "Return the length of the Unicode object, in code points." +msgstr "Unicode オブジェクトの長さをコードポイントで返します。" + +#: ../../c-api/unicode.rst:599 msgid "" -"Append the string *right* to the end of *p_left*. *p_left* must point to a :" -"term:`strong reference` to a Unicode object; :c:func:`!PyUnicode_Append` " -"releases (\"steals\") this reference." +"Copy characters from one Unicode object into another. This function " +"performs character conversion when necessary and falls back to :c:func:" +"`memcpy` if possible. Returns ``-1`` and sets an exception on error, " +"otherwise returns the number of copied characters." msgstr "" +"ある Unicode オブジェクトから他へ文字をコピーします。\n" +"この関数は必要なときに文字変換を行い、可能な場合は :c:func:`memcpy` へ差し戻" +"します。\n" +"失敗のときには ``-1`` を返し、例外を設定します。そうでない場合は、コピーした" +"文字数を返します。" -#: ../../c-api/unicode.rst:637 -msgid "On error, set *\\*p_left* to ``NULL`` and set an exception." +#: ../../c-api/unicode.rst:610 +msgid "" +"Fill a string with a character: write *fill_char* into ``unicode[start:" +"start+length]``." msgstr "" +"文字列を文字で埋めます: ``unicode[start:start+length]`` で *fill_char* を埋め" +"ることになります。" -#: ../../c-api/unicode.rst:639 -msgid "On success, set *\\*p_left* to a new strong reference to the result." +#: ../../c-api/unicode.rst:613 +msgid "" +"Fail if *fill_char* is bigger than the string maximum character, or if the " +"string has more than 1 reference." msgstr "" +"*fill_char* が文字列の最大文字よりも大きい場合や、文字列2つ以上の参照を持って" +"た場合は失敗します。" -#: ../../c-api/unicode.rst:644 +#: ../../c-api/unicode.rst:616 msgid "" -"The function is similar to :c:func:`PyUnicode_Append`, with the only " -"difference being that it decrements the reference count of *right* by one." +"Return the number of written character, or return ``-1`` and raise an " +"exception on error." msgstr "" +"書き込んだ文字数を返すか、失敗のときには ``-1`` を返し例外を送出します。" -#: ../../c-api/unicode.rst:650 +#: ../../c-api/unicode.rst:625 msgid "" -"Return a mapping suitable for decoding a custom single-byte encoding. Given " -"a Unicode string *string* of up to 256 characters representing an encoding " -"table, returns either a compact internal mapping object or a dictionary " -"mapping character ordinals to byte values. Raises a :exc:`TypeError` and " -"return ``NULL`` on invalid input." +"Write a character to a string. The string must have been created through :c:" +"func:`PyUnicode_New`. Since Unicode strings are supposed to be immutable, " +"the string must not be shared, or have been hashed yet." msgstr "" +"文字列に文字を書き込みます。\n" +"文字列は :c:func:`PyUnicode_New` で作成しなければなりません。\n" +"Unicode 文字列は不変とされているので、この文字列は共有されていたり、これまで" +"にハッシュ化されていてはいけません。" -#: ../../c-api/unicode.rst:661 +#: ../../c-api/unicode.rst:629 msgid "" -"Return the name of the default string encoding, ``\"utf-8\"``. See :func:" -"`sys.getdefaultencoding`." +"This function checks that *unicode* is a Unicode object, that the index is " +"not out of bounds, and that the object can be modified safely (i.e. that it " +"its reference count is one)." msgstr "" +"この関数は *unicode* が Unicode オブジェクトであること、インデックスが範囲内" +"であること、オブジェクトが安全に変更できる (つまり参照カウントが1である) こと" +"をチェックします。" -#: ../../c-api/unicode.rst:664 +#: ../../c-api/unicode.rst:638 msgid "" -"The returned string does not need to be freed, and is valid until " -"interpreter shutdown." +"Read a character from a string. This function checks that *unicode* is a " +"Unicode object and the index is not out of bounds, in contrast to the macro " +"version :c:func:`PyUnicode_READ_CHAR`." msgstr "" +"文字列から文字を読み取ります。\n" +"マクロ版の :c:func:`PyUnicode_READ_CHAR` とは対照的に、この関数は *unicode* " +"が Unicode オブジェクトであること、インデックスが範囲内であることをチェックし" +"ます。" -#: ../../c-api/unicode.rst:670 -msgid "Return the length of the Unicode object, in code points." -msgstr "Unicode オブジェクトの長さをコードポイントで返します。" +#: ../../c-api/unicode.rst:648 +msgid "" +"Return a substring of *str*, from character index *start* (included) to " +"character index *end* (excluded). Negative indices are not supported." +msgstr "" +"*str* の文字インデックス *start* (端点を含む) から文字インデックス *end* (端" +"点を含まず) までの部分文字列を返します。\n" +"負のインデックスはサポートされていません。" -#: ../../c-api/unicode.rst:672 -msgid "On error, set an exception and return ``-1``." +#: ../../c-api/unicode.rst:657 +msgid "" +"Copy the string *u* into a UCS4 buffer, including a null character, if " +"*copy_null* is set. Returns ``NULL`` and sets an exception on error (in " +"particular, a :exc:`SystemError` if *buflen* is smaller than the length of " +"*u*). *buffer* is returned on success." msgstr "" +"文字列 *u* を UCS4 のバッファへコピーします。\n" +"*copy_null* が設定されている場合は、ヌル文字も含めます。\n" +"エラーが起きたときは、 ``NULL`` を返し、例外を設定します (*buflen* が *u* の" +"長さより短かった場合については、 :exc:`SystemError` が設定されます)。\n" +"成功したときは *buffer* を返します。" -#: ../../c-api/unicode.rst:683 +#: ../../c-api/unicode.rst:667 msgid "" -"Copy characters from one Unicode object into another. This function " -"performs character conversion when necessary and falls back to :c:func:`!" -"memcpy` if possible. Returns ``-1`` and sets an exception on error, " -"otherwise returns the number of copied characters." +"Copy the string *u* into a new UCS4 buffer that is allocated using :c:func:" +"`PyMem_Malloc`. If this fails, ``NULL`` is returned with a :exc:" +"`MemoryError` set. The returned buffer always has an extra null code point " +"appended." msgstr "" -"ある Unicode オブジェクトから他へ文字をコピーします。\n" -"この関数は必要なときに文字変換を行い、可能な場合は :c:func:`!memcpy` へ差し戻" -"します。\n" -"失敗のときには ``-1`` を返し、例外を設定します。そうでない場合は、コピーした" -"文字数を返します。" +"文字列 *u* を :c:func:`PyMem_Malloc` でメモリ確保された新しい UCS4 型のバッ" +"ファにコピーします。\n" +"これが失敗した場合は、 ``NULL`` を返し :exc:`MemoryError` をセットします。\n" +"返されたバッファは必ず null コードポイントが追加されています。" + +#: ../../c-api/unicode.rst:676 +msgid "Deprecated Py_UNICODE APIs" +msgstr "廃止予定の Py_UNICODE API群" -#: ../../c-api/unicode.rst:688 ../../c-api/unicode.rst:718 -#: ../../c-api/unicode.rst:738 +#: ../../c-api/unicode.rst:680 msgid "" -"The string must not have been “used” yet. See :c:func:`PyUnicode_New` for " -"details." +"These API functions are deprecated with the implementation of :pep:`393`. " +"Extension modules can continue using them, as they will not be removed in " +"Python 3.x, but need to be aware that their use can now cause performance " +"and memory hits." msgstr "" +"これらのAPI 関数は :pep:`393` の実装により廃止予定です。Python 3.x では削除さ" +"れないため、拡張モジュールはこれらの関数を引き続き使えますが、これらの関数の" +"使用はパフォーマンスとメモリに影響があることを念頭に置いてください。" -#: ../../c-api/unicode.rst:696 +#: ../../c-api/unicode.rst:687 msgid "" -"Resize a Unicode object *\\*unicode* to the new *length* in code points." +"Create a Unicode object from the Py_UNICODE buffer *u* of the given size. " +"*u* may be ``NULL`` which causes the contents to be undefined. It is the " +"user's responsibility to fill in the needed data. The buffer is copied into " +"the new object." msgstr "" +"*size* で指定された長さを持つ Py_UNICODE 型バッファ *u* から Unicode オブジェ" +"クトを生成します。\n" +"*u* を ``NULL`` にしてもよく、その場合オブジェクトの内容は未定義です。\n" +"バッファに必要な情報を埋めるのはユーザの責任です。\n" +"バッファの内容は新たなオブジェクトにコピーされます。" -#: ../../c-api/unicode.rst:698 +#: ../../c-api/unicode.rst:692 msgid "" -"Try to resize the string in place (which is usually faster than allocating a " -"new string and copying characters), or create a new string." +"If the buffer is not ``NULL``, the return value might be a shared object. " +"Therefore, modification of the resulting Unicode object is only allowed when " +"*u* is ``NULL``." msgstr "" +"バッファが ``NULL`` でない場合、戻り値は共有されたオブジェクトになることがあ" +"ります。\n" +"従って、この関数が返す Unicode オブジェクトを変更してよいのは *u* が " +"``NULL`` のときだけです。" -#: ../../c-api/unicode.rst:701 +#: ../../c-api/unicode.rst:696 msgid "" -"*\\*unicode* is modified to point to the new (resized) object and ``0`` is " -"returned on success. Otherwise, ``-1`` is returned and an exception is set, " -"and *\\*unicode* is left untouched." +"If the buffer is ``NULL``, :c:func:`PyUnicode_READY` must be called once the " +"string content has been filled before using any of the access macros such " +"as :c:func:`PyUnicode_KIND`." msgstr "" +"バッファが ``NULL`` の場合、文字列の内容が埋められたなら :c:func:" +"`PyUnicode_KIND` のようなアクセスマクロを使う前に :c:func:`PyUnicode_READY` " +"を呼び出さなければなりません。" -#: ../../c-api/unicode.rst:705 +#: ../../c-api/unicode.rst:703 msgid "" -"The function doesn't check string content, the result may not be a string in " -"canonical representation." +"Part of the old-style Unicode API, please migrate to using :c:func:" +"`PyUnicode_FromKindAndData`, :c:func:`PyUnicode_FromWideChar`, or :c:func:" +"`PyUnicode_New`." msgstr "" -#: ../../c-api/unicode.rst:712 +#: ../../c-api/unicode.rst:708 msgid "" -"Fill a string with a character: write *fill_char* into ``unicode[start:" -"start+length]``." +"Return a read-only pointer to the Unicode object's internal :c:type:" +"`Py_UNICODE` buffer, or ``NULL`` on error. This will create the :c:type:" +"`Py_UNICODE*` representation of the object if it is not yet available. The " +"buffer is always terminated with an extra null code point. Note that the " +"resulting :c:type:`Py_UNICODE` string may also contain embedded null code " +"points, which would cause the string to be truncated when used in most C " +"functions." msgstr "" -"文字列を文字で埋めます: ``unicode[start:start+length]`` で *fill_char* を埋め" -"ることになります。" +"Unicode オブジェクトの :c:type:`Py_UNICODE` 型の内部バッファへの読み出し専用" +"のポインタを返すか、失敗のときには ``NULL`` を返します。\n" +"オブジェクトの :c:type:`Py_UNICODE*` 表現形式が無い場合には作成します。\n" +"結果の :c:type:`Py_UNICODE` 文字列には null コードポイントが含まれていること" +"があり、たいていの C 関数では、そのような文字列は切り詰められてしまうことに注" +"意してください。" -#: ../../c-api/unicode.rst:715 +#: ../../c-api/unicode.rst:720 ../../c-api/unicode.rst:748 msgid "" -"Fail if *fill_char* is bigger than the string maximum character, or if the " -"string has more than 1 reference." +"Part of the old-style Unicode API, please migrate to using :c:func:" +"`PyUnicode_AsUCS4`, :c:func:`PyUnicode_AsWideChar`, :c:func:" +"`PyUnicode_ReadChar` or similar new APIs." msgstr "" -"*fill_char* が文字列の最大文字よりも大きい場合や、文字列2つ以上の参照を持って" -"た場合は失敗します。" -#: ../../c-api/unicode.rst:721 +#: ../../c-api/unicode.rst:726 msgid "" -"Return the number of written character, or return ``-1`` and raise an " -"exception on error." +"Create a Unicode object by replacing all decimal digits in :c:type:" +"`Py_UNICODE` buffer of the given *size* by ASCII digits 0--9 according to " +"their decimal value. Return ``NULL`` if an exception occurs." msgstr "" -"書き込んだ文字数を返すか、失敗のときには ``-1`` を返し例外を送出します。" +"与えられた長さ *size* を持つ :c:type:`Py_UNICODE` 型のバッファにある全ての " +"decimal digit を、それらの10進の値に対応する 0 から 9 までの ASCII 数字に置き" +"換えた Unicode オブジェクトを生成します。\n" +"例外が起きた場合は ``NULL`` を返します。" -#: ../../c-api/unicode.rst:730 +#: ../../c-api/unicode.rst:732 msgid "" -"Write a *character* to the string *unicode* at the zero-based *index*. " -"Return ``0`` on success, ``-1`` on error with an exception set." +"Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using :c:" +"func:`Py_UNICODE_TODECIMAL`." msgstr "" -#: ../../c-api/unicode.rst:733 +#: ../../c-api/unicode.rst:737 msgid "" -"This function checks that *unicode* is a Unicode object, that the index is " -"not out of bounds, and that the object's reference count is one). See :c:" -"func:`PyUnicode_WRITE` for a version that skips these checks, making them " -"your responsibility." +"Like :c:func:`PyUnicode_AsUnicode`, but also saves the :c:func:`Py_UNICODE` " +"array length (excluding the extra null terminator) in *size*. Note that the " +"resulting :c:type:`Py_UNICODE*` string may contain embedded null code " +"points, which would cause the string to be truncated when used in most C " +"functions." msgstr "" +":c:func:`PyUnicode_AsUnicode` に似てますが、さらに (追加の null 終端子を除い" +"た) :c:func:`Py_UNICODE` 配列の長さを *size* に保存します。\n" +"結果の :c:type:`Py_UNICODE` 文字列には null コードポイントが含まれていること" +"があり、たいていの C 関数では、そのような文字列は切り詰められてしまうことに注" +"意してください。" -#: ../../c-api/unicode.rst:746 +#: ../../c-api/unicode.rst:753 msgid "" -"Read a character from a string. This function checks that *unicode* is a " -"Unicode object and the index is not out of bounds, in contrast to :c:func:" -"`PyUnicode_READ_CHAR`, which performs no error checking." +"Create a copy of a Unicode string ending with a null code point. Return " +"``NULL`` and raise a :exc:`MemoryError` exception on memory allocation " +"failure, otherwise return a new allocated buffer (use :c:func:`PyMem_Free` " +"to free the buffer). Note that the resulting :c:type:`Py_UNICODE*` string " +"may contain embedded null code points, which would cause the string to be " +"truncated when used in most C functions." msgstr "" -"文字列から文字を読み取ります。\n" -"エラーチェックを行わない :c:func:`PyUnicode_READ_CHAR` とは対照的に、この関数" -"は *unicode* が Unicode オブジェクトであること、インデックスが範囲内であるこ" -"とをチェックします。" +"終端に null コードポイントが付加された Unicode 文字列のコピーを作成します。\n" +"メモリ確保に失敗したときは ``NULL`` を返し :exc:`MemoryError` 例外を送出しま" +"す。\n" +"そうでないときは新しくメモリ確保されたバッファを返します (このバッファを解放" +"するときには :c:func:`PyMem_Free` を使ってください)。\n" +"結果の :c:type:`Py_UNICODE` 文字列には null コードポイントが含まれていること" +"があり、たいていの C 関数では、そのような文字列は切り詰められてしまうことに注" +"意してください。" -#: ../../c-api/unicode.rst:750 -msgid "Return character on success, ``-1`` on error with an exception set." +#: ../../c-api/unicode.rst:762 +msgid "" +"Please migrate to using :c:func:`PyUnicode_AsUCS4Copy` or similar new APIs." msgstr "" +":c:func:`PyUnicode_AsUCS4Copy` や類似の新しい API を使用するように移行してく" +"ださい。" -#: ../../c-api/unicode.rst:758 +#: ../../c-api/unicode.rst:767 msgid "" -"Return a substring of *unicode*, from character index *start* (included) to " -"character index *end* (excluded). Negative indices are not supported. On " -"error, set an exception and return ``NULL``." +"Return the size of the deprecated :c:type:`Py_UNICODE` representation, in " +"code units (this includes surrogate pairs as 2 units)." msgstr "" +"非推奨の :c:type:`Py_UNICODE` 表現形式のサイズをコード単位で返します (サロ" +"ゲートペアを2つとしています)。" -#: ../../c-api/unicode.rst:768 +#: ../../c-api/unicode.rst:777 msgid "" -"Copy the string *unicode* into a UCS4 buffer, including a null character, if " -"*copy_null* is set. Returns ``NULL`` and sets an exception on error (in " -"particular, a :exc:`SystemError` if *buflen* is smaller than the length of " -"*unicode*). *buffer* is returned on success." +"Copy an instance of a Unicode subtype to a new true Unicode object if " +"necessary. If *obj* is already a true Unicode object (not a subtype), return " +"the reference with incremented refcount." msgstr "" +"Unicode のサブタイプのインスタンスを、必要な場合は本物の Unicode オブジェクト" +"にコピーします。\n" +"*obj* が (サブタイプではない) 既に本物の Unicode オブジェクトだった場合は、参" +"照カウントを1つ増やした参照を返します。" -#: ../../c-api/unicode.rst:778 +#: ../../c-api/unicode.rst:781 msgid "" -"Copy the string *unicode* into a new UCS4 buffer that is allocated using :c:" -"func:`PyMem_Malloc`. If this fails, ``NULL`` is returned with a :exc:" -"`MemoryError` set. The returned buffer always has an extra null code point " -"appended." +"Objects other than Unicode or its subtypes will cause a :exc:`TypeError`." msgstr "" -"文字列 *unicode* を :c:func:`PyMem_Malloc` でメモリ確保された新しい UCS4 型の" -"バッファにコピーします。\n" -"これが失敗した場合は、 ``NULL`` を返し :exc:`MemoryError` をセットします。\n" -"返されたバッファは必ず null コードポイントが追加されています。" +"Unicode やそのサブタイプ以外のオブジェクトでは :exc:`TypeError` が引き起こさ" +"れます。" -#: ../../c-api/unicode.rst:787 +#: ../../c-api/unicode.rst:785 msgid "Locale Encoding" msgstr "ロケールエンコーディング" -#: ../../c-api/unicode.rst:789 +#: ../../c-api/unicode.rst:787 msgid "" "The current locale encoding can be used to decode text from the operating " "system." @@ -1159,7 +1221,7 @@ msgstr "" "現在のロケールエンコーディングはオペレーティングシステムのテキストをデコード" "するのに使えます。" -#: ../../c-api/unicode.rst:796 +#: ../../c-api/unicode.rst:794 msgid "" "Decode a string from UTF-8 on Android and VxWorks, or from the current " "locale encoding on other platforms. The supported error handlers are " @@ -1168,21 +1230,25 @@ msgid "" "null character but cannot contain embedded null characters." msgstr "" -#: ../../c-api/unicode.rst:803 +#: ../../c-api/unicode.rst:801 msgid "" -"Use :c:func:`PyUnicode_DecodeFSDefaultAndSize` to decode a string from the :" -"term:`filesystem encoding and error handler`." +"Use :c:func:`PyUnicode_DecodeFSDefaultAndSize` to decode a string from :c:" +"data:`Py_FileSystemDefaultEncoding` (the locale encoding read at Python " +"startup)." msgstr "" +":c:func:`PyUnicode_DecodeFSDefaultAndSize` を使って (Python の起動時に読み込" +"まれるロケールエンコーディングの) :c:data:`Py_FileSystemDefaultEncoding` の文" +"字列をデコードします。" -#: ../../c-api/unicode.rst:806 ../../c-api/unicode.rst:841 -msgid "This function ignores the :ref:`Python UTF-8 Mode `." -msgstr "" +#: ../../c-api/unicode.rst:805 ../../c-api/unicode.rst:841 +msgid "This function ignores the Python UTF-8 mode." +msgstr "この関数は Python の UTF-8 モードを無視します。" -#: ../../c-api/unicode.rst:810 ../../c-api/unicode.rst:926 +#: ../../c-api/unicode.rst:809 ../../c-api/unicode.rst:913 msgid "The :c:func:`Py_DecodeLocale` function." msgstr ":c:func:`Py_DecodeLocale` 関数。" -#: ../../c-api/unicode.rst:814 +#: ../../c-api/unicode.rst:813 msgid "" "The function now also uses the current locale encoding for the " "``surrogateescape`` error handler, except on Android. Previously, :c:func:" @@ -1194,13 +1260,15 @@ msgstr "" "以前は、 :c:func:`Py_DecodeLocale` が ``surrogateescape`` で使われ、現在のロ" "ケールエンコーディングは ``strict`` で使われていました。" -#: ../../c-api/unicode.rst:823 +#: ../../c-api/unicode.rst:822 msgid "" "Similar to :c:func:`PyUnicode_DecodeLocaleAndSize`, but compute the string " -"length using :c:func:`!strlen`." +"length using :c:func:`strlen`." msgstr "" +":c:func:`PyUnicode_DecodeLocaleAndSize` と似てますが、 :c:func:`strlen` を" +"使って文字列の長さを計算します。" -#: ../../c-api/unicode.rst:831 +#: ../../c-api/unicode.rst:830 msgid "" "Encode a Unicode object to UTF-8 on Android and VxWorks, or to the current " "locale encoding on other platforms. The supported error handlers are " @@ -1209,13 +1277,16 @@ msgid "" "`bytes` object. *unicode* cannot contain embedded null characters." msgstr "" -#: ../../c-api/unicode.rst:838 +#: ../../c-api/unicode.rst:837 msgid "" -"Use :c:func:`PyUnicode_EncodeFSDefault` to encode a string to the :term:" -"`filesystem encoding and error handler`." +"Use :c:func:`PyUnicode_EncodeFSDefault` to encode a string to :c:data:" +"`Py_FileSystemDefaultEncoding` (the locale encoding read at Python startup)." msgstr "" +":c:func:`PyUnicode_EncodeFSDefault` を使って (Python の起動時に読み込まれるロ" +"ケールエンコーディングの) :c:data:`Py_FileSystemDefaultEncoding` の文字列へエ" +"ンコードします。" -#: ../../c-api/unicode.rst:845 ../../c-api/unicode.rst:957 +#: ../../c-api/unicode.rst:845 ../../c-api/unicode.rst:949 msgid "The :c:func:`Py_EncodeLocale` function." msgstr ":c:func:`Py_EncodeLocale` 関数。" @@ -1237,178 +1308,219 @@ msgstr "ファイルシステムエンコーディング" #: ../../c-api/unicode.rst:860 msgid "" -"Functions encoding to and decoding from the :term:`filesystem encoding and " -"error handler` (:pep:`383` and :pep:`529`)." -msgstr "" - -#: ../../c-api/unicode.rst:863 -msgid "" -"To encode file names to :class:`bytes` during argument parsing, the " -"``\"O&\"`` converter should be used, passing :c:func:`!" -"PyUnicode_FSConverter` as the conversion function:" -msgstr "" +"To encode and decode file names and other environment strings, :c:data:" +"`Py_FileSystemDefaultEncoding` should be used as the encoding, and :c:data:" +"`Py_FileSystemDefaultEncodeErrors` should be used as the error handler (:pep:" +"`383` and :pep:`529`). To encode file names to :class:`bytes` during " +"argument parsing, the ``\"O&\"`` converter should be used, passing :c:func:" +"`PyUnicode_FSConverter` as the conversion function:" +msgstr "" +"ファイル名や他の環境文字列のエンコードやデコードを行うには、 :c:data:" +"`Py_FileSystemDefaultEncoding` をエンコーディングとして使い、 :c:data:" +"`Py_FileSystemDefaultEncodeErrors` をエラーハンドラとして使うべきです (:pep:" +"`383` および :pep:`529`)。\n" +"引数の構文解析中にファイル名を :class:`bytes` にエンコードするには、 " +"``\"O&\"`` コンバーターを使い、 :c:func:`PyUnicode_FSConverter` を変換関数と" +"して渡すべきです:" #: ../../c-api/unicode.rst:869 msgid "" -":ref:`PyArg_Parse\\* converter `: encode :class:`str` objects " -"-- obtained directly or through the :class:`os.PathLike` interface -- to :" -"class:`bytes` using :c:func:`PyUnicode_EncodeFSDefault`; :class:`bytes` " -"objects are output as-is. *result* must be an address of a C variable of " -"type :c:expr:`PyObject*` (or :c:expr:`PyBytesObject*`). On success, set the " -"variable to a new :term:`strong reference` to a :ref:`bytes object " -"` which must be released when it is no longer used and return " -"a non-zero value (:c:macro:`Py_CLEANUP_SUPPORTED`). Embedded null bytes are " -"not allowed in the result. On failure, return ``0`` with an exception set." +"ParseTuple converter: encode :class:`str` objects -- obtained directly or " +"through the :class:`os.PathLike` interface -- to :class:`bytes` using :c:" +"func:`PyUnicode_EncodeFSDefault`; :class:`bytes` objects are output as-is. " +"*result* must be a :c:type:`PyBytesObject*` which must be released when it " +"is no longer used." msgstr "" +"ParseTuple コンバーター: :c:func:`PyUnicode_EncodeFSDefault` を使い -- 直接あ" +"るいは :class:`os.PathLike` インターフェースを通して取得した -- :class:`str` " +"オブジェクトを :class:`bytes` へエンコードします;\n" +":class:`bytes` オブジェクトはそのまま出力されます。\n" +"*result* は :c:type:`PyBytesObject*` でなければならず、使われなくなったときに" +"は解放されなければなりません。" -#: ../../c-api/unicode.rst:881 -msgid "" -"If *obj* is ``NULL``, the function releases a strong reference stored in the " -"variable referred by *result* and returns ``1``." -msgstr "" - -#: ../../c-api/unicode.rst:886 ../../c-api/unicode.rst:913 +#: ../../c-api/unicode.rst:877 ../../c-api/unicode.rst:894 msgid "Accepts a :term:`path-like object`." msgstr ":term:`path-like object` を受け入れるようになりました。" -#: ../../c-api/unicode.rst:889 +#: ../../c-api/unicode.rst:880 msgid "" "To decode file names to :class:`str` during argument parsing, the ``\"O&\"`` " -"converter should be used, passing :c:func:`!PyUnicode_FSDecoder` as the " +"converter should be used, passing :c:func:`PyUnicode_FSDecoder` as the " "conversion function:" msgstr "" +"引数の構文解析中にファイル名を :class:`str` にデコードするには、 ``\"O&\"`` " +"コンバーターを使い、 :c:func:`PyUnicode_FSDecoder` を変換関数として渡すのがよ" +"いです:" -#: ../../c-api/unicode.rst:895 +#: ../../c-api/unicode.rst:886 msgid "" -":ref:`PyArg_Parse\\* converter `: decode :class:`bytes` objects " -"-- obtained either directly or indirectly through the :class:`os.PathLike` " -"interface -- to :class:`str` using :c:func:" -"`PyUnicode_DecodeFSDefaultAndSize`; :class:`str` objects are output as-is. " -"*result* must be an address of a C variable of type :c:expr:`PyObject*` (or :" -"c:expr:`PyUnicodeObject*`). On success, set the variable to a new :term:" -"`strong reference` to a :ref:`Unicode object ` which must be " -"released when it is no longer used and return a non-zero value (:c:macro:" -"`Py_CLEANUP_SUPPORTED`). Embedded null characters are not allowed in the " -"result. On failure, return ``0`` with an exception set." +"ParseTuple converter: decode :class:`bytes` objects -- obtained either " +"directly or indirectly through the :class:`os.PathLike` interface -- to :" +"class:`str` using :c:func:`PyUnicode_DecodeFSDefaultAndSize`; :class:`str` " +"objects are output as-is. *result* must be a :c:type:`PyUnicodeObject*` " +"which must be released when it is no longer used." msgstr "" +"ParseTuple コンバーター: :c:func:`PyUnicode_DecodeFSDefaultAndSize` を使い " +"-- 直接的あるいは間接的に :class:`os.PathLike` インターフェースを通して取得し" +"た -- :class:`bytes` オブジェクトを :class:`str` へエンコードします;\n" +":class:`bytes` オブジェクトはそのまま出力されます。\n" +"*result* は :c:type:`PyUnicodeObject*` でなければならず、使われなくなったとき" +"には解放されなければなりません。" -#: ../../c-api/unicode.rst:908 +#: ../../c-api/unicode.rst:900 msgid "" -"If *obj* is ``NULL``, release the strong reference to the object referred to " -"by *result* and return ``1``." +"Decode a string using :c:data:`Py_FileSystemDefaultEncoding` and the :c:data:" +"`Py_FileSystemDefaultEncodeErrors` error handler." msgstr "" +":c:data:`Py_FileSystemDefaultEncoding` と :c:data:" +"`Py_FileSystemDefaultEncodeErrors` エラーハンドラを使い、文字列をデコードしま" +"す。" -#: ../../c-api/unicode.rst:919 -msgid "Decode a string from the :term:`filesystem encoding and error handler`." +#: ../../c-api/unicode.rst:903 ../../c-api/unicode.rst:924 +#: ../../c-api/unicode.rst:940 +msgid "" +"If :c:data:`Py_FileSystemDefaultEncoding` is not set, fall back to the " +"locale encoding." msgstr "" +":c:data:`Py_FileSystemDefaultEncoding` が設定されていない場合は、ロケールエン" +"コーディングに差し戻されます。" -#: ../../c-api/unicode.rst:921 +#: ../../c-api/unicode.rst:906 msgid "" -"If you need to decode a string from the current locale encoding, use :c:func:" +":c:data:`Py_FileSystemDefaultEncoding` is initialized at startup from the " +"locale encoding and cannot be modified later. If you need to decode a string " +"from the current locale encoding, use :c:func:" "`PyUnicode_DecodeLocaleAndSize`." msgstr "" +":c:data:`Py_FileSystemDefaultEncoding` は起動時にロケールエンコーディングで初" +"期化され、それ以降は変更できません。\n" +"現在のロケールエンコーディングで文字列をデコードする必要がある場合は、 :c:" +"func:`PyUnicode_DecodeLocaleAndSize` を使ってください。" -#: ../../c-api/unicode.rst:928 ../../c-api/unicode.rst:941 -#: ../../c-api/unicode.rst:961 -msgid "" -"The :term:`filesystem error handler ` " -"is now used." +#: ../../c-api/unicode.rst:915 ../../c-api/unicode.rst:929 +#: ../../c-api/unicode.rst:953 +msgid "Use :c:data:`Py_FileSystemDefaultEncodeErrors` error handler." msgstr "" +":c:data:`Py_FileSystemDefaultEncodeErrors` エラーハンドラを使うようになりまし" +"た。" -#: ../../c-api/unicode.rst:935 +#: ../../c-api/unicode.rst:921 msgid "" -"Decode a null-terminated string from the :term:`filesystem encoding and " -"error handler`." +"Decode a null-terminated string using :c:data:`Py_FileSystemDefaultEncoding` " +"and the :c:data:`Py_FileSystemDefaultEncodeErrors` error handler." msgstr "" +":c:data:`Py_FileSystemDefaultEncoding` と :c:data:" +"`Py_FileSystemDefaultEncodeErrors` エラーハンドラを使い、 null 終端文字列をデ" +"コードします。" -#: ../../c-api/unicode.rst:938 +#: ../../c-api/unicode.rst:927 msgid "" -"If the string length is known, use :c:func:" -"`PyUnicode_DecodeFSDefaultAndSize`." +"Use :c:func:`PyUnicode_DecodeFSDefaultAndSize` if you know the string length." msgstr "" +"文字列の長さが分かっている場合は、 :c:func:" +"`PyUnicode_DecodeFSDefaultAndSize` を使ってください。" -#: ../../c-api/unicode.rst:948 +#: ../../c-api/unicode.rst:935 msgid "" -"Encode a Unicode object to the :term:`filesystem encoding and error " -"handler`, and return :class:`bytes`. Note that the resulting :class:`bytes` " -"object can contain null bytes." +"Encode a Unicode object to :c:data:`Py_FileSystemDefaultEncoding` with the :" +"c:data:`Py_FileSystemDefaultEncodeErrors` error handler, and return :class:" +"`bytes`. Note that the resulting :class:`bytes` object may contain null " +"bytes." msgstr "" +":c:data:`Py_FileSystemDefaultEncoding` エラーハンドラで Unicode オブジェクト" +"を :c:data:`Py_FileSystemDefaultEncoding` にエンコードし、 :class:`bytes` を" +"返します。\n" +"返される :class:`bytes` オブジェクトは null バイトを含んでいるかもしれないこ" +"とに注意してください。" -#: ../../c-api/unicode.rst:952 +#: ../../c-api/unicode.rst:943 msgid "" -"If you need to encode a string to the current locale encoding, use :c:func:" -"`PyUnicode_EncodeLocale`." +":c:data:`Py_FileSystemDefaultEncoding` is initialized at startup from the " +"locale encoding and cannot be modified later. If you need to encode a string " +"to the current locale encoding, use :c:func:`PyUnicode_EncodeLocale`." msgstr "" +":c:data:`Py_FileSystemDefaultEncoding` は起動時にロケールエンコーディングで初" +"期化され、それ以降は変更できません。\n" +"現在のロケールエンコーディングで文字列をエンコードする必要がある場合は、 :c:" +"func:`PyUnicode_EncodeLocale` を使ってください。" -#: ../../c-api/unicode.rst:966 +#: ../../c-api/unicode.rst:957 msgid "wchar_t Support" msgstr "wchar_t サポート" -#: ../../c-api/unicode.rst:968 +#: ../../c-api/unicode.rst:959 msgid ":c:type:`wchar_t` support for platforms which support it:" msgstr ":c:type:`wchar_t` をサポートするプラットフォームでの wchar_t サポート:" -#: ../../c-api/unicode.rst:972 +#: ../../c-api/unicode.rst:963 msgid "" -"Create a Unicode object from the :c:type:`wchar_t` buffer *wstr* of the " -"given *size*. Passing ``-1`` as the *size* indicates that the function must " -"itself compute the length, using :c:func:`!wcslen`. Return ``NULL`` on " -"failure." +"Create a Unicode object from the :c:type:`wchar_t` buffer *w* of the given " +"*size*. Passing ``-1`` as the *size* indicates that the function must itself " +"compute the length, using wcslen. Return ``NULL`` on failure." msgstr "" +"*size* の :c:type:`wchar_t` バッファ *w* から Unicode オブジェクトを生成しま" +"す。\n" +"*size* として ``-1`` を渡すことで、 wcslen を使い自身で長さを計算しなければな" +"らないことを関数に指示します。\n" +"失敗すると ``NULL`` を返します。" -#: ../../c-api/unicode.rst:980 +#: ../../c-api/unicode.rst:971 msgid "" -"Copy the Unicode object contents into the :c:type:`wchar_t` buffer *wstr*. " -"At most *size* :c:type:`wchar_t` characters are copied (excluding a possibly " +"Copy the Unicode object contents into the :c:type:`wchar_t` buffer *w*. At " +"most *size* :c:type:`wchar_t` characters are copied (excluding a possibly " "trailing null termination character). Return the number of :c:type:" -"`wchar_t` characters copied or ``-1`` in case of an error." -msgstr "" - -#: ../../c-api/unicode.rst:985 -msgid "" -"When *wstr* is ``NULL``, instead return the *size* that would be required to " -"store all of *unicode* including a terminating null." -msgstr "" - -#: ../../c-api/unicode.rst:988 -msgid "" -"Note that the resulting :c:expr:`wchar_t*` string may or may not be null-" -"terminated. It is the responsibility of the caller to make sure that the :c:" -"expr:`wchar_t*` string is null-terminated in case this is required by the " -"application. Also, note that the :c:expr:`wchar_t*` string might contain " -"null characters, which would cause the string to be truncated when used with " -"most C functions." -msgstr "" - -#: ../../c-api/unicode.rst:998 +"`wchar_t` characters copied or ``-1`` in case of an error. Note that the " +"resulting :c:type:`wchar_t*` string may or may not be null-terminated. It " +"is the responsibility of the caller to make sure that the :c:type:`wchar_t*` " +"string is null-terminated in case this is required by the application. Also, " +"note that the :c:type:`wchar_t*` string might contain null characters, which " +"would cause the string to be truncated when used with most C functions." +msgstr "" +"Unicode オブジェクトの内容を :c:type:`wchar_t` バッファ *w* にコピーしま" +"す。\n" +"最大で *size* 個の :c:type:`wchar_t` 文字を (末尾の null 終端文字を除いて) コ" +"ピーします。\n" +"コピーした :c:type:`wchar_t` 文字の個数を返します。エラーの時には -1 を返しま" +"す。 :c:type:`wchar_t` 文字列は null 終端されている場合も、されていない場合も" +"あります。\n" +"関数の呼び出し側の責任で、アプリケーションの必要に応じて :c:type:`wchar_t` 文" +"字列を null 終端してください。\n" +"また、結果の :c:type:`wchar_t*` 文字列には文字列の途中にも null 文字が含まれ" +"ていることがあり、たいていの C 関数では、そのような文字列は切り詰められてしま" +"うことに注意してください。" + +#: ../../c-api/unicode.rst:984 msgid "" "Convert the Unicode object to a wide character string. The output string " "always ends with a null character. If *size* is not ``NULL``, write the " "number of wide characters (excluding the trailing null termination " "character) into *\\*size*. Note that the resulting :c:type:`wchar_t` string " "might contain null characters, which would cause the string to be truncated " -"when used with most C functions. If *size* is ``NULL`` and the :c:expr:" +"when used with most C functions. If *size* is ``NULL`` and the :c:type:" "`wchar_t*` string contains null characters a :exc:`ValueError` is raised." msgstr "" -#: ../../c-api/unicode.rst:1006 +#: ../../c-api/unicode.rst:992 msgid "" -"Returns a buffer allocated by :c:macro:`PyMem_New` (use :c:func:`PyMem_Free` " -"to free it) on success. On error, returns ``NULL`` and *\\*size* is " -"undefined. Raises a :exc:`MemoryError` if memory allocation is failed." +"Returns a buffer allocated by :c:func:`PyMem_Alloc` (use :c:func:" +"`PyMem_Free` to free it) on success. On error, returns ``NULL`` and " +"*\\*size* is undefined. Raises a :exc:`MemoryError` if memory allocation is " +"failed." msgstr "" -#: ../../c-api/unicode.rst:1013 +#: ../../c-api/unicode.rst:999 msgid "" -"Raises a :exc:`ValueError` if *size* is ``NULL`` and the :c:expr:`wchar_t*` " +"Raises a :exc:`ValueError` if *size* is ``NULL`` and the :c:type:`wchar_t*` " "string contains null characters." msgstr "" +"*size* が ``NULL`` かつ :c:type:`wchar_t*` 文字列が null 文字を含んでいた場" +"合、 :exc:`ValueError` を送出します。" -#: ../../c-api/unicode.rst:1021 +#: ../../c-api/unicode.rst:1007 msgid "Built-in Codecs" msgstr "組み込み codec (built-in codec)" -#: ../../c-api/unicode.rst:1023 +#: ../../c-api/unicode.rst:1009 msgid "" "Python provides a set of built-in codecs which are written in C for speed. " "All of these codecs are directly usable via the following functions." @@ -1416,7 +1528,7 @@ msgstr "" "Python には、処理速度を高めるために C で書かれた codec が揃えてあります。これ" "ら全ての codec は以下の関数を介して直接利用できます。" -#: ../../c-api/unicode.rst:1026 +#: ../../c-api/unicode.rst:1012 msgid "" "Many of the following APIs take two arguments encoding and errors, and they " "have the same semantics as the ones of the built-in :func:`str` string " @@ -1426,15 +1538,26 @@ msgstr "" "らのパラメータは、組み込みの文字列コンストラクタである :func:`str` における同" "名のパラメータと同じ意味を持ちます。" -#: ../../c-api/unicode.rst:1030 +#: ../../c-api/unicode.rst:1016 msgid "" "Setting encoding to ``NULL`` causes the default encoding to be used which is " "UTF-8. The file system calls should use :c:func:`PyUnicode_FSConverter` for " -"encoding file names. This uses the :term:`filesystem encoding and error " -"handler` internally." -msgstr "" - -#: ../../c-api/unicode.rst:1035 +"encoding file names. This uses the variable :c:data:" +"`Py_FileSystemDefaultEncoding` internally. This variable should be treated " +"as read-only: on some systems, it will be a pointer to a static string, on " +"others, it will change at run-time (such as when the application invokes " +"setlocale)." +msgstr "" +"*encoding* を ``NULL`` にすると、デフォルトエンコーディングである UTF-8 を使" +"います。\n" +"ファイルシステムに関する関数の呼び出しでは、ファイル名に対するエンコーディン" +"グとして :c:func:`PyUnicode_FSConverter` を使わねばなりません。\n" +"これは内部で変数 :c:data:`Py_FileSystemDefaultEncoding` を使用しています。\n" +"この変数は読み出し専用の変数として扱わねばなりません: この変数は、あるシステ" +"ムによっては静的な文字列に対するポインタであったり、また別のシステムでは、(ア" +"プリケーションが setlocale を呼んだときなどに) 変わったりもします。" + +#: ../../c-api/unicode.rst:1024 msgid "" "Error handling is set by errors which may also be set to ``NULL`` meaning to " "use the default handling defined for the codec. Default error handling for " @@ -1445,47 +1568,39 @@ msgstr "" "込み codec で、デフォルトのエラー処理は \"strict\" (:exc:`ValueError` を送出" "する) になっています。" -#: ../../c-api/unicode.rst:1039 +#: ../../c-api/unicode.rst:1028 msgid "" -"The codecs all use a similar interface. Only deviations from the following " +"The codecs all use a similar interface. Only deviation from the following " "generic ones are documented for simplicity." msgstr "" "個々の codec は全て同様のインターフェースを使っています。個別の codec の説明" "では、説明を簡単にするために以下の汎用のインターフェースとの違いだけを説明し" "ています。" -#: ../../c-api/unicode.rst:1044 +#: ../../c-api/unicode.rst:1033 msgid "Generic Codecs" msgstr "汎用 codec" -#: ../../c-api/unicode.rst:1046 -msgid "The following macro is provided:" -msgstr "" - -#: ../../c-api/unicode.rst:1051 -msgid "The Unicode code point ``U+FFFD`` (replacement character)." -msgstr "" - -#: ../../c-api/unicode.rst:1053 -msgid "" -"This Unicode character is used as the replacement character during decoding " -"if the *errors* argument is set to \"replace\"." -msgstr "" - -#: ../../c-api/unicode.rst:1057 +#: ../../c-api/unicode.rst:1035 msgid "These are the generic codec APIs:" msgstr "以下は汎用 codec の API です:" -#: ../../c-api/unicode.rst:1063 +#: ../../c-api/unicode.rst:1041 msgid "" -"Create a Unicode object by decoding *size* bytes of the encoded string " -"*str*. *encoding* and *errors* have the same meaning as the parameters of " -"the same name in the :func:`str` built-in function. The codec to be used is " -"looked up using the Python codec registry. Return ``NULL`` if an exception " -"was raised by the codec." +"Create a Unicode object by decoding *size* bytes of the encoded string *s*. " +"*encoding* and *errors* have the same meaning as the parameters of the same " +"name in the :func:`str` built-in function. The codec to be used is looked " +"up using the Python codec registry. Return ``NULL`` if an exception was " +"raised by the codec." msgstr "" +"*size* バイトのエンコードされた文字列 *s* をデコードして Unicode オブジェクト" +"を生成します。\n" +"*encoding* と *errors* は、組み込み関数 :func:`str` の同名のパラメータと同じ" +"意味を持ちます。\n" +"使用する codec の検索は、 Python の codec レジストリを使って行います。\n" +"codec が例外を送出した場合には ``NULL`` を返します。" -#: ../../c-api/unicode.rst:1073 +#: ../../c-api/unicode.rst:1051 msgid "" "Encode a Unicode object and return the result as Python bytes object. " "*encoding* and *errors* have the same meaning as the parameters of the same " @@ -1500,23 +1615,46 @@ msgstr "" "使用する codec の検索は、 Python の codec レジストリを使って行います。\n" "codec が例外を送出した場合には ``NULL`` を返します。" -#: ../../c-api/unicode.rst:1081 +#: ../../c-api/unicode.rst:1061 +msgid "" +"Encode the :c:type:`Py_UNICODE` buffer *s* of the given *size* and return a " +"Python bytes object. *encoding* and *errors* have the same meaning as the " +"parameters of the same name in the Unicode :meth:`~str.encode` method. The " +"codec to be used is looked up using the Python codec registry. Return " +"``NULL`` if an exception was raised by the codec." +msgstr "" +"*size* で指定されたサイズの :c:type:`Py_UNICODE` バッファ *s* をエンコードし" +"た Python の bytes オブジェクトを返します。\n" +"*encoding* および *errors* は Unicode 型の :meth:`~str.encode` メソッドに与え" +"る同名のパラメータと同じ意味を持ちます。\n" +"使用する codec の検索は、 Python の codec レジストリを使って行います。\n" +"codec が例外を送出した場合には ``NULL`` を返します。" + +#: ../../c-api/unicode.rst:1069 ../../c-api/unicode.rst:1326 +msgid "" +"Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using :c:" +"func:`PyUnicode_AsEncodedString`." +msgstr "" +"古いスタイルの :c:type:`Py_UNICODE` APIの一部です; :c:func:" +"`PyUnicode_AsEncodedString` を使用するように移行してください。" + +#: ../../c-api/unicode.rst:1073 msgid "UTF-8 Codecs" msgstr "UTF-8 Codecs" -#: ../../c-api/unicode.rst:1083 +#: ../../c-api/unicode.rst:1075 msgid "These are the UTF-8 codec APIs:" msgstr "以下は UTF-8 codec の APIです:" -#: ../../c-api/unicode.rst:1088 +#: ../../c-api/unicode.rst:1080 msgid "" "Create a Unicode object by decoding *size* bytes of the UTF-8 encoded string " -"*str*. Return ``NULL`` if an exception was raised by the codec." +"*s*. Return ``NULL`` if an exception was raised by the codec." msgstr "" -"UTF-8 でエンコードされた *size* バイトの文字列 *str* から Unicode オブジェク" -"トを生成します。codec が例外を送出した場合には ``NULL`` を返します。" +"UTF-8 でエンコードされた *size* バイトの文字列 *s* から Unicode オブジェクト" +"を生成します。codec が例外を送出した場合には ``NULL`` を返します。" -#: ../../c-api/unicode.rst:1095 +#: ../../c-api/unicode.rst:1087 msgid "" "If *consumed* is ``NULL``, behave like :c:func:`PyUnicode_DecodeUTF8`. If " "*consumed* is not ``NULL``, trailing incomplete UTF-8 byte sequences will " @@ -1524,11 +1662,12 @@ msgid "" "of bytes that have been decoded will be stored in *consumed*." msgstr "" "*consumed* が ``NULL`` の場合、 :c:func:`PyUnicode_DecodeUTF8` と同じように動" -"作します。 *consumed* が ``NULL`` でない場合、末尾の不完全な UTF-8 バイト列は" -"エラーとみなされません。これらのバイト列はデコードされず、デコードされたバイ" -"ト数は *consumed* に格納されます。" +"作します。 *consumed* が ``NULL`` でない場合、 :c:func:" +"`PyUnicode_DecodeUTF8Stateful` は末尾の不完全な UTF-8 バイト列をエラーとみな" +"しません。これらのバイト列はデコードされず、デコードされたバイト数を " +"*consumed* に返します。" -#: ../../c-api/unicode.rst:1103 +#: ../../c-api/unicode.rst:1095 msgid "" "Encode a Unicode object using UTF-8 and return the result as Python bytes " "object. Error handling is \"strict\". Return ``NULL`` if an exception was " @@ -1538,13 +1677,7 @@ msgstr "" "トとして返します。エラー処理は \"strict\" です。 codec が例外を送出した場合に" "は ``NULL`` を返します。" -#: ../../c-api/unicode.rst:1107 ../../c-api/unicode.rst:1122 -msgid "" -"The function fails if the string contains surrogate code points (``U+D800`` " -"- ``U+DFFF``)." -msgstr "" - -#: ../../c-api/unicode.rst:1113 +#: ../../c-api/unicode.rst:1102 msgid "" "Return a pointer to the UTF-8 encoding of the Unicode object, and store the " "size of the encoded representation (in bytes) in *size*. The *size* " @@ -1558,53 +1691,62 @@ msgstr "" "返されるバッファには、 null コードポイントがあるかどうかに関わらず、常に " "null バイトが終端に付加されています (これは *size* には勘定されません)。" -#: ../../c-api/unicode.rst:1119 +#: ../../c-api/unicode.rst:1108 msgid "" -"On error, set an exception, set *size* to ``-1`` (if it's not NULL) and " -"return ``NULL``." +"In the case of an error, ``NULL`` is returned with an exception set and no " +"*size* is stored." msgstr "" +"エラーが起きた場合は、 ``NULL`` を返し、例外を設定し、 *size* には何も格納し" +"ません。" -#: ../../c-api/unicode.rst:1125 +#: ../../c-api/unicode.rst:1111 msgid "" "This caches the UTF-8 representation of the string in the Unicode object, " "and subsequent calls will return a pointer to the same buffer. The caller " -"is not responsible for deallocating the buffer. The buffer is deallocated " -"and pointers to it become invalid when the Unicode object is garbage " -"collected." +"is not responsible for deallocating the buffer." msgstr "" +"この関数は、 Unicode オブジェクトの文字列の UTF-8 表現形式をキャッシュし、そ" +"れ以降の呼び出しでは同じバッファへのポインタを返します。\n" +"呼び出し側にバッファを解放する責任はありません。" -#: ../../c-api/unicode.rst:1132 ../../c-api/unicode.rst:1154 +#: ../../c-api/unicode.rst:1117 ../../c-api/unicode.rst:1127 msgid "The return type is now ``const char *`` rather of ``char *``." msgstr "返り値の型が ``char *`` ではなく ``const char *`` になりました。" -#: ../../c-api/unicode.rst:1135 -msgid "This function is a part of the :ref:`limited API `." -msgstr "" - -#: ../../c-api/unicode.rst:1141 +#: ../../c-api/unicode.rst:1123 msgid "As :c:func:`PyUnicode_AsUTF8AndSize`, but does not store the size." msgstr "" ":c:func:`PyUnicode_AsUTF8AndSize` とほぼ同じですが、サイズを格納しません。" -#: ../../c-api/unicode.rst:1145 +#: ../../c-api/unicode.rst:1133 msgid "" -"This function does not have any special behavior for `null characters " -"`_ embedded within *unicode*. " -"As a result, strings containing null characters will remain in the returned " -"string, which some C functions might interpret as the end of the string, " -"leading to truncation. If truncation is an issue, it is recommended to use :" -"c:func:`PyUnicode_AsUTF8AndSize` instead." +"Encode the :c:type:`Py_UNICODE` buffer *s* of the given *size* using UTF-8 " +"and return a Python bytes object. Return ``NULL`` if an exception was " +"raised by the codec." msgstr "" +"与えられたサイズの :c:type:`Py_UNICODE` バッファ *s* を UTF-8 でエンコードし" +"て、 Python の bytes オブジェクトとして返します。\n" +"codec が例外を発生させたときは ``NULL`` を返します。" + +#: ../../c-api/unicode.rst:1140 +msgid "" +"Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using :c:" +"func:`PyUnicode_AsUTF8String`, :c:func:`PyUnicode_AsUTF8AndSize` or :c:func:" +"`PyUnicode_AsEncodedString`." +msgstr "" +"古いスタイルの :c:type:`Py_UNICODE` APIの一部です; :c:func:" +"`PyUnicode_AsUTF8String`, :c:func:`PyUnicode_AsUTF8AndSize`, :c:func:" +"`PyUnicode_AsEncodedString` のいずれかを使用するように移行してください。" -#: ../../c-api/unicode.rst:1159 +#: ../../c-api/unicode.rst:1144 msgid "UTF-32 Codecs" msgstr "UTF-32 Codecs" -#: ../../c-api/unicode.rst:1161 +#: ../../c-api/unicode.rst:1146 msgid "These are the UTF-32 codec APIs:" msgstr "以下は UTF-32 codec API です:" -#: ../../c-api/unicode.rst:1167 +#: ../../c-api/unicode.rst:1152 msgid "" "Decode *size* bytes from a UTF-32 encoded buffer string and return the " "corresponding Unicode object. *errors* (if non-``NULL``) defines the error " @@ -1614,7 +1756,7 @@ msgstr "" "Unicodeオブジェクトとして返します。 *errors* は (``NULL`` でないなら) エラー" "ハンドラを指定します。デフォルトは \"strict\" です。" -#: ../../c-api/unicode.rst:1171 ../../c-api/unicode.rst:1221 +#: ../../c-api/unicode.rst:1156 ../../c-api/unicode.rst:1229 msgid "" "If *byteorder* is non-``NULL``, the decoder starts decoding using the given " "byte order::" @@ -1622,14 +1764,7 @@ msgstr "" "*byteorder* が ``NULL`` でない時、デコーダは与えられたバイトオーダーでデコー" "ドを開始します。 ::" -#: ../../c-api/unicode.rst:1174 ../../c-api/unicode.rst:1224 -msgid "" -"*byteorder == -1: little endian\n" -"*byteorder == 0: native order\n" -"*byteorder == 1: big endian" -msgstr "" - -#: ../../c-api/unicode.rst:1178 +#: ../../c-api/unicode.rst:1163 msgid "" "If ``*byteorder`` is zero, and the first four bytes of the input data are a " "byte order mark (BOM), the decoder switches to this byte order and the BOM " @@ -1641,7 +1776,7 @@ msgstr "" "コピーされません。 ``*byteorder`` が ``-1`` または ``1`` ならば、全ての byte " "order mark は出力にコピーされます。" -#: ../../c-api/unicode.rst:1183 +#: ../../c-api/unicode.rst:1168 ../../c-api/unicode.rst:1242 msgid "" "After completion, *\\*byteorder* is set to the current byte order at the end " "of input data." @@ -1649,16 +1784,17 @@ msgstr "" "デコードが完了した後、入力データの終端に来た時点でのバイトオーダーを " "*\\*byteorder* にセットします。" -#: ../../c-api/unicode.rst:1186 ../../c-api/unicode.rst:1237 +#: ../../c-api/unicode.rst:1171 ../../c-api/unicode.rst:1245 msgid "If *byteorder* is ``NULL``, the codec starts in native order mode." msgstr "" "*byteorder* が ``NULL`` のとき、 codec は native order モードで開始します。" -#: ../../c-api/unicode.rst:1188 ../../c-api/unicode.rst:1239 +#: ../../c-api/unicode.rst:1173 ../../c-api/unicode.rst:1209 +#: ../../c-api/unicode.rst:1247 ../../c-api/unicode.rst:1284 msgid "Return ``NULL`` if an exception was raised by the codec." msgstr "codec が例外を発生させたときは ``NULL`` を返します。" -#: ../../c-api/unicode.rst:1194 +#: ../../c-api/unicode.rst:1179 msgid "" "If *consumed* is ``NULL``, behave like :c:func:`PyUnicode_DecodeUTF32`. If " "*consumed* is not ``NULL``, :c:func:`PyUnicode_DecodeUTF32Stateful` will not " @@ -1672,7 +1808,7 @@ msgstr "" "ト列などの) UTF-32 バイト列をエラーとして扱いません。末尾の不完全なバイト列は" "デコードされず、デコードされたバイト数が *consumed* に格納されます。" -#: ../../c-api/unicode.rst:1203 +#: ../../c-api/unicode.rst:1188 msgid "" "Return a Python byte string using the UTF-32 encoding in native byte order. " "The string always starts with a BOM mark. Error handling is \"strict\". " @@ -1684,15 +1820,47 @@ msgstr "" "エラーハンドラは \"strict\" です。\n" "codec が例外を発生させたときは ``NULL`` を返します。" -#: ../../c-api/unicode.rst:1209 +#: ../../c-api/unicode.rst:1196 +msgid "" +"Return a Python bytes object holding the UTF-32 encoded value of the Unicode " +"data in *s*. Output is written according to the following byte order::" +msgstr "" +"*s* の Unicode データを UTF-32 にエンコードし、その値を Python の bytes オブ" +"ジェクトに格納して返します。\n" +"出力は以下のバイトオーダーで従って書かれます::" + +#: ../../c-api/unicode.rst:1203 ../../c-api/unicode.rst:1277 +msgid "" +"If byteorder is ``0``, the output string will always start with the Unicode " +"BOM mark (U+FEFF). In the other two modes, no BOM mark is prepended." +msgstr "" +"byteorder が ``0`` のとき、出力文字列は常に Unicode BOM マーク (U+FEFF) で始" +"まります。それ以外の2つのモードでは、先頭に BOM マークは出力されません。" + +#: ../../c-api/unicode.rst:1206 +msgid "" +"If ``Py_UNICODE_WIDE`` is not defined, surrogate pairs will be output as a " +"single code point." +msgstr "" + +#: ../../c-api/unicode.rst:1213 +msgid "" +"Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using :c:" +"func:`PyUnicode_AsUTF32String` or :c:func:`PyUnicode_AsEncodedString`." +msgstr "" +"古いスタイルの :c:type:`Py_UNICODE` APIの一部です; :c:func:" +"`PyUnicode_AsUTF32String` または :c:func:`PyUnicode_AsEncodedString` を使用す" +"るように移行してください。" + +#: ../../c-api/unicode.rst:1217 msgid "UTF-16 Codecs" msgstr "UTF-16 Codecs" -#: ../../c-api/unicode.rst:1211 +#: ../../c-api/unicode.rst:1219 msgid "These are the UTF-16 codec APIs:" msgstr "以下は UTF-16 codec の APIです:" -#: ../../c-api/unicode.rst:1217 +#: ../../c-api/unicode.rst:1225 msgid "" "Decode *size* bytes from a UTF-16 encoded buffer string and return the " "corresponding Unicode object. *errors* (if non-``NULL``) defines the error " @@ -1702,7 +1870,7 @@ msgstr "" "果を Unicode オブジェクトで返します。 *errors* は (``NULL`` でない場合) エ" "ラー処理方法を定義します。デフォルト値は \"strict\" です。" -#: ../../c-api/unicode.rst:1228 +#: ../../c-api/unicode.rst:1236 msgid "" "If ``*byteorder`` is zero, and the first two bytes of the input data are a " "byte order mark (BOM), the decoder switches to this byte order and the BOM " @@ -1716,15 +1884,7 @@ msgstr "" "合、すべてのBOMは出力へコピーされます (出力では ``\\ufeff`` か ``\\ufffe`` の" "どちらかになるでしょう)。" -#: ../../c-api/unicode.rst:1234 -msgid "" -"After completion, ``*byteorder`` is set to the current byte order at the end " -"of input data." -msgstr "" -"デコードが完了した後、入力データの終端に来た時点でのバイトオーダーを " -"``*byteorder`` にセットします。" - -#: ../../c-api/unicode.rst:1245 +#: ../../c-api/unicode.rst:1253 msgid "" "If *consumed* is ``NULL``, behave like :c:func:`PyUnicode_DecodeUTF16`. If " "*consumed* is not ``NULL``, :c:func:`PyUnicode_DecodeUTF16Stateful` will not " @@ -1739,7 +1899,7 @@ msgstr "" "イト列や分割されたサロゲートペア) をエラーとみなしません。これらのバイト列は" "デコードされず、デコードされたバイト数を *consumed* に返します。" -#: ../../c-api/unicode.rst:1254 +#: ../../c-api/unicode.rst:1262 msgid "" "Return a Python byte string using the UTF-16 encoding in native byte order. " "The string always starts with a BOM mark. Error handling is \"strict\". " @@ -1751,21 +1911,48 @@ msgstr "" "エラーハンドラは \"strict\" です。\n" "codec が例外を発生させたときは ``NULL`` を返します。" -#: ../../c-api/unicode.rst:1260 +#: ../../c-api/unicode.rst:1270 +msgid "" +"Return a Python bytes object holding the UTF-16 encoded value of the Unicode " +"data in *s*. Output is written according to the following byte order::" +msgstr "" +"*s* の Unicode データを UTF-16 にエンコードし、その値を Python の bytes オブ" +"ジェクトに格納して返します。\n" +"出力は以下のバイトオーダーに従って書かれます::" + +#: ../../c-api/unicode.rst:1280 +msgid "" +"If ``Py_UNICODE_WIDE`` is defined, a single :c:type:`Py_UNICODE` value may " +"get represented as a surrogate pair. If it is not defined, each :c:type:" +"`Py_UNICODE` values is interpreted as a UCS-2 character." +msgstr "" + +#: ../../c-api/unicode.rst:1288 +msgid "" +"Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using :c:" +"func:`PyUnicode_AsUTF16String` or :c:func:`PyUnicode_AsEncodedString`." +msgstr "" +"古いスタイルの :c:type:`Py_UNICODE` APIの一部です; :c:func:" +"`PyUnicode_AsUTF16String` または :c:func:`PyUnicode_AsEncodedString` を使用す" +"るように移行してください。" + +#: ../../c-api/unicode.rst:1292 msgid "UTF-7 Codecs" msgstr "UTF-7 Codecs" -#: ../../c-api/unicode.rst:1262 +#: ../../c-api/unicode.rst:1294 msgid "These are the UTF-7 codec APIs:" msgstr "以下は UTF-7 codec の API です:" -#: ../../c-api/unicode.rst:1267 +#: ../../c-api/unicode.rst:1299 msgid "" "Create a Unicode object by decoding *size* bytes of the UTF-7 encoded string " -"*str*. Return ``NULL`` if an exception was raised by the codec." +"*s*. Return ``NULL`` if an exception was raised by the codec." msgstr "" +"UTF-7 でエンコードされた *size* バイトの文字列 *s* をデコードして Unicode オ" +"ブジェクトを作成します。 codec が例外を発生させたときは ``NULL`` を返します。" -#: ../../c-api/unicode.rst:1274 +#: ../../c-api/unicode.rst:1306 msgid "" "If *consumed* is ``NULL``, behave like :c:func:`PyUnicode_DecodeUTF7`. If " "*consumed* is not ``NULL``, trailing incomplete UTF-7 base-64 sections will " @@ -1777,22 +1964,45 @@ msgstr "" "分をエラーとしません。不完全な部分のバイト列はデコードせずに、デコードしたバ" "イト数を *consumed* に格納します。" -#: ../../c-api/unicode.rst:1281 +#: ../../c-api/unicode.rst:1315 +msgid "" +"Encode the :c:type:`Py_UNICODE` buffer of the given size using UTF-7 and " +"return a Python bytes object. Return ``NULL`` if an exception was raised by " +"the codec." +msgstr "" +"与えられたサイズの :c:type:`Py_UNICODE` バッファを UTF-7 でエンコードして、 " +"Python の bytes オブジェクトとして返します。 codec が例外を発生させたときは " +"``NULL`` を返します。" + +#: ../../c-api/unicode.rst:1319 +msgid "" +"If *base64SetO* is nonzero, \"Set O\" (punctuation that has no otherwise " +"special meaning) will be encoded in base-64. If *base64WhiteSpace* is " +"nonzero, whitespace will be encoded in base-64. Both are set to zero for " +"the Python \"utf-7\" codec." +msgstr "" +"*base64SetO* がゼロでないとき、 \"Set O\" 文字 (他の場合には何も特別な意味を" +"持たない句読点) を base-64 エンコードします。 *base64WhiteSpace* がゼロでない" +"とき、空白文字を base-64 エンコードします。 Python の \"utf-7\" codec では、" +"両方ともゼロに設定されています。" + +#: ../../c-api/unicode.rst:1330 msgid "Unicode-Escape Codecs" msgstr "Unicode-Escape Codecs" -#: ../../c-api/unicode.rst:1283 +#: ../../c-api/unicode.rst:1332 msgid "These are the \"Unicode Escape\" codec APIs:" msgstr "以下は \"Unicode Escape\" codec の API です:" -#: ../../c-api/unicode.rst:1289 +#: ../../c-api/unicode.rst:1338 msgid "" "Create a Unicode object by decoding *size* bytes of the Unicode-Escape " -"encoded string *str*. Return ``NULL`` if an exception was raised by the " -"codec." +"encoded string *s*. Return ``NULL`` if an exception was raised by the codec." msgstr "" +"Unicode-Escape でエンコードされた *size* バイトの文字列 *s* から Unicode オブ" +"ジェクトを生成します。codec が例外を送出した場合には ``NULL`` を返します。" -#: ../../c-api/unicode.rst:1295 +#: ../../c-api/unicode.rst:1344 msgid "" "Encode a Unicode object using Unicode-Escape and return the result as a " "bytes object. Error handling is \"strict\". Return ``NULL`` if an " @@ -1803,22 +2013,42 @@ msgstr "" "エラー処理は \"strict\" です。\n" "codec が例外を送出した場合には ``NULL`` を返します。" -#: ../../c-api/unicode.rst:1301 +#: ../../c-api/unicode.rst:1351 +msgid "" +"Encode the :c:type:`Py_UNICODE` buffer of the given *size* using Unicode-" +"Escape and return a bytes object. Return ``NULL`` if an exception was " +"raised by the codec." +msgstr "" +"Unicode-Escape を使い *size* で指定された長さを持つ :c:type:`Py_UNICODE` 型" +"バッファをエンコードし、 bytes オブジェクトにして返します。\n" +"codec が例外を送出した場合には ``NULL`` を返します。" + +#: ../../c-api/unicode.rst:1356 +msgid "" +"Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using :c:" +"func:`PyUnicode_AsUnicodeEscapeString`." +msgstr "" +"古いスタイルの :c:type:`Py_UNICODE` APIの一部です; :c:func:" +"`PyUnicode_AsUnicodeEscapeString` を使用するように移行してください。" + +#: ../../c-api/unicode.rst:1360 msgid "Raw-Unicode-Escape Codecs" msgstr "Raw-Unicode-Escape Codecs" -#: ../../c-api/unicode.rst:1303 +#: ../../c-api/unicode.rst:1362 msgid "These are the \"Raw Unicode Escape\" codec APIs:" msgstr "以下は \"Raw Unicode Escape\" codec の APIです:" -#: ../../c-api/unicode.rst:1309 +#: ../../c-api/unicode.rst:1368 msgid "" "Create a Unicode object by decoding *size* bytes of the Raw-Unicode-Escape " -"encoded string *str*. Return ``NULL`` if an exception was raised by the " -"codec." +"encoded string *s*. Return ``NULL`` if an exception was raised by the codec." msgstr "" +"Raw-Unicode-Escape でエンコードされた *size* バイトの文字列 *s* から Unicode " +"オブジェクトを生成します。codec が例外を送出した場合には ``NULL`` を返しま" +"す。" -#: ../../c-api/unicode.rst:1315 +#: ../../c-api/unicode.rst:1374 msgid "" "Encode a Unicode object using Raw-Unicode-Escape and return the result as a " "bytes object. Error handling is \"strict\". Return ``NULL`` if an " @@ -1829,11 +2059,31 @@ msgstr "" "エラー処理は \"strict\" です。\n" "codec が例外を送出した場合には ``NULL`` を返します。" -#: ../../c-api/unicode.rst:1321 +#: ../../c-api/unicode.rst:1382 +msgid "" +"Encode the :c:type:`Py_UNICODE` buffer of the given *size* using Raw-Unicode-" +"Escape and return a bytes object. Return ``NULL`` if an exception was " +"raised by the codec." +msgstr "" +"Raw-Unicode-Escape を使い *size* で指定された長さを持つ :c:type:`Py_UNICODE` " +"型バッファをエンコードし、 bytes オブジェクトにして返します。\n" +"codec が例外を送出した場合には ``NULL`` を返します。" + +#: ../../c-api/unicode.rst:1388 +msgid "" +"Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using :c:" +"func:`PyUnicode_AsRawUnicodeEscapeString` or :c:func:" +"`PyUnicode_AsEncodedString`." +msgstr "" +"古いスタイルの :c:type:`Py_UNICODE` APIの一部です; :c:func:" +"`PyUnicode_AsRawUnicodeEscapeString` または :c:func:" +"`PyUnicode_AsEncodedString` を使用するように移行してください。" + +#: ../../c-api/unicode.rst:1392 msgid "Latin-1 Codecs" msgstr "Latin-1 Codecs" -#: ../../c-api/unicode.rst:1323 +#: ../../c-api/unicode.rst:1394 msgid "" "These are the Latin-1 codec APIs: Latin-1 corresponds to the first 256 " "Unicode ordinals and only these are accepted by the codecs during encoding." @@ -1841,15 +2091,15 @@ msgstr "" "以下は Latin-1 codec の APIです: Latin-1 は、 Unicode 序数の最初の 256 個に対" "応し、エンコード時にはこの 256 個だけを受理します。" -#: ../../c-api/unicode.rst:1329 +#: ../../c-api/unicode.rst:1400 msgid "" "Create a Unicode object by decoding *size* bytes of the Latin-1 encoded " -"string *str*. Return ``NULL`` if an exception was raised by the codec." +"string *s*. Return ``NULL`` if an exception was raised by the codec." msgstr "" -"Latin-1 でエンコードされた *size* バイトの文字列 *str* から Unicode オブジェ" -"クトを生成します。codec が例外を送出した場合には ``NULL`` を返します。" +"Latin-1 でエンコードされた *size* バイトの文字列 *s* から Unicode オブジェク" +"トを生成します。codec が例外を送出した場合には ``NULL`` を返します。" -#: ../../c-api/unicode.rst:1335 +#: ../../c-api/unicode.rst:1406 msgid "" "Encode a Unicode object using Latin-1 and return the result as Python bytes " "object. Error handling is \"strict\". Return ``NULL`` if an exception was " @@ -1860,11 +2110,30 @@ msgstr "" "エラー処理は \"strict\" です。 codec が例外を送出した場合には ``NULL`` を返し" "ます。" -#: ../../c-api/unicode.rst:1341 +#: ../../c-api/unicode.rst:1413 +msgid "" +"Encode the :c:type:`Py_UNICODE` buffer of the given *size* using Latin-1 and " +"return a Python bytes object. Return ``NULL`` if an exception was raised by " +"the codec." +msgstr "" +"*size* で指定された長さを持つ :c:type:`Py_UNICODE` 型バッファを Latin-1 でエ" +"ンコードし、 Python bytes オブジェクトにして返します。\n" +"codec が例外を送出した場合には ``NULL`` を返します。" + +#: ../../c-api/unicode.rst:1420 +msgid "" +"Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using :c:" +"func:`PyUnicode_AsLatin1String` or :c:func:`PyUnicode_AsEncodedString`." +msgstr "" +"古いスタイルの :c:type:`Py_UNICODE` APIの一部です; :c:func:" +"`PyUnicode_AsLatin1String` または :c:func:`PyUnicode_AsEncodedString` を使用" +"するように移行してください。" + +#: ../../c-api/unicode.rst:1424 msgid "ASCII Codecs" msgstr "ASCII Codecs" -#: ../../c-api/unicode.rst:1343 +#: ../../c-api/unicode.rst:1426 msgid "" "These are the ASCII codec APIs. Only 7-bit ASCII data is accepted. All " "other codes generate errors." @@ -1872,13 +2141,15 @@ msgstr "" "以下は ASCII codec の APIです。 7 ビットの ASCII データだけを受理します。その" "他のコードはエラーになります。" -#: ../../c-api/unicode.rst:1349 +#: ../../c-api/unicode.rst:1432 msgid "" "Create a Unicode object by decoding *size* bytes of the ASCII encoded string " -"*str*. Return ``NULL`` if an exception was raised by the codec." +"*s*. Return ``NULL`` if an exception was raised by the codec." msgstr "" +"ASCII でエンコードされた *size* バイトの文字列 *s* から Unicode オブジェクト" +"を生成します。codec が例外を送出した場合には ``NULL`` を返します。" -#: ../../c-api/unicode.rst:1355 +#: ../../c-api/unicode.rst:1438 msgid "" "Encode a Unicode object using ASCII and return the result as Python bytes " "object. Error handling is \"strict\". Return ``NULL`` if an exception was " @@ -1889,42 +2160,60 @@ msgstr "" "エラー処理は \"strict\" です。\n" "codec が例外を送出した場合には ``NULL`` を返します。" -#: ../../c-api/unicode.rst:1361 +#: ../../c-api/unicode.rst:1445 +msgid "" +"Encode the :c:type:`Py_UNICODE` buffer of the given *size* using ASCII and " +"return a Python bytes object. Return ``NULL`` if an exception was raised by " +"the codec." +msgstr "" +"*size* で指定された長さを持つ :c:type:`Py_UNICODE` 型バッファを ASCII でエン" +"コードし、 Python bytes オブジェクトにして返します。\n" +"codec が例外を送出した場合には ``NULL`` を返します。" + +#: ../../c-api/unicode.rst:1452 +msgid "" +"Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using :c:" +"func:`PyUnicode_AsASCIIString` or :c:func:`PyUnicode_AsEncodedString`." +msgstr "" +"古いスタイルの :c:type:`Py_UNICODE` APIの一部です; :c:func:" +"`PyUnicode_AsASCIIString` または :c:func:`PyUnicode_AsEncodedString` を使用す" +"るように移行してください。" + +#: ../../c-api/unicode.rst:1456 msgid "Character Map Codecs" msgstr "Character Map Codecs" -#: ../../c-api/unicode.rst:1363 +#: ../../c-api/unicode.rst:1458 msgid "" "This codec is special in that it can be used to implement many different " "codecs (and this is in fact what was done to obtain most of the standard " -"codecs included in the :mod:`!encodings` package). The codec uses mappings " -"to encode and decode characters. The mapping objects provided must support " -"the :meth:`~object.__getitem__` mapping interface; dictionaries and " -"sequences work well." +"codecs included in the :mod:`encodings` package). The codec uses mapping to " +"encode and decode characters. The mapping objects provided must support " +"the :meth:`__getitem__` mapping interface; dictionaries and sequences work " +"well." msgstr "" "この codec は、多くの様々な codec を実装する際に使われるという点で特殊な " -"codec です (実際、 :mod:`!encodings` パッケージに入っている標準 codecs のほと" +"codec です (実際、 :mod:`encodings` パッケージに入っている標準 codecs のほと" "んどは、この codec を使っています)。\n" "この codec は、文字のエンコードやデコードに対応表を使います。\n" -"提供される対応表のオブジェクトは :meth:`~object.__getitem__` マッピングイン" -"ターフェースをサポートしていなければなりません; 辞書やシーケンスがそれに適し" -"ています。" +"提供される対応表のオブジェクトは :meth:`__getitem__` マッピングインターフェー" +"スをサポートしていなければなりません; 辞書やシーケンスがそれに適しています。" -#: ../../c-api/unicode.rst:1369 +#: ../../c-api/unicode.rst:1464 msgid "These are the mapping codec APIs:" msgstr "以下は mapping codec の APIです:" -#: ../../c-api/unicode.rst:1374 +#: ../../c-api/unicode.rst:1469 msgid "" -"Create a Unicode object by decoding *size* bytes of the encoded string *str* " +"Create a Unicode object by decoding *size* bytes of the encoded string *s* " "using the given *mapping* object. Return ``NULL`` if an exception was " "raised by the codec." msgstr "" "与えられた *mapping* オブジェクトを使って、 *size* バイトのエンコードされた文" -"字列 *str* をデコードして Unicode オブジェクトを作成します。\n" +"字列 *s* をデコードして Unicode オブジェクトを作成します。\n" "codec が例外を発生させたときは ``NULL`` を返します。" -#: ../../c-api/unicode.rst:1378 +#: ../../c-api/unicode.rst:1473 msgid "" "If *mapping* is ``NULL``, Latin-1 decoding will be applied. Else *mapping* " "must map bytes ordinals (integers in the range from 0 to 255) to Unicode " @@ -1934,7 +2223,7 @@ msgid "" "treated as undefined mappings and cause an error." msgstr "" -#: ../../c-api/unicode.rst:1389 +#: ../../c-api/unicode.rst:1484 msgid "" "Encode a Unicode object using the given *mapping* object and return the " "result as a bytes object. Error handling is \"strict\". Return ``NULL`` if " @@ -1944,7 +2233,7 @@ msgstr "" "し、結果を bytes オブジェクトとして返します。エラー処理は \"strict\" です。 " "codec が例外を送出した場合には ``NULL`` を返します。" -#: ../../c-api/unicode.rst:1393 +#: ../../c-api/unicode.rst:1488 msgid "" "The *mapping* object must map Unicode ordinal integers to bytes objects, " "integers in the range from 0 to 255 or ``None``. Unmapped character " @@ -1952,12 +2241,28 @@ msgid "" "``None`` are treated as \"undefined mapping\" and cause an error." msgstr "" -#: ../../c-api/unicode.rst:1399 +#: ../../c-api/unicode.rst:1497 +msgid "" +"Encode the :c:type:`Py_UNICODE` buffer of the given *size* using the given " +"*mapping* object and return the result as a bytes object. Return ``NULL`` " +"if an exception was raised by the codec." +msgstr "" + +#: ../../c-api/unicode.rst:1504 +msgid "" +"Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using :c:" +"func:`PyUnicode_AsCharmapString` or :c:func:`PyUnicode_AsEncodedString`." +msgstr "" +"古いスタイルの :c:type:`Py_UNICODE` APIの一部です; :c:func:" +"`PyUnicode_AsCharmapString` または :c:func:`PyUnicode_AsEncodedString` を使用" +"するように移行してください。" + +#: ../../c-api/unicode.rst:1507 msgid "The following codec API is special in that maps Unicode to Unicode." msgstr "" "以下の codec API は Unicode から Unicode への対応付けを行う特殊なものです。" -#: ../../c-api/unicode.rst:1403 +#: ../../c-api/unicode.rst:1511 msgid "" "Translate a string by applying a character mapping table to it and return " "the resulting Unicode object. Return ``NULL`` if an exception was raised by " @@ -1966,7 +2271,7 @@ msgstr "" "文字列に文字対応表 *table* を適用して変換し、変換結果を Unicode オブジェクト" "で返します。codec が例外を発行した場合には ``NULL`` を返します。" -#: ../../c-api/unicode.rst:1407 +#: ../../c-api/unicode.rst:1515 msgid "" "The mapping table must map Unicode ordinal integers to Unicode ordinal " "integers or ``None`` (causing deletion of the character)." @@ -1974,14 +2279,18 @@ msgstr "" "対応表は、Unicode 序数を表す整数を Unicode 序数を表す整数または ``None`` (そ" "の文字を削除する) に対応付けなければなりません。" -#: ../../c-api/unicode.rst:1410 +#: ../../c-api/unicode.rst:1518 msgid "" -"Mapping tables need only provide the :meth:`~object.__getitem__` interface; " +"Mapping tables need only provide the :meth:`__getitem__` interface; " "dictionaries and sequences work well. Unmapped character ordinals (ones " "which cause a :exc:`LookupError`) are left untouched and are copied as-is." msgstr "" +"対応表が提供する必要があるメソッドは :meth:`__getitem__` インターフェースだけ" +"です; 従って、辞書やシーケンス型を使ってもうまく動作します。\n" +"対応付けを行っていない (:exc:`LookupError` を起こすような) 文字序数に対して" +"は、変換は行わず、そのままコピーします。" -#: ../../c-api/unicode.rst:1414 +#: ../../c-api/unicode.rst:1522 msgid "" "*errors* has the usual meaning for codecs. It may be ``NULL`` which " "indicates to use the default error handling." @@ -1989,11 +2298,28 @@ msgstr "" "*errors* は codecs で通常使われるのと同じ意味を持ちます。 *errors* は " "``NULL`` にしてもよく、デフォルトエラー処理の使用を意味します。" -#: ../../c-api/unicode.rst:1419 +#: ../../c-api/unicode.rst:1529 +msgid "" +"Translate a :c:type:`Py_UNICODE` buffer of the given *size* by applying a " +"character *mapping* table to it and return the resulting Unicode object. " +"Return ``NULL`` when an exception was raised by the codec." +msgstr "" + +#: ../../c-api/unicode.rst:1536 +msgid "" +"Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using :c:" +"func:`PyUnicode_Translate`. or :ref:`generic codec based API `" +msgstr "" +"古いスタイルの :c:type:`Py_UNICODE` APIの一部です; :c:func:" +"`PyUnicode_Translate`. または :ref:`汎用の codec ベースの API ` を使用するように移行してください。" + +#: ../../c-api/unicode.rst:1540 msgid "MBCS codecs for Windows" msgstr "Windows 用の MBCS codec" -#: ../../c-api/unicode.rst:1421 +#: ../../c-api/unicode.rst:1542 msgid "" "These are the MBCS codec APIs. They are currently only available on Windows " "and use the Win32 MBCS converters to implement the conversions. Note that " @@ -2007,13 +2333,15 @@ msgstr "" "式 (target encoding) は、 codec を動作させているマシン上のユーザ設定で定義さ" "れています。" -#: ../../c-api/unicode.rst:1428 +#: ../../c-api/unicode.rst:1549 msgid "" "Create a Unicode object by decoding *size* bytes of the MBCS encoded string " -"*str*. Return ``NULL`` if an exception was raised by the codec." +"*s*. Return ``NULL`` if an exception was raised by the codec." msgstr "" +"MBCS でエンコードされた *size* バイトの文字列 *s* から Unicode オブジェクトを" +"生成します。codec が例外を送出した場合には ``NULL`` を返します。" -#: ../../c-api/unicode.rst:1435 +#: ../../c-api/unicode.rst:1556 msgid "" "If *consumed* is ``NULL``, behave like :c:func:`PyUnicode_DecodeMBCS`. If " "*consumed* is not ``NULL``, :c:func:`PyUnicode_DecodeMBCSStateful` will not " @@ -2025,13 +2353,7 @@ msgstr "" "`PyUnicode_DecodeMBCSStateful` は文字列の最後にあるマルチバイト文字の前半バイ" "トをデコードせず、 *consumed* にデコードしたバイト数を格納します。" -#: ../../c-api/unicode.rst:1444 -msgid "" -"Similar to :c:func:`PyUnicode_DecodeMBCSStateful`, except uses the code page " -"specified by *code_page*." -msgstr "" - -#: ../../c-api/unicode.rst:1450 +#: ../../c-api/unicode.rst:1564 msgid "" "Encode a Unicode object using MBCS and return the result as Python bytes " "object. Error handling is \"strict\". Return ``NULL`` if an exception was " @@ -2041,18 +2363,46 @@ msgstr "" "トとして返します。エラー処理は \"strict\" です。 codec が例外を送出した場合に" "は ``NULL`` を返します。" -#: ../../c-api/unicode.rst:1457 +#: ../../c-api/unicode.rst:1571 msgid "" "Encode the Unicode object using the specified code page and return a Python " "bytes object. Return ``NULL`` if an exception was raised by the codec. Use :" -"c:macro:`!CP_ACP` code page to get the MBCS encoder." +"c:data:`CP_ACP` code page to get the MBCS encoder." msgstr "" +"指定されたコードページを使い Unicode オブジェクトをエンコードし、 Python " +"bytes オブジェクトを返します。\n" +"codec が例外を送出した場合には ``NULL`` を返します。\n" +":c:data:`CP_ACP` コードページを使い MBCS エンコーダを取得してください。" + +#: ../../c-api/unicode.rst:1580 +msgid "" +"Encode the :c:type:`Py_UNICODE` buffer of the given *size* using MBCS and " +"return a Python bytes object. Return ``NULL`` if an exception was raised by " +"the codec." +msgstr "" +"*size* で指定された長さを持つ :c:type:`Py_UNICODE` 型バッファを MBCS でエン" +"コードし、 Python bytes オブジェクトにして返します。\n" +"codec が例外を送出した場合には ``NULL`` を返します。" + +#: ../../c-api/unicode.rst:1587 +msgid "" +"Part of the old-style :c:type:`Py_UNICODE` API; please migrate to using :c:" +"func:`PyUnicode_AsMBCSString`, :c:func:`PyUnicode_EncodeCodePage` or :c:func:" +"`PyUnicode_AsEncodedString`." +msgstr "" +"古いスタイルの :c:type:`Py_UNICODE` APIの一部です; :c:func:" +"`PyUnicode_AsMBCSString`, :c:func:`PyUnicode_EncodeCodePage`, :c:func:" +"`PyUnicode_AsEncodedString` のいずれかを使用するように移行してください。" + +#: ../../c-api/unicode.rst:1591 +msgid "Methods & Slots" +msgstr "メソッドとスロット" -#: ../../c-api/unicode.rst:1467 +#: ../../c-api/unicode.rst:1597 msgid "Methods and Slot Functions" msgstr "メソッドおよびスロット関数 (slot function)" -#: ../../c-api/unicode.rst:1469 +#: ../../c-api/unicode.rst:1599 msgid "" "The following APIs are capable of handling Unicode objects and strings on " "input (we refer to them as strings in the descriptions) and return Unicode " @@ -2062,17 +2412,17 @@ msgstr "" "も文字列と表記しています)、場合に応じて Unicode オブジェクトか整数を返す機能" "を持っています。" -#: ../../c-api/unicode.rst:1473 +#: ../../c-api/unicode.rst:1603 msgid "They all return ``NULL`` or ``-1`` if an exception occurs." msgstr "" "これらの関数は全て、例外が発生した場合には ``NULL`` または ``-1`` を返しま" "す。" -#: ../../c-api/unicode.rst:1478 +#: ../../c-api/unicode.rst:1608 msgid "Concat two strings giving a new Unicode string." msgstr "二つの文字列を結合して、新たな Unicode 文字列を生成します。" -#: ../../c-api/unicode.rst:1483 +#: ../../c-api/unicode.rst:1613 msgid "" "Split a string giving a list of Unicode strings. If *sep* is ``NULL``, " "splitting will be done at all whitespace substrings. Otherwise, splits " @@ -2086,60 +2436,17 @@ msgstr "" "います。 *maxsplit* が負ならば分割数に制限を設けません。分割結果のリスト内に" "は分割文字は含みません。" -#: ../../c-api/unicode.rst:1488 ../../c-api/unicode.rst:1498 -#: ../../c-api/unicode.rst:1519 ../../c-api/unicode.rst:1532 -msgid "On error, return ``NULL`` with an exception set." -msgstr "" - -#: ../../c-api/unicode.rst:1490 -msgid "Equivalent to :py:meth:`str.split`." -msgstr "" - -#: ../../c-api/unicode.rst:1495 -msgid "" -"Similar to :c:func:`PyUnicode_Split`, but splitting will be done beginning " -"at the end of the string." -msgstr "" - -#: ../../c-api/unicode.rst:1500 -msgid "Equivalent to :py:meth:`str.rsplit`." -msgstr "" - -#: ../../c-api/unicode.rst:1505 +#: ../../c-api/unicode.rst:1621 msgid "" "Split a Unicode string at line breaks, returning a list of Unicode strings. " -"CRLF is considered to be one line break. If *keepends* is ``0``, the Line " +"CRLF is considered to be one line break. If *keepend* is ``0``, the Line " "break characters are not included in the resulting strings." msgstr "" +"Unicode 文字列を改行文字で区切り、Unicode 文字列からなるリストを返します。\n" +"CRLF は一個の改行文字とみなします。\n" +"*keepend* が ``0`` の場合、分割結果のリスト内に改行文字を含めません。" -#: ../../c-api/unicode.rst:1512 -msgid "" -"Split a Unicode string at the first occurrence of *sep*, and return a 3-" -"tuple containing the part before the separator, the separator itself, and " -"the part after the separator. If the separator is not found, return a 3-" -"tuple containing the string itself, followed by two empty strings." -msgstr "" - -#: ../../c-api/unicode.rst:1517 ../../c-api/unicode.rst:1530 -msgid "*sep* must not be empty." -msgstr "" - -#: ../../c-api/unicode.rst:1521 -msgid "Equivalent to :py:meth:`str.partition`." -msgstr "" - -#: ../../c-api/unicode.rst:1526 -msgid "" -"Similar to :c:func:`PyUnicode_Partition`, but split a Unicode string at the " -"last occurrence of *sep*. If the separator is not found, return a 3-tuple " -"containing two empty strings, followed by the string itself." -msgstr "" - -#: ../../c-api/unicode.rst:1534 -msgid "Equivalent to :py:meth:`str.rpartition`." -msgstr "" - -#: ../../c-api/unicode.rst:1539 +#: ../../c-api/unicode.rst:1628 msgid "" "Join a sequence of strings using the given *separator* and return the " "resulting Unicode string." @@ -2147,68 +2454,70 @@ msgstr "" "指定した *separator* で文字列からなるシーケンスを連結 (join) し、連結結果を " "Unicode 文字列で返します。" -#: ../../c-api/unicode.rst:1546 +#: ../../c-api/unicode.rst:1635 msgid "" -"Return ``1`` if *substr* matches ``unicode[start:end]`` at the given tail " -"end (*direction* == ``-1`` means to do a prefix match, *direction* == ``1`` " -"a suffix match), ``0`` otherwise. Return ``-1`` if an error occurred." +"Return ``1`` if *substr* matches ``str[start:end]`` at the given tail end " +"(*direction* == ``-1`` means to do a prefix match, *direction* == ``1`` a " +"suffix match), ``0`` otherwise. Return ``-1`` if an error occurred." msgstr "" +"*substr* が ``str[start:end]`` の末端 (*direction* == ``-1`` は先頭一致、 " +"*direction* == ``1`` は末尾一致) でとマッチする場合に ``1`` を返し、それ以外" +"の場合には ``0`` を返します。\n" +"エラーが発生した時は ``-1`` を返します。" -#: ../../c-api/unicode.rst:1554 +#: ../../c-api/unicode.rst:1643 msgid "" -"Return the first position of *substr* in ``unicode[start:end]`` using the " -"given *direction* (*direction* == ``1`` means to do a forward search, " -"*direction* == ``-1`` a backward search). The return value is the index of " -"the first match; a value of ``-1`` indicates that no match was found, and " -"``-2`` indicates that an error occurred and an exception has been set." +"Return the first position of *substr* in ``str[start:end]`` using the given " +"*direction* (*direction* == ``1`` means to do a forward search, *direction* " +"== ``-1`` a backward search). The return value is the index of the first " +"match; a value of ``-1`` indicates that no match was found, and ``-2`` " +"indicates that an error occurred and an exception has been set." msgstr "" -"``unicode[start:end]`` 中に *substr* が最初に出現する場所を返します。\n" +"``str[start:end]`` 中に *substr* が最初に出現する場所を返します。\n" "このとき指定された検索方向 *direction* (*direction* == ``1`` は順方向検索、 " "*direction* == ``-1`` は逆方向検索) で検索します。\n" "戻り値は最初にマッチが見つかった場所のインデックスです; 戻り値 ``-1`` はマッ" "チが見つからなかったことを表し、 ``-2`` はエラーが発生して例外情報が設定され" "ていることを表します。" -#: ../../c-api/unicode.rst:1564 +#: ../../c-api/unicode.rst:1653 msgid "" -"Return the first position of the character *ch* in ``unicode[start:end]`` " -"using the given *direction* (*direction* == ``1`` means to do a forward " -"search, *direction* == ``-1`` a backward search). The return value is the " -"index of the first match; a value of ``-1`` indicates that no match was " -"found, and ``-2`` indicates that an error occurred and an exception has been " -"set." +"Return the first position of the character *ch* in ``str[start:end]`` using " +"the given *direction* (*direction* == ``1`` means to do a forward search, " +"*direction* == ``-1`` a backward search). The return value is the index of " +"the first match; a value of ``-1`` indicates that no match was found, and " +"``-2`` indicates that an error occurred and an exception has been set." msgstr "" -"``unicode[start:end]`` 中に文字 *ch* が最初に出現する場所を返します。\n" +"``str[start:end]`` 中に文字 *ch* が最初に出現する場所を返します。\n" "このとき指定された検索方向 *direction* (*direction* == ``1`` は順方向検索、 " "*direction* == ``-1`` は逆方向検索) で検索します。\n" "戻り値は最初にマッチが見つかった場所のインデックスです; 戻り値 ``-1`` はマッ" "チが見つからなかったことを表し、 ``-2`` はエラーが発生して例外情報が設定され" "ていることを表します。" -#: ../../c-api/unicode.rst:1572 -msgid "" -"*start* and *end* are now adjusted to behave like ``unicode[start:end]``." +#: ../../c-api/unicode.rst:1661 +msgid "*start* and *end* are now adjusted to behave like ``str[start:end]``." msgstr "" -#: ../../c-api/unicode.rst:1579 +#: ../../c-api/unicode.rst:1668 msgid "" -"Return the number of non-overlapping occurrences of *substr* in " -"``unicode[start:end]``. Return ``-1`` if an error occurred." +"Return the number of non-overlapping occurrences of *substr* in ``str[start:" +"end]``. Return ``-1`` if an error occurred." msgstr "" -"``unicode[start:end]`` に *substr* が重複することなく出現する回数を返します。" -"エラーが発生した場合には ``-1`` を返します。" +"``str[start:end]`` に *substr* が重複することなく出現する回数を返します。エ" +"ラーが発生した場合には ``-1`` を返します。" -#: ../../c-api/unicode.rst:1586 +#: ../../c-api/unicode.rst:1675 msgid "" -"Replace at most *maxcount* occurrences of *substr* in *unicode* with " -"*replstr* and return the resulting Unicode object. *maxcount* == ``-1`` " -"means replace all occurrences." +"Replace at most *maxcount* occurrences of *substr* in *str* with *replstr* " +"and return the resulting Unicode object. *maxcount* == ``-1`` means replace " +"all occurrences." msgstr "" -"*unicode* 中に出現する *substr* を最大で *maxcount* 個 *replstr* に置換し、置" -"換結果である Unicode オブジェクトを返します。\n" +"*str* 中に出現する *substr* を最大で *maxcount* 個 *replstr* に置換し、置換結" +"果である Unicode オブジェクトを返します。\n" "*maxcount* == ``-1`` にすると、文字列中に現れる全ての *substr* を置換します。" -#: ../../c-api/unicode.rst:1593 +#: ../../c-api/unicode.rst:1682 msgid "" "Compare two strings and return ``-1``, ``0``, ``1`` for less than, equal, " "and greater than, respectively." @@ -2217,7 +2526,7 @@ msgstr "" "左引数が右引数より大きい場合に対して、それぞれ ``-1``, ``0``, ``1`` を返しま" "す。" -#: ../../c-api/unicode.rst:1596 +#: ../../c-api/unicode.rst:1685 msgid "" "This function returns ``-1`` upon failure, so one should call :c:func:" "`PyErr_Occurred` to check for errors." @@ -2225,100 +2534,53 @@ msgstr "" "この関数は、失敗したときに ``-1`` を返すので、 :c:func:`PyErr_Occurred` を呼" "び出して、エラーをチェックすべきです。" -#: ../../c-api/unicode.rst:1601 -msgid "The :c:func:`PyUnicode_Equal` function." -msgstr "" - -#: ../../c-api/unicode.rst:1606 -msgid "Test if two strings are equal:" -msgstr "" - -#: ../../c-api/unicode.rst:1608 -msgid "Return ``1`` if *a* is equal to *b*." -msgstr "" - -#: ../../c-api/unicode.rst:1609 -msgid "Return ``0`` if *a* is not equal to *b*." -msgstr "" - -#: ../../c-api/unicode.rst:1610 -msgid "" -"Set a :exc:`TypeError` exception and return ``-1`` if *a* or *b* is not a :" -"class:`str` object." -msgstr "" - -#: ../../c-api/unicode.rst:1613 -msgid "The function always succeeds if *a* and *b* are :class:`str` objects." -msgstr "" - -#: ../../c-api/unicode.rst:1615 +#: ../../c-api/unicode.rst:1691 msgid "" -"The function works for :class:`str` subclasses, but does not honor custom " -"``__eq__()`` method." -msgstr "" - -#: ../../c-api/unicode.rst:1620 -msgid "The :c:func:`PyUnicode_Compare` function." -msgstr "" - -#: ../../c-api/unicode.rst:1627 -msgid "" -"Compare a Unicode object with a char buffer which is interpreted as being " -"UTF-8 or ASCII encoded and return true (``1``) if they are equal, or false " -"(``0``) otherwise. If the Unicode object contains surrogate code points " -"(``U+D800`` - ``U+DFFF``) or the C string is not valid UTF-8, false (``0``) " -"is returned." -msgstr "" - -#: ../../c-api/unicode.rst:1634 ../../c-api/unicode.rst:1655 -msgid "This function does not raise exceptions." -msgstr "この関数は例外を送出しません。" - -#: ../../c-api/unicode.rst:1641 -msgid "" -"Similar to :c:func:`PyUnicode_EqualToUTF8AndSize`, but compute *string* " -"length using :c:func:`!strlen`. If the Unicode object contains null " -"characters, false (``0``) is returned." -msgstr "" - -#: ../../c-api/unicode.rst:1650 -msgid "" -"Compare a Unicode object, *unicode*, with *string* and return ``-1``, ``0``, " +"Compare a Unicode object, *uni*, with *string* and return ``-1``, ``0``, " "``1`` for less than, equal, and greater than, respectively. It is best to " "pass only ASCII-encoded strings, but the function interprets the input " "string as ISO-8859-1 if it contains non-ASCII characters." msgstr "" -"Unicode オブジェクト *unicode* と *string* を比較して、左引数が右引数より小さ" -"い場合、左右引数が等価の場合、左引数が右引数より大きい場合に対して、それぞれ " +"Unicode オブジェクト *uni* と *string* を比較して、左引数が右引数より小さい場" +"合、左右引数が等価の場合、左引数が右引数より大きい場合に対して、それぞれ " "``-1``, ``0``, ``1`` を返します。\n" "ASCII エンコードされた文字列だけを渡すのが最も良いですが、入力文字列に非 " "ASCII 文字が含まれている場合は ISO-8859-1 として解釈します。" -#: ../../c-api/unicode.rst:1660 +#: ../../c-api/unicode.rst:1696 +msgid "This function does not raise exceptions." +msgstr "この関数は例外を送出しません。" + +#: ../../c-api/unicode.rst:1701 msgid "Rich compare two Unicode strings and return one of the following:" msgstr "二つのUnicode文字列を比較して、下のうちの一つを返します:" -#: ../../c-api/unicode.rst:1662 +#: ../../c-api/unicode.rst:1703 msgid "``NULL`` in case an exception was raised" msgstr "``NULL`` を、例外が発生したときに返します。" -#: ../../c-api/unicode.rst:1663 -msgid ":c:data:`Py_True` or :c:data:`Py_False` for successful comparisons" +#: ../../c-api/unicode.rst:1704 +msgid ":const:`Py_True` or :const:`Py_False` for successful comparisons" msgstr "" -":c:data:`Py_True` もしくは :c:data:`Py_False` を、正しく比較できた時に返しま" +":const:`Py_True` もしくは :const:`Py_False` を、正しく比較できた時に返しま" "す。" -#: ../../c-api/unicode.rst:1664 -msgid ":c:data:`Py_NotImplemented` in case the type combination is unknown" +#: ../../c-api/unicode.rst:1705 +msgid ":const:`Py_NotImplemented` in case the type combination is unknown" msgstr "" +":const:`Py_NotImplemented` を、 *left* と *right* のどちらかに対する :c:func:" +"`PyUnicode_FromObject` が失敗したときに返します。(原文: in case the type " +"combination is unknown)" -#: ../../c-api/unicode.rst:1666 +#: ../../c-api/unicode.rst:1707 msgid "" -"Possible values for *op* are :c:macro:`Py_GT`, :c:macro:`Py_GE`, :c:macro:" -"`Py_EQ`, :c:macro:`Py_NE`, :c:macro:`Py_LT`, and :c:macro:`Py_LE`." +"Possible values for *op* are :const:`Py_GT`, :const:`Py_GE`, :const:" +"`Py_EQ`, :const:`Py_NE`, :const:`Py_LT`, and :const:`Py_LE`." msgstr "" +"*op* に入れられる値は、 :const:`Py_GT`, :const:`Py_GE`, :const:`Py_EQ`, :" +"const:`Py_NE`, :const:`Py_LT`, and :const:`Py_LE` のどれかです。" -#: ../../c-api/unicode.rst:1672 +#: ../../c-api/unicode.rst:1713 msgid "" "Return a new string object from *format* and *args*; this is analogous to " "``format % args``." @@ -2326,306 +2588,56 @@ msgstr "" "新たな文字列オブジェクトを *format* および *args* から生成して返します; この" "メソッドは ``format % args`` のようなものです。" -#: ../../c-api/unicode.rst:1678 +#: ../../c-api/unicode.rst:1719 msgid "" -"Check whether *substr* is contained in *unicode* and return true or false " +"Check whether *element* is contained in *container* and return true or false " "accordingly." msgstr "" -"*substr* が *unicode* 内にあるか調べ、その結果に応じて真または偽を返します。" +"*element* が *container* 内にあるか調べ、その結果に応じて真または偽を返しま" +"す。" -#: ../../c-api/unicode.rst:1681 +#: ../../c-api/unicode.rst:1722 msgid "" -"*substr* has to coerce to a one element Unicode string. ``-1`` is returned " +"*element* has to coerce to a one element Unicode string. ``-1`` is returned " "if there was an error." msgstr "" -"*substr* は単要素の Unicode 文字に型強制できなければなりません。エラーが生じ" +"*element* は単要素の Unicode 文字に型強制できなければなりません。エラーが生じ" "た場合には ``-1`` を返します。" -#: ../../c-api/unicode.rst:1687 -msgid "" -"Intern the argument :c:expr:`*p_unicode` in place. The argument must be the " -"address of a pointer variable pointing to a Python Unicode string object. " -"If there is an existing interned string that is the same as :c:expr:" -"`*p_unicode`, it sets :c:expr:`*p_unicode` to it (releasing the reference to " -"the old string object and creating a new :term:`strong reference` to the " -"interned string object), otherwise it leaves :c:expr:`*p_unicode` alone and " -"interns it." -msgstr "" - -#: ../../c-api/unicode.rst:1694 -msgid "" -"(Clarification: even though there is a lot of talk about references, think " -"of this function as reference-neutral. You must own the object you pass in; " -"after the call you no longer own the passed-in reference, but you newly own " -"the result.)" -msgstr "" - -#: ../../c-api/unicode.rst:1699 -msgid "" -"This function never raises an exception. On error, it leaves its argument " -"unchanged without interning it." -msgstr "" - -#: ../../c-api/unicode.rst:1702 -msgid "" -"Instances of subclasses of :py:class:`str` may not be interned, that is, :c:" -"expr:`PyUnicode_CheckExact(*p_unicode)` must be true. If it is not, then -- " -"as with any other error -- the argument is left unchanged." -msgstr "" - -#: ../../c-api/unicode.rst:1706 -msgid "" -"Note that interned strings are not “immortal”. You must keep a reference to " -"the result to benefit from interning." -msgstr "" - -#: ../../c-api/unicode.rst:1712 -msgid "" -"A combination of :c:func:`PyUnicode_FromString` and :c:func:" -"`PyUnicode_InternInPlace`, meant for statically allocated strings." -msgstr "" - -#: ../../c-api/unicode.rst:1715 -msgid "" -"Return a new (\"owned\") reference to either a new Unicode string object " -"that has been interned, or an earlier interned string object with the same " -"value." -msgstr "" - -#: ../../c-api/unicode.rst:1719 -msgid "" -"Python may keep a reference to the result, or make it :term:`immortal`, " -"preventing it from being garbage-collected promptly. For interning an " -"unbounded number of different strings, such as ones coming from user input, " -"prefer calling :c:func:`PyUnicode_FromString` and :c:func:" -"`PyUnicode_InternInPlace` directly." -msgstr "" - #: ../../c-api/unicode.rst:1728 msgid "" -"Return a non-zero value if *str* is interned, zero if not. The *str* " -"argument must be a string; this is not checked. This function always " -"succeeds." -msgstr "" - -#: ../../c-api/unicode.rst:1734 -msgid "" -"A non-zero return value may carry additional information about *how* the " -"string is interned. The meaning of such non-zero values, as well as each " -"specific string's intern-related details, may change between CPython " -"versions." -msgstr "" +"Intern the argument *\\*string* in place. The argument must be the address " +"of a pointer variable pointing to a Python Unicode string object. If there " +"is an existing interned string that is the same as *\\*string*, it sets " +"*\\*string* to it (decrementing the reference count of the old string object " +"and incrementing the reference count of the interned string object), " +"otherwise it leaves *\\*string* alone and interns it (incrementing its " +"reference count). (Clarification: even though there is a lot of talk about " +"reference counts, think of this function as reference-count-neutral; you own " +"the object after the call if and only if you owned it before the call.)" +msgstr "" +"引数 *\\*string* をインプレースで収容 (intern) します。\n" +"引数は Python Unicode 文字列オブジェクトを指すポインタ変数のアドレスでなけれ" +"ばなりません。\n" +"*\\*string* と等しい、すでに収容済みの文字列が存在する場合は、 *\\*string* に" +"その文字列を設定します (そして、元の渡された文字列オブジェクトの参照カウント" +"をデクリメントし、すでに収容済みの文字列オブジェクトの参照カウントをインクリ" +"メントします)。\n" +"そうでない場合は、 *\\*string* は変更せず、そのまま収容します (そして、参照カ" +"ウントをインクリメントします)。\n" +"(解説: 参照カウントについては沢山説明して来ましたが、この関数は参照カウント中" +"立 (reference-count-neutral) と考えてください; この関数を呼び出した後にオブ" +"ジェクトの所有権を持っているのは、関数を呼び出す前にすでに所有権を持っていた" +"場合かつその場合に限ります。)" #: ../../c-api/unicode.rst:1741 -msgid "PyUnicodeWriter" -msgstr "" - -#: ../../c-api/unicode.rst:1743 -msgid "" -"The :c:type:`PyUnicodeWriter` API can be used to create a Python :class:" -"`str` object." -msgstr "" - -#: ../../c-api/unicode.rst:1750 -msgid "A Unicode writer instance." -msgstr "" - -#: ../../c-api/unicode.rst:1752 -msgid "" -"The instance must be destroyed by :c:func:`PyUnicodeWriter_Finish` on " -"success, or :c:func:`PyUnicodeWriter_Discard` on error." -msgstr "" - -#: ../../c-api/unicode.rst:1757 -msgid "Create a Unicode writer instance." -msgstr "" - -#: ../../c-api/unicode.rst:1759 -msgid "*length* must be greater than or equal to ``0``." -msgstr "" - -#: ../../c-api/unicode.rst:1761 -msgid "" -"If *length* is greater than ``0``, preallocate an internal buffer of " -"*length* characters." -msgstr "" - -#: ../../c-api/unicode.rst:1764 ../../c-api/unicode.rst:1770 -msgid "Set an exception and return ``NULL`` on error." -msgstr "" - -#: ../../c-api/unicode.rst:1768 -msgid "" -"Return the final Python :class:`str` object and destroy the writer instance." -msgstr "" - -#: ../../c-api/unicode.rst:1772 ../../c-api/unicode.rst:1780 -msgid "The writer instance is invalid after this call." -msgstr "" - -#: ../../c-api/unicode.rst:1776 -msgid "Discard the internal Unicode buffer and destroy the writer instance." -msgstr "" - -#: ../../c-api/unicode.rst:1778 -msgid "If *writer* is ``NULL``, no operation is performed." -msgstr "" - -#: ../../c-api/unicode.rst:1784 -msgid "Write the single Unicode character *ch* into *writer*." -msgstr "" - -#: ../../c-api/unicode.rst:1786 ../../c-api/unicode.rst:1796 -#: ../../c-api/unicode.rst:1811 ../../c-api/unicode.rst:1823 -#: ../../c-api/unicode.rst:1832 ../../c-api/unicode.rst:1839 -#: ../../c-api/unicode.rst:1846 ../../c-api/unicode.rst:1857 -#: ../../c-api/unicode.rst:1864 ../../c-api/unicode.rst:1883 -msgid "" -"On success, return ``0``. On error, set an exception, leave the writer " -"unchanged, and return ``-1``." -msgstr "" - -#: ../../c-api/unicode.rst:1791 -msgid "" -"Decode the string *str* from UTF-8 in strict mode and write the output into " -"*writer*." -msgstr "" - -#: ../../c-api/unicode.rst:1793 ../../c-api/unicode.rst:1805 -#: ../../c-api/unicode.rst:1872 -msgid "" -"*size* is the string length in bytes. If *size* is equal to ``-1``, call " -"``strlen(str)`` to get the string length." -msgstr "" - -#: ../../c-api/unicode.rst:1799 -msgid "See also :c:func:`PyUnicodeWriter_DecodeUTF8Stateful`." -msgstr "" - -#: ../../c-api/unicode.rst:1803 -msgid "Write the ASCII string *str* into *writer*." -msgstr "" - -#: ../../c-api/unicode.rst:1808 -msgid "" -"*str* must only contain ASCII characters. The behavior is undefined if *str* " -"contains non-ASCII characters." -msgstr "" - -#: ../../c-api/unicode.rst:1818 -msgid "Write the wide string *str* into *writer*." -msgstr "" - -#: ../../c-api/unicode.rst:1820 -msgid "" -"*size* is a number of wide characters. If *size* is equal to ``-1``, call " -"``wcslen(str)`` to get the string length." -msgstr "" - -#: ../../c-api/unicode.rst:1828 -msgid "Writer the UCS4 string *str* into *writer*." -msgstr "" - -#: ../../c-api/unicode.rst:1830 -msgid "*size* is a number of UCS4 characters." -msgstr "" - -#: ../../c-api/unicode.rst:1837 -msgid "" -"Call :c:func:`PyObject_Str` on *obj* and write the output into *writer*." -msgstr "" - -#: ../../c-api/unicode.rst:1844 -msgid "" -"Call :c:func:`PyObject_Repr` on *obj* and write the output into *writer*." -msgstr "" - -#: ../../c-api/unicode.rst:1851 -msgid "Write the substring ``str[start:end]`` into *writer*." -msgstr "" - -#: ../../c-api/unicode.rst:1853 -msgid "" -"*str* must be Python :class:`str` object. *start* must be greater than or " -"equal to 0, and less than or equal to *end*. *end* must be less than or " -"equal to *str* length." -msgstr "" - -#: ../../c-api/unicode.rst:1862 -msgid "" -"Similar to :c:func:`PyUnicode_FromFormat`, but write the output directly " -"into *writer*." -msgstr "" - -#: ../../c-api/unicode.rst:1869 -msgid "" -"Decode the string *str* from UTF-8 with *errors* error handler and write the " -"output into *writer*." -msgstr "" - -#: ../../c-api/unicode.rst:1875 msgid "" -"*errors* is an :ref:`error handler ` name, such as " -"``\"replace\"``. If *errors* is ``NULL``, use the strict error handler." -msgstr "" - -#: ../../c-api/unicode.rst:1878 -msgid "" -"If *consumed* is not ``NULL``, set *\\*consumed* to the number of decoded " -"bytes on success. If *consumed* is ``NULL``, treat trailing incomplete UTF-8 " -"byte sequences as an error." -msgstr "" - -#: ../../c-api/unicode.rst:1886 -msgid "See also :c:func:`PyUnicodeWriter_WriteUTF8`." -msgstr "" - -#: ../../c-api/unicode.rst:1889 -msgid "Deprecated API" -msgstr "" - -#: ../../c-api/unicode.rst:1891 -msgid "The following API is deprecated." -msgstr "" - -#: ../../c-api/unicode.rst:1895 -msgid "" -"This is a typedef of :c:type:`wchar_t`, which is a 16-bit type or 32-bit " -"type depending on the platform. Please use :c:type:`wchar_t` directly " -"instead." -msgstr "" - -#: ../../c-api/unicode.rst:1899 -msgid "" -"In previous versions, this was a 16-bit type or a 32-bit type depending on " -"whether you selected a \"narrow\" or \"wide\" Unicode version of Python at " -"build time." -msgstr "" -"以前のバージョンでは、Pythonをビルドした際に \"narrow\" または \"wide\" " -"Unicode バージョンのどちらを選択したかによって、 16ビットか32ビットのどちらか" -"の型になっていました。" - -#: ../../c-api/unicode.rst:1909 -msgid "" -"Do nothing and return ``0``. This API is kept only for backward " -"compatibility, but there are no plans to remove it." -msgstr "" - -#: ../../c-api/unicode.rst:1915 -msgid "" -"This API does nothing since Python 3.12. Previously, this needed to be " -"called for each string created using the old API (:c:func:`!" -"PyUnicode_FromUnicode` or similar)." -msgstr "" - -#: ../../c-api/unicode.rst:1923 -msgid "" -"Do nothing and return ``1``. This API is kept only for backward " -"compatibility, but there are no plans to remove it." -msgstr "" - -#: ../../c-api/unicode.rst:1929 -msgid "" -"This API does nothing since Python 3.12. Previously, this could be called to " -"check if :c:func:`PyUnicode_READY` is necessary." +"A combination of :c:func:`PyUnicode_FromString` and :c:func:" +"`PyUnicode_InternInPlace`, returning either a new Unicode string object that " +"has been interned, or a new (\"owned\") reference to an earlier interned " +"string object with the same value." msgstr "" +":c:func:`PyUnicode_FromString` と :c:func:`PyUnicode_InternInPlace` を組み合" +"わせたもので、収容済みの新たな文字列オブジェクトを返すか、同じ値を持つ収容済" +"みの Unicode 文字列オブジェクトに対する新たな (\"所有権のある\") 参照を返しま" +"す。" diff --git a/c-api/utilities.po b/c-api/utilities.po index a6246e39f..315ce98d9 100644 --- a/c-api/utilities.po +++ b/c-api/utilities.po @@ -1,25 +1,26 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 +# Arihiro TAKASE, 2017 +# Inada Naoki , 2017 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-30 14:22+0000\n" -"PO-Revision-Date: 2021-06-28 00:50+0000\n" -"Last-Translator: tomo, 2021\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 17:40+0000\n" +"Last-Translator: Inada Naoki , 2017\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/utilities.rst:7 diff --git a/c-api/veryhigh.po b/c-api/veryhigh.po index bdcceec2d..e90cd9ceb 100644 --- a/c-api/veryhigh.po +++ b/c-api/veryhigh.po @@ -1,28 +1,31 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 +# Nozomu Kaneko , 2017 +# E. Kawashima, 2017 +# Arihiro TAKASE, 2017 +# 秘湯 , 2017 +# tomo, 2020 +# mollinaca, 2020 # Osamu NAKAMURA, 2021 -# mollinaca, 2021 -# Arihiro TAKASE, 2023 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:50+0000\n" -"Last-Translator: Arihiro TAKASE, 2023\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 17:40+0000\n" +"Last-Translator: Osamu NAKAMURA, 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/veryhigh.rst:8 @@ -41,32 +44,71 @@ msgstr "" #: ../../c-api/veryhigh.rst:14 msgid "" "Several of these functions accept a start symbol from the grammar as a " -"parameter. The available start symbols are :c:data:`Py_eval_input`, :c:data:" -"`Py_file_input`, and :c:data:`Py_single_input`. These are described " +"parameter. The available start symbols are :const:`Py_eval_input`, :const:" +"`Py_file_input`, and :const:`Py_single_input`. These are described " "following the functions which accept them as parameters." msgstr "" +"これらの関数のいくつかは引数として文法の開始記号を受け取ります。使用できる開" +"始記号は :const:`Py_eval_input` と :const:`Py_file_input` 、 :const:" +"`Py_single_input` です。開始記号の説明はこれらを引数として取る関数の後にあり" +"ます。" #: ../../c-api/veryhigh.rst:19 msgid "" -"Note also that several of these functions take :c:expr:`FILE*` parameters. " +"Note also that several of these functions take :c:type:`FILE*` parameters. " "One particular issue which needs to be handled carefully is that the :c:type:" "`FILE` structure for different C libraries can be different and " "incompatible. Under Windows (at least), it is possible for dynamically " "linked extensions to actually use different libraries, so care should be " -"taken that :c:expr:`FILE*` parameters are only passed to these functions if " +"taken that :c:type:`FILE*` parameters are only passed to these functions if " "it is certain that they were created by the same library that the Python " "runtime is using." msgstr "" #: ../../c-api/veryhigh.rst:30 msgid "" +"The main program for the standard interpreter. This is made available for " +"programs which embed Python. The *argc* and *argv* parameters should be " +"prepared exactly as those which are passed to a C program's :c:func:`main` " +"function (converted to wchar_t according to the user's locale). It is " +"important to note that the argument list may be modified (but the contents " +"of the strings pointed to by the argument list are not). 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 parameter list does not represent a valid Python command line." +msgstr "" +"標準インタプリタのためのメインプログラム。Pythonを組み込むプログラムのために" +"これを利用できるようにしています。 *argc* と *argv* 引数をCプログラムの :c:" +"func:`main` 関数 (ユーザのロケールに従って wchar_t に変換されます) へ渡される" +"ものとまったく同じに作成すべきです。引数リストが変更される可能性があるという" +"点に注意することは重要です。 (しかし、引数リストが指している文字列の内容は変" +"更されません)。戻り値はインタプリタが(例外などではなく)普通に終了した時は " +"``0`` に、例外で終了したときには ``1`` に、引数リストが正しい Python コマンド" +"ラインが渡されなかったときは ``2`` になります。" + +#: ../../c-api/veryhigh.rst:40 +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." +msgstr "" +"``Py_InspectFlag`` が設定されていない場合、未処理の :exc:`SystemExit` 例外が" +"発生すると、この関数は ``1`` を返すのではなくプロセスを exit することに気をつ" +"けてください。" + +#: ../../c-api/veryhigh.rst:47 +msgid "Similar to :c:func:`Py_Main` but *argv* is an array of bytes strings." +msgstr "" + +#: ../../c-api/veryhigh.rst:54 +msgid "" "This is a simplified interface to :c:func:`PyRun_AnyFileExFlags` below, " "leaving *closeit* set to ``0`` and *flags* set to ``NULL``." msgstr "" "下記の :c:func:`PyRun_AnyFileExFlags` の *closeit* を ``0`` に、 *flags* を " "``NULL`` にして単純化したインターフェースです。" -#: ../../c-api/veryhigh.rst:36 +#: ../../c-api/veryhigh.rst:60 msgid "" "This is a simplified interface to :c:func:`PyRun_AnyFileExFlags` below, " "leaving the *closeit* argument set to ``0``." @@ -74,7 +116,7 @@ msgstr "" "下記の :c:func:`PyRun_AnyFileExFlags` の *closeit* を ``0`` にして単純化した" "インターフェースです。" -#: ../../c-api/veryhigh.rst:42 +#: ../../c-api/veryhigh.rst:66 msgid "" "This is a simplified interface to :c:func:`PyRun_AnyFileExFlags` below, " "leaving the *flags* argument set to ``NULL``." @@ -82,33 +124,29 @@ msgstr "" "下記の :c:func:`PyRun_AnyFileExFlags` の *flags* を ``NULL`` にして単純化した" "インターフェースです。" -#: ../../c-api/veryhigh.rst:48 +#: ../../c-api/veryhigh.rst:72 msgid "" "If *fp* refers to a file associated with an interactive device (console or " "terminal input or Unix pseudo-terminal), return the value of :c:func:" "`PyRun_InteractiveLoop`, otherwise return the result of :c:func:" "`PyRun_SimpleFile`. *filename* is decoded from the filesystem encoding (:" "func:`sys.getfilesystemencoding`). If *filename* is ``NULL``, this function " -"uses ``\"???\"`` as the filename. If *closeit* is true, the file is closed " -"before ``PyRun_SimpleFileExFlags()`` returns." +"uses ``\"???\"`` as the filename." msgstr "" "*fp* が対話的デバイス (コンソールや端末入力あるいは Unix 仮想端末) と関連づけ" "られたファイルを参照している場合は、 :c:func:`PyRun_InteractiveLoop` の値を返" "します。それ以外の場合は、 :c:func:`PyRun_SimpleFile` の結果を返します。 " "*filename* はファイルシステムのエンコーディング (:func:`sys." "getfilesystemencoding`) でデコードされます。 *filename* が ``NULL`` ならば、" -"この関数はファイル名として ``\"???\"`` を使います。*closeit* が真なら、ファイ" -"ルは ``PyRun_SimpleFileExFlags()`` が処理を戻す前に閉じられます。" +"この関数はファイル名として ``\"???\"`` を使います。" -#: ../../c-api/veryhigh.rst:60 +#: ../../c-api/veryhigh.rst:82 msgid "" "This is a simplified interface to :c:func:`PyRun_SimpleStringFlags` below, " -"leaving the :c:struct:`PyCompilerFlags`\\* argument set to ``NULL``." +"leaving the :c:type:`PyCompilerFlags`\\* argument set to ``NULL``." msgstr "" -"下記の :c:func:`PyRun_SimpleStringFlags` の :c:struct:`PyCompilerFlags`\\* " -"を ``NULL`` にして単純化したインタフェースです。" -#: ../../c-api/veryhigh.rst:66 +#: ../../c-api/veryhigh.rst:88 msgid "" "Executes the Python source code from *command* in the :mod:`__main__` module " "according to the *flags* argument. If :mod:`__main__` does not already " @@ -122,14 +160,17 @@ msgstr "" "します。エラーがあっても、例外情報を得る方法はありません。 *flags* の意味につ" "いては、後述します。" -#: ../../c-api/veryhigh.rst:72 +#: ../../c-api/veryhigh.rst:94 msgid "" "Note that if an otherwise unhandled :exc:`SystemExit` is raised, this " -"function will not return ``-1``, but exit the process, as long as :c:member:" -"`PyConfig.inspect` is zero." +"function will not return ``-1``, but exit the process, as long as " +"``Py_InspectFlag`` is not set." msgstr "" +"``Py_InspectFlag`` が設定されていない場合、未処理の :exc:`SystemExit` 例外が" +"発生すると、この関数は ``1`` を返すのではなくプロセスを exit することに気をつ" +"けてください。" -#: ../../c-api/veryhigh.rst:79 +#: ../../c-api/veryhigh.rst:101 msgid "" "This is a simplified interface to :c:func:`PyRun_SimpleFileExFlags` below, " "leaving *closeit* set to ``0`` and *flags* set to ``NULL``." @@ -137,7 +178,7 @@ msgstr "" "下記の :c:func:`PyRun_SimpleFileExFlags` の *closeit* を ``0`` に、 *flags* " "を ``NULL`` にして単純化したインターフェースです。" -#: ../../c-api/veryhigh.rst:85 +#: ../../c-api/veryhigh.rst:107 msgid "" "This is a simplified interface to :c:func:`PyRun_SimpleFileExFlags` below, " "leaving *flags* set to ``NULL``." @@ -145,22 +186,21 @@ msgstr "" "下記の :c:func:`PyRun_SimpleFileExFlags` の *flags* を ``NULL`` にして単純化" "したインターフェースです。" -#: ../../c-api/veryhigh.rst:91 +#: ../../c-api/veryhigh.rst:113 msgid "" "Similar to :c:func:`PyRun_SimpleStringFlags`, but the Python source code is " "read from *fp* instead of an in-memory string. *filename* should be the name " -"of the file, it is decoded from :term:`filesystem encoding and error " -"handler`. If *closeit* is true, the file is closed before " -"``PyRun_SimpleFileExFlags()`` returns." +"of the file, it is decoded from the filesystem encoding (:func:`sys." +"getfilesystemencoding`). If *closeit* is true, the file is closed before " +"PyRun_SimpleFileExFlags returns." msgstr "" ":c:func:`PyRun_SimpleStringFlags` と似ていますが、Pythonソースコードをメモリ" "内の文字列ではなく *fp* から読み込みます。 *filename* はそのファイルの名前で" -"なければならず、 :term:`ファイルシステムのエンコーディングとエラーハンドラ " -"` でデコードされます。 *closeit* に真" -"を指定した場合は、``PyRun_SimpleFileExFlags()`` が処理を戻す前にファイルを閉" -"じます。" +"なければならず、ファイルシステムのエンコーディング (:func:`sys." +"getfilesystemencoding`) でデコードされます。 *closeit* に真を指定した場合は、" +"PyRun_SimpleFileExFlags が処理を戻す前にファイルを閉じます。" -#: ../../c-api/veryhigh.rst:98 +#: ../../c-api/veryhigh.rst:120 msgid "" "On Windows, *fp* should be opened as binary mode (e.g. ``fopen(filename, " "\"rb\")``). Otherwise, Python may not handle script file with LF line ending " @@ -170,7 +210,7 @@ msgstr "" "\"rb\")``)。\n" "そうしない場合は、 Python は行末が LF のスクリプトを正しく扱えないでしょう。" -#: ../../c-api/veryhigh.rst:104 +#: ../../c-api/veryhigh.rst:126 msgid "" "This is a simplified interface to :c:func:`PyRun_InteractiveOneFlags` below, " "leaving *flags* set to ``NULL``." @@ -178,19 +218,19 @@ msgstr "" "下記の :c:func:`PyRun_InteractiveOneFlags` の *flags* を ``NULL`` にして単純" "化したインターフェースです。" -#: ../../c-api/veryhigh.rst:110 +#: ../../c-api/veryhigh.rst:132 msgid "" "Read and execute a single statement from a file associated with an " "interactive device according to the *flags* argument. The user will be " -"prompted using ``sys.ps1`` and ``sys.ps2``. *filename* is decoded from the :" -"term:`filesystem encoding and error handler`." +"prompted using ``sys.ps1`` and ``sys.ps2``. *filename* is decoded from the " +"filesystem encoding (:func:`sys.getfilesystemencoding`)." msgstr "" "対話的デバイスに関連付けられたファイルから文を一つ読み込み、 *flags* に従って" "実行します。 ``sys.ps1`` と ``sys.ps2`` を使って、ユーザにプロンプトを表示し" -"ます。 *filename* は :term:`ファイルシステムのエンコーディングとエラーハンド" -"ラ ` でデコードされます。" +"ます。 *filename* はファイルシステムのエンコーディング (:func:`sys." +"getfilesystemencoding`) でデコードされます。" -#: ../../c-api/veryhigh.rst:115 +#: ../../c-api/veryhigh.rst:137 msgid "" "Returns ``0`` when the input was executed successfully, ``-1`` if there was " "an exception, or an error code from the :file:`errcode.h` include file " @@ -204,7 +244,7 @@ msgstr "" "`Python.h` は :file:`errcode.h` をインクルードしません。従って、 必要な場合は" "その都度インクルードしなければならないことに注意してください。)" -#: ../../c-api/veryhigh.rst:124 +#: ../../c-api/veryhigh.rst:146 msgid "" "This is a simplified interface to :c:func:`PyRun_InteractiveLoopFlags` " "below, leaving *flags* set to ``NULL``." @@ -212,21 +252,22 @@ msgstr "" "下記の :c:func:`PyRun_InteractiveLoopFlags` の *flags* を ``NULL`` にして単純" "化したインターフェースです。" -#: ../../c-api/veryhigh.rst:130 +#: ../../c-api/veryhigh.rst:152 msgid "" "Read and execute statements from a file associated with an interactive " "device until EOF is reached. The user will be prompted using ``sys.ps1`` " -"and ``sys.ps2``. *filename* is decoded from the :term:`filesystem encoding " -"and error handler`. Returns ``0`` at EOF or a negative number upon failure." +"and ``sys.ps2``. *filename* is decoded from the filesystem encoding (:func:" +"`sys.getfilesystemencoding`). Returns ``0`` at EOF or a negative number " +"upon failure." msgstr "" "対話的デバイスに関連付けられたファイルから EOF に達するまで文を読み込み実行し" "ます。\n" "``sys.ps1`` と ``sys.ps2`` を使って、ユーザにプロンプトを表示します。\n" -"*filename* は :term:`ファイルシステムのエンコーディングとエラーハンドラ " -"` でデコードされます。\n" +"*filename* はファイルシステムのエンコーディング (:func:`sys." +"getfilesystemencoding`) でデコードされます。\n" "EOFに達すると ``0`` を返すか、失敗したら負の数を返します。" -#: ../../c-api/veryhigh.rst:138 +#: ../../c-api/veryhigh.rst:161 msgid "" "Can be set to point to a function with the prototype ``int func(void)``. " "The function will be called when Python's interpreter prompt is about to " @@ -243,13 +284,7 @@ msgstr "" "_tkinter.c` がやっているように、インタプリタのプロンプトと他のイベントループ" "を統合できます。" -#: ../../c-api/veryhigh.rst:146 ../../c-api/veryhigh.rst:170 -msgid "" -"This function is only called from the :ref:`main interpreter `." -msgstr "" - -#: ../../c-api/veryhigh.rst:153 +#: ../../c-api/veryhigh.rst:172 msgid "" "Can be set to point to a function with the prototype ``char *func(FILE " "*stdin, FILE *stdout, char *prompt)``, overriding the default function used " @@ -268,7 +303,7 @@ msgstr "" "例えば、 :mod:`readline` モジュールはこのフックを設定して、行編集機能やタブ補" "完機能を提供しています。" -#: ../../c-api/veryhigh.rst:162 +#: ../../c-api/veryhigh.rst:181 msgid "" "The result must be a string allocated by :c:func:`PyMem_RawMalloc` or :c:" "func:`PyMem_RawRealloc`, or ``NULL`` if an error occurred." @@ -277,7 +312,7 @@ msgstr "" "確保した文字列、あるいはエラーが起きた場合には ``NULL`` でなければなりませ" "ん。" -#: ../../c-api/veryhigh.rst:165 +#: ../../c-api/veryhigh.rst:184 msgid "" "The result must be allocated by :c:func:`PyMem_RawMalloc` or :c:func:" "`PyMem_RawRealloc`, instead of being allocated by :c:func:`PyMem_Malloc` or :" @@ -287,7 +322,56 @@ msgstr "" "func:`PyMem_RawMalloc` または :c:func:`PyMem_RawRealloc` でメモリ確保したもの" "でなければなりません。" -#: ../../c-api/veryhigh.rst:176 +#: ../../c-api/veryhigh.rst:192 +msgid "" +"This is a simplified interface to :c:func:" +"`PyParser_SimpleParseStringFlagsFilename` below, leaving *filename* set to " +"``NULL`` and *flags* set to ``0``." +msgstr "" +"下記の :c:func:`PyParser_SimpleParseStringFlagsFilename` の *filename* を " +"``NULL`` に、 *flags* を ``0`` にして単純化したインターフェースです。" + +#: ../../c-api/veryhigh.rst:201 +msgid "" +"This is a simplified interface to :c:func:" +"`PyParser_SimpleParseStringFlagsFilename` below, leaving *filename* set to " +"``NULL``." +msgstr "" +"下記の :c:func:`PyParser_SimpleParseStringFlagsFilename` の *filename* を " +"``NULL`` にして単純化したインターフェースです。" + +#: ../../c-api/veryhigh.rst:210 +msgid "" +"Parse Python source code from *str* using the start token *start* according " +"to the *flags* argument. The result can be used to create a code object " +"which can be evaluated efficiently. This is useful if a code fragment must " +"be evaluated many times. *filename* is decoded from the filesystem encoding " +"(:func:`sys.getfilesystemencoding`)." +msgstr "" +"開始トークン *start* を使って *str* に含まれる Python ソースコードを *flags* " +"引数に従ってパースします。効率的に評価可能なコードオブジェ クトを作成するため" +"にその結果を使うことができます。コード断片を何度も評価しなければならない場合" +"に役に立ちます。 *filename* はファイルシステムエンコーディング (:func:`sys." +"getfilesystemencoding`) でデコードされます。" + +#: ../../c-api/veryhigh.rst:221 +msgid "" +"This is a simplified interface to :c:func:`PyParser_SimpleParseFileFlags` " +"below, leaving *flags* set to ``0``." +msgstr "" +"下記の :c:func:`PyRun_SimpleParseFileFlags` の *flags* を ``0`` にして単純化" +"したインターフェースです。" + +#: ../../c-api/veryhigh.rst:229 +msgid "" +"Similar to :c:func:`PyParser_SimpleParseStringFlagsFilename`, but the Python " +"source code is read from *fp* instead of an in-memory string." +msgstr "" +":c:func:`PyParser_SimpleParseStringFlagsFilename` に似ていますが、 Pythonソー" +"スコードをメモリ内の文字列ではなく *fp* から読み込みます。 *filename* はその" +"ファイルの名前でなけれななりません。" + +#: ../../c-api/veryhigh.rst:237 msgid "" "This is a simplified interface to :c:func:`PyRun_StringFlags` below, leaving " "*flags* set to ``NULL``." @@ -295,7 +379,7 @@ msgstr "" "下記の :c:func:`PyRun_StringFlags` の *flags* を ``NULL`` にして単純化したイ" "ンターフェースです。" -#: ../../c-api/veryhigh.rst:182 +#: ../../c-api/veryhigh.rst:243 msgid "" "Execute Python source code from *str* in the context specified by the " "objects *globals* and *locals* with the compiler flags specified by " @@ -311,7 +395,7 @@ msgstr "" "引数 *start* はソースコードをパースするために使われるべき開始トークンを指定し" "ます。" -#: ../../c-api/veryhigh.rst:188 +#: ../../c-api/veryhigh.rst:249 msgid "" "Returns the result of executing the code as a Python object, or ``NULL`` if " "an exception was raised." @@ -319,7 +403,7 @@ msgstr "" "コードを実行した結果をPythonオブジェクトとして返します。または、例外が発生し" "たならば ``NULL`` を返します。" -#: ../../c-api/veryhigh.rst:194 +#: ../../c-api/veryhigh.rst:255 msgid "" "This is a simplified interface to :c:func:`PyRun_FileExFlags` below, leaving " "*closeit* set to ``0`` and *flags* set to ``NULL``." @@ -327,7 +411,7 @@ msgstr "" "下記の :c:func:`PyRun_FileExFlags` の *closeit* を ``0`` にし、 *flags* を " "``NULL`` にして単純化したインターフェースです。" -#: ../../c-api/veryhigh.rst:200 +#: ../../c-api/veryhigh.rst:261 msgid "" "This is a simplified interface to :c:func:`PyRun_FileExFlags` below, leaving " "*flags* set to ``NULL``." @@ -335,7 +419,7 @@ msgstr "" "下記の :c:func:`PyRun_FileExFlags` の *flags* を ``NULL`` にして単純化したイ" "ンターフェースです。" -#: ../../c-api/veryhigh.rst:206 +#: ../../c-api/veryhigh.rst:267 msgid "" "This is a simplified interface to :c:func:`PyRun_FileExFlags` below, leaving " "*closeit* set to ``0``." @@ -343,22 +427,21 @@ msgstr "" "下記の :c:func:`PyRun_FileExFlags` の *closeit* を ``0`` にして単純化したイン" "ターフェースです。" -#: ../../c-api/veryhigh.rst:212 +#: ../../c-api/veryhigh.rst:273 msgid "" "Similar to :c:func:`PyRun_StringFlags`, but the Python source code is read " "from *fp* instead of an in-memory string. *filename* should be the name of " -"the file, it is decoded from the :term:`filesystem encoding and error " -"handler`. If *closeit* is true, the file is closed before :c:func:" -"`PyRun_FileExFlags` returns." +"the file, it is decoded from the filesystem encoding (:func:`sys." +"getfilesystemencoding`). If *closeit* is true, the file is closed before :c:" +"func:`PyRun_FileExFlags` returns." msgstr "" ":c:func:`PyRun_StringFlags` と似ていますが、Pythonソースコードをメモリ内の文" "字列ではなく *fp* から読み込みます。 *filename* はそのファイルの名前でなけれ" -"ばならず、 :term:`ファイルシステムのエンコーディングとエラーハンドラ " -"` でデコードされます。 *closeit* に真" -"を指定した場合は、:c:func:`PyRun_FileExFlags` が処理を戻す前にファイルを閉じ" -"ます。" +"ばならず、ファイルシステムのエンコーディング (:func:`sys." +"getfilesystemencoding`) でデコードされます。もし *closeit* を真にすると、 :c:" +"func:`PyRun_FileExFlags` が処理を戻す前にファイルを閉じます。" -#: ../../c-api/veryhigh.rst:221 +#: ../../c-api/veryhigh.rst:282 msgid "" "This is a simplified interface to :c:func:`Py_CompileStringFlags` below, " "leaving *flags* set to ``NULL``." @@ -366,7 +449,7 @@ msgstr "" "下記の :c:func:`Py_CompileStringFlags` の *flags* を ``NULL`` にして単純化し" "たインターフェースです。" -#: ../../c-api/veryhigh.rst:227 +#: ../../c-api/veryhigh.rst:288 msgid "" "This is a simplified interface to :c:func:`Py_CompileStringExFlags` below, " "with *optimize* set to ``-1``." @@ -374,18 +457,26 @@ msgstr "" "下記の :c:func:`Py_CompileStringExFlags` の *optimize* を ``-1`` にして単純化" "したインターフェースです。" -#: ../../c-api/veryhigh.rst:233 +#: ../../c-api/veryhigh.rst:294 msgid "" "Parse and compile the Python source code in *str*, returning the resulting " "code object. The start token is given by *start*; this can be used to " -"constrain the code which can be compiled and should be :c:data:" -"`Py_eval_input`, :c:data:`Py_file_input`, or :c:data:`Py_single_input`. The " +"constrain the code which can be compiled and should be :const:" +"`Py_eval_input`, :const:`Py_file_input`, or :const:`Py_single_input`. The " "filename specified by *filename* is used to construct the code object and " "may appear in tracebacks or :exc:`SyntaxError` exception messages. This " "returns ``NULL`` if the code cannot be parsed or compiled." msgstr "" +"*str* 内の Python ソースコードをパースしてコンパイルし、作られたコードオブ" +"ジェクトを返します。開始トークンは *start* によって与えられます。これはコンパ" +"イル可能なコードを制限するために使うことができ、 :const:`Py_eval_input` 、 :" +"const:`Py_file_input` もしくは :const:`Py_single_input` であるべきです。 " +"*filename* で指定されるファイル名はコードオブジェクトを構築するために使われ、" +"トレースバックあるいは :exc:`SyntaxError` 例外メッセージに出てくる可能性があ" +"ります。コードがパースできなかったりコンパイルできなかったりした場合に、これ" +"は ``NULL`` を返します。" -#: ../../c-api/veryhigh.rst:241 +#: ../../c-api/veryhigh.rst:302 msgid "" "The integer *optimize* specifies the optimization level of the compiler; a " "value of ``-1`` selects the optimization level of the interpreter as given " @@ -398,16 +489,15 @@ msgstr "" "明示的なレベルは、 ``0`` (最適化なし、 ``__debug__`` は真)、 ``1`` (assert は" "取り除かれ、 ``__debug__`` は偽)、 ``2`` (docstring も取り除かれる) です。" -#: ../../c-api/veryhigh.rst:252 +#: ../../c-api/veryhigh.rst:313 msgid "" "Like :c:func:`Py_CompileStringObject`, but *filename* is a byte string " -"decoded from the :term:`filesystem encoding and error handler`." +"decoded from the filesystem encoding (:func:`os.fsdecode`)." msgstr "" -":c:func:`Py_CompileStringObject` と似ていますが、 *filename* は :term:`ファイ" -"ルシステムのエンコーディングとエラーハンドラ ` でデコードされたバイト文字列です。" +":c:func:`Py_CompileStringObject` と似ていますが、 *filename* はファイルシステ" +"ムのエンコーディングでデコード (:func:`os.fsdecode`) されたバイト文字列です。" -#: ../../c-api/veryhigh.rst:259 +#: ../../c-api/veryhigh.rst:320 msgid "" "This is a simplified interface to :c:func:`PyEval_EvalCodeEx`, with just the " "code object, and global and local variables. The other arguments are set to " @@ -417,7 +507,7 @@ msgstr "" "トと、グローバル変数とローカル変数だけを受け取ります。\n" "他の引数には ``NULL`` が渡されます。" -#: ../../c-api/veryhigh.rst:266 +#: ../../c-api/veryhigh.rst:327 msgid "" "Evaluate a precompiled code object, given a particular environment for its " "evaluation. This environment consists of a dictionary of global variables, " @@ -430,7 +520,15 @@ msgstr "" "列、キーワードとデフォルト値、:ref:`キーワード専用 ` " "引数のデフォルト値の辞書と、セルのクロージャタプルで構成されます。" -#: ../../c-api/veryhigh.rst:275 +#: ../../c-api/veryhigh.rst:336 +msgid "" +"The C structure of the objects used to describe frame objects. The fields of " +"this type are subject to change at any time." +msgstr "" +"フレームオブジェクトを表現するために使われるオブジェクトのC構造体。\n" +"この型のフィールドはいつでも変更され得ます。" + +#: ../../c-api/veryhigh.rst:342 msgid "" "Evaluate an execution frame. This is a simplified interface to :c:func:" "`PyEval_EvalFrameEx`, for backward compatibility." @@ -438,7 +536,7 @@ msgstr "" "実行フレームを評価します。これは :c:func:`PyEval_EvalFrameEx` に対するシンプ" "ルなインターフェースで、後方互換性のためのものです。" -#: ../../c-api/veryhigh.rst:281 +#: ../../c-api/veryhigh.rst:348 msgid "" "This is the main, unvarnished function of Python interpretation. The code " "object associated with the execution frame *f* is executed, interpreting " @@ -453,7 +551,7 @@ msgstr "" "し true なら、 すぐに例外を発生させます。これはジェネレータオブジェクトの :" "meth:`~generator.throw` メソッドで利用されます。" -#: ../../c-api/veryhigh.rst:288 +#: ../../c-api/veryhigh.rst:355 msgid "" "This function now includes a debug assertion to help ensure that it does not " "silently discard an active exception." @@ -461,7 +559,7 @@ msgstr "" "アクティブな例外を黙って捨てないことを保証するのに便利なように、この関数はデ" "バッグアサーションを含むようになりました。" -#: ../../c-api/veryhigh.rst:295 +#: ../../c-api/veryhigh.rst:362 msgid "" "This function changes the flags of the current evaluation frame, and returns " "true on success, false on failure." @@ -469,7 +567,7 @@ msgstr "" "現在の評価フレームのフラグを変更します。成功したら true を、失敗したら false " "を返します。" -#: ../../c-api/veryhigh.rst:303 +#: ../../c-api/veryhigh.rst:370 msgid "" "The start symbol from the Python grammar for isolated expressions; for use " "with :c:func:`Py_CompileString`." @@ -477,7 +575,7 @@ msgstr "" "単独の式に対するPython文法の開始記号で、 :c:func:`Py_CompileString` と一緒に" "使います。" -#: ../../c-api/veryhigh.rst:311 +#: ../../c-api/veryhigh.rst:378 msgid "" "The start symbol from the Python grammar for sequences of statements as read " "from a file or other source; for use with :c:func:`Py_CompileString`. This " @@ -487,7 +585,7 @@ msgstr "" "号で、 :c:func:`Py_CompileString` と一緒に使います。これは任意の長さのPython" "ソースコードをコンパイルするときに使う記号です。" -#: ../../c-api/veryhigh.rst:320 +#: ../../c-api/veryhigh.rst:387 msgid "" "The start symbol from the Python grammar for a single statement; for use " "with :c:func:`Py_CompileString`. This is the symbol used for the interactive " @@ -496,7 +594,7 @@ msgstr "" "単一の文に対するPython文法の開始記号で、 :c:func:`Py_CompileString` と一緒に" "使います。これは対話式のインタプリタループのための記号です。" -#: ../../c-api/veryhigh.rst:327 +#: ../../c-api/veryhigh.rst:394 msgid "" "This is the structure used to hold compiler flags. In cases where code is " "only being compiled, it is passed as ``int flags``, and in cases where code " @@ -508,52 +606,39 @@ msgstr "" "``PyCompilerFlags *flags`` として渡されます。この場合、``from __future__ " "import`` は *flags* の内容を変更できます。" -#: ../../c-api/veryhigh.rst:332 +#: ../../c-api/veryhigh.rst:399 msgid "" -"Whenever ``PyCompilerFlags *flags`` is ``NULL``, :c:member:`~PyCompilerFlags." -"cf_flags` is treated as equal to ``0``, and any modification due to ``from " -"__future__ import`` is discarded." +"Whenever ``PyCompilerFlags *flags`` is ``NULL``, :attr:`cf_flags` is treated " +"as equal to ``0``, and any modification due to ``from __future__ import`` is " +"discarded." msgstr "" +"``PyCompilerFlags *flags`` が ``NULL`` の場合、 :attr:`cf_flags` は ``0`` と" +"して扱われ、 ``from __future__ import`` による変更は無視されます。" -#: ../../c-api/veryhigh.rst:338 +#: ../../c-api/veryhigh.rst:405 msgid "Compiler flags." msgstr "コンパイラフラグ。" -#: ../../c-api/veryhigh.rst:342 +#: ../../c-api/veryhigh.rst:409 msgid "" "*cf_feature_version* is the minor Python version. It should be initialized " "to ``PY_MINOR_VERSION``." msgstr "" -#: ../../c-api/veryhigh.rst:345 +#: ../../c-api/veryhigh.rst:412 msgid "" "The field is ignored by default, it is used if and only if ``PyCF_ONLY_AST`` " -"flag is set in :c:member:`~PyCompilerFlags.cf_flags`." +"flag is set in *cf_flags*." msgstr "" -#: ../../c-api/veryhigh.rst:348 +#: ../../c-api/veryhigh.rst:415 msgid "Added *cf_feature_version* field." msgstr "" -#: ../../c-api/veryhigh.rst:351 -msgid "The available compiler flags are accessible as macros:" -msgstr "" - -#: ../../c-api/veryhigh.rst:360 -msgid "" -"See :ref:`compiler flags ` in documentation of the :py:" -"mod:`!ast` Python module, which exports these constants under the same names." -msgstr "" - -#: ../../c-api/veryhigh.rst:366 +#: ../../c-api/veryhigh.rst:421 msgid "" "This bit can be set in *flags* to cause division operator ``/`` to be " "interpreted as \"true division\" according to :pep:`238`." msgstr "" "このビットを *flags* にセットすると、除算演算子 ``/`` は :pep:`238` による" "「真の除算 (true division)」として扱われます。" - -#: ../../c-api/veryhigh.rst:301 ../../c-api/veryhigh.rst:309 -#: ../../c-api/veryhigh.rst:318 -msgid "Py_CompileString (C function)" -msgstr "" diff --git a/c-api/weakref.po b/c-api/weakref.po index 45ebd56d2..848aa64c1 100644 --- a/c-api/weakref.po +++ b/c-api/weakref.po @@ -1,25 +1,26 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 +# Arihiro TAKASE, 2017 +# tomo, 2019 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:50+0000\n" -"Last-Translator: tomo, 2021\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-07 05:06+0000\n" +"PO-Revision-Date: 2017-02-16 17:40+0000\n" +"Last-Translator: tomo, 2019\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../c-api/weakref.rst:6 @@ -40,19 +41,17 @@ msgstr "" #: ../../c-api/weakref.rst:16 msgid "" -"Return non-zero if *ob* is either a reference or proxy object. This " -"function always succeeds." +"Return true if *ob* is either a reference or proxy object. This function " +"always succeeds." msgstr "" #: ../../c-api/weakref.rst:22 msgid "" -"Return non-zero if *ob* is a reference object. This function always " -"succeeds." +"Return true if *ob* is a reference object. This function always succeeds." msgstr "" #: ../../c-api/weakref.rst:27 -msgid "" -"Return non-zero if *ob* is a proxy object. This function always succeeds." +msgid "Return true if *ob* is a proxy object. This function always succeeds." msgstr "" #: ../../c-api/weakref.rst:32 @@ -63,9 +62,17 @@ msgid "" "a callable object that receives notification when *ob* is garbage collected; " "it should accept a single parameter, which will be the weak reference object " "itself. *callback* may also be ``None`` or ``NULL``. If *ob* is not a " -"weakly referenceable object, or if *callback* is not callable, ``None``, or " +"weakly-referencable object, or if *callback* is not callable, ``None``, or " "``NULL``, this will return ``NULL`` and raise :exc:`TypeError`." msgstr "" +"*ob* に対する弱参照オブジェクトを返します。この関数は常に新たな参照を返します" +"が、必ずしも新たなオブジェクトを作る保証はありません; 既存の参照オブジェクト" +"が返されることもあります。第二のパラメタ *callback* は呼び出し可能オブジェク" +"トで、 *ob* がガーベジコレクションされた際に通知を受け取ります; *callback* は" +"弱参照オブジェクト自体を単一のパラメタとして受け取ります。 *callback* は " +"``None`` や ``NULL`` にしてもかまいません。 *ob* が弱参照できないオブジェクト" +"の場合や、 *callback* が呼び出し可能オブジェクト、 ``None`` 、 ``NULL`` のい" +"ずれでもない場合は、 ``NULL`` を返して :exc:`TypeError` を送出します。" #: ../../c-api/weakref.rst:44 msgid "" @@ -75,87 +82,42 @@ msgid "" "can be a callable object that receives notification when *ob* is garbage " "collected; it should accept a single parameter, which will be the weak " "reference object itself. *callback* may also be ``None`` or ``NULL``. If " -"*ob* is not a weakly referenceable object, or if *callback* is not callable, " +"*ob* is not a weakly-referencable object, or if *callback* is not callable, " "``None``, or ``NULL``, this will return ``NULL`` and raise :exc:`TypeError`." msgstr "" +"*ob* に対する弱参照プロキシオブジェクトを返します。\n" +"この関数は常に新たな参照を返しますが、必ずしも新たなオブジェクトを作る保証は" +"ありません。既存のプロキシオブジェクトが返されることもあります。第二のパラメ" +"タ *callback* は呼び出し可能オブジェクトで、 *ob* がガーベジコレクションされ" +"た際に通知を受け取ります。 *callback* は弱参照オブジェクト自体を単一のパラメ" +"タとして受け取ります。\n" +"*callback* は ``None`` や ``NULL`` にしてもかまいません。\n" +"*ob* が弱参照できないオブジェクトの場合や、 *callback* が呼び出し可能オブジェ" +"クト、 ``None`` 、 ``NULL`` のいずれでもない場合は、 ``NULL`` を返して :exc:" +"`TypeError` を送出します。" #: ../../c-api/weakref.rst:56 msgid "" -"Get a :term:`strong reference` to the referenced object from a weak " -"reference, *ref*, into *\\*pobj*." -msgstr "" - -#: ../../c-api/weakref.rst:59 -msgid "" -"On success, set *\\*pobj* to a new :term:`strong reference` to the " -"referenced object and return 1." +"Return the referenced object from a weak reference, *ref*. If the referent " +"is no longer live, returns :const:`Py_None`." msgstr "" +"弱参照 *ref* が参照しているオブジェクトを返します。被参照オブジェクトがすでに" +"存続していない場合、 :const:`Py_None` を返します。" #: ../../c-api/weakref.rst:61 -msgid "If the reference is dead, set *\\*pobj* to ``NULL`` and return 0." -msgstr "" - -#: ../../c-api/weakref.rst:62 -msgid "On error, raise an exception and return -1." -msgstr "" - -#: ../../c-api/weakref.rst:69 -msgid "" -"Return a :term:`borrowed reference` to the referenced object from a weak " -"reference, *ref*. If the referent is no longer live, returns ``Py_None``." -msgstr "" - -#: ../../c-api/weakref.rst:74 msgid "" -"This function returns a :term:`borrowed reference` to the referenced object. " +"This function returns a **borrowed reference** to the referenced object. " "This means that you should always call :c:func:`Py_INCREF` on the object " -"except when it cannot be destroyed before the last usage of the borrowed " -"reference." -msgstr "" - -#: ../../c-api/weakref.rst:79 ../../c-api/weakref.rst:87 -msgid "Use :c:func:`PyWeakref_GetRef` instead." +"except if you know that it cannot be destroyed while you are still using it." msgstr "" +"この関数は参照先オブジェクトの **借り物の参照** を返します。そのため、そのオ" +"ブジェクトを利用している間そのオブジェクトが破棄されないことが判っている場合" +"を除き、常に :c:func:`Py_INCREF` を呼び出すべきです。" -#: ../../c-api/weakref.rst:85 -msgid "Similar to :c:func:`PyWeakref_GetObject`, but does no error checking." -msgstr "" - -#: ../../c-api/weakref.rst:93 -msgid "" -"Test if the weak reference *ref* is dead. Returns 1 if the reference is " -"dead, 0 if it is alive, and -1 with an error set if *ref* is not a weak " -"reference object." -msgstr "" - -#: ../../c-api/weakref.rst:102 -msgid "" -"This function is called by the :c:member:`~PyTypeObject.tp_dealloc` handler " -"to clear weak references." -msgstr "" - -#: ../../c-api/weakref.rst:105 -msgid "" -"This iterates through the weak references for *object* and calls callbacks " -"for those references which have one. It returns when all callbacks have been " -"attempted." -msgstr "" - -#: ../../c-api/weakref.rst:112 -msgid "Clears the weakrefs for *object* without calling the callbacks." -msgstr "" - -#: ../../c-api/weakref.rst:114 -msgid "" -"This function is called by the :c:member:`~PyTypeObject.tp_dealloc` handler " -"for types with finalizers (i.e., :meth:`~object.__del__`). The handler for " -"those objects first calls :c:func:`PyObject_ClearWeakRefs` to clear weakrefs " -"and call their callbacks, then the finalizer, and finally this function to " -"clear any weakrefs that may have been created by the finalizer." -msgstr "" - -#: ../../c-api/weakref.rst:120 +#: ../../c-api/weakref.rst:69 msgid "" -"In most circumstances, it's more appropriate to use :c:func:" -"`PyObject_ClearWeakRefs` to clear weakrefs instead of this function." +"Similar to :c:func:`PyWeakref_GetObject`, but implemented as a macro that " +"does no error checking." msgstr "" +":c:func:`PyWeakref_GetObject` に似ていますが、マクロで実装されていて、エラー" +"チェックを行いません。" diff --git a/contents.po b/contents.po index ca490392e..9346c0e0b 100644 --- a/contents.po +++ b/contents.po @@ -1,21 +1,20 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. -# +# # Translators: -# tomo, 2021 -# +# Arihiro TAKASE, 2017 +# #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-30 14:22+0000\n" -"PO-Revision-Date: 2021-06-28 00:47+0000\n" -"Last-Translator: tomo, 2021\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" -"ja/)\n" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 17:32+0000\n" +"Last-Translator: Arihiro TAKASE, 2017\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/ja/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" diff --git a/copyright.po b/copyright.po index 826a08086..78ee043e9 100644 --- a/copyright.po +++ b/copyright.po @@ -1,21 +1,21 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. -# +# # Translators: -# tomo, 2021 -# +# Arihiro TAKASE, 2017 +# Tetsuo Koyama , 2021 +# #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:47+0000\n" -"Last-Translator: tomo, 2021\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" -"ja/)\n" +"POT-Creation-Date: 2021-01-02 05:03+0000\n" +"PO-Revision-Date: 2017-02-16 17:32+0000\n" +"Last-Translator: Tetsuo Koyama , 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/ja/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -31,8 +31,9 @@ msgid "Python and this documentation is:" msgstr "Python and this documentation is:" #: ../../copyright.rst:7 -msgid "Copyright © 2001 Python Software Foundation. All rights reserved." +msgid "Copyright © 2001-2021 Python Software Foundation. All rights reserved." msgstr "" +"Copyright © 2001-2021 Python Software Foundation. All rights reserved." #: ../../copyright.rst:9 msgid "Copyright © 2000 BeOpen.com. All rights reserved." @@ -56,6 +57,4 @@ msgstr "" msgid "" "See :ref:`history-and-license` for complete license and permissions " "information." -msgstr "" -"ライセンスおよび許諾に関する完全な情報は、 :ref:`history-and-license` を参照" -"してください。" +msgstr "ライセンスおよび許諾に関する完全な情報は、 :ref:`history-and-license` を参照してください。" diff --git a/deprecations/c-api-pending-removal-in-3.14.po b/deprecations/c-api-pending-removal-in-3.14.po deleted file mode 100644 index 1ac857ae1..000000000 --- a/deprecations/c-api-pending-removal-in-3.14.po +++ /dev/null @@ -1,35 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 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.14\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-13 14:21+0000\n" -"PO-Revision-Date: 2024-08-02 14:17+0000\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" -"ja/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:2 -msgid "Pending removal in Python 3.14" -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:4 -msgid "" -"The ``ma_version_tag`` field in :c:type:`PyDictObject` for extension modules " -"(:pep:`699`; :gh:`101193`)." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.14.rst:7 -msgid "" -"Creating :c:data:`immutable types ` with mutable " -"bases (:gh:`95388`)." -msgstr "" diff --git a/deprecations/c-api-pending-removal-in-3.15.po b/deprecations/c-api-pending-removal-in-3.15.po deleted file mode 100644 index 86cbdc36f..000000000 --- a/deprecations/c-api-pending-removal-in-3.15.po +++ /dev/null @@ -1,295 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 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.14\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-13 14:21+0000\n" -"PO-Revision-Date: 2024-08-02 14:17+0000\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" -"ja/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:2 -msgid "Pending removal in Python 3.15" -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:4 -msgid "The bundled copy of ``libmpdecimal``." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:5 -msgid "" -"The :c:func:`PyImport_ImportModuleNoBlock`: Use :c:func:" -"`PyImport_ImportModule` instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:7 -msgid "" -":c:func:`PyWeakref_GetObject` and :c:func:`PyWeakref_GET_OBJECT`: Use :c:" -"func:`PyWeakref_GetRef` instead. The `pythoncapi-compat project `__ can be used to get :c:func:" -"`PyWeakref_GetRef` on Python 3.12 and older." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:11 -msgid "" -":c:type:`Py_UNICODE` type and the :c:macro:`!Py_UNICODE_WIDE` macro: Use :c:" -"type:`wchar_t` instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:13 -msgid "" -":c:func:`!PyUnicode_AsDecodedObject`: Use :c:func:`PyCodec_Decode` instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:15 -msgid "" -":c:func:`!PyUnicode_AsDecodedUnicode`: Use :c:func:`PyCodec_Decode` instead; " -"Note that some codecs (for example, \"base64\") may return a type other " -"than :class:`str`, such as :class:`bytes`." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:18 -msgid "" -":c:func:`!PyUnicode_AsEncodedObject`: Use :c:func:`PyCodec_Encode` instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:20 -msgid "" -":c:func:`!PyUnicode_AsEncodedUnicode`: Use :c:func:`PyCodec_Encode` instead; " -"Note that some codecs (for example, \"base64\") may return a type other " -"than :class:`bytes`, such as :class:`str`." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:23 -msgid "Python initialization functions, deprecated in Python 3.13:" -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:25 -msgid "" -":c:func:`Py_GetPath`: Use :c:func:`PyConfig_Get(\"module_search_paths\") " -"` (:data:`sys.path`) instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:28 -msgid "" -":c:func:`Py_GetPrefix`: Use :c:func:`PyConfig_Get(\"base_prefix\") " -"` (:data:`sys.base_prefix`) instead. Use :c:func:" -"`PyConfig_Get(\"prefix\") ` (:data:`sys.prefix`) if :ref:" -"`virtual environments ` need to be handled." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:33 -msgid "" -":c:func:`Py_GetExecPrefix`: Use :c:func:`PyConfig_Get(\"base_exec_prefix\") " -"` (:data:`sys.base_exec_prefix`) instead. Use :c:func:" -"`PyConfig_Get(\"exec_prefix\") ` (:data:`sys.exec_prefix`) if :" -"ref:`virtual environments ` need to be handled." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:39 -msgid "" -":c:func:`Py_GetProgramFullPath`: Use :c:func:`PyConfig_Get(\"executable\") " -"` (:data:`sys.executable`) instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:42 -msgid "" -":c:func:`Py_GetProgramName`: Use :c:func:`PyConfig_Get(\"executable\") " -"` (:data:`sys.executable`) instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:45 -msgid "" -":c:func:`Py_GetPythonHome`: Use :c:func:`PyConfig_Get(\"home\") " -"` or the :envvar:`PYTHONHOME` environment variable instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:49 -msgid "" -"The `pythoncapi-compat project `__ can be used to get :c:func:`PyConfig_Get` on Python 3.13 and older." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:53 -msgid "" -"Functions to configure Python's initialization, deprecated in Python 3.11:" -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:55 -msgid ":c:func:`!PySys_SetArgvEx()`: Set :c:member:`PyConfig.argv` instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:57 -msgid ":c:func:`!PySys_SetArgv()`: Set :c:member:`PyConfig.argv` instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:59 -msgid "" -":c:func:`!Py_SetProgramName()`: Set :c:member:`PyConfig.program_name` " -"instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:61 -msgid ":c:func:`!Py_SetPythonHome()`: Set :c:member:`PyConfig.home` instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:63 -msgid "" -":c:func:`PySys_ResetWarnOptions`: Clear :data:`sys.warnoptions` and :data:`!" -"warnings.filters` instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:66 -msgid "" -"The :c:func:`Py_InitializeFromConfig` API should be used with :c:type:" -"`PyConfig` instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:69 -msgid "Global configuration variables:" -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:71 -msgid "" -":c:var:`Py_DebugFlag`: Use :c:member:`PyConfig.parser_debug` or :c:func:" -"`PyConfig_Get(\"parser_debug\") ` instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:74 -msgid "" -":c:var:`Py_VerboseFlag`: Use :c:member:`PyConfig.verbose` or :c:func:" -"`PyConfig_Get(\"verbose\") ` instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:77 -msgid "" -":c:var:`Py_QuietFlag`: Use :c:member:`PyConfig.quiet` or :c:func:" -"`PyConfig_Get(\"quiet\") ` instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:80 -msgid "" -":c:var:`Py_InteractiveFlag`: Use :c:member:`PyConfig.interactive` or :c:func:" -"`PyConfig_Get(\"interactive\") ` instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:83 -msgid "" -":c:var:`Py_InspectFlag`: Use :c:member:`PyConfig.inspect` or :c:func:" -"`PyConfig_Get(\"inspect\") ` instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:86 -msgid "" -":c:var:`Py_OptimizeFlag`: Use :c:member:`PyConfig.optimization_level` or :c:" -"func:`PyConfig_Get(\"optimization_level\") ` instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:89 -msgid "" -":c:var:`Py_NoSiteFlag`: Use :c:member:`PyConfig.site_import` or :c:func:" -"`PyConfig_Get(\"site_import\") ` instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:92 -msgid "" -":c:var:`Py_BytesWarningFlag`: Use :c:member:`PyConfig.bytes_warning` or :c:" -"func:`PyConfig_Get(\"bytes_warning\") ` instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:95 -msgid "" -":c:var:`Py_FrozenFlag`: Use :c:member:`PyConfig.pathconfig_warnings` or :c:" -"func:`PyConfig_Get(\"pathconfig_warnings\") ` instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:98 -msgid "" -":c:var:`Py_IgnoreEnvironmentFlag`: Use :c:member:`PyConfig.use_environment` " -"or :c:func:`PyConfig_Get(\"use_environment\") ` instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:101 -msgid "" -":c:var:`Py_DontWriteBytecodeFlag`: Use :c:member:`PyConfig.write_bytecode` " -"or :c:func:`PyConfig_Get(\"write_bytecode\") ` instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:104 -msgid "" -":c:var:`Py_NoUserSiteDirectory`: Use :c:member:`PyConfig." -"user_site_directory` or :c:func:`PyConfig_Get(\"user_site_directory\") " -"` instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:107 -msgid "" -":c:var:`Py_UnbufferedStdioFlag`: Use :c:member:`PyConfig.buffered_stdio` or :" -"c:func:`PyConfig_Get(\"buffered_stdio\") ` instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:110 -msgid "" -":c:var:`Py_HashRandomizationFlag`: Use :c:member:`PyConfig.use_hash_seed` " -"and :c:member:`PyConfig.hash_seed` or :c:func:`PyConfig_Get(\"hash_seed\") " -"` instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:114 -msgid "" -":c:var:`Py_IsolatedFlag`: Use :c:member:`PyConfig.isolated` or :c:func:" -"`PyConfig_Get(\"isolated\") ` instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:117 -msgid "" -":c:var:`Py_LegacyWindowsFSEncodingFlag`: Use :c:member:`PyPreConfig." -"legacy_windows_fs_encoding` or :c:func:" -"`PyConfig_Get(\"legacy_windows_fs_encoding\") ` instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:120 -msgid "" -":c:var:`Py_LegacyWindowsStdioFlag`: Use :c:member:`PyConfig." -"legacy_windows_stdio` or :c:func:`PyConfig_Get(\"legacy_windows_stdio\") " -"` instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:123 -msgid "" -":c:var:`!Py_FileSystemDefaultEncoding`, :c:var:`!" -"Py_HasFileSystemDefaultEncoding`: Use :c:member:`PyConfig." -"filesystem_encoding` or :c:func:`PyConfig_Get(\"filesystem_encoding\") " -"` instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:126 -msgid "" -":c:var:`!Py_FileSystemDefaultEncodeErrors`: Use :c:member:`PyConfig." -"filesystem_errors` or :c:func:`PyConfig_Get(\"filesystem_errors\") " -"` instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:129 -msgid "" -":c:var:`!Py_UTF8Mode`: Use :c:member:`PyPreConfig.utf8_mode` or :c:func:" -"`PyConfig_Get(\"utf8_mode\") ` instead. (see :c:func:" -"`Py_PreInitialize`)" -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:134 -msgid "" -"The :c:func:`Py_InitializeFromConfig` API should be used with :c:type:" -"`PyConfig` to set these options. Or :c:func:`PyConfig_Get` can be used to " -"get these options at runtime." -msgstr "" diff --git a/deprecations/c-api-pending-removal-in-3.18.po b/deprecations/c-api-pending-removal-in-3.18.po deleted file mode 100644 index 47e1a7866..000000000 --- a/deprecations/c-api-pending-removal-in-3.18.po +++ /dev/null @@ -1,139 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 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.14\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-13 14:21+0000\n" -"PO-Revision-Date: 2025-05-08 06:04+0000\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" -"ja/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:2 -msgid "Pending removal in Python 3.18" -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:4 -msgid "Deprecated private functions (:gh:`128863`):" -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:6 -msgid ":c:func:`!_PyBytes_Join`: use :c:func:`PyBytes_Join`." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:7 -msgid "" -":c:func:`!_PyDict_GetItemStringWithError`: use :c:func:" -"`PyDict_GetItemStringRef`." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:8 -msgid ":c:func:`!_PyDict_Pop()`: :c:func:`PyDict_Pop`." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:9 -msgid ":c:func:`!_PyLong_Sign()`: use :c:func:`PyLong_GetSign`." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:10 -msgid "" -":c:func:`!_PyLong_FromDigits` and :c:func:`!_PyLong_New`: use :c:func:" -"`PyLongWriter_Create`." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:12 -msgid "" -":c:func:`!_PyThreadState_UncheckedGet`: use :c:func:" -"`PyThreadState_GetUnchecked`." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:13 -msgid ":c:func:`!_PyUnicode_AsString`: use :c:func:`PyUnicode_AsUTF8`." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:14 -msgid "" -":c:func:`!_PyUnicodeWriter_Init`: replace ``_PyUnicodeWriter_Init(&writer)`` " -"with :c:func:`writer = PyUnicodeWriter_Create(0) `." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:17 -msgid "" -":c:func:`!_PyUnicodeWriter_Finish`: replace " -"``_PyUnicodeWriter_Finish(&writer)`` with :c:func:" -"`PyUnicodeWriter_Finish(writer) `." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:20 -msgid "" -":c:func:`!_PyUnicodeWriter_Dealloc`: replace " -"``_PyUnicodeWriter_Dealloc(&writer)`` with :c:func:" -"`PyUnicodeWriter_Discard(writer) `." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:23 -msgid "" -":c:func:`!_PyUnicodeWriter_WriteChar`: replace " -"``_PyUnicodeWriter_WriteChar(&writer, ch)`` with :c:func:" -"`PyUnicodeWriter_WriteChar(writer, ch) `." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:26 -msgid "" -":c:func:`!_PyUnicodeWriter_WriteStr`: replace " -"``_PyUnicodeWriter_WriteStr(&writer, str)`` with :c:func:" -"`PyUnicodeWriter_WriteStr(writer, str) `." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:29 -msgid "" -":c:func:`!_PyUnicodeWriter_WriteSubstring`: replace " -"``_PyUnicodeWriter_WriteSubstring(&writer, str, start, end)`` with :c:func:" -"`PyUnicodeWriter_WriteSubstring(writer, str, start, end) " -"`." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:32 -msgid "" -":c:func:`!_PyUnicodeWriter_WriteASCIIString`: replace " -"``_PyUnicodeWriter_WriteASCIIString(&writer, str)`` with :c:func:" -"`PyUnicodeWriter_WriteUTF8(writer, str) `." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:35 -msgid "" -":c:func:`!_PyUnicodeWriter_WriteLatin1String`: replace " -"``_PyUnicodeWriter_WriteLatin1String(&writer, str)`` with :c:func:" -"`PyUnicodeWriter_WriteUTF8(writer, str) `." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:38 -msgid ":c:func:`!_PyUnicodeWriter_Prepare`: (no replacement)." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:39 -msgid ":c:func:`!_PyUnicodeWriter_PrepareKind`: (no replacement)." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:40 -msgid ":c:func:`!_Py_HashPointer`: use :c:func:`Py_HashPointer`." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:41 -msgid ":c:func:`!_Py_fopen_obj`: use :c:func:`Py_fopen`." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:43 -msgid "" -"The `pythoncapi-compat project `__ can be used to get these new public functions on Python 3.13 and older." -msgstr "" diff --git a/deprecations/c-api-pending-removal-in-future.po b/deprecations/c-api-pending-removal-in-future.po deleted file mode 100644 index 4cd53d6ec..000000000 --- a/deprecations/c-api-pending-removal-in-future.po +++ /dev/null @@ -1,117 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 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.14\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-13 14:21+0000\n" -"PO-Revision-Date: 2024-08-02 14:17+0000\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" -"ja/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#: ../../deprecations/c-api-pending-removal-in-future.rst:2 -msgid "Pending removal in future versions" -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-future.rst:4 -msgid "" -"The following APIs are deprecated and will be removed, although there is " -"currently no date scheduled for their removal." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-future.rst:7 -msgid ":c:macro:`Py_TPFLAGS_HAVE_FINALIZE`: Unneeded since Python 3.8." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-future.rst:9 -msgid ":c:func:`PyErr_Fetch`: Use :c:func:`PyErr_GetRaisedException` instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-future.rst:11 -msgid "" -":c:func:`PyErr_NormalizeException`: Use :c:func:`PyErr_GetRaisedException` " -"instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-future.rst:13 -msgid "" -":c:func:`PyErr_Restore`: Use :c:func:`PyErr_SetRaisedException` instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-future.rst:15 -msgid "" -":c:func:`PyModule_GetFilename`: Use :c:func:`PyModule_GetFilenameObject` " -"instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-future.rst:17 -msgid ":c:func:`PyOS_AfterFork`: Use :c:func:`PyOS_AfterFork_Child` instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-future.rst:19 -msgid "" -":c:func:`PySlice_GetIndicesEx`: Use :c:func:`PySlice_Unpack` and :c:func:" -"`PySlice_AdjustIndices` instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-future.rst:21 -msgid ":c:func:`PyUnicode_READY`: Unneeded since Python 3.12" -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-future.rst:23 -msgid ":c:func:`!PyErr_Display`: Use :c:func:`PyErr_DisplayException` instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-future.rst:25 -msgid "" -":c:func:`!_PyErr_ChainExceptions`: Use :c:func:`!_PyErr_ChainExceptions1` " -"instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-future.rst:27 -msgid "" -":c:member:`!PyBytesObject.ob_shash` member: call :c:func:`PyObject_Hash` " -"instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-future.rst:29 -msgid "Thread Local Storage (TLS) API:" -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-future.rst:31 -msgid "" -":c:func:`PyThread_create_key`: Use :c:func:`PyThread_tss_alloc` instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-future.rst:33 -msgid ":c:func:`PyThread_delete_key`: Use :c:func:`PyThread_tss_free` instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-future.rst:35 -msgid "" -":c:func:`PyThread_set_key_value`: Use :c:func:`PyThread_tss_set` instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-future.rst:37 -msgid "" -":c:func:`PyThread_get_key_value`: Use :c:func:`PyThread_tss_get` instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-future.rst:39 -msgid "" -":c:func:`PyThread_delete_key_value`: Use :c:func:`PyThread_tss_delete` " -"instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-future.rst:41 -msgid ":c:func:`PyThread_ReInitTLS`: Unneeded since Python 3.7." -msgstr "" diff --git a/deprecations/index.po b/deprecations/index.po deleted file mode 100644 index 086305486..000000000 --- a/deprecations/index.po +++ /dev/null @@ -1,1272 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation -# This file is distributed under the same license as the Python package. -# FIRST AUTHOR , YEAR. -# -# Translators: -# TENMYO Masakazu, 2024 -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: Python 3.14\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-13 14:21+0000\n" -"PO-Revision-Date: 2024-07-29 04:07+0000\n" -"Last-Translator: TENMYO Masakazu, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" -"ja/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#: ../../deprecations/index.rst:2 -msgid "Deprecations" -msgstr "非推奨" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:2 -#: ../../deprecations/pending-removal-in-3.15.rst:2 -msgid "Pending removal in Python 3.15" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.15.rst:4 -#: ../../deprecations/pending-removal-in-3.16.rst:4 -msgid "The import system:" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.15.rst:6 -msgid "" -"Setting :attr:`~module.__cached__` on a module while failing to set :attr:" -"`__spec__.cached ` is deprecated. In " -"Python 3.15, :attr:`!__cached__` will cease to be set or take into " -"consideration by the import system or standard library. (:gh:`97879`)" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.15.rst:11 -msgid "" -"Setting :attr:`~module.__package__` on a module while failing to set :attr:" -"`__spec__.parent ` is deprecated. In " -"Python 3.15, :attr:`!__package__` will cease to be set or take into " -"consideration by the import system or standard library. (:gh:`97879`)" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.15.rst:16 -#: ../../deprecations/pending-removal-in-3.19.rst:4 -msgid ":mod:`ctypes`:" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.15.rst:18 -msgid "" -"The undocumented :func:`!ctypes.SetPointerType` function has been deprecated " -"since Python 3.13." -msgstr "" - -#: ../../deprecations/pending-removal-in-3.15.rst:21 -msgid ":mod:`http.server`:" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.15.rst:23 -msgid "" -"The obsolete and rarely used :class:`~http.server.CGIHTTPRequestHandler` has " -"been deprecated since Python 3.13. No direct replacement exists. *Anything* " -"is better than CGI to interface a web server with a request handler." -msgstr "" - -#: ../../deprecations/pending-removal-in-3.15.rst:29 -msgid "" -"The :option:`!--cgi` flag to the :program:`python -m http.server` command-" -"line interface has been deprecated since Python 3.13." -msgstr "" - -#: ../../deprecations/pending-removal-in-3.15.rst:32 -#: ../../deprecations/pending-removal-in-future.rst:64 -msgid ":mod:`importlib`:" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.15.rst:34 -msgid "``load_module()`` method: use ``exec_module()`` instead." -msgstr "" - -#: ../../deprecations/pending-removal-in-3.15.rst:36 -msgid ":class:`locale`:" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.15.rst:38 -msgid "" -"The :func:`~locale.getdefaultlocale` function has been deprecated since " -"Python 3.11. Its removal was originally planned for Python 3.13 (:gh:" -"`90817`), but has been postponed to Python 3.15. Use :func:`~locale." -"getlocale`, :func:`~locale.setlocale`, and :func:`~locale.getencoding` " -"instead. (Contributed by Hugo van Kemenade in :gh:`111187`.)" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.15.rst:46 -msgid ":mod:`pathlib`:" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.15.rst:48 -msgid "" -":meth:`.PurePath.is_reserved` has been deprecated since Python 3.13. Use :" -"func:`os.path.isreserved` to detect reserved paths on Windows." -msgstr "" - -#: ../../deprecations/pending-removal-in-3.15.rst:52 -msgid ":mod:`platform`:" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.15.rst:54 -msgid "" -":func:`~platform.java_ver` has been deprecated since Python 3.13. This " -"function is only useful for Jython support, has a confusing API, and is " -"largely untested." -msgstr "" - -#: ../../deprecations/pending-removal-in-3.15.rst:58 -#: ../../deprecations/pending-removal-in-3.16.rst:96 -msgid ":mod:`sysconfig`:" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.15.rst:60 -msgid "" -"The *check_home* argument of :func:`sysconfig.is_python_build` has been " -"deprecated since Python 3.12." -msgstr "" - -#: ../../deprecations/pending-removal-in-3.15.rst:63 -msgid ":mod:`threading`:" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.15.rst:65 -msgid "" -":func:`~threading.RLock` will take no arguments in Python 3.15. Passing any " -"arguments has been deprecated since Python 3.14, as the Python version does " -"not permit any arguments, but the C version allows any number of positional " -"or keyword arguments, ignoring every argument." -msgstr "" - -#: ../../deprecations/pending-removal-in-3.15.rst:71 -msgid ":mod:`types`:" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.15.rst:73 -msgid "" -":class:`types.CodeType`: Accessing :attr:`~codeobject.co_lnotab` was " -"deprecated in :pep:`626` since 3.10 and was planned to be removed in 3.12, " -"but it only got a proper :exc:`DeprecationWarning` in 3.12. May be removed " -"in 3.15. (Contributed by Nikita Sobolev in :gh:`101866`.)" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.15.rst:80 -#: ../../deprecations/pending-removal-in-3.17.rst:4 -msgid ":mod:`typing`:" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.15.rst:82 -msgid "" -"The undocumented keyword argument syntax for creating :class:`~typing." -"NamedTuple` classes (for example, ``Point = NamedTuple(\"Point\", x=int, " -"y=int)``) has been deprecated since Python 3.13. Use the class-based syntax " -"or the functional syntax instead." -msgstr "" - -#: ../../deprecations/pending-removal-in-3.15.rst:88 -msgid "" -"When using the functional syntax of :class:`~typing.TypedDict`\\s, failing " -"to pass a value to the *fields* parameter (``TD = TypedDict(\"TD\")``) or " -"passing ``None`` (``TD = TypedDict(\"TD\", None)``) has been deprecated " -"since Python 3.13. Use ``class TD(TypedDict): pass`` or ``TD = " -"TypedDict(\"TD\", {})`` to create a TypedDict with zero field." -msgstr "" - -#: ../../deprecations/pending-removal-in-3.15.rst:95 -msgid "" -"The :func:`typing.no_type_check_decorator` decorator function has been " -"deprecated since Python 3.13. After eight years in the :mod:`typing` module, " -"it has yet to be supported by any major type checker." -msgstr "" - -#: ../../deprecations/pending-removal-in-3.15.rst:100 -msgid ":mod:`wave`:" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.15.rst:102 -msgid "" -"The :meth:`~wave.Wave_read.getmark`, :meth:`!setmark`, and :meth:`~wave." -"Wave_read.getmarkers` methods of the :class:`~wave.Wave_read` and :class:" -"`~wave.Wave_write` classes have been deprecated since Python 3.13." -msgstr "" - -#: ../../deprecations/pending-removal-in-3.15.rst:107 -msgid ":mod:`zipimport`:" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.15.rst:109 -msgid "" -":meth:`~zipimport.zipimporter.load_module` has been deprecated since Python " -"3.10. Use :meth:`~zipimport.zipimporter.exec_module` instead. (Contributed " -"by Jiahao Li in :gh:`125746`.)" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.16.rst:2 -msgid "Pending removal in Python 3.16" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.16.rst:6 -msgid "" -"Setting :attr:`~module.__loader__` on a module while failing to set :attr:" -"`__spec__.loader ` is deprecated. In " -"Python 3.16, :attr:`!__loader__` will cease to be set or taken into " -"consideration by the import system or the standard library." -msgstr "" - -#: ../../deprecations/pending-removal-in-3.16.rst:11 -msgid ":mod:`array`:" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.16.rst:13 -msgid "" -"The ``'u'`` format code (:c:type:`wchar_t`) has been deprecated in " -"documentation since Python 3.3 and at runtime since Python 3.13. Use the " -"``'w'`` format code (:c:type:`Py_UCS4`) for Unicode characters instead." -msgstr "" - -#: ../../deprecations/pending-removal-in-3.16.rst:19 -msgid ":mod:`asyncio`:" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.16.rst:21 -msgid "" -":func:`!asyncio.iscoroutinefunction` is deprecated and will be removed in " -"Python 3.16; use :func:`inspect.iscoroutinefunction` instead. (Contributed " -"by Jiahao Li and Kumar Aditya in :gh:`122875`.)" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.16.rst:26 -msgid "" -":mod:`asyncio` policy system is deprecated and will be removed in Python " -"3.16. In particular, the following classes and functions are deprecated:" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.16.rst:29 -msgid ":class:`asyncio.AbstractEventLoopPolicy`" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.16.rst:30 -msgid ":class:`asyncio.DefaultEventLoopPolicy`" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.16.rst:31 -msgid ":class:`asyncio.WindowsSelectorEventLoopPolicy`" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.16.rst:32 -msgid ":class:`asyncio.WindowsProactorEventLoopPolicy`" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.16.rst:33 -msgid ":func:`asyncio.get_event_loop_policy`" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.16.rst:34 -msgid ":func:`asyncio.set_event_loop_policy`" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.16.rst:36 -msgid "" -"Users should use :func:`asyncio.run` or :class:`asyncio.Runner` with " -"*loop_factory* to use the desired event loop implementation." -msgstr "" - -#: ../../deprecations/pending-removal-in-3.16.rst:39 -msgid "For example, to use :class:`asyncio.SelectorEventLoop` on Windows::" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.16.rst:41 -msgid "" -"import asyncio\n" -"\n" -"async def main():\n" -" ...\n" -"\n" -"asyncio.run(main(), loop_factory=asyncio.SelectorEventLoop)" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.16.rst:48 -msgid "(Contributed by Kumar Aditya in :gh:`127949`.)" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.16.rst:50 -#: ../../deprecations/pending-removal-in-future.rst:16 -msgid ":mod:`builtins`:" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.16.rst:52 -msgid "" -"Bitwise inversion on boolean types, ``~True`` or ``~False`` has been " -"deprecated since Python 3.12, as it produces surprising and unintuitive " -"results (``-2`` and ``-1``). Use ``not x`` instead for the logical negation " -"of a Boolean. In the rare case that you need the bitwise inversion of the " -"underlying integer, convert to ``int`` explicitly (``~int(x)``)." -msgstr "" - -#: ../../deprecations/pending-removal-in-3.16.rst:59 -msgid ":mod:`functools`:" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.16.rst:61 -msgid "" -"Calling the Python implementation of :func:`functools.reduce` with " -"*function* or *sequence* as keyword arguments has been deprecated since " -"Python 3.14." -msgstr "" - -#: ../../deprecations/pending-removal-in-3.16.rst:64 -msgid ":mod:`logging`:" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.16.rst:66 -msgid "" -"Support for custom logging handlers with the *strm* argument is deprecated " -"and scheduled for removal in Python 3.16. Define handlers with the *stream* " -"argument instead. (Contributed by Mariusz Felisiak in :gh:`115032`.)" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.16.rst:70 -msgid ":mod:`mimetypes`:" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.16.rst:72 -msgid "" -"Valid extensions start with a '.' or are empty for :meth:`mimetypes." -"MimeTypes.add_type`. Undotted extensions are deprecated and will raise a :" -"exc:`ValueError` in Python 3.16. (Contributed by Hugo van Kemenade in :gh:" -"`75223`.)" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.16.rst:78 -msgid ":mod:`shutil`:" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.16.rst:80 -msgid "" -"The :class:`!ExecError` exception has been deprecated since Python 3.14. It " -"has not been used by any function in :mod:`!shutil` since Python 3.4, and is " -"now an alias of :exc:`RuntimeError`." -msgstr "" - -#: ../../deprecations/pending-removal-in-3.16.rst:85 -msgid ":mod:`symtable`:" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.16.rst:87 -msgid "" -"The :meth:`Class.get_methods ` method has been " -"deprecated since Python 3.14." -msgstr "" - -#: ../../deprecations/pending-removal-in-3.16.rst:90 -msgid ":mod:`sys`:" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.16.rst:92 -msgid "" -"The :func:`~sys._enablelegacywindowsfsencoding` function has been deprecated " -"since Python 3.13. Use the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` " -"environment variable instead." -msgstr "" - -#: ../../deprecations/pending-removal-in-3.16.rst:98 -msgid "" -"The :func:`!sysconfig.expand_makefile_vars` function has been deprecated " -"since Python 3.14. Use the ``vars`` argument of :func:`sysconfig.get_paths` " -"instead." -msgstr "" - -#: ../../deprecations/pending-removal-in-3.16.rst:102 -msgid ":mod:`tarfile`:" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.16.rst:104 -msgid "" -"The undocumented and unused :attr:`!TarFile.tarfile` attribute has been " -"deprecated since Python 3.13." -msgstr "" - -#: ../../deprecations/pending-removal-in-3.17.rst:2 -msgid "Pending removal in Python 3.17" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.17.rst:6 -msgid "" -"Before Python 3.14, old-style unions were implemented using the private " -"class ``typing._UnionGenericAlias``. This class is no longer needed for the " -"implementation, but it has been retained for backward compatibility, with " -"removal scheduled for Python 3.17. Users should use documented introspection " -"helpers like :func:`typing.get_origin` and :func:`typing.get_args` instead " -"of relying on private implementation details." -msgstr "" - -#: ../../deprecations/pending-removal-in-3.19.rst:2 -msgid "Pending removal in Python 3.19" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.19.rst:6 -msgid "" -"Implicitly switching to the MSVC-compatible struct layout by setting :attr:" -"`~ctypes.Structure._pack_` but not :attr:`~ctypes.Structure._layout_` on non-" -"Windows platforms." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-future.rst:2 -#: ../../deprecations/pending-removal-in-future.rst:2 -msgid "Pending removal in future versions" -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:4 -msgid "" -"The following APIs will be removed in the future, although there is " -"currently no date scheduled for their removal." -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:7 -msgid ":mod:`argparse`:" -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:9 -msgid "" -"Nesting argument groups and nesting mutually exclusive groups are deprecated." -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:11 -msgid "" -"Passing the undocumented keyword argument *prefix_chars* to :meth:`~argparse." -"ArgumentParser.add_argument_group` is now deprecated." -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:14 -msgid "The :class:`argparse.FileType` type converter is deprecated." -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:18 -msgid "``bool(NotImplemented)``." -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:19 -msgid "" -"Generators: ``throw(type, exc, tb)`` and ``athrow(type, exc, tb)`` signature " -"is deprecated: use ``throw(exc)`` and ``athrow(exc)`` instead, the single " -"argument signature." -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:22 -msgid "" -"Currently Python accepts numeric literals immediately followed by keywords, " -"for example ``0in x``, ``1or x``, ``0if 1else 2``. It allows confusing and " -"ambiguous expressions like ``[0x1for x in y]`` (which can be interpreted as " -"``[0x1 for x in y]`` or ``[0x1f or x in y]``). A syntax warning is raised " -"if the numeric literal is immediately followed by one of keywords :keyword:" -"`and`, :keyword:`else`, :keyword:`for`, :keyword:`if`, :keyword:`in`, :" -"keyword:`is` and :keyword:`or`. In a future release it will be changed to a " -"syntax error. (:gh:`87999`)" -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:30 -msgid "" -"Support for ``__index__()`` and ``__int__()`` method returning non-int type: " -"these methods will be required to return an instance of a strict subclass " -"of :class:`int`." -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:33 -msgid "" -"Support for ``__float__()`` method returning a strict subclass of :class:" -"`float`: these methods will be required to return an instance of :class:" -"`float`." -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:36 -msgid "" -"Support for ``__complex__()`` method returning a strict subclass of :class:" -"`complex`: these methods will be required to return an instance of :class:" -"`complex`." -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:39 -msgid "Delegation of ``int()`` to ``__trunc__()`` method." -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:40 -msgid "" -"Passing a complex number as the *real* or *imag* argument in the :func:" -"`complex` constructor is now deprecated; it should only be passed as a " -"single positional argument. (Contributed by Serhiy Storchaka in :gh:" -"`109218`.)" -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:45 -msgid "" -":mod:`calendar`: ``calendar.January`` and ``calendar.February`` constants " -"are deprecated and replaced by :data:`calendar.JANUARY` and :data:`calendar." -"FEBRUARY`. (Contributed by Prince Roshan in :gh:`103636`.)" -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:50 -msgid "" -":mod:`codecs`: use :func:`open` instead of :func:`codecs.open`. (:gh:" -"`133038`)" -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:52 -msgid "" -":attr:`codeobject.co_lnotab`: use the :meth:`codeobject.co_lines` method " -"instead." -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:55 -msgid ":mod:`datetime`:" -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:57 -msgid "" -":meth:`~datetime.datetime.utcnow`: use ``datetime.datetime.now(tz=datetime." -"UTC)``." -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:59 -msgid "" -":meth:`~datetime.datetime.utcfromtimestamp`: use ``datetime.datetime." -"fromtimestamp(timestamp, tz=datetime.UTC)``." -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:62 -msgid ":mod:`gettext`: Plural value must be an integer." -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:66 -msgid "" -":func:`~importlib.util.cache_from_source` *debug_override* parameter is " -"deprecated: use the *optimization* parameter instead." -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:69 -msgid ":mod:`importlib.metadata`:" -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:71 -msgid "``EntryPoints`` tuple interface." -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:72 -msgid "Implicit ``None`` on return values." -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:74 -msgid "" -":mod:`logging`: the ``warn()`` method has been deprecated since Python 3.3, " -"use :meth:`~logging.warning` instead." -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:77 -msgid "" -":mod:`mailbox`: Use of StringIO input and text mode is deprecated, use " -"BytesIO and binary mode instead." -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:80 -msgid "" -":mod:`os`: Calling :func:`os.register_at_fork` in multi-threaded process." -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:82 -msgid "" -":class:`!pydoc.ErrorDuringImport`: A tuple value for *exc_info* parameter is " -"deprecated, use an exception instance." -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:85 -msgid "" -":mod:`re`: More strict rules are now applied for numerical group references " -"and group names in regular expressions. Only sequence of ASCII digits is " -"now accepted as a numerical reference. The group name in bytes patterns and " -"replacement strings can now only contain ASCII letters and digits and " -"underscore. (Contributed by Serhiy Storchaka in :gh:`91760`.)" -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:92 -msgid "" -":mod:`!sre_compile`, :mod:`!sre_constants` and :mod:`!sre_parse` modules." -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:94 -msgid "" -":mod:`shutil`: :func:`~shutil.rmtree`'s *onerror* parameter is deprecated in " -"Python 3.12; use the *onexc* parameter instead." -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:97 -msgid ":mod:`ssl` options and protocols:" -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:99 -msgid ":class:`ssl.SSLContext` without protocol argument is deprecated." -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:100 -msgid "" -":class:`ssl.SSLContext`: :meth:`~ssl.SSLContext.set_npn_protocols` and :meth:" -"`!selected_npn_protocol` are deprecated: use ALPN instead." -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:103 -msgid "``ssl.OP_NO_SSL*`` options" -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:104 -msgid "``ssl.OP_NO_TLS*`` options" -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:105 -msgid "``ssl.PROTOCOL_SSLv3``" -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:106 -msgid "``ssl.PROTOCOL_TLS``" -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:107 -msgid "``ssl.PROTOCOL_TLSv1``" -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:108 -msgid "``ssl.PROTOCOL_TLSv1_1``" -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:109 -msgid "``ssl.PROTOCOL_TLSv1_2``" -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:110 -msgid "``ssl.TLSVersion.SSLv3``" -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:111 -msgid "``ssl.TLSVersion.TLSv1``" -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:112 -msgid "``ssl.TLSVersion.TLSv1_1``" -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:114 -msgid ":mod:`threading` methods:" -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:116 -msgid "" -":meth:`!threading.Condition.notifyAll`: use :meth:`~threading.Condition." -"notify_all`." -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:117 -msgid ":meth:`!threading.Event.isSet`: use :meth:`~threading.Event.is_set`." -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:118 -msgid "" -":meth:`!threading.Thread.isDaemon`, :meth:`threading.Thread.setDaemon`: use :" -"attr:`threading.Thread.daemon` attribute." -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:120 -msgid "" -":meth:`!threading.Thread.getName`, :meth:`threading.Thread.setName`: use :" -"attr:`threading.Thread.name` attribute." -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:122 -msgid ":meth:`!threading.currentThread`: use :meth:`threading.current_thread`." -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:123 -msgid ":meth:`!threading.activeCount`: use :meth:`threading.active_count`." -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:125 -msgid ":class:`typing.Text` (:gh:`92332`)." -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:127 -msgid "" -"The internal class ``typing._UnionGenericAlias`` is no longer used to " -"implement :class:`typing.Union`. To preserve compatibility with users using " -"this private class, a compatibility shim will be provided until at least " -"Python 3.17. (Contributed by Jelle Zijlstra in :gh:`105499`.)" -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:132 -msgid "" -":class:`unittest.IsolatedAsyncioTestCase`: it is deprecated to return a " -"value that is not ``None`` from a test case." -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:135 -msgid "" -":mod:`urllib.parse` deprecated functions: :func:`~urllib.parse.urlparse` " -"instead" -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:137 -msgid "``splitattr()``" -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:138 -msgid "``splithost()``" -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:139 -msgid "``splitnport()``" -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:140 -msgid "``splitpasswd()``" -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:141 -msgid "``splitport()``" -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:142 -msgid "``splitquery()``" -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:143 -msgid "``splittag()``" -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:144 -msgid "``splittype()``" -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:145 -msgid "``splituser()``" -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:146 -msgid "``splitvalue()``" -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:147 -msgid "``to_bytes()``" -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:149 -msgid "" -":mod:`wsgiref`: ``SimpleHandler.stdout.write()`` should not do partial " -"writes." -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:152 -msgid "" -":mod:`xml.etree.ElementTree`: Testing the truth value of an :class:`~xml." -"etree.ElementTree.Element` is deprecated. In a future release it will always " -"return ``True``. Prefer explicit ``len(elem)`` or ``elem is not None`` tests " -"instead." -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:157 -msgid "" -":func:`sys._clear_type_cache` is deprecated: use :func:`sys." -"_clear_internal_caches` instead." -msgstr "" - -#: ../../deprecations/index.rst:15 -msgid "C API deprecations" -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:4 -msgid "The bundled copy of ``libmpdecimal``." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:5 -msgid "" -"The :c:func:`PyImport_ImportModuleNoBlock`: Use :c:func:" -"`PyImport_ImportModule` instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:7 -msgid "" -":c:func:`PyWeakref_GetObject` and :c:func:`PyWeakref_GET_OBJECT`: Use :c:" -"func:`PyWeakref_GetRef` instead. The `pythoncapi-compat project `__ can be used to get :c:func:" -"`PyWeakref_GetRef` on Python 3.12 and older." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:11 -msgid "" -":c:type:`Py_UNICODE` type and the :c:macro:`!Py_UNICODE_WIDE` macro: Use :c:" -"type:`wchar_t` instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:13 -msgid "" -":c:func:`!PyUnicode_AsDecodedObject`: Use :c:func:`PyCodec_Decode` instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:15 -msgid "" -":c:func:`!PyUnicode_AsDecodedUnicode`: Use :c:func:`PyCodec_Decode` instead; " -"Note that some codecs (for example, \"base64\") may return a type other " -"than :class:`str`, such as :class:`bytes`." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:18 -msgid "" -":c:func:`!PyUnicode_AsEncodedObject`: Use :c:func:`PyCodec_Encode` instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:20 -msgid "" -":c:func:`!PyUnicode_AsEncodedUnicode`: Use :c:func:`PyCodec_Encode` instead; " -"Note that some codecs (for example, \"base64\") may return a type other " -"than :class:`bytes`, such as :class:`str`." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:23 -msgid "Python initialization functions, deprecated in Python 3.13:" -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:25 -msgid "" -":c:func:`Py_GetPath`: Use :c:func:`PyConfig_Get(\"module_search_paths\") " -"` (:data:`sys.path`) instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:28 -msgid "" -":c:func:`Py_GetPrefix`: Use :c:func:`PyConfig_Get(\"base_prefix\") " -"` (:data:`sys.base_prefix`) instead. Use :c:func:" -"`PyConfig_Get(\"prefix\") ` (:data:`sys.prefix`) if :ref:" -"`virtual environments ` need to be handled." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:33 -msgid "" -":c:func:`Py_GetExecPrefix`: Use :c:func:`PyConfig_Get(\"base_exec_prefix\") " -"` (:data:`sys.base_exec_prefix`) instead. Use :c:func:" -"`PyConfig_Get(\"exec_prefix\") ` (:data:`sys.exec_prefix`) if :" -"ref:`virtual environments ` need to be handled." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:39 -msgid "" -":c:func:`Py_GetProgramFullPath`: Use :c:func:`PyConfig_Get(\"executable\") " -"` (:data:`sys.executable`) instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:42 -msgid "" -":c:func:`Py_GetProgramName`: Use :c:func:`PyConfig_Get(\"executable\") " -"` (:data:`sys.executable`) instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:45 -msgid "" -":c:func:`Py_GetPythonHome`: Use :c:func:`PyConfig_Get(\"home\") " -"` or the :envvar:`PYTHONHOME` environment variable instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:49 -msgid "" -"The `pythoncapi-compat project `__ can be used to get :c:func:`PyConfig_Get` on Python 3.13 and older." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:53 -msgid "" -"Functions to configure Python's initialization, deprecated in Python 3.11:" -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:55 -msgid ":c:func:`!PySys_SetArgvEx()`: Set :c:member:`PyConfig.argv` instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:57 -msgid ":c:func:`!PySys_SetArgv()`: Set :c:member:`PyConfig.argv` instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:59 -msgid "" -":c:func:`!Py_SetProgramName()`: Set :c:member:`PyConfig.program_name` " -"instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:61 -msgid ":c:func:`!Py_SetPythonHome()`: Set :c:member:`PyConfig.home` instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:63 -msgid "" -":c:func:`PySys_ResetWarnOptions`: Clear :data:`sys.warnoptions` and :data:`!" -"warnings.filters` instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:66 -msgid "" -"The :c:func:`Py_InitializeFromConfig` API should be used with :c:type:" -"`PyConfig` instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:69 -msgid "Global configuration variables:" -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:71 -msgid "" -":c:var:`Py_DebugFlag`: Use :c:member:`PyConfig.parser_debug` or :c:func:" -"`PyConfig_Get(\"parser_debug\") ` instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:74 -msgid "" -":c:var:`Py_VerboseFlag`: Use :c:member:`PyConfig.verbose` or :c:func:" -"`PyConfig_Get(\"verbose\") ` instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:77 -msgid "" -":c:var:`Py_QuietFlag`: Use :c:member:`PyConfig.quiet` or :c:func:" -"`PyConfig_Get(\"quiet\") ` instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:80 -msgid "" -":c:var:`Py_InteractiveFlag`: Use :c:member:`PyConfig.interactive` or :c:func:" -"`PyConfig_Get(\"interactive\") ` instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:83 -msgid "" -":c:var:`Py_InspectFlag`: Use :c:member:`PyConfig.inspect` or :c:func:" -"`PyConfig_Get(\"inspect\") ` instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:86 -msgid "" -":c:var:`Py_OptimizeFlag`: Use :c:member:`PyConfig.optimization_level` or :c:" -"func:`PyConfig_Get(\"optimization_level\") ` instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:89 -msgid "" -":c:var:`Py_NoSiteFlag`: Use :c:member:`PyConfig.site_import` or :c:func:" -"`PyConfig_Get(\"site_import\") ` instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:92 -msgid "" -":c:var:`Py_BytesWarningFlag`: Use :c:member:`PyConfig.bytes_warning` or :c:" -"func:`PyConfig_Get(\"bytes_warning\") ` instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:95 -msgid "" -":c:var:`Py_FrozenFlag`: Use :c:member:`PyConfig.pathconfig_warnings` or :c:" -"func:`PyConfig_Get(\"pathconfig_warnings\") ` instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:98 -msgid "" -":c:var:`Py_IgnoreEnvironmentFlag`: Use :c:member:`PyConfig.use_environment` " -"or :c:func:`PyConfig_Get(\"use_environment\") ` instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:101 -msgid "" -":c:var:`Py_DontWriteBytecodeFlag`: Use :c:member:`PyConfig.write_bytecode` " -"or :c:func:`PyConfig_Get(\"write_bytecode\") ` instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:104 -msgid "" -":c:var:`Py_NoUserSiteDirectory`: Use :c:member:`PyConfig." -"user_site_directory` or :c:func:`PyConfig_Get(\"user_site_directory\") " -"` instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:107 -msgid "" -":c:var:`Py_UnbufferedStdioFlag`: Use :c:member:`PyConfig.buffered_stdio` or :" -"c:func:`PyConfig_Get(\"buffered_stdio\") ` instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:110 -msgid "" -":c:var:`Py_HashRandomizationFlag`: Use :c:member:`PyConfig.use_hash_seed` " -"and :c:member:`PyConfig.hash_seed` or :c:func:`PyConfig_Get(\"hash_seed\") " -"` instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:114 -msgid "" -":c:var:`Py_IsolatedFlag`: Use :c:member:`PyConfig.isolated` or :c:func:" -"`PyConfig_Get(\"isolated\") ` instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:117 -msgid "" -":c:var:`Py_LegacyWindowsFSEncodingFlag`: Use :c:member:`PyPreConfig." -"legacy_windows_fs_encoding` or :c:func:" -"`PyConfig_Get(\"legacy_windows_fs_encoding\") ` instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:120 -msgid "" -":c:var:`Py_LegacyWindowsStdioFlag`: Use :c:member:`PyConfig." -"legacy_windows_stdio` or :c:func:`PyConfig_Get(\"legacy_windows_stdio\") " -"` instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:123 -msgid "" -":c:var:`!Py_FileSystemDefaultEncoding`, :c:var:`!" -"Py_HasFileSystemDefaultEncoding`: Use :c:member:`PyConfig." -"filesystem_encoding` or :c:func:`PyConfig_Get(\"filesystem_encoding\") " -"` instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:126 -msgid "" -":c:var:`!Py_FileSystemDefaultEncodeErrors`: Use :c:member:`PyConfig." -"filesystem_errors` or :c:func:`PyConfig_Get(\"filesystem_errors\") " -"` instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:129 -msgid "" -":c:var:`!Py_UTF8Mode`: Use :c:member:`PyPreConfig.utf8_mode` or :c:func:" -"`PyConfig_Get(\"utf8_mode\") ` instead. (see :c:func:" -"`Py_PreInitialize`)" -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.15.rst:134 -msgid "" -"The :c:func:`Py_InitializeFromConfig` API should be used with :c:type:" -"`PyConfig` to set these options. Or :c:func:`PyConfig_Get` can be used to " -"get these options at runtime." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:2 -msgid "Pending removal in Python 3.18" -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:4 -msgid "Deprecated private functions (:gh:`128863`):" -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:6 -msgid ":c:func:`!_PyBytes_Join`: use :c:func:`PyBytes_Join`." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:7 -msgid "" -":c:func:`!_PyDict_GetItemStringWithError`: use :c:func:" -"`PyDict_GetItemStringRef`." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:8 -msgid ":c:func:`!_PyDict_Pop()`: :c:func:`PyDict_Pop`." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:9 -msgid ":c:func:`!_PyLong_Sign()`: use :c:func:`PyLong_GetSign`." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:10 -msgid "" -":c:func:`!_PyLong_FromDigits` and :c:func:`!_PyLong_New`: use :c:func:" -"`PyLongWriter_Create`." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:12 -msgid "" -":c:func:`!_PyThreadState_UncheckedGet`: use :c:func:" -"`PyThreadState_GetUnchecked`." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:13 -msgid ":c:func:`!_PyUnicode_AsString`: use :c:func:`PyUnicode_AsUTF8`." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:14 -msgid "" -":c:func:`!_PyUnicodeWriter_Init`: replace ``_PyUnicodeWriter_Init(&writer)`` " -"with :c:func:`writer = PyUnicodeWriter_Create(0) `." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:17 -msgid "" -":c:func:`!_PyUnicodeWriter_Finish`: replace " -"``_PyUnicodeWriter_Finish(&writer)`` with :c:func:" -"`PyUnicodeWriter_Finish(writer) `." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:20 -msgid "" -":c:func:`!_PyUnicodeWriter_Dealloc`: replace " -"``_PyUnicodeWriter_Dealloc(&writer)`` with :c:func:" -"`PyUnicodeWriter_Discard(writer) `." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:23 -msgid "" -":c:func:`!_PyUnicodeWriter_WriteChar`: replace " -"``_PyUnicodeWriter_WriteChar(&writer, ch)`` with :c:func:" -"`PyUnicodeWriter_WriteChar(writer, ch) `." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:26 -msgid "" -":c:func:`!_PyUnicodeWriter_WriteStr`: replace " -"``_PyUnicodeWriter_WriteStr(&writer, str)`` with :c:func:" -"`PyUnicodeWriter_WriteStr(writer, str) `." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:29 -msgid "" -":c:func:`!_PyUnicodeWriter_WriteSubstring`: replace " -"``_PyUnicodeWriter_WriteSubstring(&writer, str, start, end)`` with :c:func:" -"`PyUnicodeWriter_WriteSubstring(writer, str, start, end) " -"`." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:32 -msgid "" -":c:func:`!_PyUnicodeWriter_WriteASCIIString`: replace " -"``_PyUnicodeWriter_WriteASCIIString(&writer, str)`` with :c:func:" -"`PyUnicodeWriter_WriteUTF8(writer, str) `." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:35 -msgid "" -":c:func:`!_PyUnicodeWriter_WriteLatin1String`: replace " -"``_PyUnicodeWriter_WriteLatin1String(&writer, str)`` with :c:func:" -"`PyUnicodeWriter_WriteUTF8(writer, str) `." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:38 -msgid ":c:func:`!_PyUnicodeWriter_Prepare`: (no replacement)." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:39 -msgid ":c:func:`!_PyUnicodeWriter_PrepareKind`: (no replacement)." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:40 -msgid ":c:func:`!_Py_HashPointer`: use :c:func:`Py_HashPointer`." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:41 -msgid ":c:func:`!_Py_fopen_obj`: use :c:func:`Py_fopen`." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-3.18.rst:43 -msgid "" -"The `pythoncapi-compat project `__ can be used to get these new public functions on Python 3.13 and older." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-future.rst:4 -msgid "" -"The following APIs are deprecated and will be removed, although there is " -"currently no date scheduled for their removal." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-future.rst:7 -msgid ":c:macro:`Py_TPFLAGS_HAVE_FINALIZE`: Unneeded since Python 3.8." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-future.rst:9 -msgid ":c:func:`PyErr_Fetch`: Use :c:func:`PyErr_GetRaisedException` instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-future.rst:11 -msgid "" -":c:func:`PyErr_NormalizeException`: Use :c:func:`PyErr_GetRaisedException` " -"instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-future.rst:13 -msgid "" -":c:func:`PyErr_Restore`: Use :c:func:`PyErr_SetRaisedException` instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-future.rst:15 -msgid "" -":c:func:`PyModule_GetFilename`: Use :c:func:`PyModule_GetFilenameObject` " -"instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-future.rst:17 -msgid ":c:func:`PyOS_AfterFork`: Use :c:func:`PyOS_AfterFork_Child` instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-future.rst:19 -msgid "" -":c:func:`PySlice_GetIndicesEx`: Use :c:func:`PySlice_Unpack` and :c:func:" -"`PySlice_AdjustIndices` instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-future.rst:21 -msgid ":c:func:`PyUnicode_READY`: Unneeded since Python 3.12" -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-future.rst:23 -msgid ":c:func:`!PyErr_Display`: Use :c:func:`PyErr_DisplayException` instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-future.rst:25 -msgid "" -":c:func:`!_PyErr_ChainExceptions`: Use :c:func:`!_PyErr_ChainExceptions1` " -"instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-future.rst:27 -msgid "" -":c:member:`!PyBytesObject.ob_shash` member: call :c:func:`PyObject_Hash` " -"instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-future.rst:29 -msgid "Thread Local Storage (TLS) API:" -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-future.rst:31 -msgid "" -":c:func:`PyThread_create_key`: Use :c:func:`PyThread_tss_alloc` instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-future.rst:33 -msgid ":c:func:`PyThread_delete_key`: Use :c:func:`PyThread_tss_free` instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-future.rst:35 -msgid "" -":c:func:`PyThread_set_key_value`: Use :c:func:`PyThread_tss_set` instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-future.rst:37 -msgid "" -":c:func:`PyThread_get_key_value`: Use :c:func:`PyThread_tss_get` instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-future.rst:39 -msgid "" -":c:func:`PyThread_delete_key_value`: Use :c:func:`PyThread_tss_delete` " -"instead." -msgstr "" - -#: ../../deprecations/c-api-pending-removal-in-future.rst:41 -msgid ":c:func:`PyThread_ReInitTLS`: Unneeded since Python 3.7." -msgstr "" diff --git a/deprecations/pending-removal-in-3.13.po b/deprecations/pending-removal-in-3.13.po deleted file mode 100644 index 62eef105b..000000000 --- a/deprecations/pending-removal-in-3.13.po +++ /dev/null @@ -1,195 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation -# This file is distributed under the same license as the Python package. -# FIRST AUTHOR , YEAR. -# -# Translators: -# Taichi Haradaguchi, 2024 -# Takanori Suzuki , 2024 -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: Python 3.14\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2024-07-26 14:16+0000\n" -"Last-Translator: Takanori Suzuki , 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" -"ja/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#: ../../deprecations/pending-removal-in-3.13.rst:2 -msgid "Pending removal in Python 3.13" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.13.rst:4 -msgid "Modules (see :pep:`594`):" -msgstr "モジュール(:pep:`594` を参照):" - -#: ../../deprecations/pending-removal-in-3.13.rst:6 -msgid ":mod:`!aifc`" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.13.rst:7 -msgid ":mod:`!audioop`" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.13.rst:8 -msgid ":mod:`!cgi`" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.13.rst:9 -msgid ":mod:`!cgitb`" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.13.rst:10 -msgid ":mod:`!chunk`" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.13.rst:11 -msgid ":mod:`!crypt`" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.13.rst:12 -msgid ":mod:`!imghdr`" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.13.rst:13 -msgid ":mod:`!mailcap`" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.13.rst:14 -msgid ":mod:`!msilib`" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.13.rst:15 -msgid ":mod:`!nis`" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.13.rst:16 -msgid ":mod:`!nntplib`" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.13.rst:17 -msgid ":mod:`!ossaudiodev`" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.13.rst:18 -msgid ":mod:`!pipes`" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.13.rst:19 -msgid ":mod:`!sndhdr`" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.13.rst:20 -msgid ":mod:`!spwd`" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.13.rst:21 -msgid ":mod:`!sunau`" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.13.rst:22 -msgid ":mod:`!telnetlib`" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.13.rst:23 -msgid ":mod:`!uu`" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.13.rst:24 -msgid ":mod:`!xdrlib`" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.13.rst:26 -msgid "Other modules:" -msgstr "その他のモジュール:" - -#: ../../deprecations/pending-removal-in-3.13.rst:28 -msgid ":mod:`!lib2to3`, and the :program:`2to3` program (:gh:`84540`)" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.13.rst:30 -msgid "APIs:" -msgstr "API" - -#: ../../deprecations/pending-removal-in-3.13.rst:32 -msgid ":class:`!configparser.LegacyInterpolation` (:gh:`90765`)" -msgstr ":class:`!configparser.LegacyInterpolation` (:gh:`90765`)" - -#: ../../deprecations/pending-removal-in-3.13.rst:33 -msgid "``locale.resetlocale()`` (:gh:`90817`)" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.13.rst:34 -msgid ":meth:`!turtle.RawTurtle.settiltangle` (:gh:`50096`)" -msgstr ":meth:`!turtle.RawTurtle.settiltangle` (:gh:`50096`)" - -#: ../../deprecations/pending-removal-in-3.13.rst:35 -msgid ":func:`!unittest.findTestCases` (:gh:`50096`)" -msgstr ":func:`!unittest.findTestCases` (:gh:`50096`)" - -#: ../../deprecations/pending-removal-in-3.13.rst:36 -msgid ":func:`!unittest.getTestCaseNames` (:gh:`50096`)" -msgstr ":func:`!unittest.getTestCaseNames` (:gh:`50096`)" - -#: ../../deprecations/pending-removal-in-3.13.rst:37 -msgid ":func:`!unittest.makeSuite` (:gh:`50096`)" -msgstr ":func:`!unittest.makeSuite` (:gh:`50096`)" - -#: ../../deprecations/pending-removal-in-3.13.rst:38 -msgid ":meth:`!unittest.TestProgram.usageExit` (:gh:`67048`)" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.13.rst:39 -msgid ":class:`!webbrowser.MacOSX` (:gh:`86421`)" -msgstr ":class:`!webbrowser.MacOSX` (:gh:`86421`)" - -#: ../../deprecations/pending-removal-in-3.13.rst:40 -msgid ":class:`classmethod` descriptor chaining (:gh:`89519`)" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.13.rst:41 -msgid ":mod:`importlib.resources` deprecated methods:" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.13.rst:43 -msgid "``contents()``" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.13.rst:44 -msgid "``is_resource()``" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.13.rst:45 -msgid "``open_binary()``" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.13.rst:46 -msgid "``open_text()``" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.13.rst:47 -msgid "``path()``" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.13.rst:48 -msgid "``read_binary()``" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.13.rst:49 -msgid "``read_text()``" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.13.rst:51 -msgid "" -"Use :func:`importlib.resources.files` instead. Refer to `importlib-" -"resources: Migrating from Legacy `_ (:gh:`106531`)" -msgstr "" diff --git a/deprecations/pending-removal-in-3.14.po b/deprecations/pending-removal-in-3.14.po deleted file mode 100644 index f7505e58a..000000000 --- a/deprecations/pending-removal-in-3.14.po +++ /dev/null @@ -1,213 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation -# This file is distributed under the same license as the Python package. -# FIRST AUTHOR , YEAR. -# -# Translators: -# Takanori Suzuki , 2024 -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: Python 3.14\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2024-07-20 00:54+0000\n" -"Last-Translator: Takanori Suzuki , 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" -"ja/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#: ../../deprecations/pending-removal-in-3.14.rst:2 -msgid "Pending removal in Python 3.14" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.14.rst:4 -msgid "" -":mod:`argparse`: The *type*, *choices*, and *metavar* parameters of :class:`!" -"argparse.BooleanOptionalAction` are deprecated and will be removed in 3.14. " -"(Contributed by Nikita Sobolev in :gh:`92248`.)" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.14.rst:9 -msgid "" -":mod:`ast`: The following features have been deprecated in documentation " -"since Python 3.8, now cause a :exc:`DeprecationWarning` to be emitted at " -"runtime when they are accessed or used, and will be removed in Python 3.14:" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.14.rst:13 -msgid ":class:`!ast.Num`" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.14.rst:14 -msgid ":class:`!ast.Str`" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.14.rst:15 -msgid ":class:`!ast.Bytes`" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.14.rst:16 -msgid ":class:`!ast.NameConstant`" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.14.rst:17 -msgid ":class:`!ast.Ellipsis`" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.14.rst:19 -msgid "" -"Use :class:`ast.Constant` instead. (Contributed by Serhiy Storchaka in :gh:" -"`90953`.)" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.14.rst:22 -msgid ":mod:`asyncio`:" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.14.rst:24 -msgid "" -"The child watcher classes :class:`!asyncio.MultiLoopChildWatcher`, :class:`!" -"asyncio.FastChildWatcher`, :class:`!asyncio.AbstractChildWatcher` and :class:" -"`!asyncio.SafeChildWatcher` are deprecated and will be removed in Python " -"3.14. (Contributed by Kumar Aditya in :gh:`94597`.)" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.14.rst:30 -msgid "" -":func:`!asyncio.set_child_watcher`, :func:`!asyncio.get_child_watcher`, :" -"meth:`!asyncio.AbstractEventLoopPolicy.set_child_watcher` and :meth:`!" -"asyncio.AbstractEventLoopPolicy.get_child_watcher` are deprecated and will " -"be removed in Python 3.14. (Contributed by Kumar Aditya in :gh:`94597`.)" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.14.rst:36 -msgid "" -"The :meth:`~asyncio.get_event_loop` method of the default event loop policy " -"now emits a :exc:`DeprecationWarning` if there is no current event loop set " -"and it decides to create one. (Contributed by Serhiy Storchaka and Guido van " -"Rossum in :gh:`100160`.)" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.14.rst:41 -msgid "" -":mod:`collections.abc`: Deprecated :class:`!collections.abc.ByteString`. " -"Prefer :class:`!Sequence` or :class:`~collections.abc.Buffer`. For use in " -"typing, prefer a union, like ``bytes | bytearray``, or :class:`collections." -"abc.Buffer`. (Contributed by Shantanu Jain in :gh:`91896`.)" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.14.rst:47 -msgid "" -":mod:`email`: Deprecated the *isdst* parameter in :func:`email.utils." -"localtime`. (Contributed by Alan Williams in :gh:`72346`.)" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.14.rst:50 -msgid ":mod:`importlib.abc` deprecated classes:" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.14.rst:52 -msgid ":class:`!importlib.abc.ResourceReader`" -msgstr ":class:`!importlib.abc.ResourceReader`" - -#: ../../deprecations/pending-removal-in-3.14.rst:53 -msgid ":class:`!importlib.abc.Traversable`" -msgstr ":class:`!importlib.abc.Traversable`" - -#: ../../deprecations/pending-removal-in-3.14.rst:54 -msgid ":class:`!importlib.abc.TraversableResources`" -msgstr ":class:`!importlib.abc.TraversableResources`" - -#: ../../deprecations/pending-removal-in-3.14.rst:56 -msgid "Use :mod:`importlib.resources.abc` classes instead:" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.14.rst:58 -msgid ":class:`importlib.resources.abc.Traversable`" -msgstr ":class:`importlib.resources.abc.Traversable`" - -#: ../../deprecations/pending-removal-in-3.14.rst:59 -msgid ":class:`importlib.resources.abc.TraversableResources`" -msgstr ":class:`importlib.resources.abc.TraversableResources`" - -#: ../../deprecations/pending-removal-in-3.14.rst:61 -msgid "(Contributed by Jason R. Coombs and Hugo van Kemenade in :gh:`93963`.)" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.14.rst:63 -msgid "" -":mod:`itertools` had undocumented, inefficient, historically buggy, and " -"inconsistent support for copy, deepcopy, and pickle operations. This will be " -"removed in 3.14 for a significant reduction in code volume and maintenance " -"burden. (Contributed by Raymond Hettinger in :gh:`101588`.)" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.14.rst:69 -msgid "" -":mod:`multiprocessing`: The default start method will change to a safer one " -"on Linux, BSDs, and other non-macOS POSIX platforms where ``'fork'`` is " -"currently the default (:gh:`84559`). Adding a runtime warning about this was " -"deemed too disruptive as the majority of code is not expected to care. Use " -"the :func:`~multiprocessing.get_context` or :func:`~multiprocessing." -"set_start_method` APIs to explicitly specify when your code *requires* " -"``'fork'``. See :ref:`multiprocessing-start-methods`." -msgstr "" - -#: ../../deprecations/pending-removal-in-3.14.rst:77 -msgid "" -":mod:`pathlib`: :meth:`~pathlib.PurePath.is_relative_to` and :meth:`~pathlib." -"PurePath.relative_to`: passing additional arguments is deprecated." -msgstr "" - -#: ../../deprecations/pending-removal-in-3.14.rst:81 -msgid "" -":mod:`pkgutil`: :func:`!pkgutil.find_loader` and :func:`!pkgutil.get_loader` " -"now raise :exc:`DeprecationWarning`; use :func:`importlib.util.find_spec` " -"instead. (Contributed by Nikita Sobolev in :gh:`97850`.)" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.14.rst:86 -msgid ":mod:`pty`:" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.14.rst:88 -msgid "``master_open()``: use :func:`pty.openpty`." -msgstr "" - -#: ../../deprecations/pending-removal-in-3.14.rst:89 -msgid "``slave_open()``: use :func:`pty.openpty`." -msgstr "" - -#: ../../deprecations/pending-removal-in-3.14.rst:91 -msgid ":mod:`sqlite3`:" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.14.rst:93 -msgid ":data:`!version` and :data:`!version_info`." -msgstr "" - -#: ../../deprecations/pending-removal-in-3.14.rst:95 -msgid "" -":meth:`~sqlite3.Cursor.execute` and :meth:`~sqlite3.Cursor.executemany` if :" -"ref:`named placeholders ` are used and *parameters* is " -"a sequence instead of a :class:`dict`." -msgstr "" - -#: ../../deprecations/pending-removal-in-3.14.rst:99 -msgid "" -":mod:`typing`: :class:`!typing.ByteString`, deprecated since Python 3.9, now " -"causes a :exc:`DeprecationWarning` to be emitted when it is used." -msgstr "" - -#: ../../deprecations/pending-removal-in-3.14.rst:102 -msgid "" -":mod:`urllib`: :class:`!urllib.parse.Quoter` is deprecated: it was not " -"intended to be a public API. (Contributed by Gregory P. Smith in :gh:" -"`88168`.)" -msgstr "" diff --git a/deprecations/pending-removal-in-3.15.po b/deprecations/pending-removal-in-3.15.po deleted file mode 100644 index c4f3234fc..000000000 --- a/deprecations/pending-removal-in-3.15.po +++ /dev/null @@ -1,196 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 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.14\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-13 14:21+0000\n" -"PO-Revision-Date: 2024-07-20 00:54+0000\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" -"ja/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#: ../../deprecations/pending-removal-in-3.15.rst:2 -msgid "Pending removal in Python 3.15" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.15.rst:4 -msgid "The import system:" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.15.rst:6 -msgid "" -"Setting :attr:`~module.__cached__` on a module while failing to set :attr:" -"`__spec__.cached ` is deprecated. In " -"Python 3.15, :attr:`!__cached__` will cease to be set or take into " -"consideration by the import system or standard library. (:gh:`97879`)" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.15.rst:11 -msgid "" -"Setting :attr:`~module.__package__` on a module while failing to set :attr:" -"`__spec__.parent ` is deprecated. In " -"Python 3.15, :attr:`!__package__` will cease to be set or take into " -"consideration by the import system or standard library. (:gh:`97879`)" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.15.rst:16 -msgid ":mod:`ctypes`:" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.15.rst:18 -msgid "" -"The undocumented :func:`!ctypes.SetPointerType` function has been deprecated " -"since Python 3.13." -msgstr "" - -#: ../../deprecations/pending-removal-in-3.15.rst:21 -msgid ":mod:`http.server`:" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.15.rst:23 -msgid "" -"The obsolete and rarely used :class:`~http.server.CGIHTTPRequestHandler` has " -"been deprecated since Python 3.13. No direct replacement exists. *Anything* " -"is better than CGI to interface a web server with a request handler." -msgstr "" - -#: ../../deprecations/pending-removal-in-3.15.rst:29 -msgid "" -"The :option:`!--cgi` flag to the :program:`python -m http.server` command-" -"line interface has been deprecated since Python 3.13." -msgstr "" - -#: ../../deprecations/pending-removal-in-3.15.rst:32 -msgid ":mod:`importlib`:" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.15.rst:34 -msgid "``load_module()`` method: use ``exec_module()`` instead." -msgstr "" - -#: ../../deprecations/pending-removal-in-3.15.rst:36 -msgid ":class:`locale`:" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.15.rst:38 -msgid "" -"The :func:`~locale.getdefaultlocale` function has been deprecated since " -"Python 3.11. Its removal was originally planned for Python 3.13 (:gh:" -"`90817`), but has been postponed to Python 3.15. Use :func:`~locale." -"getlocale`, :func:`~locale.setlocale`, and :func:`~locale.getencoding` " -"instead. (Contributed by Hugo van Kemenade in :gh:`111187`.)" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.15.rst:46 -msgid ":mod:`pathlib`:" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.15.rst:48 -msgid "" -":meth:`.PurePath.is_reserved` has been deprecated since Python 3.13. Use :" -"func:`os.path.isreserved` to detect reserved paths on Windows." -msgstr "" - -#: ../../deprecations/pending-removal-in-3.15.rst:52 -msgid ":mod:`platform`:" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.15.rst:54 -msgid "" -":func:`~platform.java_ver` has been deprecated since Python 3.13. This " -"function is only useful for Jython support, has a confusing API, and is " -"largely untested." -msgstr "" - -#: ../../deprecations/pending-removal-in-3.15.rst:58 -msgid ":mod:`sysconfig`:" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.15.rst:60 -msgid "" -"The *check_home* argument of :func:`sysconfig.is_python_build` has been " -"deprecated since Python 3.12." -msgstr "" - -#: ../../deprecations/pending-removal-in-3.15.rst:63 -msgid ":mod:`threading`:" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.15.rst:65 -msgid "" -":func:`~threading.RLock` will take no arguments in Python 3.15. Passing any " -"arguments has been deprecated since Python 3.14, as the Python version does " -"not permit any arguments, but the C version allows any number of positional " -"or keyword arguments, ignoring every argument." -msgstr "" - -#: ../../deprecations/pending-removal-in-3.15.rst:71 -msgid ":mod:`types`:" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.15.rst:73 -msgid "" -":class:`types.CodeType`: Accessing :attr:`~codeobject.co_lnotab` was " -"deprecated in :pep:`626` since 3.10 and was planned to be removed in 3.12, " -"but it only got a proper :exc:`DeprecationWarning` in 3.12. May be removed " -"in 3.15. (Contributed by Nikita Sobolev in :gh:`101866`.)" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.15.rst:80 -msgid ":mod:`typing`:" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.15.rst:82 -msgid "" -"The undocumented keyword argument syntax for creating :class:`~typing." -"NamedTuple` classes (for example, ``Point = NamedTuple(\"Point\", x=int, " -"y=int)``) has been deprecated since Python 3.13. Use the class-based syntax " -"or the functional syntax instead." -msgstr "" - -#: ../../deprecations/pending-removal-in-3.15.rst:88 -msgid "" -"When using the functional syntax of :class:`~typing.TypedDict`\\s, failing " -"to pass a value to the *fields* parameter (``TD = TypedDict(\"TD\")``) or " -"passing ``None`` (``TD = TypedDict(\"TD\", None)``) has been deprecated " -"since Python 3.13. Use ``class TD(TypedDict): pass`` or ``TD = " -"TypedDict(\"TD\", {})`` to create a TypedDict with zero field." -msgstr "" - -#: ../../deprecations/pending-removal-in-3.15.rst:95 -msgid "" -"The :func:`typing.no_type_check_decorator` decorator function has been " -"deprecated since Python 3.13. After eight years in the :mod:`typing` module, " -"it has yet to be supported by any major type checker." -msgstr "" - -#: ../../deprecations/pending-removal-in-3.15.rst:100 -msgid ":mod:`wave`:" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.15.rst:102 -msgid "" -"The :meth:`~wave.Wave_read.getmark`, :meth:`!setmark`, and :meth:`~wave." -"Wave_read.getmarkers` methods of the :class:`~wave.Wave_read` and :class:" -"`~wave.Wave_write` classes have been deprecated since Python 3.13." -msgstr "" - -#: ../../deprecations/pending-removal-in-3.15.rst:107 -msgid ":mod:`zipimport`:" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.15.rst:109 -msgid "" -":meth:`~zipimport.zipimporter.load_module` has been deprecated since Python " -"3.10. Use :meth:`~zipimport.zipimporter.exec_module` instead. (Contributed " -"by Jiahao Li in :gh:`125746`.)" -msgstr "" diff --git a/deprecations/pending-removal-in-3.16.po b/deprecations/pending-removal-in-3.16.po deleted file mode 100644 index cec62c1d8..000000000 --- a/deprecations/pending-removal-in-3.16.po +++ /dev/null @@ -1,211 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 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.14\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-13 14:21+0000\n" -"PO-Revision-Date: 2024-07-20 00:54+0000\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" -"ja/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#: ../../deprecations/pending-removal-in-3.16.rst:2 -msgid "Pending removal in Python 3.16" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.16.rst:4 -msgid "The import system:" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.16.rst:6 -msgid "" -"Setting :attr:`~module.__loader__` on a module while failing to set :attr:" -"`__spec__.loader ` is deprecated. In " -"Python 3.16, :attr:`!__loader__` will cease to be set or taken into " -"consideration by the import system or the standard library." -msgstr "" - -#: ../../deprecations/pending-removal-in-3.16.rst:11 -msgid ":mod:`array`:" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.16.rst:13 -msgid "" -"The ``'u'`` format code (:c:type:`wchar_t`) has been deprecated in " -"documentation since Python 3.3 and at runtime since Python 3.13. Use the " -"``'w'`` format code (:c:type:`Py_UCS4`) for Unicode characters instead." -msgstr "" - -#: ../../deprecations/pending-removal-in-3.16.rst:19 -msgid ":mod:`asyncio`:" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.16.rst:21 -msgid "" -":func:`!asyncio.iscoroutinefunction` is deprecated and will be removed in " -"Python 3.16; use :func:`inspect.iscoroutinefunction` instead. (Contributed " -"by Jiahao Li and Kumar Aditya in :gh:`122875`.)" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.16.rst:26 -msgid "" -":mod:`asyncio` policy system is deprecated and will be removed in Python " -"3.16. In particular, the following classes and functions are deprecated:" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.16.rst:29 -msgid ":class:`asyncio.AbstractEventLoopPolicy`" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.16.rst:30 -msgid ":class:`asyncio.DefaultEventLoopPolicy`" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.16.rst:31 -msgid ":class:`asyncio.WindowsSelectorEventLoopPolicy`" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.16.rst:32 -msgid ":class:`asyncio.WindowsProactorEventLoopPolicy`" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.16.rst:33 -msgid ":func:`asyncio.get_event_loop_policy`" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.16.rst:34 -msgid ":func:`asyncio.set_event_loop_policy`" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.16.rst:36 -msgid "" -"Users should use :func:`asyncio.run` or :class:`asyncio.Runner` with " -"*loop_factory* to use the desired event loop implementation." -msgstr "" - -#: ../../deprecations/pending-removal-in-3.16.rst:39 -msgid "For example, to use :class:`asyncio.SelectorEventLoop` on Windows::" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.16.rst:41 -msgid "" -"import asyncio\n" -"\n" -"async def main():\n" -" ...\n" -"\n" -"asyncio.run(main(), loop_factory=asyncio.SelectorEventLoop)" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.16.rst:48 -msgid "(Contributed by Kumar Aditya in :gh:`127949`.)" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.16.rst:50 -msgid ":mod:`builtins`:" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.16.rst:52 -msgid "" -"Bitwise inversion on boolean types, ``~True`` or ``~False`` has been " -"deprecated since Python 3.12, as it produces surprising and unintuitive " -"results (``-2`` and ``-1``). Use ``not x`` instead for the logical negation " -"of a Boolean. In the rare case that you need the bitwise inversion of the " -"underlying integer, convert to ``int`` explicitly (``~int(x)``)." -msgstr "" - -#: ../../deprecations/pending-removal-in-3.16.rst:59 -msgid ":mod:`functools`:" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.16.rst:61 -msgid "" -"Calling the Python implementation of :func:`functools.reduce` with " -"*function* or *sequence* as keyword arguments has been deprecated since " -"Python 3.14." -msgstr "" - -#: ../../deprecations/pending-removal-in-3.16.rst:64 -msgid ":mod:`logging`:" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.16.rst:66 -msgid "" -"Support for custom logging handlers with the *strm* argument is deprecated " -"and scheduled for removal in Python 3.16. Define handlers with the *stream* " -"argument instead. (Contributed by Mariusz Felisiak in :gh:`115032`.)" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.16.rst:70 -msgid ":mod:`mimetypes`:" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.16.rst:72 -msgid "" -"Valid extensions start with a '.' or are empty for :meth:`mimetypes." -"MimeTypes.add_type`. Undotted extensions are deprecated and will raise a :" -"exc:`ValueError` in Python 3.16. (Contributed by Hugo van Kemenade in :gh:" -"`75223`.)" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.16.rst:78 -msgid ":mod:`shutil`:" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.16.rst:80 -msgid "" -"The :class:`!ExecError` exception has been deprecated since Python 3.14. It " -"has not been used by any function in :mod:`!shutil` since Python 3.4, and is " -"now an alias of :exc:`RuntimeError`." -msgstr "" - -#: ../../deprecations/pending-removal-in-3.16.rst:85 -msgid ":mod:`symtable`:" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.16.rst:87 -msgid "" -"The :meth:`Class.get_methods ` method has been " -"deprecated since Python 3.14." -msgstr "" - -#: ../../deprecations/pending-removal-in-3.16.rst:90 -msgid ":mod:`sys`:" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.16.rst:92 -msgid "" -"The :func:`~sys._enablelegacywindowsfsencoding` function has been deprecated " -"since Python 3.13. Use the :envvar:`PYTHONLEGACYWINDOWSFSENCODING` " -"environment variable instead." -msgstr "" - -#: ../../deprecations/pending-removal-in-3.16.rst:96 -msgid ":mod:`sysconfig`:" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.16.rst:98 -msgid "" -"The :func:`!sysconfig.expand_makefile_vars` function has been deprecated " -"since Python 3.14. Use the ``vars`` argument of :func:`sysconfig.get_paths` " -"instead." -msgstr "" - -#: ../../deprecations/pending-removal-in-3.16.rst:102 -msgid ":mod:`tarfile`:" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.16.rst:104 -msgid "" -"The undocumented and unused :attr:`!TarFile.tarfile` attribute has been " -"deprecated since Python 3.13." -msgstr "" diff --git a/deprecations/pending-removal-in-3.17.po b/deprecations/pending-removal-in-3.17.po deleted file mode 100644 index c496e99c2..000000000 --- a/deprecations/pending-removal-in-3.17.po +++ /dev/null @@ -1,37 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 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.14\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-13 14:21+0000\n" -"PO-Revision-Date: 2025-05-08 06:04+0000\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" -"ja/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#: ../../deprecations/pending-removal-in-3.17.rst:2 -msgid "Pending removal in Python 3.17" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.17.rst:4 -msgid ":mod:`typing`:" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.17.rst:6 -msgid "" -"Before Python 3.14, old-style unions were implemented using the private " -"class ``typing._UnionGenericAlias``. This class is no longer needed for the " -"implementation, but it has been retained for backward compatibility, with " -"removal scheduled for Python 3.17. Users should use documented introspection " -"helpers like :func:`typing.get_origin` and :func:`typing.get_args` instead " -"of relying on private implementation details." -msgstr "" diff --git a/deprecations/pending-removal-in-3.19.po b/deprecations/pending-removal-in-3.19.po deleted file mode 100644 index 6d5fd0c7a..000000000 --- a/deprecations/pending-removal-in-3.19.po +++ /dev/null @@ -1,34 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 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.14\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-13 14:21+0000\n" -"PO-Revision-Date: 2025-05-08 06:04+0000\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" -"ja/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#: ../../deprecations/pending-removal-in-3.19.rst:2 -msgid "Pending removal in Python 3.19" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.19.rst:4 -msgid ":mod:`ctypes`:" -msgstr "" - -#: ../../deprecations/pending-removal-in-3.19.rst:6 -msgid "" -"Implicitly switching to the MSVC-compatible struct layout by setting :attr:" -"`~ctypes.Structure._pack_` but not :attr:`~ctypes.Structure._layout_` on non-" -"Windows platforms." -msgstr "" diff --git a/deprecations/pending-removal-in-future.po b/deprecations/pending-removal-in-future.po deleted file mode 100644 index 73713185b..000000000 --- a/deprecations/pending-removal-in-future.po +++ /dev/null @@ -1,388 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 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.14\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-13 14:21+0000\n" -"PO-Revision-Date: 2024-07-20 00:54+0000\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" -"ja/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#: ../../deprecations/pending-removal-in-future.rst:2 -msgid "Pending removal in future versions" -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:4 -msgid "" -"The following APIs will be removed in the future, although there is " -"currently no date scheduled for their removal." -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:7 -msgid ":mod:`argparse`:" -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:9 -msgid "" -"Nesting argument groups and nesting mutually exclusive groups are deprecated." -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:11 -msgid "" -"Passing the undocumented keyword argument *prefix_chars* to :meth:`~argparse." -"ArgumentParser.add_argument_group` is now deprecated." -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:14 -msgid "The :class:`argparse.FileType` type converter is deprecated." -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:16 -msgid ":mod:`builtins`:" -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:18 -msgid "``bool(NotImplemented)``." -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:19 -msgid "" -"Generators: ``throw(type, exc, tb)`` and ``athrow(type, exc, tb)`` signature " -"is deprecated: use ``throw(exc)`` and ``athrow(exc)`` instead, the single " -"argument signature." -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:22 -msgid "" -"Currently Python accepts numeric literals immediately followed by keywords, " -"for example ``0in x``, ``1or x``, ``0if 1else 2``. It allows confusing and " -"ambiguous expressions like ``[0x1for x in y]`` (which can be interpreted as " -"``[0x1 for x in y]`` or ``[0x1f or x in y]``). A syntax warning is raised " -"if the numeric literal is immediately followed by one of keywords :keyword:" -"`and`, :keyword:`else`, :keyword:`for`, :keyword:`if`, :keyword:`in`, :" -"keyword:`is` and :keyword:`or`. In a future release it will be changed to a " -"syntax error. (:gh:`87999`)" -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:30 -msgid "" -"Support for ``__index__()`` and ``__int__()`` method returning non-int type: " -"these methods will be required to return an instance of a strict subclass " -"of :class:`int`." -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:33 -msgid "" -"Support for ``__float__()`` method returning a strict subclass of :class:" -"`float`: these methods will be required to return an instance of :class:" -"`float`." -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:36 -msgid "" -"Support for ``__complex__()`` method returning a strict subclass of :class:" -"`complex`: these methods will be required to return an instance of :class:" -"`complex`." -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:39 -msgid "Delegation of ``int()`` to ``__trunc__()`` method." -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:40 -msgid "" -"Passing a complex number as the *real* or *imag* argument in the :func:" -"`complex` constructor is now deprecated; it should only be passed as a " -"single positional argument. (Contributed by Serhiy Storchaka in :gh:" -"`109218`.)" -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:45 -msgid "" -":mod:`calendar`: ``calendar.January`` and ``calendar.February`` constants " -"are deprecated and replaced by :data:`calendar.JANUARY` and :data:`calendar." -"FEBRUARY`. (Contributed by Prince Roshan in :gh:`103636`.)" -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:50 -msgid "" -":mod:`codecs`: use :func:`open` instead of :func:`codecs.open`. (:gh:" -"`133038`)" -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:52 -msgid "" -":attr:`codeobject.co_lnotab`: use the :meth:`codeobject.co_lines` method " -"instead." -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:55 -msgid ":mod:`datetime`:" -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:57 -msgid "" -":meth:`~datetime.datetime.utcnow`: use ``datetime.datetime.now(tz=datetime." -"UTC)``." -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:59 -msgid "" -":meth:`~datetime.datetime.utcfromtimestamp`: use ``datetime.datetime." -"fromtimestamp(timestamp, tz=datetime.UTC)``." -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:62 -msgid ":mod:`gettext`: Plural value must be an integer." -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:64 -msgid ":mod:`importlib`:" -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:66 -msgid "" -":func:`~importlib.util.cache_from_source` *debug_override* parameter is " -"deprecated: use the *optimization* parameter instead." -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:69 -msgid ":mod:`importlib.metadata`:" -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:71 -msgid "``EntryPoints`` tuple interface." -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:72 -msgid "Implicit ``None`` on return values." -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:74 -msgid "" -":mod:`logging`: the ``warn()`` method has been deprecated since Python 3.3, " -"use :meth:`~logging.warning` instead." -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:77 -msgid "" -":mod:`mailbox`: Use of StringIO input and text mode is deprecated, use " -"BytesIO and binary mode instead." -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:80 -msgid "" -":mod:`os`: Calling :func:`os.register_at_fork` in multi-threaded process." -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:82 -msgid "" -":class:`!pydoc.ErrorDuringImport`: A tuple value for *exc_info* parameter is " -"deprecated, use an exception instance." -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:85 -msgid "" -":mod:`re`: More strict rules are now applied for numerical group references " -"and group names in regular expressions. Only sequence of ASCII digits is " -"now accepted as a numerical reference. The group name in bytes patterns and " -"replacement strings can now only contain ASCII letters and digits and " -"underscore. (Contributed by Serhiy Storchaka in :gh:`91760`.)" -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:92 -msgid "" -":mod:`!sre_compile`, :mod:`!sre_constants` and :mod:`!sre_parse` modules." -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:94 -msgid "" -":mod:`shutil`: :func:`~shutil.rmtree`'s *onerror* parameter is deprecated in " -"Python 3.12; use the *onexc* parameter instead." -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:97 -msgid ":mod:`ssl` options and protocols:" -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:99 -msgid ":class:`ssl.SSLContext` without protocol argument is deprecated." -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:100 -msgid "" -":class:`ssl.SSLContext`: :meth:`~ssl.SSLContext.set_npn_protocols` and :meth:" -"`!selected_npn_protocol` are deprecated: use ALPN instead." -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:103 -msgid "``ssl.OP_NO_SSL*`` options" -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:104 -msgid "``ssl.OP_NO_TLS*`` options" -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:105 -msgid "``ssl.PROTOCOL_SSLv3``" -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:106 -msgid "``ssl.PROTOCOL_TLS``" -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:107 -msgid "``ssl.PROTOCOL_TLSv1``" -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:108 -msgid "``ssl.PROTOCOL_TLSv1_1``" -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:109 -msgid "``ssl.PROTOCOL_TLSv1_2``" -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:110 -msgid "``ssl.TLSVersion.SSLv3``" -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:111 -msgid "``ssl.TLSVersion.TLSv1``" -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:112 -msgid "``ssl.TLSVersion.TLSv1_1``" -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:114 -msgid ":mod:`threading` methods:" -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:116 -msgid "" -":meth:`!threading.Condition.notifyAll`: use :meth:`~threading.Condition." -"notify_all`." -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:117 -msgid ":meth:`!threading.Event.isSet`: use :meth:`~threading.Event.is_set`." -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:118 -msgid "" -":meth:`!threading.Thread.isDaemon`, :meth:`threading.Thread.setDaemon`: use :" -"attr:`threading.Thread.daemon` attribute." -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:120 -msgid "" -":meth:`!threading.Thread.getName`, :meth:`threading.Thread.setName`: use :" -"attr:`threading.Thread.name` attribute." -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:122 -msgid ":meth:`!threading.currentThread`: use :meth:`threading.current_thread`." -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:123 -msgid ":meth:`!threading.activeCount`: use :meth:`threading.active_count`." -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:125 -msgid ":class:`typing.Text` (:gh:`92332`)." -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:127 -msgid "" -"The internal class ``typing._UnionGenericAlias`` is no longer used to " -"implement :class:`typing.Union`. To preserve compatibility with users using " -"this private class, a compatibility shim will be provided until at least " -"Python 3.17. (Contributed by Jelle Zijlstra in :gh:`105499`.)" -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:132 -msgid "" -":class:`unittest.IsolatedAsyncioTestCase`: it is deprecated to return a " -"value that is not ``None`` from a test case." -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:135 -msgid "" -":mod:`urllib.parse` deprecated functions: :func:`~urllib.parse.urlparse` " -"instead" -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:137 -msgid "``splitattr()``" -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:138 -msgid "``splithost()``" -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:139 -msgid "``splitnport()``" -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:140 -msgid "``splitpasswd()``" -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:141 -msgid "``splitport()``" -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:142 -msgid "``splitquery()``" -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:143 -msgid "``splittag()``" -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:144 -msgid "``splittype()``" -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:145 -msgid "``splituser()``" -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:146 -msgid "``splitvalue()``" -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:147 -msgid "``to_bytes()``" -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:149 -msgid "" -":mod:`wsgiref`: ``SimpleHandler.stdout.write()`` should not do partial " -"writes." -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:152 -msgid "" -":mod:`xml.etree.ElementTree`: Testing the truth value of an :class:`~xml." -"etree.ElementTree.Element` is deprecated. In a future release it will always " -"return ``True``. Prefer explicit ``len(elem)`` or ``elem is not None`` tests " -"instead." -msgstr "" - -#: ../../deprecations/pending-removal-in-future.rst:157 -msgid "" -":func:`sys._clear_type_cache` is deprecated: use :func:`sys." -"_clear_internal_caches` instead." -msgstr "" diff --git a/distributing/index.po b/distributing/index.po index 0618b5abb..9faea264e 100644 --- a/distributing/index.po +++ b/distributing/index.po @@ -1,38 +1,346 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 -# TENMYO Masakazu, 2024 +# NOZOMI KAWAMOTO <73circumference14@gmail.com>, 2017 +# mnamihdk, 2017 +# Yuto Horiuchi , 2017 +# Shun Sakurai, 2017 +# 秘湯 , 2017 +# Inada Naoki , 2017 +# uehara , 2018 +# tomo, 2020 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-06 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:50+0000\n" -"Last-Translator: TENMYO Masakazu, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 17:40+0000\n" +"Last-Translator: tomo, 2020\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: ../../distributing/index.rst:10 +#: ../../distributing/index.rst:5 msgid "Distributing Python Modules" msgstr "Python モジュールの配布" +#: ../../distributing/index.rst:0 +msgid "Email" +msgstr "Email" + +#: ../../distributing/index.rst:7 +msgid "distutils-sig@python.org" +msgstr "distutils-sig@python.org" + +#: ../../distributing/index.rst:10 +msgid "" +"As a popular open source development project, Python has an active " +"supporting community of contributors and users that also make their software " +"available for other Python developers to use under open source license terms." +msgstr "" +"人気のあるオープンソース開発プロジェクトがそうであるように、Python には貢献者" +"たちとユーザたちの活発なサポートコミュニティがあり、またこれらはほかの " +"Python 開発者たちに、彼らのソフトウェアのオープンソースライセンスのもとでの利" +"用も可能にしてくれています。" + #: ../../distributing/index.rst:14 msgid "" -"Information and guidance on distributing Python modules and packages has " -"been moved to the `Python Packaging User Guide`_, and the tutorial on " -"`packaging Python projects`_." +"This allows Python users to share and collaborate effectively, benefiting " +"from the solutions others have already created to common (and sometimes even " +"rare!) problems, as well as potentially contributing their own solutions to " +"the common pool." +msgstr "" +"これはほかの人が既に挙げた共通の(あるいは時折極めて稀有な!)問題や、彼ら自身の" +"解法による潜在的な貢献が共通の場所に蓄えられることによる恩恵によって、Python " +"ユーザに共有と協調を効果的に行なうことの助けとなっています。" + +#: ../../distributing/index.rst:19 +msgid "" +"This guide covers the distribution part of the process. For a guide to " +"installing other Python projects, refer to the :ref:`installation guide " +"`." +msgstr "" +"このガイドはこれらプロセスのうち、配布についてをカバーします。ほかの Python " +"プロジェクトをインストールするためのガイドについては :ref:`installation " +"guide ` を参照してください。" + +#: ../../distributing/index.rst:25 +msgid "" +"For corporate and other institutional users, be aware that many " +"organisations have their own policies around using and contributing to open " +"source software. Please take such policies into account when making use of " +"the distribution and installation tools provided with Python." +msgstr "" +"あなたが企業や組織のユーザであれば、多くの組織がオープンソースソフトウェアの" +"利用と貢献に関する彼ら独自のポリシーを持っていることに気をつけてください。" +"Python によって提供される配布とインストールのツールを利用する際には、そのよう" +"なポリシーを考慮に入れてください。" + +#: ../../distributing/index.rst:32 +msgid "Key terms" +msgstr "重要用語集" + +#: ../../distributing/index.rst:34 +msgid "" +"the `Python Packaging Index `__ is a public repository of " +"open source licensed packages made available for use by other Python users" +msgstr "" +"`Python Packaging Index `__ は Python パッケージのパブリッ" +"ク・リポジトリです。このリポジトリのパッケージは、他の Python ユーザが利用で" +"きるように、オープンソースでライセンスされています。" + +#: ../../distributing/index.rst:37 +msgid "" +"the `Python Packaging Authority `__ are the group of " +"developers and documentation authors responsible for the maintenance and " +"evolution of the standard packaging tools and the associated metadata and " +"file format standards. They maintain a variety of tools, documentation and " +"issue trackers on both `GitHub `__ and `Bitbucket " +"`__." +msgstr "" +"`Python Packaging Authority `__ は、標準のパッケージン" +"グツール、関連するメタデータとファイルフォーマット標準の保守と発展を担ってい" +"る、開発者・ドキュメントの著者のグループです。彼らは様々なツールやドキュメン" +"ト、issue tracker を `GitHub `__ と `Bitbucket " +"`__ の両方で管理しています。" + +#: ../../distributing/index.rst:44 +msgid "" +":mod:`distutils` is the original build and distribution system first added " +"to the Python standard library in 1998. While direct use of :mod:`distutils` " +"is being phased out, it still laid the foundation for the current packaging " +"and distribution infrastructure, and it not only remains part of the " +"standard library, but its name lives on in other ways (such as the name of " +"the mailing list used to coordinate Python packaging standards development)." +msgstr "" +":mod:`distutils` はオリジナルのビルド・配布システムで、 Python 標準ライブラリ" +"に 1998 年に最初に追加されました。 :mod:`distutils` の直接的な利用は段階的に" +"取り払われていきますが、それは今でも現時点でのパッケージングと配布のインフラ" +"ストラクチャの基礎として鎮座していて、標準ライブラリの一部として残っているだ" +"けでなく、その名前はほかの文脈でも生き続けています(Python のパッケージング標" +"準の開発をまとめるのに使われているメーリングリストの名前のように)。" + +#: ../../distributing/index.rst:51 +msgid "" +"`setuptools`_ is a (largely) drop-in replacement for :mod:`distutils` first " +"published in 2004. Its most notable addition over the unmodified :mod:" +"`distutils` tools was the ability to declare dependencies on other packages. " +"It is currently recommended as a more regularly updated alternative to :mod:" +"`distutils` that offers consistent support for more recent packaging " +"standards across a wide range of Python versions." +msgstr "" +"`setuptools`_ は :mod:`distutils` (の大部分)をまるごと置き換える後継プロジェ" +"クトで、2004 年に最初に公開されました。未修正の :mod:`distutils` ツールに比べ" +"て、他のパッケージへの依存関係を宣言できる機能が追加されたことが最も注目に値" +"します。今では :mod:`distutils` よりも定期的に更新される代替品として推奨され" +"ていて、広範囲の Python バージョンに渡るより新しいパッケージングの標準を一貫" +"してサポートしています。" + +#: ../../distributing/index.rst:57 +msgid "" +"`wheel`_ (in this context) is a project that adds the ``bdist_wheel`` " +"command to :mod:`distutils`/`setuptools`_. This produces a cross platform " +"binary packaging format (called \"wheels\" or \"wheel files\" and defined " +"in :pep:`427`) that allows Python libraries, even those including binary " +"extensions, to be installed on a system without needing to be built locally." +msgstr "" +"`wheel`_ は (このドキュメントの文脈では) :mod:`distutils`/`setuptools`_ に " +"``bdist_wheel`` コマンドを追加するプロジェクトです。これは、それがバイナリの" +"拡張を含んでいようと、Python ライブラリをローカルでビルドする必要性なしでシス" +"テムにインストール出来るようにする、クロスプラットフォームのバイナリのパッ" +"ケージング形式(\"wheels\" または \"wheel files\" と呼ばれ、 :pep:`427` で定義" +"されています)を生成します。" + +#: ../../distributing/index.rst:68 +msgid "Open source licensing and collaboration" +msgstr "オープンソースライセンス化とコラボレーション" + +#: ../../distributing/index.rst:70 +msgid "" +"In most parts of the world, software is automatically covered by copyright. " +"This means that other developers require explicit permission to copy, use, " +"modify and redistribute the software." +msgstr "" +"世界のほとんどの国では、ソフトウェアは自動的に著作権保護の対象となります。こ" +"れが意味するのは、ほかの開発者はそのソフトウェアに関する複製、使用、修正と配" +"布に対して、明示的な許諾を必要とする、ということです。" + +#: ../../distributing/index.rst:74 +msgid "" +"Open source licensing is a way of explicitly granting such permission in a " +"relatively consistent way, allowing developers to share and collaborate " +"efficiently by making common solutions to various problems freely available. " +"This leaves many developers free to spend more time focusing on the problems " +"that are relatively unique to their specific situation." +msgstr "" +"オープンソースライセンス化は、比較的矛盾のなく明示的にそのような権限を許可す" +"る方法です。さまざまな問題に対する共通の解法をいつでも利用可能にすることで、" +"開発者に共有と協調を効率的に行うことを可能にしています。これは多くの開発者" +"に、彼ら固有の状況での比較的特異な問題により多くの時間をかけて集中することを" +"可能にしてくれています。" + +#: ../../distributing/index.rst:80 +msgid "" +"The distribution tools provided with Python are designed to make it " +"reasonably straightforward for developers to make their own contributions " +"back to that common pool of software if they choose to do so." +msgstr "" +"Python によって提供される配布ツールは、開発者にとってそれなりに単純で理解しや" +"すいようにデザインされているため、開発者がそう望む場合、自身の貢献をソフト" +"ウェアのその共通の蓄積場所に還元できます。" + +#: ../../distributing/index.rst:84 +msgid "" +"The same distribution tools can also be used to distribute software within " +"an organisation, regardless of whether that software is published as open " +"source software or not." +msgstr "" +"それがオープンソースとして公開されているかどうかによらず、同じ配布ツールを組" +"織内のソフトウェア配布に使うことも出来ます。" + +#: ../../distributing/index.rst:90 +msgid "Installing the tools" +msgstr "ツールのインストール" + +#: ../../distributing/index.rst:92 +msgid "" +"The standard library does not include build tools that support modern Python " +"packaging standards, as the core development team has found that it is " +"important to have standard tools that work consistently, even on older " +"versions of Python." +msgstr "" +"コア開発チームは、古いバージョンの Python に対してでさえも一貫して動作する標" +"準ツールを持つことが重要だということを理解したため、標準ライブラリには、モダ" +"ンな Python パッケージング標準をサポートするビルドツールは含まれていません。" + +#: ../../distributing/index.rst:97 +msgid "" +"The currently recommended build and distribution tools can be installed by " +"invoking the ``pip`` module at the command line::" +msgstr "" +"現在のところのビルド・配布の推奨ツールは ``pip`` モジュールをコマンドラインか" +"ら呼び出すことでインストール出来ます::" + +#: ../../distributing/index.rst:104 +msgid "" +"For POSIX users (including Mac OS X and Linux users), these instructions " +"assume the use of a :term:`virtual environment`." +msgstr "" +"POSIX ユーザ(Max OS X と Linux ユーザを含みます)向けには、このガイド内の指示" +"は、 :term:`virtual environment` の利用を前提にしています。" + +#: ../../distributing/index.rst:107 +msgid "" +"For Windows users, these instructions assume that the option to adjust the " +"system PATH environment variable was selected when installing Python." +msgstr "" +"Windows ユーザ向けには、このガイド内の指示は、Python インストール時にシステム" +"の PATH 環境変数が調整されていることを前提にしています。" + +#: ../../distributing/index.rst:111 +msgid "" +"The Python Packaging User Guide includes more details on the `currently " +"recommended tools`_." +msgstr "" +"Python Packaging User Guide にはさらに詳しい情報 `currently recommended " +"tools`_ があります。" + +#: ../../distributing/index.rst:123 +msgid "Reading the Python Packaging User Guide" +msgstr "Python Packaging User Guide を読む" + +#: ../../distributing/index.rst:125 +msgid "" +"The Python Packaging User Guide covers the various key steps and elements " +"involved in creating and publishing a project:" +msgstr "" +"Python Packaging User Guide は、プロジェクトの作成と配布に関わる様々な鍵とな" +"るステップと要素をカバーしています。" + +#: ../../distributing/index.rst:128 +msgid "`Project structure`_" +msgstr "`Project structure`_" + +#: ../../distributing/index.rst:129 +msgid "`Building and packaging the project`_" +msgstr "`Building and packaging the project`_" + +#: ../../distributing/index.rst:130 +msgid "`Uploading the project to the Python Packaging Index`_" +msgstr "`Uploading the project to the Python Packaging Index`_" + +#: ../../distributing/index.rst:131 +msgid "`The .pypirc file`_" +msgstr "`.pypirc file`_" + +#: ../../distributing/index.rst:144 +msgid "How do I...?" +msgstr "どうすればいいの...?" + +#: ../../distributing/index.rst:146 +msgid "These are quick answers or links for some common tasks." +msgstr "以下はよくある課題への簡単な回答もしくは回答へのリンクです。" + +#: ../../distributing/index.rst:149 +msgid "... choose a name for my project?" +msgstr "... 私のプロジェクトの名前はどう選べばいいですか?" + +#: ../../distributing/index.rst:151 +msgid "This isn't an easy topic, but here are a few tips:" +msgstr "簡単なトピックではありませんが、いくつか助言をしておきます:" + +#: ../../distributing/index.rst:153 +msgid "check the Python Packaging Index to see if the name is already in use" +msgstr "Python Packaging Index にその名前が既に使われていないかをチェックする" + +#: ../../distributing/index.rst:154 +msgid "" +"check popular hosting sites like GitHub, Bitbucket, etc to see if there is " +"already a project with that name" +msgstr "" +"GitHub, Bitbucket などのような人気のあるホスティングサイトにその名前が既にい" +"ないかチェックする" + +#: ../../distributing/index.rst:156 +msgid "check what comes up in a web search for the name you're considering" +msgstr "検討している名前の WEB 検索の結果をチェックする" + +#: ../../distributing/index.rst:157 +msgid "" +"avoid particularly common words, especially ones with multiple meanings, as " +"they can make it difficult for users to find your software when searching " +"for it" +msgstr "" +"とりわけ一般的な語、特に多くの意味を持ち、ユーザにあなたのソフトウェアを検索" +"するのを難しくさせるような語を避ける" + +#: ../../distributing/index.rst:163 +msgid "... create and distribute binary extensions?" +msgstr "... バイナリの拡張を作って配布したいのですが?" + +#: ../../distributing/index.rst:165 +msgid "" +"This is actually quite a complex topic, with a variety of alternatives " +"available depending on exactly what you're aiming to achieve. See the Python " +"Packaging User Guide for more information and recommendations." +msgstr "" +"これは大変複雑なトピックで、あなたが何を達成したいのかに完全に依存する、数多" +"くの選択肢があります。Python Packaging User Guide にはもっと詳しい情報と提案" +"がありますので、ご参照ください。" + +#: ../../distributing/index.rst:171 +msgid "" +"`Python Packaging User Guide: Binary Extensions `__" msgstr "" -"Python モジュールとパッケージの配布に関する情報とガイダンスは、 `Python " -"Packaging User Guide`_ に移動されました。 `packaging Python projects`_ には" -"チュートリアルもあります。" +"`Python Packaging User Guide: Binary Extensions `__" diff --git a/distutils/_setuptools_disclaimer.po b/distutils/_setuptools_disclaimer.po index 702badb29..08906ef15 100644 --- a/distutils/_setuptools_disclaimer.po +++ b/distutils/_setuptools_disclaimer.po @@ -1,20 +1,20 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2023, Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 +# tomo, 2019 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-19 14:13+0000\n" -"PO-Revision-Date: 2021-06-28 00:51+0000\n" -"Last-Translator: tomo, 2021\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2019-09-01 14:28+0000\n" +"Last-Translator: tomo, 2019\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" "Language: ja\n" "MIME-Version: 1.0\n" diff --git a/distutils/apiref.po b/distutils/apiref.po index 2e2652469..c9d0bd1b7 100644 --- a/distutils/apiref.po +++ b/distutils/apiref.po @@ -1,25 +1,27 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2023, Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# mollinaca, 2021 -# tomo, 2021 -# Takeshi Nakazato, 2021 -# 菊池 健志, 2023 -# Arihiro TAKASE, 2023 -# Transifex Bot <>, 2023 +# Inada Naoki , 2017 +# E. Kawashima, 2017 +# Shun Sakurai, 2017 +# Nozomu Kaneko , 2017 +# Arihiro TAKASE, 2017 +# 秘湯 , 2017 +# tomo, 2019 +# mollinaca, 2020 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-19 14:13+0000\n" -"PO-Revision-Date: 2021-06-28 00:51+0000\n" -"Last-Translator: Transifex Bot <>, 2023\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 17:40+0000\n" +"Last-Translator: mollinaca, 2020\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" "Language: ja\n" "MIME-Version: 1.0\n" @@ -383,7 +385,7 @@ msgstr "" "は:" #: ../../distutils/apiref.rst:143 ../../distutils/apiref.rst:562 -#: ../../distutils/apiref.rst:1606 +#: ../../distutils/apiref.rst:1601 msgid "description" msgstr "description" @@ -682,9 +684,9 @@ msgid "" "See the :func:`setup` function for a list of keyword arguments accepted by " "the Distribution constructor. :func:`setup` creates a Distribution instance." msgstr "" -"Distribution のコンストラクタが取りうるキーワード引数のリストに関しては、 :" -"func:`setup` 関数を見てください。 :func:`setup` は Distribution のインスタン" -"スを作ります。" +":class:`Distribution` のコンストラクタが取りうるキーワード引数のリストに関し" +"ては、 :func:`setup` 関数を見てください。 :func:`setup` は :class:" +"`Distribution` のインスタンスを作ります。" #: ../../distutils/apiref.rst:304 msgid "" @@ -1624,8 +1626,8 @@ msgid "" msgstr "" "このモジュールは :class:`CygwinCCompiler` クラスを提供します。 :class:" "`UnixCCompiler` のサブクラスで Cygwinに移植されたWindows用の GNU C コンパイラ" -"向けです。さらに Mingw32CCompiler クラスを含んでおり、これは mingw32 向けに移" -"植された GCC (cygwinの no-cygwin モードと同じ)向けです。" +"向けです。さらに :class:`Mingw32CCompiler` クラスを含んでおり、これは " +"mingw32 向けに移植された GCC (cygwinの no-cygwin モードと同じ)向けです。" #: ../../distutils/apiref.rst:877 msgid ":mod:`distutils.archive_util` --- Archiving utilities" @@ -1847,9 +1849,12 @@ msgstr "" #: ../../distutils/apiref.rst:1022 msgid "" "Files in *src* that begin with :file:`.nfs` are skipped (more information on " -"these files is available in answer D2 of the `NFS FAQ page `_)." msgstr "" +"*src* にあるファイルで :file:`.nfs` から始まるものは対象から外されます (これ" +"らのファイルについての情報は `NFS FAQ page `_ の回答 D2 にあります) 。" #: ../../distutils/apiref.rst:1026 msgid "NFS files are ignored." @@ -1999,17 +2004,17 @@ msgstr "" #: ../../distutils/apiref.rst:1122 msgid "" -"For macOS systems the OS version reflects the minimal version on which " +"For Mac OS X systems the OS version reflects the minimal version on which " "binaries will run (that is, the value of ``MACOSX_DEPLOYMENT_TARGET`` during " "the build of Python), not the OS version of the current system." msgstr "" -"macOS システムでは、 OS バージョンは、現在のOSバージョンではなく、実行するバ" -"イナリの最小バージョンを表しています。 (これは、Python をビルドするときの " +"Mac OS X システムでは、 OS バージョンは、現在のOSバージョンではなく、実行する" +"バイナリの最小バージョンを表しています。 (これは、Python をビルドするときの " "``MACOSX_DEPLOYMENT_TARGET`` の値です。)" #: ../../distutils/apiref.rst:1126 msgid "" -"For universal binary builds on macOS the architecture value reflects the " +"For universal binary builds on Mac OS X the architecture value reflects the " "universal binary status instead of the architecture of the current " "processor. For 32-bit universal binaries the architecture is ``fat``, for 64-" "bit universal binaries the architecture is ``fat64``, and for 4-way " @@ -2018,17 +2023,17 @@ msgid "" "build (ppc, i386, x86_64) and ``intel`` is used for a universal build with " "the i386 and x86_64 architectures" msgstr "" -"macOS のユニバーサルバイナリビルドでは、アーキテクチャの値は現在のプロセッサ" -"ではなく、ユニバーサルバイナリの状態を表しています。32bit ユニバーサルバイナ" -"リではアーキテクチャは ``fat`` で、64bit ユニバーサルバイナリではアーキテク" +"Mac OS X のユニバーサルバイナリビルドでは、アーキテクチャの値は現在のプロセッ" +"サではなく、ユニバーサルバイナリの状態を表しています。32bit ユニバーサルバイ" +"ナリではアーキテクチャは ``fat`` で、64bit ユニバーサルバイナリではアーキテク" "チャは ``fat64`` で、4-way ユニバーサルバイナリではアーキテクチャは " "``universal`` になります。Python 2.7 と Python 3.2 から 3-way ユニバーサルバ" "イナリ (ppc, i386, x86_64) には ``fat3`` が i386 と x86_64 ユニバーサルバイナ" "リには ``intel`` が使われるようになりました" #: ../../distutils/apiref.rst:1135 -msgid "Examples of returned values on macOS:" -msgstr "macOS で返される値の例:" +msgid "Examples of returned values on Mac OS X:" +msgstr "Mac OS X で返される値の例:" #: ../../distutils/apiref.rst:1137 msgid "``macosx-10.3-ppc``" @@ -2056,11 +2061,10 @@ msgid "" "Release." msgstr "" "AIX の場合、 Python 3.9 以降のバージョンでは \"aix\" に続く追加のフィールド " -"(``'-'`` で連結されます) として AIX のバージョン、リリースおよびテクノロ" -"ジー・レベル (第1フィールド)、ビルド作成日 (第2フィールド)、ビットサイズ (第3" -"フィールド) を含む文字列を返します。 Python 3.8 以前のバージョンでは追加の" -"フィールドとして AIX のバージョンとリリース の1つだけを含む文字列を返していま" -"した。" +"(``'-'``で連結されます) として AIX のバージョン、リリースおよびテクノロジー・" +"レベル (第1フィールド)、ビルド作成日 (第2フィールド)、ビットサイズ (第3フィー" +"ルド) を含む文字列を返します。 Python 3.8 以前のバージョンでは追加のフィール" +"ドとして AIX のバージョンとリリース の1つだけを含む文字列を返していました。" #: ../../distutils/apiref.rst:1151 msgid "Examples of returned values on AIX:" @@ -2158,7 +2162,7 @@ msgstr "" #: ../../distutils/apiref.rst:1201 msgid "" -"Note that this is not a full-fledged string interpolation function. A valid " +"Note that this is not a fully-fledged string interpolation function. A valid " "``$variable`` can consist only of upper and lower case letters, numbers and " "an underscore. No { } or ( ) style quoting is available." msgstr "" @@ -2528,11 +2532,7 @@ msgstr "" msgid ":mod:`distutils.sysconfig` --- System configuration information" msgstr ":mod:`distutils.sysconfig` --- システム設定情報" -#: ../../distutils/apiref.rst:1455 -msgid ":mod:`distutils.sysconfig` has been merged into :mod:`sysconfig`." -msgstr "" - -#: ../../distutils/apiref.rst:1462 +#: ../../distutils/apiref.rst:1460 msgid "" "The :mod:`distutils.sysconfig` module provides access to Python's low-level " "configuration information. The specific configuration variables available " @@ -2551,7 +2551,7 @@ msgstr "" "ます。設定ファイルのヘッダは、2.2 以降のバージョンでは :file:`pyconfig.h` 、" "それ以前のバージョンでは :file:`config.h` です。" -#: ../../distutils/apiref.rst:1471 +#: ../../distutils/apiref.rst:1469 msgid "" "Some additional functions are provided which perform some useful " "manipulations for other parts of the :mod:`distutils` package." @@ -2559,15 +2559,15 @@ msgstr "" "他にも、 :mod:`distutils` パッケージの別の部分を操作する上で便利な関数がいく" "つか提供されています。" -#: ../../distutils/apiref.rst:1477 +#: ../../distutils/apiref.rst:1475 msgid "The result of ``os.path.normpath(sys.prefix)``." msgstr "``os.path.normpath(sys.prefix)`` の返り値です。" -#: ../../distutils/apiref.rst:1482 +#: ../../distutils/apiref.rst:1480 msgid "The result of ``os.path.normpath(sys.exec_prefix)``." msgstr "``os.path.normpath(sys.exec_prefix)`` の返り値です。" -#: ../../distutils/apiref.rst:1487 +#: ../../distutils/apiref.rst:1485 msgid "" "Return the value of a single variable. This is equivalent to " "``get_config_vars().get(name)``." @@ -2575,7 +2575,7 @@ msgstr "" "ある一つの設定変数に対する値を返します。 ``get_config_vars().get(name)`` と同" "じです。" -#: ../../distutils/apiref.rst:1493 +#: ../../distutils/apiref.rst:1491 msgid "" "Return a set of variable definitions. If there are no arguments, this " "returns a dictionary mapping names of configuration variables to values. If " @@ -2589,7 +2589,7 @@ msgstr "" "になります。引数に指定した名前の設定変数に値がない場合、その変数に対する戻り" "値には ``None`` が入ります。" -#: ../../distutils/apiref.rst:1502 +#: ../../distutils/apiref.rst:1500 msgid "" "Return the full path name of the configuration header. For Unix, this will " "be the header generated by the :program:`configure` script; for other " @@ -2601,7 +2601,7 @@ msgstr "" "フォームでは、ヘッダは Python ソース配布物中で直接与えられています。ファイル" "はプラットフォーム固有のテキストファイルです。" -#: ../../distutils/apiref.rst:1510 +#: ../../distutils/apiref.rst:1508 msgid "" "Return the full path name of the :file:`Makefile` used to build Python. For " "Unix, this will be a file generated by the :program:`configure` script; the " @@ -2614,13 +2614,7 @@ msgstr "" "返す場合、ファイルはプラットフォーム固有のテキストファイル形式です。この関数" "は POSIX プラットフォームでのみ有用です。" -#: ../../distutils/apiref.rst:1515 -msgid "" -"The following functions are deprecated together with this module and they " -"have no direct replacement." -msgstr "" - -#: ../../distutils/apiref.rst:1521 +#: ../../distutils/apiref.rst:1516 msgid "" "Return the directory for either the general or platform-dependent C include " "files. If *plat_specific* is true, the platform-dependent include directory " @@ -2637,7 +2631,7 @@ msgstr "" "用いられます。また、 *plat_specific* が真の場合、 :const:`EXEC_PREFIX` の代わ" "りに用いられます。" -#: ../../distutils/apiref.rst:1531 +#: ../../distutils/apiref.rst:1526 msgid "" "Return the directory for either the general or platform-dependent library " "installation. If *plat_specific* is true, the platform-dependent include " @@ -2657,14 +2651,14 @@ msgstr "" "*standard_lib* が真であれば、サードパーティ製の拡張モジュールをインストールす" "るディレクトリの代わりに、標準ライブラリのディレクトリを返します。" -#: ../../distutils/apiref.rst:1540 +#: ../../distutils/apiref.rst:1535 msgid "" "The following function is only intended for use within the :mod:`distutils` " "package." msgstr "" "以下の関数は、 :mod:`distutils` パッケージ内の使用だけを前提にしています。" -#: ../../distutils/apiref.rst:1546 +#: ../../distutils/apiref.rst:1541 msgid "" "Do any platform-specific customization of a :class:`distutils.ccompiler." "CCompiler` instance." @@ -2672,7 +2666,7 @@ msgstr "" ":class:`distutils.ccompiler.CCompiler` インスタンスに対して、プラットフォーム" "固有のカスタマイズを行います。" -#: ../../distutils/apiref.rst:1549 +#: ../../distutils/apiref.rst:1544 msgid "" "This function is only needed on Unix at this time, but should be called " "consistently to support forward-compatibility. It inserts the information " @@ -2686,7 +2680,7 @@ msgstr "" "選択されたコンパイラやコンパイラ/リンカのオプション、そして共有オブジェクトを" "扱うためにリンカに指定する拡張子が含まれます。" -#: ../../distutils/apiref.rst:1555 +#: ../../distutils/apiref.rst:1550 msgid "" "This function is even more special-purpose, and should only be used from " "Python's own build procedures." @@ -2694,7 +2688,7 @@ msgstr "" "この関数はもっと特殊用途向けで、Python 自体のビルドプロセスでのみ使われるべき" "です。" -#: ../../distutils/apiref.rst:1561 +#: ../../distutils/apiref.rst:1556 msgid "" "Inform the :mod:`distutils.sysconfig` module that it is being used as part " "of the build process for Python. This changes a lot of relative locations " @@ -2706,11 +2700,11 @@ msgstr "" "対位置が大幅に変更され、インストール済みの Python ではなく、ビルド作業領域に" "ファイルが置かれるようになります。" -#: ../../distutils/apiref.rst:1568 +#: ../../distutils/apiref.rst:1563 msgid ":mod:`distutils.text_file` --- The TextFile class" msgstr ":mod:`distutils.text_file` --- TextFile クラス" -#: ../../distutils/apiref.rst:1574 +#: ../../distutils/apiref.rst:1569 msgid "" "This module provides the :class:`TextFile` class, which gives an interface " "to text files that (optionally) takes care of stripping comments, ignoring " @@ -2720,7 +2714,7 @@ msgstr "" "へのインターフェースを提供し、コメントの削除、空行の無視、バックスラッシュで" "の行の連結を任意に行えます。" -#: ../../distutils/apiref.rst:1581 +#: ../../distutils/apiref.rst:1576 msgid "" "This class provides a file-like object that takes care of all the things " "you commonly want to do when processing a text file that has some line-by-" @@ -2735,7 +2729,7 @@ msgstr "" "ケープによる行の連結、先頭/末尾の空白文字の削除。これらは全て独立して任意に設" "定できます。" -#: ../../distutils/apiref.rst:1588 +#: ../../distutils/apiref.rst:1583 msgid "" "The class provides a :meth:`warn` method so you can generate warning " "messages that report physical line number, even if the logical line in " @@ -2747,7 +2741,7 @@ msgstr "" "夫です。また :meth:`unreadline` メソッドが一行先読みを実装するために提供され" "ています。" -#: ../../distutils/apiref.rst:1593 +#: ../../distutils/apiref.rst:1588 msgid "" ":class:`TextFile` instances are create with either *filename*, *file*, or " "both. :exc:`RuntimeError` is raised if both are ``None``. *filename* should " @@ -2765,25 +2759,25 @@ msgstr "" "えることが推奨されます、もし *file* が提供されなければ、 :class:`TextFile` は" "組み込みの :func:`open` を利用して自分で作成します。" -#: ../../distutils/apiref.rst:1601 +#: ../../distutils/apiref.rst:1596 msgid "" "The options are all boolean, and affect the values returned by :meth:" "`readline`" msgstr "オプションは全て真偽値で、 :meth:`readline` で返される値に影響します。" -#: ../../distutils/apiref.rst:1606 +#: ../../distutils/apiref.rst:1601 msgid "option name" msgstr "オプション名" -#: ../../distutils/apiref.rst:1606 +#: ../../distutils/apiref.rst:1601 msgid "default" msgstr "default" -#: ../../distutils/apiref.rst:1608 +#: ../../distutils/apiref.rst:1603 msgid "*strip_comments*" msgstr "*strip_comments*" -#: ../../distutils/apiref.rst:1608 +#: ../../distutils/apiref.rst:1603 msgid "" "strip from ``'#'`` to end-of-line, as well as any whitespace leading up to " "the ``'#'``\\ ---unless it is escaped by a backslash" @@ -2791,39 +2785,39 @@ msgstr "" "バックスラッシュでエスケープされていない限り、``'#'`` から行末までと、" "``'#'`` の先にある空白文字の並びを削除します" -#: ../../distutils/apiref.rst:1608 ../../distutils/apiref.rst:1617 -#: ../../distutils/apiref.rst:1622 +#: ../../distutils/apiref.rst:1603 ../../distutils/apiref.rst:1612 +#: ../../distutils/apiref.rst:1617 msgid "true" msgstr "true" -#: ../../distutils/apiref.rst:1614 +#: ../../distutils/apiref.rst:1609 msgid "*lstrip_ws*" msgstr "*lstrip_ws*" -#: ../../distutils/apiref.rst:1614 +#: ../../distutils/apiref.rst:1609 msgid "strip leading whitespace from each line before returning it" msgstr "行を返す前に先頭の空白文字の並びを削除します。" -#: ../../distutils/apiref.rst:1614 ../../distutils/apiref.rst:1632 -#: ../../distutils/apiref.rst:1643 +#: ../../distutils/apiref.rst:1609 ../../distutils/apiref.rst:1627 +#: ../../distutils/apiref.rst:1638 msgid "false" msgstr "false" -#: ../../distutils/apiref.rst:1617 +#: ../../distutils/apiref.rst:1612 msgid "*rstrip_ws*" msgstr "*rstrip_ws*" -#: ../../distutils/apiref.rst:1617 +#: ../../distutils/apiref.rst:1612 msgid "" "strip trailing whitespace (including line terminator!) from each line before " "returning it." msgstr "行を返す前に行末の空白文字(改行文字を含みます!)の並びを削除します。" -#: ../../distutils/apiref.rst:1622 +#: ../../distutils/apiref.rst:1617 msgid "*skip_blanks*" msgstr "*skip_blanks*" -#: ../../distutils/apiref.rst:1622 +#: ../../distutils/apiref.rst:1617 msgid "" "skip lines that are empty \\*after\\* stripping comments and whitespace. " "(If both lstrip_ws and rstrip_ws are false, then some lines may consist of " @@ -2834,11 +2828,11 @@ msgstr "" "lstrip_ws と rstrip_ws がともに偽なら、空白文字だけの行があるかもしれません。" "これは *skip_blanks* が真でない限りスキップされません。)" -#: ../../distutils/apiref.rst:1632 +#: ../../distutils/apiref.rst:1627 msgid "*join_lines*" msgstr "*join_lines*" -#: ../../distutils/apiref.rst:1632 +#: ../../distutils/apiref.rst:1627 msgid "" "if a backslash is the last non-newline character on a line after stripping " "comments and whitespace, join the following line to it to form one logical " @@ -2849,11 +2843,11 @@ msgstr "" "い文字なら、次の行を接続して一つの論理行とします: N行の連続した行がバックス" "ラッシュで終わる場合、N+1 行の物理行が1行の論理行として扱われます。" -#: ../../distutils/apiref.rst:1643 +#: ../../distutils/apiref.rst:1638 msgid "*collapse_join*" msgstr "*collapse_join*" -#: ../../distutils/apiref.rst:1643 +#: ../../distutils/apiref.rst:1638 msgid "" "strip leading whitespace from lines that are joined to their predecessor; " "only matters if ``(join_lines and not lstrip_ws)``" @@ -2861,7 +2855,7 @@ msgstr "" "前の行と接続するとき、行頭の空白文字を削除します。 ``(join_lines and not " "lstrip_ws)`` の時だけ意味をもちます。" -#: ../../distutils/apiref.rst:1650 +#: ../../distutils/apiref.rst:1645 msgid "" "Note that since *rstrip_ws* can strip the trailing newline, the semantics " "of :meth:`readline` must differ from those of the built-in file object's :" @@ -2875,7 +2869,7 @@ msgstr "" "ファイルの終端で ``None`` を返し、空文字列を返したときは空行(または全て空白文" "字の行)です。" -#: ../../distutils/apiref.rst:1659 +#: ../../distutils/apiref.rst:1654 msgid "" "Open a new file *filename*. This overrides any *file* or *filename* " "constructor arguments." @@ -2883,7 +2877,7 @@ msgstr "" "新しいファイル *filename* を開きます。これはコンストラクタ引数の *file* と " "*filename* を上書きします。" -#: ../../distutils/apiref.rst:1665 +#: ../../distutils/apiref.rst:1660 msgid "" "Close the current file and forget everything we know about it (including the " "filename and the current line number)." @@ -2891,7 +2885,7 @@ msgstr "" "現在のファイルを閉じ、(ファイル名や現在の行番号を含め)現在のファイルについて" "の情報を全て消します。" -#: ../../distutils/apiref.rst:1671 +#: ../../distutils/apiref.rst:1666 msgid "" "Print (to stderr) a warning message tied to the current logical line in the " "current file. If the current logical line in the file spans multiple " @@ -2906,7 +2900,7 @@ msgstr "" "の行番号を上書きします; 物理行のレンジをあらわすリストまたはタプル、もしくは" "ある物理行をあらわす整数のどれでも与えられます。" -#: ../../distutils/apiref.rst:1681 +#: ../../distutils/apiref.rst:1676 msgid "" "Read and return a single logical line from the current file (or from an " "internal buffer if lines have previously been \"unread\" with :meth:" @@ -2924,7 +2918,7 @@ msgstr "" "度読んだ行についての警告を出します。 *rstrip_ws* が真で、 *strip_blanks* が偽" "のとき空文字列が返るので、ファイルの終端では ``None`` を返します。" -#: ../../distutils/apiref.rst:1692 +#: ../../distutils/apiref.rst:1687 msgid "" "Read and return the list of all logical lines remaining in the current file. " "This updates the current line number to the last line of the file." @@ -2932,7 +2926,7 @@ msgstr "" "現在のファイルで残っている全ての論理行のリストを読み込んで返します。行番号" "を、ファイルの最後の行に更新します。" -#: ../../distutils/apiref.rst:1698 +#: ../../distutils/apiref.rst:1693 msgid "" "Push *line* (a string) onto an internal buffer that will be checked by " "future :meth:`readline` calls. Handy for implementing a parser with line-at-" @@ -2948,19 +2942,19 @@ msgstr "" "されません。もし :meth:`unreadline` を、 :meth:`readline` を呼ぶ前に複数回実" "行すると、最後にunreadした行から返されます。" -#: ../../distutils/apiref.rst:1707 +#: ../../distutils/apiref.rst:1702 msgid ":mod:`distutils.version` --- Version number classes" msgstr ":mod:`distutils.version` --- バージョン番号クラス" -#: ../../distutils/apiref.rst:1722 +#: ../../distutils/apiref.rst:1717 msgid ":mod:`distutils.cmd` --- Abstract base class for Distutils commands" msgstr ":mod:`distutils.cmd` --- Distutils コマンドの抽象クラス" -#: ../../distutils/apiref.rst:1729 +#: ../../distutils/apiref.rst:1724 msgid "This module supplies the abstract base class :class:`Command`." msgstr "このモジュールは抽象ベースクラス :class:`Command` を提供します。" -#: ../../distutils/apiref.rst:1734 +#: ../../distutils/apiref.rst:1729 msgid "" "Abstract base class for defining command classes, the \"worker bees\" of the " "Distutils. A useful analogy for command classes is to think of them as " @@ -2986,7 +2980,7 @@ msgstr "" "の本体は全ての処理をオプションの値にもとづいて行う :meth:`run` メソッドで、こ" "れも全てのコマンドクラスで実装される必要があります。" -#: ../../distutils/apiref.rst:1747 +#: ../../distutils/apiref.rst:1742 msgid "" "The class constructor takes a single argument *dist*, a :class:`~distutils." "core.Distribution` instance." @@ -2994,16 +2988,16 @@ msgstr "" "このクラスのコンストラクタは、 :class:`~distutils.core.Distribution` インスタ" "ンス *dist* 1 つを引数に取ります。" -#: ../../distutils/apiref.rst:1752 +#: ../../distutils/apiref.rst:1747 msgid "Creating a new Distutils command" msgstr "新しいDistutilsコマンドの作成" -#: ../../distutils/apiref.rst:1754 +#: ../../distutils/apiref.rst:1749 msgid "This section outlines the steps to create a new Distutils command." msgstr "" "このセクションではDistutilsの新しいコマンドを作成する手順の概要をしめします。" -#: ../../distutils/apiref.rst:1756 +#: ../../distutils/apiref.rst:1751 msgid "" "A new command lives in a module in the :mod:`distutils.command` package. " "There is a sample template in that directory called :file:" @@ -3025,12 +3019,12 @@ msgstr "" "class:`distutils.cmd.Command` のサブクラス :class:`peel_banana` クラスを実装" "するように編集してください。" -#: ../../distutils/apiref.rst:1766 +#: ../../distutils/apiref.rst:1761 msgid "Subclasses of :class:`Command` must define the following methods." msgstr "" ":class:`Command` のサブクラスは以下のメソッドを実装する必要があります。" -#: ../../distutils/apiref.rst:1770 +#: ../../distutils/apiref.rst:1765 msgid "" "Set default values for all the options that this command supports. Note " "that these defaults may be overridden by other commands, by the setup " @@ -3045,7 +3039,7 @@ msgstr "" "するには適切な場所ではありません。一般的に :meth:`initialize_options` は単に " "``self.foo = None`` のような定義だけを行います。" -#: ../../distutils/apiref.rst:1779 +#: ../../distutils/apiref.rst:1774 msgid "" "Set final values for all the options that this command supports. This is " "always called as late as possible, ie. after any option assignments from " @@ -3061,7 +3055,7 @@ msgstr "" "meth:`initialize_options` で定義された値のままなら、 *foo* を *bar* から代入" "しても安全です。" -#: ../../distutils/apiref.rst:1789 +#: ../../distutils/apiref.rst:1784 msgid "" "A command's raison d'etre: carry out the action it exists to perform, " "controlled by the options initialized in :meth:`initialize_options`, " @@ -3075,7 +3069,7 @@ msgstr "" "設定されたオプションがアクションを制御します。端末への出力とファイルシステム" "とのやりとりは全て :meth:`run` が行います。" -#: ../../distutils/apiref.rst:1798 +#: ../../distutils/apiref.rst:1793 msgid "" "*sub_commands* formalizes the notion of a \"family\" of commands, e.g. " "``install`` as the parent with sub-commands ``install_lib``, " @@ -3098,7 +3092,7 @@ msgstr "" "ルするべき Cヘッダファイルがある時だけ有効です。) もし *predicate* が None な" "ら、そのコマンドは常に有効になります。" -#: ../../distutils/apiref.rst:1809 +#: ../../distutils/apiref.rst:1804 msgid "" "*sub_commands* is usually defined at the *end* of a class, because " "predicates can be methods of the class, so they must already have been " @@ -3108,25 +3102,52 @@ msgstr "" "bound されていないメソッドになるので、全て先に定義されている必要があるためで" "す。標準的な例は :command:`install` コマンドです。" -#: ../../distutils/apiref.rst:1815 +#: ../../distutils/apiref.rst:1810 msgid ":mod:`distutils.command` --- Individual Distutils commands" msgstr ":mod:`distutils.command` --- Distutils 各コマンド" -#: ../../distutils/apiref.rst:1826 +#: ../../distutils/apiref.rst:1821 msgid ":mod:`distutils.command.bdist` --- Build a binary installer" msgstr ":mod:`distutils.command.bdist` --- バイナリインストーラの構築" -#: ../../distutils/apiref.rst:1836 +#: ../../distutils/apiref.rst:1831 msgid "" ":mod:`distutils.command.bdist_packager` --- Abstract base class for packagers" msgstr "" ":mod:`distutils.command.bdist_packager` --- パッケージの抽象ベースクラス" -#: ../../distutils/apiref.rst:1846 +#: ../../distutils/apiref.rst:1841 msgid ":mod:`distutils.command.bdist_dumb` --- Build a \"dumb\" installer" msgstr ":mod:`distutils.command.bdist_dumb` --- \"ダム\"インストーラを構築" -#: ../../distutils/apiref.rst:1856 +#: ../../distutils/apiref.rst:1851 +msgid "" +":mod:`distutils.command.bdist_msi` --- Build a Microsoft Installer binary " +"package" +msgstr "" +":mod:`distutils.command.bdist_msi` --- Microsoft Installer バイナリパッケージ" +"をビルドする" + +#: ../../distutils/apiref.rst:1858 ../../distutils/apiref.rst:1887 +msgid "Use bdist_wheel (wheel packages) instead." +msgstr "bdist_wheel (wheel パッケージ) を代わりに使ってください。" + +#: ../../distutils/apiref.rst:1861 +msgid "Builds a `Windows Installer`_ (.msi) binary package." +msgstr "`Windows Installer`_ (.msi) バイナリパッケージをビルドします。" + +#: ../../distutils/apiref.rst:1865 +msgid "" +"In most cases, the ``bdist_msi`` installer is a better choice than the " +"``bdist_wininst`` installer, because it provides better support for Win64 " +"platforms, allows administrators to perform non-interactive installations, " +"and allows installation through group policies." +msgstr "" +"多くの場合、 ``bdist_msi`` インストーラは Win64 のサポートが優れていて、管理" +"者が非インタラクティブインストールできたり、グループポリシーを利用したインス" +"トールができるので、 ``bdist_wininst`` インストーラよりも良い選択です。" + +#: ../../distutils/apiref.rst:1872 msgid "" ":mod:`distutils.command.bdist_rpm` --- Build a binary distribution as a " "Redhat RPM and SRPM" @@ -3134,32 +3155,36 @@ msgstr "" ":mod:`distutils.command.bdist_rpm` --- Redhat RPMとSRPM形式のバイナリディスト" "リビューションを構築" -#: ../../distutils/apiref.rst:1866 +#: ../../distutils/apiref.rst:1882 +msgid ":mod:`distutils.command.bdist_wininst` --- Build a Windows installer" +msgstr ":mod:`distutils.command.bdist_wininst` --- Windowsインストーラの構築" + +#: ../../distutils/apiref.rst:1895 msgid ":mod:`distutils.command.sdist` --- Build a source distribution" msgstr ":mod:`distutils.command.sdist` --- ソース配布物の構築" -#: ../../distutils/apiref.rst:1876 +#: ../../distutils/apiref.rst:1905 msgid ":mod:`distutils.command.build` --- Build all files of a package" msgstr ":mod:`distutils.command.build` --- パッケージ中の全ファイルを構築" -#: ../../distutils/apiref.rst:1886 +#: ../../distutils/apiref.rst:1915 msgid "" ":mod:`distutils.command.build_clib` --- Build any C libraries in a package" msgstr "" ":mod:`distutils.command.build_clib` --- パッケージ中のCライブラリを構築" -#: ../../distutils/apiref.rst:1896 +#: ../../distutils/apiref.rst:1925 msgid "" ":mod:`distutils.command.build_ext` --- Build any extensions in a package" msgstr ":mod:`distutils.command.build_ext` --- パッケージ中の拡張を構築" -#: ../../distutils/apiref.rst:1906 +#: ../../distutils/apiref.rst:1935 msgid "" ":mod:`distutils.command.build_py` --- Build the .py/.pyc files of a package" msgstr "" ":mod:`distutils.command.build_py` --- パッケージ中の.py/.pyc ファイルを構築" -#: ../../distutils/apiref.rst:1916 +#: ../../distutils/apiref.rst:1945 msgid "" "Alternative implementation of build_py which also runs the 2to3 conversion " "library on each .py file that is going to be installed. To use this in a " @@ -3171,25 +3196,25 @@ msgstr "" "て setup.py ファイルの中でこれを使用するためには、setup.py に次のように付け加" "えてください::" -#: ../../distutils/apiref.rst:1926 +#: ../../distutils/apiref.rst:1955 msgid "to your setup.py, and later::" msgstr "そして::" -#: ../../distutils/apiref.rst:1930 +#: ../../distutils/apiref.rst:1959 msgid "to the invocation of setup()." msgstr "を setup() の呼び出しに追加してください。" -#: ../../distutils/apiref.rst:1934 +#: ../../distutils/apiref.rst:1963 msgid "" ":mod:`distutils.command.build_scripts` --- Build the scripts of a package" msgstr "" ":mod:`distutils.command.build_scripts` --- パッケージ中のスクリプトを構築" -#: ../../distutils/apiref.rst:1944 +#: ../../distutils/apiref.rst:1973 msgid ":mod:`distutils.command.clean` --- Clean a package build area" msgstr ":mod:`distutils.command.clean` --- パッケージのビルドエリアを消去" -#: ../../distutils/apiref.rst:1949 +#: ../../distutils/apiref.rst:1978 msgid "" "This command removes the temporary files created by :command:`build` and its " "subcommands, like intermediary compiled object files. With the ``--all`` " @@ -3199,7 +3224,7 @@ msgstr "" "パイルオブジェクトファイルのような一時ファイルを削除します。 ``--all`` オプ" "ションとともに使うと、 build ディレクトリ全体を削除します。" -#: ../../distutils/apiref.rst:1953 +#: ../../distutils/apiref.rst:1982 msgid "" "Extension modules built :ref:`in place ` will " "not be cleaned, as they are not in the build directory." @@ -3207,22 +3232,22 @@ msgstr "" ":ref:`in place ` でビルドしたモジュールは、それ" "は build ディレクトリにいないので、削除されません。" -#: ../../distutils/apiref.rst:1958 +#: ../../distutils/apiref.rst:1987 msgid ":mod:`distutils.command.config` --- Perform package configuration" msgstr ":mod:`distutils.command.config` --- パッケージの設定" -#: ../../distutils/apiref.rst:1968 +#: ../../distutils/apiref.rst:1997 msgid ":mod:`distutils.command.install` --- Install a package" msgstr ":mod:`distutils.command.install` --- パッケージのインストール" -#: ../../distutils/apiref.rst:1978 +#: ../../distutils/apiref.rst:2007 msgid "" ":mod:`distutils.command.install_data` --- Install data files from a package" msgstr "" ":mod:`distutils.command.install_data` --- パッケージ中のデータファイルをイン" "ストール" -#: ../../distutils/apiref.rst:1988 +#: ../../distutils/apiref.rst:2017 msgid "" ":mod:`distutils.command.install_headers` --- Install C/C++ header files from " "a package" @@ -3230,14 +3255,14 @@ msgstr "" ":mod:`distutils.command.install_headers` --- パッケージから C/C++ ヘッダファ" "イルをインストール" -#: ../../distutils/apiref.rst:1998 +#: ../../distutils/apiref.rst:2027 msgid "" ":mod:`distutils.command.install_lib` --- Install library files from a package" msgstr "" ":mod:`distutils.command.install_lib` --- パッケージからライブラリファイルをイ" "ンストール" -#: ../../distutils/apiref.rst:2008 +#: ../../distutils/apiref.rst:2037 msgid "" ":mod:`distutils.command.install_scripts` --- Install script files from a " "package" @@ -3245,7 +3270,7 @@ msgstr "" ":mod:`distutils.command.install_scripts` --- パッケージからスクリプトファイル" "をインストール" -#: ../../distutils/apiref.rst:2018 +#: ../../distutils/apiref.rst:2047 msgid "" ":mod:`distutils.command.register` --- Register a module with the Python " "Package Index" @@ -3253,7 +3278,7 @@ msgstr "" ":mod:`distutils.command.register` --- モジュールをPython Package Indexに登録" "する" -#: ../../distutils/apiref.rst:2024 +#: ../../distutils/apiref.rst:2053 msgid "" "The ``register`` command registers the package with the Python Package " "Index. This is described in more detail in :pep:`301`." @@ -3261,12 +3286,12 @@ msgstr "" "``register`` コマンドはパッケージをPython Package Index に登録します。この詳" "細は :pep:`301` に記述されています。" -#: ../../distutils/apiref.rst:2031 +#: ../../distutils/apiref.rst:2060 msgid ":mod:`distutils.command.check` --- Check the meta-data of a package" msgstr "" ":mod:`distutils.command.check` --- パッケージのメタデータをチェックする" -#: ../../distutils/apiref.rst:2037 +#: ../../distutils/apiref.rst:2066 msgid "" "The ``check`` command performs some tests on the meta-data of a package. For " "example, it verifies that all required meta-data are provided as the " diff --git a/distutils/builtdist.po b/distutils/builtdist.po index ca6e6b188..5187f178c 100644 --- a/distutils/builtdist.po +++ b/distutils/builtdist.po @@ -1,24 +1,26 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2023, Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 -# Tetsuo Koyama , 2021 -# mollinaca, 2021 -# Takeshi Nakazato, 2021 -# Transifex Bot <>, 2023 +# Nozomu Kaneko , 2017 +# Masato HASHIMOTO , 2017 +# 秘湯 , 2017 +# Arihiro TAKASE, 2017 +# tomo, 2019 +# Tetsuo Koyama , 2020 +# mollinaca, 2020 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-19 14:13+0000\n" -"PO-Revision-Date: 2021-06-28 00:51+0000\n" -"Last-Translator: Transifex Bot <>, 2023\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 17:40+0000\n" +"Last-Translator: mollinaca, 2020\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" "Language: ja\n" "MIME-Version: 1.0\n" @@ -284,34 +286,46 @@ msgid "HP-UX :program:`swinstall`" msgstr "HP-UX :program:`swinstall` 形式" #: ../../distutils/builtdist.rst:99 +msgid "``wininst``" +msgstr "``wininst``" + +#: ../../distutils/builtdist.rst:99 +msgid "self-extracting ZIP file for Windows" +msgstr "Windows 用の自己展開形式 ZIP ファイル" + +#: ../../distutils/builtdist.rst:99 +msgid "\\(4)" +msgstr "\\(4)" + +#: ../../distutils/builtdist.rst:102 msgid "``msi``" msgstr "``msi``" -#: ../../distutils/builtdist.rst:99 +#: ../../distutils/builtdist.rst:102 msgid "Microsoft Installer." msgstr "マイクロソフト・インストーラー。" -#: ../../distutils/builtdist.rst:102 +#: ../../distutils/builtdist.rst:105 msgid "Added support for the ``xztar`` format." msgstr "``xztar`` 形式のサポートが追加されました。" -#: ../../distutils/builtdist.rst:106 +#: ../../distutils/builtdist.rst:109 msgid "Notes:" msgstr "注釈:" -#: ../../distutils/builtdist.rst:109 +#: ../../distutils/builtdist.rst:112 msgid "default on Unix" msgstr "Unixでのデフォルト形式です" -#: ../../distutils/builtdist.rst:112 +#: ../../distutils/builtdist.rst:115 msgid "default on Windows" msgstr "Windows でのデフォルト形式です" -#: ../../distutils/builtdist.rst:115 +#: ../../distutils/builtdist.rst:118 msgid "requires external :program:`compress` utility." msgstr "外部の :program:`compress` ユーティリティが必要です。" -#: ../../distutils/builtdist.rst:118 +#: ../../distutils/builtdist.rst:121 msgid "" "requires either external :program:`zip` utility or :mod:`zipfile` module " "(part of the standard Python library since Python 1.6)" @@ -319,7 +333,7 @@ msgstr "" "外部ユーティリティの :program:`zip` か、 :mod:`zipfile` モジュール (Python " "1.6 からは標準 Python ライブラリの一部になっています) が必要です" -#: ../../distutils/builtdist.rst:122 +#: ../../distutils/builtdist.rst:125 msgid "" "requires external :program:`rpm` utility, version 3.0.4 or better (use ``rpm " "--version`` to find out which version you have)" @@ -327,7 +341,7 @@ msgstr "" "外部ユーティリティの :program:`rpm` 、バージョン 3.0.4 以上が必要です (バー" "ジョンを調べるには、 ``rpm --version`` とします)" -#: ../../distutils/builtdist.rst:125 +#: ../../distutils/builtdist.rst:128 msgid "" "You don't have to use the :command:`bdist` command with the :option:`!--" "formats` option; you can also use the command that directly implements the " @@ -347,41 +361,67 @@ msgstr "" "`bdist_rpm` はバイナリ RPM とソース RPM の両方を生成できます。 :command:" "`bdist` サブコマンドと、それぞれが生成する形式を以下に示します:" -#: ../../distutils/builtdist.rst:135 +#: ../../distutils/builtdist.rst:138 msgid "Command" msgstr "コマンド" -#: ../../distutils/builtdist.rst:135 +#: ../../distutils/builtdist.rst:138 msgid "Formats" msgstr "Formats" -#: ../../distutils/builtdist.rst:137 +#: ../../distutils/builtdist.rst:140 msgid ":command:`bdist_dumb`" msgstr ":command:`bdist_dumb`" -#: ../../distutils/builtdist.rst:137 +#: ../../distutils/builtdist.rst:140 msgid "tar, gztar, bztar, xztar, ztar, zip" msgstr "tar, gztar, bztar, xztar, ztar, zip" -#: ../../distutils/builtdist.rst:139 +#: ../../distutils/builtdist.rst:142 msgid ":command:`bdist_rpm`" msgstr ":command:`bdist_rpm`" -#: ../../distutils/builtdist.rst:139 +#: ../../distutils/builtdist.rst:142 msgid "rpm, srpm" msgstr "rpm, srpm" -#: ../../distutils/builtdist.rst:142 +#: ../../distutils/builtdist.rst:144 +msgid ":command:`bdist_wininst`" +msgstr ":command:`bdist_wininst`" + +#: ../../distutils/builtdist.rst:144 +msgid "wininst" +msgstr "wininst" + +#: ../../distutils/builtdist.rst:146 +msgid ":command:`bdist_msi`" +msgstr ":command:`bdist_msi`" + +#: ../../distutils/builtdist.rst:146 +msgid "msi" +msgstr "msi" + +#: ../../distutils/builtdist.rst:150 ../../distutils/builtdist.rst:308 +#: ../../distutils/builtdist.rst:476 +msgid "bdist_wininst is deprecated since Python 3.8." +msgstr "" + +#: ../../distutils/builtdist.rst:153 ../../distutils/builtdist.rst:311 +#: ../../distutils/builtdist.rst:479 +msgid "bdist_msi is deprecated since Python 3.9." +msgstr "" + +#: ../../distutils/builtdist.rst:155 msgid "" "The following sections give details on the individual :command:`bdist_\\*` " "commands." msgstr ":command:`bdist_\\*` コマンドについては、以下の節で詳しく述べます。" -#: ../../distutils/builtdist.rst:158 +#: ../../distutils/builtdist.rst:171 msgid "Creating RPM packages" msgstr "RPM パッケージを作成する" -#: ../../distutils/builtdist.rst:160 +#: ../../distutils/builtdist.rst:173 msgid "" "The RPM format is used by many popular Linux distributions, including Red " "Hat, SuSE, and Mandrake. If one of these (or any of the other RPM-based " @@ -399,7 +439,7 @@ msgstr "" "ション間の違いにもよりますが、他の RPM ベースのディストリビューションでも動作" "するような RPM を作成できるかもしれません。" -#: ../../distutils/builtdist.rst:167 +#: ../../distutils/builtdist.rst:180 msgid "" "The usual way to create an RPM of your module distribution is to run the :" "command:`bdist_rpm` command::" @@ -407,13 +447,13 @@ msgstr "" "通常、モジュール配布物の RPM を作成するには、 :command:`bdist_rpm` コマンドを" "使います::" -#: ../../distutils/builtdist.rst:172 +#: ../../distutils/builtdist.rst:185 msgid "or the :command:`bdist` command with the :option:`!--format` option::" msgstr "" "あるいは、 :command:`bdist` コマンドを :option:`!--format` オプション付きで使" "います::" -#: ../../distutils/builtdist.rst:176 +#: ../../distutils/builtdist.rst:189 msgid "" "The former allows you to specify RPM-specific options; the latter allows " "you to easily specify multiple formats in one run. If you need to do both, " @@ -424,7 +464,7 @@ msgstr "" "の形式を指定できます。両方同時にやりたければ、それぞれの形式について各コマン" "ドごとにオプション付きで :command:`bdist_\\*` コマンドを並べます::" -#: ../../distutils/builtdist.rst:182 +#: ../../distutils/builtdist.rst:196 msgid "" "Creating RPM packages is driven by a :file:`.spec` file, much as using the " "Distutils is driven by the setup script. To make your life easier, the :" @@ -440,43 +480,43 @@ msgstr "" "イルを作成します。 :file:`.spec` ファイルの様々なオプションやセクション情報" "は、以下のようにして setup スクリプトから取り出されます:" -#: ../../distutils/builtdist.rst:190 ../../distutils/builtdist.rst:214 +#: ../../distutils/builtdist.rst:204 ../../distutils/builtdist.rst:228 msgid "RPM :file:`.spec` file option or section" msgstr "RPM :file:`.spec` ファイルのオプションまたはセクション" -#: ../../distutils/builtdist.rst:190 +#: ../../distutils/builtdist.rst:204 msgid "Distutils setup script option" msgstr "Distutils setup スクリプト内のオプション" -#: ../../distutils/builtdist.rst:192 +#: ../../distutils/builtdist.rst:206 msgid "Name" msgstr "名前" -#: ../../distutils/builtdist.rst:192 +#: ../../distutils/builtdist.rst:206 msgid "``name``" msgstr "``name``" -#: ../../distutils/builtdist.rst:194 +#: ../../distutils/builtdist.rst:208 msgid "Summary (in preamble)" msgstr "Summary (preamble 内)" -#: ../../distutils/builtdist.rst:194 +#: ../../distutils/builtdist.rst:208 msgid "``description``" msgstr "``description``" -#: ../../distutils/builtdist.rst:196 +#: ../../distutils/builtdist.rst:210 msgid "Version" msgstr "Version" -#: ../../distutils/builtdist.rst:196 +#: ../../distutils/builtdist.rst:210 msgid "``version``" msgstr "``version``" -#: ../../distutils/builtdist.rst:198 ../../distutils/builtdist.rst:221 +#: ../../distutils/builtdist.rst:212 ../../distutils/builtdist.rst:235 msgid "Vendor" msgstr "Vendor" -#: ../../distutils/builtdist.rst:198 +#: ../../distutils/builtdist.rst:212 msgid "" "``author`` and ``author_email``, or --- & ``maintainer`` and " "``maintainer_email``" @@ -484,31 +524,31 @@ msgstr "" "``author`` と ``author_email``, または --- & ``maintainer`` と " "``maintainer_email``" -#: ../../distutils/builtdist.rst:202 +#: ../../distutils/builtdist.rst:216 msgid "Copyright" msgstr "Copyright" -#: ../../distutils/builtdist.rst:202 +#: ../../distutils/builtdist.rst:216 msgid "``license``" msgstr "``license``" -#: ../../distutils/builtdist.rst:204 +#: ../../distutils/builtdist.rst:218 msgid "Url" msgstr "Url" -#: ../../distutils/builtdist.rst:204 +#: ../../distutils/builtdist.rst:218 msgid "``url``" msgstr "``url``" -#: ../../distutils/builtdist.rst:206 +#: ../../distutils/builtdist.rst:220 msgid "%description (section)" msgstr "%description (section)" -#: ../../distutils/builtdist.rst:206 +#: ../../distutils/builtdist.rst:220 msgid "``long_description``" msgstr "``long_description``" -#: ../../distutils/builtdist.rst:209 +#: ../../distutils/builtdist.rst:223 msgid "" "Additionally, there are many options in :file:`.spec` files that don't have " "corresponding options in the setup script. Most of these are handled " @@ -518,118 +558,118 @@ msgstr "" "応するオプションがありません。これらのほとんどは、以下に示す :command:" "`bdist_rpm` コマンドのオプションで扱えます:" -#: ../../distutils/builtdist.rst:214 +#: ../../distutils/builtdist.rst:228 msgid ":command:`bdist_rpm` option" msgstr ":command:`bdist_rpm` オプション" -#: ../../distutils/builtdist.rst:214 +#: ../../distutils/builtdist.rst:228 msgid "default value" msgstr "デフォルト値" -#: ../../distutils/builtdist.rst:217 +#: ../../distutils/builtdist.rst:231 msgid "Release" msgstr "リリース" -#: ../../distutils/builtdist.rst:217 +#: ../../distutils/builtdist.rst:231 msgid "``release``" msgstr "``release``" -#: ../../distutils/builtdist.rst:217 +#: ../../distutils/builtdist.rst:231 msgid "\"1\"" msgstr "\"1\"" -#: ../../distutils/builtdist.rst:219 +#: ../../distutils/builtdist.rst:233 msgid "Group" msgstr "Group" -#: ../../distutils/builtdist.rst:219 +#: ../../distutils/builtdist.rst:233 msgid "``group``" msgstr "``group``" -#: ../../distutils/builtdist.rst:219 +#: ../../distutils/builtdist.rst:233 msgid "\"Development/Libraries\"" msgstr "\"Development/Libraries\"" -#: ../../distutils/builtdist.rst:221 +#: ../../distutils/builtdist.rst:235 msgid "``vendor``" msgstr "``vendor``" -#: ../../distutils/builtdist.rst:221 +#: ../../distutils/builtdist.rst:235 msgid "(see above)" msgstr "(上記参照)" -#: ../../distutils/builtdist.rst:223 +#: ../../distutils/builtdist.rst:237 msgid "Packager" msgstr "Packager" -#: ../../distutils/builtdist.rst:223 +#: ../../distutils/builtdist.rst:237 msgid "``packager``" msgstr "``packager``" -#: ../../distutils/builtdist.rst:223 ../../distutils/builtdist.rst:225 -#: ../../distutils/builtdist.rst:227 ../../distutils/builtdist.rst:229 -#: ../../distutils/builtdist.rst:231 ../../distutils/builtdist.rst:233 -#: ../../distutils/builtdist.rst:235 ../../distutils/builtdist.rst:237 +#: ../../distutils/builtdist.rst:237 ../../distutils/builtdist.rst:239 +#: ../../distutils/builtdist.rst:241 ../../distutils/builtdist.rst:243 +#: ../../distutils/builtdist.rst:245 ../../distutils/builtdist.rst:247 +#: ../../distutils/builtdist.rst:249 ../../distutils/builtdist.rst:251 msgid "(none)" msgstr "(none)" -#: ../../distutils/builtdist.rst:225 +#: ../../distutils/builtdist.rst:239 msgid "Provides" msgstr "Provides" -#: ../../distutils/builtdist.rst:225 +#: ../../distutils/builtdist.rst:239 msgid "``provides``" msgstr "``provides``" -#: ../../distutils/builtdist.rst:227 +#: ../../distutils/builtdist.rst:241 msgid "Requires" msgstr "Requires" -#: ../../distutils/builtdist.rst:227 +#: ../../distutils/builtdist.rst:241 msgid "``requires``" msgstr "``requires``" -#: ../../distutils/builtdist.rst:229 +#: ../../distutils/builtdist.rst:243 msgid "Conflicts" msgstr "Conflicts" -#: ../../distutils/builtdist.rst:229 +#: ../../distutils/builtdist.rst:243 msgid "``conflicts``" msgstr "``conflicts``" -#: ../../distutils/builtdist.rst:231 +#: ../../distutils/builtdist.rst:245 msgid "Obsoletes" msgstr "Obsoletes" -#: ../../distutils/builtdist.rst:231 +#: ../../distutils/builtdist.rst:245 msgid "``obsoletes``" msgstr "``obsoletes``" -#: ../../distutils/builtdist.rst:233 +#: ../../distutils/builtdist.rst:247 msgid "Distribution" msgstr "Distribution" -#: ../../distutils/builtdist.rst:233 +#: ../../distutils/builtdist.rst:247 msgid "``distribution_name``" msgstr "``distribution_name``" -#: ../../distutils/builtdist.rst:235 +#: ../../distutils/builtdist.rst:249 msgid "BuildRequires" msgstr "BuildRequires" -#: ../../distutils/builtdist.rst:235 +#: ../../distutils/builtdist.rst:249 msgid "``build_requires``" msgstr "``build_requires``" -#: ../../distutils/builtdist.rst:237 +#: ../../distutils/builtdist.rst:251 msgid "Icon" msgstr "Icon" -#: ../../distutils/builtdist.rst:237 +#: ../../distutils/builtdist.rst:251 msgid "``icon``" msgstr "``icon``" -#: ../../distutils/builtdist.rst:240 +#: ../../distutils/builtdist.rst:254 msgid "" "Obviously, supplying even a few of these options on the command-line would " "be tedious and error-prone, so it's usually best to put them in the setup " @@ -649,7 +689,7 @@ msgstr "" "的に無効にしたければ、 :option:`!--no-user-cfg` を :file:`setup.py` に渡せま" "す。" -#: ../../distutils/builtdist.rst:248 +#: ../../distutils/builtdist.rst:262 msgid "" "There are three steps to building a binary RPM package, all of which are " "handled automatically by the Distutils:" @@ -657,7 +697,7 @@ msgstr "" "バイナリ形式の RPM パッケージを作成する際には三つの段階があり、Distutils はこ" "れら全ての段階を自動的に処理します:" -#: ../../distutils/builtdist.rst:251 +#: ../../distutils/builtdist.rst:265 msgid "" "create a :file:`.spec` file, which describes the package (analogous to the " "Distutils setup script; in fact, much of the information in the setup " @@ -667,11 +707,11 @@ msgstr "" "spec` ファイルは setup スクリプトに似たファイルです; 実際、 setup スクリプト" "のほとんどの情報が :file:`.spec` ファイルから引き揚げられます)" -#: ../../distutils/builtdist.rst:255 +#: ../../distutils/builtdist.rst:269 msgid "create the source RPM" msgstr "ソース RPM を作成します" -#: ../../distutils/builtdist.rst:257 +#: ../../distutils/builtdist.rst:271 msgid "" "create the \"binary\" RPM (which may or may not contain binary code, " "depending on whether your module distribution contains Python extensions)" @@ -680,7 +720,7 @@ msgstr "" "ジュールが入っているか否かで、バイナリコードが含まれることも含まれないことも" "あります)" -#: ../../distutils/builtdist.rst:260 +#: ../../distutils/builtdist.rst:274 msgid "" "Normally, RPM bundles the last two steps together; when you use the " "Distutils, all three steps are typically bundled together." @@ -688,7 +728,7 @@ msgstr "" "通常、RPM は最後の二つのステップをまとめて行います; Distutils を使うと、普通" "は三つのステップ全てをまとめて行います。" -#: ../../distutils/builtdist.rst:263 +#: ../../distutils/builtdist.rst:277 msgid "" "If you wish, you can separate these three steps. You can use the :option:" "`!--spec-only` option to make :command:`bdist_rpm` just create the :file:`." @@ -706,11 +746,112 @@ msgstr "" "\"ビルドツリー (build tree)\"、すなわち :command:`bdist_rpm` が作成する一時" "ディレクトリの中から引き揚げられます。)" -#: ../../distutils/builtdist.rst:291 +#: ../../distutils/builtdist.rst:305 +msgid "Creating Windows Installers" +msgstr "Windows インストーラを作成する" + +#: ../../distutils/builtdist.rst:313 +msgid "" +"Executable installers are the natural format for binary distributions on " +"Windows. They display a nice graphical user interface, display some " +"information about the module distribution to be installed taken from the " +"metadata in the setup script, let the user select a few options, and start " +"or cancel the installation." +msgstr "" +"実行可能なインストーラは、Windows 環境ではごく自然なバイナリ配布形式です。イ" +"ンストーラは結構なグラフィカルユーザインターフェースを表示して、モジュール配" +"布物に関するいくつかの情報を setup スクリプト内のメタデータから取り出して示" +"し、ユーザがいくつかのオプションを選んだり、インストールを決行するか取りやめ" +"るか選んだりできるようにします。" + +#: ../../distutils/builtdist.rst:319 +msgid "" +"Since the metadata is taken from the setup script, creating Windows " +"installers is usually as easy as running::" +msgstr "" +"メタデータは setup スクリプトから取り出されるので、Windows インストーラの作成" +"は至って簡単で、以下を実行するだけです::" + +#: ../../distutils/builtdist.rst:324 +msgid "or the :command:`bdist` command with the :option:`!--formats` option::" +msgstr "" +"あるいは、 :command:`bdist` コマンドを :option:`!--formats` オプション付きで" +"実行します::" + +#: ../../distutils/builtdist.rst:328 +msgid "" +"If you have a pure module distribution (only containing pure Python modules " +"and packages), the resulting installer will be version independent and have " +"a name like :file:`foo-1.0.win32.exe`. Note that creating ``wininst`` binary " +"distributions in only supported on Windows systems." +msgstr "" + +#: ../../distutils/builtdist.rst:333 +msgid "" +"If you have a non-pure distribution, the extensions can only be created on a " +"Windows platform, and will be Python version dependent. The installer " +"filename will reflect this and now has the form :file:`foo-1.0.win32-py2.0." +"exe`. You have to create a separate installer for every Python version you " +"want to support." +msgstr "" +"非 pure 配布物の場合、拡張モジュールは Windows プラットフォーム上だけで作成で" +"き、Python のバージョンに依存したインストーラになります。インストーラのファイ" +"ル名もバージョン依存性を反映して、 :file:`foo-1.0.win32-py2.0.exe` のような形" +"式になります。従って、サポートしたい全てのバージョンの Python に対して、別々" +"のインストーラを作成しなければなりません。" + +#: ../../distutils/builtdist.rst:339 +msgid "" +"The installer will try to compile pure modules into :term:`bytecode` after " +"installation on the target system in normal and optimizing mode. If you " +"don't want this to happen for some reason, you can run the :command:" +"`bdist_wininst` command with the :option:`!--no-target-compile` and/or the :" +"option:`!--no-target-optimize` option." +msgstr "" +"インストーラは、ターゲットとなるシステムにインストールを実行した後、 pure モ" +"ジュールを通常 (normal) モードと最適化 (optimizing) モードで :term:`バイト" +"コード ` にコンパイルしようと試みます。何らかの理由があってコンパイ" +"ルさせたくなければ、 :command:`bdist_wininst` コマンドを :option:`!--no-" +"target-compile` かつ/または :option:`!--no-target-optimize` オプション付きで" +"実行します。" + +#: ../../distutils/builtdist.rst:345 +msgid "" +"By default the installer will display the cool \"Python Powered\" logo when " +"it is run, but you can also supply your own 152x261 bitmap which must be a " +"Windows :file:`.bmp` file with the :option:`!--bitmap` option." +msgstr "" +"デフォルトでは、インストーラは実行時にクールな \"Python Powered\" ロゴを表示" +"しますが、自作の152x261ビットマップ画像も指定できます。画像は Windows の :" +"file:`.bmp` ファイル形式でなくてはならず、 :option:`!--bitmap` オプションで指" +"定します。" + +#: ../../distutils/builtdist.rst:349 +msgid "" +"The installer will also display a large title on the desktop background " +"window when it is run, which is constructed from the name of your " +"distribution and the version number. This can be changed to another text by " +"using the :option:`!--title` option." +msgstr "" +"インストーラを起動すると、デスクトップの背景ウィンドウ上にでっかいタイトルも" +"表示します。タイトルは配布物の名前とバージョン番号から作成します。 :option:" +"`!--title` オプションを使えば、タイトルを別のテキストに変更できます。" + +#: ../../distutils/builtdist.rst:354 +msgid "" +"The installer file will be written to the \"distribution directory\" --- " +"normally :file:`dist/`, but customizable with the :option:`!--dist-dir` " +"option." +msgstr "" +"インストーラファイルは \"配布物ディレクトリ (distribution directory)\" --- 通" +"常は :file:`dist/` に作成されますが、 :option:`!--dist-dir` オプションで指定" +"することもできます。" + +#: ../../distutils/builtdist.rst:360 msgid "Cross-compiling on Windows" msgstr "Windows でのクロスコンパイル" -#: ../../distutils/builtdist.rst:293 +#: ../../distutils/builtdist.rst:362 msgid "" "Starting with Python 2.6, distutils is capable of cross-compiling between " "Windows platforms. In practice, this means that with the correct tools " @@ -721,7 +862,7 @@ msgstr "" "に対応しました。これによって、必要なツールがインストールされていれば、32bit " "版の Windows で 64bit 版の拡張を作成したり、その逆が可能になりました。" -#: ../../distutils/builtdist.rst:298 +#: ../../distutils/builtdist.rst:367 msgid "" "To build for an alternate platform, specify the :option:`!--plat-name` " "option to the build command. Valid values are currently 'win32', and 'win-" @@ -732,17 +873,21 @@ msgstr "" "ば、 32bit 版の Windows 上で、 以下のようにして 64bit版 Windows 向けのビルド" "を行うことができます::" -#: ../../distutils/builtdist.rst:304 -msgid "to build a 64bit version of your extension." +#: ../../distutils/builtdist.rst:373 +msgid "" +"to build a 64bit version of your extension. The Windows Installers also " +"support this option, so the command::" msgstr "" +"Windows インストーラもこのオプションをサポートしています。なので次のコマンド" +"を実行すると::" -#: ../../distutils/builtdist.rst:306 +#: ../../distutils/builtdist.rst:378 msgid "" "would create a 64bit installation executable on your 32bit version of " "Windows." msgstr "64bit のインストーラを32bitのWindowsで作成できます。" -#: ../../distutils/builtdist.rst:308 +#: ../../distutils/builtdist.rst:380 msgid "" "To cross-compile, you must download the Python source code and cross-compile " "Python itself for the platform you are targeting - it is not possible from a " @@ -763,7 +908,7 @@ msgstr "" "ルドするために Visual Studio 2008 を使う必要があるということを意味していま" "す。" -#: ../../distutils/builtdist.rst:317 +#: ../../distutils/builtdist.rst:389 msgid "" "Note that by default, Visual Studio 2008 does not install 64bit compilers or " "tools. You may need to reexecute the Visual Studio setup process and select " @@ -775,11 +920,11 @@ msgstr "" "実行して、それらのツールを選択する必要があるでしょう。(コントロールパネル -> " "[追加と削除] から簡単に既存のインストールをチェック、修正できます。)" -#: ../../distutils/builtdist.rst:325 +#: ../../distutils/builtdist.rst:397 msgid "The Postinstallation script" msgstr "インストール後実行スクリプト (postinstallation script)" -#: ../../distutils/builtdist.rst:327 +#: ../../distutils/builtdist.rst:399 msgid "" "Starting with Python 2.3, a postinstallation script can be specified with " "the :option:`!--install-script` option. The basename of the script must be " @@ -791,7 +936,7 @@ msgstr "" "まないベースネーム (basename) で指定しなければならず、スクリプトファイル名は " "setup 関数の scripts 引数中に挙げられていなければなりません。" -#: ../../distutils/builtdist.rst:332 +#: ../../distutils/builtdist.rst:404 msgid "" "This script will be run at installation time on the target system after all " "the files have been copied, with ``argv[1]`` set to :option:`!-install`, and " @@ -803,7 +948,7 @@ msgstr "" "install` に設定します。また、アンインストール時には、ファイルを削除する前に " "``argv[1]`` を :option:`!-remove` に設定して実行します。" -#: ../../distutils/builtdist.rst:337 +#: ../../distutils/builtdist.rst:409 msgid "" "The installation script runs embedded in the windows installer, every output " "(``sys.stdout``, ``sys.stderr``) is redirected into a buffer and will be " @@ -813,7 +958,7 @@ msgstr "" "出力 (``sys.stdout``、``sys.stderr``) はバッファにリダイレクトされ、スクリプ" "トの終了後に GUI 上に表示されます。" -#: ../../distutils/builtdist.rst:341 +#: ../../distutils/builtdist.rst:413 msgid "" "Some functions especially useful in this context are available as additional " "built-in functions in the installation script." @@ -821,7 +966,7 @@ msgstr "" "インストールスクリプトでは、インストール/アンインストールのコンテキストで特に" "有用ないくつかの機能を、追加の組み込み関数として利用することができます。" -#: ../../distutils/builtdist.rst:348 +#: ../../distutils/builtdist.rst:420 msgid "" "These functions should be called when a directory or file is created by the " "postinstall script at installation time. It will register *path* with the " @@ -833,7 +978,7 @@ msgstr "" "*path* を登録し、配布物をアンインストールする際にファイルが消されるようにしま" "す。安全を期すために、ディレクトリは空の時にのみ削除されます。" -#: ../../distutils/builtdist.rst:356 +#: ../../distutils/builtdist.rst:428 msgid "" "This function can be used to retrieve special folder locations on Windows " "like the Start Menu or the Desktop. It returns the full path to the folder. " @@ -843,12 +988,12 @@ msgstr "" "特殊なフォルダ位置を取得する際に使えます。この関数はフォルダのフルパスを返し" "ます。*csidl_string* は以下の文字列のいずれかでなければなりません::" -#: ../../distutils/builtdist.rst:376 +#: ../../distutils/builtdist.rst:448 msgid "If the folder cannot be retrieved, :exc:`OSError` is raised." msgstr "" "該当するフォルダを取得できなかった場合、 :exc:`OSError` が送出されます。" -#: ../../distutils/builtdist.rst:378 +#: ../../distutils/builtdist.rst:450 msgid "" "Which folders are available depends on the exact Windows version, and " "probably also the configuration. For details refer to Microsoft's " @@ -859,7 +1004,7 @@ msgstr "" "`SHGetSpecialFolderPath` 関数に関する Microsoft のドキュメントを参照してくだ" "さい。" -#: ../../distutils/builtdist.rst:385 +#: ../../distutils/builtdist.rst:457 msgid "" "This function creates a shortcut. *target* is the path to the program to be " "started by the shortcut. *description* is the description of the shortcut. " @@ -878,3 +1023,20 @@ msgstr "" "*iconindex* はファイル *iconpath* 中のアイコンへのインデクスです。これについ" "ても、詳しくは :class:`IShellLink` インターフェースに関する Microsoft のド" "キュメントを参照してください。" + +#: ../../distutils/builtdist.rst:468 +msgid "Vista User Access Control (UAC)" +msgstr "Vista のユーザアカウント制御 (UAC)" + +#: ../../distutils/builtdist.rst:470 +msgid "" +"Starting with Python 2.6, bdist_wininst supports a :option:`!--user-access-" +"control` option. The default is 'none' (meaning no UAC handling is done), " +"and other valid values are 'auto' (meaning prompt for UAC elevation if " +"Python was installed for all users) and 'force' (meaning always prompt for " +"elevation)." +msgstr "" +"Python 2.6 から、 bdist_wininst は :option:`!--user-access-control` オプショ" +"ンをサポートしています。デフォルトは 'none' (UAC制御をしないことを意味しま" +"す) で、それ以外の有効な値は 'auto' (Python が全ユーザー用にインストールされ" +"ていれば UAC 昇格を行う)、 'force' (常に昇格を行う) です。" diff --git a/distutils/commandref.po b/distutils/commandref.po index fac738db7..62adad883 100644 --- a/distutils/commandref.po +++ b/distutils/commandref.po @@ -1,20 +1,23 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2023, Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 +# 秘湯 , 2017 +# Inada Naoki , 2017 +# Arihiro TAKASE, 2017 +# tomo, 2019 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-19 14:13+0000\n" -"PO-Revision-Date: 2021-06-28 00:51+0000\n" -"Last-Translator: tomo, 2021\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 17:40+0000\n" +"Last-Translator: tomo, 2019\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" "Language: ja\n" "MIME-Version: 1.0\n" diff --git a/distutils/configfile.po b/distutils/configfile.po index 83f124244..5ba4f6fdd 100644 --- a/distutils/configfile.po +++ b/distutils/configfile.po @@ -1,22 +1,24 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2023, Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 -# Tetsuo Koyama , 2021 -# Takeshi Nakazato, 2021 +# 秘湯 , 2017 +# Nozomu Kaneko , 2017 +# Arihiro TAKASE, 2017 +# tomo, 2019 +# Tetsuo Koyama , 2020 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-19 14:13+0000\n" -"PO-Revision-Date: 2021-06-28 00:51+0000\n" -"Last-Translator: Takeshi Nakazato, 2021\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 17:40+0000\n" +"Last-Translator: Tetsuo Koyama , 2020\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" "Language: ja\n" "MIME-Version: 1.0\n" diff --git a/distutils/examples.po b/distutils/examples.po index c8ce9c4fb..a7d7e1097 100644 --- a/distutils/examples.po +++ b/distutils/examples.po @@ -1,20 +1,22 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2023, Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 +# Nozomu Kaneko , 2017 +# Arihiro TAKASE, 2017 +# tomo, 2019 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-19 14:13+0000\n" -"PO-Revision-Date: 2021-06-28 00:51+0000\n" -"Last-Translator: tomo, 2021\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 17:41+0000\n" +"Last-Translator: tomo, 2019\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" "Language: ja\n" "MIME-Version: 1.0\n" diff --git a/distutils/extending.po b/distutils/extending.po index 270cd2f83..ee3e2c25c 100644 --- a/distutils/extending.po +++ b/distutils/extending.po @@ -1,21 +1,22 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2023, Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 -# Arihiro TAKASE, 2023 +# Arihiro TAKASE, 2017 +# Osamu NAKAMURA, 2018 +# tomo, 2019 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-19 14:13+0000\n" -"PO-Revision-Date: 2021-06-28 00:51+0000\n" -"Last-Translator: Arihiro TAKASE, 2023\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 17:41+0000\n" +"Last-Translator: tomo, 2019\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" "Language: ja\n" "MIME-Version: 1.0\n" @@ -71,11 +72,11 @@ msgid "" "indirectly, directly subclassing the command they are replacing. Commands " "are required to derive from :class:`Command`." msgstr "" -"ほとんどのdistutilsのコマンド実装は :class:`distutils.cmd.Command` クラスのサ" -"ブクラスとして実装されています。新しいコマンドは :class:`Command` を直接継承" -"し、置換するコマンドでは置換対象のコマンドのサブクラスにすることで :class:" -"`Command` を間接的に継承します。コマンドは :class:`Command` から派生したもの" -"である必要があります。" +"ほとんどのdistutilsのコマンド実装は :mod:`distutils.cmd` の :class:" +"`distutils.cmd.Command` クラスのサブクラスとして実装されています。新しいコマ" +"ンドは :class:`Command` を直接継承し、置換するコマンドでは置換対象のコマンド" +"のサブクラスにすることで :class:`Command` を間接的に継承します。コマンドは :" +"class:`Command` から派生したものである必要があります。" #: ../../distutils/extending.rst:35 msgid "Integrating new commands" diff --git a/distutils/index.po b/distutils/index.po index f075387ce..67a1f29c6 100644 --- a/distutils/index.po +++ b/distutils/index.po @@ -1,21 +1,24 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2023, Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 -# Shin Saito, 2021 +# Yusuke Miyazaki , 2017 +# 秘湯 , 2017 +# Nozomu Kaneko , 2017 +# Inada Naoki , 2017 +# tomo, 2019 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-19 14:13+0000\n" -"PO-Revision-Date: 2021-06-28 00:51+0000\n" -"Last-Translator: Shin Saito, 2021\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 17:41+0000\n" +"Last-Translator: tomo, 2019\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" "Language: ja\n" "MIME-Version: 1.0\n" @@ -51,18 +54,6 @@ msgstr ":ref:`distributing-index`" msgid "The up to date module distribution documentations" msgstr "最新のモジュール配布ドキュメンテーション" -#: ../../distutils/index.rst:17 -msgid "" -"The entire ``distutils`` package has been deprecated and will be removed in " -"Python 3.12. This documentation is retained as a reference only, and will be " -"removed with the package. See the :ref:`What's New ` " -"entry for more information." -msgstr "" -"``distutils`` パッケージ全体の使用は非推奨 (deprecated) であり、Python 3.12 " -"で削除されます。この文書は参照のために維持されており、パッケージとともに削除" -"されます。詳しくは :ref:`What's New ` エントリを参照し" -"てください。" - #: ../../distutils/_setuptools_disclaimer.rst:3 msgid "" "This document is being retained solely until the ``setuptools`` " @@ -73,7 +64,7 @@ msgstr "" "html にある ``setuptools`` のドキュメントが現時点でここにある関連情報を全て網" "羅するまで、単独でここに載せておかれます。" -#: ../../distutils/index.rst:26 +#: ../../distutils/index.rst:19 msgid "" "This guide only covers the basic tools for building and distributing " "extensions that are provided as part of this version of Python. Third party " @@ -87,7 +78,7 @@ msgstr "" "`quick recommendations section `__ にある Python パッケージングユーザガイドから得られます。" -#: ../../distutils/index.rst:32 +#: ../../distutils/index.rst:25 msgid "" "This document describes the Python Distribution Utilities (\"Distutils\") " "from the module developer's point of view, describing the underlying " diff --git a/distutils/introduction.po b/distutils/introduction.po index 88f368769..1e40092a7 100644 --- a/distutils/introduction.po +++ b/distutils/introduction.po @@ -1,21 +1,26 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2023, Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 -# mollinaca, 2021 +# Nozomu Kaneko , 2017 +# Inada Naoki , 2017 +# Arihiro TAKASE, 2017 +# yudetamago , 2018 +# Hiroyuki Kurosawa , 2019 +# tomo, 2019 +# mollinaca, 2020 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-19 14:13+0000\n" -"PO-Revision-Date: 2021-06-28 00:51+0000\n" -"Last-Translator: mollinaca, 2021\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 17:41+0000\n" +"Last-Translator: mollinaca, 2020\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" "Language: ja\n" "MIME-Version: 1.0\n" @@ -245,6 +250,29 @@ msgstr "" #: ../../distutils/introduction.rst:115 msgid "" +"If you want to make things really easy for your users, you can create one or " +"more built distributions for them. For instance, if you are running on a " +"Windows machine, and want to make things easy for other Windows users, you " +"can create an executable installer (the most appropriate type of built " +"distribution for this platform) with the :command:`bdist_wininst` command. " +"For example::" +msgstr "" +"ユーザにとって本当に簡単なものにしたいのなら、一つまたはそれ以上のビルド済み" +"配布物を作ってあげられます。例えば、Windows マシン上で作業をしていて、他の " +"Windows ユーザにとって簡単な配布物を提供したいのなら、実行可能な形式の (この" +"プラットフォーム向けのビルド済み配布物としてはもっとも適切な) インストーラを" +"作成できます。これには :command:`bdist_wininst` を使います。例えば::" + +#: ../../distutils/introduction.rst:123 +msgid "" +"will create an executable installer, :file:`foo-1.0.win32.exe`, in the " +"current directory." +msgstr "" +"とすると、実行可能なインストーラ形式、 :file:`foo-1.0.win32.exe` が現在のディ" +"レクトリに作成されます。" + +#: ../../distutils/introduction.rst:126 +msgid "" "Other useful built distribution formats are RPM, implemented by the :command:" "`bdist_rpm` command, Solaris :program:`pkgtool` (:command:`bdist_pkgtool`), " "and HP-UX :program:`swinstall` (:command:`bdist_sdux`). For example, the " @@ -255,7 +283,7 @@ msgstr "" "`swinstall` (:command:`bdist_sdux`) があります。例えば、以下のコマンドを実行" "すると、 :file:`foo-1.0.noarch.rpm` という名前の RPM ファイルを作成します::" -#: ../../distutils/introduction.rst:123 +#: ../../distutils/introduction.rst:134 msgid "" "(The :command:`bdist_rpm` command uses the :command:`rpm` executable, " "therefore this has to be run on an RPM-based system such as Red Hat Linux, " @@ -265,17 +293,17 @@ msgstr "" "Linux や SuSE Linux、 Mandrake Linux といった RPM ベースのシステムで実行しな" "ければなりません)" -#: ../../distutils/introduction.rst:127 +#: ../../distutils/introduction.rst:138 msgid "" "You can find out what distribution formats are available at any time by " "running ::" msgstr "どの配布形式が利用できるかは、これを実行すれば分かります ::" -#: ../../distutils/introduction.rst:136 +#: ../../distutils/introduction.rst:147 msgid "General Python terminology" msgstr "Python 一般の用語" -#: ../../distutils/introduction.rst:138 +#: ../../distutils/introduction.rst:149 msgid "" "If you're reading this document, you probably have a good idea of what " "modules, extensions, and so forth are. Nevertheless, just to be sure that " @@ -287,11 +315,11 @@ msgstr "" "がみな共通のスタートポイントに立って Distutils の操作を始められるように、ここ" "で一般的な Python 用語について以下のような用語集を示しておきます:" -#: ../../distutils/introduction.rst:146 +#: ../../distutils/introduction.rst:157 msgid "module" msgstr "module" -#: ../../distutils/introduction.rst:144 +#: ../../distutils/introduction.rst:155 msgid "" "the basic unit of code reusability in Python: a block of code imported by " "some other code. Three types of modules concern us here: pure Python " @@ -301,11 +329,11 @@ msgstr "" "import されるひとかたまりのコードです。ここでは、三種類のモジュール: pure " "Python モジュール、拡張モジュール、パッケージが関わってきます。" -#: ../../distutils/introduction.rst:151 +#: ../../distutils/introduction.rst:162 msgid "pure Python module" msgstr "pure Python モジュール" -#: ../../distutils/introduction.rst:149 +#: ../../distutils/introduction.rst:160 msgid "" "a module written in Python and contained in a single :file:`.py` file (and " "possibly associated :file:`.pyc` files). Sometimes referred to as a \"pure " @@ -315,11 +343,11 @@ msgstr "" "file:`.pyc` ファイルと関連があります) 。 \"pure モジュール (pure module)\" " "と呼ばれることもあります。" -#: ../../distutils/introduction.rst:159 +#: ../../distutils/introduction.rst:170 msgid "extension module" msgstr "extension module" -#: ../../distutils/introduction.rst:154 +#: ../../distutils/introduction.rst:165 msgid "" "a module written in the low-level language of the Python implementation: C/C+" "+ for Python, Java for Jython. Typically contained in a single dynamically " @@ -337,11 +365,11 @@ msgstr "" "す。 (現状では、 Distutils は Python 向けの C/C++ 拡張モジュールしか扱わない" "ので注意してください。)" -#: ../../distutils/introduction.rst:164 +#: ../../distutils/introduction.rst:175 msgid "package" msgstr "package" -#: ../../distutils/introduction.rst:162 +#: ../../distutils/introduction.rst:173 msgid "" "a module that contains other modules; typically contained in a directory in " "the filesystem and distinguished from other directories by the presence of a " @@ -351,11 +379,11 @@ msgstr "" "レクトリに収められ、 :file:`__init__.py` が入っていることで通常のディレクトリ" "と区別できます。" -#: ../../distutils/introduction.rst:174 +#: ../../distutils/introduction.rst:185 msgid "root package" msgstr "ルートパッケージ" -#: ../../distutils/introduction.rst:167 +#: ../../distutils/introduction.rst:178 msgid "" "the root of the hierarchy of packages. (This isn't really a package, since " "it doesn't have an :file:`__init__.py` file. But we have to call it " @@ -374,11 +402,11 @@ msgstr "" "path`` に列挙されているディレクトリ全てが、ルートパッケージに配置されるモ" "ジュールの内容に影響します。" -#: ../../distutils/introduction.rst:179 +#: ../../distutils/introduction.rst:190 msgid "Distutils-specific terminology" msgstr "Distutils 固有の用語" -#: ../../distutils/introduction.rst:181 +#: ../../distutils/introduction.rst:192 msgid "" "The following terms apply more specifically to the domain of distributing " "Python modules using the Distutils:" @@ -386,11 +414,11 @@ msgstr "" "以下は Distutils を使って Python モジュールを配布する際に使われる特有の用語で" "す:" -#: ../../distutils/introduction.rst:190 +#: ../../distutils/introduction.rst:201 msgid "module distribution" msgstr "モジュール配布物" -#: ../../distutils/introduction.rst:185 +#: ../../distutils/introduction.rst:196 msgid "" "a collection of Python modules distributed together as a single downloadable " "resource and meant to be installed *en masse*. Examples of some well-known " @@ -404,11 +432,11 @@ msgstr "" "これは *パッケージ* と呼ばれます: 1 つのモジュール配布物は 0 個か 1 個かもっ" "と多くの Python パッケージを含みます。)" -#: ../../distutils/introduction.rst:194 +#: ../../distutils/introduction.rst:205 msgid "pure module distribution" msgstr "pure module distribution" -#: ../../distutils/introduction.rst:193 +#: ../../distutils/introduction.rst:204 msgid "" "a module distribution that contains only pure Python modules and packages. " "Sometimes referred to as a \"pure distribution.\"" @@ -416,11 +444,11 @@ msgstr "" "pure Python モジュールやパッケージだけが入ったモジュール配布物です。\"pure 配" "布物 (pure distribution)\" とも呼ばれます。" -#: ../../distutils/introduction.rst:198 +#: ../../distutils/introduction.rst:209 msgid "non-pure module distribution" msgstr "non-pure module distribution" -#: ../../distutils/introduction.rst:197 +#: ../../distutils/introduction.rst:208 msgid "" "a module distribution that contains at least one extension module. " "Sometimes referred to as a \"non-pure distribution.\"" @@ -428,11 +456,11 @@ msgstr "" "少なくとも一つの拡張モジュールが入ったモジュール配布物です。\"非 pure 配布物" "\"とも呼びます。" -#: ../../distutils/introduction.rst:202 +#: ../../distutils/introduction.rst:213 msgid "distribution root" msgstr "配布物ルート" -#: ../../distutils/introduction.rst:201 +#: ../../distutils/introduction.rst:212 msgid "" "the top-level directory of your source tree (or source distribution); the " "directory where :file:`setup.py` exists. Generally :file:`setup.py` will " diff --git a/distutils/packageindex.po b/distutils/packageindex.po index 2741a2c12..8df80a27d 100644 --- a/distutils/packageindex.po +++ b/distutils/packageindex.po @@ -1,20 +1,20 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2023, Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 +# tomo, 2019 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-19 14:13+0000\n" -"PO-Revision-Date: 2021-06-28 00:51+0000\n" -"Last-Translator: tomo, 2021\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 17:41+0000\n" +"Last-Translator: tomo, 2019\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" "Language: ja\n" "MIME-Version: 1.0\n" diff --git a/distutils/setupscript.po b/distutils/setupscript.po index 5161cb70d..bfc4b2689 100644 --- a/distutils/setupscript.po +++ b/distutils/setupscript.po @@ -1,25 +1,26 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2023, Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 -# mollinaca, 2021 -# Takeshi Nakazato, 2021 -# Atsuo Ishimoto , 2022 -# Arihiro TAKASE, 2023 -# Transifex Bot <>, 2023 +# Shun Sakurai, 2017 +# Nozomu Kaneko , 2017 +# Masato HASHIMOTO , 2017 +# Arihiro TAKASE, 2017 +# 秘湯 , 2017 +# tomo, 2019 +# mollinaca, 2020 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-19 14:13+0000\n" -"PO-Revision-Date: 2021-06-28 00:51+0000\n" -"Last-Translator: Transifex Bot <>, 2023\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 17:41+0000\n" +"Last-Translator: mollinaca, 2020\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" "Language: ja\n" "MIME-Version: 1.0\n" @@ -57,8 +58,8 @@ msgstr "" "ジュール配布物について Distutils に伝え、モジュール配布を操作するための様々な" "コマンドを正しく動作させることにあります。上の :ref:`distutils-simple-" "example` の節で見てきたように、 setup スクリプトは主に :func:`setup` の呼び出" -"しからなり、開発者が distutils に対して与えるほとんどの情報は :func:`setup` " -"のキーワード引数として指定されます。" +"しからなり、開発者が distuils に対して与えるほとんどの情報は :func:`setup` の" +"キーワード引数として指定されます。" #: ../../distutils/setupscript.rst:17 msgid "" @@ -1247,9 +1248,8 @@ msgid "" "``['foo', 'bar']``, Otherwise, it will be converted to a list of one string." msgstr "" "後方互換性を保つため、このフィールドはリストに加えて文字列も受け付けます。コ" -"ンマ区切りの文字列 ``'foo, bar'`` を与えると、文字列のリスト ``['foo', " -"'bar']`` に変換されます。それ以外の場合、1つの文字列だけを含むリストに変換さ" -"れます。" +"ンマ区切りの文字列``'foo, bar'``を与えると、文字列のリスト``['foo', 'bar']``" +"に変換されます。それ以外の場合、1つの文字列だけを含むリストに変換されます。" #: ../../distutils/setupscript.rst:641 msgid "'short string'" @@ -1265,9 +1265,11 @@ msgstr "「長い文字列」" #: ../../distutils/setupscript.rst:644 msgid "" -"Multiple lines of plain text in reStructuredText format (see https://" -"docutils.sourceforge.io/)." +"Multiple lines of plain text in reStructuredText format (see http://docutils." +"sourceforge.net/)." msgstr "" +"複数行からなり、ReStructuredText 形式で書かれたプレーンテキスト (http://" +"docutils.sourceforge.net/ を参照してください)。" #: ../../distutils/setupscript.rst:648 msgid "'list of strings'" diff --git a/distutils/sourcedist.po b/distutils/sourcedist.po index af42f4514..db1ac76c3 100644 --- a/distutils/sourcedist.po +++ b/distutils/sourcedist.po @@ -1,21 +1,24 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2023, Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2022 -# Transifex Bot <>, 2023 +# Masato HASHIMOTO , 2017 +# 秘湯 , 2017 +# Nozomu Kaneko , 2017 +# Arihiro TAKASE, 2017 +# tomo, 2019 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-19 14:13+0000\n" -"PO-Revision-Date: 2021-06-28 00:51+0000\n" -"Last-Translator: Transifex Bot <>, 2023\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 17:41+0000\n" +"Last-Translator: tomo, 2019\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" "Language: ja\n" "MIME-Version: 1.0\n" @@ -116,11 +119,6 @@ msgstr "``bztar``" msgid "bzip2'ed tar file (:file:`.tar.bz2`)" msgstr "bzip2 圧縮された tar ファイル (:file:`.tar.bz2`)" -#: ../../distutils/sourcedist.rst:34 ../../distutils/sourcedist.rst:37 -#: ../../distutils/sourcedist.rst:43 -msgid "\\(5)" -msgstr "\\(5)" - #: ../../distutils/sourcedist.rst:37 msgid "``xztar``" msgstr "``xztar``" @@ -138,8 +136,8 @@ msgid "compressed tar file (:file:`.tar.Z`)" msgstr "compress 圧縮された tar ファイル (:file:`.tar.Z`)" #: ../../distutils/sourcedist.rst:40 -msgid "(4),(5)" -msgstr "" +msgid "\\(4)" +msgstr "\\(4)" #: ../../distutils/sourcedist.rst:43 msgid "``tar``" @@ -184,12 +182,6 @@ msgstr "" #: ../../distutils/sourcedist.rst:65 msgid "" -"deprecated by `PEP 527 `_; `PyPI `_ only accepts ``.zip`` and ``.tar.gz`` files." -msgstr "" - -#: ../../distutils/sourcedist.rst:68 -msgid "" "When using any ``tar`` format (``gztar``, ``bztar``, ``xztar``, ``ztar`` or " "``tar``), under Unix you can specify the ``owner`` and ``group`` names that " "will be set for each member of the archive." @@ -198,17 +190,17 @@ msgstr "" "``tar``) を利用する時、 Unix ではアーカイブ内の各メンバに設定される " "``owner`` と ``group`` 名を指定することができます。" -#: ../../distutils/sourcedist.rst:72 +#: ../../distutils/sourcedist.rst:69 msgid "For example, if you want all files of the archive to be owned by root::" msgstr "" "例えば、アーカイブ内の全てのファイルの所有者を root にするには、次のようにし" "ます。 ::" -#: ../../distutils/sourcedist.rst:80 +#: ../../distutils/sourcedist.rst:77 msgid "Specifying the files to distribute" msgstr "配布するファイルを指定する" -#: ../../distutils/sourcedist.rst:82 +#: ../../distutils/sourcedist.rst:79 msgid "" "If you don't supply an explicit list of files (or instructions on how to " "generate one), the :command:`sdist` command puts a minimal default set into " @@ -218,7 +210,7 @@ msgstr "" "かった場合、 :command:`sdist` コマンドはソース配布物に以下のような最小のデ" "フォルトのセットを含めます:" -#: ../../distutils/sourcedist.rst:86 +#: ../../distutils/sourcedist.rst:83 msgid "" "all Python source files implied by the ``py_modules`` and ``packages`` " "options" @@ -226,14 +218,14 @@ msgstr "" "``py_modules`` と ``packages`` オプションに指定された Python ソースファイル全" "て" -#: ../../distutils/sourcedist.rst:89 +#: ../../distutils/sourcedist.rst:86 msgid "" "all C source files mentioned in the ``ext_modules`` or ``libraries`` options" msgstr "" "``ext_modules`` オプションと ``libraries`` オプションで挙げられている C ソー" "スファイル全て" -#: ../../distutils/sourcedist.rst:95 +#: ../../distutils/sourcedist.rst:92 msgid "" "scripts identified by the ``scripts`` option See :ref:`distutils-installing-" "scripts`." @@ -241,7 +233,7 @@ msgstr "" "``scripts`` オプションで指定されたスクリプト。 :ref:`distutils-installing-" "scripts` を参照してください。" -#: ../../distutils/sourcedist.rst:98 +#: ../../distutils/sourcedist.rst:95 msgid "" "anything that looks like a test script: :file:`test/test\\*.py` (currently, " "the Distutils don't do anything with test scripts except include them in " @@ -252,7 +244,7 @@ msgstr "" "Distutils はテストスクリプトをただソース配布物に含めるだけですが、将来は " "Python モジュール配布物に対するテスト標準ができるかもしれません)" -#: ../../distutils/sourcedist.rst:103 +#: ../../distutils/sourcedist.rst:100 msgid "" "Any of the standard README files (:file:`README`, :file:`README.txt`, or :" "file:`README.rst`), :file:`setup.py` (or whatever you called your setup " @@ -262,7 +254,7 @@ msgstr "" "rst`) のどれか、 :file:`setup.py` (または setup スクリプトにしているもの) 、" "および :file:`setup.cfg` 。" -#: ../../distutils/sourcedist.rst:107 +#: ../../distutils/sourcedist.rst:104 msgid "" "all files that matches the ``package_data`` metadata. See :ref:`distutils-" "installing-package-data`." @@ -270,7 +262,7 @@ msgstr "" "``package_data`` メタデータにマッチする全てのファイル。 :ref:`distutils-" "installing-package-data` を参照してください。" -#: ../../distutils/sourcedist.rst:110 +#: ../../distutils/sourcedist.rst:107 msgid "" "all files that matches the ``data_files`` metadata. See :ref:`distutils-" "additional-files`." @@ -278,7 +270,7 @@ msgstr "" "``data_files`` メタデータにマッチする全てのファイル。 :ref:`distutils-" "additional-files` を参照してください。" -#: ../../distutils/sourcedist.rst:113 +#: ../../distutils/sourcedist.rst:110 msgid "" "Sometimes this is enough, but usually you will want to specify additional " "files to distribute. The typical way to do this is to write a *manifest " @@ -297,7 +289,7 @@ msgstr "" "マンドはこのテンプレートを処理し、書かれた指示とファイルシステム上に見つかっ" "たファイルに基づいてマニフェストファイルを作成します。" -#: ../../distutils/sourcedist.rst:121 +#: ../../distutils/sourcedist.rst:118 msgid "" "If you prefer to roll your own manifest file, the format is simple: one " "filename per line, regular files (or symlinks to them) only. If you do " @@ -310,7 +302,7 @@ msgstr "" "せん: ただし、上で説明したデフォルトのファイルセットは、この中には含まれませ" "ん。" -#: ../../distutils/sourcedist.rst:126 +#: ../../distutils/sourcedist.rst:123 msgid "" "An existing generated :file:`MANIFEST` will be regenerated without :command:" "`sdist` comparing its modification time to the one of :file:`MANIFEST.in` " @@ -319,7 +311,7 @@ msgstr "" ":command:`sdist` は :file:`MANIFEST.in` もしくは :file:`setup.py` と更新時刻" "を比較せずに、生成されて既に存在している :file:`MANIFEST` を再生成します。" -#: ../../distutils/sourcedist.rst:131 +#: ../../distutils/sourcedist.rst:128 msgid "" ":file:`MANIFEST` files start with a comment indicating they are generated. " "Files without this comment are not overwritten or removed." @@ -327,7 +319,7 @@ msgstr "" ":file:`MANIFEST` ファイルの先頭に、生成されたものであることを示すコメントが付" "きます。このコメントが無いファイルは上書きや削除はされません。" -#: ../../distutils/sourcedist.rst:135 +#: ../../distutils/sourcedist.rst:132 msgid "" ":command:`sdist` will read a :file:`MANIFEST` file if no :file:`MANIFEST.in` " "exists, like it used to do." @@ -335,14 +327,14 @@ msgstr "" "以前そうであったように、 :file:`MANIFEST.in` が無い場合、 :command:`sdist` " "は :file:`MANIFEST` を読みに行きます。" -#: ../../distutils/sourcedist.rst:139 +#: ../../distutils/sourcedist.rst:136 msgid "" ":file:`README.rst` is now included in the list of distutils standard READMEs." msgstr "" ":file:`README.rst` が distutils の標準 README のリストに含まれるようになりま" "した。" -#: ../../distutils/sourcedist.rst:143 +#: ../../distutils/sourcedist.rst:140 msgid "" "The manifest template has one command per line, where each command specifies " "a set of files to include or exclude from the source distribution. For an " @@ -352,7 +344,7 @@ msgstr "" "ンドはソース配布物に含む、もしくは含まないファイルの集合を指定します。例とし" "て、再度 Distutils 自身のマニフェストテンプレートに戻りましょう:" -#: ../../distutils/sourcedist.rst:153 +#: ../../distutils/sourcedist.rst:150 msgid "" "The meanings should be fairly clear: include all files in the distribution " "root matching :file:`\\*.txt`, all files anywhere under the :file:`examples` " @@ -375,7 +367,7 @@ msgstr "" "トテンプレートの小言語では、他にもいくつかのコマンドが利用できます; :ref:" "`sdist-cmd` を参照してください。" -#: ../../distutils/sourcedist.rst:163 +#: ../../distutils/sourcedist.rst:160 msgid "" "The order of commands in the manifest template matters: initially, we have " "the list of default files as described above, and each command in the " @@ -389,13 +381,13 @@ msgstr "" "を完全に処理し終えたら、ソース配布物中に含めるべきでない以下のファイルをリス" "トから除去します:" -#: ../../distutils/sourcedist.rst:169 +#: ../../distutils/sourcedist.rst:166 msgid "all files in the Distutils \"build\" tree (default :file:`build/`)" msgstr "" "Distutls の \"build\" (デフォルトの名前は :file:`build/`) ツリー下にある全て" "のファイル" -#: ../../distutils/sourcedist.rst:171 +#: ../../distutils/sourcedist.rst:168 msgid "" "all files in directories named :file:`RCS`, :file:`CVS`, :file:`.svn`, :file:" "`.hg`, :file:`.git`, :file:`.bzr` or :file:`_darcs`" @@ -403,7 +395,7 @@ msgstr "" ":file:`RCS`, :file:`CVS`, :file:`.svn`, :file:`.hg`, :file:`.git`, :file:`." "bzr`, :file:`_darcs` といった名前のディレクトリ下にある全てのファイル" -#: ../../distutils/sourcedist.rst:174 +#: ../../distutils/sourcedist.rst:171 msgid "" "Now we have our complete list of files, which is written to the manifest for " "future reference, and then used to build the source distribution archive(s)." @@ -411,7 +403,7 @@ msgstr "" "こうして完全なファイルのリストができ、後で参照するためにマニフェストに書き込" "まれます。この内容は、ソース配布物のアーカイブを作成する際に使われます。" -#: ../../distutils/sourcedist.rst:177 +#: ../../distutils/sourcedist.rst:174 msgid "" "You can disable the default set of included files with the :option:`!--no-" "defaults` option, and you can disable the standard exclude set with :option:" @@ -420,7 +412,7 @@ msgstr "" "含めるファイルのデフォルトセットは :option:`!--no-defaults` で無効化でき、標" "準で除外するセットは :option:`!--no-prune` で無効化できます。" -#: ../../distutils/sourcedist.rst:181 +#: ../../distutils/sourcedist.rst:178 msgid "" "Following the Distutils' own manifest template, let's trace how the :command:" "`sdist` command builds the list of files to include in the Distutils source " @@ -430,7 +422,7 @@ msgstr "" "のようにして Distutils ソース配布物に含めるファイルのリストを作成するか見てみ" "ましょう:" -#: ../../distutils/sourcedist.rst:185 +#: ../../distutils/sourcedist.rst:182 msgid "" "include all Python source files in the :file:`distutils` and :file:" "`distutils/command` subdirectories (because packages corresponding to those " @@ -442,7 +434,7 @@ msgstr "" "トリが、setup スクリプト下の ``packages`` オプションに記載されているからです " "--- :ref:`setup-script` を参照してください)" -#: ../../distutils/sourcedist.rst:190 +#: ../../distutils/sourcedist.rst:187 msgid "" "include :file:`README.txt`, :file:`setup.py`, and :file:`setup.cfg` " "(standard files)" @@ -450,11 +442,11 @@ msgstr "" ":file:`README.txt`, :file:`setup.py`, および :file:`setup.cfg` (標準のファイ" "ルセット) を含めます" -#: ../../distutils/sourcedist.rst:193 +#: ../../distutils/sourcedist.rst:190 msgid "include :file:`test/test\\*.py` (standard files)" msgstr ":file:`test/test\\*.py` (標準のファイルセット) を含めます" -#: ../../distutils/sourcedist.rst:195 +#: ../../distutils/sourcedist.rst:192 msgid "" "include :file:`\\*.txt` in the distribution root (this will find :file:" "`README.txt` a second time, but such redundancies are weeded out later)" @@ -462,7 +454,7 @@ msgstr "" "配布物ルート下の :file:`\\*.txt` を含めます (この処理で、 :file:`README.txt` " "がもう一度見つかりますが、こうした冗長性は後で刈り取られます)" -#: ../../distutils/sourcedist.rst:198 +#: ../../distutils/sourcedist.rst:195 msgid "" "include anything matching :file:`\\*.txt` or :file:`\\*.py` in the sub-tree " "under :file:`examples`," @@ -470,7 +462,7 @@ msgstr "" ":file:`examples` 下にあるサブツリー内で :file:`\\*.txt` または :file:`\\*." "py` にマッチする全てのファイルを含めます" -#: ../../distutils/sourcedist.rst:201 +#: ../../distutils/sourcedist.rst:198 msgid "" "exclude all files in the sub-trees starting at directories matching :file:" "`examples/sample?/build`\\ ---this may exclude files included by the " @@ -483,7 +475,7 @@ msgstr "" "テンプレート内では ``recursive-include`` コマンドの後に ``prune`` コマンドを" "持ってくることが重要です" -#: ../../distutils/sourcedist.rst:206 +#: ../../distutils/sourcedist.rst:203 msgid "" "exclude the entire :file:`build` tree, and any :file:`RCS`, :file:`CVS`, :" "file:`.svn`, :file:`.hg`, :file:`.git`, :file:`.bzr` and :file:`_darcs` " @@ -493,7 +485,7 @@ msgstr "" "file:`.hg`, :file:`.git`, :file:`.bzr`, :file:`_darcs` ディレクトリ全てを除外" "します。" -#: ../../distutils/sourcedist.rst:210 +#: ../../distutils/sourcedist.rst:207 msgid "" "Just like in the setup script, file and directory names in the manifest " "template should always be slash-separated; the Distutils will take care of " @@ -505,18 +497,18 @@ msgstr "" "ラットフォームでの標準的な表現に変換します。このため、マニフェストテンプレー" "トは複数のオペレーティングシステムにわたって可搬性を持ちます。" -#: ../../distutils/sourcedist.rst:219 +#: ../../distutils/sourcedist.rst:216 msgid "Manifest-related options" msgstr "マニフェスト (manifest) 関連のオプション" -#: ../../distutils/sourcedist.rst:221 +#: ../../distutils/sourcedist.rst:218 msgid "" "The normal course of operations for the :command:`sdist` command is as " "follows:" msgstr "" ":command:`sdist` コマンドが通常行う処理の流れは、以下のようになっています:" -#: ../../distutils/sourcedist.rst:223 +#: ../../distutils/sourcedist.rst:220 msgid "" "if the manifest file (:file:`MANIFEST` by default) exists and the first line " "does not have a comment indicating it is generated from :file:`MANIFEST.in`, " @@ -526,7 +518,7 @@ msgstr "" "file:`MANIFEST.in` から生成されたことを示すコメントが無い場合は、変更を加えず" "にそのまま使用します" -#: ../../distutils/sourcedist.rst:227 +#: ../../distutils/sourcedist.rst:224 msgid "" "if the manifest file doesn't exist or has been previously automatically " "generated, read :file:`MANIFEST.in` and create the manifest" @@ -534,7 +526,7 @@ msgstr "" "マニフェストファイルが存在しないか、前回自動生成されていた場合は、 :file:" "`MANIFEST.in` を読み込み、マニフェストを作成します" -#: ../../distutils/sourcedist.rst:230 +#: ../../distutils/sourcedist.rst:227 msgid "" "if neither :file:`MANIFEST` nor :file:`MANIFEST.in` exist, create a manifest " "with just the default file set" @@ -542,7 +534,7 @@ msgstr "" ":file:`MANIFEST` も :file:`MANIFEST.in` もなければ、デフォルトのファイルセッ" "トだけでできたマニフェストファイルを作成します" -#: ../../distutils/sourcedist.rst:233 +#: ../../distutils/sourcedist.rst:230 msgid "" "use the list of files now in :file:`MANIFEST` (either just generated or read " "in) to create the source distribution archive(s)" @@ -550,7 +542,7 @@ msgstr "" "(生成されたか、読み出された) :file:`MANIFEST` 内にあるファイルのリストを使っ" "てソース配布物アーカイブを作成します" -#: ../../distutils/sourcedist.rst:236 +#: ../../distutils/sourcedist.rst:233 msgid "" "There are a couple of options that modify this behaviour. First, use the :" "option:`!--no-defaults` and :option:`!--no-prune` to disable the standard " @@ -560,7 +552,7 @@ msgstr "" "よび \"exclude\" セットを無効化するには :option:`!--no-defaults` および :" "option:`!--no-prune` を使います。" -#: ../../distutils/sourcedist.rst:240 +#: ../../distutils/sourcedist.rst:237 msgid "" "Second, you might just want to (re)generate the manifest, but not create a " "source distribution::" @@ -568,6 +560,6 @@ msgstr "" "第2に、単にマニフェストを (再)生成したいだけで、ソース配布物は作成したくない" "場合があるかもしれません::" -#: ../../distutils/sourcedist.rst:245 +#: ../../distutils/sourcedist.rst:242 msgid ":option:`!-o` is a shortcut for :option:`!--manifest-only`." msgstr ":option:`!-o` は :option:`!--manifest-only` のショートカットです。" diff --git a/distutils/uploading.po b/distutils/uploading.po index 379a6fdb2..3624ff2b9 100644 --- a/distutils/uploading.po +++ b/distutils/uploading.po @@ -1,20 +1,21 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2023, Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 +# Arihiro TAKASE, 2017 +# tomo, 2019 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.11\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-05-19 14:13+0000\n" -"PO-Revision-Date: 2021-06-28 00:51+0000\n" -"Last-Translator: tomo, 2021\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 17:41+0000\n" +"Last-Translator: tomo, 2019\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" "Language: ja\n" "MIME-Version: 1.0\n" diff --git a/extending/building.po b/extending/building.po index 6a39fdb6a..44fe260f5 100644 --- a/extending/building.po +++ b/extending/building.po @@ -1,27 +1,27 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 -# 菊池 健志, 2023 -# 石井明久, 2024 +# Shun Sakurai, 2017 +# Arihiro TAKASE, 2017 +# tomo, 2019 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-30 14:22+0000\n" -"PO-Revision-Date: 2021-06-28 00:51+0000\n" -"Last-Translator: 石井明久, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 17:42+0000\n" +"Last-Translator: tomo, 2019\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../extending/building.rst:7 @@ -40,13 +40,13 @@ msgstr "" msgid "" "To be importable, the shared library must be available on :envvar:" "`PYTHONPATH`, and must be named after the module name, with an appropriate " -"extension. When using setuptools, the correct filename is generated " +"extension. When using distutils, the correct filename is generated " "automatically." msgstr "" "インポートできるように、共有ライブラリは使える状態で :envvar:`PYTHONPATH` 上" "になければならず、ファイル名をモジュール名に揃え、適切な拡張子になっていなけ" -"ればいけません。 setuptools を使っているときは、自動的に正しいファイル名が生" -"成されます。" +"ればいけません。\n" +"distutils を使っているときは、自動的に正しいファイル名が生成されます。" #: ../../extending/building.rst:16 msgid "The initialization function has the signature:" @@ -54,32 +54,31 @@ msgstr "初期化関数のシグネチャは次のとおりです:" #: ../../extending/building.rst:20 msgid "" -"It returns either a fully initialized module, or a :c:type:`PyModuleDef` " +"It returns either a fully-initialized module, or a :c:type:`PyModuleDef` " "instance. See :ref:`initializing-modules` for details." msgstr "" -"この関数は完全に初期化されたモジュールか、 :c:type:`PyModuleDef` インスタンス" -"を返します。\n" +"この関数は初期化がモジュールか、 :c:type:`PyModuleDef` インスタンスを返しま" +"す。\n" "詳しいことは :ref:`initializing-modules` を参照してください。" #: ../../extending/building.rst:25 msgid "" -"For modules with ASCII-only names, the function must be named :samp:" -"`PyInit_{}`, with ```` replaced by the name of the module. When " -"using :ref:`multi-phase-initialization`, non-ASCII module names are allowed. " -"In this case, the initialization function name is :samp:`PyInitU_{}`, " -"with ```` encoded using Python's *punycode* encoding with hyphens " -"replaced by underscores. In Python::" -msgstr "" - -#: ../../extending/building.rst:32 -msgid "" -"def initfunc_name(name):\n" -" try:\n" -" suffix = b'_' + name.encode('ascii')\n" -" except UnicodeEncodeError:\n" -" suffix = b'U_' + name.encode('punycode').replace(b'-', b'_')\n" -" return b'PyInit' + suffix" +"For modules with ASCII-only names, the function must be named " +"``PyInit_``, with ```` replaced by the name of the " +"module. When using :ref:`multi-phase-initialization`, non-ASCII module names " +"are allowed. In this case, the initialization function name is " +"``PyInitU_``, with ```` encoded using Python's " +"*punycode* encoding with hyphens replaced by underscores. In Python::" msgstr "" +"名前にASCIIしか使っていないモジュールの場合、関数名は " +"``PyInit_`` の ```` をモジュール名で置き換えたもので" +"なければなりません。\n" +":ref:`multi-phase-initialization` を使っているときは、モジュール名にASCII以外" +"の文字も使えます。\n" +"この場合、初期化関数の名前は ``PyInitU_`` で、 ```` " +"はハイフンをアンダースコアで置き換えて Python の *punycode* エンコーディング" +"でエンコードしたものになります。\n" +"Python で書くと次のような処理になります::" #: ../../extending/building.rst:39 msgid "" @@ -97,18 +96,164 @@ msgstr "" "詳しいことは :pep:`489` の *\"Multiple modules in one library\"* 節を参照して" "ください。" -#: ../../extending/building.rst:52 -msgid "Building C and C++ Extensions with setuptools" -msgstr "setuptools による C および C++ 拡張のビルド" +#: ../../extending/building.rst:49 +msgid "Building C and C++ Extensions with distutils" +msgstr "distutils による C および C++ 拡張モジュールのビルド" + +#: ../../extending/building.rst:53 +msgid "" +"Extension modules can be built using distutils, which is included in " +"Python. Since distutils also supports creation of binary packages, users " +"don't necessarily need a compiler and distutils to install the extension." +msgstr "" +"拡張モジュールは Python に含まれる distutils を使ってビルドできます。\n" +"distutils はバイナリパッケージの作成もサポートしているので、ユーザが拡張モ" +"ジュールをインストールする際に、必ずしもコンパイラや distutils が必要というわ" +"けではありません。" + +#: ../../extending/building.rst:57 +msgid "" +"A distutils package contains a driver script, :file:`setup.py`. This is a " +"plain Python file, which, in the most simple case, could look like this:" +msgstr "" +"distutils ベースのパッケージには、駆動スクリプト (driver script) となる :" +"file:`setup.py` が入っています。\n" +":file:`setup.py` は普通の Python プログラムファイルで、ほとんどの場合以下のよ" +"うな内容になっています:" + +#: ../../extending/building.rst:73 +msgid "With this :file:`setup.py`, and a file :file:`demo.c`, running ::" +msgstr "" +"この :file:`setup.py` とファイル :file:`demo.c` があるとき、以下のコマンド ::" + +#: ../../extending/building.rst:77 +msgid "" +"will compile :file:`demo.c`, and produce an extension module named ``demo`` " +"in the :file:`build` directory. Depending on the system, the module file " +"will end up in a subdirectory :file:`build/lib.system`, and may have a name " +"like :file:`demo.so` or :file:`demo.pyd`." +msgstr "" +"を実行すると、 :file:`demo.c` をコンパイルして、 ``demo`` という名前の拡張モ" +"ジュールを :file:`build` ディレクトリ内に生成します。システムによってはモ" +"ジュールファイルは :file:`build/lib.system` サブディレクトリに生成され、 :" +"file:`demo.so` や :file:`demo.pyd` といった名前になることがあります。" + +#: ../../extending/building.rst:82 +msgid "" +"In the :file:`setup.py`, all execution is performed by calling the ``setup`` " +"function. This takes a variable number of keyword arguments, of which the " +"example above uses only a subset. Specifically, the example specifies meta-" +"information to build packages, and it specifies the contents of the " +"package. Normally, a package will contain additional modules, like Python " +"source modules, documentation, subpackages, etc. Please refer to the " +"distutils documentation in :ref:`distutils-index` to learn more about the " +"features of distutils; this section explains building extension modules only." +msgstr "" +":file:`setup.py` 内では、コマンドの実行はすべて ``setup`` 関数を呼び出して行" +"います。\n" +"この関数は可変個のキーワード引数を取ります。上の例ではその一部を使っているに" +"すぎません。\n" +"もっと具体的にいうと、この例の中ではパッケージをビルドするためのメタ情報と、" +"パッケージの内容を指定しています。\n" +"通常、パッケージには Python ソースモジュールやドキュメント、サブパッケージ等" +"といった別のモジュールも入ります。 \n" +"distutils の機能に関する詳細は、 :ref:`distutils-index` に書かれている " +"distutils のドキュメントを参照してください; この節では拡張モジュールのビルド" +"についてのみ説明します。" + +#: ../../extending/building.rst:91 +msgid "" +"It is common to pre-compute arguments to :func:`setup`, to better structure " +"the driver script. In the example above, the ``ext_modules`` argument to :" +"func:`~distutils.core.setup` is a list of extension modules, each of which " +"is an instance of the :class:`~distutils.extension.Extension`. In the " +"example, the instance defines an extension named ``demo`` which is build by " +"compiling a single source file, :file:`demo.c`." +msgstr "" +"駆動スクリプトの構成をよりよくするために、 :func:`setup` への引数を前もって計" +"算しておくことがよくあります。\n" +"上の例では、 :func:`~distutils.core.setup` の ``ext_modules`` は拡張モジュー" +"ルのリストで、リストの各々の要素は :class:`~distutils.extension.Extension` ク" +"ラスのインスタンスになっています。\n" +"上の例では、 ``demo`` という名の拡張モジュールを定義していて、単一のソース" +"ファイル :file:`demo.c` をコンパイルしてビルドするよう定義しています。" + +#: ../../extending/building.rst:99 +msgid "" +"In many cases, building an extension is more complex, since additional " +"preprocessor defines and libraries may be needed. This is demonstrated in " +"the example below." +msgstr "" +"多くの場合、拡張モジュールのビルドはもっと複雑になります。\n" +"というのは、プリプロセッサ定義やライブラリの追加指定が必要になることがあるか" +"らです。\n" +"例えば以下のファイルがその実例です。" + +#: ../../extending/building.rst:127 +msgid "" +"In this example, :func:`~distutils.core.setup` is called with additional " +"meta-information, which is recommended when distribution packages have to be " +"built. For the extension itself, it specifies preprocessor defines, include " +"directories, library directories, and libraries. Depending on the compiler, " +"distutils passes this information in different ways to the compiler. For " +"example, on Unix, this may result in the compilation commands ::" +msgstr "" +"この例では、メタ情報が追加された状態で :func:`~distutils.core.setup` が呼び出" +"されていますが、配布パッケージを構築するにあたっては、メタ情報を付けておくこ" +"とが推奨されます。\n" +"拡張モジュール自体についてのメタ情報には、プリプロセッサ定義、インクルード" +"ファイルのディレクトリ、ライブラリのディレクトリ、ライブラリといった指定があ" +"ります。\n" +"distutils はこの情報をコンパイラに応じて異なるやり方で引渡します。\n" +"例えば Unix では、上の設定は以下のようなコンパイルコマンドになるかもしれませ" +"ん ::" + +#: ../../extending/building.rst:139 +msgid "" +"These lines are for demonstration purposes only; distutils users should " +"trust that distutils gets the invocations right." +msgstr "" +"これらのコマンドラインは実演目的で書かれたものです; distutils のユーザは " +"distutils が正しくコマンドを実行すると信用してください。" + +#: ../../extending/building.rst:146 +msgid "Distributing your extension modules" +msgstr "拡張モジュールの配布" + +#: ../../extending/building.rst:148 +msgid "" +"When an extension has been successfully built, there are three ways to use " +"it." +msgstr "拡張モジュールをうまくビルドできたら、三通りの使い方があります。" + +#: ../../extending/building.rst:150 +msgid "" +"End-users will typically want to install the module, they do so by running ::" +msgstr "" +"エンドユーザは普通モジュールをインストールしようと考えます; これには、次を実" +"行します ::" + +#: ../../extending/building.rst:154 +msgid "" +"Module maintainers should produce source packages; to do so, they run ::" +msgstr "" +"モジュールメンテナはソースパッケージを作成します; これには、次を実行します ::" + +#: ../../extending/building.rst:158 +msgid "" +"In some cases, additional files need to be included in a source " +"distribution; this is done through a :file:`MANIFEST.in` file; see :ref:" +"`manifest` for details." +msgstr "" +"場合によってはソース配布物に追加のファイルを含める必要があります; これには :" +"file:`MANIFEST.in` ファイルを使います; 詳しくは :ref:`manifest` を参照してく" +"ださい。" -#: ../../extending/building.rst:54 +#: ../../extending/building.rst:161 msgid "" -"Python 3.12 and newer no longer come with distutils. Please refer to the " -"``setuptools`` documentation at https://setuptools.readthedocs.io/en/latest/" -"setuptools.html to learn more about how build and distribute C/C++ " -"extensions with setuptools." +"If the source distribution has been built successfully, maintainers can also " +"create binary distributions. Depending on the platform, one of the following " +"commands can be used to do so. ::" msgstr "" -"Python 3.12 以降には、 distutils は含まれていません。 setuptools で C/C++ 拡" -"張をビルドする方法について更に学ぶには、 https://setuptools.readthedocs.io/" -"en/latest/setuptools.html にある ``setuptools`` のドキュメントを参照してくだ" -"さい。" +"ソースコード配布物をうまく構築できたら、メンテナはバイナリ配布物も作成できま" +"す。プラットフォームに応じて、以下のコマンドのいずれかを使います。 ::" diff --git a/extending/embedding.po b/extending/embedding.po index 32f74c4a0..234584678 100644 --- a/extending/embedding.po +++ b/extending/embedding.po @@ -1,28 +1,31 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 -# mollinaca, 2021 -# 菊池 健志, 2023 -# 石井明久, 2024 +# Osamu NAKAMURA, 2017 +# Nozomu Kaneko , 2017 +# 秘湯 , 2017 +# Arihiro TAKASE, 2017 +# Inada Naoki , 2017 +# tomo, 2019 +# mollinaca, 2020 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-30 14:22+0000\n" -"PO-Revision-Date: 2021-06-28 00:51+0000\n" -"Last-Translator: 石井明久, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 17:42+0000\n" +"Last-Translator: mollinaca, 2020\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../extending/embedding.rst:8 @@ -97,7 +100,7 @@ msgstr "" "func:`PyRun_SimpleFile` に渡す、といった具合です。これまでの各章で説明した低" "水準の操作を呼び出して、Python オブジェクトを構築したり使用したりもできます。" -#: ../../extending/embedding.rst:41 +#: ../../extending/embedding.rst:42 msgid ":ref:`c-api-index`" msgstr ":ref:`c-api-index`" @@ -125,76 +128,36 @@ msgstr "" "トを実行するためのものです。例えばこれは、一つのファイル上で何らかの操作を実" "現するのに利用できます。 ::" -#: ../../extending/embedding.rst:56 -msgid "" -"#define PY_SSIZE_T_CLEAN\n" -"#include \n" -"\n" -"int\n" -"main(int argc, char *argv[])\n" -"{\n" -" PyStatus status;\n" -" PyConfig config;\n" -" PyConfig_InitPythonConfig(&config);\n" -"\n" -" /* optional but recommended */\n" -" status = PyConfig_SetBytesString(&config, &config.program_name, " -"argv[0]);\n" -" if (PyStatus_Exception(status)) {\n" -" goto exception;\n" -" }\n" -"\n" -" status = Py_InitializeFromConfig(&config);\n" -" if (PyStatus_Exception(status)) {\n" -" goto exception;\n" -" }\n" -" PyConfig_Clear(&config);\n" -"\n" -" PyRun_SimpleString(\"from time import time,ctime\\n\"\n" -" \"print('Today is', ctime(time()))\\n\");\n" -" if (Py_FinalizeEx() < 0) {\n" -" exit(120);\n" -" }\n" -" return 0;\n" -"\n" -" exception:\n" -" PyConfig_Clear(&config);\n" -" Py_ExitStatusException(status);\n" -"}" -msgstr "" - -#: ../../extending/embedding.rst:92 -msgid "" -"``#define PY_SSIZE_T_CLEAN`` was used to indicate that ``Py_ssize_t`` should " -"be used in some APIs instead of ``int``. It is not necessary since Python " -"3.13, but we keep it here for backward compatibility. See :ref:`arg-parsing-" -"string-and-buffers` for a description of this macro." -msgstr "" -"``#define PY_SSIZE_T_CLEAN`` は、いくつかの API では ``int`` の代わりに " -"``Py_ssize_t`` が使われるべきであることを示すために使われていました。これは " -"Python 3.13 以降では不要となりましたが、後方互換性のために維持されています。" -"このマクロの説明は :ref:`arg-parsing-string-and-buffers` にあります。" - -#: ../../extending/embedding.rst:97 -msgid "" -"Setting :c:member:`PyConfig.program_name` should be called before :c:func:" -"`Py_InitializeFromConfig` to inform the interpreter about paths to Python " -"run-time libraries. Next, the Python interpreter is initialized with :c:" -"func:`Py_Initialize`, followed by the execution of a hard-coded Python " -"script that prints the date and time. Afterwards, the :c:func:" -"`Py_FinalizeEx` call shuts the interpreter down, followed by the end of the " -"program. In a real program, you may want to get the Python script from " -"another source, perhaps a text-editor routine, a file, or a database. " -"Getting the Python code from a file can better be done by using the :c:func:" -"`PyRun_SimpleFile` function, which saves you the trouble of allocating " -"memory space and loading the file contents." -msgstr "" - -#: ../../extending/embedding.rst:112 +#: ../../extending/embedding.rst:78 +msgid "" +"The :c:func:`Py_SetProgramName` function should be called before :c:func:" +"`Py_Initialize` to inform the interpreter about paths to Python run-time " +"libraries. Next, the Python interpreter is initialized with :c:func:" +"`Py_Initialize`, followed by the execution of a hard-coded Python script " +"that prints the date and time. Afterwards, the :c:func:`Py_FinalizeEx` call " +"shuts the interpreter down, followed by the end of the program. In a real " +"program, you may want to get the Python script from another source, perhaps " +"a text-editor routine, a file, or a database. Getting the Python code from " +"a file can better be done by using the :c:func:`PyRun_SimpleFile` function, " +"which saves you the trouble of allocating memory space and loading the file " +"contents." +msgstr "" +":c:func:`Py_SetProgramName` は :c:func:`Py_Initialize` の前に呼び出す必要があ" +"ります。これによりインタプリタにランタイムライブラリへのパスを伝えることが出" +"来ます。続いて、Python インタプリタを :c:func:`Py_Initialize` で初期化し、続" +"いてハードコードされた Python スクリプトで日付と時間の出力を実行します。その" +"後、 :c:func:`Py_FinalizeEx` の呼び出しでインタプリタを終了し, プログラムの終" +"了に続きます。実際のプログラムでは、Python スクリプトを他のソース、おそらくテ" +"キストエディタルーチンやファイル、データベースから取り出したいと考えるかもし" +"れません。Python コードをファイルから取り出すには、 :c:func:" +"`PyRun_SimpleFile` 関数を使うのがよいでしょう。この関数はメモリを確保して、" +"ファイルの内容をロードする手間を省いてくれます。" + +#: ../../extending/embedding.rst:93 msgid "Beyond Very High Level Embedding: An overview" msgstr "超高水準の埋め込みから踏み出す: 概要" -#: ../../extending/embedding.rst:114 +#: ../../extending/embedding.rst:95 msgid "" "The high level interface gives you the ability to execute arbitrary pieces " "of Python code from your application, but exchanging data values is quite " @@ -208,7 +171,7 @@ msgstr "" "り低水準のインターフェース呼び出しを利用しなくてはなりません。より多く C コー" "ドを書かねばならない代わりに、ほぼ何でもできるようになります。" -#: ../../extending/embedding.rst:119 +#: ../../extending/embedding.rst:100 msgid "" "It should be noted that extending Python and embedding Python is quite the " "same activity, despite the different intent. Most topics discussed in the " @@ -220,40 +183,40 @@ msgstr "" "まります。これを示すために、 Python から C への拡張を行うコードが実際には何を" "するか考えてみましょう:" -#: ../../extending/embedding.rst:124 +#: ../../extending/embedding.rst:105 msgid "Convert data values from Python to C," msgstr "データ値を Python から C に変換する。" -#: ../../extending/embedding.rst:126 +#: ../../extending/embedding.rst:107 msgid "Perform a function call to a C routine using the converted values, and" msgstr "変換された値を使って C ルーチンの関数呼び出しを行い、" -#: ../../extending/embedding.rst:128 +#: ../../extending/embedding.rst:109 msgid "Convert the data values from the call from C to Python." msgstr "呼び出しで得られたデータ値 C から Python に変換する。" -#: ../../extending/embedding.rst:130 +#: ../../extending/embedding.rst:111 msgid "When embedding Python, the interface code does:" msgstr "" "Python を埋め込む場合には、インターフェースコードが行う作業は以下のようになり" "ます:" -#: ../../extending/embedding.rst:132 +#: ../../extending/embedding.rst:113 msgid "Convert data values from C to Python," msgstr "データ値を C から Python に変換する。" -#: ../../extending/embedding.rst:134 +#: ../../extending/embedding.rst:115 msgid "" "Perform a function call to a Python interface routine using the converted " "values, and" msgstr "" "変換された値を使って Python インターフェースルーチンの関数呼び出しを行い、" -#: ../../extending/embedding.rst:137 +#: ../../extending/embedding.rst:118 msgid "Convert the data values from the call from Python to C." msgstr "呼び出しで得られたデータ値 Python から C に変換する。" -#: ../../extending/embedding.rst:139 +#: ../../extending/embedding.rst:120 msgid "" "As you can see, the data conversion steps are simply swapped to accommodate " "the different direction of the cross-language transfer. The only difference " @@ -265,7 +228,7 @@ msgstr "" "あるルーチンです。拡張を行う際には C ルーチンを呼び出しますが、埋め込みの際に" "は Python ルーチンを呼び出します。" -#: ../../extending/embedding.rst:144 +#: ../../extending/embedding.rst:125 msgid "" "This chapter will not discuss how to convert data from Python to C and vice " "versa. Also, proper use of references and dealing with errors is assumed to " @@ -277,11 +240,11 @@ msgstr "" "いるものと仮定します。これらの側面についてはインタプリタの拡張と何ら変わると" "ころがないので、必要な情報については以前の章を参照できます。" -#: ../../extending/embedding.rst:153 +#: ../../extending/embedding.rst:134 msgid "Pure Embedding" msgstr "純粋な埋め込み" -#: ../../extending/embedding.rst:155 +#: ../../extending/embedding.rst:136 msgid "" "The first program aims to execute a function in a Python script. Like in the " "section about the very high level interface, the Python interpreter does not " @@ -293,89 +256,13 @@ msgstr "" "はアプリケーションと直接やりとりはしません (が、次の節でやりとりするよう変更" "します)。" -#: ../../extending/embedding.rst:160 +#: ../../extending/embedding.rst:141 msgid "The code to run a function defined in a Python script is:" msgstr "" "Python スクリプト内で定義されている関数を実行するためのコードは以下のようにな" "ります:" -#: ../../extending/embedding.rst:162 -msgid "" -"#define PY_SSIZE_T_CLEAN\n" -"#include \n" -"\n" -"int\n" -"main(int argc, char *argv[])\n" -"{\n" -" PyObject *pName, *pModule, *pFunc;\n" -" PyObject *pArgs, *pValue;\n" -" int i;\n" -"\n" -" if (argc < 3) {\n" -" fprintf(stderr,\"Usage: call pythonfile funcname [args]\\n\");\n" -" return 1;\n" -" }\n" -"\n" -" Py_Initialize();\n" -" pName = PyUnicode_DecodeFSDefault(argv[1]);\n" -" /* Error checking of pName left out */\n" -"\n" -" pModule = PyImport_Import(pName);\n" -" Py_DECREF(pName);\n" -"\n" -" if (pModule != NULL) {\n" -" pFunc = PyObject_GetAttrString(pModule, argv[2]);\n" -" /* pFunc is a new reference */\n" -"\n" -" if (pFunc && PyCallable_Check(pFunc)) {\n" -" pArgs = PyTuple_New(argc - 3);\n" -" for (i = 0; i < argc - 3; ++i) {\n" -" pValue = PyLong_FromLong(atoi(argv[i + 3]));\n" -" if (!pValue) {\n" -" Py_DECREF(pArgs);\n" -" Py_DECREF(pModule);\n" -" fprintf(stderr, \"Cannot convert argument\\n\");\n" -" return 1;\n" -" }\n" -" /* pValue reference stolen here: */\n" -" PyTuple_SetItem(pArgs, i, pValue);\n" -" }\n" -" pValue = PyObject_CallObject(pFunc, pArgs);\n" -" Py_DECREF(pArgs);\n" -" if (pValue != NULL) {\n" -" printf(\"Result of call: %ld\\n\", PyLong_AsLong(pValue));\n" -" Py_DECREF(pValue);\n" -" }\n" -" else {\n" -" Py_DECREF(pFunc);\n" -" Py_DECREF(pModule);\n" -" PyErr_Print();\n" -" fprintf(stderr,\"Call failed\\n\");\n" -" return 1;\n" -" }\n" -" }\n" -" else {\n" -" if (PyErr_Occurred())\n" -" PyErr_Print();\n" -" fprintf(stderr, \"Cannot find function \\\"%s\\\"\\n\", " -"argv[2]);\n" -" }\n" -" Py_XDECREF(pFunc);\n" -" Py_DECREF(pModule);\n" -" }\n" -" else {\n" -" PyErr_Print();\n" -" fprintf(stderr, \"Failed to load \\\"%s\\\"\\n\", argv[1]);\n" -" return 1;\n" -" }\n" -" if (Py_FinalizeEx() < 0) {\n" -" return 120;\n" -" }\n" -" return 0;\n" -"}\n" -msgstr "" - -#: ../../extending/embedding.rst:165 +#: ../../extending/embedding.rst:146 msgid "" "This code loads a Python script using ``argv[1]``, and calls the function " "named in ``argv[2]``. Its integer arguments are the other values of the " @@ -389,28 +276,11 @@ msgstr "" "(できた実行可能形式を :program:`call` と呼びましょう)、以下のような Python ス" "クリプトを実行することにします:" -#: ../../extending/embedding.rst:171 -msgid "" -"def multiply(a,b):\n" -" print(\"Will compute\", a, \"times\", b)\n" -" c = 0\n" -" for i in range(0, a):\n" -" c = c + b\n" -" return c" -msgstr "" - -#: ../../extending/embedding.rst:180 +#: ../../extending/embedding.rst:161 msgid "then the result should be:" msgstr "実行結果は以下のようになるはずです:" -#: ../../extending/embedding.rst:182 -msgid "" -"$ call multiply multiply 3 2\n" -"Will compute 3 times 2\n" -"Result of call: 6" -msgstr "" - -#: ../../extending/embedding.rst:188 +#: ../../extending/embedding.rst:169 msgid "" "Although the program is quite large for its functionality, most of the code " "is for data conversion between Python and C, and for error reporting. The " @@ -420,34 +290,18 @@ msgstr "" "Python から C へのデータ変換やエラー報告のためのコードです。Python の埋め込み" "という観点から最も興味深い部分は以下のコードから始まる部分です::" -#: ../../extending/embedding.rst:192 -msgid "" -"Py_Initialize();\n" -"pName = PyUnicode_DecodeFSDefault(argv[1]);\n" -"/* Error checking of pName left out */\n" -"pModule = PyImport_Import(pName);" -msgstr "" - -#: ../../extending/embedding.rst:197 +#: ../../extending/embedding.rst:178 msgid "" "After initializing the interpreter, the script is loaded using :c:func:" "`PyImport_Import`. This routine needs a Python string as its argument, " -"which is constructed using the :c:func:`PyUnicode_DecodeFSDefault` data " +"which is constructed using the :c:func:`PyUnicode_FromString` data " "conversion routine. ::" msgstr "" +"インタプリタの初期化後、スクリプトは :c:func:`PyImport_Import` を使って読み込" +"まれます。このルーチンは Python 文字列を引数に取る必要があり、データ変換ルー" +"チン :c:func:`PyUnicode_FromString` で構築します。 ::" -#: ../../extending/embedding.rst:202 -msgid "" -"pFunc = PyObject_GetAttrString(pModule, argv[2]);\n" -"/* pFunc is a new reference */\n" -"\n" -"if (pFunc && PyCallable_Check(pFunc)) {\n" -" ...\n" -"}\n" -"Py_XDECREF(pFunc);" -msgstr "" - -#: ../../extending/embedding.rst:210 +#: ../../extending/embedding.rst:191 msgid "" "Once the script is loaded, the name we're looking for is retrieved using :c:" "func:`PyObject_GetAttrString`. If the name exists, and the object returned " @@ -461,11 +315,7 @@ msgstr "" "支えないでしょう。そこでプログラムは定石どおりに引数のタプル構築に進みます。" "その後、Python 関数を以下のコードで呼び出します::" -#: ../../extending/embedding.rst:216 -msgid "pValue = PyObject_CallObject(pFunc, pArgs);" -msgstr "" - -#: ../../extending/embedding.rst:218 +#: ../../extending/embedding.rst:199 msgid "" "Upon return of the function, ``pValue`` is either ``NULL`` or it contains a " "reference to the return value of the function. Be sure to release the " @@ -474,11 +324,11 @@ msgstr "" "関数が処理を戻す際、 ``pValue`` は ``NULL`` になるか、関数の戻り値への参照が" "入っています。値を調べた後には忘れずに参照を解放してください。" -#: ../../extending/embedding.rst:226 +#: ../../extending/embedding.rst:207 msgid "Extending Embedded Python" msgstr "埋め込まれた Python の拡張" -#: ../../extending/embedding.rst:228 +#: ../../extending/embedding.rst:209 msgid "" "Until now, the embedded Python interpreter had no access to functionality " "from the application itself. The Python API allows this by extending the " @@ -500,40 +350,7 @@ msgstr "" "クセスできるようにするグルー(glue, 糊) コードを書くと考えてください。例えば以" "下のようにです::" -#: ../../extending/embedding.rst:237 -msgid "" -"static int numargs=0;\n" -"\n" -"/* Return the number of arguments of the application command line */\n" -"static PyObject*\n" -"emb_numargs(PyObject *self, PyObject *args)\n" -"{\n" -" if(!PyArg_ParseTuple(args, \":numargs\"))\n" -" return NULL;\n" -" return PyLong_FromLong(numargs);\n" -"}\n" -"\n" -"static PyMethodDef emb_module_methods[] = {\n" -" {\"numargs\", emb_numargs, METH_VARARGS,\n" -" \"Return the number of arguments received by the process.\"},\n" -" {NULL, NULL, 0, NULL}\n" -"};\n" -"\n" -"static struct PyModuleDef emb_module = {\n" -" .m_base = PyModuleDef_HEAD_INIT,\n" -" .m_name = \"emb\",\n" -" .m_size = 0,\n" -" .m_methods = emb_module_methods,\n" -"};\n" -"\n" -"static PyObject*\n" -"PyInit_emb(void)\n" -"{\n" -" return PyModuleDef_Init(&emb_module);\n" -"}" -msgstr "" - -#: ../../extending/embedding.rst:267 +#: ../../extending/embedding.rst:246 msgid "" "Insert the above code just above the :c:func:`main` function. Also, insert " "the following two statements before the call to :c:func:`Py_Initialize`::" @@ -541,26 +358,17 @@ msgstr "" "上のコードを :c:func:`main` 関数のすぐ上に挿入します。また、以下の二つの文" "を :c:func:`Py_Initialize` の呼び出しの前に挿入します::" -#: ../../extending/embedding.rst:270 +#: ../../extending/embedding.rst:252 msgid "" -"numargs = argc;\n" -"PyImport_AppendInittab(\"emb\", &PyInit_emb);" +"These two lines initialize the ``numargs`` variable, and make the :func:`emb." +"numargs` function accessible to the embedded Python interpreter. With these " +"extensions, the Python script can do things like" msgstr "" +"これら二つの行は ``numargs`` 変数を初期化し、埋め込み Python インタプリタか" +"ら :func:`emb.numargs` 関数にアクセスできるようにします。これらの拡張モジュー" +"ル関数を使うと、 Python スクリプトは以下のようなことができます。" -#: ../../extending/embedding.rst:273 -msgid "" -"These two lines initialize the ``numargs`` variable, and make the :func:`!" -"emb.numargs` function accessible to the embedded Python interpreter. With " -"these extensions, the Python script can do things like" -msgstr "" - -#: ../../extending/embedding.rst:277 -msgid "" -"import emb\n" -"print(\"Number of arguments\", emb.numargs())" -msgstr "" - -#: ../../extending/embedding.rst:282 +#: ../../extending/embedding.rst:261 msgid "" "In a real application, the methods will expose an API of the application to " "Python." @@ -568,11 +376,11 @@ msgstr "" "実際のアプリケーションでは、こうしたメソッドでアプリケーション内の API を " "Python に公開することになります。" -#: ../../extending/embedding.rst:292 +#: ../../extending/embedding.rst:271 msgid "Embedding Python in C++" msgstr "C++による Python の埋め込み" -#: ../../extending/embedding.rst:294 +#: ../../extending/embedding.rst:273 msgid "" "It is also possible to embed Python in a C++ program; precisely how this is " "done will depend on the details of the C++ system used; in general you will " @@ -585,11 +393,11 @@ msgstr "" "+で書き、C++ コンパイラを使ってプログラムをコンパイル・リンクする必要があるで" "しょう。 Python 自体を C++でコンパイルしなおす必要はありません。" -#: ../../extending/embedding.rst:303 +#: ../../extending/embedding.rst:282 msgid "Compiling and Linking under Unix-like systems" msgstr "Unix 系システムにおけるコンパイルとリンク" -#: ../../extending/embedding.rst:305 +#: ../../extending/embedding.rst:284 msgid "" "It is not necessarily trivial to find the right flags to pass to your " "compiler (and linker) in order to embed the Python interpreter into your " @@ -601,7 +409,7 @@ msgstr "" "がライブラリモジュールに対してリンクされた C 動的拡張 (:file:`.so` ファイル) " "として実装されたものをロードする必要があるためです。" -#: ../../extending/embedding.rst:311 +#: ../../extending/embedding.rst:290 msgid "" "To find out the required compiler and linker flags, you can execute the :" "file:`python{X.Y}-config` script which is generated as part of the " @@ -614,35 +422,20 @@ msgstr "" "で、 :file:`python3-config` スクリプトも利用出来るかもしれません)。このスクリ" "プトにはオプションが多くありますが、直接的に有用なのはこれでしょう:" -#: ../../extending/embedding.rst:317 +#: ../../extending/embedding.rst:296 msgid "" "``pythonX.Y-config --cflags`` will give you the recommended flags when " "compiling:" msgstr "" "``pythonX.Y-config --cflags`` は推奨のコンパイルオプションを出力します:" -#: ../../extending/embedding.rst:320 +#: ../../extending/embedding.rst:304 msgid "" -"$ /opt/bin/python3.11-config --cflags\n" -"-I/opt/include/python3.11 -I/opt/include/python3.11 -Wsign-compare -DNDEBUG " -"-g -fwrapv -O3 -Wall" -msgstr "" - -#: ../../extending/embedding.rst:325 -msgid "" -"``pythonX.Y-config --ldflags --embed`` will give you the recommended flags " -"when linking:" -msgstr "" -"``pythonX.Y-config --ldflags --embed`` は推奨のリンクオプションを出力します:" +"``pythonX.Y-config --ldflags`` will give you the recommended flags when " +"linking:" +msgstr "``pythonX.Y-config --ldflags`` は推奨のリンクオプションを出力します:" -#: ../../extending/embedding.rst:328 -msgid "" -"$ /opt/bin/python3.11-config --ldflags --embed\n" -"-L/opt/lib/python3.11/config-3.11-x86_64-linux-gnu -L/opt/lib -lpython3.11 -" -"lpthread -ldl -lutil -lm" -msgstr "" - -#: ../../extending/embedding.rst:334 +#: ../../extending/embedding.rst:313 msgid "" "To avoid confusion between several Python installations (and especially " "between the system Python and your own compiled Python), it is recommended " @@ -653,7 +446,7 @@ msgstr "" "た Python)での混乱を避けるために、上での例のように :file:`python{X.Y}-" "config` は絶対パスで起動したほうが良いです。" -#: ../../extending/embedding.rst:339 +#: ../../extending/embedding.rst:318 msgid "" "If this procedure doesn't work for you (it is not guaranteed to work for all " "Unix-like platforms; however, we welcome :ref:`bug reports >> import sysconfig\n" -">>> sysconfig.get_config_var('LIBS')\n" -"'-lpthread -ldl -lutil'\n" -">>> sysconfig.get_config_var('LINKFORSHARED')\n" -"'-Xlinker -export-dynamic'" -msgstr "" diff --git a/extending/extending.po b/extending/extending.po index 7cf2a0814..e3dac1dd5 100644 --- a/extending/extending.po +++ b/extending/extending.po @@ -1,31 +1,32 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: +# Nozomu Kaneko , 2017 +# 秘湯 , 2017 +# Arihiro TAKASE, 2017 +# Inada Naoki , 2017 +# Shuuji TAKAHASHI , 2018 +# tomo, 2020 # Yusuke Miyazaki , 2021 # mollinaca, 2021 -# Shin Saito, 2021 -# 菊池 健志, 2023 -# tomo, 2023 -# 石井明久, 2024 -# Arihiro TAKASE, 2024 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-30 14:22+0000\n" -"PO-Revision-Date: 2021-06-28 00:51+0000\n" -"Last-Translator: Arihiro TAKASE, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 17:42+0000\n" +"Last-Translator: mollinaca, 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../extending/extending.rst:8 @@ -104,12 +105,6 @@ msgstr "" "引数にとり、整数を返します。この関数を以下のようにして Python から呼び出せる" "ようにしたいとします。" -#: ../../extending/extending.rst:48 -msgid "" -">>> import spam\n" -">>> status = spam.system(\"ls -l\")" -msgstr "" - #: ../../extending/extending.rst:53 msgid "" "Begin by creating a file :file:`spammodule.c`. (Historically, if a module " @@ -126,12 +121,6 @@ msgstr "" msgid "The first two lines of our file can be::" msgstr "このファイルの最初の 2 行は以下のようにします::" -#: ../../extending/extending.rst:60 ../../extending/extending.rst:681 -msgid "" -"#define PY_SSIZE_T_CLEAN\n" -"#include " -msgstr "" - #: ../../extending/extending.rst:63 msgid "" "which pulls in the Python API (you can add a comment describing the purpose " @@ -152,17 +141,14 @@ msgstr "" #: ../../extending/extending.rst:72 msgid "" -"``#define PY_SSIZE_T_CLEAN`` was used to indicate that ``Py_ssize_t`` should " -"be used in some APIs instead of ``int``. It is not necessary since Python " -"3.13, but we keep it here for backward compatibility. See :ref:`arg-parsing-" -"string-and-buffers` for a description of this macro." +"It is recommended to always define ``PY_SSIZE_T_CLEAN`` before including " +"``Python.h``. See :ref:`parsetuple` for a description of this macro." msgstr "" -"``#define PY_SSIZE_T_CLEAN`` は、いくつかの API では ``int`` の代わりに " -"``Py_ssize_t`` が使われるべきであることを示すために使われていました。これは " -"Python 3.13 以降では不要となりましたが、後方互換性のために維持されています。" -"このマクロの説明は :ref:`arg-parsing-string-and-buffers` にあります。" +"``Python.h`` をインクルードする前に、常に ``PY_SSIZE_T_CLEAN`` を定義すること" +"が推奨されます。\n" +"このマクロの解説については :ref:`parsetuple` を参照してください。" -#: ../../extending/extending.rst:77 +#: ../../extending/extending.rst:75 msgid "" "All user-visible symbols defined by :file:`Python.h` have a prefix of ``Py`` " "or ``PY``, except those defined in standard header files. For convenience, " @@ -180,7 +166,7 @@ msgstr "" "のヘッダファイルがシステム上になければ、 ``\"Python.h\"`` が関数 :c:func:" "`malloc` 、 :c:func:`free` および :c:func:`realloc` を直接定義します。" -#: ../../extending/extending.rst:85 +#: ../../extending/extending.rst:83 msgid "" "The next thing we add to our module file is the C function that will be " "called when the Python expression ``spam.system(string)`` is evaluated " @@ -190,22 +176,7 @@ msgstr "" "に呼び出されることになる C 関数です (この関数を最終的にどのように呼び出すか" "は、後ですぐわかります)::" -#: ../../extending/extending.rst:89 -msgid "" -"static PyObject *\n" -"spam_system(PyObject *self, PyObject *args)\n" -"{\n" -" const char *command;\n" -" int sts;\n" -"\n" -" if (!PyArg_ParseTuple(args, \"s\", &command))\n" -" return NULL;\n" -" sts = system(command);\n" -" return PyLong_FromLong(sts);\n" -"}" -msgstr "" - -#: ../../extending/extending.rst:101 +#: ../../extending/extending.rst:99 msgid "" "There is a straightforward translation from the argument list in Python (for " "example, the single expression ``\"ls -l\"``) to the arguments passed to the " @@ -216,7 +187,7 @@ msgstr "" "渡す引数にそのまま変換しています。 C 関数は常に二つの引数を持ち、便宜的に " "*self* および *args* と呼ばれます。" -#: ../../extending/extending.rst:106 +#: ../../extending/extending.rst:104 msgid "" "The *self* argument points to the module object for module-level functions; " "for a method it would point to the object instance." @@ -224,7 +195,7 @@ msgstr "" "*self* 引数には、モジュールレベルの関数であればモジュールが、メソッドにはオブ" "ジェクトインスタンスが渡されます。" -#: ../../extending/extending.rst:109 +#: ../../extending/extending.rst:107 msgid "" "The *args* argument will be a pointer to a Python tuple object containing " "the arguments. Each item of the tuple corresponds to an argument in the " @@ -243,7 +214,7 @@ msgstr "" "`PyArg_ParseTuple` はテンプレート文字列を使って、引数オブジェクトの型と、変換" "された値を入れる C 変数の型を判別します。これについては後で詳しく説明します。" -#: ../../extending/extending.rst:118 +#: ../../extending/extending.rst:116 msgid "" ":c:func:`PyArg_ParseTuple` returns true (nonzero) if all arguments have the " "right type and its components have been stored in the variables whose " @@ -258,21 +229,35 @@ msgstr "" "出するので、呼び出し側は (例にもあるように) すぐに ``NULL`` を返すようにして" "ください。" -#: ../../extending/extending.rst:128 +#: ../../extending/extending.rst:126 msgid "Intermezzo: Errors and Exceptions" msgstr "幕間小話: エラーと例外" -#: ../../extending/extending.rst:130 +#: ../../extending/extending.rst:128 msgid "" "An important convention throughout the Python interpreter is the following: " "when a function fails, it should set an exception condition and return an " -"error value (usually ``-1`` or a ``NULL`` pointer). Exception information " -"is stored in three members of the interpreter's thread state. These are " -"``NULL`` if there is no exception. Otherwise they are the C equivalents of " -"the members of the Python tuple returned by :meth:`sys.exc_info`. These are " -"the exception type, exception instance, and a traceback object. It is " -"important to know about them to understand how errors are passed around." -msgstr "" +"error value (usually a ``NULL`` pointer). Exceptions are stored in a static " +"global variable inside the interpreter; if this variable is ``NULL`` no " +"exception has occurred. A second global variable stores the \"associated " +"value\" of the exception (the second argument to :keyword:`raise`). A third " +"variable contains the stack traceback in case the error originated in Python " +"code. These three variables are the C equivalents of the result in Python " +"of :meth:`sys.exc_info` (see the section on module :mod:`sys` in the Python " +"Library Reference). It is important to know about them to understand how " +"errors are passed around." +msgstr "" +"Python インタプリタ全体を通して、一つの重要な取り決めがあります: それは、関数" +"が処理に失敗した場合、例外状態をセットして、エラーを示す値 (通常は ``NULL`` " +"ポインタ) を返さねばならない、ということです。例外はインタプリタ内の静的なグ" +"ローバル変数に保存されます; この値が ``NULL`` の場合、例外は何も起きていない" +"ことになります。第二のグローバル変数には、例外の \"付属値 (associated " +"value)\" (:keyword:`raise` 文の第二引数) が入ります。第三の値には、エラーの発" +"生源が Python コード内だった場合にスタックトレースバック (stack traceback) が" +"入ります。これらの三つの変数は、 :meth:`sys.exc_info` の Python での結果と等" +"価な C の変数です (Python ライブラリリファレンスの :mod:`sys` モジュールに関" +"する節を参照してください。) エラーがどのように受け渡されるかを理解するには、" +"これらの変数についてよく知っておくことが重要です。" #: ../../extending/extending.rst:139 msgid "" @@ -329,37 +314,38 @@ msgstr "" msgid "" "When a function *f* that calls another function *g* detects that the latter " "fails, *f* should itself return an error value (usually ``NULL`` or " -"``-1``). It should *not* call one of the ``PyErr_*`` functions --- one has " -"already been called by *g*. *f*'s caller is then supposed to also return an " -"error indication to *its* caller, again *without* calling ``PyErr_*``, and " -"so on --- the most detailed cause of the error was already reported by the " -"function that first detected it. Once the error reaches the Python " -"interpreter's main loop, this aborts the currently executing Python code and " -"tries to find an exception handler specified by the Python programmer." +"``-1``). It should *not* call one of the :c:func:`PyErr_\\*` functions --- " +"one has already been called by *g*. *f*'s caller is then supposed to also " +"return an error indication to *its* caller, again *without* calling :c:func:" +"`PyErr_\\*`, and so on --- the most detailed cause of the error was already " +"reported by the function that first detected it. Once the error reaches the " +"Python interpreter's main loop, this aborts the currently executing Python " +"code and tries to find an exception handler specified by the Python " +"programmer." msgstr "" "関数 *g* を呼び出す *f* が、前者の関数の呼び出しに失敗したことを検出すると、 " "*f* 自体はエラー値 (大抵は ``NULL`` や ``-1``) を返さねばなりません。しか" -"し、 ``PyErr_*`` 関数群のいずれかを呼び出す必要は *ありません* --- なぜな" -"ら、 *g* がすでに呼び出しているからです。次いで *f* を呼び出したコードもエ" -"ラーを示す値を *自らを呼び出したコード* に返すことになりますが、同様に " -"``PyErr_*`` は *呼び出しません* 。以下同様に続きます --- エラーの最も詳しい原" -"因は、最初にエラーを検出した関数がすでに報告しているからです。エラーが " +"し、 :c:func:`PyErr_\\*` 関数群のいずれかを呼び出す必要は *ありません* --- な" +"ぜなら、 *g* がすでに呼び出しているからです。次いで *f* を呼び出したコードも" +"エラーを示す値を *自らを呼び出したコード* に返すことになりますが、同様に :c:" +"func:`PyErr_\\*` は *呼び出しません* 。以下同様に続きます --- エラーの最も詳" +"しい原因は、最初にエラーを検出した関数がすでに報告しているからです。エラーが " "Python インタプリタのメインループに到達すると、現在実行中の Python コードは一" "時停止し、 Python プログラマが指定した例外ハンドラを探し出そうとします。" #: ../../extending/extending.rst:170 msgid "" "(There are situations where a module can actually give a more detailed error " -"message by calling another ``PyErr_*`` function, and in such cases it is " -"fine to do so. As a general rule, however, this is not necessary, and can " -"cause information about the cause of the error to be lost: most operations " -"can fail for a variety of reasons.)" +"message by calling another :c:func:`PyErr_\\*` function, and in such cases " +"it is fine to do so. As a general rule, however, this is not necessary, and " +"can cause information about the cause of the error to be lost: most " +"operations can fail for a variety of reasons.)" msgstr "" -"(モジュールが ``PyErr_*`` 関数をもう一度呼び出して、より詳細なエラーメッセー" -"ジを提供するような状況があります。このような状況ではそうすべきです。とはい" -"え、一般的な規則としては、この関数を何度も呼び出す必要はなく、ともすればエ" -"ラーの原因に関する情報を失う結果になりがちです: これにより、ほとんどの操作が" -"様々な理由から失敗するかもしれません)" +"(モジュールが :c:func:`PyErr_\\*` 関数をもう一度呼び出して、より詳細なエラー" +"メッセージを提供するような状況があります。このような状況ではそうすべきです。" +"とはいえ、一般的な規則としては、 :c:func:`PyErr_\\*` を何度も呼び出す必要はな" +"く、ともすればエラーの原因に関する情報を失う結果になりがちです: これにより、" +"ほとんどの操作が様々な理由から失敗するかもしれません)" #: ../../extending/extending.rst:176 msgid "" @@ -418,171 +404,113 @@ msgid "" "as :c:data:`PyExc_ZeroDivisionError`, which you can use directly. Of course, " "you should choose exceptions wisely --- don't use :c:data:`PyExc_TypeError` " "to mean that a file couldn't be opened (that should probably be :c:data:" -"`PyExc_OSError`). If something's wrong with the argument list, the :c:func:" +"`PyExc_IOError`). If something's wrong with the argument list, the :c:func:" "`PyArg_ParseTuple` function usually raises :c:data:`PyExc_TypeError`. If " "you have an argument whose value must be in a particular range or must " "satisfy other conditions, :c:data:`PyExc_ValueError` is appropriate." msgstr "" +"どの例外を返すかの選択は、ユーザに完全にゆだねられます。 :c:data:" +"`PyExc_ZeroDivisionError` のように、全ての組み込みの Python 例外には対応する" +"宣言済みの C オブジェクトがあり、直接利用できます。もちろん、例外の選択は賢く" +"行わねばなりません --- ファイルが開けなかったことを表すのに :c:data:" +"`PyExc_TypeError` を使ったりはしないでください (この場合はおそらく :c:data:" +"`PyExc_IOError` の方にすべきでしょう)。引数リストに問題がある場合には、 :c:" +"func:`PyArg_ParseTuple` はたいてい :c:data:`PyExc_TypeError` を送出します。引" +"数の値が特定の範囲を超えていたり、その他の満たすべき条件を満たさなかった場合" +"には、 :c:data:`PyExc_ValueError` が適切です。" #: ../../extending/extending.rst:206 msgid "" -"You can also define a new exception that is unique to your module. The " -"simplest way to do this is to declare a static global object variable at the " -"beginning of the file::" -msgstr "" - -#: ../../extending/extending.rst:210 -msgid "static PyObject *SpamError = NULL;" +"You can also define a new exception that is unique to your module. For this, " +"you usually declare a static object variable at the beginning of your file::" msgstr "" +"モジュール固有の新たな例外も定義できます。定義するには、通常はファイルの先頭" +"部分に静的なオブジェクト変数の宣言を行います::" -#: ../../extending/extending.rst:212 +#: ../../extending/extending.rst:211 msgid "" -"and initialize it by calling :c:func:`PyErr_NewException` in the module's :c:" -"data:`Py_mod_exec` function (:c:func:`!spam_module_exec`)::" -msgstr "" - -#: ../../extending/extending.rst:215 -msgid "SpamError = PyErr_NewException(\"spam.error\", NULL, NULL);" +"and initialize it in your module's initialization function (:c:func:" +"`PyInit_spam`) with an exception object::" msgstr "" +"そして、モジュールの初期化関数 (:c:func:`PyInit_spam`) の中で、例外オブジェク" +"トを使って初期化します::" -#: ../../extending/extending.rst:217 +#: ../../extending/extending.rst:235 msgid "" -"Since :c:data:`!SpamError` is a global variable, it will be overwitten every " -"time the module is reinitialized, when the :c:data:`Py_mod_exec` function is " -"called." -msgstr "" - -#: ../../extending/extending.rst:220 -msgid "" -"For now, let's avoid the issue: we will block repeated initialization by " -"raising an :py:exc:`ImportError`::" -msgstr "" - -#: ../../extending/extending.rst:223 -msgid "" -"static PyObject *SpamError = NULL;\n" -"\n" -"static int\n" -"spam_module_exec(PyObject *m)\n" -"{\n" -" if (SpamError != NULL) {\n" -" PyErr_SetString(PyExc_ImportError,\n" -" \"cannot initialize spam module more than once\");\n" -" return -1;\n" -" }\n" -" SpamError = PyErr_NewException(\"spam.error\", NULL, NULL);\n" -" if (PyModule_AddObjectRef(m, \"SpamError\", SpamError) < 0) {\n" -" return -1;\n" -" }\n" -"\n" -" return 0;\n" -"}\n" -"\n" -"static PyModuleDef_Slot spam_module_slots[] = {\n" -" {Py_mod_exec, spam_module_exec},\n" -" {0, NULL}\n" -"};\n" -"\n" -"static struct PyModuleDef spam_module = {\n" -" .m_base = PyModuleDef_HEAD_INIT,\n" -" .m_name = \"spam\",\n" -" .m_size = 0, // non-negative\n" -" .m_slots = spam_module_slots,\n" -"};\n" -"\n" -"PyMODINIT_FUNC\n" -"PyInit_spam(void)\n" -"{\n" -" return PyModuleDef_Init(&spam_module);\n" -"}" -msgstr "" - -#: ../../extending/extending.rst:259 -msgid "" -"Note that the Python name for the exception object is :exc:`!spam.error`. " +"Note that the Python name for the exception object is :exc:`spam.error`. " "The :c:func:`PyErr_NewException` function may create a class with the base " "class being :exc:`Exception` (unless another class is passed in instead of " "``NULL``), described in :ref:`bltin-exceptions`." msgstr "" +"Python レベルでの例外オブジェクトの名前は :exc:`spam.error` になることに注意" +"してください。 :c:func:`PyErr_NewException` 関数は、 :ref:`bltin-exceptions` " +"で述べられている :exc:`Exception` クラスを基底クラスに持つ例外クラスも作成で" +"きます (``NULL`` の代わりに他のクラスを渡した場合は別です)。" -#: ../../extending/extending.rst:264 +#: ../../extending/extending.rst:240 msgid "" -"Note also that the :c:data:`!SpamError` variable retains a reference to the " +"Note also that the :c:data:`SpamError` variable retains a reference to the " "newly created exception class; this is intentional! Since the exception " "could be removed from the module by external code, an owned reference to the " -"class is needed to ensure that it will not be discarded, causing :c:data:`!" -"SpamError` to become a dangling pointer. Should it become a dangling " +"class is needed to ensure that it will not be discarded, causing :c:data:" +"`SpamError` to become a dangling pointer. Should it become a dangling " "pointer, C code which raises the exception could cause a core dump or other " "unintended side effects." msgstr "" +":c:data:`SpamError` 変数は、新たに生成された例外クラスへの参照を維持すること" +"にも注意してください; これは意図的な仕様です! 外部のコードが例外オブジェクト" +"をモジュールから除去できるため、モジュールから新たに作成した例外クラスが見え" +"なくなり、 :c:data:`SpamError` がぶら下がりポインタ (dangling pointer) になっ" +"てしまわないようにするために、クラスに対する参照を所有しておかねばなりませ" +"ん。もし :c:data:`SpamError` がぶら下がりポインタになってしまうと、 C コード" +"が例外を送出しようとしたときにコアダンプや意図しない副作用を引き起こすことが" +"あります。" -#: ../../extending/extending.rst:271 +#: ../../extending/extending.rst:247 msgid "" -"For now, the :c:func:`Py_DECREF` call to remove this reference is missing. " -"Even when the Python interpreter shuts down, the global :c:data:`!SpamError` " -"variable will not be garbage-collected. It will \"leak\". We did, however, " -"ensure that this will happen at most once per process." +"We discuss the use of ``PyMODINIT_FUNC`` as a function return type later in " +"this sample." msgstr "" +"この例にある、関数の戻り値型に ``PyMODINIT_FUNC`` を使う方法については後で議" +"論します。" -#: ../../extending/extending.rst:276 +#: ../../extending/extending.rst:250 msgid "" -"We discuss the use of :c:macro:`PyMODINIT_FUNC` as a function return type " -"later in this sample." +"The :exc:`spam.error` exception can be raised in your extension module using " +"a call to :c:func:`PyErr_SetString` as shown below::" msgstr "" +":c:func:`PyErr_SetString` を次のように呼び出すと、拡張モジュールで例外 :exc:" +"`spam.error` を送出することができます::" -#: ../../extending/extending.rst:279 -msgid "" -"The :exc:`!spam.error` exception can be raised in your extension module " -"using a call to :c:func:`PyErr_SetString` as shown below::" -msgstr "" - -#: ../../extending/extending.rst:282 -msgid "" -"static PyObject *\n" -"spam_system(PyObject *self, PyObject *args)\n" -"{\n" -" const char *command;\n" -" int sts;\n" -"\n" -" if (!PyArg_ParseTuple(args, \"s\", &command))\n" -" return NULL;\n" -" sts = system(command);\n" -" if (sts < 0) {\n" -" PyErr_SetString(SpamError, \"System command failed\");\n" -" return NULL;\n" -" }\n" -" return PyLong_FromLong(sts);\n" -"}" -msgstr "" - -#: ../../extending/extending.rst:302 +#: ../../extending/extending.rst:273 msgid "Back to the Example" msgstr "例に戻る" -#: ../../extending/extending.rst:304 +#: ../../extending/extending.rst:275 msgid "" "Going back to our example function, you should now be able to understand " "this statement::" msgstr "先ほどの関数の例に戻ると、今度は以下の実行文を理解できるはずです::" -#: ../../extending/extending.rst:307 -msgid "" -"if (!PyArg_ParseTuple(args, \"s\", &command))\n" -" return NULL;" -msgstr "" - -#: ../../extending/extending.rst:310 +#: ../../extending/extending.rst:281 msgid "" "It returns ``NULL`` (the error indicator for functions returning object " "pointers) if an error is detected in the argument list, relying on the " "exception set by :c:func:`PyArg_ParseTuple`. Otherwise the string value of " -"the argument has been copied to the local variable :c:data:`!command`. This " +"the argument has been copied to the local variable :c:data:`command`. This " "is a pointer assignment and you are not supposed to modify the string to " -"which it points (so in Standard C, the variable :c:data:`!command` should " +"which it points (so in Standard C, the variable :c:data:`command` should " "properly be declared as ``const char *command``)." msgstr "" +"この実行文は、 :c:func:`PyArg_ParseTuple` がセットする例外によって、引数リス" +"トに何らかのエラーが生じたときに ``NULL`` (オブジェクトへのポインタを返すタイ" +"プの関数におけるエラー標示値) を返します。エラーでなければ、引数として与えた" +"文字列値はローカルな変数 :c:data:`command` にコピーされています。この操作はポ" +"インタ代入であり、ポインタが指している文字列に対して変更が行われるとは想定さ" +"れていません (従って、標準 C では、変数 :c:data:`command` は ``const char* " +"command`` として適切に定義せねばなりません)。" -#: ../../extending/extending.rst:318 +#: ../../extending/extending.rst:289 msgid "" "The next statement is a call to the Unix function :c:func:`system`, passing " "it the string we just got from :c:func:`PyArg_ParseTuple`::" @@ -590,22 +518,15 @@ msgstr "" "次の文では、 :c:func:`PyArg_ParseTuple` で得た文字列を渡して Unix 関数 :c:" "func:`system` を呼び出しています::" -#: ../../extending/extending.rst:321 -msgid "sts = system(command);" -msgstr "" - -#: ../../extending/extending.rst:323 +#: ../../extending/extending.rst:294 msgid "" -"Our :func:`!spam.system` function must return the value of :c:data:`!sts` as " -"a Python object. This is done using the function :c:func:" -"`PyLong_FromLong`. ::" -msgstr "" - -#: ../../extending/extending.rst:326 -msgid "return PyLong_FromLong(sts);" +"Our :func:`spam.system` function must return the value of :c:data:`sts` as a " +"Python object. This is done using the function :c:func:`PyLong_FromLong`. ::" msgstr "" +":func:`spam.system` は :c:data:`sts` を Python オブジェクトとして返さねばなり" +"ません。これには、 :c:func:`PyLong_FromLong` を使います。 ::" -#: ../../extending/extending.rst:328 +#: ../../extending/extending.rst:299 msgid "" "In this case, it will return an integer object. (Yes, even integers are " "objects on the heap in Python!)" @@ -613,25 +534,19 @@ msgstr "" "上の場合では、整数オブジェクトを返します。(そう、整数ですら、 Python において" "はヒープ上のオブジェクトなのです! )" -#: ../../extending/extending.rst:331 +#: ../../extending/extending.rst:302 msgid "" "If you have a C function that returns no useful argument (a function " -"returning :c:expr:`void`), the corresponding Python function must return " +"returning :c:type:`void`), the corresponding Python function must return " "``None``. You need this idiom to do so (which is implemented by the :c:" "macro:`Py_RETURN_NONE` macro)::" msgstr "" -"何ら有用な値を返さない関数 (:c:expr:`void` を返す関数) に対応する Python の関" +"何ら有用な値を返さない関数 (:c:type:`void` を返す関数) に対応する Python の関" "数は ``None`` を返さねばなりません。関数に ``None`` を返させるには、以下のよ" "うな慣用句を使います (この慣用句は :c:macro:`Py_RETURN_NONE` マクロに実装され" "ています)::" -#: ../../extending/extending.rst:336 -msgid "" -"Py_INCREF(Py_None);\n" -"return Py_None;" -msgstr "" - -#: ../../extending/extending.rst:339 +#: ../../extending/extending.rst:310 msgid "" ":c:data:`Py_None` is the C name for the special Python object ``None``. It " "is a genuine Python object rather than a ``NULL`` pointer, which means " @@ -642,28 +557,20 @@ msgstr "" "する ``NULL`` ポインタとは違い、 ``None`` は純粋な Python のオブジェクトで" "す。" -#: ../../extending/extending.rst:347 +#: ../../extending/extending.rst:318 msgid "The Module's Method Table and Initialization Function" msgstr "モジュールのメソッドテーブルと初期化関数" -#: ../../extending/extending.rst:349 +#: ../../extending/extending.rst:320 msgid "" -"I promised to show how :c:func:`!spam_system` is called from Python " -"programs. First, we need to list its name and address in a \"method table\"::" +"I promised to show how :c:func:`spam_system` is called from Python programs. " +"First, we need to list its name and address in a \"method table\"::" msgstr "" +"さて、前に約束したように、 :c:func:`spam_system` を Python プログラムからどう" +"やって呼び出すかをこれから示します。まずは、関数名とアドレスを \"メソッドテー" +"ブル (method table)\" に列挙する必要があります::" -#: ../../extending/extending.rst:352 -msgid "" -"static PyMethodDef spam_methods[] = {\n" -" ...\n" -" {\"system\", spam_system, METH_VARARGS,\n" -" \"Execute a shell command.\"},\n" -" ...\n" -" {NULL, NULL, 0, NULL} /* Sentinel */\n" -"};" -msgstr "" - -#: ../../extending/extending.rst:360 +#: ../../extending/extending.rst:331 msgid "" "Note the third entry (``METH_VARARGS``). This is a flag telling the " "interpreter the calling convention to be used for the C function. It should " @@ -677,7 +584,7 @@ msgstr "" "``0`` は旧式の :c:func:`PyArg_ParseTuple` の変化形が使われることを意味しま" "す。" -#: ../../extending/extending.rst:365 +#: ../../extending/extending.rst:336 msgid "" "When using only ``METH_VARARGS``, the function should expect the Python-" "level parameters to be passed in as a tuple acceptable for parsing via :c:" @@ -687,148 +594,126 @@ msgstr "" "`PyArg_ParseTuple` が受理できるタプルの形式で渡されるものと想定しなければなり" "ません; この関数についての詳細は下で説明します。" -#: ../../extending/extending.rst:369 +#: ../../extending/extending.rst:340 msgid "" -"The :c:macro:`METH_KEYWORDS` bit may be set in the third field if keyword " +"The :const:`METH_KEYWORDS` bit may be set in the third field if keyword " "arguments should be passed to the function. In this case, the C function " "should accept a third ``PyObject *`` parameter which will be a dictionary of " "keywords. Use :c:func:`PyArg_ParseTupleAndKeywords` to parse the arguments " "to such a function." msgstr "" +"関数にキーワード引数が渡されることになっているのなら、第三フィールドに :" +"const:`METH_KEYWORDS` ビットをセットできます。この場合、C 関数は第三引数に " +"``PyObject *`` を受理するようにせねばなりません。このオブジェクトは、キーワー" +"ド引数の辞書になります。こうした関数で引数を解釈するには、 :c:func:" +"`PyArg_ParseTupleAndKeywords` を使ってください。" -#: ../../extending/extending.rst:375 +#: ../../extending/extending.rst:346 msgid "" "The method table must be referenced in the module definition structure::" msgstr "" "メソッドテーブルはモジュール定義の構造体から参照されていなければなりません::" -#: ../../extending/extending.rst:377 -msgid "" -"static struct PyModuleDef spam_module = {\n" -" ...\n" -" .m_methods = spam_methods,\n" -" ...\n" -"};" -msgstr "" - -#: ../../extending/extending.rst:383 +#: ../../extending/extending.rst:357 msgid "" "This structure, in turn, must be passed to the interpreter in the module's " "initialization function. The initialization function must be named :c:func:" -"`!PyInit_name`, where *name* is the name of the module, and should be the " +"`PyInit_name`, where *name* is the name of the module, and should be the " "only non-\\ ``static`` item defined in the module file::" msgstr "" +"同様に、この構造体は、モジュールの初期化関数内でインタプリタに渡さねばなりま" +"せん。初期化関数はモジュールの名前を *name* としたときに :c:func:" +"`PyInit_name` という名前でなければならず、モジュールファイル内で定義されてい" +"るもののうち、唯一の非 ``static`` 要素でなければなりません::" + +#: ../../extending/extending.rst:368 +msgid "" +"Note that PyMODINIT_FUNC declares the function as ``PyObject *`` return " +"type, declares any special linkage declarations required by the platform, " +"and for C++ declares the function as ``extern \"C\"``." +msgstr "" +"PyMODINIT_FUNC は関数の戻り値を ``PyObject *`` になるように宣言し、プラット" +"フォーム毎に必要とされる、特有のリンク宣言 (linkage declaration) を定義するこ" +"と、さらに C++ の場合には関数を ``extern \"C\"`` に宣言することに注意してくだ" +"さい。" + +#: ../../extending/extending.rst:372 +msgid "" +"When the Python program imports module :mod:`spam` for the first time, :c:" +"func:`PyInit_spam` is called. (See below for comments about embedding " +"Python.) It calls :c:func:`PyModule_Create`, which returns a module object, " +"and inserts built-in function objects into the newly created module based " +"upon the table (an array of :c:type:`PyMethodDef` structures) found in the " +"module definition. :c:func:`PyModule_Create` returns a pointer to the module " +"object that it creates. It may abort with a fatal error for certain errors, " +"or return ``NULL`` if the module could not be initialized satisfactorily. " +"The init function must return the module object to its caller, so that it " +"then gets inserted into ``sys.modules``." +msgstr "" +"Python プログラムが初めて :mod:`spam` モジュールを import するときに、 :c:" +"func:`PyInit_spam` が呼ばれます。 (以下にある Python への埋め込みに関するコメ" +"ントを参照してください。) そこからモジュールオブジェクトを返す :c:func:" +"`PyModule_Create` が呼ばれ、モジュール定義にあるテーブル (:c:type:" +"`PyMethodDef` 構造体の配列) に基いて新たに作られたモジュールに、組み込み関数" +"オブジェクトが挿入されます。 :c:func:`PyModule_Create` は作成したモジュールオ" +"ブジェクトへのポインタを返します。あるエラーによって異常終了するかもしれませ" +"んし、モジュールが問題無く初期化できなかった場合には ``NULL`` を返すかもしれ" +"ません。 init 関数はモジュールオブジェクトを呼び出し元に返し、それが ``sys." +"modules`` に挿入されるようにしなければなりません。" -#: ../../extending/extending.rst:388 -msgid "" -"PyMODINIT_FUNC\n" -"PyInit_spam(void)\n" -"{\n" -" return PyModuleDef_Init(&spam_module);\n" -"}" -msgstr "" - -#: ../../extending/extending.rst:394 -msgid "" -"Note that :c:macro:`PyMODINIT_FUNC` declares the function as ``PyObject *`` " -"return type, declares any special linkage declarations required by the " -"platform, and for C++ declares the function as ``extern \"C\"``." -msgstr "" - -#: ../../extending/extending.rst:398 -msgid "" -":c:func:`!PyInit_spam` is called when each interpreter imports its module :" -"mod:`!spam` for the first time. (See below for comments about embedding " -"Python.) A pointer to the module definition must be returned via :c:func:" -"`PyModuleDef_Init`, so that the import machinery can create the module and " -"store it in ``sys.modules``." -msgstr "" - -#: ../../extending/extending.rst:403 +#: ../../extending/extending.rst:383 msgid "" -"When embedding Python, the :c:func:`!PyInit_spam` function is not called " +"When embedding Python, the :c:func:`PyInit_spam` function is not called " "automatically unless there's an entry in the :c:data:`PyImport_Inittab` " "table. To add the module to the initialization table, use :c:func:" "`PyImport_AppendInittab`, optionally followed by an import of the module::" msgstr "" +"Python へ埋め込むときに、 :c:data:`PyImport_Inittab` テーブルに存在していて" +"も :c:func:`PyInit_spam` 関数は自動的には呼ばれません。初期化テーブルにモ" +"ジュールを追加するには、 :c:func:`PyImport_AppendInittab` を使ってください。" +"その後にオプションでモジュールを import します::" -#: ../../extending/extending.rst:408 -msgid "" -"#define PY_SSIZE_T_CLEAN\n" -"#include \n" -"\n" -"int\n" -"main(int argc, char *argv[])\n" -"{\n" -" PyStatus status;\n" -" PyConfig config;\n" -" PyConfig_InitPythonConfig(&config);\n" -"\n" -" /* Add a built-in module, before Py_Initialize */\n" -" if (PyImport_AppendInittab(\"spam\", PyInit_spam) == -1) {\n" -" fprintf(stderr, \"Error: could not extend in-built modules " -"table\\n\");\n" -" exit(1);\n" -" }\n" -"\n" -" /* Pass argv[0] to the Python interpreter */\n" -" status = PyConfig_SetBytesString(&config, &config.program_name, " -"argv[0]);\n" -" if (PyStatus_Exception(status)) {\n" -" goto exception;\n" -" }\n" -"\n" -" /* Initialize the Python interpreter. Required.\n" -" If this step fails, it will be a fatal error. */\n" -" status = Py_InitializeFromConfig(&config);\n" -" if (PyStatus_Exception(status)) {\n" -" goto exception;\n" -" }\n" -" PyConfig_Clear(&config);\n" -"\n" -" /* Optionally import the module; alternatively,\n" -" import can be deferred until the embedded script\n" -" imports it. */\n" -" PyObject *pmodule = PyImport_ImportModule(\"spam\");\n" -" if (!pmodule) {\n" -" PyErr_Print();\n" -" fprintf(stderr, \"Error: could not import module 'spam'\\n\");\n" -" }\n" -"\n" -" // ... use Python C API here ...\n" -"\n" -" return 0;\n" -"\n" -" exception:\n" -" PyConfig_Clear(&config);\n" -" Py_ExitStatusException(status);\n" -"}" -msgstr "" - -#: ../../extending/extending.rst:458 -msgid "" -"If you declare a global variable or a local static one, the module may " -"experience unintended side-effects on re-initialisation, for example when " -"removing entries from ``sys.modules`` or importing compiled modules into " +#: ../../extending/extending.rst:427 +msgid "" +"Removing entries from ``sys.modules`` or importing compiled modules into " "multiple interpreters within a process (or following a :c:func:`fork` " -"without an intervening :c:func:`exec`). If module state is not yet fully :" -"ref:`isolated `, authors should consider marking " -"the module as having no support for subinterpreters (via :c:macro:" -"`Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED`)." +"without an intervening :c:func:`exec`) can create problems for some " +"extension modules. Extension module authors should exercise caution when " +"initializing internal data structures." msgstr "" +"単一のプロセス内 (または :c:func:`fork` 後の :c:func:`exec` が介入していない" +"状態) における複数のインタプリタにおいて、 ``sys.modules`` からエントリを除去" +"したり新たなコンパイル済みモジュールを import したりすると、拡張モジュールに" +"よっては問題を生じることがあります。拡張モジュールの作者は、内部データ構造を" +"初期化する際にはよくよく用心すべきです。" -#: ../../extending/extending.rst:467 +#: ../../extending/extending.rst:433 msgid "" "A more substantial example module is included in the Python source " -"distribution as :file:`Modules/xxlimited.c`. This file may be used as a " +"distribution as :file:`Modules/xxmodule.c`. This file may be used as a " "template or simply read as an example." msgstr "" +"より実質的なモジュール例は、Python ソース配布物に :file:`Modules/xxmodule.c` " +"という名前で入っています。このファイルはテンプレートとしても利用できますし、" +"単に例としても読めます。" -#: ../../extending/extending.rst:475 +#: ../../extending/extending.rst:439 +msgid "" +"Unlike our ``spam`` example, ``xxmodule`` uses *multi-phase initialization* " +"(new in Python 3.5), where a PyModuleDef structure is returned from " +"``PyInit_spam``, and creation of the module is left to the import machinery. " +"For details on multi-phase initialization, see :PEP:`489`." +msgstr "" +"``xmodule`` は ``spam`` と異なり、 *多段階初期化 (multi-phase " +"initialization* (Python 3.5 の新機能) を使っています。 ``PyInit_spam`` が " +"PyModuleDef を返し、モジュールの生成は後に import 機構が行います。多段階初期" +"化についての詳細は :PEP:`489` を参照してください。" + +#: ../../extending/extending.rst:448 msgid "Compilation and Linkage" msgstr "コンパイルとリンク" -#: ../../extending/extending.rst:477 +#: ../../extending/extending.rst:450 msgid "" "There are two more things to do before you can use your new extension: " "compiling and linking it with the Python system. If you use dynamic " @@ -844,7 +729,7 @@ msgstr "" "`building` 章) や、Windows におけるビルドに関係する追加情報の章 (:ref:" "`building-on-windows` 章) を参照してください。" -#: ../../extending/extending.rst:484 +#: ../../extending/extending.rst:457 msgid "" "If you can't use dynamic loading, or if you want to make your module a " "permanent part of the Python interpreter, you will have to change the " @@ -860,11 +745,7 @@ msgstr "" "file:`Modules/` ディレクトリに置き、 :file:`Modules/Setup.local` に自分の" "ファイルを説明する以下の一行:" -#: ../../extending/extending.rst:491 -msgid "spam spammodule.o" -msgstr "" - -#: ../../extending/extending.rst:495 +#: ../../extending/extending.rst:468 msgid "" "and rebuild the interpreter by running :program:`make` in the toplevel " "directory. You can also run :program:`make` in the :file:`Modules/` " @@ -878,7 +759,7 @@ msgstr "" "file:`Makefile` を再ビルドしておかなければならりません。(この作業は :file:" "`Setup` ファイルを変更するたびに必要です。)" -#: ../../extending/extending.rst:501 +#: ../../extending/extending.rst:474 msgid "" "If your module requires additional libraries to link with, these can be " "listed on the line in the configuration file as well, for instance:" @@ -886,15 +767,11 @@ msgstr "" "モジュールが別のライブラリとリンクされている必要がある場合、ライブラリも設定" "ファイルに列挙できます。例えば以下のようにします。" -#: ../../extending/extending.rst:504 -msgid "spam spammodule.o -lX11" -msgstr "" - -#: ../../extending/extending.rst:512 +#: ../../extending/extending.rst:485 msgid "Calling Python Functions from C" msgstr "C から Python 関数を呼び出す" -#: ../../extending/extending.rst:514 +#: ../../extending/extending.rst:487 msgid "" "So far we have concentrated on making C functions callable from Python. The " "reverse is also useful: calling Python functions from C. This is especially " @@ -913,7 +790,7 @@ msgstr "" "Python で書かれたコールパック関数を呼び出すようにする必要があるでしょう。もち" "ろん、他の用途も考えられます。" -#: ../../extending/extending.rst:522 +#: ../../extending/extending.rst:495 msgid "" "Fortunately, the Python interpreter is easily called recursively, and there " "is a standard interface to call a Python function. (I won't dwell on how to " @@ -927,7 +804,7 @@ msgstr "" "なら、 Python ソースコードの :file:`Modules/main.c` にある、コマンドラインオ" "プション :option:`-c` の実装を見てください)" -#: ../../extending/extending.rst:528 +#: ../../extending/extending.rst:501 msgid "" "Calling a Python function is easy. First, the Python program must somehow " "pass you the Python function object. You should provide a function (or some " @@ -945,42 +822,19 @@ msgstr "" "`Py_INCREF` するようよく注意してください!)。例えば、以下のような関数がモ" "ジュールの一部になっていることでしょう::" -#: ../../extending/extending.rst:535 -msgid "" -"static PyObject *my_callback = NULL;\n" -"\n" -"static PyObject *\n" -"my_set_callback(PyObject *dummy, PyObject *args)\n" -"{\n" -" PyObject *result = NULL;\n" -" PyObject *temp;\n" -"\n" -" if (PyArg_ParseTuple(args, \"O:set_callback\", &temp)) {\n" -" if (!PyCallable_Check(temp)) {\n" -" PyErr_SetString(PyExc_TypeError, \"parameter must be " -"callable\");\n" -" return NULL;\n" -" }\n" -" Py_XINCREF(temp); /* Add a reference to new callback */\n" -" Py_XDECREF(my_callback); /* Dispose of previous callback */\n" -" my_callback = temp; /* Remember new callback */\n" -" /* Boilerplate to return \"None\" */\n" -" Py_INCREF(Py_None);\n" -" result = Py_None;\n" -" }\n" -" return result;\n" -"}" -msgstr "" - -#: ../../extending/extending.rst:558 -msgid "" -"This function must be registered with the interpreter using the :c:macro:" +#: ../../extending/extending.rst:531 +msgid "" +"This function must be registered with the interpreter using the :const:" "`METH_VARARGS` flag; this is described in section :ref:`methodtable`. The :" "c:func:`PyArg_ParseTuple` function and its arguments are documented in " "section :ref:`parsetuple`." msgstr "" +"この関数は :const:`METH_VARARGS` フラグを使ってインタプリタに登録せねばなりま" +"せん; :const:`METH_VARARGS` フラグについては、 :ref:`methodtable` で説明して" +"います。 :c:func:`PyArg_ParseTuple` 関数とその引数については、 :ref:" +"`parsetuple` に記述しています。" -#: ../../extending/extending.rst:563 +#: ../../extending/extending.rst:536 msgid "" "The macros :c:func:`Py_XINCREF` and :c:func:`Py_XDECREF` increment/decrement " "the reference count of an object and are safe in the presence of ``NULL`` " @@ -993,7 +847,7 @@ msgstr "" "``NULL`` になることはありません)。これらのマクロと参照カウントについては、 :" "ref:`refcounts` で説明しています。" -#: ../../extending/extending.rst:570 +#: ../../extending/extending.rst:543 msgid "" "Later, when it is time to call the function, you call the C function :c:func:" "`PyObject_CallObject`. This function has two arguments, both pointers to " @@ -1014,21 +868,7 @@ msgstr "" "化コードが入った丸括弧がある場合、この関数はタプルを返します。以下に例を示し" "ます::" -#: ../../extending/extending.rst:579 -msgid "" -"int arg;\n" -"PyObject *arglist;\n" -"PyObject *result;\n" -"...\n" -"arg = 123;\n" -"...\n" -"/* Time to call the callback */\n" -"arglist = Py_BuildValue(\"(i)\", arg);\n" -"result = PyObject_CallObject(my_callback, arglist);\n" -"Py_DECREF(arglist);" -msgstr "" - -#: ../../extending/extending.rst:590 +#: ../../extending/extending.rst:563 msgid "" ":c:func:`PyObject_CallObject` returns a Python object pointer: this is the " "return value of the Python function. :c:func:`PyObject_CallObject` is " @@ -1042,7 +882,7 @@ msgstr "" "タプルを生成して引数リストとして提供しており、このタプルは :c:func:" "`PyObject_CallObject` の呼び出し直後に :c:func:`Py_DECREF` されています。" -#: ../../extending/extending.rst:597 +#: ../../extending/extending.rst:570 msgid "" "The return value of :c:func:`PyObject_CallObject` is \"new\": either it is a " "brand new object, or it is an existing object whose reference count has been " @@ -1056,7 +896,7 @@ msgstr "" "いかぎり、たとえこの戻り値に興味がなくても (むしろ、そうであればなおさら!) 何" "がしかの方法で戻り値オブジェクトを :c:func:`Py_DECREF` しなければなりません。" -#: ../../extending/extending.rst:603 +#: ../../extending/extending.rst:576 msgid "" "Before you do this, however, it is important to check that the return value " "isn't ``NULL``. If it is, the Python function terminated by raising an " @@ -1066,25 +906,17 @@ msgid "" "handle the exception. If this is not possible or desirable, the exception " "should be cleared by calling :c:func:`PyErr_Clear`. For example::" msgstr "" -"とはいえ、戻り値を :c:func:`Py_DECREF` する前には、値が ``NULL`` でないか" -"チェックしておくことが重要です。もし ``NULL`` なら、呼び出した Python 関数は" -"例外を送出して終了させられています。 :c:func:`PyObject_CallObject` を呼び出し" -"ているコード自体もまた Python から呼び出されているのであれば、今度は C コード" -"が自分を呼び出している Python コードにエラー標示値を返さねばなりません。それ" -"により、インタプリタはスタックトレースを出力したり、例外を処理するための " -"Python コードを呼び出したりできます。例外の送出が不可能だったり、したくないの" -"なら、 :c:func:`PyErr_Clear` を呼んで例外を消去しておかねばなりません。例えば" -"以下のようにします::" - -#: ../../extending/extending.rst:611 -msgid "" -"if (result == NULL)\n" -" return NULL; /* Pass error back */\n" -"...use result...\n" -"Py_DECREF(result);" -msgstr "" +"とはいえ、戻り値を :c:func:`Py_DECREF` する前には、値が *NULL* でないかチェッ" +"クしておくことが重要です。もし ``NULL`` なら、呼び出した Python 関数は例外を" +"送出して終了させられています。 :c:func:`PyObject_CallObject` を呼び出している" +"コード自体もまた Python から呼び出されているのであれば、今度は C コードが自分" +"を呼び出している Python コードにエラー標示値を返さねばなりません。それによ" +"り、インタプリタはスタックトレースを出力したり、例外を処理するための Python " +"コードを呼び出したりできます。例外の送出が不可能だったり、したくないのな" +"ら、 :c:func:`PyErr_Clear` を呼んで例外を消去しておかねばなりません。例えば以" +"下のようにします::" -#: ../../extending/extending.rst:616 +#: ../../extending/extending.rst:589 msgid "" "Depending on the desired interface to the Python callback function, you may " "also have to provide an argument list to :c:func:`PyObject_CallObject`. In " @@ -1103,20 +935,7 @@ msgstr "" "`Py_BuildValue` を呼ぶやり方です。例えば、整数のイベントコードを渡したけれ" "ば、以下のようなコードを使うことになるでしょう::" -#: ../../extending/extending.rst:625 -msgid "" -"PyObject *arglist;\n" -"...\n" -"arglist = Py_BuildValue(\"(l)\", eventcode);\n" -"result = PyObject_CallObject(my_callback, arglist);\n" -"Py_DECREF(arglist);\n" -"if (result == NULL)\n" -" return NULL; /* Pass error back */\n" -"/* Here maybe use the result */\n" -"Py_DECREF(result);" -msgstr "" - -#: ../../extending/extending.rst:635 +#: ../../extending/extending.rst:608 msgid "" "Note the placement of ``Py_DECREF(arglist)`` immediately after the call, " "before the error check! Also note that strictly speaking this code is not " @@ -1128,7 +947,7 @@ msgstr "" "c:func:`Py_BuildValue` はメモリ不足におちいるかもしれず、チェックしておくべき" "です。" -#: ../../extending/extending.rst:639 +#: ../../extending/extending.rst:612 msgid "" "You may also call a function with keyword arguments by using :c:func:" "`PyObject_Call`, which supports arguments and keyword arguments. As in the " @@ -1138,32 +957,15 @@ msgstr "" "キーワード引数を伴う関数呼び出しをすることができます。上の例と同じように、 :" "c:func:`Py_BuildValue` を作って辞書を作ります。 ::" -#: ../../extending/extending.rst:643 -msgid "" -"PyObject *dict;\n" -"...\n" -"dict = Py_BuildValue(\"{s:i}\", \"name\", val);\n" -"result = PyObject_Call(my_callback, NULL, dict);\n" -"Py_DECREF(dict);\n" -"if (result == NULL)\n" -" return NULL; /* Pass error back */\n" -"/* Here maybe use the result */\n" -"Py_DECREF(result);" -msgstr "" - -#: ../../extending/extending.rst:657 +#: ../../extending/extending.rst:630 msgid "Extracting Parameters in Extension Functions" msgstr "拡張モジュール関数でのパラメタ展開" -#: ../../extending/extending.rst:661 +#: ../../extending/extending.rst:634 msgid "The :c:func:`PyArg_ParseTuple` function is declared as follows::" msgstr ":c:func:`PyArg_ParseTuple` 関数は以下のように宣言されています::" -#: ../../extending/extending.rst:663 -msgid "int PyArg_ParseTuple(PyObject *arg, const char *format, ...);" -msgstr "" - -#: ../../extending/extending.rst:665 +#: ../../extending/extending.rst:638 msgid "" "The *arg* argument must be a tuple object containing an argument list passed " "from Python to a C function. The *format* argument must be a format string, " @@ -1177,7 +979,7 @@ msgstr "" "ん。残りの引数は、それぞれの変数のアドレスで、書式化文字列から決まる型になっ" "ていなければなりません。" -#: ../../extending/extending.rst:671 +#: ../../extending/extending.rst:644 msgid "" "Note that while :c:func:`PyArg_ParseTuple` checks that the Python arguments " "have the required types, it cannot check the validity of the addresses of C " @@ -1190,7 +992,7 @@ msgstr "" "いを犯すと、コードがクラッシュするかもしれませんし、少なくともでたらめなビッ" "トをメモリに上書きしてしまいます。慎重に!" -#: ../../extending/extending.rst:676 +#: ../../extending/extending.rst:649 msgid "" "Note that any Python object references which are provided to the caller are " "*borrowed* references; do not decrement their reference count!" @@ -1199,97 +1001,21 @@ msgstr "" "reference) になります; これらのオブジェクトの参照カウントをデクリメントしては" "なりません!" -#: ../../extending/extending.rst:679 +#: ../../extending/extending.rst:652 msgid "Some example calls::" msgstr "以下にいくつかの呼び出し例を示します::" -#: ../../extending/extending.rst:686 -msgid "" -"int ok;\n" -"int i, j;\n" -"long k, l;\n" -"const char *s;\n" -"Py_ssize_t size;\n" -"\n" -"ok = PyArg_ParseTuple(args, \"\"); /* No arguments */\n" -" /* Python call: f() */" -msgstr "" - -#: ../../extending/extending.rst:697 -msgid "" -"ok = PyArg_ParseTuple(args, \"s\", &s); /* A string */\n" -" /* Possible Python call: f('whoops!') */" -msgstr "" - -#: ../../extending/extending.rst:702 -msgid "" -"ok = PyArg_ParseTuple(args, \"lls\", &k, &l, &s); /* Two longs and a string " -"*/\n" -" /* Possible Python call: f(1, 2, 'three') */" -msgstr "" - -#: ../../extending/extending.rst:707 -msgid "" -"ok = PyArg_ParseTuple(args, \"(ii)s#\", &i, &j, &s, &size);\n" -" /* A pair of ints and a string, whose size is also returned */\n" -" /* Possible Python call: f((1, 2), 'three') */" -msgstr "" - -#: ../../extending/extending.rst:713 -msgid "" -"{\n" -" const char *file;\n" -" const char *mode = \"r\";\n" -" int bufsize = 0;\n" -" ok = PyArg_ParseTuple(args, \"s|si\", &file, &mode, &bufsize);\n" -" /* A string, and optionally another string and an integer */\n" -" /* Possible Python calls:\n" -" f('spam')\n" -" f('spam', 'w')\n" -" f('spam', 'wb', 100000) */\n" -"}" -msgstr "" - -#: ../../extending/extending.rst:727 -msgid "" -"{\n" -" int left, top, right, bottom, h, v;\n" -" ok = PyArg_ParseTuple(args, \"((ii)(ii))(ii)\",\n" -" &left, &top, &right, &bottom, &h, &v);\n" -" /* A rectangle and a point */\n" -" /* Possible Python call:\n" -" f(((0, 0), (400, 300)), (10, 10)) */\n" -"}" -msgstr "" - -#: ../../extending/extending.rst:738 -msgid "" -"{\n" -" Py_complex c;\n" -" ok = PyArg_ParseTuple(args, \"D:myfunction\", &c);\n" -" /* a complex, also providing a function name for errors */\n" -" /* Possible Python call: myfunction(1+2j) */\n" -"}" -msgstr "" - -#: ../../extending/extending.rst:749 +#: ../../extending/extending.rst:722 msgid "Keyword Parameters for Extension Functions" msgstr "拡張モジュール関数のキーワードパラメタ" -#: ../../extending/extending.rst:753 +#: ../../extending/extending.rst:726 msgid "" "The :c:func:`PyArg_ParseTupleAndKeywords` function is declared as follows::" msgstr "" ":c:func:`PyArg_ParseTupleAndKeywords` は、以下のように宣言されています::" -#: ../../extending/extending.rst:755 -msgid "" -"int PyArg_ParseTupleAndKeywords(PyObject *arg, PyObject *kwdict,\n" -" const char *format, char * const " -"*kwlist, ...);" -msgstr "" - -#: ../../extending/extending.rst:758 +#: ../../extending/extending.rst:731 msgid "" "The *arg* and *format* parameters are identical to those of the :c:func:" "`PyArg_ParseTuple` function. The *kwdict* parameter is the dictionary of " @@ -1308,7 +1034,7 @@ msgstr "" "`PyArg_ParseTupleAndKeywords` は真を返し、それ以外の場合には適切な例外を送出" "して偽を返します。" -#: ../../extending/extending.rst:768 +#: ../../extending/extending.rst:741 msgid "" "Nested tuples cannot be parsed when using keyword arguments! Keyword " "parameters passed in which are not present in the *kwlist* will cause :exc:" @@ -1318,7 +1044,7 @@ msgstr "" "存在しないキーワードパラメタが渡された場合、 :exc:`TypeError` の送出を引き起" "こします。" -#: ../../extending/extending.rst:774 +#: ../../extending/extending.rst:747 msgid "" "Here is an example module which uses keywords, based on an example by Geoff " "Philbrick (philbrick@hks.com)::" @@ -1326,64 +1052,11 @@ msgstr "" "以下にキーワードを使ったモジュール例を示します。これは Geoff Philbrick " "(philbrick@hks.com) によるプログラム例をもとにしています::" -#: ../../extending/extending.rst:777 -msgid "" -"#define PY_SSIZE_T_CLEAN\n" -"#include \n" -"\n" -"static PyObject *\n" -"keywdarg_parrot(PyObject *self, PyObject *args, PyObject *keywds)\n" -"{\n" -" int voltage;\n" -" const char *state = \"a stiff\";\n" -" const char *action = \"voom\";\n" -" const char *type = \"Norwegian Blue\";\n" -"\n" -" static char *kwlist[] = {\"voltage\", \"state\", \"action\", \"type\", " -"NULL};\n" -"\n" -" if (!PyArg_ParseTupleAndKeywords(args, keywds, \"i|sss\", kwlist,\n" -" &voltage, &state, &action, &type))\n" -" return NULL;\n" -"\n" -" printf(\"-- This parrot wouldn't %s if you put %i Volts through it." -"\\n\",\n" -" action, voltage);\n" -" printf(\"-- Lovely plumage, the %s -- It's %s!\\n\", type, state);\n" -"\n" -" Py_RETURN_NONE;\n" -"}\n" -"\n" -"static PyMethodDef keywdarg_methods[] = {\n" -" /* The cast of the function is necessary since PyCFunction values\n" -" * only take two PyObject* parameters, and keywdarg_parrot() takes\n" -" * three.\n" -" */\n" -" {\"parrot\", (PyCFunction)(void(*)(void))keywdarg_parrot, METH_VARARGS | " -"METH_KEYWORDS,\n" -" \"Print a lovely skit to standard output.\"},\n" -" {NULL, NULL, 0, NULL} /* sentinel */\n" -"};\n" -"\n" -"static struct PyModuleDef keywdarg_module = {\n" -" .m_base = PyModuleDef_HEAD_INIT,\n" -" .m_name = \"keywdarg\",\n" -" .m_size = 0,\n" -" .m_methods = keywdarg_methods,\n" -"};\n" -"\n" -"PyMODINIT_FUNC\n" -"PyInit_keywdarg(void)\n" -"{\n" -" return PyModuleDef_Init(&keywdarg_module);\n" -"}" -msgstr "" - -#: ../../extending/extending.rst:828 +#: ../../extending/extending.rst:802 msgid "Building Arbitrary Values" msgstr "任意の値を構築する" -#: ../../extending/extending.rst:830 +#: ../../extending/extending.rst:804 msgid "" "This function is the counterpart to :c:func:`PyArg_ParseTuple`. It is " "declared as follows::" @@ -1391,11 +1064,7 @@ msgstr "" ":c:func:`Py_BuildValue` は :c:func:`PyArg_ParseTuple` の対極に位置するもので" "す。この関数は以下のように定義されています::" -#: ../../extending/extending.rst:833 -msgid "PyObject *Py_BuildValue(const char *format, ...);" -msgstr "" - -#: ../../extending/extending.rst:835 +#: ../../extending/extending.rst:809 msgid "" "It recognizes a set of format units similar to the ones recognized by :c:" "func:`PyArg_ParseTuple`, but the arguments (which are input to the function, " @@ -1407,7 +1076,7 @@ msgstr "" "る) 引数はポインタではなく、ただの値でなければなりません。 Python から呼び出" "された C 関数が返す値として適切な、新たな Python オブジェクトを返します。" -#: ../../extending/extending.rst:840 +#: ../../extending/extending.rst:814 msgid "" "One difference with :c:func:`PyArg_ParseTuple`: while the latter requires " "its first argument to be a tuple (since Python argument lists are always " @@ -1427,38 +1096,17 @@ msgstr "" "の書式単位が記述している何らかのオブジェクトになります。サイズが 0 や 1 のタ" "プル返させたいのなら、書式文字列を丸括弧で囲います。" -#: ../../extending/extending.rst:848 +#: ../../extending/extending.rst:822 msgid "" "Examples (to the left the call, to the right the resulting Python value):" msgstr "" "以下に例を示します (左に呼び出し例を、右に構築される Python 値を示します):" -#: ../../extending/extending.rst:850 -msgid "" -"Py_BuildValue(\"\") None\n" -"Py_BuildValue(\"i\", 123) 123\n" -"Py_BuildValue(\"iii\", 123, 456, 789) (123, 456, 789)\n" -"Py_BuildValue(\"s\", \"hello\") 'hello'\n" -"Py_BuildValue(\"y\", \"hello\") b'hello'\n" -"Py_BuildValue(\"ss\", \"hello\", \"world\") ('hello', 'world')\n" -"Py_BuildValue(\"s#\", \"hello\", 4) 'hell'\n" -"Py_BuildValue(\"y#\", \"hello\", 4) b'hell'\n" -"Py_BuildValue(\"()\") ()\n" -"Py_BuildValue(\"(i)\", 123) (123,)\n" -"Py_BuildValue(\"(ii)\", 123, 456) (123, 456)\n" -"Py_BuildValue(\"(i,i)\", 123, 456) (123, 456)\n" -"Py_BuildValue(\"[i,i]\", 123, 456) [123, 456]\n" -"Py_BuildValue(\"{s:i,s:i}\",\n" -" \"abc\", 123, \"def\", 456) {'abc': 123, 'def': 456}\n" -"Py_BuildValue(\"((ii)(ii)) (ii)\",\n" -" 1, 2, 3, 4, 5, 6) (((1, 2), (3, 4)), (5, 6))" -msgstr "" - -#: ../../extending/extending.rst:874 +#: ../../extending/extending.rst:848 msgid "Reference Counts" msgstr "参照カウント法" -#: ../../extending/extending.rst:876 +#: ../../extending/extending.rst:850 msgid "" "In languages like C or C++, the programmer is responsible for dynamic " "allocation and deallocation of memory on the heap. In C, this is done using " @@ -1471,7 +1119,7 @@ msgstr "" "func:`free` で行います。C++では本質的に同じ意味で演算子 ``new`` や " "``delete`` が使われます。そこで、以下の議論は C の場合に限定して行います。" -#: ../../extending/extending.rst:882 +#: ../../extending/extending.rst:856 msgid "" "Every block of memory allocated with :c:func:`malloc` should eventually be " "returned to the pool of available memory by exactly one call to :c:func:" @@ -1480,13 +1128,25 @@ msgid "" "memory it occupies cannot be reused until the program terminates. This is " "called a :dfn:`memory leak`. On the other hand, if a program calls :c:func:" "`free` for a block and then continues to use the block, it creates a " -"conflict with reuse of the block through another :c:func:`malloc` call. " +"conflict with re-use of the block through another :c:func:`malloc` call. " "This is called :dfn:`using freed memory`. It has the same bad consequences " "as referencing uninitialized data --- core dumps, wrong results, mysterious " "crashes." msgstr "" - -#: ../../extending/extending.rst:893 +":c:func:`malloc` が確保する全てのメモリブロックは、最終的には :c:func:`free` " +"を厳密に一度だけ呼び出して利用可能メモリのプールに戻さねばなりません。そこ" +"で、適切な時に :c:func:`free` を呼び出すことが重要になります。あるメモリブ" +"ロックに対して、 :c:func:`free` を呼ばなかったにもかかわらずそのアドレスを忘" +"却してしまうと、ブロックが占有しているメモリはプログラムが終了するまで再利用" +"できなくなります。これはメモリリーク(:dfn:`memory leak`) と呼ばれています。逆" +"に、プログラムがあるメモリブロックに対して :c:func:`free` を呼んでおきなが" +"ら、そのブロックを使い続けようとすると、別の :c:func:`malloc` 呼び出しによっ" +"て行われるブロックの再利用と衝突を起こします。これは解放済みメモリの使用 (:" +"dfn:`using freed memory`) と呼ばれます。これは初期化されていないデータに対す" +"る参照と同様のよくない結果 --- コアダンプ、誤った参照、不可解なクラッシュ " +"--- を引き起こします。" + +#: ../../extending/extending.rst:867 msgid "" "Common causes of memory leaks are unusual paths through the code. For " "instance, a function may allocate a block of memory, do some calculation, " @@ -1515,7 +1175,7 @@ msgstr "" "場合に限られるからです。従って、この種のエラーを最小限にとどめるようなコー" "ディング規約や戦略を設けて、不慮のメモリリークを避けることが重要なのです。" -#: ../../extending/extending.rst:906 +#: ../../extending/extending.rst:880 msgid "" "Since Python makes heavy use of :c:func:`malloc` and :c:func:`free`, it " "needs a strategy to avoid memory leaks as well as the use of freed memory. " @@ -1534,7 +1194,7 @@ msgstr "" "ら、オブジェクトへの最後の参照が削除されたことになり、オブジェクトは解放され" "ます。" -#: ../../extending/extending.rst:914 +#: ../../extending/extending.rst:888 msgid "" "An alternative strategy is called :dfn:`automatic garbage collection`. " "(Sometimes, reference counting is also referred to as a garbage collection " @@ -1562,7 +1222,7 @@ msgstr "" "タが C で使えるようになるかもしれませんが、それまでは参照カウント法でやってい" "く以外にはないのです。" -#: ../../extending/extending.rst:926 +#: ../../extending/extending.rst:900 msgid "" "While Python uses the traditional reference counting implementation, it also " "offers a cycle detector that works to detect reference cycles. This allows " @@ -1585,24 +1245,32 @@ msgstr "" "え循環参照を形成するオブジェクトに対して他に全く参照がないとしても、循環参照" "内のどのオブジェクトに属するメモリも再利用できません。" -#: ../../extending/extending.rst:937 +#: ../../extending/extending.rst:911 msgid "" "The cycle detector is able to detect garbage cycles and can reclaim them. " "The :mod:`gc` module exposes a way to run the detector (the :func:`~gc." "collect` function), as well as configuration interfaces and the ability to " -"disable the detector at runtime." -msgstr "" -"循環参照検出機構はそのようなガベージサイクル (前述したような循環参照オブジェ" -"クト) を検出して回収することができます。\n" -":mod:`gc` モジュールそのような検出機構の実行 (:func:`~gc.collect` 関数) を提" -"供するとともに、設定のためのインタフェースおよび検出機構を実行時に無効にする" -"方法も提供しています。" +"disable the detector at runtime. The cycle detector is considered an " +"optional component; though it is included by default, it can be disabled at " +"build time using the :option:`!--without-cycle-gc` option to the :program:" +"`configure` script on Unix platforms (including Mac OS X). If the cycle " +"detector is disabled in this way, the :mod:`gc` module will not be available." +msgstr "" +"循環参照検出器は循環参照を形成しているゴミを見付け回収することできます。\n" +":mod:`gc` モジュールは、実行時に検出器を無効にする設定インターフェースだけで" +"なく、検出器を走らせる手段 (:func:`~gc.collect` 関数) も提供します。\n" +"循環参照検出器はオプションのコンポーネントだと見なされます;\n" +"デフォルトでは含まれていますが、 (Mac OS X を含む) Unix プラットフォームの :" +"program:`configure` スクリプトで :option:`!--without-cycle-gc` オプションを使" +"うことで、ビルド時に無効化することができます。\n" +"循環参照検出器がこの方法で無効化された場合、 :mod:`gc` は利用できなくなりま" +"す。" -#: ../../extending/extending.rst:946 +#: ../../extending/extending.rst:925 msgid "Reference Counting in Python" msgstr "Python における参照カウント法" -#: ../../extending/extending.rst:948 +#: ../../extending/extending.rst:927 msgid "" "There are two macros, ``Py_INCREF(x)`` and ``Py_DECREF(x)``, which handle " "the incrementing and decrementing of the reference count. :c:func:" @@ -1620,7 +1288,7 @@ msgstr "" "目的もありますが)、全てのオブジェクトには自身の型オブジェクトに対するポインタ" "が入っています。" -#: ../../extending/extending.rst:955 +#: ../../extending/extending.rst:934 msgid "" "The big question now remains: when to use ``Py_INCREF(x)`` and " "``Py_DECREF(x)``? Let's first introduce some terms. Nobody \"owns\" an " @@ -1643,7 +1311,7 @@ msgstr "" "`Py_DECREF` を呼び出す、という三つの方法があります。所有参照を処理し忘れる" "と、メモリリークを引き起こします。" -#: ../../extending/extending.rst:964 +#: ../../extending/extending.rst:943 msgid "" "It is also possible to :dfn:`borrow` [#]_ a reference to an object. The " "borrower of a reference should not call :c:func:`Py_DECREF`. The borrower " @@ -1657,7 +1325,7 @@ msgstr "" "借用参照を使うと、解放済みメモリを使用してしまう危険があるので、絶対に避けね" "ばなりません。 [#]_" -#: ../../extending/extending.rst:970 +#: ../../extending/extending.rst:949 msgid "" "The advantage of borrowing over owning a reference is that you don't need to " "take care of disposing of the reference on all possible paths through the " @@ -1674,7 +1342,7 @@ msgstr "" "実際には参照の借用元で放棄されてしまった後にその参照を使うかもしれないような" "微妙な状況があるということです。" -#: ../../extending/extending.rst:978 +#: ../../extending/extending.rst:957 msgid "" "A borrowed reference can be changed into an owned reference by calling :c:" "func:`Py_INCREF`. This does not affect the status of the owner from which " @@ -1687,11 +1355,11 @@ msgstr "" "を生成し、参照の所有者が担うべき全ての責任を課します (つまり、新たな参照の所" "有者は、以前の所有者と同様、参照の放棄を適切に行わねばなりません)。" -#: ../../extending/extending.rst:988 +#: ../../extending/extending.rst:967 msgid "Ownership Rules" msgstr "所有権にまつわる規則" -#: ../../extending/extending.rst:990 +#: ../../extending/extending.rst:969 msgid "" "Whenever an object reference is passed into or out of a function, it is part " "of the function's interface specification whether ownership is transferred " @@ -1700,7 +1368,7 @@ msgstr "" "オブジェクトへの参照を関数の内外に渡す場合には、オブジェクトの所有権が参照と" "共に渡されるか否かが常に関数インターフェース仕様の一部となります。" -#: ../../extending/extending.rst:994 +#: ../../extending/extending.rst:973 msgid "" "Most functions that return a reference to an object pass on ownership with " "the reference. In particular, all functions whose function it is to create " @@ -1717,7 +1385,7 @@ msgstr "" "ます。例えば、 :c:func:`PyLong_FromLong` はよく使う値をキャッシュしており、" "キャッシュされた値への参照を返すことがあります。" -#: ../../extending/extending.rst:1002 +#: ../../extending/extending.rst:981 msgid "" "Many functions that extract objects from other objects also transfer " "ownership with the reference, for instance :c:func:" @@ -1735,7 +1403,7 @@ msgstr "" "`PyDict_GetItemString` は全て、タプル、リスト、または辞書から借用参照を返しま" "す。" -#: ../../extending/extending.rst:1009 +#: ../../extending/extending.rst:988 msgid "" "The function :c:func:`PyImport_AddModule` also returns a borrowed reference, " "even though it may actually create the object it returns: this is possible " @@ -1745,7 +1413,7 @@ msgstr "" "にもかかわらず、借用参照を返します: これが可能なのは、生成されたオブジェクト" "に対する所有参照は ``sys.modules`` に保持されるからです。" -#: ../../extending/extending.rst:1013 +#: ../../extending/extending.rst:992 msgid "" "When you pass an object reference into another function, in general, the " "function borrows the reference from you --- if it needs to store it, it will " @@ -1763,7 +1431,7 @@ msgstr "" "す --- たとえ失敗してもです! (:c:func:`PyDict_SetItem` とその仲間は所有権を" "乗っ取りません --- これらはいわば \"普通の\" 関数です。)" -#: ../../extending/extending.rst:1021 +#: ../../extending/extending.rst:1000 msgid "" "When a C function is called from Python, it borrows references to its " "arguments from the caller. The caller owns a reference to the object, so " @@ -1777,7 +1445,7 @@ msgstr "" "照を保存したり他に渡したりしたい場合にのみ、 :c:func:`Py_INCREF` を使って所有" "参照にする必要があります。" -#: ../../extending/extending.rst:1027 +#: ../../extending/extending.rst:1006 msgid "" "The object reference returned from a C function that is called from Python " "must be an owned reference --- ownership is transferred from the function to " @@ -1786,11 +1454,11 @@ msgstr "" "Python から呼び出された C 関数が返す参照は所有参照でなければなりません --- 所" "有権は関数から呼び出し側へと委譲されます。" -#: ../../extending/extending.rst:1035 +#: ../../extending/extending.rst:1014 msgid "Thin Ice" msgstr "薄氷" -#: ../../extending/extending.rst:1037 +#: ../../extending/extending.rst:1016 msgid "" "There are a few situations where seemingly harmless use of a borrowed " "reference can lead to problems. These all have to do with implicit " @@ -1801,7 +1469,7 @@ msgstr "" "あります。この問題はすべて、インタプリタが非明示的に呼び出され、インタプリタ" "が参照の所有者に参照を放棄させてしまう状況と関係しています。" -#: ../../extending/extending.rst:1041 +#: ../../extending/extending.rst:1020 msgid "" "The first and most important case to know about is using :c:func:`Py_DECREF` " "on an unrelated object while borrowing a reference to a list item. For " @@ -1811,19 +1479,7 @@ msgstr "" "参照を借りている際に起きる、関係ないオブジェクトに対する :c:func:`Py_DECREF` " "の使用です。例えば::" -#: ../../extending/extending.rst:1044 -msgid "" -"void\n" -"bug(PyObject *list)\n" -"{\n" -" PyObject *item = PyList_GetItem(list, 0);\n" -"\n" -" PyList_SetItem(list, 1, PyLong_FromLong(0L));\n" -" PyObject_Print(item, stdout, 0); /* BUG! */\n" -"}" -msgstr "" - -#: ../../extending/extending.rst:1053 +#: ../../extending/extending.rst:1032 msgid "" "This function first borrows a reference to ``list[0]``, then replaces " "``list[1]`` with the value ``0``, and finally prints the borrowed reference. " @@ -1833,28 +1489,41 @@ msgstr "" "置き換え、最後にさきほど借用した参照を出力しています。何も問題ないように見え" "ますね? でもそうではないのです!" -#: ../../extending/extending.rst:1057 +#: ../../extending/extending.rst:1036 msgid "" "Let's follow the control flow into :c:func:`PyList_SetItem`. The list owns " "references to all its items, so when item 1 is replaced, it has to dispose " "of the original item 1. Now let's suppose the original item 1 was an " "instance of a user-defined class, and let's further suppose that the class " -"defined a :meth:`!__del__` method. If this class instance has a reference " -"count of 1, disposing of it will call its :meth:`!__del__` method." +"defined a :meth:`__del__` method. If this class instance has a reference " +"count of 1, disposing of it will call its :meth:`__del__` method." msgstr "" +":c:func:`PyList_SetItem` の処理の流れを追跡してみましょう。リストは全ての要素" +"に対して参照を所有しているので、要素 1 を置き換えると、以前の要素 1 を放棄し" +"ます。ここで、以前の要素 1 がユーザ定義クラスのインスタンスであり、さらにこの" +"クラスが :meth:`__del__` メソッドを定義していると仮定しましょう。このクラスイ" +"ンスタンスの参照カウントが 1 だった場合、リストが参照を放棄すると、インスタン" +"スの :meth:`__del__` メソッドが呼び出されます。" -#: ../../extending/extending.rst:1064 +#: ../../extending/extending.rst:1043 msgid "" -"Since it is written in Python, the :meth:`!__del__` method can execute " +"Since it is written in Python, the :meth:`__del__` method can execute " "arbitrary Python code. Could it perhaps do something to invalidate the " -"reference to ``item`` in :c:func:`!bug`? You bet! Assuming that the list " -"passed into :c:func:`!bug` is accessible to the :meth:`!__del__` method, it " +"reference to ``item`` in :c:func:`bug`? You bet! Assuming that the list " +"passed into :c:func:`bug` is accessible to the :meth:`__del__` method, it " "could execute a statement to the effect of ``del list[0]``, and assuming " "this was the last reference to that object, it would free the memory " "associated with it, thereby invalidating ``item``." msgstr "" +"クラスは Python で書かれているので、 :meth:`__del__` は任意の Python コードを" +"実行できます。この :meth:`__del__` が :c:func:`bug` における ``item`` に何か" +"不正なことをしているのでしょうか? その通り! :c:func:`bug` に渡したリストが :" +"meth:`__del__` メソッドから操作できるとすると、 ``del list[0]`` の効果を持つ" +"ような文を実行できてしまいます。もしこの操作で ``list[0]`` に対する最後の参照" +"が放棄されてしまうと、 ``list[0]`` に関連付けられていたメモリは解放され、結果" +"的に ``item`` は無効な値になってしまいます。" -#: ../../extending/extending.rst:1072 +#: ../../extending/extending.rst:1051 msgid "" "The solution, once you know the source of the problem, is easy: temporarily " "increment the reference count. The correct version of the function reads::" @@ -1862,58 +1531,42 @@ msgstr "" "問題の原因が分かれば、解決は簡単です。一時的に参照回数を増やせばよいのです。" "正しく動作するバージョンは以下のようになります::" -#: ../../extending/extending.rst:1075 -msgid "" -"void\n" -"no_bug(PyObject *list)\n" -"{\n" -" PyObject *item = PyList_GetItem(list, 0);\n" -"\n" -" Py_INCREF(item);\n" -" PyList_SetItem(list, 1, PyLong_FromLong(0L));\n" -" PyObject_Print(item, stdout, 0);\n" -" Py_DECREF(item);\n" -"}" -msgstr "" - -#: ../../extending/extending.rst:1086 +#: ../../extending/extending.rst:1065 msgid "" "This is a true story. An older version of Python contained variants of this " "bug and someone spent a considerable amount of time in a C debugger to " -"figure out why his :meth:`!__del__` methods would fail..." +"figure out why his :meth:`__del__` methods would fail..." msgstr "" +"これは実際にあった話です。以前のバージョンの Python には、このバグの一種が潜" +"んでいて、 :meth:`__del__` メソッドがどうしてうまく動かないのかを調べるため" +"に C デバッガで相当時間を費やした人がいました..." -#: ../../extending/extending.rst:1090 +#: ../../extending/extending.rst:1069 msgid "" "The second case of problems with a borrowed reference is a variant involving " "threads. Normally, multiple threads in the Python interpreter can't get in " -"each other's way, because there is a :term:`global lock ` protecting Python's entire object space. However, it is possible to " -"temporarily release this lock using the macro :c:macro:" -"`Py_BEGIN_ALLOW_THREADS`, and to re-acquire it using :c:macro:" -"`Py_END_ALLOW_THREADS`. This is common around blocking I/O calls, to let " -"other threads use the processor while waiting for the I/O to complete. " -"Obviously, the following function has the same problem as the previous one::" -msgstr "" - -#: ../../extending/extending.rst:1100 -msgid "" -"void\n" -"bug(PyObject *list)\n" -"{\n" -" PyObject *item = PyList_GetItem(list, 0);\n" -" Py_BEGIN_ALLOW_THREADS\n" -" ...some blocking I/O call...\n" -" Py_END_ALLOW_THREADS\n" -" PyObject_Print(item, stdout, 0); /* BUG! */\n" -"}" -msgstr "" - -#: ../../extending/extending.rst:1114 +"each other's way, because there is a global lock protecting Python's entire " +"object space. However, it is possible to temporarily release this lock " +"using the macro :c:macro:`Py_BEGIN_ALLOW_THREADS`, and to re-acquire it " +"using :c:macro:`Py_END_ALLOW_THREADS`. This is common around blocking I/O " +"calls, to let other threads use the processor while waiting for the I/O to " +"complete. Obviously, the following function has the same problem as the " +"previous one::" +msgstr "" +"二つ目は、借用参照がスレッドに関係しているケースです。通常は、 Python インタ" +"プリタにおける複数のスレッドは、グローバルインタプリタロックがオブジェクト空" +"間全体を保護しているため、互いに邪魔し合うことはありません。とはいえ、ロック" +"は :c:macro:`Py_BEGIN_ALLOW_THREADS` マクロで一時的に解除したり、 :c:macro:" +"`Py_END_ALLOW_THREADS` で再獲得したりできます。これらのマクロはブロックの起こ" +"る I/O 呼び出しの周囲によく置かれ、 I/O が完了するまでの間に他のスレッドがプ" +"ロセッサを利用できるようにします。明らかに、以下の関数は上の例と似た問題をは" +"らんでいます::" + +#: ../../extending/extending.rst:1092 msgid "NULL Pointers" msgstr "NULL ポインタ" -#: ../../extending/extending.rst:1116 +#: ../../extending/extending.rst:1094 msgid "" "In general, functions that take object references as arguments do not expect " "you to pass them ``NULL`` pointers, and will dump core (or cause later core " @@ -1932,7 +1585,7 @@ msgstr "" "数へと引き渡すからです --- 各々の関数が ``NULL`` テストを行えば、冗長なテスト" "が大量に行われ、コードはより低速に動くことになります。" -#: ../../extending/extending.rst:1124 +#: ../../extending/extending.rst:1102 msgid "" "It is better to test for ``NULL`` only at the \"source:\" when a pointer " "that may be ``NULL`` is received, for example, from :c:func:`malloc` or from " @@ -1942,7 +1595,7 @@ msgstr "" "になるかもしれないポインタを受け取ったときだけにしましょう。 :c:func:" "`malloc` や、例外を送出する可能性のある関数がその例です。" -#: ../../extending/extending.rst:1128 +#: ../../extending/extending.rst:1106 msgid "" "The macros :c:func:`Py_INCREF` and :c:func:`Py_DECREF` do not check for " "``NULL`` pointers --- however, their variants :c:func:`Py_XINCREF` and :c:" @@ -1952,7 +1605,7 @@ msgstr "" "チェックを行いません --- しかし、これらのマクロの変化形である :c:func:" "`Py_XINCREF` および :c:func:`Py_XDECREF` はチェックを行います。" -#: ../../extending/extending.rst:1132 +#: ../../extending/extending.rst:1110 msgid "" "The macros for checking for a particular object type (``Pytype_Check()``) " "don't check for ``NULL`` pointers --- again, there is much code that calls " @@ -1966,7 +1619,7 @@ msgstr "" "別に ``NULL`` ポインタのチェックをすると冗長なテストになってしまうのです。型" "を調べるマクロには、 ``NULL`` チェックを行う変化形はありません。" -#: ../../extending/extending.rst:1138 +#: ../../extending/extending.rst:1116 msgid "" "The C function calling mechanism guarantees that the argument list passed to " "C functions (``args`` in the examples) is never ``NULL`` --- in fact it " @@ -1976,7 +1629,7 @@ msgstr "" "ろの ``args``) が決して ``NULL`` にならないよう保証しています --- 実際には、" "常にタプル型になるよう保証しています。[#]_" -#: ../../extending/extending.rst:1142 +#: ../../extending/extending.rst:1120 msgid "" "It is a severe error to ever let a ``NULL`` pointer \"escape\" to the Python " "user." @@ -1984,11 +1637,11 @@ msgstr "" "``NULL`` ポインタを Python ユーザレベルに \"逃がし\" てしまうと、深刻なエラー" "を引き起こします。" -#: ../../extending/extending.rst:1153 +#: ../../extending/extending.rst:1131 msgid "Writing Extensions in C++" msgstr "C++での拡張モジュール作成" -#: ../../extending/extending.rst:1155 +#: ../../extending/extending.rst:1133 msgid "" "It is possible to write extension modules in C++. Some restrictions apply. " "If the main program (the Python interpreter) is compiled and linked by the C " @@ -2011,11 +1664,11 @@ msgstr "" "定義されているときに ``extern \"C\" {...}`` が行われるように、ヘッダファイル" "内にすでに書かれているからです。" -#: ../../extending/extending.rst:1169 +#: ../../extending/extending.rst:1147 msgid "Providing a C API for an Extension Module" msgstr "拡張モジュールに C API を提供する" -#: ../../extending/extending.rst:1174 +#: ../../extending/extending.rst:1152 msgid "" "Many extension modules just provide new functions and types to be used from " "Python, but sometimes the code in an extension module can be useful for " @@ -2033,7 +1686,7 @@ msgstr "" "たなコレクション型も他の拡張モジュールから直接操作できるようにするには一連の " "C 関数を持っていなければなりません。" -#: ../../extending/extending.rst:1182 +#: ../../extending/extending.rst:1160 msgid "" "At first sight this seems easy: just write the functions (without declaring " "them ``static``, of course), provide an appropriate header file, and " @@ -2061,7 +1714,7 @@ msgstr "" "す。そして、たとえシンボルがグローバル変数として可視であっても、呼び出したい" "関数の入ったモジュールがまだロードされていないことだってあります!" -#: ../../extending/extending.rst:1194 +#: ../../extending/extending.rst:1172 msgid "" "Portability therefore requires not to make any assumptions about symbol " "visibility. This means that all symbols in extension modules should be " @@ -2077,11 +1730,11 @@ msgstr "" "張モジュールからアクセスを *受けるべきではない* シンボルは別のやり方で公開せ" "ねばなりません。" -#: ../../extending/extending.rst:1201 +#: ../../extending/extending.rst:1179 msgid "" "Python provides a special mechanism to pass C-level information (pointers) " "from one extension module to another one: Capsules. A Capsule is a Python " -"data type which stores a pointer (:c:expr:`void \\*`). Capsules can only be " +"data type which stores a pointer (:c:type:`void \\*`). Capsules can only be " "created and accessed via their C API, but they can be passed around like any " "other Python object. In particular, they can be assigned to a name in an " "extension module's namespace. Other extension modules can then import this " @@ -2090,13 +1743,13 @@ msgid "" msgstr "" "Python はある拡張モジュールの C レベルの情報 (ポインタ) を別のモジュールに渡" "すための特殊な機構: Capsule (カプセル)を提供しています。 Capsule はポインタ " -"(:c:expr:`void \\*`) を記憶する Python のデータ型です。 Capsule は C API を介" +"(:c:type:`void \\*`) を記憶する Python のデータ型です。 Capsule は C API を介" "してのみ生成したりアクセスしたりできますが、他の Python オブジェクトと同じよ" "うに受け渡しできます。とりわけ、Capsule は拡張モジュールの名前空間内にある名" "前に代入できます。他の拡張モジュールはこのモジュールを import でき、次に名前" "を取得し、最後にCapsule へのポインタを取得します。" -#: ../../extending/extending.rst:1209 +#: ../../extending/extending.rst:1187 msgid "" "There are many ways in which Capsules can be used to export the C API of an " "extension module. Each function could get its own Capsule, or all C API " @@ -2111,23 +1764,23 @@ msgstr "" "は、コードを提供しているモジュールとクライアントモジュールとの間では異なる方" "法で分散できます。" -#: ../../extending/extending.rst:1215 +#: ../../extending/extending.rst:1193 msgid "" "Whichever method you choose, it's important to name your Capsules properly. " -"The function :c:func:`PyCapsule_New` takes a name parameter (:c:expr:`const " +"The function :c:func:`PyCapsule_New` takes a name parameter (:c:type:`const " "char \\*`); you're permitted to pass in a ``NULL`` name, but we strongly " "encourage you to specify a name. Properly named Capsules provide a degree " "of runtime type-safety; there is no feasible way to tell one unnamed Capsule " "from another." msgstr "" "どの方法を選ぶにしても、 Capsule の name を正しく設定することは重要です。 :c:" -"func:`PyCapsule_New` は name 引数 (:c:expr:`const char \\*`) を取ります。 " +"func:`PyCapsule_New` は name 引数 (:c:type:`const char \\*`) を取ります。 " "``NULL`` を name に渡すことも許可されていますが、 name を設定することを強く推" "奨します。正しく名前を付けられた Capsule はある程度の実行時型安全性を持ちま" "す。名前を付けられていない Capsule を他の Capsule と区別する現実的な方法はあ" "りません。" -#: ../../extending/extending.rst:1222 +#: ../../extending/extending.rst:1200 msgid "" "In particular, Capsules used to expose C APIs should be given a name " "following this convention::" @@ -2135,11 +1788,7 @@ msgstr "" "特に、 C API を公開するための Capsule には次のルールに従った名前を付けるべき" "です::" -#: ../../extending/extending.rst:1225 -msgid "modulename.attributename" -msgstr "" - -#: ../../extending/extending.rst:1227 +#: ../../extending/extending.rst:1205 msgid "" "The convenience function :c:func:`PyCapsule_Import` makes it easy to load a " "C API provided via a Capsule, but only if the Capsule's name matches this " @@ -2151,12 +1800,12 @@ msgstr "" "ことができます。この挙動により、 C API のユーザーが、確実に正しい C API を格" "納している Capsule をロードできたことを確かめることができます。" -#: ../../extending/extending.rst:1232 +#: ../../extending/extending.rst:1210 msgid "" "The following example demonstrates an approach that puts most of the burden " "on the writer of the exporting module, which is appropriate for commonly " "used library modules. It stores all C API pointers (just one in the " -"example!) in an array of :c:expr:`void` pointers which becomes the value of " +"example!) in an array of :c:type:`void` pointers which becomes the value of " "a Capsule. The header file corresponding to the module provides a macro that " "takes care of importing the module and retrieving its C API pointers; client " "modules only have to call this macro before accessing the C API." @@ -2164,112 +1813,69 @@ msgstr "" "以下の例では、名前を公開するモジュールの作者にほとんどの負荷が掛かりますが、" "よく使われるライブラリを作る際に適切なアプローチを実演します。このアプローチ" "では、全ての C API ポインタ (例中では一つだけですが!) を、 Capsule の値とな" -"る :c:expr:`void` ポインタの配列に保存します。拡張モジュールに対応するヘッダ" +"る :c:type:`void` ポインタの配列に保存します。拡張モジュールに対応するヘッダ" "ファイルは、モジュールの import と C API ポインタを取得するよう手配するマクロ" "を提供します; クライアントモジュールは、C API にアクセスする前にこのマクロを" "呼ぶだけです。" -#: ../../extending/extending.rst:1240 +#: ../../extending/extending.rst:1218 msgid "" -"The exporting module is a modification of the :mod:`!spam` module from " -"section :ref:`extending-simpleexample`. The function :func:`!spam.system` " +"The exporting module is a modification of the :mod:`spam` module from " +"section :ref:`extending-simpleexample`. The function :func:`spam.system` " "does not call the C library function :c:func:`system` directly, but a " -"function :c:func:`!PySpam_System`, which would of course do something more " +"function :c:func:`PySpam_System`, which would of course do something more " "complicated in reality (such as adding \"spam\" to every command). This " -"function :c:func:`!PySpam_System` is also exported to other extension " -"modules." +"function :c:func:`PySpam_System` is also exported to other extension modules." msgstr "" +"名前を公開する側のモジュールは、 :ref:`extending-simpleexample` 節の :mod:" +"`spam` モジュールを修正したものです。関数 :func:`spam.system` は C ライブラリ" +"関数 :c:func:`system` を直接呼び出さず、 :c:func:`PySpam_System` を呼び出しま" +"す。この関数はもちろん、実際には (全てのコマンドに \"spam\" を付けるといった" +"ような) より込み入った処理を行います。この関数 :c:func:`PySpam_System` はま" +"た、他の拡張モジュールにも公開されます。" -#: ../../extending/extending.rst:1247 +#: ../../extending/extending.rst:1225 msgid "" -"The function :c:func:`!PySpam_System` is a plain C function, declared " +"The function :c:func:`PySpam_System` is a plain C function, declared " "``static`` like everything else::" msgstr "" +"関数 :c:func:`PySpam_System` は、他の全ての関数と同様に ``static`` で宣言され" +"た通常の C 関数です::" -#: ../../extending/extending.rst:1250 -msgid "" -"static int\n" -"PySpam_System(const char *command)\n" -"{\n" -" return system(command);\n" -"}" -msgstr "" - -#: ../../extending/extending.rst:1256 -msgid "The function :c:func:`!spam_system` is modified in a trivial way::" -msgstr "" - -#: ../../extending/extending.rst:1258 -msgid "" -"static PyObject *\n" -"spam_system(PyObject *self, PyObject *args)\n" -"{\n" -" const char *command;\n" -" int sts;\n" -"\n" -" if (!PyArg_ParseTuple(args, \"s\", &command))\n" -" return NULL;\n" -" sts = PySpam_System(command);\n" -" return PyLong_FromLong(sts);\n" -"}" -msgstr "" +#: ../../extending/extending.rst:1234 +msgid "The function :c:func:`spam_system` is modified in a trivial way::" +msgstr ":c:func:`spam_system` には取るに足らない変更が施されています::" -#: ../../extending/extending.rst:1270 +#: ../../extending/extending.rst:1248 msgid "In the beginning of the module, right after the line ::" msgstr "モジュールの先頭にある以下の行 ::" -#: ../../extending/extending.rst:1272 -msgid "#include " -msgstr "" - -#: ../../extending/extending.rst:1274 +#: ../../extending/extending.rst:1252 msgid "two more lines must be added::" msgstr "の直後に、以下の二行を必ず追加してください::" -#: ../../extending/extending.rst:1276 +#: ../../extending/extending.rst:1257 msgid "" -"#define SPAM_MODULE\n" -"#include \"spammodule.h\"" +"The ``#define`` is used to tell the header file that it is being included in " +"the exporting module, not a client module. Finally, the module's " +"initialization function must take care of initializing the C API pointer " +"array::" msgstr "" +"``#define`` は、ファイル :file:`spammodule.h` をインクルードしているのが名前" +"を公開する側のモジュールであって、クライアントモジュールではないことをヘッダ" +"ファイルに教えるために使われます。最後に、モジュールの初期化関数は C API のポ" +"インタ配列を初期化するよう手配しなければなりません::" -#: ../../extending/extending.rst:1279 -msgid "" -"The ``#define`` is used to tell the header file that it is being included in " -"the exporting module, not a client module. Finally, the module's :c:data:" -"`mod_exec ` function must take care of initializing the C API " -"pointer array::" -msgstr "" - -#: ../../extending/extending.rst:1283 -msgid "" -"static int\n" -"spam_module_exec(PyObject *m)\n" -"{\n" -" static void *PySpam_API[PySpam_API_pointers];\n" -" PyObject *c_api_object;\n" -"\n" -" /* Initialize the C API pointer array */\n" -" PySpam_API[PySpam_System_NUM] = (void *)PySpam_System;\n" -"\n" -" /* Create a Capsule containing the API pointer array's address */\n" -" c_api_object = PyCapsule_New((void *)PySpam_API, \"spam._C_API\", " -"NULL);\n" -"\n" -" if (PyModule_Add(m, \"_C_API\", c_api_object) < 0) {\n" -" return -1;\n" -" }\n" -"\n" -" return 0;\n" -"}" -msgstr "" - -#: ../../extending/extending.rst:1302 +#: ../../extending/extending.rst:1287 msgid "" "Note that ``PySpam_API`` is declared ``static``; otherwise the pointer array " -"would disappear when :c:func:`!PyInit_spam` terminates!" +"would disappear when :func:`PyInit_spam` terminates!" msgstr "" +"``PySpam_API`` が ``static`` と宣言されていることに注意してください; そうしな" +"ければ、 :func:`PyInit_spam` が終了したときにポインタアレイは消滅してしまいま" +"す!" -#: ../../extending/extending.rst:1305 +#: ../../extending/extending.rst:1290 msgid "" "The bulk of the work is in the header file :file:`spammodule.h`, which looks " "like this::" @@ -2277,79 +1883,17 @@ msgstr "" "からくりの大部分はヘッダファイル :file:`spammodule.h` 内にあり、以下のように" "なっています::" -#: ../../extending/extending.rst:1308 -msgid "" -"#ifndef Py_SPAMMODULE_H\n" -"#define Py_SPAMMODULE_H\n" -"#ifdef __cplusplus\n" -"extern \"C\" {\n" -"#endif\n" -"\n" -"/* Header file for spammodule */\n" -"\n" -"/* C API functions */\n" -"#define PySpam_System_NUM 0\n" -"#define PySpam_System_RETURN int\n" -"#define PySpam_System_PROTO (const char *command)\n" -"\n" -"/* Total number of C API pointers */\n" -"#define PySpam_API_pointers 1\n" -"\n" -"\n" -"#ifdef SPAM_MODULE\n" -"/* This section is used when compiling spammodule.c */\n" -"\n" -"static PySpam_System_RETURN PySpam_System PySpam_System_PROTO;\n" -"\n" -"#else\n" -"/* This section is used in modules that use spammodule's API */\n" -"\n" -"static void **PySpam_API;\n" -"\n" -"#define PySpam_System \\\n" -" (*(PySpam_System_RETURN (*)PySpam_System_PROTO) " -"PySpam_API[PySpam_System_NUM])\n" -"\n" -"/* Return -1 on error, 0 on success.\n" -" * PyCapsule_Import will set an exception if there's an error.\n" -" */\n" -"static int\n" -"import_spam(void)\n" -"{\n" -" PySpam_API = (void **)PyCapsule_Import(\"spam._C_API\", 0);\n" -" return (PySpam_API != NULL) ? 0 : -1;\n" -"}\n" -"\n" -"#endif\n" -"\n" -"#ifdef __cplusplus\n" -"}\n" -"#endif\n" -"\n" -"#endif /* !defined(Py_SPAMMODULE_H) */" -msgstr "" - -#: ../../extending/extending.rst:1356 +#: ../../extending/extending.rst:1341 msgid "" "All that a client module must do in order to have access to the function :c:" -"func:`!PySpam_System` is to call the function (or rather macro) :c:func:`!" -"import_spam` in its :c:data:`mod_exec ` function::" -msgstr "" - -#: ../../extending/extending.rst:1360 -msgid "" -"static int\n" -"client_module_exec(PyObject *m)\n" -"{\n" -" if (import_spam() < 0) {\n" -" return -1;\n" -" }\n" -" /* additional initialization can happen here */\n" -" return 0;\n" -"}" +"func:`PySpam_System` is to call the function (or rather macro) :c:func:" +"`import_spam` in its initialization function::" msgstr "" +":c:func:`PySpam_System` へのアクセス手段を得るためにクライアントモジュール側" +"がしなければならないことは、初期化関数内での :c:func:`import_spam` 関数 (また" +"はマクロ) の呼び出しです::" -#: ../../extending/extending.rst:1370 +#: ../../extending/extending.rst:1359 msgid "" "The main disadvantage of this approach is that the file :file:`spammodule.h` " "is rather complicated. However, the basic structure is the same for each " @@ -2359,7 +1903,7 @@ msgstr "" "とです。とはいえ、各関数の基本的な構成は公開されるものと同じなので、書き方を" "一度だけ学べばすみます。" -#: ../../extending/extending.rst:1374 +#: ../../extending/extending.rst:1363 msgid "" "Finally it should be mentioned that Capsules offer additional functionality, " "which is especially useful for memory allocation and deallocation of the " @@ -2374,11 +1918,11 @@ msgstr "" "び Capsule の実装部分 (Python ソースコード配布物中のファイル :file:`Include/" "pycapsule.h` および :file:`Objects/pycapsule.c` に述べられています。" -#: ../../extending/extending.rst:1382 +#: ../../extending/extending.rst:1371 msgid "Footnotes" msgstr "脚注" -#: ../../extending/extending.rst:1383 +#: ../../extending/extending.rst:1372 msgid "" "An interface for this function already exists in the standard module :mod:" "`os` --- it was chosen as a simple and straightforward example." @@ -2386,7 +1930,7 @@ msgstr "" "この関数へのインターフェースはすでに標準モジュール :mod:`os` にあります --- " "この関数を選んだのは、単純で直接的な例を示したいからです。" -#: ../../extending/extending.rst:1386 +#: ../../extending/extending.rst:1375 msgid "" "The metaphor of \"borrowing\" a reference is not completely correct: the " "owner still has a copy of the reference." @@ -2394,7 +1938,7 @@ msgstr "" "参照を \"借用する\" というメタファは厳密には正しくありません: なぜなら、参照" "の所有者は依然として参照のコピーを持っているからです。" -#: ../../extending/extending.rst:1389 +#: ../../extending/extending.rst:1378 msgid "" "Checking that the reference count is at least 1 **does not work** --- the " "reference count itself could be in freed memory and may thus be reused for " @@ -2404,26 +1948,10 @@ msgstr "" "ト自体も解放されたメモリ上にあるため、その領域が他のオブジェクトに使われてい" "る可能性があります!" -#: ../../extending/extending.rst:1393 +#: ../../extending/extending.rst:1382 msgid "" "These guarantees don't hold when you use the \"old\" style calling " "convention --- this is still found in much existing code." msgstr "" "\"旧式の\" 呼び出し規約を使っている場合には、この保証は適用されません --- 既" "存のコードにはいまだに旧式の呼び出し規約が多々あります。" - -#: ../../extending/extending.rst:568 -msgid "PyObject_CallObject (C function)" -msgstr "" - -#: ../../extending/extending.rst:659 -msgid "PyArg_ParseTuple (C function)" -msgstr "" - -#: ../../extending/extending.rst:751 -msgid "PyArg_ParseTupleAndKeywords (C function)" -msgstr "" - -#: ../../extending/extending.rst:772 -msgid "Philbrick, Geoff" -msgstr "Philbrick, Geoff" diff --git a/extending/index.po b/extending/index.po index 29a4a12df..7479bd007 100644 --- a/extending/index.po +++ b/extending/index.po @@ -1,26 +1,27 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Yusuke Miyazaki , 2021 -# tomo, 2025 +# Arihiro TAKASE, 2017 +# tomo, 2019 +# Yusuke Miyazaki , 2020 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-30 14:22+0000\n" -"PO-Revision-Date: 2021-06-28 00:52+0000\n" -"Last-Translator: tomo, 2025\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 17:42+0000\n" +"Last-Translator: Yusuke Miyazaki , 2020\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../extending/index.rst:5 @@ -76,16 +77,41 @@ msgstr "おすすめのサードパーティツール" #: ../../extending/index.rst:28 msgid "" "This guide only covers the basic tools for creating extensions provided as " -"part of this version of CPython. Some :ref:`third party tools ` " -"offer both simpler and more sophisticated approaches to creating C and C++ " -"extensions for Python." +"part of this version of CPython. Third party tools like `Cython `_, `cffi `_, `SWIG `_ and `Numba `_ offer both simpler and " +"more sophisticated approaches to creating C and C++ extensions for Python." +msgstr "" +"このガイドがカバーするのは、このバージョンの CPython の一部として提供されてい" +"る、拡張を作成するための基本的なツールだけです。\n" +"`Cython `_, `cffi `_, `SWIG " +"`_, `Numba `_ のようなサード" +"パーティのツールは、 Python の C および C++ 拡張を作成するための、より簡潔か" +"つより洗練された手法を提供します。" + +#: ../../extending/index.rst:40 +msgid "" +"`Python Packaging User Guide: Binary Extensions `_" msgstr "" +"`Python Packaging User Guide: Binary Extensions `_" -#: ../../extending/index.rst:35 +#: ../../extending/index.rst:38 +msgid "" +"The Python Packaging User Guide not only covers several available tools that " +"simplify the creation of binary extensions, but also discusses the various " +"reasons why creating an extension module may be desirable in the first place." +msgstr "" +"Python Packaging User Guideはバイナリ拡張の作成が簡単になる便利なツールをカ" +"バーしているだけではなく、まず始めになぜ拡張モジュールを作ることが望ましいか" +"の様々な理由について議論しています。" + +#: ../../extending/index.rst:45 msgid "Creating extensions without third party tools" msgstr "サードパーティツールなしで拡張を作る" -#: ../../extending/index.rst:37 +#: ../../extending/index.rst:47 msgid "" "This section of the guide covers creating C and C++ extensions without " "assistance from third party tools. It is intended primarily for creators of " @@ -97,15 +123,11 @@ msgstr "" "これは自分自身の C 拡張を作成するおすすめの方法というよりも、主にそれらのツー" "ルを作成する人向けのものです。" -#: ../../extending/index.rst:44 -msgid ":pep:`489` -- Multi-phase extension module initialization" -msgstr ":pep:`489` -- 拡張モジュールの多段階初期化" - -#: ../../extending/index.rst:57 +#: ../../extending/index.rst:63 msgid "Embedding the CPython runtime in a larger application" msgstr "大規模なアプリケーションへの Python ランタイムの埋め込み" -#: ../../extending/index.rst:59 +#: ../../extending/index.rst:65 msgid "" "Sometimes, rather than creating an extension that runs inside the Python " "interpreter as the main application, it is desirable to instead embed the " diff --git a/extending/newtypes.po b/extending/newtypes.po index 93989e3ec..907981bed 100644 --- a/extending/newtypes.po +++ b/extending/newtypes.po @@ -1,27 +1,27 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Nozomu Kaneko , 2023 -# tomo, 2023 -# 石井明久, 2024 +# 秘湯 , 2017 +# Arihiro TAKASE, 2017 +# tomo, 2019 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:52+0000\n" -"Last-Translator: 石井明久, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 17:42+0000\n" +"Last-Translator: tomo, 2019\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../extending/newtypes.rst:7 @@ -39,109 +39,10 @@ msgstr "" #: ../../extending/newtypes.rst:14 msgid "" "Here is the definition of :c:type:`PyTypeObject`, with some fields only used " -"in :ref:`debug builds ` omitted:" -msgstr "" -"以下は :c:type:`PyTypeObject` の定義です。 :ref:`デバッグビルド ` でしか使われないいくつかのメンバは省いてあります:" - -#: ../../extending/newtypes.rst:17 -msgid "" -"typedef struct _typeobject {\n" -" PyObject_VAR_HEAD\n" -" const char *tp_name; /* For printing, in format \".\" */\n" -" Py_ssize_t tp_basicsize, tp_itemsize; /* For allocation */\n" -"\n" -" /* Methods to implement standard operations */\n" -"\n" -" destructor tp_dealloc;\n" -" Py_ssize_t tp_vectorcall_offset;\n" -" getattrfunc tp_getattr;\n" -" setattrfunc tp_setattr;\n" -" PyAsyncMethods *tp_as_async; /* formerly known as tp_compare (Python 2)\n" -" or tp_reserved (Python 3) */\n" -" reprfunc tp_repr;\n" -"\n" -" /* Method suites for standard classes */\n" -"\n" -" PyNumberMethods *tp_as_number;\n" -" PySequenceMethods *tp_as_sequence;\n" -" PyMappingMethods *tp_as_mapping;\n" -"\n" -" /* More standard operations (here for binary compatibility) */\n" -"\n" -" hashfunc tp_hash;\n" -" ternaryfunc tp_call;\n" -" reprfunc tp_str;\n" -" getattrofunc tp_getattro;\n" -" setattrofunc tp_setattro;\n" -"\n" -" /* Functions to access object as input/output buffer */\n" -" PyBufferProcs *tp_as_buffer;\n" -"\n" -" /* Flags to define presence of optional/expanded features */\n" -" unsigned long tp_flags;\n" -"\n" -" const char *tp_doc; /* Documentation string */\n" -"\n" -" /* Assigned meaning in release 2.0 */\n" -" /* call function for all accessible objects */\n" -" traverseproc tp_traverse;\n" -"\n" -" /* delete references to contained objects */\n" -" inquiry tp_clear;\n" -"\n" -" /* Assigned meaning in release 2.1 */\n" -" /* rich comparisons */\n" -" richcmpfunc tp_richcompare;\n" -"\n" -" /* weak reference enabler */\n" -" Py_ssize_t tp_weaklistoffset;\n" -"\n" -" /* Iterators */\n" -" getiterfunc tp_iter;\n" -" iternextfunc tp_iternext;\n" -"\n" -" /* Attribute descriptor and subclassing stuff */\n" -" PyMethodDef *tp_methods;\n" -" PyMemberDef *tp_members;\n" -" PyGetSetDef *tp_getset;\n" -" // Strong reference on a heap type, borrowed reference on a static type\n" -" PyTypeObject *tp_base;\n" -" PyObject *tp_dict;\n" -" descrgetfunc tp_descr_get;\n" -" descrsetfunc tp_descr_set;\n" -" Py_ssize_t tp_dictoffset;\n" -" initproc tp_init;\n" -" allocfunc tp_alloc;\n" -" newfunc tp_new;\n" -" freefunc tp_free; /* Low-level free-memory routine */\n" -" inquiry tp_is_gc; /* For PyObject_IS_GC */\n" -" PyObject *tp_bases;\n" -" PyObject *tp_mro; /* method resolution order */\n" -" PyObject *tp_cache; /* no longer used */\n" -" void *tp_subclasses; /* for static builtin types this is an index */\n" -" PyObject *tp_weaklist; /* not used for static builtin types */\n" -" destructor tp_del;\n" -"\n" -" /* Type attribute cache version tag. Added in version 2.6.\n" -" * If zero, the cache is invalid and must be initialized.\n" -" */\n" -" unsigned int tp_version_tag;\n" -"\n" -" destructor tp_finalize;\n" -" vectorcallfunc tp_vectorcall;\n" -"\n" -" /* bitset of which type-watchers care about this type */\n" -" unsigned char tp_watched;\n" -"\n" -" /* Number of tp_version_tag values used.\n" -" * Set to _Py_ATTR_CACHE_UNUSED if the attribute cache is\n" -" * disabled for this type (e.g. due to custom MRO entries).\n" -" * Otherwise, limited to MAX_VERSIONS_PER_CLASS (defined elsewhere).\n" -" */\n" -" uint16_t tp_versions_used;\n" -"} PyTypeObject;\n" +"in debug builds omitted:" msgstr "" +"以下は :c:type:`PyTypeObject` の定義です。デバッグビルドでしか使われないいく" +"つかのメンバは省いてあります:" #: ../../extending/newtypes.rst:20 msgid "" @@ -169,10 +70,6 @@ msgstr "" "多くの場合いちばん簡単なのは、必要とするメンバがすべて含まれている例をとって" "きて、新しく作る型に合わせて値を変更することです。 ::" -#: ../../extending/newtypes.rst:31 -msgid "const char *tp_name; /* For printing */" -msgstr "" - #: ../../extending/newtypes.rst:33 msgid "" "The name of the type -- as mentioned in the previous chapter, this will " @@ -183,10 +80,6 @@ msgstr "" "は診断目的で使われるものです。\n" "それなので、そのような場面で役に立つであろう名前を選んでください! ::" -#: ../../extending/newtypes.rst:37 -msgid "Py_ssize_t tp_basicsize, tp_itemsize; /* For allocation */" -msgstr "" - #: ../../extending/newtypes.rst:39 msgid "" "These fields tell the runtime how much memory to allocate when new objects " @@ -201,10 +94,6 @@ msgstr "" "度あり、ここで :c:member:`~PyTypeObject.tp_itemsize` メンバが使われます。これ" "らについてはあとでふれます。 ::" -#: ../../extending/newtypes.rst:44 -msgid "const char *tp_doc;" -msgstr "" - #: ../../extending/newtypes.rst:46 msgid "" "Here you can put a string (or its address) that you want returned when the " @@ -225,10 +114,6 @@ msgstr "" msgid "Finalization and De-allocation" msgstr "ファイナライズとメモリ解放" -#: ../../extending/newtypes.rst:64 -msgid "destructor tp_dealloc;" -msgstr "" - #: ../../extending/newtypes.rst:66 msgid "" "This function is called when the reference count of the instance of your " @@ -243,38 +128,8 @@ msgstr "" "す。オブジェクトそれ自体もここで解放される必要があります。この関数の例は、以" "下のようなものです::" -#: ../../extending/newtypes.rst:72 -msgid "" -"static void\n" -"newdatatype_dealloc(PyObject *op)\n" -"{\n" -" newdatatypeobject *self = (newdatatypeobject *) op;\n" -" free(self->obj_UnderlyingDatatypePtr);\n" -" Py_TYPE(self)->tp_free(self);\n" -"}" -msgstr "" - -#: ../../extending/newtypes.rst:80 -msgid "" -"If your type supports garbage collection, the destructor should call :c:func:" -"`PyObject_GC_UnTrack` before clearing any member fields::" -msgstr "" - #: ../../extending/newtypes.rst:83 msgid "" -"static void\n" -"newdatatype_dealloc(PyObject *op)\n" -"{\n" -" newdatatypeobject *self = (newdatatypeobject *) op;\n" -" PyObject_GC_UnTrack(op);\n" -" Py_CLEAR(self->other_obj);\n" -" ...\n" -" Py_TYPE(self)->tp_free(self);\n" -"}" -msgstr "" - -#: ../../extending/newtypes.rst:97 -msgid "" "One important requirement of the deallocator function is that it leaves any " "pending exceptions alone. This is important since deallocators are " "frequently called as the interpreter unwinds the Python stack; when the " @@ -298,38 +153,7 @@ msgstr "" "たらそれを元に戻すことです。これは :c:func:`PyErr_Fetch` および :c:func:" "`PyErr_Restore` 関数を使うことによって可能になります::" -#: ../../extending/newtypes.rst:109 -msgid "" -"static void\n" -"my_dealloc(PyObject *obj)\n" -"{\n" -" MyObject *self = (MyObject *) obj;\n" -" PyObject *cbresult;\n" -"\n" -" if (self->my_callback != NULL) {\n" -" PyObject *err_type, *err_value, *err_traceback;\n" -"\n" -" /* This saves the current exception state */\n" -" PyErr_Fetch(&err_type, &err_value, &err_traceback);\n" -"\n" -" cbresult = PyObject_CallNoArgs(self->my_callback);\n" -" if (cbresult == NULL) {\n" -" PyErr_WriteUnraisable(self->my_callback);\n" -" }\n" -" else {\n" -" Py_DECREF(cbresult);\n" -" }\n" -"\n" -" /* This restores the saved exception state */\n" -" PyErr_Restore(err_type, err_value, err_traceback);\n" -"\n" -" Py_DECREF(self->my_callback);\n" -" }\n" -" Py_TYPE(self)->tp_free(self);\n" -"}" -msgstr "" - -#: ../../extending/newtypes.rst:138 +#: ../../extending/newtypes.rst:122 msgid "" "There are limitations to what you can safely do in a deallocator function. " "First, if your type supports garbage collection (using :c:member:" @@ -352,7 +176,7 @@ msgstr "" "`~PyTypeObject.tp_dealloc` を再度呼び出し、二重解放からクラッシュすることにな" "るかもしれません。" -#: ../../extending/newtypes.rst:147 +#: ../../extending/newtypes.rst:131 msgid "" "Starting with Python 3.4, it is recommended not to put any complex " "finalization code in :c:member:`~PyTypeObject.tp_dealloc`, and instead use " @@ -362,15 +186,15 @@ msgstr "" "tp_dealloc` に置かず、代わりに新しく導入された :c:member:`~PyTypeObject." "tp_finalize` という型メソッドを使うことが推奨されています。" -#: ../../extending/newtypes.rst:152 +#: ../../extending/newtypes.rst:136 msgid ":pep:`442` explains the new finalization scheme." msgstr ":pep:`442` で新しいファイナライズの仕組みが説明されています。" -#: ../../extending/newtypes.rst:159 +#: ../../extending/newtypes.rst:143 msgid "Object Presentation" msgstr "オブジェクト表現" -#: ../../extending/newtypes.rst:161 +#: ../../extending/newtypes.rst:145 msgid "" "In Python, there are two ways to generate a textual representation of an " "object: the :func:`repr` function, and the :func:`str` function. (The :func:" @@ -381,13 +205,7 @@ msgstr "" "`print` 関数は単に :func:`str` を呼び出します。) これらのハンドラはどちらも省" "略できます。" -#: ../../extending/newtypes.rst:167 -msgid "" -"reprfunc tp_repr;\n" -"reprfunc tp_str;" -msgstr "" - -#: ../../extending/newtypes.rst:170 +#: ../../extending/newtypes.rst:154 msgid "" "The :c:member:`~PyTypeObject.tp_repr` handler should return a string object " "containing a representation of the instance for which it is called. Here is " @@ -397,25 +215,17 @@ msgstr "" "表現を格納した文字列オブジェクトを返す必要があります。簡単な例は以下のような" "ものです::" -#: ../../extending/newtypes.rst:174 -msgid "" -"static PyObject *\n" -"newdatatype_repr(PyObject *op)\n" -"{\n" -" newdatatypeobject *self = (newdatatypeobject *) op;\n" -" return PyUnicode_FromFormat(\"Repr-ified_newdatatype{{size:%d}}\",\n" -" self->obj_UnderlyingDatatypePtr->size);\n" -"}" -msgstr "" - -#: ../../extending/newtypes.rst:182 +#: ../../extending/newtypes.rst:165 msgid "" "If no :c:member:`~PyTypeObject.tp_repr` handler is specified, the " "interpreter will supply a representation that uses the type's :c:member:" -"`~PyTypeObject.tp_name` and a uniquely identifying value for the object." +"`~PyTypeObject.tp_name` and a uniquely-identifying value for the object." msgstr "" +":c:member:`~PyTypeObject.tp_repr` ハンドラが指定されていなければ、インタプリ" +"タはその型の :c:member:`~PyTypeObject.tp_name` とそのオブジェクトの一意な識別" +"値をもちいて文字列表現を作成します。" -#: ../../extending/newtypes.rst:186 +#: ../../extending/newtypes.rst:169 msgid "" "The :c:member:`~PyTypeObject.tp_str` handler is to :func:`str` what the :c:" "member:`~PyTypeObject.tp_repr` handler described above is to :func:`repr`; " @@ -433,26 +243,15 @@ msgstr "" "とを意図されています。 :c:member:`~PyTypeObject.tp_str` が指定されていない場" "合、かわりに :c:member:`~PyTypeObject.tp_repr` ハンドラが使われます。" -#: ../../extending/newtypes.rst:193 +#: ../../extending/newtypes.rst:176 msgid "Here is a simple example::" msgstr "以下は簡単な例です::" -#: ../../extending/newtypes.rst:195 -msgid "" -"static PyObject *\n" -"newdatatype_str(PyObject *op)\n" -"{\n" -" newdatatypeobject *self = (newdatatypeobject *) op;\n" -" return PyUnicode_FromFormat(\"Stringified_newdatatype{{size:%d}}\",\n" -" self->obj_UnderlyingDatatypePtr->size);\n" -"}" -msgstr "" - -#: ../../extending/newtypes.rst:206 +#: ../../extending/newtypes.rst:188 msgid "Attribute Management" msgstr "属性を管理する" -#: ../../extending/newtypes.rst:208 +#: ../../extending/newtypes.rst:190 msgid "" "For every object which can support attributes, the corresponding type must " "provide the functions that control how the attributes are resolved. There " @@ -462,40 +261,41 @@ msgid "" "handler is ``NULL``." msgstr "" -#: ../../extending/newtypes.rst:214 +#: ../../extending/newtypes.rst:196 msgid "" "Python supports two pairs of attribute handlers; a type that supports " "attributes only needs to implement the functions for one pair. The " -"difference is that one pair takes the name of the attribute as a :c:expr:" -"`char\\*`, while the other accepts a :c:expr:`PyObject*`. Each type can use " -"whichever pair makes more sense for the implementation's convenience. ::" +"difference is that one pair takes the name of the attribute as a :c:type:" +"`char\\*`, while the other accepts a :c:type:`PyObject\\*`. Each type can " +"use whichever pair makes more sense for the implementation's convenience. ::" msgstr "" +"Python は 2つの属性ハンドラの組をサポートしています。属性をもつ型はどちらか一" +"組を実装するだけでよく、それらの違いは一方の組が属性の名前を :c:type:" +"`char\\*` として受け取るのに対してもう一方の組は属性の名前を :c:type:" +"`PyObject\\*` として受け取る、というものです。それぞれの型はその実装にとって" +"都合がよい方を使えます。 ::" -#: ../../extending/newtypes.rst:220 -msgid "" -"getattrfunc tp_getattr; /* char * version */\n" -"setattrfunc tp_setattr;\n" -"/* ... */\n" -"getattrofunc tp_getattro; /* PyObject * version */\n" -"setattrofunc tp_setattro;" -msgstr "" - -#: ../../extending/newtypes.rst:226 +#: ../../extending/newtypes.rst:208 msgid "" "If accessing attributes of an object is always a simple operation (this will " "be explained shortly), there are generic implementations which can be used " -"to provide the :c:expr:`PyObject*` version of the attribute management " +"to provide the :c:type:`PyObject\\*` version of the attribute management " "functions. The actual need for type-specific attribute handlers almost " "completely disappeared starting with Python 2.2, though there are many " "examples which have not been updated to use some of the new generic " "mechanism that is available." msgstr "" +"オブジェクトの属性へのアクセスがつねに (すぐあとで説明する) 単純な操作だけな" +"らば、 :c:type:`PyObject\\*` を使って属性を管理する関数として、総称的 " +"(generic) な実装を使えます。特定の型に特化した属性ハンドラの必要性は Python " +"2.2 からほとんど完全になくなりました。しかし、多くの例はまだ、この新しく使え" +"るようになった総称的なメカニズムを使うよう更新されてはいません。" -#: ../../extending/newtypes.rst:237 +#: ../../extending/newtypes.rst:219 msgid "Generic Attribute Management" msgstr "総称的な属性を管理する" -#: ../../extending/newtypes.rst:239 +#: ../../extending/newtypes.rst:221 msgid "" "Most extension types only use *simple* attributes. So, what makes the " "attributes simple? There are only a couple of conditions that must be met:" @@ -503,14 +303,14 @@ msgstr "" "ほとんどの型は *単純な* 属性を使うだけです。では、どのような属性が単純だとい" "えるのでしょうか? それが満たすべき条件はごくわずかです:" -#: ../../extending/newtypes.rst:242 +#: ../../extending/newtypes.rst:224 msgid "" "The name of the attributes must be known when :c:func:`PyType_Ready` is " "called." msgstr "" ":c:func:`PyType_Ready` が呼ばれたとき、すでに属性の名前がわかっていること。" -#: ../../extending/newtypes.rst:245 +#: ../../extending/newtypes.rst:227 msgid "" "No special processing is needed to record that an attribute was looked up or " "set, nor do actions need to be taken based on the value." @@ -518,7 +318,7 @@ msgstr "" "属性を参照したり設定したりするときに、特別な記録のための処理が必要でなく、ま" "た参照したり設定した値に対してどんな操作も実行する必要がないこと。" -#: ../../extending/newtypes.rst:248 +#: ../../extending/newtypes.rst:230 msgid "" "Note that this list does not place any restrictions on the values of the " "attributes, when the values are computed, or how relevant data is stored." @@ -527,7 +327,7 @@ msgstr "" "がどの程度妥当なものであるかといったことになんら制約を課すものではないことに" "注意してください。" -#: ../../extending/newtypes.rst:251 +#: ../../extending/newtypes.rst:233 msgid "" "When :c:func:`PyType_Ready` is called, it uses three tables referenced by " "the type object to create :term:`descriptor`\\s which are placed in the " @@ -539,43 +339,26 @@ msgid "" "``NULL`` as well, allowing the base type to handle attributes." msgstr "" -#: ../../extending/newtypes.rst:259 +#: ../../extending/newtypes.rst:241 msgid "The tables are declared as three fields of the type object::" msgstr "テーブルはタイプオブジェクト中の 3つのメンバとして宣言されています::" -#: ../../extending/newtypes.rst:261 -msgid "" -"struct PyMethodDef *tp_methods;\n" -"struct PyMemberDef *tp_members;\n" -"struct PyGetSetDef *tp_getset;" -msgstr "" - -#: ../../extending/newtypes.rst:265 +#: ../../extending/newtypes.rst:247 msgid "" "If :c:member:`~PyTypeObject.tp_methods` is not ``NULL``, it must refer to an " "array of :c:type:`PyMethodDef` structures. Each entry in the table is an " "instance of this structure::" msgstr "" -#: ../../extending/newtypes.rst:269 -msgid "" -"typedef struct PyMethodDef {\n" -" const char *ml_name; /* method name */\n" -" PyCFunction ml_meth; /* implementation function */\n" -" int ml_flags; /* flags */\n" -" const char *ml_doc; /* docstring */\n" -"} PyMethodDef;" -msgstr "" - -#: ../../extending/newtypes.rst:276 +#: ../../extending/newtypes.rst:258 msgid "" "One entry should be defined for each method provided by the type; no entries " "are needed for methods inherited from a base type. One additional entry is " -"needed at the end; it is a sentinel that marks the end of the array. The :c:" -"member:`~PyMethodDef.ml_name` field of the sentinel must be ``NULL``." +"needed at the end; it is a sentinel that marks the end of the array. The :" +"attr:`ml_name` field of the sentinel must be ``NULL``." msgstr "" -#: ../../extending/newtypes.rst:281 +#: ../../extending/newtypes.rst:263 msgid "" "The second table is used to define attributes which map directly to data " "stored in the instance. A variety of primitive C types are supported, and " @@ -587,136 +370,168 @@ msgstr "" "を読み出し専用にも読み書き可能にもできます。このテーブルで使われる構造体は次" "のように定義されています::" -#: ../../extending/newtypes.rst:285 +#: ../../extending/newtypes.rst:275 msgid "" -"typedef struct PyMemberDef {\n" -" const char *name;\n" -" int type;\n" -" int offset;\n" -" int flags;\n" -" const char *doc;\n" -"} PyMemberDef;" +"For each entry in the table, a :term:`descriptor` will be constructed and " +"added to the type which will be able to extract a value from the instance " +"structure. The :attr:`type` field should contain one of the type codes " +"defined in the :file:`structmember.h` header; the value will be used to " +"determine how to convert Python values to and from C values. The :attr:" +"`flags` field is used to store flags which control how the attribute can be " +"accessed." msgstr "" +"このテーブルの各エントリに対して :term:`デスクリプタ ` が作成さ" +"れ、値をインスタンスの構造体から抽出しうる型に対してそれらが追加されます。 :" +"attr:`type` メンバは :file:`structmember.h` ヘッダで定義された型のコードをひ" +"とつ含んでいる必要があります。この値は Python における値と C における値をどの" +"ように変換しあうかを定めるものです。 :attr:`flags` メンバはこの属性がどのよう" +"にアクセスされるかを制御するフラグを格納するのに使われます。" -#: ../../extending/newtypes.rst:293 +#: ../../extending/newtypes.rst:282 msgid "" -"For each entry in the table, a :term:`descriptor` will be constructed and " -"added to the type which will be able to extract a value from the instance " -"structure. The :c:member:`~PyMemberDef.type` field should contain a type " -"code like :c:macro:`Py_T_INT` or :c:macro:`Py_T_DOUBLE`; the value will be " -"used to determine how to convert Python values to and from C values. The :c:" -"member:`~PyMemberDef.flags` field is used to store flags which control how " -"the attribute can be accessed: you can set it to :c:macro:`Py_READONLY` to " -"prevent Python code from setting it." +"The following flag constants are defined in :file:`structmember.h`; they may " +"be combined using bitwise-OR." msgstr "" +"以下のフラグ用定数は :file:`structmember.h` で定義されており、これらはビット" +"ごとの OR を取って組み合わせられます。" + +#: ../../extending/newtypes.rst:286 +msgid "Constant" +msgstr "定数" + +#: ../../extending/newtypes.rst:286 +msgid "Meaning" +msgstr "意味" + +#: ../../extending/newtypes.rst:288 +msgid ":const:`READONLY`" +msgstr ":const:`READONLY`" + +#: ../../extending/newtypes.rst:288 +msgid "Never writable." +msgstr "絶対に変更できない。" -#: ../../extending/newtypes.rst:301 +#: ../../extending/newtypes.rst:290 +msgid ":const:`READ_RESTRICTED`" +msgstr ":const:`READ_RESTRICTED`" + +#: ../../extending/newtypes.rst:290 +msgid "Not readable in restricted mode." +msgstr "制限モード (restricted mode) では参照できない。" + +#: ../../extending/newtypes.rst:292 +msgid ":const:`WRITE_RESTRICTED`" +msgstr ":const:`WRITE_RESTRICTED`" + +#: ../../extending/newtypes.rst:292 +msgid "Not writable in restricted mode." +msgstr "制限モード (restricted mode) では変更できない。" + +#: ../../extending/newtypes.rst:294 +msgid ":const:`RESTRICTED`" +msgstr ":const:`RESTRICTED`" + +#: ../../extending/newtypes.rst:294 +msgid "Not readable or writable in restricted mode." +msgstr "制限モード (restricted mode) では参照も変更もできない。" + +#: ../../extending/newtypes.rst:303 msgid "" "An interesting advantage of using the :c:member:`~PyTypeObject.tp_members` " "table to build descriptors that are used at runtime is that any attribute " "defined this way can have an associated doc string simply by providing the " "text in the table. An application can use the introspection API to retrieve " "the descriptor from the class object, and get the doc string using its :attr:" -"`~type.__doc__` attribute." +"`__doc__` attribute." msgstr "" +":c:member:`~PyTypeObject.tp_members` を使ったひとつの面白い利用法は、実行時に" +"使われるデスクリプタを作成しておき、単にテーブル中にテキストを置いておくこと" +"によって、この方法で定義されたすべての属性に doc string を関連付けられるよう" +"にすることです。アプリケーションはこのイントロスペクション用 API を使って、ク" +"ラスオブジェクトからデスクリプタを取り出し、その :attr:`__doc__` 属性を使っ" +"て doc string を得られます。" -#: ../../extending/newtypes.rst:307 +#: ../../extending/newtypes.rst:309 msgid "" "As with the :c:member:`~PyTypeObject.tp_methods` table, a sentinel entry " -"with a :c:member:`~PyMethodDef.ml_name` value of ``NULL`` is required." +"with a :attr:`name` value of ``NULL`` is required." msgstr "" -#: ../../extending/newtypes.rst:321 +#: ../../extending/newtypes.rst:323 msgid "Type-specific Attribute Management" msgstr "特定の型に特化した属性の管理" -#: ../../extending/newtypes.rst:323 +#: ../../extending/newtypes.rst:325 msgid "" -"For simplicity, only the :c:expr:`char\\*` version will be demonstrated " +"For simplicity, only the :c:type:`char\\*` version will be demonstrated " "here; the type of the name parameter is the only difference between the :c:" -"expr:`char\\*` and :c:expr:`PyObject*` flavors of the interface. This " +"type:`char\\*` and :c:type:`PyObject\\*` flavors of the interface. This " "example effectively does the same thing as the generic example above, but " "does not use the generic support added in Python 2.2. It explains how the " "handler functions are called, so that if you do need to extend their " "functionality, you'll understand what needs to be done." msgstr "" +"話を単純にするため、ここでは :c:type:`char\\*` を使ったバージョンのみを示しま" +"す。name パラメータの型はインターフェイスとして :c:type:`char\\*` を使うか :" +"c:type:`PyObject\\*` を使うかの違いしかありません。この例では、上の総称的な例" +"と同じことを効率的にやりますが、 Python 2.2 で追加された総称的な型のサポート" +"を使わずにやります。これはハンドラの関数がどのようにして呼ばれるのかを説明し" +"ます。これで、たとえその機能を拡張する必要があるとき、何をどうすればいいかわ" +"かるでしょう。" -#: ../../extending/newtypes.rst:331 +#: ../../extending/newtypes.rst:333 msgid "" "The :c:member:`~PyTypeObject.tp_getattr` handler is called when the object " "requires an attribute look-up. It is called in the same situations where " -"the :meth:`~object.__getattr__` method of a class would be called." +"the :meth:`__getattr__` method of a class would be called." msgstr "" +":c:member:`~PyTypeObject.tp_getattr` ハンドラはオブジェクトが属性への参照を要" +"求するときに呼ばれます。これは、そのクラスの :meth:`__getattr__` メソッドが呼" +"ばれるであろう状況と同じ状況下で呼び出されます。" -#: ../../extending/newtypes.rst:335 +#: ../../extending/newtypes.rst:337 msgid "Here is an example::" msgstr "以下に例を示します。::" -#: ../../extending/newtypes.rst:337 -msgid "" -"static PyObject *\n" -"newdatatype_getattr(PyObject *op, char *name)\n" -"{\n" -" newdatatypeobject *self = (newdatatypeobject *) op;\n" -" if (strcmp(name, \"data\") == 0) {\n" -" return PyLong_FromLong(self->data);\n" -" }\n" -"\n" -" PyErr_Format(PyExc_AttributeError,\n" -" \"'%.100s' object has no attribute '%.400s'\",\n" -" Py_TYPE(self)->tp_name, name);\n" -" return NULL;\n" -"}" -msgstr "" - -#: ../../extending/newtypes.rst:351 +#: ../../extending/newtypes.rst:353 msgid "" "The :c:member:`~PyTypeObject.tp_setattr` handler is called when the :meth:" -"`~object.__setattr__` or :meth:`~object.__delattr__` method of a class " -"instance would be called. When an attribute should be deleted, the third " -"parameter will be ``NULL``. Here is an example that simply raises an " -"exception; if this were really all you wanted, the :c:member:`~PyTypeObject." -"tp_setattr` handler should be set to ``NULL``. ::" +"`__setattr__` or :meth:`__delattr__` method of a class instance would be " +"called. When an attribute should be deleted, the third parameter will be " +"``NULL``. Here is an example that simply raises an exception; if this were " +"really all you wanted, the :c:member:`~PyTypeObject.tp_setattr` handler " +"should be set to ``NULL``. ::" msgstr "" -#: ../../extending/newtypes.rst:357 -msgid "" -"static int\n" -"newdatatype_setattr(PyObject *op, char *name, PyObject *v)\n" -"{\n" -" PyErr_Format(PyExc_RuntimeError, \"Read-only attribute: %s\", name);\n" -" return -1;\n" -"}" -msgstr "" - -#: ../../extending/newtypes.rst:365 +#: ../../extending/newtypes.rst:367 msgid "Object Comparison" msgstr "オブジェクトの比較" -#: ../../extending/newtypes.rst:369 -msgid "richcmpfunc tp_richcompare;" -msgstr "" - -#: ../../extending/newtypes.rst:371 +#: ../../extending/newtypes.rst:373 msgid "" "The :c:member:`~PyTypeObject.tp_richcompare` handler is called when " "comparisons are needed. It is analogous to the :ref:`rich comparison " -"methods `, like :meth:`!__lt__`, and also called by :c:func:" +"methods `, like :meth:`__lt__`, and also called by :c:func:" "`PyObject_RichCompare` and :c:func:`PyObject_RichCompareBool`." msgstr "" +":c:member:`~PyTypeObject.tp_richcompare` ハンドラは比較処理が要求されたときに" +"呼び出されます。\n" +":meth:`__lt__` のような :ref:`拡張比較メソッド ` に類似してお" +"り、 :c:func:`PyObject_RichCompare` と :c:func:`PyObject_RichCompareBool` か" +"らも呼び出されます。" -#: ../../extending/newtypes.rst:376 +#: ../../extending/newtypes.rst:378 msgid "" "This function is called with two Python objects and the operator as " "arguments, where the operator is one of ``Py_EQ``, ``Py_NE``, ``Py_LE``, " -"``Py_GE``, ``Py_LT`` or ``Py_GT``. It should compare the two objects with " +"``Py_GT``, ``Py_LT`` or ``Py_GT``. It should compare the two objects with " "respect to the specified operator and return ``Py_True`` or ``Py_False`` if " "the comparison is successful, ``Py_NotImplemented`` to indicate that " "comparison is not implemented and the other object's comparison method " "should be tried, or ``NULL`` if an exception was set." msgstr "" -#: ../../extending/newtypes.rst:384 +#: ../../extending/newtypes.rst:386 msgid "" "Here is a sample implementation, for a datatype that is considered equal if " "the size of an internal pointer is equal::" @@ -724,40 +539,11 @@ msgstr "" "これは内部ポインタのサイズが等しければ等しいと見なすデータ型のサンプル実装で" "す::" -#: ../../extending/newtypes.rst:387 -msgid "" -"static PyObject *\n" -"newdatatype_richcmp(PyObject *lhs, PyObject *rhs, int op)\n" -"{\n" -" newdatatypeobject *obj1 = (newdatatypeobject *) lhs;\n" -" newdatatypeobject *obj2 = (newdatatypeobject *) rhs;\n" -" PyObject *result;\n" -" int c, size1, size2;\n" -"\n" -" /* code to make sure that both arguments are of type\n" -" newdatatype omitted */\n" -"\n" -" size1 = obj1->obj_UnderlyingDatatypePtr->size;\n" -" size2 = obj2->obj_UnderlyingDatatypePtr->size;\n" -"\n" -" switch (op) {\n" -" case Py_LT: c = size1 < size2; break;\n" -" case Py_LE: c = size1 <= size2; break;\n" -" case Py_EQ: c = size1 == size2; break;\n" -" case Py_NE: c = size1 != size2; break;\n" -" case Py_GT: c = size1 > size2; break;\n" -" case Py_GE: c = size1 >= size2; break;\n" -" }\n" -" result = c ? Py_True : Py_False;\n" -" return Py_NewRef(result);\n" -" }" -msgstr "" - -#: ../../extending/newtypes.rst:415 +#: ../../extending/newtypes.rst:416 msgid "Abstract Protocol Support" msgstr "抽象的なプロトコルのサポート" -#: ../../extending/newtypes.rst:417 +#: ../../extending/newtypes.rst:418 msgid "" "Python supports a variety of *abstract* 'protocols;' the specific interfaces " "provided to use these interfaces are documented in :ref:`abstract`." @@ -765,7 +551,7 @@ msgstr "" "Python はいくつもの *抽象的な* “プロトコル”をサポートしています。これらを使用" "する特定のインターフェイスについては :ref:`abstract` で解説されています。" -#: ../../extending/newtypes.rst:421 +#: ../../extending/newtypes.rst:422 msgid "" "A number of these abstract interfaces were defined early in the development " "of the Python implementation. In particular, the number, mapping, and " @@ -780,14 +566,7 @@ msgid "" "slot, but a slot may still be unfilled.) ::" msgstr "" -#: ../../extending/newtypes.rst:432 -msgid "" -"PyNumberMethods *tp_as_number;\n" -"PySequenceMethods *tp_as_sequence;\n" -"PyMappingMethods *tp_as_mapping;" -msgstr "" - -#: ../../extending/newtypes.rst:436 +#: ../../extending/newtypes.rst:437 msgid "" "If you wish your object to be able to act like a number, a sequence, or a " "mapping object, then you place the address of a structure that implements " @@ -804,11 +583,7 @@ msgstr "" "使った例は Python の配布ソースにある :file:`Objects` でみつけることができるで" "しょう。 ::" -#: ../../extending/newtypes.rst:443 -msgid "hashfunc tp_hash;" -msgstr "" - -#: ../../extending/newtypes.rst:445 +#: ../../extending/newtypes.rst:446 msgid "" "This function, if you choose to provide it, should return a hash number for " "an instance of your data type. Here is a simple example::" @@ -816,22 +591,7 @@ msgstr "" "この関数は、もし使うことにしたならば、データ型のインスタンスのハッシュ番号を" "返すようにします。次のは単純な例です::" -#: ../../extending/newtypes.rst:448 -msgid "" -"static Py_hash_t\n" -"newdatatype_hash(PyObject *op)\n" -"{\n" -" newdatatypeobject *self = (newdatatypeobject *) op;\n" -" Py_hash_t result;\n" -" result = self->some_size + 32767 * self->some_number;\n" -" if (result == -1) {\n" -" result = -2;\n" -" }\n" -" return result;\n" -"}" -msgstr "" - -#: ../../extending/newtypes.rst:460 +#: ../../extending/newtypes.rst:459 msgid "" ":c:type:`Py_hash_t` is a signed integer type with a platform-varying width. " "Returning ``-1`` from :c:member:`~PyTypeObject.tp_hash` indicates an error, " @@ -839,11 +599,7 @@ msgid "" "computation is successful, as seen above." msgstr "" -#: ../../extending/newtypes.rst:467 -msgid "ternaryfunc tp_call;" -msgstr "" - -#: ../../extending/newtypes.rst:469 +#: ../../extending/newtypes.rst:468 msgid "" "This function is called when an instance of your data type is \"called\", " "for example, if ``obj1`` is an instance of your data type and the Python " @@ -855,11 +611,11 @@ msgstr "" "で ``obj1('hello')`` を実行したとすると、 :c:member:`~PyTypeObject.tp_call` " "ハンドラが呼ばれます。" -#: ../../extending/newtypes.rst:473 +#: ../../extending/newtypes.rst:472 msgid "This function takes three arguments:" msgstr "この関数は 3つの引数をとります:" -#: ../../extending/newtypes.rst:475 +#: ../../extending/newtypes.rst:474 msgid "" "*self* is the instance of the data type which is the subject of the call. If " "the call is ``obj1('hello')``, then *self* is ``obj1``." @@ -867,7 +623,7 @@ msgstr "" "*self* は呼び出しの対象となるデータ型のインスタンスです。\n" "たとえば呼び出しが ``obj1('hello')`` の場合、*self* は ``obj1`` になります。" -#: ../../extending/newtypes.rst:478 +#: ../../extending/newtypes.rst:477 msgid "" "*args* is a tuple containing the arguments to the call. You can use :c:func:" "`PyArg_ParseTuple` to extract the arguments." @@ -875,7 +631,7 @@ msgstr "" "*args* は呼び出しの引数を格納しているタプルです。ここから引数を取り出すには :" "c:func:`PyArg_ParseTuple` を使います。" -#: ../../extending/newtypes.rst:481 +#: ../../extending/newtypes.rst:480 msgid "" "*kwds* is a dictionary of keyword arguments that were passed. If this is non-" "``NULL`` and you support keyword arguments, use :c:func:" @@ -884,65 +640,36 @@ msgid "" "`TypeError` with a message saying that keyword arguments are not supported." msgstr "" -#: ../../extending/newtypes.rst:487 +#: ../../extending/newtypes.rst:486 msgid "Here is a toy ``tp_call`` implementation::" msgstr "以下は ``tp_call`` の簡易な実装です::" -#: ../../extending/newtypes.rst:489 -msgid "" -"static PyObject *\n" -"newdatatype_call(PyObject *op, PyObject *args, PyObject *kwds)\n" -"{\n" -" newdatatypeobject *self = (newdatatypeobject *) op;\n" -" PyObject *result;\n" -" const char *arg1;\n" -" const char *arg2;\n" -" const char *arg3;\n" -"\n" -" if (!PyArg_ParseTuple(args, \"sss:call\", &arg1, &arg2, &arg3)) {\n" -" return NULL;\n" -" }\n" -" result = PyUnicode_FromFormat(\n" -" \"Returning -- value: [%d] arg1: [%s] arg2: [%s] arg3: [%s]\\n\",\n" -" self->obj_UnderlyingDatatypePtr->size,\n" -" arg1, arg2, arg3);\n" -" return result;\n" -"}" -msgstr "" - -#: ../../extending/newtypes.rst:510 -msgid "" -"/* Iterators */\n" -"getiterfunc tp_iter;\n" -"iternextfunc tp_iternext;" -msgstr "" - -#: ../../extending/newtypes.rst:514 +#: ../../extending/newtypes.rst:512 msgid "" "These functions provide support for the iterator protocol. Both handlers " "take exactly one parameter, the instance for which they are being called, " "and return a new reference. In the case of an error, they should set an " "exception and return ``NULL``. :c:member:`~PyTypeObject.tp_iter` " -"corresponds to the Python :meth:`~object.__iter__` method, while :c:member:" +"corresponds to the Python :meth:`__iter__` method, while :c:member:" "`~PyTypeObject.tp_iternext` corresponds to the Python :meth:`~iterator." "__next__` method." msgstr "" -#: ../../extending/newtypes.rst:521 +#: ../../extending/newtypes.rst:519 msgid "" "Any :term:`iterable` object must implement the :c:member:`~PyTypeObject." "tp_iter` handler, which must return an :term:`iterator` object. Here the " "same guidelines apply as for Python classes:" msgstr "" -#: ../../extending/newtypes.rst:525 +#: ../../extending/newtypes.rst:523 msgid "" "For collections (such as lists and tuples) which can support multiple " "independent iterators, a new iterator should be created and returned by each " "call to :c:member:`~PyTypeObject.tp_iter`." msgstr "" -#: ../../extending/newtypes.rst:528 +#: ../../extending/newtypes.rst:526 msgid "" "Objects which can only be iterated over once (usually due to side effects of " "iteration, such as file objects) can implement :c:member:`~PyTypeObject." @@ -950,7 +677,7 @@ msgid "" "therefore implement the :c:member:`~PyTypeObject.tp_iternext` handler." msgstr "" -#: ../../extending/newtypes.rst:533 +#: ../../extending/newtypes.rst:531 msgid "" "Any :term:`iterator` object should implement both :c:member:`~PyTypeObject." "tp_iter` and :c:member:`~PyTypeObject.tp_iternext`. An iterator's :c:member:" @@ -965,66 +692,64 @@ msgid "" "``NULL``." msgstr "" -#: ../../extending/newtypes.rst:549 +#: ../../extending/newtypes.rst:547 msgid "Weak Reference Support" msgstr "弱参照(Weak Reference)のサポート" -#: ../../extending/newtypes.rst:551 +#: ../../extending/newtypes.rst:549 msgid "" "One of the goals of Python's weak reference implementation is to allow any " "type to participate in the weak reference mechanism without incurring the " "overhead on performance-critical objects (such as numbers)." msgstr "" -#: ../../extending/newtypes.rst:556 +#: ../../extending/newtypes.rst:554 msgid "Documentation for the :mod:`weakref` module." msgstr "" -#: ../../extending/newtypes.rst:558 +#: ../../extending/newtypes.rst:556 msgid "" -"For an object to be weakly referenceable, the extension type must set the " -"``Py_TPFLAGS_MANAGED_WEAKREF`` bit of the :c:member:`~PyTypeObject.tp_flags` " -"field. The legacy :c:member:`~PyTypeObject.tp_weaklistoffset` field should " -"be left as zero." +"For an object to be weakly referencable, the extension type must do two " +"things:" msgstr "" -#: ../../extending/newtypes.rst:563 +#: ../../extending/newtypes.rst:558 msgid "" -"Concretely, here is how the statically declared type object would look::" +"Include a :c:type:`PyObject\\*` field in the C object structure dedicated to " +"the weak reference mechanism. The object's constructor should leave it " +"``NULL`` (which is automatic when using the default :c:member:`~PyTypeObject." +"tp_alloc`)." msgstr "" -#: ../../extending/newtypes.rst:565 +#: ../../extending/newtypes.rst:563 msgid "" -"static PyTypeObject TrivialType = {\n" -" PyVarObject_HEAD_INIT(NULL, 0)\n" -" /* ... other members omitted for brevity ... */\n" -" .tp_flags = Py_TPFLAGS_MANAGED_WEAKREF | ...,\n" -"};" +"Set the :c:member:`~PyTypeObject.tp_weaklistoffset` type member to the " +"offset of the aforementioned field in the C object structure, so that the " +"interpreter knows how to access and modify that field." msgstr "" -#: ../../extending/newtypes.rst:572 +#: ../../extending/newtypes.rst:567 msgid "" -"The only further addition is that ``tp_dealloc`` needs to clear any weak " -"references (by calling :c:func:`PyObject_ClearWeakRefs`)::" +"Concretely, here is how a trivial object structure would be augmented with " +"the required field::" msgstr "" #: ../../extending/newtypes.rst:575 +msgid "And the corresponding member in the statically-declared type object::" +msgstr "" + +#: ../../extending/newtypes.rst:583 msgid "" -"static void\n" -"Trivial_dealloc(PyObject *op)\n" -"{\n" -" /* Clear weakrefs first before calling any destructors */\n" -" PyObject_ClearWeakRefs(op);\n" -" /* ... remainder of destruction code omitted for brevity ... */\n" -" Py_TYPE(op)->tp_free(op);\n" -"}" +"The only further addition is that ``tp_dealloc`` needs to clear any weak " +"references (by calling :c:func:`PyObject_ClearWeakRefs`) if the field is non-" +"``NULL``::" msgstr "" -#: ../../extending/newtypes.rst:586 +#: ../../extending/newtypes.rst:599 msgid "More Suggestions" msgstr "その他いろいろ" -#: ../../extending/newtypes.rst:588 +#: ../../extending/newtypes.rst:601 msgid "" "In order to learn how to implement any specific method for your new data " "type, get the :term:`CPython` source code. Go to the :file:`Objects` " @@ -1033,78 +758,26 @@ msgid "" "function you want to implement." msgstr "" -#: ../../extending/newtypes.rst:594 +#: ../../extending/newtypes.rst:607 msgid "" "When you need to verify that an object is a concrete instance of the type " "you are implementing, use the :c:func:`PyObject_TypeCheck` function. A " "sample of its use might be something like the following::" msgstr "" -#: ../../extending/newtypes.rst:598 -msgid "" -"if (!PyObject_TypeCheck(some_object, &MyType)) {\n" -" PyErr_SetString(PyExc_TypeError, \"arg #1 not a mything\");\n" -" return NULL;\n" -"}" -msgstr "" - -#: ../../extending/newtypes.rst:604 +#: ../../extending/newtypes.rst:618 msgid "Download CPython source releases." msgstr "" -#: ../../extending/newtypes.rst:605 +#: ../../extending/newtypes.rst:618 msgid "https://www.python.org/downloads/source/" msgstr "" -#: ../../extending/newtypes.rst:607 +#: ../../extending/newtypes.rst:620 msgid "" "The CPython project on GitHub, where the CPython source code is developed." msgstr "" -#: ../../extending/newtypes.rst:608 +#: ../../extending/newtypes.rst:621 msgid "https://github.com/python/cpython" msgstr "" - -#: ../../extending/newtypes.rst:56 -msgid "object" -msgstr "object" - -#: ../../extending/newtypes.rst:56 -msgid "deallocation" -msgstr "deallocation" - -#: ../../extending/newtypes.rst:56 -msgid "deallocation, object" -msgstr "deallocation, object" - -#: ../../extending/newtypes.rst:56 -msgid "finalization" -msgstr "finalization" - -#: ../../extending/newtypes.rst:56 -msgid "finalization, of objects" -msgstr "finalization, of objects" - -#: ../../extending/newtypes.rst:93 -msgid "PyErr_Fetch (C function)" -msgstr "" - -#: ../../extending/newtypes.rst:93 -msgid "PyErr_Restore (C function)" -msgstr "" - -#: ../../extending/newtypes.rst:154 -msgid "string" -msgstr "string" - -#: ../../extending/newtypes.rst:154 -msgid "object representation" -msgstr "" - -#: ../../extending/newtypes.rst:154 -msgid "built-in function" -msgstr "組み込み関数" - -#: ../../extending/newtypes.rst:154 -msgid "repr" -msgstr "repr" diff --git a/extending/newtypes_tutorial.po b/extending/newtypes_tutorial.po index 6ce7086de..6f3f59738 100644 --- a/extending/newtypes_tutorial.po +++ b/extending/newtypes_tutorial.po @@ -1,27 +1,31 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 -# Arihiro TAKASE, 2023 -# 石井明久, 2024 +# Arihiro TAKASE, 2018 +# Nozomu Kaneko , 2018 +# 秘湯 , 2018 +# Osamu NAKAMURA, 2019 +# tomo, 2019 +# Yuta Kanzawa, 2019 +# samuel300z , 2020 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-30 14:22+0000\n" -"PO-Revision-Date: 2021-06-28 00:52+0000\n" -"Last-Translator: 石井明久, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2018-04-08 04:04+0000\n" +"Last-Translator: samuel300z , 2020\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../extending/newtypes_tutorial.rst:7 @@ -49,7 +53,7 @@ msgstr "基本的なこと" #: ../../extending/newtypes_tutorial.rst:26 msgid "" "The :term:`CPython` runtime sees all Python objects as variables of type :c:" -"expr:`PyObject*`, which serves as a \"base type\" for all Python objects. " +"type:`PyObject\\*`, which serves as a \"base type\" for all Python objects. " "The :c:type:`PyObject` structure itself only contains the object's :term:" "`reference count` and a pointer to the object's \"type object\". This is " "where the action is; the type object determines which (C) functions get " @@ -57,14 +61,17 @@ msgid "" "an object, a method called, or it is multiplied by another object. These C " "functions are called \"type methods\"." msgstr "" -":term:`CPython` ランタイムは Python の全てのオブジェクトを、 Python の全ての" -"オブジェクトの \"基底型 (base type)\" である :c:expr:`PyObject*` 型の変数と見" -"なします。 :c:type:`PyObject` 構造体自身は :term:`参照カウント ` と、オブジェクトの \"型オブジェクト\" へのポインタのみを持ちます。こ" -"こには動作が定義されています; 型オブジェクトは、例えば、ある属性があるオブ" +":term:`CPython` ランタイムは Python の全てのオブジェクトを :c:type:" +"`PyObject\\*` 型の変数と見なします。\n" +":c:type:`PyObject\\*` は Python の全てのオブジェクトの \"基底型 (base " +"type)\" となっています。\n" +":c:type:`PyObject` 構造体自身は :term:`参照カウント ` と、オ" +"ブジェクトの \"型オブジェクト (type object)\" へのポインタのみを持ちます。\n" +"ここには動作が定義されています; 型オブジェクトは、例えば、ある属性があるオブ" "ジェクトから検索されたり、メソッドが呼ばれたり、他のオブジェクトによって操作" -"されたりしたときに、どの (C) 関数がインタープリターから呼ばれるのかを決定しま" -"す。これらの C 関数は \"型メソッド (type method)\" と呼ばれます。" +"されたりしたときに、どの (C) 関数がインタプリタから呼ばれるのかを決定しま" +"す。\n" +"これらの C 関数は \"タイプメソッド (type method)\" と呼ばれます。" #: ../../extending/newtypes_tutorial.rst:35 msgid "" @@ -77,11 +84,11 @@ msgstr "" #: ../../extending/newtypes_tutorial.rst:38 msgid "" "This sort of thing can only be explained by example, so here's a minimal, " -"but complete, module that defines a new type named :class:`!Custom` inside a " -"C extension module :mod:`!custom`:" +"but complete, module that defines a new type named :class:`Custom` inside a " +"C extension module :mod:`custom`:" msgstr "" -"この手のことは例を見たほうが早いでしょうから、以下に C 拡張モジュール :mod:`!" -"custom` にある :class:`!Custom` という名前の新しい型を定義する、最小限ながら" +"この手のことは例を見たほうが早いでしょうから、以下に C 拡張モジュール :mod:" +"`custom` にある :class:`Custom` という名前の新しい型を定義する、最小限ながら" "完全なモジュールをあげておきます:" #: ../../extending/newtypes_tutorial.rst:43 @@ -96,64 +103,6 @@ msgstr "" "C API では、 :c:func:`PyType_FromSpec` 関数を使い、ヒープ上に配置された拡張の" "型も定義できますが、これについてはこのチュートリアルでは扱いません。" -#: ../../extending/newtypes_tutorial.rst:48 -msgid "" -"#define PY_SSIZE_T_CLEAN\n" -"#include \n" -"\n" -"typedef struct {\n" -" PyObject_HEAD\n" -" /* Type-specific fields go here. */\n" -"} CustomObject;\n" -"\n" -"static PyTypeObject CustomType = {\n" -" .ob_base = PyVarObject_HEAD_INIT(NULL, 0)\n" -" .tp_name = \"custom.Custom\",\n" -" .tp_doc = PyDoc_STR(\"Custom objects\"),\n" -" .tp_basicsize = sizeof(CustomObject),\n" -" .tp_itemsize = 0,\n" -" .tp_flags = Py_TPFLAGS_DEFAULT,\n" -" .tp_new = PyType_GenericNew,\n" -"};\n" -"\n" -"static int\n" -"custom_module_exec(PyObject *m)\n" -"{\n" -" if (PyType_Ready(&CustomType) < 0) {\n" -" return -1;\n" -" }\n" -"\n" -" if (PyModule_AddObjectRef(m, \"Custom\", (PyObject *) &CustomType) < 0) " -"{\n" -" return -1;\n" -" }\n" -"\n" -" return 0;\n" -"}\n" -"\n" -"static PyModuleDef_Slot custom_module_slots[] = {\n" -" {Py_mod_exec, custom_module_exec},\n" -" // Just use this while using static types\n" -" {Py_mod_multiple_interpreters, " -"Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED},\n" -" {0, NULL}\n" -"};\n" -"\n" -"static PyModuleDef custom_module = {\n" -" .m_base = PyModuleDef_HEAD_INIT,\n" -" .m_name = \"custom\",\n" -" .m_doc = \"Example module that creates an extension type.\",\n" -" .m_size = 0,\n" -" .m_slots = custom_module_slots,\n" -"};\n" -"\n" -"PyMODINIT_FUNC\n" -"PyInit_custom(void)\n" -"{\n" -" return PyModuleDef_Init(&custom_module);\n" -"}\n" -msgstr "" - #: ../../extending/newtypes_tutorial.rst:50 msgid "" "Now that's quite a bit to take in at once, but hopefully bits will seem " @@ -164,61 +113,53 @@ msgstr "" #: ../../extending/newtypes_tutorial.rst:53 msgid "" -"What a :class:`!Custom` **object** contains: this is the ``CustomObject`` " -"struct, which is allocated once for each :class:`!Custom` instance." +"What a :class:`Custom` **object** contains: this is the ``CustomObject`` " +"struct, which is allocated once for each :class:`Custom` instance." msgstr "" -":class:`!Custom` **オブジェクト** が何を含んでいるか: これが " -"``CustomObject`` 構造体で、 :class:`!Custom` インスタンスごとに1回だけメモリ" -"確保が行われます。" +":class:`Custom` **オブジェクト** が何を含んでいるか: これが ``CustomObject`` " +"構造体で、 :class:`Custom` インスタンスごとに1回だけメモリ確保が行われます。" #: ../../extending/newtypes_tutorial.rst:55 msgid "" -"How the :class:`!Custom` **type** behaves: this is the ``CustomType`` " -"struct, which defines a set of flags and function pointers that the " -"interpreter inspects when specific operations are requested." +"How the :class:`Custom` **type** behaves: this is the ``CustomType`` struct, " +"which defines a set of flags and function pointers that the interpreter " +"inspects when specific operations are requested." msgstr "" -":class:`!Custom` **型** がどのように振る舞うか: これが ``CustomType`` 構造体" +":class:`Custom` **型** がどのように振る舞うか: これが ``CustomType`` 構造体" "で、フラグと関数ポインタの集まりを定義しています。特定の操作が要求されたとき" -"に、この関数ポインタをインタープリターが見に行きます。" +"に、この関数ポインタをインタプリタが見に行きます。" #: ../../extending/newtypes_tutorial.rst:58 msgid "" -"How to define and execute the :mod:`!custom` module: this is the " -"``PyInit_custom`` function and the associated ``custom_module`` struct for " -"defining the module, and the ``custom_module_exec`` function to set up a " -"fresh module object." +"How to initialize the :mod:`custom` module: this is the ``PyInit_custom`` " +"function and the associated ``custommodule`` struct." msgstr "" +":mod:`custom` モジュールをどう初期化するか: これが ``PyInit_custom`` 関数とそ" +"れに関係する ``custommodule`` 構造体です。" -#: ../../extending/newtypes_tutorial.rst:63 +#: ../../extending/newtypes_tutorial.rst:61 msgid "The first bit is::" msgstr "まず最初はこれです::" -#: ../../extending/newtypes_tutorial.rst:65 -msgid "" -"typedef struct {\n" -" PyObject_HEAD\n" -"} CustomObject;" -msgstr "" - -#: ../../extending/newtypes_tutorial.rst:69 +#: ../../extending/newtypes_tutorial.rst:67 msgid "" "This is what a Custom object will contain. ``PyObject_HEAD`` is mandatory " "at the start of each object struct and defines a field called ``ob_base`` of " "type :c:type:`PyObject`, containing a pointer to a type object and a " -"reference count (these can be accessed using the macros :c:macro:`Py_TYPE` " -"and :c:macro:`Py_REFCNT` respectively). The reason for the macro is to " -"abstract away the layout and to enable additional fields in :ref:`debug " -"builds `." -msgstr "" -"これが Custom オブジェクトの内容です。 ``PyObject_HEAD`` はそれぞれのオブジェ" -"クト構造体の先頭に必須なもので、 :c:type:`PyObject` 型の ``ob_base`` という名" -"前のフィールドを定義します。 :c:type:`PyObject` 型には (それぞれ :c:macro:" -"`Py_TYPE` マクロおよび :c:macro:`Py_REFCNT` マクロからアクセスできる) 型オブ" -"ジェクトへのポインタと参照カウントが格納されています。このマクロが用意されて" -"いる理由は、構造体のレイアウトを抽象化し、デバッグビルドでフィールドを追加で" -"きるようにするためです。" +"reference count (these can be accessed using the macros :c:macro:`Py_REFCNT` " +"and :c:macro:`Py_TYPE` respectively). The reason for the macro is to " +"abstract away the layout and to enable additional fields in debug builds." +msgstr "" +"これが Custom オブジェクトの内容です。\n" +"``PyObject_HEAD`` はそれぞれのオブジェクト構造体の先頭に必須なもので、 :c:" +"type:`PyObject` 型の ``ob_base`` という名前のフィールドを定義します。 :c:" +"type:`PyObject` 型には (それぞれ :c:macro:`Py_REFCNT` マクロおよび :c:macro:" +"`Py_TYPE` マクロからアクセスできる) 型オブジェクトへのポインタと参照カウント" +"が格納されています。\n" +"このマクロが用意されている理由は、構造体のレイアウトを抽象化し、デバッグビル" +"ドでフィールドを追加できるようにするためです。" -#: ../../extending/newtypes_tutorial.rst:78 +#: ../../extending/newtypes_tutorial.rst:75 msgid "" "There is no semicolon above after the :c:macro:`PyObject_HEAD` macro. Be " "wary of adding one by accident: some compilers will complain." @@ -227,7 +168,7 @@ msgstr "" "うっかりセミコロンを追加しないように気を付けてください: これを警告するコンパ" "イラもあります。" -#: ../../extending/newtypes_tutorial.rst:81 +#: ../../extending/newtypes_tutorial.rst:78 msgid "" "Of course, objects generally store additional data besides the standard " "``PyObject_HEAD`` boilerplate; for example, here is the definition for " @@ -237,32 +178,11 @@ msgstr "" "の他にもデータを保持しています; 例えば、これは Python 標準の浮動小数点数の定" "義です::" -#: ../../extending/newtypes_tutorial.rst:85 -msgid "" -"typedef struct {\n" -" PyObject_HEAD\n" -" double ob_fval;\n" -"} PyFloatObject;" -msgstr "" - -#: ../../extending/newtypes_tutorial.rst:90 +#: ../../extending/newtypes_tutorial.rst:87 msgid "The second bit is the definition of the type object. ::" msgstr "2つ目は型オブジェクトの定義です。 ::" -#: ../../extending/newtypes_tutorial.rst:92 -msgid "" -"static PyTypeObject CustomType = {\n" -" .ob_base = PyVarObject_HEAD_INIT(NULL, 0)\n" -" .tp_name = \"custom.Custom\",\n" -" .tp_doc = PyDoc_STR(\"Custom objects\"),\n" -" .tp_basicsize = sizeof(CustomObject),\n" -" .tp_itemsize = 0,\n" -" .tp_flags = Py_TPFLAGS_DEFAULT,\n" -" .tp_new = PyType_GenericNew,\n" -"};" -msgstr "" - -#: ../../extending/newtypes_tutorial.rst:103 +#: ../../extending/newtypes_tutorial.rst:100 msgid "" "We recommend using C99-style designated initializers as above, to avoid " "listing all the :c:type:`PyTypeObject` fields that you don't care about and " @@ -272,7 +192,7 @@ msgstr "" "`PyTypeObject` の特に関心の無いフィールドまで全て並べたり、フィールドを宣言す" "る順序に気を使ったりせずに済ませるのをお薦めします。" -#: ../../extending/newtypes_tutorial.rst:107 +#: ../../extending/newtypes_tutorial.rst:104 msgid "" "The actual definition of :c:type:`PyTypeObject` in :file:`object.h` has many " "more :ref:`fields ` than the definition above. The remaining " @@ -284,15 +204,11 @@ msgstr "" "ここに出てきていないフィールドは C コンパイラによってゼロで埋められるので、必" "要でない限り明示的には値の指定をしないのが一般的な作法になっています。" -#: ../../extending/newtypes_tutorial.rst:112 +#: ../../extending/newtypes_tutorial.rst:109 msgid "We're going to pick it apart, one field at a time::" msgstr "一度に1つずつフィールドを取り上げていきましょう::" -#: ../../extending/newtypes_tutorial.rst:114 -msgid ".ob_base = PyVarObject_HEAD_INIT(NULL, 0)" -msgstr "" - -#: ../../extending/newtypes_tutorial.rst:116 +#: ../../extending/newtypes_tutorial.rst:113 msgid "" "This line is mandatory boilerplate to initialize the ``ob_base`` field " "mentioned above. ::" @@ -300,11 +216,7 @@ msgstr "" "この行は、上で触れた ``ob_base`` フィールドの初期化に必須のボイラープレートで" "す。" -#: ../../extending/newtypes_tutorial.rst:119 -msgid ".tp_name = \"custom.Custom\"," -msgstr "" - -#: ../../extending/newtypes_tutorial.rst:121 +#: ../../extending/newtypes_tutorial.rst:118 msgid "" "The name of our type. This will appear in the default textual " "representation of our objects and in some error messages, for example:" @@ -313,68 +225,62 @@ msgstr "" "これは、オブジェクトのデフォルトの文字列表現やエラーメッセージに現れます。例" "えば次の通りです:" -#: ../../extending/newtypes_tutorial.rst:124 -msgid "" -">>> \"\" + custom.Custom()\n" -"Traceback (most recent call last):\n" -" File \"\", line 1, in \n" -"TypeError: can only concatenate str (not \"custom.Custom\") to str" -msgstr "" - -#: ../../extending/newtypes_tutorial.rst:131 +#: ../../extending/newtypes_tutorial.rst:128 msgid "" "Note that the name is a dotted name that includes both the module name and " -"the name of the type within the module. The module in this case is :mod:`!" -"custom` and the type is :class:`!Custom`, so we set the type name to :class:" -"`!custom.Custom`. Using the real dotted import path is important to make " -"your type compatible with the :mod:`pydoc` and :mod:`pickle` modules. ::" +"the name of the type within the module. The module in this case is :mod:" +"`custom` and the type is :class:`Custom`, so we set the type name to :class:" +"`custom.Custom`. Using the real dotted import path is important to make your " +"type compatible with the :mod:`pydoc` and :mod:`pickle` modules. ::" msgstr "" "型の名前が、モジュール名とモジュールにおける型の名前の両方をドットでつないだ" -"名前になっていることに注意してください。この場合は、モジュールは :mod:`!" -"custom` で型は :class:`!Custom` なので、型の名前を :class:`!custom.Custom` に" -"設定しました。実際のドット付きのインポートパスを使うのは、 :mod:`pydoc` モ" -"ジュールや :mod:`pickle` モジュールと互換性を持たせるために重要なのです。" +"名前になっていることに注意してください。\n" +"この場合は、モジュールは :mod:`custom` で型は :class:`Custom` なので、型の名" +"前を :class:`custom.Custom` に設定しました。\n" +"実際のドット付きのインポートパスを使うのは、 :mod:`pydoc` モジュールや :mod:" +"`pickle` モジュールと互換性を持たせるために重要なのです。" #: ../../extending/newtypes_tutorial.rst:137 msgid "" -".tp_basicsize = sizeof(CustomObject),\n" -".tp_itemsize = 0," -msgstr "" - -#: ../../extending/newtypes_tutorial.rst:140 -msgid "" "This is so that Python knows how much memory to allocate when creating new :" -"class:`!Custom` instances. :c:member:`~PyTypeObject.tp_itemsize` is only " +"class:`Custom` instances. :c:member:`~PyTypeObject.tp_itemsize` is only " "used for variable-sized objects and should otherwise be zero." msgstr "" -"これは、新しい :class:`!Custom` インスタンスを作るときに Python が割り当てる" -"べきメモリがどのくらいなのかを知るためのものです。 :c:member:`~PyTypeObject." -"tp_itemsize` は可変サイズのオブジェクトでのみ使うものなので、サイズが可変でな" -"いオブジェクトでは 0 にすべきです。" +":c:member:`~PyTypeObject.tp_basicsize` は、新しい :class:`Custom` インスタン" +"スを作るとき Python が割り当てるべきメモリがどのくらいなのかを知るためのもの" +"です。\n" +":c:member:`~PyTypeObject.tp_itemsize` は可変サイズのオブジェクトでのみ使うも" +"のなので、サイズが可変でないオブジェクトでは 0 にすべきです。" -#: ../../extending/newtypes_tutorial.rst:146 +#: ../../extending/newtypes_tutorial.rst:143 msgid "" "If you want your type to be subclassable from Python, and your type has the " "same :c:member:`~PyTypeObject.tp_basicsize` as its base type, you may have " "problems with multiple inheritance. A Python subclass of your type will " -"have to list your type first in its :attr:`~type.__bases__`, or else it will " -"not be able to call your type's :meth:`~object.__new__` method without " -"getting an error. You can avoid this problem by ensuring that your type has " -"a larger value for :c:member:`~PyTypeObject.tp_basicsize` than its base type " +"have to list your type first in its :attr:`~class.__bases__`, or else it " +"will not be able to call your type's :meth:`__new__` method without getting " +"an error. You can avoid this problem by ensuring that your type has a " +"larger value for :c:member:`~PyTypeObject.tp_basicsize` than its base type " "does. Most of the time, this will be true anyway, because either your base " "type will be :class:`object`, or else you will be adding data members to " "your base type, and therefore increasing its size." msgstr "" +"あなたのタイプを Python でサブクラス化可能にしたい場合、そのタイプが基底タイ" +"プと同じ :c:member:`~PyTypeObject.tp_basicsize` をもっていると多重継承のとき" +"に問題が生じることがあります。そのタイプを Python のサブクラスにしたとき、そ" +"の :attr:`~class.__bases__` リストにはあなたのタイプが最初にくるようにしなけ" +"ればなりません。さもないとエラーの発生なしにあなたのタイプの :meth:`__new__` " +"メソッドを呼び出すことはできなくなります。この問題を回避するには、つねにあな" +"たのタイプの :c:member:`~PyTypeObject.tp_basicsize` をその基底タイプよりも大" +"きくしておくことです。ほとんどの場合、あなたのタイプは :class:`object` か、そ" +"うでなければ基底タイプにデータ用のメンバを追加したものでしょうから、したがっ" +"て大きさはつねに増加するためこの条件は満たされています。" -#: ../../extending/newtypes_tutorial.rst:156 -msgid "We set the class flags to :c:macro:`Py_TPFLAGS_DEFAULT`. ::" -msgstr ":c:macro:`Py_TPFLAGS_DEFAULT` にクラスフラグを設定します。 ::" +#: ../../extending/newtypes_tutorial.rst:153 +msgid "We set the class flags to :const:`Py_TPFLAGS_DEFAULT`. ::" +msgstr ":const:`Py_TPFLAGS_DEFAULT` にクラスフラグを設定します。 ::" -#: ../../extending/newtypes_tutorial.rst:158 -msgid ".tp_flags = Py_TPFLAGS_DEFAULT," -msgstr "" - -#: ../../extending/newtypes_tutorial.rst:160 +#: ../../extending/newtypes_tutorial.rst:157 msgid "" "All types should include this constant in their flags. It enables all of " "the members defined until at least Python 3.3. If you need further members, " @@ -384,132 +290,80 @@ msgstr "" "Python 3.3 までに定義されているすべてのメンバを許可します。それ以上のメンバが" "必要なら、対応するフラグの OR をとる必要があります。" -#: ../../extending/newtypes_tutorial.rst:164 +#: ../../extending/newtypes_tutorial.rst:161 msgid "" "We provide a doc string for the type in :c:member:`~PyTypeObject.tp_doc`. ::" msgstr "この型の docstring は :c:member:`~PyTypeObject.tp_doc` に入れます。 ::" -#: ../../extending/newtypes_tutorial.rst:166 -msgid ".tp_doc = PyDoc_STR(\"Custom objects\")," -msgstr "" - -#: ../../extending/newtypes_tutorial.rst:168 +#: ../../extending/newtypes_tutorial.rst:165 msgid "" "To enable object creation, we have to provide a :c:member:`~PyTypeObject." -"tp_new` handler. This is the equivalent of the Python method :meth:`~object." -"__new__`, but has to be specified explicitly. In this case, we can just use " -"the default implementation provided by the API function :c:func:" +"tp_new` handler. This is the equivalent of the Python method :meth:" +"`__new__`, but has to be specified explicitly. In this case, we can just " +"use the default implementation provided by the API function :c:func:" "`PyType_GenericNew`. ::" msgstr "" "オブジェクトが生成できるように、 :c:member:`~PyTypeObject.tp_new` ハンドラを" -"提供する必要があります。これは Python のメソッド :meth:`~object.__new__` と同" -"等のものですが、明示的に与える必要があります。今の場合では、 API 関数の :c:" -"func:`PyType_GenericNew` として提供されるデフォルトの実装をそのまま使えま" -"す。 ::" - -#: ../../extending/newtypes_tutorial.rst:173 -msgid ".tp_new = PyType_GenericNew," -msgstr "" +"提供する必要があります。\n" +"これは Python のメソッド :meth:`__new__` と同等のものですが、明示的に与える必" +"要があります。\n" +"今の場合では、 API 関数の :c:func:`PyType_GenericNew` として提供されるデフォ" +"ルトをそのまま使えます。 ::" -#: ../../extending/newtypes_tutorial.rst:175 +#: ../../extending/newtypes_tutorial.rst:172 msgid "" "Everything else in the file should be familiar, except for some code in :c:" -"func:`!custom_module_exec`::" +"func:`PyInit_custom`::" msgstr "" +"ファイルの残りの部分はきっと馴染みやすいものだと思いますが、 :c:func:" +"`PyInit_custom` の一部のコードはそうではないでしょう::" #: ../../extending/newtypes_tutorial.rst:178 msgid "" -"if (PyType_Ready(&CustomType) < 0) {\n" -" return -1;\n" -"}" -msgstr "" - -#: ../../extending/newtypes_tutorial.rst:182 -msgid "" -"This initializes the :class:`!Custom` type, filling in a number of members " -"to the appropriate default values, including :c:member:`~PyObject.ob_type` " -"that we initially set to ``NULL``. ::" -msgstr "" -"これは、 ``NULL`` に初期化された :c:member:`~PyObject.ob_type` も含めて、いく" -"つかのメンバーを適切なデフォルト値で埋めて、 :class:`!Custom` 型を初期化しま" -"す。 ::" - -#: ../../extending/newtypes_tutorial.rst:186 -msgid "" -"if (PyModule_AddObjectRef(m, \"Custom\", (PyObject *) &CustomType) < 0) {\n" -" return -1;\n" -"}" +"This initializes the :class:`Custom` type, filling in a number of members to " +"the appropriate default values, including :attr:`ob_type` that we initially " +"set to ``NULL``. ::" msgstr "" +"これは、 ``NULL`` に初期化された :attr:`ob_type` も含めて、いくつかのメンバー" +"を適切なデフォルト値で埋めて、 :class:`Custom` 型を初期化します。 ::" -#: ../../extending/newtypes_tutorial.rst:190 +#: ../../extending/newtypes_tutorial.rst:189 msgid "" "This adds the type to the module dictionary. This allows us to create :" -"class:`!Custom` instances by calling the :class:`!Custom` class:" +"class:`Custom` instances by calling the :class:`Custom` class:" msgstr "" -"これは型をモジュールの辞書に追加します。こうすることで :class:`!Custom` クラ" -"スの呼び出しで :class:`!Custom` インスタンスが作成できるようになります:" +"これは型をモジュールの辞書に追加します。\n" +"こうすることで :class:`Custom` クラスの呼び出しで :class:`Custom` インスタン" +"スが作成できるようになります:" -#: ../../extending/newtypes_tutorial.rst:193 -msgid "" -">>> import custom\n" -">>> mycustom = custom.Custom()" -msgstr "" - -#: ../../extending/newtypes_tutorial.rst:198 +#: ../../extending/newtypes_tutorial.rst:197 msgid "" "That's it! All that remains is to build it; put the above code in a file " -"called :file:`custom.c`," +"called :file:`custom.c` and:" msgstr "" -"以上です!残りの作業はビルドだけです; :file:`custom.c` という名前のファイルに" -"ここまでのコードを書き込み、" - -#: ../../extending/newtypes_tutorial.rst:201 -msgid "" -"[build-system]\n" -"requires = [\"setuptools\"]\n" -"build-backend = \"setuptools.build_meta\"\n" -"\n" -"[project]\n" -"name = \"custom\"\n" -"version = \"1\"\n" -msgstr "" - -#: ../../extending/newtypes_tutorial.rst:203 -msgid "in a file called :file:`pyproject.toml`, and" -msgstr ":file:`pyproject.toml` というファイルにこれを書き込み、" +"以上です!\n" +"残りの作業はビルドだけです; :file:`custom.c` という名前のファイルにここまでの" +"コードを書き込み、次の内容を持つ setup.py を用意します:" -#: ../../extending/newtypes_tutorial.rst:205 -msgid "" -"from setuptools import Extension, setup\n" -"setup(ext_modules=[Extension(\"custom\", [\"custom.c\"])])" -msgstr "" - -#: ../../extending/newtypes_tutorial.rst:210 +#: ../../extending/newtypes_tutorial.rst:206 msgid "in a file called :file:`setup.py`; then typing" -msgstr "" -"そして :file:`setup.py` というファイルにこのように書き込み、そして、以下のよ" -"うに" +msgstr "そして、シェルから以下のように入力します" #: ../../extending/newtypes_tutorial.rst:212 -#: ../../extending/newtypes_tutorial.rst:550 -msgid "$ python -m pip install ." -msgstr "" - -#: ../../extending/newtypes_tutorial.rst:216 msgid "" -"in a shell should produce a file :file:`custom.so` in a subdirectory and " -"install it; now fire up Python --- you should be able to ``import custom`` " -"and play around with ``Custom`` objects." +"at a shell should produce a file :file:`custom.so` in a subdirectory; move " +"to that directory and fire up Python --- you should be able to ``import " +"custom`` and play around with Custom objects." msgstr "" -"シェルに入力します。これにより、サブディレクトリに :file:`custom.so` が生成さ" -"れ、インストールされます。これで、 Python を立ち上げて、 ``import custom`` す" -"ると ``Custom`` オブジェクトで遊べるようになっているはずです。" +"すると :file:`custom.so` ファイルがサブディレクトリに生成されます。そのディレ" +"クトリに移動して、Pythonを起動します -- これで ``import custom`` して、" +"Custom オブジェクトで遊べるようになっているはずです。" -#: ../../extending/newtypes_tutorial.rst:220 +#: ../../extending/newtypes_tutorial.rst:216 msgid "That wasn't so hard, was it?" msgstr "そんなにむずかしくありません、よね?" -#: ../../extending/newtypes_tutorial.rst:222 +#: ../../extending/newtypes_tutorial.rst:218 msgid "" "Of course, the current Custom type is pretty uninteresting. It has no data " "and doesn't do anything. It can't even be subclassed." @@ -517,198 +371,67 @@ msgstr "" "もちろん、現在の Custom 型は面白みに欠けています。何もデータを持っていない" "し、何もできません。継承してサブクラスを作ることさえできないのです。" -#: ../../extending/newtypes_tutorial.rst:227 +#: ../../extending/newtypes_tutorial.rst:222 +msgid "" +"While this documentation showcases the standard :mod:`distutils` module for " +"building C extensions, it is recommended in real-world use cases to use the " +"newer and better-maintained ``setuptools`` library. Documentation on how to " +"do this is out of scope for this document and can be found in the `Python " +"Packaging User's Guide `_." +msgstr "" +"この文書では、標準の :mod:`distutils` モジュールを使って C 拡張をビルドしてい" +"ますが、現実のユースケースでは、より新しく、保守されている ``setuptools`` ラ" +"イブラリを利用することを推奨します。これを行う方法を文書化することはこのド" +"キュメントの範囲外ですので、 `Python Packaging User's Guide `_ を参照してください。" + +#: ../../extending/newtypes_tutorial.rst:230 msgid "Adding data and methods to the Basic example" msgstr "基本のサンプルにデータとメソッドを追加する" -#: ../../extending/newtypes_tutorial.rst:229 +#: ../../extending/newtypes_tutorial.rst:232 msgid "" "Let's extend the basic example to add some data and methods. Let's also " -"make the type usable as a base class. We'll create a new module, :mod:`!" -"custom2` that adds these capabilities:" +"make the type usable as a base class. We'll create a new module, :mod:" +"`custom2` that adds these capabilities:" msgstr "" "この基本のサンプルにデータとメソッドを追加してみましょう。ついでに、この型を" -"基底クラスとしても利用できるようにします。ここでは新しいモジュール :mod:`!" -"custom2` をつくり、これらの機能を追加します:" - -#: ../../extending/newtypes_tutorial.rst:233 -msgid "" -"#define PY_SSIZE_T_CLEAN\n" -"#include \n" -"#include /* for offsetof() */\n" -"\n" -"typedef struct {\n" -" PyObject_HEAD\n" -" PyObject *first; /* first name */\n" -" PyObject *last; /* last name */\n" -" int number;\n" -"} CustomObject;\n" -"\n" -"static void\n" -"Custom_dealloc(PyObject *op)\n" -"{\n" -" CustomObject *self = (CustomObject *) op;\n" -" Py_XDECREF(self->first);\n" -" Py_XDECREF(self->last);\n" -" Py_TYPE(self)->tp_free(self);\n" -"}\n" -"\n" -"static PyObject *\n" -"Custom_new(PyTypeObject *type, PyObject *args, PyObject *kwds)\n" -"{\n" -" CustomObject *self;\n" -" self = (CustomObject *) type->tp_alloc(type, 0);\n" -" if (self != NULL) {\n" -" self->first = Py_GetConstant(Py_CONSTANT_EMPTY_STR);\n" -" if (self->first == NULL) {\n" -" Py_DECREF(self);\n" -" return NULL;\n" -" }\n" -" self->last = Py_GetConstant(Py_CONSTANT_EMPTY_STR);\n" -" if (self->last == NULL) {\n" -" Py_DECREF(self);\n" -" return NULL;\n" -" }\n" -" self->number = 0;\n" -" }\n" -" return (PyObject *) self;\n" -"}\n" -"\n" -"static int\n" -"Custom_init(PyObject *op, PyObject *args, PyObject *kwds)\n" -"{\n" -" CustomObject *self = (CustomObject *) op;\n" -" static char *kwlist[] = {\"first\", \"last\", \"number\", NULL};\n" -" PyObject *first = NULL, *last = NULL;\n" -"\n" -" if (!PyArg_ParseTupleAndKeywords(args, kwds, \"|OOi\", kwlist,\n" -" &first, &last,\n" -" &self->number))\n" -" return -1;\n" -"\n" -" if (first) {\n" -" Py_XSETREF(self->first, Py_NewRef(first));\n" -" }\n" -" if (last) {\n" -" Py_XSETREF(self->last, Py_NewRef(last));\n" -" }\n" -" return 0;\n" -"}\n" -"\n" -"static PyMemberDef Custom_members[] = {\n" -" {\"first\", Py_T_OBJECT_EX, offsetof(CustomObject, first), 0,\n" -" \"first name\"},\n" -" {\"last\", Py_T_OBJECT_EX, offsetof(CustomObject, last), 0,\n" -" \"last name\"},\n" -" {\"number\", Py_T_INT, offsetof(CustomObject, number), 0,\n" -" \"custom number\"},\n" -" {NULL} /* Sentinel */\n" -"};\n" -"\n" -"static PyObject *\n" -"Custom_name(PyObject *op, PyObject *Py_UNUSED(dummy))\n" -"{\n" -" CustomObject *self = (CustomObject *) op;\n" -" if (self->first == NULL) {\n" -" PyErr_SetString(PyExc_AttributeError, \"first\");\n" -" return NULL;\n" -" }\n" -" if (self->last == NULL) {\n" -" PyErr_SetString(PyExc_AttributeError, \"last\");\n" -" return NULL;\n" -" }\n" -" return PyUnicode_FromFormat(\"%S %S\", self->first, self->last);\n" -"}\n" -"\n" -"static PyMethodDef Custom_methods[] = {\n" -" {\"name\", Custom_name, METH_NOARGS,\n" -" \"Return the name, combining the first and last name\"\n" -" },\n" -" {NULL} /* Sentinel */\n" -"};\n" -"\n" -"static PyTypeObject CustomType = {\n" -" .ob_base = PyVarObject_HEAD_INIT(NULL, 0)\n" -" .tp_name = \"custom2.Custom\",\n" -" .tp_doc = PyDoc_STR(\"Custom objects\"),\n" -" .tp_basicsize = sizeof(CustomObject),\n" -" .tp_itemsize = 0,\n" -" .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,\n" -" .tp_new = Custom_new,\n" -" .tp_init = Custom_init,\n" -" .tp_dealloc = Custom_dealloc,\n" -" .tp_members = Custom_members,\n" -" .tp_methods = Custom_methods,\n" -"};\n" -"\n" -"static int\n" -"custom_module_exec(PyObject *m)\n" -"{\n" -" if (PyType_Ready(&CustomType) < 0) {\n" -" return -1;\n" -" }\n" -"\n" -" if (PyModule_AddObjectRef(m, \"Custom\", (PyObject *) &CustomType) < 0) " -"{\n" -" return -1;\n" -" }\n" -"\n" -" return 0;\n" -"}\n" -"\n" -"static PyModuleDef_Slot custom_module_slots[] = {\n" -" {Py_mod_exec, custom_module_exec},\n" -" {Py_mod_multiple_interpreters, " -"Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED},\n" -" {0, NULL}\n" -"};\n" -"\n" -"static PyModuleDef custom_module = {\n" -" .m_base = PyModuleDef_HEAD_INIT,\n" -" .m_name = \"custom2\",\n" -" .m_doc = \"Example module that creates an extension type.\",\n" -" .m_size = 0,\n" -" .m_slots = custom_module_slots,\n" -"};\n" -"\n" -"PyMODINIT_FUNC\n" -"PyInit_custom2(void)\n" -"{\n" -" return PyModuleDef_Init(&custom_module);\n" -"}\n" -msgstr "" - -#: ../../extending/newtypes_tutorial.rst:236 +"基底クラスとしても利用できるようにします。ここでは新しいモジュール :mod:" +"`custom2` をつくり、これらの機能を追加します:" + +#: ../../extending/newtypes_tutorial.rst:239 msgid "This version of the module has a number of changes." -msgstr "モジュールのこのバージョンでは、いくつもの変更をおこないます。" +msgstr "このバージョンでは、いくつもの変更をおこないます。" -#: ../../extending/newtypes_tutorial.rst:238 +#: ../../extending/newtypes_tutorial.rst:241 +msgid "We've added an extra include::" +msgstr "以下の include を追加します::" + +#: ../../extending/newtypes_tutorial.rst:245 msgid "" -"The :class:`!Custom` type now has three data attributes in its C struct, " +"This include provides declarations that we use to handle attributes, as " +"described a bit later." +msgstr "" +"すこしあとでふれますが、この include には属性を扱うための宣言が入っています。" + +#: ../../extending/newtypes_tutorial.rst:248 +msgid "" +"The :class:`Custom` type now has three data attributes in its C struct, " "*first*, *last*, and *number*. The *first* and *last* variables are Python " "strings containing first and last names. The *number* attribute is a C " "integer." msgstr "" -":class:`!Custom` 型は そのC構造体に 3つのデータ属性 *first* 、 *last* 、およ" +":class:`Custom` 型は そのC構造体に 3つのデータ属性 *first* 、 *last* 、およ" "び *number* をもつようになりました。 *first* と *last* 属性はファーストネーム" "とラストネームを格納した Python 文字列で、 *number* 属性は C言語での整数の値" "です。" -#: ../../extending/newtypes_tutorial.rst:242 +#: ../../extending/newtypes_tutorial.rst:252 msgid "The object structure is updated accordingly::" msgstr "これにしたがうと、オブジェクトの構造体は次のようになります::" -#: ../../extending/newtypes_tutorial.rst:244 -msgid "" -"typedef struct {\n" -" PyObject_HEAD\n" -" PyObject *first; /* first name */\n" -" PyObject *last; /* last name */\n" -" int number;\n" -"} CustomObject;" -msgstr "" - -#: ../../extending/newtypes_tutorial.rst:251 +#: ../../extending/newtypes_tutorial.rst:261 msgid "" "Because we now have data to manage, we have to be more careful about object " "allocation and deallocation. At a minimum, we need a deallocation method::" @@ -716,81 +439,44 @@ msgstr "" "いまや管理すべきデータができたので、オブジェクトの割り当てと解放に際してはよ" "り慎重になる必要があります。最低限、オブジェクトの解放メソッドが必要です::" -#: ../../extending/newtypes_tutorial.rst:254 -msgid "" -"static void\n" -"Custom_dealloc(PyObject *op)\n" -"{\n" -" CustomObject *self = (CustomObject *) op;\n" -" Py_XDECREF(self->first);\n" -" Py_XDECREF(self->last);\n" -" Py_TYPE(self)->tp_free(self);\n" -"}" -msgstr "" - -#: ../../extending/newtypes_tutorial.rst:263 +#: ../../extending/newtypes_tutorial.rst:272 msgid "which is assigned to the :c:member:`~PyTypeObject.tp_dealloc` member::" msgstr "" "この関数は :c:member:`~PyTypeObject.tp_dealloc` メンバに代入されます。 ::" -#: ../../extending/newtypes_tutorial.rst:265 -msgid ".tp_dealloc = Custom_dealloc," -msgstr "" - -#: ../../extending/newtypes_tutorial.rst:267 +#: ../../extending/newtypes_tutorial.rst:276 msgid "" "This method first clears the reference counts of the two Python attributes. :" "c:func:`Py_XDECREF` correctly handles the case where its argument is " "``NULL`` (which might happen here if ``tp_new`` failed midway). It then " "calls the :c:member:`~PyTypeObject.tp_free` member of the object's type " "(computed by ``Py_TYPE(self)``) to free the object's memory. Note that the " -"object's type might not be :class:`!CustomType`, because the object may be " -"an instance of a subclass." +"object's type might not be :class:`CustomType`, because the object may be an " +"instance of a subclass." msgstr "" "このメソッドは、まず二つのPython 属性の参照カウントをクリアします。 :c:func:" -"`Py_XDECREF` は引数が ``NULL`` のケースを正しく扱えます (これは、``tp_new`` " -"が途中で失敗した場合に起こりえます) 。このメソッドは、つぎにオブジェクトの型 " -"(``Py_TYPE(self)`` で算出します) のメンバ :c:member:`~PyTypeObject.tp_free` " -"を呼び出し、オブジェクトのメモリを開放します。オブジェクトの型が :class:`!" -"CustomType` であるとは限らない点に注意してください。なぜなら、オブジェクトは" +"`Py_XDECREF` は引数が *NULL* のケースを正しく扱えます( これは、``tp_new`` が" +"途中で失敗した場合に起こりえます)。このメソッドは、つぎにオブジェクトの型 " +"(``Py_TYPE(self)`` で算出します)のメンバ :c:member:`~PyTypeObject.tp_free` を" +"呼び出し、オブジェクトのメモリを開放します。オブジェクトの型が :class:" +"`CustomType` であるとは限らない点に注意してください。なぜなら、オブジェクトは" "サブクラスのインスタンスかもしれないからです。" -#: ../../extending/newtypes_tutorial.rst:277 -msgid "" -"The explicit cast to ``CustomObject *`` above is needed because we defined " -"``Custom_dealloc`` to take a ``PyObject *`` argument, as the ``tp_dealloc`` " -"function pointer expects to receive a ``PyObject *`` argument. By assigning " -"to the the ``tp_dealloc`` slot of a type, we declare that it can only be " -"called with instances of our ``CustomObject`` class, so the cast to " -"``(CustomObject *)`` is safe. This is object-oriented polymorphism, in C!" -msgstr "" - #: ../../extending/newtypes_tutorial.rst:285 msgid "" -"In existing code, or in previous versions of this tutorial, you might see " -"similar functions take a pointer to the subtype object structure " -"(``CustomObject*``) directly, like this::" -msgstr "" - -#: ../../extending/newtypes_tutorial.rst:289 -msgid "" -"Custom_dealloc(CustomObject *self)\n" -"{\n" -" Py_XDECREF(self->first);\n" -" Py_XDECREF(self->last);\n" -" Py_TYPE(self)->tp_free((PyObject *) self);\n" -"}\n" -"...\n" -".tp_dealloc = (destructor) Custom_dealloc," -msgstr "" - -#: ../../extending/newtypes_tutorial.rst:298 -msgid "" -"This does the same thing on all architectures that CPython supports, but " -"according to the C standard, it invokes undefined behavior." +"The explicit cast to ``destructor`` above is needed because we defined " +"``Custom_dealloc`` to take a ``CustomObject *`` argument, but the " +"``tp_dealloc`` function pointer expects to receive a ``PyObject *`` " +"argument. Otherwise, the compiler will emit a warning. This is object-" +"oriented polymorphism, in C!" msgstr "" +"上の ``destructor`` への明示的な型変換は必要です。なぜなら、 " +"``Custom_dealloc`` が ``CustomObject *`` 引数をとると定義しましたが、 " +"``tp_dealloc`` 関数のポインタは ``PyObject *`` 引数を受け取ることになっている" +"からです。もし明示的に型変換をしなければ、コンパイラが警告を発するでしょう。" +"これは、Cにおけるオブジェクト指向のポリモーフィズムです!" -#: ../../extending/newtypes_tutorial.rst:302 +#: ../../extending/newtypes_tutorial.rst:291 msgid "" "We want to make sure that the first and last names are initialized to empty " "strings, so we provide a ``tp_new`` implementation::" @@ -798,52 +484,24 @@ msgstr "" "ファーストネームとラストネームを空文字列に初期化しておきたいので、``tp_new`` " "の実装を追加することにしましょう::" -#: ../../extending/newtypes_tutorial.rst:305 -msgid "" -"static PyObject *\n" -"Custom_new(PyTypeObject *type, PyObject *args, PyObject *kwds)\n" -"{\n" -" CustomObject *self;\n" -" self = (CustomObject *) type->tp_alloc(type, 0);\n" -" if (self != NULL) {\n" -" self->first = PyUnicode_FromString(\"\");\n" -" if (self->first == NULL) {\n" -" Py_DECREF(self);\n" -" return NULL;\n" -" }\n" -" self->last = PyUnicode_FromString(\"\");\n" -" if (self->last == NULL) {\n" -" Py_DECREF(self);\n" -" return NULL;\n" -" }\n" -" self->number = 0;\n" -" }\n" -" return (PyObject *) self;\n" -"}" -msgstr "" - -#: ../../extending/newtypes_tutorial.rst:326 +#: ../../extending/newtypes_tutorial.rst:315 msgid "and install it in the :c:member:`~PyTypeObject.tp_new` member::" msgstr "" "そしてこれを :c:member:`~PyTypeObject.tp_new` メンバとしてインストールしま" "す::" -#: ../../extending/newtypes_tutorial.rst:328 -msgid ".tp_new = Custom_new," -msgstr "" - -#: ../../extending/newtypes_tutorial.rst:330 +#: ../../extending/newtypes_tutorial.rst:319 msgid "" "The ``tp_new`` handler is responsible for creating (as opposed to " "initializing) objects of the type. It is exposed in Python as the :meth:" -"`~object.__new__` method. It is not required to define a ``tp_new`` member, " -"and indeed many extension types will simply reuse :c:func:" -"`PyType_GenericNew` as done in the first version of the :class:`!Custom` " -"type above. In this case, we use the ``tp_new`` handler to initialize the " -"``first`` and ``last`` attributes to non-``NULL`` default values." +"`__new__` method. It is not required to define a ``tp_new`` member, and " +"indeed many extension types will simply reuse :c:func:`PyType_GenericNew` as " +"done in the first version of the ``Custom`` type above. In this case, we " +"use the ``tp_new`` handler to initialize the ``first`` and ``last`` " +"attributes to non-``NULL`` default values." msgstr "" -#: ../../extending/newtypes_tutorial.rst:338 +#: ../../extending/newtypes_tutorial.rst:327 msgid "" "``tp_new`` is passed the type being instantiated (not necessarily " "``CustomType``, if a subclass is instantiated) and any arguments passed when " @@ -853,7 +511,7 @@ msgid "" "k.a. ``tp_init`` in C or ``__init__`` in Python) methods." msgstr "" -#: ../../extending/newtypes_tutorial.rst:346 +#: ../../extending/newtypes_tutorial.rst:335 msgid "" "``tp_new`` shouldn't call ``tp_init`` explicitly, as the interpreter will do " "it itself." @@ -861,7 +519,7 @@ msgstr "" "``tp_new`` は明示的に ``tp_init`` を呼び出してはいけません、これはインタープ" "リタが自分で行うためです。" -#: ../../extending/newtypes_tutorial.rst:349 +#: ../../extending/newtypes_tutorial.rst:338 msgid "" "The ``tp_new`` implementation calls the :c:member:`~PyTypeObject.tp_alloc` " "slot to allocate memory::" @@ -869,11 +527,7 @@ msgstr "" "この ``tp_new`` の実装は、:c:member:`~PyTypeObject.tp_alloc` スロットを呼び出" "してメモリを割り当てます::" -#: ../../extending/newtypes_tutorial.rst:352 -msgid "self = (CustomObject *) type->tp_alloc(type, 0);" -msgstr "" - -#: ../../extending/newtypes_tutorial.rst:354 +#: ../../extending/newtypes_tutorial.rst:343 msgid "" "Since memory allocation may fail, we must check the :c:member:`~PyTypeObject." "tp_alloc` result against ``NULL`` before proceeding." @@ -882,7 +536,7 @@ msgstr "" "`~PyTypeObject.tp_alloc` の結果が ``NULL`` でないかチェックしなければなりませ" "ん。" -#: ../../extending/newtypes_tutorial.rst:358 +#: ../../extending/newtypes_tutorial.rst:347 msgid "" "We didn't fill the :c:member:`~PyTypeObject.tp_alloc` slot ourselves. " "Rather :c:func:`PyType_Ready` fills it for us by inheriting it from our base " @@ -890,11 +544,11 @@ msgid "" "allocation strategy." msgstr "" -#: ../../extending/newtypes_tutorial.rst:364 +#: ../../extending/newtypes_tutorial.rst:353 msgid "" "If you are creating a co-operative :c:member:`~PyTypeObject.tp_new` (one " -"that calls a base type's :c:member:`~PyTypeObject.tp_new` or :meth:`~object." -"__new__`), you must *not* try to determine what method to call using method " +"that calls a base type's :c:member:`~PyTypeObject.tp_new` or :meth:" +"`__new__`), you must *not* try to determine what method to call using method " "resolution order at runtime. Always statically determine what type you are " "going to call, and call its :c:member:`~PyTypeObject.tp_new` directly, or " "via ``type->tp_base->tp_new``. If you do not do this, Python subclasses of " @@ -903,123 +557,79 @@ msgid "" "subclasses without getting a :exc:`TypeError`.)" msgstr "" "もし協力的な :c:member:`~PyTypeObject.tp_new` (基底タイプの :c:member:" -"`~PyTypeObject.tp_new` または :meth:`~object.__new__` を呼んでいるもの) を作" -"りたいのならば、実行時のメソッド解決順序をつかってどのメソッドを呼びだすかを" -"決定しようとしては *いけません* 。常に呼び出す型を静的に決めておき、直接そ" -"の :c:member:`~PyTypeObject.tp_new` を呼び出すか、あるいは ``type->tp_base-" +"`~PyTypeObject.tp_new` または :meth:`__new__` を呼んでいるもの) を作りたいの" +"ならば、実行時のメソッド解決順序をつかってどのメソッドを呼びだすかを決定しよ" +"うとしては *いけません* 。つねに呼び出す型を静的に決めておき、直接その :c:" +"member:`~PyTypeObject.tp_new` を呼び出すか、あるいは ``type->tp_base-" ">tp_new`` を経由してください。こうしないと、あなたが作成したタイプの Python " "サブクラスが他の Python で定義されたクラスも継承している場合にうまく動かない" "場合があります。 (とりわけ、そのようなサブクラスのインスタンスを :exc:" "`TypeError` を出さずに作ることが不可能になります。)" -#: ../../extending/newtypes_tutorial.rst:374 +#: ../../extending/newtypes_tutorial.rst:363 msgid "" "We also define an initialization function which accepts arguments to provide " "initial values for our instance::" msgstr "" -#: ../../extending/newtypes_tutorial.rst:377 -msgid "" -"static int\n" -"Custom_init(PyObject *op, PyObject *args, PyObject *kwds)\n" -"{\n" -" CustomObject *self = (CustomObject *) op;\n" -" static char *kwlist[] = {\"first\", \"last\", \"number\", NULL};\n" -" PyObject *first = NULL, *last = NULL, *tmp;\n" -"\n" -" if (!PyArg_ParseTupleAndKeywords(args, kwds, \"|OOi\", kwlist,\n" -" &first, &last,\n" -" &self->number))\n" -" return -1;\n" -"\n" -" if (first) {\n" -" tmp = self->first;\n" -" Py_INCREF(first);\n" -" self->first = first;\n" -" Py_XDECREF(tmp);\n" -" }\n" -" if (last) {\n" -" tmp = self->last;\n" -" Py_INCREF(last);\n" -" self->last = last;\n" -" Py_XDECREF(tmp);\n" -" }\n" -" return 0;\n" -"}" -msgstr "" - -#: ../../extending/newtypes_tutorial.rst:404 +#: ../../extending/newtypes_tutorial.rst:392 msgid "by filling the :c:member:`~PyTypeObject.tp_init` slot. ::" msgstr "これは :c:member:`~PyTypeObject.tp_init` メンバに代入されます。 ::" -#: ../../extending/newtypes_tutorial.rst:406 -msgid ".tp_init = Custom_init," -msgstr "" - -#: ../../extending/newtypes_tutorial.rst:408 +#: ../../extending/newtypes_tutorial.rst:396 msgid "" "The :c:member:`~PyTypeObject.tp_init` slot is exposed in Python as the :meth:" -"`~object.__init__` method. It is used to initialize an object after it's " -"created. Initializers always accept positional and keyword arguments, and " -"they should return either ``0`` on success or ``-1`` on error." +"`__init__` method. It is used to initialize an object after it's created. " +"Initializers always accept positional and keyword arguments, and they should " +"return either ``0`` on success or ``-1`` on error." msgstr "" -#: ../../extending/newtypes_tutorial.rst:413 +#: ../../extending/newtypes_tutorial.rst:401 msgid "" "Unlike the ``tp_new`` handler, there is no guarantee that ``tp_init`` is " "called at all (for example, the :mod:`pickle` module by default doesn't " -"call :meth:`~object.__init__` on unpickled instances). It can also be " -"called multiple times. Anyone can call the :meth:`!__init__` method on our " +"call :meth:`__init__` on unpickled instances). It can also be called " +"multiple times. Anyone can call the :meth:`__init__` method on our " "objects. For this reason, we have to be extra careful when assigning the " "new attribute values. We might be tempted, for example to assign the " "``first`` member like this::" msgstr "" -#: ../../extending/newtypes_tutorial.rst:421 -msgid "" -"if (first) {\n" -" Py_XDECREF(self->first);\n" -" Py_INCREF(first);\n" -" self->first = first;\n" -"}" -msgstr "" - -#: ../../extending/newtypes_tutorial.rst:427 +#: ../../extending/newtypes_tutorial.rst:415 msgid "" "But this would be risky. Our type doesn't restrict the type of the " "``first`` member, so it could be any kind of object. It could have a " "destructor that causes code to be executed that tries to access the " -"``first`` member; or that destructor could detach the :term:`thread state " -"` and let arbitrary code run in other threads that " +"``first`` member; or that destructor could release the :term:`Global " +"interpreter Lock ` and let arbitrary code run in other threads that " "accesses and modifies our object." msgstr "" -#: ../../extending/newtypes_tutorial.rst:434 +#: ../../extending/newtypes_tutorial.rst:422 msgid "" "To be paranoid and protect ourselves against this possibility, we almost " "always reassign members before decrementing their reference counts. When " "don't we have to do this?" msgstr "" -#: ../../extending/newtypes_tutorial.rst:438 +#: ../../extending/newtypes_tutorial.rst:426 msgid "when we absolutely know that the reference count is greater than 1;" msgstr "その参照カウントが 1 より大きいと確信できる場合" -#: ../../extending/newtypes_tutorial.rst:440 +#: ../../extending/newtypes_tutorial.rst:428 msgid "" -"when we know that deallocation of the object [#]_ will neither detach the :" -"term:`thread state ` nor cause any calls back into " -"our type's code;" +"when we know that deallocation of the object [#]_ will neither release the :" +"term:`GIL` nor cause any calls back into our type's code;" msgstr "" -#: ../../extending/newtypes_tutorial.rst:443 +#: ../../extending/newtypes_tutorial.rst:431 msgid "" "when decrementing a reference count in a :c:member:`~PyTypeObject." "tp_dealloc` handler on a type which doesn't support cyclic garbage " "collection [#]_." msgstr "" -#: ../../extending/newtypes_tutorial.rst:446 +#: ../../extending/newtypes_tutorial.rst:434 msgid "" "We want to expose our instance variables as attributes. There are a number " "of ways to do that. The simplest way is to define member definitions::" @@ -1027,38 +637,21 @@ msgstr "" "ここではインスタンス変数を属性として見えるようにしたいのですが、これにはいく" "つもの方法があります。もっとも簡単な方法は、メンバの定義を与えることです::" -#: ../../extending/newtypes_tutorial.rst:449 -msgid "" -"static PyMemberDef Custom_members[] = {\n" -" {\"first\", Py_T_OBJECT_EX, offsetof(CustomObject, first), 0,\n" -" \"first name\"},\n" -" {\"last\", Py_T_OBJECT_EX, offsetof(CustomObject, last), 0,\n" -" \"last name\"},\n" -" {\"number\", Py_T_INT, offsetof(CustomObject, number), 0,\n" -" \"custom number\"},\n" -" {NULL} /* Sentinel */\n" -"};" -msgstr "" - -#: ../../extending/newtypes_tutorial.rst:459 +#: ../../extending/newtypes_tutorial.rst:447 msgid "" "and put the definitions in the :c:member:`~PyTypeObject.tp_members` slot::" msgstr "" "そして、この定義を :c:member:`~PyTypeObject.tp_members` スロットに入れましょ" "う::" -#: ../../extending/newtypes_tutorial.rst:461 -msgid ".tp_members = Custom_members," -msgstr "" - -#: ../../extending/newtypes_tutorial.rst:463 +#: ../../extending/newtypes_tutorial.rst:451 msgid "" "Each member definition has a member name, type, offset, access flags and " "documentation string. See the :ref:`Generic-Attribute-Management` section " "below for details." msgstr "" -#: ../../extending/newtypes_tutorial.rst:467 +#: ../../extending/newtypes_tutorial.rst:455 msgid "" "A disadvantage of this approach is that it doesn't provide a way to restrict " "the types of objects that can be assigned to the Python attributes. We " @@ -1069,56 +662,41 @@ msgid "" "deleted." msgstr "" -#: ../../extending/newtypes_tutorial.rst:474 +#: ../../extending/newtypes_tutorial.rst:462 msgid "" -"We define a single method, :meth:`!Custom.name`, that outputs the objects " +"We define a single method, :meth:`Custom.name()`, that outputs the objects " "name as the concatenation of the first and last names. ::" msgstr "" +"ここでは :meth:`Custom.name()` と呼ばれるメソッドを定義しましょう。これは" +"ファーストネーム first とラストネーム last を連結した文字列をそのオブジェクト" +"の名前として返します。 ::" -#: ../../extending/newtypes_tutorial.rst:477 -msgid "" -"static PyObject *\n" -"Custom_name(PyObject *op, PyObject *Py_UNUSED(dummy))\n" -"{\n" -" CustomObject *self = (CustomObject *) op;\n" -" if (self->first == NULL) {\n" -" PyErr_SetString(PyExc_AttributeError, \"first\");\n" -" return NULL;\n" -" }\n" -" if (self->last == NULL) {\n" -" PyErr_SetString(PyExc_AttributeError, \"last\");\n" -" return NULL;\n" -" }\n" -" return PyUnicode_FromFormat(\"%S %S\", self->first, self->last);\n" -"}" -msgstr "" - -#: ../../extending/newtypes_tutorial.rst:492 +#: ../../extending/newtypes_tutorial.rst:479 msgid "" -"The method is implemented as a C function that takes a :class:`!Custom` (or :" -"class:`!Custom` subclass) instance as the first argument. Methods always " +"The method is implemented as a C function that takes a :class:`Custom` (or :" +"class:`Custom` subclass) instance as the first argument. Methods always " "take an instance as the first argument. Methods often take positional and " "keyword arguments as well, but in this case we don't take any and don't need " "to accept a positional argument tuple or keyword argument dictionary. This " "method is equivalent to the Python method:" msgstr "" +"このメソッドは C 関数として実装され、 :class:`Custom` (あるいは :class:" +"`Custom` のサブクラス) のインスタンスを第一引数として受けとります。メソッドは" +"つねにそのインスタンスを最初の引数として受けとらなければなりません。しばしば" +"位置引数とキーワード引数も受けとりますが、今回はなにも必要ないので、固定引数" +"のタプルもキーワード引数の辞書も取らないことにします。このメソッドは Python " +"の以下のメソッドと等価です:" -#: ../../extending/newtypes_tutorial.rst:499 +#: ../../extending/newtypes_tutorial.rst:491 msgid "" -"def name(self):\n" -" return \"%s %s\" % (self.first, self.last)" -msgstr "" - -#: ../../extending/newtypes_tutorial.rst:504 -msgid "" -"Note that we have to check for the possibility that our :attr:`!first` and :" -"attr:`!last` members are ``NULL``. This is because they can be deleted, in " +"Note that we have to check for the possibility that our :attr:`first` and :" +"attr:`last` members are ``NULL``. This is because they can be deleted, in " "which case they are set to ``NULL``. It would be better to prevent deletion " "of these attributes and to restrict the attribute values to be strings. " "We'll see how to do that in the next section." msgstr "" -#: ../../extending/newtypes_tutorial.rst:510 +#: ../../extending/newtypes_tutorial.rst:497 msgid "" "Now that we've defined the method, we need to create an array of method " "definitions::" @@ -1126,316 +704,61 @@ msgstr "" "さて、メソッドを定義したので、ここでメソッド定義用の配列を作成する必要があり" "ます::" -#: ../../extending/newtypes_tutorial.rst:513 +#: ../../extending/newtypes_tutorial.rst:507 msgid "" -"static PyMethodDef Custom_methods[] = {\n" -" {\"name\", Custom_name, METH_NOARGS,\n" -" \"Return the name, combining the first and last name\"\n" -" },\n" -" {NULL} /* Sentinel */\n" -"};" +"(note that we used the :const:`METH_NOARGS` flag to indicate that the method " +"is expecting no arguments other than *self*)" msgstr "" -#: ../../extending/newtypes_tutorial.rst:520 -msgid "" -"(note that we used the :c:macro:`METH_NOARGS` flag to indicate that the " -"method is expecting no arguments other than *self*)" -msgstr "" - -#: ../../extending/newtypes_tutorial.rst:523 +#: ../../extending/newtypes_tutorial.rst:510 msgid "and assign it to the :c:member:`~PyTypeObject.tp_methods` slot::" msgstr "" -#: ../../extending/newtypes_tutorial.rst:525 -msgid ".tp_methods = Custom_methods," -msgstr "" - -#: ../../extending/newtypes_tutorial.rst:527 +#: ../../extending/newtypes_tutorial.rst:514 msgid "" "Finally, we'll make our type usable as a base class for subclassing. We've " "written our methods carefully so far so that they don't make any assumptions " "about the type of the object being created or used, so all we need to do is " -"to add the :c:macro:`Py_TPFLAGS_BASETYPE` to our class flag definition::" +"to add the :const:`Py_TPFLAGS_BASETYPE` to our class flag definition::" msgstr "" -#: ../../extending/newtypes_tutorial.rst:532 -msgid ".tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE," -msgstr "" - -#: ../../extending/newtypes_tutorial.rst:534 +#: ../../extending/newtypes_tutorial.rst:521 msgid "" -"We rename :c:func:`!PyInit_custom` to :c:func:`!PyInit_custom2`, update the " +"We rename :c:func:`PyInit_custom` to :c:func:`PyInit_custom2`, update the " "module name in the :c:type:`PyModuleDef` struct, and update the full class " "name in the :c:type:`PyTypeObject` struct." msgstr "" -#: ../../extending/newtypes_tutorial.rst:538 -msgid "Finally, we update our :file:`setup.py` file to include the new module," -msgstr "" - -#: ../../extending/newtypes_tutorial.rst:540 -msgid "" -"from setuptools import Extension, setup\n" -"setup(ext_modules=[\n" -" Extension(\"custom\", [\"custom.c\"]),\n" -" Extension(\"custom2\", [\"custom2.c\"]),\n" -"])" -msgstr "" - -#: ../../extending/newtypes_tutorial.rst:548 -msgid "and then we re-install so that we can ``import custom2``:" +#: ../../extending/newtypes_tutorial.rst:525 +msgid "Finally, we update our :file:`setup.py` file to build the new module:" msgstr "" -#: ../../extending/newtypes_tutorial.rst:555 +#: ../../extending/newtypes_tutorial.rst:538 msgid "Providing finer control over data attributes" msgstr "データ属性をこまかく制御する" -#: ../../extending/newtypes_tutorial.rst:557 +#: ../../extending/newtypes_tutorial.rst:540 msgid "" -"In this section, we'll provide finer control over how the :attr:`!first` " -"and :attr:`!last` attributes are set in the :class:`!Custom` example. In the " -"previous version of our module, the instance variables :attr:`!first` and :" -"attr:`!last` could be set to non-string values or even deleted. We want to " +"In this section, we'll provide finer control over how the :attr:`first` and :" +"attr:`last` attributes are set in the :class:`Custom` example. In the " +"previous version of our module, the instance variables :attr:`first` and :" +"attr:`last` could be set to non-string values or even deleted. We want to " "make sure that these attributes always contain strings." msgstr "" -#: ../../extending/newtypes_tutorial.rst:563 -msgid "" -"#define PY_SSIZE_T_CLEAN\n" -"#include \n" -"#include /* for offsetof() */\n" -"\n" -"typedef struct {\n" -" PyObject_HEAD\n" -" PyObject *first; /* first name */\n" -" PyObject *last; /* last name */\n" -" int number;\n" -"} CustomObject;\n" -"\n" -"static void\n" -"Custom_dealloc(PyObject *op)\n" -"{\n" -" CustomObject *self = (CustomObject *) op;\n" -" Py_XDECREF(self->first);\n" -" Py_XDECREF(self->last);\n" -" Py_TYPE(self)->tp_free(self);\n" -"}\n" -"\n" -"static PyObject *\n" -"Custom_new(PyTypeObject *type, PyObject *args, PyObject *kwds)\n" -"{\n" -" CustomObject *self;\n" -" self = (CustomObject *) type->tp_alloc(type, 0);\n" -" if (self != NULL) {\n" -" self->first = Py_GetConstant(Py_CONSTANT_EMPTY_STR);\n" -" if (self->first == NULL) {\n" -" Py_DECREF(self);\n" -" return NULL;\n" -" }\n" -" self->last = Py_GetConstant(Py_CONSTANT_EMPTY_STR);\n" -" if (self->last == NULL) {\n" -" Py_DECREF(self);\n" -" return NULL;\n" -" }\n" -" self->number = 0;\n" -" }\n" -" return (PyObject *) self;\n" -"}\n" -"\n" -"static int\n" -"Custom_init(PyObject *op, PyObject *args, PyObject *kwds)\n" -"{\n" -" CustomObject *self = (CustomObject *) op;\n" -" static char *kwlist[] = {\"first\", \"last\", \"number\", NULL};\n" -" PyObject *first = NULL, *last = NULL;\n" -"\n" -" if (!PyArg_ParseTupleAndKeywords(args, kwds, \"|UUi\", kwlist,\n" -" &first, &last,\n" -" &self->number))\n" -" return -1;\n" -"\n" -" if (first) {\n" -" Py_SETREF(self->first, Py_NewRef(first));\n" -" }\n" -" if (last) {\n" -" Py_SETREF(self->last, Py_NewRef(last));\n" -" }\n" -" return 0;\n" -"}\n" -"\n" -"static PyMemberDef Custom_members[] = {\n" -" {\"number\", Py_T_INT, offsetof(CustomObject, number), 0,\n" -" \"custom number\"},\n" -" {NULL} /* Sentinel */\n" -"};\n" -"\n" -"static PyObject *\n" -"Custom_getfirst(PyObject *op, void *closure)\n" -"{\n" -" CustomObject *self = (CustomObject *) op;\n" -" return Py_NewRef(self->first);\n" -"}\n" -"\n" -"static int\n" -"Custom_setfirst(PyObject *op, PyObject *value, void *closure)\n" -"{\n" -" CustomObject *self = (CustomObject *) op;\n" -" if (value == NULL) {\n" -" PyErr_SetString(PyExc_TypeError, \"Cannot delete the first " -"attribute\");\n" -" return -1;\n" -" }\n" -" if (!PyUnicode_Check(value)) {\n" -" PyErr_SetString(PyExc_TypeError,\n" -" \"The first attribute value must be a string\");\n" -" return -1;\n" -" }\n" -" Py_SETREF(self->first, Py_NewRef(value));\n" -" return 0;\n" -"}\n" -"\n" -"static PyObject *\n" -"Custom_getlast(PyObject *op, void *closure)\n" -"{\n" -" CustomObject *self = (CustomObject *) op;\n" -" return Py_NewRef(self->last);\n" -"}\n" -"\n" -"static int\n" -"Custom_setlast(PyObject *op, PyObject *value, void *closure)\n" -"{\n" -" CustomObject *self = (CustomObject *) op;\n" -" if (value == NULL) {\n" -" PyErr_SetString(PyExc_TypeError, \"Cannot delete the last " -"attribute\");\n" -" return -1;\n" -" }\n" -" if (!PyUnicode_Check(value)) {\n" -" PyErr_SetString(PyExc_TypeError,\n" -" \"The last attribute value must be a string\");\n" -" return -1;\n" -" }\n" -" Py_SETREF(self->last, Py_NewRef(value));\n" -" return 0;\n" -"}\n" -"\n" -"static PyGetSetDef Custom_getsetters[] = {\n" -" {\"first\", Custom_getfirst, Custom_setfirst,\n" -" \"first name\", NULL},\n" -" {\"last\", Custom_getlast, Custom_setlast,\n" -" \"last name\", NULL},\n" -" {NULL} /* Sentinel */\n" -"};\n" -"\n" -"static PyObject *\n" -"Custom_name(PyObject *op, PyObject *Py_UNUSED(dummy))\n" -"{\n" -" CustomObject *self = (CustomObject *) op;\n" -" return PyUnicode_FromFormat(\"%S %S\", self->first, self->last);\n" -"}\n" -"\n" -"static PyMethodDef Custom_methods[] = {\n" -" {\"name\", Custom_name, METH_NOARGS,\n" -" \"Return the name, combining the first and last name\"\n" -" },\n" -" {NULL} /* Sentinel */\n" -"};\n" -"\n" -"static PyTypeObject CustomType = {\n" -" .ob_base = PyVarObject_HEAD_INIT(NULL, 0)\n" -" .tp_name = \"custom3.Custom\",\n" -" .tp_doc = PyDoc_STR(\"Custom objects\"),\n" -" .tp_basicsize = sizeof(CustomObject),\n" -" .tp_itemsize = 0,\n" -" .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,\n" -" .tp_new = Custom_new,\n" -" .tp_init = Custom_init,\n" -" .tp_dealloc = Custom_dealloc,\n" -" .tp_members = Custom_members,\n" -" .tp_methods = Custom_methods,\n" -" .tp_getset = Custom_getsetters,\n" -"};\n" -"\n" -"static int\n" -"custom_module_exec(PyObject *m)\n" -"{\n" -" if (PyType_Ready(&CustomType) < 0) {\n" -" return -1;\n" -" }\n" -"\n" -" if (PyModule_AddObjectRef(m, \"Custom\", (PyObject *) &CustomType) < 0) " -"{\n" -" return -1;\n" -" }\n" -"\n" -" return 0;\n" -"}\n" -"\n" -"static PyModuleDef_Slot custom_module_slots[] = {\n" -" {Py_mod_exec, custom_module_exec},\n" -" {Py_mod_multiple_interpreters, " -"Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED},\n" -" {0, NULL}\n" -"};\n" -"\n" -"static PyModuleDef custom_module = {\n" -" .m_base = PyModuleDef_HEAD_INIT,\n" -" .m_name = \"custom3\",\n" -" .m_doc = \"Example module that creates an extension type.\",\n" -" .m_size = 0,\n" -" .m_slots = custom_module_slots,\n" -"};\n" -"\n" -"PyMODINIT_FUNC\n" -"PyInit_custom3(void)\n" -"{\n" -" return PyModuleDef_Init(&custom_module);\n" -"}\n" -msgstr "" - -#: ../../extending/newtypes_tutorial.rst:566 -msgid "" -"To provide greater control, over the :attr:`!first` and :attr:`!last` " +#: ../../extending/newtypes_tutorial.rst:549 +msgid "" +"To provide greater control, over the :attr:`first` and :attr:`last` " "attributes, we'll use custom getter and setter functions. Here are the " -"functions for getting and setting the :attr:`!first` attribute::" -msgstr "" - -#: ../../extending/newtypes_tutorial.rst:570 -msgid "" -"static PyObject *\n" -"Custom_getfirst(PyObject *op, void *closure)\n" -"{\n" -" CustomObject *self = (CustomObject *) op;\n" -" Py_INCREF(self->first);\n" -" return self->first;\n" -"}\n" -"\n" -"static int\n" -"Custom_setfirst(PyObject *op, PyObject *value, void *closure)\n" -"{\n" -" CustomObject *self = (CustomObject *) op;\n" -" PyObject *tmp;\n" -" if (value == NULL) {\n" -" PyErr_SetString(PyExc_TypeError, \"Cannot delete the first " -"attribute\");\n" -" return -1;\n" -" }\n" -" if (!PyUnicode_Check(value)) {\n" -" PyErr_SetString(PyExc_TypeError,\n" -" \"The first attribute value must be a string\");\n" -" return -1;\n" -" }\n" -" tmp = self->first;\n" -" Py_INCREF(value);\n" -" self->first = value;\n" -" Py_DECREF(tmp);\n" -" return 0;\n" -"}" -msgstr "" - -#: ../../extending/newtypes_tutorial.rst:599 -msgid "" -"The getter function is passed a :class:`!Custom` object and a \"closure\", " +"functions for getting and setting the :attr:`first` attribute::" +msgstr "" +":attr:`first` 属性と :attr:`last` 属性をよりこまかく制御するためには、カスタ" +"ムメイドの getter 関数と setter 関数を使います。以下は :attr:`first` 属性から" +"値を取得する関数 (getter) と、この属性に値を格納する関数 (setter) です::" + +#: ../../extending/newtypes_tutorial.rst:580 +msgid "" +"The getter function is passed a :class:`Custom` object and a \"closure\", " "which is a void pointer. In this case, the closure is ignored. (The " "closure supports an advanced usage in which definition data is passed to the " "getter and setter. This could, for example, be used to allow a single set of " @@ -1443,59 +766,35 @@ msgid "" "data in the closure.)" msgstr "" -#: ../../extending/newtypes_tutorial.rst:605 +#: ../../extending/newtypes_tutorial.rst:586 msgid "" -"The setter function is passed the :class:`!Custom` object, the new value, " -"and the closure. The new value may be ``NULL``, in which case the attribute " -"is being deleted. In our setter, we raise an error if the attribute is " -"deleted or if its new value is not a string." +"The setter function is passed the :class:`Custom` object, the new value, and " +"the closure. The new value may be ``NULL``, in which case the attribute is " +"being deleted. In our setter, we raise an error if the attribute is deleted " +"or if its new value is not a string." msgstr "" -#: ../../extending/newtypes_tutorial.rst:610 +#: ../../extending/newtypes_tutorial.rst:591 msgid "We create an array of :c:type:`PyGetSetDef` structures::" msgstr "ここでは :c:type:`PyGetSetDef` 構造体の配列をつくります::" -#: ../../extending/newtypes_tutorial.rst:612 -msgid "" -"static PyGetSetDef Custom_getsetters[] = {\n" -" {\"first\", Custom_getfirst, Custom_setfirst,\n" -" \"first name\", NULL},\n" -" {\"last\", Custom_getlast, Custom_setlast,\n" -" \"last name\", NULL},\n" -" {NULL} /* Sentinel */\n" -"};" -msgstr "" - -#: ../../extending/newtypes_tutorial.rst:620 +#: ../../extending/newtypes_tutorial.rst:601 msgid "and register it in the :c:member:`~PyTypeObject.tp_getset` slot::" msgstr "" "そしてこれを :c:member:`~PyTypeObject.tp_getset` スロットに登録します::" -#: ../../extending/newtypes_tutorial.rst:622 -msgid ".tp_getset = Custom_getsetters," -msgstr "" - -#: ../../extending/newtypes_tutorial.rst:624 +#: ../../extending/newtypes_tutorial.rst:605 msgid "" "The last item in a :c:type:`PyGetSetDef` structure is the \"closure\" " "mentioned above. In this case, we aren't using a closure, so we just pass " "``NULL``." msgstr "" -#: ../../extending/newtypes_tutorial.rst:627 +#: ../../extending/newtypes_tutorial.rst:608 msgid "We also remove the member definitions for these attributes::" msgstr "また、メンバ定義からはこれらの属性を除いておきましょう::" -#: ../../extending/newtypes_tutorial.rst:629 -msgid "" -"static PyMemberDef Custom_members[] = {\n" -" {\"number\", Py_T_INT, offsetof(CustomObject, number), 0,\n" -" \"custom number\"},\n" -" {NULL} /* Sentinel */\n" -"};" -msgstr "" - -#: ../../extending/newtypes_tutorial.rst:635 +#: ../../extending/newtypes_tutorial.rst:616 msgid "" "We also need to update the :c:member:`~PyTypeObject.tp_init` handler to only " "allow strings [#]_ to be passed::" @@ -1503,37 +802,7 @@ msgstr "" "また、ここでは :c:member:`~PyTypeObject.tp_init` ハンドラも渡されるものとして" "文字列のみを許可するように修正する必要があります [#]_::" -#: ../../extending/newtypes_tutorial.rst:638 -msgid "" -"static int\n" -"Custom_init(PyObject *op, PyObject *args, PyObject *kwds)\n" -"{\n" -" CustomObject *self = (CustomObject *) op;\n" -" static char *kwlist[] = {\"first\", \"last\", \"number\", NULL};\n" -" PyObject *first = NULL, *last = NULL, *tmp;\n" -"\n" -" if (!PyArg_ParseTupleAndKeywords(args, kwds, \"|UUi\", kwlist,\n" -" &first, &last,\n" -" &self->number))\n" -" return -1;\n" -"\n" -" if (first) {\n" -" tmp = self->first;\n" -" Py_INCREF(first);\n" -" self->first = first;\n" -" Py_DECREF(tmp);\n" -" }\n" -" if (last) {\n" -" tmp = self->last;\n" -" Py_INCREF(last);\n" -" self->last = last;\n" -" Py_DECREF(tmp);\n" -" }\n" -" return 0;\n" -"}" -msgstr "" - -#: ../../extending/newtypes_tutorial.rst:665 +#: ../../extending/newtypes_tutorial.rst:645 msgid "" "With these changes, we can assure that the ``first`` and ``last`` members " "are never ``NULL`` so we can remove checks for ``NULL`` values in almost all " @@ -1543,7 +812,7 @@ msgid "" "possibility that the initialization of these members failed in ``tp_new``." msgstr "" -#: ../../extending/newtypes_tutorial.rst:672 +#: ../../extending/newtypes_tutorial.rst:652 msgid "" "We also rename the module initialization function and module name in the " "initialization function, as we did before, and we add an extra definition to " @@ -1553,29 +822,22 @@ msgstr "" "ジュール名を変更しましょう。そして :file:`setup.py` ファイルに追加の定義をく" "わえます。" -#: ../../extending/newtypes_tutorial.rst:678 +#: ../../extending/newtypes_tutorial.rst:658 msgid "Supporting cyclic garbage collection" msgstr "循環ガベージコレクションをサポートする" -#: ../../extending/newtypes_tutorial.rst:680 +#: ../../extending/newtypes_tutorial.rst:660 msgid "" "Python has a :term:`cyclic garbage collector (GC) ` that " "can identify unneeded objects even when their reference counts are not zero. " "This can happen when objects are involved in cycles. For example, consider:" msgstr "" -"Python は :term:`循環ガベージコレクタ (GC) 機能 ` をもっ" -"ており、これは不要なオブジェクトを、たとえ参照カウントがゼロでなくても発見す" -"ることができます。そのような状況はオブジェクトの参照が循環しているときに起こ" -"りえます。たとえば以下の例を考えてください:" +"Python は:term:`循環ガベージコレクタ(GC)機能 `をもってお" +"り、これは不要なオブジェクトを、たとえ参照カウントがゼロでなくても発見するこ" +"とができます。そのような状況はオブジェクトの参照が循環しているときに起こりえ" +"ます。たとえば以下の例を考えてください:" -#: ../../extending/newtypes_tutorial.rst:684 -msgid "" -">>> l = []\n" -">>> l.append(l)\n" -">>> del l" -msgstr "" - -#: ../../extending/newtypes_tutorial.rst:690 +#: ../../extending/newtypes_tutorial.rst:670 msgid "" "In this example, we create a list that contains itself. When we delete it, " "it still has a reference from itself. Its reference count doesn't drop to " @@ -1587,326 +849,62 @@ msgstr "" "りません。嬉しいことに Python には循環ガベージコレクタは最終的にはこのリスト" "が不要であることを検出し、解放できます。" -#: ../../extending/newtypes_tutorial.rst:695 -msgid "" -"In the second version of the :class:`!Custom` example, we allowed any kind " -"of object to be stored in the :attr:`!first` or :attr:`!last` attributes " -"[#]_. Besides, in the second and third versions, we allowed subclassing :" -"class:`!Custom`, and subclasses may add arbitrary attributes. For any of " -"those two reasons, :class:`!Custom` objects can participate in cycles:" -msgstr "" - -#: ../../extending/newtypes_tutorial.rst:701 -msgid "" -">>> import custom3\n" -">>> class Derived(custom3.Custom): pass\n" -"...\n" -">>> n = Derived()\n" -">>> n.some_attribute = n" -msgstr "" - -#: ../../extending/newtypes_tutorial.rst:709 -msgid "" -"To allow a :class:`!Custom` instance participating in a reference cycle to " -"be properly detected and collected by the cyclic GC, our :class:`!Custom` " -"type needs to fill two additional slots and to enable a flag that enables " -"these slots:" -msgstr "" - -#: ../../extending/newtypes_tutorial.rst:713 -msgid "" -"#define PY_SSIZE_T_CLEAN\n" -"#include \n" -"#include /* for offsetof() */\n" -"\n" -"typedef struct {\n" -" PyObject_HEAD\n" -" PyObject *first; /* first name */\n" -" PyObject *last; /* last name */\n" -" int number;\n" -"} CustomObject;\n" -"\n" -"static int\n" -"Custom_traverse(PyObject *op, visitproc visit, void *arg)\n" -"{\n" -" CustomObject *self = (CustomObject *) op;\n" -" Py_VISIT(self->first);\n" -" Py_VISIT(self->last);\n" -" return 0;\n" -"}\n" -"\n" -"static int\n" -"Custom_clear(PyObject *op)\n" -"{\n" -" CustomObject *self = (CustomObject *) op;\n" -" Py_CLEAR(self->first);\n" -" Py_CLEAR(self->last);\n" -" return 0;\n" -"}\n" -"\n" -"static void\n" -"Custom_dealloc(PyObject *op)\n" -"{\n" -" PyObject_GC_UnTrack(op);\n" -" (void)Custom_clear(op);\n" -" Py_TYPE(op)->tp_free(op);\n" -"}\n" -"\n" -"static PyObject *\n" -"Custom_new(PyTypeObject *type, PyObject *args, PyObject *kwds)\n" -"{\n" -" CustomObject *self;\n" -" self = (CustomObject *) type->tp_alloc(type, 0);\n" -" if (self != NULL) {\n" -" self->first = Py_GetConstant(Py_CONSTANT_EMPTY_STR);\n" -" if (self->first == NULL) {\n" -" Py_DECREF(self);\n" -" return NULL;\n" -" }\n" -" self->last = Py_GetConstant(Py_CONSTANT_EMPTY_STR);\n" -" if (self->last == NULL) {\n" -" Py_DECREF(self);\n" -" return NULL;\n" -" }\n" -" self->number = 0;\n" -" }\n" -" return (PyObject *) self;\n" -"}\n" -"\n" -"static int\n" -"Custom_init(PyObject *op, PyObject *args, PyObject *kwds)\n" -"{\n" -" CustomObject *self = (CustomObject *) op;\n" -" static char *kwlist[] = {\"first\", \"last\", \"number\", NULL};\n" -" PyObject *first = NULL, *last = NULL;\n" -"\n" -" if (!PyArg_ParseTupleAndKeywords(args, kwds, \"|UUi\", kwlist,\n" -" &first, &last,\n" -" &self->number))\n" -" return -1;\n" -"\n" -" if (first) {\n" -" Py_SETREF(self->first, Py_NewRef(first));\n" -" }\n" -" if (last) {\n" -" Py_SETREF(self->last, Py_NewRef(last));\n" -" }\n" -" return 0;\n" -"}\n" -"\n" -"static PyMemberDef Custom_members[] = {\n" -" {\"number\", Py_T_INT, offsetof(CustomObject, number), 0,\n" -" \"custom number\"},\n" -" {NULL} /* Sentinel */\n" -"};\n" -"\n" -"static PyObject *\n" -"Custom_getfirst(PyObject *op, void *closure)\n" -"{\n" -" CustomObject *self = (CustomObject *) op;\n" -" return Py_NewRef(self->first);\n" -"}\n" -"\n" -"static int\n" -"Custom_setfirst(PyObject *op, PyObject *value, void *closure)\n" -"{\n" -" CustomObject *self = (CustomObject *) op;\n" -" if (value == NULL) {\n" -" PyErr_SetString(PyExc_TypeError, \"Cannot delete the first " -"attribute\");\n" -" return -1;\n" -" }\n" -" if (!PyUnicode_Check(value)) {\n" -" PyErr_SetString(PyExc_TypeError,\n" -" \"The first attribute value must be a string\");\n" -" return -1;\n" -" }\n" -" Py_XSETREF(self->first, Py_NewRef(value));\n" -" return 0;\n" -"}\n" -"\n" -"static PyObject *\n" -"Custom_getlast(PyObject *op, void *closure)\n" -"{\n" -" CustomObject *self = (CustomObject *) op;\n" -" return Py_NewRef(self->last);\n" -"}\n" -"\n" -"static int\n" -"Custom_setlast(PyObject *op, PyObject *value, void *closure)\n" -"{\n" -" CustomObject *self = (CustomObject *) op;\n" -" if (value == NULL) {\n" -" PyErr_SetString(PyExc_TypeError, \"Cannot delete the last " -"attribute\");\n" -" return -1;\n" -" }\n" -" if (!PyUnicode_Check(value)) {\n" -" PyErr_SetString(PyExc_TypeError,\n" -" \"The last attribute value must be a string\");\n" -" return -1;\n" -" }\n" -" Py_XSETREF(self->last, Py_NewRef(value));\n" -" return 0;\n" -"}\n" -"\n" -"static PyGetSetDef Custom_getsetters[] = {\n" -" {\"first\", Custom_getfirst, Custom_setfirst,\n" -" \"first name\", NULL},\n" -" {\"last\", Custom_getlast, Custom_setlast,\n" -" \"last name\", NULL},\n" -" {NULL} /* Sentinel */\n" -"};\n" -"\n" -"static PyObject *\n" -"Custom_name(PyObject *op, PyObject *Py_UNUSED(dummy))\n" -"{\n" -" CustomObject *self = (CustomObject *) op;\n" -" return PyUnicode_FromFormat(\"%S %S\", self->first, self->last);\n" -"}\n" -"\n" -"static PyMethodDef Custom_methods[] = {\n" -" {\"name\", Custom_name, METH_NOARGS,\n" -" \"Return the name, combining the first and last name\"\n" -" },\n" -" {NULL} /* Sentinel */\n" -"};\n" -"\n" -"static PyTypeObject CustomType = {\n" -" .ob_base = PyVarObject_HEAD_INIT(NULL, 0)\n" -" .tp_name = \"custom4.Custom\",\n" -" .tp_doc = PyDoc_STR(\"Custom objects\"),\n" -" .tp_basicsize = sizeof(CustomObject),\n" -" .tp_itemsize = 0,\n" -" .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | " -"Py_TPFLAGS_HAVE_GC,\n" -" .tp_new = Custom_new,\n" -" .tp_init = Custom_init,\n" -" .tp_dealloc = Custom_dealloc,\n" -" .tp_traverse = Custom_traverse,\n" -" .tp_clear = Custom_clear,\n" -" .tp_members = Custom_members,\n" -" .tp_methods = Custom_methods,\n" -" .tp_getset = Custom_getsetters,\n" -"};\n" -"\n" -"static int\n" -"custom_module_exec(PyObject *m)\n" -"{\n" -" if (PyType_Ready(&CustomType) < 0) {\n" -" return -1;\n" -" }\n" -"\n" -" if (PyModule_AddObjectRef(m, \"Custom\", (PyObject *) &CustomType) < 0) " -"{\n" -" return -1;\n" -" }\n" -"\n" -" return 0;\n" -"}\n" -"\n" -"static PyModuleDef_Slot custom_module_slots[] = {\n" -" {Py_mod_exec, custom_module_exec},\n" -" {Py_mod_multiple_interpreters, " -"Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED},\n" -" {0, NULL}\n" -"};\n" -"\n" -"static PyModuleDef custom_module = {\n" -" .m_base = PyModuleDef_HEAD_INIT,\n" -" .m_name = \"custom4\",\n" -" .m_doc = \"Example module that creates an extension type.\",\n" -" .m_size = 0,\n" -" .m_slots = custom_module_slots,\n" -"};\n" -"\n" -"PyMODINIT_FUNC\n" -"PyInit_custom4(void)\n" -"{\n" -" return PyModuleDef_Init(&custom_module);\n" -"}\n" +#: ../../extending/newtypes_tutorial.rst:675 +msgid "" +"In the second version of the :class:`Custom` example, we allowed any kind of " +"object to be stored in the :attr:`first` or :attr:`last` attributes [#]_. " +"Besides, in the second and third versions, we allowed subclassing :class:" +"`Custom`, and subclasses may add arbitrary attributes. For any of those two " +"reasons, :class:`Custom` objects can participate in cycles:" msgstr "" -#: ../../extending/newtypes_tutorial.rst:716 +#: ../../extending/newtypes_tutorial.rst:689 msgid "" -"First, the traversal method lets the cyclic GC know about subobjects that " -"could participate in cycles::" +"To allow a :class:`Custom` instance participating in a reference cycle to be " +"properly detected and collected by the cyclic GC, our :class:`Custom` type " +"needs to fill two additional slots and to enable a flag that enables these " +"slots:" msgstr "" -#: ../../extending/newtypes_tutorial.rst:719 +#: ../../extending/newtypes_tutorial.rst:696 msgid "" -"static int\n" -"Custom_traverse(PyObject *op, visitproc visit, void *arg)\n" -"{\n" -" CustomObject *self = (CustomObject *) op;\n" -" int vret;\n" -" if (self->first) {\n" -" vret = visit(self->first, arg);\n" -" if (vret != 0)\n" -" return vret;\n" -" }\n" -" if (self->last) {\n" -" vret = visit(self->last, arg);\n" -" if (vret != 0)\n" -" return vret;\n" -" }\n" -" return 0;\n" -"}" +"First, the traversal method lets the cyclic GC know about subobjects that " +"could participate in cycles::" msgstr "" -#: ../../extending/newtypes_tutorial.rst:737 +#: ../../extending/newtypes_tutorial.rst:716 msgid "" "For each subobject that can participate in cycles, we need to call the :c:" -"func:`!visit` function, which is passed to the traversal method. The :c:func:" -"`!visit` function takes as arguments the subobject and the extra argument " +"func:`visit` function, which is passed to the traversal method. The :c:func:" +"`visit` function takes as arguments the subobject and the extra argument " "*arg* passed to the traversal method. It returns an integer value that must " "be returned if it is non-zero." msgstr "" +"循環した参照に含まれるかもしれない各内部オブジェクトに対して、 traversal メ" +"ソッドに渡された :c:func:`visit` 関数を呼びます。 :c:func:`visit` 関数は内部" +"オブジェクトと、traversal メソッドに渡された追加の引数 *arg* を引数としてとり" +"ます。この関数はこの値が非負の場合に返される整数の値を返します。" -#: ../../extending/newtypes_tutorial.rst:743 +#: ../../extending/newtypes_tutorial.rst:722 msgid "" "Python provides a :c:func:`Py_VISIT` macro that automates calling visit " "functions. With :c:func:`Py_VISIT`, we can minimize the amount of " "boilerplate in ``Custom_traverse``::" msgstr "" -#: ../../extending/newtypes_tutorial.rst:747 -msgid "" -"static int\n" -"Custom_traverse(PyObject *op, visitproc visit, void *arg)\n" -"{\n" -" CustomObject *self = (CustomObject *) op;\n" -" Py_VISIT(self->first);\n" -" Py_VISIT(self->last);\n" -" return 0;\n" -"}" -msgstr "" - -#: ../../extending/newtypes_tutorial.rst:757 +#: ../../extending/newtypes_tutorial.rst:735 msgid "" "The :c:member:`~PyTypeObject.tp_traverse` implementation must name its " "arguments exactly *visit* and *arg* in order to use :c:func:`Py_VISIT`." msgstr "" -#: ../../extending/newtypes_tutorial.rst:760 +#: ../../extending/newtypes_tutorial.rst:738 msgid "" "Second, we need to provide a method for clearing any subobjects that can " "participate in cycles::" msgstr "" -#: ../../extending/newtypes_tutorial.rst:763 -msgid "" -"static int\n" -"Custom_clear(PyObject *op)\n" -"{\n" -" CustomObject *self = (CustomObject *) op;\n" -" Py_CLEAR(self->first);\n" -" Py_CLEAR(self->last);\n" -" return 0;\n" -"}" -msgstr "" - -#: ../../extending/newtypes_tutorial.rst:772 +#: ../../extending/newtypes_tutorial.rst:749 msgid "" "Notice the use of the :c:func:`Py_CLEAR` macro. It is the recommended and " "safe way to clear data attributes of arbitrary types while decrementing " @@ -1916,26 +914,18 @@ msgid "" "again (*especially* if there is a reference cycle)." msgstr "" -#: ../../extending/newtypes_tutorial.rst:780 +#: ../../extending/newtypes_tutorial.rst:757 msgid "You could emulate :c:func:`Py_CLEAR` by writing::" msgstr "" -#: ../../extending/newtypes_tutorial.rst:782 -msgid "" -"PyObject *tmp;\n" -"tmp = self->first;\n" -"self->first = NULL;\n" -"Py_XDECREF(tmp);" -msgstr "" - -#: ../../extending/newtypes_tutorial.rst:787 +#: ../../extending/newtypes_tutorial.rst:764 msgid "" "Nevertheless, it is much easier and less error-prone to always use :c:func:" "`Py_CLEAR` when deleting an attribute. Don't try to micro-optimize at the " "expense of robustness!" msgstr "" -#: ../../extending/newtypes_tutorial.rst:791 +#: ../../extending/newtypes_tutorial.rst:768 msgid "" "The deallocator ``Custom_dealloc`` may call arbitrary code when clearing " "attributes. It means the circular GC can be triggered inside the function. " @@ -1945,28 +935,13 @@ msgid "" "`PyObject_GC_UnTrack` and ``Custom_clear``::" msgstr "" -#: ../../extending/newtypes_tutorial.rst:798 +#: ../../extending/newtypes_tutorial.rst:783 msgid "" -"static void\n" -"Custom_dealloc(PyObject *op)\n" -"{\n" -" PyObject_GC_UnTrack(op);\n" -" (void)Custom_clear(op);\n" -" Py_TYPE(op)->tp_free(op);\n" -"}" +"Finally, we add the :const:`Py_TPFLAGS_HAVE_GC` flag to the class flags::" msgstr "" +"最後に、 :const:`Py_TPFLAGS_HAVE_GC` フラグをクラス定義のフラグに加えます::" -#: ../../extending/newtypes_tutorial.rst:806 -msgid "" -"Finally, we add the :c:macro:`Py_TPFLAGS_HAVE_GC` flag to the class flags::" -msgstr "" - -#: ../../extending/newtypes_tutorial.rst:808 -msgid "" -".tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC," -msgstr "" - -#: ../../extending/newtypes_tutorial.rst:810 +#: ../../extending/newtypes_tutorial.rst:787 msgid "" "That's pretty much it. If we had written custom :c:member:`~PyTypeObject." "tp_alloc` or :c:member:`~PyTypeObject.tp_free` handlers, we'd need to modify " @@ -1978,11 +953,11 @@ msgstr "" "ションに使えるよう修正すればよいのです。ほとんどの拡張機能は自動的に提供され" "るバージョンを使うでしょう。" -#: ../../extending/newtypes_tutorial.rst:816 +#: ../../extending/newtypes_tutorial.rst:793 msgid "Subclassing other types" msgstr "他の型のサブクラスを作る" -#: ../../extending/newtypes_tutorial.rst:818 +#: ../../extending/newtypes_tutorial.rst:795 msgid "" "It is possible to create new extension types that are derived from existing " "types. It is easiest to inherit from the built in types, since an extension " @@ -1994,159 +969,47 @@ msgstr "" "す。それに比べて、 :c:type:`PyTypeObject` 構造体を拡張モジュール間で共有する" "のは難しいです。" -#: ../../extending/newtypes_tutorial.rst:823 +#: ../../extending/newtypes_tutorial.rst:800 msgid "" -"In this example we will create a :class:`!SubList` type that inherits from " +"In this example we will create a :class:`SubList` type that inherits from " "the built-in :class:`list` type. The new type will be completely compatible " -"with regular lists, but will have an additional :meth:`!increment` method " +"with regular lists, but will have an additional :meth:`increment` method " "that increases an internal counter:" msgstr "" +"次の例では、ビルトインの :class:`list` 型を継承した :class:`SubList` 型を作成" +"しています。新しい型は通常のリスト型と完全に互換性がありますが、追加で内部の" +"カウンタを増やす :meth:`increment` メソッドを持っています:" -#: ../../extending/newtypes_tutorial.rst:828 +#: ../../extending/newtypes_tutorial.rst:820 msgid "" -">>> import sublist\n" -">>> s = sublist.SubList(range(3))\n" -">>> s.extend(s)\n" -">>> print(len(s))\n" -"6\n" -">>> print(s.increment())\n" -"1\n" -">>> print(s.increment())\n" -"2" -msgstr "" - -#: ../../extending/newtypes_tutorial.rst:840 -msgid "" -"#define PY_SSIZE_T_CLEAN\n" -"#include \n" -"\n" -"typedef struct {\n" -" PyListObject list;\n" -" int state;\n" -"} SubListObject;\n" -"\n" -"static PyObject *\n" -"SubList_increment(PyObject *op, PyObject *Py_UNUSED(dummy))\n" -"{\n" -" SubListObject *self = (SubListObject *) op;\n" -" self->state++;\n" -" return PyLong_FromLong(self->state);\n" -"}\n" -"\n" -"static PyMethodDef SubList_methods[] = {\n" -" {\"increment\", SubList_increment, METH_NOARGS,\n" -" PyDoc_STR(\"increment state counter\")},\n" -" {NULL},\n" -"};\n" -"\n" -"static int\n" -"SubList_init(PyObject *op, PyObject *args, PyObject *kwds)\n" -"{\n" -" SubListObject *self = (SubListObject *) op;\n" -" if (PyList_Type.tp_init(op, args, kwds) < 0)\n" -" return -1;\n" -" self->state = 0;\n" -" return 0;\n" -"}\n" -"\n" -"static PyTypeObject SubListType = {\n" -" .ob_base = PyVarObject_HEAD_INIT(NULL, 0)\n" -" .tp_name = \"sublist.SubList\",\n" -" .tp_doc = PyDoc_STR(\"SubList objects\"),\n" -" .tp_basicsize = sizeof(SubListObject),\n" -" .tp_itemsize = 0,\n" -" .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,\n" -" .tp_init = SubList_init,\n" -" .tp_methods = SubList_methods,\n" -"};\n" -"\n" -"static int\n" -"sublist_module_exec(PyObject *m)\n" -"{\n" -" SubListType.tp_base = &PyList_Type;\n" -" if (PyType_Ready(&SubListType) < 0) {\n" -" return -1;\n" -" }\n" -"\n" -" if (PyModule_AddObjectRef(m, \"SubList\", (PyObject *) &SubListType) < " -"0) {\n" -" return -1;\n" -" }\n" -"\n" -" return 0;\n" -"}\n" -"\n" -"static PyModuleDef_Slot sublist_module_slots[] = {\n" -" {Py_mod_exec, sublist_module_exec},\n" -" {Py_mod_multiple_interpreters, " -"Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED},\n" -" {0, NULL}\n" -"};\n" -"\n" -"static PyModuleDef sublist_module = {\n" -" .m_base = PyModuleDef_HEAD_INIT,\n" -" .m_name = \"sublist\",\n" -" .m_doc = \"Example module that creates an extension type.\",\n" -" .m_size = 0,\n" -" .m_slots = sublist_module_slots,\n" -"};\n" -"\n" -"PyMODINIT_FUNC\n" -"PyInit_sublist(void)\n" -"{\n" -" return PyModuleDef_Init(&sublist_module);\n" -"}\n" -msgstr "" - -#: ../../extending/newtypes_tutorial.rst:843 -msgid "" -"As you can see, the source code closely resembles the :class:`!Custom` " +"As you can see, the source code closely resembles the :class:`Custom` " "examples in previous sections. We will break down the main differences " "between them. ::" msgstr "" +"見てわかるように、ソースコードは前の節の :class:`Custom` の時と非常に似ていま" +"す。違う部分をそれぞれを見ていきます。 ::" -#: ../../extending/newtypes_tutorial.rst:846 -msgid "" -"typedef struct {\n" -" PyListObject list;\n" -" int state;\n" -"} SubListObject;" -msgstr "" - -#: ../../extending/newtypes_tutorial.rst:851 +#: ../../extending/newtypes_tutorial.rst:828 msgid "" "The primary difference for derived type objects is that the base type's " "object structure must be the first value. The base type will already " "include the :c:func:`PyObject_HEAD` at the beginning of its structure." msgstr "" -#: ../../extending/newtypes_tutorial.rst:855 +#: ../../extending/newtypes_tutorial.rst:832 msgid "" -"When a Python object is a :class:`!SubList` instance, its ``PyObject *`` " +"When a Python object is a :class:`SubList` instance, its ``PyObject *`` " "pointer can be safely cast to both ``PyListObject *`` and ``SubListObject " "*``::" msgstr "" -#: ../../extending/newtypes_tutorial.rst:858 +#: ../../extending/newtypes_tutorial.rst:844 msgid "" -"static int\n" -"SubList_init(PyObject *op, PyObject *args, PyObject *kwds)\n" -"{\n" -" SubListObject *self = (SubListObject *) op;\n" -" if (PyList_Type.tp_init(op, args, kwds) < 0)\n" -" return -1;\n" -" self->state = 0;\n" -" return 0;\n" -"}" +"We see above how to call through to the :attr:`__init__` method of the base " +"type." msgstr "" -#: ../../extending/newtypes_tutorial.rst:868 -msgid "" -"We see above how to call through to the :meth:`~object.__init__` method of " -"the base type." -msgstr "" - -#: ../../extending/newtypes_tutorial.rst:871 +#: ../../extending/newtypes_tutorial.rst:847 msgid "" "This pattern is important when writing a type with custom :c:member:" "`~PyTypeObject.tp_new` and :c:member:`~PyTypeObject.tp_dealloc` members. " @@ -2155,34 +1018,16 @@ msgid "" "the base class handle it by calling its own :c:member:`~PyTypeObject.tp_new`." msgstr "" -#: ../../extending/newtypes_tutorial.rst:877 +#: ../../extending/newtypes_tutorial.rst:853 msgid "" "The :c:type:`PyTypeObject` struct supports a :c:member:`~PyTypeObject." "tp_base` specifying the type's concrete base class. Due to cross-platform " "compiler issues, you can't fill that field directly with a reference to :c:" -"type:`PyList_Type`; it should be done in the :c:data:`Py_mod_exec` function::" -msgstr "" - -#: ../../extending/newtypes_tutorial.rst:883 -msgid "" -"static int\n" -"sublist_module_exec(PyObject *m)\n" -"{\n" -" SubListType.tp_base = &PyList_Type;\n" -" if (PyType_Ready(&SubListType) < 0) {\n" -" return -1;\n" -" }\n" -"\n" -" if (PyModule_AddObjectRef(m, \"SubList\", (PyObject *) &SubListType) < " -"0) {\n" -" return -1;\n" -" }\n" -"\n" -" return 0;\n" -"}" +"type:`PyList_Type`; it should be done later in the module initialization " +"function::" msgstr "" -#: ../../extending/newtypes_tutorial.rst:898 +#: ../../extending/newtypes_tutorial.rst:881 msgid "" "Before calling :c:func:`PyType_Ready`, the type structure must have the :c:" "member:`~PyTypeObject.tp_base` slot filled in. When we are deriving an " @@ -2196,17 +1041,19 @@ msgstr "" "`PyType_GenericNew` で埋める必要はありません。 -- 基底型のアロケーション関数" "が継承されます。" -#: ../../extending/newtypes_tutorial.rst:904 +#: ../../extending/newtypes_tutorial.rst:887 msgid "" "After that, calling :c:func:`PyType_Ready` and adding the type object to the " -"module is the same as with the basic :class:`!Custom` examples." +"module is the same as with the basic :class:`Custom` examples." msgstr "" +"この後は、 :c:func:`PyType_Ready` 関数を呼び、タイプオブジェクトをモジュール" +"へ追加するのは、基本的な :class:`Custom` の例と同じです。" -#: ../../extending/newtypes_tutorial.rst:909 +#: ../../extending/newtypes_tutorial.rst:892 msgid "Footnotes" msgstr "脚注" -#: ../../extending/newtypes_tutorial.rst:910 +#: ../../extending/newtypes_tutorial.rst:893 msgid "" "This is true when we know that the object is a basic type, like a string or " "a float." @@ -2214,13 +1061,13 @@ msgstr "" "これはそのオブジェクトが文字列や実数などの基本タイプであるような時に成り立ち" "ます。" -#: ../../extending/newtypes_tutorial.rst:913 +#: ../../extending/newtypes_tutorial.rst:896 msgid "" "We relied on this in the :c:member:`~PyTypeObject.tp_dealloc` handler in " "this example, because our type doesn't support garbage collection." msgstr "" -#: ../../extending/newtypes_tutorial.rst:916 +#: ../../extending/newtypes_tutorial.rst:899 msgid "" "We now know that the first and last members are strings, so perhaps we could " "be less careful about decrementing their reference counts, however, we " @@ -2230,7 +1077,7 @@ msgid "" "objects." msgstr "" -#: ../../extending/newtypes_tutorial.rst:922 +#: ../../extending/newtypes_tutorial.rst:905 msgid "" "Also, even with our attributes restricted to strings instances, the user " "could pass arbitrary :class:`str` subclasses and therefore still create " diff --git a/extending/windows.po b/extending/windows.po index 13ae33c9d..5f9a91d19 100644 --- a/extending/windows.po +++ b/extending/windows.po @@ -1,25 +1,26 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 +# 秘湯 , 2017 +# Arihiro TAKASE, 2017 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-06 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:52+0000\n" -"Last-Translator: tomo, 2021\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 17:42+0000\n" +"Last-Translator: Arihiro TAKASE, 2017\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../extending/windows.rst:8 @@ -74,14 +75,21 @@ msgstr "型どおりのアプローチ" #: ../../extending/windows.rst:36 msgid "" "There are two approaches to building extension modules on Windows, just as " -"there are on Unix: use the ``setuptools`` package to control the build " -"process, or do things manually. The setuptools approach works well for most " -"extensions; documentation on using ``setuptools`` to build and package " -"extension modules is available in :ref:`setuptools-index`. If you find you " +"there are on Unix: use the :mod:`distutils` package to control the build " +"process, or do things manually. The distutils approach works well for most " +"extensions; documentation on using :mod:`distutils` to build and package " +"extension modules is available in :ref:`distutils-index`. If you find you " "really need to do things manually, it may be instructive to study the " "project file for the :source:`winsound ` standard " "library module." msgstr "" +"Windows での拡張モジュールのビルドには、Unix と同じように、 :mod:`distutils` " +"パッケージを使ったビルド作業の制御と手動の二通りのアプローチがあります。 " +"distutils によるアプローチはほとんどの拡張モジュールでうまくいきます; :mod:" +"`distutils` を使った拡張モジュールのビルドとパッケージ化については、 :ref:" +"`distutils-index` にあります。これらを本当に手動で行わなければならないとわ" +"かった場合、標準ライブラリモジュールの :source:`winsound ` のプロジェクトファイルが学習に有益かもしれません。" #: ../../extending/windows.rst:48 msgid "Differences Between Unix and Windows" @@ -199,57 +207,43 @@ msgstr "" "作成したりはしません。Unix では、ライブラリとのリンクはむしろ ``from spam " "import *`` に似ています; この操作では個別にコードのコピーを生成します。" -#: ../../extending/windows.rst:101 -msgid "" -"Turn off the implicit, ``#pragma``-based linkage with the Python library, " -"performed inside CPython header files." -msgstr "" - -#: ../../extending/windows.rst:110 +#: ../../extending/windows.rst:103 msgid "Using DLLs in Practice" msgstr "DLL 使用の実際" -#: ../../extending/windows.rst:115 +#: ../../extending/windows.rst:108 msgid "" "Windows Python is built in Microsoft Visual C++; using other compilers may " -"or may not work. The rest of this section is MSVC++ specific." -msgstr "" - -#: ../../extending/windows.rst:118 -msgid "" -"When creating DLLs in Windows, you can use the CPython library in two ways:" -msgstr "" - -#: ../../extending/windows.rst:120 -msgid "" -"By default, inclusion of :file:`PC/pyconfig.h` directly or via :file:`Python." -"h` triggers an implicit, configure-aware link with the library. The header " -"file chooses :file:`pythonXY_d.lib` for Debug, :file:`pythonXY.lib` for " -"Release, and :file:`pythonX.lib` for Release with the :ref:`Limited API " -"` enabled." -msgstr "" - -#: ../../extending/windows.rst:126 ../../extending/windows.rst:144 -msgid "" -"To build two DLLs, spam and ni (which uses C functions found in spam), you " -"could use these commands::" +"or may not work (though Borland seems to). The rest of this section is MSVC+" +"+ specific." msgstr "" +"Windows 版の Python は Microsoft Visual C++でビルドされています; 他のコンパイ" +"ラを使うと、うまく動作したり、しなかったりします (Borland も一見うまく動作し" +"ません)。この節の残りの部分は MSVC++ 向けの説明です。" -#: ../../extending/windows.rst:129 +#: ../../extending/windows.rst:112 msgid "" -"cl /LD /I/python/include spam.c\n" -"cl /LD /I/python/include ni.c spam.lib" +"When creating DLLs in Windows, you must pass :file:`pythonXY.lib` to the " +"linker. To build two DLLs, spam and ni (which uses C functions found in " +"spam), you could use these commands::" msgstr "" +"Windows で DLL を作成する際は、 :file:`pythonXY.lib` をリンカに渡さねばなりま" +"せん。例えば二つの DLL 、spam と ni (spam の中には C 関数が入っているとしま" +"す) をビルドするには、以下のコマンドを実行します::" -#: ../../extending/windows.rst:132 +#: ../../extending/windows.rst:119 msgid "" "The first command created three files: :file:`spam.obj`, :file:`spam.dll` " "and :file:`spam.lib`. :file:`Spam.dll` does not contain any Python " "functions (such as :c:func:`PyArg_ParseTuple`), but it does know how to find " -"the Python code thanks to the implicitly linked :file:`pythonXY.lib`." +"the Python code thanks to :file:`pythonXY.lib`." msgstr "" +"最初のコマンドで、三つのファイル: :file:`spam.obj` 、 :file:`spam.dll` およ" +"び :file:`spam.lib` ができます。 :file:`Spam.dll` には (:c:func:" +"`PyArg_ParseTuple` のような) Python 関数は全く入っていませんが、 :file:" +"`pythonXY.lib` のおかげで Python コードを見つけることはできます。" -#: ../../extending/windows.rst:137 ../../extending/windows.rst:155 +#: ../../extending/windows.rst:124 msgid "" "The second command created :file:`ni.dll` (and :file:`.obj` and :file:`." "lib`), which knows how to find the necessary functions from spam, and also " @@ -259,31 +253,7 @@ msgstr "" "ができ、このライブラリは spam と Python 実行形式中の必要な関数をどうやって見" "つければよいか知っています。" -#: ../../extending/windows.rst:141 -msgid "" -"Manually by defining :c:macro:`Py_NO_LINK_LIB` macro before including :file:" -"`Python.h`. You must pass :file:`pythonXY.lib` to the linker." -msgstr "" - -#: ../../extending/windows.rst:147 -msgid "" -"cl /LD /DPy_NO_LINK_LIB /I/python/include spam.c ../libs/pythonXY.lib\n" -"cl /LD /DPy_NO_LINK_LIB /I/python/include ni.c spam.lib ../libs/pythonXY.lib" -msgstr "" - -#: ../../extending/windows.rst:150 -msgid "" -"The first command created three files: :file:`spam.obj`, :file:`spam.dll` " -"and :file:`spam.lib`. :file:`Spam.dll` does not contain any Python " -"functions (such as :c:func:`PyArg_ParseTuple`), but it does know how to find " -"the Python code thanks to :file:`pythonXY.lib`." -msgstr "" -"最初のコマンドで、三つのファイル: :file:`spam.obj` 、 :file:`spam.dll` およ" -"び :file:`spam.lib` ができます。 :file:`Spam.dll` には (:c:func:" -"`PyArg_ParseTuple` のような) Python 関数は全く入っていませんが、 :file:" -"`pythonXY.lib` のおかげで Python コードを見つけることはできます。" - -#: ../../extending/windows.rst:159 +#: ../../extending/windows.rst:128 msgid "" "Not every identifier is exported to the lookup table. If you want any other " "modules (including Python) to be able to see your identifiers, you have to " @@ -296,10 +266,15 @@ msgstr "" "_declspec(dllexport) *NiGetSpamData(void)`` のように、" "``_declspec(dllexport)`` で宣言せねばなりません。" -#: ../../extending/windows.rst:164 +#: ../../extending/windows.rst:133 msgid "" "Developer Studio will throw in a lot of import libraries that you do not " "really need, adding about 100K to your executable. To get rid of them, use " "the Project Settings dialog, Link tab, to specify *ignore default " -"libraries*. Add the correct :file:`msvcrt{xx}.lib` to the list of libraries." +"libraries*. Add the correct :file:`msvcrtxx.lib` to the list of libraries." msgstr "" +"Developer Studio は必要もなく大量のインポートライブラリを DLL に突っ込んで、" +"実行形式のサイズを 100K も大きくしてしまいます。不用なライブラリを追い出した" +"ければ、「プロジェクトのプロパティ」ダイアログを選び、「リンカ」タブに移動し" +"て、 *インポートライブラリの無視* を指定します。その後、適切な :file:" +"`msvcrtxx.lib` をライブラリのリストに追加してください。" diff --git a/faq/design.po b/faq/design.po index c09203780..f8ddc05cd 100644 --- a/faq/design.po +++ b/faq/design.po @@ -1,30 +1,34 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 -# mollinaca, 2021 +# Inada Naoki , 2017 +# E. Kawashima, 2017 +# Nozomu Kaneko , 2017 +# 秘湯 , 2017 +# Osamu NAKAMURA, 2017 +# Arihiro TAKASE, 2018 +# Hiroyuki Kurosawa , 2019 +# tomo, 2019 +# mollinaca, 2020 # Mikami Akiko, 2021 -# 菊池 健志, 2023 -# Arihiro TAKASE, 2023 -# TENMYO Masakazu, 2024 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-30 14:22+0000\n" -"PO-Revision-Date: 2021-06-28 00:52+0000\n" -"Last-Translator: TENMYO Masakazu, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-06-22 06:42+0000\n" +"PO-Revision-Date: 2017-02-16 17:42+0000\n" +"Last-Translator: Mikami Akiko, 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../faq/design.rst:3 @@ -58,14 +62,6 @@ msgstr "" "開始/終了の括弧がないので、構文解析器と人間の読者の間にグループ化の解釈の違い" "は起こりえません。時折、C のプログラマはこのようなコード片に出くわします::" -#: ../../faq/design.rst:21 -msgid "" -"if (x <= y)\n" -" x++;\n" -" y--;\n" -"z++;" -msgstr "" - #: ../../faq/design.rst:26 msgid "" "Only the ``x++`` statement is executed if the condition is true, but the " @@ -125,12 +121,6 @@ msgstr "なぜ浮動小数点数の計算はこんなに不正確なんですか msgid "Users are often surprised by results like this::" msgstr "ユーザーはよく次のような結果に驚きます::" -#: ../../faq/design.rst:58 -msgid "" -">>> 1.2 - 1.0\n" -"0.19999999999999996" -msgstr "" - #: ../../faq/design.rst:61 msgid "" "and think it is a bug in Python. It's not. This has little to do with " @@ -159,12 +149,10 @@ msgstr "" #: ../../faq/design.rst:72 msgid "" "Many numbers that can be written easily in decimal notation cannot be " -"expressed exactly in binary floating point. For example, after::" -msgstr "" - -#: ../../faq/design.rst:75 -msgid ">>> x = 1.2" +"expressed exactly in binary floating-point. For example, after::" msgstr "" +"10 進数で簡単に書ける多くの数が、2 進浮動小数点数では正確に表すことができませ" +"ん。例えばこうすると::" #: ../../faq/design.rst:77 msgid "" @@ -176,18 +164,10 @@ msgstr "" "て、厳密な ``1.2`` ではありません。一般的なコンピューターでは、実際に格納され" "る値は::" -#: ../../faq/design.rst:81 -msgid "1.0011001100110011001100110011001100110011001100110011 (binary)" -msgstr "" - #: ../../faq/design.rst:83 msgid "which is exactly::" msgstr "で、正確には次の値です::" -#: ../../faq/design.rst:85 -msgid "1.1999999999999999555910790149937383830547332763671875 (decimal)" -msgstr "" - #: ../../faq/design.rst:87 msgid "" "The typical precision of 53 bits provides Python floats with 15--16 decimal " @@ -198,9 +178,11 @@ msgstr "" #: ../../faq/design.rst:90 msgid "" -"For a fuller explanation, please see the :ref:`floating-point arithmetic " +"For a fuller explanation, please see the :ref:`floating point arithmetic " "` chapter in the Python tutorial." msgstr "" +"詳しくは、Python チュートリアルの :ref:`floating point arithmetic ` の章を参照してください。" #: ../../faq/design.rst:95 msgid "Why are Python strings immutable?" @@ -274,17 +256,17 @@ msgid "" "you want to use a method from a base class which is overridden in a derived " "class, you have to use the ``::`` operator -- in Python you can write " "``baseclass.methodname(self, )``. This is particularly " -"useful for :meth:`~object.__init__` methods, and in general in cases where a " -"derived class method wants to extend the base class method of the same name " -"and thus has to call the base class method somehow." +"useful for :meth:`__init__` methods, and in general in cases where a derived " +"class method wants to extend the base class method of the same name and thus " +"has to call the base class method somehow." msgstr "" "第二に、特定のクラスからメソッドを明示的に参照または呼び出ししたい時に、特別" "な構文が必要なくなります。C++ では、派生クラスでオーバーライドされた基底クラ" "スからメソッドを使うには、 ``::`` 演算子を使わなければなりません。 -- Python " "では、 ``baseclass.methodname(self, )`` と書けます。これは特" -"に、 :meth:`~object.__init__` メソッドに便利ですし、派生クラスのメソッドが、" -"基底クラスにある同じ名前のメソッドを拡張するために、基底クラスのメソッドをど" -"うにかして呼び出したい時にも便利です。" +"に、 :meth:`__init__` メソッドに便利ですし、派生クラスのメソッドが、基底クラ" +"スにある同じ名前のメソッドを拡張するために、基底クラスのメソッドをどうにかし" +"て呼び出したい時にも便利です。" #: ../../faq/design.rst:136 msgid "" @@ -326,15 +308,9 @@ msgstr "Python 3.8 以降ならできるよ!" #: ../../faq/design.rst:158 msgid "" -"Assignment expressions using the walrus operator ``:=`` assign a variable in " +"Assignment expressions using the walrus operator `:=` assign a variable in " "an expression::" -msgstr "セイウチ演算子 ``:=`` を使った代入式は、式の中で変数に代入します::" - -#: ../../faq/design.rst:161 -msgid "" -"while chunk := fp.read(200):\n" -" print(chunk)" -msgstr "" +msgstr "セイウチ演算子 `:=` を使った代入式は、式の中で変数に代入します::" #: ../../faq/design.rst:164 msgid "See :pep:`572` for more information." @@ -385,7 +361,7 @@ msgstr "" "ります。mappingを実装していないクラスがget()やkeys()メソッドを持っていたり、" "fileでない何かがwrite()メソッドを持っているような混乱は時折見かけます。" -#: ../../faq/design.rst:189 +#: ../../faq/design.rst:207 msgid "https://mail.python.org/pipermail/python-3000/2006-November/004643.html" msgstr "" "https://mail.python.org/pipermail/python-3000/2006-November/004643.html" @@ -408,18 +384,10 @@ msgstr "" "時に追加されました。その新しいメソッドの多くは広く受け入れられましたが、一部" "のプログラマに不快を感じさせていると思われるものがこれで::" -#: ../../faq/design.rst:201 -msgid "\", \".join(['1', '2', '4', '8', '16'])" -msgstr "" - #: ../../faq/design.rst:203 msgid "which gives the result::" msgstr "結果はこうなります::" -#: ../../faq/design.rst:205 -msgid "\"1, 2, 4, 8, 16\"" -msgstr "" - #: ../../faq/design.rst:207 msgid "There are two common arguments against this usage." msgstr "この使い方には二つの議論があります。" @@ -449,10 +417,6 @@ msgstr "" "です。いくつかの理由から :meth:`~str.split` を文字列のメソッドとしておいた方" "がはるかに簡単です。これを見ると分かりやすいでしょう ::" -#: ../../faq/design.rst:220 -msgid "\"1, 2, 4, 8, 16\".split(\", \")" -msgstr "" - #: ../../faq/design.rst:222 msgid "" "is an instruction to a string literal to return the substrings delimited by " @@ -481,24 +445,15 @@ msgstr "例外はどれくらい速いのですか?" #: ../../faq/design.rst:235 msgid "" -"A :keyword:`try`/:keyword:`except` block is extremely efficient if no " -"exceptions are raised. Actually catching an exception is expensive. In " -"versions of Python prior to 2.0 it was common to use this idiom::" -msgstr "" -":keyword:`try`/:keyword:`except` ブロックは例外が送出されなければ極端に効率的" -"です。実際に例外を捕捉するのは高価です。Python 2.0 より前のバージョンでは、こ" -"のイディオムを使うのが一般的でした::" - -#: ../../faq/design.rst:240 -msgid "" -"try:\n" -" value = mydict[key]\n" -"except KeyError:\n" -" mydict[key] = getvalue(key)\n" -" value = mydict[key]" +"A try/except block is extremely efficient if no exceptions are raised. " +"Actually catching an exception is expensive. In versions of Python prior to " +"2.0 it was common to use this idiom::" msgstr "" +"try/except ブロックは例外が送出されなければ極端に効率的です。実際に例外を捕捉" +"するのは高価です。Python 2.0 より前のバージョンでは、このイディオムを使うのが" +"一般的でした::" -#: ../../faq/design.rst:246 +#: ../../faq/design.rst:245 msgid "" "This only made sense when you expected the dict to have the key almost all " "the time. If that wasn't the case, you coded it like this::" @@ -506,15 +461,7 @@ msgstr "" "これは、辞書がほとんどの場合にキーを持っていると予想できるときにのみ意味をな" "します。そうでなければ、このように書きます::" -#: ../../faq/design.rst:249 -msgid "" -"if key in mydict:\n" -" value = mydict[key]\n" -"else:\n" -" value = mydict[key] = getvalue(key)" -msgstr "" - -#: ../../faq/design.rst:254 +#: ../../faq/design.rst:253 msgid "" "For this specific case, you could also use ``value = dict.setdefault(key, " "getvalue(key))``, but only if the ``getvalue()`` call is cheap enough " @@ -524,24 +471,23 @@ msgstr "" "が、これは ``getvalue()`` 呼び出しが十分安価な場合に限ります。なぜならそれが" "全ての場合に評価されるからです。" -#: ../../faq/design.rst:260 +#: ../../faq/design.rst:259 msgid "Why isn't there a switch or case statement in Python?" msgstr "Python に switch や case 文がないのはなぜですか?" -#: ../../faq/design.rst:262 +#: ../../faq/design.rst:261 msgid "" -"In general, structured switch statements execute one block of code when an " -"expression has a particular value or set of values. Since Python 3.10 one " -"can easily match literal values, or constants within a namespace, with a " -"``match ... case`` statement. An older alternative is a sequence of ``if... " -"elif... elif... else``." +"You can do this easily enough with a sequence of ``if... elif... elif... " +"else``. There have been some proposals for switch statement syntax, but " +"there is no consensus (yet) on whether and how to do range tests. See :pep:" +"`275` for complete details and the current status." msgstr "" -"一般的に、構造化された switch 文は、式が特定の値または値の集合を持つとき、1" -"つのコードブロックを実行します。 Python 3.10 以降では、リテラル値や名前空間内" -"の定数を、 ``match ... case`` 文で簡単にマッチさせることができます。より古い" -"手段は一連の ``if... elif... elif... else`` です。" +"``if... elif... elif... else`` の繰り返しで簡単に同じことができます。switch " +"文の構文に関する提案がいくつかありましたが、範囲判定をするべきか、あるいはど" +"のようにするべきかについての合意は (まだ) 得られていません。現在の状況の完全" +"な詳細は :pep:`275` を参照してください。" -#: ../../faq/design.rst:268 +#: ../../faq/design.rst:266 msgid "" "For cases where you need to choose from a very large number of " "possibilities, you can create a dictionary mapping case values to functions " @@ -550,17 +496,7 @@ msgstr "" "非常に大きな数の選択肢から選ぶとき、値を呼び出す関数に対応づける辞書を作れま" "す。例えば::" -#: ../../faq/design.rst:272 -msgid "" -"functions = {'a': function_1,\n" -" 'b': function_2,\n" -" 'c': self.method_1}\n" -"\n" -"func = functions[value]\n" -"func()" -msgstr "" - -#: ../../faq/design.rst:279 +#: ../../faq/design.rst:280 msgid "" "For calling methods on objects, you can simplify yet further by using the :" "func:`getattr` built-in to retrieve methods with a particular name::" @@ -568,19 +504,7 @@ msgstr "" "オブジェクトのメソッドを呼び出すには、さらに単純に :func:`getattr` 組み込み関" "数で特定の名前のメソッドを検索できます::" -#: ../../faq/design.rst:282 -msgid "" -"class MyVisitor:\n" -" def visit_a(self):\n" -" ...\n" -"\n" -" def dispatch(self, value):\n" -" method_name = 'visit_' + str(value)\n" -" method = getattr(self, method_name)\n" -" method()" -msgstr "" - -#: ../../faq/design.rst:291 +#: ../../faq/design.rst:292 msgid "" "It's suggested that you use a prefix for the method names, such as " "``visit_`` in this example. Without such a prefix, if values are coming " @@ -591,15 +515,7 @@ msgstr "" "ような接頭辞がないと、信頼できないソースから値が与えられたときに、オブジェク" "トの任意のメソッドを呼び出す攻撃をされる可能性があります。" -#: ../../faq/design.rst:295 -msgid "" -"Imitating switch with fallthrough, as with C's switch-case-default, is " -"possible, much harder, and less needed." -msgstr "" -"C の switch-case-default のような、フォールスルーのある switch を模倣すること" -"もできますが、はるかに難しいうえに必要性も少ないでしょう。" - -#: ../../faq/design.rst:300 +#: ../../faq/design.rst:298 msgid "" "Can't you emulate threads in the interpreter instead of relying on an OS-" "specific thread implementation?" @@ -607,7 +523,7 @@ msgstr "" "OS 特有のスレッド実装に依らずにインタプリタでスレッドをエミュレートすることは" "できないのですか?" -#: ../../faq/design.rst:302 +#: ../../faq/design.rst:300 msgid "" "Answer 1: Unfortunately, the interpreter pushes at least one C stack frame " "for each Python stack frame. Also, extensions can call back into Python at " @@ -619,7 +535,7 @@ msgstr "" "きに Python にコールバックすることがあります。よって、完全なスレッド実装には " "C のスレッドサポートが必要です。" -#: ../../faq/design.rst:307 +#: ../../faq/design.rst:305 msgid "" "Answer 2: Fortunately, there is `Stackless Python `_, which has a completely redesigned " @@ -629,11 +545,11 @@ msgstr "" "stackless/wiki>`_ があります。これは完全に再デザインされたインタープリタで、C" "のスタックを回避しています。" -#: ../../faq/design.rst:312 +#: ../../faq/design.rst:310 msgid "Why can't lambda expressions contain statements?" msgstr "なぜラムダ式は文を含むことができないのですか?" -#: ../../faq/design.rst:314 +#: ../../faq/design.rst:312 msgid "" "Python lambda expressions cannot contain statements because Python's " "syntactic framework can't handle statements nested inside expressions. " @@ -647,11 +563,11 @@ msgstr "" "Python のラムダは単なる、関数を定義するのが面倒すぎる場合のための簡略な記法に" "過ぎないのです。" -#: ../../faq/design.rst:320 +#: ../../faq/design.rst:318 msgid "" "Functions are already first class objects in Python, and can be declared in " "a local scope. Therefore the only advantage of using a lambda instead of a " -"locally defined function is that you don't need to invent a name for the " +"locally-defined function is that you don't need to invent a name for the " "function -- but that's just a local variable to which the function object " "(which is exactly the same type of object that a lambda expression yields) " "is assigned!" @@ -661,23 +577,29 @@ msgstr "" "る必要が無いことだけです -- しかし、(ラムダ式が生み出すオブジェクトと厳密に同" "じ型の) 関数オブジェクトが代入される先はただのローカル変数です!" -#: ../../faq/design.rst:328 +#: ../../faq/design.rst:326 msgid "Can Python be compiled to machine code, C or some other language?" msgstr "Python は C やその他の言語のように機械語にコンパイルできますか?" -#: ../../faq/design.rst:330 +#: ../../faq/design.rst:328 msgid "" -"`Cython `_ compiles a modified version of Python with " -"optional annotations into C extensions. `Nuitka `_ is " -"an up-and-coming compiler of Python into C++ code, aiming to support the " -"full Python language." +"`Cython `_ compiles a modified version of Python with " +"optional annotations into C extensions. `Nuitka `_ " +"is an up-and-coming compiler of Python into C++ code, aiming to support the " +"full Python language. For compiling to Java you can consider `VOC `_." msgstr "" +"`Cython `_ は オプションのアノテーション付きのPythonの修" +"正版を C拡張へ変換します。`Nuitka `_ はPythonをC+" +"+コードへ変換する将来有望なPythonコンパイラで、完全なPython言語をサポートする" +"ことを目的としています。Javaへコンパイラするには、 `VOC `_ を検討してください。" -#: ../../faq/design.rst:337 +#: ../../faq/design.rst:336 msgid "How does Python manage memory?" msgstr "Python はメモリをどのように管理するのですか?" -#: ../../faq/design.rst:339 +#: ../../faq/design.rst:338 msgid "" "The details of Python memory management depend on the implementation. The " "standard implementation of Python, :term:`CPython`, uses reference counting " @@ -694,16 +616,20 @@ msgstr "" "を削除します。 :mod:`gc` モジュールの関数で、ガベージコレクションを実行し、デ" "バッグ統計を取得し、コレクタのパラメタを変更できます。" -#: ../../faq/design.rst:347 +#: ../../faq/design.rst:346 msgid "" -"Other implementations (such as `Jython `_ or `PyPy " -"`_), however, can rely on a different mechanism such as a " -"full-blown garbage collector. This difference can cause some subtle porting " -"problems if your Python code depends on the behavior of the reference " -"counting implementation." +"Other implementations (such as `Jython `_ or `PyPy " +"`_), however, can rely on a different mechanism such as " +"a full-blown garbage collector. This difference can cause some subtle " +"porting problems if your Python code depends on the behavior of the " +"reference counting implementation." msgstr "" +"ただし、他の実装 (例えば `Jython `_ や `PyPy `_) は本格的 (full-blown) なガベージコレクタのような別のメカニズ" +"ムに依存するかもしれません。あなたの Python コードが参照カウントの実装の振る" +"舞いに依存する場合、この違いが微妙な移植上の問題を引き起こすでしょう。" -#: ../../faq/design.rst:353 +#: ../../faq/design.rst:352 msgid "" "In some Python implementations, the following code (which is fine in " "CPython) will probably run out of file descriptors::" @@ -711,26 +637,19 @@ msgstr "" "Python の実装によっては、以下の (CPython では通る) コードはおそらく、ファイル" "ディスクリプタを使い果たすでしょう::" -#: ../../faq/design.rst:356 -msgid "" -"for file in very_long_list_of_files:\n" -" f = open(file)\n" -" c = f.read(1)" -msgstr "" - -#: ../../faq/design.rst:360 +#: ../../faq/design.rst:359 msgid "" "Indeed, using CPython's reference counting and destructor scheme, each new " -"assignment to ``f`` closes the previous file. With a traditional GC, " -"however, those file objects will only get collected (and closed) at varying " -"and possibly long intervals." +"assignment to *f* closes the previous file. With a traditional GC, however, " +"those file objects will only get collected (and closed) at varying and " +"possibly long intervals." msgstr "" -"実際、CPython の参照カウントとデストラクタのスキームを使えば ``f`` への新しい" -"代入ごとにファイルは閉じられます。しかし、伝統的な GC を使うと、これらのファ" -"イルオブジェクトが回収され (て閉じられる) までに不定な、場合によっては長い、" -"間隔が空くことがあります。" +"実際、CPython の参照カウントとデストラクタのスキームを使えば *f* への新しい代" +"入ごとにファイルは閉じられます。しかし、伝統的な GC を使うと、これらのファイ" +"ルオブジェクトが回収され (て閉じられる) までに不定な、場合によっては長い、間" +"隔が空くことがあります。" -#: ../../faq/design.rst:365 +#: ../../faq/design.rst:364 msgid "" "If you want to write code that will work with any Python implementation, you " "should explicitly close the file or use the :keyword:`with` statement; this " @@ -740,18 +659,11 @@ msgstr "" "keyword:`with` 文を使ってください。これでメモリ管理のスキームに関係なく動きま" "す::" -#: ../../faq/design.rst:369 -msgid "" -"for file in very_long_list_of_files:\n" -" with open(file) as f:\n" -" c = f.read(1)" -msgstr "" - -#: ../../faq/design.rst:375 +#: ../../faq/design.rst:374 msgid "Why doesn't CPython use a more traditional garbage collection scheme?" msgstr "CPython はなぜ伝統的なガベージコレクションスキームを使わないのですか?" -#: ../../faq/design.rst:377 +#: ../../faq/design.rst:376 msgid "" "For one thing, this is not a C standard feature and hence it's not portable. " "(Yes, we know about the Boehm GC library. It has bits of assembler code for " @@ -765,29 +677,28 @@ msgstr "" "ほとんど透過的ですが、完全に透過的ではありません。Python を対応させるにはパッ" "チが必要です。)" -#: ../../faq/design.rst:383 +#: ../../faq/design.rst:382 msgid "" "Traditional GC also becomes a problem when Python is embedded into other " "applications. While in a standalone Python it's fine to replace the " -"standard ``malloc()`` and ``free()`` with versions provided by the GC " -"library, an application embedding Python may want to have its *own* " -"substitute for ``malloc()`` and ``free()``, and may not want Python's. " -"Right now, CPython works with anything that implements ``malloc()`` and " -"``free()`` properly." +"standard malloc() and free() with versions provided by the GC library, an " +"application embedding Python may want to have its *own* substitute for " +"malloc() and free(), and may not want Python's. Right now, CPython works " +"with anything that implements malloc() and free() properly." msgstr "" "伝統的な GC は Python が他のアプリケーションに組み込まれるときにも問題となり" -"ます。スタンドアロンの Python で動く限りでは、標準の ``malloc()`` と " -"``free()`` を GC ライブラリから提供されるものに置き換えても問題ありませんが、" -"Python を実装したアプリケーションは Python のものではない *独自の* 代替品を使" -"おうとするかもしれません。現在のようにすることで、CPython は ``malloc()`` と " -"``free()`` が適切に実装されている限りどんなものにも対応させられます。" +"ます。スタンドアロンの Python で動く限りでは、標準の malloc() と free() を " +"GC ライブラリから提供されるものに置き換えても問題ありませんが、Python を実装" +"したアプリケーションは Python のものではない *独自の* 代替品を使おうとするか" +"もしれません。現在のようにすることで、CPython は malloc() と free() が適切に" +"実装されている限りどんなものにも対応させられます。" -#: ../../faq/design.rst:392 +#: ../../faq/design.rst:391 msgid "Why isn't all memory freed when CPython exits?" msgstr "" "なぜ CPython の終了時にすべてのメモリが解放されるわけではないのですか?" -#: ../../faq/design.rst:394 +#: ../../faq/design.rst:393 msgid "" "Objects referenced from the global namespaces of Python modules are not " "always deallocated when Python exits. This may happen if there are circular " @@ -803,7 +714,7 @@ msgstr "" "かし、Python は終了時にメモリをクリーンアップすることには積極的で、全ての単一" "のオブジェクトを破棄しようとします。" -#: ../../faq/design.rst:401 +#: ../../faq/design.rst:400 msgid "" "If you want to force Python to delete certain things on deallocation use " "the :mod:`atexit` module to run a function that will force those deletions." @@ -811,41 +722,40 @@ msgstr "" "再割り当て時に Python が特定のものを削除するように強制したいときは、 :mod:" "`atexit` モジュールを使って削除を強制する関数を実行してください。" -#: ../../faq/design.rst:406 +#: ../../faq/design.rst:405 msgid "Why are there separate tuple and list data types?" msgstr "なぜタプルとリストという別のデータ型が用意されているのですか?" -#: ../../faq/design.rst:408 +#: ../../faq/design.rst:407 msgid "" "Lists and tuples, while similar in many respects, are generally used in " "fundamentally different ways. Tuples can be thought of as being similar to " -"Pascal ``records`` or C ``structs``; they're small collections of related " -"data which may be of different types which are operated on as a group. For " -"example, a Cartesian coordinate is appropriately represented as a tuple of " -"two or three numbers." +"Pascal records or C structs; they're small collections of related data which " +"may be of different types which are operated on as a group. For example, a " +"Cartesian coordinate is appropriately represented as a tuple of two or three " +"numbers." msgstr "" "リストとタプルは、多くの点で似ていますが、一般には本質的に異なる方法で使われ" -"ます。タプルは、Pascal の ``レコード`` や C の ``構造体`` と同様なものと考え" -"られます。型が異なっても良い関連するデータの小さな集合で、グループとして演算" -"されます。例えば、デカルト座標は 2 つや 3 つの数のタプルとして適切に表せま" -"す。" +"ます。タプルは、Pascal のレコードや C の構造体と同様なものと考えられます。型" +"が異なっても良い関連するデータの小さな集合で、グループとして演算されます。例" +"えば、デカルト座標は 2 つや 3 つの数のタプルとして適切に表せます。" -#: ../../faq/design.rst:415 +#: ../../faq/design.rst:414 msgid "" "Lists, on the other hand, are more like arrays in other languages. They " "tend to hold a varying number of objects all of which have the same type and " -"which are operated on one-by-one. For example, :func:`os.listdir('.') ` returns a list of strings representing the files in the current " -"directory. Functions which operate on this output would generally not break " -"if you added another file or two to the directory." +"which are operated on one-by-one. For example, ``os.listdir('.')`` returns " +"a list of strings representing the files in the current directory. " +"Functions which operate on this output would generally not break if you " +"added another file or two to the directory." msgstr "" "一方、リストは、もっと他の言語の配列に近いものです。全て同じ型の可変数のオブ" -"ジェクトを持ち、それらが一つ一つ演算される傾向にあります。例えば、 :func:`os." -"listdir('.') ` はカレントディレクトリ内にあるファイルの文字列表現" -"のリストを返します。この出力を演算する関数は一般に、ディレクトリに一つや二つ" -"の別のファイルを加えても壊れません。" +"ジェクトを持ち、それらが一つ一つ演算される傾向にあります。例えば、 ``os." +"listdir('.')`` はカレントディレクトリ内にあるファイルの文字列表現のリストを返" +"します。この出力を演算する関数は一般に、ディレクトリに一つや二つの別のファイ" +"ルを加えても壊れません。" -#: ../../faq/design.rst:423 +#: ../../faq/design.rst:421 msgid "" "Tuples are immutable, meaning that once a tuple has been created, you can't " "replace any of its elements with a new value. Lists are mutable, meaning " @@ -858,11 +768,11 @@ msgstr "" "更できます。イミュータブルな要素だけが辞書のキーとして使えるので、リストでは" "なくタプルだけがキーとして使えます。" -#: ../../faq/design.rst:430 +#: ../../faq/design.rst:428 msgid "How are lists implemented in CPython?" msgstr "CPythonでリストはどのように実装されているのですか?" -#: ../../faq/design.rst:432 +#: ../../faq/design.rst:430 msgid "" "CPython's lists are really variable-length arrays, not Lisp-style linked " "lists. The implementation uses a contiguous array of references to other " @@ -873,7 +783,7 @@ msgstr "" "ません。この実装は他のオブジェクトへの参照の連続した配列を使用していて、この" "配列へのポインタおよび配列長はリストの先頭の構造体に保存されています。" -#: ../../faq/design.rst:436 +#: ../../faq/design.rst:434 msgid "" "This makes indexing a list ``a[i]`` an operation whose cost is independent " "of the size of the list or the value of the index." @@ -881,7 +791,7 @@ msgstr "" "これにより、リストのインデクシング ``a[i]`` は、リストの大きさやインデクスの" "値に依存しないコストで演算できます。" -#: ../../faq/design.rst:439 +#: ../../faq/design.rst:437 msgid "" "When items are appended or inserted, the array of references is resized. " "Some cleverness is applied to improve the performance of appending items " @@ -893,11 +803,11 @@ msgstr "" "くなるとき、次の何回かは実際に大きさを変更する必要がないように、いくらかの追" "加の領域が割り当てられます。" -#: ../../faq/design.rst:446 +#: ../../faq/design.rst:444 msgid "How are dictionaries implemented in CPython?" msgstr "CPythonで辞書はどのように実装されていますか?" -#: ../../faq/design.rst:448 +#: ../../faq/design.rst:446 msgid "" "CPython's dictionaries are implemented as resizable hash tables. Compared " "to B-trees, this gives better performance for lookup (the most common " @@ -908,32 +818,31 @@ msgstr "" "木と比べて、ほとんどの条件下で (特に一般的な演算である) 探索のパフォーマンス" "が良いですし、実装も単純です。" -#: ../../faq/design.rst:452 +#: ../../faq/design.rst:450 msgid "" "Dictionaries work by computing a hash code for each key stored in the " "dictionary using the :func:`hash` built-in function. The hash code varies " -"widely depending on the key and a per-process seed; for example, " -"``'Python'`` could hash to ``-539294296`` while ``'python'``, a string that " -"differs by a single bit, could hash to ``1142331976``. The hash code is " -"then used to calculate a location in an internal array where the value will " -"be stored. Assuming that you're storing keys that all have different hash " -"values, this means that dictionaries take constant time -- *O*\\ (1), in Big-" -"O notation -- to retrieve a key." -msgstr "" -"辞書は、辞書に保存されているそれぞれのキーに対応するハッシュコードを :func:" +"widely depending on the key and a per-process seed; for example, \"Python\" " +"could hash to -539294296 while \"python\", a string that differs by a single " +"bit, could hash to 1142331976. The hash code is then used to calculate a " +"location in an internal array where the value will be stored. Assuming that " +"you're storing keys that all have different hash values, this means that " +"dictionaries take constant time -- O(1), in Big-O notation -- to retrieve a " +"key." +msgstr "" +"辞書は、 辞書に保存されているそれぞれのキーに対応するハッシュコードを:func:" "`hash` ビルトイン関数で計算することで機能します。このハッシュコードはキーやプ" -"ロセスごとのシードによって大きく変化します。例えば、 ``'Python'`` のハッシュ" -"値は ``-539294296`` ですが、ビットが一つ違うだけの文字列 ``'python'`` のハッ" -"シュ値は ``1142331976`` です。そしてこのハッシュコードは、値が保存される内部" -"配列での位置を計算するために使われます。保存しているキーのハッシュ値が全て異" -"なるとすれば、一定の時間 − Big-O 記法では *O*\\ (1) − でキーを検索できること" -"になります。" +"ロセスごとのシードによって大きく変化します。例えば、\"Python\" のハッシュ値" +"は -539294296 ですが、ビットが一つ違うだけの文字列 \"python\" のハッシュ値は " +"1142331976 です。そしてこのハッシュコードは、値が保存される内部配列での位置を" +"計算するために使われます。保存しているキーのハッシュ値が全て異なるとすれば、" +"一定の時間 − big O-記法ではO(1) − でキーを検索できることになります。" -#: ../../faq/design.rst:463 +#: ../../faq/design.rst:461 msgid "Why must dictionary keys be immutable?" msgstr "なぜ辞書のキーはイミュータブルでなくてはならないのですか?" -#: ../../faq/design.rst:465 +#: ../../faq/design.rst:463 msgid "" "The hash table implementation of dictionaries uses a hash value calculated " "from the key value to find the key. If the key were a mutable object, its " @@ -954,7 +863,7 @@ msgstr "" "ハッシュバイナリから見つかるオブジェクトの値は異なるでしょうから、これも見つ" "かりません。" -#: ../../faq/design.rst:474 +#: ../../faq/design.rst:472 msgid "" "If you want a dictionary indexed with a list, simply convert the list to a " "tuple first; the function ``tuple(L)`` creates a tuple with the same entries " @@ -965,11 +874,11 @@ msgstr "" "てください。関数 ``tuple(L)`` は、リスト ``L`` と同じエントリのタプルを生成し" "ます。タプルはイミュータブルなので、辞書のキーとして使えます。" -#: ../../faq/design.rst:478 +#: ../../faq/design.rst:476 msgid "Some unacceptable solutions that have been proposed:" msgstr "いくつかの受け入れられなかった提案:" -#: ../../faq/design.rst:480 +#: ../../faq/design.rst:478 msgid "" "Hash lists by their address (object ID). This doesn't work because if you " "construct a new list with the same value it won't be found; e.g.::" @@ -977,13 +886,7 @@ msgstr "" "アドレス (オブジェクト ID) のハッシュリスト。これは、同じ値の新しいリストを" "作っても見つからないので駄目です。例えば::" -#: ../../faq/design.rst:483 -msgid "" -"mydict = {[1, 2]: '12'}\n" -"print(mydict[[1, 2]])" -msgstr "" - -#: ../../faq/design.rst:486 +#: ../../faq/design.rst:484 msgid "" "would raise a :exc:`KeyError` exception because the id of the ``[1, 2]`` " "used in the second line differs from that in the first line. In other " @@ -994,7 +897,7 @@ msgstr "" "外を送出するでしょう。言い換えれば、辞書のキーは ``==`` を使って比較されるべ" "きであり、 :keyword:`is` ではないということです。" -#: ../../faq/design.rst:490 +#: ../../faq/design.rst:488 msgid "" "Make a copy when using a list as a key. This doesn't work because the list, " "being a mutable object, could contain a reference to itself, and then the " @@ -1004,7 +907,7 @@ msgstr "" "身への参照を含むことができ、コードをコピーするときに無限ループにハマる可能性" "があるので、これは駄目です。" -#: ../../faq/design.rst:494 +#: ../../faq/design.rst:492 msgid "" "Allow lists as keys but tell the user not to modify them. This would allow " "a class of hard-to-track bugs in programs when you forgot or modified a list " @@ -1016,7 +919,7 @@ msgstr "" "なバグの可能性を生じてしまいます。またこれは、 ``d.keys()`` のすべての値は辞" "書のキーとして使えるという、辞書の重要な不変性も潰してしまいます。" -#: ../../faq/design.rst:499 +#: ../../faq/design.rst:497 msgid "" "Mark lists as read-only once they are used as a dictionary key. The problem " "is that it's not just the top-level object that could change its value; you " @@ -1031,43 +934,23 @@ msgstr "" "達可能な全てのオブジェクトに読み出し専用のマークを付ける必要があります -- そ" "して再び、自己参照オブジェクトが無限ループを引き起こします。" -#: ../../faq/design.rst:505 +#: ../../faq/design.rst:503 msgid "" "There is a trick to get around this if you need to, but use it at your own " "risk: You can wrap a mutable structure inside a class instance which has " -"both a :meth:`~object.__eq__` and a :meth:`~object.__hash__` method. You " -"must then make sure that the hash value for all such wrapper objects that " -"reside in a dictionary (or other hash based structure), remain fixed while " -"the object is in the dictionary (or other structure). ::" +"both a :meth:`__eq__` and a :meth:`__hash__` method. You must then make " +"sure that the hash value for all such wrapper objects that reside in a " +"dictionary (or other hash based structure), remain fixed while the object is " +"in the dictionary (or other structure). ::" msgstr "" "必要ならばこれを回避する方法がありますが、自己責任のもとで行ってください。" -"ミュータブルな構造を、 :meth:`~object.__eq__` と :meth:`~object.__hash__` メ" -"ソッドの両方を持つクラスインスタンスに含めることができます。その時、辞書 (ま" -"たはハッシュに基づく別の構造体) に属するような全てのラッパーオブジェクトの" -"ハッシュ値が、そのオブジェクトが辞書 (その他の構造体) 中にある間固定され続け" -"ることを確実にしてください。 ::" - -#: ../../faq/design.rst:513 -msgid "" -"class ListWrapper:\n" -" def __init__(self, the_list):\n" -" self.the_list = the_list\n" -"\n" -" def __eq__(self, other):\n" -" return self.the_list == other.the_list\n" -"\n" -" def __hash__(self):\n" -" l = self.the_list\n" -" result = 98767 - len(l)*555\n" -" for i, el in enumerate(l):\n" -" try:\n" -" result = result + (hash(el) % 9999999) * 1001 + i\n" -" except Exception:\n" -" result = (result % 7777777) + i * 333\n" -" return result" -msgstr "" - -#: ../../faq/design.rst:530 +"ミュータブルな構造を、 :meth:`__eq__` と :meth:`__hash__` メソッドの両方を持" +"つクラスインスタンスに含めることができます。その時、辞書 (またはハッシュに基" +"づく別の構造体) に属するような全てのラッパーオブジェクトのハッシュ値が、その" +"オブジェクトが辞書 (その他の構造体) 中にある間固定され続けることを確実にして" +"ください。 ::" + +#: ../../faq/design.rst:527 msgid "" "Note that the hash computation is complicated by the possibility that some " "members of the list may be unhashable and also by the possibility of " @@ -1076,7 +959,7 @@ msgstr "" "なお、リストのメンバーの中にハッシュ化できないものがある可能性や、算術オー" "バーフローの可能性から、ハッシュ計算は複雑になります。" -#: ../../faq/design.rst:534 +#: ../../faq/design.rst:531 msgid "" "Furthermore it must always be the case that if ``o1 == o2`` (ie ``o1." "__eq__(o2) is True``) then ``hash(o1) == hash(o2)`` (ie, ``o1.__hash__() == " @@ -1089,23 +972,23 @@ msgstr "" "なわち ``o1.__hash__() == o2.__hash__()``) でなくてはなりません。その制限に適" "合できなければ、辞書やその他のハッシュに基づく構造体は間違いを起こします。" -#: ../../faq/design.rst:539 +#: ../../faq/design.rst:536 msgid "" -"In the case of :class:`!ListWrapper`, whenever the wrapper object is in a " -"dictionary the wrapped list must not change to avoid anomalies. Don't do " -"this unless you are prepared to think hard about the requirements and the " -"consequences of not meeting them correctly. Consider yourself warned." +"In the case of ListWrapper, whenever the wrapper object is in a dictionary " +"the wrapped list must not change to avoid anomalies. Don't do this unless " +"you are prepared to think hard about the requirements and the consequences " +"of not meeting them correctly. Consider yourself warned." msgstr "" -"この :class:`!ListWrapper` の例では、異常を避けるため、ラッパオブジェクトが辞" -"書内にある限りラップされたリストが変更されてはなりません。この条件と満たせな" -"かった時の結果について知恵を絞る覚悟がない限り、これをしてはいけません。よく" -"考えてください。" +"この ListWrapper の例では、異常を避けるため、ラッパオブジェクトが辞書内にある" +"限りラップされたリストが変更されてはなりません。この条件と満たせなかった時の" +"結果について知恵を絞る覚悟がない限り、これをしてはいけません。よく考えてくだ" +"さい。" -#: ../../faq/design.rst:546 +#: ../../faq/design.rst:543 msgid "Why doesn't list.sort() return the sorted list?" msgstr "なぜ list.sort() はソートされたリストを返さないのですか?" -#: ../../faq/design.rst:548 +#: ../../faq/design.rst:545 msgid "" "In situations where performance matters, making a copy of the list just to " "sort it would be wasteful. Therefore, :meth:`list.sort` sorts the list in " @@ -1120,7 +1003,7 @@ msgstr "" "うすることで、ソートされたコピーが必要で、ソートされていないものも残しておき" "たいときに、うっかり上書きしてしまうようなことがなくなります。" -#: ../../faq/design.rst:554 +#: ../../faq/design.rst:551 msgid "" "If you want to return a new list, use the built-in :func:`sorted` function " "instead. This function creates a new list from a provided iterable, sorts " @@ -1132,17 +1015,11 @@ msgstr "" "成し、ソートして返します。例えば、辞書のキーをソートされた順序でイテレートす" "る方法は::" -#: ../../faq/design.rst:559 -msgid "" -"for key in sorted(mydict):\n" -" ... # do whatever with mydict[key]..." -msgstr "" - -#: ../../faq/design.rst:564 +#: ../../faq/design.rst:561 msgid "How do you specify and enforce an interface spec in Python?" msgstr "Python ではどのようにインターフェース仕様を特定し適用するのですか?" -#: ../../faq/design.rst:566 +#: ../../faq/design.rst:563 msgid "" "An interface specification for a module as provided by languages such as C++ " "and Java describes the prototypes for the methods and functions of the " @@ -1154,7 +1031,7 @@ msgstr "" "の特定がコンパイル時に適用されることが、大きなプログラムの構成に役立つと、広" "く感じられています。" -#: ../../faq/design.rst:571 +#: ../../faq/design.rst:568 msgid "" "Python 2.6 adds an :mod:`abc` module that lets you define Abstract Base " "Classes (ABCs). You can then use :func:`isinstance` and :func:`issubclass` " @@ -1170,7 +1047,7 @@ msgstr "" "`~collections.abc.Iterable` 、 :class:`~collections.abc.Container` 、 :class:" "`~collections.abc.MutableMapping` などの便利な ABC が定義されています。" -#: ../../faq/design.rst:578 +#: ../../faq/design.rst:575 msgid "" "For Python, many of the advantages of interface specifications can be " "obtained by an appropriate test discipline for components." @@ -1178,7 +1055,7 @@ msgstr "" "Pythonでは、インターフェース仕様の多くの利点は、コンポーネントへの適切なテス" "ト規律により得られます。" -#: ../../faq/design.rst:581 +#: ../../faq/design.rst:578 msgid "" "A good test suite for a module can both provide a regression test and serve " "as a module interface specification and a set of examples. Many Python " @@ -1197,25 +1074,24 @@ msgstr "" "`unittest` モジュール、あるいはサードパーティのテストフレームワークで、モ" "ジュールのコードの全ての行に及ぶ徹底的なテストスイートを構成できます。" -#: ../../faq/design.rst:589 +#: ../../faq/design.rst:586 msgid "" "An appropriate testing discipline can help build large complex applications " "in Python as well as having interface specifications would. In fact, it can " "be better because an interface specification cannot test certain properties " -"of a program. For example, the :meth:`!list.append` method is expected to " -"add new elements to the end of some internal list; an interface " -"specification cannot test that your :meth:`!list.append` implementation will " -"actually do this correctly, but it's trivial to check this property in a " -"test suite." +"of a program. For example, the :meth:`append` method is expected to add new " +"elements to the end of some internal list; an interface specification cannot " +"test that your :meth:`append` implementation will actually do this " +"correctly, but it's trivial to check this property in a test suite." msgstr "" "Python で大きくて複雑なアプリケーションを構築するとき、インターフェース仕様と" "同様に、適切なテスト規律も役立ちます。実際には、インターフェース仕様ではテス" "トできないプログラムの属性もあるので、それ以上にもなりえます。例えば、 :meth:" -"`!list.append` メソッドは新しい要素をある内部リストの終わりに加えます。イン" -"ターフェース仕様ではこの :meth:`!list.append` の実装が実際にこれを行うかをテ" -"ストできませんが、テストスイートならこの機能を簡単に確かめられます。" +"`append` メソッドは新しい要素をある内部リストの終わりに加えます。インター" +"フェース仕様ではこの :meth:`append` の実装が実際にこれを行うかをテストできま" +"せんが、テストスイートならこの機能を簡単に確かめられます。" -#: ../../faq/design.rst:597 +#: ../../faq/design.rst:594 msgid "" "Writing test suites is very helpful, and you might want to design your code " "to make it easily tested. One increasingly popular technique, test-driven " @@ -1229,67 +1105,52 @@ msgstr "" "ます。ご心配なく、Python は、あなたがいい加減でもテストケースを全く書かなくて" "も構いません。" -#: ../../faq/design.rst:605 +#: ../../faq/design.rst:602 msgid "Why is there no goto?" msgstr "なぜ goto が無いのですか?" -#: ../../faq/design.rst:607 +#: ../../faq/design.rst:604 msgid "" "In the 1970s people realized that unrestricted goto could lead to messy " "\"spaghetti\" code that was hard to understand and revise. In a high-level " "language, it is also unneeded as long as there are ways to branch (in " -"Python, with :keyword:`if` statements and :keyword:`or`, :keyword:`and`, " -"and :keyword:`if`/:keyword:`else` expressions) and loop (with :keyword:" -"`while` and :keyword:`for` statements, possibly containing :keyword:" -"`continue` and :keyword:`break`)." +"Python, with ``if`` statements and ``or``, ``and``, and ``if-else`` " +"expressions) and loop (with ``while`` and ``for`` statements, possibly " +"containing ``continue`` and ``break``)." msgstr "" "1970年代、人々は気付きました。秩序なき goto は、理解するのも手直しするのも困" "難という厄介な\"スパゲッティ\"コードに陥りがちであると。\n" "高水準言語では、分岐とループの手段があれば goto は不要です。\n" -"(Pythonだと、分岐には :keyword:`if` 文及び :keyword:`or` ・ :keyword:`and` " -"・ :keyword:`if`/:keyword:`else` 式を使います。ループには :keyword:`while` 文" -"と :keyword:`for` 文を使い、 ループ内に :keyword:`continue` ・ :keyword:" -"`break` を含むことがあります)" +"(Pythonだと、分岐には ``if`` 節及び ``or`` ・ ``and`` ・ ``if-else`` 式を使い" +"ます。ループには ``while`` 節と ``for`` 節を使い、 ループ内に ``continue`` " +"・ ``break`` を含むことがあります)" -#: ../../faq/design.rst:614 +#: ../../faq/design.rst:611 msgid "" "One can also use exceptions to provide a \"structured goto\" that works even " "across function calls. Many feel that exceptions can conveniently emulate " -"all reasonable uses of the ``go`` or ``goto`` constructs of C, Fortran, and " +"all reasonable uses of the \"go\" or \"goto\" constructs of C, Fortran, and " "other languages. For example::" msgstr "" "関数の呼び出しをまたいでも動作する \"構造化された goto\" をまかなうものとして" -"例外を使えます。C、Fortran、その他の言語での ``go`` あるいは ``goto`` 構造の" -"適切な用途は全て、例外で同じようなことをすれば便利であると、広く感じられてい" -"ます。例えば::" +"例外を使えます。C、Fortran、その他の言語での \"go\" あるいは \"goto\" 構造の" +"適切な用途は全て、例外で同じようなことををすれば便利であると、広く感じられて" +"います。例えば::" -#: ../../faq/design.rst:620 -msgid "" -"class label(Exception): pass # declare a label\n" -"\n" -"try:\n" -" ...\n" -" if condition: raise label() # goto label\n" -" ...\n" -"except label: # where to goto\n" -" pass\n" -"..." -msgstr "" - -#: ../../faq/design.rst:630 +#: ../../faq/design.rst:627 msgid "" "This doesn't allow you to jump into the middle of a loop, but that's usually " -"considered an abuse of ``goto`` anyway. Use sparingly." +"considered an abuse of goto anyway. Use sparingly." msgstr "" -"例外ではループ内へ跳ぶことはできませんが、どちらにしてもそれは ``goto`` の乱" -"用と見なされるものです。使うのは控えてください。" +"例外ではループ内へ跳ぶことはできませんが、どちらにしてもそれは goto の乱用と" +"見なされるものです。使うのは控えてください。" -#: ../../faq/design.rst:635 +#: ../../faq/design.rst:632 msgid "Why can't raw strings (r-strings) end with a backslash?" msgstr "" "なぜ raw 文字列 (r-strings) はバックスラッシュで終わってはいけないのですか?" -#: ../../faq/design.rst:637 +#: ../../faq/design.rst:634 msgid "" "More precisely, they can't end with an odd number of backslashes: the " "unpaired backslash at the end escapes the closing quote character, leaving " @@ -1299,7 +1160,7 @@ msgstr "" "いないバックスラッシュは、閉じ引用文字をエスケープし、終っていない文字列を残" "してしまいます。" -#: ../../faq/design.rst:641 +#: ../../faq/design.rst:638 msgid "" "Raw strings were designed to ease creating input for processors (chiefly " "regular expression engines) that want to do their own backslash escape " @@ -1315,7 +1176,7 @@ msgstr "" "ことで、引用文字を文字列として渡すことができます。r-string が意図された目的に" "使われるときに、この規則が役に立つのです。" -#: ../../faq/design.rst:648 +#: ../../faq/design.rst:645 msgid "" "If you're trying to build Windows pathnames, note that all Windows system " "calls accept forward slashes too::" @@ -1323,50 +1184,32 @@ msgstr "" "Windows のパス名を構築するときには、Windows のシステムコールは普通のスラッ" "シュも受け付けることを憶えておいてください::" -#: ../../faq/design.rst:651 -msgid "f = open(\"/mydir/file.txt\") # works fine!" -msgstr "" - -#: ../../faq/design.rst:653 +#: ../../faq/design.rst:650 msgid "" "If you're trying to build a pathname for a DOS command, try e.g. one of ::" msgstr "" "DOS コマンドのパス名を構築するときには、例えばこの中のどれかを試してくださ" "い::" -#: ../../faq/design.rst:655 -msgid "" -"dir = r\"\\this\\is\\my\\dos\\dir\" \"\\\\\"\n" -"dir = r\"\\this\\is\\my\\dos\\dir\\ \"[:-1]\n" -"dir = \"\\\\this\\\\is\\\\my\\\\dos\\\\dir\\\\\"" -msgstr "" - -#: ../../faq/design.rst:661 +#: ../../faq/design.rst:658 msgid "Why doesn't Python have a \"with\" statement for attribute assignments?" msgstr "属性の代入に \"with\" 文が使えないのはなぜですか?" -#: ../../faq/design.rst:663 +#: ../../faq/design.rst:660 msgid "" -"Python has a :keyword:`with` statement that wraps the execution of a block, " -"calling code on the entrance and exit from the block. Some languages have a " +"Python has a 'with' statement that wraps the execution of a block, calling " +"code on the entrance and exit from the block. Some languages have a " "construct that looks like this::" msgstr "" -"Python には、ブロックの実行を包む :keyword:`with` 文があり、ブロックに入ると" -"きとブロックから出るときに、コードを呼び出します。以下のような構造を持つ言語" -"があります::" - -#: ../../faq/design.rst:667 -msgid "" -"with obj:\n" -" a = 1 # equivalent to obj.a = 1\n" -" total = total + 1 # obj.total = obj.total + 1" -msgstr "" +"Python には、ブロックの実行を包む 'with' 文があり、ブロックに入るときとブロッ" +"クから出るときに、コードを呼び出します。以下のような構造を持つ言語がありま" +"す::" -#: ../../faq/design.rst:671 +#: ../../faq/design.rst:668 msgid "In Python, such a construct would be ambiguous." msgstr "Python では、このような構造は曖昧になるでしょう。" -#: ../../faq/design.rst:673 +#: ../../faq/design.rst:670 msgid "" "Other languages, such as Object Pascal, Delphi, and C++, use static types, " "so it's possible to know, in an unambiguous way, what member is being " @@ -1377,7 +1220,7 @@ msgstr "" "法でも、どのメンバに代入されているのか分かります。これが静的型付けの要点です " "-- コンパイラは *いつでも* コンパイル時にすべての変数のスコープを知るのです。" -#: ../../faq/design.rst:678 +#: ../../faq/design.rst:675 msgid "" "Python uses dynamic types. It is impossible to know in advance which " "attribute will be referenced at runtime. Member attributes may be added or " @@ -1390,61 +1233,39 @@ msgstr "" "に読むだけではどのアトリビュートが参照されているか分かりません。ローカルなの" "か、グローバルなのか、メンバ属性なのか?" -#: ../../faq/design.rst:684 +#: ../../faq/design.rst:681 msgid "For instance, take the following incomplete snippet::" msgstr "例えば、以下の不完全なコード片を考えましょう::" -#: ../../faq/design.rst:686 +#: ../../faq/design.rst:687 msgid "" -"def foo(a):\n" -" with a:\n" -" print(x)" -msgstr "" - -#: ../../faq/design.rst:690 -msgid "" -"The snippet assumes that ``a`` must have a member attribute called ``x``. " +"The snippet assumes that \"a\" must have a member attribute called \"x\". " "However, there is nothing in Python that tells the interpreter this. What " -"should happen if ``a`` is, let us say, an integer? If there is a global " -"variable named ``x``, will it be used inside the :keyword:`with` block? As " -"you see, the dynamic nature of Python makes such choices much harder." +"should happen if \"a\" is, let us say, an integer? If there is a global " +"variable named \"x\", will it be used inside the with block? As you see, " +"the dynamic nature of Python makes such choices much harder." msgstr "" -"このコード片では、``a`` は ``x``. というメンバ属性を持っていると仮定されてい" -"ます。しかし、Python ではインタプリタにはこの仮定を伝えられる仕組みはありませ" -"ん。 ``a`` が、例えば整数だったら、どうなってしまうでしょうか。 ``x`` という" -"名前のグローバル変数があったら、それが :keyword:`with` ブロックの中で使われる" -"のでしょうか。この通り、Python の動的な特質から、このような選択はとても難しい" -"物になっています。" +"このコード片では、\"a\" は \"x\" というメンバ属性を持っていると仮定されていま" +"す。しかし、Python ではインタプリタにはこの仮定を伝えられる仕組みはありませ" +"ん。 \"a\" が、例えば整数だったら、どうなってしまうでしょうか。 \"x\" という" +"名前のグローバル変数があったら、それが with ブロックの中で使われるのでしょう" +"か。この通り、Python の動的な特質から、このような選択はとても難しい物になって" +"います。" -#: ../../faq/design.rst:696 +#: ../../faq/design.rst:693 msgid "" -"The primary benefit of :keyword:`with` and similar language features " -"(reduction of code volume) can, however, easily be achieved in Python by " -"assignment. Instead of::" +"The primary benefit of \"with\" and similar language features (reduction of " +"code volume) can, however, easily be achieved in Python by assignment. " +"Instead of::" msgstr "" -"しかし、:keyword:`with` やそれに類する言語の機能の一番の利点 (コード量の削" -"減) は、 Python では代入により簡単に手に入れられます::" +"しかし、\"with\" やそれに類する言語の機能の一番の利点 (コード量の削減) は、 " +"Python では代入により簡単に手に入れられます::" -#: ../../faq/design.rst:699 -msgid "" -"function(args).mydict[index][index].a = 21\n" -"function(args).mydict[index][index].b = 42\n" -"function(args).mydict[index][index].c = 63" -msgstr "" - -#: ../../faq/design.rst:703 +#: ../../faq/design.rst:700 msgid "write this::" msgstr "こう書いてください::" -#: ../../faq/design.rst:705 -msgid "" -"ref = function(args).mydict[index][index]\n" -"ref.a = 21\n" -"ref.b = 42\n" -"ref.c = 63" -msgstr "" - -#: ../../faq/design.rst:710 +#: ../../faq/design.rst:707 msgid "" "This also has the side-effect of increasing execution speed because name " "bindings are resolved at run-time in Python, and the second version only " @@ -1453,62 +1274,34 @@ msgstr "" "Python では実行時に名前束縛が解決され、後者はその解決が一度で済むため、これに" "は実行速度をあげる副作用もあります。" -#: ../../faq/design.rst:714 -msgid "" -"Similar proposals that would introduce syntax to further reduce code volume, " -"such as using a 'leading dot', have been rejected in favour of explicitness " -"(see https://mail.python.org/pipermail/python-ideas/2016-May/040070.html)." -msgstr "" -"似た提案として、「先頭のドット」を使うなどして さらにコード量を減らす構文は、" -"明白さを優先をして却下されました (https://mail.python.org/pipermail/python-" -"ideas/2016-May/040070.html 参照)。" - -#: ../../faq/design.rst:720 +#: ../../faq/design.rst:713 msgid "Why don't generators support the with statement?" msgstr "なぜジェネレータは with 文をサポートしないのですか?" -#: ../../faq/design.rst:722 +#: ../../faq/design.rst:715 msgid "" "For technical reasons, a generator used directly as a context manager would " "not work correctly. When, as is most common, a generator is used as an " -"iterator run to completion, no closing is needed. When it is, wrap it as :" -"func:`contextlib.closing(generator) ` in the :keyword:" -"`with` statement." -msgstr "" -"技術的な理由で、ジェネレータは直接コンテキストマネージャとして使ってもうまく" -"動きません。最も一般的なように、ジェネレータが最後まで回りきるイテレータとし" -"て使われる場合、クローズ処理は不要です。必要な場合は、 :keyword:`with` 文で :" -"func:`contextlib.closing(generator) ` のようにラップしま" -"す。" +"iterator run to completion, no closing is needed. When it is, wrap it as " +"\"contextlib.closing(generator)\" in the 'with' statment." +msgstr "" -#: ../../faq/design.rst:730 +#: ../../faq/design.rst:722 msgid "Why are colons required for the if/while/def/class statements?" msgstr "if/while/def/class 文にコロンが必要なのはなぜですか?" -#: ../../faq/design.rst:732 +#: ../../faq/design.rst:724 msgid "" "The colon is required primarily to enhance readability (one of the results " "of the experimental ABC language). Consider this::" msgstr "" "主に可読性を高めるため (実験的な ABC 言語の結果の一つ) に、コロンが必要です::" -#: ../../faq/design.rst:735 -msgid "" -"if a == b\n" -" print(a)" -msgstr "" - -#: ../../faq/design.rst:738 +#: ../../faq/design.rst:730 msgid "versus ::" msgstr "と::" -#: ../../faq/design.rst:740 -msgid "" -"if a == b:\n" -" print(a)" -msgstr "" - -#: ../../faq/design.rst:743 +#: ../../faq/design.rst:735 msgid "" "Notice how the second one is slightly easier to read. Notice further how a " "colon sets off the example in this FAQ answer; it's a standard usage in " @@ -1517,7 +1310,7 @@ msgstr "" "を考えれば、後者のほうが少し読みやすいでしょう。さらに言えば、この FAQ の解答" "例は次のようになるでしょう。これは、英語の標準的な用法です。" -#: ../../faq/design.rst:746 +#: ../../faq/design.rst:738 msgid "" "Another minor reason is that the colon makes it easier for editors with " "syntax highlighting; they can look for colons to decide when indentation " @@ -1528,11 +1321,11 @@ msgstr "" "ることです。プログラムテキストの手の込んだ解析をしなくても、コロンを探せばい" "つインデントを増やすべきかを決められます。" -#: ../../faq/design.rst:752 +#: ../../faq/design.rst:744 msgid "Why does Python allow commas at the end of lists and tuples?" msgstr "なぜ Python ではリストやタプルの最後にカンマがあっても良いのですか?" -#: ../../faq/design.rst:754 +#: ../../faq/design.rst:746 msgid "" "Python lets you add a trailing comma at the end of lists, tuples, and " "dictionaries::" @@ -1541,20 +1334,10 @@ msgstr "" "になっています::" #: ../../faq/design.rst:757 -msgid "" -"[1, 2, 3,]\n" -"('a', 'b', 'c',)\n" -"d = {\n" -" \"A\": [1, 5],\n" -" \"B\": [6, 7], # last trailing comma is optional but good style\n" -"}" -msgstr "" - -#: ../../faq/design.rst:765 msgid "There are several reasons to allow this." msgstr "これを許すのには、いくつかの理由があります。" -#: ../../faq/design.rst:767 +#: ../../faq/design.rst:759 msgid "" "When you have a literal value for a list, tuple, or dictionary spread across " "multiple lines, it's easier to add more elements because you don't have to " @@ -1565,24 +1348,14 @@ msgstr "" "加するのを覚えておく必要が無いため、要素を追加するのが楽になります。また、文" "法エラーを起こすこと無く、行の並べ替えを行うことができます。" -#: ../../faq/design.rst:772 +#: ../../faq/design.rst:764 msgid "" "Accidentally omitting the comma can lead to errors that are hard to " "diagnose. For example::" msgstr "" "間違えてカンマを落としてしまうと、診断しづらいエラーにつながります。例えば::" -#: ../../faq/design.rst:775 -msgid "" -"x = [\n" -" \"fee\",\n" -" \"fie\"\n" -" \"foo\",\n" -" \"fum\"\n" -"]" -msgstr "" - -#: ../../faq/design.rst:782 +#: ../../faq/design.rst:774 msgid "" "This list looks like it has four elements, but it actually contains three: " "\"fee\", \"fiefoo\" and \"fum\". Always adding the comma avoids this source " @@ -1592,7 +1365,7 @@ msgstr "" "\"fee\"、\"fiefoo\"、\"fum\" です。\n" "常にカンマを付けるようにすれば、この種のエラーが避けられます。" -#: ../../faq/design.rst:785 +#: ../../faq/design.rst:777 msgid "" "Allowing the trailing comma may also make programmatic code generation " "easier." diff --git a/faq/extending.po b/faq/extending.po index bde7f1b71..b72773983 100644 --- a/faq/extending.po +++ b/faq/extending.po @@ -1,29 +1,31 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 -# mollinaca, 2021 -# Shin Saito, 2021 -# 菊池 健志, 2023 -# Arihiro TAKASE, 2023 +# Nozomu Kaneko , 2017 +# 秘湯 , 2017 +# Osamu NAKAMURA, 2018 +# Arihiro TAKASE, 2018 +# Hiroyuki Kurosawa , 2019 +# tomo, 2019 +# mollinaca, 2020 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-30 14:22+0000\n" -"PO-Revision-Date: 2021-06-28 00:52+0000\n" -"Last-Translator: Arihiro TAKASE, 2023\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 17:43+0000\n" +"Last-Translator: mollinaca, 2020\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../faq/extending.rst:3 @@ -74,16 +76,45 @@ msgstr "C を書くのは大変です。他の方法はありませんか?" #: ../../faq/extending.rst:39 msgid "" "There are a number of alternatives to writing your own C extensions, " -"depending on what you're trying to do. :ref:`Recommended third party tools " -"` offer both simpler and more sophisticated approaches to " -"creating C and C++ extensions for Python." -msgstr "" - -#: ../../faq/extending.rst:46 +"depending on what you're trying to do." +msgstr "独自の C 拡張を書くための別のやり方は、目的によっていくつかあります。" + +#: ../../faq/extending.rst:44 +msgid "" +"`Cython `_ and its relative `Pyrex `_ are compilers that accept a " +"slightly modified form of Python and generate the corresponding C code. " +"Cython and Pyrex make it possible to write an extension without having to " +"learn Python's C API." +msgstr "" +"`Cython `_ とその親戚 `Pyrex `_ は、わずかに変形した Python を受け取り、対" +"応する C コードを生成します。Cython や Pyrex を使えば Python の C API を習得" +"することなく拡張を書けます。" + +#: ../../faq/extending.rst:50 +msgid "" +"If you need to interface to some C or C++ library for which no Python " +"extension currently exists, you can try wrapping the library's data types " +"and functions with a tool such as `SWIG `_. `SIP " +"`__, `CXX `_ `Boost `_, or `Weave `_ are also alternatives " +"for wrapping C++ libraries." +msgstr "" +"今のところ Python 拡張が存在しないような C や C++ ライブラリへのインターフェ" +"イスが必要な場合、`SWIG `_ のようなツールで、そのライブ" +"ラリのデータ型のラッピングを図れます。\n" +"`SIP `_、`CXX `_、`Boost `_、`Weave `_ でも C++ ライブラリをラッ" +"ピングできます。" + +#: ../../faq/extending.rst:61 msgid "How can I execute arbitrary Python statements from C?" msgstr "C から任意の Python 文を実行するにはどうしますか?" -#: ../../faq/extending.rst:48 +#: ../../faq/extending.rst:63 msgid "" "The highest-level function to do this is :c:func:`PyRun_SimpleString` which " "takes a single string argument to be executed in the context of the module " @@ -98,11 +129,11 @@ msgstr "" "制御したければ、 :c:func:`PyRun_String` を使ってください。ソースは ``Python/" "pythonrun.c`` の ':c:func:`PyRun_SimpleString` を参照してください。" -#: ../../faq/extending.rst:57 +#: ../../faq/extending.rst:72 msgid "How can I evaluate an arbitrary Python expression from C?" msgstr "C から任意の Python 式を評価するにはどうしますか?" -#: ../../faq/extending.rst:59 +#: ../../faq/extending.rst:74 msgid "" "Call the function :c:func:`PyRun_String` from the previous question with the " "start symbol :c:data:`Py_eval_input`; it parses an expression, evaluates it " @@ -112,15 +143,15 @@ msgstr "" "`Py_eval_input` を渡して呼び出してください。これは式を解析し、評価してその値" "を返します。" -#: ../../faq/extending.rst:65 +#: ../../faq/extending.rst:80 msgid "How do I extract C values from a Python object?" msgstr "Python オブジェクトから C の値を取り出すにはどうしますか?" -#: ../../faq/extending.rst:67 +#: ../../faq/extending.rst:82 msgid "" "That depends on the object's type. If it's a tuple, :c:func:`PyTuple_Size` " "returns its length and :c:func:`PyTuple_GetItem` returns the item at a " -"specified index. Lists have similar functions, :c:func:`PyList_Size` and :c:" +"specified index. Lists have similar functions, :c:func:`PyListSize` and :c:" "func:`PyList_GetItem`." msgstr "" "オブジェクトの型に依ります。タプルなら、 :c:func:`PyTuple_Size` が長さを返" @@ -128,19 +159,19 @@ msgstr "" "トにも同様の関数 :c:func:`PyList_Size` と :c:func:`PyList_GetItem` がありま" "す。" -#: ../../faq/extending.rst:72 +#: ../../faq/extending.rst:87 msgid "" "For bytes, :c:func:`PyBytes_Size` returns its length and :c:func:" "`PyBytes_AsStringAndSize` provides a pointer to its value and its length. " -"Note that Python bytes objects may contain null bytes so C's :c:func:`!" -"strlen` should not be used." +"Note that Python bytes objects may contain null bytes so C's :c:func:" +"`strlen` should not be used." msgstr "" "bytes では、 :c:func:`PyBytes_Size` がその長さを返し、 :c:func:" "`PyBytes_AsStringAndSize` がその値へのポインタと長さを提供します。 Python の " -"bytes オブジェクトは null を含むこともできるので、 C の :c:func:`!strlen` を" -"使うべきではないことに注意してください。" +"bytes オブジェクトは null を含むこともできるので、 C の :c:func:`strlen` を使" +"うべきではないことに注意してください。" -#: ../../faq/extending.rst:77 +#: ../../faq/extending.rst:92 msgid "" "To test the type of an object, first make sure it isn't ``NULL``, and then " "use :c:func:`PyBytes_Check`, :c:func:`PyTuple_Check`, :c:func:" @@ -150,7 +181,7 @@ msgstr "" "た上で、 :c:func:`PyBytes_Check` 、 :c:func:`PyTuple_Check` 、 :c:func:" "`PyList_Check` などを使います。" -#: ../../faq/extending.rst:80 +#: ../../faq/extending.rst:95 msgid "" "There is also a high-level API to Python objects which is provided by the so-" "called 'abstract' interface -- read ``Include/abstract.h`` for further " @@ -166,19 +197,19 @@ msgstr "" "func:`PySequence_Length` や :c:func:`PySequence_GetItem` などの任意の種類の " "Python シーケンスへのインターフェースにアクセスできます。" -#: ../../faq/extending.rst:89 +#: ../../faq/extending.rst:104 msgid "How do I use Py_BuildValue() to create a tuple of arbitrary length?" msgstr "Py_BuildValue() で任意長のタプルを作るにはどうしますか?" -#: ../../faq/extending.rst:91 +#: ../../faq/extending.rst:106 msgid "You can't. Use :c:func:`PyTuple_Pack` instead." msgstr "できません。代わりに :c:func:`PyTuple_Pack` を使ってください。" -#: ../../faq/extending.rst:95 +#: ../../faq/extending.rst:110 msgid "How do I call an object's method from C?" msgstr "C からオブジェクトのメソッドを呼び出すにはどうしますか?" -#: ../../faq/extending.rst:97 +#: ../../faq/extending.rst:112 msgid "" "The :c:func:`PyObject_CallMethod` function can be used to call an arbitrary " "method of an object. The parameters are the object, the name of the method " @@ -189,14 +220,7 @@ msgstr "" "す。パラメタは、オブジェクト、呼び出すメソッドの名前、 :c:func:" "`Py_BuildValue` で使われるようなフォーマット文字列、そして引数です::" -#: ../../faq/extending.rst:102 -msgid "" -"PyObject *\n" -"PyObject_CallMethod(PyObject *object, const char *method_name,\n" -" const char *arg_format, ...);" -msgstr "" - -#: ../../faq/extending.rst:106 +#: ../../faq/extending.rst:121 msgid "" "This works for any object that has methods -- whether built-in or user-" "defined. You are responsible for eventually :c:func:`Py_DECREF`\\ 'ing the " @@ -206,7 +230,7 @@ msgstr "" "関係ありません。返り値に対して :c:func:`Py_DECREF` する必要があることもありま" "す。" -#: ../../faq/extending.rst:109 +#: ../../faq/extending.rst:124 msgid "" "To call, e.g., a file object's \"seek\" method with arguments 10, 0 " "(assuming the file object pointer is \"f\")::" @@ -214,18 +238,7 @@ msgstr "" "例えば、あるファイルオブジェクトの \"seek\" メソッドを 10, 0 を引数として呼ぶ" "とき (ファイルオブジェクトのポインタを \"f\" とします)::" -#: ../../faq/extending.rst:112 -msgid "" -"res = PyObject_CallMethod(f, \"seek\", \"(ii)\", 10, 0);\n" -"if (res == NULL) {\n" -" ... an exception occurred ...\n" -"}\n" -"else {\n" -" Py_DECREF(res);\n" -"}" -msgstr "" - -#: ../../faq/extending.rst:120 +#: ../../faq/extending.rst:135 msgid "" "Note that since :c:func:`PyObject_CallObject` *always* wants a tuple for the " "argument list, to call a function without arguments, pass \"()\" for the " @@ -236,7 +249,7 @@ msgstr "" "す。関数を引数なしで呼び出すには、フォーマットに \"()\" を渡し、関数を一つの" "引数で呼び出すには、関数を括弧でくくって例えば \"(i)\" としてください。" -#: ../../faq/extending.rst:127 +#: ../../faq/extending.rst:142 msgid "" "How do I catch the output from PyErr_Print() (or anything that prints to " "stdout/stderr)?" @@ -244,7 +257,7 @@ msgstr "" "PyErr_Print() (その他 stdout/stderr に印字するもの) からの出力を受け取るには" "どうしますか?" -#: ../../faq/extending.rst:129 +#: ../../faq/extending.rst:144 msgid "" "In Python code, define an object that supports the ``write()`` method. " "Assign this object to :data:`sys.stdout` and :data:`sys.stderr`. Call " @@ -256,56 +269,23 @@ msgstr "" "してください。print_error を呼び出すか、単に標準のトレースバック機構を作動さ" "せてください。そうすれば、出力は ``write()`` が送る任意の所に行きます。" -#: ../../faq/extending.rst:134 +#: ../../faq/extending.rst:149 msgid "The easiest way to do this is to use the :class:`io.StringIO` class:" msgstr "最も簡単な方法は、 :class:`io.StringIO` クラスを使うことです:" -#: ../../faq/extending.rst:136 -msgid "" -">>> import io, sys\n" -">>> sys.stdout = io.StringIO()\n" -">>> print('foo')\n" -">>> print('hello world!')\n" -">>> sys.stderr.write(sys.stdout.getvalue())\n" -"foo\n" -"hello world!" -msgstr "" - -#: ../../faq/extending.rst:146 +#: ../../faq/extending.rst:161 msgid "A custom object to do the same would look like this:" msgstr "これと同じことをするカスタムオブジェクトは次のようになるでしょう:" -#: ../../faq/extending.rst:148 -msgid "" -">>> import io, sys\n" -">>> class StdoutCatcher(io.TextIOBase):\n" -"... def __init__(self):\n" -"... self.data = []\n" -"... def write(self, stuff):\n" -"... self.data.append(stuff)\n" -"...\n" -">>> import sys\n" -">>> sys.stdout = StdoutCatcher()\n" -">>> print('foo')\n" -">>> print('hello world!')\n" -">>> sys.stderr.write(''.join(sys.stdout.data))\n" -"foo\n" -"hello world!" -msgstr "" - -#: ../../faq/extending.rst:167 +#: ../../faq/extending.rst:182 msgid "How do I access a module written in Python from C?" msgstr "C から Python で書かれたモジュールにアクセスするにはどうしますか?" -#: ../../faq/extending.rst:169 +#: ../../faq/extending.rst:184 msgid "You can get a pointer to the module object as follows::" msgstr "以下のようにモジュールオブジェクトへのポインタを得られます::" -#: ../../faq/extending.rst:171 -msgid "module = PyImport_ImportModule(\"\");" -msgstr "" - -#: ../../faq/extending.rst:173 +#: ../../faq/extending.rst:188 msgid "" "If the module hasn't been imported yet (i.e. it is not yet present in :data:" "`sys.modules`), this initializes the module; otherwise it simply returns the " @@ -319,7 +299,7 @@ msgstr "" "かなる名前空間にも代入しません。これはモジュールが初期化されて ':data:`sys." "modules` に保管されていることを保証するだけです。" -#: ../../faq/extending.rst:179 +#: ../../faq/extending.rst:194 msgid "" "You can then access the module's attributes (i.e. any name defined in the " "module) as follows::" @@ -327,11 +307,7 @@ msgstr "" "これで、モジュールの属性 (つまり、モジュールで定義された任意の名前) に以下の" "ようにアクセスできるようになります::" -#: ../../faq/extending.rst:182 -msgid "attr = PyObject_GetAttrString(module, \"\");" -msgstr "" - -#: ../../faq/extending.rst:184 +#: ../../faq/extending.rst:199 msgid "" "Calling :c:func:`PyObject_SetAttrString` to assign to variables in the " "module also works." @@ -339,11 +315,11 @@ msgstr "" ":c:func:`PyObject_SetAttrString` を呼んでモジュールの変数に代入することもでき" "ます。" -#: ../../faq/extending.rst:189 +#: ../../faq/extending.rst:204 msgid "How do I interface to C++ objects from Python?" msgstr "Python から C++ へインターフェースするにはどうしますか?" -#: ../../faq/extending.rst:191 +#: ../../faq/extending.rst:206 msgid "" "Depending on your requirements, there are many approaches. To do this " "manually, begin by reading :ref:`the \"Extending and Embedding\" document " @@ -358,18 +334,18 @@ msgstr "" "ら、C 構造体 (ポインタ)型に基づいて新しい Python の型を構築する方針は C++ オ" "ブジェクトに対しても有効です。" -#: ../../faq/extending.rst:197 +#: ../../faq/extending.rst:212 msgid "For C++ libraries, see :ref:`c-wrapper-software`." msgstr "" "C++ ライブラリに関しては、 :ref:`c-wrapper-software` を参照してください。" -#: ../../faq/extending.rst:201 +#: ../../faq/extending.rst:216 msgid "I added a module using the Setup file and the make fails; why?" msgstr "" "セットアップファイルでモジュールを追加しようとしたらメイクに失敗しました。な" "ぜですか?" -#: ../../faq/extending.rst:203 +#: ../../faq/extending.rst:218 msgid "" "Setup must end in a newline, if there is no newline there, the build process " "fails. (Fixing this requires some ugly shell script hackery, and this bug " @@ -379,11 +355,11 @@ msgstr "" "します。(これを直すには、ある種の醜いシェルスクリプトハックが必要ですが、この" "バグは小さいものですから努力に見合う価値はないでしょう。)" -#: ../../faq/extending.rst:209 +#: ../../faq/extending.rst:224 msgid "How do I debug an extension?" msgstr "拡張をデバッグするにはどうしますか?" -#: ../../faq/extending.rst:211 +#: ../../faq/extending.rst:226 msgid "" "When using GDB with dynamically loaded extensions, you can't set a " "breakpoint in your extension until your extension is loaded." @@ -391,29 +367,15 @@ msgstr "" "動的にロードされた拡張に GDB を使うとき、拡張がロードされるまでブレークポイン" "トを設定してはいけません。" -#: ../../faq/extending.rst:214 +#: ../../faq/extending.rst:229 msgid "In your ``.gdbinit`` file (or interactively), add the command:" msgstr "``.gdbinit`` ファイルに(または対話的に)、このコマンドを加えてください:" -#: ../../faq/extending.rst:216 -msgid "br _PyImport_LoadDynamicModule" -msgstr "" - -#: ../../faq/extending.rst:220 +#: ../../faq/extending.rst:235 msgid "Then, when you run GDB:" msgstr "そして、GDB を起動するときに:" -#: ../../faq/extending.rst:222 -msgid "" -"$ gdb /local/bin/python\n" -"gdb) run myscript.py\n" -"gdb) continue # repeat until your extension is loaded\n" -"gdb) finish # so that your extension is loaded\n" -"gdb) br myfunction.c:50\n" -"gdb) continue" -msgstr "" - -#: ../../faq/extending.rst:232 +#: ../../faq/extending.rst:247 msgid "" "I want to compile a Python module on my Linux system, but some files are " "missing. Why?" @@ -421,27 +383,32 @@ msgstr "" "Linux システムで Python モジュールをコンパイルしたいのですが、見つからない" "ファイルがあります。なぜですか?" -#: ../../faq/extending.rst:234 +#: ../../faq/extending.rst:249 msgid "" -"Most packaged versions of Python omit some files required for compiling " +"Most packaged versions of Python don't include the :file:`/usr/lib/python2." +"{x}/config/` directory, which contains various files required for compiling " "Python extensions." msgstr "" +"Python の多くのパッケージバージョンには、Python 拡張をコンパイルするのに必要" +"な様々なファイルを含む :file:`/usr/lib/python2.{x}/config/` ディレクトリが含" +"まれていません。" -#: ../../faq/extending.rst:237 -msgid "For Red Hat, install the python3-devel RPM to get the necessary files." +#: ../../faq/extending.rst:253 +msgid "For Red Hat, install the python-devel RPM to get the necessary files." msgstr "" +"Red Hat では、Python RPM をインストールして必要なファイルを得てください。" -#: ../../faq/extending.rst:239 -msgid "For Debian, run ``apt-get install python3-dev``." -msgstr "" +#: ../../faq/extending.rst:255 +msgid "For Debian, run ``apt-get install python-dev``." +msgstr "Debian では、 ``apt-get install python-dev`` を実行してください。" -#: ../../faq/extending.rst:242 +#: ../../faq/extending.rst:259 msgid "How do I tell \"incomplete input\" from \"invalid input\"?" msgstr "" "\"不完全 (incomplete) な入力\" を \"不適切 (invalid) な入力\" から区別するに" "はどうしますか?" -#: ../../faq/extending.rst:244 +#: ../../faq/extending.rst:261 msgid "" "Sometimes you want to emulate the Python interactive interpreter's behavior, " "where it gives you a continuation prompt when the input is incomplete (e.g. " @@ -454,7 +421,7 @@ msgstr "" "は継続プロンプトを与えられますが、入力が不適切であるときには即座に構文エラー" "メッセージが与えられます。このようなふるまいを模倣したいことがあります。" -#: ../../faq/extending.rst:250 +#: ../../faq/extending.rst:267 msgid "" "In Python you can use the :mod:`codeop` module, which approximates the " "parser's behavior sufficiently. IDLE uses this, for example." @@ -462,7 +429,7 @@ msgstr "" "Python では構文解析器のふるまいに十分に近い :mod:`codeop` モジュールが使えま" "す。例えば IDLE がこれを使っています。" -#: ../../faq/extending.rst:253 +#: ../../faq/extending.rst:270 msgid "" "The easiest way to do it in C is to call :c:func:`PyRun_InteractiveLoop` " "(perhaps in a separate thread) and let the Python interpreter handle the " @@ -476,13 +443,50 @@ msgstr "" "定することもできます。詳しいヒントは、 ``Modules/readline.c`` や ``Parser/" "myreadline.c`` を参照してください。" -#: ../../faq/extending.rst:260 +#: ../../faq/extending.rst:276 +msgid "" +"However sometimes you have to run the embedded Python interpreter in the " +"same thread as your rest application and you can't allow the :c:func:" +"`PyRun_InteractiveLoop` to stop while waiting for user input. The one " +"solution then is to call :c:func:`PyParser_ParseString` and test for ``e." +"error`` equal to ``E_EOF``, which means the input is incomplete. Here's a " +"sample code fragment, untested, inspired by code from Alex Farber::" +msgstr "" +"しかし、組み込みの Python インタープリタを他のアプリケーションと同じスレッド" +"で実行することが必要で、 :c:func:`PyRun_InteractiveLoop` でユーザの入力を待っ" +"ている間止められないこともあります。このような場合の解決策の一つは、 :c:func:" +"`PyParser_ParseString` を呼んで ``e.error`` と ``E_EOF`` が等しいこと、つまり" +"入力が不完全であることを確かめることです。これは、Alex Farber のコードを参考" +"にした、未テストのサンプルコード片です::" + +#: ../../faq/extending.rst:310 +msgid "" +"Another solution is trying to compile the received string with :c:func:" +"`Py_CompileString`. If it compiles without errors, try to execute the " +"returned code object by calling :c:func:`PyEval_EvalCode`. Otherwise save " +"the input for later. If the compilation fails, find out if it's an error or " +"just more input is required - by extracting the message string from the " +"exception tuple and comparing it to the string \"unexpected EOF while " +"parsing\". Here is a complete example using the GNU readline library (you " +"may want to ignore **SIGINT** while calling readline())::" +msgstr "" +"別の解決策は、受け取られた文字列を :c:func:`Py_CompileString` でコンパイルす" +"ることを試みることです。エラー無くコンパイルされたら、返されたコードオブジェ" +"クトを :c:func:`PyEval_EvalCode` を呼んで実行することを試みてください。そうで" +"なければ、入力を後のために保存してください。コンパイルが失敗したなら、それが" +"エラーなのか入力の続きが求められているだけなのか調べてください。そのために" +"は、例外タプルからメッセージ文字列を展開し、それを文字列 \"unexpected EOF " +"while parsing\" と比較します。ここに GNU readline library を使った完全な例が" +"あります (readline() を読んでいる間は **SIGINT** を無視したいかもしれませ" +"ん)::" + +#: ../../faq/extending.rst:432 msgid "How do I find undefined g++ symbols __builtin_new or __pure_virtual?" msgstr "" "未定義の g++ シンボル __builtin_new や __pure_virtual を見つけるにはどうしま" "すか?" -#: ../../faq/extending.rst:262 +#: ../../faq/extending.rst:434 msgid "" "To dynamically load g++ extension modules, you must recompile Python, relink " "it using g++ (change LINKCC in the Python Modules Makefile), and link your " @@ -492,7 +496,7 @@ msgstr "" "再リンク (Python Modules Makefile 内の LINKCC を変更) し、拡張を g++ でリン" "ク (例えば ``g++ -shared -o mymodule.so mymodule.o``) しなければなりません。" -#: ../../faq/extending.rst:268 +#: ../../faq/extending.rst:440 msgid "" "Can I create an object class with some methods implemented in C and others " "in Python (e.g. through inheritance)?" @@ -500,7 +504,7 @@ msgstr "" "メソッドのいくつかは C で、その他は Python で実装されたオブジェクトクラスを " "(継承などで) 作ることはできますか?" -#: ../../faq/extending.rst:270 +#: ../../faq/extending.rst:442 msgid "" "Yes, you can inherit from built-in classes such as :class:`int`, :class:" "`list`, :class:`dict`, etc." @@ -508,12 +512,12 @@ msgstr "" "はい、 :class:`int` 、 :class:`list` 、 :class:`dict` などのビルトインクラス" "から継承できます。" -#: ../../faq/extending.rst:273 +#: ../../faq/extending.rst:445 msgid "" -"The Boost Python Library (BPL, https://www.boost.org/libs/python/doc/index." +"The Boost Python Library (BPL, http://www.boost.org/libs/python/doc/index." "html) provides a way of doing this from C++ (i.e. you can inherit from an " "extension class written in C++ using the BPL)." msgstr "" -"The Boost Python Library (BPL, https://www.boost.org/libs/python/doc/index." +"The Boost Python Library (BPL, http://www.boost.org/libs/python/doc/index." "html) を使えば、これを C++ からできます。 (すなわち、BPL を使って C++ で書か" "れた拡張クラスを継承できます)." diff --git a/faq/general.po b/faq/general.po index ba9a199c8..87a386a04 100644 --- a/faq/general.po +++ b/faq/general.po @@ -1,30 +1,33 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 +# Nozomu Kaneko , 2017 +# 秘湯 , 2017 +# E. Kawashima, 2017 +# tomo, 2018 +# Arihiro TAKASE, 2018 +# Hiroyuki Kurosawa , 2019 +# mollinaca, 2020 +# Mikami Akiko, 2021 # Osamu NAKAMURA, 2021 -# mollinaca, 2021 -# 菊池 健志, 2023 -# Arihiro TAKASE, 2023 -# TENMYO Masakazu, 2024 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:52+0000\n" -"Last-Translator: TENMYO Masakazu, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 17:43+0000\n" +"Last-Translator: Osamu NAKAMURA, 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../faq/general.rst:5 @@ -75,8 +78,8 @@ msgid "" "introductory tutorials and resources for learning Python." msgstr "" "さらに知りたければ、 :ref:`tutorial-index` から始めましょう。他にも、 " -"`Beginner's Guide to Python `_ " -"から、Python 学習のための入門用チュートリアルやリソースを参照できます。" +"`Beginner's Guide to Python `_ から、Python 学習のための入門用チュートリアル" +"やリソースを参照できます。" #: ../../faq/general.rst:34 msgid "What is the Python Software Foundation?" @@ -128,11 +131,11 @@ msgstr "" #: ../../faq/general.rst:57 msgid "" -"See `the license page `_ to find " -"further explanations and the full text of the PSF License." +"See `the PSF license page `_ to find " +"further explanations and a link to the full text of the license." msgstr "" -"PSF License のより詳しい説明と全文へのリンクは `the license page `_ を参照してください。" +"ライセンスのより詳しい説明と全文へのリンクは `the PSF license page `_ を参照してください。" #: ../../faq/general.rst:60 msgid "" @@ -248,104 +251,76 @@ msgstr "" msgid "" "The language comes with a large standard library that covers areas such as " "string processing (regular expressions, Unicode, calculating differences " -"between files), internet protocols (HTTP, FTP, SMTP, XML-RPC, POP, IMAP), " -"software engineering (unit testing, logging, profiling, parsing Python " -"code), and operating system interfaces (system calls, filesystems, TCP/IP " -"sockets). Look at the table of contents for :ref:`library-index` to get an " -"idea of what's available. A wide variety of third-party extensions are also " -"available. Consult `the Python Package Index `_ to find " -"packages of interest to you." +"between files), Internet protocols (HTTP, FTP, SMTP, XML-RPC, POP, IMAP, CGI " +"programming), software engineering (unit testing, logging, profiling, " +"parsing Python code), and operating system interfaces (system calls, " +"filesystems, TCP/IP sockets). Look at the table of contents for :ref:" +"`library-index` to get an idea of what's available. A wide variety of third-" +"party extensions are also available. Consult `the Python Package Index " +"`_ to find packages of interest to you." msgstr "" "この言語は、文字列処理(正規表現、Unicode、ファイル間の差分の計算)、インター" -"ネットプロトコル(HTTP、FTP、SMTP、XML-RPC、POP、IMAP)、ソフトウェアエンジニア" -"リング(Python コードのユニットテスト、ロギング、プロファイリング、解析)、オペ" -"レーティングシステムインターフェース(システムコール、ファイルシステム、 TCP/" -"IP ソケット) のような領域をカバーする大規模な標準ライブラリから成り立っていま" -"す。何ができるかを知るには :ref:`library-index` の一覧を参照してください。ま" -"た、様々なサードパーティの拡張も使えます。 `the Python Package Index " -"`_ から興味のあるパッケージを探してみましょう。" - -#: ../../faq/general.rst:128 +"ネットプロトコル(HTTP、FTP、SMTP、XML-RPC、POP、IMAP、 CGI プログラミング)、" +"ソフトウェアエンジニアリング(Python コードのユニットテスト、ロギング、プロ" +"ファイリング、解析)、オペレーティングシステムインターフェース(システムコー" +"ル、ファイルシステム、 TCP/IP ソケット) のような領域をカバーする大規模な標準" +"ライブラリから成り立っています。何ができるかを知るには :ref:`library-index` " +"の一覧を参照してください。また、様々なサードパーティの拡張も使えます。 `the " +"Python Package Index `_ から興味のあるパッケージを探してみ" +"ましょう。" + +#: ../../faq/general.rst:126 msgid "How does the Python version numbering scheme work?" msgstr "Python のバージョン番号の仕組みはどうなっているのですか?" -#: ../../faq/general.rst:130 -msgid "Python versions are numbered \"A.B.C\" or \"A.B\":" -msgstr "Python のバージョン番号は \"A.B.C\" または \"A.B\" が付けられます :" - -#: ../../faq/general.rst:132 +#: ../../faq/general.rst:128 msgid "" -"*A* is the major version number -- it is only incremented for really major " -"changes in the language." +"Python versions are numbered A.B.C or A.B. A is the major version number -- " +"it is only incremented for really major changes in the language. B is the " +"minor version number, incremented for less earth-shattering changes. C is " +"the micro-level -- it is incremented for each bugfix release. See :pep:`6` " +"for more information about bugfix releases." msgstr "" -"*A* はメジャーバージョン番号です -- 言語に本当に大きな変更があった場合に増や" -"されます。" +"Python のバージョン番号は A.B.C や A.B のように付けられています。 A はメ" +"ジャーバージョン番号で、言語の本当に重要な変更の時のみ上げられます。 B はマイ" +"ナーバージョン番号で、そこまでは大きくない変更の時に上げられます。 C はマイク" +"ロレベルで、バグフィックスリリースの度に上げられます。バグフィックスリリース" +"に関する詳細は :pep:`6` を参照してください。" #: ../../faq/general.rst:134 msgid "" -"*B* is the minor version number -- it is incremented for less earth-" -"shattering changes." -msgstr "" -"*B* はマイナーバージョン番号です -- 驚きの少ない変更があった場合に増やされま" -"す。" - -#: ../../faq/general.rst:136 -msgid "" -"*C* is the micro version number -- it is incremented for each bugfix release." -msgstr "" -"*C* はマイクロバージョン番号です -- バグフィックスリリースごとに増やされま" -"す。" - -#: ../../faq/general.rst:138 -msgid "" -"Not all releases are bugfix releases. In the run-up to a new feature " -"release, a series of development releases are made, denoted as alpha, beta, " -"or release candidate. Alphas are early releases in which interfaces aren't " -"yet finalized; it's not unexpected to see an interface change between two " -"alpha releases. Betas are more stable, preserving existing interfaces but " -"possibly adding new modules, and release candidates are frozen, making no " -"changes except as needed to fix critical bugs." -msgstr "" -"すべてのリリースがバグフィックスリリースであるというわけではありません。" -"フィーチャーリリースへの準備段階では、一連の開発リリースが作られ、アルファ" -"版、ベータ版、またはリリース候補と名付けられます。アルファ版はインターフェー" -"スが確定されないうちにリリースされる早期リリースで、2つのアルファリリース間" -"でインターフェースが変わるかもしれません。ベータ版はもっと安定していて、現存" -"のインターフェースは保存されますが新しいモジュールが追加されるかもしれませ" -"ん。リリース候補は固まったもので、致命的なバグを直すのでなければ変更されませ" -"ん。" - -#: ../../faq/general.rst:146 -msgid "Alpha, beta and release candidate versions have an additional suffix:" -msgstr "アルファ、ベータとリリース候補のバージョンは、追加の接尾辞を持ちます:" - -#: ../../faq/general.rst:148 -msgid "The suffix for an alpha version is \"aN\" for some small number *N*." -msgstr "" -"アルファバージョンの接尾辞は、ある小さな数 *N* に対して \"aN \"となります。" +"Not all releases are bugfix releases. In the run-up to a new major release, " +"a series of development releases are made, denoted as alpha, beta, or " +"release candidate. Alphas are early releases in which interfaces aren't yet " +"finalized; it's not unexpected to see an interface change between two alpha " +"releases. Betas are more stable, preserving existing interfaces but possibly " +"adding new modules, and release candidates are frozen, making no changes " +"except as needed to fix critical bugs." +msgstr "" +"すべてのリリースがバグフィックスリリースであるというわけではありません。メ" +"ジャーリリースへの準備段階では、一連の開発リリースが作られ、アルファ版、ベー" +"タ版、またはリリース候補と名付けられます。アルファ版はインターフェースが確定" +"されないうちにリリースされる早期リリースで、2つのアルファリリース間でイン" +"ターフェースが変わるかもしれません。ベータ版はもっと安定していて、現存のイン" +"ターフェースは保存されますが新しいモジュールが追加されるかもしれません。リ" +"リース候補は固まったもので、致命的なバグを直すのでなければ変更されません。" + +#: ../../faq/general.rst:142 +msgid "" +"Alpha, beta and release candidate versions have an additional suffix. The " +"suffix for an alpha version is \"aN\" for some small number N, the suffix " +"for a beta version is \"bN\" for some small number N, and the suffix for a " +"release candidate version is \"rcN\" for some small number N. In other " +"words, all versions labeled 2.0aN precede the versions labeled 2.0bN, which " +"precede versions labeled 2.0rcN, and *those* precede 2.0." +msgstr "" +"アルファ、ベータ、リリース候補の各バージョンには接尾語が追加されます。 N をな" +"にか小さい番号として、アルファ版の接尾語は \"aN\" 、ベータ版の接尾語は " +"\"bN\" 、リリース候補の接尾語は \"rcNcN\" です。つまり、バージョン 2.0aN、" +"バージョン 2.0bN、バージョン 2.0rcN0cN、バージョン 2.0 の順にリリースされるこ" +"とになります。" #: ../../faq/general.rst:149 -msgid "The suffix for a beta version is \"bN\" for some small number *N*." -msgstr "" -"ベータバージョンの接尾辞は、ある小さな数 *N* に対して \"bN\" となります。" - -#: ../../faq/general.rst:150 -msgid "" -"The suffix for a release candidate version is \"rcN\" for some small number " -"*N*." -msgstr "" -"リリース候補バージョンの接尾辞は、ある小さな数 *N* に対して \"rcN\" となりま" -"す。" - -#: ../../faq/general.rst:152 -msgid "" -"In other words, all versions labeled *2.0aN* precede the versions labeled " -"*2.0bN*, which precede versions labeled *2.0rcN*, and *those* precede 2.0." -msgstr "" -"つまり、 *2.0aN* と付けられたバージョンはすべて *2.0bN* に先立ち、 *2.0bN* " -"は *2.0rcN* に先立ち、そして *これら* は 2.0 に先立ちます。" - -#: ../../faq/general.rst:155 msgid "" "You may also find version numbers with a \"+\" suffix, e.g. \"2.2+\". These " "are unreleased versions, built directly from the CPython development " @@ -358,35 +333,29 @@ msgstr "" "際、最後のマイナーリリースが行われた後、バージョンは \"2.4a0\" のように " "\"a0\" がつく次のマイナーバージョンになります。" -#: ../../faq/general.rst:160 +#: ../../faq/general.rst:154 msgid "" -"See the `Developer's Guide `__ for more information about the development cycle, " -"and :pep:`387` to learn more about Python's backward compatibility policy. " "See also the documentation for :data:`sys.version`, :data:`sys.hexversion`, " "and :data:`sys.version_info`." msgstr "" -"開発サイクルの詳細は `Developer's Guide `__ を、 Python の後方互換性ポリシーに" -"ついては :pep:`387` を参照してください。 ドキュメント :data:`sys." -"version` 、 :data:`sys.hexversion` 、 :data:`sys.version_info` も参照してくだ" -"さい。" +":data:`sys.version`, :data:`sys.hexversion`, :data:`sys.version_info` につい" +"てのドキュメントも参照してください。" -#: ../../faq/general.rst:169 +#: ../../faq/general.rst:159 msgid "How do I obtain a copy of the Python source?" msgstr "Python のソースのコピーはどこで手に入りますか?" -#: ../../faq/general.rst:171 +#: ../../faq/general.rst:161 msgid "" "The latest Python source distribution is always available from python.org, " "at https://www.python.org/downloads/. The latest development sources can be " "obtained at https://github.com/python/cpython/." msgstr "" "最新の Python ソースは python.org (https://www.python.org/downloads/) からい" -"つでも手に入れることができます。最新の開発版ソースは https://github.com/" -"python/cpython/ にアクセスして手に入れることができます。" +"つでも手に入れることができます。最新の開発版ソースは https://github.python." +"org/cpython にアクセスして手に入れることができます。" -#: ../../faq/general.rst:175 +#: ../../faq/general.rst:165 msgid "" "The source distribution is a gzipped tar file containing the complete C " "source, Sphinx-formatted documentation, Python library modules, example " @@ -398,7 +367,7 @@ msgstr "" "ム、そしていくつかの役立つ配布自由なソフトウェアを含んでいます。このソースは" "ほとんどの UNIX プラットフォームでそのままコンパイルして動かせます。" -#: ../../faq/general.rst:180 +#: ../../faq/general.rst:170 msgid "" "Consult the `Getting Started section of the Python Developer's Guide " "`__ for more information on getting the " @@ -408,11 +377,11 @@ msgstr "" "section of the Python Developer's Guide `__ を参照してください。" -#: ../../faq/general.rst:186 +#: ../../faq/general.rst:176 msgid "How do I get documentation on Python?" msgstr "Python のドキュメントはどこで手に入りますか?" -#: ../../faq/general.rst:188 +#: ../../faq/general.rst:180 msgid "" "The standard documentation for the current stable version of Python is " "available at https://docs.python.org/3/. PDF, plain text, and downloadable " @@ -422,23 +391,22 @@ msgstr "" "から利用できます。また、PDF、プレーンテキスト、ダウンロードできる HTML 版も " "https://docs.python.org/3/download.html%20%E3%81%8B%E3%82%89%E5%88%A9%E7%94%A8%E3%81%A7%E3%81%8D%E3%81%BE%E3%81%99%E3%80%82" -#: ../../faq/general.rst:192 +#: ../../faq/general.rst:184 msgid "" "The documentation is written in reStructuredText and processed by `the " -"Sphinx documentation tool `__. The " -"reStructuredText source for the documentation is part of the Python source " -"distribution." +"Sphinx documentation tool `__. The reStructuredText " +"source for the documentation is part of the Python source distribution." msgstr "" "このドキュメントは reStructuredText で書かれ、`the Sphinx documentation tool " -"`__ で構成されました。このドキュメントに使われ" -"た reStructuredText のソースは Python のソース配布に含まれます。" +"`__ で構成されました。このドキュメントに使われた " +"reStructuredText のソースは Python のソース配布に含まれます。" -#: ../../faq/general.rst:198 +#: ../../faq/general.rst:190 msgid "I've never programmed before. Is there a Python tutorial?" msgstr "" "プログラミングをしたことがないのですが、Python のチュートリアルはありますか?" -#: ../../faq/general.rst:200 +#: ../../faq/general.rst:192 msgid "" "There are numerous tutorials and books available. The standard " "documentation includes :ref:`tutorial-index`." @@ -446,7 +414,7 @@ msgstr "" "膨大な量の役に立つチュートリアルや書籍があります。標準のドキュメントには :" "ref:`tutorial-index` などがあります。" -#: ../../faq/general.rst:203 +#: ../../faq/general.rst:195 msgid "" "Consult `the Beginner's Guide `_ to find information for beginning Python programmers, " @@ -456,11 +424,11 @@ msgstr "" "Beginner's Guide `_ を参照してく" "ださい。" -#: ../../faq/general.rst:208 +#: ../../faq/general.rst:200 msgid "Is there a newsgroup or mailing list devoted to Python?" msgstr "Python のためのニュースグループやメーリングリストはありますか?" -#: ../../faq/general.rst:210 +#: ../../faq/general.rst:202 msgid "" "There is a newsgroup, :newsgroup:`comp.lang.python`, and a mailing list, " "`python-list `_. The " @@ -476,19 +444,19 @@ msgstr "" "は一日に数百のポスティングを受ける高いトラフィックで、USENET 読者は多くの場" "合、このボリュームに応えることができます。" -#: ../../faq/general.rst:217 +#: ../../faq/general.rst:209 msgid "" "Announcements of new software releases and events can be found in comp.lang." "python.announce, a low-traffic moderated list that receives about five " "postings per day. It's available as `the python-announce mailing list " -"`_." +"`_." msgstr "" "新しいソフトウェアリリースとイベントの告知は comp.lang.python.announce で見つ" "けられます。これは一日に 5 ポスティング程度を受ける低トラフィックの手頃なメー" "リングリストです。`the python-announce mailing list `_ から利用可能です。" +"mailman/listinfo/python-announce-list>`_ から利用可能です。" -#: ../../faq/general.rst:222 +#: ../../faq/general.rst:214 msgid "" "More info about other mailing lists and newsgroups can be found at https://" "www.python.org/community/lists/." @@ -496,11 +464,11 @@ msgstr "" "その他のメーリングリストやニュースグループについての詳しい情報は https://www." "python.org/community/lists/ にあります。" -#: ../../faq/general.rst:227 +#: ../../faq/general.rst:219 msgid "How do I get a beta test version of Python?" msgstr "Python のベータテスト版はどこで手に入りますか?" -#: ../../faq/general.rst:229 +#: ../../faq/general.rst:221 msgid "" "Alpha and beta releases are available from https://www.python.org/" "downloads/. All releases are announced on the comp.lang.python and comp." @@ -512,7 +480,7 @@ msgstr "" "ループと Python ホームページ https://www.python.org/ で告知され、RSS ニュース" "フィードが利用できます。" -#: ../../faq/general.rst:234 +#: ../../faq/general.rst:226 msgid "" "You can also access the development version of Python through Git. See `The " "Python Developer's Guide `_ for details." @@ -520,19 +488,34 @@ msgstr "" "Git から開発版を手に入れることもできます。詳細は `The Python Developer's " "guide `_ を参照してください。" -#: ../../faq/general.rst:239 +#: ../../faq/general.rst:231 msgid "How do I submit bug reports and patches for Python?" msgstr "Python のバグ報告やパッチを上げるにはどうしたら良いですか?" -#: ../../faq/general.rst:241 +#: ../../faq/general.rst:233 msgid "" -"To report a bug or submit a patch, use the issue tracker at https://github." -"com/python/cpython/issues." +"To report a bug or submit a patch, please use the Roundup installation at " +"https://bugs.python.org/" msgstr "" -"バグの報告やパッチの提出には、issue tracker https://github.com/python/" -"CPython/issues をご利用ください。" +"バグの報告やパッチの投稿には、https://bugs.python.org/ から Roundup " +"installation を利用してください。" -#: ../../faq/general.rst:244 +#: ../../faq/general.rst:236 +msgid "" +"You must have a Roundup account to report bugs; this makes it possible for " +"us to contact you if we have follow-up questions. It will also enable " +"Roundup to send you updates as we act on your bug. If you had previously " +"used SourceForge to report bugs to Python, you can obtain your Roundup " +"password through Roundup's `password reset procedure `_." +msgstr "" +"バグ報告には Roundup アカウントが必要です (こちらから関連する質問をさせて頂く" +"ため、またバグを解決したときにアップデート版を送るため)。以前バグ報告に " +"SourceForge を使っていたことがあるなら、Roundup の `password reset procedure " +"`_ から Roundup のパスワー" +"ドを取得することができます。" + +#: ../../faq/general.rst:242 msgid "" "For more information on how Python is developed, consult `the Python " "Developer's Guide `_." @@ -540,23 +523,21 @@ msgstr "" "Python 開発の工程について、詳しくは `the Python Developer's Guide `_ を参照してください。" -#: ../../faq/general.rst:249 +#: ../../faq/general.rst:247 msgid "Are there any published articles about Python that I can reference?" msgstr "Python について発行された記事を何か参照できますか?" -#: ../../faq/general.rst:251 +#: ../../faq/general.rst:249 msgid "It's probably best to cite your favorite book about Python." msgstr "Python に関するあなたの愛読書を引用するのが一番でしょう。" -#: ../../faq/general.rst:253 +#: ../../faq/general.rst:251 msgid "" -"The `very first article `_ about Python was " -"written in 1991 and is now quite outdated." -msgstr "" -"Python に関する `一番初めの記事 `_ はとても古" -"く、1991年に書かれています。" +"The very first article about Python was written in 1991 and is now quite " +"outdated." +msgstr "Python に関する一番初めの記事はとても古く、1991年に書かれています。" -#: ../../faq/general.rst:256 +#: ../../faq/general.rst:254 msgid "" "Guido van Rossum and Jelke de Boer, \"Interactively Testing Remote Servers " "Using the Python Programming Language\", CWI Quarterly, Volume 4, Issue 4 " @@ -566,11 +547,11 @@ msgstr "" "Using the Python Programming Language\", CWI Quarterly, Volume 4, Issue 4 " "(December 1991), Amsterdam, pp 283--303." -#: ../../faq/general.rst:262 +#: ../../faq/general.rst:260 msgid "Are there any books on Python?" msgstr "Python の本はありますか?" -#: ../../faq/general.rst:264 +#: ../../faq/general.rst:262 msgid "" "Yes, there are many, and more are being published. See the python.org wiki " "at https://wiki.python.org/moin/PythonBooks for a list." @@ -578,7 +559,7 @@ msgstr "" "はい、たくさんあり、そのほとんどは現在も出版されています。リストは python." "org wiki https://wiki.python.org/moin/PythonBooks にあります。" -#: ../../faq/general.rst:267 +#: ../../faq/general.rst:265 msgid "" "You can also search online bookstores for \"Python\" and filter out the " "Monty Python references; or perhaps search for \"Python\" and \"language\"." @@ -586,24 +567,24 @@ msgstr "" "また、オンライン書店で \"Python\" で検索し、Monty Python をフィルタで除外して" "もいいです (または、\"Python\" と \"言語\" で検索してください)。" -#: ../../faq/general.rst:272 +#: ../../faq/general.rst:270 msgid "Where in the world is www.python.org located?" msgstr "www.python.org は世界のどこにあるのですか?" -#: ../../faq/general.rst:274 +#: ../../faq/general.rst:272 msgid "" "The Python project's infrastructure is located all over the world and is " -"managed by the Python Infrastructure Team. Details `here `__." msgstr "" "Pythonプロジェクトのインフラは世界中にあり、Pythonインフラストラクチャチーム" -"によって管理されています。詳細は `こちら `__." +"によって管理されています。詳細は `こちら `__." -#: ../../faq/general.rst:279 +#: ../../faq/general.rst:277 msgid "Why is it called Python?" msgstr "なぜ Python という名前なのですか?" -#: ../../faq/general.rst:281 +#: ../../faq/general.rst:279 msgid "" "When he began implementing Python, Guido van Rossum was also reading the " "published scripts from `\"Monty Python's Flying Circus\" `_. Python 3.x is the recommended version " -"and supported by most widely used libraries. Python 2.x :pep:`is not " -"maintained anymore <373>`." +"`_. There are two production-ready " +"versions of Python: 2.x and 3.x. The recommended version is 3.x, which is " +"supported by most widely used libraries. Although 2.x is still widely used, " +"`it is not maintained anymore `_." msgstr "" +"最新の安定版リリースは常に `Python download page `_ にあります。Pythonには2.x" +"と3.xという、製品に利用可能な2つのバージョンがあります。推奨のバージョンは3.x" +"で、これは広く利用されているライブラリのほとんどでサポートされています。2.xも" +"依然として広く利用されていますが、`もうこれ以上はメンテナンスされません`_ 。" -#: ../../faq/general.rst:317 +#: ../../faq/general.rst:316 msgid "How many people are using Python?" msgstr "どれくらいの人が Python を使っていますか?" -#: ../../faq/general.rst:319 +#: ../../faq/general.rst:318 msgid "" "There are probably millions of users, though it's difficult to obtain an " "exact count." @@ -679,7 +665,7 @@ msgstr "" "正確な人数を調べるのは難しいですが、おそらく何百万人ものユーザーがいるでしょ" "う。" -#: ../../faq/general.rst:322 +#: ../../faq/general.rst:321 msgid "" "Python is available for free download, so there are no sales figures, and " "it's available from many different sites and packaged with many Linux " @@ -689,7 +675,7 @@ msgstr "" "き、多くの Linux ディストーションに同梱されているので、ダウンロード統計から全" "体の状況を知ることはできません。" -#: ../../faq/general.rst:326 +#: ../../faq/general.rst:325 msgid "" "The comp.lang.python newsgroup is very active, but not all Python users post " "to the group or even read it." @@ -697,11 +683,11 @@ msgstr "" "comp.lang.python ニュースグループはとても活発ですが、すべての Python ユーザー" "が投稿するわけではなく、読みすらしない人もいます。" -#: ../../faq/general.rst:331 +#: ../../faq/general.rst:330 msgid "Have any significant projects been done in Python?" msgstr "Python で行われた大きなプロジェクトはありますか?" -#: ../../faq/general.rst:333 +#: ../../faq/general.rst:332 msgid "" "See https://www.python.org/about/success for a list of projects that use " "Python. Consulting the proceedings for `past Python conferences `_ から議事録を参照すると、多くの会社や組織の貢献がわか" "るでしょう。" -#: ../../faq/general.rst:338 +#: ../../faq/general.rst:337 msgid "" "High-profile Python projects include `the Mailman mailing list manager " -"`_ and `the Zope application server `_. Several Linux distributions, most notably `Red Hat `_ and `the Zope application server `_. Several Linux distributions, most notably `Red Hat `_, have written part or all of their installer and system " "administration software in Python. Companies that use Python internally " "include Google, Yahoo, and Lucasfilm Ltd." msgstr "" "注目されている Python のプロジェクトは `the Mailman mailing list manager " -"`_ や `the Zope application server `_ などです。`Red Hat `_ をはじめとするいくつか" +"`_ や `the Zope application server `_ などです。`Red Hat `_ をはじめとするいくつか" "の Linux ディストーションのインストーラやシステムアドミニストレーションソフト" "ウェアは、一部や全部が Python で書かれています。内部で Python を利用している" "企業には、Google、Yahoo、Lucasfilm Ltd. などがあります。" -#: ../../faq/general.rst:347 +#: ../../faq/general.rst:346 msgid "What new developments are expected for Python in the future?" msgstr "将来 Python にどのような新しい開発が期待されますか?" -#: ../../faq/general.rst:349 +#: ../../faq/general.rst:348 msgid "" -"See https://peps.python.org/ for the Python Enhancement Proposals (PEPs). " -"PEPs are design documents describing a suggested new feature for Python, " -"providing a concise technical specification and a rationale. Look for a PEP " -"titled \"Python X.Y Release Schedule\", where X.Y is a version that hasn't " -"been publicly released yet." +"See https://www.python.org/dev/peps/ for the Python Enhancement Proposals " +"(PEPs). PEPs are design documents describing a suggested new feature for " +"Python, providing a concise technical specification and a rationale. Look " +"for a PEP titled \"Python X.Y Release Schedule\", where X.Y is a version " +"that hasn't been publicly released yet." msgstr "" -"Python Enhancement Proposals (PEP) https://peps.python.org/ を参照してくださ" -"い。PEP は Python に提案された新機能について書かれた設計書で、簡潔な技術仕様" -"と原理が提供されています。\"Python X.Y Release Schedule\" (X.Y はまだリリース" -"されていないバージョン) を探してください。" +"Python Enhancement Proposals (PEP) https://www.python.org/dev/peps/ を参照し" +"てください。PEP は Python に提案された新機能について書かれた設計書で、簡潔な" +"技術仕様と原理が提供されています。\"Python X.Y Release Schedule\" (X.Y はまだ" +"リリースされていないバージョン) を探してください。" -#: ../../faq/general.rst:355 +#: ../../faq/general.rst:354 msgid "" "New development is discussed on `the python-dev mailing list `_." +"python.org/mailman/listinfo/python-dev/>`_." msgstr "" "新しい開発については `the python-dev mailing list `_ で議論されています。" +"mailman/listinfo/python-dev/>`_ で議論されています。" -#: ../../faq/general.rst:360 +#: ../../faq/general.rst:359 msgid "Is it reasonable to propose incompatible changes to Python?" msgstr "Python の互換性を無くすような提案をしてもいいのですか?" -#: ../../faq/general.rst:362 +#: ../../faq/general.rst:361 msgid "" "In general, no. There are already millions of lines of Python code around " "the world, so any change in the language that invalidates more than a very " @@ -774,7 +760,7 @@ msgstr "" "に関する多くの本が出版されているので、それらを一発で不適切にするようなことは" "したくないです。" -#: ../../faq/general.rst:369 +#: ../../faq/general.rst:368 msgid "" "Providing a gradual upgrade path is necessary if a feature has to be " "changed. :pep:`5` describes the procedure followed for introducing backward-" @@ -784,15 +770,15 @@ msgstr "" "なりません。 :pep:`5` で、ユーザーの受ける分裂を最小限にしながら後方互換性の" "ない変更を行うために従うべき手順について説明しています。" -#: ../../faq/general.rst:375 +#: ../../faq/general.rst:374 msgid "Is Python a good language for beginning programmers?" msgstr "Python は初心者プログラマに向いている言語ですか?" -#: ../../faq/general.rst:377 +#: ../../faq/general.rst:376 msgid "Yes." msgstr "はい。" -#: ../../faq/general.rst:379 +#: ../../faq/general.rst:378 msgid "" "It is still common to start students with a procedural and statically typed " "language such as Pascal, C, or a subset of C++ or Java. Students may be " @@ -813,7 +799,7 @@ msgstr "" "や手続きなどの基本概念をすぐに取り入れられます。最初の課程でいきなりユーザ定" "義のオブジェクトを操ることさえできるでしょう。" -#: ../../faq/general.rst:389 +#: ../../faq/general.rst:388 msgid "" "For a student who has never programmed before, using a statically typed " "language seems unnatural. It presents additional complexity that the " @@ -831,7 +817,7 @@ msgstr "" "見れば静的型付け言語を学ぶことは重要ですが、それが最初のプログラミングの授業" "で学ぶべき最高の話題とは限りません。" -#: ../../faq/general.rst:397 +#: ../../faq/general.rst:396 msgid "" "Many other aspects of Python make it a good first language. Like Java, " "Python has a large standard library so that students can be assigned " @@ -852,7 +838,7 @@ msgstr "" "PyGame などのサードパーティモジュールもまた手が届く範囲を広げるのに役立ちま" "す。" -#: ../../faq/general.rst:406 +#: ../../faq/general.rst:405 msgid "" "Python's interactive interpreter enables students to test language features " "while they're programming. They can keep a window with the interpreter " @@ -864,35 +850,7 @@ msgstr "" "間、ウィンドウでインタプリタを起動させたままにしておくことができます。リスト" "のメソッドを思い出せないときは、例えばこのようにできます::" -#: ../../faq/general.rst:411 -msgid "" -">>> L = []\n" -">>> dir(L)\n" -"['__add__', '__class__', '__contains__', '__delattr__', '__delitem__',\n" -"'__dir__', '__doc__', '__eq__', '__format__', '__ge__',\n" -"'__getattribute__', '__getitem__', '__gt__', '__hash__', '__iadd__',\n" -"'__imul__', '__init__', '__iter__', '__le__', '__len__', '__lt__',\n" -"'__mul__', '__ne__', '__new__', '__reduce__', '__reduce_ex__',\n" -"'__repr__', '__reversed__', '__rmul__', '__setattr__', '__setitem__',\n" -"'__sizeof__', '__str__', '__subclasshook__', 'append', 'clear',\n" -"'copy', 'count', 'extend', 'index', 'insert', 'pop', 'remove',\n" -"'reverse', 'sort']\n" -">>> [d for d in dir(L) if '__' not in d]\n" -"['append', 'clear', 'copy', 'count', 'extend', 'index', 'insert', 'pop', " -"'remove', 'reverse', 'sort']\n" -"\n" -">>> help(L.append)\n" -"Help on built-in function append:\n" -"\n" -"append(...)\n" -" L.append(object) -> None -- append object to end\n" -"\n" -">>> L.append(1)\n" -">>> L\n" -"[1]" -msgstr "" - -#: ../../faq/general.rst:435 +#: ../../faq/general.rst:434 msgid "" "With the interpreter, documentation is never far from the student as they " "are programming." @@ -900,24 +858,25 @@ msgstr "" "インタプリタがあれば、プログラミングをしている間にドキュメントは生徒のそばを" "離れません。" -#: ../../faq/general.rst:438 +#: ../../faq/general.rst:437 msgid "" "There are also good IDEs for Python. IDLE is a cross-platform IDE for " -"Python that is written in Python using Tkinter. Emacs users will be happy to " -"know that there is a very good Python mode for Emacs. All of these " -"programming environments provide syntax highlighting, auto-indenting, and " -"access to the interactive interpreter while coding. Consult `the Python " -"wiki `_ for a full list of " -"Python editing environments." +"Python that is written in Python using Tkinter. PythonWin is a Windows-" +"specific IDE. Emacs users will be happy to know that there is a very good " +"Python mode for Emacs. All of these programming environments provide syntax " +"highlighting, auto-indenting, and access to the interactive interpreter " +"while coding. Consult `the Python wiki `_ for a full list of Python editing environments." msgstr "" "Python のための良い IDE もあります。IDLE は Python で Tkinter を使って書かれ" -"たクロスプラットフォーム IDE です。Emacs には、ユーザにとって幸運なことに、素" -"晴らしい Python モードがあります。これらすべてのプログラミング環境から、シン" -"タックスハイライト、オートインデント、コーディング中のインタラクティブインタ" -"プリタへのアクセスが使えます。`the Python wiki `_ から Python 編集環境の一覧を参照してください。" - -#: ../../faq/general.rst:446 +"たクロスプラットフォーム IDE です。PythonWin は Windows 専用の IDE です。" +"Emacs には、ユーザにとって幸運なことに、素晴らしい Python モードがあります。" +"これらすべてのプログラミング環境から、シンタックスハイライト、オートインデン" +"ト、コーディング中のインタラクティブインタプリタへのアクセスが使えます。`the " +"Python wiki `_ から Python 編集環" +"境の一覧を参照してください。" + +#: ../../faq/general.rst:445 msgid "" "If you want to discuss Python's use in education, you may be interested in " "joining `the edu-sig mailing list , YEAR. # # Translators: -# tomo, 2021 -# mollinaca, 2021 +# Arihiro TAKASE, 2018 +# mollinaca, 2020 # Shin Saito, 2021 -# Arihiro TAKASE, 2023 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-06 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:52+0000\n" -"Last-Translator: Arihiro TAKASE, 2023\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-08-18 07:17+0000\n" +"PO-Revision-Date: 2017-02-16 17:43+0000\n" +"Last-Translator: Shin Saito, 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../faq/gui.rst:5 @@ -48,15 +47,16 @@ msgid "" "to install (since it comes included with most `binary distributions `_ of Python) and use. For more info about Tk, " "including pointers to the source, see the `Tcl/Tk home page `_. Tcl/Tk is fully portable to the macOS, Windows, and Unix platforms." +"tk>`_. Tcl/Tk is fully portable to the Mac OS X, Windows, and Unix " +"platforms." msgstr "" -"Python の標準的なビルドには、 :ref:`tkinter ` という Tcl/Tk ウィ" -"ジェットセットのオブジェクト指向インターフェースが含まれています。これは最も" -"簡単にインストールして使えるでしょう (なぜなら、これは Python のほとんどの `" -"バイナリディストリビューション `_ に同梱さ" -"れているからです)。ソースへのポインタなど、 Tk に関する詳しい情報は、 `Tcl/" -"Tk ホームページ `_ を参照してください。 Tcl/Tk は、 " -"macOS 、Windows 、 Unix プラットフォームに完全にポータブルです。" +"Python の標準的なビルドには、 :ref:`tkinter 1` という Tcl/Tk ウィジェットセッ" +"トのオブジェクト指向インターフェースが含まれています。これは最も簡単にインス" +"トールして使えるでしょう (なぜなら、これは Python のほとんどの `バイナリディ" +"ストリビューション `_ に同梱されているから" +"です)。ソースへのポインタなど、 Tk に関する詳しい情報は、 `Tcl/Tk ホームペー" +"ジ `_ を参照してください。 Tcl/Tk は、 Mac OS X 、" +"Windows 、 Unix プラットフォームに完全にポータブルです。" #: ../../faq/gui.rst:28 msgid "" @@ -93,52 +93,66 @@ msgstr "" #: ../../faq/gui.rst:45 msgid "" "One solution is to ship the application with the Tcl and Tk libraries, and " -"point to them at run-time using the :envvar:`!TCL_LIBRARY` and :envvar:`!" -"TK_LIBRARY` environment variables." +"point to them at run-time using the :envvar:`TCL_LIBRARY` and :envvar:" +"`TK_LIBRARY` environment variables." msgstr "" "一つの解決策は、アプリケーションに Tcl と Tk ライブラリを同梱し、環境変数 :" -"envvar:`!TCL_LIBRARY` と :envvar:`!TK_LIBRARY` でランタイムに指定することで" -"す。" +"envvar:`TCL_LIBRARY` と :envvar:`TK_LIBRARY` でランタイムに指定することです。" #: ../../faq/gui.rst:49 msgid "" -"Various third-party freeze libraries such as py2exe and cx_Freeze have " -"handling for Tkinter applications built-in." +"To get truly stand-alone applications, the Tcl scripts that form the library " +"have to be integrated into the application as well. One tool supporting that " +"is SAM (stand-alone modules), which is part of the Tix distribution (http://" +"tix.sourceforge.net/)." msgstr "" +"真にスタンドアロンなアプリケーションにするためには、ライブラリを成す Tcl スク" +"リプトもアプリケーションに統合されていなければなりません。それをサポートする" +"ツールの一つは SAM (stand-alone modules) で、Tix ディストリビューション " +"(http://tix.sourceforge.net/) の一部です。" #: ../../faq/gui.rst:54 +msgid "" +"Build Tix with SAM enabled, perform the appropriate call to :c:func:" +"`Tclsam_init`, etc. inside Python's :file:`Modules/tkappinit.c`, and link " +"with libtclsam and libtksam (you might include the Tix libraries as well)." +msgstr "" +"SAM を有効にするように Tix をビルドして、Python の :file:`Modules/tkappinit." +"c` 内部の :c:func:`Tclsam_init` 等への適切なコールを実行し、libtclsam と " +"libtksam にリンクしてください (Tix ライブラリを含んでも良いです)。" + +#: ../../faq/gui.rst:61 msgid "Can I have Tk events handled while waiting for I/O?" msgstr "I/O を待つ間に扱われる Tk イベントを作れますか?" -#: ../../faq/gui.rst:56 +#: ../../faq/gui.rst:63 msgid "" "On platforms other than Windows, yes, and you don't even need threads! But " "you'll have to restructure your I/O code a bit. Tk has the equivalent of " -"Xt's :c:func:`!XtAddInput` call, which allows you to register a callback " +"Xt's :c:func:`XtAddInput()` call, which allows you to register a callback " "function which will be called from the Tk mainloop when I/O is possible on a " "file descriptor. See :ref:`tkinter-file-handlers`." msgstr "" "Windows 以外のプラットフォームについては、はい、スレッドさえ必要ありませ" "ん! ただし、I/O コードを少し再構成しなければなりません。Tk には Xt の :c:" -"func:`!XtAddInput` コールと同等なものがあるので、ファイルディスクリプタ上で " +"func:`XtAddInput()` コールと同等なものがあるので、ファイルディスクリプタ上で " "I/O が可能なときに Tk メインループから呼ばれるコールバック関数を登録できま" "す。 :ref:`tkinter-file-handlers` を参照してください。" -#: ../../faq/gui.rst:64 +#: ../../faq/gui.rst:71 msgid "I can't get key bindings to work in Tkinter: why?" msgstr "Tkinter で働くキーバインディングが得られません。なぜですか?" -#: ../../faq/gui.rst:66 +#: ../../faq/gui.rst:73 msgid "" -"An often-heard complaint is that event handlers :ref:`bound ` to events with the :meth:`!bind` method don't get handled even when " -"the appropriate key is pressed." +"An often-heard complaint is that event handlers bound to events with the :" +"meth:`bind` method don't get handled even when the appropriate key is " +"pressed." msgstr "" -":meth:`!bind` メソッドでイベントに :ref:`結び付けられた ` イベントハンドラが、適切なキーが押されたときにさえハンドルされないと" -"いう苦情がよく聞かれます。" +":meth:`bind` メソッドでイベントに結び付けられたイベントハンドラが、適切なキー" +"が押されたときにさえハンドルされないという苦情がよく聞かれます。" -#: ../../faq/gui.rst:70 +#: ../../faq/gui.rst:76 msgid "" "The most common cause is that the widget to which the binding applies " "doesn't have \"keyboard focus\". Check out the Tk documentation for the " diff --git a/faq/index.po b/faq/index.po index ce836050b..b62c2e5bf 100644 --- a/faq/index.po +++ b/faq/index.po @@ -1,25 +1,25 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 +# Nozomu Kaneko , 2017 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-30 14:22+0000\n" -"PO-Revision-Date: 2021-06-28 00:52+0000\n" -"Last-Translator: tomo, 2021\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 17:43+0000\n" +"Last-Translator: Nozomu Kaneko , 2017\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../faq/index.rst:5 diff --git a/faq/installed.po b/faq/installed.po index cf877d904..fdbb7c415 100644 --- a/faq/installed.po +++ b/faq/installed.po @@ -1,26 +1,27 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 -# 菊池 健志, 2023 +# 秘湯 , 2017 +# Nozomu Kaneko , 2017 +# Arihiro TAKASE, 2017 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-30 14:22+0000\n" -"PO-Revision-Date: 2021-06-28 00:52+0000\n" -"Last-Translator: 菊池 健志, 2023\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 17:43+0000\n" +"Last-Translator: Arihiro TAKASE, 2017\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../faq/installed.rst:3 @@ -99,13 +100,13 @@ msgstr "" #: ../../faq/installed.rst:32 msgid "" -"Many Unix-compatible operating systems, such as macOS and some Linux " +"Many Unix-compatible operating systems, such as Mac OS X and some Linux " "distributions, have Python installed by default; it's included in the base " "installation." msgstr "" -"macOS や一部の Linux ディストリビューションなど、多くの Unix 互換オペレーティ" -"ングシステムシステムには、Python がデフォルトでインストールされています。標準" -"インストールに Python が含まれているのです。" +"Mac OS X や一部の Linux ディストリビューションなど、多くの Unix 互換オペレー" +"ティングシステムシステムには、Python がデフォルトでインストールされています。" +"標準インストールに Python が含まれているのです。" #: ../../faq/installed.rst:38 msgid "Can I delete Python?" diff --git a/faq/library.po b/faq/library.po index feab60885..759691f56 100644 --- a/faq/library.po +++ b/faq/library.po @@ -1,30 +1,34 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# mollinaca, 2021 +# Nozomu Kaneko , 2017 +# 秘湯 , 2017 +# E. Kawashima, 2017 +# Shun Sakurai, 2017 +# mnamihdk, 2017 +# yudetamago , 2018 +# Arihiro TAKASE, 2018 +# tomo, 2020 +# mollinaca, 2020 # Shin Saito, 2021 -# tomo, 2021 -# 菊池 健志, 2023 -# Arihiro TAKASE, 2023 -# TENMYO Masakazu, 2024 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:52+0000\n" -"Last-Translator: TENMYO Masakazu, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 17:43+0000\n" +"Last-Translator: Shin Saito, 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../faq/library.rst:5 @@ -57,12 +61,12 @@ msgstr "" #: ../../faq/library.rst:21 msgid "" "For third-party packages, search the `Python Package Index `_ or try `Google `_ or another web search " +"org>`_ or try `Google `_ or another Web search " "engine. Searching for \"Python\" plus a keyword or two for your topic of " "interest will usually find something helpful." msgstr "" "サードパーティのパッケージについては、`Python Package Index `_ を探したり、`Google `_ その他の web サーチエン" +"org>`_ を探したり、`Google `_ その他の Web サーチエン" "ジンを試してください。\"Python\" に加えて一つか二つのキーワードで興味のある話" "題を検索すれば、たいてい役に立つものが見つかるでしょう。" @@ -106,12 +110,6 @@ msgstr "" "C で書かれ、インタプリタにリンクされているモジュール。このリストを得るには、" "こうタイプしてください::" -#: ../../faq/library.rst:42 -msgid "" -"import sys\n" -"print(sys.builtin_module_names)" -msgstr "" - #: ../../faq/library.rst:47 msgid "How do I make a Python script executable on Unix?" msgstr "Python のスクリプトを Unix で実行可能にするにはどうしますか?" @@ -139,10 +137,6 @@ msgid "" "to write ::" msgstr "後者は、いくつかの方法でできます。最も直接的な方法はこのように ::" -#: ../../faq/library.rst:59 -msgid "#!/usr/local/bin/python" -msgstr "" - #: ../../faq/library.rst:61 msgid "" "as the very first line of your file, using the pathname for where the Python " @@ -163,10 +157,6 @@ msgstr "" "ディレクトリにあることを前提とすれば、ほとんど全ての Unix 系 OS では次の書き" "方をサポートしています::" -#: ../../faq/library.rst:69 -msgid "#!/usr/bin/env python" -msgstr "" - #: ../../faq/library.rst:71 msgid "" "*Don't* do this for CGI scripts. The :envvar:`PATH` variable for CGI " @@ -187,14 +177,6 @@ msgstr "" "ことがあります; もしくは、 env プログラム自体が無いことがあります。そのような" "場合は、次の (Alex Rezinsky による) ハックが試せます:" -#: ../../faq/library.rst:79 -msgid "" -"#! /bin/sh\n" -"\"\"\":\"\n" -"exec python $0 ${1+\"$@\"}\n" -"\"\"\"" -msgstr "" - #: ../../faq/library.rst:86 msgid "" "The minor disadvantage is that this defines the script's __doc__ string. " @@ -203,10 +185,6 @@ msgstr "" "これには、スクリプトの __doc__ 文字列を定義するというちょっとした欠点がありま" "す。しかし、これを付け足せば直せます::" -#: ../../faq/library.rst:89 -msgid "__doc__ = \"\"\"...Whatever...\"\"\"" -msgstr "" - #: ../../faq/library.rst:94 msgid "Is there a curses/termcap package for Python?" msgstr "Python には curses/termcap パッケージはありますか?" @@ -239,23 +217,31 @@ msgstr "" "い OS とは互換性が無いことを意味しますが、現在メンテナンスされている OS でそ" "ういう類のものは無さそうです。" -#: ../../faq/library.rst:111 +#: ../../faq/library.rst:109 +msgid "" +"For Windows: use `the consolelib module `_." +msgstr "" +"Windows では: `the consolelib module `_ を使ってください。" + +#: ../../faq/library.rst:114 msgid "Is there an equivalent to C's onexit() in Python?" msgstr "Python には C の onexit() に相当するものはありますか?" -#: ../../faq/library.rst:113 +#: ../../faq/library.rst:116 msgid "" "The :mod:`atexit` module provides a register function that is similar to " -"C's :c:func:`!onexit`." +"C's :c:func:`onexit`." msgstr "" -":mod:`atexit` モジュールは、 C の :c:func:`!onexit` と同じような関数登録を提" -"供します。" +":mod:`atexit` モジュールは、 C の :c:func:`onexit` と同じような関数登録を提供" +"します。" -#: ../../faq/library.rst:118 +#: ../../faq/library.rst:121 msgid "Why don't my signal handlers work?" msgstr "シグナルハンドラが動かないのですがなぜですか?" -#: ../../faq/library.rst:120 +#: ../../faq/library.rst:123 msgid "" "The most common problem is that the signal handler is declared with the " "wrong argument list. It is called as ::" @@ -263,29 +249,19 @@ msgstr "" "最もありがちな問題は、シグナルハンドラが間違った引数リストで宣言されているこ" "とです。これは次のように呼び出されます ::" -#: ../../faq/library.rst:123 -msgid "handler(signum, frame)" -msgstr "" - -#: ../../faq/library.rst:125 +#: ../../faq/library.rst:128 msgid "so it should be declared with two parameters::" msgstr "だから、これは二つの仮引数で宣言されるべきです:" -#: ../../faq/library.rst:127 -msgid "" -"def handler(signum, frame):\n" -" ..." -msgstr "" - -#: ../../faq/library.rst:132 +#: ../../faq/library.rst:135 msgid "Common tasks" msgstr "よくある作業" -#: ../../faq/library.rst:135 +#: ../../faq/library.rst:138 msgid "How do I test a Python program or component?" msgstr "Python のプログラムやコンポーネントをテストするにはどうしますか?" -#: ../../faq/library.rst:137 +#: ../../faq/library.rst:140 msgid "" "Python comes with two testing frameworks. The :mod:`doctest` module finds " "examples in the docstrings for a module and runs them, comparing the output " @@ -295,7 +271,7 @@ msgstr "" "ルは、モジュールの docstring から使用例を見つけてそれらを実行し、出力を " "docstring によって与えられた望まれる出力と比較します。" -#: ../../faq/library.rst:141 +#: ../../faq/library.rst:144 msgid "" "The :mod:`unittest` module is a fancier testing framework modelled on Java " "and Smalltalk testing frameworks." @@ -303,7 +279,7 @@ msgstr "" ":mod:`unittest` モジュールは、Java や Smalltalk のテストフレームワークを模し" "た装飾されたテストフレームワークです。" -#: ../../faq/library.rst:144 +#: ../../faq/library.rst:147 msgid "" "To make testing easier, you should use good modular design in your program. " "Your program should have almost all functionality encapsulated in either " @@ -320,23 +296,17 @@ msgstr "" "アクセスよりも速いからです)。さらに言うと、テストを行うのがより難しくなってし" "まうため、プログラムは可変なグローバル変数に依存するのを避けるべきです。" -#: ../../faq/library.rst:152 +#: ../../faq/library.rst:155 msgid "The \"global main logic\" of your program may be as simple as ::" msgstr "プログラムの \"global main logic\" は ::" -#: ../../faq/library.rst:154 -msgid "" -"if __name__ == \"__main__\":\n" -" main_logic()" -msgstr "" - -#: ../../faq/library.rst:157 +#: ../../faq/library.rst:160 msgid "at the bottom of the main module of your program." msgstr "" "のように main モジュールの最後に出来る限りシンプルなものを書くのが良いでしょ" "う。" -#: ../../faq/library.rst:159 +#: ../../faq/library.rst:162 msgid "" "Once your program is organized as a tractable collection of function and " "class behaviours, you should write test functions that exercise the " @@ -355,7 +325,7 @@ msgstr "" "早い段階で簡単に見付かるようになるので、コーディング作業をより心地良く楽しい" "ものにできます。" -#: ../../faq/library.rst:167 +#: ../../faq/library.rst:170 msgid "" "\"Support modules\" that are not intended to be the main module of a program " "may include a self-test of the module. ::" @@ -363,13 +333,7 @@ msgstr "" "プログラムのメインモジュールとして設計されたのではない \"補助モジュール\" に" "は、モジュールの自己テストを含めるといいでしょう。 ::" -#: ../../faq/library.rst:170 -msgid "" -"if __name__ == \"__main__\":\n" -" self_test()" -msgstr "" - -#: ../../faq/library.rst:173 +#: ../../faq/library.rst:176 msgid "" "Even programs that interact with complex external interfaces may be tested " "when the external interfaces are unavailable by using \"fake\" interfaces " @@ -379,28 +343,28 @@ msgstr "" "が使えない時でも、Python で実装された \"fake\" インターフェースを使ってテスト" "できます。" -#: ../../faq/library.rst:179 +#: ../../faq/library.rst:182 msgid "How do I create documentation from doc strings?" msgstr "" "Python のドキュメント文字列からドキュメントを生成するにはどうしますか?" -#: ../../faq/library.rst:181 +#: ../../faq/library.rst:184 msgid "" "The :mod:`pydoc` module can create HTML from the doc strings in your Python " "source code. An alternative for creating API documentation purely from " -"docstrings is `epydoc `_. `Sphinx `_ can also include docstring content." +"docstrings is `epydoc `_. `Sphinx `_ can also include docstring content." msgstr "" ":mod:`pydoc` モジュールで Python ソースコード内のドキュメント文字列から HTML " "を生成できます。純粋に docstring から API ドキュメントを生成するには、他に " -"`epydoc `_ という選択肢もあります。 `Sphinx " -"`_ も docstring の内容を含めることができます。" +"`epydoc `_ という選択肢もあります。 `Sphinx " +"`_ も docstring の内容を含めることができます。" -#: ../../faq/library.rst:188 +#: ../../faq/library.rst:191 msgid "How do I get a single keypress at a time?" msgstr "一度に一つの押鍵を取得するにはどうしますか?" -#: ../../faq/library.rst:190 +#: ../../faq/library.rst:193 msgid "" "For Unix variants there are several solutions. It's straightforward to do " "this using curses, but curses is a fairly large module to learn." @@ -408,15 +372,15 @@ msgstr "" "Unix 系 OS ではいくつか解決方法があります。curses を使うのが素直なやり方です" "が、curses は学ぶには少し大き過ぎるモジュールです。" -#: ../../faq/library.rst:234 +#: ../../faq/library.rst:237 msgid "Threads" msgstr "スレッド" -#: ../../faq/library.rst:237 +#: ../../faq/library.rst:240 msgid "How do I program using threads?" msgstr "スレッドを使ったプログラムを書くにはどうしますか?" -#: ../../faq/library.rst:239 +#: ../../faq/library.rst:242 msgid "" "Be sure to use the :mod:`threading` module and not the :mod:`_thread` " "module. The :mod:`threading` module builds convenient abstractions on top of " @@ -426,11 +390,19 @@ msgstr "" "ださい。 :mod:`threading` モジュールは、 :mod:`_thread` モジュールで提供され" "る低レベルな基本要素の、便利な抽象化を構成します。" -#: ../../faq/library.rst:245 +#: ../../faq/library.rst:246 +msgid "" +"Aahz has a set of slides from his threading tutorial that are helpful; see " +"http://www.pythoncraft.com/OSCON2001/" +msgstr "" +"Aahz は、役立つスレッディングのチュートリアルから成るスライドを揃えていま" +"す。 http://www.pythoncraft.com/OSCON2001/ を参照してください。" + +#: ../../faq/library.rst:251 msgid "None of my threads seem to run: why?" msgstr "スレッドが一つも実行されていないようです。なぜですか?" -#: ../../faq/library.rst:247 +#: ../../faq/library.rst:253 msgid "" "As soon as the main thread exits, all threads are killed. Your main thread " "is running too quickly, giving the threads no time to do any work." @@ -438,7 +410,7 @@ msgstr "" "メインスレッドが終了するとともに、全てのスレッドは終了されます。メインスレッ" "ドは速く働きすぎるので、スレッドには何をする時間も与えられません。" -#: ../../faq/library.rst:250 +#: ../../faq/library.rst:256 msgid "" "A simple fix is to add a sleep to the end of the program that's long enough " "for all the threads to finish::" @@ -446,22 +418,7 @@ msgstr "" "簡単な解決策は、プログラムの終わりに、スレッドが完了するのに十分な時間のス" "リープを加えることです::" -#: ../../faq/library.rst:253 -msgid "" -"import threading, time\n" -"\n" -"def thread_task(name, n):\n" -" for i in range(n):\n" -" print(name, i)\n" -"\n" -"for i in range(10):\n" -" T = threading.Thread(target=thread_task, args=(str(i), i))\n" -" T.start()\n" -"\n" -"time.sleep(10) # <---------------------------!" -msgstr "" - -#: ../../faq/library.rst:265 +#: ../../faq/library.rst:271 msgid "" "But now (on many platforms) the threads don't run in parallel, but appear to " "run sequentially, one at a time! The reason is that the OS thread scheduler " @@ -471,25 +428,11 @@ msgstr "" "のではなく、一つづつ実行されるのです!なぜなら、OS のスレッドスケジューラは、" "前のスレッドがブロックされるまで新しいスレッドを開始しないからです。" -#: ../../faq/library.rst:269 +#: ../../faq/library.rst:275 msgid "A simple fix is to add a tiny sleep to the start of the run function::" msgstr "簡単に直すには、関数の実行の最初にちょっとスリープを加えることです::" -#: ../../faq/library.rst:271 -msgid "" -"def thread_task(name, n):\n" -" time.sleep(0.001) # <--------------------!\n" -" for i in range(n):\n" -" print(name, i)\n" -"\n" -"for i in range(10):\n" -" T = threading.Thread(target=thread_task, args=(str(i), i))\n" -" T.start()\n" -"\n" -"time.sleep(10)" -msgstr "" - -#: ../../faq/library.rst:282 +#: ../../faq/library.rst:288 msgid "" "Instead of trying to guess a good delay value for :func:`time.sleep`, it's " "better to use some kind of semaphore mechanism. One idea is to use the :mod:" @@ -503,11 +446,11 @@ msgstr "" "加し、メインスレッドにスレッドと同じ数のトークンをキューから読み出させること" "です。" -#: ../../faq/library.rst:290 +#: ../../faq/library.rst:296 msgid "How do I parcel out work among a bunch of worker threads?" msgstr "たくさんのワーカースレッドに作業を割り振るにはどうしますか?" -#: ../../faq/library.rst:292 +#: ../../faq/library.rst:298 msgid "" "The easiest way is to use the :mod:`concurrent.futures` module, especially " "the :mod:`~concurrent.futures.ThreadPoolExecutor` class." @@ -515,7 +458,7 @@ msgstr "" "最も簡単な方法は、新しい :mod:`concurrent.futures` モジュール、特に :mod:" "`~concurrent.futures.ThreadPoolExecutor` クラスを使うことです。" -#: ../../faq/library.rst:295 +#: ../../faq/library.rst:301 msgid "" "Or, if you want fine control over the dispatching algorithm, you can write " "your own logic manually. Use the :mod:`queue` module to create a queue " @@ -531,71 +474,15 @@ msgstr "" "get()`` メソッドを持っています。このクラスは、それぞれのジョブがきっちり 1 回" "だけ取り出されることを保証するのに必要なロック処理にも配慮します。" -#: ../../faq/library.rst:302 +#: ../../faq/library.rst:308 msgid "Here's a trivial example::" msgstr "ここにちょっとした例があります::" -#: ../../faq/library.rst:304 -msgid "" -"import threading, queue, time\n" -"\n" -"# The worker thread gets jobs off the queue. When the queue is empty, it\n" -"# assumes there will be no more work and exits.\n" -"# (Realistically workers will run until terminated.)\n" -"def worker():\n" -" print('Running worker')\n" -" time.sleep(0.1)\n" -" while True:\n" -" try:\n" -" arg = q.get(block=False)\n" -" except queue.Empty:\n" -" print('Worker', threading.current_thread(), end=' ')\n" -" print('queue empty')\n" -" break\n" -" else:\n" -" print('Worker', threading.current_thread(), end=' ')\n" -" print('running with argument', arg)\n" -" time.sleep(0.5)\n" -"\n" -"# Create queue\n" -"q = queue.Queue()\n" -"\n" -"# Start a pool of 5 workers\n" -"for i in range(5):\n" -" t = threading.Thread(target=worker, name='worker %i' % (i+1))\n" -" t.start()\n" -"\n" -"# Begin adding work to the queue\n" -"for i in range(50):\n" -" q.put(i)\n" -"\n" -"# Give threads time to run\n" -"print('Main thread sleeping')\n" -"time.sleep(5)" -msgstr "" - -#: ../../faq/library.rst:340 +#: ../../faq/library.rst:346 msgid "When run, this will produce the following output:" msgstr "実行時には、以下のように出力されます:" -#: ../../faq/library.rst:342 -msgid "" -"Running worker\n" -"Running worker\n" -"Running worker\n" -"Running worker\n" -"Running worker\n" -"Main thread sleeping\n" -"Worker running with argument 0\n" -"Worker running with argument 1\n" -"Worker running with argument 2\n" -"Worker running with argument 3\n" -"Worker running with argument 4\n" -"Worker running with argument 5\n" -"..." -msgstr "" - -#: ../../faq/library.rst:358 +#: ../../faq/library.rst:364 msgid "" "Consult the module's documentation for more details; the :class:`~queue." "Queue` class provides a featureful interface." @@ -603,11 +490,11 @@ msgstr "" "より詳しいことはモジュールのドキュメントを調べてください; :class:`~queue." "Queue` クラスは多機能なインターフェースを提供しています。" -#: ../../faq/library.rst:363 +#: ../../faq/library.rst:369 msgid "What kinds of global value mutation are thread-safe?" msgstr "グローバルな値のどんな種類の変更がスレッドセーフになるのですか?" -#: ../../faq/library.rst:365 +#: ../../faq/library.rst:371 msgid "" "A :term:`global interpreter lock` (GIL) is used internally to ensure that " "only one thread runs in the Python VM at a time. In general, Python offers " @@ -623,7 +510,7 @@ msgstr "" "令、そしてそれぞれの命令が届く全ての C 実装コードは、 Python プログラムの観点" "からは、アトミックです。" -#: ../../faq/library.rst:372 +#: ../../faq/library.rst:378 msgid "" "In theory, this means an exact accounting requires an exact understanding of " "the PVM bytecode implementation. In practice, it means that operations on " @@ -634,7 +521,7 @@ msgstr "" "ことが必要です。実際上は、組み込みデータ型(整数、リスト、辞書、等)の、変数を" "共有する \"アトミックそうな\" 演算は、実際にアトミックです。" -#: ../../faq/library.rst:377 +#: ../../faq/library.rst:383 msgid "" "For example, the following operations are all atomic (L, L1, L2 are lists, " "D, D1, D2 are dicts, x, y are objects, i, j are ints)::" @@ -642,52 +529,29 @@ msgstr "" "例えば、以下の演算は全てアトミックです (L、L1、L2 はリスト、 D、D1、D2 は辞" "書、x、y はオブジェクト、i、j は整数です)::" -#: ../../faq/library.rst:380 -msgid "" -"L.append(x)\n" -"L1.extend(L2)\n" -"x = L[i]\n" -"x = L.pop()\n" -"L1[i:j] = L2\n" -"L.sort()\n" -"x = y\n" -"x.field = y\n" -"D[x] = y\n" -"D1.update(D2)\n" -"D.keys()" -msgstr "" - -#: ../../faq/library.rst:392 +#: ../../faq/library.rst:398 msgid "These aren't::" msgstr "これらは、アトミックではありません::" -#: ../../faq/library.rst:394 -msgid "" -"i = i+1\n" -"L.append(L[-1])\n" -"L[i] = L[j]\n" -"D[x] = D[x] + 1" -msgstr "" - -#: ../../faq/library.rst:399 +#: ../../faq/library.rst:405 msgid "" "Operations that replace other objects may invoke those other objects' :meth:" -"`~object.__del__` method when their reference count reaches zero, and that " -"can affect things. This is especially true for the mass updates to " -"dictionaries and lists. When in doubt, use a mutex!" +"`__del__` method when their reference count reaches zero, and that can " +"affect things. This is especially true for the mass updates to dictionaries " +"and lists. When in doubt, use a mutex!" msgstr "" "他のオブジェクトを置き換えるような演算は、そのオブジェクトの参照カウントがゼ" -"ロになったときに :meth:`~object.__del__` メソッドを呼び出すことがあり、これが" -"影響を及ぼすかもしれません。これは特に、辞書やリストの大規模な更新に当てはま" -"ります。疑わしければ、mutex を使ってください!" +"ロになったときに :meth:`__del__` メソッドを呼び出すことがあり、これが影響を及" +"ぼすかもしれません。これは特に、辞書やリストの大規模な更新に当てはまります。" +"疑わしければ、mutex を使ってください!" -#: ../../faq/library.rst:406 +#: ../../faq/library.rst:412 msgid "Can't we get rid of the Global Interpreter Lock?" msgstr "" "グローバルインタプリタロック (Global Interpreter Lock) を取り除くことはできな" "いのですか?" -#: ../../faq/library.rst:408 +#: ../../faq/library.rst:416 msgid "" "The :term:`global interpreter lock` (GIL) is often seen as a hindrance to " "Python's deployment on high-end multiprocessor server machines, because a " @@ -700,46 +564,44 @@ msgstr "" "Python をハイエンドなマルチプロセッササーバマシン上に配備する上で邪魔であると" "見なされがちです。" -#: ../../faq/library.rst:413 -msgid "" -"With the approval of :pep:`703` work is now underway to remove the GIL from " -"the CPython implementation of Python. Initially it will be implemented as " -"an optional compiler flag when building the interpreter, and so separate " -"builds will be available with and without the GIL. Long-term, the hope is " -"to settle on a single build, once the performance implications of removing " -"the GIL are fully understood. Python 3.13 is likely to be the first release " -"containing this work, although it may not be completely functional in this " -"release." -msgstr "" - -#: ../../faq/library.rst:422 +#: ../../faq/library.rst:421 msgid "" -"The current work to remove the GIL is based on a `fork of Python 3.9 with " -"the GIL removed `_ by Sam Gross. Prior " -"to that, in the days of Python 1.5, Greg Stein actually implemented a " +"Back in the days of Python 1.5, Greg Stein actually implemented a " "comprehensive patch set (the \"free threading\" patches) that removed the " -"GIL and replaced it with fine-grained locking. Adam Olsen did a similar " -"experiment in his `python-safethread `_ project. Unfortunately, both of these earlier " -"experiments exhibited a sharp drop in single-thread performance (at least " -"30% slower), due to the amount of fine-grained locking necessary to " -"compensate for the removal of the GIL. The Python 3.9 fork is the first " -"attempt at removing the GIL with an acceptable performance impact." -msgstr "" +"GIL and replaced it with fine-grained locking. Adam Olsen recently did a " +"similar experiment in his `python-safethread `_ project. Unfortunately, both experiments " +"exhibited a sharp drop in single-thread performance (at least 30% slower), " +"due to the amount of fine-grained locking necessary to compensate for the " +"removal of the GIL." +msgstr "" +"Python 1.5 の時代、Greg Stein は実際に、GIL を取り除いてよりきめ細かいロッキ" +"ングで置き換える包括的なパッチセット (\"free threading\" パッチ) を実装しまし" +"た。Adam Olsen は最近、 `python-safethread `_ プロジェクトで似たような実験を行いました。残念ながら" +"どちらの実験も、GIL の除去を補償するために必要なきめ細かいロッキングの量のた" +"め、シングルスレッドのパフォーマンスの極端な低下 (少なくとも 30% の遅れ) を示" +"しました。" + +#: ../../faq/library.rst:429 +msgid "" +"This doesn't mean that you can't make good use of Python on multi-CPU " +"machines! You just have to be creative with dividing the work up between " +"multiple *processes* rather than multiple *threads*. The :class:" +"`~concurrent.futures.ProcessPoolExecutor` class in the new :mod:`concurrent." +"futures` module provides an easy way of doing so; the :mod:`multiprocessing` " +"module provides a lower-level API in case you want more control over " +"dispatching of tasks." +msgstr "" +"これは、マルチ CPU マシン上で Python を使いこなせないことを意味しません!タス" +"クを複数の *スレッド* ではなく複数の *プロセス* に分けることを考えればいいの" +"です。これは、新しい :mod:`concurrent.futures` モジュールの :class:" +"`~concurrent.futures.ProcessPoolExecutor` クラスを使えば簡単です。:mod:" +"`multiprocessing` モジュールは、タスクのディスパッチをより深く制御したいとき" +"のためのより低水準な API を提供します。" #: ../../faq/library.rst:437 msgid "" -"The presence of the GIL in current Python releases doesn't mean that you " -"can't make good use of Python on multi-CPU machines! You just have to be " -"creative with dividing the work up between multiple *processes* rather than " -"multiple *threads*. The :class:`~concurrent.futures.ProcessPoolExecutor` " -"class in the new :mod:`concurrent.futures` module provides an easy way of " -"doing so; the :mod:`multiprocessing` module provides a lower-level API in " -"case you want more control over dispatching of tasks." -msgstr "" - -#: ../../faq/library.rst:446 -msgid "" "Judicious use of C extensions will also help; if you use a C extension to " "perform a time-consuming task, the extension can release the GIL while the " "thread of execution is in the C code and allow other threads to get some " @@ -751,16 +613,46 @@ msgstr "" "レッドで作業が進められます。 :mod:`zlib` や :mod:`hashlib` など、すでにこれを" "行なっている標準ライブラリモジュールもあります。" +#: ../../faq/library.rst:443 +msgid "" +"It has been suggested that the GIL should be a per-interpreter-state lock " +"rather than truly global; interpreters then wouldn't be able to share " +"objects. Unfortunately, this isn't likely to happen either. It would be a " +"tremendous amount of work, because many object implementations currently " +"have global state. For example, small integers and short strings are cached; " +"these caches would have to be moved to the interpreter state. Other object " +"types have their own free list; these free lists would have to be moved to " +"the interpreter state. And so on." +msgstr "" +"GIL を本当にグローバルにするより、インタプリタ状態ごとのロックにするべきとい" +"う提案もあります。そして、インタプリタはオブジェクトを共有するべきではないと" +"いうことです。残念ながら、どちらも実現しないでしょう。多くのオブジェクトの実" +"装は現在、グローバル状態を持っているので、実現はたいへんな大仕事になりそうで" +"す。例えば、小さな整数と短い文字列はキャッシュされます。このキャッシュはイン" +"タプリタ状態に動かされなくてはなりません。他のオブジェクト型は自身の自由変数" +"リストを持っています。これらの自由変数リストはインタプリタ状態に動かされなく" +"てはなりません。等々。" + #: ../../faq/library.rst:452 msgid "" -"An alternative approach to reducing the impact of the GIL is to make the GIL " -"a per-interpreter-state lock rather than truly global. This was :ref:`first " -"implemented in Python 3.12 ` and is available in the C " -"API. A Python interface to it is expected in Python 3.13. The main " -"limitation to it at the moment is likely to be 3rd party extension modules, " -"since these must be written with multiple interpreters in mind in order to " -"be usable, so many older extension modules will not be usable." +"And I doubt that it can even be done in finite time, because the same " +"problem exists for 3rd party extensions. It is likely that 3rd party " +"extensions are being written at a faster rate than you can convert them to " +"store all their global state in the interpreter state." msgstr "" +"それどころか、その作業が終わる時が来るかもわかりません。なぜなら、サードパー" +"ティ拡張にも問題があるからです。サードパーティ拡張が書かれるペースは、インタ" +"プリタ状態にすべてのグローバル状態を格納するように変換できるペースよりも速い" +"ことでしょう。" + +#: ../../faq/library.rst:457 +msgid "" +"And finally, once you have multiple interpreters not sharing any state, what " +"have you gained over running each interpreter in a separate process?" +msgstr "" +"そして最後に、状態を共有しないインタプリタを1プロセス上で複数作れたとして、各" +"インタプリタをそれぞれ別プロセスで動かすのに比べてどういう利点があるのでしょ" +"うか?" #: ../../faq/library.rst:462 msgid "Input and Output" @@ -829,27 +721,17 @@ msgstr "ファイルをコピーするにはどうしますか?" #: ../../faq/library.rst:492 msgid "" -"The :mod:`shutil` module contains a :func:`~shutil.copyfile` function. Note " -"that on Windows NTFS volumes, it does not copy `alternate data streams " -"`_ nor " -"`resource forks `__ on macOS " -"HFS+ volumes, though both are now rarely used. It also doesn't copy file " -"permissions and metadata, though using :func:`shutil.copy2` instead will " -"preserve most (though not all) of it." -msgstr "" -":mod:`shutil` モジュールに :func:`~shutil.copyfile` 関数があります。注意点と" -"して、これは Windows NTFS ボリューム上の `alternate data streams `_ も macOS HFS+ 上の " -"`resource forks `__ もコピーしま" -"せん。ただし現在ではどちらも使われることは ほとんどありません。またファイルの" -"パーミッションやメタデータもコピーされませんが、この代わりに :func:`shutil." -"copy2` を使うとそのほとんど (すべてではありませんが) が保持されます。" +"The :mod:`shutil` module contains a :func:`~shutil.copyfile` function. Note " +"that on MacOS 9 it doesn't copy the resource fork and Finder info." +msgstr "" +":mod:`shutil` モジュールには :func:`~shutil.copyfile` 関数があります。なお、" +"MacOS 9 ではリソースフォークやファインダー情報をコピーしません。" -#: ../../faq/library.rst:503 +#: ../../faq/library.rst:497 msgid "How do I read (or write) binary data?" msgstr "バイナリデータを読み書きするにはどうしますか?" -#: ../../faq/library.rst:505 +#: ../../faq/library.rst:499 msgid "" "To read or write complex binary data formats, it's best to use the :mod:" "`struct` module. It allows you to take a string containing binary data " @@ -859,7 +741,7 @@ msgstr "" "番です。これでバイナリデータ (通常は数) を含む文字列を取って、 Python オブ" "ジェクトに変換することができますし、その逆もできます。" -#: ../../faq/library.rst:509 +#: ../../faq/library.rst:503 msgid "" "For example, the following code reads two 2-byte integers and one 4-byte " "integer in big-endian format from a file::" @@ -869,15 +751,6 @@ msgstr "" #: ../../faq/library.rst:512 msgid "" -"import struct\n" -"\n" -"with open(filename, \"rb\") as f:\n" -" s = f.read(8)\n" -" x, y, z = struct.unpack(\">hhl\", s)" -msgstr "" - -#: ../../faq/library.rst:518 -msgid "" "The '>' in the format string forces big-endian data; the letter 'h' reads " "one \"short integer\" (2 bytes), and 'l' reads one \"long integer\" (4 " "bytes) from the string." @@ -886,7 +759,7 @@ msgstr "" "ら、文字 'h' は一つの\"整数\"(2 バイト)を読み込み、文字 'l' は一つの\"long 整" "数\"を読み込みます。" -#: ../../faq/library.rst:522 +#: ../../faq/library.rst:516 msgid "" "For data that is more regular (e.g. a homogeneous list of ints or floats), " "you can also use the :mod:`array` module." @@ -894,7 +767,7 @@ msgstr "" "より規則的なデータ (例えば、整数や浮動小数点数の中身の型が揃ったリスト) に対" "しては、 :mod:`array` モジュールを使うこともできます。" -#: ../../faq/library.rst:527 +#: ../../faq/library.rst:521 msgid "" "To read and write binary data, it is mandatory to open the file in binary " "mode (here, passing ``\"rb\"`` to :func:`open`). If you use ``\"r\"`` " @@ -907,13 +780,13 @@ msgstr "" "read()`` は :class:`bytes` オブジェクトではなく :class:`str` オブジェクトを返" "します。" -#: ../../faq/library.rst:535 +#: ../../faq/library.rst:529 msgid "I can't seem to use os.read() on a pipe created with os.popen(); why?" msgstr "" "os.popen() によって作られたパイプで os.read() が使われていないようです。なぜ" "ですか?" -#: ../../faq/library.rst:537 +#: ../../faq/library.rst:531 msgid "" ":func:`os.read` is a low-level function which takes a file descriptor, a " "small integer representing the opened file. :func:`os.popen` creates a high-" @@ -927,33 +800,33 @@ msgstr "" "従って、 :func:`os.popen` によって作成されたパイプ *p* から *n* バイト分だけ" "読み取るには、 ``p.read(n)`` を使う必要があります。" -#: ../../faq/library.rst:545 +#: ../../faq/library.rst:618 msgid "How do I access the serial (RS232) port?" msgstr "シリアル (RS232) ポートにアクセスするにはどうしますか?" -#: ../../faq/library.rst:547 -msgid "For Win32, OSX, Linux, BSD, Jython, IronPython:" -msgstr "Win32、OSX、Linux、BSD、Jython、IronPython では:" +#: ../../faq/library.rst:620 +msgid "For Win32, POSIX (Linux, BSD, etc.), Jython:" +msgstr "Win32、POSIX (Linux、BSD、など)、Jythonでは:" -#: ../../faq/library.rst:549 -msgid ":pypi:`pyserial`" -msgstr ":pypi:`pyserial`" +#: ../../faq/library.rst:622 +msgid "http://pyserial.sourceforge.net/" +msgstr "http://pyserial.sourceforge.net/" -#: ../../faq/library.rst:551 +#: ../../faq/library.rst:624 msgid "For Unix, see a Usenet post by Mitch Chapman:" msgstr "Unix では、Mitch Chapman による Usenet の投稿を参照してください:" -#: ../../faq/library.rst:553 +#: ../../faq/library.rst:626 msgid "https://groups.google.com/groups?selm=34A04430.CF9@ohioee.com" msgstr "https://groups.google.com/groups?selm=34A04430.CF9@ohioee.com" -#: ../../faq/library.rst:557 +#: ../../faq/library.rst:630 msgid "Why doesn't closing sys.stdout (stdin, stderr) really close it?" msgstr "" "sys.stdout (stdin, stderr) を閉じようとしても実際に閉じられないのはなぜです" "か?" -#: ../../faq/library.rst:559 +#: ../../faq/library.rst:632 msgid "" "Python :term:`file objects ` are a high-level layer of " "abstraction on low-level C file descriptors." @@ -961,7 +834,7 @@ msgstr "" "Python の :term:`file object ` は、低水準の C ファイルディスクリ" "プタ上の、抽象の高水準レイヤです。" -#: ../../faq/library.rst:562 +#: ../../faq/library.rst:635 msgid "" "For most file objects you create in Python via the built-in :func:`open` " "function, ``f.close()`` marks the Python file object as being closed from " @@ -975,7 +848,7 @@ msgstr "" "うに手配します。これは、 ``f`` がガベージとなったときにも、 ``f`` のデストラ" "クタで自動的に起こります。" -#: ../../faq/library.rst:568 +#: ../../faq/library.rst:641 msgid "" "But stdin, stdout and stderr are treated specially by Python, because of the " "special status also given to them by C. Running ``sys.stdout.close()`` " @@ -987,7 +860,7 @@ msgstr "" "Python レベルのファイルオブジェクトには閉じられているものとする印がつけられま" "すが、C ファイルディスクリプタは *閉じられません*。" -#: ../../faq/library.rst:573 +#: ../../faq/library.rst:646 msgid "" "To close the underlying C file descriptor for one of these three, you should " "first be sure that's what you really want to do (e.g., you may confuse " @@ -998,26 +871,19 @@ msgstr "" "乱させてしまうかもしれません)。本当に必要ならば、 :func:`os.close` を使ってく" "ださい::" -#: ../../faq/library.rst:577 -msgid "" -"os.close(stdin.fileno())\n" -"os.close(stdout.fileno())\n" -"os.close(stderr.fileno())" -msgstr "" - -#: ../../faq/library.rst:581 +#: ../../faq/library.rst:654 msgid "Or you can use the numeric constants 0, 1 and 2, respectively." msgstr "または、数の定数としてそれぞれ 0, 1, 2 も使えます。" -#: ../../faq/library.rst:585 +#: ../../faq/library.rst:658 msgid "Network/Internet Programming" msgstr "ネットワーク/インターネットプログラミング" -#: ../../faq/library.rst:588 +#: ../../faq/library.rst:661 msgid "What WWW tools are there for Python?" msgstr "Python の WWW ツールには何がありますか?" -#: ../../faq/library.rst:590 +#: ../../faq/library.rst:663 msgid "" "See the chapters titled :ref:`internet` and :ref:`netdata` in the Library " "Reference Manual. Python has many modules that will help you build server-" @@ -1027,7 +893,7 @@ msgstr "" "を参照してください。Python には、サーバサイドとクライアントサイドの web シス" "テムを構築するのに便利な多くのモジュールがあります。" -#: ../../faq/library.rst:596 +#: ../../faq/library.rst:669 msgid "" "A summary of available frameworks is maintained by Paul Boddie at https://" "wiki.python.org/moin/WebProgramming\\ ." @@ -1035,11 +901,49 @@ msgstr "" "利用可能なフレームワークの概要は Paul Boddie によって、 https://wiki.python." "org/moin/WebProgramming でメンテナンスされています。" -#: ../../faq/library.rst:601 +#: ../../faq/library.rst:672 +msgid "" +"Cameron Laird maintains a useful set of pages about Python web technologies " +"at http://phaseit.net/claird/comp.lang.python/web_python." +msgstr "" +"Cameron Laird は、http://phaseit.net/claird/comp.lang.python/web_python で " +"Python のウェブ技術に関する便利なページ群を整備しています。" + +#: ../../faq/library.rst:677 +msgid "How can I mimic CGI form submission (METHOD=POST)?" +msgstr "CGI フォームの発信 (METHOD=POST) を模倣するにはどうしますか?" + +#: ../../faq/library.rst:679 +msgid "" +"I would like to retrieve web pages that are the result of POSTing a form. Is " +"there existing code that would let me do this easily?" +msgstr "" +"フォームを POST した結果のウェブページを取得したいです。簡単に取得するための" +"コードはあるでしょうか?" + +#: ../../faq/library.rst:682 +msgid "Yes. Here's a simple example that uses :mod:`urllib.request`::" +msgstr "あります。これは :mod:`urllib.request` を利用した簡単な例です::" + +#: ../../faq/library.rst:697 +msgid "" +"Note that in general for percent-encoded POST operations, query strings must " +"be quoted using :func:`urllib.parse.urlencode`. For example, to send " +"``name=Guy Steele, Jr.``::" +msgstr "" +"一般的には、パーセント記号でエンコードされた POST 操作では、クエリ文字列は :" +"func:`urllib.parse.urlencode` を使って処理されなければならないことに注意して" +"ください。例えば、 ``name=Guy Steele, Jr.`` を送信するには::" + +#: ../../faq/library.rst:705 +msgid ":ref:`urllib-howto` for extensive examples." +msgstr ":ref:`urllib-howto` に多くの例があります。" + +#: ../../faq/library.rst:709 msgid "What module should I use to help with generating HTML?" msgstr "どのモジュールが HTML の生成の役に立ちますか?" -#: ../../faq/library.rst:605 +#: ../../faq/library.rst:713 msgid "" "You can find a collection of useful links on the `Web Programming wiki page " "`_." @@ -1047,15 +951,15 @@ msgstr "" "`Web Programming についての wiki のページ `_ から役に立つリンクが見付けられます。" -#: ../../faq/library.rst:610 +#: ../../faq/library.rst:718 msgid "How do I send mail from a Python script?" msgstr "Python のスクリプトからメールを送るにはどうしますか?" -#: ../../faq/library.rst:612 +#: ../../faq/library.rst:720 msgid "Use the standard library module :mod:`smtplib`." msgstr "標準ライブラリモジュール :mod:`smtplib` を使ってください。" -#: ../../faq/library.rst:614 +#: ../../faq/library.rst:722 msgid "" "Here's a very simple interactive mail sender that uses it. This method will " "work on any host that supports an SMTP listener. ::" @@ -1063,27 +967,7 @@ msgstr "" "以下に示すのが、これを使ったごく単純な対話型のメール送信器です。このメソッド" "は SMTP リスナをサポートするホストならどこででも作動します。 ::" -#: ../../faq/library.rst:617 -msgid "" -"import sys, smtplib\n" -"\n" -"fromaddr = input(\"From: \")\n" -"toaddrs = input(\"To: \").split(',')\n" -"print(\"Enter message, end with ^D:\")\n" -"msg = ''\n" -"while True:\n" -" line = sys.stdin.readline()\n" -" if not line:\n" -" break\n" -" msg += line\n" -"\n" -"# The actual mail send\n" -"server = smtplib.SMTP('localhost')\n" -"server.sendmail(fromaddr, toaddrs, msg)\n" -"server.quit()" -msgstr "" - -#: ../../faq/library.rst:634 +#: ../../faq/library.rst:742 msgid "" "A Unix-only alternative uses sendmail. The location of the sendmail program " "varies between systems; sometimes it is ``/usr/lib/sendmail``, sometimes ``/" @@ -1095,89 +979,73 @@ msgstr "" "ときは ``/usr/sbin/sendmail`` だったり。sendmail のマニュアルページが助けにな" "るでしょう。サンプルコードはこのようになります::" -#: ../../faq/library.rst:639 -msgid "" -"import os\n" -"\n" -"SENDMAIL = \"/usr/sbin/sendmail\" # sendmail location\n" -"p = os.popen(\"%s -t -i\" % SENDMAIL, \"w\")\n" -"p.write(\"To: receiver@example.com\\n\")\n" -"p.write(\"Subject: test\\n\")\n" -"p.write(\"\\n\") # blank line separating headers from body\n" -"p.write(\"Some text\\n\")\n" -"p.write(\"some more text\\n\")\n" -"sts = p.close()\n" -"if sts != 0:\n" -" print(\"Sendmail exit status\", sts)" -msgstr "" - -#: ../../faq/library.rst:654 +#: ../../faq/library.rst:762 msgid "How do I avoid blocking in the connect() method of a socket?" msgstr "" "ソケットの connect() メソッドでブロッキングされなくするにはどうしますか?" -#: ../../faq/library.rst:656 +#: ../../faq/library.rst:764 msgid "" "The :mod:`select` module is commonly used to help with asynchronous I/O on " "sockets." msgstr "" "主に :mod:`select` モジュールがソケットの非同期の I/O を扱うのに使われます。" -#: ../../faq/library.rst:659 +#: ../../faq/library.rst:767 msgid "" "To prevent the TCP connect from blocking, you can set the socket to non-" -"blocking mode. Then when you do the :meth:`~socket.socket.connect`, you " -"will either connect immediately (unlikely) or get an exception that contains " -"the error number as ``.errno``. ``errno.EINPROGRESS`` indicates that the " -"connection is in progress, but hasn't finished yet. Different OSes will " -"return different values, so you're going to have to check what's returned on " -"your system." +"blocking mode. Then when you do the :meth:`socket.connect`, you will either " +"connect immediately (unlikely) or get an exception that contains the error " +"number as ``.errno``. ``errno.EINPROGRESS`` indicates that the connection is " +"in progress, but hasn't finished yet. Different OSes will return different " +"values, so you're going to have to check what's returned on your system." msgstr "" "TCP 接続がブロッキングされないようにするために、ソケットをノンブロッキング" -"モードに設定することが出来ます。そして :meth:`~socket.socket.connect` したと" -"きに、即座に接続できるか、エラー番号を ``.errno`` として含む例外を受け取るか" -"のどちらかになります。``errno.EINPROGRESS`` は、接続が進行中であるが、まだ完" -"了していないということを示します。異なる OS では異なる値が返されるので、あな" -"たのシステムで何が返されるかを確かめておく必要があります。" +"モードに設定することが出来ます。そして :meth:`socket.connect` したときに、即" +"座に接続できるか、エラー番号を ``.errno`` として含む例外を受け取るかのどちら" +"かになります。``errno.EINPROGRESS`` は、接続が進行中であるが、まだ完了してい" +"ないということを示します。異なる OS では異なる値が返されるので、あなたのシス" +"テムで何が返されるかを確かめておく必要があります。" -#: ../../faq/library.rst:667 +#: ../../faq/library.rst:774 msgid "" -"You can use the :meth:`~socket.socket.connect_ex` method to avoid creating " -"an exception. It will just return the errno value. To poll, you can call :" -"meth:`~socket.socket.connect_ex` again later -- ``0`` or ``errno.EISCONN`` " -"indicate that you're connected -- or you can pass this socket to :meth:" -"`select.select` to check if it's writable." +"You can use the :meth:`socket.connect_ex` method to avoid creating an " +"exception. It will just return the errno value. To poll, you can call :" +"meth:`socket.connect_ex` again later -- ``0`` or ``errno.EISCONN`` indicate " +"that you're connected -- or you can pass this socket to :meth:`select." +"select` to check if it's writable." msgstr "" -":meth:`~socket.socket.connect_ex` メソッドを使えば例外を生成しなくて済みま" -"す。これは単に errno の値を返すでしょう。ポーリングのためには、後でまた :" -"meth:`~socket.socket.connect_ex` を呼び出すことができます -- ``0`` または " -"``errno.EISCONN`` は接続されたことを表します -- または、このソケットを :meth:" -"`select.select` に渡して書き込み可能か調べることができます。" +":meth:`socket.connect_ex` メソッドを使えば例外を生成しなくて済みます。これは" +"単に errno の値を返すでしょう。ポーリングのためには、後でまた :meth:`socket." +"connect_ex` を呼び出すことができます -- ``0`` または ``errno.EISCONN`` は接続" +"されたことを表します -- または、選択するソケットにこれを渡して書き込み可能か" +"調べることができます。" -#: ../../faq/library.rst:675 +#: ../../faq/library.rst:780 msgid "" "The :mod:`asyncio` module provides a general purpose single-threaded and " "concurrent asynchronous library, which can be used for writing non-blocking " -"network code. The third-party `Twisted `_ library is a " -"popular and feature-rich alternative." +"network code. The third-party `Twisted `_ " +"library is a popular and feature-rich alternative." msgstr "" ":mod:`asyncio` モジュールは、ノンブロッキングのネットワークコードを書く作業の" "ためにフレームワークのような方法を提供します。その他の選択肢として、`Twisted " -"`_ は多機能で著名なサードパーティのライブラリです。" +"`_ は多機能で著名なサードパーティのライブラ" +"リです。" -#: ../../faq/library.rst:683 +#: ../../faq/library.rst:788 msgid "Databases" msgstr "データベース" -#: ../../faq/library.rst:686 +#: ../../faq/library.rst:791 msgid "Are there any interfaces to database packages in Python?" msgstr "Python にはデータベースパッケージへのインターフェースはありますか?" -#: ../../faq/library.rst:688 +#: ../../faq/library.rst:793 msgid "Yes." msgstr "はい。" -#: ../../faq/library.rst:690 +#: ../../faq/library.rst:795 msgid "" "Interfaces to disk-based hashes such as :mod:`DBM ` and :mod:`GDBM " "` are also included with standard Python. There is also the :mod:" @@ -1188,7 +1056,7 @@ msgstr "" "ディスクベースのハッシュへのインターフェースも含まれています。また、 :mod:" "`sqlite3` モジュールは、軽量なディスクベースの関係データベースを提供します。" -#: ../../faq/library.rst:695 +#: ../../faq/library.rst:800 msgid "" "Support for most relational databases is available. See the " "`DatabaseProgramming wiki page `_ を参照してください。" -#: ../../faq/library.rst:701 +#: ../../faq/library.rst:806 msgid "How do you implement persistent objects in Python?" msgstr "Python で永続的なオブジェクトを実装するにはどうしますか?" -#: ../../faq/library.rst:703 +#: ../../faq/library.rst:808 msgid "" "The :mod:`pickle` library module solves this in a very general way (though " "you still can't store things like open files, sockets or windows), and the :" @@ -1214,15 +1082,15 @@ msgstr "" "が)。 :mod:`shelve` ライブラリモジュールは pickle と (g)dbm を使い、任意の " "Python オブジェクトを含む永続的なマッピングを生成します。" -#: ../../faq/library.rst:710 +#: ../../faq/library.rst:815 msgid "Mathematics and Numerics" msgstr "数学と数" -#: ../../faq/library.rst:713 +#: ../../faq/library.rst:818 msgid "How do I generate random numbers in Python?" msgstr "Python で乱数を生成するにはどうしますか?" -#: ../../faq/library.rst:715 +#: ../../faq/library.rst:820 msgid "" "The standard module :mod:`random` implements a random number generator. " "Usage is simple::" @@ -1230,50 +1098,44 @@ msgstr "" "標準モジュールの :mod:`random` が乱数生成器を実装しています。使い方は単純で" "す::" -#: ../../faq/library.rst:718 -msgid "" -"import random\n" -"random.random()" -msgstr "" +#: ../../faq/library.rst:826 +msgid "This returns a random floating point number in the range [0, 1)." +msgstr "これは区間 [0, 1) 内のランダムな浮動小数点数を返します。" -#: ../../faq/library.rst:721 -msgid "This returns a random floating-point number in the range [0, 1)." -msgstr "" - -#: ../../faq/library.rst:723 +#: ../../faq/library.rst:828 msgid "" "There are also many other specialized generators in this module, such as:" msgstr "このモジュールにはその他多くの特化した生成器もあります。例えば:" -#: ../../faq/library.rst:725 +#: ../../faq/library.rst:830 msgid "``randrange(a, b)`` chooses an integer in the range [a, b)." msgstr "``randrange(a, b)`` は区間 [a, b) から整数を選びます。" -#: ../../faq/library.rst:726 -msgid "``uniform(a, b)`` chooses a floating-point number in the range [a, b)." -msgstr "" +#: ../../faq/library.rst:831 +msgid "``uniform(a, b)`` chooses a floating point number in the range [a, b)." +msgstr "``uniform(a, b)`` は区間 [a, b) から浮動小数点数を選びます。" -#: ../../faq/library.rst:727 +#: ../../faq/library.rst:832 msgid "" "``normalvariate(mean, sdev)`` samples the normal (Gaussian) distribution." msgstr "" "``normalvariate(mean, sdev)`` は正規 (ガウス) 分布をサンプリングします。" -#: ../../faq/library.rst:729 +#: ../../faq/library.rst:834 msgid "Some higher-level functions operate on sequences directly, such as:" msgstr "シーケンスに直接作用する高水準な関数もあります。例えば:" -#: ../../faq/library.rst:731 +#: ../../faq/library.rst:836 msgid "``choice(S)`` chooses a random element from a given sequence." msgstr "``choice(S)`` は与えられたシーケンスからランダムな要素を選びます。" -#: ../../faq/library.rst:732 +#: ../../faq/library.rst:837 msgid "``shuffle(L)`` shuffles a list in-place, i.e. permutes it randomly." msgstr "" "``shuffle(L)`` はリストをインプレースにシャッフルします。すなわち、ランダムに" "並び替えます。" -#: ../../faq/library.rst:734 +#: ../../faq/library.rst:839 msgid "" "There's also a ``Random`` class you can instantiate to create independent " "multiple random number generators." diff --git a/faq/programming.po b/faq/programming.po index db6d794e1..a9bc335c4 100644 --- a/faq/programming.po +++ b/faq/programming.po @@ -1,30 +1,38 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# mollinaca, 2021 +# ごはんですよ , 2017 +# Inada Naoki , 2017 +# Nozomu Kaneko , 2017 +# Yusuke Miyazaki , 2017 +# E. Kawashima, 2017 +# 秘湯 , 2017 +# Kazuma Okada , 2017 +# mnamihdk, 2017 +# Arihiro TAKASE, 2018 +# Tetsuo Koyama , 2020 +# tomo, 2020 +# mollinaca, 2020 +# Osamu NAKAMURA, 2021 # Mikami Akiko, 2021 -# 菊池 健志, 2023 -# tomo, 2023 -# Arihiro TAKASE, 2023 -# TENMYO Masakazu, 2024 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-06 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:52+0000\n" -"Last-Translator: TENMYO Masakazu, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-05-23 06:25+0000\n" +"PO-Revision-Date: 2017-02-16 17:43+0000\n" +"Last-Translator: Mikami Akiko, 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../faq/programming.rst:5 @@ -47,7 +55,7 @@ msgstr "" "ブレークポイントやシングルステップ実行などを備えたソースコードレベルデバッガ" "はありますか?" -#: ../../faq/programming.rst:17 ../../faq/programming.rst:58 +#: ../../faq/programming.rst:17 ../../faq/programming.rst:57 msgid "Yes." msgstr "はい。" @@ -74,16 +82,14 @@ msgstr "" #: ../../faq/programming.rst:27 msgid "" "The IDLE interactive development environment, which is part of the standard " -"Python distribution (normally available as `Tools/scripts/idle3 `_), includes a " +"Python distribution (normally available as Tools/scripts/idle), includes a " "graphical debugger." msgstr "" "Python に同梱されている統合開発環境の IDLE は通常の Python の配布形態の一部 " -"(普通は `Tools/scripts/idle3 `_ から利用可能) であり、グラフィカルなデバッガを含んでい" -"ます。" +"(普通は Tools/scripts/idle から利用可能) であり、グラフィカルなデバッガを含ん" +"でいます。" -#: ../../faq/programming.rst:32 +#: ../../faq/programming.rst:31 msgid "" "PythonWin is a Python IDE that includes a GUI debugger based on pdb. The " "PythonWin debugger colors breakpoints and has quite a few cool features such " @@ -94,82 +100,77 @@ msgid "" msgstr "" "PythonWin は、pdb をベースとした GUI デバッガを含む Python IDE です。" "Pythonwin デバッガは、ブレークポイントの色付けや非 PythonWin プログラムのデ" -"バッグなどの素敵な機能をたくさん持っています。PythonWin は `pywin32 " -"`_ プロジェクトの一部、あるいは " -"`ActivePython `_ ディストリ" -"ビューションの一部として利用可能です。" +"バッグなどの素敵な機能をたくさん持っています。PythonWin は `pywin32 `_ プロ" +"ジェクトの一部、あるいは `ActivePython `_ ディストリビューションの一部として" +"利用可能です。" -#: ../../faq/programming.rst:39 +#: ../../faq/programming.rst:38 msgid "" -"`Eric `_ is an IDE built on PyQt and " +"`Eric `_ is an IDE built on PyQt and " "the Scintilla editing component." msgstr "" -"`Eric `_ は PyQt や Scintilla editing " +"`Eric `_ は PyQt や Scintilla editing " "component をもとにした IDE です。" -#: ../../faq/programming.rst:42 +#: ../../faq/programming.rst:41 msgid "" "`trepan3k `_ is a gdb-like " "debugger." -msgstr "" -"`trepan3k `_ は gdbライクなデバッガ" -"です。" +msgstr "`trepan3k `_ は gdbライクなデバッガです。" -#: ../../faq/programming.rst:44 +#: ../../faq/programming.rst:43 msgid "" "`Visual Studio Code `_ is an IDE with " "debugging tools that integrates with version-control software." msgstr "" -"`Visual Studio Code `_ はバージョン管理ソフト" -"と一緒になったデバッグツールを備えた IDE です" +"`Visual Studio Code `_ はバージョン管理ソフトと一緒になったデバッグツールを備" +"えた IDE です" -#: ../../faq/programming.rst:47 +#: ../../faq/programming.rst:46 msgid "" "There are a number of commercial Python IDEs that include graphical " "debuggers. They include:" msgstr "商業のグラフィカルデバッガ付き Python IDE もあります。例えば:" -#: ../../faq/programming.rst:50 +#: ../../faq/programming.rst:49 msgid "`Wing IDE `_" msgstr "`Wing IDE `_" -#: ../../faq/programming.rst:51 +#: ../../faq/programming.rst:50 msgid "`Komodo IDE `_" msgstr "`Komodo IDE `_" -#: ../../faq/programming.rst:52 +#: ../../faq/programming.rst:51 msgid "`PyCharm `_" msgstr "`PyCharm `_" -#: ../../faq/programming.rst:56 +#: ../../faq/programming.rst:55 msgid "Are there tools to help find bugs or perform static analysis?" msgstr "バグの発見や静的解析に役立つツールはありますか?" -#: ../../faq/programming.rst:60 +#: ../../faq/programming.rst:59 msgid "" -"`Pylint `_ and `Pyflakes " -"`_ do basic checking that will help you " -"catch bugs sooner." +"`Pylint `_ and `Pyflakes `_ do basic checking that will help you catch bugs sooner." msgstr "" -"`Pylint `_ と `Pyflakes " -"`_ は、バグの早期発見に役立つ基本的な" -"チェックを行います。" +"`Pylint `_ と `Pyflakes `_ は、バグの早期発見に役立つ基本的なチェックを行いま" +"す。" -#: ../../faq/programming.rst:64 +#: ../../faq/programming.rst:63 msgid "" -"Static type checkers such as `Mypy `_, `Pyre " -"`_, and `Pytype `_ can check type hints in Python source code." +"Static type checkers such as `Mypy `_, `Pyre `_, and `Pytype `_ can " +"check type hints in Python source code." msgstr "" -"`Mypy `_, `Pyre `_, `Pytype " +"`Mypy `_, `Pyre `_, `Pytype " "`_ などの静的型チェッカーは、 Python ソース" "コードにある型ヒントをチェックできます。" -#: ../../faq/programming.rst:73 +#: ../../faq/programming.rst:72 msgid "How can I create a stand-alone binary from a Python script?" msgstr "どうしたら Python スクリプトからスタンドアロンバイナリを作れますか?" -#: ../../faq/programming.rst:75 +#: ../../faq/programming.rst:74 msgid "" "You don't need the ability to compile Python to C code if all you want is a " "stand-alone program that users can download and run without having to " @@ -183,21 +184,19 @@ msgstr "" "のモジュールを Python バイナリに束縛して一つの実行可能ファイルにまとめる多く" "のツールがあります。" -#: ../../faq/programming.rst:81 +#: ../../faq/programming.rst:80 msgid "" "One is to use the freeze tool, which is included in the Python source tree " -"as `Tools/freeze `_. It converts Python byte code to C arrays; with a C compiler you " -"can embed all your modules into a new program, which is then linked with the " -"standard Python modules." -msgstr "" -"一つは freeze ツールで、Python ソースツリーに `Tools/freeze `_ として含まれています。これは " -"Python バイトコードを C 配列に変換します。すべてのモジュールを新しいプログラ" -"ムに埋め込む C コンパイラで、そのプログラムは Python モジュールにリンクされま" -"す。" +"as ``Tools/freeze``. It converts Python byte code to C arrays; a C compiler " +"you can embed all your modules into a new program, which is then linked with " +"the standard Python modules." +msgstr "" +"一つは freeze ツールで、Python ソースツリーに ``Tools/freeze`` として含まれて" +"います。これは Python バイトコードを C 配列に変換します。すべてのモジュールを" +"新しいプログラムに埋め込む C コンパイラで、そのプログラムは Python モジュール" +"にリンクされます。" -#: ../../faq/programming.rst:87 +#: ../../faq/programming.rst:85 msgid "" "It works by scanning your source recursively for import statements (in both " "forms) and looking for the modules in the standard Python path as well as in " @@ -218,47 +217,47 @@ msgstr "" "Python インタプリタの残りとリンクし、元のスクリプトと全く同じように動作する自" "己完結的なバイナリを形成します。" -#: ../../faq/programming.rst:96 +#: ../../faq/programming.rst:94 msgid "" "The following packages can help with the creation of console and GUI " "executables:" msgstr "以下のパッケージはコンソールやGUIの実行ファイル作成に役立ちます。" -#: ../../faq/programming.rst:99 +#: ../../faq/programming.rst:97 msgid "`Nuitka `_ (Cross-platform)" msgstr "`Nuitka `_ (Cross-platform)" -#: ../../faq/programming.rst:100 -msgid "`PyInstaller `_ (Cross-platform)" -msgstr "`PyInstaller `_ (Cross-platform)" +#: ../../faq/programming.rst:98 +msgid "`PyInstaller `_ (Cross-platform)" +msgstr "" -#: ../../faq/programming.rst:101 +#: ../../faq/programming.rst:99 msgid "" "`PyOxidizer `_ (Cross-platform)" msgstr "" "`PyOxidizer `_ (Cross-platform)" -#: ../../faq/programming.rst:102 +#: ../../faq/programming.rst:100 msgid "" "`cx_Freeze `_ (Cross-platform)" msgstr "" "`cx_Freeze `_ (Cross-platform)" -#: ../../faq/programming.rst:103 +#: ../../faq/programming.rst:101 msgid "`py2app `_ (macOS only)" msgstr "`py2app `_ (macOS only)" -#: ../../faq/programming.rst:104 -msgid "`py2exe `_ (Windows only)" -msgstr "`py2exe `_ (Windows only)" +#: ../../faq/programming.rst:102 +msgid "`py2exe `_ (Windows only)" +msgstr "" -#: ../../faq/programming.rst:107 +#: ../../faq/programming.rst:105 msgid "Are there coding standards or a style guide for Python programs?" msgstr "" "Python プログラムのためのコーディングスタンダードやスタイルガイドはあります" "か?" -#: ../../faq/programming.rst:109 +#: ../../faq/programming.rst:107 msgid "" "Yes. The coding style required for standard library modules is documented " "as :pep:`8`." @@ -266,36 +265,36 @@ msgstr "" "はい。標準ライブラリモジュールに求められるコーディングスタイルは :pep:`8` と" "して文書化されています。" -#: ../../faq/programming.rst:114 +#: ../../faq/programming.rst:112 msgid "Core Language" msgstr "コア言語" -#: ../../faq/programming.rst:119 +#: ../../faq/programming.rst:115 msgid "Why am I getting an UnboundLocalError when the variable has a value?" msgstr "なぜ変数に値があるのに UnboundLocalError が出るのですか?" -#: ../../faq/programming.rst:121 +#: ../../faq/programming.rst:117 msgid "" -"It can be a surprise to get the :exc:`UnboundLocalError` in previously " -"working code when it is modified by adding an assignment statement somewhere " -"in the body of a function." +"It can be a surprise to get the UnboundLocalError in previously working code " +"when it is modified by adding an assignment statement somewhere in the body " +"of a function." msgstr "" "もともと動いていたコードが、関数の本体のどこかに代入文を加えるという変更をし" -"たら :exc:`UnboundLocalError` を出すのには驚くかもしれません。" +"たら UnboundLocalError を出すのには驚くかもしれません。" -#: ../../faq/programming.rst:125 +#: ../../faq/programming.rst:121 msgid "This code:" msgstr "このコード:" -#: ../../faq/programming.rst:134 +#: ../../faq/programming.rst:129 msgid "works, but this code:" msgstr "は動きますが、このコード:" -#: ../../faq/programming.rst:141 -msgid "results in an :exc:`!UnboundLocalError`:" -msgstr "は :exc:`!UnboundLocalError` になります:" +#: ../../faq/programming.rst:136 +msgid "results in an UnboundLocalError:" +msgstr "は UnboundLocalError になります:" -#: ../../faq/programming.rst:148 +#: ../../faq/programming.rst:143 msgid "" "This is because when you make an assignment to a variable in a scope, that " "variable becomes local to that scope and shadows any similarly named " @@ -310,14 +309,14 @@ msgstr "" "ると認識します。その結果、先の ``print(x)`` が初期化されていないローカル変数" "を表示しようとして結果はエラーとなります。" -#: ../../faq/programming.rst:155 +#: ../../faq/programming.rst:150 msgid "" "In the example above you can access the outer scope variable by declaring it " "global:" msgstr "" "上の例では、グローバルであると宣言することで外のスコープにアクセスできます:" -#: ../../faq/programming.rst:167 +#: ../../faq/programming.rst:161 msgid "" "This explicit declaration is required in order to remind you that (unlike " "the superficially analogous situation with class and instance variables) you " @@ -327,7 +326,7 @@ msgstr "" "て) あなたは実際は他のスコープの変数の値を変えようとしているのだ、ということ" "を知らせるのに必要です:" -#: ../../faq/programming.rst:174 +#: ../../faq/programming.rst:168 msgid "" "You can do a similar thing in a nested scope using the :keyword:`nonlocal` " "keyword:" @@ -335,11 +334,11 @@ msgstr "" "同様のことを、ネストされたスコープで :keyword:`nonlocal` 予約語を使うことでも" "できます:" -#: ../../faq/programming.rst:192 +#: ../../faq/programming.rst:185 msgid "What are the rules for local and global variables in Python?" msgstr "Python のローカルとグローバル変数のルールは何ですか?" -#: ../../faq/programming.rst:194 +#: ../../faq/programming.rst:187 msgid "" "In Python, variables that are only referenced inside a function are " "implicitly global. If a variable is assigned a value anywhere within the " @@ -350,7 +349,7 @@ msgstr "" "関数の本体のどこかで値が変数に代入されたなら、それは明示的にグローバルである" "と宣言されない限り、ローカルであるとみなされます。" -#: ../../faq/programming.rst:198 +#: ../../faq/programming.rst:191 msgid "" "Though a bit surprising at first, a moment's consideration explains this. " "On one hand, requiring :keyword:`global` for assigned variables provides a " @@ -367,14 +366,14 @@ msgstr "" "内容を参照するたびにグローバル宣言をしなければならないのです。その乱雑さは副" "作用を特定するための ``global`` 宣言の便利さよりも重大です。" -#: ../../faq/programming.rst:208 +#: ../../faq/programming.rst:201 msgid "" "Why do lambdas defined in a loop with different values all return the same " "result?" msgstr "" "ループの中で異なる値で定義されたラムダ式が、同じ値を返すのはなぜですか?" -#: ../../faq/programming.rst:210 +#: ../../faq/programming.rst:203 msgid "" "Assume you use a for loop to define a few different lambdas (or even plain " "functions), e.g.::" @@ -382,14 +381,7 @@ msgstr "" "for ループを使って、少しずつ異なるラムダを定義 (もしくは簡単な関数) するとし" "ます。例えば::" -#: ../../faq/programming.rst:213 -msgid "" -">>> squares = []\n" -">>> for x in range(5):\n" -"... squares.append(lambda: x**2)" -msgstr "" - -#: ../../faq/programming.rst:217 +#: ../../faq/programming.rst:210 msgid "" "This gives you a list that contains 5 lambdas that calculate ``x**2``. You " "might expect that, when called, they would return, respectively, ``0``, " @@ -401,15 +393,7 @@ msgstr "" "ません。しかし実際にやってみると、全て ``16`` が返ってくるのを目にするでしょ" "う::" -#: ../../faq/programming.rst:222 -msgid "" -">>> squares[2]()\n" -"16\n" -">>> squares[4]()\n" -"16" -msgstr "" - -#: ../../faq/programming.rst:227 +#: ../../faq/programming.rst:220 msgid "" "This happens because ``x`` is not local to the lambdas, but is defined in " "the outer scope, and it is accessed when the lambda is called --- not when " @@ -423,14 +407,7 @@ msgstr "" "は ``4**2`` つまり ``16`` を返します。このことは ``x`` の値を変えてみることで" "検証でき、ラムダの返り値がどのように変わるのか観察できます::" -#: ../../faq/programming.rst:233 -msgid "" -">>> x = 8\n" -">>> squares[2]()\n" -"64" -msgstr "" - -#: ../../faq/programming.rst:237 +#: ../../faq/programming.rst:230 msgid "" "In order to avoid this, you need to save the values in variables local to " "the lambdas, so that they don't rely on the value of the global ``x``::" @@ -438,14 +415,7 @@ msgstr "" "これを避けるためには、グローバルの ``x`` の値に依存しないために、ラムダにとっ" "てのローカル変数に値を保存する必要があります::" -#: ../../faq/programming.rst:240 -msgid "" -">>> squares = []\n" -">>> for x in range(5):\n" -"... squares.append(lambda n=x: n**2)" -msgstr "" - -#: ../../faq/programming.rst:244 +#: ../../faq/programming.rst:237 msgid "" "Here, ``n=x`` creates a new variable ``n`` local to the lambda and computed " "when the lambda is defined so that it has the same value that ``x`` had at " @@ -459,15 +429,7 @@ msgstr "" "``1``、3 つ目では ``2`` 以下同様、となることを意味します。従って、それぞれの" "ラムダは今や正しい値を返すようになりました::" -#: ../../faq/programming.rst:250 -msgid "" -">>> squares[2]()\n" -"4\n" -">>> squares[4]()\n" -"16" -msgstr "" - -#: ../../faq/programming.rst:255 +#: ../../faq/programming.rst:248 msgid "" "Note that this behaviour is not peculiar to lambdas, but applies to regular " "functions too." @@ -475,11 +437,11 @@ msgstr "" "この動作はラムダに特有なものではなく、通常の関数にも適用されることに注意して" "ください。" -#: ../../faq/programming.rst:260 +#: ../../faq/programming.rst:253 msgid "How do I share global variables across modules?" msgstr "グローバル変数をモジュール間で共有するにはどうしたらいいですか?" -#: ../../faq/programming.rst:262 +#: ../../faq/programming.rst:255 msgid "" "The canonical way to share information across modules within a single " "program is to create a special module (often called config or cfg). Just " @@ -495,48 +457,31 @@ msgstr "" "あるので、設定モジュールオブジェクトに対するいかなる変更も全体に反映されま" "す。例えば:" -#: ../../faq/programming.rst:268 +#: ../../faq/programming.rst:261 msgid "config.py::" msgstr "config.py::" -#: ../../faq/programming.rst:270 -msgid "x = 0 # Default value of the 'x' configuration setting" -msgstr "" - -#: ../../faq/programming.rst:272 +#: ../../faq/programming.rst:265 msgid "mod.py::" msgstr "mod.py::" -#: ../../faq/programming.rst:274 -msgid "" -"import config\n" -"config.x = 1" -msgstr "" - -#: ../../faq/programming.rst:277 +#: ../../faq/programming.rst:270 msgid "main.py::" msgstr "main.py::" -#: ../../faq/programming.rst:279 -msgid "" -"import config\n" -"import mod\n" -"print(config.x)" -msgstr "" - -#: ../../faq/programming.rst:283 +#: ../../faq/programming.rst:276 msgid "" -"Note that using a module is also the basis for implementing the singleton " +"Note that using a module is also the basis for implementing the Singleton " "design pattern, for the same reason." msgstr "" "なお、同じ理由から、モジュールを使うということは、シングルトンデザインパター" "ンを実装することの基礎でもあります。" -#: ../../faq/programming.rst:288 +#: ../../faq/programming.rst:281 msgid "What are the \"best practices\" for using import in a module?" msgstr "モジュールで import を使う際の「ベストプラクティス」は何ですか?" -#: ../../faq/programming.rst:290 +#: ../../faq/programming.rst:283 msgid "" "In general, don't use ``from modulename import *``. Doing so clutters the " "importer's namespace, and makes it much harder for linters to detect " @@ -546,7 +491,7 @@ msgstr "" "インポータの名前空間は汚染され、linter が未定義の名前を発見することが難しくな" "ります。" -#: ../../faq/programming.rst:294 +#: ../../faq/programming.rst:287 msgid "" "Import modules at the top of a file. Doing so makes it clear what other " "modules your code requires and avoids questions of whether the module name " @@ -559,31 +504,27 @@ msgstr "" "と削除が容易になりますが、行に複数のインポートにすると画面の領域が少なく済み" "ます。" -#: ../../faq/programming.rst:299 +#: ../../faq/programming.rst:292 msgid "It's good practice if you import modules in the following order:" msgstr "次の手順でモジュールをインポートするのが、良い習慣になります:" -#: ../../faq/programming.rst:301 -msgid "" -"standard library modules -- e.g. :mod:`sys`, :mod:`os`, :mod:`argparse`, :" -"mod:`re`" -msgstr "" -"標準ライブラリモジュール -- 例 :mod:`sys`、:mod:`os`、:mod:`argparse`、:mod:" -"`re`" +#: ../../faq/programming.rst:294 +msgid "standard library modules -- e.g. ``sys``, ``os``, ``getopt``, ``re``" +msgstr "標準ライブラリモジュール -- 例 ``sys``、``os``、``getopt``、``re``" -#: ../../faq/programming.rst:302 +#: ../../faq/programming.rst:295 msgid "" "third-party library modules (anything installed in Python's site-packages " -"directory) -- e.g. :mod:`!dateutil`, :mod:`!requests`, :mod:`!PIL.Image`" +"directory) -- e.g. mx.DateTime, ZODB, PIL.Image, etc." msgstr "" "サードパーティのライブラリモジュール (Python の site-packages ディレクトリに" -"あるもの) -- 例 :mod:`!dateutil`、:mod:`!requests`、:mod:`!PIL.Image`、など" +"あるもの) -- 例 mx.DateTime、ZODB、PIL.Image、など" -#: ../../faq/programming.rst:304 -msgid "locally developed modules" +#: ../../faq/programming.rst:297 +msgid "locally-developed modules" msgstr "自前で開発したモジュール" -#: ../../faq/programming.rst:306 +#: ../../faq/programming.rst:299 msgid "" "It is sometimes necessary to move imports to a function or class to avoid " "problems with circular imports. Gordon McMillan says:" @@ -591,7 +532,7 @@ msgstr "" "循環参照の問題を避けるために、インポートを関数やクラスに移すことが必要なとき" "もあります。Gordon McMillan によれば:" -#: ../../faq/programming.rst:309 +#: ../../faq/programming.rst:302 msgid "" "Circular imports are fine where both modules use the \"import \" " "form of import. They fail when the 2nd module wants to grab a name out of " @@ -605,7 +546,7 @@ msgstr "" "最初のモジュールが二つ目のモジュールをインポートするのに忙しくて、最初のモ" "ジュールの名前が利用可能になっていないからです。" -#: ../../faq/programming.rst:315 +#: ../../faq/programming.rst:308 msgid "" "In this case, if the second module is only used in one function, then the " "import can easily be moved into that function. By the time the import is " @@ -617,7 +558,7 @@ msgstr "" "ジュールは初期化を完了していて、二つ目のモジュールは自分のインポートをできま" "す。" -#: ../../faq/programming.rst:320 +#: ../../faq/programming.rst:313 msgid "" "It may also be necessary to move imports out of the top level of code if " "some of the modules are platform-specific. In that case, it may not even be " @@ -630,7 +571,7 @@ msgstr "" "ポートすることさえできないかもしれません。この場合は、対応するプラットフォー" "ムに合わせたコードで正しいモジュールをインポートすることを選ぶと良いです。" -#: ../../faq/programming.rst:325 +#: ../../faq/programming.rst:318 msgid "" "Only move imports into a local scope, such as inside a function definition, " "if it's necessary to solve a problem such as avoiding a circular import or " @@ -653,11 +594,11 @@ msgstr "" "ジュール名がスコープから外れてさえ、そのモジュールはおそらく :data:`sys." "modules` から利用できるでしょう。" -#: ../../faq/programming.rst:338 +#: ../../faq/programming.rst:331 msgid "Why are default values shared between objects?" msgstr "なぜオブジェクト間でデフォルト値が共有されるのですか?" -#: ../../faq/programming.rst:340 +#: ../../faq/programming.rst:333 msgid "" "This type of bug commonly bites neophyte programmers. Consider this " "function::" @@ -665,15 +606,7 @@ msgstr "" "この種のバグがよく初心者プログラマに噛み付きます。この関数を考えてみてくださ" "い::" -#: ../../faq/programming.rst:342 -msgid "" -"def foo(mydict={}): # Danger: shared reference to one dict for all calls\n" -" ... compute something ...\n" -" mydict[key] = value\n" -" return mydict" -msgstr "" - -#: ../../faq/programming.rst:347 +#: ../../faq/programming.rst:340 msgid "" "The first time you call this function, ``mydict`` contains a single item. " "The second time, ``mydict`` contains two items because when ``foo()`` begins " @@ -683,7 +616,7 @@ msgstr "" "は、``foo()`` が実行されるときに ``mydict`` には初めから一つの要素をすでに" "持っているので、``mydict`` には二つの要素があります。" -#: ../../faq/programming.rst:351 +#: ../../faq/programming.rst:344 msgid "" "It is often expected that a function call creates new objects for default " "values. This is not what happens. Default values are created exactly once, " @@ -696,7 +629,7 @@ msgstr "" "に一度だけ生成されます。この例の辞書のように、そのオブジェクトが変更されたと" "き、その後の関数の呼び出しは変更後のオブジェクトを参照します。" -#: ../../faq/programming.rst:356 +#: ../../faq/programming.rst:349 msgid "" "By definition, immutable objects such as numbers, strings, tuples, and " "``None``, are safe from change. Changes to mutable objects such as " @@ -706,7 +639,7 @@ msgstr "" "使うと変更される危険がありません。辞書、リスト、クラスインスタンスなどの" "ミュータブルなオブジェクトは混乱のもとです。" -#: ../../faq/programming.rst:360 +#: ../../faq/programming.rst:353 msgid "" "Because of this feature, it is good programming practice to not use mutable " "objects as default values. Instead, use ``None`` as the default value and " @@ -718,24 +651,11 @@ msgstr "" "が ``None`` である時にだけ、関数の内部で新しいリスト/辞書/その他をつくるよう" "にしてください。例えば、こう書かずに::" -#: ../../faq/programming.rst:365 -msgid "" -"def foo(mydict={}):\n" -" ..." -msgstr "" - -#: ../../faq/programming.rst:368 +#: ../../faq/programming.rst:361 msgid "but::" msgstr "代わりに::" -#: ../../faq/programming.rst:370 -msgid "" -"def foo(mydict=None):\n" -" if mydict is None:\n" -" mydict = {} # create a new dict for local namespace" -msgstr "" - -#: ../../faq/programming.rst:374 +#: ../../faq/programming.rst:367 msgid "" "This feature can be useful. When you have a function that's time-consuming " "to compute, a common technique is to cache the parameters and the resulting " @@ -748,21 +668,7 @@ msgstr "" "再び同じ値が要求されたらキャッシュされた値を返すというものです。これは " "\"memoizing\" と呼ばれ、このように実装されます::" -#: ../../faq/programming.rst:379 -msgid "" -"# Callers can only provide two parameters and optionally pass _cache by " -"keyword\n" -"def expensive(arg1, arg2, *, _cache={}):\n" -" if (arg1, arg2) in _cache:\n" -" return _cache[(arg1, arg2)]\n" -"\n" -" # Calculate the value\n" -" result = ... expensive computation ...\n" -" _cache[(arg1, arg2)] = result # Store result in the cache\n" -" return result" -msgstr "" - -#: ../../faq/programming.rst:389 +#: ../../faq/programming.rst:382 msgid "" "You could use a global variable containing a dictionary instead of the " "default value; it's a matter of taste." @@ -770,14 +676,14 @@ msgstr "" "デフォルト値の代わりに、辞書を含むグローバル変数も使えます。これは好みの問題" "です。" -#: ../../faq/programming.rst:394 +#: ../../faq/programming.rst:387 msgid "" "How can I pass optional or keyword parameters from one function to another?" msgstr "" "オプションパラメータやキーワードパラメータを関数から関数へ渡すにはどうしたら" "いいですか?" -#: ../../faq/programming.rst:396 +#: ../../faq/programming.rst:389 msgid "" "Collect the arguments using the ``*`` and ``**`` specifiers in the " "function's parameter list; this gives you the positional arguments as a " @@ -789,39 +695,24 @@ msgstr "" "ます。これで、他の関数を呼び出すときに ``*`` と ``**`` を使ってそれらの引数を" "渡せます::" -#: ../../faq/programming.rst:401 -msgid "" -"def f(x, *args, **kwargs):\n" -" ...\n" -" kwargs['width'] = '14.3c'\n" -" ...\n" -" g(x, *args, **kwargs)" -msgstr "" - -#: ../../faq/programming.rst:415 +#: ../../faq/programming.rst:408 msgid "What is the difference between arguments and parameters?" msgstr "実引数と仮引数の違いは何ですか?" -#: ../../faq/programming.rst:417 +#: ../../faq/programming.rst:410 msgid "" ":term:`Parameters ` are defined by the names that appear in a " "function definition, whereas :term:`arguments ` are the values " -"actually passed to a function when calling it. Parameters define what :term:" -"`kind of arguments ` a function can accept. For example, given " -"the function definition::" +"actually passed to a function when calling it. Parameters define what types " +"of arguments a function can accept. For example, given the function " +"definition::" msgstr "" ":term:`仮引数 (parameter) ` は関数定義に表れる名前で定義されるのに" "対し、 :term:`実引数 (argument) ` は関数を呼び出すときに実際に渡す" -"値のことです。仮引数は関数が受け取ることの出来る :term:`実引数の型 " -"` を定義します。例えば、以下のような関数定義があったとして::" +"値のことです。仮引数は関数が受け取ることの出来る実引数の型を定義します。例え" +"ば、以下のような関数定義があったとして::" -#: ../../faq/programming.rst:423 -msgid "" -"def func(foo, bar=None, **kwargs):\n" -" pass" -msgstr "" - -#: ../../faq/programming.rst:426 +#: ../../faq/programming.rst:418 msgid "" "*foo*, *bar* and *kwargs* are parameters of ``func``. However, when calling " "``func``, for example::" @@ -829,45 +720,30 @@ msgstr "" "*foo*、*bar*、*kwargs* は ``func`` の仮引数です。一方、``func`` を呼び出すと" "きには、例えば::" -#: ../../faq/programming.rst:429 -msgid "func(42, bar=314, extra=somevar)" -msgstr "" - -#: ../../faq/programming.rst:431 +#: ../../faq/programming.rst:423 msgid "the values ``42``, ``314``, and ``somevar`` are arguments." msgstr "``42``、``314``、``somevar`` という値は実引数です。" -#: ../../faq/programming.rst:435 +#: ../../faq/programming.rst:427 msgid "Why did changing list 'y' also change list 'x'?" msgstr "なぜ list 'y' を変更すると list 'x' も変更されるのですか?" -#: ../../faq/programming.rst:437 +#: ../../faq/programming.rst:429 msgid "If you wrote code like::" msgstr "次のようなコードを書いたとします::" #: ../../faq/programming.rst:439 msgid "" -">>> x = []\n" -">>> y = x\n" -">>> y.append(10)\n" -">>> y\n" -"[10]\n" -">>> x\n" -"[10]" -msgstr "" - -#: ../../faq/programming.rst:447 -msgid "" "you might be wondering why appending an element to ``y`` changed ``x`` too." msgstr "" "どうして ``y`` への要素の追加が ``x`` も変更してしまうのか疑問に思うかもしれ" "ません。 " -#: ../../faq/programming.rst:449 +#: ../../faq/programming.rst:441 msgid "There are two factors that produce this result:" msgstr "このような結果になる2つの要因があります:" -#: ../../faq/programming.rst:451 +#: ../../faq/programming.rst:443 msgid "" "Variables are simply names that refer to objects. Doing ``y = x`` doesn't " "create a copy of the list -- it creates a new variable ``y`` that refers to " @@ -880,38 +756,27 @@ msgstr "" "(この場合リスト)だけであって、 ``x`` と ``y`` の両方がそれを参照しているので" "す。" -#: ../../faq/programming.rst:455 +#: ../../faq/programming.rst:447 msgid "" "Lists are :term:`mutable`, which means that you can change their content." msgstr "リストは :term:`mutable` です。内容を変更出来る、ということです。" -#: ../../faq/programming.rst:457 +#: ../../faq/programming.rst:449 msgid "" -"After the call to :meth:`!append`, the content of the mutable object has " -"changed from ``[]`` to ``[10]``. Since both the variables refer to the same " -"object, using either name accesses the modified value ``[10]``." +"After the call to :meth:`~list.append`, the content of the mutable object " +"has changed from ``[]`` to ``[10]``. Since both the variables refer to the " +"same object, using either name accesses the modified value ``[10]``." msgstr "" -":meth:`!append` 呼び出しの後、ミュータブルオブジェクトの内容が ``[]`` から " -"``[10]`` に変わります。 変数が同じオブジェクトを参照しているので、どちらの名" -"前であっても変更された値 ``[10]`` にアクセスします。" +":meth:`~list.append` 呼び出しの後、ミュータブルオブジェクトの内容が ``[]`` か" +"ら ``[10]`` に変わります。 変数が同じオブジェクトを参照しているので、どちらの" +"名前であっても変更された値 ``[10]`` にアクセスします。" -#: ../../faq/programming.rst:461 +#: ../../faq/programming.rst:453 msgid "If we instead assign an immutable object to ``x``::" msgstr "代わりに ``x`` にイミュータブルを代入すると::" #: ../../faq/programming.rst:463 msgid "" -">>> x = 5 # ints are immutable\n" -">>> y = x\n" -">>> x = x + 1 # 5 can't be mutated, we are creating a new object here\n" -">>> x\n" -"6\n" -">>> y\n" -"5" -msgstr "" - -#: ../../faq/programming.rst:471 -msgid "" "we can see that in this case ``x`` and ``y`` are not equal anymore. This is " "because integers are :term:`immutable`, and when we do ``x = x + 1`` we are " "not mutating the int ``5`` by incrementing its value; instead, we are " @@ -928,27 +793,27 @@ msgstr "" "数はそれらを参照しています(``x`` はいまや ``6`` を参照していますが ``y`` は " "``5`` を参照したままです)。" -#: ../../faq/programming.rst:479 +#: ../../faq/programming.rst:471 msgid "" "Some operations (for example ``y.append(10)`` and ``y.sort()``) mutate the " "object, whereas superficially similar operations (for example ``y = y + " -"[10]`` and :func:`sorted(y) `) create a new object. In general in " -"Python (and in all cases in the standard library) a method that mutates an " -"object will return ``None`` to help avoid getting the two types of " -"operations confused. So if you mistakenly write ``y.sort()`` thinking it " -"will give you a sorted copy of ``y``, you'll instead end up with ``None``, " -"which will likely cause your program to generate an easily diagnosed error." +"[10]`` and ``sorted(y)``) create a new object. In general in Python (and in " +"all cases in the standard library) a method that mutates an object will " +"return ``None`` to help avoid getting the two types of operations confused. " +"So if you mistakenly write ``y.sort()`` thinking it will give you a sorted " +"copy of ``y``, you'll instead end up with ``None``, which will likely cause " +"your program to generate an easily diagnosed error." msgstr "" "ある演算 (たとえば ``y.append(10)``, ``y.sort()``) がオブジェクトを変更する一" -"方で、外見上は似た演算 (たとえば ``y = y + [10]``, :func:`sorted(y) " -"`) は新しいオブジェクトを作ります。Python では一般に (そして標準ライ" -"ブラリの全てのケースで)、このような 2 つのタイプの演算にまつわる混乱を避ける" -"ために、オブジェクトを変更するメソッドは ``None`` を返します。ですからもしあ" -"なたが誤って ``y`` の複製の並び替えをするつもりで ``y.sort()`` と書いた場合に" -"結果手にするのは ``None`` でしょうから、あなたのプログラムは簡単に診断出来る" -"エラーを起こすでしょう。" +"方で、外見上は似た演算 (たとえば ``y = y + [10]``, ``sorted(y)``) は新しいオ" +"ブジェクトを作ります。Python では一般に (そして標準ライブラリの全てのケース" +"で)、このような 2 つのタイプの演算にまつわる混乱を避けるために、オブジェクト" +"を変更するメソッドは ``None`` を返します。ですからもしあなたが誤って ``y`` の" +"複製の並び替えをするつもりで ``y.sort()`` と書いた場合に結果手にするのは " +"``None`` でしょうから、あなたのプログラムは簡単に診断出来るエラーを起こすで" +"しょう。" -#: ../../faq/programming.rst:488 +#: ../../faq/programming.rst:480 msgid "" "However, there is one class of operations where the same operation sometimes " "has different behaviors with different types: the augmented assignment " @@ -963,11 +828,11 @@ msgstr "" "で、そして ``a_list`` を変更しますが、 ``some_tuple += (1, 2, 3)`` と " "``some_int += 1`` は新しいオブジェクトを作ります)。" -#: ../../faq/programming.rst:495 +#: ../../faq/programming.rst:487 msgid "In other words:" msgstr "言い換えると:" -#: ../../faq/programming.rst:497 +#: ../../faq/programming.rst:489 msgid "" "If we have a mutable object (:class:`list`, :class:`dict`, :class:`set`, " "etc.), we can use some specific operations to mutate it and all the " @@ -977,7 +842,7 @@ msgstr "" "持っている場合、私たちはその内容を変更するある種の演算を使うことが出来、それ" "を参照している全ての変数はその変化を見ることになるでしょう。" -#: ../../faq/programming.rst:500 +#: ../../faq/programming.rst:492 msgid "" "If we have an immutable object (:class:`str`, :class:`int`, :class:`tuple`, " "etc.), all the variables that refer to it will always see the same value, " @@ -989,7 +854,7 @@ msgstr "" "が、持っている値を新しい値に変換する演算はいつでも新しいオブジェクトを返しま" "す。" -#: ../../faq/programming.rst:505 +#: ../../faq/programming.rst:497 msgid "" "If you want to know if two variables refer to the same object or not, you " "can use the :keyword:`is` operator, or the built-in function :func:`id`." @@ -997,11 +862,11 @@ msgstr "" "2つの変数が同じオブジェクトを参照しているかどうかが知りたければ、 :keyword:" "`is` 演算子や組み込み関数 :func:`id` が使えます。" -#: ../../faq/programming.rst:510 +#: ../../faq/programming.rst:502 msgid "How do I write a function with output parameters (call by reference)?" msgstr "出力引数のある関数 (参照渡し) はどのように書きますか?" -#: ../../faq/programming.rst:512 +#: ../../faq/programming.rst:504 msgid "" "Remember that arguments are passed by assignment in Python. Since " "assignment just creates references to objects, there's no alias between an " @@ -1013,99 +878,46 @@ msgstr "" "ませんし、参照渡しそれ自体はありません。望む効果を得るためには幾つかの方法が" "あります。" -#: ../../faq/programming.rst:517 +#: ../../faq/programming.rst:509 msgid "By returning a tuple of the results::" msgstr "結果のタプルを返すことによって::" -#: ../../faq/programming.rst:519 -msgid "" -">>> def func1(a, b):\n" -"... a = 'new-value' # a and b are local names\n" -"... b = b + 1 # assigned to new objects\n" -"... return a, b # return new values\n" -"...\n" -">>> x, y = 'old-value', 99\n" -">>> func1(x, y)\n" -"('new-value', 100)" -msgstr "" - -#: ../../faq/programming.rst:528 +#: ../../faq/programming.rst:520 msgid "This is almost always the clearest solution." msgstr "これはたいてい一番明確な方法です。" -#: ../../faq/programming.rst:530 +#: ../../faq/programming.rst:522 msgid "" "By using global variables. This isn't thread-safe, and is not recommended." msgstr "" "グローバル変数を使って。これはスレッドセーフでないので、推奨されません。" -#: ../../faq/programming.rst:532 +#: ../../faq/programming.rst:524 msgid "By passing a mutable (changeable in-place) object::" msgstr "" "ミュータブルな (インプレースに変更可能な) オブジェクトを渡すことによって::" -#: ../../faq/programming.rst:534 -msgid "" -">>> def func2(a):\n" -"... a[0] = 'new-value' # 'a' references a mutable list\n" -"... a[1] = a[1] + 1 # changes a shared object\n" -"...\n" -">>> args = ['old-value', 99]\n" -">>> func2(args)\n" -">>> args\n" -"['new-value', 100]" -msgstr "" - -#: ../../faq/programming.rst:543 +#: ../../faq/programming.rst:535 msgid "By passing in a dictionary that gets mutated::" msgstr "変更される辞書に渡すことによって::" -#: ../../faq/programming.rst:545 -msgid "" -">>> def func3(args):\n" -"... args['a'] = 'new-value' # args is a mutable dictionary\n" -"... args['b'] = args['b'] + 1 # change it in-place\n" -"...\n" -">>> args = {'a': 'old-value', 'b': 99}\n" -">>> func3(args)\n" -">>> args\n" -"{'a': 'new-value', 'b': 100}" -msgstr "" - -#: ../../faq/programming.rst:554 +#: ../../faq/programming.rst:546 msgid "Or bundle up values in a class instance::" msgstr "または、クラスインスタンスに値を同梱することによって::" -#: ../../faq/programming.rst:556 -msgid "" -">>> class Namespace:\n" -"... def __init__(self, /, **args):\n" -"... for key, value in args.items():\n" -"... setattr(self, key, value)\n" -"...\n" -">>> def func4(args):\n" -"... args.a = 'new-value' # args is a mutable Namespace\n" -"... args.b = args.b + 1 # change object in-place\n" -"...\n" -">>> args = Namespace(a='old-value', b=99)\n" -">>> func4(args)\n" -">>> vars(args)\n" -"{'a': 'new-value', 'b': 100}" -msgstr "" - -#: ../../faq/programming.rst:571 +#: ../../faq/programming.rst:563 msgid "There's almost never a good reason to get this complicated." msgstr "このような複雑なことをする理由はめったに無いでしょう。" -#: ../../faq/programming.rst:573 +#: ../../faq/programming.rst:565 msgid "Your best choice is to return a tuple containing the multiple results." msgstr "一番の選択は、複数の結果を含むタプルを返すことです。" -#: ../../faq/programming.rst:577 +#: ../../faq/programming.rst:569 msgid "How do you make a higher order function in Python?" msgstr "Python で高次関数はどのようにつくりますか?" -#: ../../faq/programming.rst:579 +#: ../../faq/programming.rst:571 msgid "" "You have two choices: you can use nested scopes or you can use callable " "objects. For example, suppose you wanted to define ``linear(a,b)`` which " @@ -1116,44 +928,21 @@ msgstr "" "クトを使う方法です。例えば、``a*x+b`` の値を計算する ``f(x)`` 関数を返す " "``linear(a,b)`` を定義したいとします。ネストされたスコープを使うと::" -#: ../../faq/programming.rst:583 -msgid "" -"def linear(a, b):\n" -" def result(x):\n" -" return a * x + b\n" -" return result" -msgstr "" - -#: ../../faq/programming.rst:588 +#: ../../faq/programming.rst:580 msgid "Or using a callable object::" msgstr "また、呼び出し可能オブジェクトを使うと::" #: ../../faq/programming.rst:590 -msgid "" -"class linear:\n" -"\n" -" def __init__(self, a, b):\n" -" self.a, self.b = a, b\n" -"\n" -" def __call__(self, x):\n" -" return self.a * x + self.b" -msgstr "" - -#: ../../faq/programming.rst:598 msgid "In both cases, ::" msgstr "どちらの場合でも、 ::" -#: ../../faq/programming.rst:600 -msgid "taxes = linear(0.3, 2)" -msgstr "" - -#: ../../faq/programming.rst:602 +#: ../../faq/programming.rst:594 msgid "gives a callable object where ``taxes(10e6) == 0.3 * 10e6 + 2``." msgstr "" "とすれば、``taxes(10e6) == 0.3 * 10e6 + 2`` となるような呼び出し可能オブジェ" "クトを得られます。" -#: ../../faq/programming.rst:604 +#: ../../faq/programming.rst:596 msgid "" "The callable object approach has the disadvantage that it is a bit slower " "and results in slightly longer code. However, note that a collection of " @@ -1163,38 +952,11 @@ msgstr "" "という短所があります。ですが、継承を使って呼び出し可能オブジェクト同士で記号" "を共有することもできます::" -#: ../../faq/programming.rst:608 -msgid "" -"class exponential(linear):\n" -" # __init__ inherited\n" -" def __call__(self, x):\n" -" return self.a * (x ** self.b)" -msgstr "" - -#: ../../faq/programming.rst:613 +#: ../../faq/programming.rst:605 msgid "Object can encapsulate state for several methods::" msgstr "オブジェクトはいくつかのメソッドに状態をカプセル化できます::" -#: ../../faq/programming.rst:615 -msgid "" -"class counter:\n" -"\n" -" value = 0\n" -"\n" -" def set(self, x):\n" -" self.value = x\n" -"\n" -" def up(self):\n" -" self.value = self.value + 1\n" -"\n" -" def down(self):\n" -" self.value = self.value - 1\n" -"\n" -"count = counter()\n" -"inc, dec, reset = count.up, count.down, count.set" -msgstr "" - -#: ../../faq/programming.rst:631 +#: ../../faq/programming.rst:623 msgid "" "Here ``inc()``, ``dec()`` and ``reset()`` act like functions which share the " "same counting variable." @@ -1202,11 +964,11 @@ msgstr "" "ここで、``inc()``、``dec()``、``reset()`` は同じカウント変数を共有する関数の" "ようにふるまいます。" -#: ../../faq/programming.rst:636 +#: ../../faq/programming.rst:628 msgid "How do I copy an object in Python?" msgstr "Python のオブジェクトはどのようにコピーしますか?" -#: ../../faq/programming.rst:638 +#: ../../faq/programming.rst:630 msgid "" "In general, try :func:`copy.copy` or :func:`copy.deepcopy` for the general " "case. Not all objects can be copied, but most can." @@ -1214,7 +976,7 @@ msgstr "" "一般的に、普通は :func:`copy.copy` や :func:`copy.deepcopy` を試してくださ" "い。何でもコピーできるとは限りませんが、たいていはできます。" -#: ../../faq/programming.rst:641 +#: ../../faq/programming.rst:633 msgid "" "Some objects can be copied more easily. Dictionaries have a :meth:`~dict." "copy` method::" @@ -1222,37 +984,28 @@ msgstr "" "もっと簡単にコピーできるオブジェクトもあります。辞書には :meth:`~dict.copy` " "メソッドがあります::" -#: ../../faq/programming.rst:644 -msgid "newdict = olddict.copy()" -msgstr "" - -#: ../../faq/programming.rst:646 +#: ../../faq/programming.rst:638 msgid "Sequences can be copied by slicing::" msgstr "シーケンスはスライシングでコピーできます::" -#: ../../faq/programming.rst:648 -msgid "new_l = l[:]" -msgstr "" - -#: ../../faq/programming.rst:652 +#: ../../faq/programming.rst:644 msgid "How can I find the methods or attributes of an object?" msgstr "オブジェクトのメソッドや属性はどのように見つけますか?" -#: ../../faq/programming.rst:654 +#: ../../faq/programming.rst:646 msgid "" -"For an instance ``x`` of a user-defined class, :func:`dir(x) ` returns " -"an alphabetized list of the names containing the instance attributes and " +"For an instance x of a user-defined class, ``dir(x)`` returns an " +"alphabetized list of the names containing the instance attributes and " "methods and attributes defined by its class." msgstr "" -"ユーザー定義クラスのインスタンス ``x`` で、:func:`dir(x) `,< はインスタ" -"ンス属性とそのクラスで定義されたメソッドや属性を含む名前のアルファベット順リ" -"ストを返します。" +"ユーザー定義クラスのインスタンス x で、``dir(x)`` はインスタンス属性とそのク" +"ラスで定義されたメソッドや属性を含む名前のアルファベット順リストを返します。" -#: ../../faq/programming.rst:660 +#: ../../faq/programming.rst:652 msgid "How can my code discover the name of an object?" msgstr "コードはどのようにオブジェクトの名前を見つけるのですか?" -#: ../../faq/programming.rst:662 +#: ../../faq/programming.rst:654 msgid "" "Generally speaking, it can't, because objects don't really have names. " "Essentially, assignment always binds a name to a value; the same is true of " @@ -1263,34 +1016,19 @@ msgstr "" "質的には、代入とはいつも値に名前を束縛することです。``def`` と ``class`` 文も" "同じですが、この場合は値はコーラブルです。以下のコードを考えてみましょう::" -#: ../../faq/programming.rst:667 -msgid "" -">>> class A:\n" -"... pass\n" -"...\n" -">>> B = A\n" -">>> a = B()\n" -">>> b = a\n" -">>> print(b)\n" -"<__main__.A object at 0x16D07CC>\n" -">>> print(a)\n" -"<__main__.A object at 0x16D07CC>" -msgstr "" - -#: ../../faq/programming.rst:678 +#: ../../faq/programming.rst:670 msgid "" "Arguably the class has a name: even though it is bound to two names and " -"invoked through the name ``B`` the created instance is still reported as an " -"instance of class ``A``. However, it is impossible to say whether the " -"instance's name is ``a`` or ``b``, since both names are bound to the same " -"value." +"invoked through the name B the created instance is still reported as an " +"instance of class A. However, it is impossible to say whether the " +"instance's name is a or b, since both names are bound to the same value." msgstr "" "おそらく、このクラスには名前があります。このクラスは二つの名前に縛られて、名" -"前 ``B`` を通して呼び出されますが、それでもクラス ``A`` のインスタンスとして" -"報告されるのです。しかし、両方の名前が同じ値に束縛されている以上、このインス" -"タンスの名前が ``a`` か ``b`` か決めることはできないのです。" +"前 B を通して呼び出されますが、それでもクラス A のインスタンスとして報告され" +"るのです。しかし、両方の名前が同じ値に束縛されている以上、このインスタンスの" +"名前が a か b か決めることはできないのです。" -#: ../../faq/programming.rst:683 +#: ../../faq/programming.rst:675 msgid "" "Generally speaking it should not be necessary for your code to \"know the " "names\" of particular values. Unless you are deliberately writing " @@ -1301,7 +1039,7 @@ msgstr "" "なたがわざと内省的なコードを書いているのでない限り、方針を変えた方がいいかも" "しれないということになるでしょう。" -#: ../../faq/programming.rst:688 +#: ../../faq/programming.rst:680 msgid "" "In comp.lang.python, Fredrik Lundh once gave an excellent analogy in answer " "to this question:" @@ -1309,7 +1047,7 @@ msgstr "" "comp.lang.python で、Fredrik Lundh はこの問題の答えとして素晴らしい喩えをして" "くれました:" -#: ../../faq/programming.rst:691 +#: ../../faq/programming.rst:683 msgid "" "The same way as you get the name of that cat you found on your porch: the " "cat (object) itself cannot tell you its name, and it doesn't really care -- " @@ -1321,7 +1059,7 @@ msgstr "" "ているかを知る唯一の方法は、すべての隣人 (名前空間) にその猫 (オブジェクト) " "が何と呼ばれているかを聞くことです。" -#: ../../faq/programming.rst:696 +#: ../../faq/programming.rst:688 msgid "" "....and don't be surprised if you'll find that it's known by many names, or " "no name at all!" @@ -1329,22 +1067,16 @@ msgstr "" "……そして、その猫が沢山の名前で知られていたり、逆に全く名前が無かったりしても" "驚かないでください!" -#: ../../faq/programming.rst:701 +#: ../../faq/programming.rst:693 msgid "What's up with the comma operator's precedence?" msgstr "カンマ演算子はなぜ優先されるのですか?" -#: ../../faq/programming.rst:703 +#: ../../faq/programming.rst:695 msgid "Comma is not an operator in Python. Consider this session::" msgstr "" "カンマは Python では演算子ではありません。このセッションを考えてください::" -#: ../../faq/programming.rst:705 -msgid "" -">>> \"a\" in \"b\", \"a\"\n" -"(False, 'a')" -msgstr "" - -#: ../../faq/programming.rst:708 +#: ../../faq/programming.rst:700 msgid "" "Since the comma is not an operator, but a separator between expressions the " "above is evaluated as if you had entered::" @@ -1352,19 +1084,11 @@ msgstr "" "カンマは演算子ではなく、式の分離子なので、上の式は次の式と同じように評価され" "ます::" -#: ../../faq/programming.rst:711 -msgid "(\"a\" in \"b\"), \"a\"" -msgstr "" - -#: ../../faq/programming.rst:713 +#: ../../faq/programming.rst:705 msgid "not::" msgstr "こうではありません::" -#: ../../faq/programming.rst:715 -msgid "\"a\" in (\"b\", \"a\")" -msgstr "" - -#: ../../faq/programming.rst:717 +#: ../../faq/programming.rst:709 msgid "" "The same is true of the various assignment operators (``=``, ``+=`` etc). " "They are not truly operators but syntactic delimiters in assignment " @@ -1373,23 +1097,15 @@ msgstr "" "他のさまざまな演算子(``=``、``+=`` など)も同じです。これらは真の演算子ではあ" "りませんが、代入文の構文上のデリミタです。" -#: ../../faq/programming.rst:722 +#: ../../faq/programming.rst:714 msgid "Is there an equivalent of C's \"?:\" ternary operator?" msgstr "C の \"?:\" 三項演算子と等価なものはありますか?" -#: ../../faq/programming.rst:724 +#: ../../faq/programming.rst:716 msgid "Yes, there is. The syntax is as follows::" msgstr "はい、あります。構文は以下のようになります::" -#: ../../faq/programming.rst:726 -msgid "" -"[on_true] if [expression] else [on_false]\n" -"\n" -"x, y = 50, 25\n" -"small = x if x < y else y" -msgstr "" - -#: ../../faq/programming.rst:731 +#: ../../faq/programming.rst:723 msgid "" "Before this syntax was introduced in Python 2.5, a common idiom was to use " "logical operators::" @@ -1397,11 +1113,7 @@ msgstr "" "この構文が導入された 2.5 以前のバージョンに関しては、論理演算子を使ったこのイ" "ディオムが一般的でした::" -#: ../../faq/programming.rst:734 -msgid "[expression] and [on_true] or [on_false]" -msgstr "" - -#: ../../faq/programming.rst:736 +#: ../../faq/programming.rst:728 msgid "" "However, this idiom is unsafe, as it can give wrong results when *on_true* " "has a false boolean value. Therefore, it is always better to use the ``... " @@ -1411,61 +1123,31 @@ msgstr "" "きに間違った結果を与えることがあります。ですから、いつでも ``... if ... " "else ...`` 形式を使ったほうが良いです。" -#: ../../faq/programming.rst:742 +#: ../../faq/programming.rst:734 msgid "Is it possible to write obfuscated one-liners in Python?" msgstr "Python で解し難いワンライナーを書くことはできますか?" -#: ../../faq/programming.rst:744 +#: ../../faq/programming.rst:736 msgid "" "Yes. Usually this is done by nesting :keyword:`lambda` within :keyword:`!" -"lambda`. See the following three examples, slightly adapted from Ulf " -"Bartelt::" +"lambda`. See the following three examples, due to Ulf Bartelt::" msgstr "" "はい。そういうものはたいてい、 :keyword:`!lambda` の中に :keyword:`lambda` が" -"ネストされています。Ulf Bartelt によるものを少しアレンジした下の3つの例を見" -"てください::" - -#: ../../faq/programming.rst:747 -msgid "" -"from functools import reduce\n" -"\n" -"# Primes < 1000\n" -"print(list(filter(None,map(lambda y:y*reduce(lambda x,y:x*y!=0,\n" -"map(lambda x,y=y:y%x,range(2,int(pow(y,0.5)+1))),1),range(2,1000)))))\n" -"\n" -"# First 10 Fibonacci numbers\n" -"print(list(map(lambda x,f=lambda x,f:(f(x-1,f)+f(x-2,f)) if x>1 else 1:\n" -"f(x,f), range(10))))\n" -"\n" -"# Mandelbrot set\n" -"print((lambda Ru,Ro,Iu,Io,IM,Sx,Sy:reduce(lambda x,y:x+'\\n'+y,map(lambda " -"y,\n" -"Iu=Iu,Io=Io,Ru=Ru,Ro=Ro,Sy=Sy,L=lambda yc,Iu=Iu,Io=Io,Ru=Ru,Ro=Ro,i=IM,\n" -"Sx=Sx,Sy=Sy:reduce(lambda x,y:x+y,map(lambda x,xc=Ru,yc=yc,Ru=Ru,Ro=Ro,\n" -"i=i,Sx=Sx,F=lambda xc,yc,x,y,k,f=lambda xc,yc,x,y,k,f:(k<=0)or (x*x+y*y\n" -">=4.0) or 1+f(xc,yc,x*x-y*y+xc,2.0*x*y+yc,k-1,f):f(xc,yc,x,y,k,f):chr(\n" -"64+F(Ru+x*(Ro-Ru)/Sx,yc,0,0,i)),range(Sx))):L(Iu+y*(Io-Iu)/Sy),range(Sy\n" -"))))(-2.1, 0.7, -1.2, 1.2, 30, 80, 24))\n" -"# \\___ ___/ \\___ ___/ | | |__ lines on screen\n" -"# V V | |______ columns on screen\n" -"# | | |__________ maximum of \"iterations\"\n" -"# | |_________________ range on y axis\n" -"# |____________________________ range on x axis" -msgstr "" +"ネストされています。Ulf Bartelt による下の3つの例を見てください::" -#: ../../faq/programming.rst:771 +#: ../../faq/programming.rst:763 msgid "Don't try this at home, kids!" msgstr "よい子はまねしないでね!" -#: ../../faq/programming.rst:777 +#: ../../faq/programming.rst:769 msgid "What does the slash(/) in the parameter list of a function mean?" msgstr "関数の引数リストにあるスラッシュ (/) は何を意味しますか?" -#: ../../faq/programming.rst:779 +#: ../../faq/programming.rst:771 msgid "" "A slash in the argument list of a function denotes that the parameters prior " "to it are positional-only. Positional-only parameters are the ones without " -"an externally usable name. Upon calling a function that accepts positional-" +"an externally-usable name. Upon calling a function that accepts positional-" "only parameters, arguments are mapped to parameters based solely on their " "position. For example, :func:`divmod` is a function that accepts positional-" "only parameters. Its documentation looks like this::" @@ -1478,16 +1160,7 @@ msgstr "" "例えば、 :func:`divmod` は位置専用引数を受け付けます。\n" "そのドキュメントは次のようになります::" -#: ../../faq/programming.rst:786 -msgid "" -">>> help(divmod)\n" -"Help on built-in function divmod in module builtins:\n" -"\n" -"divmod(x, y, /)\n" -" Return the tuple (x//y, x%y). Invariant: div*y + mod == x." -msgstr "" - -#: ../../faq/programming.rst:792 +#: ../../faq/programming.rst:784 msgid "" "The slash at the end of the parameter list means that both parameters are " "positional-only. Thus, calling :func:`divmod` with keyword arguments would " @@ -1498,23 +1171,15 @@ msgstr "" "したがって、:func:`divmod` をキーワード引数を使って呼び出すとエラーになりま" "す::" -#: ../../faq/programming.rst:796 -msgid "" -">>> divmod(x=3, y=4)\n" -"Traceback (most recent call last):\n" -" File \"\", line 1, in \n" -"TypeError: divmod() takes no keyword arguments" -msgstr "" - -#: ../../faq/programming.rst:803 +#: ../../faq/programming.rst:795 msgid "Numbers and strings" msgstr "数と文字列" -#: ../../faq/programming.rst:806 +#: ../../faq/programming.rst:798 msgid "How do I specify hexadecimal and octal integers?" msgstr "十六進数や八進数を指定するにはどうしたらいいですか?" -#: ../../faq/programming.rst:808 +#: ../../faq/programming.rst:800 msgid "" "To specify an octal digit, precede the octal value with a zero, and then a " "lower or uppercase \"o\". For example, to set the variable \"a\" to the " @@ -1524,14 +1189,7 @@ msgstr "" "加えてください。たとえば、変数 \"a\" に八進数での \"10\" (十進数での\"8\") を" "代入するには、こう打ってください::" -#: ../../faq/programming.rst:812 -msgid "" -">>> a = 0o10\n" -">>> a\n" -"8" -msgstr "" - -#: ../../faq/programming.rst:816 +#: ../../faq/programming.rst:808 msgid "" "Hexadecimal is just as easy. Simply precede the hexadecimal number with a " "zero, and then a lower or uppercase \"x\". Hexadecimal digits can be " @@ -1541,21 +1199,11 @@ msgstr "" "字) を加えてください。十六進数は小文字でも大文字でも指定できます。たとえば、" "Python インタプリタで::" -#: ../../faq/programming.rst:820 -msgid "" -">>> a = 0xa5\n" -">>> a\n" -"165\n" -">>> b = 0XB2\n" -">>> b\n" -"178" -msgstr "" - -#: ../../faq/programming.rst:829 +#: ../../faq/programming.rst:821 msgid "Why does -22 // 10 return -3?" msgstr "なぜ -22 // 10 は -3 を返すのですか?" -#: ../../faq/programming.rst:831 +#: ../../faq/programming.rst:823 msgid "" "It's primarily driven by the desire that ``i % j`` have the same sign as " "``j``. If you want that, and also want::" @@ -1563,11 +1211,7 @@ msgstr "" "``i % j`` が ``j`` と同じ符号であってほしいことに基づいています。それに加えて" "以下のようにもしたいとすると::" -#: ../../faq/programming.rst:834 -msgid "i == (i // j) * j + (i % j)" -msgstr "" - -#: ../../faq/programming.rst:836 +#: ../../faq/programming.rst:828 msgid "" "then integer division has to return the floor. C also requires that " "identity to hold, and then compilers that truncate ``i // j`` need to make " @@ -1576,7 +1220,7 @@ msgstr "" "整数除算は床を返すことになります。C にも C の一貫性があって、``i % j`` が " "``i`` と同じ符号を持つように ``i // j`` を丸めています。" -#: ../../faq/programming.rst:840 +#: ../../faq/programming.rst:832 msgid "" "There are few real use cases for ``i % j`` when ``j`` is negative. When " "``j`` is positive, there are many, and in virtually all of them it's more " @@ -1590,45 +1234,21 @@ msgstr "" "% 12 == 2`` となるのが便利です。``-190 % 12 == -10`` は噛み付きかねないバグで" "す。" -#: ../../faq/programming.rst:848 -msgid "How do I get int literal attribute instead of SyntaxError?" -msgstr "どうすれば SyntaxError を起こさずに整数リテラルの属性を得られますか?" - -#: ../../faq/programming.rst:850 -msgid "" -"Trying to lookup an ``int`` literal attribute in the normal manner gives a :" -"exc:`SyntaxError` because the period is seen as a decimal point::" -msgstr "" -"ふつうの方法で ``int`` リテラルの属性を探そうとすると、ピリオドが小数点とみな" -"され、:exc:`SyntaxError` となります::" - -#: ../../faq/programming.rst:853 -msgid "" -">>> 1.__class__\n" -" File \"\", line 1\n" -" 1.__class__\n" -" ^\n" -"SyntaxError: invalid decimal literal" -msgstr "" - -#: ../../faq/programming.rst:859 -msgid "" -"The solution is to separate the literal from the period with either a space " -"or parentheses." -msgstr "解決策は、リテラルとピリオドを スペースや括弧で分けることです。" - -#: ../../faq/programming.rst:869 +#: ../../faq/programming.rst:840 msgid "How do I convert a string to a number?" msgstr "文字列を数に変換するにはどうしたらいいですか?" -#: ../../faq/programming.rst:871 +#: ../../faq/programming.rst:842 msgid "" "For integers, use the built-in :func:`int` type constructor, e.g. " -"``int('144') == 144``. Similarly, :func:`float` converts to a floating-" -"point number, e.g. ``float('144') == 144.0``." +"``int('144') == 144``. Similarly, :func:`float` converts to floating-point, " +"e.g. ``float('144') == 144.0``." msgstr "" +"整数に変換するには、組み込みの :func:`int` 型コンストラクタを使ってください。" +"例えば、 ``int('144') == 144`` です。同様に、 :func:`float` は浮動小数点に変" +"換します。例えば、 ``float('144') == 144.0`` です。" -#: ../../faq/programming.rst:875 +#: ../../faq/programming.rst:846 msgid "" "By default, these interpret the number as decimal, so that ``int('0144') == " "144`` holds true, and ``int('0x144')`` raises :exc:`ValueError`. " @@ -1644,7 +1264,7 @@ msgstr "" "Python の基準によって解釈されます。先頭が '0o' なら八進数で、'0x' なら十六進" "数を表します。" -#: ../../faq/programming.rst:882 +#: ../../faq/programming.rst:853 msgid "" "Do not use the built-in function :func:`eval` if all you need is to convert " "strings to numbers. :func:`eval` will be significantly slower and it " @@ -1659,7 +1279,7 @@ msgstr "" "のホームディレクトリを消去する ``__import__('os').system(\"rm -rf $HOME\")`` " "を渡そうとする人がいるかも知れません。" -#: ../../faq/programming.rst:889 +#: ../../faq/programming.rst:860 msgid "" ":func:`eval` also has the effect of interpreting numbers as Python " "expressions, so that e.g. ``eval('09')`` gives a syntax error because Python " @@ -1669,21 +1289,21 @@ msgstr "" "ば、 ``eval('09')`` は構文エラー起こします。Python は ('0' 以外の) 十進数を " "'0' で始めてはならないからです。" -#: ../../faq/programming.rst:895 +#: ../../faq/programming.rst:866 msgid "How do I convert a number to a string?" msgstr "数を文字列に変換するにはどうしたらいいですか?" -#: ../../faq/programming.rst:897 +#: ../../faq/programming.rst:868 msgid "" -"To convert, e.g., the number ``144`` to the string ``'144'``, use the built-" -"in type constructor :func:`str`. If you want a hexadecimal or octal " -"representation, use the built-in functions :func:`hex` or :func:`oct`. For " -"fancy formatting, see the :ref:`f-strings` and :ref:`formatstrings` " -"sections, e.g. ``\"{:04d}\".format(144)`` yields ``'0144'`` and ``\"{:.3f}\"." +"To convert, e.g., the number 144 to the string '144', use the built-in type " +"constructor :func:`str`. If you want a hexadecimal or octal representation, " +"use the built-in functions :func:`hex` or :func:`oct`. For fancy " +"formatting, see the :ref:`f-strings` and :ref:`formatstrings` sections, e.g. " +"``\"{:04d}\".format(144)`` yields ``'0144'`` and ``\"{:.3f}\"." "format(1.0/3.0)`` yields ``'0.333'``." msgstr "" -"例えば、``144`` という数を ``'144'`` という文字列に変換したいなら、組み込み型" -"のコンストラクタ :func:`str` を使ってください。\n" +"例えば、144 という数を '144' という文字列に変換したいなら、組み込み型のコンス" +"トラクタ :func:`str` を使ってください。\n" "十六進数や八進数にしたければ、組み込み関数の :func:`hex` や :func:`oct` を" "使ってください。\n" "手の込んだフォーマット形式を使うなら、 :ref:`f-strings` と :ref:" @@ -1691,11 +1311,11 @@ msgstr "" "例えば、 ``\"{:04d}\".format(144)`` は ``'0144'`` になり、 ``\"{:.3f}\"." "format(1.0/3.0)`` は ``'0.333'`` になります。" -#: ../../faq/programming.rst:906 +#: ../../faq/programming.rst:877 msgid "How do I modify a string in place?" msgstr "文字列をインプレースに変更するにはどうしたらいいですか?" -#: ../../faq/programming.rst:908 +#: ../../faq/programming.rst:879 msgid "" "You can't, because strings are immutable. In most situations, you should " "simply construct a new string from the various parts you want to assemble it " @@ -1708,40 +1328,15 @@ msgstr "" "プレースに変更できるオブジェクトが必要なら、 :mod:`array` モジュールの :" "class:`io.StringIO` オブジェクトを試してください::" -#: ../../faq/programming.rst:914 -msgid "" -">>> import io\n" -">>> s = \"Hello, world\"\n" -">>> sio = io.StringIO(s)\n" -">>> sio.getvalue()\n" -"'Hello, world'\n" -">>> sio.seek(7)\n" -"7\n" -">>> sio.write(\"there!\")\n" -"6\n" -">>> sio.getvalue()\n" -"'Hello, there!'\n" -"\n" -">>> import array\n" -">>> a = array.array('w', s)\n" -">>> print(a)\n" -"array('w', 'Hello, world')\n" -">>> a[0] = 'y'\n" -">>> print(a)\n" -"array('w', 'yello, world')\n" -">>> a.tounicode()\n" -"'yello, world'" -msgstr "" - -#: ../../faq/programming.rst:938 +#: ../../faq/programming.rst:909 msgid "How do I use strings to call functions/methods?" msgstr "関数やメソッドを呼ぶのに文字列を使うにはどうしたらいいですか?" -#: ../../faq/programming.rst:940 +#: ../../faq/programming.rst:911 msgid "There are various techniques." msgstr "様々なテクニックがあります。" -#: ../../faq/programming.rst:942 +#: ../../faq/programming.rst:913 msgid "" "The best is to use a dictionary that maps strings to functions. The primary " "advantage of this technique is that the strings do not need to match the " @@ -1752,30 +1347,11 @@ msgstr "" "番の利点は、文字列が関数の名前と同じ必要がないことです。この方法は case 構造" "をエミュレートするための一番のテクニックでもあります::" -#: ../../faq/programming.rst:947 -msgid "" -"def a():\n" -" pass\n" -"\n" -"def b():\n" -" pass\n" -"\n" -"dispatch = {'go': a, 'stop': b} # Note lack of parens for funcs\n" -"\n" -"dispatch[get_input()]() # Note trailing parens to call function" -msgstr "" - -#: ../../faq/programming.rst:957 +#: ../../faq/programming.rst:928 msgid "Use the built-in function :func:`getattr`::" msgstr "組み込み関数の :func:`getattr` を使う方法::" -#: ../../faq/programming.rst:959 -msgid "" -"import foo\n" -"getattr(foo, 'bar')()" -msgstr "" - -#: ../../faq/programming.rst:962 +#: ../../faq/programming.rst:933 msgid "" "Note that :func:`getattr` works on any object, including classes, class " "instances, modules, and so on." @@ -1783,45 +1359,22 @@ msgstr "" "なお、 :func:`getattr` はクラス、クラスインスタンス、モジュールなど、どんなオ" "ブジェクトにも使えます。" -#: ../../faq/programming.rst:965 +#: ../../faq/programming.rst:936 msgid "This is used in several places in the standard library, like this::" msgstr "これは標準ライブラリでも何箇所か使われています。このように::" -#: ../../faq/programming.rst:967 -msgid "" -"class Foo:\n" -" def do_foo(self):\n" -" ...\n" -"\n" -" def do_bar(self):\n" -" ...\n" -"\n" -"f = getattr(foo_instance, 'do_' + opname)\n" -"f()" -msgstr "" - -#: ../../faq/programming.rst:978 +#: ../../faq/programming.rst:949 msgid "Use :func:`locals` to resolve the function name::" msgstr ":func:`locals` を使って関数名を決める方法::" -#: ../../faq/programming.rst:980 -msgid "" -"def myFunc():\n" -" print(\"hello\")\n" -"\n" -"fname = \"myFunc\"\n" -"\n" -"f = locals()[fname]\n" -"f()" -msgstr "" - -#: ../../faq/programming.rst:990 +#: ../../faq/programming.rst:961 msgid "" -"Is there an equivalent to Perl's ``chomp()`` for removing trailing newlines " -"from strings?" +"Is there an equivalent to Perl's chomp() for removing trailing newlines from " +"strings?" msgstr "" +"文字列から後端の改行を取り除く Perl の chomp() に相当するものはありますか?" -#: ../../faq/programming.rst:992 +#: ../../faq/programming.rst:963 msgid "" "You can use ``S.rstrip(\"\\r\\n\")`` to remove all occurrences of any line " "terminator from the end of the string ``S`` without removing other trailing " @@ -1833,16 +1386,7 @@ msgstr "" "くことなくすべての行末記号を取り除くことができます。文字列 ``S`` が複数行を表" "し、終端に空行があるとき、そのすべての空行も取り除かれます::" -#: ../../faq/programming.rst:998 -msgid "" -">>> lines = (\"line 1 \\r\\n\"\n" -"... \"\\r\\n\"\n" -"... \"\\r\\n\")\n" -">>> lines.rstrip(\"\\n\\r\")\n" -"'line 1 '" -msgstr "" - -#: ../../faq/programming.rst:1004 +#: ../../faq/programming.rst:975 msgid "" "Since this is typically only desired when reading text one line at a time, " "using ``S.rstrip()`` this way works well." @@ -1850,149 +1394,70 @@ msgstr "" "これは典型的に一度に一行ずつテキストを読みたい時にのみ使われるので、``S." "rstrip()`` をこの方法で使うとうまくいきます。" -#: ../../faq/programming.rst:1009 -msgid "Is there a ``scanf()`` or ``sscanf()`` equivalent?" -msgstr "" +#: ../../faq/programming.rst:980 +msgid "Is there a scanf() or sscanf() equivalent?" +msgstr "scanf() や sscanf() と同等なものはありますか?" -#: ../../faq/programming.rst:1011 +#: ../../faq/programming.rst:982 msgid "Not as such." msgstr "そのようなものはありません。" -#: ../../faq/programming.rst:1013 +#: ../../faq/programming.rst:984 msgid "" "For simple input parsing, the easiest approach is usually to split the line " "into whitespace-delimited words using the :meth:`~str.split` method of " "string objects and then convert decimal strings to numeric values using :" -"func:`int` or :func:`float`. :meth:`!split` supports an optional \"sep\" " +"func:`int` or :func:`float`. ``split()`` supports an optional \"sep\" " "parameter which is useful if the line uses something other than whitespace " "as a separator." msgstr "" +"簡単な入力解析で、多くの場合に一番簡単な方法は、文字列オブジェクトの :meth:" +"`~str.split` メソッドで行を空白文字で区切られた単語に分け、十進数の文字列を :" +"func:`int` や :func:`float` で数値に変換することです。 ``split()`` にはオプ" +"ションの \"sep\" 変数があり、行に空白文字以外の区切りを使っているときに便利で" +"す。" -#: ../../faq/programming.rst:1019 +#: ../../faq/programming.rst:990 msgid "" "For more complicated input parsing, regular expressions are more powerful " -"than C's ``sscanf`` and better suited for the task." +"than C's :c:func:`sscanf` and better suited for the task." msgstr "" -"もっと複雑な入力解析をしたいなら、C の ``sscanf`` よりも正規表現の方が便利で" -"すし、この処理に向いています。" +"もっと複雑な入力解析をしたいなら、C の :c:func:`sscanf` よりも正規表現の方が" +"便利ですし、この処理に向いています。" -#: ../../faq/programming.rst:1024 -msgid "What does ``UnicodeDecodeError`` or ``UnicodeEncodeError`` error mean?" -msgstr "" +#: ../../faq/programming.rst:995 +msgid "What does 'UnicodeDecodeError' or 'UnicodeEncodeError' error mean?" +msgstr "'UnicodeDecodeError' や 'UnicodeEncodeError' はどういう意味ですか?" -#: ../../faq/programming.rst:1026 +#: ../../faq/programming.rst:997 msgid "See the :ref:`unicode-howto`." msgstr ":ref:`unicode-howto` を参照して下さい。" -#: ../../faq/programming.rst:1032 -msgid "Can I end a raw string with an odd number of backslashes?" -msgstr "raw string を奇数個のバックスラッシュで終えることはできますか?" +#: ../../faq/programming.rst:1001 +msgid "Performance" +msgstr "性能" -#: ../../faq/programming.rst:1034 -msgid "" -"A raw string ending with an odd number of backslashes will escape the " -"string's quote::" -msgstr "" -"奇数個のバックスラッシュで終わる raw string は文字列のクォートをエスケープし" -"ます::" +#: ../../faq/programming.rst:1004 +msgid "My program is too slow. How do I speed it up?" +msgstr "プログラムが遅すぎます。どうしたら速くなりますか?" -#: ../../faq/programming.rst:1036 +#: ../../faq/programming.rst:1006 msgid "" -">>> r'C:\\this\\will\\not\\work\\'\n" -" File \"\", line 1\n" -" r'C:\\this\\will\\not\\work\\'\n" -" ^\n" -"SyntaxError: unterminated string literal (detected at line 1)" +"That's a tough one, in general. First, here are a list of things to " +"remember before diving further:" msgstr "" +"これは、一般的に難しい問題です。まず、先に進む前に覚えておいて欲しいことをこ" +"こに挙げます:" -#: ../../faq/programming.rst:1042 +#: ../../faq/programming.rst:1009 msgid "" -"There are several workarounds for this. One is to use regular strings and " -"double the backslashes::" +"Performance characteristics vary across Python implementations. This FAQ " +"focuses on :term:`CPython`." msgstr "" -"これにはいくつかの回避策があります。ひとつは通常文字列と二重バックスラッシュ" -"を使うことです::" +"性能の傾向は Python 実装によって変わります。この FAQ では :term:`CPython` に" +"焦点を当てます。" -#: ../../faq/programming.rst:1045 -msgid "" -">>> 'C:\\\\this\\\\will\\\\work\\\\'\n" -"'C:\\\\this\\\\will\\\\work\\\\'" -msgstr "" - -#: ../../faq/programming.rst:1048 -msgid "" -"Another is to concatenate a regular string containing an escaped backslash " -"to the raw string::" -msgstr "" -"もうひとつは、エスケープされたバックスラッシュを含む通常の文字列を、 raw " -"string に連結します::" - -#: ../../faq/programming.rst:1051 -msgid "" -">>> r'C:\\this\\will\\work' '\\\\'\n" -"'C:\\\\this\\\\will\\\\work\\\\'" -msgstr "" - -#: ../../faq/programming.rst:1054 -msgid "" -"It is also possible to use :func:`os.path.join` to append a backslash on " -"Windows::" -msgstr "" -"Windowsでは、 :func:`os.path.join` を使ってバックスラッシュを追加することもで" -"きます::" - -#: ../../faq/programming.rst:1056 -msgid "" -">>> os.path.join(r'C:\\this\\will\\work', '')\n" -"'C:\\\\this\\\\will\\\\work\\\\'" -msgstr "" - -#: ../../faq/programming.rst:1059 -msgid "" -"Note that while a backslash will \"escape\" a quote for the purposes of " -"determining where the raw string ends, no escaping occurs when interpreting " -"the value of the raw string. That is, the backslash remains present in the " -"value of the raw string::" -msgstr "" -"注意点として、バックスラッシュは raw string 終端のクォートを「エスケープ」し" -"ますが、 raw string の値を解釈する際にはエスケープが生じません。つまり、バッ" -"クスラッシュは raw string 値の中に残ったままになります::" - -#: ../../faq/programming.rst:1064 -msgid "" -">>> r'backslash\\'preserved'\n" -"\"backslash\\\\'preserved\"" -msgstr "" - -#: ../../faq/programming.rst:1067 -msgid "Also see the specification in the :ref:`language reference `." -msgstr ":ref:`言語リファレンス ` の仕様も参照してください。" - -#: ../../faq/programming.rst:1070 -msgid "Performance" -msgstr "性能" - -#: ../../faq/programming.rst:1073 -msgid "My program is too slow. How do I speed it up?" -msgstr "プログラムが遅すぎます。どうしたら速くなりますか?" - -#: ../../faq/programming.rst:1075 -msgid "" -"That's a tough one, in general. First, here are a list of things to " -"remember before diving further:" -msgstr "" -"これは、一般的に難しい問題です。まず、先に進む前に覚えておいて欲しいことをこ" -"こに挙げます:" - -#: ../../faq/programming.rst:1078 -msgid "" -"Performance characteristics vary across Python implementations. This FAQ " -"focuses on :term:`CPython`." -msgstr "" -"性能の傾向は Python 実装によって変わります。この FAQ では :term:`CPython` に" -"焦点を当てます。" - -#: ../../faq/programming.rst:1080 +#: ../../faq/programming.rst:1011 msgid "" "Behaviour can vary across operating systems, especially when talking about I/" "O or multi-threading." @@ -2000,7 +1465,7 @@ msgstr "" "振る舞いはオペレーティングシステムによって変わりえます。特に、I/O やマルチス" "レッドに関しては顕著です。" -#: ../../faq/programming.rst:1082 +#: ../../faq/programming.rst:1013 msgid "" "You should always find the hot spots in your program *before* attempting to " "optimize any code (see the :mod:`profile` module)." @@ -2008,7 +1473,7 @@ msgstr "" "常に、コードの最適化を始める *前に* プログラムのホットスポットを見つけるべき" "です (:mod:`profile` モジュールを参照してください)。" -#: ../../faq/programming.rst:1084 +#: ../../faq/programming.rst:1015 msgid "" "Writing benchmark scripts will allow you to iterate quickly when searching " "for improvements (see the :mod:`timeit` module)." @@ -2016,7 +1481,7 @@ msgstr "" "ベンチマークスクリプトを書くことで、改善箇所の捜索を素早く繰り返せます (:mod:" "`timeit` モジュールを参照してください)。" -#: ../../faq/programming.rst:1086 +#: ../../faq/programming.rst:1017 msgid "" "It is highly recommended to have good code coverage (through unit testing or " "any other technique) before potentially introducing regressions hidden in " @@ -2025,7 +1490,7 @@ msgstr "" "洗練された最適化に隠れたリグレッションの可能性を生む前に、(ユニットテストやそ" "の他の技法で) コードカバレッジを上げることを強く推奨します。" -#: ../../faq/programming.rst:1090 +#: ../../faq/programming.rst:1021 msgid "" "That being said, there are many tricks to speed up Python code. Here are " "some general principles which go a long way towards reaching acceptable " @@ -2034,7 +1499,7 @@ msgstr "" "とは言っても、Python コードを高速化する技法はたくさんあります。ここでは、満足" "な性能のレベルにたどり着くまでの長い道のりを進む、一般的な方針を示します:" -#: ../../faq/programming.rst:1094 +#: ../../faq/programming.rst:1025 msgid "" "Making your algorithms faster (or changing to faster ones) can yield much " "larger benefits than trying to sprinkle micro-optimization tricks all over " @@ -2043,7 +1508,7 @@ msgstr "" "コード中に細かい最適化の技法をばらまこうとするよりも、アルゴリズムを高速化 " "(または高速なアルゴリズムに変更) するほうが、大きな利益を生むことがあります。" -#: ../../faq/programming.rst:1098 +#: ../../faq/programming.rst:1029 msgid "" "Use the right data structures. Study documentation for the :ref:`bltin-" "types` and the :mod:`collections` module." @@ -2051,7 +1516,7 @@ msgstr "" "適切なデータ構造を使ってください。:ref:`bltin-types` や :mod:`collections` を" "調べてください。" -#: ../../faq/programming.rst:1101 +#: ../../faq/programming.rst:1032 msgid "" "When the standard library provides a primitive for doing something, it is " "likely (although not guaranteed) to be faster than any alternative you may " @@ -2068,7 +1533,7 @@ msgstr "" "`sorted` 関数を使ってください (また、中程度に高度な例は、 :ref:" "`sortinghowto` を参照してください)。" -#: ../../faq/programming.rst:1109 +#: ../../faq/programming.rst:1040 msgid "" "Abstractions tend to create indirections and force the interpreter to work " "more. If the levels of indirection outweigh the amount of useful work done, " @@ -2081,10 +1546,10 @@ msgstr "" "す。過度な抽象化、特に細かい関数やメソッドの形で現れるもの (これは読みにくさ" "も落とします) は防ぐべきです。" -#: ../../faq/programming.rst:1115 +#: ../../faq/programming.rst:1046 msgid "" "If you have reached the limit of what pure Python can allow, there are tools " -"to take you further away. For example, `Cython `_ can " +"to take you further away. For example, `Cython `_ can " "compile a slightly modified version of Python code into a C extension, and " "can be used on many different platforms. Cython can take advantage of " "compilation (and optional type annotations) to make your code significantly " @@ -2093,25 +1558,23 @@ msgid "" "yourself." msgstr "" "pure Python にできる限界に達したなら、更に進むためのツールがあります。例え" -"ば、`Cython `_ は、Python コードのわずかに変形した版を C " -"拡張にコンパイルし、多種のプラットフォームで使えます。Cython は、コンパイル " -"(と任意の型アノテーション) を利用し、コードの解釈を大幅に速くします。C プログ" -"ラミングに自信があるなら、自分で :ref:`write a C extension module ` こともできます。" +"ば、 `Cython `_ は、Python コードのわずかに変形した版を C 拡張にコンパイル" +"し、多種のプラットフォームで使えます。Cython は、コンパイル (と任意の型アノ" +"テーション) を利用し、コードの解釈を大幅に速くします。C プログラミングに自信" +"があるなら、自分で :ref:`write a C extension module ` ことも" +"できます。" -#: ../../faq/programming.rst:1125 +#: ../../faq/programming.rst:1056 msgid "" "The wiki page devoted to `performance tips `_." -msgstr "" -"`パフォーマンス tips `_ が載っている wiki のページ。" +msgstr "`パフォーマンス tips `_ が載っている wiki のページ。" -#: ../../faq/programming.rst:1131 +#: ../../faq/programming.rst:1062 msgid "What is the most efficient way to concatenate many strings together?" msgstr "多くの文字列を結合するのに最も効率的な方法は何ですか?" -#: ../../faq/programming.rst:1133 +#: ../../faq/programming.rst:1064 msgid "" ":class:`str` and :class:`bytes` objects are immutable, therefore " "concatenating many strings together is inefficient as each concatenation " @@ -2122,7 +1585,7 @@ msgstr "" "文字列の結合は結合ごとに新しいオブジェクトを作成し、効率が悪いです。\n" "一般的に、全体の実行時間のコストは文字列の長さの二乗に比例します。" -#: ../../faq/programming.rst:1138 +#: ../../faq/programming.rst:1069 msgid "" "To accumulate many :class:`str` objects, the recommended idiom is to place " "them into a list and call :meth:`str.join` at the end::" @@ -2130,19 +1593,11 @@ msgstr "" "多くの :class:`str` オブジェクトを累積するのにおすすめのイディオムは、すべて" "をリストに配置してから最後に :meth:`str.join` を呼び出すことです::" -#: ../../faq/programming.rst:1141 -msgid "" -"chunks = []\n" -"for s in my_strings:\n" -" chunks.append(s)\n" -"result = ''.join(chunks)" -msgstr "" - -#: ../../faq/programming.rst:1146 +#: ../../faq/programming.rst:1077 msgid "(another reasonably efficient idiom is to use :class:`io.StringIO`)" msgstr "(他の割と効率的なイディオムは、 :class:`io.StringIO` を使うことです)" -#: ../../faq/programming.rst:1148 +#: ../../faq/programming.rst:1079 msgid "" "To accumulate many :class:`bytes` objects, the recommended idiom is to " "extend a :class:`bytearray` object using in-place concatenation (the ``+=`` " @@ -2152,22 +1607,15 @@ msgstr "" "class:`bytearray` オブジェクトをインプレース結合 (``+=`` 演算子) で拡張するこ" "とです::" -#: ../../faq/programming.rst:1151 -msgid "" -"result = bytearray()\n" -"for b in my_bytes_objects:\n" -" result += b" -msgstr "" - -#: ../../faq/programming.rst:1157 +#: ../../faq/programming.rst:1088 msgid "Sequences (Tuples/Lists)" msgstr "シーケンス(タプル/リスト)" -#: ../../faq/programming.rst:1160 +#: ../../faq/programming.rst:1091 msgid "How do I convert between tuples and lists?" msgstr "タプル、リスト間の変更はどのようにするのですか?" -#: ../../faq/programming.rst:1162 +#: ../../faq/programming.rst:1093 msgid "" "The type constructor ``tuple(seq)`` converts any sequence (actually, any " "iterable) into a tuple with the same items in the same order." @@ -2175,7 +1623,7 @@ msgstr "" "型コンストラクタ ``tuple(seq)`` はすべてのシーケンス (実際には、すべてのイテ" "ラブル) を同じ要素、同じ順序のタプルに変換します。" -#: ../../faq/programming.rst:1165 +#: ../../faq/programming.rst:1096 msgid "" "For example, ``tuple([1, 2, 3])`` yields ``(1, 2, 3)`` and ``tuple('abc')`` " "yields ``('a', 'b', 'c')``. If the argument is a tuple, it does not make a " @@ -2187,7 +1635,7 @@ msgstr "" "ジェクトそのものを返すので、あるオブジェクトが既にタプルになっているか確信が" "持てないのなら、 :func:`tuple` を呼ぶのが手軽です。" -#: ../../faq/programming.rst:1170 +#: ../../faq/programming.rst:1101 msgid "" "The type constructor ``list(seq)`` converts any sequence or iterable into a " "list with the same items in the same order. For example, ``list((1, 2, " @@ -2199,11 +1647,11 @@ msgstr "" "3]`` を与え、``list('abc')`` は ``['a', 'b', 'c']`` を与えます。引数がリスト" "なら、``seq[:]`` と同様にコピーを作ります。" -#: ../../faq/programming.rst:1177 +#: ../../faq/programming.rst:1108 msgid "What's a negative index?" msgstr "負の添え字は何ですか?" -#: ../../faq/programming.rst:1179 +#: ../../faq/programming.rst:1110 msgid "" "Python sequences are indexed with positive numbers and negative numbers. " "For positive numbers 0 is the first index 1 is the second index and so " @@ -2216,7 +1664,7 @@ msgstr "" "は、-1 が最後のインデクス、-2 が最後から 2 番目のインデクス、以下も同様です。" "``seq[-n]`` は ``seq[len(seq)-n]`` と同じだと考えてください。" -#: ../../faq/programming.rst:1184 +#: ../../faq/programming.rst:1115 msgid "" "Using negative indices can be very convenient. For example ``S[:-1]`` is " "all of the string except for its last character, which is useful for " @@ -2225,21 +1673,15 @@ msgstr "" "負のインデクスを使うと便利なことがあります。例えば、``S[:-1]`` は文字列の最後" "以外のすべての文字を表すので、文字列の末尾の改行を取り除くときに便利です。" -#: ../../faq/programming.rst:1190 +#: ../../faq/programming.rst:1121 msgid "How do I iterate over a sequence in reverse order?" msgstr "シーケンスを逆順にイテレートするにはどうしたらいいですか?" -#: ../../faq/programming.rst:1192 +#: ../../faq/programming.rst:1123 msgid "Use the :func:`reversed` built-in function::" msgstr "組み込み関数 :func:`reversed` を使ってください。" -#: ../../faq/programming.rst:1194 -msgid "" -"for x in reversed(sequence):\n" -" ... # do something with x ..." -msgstr "" - -#: ../../faq/programming.rst:1197 +#: ../../faq/programming.rst:1128 msgid "" "This won't touch your original sequence, but build a new copy with reversed " "order to iterate over." @@ -2247,19 +1689,19 @@ msgstr "" "これは元のシーケンスをいじるのではなく、逆順の新しいコピーを作ってイテレート" "させます。" -#: ../../faq/programming.rst:1202 +#: ../../faq/programming.rst:1133 msgid "How do you remove duplicates from a list?" msgstr "リストから重複を取り除くにはどうしますか?" -#: ../../faq/programming.rst:1204 +#: ../../faq/programming.rst:1135 msgid "See the Python Cookbook for a long discussion of many ways to do this:" msgstr "Python Cookbook の長い議論に多くの方法があるので参照してください:" -#: ../../faq/programming.rst:1206 +#: ../../faq/programming.rst:1137 msgid "https://code.activestate.com/recipes/52560/" msgstr "https://code.activestate.com/recipes/52560/" -#: ../../faq/programming.rst:1208 +#: ../../faq/programming.rst:1139 msgid "" "If you don't mind reordering the list, sort it and then scan from the end of " "the list, deleting duplicates as you go::" @@ -2267,19 +1709,7 @@ msgstr "" "リストを並び替えて構わないのなら、ソートした上でリストの最初から最後までを調" "べ、次のように重複を削除してください::" -#: ../../faq/programming.rst:1211 -msgid "" -"if mylist:\n" -" mylist.sort()\n" -" last = mylist[-1]\n" -" for i in range(len(mylist)-2, -1, -1):\n" -" if last == mylist[i]:\n" -" del mylist[i]\n" -" else:\n" -" last = mylist[i]" -msgstr "" - -#: ../../faq/programming.rst:1220 +#: ../../faq/programming.rst:1151 msgid "" "If all elements of the list may be used as set keys (i.e. they are all :term:" "`hashable`) this is often faster ::" @@ -2287,11 +1717,7 @@ msgstr "" "リストのすべての要素が集合のキーとして使える (つまり、すべての要素が :term:" "`hashable`) なら、おそらくこのほうが速いです ::" -#: ../../faq/programming.rst:1223 -msgid "mylist = list(set(mylist))" -msgstr "" - -#: ../../faq/programming.rst:1225 +#: ../../faq/programming.rst:1156 msgid "" "This converts the list into a set, thereby removing duplicates, and then " "back into a list." @@ -2299,11 +1725,11 @@ msgstr "" "リストを集合に変換するときに重複は取り除かれるので、それをリストに戻せばいい" "のです。" -#: ../../faq/programming.rst:1230 +#: ../../faq/programming.rst:1161 msgid "How do you remove multiple items from a list" msgstr "リストから複数のアイテムを取り除く方法" -#: ../../faq/programming.rst:1232 +#: ../../faq/programming.rst:1163 msgid "" "As with removing duplicates, explicitly iterating in reverse with a delete " "condition is one possibility. However, it is easier and faster to use slice " @@ -2314,30 +1740,19 @@ msgstr "" "明示的/暗黙的な反復でスライス置換する方が速くて簡単です。こちらは3つのバリ" "エーションです。::" -#: ../../faq/programming.rst:1237 -msgid "" -"mylist[:] = filter(keep_function, mylist)\n" -"mylist[:] = (x for x in mylist if keep_condition)\n" -"mylist[:] = [x for x in mylist if keep_condition]" -msgstr "" - -#: ../../faq/programming.rst:1241 +#: ../../faq/programming.rst:1172 msgid "The list comprehension may be fastest." msgstr "リスト内包表記がおそらく最も高速です。" -#: ../../faq/programming.rst:1245 +#: ../../faq/programming.rst:1176 msgid "How do you make an array in Python?" msgstr "Python で配列を作るにはどうしますか?" -#: ../../faq/programming.rst:1247 +#: ../../faq/programming.rst:1178 msgid "Use a list::" msgstr "リストを使ってください::" -#: ../../faq/programming.rst:1249 -msgid "[\"this\", 1, \"is\", \"an\", \"array\"]" -msgstr "" - -#: ../../faq/programming.rst:1251 +#: ../../faq/programming.rst:1182 msgid "" "Lists are equivalent to C or Pascal arrays in their time complexity; the " "primary difference is that a Python list can contain objects of many " @@ -2346,75 +1761,53 @@ msgstr "" "リストの時間計算量は C や Pascal の配列と同じです。大きな違いは、Python のリ" "ストは多くの異なる型のオブジェクトを含めることです。" -#: ../../faq/programming.rst:1254 +#: ../../faq/programming.rst:1185 msgid "" "The ``array`` module also provides methods for creating arrays of fixed " "types with compact representations, but they are slower to index than " -"lists. Also note that `NumPy `_ and other third party " -"packages define array-like structures with various characteristics as well." +"lists. Also note that the Numeric extensions and others define array-like " +"structures with various characteristics as well." msgstr "" "``array`` モジュールにも固定された型を簡潔に表現する配列を作るためのメソッド" -"がありますが、リストよりもインデクスが遅いです。また、`NumPy `_ やその他のサードパーティー拡張でも、様々な特徴をもつ配列的な構造体が" -"定義されています。" +"がありますが、リストよりもインデクスが遅いです。また、Numeric 拡張その他で" +"も、様々な特徴をもつ配列的な構造体が定義されています。" -#: ../../faq/programming.rst:1260 +#: ../../faq/programming.rst:1190 msgid "" -"To get Lisp-style linked lists, you can emulate *cons cells* using tuples::" -msgstr "" -"Lisp 方式の連結リストを得るのに、タプルを使って *cons cells* をエミュレートで" -"きます::" - -#: ../../faq/programming.rst:1262 -msgid "lisp_list = (\"like\", (\"this\", (\"example\", None) ) )" +"To get Lisp-style linked lists, you can emulate cons cells using tuples::" msgstr "" +"Lisp 方式の連結リストを得るのに、タプルを使ってコンスセルをエミュレートできま" +"す::" -#: ../../faq/programming.rst:1264 +#: ../../faq/programming.rst:1194 msgid "" "If mutability is desired, you could use lists instead of tuples. Here the " -"analogue of a Lisp *car* is ``lisp_list[0]`` and the analogue of *cdr* is " +"analogue of lisp car is ``lisp_list[0]`` and the analogue of cdr is " "``lisp_list[1]``. Only do this if you're sure you really need to, because " "it's usually a lot slower than using Python lists." msgstr "" -"ミュータブルな必要があるなら、タプルではなくリストを使いましょう。Lisp の " -"*car* にあたるものが ``lisp_list[0]`` で、cdr にあたるものが " -"``lisp_list[1]`` です。本当に必要だと確信できるとき以外はこれはしないでくださ" -"い。たいてい、これは Python のリストを使うよりも非常に遅いですから。" +"ミュータブルな必要があるなら、タプルではなくリストを使いましょう。lisp の " +"car にあたるものが ``lisp_list[0]`` で、cdr にあたるものが ``lisp_list[1]`` " +"です。本当に必要だと確信できるとき以外はこれはしないでください。たいてい、こ" +"れは Python のリストを使うよりも非常に遅いですから。" -#: ../../faq/programming.rst:1273 +#: ../../faq/programming.rst:1203 msgid "How do I create a multidimensional list?" msgstr "多次元のリストを作るにはどうしますか?" -#: ../../faq/programming.rst:1275 +#: ../../faq/programming.rst:1205 msgid "You probably tried to make a multidimensional array like this::" msgstr "このようにして多次元の配列を作ろうとしてしまったことがあるでしょう::" -#: ../../faq/programming.rst:1277 -msgid ">>> A = [[None] * 2] * 3" -msgstr "" - -#: ../../faq/programming.rst:1279 +#: ../../faq/programming.rst:1209 msgid "This looks correct if you print it:" msgstr "これを表示したときには問題なさそうに見えます:" -#: ../../faq/programming.rst:1285 -msgid "" -">>> A\n" -"[[None, None], [None, None], [None, None]]" -msgstr "" - -#: ../../faq/programming.rst:1290 +#: ../../faq/programming.rst:1220 msgid "But when you assign a value, it shows up in multiple places:" msgstr "しかし値を代入すると、その値が複数の場所に現れてしまいます:" -#: ../../faq/programming.rst:1296 -msgid "" -">>> A[0][0] = 5\n" -">>> A\n" -"[[5, None], [5, None], [5, None]]" -msgstr "" - -#: ../../faq/programming.rst:1302 +#: ../../faq/programming.rst:1232 msgid "" "The reason is that replicating a list with ``*`` doesn't create copies, it " "only creates references to the existing objects. The ``*3`` creates a list " @@ -2426,7 +1819,7 @@ msgstr "" "トを作ります。一つの列に対する変更はすべての列に現れますが、これが望んだ結果" "であることはまずないでしょう。" -#: ../../faq/programming.rst:1307 +#: ../../faq/programming.rst:1237 msgid "" "The suggested approach is to create a list of the desired length first and " "then fill in each element with a newly created list::" @@ -2434,14 +1827,7 @@ msgstr "" "おすすめの方法は、最初に望んだ長さのリストを作り、それから新しく作ったリスト" "でそれぞれの要素を埋めていくことです::" -#: ../../faq/programming.rst:1310 -msgid "" -"A = [None] * 3\n" -"for i in range(3):\n" -" A[i] = [None] * 2" -msgstr "" - -#: ../../faq/programming.rst:1314 +#: ../../faq/programming.rst:1244 msgid "" "This generates a list containing 3 different lists of length two. You can " "also use a list comprehension::" @@ -2449,62 +1835,28 @@ msgstr "" "これは長さ 2 の異なるリスト 3 つを含むリストを生成します。リスト内包表記も使" "えます::" -#: ../../faq/programming.rst:1317 -msgid "" -"w, h = 2, 3\n" -"A = [[None] * w for i in range(h)]" -msgstr "" - -#: ../../faq/programming.rst:1320 -msgid "" -"Or, you can use an extension that provides a matrix datatype; `NumPy " -"`_ is the best known." -msgstr "" -"あるいは、行列データ型を提供している拡張を使用することもできます; `NumPy " -"`_ が最もよく知られています。" - -#: ../../faq/programming.rst:1325 -msgid "How do I apply a method or function to a sequence of objects?" -msgstr "オブジェクトのシーケンスにメソッドや関数を適用するにはどうしますか?" - -#: ../../faq/programming.rst:1327 +#: ../../faq/programming.rst:1250 msgid "" -"To call a method or function and accumulate the return values is a list, a :" -"term:`list comprehension` is an elegant solution::" +"Or, you can use an extension that provides a matrix datatype; `NumPy `_ is the best known." msgstr "" -"メソッドや関数を呼び出して結果を蓄積するのには、 :term:`list comprehension` " -"(リスト内包表記) がエレガントな解決策です::" +"あるいは、行列データ型を提供している拡張を使用することもできます; `NumPy `_ " +"が最もよく知られています。" -#: ../../faq/programming.rst:1330 -msgid "" -"result = [obj.method() for obj in mylist]\n" -"\n" -"result = [function(obj) for obj in mylist]" -msgstr "" +#: ../../faq/programming.rst:1255 +msgid "How do I apply a method to a sequence of objects?" +msgstr "オブジェクトのシーケンスにメソッドを適用するにはどうしますか?" -#: ../../faq/programming.rst:1334 -msgid "" -"To just run the method or function without saving the return values, a " -"plain :keyword:`for` loop will suffice::" -msgstr "" -"戻り値を保存せずにメソッドや関数を実行するだけなら、ただの :keyword:`for` " -"ループで十分です::" +#: ../../faq/programming.rst:1257 +msgid "Use a list comprehension::" +msgstr "リスト内包表記を使ってください::" -#: ../../faq/programming.rst:1337 -msgid "" -"for obj in mylist:\n" -" obj.method()\n" -"\n" -"for obj in mylist:\n" -" function(obj)" -msgstr "" - -#: ../../faq/programming.rst:1346 +#: ../../faq/programming.rst:1264 msgid "" "Why does a_tuple[i] += ['item'] raise an exception when the addition works?" msgstr "なぜ加算はされるのに a_tuple[i] += ['item'] は例外を送出するのですか?" -#: ../../faq/programming.rst:1348 +#: ../../faq/programming.rst:1266 msgid "" "This is because of a combination of the fact that augmented assignment " "operators are *assignment* operators, and the difference between mutable and " @@ -2513,7 +1865,7 @@ msgstr "" "これは、累算代入演算子は *代入* 演算子だ、という事実と、Python での可変オブ" "ジェクトと不変オブジェクトの違いが組み合わさって起きるのです。" -#: ../../faq/programming.rst:1352 +#: ../../faq/programming.rst:1270 msgid "" "This discussion applies in general when augmented assignment operators are " "applied to elements of a tuple that point to mutable objects, but we'll use " @@ -2522,20 +1874,11 @@ msgstr "" "この議論は一般的に、可変オブジェクトを指すタプルの要素に、累算代入演算子が適" "用されたときにも適用できますが、例として ``list`` と ``+=`` を使います。" -#: ../../faq/programming.rst:1356 +#: ../../faq/programming.rst:1274 msgid "If you wrote::" msgstr "次のように書いたとします::" -#: ../../faq/programming.rst:1358 -msgid "" -">>> a_tuple = (1, 2)\n" -">>> a_tuple[0] += 1\n" -"Traceback (most recent call last):\n" -" ...\n" -"TypeError: 'tuple' object does not support item assignment" -msgstr "" - -#: ../../faq/programming.rst:1364 +#: ../../faq/programming.rst:1282 msgid "" "The reason for the exception should be immediately clear: ``1`` is added to " "the object ``a_tuple[0]`` points to (``1``), producing the result object, " @@ -2548,41 +1891,23 @@ msgstr "" "果 ``2`` をタプルの第 ``0`` 要素に代入しようとしたときに、エラーが発生しま" "す。なぜならば、タプルの要素が何を指すかは変えられないからです。" -#: ../../faq/programming.rst:1370 +#: ../../faq/programming.rst:1288 msgid "" "Under the covers, what this augmented assignment statement is doing is " "approximately this::" msgstr "このような裏事情の元、累算代入文はだいたい次のようなことをしています::" -#: ../../faq/programming.rst:1373 -msgid "" -">>> result = a_tuple[0] + 1\n" -">>> a_tuple[0] = result\n" -"Traceback (most recent call last):\n" -" ...\n" -"TypeError: 'tuple' object does not support item assignment" -msgstr "" - -#: ../../faq/programming.rst:1379 +#: ../../faq/programming.rst:1297 msgid "" "It is the assignment part of the operation that produces the error, since a " "tuple is immutable." msgstr "タプルは不変なので、例外を生み出しているのは操作の代入部分なのです。" -#: ../../faq/programming.rst:1382 +#: ../../faq/programming.rst:1300 msgid "When you write something like::" msgstr "次のように書いたとします::" -#: ../../faq/programming.rst:1384 -msgid "" -">>> a_tuple = (['foo'], 'bar')\n" -">>> a_tuple[0] += ['item']\n" -"Traceback (most recent call last):\n" -" ...\n" -"TypeError: 'tuple' object does not support item assignment" -msgstr "" - -#: ../../faq/programming.rst:1390 +#: ../../faq/programming.rst:1308 msgid "" "The exception is a bit more surprising, and even more surprising is the fact " "that even though there was an error, the append worked::" @@ -2590,47 +1915,27 @@ msgstr "" "この例外にはちょっと驚きますが、もっと驚くべきことは、エラーがあったとしても" "追記はきちんと動いている、という事実です::" -#: ../../faq/programming.rst:1393 -msgid "" -">>> a_tuple[0]\n" -"['foo', 'item']" -msgstr "" - -#: ../../faq/programming.rst:1396 +#: ../../faq/programming.rst:1314 msgid "" "To see why this happens, you need to know that (a) if an object implements " -"an :meth:`~object.__iadd__` magic method, it gets called when the ``+=`` " -"augmented assignment is executed, and its return value is what gets used in " -"the assignment statement; and (b) for lists, :meth:`!__iadd__` is equivalent " -"to calling :meth:`!extend` on the list and returning the list. That's why " -"we say that for lists, ``+=`` is a \"shorthand\" for :meth:`!list.extend`::" +"an ``__iadd__`` magic method, it gets called when the ``+=`` augmented " +"assignment is executed, and its return value is what gets used in the " +"assignment statement; and (b) for lists, ``__iadd__`` is equivalent to " +"calling ``extend`` on the list and returning the list. That's why we say " +"that for lists, ``+=`` is a \"shorthand\" for ``list.extend``::" msgstr "" "なぜこれが起きるかを調べるためには、次の 2 点を知っている必要があります。(a) " -"オブジェクトに :meth:`~object.__iadd__` 特殊メソッドが実装されている場合、拡" -"張代入 ``+=`` が実行されるときにそれが呼び出され、その返り値が代入文で使われ" -"ます; (b) リストでは、:meth:`!__iadd__` は :meth:`!extend` の呼び出しと等価" -"で、リストを返します。こんな理由で、リストでは ``+=`` は :meth:`!list." -"extend` の \"略記\" だと言ったのでした::" +"オブジェクトに ``__iadd__`` 特殊メソッドが実装されている場合、拡張代入 " +"``+=`` が実行されるときにそれが呼び出され、その返り値が代入文で使われます; " +"(b) リストでは、``__iadd__`` は ``extend`` の呼び出しと等価で、リストを返しま" +"す。こんな理由で、リストでは ``+=`` は ``list.extend`` の \"略記\" だと言った" +"のでした::" -#: ../../faq/programming.rst:1404 -msgid "" -">>> a_list = []\n" -">>> a_list += [1]\n" -">>> a_list\n" -"[1]" -msgstr "" - -#: ../../faq/programming.rst:1409 +#: ../../faq/programming.rst:1326 msgid "This is equivalent to::" msgstr "これは次と等価です::" -#: ../../faq/programming.rst:1411 -msgid "" -">>> result = a_list.__iadd__([1])\n" -">>> a_list = result" -msgstr "" - -#: ../../faq/programming.rst:1414 +#: ../../faq/programming.rst:1331 msgid "" "The object pointed to by a_list has been mutated, and the pointer to the " "mutated object is assigned back to ``a_list``. The end result of the " @@ -2642,37 +1947,28 @@ msgstr "" "していた同じオブジェクトへのポインタなので、代入は最終的には何もしていないの" "ですが、代入処理自体は起きています。" -#: ../../faq/programming.rst:1419 +#: ../../faq/programming.rst:1336 msgid "Thus, in our tuple example what is happening is equivalent to::" msgstr "従って、今のタプルの例では、次のと同じことが起きています::" -#: ../../faq/programming.rst:1421 -msgid "" -">>> result = a_tuple[0].__iadd__(['item'])\n" -">>> a_tuple[0] = result\n" -"Traceback (most recent call last):\n" -" ...\n" -"TypeError: 'tuple' object does not support item assignment" -msgstr "" - -#: ../../faq/programming.rst:1427 +#: ../../faq/programming.rst:1344 msgid "" -"The :meth:`!__iadd__` succeeds, and thus the list is extended, but even " -"though ``result`` points to the same object that ``a_tuple[0]`` already " -"points to, that final assignment still results in an error, because tuples " -"are immutable." +"The ``__iadd__`` succeeds, and thus the list is extended, but even though " +"``result`` points to the same object that ``a_tuple[0]`` already points to, " +"that final assignment still results in an error, because tuples are " +"immutable." msgstr "" -":meth:`!__iadd__` は成功し、リストは拡張 (extend) されますが、``result`` が " +"``__iadd__`` は成功し、リストは拡張 (extend) されますが、``result`` が " "``a_tuple[0]`` が既に指しているオブジェクトと同じオブジェクトを指していたとし" "ても、タプルは不変なので、その最後の代入はやはりエラーとなります。" -#: ../../faq/programming.rst:1433 +#: ../../faq/programming.rst:1350 msgid "" "I want to do a complicated sort: can you do a Schwartzian Transform in " "Python?" msgstr "複雑なソートがしたいのですが、Python でシュワルツ変換はできますか?" -#: ../../faq/programming.rst:1435 +#: ../../faq/programming.rst:1352 msgid "" "The technique, attributed to Randal Schwartz of the Perl community, sorts " "the elements of a list by a metric which maps each element to its \"sort " @@ -2684,17 +1980,11 @@ msgstr "" "ます。Python では、 :meth:`list.sort` メソッドに ``key`` 引数を使ってくださ" "い::" -#: ../../faq/programming.rst:1439 -msgid "" -"Isorted = L[:]\n" -"Isorted.sort(key=lambda s: int(s[10:15]))" -msgstr "" - -#: ../../faq/programming.rst:1444 +#: ../../faq/programming.rst:1361 msgid "How can I sort one list by values from another list?" msgstr "リストを別のリストの値によってソートするにはどうしますか?" -#: ../../faq/programming.rst:1446 +#: ../../faq/programming.rst:1363 msgid "" "Merge them into an iterator of tuples, sort the resulting list, and then " "pick out the element you want. ::" @@ -2702,29 +1992,15 @@ msgstr "" "二つのイテレータを混ぜあわせてタプルのイテレータにしてから、必要な要素を選ん" "でください。 ::" -#: ../../faq/programming.rst:1449 -msgid "" -">>> list1 = [\"what\", \"I'm\", \"sorting\", \"by\"]\n" -">>> list2 = [\"something\", \"else\", \"to\", \"sort\"]\n" -">>> pairs = zip(list1, list2)\n" -">>> pairs = sorted(pairs)\n" -">>> pairs\n" -"[(\"I'm\", 'else'), ('by', 'sort'), ('sorting', 'to'), ('what', " -"'something')]\n" -">>> result = [x[1] for x in pairs]\n" -">>> result\n" -"['else', 'sort', 'to', 'something']" -msgstr "" - -#: ../../faq/programming.rst:1461 +#: ../../faq/programming.rst:1378 msgid "Objects" msgstr "オブジェクト" -#: ../../faq/programming.rst:1464 +#: ../../faq/programming.rst:1381 msgid "What is a class?" msgstr "クラスとは何ですか?" -#: ../../faq/programming.rst:1466 +#: ../../faq/programming.rst:1383 msgid "" "A class is the particular object type created by executing a class " "statement. Class objects are used as templates to create instance objects, " @@ -2736,7 +2012,7 @@ msgstr "" "データ型に特有のデータ (attribute/属性) とコード (メソッド) の両方を内蔵して" "います。" -#: ../../faq/programming.rst:1470 +#: ../../faq/programming.rst:1387 msgid "" "A class can be based on one or more other classes, called its base " "class(es). It then inherits the attributes and methods of its base classes. " @@ -2752,11 +2028,11 @@ msgstr "" "て、それからいろいろな特定のメールボックスの形式を扱う ``MboxMailbox``、" "``MaildirMailbox``、``OutlookMailbox`` のようなサブクラスを作れるのです。" -#: ../../faq/programming.rst:1479 +#: ../../faq/programming.rst:1396 msgid "What is a method?" msgstr "メソッドとは何ですか?" -#: ../../faq/programming.rst:1481 +#: ../../faq/programming.rst:1398 msgid "" "A method is a function on some object ``x`` that you normally call as ``x." "name(arguments...)``. Methods are defined as functions inside the class " @@ -2765,18 +2041,11 @@ msgstr "" "メソッドは、オブジェクト ``x`` が持つ関数で、通常 ``x.name(arguments...)`` と" "して呼び出されるものです。メソッドはクラス定義の中で関数として定義されます::" -#: ../../faq/programming.rst:1485 -msgid "" -"class C:\n" -" def meth(self, arg):\n" -" return arg * 2 + self.attribute" -msgstr "" - -#: ../../faq/programming.rst:1491 +#: ../../faq/programming.rst:1408 msgid "What is self?" msgstr "self とは何ですか?" -#: ../../faq/programming.rst:1493 +#: ../../faq/programming.rst:1410 msgid "" "Self is merely a conventional name for the first argument of a method. A " "method defined as ``meth(self, a, b, c)`` should be called as ``x.meth(a, b, " @@ -2788,11 +2057,11 @@ msgstr "" "ス ``x`` に対して ``x.meth(a, b, c)`` として呼び出されます。呼び出されたメ" "ソッドは、``meth(x, a, b, c)`` が呼ばれたものと考えます。" -#: ../../faq/programming.rst:1498 +#: ../../faq/programming.rst:1415 msgid "See also :ref:`why-self`." msgstr ":ref:`why-self` も参照してください。" -#: ../../faq/programming.rst:1502 +#: ../../faq/programming.rst:1419 msgid "" "How do I check if an object is an instance of a given class or of a subclass " "of it?" @@ -2800,22 +2069,21 @@ msgstr "" "あるオブジェクトが、与えられたクラスやそのサブクラスのインスタンスであるかを" "調べるにはどうしますか?" -#: ../../faq/programming.rst:1504 +#: ../../faq/programming.rst:1421 msgid "" -"Use the built-in function :func:`isinstance(obj, cls) `. You " -"can check if an object is an instance of any of a number of classes by " -"providing a tuple instead of a single class, e.g. ``isinstance(obj, (class1, " -"class2, ...))``, and can also check whether an object is one of Python's " -"built-in types, e.g. ``isinstance(obj, str)`` or ``isinstance(obj, (int, " -"float, complex))``." +"Use the built-in function ``isinstance(obj, cls)``. You can check if an " +"object is an instance of any of a number of classes by providing a tuple " +"instead of a single class, e.g. ``isinstance(obj, (class1, class2, ...))``, " +"and can also check whether an object is one of Python's built-in types, e.g. " +"``isinstance(obj, str)`` or ``isinstance(obj, (int, float, complex))``." msgstr "" -"ビルトイン関数 :func:`isinstance(obj, cls) ` を使ってください。ク" -"ラスのタプルを与えて ``isinstance(obj, (class1, class2, ...))`` のようにすれ" -"ば、あるオブジェクトが任意の数のクラスのオブジェクトであるかを調べられます" -"し、``isinstance(obj, str)`` や ``isinstance(obj, (int, float, complex))`` の" -"ようにすれば、Python のビルトイン型のオブジェクトであるかも調べられます。" +"ビルトイン関数 ``isinstance(obj, cls)`` を使ってください。クラスのタプルを与" +"えて ``isinstance(obj, (class1, class2, ...))`` のようにすれば、あるオブジェ" +"クトが任意の数のクラスのオブジェクトであるかを調べられますし、" +"``isinstance(obj, str)`` や ``isinstance(obj, (int, float, complex))`` のよう" +"にすれば、Python のビルトイン型のオブジェクトであるかも調べられます。" -#: ../../faq/programming.rst:1511 +#: ../../faq/programming.rst:1427 msgid "" "Note that :func:`isinstance` also checks for virtual inheritance from an :" "term:`abstract base class`. So, the test will return ``True`` for a " @@ -2827,39 +2095,7 @@ msgstr "" "的にそれを継承していなくても ``True`` を返します。「真のインスタンス」をテス" "トする場合は、クラスの :term:`MRO` を調べます:" -#: ../../faq/programming.rst:1516 -msgid "" -"from collections.abc import Mapping\n" -"\n" -"class P:\n" -" pass\n" -"\n" -"class C(P):\n" -" pass\n" -"\n" -"Mapping.register(P)" -msgstr "" - -#: ../../faq/programming.rst:1528 -msgid "" -">>> c = C()\n" -">>> isinstance(c, C) # direct\n" -"True\n" -">>> isinstance(c, P) # indirect\n" -"True\n" -">>> isinstance(c, Mapping) # virtual\n" -"True\n" -"\n" -"# Actual inheritance chain\n" -">>> type(c).__mro__\n" -"(, , )\n" -"\n" -"# Test for \"true inheritance\"\n" -">>> Mapping in type(c).__mro__\n" -"False" -msgstr "" - -#: ../../faq/programming.rst:1546 +#: ../../faq/programming.rst:1462 msgid "" "Note that most programs do not use :func:`isinstance` on user-defined " "classes very often. If you are developing the classes yourself, a more " @@ -2874,17 +2110,7 @@ msgstr "" "であって、オブジェクトのクラスを調べてそのクラスに応じて違うことをするもので" "はありません。例えば、何かをする関数があったとして::" -#: ../../faq/programming.rst:1553 -msgid "" -"def search(obj):\n" -" if isinstance(obj, Mailbox):\n" -" ... # code to search a mailbox\n" -" elif isinstance(obj, Document):\n" -" ... # code to search a document\n" -" elif ..." -msgstr "" - -#: ../../faq/programming.rst:1560 +#: ../../faq/programming.rst:1476 msgid "" "A better approach is to define a ``search()`` method on all the classes and " "just call it::" @@ -2892,24 +2118,11 @@ msgstr "" "よりよいアプローチは、``search()`` メソッドをすべてのクラスに定義して、それを" "ただ呼び出すことです::" -#: ../../faq/programming.rst:1563 -msgid "" -"class Mailbox:\n" -" def search(self):\n" -" ... # code to search a mailbox\n" -"\n" -"class Document:\n" -" def search(self):\n" -" ... # code to search a document\n" -"\n" -"obj.search()" -msgstr "" - -#: ../../faq/programming.rst:1575 +#: ../../faq/programming.rst:1491 msgid "What is delegation?" msgstr "委譲とは何ですか?" -#: ../../faq/programming.rst:1577 +#: ../../faq/programming.rst:1493 msgid "" "Delegation is an object oriented technique (also called a design pattern). " "Let's say you have an object ``x`` and want to change the behaviour of just " @@ -2923,7 +2136,7 @@ msgstr "" "新しく実装し、他のすべてのメソッドを ``x`` の対応するメソッドに委譲する新しい" "クラスを作れます。" -#: ../../faq/programming.rst:1583 +#: ../../faq/programming.rst:1499 msgid "" "Python programmers can easily implement delegation. For example, the " "following class implements a class that behaves like a file but converts all " @@ -2932,113 +2145,68 @@ msgstr "" "Python プログラマは簡単に委譲を実装できます。例えば、以下のクラスは、ファイル" "のように振る舞いながらすべての文字を大文字に変換するクラスを実装します::" -#: ../../faq/programming.rst:1587 -msgid "" -"class UpperOut:\n" -"\n" -" def __init__(self, outfile):\n" -" self._outfile = outfile\n" -"\n" -" def write(self, s):\n" -" self._outfile.write(s.upper())\n" -"\n" -" def __getattr__(self, name):\n" -" return getattr(self._outfile, name)" -msgstr "" - -#: ../../faq/programming.rst:1598 +#: ../../faq/programming.rst:1514 msgid "" "Here the ``UpperOut`` class redefines the ``write()`` method to convert the " "argument string to uppercase before calling the underlying ``self._outfile." "write()`` method. All other methods are delegated to the underlying ``self." -"_outfile`` object. The delegation is accomplished via the :meth:`~object." -"__getattr__` method; consult :ref:`the language reference ` for more information about controlling attribute access." +"_outfile`` object. The delegation is accomplished via the ``__getattr__`` " +"method; consult :ref:`the language reference ` for more " +"information about controlling attribute access." msgstr "" -"ここで ``UpperOut`` クラスは ``write()`` メソッドを定義しなおして、引数の文字" -"列を大文字に変換してから基礎となる ``self._outfile.write()`` メソッドを呼び出" -"すようにします。その他すべてのメソッドは基礎となる ``self._outfile`` オブジェ" -"クトに移譲されます。この委譲は :meth:`~object.__getattr__` メソッドを通してな" -"されます。属性の制御の詳細は :ref:`言語リファレンス ` を参" -"照してください。" -#: ../../faq/programming.rst:1605 +#: ../../faq/programming.rst:1521 msgid "" "Note that for more general cases delegation can get trickier. When " "attributes must be set as well as retrieved, the class must define a :meth:" -"`~object.__setattr__` method too, and it must do so carefully. The basic " -"implementation of :meth:`!__setattr__` is roughly equivalent to the " +"`__setattr__` method too, and it must do so carefully. The basic " +"implementation of :meth:`__setattr__` is roughly equivalent to the " "following::" msgstr "" "なお、一般的に委譲はトリッキーになりがちです。属性が設定される時には読み出さ" -"れる時と同様に、そのクラスに :meth:`~object.__setattr__` メソッドを定義する必" -"要があり、それには細心の注意が必要です。 :meth:`!__setattr__` の基本的な実装" -"はおおよそ以下のようになります::" - -#: ../../faq/programming.rst:1610 -msgid "" -"class X:\n" -" ...\n" -" def __setattr__(self, name, value):\n" -" self.__dict__[name] = value\n" -" ..." -msgstr "" - -#: ../../faq/programming.rst:1616 -msgid "" -"Many :meth:`~object.__setattr__` implementations call :meth:`!object." -"__setattr__` to set an attribute on self without causing infinite recursion::" -msgstr "" - -#: ../../faq/programming.rst:1619 -msgid "" -"class X:\n" -" def __setattr__(self, name, value):\n" -" # Custom logic here...\n" -" object.__setattr__(self, name, value)" -msgstr "" +"れる時と同様に、そのクラスに :meth:`__setattr__` メソッドを定義する必要があ" +"り、それには細心の注意が必要です。 :meth:`__setattr__` の基本的な実装はおおよ" +"そ以下のようになります::" -#: ../../faq/programming.rst:1624 +#: ../../faq/programming.rst:1532 msgid "" -"Alternatively, it is possible to set attributes by inserting entries into :" -"attr:`self.__dict__ ` directly." +"Most :meth:`__setattr__` implementations must modify ``self.__dict__`` to " +"store local state for self without causing an infinite recursion." msgstr "" +"たいてい、 :meth:`__setattr__` 実装は ``self.__dict__`` を変更して、無限再帰" +"を起こすことなくローカルな状態を保存するようにしなければなりません。" -#: ../../faq/programming.rst:1629 +#: ../../faq/programming.rst:1537 msgid "" "How do I call a method defined in a base class from a derived class that " -"extends it?" +"overrides it?" msgstr "" -"基底クラスで定義されたメソッドを、そのクラスを継承した派生クラスから呼び出す" -"にはどうしますか?" +"基底クラスで定義されたメソッドを、そのクラスをオーバーライドした派生クラスか" +"ら呼び出すにはどうしますか?" -#: ../../faq/programming.rst:1631 +#: ../../faq/programming.rst:1539 msgid "Use the built-in :func:`super` function::" msgstr "組み込みの :func:`super` 関数を使ってください::" -#: ../../faq/programming.rst:1633 -msgid "" -"class Derived(Base):\n" -" def meth(self):\n" -" super().meth() # calls Base.meth" -msgstr "" - -#: ../../faq/programming.rst:1637 +#: ../../faq/programming.rst:1545 msgid "" -"In the example, :func:`super` will automatically determine the instance from " -"which it was called (the ``self`` value), look up the :term:`method " -"resolution order` (MRO) with ``type(self).__mro__``, and return the next in " -"line after ``Derived`` in the MRO: ``Base``." +"For version prior to 3.0, you may be using classic classes: For a class " +"definition such as ``class Derived(Base): ...`` you can call method " +"``meth()`` defined in ``Base`` (or one of ``Base``'s base classes) as ``Base." +"meth(self, arguments...)``. Here, ``Base.meth`` is an unbound method, so " +"you need to provide the ``self`` argument." msgstr "" -"この例では、 :func:`super` は呼ばれたインスタンス (``self`` の値) を自動判断" -"し、 ``type(self).__mro__`` で :term:`method resolution order` (MRO メソッド" -"解決順) を検索し、そしてMRO内で ``Derived`` の次行を返します: ``Base`` 。" +"3.0 以前のバージョンで旧スタイルクラスを使っているなら: ``class " +"Derived(Base): ...`` のようなクラス定義で、``Base.meth(self, arguments...)`` " +"とすれば、``Base`` (または ``Base`` の基底クラス) で定義された ``meth()`` メ" +"ソッドを呼び出せます。ここで、``Base.meth`` は束縛されていないメソッドなの" +"で、``self`` 引数を渡す必要があります。" -#: ../../faq/programming.rst:1644 +#: ../../faq/programming.rst:1553 msgid "How can I organize my code to make it easier to change the base class?" msgstr "基底クラスの名前を変えやすいコードを書くにはどうしますか?" -#: ../../faq/programming.rst:1646 +#: ../../faq/programming.rst:1555 msgid "" "You could assign the base class to an alias and derive from the alias. Then " "all you have to change is the value assigned to the alias. Incidentally, " @@ -3050,22 +2218,11 @@ msgstr "" "す。ちなみに、この手法は使用する基底クラスを動的に選びたいとき、例えば使える" "リソースによって選びたいときなどにも便利です。例::" -#: ../../faq/programming.rst:1651 -msgid "" -"class Base:\n" -" ...\n" -"\n" -"BaseAlias = Base\n" -"\n" -"class Derived(BaseAlias):\n" -" ..." -msgstr "" - -#: ../../faq/programming.rst:1661 +#: ../../faq/programming.rst:1570 msgid "How do I create static class data and static class methods?" msgstr "静的なクラスデータや静的なクラスメソッドを作るにはどうしますか?" -#: ../../faq/programming.rst:1663 +#: ../../faq/programming.rst:1572 msgid "" "Both static data and static methods (in the sense of C++ or Java) are " "supported in Python." @@ -3073,7 +2230,7 @@ msgstr "" "(C++ や Java の意味で) 静的なデータも静的なメソッドも Python でサポートされて" "います。" -#: ../../faq/programming.rst:1666 +#: ../../faq/programming.rst:1575 msgid "" "For static data, simply define a class attribute. To assign a new value to " "the attribute, you have to explicitly use the class name in the assignment::" @@ -3081,19 +2238,7 @@ msgstr "" "静的なデータを作るには、単純にクラス属性を定義してください。その属性に新しい" "値を代入するには、代入するクラス名を明示する必要があります::" -#: ../../faq/programming.rst:1669 -msgid "" -"class C:\n" -" count = 0 # number of times C.__init__ called\n" -"\n" -" def __init__(self):\n" -" C.count = C.count + 1\n" -"\n" -" def getcount(self):\n" -" return C.count # or return self.count" -msgstr "" - -#: ../../faq/programming.rst:1678 +#: ../../faq/programming.rst:1587 msgid "" "``c.count`` also refers to ``C.count`` for any ``c`` such that " "``isinstance(c, C)`` holds, unless overridden by ``c`` itself or by some " @@ -3103,7 +2248,7 @@ msgstr "" "よってオーバーライドされない限り、``c.count`` も ``isinstance(c, C)`` である" "すべての ``c`` に対する ``C.count`` を参照します。" -#: ../../faq/programming.rst:1682 +#: ../../faq/programming.rst:1591 msgid "" "Caution: within a method of C, an assignment like ``self.count = 42`` " "creates a new and unrelated instance named \"count\" in ``self``'s own " @@ -3115,24 +2260,11 @@ msgstr "" "静的なデータの再束縛には、メソッド内であるか否かにかかわらず、いつもクラスを" "指定しなければなりません::" -#: ../../faq/programming.rst:1687 -msgid "C.count = 314" -msgstr "" - -#: ../../faq/programming.rst:1689 +#: ../../faq/programming.rst:1598 msgid "Static methods are possible::" msgstr "静的メソッドが使えます::" -#: ../../faq/programming.rst:1691 -msgid "" -"class C:\n" -" @staticmethod\n" -" def static(arg1, arg2, arg3):\n" -" # No 'self' parameter!\n" -" ..." -msgstr "" - -#: ../../faq/programming.rst:1697 +#: ../../faq/programming.rst:1606 msgid "" "However, a far more straightforward way to get the effect of a static method " "is via a simple module-level function::" @@ -3140,13 +2272,7 @@ msgstr "" "しかし、静的メソッドの効果を得るもっと簡単な方法は、単にモジュールレベル関数" "を使うことです::" -#: ../../faq/programming.rst:1700 -msgid "" -"def getcount():\n" -" return C.count" -msgstr "" - -#: ../../faq/programming.rst:1703 +#: ../../faq/programming.rst:1612 msgid "" "If your code is structured so as to define one class (or tightly related " "class hierarchy) per module, this supplies the desired encapsulation." @@ -3155,13 +2281,13 @@ msgstr "" "連させるように) コードが構成されているなら、これで必要なカプセル化ができま" "す。" -#: ../../faq/programming.rst:1708 +#: ../../faq/programming.rst:1617 msgid "How can I overload constructors (or methods) in Python?" msgstr "" "Python でコンストラクタ(やメソッド)をオーバーロードするにはどうしたらいいです" "か?" -#: ../../faq/programming.rst:1710 +#: ../../faq/programming.rst:1619 msgid "" "This answer actually applies to all methods, but the question usually comes " "up first in the context of constructors." @@ -3169,19 +2295,11 @@ msgstr "" "この質問の答えはすべてのメソッドについて言えることですが、この質問はだいたい" "以下の構造の文脈から出てきます。" -#: ../../faq/programming.rst:1713 +#: ../../faq/programming.rst:1622 msgid "In C++ you'd write" msgstr "C++ では、このように書けます" -#: ../../faq/programming.rst:1715 -msgid "" -"class C {\n" -" C() { cout << \"No arguments\\n\"; }\n" -" C(int i) { cout << \"Argument is \" << i << \"\\n\"; }\n" -"}" -msgstr "" - -#: ../../faq/programming.rst:1722 +#: ../../faq/programming.rst:1631 msgid "" "In Python you have to write a single constructor that catches all cases " "using default arguments. For example::" @@ -3189,39 +2307,23 @@ msgstr "" "Python では、一つのコンストラクタでデフォルトの引数を使ってすべての場合に対応" "するように書かなければなりません。例えば::" -#: ../../faq/programming.rst:1725 -msgid "" -"class C:\n" -" def __init__(self, i=None):\n" -" if i is None:\n" -" print(\"No arguments\")\n" -" else:\n" -" print(\"Argument is\", i)" -msgstr "" - -#: ../../faq/programming.rst:1732 +#: ../../faq/programming.rst:1641 msgid "This is not entirely equivalent, but close enough in practice." msgstr "これで完全に等価とは言えませんが、実用上は十分に近いです。" -#: ../../faq/programming.rst:1734 +#: ../../faq/programming.rst:1643 msgid "You could also try a variable-length argument list, e.g. ::" msgstr "長さが変えられる引数のリストを試すには、例えば ::" -#: ../../faq/programming.rst:1736 -msgid "" -"def __init__(self, *args):\n" -" ..." -msgstr "" - -#: ../../faq/programming.rst:1739 +#: ../../faq/programming.rst:1648 msgid "The same approach works for all method definitions." msgstr "これと同じやり方がすべてのメソッド定義で使えます。" -#: ../../faq/programming.rst:1743 +#: ../../faq/programming.rst:1652 msgid "I try to use __spam and I get an error about _SomeClassName__spam." msgstr "__spam を使おうとしたら _SomeClassName__spam からエラーがでました。" -#: ../../faq/programming.rst:1745 +#: ../../faq/programming.rst:1654 msgid "" "Variable names with double leading underscores are \"mangled\" to provide a " "simple but effective way to define class private variables. Any identifier " @@ -3236,72 +2338,48 @@ msgstr "" "子は、``classname`` が先頭のアンダースコアをすべて削除した現在のクラス名とす" "れば、``_classname__spam`` のように文字上で置換えられます。" -#: ../../faq/programming.rst:1751 -msgid "" -"The identifier can be used unchanged within the class, but to access it " -"outside the class, the mangled name must be used:" -msgstr "" - -#: ../../faq/programming.rst:1754 -msgid "" -"class A:\n" -" def __one(self):\n" -" return 1\n" -" def two(self):\n" -" return 2 * self.__one()\n" -"\n" -"class B(A):\n" -" def three(self):\n" -" return 3 * self._A__one()\n" -"\n" -"four = 4 * A()._A__one()" -msgstr "" - -#: ../../faq/programming.rst:1768 -msgid "" -"In particular, this does not guarantee privacy since an outside user can " -"still deliberately access the private attribute; many Python programmers " -"never bother to use private variable names at all." -msgstr "" - -#: ../../faq/programming.rst:1774 +#: ../../faq/programming.rst:1660 msgid "" -"The :ref:`private name mangling specifications ` for " -"details and special cases." +"This doesn't guarantee privacy: an outside user can still deliberately " +"access the \"_classname__spam\" attribute, and private values are visible in " +"the object's ``__dict__``. Many Python programmers never bother to use " +"private variable names at all." msgstr "" -"詳細と特例は、 :ref:`private name mangling specifications` 。" +"これはプライベートであることを保証するものではありません。これでも外部のユー" +"ザが \"_classname__spam\" 属性に直接アクセスできますし、プライベートな変数は" +"オブジェクトの ``__dict__`` から見えます。多くの Python プログラマはわざわざ" +"プライベートな変数名を使おうとなど考えません。" -#: ../../faq/programming.rst:1778 +#: ../../faq/programming.rst:1667 msgid "My class defines __del__ but it is not called when I delete the object." msgstr "" "クラスに __del__ メソッドを定義しているのですが、オブジェクトを削除したときに" "呼ばれません。" -#: ../../faq/programming.rst:1780 +#: ../../faq/programming.rst:1669 msgid "There are several possible reasons for this." msgstr "いくつかの可能性があります。" -#: ../../faq/programming.rst:1782 +#: ../../faq/programming.rst:1671 msgid "" -"The :keyword:`del` statement does not necessarily call :meth:`~object." -"__del__` -- it simply decrements the object's reference count, and if this " -"reaches zero :meth:`!__del__` is called." +"The del statement does not necessarily call :meth:`__del__` -- it simply " +"decrements the object's reference count, and if this reaches zero :meth:" +"`__del__` is called." msgstr "" -":keyword:`del` 文は必ずしも :meth:`~object.__del__` を呼び出すとは限りません " -"-- これは単純にオブジェクトの参照カウントを減らすもので、カウントがゼロになっ" -"たときに :meth:`!__del__` が呼び出されます。" +"del 文は必ずしも :meth:`__del__` を呼び出すとは限りません -- これは単純にオブ" +"ジェクトの参照カウントを減らすもので、カウントがゼロになったときに :meth:" +"`__del__` が呼び出されます。" -#: ../../faq/programming.rst:1786 +#: ../../faq/programming.rst:1675 msgid "" "If your data structures contain circular links (e.g. a tree where each child " "has a parent reference and each parent has a list of children) the reference " "counts will never go back to zero. Once in a while Python runs an algorithm " "to detect such cycles, but the garbage collector might run some time after " -"the last reference to your data structure vanishes, so your :meth:`!__del__` " +"the last reference to your data structure vanishes, so your :meth:`__del__` " "method may be called at an inconvenient and random time. This is " "inconvenient if you're trying to reproduce a problem. Worse, the order in " -"which object's :meth:`!__del__` methods are executed is arbitrary. You can " +"which object's :meth:`__del__` methods are executed is arbitrary. You can " "run :func:`gc.collect` to force a collection, but there *are* pathological " "cases where objects will never be collected." msgstr "" @@ -3309,18 +2387,18 @@ msgstr "" "トを持つツリーなど) を含む場合、その参照カウントは決して 0 にはなりません。" "時々、Python はこのようなサイクルを検出するアルゴリズムを実行しますが、データ" "構造への参照がなくなってからこのガベージコレクタが実行されるまでいくらか時間" -"が掛かるかもしれないので、 :meth:`!__del__` メソッドは不都合な予期できないタ" -"イミングで呼び出されるかもしれません。これは問題を再現しようとするときに不便" -"です。さらに悪いことに、オブジェクトの :meth:`!__del__` メソッドが実行される" -"順序は任意です。 :func:`gc.collect` を起動して収集を強制することができます" -"が、オブジェクトが決して回収されないような本当に病的な場合も *あります* 。" +"が掛かるかもしれないので、 :meth:`__del__` メソッドは不都合な予期できないタイ" +"ミングで呼び出されるかもしれません。これは問題を再現しようとするときに不便で" +"す。さらに悪いことに、オブジェクトの :meth:`__del__` メソッドが実行される順序" +"は任意です。 :func:`gc.collect` を起動して収集を強制することができますが、オ" +"ブジェクトが決して回収されないような本当に病的な場合も *あります* 。" -#: ../../faq/programming.rst:1797 +#: ../../faq/programming.rst:1686 msgid "" "Despite the cycle collector, it's still a good idea to define an explicit " "``close()`` method on objects to be called whenever you're done with them. " "The ``close()`` method can then remove attributes that refer to subobjects. " -"Don't call :meth:`!__del__` directly -- :meth:`!__del__` should call " +"Don't call :meth:`__del__` directly -- :meth:`__del__` should call " "``close()`` and ``close()`` should make sure that it can be called more than " "once for the same object." msgstr "" @@ -3328,11 +2406,11 @@ msgstr "" "定義し、使い終わったらいつでも呼び出せるようにするのはいいことです。\n" "``close()`` メソッドを使うと、サブオブジェクトを参照している属性を取り除けま" "す。\n" -":meth:`!__del__` を直接呼び出さないでください -- :meth:`!__del__` は " +":meth:`__del__` を直接呼び出さないでください -- :meth:`__del__` は " "``close()`` を呼び出すでしょうし、 ``close()`` なら同じオブジェクトに対して複" "数回呼ばれてもいいことが保証されているでしょう。" -#: ../../faq/programming.rst:1804 +#: ../../faq/programming.rst:1693 msgid "" "Another way to avoid cyclical references is to use the :mod:`weakref` " "module, which allows you to point to objects without incrementing their " @@ -3343,19 +2421,19 @@ msgstr "" "を増やすことなくオブジェクトを示すことです。例えばツリー構造は、親と (必要な" "ら!) 兄弟に弱参照を使うべきです。" -#: ../../faq/programming.rst:1817 +#: ../../faq/programming.rst:1706 msgid "" -"Finally, if your :meth:`!__del__` method raises an exception, a warning " +"Finally, if your :meth:`__del__` method raises an exception, a warning " "message is printed to :data:`sys.stderr`." msgstr "" -"最後に、 :meth:`!__del__` メソッドが例外を発生させた場合、警告のメッセージ" -"が :data:`sys.stderr` に書きこまれます。" +"最後に、 :meth:`__del__` メソッドが例外を発生させた場合、警告のメッセージが :" +"data:`sys.stderr` に書きこまれます。" -#: ../../faq/programming.rst:1822 +#: ../../faq/programming.rst:1711 msgid "How do I get a list of all instances of a given class?" msgstr "与えられたクラスのすべてのインスタンスのリストを得るにはどうしますか?" -#: ../../faq/programming.rst:1824 +#: ../../faq/programming.rst:1713 msgid "" "Python does not keep track of all instances of a class (or of a built-in " "type). You can program the class's constructor to keep track of all " @@ -3365,11 +2443,11 @@ msgstr "" "のコンストラクタにそれぞれのインスタンスへの弱参照のリストを作らせることです" "べてのインスタンスをたどらせられます。" -#: ../../faq/programming.rst:1830 +#: ../../faq/programming.rst:1719 msgid "Why does the result of ``id()`` appear to be not unique?" msgstr "なぜ ``id()`` の結果は一意でないように見えるのですか?" -#: ../../faq/programming.rst:1832 +#: ../../faq/programming.rst:1721 msgid "" "The :func:`id` builtin returns an integer that is guaranteed to be unique " "during the lifetime of the object. Since in CPython, this is the object's " @@ -3383,7 +2461,7 @@ msgstr "" "はメモリの同じ場所にメモリ領域を確保されていることが、しばしば起きます。この" "現象を次の例で示しましょう:" -#: ../../faq/programming.rst:1843 +#: ../../faq/programming.rst:1732 msgid "" "The two ids belong to different integer objects that are created before, and " "deleted immediately after execution of the ``id()`` call. To be sure that " @@ -3394,11 +2472,11 @@ msgstr "" "る整数オブジェクトによるものです。id を調べたいオブジェクトがまだ生きてること" "を保証したいなら、オブジェクトへの別の参照を作ってください:" -#: ../../faq/programming.rst:1856 +#: ../../faq/programming.rst:1745 msgid "When can I rely on identity tests with the *is* operator?" msgstr "いつ *is* 演算子での同一性テストが頼れますか?" -#: ../../faq/programming.rst:1858 +#: ../../faq/programming.rst:1747 msgid "" "The ``is`` operator tests for object identity. The test ``a is b`` is " "equivalent to ``id(a) == id(b)``." @@ -3406,7 +2484,7 @@ msgstr "" "``is`` 演算子はオブジェクトの同一性をテストします。 テスト ``a is b`` は " "``id(a) == id(b)`` と同等です。" -#: ../../faq/programming.rst:1861 +#: ../../faq/programming.rst:1750 msgid "" "The most important property of an identity test is that an object is always " "identical to itself, ``a is a`` always returns ``True``. Identity tests are " @@ -3418,7 +2496,7 @@ msgstr "" "トよりも高速です。 また、等価性テストとは異なり、同一性テストは真偽値 " "``True`` または``False`` を返すことが保証されています。" -#: ../../faq/programming.rst:1866 +#: ../../faq/programming.rst:1755 msgid "" "However, identity tests can *only* be substituted for equality tests when " "object identity is assured. Generally, there are three circumstances where " @@ -3428,66 +2506,51 @@ msgstr "" "保証されている場合 *のみ* です。 一般的に、同一性が保証される状況は3つありま" "す:" -#: ../../faq/programming.rst:1870 +#: ../../faq/programming.rst:1759 msgid "" -"Assignments create new names but do not change object identity. After the " -"assignment ``new = old``, it is guaranteed that ``new is old``." +"1) Assignments create new names but do not change object identity. After " +"the assignment ``new = old``, it is guaranteed that ``new is old``." msgstr "" +"1) 代入は新しい名前を作りますが、オブジェクトIDは変えません。 ``new = old`` " +"代入の後、 ``new is old`` が保証されます。" -#: ../../faq/programming.rst:1873 +#: ../../faq/programming.rst:1762 msgid "" -"Putting an object in a container that stores object references does not " +"2) Putting an object in a container that stores object references does not " "change object identity. After the list assignment ``s[0] = x``, it is " "guaranteed that ``s[0] is x``." msgstr "" +"2) オブジェクト参照を格納するコンテナにオブジェクトを入れても、オブジェクトID" +"は変わりません。 ``s[0] = x`` リスト代入の後、 ``s[0] is x`` が保証されま" +"す。" -#: ../../faq/programming.rst:1877 +#: ../../faq/programming.rst:1766 msgid "" -"If an object is a singleton, it means that only one instance of that object " -"can exist. After the assignments ``a = None`` and ``b = None``, it is " -"guaranteed that ``a is b`` because ``None`` is a singleton." +"3) If an object is a singleton, it means that only one instance of that " +"object can exist. After the assignments ``a = None`` and ``b = None``, it " +"is guaranteed that ``a is b`` because ``None`` is a singleton." msgstr "" +"3) オブジェクトがシングルトンなら、それはそのオブジェクトのインスタンスは1つ" +"だけ存在できることを意味します。 ``a = None`` と ``b = None`` 代入の後、 " +"``a is b`` が保証されます。``None`` がシングルトンのためです。" -#: ../../faq/programming.rst:1881 +#: ../../faq/programming.rst:1770 msgid "" "In most other circumstances, identity tests are inadvisable and equality " "tests are preferred. In particular, identity tests should not be used to " "check constants such as :class:`int` and :class:`str` which aren't " "guaranteed to be singletons::" msgstr "" -"多くの他の状況では、同一性テストは賢明でなく、等価性テストをお勧めします。 " +"多くの他の状況では、同一性テストは賢明でなく、透過性テストをお勧めします。 " "特に、シングルトンであることが保証されていない :class:`int` や :class:`str` " "などの定数をチェックするために同一性テストを使わないでください。" -#: ../../faq/programming.rst:1886 -msgid "" -">>> a = 1000\n" -">>> b = 500\n" -">>> c = b + 500\n" -">>> a is c\n" -"False\n" -"\n" -">>> a = 'Python'\n" -">>> b = 'Py'\n" -">>> c = b + 'thon'\n" -">>> a is c\n" -"False" -msgstr "" - -#: ../../faq/programming.rst:1898 +#: ../../faq/programming.rst:1787 msgid "Likewise, new instances of mutable containers are never identical::" msgstr "" "同様に、ミュータブルなコンテナの新しいインスタンスは同一ではありません::" -#: ../../faq/programming.rst:1900 -msgid "" -">>> a = []\n" -">>> b = []\n" -">>> a is b\n" -"False" -msgstr "" - -#: ../../faq/programming.rst:1905 +#: ../../faq/programming.rst:1794 msgid "" "In the standard library code, you will see several common patterns for " "correctly using identity tests:" @@ -3495,261 +2558,50 @@ msgstr "" "標準ライブラリのコードには、同一性テストを正しく使うための一般的なパターンが" "あります:" -#: ../../faq/programming.rst:1908 +#: ../../faq/programming.rst:1797 msgid "" -"As recommended by :pep:`8`, an identity test is the preferred way to check " -"for ``None``. This reads like plain English in code and avoids confusion " -"with other objects that may have boolean values that evaluate to false." +"1) As recommended by :pep:`8`, an identity test is the preferred way to " +"check for ``None``. This reads like plain English in code and avoids " +"confusion with other objects that may have boolean values that evaluate to " +"false." msgstr "" +"1) :pep:`8` で推奨されるように、同一性テストは ``None`` のチェックの良い方法" +"です。 コードの中で平易な英語のように読めますし、 false と評価される真偽値を" +"持ちうる他のオブジェクトとの混同を避けます。" -#: ../../faq/programming.rst:1912 +#: ../../faq/programming.rst:1801 msgid "" -"Detecting optional arguments can be tricky when ``None`` is a valid input " -"value. In those situations, you can create a singleton sentinel object " +"2) Detecting optional arguments can be tricky when ``None`` is a valid input " +"value. In those situations, you can create an singleton sentinel object " "guaranteed to be distinct from other objects. For example, here is how to " -"implement a method that behaves like :meth:`dict.pop`:" +"implement a method that behaves like :meth:`dict.pop`::" msgstr "" -#: ../../faq/programming.rst:1917 -msgid "" -"_sentinel = object()\n" -"\n" -"def pop(self, key, default=_sentinel):\n" -" if key in self:\n" -" value = self[key]\n" -" del self[key]\n" -" return value\n" -" if default is _sentinel:\n" -" raise KeyError(key)\n" -" return default" -msgstr "" - -#: ../../faq/programming.rst:1930 +#: ../../faq/programming.rst:1817 msgid "" -"Container implementations sometimes need to augment equality tests with " +"3) Container implementations sometimes need to augment equality tests with " "identity tests. This prevents the code from being confused by objects such " "as ``float('NaN')`` that are not equal to themselves." msgstr "" +"3) コンテナの実装では、等価性テストを同一性テストで補強しないといけない場合が" +"あります。 これは、 ``float('NaN')`` のような自分自身と等価でないオブジェク" +"トによってコードが混乱するのを防ぐためです。" -#: ../../faq/programming.rst:1934 +#: ../../faq/programming.rst:1821 msgid "" -"For example, here is the implementation of :meth:`!collections.abc.Sequence." +"For example, here is the implementation of :meth:`collections.abc.Sequence." "__contains__`::" msgstr "" -"例えば、これは :meth:`!collections.abc.Sequence.__contains__`: の実装です:" - -#: ../../faq/programming.rst:1937 -msgid "" -"def __contains__(self, value):\n" -" for v in self:\n" -" if v is value or v == value:\n" -" return True\n" -" return False" -msgstr "" - -#: ../../faq/programming.rst:1945 -msgid "" -"How can a subclass control what data is stored in an immutable instance?" -msgstr "" -"どうすればサブクラスはイミュータブルなインスタンスに格納されたデータを制御で" -"きますか?" - -#: ../../faq/programming.rst:1947 -msgid "" -"When subclassing an immutable type, override the :meth:`~object.__new__` " -"method instead of the :meth:`~object.__init__` method. The latter only runs " -"*after* an instance is created, which is too late to alter data in an " -"immutable instance." -msgstr "" -"イミュータブル型をサブクラス化する場合、 :meth:`~object.__init__` ではなく :" -"meth:`~object.__new__` メソッドを継承します。 前者はインスタンスが生成され" -"た *後* に動くため、イミュータブルなインスタンスのデータを変えるには遅すぎま" -"す。" - -#: ../../faq/programming.rst:1952 -msgid "" -"All of these immutable classes have a different signature than their parent " -"class:" -msgstr "" -"これらのイミュータブルクラスはすべて、親クラスと異なるシグネチャを持ちます:" - -#: ../../faq/programming.rst:1955 -msgid "" -"from datetime import date\n" -"\n" -"class FirstOfMonthDate(date):\n" -" \"Always choose the first day of the month\"\n" -" def __new__(cls, year, month, day):\n" -" return super().__new__(cls, year, month, 1)\n" -"\n" -"class NamedInt(int):\n" -" \"Allow text names for some numbers\"\n" -" xlat = {'zero': 0, 'one': 1, 'ten': 10}\n" -" def __new__(cls, value):\n" -" value = cls.xlat.get(value, value)\n" -" return super().__new__(cls, value)\n" -"\n" -"class TitleStr(str):\n" -" \"Convert str to name suitable for a URL path\"\n" -" def __new__(cls, s):\n" -" s = s.lower().replace(' ', '-')\n" -" s = ''.join([c for c in s if c.isalnum() or c == '-'])\n" -" return super().__new__(cls, s)" -msgstr "" - -#: ../../faq/programming.rst:1978 -msgid "The classes can be used like this:" -msgstr "クラスはこのように使えます:" - -#: ../../faq/programming.rst:1980 -msgid "" -">>> FirstOfMonthDate(2012, 2, 14)\n" -"FirstOfMonthDate(2012, 2, 1)\n" -">>> NamedInt('ten')\n" -"10\n" -">>> NamedInt(20)\n" -"20\n" -">>> TitleStr('Blog: Why Python Rocks')\n" -"'blog-why-python-rocks'" -msgstr "" - -#: ../../faq/programming.rst:1995 -msgid "How do I cache method calls?" -msgstr "メソッド呼び出しをキャッシュするには どうしたらいいですか?" - -#: ../../faq/programming.rst:1997 -msgid "" -"The two principal tools for caching methods are :func:`functools." -"cached_property` and :func:`functools.lru_cache`. The former stores results " -"at the instance level and the latter at the class level." -msgstr "" -"メソッドキャッシュの主な道具は2つあり、 :func:`functools.cached_property` " -"と :func:`functools.lru_cache` です。前者はインスタンスレベル、後者はクラスレ" -"ベルで結果を保存します。" -#: ../../faq/programming.rst:2002 -msgid "" -"The *cached_property* approach only works with methods that do not take any " -"arguments. It does not create a reference to the instance. The cached " -"method result will be kept only as long as the instance is alive." -msgstr "" -"*cached_property* アプローチは、引数を取らないメソッドでのみ働きます。これは" -"インスタンスへの参照を作りません。キャッシュされたメソッドの結果は、インスタ" -"ンスが生きている間だけ保持されます。" - -#: ../../faq/programming.rst:2006 -msgid "" -"The advantage is that when an instance is no longer used, the cached method " -"result will be released right away. The disadvantage is that if instances " -"accumulate, so too will the accumulated method results. They can grow " -"without bound." -msgstr "" -"利点は、インスタンスが使われなくなった場合、キャッシュされたメソッドの結果が" -"すぐに解放されることです。欠点は、インスタンスが溜まると、溜められたメソッド" -"の結果も増えてしまうことです。それらは際限なく増える恐れがあります。" - -#: ../../faq/programming.rst:2011 -msgid "" -"The *lru_cache* approach works with methods that have :term:`hashable` " -"arguments. It creates a reference to the instance unless special efforts " -"are made to pass in weak references." -msgstr "" -"*lru_cache* アプローチは、 :term:`hashable` な引数を持つメソッドで働きます。 " -"weak references を渡すための特別な努力がない限り、インスタンスへの参照を作り" -"ます。" - -#: ../../faq/programming.rst:2015 -msgid "" -"The advantage of the least recently used algorithm is that the cache is " -"bounded by the specified *maxsize*. The disadvantage is that instances are " -"kept alive until they age out of the cache or until the cache is cleared." -msgstr "" -"least recently used アルゴリズム(訳注:LRU 直近に使われたものを残す)の利点" -"は、キャッシュが指定された *maxsize* で制限されることです。欠点は、キャッシュ" -"から期限切れで追い出されるかクリアされるまで、インスタンスが生き続けることで" -"す。" - -#: ../../faq/programming.rst:2020 -msgid "This example shows the various techniques::" -msgstr "この例は各種テクニックを示します::" - -#: ../../faq/programming.rst:2022 -msgid "" -"class Weather:\n" -" \"Lookup weather information on a government website\"\n" -"\n" -" def __init__(self, station_id):\n" -" self._station_id = station_id\n" -" # The _station_id is private and immutable\n" -"\n" -" def current_temperature(self):\n" -" \"Latest hourly observation\"\n" -" # Do not cache this because old results\n" -" # can be out of date.\n" -"\n" -" @cached_property\n" -" def location(self):\n" -" \"Return the longitude/latitude coordinates of the station\"\n" -" # Result only depends on the station_id\n" -"\n" -" @lru_cache(maxsize=20)\n" -" def historic_rainfall(self, date, units='mm'):\n" -" \"Rainfall on a given date\"\n" -" # Depends on the station_id, date, and units." -msgstr "" - -#: ../../faq/programming.rst:2044 -msgid "" -"The above example assumes that the *station_id* never changes. If the " -"relevant instance attributes are mutable, the *cached_property* approach " -"can't be made to work because it cannot detect changes to the attributes." -msgstr "" -"上の例では、 *station_id* が常に変わらないことを前提としています。関連するイ" -"ンスタンスの属性が可変である場合、 *cached_property* アプローチは属性の変更を" -"検出できないため、機能しなくなります。" - -#: ../../faq/programming.rst:2049 -msgid "" -"To make the *lru_cache* approach work when the *station_id* is mutable, the " -"class needs to define the :meth:`~object.__eq__` and :meth:`~object." -"__hash__` methods so that the cache can detect relevant attribute updates::" -msgstr "" -"*station_id* が可変の場合に *lru_cache* アプローチを機能させるには、クラス" -"で :meth:`~object.__eq__` と :meth:`~object.__hash__` メソッドを定義する必要" -"があります。これにより、キャッシュは関連する属性の更新を検出できます::" - -#: ../../faq/programming.rst:2053 -msgid "" -"class Weather:\n" -" \"Example with a mutable station identifier\"\n" -"\n" -" def __init__(self, station_id):\n" -" self.station_id = station_id\n" -"\n" -" def change_station(self, station_id):\n" -" self.station_id = station_id\n" -"\n" -" def __eq__(self, other):\n" -" return self.station_id == other.station_id\n" -"\n" -" def __hash__(self):\n" -" return hash(self.station_id)\n" -"\n" -" @lru_cache(maxsize=20)\n" -" def historic_rainfall(self, date, units='cm'):\n" -" 'Rainfall on a given date'\n" -" # Depends on the station_id, date, and units." -msgstr "" - -#: ../../faq/programming.rst:2075 +#: ../../faq/programming.rst:1832 msgid "Modules" msgstr "モジュール" -#: ../../faq/programming.rst:2078 +#: ../../faq/programming.rst:1835 msgid "How do I create a .pyc file?" msgstr ".pyc ファイルを作るにはどうしますか?" -#: ../../faq/programming.rst:2080 +#: ../../faq/programming.rst:1837 msgid "" "When a module is imported for the first time (or when the source file has " "changed since the current compiled file was created) a ``.pyc`` file " @@ -3767,7 +2619,7 @@ msgstr "" "ルを作った ``python`` バイナリに依存した文字列になります。 (詳細は :pep:" "`3147` を参照してください。)" -#: ../../faq/programming.rst:2088 +#: ../../faq/programming.rst:1845 msgid "" "One reason that a ``.pyc`` file may not be created is a permissions problem " "with the directory containing the source file, meaning that the " @@ -3780,7 +2632,7 @@ msgstr "" "ば、ウェブサーバーでテストを行っているときのような、開発者のユーザと実行者の" "ユーザが別な場合に、起こり得ます。" -#: ../../faq/programming.rst:2093 +#: ../../faq/programming.rst:1850 msgid "" "Unless the :envvar:`PYTHONDONTWRITEBYTECODE` environment variable is set, " "creation of a .pyc file is automatic if you're importing a module and Python " @@ -3793,7 +2645,7 @@ msgstr "" "コンパイルされたモジュールが置ける能力 (権限、ディスクの空きスペース、など) " "がある場合は、 .pyc ファイルは自動的に作られます。" -#: ../../faq/programming.rst:2098 +#: ../../faq/programming.rst:1855 msgid "" "Running Python on a top level script is not considered an import and no ``." "pyc`` will be created. For example, if you have a top-level module ``foo." @@ -3809,7 +2661,7 @@ msgstr "" "の ``.pyc`` は作成されますが、``foo.py`` はインポートされたわけではないので " "``foo`` の ``.pyc`` は作られません。" -#: ../../faq/programming.rst:2105 +#: ../../faq/programming.rst:1862 msgid "" "If you need to create a ``.pyc`` file for ``foo`` -- that is, to create a ``." "pyc`` file for a module that is not imported -- you can, using the :mod:" @@ -3819,7 +2671,7 @@ msgstr "" "ジュールの ``.pyc`` ファイルを作成する -- 必要がある場合、 :mod:`py_compile` " "モジュールと :mod:`compileall` モジュールを使えば可能です。" -#: ../../faq/programming.rst:2109 +#: ../../faq/programming.rst:1866 msgid "" "The :mod:`py_compile` module can manually compile any module. One way is to " "use the ``compile()`` function in that module interactively::" @@ -3828,13 +2680,7 @@ msgstr "" "り方の一つは、このモジュールの ``compile()`` 関数をインタラクティブに実行する" "ことです::" -#: ../../faq/programming.rst:2112 -msgid "" -">>> import py_compile\n" -">>> py_compile.compile('foo.py')" -msgstr "" - -#: ../../faq/programming.rst:2115 +#: ../../faq/programming.rst:1872 msgid "" "This will write the ``.pyc`` to a ``__pycache__`` subdirectory in the same " "location as ``foo.py`` (or you can override that with the optional parameter " @@ -3844,7 +2690,7 @@ msgstr "" "リに ``.pyc`` が書き出されます (出力ファイルの位置は、オプション引数 " "``cfile`` で上書きすることもできます)。" -#: ../../faq/programming.rst:2119 +#: ../../faq/programming.rst:1876 msgid "" "You can also automatically compile all files in a directory or directories " "using the :mod:`compileall` module. You can do it from the shell prompt by " @@ -3855,15 +2701,11 @@ msgstr "" "のファイルをコンパイルできます。シェルプロンプトから ``compileall.py`` を起動" "して、コンパイルしたいファイルを含むディレクトリのパスを指定してください::" -#: ../../faq/programming.rst:2124 -msgid "python -m compileall ." -msgstr "" - -#: ../../faq/programming.rst:2128 +#: ../../faq/programming.rst:1885 msgid "How do I find the current module name?" msgstr "現在のモジュール名を知るにはどうしますか?" -#: ../../faq/programming.rst:2130 +#: ../../faq/programming.rst:1887 msgid "" "A module can find out its own module name by looking at the predefined " "global variable ``__name__``. If this has the value ``'__main__'``, the " @@ -3877,89 +2719,62 @@ msgstr "" "モジュールはコマンドラインインターフェースや自己テストも提供していて、" "``__name__`` をチェックしてからそのコードだけを実行します::" -#: ../../faq/programming.rst:2136 -msgid "" -"def main():\n" -" print('Running test...')\n" -" ...\n" -"\n" -"if __name__ == '__main__':\n" -" main()" -msgstr "" - -#: ../../faq/programming.rst:2145 +#: ../../faq/programming.rst:1902 msgid "How can I have modules that mutually import each other?" msgstr "相互にインポートしあうモジュールを作るにはどうしたらいいですか?" -#: ../../faq/programming.rst:2147 +#: ../../faq/programming.rst:1904 msgid "Suppose you have the following modules:" msgstr "以下のモジュールがあったとしましょう:" -#: ../../faq/programming.rst:2149 -msgid ":file:`foo.py`::" -msgstr ":file:`foo.py`::" +#: ../../faq/programming.rst:1906 +msgid "foo.py::" +msgstr "foo.py::" -#: ../../faq/programming.rst:2151 -msgid "" -"from bar import bar_var\n" -"foo_var = 1" -msgstr "" +#: ../../faq/programming.rst:1911 +msgid "bar.py::" +msgstr "bar.py::" -#: ../../faq/programming.rst:2154 -msgid ":file:`bar.py`::" -msgstr ":file:`bar.py`::" - -#: ../../faq/programming.rst:2156 -msgid "" -"from foo import foo_var\n" -"bar_var = 2" -msgstr "" - -#: ../../faq/programming.rst:2159 +#: ../../faq/programming.rst:1916 msgid "The problem is that the interpreter will perform the following steps:" msgstr "問題はインタプリタが以下の段階を実行することです:" -#: ../../faq/programming.rst:2161 -msgid "main imports ``foo``" -msgstr "main が ``foo`` をインポートする" +#: ../../faq/programming.rst:1918 +msgid "main imports foo" +msgstr "main が foo をインポートする" -#: ../../faq/programming.rst:2162 -msgid "Empty globals for ``foo`` are created" -msgstr "``foo`` の空のグローバルが生成される" +#: ../../faq/programming.rst:1919 +msgid "Empty globals for foo are created" +msgstr "foo の空のグローバルが生成される" -#: ../../faq/programming.rst:2163 -msgid "``foo`` is compiled and starts executing" -msgstr "``foo`` がコンパイルされ実行を始める" +#: ../../faq/programming.rst:1920 +msgid "foo is compiled and starts executing" +msgstr "foo がコンパイルされ実行を始める" -#: ../../faq/programming.rst:2164 -msgid "``foo`` imports ``bar``" -msgstr "``foo`` が ``bar`` をインポートする" +#: ../../faq/programming.rst:1921 +msgid "foo imports bar" +msgstr "foo が bar をインポートする" -#: ../../faq/programming.rst:2165 -msgid "Empty globals for ``bar`` are created" -msgstr "``bar`` の空のグローバルが生成される" +#: ../../faq/programming.rst:1922 +msgid "Empty globals for bar are created" +msgstr "bar の空のグローバルが生成される" -#: ../../faq/programming.rst:2166 -msgid "``bar`` is compiled and starts executing" -msgstr "``bar`` がコンパイルされ実行を始める" +#: ../../faq/programming.rst:1923 +msgid "bar is compiled and starts executing" +msgstr "bar がコンパイルされ実行を始める" -#: ../../faq/programming.rst:2167 +#: ../../faq/programming.rst:1924 msgid "" -"``bar`` imports ``foo`` (which is a no-op since there already is a module " -"named ``foo``)" +"bar imports foo (which is a no-op since there already is a module named foo)" msgstr "" -"``bar`` が ``foo`` をインポートする(すでに ``foo`` という名前のモジュールがあ" -"るので no-op となる)" +"bar が foo をインポートする(すでに foo という名前のモジュールがあるので no-" +"op となる)" -#: ../../faq/programming.rst:2168 -msgid "" -"The import mechanism tries to read ``foo_var`` from ``foo`` globals, to set " -"``bar.foo_var = foo.foo_var``" -msgstr "" -"インポートメカニズムは ``foo`` のグローバルから ``foo_var`` を読んで、 ``bar." -"foo_var = foo.foo_var`` に設定しようとします。" +#: ../../faq/programming.rst:1925 +msgid "bar.foo_var = foo.foo_var" +msgstr "bar.foo_var = foo.foo_var" -#: ../../faq/programming.rst:2170 +#: ../../faq/programming.rst:1927 msgid "" "The last step fails, because Python isn't done with interpreting ``foo`` yet " "and the global symbol dictionary for ``foo`` is still empty." @@ -3967,7 +2782,7 @@ msgstr "" "この最後の段階は失敗します。Python が ``foo`` を解釈し終わっていなくて、" "``foo`` のグローバルなシンボルの辞書はまだ空ですから。" -#: ../../faq/programming.rst:2173 +#: ../../faq/programming.rst:1930 msgid "" "The same thing happens when you use ``import foo``, and then try to access " "``foo.foo_var`` in global code." @@ -3975,11 +2790,11 @@ msgstr "" "``import foo`` を使って、グローバルコードの ``foo.foo_var`` にアクセスしよう" "としたときにも、これと同じことが起こります。" -#: ../../faq/programming.rst:2176 +#: ../../faq/programming.rst:1933 msgid "There are (at least) three possible workarounds for this problem." msgstr "この問題には (少なくとも) 三つの解決策があります。" -#: ../../faq/programming.rst:2178 +#: ../../faq/programming.rst:1935 msgid "" "Guido van Rossum recommends avoiding all uses of ``from import ..." "``, and placing all code inside functions. Initializations of global " @@ -3992,14 +2807,14 @@ msgstr "" "化は定数とビルトイン関数のみで行われるべきです。これでインポートされたすべて" "のモジュールは ``.`` として参照されることになります。" -#: ../../faq/programming.rst:2183 +#: ../../faq/programming.rst:1940 msgid "" "Jim Roskind suggests performing steps in the following order in each module:" msgstr "" "Jim Roskind はそれぞれのモジュールに対して以下の順に進めることを提案していま" "す:" -#: ../../faq/programming.rst:2185 +#: ../../faq/programming.rst:1942 msgid "" "exports (globals, functions, and classes that don't need imported base " "classes)" @@ -4007,25 +2822,25 @@ msgstr "" "エクスポート (インポートされた基底クラスを必要としないグローバル、関数、クラ" "ス)" -#: ../../faq/programming.rst:2187 +#: ../../faq/programming.rst:1944 msgid "``import`` statements" msgstr "``import`` 文" -#: ../../faq/programming.rst:2188 +#: ../../faq/programming.rst:1945 msgid "" "active code (including globals that are initialized from imported values)." msgstr "" "アクティブなコード (インポートされた値によって初期化されるグローバルを含む)。" -#: ../../faq/programming.rst:2190 +#: ../../faq/programming.rst:1947 msgid "" -"Van Rossum doesn't like this approach much because the imports appear in a " +"van Rossum doesn't like this approach much because the imports appear in a " "strange place, but it does work." msgstr "" -"インポートが奇妙な場所に現れることから Van Rossum はこの方法をそれほど好みま" +"インポートが奇妙な場所に現れることから van Rossum はこの方法をそれほど好みま" "せんが、これは有効です。" -#: ../../faq/programming.rst:2193 +#: ../../faq/programming.rst:1950 msgid "" "Matthias Urlichs recommends restructuring your code so that the recursive " "import is not necessary in the first place." @@ -4033,17 +2848,17 @@ msgstr "" "Matthias Urlichs は第一に再帰インポートが必要ないようにコードを構築しなおすこ" "とを推奨しています。" -#: ../../faq/programming.rst:2196 +#: ../../faq/programming.rst:1953 msgid "These solutions are not mutually exclusive." msgstr "これらの解決策はそれぞれ両立させることもできます。" -#: ../../faq/programming.rst:2200 +#: ../../faq/programming.rst:1957 msgid "__import__('x.y.z') returns ; how do I get z?" msgstr "" "__import__('x.y.z') は を返しますが、z を得るためにはどうします" "か?" -#: ../../faq/programming.rst:2202 +#: ../../faq/programming.rst:1959 msgid "" "Consider using the convenience function :func:`~importlib.import_module` " "from :mod:`importlib` instead::" @@ -4051,11 +2866,7 @@ msgstr "" ":mod:`importlib` に :func:`~importlib.import_module` という便利な関数があるの" "で、代わりにそちらを使用することを検討してください。" -#: ../../faq/programming.rst:2205 -msgid "z = importlib.import_module('x.y.z')" -msgstr "" - -#: ../../faq/programming.rst:2209 +#: ../../faq/programming.rst:1966 msgid "" "When I edit an imported module and reimport it, the changes don't show up. " "Why does this happen?" @@ -4063,7 +2874,7 @@ msgstr "" "インポートされたモジュールを編集してから再インポートしましたが、変化が現れま" "せん。なぜですか?" -#: ../../faq/programming.rst:2211 +#: ../../faq/programming.rst:1968 msgid "" "For reasons of efficiency as well as consistency, Python only reads the " "module file on the first time a module is imported. If it didn't, in a " @@ -4077,24 +2888,13 @@ msgstr "" "その基本モジュールの解析と再解析が繰り返されることになります。変更されさたモ" "ジュールの再読込を強制するには、こうしてください::" -#: ../../faq/programming.rst:2217 -msgid "" -"import importlib\n" -"import modname\n" -"importlib.reload(modname)" -msgstr "" - -#: ../../faq/programming.rst:2221 +#: ../../faq/programming.rst:1978 msgid "" "Warning: this technique is not 100% fool-proof. In particular, modules " "containing statements like ::" msgstr "注意:この手法は 100%安全とは言えません。とりわけ ::" -#: ../../faq/programming.rst:2224 -msgid "from modname import some_objects" -msgstr "" - -#: ../../faq/programming.rst:2226 +#: ../../faq/programming.rst:1983 msgid "" "will continue to work with the old version of the imported objects. If the " "module contains class definitions, existing class instances will *not* be " @@ -4106,45 +2906,10 @@ msgstr "" "スタンスは新しいクラス定義を使うようにアップデート *されません*。これによって" "以下の矛盾した振舞いがなされえます::" -#: ../../faq/programming.rst:2231 -msgid "" -">>> import importlib\n" -">>> import cls\n" -">>> c = cls.C() # Create an instance of C\n" -">>> importlib.reload(cls)\n" -"\n" -">>> isinstance(c, cls.C) # isinstance is false?!?\n" -"False" -msgstr "" - -#: ../../faq/programming.rst:2239 +#: ../../faq/programming.rst:1996 msgid "" "The nature of the problem is made clear if you print out the \"identity\" of " "the class objects::" msgstr "" "この問題の本質は、クラスオブジェクトの \"固有値\" を印字することで明らかにな" "ります::" - -#: ../../faq/programming.rst:2242 -msgid "" -">>> hex(id(c.__class__))\n" -"'0x7352a0'\n" -">>> hex(id(cls.C))\n" -"'0x4198d0'" -msgstr "" - -#: ../../faq/programming.rst:408 -msgid "argument" -msgstr "引数 (argument)" - -#: ../../faq/programming.rst:408 -msgid "difference from parameter" -msgstr "difference from parameter" - -#: ../../faq/programming.rst:408 -msgid "parameter" -msgstr "parameter" - -#: ../../faq/programming.rst:408 -msgid "difference from argument" -msgstr "difference from argument" diff --git a/faq/windows.po b/faq/windows.po index aa26bf46d..ef1bc236e 100644 --- a/faq/windows.po +++ b/faq/windows.po @@ -1,28 +1,29 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: +# 秘湯 , 2017 +# Osamu NAKAMURA, 2017 +# Arihiro TAKASE, 2018 # Mikami Akiko, 2021 # tomo, 2021 -# 菊池 健志, 2023 -# TENMYO Masakazu, 2023 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-13 14:21+0000\n" -"PO-Revision-Date: 2021-06-28 00:52+0000\n" -"Last-Translator: TENMYO Masakazu, 2023\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-05-23 06:25+0000\n" +"PO-Revision-Date: 2017-02-16 17:43+0000\n" +"Last-Translator: tomo, 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../faq/windows.rst:9 @@ -50,23 +51,19 @@ msgstr "" #: ../../faq/windows.rst:28 msgid "" "Unless you use some sort of integrated development environment, you will end " -"up *typing* Windows commands into what is referred to as a \"Command prompt " -"window\". Usually you can create such a window from your search bar by " -"searching for ``cmd``. You should be able to recognize when you have " -"started such a window because you will see a Windows \"command prompt\", " -"which usually looks like this:" -msgstr "" -"ある種の統合開発環境を使っているのでなければ、最終的には \"コマンドプロンプト" -"\" などと呼ばれているものに、 Windows コマンドをタイプすることになるでしょ" -"う。\n" +"up *typing* Windows commands into what is variously referred to as a \"DOS " +"window\" or \"Command prompt window\". Usually you can create such a window " +"from your search bar by searching for ``cmd``. You should be able to " +"recognize when you have started such a window because you will see a Windows " +"\"command prompt\", which usually looks like this:" +msgstr "" +"ある種の統合開発環境を使っているのでなければ、最終的には \"DOS ウィンドウ\" " +"や \"コマンドプロンプト\" などと色々に呼ばれているものに、 Windows コマンドを" +"タイプすることになるでしょう。\n" "通常そういうウィンドウは検索バーで ``cmd`` を検索して起動します。\n" "通常は次のような見た目の Windows の \"コマンド プロンプト\" が現れるので、" "ウィンドウが起動したのが分かるはずです::" -#: ../../faq/windows.rst:35 -msgid "C:\\>" -msgstr "" - #: ../../faq/windows.rst:39 msgid "" "The letter may be different, and there might be other things after it, so " @@ -75,10 +72,6 @@ msgstr "" "この文字は異なっていたり、続きがあったりするので、コンピュータの設定や、あな" "たが最近何をしたかに依って、このようになっていることもあるでしょう:" -#: ../../faq/windows.rst:42 -msgid "D:\\YourName\\Projects\\Python>" -msgstr "" - #: ../../faq/windows.rst:46 msgid "" "depending on how your computer has been set up and what else you have " @@ -113,23 +106,10 @@ msgstr "" "コマンドウィンドウを開いたら、 ``py`` というコマンドを入力し、リターンキーを" "叩いてください。:" -#: ../../faq/windows.rst:60 -msgid "C:\\Users\\YourName> py" -msgstr "" - #: ../../faq/windows.rst:64 msgid "You should then see something like:" msgstr "次のような出力が見えるでしょう:" -#: ../../faq/windows.rst:66 -msgid "" -"Python 3.6.4 (v3.6.4:d48eceb, Dec 19 2017, 06:04:45) [MSC v.1900 32 bit " -"(Intel)] on win32\n" -"Type \"help\", \"copyright\", \"credits\" or \"license\" for more " -"information.\n" -">>>" -msgstr "" - #: ../../faq/windows.rst:72 msgid "" "You have started the interpreter in \"interactive mode\". That means you can " @@ -141,14 +121,6 @@ msgstr "" "入力して、待っている間に実行や評価させることができます。これが Python の最強" "の機能のひとつです。いくつかの式を選んで入力し、結果を見て確かめてみましょう:" -#: ../../faq/windows.rst:77 -msgid "" -">>> print(\"Hello\")\n" -"Hello\n" -">>> \"Hello\" * 3\n" -"'HelloHelloHello'" -msgstr "" - #: ../../faq/windows.rst:84 msgid "" "Many people use the interactive mode as a convenient yet highly programmable " @@ -194,10 +166,6 @@ msgstr "" "いことにコマンドプロンプトがホームディレクトリを開いていると仮定しましょう。" "そうすると次のような表示が見られます::" -#: ../../faq/windows.rst:104 -msgid "C:\\Users\\YourName>" -msgstr "" - #: ../../faq/windows.rst:106 msgid "" "So now you'll ask the ``py`` command to give your script to Python by typing " @@ -206,12 +174,6 @@ msgstr "" "ここまで来れば ``py`` の後ろにスクリプトのパスを入力することで、 Python にス" "クリプトを渡すよう ``py`` コマンドに命令できます::" -#: ../../faq/windows.rst:110 -msgid "" -"C:\\Users\\YourName> py Desktop\\hello.py\n" -"hello" -msgstr "" - #: ../../faq/windows.rst:114 msgid "How do I make Python scripts executable?" msgstr "Python スクリプトを実行可能にするにはどうしますか?" @@ -326,18 +288,18 @@ msgstr "" #: ../../faq/windows.rst:170 msgid "" -"Do **not** build Python into your .exe file directly. On Windows, Python " -"must be a DLL to handle importing modules that are themselves DLL's. (This " -"is the first key undocumented fact.) Instead, link to :file:`python{NN}." -"dll`; it is typically installed in ``C:\\Windows\\System``. *NN* is the " -"Python version, a number such as \"33\" for Python 3.3." +"Do _not_ build Python into your .exe file directly. On Windows, Python must " +"be a DLL to handle importing modules that are themselves DLL's. (This is " +"the first key undocumented fact.) Instead, link to :file:`python{NN}.dll`; " +"it is typically installed in ``C:\\Windows\\System``. *NN* is the Python " +"version, a number such as \"33\" for Python 3.3." msgstr "" -"あなたの .exe 内に直接 Python を取り込んでビルド **しないで** 下さい。" -"Windows では、それ自身が DLL になっているようなモジュールのインポートを処理す" -"るために、Python は DLL でなければなりません。(ドキュメント化されていない重大" -"な事実の一つ目です。)代わりに、 :file:`python{NN}.dll` とリンクしてください; " -"普通はそれは ``C:\\Windows\\System`` にインストールされています。 *NN* は " -"Python バージョンで Python 3.3 であれば \"33\" のような数字です。" +"あなたの .exe 内に直接 Python を取り込んでビルド *しないで* 下さい。Windows " +"では、それ自身が DLL になっているようなモジュールのインポートを処理するため" +"に、Python は DLL でなければなりません。(ドキュメント化されていない重大な事実" +"の一つ目です。)代わりに、 :file:`python{NN}.dll` とリンクしてください; 普通は" +"それは ``C:\\Windows\\System`` にインストールされています。 *NN* は Python " +"バージョンで Python 3.3 であれば \"33\" のような数字です。" #: ../../faq/windows.rst:176 msgid "" @@ -371,20 +333,28 @@ msgstr "" "ん。マクロによって、このポインタを Python の C API のルーチンを呼び出す任意" "の C コードに通して使えます。" -#: ../../faq/windows.rst:191 +#: ../../faq/windows.rst:189 +msgid "" +"Borland note: convert :file:`python{NN}.lib` to OMF format using Coff2Omf." +"exe first." +msgstr "" +"Borland note: まず :file:`python{NN}.lib` を Coff2Omf.exe で OMF フォーマット" +"に変換してください。" + +#: ../../faq/windows.rst:194 msgid "" "If you use SWIG, it is easy to create a Python \"extension module\" that " "will make the app's data and methods available to Python. SWIG will handle " "just about all the grungy details for you. The result is C code that you " -"link *into* your .exe file (!) You do **not** have to create a DLL file, " -"and this also simplifies linking." +"link *into* your .exe file (!) You do _not_ have to create a DLL file, and " +"this also simplifies linking." msgstr "" "SWIG を使えば、app のデータとメソッドを Python で使えるようにする Python \"拡" "張モジュール\"を簡単に作れます。SWIG は雑用を殆どやってくれるでしょう。結果と" -"して、.exe ファイル *の中に* リンクする C コードができます(!)。DLL を作 **ら" -"なくてもよく**、リンクも簡潔になります。" +"して、.exe ファイル *の中に* リンクする C コードができます(!)。DLL を作 _ら" +"なくてもよく_、リンクも簡潔になります。" -#: ../../faq/windows.rst:197 +#: ../../faq/windows.rst:200 msgid "" "SWIG will create an init function (a C function) whose name depends on the " "name of the extension module. For example, if the name of the module is " @@ -397,7 +367,7 @@ msgstr "" "スを使ったほうがよく、そうすると init 関数の名前は initleoc() になります。こ" "れは shadow クラスが使うほとんど隠れた helper クラスを初期化します。" -#: ../../faq/windows.rst:203 +#: ../../faq/windows.rst:206 msgid "" "The reason you can link the C code in step 2 into your .exe file is that " "calling the initialization function is equivalent to importing the module " @@ -407,7 +377,7 @@ msgstr "" "しと Python へのモジュールのインポートが同等だからです! (ドキュメント化され" "ていない重大な事実の二つ目です)" -#: ../../faq/windows.rst:207 +#: ../../faq/windows.rst:210 msgid "" "In short, you can use the following code to initialize the Python " "interpreter with your extension module." @@ -415,16 +385,7 @@ msgstr "" "要するに、以下のコードを使って Python インタプリタを拡張モジュール込みで初期" "化することができます。" -#: ../../faq/windows.rst:210 -msgid "" -"#include \n" -"...\n" -"Py_Initialize(); // Initialize Python.\n" -"initmyAppc(); // Initialize (import) the helper class.\n" -"PyRun_SimpleString(\"import myApp\"); // Import the shadow class." -msgstr "" - -#: ../../faq/windows.rst:218 +#: ../../faq/windows.rst:221 msgid "" "There are two problems with Python's C API which will become apparent if you " "use a compiler other than MSVC, the compiler used to build pythonNN.dll." @@ -432,32 +393,25 @@ msgstr "" "Python の C API には、pythonNN.dll をビルドするのに使われたコンパイラ MSVC 以" "外のコンパイラを使うと現れる二つの問題があります。" -#: ../../faq/windows.rst:221 +#: ../../faq/windows.rst:224 msgid "" -"Problem 1: The so-called \"Very High Level\" functions that take ``FILE *`` " +"Problem 1: The so-called \"Very High Level\" functions that take FILE * " "arguments will not work in a multi-compiler environment because each " -"compiler's notion of a ``struct FILE`` will be different. From an " -"implementation standpoint these are very low level functions." +"compiler's notion of a struct FILE will be different. From an " +"implementation standpoint these are very _low_ level functions." msgstr "" -"問題 1: コンパイラによって ``struct FILE`` に対する概念が異なるため、``FILE " -"*`` 引数を取るいわゆる \"超高水準\" 関数は、多コンパイラ環境で働きません。実" -"装の観点から、これらは超低水準関数になっています。" +"問題 1: コンパイラによって struct FILE に対する概念が異なるため、FILE * 引数" +"を取るいわゆる \"超高水準\" 関数は、多コンパイラ環境で働きません。実装の観点" +"から、これらは超 _低_ 水準関数になっています。" -#: ../../faq/windows.rst:226 +#: ../../faq/windows.rst:229 msgid "" "Problem 2: SWIG generates the following code when generating wrappers to " "void functions:" msgstr "" "問題 2: SWIG は void 関数へのラッパを生成するときに以下のコードを生成します:" -#: ../../faq/windows.rst:229 -msgid "" -"Py_INCREF(Py_None);\n" -"_resultobj = Py_None;\n" -"return _resultobj;" -msgstr "" - -#: ../../faq/windows.rst:235 +#: ../../faq/windows.rst:238 msgid "" "Alas, Py_None is a macro that expands to a reference to a complex data " "structure called _Py_NoneStruct inside pythonNN.dll. Again, this code will " @@ -467,11 +421,7 @@ msgstr "" "開するマクロです。また、このコードは他コンパイラ環境では失敗します。このコー" "ドを次のように置き換えてください:" -#: ../../faq/windows.rst:239 -msgid "return Py_BuildValue(\"\");" -msgstr "" - -#: ../../faq/windows.rst:243 +#: ../../faq/windows.rst:246 msgid "" "It may be possible to use SWIG's ``%typemap`` command to make the change " "automatically, though I have not been able to get this to work (I'm a " @@ -480,7 +430,7 @@ msgstr "" "これで、SWIG をまだ仕事に使えない (私は SWIG の完全な初心者です) 私でも、" "SWIG の ``%typemap`` コマンドを使って自動的に変更できるようになります。" -#: ../../faq/windows.rst:247 +#: ../../faq/windows.rst:250 msgid "" "Using a Python shell script to put up a Python interpreter window from " "inside your Windows app is not a good idea; the resulting window will be " @@ -500,12 +450,12 @@ msgstr "" "ソッドを含む (拡張モジュールで定義された) Python オブジェクトさえあればいいの" "です。" -#: ../../faq/windows.rst:256 +#: ../../faq/windows.rst:259 msgid "How do I keep editors from inserting tabs into my Python source?" msgstr "" "エディタが Python ソースにタブを勝手に挿入しないようにするにはどうしますか?" -#: ../../faq/windows.rst:258 +#: ../../faq/windows.rst:261 msgid "" "The FAQ does not recommend using tabs, and the Python style guide, :pep:`8`, " "recommends 4 spaces for distributed Python code; this is also the Emacs " @@ -515,7 +465,7 @@ msgstr "" "は、配布される Python コードにはスペース 4 つを使うことを推奨しています。これ" "は Emacs の python-mode のデフォルトでも同じです。" -#: ../../faq/windows.rst:262 +#: ../../faq/windows.rst:265 msgid "" "Under any editor, mixing tabs and spaces is a bad idea. MSVC is no " "different in this respect, and is easily configured to use spaces: Take :" @@ -529,7 +479,7 @@ msgstr "" "\"タブ幅\" と \"インデント幅\" に 4 を設定して、 \"スペースを挿入する\" のラ" "ジオボタンを選択してください。" -#: ../../faq/windows.rst:267 +#: ../../faq/windows.rst:270 msgid "" "Python raises :exc:`IndentationError` or :exc:`TabError` if mixed tabs and " "spaces are causing problems in leading whitespace. You may also run the :mod:" @@ -540,11 +490,11 @@ msgstr "" ":mod:`tabnanny` モジュールを実行することで、ディレクトリーツリーをバッチモー" "ドでチェックすることができます。" -#: ../../faq/windows.rst:274 +#: ../../faq/windows.rst:277 msgid "How do I check for a keypress without blocking?" msgstr "ブロックすることなく押鍵を検出するにはどうしますか?" -#: ../../faq/windows.rst:276 +#: ../../faq/windows.rst:279 msgid "" "Use the :mod:`msvcrt` module. This is a standard Windows-specific extension " "module. It defines a function ``kbhit()`` which checks whether a keyboard " @@ -553,23 +503,3 @@ msgstr "" ":mod:`msvcrt` モジュールを使ってください。これは標準の Windows 専用拡張モ" "ジュールです。これはキーボードが打たれているかを調べる関数 ``kbhit()`` と、反" "響することなく一文字を得る ``getch()`` を定義します。" - -#: ../../faq/windows.rst:281 -msgid "How do I solve the missing api-ms-win-crt-runtime-l1-1-0.dll error?" -msgstr "" -"missing api-ms-win-crt-runtime-l1-1-0.dll エラーを解決するにはどうしますか?" - -#: ../../faq/windows.rst:283 -msgid "" -"This can occur on Python 3.5 and later when using Windows 8.1 or earlier " -"without all updates having been installed. First ensure your operating " -"system is supported and is up to date, and if that does not resolve the " -"issue, visit the `Microsoft support page `_ for guidance on manually installing the C Runtime update." -msgstr "" -"この問題は更新がインストールされていない Windows 8.1 以前を使っていると " -"Python 3.5 以降で発生することがあります。まずはあなたのオペレーティングシステ" -"ムがサポートされており最新であることを確認してください。それでも解決しない場" -"合は、 C ランタイムアップデートの手動インストール方法について `Microsoft " -"support page `_ を参照して" -"ください。" diff --git a/glossary.po b/glossary.po index f06d9dfa1..0c786d7f1 100644 --- a/glossary.po +++ b/glossary.po @@ -1,32 +1,31 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. -# +# # Translators: -# Osamu NAKAMURA, 2021 -# Yusuke Miyazaki , 2021 +# 秘湯 , 2017 +# Nozomu Kaneko , 2017 +# Masato HASHIMOTO , 2017 +# Arihiro TAKASE, 2017 +# Inada Naoki , 2017 +# E. Kawashima, 2017 +# Shun Sakurai, 2017 +# tomo, 2020 +# Yusuke Miyazaki , 2020 +# Shin Saito, 2021 # mollinaca, 2021 -# 菊池 健志, 2023 -# TENMYO Masakazu, 2024 -# Taichi Haradaguchi, 2024 -# 石井明久, 2024 -# Arihiro TAKASE, 2024 -# tomo, 2024 -# Hano, 2024 -# Nozomu Kaneko , 2025 -# Inada Naoki , 2025 -# +# Osamu NAKAMURA, 2021 +# #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-13 14:21+0000\n" -"PO-Revision-Date: 2021-06-28 00:47+0000\n" -"Last-Translator: Inada Naoki , 2025\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" -"ja/)\n" +"POT-Creation-Date: 2021-07-26 07:02+0000\n" +"PO-Revision-Date: 2017-02-16 17:32+0000\n" +"Last-Translator: Osamu NAKAMURA, 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/ja/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -43,193 +42,182 @@ msgstr "``>>>``" #: ../../glossary.rst:12 msgid "" -"The default Python prompt of the :term:`interactive` shell. Often seen for " -"code examples which can be executed interactively in the interpreter." +"The default Python prompt of the interactive shell. Often seen for code " +"examples which can be executed interactively in the interpreter." msgstr "" -":term:`対話型 ` シェルにおけるデフォルトの Python プロンプトで" -"す。インタープリターで対話的に実行されるコード例でよく見られます。" +"インタラクティブシェルにおけるデフォルトの Python プロンプトです。インタプリタでインタラクティブに実行されるコード例でよく出てきます。" -#: ../../glossary.rst:15 +#: ../../glossary.rst:14 msgid "``...``" msgstr "``...``" -#: ../../glossary.rst:17 +#: ../../glossary.rst:16 msgid "Can refer to:" msgstr "次のものが考えられます:" -#: ../../glossary.rst:19 +#: ../../glossary.rst:18 msgid "" -"The default Python prompt of the :term:`interactive` shell when entering the " -"code for an indented code block, when within a pair of matching left and " -"right delimiters (parentheses, square brackets, curly braces or triple " -"quotes), or after specifying a decorator." +"The default Python prompt of the interactive shell when entering the code " +"for an indented code block, when within a pair of matching left and right " +"delimiters (parentheses, square brackets, curly braces or triple quotes), or" +" after specifying a decorator." msgstr "" -"対話型 (:term:`interactive`) シェルにおいて、インデントされたコードブロック、" -"対応する左右の区切り文字の組 (丸括弧、角括弧、波括弧、三重引用符) の内側、デ" -"コレーターの後に、コードを入力する際に表示されるデフォルトの Python プロンプ" -"トです。" +"インタラクティブシェルにおいて、インデントされたコードブロック、対応する左右の区切り文字の組 (丸括弧、角括弧、波括弧、三重引用符) " +"の内側、デコレーターの後に、コードを入力する際に表示されるデフォルトの Python プロンプトです。" -#: ../../glossary.rst:24 +#: ../../glossary.rst:23 msgid "The :const:`Ellipsis` built-in constant." msgstr "組み込みの定数 :const:`Ellipsis` 。" -#: ../../glossary.rst:25 +#: ../../glossary.rst:24 +msgid "2to3" +msgstr "2to3" + +#: ../../glossary.rst:26 +msgid "" +"A tool that tries to convert Python 2.x code to Python 3.x code by handling " +"most of the incompatibilities which can be detected by parsing the source " +"and traversing the parse tree." +msgstr "" +"Python 2.x のコードを Python 3.x のコードに変換するツールです。ソースコードを解析してその解析木を巡回 (traverse) " +"することで検知できる、非互換性の大部分を処理します。" + +#: ../../glossary.rst:30 +msgid "" +"2to3 is available in the standard library as :mod:`lib2to3`; a standalone " +"entry point is provided as :file:`Tools/scripts/2to3`. See " +":ref:`2to3-reference`." +msgstr "" +"2to3 は標準ライブラリの :mod:`lib2to3` として利用できます。単体のツールとして使えるスクリプトが " +":file:`Tools/scripts/2to3` として提供されています。 :ref:`2to3-reference` を参照してください。" + +#: ../../glossary.rst:33 msgid "abstract base class" msgstr "abstract base class" -#: ../../glossary.rst:27 +#: ../../glossary.rst:35 msgid "" "Abstract base classes complement :term:`duck-typing` by providing a way to " -"define interfaces when other techniques like :func:`hasattr` would be clumsy " -"or subtly wrong (for example with :ref:`magic methods `). " -"ABCs introduce virtual subclasses, which are classes that don't inherit from " -"a class but are still recognized by :func:`isinstance` and :func:" -"`issubclass`; see the :mod:`abc` module documentation. Python comes with " -"many built-in ABCs for data structures (in the :mod:`collections.abc` " +"define interfaces when other techniques like :func:`hasattr` would be clumsy" +" or subtly wrong (for example with :ref:`magic methods `). " +"ABCs introduce virtual subclasses, which are classes that don't inherit from" +" a class but are still recognized by :func:`isinstance` and " +":func:`issubclass`; see the :mod:`abc` module documentation. Python comes " +"with many built-in ABCs for data structures (in the :mod:`collections.abc` " "module), numbers (in the :mod:`numbers` module), streams (in the :mod:`io` " "module), import finders and loaders (in the :mod:`importlib.abc` module). " "You can create your own ABCs with the :mod:`abc` module." msgstr "" -"(抽象基底クラス) 抽象基底クラスは :term:`duck-typing` を補完するもので、 :" -"func:`hasattr` などの別のテクニックでは不恰好であったり微妙に誤る (例えば :" -"ref:`magic methods ` の場合) 場合にインターフェースを定義する" -"方法を提供します。ABC は仮想 (virtual) サブクラスを導入します。これは親クラス" -"から継承しませんが、それでも :func:`isinstance` や :func:`issubclass` に認識" -"されます; :mod:`abc` モジュールのドキュメントを参照してください。Python に" -"は、多くの組み込み ABC が同梱されています。その対象は、(:mod:`collections." -"abc` モジュールで) データ構造、(:mod:`numbers` モジュールで) 数、(:mod:`io` " -"モジュールで) ストリーム、(:mod:`importlib.abc` モジュールで) インポートファ" -"インダ及びローダーです。 :mod:`abc` モジュールを利用して独自の ABC を作成でき" -"ます。" - -#: ../../glossary.rst:38 -msgid "annotate function" -msgstr "" - -#: ../../glossary.rst:40 -msgid "" -"A function that can be called to retrieve the :term:`annotations " -"` of an object. This function is accessible as the :attr:" -"`~object.__annotate__` attribute of functions, classes, and modules. " -"Annotate functions are a subset of :term:`evaluate functions `." -msgstr "" +"(抽象基底クラス) 抽象基底クラスは :term:`duck-typing` を補完するもので、 :func:`hasattr` " +"などの別のテクニックでは不恰好であったり微妙に誤る (例えば :ref:`magic methods ` の場合) " +"場合にインターフェースを定義する方法を提供します。ABC は仮想 (virtual) サブクラスを導入します。これは親クラスから継承しませんが、それでも" +" :func:`isinstance` や :func:`issubclass` に認識されます; :mod:`abc` " +"モジュールのドキュメントを参照してください。Python には、多くの組み込み ABC " +"が同梱されています。その対象は、(:mod:`collections.abc` モジュールで) データ構造、(:mod:`numbers` " +"モジュールで) 数、(:mod:`io` モジュールで) ストリーム、(:mod:`importlib.abc` モジュールで) " +"インポートファインダ及びローダーです。 :mod:`abc` モジュールを利用して独自の ABC を作成できます。" -#: ../../glossary.rst:44 +#: ../../glossary.rst:46 msgid "annotation" msgstr "annotation" -#: ../../glossary.rst:46 +#: ../../glossary.rst:48 msgid "" "A label associated with a variable, a class attribute or a function " "parameter or return value, used by convention as a :term:`type hint`." msgstr "" -"(アノテーション) 変数、クラス属性、関数のパラメータや返り値に関係するラベルで" -"す。\n" +"(アノテーション) 変数、クラス属性、関数のパラメータや返り値に関係するラベルです。\n" "慣例により :term:`type hint` として使われています。" -#: ../../glossary.rst:50 +#: ../../glossary.rst:52 msgid "" "Annotations of local variables cannot be accessed at runtime, but " -"annotations of global variables, class attributes, and functions can be " -"retrieved by calling :func:`annotationlib.get_annotations` on modules, " -"classes, and functions, respectively." +"annotations of global variables, class attributes, and functions are stored " +"in the :attr:`__annotations__` special attribute of modules, classes, and " +"functions, respectively." msgstr "" +"ローカル変数のアノテーションは実行時にはアクセスできませんが、グローバル変数、クラス属性、関数のアノテーションはそれぞれモジュール、クラス、関数の " +":attr:`__annotations__` 特殊属性に保持されています。" -#: ../../glossary.rst:55 +#: ../../glossary.rst:58 msgid "" -"See :term:`variable annotation`, :term:`function annotation`, :pep:`484`, :" -"pep:`526`, and :pep:`649`, which describe this functionality. Also see :ref:" -"`annotations-howto` for best practices on working with annotations." +"See :term:`variable annotation`, :term:`function annotation`, :pep:`484` and" +" :pep:`526`, which describe this functionality." msgstr "" +"機能の説明がある :term:`variable annotation`, :term:`function annotation`, " +":pep:`484`, :pep:`526` を参照してください。" -#: ../../glossary.rst:59 +#: ../../glossary.rst:60 msgid "argument" -msgstr "引数 (argument)" +msgstr "argument" -#: ../../glossary.rst:61 +#: ../../glossary.rst:62 msgid "" "A value passed to a :term:`function` (or :term:`method`) when calling the " "function. There are two kinds of argument:" msgstr "" -"(実引数) 関数を呼び出す際に、 :term:`関数` (または :term:`メソッド " -"`) に渡す値です。実引数には2種類あります:" +"(実引数) 関数を呼び出す際に、 :term:`関数` (または :term:`メソッド `) " +"に渡す値です。実引数には2種類あります:" -#: ../../glossary.rst:64 +#: ../../glossary.rst:65 msgid "" ":dfn:`keyword argument`: an argument preceded by an identifier (e.g. " "``name=``) in a function call or passed as a value in a dictionary preceded " "by ``**``. For example, ``3`` and ``5`` are both keyword arguments in the " "following calls to :func:`complex`::" msgstr "" -":dfn:`キーワード引数`: 関数呼び出しの際に引数の前に識別子がついたもの (例: " -"``name=``) や、 ``**`` に続けた辞書の中の値として渡された引数。例えば、次の :" -"func:`complex` の呼び出しでは、 ``3`` と ``5`` がキーワード引数です::" - -#: ../../glossary.rst:69 -msgid "" -"complex(real=3, imag=5)\n" -"complex(**{'real': 3, 'imag': 5})" -msgstr "" +":dfn:`キーワード引数`: 関数呼び出しの際に引数の前に識別子がついたもの (例: ``name=``) や、 ``**`` " +"に続けた辞書の中の値として渡された引数。例えば、次の :func:`complex` の呼び出しでは、 ``3`` と ``5`` " +"がキーワード引数です::" -#: ../../glossary.rst:72 +#: ../../glossary.rst:73 msgid "" ":dfn:`positional argument`: an argument that is not a keyword argument. " "Positional arguments can appear at the beginning of an argument list and/or " -"be passed as elements of an :term:`iterable` preceded by ``*``. For example, " -"``3`` and ``5`` are both positional arguments in the following calls::" -msgstr "" -":dfn:`位置引数`: キーワード引数以外の引数。位置引数は引数リストの先頭に書くこ" -"とができ、また ``*`` に続けた :term:`iterable` の要素として渡すことができま" -"す。例えば、次の例では ``3`` と ``5`` は両方共位置引数です::" - -#: ../../glossary.rst:78 -msgid "" -"complex(3, 5)\n" -"complex(*(3, 5))" +"be passed as elements of an :term:`iterable` preceded by ``*``. For example," +" ``3`` and ``5`` are both positional arguments in the following calls::" msgstr "" +":dfn:`位置引数`: キーワード引数以外の引数。位置引数は引数リストの先頭に書くことができ、また ``*`` に続けた " +":term:`iterable` の要素として渡すことができます。例えば、次の例では ``3`` と ``5`` は両方共位置引数です::" -#: ../../glossary.rst:81 +#: ../../glossary.rst:82 msgid "" "Arguments are assigned to the named local variables in a function body. See " "the :ref:`calls` section for the rules governing this assignment. " "Syntactically, any expression can be used to represent an argument; the " "evaluated value is assigned to the local variable." msgstr "" -"実引数は関数の実体において名前付きのローカル変数に割り当てられます。割り当て" -"を行う規則については :ref:`calls` を参照してください。シンタックスにおいて実" -"引数を表すためにあらゆる式を使うことが出来ます。評価された値はローカル変数に" -"割り当てられます。" +"実引数は関数の実体において名前付きのローカル変数に割り当てられます。割り当てを行う規則については :ref:`calls` " +"を参照してください。シンタックスにおいて実引数を表すためにあらゆる式を使うことが出来ます。評価された値はローカル変数に割り当てられます。" -#: ../../glossary.rst:86 +#: ../../glossary.rst:87 msgid "" -"See also the :term:`parameter` glossary entry, the FAQ question on :ref:`the " -"difference between arguments and parameters `, " +"See also the :term:`parameter` glossary entry, the FAQ question on :ref:`the" +" difference between arguments and parameters `, " "and :pep:`362`." msgstr "" -":term:`仮引数` 、FAQ の :ref:`実引数と仮引数の違いは何ですか? " -"` 、:pep:`362` を参照してください。" +":term:`仮引数` 、FAQ の :ref:`実引数と仮引数の違いは何ですか? ` 、:pep:`362` を参照してください。" -#: ../../glossary.rst:89 +#: ../../glossary.rst:90 msgid "asynchronous context manager" msgstr "asynchronous context manager" -#: ../../glossary.rst:91 +#: ../../glossary.rst:92 msgid "" "An object which controls the environment seen in an :keyword:`async with` " -"statement by defining :meth:`~object.__aenter__` and :meth:`~object." -"__aexit__` methods. Introduced by :pep:`492`." +"statement by defining :meth:`__aenter__` and :meth:`__aexit__` methods. " +"Introduced by :pep:`492`." msgstr "" "(非同期コンテキストマネージャ)\n" -":meth:`~object.__aenter__` と :meth:`~object.__aexit__` メソッドを定義するこ" -"とで :keyword:`async with` 文内の環境を管理するオブジェクトです。 :pep:" -"`492` で導入されました。" +":meth:`__aenter__` と :meth:`__aexit__` メソッドを定義することで :keyword:`async with` 文内の環境を管理するオブジェクトです。\n" +":pep:`492` で導入されました。" -#: ../../glossary.rst:94 +#: ../../glossary.rst:95 msgid "asynchronous generator" msgstr "asynchronous generator" -#: ../../glossary.rst:96 +#: ../../glossary.rst:97 msgid "" "A function which returns an :term:`asynchronous generator iterator`. It " "looks like a coroutine function defined with :keyword:`async def` except " @@ -238,401 +226,265 @@ msgid "" msgstr "" "(非同期ジェネレータ)\n" ":term:`asynchronous generator iterator` を返す関数です。\n" -":keyword:`async def` で定義されたコルーチン関数に似ていますが、 :keyword:" -"`yield` 式を持つ点で異なります。\n" -":keyword:`yield` 式は :keyword:`async for` ループで使用できる値の並びを生成す" -"るのに使用されます。" +":keyword:`async def` で定義されたコルーチン関数に似ていますが、 :keyword:`yield` 式を持つ点で異なります。\n" +":keyword:`yield` 式は :keyword:`async for` ループで使用できる値の並びを生成するのに使用されます。" -#: ../../glossary.rst:101 +#: ../../glossary.rst:102 msgid "" "Usually refers to an asynchronous generator function, but may refer to an " "*asynchronous generator iterator* in some contexts. In cases where the " "intended meaning isn't clear, using the full terms avoids ambiguity." msgstr "" -"通常は非同期ジェネレータ関数を指しますが、文脈によっては *非同期ジェネレータ" -"イテレータ* を指す場合があります。\n" +"通常は非同期ジェネレータ関数を指しますが、文脈によっては *非同期ジェネレータイテレータ* を指す場合があります。\n" "意図された意味が明らかでない場合、 明瞭化のために完全な単語を使用します。" -#: ../../glossary.rst:105 +#: ../../glossary.rst:106 msgid "" "An asynchronous generator function may contain :keyword:`await` expressions " "as well as :keyword:`async for`, and :keyword:`async with` statements." msgstr "" -"非同期ジェネレータ関数には、 :keyword:`async for` 文や :keyword:`async with` " -"文だけでなく :keyword:`await` 式もあることがあります。" +"非同期ジェネレータ関数には、 :keyword:`async for` 文や :keyword:`async with` 文だけでなく " +":keyword:`await` 式もあることがあります。" -#: ../../glossary.rst:108 +#: ../../glossary.rst:109 msgid "asynchronous generator iterator" msgstr "asynchronous generator iterator" -#: ../../glossary.rst:110 +#: ../../glossary.rst:111 msgid "An object created by a :term:`asynchronous generator` function." msgstr "" "(非同期ジェネレータイテレータ)\n" ":term:`asynchronous generator` 関数で生成されるオブジェクトです。" -#: ../../glossary.rst:112 +#: ../../glossary.rst:113 msgid "" -"This is an :term:`asynchronous iterator` which when called using the :meth:" -"`~object.__anext__` method returns an awaitable object which will execute " -"the body of the asynchronous generator function until the next :keyword:" -"`yield` expression." +"This is an :term:`asynchronous iterator` which when called using the " +":meth:`__anext__` method returns an awaitable object which will execute the " +"body of the asynchronous generator function until the next :keyword:`yield` " +"expression." msgstr "" -"これは :term:`asynchronous iterator` で、 :meth:`~object.__anext__` メソッド" -"を使って呼ばれると awaitable オブジェクトを返します。 この awaitable オブ" -"ジェクトは、次の :keyword:`yield` 式まで非同期ジェネレータ関数の本体を実行し" -"ます。" +"これは、 :meth:`__anext__` メソッドを使って呼び出されたときに awaitable オブジェクトを返す :term:`asynchronous iterator` です。\n" +"この awaitable オブジェクトは、次の :keyword:`yield` 式までの非同期ジェネレータ関数の本体を実行します。" -#: ../../glossary.rst:117 +#: ../../glossary.rst:118 msgid "" "Each :keyword:`yield` temporarily suspends processing, remembering the " -"execution state (including local variables and pending try-statements). " -"When the *asynchronous generator iterator* effectively resumes with another " -"awaitable returned by :meth:`~object.__anext__`, it picks up where it left " -"off. See :pep:`492` and :pep:`525`." +"location execution state (including local variables and pending try-" +"statements). When the *asynchronous generator iterator* effectively resumes" +" with another awaitable returned by :meth:`__anext__`, it picks up where it " +"left off. See :pep:`492` and :pep:`525`." msgstr "" +":keyword:`yield` にくるたびに、その位置での実行状態 (ローカル変数と保留状態の try 文) 処理は一時停止されます。\n" +":meth:`__anext__` で返された他の awaitable によって *非同期ジェネレータイテレータ* が実際に再開されたとき、中断した箇所を取得します。\n" +":pep:`492` および :pep:`525` を参照してください。" -#: ../../glossary.rst:122 +#: ../../glossary.rst:123 msgid "asynchronous iterable" msgstr "asynchronous iterable" -#: ../../glossary.rst:124 +#: ../../glossary.rst:125 msgid "" "An object, that can be used in an :keyword:`async for` statement. Must " -"return an :term:`asynchronous iterator` from its :meth:`~object.__aiter__` " -"method. Introduced by :pep:`492`." +"return an :term:`asynchronous iterator` from its :meth:`__aiter__` method. " +"Introduced by :pep:`492`." msgstr "" "(非同期イテラブル)\n" -":keyword:`async for` 文の中で使用できるオブジェクトです。 自身の :meth:" -"`~object.__aiter__` メソッドから :term:`asynchronous iterator` を返さなければ" -"なりません。 :pep:`492` で導入されました。" +":keyword:`async for` 文の中で使用できるオブジェクトです。\n" +"自身の :meth:`__aiter__` メソッドから :term:`asynchronous iterator` を返さなければなりません。 \n" +":pep:`492` で導入されました。" -#: ../../glossary.rst:127 +#: ../../glossary.rst:128 msgid "asynchronous iterator" msgstr "asynchronous iterator" -#: ../../glossary.rst:129 +#: ../../glossary.rst:130 msgid "" -"An object that implements the :meth:`~object.__aiter__` and :meth:`~object." -"__anext__` methods. :meth:`~object.__anext__` must return an :term:" -"`awaitable` object. :keyword:`async for` resolves the awaitables returned by " -"an asynchronous iterator's :meth:`~object.__anext__` method until it raises " -"a :exc:`StopAsyncIteration` exception. Introduced by :pep:`492`." +"An object that implements the :meth:`__aiter__` and :meth:`__anext__` " +"methods. ``__anext__`` must return an :term:`awaitable` object. " +":keyword:`async for` resolves the awaitables returned by an asynchronous " +"iterator's :meth:`__anext__` method until it raises a " +":exc:`StopAsyncIteration` exception. Introduced by :pep:`492`." msgstr "" "(非同期イテレータ)\n" -":meth:`~object.__aiter__` と :meth:`~object.__anext__` メソッドを実装したオブ" -"ジェクトです。 :meth:`~object.__anext__` は :term:`awaitable` オブジェクトを" -"返さなければなりません。 :keyword:`async for` は :exc:`StopAsyncIteration` " -"例外を送出するまで、非同期イテレータの :meth:`~object.__anext__` メソッドが返" -"す awaitable を解決します。 :pep:`492` で導入されました。" - -#: ../../glossary.rst:134 -msgid "attached thread state" -msgstr "" - -#: ../../glossary.rst:137 -msgid "A :term:`thread state` that is active for the current OS thread." -msgstr "" - -#: ../../glossary.rst:139 -msgid "" -"When a :term:`thread state` is attached, the OS thread has access to the " -"full Python C API and can safely invoke the bytecode interpreter." -msgstr "" - -#: ../../glossary.rst:143 -msgid "" -"Unless a function explicitly notes otherwise, attempting to call the C API " -"without an attached thread state will result in a fatal error or undefined " -"behavior. A thread state can be attached and detached explicitly by the " -"user through the C API, or implicitly by the runtime, including during " -"blocking C calls and by the bytecode interpreter in between calls." -msgstr "" - -#: ../../glossary.rst:150 -msgid "" -"On most builds of Python, having an attached thread state implies that the " -"caller holds the :term:`GIL` for the current interpreter, so only one OS " -"thread can have an attached thread state at a given moment. In :term:`free-" -"threaded ` builds of Python, threads can concurrently hold " -"an attached thread state, allowing for true parallelism of the bytecode " -"interpreter." -msgstr "" +":meth:`__aiter__` と :meth:`__anext__` メソッドを実装したオブジェクトです。\n" +"``__anext__`` は :term:`awaitable` オブジェクトを返さなければなりません。\n" +":keyword:`async for` は :exc:`StopAsyncIteration` 例外を送出するまで、非同期イテレータの :meth:`__anext__` メソッドが返す awaitable を解決します。\n" +":pep:`492` で導入されました。" -#: ../../glossary.rst:156 +#: ../../glossary.rst:135 msgid "attribute" -msgstr "属性" +msgstr "attribute" -#: ../../glossary.rst:158 -msgid "" -"A value associated with an object which is usually referenced by name using " -"dotted expressions. For example, if an object *o* has an attribute *a* it " -"would be referenced as *o.a*." -msgstr "" -"(属性) オブジェクトに関連付けられ、ドット表記式によって名前で通常参照される値" -"です。例えば、オブジェクト *o* が属性 *a* を持っているとき、その属性は *o.a* " -"で参照されます。" - -#: ../../glossary.rst:163 +#: ../../glossary.rst:137 msgid "" -"It is possible to give an object an attribute whose name is not an " -"identifier as defined by :ref:`identifiers`, for example using :func:" -"`setattr`, if the object allows it. Such an attribute will not be accessible " -"using a dotted expression, and would instead need to be retrieved with :func:" -"`getattr`." +"A value associated with an object which is referenced by name using dotted " +"expressions. For example, if an object *o* has an attribute *a* it would be" +" referenced as *o.a*." msgstr "" -"オブジェクトには、 :ref:`identifiers` で定義される識別子ではない名前の属性を" -"与えることができます。たとえば :func:`setattr` を使い、オブジェクトがそれを許" -"可している場合に行えます。このような属性はドット表記式ではアクセスできず、代" -"わりに :func:`getattr` を使って取る必要があります。" +"(属性) オブジェクトに関連付けられ、ドット表記式によって名前で参照される値です。例えば、オブジェクト *o* が属性 *a* " +"を持っているとき、その属性は *o.a* で参照されます。" -#: ../../glossary.rst:168 +#: ../../glossary.rst:140 msgid "awaitable" msgstr "awaitable" -#: ../../glossary.rst:170 +#: ../../glossary.rst:142 msgid "" -"An object that can be used in an :keyword:`await` expression. Can be a :" -"term:`coroutine` or an object with an :meth:`~object.__await__` method. See " -"also :pep:`492`." +"An object that can be used in an :keyword:`await` expression. Can be a " +":term:`coroutine` or an object with an :meth:`__await__` method. See also " +":pep:`492`." msgstr "" -"(待機可能)\n" -":keyword:`await` 式で使用することが出来るオブジェクトです。 :term:" -"`coroutine` か、 :meth:`~object.__await__` メソッドがあるオブジェクトです。 :" -"pep:`492` を参照してください。" +"(待機可能) :keyword:`await` 式で使用することが出来るオブジェクトです。\n" +":term:`coroutine` か、 :meth:`__await__` メソッドがあるオブジェクトです。\n" +":pep:`492` を参照してください。" -#: ../../glossary.rst:173 +#: ../../glossary.rst:145 msgid "BDFL" msgstr "BDFL" -#: ../../glossary.rst:175 +#: ../../glossary.rst:147 msgid "" -"Benevolent Dictator For Life, a.k.a. `Guido van Rossum `_, Python's creator." +"Benevolent Dictator For Life, a.k.a. `Guido van Rossum " +"`_, Python's creator." msgstr "" -"慈悲深き終身独裁者 (Benevolent Dictator For Life) の略です。Python の作者、" -"`Guido van Rossum `_ のことです。" +"慈悲深き終身独裁者 (Benevolent Dictator For Life) の略です。Python の作者、`Guido van Rossum " +"`_ のことです。" -#: ../../glossary.rst:177 +#: ../../glossary.rst:149 msgid "binary file" msgstr "binary file" -#: ../../glossary.rst:179 +#: ../../glossary.rst:151 msgid "" "A :term:`file object` able to read and write :term:`bytes-like objects " "`. Examples of binary files are files opened in binary " -"mode (``'rb'``, ``'wb'`` or ``'rb+'``), :data:`sys.stdin.buffer `, :data:`sys.stdout.buffer `, and instances of :class:`io." -"BytesIO` and :class:`gzip.GzipFile`." +"mode (``'rb'``, ``'wb'`` or ``'rb+'``), :data:`sys.stdin.buffer`, " +":data:`sys.stdout.buffer`, and instances of :class:`io.BytesIO` and " +":class:`gzip.GzipFile`." msgstr "" "(バイナリファイル)\n" -":term:`bytes-like オブジェクト ` の読み込みおよび書き込み" -"ができる :term:`ファイルオブジェクト ` です。\n" -"バイナリファイルの例は、バイナリモード (``'rb'``, ``'wb'`` or ``'rb+'``) で開" -"かれたファイル、:data:`sys.stdin.buffer `、:data:`sys.stdout." -"buffer `、 :class:`io.BytesIO` や :class:`gzip.GzipFile`. のイン" -"スタンスです。" +":term:`bytes-like オブジェクト ` の読み込みおよび書き込みができる :term:`ファイルオブジェクト ` です。\n" +"バイナリファイルの例は、バイナリモード (``'rb'``, ``'wb'`` or ``'rb+'``) で開かれたファイル、 :data:`sys.stdin.buffer` 、 :data:`sys.stdout.buffer` 、 :class:`io.BytesIO` や :class:`gzip.GzipFile`. のインスタンスです。" -#: ../../glossary.rst:186 +#: ../../glossary.rst:158 msgid "" -"See also :term:`text file` for a file object able to read and write :class:" -"`str` objects." +"See also :term:`text file` for a file object able to read and write " +":class:`str` objects." msgstr "" -":class:`str` オブジェクトの読み書きができるファイルオブジェクトについては、 :" -"term:`text file` も参照してください。" +":class:`str` オブジェクトの読み書きができるファイルオブジェクトについては、 :term:`text file` も参照してください。" -#: ../../glossary.rst:188 -msgid "borrowed reference" -msgstr "" +#: ../../glossary.rst:160 +msgid "bytes-like object" +msgstr "bytes-like object" -#: ../../glossary.rst:190 +#: ../../glossary.rst:162 msgid "" -"In Python's C API, a borrowed reference is a reference to an object, where " -"the code using the object does not own the reference. It becomes a dangling " -"pointer if the object is destroyed. For example, a garbage collection can " -"remove the last :term:`strong reference` to the object and so destroy it." +"An object that supports the :ref:`bufferobjects` and can export a " +"C-:term:`contiguous` buffer. This includes all :class:`bytes`, " +":class:`bytearray`, and :class:`array.array` objects, as well as many common" +" :class:`memoryview` objects. Bytes-like objects can be used for various " +"operations that work with binary data; these include compression, saving to " +"a binary file, and sending over a socket." msgstr "" +":ref:`bufferobjects` をサポートしていて、 C 言語の意味で :term:`連続した contiguous` バッファーを提供可能なオブジェクト。\n" +":class:`bytes`, :class:`bytearray`, :class:`array.array` や、多くの一般的な :class:`memoryview` オブジェクトがこれに当たります。\n" +"bytes-like オブジェクトは、データ圧縮、バイナリファイルへの保存、ソケットを経由した送信など、バイナリデータを要求するいろいろな操作に利用することができます。" -#: ../../glossary.rst:196 +#: ../../glossary.rst:169 msgid "" -"Calling :c:func:`Py_INCREF` on the :term:`borrowed reference` is recommended " -"to convert it to a :term:`strong reference` in-place, except when the object " -"cannot be destroyed before the last usage of the borrowed reference. The :c:" -"func:`Py_NewRef` function can be used to create a new :term:`strong " -"reference`." -msgstr "" - -#: ../../glossary.rst:201 -msgid "bytes-like object" -msgstr "bytes-like object" - -#: ../../glossary.rst:203 -msgid "" -"An object that supports the :ref:`bufferobjects` and can export a C-:term:" -"`contiguous` buffer. This includes all :class:`bytes`, :class:`bytearray`, " -"and :class:`array.array` objects, as well as many common :class:`memoryview` " -"objects. Bytes-like objects can be used for various operations that work " -"with binary data; these include compression, saving to a binary file, and " -"sending over a socket." -msgstr "" -":ref:`bufferobjects` をサポートしていて、 C 言語の意味で :term:`連続した " -"` バッファーを提供可能なオブジェクト。\n" -":class:`bytes`, :class:`bytearray`, :class:`array.array` や、多くの一般的な :" -"class:`memoryview` オブジェクトがこれに当たります。\n" -"bytes-like オブジェクトは、データ圧縮、バイナリファイルへの保存、ソケットを経" -"由した送信など、バイナリデータを要求するいろいろな操作に利用することができま" -"す。" - -#: ../../glossary.rst:210 -msgid "" -"Some operations need the binary data to be mutable. The documentation often " -"refers to these as \"read-write bytes-like objects\". Example mutable " -"buffer objects include :class:`bytearray` and a :class:`memoryview` of a :" -"class:`bytearray`. Other operations require the binary data to be stored in " -"immutable objects (\"read-only bytes-like objects\"); examples of these " +"Some operations need the binary data to be mutable. The documentation often" +" refers to these as \"read-write bytes-like objects\". Example mutable " +"buffer objects include :class:`bytearray` and a :class:`memoryview` of a " +":class:`bytearray`. Other operations require the binary data to be stored in" +" immutable objects (\"read-only bytes-like objects\"); examples of these " "include :class:`bytes` and a :class:`memoryview` of a :class:`bytes` object." msgstr "" "幾つかの操作ではバイナリデータを変更する必要があります。\n" -"その操作のドキュメントではよく \"読み書き可能な bytes-like オブジェクト\" に" -"言及しています。\n" -"変更可能なバッファーオブジェクトには、 :class:`bytearray` と :class:" -"`bytearray` の :class:`memoryview` などが含まれます。\n" -"また、他の幾つかの操作では不変なオブジェクト内のバイナリデータ (\"読み出し専" -"用の bytes-like オブジェクト\") を必要します。それには :class:`bytes` と :" -"class:`bytes` の :class:`memoryview` オブジェクトが含まれます。" - -#: ../../glossary.rst:218 +"その操作のドキュメントではよく \"読み書き可能な bytes-like オブジェクト\" に言及しています。\n" +"変更可能なバッファーオブジェクトには、 :class:`bytearray` と :class:`bytearray` の :class:`memoryview` などが含まれます。\n" +"また、他の幾つかの操作では不変なオブジェクト内のバイナリデータ (\"読み出し専用の bytes-like オブジェクト\") を必要します。それには :class:`bytes` と :class:`bytes` の :class:`memoryview` オブジェクトが含まれます。" + +#: ../../glossary.rst:177 msgid "bytecode" msgstr "bytecode" -#: ../../glossary.rst:220 +#: ../../glossary.rst:179 msgid "" -"Python source code is compiled into bytecode, the internal representation of " -"a Python program in the CPython interpreter. The bytecode is also cached in " -"``.pyc`` files so that executing the same file is faster the second time " -"(recompilation from source to bytecode can be avoided). This \"intermediate " -"language\" is said to run on a :term:`virtual machine` that executes the " +"Python source code is compiled into bytecode, the internal representation of" +" a Python program in the CPython interpreter. The bytecode is also cached " +"in ``.pyc`` files so that executing the same file is faster the second time " +"(recompilation from source to bytecode can be avoided). This \"intermediate" +" language\" is said to run on a :term:`virtual machine` that executes the " "machine code corresponding to each bytecode. Do note that bytecodes are not " -"expected to work between different Python virtual machines, nor to be stable " -"between Python releases." +"expected to work between different Python virtual machines, nor to be stable" +" between Python releases." msgstr "" -"(バイトコード) Python のソースコードは、 Python プログラムの CPython インタプ" -"リタの内部表現であるバイトコードへとコンパイルされます。\n" -"バイトコードは ``.pyc`` ファイルにキャッシュされ、同じファイルが二度目に実行" -"されるときはより高速になります (ソースコードからバイトコードへの再度のコンパ" -"イルは回避されます)。\n" -"この \"中間言語 (intermediate language)\" は、各々のバイトコードに対応する機" -"械語を実行する :term:`仮想マシン ` で動作するといえます。\n" -"重要な注意として、バイトコードは異なる Python 仮想マシン間で動作することや、" -"Python リリース間で安定であることは期待されていません。" +"(バイトコード) Python のソースコードは、 Python プログラムの CPython インタプリタの内部表現であるバイトコードへとコンパイルされます。\n" +"バイトコードは ``.pyc`` ファイルにキャッシュされ、同じファイルが二度目に実行されるときはより高速になります (ソースコードからバイトコードへの再度のコンパイルは回避されます)。\n" +"この \"中間言語 (intermediate language)\" は、各々のバイトコードに対応する機械語を実行する :term:`仮想マシン ` で動作するといえます。\n" +"重要な注意として、バイトコードは異なる Python 仮想マシン間で動作することや、Python リリース間で安定であることは期待されていません。" -#: ../../glossary.rst:230 +#: ../../glossary.rst:189 msgid "" -"A list of bytecode instructions can be found in the documentation for :ref:" -"`the dis module `." -msgstr "" -"バイトコードの命令一覧は :ref:`dis モジュール ` にあります。" - -#: ../../glossary.rst:232 -msgid "callable" -msgstr "callable" +"A list of bytecode instructions can be found in the documentation for " +":ref:`the dis module `." +msgstr "バイトコードの命令一覧は :ref:`dis モジュール ` にあります。" -#: ../../glossary.rst:234 -msgid "" -"A callable is an object that can be called, possibly with a set of arguments " -"(see :term:`argument`), with the following syntax::" -msgstr "" - -#: ../../glossary.rst:237 -msgid "callable(argument1, argument2, argumentN)" -msgstr "" - -#: ../../glossary.rst:239 -msgid "" -"A :term:`function`, and by extension a :term:`method`, is a callable. An " -"instance of a class that implements the :meth:`~object.__call__` method is " -"also a callable." -msgstr "" - -#: ../../glossary.rst:242 +#: ../../glossary.rst:191 msgid "callback" msgstr "callback" -#: ../../glossary.rst:244 +#: ../../glossary.rst:193 msgid "" "A subroutine function which is passed as an argument to be executed at some " "point in the future." msgstr "(コールバック) 将来のある時点で実行されるために引数として渡される関数" -#: ../../glossary.rst:246 +#: ../../glossary.rst:195 msgid "class" -msgstr "クラス" +msgstr "class" -#: ../../glossary.rst:248 +#: ../../glossary.rst:197 msgid "" "A template for creating user-defined objects. Class definitions normally " "contain method definitions which operate on instances of the class." msgstr "" -"(クラス) ユーザー定義オブジェクトを作成するためのテンプレートです。クラス定義" -"は普通、そのクラスのインスタンス上の操作をするメソッドの定義を含みます。" +"(クラス) ユーザー定義オブジェクトを作成するためのテンプレートです。クラス定義は普通、そのクラスのインスタンス上の操作をするメソッドの定義を含みます。" -#: ../../glossary.rst:251 +#: ../../glossary.rst:200 msgid "class variable" msgstr "class variable" -#: ../../glossary.rst:253 +#: ../../glossary.rst:202 msgid "" "A variable defined in a class and intended to be modified only at class " "level (i.e., not in an instance of the class)." -msgstr "" -"(クラス変数) クラス上に定義され、クラスレベルで (つまり、クラスのインスタンス" -"上ではなしに) 変更されることを目的としている変数です。" - -#: ../../glossary.rst:255 -msgid "closure variable" -msgstr "" - -#: ../../glossary.rst:257 -msgid "" -"A :term:`free variable` referenced from a :term:`nested scope` that is " -"defined in an outer scope rather than being resolved at runtime from the " -"globals or builtin namespaces. May be explicitly defined with the :keyword:" -"`nonlocal` keyword to allow write access, or implicitly defined if the " -"variable is only being read." -msgstr "" +msgstr "(クラス変数) クラス上に定義され、クラスレベルで (つまり、クラスのインスタンス上ではなしに) 変更されることを目的としている変数です。" -#: ../../glossary.rst:262 -msgid "" -"For example, in the ``inner`` function in the following code, both ``x`` and " -"``print`` are :term:`free variables `, but only ``x`` is a " -"*closure variable*::" -msgstr "" +#: ../../glossary.rst:204 +msgid "coercion" +msgstr "coercion" -#: ../../glossary.rst:265 +#: ../../glossary.rst:206 msgid "" -"def outer():\n" -" x = 0\n" -" def inner():\n" -" nonlocal x\n" -" x += 1\n" -" print(x)\n" -" return inner" +"The implicit conversion of an instance of one type to another during an " +"operation which involves two arguments of the same type. For example, " +"``int(3.15)`` converts the floating point number to the integer ``3``, but " +"in ``3+4.5``, each argument is of a different type (one int, one float), and" +" both must be converted to the same type before they can be added or it will" +" raise a :exc:`TypeError`. Without coercion, all arguments of even " +"compatible types would have to be normalized to the same value by the " +"programmer, e.g., ``float(3)+4.5`` rather than just ``3+4.5``." msgstr "" +"(型強制) 同じ型の 2 引数を伴う演算の最中に行われる、ある型のインスタンスの別の型への暗黙の変換です。\n" +"例えば、 ``int(3.15)`` は浮動小数点数を整数 ``3`` に変換します。しかし ``3+4.5`` では、各引数は型が異なり(一つは整数、一つは浮動小数点数)、加算をする前に同じ型に変換できなければ :exc:`TypeError` 例外が投げられます。\n" +"型強制がなかったら、すべての引数は、たとえ互換な型であっても、単に ``3+4.5`` ではなく ``float(3)+4.5`` というように、プログラマーが同じ型に正規化しなければいけません。" -#: ../../glossary.rst:273 -msgid "" -"Due to the :attr:`codeobject.co_freevars` attribute (which, despite its " -"name, only includes the names of closure variables rather than listing all " -"referenced free variables), the more general :term:`free variable` term is " -"sometimes used even when the intended meaning is to refer specifically to " -"closure variables." -msgstr "" - -#: ../../glossary.rst:277 +#: ../../glossary.rst:214 msgid "complex number" msgstr "complex number" -#: ../../glossary.rst:279 +#: ../../glossary.rst:216 msgid "" "An extension of the familiar real number system in which all numbers are " "expressed as a sum of a real part and an imaginary part. Imaginary numbers " @@ -641,105 +493,70 @@ msgid "" "support for complex numbers, which are written with this latter notation; " "the imaginary part is written with a ``j`` suffix, e.g., ``3+1j``. To get " "access to complex equivalents of the :mod:`math` module, use :mod:`cmath`. " -"Use of complex numbers is a fairly advanced mathematical feature. If you're " -"not aware of a need for them, it's almost certain you can safely ignore them." -msgstr "" -"(複素数) よく知られている実数系を拡張したもので、すべての数は実部と虚部の和と" -"して表されます。虚数は虚数単位 (``-1`` の平方根) に実数を掛けたもので、一般に" -"数学では ``i`` と書かれ、工学では ``j`` と書かれます。Python は複素数に組み込" -"みで対応し、後者の表記を取っています。虚部は末尾に ``j`` をつけて書きます。例" -"えば ``3+1j`` です。 :mod:`math` モジュールの複素数版を利用するには、 :mod:" -"`cmath` を使います。複素数の使用はかなり高度な数学の機能です。必要性を感じな" -"ければ、ほぼ間違いなく無視してしまってよいでしょう。" - -#: ../../glossary.rst:289 -msgid "context" +"Use of complex numbers is a fairly advanced mathematical feature. If you're" +" not aware of a need for them, it's almost certain you can safely ignore " +"them." msgstr "" +"(複素数) よく知られている実数系を拡張したもので、すべての数は実部と虚部の和として表されます。虚数は虚数単位 (``-1`` の平方根) " +"に実数を掛けたもので、一般に数学では ``i`` と書かれ、工学では ``j`` と書かれます。Python " +"は複素数に組み込みで対応し、後者の表記を取っています。虚部は末尾に ``j`` をつけて書きます。例えば ``3+1j`` です。 " +":mod:`math` モジュールの複素数版を利用するには、 :mod:`cmath` " +"を使います。複素数の使用はかなり高度な数学の機能です。必要性を感じなければ、ほぼ間違いなく無視してしまってよいでしょう。" -#: ../../glossary.rst:291 -msgid "" -"This term has different meanings depending on where and how it is used. Some " -"common meanings:" -msgstr "" - -#: ../../glossary.rst:294 -msgid "" -"The temporary state or environment established by a :term:`context manager` " -"via a :keyword:`with` statement." -msgstr "" - -#: ../../glossary.rst:296 -msgid "" -"The collection of key­value bindings associated with a particular :class:" -"`contextvars.Context` object and accessed via :class:`~contextvars." -"ContextVar` objects. Also see :term:`context variable`." -msgstr "" - -#: ../../glossary.rst:300 -msgid "" -"A :class:`contextvars.Context` object. Also see :term:`current context`." -msgstr "" - -#: ../../glossary.rst:302 -msgid "context management protocol" -msgstr "コンテキスト管理プロトコル" - -#: ../../glossary.rst:304 -msgid "" -"The :meth:`~object.__enter__` and :meth:`~object.__exit__` methods called by " -"the :keyword:`with` statement. See :pep:`343`." -msgstr "" - -#: ../../glossary.rst:306 +#: ../../glossary.rst:226 msgid "context manager" msgstr "context manager" -#: ../../glossary.rst:308 +#: ../../glossary.rst:228 msgid "" -"An object which implements the :term:`context management protocol` and " -"controls the environment seen in a :keyword:`with` statement. See :pep:" -"`343`." +"An object which controls the environment seen in a :keyword:`with` statement" +" by defining :meth:`__enter__` and :meth:`__exit__` methods. See :pep:`343`." msgstr "" +"(コンテキストマネージャ)\n" +":meth:`__enter__` と :meth:`__exit__` メソッドを定義することで :keyword:`with` 文内の環境を管理するオブジェクトです。:pep:`343` を参照してください。" -#: ../../glossary.rst:311 +#: ../../glossary.rst:231 msgid "context variable" msgstr "context variable" -#: ../../glossary.rst:313 +#: ../../glossary.rst:233 msgid "" -"A variable whose value depends on which context is the :term:`current " -"context`. Values are accessed via :class:`contextvars.ContextVar` objects. " -"Context variables are primarily used to isolate state between concurrent " -"asynchronous tasks." +"A variable which can have different values depending on its context. This is" +" similar to Thread-Local Storage in which each execution thread may have a " +"different value for a variable. However, with context variables, there may " +"be several contexts in one execution thread and the main usage for context " +"variables is to keep track of variables in concurrent asynchronous tasks. " +"See :mod:`contextvars`." msgstr "" +"(コンテキスト変数) コンテキストに依存して異なる値を持つ変数。\n" +"これは、ある変数の値が各々の実行スレッドで異なり得るスレッドローカルストレージに似ています。\n" +"しかしコンテキスト変数では、 1 つの実行スレッドにいくつかのコンテキストがあり得、コンテキスト変数の主な用途は並列な非同期タスクの変数の追跡です。\n" +":mod:`contextvars` を参照してください。" -#: ../../glossary.rst:317 +#: ../../glossary.rst:240 msgid "contiguous" msgstr "contiguous" -#: ../../glossary.rst:321 +#: ../../glossary.rst:244 msgid "" "A buffer is considered contiguous exactly if it is either *C-contiguous* or " "*Fortran contiguous*. Zero-dimensional buffers are C and Fortran " -"contiguous. In one-dimensional arrays, the items must be laid out in memory " -"next to each other, in order of increasing indexes starting from zero. In " -"multidimensional C-contiguous arrays, the last index varies the fastest when " -"visiting items in order of memory address. However, in Fortran contiguous " +"contiguous. In one-dimensional arrays, the items must be laid out in memory" +" next to each other, in order of increasing indexes starting from zero. In " +"multidimensional C-contiguous arrays, the last index varies the fastest when" +" visiting items in order of memory address. However, in Fortran contiguous " "arrays, the first index varies the fastest." msgstr "" -"(隣接、連続) バッファが厳密に *C-連続* または *Fortran 連続* である場合に、そ" -"のバッファは連続しているとみなせます。\n" +"(隣接、連続) バッファが厳密に *C-連続* または *Fortran 連続* である場合に、そのバッファは連続しているとみなせます。\n" "ゼロ次元バッファは C 連続であり Fortran 連続です。\n" -"一次元の配列では、その要素は必ずメモリ上で隣接するように配置され、添字がゼロ" -"から始まり増えていく順序で並びます。\n" -"多次元の C-連続な配列では、メモリアドレス順に要素を巡る際には最後の添え字が最" -"初に変わるのに対し、 Fortran 連続な配列では最初の添え字が最初に動きます。" +"一次元の配列では、その要素は必ずメモリ上で隣接するように配置され、添字がゼロから始まり増えていく順序で並びます。\n" +"多次元の C-連続な配列では、メモリアドレス順に要素を巡る際には最後の添え字が最初に変わるのに対し、 Fortran 連続な配列では最初の添え字が最初に動きます。" -#: ../../glossary.rst:329 +#: ../../glossary.rst:252 msgid "coroutine" -msgstr "コルーチン" +msgstr "coroutine" -#: ../../glossary.rst:331 +#: ../../glossary.rst:254 msgid "" "Coroutines are a more generalized form of subroutines. Subroutines are " "entered at one point and exited at another point. Coroutines can be " @@ -752,226 +569,184 @@ msgstr "" "コルーチンは :keyword:`async def` 文で実装できます。\n" ":pep:`492` を参照してください。" -#: ../../glossary.rst:336 +#: ../../glossary.rst:259 msgid "coroutine function" msgstr "coroutine function" -#: ../../glossary.rst:338 +#: ../../glossary.rst:261 msgid "" "A function which returns a :term:`coroutine` object. A coroutine function " -"may be defined with the :keyword:`async def` statement, and may contain :" -"keyword:`await`, :keyword:`async for`, and :keyword:`async with` keywords. " -"These were introduced by :pep:`492`." +"may be defined with the :keyword:`async def` statement, and may contain " +":keyword:`await`, :keyword:`async for`, and :keyword:`async with` keywords." +" These were introduced by :pep:`492`." msgstr "" "(コルーチン関数)\n" ":term:`coroutine` オブジェクトを返す関数です。\n" -"コルーチン関数は :keyword:`async def` 文で実装され、:keyword:`await`、:" -"keyword:`async for`、 および :keyword:`async with` キーワードを持つことが出来" -"ます。\n" +"コルーチン関数は :keyword:`async def` 文で実装され、:keyword:`await`、:keyword:`async for`、 および :keyword:`async with` キーワードを持つことが出来ます。\n" "これらは :pep:`492` で導入されました。" -#: ../../glossary.rst:343 +#: ../../glossary.rst:266 msgid "CPython" msgstr "CPython" -#: ../../glossary.rst:345 +#: ../../glossary.rst:268 msgid "" "The canonical implementation of the Python programming language, as " -"distributed on `python.org `_. The term \"CPython\" " -"is used when necessary to distinguish this implementation from others such " +"distributed on `python.org `_. The term \"CPython\"" +" is used when necessary to distinguish this implementation from others such " "as Jython or IronPython." msgstr "" -"`python.org `_ で配布されている、Python プログラミン" -"グ言語の標準的な実装です。\"CPython\" という単語は、この実装を Jython や " -"IronPython といった他の実装と区別する必要が有る場合に利用されます。" +"`python.org `_ で配布されている、Python " +"プログラミング言語の標準的な実装です。\"CPython\" という単語は、この実装を Jython や IronPython " +"といった他の実装と区別する必要が有る場合に利用されます。" -#: ../../glossary.rst:349 -msgid "current context" -msgstr "" - -#: ../../glossary.rst:351 -msgid "" -"The :term:`context` (:class:`contextvars.Context` object) that is currently " -"used by :class:`~contextvars.ContextVar` objects to access (get or set) the " -"values of :term:`context variables `. Each thread has its " -"own current context. Frameworks for executing asynchronous tasks (see :mod:" -"`asyncio`) associate each task with a context which becomes the current " -"context whenever the task starts or resumes execution." -msgstr "" - -#: ../../glossary.rst:357 -msgid "cyclic isolate" -msgstr "" - -#: ../../glossary.rst:359 -msgid "" -"A subgroup of one or more objects that reference each other in a reference " -"cycle, but are not referenced by objects outside the group. The goal of " -"the :term:`cyclic garbage collector ` is to identify " -"these groups and break the reference cycles so that the memory can be " -"reclaimed." -msgstr "" - -#: ../../glossary.rst:363 +#: ../../glossary.rst:272 msgid "decorator" msgstr "decorator" -#: ../../glossary.rst:365 +#: ../../glossary.rst:274 msgid "" "A function returning another function, usually applied as a function " "transformation using the ``@wrapper`` syntax. Common examples for " "decorators are :func:`classmethod` and :func:`staticmethod`." msgstr "" -"(デコレータ) 別の関数を返す関数で、通常、 ``@wrapper`` 構文で関数変換として適" -"用されます。デコレータの一般的な利用例は、 :func:`classmethod` と :func:" -"`staticmethod` です。" +"(デコレータ) 別の関数を返す関数で、通常、 ``@wrapper`` 構文で関数変換として適用されます。デコレータの一般的な利用例は、 " +":func:`classmethod` と :func:`staticmethod` です。" -#: ../../glossary.rst:369 +#: ../../glossary.rst:278 msgid "" "The decorator syntax is merely syntactic sugar, the following two function " "definitions are semantically equivalent::" -msgstr "" -"デコレータの文法はシンタックスシュガーです。次の2つの関数定義は意味的に同じも" -"のです::" +msgstr "デコレータの文法はシンタックスシュガーです。次の2つの関数定義は意味的に同じものです::" -#: ../../glossary.rst:372 -msgid "" -"def f(arg):\n" -" ...\n" -"f = staticmethod(f)\n" -"\n" -"@staticmethod\n" -"def f(arg):\n" -" ..." -msgstr "" - -#: ../../glossary.rst:380 +#: ../../glossary.rst:289 msgid "" "The same concept exists for classes, but is less commonly used there. See " -"the documentation for :ref:`function definitions ` and :ref:`class " -"definitions ` for more about decorators." +"the documentation for :ref:`function definitions ` and :ref:`class" +" definitions ` for more about decorators." msgstr "" -"同じ概念がクラスにも存在しますが、あまり使われません。デコレータについて詳し" -"くは、 :ref:`関数定義 ` および :ref:`クラス定義 ` のドキュメ" -"ントを参照してください。" +"同じ概念がクラスにも存在しますが、あまり使われません。デコレータについて詳しくは、 :ref:`関数定義 ` および " +":ref:`クラス定義 ` のドキュメントを参照してください。" -#: ../../glossary.rst:383 +#: ../../glossary.rst:292 msgid "descriptor" msgstr "descriptor" -#: ../../glossary.rst:385 +#: ../../glossary.rst:294 msgid "" -"Any object which defines the methods :meth:`~object.__get__`, :meth:`~object." -"__set__`, or :meth:`~object.__delete__`. When a class attribute is a " -"descriptor, its special binding behavior is triggered upon attribute " -"lookup. Normally, using *a.b* to get, set or delete an attribute looks up " -"the object named *b* in the class dictionary for *a*, but if *b* is a " -"descriptor, the respective descriptor method gets called. Understanding " -"descriptors is a key to a deep understanding of Python because they are the " -"basis for many features including functions, methods, properties, class " -"methods, static methods, and reference to super classes." -msgstr "" +"Any object which defines the methods :meth:`__get__`, :meth:`__set__`, or " +":meth:`__delete__`. When a class attribute is a descriptor, its special " +"binding behavior is triggered upon attribute lookup. Normally, using *a.b* " +"to get, set or delete an attribute looks up the object named *b* in the " +"class dictionary for *a*, but if *b* is a descriptor, the respective " +"descriptor method gets called. Understanding descriptors is a key to a deep" +" understanding of Python because they are the basis for many features " +"including functions, methods, properties, class methods, static methods, and" +" reference to super classes." +msgstr "" +"(デスクリプタ) メソッド :meth:`__get__`, :meth:`__set__`, あるいは :meth:`__delete__` " +"を定義しているオブジェクトです。あるクラス属性がデスクリプタであるとき、属性探索によって、束縛されている特別な動作が呼び出されます。通常、get,set,deleteのために" +" *a.b* と書くと、 *a* のクラス辞書内でオブジェクト *b* を検索しますが、 *b* " +"がデスクリプタであればそれぞれのデスクリプタメソッドが呼び出されます。デスクリプタの理解は、 Python " +"を深く理解する上で鍵となります。というのは、デスクリプタこそが、関数、メソッド、プロパティ、クラスメソッド、静的メソッド、そしてスーパクラスの参照といった多くの機能の基盤だからです。" -#: ../../glossary.rst:396 +#: ../../glossary.rst:304 msgid "" "For more information about descriptors' methods, see :ref:`descriptors` or " "the :ref:`Descriptor How To Guide `." msgstr "" -"デスクリプタのメソッドに関しての詳細は、 :ref:`descriptors` や :ref:" -"`Descriptor How To Guide ` を参照してください。" +"デスクリプタのメソッドに関しての詳細は、 :ref:`descriptors` や :ref:`Descriptor How To Guide " +"` を参照してください。" -#: ../../glossary.rst:398 +#: ../../glossary.rst:306 msgid "dictionary" msgstr "dictionary" -#: ../../glossary.rst:400 +#: ../../glossary.rst:308 msgid "" "An associative array, where arbitrary keys are mapped to values. The keys " -"can be any object with :meth:`~object.__hash__` and :meth:`~object.__eq__` " -"methods. Called a hash in Perl." +"can be any object with :meth:`__hash__` and :meth:`__eq__` methods. Called a" +" hash in Perl." msgstr "" +"(辞書) 任意のキーを値に対応付ける連想配列です。 :meth:`__hash__` メソッドと :meth:`__eq__` " +"メソッドを実装した任意のオブジェクトをキーにできます。 Perl ではハッシュ (hash) と呼ばれています。" -#: ../../glossary.rst:404 +#: ../../glossary.rst:311 msgid "dictionary comprehension" msgstr "dictionary comprehension" -#: ../../glossary.rst:406 +#: ../../glossary.rst:313 msgid "" "A compact way to process all or part of the elements in an iterable and " "return a dictionary with the results. ``results = {n: n ** 2 for n in " -"range(10)}`` generates a dictionary containing key ``n`` mapped to value ``n " -"** 2``. See :ref:`comprehensions`." +"range(10)}`` generates a dictionary containing key ``n`` mapped to value ``n" +" ** 2``. See :ref:`comprehensions`." msgstr "" -"(辞書内包表記) iterable 内の全てあるいは一部の要素を処理して、その結果からな" -"る辞書を返すコンパクトな書き方です。 ``results = {n: n ** 2 for n in " -"range(10)}`` とすると、キー ``n`` を値 ``n ** 2`` に対応付ける辞書を生成しま" -"す。 :ref:`comprehensions` を参照してください。" +"(辞書内包表記) iterable 内の全てあるいは一部の要素を処理して、その結果からなる辞書を返すコンパクトな書き方です。 ``results = " +"{n: n ** 2 for n in range(10)}`` とすると、キー ``n`` を値 ``n ** 2`` に対応付ける辞書を生成します。" +" :ref:`comprehensions` を参照してください。" -#: ../../glossary.rst:410 +#: ../../glossary.rst:317 msgid "dictionary view" msgstr "dictionary view" -#: ../../glossary.rst:412 +#: ../../glossary.rst:319 msgid "" -"The objects returned from :meth:`dict.keys`, :meth:`dict.values`, and :meth:" -"`dict.items` are called dictionary views. They provide a dynamic view on the " -"dictionary’s entries, which means that when the dictionary changes, the view " -"reflects these changes. To force the dictionary view to become a full list " -"use ``list(dictview)``. See :ref:`dict-views`." +"The objects returned from :meth:`dict.keys`, :meth:`dict.values`, and " +":meth:`dict.items` are called dictionary views. They provide a dynamic view " +"on the dictionary’s entries, which means that when the dictionary changes, " +"the view reflects these changes. To force the dictionary view to become a " +"full list use ``list(dictview)``. See :ref:`dict-views`." msgstr "" "(辞書ビュー)\n" -":meth:`dict.keys`、:meth:`dict.values`、:meth:`dict.items` が返すオブジェクト" -"です。\n" +":meth:`dict.keys`、:meth:`dict.values`、:meth:`dict.items` が返すオブジェクトです。\n" "辞書の項目の動的なビューを提供します。\n" "すなわち、辞書が変更されるとビューはそれを反映します。\n" -"辞書ビューを強制的に完全なリストにするには ``list(dictview)`` を使用してくだ" -"さい。 \n" +"辞書ビューを強制的に完全なリストにするには ``list(dictview)`` を使用してください。 \n" ":ref:`dict-views` を参照してください。" -#: ../../glossary.rst:418 +#: ../../glossary.rst:325 msgid "docstring" msgstr "docstring" -#: ../../glossary.rst:420 +#: ../../glossary.rst:327 msgid "" "A string literal which appears as the first expression in a class, function " "or module. While ignored when the suite is executed, it is recognized by " -"the compiler and put into the :attr:`~definition.__doc__` attribute of the " -"enclosing class, function or module. Since it is available via " -"introspection, it is the canonical place for documentation of the object." +"the compiler and put into the :attr:`__doc__` attribute of the enclosing " +"class, function or module. Since it is available via introspection, it is " +"the canonical place for documentation of the object." msgstr "" +"クラス、関数、モジュールの最初の式である文字列リテラルです。そのスイートの実行時には無視されますが、コンパイラによって識別され、そのクラス、関数、モジュールの" +" :attr:`__doc__` 属性として保存されます。イントロスペクションできる(訳注: " +"属性として参照できる)ので、オブジェクトのドキュメントを書く標準的な場所です。" -#: ../../glossary.rst:426 +#: ../../glossary.rst:333 msgid "duck-typing" msgstr "duck-typing" -#: ../../glossary.rst:428 +#: ../../glossary.rst:335 msgid "" "A programming style which does not look at an object's type to determine if " "it has the right interface; instead, the method or attribute is simply " -"called or used (\"If it looks like a duck and quacks like a duck, it must be " -"a duck.\") By emphasizing interfaces rather than specific types, well-" -"designed code improves its flexibility by allowing polymorphic " -"substitution. Duck-typing avoids tests using :func:`type` or :func:" -"`isinstance`. (Note, however, that duck-typing can be complemented with :" -"term:`abstract base classes `.) Instead, it typically " -"employs :func:`hasattr` tests or :term:`EAFP` programming." -msgstr "" -"あるオブジェクトが正しいインターフェースを持っているかを決定するのにオブジェ" -"クトの型を見ないプログラミングスタイルです。代わりに、単純にオブジェクトのメ" -"ソッドや属性が呼ばれたり使われたりします。(「アヒルのように見えて、アヒルの" -"ように鳴けば、それはアヒルである。」)インターフェースを型より重視すること" -"で、上手くデザインされたコードは、ポリモーフィックな代替を許して柔軟性を向上" -"させます。ダックタイピングは :func:`type` や :func:`isinstance` による判定を" -"避けます。 (ただし、ダックタイピングを :term:`抽象基底クラス ` で補完することもできます。) その代わり、典型的に :func:`hasattr` 判定" -"や :term:`EAFP` プログラミングを利用します。" - -#: ../../glossary.rst:437 +"called or used (\"If it looks like a duck and quacks like a duck, it must be" +" a duck.\") By emphasizing interfaces rather than specific types, well-" +"designed code improves its flexibility by allowing polymorphic substitution." +" Duck-typing avoids tests using :func:`type` or :func:`isinstance`. (Note," +" however, that duck-typing can be complemented with :term:`abstract base " +"classes `.) Instead, it typically employs " +":func:`hasattr` tests or :term:`EAFP` programming." +msgstr "" +"あるオブジェクトが正しいインターフェースを持っているかを決定するのにオブジェクトの型を見ないプログラミングスタイルです。代わりに、単純にオブジェクトのメソッドや属性が呼ばれたり使われたりします。(「アヒルのように見えて、アヒルのように鳴けば、それはアヒルである。」)インターフェースを型より重視することで、上手くデザインされたコードは、ポリモーフィックな代替を許して柔軟性を向上させます。ダックタイピングは" +" :func:`type` や :func:`isinstance` による判定を避けます。 (ただし、ダックタイピングを :term:`抽象基底クラス" +" ` で補完することもできます。) その代わり、典型的に :func:`hasattr` 判定や " +":term:`EAFP` プログラミングを利用します。" + +#: ../../glossary.rst:344 msgid "EAFP" msgstr "EAFP" -#: ../../glossary.rst:439 +#: ../../glossary.rst:346 msgid "" "Easier to ask for forgiveness than permission. This common Python coding " "style assumes the existence of valid keys or attributes and catches " @@ -981,176 +756,125 @@ msgid "" "many other languages such as C." msgstr "" "「認可をとるより許しを請う方が容易 (easier to ask for forgiveness than " -"permission、マーフィーの法則)」の略です。この Python で広く使われているコー" -"ディングスタイルでは、通常は有効なキーや属性が存在するものと仮定し、その仮定" -"が誤っていた場合に例外を捕捉します。この簡潔で手早く書けるコーディングスタイ" -"ルには、 :keyword:`try` 文および :keyword:`except` 文がたくさんあるのが特徴で" -"す。このテクニックは、C のような言語でよく使われている :term:`LBYL` スタイル" -"と対照的なものです。" +"permission、マーフィーの法則)」の略です。この Python " +"で広く使われているコーディングスタイルでは、通常は有効なキーや属性が存在するものと仮定し、その仮定が誤っていた場合に例外を捕捉します。この簡潔で手早く書けるコーディングスタイルには、" +" :keyword:`try` 文および :keyword:`except` 文がたくさんあるのが特徴です。このテクニックは、C " +"のような言語でよく使われている :term:`LBYL` スタイルと対照的なものです。" -#: ../../glossary.rst:445 -msgid "evaluate function" -msgstr "" - -#: ../../glossary.rst:447 -msgid "" -"A function that can be called to evaluate a lazily evaluated attribute of an " -"object, such as the value of type aliases created with the :keyword:`type` " -"statement." -msgstr "" - -#: ../../glossary.rst:450 +#: ../../glossary.rst:352 msgid "expression" msgstr "expression" -#: ../../glossary.rst:452 +#: ../../glossary.rst:354 msgid "" "A piece of syntax which can be evaluated to some value. In other words, an " "expression is an accumulation of expression elements like literals, names, " "attribute access, operators or function calls which all return a value. In " "contrast to many other languages, not all language constructs are " "expressions. There are also :term:`statement`\\s which cannot be used as " -"expressions, such as :keyword:`while`. Assignments are also statements, not " -"expressions." +"expressions, such as :keyword:`while`. Assignments are also statements, not" +" expressions." msgstr "" -"(式) 何かの値と評価される、一まとまりの構文 (a piece of syntax) です。言い換" -"えると、式とはリテラル、名前、属性アクセス、演算子や関数呼び出しなど、値を返" -"す式の要素の積み重ねです。他の多くの言語と違い、Python では言語の全ての構成要" -"素が式というわけではありません。 :keyword:`while` のように、式としては使えな" -"い :term:`文 ` もあります。代入も式ではなく文です。" +"(式) 何かの値と評価される、一まとまりの構文 (a piece of syntax) " +"です。言い換えると、式とはリテラル、名前、属性アクセス、演算子や関数呼び出しなど、値を返す式の要素の積み重ねです。他の多くの言語と違い、Python " +"では言語の全ての構成要素が式というわけではありません。 :keyword:`while` のように、式としては使えない :term:`文 " +"` もあります。代入も式ではなく文です。" -#: ../../glossary.rst:459 +#: ../../glossary.rst:361 msgid "extension module" msgstr "extension module" -#: ../../glossary.rst:461 +#: ../../glossary.rst:363 msgid "" -"A module written in C or C++, using Python's C API to interact with the core " -"and with user code." +"A module written in C or C++, using Python's C API to interact with the core" +" and with user code." msgstr "" -"(拡張モジュール) C や C++ で書かれたモジュールで、Python の C API を利用して " -"Python コアやユーザーコードとやりとりします。" +"(拡張モジュール) C や C++ で書かれたモジュールで、Python の C API を利用して Python " +"コアやユーザーコードとやりとりします。" -#: ../../glossary.rst:463 +#: ../../glossary.rst:365 msgid "f-string" msgstr "f-string" -#: ../../glossary.rst:465 +#: ../../glossary.rst:367 msgid "" -"String literals prefixed with ``'f'`` or ``'F'`` are commonly called \"f-" -"strings\" which is short for :ref:`formatted string literals `. " -"See also :pep:`498`." +"String literals prefixed with ``'f'`` or ``'F'`` are commonly called " +"\"f-strings\" which is short for :ref:`formatted string literals " +"`. See also :pep:`498`." msgstr "" -"``'f'`` や ``'F'`` が先頭に付いた文字列リテラルは \"f-string\" と呼ばれ、これ" -"は :ref:`フォーマット済み文字列リテラル ` の短縮形の名称です。\n" +"``'f'`` や ``'F'`` が先頭に付いた文字列リテラルは \"f-string\" と呼ばれ、これは :ref:`フォーマット済み文字列リテラル ` の短縮形の名称です。\n" ":pep:`498` も参照してください。" -#: ../../glossary.rst:468 +#: ../../glossary.rst:370 msgid "file object" msgstr "file object" -#: ../../glossary.rst:470 +#: ../../glossary.rst:372 msgid "" -"An object exposing a file-oriented API (with methods such as :meth:`!read` " -"or :meth:`!write`) to an underlying resource. Depending on the way it was " +"An object exposing a file-oriented API (with methods such as :meth:`read()` " +"or :meth:`write()`) to an underlying resource. Depending on the way it was " "created, a file object can mediate access to a real on-disk file or to " -"another type of storage or communication device (for example standard input/" -"output, in-memory buffers, sockets, pipes, etc.). File objects are also " -"called :dfn:`file-like objects` or :dfn:`streams`." +"another type of storage or communication device (for example standard " +"input/output, in-memory buffers, sockets, pipes, etc.). File objects are " +"also called :dfn:`file-like objects` or :dfn:`streams`." msgstr "" +"(ファイルオブジェクト) 下位のリソースへのファイル指向 API (:meth:`read()` や :meth:`write()` " +"メソッドを持つもの) " +"を公開しているオブジェクトです。ファイルオブジェクトは、作成された手段によって、実際のディスク上のファイルや、その他のタイプのストレージや通信デバイス " +"(例えば、標準入出力、インメモリバッファ、ソケット、パイプ、等) へのアクセスを媒介できます。ファイルオブジェクトは :dfn:`file-like " +"objects` や :dfn:`streams` とも呼ばれます。" -#: ../../glossary.rst:478 +#: ../../glossary.rst:380 msgid "" -"There are actually three categories of file objects: raw :term:`binary files " -"`, buffered :term:`binary files ` and :term:`text " -"files `. Their interfaces are defined in the :mod:`io` module. " +"There are actually three categories of file objects: raw :term:`binary files" +" `, buffered :term:`binary files ` and :term:`text" +" files `. Their interfaces are defined in the :mod:`io` module. " "The canonical way to create a file object is by using the :func:`open` " "function." msgstr "" -"ファイルオブジェクトには実際には 3 種類あります: 生の :term:`バイナリーファイ" -"ル `、バッファされた :term:`バイナリーファイル `、" -"そして :term:`テキストファイル` です。インターフェイスは :mod:" -"`io` モジュールで定義されています。ファイルオブジェクトを作る標準的な方法は :" -"func:`open` 関数を使うことです。" +"ファイルオブジェクトには実際には 3 種類あります: 生の :term:`バイナリーファイル `、バッファされた " +":term:`バイナリーファイル `、そして :term:`テキストファイル` です。インターフェイスは" +" :mod:`io` モジュールで定義されています。ファイルオブジェクトを作る標準的な方法は :func:`open` 関数を使うことです。" -#: ../../glossary.rst:483 +#: ../../glossary.rst:385 msgid "file-like object" msgstr "file-like object" -#: ../../glossary.rst:485 +#: ../../glossary.rst:387 msgid "A synonym for :term:`file object`." msgstr ":term:`file object` と同義です。" -#: ../../glossary.rst:486 -msgid "filesystem encoding and error handler" -msgstr "" - -#: ../../glossary.rst:488 -msgid "" -"Encoding and error handler used by Python to decode bytes from the operating " -"system and encode Unicode to the operating system." -msgstr "" - -#: ../../glossary.rst:491 -msgid "" -"The filesystem encoding must guarantee to successfully decode all bytes " -"below 128. If the file system encoding fails to provide this guarantee, API " -"functions can raise :exc:`UnicodeError`." -msgstr "" -"ファイルシステムのエンコーディングでは、すべてが 128 バイト以下に正常にデコー" -"ドされることが保証されなくてはなりません。ファイルシステムのエンコーディング" -"でこれが保証されなかった場合は、API 関数が :exc:`UnicodeError` を送出すること" -"があります。" - -#: ../../glossary.rst:495 -msgid "" -"The :func:`sys.getfilesystemencoding` and :func:`sys." -"getfilesystemencodeerrors` functions can be used to get the filesystem " -"encoding and error handler." -msgstr "" - -#: ../../glossary.rst:499 -msgid "" -"The :term:`filesystem encoding and error handler` are configured at Python " -"startup by the :c:func:`PyConfig_Read` function: see :c:member:`~PyConfig." -"filesystem_encoding` and :c:member:`~PyConfig.filesystem_errors` members of :" -"c:type:`PyConfig`." -msgstr "" - -#: ../../glossary.rst:504 -msgid "See also the :term:`locale encoding`." -msgstr "" - -#: ../../glossary.rst:505 +#: ../../glossary.rst:388 msgid "finder" msgstr "finder" -#: ../../glossary.rst:507 +#: ../../glossary.rst:390 msgid "" "An object that tries to find the :term:`loader` for a module that is being " "imported." msgstr "" "(ファインダ)\n" -"インポートされているモジュールの :term:`loader` の発見を試行するオブジェクト" -"です。" +"インポートされているモジュールの :term:`loader` の発見を試行するオブジェクトです。" -#: ../../glossary.rst:510 +#: ../../glossary.rst:393 msgid "" -"There are two types of finder: :term:`meta path finders ` " -"for use with :data:`sys.meta_path`, and :term:`path entry finders ` for use with :data:`sys.path_hooks`." +"Since Python 3.3, there are two types of finder: :term:`meta path finders " +"` for use with :data:`sys.meta_path`, and :term:`path " +"entry finders ` for use with :data:`sys.path_hooks`." msgstr "" +"Python 3.3 以降では 2 種類のファインダがあります。\n" +":data:`sys.meta_path` で使用される :term:`meta path finder` と、\n" +":data:`sys.path_hooks` で使用される :term:`path entry finder` です。" -#: ../../glossary.rst:514 -msgid "" -"See :ref:`finders-and-loaders` and :mod:`importlib` for much more detail." -msgstr "" +#: ../../glossary.rst:397 +msgid "See :pep:`302`, :pep:`420` and :pep:`451` for much more detail." +msgstr "詳細については :pep:`302`、:pep:`420` および :pep:`451` を参照してください。" -#: ../../glossary.rst:515 +#: ../../glossary.rst:398 msgid "floor division" msgstr "floor division" -#: ../../glossary.rst:517 +#: ../../glossary.rst:400 msgid "" "Mathematical division that rounds down to nearest integer. The floor " "division operator is ``//``. For example, the expression ``11 // 4`` " @@ -1160,126 +884,72 @@ msgid "" msgstr "" "(切り捨て除算) 一番近い整数に切り捨てる数学的除算。\n" "切り捨て除算演算子は ``//`` です。\n" -"例えば、 ``11 // 4`` は ``2`` になり、それとは対称に浮動小数点数の真の除算で" -"は ``2.75`` が 返ってきます。\n" -"``(-11) // 4`` は ``-2.75`` を *小さい方に* 丸める (訳注: 負の無限大への丸め" -"を行う) ので ``-3`` になることに注意してください。\n" +"例えば、 ``11 // 4`` は ``2`` になり、それとは対称に浮動小数点数の真の除算では ``2.75`` が 返ってきます。\n" +"``(-11) // 4`` は ``-2.75`` を *小さい方に* 丸める (訳注: 負の無限大への丸めを行う) ので ``-3`` になることに注意してください。\n" ":pep:`238` を参照してください。" -#: ../../glossary.rst:522 -msgid "free threading" -msgstr "" - -#: ../../glossary.rst:524 -msgid "" -"A threading model where multiple threads can run Python bytecode " -"simultaneously within the same interpreter. This is in contrast to the :" -"term:`global interpreter lock` which allows only one thread to execute " -"Python bytecode at a time. See :pep:`703`." -msgstr "" - -#: ../../glossary.rst:528 -msgid "free variable" -msgstr "" - -#: ../../glossary.rst:530 -msgid "" -"Formally, as defined in the :ref:`language execution model `, a " -"free variable is any variable used in a namespace which is not a local " -"variable in that namespace. See :term:`closure variable` for an example. " -"Pragmatically, due to the name of the :attr:`codeobject.co_freevars` " -"attribute, the term is also sometimes used as a synonym for :term:`closure " -"variable`." -msgstr "" - -#: ../../glossary.rst:535 +#: ../../glossary.rst:405 msgid "function" -msgstr "関数" +msgstr "function" -#: ../../glossary.rst:537 +#: ../../glossary.rst:407 msgid "" "A series of statements which returns some value to a caller. It can also be " "passed zero or more :term:`arguments ` which may be used in the " -"execution of the body. See also :term:`parameter`, :term:`method`, and the :" -"ref:`function` section." +"execution of the body. See also :term:`parameter`, :term:`method`, and the " +":ref:`function` section." msgstr "" -"(関数) 呼び出し側に値を返す一連の文のことです。関数には0以上の :term:`実引数 " -"` を渡すことが出来ます。実体の実行時に引数を使用することが出来ま" -"す。 :term:`仮引数 `、:term:`メソッド `、:ref:`function` " -"を参照してください。" +"(関数) 呼び出し側に値を返す一連の文のことです。関数には0以上の :term:`実引数 ` " +"を渡すことが出来ます。実体の実行時に引数を使用することが出来ます。 :term:`仮引数 `、:term:`メソッド " +"`、:ref:`function` を参照してください。" -#: ../../glossary.rst:541 +#: ../../glossary.rst:411 msgid "function annotation" msgstr "function annotation" -#: ../../glossary.rst:543 +#: ../../glossary.rst:413 msgid "An :term:`annotation` of a function parameter or return value." -msgstr "" -"(関数アノテーション) 関数のパラメータや返り値の :term:`annotation` です。" +msgstr "(関数アノテーション) 関数のパラメータや返り値の :term:`annotation` です。" -#: ../../glossary.rst:545 +#: ../../glossary.rst:415 msgid "" "Function annotations are usually used for :term:`type hints `: " "for example, this function is expected to take two :class:`int` arguments " "and is also expected to have an :class:`int` return value::" msgstr "" -"関数アノテーションは、通常は :term:`型ヒント ` のために使われま" -"す: 例えば、この関数は 2 つの :class:`int` 型の引数を取ると期待され、また :" -"class:`int` 型の返り値を持つと期待されています。" - -#: ../../glossary.rst:550 -msgid "" -"def sum_two_numbers(a: int, b: int) -> int:\n" -" return a + b" -msgstr "" +"関数アノテーションは、通常は :term:`型ヒント ` のために使われます: 例えば、この関数は 2 つの " +":class:`int` 型の引数を取ると期待され、また :class:`int` 型の返り値を持つと期待されています。" -#: ../../glossary.rst:553 +#: ../../glossary.rst:423 msgid "Function annotation syntax is explained in section :ref:`function`." msgstr "関数アノテーションの文法は :ref:`function` の節で解説されています。" -#: ../../glossary.rst:555 +#: ../../glossary.rst:425 msgid "" "See :term:`variable annotation` and :pep:`484`, which describe this " -"functionality. Also see :ref:`annotations-howto` for best practices on " -"working with annotations." -msgstr "" -"機能の説明がある :term:`variable annotation`, :pep:`484`,を参照してください。" -"また、アノテーションを利用するベストプラクティスとして :ref:`annotations-" -"howto` も参照してください。" +"functionality." +msgstr "機能の説明がある :term:`variable annotation` と :pep:`484` を参照してください。" -#: ../../glossary.rst:559 +#: ../../glossary.rst:427 msgid "__future__" msgstr "__future__" -#: ../../glossary.rst:561 +#: ../../glossary.rst:429 msgid "" "A :ref:`future statement `, ``from __future__ import ``, " -"directs the compiler to compile the current module using syntax or semantics " -"that will become standard in a future release of Python. The :mod:" -"`__future__` module documents the possible values of *feature*. By " +"directs the compiler to compile the current module using syntax or semantics" +" that will become standard in a future release of Python. The " +":mod:`__future__` module documents the possible values of *feature*. By " "importing this module and evaluating its variables, you can see when a new " -"feature was first added to the language and when it will (or did) become the " -"default::" +"feature was first added to the language and when it will (or did) become the" +" default::" msgstr "" -"``from __future__ import `` という :ref:`future 文 ` は、コ" -"ンパイラーに将来の Python リリースで標準となる構文や意味を使用して現在のモ" -"ジュールをコンパイルするよう指示します。 :mod:`__future__` モジュールでは、 " -"*feature* のとりうる値をドキュメント化しています。このモジュールをインポート" -"し、その変数を評価することで、新機能が最初に言語に追加されたのはいつかや、い" -"つデフォルトになるか (またはなったか) を見ることができます::" -#: ../../glossary.rst:569 -msgid "" -">>> import __future__\n" -">>> __future__.division\n" -"_Feature((2, 2, 0, 'alpha', 2), (3, 0, 0, 'alpha', 0), 8192)" -msgstr "" - -#: ../../glossary.rst:572 +#: ../../glossary.rst:440 msgid "garbage collection" msgstr "garbage collection" -#: ../../glossary.rst:574 +#: ../../glossary.rst:442 msgid "" "The process of freeing memory when it is not used anymore. Python performs " "garbage collection via reference counting and a cyclic garbage collector " @@ -1287,15 +957,14 @@ msgid "" "can be controlled using the :mod:`gc` module." msgstr "" "(ガベージコレクション) これ以降使われることのないメモリを解放する処理です。\n" -"Pythonは、参照カウントと、循環参照を検出し破壊する循環ガベージコレクタを使っ" -"てガベージコレクションを行います。\n" +"Pythonは、参照カウントと、循環参照を検出し破壊する循環ガベージコレクタを使ってガベージコレクションを行います。\n" "ガベージコレクタは :mod:`gc` モジュールを使って操作できます。" -#: ../../glossary.rst:579 ../../glossary.rst:580 +#: ../../glossary.rst:448 msgid "generator" -msgstr "ジェネレータ" +msgstr "generator" -#: ../../glossary.rst:582 +#: ../../glossary.rst:450 msgid "" "A function which returns a :term:`generator iterator`. It looks like a " "normal function except that it contains :keyword:`yield` expressions for " @@ -1305,106 +974,103 @@ msgstr "" "(ジェネレータ)\n" ":term:`generator iterator` を返す関数です。\n" "通常の関数に似ていますが、 :keyword:`yield` 式を持つ点で異なります。\n" -":keyword:`yield` 式は、 for ループで使用できたり、:func:`next` 関数で値を 1 " -"つずつ取り出したりできる、値の並びを生成するのに使用されます。" +":keyword:`yield` 式は、 for ループで使用できたり、:func:`next` 関数で値を 1 つずつ取り出したりできる、値の並びを生成するのに使用されます。" -#: ../../glossary.rst:587 +#: ../../glossary.rst:455 msgid "" "Usually refers to a generator function, but may refer to a *generator " "iterator* in some contexts. In cases where the intended meaning isn't " "clear, using the full terms avoids ambiguity." msgstr "" -"通常はジェネレータ関数を指しますが、文脈によっては *ジェネレータイテレータ* " -"を指す場合があります。\n" +"通常はジェネレータ関数を指しますが、文脈によっては *ジェネレータイテレータ* を指す場合があります。\n" "意図された意味が明らかでない場合、 明瞭化のために完全な単語を使用します。" -#: ../../glossary.rst:590 +#: ../../glossary.rst:458 msgid "generator iterator" msgstr "generator iterator" -#: ../../glossary.rst:592 +#: ../../glossary.rst:460 msgid "An object created by a :term:`generator` function." msgstr "" "(ジェネレータイテレータ)\n" ":term:`generator` 関数で生成されるオブジェクトです。" -#: ../../glossary.rst:594 +#: ../../glossary.rst:462 msgid "" "Each :keyword:`yield` temporarily suspends processing, remembering the " -"execution state (including local variables and pending try-statements). " -"When the *generator iterator* resumes, it picks up where it left off (in " -"contrast to functions which start fresh on every invocation)." +"location execution state (including local variables and pending try-" +"statements). When the *generator iterator* resumes, it picks up where it " +"left off (in contrast to functions which start fresh on every invocation)." msgstr "" +":keyword:`yield` のたびに局所実行状態 (局所変数や未処理の try 文などを含む) を記憶して、処理は一時的に中断されます。\n" +"*ジェネレータイテレータ* が再開されると、中断した位置を取得します (通常の関数が実行のたびに新しい状態から開始するのと対照的です)。" -#: ../../glossary.rst:600 ../../glossary.rst:601 +#: ../../glossary.rst:469 msgid "generator expression" msgstr "generator expression" -#: ../../glossary.rst:603 -msgid "" -"An :term:`expression` that returns an :term:`iterator`. It looks like a " -"normal expression followed by a :keyword:`!for` clause defining a loop " -"variable, range, and an optional :keyword:`!if` clause. The combined " -"expression generates values for an enclosing function::" -msgstr "" - -#: ../../glossary.rst:608 +#: ../../glossary.rst:471 msgid "" -">>> sum(i*i for i in range(10)) # sum of squares 0, 1, 4, ... 81\n" -"285" +"An expression that returns an iterator. It looks like a normal expression " +"followed by a :keyword:`!for` clause defining a loop variable, range, and an" +" optional :keyword:`!if` clause. The combined expression generates values " +"for an enclosing function::" msgstr "" +"(ジェネレータ式) イテレータを返す式です。\n" +"普通の式に、ループ変数を定義する :keyword:`!for` 節、範囲、そして省略可能な :keyword:`!if` 節がつづいているように見えます。\n" +"こうして構成された式は、外側の関数に向けて値を生成します::" -#: ../../glossary.rst:610 +#: ../../glossary.rst:478 msgid "generic function" msgstr "generic function" -#: ../../glossary.rst:612 +#: ../../glossary.rst:480 msgid "" "A function composed of multiple functions implementing the same operation " "for different types. Which implementation should be used during a call is " "determined by the dispatch algorithm." msgstr "" -"(ジェネリック関数) 異なる型に対し同じ操作をする関数群から構成される関数です。" -"呼び出し時にどの実装を用いるかはディスパッチアルゴリズムにより決定されます。" +"(ジェネリック関数) " +"異なる型に対し同じ操作をする関数群から構成される関数です。呼び出し時にどの実装を用いるかはディスパッチアルゴリズムにより決定されます。" -#: ../../glossary.rst:616 +#: ../../glossary.rst:484 msgid "" -"See also the :term:`single dispatch` glossary entry, the :func:`functools." -"singledispatch` decorator, and :pep:`443`." +"See also the :term:`single dispatch` glossary entry, the " +":func:`functools.singledispatch` decorator, and :pep:`443`." msgstr "" -":term:`single dispatch`、:func:`functools.singledispatch` デコレータ、:pep:" -"`443` を参照してください。" +":term:`single dispatch`、:func:`functools.singledispatch` デコレータ、:pep:`443` " +"を参照してください。" -#: ../../glossary.rst:618 +#: ../../glossary.rst:486 msgid "generic type" msgstr "" -#: ../../glossary.rst:620 +#: ../../glossary.rst:488 msgid "" -"A :term:`type` that can be parameterized; typically a :ref:`container " -"class` such as :class:`list` or :class:`dict`. Used for :" -"term:`type hints ` and :term:`annotations `." +"A :term:`type` that can be parameterized; typically a container like " +":class:`list`. Used for :term:`type hints ` and " +":term:`annotations `." msgstr "" -#: ../../glossary.rst:625 +#: ../../glossary.rst:492 msgid "" -"For more details, see :ref:`generic alias types`, :pep:" -"`483`, :pep:`484`, :pep:`585`, and the :mod:`typing` module." +"See :pep:`483` for more details, and :mod:`typing` or :ref:`generic alias " +"type ` for its uses." msgstr "" -#: ../../glossary.rst:627 +#: ../../glossary.rst:494 msgid "GIL" msgstr "GIL" -#: ../../glossary.rst:629 +#: ../../glossary.rst:496 msgid "See :term:`global interpreter lock`." msgstr ":term:`global interpreter lock` を参照してください。" -#: ../../glossary.rst:630 +#: ../../glossary.rst:497 msgid "global interpreter lock" msgstr "global interpreter lock" -#: ../../glossary.rst:632 +#: ../../glossary.rst:499 msgid "" "The mechanism used by the :term:`CPython` interpreter to assure that only " "one thread executes Python :term:`bytecode` at a time. This simplifies the " @@ -1414,136 +1080,97 @@ msgid "" "multi-threaded, at the expense of much of the parallelism afforded by multi-" "processor machines." msgstr "" -"(グローバルインタプリタロック) :term:`CPython` インタプリタが利用している、一" -"度に Python の :term:`バイトコード ` を実行するスレッドは一つだけで" -"あることを保証する仕組みです。これにより (:class:`dict` などの重要な組み込み" -"型を含む) オブジェクトモデルが同時アクセスに対して暗黙的に安全になるので、 " -"CPython の実装がシンプルになります。インタプリタ全体をロックすることで、マル" -"チプロセッサマシンが生じる並列化のコストと引き換えに、インタプリタを簡単にマ" -"ルチスレッド化できるようになります。" +"(グローバルインタプリタロック) :term:`CPython` インタプリタが利用している、一度に Python の :term:`バイトコード " +"` を実行するスレッドは一つだけであることを保証する仕組みです。これにより (:class:`dict` " +"などの重要な組み込み型を含む) オブジェクトモデルが同時アクセスに対して暗黙的に安全になるので、 CPython " +"の実装がシンプルになります。インタプリタ全体をロックすることで、マルチプロセッサマシンが生じる並列化のコストと引き換えに、インタプリタを簡単にマルチスレッド化できるようになります。" -#: ../../glossary.rst:641 +#: ../../glossary.rst:508 msgid "" "However, some extension modules, either standard or third-party, are " -"designed so as to release the GIL when doing computationally intensive tasks " -"such as compression or hashing. Also, the GIL is always released when doing " -"I/O." -msgstr "" -"ただし、標準あるいは外部のいくつかの拡張モジュールは、圧縮やハッシュ計算など" -"の計算の重い処理をするときに GIL を解除するように設計されています。また、I/O " -"処理をする場合 GIL は常に解除されます。" - -#: ../../glossary.rst:646 -msgid "" -"As of Python 3.13, the GIL can be disabled using the :option:`--disable-gil` " -"build configuration. After building Python with this option, code must be " -"run with :option:`-X gil=0 <-X>` or after setting the :envvar:`PYTHON_GIL=0 " -"` environment variable. This feature enables improved " -"performance for multi-threaded applications and makes it easier to use multi-" -"core CPUs efficiently. For more details, see :pep:`703`." +"designed so as to release the GIL when doing computationally-intensive tasks" +" such as compression or hashing. Also, the GIL is always released when " +"doing I/O." msgstr "" +"ただし、標準あるいは外部のいくつかの拡張モジュールは、圧縮やハッシュ計算などの計算の重い処理をするときに GIL " +"を解除するように設計されています。また、I/O 処理をする場合 GIL は常に解除されます。" -#: ../../glossary.rst:653 +#: ../../glossary.rst:513 msgid "" -"In prior versions of Python's C API, a function might declare that it " -"requires the GIL to be held in order to use it. This refers to having an :" -"term:`attached thread state`." +"Past efforts to create a \"free-threaded\" interpreter (one which locks " +"shared data at a much finer granularity) have not been successful because " +"performance suffered in the common single-processor case. It is believed " +"that overcoming this performance issue would make the implementation much " +"more complicated and therefore costlier to maintain." msgstr "" +"過去に \"自由なマルチスレッド化\" したインタプリタ (供用されるデータを細かい粒度でロックする) " +"が開発されましたが、一般的なシングルプロセッサの場合のパフォーマンスが悪かったので成功しませんでした。このパフォーマンスの問題を克服しようとすると、実装がより複雑になり保守コストが増加すると考えられています。" -#: ../../glossary.rst:656 +#: ../../glossary.rst:519 msgid "hash-based pyc" msgstr "hash-based pyc" -#: ../../glossary.rst:658 +#: ../../glossary.rst:521 msgid "" "A bytecode cache file that uses the hash rather than the last-modified time " "of the corresponding source file to determine its validity. See :ref:`pyc-" "invalidation`." msgstr "" -"(ハッシュベース pyc ファイル) 正当性を判別するために、対応するソースファイル" -"の最終更新時刻ではなくハッシュ値を使用するバイトコードのキャッシュファイルで" -"す。:ref:`pyc-invalidation` を参照してください。" +"(ハッシュベース pyc ファイル) " +"正当性を判別するために、対応するソースファイルの最終更新時刻ではなくハッシュ値を使用するバイトコードのキャッシュファイルです。" -#: ../../glossary.rst:661 +#: ../../glossary.rst:524 msgid "hashable" msgstr "hashable" -#: ../../glossary.rst:663 +#: ../../glossary.rst:526 msgid "" "An object is *hashable* if it has a hash value which never changes during " -"its lifetime (it needs a :meth:`~object.__hash__` method), and can be " -"compared to other objects (it needs an :meth:`~object.__eq__` method). " -"Hashable objects which compare equal must have the same hash value." +"its lifetime (it needs a :meth:`__hash__` method), and can be compared to " +"other objects (it needs an :meth:`__eq__` method). Hashable objects which " +"compare equal must have the same hash value." msgstr "" +"(ハッシュ可能) *ハッシュ可能* なオブジェクトとは、生存期間中変わらないハッシュ値を持ち (:meth:`__hash__` " +"メソッドが必要)、他のオブジェクトと比較ができる (:meth:`__eq__` メソッドが必要) " +"オブジェクトです。同値なハッシュ可能オブジェクトは必ず同じハッシュ値を持つ必要があります。" -#: ../../glossary.rst:669 +#: ../../glossary.rst:531 msgid "" "Hashability makes an object usable as a dictionary key and a set member, " "because these data structures use the hash value internally." -msgstr "" -"ハッシュ可能なオブジェクトは辞書のキーや集合のメンバーとして使えます。辞書や" -"集合のデータ構造は内部でハッシュ値を使っているからです。" +msgstr "ハッシュ可能なオブジェクトは辞書のキーや集合のメンバーとして使えます。辞書や集合のデータ構造は内部でハッシュ値を使っているからです。" -#: ../../glossary.rst:672 +#: ../../glossary.rst:534 msgid "" -"Most of Python's immutable built-in objects are hashable; mutable containers " -"(such as lists or dictionaries) are not; immutable containers (such as " +"Most of Python's immutable built-in objects are hashable; mutable containers" +" (such as lists or dictionaries) are not; immutable containers (such as " "tuples and frozensets) are only hashable if their elements are hashable. " -"Objects which are instances of user-defined classes are hashable by " -"default. They all compare unequal (except with themselves), and their hash " -"value is derived from their :func:`id`." -msgstr "" -"Python のイミュータブルな組み込みオブジェクトは、ほとんどがハッシュ可能です。" -"(リストや辞書のような) ミュータブルなコンテナはハッシュ不可能です。(タプルや " -"frozenset のような) イミュータブルなコンテナは、要素がハッシュ可能であるとき" -"のみハッシュ可能です。\n" -"ユーザー定義のクラスのインスタンスであるようなオブジェクトはデフォルトでハッ" -"シュ可能です。\n" -"それらは全て (自身を除いて) 比較結果は非等価であり、ハッシュ値は :func:`id` " -"より得られます。" - -#: ../../glossary.rst:679 -msgid "IDLE" -msgstr "IDLE" - -#: ../../glossary.rst:681 -msgid "" -"An Integrated Development and Learning Environment for Python. :ref:`idle` " -"is a basic editor and interpreter environment which ships with the standard " -"distribution of Python." +"Objects which are instances of user-defined classes are hashable by default." +" They all compare unequal (except with themselves), and their hash value is" +" derived from their :func:`id`." msgstr "" -"Python の統合開発環境 (Integrated DeveLopment Environment)及び学習環境 " -"(Learning Environment) です。:ref:`idle` は Python の標準的な配布に同梱されて" -"いる基本的な機能のエディタとインタプリタ環境です。" +"Python のイミュータブルな組み込みオブジェクトは、ほとんどがハッシュ可能です。(リストや辞書のような) ミュータブルなコンテナはハッシュ不可能です。(タプルや frozenset のような) イミュータブルなコンテナは、要素がハッシュ可能であるときのみハッシュ可能です。\n" +"ユーザー定義のクラスのインスタンスであるようなオブジェクトはデフォルトでハッシュ可能です。\n" +"それらは全て (自身を除いて) 比較結果は非等価であり、ハッシュ値は :func:`id` より得られます。" -#: ../../glossary.rst:684 -msgid "immortal" -msgstr "永続オブジェクト (immortal)" - -#: ../../glossary.rst:686 -msgid "" -"*Immortal objects* are a CPython implementation detail introduced in :pep:" -"`683`." -msgstr "" - -#: ../../glossary.rst:689 -msgid "" -"If an object is immortal, its :term:`reference count` is never modified, and " -"therefore it is never deallocated while the interpreter is running. For " -"example, :const:`True` and :const:`None` are immortal in CPython." -msgstr "" +#: ../../glossary.rst:541 +msgid "IDLE" +msgstr "IDLE" -#: ../../glossary.rst:693 +#: ../../glossary.rst:543 msgid "" -"Immortal objects can be identified via :func:`sys._is_immortal`, or via :c:" -"func:`PyUnstable_IsImmortal` in the C API." +"An Integrated Development Environment for Python. IDLE is a basic editor " +"and interpreter environment which ships with the standard distribution of " +"Python." msgstr "" +"Python の統合開発環境 (Integrated DeveLopment Environment) です。IDLE は Python " +"の標準的な配布に同梱されている基本的な機能のエディタとインタプリタ環境です。" -#: ../../glossary.rst:695 +#: ../../glossary.rst:546 msgid "immutable" msgstr "immutable" -#: ../../glossary.rst:697 +#: ../../glossary.rst:548 msgid "" "An object with a fixed value. Immutable objects include numbers, strings " "and tuples. Such an object cannot be altered. A new object has to be " @@ -1551,279 +1178,251 @@ msgid "" "in places where a constant hash value is needed, for example as a key in a " "dictionary." msgstr "" -"(イミュータブル) 固定の値を持ったオブジェクトです。イミュータブルなオブジェク" -"トには、数値、文字列、およびタプルなどがあります。これらのオブジェクトは値を" -"変えられません。別の値を記憶させる際には、新たなオブジェクトを作成しなければ" -"なりません。イミュータブルなオブジェクトは、固定のハッシュ値が必要となる状況" -"で重要な役割を果たします。辞書のキーがその例です。" +"(イミュータブル) " +"固定の値を持ったオブジェクトです。イミュータブルなオブジェクトには、数値、文字列、およびタプルなどがあります。これらのオブジェクトは値を変えられません。別の値を記憶させる際には、新たなオブジェクトを作成しなければなりません。イミュータブルなオブジェクトは、固定のハッシュ値が必要となる状況で重要な役割を果たします。辞書のキーがその例です。" -#: ../../glossary.rst:702 +#: ../../glossary.rst:553 msgid "import path" msgstr "import path" -#: ../../glossary.rst:704 +#: ../../glossary.rst:555 msgid "" -"A list of locations (or :term:`path entries `) that are searched " -"by the :term:`path based finder` for modules to import. During import, this " -"list of locations usually comes from :data:`sys.path`, but for subpackages " +"A list of locations (or :term:`path entries `) that are searched" +" by the :term:`path based finder` for modules to import. During import, this" +" list of locations usually comes from :data:`sys.path`, but for subpackages " "it may also come from the parent package's ``__path__`` attribute." msgstr "" -":term:`path based finder` が import するモジュールを検索する場所 (または :" -"term:`path entry`) のリスト。 import 中、このリストは通常 :data:`sys.path` か" -"ら来ますが、サブパッケージの場合は親パッケージの ``__path__`` 属性からも来ま" -"す。" +":term:`path based finder` が import するモジュールを検索する場所 (または :term:`path entry`) " +"のリスト。 import 中、このリストは通常 :data:`sys.path` から来ますが、サブパッケージの場合は親パッケージの " +"``__path__`` 属性からも来ます。" -#: ../../glossary.rst:709 +#: ../../glossary.rst:560 msgid "importing" msgstr "importing" -#: ../../glossary.rst:711 +#: ../../glossary.rst:562 msgid "" "The process by which Python code in one module is made available to Python " "code in another module." -msgstr "" -"あるモジュールの Python コードが別のモジュールの Python コードで使えるように" -"する処理です。" +msgstr "あるモジュールの Python コードが別のモジュールの Python コードで使えるようにする処理です。" -#: ../../glossary.rst:713 +#: ../../glossary.rst:564 msgid "importer" msgstr "importer" -#: ../../glossary.rst:715 +#: ../../glossary.rst:566 msgid "" -"An object that both finds and loads a module; both a :term:`finder` and :" -"term:`loader` object." -msgstr "" -"モジュールを探してロードするオブジェクト。 :term:`finder` と :term:`loader` " -"のどちらでもあるオブジェクト。" +"An object that both finds and loads a module; both a :term:`finder` and " +":term:`loader` object." +msgstr "モジュールを探してロードするオブジェクト。 :term:`finder` と :term:`loader` のどちらでもあるオブジェクト。" -#: ../../glossary.rst:717 +#: ../../glossary.rst:568 msgid "interactive" msgstr "interactive" -#: ../../glossary.rst:719 +#: ../../glossary.rst:570 msgid "" "Python has an interactive interpreter which means you can enter statements " "and expressions at the interpreter prompt, immediately execute them and see " "their results. Just launch ``python`` with no arguments (possibly by " "selecting it from your computer's main menu). It is a very powerful way to " -"test out new ideas or inspect modules and packages (remember ``help(x)``). " -"For more on interactive mode, see :ref:`tut-interac`." +"test out new ideas or inspect modules and packages (remember ``help(x)``)." msgstr "" +"(対話的) Python には対話的インタプリタがあり、文や式をインタプリタのプロンプトに入力すると即座に実行されて結果を見ることができます。 " +"``python`` と何も引数を与えずに実行してください。(コンピュータのメインメニューから " +"Pythonの対話的インタプリタを起動できるかもしれません。) " +"対話的インタプリタは、新しいアイデアを試してみたり、モジュールやパッケージの中を覗いてみる(``help(x)`` を覚えておいてください) " +"のに非常に便利なツールです。" -#: ../../glossary.rst:726 +#: ../../glossary.rst:576 msgid "interpreted" msgstr "interpreted" -#: ../../glossary.rst:728 +#: ../../glossary.rst:578 msgid "" "Python is an interpreted language, as opposed to a compiled one, though the " -"distinction can be blurry because of the presence of the bytecode compiler. " -"This means that source files can be run directly without explicitly creating " -"an executable which is then run. Interpreted languages typically have a " -"shorter development/debug cycle than compiled ones, though their programs " -"generally also run more slowly. See also :term:`interactive`." -msgstr "" -"Python はインタプリタ形式の言語であり、コンパイラ言語の対極に位置します。 (バ" -"イトコードコンパイラがあるために、この区別は曖昧ですが。) ここでのインタプリ" -"タ言語とは、ソースコードのファイルを、まず実行可能形式にしてから実行させると" -"いった操作なしに、直接実行できることを意味します。インタプリタ形式の言語は通" -"常、コンパイラ形式の言語よりも開発/デバッグのサイクルは短いものの、プログラ" -"ムの実行は一般に遅いです。 :term:`対話的 ` も参照してください。" +"distinction can be blurry because of the presence of the bytecode compiler." +" This means that source files can be run directly without explicitly " +"creating an executable which is then run. Interpreted languages typically " +"have a shorter development/debug cycle than compiled ones, though their " +"programs generally also run more slowly. See also :term:`interactive`." +msgstr "" +"Python はインタプリタ形式の言語であり、コンパイラ言語の対極に位置します。 (バイトコードコンパイラがあるために、この区別は曖昧ですが。) " +"ここでのインタプリタ言語とは、ソースコードのファイルを、まず実行可能形式にしてから実行させるといった操作なしに、直接実行できることを意味します。インタプリタ形式の言語は通常、コンパイラ形式の言語よりも開発/デバッグのサイクルは短いものの、プログラムの実行は一般に遅いです。" +" :term:`対話的 ` も参照してください。" -#: ../../glossary.rst:735 +#: ../../glossary.rst:585 msgid "interpreter shutdown" msgstr "interpreter shutdown" -#: ../../glossary.rst:737 +#: ../../glossary.rst:587 msgid "" -"When asked to shut down, the Python interpreter enters a special phase where " -"it gradually releases all allocated resources, such as modules and various " -"critical internal structures. It also makes several calls to the :term:" -"`garbage collector `. This can trigger the execution of " -"code in user-defined destructors or weakref callbacks. Code executed during " -"the shutdown phase can encounter various exceptions as the resources it " -"relies on may not function anymore (common examples are library modules or " -"the warnings machinery)." -msgstr "" -"Python インタープリターはシャットダウンを要請された時に、モジュールやすべての" -"クリティカルな内部構造をなどの、すべての確保したリソースを段階的に開放する、" -"特別なフェーズに入ります。\n" -"このフェーズは :term:`ガベージコレクタ ` を複数回呼び出し" -"ます。\n" -"これによりユーザー定義のデストラクターや weakref コールバックが呼び出されるこ" -"とがあります。\n" -"シャットダウンフェーズ中に実行されるコードは、それが依存するリソースがすでに" -"機能しない(よくある例はライブラリーモジュールや warning 機構です) ために様々" -"な例外に直面します。" - -#: ../../glossary.rst:746 +"When asked to shut down, the Python interpreter enters a special phase where" +" it gradually releases all allocated resources, such as modules and various " +"critical internal structures. It also makes several calls to the " +":term:`garbage collector `. This can trigger the " +"execution of code in user-defined destructors or weakref callbacks. Code " +"executed during the shutdown phase can encounter various exceptions as the " +"resources it relies on may not function anymore (common examples are library" +" modules or the warnings machinery)." +msgstr "" +"Python インタープリターはシャットダウンを要請された時に、モジュールやすべてのクリティカルな内部構造をなどの、すべての確保したリソースを段階的に開放する、特別なフェーズに入ります。\n" +"このフェーズは :term:`ガベージコレクタ ` を複数回呼び出します。\n" +"これによりユーザー定義のデストラクターや weakref コールバックが呼び出されることがあります。\n" +"シャットダウンフェーズ中に実行されるコードは、それが依存するリソースがすでに機能しない(よくある例はライブラリーモジュールや warning 機構です) ために様々な例外に直面します。" + +#: ../../glossary.rst:596 msgid "" "The main reason for interpreter shutdown is that the ``__main__`` module or " "the script being run has finished executing." -msgstr "" -"インタープリタがシャットダウンする主な理由は ``__main__`` モジュールや実行さ" -"れていたスクリプトの実行が終了したことです。" +msgstr "インタープリタがシャットダウンする主な理由は ``__main__`` モジュールや実行されていたスクリプトの実行が終了したことです。" -#: ../../glossary.rst:748 +#: ../../glossary.rst:598 msgid "iterable" msgstr "iterable" -#: ../../glossary.rst:750 +#: ../../glossary.rst:600 msgid "" "An object capable of returning its members one at a time. Examples of " "iterables include all sequence types (such as :class:`list`, :class:`str`, " -"and :class:`tuple`) and some non-sequence types like :class:`dict`, :term:" -"`file objects `, and objects of any classes you define with an :" -"meth:`~object.__iter__` method or with a :meth:`~object.__getitem__` method " -"that implements :term:`sequence` semantics." +"and :class:`tuple`) and some non-sequence types like :class:`dict`, " +":term:`file objects `, and objects of any classes you define " +"with an :meth:`__iter__` method or with a :meth:`__getitem__` method that " +"implements :term:`Sequence ` semantics." msgstr "" +"(反復可能オブジェクト) 要素を一度に 1 つずつ返せるオブジェクトです。\n" +"反復可能オブジェクトの例には、(:class:`list`, :class:`str`, :class:`tuple` といった) 全てのシーケンス型や、 :class:`dict` や :term:`ファイルオブジェクト ` といった幾つかの非シーケンス型、 あるいは :term:`Sequence ` 意味論を実装した :meth:`__iter__` メソッドか :meth:`__getitem__` メソッドを持つ任意のクラスのインスタンスが含まれます。" -#: ../../glossary.rst:758 +#: ../../glossary.rst:607 msgid "" "Iterables can be used in a :keyword:`for` loop and in many other places " "where a sequence is needed (:func:`zip`, :func:`map`, ...). When an " -"iterable object is passed as an argument to the built-in function :func:" -"`iter`, it returns an iterator for the object. This iterator is good for " -"one pass over the set of values. When using iterables, it is usually not " -"necessary to call :func:`iter` or deal with iterator objects yourself. The :" -"keyword:`for` statement does that automatically for you, creating a " -"temporary unnamed variable to hold the iterator for the duration of the " -"loop. See also :term:`iterator`, :term:`sequence`, and :term:`generator`." -msgstr "" - -#: ../../glossary.rst:768 +"iterable object is passed as an argument to the built-in function " +":func:`iter`, it returns an iterator for the object. This iterator is good " +"for one pass over the set of values. When using iterables, it is usually " +"not necessary to call :func:`iter` or deal with iterator objects yourself. " +"The ``for`` statement does that automatically for you, creating a temporary " +"unnamed variable to hold the iterator for the duration of the loop. See " +"also :term:`iterator`, :term:`sequence`, and :term:`generator`." +msgstr "" +"反復可能オブジェクトは :keyword:`for` ループ内やその他多くのシーケンス (訳注: ここでのシーケンスとは、シーケンス型ではなくただの列という意味)が必要となる状況 (:func:`zip`, :func:`map`, ...) で利用できます。\n" +"反復可能オブジェクトを組み込み関数 :func:`iter` の引数として渡すと、 オブジェクトに対するイテレータを返します。\n" +"このイテレータは一連の値を引き渡す際に便利です。\n" +"通常は反復可能オブジェクトを使う際には、 :func:`iter` を呼んだりイテレータオブジェクトを自分で操作する必要はありません。\n" +"``for`` 文ではこの操作を自動的に行い、一時的な無名の変数を作成してループを回している間イテレータを保持します。\n" +":term:`イテレータ ` 、 :term:`シーケンス ` 、 :term:`ジェネレータ ` も参照してください。 " + +#: ../../glossary.rst:617 msgid "iterator" msgstr "iterator" -#: ../../glossary.rst:770 +#: ../../glossary.rst:619 msgid "" -"An object representing a stream of data. Repeated calls to the iterator's :" -"meth:`~iterator.__next__` method (or passing it to the built-in function :" -"func:`next`) return successive items in the stream. When no more data are " +"An object representing a stream of data. Repeated calls to the iterator's " +":meth:`~iterator.__next__` method (or passing it to the built-in function " +":func:`next`) return successive items in the stream. When no more data are " "available a :exc:`StopIteration` exception is raised instead. At this " -"point, the iterator object is exhausted and any further calls to its :meth:`!" -"__next__` method just raise :exc:`StopIteration` again. Iterators are " -"required to have an :meth:`~iterator.__iter__` method that returns the " -"iterator object itself so every iterator is also iterable and may be used in " -"most places where other iterables are accepted. One notable exception is " -"code which attempts multiple iteration passes. A container object (such as " -"a :class:`list`) produces a fresh new iterator each time you pass it to the :" -"func:`iter` function or use it in a :keyword:`for` loop. Attempting this " -"with an iterator will just return the same exhausted iterator object used in " -"the previous iteration pass, making it appear like an empty container." -msgstr "" -"データの流れを表現するオブジェクトです。イテレータの :meth:`~iterator." -"__next__` メソッドを繰り返し呼び出す (または組み込み関数 :func:`next` に渡" -"す) と、流れの中の要素を一つずつ返します。データがなくなると、代わりに :exc:" -"`StopIteration` 例外を送出します。その時点で、イテレータオブジェクトは尽きて" -"おり、それ以降は :meth:`!__next__` を何度呼んでも :exc:`StopIteration` を送出" -"します。イテレータは、そのイテレータオブジェクト自体を返す :meth:`~iterator." -"__iter__` メソッドを実装しなければならないので、イテレータは他の iterable を" -"受理するほとんどの場所で利用できます。はっきりとした例外は複数の反復を行うよ" -"うなコードです。 (:class:`list` のような) コンテナオブジェクトは、自身を :" -"func:`iter` 関数にオブジェクトに渡したり :keyword:`for` ループ内で使うたび" -"に、新たな未使用のイテレータを生成します。これをイテレータで行おうとすると、" -"前回のイテレーションで使用済みの同じイテレータオブジェクトを単純に返すため、" -"空のコンテナのようになってしまします。" - -#: ../../glossary.rst:785 +"point, the iterator object is exhausted and any further calls to its " +":meth:`__next__` method just raise :exc:`StopIteration` again. Iterators " +"are required to have an :meth:`__iter__` method that returns the iterator " +"object itself so every iterator is also iterable and may be used in most " +"places where other iterables are accepted. One notable exception is code " +"which attempts multiple iteration passes. A container object (such as a " +":class:`list`) produces a fresh new iterator each time you pass it to the " +":func:`iter` function or use it in a :keyword:`for` loop. Attempting this " +"with an iterator will just return the same exhausted iterator object used in" +" the previous iteration pass, making it appear like an empty container." +msgstr "" +"(イテレータ) データの流れを表現するオブジェクトです。イテレータの :meth:`~iterator.__next__` メソッドを繰り返し呼び出す " +"(または組み込み関数 :func:`next` に渡す) と、流れの中の要素を一つずつ返します。データがなくなると、代わりに " +":exc:`StopIteration` 例外を送出します。その時点で、イテレータオブジェクトは尽きており、それ以降は :meth:`__next__`" +" を何度呼んでも :exc:`StopIteration` を送出します。イテレータは、そのイテレータオブジェクト自体を返す " +":meth:`__iter__` メソッドを実装しなければならないので、イテレータは他の iterable " +"を受理するほとんどの場所で利用できます。はっきりとした例外は複数の反復を行うようなコードです。 (:class:`list` のような) " +"コンテナオブジェクトは、自身を :func:`iter` 関数にオブジェクトに渡したり :keyword:`for` " +"ループ内で使うたびに、新たな未使用のイテレータを生成します。これをイテレータで行おうとすると、前回のイテレーションで使用済みの同じイテレータオブジェクトを単純に返すため、空のコンテナのようになってしまします。" + +#: ../../glossary.rst:634 msgid "More information can be found in :ref:`typeiter`." msgstr "詳細な情報は :ref:`typeiter` にあります。" -#: ../../glossary.rst:789 -msgid "" -"CPython does not consistently apply the requirement that an iterator define :" -"meth:`~iterator.__iter__`. And also please note that the free-threading " -"CPython does not guarantee the thread-safety of iterator operations." -msgstr "" - -#: ../../glossary.rst:794 +#: ../../glossary.rst:635 msgid "key function" msgstr "key function" -#: ../../glossary.rst:796 +#: ../../glossary.rst:637 msgid "" -"A key function or collation function is a callable that returns a value used " -"for sorting or ordering. For example, :func:`locale.strxfrm` is used to " +"A key function or collation function is a callable that returns a value used" +" for sorting or ordering. For example, :func:`locale.strxfrm` is used to " "produce a sort key that is aware of locale specific sort conventions." msgstr "" -"(キー関数) キー関数、あるいは照合関数とは、ソートや順序比較のための値を返す呼" -"び出し可能オブジェクト(callable)です。例えば、 :func:`locale.strxfrm` をキー" -"関数に使えば、ロケール依存のソートの慣習にのっとったソートキーを返します。" +"(キー関数) キー関数、あるいは照合関数とは、ソートや順序比較のための値を返す呼び出し可能オブジェクト(callable)です。例えば、 " +":func:`locale.strxfrm` をキー関数に使えば、ロケール依存のソートの慣習にのっとったソートキーを返します。" -#: ../../glossary.rst:801 +#: ../../glossary.rst:642 msgid "" -"A number of tools in Python accept key functions to control how elements are " -"ordered or grouped. They include :func:`min`, :func:`max`, :func:`sorted`, :" -"meth:`list.sort`, :func:`heapq.merge`, :func:`heapq.nsmallest`, :func:`heapq." -"nlargest`, and :func:`itertools.groupby`." +"A number of tools in Python accept key functions to control how elements are" +" ordered or grouped. They include :func:`min`, :func:`max`, :func:`sorted`," +" :meth:`list.sort`, :func:`heapq.merge`, :func:`heapq.nsmallest`, " +":func:`heapq.nlargest`, and :func:`itertools.groupby`." msgstr "" -"Python の多くのツールはキー関数を受け取り要素の並び順やグループ化を管理しま" -"す。\n" -":func:`min`, :func:`max`, :func:`sorted`, :meth:`list.sort`, :func:`heapq." -"merge`, :func:`heapq.nsmallest`, :func:`heapq.nlargest`, :func:`itertools." -"groupby` 等があります。" +"Python の多くのツールはキー関数を受け取り要素の並び順やグループ化を管理します。\n" +":func:`min`, :func:`max`, :func:`sorted`, :meth:`list.sort`, :func:`heapq.merge`, :func:`heapq.nsmallest`, :func:`heapq.nlargest`, :func:`itertools.groupby` 等があります。" -#: ../../glossary.rst:807 +#: ../../glossary.rst:648 msgid "" -"There are several ways to create a key function. For example. the :meth:" -"`str.lower` method can serve as a key function for case insensitive sorts. " -"Alternatively, a key function can be built from a :keyword:`lambda` " -"expression such as ``lambda r: (r[0], r[2])``. Also, :func:`operator." -"attrgetter`, :func:`operator.itemgetter`, and :func:`operator.methodcaller` " -"are three key function constructors. See the :ref:`Sorting HOW TO " +"There are several ways to create a key function. For example. the " +":meth:`str.lower` method can serve as a key function for case insensitive " +"sorts. Alternatively, a key function can be built from a :keyword:`lambda` " +"expression such as ``lambda r: (r[0], r[2])``. Also, the :mod:`operator` " +"module provides three key function constructors: " +":func:`~operator.attrgetter`, :func:`~operator.itemgetter`, and " +":func:`~operator.methodcaller`. See the :ref:`Sorting HOW TO " "` for examples of how to create and use key functions." msgstr "" "キー関数を作る方法はいくつかあります。\n" -"例えば :meth:`str.lower` メソッドを大文字小文字を区別しないソートを行うキー関" -"数として使うことが出来ます。\n" -"あるいは、``lambda r: (r[0], r[2])`` のような :keyword:`lambda` 式からキー関" -"数を作ることができます。\n" -"また、:func:`operator.attrgetter`, :func:`operator.itemgetter`, :func:" -"`operator.methodcaller` の 3 つのキー関数コンストラクタがあります。\n" -"キー関数の作り方と使い方の例は :ref:`Sorting HOW TO ` を参照し" -"てください。" +"例えば :meth:`str.lower` メソッドを大文字小文字を区別しないソートを行うキー関数として使うことが出来ます。\n" +"あるいは、``lambda r: (r[0], r[2])`` のような :keyword:`lambda` 式からキー関数を作ることができます。\n" +"また、 :mod:`operator` モジュールは :func:`~operator.attrgetter`, :func:`~operator.itemgetter`, :func:`~operator.methodcaller` という 3 つのキー関数コンストラクタを提供しています。\n" +"キー関数の作り方と使い方の例は :ref:`Sorting HOW TO ` を参照してください。" -#: ../../glossary.rst:814 +#: ../../glossary.rst:656 msgid "keyword argument" msgstr "keyword argument" -#: ../../glossary.rst:816 ../../glossary.rst:1131 +#: ../../glossary.rst:658 ../../glossary.rst:935 msgid "See :term:`argument`." msgstr ":term:`実引数 ` を参照してください。" -#: ../../glossary.rst:817 +#: ../../glossary.rst:659 msgid "lambda" msgstr "lambda" -#: ../../glossary.rst:819 +#: ../../glossary.rst:661 msgid "" -"An anonymous inline function consisting of a single :term:`expression` which " -"is evaluated when the function is called. The syntax to create a lambda " +"An anonymous inline function consisting of a single :term:`expression` which" +" is evaluated when the function is called. The syntax to create a lambda " "function is ``lambda [parameters]: expression``" msgstr "" -"(ラムダ) 無名のインライン関数で、関数が呼び出されたときに評価される 1 つの :" -"term:`式 ` を含みます。ラムダ関数を作る構文は ``lambda " -"[parameters]: expression`` です。" +"(ラムダ) 無名のインライン関数で、関数が呼び出されたときに評価される 1 つの :term:`式 ` " +"を含みます。ラムダ関数を作る構文は ``lambda [parameters]: expression`` です。" -#: ../../glossary.rst:822 +#: ../../glossary.rst:664 msgid "LBYL" msgstr "LBYL" -#: ../../glossary.rst:824 +#: ../../glossary.rst:666 msgid "" -"Look before you leap. This coding style explicitly tests for pre-conditions " -"before making calls or lookups. This style contrasts with the :term:`EAFP` " -"approach and is characterized by the presence of many :keyword:`if` " +"Look before you leap. This coding style explicitly tests for pre-conditions" +" before making calls or lookups. This style contrasts with the :term:`EAFP`" +" approach and is characterized by the presence of many :keyword:`if` " "statements." msgstr "" -"「ころばぬ先の杖 (look before you leap)」 の略です。このコーディングスタイル" -"では、呼び出しや検索を行う前に、明示的に前提条件 (pre-condition) 判定を行いま" -"す。 :term:`EAFP` アプローチと対照的で、 :keyword:`if` 文がたくさん使われるの" -"が特徴的です。" +"「ころばぬ先の杖 (look before you leap)」 の略です。このコーディングスタイルでは、呼び出しや検索を行う前に、明示的に前提条件 " +"(pre-condition) 判定を行います。 :term:`EAFP` アプローチと対照的で、 :keyword:`if` " +"文がたくさん使われるのが特徴的です。" -#: ../../glossary.rst:829 +#: ../../glossary.rst:671 msgid "" "In a multi-threaded environment, the LBYL approach can risk introducing a " "race condition between \"the looking\" and \"the leaping\". For example, " @@ -1831,36 +1430,28 @@ msgid "" "thread removes *key* from *mapping* after the test, but before the lookup. " "This issue can be solved with locks or by using the EAFP approach." msgstr "" -"マルチスレッド化された環境では、LBYL アプローチは \"見る\" 過程と \"飛ぶ\" 過" -"程の競合状態を引き起こすリスクがあります。例えば、``if key in mapping: " -"return mapping[key]`` というコードは、判定の後、別のスレッドが探索の前に " -"*mapping* から *key* を取り除くと失敗します。この問題は、ロックするか EAFP ア" -"プローチを使うことで解決できます。" - -#: ../../glossary.rst:834 -msgid "lexical analyzer" -msgstr "" +"マルチスレッド化された環境では、LBYL アプローチは \"見る\" 過程と \"飛ぶ\" 過程の競合状態を引き起こすリスクがあります。例えば、``if" +" key in mapping: return mapping[key]`` というコードは、判定の後、別のスレッドが探索の前に *mapping* " +"から *key* を取り除くと失敗します。この問題は、ロックするか EAFP アプローチを使うことで解決できます。" -#: ../../glossary.rst:837 -msgid "Formal name for the *tokenizer*; see :term:`token`." -msgstr "" - -#: ../../glossary.rst:838 +#: ../../glossary.rst:676 msgid "list" msgstr "list" -#: ../../glossary.rst:840 +#: ../../glossary.rst:678 msgid "" "A built-in Python :term:`sequence`. Despite its name it is more akin to an " "array in other languages than to a linked list since access to elements is " -"*O*\\ (1)." +"O(1)." msgstr "" +"(リスト) Python の組み込みの :term:`シーケンス ` " +"です。リストという名前ですが、リンクリストではなく、他の言語で言う配列 (array) と同種のもので、要素へのアクセスは O(1) です。" -#: ../../glossary.rst:843 +#: ../../glossary.rst:681 msgid "list comprehension" msgstr "list comprehension" -#: ../../glossary.rst:845 +#: ../../glossary.rst:683 msgid "" "A compact way to process all or part of the elements in a sequence and " "return a list with the results. ``result = ['{:#04x}'.format(x) for x in " @@ -1868,97 +1459,58 @@ msgid "" "numbers (0x..) in the range from 0 to 255. The :keyword:`if` clause is " "optional. If omitted, all elements in ``range(256)`` are processed." msgstr "" -"(リスト内包表記) シーケンス中の全てあるいは一部の要素を処理して、その結果から" -"なるリストを返す、コンパクトな方法です。 ``result = ['{:#04x}'.format(x) for " -"x in range(256) if x % 2 == 0]`` とすると、 0 から 255 までの偶数を 16進数表" -"記 (0x..) した文字列からなるリストを生成します。 :keyword:`if` 節はオプション" -"です。 :keyword:`if` 節がない場合、 ``range(256)`` の全ての要素が処理されま" -"す。" +"(リスト内包表記) シーケンス中の全てあるいは一部の要素を処理して、その結果からなるリストを返す、コンパクトな方法です。 ``result = " +"['{:#04x}'.format(x) for x in range(256) if x % 2 == 0]`` とすると、 0 から 255 " +"までの偶数を 16進数表記 (0x..) した文字列からなるリストを生成します。 :keyword:`if` 節はオプションです。 " +":keyword:`if` 節がない場合、 ``range(256)`` の全ての要素が処理されます。" -#: ../../glossary.rst:851 +#: ../../glossary.rst:689 msgid "loader" msgstr "loader" -#: ../../glossary.rst:853 -msgid "" -"An object that loads a module. It must define the :meth:`!exec_module` and :" -"meth:`!create_module` methods to implement the :class:`~importlib.abc." -"Loader` interface. A loader is typically returned by a :term:`finder`. See " -"also:" -msgstr "" - -#: ../../glossary.rst:859 -msgid ":ref:`finders-and-loaders`" -msgstr "" - -#: ../../glossary.rst:860 -msgid ":class:`importlib.abc.Loader`" -msgstr "" - -#: ../../glossary.rst:861 -msgid ":pep:`302`" -msgstr ":pep:`302`" - -#: ../../glossary.rst:862 -msgid "locale encoding" -msgstr "ロケールエンコーディング" - -#: ../../glossary.rst:864 +#: ../../glossary.rst:691 msgid "" -"On Unix, it is the encoding of the LC_CTYPE locale. It can be set with :func:" -"`locale.setlocale(locale.LC_CTYPE, new_locale) `." +"An object that loads a module. It must define a method named " +":meth:`load_module`. A loader is typically returned by a :term:`finder`. See" +" :pep:`302` for details and :class:`importlib.abc.Loader` for an " +":term:`abstract base class`." msgstr "" +"モジュールをロードするオブジェクト。 :meth:`load_module` という名前のメソッドを定義していなければなりません。ローダーは一般的に " +":term:`finder` から返されます。詳細は :pep:`302` を、 :term:`abstract base class` については " +":class:`importlib.abc.Loader` を参照してください。" -#: ../../glossary.rst:867 -msgid "On Windows, it is the ANSI code page (ex: ``\"cp1252\"``)." -msgstr "" - -#: ../../glossary.rst:869 -msgid "" -"On Android and VxWorks, Python uses ``\"utf-8\"`` as the locale encoding." -msgstr "" - -#: ../../glossary.rst:871 -msgid ":func:`locale.getencoding` can be used to get the locale encoding." -msgstr "" - -#: ../../glossary.rst:873 -msgid "See also the :term:`filesystem encoding and error handler`." -msgstr "" - -#: ../../glossary.rst:874 +#: ../../glossary.rst:695 msgid "magic method" msgstr "magic method" -#: ../../glossary.rst:878 +#: ../../glossary.rst:699 msgid "An informal synonym for :term:`special method`." msgstr ":term:`special method` のくだけた同義語です。" -#: ../../glossary.rst:879 +#: ../../glossary.rst:700 msgid "mapping" msgstr "mapping" -#: ../../glossary.rst:881 +#: ../../glossary.rst:702 msgid "" "A container object that supports arbitrary key lookups and implements the " -"methods specified in the :class:`collections.abc.Mapping` or :class:" -"`collections.abc.MutableMapping` :ref:`abstract base classes `. Examples include :class:`dict`, :class:" -"`collections.defaultdict`, :class:`collections.OrderedDict` and :class:" -"`collections.Counter`." -msgstr "" -"(マッピング) 任意のキー探索をサポートしていて、 :class:`collections.abc." -"Mapping` か :class:`collections.abc.MutableMapping` の :ref:`抽象基底クラス " -"` で指定されたメソッドを実装しているコンテ" -"ナオブジェクトです。例えば、 :class:`dict`, :class:`collections." -"defaultdict`, :class:`collections.OrderedDict`, :class:`collections.Counter` " -"などです。" - -#: ../../glossary.rst:887 +"methods specified in the :class:`~collections.abc.Mapping` or " +":class:`~collections.abc.MutableMapping` :ref:`abstract base classes " +"`. Examples include :class:`dict`, " +":class:`collections.defaultdict`, :class:`collections.OrderedDict` and " +":class:`collections.Counter`." +msgstr "" +"(マッピング) 任意のキー探索をサポートしていて、 :class:`~collections.abc.Mapping` か " +":class:`~collections.abc.MutableMapping` の :ref:`抽象基底クラス ` で指定されたメソッドを実装しているコンテナオブジェクトです。例えば、 :class:`dict`, " +":class:`collections.defaultdict`, :class:`collections.OrderedDict`, " +":class:`collections.Counter` などです。" + +#: ../../glossary.rst:708 msgid "meta path finder" msgstr "meta path finder" -#: ../../glossary.rst:889 +#: ../../glossary.rst:710 msgid "" "A :term:`finder` returned by a search of :data:`sys.meta_path`. Meta path " "finders are related to, but different from :term:`path entry finders ` として受け取ります (この第一引数は通常 ``self`` と呼ばれます)。 :" -"term:`関数 ` と :term:`ネストされたスコープ ` も参照" -"してください。" +"(メソッド) クラス本体の中で定義された関数。そのクラスのインスタンスの属性として呼び出された場合、メソッドはインスタンスオブジェクトを第一 " +":term:`引数 ` として受け取ります (この第一引数は通常 ``self`` と呼ばれます)。 :term:`関数 " +"` と :term:`ネストされたスコープ ` も参照してください。" -#: ../../glossary.rst:914 +#: ../../glossary.rst:735 msgid "method resolution order" msgstr "method resolution order" -#: ../../glossary.rst:916 +#: ../../glossary.rst:737 msgid "" "Method Resolution Order is the order in which base classes are searched for " -"a member during lookup. See :ref:`python_2.3_mro` for details of the " +"a member during lookup. See `The Python 2.3 Method Resolution Order " +"`_ for details of the " "algorithm used by the Python interpreter since the 2.3 release." msgstr "" +"(メソッド解決順序)\n" +"探索中に基底クラスが構成要素を検索される順番です。\n" +"2.3 以降の Python インタープリタが使用するアルゴリズムの詳細については `The Python 2.3 Method Resolution Order `_ を参照してください。" -#: ../../glossary.rst:919 +#: ../../glossary.rst:741 msgid "module" msgstr "module" -#: ../../glossary.rst:921 +#: ../../glossary.rst:743 msgid "" "An object that serves as an organizational unit of Python code. Modules " "have a namespace containing arbitrary Python objects. Modules are loaded " "into Python by the process of :term:`importing`." msgstr "" -"(モジュール) Python コードの組織単位としてはたらくオブジェクトです。モジュー" -"ルは任意の Python オブジェクトを含む名前空間を持ちます。モジュールは :term:" -"`importing` の処理によって Python に読み込まれます。" +"(モジュール) Python コードの組織単位としてはたらくオブジェクトです。モジュールは任意の Python " +"オブジェクトを含む名前空間を持ちます。モジュールは :term:`importing` の処理によって Python に読み込まれます。" -#: ../../glossary.rst:925 +#: ../../glossary.rst:747 msgid "See also :term:`package`." msgstr ":term:`パッケージ ` を参照してください。" -#: ../../glossary.rst:926 +#: ../../glossary.rst:748 msgid "module spec" msgstr "module spec" -#: ../../glossary.rst:928 +#: ../../glossary.rst:750 msgid "" -"A namespace containing the import-related information used to load a module. " -"An instance of :class:`importlib.machinery.ModuleSpec`." +"A namespace containing the import-related information used to load a module." +" An instance of :class:`importlib.machinery.ModuleSpec`." msgstr "" "モジュールをロードするのに使われるインポート関連の情報を含む名前空間です。\n" ":class:`importlib.machinery.ModuleSpec` のインスタンスです。" -#: ../../glossary.rst:931 -msgid "See also :ref:`module-specs`." -msgstr "" - -#: ../../glossary.rst:932 +#: ../../glossary.rst:752 msgid "MRO" msgstr "MRO" -#: ../../glossary.rst:934 +#: ../../glossary.rst:754 msgid "See :term:`method resolution order`." msgstr ":term:`method resolution order` を参照してください。" -#: ../../glossary.rst:935 +#: ../../glossary.rst:755 msgid "mutable" msgstr "mutable" -#: ../../glossary.rst:937 +#: ../../glossary.rst:757 msgid "" -"Mutable objects can change their value but keep their :func:`id`. See also :" -"term:`immutable`." +"Mutable objects can change their value but keep their :func:`id`. See also " +":term:`immutable`." msgstr "" -"(ミュータブル) ミュータブルなオブジェクトは、 :func:`id` を変えることなく値を" -"変更できます。 :term:`イミュータブル `) も参照してください。" +"(ミュータブル) ミュータブルなオブジェクトは、 :func:`id` を変えることなく値を変更できます。 :term:`イミュータブル " +"`) も参照してください。" -#: ../../glossary.rst:939 +#: ../../glossary.rst:759 msgid "named tuple" msgstr "named tuple" -#: ../../glossary.rst:941 +#: ../../glossary.rst:761 msgid "" "The term \"named tuple\" applies to any type or class that inherits from " "tuple and whose indexable elements are also accessible using named " "attributes. The type or class may have other features as well." msgstr "" -"\"名前付きタプル\" という用語は、タプルを継承していて、インデックスが付く要素" -"に対し属性を使ってのアクセスもできる任意の型やクラスに応用されています。\n" +"\"名前付きタプル\" という用語は、タプルを継承していて、インデックスが付く要素に対し属性を使ってのアクセスもできる任意の型やクラスに応用されています。\n" "その型やクラスは他の機能も持っていることもあります。" -#: ../../glossary.rst:945 +#: ../../glossary.rst:765 msgid "" -"Several built-in types are named tuples, including the values returned by :" -"func:`time.localtime` and :func:`os.stat`. Another example is :data:`sys." -"float_info`::" +"Several built-in types are named tuples, including the values returned by " +":func:`time.localtime` and :func:`os.stat`. Another example is " +":data:`sys.float_info`::" msgstr "" -":func:`time.localtime` や :func:`os.stat` の返り値を含むいくつかの組み込み型" -"は名前付きタプルです。\n" +":func:`time.localtime` や :func:`os.stat` の返り値を含むいくつかの組み込み型は名前付きタプルです。\n" "他の例は :data:`sys.float_info` です::" -#: ../../glossary.rst:949 -msgid "" -">>> sys.float_info[1] # indexed access\n" -"1024\n" -">>> sys.float_info.max_exp # named field access\n" -"1024\n" -">>> isinstance(sys.float_info, tuple) # kind of tuple\n" -"True" -msgstr "" - -#: ../../glossary.rst:956 +#: ../../glossary.rst:776 msgid "" "Some named tuples are built-in types (such as the above examples). " "Alternatively, a named tuple can be created from a regular class definition " "that inherits from :class:`tuple` and that defines named fields. Such a " -"class can be written by hand, or it can be created by inheriting :class:" -"`typing.NamedTuple`, or with the factory function :func:`collections." -"namedtuple`. The latter techniques also add some extra methods that may not " -"be found in hand-written or built-in named tuples." +"class can be written by hand or it can be created with the factory function " +":func:`collections.namedtuple`. The latter technique also adds some extra " +"methods that may not be found in hand-written or built-in named tuples." msgstr "" +"(上の例のように) いくつかの名前付きタプルは組み込み型になっています。\n" +"その他にも名前付きタプルは、通常のクラス定義で :class:`tuple` を継承し、名前のフィールドを定義して作成できます。\n" +"そのようなクラスは手動で書いたり、 :func:`collections.namedtuple` ファクトリ関数で作成したりできます。\n" +"後者の方法は、手動で書いた名前付きタプルや組み込みの名前付きタプルには無い付加的なメソッドを追加できます。" -#: ../../glossary.rst:964 +#: ../../glossary.rst:783 msgid "namespace" msgstr "namespace" -#: ../../glossary.rst:966 +#: ../../glossary.rst:785 msgid "" "The place where a variable is stored. Namespaces are implemented as " "dictionaries. There are the local, global and built-in namespaces as well " -"as nested namespaces in objects (in methods). Namespaces support modularity " -"by preventing naming conflicts. For instance, the functions :func:`builtins." -"open <.open>` and :func:`os.open` are distinguished by their namespaces. " -"Namespaces also aid readability and maintainability by making it clear which " -"module implements a function. For instance, writing :func:`random.seed` or :" -"func:`itertools.islice` makes it clear that those functions are implemented " -"by the :mod:`random` and :mod:`itertools` modules, respectively." -msgstr "" -"(名前空間) 変数が格納される場所です。名前空間は辞書として実装されます。名前空" -"間にはオブジェクトの (メソッドの) 入れ子になったものだけでなく、局所的なも" -"の、大域的なもの、そして組み込みのものがあります。名前空間は名前の衝突を防ぐ" -"ことによってモジュール性をサポートする。例えば関数 :func:`builtins.open <." -"open>` と :func:`os.open` は名前空間で区別されています。また、どのモジュール" -"が関数を実装しているか明示することによって名前空間は可読性と保守性を支援しま" -"す。例えば、:func:`random.seed` や :func:`itertools.islice` と書くと、それぞ" -"れモジュール :mod:`random` や :mod:`itertools` で実装されていることが明らかで" -"す。" - -#: ../../glossary.rst:976 +"as nested namespaces in objects (in methods). Namespaces support modularity" +" by preventing naming conflicts. For instance, the functions " +":func:`builtins.open <.open>` and :func:`os.open` are distinguished by their" +" namespaces. Namespaces also aid readability and maintainability by making " +"it clear which module implements a function. For instance, writing " +":func:`random.seed` or :func:`itertools.islice` makes it clear that those " +"functions are implemented by the :mod:`random` and :mod:`itertools` modules," +" respectively." +msgstr "" +"(名前空間) 変数が格納される場所です。名前空間は辞書として実装されます。名前空間にはオブジェクトの (メソッドの) " +"入れ子になったものだけでなく、局所的なもの、大域的なもの、そして組み込みのものがあります。名前空間は名前の衝突を防ぐことによってモジュール性をサポートする。例えば関数" +" :func:`builtins.open <.open>` と :func:`os.open` " +"は名前空間で区別されています。また、どのモジュールが関数を実装しているか明示することによって名前空間は可読性と保守性を支援します。例えば、:func:`random.seed`" +" や :func:`itertools.islice` と書くと、それぞれモジュール :mod:`random` や :mod:`itertools` " +"で実装されていることが明らかです。" + +#: ../../glossary.rst:795 msgid "namespace package" msgstr "namespace package" -#: ../../glossary.rst:978 -msgid "" -"A :term:`package` which serves only as a container for subpackages. " -"Namespace packages may have no physical representation, and specifically are " -"not like a :term:`regular package` because they have no ``__init__.py`` file." -msgstr "" - -#: ../../glossary.rst:983 -msgid "" -"Namespace packages allow several individually installable packages to have a " -"common parent package. Otherwise, it is recommended to use a :term:`regular " -"package`." -msgstr "" - -#: ../../glossary.rst:986 +#: ../../glossary.rst:797 msgid "" -"For more information, see :pep:`420` and :ref:`reference-namespace-package`." +"A :pep:`420` :term:`package` which serves only as a container for " +"subpackages. Namespace packages may have no physical representation, and " +"specifically are not like a :term:`regular package` because they have no " +"``__init__.py`` file." msgstr "" +"(名前空間パッケージ) サブパッケージのコンテナとしてのみ提供される :pep:`420` で定義された :term:`package` " +"です。名前空間パッケージは物理的な表現を持たないことができ、 ``__init__.py`` ファイルを持たないため、 :term:`regular " +"package` とは異なります。" -#: ../../glossary.rst:988 +#: ../../glossary.rst:802 msgid "See also :term:`module`." msgstr ":term:`module` を参照してください。" -#: ../../glossary.rst:989 +#: ../../glossary.rst:803 msgid "nested scope" msgstr "nested scope" -#: ../../glossary.rst:991 +#: ../../glossary.rst:805 msgid "" "The ability to refer to a variable in an enclosing definition. For " "instance, a function defined inside another function can refer to variables " @@ -2198,117 +1723,88 @@ msgid "" "the innermost scope. Likewise, global variables read and write to the " "global namespace. The :keyword:`nonlocal` allows writing to outer scopes." msgstr "" -"(ネストされたスコープ) 外側で定義されている変数を参照する機能です。例えば、あ" -"る関数が別の関数の中で定義されている場合、内側の関数は外側の関数中の変数を参" -"照できます。ネストされたスコープはデフォルトでは変数の参照だけができ、変数の" -"代入はできないので注意してください。ローカル変数は、最も内側のスコープで変数" -"を読み書きします。同様に、グローバル変数を使うとグローバル名前空間の値を読み" -"書きします。 :keyword:`nonlocal` で外側の変数に書き込めます。" +"(ネストされたスコープ) " +"外側で定義されている変数を参照する機能です。例えば、ある関数が別の関数の中で定義されている場合、内側の関数は外側の関数中の変数を参照できます。ネストされたスコープはデフォルトでは変数の参照だけができ、変数の代入はできないので注意してください。ローカル変数は、最も内側のスコープで変数を読み書きします。同様に、グローバル変数を使うとグローバル名前空間の値を読み書きします。" +" :keyword:`nonlocal` で外側の変数に書き込めます。" -#: ../../glossary.rst:998 +#: ../../glossary.rst:812 msgid "new-style class" msgstr "new-style class" -#: ../../glossary.rst:1000 +#: ../../glossary.rst:814 msgid "" "Old name for the flavor of classes now used for all class objects. In " "earlier Python versions, only new-style classes could use Python's newer, " -"versatile features like :attr:`~object.__slots__`, descriptors, properties, :" -"meth:`~object.__getattribute__`, class methods, and static methods." +"versatile features like :attr:`~object.__slots__`, descriptors, properties, " +":meth:`__getattribute__`, class methods, and static methods." msgstr "" +"(新スタイルクラス) 今では全てのクラスオブジェクトに使われている味付けの古い名前です。以前の Python のバージョンでは、新スタイルクラスのみが " +":attr:`~object.__slots__` 、デスクリプタ、 :meth:`__getattribute__` " +"、クラスメソッド、そして静的メソッド等の Python の新しい、多様な機能を利用できました。" -#: ../../glossary.rst:1005 +#: ../../glossary.rst:818 msgid "object" msgstr "object" -#: ../../glossary.rst:1007 +#: ../../glossary.rst:820 msgid "" "Any data with state (attributes or value) and defined behavior (methods). " "Also the ultimate base class of any :term:`new-style class`." msgstr "" -"(オブジェクト) 状態 (属性や値) と定義された振る舞い (メソッド) をもつ全ての" -"データ。もしくは、全ての :term:`新スタイルクラス ` の究極の" -"基底クラスのこと。" - -#: ../../glossary.rst:1010 -msgid "optimized scope" -msgstr "" +"(オブジェクト) 状態 (属性や値) と定義された振る舞い (メソッド) をもつ全てのデータ。もしくは、全ての :term:`新スタイルクラス " +"` の究極の基底クラスのこと。" -#: ../../glossary.rst:1012 -msgid "" -"A scope where target local variable names are reliably known to the compiler " -"when the code is compiled, allowing optimization of read and write access to " -"these names. The local namespaces for functions, generators, coroutines, " -"comprehensions, and generator expressions are optimized in this fashion. " -"Note: most interpreter optimizations are applied to all scopes, only those " -"relying on a known set of local and nonlocal variable names are restricted " -"to optimized scopes." -msgstr "" - -#: ../../glossary.rst:1019 +#: ../../glossary.rst:823 msgid "package" msgstr "package" -#: ../../glossary.rst:1021 +#: ../../glossary.rst:825 msgid "" "A Python :term:`module` which can contain submodules or recursively, " -"subpackages. Technically, a package is a Python module with a ``__path__`` " -"attribute." +"subpackages. Technically, a package is a Python module with an ``__path__``" +" attribute." msgstr "" -"(パッケージ) サブモジュールや再帰的にサブパッケージを含むことの出来る :term:" -"`module` のことです。専門的には、パッケージは ``__path__`` 属性を持つ Python " -"オブジェクトです。" +"(パッケージ) サブモジュールや再帰的にサブパッケージを含むことの出来る :term:`module` のことです。専門的には、パッケージは " +"``__path__`` 属性を持つ Python オブジェクトです。" -#: ../../glossary.rst:1025 +#: ../../glossary.rst:829 msgid "See also :term:`regular package` and :term:`namespace package`." -msgstr "" -":term:`regular package` と :term:`namespace package` を参照してください。" +msgstr ":term:`regular package` と :term:`namespace package` を参照してください。" -#: ../../glossary.rst:1026 +#: ../../glossary.rst:830 msgid "parameter" msgstr "parameter" -#: ../../glossary.rst:1028 +#: ../../glossary.rst:832 msgid "" "A named entity in a :term:`function` (or method) definition that specifies " "an :term:`argument` (or in some cases, arguments) that the function can " "accept. There are five kinds of parameter:" msgstr "" -"(仮引数) 名前付の実体で :term:`関数 ` (や :term:`メソッド " -"` ) の定義において関数が受ける :term:`実引数 ` を指定しま" -"す。仮引数には5種類あります:" +"(仮引数) 名前付の実体で :term:`関数` (や :term:`メソッド` ) の定義において関数が受ける " +":term:`実引数` を指定します。仮引数には5種類あります:" -#: ../../glossary.rst:1032 +#: ../../glossary.rst:836 msgid "" ":dfn:`positional-or-keyword`: specifies an argument that can be passed " "either :term:`positionally ` or as a :term:`keyword argument " "`. This is the default kind of parameter, for example *foo* and " "*bar* in the following::" msgstr "" -":dfn:`位置またはキーワード`: :term:`位置 ` であるいは :term:`キー" -"ワード引数 ` として渡すことができる引数を指定します。\n" +":dfn:`位置またはキーワード`: :term:`位置 ` であるいは :term:`キーワード引数 ` として渡すことができる引数を指定します。\n" "これはたとえば以下の *foo* や *bar* のように、デフォルトの仮引数の種類です::" -#: ../../glossary.rst:1037 -msgid "def func(foo, bar=None): ..." -msgstr "" - -#: ../../glossary.rst:1041 +#: ../../glossary.rst:845 msgid "" ":dfn:`positional-only`: specifies an argument that can be supplied only by " "position. Positional-only parameters can be defined by including a ``/`` " "character in the parameter list of the function definition after them, for " "example *posonly1* and *posonly2* in the following::" msgstr "" -"位置専用: 位置によってのみ与えられる引数を指定します。位置専用の引数は 関数定" -"義の引数のリストの中でそれらの後ろに ``/`` を含めることで定義できます。例えば" -"下記の *posonly1* と *posonly2* は位置専用引数になります:: " - -#: ../../glossary.rst:1046 -msgid "def func(posonly1, posonly2, /, positional_or_keyword): ..." -msgstr "" +"位置専用: 位置によってのみ与えられる引数を指定します。位置専用の引数は 関数定義の引数のリストの中でそれらの後ろに ``/`` " +"を含めることで定義できます。例えば下記の *posonly1* と *posonly2* は位置専用引数になります:: " -#: ../../glossary.rst:1050 +#: ../../glossary.rst:854 msgid "" ":dfn:`keyword-only`: specifies an argument that can be supplied only by " "keyword. Keyword-only parameters can be defined by including a single var-" @@ -2316,16 +1812,10 @@ msgid "" "definition before them, for example *kw_only1* and *kw_only2* in the " "following::" msgstr "" -":dfn:`キーワード専用`: キーワードによってのみ与えられる引数を指定します。キー" -"ワード専用の引数を定義できる場所は、例えば以下の *kw_only1* や *kw_only2* の" -"ように、関数定義の仮引数リストに含めた可変長位置引数または裸の ``*`` の後で" -"す::" +":dfn:`キーワード専用`: キーワードによってのみ与えられる引数を指定します。キーワード専用の引数を定義できる場所は、例えば以下の " +"*kw_only1* や *kw_only2* のように、関数定義の仮引数リストに含めた可変長位置引数または裸の ``*`` の後です::" -#: ../../glossary.rst:1056 -msgid "def func(arg, *, kw_only1, kw_only2): ..." -msgstr "" - -#: ../../glossary.rst:1058 +#: ../../glossary.rst:862 msgid "" ":dfn:`var-positional`: specifies that an arbitrary sequence of positional " "arguments can be provided (in addition to any positional arguments already " @@ -2333,144 +1823,128 @@ msgid "" "prepending the parameter name with ``*``, for example *args* in the " "following::" msgstr "" -":dfn:`可変長位置`: (他の仮引数で既に受けられた任意の位置引数に加えて) 任意の" -"個数の位置引数が与えられることを指定します。このような仮引数は、以下の " -"*args* のように仮引数名の前に ``*`` をつけることで定義できます::" +":dfn:`可変長位置`: (他の仮引数で既に受けられた任意の位置引数に加えて) " +"任意の個数の位置引数が与えられることを指定します。このような仮引数は、以下の *args* のように仮引数名の前に ``*`` " +"をつけることで定義できます::" -#: ../../glossary.rst:1064 -msgid "def func(*args, **kwargs): ..." -msgstr "" - -#: ../../glossary.rst:1066 +#: ../../glossary.rst:870 msgid "" -":dfn:`var-keyword`: specifies that arbitrarily many keyword arguments can be " -"provided (in addition to any keyword arguments already accepted by other " +":dfn:`var-keyword`: specifies that arbitrarily many keyword arguments can be" +" provided (in addition to any keyword arguments already accepted by other " "parameters). Such a parameter can be defined by prepending the parameter " "name with ``**``, for example *kwargs* in the example above." msgstr "" -":dfn:`可変長キーワード`: (他の仮引数で既に受けられた任意のキーワード引数に加" -"えて) 任意の個数のキーワード引数が与えられることを指定します。このような仮引" -"数は、上の例の *kwargs* のように仮引数名の前に ``**`` をつけることで定義でき" -"ます。" +":dfn:`可変長キーワード`: (他の仮引数で既に受けられた任意のキーワード引数に加えて) " +"任意の個数のキーワード引数が与えられることを指定します。このような仮引数は、上の例の *kwargs* のように仮引数名の前に ``**`` " +"をつけることで定義できます。" -#: ../../glossary.rst:1072 +#: ../../glossary.rst:876 msgid "" "Parameters can specify both optional and required arguments, as well as " "default values for some optional arguments." -msgstr "" -"仮引数はオプションと必須の引数のどちらも指定でき、オプションの引数にはデフォ" -"ルト値も指定できます。" +msgstr "仮引数はオプションと必須の引数のどちらも指定でき、オプションの引数にはデフォルト値も指定できます。" -#: ../../glossary.rst:1075 +#: ../../glossary.rst:879 msgid "" "See also the :term:`argument` glossary entry, the FAQ question on :ref:`the " "difference between arguments and parameters `, " -"the :class:`inspect.Parameter` class, the :ref:`function` section, and :pep:" -"`362`." +"the :class:`inspect.Parameter` class, the :ref:`function` section, and " +":pep:`362`." msgstr "" -":term:`仮引数 ` 、FAQ の :ref:`実引数と仮引数の違いは何ですか? " -"` 、:class:`inspect.Parameter` クラス、 :ref:" -"`function` セクション、:pep:`362` を参照してください。" +":term:`仮引数 ` 、FAQ の :ref:`実引数と仮引数の違いは何ですか? ` 、:class:`inspect.Parameter` クラス、 :ref:`function` " +"セクション、:pep:`362` を参照してください。" -#: ../../glossary.rst:1079 +#: ../../glossary.rst:883 msgid "path entry" msgstr "path entry" -#: ../../glossary.rst:1081 +#: ../../glossary.rst:885 msgid "" "A single location on the :term:`import path` which the :term:`path based " "finder` consults to find modules for importing." msgstr "" -":term:`path based finder` が import するモジュールを探す :term:`import path` " -"上の1つの場所です。" +":term:`path based finder` が import するモジュールを探す :term:`import path` 上の1つの場所です。" -#: ../../glossary.rst:1083 +#: ../../glossary.rst:887 msgid "path entry finder" msgstr "path entry finder" -#: ../../glossary.rst:1085 +#: ../../glossary.rst:889 msgid "" -"A :term:`finder` returned by a callable on :data:`sys.path_hooks` (i.e. a :" -"term:`path entry hook`) which knows how to locate modules given a :term:" -"`path entry`." +"A :term:`finder` returned by a callable on :data:`sys.path_hooks` (i.e. a " +":term:`path entry hook`) which knows how to locate modules given a " +":term:`path entry`." msgstr "" -":data:`sys.path_hooks` にある callable (つまり :term:`path entry hook`) が返" -"した :term:`finder` です。与えられた :term:`path entry` にあるモジュールを見" -"つける方法を知っています。" +":data:`sys.path_hooks` にある callable (つまり :term:`path entry hook`) が返した " +":term:`finder` です。与えられた :term:`path entry` にあるモジュールを見つける方法を知っています。" -#: ../../glossary.rst:1089 +#: ../../glossary.rst:893 msgid "" "See :class:`importlib.abc.PathEntryFinder` for the methods that path entry " "finders implement." msgstr "" -"パスエントリーファインダが実装するメソッドについては :class:`importlib.abc." -"PathEntryFinder` を参照してください。" +"パスエントリーファインダが実装するメソッドについては :class:`importlib.abc.PathEntryFinder` を参照してください。" -#: ../../glossary.rst:1091 +#: ../../glossary.rst:895 msgid "path entry hook" msgstr "path entry hook" -#: ../../glossary.rst:1093 +#: ../../glossary.rst:897 msgid "" -"A callable on the :data:`sys.path_hooks` list which returns a :term:`path " +"A callable on the :data:`sys.path_hook` list which returns a :term:`path " "entry finder` if it knows how to find modules on a specific :term:`path " "entry`." msgstr "" +":data:`sys.path_hook` リストにある callable で、指定された :term:`path entry` " +"にあるモジュールを見つける方法を知っている場合に :term:`path entry finder` を返します。" -#: ../../glossary.rst:1096 +#: ../../glossary.rst:900 msgid "path based finder" msgstr "path based finder" -#: ../../glossary.rst:1098 +#: ../../glossary.rst:902 msgid "" "One of the default :term:`meta path finders ` which " "searches an :term:`import path` for modules." msgstr "" -"デフォルトの :term:`meta path finder` の1つは、モジュールの :term:`import " -"path` を検索します。" +"デフォルトの :term:`meta path finder` の1つは、モジュールの :term:`import path` を検索します。" -#: ../../glossary.rst:1100 +#: ../../glossary.rst:904 msgid "path-like object" msgstr "path-like object" -#: ../../glossary.rst:1102 +#: ../../glossary.rst:906 msgid "" -"An object representing a file system path. A path-like object is either a :" -"class:`str` or :class:`bytes` object representing a path, or an object " -"implementing the :class:`os.PathLike` protocol. An object that supports the :" -"class:`os.PathLike` protocol can be converted to a :class:`str` or :class:" -"`bytes` file system path by calling the :func:`os.fspath` function; :func:" -"`os.fsdecode` and :func:`os.fsencode` can be used to guarantee a :class:" -"`str` or :class:`bytes` result instead, respectively. Introduced by :pep:" -"`519`." +"An object representing a file system path. A path-like object is either a " +":class:`str` or :class:`bytes` object representing a path, or an object " +"implementing the :class:`os.PathLike` protocol. An object that supports the " +":class:`os.PathLike` protocol can be converted to a :class:`str` or " +":class:`bytes` file system path by calling the :func:`os.fspath` function; " +":func:`os.fsdecode` and :func:`os.fsencode` can be used to guarantee a " +":class:`str` or :class:`bytes` result instead, respectively. Introduced by " +":pep:`519`." msgstr "" "(path-like オブジェクト) ファイルシステムパスを表します。\n" -"path-like オブジェクトは、パスを表す :class:`str` オブジェクトや :class:" -"`bytes` オブジェクト、または :class:`os.PathLike` プロトコルを実装したオブ" -"ジェクトのどれかです。\n" -":class:`os.PathLike` プロトコルをサポートしているオブジェクトは :func:`os." -"fspath` を呼び出すことで :class:`str` または :class:`bytes` のファイルシステ" -"ムパスに変換できます。 :func:`os.fsdecode` と :func:`os.fsencode` はそれぞ" -"れ :class:`str` あるいは :class:`bytes` になるのを保証するのに使えます。\n" +"path-like オブジェクトは、パスを表す :class:`str` オブジェクトや :class:`bytes` オブジェクト、または :class:`os.PathLike` プロトコルを実装したオブジェクトのどれかです。\n" +":class:`os.PathLike` プロトコルをサポートしているオブジェクトは :func:`os.fspath` を呼び出すことで :class:`str` または :class:`bytes` のファイルシステムパスに変換できます。 :func:`os.fsdecode` と :func:`os.fsencode` はそれぞれ :class:`str` あるいは :class:`bytes` になるのを保証するのに使えます。\n" ":pep:`519` で導入されました。" -#: ../../glossary.rst:1110 +#: ../../glossary.rst:914 msgid "PEP" msgstr "PEP" -#: ../../glossary.rst:1112 +#: ../../glossary.rst:916 msgid "" "Python Enhancement Proposal. A PEP is a design document providing " "information to the Python community, or describing a new feature for Python " "or its processes or environment. PEPs should provide a concise technical " "specification and a rationale for proposed features." msgstr "" -"Python Enhancement Proposal。PEP は、Python コミュニティに対して情報を提供す" -"る、あるいは Python の新機能やその過程や環境について記述する設計文書です。\n" -"PEP は、機能についての簡潔な技術的仕様と提案する機能の論拠 (理論) を伝えるべ" -"きです。" +"Python Enhancement Proposal。PEP は、Python コミュニティに対して情報を提供する、あるいは Python の新機能やその過程や環境について記述する設計文書です。\n" +"PEP は、機能についての簡潔な技術的仕様と提案する機能の論拠 (理論) を伝えるべきです。" -#: ../../glossary.rst:1118 +#: ../../glossary.rst:922 msgid "" "PEPs are intended to be the primary mechanisms for proposing major new " "features, for collecting community input on an issue, and for documenting " @@ -2478,229 +1952,167 @@ msgid "" "responsible for building consensus within the community and documenting " "dissenting opinions." msgstr "" -"PEP は、新機能の提案にかかる、コミュニティによる問題提起の集積と Python にな" -"される設計決断の文書化のための最上位の機構となることを意図しています。PEP の" -"著者にはコミュニティ内の合意形成を行うこと、反対意見を文書化することの責務が" -"あります。" +"PEP は、新機能の提案にかかる、コミュニティによる問題提起の集積と Python " +"になされる設計決断の文書化のための最上位の機構となることを意図しています。PEP " +"の著者にはコミュニティ内の合意形成を行うこと、反対意見を文書化することの責務があります。" -#: ../../glossary.rst:1124 +#: ../../glossary.rst:928 msgid "See :pep:`1`." msgstr ":pep:`1` を参照してください。" -#: ../../glossary.rst:1125 +#: ../../glossary.rst:929 msgid "portion" msgstr "portion" -#: ../../glossary.rst:1127 +#: ../../glossary.rst:931 msgid "" "A set of files in a single directory (possibly stored in a zip file) that " "contribute to a namespace package, as defined in :pep:`420`." msgstr "" -":pep:`420` で定義されている、namespace package に属する、複数のファイルが " -"(zipファイルに格納されている場合もある) 1つのディレクトリに格納されたもの。" +":pep:`420` で定義されている、namespace package に属する、複数のファイルが (zipファイルに格納されている場合もある) " +"1つのディレクトリに格納されたもの。" -#: ../../glossary.rst:1129 +#: ../../glossary.rst:933 msgid "positional argument" -msgstr "位置引数 (positional argument)" +msgstr "positional argument (位置引数)" -#: ../../glossary.rst:1132 +#: ../../glossary.rst:936 msgid "provisional API" msgstr "provisional API" -#: ../../glossary.rst:1134 +#: ../../glossary.rst:938 msgid "" "A provisional API is one which has been deliberately excluded from the " "standard library's backwards compatibility guarantees. While major changes " -"to such interfaces are not expected, as long as they are marked provisional, " -"backwards incompatible changes (up to and including removal of the " +"to such interfaces are not expected, as long as they are marked provisional," +" backwards incompatible changes (up to and including removal of the " "interface) may occur if deemed necessary by core developers. Such changes " -"will not be made gratuitously -- they will occur only if serious fundamental " -"flaws are uncovered that were missed prior to the inclusion of the API." +"will not be made gratuitously -- they will occur only if serious fundamental" +" flaws are uncovered that were missed prior to the inclusion of the API." msgstr "" -"(暫定 API) 標準ライブラリの後方互換性保証から計画的に除外されたものです。その" -"ようなインターフェースへの大きな変更は、暫定であるとされている間は期待されて" -"いませんが、コア開発者によって必要とみなされれば、後方非互換な変更 (インター" -"フェースの削除まで含まれる) が行われえます。このような変更はむやみに行われる" -"ものではありません -- これは API を組み込む前には見落とされていた重大な欠陥が" -"露呈したときにのみ行われます。" +"(暫定 API) " +"標準ライブラリの後方互換性保証から計画的に除外されたものです。そのようなインターフェースへの大きな変更は、暫定であるとされている間は期待されていませんが、コア開発者によって必要とみなされれば、後方非互換な変更" +" (インターフェースの削除まで含まれる) が行われえます。このような変更はむやみに行われるものではありません -- これは API " +"を組み込む前には見落とされていた重大な欠陥が露呈したときにのみ行われます。" -#: ../../glossary.rst:1143 +#: ../../glossary.rst:947 msgid "" "Even for provisional APIs, backwards incompatible changes are seen as a " "\"solution of last resort\" - every attempt will still be made to find a " "backwards compatible resolution to any identified problems." -msgstr "" -"暫定 API についても、後方互換性のない変更は「最終手段」とみなされています。問" -"題点が判明した場合でも後方互換な解決策を探すべきです。" +msgstr "暫定 API についても、後方互換性のない変更は「最終手段」とみなされています。問題点が判明した場合でも後方互換な解決策を探すべきです。" -#: ../../glossary.rst:1147 +#: ../../glossary.rst:951 msgid "" "This process allows the standard library to continue to evolve over time, " "without locking in problematic design errors for extended periods of time. " "See :pep:`411` for more details." msgstr "" -"このプロセスにより、標準ライブラリは問題となるデザインエラーに長い間閉じ込め" -"られることなく、時代を超えて進化を続けられます。詳細は :pep:`411` を参照して" -"ください。" +"このプロセスにより、標準ライブラリは問題となるデザインエラーに長い間閉じ込められることなく、時代を超えて進化を続けられます。詳細は :pep:`411`" +" を参照してください。" -#: ../../glossary.rst:1150 +#: ../../glossary.rst:954 msgid "provisional package" msgstr "provisional package" -#: ../../glossary.rst:1152 +#: ../../glossary.rst:956 msgid "See :term:`provisional API`." msgstr ":term:`provisional API` を参照してください。" -#: ../../glossary.rst:1153 +#: ../../glossary.rst:957 msgid "Python 3000" msgstr "Python 3000" -#: ../../glossary.rst:1155 +#: ../../glossary.rst:959 msgid "" "Nickname for the Python 3.x release line (coined long ago when the release " -"of version 3 was something in the distant future.) This is also abbreviated " -"\"Py3k\"." +"of version 3 was something in the distant future.) This is also abbreviated" +" \"Py3k\"." msgstr "" -"Python 3.x リリースラインのニックネームです。(Python 3 が遠い将来の話だった頃" -"に作られた言葉です。) \"Py3k\" と略されることもあります。" +"Python 3.x リリースラインのニックネームです。(Python 3 が遠い将来の話だった頃に作られた言葉です。) \"Py3k\" " +"と略されることもあります。" -#: ../../glossary.rst:1158 +#: ../../glossary.rst:962 msgid "Pythonic" msgstr "Pythonic" -#: ../../glossary.rst:1160 +#: ../../glossary.rst:964 msgid "" -"An idea or piece of code which closely follows the most common idioms of the " -"Python language, rather than implementing code using concepts common to " +"An idea or piece of code which closely follows the most common idioms of the" +" Python language, rather than implementing code using concepts common to " "other languages. For example, a common idiom in Python is to loop over all " "elements of an iterable using a :keyword:`for` statement. Many other " "languages don't have this type of construct, so people unfamiliar with " "Python sometimes use a numerical counter instead::" msgstr "" -"他の言語で一般的な考え方で書かれたコードではなく、Python の特に一般的なイディ" -"オムに従った考え方やコード片。例えば、Python の一般的なイディオムでは :" -"keyword:`for` 文を使ってイテラブルのすべての要素に渡ってループします。他の多" -"くの言語にはこの仕組みはないので、Python に慣れていない人は代わりに数値のカウ" -"ンターを使うかもしれません::" +"他の言語で一般的な考え方で書かれたコードではなく、Python の特に一般的なイディオムに従った考え方やコード片。例えば、Python " +"の一般的なイディオムでは :keyword:`for` " +"文を使ってイテラブルのすべての要素に渡ってループします。他の多くの言語にはこの仕組みはないので、Python " +"に慣れていない人は代わりに数値のカウンターを使うかもしれません::" -#: ../../glossary.rst:1167 -msgid "" -"for i in range(len(food)):\n" -" print(food[i])" -msgstr "" - -#: ../../glossary.rst:1170 +#: ../../glossary.rst:974 msgid "As opposed to the cleaner, Pythonic method::" msgstr "これに対し、きれいな Pythonic な方法は::" -#: ../../glossary.rst:1172 -msgid "" -"for piece in food:\n" -" print(piece)" -msgstr "" - -#: ../../glossary.rst:1174 +#: ../../glossary.rst:978 msgid "qualified name" msgstr "qualified name" -#: ../../glossary.rst:1176 +#: ../../glossary.rst:980 msgid "" "A dotted name showing the \"path\" from a module's global scope to a class, " "function or method defined in that module, as defined in :pep:`3155`. For " "top-level functions and classes, the qualified name is the same as the " "object's name::" msgstr "" -"(修飾名) モジュールのグローバルスコープから、そのモジュールで定義されたクラ" -"ス、関数、メソッドへの、 \"パス\" を表すドット名表記です。 :pep:`3155` で定義" -"されています。トップレベルの関数やクラスでは、修飾名はオブジェクトの名前と同" -"じです::" +"(修飾名) モジュールのグローバルスコープから、そのモジュールで定義されたクラス、関数、メソッドへの、 \"パス\" を表すドット名表記です。 " +":pep:`3155` で定義されています。トップレベルの関数やクラスでは、修飾名はオブジェクトの名前と同じです::" -#: ../../glossary.rst:1181 -msgid "" -">>> class C:\n" -"... class D:\n" -"... def meth(self):\n" -"... pass\n" -"...\n" -">>> C.__qualname__\n" -"'C'\n" -">>> C.D.__qualname__\n" -"'C.D'\n" -">>> C.D.meth.__qualname__\n" -"'C.D.meth'" -msgstr "" - -#: ../../glossary.rst:1193 +#: ../../glossary.rst:997 msgid "" "When used to refer to modules, the *fully qualified name* means the entire " -"dotted path to the module, including any parent packages, e.g. ``email.mime." -"text``::" -msgstr "" -"モジュールへの参照で使われると、*完全修飾名 (fully qualified name)* はすべて" -"の親パッケージを含む全体のドット名表記、例えば ``email.mime.text`` を意味しま" -"す::" - -#: ../../glossary.rst:1197 -msgid "" -">>> import email.mime.text\n" -">>> email.mime.text.__name__\n" -"'email.mime.text'" +"dotted path to the module, including any parent packages, e.g. " +"``email.mime.text``::" msgstr "" +"モジュールへの参照で使われると、*完全修飾名 (fully qualified name)* はすべての親パッケージを含む全体のドット名表記、例えば " +"``email.mime.text`` を意味します::" -#: ../../glossary.rst:1200 +#: ../../glossary.rst:1004 msgid "reference count" msgstr "reference count" -#: ../../glossary.rst:1202 +#: ../../glossary.rst:1006 msgid "" "The number of references to an object. When the reference count of an " -"object drops to zero, it is deallocated. Some objects are :term:`immortal` " -"and have reference counts that are never modified, and therefore the objects " -"are never deallocated. Reference counting is generally not visible to " -"Python code, but it is a key element of the :term:`CPython` implementation. " -"Programmers can call the :func:`sys.getrefcount` function to return the " -"reference count for a particular object." -msgstr "" -"(参照カウント) あるオブジェクトに対する参照の数。参照カウントが0になったと" -"き、そのオブジェクトは破棄されます。 :term:`永続 ` であり、参照カウ" -"ントが決して変更されないために割り当てが解除されないオブジェクトもあります。" -"参照カウントは通常は Python のコード上には現れませんが、 :term:`CPython` 実装" -"の重要な要素です。プログラマーは、 任意のオブジェクトの参照カウントを知るため" -"に :func:`sys.getrefcount` 関数を呼び出すことが出来ます。" - -#: ../../glossary.rst:1210 +"object drops to zero, it is deallocated. Reference counting is generally " +"not visible to Python code, but it is a key element of the :term:`CPython` " +"implementation. The :mod:`sys` module defines a :func:`~sys.getrefcount` " +"function that programmers can call to return the reference count for a " +"particular object." +msgstr "" +"(参照カウント) あるオブジェクトに対する参照の数。参照カウントが0になったとき、そのオブジェクトは破棄されます。参照カウントは通常は Python " +"のコード上には現れませんが、 :term:`CPython` 実装の重要な要素です。 :mod:`sys` " +"モジュールは、プログラマーが任意のオブジェクトの参照カウントを知るための :func:`~sys.getrefcount` 関数を提供しています。" + +#: ../../glossary.rst:1012 msgid "regular package" msgstr "regular package" -#: ../../glossary.rst:1212 +#: ../../glossary.rst:1014 msgid "" -"A traditional :term:`package`, such as a directory containing an ``__init__." -"py`` file." -msgstr "" -"伝統的な、 ``__init__.py`` ファイルを含むディレクトリとしての :term:" -"`package`。" +"A traditional :term:`package`, such as a directory containing an " +"``__init__.py`` file." +msgstr "伝統的な、 ``__init__.py`` ファイルを含むディレクトリとしての :term:`package`。" -#: ../../glossary.rst:1215 +#: ../../glossary.rst:1017 msgid "See also :term:`namespace package`." msgstr ":term:`namespace package` を参照してください。" -#: ../../glossary.rst:1216 -msgid "REPL" -msgstr "REPL" - -#: ../../glossary.rst:1218 -msgid "" -"An acronym for the \"read–eval–print loop\", another name for the :term:" -"`interactive` interpreter shell." -msgstr "" -"\"read–eval–print loop\" の頭字語で、 :term:`対話型 ` インタープ" -"リターシェルの別名。" - -#: ../../glossary.rst:1220 +#: ../../glossary.rst:1018 msgid "__slots__" msgstr "__slots__" -#: ../../glossary.rst:1222 +#: ../../glossary.rst:1020 msgid "" "A declaration inside a class that saves memory by pre-declaring space for " "instance attributes and eliminating instance dictionaries. Though popular, " @@ -2708,284 +2120,141 @@ msgid "" "cases where there are large numbers of instances in a memory-critical " "application." msgstr "" -"クラス内での宣言で、インスタンス属性の領域をあらかじめ定義しておき、インスタ" -"ンス辞書を排除することで、メモリを節約します。これはよく使われるテクニックで" -"すが、正しく扱うには少しトリッキーなので、稀なケース、例えばメモリが死活問題" -"となるアプリケーションでインスタンスが大量に存在する、といったときを除き、使" -"わないのがベストです。" +"クラス内での宣言で、インスタンス属性の領域をあらかじめ定義しておき、インスタンス辞書を排除することで、メモリを節約します。これはよく使われるテクニックですが、正しく扱うには少しトリッキーなので、稀なケース、例えばメモリが死活問題となるアプリケーションでインスタンスが大量に存在する、といったときを除き、使わないのがベストです。" -#: ../../glossary.rst:1227 +#: ../../glossary.rst:1025 msgid "sequence" msgstr "sequence" -#: ../../glossary.rst:1229 +#: ../../glossary.rst:1027 msgid "" "An :term:`iterable` which supports efficient element access using integer " -"indices via the :meth:`~object.__getitem__` special method and defines a :" -"meth:`~object.__len__` method that returns the length of the sequence. Some " -"built-in sequence types are :class:`list`, :class:`str`, :class:`tuple`, " -"and :class:`bytes`. Note that :class:`dict` also supports :meth:`~object." -"__getitem__` and :meth:`!__len__`, but is considered a mapping rather than a " -"sequence because the lookups use arbitrary :term:`hashable` keys rather than " +"indices via the :meth:`__getitem__` special method and defines a " +":meth:`__len__` method that returns the length of the sequence. Some built-" +"in sequence types are :class:`list`, :class:`str`, :class:`tuple`, and " +":class:`bytes`. Note that :class:`dict` also supports :meth:`__getitem__` " +"and :meth:`__len__`, but is considered a mapping rather than a sequence " +"because the lookups use arbitrary :term:`immutable` keys rather than " "integers." msgstr "" +"(シーケンス) 整数インデクスによる効率的な要素アクセスを :meth:`__getitem__` 特殊メソッドを通じてサポートし、長さを返す " +":meth:`__len__` メソッドを定義した :term:`iterable` です。組み込みシーケンス型には、 :class:`list`, " +":class:`str`, :class:`tuple`, :class:`bytes` などがあります。 :class:`dict` は " +":meth:`__getitem__` と :meth:`__len__` もサポートしますが、検索の際に整数ではなく任意の " +":term:`immutable` なキーを使うため、シーケンスではなくマッピング (mapping) とみなされているので注意してください。" -#: ../../glossary.rst:1238 +#: ../../glossary.rst:1036 msgid "" "The :class:`collections.abc.Sequence` abstract base class defines a much " -"richer interface that goes beyond just :meth:`~object.__getitem__` and :meth:" -"`~object.__len__`, adding :meth:`!count`, :meth:`!index`, :meth:`~object." -"__contains__`, and :meth:`~object.__reversed__`. Types that implement this " -"expanded interface can be registered explicitly using :func:`~abc.ABCMeta." -"register`. For more documentation on sequence methods generally, see :ref:" -"`Common Sequence Operations `." +"richer interface that goes beyond just :meth:`__getitem__` and " +":meth:`__len__`, adding :meth:`count`, :meth:`index`, :meth:`__contains__`, " +"and :meth:`__reversed__`. Types that implement this expanded interface can " +"be registered explicitly using :func:`~abc.ABCMeta.register`." msgstr "" -#: ../../glossary.rst:1247 +#: ../../glossary.rst:1043 msgid "set comprehension" msgstr "" -#: ../../glossary.rst:1249 +#: ../../glossary.rst:1045 msgid "" "A compact way to process all or part of the elements in an iterable and " "return a set with the results. ``results = {c for c in 'abracadabra' if c " -"not in 'abc'}`` generates the set of strings ``{'r', 'd'}``. See :ref:" -"`comprehensions`." +"not in 'abc'}`` generates the set of strings ``{'r', 'd'}``. See " +":ref:`comprehensions`." msgstr "" -"(集合内包表記) iterable 内の全てあるいは一部の要素を処理して、その結果からな" -"る集合を返すコンパクトな書き方です。 ``results = {c for c in 'abracadabra' " -"if c not in 'abc'}`` とすると、``{'r', 'd'}`` という文字列の辞書を生成しま" -"す。 :ref:`comprehensions` を参照してください。" -#: ../../glossary.rst:1253 +#: ../../glossary.rst:1049 msgid "single dispatch" msgstr "single dispatch" -#: ../../glossary.rst:1255 +#: ../../glossary.rst:1051 msgid "" "A form of :term:`generic function` dispatch where the implementation is " "chosen based on the type of a single argument." -msgstr "" -":term:`generic function` の一種で実装は一つの引数の型により選択されます。" +msgstr ":term:`generic function` の一種で実装は一つの引数の型により選択されます。" -#: ../../glossary.rst:1257 +#: ../../glossary.rst:1053 msgid "slice" msgstr "slice" -#: ../../glossary.rst:1259 +#: ../../glossary.rst:1055 msgid "" "An object usually containing a portion of a :term:`sequence`. A slice is " "created using the subscript notation, ``[]`` with colons between numbers " "when several are given, such as in ``variable_name[1:3:5]``. The bracket " "(subscript) notation uses :class:`slice` objects internally." msgstr "" -"(スライス) 一般に :term:`シーケンス ` の一部を含むオブジェクト。ス" -"ライスは、添字表記 ``[]`` で与えられた複数の数の間にコロンを書くことで作られ" -"ます。例えば、 ``variable_name[1:3:5]`` です。角括弧 (添字) 記号は :class:" -"`slice` オブジェクトを内部で利用しています。" +"(スライス) 一般に :term:`シーケンス ` の一部を含むオブジェクト。スライスは、添字表記 ``[]`` " +"で与えられた複数の数の間にコロンを書くことで作られます。例えば、 ``variable_name[1:3:5]`` です。角括弧 (添字) 記号は " +":class:`slice` オブジェクトを内部で利用しています。" -#: ../../glossary.rst:1263 -msgid "soft deprecated" -msgstr "" - -#: ../../glossary.rst:1265 -msgid "" -"A soft deprecated API should not be used in new code, but it is safe for " -"already existing code to use it. The API remains documented and tested, but " -"will not be enhanced further." -msgstr "" - -#: ../../glossary.rst:1269 -msgid "" -"Soft deprecation, unlike normal deprecation, does not plan on removing the " -"API and will not emit warnings." -msgstr "" - -#: ../../glossary.rst:1272 -msgid "" -"See `PEP 387: Soft Deprecation `_." -msgstr "" - -#: ../../glossary.rst:1274 +#: ../../glossary.rst:1059 msgid "special method" msgstr "special method" -#: ../../glossary.rst:1278 +#: ../../glossary.rst:1063 msgid "" "A method that is called implicitly by Python to execute a certain operation " "on a type, such as addition. Such methods have names starting and ending " -"with double underscores. Special methods are documented in :ref:" -"`specialnames`." +"with double underscores. Special methods are documented in " +":ref:`specialnames`." msgstr "" -"(特殊メソッド) ある型に特定の操作、例えば加算をするために Python から暗黙に呼" -"び出されるメソッド。この種類のメソッドは、メソッド名の最初と最後にアンダース" -"コア 2 つがついています。特殊メソッドについては :ref:`specialnames` で解説さ" -"れています。" +"(特殊メソッド) ある型に特定の操作、例えば加算をするために Python " +"から暗黙に呼び出されるメソッド。この種類のメソッドは、メソッド名の最初と最後にアンダースコア 2 つがついています。特殊メソッドについては " +":ref:`specialnames` で解説されています。" -#: ../../glossary.rst:1282 +#: ../../glossary.rst:1067 msgid "statement" msgstr "statement" -#: ../../glossary.rst:1284 -msgid "" -"A statement is part of a suite (a \"block\" of code). A statement is either " -"an :term:`expression` or one of several constructs with a keyword, such as :" -"keyword:`if`, :keyword:`while` or :keyword:`for`." -msgstr "" -"(文) 文はスイート (コードの\"ブロック\") に不可欠な要素です。文は :term:`式 " -"` かキーワードから構成されるもののどちらかです。後者には :" -"keyword:`if`、:keyword:`while`、:keyword:`for` があります。" - -#: ../../glossary.rst:1287 -msgid "static type checker" -msgstr "" - -#: ../../glossary.rst:1289 -msgid "" -"An external tool that reads Python code and analyzes it, looking for issues " -"such as incorrect types. See also :term:`type hints ` and the :" -"mod:`typing` module." -msgstr "" - -#: ../../glossary.rst:1292 -msgid "strong reference" -msgstr "" - -#: ../../glossary.rst:1294 -msgid "" -"In Python's C API, a strong reference is a reference to an object which is " -"owned by the code holding the reference. The strong reference is taken by " -"calling :c:func:`Py_INCREF` when the reference is created and released with :" -"c:func:`Py_DECREF` when the reference is deleted." -msgstr "" - -#: ../../glossary.rst:1300 +#: ../../glossary.rst:1069 msgid "" -"The :c:func:`Py_NewRef` function can be used to create a strong reference to " -"an object. Usually, the :c:func:`Py_DECREF` function must be called on the " -"strong reference before exiting the scope of the strong reference, to avoid " -"leaking one reference." -msgstr "" - -#: ../../glossary.rst:1305 -msgid "See also :term:`borrowed reference`." +"A statement is part of a suite (a \"block\" of code). A statement is either" +" an :term:`expression` or one of several constructs with a keyword, such as " +":keyword:`if`, :keyword:`while` or :keyword:`for`." msgstr "" +"(文) 文はスイート (コードの\"ブロック\") に不可欠な要素です。文は :term:`式 ` " +"かキーワードから構成されるもののどちらかです。後者には :keyword:`if`、:keyword:`while`、:keyword:`for` " +"があります。" -#: ../../glossary.rst:1306 +#: ../../glossary.rst:1072 msgid "text encoding" msgstr "text encoding" -#: ../../glossary.rst:1308 -msgid "" -"A string in Python is a sequence of Unicode code points (in range " -"``U+0000``--``U+10FFFF``). To store or transfer a string, it needs to be " -"serialized as a sequence of bytes." -msgstr "" +#: ../../glossary.rst:1074 +msgid "A codec which encodes Unicode strings to bytes." +msgstr "ユニコード文字列をエンコードするコーデックです。" -#: ../../glossary.rst:1312 -msgid "" -"Serializing a string into a sequence of bytes is known as \"encoding\", and " -"recreating the string from the sequence of bytes is known as \"decoding\"." -msgstr "" - -#: ../../glossary.rst:1315 -msgid "" -"There are a variety of different text serialization :ref:`codecs `, which are collectively referred to as \"text encodings\"." -msgstr "" - -#: ../../glossary.rst:1318 +#: ../../glossary.rst:1075 msgid "text file" msgstr "text file" -#: ../../glossary.rst:1320 +#: ../../glossary.rst:1077 msgid "" "A :term:`file object` able to read and write :class:`str` objects. Often, a " -"text file actually accesses a byte-oriented datastream and handles the :term:" -"`text encoding` automatically. Examples of text files are files opened in " -"text mode (``'r'`` or ``'w'``), :data:`sys.stdin`, :data:`sys.stdout`, and " -"instances of :class:`io.StringIO`." +"text file actually accesses a byte-oriented datastream and handles the " +":term:`text encoding` automatically. Examples of text files are files opened" +" in text mode (``'r'`` or ``'w'``), :data:`sys.stdin`, :data:`sys.stdout`, " +"and instances of :class:`io.StringIO`." msgstr "" -"(テキストファイル) :class:`str` オブジェクトを読み書きできる :term:`file " -"object` です。\n" -"しばしば、テキストファイルは実際にバイト指向のデータストリームにアクセス" -"し、 :term:`テキストエンコーディング ` を自動的に行います。\n" -"テキストファイルの例は、 :data:`sys.stdin`, :data:`sys.stdout`, :class:`io." -"StringIO` インスタンスなどをテキストモード (``'r'`` or ``'w'``) で開いたファ" -"イルです。" +"(テキストファイル) :class:`str` オブジェクトを読み書きできる :term:`file object` です。\n" +"しばしば、テキストファイルは実際にバイト指向のデータストリームにアクセスし、 :term:`テキストエンコーディング ` を自動的に行います。\n" +"テキストファイルの例は、 :data:`sys.stdin`, :data:`sys.stdout`, :class:`io.StringIO` インスタンスなどをテキストモード (``'r'`` or ``'w'``) で開いたファイルです。" -#: ../../glossary.rst:1327 +#: ../../glossary.rst:1084 msgid "" -"See also :term:`binary file` for a file object able to read and write :term:" -"`bytes-like objects `." +"See also :term:`binary file` for a file object able to read and write :term" +":`bytes-like objects `." msgstr "" -":term:`bytes-like オブジェクト ` を読み書きできるファイル" -"オブジェクトについては、 :term:`バイナリファイル ` も参照してく" -"ださい。" +":term:`bytes-like オブジェクト ` を読み書きできるファイルオブジェクトについては、 " +":term:`バイナリファイル ` も参照してください。" -#: ../../glossary.rst:1329 -msgid "thread state" -msgstr "" - -#: ../../glossary.rst:1332 -msgid "" -"The information used by the :term:`CPython` runtime to run in an OS thread. " -"For example, this includes the current exception, if any, and the state of " -"the bytecode interpreter." -msgstr "" - -#: ../../glossary.rst:1336 -msgid "" -"Each thread state is bound to a single OS thread, but threads may have many " -"thread states available. At most, one of them may be :term:`attached " -"` at once." -msgstr "" - -#: ../../glossary.rst:1340 -msgid "" -"An :term:`attached thread state` is required to call most of Python's C API, " -"unless a function explicitly documents otherwise. The bytecode interpreter " -"only runs under an attached thread state." -msgstr "" - -#: ../../glossary.rst:1344 -msgid "" -"Each thread state belongs to a single interpreter, but each interpreter may " -"have many thread states, including multiple for the same OS thread. Thread " -"states from multiple interpreters may be bound to the same thread, but only " -"one can be :term:`attached ` in that thread at any " -"given moment." -msgstr "" - -#: ../../glossary.rst:1350 -msgid "" -"See :ref:`Thread State and the Global Interpreter Lock ` for more " -"information." -msgstr "" - -#: ../../glossary.rst:1352 -msgid "token" -msgstr "トークン" - -#: ../../glossary.rst:1355 -msgid "" -"A small unit of source code, generated by the :ref:`lexical analyzer " -"` (also called the *tokenizer*). Names, numbers, strings, " -"operators, newlines and similar are represented by tokens." -msgstr "" - -#: ../../glossary.rst:1360 -msgid "" -"The :mod:`tokenize` module exposes Python's lexical analyzer. The :mod:" -"`token` module contains information on the various types of tokens." -msgstr "" - -#: ../../glossary.rst:1363 +#: ../../glossary.rst:1086 msgid "triple-quoted string" msgstr "triple-quoted string" -#: ../../glossary.rst:1365 +#: ../../glossary.rst:1088 msgid "" "A string which is bound by three instances of either a quotation mark (\") " "or an apostrophe ('). While they don't provide any functionality not " @@ -2995,210 +2264,159 @@ msgid "" "continuation character, making them especially useful when writing " "docstrings." msgstr "" -"(三重クォート文字列) 3つの連続したクォート記号(\")かアポストロフィー(')で囲ま" -"れた文字列。通常の(一重)クォート文字列に比べて表現できる文字列に違いはありま" -"せんが、幾つかの理由で有用です。1つか2つの連続したクォート記号をエスケープ無" -"しに書くことができますし、行継続文字(\\\\)を使わなくても複数行にまたがること" -"ができるので、ドキュメンテーション文字列を書く時に特に便利です。" +"(三重クォート文字列) " +"3つの連続したクォート記号(\")かアポストロフィー(')で囲まれた文字列。通常の(一重)クォート文字列に比べて表現できる文字列に違いはありませんが、幾つかの理由で有用です。1つか2つの連続したクォート記号をエスケープ無しに書くことができますし、行継続文字(\\\\)を使わなくても複数行にまたがることができるので、ドキュメンテーション文字列を書く時に特に便利です。" -#: ../../glossary.rst:1372 +#: ../../glossary.rst:1095 msgid "type" msgstr "type" -#: ../../glossary.rst:1374 +#: ../../glossary.rst:1097 msgid "" "The type of a Python object determines what kind of object it is; every " -"object has a type. An object's type is accessible as its :attr:`~object." -"__class__` attribute or can be retrieved with ``type(obj)``." +"object has a type. An object's type is accessible as its " +":attr:`~instance.__class__` attribute or can be retrieved with " +"``type(obj)``." msgstr "" +"(型) Python オブジェクトの型はオブジェクトがどのようなものかを決めます。あらゆるオブジェクトは型を持っています。オブジェクトの型は " +":attr:`~instance.__class__` 属性でアクセスしたり、``type(obj)`` で取得したり出来ます。" -#: ../../glossary.rst:1378 +#: ../../glossary.rst:1101 msgid "type alias" msgstr "type alias" -#: ../../glossary.rst:1380 +#: ../../glossary.rst:1103 msgid "A synonym for a type, created by assigning the type to an identifier." msgstr "(型エイリアス) 型の別名で、型を識別子に代入して作成します。" -#: ../../glossary.rst:1382 +#: ../../glossary.rst:1105 msgid "" "Type aliases are useful for simplifying :term:`type hints `. For " "example::" -msgstr "" -"型エイリアスは :term:`型ヒント ` を単純化するのに有用です。例え" -"ば::" - -#: ../../glossary.rst:1385 -msgid "" -"def remove_gray_shades(\n" -" colors: list[tuple[int, int, int]]) -> list[tuple[int, int, int]]:\n" -" pass" -msgstr "" +msgstr "型エイリアスは :term:`型ヒント ` を単純化するのに有用です。例えば::" -#: ../../glossary.rst:1389 +#: ../../glossary.rst:1112 msgid "could be made more readable like this::" msgstr "これは次のようにより読みやすくできます::" -#: ../../glossary.rst:1391 -msgid "" -"Color = tuple[int, int, int]\n" -"\n" -"def remove_gray_shades(colors: list[Color]) -> list[Color]:\n" -" pass" -msgstr "" - -#: ../../glossary.rst:1396 ../../glossary.rst:1410 +#: ../../glossary.rst:1119 ../../glossary.rst:1133 msgid "See :mod:`typing` and :pep:`484`, which describe this functionality." msgstr "機能の説明がある :mod:`typing` と :pep:`484` を参照してください。" -#: ../../glossary.rst:1397 +#: ../../glossary.rst:1120 msgid "type hint" msgstr "type hint" -#: ../../glossary.rst:1399 +#: ../../glossary.rst:1122 msgid "" "An :term:`annotation` that specifies the expected type for a variable, a " "class attribute, or a function parameter or return value." -msgstr "" -"(型ヒント) 変数、クラス属性、関数のパラメータや返り値の期待される型を指定す" -"る :term:`annotation` です。" +msgstr "(型ヒント) 変数、クラス属性、関数のパラメータや返り値の期待される型を指定する :term:`annotation` です。" -#: ../../glossary.rst:1402 +#: ../../glossary.rst:1125 msgid "" "Type hints are optional and are not enforced by Python but they are useful " -"to :term:`static type checkers `. They can also aid " -"IDEs with code completion and refactoring." +"to static type analysis tools, and aid IDEs with code completion and " +"refactoring." msgstr "" +"型ヒントは必須ではなく Python では強制ではありませんが、静的型解析ツールにとって有用であり、IDE " +"のコード補完とリファクタリングの手助けになります。" -#: ../../glossary.rst:1406 +#: ../../glossary.rst:1129 msgid "" "Type hints of global variables, class attributes, and functions, but not " "local variables, can be accessed using :func:`typing.get_type_hints`." msgstr "" -"グローバル変数、クラス属性、関数で、ローカル変数でないものの型ヒントは :func:" -"`typing.get_type_hints` で取得できます。" +"グローバル変数、クラス属性、関数で、ローカル変数でないものの型ヒントは :func:`typing.get_type_hints` で取得できます。" -#: ../../glossary.rst:1411 +#: ../../glossary.rst:1134 msgid "universal newlines" msgstr "universal newlines" -#: ../../glossary.rst:1413 +#: ../../glossary.rst:1136 msgid "" "A manner of interpreting text streams in which all of the following are " "recognized as ending a line: the Unix end-of-line convention ``'\\n'``, the " -"Windows convention ``'\\r\\n'``, and the old Macintosh convention " -"``'\\r'``. See :pep:`278` and :pep:`3116`, as well as :func:`bytes." -"splitlines` for an additional use." +"Windows convention ``'\\r\\n'``, and the old Macintosh convention ``'\\r'``." +" See :pep:`278` and :pep:`3116`, as well as :func:`bytes.splitlines` for an" +" additional use." msgstr "" -"テキストストリームの解釈法の一つで、以下のすべてを行末と認識します: Unix の行" -"末規定 ``'\\n'``、Windows の規定 ``'\\r\\n'``、古い Macintosh の規定 " -"``'\\r'``。利用法について詳しくは、 :pep:`278` と :pep:`3116` 、さらに :func:" -"`bytes.splitlines` も参照してください。" +"テキストストリームの解釈法の一つで、以下のすべてを行末と認識します: Unix の行末規定 ``'\\n'``、Windows の規定 " +"``'\\r\\n'``、古い Macintosh の規定 ``'\\r'``。利用法について詳しくは、 :pep:`278` と " +":pep:`3116` 、さらに :func:`bytes.splitlines` も参照してください。" -#: ../../glossary.rst:1418 +#: ../../glossary.rst:1141 msgid "variable annotation" msgstr "variable annotation" -#: ../../glossary.rst:1420 +#: ../../glossary.rst:1143 msgid "An :term:`annotation` of a variable or a class attribute." msgstr "(変数アノテーション) 変数あるいはクラス属性の :term:`annotation` 。" -#: ../../glossary.rst:1422 +#: ../../glossary.rst:1145 msgid "" "When annotating a variable or a class attribute, assignment is optional::" msgstr "変数あるいはクラス属性に注釈を付けたときは、代入部分は任意です::" -#: ../../glossary.rst:1424 -msgid "" -"class C:\n" -" field: 'annotation'" -msgstr "" - -#: ../../glossary.rst:1427 +#: ../../glossary.rst:1150 msgid "" "Variable annotations are usually used for :term:`type hints `: " "for example this variable is expected to take :class:`int` values::" msgstr "" -"変数アノテーションは通常は :term:`型ヒント` のために使われます: 例" -"えば、この変数は :class:`int` の値を取ることを期待されています::" - -#: ../../glossary.rst:1431 -msgid "count: int = 0" -msgstr "" +"変数アノテーションは通常は :term:`型ヒント` のために使われます: 例えば、この変数は :class:`int` " +"の値を取ることを期待されています::" -#: ../../glossary.rst:1433 +#: ../../glossary.rst:1156 msgid "Variable annotation syntax is explained in section :ref:`annassign`." -msgstr "" -"変数アノテーションの構文については :ref:`annassign` 節で解説しています。" +msgstr "変数アノテーションの構文については :ref:`annassign` 節で解説しています。" -#: ../../glossary.rst:1435 +#: ../../glossary.rst:1158 msgid "" "See :term:`function annotation`, :pep:`484` and :pep:`526`, which describe " -"this functionality. Also see :ref:`annotations-howto` for best practices on " -"working with annotations." +"this functionality." msgstr "" -"機能の説明がある :term:`function annotation`, :pep:`484` , :pep:`526` を参照" -"してください。また、アノテーションを利用するベストプラクティスとして :ref:" -"`annotations-howto` も参照してください。" +"この機能について解説している :term:`function annotation`, :pep:`484`, :pep:`526` " +"を参照してください。" -#: ../../glossary.rst:1439 +#: ../../glossary.rst:1160 msgid "virtual environment" msgstr "virtual environment" -#: ../../glossary.rst:1441 +#: ../../glossary.rst:1162 msgid "" "A cooperatively isolated runtime environment that allows Python users and " "applications to install and upgrade Python distribution packages without " "interfering with the behaviour of other Python applications running on the " "same system." msgstr "" -"(仮想環境) 協調的に切り離された実行環境です。これにより Python ユーザとアプリ" -"ケーションは同じシステム上で動いている他の Python アプリケーションの挙動に干" -"渉することなく Python パッケージのインストールと更新を行うことができます。" +"(仮想環境) 協調的に切り離された実行環境です。これにより Python ユーザとアプリケーションは同じシステム上で動いている他の Python " +"アプリケーションの挙動に干渉することなく Python パッケージのインストールと更新を行うことができます。" -#: ../../glossary.rst:1446 +#: ../../glossary.rst:1167 msgid "See also :mod:`venv`." msgstr ":mod:`venv` を参照してください。" -#: ../../glossary.rst:1447 +#: ../../glossary.rst:1168 msgid "virtual machine" msgstr "virtual machine" -#: ../../glossary.rst:1449 +#: ../../glossary.rst:1170 msgid "" "A computer defined entirely in software. Python's virtual machine executes " "the :term:`bytecode` emitted by the bytecode compiler." msgstr "" -"(仮想マシン) 完全にソフトウェアにより定義されたコンピュータ。 Python の仮想マ" -"シンは、バイトコードコンパイラが出力した :term:`バイトコード ` を実" -"行します。" +"(仮想マシン) 完全にソフトウェアにより定義されたコンピュータ。 Python の仮想マシンは、バイトコードコンパイラが出力した " +":term:`バイトコード ` を実行します。" -#: ../../glossary.rst:1451 +#: ../../glossary.rst:1172 msgid "Zen of Python" msgstr "Zen of Python" -#: ../../glossary.rst:1453 +#: ../../glossary.rst:1174 msgid "" "Listing of Python design principles and philosophies that are helpful in " "understanding and using the language. The listing can be found by typing " "\"``import this``\" at the interactive prompt." msgstr "" -"(Pythonの悟り) Python を理解し利用する上での導きとなる、Python の設計原則と哲" -"学をリストにしたものです。対話プロンプトで \"``import this``\" とするとこのリ" -"ストを読めます。" - -#: ../../glossary.rst:319 -msgid "C-contiguous" -msgstr "" - -#: ../../glossary.rst:319 -msgid "Fortran contiguous" -msgstr "" - -#: ../../glossary.rst:876 -msgid "magic" -msgstr "" - -#: ../../glossary.rst:1276 -msgid "special" -msgstr "特殊" +"(Pythonの悟り) Python を理解し利用する上での導きとなる、Python の設計原則と哲学をリストにしたものです。対話プロンプトで " +"\"``import this``\" とするとこのリストを読めます。" diff --git a/howto/annotations.po b/howto/annotations.po deleted file mode 100644 index a0d530ca0..000000000 --- a/howto/annotations.po +++ /dev/null @@ -1,393 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation -# This file is distributed under the same license as the Python package. -# FIRST AUTHOR , YEAR. -# -# Translators: -# tomo, 2021 -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: Python 3.14\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-06 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:52+0000\n" -"Last-Translator: tomo, 2021\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" -"ja/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#: ../../howto/annotations.rst:5 -msgid "Annotations Best Practices" -msgstr "" - -#: ../../howto/annotations.rst:0 -msgid "author" -msgstr "author" - -#: ../../howto/annotations.rst:7 -msgid "Larry Hastings" -msgstr "Larry Hastings" - -#: ../../howto/annotations.rst-1 -msgid "Abstract" -msgstr "概要" - -#: ../../howto/annotations.rst:11 -msgid "" -"This document is designed to encapsulate the best practices for working with " -"annotations dicts. If you write Python code that examines " -"``__annotations__`` on Python objects, we encourage you to follow the " -"guidelines described below." -msgstr "" - -#: ../../howto/annotations.rst:16 -msgid "" -"The document is organized into four sections: best practices for accessing " -"the annotations of an object in Python versions 3.10 and newer, best " -"practices for accessing the annotations of an object in Python versions 3.9 " -"and older, other best practices for ``__annotations__`` that apply to any " -"Python version, and quirks of ``__annotations__``." -msgstr "" - -#: ../../howto/annotations.rst:26 -msgid "" -"Note that this document is specifically about working with " -"``__annotations__``, not uses *for* annotations. If you're looking for " -"information on how to use \"type hints\" in your code, please see the :mod:" -"`typing` module." -msgstr "" - -#: ../../howto/annotations.rst:33 -msgid "Accessing The Annotations Dict Of An Object In Python 3.10 And Newer" -msgstr "" - -#: ../../howto/annotations.rst:35 -msgid "" -"Python 3.10 adds a new function to the standard library: :func:`inspect." -"get_annotations`. In Python versions 3.10 through 3.13, calling this " -"function is the best practice for accessing the annotations dict of any " -"object that supports annotations. This function can also \"un-stringize\" " -"stringized annotations for you." -msgstr "" - -#: ../../howto/annotations.rst:42 -msgid "" -"In Python 3.14, there is a new :mod:`annotationlib` module with " -"functionality for working with annotations. This includes a :func:" -"`annotationlib.get_annotations` function, which supersedes :func:`inspect." -"get_annotations`." -msgstr "" - -#: ../../howto/annotations.rst:47 -msgid "" -"If for some reason :func:`inspect.get_annotations` isn't viable for your use " -"case, you may access the ``__annotations__`` data member manually. Best " -"practice for this changed in Python 3.10 as well: as of Python 3.10, ``o." -"__annotations__`` is guaranteed to *always* work on Python functions, " -"classes, and modules. If you're certain the object you're examining is one " -"of these three *specific* objects, you may simply use ``o.__annotations__`` " -"to get at the object's annotations dict." -msgstr "" - -#: ../../howto/annotations.rst:57 -msgid "" -"However, other types of callables--for example, callables created by :func:" -"`functools.partial`--may not have an ``__annotations__`` attribute defined. " -"When accessing the ``__annotations__`` of a possibly unknown object, best " -"practice in Python versions 3.10 and newer is to call :func:`getattr` with " -"three arguments, for example ``getattr(o, '__annotations__', None)``." -msgstr "" - -#: ../../howto/annotations.rst:65 -msgid "" -"Before Python 3.10, accessing ``__annotations__`` on a class that defines no " -"annotations but that has a parent class with annotations would return the " -"parent's ``__annotations__``. In Python 3.10 and newer, the child class's " -"annotations will be an empty dict instead." -msgstr "" - -#: ../../howto/annotations.rst:73 -msgid "Accessing The Annotations Dict Of An Object In Python 3.9 And Older" -msgstr "" - -#: ../../howto/annotations.rst:75 -msgid "" -"In Python 3.9 and older, accessing the annotations dict of an object is much " -"more complicated than in newer versions. The problem is a design flaw in " -"these older versions of Python, specifically to do with class annotations." -msgstr "" - -#: ../../howto/annotations.rst:80 -msgid "" -"Best practice for accessing the annotations dict of other objects--" -"functions, other callables, and modules--is the same as best practice for " -"3.10, assuming you aren't calling :func:`inspect.get_annotations`: you " -"should use three-argument :func:`getattr` to access the object's " -"``__annotations__`` attribute." -msgstr "" - -#: ../../howto/annotations.rst:87 -msgid "" -"Unfortunately, this isn't best practice for classes. The problem is that, " -"since ``__annotations__`` is optional on classes, and because classes can " -"inherit attributes from their base classes, accessing the " -"``__annotations__`` attribute of a class may inadvertently return the " -"annotations dict of a *base class.* As an example::" -msgstr "" - -#: ../../howto/annotations.rst:94 -msgid "" -"class Base:\n" -" a: int = 3\n" -" b: str = 'abc'\n" -"\n" -"class Derived(Base):\n" -" pass\n" -"\n" -"print(Derived.__annotations__)" -msgstr "" - -#: ../../howto/annotations.rst:103 -msgid "This will print the annotations dict from ``Base``, not ``Derived``." -msgstr "" - -#: ../../howto/annotations.rst:106 -msgid "" -"Your code will have to have a separate code path if the object you're " -"examining is a class (``isinstance(o, type)``). In that case, best practice " -"relies on an implementation detail of Python 3.9 and before: if a class has " -"annotations defined, they are stored in the class's :attr:`~type.__dict__` " -"dictionary. Since the class may or may not have annotations defined, best " -"practice is to call the :meth:`~dict.get` method on the class dict." -msgstr "" - -#: ../../howto/annotations.rst:114 -msgid "" -"To put it all together, here is some sample code that safely accesses the " -"``__annotations__`` attribute on an arbitrary object in Python 3.9 and " -"before::" -msgstr "" - -#: ../../howto/annotations.rst:118 -msgid "" -"if isinstance(o, type):\n" -" ann = o.__dict__.get('__annotations__', None)\n" -"else:\n" -" ann = getattr(o, '__annotations__', None)" -msgstr "" - -#: ../../howto/annotations.rst:123 -msgid "" -"After running this code, ``ann`` should be either a dictionary or ``None``. " -"You're encouraged to double-check the type of ``ann`` using :func:" -"`isinstance` before further examination." -msgstr "" - -#: ../../howto/annotations.rst:128 -msgid "" -"Note that some exotic or malformed type objects may not have a :attr:`~type." -"__dict__` attribute, so for extra safety you may also wish to use :func:" -"`getattr` to access :attr:`!__dict__`." -msgstr "" - -#: ../../howto/annotations.rst:134 -msgid "Manually Un-Stringizing Stringized Annotations" -msgstr "" - -#: ../../howto/annotations.rst:136 -msgid "" -"In situations where some annotations may be \"stringized\", and you wish to " -"evaluate those strings to produce the Python values they represent, it " -"really is best to call :func:`inspect.get_annotations` to do this work for " -"you." -msgstr "" - -#: ../../howto/annotations.rst:142 -msgid "" -"If you're using Python 3.9 or older, or if for some reason you can't use :" -"func:`inspect.get_annotations`, you'll need to duplicate its logic. You're " -"encouraged to examine the implementation of :func:`inspect.get_annotations` " -"in the current Python version and follow a similar approach." -msgstr "" - -#: ../../howto/annotations.rst:148 -msgid "" -"In a nutshell, if you wish to evaluate a stringized annotation on an " -"arbitrary object ``o``:" -msgstr "" - -#: ../../howto/annotations.rst:151 -msgid "" -"If ``o`` is a module, use ``o.__dict__`` as the ``globals`` when calling :" -"func:`eval`." -msgstr "" - -#: ../../howto/annotations.rst:153 -msgid "" -"If ``o`` is a class, use ``sys.modules[o.__module__].__dict__`` as the " -"``globals``, and ``dict(vars(o))`` as the ``locals``, when calling :func:" -"`eval`." -msgstr "" - -#: ../../howto/annotations.rst:156 -msgid "" -"If ``o`` is a wrapped callable using :func:`functools.update_wrapper`, :func:" -"`functools.wraps`, or :func:`functools.partial`, iteratively unwrap it by " -"accessing either ``o.__wrapped__`` or ``o.func`` as appropriate, until you " -"have found the root unwrapped function." -msgstr "" - -#: ../../howto/annotations.rst:160 -msgid "" -"If ``o`` is a callable (but not a class), use :attr:`o.__globals__ ` as the globals when calling :func:`eval`." -msgstr "" - -#: ../../howto/annotations.rst:164 -msgid "" -"However, not all string values used as annotations can be successfully " -"turned into Python values by :func:`eval`. String values could theoretically " -"contain any valid string, and in practice there are valid use cases for type " -"hints that require annotating with string values that specifically *can't* " -"be evaluated. For example:" -msgstr "" - -#: ../../howto/annotations.rst:171 -msgid "" -":pep:`604` union types using ``|``, before support for this was added to " -"Python 3.10." -msgstr "" - -#: ../../howto/annotations.rst:173 -msgid "" -"Definitions that aren't needed at runtime, only imported when :const:`typing." -"TYPE_CHECKING` is true." -msgstr "" - -#: ../../howto/annotations.rst:176 -msgid "" -"If :func:`eval` attempts to evaluate such values, it will fail and raise an " -"exception. So, when designing a library API that works with annotations, " -"it's recommended to only attempt to evaluate string values when explicitly " -"requested to by the caller." -msgstr "" - -#: ../../howto/annotations.rst:184 -msgid "Best Practices For ``__annotations__`` In Any Python Version" -msgstr "" - -#: ../../howto/annotations.rst:186 -msgid "" -"You should avoid assigning to the ``__annotations__`` member of objects " -"directly. Let Python manage setting ``__annotations__``." -msgstr "" - -#: ../../howto/annotations.rst:189 -msgid "" -"If you do assign directly to the ``__annotations__`` member of an object, " -"you should always set it to a ``dict`` object." -msgstr "" - -#: ../../howto/annotations.rst:192 -msgid "" -"You should avoid accessing ``__annotations__`` directly on any object. " -"Instead, use :func:`annotationlib.get_annotations` (Python 3.14+) or :func:" -"`inspect.get_annotations` (Python 3.10+)." -msgstr "" - -#: ../../howto/annotations.rst:196 -msgid "" -"If you do directly access the ``__annotations__`` member of an object, you " -"should ensure that it's a dictionary before attempting to examine its " -"contents." -msgstr "" - -#: ../../howto/annotations.rst:200 -msgid "You should avoid modifying ``__annotations__`` dicts." -msgstr "" - -#: ../../howto/annotations.rst:202 -msgid "" -"You should avoid deleting the ``__annotations__`` attribute of an object." -msgstr "" - -#: ../../howto/annotations.rst:207 -msgid "``__annotations__`` Quirks" -msgstr "" - -#: ../../howto/annotations.rst:209 -msgid "" -"In all versions of Python 3, function objects lazy-create an annotations " -"dict if no annotations are defined on that object. You can delete the " -"``__annotations__`` attribute using ``del fn.__annotations__``, but if you " -"then access ``fn.__annotations__`` the object will create a new empty dict " -"that it will store and return as its annotations. Deleting the annotations " -"on a function before it has lazily created its annotations dict will throw " -"an ``AttributeError``; using ``del fn.__annotations__`` twice in a row is " -"guaranteed to always throw an ``AttributeError``." -msgstr "" - -#: ../../howto/annotations.rst:219 -msgid "" -"Everything in the above paragraph also applies to class and module objects " -"in Python 3.10 and newer." -msgstr "" - -#: ../../howto/annotations.rst:222 -msgid "" -"In all versions of Python 3, you can set ``__annotations__`` on a function " -"object to ``None``. However, subsequently accessing the annotations on that " -"object using ``fn.__annotations__`` will lazy-create an empty dictionary as " -"per the first paragraph of this section. This is *not* true of modules and " -"classes, in any Python version; those objects permit setting " -"``__annotations__`` to any Python value, and will retain whatever value is " -"set." -msgstr "" - -#: ../../howto/annotations.rst:230 -msgid "" -"If Python stringizes your annotations for you (using ``from __future__ " -"import annotations``), and you specify a string as an annotation, the string " -"will itself be quoted. In effect the annotation is quoted *twice.* For " -"example::" -msgstr "" - -#: ../../howto/annotations.rst:236 -msgid "" -"from __future__ import annotations\n" -"def foo(a: \"str\"): pass\n" -"\n" -"print(foo.__annotations__)" -msgstr "" - -#: ../../howto/annotations.rst:241 -msgid "" -"This prints ``{'a': \"'str'\"}``. This shouldn't really be considered a " -"\"quirk\"; it's mentioned here simply because it might be surprising." -msgstr "" - -#: ../../howto/annotations.rst:244 -msgid "" -"If you use a class with a custom metaclass and access ``__annotations__`` on " -"the class, you may observe unexpected behavior; see :pep:`749 <749#pep749-" -"metaclasses>` for some examples. You can avoid these quirks by using :func:" -"`annotationlib.get_annotations` on Python 3.14+ or :func:`inspect." -"get_annotations` on Python 3.10+. On earlier versions of Python, you can " -"avoid these bugs by accessing the annotations from the class's :attr:`~type." -"__dict__` (for example, ``cls.__dict__.get('__annotations__', None)``)." -msgstr "" - -#: ../../howto/annotations.rst:253 -msgid "" -"In some versions of Python, instances of classes may have an " -"``__annotations__`` attribute. However, this is not supported functionality. " -"If you need the annotations of an instance, you can use :func:`type` to " -"access its class (for example, ``annotationlib." -"get_annotations(type(myinstance))`` on Python 3.14+)." -msgstr "" diff --git a/howto/argparse-optparse.po b/howto/argparse-optparse.po deleted file mode 100644 index a4055eae5..000000000 --- a/howto/argparse-optparse.po +++ /dev/null @@ -1,164 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation -# This file is distributed under the same license as the Python package. -# FIRST AUTHOR , YEAR. -# -# Translators: -# tomo, 2024 -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: Python 3.14\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-06 14:20+0000\n" -"PO-Revision-Date: 2024-10-11 14:19+0000\n" -"Last-Translator: tomo, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" -"ja/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#: ../../howto/argparse-optparse.rst:8 -msgid "Migrating ``optparse`` code to ``argparse``" -msgstr "" - -#: ../../howto/argparse-optparse.rst:10 -msgid "" -"The :mod:`argparse` module offers several higher level features not natively " -"provided by the :mod:`optparse` module, including:" -msgstr "" - -#: ../../howto/argparse-optparse.rst:13 -msgid "Handling positional arguments." -msgstr "位置引数を扱う" - -#: ../../howto/argparse-optparse.rst:14 -msgid "Supporting subcommands." -msgstr "" - -#: ../../howto/argparse-optparse.rst:15 -msgid "Allowing alternative option prefixes like ``+`` and ``/``." -msgstr "``+``, ``/`` のような代替オプションプレフィクスを許容する" - -#: ../../howto/argparse-optparse.rst:16 -msgid "Handling zero-or-more and one-or-more style arguments." -msgstr "zero-or-more スタイル、one-or-more スタイルの引数を扱う" - -#: ../../howto/argparse-optparse.rst:17 -msgid "Producing more informative usage messages." -msgstr "より有益な使用方法メッセージの生成" - -#: ../../howto/argparse-optparse.rst:18 -msgid "Providing a much simpler interface for custom ``type`` and ``action``." -msgstr "" -"カスタム ``type``, カスタム ``action`` のために遥かに簡単なインターフェイスを" -"提供する" - -#: ../../howto/argparse-optparse.rst:20 -msgid "" -"Originally, the :mod:`argparse` module attempted to maintain compatibility " -"with :mod:`optparse`. However, the fundamental design differences between " -"supporting declarative command line option processing (while leaving " -"positional argument processing to application code), and supporting both " -"named options and positional arguments in the declarative interface mean " -"that the API has diverged from that of ``optparse`` over time." -msgstr "" - -#: ../../howto/argparse-optparse.rst:27 -msgid "" -"As described in :ref:`choosing-an-argument-parser`, applications that are " -"currently using :mod:`optparse` and are happy with the way it works can just " -"continue to use ``optparse``." -msgstr "" - -#: ../../howto/argparse-optparse.rst:31 -msgid "" -"Application developers that are considering migrating should also review the " -"list of intrinsic behavioural differences described in that section before " -"deciding whether or not migration is desirable." -msgstr "" - -#: ../../howto/argparse-optparse.rst:35 -msgid "" -"For applications that do choose to migrate from :mod:`optparse` to :mod:" -"`argparse`, the following suggestions should be helpful:" -msgstr "" - -#: ../../howto/argparse-optparse.rst:38 -msgid "" -"Replace all :meth:`optparse.OptionParser.add_option` calls with :meth:" -"`ArgumentParser.add_argument` calls." -msgstr "" -"すべての :meth:`optparse.OptionParser.add_option` の呼び出しを、:meth:" -"`ArgumentParser.add_argument` の呼び出しに置き換える。" - -#: ../../howto/argparse-optparse.rst:41 -msgid "" -"Replace ``(options, args) = parser.parse_args()`` with ``args = parser." -"parse_args()`` and add additional :meth:`ArgumentParser.add_argument` calls " -"for the positional arguments. Keep in mind that what was previously called " -"``options``, now in the :mod:`argparse` context is called ``args``." -msgstr "" -"``(options, args) = parser.parse_args()`` を ``args = parser.parse_args()`` " -"に置き換え、位置引数のために必要に応じて :meth:`ArgumentParser.add_argument` " -"の呼び出しを追加する。これまで ``options`` と呼ばれていたものが、:mod:" -"`argparse` では ``args`` と呼ばれていることに留意してください。" - -#: ../../howto/argparse-optparse.rst:46 -msgid "" -"Replace :meth:`optparse.OptionParser.disable_interspersed_args` by using :" -"meth:`~ArgumentParser.parse_intermixed_args` instead of :meth:" -"`~ArgumentParser.parse_args`." -msgstr "" -":meth:`optparse.OptionParser.disable_interspersed_args` を、:meth:" -"`~ArgumentParser.parse_args` ではなく :meth:`~ArgumentParser." -"parse_intermixed_args` で置き換える。" - -#: ../../howto/argparse-optparse.rst:50 -msgid "" -"Replace callback actions and the ``callback_*`` keyword arguments with " -"``type`` or ``action`` arguments." -msgstr "" -"コールバック・アクションと ``callback_*`` キーワード引数を ``type`` や " -"``action`` 引数に置き換える。" - -#: ../../howto/argparse-optparse.rst:53 -msgid "" -"Replace string names for ``type`` keyword arguments with the corresponding " -"type objects (e.g. int, float, complex, etc)." -msgstr "" -"``type`` キーワード引数に渡していた文字列の名前を、それに応じたオブジェクト " -"(例: int, float, complex, ...) に置き換える。" - -#: ../../howto/argparse-optparse.rst:56 -msgid "" -"Replace :class:`optparse.Values` with :class:`Namespace` and :exc:`optparse." -"OptionError` and :exc:`optparse.OptionValueError` with :exc:`ArgumentError`." -msgstr "" -":class:`optparse.Values` を :class:`Namespace` に置き換え、:exc:`optparse." -"OptionError` と :exc:`optparse.OptionValueError` を :exc:`ArgumentError` に置" -"き換える。" - -#: ../../howto/argparse-optparse.rst:60 -msgid "" -"Replace strings with implicit arguments such as ``%default`` or ``%prog`` " -"with the standard Python syntax to use dictionaries to format strings, that " -"is, ``%(default)s`` and ``%(prog)s``." -msgstr "" -"``%default`` や ``%prog`` などの暗黙の引数を含む文字列を、``%(default)s`` や " -"``%(prog)s`` などの、通常の Python で辞書を使う場合のフォーマット文字列に置き" -"換える。" - -#: ../../howto/argparse-optparse.rst:64 -msgid "" -"Replace the OptionParser constructor ``version`` argument with a call to " -"``parser.add_argument('--version', action='http://github.com/version', version='')``." -msgstr "" -"OptionParser のコンストラクターの ``version`` 引数を、``parser." -"add_argument('--version', action='http://github.com/version', version='')`` に置き" -"換える" diff --git a/howto/argparse.po b/howto/argparse.po index 590516886..7cb87ea52 100644 --- a/howto/argparse.po +++ b/howto/argparse.po @@ -1,31 +1,31 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 -# Takeshi Nakazato, 2023 -# TENMYO Masakazu, 2024 -# Arihiro TAKASE, 2024 +# Osamu NAKAMURA, 2017 +# 秘湯 , 2017 +# SHIMIZU Taku , 2017 +# tomo, 2018 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-06 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:52+0000\n" -"Last-Translator: Arihiro TAKASE, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 17:44+0000\n" +"Last-Translator: tomo, 2018\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: ../../howto/argparse.rst:5 +#: ../../howto/argparse.rst:3 msgid "Argparse Tutorial" msgstr "Argparse チュートリアル" @@ -33,11 +33,11 @@ msgstr "Argparse チュートリアル" msgid "author" msgstr "author" -#: ../../howto/argparse.rst:7 -msgid "Tshepang Mbambo" -msgstr "Tshepang Mbambo" +#: ../../howto/argparse.rst:5 +msgid "Tshepang Lekhonkhobe" +msgstr "Tshepang Lekhonkhobe" -#: ../../howto/argparse.rst:11 +#: ../../howto/argparse.rst:9 msgid "" "This tutorial is intended to be a gentle introduction to :mod:`argparse`, " "the recommended command-line parsing module in the Python standard library." @@ -46,25 +46,23 @@ msgstr "" "は、Python 標準ライブラリの一部であり、おすすめのコマンドライン引数の解析モ" "ジュールです。" -#: ../../howto/argparse.rst:16 +#: ../../howto/argparse.rst:14 msgid "" -"The standard library includes two other libraries directly related to " -"command-line parameter processing: the lower level :mod:`optparse` module " -"(which may require more code to configure for a given application, but also " -"allows an application to request behaviors that ``argparse`` doesn't " -"support), and the very low level :mod:`getopt` (which specifically serves as " -"an equivalent to the :c:func:`!getopt` family of functions available to C " -"programmers). While neither of those modules is covered directly in this " -"guide, many of the core concepts in ``argparse`` first originated in " -"``optparse``, so some aspects of this tutorial will also be relevant to " -"``optparse`` users." +"There are two other modules that fulfill the same task, namely :mod:`getopt` " +"(an equivalent for :c:func:`getopt` from the C language) and the deprecated :" +"mod:`optparse`. Note also that :mod:`argparse` is based on :mod:`optparse`, " +"and therefore very similar in terms of usage." msgstr "" +"同じタスクを満足するモジュールとして、 :mod:`getopt` (C言語の :c:func:" +"`getopt` と同等) と廃止予定の :mod:`optparse` と呼ばれる二つのモジュールがあ" +"ります。 :mod:`argparse` は :mod:`optparse` をベースにしているので、使用方法" +"がよく似ています。" -#: ../../howto/argparse.rst:29 +#: ../../howto/argparse.rst:22 msgid "Concepts" msgstr "コンセプト" -#: ../../howto/argparse.rst:31 +#: ../../howto/argparse.rst:24 msgid "" "Let's show the sort of functionality that we are going to explore in this " "introductory tutorial by making use of the :command:`ls` command:" @@ -72,31 +70,11 @@ msgstr "" ":command:`ls` コマンドを使って、このチュートリアルで私たちが学ぶ機能をいくつ" "か見てみましょう:" -#: ../../howto/argparse.rst:34 -msgid "" -"$ ls\n" -"cpython devguide prog.py pypy rm-unused-function.patch\n" -"$ ls pypy\n" -"ctypes_configure demo dotviewer include lib_pypy lib-python ...\n" -"$ ls -l\n" -"total 20\n" -"drwxr-xr-x 19 wena wena 4096 Feb 18 18:51 cpython\n" -"drwxr-xr-x 4 wena wena 4096 Feb 8 12:04 devguide\n" -"-rwxr-xr-x 1 wena wena 535 Feb 19 00:05 prog.py\n" -"drwxr-xr-x 14 wena wena 4096 Feb 7 00:59 pypy\n" -"-rw-r--r-- 1 wena wena 741 Feb 18 01:01 rm-unused-function.patch\n" -"$ ls --help\n" -"Usage: ls [OPTION]... [FILE]...\n" -"List information about the FILEs (the current directory by default).\n" -"Sort entries alphabetically if none of -cftuvSUX nor --sort is specified.\n" -"..." -msgstr "" - -#: ../../howto/argparse.rst:53 +#: ../../howto/argparse.rst:46 msgid "A few concepts we can learn from the four commands:" msgstr "上の4つの実行結果から、以下のことが分かります:" -#: ../../howto/argparse.rst:55 +#: ../../howto/argparse.rst:48 msgid "" "The :command:`ls` command is useful when run without any options at all. It " "defaults to displaying the contents of the current directory." @@ -104,7 +82,7 @@ msgstr "" ":command:`ls` コマンドは、まったくオプションを指定せずに実行したとしても役に" "立ちます。デフォルトの動作は、カレントディレクトリの内容を表示することです。" -#: ../../howto/argparse.rst:58 +#: ../../howto/argparse.rst:51 msgid "" "If we want beyond what it provides by default, we tell it a bit more. In " "this case, we want it to display a different directory, ``pypy``. What we " @@ -124,7 +102,7 @@ msgstr "" "ンドのもっとも基本的な使い方は、 ``cp SRC DEST`` です。最初の引数は *何をコ" "ピーしたいか* であり、二つ目の引数は *どこにコピーしたいか* を意味します。" -#: ../../howto/argparse.rst:67 +#: ../../howto/argparse.rst:60 msgid "" "Now, say we want to change behaviour of the program. In our example, we " "display more info for each file instead of just showing the file names. The " @@ -134,7 +112,7 @@ msgstr "" "それぞれのファイルに関する多くの情報を表示します。このケースでは、``-l`` は" "optional引数として知られます。" -#: ../../howto/argparse.rst:71 +#: ../../howto/argparse.rst:64 msgid "" "That's a snippet of the help text. It's very useful in that you can come " "across a program you have never used before, and can figure out how it works " @@ -144,48 +122,25 @@ msgstr "" "にたいして行うと有用で、ヘルプテキストを読むことで、プログラムがどのように動" "作するかわかります。" -#: ../../howto/argparse.rst:77 +#: ../../howto/argparse.rst:70 msgid "The basics" msgstr "基礎" -#: ../../howto/argparse.rst:79 +#: ../../howto/argparse.rst:72 msgid "Let us start with a very simple example which does (almost) nothing::" msgstr "(ほとんど)何もしない、とても簡単な例から始めましょう::" -#: ../../howto/argparse.rst:81 -msgid "" -"import argparse\n" -"parser = argparse.ArgumentParser()\n" -"parser.parse_args()" -msgstr "" - -#: ../../howto/argparse.rst:85 ../../howto/argparse.rst:193 -#: ../../howto/argparse.rst:214 +#: ../../howto/argparse.rst:78 ../../howto/argparse.rst:186 +#: ../../howto/argparse.rst:207 msgid "Following is a result of running the code:" msgstr "下記がこのコードを実行した結果です:" -#: ../../howto/argparse.rst:87 -msgid "" -"$ python prog.py\n" -"$ python prog.py --help\n" -"usage: prog.py [-h]\n" -"\n" -"options:\n" -" -h, --help show this help message and exit\n" -"$ python prog.py --verbose\n" -"usage: prog.py [-h]\n" -"prog.py: error: unrecognized arguments: --verbose\n" -"$ python prog.py foo\n" -"usage: prog.py [-h]\n" -"prog.py: error: unrecognized arguments: foo" -msgstr "" - -#: ../../howto/argparse.rst:102 ../../howto/argparse.rst:259 -#: ../../howto/argparse.rst:303 +#: ../../howto/argparse.rst:95 ../../howto/argparse.rst:252 +#: ../../howto/argparse.rst:296 msgid "Here is what is happening:" msgstr "こんなことが起こりました:" -#: ../../howto/argparse.rst:104 +#: ../../howto/argparse.rst:97 msgid "" "Running the script without any options results in nothing displayed to " "stdout. Not so useful." @@ -193,7 +148,7 @@ msgstr "" "オプションなしでスクリプトを実行した結果、なにも標準出力に表示されませんでし" "た。それほど便利ではありませんね。" -#: ../../howto/argparse.rst:107 +#: ../../howto/argparse.rst:100 msgid "" "The second one starts to display the usefulness of the :mod:`argparse` " "module. We have done almost nothing, but already we get a nice help message." @@ -201,7 +156,7 @@ msgstr "" "二つ目の実行結果から :mod:`argparse` モジュールの有用性がわかります。ほとんど" "何もしていないのに、すてきなヘルプメッセージが手に入りました。" -#: ../../howto/argparse.rst:110 +#: ../../howto/argparse.rst:103 msgid "" "The ``--help`` option, which can also be shortened to ``-h``, is the only " "option we get for free (i.e. no need to specify it). Specifying anything " @@ -213,72 +168,45 @@ msgstr "" "ります。エラー時の有用な用法メッセージも、プログラムで指示することなく出力で" "きます。" -#: ../../howto/argparse.rst:117 +#: ../../howto/argparse.rst:110 msgid "Introducing Positional arguments" msgstr "位置引数の入門" -#: ../../howto/argparse.rst:119 +#: ../../howto/argparse.rst:112 msgid "An example::" msgstr "以下に例を示します::" -#: ../../howto/argparse.rst:121 -msgid "" -"import argparse\n" -"parser = argparse.ArgumentParser()\n" -"parser.add_argument(\"echo\")\n" -"args = parser.parse_args()\n" -"print(args.echo)" -msgstr "" - -#: ../../howto/argparse.rst:127 +#: ../../howto/argparse.rst:120 msgid "And running the code:" msgstr "このコードを実行してみましょう:" -#: ../../howto/argparse.rst:129 -msgid "" -"$ python prog.py\n" -"usage: prog.py [-h] echo\n" -"prog.py: error: the following arguments are required: echo\n" -"$ python prog.py --help\n" -"usage: prog.py [-h] echo\n" -"\n" -"positional arguments:\n" -" echo\n" -"\n" -"options:\n" -" -h, --help show this help message and exit\n" -"$ python prog.py foo\n" -"foo" -msgstr "" - -#: ../../howto/argparse.rst:145 +#: ../../howto/argparse.rst:138 msgid "Here is what's happening:" msgstr "こんなことが起こりました:" -#: ../../howto/argparse.rst:147 +#: ../../howto/argparse.rst:140 msgid "" -"We've added the :meth:`~ArgumentParser.add_argument` method, which is what " -"we use to specify which command-line options the program is willing to " -"accept. In this case, I've named it ``echo`` so that it's in line with its " -"function." +"We've added the :meth:`add_argument` method, which is what we use to specify " +"which command-line options the program is willing to accept. In this case, " +"I've named it ``echo`` so that it's in line with its function." msgstr "" -"プログラムが受け付けるコマンドラインオプションを指定するメソッドである :meth:" -"`~ArgumentParser.add_argument` を追加しました。ここでは、その機能にあわせて引" -"数名を ``echo`` としました。" +":meth:`add_argument` メソッドを追加しました。このメソッドはプログラムがどんな" +"コマンドラインオプションを受け付けるか指定するためのものです。このケースでは" +"オプションにその機能と合うように ``echo`` と名付けました。" -#: ../../howto/argparse.rst:151 +#: ../../howto/argparse.rst:144 msgid "Calling our program now requires us to specify an option." msgstr "プログラムを実行すると、オプションを指定するように要求されます。" -#: ../../howto/argparse.rst:153 +#: ../../howto/argparse.rst:146 msgid "" -"The :meth:`~ArgumentParser.parse_args` method actually returns some data " -"from the options specified, in this case, ``echo``." +"The :meth:`parse_args` method actually returns some data from the options " +"specified, in this case, ``echo``." msgstr "" -":meth:`~ArgumentParser.parse_args` メソッドは指定されたオプションを、この場合" -"は ``echo`` として、返します。" +":meth:`parse_args` メソッドは指定されたオプションのデータを返します。このケー" +"スでは ``echo`` です。" -#: ../../howto/argparse.rst:156 +#: ../../howto/argparse.rst:149 msgid "" "The variable is some form of 'magic' that :mod:`argparse` performs for free " "(i.e. no need to specify which variable that value is stored in). You will " @@ -289,7 +217,7 @@ msgstr "" "る変数を指定する必要がありません)。変数の名前がメソッドに与えた文字列引数 " "``echo`` と同じことに気付いたでしょう。" -#: ../../howto/argparse.rst:161 +#: ../../howto/argparse.rst:154 msgid "" "Note however that, although the help display looks nice and all, it " "currently is not as helpful as it can be. For example we see that we got " @@ -302,55 +230,15 @@ msgstr "" "ためには推測するかソースコードを見なけれなりません。もうすこしヘルプメッセー" "ジ分かりやすくしてみましょう::" -#: ../../howto/argparse.rst:166 -msgid "" -"import argparse\n" -"parser = argparse.ArgumentParser()\n" -"parser.add_argument(\"echo\", help=\"echo the string you use here\")\n" -"args = parser.parse_args()\n" -"print(args.echo)" -msgstr "" - -#: ../../howto/argparse.rst:172 +#: ../../howto/argparse.rst:165 msgid "And we get:" msgstr "修正した結果は以下のようになります:" -#: ../../howto/argparse.rst:174 -msgid "" -"$ python prog.py -h\n" -"usage: prog.py [-h] echo\n" -"\n" -"positional arguments:\n" -" echo echo the string you use here\n" -"\n" -"options:\n" -" -h, --help show this help message and exit" -msgstr "" - -#: ../../howto/argparse.rst:185 +#: ../../howto/argparse.rst:178 msgid "Now, how about doing something even more useful::" msgstr "次は、もっと有益なことをしてみませんか?::" -#: ../../howto/argparse.rst:187 -msgid "" -"import argparse\n" -"parser = argparse.ArgumentParser()\n" -"parser.add_argument(\"square\", help=\"display a square of a given " -"number\")\n" -"args = parser.parse_args()\n" -"print(args.square**2)" -msgstr "" - -#: ../../howto/argparse.rst:195 -msgid "" -"$ python prog.py 4\n" -"Traceback (most recent call last):\n" -" File \"prog.py\", line 5, in \n" -" print(args.square**2)\n" -"TypeError: unsupported operand type(s) for ** or pow(): 'str' and 'int'" -msgstr "" - -#: ../../howto/argparse.rst:203 +#: ../../howto/argparse.rst:196 msgid "" "That didn't go so well. That's because :mod:`argparse` treats the options we " "give it as strings, unless we tell it otherwise. So, let's tell :mod:" @@ -360,27 +248,7 @@ msgstr "" "ションを文字列として扱います。 :mod:`argparse` にオプションの値を整数として扱" "うように伝えましょう::" -#: ../../howto/argparse.rst:207 -msgid "" -"import argparse\n" -"parser = argparse.ArgumentParser()\n" -"parser.add_argument(\"square\", help=\"display a square of a given " -"number\",\n" -" type=int)\n" -"args = parser.parse_args()\n" -"print(args.square**2)" -msgstr "" - -#: ../../howto/argparse.rst:216 -msgid "" -"$ python prog.py 4\n" -"16\n" -"$ python prog.py four\n" -"usage: prog.py [-h] square\n" -"prog.py: error: argument square: invalid int value: 'four'" -msgstr "" - -#: ../../howto/argparse.rst:224 +#: ../../howto/argparse.rst:217 msgid "" "That went well. The program now even helpfully quits on bad illegal input " "before proceeding." @@ -388,11 +256,11 @@ msgstr "" "今度は上手くいきました。このプログラムは不正な入力が与えられるとそれを処理せ" "ずに、より親切なメッセージを表示して実行を終了します。" -#: ../../howto/argparse.rst:229 +#: ../../howto/argparse.rst:222 msgid "Introducing Optional arguments" msgstr "Optional引数の導入" -#: ../../howto/argparse.rst:231 +#: ../../howto/argparse.rst:224 msgid "" "So far we have been playing with positional arguments. Let us have a look on " "how to add optional ones::" @@ -400,39 +268,12 @@ msgstr "" "ここまで位置引数を扱ってきました。optional引数を追加する方法についても見てい" "きましょう::" -#: ../../howto/argparse.rst:234 -msgid "" -"import argparse\n" -"parser = argparse.ArgumentParser()\n" -"parser.add_argument(\"--verbosity\", help=\"increase output verbosity\")\n" -"args = parser.parse_args()\n" -"if args.verbosity:\n" -" print(\"verbosity turned on\")" -msgstr "" - -#: ../../howto/argparse.rst:241 ../../howto/argparse.rst:287 -#: ../../howto/argparse.rst:403 ../../howto/argparse.rst:437 +#: ../../howto/argparse.rst:234 ../../howto/argparse.rst:280 +#: ../../howto/argparse.rst:396 ../../howto/argparse.rst:430 msgid "And the output:" msgstr "実行してみましょう:" -#: ../../howto/argparse.rst:243 -msgid "" -"$ python prog.py --verbosity 1\n" -"verbosity turned on\n" -"$ python prog.py\n" -"$ python prog.py --help\n" -"usage: prog.py [-h] [--verbosity VERBOSITY]\n" -"\n" -"options:\n" -" -h, --help show this help message and exit\n" -" --verbosity VERBOSITY\n" -" increase output verbosity\n" -"$ python prog.py --verbosity\n" -"usage: prog.py [-h] [--verbosity VERBOSITY]\n" -"prog.py: error: argument --verbosity: expected one argument" -msgstr "" - -#: ../../howto/argparse.rst:261 +#: ../../howto/argparse.rst:254 msgid "" "The program is written so as to display something when ``--verbosity`` is " "specified and display nothing when not." @@ -440,25 +281,25 @@ msgstr "" "プログラムは、``--verbosity`` が指定された場合はなにかしらを表示し、指定され" "なければ何も表示をしないように書かれています。" -#: ../../howto/argparse.rst:264 +#: ../../howto/argparse.rst:257 msgid "" "To show that the option is actually optional, there is no error when running " "the program without it. Note that by default, if an optional argument isn't " -"used, the relevant variable, in this case ``args.verbosity``, is given " +"used, the relevant variable, in this case :attr:`args.verbosity`, is given " "``None`` as a value, which is the reason it fails the truth test of the :" "keyword:`if` statement." msgstr "" -"オプションの指定が実際に任意であることを示すために、プログラムをオプション指" -"定なしで実行してもエラーにはなっていません。オプション引数が指定されなかった" -"場合、関連する変数、この例では ``args.verbosity`` 、の値にはデフォルトで " -"``None`` がセットされます。これが :keyword:`if` 文による真偽テストに失敗した" -"理由です。" +"optional 引数を指定せずにプログラムを実行したときにエラーにならないことから、" +"このオプションの指定が任意(optional)であることがわかります。注意すべき点とし" +"て、デフォルトでは、optional 引数が使用されないときは、関連する変数(このケー" +"スでは、 :attr:`args.verbosity`) の値に ``None`` が設定されることです。こうす" +"る理由は :keyword:`if` 文の真偽判定が偽を返すようにするためです。" -#: ../../howto/argparse.rst:270 +#: ../../howto/argparse.rst:263 msgid "The help message is a bit different." msgstr "ヘルプメッセージが少し変わりました。" -#: ../../howto/argparse.rst:272 +#: ../../howto/argparse.rst:265 msgid "" "When using the ``--verbosity`` option, one must also specify some value, any " "value." @@ -466,7 +307,7 @@ msgstr "" "``--verbosity`` オプションを使うには、そのオプションにひとつの値を指定しなけ" "ればなりません。" -#: ../../howto/argparse.rst:275 +#: ../../howto/argparse.rst:268 msgid "" "The above example accepts arbitrary integer values for ``--verbosity``, but " "for our simple program, only two values are actually useful, ``True`` or " @@ -476,48 +317,22 @@ msgstr "" "は、実際には ``True`` または ``False`` の二つの値だけが有効です。そうなるよう" "にコードを修正してみましょう::" -#: ../../howto/argparse.rst:279 -msgid "" -"import argparse\n" -"parser = argparse.ArgumentParser()\n" -"parser.add_argument(\"--verbose\", help=\"increase output verbosity\",\n" -" action=\"store_true\")\n" -"args = parser.parse_args()\n" -"if args.verbose:\n" -" print(\"verbosity turned on\")" -msgstr "" - -#: ../../howto/argparse.rst:289 -msgid "" -"$ python prog.py --verbose\n" -"verbosity turned on\n" -"$ python prog.py --verbose 1\n" -"usage: prog.py [-h] [--verbose]\n" -"prog.py: error: unrecognized arguments: 1\n" -"$ python prog.py --help\n" -"usage: prog.py [-h] [--verbose]\n" -"\n" -"options:\n" -" -h, --help show this help message and exit\n" -" --verbose increase output verbosity" -msgstr "" - -#: ../../howto/argparse.rst:305 +#: ../../howto/argparse.rst:298 msgid "" "The option is now more of a flag than something that requires a value. We " "even changed the name of the option to match that idea. Note that we now " "specify a new keyword, ``action``, and give it the value ``\"store_true\"``. " -"This means that, if the option is specified, assign the value ``True`` to " -"``args.verbose``. Not specifying it implies ``False``." +"This means that, if the option is specified, assign the value ``True`` to :" +"data:`args.verbose`. Not specifying it implies ``False``." msgstr "" -"オプションは値を必要とするのではなく、単なるフラグになりました。この考え方に" -"沿うようにオプションの名前も変更しています。ここで新しいキーワード " -"``action`` を指定し、値として ``\"store_true\"`` を設定していることに注意して" -"ください。これは、オプションが指定された場合に値として ``True`` を ``args." -"verbose`` に設定するということを意味します。オプションの指定がない場合の値は " -"``False`` となることを意味します。" +"いまや、このオプションは値をとるオプションというよりは、フラグになりました。" +"オプションの名前をその意図に合うように変更しました。新しいキーワード引数 " +"``action`` に ``\"store_true\"`` を値として渡していることに注意してください。" +"これはオプションが指定されると :data:`args.verbose` に ``True`` を代入するこ" +"とを意味しています。もしオプションが指定されなければ代入される値は ``False`` " +"になります。" -#: ../../howto/argparse.rst:312 +#: ../../howto/argparse.rst:305 msgid "" "It complains when you specify a value, in true spirit of what flags actually " "are." @@ -525,15 +340,15 @@ msgstr "" "フラグは値を取るべきではないので、値を指定するとプログラムはエラーになりま" "す。" -#: ../../howto/argparse.rst:315 +#: ../../howto/argparse.rst:308 msgid "Notice the different help text." msgstr "ヘルプテキストが変わっています。" -#: ../../howto/argparse.rst:319 +#: ../../howto/argparse.rst:312 msgid "Short options" msgstr "短いオプション" -#: ../../howto/argparse.rst:321 +#: ../../howto/argparse.rst:314 msgid "" "If you are familiar with command line usage, you will notice that I haven't " "yet touched on the topic of short versions of the options. It's quite " @@ -542,88 +357,35 @@ msgstr "" "コマンドラインになれていれば、オプションの短いバージョンの話題に触れていない" "ことに気付いたでしょう。それはとても簡単です::" -#: ../../howto/argparse.rst:325 -msgid "" -"import argparse\n" -"parser = argparse.ArgumentParser()\n" -"parser.add_argument(\"-v\", \"--verbose\", help=\"increase output " -"verbosity\",\n" -" action=\"store_true\")\n" -"args = parser.parse_args()\n" -"if args.verbose:\n" -" print(\"verbosity turned on\")" -msgstr "" - -#: ../../howto/argparse.rst:333 +#: ../../howto/argparse.rst:326 msgid "And here goes:" msgstr "上記のプログラムを実行するとこうなります:" -#: ../../howto/argparse.rst:335 -msgid "" -"$ python prog.py -v\n" -"verbosity turned on\n" -"$ python prog.py --help\n" -"usage: prog.py [-h] [-v]\n" -"\n" -"options:\n" -" -h, --help show this help message and exit\n" -" -v, --verbose increase output verbosity" -msgstr "" - -#: ../../howto/argparse.rst:346 +#: ../../howto/argparse.rst:339 msgid "Note that the new ability is also reflected in the help text." msgstr "新しい機能がヘルプテキストにも反映されている点に気付いたでしょう。" -#: ../../howto/argparse.rst:350 +#: ../../howto/argparse.rst:343 msgid "Combining Positional and Optional arguments" msgstr "位置引数とOptional引数の併用" -#: ../../howto/argparse.rst:352 +#: ../../howto/argparse.rst:345 msgid "Our program keeps growing in complexity::" msgstr "プログラムが複雑になってきました::" -#: ../../howto/argparse.rst:354 -msgid "" -"import argparse\n" -"parser = argparse.ArgumentParser()\n" -"parser.add_argument(\"square\", type=int,\n" -" help=\"display a square of a given number\")\n" -"parser.add_argument(\"-v\", \"--verbose\", action=\"store_true\",\n" -" help=\"increase output verbosity\")\n" -"args = parser.parse_args()\n" -"answer = args.square**2\n" -"if args.verbose:\n" -" print(f\"the square of {args.square} equals {answer}\")\n" -"else:\n" -" print(answer)" -msgstr "" - -#: ../../howto/argparse.rst:367 +#: ../../howto/argparse.rst:360 msgid "And now the output:" msgstr "出力は以下のようになります:" -#: ../../howto/argparse.rst:369 -msgid "" -"$ python prog.py\n" -"usage: prog.py [-h] [-v] square\n" -"prog.py: error: the following arguments are required: square\n" -"$ python prog.py 4\n" -"16\n" -"$ python prog.py 4 --verbose\n" -"the square of 4 equals 16\n" -"$ python prog.py --verbose 4\n" -"the square of 4 equals 16" -msgstr "" - -#: ../../howto/argparse.rst:381 +#: ../../howto/argparse.rst:374 msgid "We've brought back a positional argument, hence the complaint." msgstr "位置引数を元に戻したので、引数を指定しないとエラーになりました。" -#: ../../howto/argparse.rst:383 +#: ../../howto/argparse.rst:376 msgid "Note that the order does not matter." msgstr "2つのオプションの順序を考慮しないことに注意してください。" -#: ../../howto/argparse.rst:385 +#: ../../howto/argparse.rst:378 msgid "" "How about we give this program of ours back the ability to have multiple " "verbosity values, and actually get to use them::" @@ -631,40 +393,7 @@ msgstr "" "複数の詳細レベルを値にとれるようにプログラムを元に戻して、指定された値を使っ" "てみましょう::" -#: ../../howto/argparse.rst:388 -msgid "" -"import argparse\n" -"parser = argparse.ArgumentParser()\n" -"parser.add_argument(\"square\", type=int,\n" -" help=\"display a square of a given number\")\n" -"parser.add_argument(\"-v\", \"--verbosity\", type=int,\n" -" help=\"increase output verbosity\")\n" -"args = parser.parse_args()\n" -"answer = args.square**2\n" -"if args.verbosity == 2:\n" -" print(f\"the square of {args.square} equals {answer}\")\n" -"elif args.verbosity == 1:\n" -" print(f\"{args.square}^2 == {answer}\")\n" -"else:\n" -" print(answer)" -msgstr "" - -#: ../../howto/argparse.rst:405 -msgid "" -"$ python prog.py 4\n" -"16\n" -"$ python prog.py 4 -v\n" -"usage: prog.py [-h] [-v VERBOSITY] square\n" -"prog.py: error: argument -v/--verbosity: expected one argument\n" -"$ python prog.py 4 -v 1\n" -"4^2 == 16\n" -"$ python prog.py 4 -v 2\n" -"the square of 4 equals 16\n" -"$ python prog.py 4 -v 3\n" -"16" -msgstr "" - -#: ../../howto/argparse.rst:419 +#: ../../howto/argparse.rst:412 msgid "" "These all look good except the last one, which exposes a bug in our program. " "Let's fix it by restricting the values the ``--verbosity`` option can " @@ -673,43 +402,7 @@ msgstr "" "プログラムのバグである最後の結果を除いて、上手く行っているようです。このバグ" "を、``--verbosity`` オプションが取れる値を制限することで修正しましょう::" -#: ../../howto/argparse.rst:422 -msgid "" -"import argparse\n" -"parser = argparse.ArgumentParser()\n" -"parser.add_argument(\"square\", type=int,\n" -" help=\"display a square of a given number\")\n" -"parser.add_argument(\"-v\", \"--verbosity\", type=int, choices=[0, 1, 2],\n" -" help=\"increase output verbosity\")\n" -"args = parser.parse_args()\n" -"answer = args.square**2\n" -"if args.verbosity == 2:\n" -" print(f\"the square of {args.square} equals {answer}\")\n" -"elif args.verbosity == 1:\n" -" print(f\"{args.square}^2 == {answer}\")\n" -"else:\n" -" print(answer)" -msgstr "" - -#: ../../howto/argparse.rst:439 -msgid "" -"$ python prog.py 4 -v 3\n" -"usage: prog.py [-h] [-v {0,1,2}] square\n" -"prog.py: error: argument -v/--verbosity: invalid choice: 3 (choose from 0, " -"1, 2)\n" -"$ python prog.py 4 -h\n" -"usage: prog.py [-h] [-v {0,1,2}] square\n" -"\n" -"positional arguments:\n" -" square display a square of a given number\n" -"\n" -"options:\n" -" -h, --help show this help message and exit\n" -" -v, --verbosity {0,1,2}\n" -" increase output verbosity" -msgstr "" - -#: ../../howto/argparse.rst:455 +#: ../../howto/argparse.rst:448 msgid "" "Note that the change also reflects both in the error message as well as the " "help string." @@ -717,7 +410,7 @@ msgstr "" "変更がエラーメッセージとヘルプメッセージの両方に反映されていることに注意して" "ください。" -#: ../../howto/argparse.rst:458 +#: ../../howto/argparse.rst:451 msgid "" "Now, let's use a different approach of playing with verbosity, which is " "pretty common. It also matches the way the CPython executable handles its " @@ -727,59 +420,15 @@ msgstr "" "ファイルがその詳細レベル引数を扱う方法と同じです。( ``python --help`` の出力" "を確認してください)::" -#: ../../howto/argparse.rst:462 -msgid "" -"import argparse\n" -"parser = argparse.ArgumentParser()\n" -"parser.add_argument(\"square\", type=int,\n" -" help=\"display the square of a given number\")\n" -"parser.add_argument(\"-v\", \"--verbosity\", action=\"count\",\n" -" help=\"increase output verbosity\")\n" -"args = parser.parse_args()\n" -"answer = args.square**2\n" -"if args.verbosity == 2:\n" -" print(f\"the square of {args.square} equals {answer}\")\n" -"elif args.verbosity == 1:\n" -" print(f\"{args.square}^2 == {answer}\")\n" -"else:\n" -" print(answer)" -msgstr "" - -#: ../../howto/argparse.rst:477 +#: ../../howto/argparse.rst:470 msgid "" "We have introduced another action, \"count\", to count the number of " -"occurrences of specific options." +"occurrences of a specific optional arguments:" msgstr "" "もう一つの action である \"count\" を紹介します。これは指定されたオプションの" -"出現回数を数えます:" - -#: ../../howto/argparse.rst:481 -msgid "" -"$ python prog.py 4\n" -"16\n" -"$ python prog.py 4 -v\n" -"4^2 == 16\n" -"$ python prog.py 4 -vv\n" -"the square of 4 equals 16\n" -"$ python prog.py 4 --verbosity --verbosity\n" -"the square of 4 equals 16\n" -"$ python prog.py 4 -v 1\n" -"usage: prog.py [-h] [-v] square\n" -"prog.py: error: unrecognized arguments: 1\n" -"$ python prog.py 4 -h\n" -"usage: prog.py [-h] [-v] square\n" -"\n" -"positional arguments:\n" -" square display a square of a given number\n" -"\n" -"options:\n" -" -h, --help show this help message and exit\n" -" -v, --verbosity increase output verbosity\n" -"$ python prog.py 4 -vvv\n" -"16" -msgstr "" +"出現回数をカウントします:" -#: ../../howto/argparse.rst:506 +#: ../../howto/argparse.rst:498 msgid "" "Yes, it's now more of a flag (similar to ``action=\"store_true\"``) in the " "previous version of our script. That should explain the complaint." @@ -788,11 +437,11 @@ msgstr "" "ます)になりました。エラーとなる理由がわかります。(訳注: 5つ目の例では ``-" "v`` オプションに引数を与えたため、エラーとなっています。)" -#: ../../howto/argparse.rst:509 +#: ../../howto/argparse.rst:501 msgid "It also behaves similar to \"store_true\" action." msgstr "これは\"store_true\" アクションによく似た動作をします。" -#: ../../howto/argparse.rst:511 +#: ../../howto/argparse.rst:503 msgid "" "Now here's a demonstration of what the \"count\" action gives. You've " "probably seen this sort of usage before." @@ -800,19 +449,19 @@ msgstr "" "では \"count\" アクションが何をもたらすかデモンストレーションをします。おそら" "くこのような使用方法を前に見たことがあるでしょう。" -#: ../../howto/argparse.rst:514 +#: ../../howto/argparse.rst:506 msgid "" "And if you don't specify the ``-v`` flag, that flag is considered to have " "``None`` value." msgstr "``-v`` フラグを指定しなければ、フラグの値は ``None`` とみなされます。" -#: ../../howto/argparse.rst:517 +#: ../../howto/argparse.rst:509 msgid "" "As should be expected, specifying the long form of the flag, we should get " "the same output." msgstr "期待通り、長い形式のフラグを指定しても同じ結果になります。" -#: ../../howto/argparse.rst:520 +#: ../../howto/argparse.rst:512 msgid "" "Sadly, our help output isn't very informative on the new ability our script " "has acquired, but that can always be fixed by improving the documentation " @@ -822,52 +471,19 @@ msgstr "" "はありません。しかし、スクリプトのドキュメンテーションを改善することでいつで" "も修正することができます(例えば、``help`` キーワード引数を使用することで)。" -#: ../../howto/argparse.rst:524 +#: ../../howto/argparse.rst:516 msgid "That last output exposes a bug in our program." msgstr "最後の出力はプログラムにバグがあることを示します。" -#: ../../howto/argparse.rst:527 +#: ../../howto/argparse.rst:519 msgid "Let's fix::" msgstr "修正しましょう::" -#: ../../howto/argparse.rst:529 -msgid "" -"import argparse\n" -"parser = argparse.ArgumentParser()\n" -"parser.add_argument(\"square\", type=int,\n" -" help=\"display a square of a given number\")\n" -"parser.add_argument(\"-v\", \"--verbosity\", action=\"count\",\n" -" help=\"increase output verbosity\")\n" -"args = parser.parse_args()\n" -"answer = args.square**2\n" -"\n" -"# bugfix: replace == with >=\n" -"if args.verbosity >= 2:\n" -" print(f\"the square of {args.square} equals {answer}\")\n" -"elif args.verbosity >= 1:\n" -" print(f\"{args.square}^2 == {answer}\")\n" -"else:\n" -" print(answer)" -msgstr "" - -#: ../../howto/argparse.rst:546 +#: ../../howto/argparse.rst:538 msgid "And this is what it gives:" msgstr "これが結果です:" -#: ../../howto/argparse.rst:548 -msgid "" -"$ python prog.py 4 -vvv\n" -"the square of 4 equals 16\n" -"$ python prog.py 4 -vvvv\n" -"the square of 4 equals 16\n" -"$ python prog.py 4\n" -"Traceback (most recent call last):\n" -" File \"prog.py\", line 11, in \n" -" if args.verbosity >= 2:\n" -"TypeError: '>=' not supported between instances of 'NoneType' and 'int'" -msgstr "" - -#: ../../howto/argparse.rst:561 +#: ../../howto/argparse.rst:553 msgid "" "First output went well, and fixes the bug we had before. That is, we want " "any value >= 2 to be as verbose as possible." @@ -875,33 +491,15 @@ msgstr "" "最初の出力は上手くいっていますし、以前のバグが修正されています。最も詳細な出" "力を得るには、2 以上の値が必要です。" -#: ../../howto/argparse.rst:564 +#: ../../howto/argparse.rst:556 msgid "Third output not so good." msgstr "三番目の結果は、よくありません。" -#: ../../howto/argparse.rst:566 +#: ../../howto/argparse.rst:558 msgid "Let's fix that bug::" msgstr "このバグを修正しましょう::" -#: ../../howto/argparse.rst:568 -msgid "" -"import argparse\n" -"parser = argparse.ArgumentParser()\n" -"parser.add_argument(\"square\", type=int,\n" -" help=\"display a square of a given number\")\n" -"parser.add_argument(\"-v\", \"--verbosity\", action=\"count\", default=0,\n" -" help=\"increase output verbosity\")\n" -"args = parser.parse_args()\n" -"answer = args.square**2\n" -"if args.verbosity >= 2:\n" -" print(f\"the square of {args.square} equals {answer}\")\n" -"elif args.verbosity >= 1:\n" -" print(f\"{args.square}^2 == {answer}\")\n" -"else:\n" -" print(answer)" -msgstr "" - -#: ../../howto/argparse.rst:583 +#: ../../howto/argparse.rst:575 msgid "" "We've just introduced yet another keyword, ``default``. We've set it to " "``0`` in order to make it comparable to the other int values. Remember that " @@ -914,17 +512,11 @@ msgstr "" "れていない場合 ``None`` となること、``None`` が整数値と比較できない(よって :" "exc:`TypeError` 例外となる)ことを思い出してください。" -#: ../../howto/argparse.rst:590 +#: ../../howto/argparse.rst:582 msgid "And:" msgstr "こうなりました:" -#: ../../howto/argparse.rst:592 -msgid "" -"$ python prog.py 4\n" -"16" -msgstr "" - -#: ../../howto/argparse.rst:597 +#: ../../howto/argparse.rst:589 msgid "" "You can go quite far just with what we've learned so far, and we have only " "scratched the surface. The :mod:`argparse` module is very powerful, and " @@ -934,11 +526,11 @@ msgstr "" "ぞっただけです。 :mod:`argparse` モジュールはとても強力ですので、チュートリア" "ルを終える前にもう少しだけ探検してみましょう." -#: ../../howto/argparse.rst:604 +#: ../../howto/argparse.rst:596 msgid "Getting a little more advanced" msgstr "もうちょっとだけ学ぶ" -#: ../../howto/argparse.rst:606 +#: ../../howto/argparse.rst:598 msgid "" "What if we wanted to expand our tiny program to perform other powers, not " "just squares::" @@ -946,48 +538,11 @@ msgstr "" "もし、この小さなプログラムを二乗以外の累乗が行えるように拡張するとどうなるで" "しょうか::" -#: ../../howto/argparse.rst:609 -msgid "" -"import argparse\n" -"parser = argparse.ArgumentParser()\n" -"parser.add_argument(\"x\", type=int, help=\"the base\")\n" -"parser.add_argument(\"y\", type=int, help=\"the exponent\")\n" -"parser.add_argument(\"-v\", \"--verbosity\", action=\"count\", default=0)\n" -"args = parser.parse_args()\n" -"answer = args.x**args.y\n" -"if args.verbosity >= 2:\n" -" print(f\"{args.x} to the power {args.y} equals {answer}\")\n" -"elif args.verbosity >= 1:\n" -" print(f\"{args.x}^{args.y} == {answer}\")\n" -"else:\n" -" print(answer)" -msgstr "" - -#: ../../howto/argparse.rst:623 ../../howto/argparse.rst:661 -#: ../../howto/argparse.rst:877 +#: ../../howto/argparse.rst:615 ../../howto/argparse.rst:653 msgid "Output:" msgstr "出力:" -#: ../../howto/argparse.rst:625 -msgid "" -"$ python prog.py\n" -"usage: prog.py [-h] [-v] x y\n" -"prog.py: error: the following arguments are required: x, y\n" -"$ python prog.py -h\n" -"usage: prog.py [-h] [-v] x y\n" -"\n" -"positional arguments:\n" -" x the base\n" -" y the exponent\n" -"\n" -"options:\n" -" -h, --help show this help message and exit\n" -" -v, --verbosity\n" -"$ python prog.py 4 2 -v\n" -"4^2 == 16" -msgstr "" - -#: ../../howto/argparse.rst:644 +#: ../../howto/argparse.rst:636 msgid "" "Notice that so far we've been using verbosity level to *change* the text " "that gets displayed. The following example instead uses verbosity level to " @@ -996,111 +551,27 @@ msgstr "" "これまで、出力されるテキストを *変更する* ために詳細レベルを使ってきました。" "かわりに下記の例では、*追加の* テキストを出力するのに詳細レベルを使用します::" -#: ../../howto/argparse.rst:648 -msgid "" -"import argparse\n" -"parser = argparse.ArgumentParser()\n" -"parser.add_argument(\"x\", type=int, help=\"the base\")\n" -"parser.add_argument(\"y\", type=int, help=\"the exponent\")\n" -"parser.add_argument(\"-v\", \"--verbosity\", action=\"count\", default=0)\n" -"args = parser.parse_args()\n" -"answer = args.x**args.y\n" -"if args.verbosity >= 2:\n" -" print(f\"Running '{__file__}'\")\n" -"if args.verbosity >= 1:\n" -" print(f\"{args.x}^{args.y} == \", end=\"\")\n" -"print(answer)" -msgstr "" - -#: ../../howto/argparse.rst:663 -msgid "" -"$ python prog.py 4 2\n" -"16\n" -"$ python prog.py 4 2 -v\n" -"4^2 == 16\n" -"$ python prog.py 4 2 -vv\n" -"Running 'prog.py'\n" -"4^2 == 16" -msgstr "" - -#: ../../howto/argparse.rst:677 -msgid "Specifying ambiguous arguments" -msgstr "多義性のある引数の指定" - -#: ../../howto/argparse.rst:679 -msgid "" -"When there is ambiguity in deciding whether an argument is positional or for " -"an argument, ``--`` can be used to tell :meth:`~ArgumentParser.parse_args` " -"that everything after that is a positional argument::" -msgstr "" -"ある引数の解釈について、位置引数なのか、ある引数に対する追加の引数なのか、あ" -"いまいさがあるときは、 ``--`` を使うことで :meth:`~ArgumentParser." -"parse_args` に対してこれ以降は位置引数であることを伝えることができます::" - -#: ../../howto/argparse.rst:683 -msgid "" -">>> parser = argparse.ArgumentParser(prog='PROG')\n" -">>> parser.add_argument('-n', nargs='+')\n" -">>> parser.add_argument('args', nargs='*')\n" -"\n" -">>> # ambiguous, so parse_args assumes it's an option\n" -">>> parser.parse_args(['-f'])\n" -"usage: PROG [-h] [-n N [N ...]] [args ...]\n" -"PROG: error: unrecognized arguments: -f\n" -"\n" -">>> parser.parse_args(['--', '-f'])\n" -"Namespace(args=['-f'], n=None)\n" -"\n" -">>> # ambiguous, so the -n option greedily accepts arguments\n" -">>> parser.parse_args(['-n', '1', '2', '3'])\n" -"Namespace(args=[], n=['1', '2', '3'])\n" -"\n" -">>> parser.parse_args(['-n', '1', '--', '2', '3'])\n" -"Namespace(args=['2', '3'], n=['1'])" -msgstr "" - -#: ../../howto/argparse.rst:704 +#: ../../howto/argparse.rst:667 msgid "Conflicting options" msgstr "競合するオプション" -#: ../../howto/argparse.rst:706 +#: ../../howto/argparse.rst:669 msgid "" "So far, we have been working with two methods of an :class:`argparse." "ArgumentParser` instance. Let's introduce a third one, :meth:" -"`~ArgumentParser.add_mutually_exclusive_group`. It allows for us to specify " -"options that conflict with each other. Let's also change the rest of the " -"program so that the new functionality makes more sense: we'll introduce the " -"``--quiet`` option, which will be the opposite of the ``--verbose`` one::" -msgstr "" -"これまでのところ、 :class:`argparse.ArgumentParser` インスタンスの2つのメソッ" -"ドについて学んできました。ここで3つめのメソッドとして :meth:`~ArgumentParser." -"add_mutually_exclusive_group` を導入しましょう。このメソッドは互いに対立する" -"引数の指定を可能にします。また、新しい機能として理解しやすいように、プログラ" -"ムの残りの部分を変更しましょう: 以下では ``--quiet`` オプションを ``--" -"verbose`` と反対のオプションとして導入します::" - -#: ../../howto/argparse.rst:714 -msgid "" -"import argparse\n" -"\n" -"parser = argparse.ArgumentParser()\n" -"group = parser.add_mutually_exclusive_group()\n" -"group.add_argument(\"-v\", \"--verbose\", action=\"store_true\")\n" -"group.add_argument(\"-q\", \"--quiet\", action=\"store_true\")\n" -"parser.add_argument(\"x\", type=int, help=\"the base\")\n" -"parser.add_argument(\"y\", type=int, help=\"the exponent\")\n" -"args = parser.parse_args()\n" -"answer = args.x**args.y\n" -"\n" -"if args.quiet:\n" -" print(answer)\n" -"elif args.verbose:\n" -" print(f\"{args.x} to the power {args.y} equals {answer}\")\n" -"else:\n" -" print(f\"{args.x}^{args.y} == {answer}\")" +"`add_mutually_exclusive_group`. It allows for us to specify options that " +"conflict with each other. Let's also change the rest of the program so that " +"the new functionality makes more sense: we'll introduce the ``--quiet`` " +"option, which will be the opposite of the ``--verbose`` one::" msgstr "" +"ここまでで、 :class:`argparse.ArgumentParser` インスタンスの二つのメソッドに" +"ついて学んできました。では三つ目のメソッド :meth:" +"`add_mutually_exclusive_group` を紹介しましょう。このメソッドでは、互いに競合" +"するオプションを指定することができます。新しい機能がより意味をなすようにプロ" +"グラムを変更しましょう: ``--verbose`` オプションと反対の ``--quiet`` オプ" +"ションを導入します::" -#: ../../howto/argparse.rst:732 +#: ../../howto/argparse.rst:695 msgid "" "Our program is now simpler, and we've lost some functionality for the sake " "of demonstration. Anyways, here's the output:" @@ -1108,23 +579,7 @@ msgstr "" "プログラムはより簡潔になりましたが、デモのための機能が失われました。ともかく" "下記が実行結果です:" -#: ../../howto/argparse.rst:735 -msgid "" -"$ python prog.py 4 2\n" -"4^2 == 16\n" -"$ python prog.py 4 2 -q\n" -"16\n" -"$ python prog.py 4 2 -v\n" -"4 to the power 2 equals 16\n" -"$ python prog.py 4 2 -vq\n" -"usage: prog.py [-h] [-v | -q] x y\n" -"prog.py: error: argument -q/--quiet: not allowed with argument -v/--verbose\n" -"$ python prog.py 4 2 -v --quiet\n" -"usage: prog.py [-h] [-v | -q] x y\n" -"prog.py: error: argument -q/--quiet: not allowed with argument -v/--verbose" -msgstr "" - -#: ../../howto/argparse.rst:750 +#: ../../howto/argparse.rst:713 msgid "" "That should be easy to follow. I've added that last output so you can see " "the sort of flexibility you get, i.e. mixing long form options with short " @@ -1134,7 +589,7 @@ msgstr "" "力を追加しました、つまり長い形式のオプションと短い形式のオプションの混在で" "す。" -#: ../../howto/argparse.rst:754 +#: ../../howto/argparse.rst:717 msgid "" "Before we conclude, you probably want to tell your users the main purpose of " "your program, just in case they don't know::" @@ -1142,29 +597,7 @@ msgstr "" "結びの前に、恐らくあなたはプログラムの主な目的をユーザに伝えたいでしょう。万" "が一、彼らがそれを知らないときに備えて::" -#: ../../howto/argparse.rst:757 -msgid "" -"import argparse\n" -"\n" -"parser = argparse.ArgumentParser(description=\"calculate X to the power of " -"Y\")\n" -"group = parser.add_mutually_exclusive_group()\n" -"group.add_argument(\"-v\", \"--verbose\", action=\"store_true\")\n" -"group.add_argument(\"-q\", \"--quiet\", action=\"store_true\")\n" -"parser.add_argument(\"x\", type=int, help=\"the base\")\n" -"parser.add_argument(\"y\", type=int, help=\"the exponent\")\n" -"args = parser.parse_args()\n" -"answer = args.x**args.y\n" -"\n" -"if args.quiet:\n" -" print(answer)\n" -"elif args.verbose:\n" -" print(f\"{args.x} to the power {args.y} equals {answer}\")\n" -"else:\n" -" print(f\"{args.x}^{args.y} == {answer}\")" -msgstr "" - -#: ../../howto/argparse.rst:775 +#: ../../howto/argparse.rst:738 msgid "" "Note that slight difference in the usage text. Note the ``[-v | -q]``, which " "tells us that we can either use ``-v`` or ``-q``, but not both at the same " @@ -1173,184 +606,11 @@ msgstr "" "使用方法のテキストが少し変化しました。``[-v | -q]`` は ``-v`` または ``-q`` " "のどちらかを使用できるが、同時に両方を使用できないことを意味します:" -#: ../../howto/argparse.rst:779 ../../howto/argparse.rst:806 -msgid "" -"$ python prog.py --help\n" -"usage: prog.py [-h] [-v | -q] x y\n" -"\n" -"calculate X to the power of Y\n" -"\n" -"positional arguments:\n" -" x the base\n" -" y the exponent\n" -"\n" -"options:\n" -" -h, --help show this help message and exit\n" -" -v, --verbose\n" -" -q, --quiet" -msgstr "" - -#: ../../howto/argparse.rst:797 -msgid "How to translate the argparse output" -msgstr "argparse の出力を翻訳するには" - -#: ../../howto/argparse.rst:799 -msgid "" -"The output of the :mod:`argparse` module such as its help text and error " -"messages are all made translatable using the :mod:`gettext` module. This " -"allows applications to easily localize messages produced by :mod:`argparse`. " -"See also :ref:`i18n-howto`." -msgstr "" -"ヘルプテキストやエラーメッセージなどの :mod:`argparse` モジュールの出力は、す" -"べて :mod:`gettext` モジュールを使って訳せるように作られています。これによ" -"り、 :mod:`argparse` によって生成されたメッセージを簡単にローカライズできま" -"す。 :ref:`i18n-howto` も参照してください。" - -#: ../../howto/argparse.rst:804 -msgid "For instance, in this :mod:`argparse` output:" -msgstr "たとえば、この :mod:`argparse` の出力では:" - -#: ../../howto/argparse.rst:822 -msgid "" -"The strings ``usage:``, ``positional arguments:``, ``options:`` and ``show " -"this help message and exit`` are all translatable." -msgstr "" -"文字列 ``usage:``, ``positional arguments:``, ``options:`` と ``show this " -"help message and exit`` はすべて訳せます。" - -#: ../../howto/argparse.rst:825 -msgid "" -"In order to translate these strings, they must first be extracted into a ``." -"po`` file. For example, using `Babel `__, run this " -"command:" -msgstr "" -"これらの文字列を訳すには、それらをまず ``.po`` ファイルに抽出する必要がありま" -"す。たとえば、 `Babel `__ を使い、次のコマンドを実" -"行します。" - -#: ../../howto/argparse.rst:829 -msgid "$ pybabel extract -o messages.po /usr/lib/python3.12/argparse.py" -msgstr "" - -#: ../../howto/argparse.rst:833 -msgid "" -"This command will extract all translatable strings from the :mod:`argparse` " -"module and output them into a file named ``messages.po``. This command " -"assumes that your Python installation is in ``/usr/lib``." -msgstr "" -"このコマンドは :mod:`argparse` モジュールからすべての翻訳可能な文字列を抽出" -"し、それらを ``messages.po`` という名前のファイルに出力します。このコマンド" -"は Python のインストールが ``/usr/lib`` にあることを前提としています。" - -#: ../../howto/argparse.rst:837 -msgid "" -"You can find out the location of the :mod:`argparse` module on your system " -"using this script::" -msgstr "" -"システム上の :mod:`argparse` モジュールの場所は、次のスクリプトで調べられま" -"す::" - -#: ../../howto/argparse.rst:840 -msgid "" -"import argparse\n" -"print(argparse.__file__)" -msgstr "" - -#: ../../howto/argparse.rst:843 -msgid "" -"Once the messages in the ``.po`` file are translated and the translations " -"are installed using :mod:`gettext`, :mod:`argparse` will be able to display " -"the translated messages." -msgstr "" -"``.po`` ファイル内のメッセージが訳され、その訳が :mod:`gettext` を用いてイン" -"ストールされると、 :mod:`argparse` は翻訳されたメッセージを表示できるようにな" -"ります。" - -#: ../../howto/argparse.rst:847 -msgid "" -"To translate your own strings in the :mod:`argparse` output, use :mod:" -"`gettext`." -msgstr "" -":mod:`argparse` 出力内のあなたの文字列を翻訳するには、 :mod:`gettext` を使い" -"ます。" - -#: ../../howto/argparse.rst:850 -msgid "Custom type converters" -msgstr "" - -#: ../../howto/argparse.rst:852 -msgid "" -"The :mod:`argparse` module allows you to specify custom type converters for " -"your command-line arguments. This allows you to modify user input before " -"it's stored in the :class:`argparse.Namespace`. This can be useful when you " -"need to pre-process the input before it is used in your program." -msgstr "" - -#: ../../howto/argparse.rst:857 -msgid "" -"When using a custom type converter, you can use any callable that takes a " -"single string argument (the argument value) and returns the converted value. " -"However, if you need to handle more complex scenarios, you can use a custom " -"action class with the **action** parameter instead." -msgstr "" - -#: ../../howto/argparse.rst:862 -msgid "" -"For example, let's say you want to handle arguments with different prefixes " -"and process them accordingly::" -msgstr "" - -#: ../../howto/argparse.rst:865 -msgid "" -"import argparse\n" -"\n" -"parser = argparse.ArgumentParser(prefix_chars='-+')\n" -"\n" -"parser.add_argument('-a', metavar='', action='http://github.com/append',\n" -" type=lambda x: ('-', x))\n" -"parser.add_argument('+a', metavar='', action='http://github.com/append',\n" -" type=lambda x: ('+', x))\n" -"\n" -"args = parser.parse_args()\n" -"print(args)" -msgstr "" - -#: ../../howto/argparse.rst:879 -msgid "" -"$ python prog.py -a value1 +a value2\n" -"Namespace(a=[('-', 'value1'), ('+', 'value2')])" -msgstr "" - -#: ../../howto/argparse.rst:884 -msgid "In this example, we:" -msgstr "" - -#: ../../howto/argparse.rst:886 -msgid "" -"Created a parser with custom prefix characters using the ``prefix_chars`` " -"parameter." -msgstr "" - -#: ../../howto/argparse.rst:889 -msgid "" -"Defined two arguments, ``-a`` and ``+a``, which used the ``type`` parameter " -"to create custom type converters to store the value in a tuple with the " -"prefix." -msgstr "" - -#: ../../howto/argparse.rst:892 -msgid "" -"Without the custom type converters, the arguments would have treated the ``-" -"a`` and ``+a`` as the same argument, which would have been undesirable. By " -"using custom type converters, we were able to differentiate between the two " -"arguments." -msgstr "" - -#: ../../howto/argparse.rst:897 +#: ../../howto/argparse.rst:760 msgid "Conclusion" msgstr "結び" -#: ../../howto/argparse.rst:899 +#: ../../howto/argparse.rst:762 msgid "" "The :mod:`argparse` module offers a lot more than shown here. Its docs are " "quite detailed and thorough, and full of examples. Having gone through this " diff --git a/howto/clinic.po b/howto/clinic.po index 54f6bfb8e..a7219dd94 100644 --- a/howto/clinic.po +++ b/howto/clinic.po @@ -1,36 +1,2688 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# TENMYO Masakazu, 2024 -# tomo, 2024 +# Masato HASHIMOTO , 2017 +# Yusuke Miyazaki , 2017 +# Arihiro TAKASE, 2017 +# Nozomu Kaneko , 2017 +# E. Kawashima, 2017 +# Inada Naoki , 2017 +# Osamu NAKAMURA, 2018 +# 秘湯 , 2018 +# tomo, 2019 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:52+0000\n" -"Last-Translator: tomo, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 17:44+0000\n" +"Last-Translator: tomo, 2019\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: ../../howto/clinic.rst:8 +#: ../../howto/clinic.rst:5 msgid "Argument Clinic How-To" msgstr "Argument Clinic How-To" -#: ../../howto/clinic.rst:13 +#: ../../howto/clinic.rst:0 +msgid "author" +msgstr "author" + +#: ../../howto/clinic.rst:7 +msgid "Larry Hastings" +msgstr "Larry Hastings" + +#: ../../howto/clinic.rstNone +msgid "Abstract" +msgstr "概要" + +#: ../../howto/clinic.rst:12 +msgid "" +"Argument Clinic is a preprocessor for CPython C files. Its purpose is to " +"automate all the boilerplate involved with writing argument parsing code for " +"\"builtins\". This document shows you how to convert your first C function " +"to work with Argument Clinic, and then introduces some advanced topics on " +"Argument Clinic usage." +msgstr "" +"Argument Clinic は CPython の C ファイルのプリプロセッサです。builtin の中" +"の、退屈な引数解析のコードを自動化するのが目的です。このドキュメントでは、C関" +"数を Argument Clinic 化する方法を示し、さらに高度な Argument Clinic の利用方" +"法について説明します。" + +#: ../../howto/clinic.rst:19 +msgid "" +"Currently Argument Clinic is considered internal-only for CPython. Its use " +"is not supported for files outside CPython, and no guarantees are made " +"regarding backwards compatibility for future versions. In other words: if " +"you maintain an external C extension for CPython, you're welcome to " +"experiment with Argument Clinic in your own code. But the version of " +"Argument Clinic that ships with the next version of CPython *could* be " +"totally incompatible and break all your code." +msgstr "" +"現在のところ、Argument Clinic は CPython の内部専用の扱いです。CPython の外に" +"あるファイルはサポートしておらず、将来のバージョンでの後方互換性を保証しませ" +"ん。言い換えると、CPython の外の C 拡張をメンテナンスしている場合、Argument " +"Clinic を試してみることはできますが、次のバージョンの CPython の Argument " +"Clinic では互換性が無くなりそのコードが動かなくなる *可能性があります* 。" + +#: ../../howto/clinic.rst:29 +msgid "The Goals Of Argument Clinic" +msgstr "Argument Clinic の目的" + +#: ../../howto/clinic.rst:31 +msgid "" +"Argument Clinic's primary goal is to take over responsibility for all " +"argument parsing code inside CPython. This means that, when you convert a " +"function to work with Argument Clinic, that function should no longer do any " +"of its own argument parsing—the code generated by Argument Clinic should be " +"a \"black box\" to you, where CPython calls in at the top, and your code " +"gets called at the bottom, with ``PyObject *args`` (and maybe ``PyObject " +"*kwargs``) magically converted into the C variables and types you need." +msgstr "" +"Argument Clinic の第一目標は、CPython の中の全ての引数解析のためのコードを引" +"き継ぐことです。ある関数を Argument Clinic を使うように変更すると、その関数は" +"一切の引数解析を行わなくなります。Argument Clinic が生成するコードがブラック" +"ボックスになり、CPython がそのブラックボックスの先頭を呼び出し、最後にその関" +"数のコードが呼ばれます。引数の ``PyObject *args`` (と ``PyObject *kwargs``) " +"は暗黙的に、必要な型のC言語の変数に変換されます。" + +#: ../../howto/clinic.rst:41 +msgid "" +"In order for Argument Clinic to accomplish its primary goal, it must be easy " +"to use. Currently, working with CPython's argument parsing library is a " +"chore, requiring maintaining redundant information in a surprising number of " +"places. When you use Argument Clinic, you don't have to repeat yourself." +msgstr "" +"Argument Clinic の第一目標を達成するためには、使いやすくなければなりません。" +"現在、CPython の引数解析ライブラリを利用するのは面倒で、とても多くの場所で冗" +"長な情報のメンテナンスを必要とします。Argument Clinic を使うことで DRY を実現" +"できます。" + +#: ../../howto/clinic.rst:47 +msgid "" +"Obviously, no one would want to use Argument Clinic unless it's solving " +"their problem—and without creating new problems of its own. So it's " +"paramount that Argument Clinic generate correct code. It'd be nice if the " +"code was faster, too, but at the very least it should not introduce a major " +"speed regression. (Eventually Argument Clinic *should* make a major speedup " +"possible—we could rewrite its code generator to produce tailor-made argument " +"parsing code, rather than calling the general-purpose CPython argument " +"parsing library. That would make for the fastest argument parsing possible!)" +msgstr "" +"もちろん、新たな問題を持ち込むことなしに、自分の問題を解決してくれるのでなけ" +"れば、誰も Argument Clinic を使いたいとは思わないでしょう。なので、正しいコー" +"ドを生成することは Argument Clinic にとって最重要です。生成したコードによって" +"速度が大きく低下することがあってはいけないし、速くなるならより良いです。(最終" +"的には、Argument Clinic は大幅な高速化を可能にするはずです。Argument Clinic " +"が、汎用的な CPython の引数解析ライブラリを呼び出す代わりに、オーダーメイドの" +"引数解析コードを生成するようにできるからです。これにより可能な限り最速の引数" +"解析が可能になるでしょう!)" + +#: ../../howto/clinic.rst:59 +msgid "" +"Additionally, Argument Clinic must be flexible enough to work with any " +"approach to argument parsing. Python has some functions with some very " +"strange parsing behaviors; Argument Clinic's goal is to support all of them." +msgstr "" +"加えて、Argument Clinic は全ての引数解析の方式に対応できるように柔軟でなけれ" +"ばなりません。Python の幾つかの関数はとても特殊な引数の解釈を行います。" +"Argument Clinic の目標はその全てをサポートすることです。" + +#: ../../howto/clinic.rst:64 +msgid "" +"Finally, the original motivation for Argument Clinic was to provide " +"introspection \"signatures\" for CPython builtins. It used to be, the " +"introspection query functions would throw an exception if you passed in a " +"builtin. With Argument Clinic, that's a thing of the past!" +msgstr "" +"最後に、もともとの Argument Clinic の目的は CPython 組み込み関数に \"シグネ" +"チャ\" の introspection を提供することでした。今までは、組み込み関数に対して " +"introspection する関数で問い合わせると例外が発生していました。Argument " +"Clinic によってこれは過去の事になりました。" + +#: ../../howto/clinic.rst:70 +msgid "" +"One idea you should keep in mind, as you work with Argument Clinic: the more " +"information you give it, the better job it'll be able to do. Argument Clinic " +"is admittedly relatively simple right now. But as it evolves it will get " +"more sophisticated, and it should be able to do many interesting and smart " +"things with all the information you give it." +msgstr "" +"Argument Clinic を使うにあたって1つ覚えておかないといけないアイデアがありま" +"す: それは「より多くの情報を与えれば、より良い仕事ができるようになる」という" +"ことです。\n" +"Argument Clinic は今のところはまだ比較的シンプルです。\n" +"しかし、将来の進化により、与えられた情報を元により洗練された賢いことができる" +"ようになるでしょう。" + +#: ../../howto/clinic.rst:80 +msgid "Basic Concepts And Usage" +msgstr "基本的な概念と使用法" + +#: ../../howto/clinic.rst:82 +msgid "" +"Argument Clinic ships with CPython; you'll find it in ``Tools/clinic/clinic." +"py``. If you run that script, specifying a C file as an argument:" +msgstr "" +"Argument Clinic は CPython とともに配布されています。その中の ``Tools/clinic/" +"clinic.py`` を見つけることができるでしょう。\n" +"そのスクリプトを、引数にCファイルを指定して実行すると:" + +#: ../../howto/clinic.rst:89 +msgid "" +"Argument Clinic will scan over the file looking for lines that look exactly " +"like this:" +msgstr "" +"Argument Clinic は指定されたファイルをスキャンし、次の行と全く同じ行を探しま" +"す:" + +#: ../../howto/clinic.rst:96 +msgid "" +"When it finds one, it reads everything up to a line that looks exactly like " +"this:" +msgstr "" +"その行を見つけたら、今度は正確に次のような行を見つけるまで、すべてを読み込み" +"ます:" + +#: ../../howto/clinic.rst:103 +msgid "" +"Everything in between these two lines is input for Argument Clinic. All of " +"these lines, including the beginning and ending comment lines, are " +"collectively called an Argument Clinic \"block\"." +msgstr "" +"これらの2つの行の間のすべての行が Argument Clinic への入力になります。これら" +"のコメント行の開始と終了も含めたすべての行が、 Argument Clinic \"ブロック\" " +"と呼ばれます。" + +#: ../../howto/clinic.rst:107 +msgid "" +"When Argument Clinic parses one of these blocks, it generates output. This " +"output is rewritten into the C file immediately after the block, followed by " +"a comment containing a checksum. The Argument Clinic block now looks like " +"this:" +msgstr "" +"Argument Clinic はその block をパースすると、出力を生成します。\n" +"その出力は、そのCソースファイルの該当する block の直後に挿入され、チェックサ" +"ムを含むコメントで終了します。\n" +"その結果 Argument Clinick block は次のようになります:" + +#: ../../howto/clinic.rst:120 +msgid "" +"If you run Argument Clinic on the same file a second time, Argument Clinic " +"will discard the old output and write out the new output with a fresh " +"checksum line. However, if the input hasn't changed, the output won't " +"change either." +msgstr "" +"Argument Clinic を同じファイルに対して2度実行した場合、Argument Clinic は古い" +"出力を新しい出力で上書きしてチェックサムも更新します。\n" +"しかし、入力が変更されていない場合、出力も変化しません。" + +#: ../../howto/clinic.rst:124 +msgid "" +"You should never modify the output portion of an Argument Clinic block. " +"Instead, change the input until it produces the output you want. (That's " +"the purpose of the checksum—to detect if someone changed the output, as " +"these edits would be lost the next time Argument Clinic writes out fresh " +"output.)" +msgstr "" +"Argument Clinick block の出力部分を修正してはいけません。\n" +"出力が望みどおりになるまで、入力を修正してください。\n" +"(出力部分に対する修正は、次に Argument Clinic が新しい出力を書いたときに失わ" +"れてしまいます。\n" +"チェックサムの目的は出力部分に対する修正を検出するためです。)" + +#: ../../howto/clinic.rst:129 +msgid "" +"For the sake of clarity, here's the terminology we'll use with Argument " +"Clinic:" +msgstr "" +"混乱を避けるために、 Argument Clinic で利用する用語を定義しておきます。" + +#: ../../howto/clinic.rst:131 +msgid "" +"The first line of the comment (``/*[clinic input]``) is the *start line*." +msgstr "コメントの最初の行 (``/*[clinic input]``) は *スタートライン* です。" + +#: ../../howto/clinic.rst:132 +msgid "" +"The last line of the initial comment (``[clinic start generated code]*/``) " +"is the *end line*." +msgstr "" +"Argument Clinic を実行する前の状態のコメントの最終行 (``[clinic start " +"generated code]*/``) は *エンドライン* です。" + +#: ../../howto/clinic.rst:133 +msgid "" +"The last line (``/*[clinic end generated code: checksum=...]*/``) is the " +"*checksum line*." +msgstr "" +"最後の行 (``/*[clinic end generated code: checksum=...]*/``) は *チェックサム" +"ライン* です。" + +#: ../../howto/clinic.rst:134 +msgid "In between the start line and the end line is the *input*." +msgstr "スタートラインとエンドラインの間が *インプット* です。" + +#: ../../howto/clinic.rst:135 +msgid "In between the end line and the checksum line is the *output*." +msgstr "エンドラインとチェックサムラインの間が *アウトプット* です。" + +#: ../../howto/clinic.rst:136 +msgid "" +"All the text collectively, from the start line to the checksum line " +"inclusively, is the *block*. (A block that hasn't been successfully " +"processed by Argument Clinic yet doesn't have output or a checksum line, but " +"it's still considered a block.)" +msgstr "" +"スタートラインからエンドラインまで、その2行を含めた全体が *ブロック* です。\n" +"(Argument Clinic がまだ正常に処理を実行できてないブロックは、アウトプットと" +"チェックサムラインをまだ持っていませんが、それもブロックとして扱います。)" + +#: ../../howto/clinic.rst:143 +msgid "Converting Your First Function" +msgstr "関数を変換してみよう" + +#: ../../howto/clinic.rst:145 +msgid "" +"The best way to get a sense of how Argument Clinic works is to convert a " +"function to work with it. Here, then, are the bare minimum steps you'd need " +"to follow to convert a function to work with Argument Clinic. Note that for " +"code you plan to check in to CPython, you really should take the conversion " +"farther, using some of the advanced concepts you'll see later on in the " +"document (like \"return converters\" and \"self converters\"). But we'll " +"keep it simple for this walkthrough so you can learn." +msgstr "" +"Argument Clinic の動作について把握する一番の方法は、1つの関数で実際に試してみ" +"ることです。\n" +"なのでここでは、1つの関数で試すための最小限の手順を説明します。\n" +"CPythonのコードにコミットする場合は、あとで出てくるもっと強力な機能 " +"(\"return converter\" や \"self converter\" など) を使った変換をする必要があ" +"ることに気をつけてください。\n" +"ここでは学習目的でシンプルな手順だけにとどめます。" + +#: ../../howto/clinic.rst:154 +msgid "Let's dive in!" +msgstr "飛び込もう!" + +#: ../../howto/clinic.rst:156 +msgid "" +"Make sure you're working with a freshly updated checkout of the CPython " +"trunk." +msgstr "まずCPythonの最新版のチェックアウトを用意してください。" + +#: ../../howto/clinic.rst:159 +msgid "" +"Find a Python builtin that calls either :c:func:`PyArg_ParseTuple` or :c:" +"func:`PyArg_ParseTupleAndKeywords`, and hasn't been converted to work with " +"Argument Clinic yet. For my example I'm using ``_pickle.Pickler.dump()``." +msgstr "" +"まだ Argument Clinic を利用していない、 :c:func:`PyArg_ParseTuple` か\n" +" :c:func:`PyArg_ParseTupleAndKeywords` を呼び出している Python 組み込み関数を" +"見つけてください。\n" +"この例では ``_pickle.Pickler.dump()`` を利用します。" + +#: ../../howto/clinic.rst:164 +msgid "" +"If the call to the ``PyArg_Parse`` function uses any of the following format " +"units:" +msgstr "" +"``PyArg_Parse`` 関数が以下のいずれかのフォーマット単位を使っていた場合:" + +#: ../../howto/clinic.rst:176 +msgid "" +"or if it has multiple calls to :c:func:`PyArg_ParseTuple`, you should choose " +"a different function. Argument Clinic *does* support all of these " +"scenarios. But these are advanced topics—let's do something simpler for " +"your first function." +msgstr "" +"あるいは :c:func:`PyArg_ParseTuple` の呼び出しを複数持っていた場合、別の関数" +"を選びましょう。Argument Clinic はこれらすべてのケースを **サポートしています" +"**。 ですが、これは高度な話題になります。最初の関数にはシンプルなものを選びま" +"しょう。" + +#: ../../howto/clinic.rst:181 +msgid "" +"Also, if the function has multiple calls to :c:func:`PyArg_ParseTuple` or :c:" +"func:`PyArg_ParseTupleAndKeywords` where it supports different types for the " +"same argument, or if the function uses something besides PyArg_Parse " +"functions to parse its arguments, it probably isn't suitable for conversion " +"to Argument Clinic. Argument Clinic doesn't support generic functions or " +"polymorphic parameters." +msgstr "" +"また、その関数が、同一の引数が複数の型を持つ場合に対応するために :c:func:" +"`PyArg_ParseTuple` か :c:func:`PyArg_ParseTupleAndKeyword` の呼び出しを複数" +"持っていたり、 PyArg_Parse 関数を利用していないようなら、その関数は Argument " +"Clinic に向いていません。\n" +"Argument Clinic はジェネリック関数やポリモーフィックな引数をサポートしていま" +"せん。" + +#: ../../howto/clinic.rst:188 +msgid "Add the following boilerplate above the function, creating our block::" +msgstr "その関数の上に次の定型文を追加し、ブロックを作ります::" + +#: ../../howto/clinic.rst:193 +msgid "" +"Cut the docstring and paste it in between the ``[clinic]`` lines, removing " +"all the junk that makes it a properly quoted C string. When you're done you " +"should have just the text, based at the left margin, with no line wider than " +"80 characters. (Argument Clinic will preserve indents inside the docstring.)" +msgstr "" +"docstring を切り取って ``[clinic]`` の行の間に貼り付け、適切にクォートされた " +"C の文字列になるようにガラクタを全て削除します。そうすると、80文字以上の行が" +"ない、左マージンに揃えられた、テキストだけになるはずです。 (Argument Clinic " +"は docstring 内のインデントを保持します。)" + +#: ../../howto/clinic.rst:199 +msgid "" +"If the old docstring had a first line that looked like a function signature, " +"throw that line away. (The docstring doesn't need it anymore—when you use " +"``help()`` on your builtin in the future, the first line will be built " +"automatically based on the function's signature.)" +msgstr "" +"古い docstring の最初の行に関数シグネチャのようなものがある場合は、その行を破" +"棄します。 (docstring は最早必要ありません — 将来あなたのビルトインで " +"``help()`` を使うときは、 最初の行は、 関数のシグネチャに基づいて自動的にビル" +"ドされます。)" + +#: ../../howto/clinic.rst:205 ../../howto/clinic.rst:226 +#: ../../howto/clinic.rst:250 ../../howto/clinic.rst:308 +#: ../../howto/clinic.rst:348 ../../howto/clinic.rst:375 +#: ../../howto/clinic.rst:481 ../../howto/clinic.rst:533 +msgid "Sample::" +msgstr "例::" + +#: ../../howto/clinic.rst:211 +msgid "" +"If your docstring doesn't have a \"summary\" line, Argument Clinic will " +"complain. So let's make sure it has one. The \"summary\" line should be a " +"paragraph consisting of a single 80-column line at the beginning of the " +"docstring." +msgstr "" +"あなたの docstring に「要約」(summary)行がない場合、 Argument Clinic は文句を" +"言います。 なので、それがあることを確認しましょう。 「要約」行は、 docstring " +"の先頭にあり、 80 桁以内の単一の行で構成される段落である必要があります。" + +#: ../../howto/clinic.rst:216 +msgid "" +"(Our example docstring consists solely of a summary line, so the sample code " +"doesn't have to change for this step.)" +msgstr "" +"(例の docstring は要約行のみで構成されているため、このステップではサンプル・" +"コードを変更する必要はありません。)" + +#: ../../howto/clinic.rst:219 +msgid "" +"Above the docstring, enter the name of the function, followed by a blank " +"line. This should be the Python name of the function, and should be the " +"full dotted path to the function—it should start with the name of the " +"module, include any sub-modules, and if the function is a method on a class " +"it should include the class name too." +msgstr "" +"docstring に関数の名前を入力し、その後に空白行を入力します。 これは関数の " +"Python 名であり、 関数への完全なドット・パス(full dotted path)である必要があ" +"ります。つまり、それはモジュール名で始まり、サブモジュールが含まれている必要" +"があり、関数がクラスのメソッドである場合は、クラス名も含める必要があります。" + +#: ../../howto/clinic.rst:234 +msgid "" +"If this is the first time that module or class has been used with Argument " +"Clinic in this C file, you must declare the module and/or class. Proper " +"Argument Clinic hygiene prefers declaring these in a separate block " +"somewhere near the top of the C file, in the same way that include files and " +"statics go at the top. (In our sample code we'll just show the two blocks " +"next to each other.)" +msgstr "" +"モジュールまたはクラスがこの C ファイルの Argument Clinic で初めて使用される" +"場合は、モジュール および/または クラスを宣言する必要があります。 Argument " +"Clinic 界隈では、これらを C ファイルの先頭近くの別のブロックで宣言することが" +"好ましいとされます。これは、インクルード・ファイル や statics が先頭に配置さ" +"れるのと同一の手法です。 (なお、 このコード例では、説明の都合上 2 つのブロッ" +"クを続けて表示しています。)" + +#: ../../howto/clinic.rst:242 +msgid "" +"The name of the class and module should be the same as the one seen by " +"Python. Check the name defined in the :c:type:`PyModuleDef` or :c:type:" +"`PyTypeObject` as appropriate." +msgstr "" +"クラス名とモジュール名は、 Python で表示されるものと同一にする必要がありま" +"す。 :c:type:`PyModuleDef` または :c:type:`PyTypeObject` で定義されている名前" +"を適宜確認してください。" + +#: ../../howto/clinic.rst:246 +msgid "" +"When you declare a class, you must also specify two aspects of its type in " +"C: the type declaration you'd use for a pointer to an instance of this " +"class, and a pointer to the :c:type:`PyTypeObject` for this class." +msgstr "" +"クラスを宣言するときは、 C では、その型の 2 つの側面も指定する必要がありま" +"す。 それは、このクラスのインスタンスへのポインタに使用する型宣言と、このクラ" +"スの :c:type:`PyTypeObject` へのポインタに使用する型宣言です。" + +#: ../../howto/clinic.rst:266 +msgid "" +"Declare each of the parameters to the function. Each parameter should get " +"its own line. All the parameter lines should be indented from the function " +"name and the docstring." +msgstr "" +"関数のための各引数(parameters)を宣言します。 各引数は、それぞれ独立した行であ" +"る必要があります。すべての引数行は、関数名と docstring からインデントさせる必" +"要があります。" + +#: ../../howto/clinic.rst:270 +msgid "The general form of these parameter lines is as follows:" +msgstr "これらの引数行の一般的な形式は以下のとおりです:" + +#: ../../howto/clinic.rst:276 +msgid "If the parameter has a default value, add that after the converter:" +msgstr "" +"引数にデフォルト値がある場合は、コンバーター(converter)の後に追加します:" + +#: ../../howto/clinic.rst:283 +msgid "" +"Argument Clinic's support for \"default values\" is quite sophisticated; " +"please see :ref:`the section below on default values ` for " +"more information." +msgstr "" +"「デフォルト値」に対する Argument Clinic のサポートは非常に洗練されています。" +"詳細については、 :ref:`下記 引数のデフォルト値 セクション ` " +"を参照してください。" + +#: ../../howto/clinic.rst:287 +msgid "Add a blank line below the parameters." +msgstr "全ての引数の下に空白行を追加します。" + +#: ../../howto/clinic.rst:289 +msgid "" +"What's a \"converter\"? It establishes both the type of the variable used " +"in C, and the method to convert the Python value into a C value at runtime. " +"For now you're going to use what's called a \"legacy converter\"—a " +"convenience syntax intended to make porting old code into Argument Clinic " +"easier." +msgstr "" +"「コンバーター」(converter)は、 C で使用される変数の型と、実行時に Python の" +"値を C の値に変換する方法の、両方を確立します。 ここでは、 「レガシー・コン" +"バーター」(legacy converter) と呼ばれるものを使用します。これは、古いコード" +"を Argument Clinic に簡単に移植できるようにするための便利な構文です。" + +#: ../../howto/clinic.rst:296 +msgid "" +"For each parameter, copy the \"format unit\" for that parameter from the " +"``PyArg_Parse()`` format argument and specify *that* as its converter, as a " +"quoted string. (\"format unit\" is the formal name for the one-to-three " +"character substring of the ``format`` parameter that tells the argument " +"parsing function what the type of the variable is and how to convert it. " +"For more on format units please see :ref:`arg-parsing`.)" +msgstr "" +"各引数について、その引数の「フォーマット単位」を ``PyArg_Parse()`` のフォー" +"マット引数からコピーし、 引用符に囲まれた文字列にして、 *that* にコンバーター" +"として指定します。 (「フォーマット単位」(format unit)とは、引数解析関数に変数" +"の型とその変換方法を伝える ``format`` パラメータの 1 ~ 3 文字の部分文字列の" +"正式な名前です。フォーマット単位の詳細については、 :ref:`arg-parsing` を参照" +"してください。)" + +#: ../../howto/clinic.rst:305 +msgid "" +"For multicharacter format units like ``z#``, use the entire two-or-three " +"character string." +msgstr "" +"``z#`` のような複数文字のフォーマット単位の場合、2または3文字の文字列全体を使" +"用します。" + +#: ../../howto/clinic.rst:323 +msgid "" +"If your function has ``|`` in the format string, meaning some parameters " +"have default values, you can ignore it. Argument Clinic infers which " +"parameters are optional based on whether or not they have default values." +msgstr "" +"関数のフォーマット文字列に ``|`` が含まれている場合、つまり一部の引数にデフォ" +"ルト値がある場合は、無視してかまいません。 Argument Clinic は、デフォルト値が" +"あるかどうかに基づいて、どの引数がオプションなのかを推測します。" + +#: ../../howto/clinic.rst:328 +msgid "" +"If your function has ``$`` in the format string, meaning it takes keyword-" +"only arguments, specify ``*`` on a line by itself before the first keyword-" +"only argument, indented the same as the parameter lines." +msgstr "" +"関数のフォーマット文字列に ``$`` が含まれている場合、つまりキーワードのみの引" +"数を取る場合は、最初のキーワードのみの引数の、前の行に ``*`` を単独で指定し、" +"引数行と同一のインデントを行います。" + +#: ../../howto/clinic.rst:333 +msgid "(``_pickle.Pickler.dump`` has neither, so our sample is unchanged.)" +msgstr "" +"(なお、 ``_pickle.Pickler.dump`` にはどちらも含まれていないため、サンプルは変" +"更されていません。)" + +#: ../../howto/clinic.rst:336 +msgid "" +"If the existing C function calls :c:func:`PyArg_ParseTuple` (as opposed to :" +"c:func:`PyArg_ParseTupleAndKeywords`), then all its arguments are positional-" +"only." +msgstr "" +"既存の C 関数が、(:c:func:`PyArg_ParseTupleAndKeywords` ではなく、) :c:func:" +"`PyArg_ParseTuple` を呼び出す場合、そのすべての引数は位置のみです(positional-" +"only)。" + +#: ../../howto/clinic.rst:340 +msgid "" +"To mark all parameters as positional-only in Argument Clinic, add a ``/`` on " +"a line by itself after the last parameter, indented the same as the " +"parameter lines." +msgstr "" +"Argument Clinic ですべての引数を位置のみ(positional-only)としてマークするに" +"は、引数行と同一のインデントにして、最後の引数の次の行に ``/`` を追加します。" + +#: ../../howto/clinic.rst:344 +msgid "" +"Currently this is all-or-nothing; either all parameters are positional-only, " +"or none of them are. (In the future Argument Clinic may relax this " +"restriction.)" +msgstr "" +"現在のところ、これは、すべての引数が位置のみ(positional-only)であるか、全てが" +"そうでないかのどちらかです(all-or-nothing)。 (Argument Clinic は将来はこの制" +"限を緩和する可能性もあります。)" + +#: ../../howto/clinic.rst:364 +msgid "" +"It's helpful to write a per-parameter docstring for each parameter. But per-" +"parameter docstrings are optional; you can skip this step if you prefer." +msgstr "" +"各引数に引数ごとの docstring (per-parameter docstring)を記述すると助けになり" +"ます。 ただし、引数ごとの docstring はオプションですので、必要に応じて、この" +"手順はスキップできます。" + +#: ../../howto/clinic.rst:368 +msgid "" +"Here's how to add a per-parameter docstring. The first line of the per-" +"parameter docstring must be indented further than the parameter definition. " +"The left margin of this first line establishes the left margin for the whole " +"per-parameter docstring; all the text you write will be outdented by this " +"amount. You can write as much text as you like, across multiple lines if " +"you wish." +msgstr "" +"引数ごとの docstring を追加する方法: 引数ごとの docstring の最初の行は、引数" +"行定義よりもさらにインデントする必要があります。 この最初の行の左マージンは、" +"引数ごとの docstring 全体の左マージンを確定します。 あなたが書くすべてのテキ" +"ストは、この左マージン量だけアウトデントされます。 必要に応じて、複数行にまた" +"がって、好きなだけテキストを書くことができます。" + +#: ../../howto/clinic.rst:392 +msgid "" +"Save and close the file, then run ``Tools/clinic/clinic.py`` on it. With " +"luck everything worked---your block now has output, and a ``.c.h`` file has " +"been generated! Reopen the file in your text editor to see::" +msgstr "" +"ファイルを保存して閉じ、 そのファイルに対して ``Tools/clinic/clinic.py`` を実" +"行します。 運が良ければすべてうまくいきます --- つまり、 Argument Clinic ブ" +"ロックに出力があり、かつ、 ``.c.h`` ファイルが生成されまます! テキスト・エ" +"ディタでそのファイルを再度開いて確認します::" + +#: ../../howto/clinic.rst:411 +msgid "" +"Obviously, if Argument Clinic didn't produce any output, it's because it " +"found an error in your input. Keep fixing your errors and retrying until " +"Argument Clinic processes your file without complaint." +msgstr "" +"Argument Clinic が明らかに出力を生成しなかった場合、それは入力にエラーが見つ" +"かったためです。 Argument Clinic が問題なくファイルを処理するまで、エラーの修" +"正と再試行を続けて下さい。。" + +#: ../../howto/clinic.rst:415 +msgid "" +"For readability, most of the glue code has been generated to a ``.c.h`` " +"file. You'll need to include that in your original ``.c`` file, typically " +"right after the clinic module block::" +msgstr "" +"読みやすさのために、ほとんどのグルー・コードは ``.c.h`` ファイルに生成されて" +"います。 これを元の ``.c`` ファイルにインクルードする必要があり、通常は " +"clinic モジュール・ブロックの直後に置きます::" + +#: ../../howto/clinic.rst:421 +msgid "" +"Double-check that the argument-parsing code Argument Clinic generated looks " +"basically the same as the existing code." +msgstr "" +"Argument Clinic が生成した引数解析コードが既存のコードと基本的に同じであるこ" +"とをダブル・チェックします。" + +#: ../../howto/clinic.rst:424 +msgid "" +"First, ensure both places use the same argument-parsing function. The " +"existing code must call either :c:func:`PyArg_ParseTuple` or :c:func:" +"`PyArg_ParseTupleAndKeywords`; ensure that the code generated by Argument " +"Clinic calls the *exact* same function." +msgstr "" +"1番目に、両方の場所で同じ引数解析関数が使用されていることを確認します。 既存" +"のコードは :c:func:`PyArg_ParseTuple` または :c:func:" +"`PyArg_ParseTupleAndKeywords` のいずれかを呼び出す必要があります。 Argument " +"Clinic によって生成されたコードが *まったく同じ* 関数を呼び出すことを確認して" +"ください。" + +#: ../../howto/clinic.rst:430 +msgid "" +"Second, the format string passed in to :c:func:`PyArg_ParseTuple` or :c:func:" +"`PyArg_ParseTupleAndKeywords` should be *exactly* the same as the hand-" +"written one in the existing function, up to the colon or semi-colon." +msgstr "" +"2番目、 :c:func:`PyArg_ParseTuple` または :c:func:" +"`PyArg_ParseTupleAndKeywords` に渡されるフォーマット文字列は、コロンまたはセ" +"ミコロン含めて、既存の関数で手書きされたものと *まったく同じ* でなければなり" +"ません。" + +#: ../../howto/clinic.rst:435 +msgid "" +"(Argument Clinic always generates its format strings with a ``:`` followed " +"by the name of the function. If the existing code's format string ends with " +"``;``, to provide usage help, this change is harmless—don't worry about it.)" +msgstr "" +"(Argument Clinic は常に ``:`` の後に関数名が続くフォーマット文字列を生成しま" +"す。既存のコードのフォーマット文字列が ``;`` で終わっていた場合のこの変更は使" +"用法のヘルプを提供するためで、この変更は無害です。 心配してないでください。)" + +#: ../../howto/clinic.rst:440 +msgid "" +"Third, for parameters whose format units require two arguments (like a " +"length variable, or an encoding string, or a pointer to a conversion " +"function), ensure that the second argument is *exactly* the same between the " +"two invocations." +msgstr "" +"3 番目に、フォーマット単位が 2 つの引数(arguments)を必要とする引数" +"(parameters)(length 変数や、エンコード文字列や、変換関数へのポインタなど)につ" +"いては、2 番目の引数(argument)が 2 つの呼び出し間で *正確に同じである* ことを" +"確認してください。" + +#: ../../howto/clinic.rst:445 +msgid "" +"Fourth, inside the output portion of the block you'll find a preprocessor " +"macro defining the appropriate static :c:type:`PyMethodDef` structure for " +"this builtin::" +msgstr "" +"4 番目に、ブロックの出力部分内に、このビルトインの適切な静的 :c:type:" +"`PyMethodDef` 構造を定義するプリプロセッサ・マクロがあります::" + +#: ../../howto/clinic.rst:452 +msgid "" +"This static structure should be *exactly* the same as the existing static :c:" +"type:`PyMethodDef` structure for this builtin." +msgstr "" +"この static な構造体は、このビルトインの既存の static な :c:type:" +"`PyMethodDef` 構造体と *まったく同じ* でなければなりません。" + +#: ../../howto/clinic.rst:455 +msgid "" +"If any of these items differ in *any way*, adjust your Argument Clinic " +"function specification and rerun ``Tools/clinic/clinic.py`` until they *are* " +"the same." +msgstr "" +"これらの項目のいずれかが *何らか異なる* 場合は、 Argument Clinic 関数の仕様を" +"調整し、同一になるまで ``Tools/clinic/clinic.py`` を再実行し続けてください。" + +#: ../../howto/clinic.rst:460 +msgid "" +"Notice that the last line of its output is the declaration of your \"impl\" " +"function. This is where the builtin's implementation goes. Delete the " +"existing prototype of the function you're modifying, but leave the opening " +"curly brace. Now delete its argument parsing code and the declarations of " +"all the variables it dumps the arguments into. Notice how the Python " +"arguments are now arguments to this impl function; if the implementation " +"used different names for these variables, fix it." +msgstr "" +"その出力の最終行が、あなたの \"impl\" 関数の宣言であることに注意してくださ" +"い。 これは、ビルトインの実装が行われる場所です。 あなたが変更中の関数の既存" +"のプロトタイプを削除してください。しかし、開き並括弧 ``{`` は残してください。" +"そして、その引数をパースするコードと、 その引数をダンプするすべての変数の宣言" +"を削除してください。 Python の引数がこの impl 関数の引数になっていることに注" +"意してください。実装でこれらの変数に異なる名前が使用されている場合は、修正し" +"てください。" + +#: ../../howto/clinic.rst:468 +msgid "" +"Let's reiterate, just because it's kind of weird. Your code should now look " +"like this::" +msgstr "" +"少々奇妙なコードなので、もう一度やってみましょう。あなたのコードは今や以下の" +"ようになっているはずです::" + +#: ../../howto/clinic.rst:477 +msgid "" +"Argument Clinic generated the checksum line and the function prototype just " +"above it. You should write the opening (and closing) curly braces for the " +"function, and the implementation inside." +msgstr "" +"Argument Clinic は、チェックサム行とそのすぐ上の関数プロトタイプまでを生成し" +"ました。 あなたは関数の開始の波括弧 ``{`` (および終了の波括弧 ``}`` )と、その" +"内側の実装を記述する必要があります。" + +#: ../../howto/clinic.rst:522 +msgid "" +"Remember the macro with the :c:type:`PyMethodDef` structure for this " +"function? Find the existing :c:type:`PyMethodDef` structure for this " +"function and replace it with a reference to the macro. (If the builtin is " +"at module scope, this will probably be very near the end of the file; if the " +"builtin is a class method, this will probably be below but relatively near " +"to the implementation.)" +msgstr "" +"この関数の :c:type:`PyMethodDef` 構造体を含むマクロについて思い出して下さい。" +"この関数の既存の :c:type:`PyMethodDef` 構造体を探して、それをマクロへの参照に" +"置き換えて下さい。 (ビルトインがモジュール・スコープにある場合、既存の :c:" +"type:`PyMethodDef` 構造体はおそらくファイルの終わり近くにあります。ビルトイン" +"がクラス・メソッドの場合、既存の :c:type:`PyMethodDef` 構造体はおそらく実装の" +"後ろにありますが、比較的実装に近いです。)" + +#: ../../howto/clinic.rst:529 +msgid "" +"Note that the body of the macro contains a trailing comma. So when you " +"replace the existing static :c:type:`PyMethodDef` structure with the macro, " +"*don't* add a comma to the end." +msgstr "" +"マクロの本体には末尾にカンマ(comma)が含まれていることに注意してください。した" +"がって、既存の static :c:type:`PyMethodDef` 構造体をマクロに置き換える場合" +"は、末尾にカンマ(comma)を追加しないでください。" + +#: ../../howto/clinic.rst:542 +msgid "" +"Compile, then run the relevant portions of the regression-test suite. This " +"change should not introduce any new compile-time warnings or errors, and " +"there should be no externally-visible change to Python's behavior." +msgstr "" + +#: ../../howto/clinic.rst:546 +msgid "" +"Well, except for one difference: ``inspect.signature()`` run on your " +"function should now provide a valid signature!" +msgstr "" + +#: ../../howto/clinic.rst:549 +msgid "" +"Congratulations, you've ported your first function to work with Argument " +"Clinic!" +msgstr "" + +#: ../../howto/clinic.rst:552 +msgid "Advanced Topics" +msgstr "高度なトピック" + +#: ../../howto/clinic.rst:554 +msgid "" +"Now that you've had some experience working with Argument Clinic, it's time " +"for some advanced topics." +msgstr "" + +#: ../../howto/clinic.rst:559 +msgid "Symbolic default values" +msgstr "シンボルのデフォルト値" + +#: ../../howto/clinic.rst:561 +msgid "" +"The default value you provide for a parameter can't be any arbitrary " +"expression. Currently the following are explicitly supported:" +msgstr "" + +#: ../../howto/clinic.rst:564 +msgid "Numeric constants (integer and float)" +msgstr "数値定数 (整数と浮動小数)" + +#: ../../howto/clinic.rst:565 +msgid "String constants" +msgstr "文字列定数" + +#: ../../howto/clinic.rst:566 +msgid "``True``, ``False``, and ``None``" +msgstr "``True``、``False``、``None``" + +#: ../../howto/clinic.rst:567 +msgid "" +"Simple symbolic constants like ``sys.maxsize``, which must start with the " +"name of the module" +msgstr "必ずモジュール名で始まる、 ``sys.maxsize`` のような単純な記号定数" + +#: ../../howto/clinic.rst:570 +msgid "" +"In case you're curious, this is implemented in ``from_builtin()`` in ``Lib/" +"inspect.py``." +msgstr "" + +#: ../../howto/clinic.rst:573 +msgid "" +"(In the future, this may need to get even more elaborate, to allow full " +"expressions like ``CONSTANT - 1``.)" +msgstr "" +"(将来的には、`CONSTANT - 1`` のような式を表現可能にするために、さらに精巧にす" +"る必要があるかもしれません。)" + +#: ../../howto/clinic.rst:578 +msgid "Renaming the C functions and variables generated by Argument Clinic" +msgstr "Argument Clinic が生成した関数と変数をリネームする" + +#: ../../howto/clinic.rst:580 +msgid "" +"Argument Clinic automatically names the functions it generates for you. " +"Occasionally this may cause a problem, if the generated name collides with " +"the name of an existing C function. There's an easy solution: override the " +"names used for the C functions. Just add the keyword ``\"as\"`` to your " +"function declaration line, followed by the function name you wish to use. " +"Argument Clinic will use that function name for the base (generated) " +"function, then add ``\"_impl\"`` to the end and use that for the name of the " +"impl function." +msgstr "" + +#: ../../howto/clinic.rst:588 +msgid "" +"For example, if we wanted to rename the C function names generated for " +"``pickle.Pickler.dump``, it'd look like this::" +msgstr "" + +#: ../../howto/clinic.rst:596 +msgid "" +"The base function would now be named ``pickler_dumper()``, and the impl " +"function would now be named ``pickler_dumper_impl()``." +msgstr "" + +#: ../../howto/clinic.rst:600 +msgid "" +"Similarly, you may have a problem where you want to give a parameter a " +"specific Python name, but that name may be inconvenient in C. Argument " +"Clinic allows you to give a parameter different names in Python and in C, " +"using the same ``\"as\"`` syntax::" +msgstr "" + +#: ../../howto/clinic.rst:614 +msgid "" +"Here, the name used in Python (in the signature and the ``keywords`` array) " +"would be ``file``, but the C variable would be named ``file_obj``." +msgstr "" + +#: ../../howto/clinic.rst:617 +msgid "You can use this to rename the ``self`` parameter too!" +msgstr "" + +#: ../../howto/clinic.rst:621 +msgid "Converting functions using PyArg_UnpackTuple" +msgstr "PyArg_UnpackTuple による関数の変換" + +#: ../../howto/clinic.rst:623 +msgid "" +"To convert a function parsing its arguments with :c:func:" +"`PyArg_UnpackTuple`, simply write out all the arguments, specifying each as " +"an ``object``. You may specify the ``type`` argument to cast the type as " +"appropriate. All arguments should be marked positional-only (add a ``/`` on " +"a line by itself after the last argument)." +msgstr "" + +#: ../../howto/clinic.rst:629 +msgid "" +"Currently the generated code will use :c:func:`PyArg_ParseTuple`, but this " +"will change soon." +msgstr "" + +#: ../../howto/clinic.rst:633 +msgid "Optional Groups" +msgstr "オプション群" + +#: ../../howto/clinic.rst:635 +msgid "" +"Some legacy functions have a tricky approach to parsing their arguments: " +"they count the number of positional arguments, then use a ``switch`` " +"statement to call one of several different :c:func:`PyArg_ParseTuple` calls " +"depending on how many positional arguments there are. (These functions " +"cannot accept keyword-only arguments.) This approach was used to simulate " +"optional arguments back before :c:func:`PyArg_ParseTupleAndKeywords` was " +"created." +msgstr "" + +#: ../../howto/clinic.rst:642 +msgid "" +"While functions using this approach can often be converted to use :c:func:" +"`PyArg_ParseTupleAndKeywords`, optional arguments, and default values, it's " +"not always possible. Some of these legacy functions have behaviors :c:func:" +"`PyArg_ParseTupleAndKeywords` doesn't directly support. The most obvious " +"example is the builtin function ``range()``, which has an optional argument " +"on the *left* side of its required argument! Another example is ``curses." +"window.addch()``, which has a group of two arguments that must always be " +"specified together. (The arguments are called ``x`` and ``y``; if you call " +"the function passing in ``x``, you must also pass in ``y``—and if you don't " +"pass in ``x`` you may not pass in ``y`` either.)" +msgstr "" + +#: ../../howto/clinic.rst:654 +msgid "" +"In any case, the goal of Argument Clinic is to support argument parsing for " +"all existing CPython builtins without changing their semantics. Therefore " +"Argument Clinic supports this alternate approach to parsing, using what are " +"called *optional groups*. Optional groups are groups of arguments that must " +"all be passed in together. They can be to the left or the right of the " +"required arguments. They can *only* be used with positional-only parameters." +msgstr "" + +#: ../../howto/clinic.rst:662 +msgid "" +"Optional groups are *only* intended for use when converting functions that " +"make multiple calls to :c:func:`PyArg_ParseTuple`! Functions that use *any* " +"other approach for parsing arguments should *almost never* be converted to " +"Argument Clinic using optional groups. Functions using optional groups " +"currently cannot have accurate signatures in Python, because Python just " +"doesn't understand the concept. Please avoid using optional groups wherever " +"possible." +msgstr "" + +#: ../../howto/clinic.rst:671 +msgid "" +"To specify an optional group, add a ``[`` on a line by itself before the " +"parameters you wish to group together, and a ``]`` on a line by itself after " +"these parameters. As an example, here's how ``curses.window.addch`` uses " +"optional groups to make the first two parameters and the last parameter " +"optional::" +msgstr "" + +#: ../../howto/clinic.rst:700 +msgid "Notes:" +msgstr "注釈:" + +#: ../../howto/clinic.rst:702 +msgid "" +"For every optional group, one additional parameter will be passed into the " +"impl function representing the group. The parameter will be an int named " +"``group_{direction}_{number}``, where ``{direction}`` is either ``right`` or " +"``left`` depending on whether the group is before or after the required " +"parameters, and ``{number}`` is a monotonically increasing number (starting " +"at 1) indicating how far away the group is from the required parameters. " +"When the impl is called, this parameter will be set to zero if this group " +"was unused, and set to non-zero if this group was used. (By used or unused, " +"I mean whether or not the parameters received arguments in this invocation.)" +msgstr "" + +#: ../../howto/clinic.rst:713 +msgid "" +"If there are no required arguments, the optional groups will behave as if " +"they're to the right of the required arguments." +msgstr "" + +#: ../../howto/clinic.rst:716 +msgid "" +"In the case of ambiguity, the argument parsing code favors parameters on the " +"left (before the required parameters)." +msgstr "" + +#: ../../howto/clinic.rst:719 +msgid "Optional groups can only contain positional-only parameters." +msgstr "" + +#: ../../howto/clinic.rst:721 +msgid "" +"Optional groups are *only* intended for legacy code. Please do not use " +"optional groups for new code." +msgstr "" + +#: ../../howto/clinic.rst:726 +msgid "Using real Argument Clinic converters, instead of \"legacy converters\"" +msgstr "" + +#: ../../howto/clinic.rst:728 +msgid "" +"To save time, and to minimize how much you need to learn to achieve your " +"first port to Argument Clinic, the walkthrough above tells you to use " +"\"legacy converters\". \"Legacy converters\" are a convenience, designed " +"explicitly to make porting existing code to Argument Clinic easier. And to " +"be clear, their use is acceptable when porting code for Python 3.4." +msgstr "" + +#: ../../howto/clinic.rst:735 +msgid "" +"However, in the long term we probably want all our blocks to use Argument " +"Clinic's real syntax for converters. Why? A couple reasons:" +msgstr "" + +#: ../../howto/clinic.rst:739 +msgid "" +"The proper converters are far easier to read and clearer in their intent." +msgstr "" + +#: ../../howto/clinic.rst:740 +msgid "" +"There are some format units that are unsupported as \"legacy converters\", " +"because they require arguments, and the legacy converter syntax doesn't " +"support specifying arguments." +msgstr "" + +#: ../../howto/clinic.rst:743 +msgid "" +"In the future we may have a new argument parsing library that isn't " +"restricted to what :c:func:`PyArg_ParseTuple` supports; this flexibility " +"won't be available to parameters using legacy converters." +msgstr "" + +#: ../../howto/clinic.rst:747 +msgid "" +"Therefore, if you don't mind a little extra effort, please use the normal " +"converters instead of legacy converters." +msgstr "" + +#: ../../howto/clinic.rst:750 +msgid "" +"In a nutshell, the syntax for Argument Clinic (non-legacy) converters looks " +"like a Python function call. However, if there are no explicit arguments to " +"the function (all functions take their default values), you may omit the " +"parentheses. Thus ``bool`` and ``bool()`` are exactly the same converters." +msgstr "" + +#: ../../howto/clinic.rst:756 +msgid "" +"All arguments to Argument Clinic converters are keyword-only. All Argument " +"Clinic converters accept the following arguments:" +msgstr "" + +#: ../../howto/clinic.rst:764 ../../howto/clinic.rst:1252 +msgid "``c_default``" +msgstr "``c_default``" + +#: ../../howto/clinic.rst:760 +msgid "" +"The default value for this parameter when defined in C. Specifically, this " +"will be the initializer for the variable declared in the \"parse " +"function\". See :ref:`the section on default values ` for " +"how to use this. Specified as a string." +msgstr "" + +#: ../../howto/clinic.rst:769 +msgid "``annotation``" +msgstr "``annotation``" + +#: ../../howto/clinic.rst:767 +msgid "" +"The annotation value for this parameter. Not currently supported, because :" +"pep:`8` mandates that the Python library may not use annotations." +msgstr "" + +#: ../../howto/clinic.rst:771 +msgid "" +"In addition, some converters accept additional arguments. Here is a list of " +"these arguments, along with their meanings:" +msgstr "" + +#: ../../howto/clinic.rst:780 +msgid "``accept``" +msgstr "``accept``" + +#: ../../howto/clinic.rst:775 +msgid "" +"A set of Python types (and possibly pseudo-types); this restricts the " +"allowable Python argument to values of these types. (This is not a general-" +"purpose facility; as a rule it only supports specific lists of types as " +"shown in the legacy converter table.)" +msgstr "" + +#: ../../howto/clinic.rst:780 +msgid "To accept ``None``, add ``NoneType`` to this set." +msgstr "" + +#: ../../howto/clinic.rst:785 +msgid "``bitwise``" +msgstr "``bitwise``" + +#: ../../howto/clinic.rst:783 +msgid "" +"Only supported for unsigned integers. The native integer value of this " +"Python argument will be written to the parameter without any range checking, " +"even for negative values." +msgstr "" + +#: ../../howto/clinic.rst:790 ../../howto/clinic.rst:1266 +msgid "``converter``" +msgstr "``converter``" + +#: ../../howto/clinic.rst:788 +msgid "" +"Only supported by the ``object`` converter. Specifies the name of a :ref:`C " +"\"converter function\" ` to use to convert this object to a " +"native type." +msgstr "" + +#: ../../howto/clinic.rst:795 +msgid "``encoding``" +msgstr "``encoding``" + +#: ../../howto/clinic.rst:793 +msgid "" +"Only supported for strings. Specifies the encoding to use when converting " +"this string from a Python str (Unicode) value into a C ``char *`` value." +msgstr "" + +#: ../../howto/clinic.rst:799 +msgid "``subclass_of``" +msgstr "``subclass_of``" + +#: ../../howto/clinic.rst:798 +msgid "" +"Only supported for the ``object`` converter. Requires that the Python value " +"be a subclass of a Python type, as expressed in C." +msgstr "" + +#: ../../howto/clinic.rst:804 ../../howto/clinic.rst:1238 +msgid "``type``" +msgstr "``type``" + +#: ../../howto/clinic.rst:802 +msgid "" +"Only supported for the ``object`` and ``self`` converters. Specifies the C " +"type that will be used to declare the variable. Default value is " +"``\"PyObject *\"``." +msgstr "" + +#: ../../howto/clinic.rst:810 +msgid "``zeroes``" +msgstr "``zeroes``" + +#: ../../howto/clinic.rst:807 +msgid "" +"Only supported for strings. If true, embedded NUL bytes (``'\\\\0'``) are " +"permitted inside the value. The length of the string will be passed in to " +"the impl function, just after the string parameter, as a parameter named " +"``_length``." +msgstr "" + +#: ../../howto/clinic.rst:812 +msgid "" +"Please note, not every possible combination of arguments will work. Usually " +"these arguments are implemented by specific ``PyArg_ParseTuple`` *format " +"units*, with specific behavior. For example, currently you cannot call " +"``unsigned_short`` without also specifying ``bitwise=True``. Although it's " +"perfectly reasonable to think this would work, these semantics don't map to " +"any existing format unit. So Argument Clinic doesn't support it. (Or, at " +"least, not yet.)" +msgstr "" + +#: ../../howto/clinic.rst:820 +msgid "" +"Below is a table showing the mapping of legacy converters into real Argument " +"Clinic converters. On the left is the legacy converter, on the right is the " +"text you'd replace it with." +msgstr "" +"以下の表は、 legacy converter から実際の Argument Clinic converter へのマッピ" +"ングを示す表です。左側は legacy converter で、右側がそれを置き換えたテキスト" +"です。" + +#: ../../howto/clinic.rst:825 +msgid "``'B'``" +msgstr "``'B'``" + +#: ../../howto/clinic.rst:825 +msgid "``unsigned_char(bitwise=True)``" +msgstr "``unsigned_char(bitwise=True)``" + +#: ../../howto/clinic.rst:826 +msgid "``'b'``" +msgstr "``'b'``" + +#: ../../howto/clinic.rst:826 +msgid "``unsigned_char``" +msgstr "``unsigned_char``" + +#: ../../howto/clinic.rst:827 +msgid "``'c'``" +msgstr "``'c'``" + +#: ../../howto/clinic.rst:827 +msgid "``char``" +msgstr "``char``" + +#: ../../howto/clinic.rst:828 +msgid "``'C'``" +msgstr "``'C'``" + +#: ../../howto/clinic.rst:828 +msgid "``int(accept={str})``" +msgstr "``int(accept={str})``" + +#: ../../howto/clinic.rst:829 +msgid "``'d'``" +msgstr "``'d'``" + +#: ../../howto/clinic.rst:829 +msgid "``double``" +msgstr "``double``" + +#: ../../howto/clinic.rst:830 +msgid "``'D'``" +msgstr "``'D'``" + +#: ../../howto/clinic.rst:830 +msgid "``Py_complex``" +msgstr "``Py_complex``" + +#: ../../howto/clinic.rst:831 +msgid "``'es'``" +msgstr "``'es'``" + +#: ../../howto/clinic.rst:831 +msgid "``str(encoding='name_of_encoding')``" +msgstr "``str(encoding='name_of_encoding')``" + +#: ../../howto/clinic.rst:832 +msgid "``'es#'``" +msgstr "``'es#'``" + +#: ../../howto/clinic.rst:832 +msgid "``str(encoding='name_of_encoding', zeroes=True)``" +msgstr "``str(encoding='name_of_encoding', zeroes=True)``" + +#: ../../howto/clinic.rst:833 +msgid "``'et'``" +msgstr "``'et'``" + +#: ../../howto/clinic.rst:833 +msgid "``str(encoding='name_of_encoding', accept={bytes, bytearray, str})``" +msgstr "``str(encoding='name_of_encoding', accept={bytes, bytearray, str})``" + +#: ../../howto/clinic.rst:834 +msgid "``'et#'``" +msgstr "``'et#'``" + +#: ../../howto/clinic.rst:834 +msgid "" +"``str(encoding='name_of_encoding', accept={bytes, bytearray, str}, " +"zeroes=True)``" +msgstr "" +"``str(encoding='name_of_encoding', accept={bytes, bytearray, str}, " +"zeroes=True)``" + +#: ../../howto/clinic.rst:835 +msgid "``'f'``" +msgstr "``'f'``" + +#: ../../howto/clinic.rst:835 +msgid "``float``" +msgstr "``float``" + +#: ../../howto/clinic.rst:836 +msgid "``'h'``" +msgstr "``'h'``" + +#: ../../howto/clinic.rst:836 +msgid "``short``" +msgstr "``short``" + +#: ../../howto/clinic.rst:837 +msgid "``'H'``" +msgstr "``'H'``" + +#: ../../howto/clinic.rst:837 +msgid "``unsigned_short(bitwise=True)``" +msgstr "``unsigned_short(bitwise=True)``" + +#: ../../howto/clinic.rst:838 +msgid "``'i'``" +msgstr "``'i'``" + +#: ../../howto/clinic.rst:838 +msgid "``int``" +msgstr "``int``" + +#: ../../howto/clinic.rst:839 +msgid "``'I'``" +msgstr "``'I'``" + +#: ../../howto/clinic.rst:839 +msgid "``unsigned_int(bitwise=True)``" +msgstr "``unsigned_int(bitwise=True)``" + +#: ../../howto/clinic.rst:840 +msgid "``'k'``" +msgstr "``'k'``" + +#: ../../howto/clinic.rst:840 +msgid "``unsigned_long(bitwise=True)``" +msgstr "``unsigned_long(bitwise=True)``" + +#: ../../howto/clinic.rst:841 +msgid "``'K'``" +msgstr "``'K'``" + +#: ../../howto/clinic.rst:841 +msgid "``unsigned_long_long(bitwise=True)``" +msgstr "``unsigned_long_long(bitwise=True)``" + +#: ../../howto/clinic.rst:842 +msgid "``'l'``" +msgstr "``'l'``" + +#: ../../howto/clinic.rst:842 +msgid "``long``" +msgstr "``long``" + +#: ../../howto/clinic.rst:843 +msgid "``'L'``" +msgstr "``'L'``" + +#: ../../howto/clinic.rst:843 +msgid "``long long``" +msgstr "" + +#: ../../howto/clinic.rst:844 +msgid "``'n'``" +msgstr "``'n'``" + +#: ../../howto/clinic.rst:844 +msgid "``Py_ssize_t``" +msgstr "``Py_ssize_t``" + +#: ../../howto/clinic.rst:845 +msgid "``'O'``" +msgstr "``'O'``" + +#: ../../howto/clinic.rst:845 +msgid "``object``" +msgstr "``object``" + +#: ../../howto/clinic.rst:846 +msgid "``'O!'``" +msgstr "``'O!'``" + +#: ../../howto/clinic.rst:846 +msgid "``object(subclass_of='&PySomething_Type')``" +msgstr "``object(subclass_of='&PySomething_Type')``" + +#: ../../howto/clinic.rst:847 +msgid "``'O&'``" +msgstr "``'O&'``" + +#: ../../howto/clinic.rst:847 +msgid "``object(converter='name_of_c_function')``" +msgstr "``object(converter='name_of_c_function')``" + +#: ../../howto/clinic.rst:848 +msgid "``'p'``" +msgstr "``'p'``" + +#: ../../howto/clinic.rst:848 +msgid "``bool``" +msgstr "``bool``" + +#: ../../howto/clinic.rst:849 +msgid "``'S'``" +msgstr "``'S'``" + +#: ../../howto/clinic.rst:849 +msgid "``PyBytesObject``" +msgstr "``PyBytesObject``" + +#: ../../howto/clinic.rst:850 +msgid "``'s'``" +msgstr "``'s'``" + +#: ../../howto/clinic.rst:850 +msgid "``str``" +msgstr "``str``" + +#: ../../howto/clinic.rst:851 +msgid "``'s#'``" +msgstr "``'s#'``" + +#: ../../howto/clinic.rst:851 +msgid "``str(zeroes=True)``" +msgstr "``str(zeroes=True)``" + +#: ../../howto/clinic.rst:852 +msgid "``'s*'``" +msgstr "``'s*'``" + +#: ../../howto/clinic.rst:852 +msgid "``Py_buffer(accept={buffer, str})``" +msgstr "``Py_buffer(accept={buffer, str})``" + +#: ../../howto/clinic.rst:853 +msgid "``'U'``" +msgstr "``'U'``" + +#: ../../howto/clinic.rst:853 +msgid "``unicode``" +msgstr "``unicode``" + +#: ../../howto/clinic.rst:854 +msgid "``'u'``" +msgstr "``'u'``" + +#: ../../howto/clinic.rst:854 +msgid "``Py_UNICODE``" +msgstr "``Py_UNICODE``" + +#: ../../howto/clinic.rst:855 +msgid "``'u#'``" +msgstr "``'u#'``" + +#: ../../howto/clinic.rst:855 +msgid "``Py_UNICODE(zeroes=True)``" +msgstr "``Py_UNICODE(zeroes=True)``" + +#: ../../howto/clinic.rst:856 +msgid "``'w*'``" +msgstr "``'w*'``" + +#: ../../howto/clinic.rst:856 +msgid "``Py_buffer(accept={rwbuffer})``" +msgstr "``Py_buffer(accept={rwbuffer})``" + +#: ../../howto/clinic.rst:857 +msgid "``'Y'``" +msgstr "``'Y'``" + +#: ../../howto/clinic.rst:857 +msgid "``PyByteArrayObject``" +msgstr "``PyByteArrayObject``" + +#: ../../howto/clinic.rst:858 +msgid "``'y'``" +msgstr "``'y'``" + +#: ../../howto/clinic.rst:858 +msgid "``str(accept={bytes})``" +msgstr "``str(accept={bytes})``" + +#: ../../howto/clinic.rst:859 +msgid "``'y#'``" +msgstr "``'y#'``" + +#: ../../howto/clinic.rst:859 +msgid "``str(accept={robuffer}, zeroes=True)``" +msgstr "``str(accept={robuffer}, zeroes=True)``" + +#: ../../howto/clinic.rst:860 +msgid "``'y*'``" +msgstr "``'y*'``" + +#: ../../howto/clinic.rst:860 +msgid "``Py_buffer``" +msgstr "``Py_buffer``" + +#: ../../howto/clinic.rst:861 +msgid "``'Z'``" +msgstr "``'Z'``" + +#: ../../howto/clinic.rst:861 +msgid "``Py_UNICODE(accept={str, NoneType})``" +msgstr "``Py_UNICODE(accept={str, NoneType})``" + +#: ../../howto/clinic.rst:862 +msgid "``'Z#'``" +msgstr "``'Z#'``" + +#: ../../howto/clinic.rst:862 +msgid "``Py_UNICODE(accept={str, NoneType}, zeroes=True)``" +msgstr "``Py_UNICODE(accept={str, NoneType}, zeroes=True)``" + +#: ../../howto/clinic.rst:863 +msgid "``'z'``" +msgstr "``'z'``" + +#: ../../howto/clinic.rst:863 +msgid "``str(accept={str, NoneType})``" +msgstr "``str(accept={str, NoneType})``" + +#: ../../howto/clinic.rst:864 +msgid "``'z#'``" +msgstr "``'z#'``" + +#: ../../howto/clinic.rst:864 +msgid "``str(accept={str, NoneType}, zeroes=True)``" +msgstr "``str(accept={str, NoneType}, zeroes=True)``" + +#: ../../howto/clinic.rst:865 +msgid "``'z*'``" +msgstr "``'z*'``" + +#: ../../howto/clinic.rst:865 +msgid "``Py_buffer(accept={buffer, str, NoneType})``" +msgstr "``Py_buffer(accept={buffer, str, NoneType})``" + +#: ../../howto/clinic.rst:868 +msgid "" +"As an example, here's our sample ``pickle.Pickler.dump`` using the proper " +"converter::" +msgstr "" +"例題の ``pickle.Pickler.dump`` 適切な converter を使用したものを以下示しま" +"す::" + +#: ../../howto/clinic.rst:881 +msgid "" +"One advantage of real converters is that they're more flexible than legacy " +"converters. For example, the ``unsigned_int`` converter (and all the " +"``unsigned_`` converters) can be specified without ``bitwise=True``. Their " +"default behavior performs range checking on the value, and they won't accept " +"negative numbers. You just can't do that with a legacy converter!" +msgstr "" + +#: ../../howto/clinic.rst:887 +msgid "" +"Argument Clinic will show you all the converters it has available. For each " +"converter it'll show you all the parameters it accepts, along with the " +"default value for each parameter. Just run ``Tools/clinic/clinic.py --" +"converters`` to see the full list." +msgstr "" + +#: ../../howto/clinic.rst:893 +msgid "Py_buffer" +msgstr "Py_buffer" + +#: ../../howto/clinic.rst:895 +msgid "" +"When using the ``Py_buffer`` converter (or the ``'s*'``, ``'w*'``, ``'*y'``, " +"or ``'z*'`` legacy converters), you *must* not call :c:func:" +"`PyBuffer_Release` on the provided buffer. Argument Clinic generates code " +"that does it for you (in the parsing function)." +msgstr "" + +#: ../../howto/clinic.rst:903 +msgid "Advanced converters" +msgstr "" + +#: ../../howto/clinic.rst:905 +msgid "" +"Remember those format units you skipped for your first time because they " +"were advanced? Here's how to handle those too." +msgstr "" + +#: ../../howto/clinic.rst:908 +msgid "" +"The trick is, all those format units take arguments—either conversion " +"functions, or types, or strings specifying an encoding. (But \"legacy " +"converters\" don't support arguments. That's why we skipped them for your " +"first function.) The argument you specified to the format unit is now an " +"argument to the converter; this argument is either ``converter`` (for " +"``O&``), ``subclass_of`` (for ``O!``), or ``encoding`` (for all the format " +"units that start with ``e``)." +msgstr "" + +#: ../../howto/clinic.rst:916 +msgid "" +"When using ``subclass_of``, you may also want to use the other custom " +"argument for ``object()``: ``type``, which lets you set the type actually " +"used for the parameter. For example, if you want to ensure that the object " +"is a subclass of ``PyUnicode_Type``, you probably want to use the converter " +"``object(type='PyUnicodeObject *', subclass_of='&PyUnicode_Type')``." +msgstr "" + +#: ../../howto/clinic.rst:922 +msgid "" +"One possible problem with using Argument Clinic: it takes away some possible " +"flexibility for the format units starting with ``e``. When writing a " +"``PyArg_Parse`` call by hand, you could theoretically decide at runtime what " +"encoding string to pass in to :c:func:`PyArg_ParseTuple`. But now this " +"string must be hard-coded at Argument-Clinic-preprocessing-time. This " +"limitation is deliberate; it made supporting this format unit much easier, " +"and may allow for future optimizations. This restriction doesn't seem " +"unreasonable; CPython itself always passes in static hard-coded encoding " +"strings for parameters whose format units start with ``e``." +msgstr "" + +#: ../../howto/clinic.rst:935 +msgid "Parameter default values" +msgstr "引数のデフォルト値" + +#: ../../howto/clinic.rst:937 +msgid "" +"Default values for parameters can be any of a number of values. At their " +"simplest, they can be string, int, or float literals:" +msgstr "" + +#: ../../howto/clinic.rst:946 +msgid "They can also use any of Python's built-in constants:" +msgstr "" + +#: ../../howto/clinic.rst:954 +msgid "" +"There's also special support for a default value of ``NULL``, and for simple " +"expressions, documented in the following sections." +msgstr "" + +#: ../../howto/clinic.rst:959 +msgid "The ``NULL`` default value" +msgstr "``NULL`` デフォルト値" + +#: ../../howto/clinic.rst:961 +msgid "" +"For string and object parameters, you can set them to ``None`` to indicate " +"that there's no default. However, that means the C variable will be " +"initialized to ``Py_None``. For convenience's sakes, there's a special " +"value called ``NULL`` for just this reason: from Python's perspective it " +"behaves like a default value of ``None``, but the C variable is initialized " +"with ``NULL``." +msgstr "" + +#: ../../howto/clinic.rst:969 +msgid "Expressions specified as default values" +msgstr "デフォルト値として指定された式" + +#: ../../howto/clinic.rst:971 +msgid "" +"The default value for a parameter can be more than just a literal value. It " +"can be an entire expression, using math operators and looking up attributes " +"on objects. However, this support isn't exactly simple, because of some non-" +"obvious semantics." +msgstr "" + +#: ../../howto/clinic.rst:976 +msgid "Consider the following example:" +msgstr "" + +#: ../../howto/clinic.rst:982 +msgid "" +"``sys.maxsize`` can have different values on different platforms. Therefore " +"Argument Clinic can't simply evaluate that expression locally and hard-code " +"it in C. So it stores the default in such a way that it will get evaluated " +"at runtime, when the user asks for the function's signature." +msgstr "" + +#: ../../howto/clinic.rst:987 +msgid "" +"What namespace is available when the expression is evaluated? It's " +"evaluated in the context of the module the builtin came from. So, if your " +"module has an attribute called \"``max_widgets``\", you may simply use it:" +msgstr "" + +#: ../../howto/clinic.rst:995 +msgid "" +"If the symbol isn't found in the current module, it fails over to looking in " +"``sys.modules``. That's how it can find ``sys.maxsize`` for example. " +"(Since you don't know in advance what modules the user will load into their " +"interpreter, it's best to restrict yourself to modules that are preloaded by " +"Python itself.)" +msgstr "" + +#: ../../howto/clinic.rst:1000 +msgid "" +"Evaluating default values only at runtime means Argument Clinic can't " +"compute the correct equivalent C default value. So you need to tell it " +"explicitly. When you use an expression, you must also specify the equivalent " +"expression in C, using the ``c_default`` parameter to the converter:" +msgstr "" + +#: ../../howto/clinic.rst:1009 +msgid "" +"Another complication: Argument Clinic can't know in advance whether or not " +"the expression you supply is valid. It parses it to make sure it looks " +"legal, but it can't *actually* know. You must be very careful when using " +"expressions to specify values that are guaranteed to be valid at runtime!" +msgstr "" + +#: ../../howto/clinic.rst:1014 +msgid "" +"Finally, because expressions must be representable as static C values, there " +"are many restrictions on legal expressions. Here's a list of Python " +"features you're not permitted to use:" +msgstr "" + +#: ../../howto/clinic.rst:1018 +msgid "Function calls." +msgstr "関数呼び出し" + +#: ../../howto/clinic.rst:1019 +msgid "Inline if statements (``3 if foo else 5``)." +msgstr "インライン if 文 (``3 if foo else 5``)." + +#: ../../howto/clinic.rst:1020 +msgid "Automatic sequence unpacking (``*[1, 2, 3]``)." +msgstr "シークエンスの自動アンパック (``*[1, 2, 3]``)." + +#: ../../howto/clinic.rst:1021 +msgid "List/set/dict comprehensions and generator expressions." +msgstr "List/set/dict 内包表記とジェネレータ式" + +#: ../../howto/clinic.rst:1022 +msgid "Tuple/list/set/dict literals." +msgstr "" + +#: ../../howto/clinic.rst:1027 +msgid "Using a return converter" +msgstr "" + +#: ../../howto/clinic.rst:1029 +msgid "" +"By default the impl function Argument Clinic generates for you returns " +"``PyObject *``. But your C function often computes some C type, then " +"converts it into the ``PyObject *`` at the last moment. Argument Clinic " +"handles converting your inputs from Python types into native C types—why not " +"have it convert your return value from a native C type into a Python type " +"too?" +msgstr "" + +#: ../../howto/clinic.rst:1035 +msgid "" +"That's what a \"return converter\" does. It changes your impl function to " +"return some C type, then adds code to the generated (non-impl) function to " +"handle converting that value into the appropriate ``PyObject *``." +msgstr "" + +#: ../../howto/clinic.rst:1039 +msgid "" +"The syntax for return converters is similar to that of parameter converters. " +"You specify the return converter like it was a return annotation on the " +"function itself. Return converters behave much the same as parameter " +"converters; they take arguments, the arguments are all keyword-only, and if " +"you're not changing any of the default arguments you can omit the " +"parentheses." +msgstr "" + +#: ../../howto/clinic.rst:1045 +msgid "" +"(If you use both ``\"as\"`` *and* a return converter for your function, the " +"``\"as\"`` should come before the return converter.)" +msgstr "" + +#: ../../howto/clinic.rst:1048 +msgid "" +"There's one additional complication when using return converters: how do you " +"indicate an error has occurred? Normally, a function returns a valid (non-" +"``NULL``) pointer for success, and ``NULL`` for failure. But if you use an " +"integer return converter, all integers are valid. How can Argument Clinic " +"detect an error? Its solution: each return converter implicitly looks for a " +"special value that indicates an error. If you return that value, and an " +"error has been set (``PyErr_Occurred()`` returns a true value), then the " +"generated code will propagate the error. Otherwise it will encode the value " +"you return like normal." +msgstr "" + +#: ../../howto/clinic.rst:1057 +msgid "Currently Argument Clinic supports only a few return converters:" +msgstr "" + +#: ../../howto/clinic.rst:1072 +msgid "" +"None of these take parameters. For the first three, return -1 to indicate " +"error. For ``DecodeFSDefault``, the return type is ``const char *``; return " +"a ``NULL`` pointer to indicate an error." +msgstr "" + +#: ../../howto/clinic.rst:1076 +msgid "" +"(There's also an experimental ``NoneType`` converter, which lets you return " +"``Py_None`` on success or ``NULL`` on failure, without having to increment " +"the reference count on ``Py_None``. I'm not sure it adds enough clarity to " +"be worth using.)" +msgstr "" + +#: ../../howto/clinic.rst:1081 +msgid "" +"To see all the return converters Argument Clinic supports, along with their " +"parameters (if any), just run ``Tools/clinic/clinic.py --converters`` for " +"the full list." +msgstr "" + +#: ../../howto/clinic.rst:1087 +msgid "Cloning existing functions" +msgstr "既存関数の複製" + +#: ../../howto/clinic.rst:1089 +msgid "" +"If you have a number of functions that look similar, you may be able to use " +"Clinic's \"clone\" feature. When you clone an existing function, you reuse:" +msgstr "" + +#: ../../howto/clinic.rst:1093 +msgid "its parameters, including" +msgstr "" + +#: ../../howto/clinic.rst:1095 +msgid "their names," +msgstr "名前、" + +#: ../../howto/clinic.rst:1097 +msgid "their converters, with all parameters," +msgstr "コンバータと全引数、" + +#: ../../howto/clinic.rst:1099 +msgid "their default values," +msgstr "デフォルト値、" + +#: ../../howto/clinic.rst:1101 +msgid "their per-parameter docstrings," +msgstr "引数ごとのドックストリング、" + +#: ../../howto/clinic.rst:1103 +msgid "" +"their *kind* (whether they're positional only, positional or keyword, or " +"keyword only), and" +msgstr "*種類* (位置専用、位置またはキーワード、キーワード専用)、" + +#: ../../howto/clinic.rst:1106 +msgid "its return converter." +msgstr "return コンバータ" + +#: ../../howto/clinic.rst:1108 +msgid "" +"The only thing not copied from the original function is its docstring; the " +"syntax allows you to specify a new docstring." +msgstr "" + +#: ../../howto/clinic.rst:1111 +msgid "Here's the syntax for cloning a function::" +msgstr "" + +#: ../../howto/clinic.rst:1119 +msgid "" +"(The functions can be in different modules or classes. I wrote ``module." +"class`` in the sample just to illustrate that you must use the full path to " +"*both* functions.)" +msgstr "" + +#: ../../howto/clinic.rst:1123 +msgid "" +"Sorry, there's no syntax for partially-cloning a function, or cloning a " +"function then modifying it. Cloning is an all-or nothing proposition." +msgstr "" + +#: ../../howto/clinic.rst:1126 +msgid "" +"Also, the function you are cloning from must have been previously defined in " +"the current file." +msgstr "" + +#: ../../howto/clinic.rst:1130 +msgid "Calling Python code" +msgstr "Python コードの呼び出し" + +#: ../../howto/clinic.rst:1132 +msgid "" +"The rest of the advanced topics require you to write Python code which lives " +"inside your C file and modifies Argument Clinic's runtime state. This is " +"simple: you simply define a Python block." +msgstr "" + +#: ../../howto/clinic.rst:1136 +msgid "" +"A Python block uses different delimiter lines than an Argument Clinic " +"function block. It looks like this::" +msgstr "" + +#: ../../howto/clinic.rst:1143 +msgid "" +"All the code inside the Python block is executed at the time it's parsed. " +"All text written to stdout inside the block is redirected into the " +"\"output\" after the block." +msgstr "" + +#: ../../howto/clinic.rst:1147 +msgid "" +"As an example, here's a Python block that adds a static integer variable to " +"the C code::" +msgstr "" + +#: ../../howto/clinic.rst:1158 +msgid "Using a \"self converter\"" +msgstr "\"self converter\" の利用" + +#: ../../howto/clinic.rst:1160 +msgid "" +"Argument Clinic automatically adds a \"self\" parameter for you using a " +"default converter. It automatically sets the ``type`` of this parameter to " +"the \"pointer to an instance\" you specified when you declared the type. " +"However, you can override Argument Clinic's converter and specify one " +"yourself. Just add your own ``self`` parameter as the first parameter in a " +"block, and ensure that its converter is an instance of ``self_converter`` or " +"a subclass thereof." +msgstr "" + +#: ../../howto/clinic.rst:1169 +msgid "" +"What's the point? This lets you override the type of ``self``, or give it a " +"different default name." +msgstr "" + +#: ../../howto/clinic.rst:1172 +msgid "" +"How do you specify the custom type you want to cast ``self`` to? If you only " +"have one or two functions with the same type for ``self``, you can directly " +"use Argument Clinic's existing ``self`` converter, passing in the type you " +"want to use as the ``type`` parameter::" +msgstr "" + +#: ../../howto/clinic.rst:1188 +msgid "" +"On the other hand, if you have a lot of functions that will use the same " +"type for ``self``, it's best to create your own converter, subclassing " +"``self_converter`` but overwriting the ``type`` member::" +msgstr "" + +#: ../../howto/clinic.rst:1211 +msgid "Writing a custom converter" +msgstr "カスタムコンバータを書く" + +#: ../../howto/clinic.rst:1213 +msgid "" +"As we hinted at in the previous section... you can write your own " +"converters! A converter is simply a Python class that inherits from " +"``CConverter``. The main purpose of a custom converter is if you have a " +"parameter using the ``O&`` format unit—parsing this parameter means calling " +"a :c:func:`PyArg_ParseTuple` \"converter function\"." +msgstr "" + +#: ../../howto/clinic.rst:1219 +msgid "" +"Your converter class should be named ``*something*_converter``. If the name " +"follows this convention, then your converter class will be automatically " +"registered with Argument Clinic; its name will be the name of your class " +"with the ``_converter`` suffix stripped off. (This is accomplished with a " +"metaclass.)" +msgstr "" + +#: ../../howto/clinic.rst:1225 +msgid "" +"You shouldn't subclass ``CConverter.__init__``. Instead, you should write a " +"``converter_init()`` function. ``converter_init()`` always accepts a " +"``self`` parameter; after that, all additional parameters *must* be keyword-" +"only. Any arguments passed in to the converter in Argument Clinic will be " +"passed along to your ``converter_init()``." +msgstr "" + +#: ../../howto/clinic.rst:1232 +msgid "" +"There are some additional members of ``CConverter`` you may wish to specify " +"in your subclass. Here's the current list:" +msgstr "" + +#: ../../howto/clinic.rst:1236 +msgid "" +"The C type to use for this variable. ``type`` should be a Python string " +"specifying the type, e.g. ``int``. If this is a pointer type, the type " +"string should end with ``' *'``." +msgstr "" + +#: ../../howto/clinic.rst:1242 +msgid "``default``" +msgstr "``default``" + +#: ../../howto/clinic.rst:1241 +msgid "" +"The Python default value for this parameter, as a Python value. Or the magic " +"value ``unspecified`` if there is no default." +msgstr "" + +#: ../../howto/clinic.rst:1247 +msgid "``py_default``" +msgstr "``py_default``" + +#: ../../howto/clinic.rst:1245 +msgid "" +"``default`` as it should appear in Python code, as a string. Or ``None`` if " +"there is no default." +msgstr "" + +#: ../../howto/clinic.rst:1250 +msgid "" +"``default`` as it should appear in C code, as a string. Or ``None`` if there " +"is no default." +msgstr "" + +#: ../../howto/clinic.rst:1263 +msgid "``c_ignored_default``" +msgstr "``c_ignored_default``" + +#: ../../howto/clinic.rst:1255 +msgid "" +"The default value used to initialize the C variable when there is no " +"default, but not specifying a default may result in an \"uninitialized " +"variable\" warning. This can easily happen when using option groups—" +"although properly-written code will never actually use this value, the " +"variable does get passed in to the impl, and the C compiler will complain " +"about the \"use\" of the uninitialized value. This value should always be a " +"non-empty string." +msgstr "" + +#: ../../howto/clinic.rst:1266 +msgid "The name of the C converter function, as a string." +msgstr "" + +#: ../../howto/clinic.rst:1271 +msgid "``impl_by_reference``" +msgstr "``impl_by_reference``" + +#: ../../howto/clinic.rst:1269 +msgid "" +"A boolean value. If true, Argument Clinic will add a ``&`` in front of the " +"name of the variable when passing it into the impl function." +msgstr "" + +#: ../../howto/clinic.rst:1277 +msgid "``parse_by_reference``" +msgstr "``parse_by_reference``" + +#: ../../howto/clinic.rst:1274 +msgid "" +"A boolean value. If true, Argument Clinic will add a ``&`` in front of the " +"name of the variable when passing it into :c:func:`PyArg_ParseTuple`." +msgstr "" + +#: ../../howto/clinic.rst:1279 +msgid "" +"Here's the simplest example of a custom converter, from ``Modules/zlibmodule." +"c``::" +msgstr "" + +#: ../../howto/clinic.rst:1290 +msgid "" +"This block adds a converter to Argument Clinic named ``ssize_t``. " +"Parameters declared as ``ssize_t`` will be declared as type ``Py_ssize_t``, " +"and will be parsed by the ``'O&'`` format unit, which will call the " +"``ssize_t_converter`` converter function. ``ssize_t`` variables " +"automatically support default values." +msgstr "" + +#: ../../howto/clinic.rst:1296 +msgid "" +"More sophisticated custom converters can insert custom C code to handle " +"initialization and cleanup. You can see more examples of custom converters " +"in the CPython source tree; grep the C files for the string ``CConverter``." +msgstr "" + +#: ../../howto/clinic.rst:1302 +msgid "Writing a custom return converter" +msgstr "カスタム return コンバータを書く" + +#: ../../howto/clinic.rst:1304 +msgid "" +"Writing a custom return converter is much like writing a custom converter. " +"Except it's somewhat simpler, because return converters are themselves much " +"simpler." +msgstr "" + +#: ../../howto/clinic.rst:1308 +msgid "" +"Return converters must subclass ``CReturnConverter``. There are no examples " +"yet of custom return converters, because they are not widely used yet. If " +"you wish to write your own return converter, please read ``Tools/clinic/" +"clinic.py``, specifically the implementation of ``CReturnConverter`` and all " +"its subclasses." +msgstr "" + +#: ../../howto/clinic.rst:1316 +msgid "METH_O and METH_NOARGS" +msgstr "METH_O と METH_NOARGS" + +#: ../../howto/clinic.rst:1318 +msgid "" +"To convert a function using ``METH_O``, make sure the function's single " +"argument is using the ``object`` converter, and mark the arguments as " +"positional-only::" +msgstr "" + +#: ../../howto/clinic.rst:1330 +msgid "" +"To convert a function using ``METH_NOARGS``, just don't specify any " +"arguments." +msgstr "" + +#: ../../howto/clinic.rst:1333 +msgid "" +"You can still use a self converter, a return converter, and specify a " +"``type`` argument to the object converter for ``METH_O``." +msgstr "" + +#: ../../howto/clinic.rst:1337 +msgid "tp_new and tp_init functions" +msgstr "tp_new と tp_init functions" + +#: ../../howto/clinic.rst:1339 +msgid "" +"You can convert ``tp_new`` and ``tp_init`` functions. Just name them " +"``__new__`` or ``__init__`` as appropriate. Notes:" +msgstr "" + +#: ../../howto/clinic.rst:1342 +msgid "" +"The function name generated for ``__new__`` doesn't end in ``__new__`` like " +"it would by default. It's just the name of the class, converted into a " +"valid C identifier." +msgstr "" + +#: ../../howto/clinic.rst:1346 +msgid "No ``PyMethodDef`` ``#define`` is generated for these functions." +msgstr "" + +#: ../../howto/clinic.rst:1348 +msgid "``__init__`` functions return ``int``, not ``PyObject *``." +msgstr "" + +#: ../../howto/clinic.rst:1350 +msgid "Use the docstring as the class docstring." +msgstr "" + +#: ../../howto/clinic.rst:1352 +msgid "" +"Although ``__new__`` and ``__init__`` functions must always accept both the " +"``args`` and ``kwargs`` objects, when converting you may specify any " +"signature for these functions that you like. (If your function doesn't " +"support keywords, the parsing function generated will throw an exception if " +"it receives any.)" +msgstr "" + +#: ../../howto/clinic.rst:1359 +msgid "Changing and redirecting Clinic's output" +msgstr "Clinic 出力の変更とリダイレクト" + +#: ../../howto/clinic.rst:1361 +msgid "" +"It can be inconvenient to have Clinic's output interspersed with your " +"conventional hand-edited C code. Luckily, Clinic is configurable: you can " +"buffer up its output for printing later (or earlier!), or write its output " +"to a separate file. You can also add a prefix or suffix to every line of " +"Clinic's generated output." +msgstr "" + +#: ../../howto/clinic.rst:1367 +msgid "" +"While changing Clinic's output in this manner can be a boon to readability, " +"it may result in Clinic code using types before they are defined, or your " +"code attempting to use Clinic-generated code before it is defined. These " +"problems can be easily solved by rearranging the declarations in your file, " +"or moving where Clinic's generated code goes. (This is why the default " +"behavior of Clinic is to output everything into the current block; while " +"many people consider this hampers readability, it will never require " +"rearranging your code to fix definition-before-use problems.)" +msgstr "" + +#: ../../howto/clinic.rst:1376 +msgid "Let's start with defining some terminology:" +msgstr "" + +#: ../../howto/clinic.rst:1403 +msgid "*field*" +msgstr "*field*" + +#: ../../howto/clinic.rst:1379 +msgid "" +"A field, in this context, is a subsection of Clinic's output. For example, " +"the ``#define`` for the ``PyMethodDef`` structure is a field, called " +"``methoddef_define``. Clinic has seven different fields it can output per " +"function definition:" +msgstr "" + +#: ../../howto/clinic.rst:1394 +msgid "" +"All the names are of the form ``\"_\"``, where ``\"\"`` is the " +"semantic object represented (the parsing function, the impl function, the " +"docstring, or the methoddef structure) and ``\"\"`` represents what kind " +"of statement the field is. Field names that end in ``\"_prototype\"`` " +"represent forward declarations of that thing, without the actual body/data " +"of the thing; field names that end in ``\"_definition\"`` represent the " +"actual definition of the thing, with the body/data of the thing. " +"(``\"methoddef\"`` is special, it's the only one that ends with " +"``\"_define\"``, representing that it's a preprocessor #define.)" +msgstr "" + +#: ../../howto/clinic.rst:1437 +msgid "*destination*" +msgstr "*destination*" + +#: ../../howto/clinic.rst:1406 +msgid "" +"A destination is a place Clinic can write output to. There are five built-" +"in destinations:" +msgstr "" + +#: ../../howto/clinic.rst:1411 ../../howto/clinic.rst:1486 +#: ../../howto/clinic.rst:1564 +msgid "``block``" +msgstr "``block``" + +#: ../../howto/clinic.rst:1410 +msgid "" +"The default destination: printed in the output section of the current Clinic " +"block." +msgstr "" + +#: ../../howto/clinic.rst:1417 ../../howto/clinic.rst:1513 +#: ../../howto/clinic.rst:1567 +msgid "``buffer``" +msgstr "``buffer``" + +#: ../../howto/clinic.rst:1414 +msgid "" +"A text buffer where you can save text for later. Text sent here is appended " +"to the end of any existing text. It's an error to have any text left in the " +"buffer when Clinic finishes processing a file." +msgstr "" + +#: ../../howto/clinic.rst:1428 ../../howto/clinic.rst:1499 +#: ../../howto/clinic.rst:1593 +msgid "``file``" +msgstr "``file``" + +#: ../../howto/clinic.rst:1420 +msgid "" +"A separate \"clinic file\" that will be created automatically by Clinic. The " +"filename chosen for the file is ``{basename}.clinic{extension}``, where " +"``basename`` and ``extension`` were assigned the output from ``os.path." +"splitext()`` run on the current file. (Example: the ``file`` destination " +"for ``_pickle.c`` would be written to ``_pickle.clinic.c``.)" +msgstr "" + +#: ../../howto/clinic.rst:1427 +msgid "" +"**Important: When using a** ``file`` **destination, you** *must check in* " +"**the generated file!**" +msgstr "" + +#: ../../howto/clinic.rst:1433 ../../howto/clinic.rst:1526 +#: ../../howto/clinic.rst:1597 +msgid "``two-pass``" +msgstr "``two-pass``" + +#: ../../howto/clinic.rst:1431 +msgid "" +"A buffer like ``buffer``. However, a two-pass buffer can only be dumped " +"once, and it prints out all text sent to it during all processing, even from " +"Clinic blocks *after* the dumping point." +msgstr "" + +#: ../../howto/clinic.rst:1437 ../../howto/clinic.rst:1560 +msgid "``suppress``" +msgstr "``suppress``" + +#: ../../howto/clinic.rst:1436 +msgid "The text is suppressed—thrown away." +msgstr "" + +#: ../../howto/clinic.rst:1439 +msgid "Clinic defines five new directives that let you reconfigure its output." +msgstr "" + +#: ../../howto/clinic.rst:1441 +msgid "The first new directive is ``dump``:" +msgstr "" + +#: ../../howto/clinic.rst:1447 +msgid "" +"This dumps the current contents of the named destination into the output of " +"the current block, and empties it. This only works with ``buffer`` and " +"``two-pass`` destinations." +msgstr "" + +#: ../../howto/clinic.rst:1451 +msgid "" +"The second new directive is ``output``. The most basic form of ``output`` " +"is like this:" +msgstr "" + +#: ../../howto/clinic.rst:1458 +msgid "" +"This tells Clinic to output *field* to *destination*. ``output`` also " +"supports a special meta-destination, called ``everything``, which tells " +"Clinic to output *all* fields to that *destination*." +msgstr "" + +#: ../../howto/clinic.rst:1462 +msgid "``output`` has a number of other functions:" +msgstr "" + +#: ../../howto/clinic.rst:1471 +msgid "" +"``output push`` and ``output pop`` allow you to push and pop configurations " +"on an internal configuration stack, so that you can temporarily modify the " +"output configuration, then easily restore the previous configuration. " +"Simply push before your change to save the current configuration, then pop " +"when you wish to restore the previous configuration." +msgstr "" + +#: ../../howto/clinic.rst:1478 +msgid "" +"``output preset`` sets Clinic's output to one of several built-in preset " +"configurations, as follows:" +msgstr "" + +#: ../../howto/clinic.rst:1482 +msgid "" +"Clinic's original starting configuration. Writes everything immediately " +"after the input block." +msgstr "" + +#: ../../howto/clinic.rst:1485 +msgid "" +"Suppress the ``parser_prototype`` and ``docstring_prototype``, write " +"everything else to ``block``." +msgstr "" + +#: ../../howto/clinic.rst:1489 +msgid "" +"Designed to write everything to the \"clinic file\" that it can. You then " +"``#include`` this file near the top of your file. You may need to rearrange " +"your file to make this work, though usually this just means creating forward " +"declarations for various ``typedef`` and ``PyTypeObject`` definitions." +msgstr "" + +#: ../../howto/clinic.rst:1495 +msgid "" +"Suppress the ``parser_prototype`` and ``docstring_prototype``, write the " +"``impl_definition`` to ``block``, and write everything else to ``file``." +msgstr "" + +#: ../../howto/clinic.rst:1499 +msgid "The default filename is ``\"{dirname}/clinic/{basename}.h\"``." +msgstr "" + +#: ../../howto/clinic.rst:1502 +msgid "" +"Save up most of the output from Clinic, to be written into your file near " +"the end. For Python files implementing modules or builtin types, it's " +"recommended that you dump the buffer just above the static structures for " +"your module or builtin type; these are normally very near the end. Using " +"``buffer`` may require even more editing than ``file``, if your file has " +"static ``PyMethodDef`` arrays defined in the middle of the file." +msgstr "" + +#: ../../howto/clinic.rst:1511 +msgid "" +"Suppress the ``parser_prototype``, ``impl_prototype``, and " +"``docstring_prototype``, write the ``impl_definition`` to ``block``, and " +"write everything else to ``file``." +msgstr "" + +#: ../../howto/clinic.rst:1516 +msgid "" +"Similar to the ``buffer`` preset, but writes forward declarations to the " +"``two-pass`` buffer, and definitions to the ``buffer``. This is similar to " +"the ``buffer`` preset, but may require less editing than ``buffer``. Dump " +"the ``two-pass`` buffer near the top of your file, and dump the ``buffer`` " +"near the end just like you would when using the ``buffer`` preset." +msgstr "" + +#: ../../howto/clinic.rst:1523 +msgid "" +"Suppresses the ``impl_prototype``, write the ``impl_definition`` to " +"``block``, write ``docstring_prototype``, ``methoddef_define``, and " +"``parser_prototype`` to ``two-pass``, write everything else to ``buffer``." +msgstr "" + +#: ../../howto/clinic.rst:1537 +msgid "``partial-buffer``" +msgstr "``partial-buffer``" + +#: ../../howto/clinic.rst:1529 +msgid "" +"Similar to the ``buffer`` preset, but writes more things to ``block``, only " +"writing the really big chunks of generated code to ``buffer``. This avoids " +"the definition-before-use problem of ``buffer`` completely, at the small " +"cost of having slightly more stuff in the block's output. Dump the " +"``buffer`` near the end, just like you would when using the ``buffer`` " +"preset." +msgstr "" + +#: ../../howto/clinic.rst:1536 +msgid "" +"Suppresses the ``impl_prototype``, write the ``docstring_definition`` and " +"``parser_definition`` to ``buffer``, write everything else to ``block``." +msgstr "" + +#: ../../howto/clinic.rst:1539 +msgid "The third new directive is ``destination``:" +msgstr "" + +#: ../../howto/clinic.rst:1545 +msgid "This performs an operation on the destination named ``name``." +msgstr "" + +#: ../../howto/clinic.rst:1547 +msgid "There are two defined subcommands: ``new`` and ``clear``." +msgstr "" + +#: ../../howto/clinic.rst:1549 +msgid "The ``new`` subcommand works like this:" +msgstr "" + +#: ../../howto/clinic.rst:1555 +msgid "" +"This creates a new destination with name ```` and type ````." +msgstr "" + +#: ../../howto/clinic.rst:1557 +msgid "There are five destination types:" +msgstr "" + +#: ../../howto/clinic.rst:1560 +msgid "Throws the text away." +msgstr "" + +#: ../../howto/clinic.rst:1563 +msgid "" +"Writes the text to the current block. This is what Clinic originally did." +msgstr "" + +#: ../../howto/clinic.rst:1567 +msgid "A simple text buffer, like the \"buffer\" builtin destination above." +msgstr "" + +#: ../../howto/clinic.rst:1570 +msgid "" +"A text file. The file destination takes an extra argument, a template to " +"use for building the filename, like so:" +msgstr "" + +#: ../../howto/clinic.rst:1573 +msgid "destination new " +msgstr "" + +#: ../../howto/clinic.rst:1575 +msgid "" +"The template can use three strings internally that will be replaced by bits " +"of the filename:" +msgstr "" + +#: ../../howto/clinic.rst:1578 +msgid "{path}" +msgstr "{path}" + +#: ../../howto/clinic.rst:1579 +msgid "The full path to the file, including directory and full filename." +msgstr "" + +#: ../../howto/clinic.rst:1580 +msgid "{dirname}" +msgstr "{dirname}" + +#: ../../howto/clinic.rst:1581 +msgid "The name of the directory the file is in." +msgstr "" + +#: ../../howto/clinic.rst:1582 +msgid "{basename}" +msgstr "{basename}" + +#: ../../howto/clinic.rst:1583 +msgid "Just the name of the file, not including the directory." +msgstr "" + +#: ../../howto/clinic.rst:1585 +msgid "{basename_root}" +msgstr "{basename_root}" + +#: ../../howto/clinic.rst:1585 +msgid "" +"Basename with the extension clipped off (everything up to but not including " +"the last '.')." +msgstr "" + +#: ../../howto/clinic.rst:1589 +msgid "{basename_extension}" +msgstr "{basename_extension}" + +#: ../../howto/clinic.rst:1588 +msgid "" +"The last '.' and everything after it. If the basename does not contain a " +"period, this will be the empty string." +msgstr "" + +#: ../../howto/clinic.rst:1591 +msgid "" +"If there are no periods in the filename, {basename} and {filename} are the " +"same, and {extension} is empty. \"{basename}{extension}\" is always exactly " +"the same as \"{filename}\".\"" +msgstr "" + +#: ../../howto/clinic.rst:1596 +msgid "A two-pass buffer, like the \"two-pass\" builtin destination above." +msgstr "" + +#: ../../howto/clinic.rst:1599 +msgid "The ``clear`` subcommand works like this:" +msgstr "" + +#: ../../howto/clinic.rst:1605 +msgid "" +"It removes all the accumulated text up to this point in the destination. (I " +"don't know what you'd need this for, but I thought maybe it'd be useful " +"while someone's experimenting.)" +msgstr "" + +#: ../../howto/clinic.rst:1609 +msgid "The fourth new directive is ``set``:" +msgstr "" + +#: ../../howto/clinic.rst:1616 +msgid "" +"``set`` lets you set two internal variables in Clinic. ``line_prefix`` is a " +"string that will be prepended to every line of Clinic's output; " +"``line_suffix`` is a string that will be appended to every line of Clinic's " +"output." +msgstr "" + +#: ../../howto/clinic.rst:1620 +msgid "Both of these support two format strings:" +msgstr "以下はいずれも書式文字列をサポートします:" + +#: ../../howto/clinic.rst:1623 +msgid "``{block comment start}``" +msgstr "``{block comment start}``" + +#: ../../howto/clinic.rst:1623 +msgid "" +"Turns into the string ``/*``, the start-comment text sequence for C files." +msgstr "" + +#: ../../howto/clinic.rst:1626 +msgid "``{block comment end}``" +msgstr "``{block comment end}``" + +#: ../../howto/clinic.rst:1626 +msgid "" +"Turns into the string ``*/``, the end-comment text sequence for C files." +msgstr "" + +#: ../../howto/clinic.rst:1628 +msgid "" +"The final new directive is one you shouldn't need to use directly, called " +"``preserve``:" +msgstr "" + +#: ../../howto/clinic.rst:1635 +msgid "" +"This tells Clinic that the current contents of the output should be kept, " +"unmodified. This is used internally by Clinic when dumping output into " +"``file`` files; wrapping it in a Clinic block lets Clinic use its existing " +"checksum functionality to ensure the file was not modified by hand before it " +"gets overwritten." +msgstr "" + +#: ../../howto/clinic.rst:1642 +msgid "The #ifdef trick" +msgstr "#ifdef トリック" + +#: ../../howto/clinic.rst:1644 +msgid "" +"If you're converting a function that isn't available on all platforms, " +"there's a trick you can use to make life a little easier. The existing code " +"probably looks like this::" +msgstr "" + +#: ../../howto/clinic.rst:1655 +msgid "" +"And then in the ``PyMethodDef`` structure at the bottom the existing code " +"will have:" +msgstr "" + +#: ../../howto/clinic.rst:1664 +msgid "" +"In this scenario, you should enclose the body of your impl function inside " +"the ``#ifdef``, like so::" +msgstr "" + +#: ../../howto/clinic.rst:1678 +msgid "" +"Then, remove those three lines from the ``PyMethodDef`` structure, replacing " +"them with the macro Argument Clinic generated:" +msgstr "" + +#: ../../howto/clinic.rst:1685 +msgid "" +"(You can find the real name for this macro inside the generated code. Or you " +"can calculate it yourself: it's the name of your function as defined on the " +"first line of your block, but with periods changed to underscores, " +"uppercased, and ``\"_METHODDEF\"`` added to the end.)" +msgstr "" + +#: ../../howto/clinic.rst:1690 +msgid "" +"Perhaps you're wondering: what if ``HAVE_FUNCTIONNAME`` isn't defined? The " +"``MODULE_FUNCTIONNAME_METHODDEF`` macro won't be defined either!" +msgstr "" + +#: ../../howto/clinic.rst:1693 +msgid "" +"Here's where Argument Clinic gets very clever. It actually detects that the " +"Argument Clinic block might be deactivated by the ``#ifdef``. When that " +"happens, it generates a little extra code that looks like this::" +msgstr "" + +#: ../../howto/clinic.rst:1701 +msgid "" +"That means the macro always works. If the function is defined, this turns " +"into the correct structure, including the trailing comma. If the function " +"is undefined, this turns into nothing." +msgstr "" + +#: ../../howto/clinic.rst:1705 +msgid "" +"However, this causes one ticklish problem: where should Argument Clinic put " +"this extra code when using the \"block\" output preset? It can't go in the " +"output block, because that could be deactivated by the ``#ifdef``. (That's " +"the whole point!)" +msgstr "" + +#: ../../howto/clinic.rst:1709 +msgid "" +"In this situation, Argument Clinic writes the extra code to the \"buffer\" " +"destination. This may mean that you get a complaint from Argument Clinic:" +msgstr "" + +#: ../../howto/clinic.rst:1717 +msgid "" +"When this happens, just open your file, find the ``dump buffer`` block that " +"Argument Clinic added to your file (it'll be at the very bottom), then move " +"it above the ``PyMethodDef`` structure where that macro is used." +msgstr "" + +#: ../../howto/clinic.rst:1724 +msgid "Using Argument Clinic in Python files" +msgstr "Python ファイル内での Argument Clinic の利用" + +#: ../../howto/clinic.rst:1726 +msgid "" +"It's actually possible to use Argument Clinic to preprocess Python files. " +"There's no point to using Argument Clinic blocks, of course, as the output " +"wouldn't make any sense to the Python interpreter. But using Argument " +"Clinic to run Python blocks lets you use Python as a Python preprocessor!" +msgstr "" + +#: ../../howto/clinic.rst:1731 msgid "" -"The Argument Clinic How-TO has been moved to the `Python Developer's Guide " -"`__." +"Since Python comments are different from C comments, Argument Clinic blocks " +"embedded in Python files look slightly different. They look like this:" msgstr "" -"Argument Clinic How-TOは、 `Python Developer's Guide `__ に移動しました。" diff --git a/howto/cporting.po b/howto/cporting.po index 68814796f..aff477f32 100644 --- a/howto/cporting.po +++ b/howto/cporting.po @@ -1,26 +1,25 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# TENMYO Masakazu, 2024 -# tomo, 2024 +# Arihiro TAKASE, 2017 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-30 14:22+0000\n" -"PO-Revision-Date: 2021-06-28 00:52+0000\n" -"Last-Translator: tomo, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 17:44+0000\n" +"Last-Translator: Arihiro TAKASE, 2017\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../howto/cporting.rst:7 @@ -53,8 +52,11 @@ msgstr "" #: ../../howto/cporting.rst:17 msgid "" -":ref:`Recommended third party tools ` offer abstractions over " -"the Python's C API. Extensions generally need to be re-written to use one of " -"them, but the library then handles differences between various Python " -"versions and implementations." +"The `Cython`_ and `CFFI`_ libraries offer abstractions over Python's C API. " +"Extensions generally need to be re-written to use one of them, but the " +"library then handles differences between various Python versions and " +"implementations." msgstr "" +"`Cython`_ と `CFFI`_ のライブラリは Python の C API 抽象化を提案します。拡張" +"はたいてい使用時に書き換えが求められますが、これらのライブラリは Python の" +"バージョンや実装にまたがる違いを処理します。" diff --git a/howto/curses.po b/howto/curses.po index a2517b170..238a7b465 100644 --- a/howto/curses.po +++ b/howto/curses.po @@ -1,26 +1,32 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 +# ttakah , 2017 +# Osamu NAKAMURA, 2017 +# Arihiro TAKASE, 2017 +# Nozomu Kaneko , 2017 +# tomo, 2018 +# 秘湯 , 2018 +# Naoki Nakamura , 2020 # Mikami Akiko, 2021 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-06 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:53+0000\n" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 17:44+0000\n" "Last-Translator: Mikami Akiko, 2021\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../howto/curses.rst:5 @@ -31,7 +37,7 @@ msgstr "Python で Curses プログラミング" msgid "Author" msgstr "著者" -#: ../../howto/curses.rst:9 +#: ../../howto/curses.rst:7 msgid "A.M. Kuchling, Eric S. Raymond" msgstr "A.M. Kuchling, Eric S. Raymond" @@ -39,15 +45,15 @@ msgstr "A.M. Kuchling, Eric S. Raymond" msgid "Release" msgstr "リリース" -#: ../../howto/curses.rst:10 +#: ../../howto/curses.rst:8 msgid "2.04" msgstr "2.04" -#: ../../howto/curses.rst-1 +#: ../../howto/curses.rstNone msgid "Abstract" msgstr "概要" -#: ../../howto/curses.rst:15 +#: ../../howto/curses.rst:13 msgid "" "This document describes how to use the :mod:`curses` extension module to " "control text-mode displays." @@ -55,11 +61,11 @@ msgstr "" "このドキュメントでは :mod:`curses` 拡張モジュールでテキストモードディスプレイ" "を制御する方法について記述します。" -#: ../../howto/curses.rst:20 +#: ../../howto/curses.rst:18 msgid "What is curses?" msgstr "curses ってなに?" -#: ../../howto/curses.rst:22 +#: ../../howto/curses.rst:20 msgid "" "The curses library supplies a terminal-independent screen-painting and " "keyboard-handling facility for text-based terminals; such terminals include " @@ -76,7 +82,7 @@ msgstr "" "御コードをサポートします。端末の種類によって大きく異なる制御コードを使うこと" "があり、しばしば独特の癖があります。" -#: ../../howto/curses.rst:30 +#: ../../howto/curses.rst:28 msgid "" "In a world of graphical displays, one might ask \"why bother\"? It's true " "that character-cell display terminals are an obsolete technology, but there " @@ -92,7 +98,7 @@ msgstr "" "みのUnixです。ほかにも、OSのインストーラや、カーネル設定などのツールで、これ" "らはグラフィカルサポートが利用可能になる前に動作する必要があります。" -#: ../../howto/curses.rst:38 +#: ../../howto/curses.rst:36 msgid "" "The curses library provides fairly basic functionality, providing the " "programmer with an abstraction of a display containing multiple non-" @@ -101,10 +107,19 @@ msgid "" "curses library will figure out what control codes need to be sent to the " "terminal to produce the right output. curses doesn't provide many user-" "interface concepts such as buttons, checkboxes, or dialogs; if you need such " -"features, consider a user interface library such as :pypi:`Urwid`." +"features, consider a user interface library such as `Urwid `_." msgstr "" +"The cursesライブラリは、プログラマーに重複しない複数のテキストウィンドウを含" +"むディスプレイを抽象化した機能を提供します。ウィンドウの内容は複数の方法で変" +"更が可能で、(文字の追加、削除、表示の変更等)cursesライブラリによって正しい" +"出力を得るためのコントロールコードが判断されます。cursesが提供するユーザーイ" +"ンターフェースのコンセプトは限られています。ボタン、チェックボックス、ダイア" +"ログ等は含まれておりません。そのような機能が必要な場合は、`Urwid `_.のようなユーザーインターフェースライブラリーの使用" +"を検討してください。" -#: ../../howto/curses.rst:48 +#: ../../howto/curses.rst:46 msgid "" "The curses library was originally written for BSD Unix; the later System V " "versions of Unix from AT&T added many enhancements and new functions. BSD " @@ -125,28 +140,38 @@ msgstr "" "述べる全ての関数が利用できるはずです。しかし、古いバージョンの curses を持つ" "いくつかのプロプライエタリ Unix は全てには対応していないでしょう。" -#: ../../howto/curses.rst:58 +#: ../../howto/curses.rst:56 msgid "" "The Windows version of Python doesn't include the :mod:`curses` module. A " -"ported version called :pypi:`UniCurses` is available." -msgstr "" - -#: ../../howto/curses.rst:63 +"ported version called `UniCurses `_ is " +"available. You could also try `the Console module `_ written by Fredrik Lundh, which doesn't use the same " +"API as curses but provides cursor-addressable text output and full support " +"for mouse and keyboard input." +msgstr "" +"Windows 版 Python には :mod:`curses` が含まれていません。 `UniCurses " +"`_ という名の移植版が利用可能です。" +"Fredrik Lundh の手による `the Console module `_ も試してみると良いでしょう。これには curses と同じ API を用いて" +"いませんが、カーソル位置指定でのテキスト出力と、マウス、キーボード入力のフル" +"サポートを提供しています。" + +#: ../../howto/curses.rst:66 msgid "The Python curses module" msgstr "Python の curses module" -#: ../../howto/curses.rst:65 +#: ../../howto/curses.rst:68 msgid "" "The Python module is a fairly simple wrapper over the C functions provided " "by curses; if you're already familiar with curses programming in C, it's " "really easy to transfer that knowledge to Python. The biggest difference is " "that the Python interface makes things simpler by merging different C " -"functions such as :c:func:`!addstr`, :c:func:`!mvaddstr`, and :c:func:`!" -"mvwaddstr` into a single :meth:`~curses.window.addstr` method. You'll see " +"functions such as :c:func:`addstr`, :c:func:`mvaddstr`, and :c:func:" +"`mvwaddstr` into a single :meth:`~curses.window.addstr` method. You'll see " "this covered in more detail later." msgstr "" -#: ../../howto/curses.rst:73 +#: ../../howto/curses.rst:76 msgid "" "This HOWTO is an introduction to writing text-mode programs with curses and " "Python. It doesn't attempt to be a complete guide to the curses API; for " @@ -159,38 +184,28 @@ msgstr "" "ページを参照してください。とはいえ、この文章は基本的な考えを提供してくれるで" "しょう。" -#: ../../howto/curses.rst:80 +#: ../../howto/curses.rst:83 msgid "Starting and ending a curses application" msgstr "curses アプリケーションの起動と終了" -#: ../../howto/curses.rst:82 +#: ../../howto/curses.rst:85 msgid "" "Before doing anything, curses must be initialized. This is done by calling " "the :func:`~curses.initscr` function, which will determine the terminal " "type, send any required setup codes to the terminal, and create various " -"internal data structures. If successful, :func:`!initscr` returns a window " +"internal data structures. If successful, :func:`initscr` returns a window " "object representing the entire screen; this is usually called ``stdscr`` " "after the name of the corresponding C variable. ::" msgstr "" -#: ../../howto/curses.rst:90 -msgid "" -"import curses\n" -"stdscr = curses.initscr()" -msgstr "" - -#: ../../howto/curses.rst:93 +#: ../../howto/curses.rst:96 msgid "" "Usually curses applications turn off automatic echoing of keys to the " "screen, in order to be able to read keys and only display them under certain " "circumstances. This requires calling the :func:`~curses.noecho` function. ::" msgstr "" -#: ../../howto/curses.rst:98 -msgid "curses.noecho()" -msgstr "" - -#: ../../howto/curses.rst:100 +#: ../../howto/curses.rst:103 msgid "" "Applications will also commonly need to react to keys instantly, without " "requiring the Enter key to be pressed; this is called cbreak mode, as " @@ -200,11 +215,7 @@ msgstr "" "する必要があります; これは cbreak モードと呼ばれ、通常の入力がバッファされる" "モードと逆に動作します。 ::" -#: ../../howto/curses.rst:104 -msgid "curses.cbreak()" -msgstr "" - -#: ../../howto/curses.rst:106 +#: ../../howto/curses.rst:109 msgid "" "Terminals usually return special keys, such as the cursor keys or navigation " "keys such as Page Up and Home, as a multibyte escape sequence. While you " @@ -219,11 +230,7 @@ msgstr "" "`curses.KEY_LEFT` のような特別な値を返して行ってくれます。 curses にその仕事" "をさせるには、キーパッドモードを有効にする必要があります。 ::" -#: ../../howto/curses.rst:113 -msgid "stdscr.keypad(True)" -msgstr "" - -#: ../../howto/curses.rst:115 +#: ../../howto/curses.rst:118 msgid "" "Terminating a curses application is much easier than starting one. You'll " "need to call::" @@ -231,14 +238,7 @@ msgstr "" "curses アプリケーションを終了させるのは起動よりも簡単です。 以下を呼び出す必" "要があります::" -#: ../../howto/curses.rst:118 -msgid "" -"curses.nocbreak()\n" -"stdscr.keypad(False)\n" -"curses.echo()" -msgstr "" - -#: ../../howto/curses.rst:122 +#: ../../howto/curses.rst:125 msgid "" "to reverse the curses-friendly terminal settings. Then call the :func:" "`~curses.endwin` function to restore the terminal to its original operating " @@ -247,11 +247,7 @@ msgstr "" "cursesに親和性の高い設定をもとに戻します。そして、:func:`~curses.endwin` 関数" "を呼び出し、端末を通常の操作モードに復旧します。 ::" -#: ../../howto/curses.rst:126 -msgid "curses.endwin()" -msgstr "" - -#: ../../howto/curses.rst:128 +#: ../../howto/curses.rst:131 msgid "" "A common problem when debugging a curses application is to get your terminal " "messed up when the application dies without restoring the terminal to its " @@ -265,7 +261,7 @@ msgstr "" "たときによく起きます。タイプしたキーはもはやエコーされません、例えば、シェル" "を使うのが難しくなります。" -#: ../../howto/curses.rst:134 +#: ../../howto/curses.rst:137 msgid "" "In Python you can avoid these complications and make debugging much easier " "by importing the :func:`curses.wrapper` function and using it like this::" @@ -273,31 +269,12 @@ msgstr "" "Pythonでは、これらの複雑さを避けデバッグをより容易にするために、 :func:" "`curses.wrapper` 関数をインポートして、このように使います::" -#: ../../howto/curses.rst:137 -msgid "" -"from curses import wrapper\n" -"\n" -"def main(stdscr):\n" -" # Clear screen\n" -" stdscr.clear()\n" -"\n" -" # This raises ZeroDivisionError when i == 10.\n" -" for i in range(0, 11):\n" -" v = i-10\n" -" stdscr.addstr(i, 0, '10 divided by {} is {}'.format(v, 10/v))\n" -"\n" -" stdscr.refresh()\n" -" stdscr.getkey()\n" -"\n" -"wrapper(main)" -msgstr "" - -#: ../../howto/curses.rst:153 +#: ../../howto/curses.rst:156 msgid "" "The :func:`~curses.wrapper` function takes a callable object and does the " "initializations described above, also initializing colors if color support " -"is present. :func:`!wrapper` then runs your provided callable. Once the " -"callable returns, :func:`!wrapper` will restore the original state of the " +"is present. :func:`wrapper` then runs your provided callable. Once the " +"callable returns, :func:`wrapper` will restore the original state of the " "terminal. The callable is called inside a :keyword:`try`...\\ :keyword:" "`except` that catches exceptions, restores the state of the terminal, and " "then re-raises the exception. Therefore your terminal won't be left in a " @@ -305,18 +282,18 @@ msgid "" "and traceback." msgstr "" -#: ../../howto/curses.rst:165 +#: ../../howto/curses.rst:168 msgid "Windows and Pads" msgstr "ウィンドウとパッド" -#: ../../howto/curses.rst:167 +#: ../../howto/curses.rst:170 msgid "" "Windows are the basic abstraction in curses. A window object represents a " "rectangular area of the screen, and supports methods to display text, erase " "it, allow the user to input strings, and so forth." msgstr "" -#: ../../howto/curses.rst:171 +#: ../../howto/curses.rst:174 msgid "" "The ``stdscr`` object returned by the :func:`~curses.initscr` function is a " "window object that covers the entire screen. Many programs may need only " @@ -326,14 +303,7 @@ msgid "" "window object. ::" msgstr "" -#: ../../howto/curses.rst:178 -msgid "" -"begin_x = 20; begin_y = 7\n" -"height = 5; width = 40\n" -"win = curses.newwin(height, width, begin_y, begin_x)" -msgstr "" - -#: ../../howto/curses.rst:182 +#: ../../howto/curses.rst:185 msgid "" "Note that the coordinate system used in curses is unusual. Coordinates are " "always passed in the order *y,x*, and the top-left corner of a window is " @@ -343,7 +313,7 @@ msgid "" "curses since it was first written, and it's too late to change things now." msgstr "" -#: ../../howto/curses.rst:190 +#: ../../howto/curses.rst:193 msgid "" "Your application can determine the size of the screen by using the :data:" "`curses.LINES` and :data:`curses.COLS` variables to obtain the *y* and *x* " @@ -351,35 +321,35 @@ msgid "" "- 1, curses.COLS - 1)``." msgstr "" -#: ../../howto/curses.rst:195 +#: ../../howto/curses.rst:198 msgid "" "When you call a method to display or erase text, the effect doesn't " "immediately show up on the display. Instead you must call the :meth:" "`~curses.window.refresh` method of window objects to update the screen." msgstr "" -#: ../../howto/curses.rst:200 +#: ../../howto/curses.rst:203 msgid "" "This is because curses was originally written with slow 300-baud terminal " "connections in mind; with these terminals, minimizing the time required to " "redraw the screen was very important. Instead curses accumulates changes to " "the screen and displays them in the most efficient manner when you call :" -"meth:`!refresh`. For example, if your program displays some text in a " -"window and then clears the window, there's no need to send the original text " +"meth:`refresh`. For example, if your program displays some text in a window " +"and then clears the window, there's no need to send the original text " "because they're never visible." msgstr "" -#: ../../howto/curses.rst:209 +#: ../../howto/curses.rst:212 msgid "" "In practice, explicitly telling curses to redraw a window doesn't really " "complicate programming with curses much. Most programs go into a flurry of " "activity, and then pause waiting for a keypress or some other action on the " "part of the user. All you have to do is to be sure that the screen has been " -"redrawn before pausing to wait for user input, by first calling :meth:`!" -"stdscr.refresh` or the :meth:`!refresh` method of some other relevant window." +"redrawn before pausing to wait for user input, by first calling ``stdscr." +"refresh()`` or the :meth:`refresh` method of some other relevant window." msgstr "" -#: ../../howto/curses.rst:217 +#: ../../howto/curses.rst:220 msgid "" "A pad is a special case of a window; it can be larger than the actual " "display screen, and only a portion of the pad displayed at a time. Creating " @@ -388,41 +358,26 @@ msgid "" "will be displayed. ::" msgstr "" -#: ../../howto/curses.rst:223 -msgid "" -"pad = curses.newpad(100, 100)\n" -"# These loops fill the pad with letters; addch() is\n" -"# explained in the next section\n" -"for y in range(0, 99):\n" -" for x in range(0, 99):\n" -" pad.addch(y,x, ord('a') + (x*x+y*y) % 26)\n" -"\n" -"# Displays a section of the pad in the middle of the screen.\n" -"# (0,0) : coordinate of upper-left corner of pad area to display.\n" -"# (5,5) : coordinate of upper-left corner of window area to be filled\n" -"# with pad content.\n" -"# (20, 75) : coordinate of lower-right corner of window area to be\n" -"# : filled with pad content.\n" -"pad.refresh( 0,0, 5,5, 20,75)" -msgstr "" - -#: ../../howto/curses.rst:238 +#: ../../howto/curses.rst:241 msgid "" -"The :meth:`!refresh` call displays a section of the pad in the rectangle " +"The :meth:`refresh` call displays a section of the pad in the rectangle " "extending from coordinate (5,5) to coordinate (20,75) on the screen; the " "upper left corner of the displayed section is coordinate (0,0) on the pad. " "Beyond that difference, pads are exactly like ordinary windows and support " "the same methods." msgstr "" -#: ../../howto/curses.rst:244 +#: ../../howto/curses.rst:247 msgid "" "If you have multiple windows and pads on screen there is a more efficient " "way to update the screen and prevent annoying screen flicker as each part of " -"the screen gets updated. :meth:`!refresh` actually does two things:" +"the screen gets updated. :meth:`refresh` actually does two things:" msgstr "" +"もし、スクリーンに複数のウィンドウやパッドを持っている場合、スクリーンをより" +"効率よく更新し、スクリーンの各部が更新されるたびに起こるいらいらするちらつき" +"を抑える方法があります。 :meth:`refresh` は実際には二つの事を行っています。" -#: ../../howto/curses.rst:249 +#: ../../howto/curses.rst:252 msgid "" "Calls the :meth:`~curses.window.noutrefresh` method of each window to update " "an underlying data structure representing the desired state of the screen." @@ -430,7 +385,7 @@ msgstr "" "それぞれのウィンドウの :meth:`~curses.window.noutrefresh` メソッドを呼び出し" "て、配下にある、スクリーンの望ましい状態を表すデータ構造を更新します。 " -#: ../../howto/curses.rst:252 +#: ../../howto/curses.rst:255 msgid "" "Calls the function :func:`~curses.doupdate` function to change the physical " "screen to match the desired state recorded in the data structure." @@ -438,29 +393,37 @@ msgstr "" ":func:`~curses.doupdate` 関数を呼び出して、データ構造に記録された望ましい状態" "に合致するように、物理スクリーンを更新します。" -#: ../../howto/curses.rst:255 +#: ../../howto/curses.rst:258 msgid "" -"Instead you can call :meth:`!noutrefresh` on a number of windows to update " -"the data structure, and then call :func:`!doupdate` to update the screen." +"Instead you can call :meth:`noutrefresh` on a number of windows to update " +"the data structure, and then call :func:`doupdate` to update the screen." msgstr "" +"かわりに、:meth:`noutrefresh` を呼び出して、いくつかのウィンドウのデータ構造" +"を更新し、その後に :func:`doupdate` を呼び出して、スクリーンを更新できます。" -#: ../../howto/curses.rst:261 +#: ../../howto/curses.rst:264 msgid "Displaying Text" msgstr "テキストの表示" -#: ../../howto/curses.rst:263 +#: ../../howto/curses.rst:266 msgid "" "From a C programmer's point of view, curses may sometimes look like a twisty " -"maze of functions, all subtly different. For example, :c:func:`!addstr` " +"maze of functions, all subtly different. For example, :c:func:`addstr` " "displays a string at the current cursor location in the ``stdscr`` window, " -"while :c:func:`!mvaddstr` moves to a given y,x coordinate first before " -"displaying the string. :c:func:`!waddstr` is just like :c:func:`!addstr`, " -"but allows specifying a window to use instead of using ``stdscr`` by " -"default. :c:func:`!mvwaddstr` allows specifying both a window and a " -"coordinate." +"while :c:func:`mvaddstr` moves to a given y,x coordinate first before " +"displaying the string. :c:func:`waddstr` is just like :c:func:`addstr`, but " +"allows specifying a window to use instead of using ``stdscr`` by default. :c:" +"func:`mvwaddstr` allows specifying both a window and a coordinate." msgstr "" +"C 言語のプログラマの視点からすると、curses はしばしば、混乱を招きやすい、微妙" +"に似た関数を持っています。例えば :c:func:`addstr` は ``stdscr`` ウィンドウの" +"現在のカーソル位置の文字列を表示し、一方で :c:func:`mvaddstr` は与えられた y," +"x 座標にまず移動して、文字列を表示します。 :c:func:`waddstr` はほとんど :c:" +"func:`addstr` に似ていますが、デフォルトの ``stdscr`` を使う代わりに使うウィ" +"ンドウを指定できます。 :c:func:`mvwaddstr` はウィンドウと座標の両方を指定でき" +"ます。" -#: ../../howto/curses.rst:272 +#: ../../howto/curses.rst:275 msgid "" "Fortunately the Python interface hides all these details. ``stdscr`` is a " "window object like any other, and methods such as :meth:`~curses.window." @@ -472,46 +435,46 @@ msgstr "" "window.addstr` のようなメソッドは複数の引数形式を許容してくれます。通常それら" "は4つの形式です。" -#: ../../howto/curses.rst:278 +#: ../../howto/curses.rst:281 msgid "Form" msgstr "形式" -#: ../../howto/curses.rst:278 ../../howto/curses.rst:346 +#: ../../howto/curses.rst:281 ../../howto/curses.rst:350 msgid "Description" msgstr "説明" -#: ../../howto/curses.rst:280 +#: ../../howto/curses.rst:283 msgid "*str* or *ch*" msgstr "*str* または *ch*" -#: ../../howto/curses.rst:280 +#: ../../howto/curses.rst:283 msgid "Display the string *str* or character *ch* at the current position" msgstr "文字列 *str* または文字 *ch* を現在位置に表示します" -#: ../../howto/curses.rst:283 +#: ../../howto/curses.rst:286 msgid "*str* or *ch*, *attr*" msgstr "*str* または *ch*, *attr*" -#: ../../howto/curses.rst:283 +#: ../../howto/curses.rst:286 msgid "" "Display the string *str* or character *ch*, using attribute *attr* at the " "current position" msgstr "" "文字列 *str* または文字 *ch* を属性 *attr* を利用して現在位置に表示します" -#: ../../howto/curses.rst:287 +#: ../../howto/curses.rst:290 msgid "*y*, *x*, *str* or *ch*" msgstr "*y*, *x*, *str* または *ch*" -#: ../../howto/curses.rst:287 +#: ../../howto/curses.rst:290 msgid "Move to position *y,x* within the window, and display *str* or *ch*" msgstr "ウィンドウ内の位置 *y,x* に移動し *str* または *ch* を表示します" -#: ../../howto/curses.rst:290 +#: ../../howto/curses.rst:293 msgid "*y*, *x*, *str* or *ch*, *attr*" msgstr "*y*, *x*, *str* または *ch*, *attr*" -#: ../../howto/curses.rst:290 +#: ../../howto/curses.rst:293 msgid "" "Move to position *y,x* within the window, and display *str* or *ch*, using " "attribute *attr*" @@ -519,7 +482,7 @@ msgstr "" "ウィンドウ内の位置 *y,x* に移動し属性 *attr* を利用して *str* または *ch* を" "表示します" -#: ../../howto/curses.rst:294 +#: ../../howto/curses.rst:297 msgid "" "Attributes allow displaying text in highlighted forms such as boldface, " "underline, reverse code, or in color. They'll be explained in more detail " @@ -528,22 +491,22 @@ msgstr "" "属性によって表示するテキストをハイライトすることができます、ボールド体、アン" "ダーライン、反転、カラーなど。より詳しくは次の小節で説明します。" -#: ../../howto/curses.rst:299 +#: ../../howto/curses.rst:302 msgid "" "The :meth:`~curses.window.addstr` method takes a Python string or bytestring " "as the value to be displayed. The contents of bytestrings are sent to the " "terminal as-is. Strings are encoded to bytes using the value of the " -"window's :attr:`~window.encoding` attribute; this defaults to the default " -"system encoding as returned by :func:`locale.getencoding`." +"window's :attr:`encoding` attribute; this defaults to the default system " +"encoding as returned by :func:`locale.getpreferredencoding`." msgstr "" -#: ../../howto/curses.rst:305 +#: ../../howto/curses.rst:309 msgid "" "The :meth:`~curses.window.addch` methods take a character, which can be " "either a string of length 1, a bytestring of length 1, or an integer." msgstr "" -#: ../../howto/curses.rst:308 +#: ../../howto/curses.rst:312 msgid "" "Constants are provided for extension characters; these constants are " "integers greater than 255. For example, :const:`ACS_PLMINUS` is a +/- " @@ -551,7 +514,7 @@ msgid "" "for drawing borders). You can also use the appropriate Unicode character." msgstr "" -#: ../../howto/curses.rst:314 +#: ../../howto/curses.rst:318 msgid "" "Windows remember where the cursor was left after the last operation, so if " "you leave out the *y,x* coordinates, the string or character will be " @@ -568,7 +531,7 @@ msgstr "" "うにしたいと思うかもしれません; ランダムに見える位置でカーソルが点滅すると面" "を食らってしまいます。" -#: ../../howto/curses.rst:322 +#: ../../howto/curses.rst:326 msgid "" "If your application doesn't need a blinking cursor at all, you can call " "``curs_set(False)`` to make it invisible. For compatibility with older " @@ -578,11 +541,11 @@ msgid "" "leaving it in odd locations." msgstr "" -#: ../../howto/curses.rst:331 +#: ../../howto/curses.rst:335 msgid "Attributes and Color" msgstr "属性とカラー" -#: ../../howto/curses.rst:333 +#: ../../howto/curses.rst:337 msgid "" "Characters can be displayed in different ways. Status lines in a text-based " "application are commonly shown in reverse video, or a text viewer may need " @@ -590,7 +553,7 @@ msgid "" "an attribute for each cell on the screen." msgstr "" -#: ../../howto/curses.rst:338 +#: ../../howto/curses.rst:342 msgid "" "An attribute is an integer, each bit representing a different attribute. " "You can try to display text with multiple attribute bits set, but curses " @@ -605,59 +568,59 @@ msgstr "" "用している端末の能力に依存しているため、最も安全なのは、最も一般的に利用可能" "な属性を設定する方法です、ここに列挙します。" -#: ../../howto/curses.rst:346 +#: ../../howto/curses.rst:350 msgid "Attribute" msgstr "属性" -#: ../../howto/curses.rst:348 +#: ../../howto/curses.rst:352 msgid ":const:`A_BLINK`" msgstr ":const:`A_BLINK`" -#: ../../howto/curses.rst:348 +#: ../../howto/curses.rst:352 msgid "Blinking text" msgstr "テキストを点滅" -#: ../../howto/curses.rst:350 +#: ../../howto/curses.rst:354 msgid ":const:`A_BOLD`" msgstr ":const:`A_BOLD`" -#: ../../howto/curses.rst:350 +#: ../../howto/curses.rst:354 msgid "Extra bright or bold text" msgstr "高輝度またはボールドテキスト" -#: ../../howto/curses.rst:352 +#: ../../howto/curses.rst:356 msgid ":const:`A_DIM`" msgstr ":const:`A_DIM`" -#: ../../howto/curses.rst:352 +#: ../../howto/curses.rst:356 msgid "Half bright text" msgstr "低輝度テキスト" -#: ../../howto/curses.rst:354 +#: ../../howto/curses.rst:358 msgid ":const:`A_REVERSE`" msgstr ":const:`A_REVERSE`" -#: ../../howto/curses.rst:354 +#: ../../howto/curses.rst:358 msgid "Reverse-video text" msgstr "反転テキスト" -#: ../../howto/curses.rst:356 +#: ../../howto/curses.rst:360 msgid ":const:`A_STANDOUT`" msgstr ":const:`A_STANDOUT`" -#: ../../howto/curses.rst:356 +#: ../../howto/curses.rst:360 msgid "The best highlighting mode available" msgstr "利用できる最良のハイライトモード" -#: ../../howto/curses.rst:358 +#: ../../howto/curses.rst:362 msgid ":const:`A_UNDERLINE`" msgstr ":const:`A_UNDERLINE`" -#: ../../howto/curses.rst:358 +#: ../../howto/curses.rst:362 msgid "Underlined text" msgstr "下線付きテキスト" -#: ../../howto/curses.rst:361 +#: ../../howto/curses.rst:365 msgid "" "So, to display a reverse-video status line on the top line of the screen, " "you could code::" @@ -665,14 +628,7 @@ msgstr "" "つまり、反転するステータスラインを画面の最上部に表示するには、コードをこうし" "ます::" -#: ../../howto/curses.rst:364 -msgid "" -"stdscr.addstr(0, 0, \"Current mode: Typing mode\",\n" -" curses.A_REVERSE)\n" -"stdscr.refresh()" -msgstr "" - -#: ../../howto/curses.rst:368 +#: ../../howto/curses.rst:372 msgid "" "The curses library also supports color on those terminals that provide it. " "The most common such terminal is probably the Linux console, followed by " @@ -682,7 +638,7 @@ msgstr "" "す。そんな端末の中で最も一般的なものは Linux コンソールで、color xterm もそれ" "に続きます。" -#: ../../howto/curses.rst:372 +#: ../../howto/curses.rst:376 msgid "" "To use color, you must call the :func:`~curses.start_color` function soon " "after calling :func:`~curses.initscr`, to initialize the default color set " @@ -694,7 +650,7 @@ msgid "" "for the sake of these functions.)" msgstr "" -#: ../../howto/curses.rst:382 +#: ../../howto/curses.rst:386 msgid "" "The curses library maintains a finite number of color pairs, containing a " "foreground (or text) color and a background color. You can get the " @@ -704,17 +660,11 @@ msgid "" "work on all terminals." msgstr "" -#: ../../howto/curses.rst:389 +#: ../../howto/curses.rst:393 msgid "An example, which displays a line of text using color pair 1::" msgstr "例として、テキスト行をカラーペア 1 を使って表示します::" -#: ../../howto/curses.rst:391 -msgid "" -"stdscr.addstr(\"Pretty text\", curses.color_pair(1))\n" -"stdscr.refresh()" -msgstr "" - -#: ../../howto/curses.rst:394 +#: ../../howto/curses.rst:398 msgid "" "As I said before, a color pair consists of a foreground and background " "color. The ``init_pair(n, f, b)`` function changes the definition of color " @@ -722,7 +672,7 @@ msgid "" "hard-wired to white on black, and cannot be changed." msgstr "" -#: ../../howto/curses.rst:399 +#: ../../howto/curses.rst:403 msgid "" "Colors are numbered, and :func:`start_color` initializes 8 basic colors when " "it activates color mode. They are: 0:black, 1:red, 2:green, 3:yellow, 4:" @@ -731,7 +681,7 @@ msgid "" "const:`curses.COLOR_RED`, and so forth." msgstr "" -#: ../../howto/curses.rst:405 +#: ../../howto/curses.rst:409 msgid "" "Let's put all this together. To change color 1 to red text on a white " "background, you would call::" @@ -739,11 +689,7 @@ msgstr "" "やってみましょう。カラー 1 を白背景に赤に変更してみましょう、こうして呼び出し" "ます::" -#: ../../howto/curses.rst:408 -msgid "curses.init_pair(1, curses.COLOR_RED, curses.COLOR_WHITE)" -msgstr "" - -#: ../../howto/curses.rst:410 +#: ../../howto/curses.rst:414 msgid "" "When you change a color pair, any text already displayed using that color " "pair will change to the new colors. You can also display new text in this " @@ -752,11 +698,7 @@ msgstr "" "カラーペアを変更するときには、既に表示された任意のテキストが利用するカラーペ" "アを新しい色に変更します。新しいテキストをこの色で使うこともできます::" -#: ../../howto/curses.rst:414 -msgid "stdscr.addstr(0,0, \"RED ALERT!\", curses.color_pair(1))" -msgstr "" - -#: ../../howto/curses.rst:416 +#: ../../howto/curses.rst:420 msgid "" "Very fancy terminals can change the definitions of the actual colors to a " "given RGB value. This lets you change color 1, which is usually red, to " @@ -768,22 +710,23 @@ msgid "" "your system's man pages for more information." msgstr "" -#: ../../howto/curses.rst:427 +#: ../../howto/curses.rst:431 msgid "User Input" msgstr "ユーザ入力" -#: ../../howto/curses.rst:429 +#: ../../howto/curses.rst:433 msgid "" "The C curses library offers only very simple input mechanisms. Python's :mod:" -"`curses` module adds a basic text-input widget. (Other libraries such as :" -"pypi:`Urwid` have more extensive collections of widgets.)" +"`curses` module adds a basic text-input widget. (Other libraries such as " +"`Urwid `_ have more extensive collections " +"of widgets.)" msgstr "" -#: ../../howto/curses.rst:433 +#: ../../howto/curses.rst:438 msgid "There are two methods for getting input from a window:" msgstr "ウィンドウから入力を得るための2つのメソッドがあります。" -#: ../../howto/curses.rst:435 +#: ../../howto/curses.rst:440 msgid "" ":meth:`~curses.window.getch` refreshes the screen and then waits for the " "user to hit a key, displaying the key if :func:`~curses.echo` has been " @@ -791,7 +734,7 @@ msgid "" "should be moved before pausing." msgstr "" -#: ../../howto/curses.rst:440 +#: ../../howto/curses.rst:445 msgid "" ":meth:`~curses.window.getkey` does the same thing but converts the integer " "to a string. Individual characters are returned as 1-character strings, and " @@ -799,21 +742,21 @@ msgid "" "name such as ``KEY_UP`` or ``^G``." msgstr "" -#: ../../howto/curses.rst:445 +#: ../../howto/curses.rst:450 msgid "" "It's possible to not wait for the user using the :meth:`~curses.window." -"nodelay` window method. After ``nodelay(True)``, :meth:`!getch` and :meth:`!" -"getkey` for the window become non-blocking. To signal that no input is " -"ready, :meth:`!getch` returns ``curses.ERR`` (a value of -1) and :meth:`!" -"getkey` raises an exception. There's also a :func:`~curses.halfdelay` " -"function, which can be used to (in effect) set a timer on each :meth:`!" -"getch`; if no input becomes available within a specified delay (measured in " +"nodelay` window method. After ``nodelay(True)``, :meth:`getch` and :meth:" +"`getkey` for the window become non-blocking. To signal that no input is " +"ready, :meth:`getch` returns ``curses.ERR`` (a value of -1) and :meth:" +"`getkey` raises an exception. There's also a :func:`~curses.halfdelay` " +"function, which can be used to (in effect) set a timer on each :meth:" +"`getch`; if no input becomes available within a specified delay (measured in " "tenths of a second), curses raises an exception." msgstr "" -#: ../../howto/curses.rst:455 +#: ../../howto/curses.rst:460 msgid "" -"The :meth:`!getch` method returns an integer; if it's between 0 and 255, it " +"The :meth:`getch` method returns an integer; if it's between 0 and 255, it " "represents the ASCII code of the key pressed. Values greater than 255 are " "special keys such as Page Up, Home, or the cursor keys. You can compare the " "value returned to constants such as :const:`curses.KEY_PPAGE`, :const:" @@ -821,19 +764,7 @@ msgid "" "program may look something like this::" msgstr "" -#: ../../howto/curses.rst:462 -msgid "" -"while True:\n" -" c = stdscr.getch()\n" -" if c == ord('p'):\n" -" PrintDocument()\n" -" elif c == ord('q'):\n" -" break # Exit the while loop\n" -" elif c == curses.KEY_HOME:\n" -" x = y = 0" -msgstr "" - -#: ../../howto/curses.rst:471 +#: ../../howto/curses.rst:476 msgid "" "The :mod:`curses.ascii` module supplies ASCII class membership functions " "that take either integer or 1-character string arguments; these may be " @@ -843,7 +774,7 @@ msgid "" "returns the control character corresponding to its argument." msgstr "" -#: ../../howto/curses.rst:478 +#: ../../howto/curses.rst:483 msgid "" "There's also a method to retrieve an entire string, :meth:`~curses.window." "getstr`. It isn't used very often, because its functionality is quite " @@ -852,15 +783,7 @@ msgid "" "number of characters. ::" msgstr "" -#: ../../howto/curses.rst:484 -msgid "" -"curses.echo() # Enable echoing of characters\n" -"\n" -"# Get a 15-character string, with the cursor on the top line\n" -"s = stdscr.getstr(0,0, 15)" -msgstr "" - -#: ../../howto/curses.rst:489 +#: ../../howto/curses.rst:494 msgid "" "The :mod:`curses.textpad` module supplies a text box that supports an Emacs-" "like set of keybindings. Various methods of the :class:`~curses.textpad." @@ -868,39 +791,18 @@ msgid "" "results either with or without trailing spaces. Here's an example::" msgstr "" -#: ../../howto/curses.rst:495 -msgid "" -"import curses\n" -"from curses.textpad import Textbox, rectangle\n" -"\n" -"def main(stdscr):\n" -" stdscr.addstr(0, 0, \"Enter IM message: (hit Ctrl-G to send)\")\n" -"\n" -" editwin = curses.newwin(5,30, 2,1)\n" -" rectangle(stdscr, 1,0, 1+5+1, 1+30+1)\n" -" stdscr.refresh()\n" -"\n" -" box = Textbox(editwin)\n" -"\n" -" # Let the user edit until Ctrl-G is struck.\n" -" box.edit()\n" -"\n" -" # Get resulting contents\n" -" message = box.gather()" -msgstr "" - -#: ../../howto/curses.rst:513 +#: ../../howto/curses.rst:518 msgid "" "See the library documentation on :mod:`curses.textpad` for more details." msgstr "" "さらなる詳細についてはライブラリのドキュメント :mod:`curses.textpad` を参照" "してください。" -#: ../../howto/curses.rst:517 +#: ../../howto/curses.rst:522 msgid "For More Information" msgstr "より多くの情報" -#: ../../howto/curses.rst:519 +#: ../../howto/curses.rst:524 msgid "" "This HOWTO doesn't cover some advanced topics, such as reading the contents " "of the screen or capturing mouse events from an xterm instance, but the " @@ -912,16 +814,21 @@ msgstr "" "Python の :mod:`curses` モジュールのライブラリページはいまやかなり充実してい" "ます。次はこれを見るべきです。" -#: ../../howto/curses.rst:524 +#: ../../howto/curses.rst:529 msgid "" "If you're in doubt about the detailed behavior of the curses functions, " "consult the manual pages for your curses implementation, whether it's " "ncurses or a proprietary Unix vendor's. The manual pages will document any " "quirks, and provide complete lists of all the functions, attributes, and :" -"ref:`ACS_\\* ` characters available to you." +"const:`ACS_\\*` characters available to you." msgstr "" +"curses 関数の詳細な振る舞いで不審に思ったら、それが ncurses であろうがプロプ" +"ライエタリな Unix ベンダーのものであろうが、curses 実装のマニュアルページを調" +"べてください。マニュアルページには、どんな気紛れ血の迷いでもドキュメントさ" +"れ、関数、属性、 :const:`ACS_\\*` 文字の完全なリストが提供されていることで" +"しょう。" -#: ../../howto/curses.rst:531 +#: ../../howto/curses.rst:536 msgid "" "Because the curses API is so large, some functions aren't supported in the " "Python interface. Often this isn't because they're difficult to implement, " @@ -931,22 +838,25 @@ msgid "" "org/>`_ to learn more about submitting patches to Python." msgstr "" -#: ../../howto/curses.rst:539 +#: ../../howto/curses.rst:544 msgid "" -"`Writing Programs with NCURSES `_: a lengthy tutorial for C programmers." msgstr "" +"`Writing Programs with NCURSES `_: C プログラマ向けの非常に長いチュートリアルです。" -#: ../../howto/curses.rst:541 +#: ../../howto/curses.rst:546 msgid "`The ncurses man page `_" msgstr "`The ncurses man page `_" -#: ../../howto/curses.rst:542 +#: ../../howto/curses.rst:547 msgid "" -"`The ncurses FAQ `_" +"`The ncurses FAQ `_" msgstr "" +"`The ncurses FAQ `_" -#: ../../howto/curses.rst:543 +#: ../../howto/curses.rst:548 msgid "" "`\"Use curses... don't swear\" `_: video of a PyCon 2013 talk on controlling terminals using " @@ -956,9 +866,12 @@ msgstr "" "v=eN1eZtjLEnU>`_: curses または Urwid を使って端末を制御する PyCon 2013 講演" "ビデオです。" -#: ../../howto/curses.rst:545 +#: ../../howto/curses.rst:550 msgid "" -"`\"Console Applications with Urwid\" `_: video of a PyCon CA 2012 talk demonstrating some " -"applications written using Urwid." +"`\"Console Applications with Urwid\" `_: video of a PyCon CA 2012 talk " +"demonstrating some applications written using Urwid." msgstr "" +"`\"Console Applications with Urwid\" `_: Urwid で書かれたいくつかのアプリケーショ" +"ンをデモンストレーションしている PyCon CA 2012 講演ビデオです。" diff --git a/howto/descriptor.po b/howto/descriptor.po index 8c97c279b..67a08e696 100644 --- a/howto/descriptor.po +++ b/howto/descriptor.po @@ -1,35 +1,35 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 -# mollinaca, 2021 -# 渋川よしき , 2021 -# souma987, 2023 -# TENMYO Masakazu, 2024 -# Arihiro TAKASE, 2024 +# E. Kawashima, 2017 +# 秘湯 , 2017 +# Nozomu Kaneko , 2017 +# Arihiro TAKASE, 2018 +# tomo, 2019 +# mollinaca, 2020 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:53+0000\n" -"Last-Translator: Arihiro TAKASE, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-04-23 06:07+0000\n" +"PO-Revision-Date: 2017-02-16 17:44+0000\n" +"Last-Translator: mollinaca, 2020\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../howto/descriptor.rst:5 -msgid "Descriptor Guide" -msgstr "デスクリプタ ガイド" +msgid "Descriptor HowTo Guide" +msgstr "デスクリプタ HowTo ガイド" #: ../../howto/descriptor.rst:0 msgid "Author" @@ -99,9 +99,8 @@ msgid "" msgstr "" "最後のセクションは、Cで書かれた組み込みのデスクリプタをピュアPythonで実現する" "方法を紹介します。このセクションがどのように関数が束縛メソッドになるのか、 :" -"func:`classmethod` や :func:`staticmethod`, :func:`property`, :term:" -"`__slots__` といった一般的なツールの実装がどのようになっているのか興味を持っ" -"たら読んでください。" +"func:`classmethod` や :func:`staticmethod`, :term:`__slots__` といった一般的" +"なツールの実装がどのようになっているのか興味を持ったら読んでください。" #: ../../howto/descriptor.rst:36 msgid "Primer" @@ -121,15 +120,8 @@ msgstr "シンプルな例: 定数を返すデスクリプタ" #: ../../howto/descriptor.rst:45 msgid "" -"The :class:`!Ten` class is a descriptor whose :meth:`~object.__get__` method " -"always returns the constant ``10``:" -msgstr "" - -#: ../../howto/descriptor.rst:48 -msgid "" -"class Ten:\n" -" def __get__(self, obj, objtype=None):\n" -" return 10" +"The :class:`Ten` class is a descriptor that always returns the constant " +"``10`` from its :meth:`__get__` method:" msgstr "" #: ../../howto/descriptor.rst:54 @@ -138,13 +130,6 @@ msgid "" "class:" msgstr "このデスクリプタを使うには他のクラスのクラス変数として保存します:" -#: ../../howto/descriptor.rst:56 -msgid "" -"class A:\n" -" x = 5 # Regular class attribute\n" -" y = Ten() # Descriptor instance" -msgstr "" - #: ../../howto/descriptor.rst:62 msgid "" "An interactive session shows the difference between normal attribute lookup " @@ -153,26 +138,13 @@ msgstr "" "インタラクティブセッションを使って、通常の属性ルックアップと、デスクリプタの" "ルックアップの違いを見てみましょう。" -#: ../../howto/descriptor.rst:65 -msgid "" -">>> a = A() # Make an instance of class A\n" -">>> a.x # Normal attribute lookup\n" -"5\n" -">>> a.y # Descriptor lookup\n" -"10" -msgstr "" - #: ../../howto/descriptor.rst:73 msgid "" -"In the ``a.x`` attribute lookup, the dot operator finds ``'x': 5`` in the " -"class dictionary. In the ``a.y`` lookup, the dot operator finds a " -"descriptor instance, recognized by its ``__get__`` method. Calling that " -"method returns ``10``." +"In the ``a.x`` attribute lookup, the dot operator finds the key ``x`` and " +"the value ``5`` in the class dictionary. In the ``a.y`` lookup, the dot " +"operator finds a descriptor instance, recognized by its ``__get__`` method, " +"and calls that method which returns ``10``." msgstr "" -"``a.x`` 属性ルックアップではドット演算子がクラス辞書の中から ``'x': 5`` を見" -"つけます。 ``a.y`` ルックアップではドット演算子は ``__get__`` メソッドを持つ" -"デスクリプタインスタンスを取得します。そのメソッドを呼び出すと、 ``10`` を返" -"します。" #: ../../howto/descriptor.rst:78 msgid "" @@ -207,23 +179,6 @@ msgid "" msgstr "" "単に定数を返すよりも、なにか処理を実行するデスクリプタの方が面白いでしょう。" -#: ../../howto/descriptor.rst:93 -msgid "" -"import os\n" -"\n" -"class DirectorySize:\n" -"\n" -" def __get__(self, obj, objtype=None):\n" -" return len(os.listdir(obj.dirname))\n" -"\n" -"class Directory:\n" -"\n" -" size = DirectorySize() # Descriptor instance\n" -"\n" -" def __init__(self, dirname):\n" -" self.dirname = dirname # Regular instance attribute" -msgstr "" - #: ../../howto/descriptor.rst:109 msgid "" "An interactive session shows that the lookup is dynamic — it computes " @@ -232,31 +187,20 @@ msgstr "" "インタラクティブセッションで見たように、この探索は動的です。実行ごとに異なる" "計算を行い、毎回答えが更新されます。" -#: ../../howto/descriptor.rst:112 -msgid "" -">>> s = Directory('songs')\n" -">>> g = Directory('games')\n" -">>> s.size # The songs directory has twenty " -"files\n" -"20\n" -">>> g.size # The games directory has three " -"files\n" -"3\n" -">>> os.remove('games/chess') # Delete a game\n" -">>> g.size # File count is automatically " -"updated\n" -"2" -msgstr "" - #: ../../howto/descriptor.rst:122 msgid "" "Besides showing how descriptors can run computations, this example also " -"reveals the purpose of the parameters to :meth:`~object.__get__`. The " -"*self* parameter is *size*, an instance of *DirectorySize*. The *obj* " -"parameter is either *g* or *s*, an instance of *Directory*. It is the *obj* " -"parameter that lets the :meth:`~object.__get__` method learn the target " -"directory. The *objtype* parameter is the class *Directory*." -msgstr "" +"reveals the purpose of the parameters to :meth:`__get__`. The *self* " +"parameter is *size*, an instance of *DirectorySize*. The *obj* parameter is " +"either *g* or *s*, an instance of *Directory*. It is the *obj* parameter " +"that lets the :meth:`__get__` method learn the target directory. The " +"*objtype* parameter is the class *Directory*." +msgstr "" +"このサンプルはデスクリプタの中でどのように処理を行うかだけではなく、 :meth:" +"`__get__` の引数の目的も示しています。 *self* パラメータは *size* で、 " +"*DirectorySize* のインスタンスです。 *obj* パラメータは *g* や *s* といった " +"*Directory* のインスタンスです。 *obj* により、 :meth:`__get__` はターゲット" +"のディレクトリを知れます。 *objtype* パラメータは *Directory* クラスです。" #: ../../howto/descriptor.rst:131 msgid "Managed attributes" @@ -267,9 +211,14 @@ msgid "" "A popular use for descriptors is managing access to instance data. The " "descriptor is assigned to a public attribute in the class dictionary while " "the actual data is stored as a private attribute in the instance " -"dictionary. The descriptor's :meth:`~object.__get__` and :meth:`~object." -"__set__` methods are triggered when the public attribute is accessed." +"dictionary. The descriptor's :meth:`__get__` and :meth:`__set__` methods " +"are triggered when the public attribute is accessed." msgstr "" +"デスクリプタで広く使われる用途がインスタンスのデータへのアクセスの管理です。" +"このデスクリプタはクラス辞書のパブリックな属性に割り当てられますが、実際の" +"データはインスタンス辞書のプライベートな属性に保存します。パブリックなアクセ" +"スが行われると、デスクリプタの :meth:`__get__` と :meth:`__set__` メソッドが" +"実行されます。" #: ../../howto/descriptor.rst:139 msgid "" @@ -281,35 +230,6 @@ msgstr "" "す。パブリックな属性がアクセスされると、デスクリプタはルックアップや更新のロ" "グ出力をします。" -#: ../../howto/descriptor.rst:143 -msgid "" -"import logging\n" -"\n" -"logging.basicConfig(level=logging.INFO)\n" -"\n" -"class LoggedAgeAccess:\n" -"\n" -" def __get__(self, obj, objtype=None):\n" -" value = obj._age\n" -" logging.info('Accessing %r giving %r', 'age', value)\n" -" return value\n" -"\n" -" def __set__(self, obj, value):\n" -" logging.info('Updating %r to %r', 'age', value)\n" -" obj._age = value\n" -"\n" -"class Person:\n" -"\n" -" age = LoggedAgeAccess() # Descriptor instance\n" -"\n" -" def __init__(self, name, age):\n" -" self.name = name # Regular instance attribute\n" -" self.age = age # Calls __set__()\n" -"\n" -" def birthday(self):\n" -" self.age += 1 # Calls both __get__() and __set__()" -msgstr "" - #: ../../howto/descriptor.rst:172 msgid "" "An interactive session shows that all access to the managed attribute *age* " @@ -318,36 +238,6 @@ msgstr "" "インタラクティブセッションの結果で見てわかるように、管理された属性の *age* の" "ログ出力が行われますが、通常の属性の *name* はログ出力されません。" -#: ../../howto/descriptor.rst:181 -msgid "" -">>> mary = Person('Mary M', 30) # The initial age update is logged\n" -"INFO:root:Updating 'age' to 30\n" -">>> dave = Person('David D', 40)\n" -"INFO:root:Updating 'age' to 40\n" -"\n" -">>> vars(mary) # The actual data is in a private " -"attribute\n" -"{'name': 'Mary M', '_age': 30}\n" -">>> vars(dave)\n" -"{'name': 'David D', '_age': 40}\n" -"\n" -">>> mary.age # Access the data and log the " -"lookup\n" -"INFO:root:Accessing 'age' giving 30\n" -"30\n" -">>> mary.birthday() # Updates are logged as well\n" -"INFO:root:Accessing 'age' giving 30\n" -"INFO:root:Updating 'age' to 31\n" -"\n" -">>> dave.name # Regular attribute lookup isn't " -"logged\n" -"'David D'\n" -">>> dave.age # Only the managed attribute is " -"logged\n" -"INFO:root:Accessing 'age' giving 40\n" -"40" -msgstr "" - #: ../../howto/descriptor.rst:206 msgid "" "One major issue with this example is that the private name *_age* is " @@ -374,116 +264,67 @@ msgstr "" #: ../../howto/descriptor.rst:218 msgid "" -"In this example, the :class:`!Person` class has two descriptor instances, " -"*name* and *age*. When the :class:`!Person` class is defined, it makes a " -"callback to :meth:`~object.__set_name__` in *LoggedAccess* so that the field " -"names can be recorded, giving each descriptor its own *public_name* and " +"In this example, the :class:`Person` class has two descriptor instances, " +"*name* and *age*. When the :class:`Person` class is defined, it makes a " +"callback to :meth:`__set_name__` in *LoggedAccess* so that the field names " +"can be recorded, giving each descriptor its own *public_name* and " "*private_name*:" msgstr "" - -#: ../../howto/descriptor.rst:223 -msgid "" -"import logging\n" -"\n" -"logging.basicConfig(level=logging.INFO)\n" -"\n" -"class LoggedAccess:\n" -"\n" -" def __set_name__(self, owner, name):\n" -" self.public_name = name\n" -" self.private_name = '_' + name\n" -"\n" -" def __get__(self, obj, objtype=None):\n" -" value = getattr(obj, self.private_name)\n" -" logging.info('Accessing %r giving %r', self.public_name, value)\n" -" return value\n" -"\n" -" def __set__(self, obj, value):\n" -" logging.info('Updating %r to %r', self.public_name, value)\n" -" setattr(obj, self.private_name, value)\n" -"\n" -"class Person:\n" -"\n" -" name = LoggedAccess() # First descriptor instance\n" -" age = LoggedAccess() # Second descriptor instance\n" -"\n" -" def __init__(self, name, age):\n" -" self.name = name # Calls the first descriptor\n" -" self.age = age # Calls the second descriptor\n" -"\n" -" def birthday(self):\n" -" self.age += 1" -msgstr "" +"このサンプルでは :class:`Person` クラスは、 *name* と *age* という2つのデスク" +"リプタインスタンスを持っています。 :class:`Person` が定義されると、 " +"*LoggedAccess* の :meth:`__set_name__` にコールバックを行うため、フィールド名" +"を記録できます。それぞれのデスクリプタは、 *public_name* と *private_name* を" +"持ちます。" #: ../../howto/descriptor.rst:256 msgid "" -"An interactive session shows that the :class:`!Person` class has called :" -"meth:`~object.__set_name__` so that the field names would be recorded. Here " -"we call :func:`vars` to look up the descriptor without triggering it:" -msgstr "" - -#: ../../howto/descriptor.rst:260 -msgid "" -">>> vars(vars(Person)['name'])\n" -"{'public_name': 'name', 'private_name': '_name'}\n" -">>> vars(vars(Person)['age'])\n" -"{'public_name': 'age', 'private_name': '_age'}" +"An interactive session shows that the :class:`Person` class has called :meth:" +"`__set_name__` so that the field names would be recorded. Here we call :" +"func:`vars` to look up the descriptor without triggering it:" msgstr "" +"インタラクティブセッション上で試すと、 :class:`Person` クラスが :meth:" +"`__set_name__` を呼び出し、フィールド名が記録されることが分かるでしょう。 :" +"func:`vars` を呼んで、デスクリプタを起動しないでデスクリプタを取得してみま" +"しょう。" #: ../../howto/descriptor.rst:267 msgid "The new class now logs access to both *name* and *age*:" msgstr "新しいクラスは *name* と *age* の両方でログを出力します。" -#: ../../howto/descriptor.rst:275 -msgid "" -">>> pete = Person('Peter P', 10)\n" -"INFO:root:Updating 'name' to 'Peter P'\n" -"INFO:root:Updating 'age' to 10\n" -">>> kate = Person('Catherine C', 20)\n" -"INFO:root:Updating 'name' to 'Catherine C'\n" -"INFO:root:Updating 'age' to 20" -msgstr "" - #: ../../howto/descriptor.rst:284 msgid "The two *Person* instances contain only the private names:" msgstr "2つの *Person* のインスタンスは、プライベート名しか保持していません。" -#: ../../howto/descriptor.rst:286 -msgid "" -">>> vars(pete)\n" -"{'_name': 'Peter P', '_age': 10}\n" -">>> vars(kate)\n" -"{'_name': 'Catherine C', '_age': 20}" -msgstr "" - #: ../../howto/descriptor.rst:295 msgid "Closing thoughts" msgstr "まとめ" #: ../../howto/descriptor.rst:297 msgid "" -"A :term:`descriptor` is what we call any object that defines :meth:`~object." -"__get__`, :meth:`~object.__set__`, or :meth:`~object.__delete__`." +"A :term:`descriptor` is what we call any object that defines :meth:" +"`__get__`, :meth:`__set__`, or :meth:`__delete__`." msgstr "" +":meth:`__get__` 、 :meth:`__set__` 、あるいは :meth:`__delete__` メソッドを定" +"義したあらゆるオブジェクトが、我々が :term:`descriptor` と呼ぶものです。" #: ../../howto/descriptor.rst:300 msgid "" -"Optionally, descriptors can have a :meth:`~object.__set_name__` method. " -"This is only used in cases where a descriptor needs to know either the class " -"where it was created or the name of class variable it was assigned to. " -"(This method, if present, is called even if the class is not a descriptor.)" +"Optionally, descriptors can have a :meth:`__set_name__` method. This is " +"only used in cases where a descriptor needs to know either the class where " +"it was created or the name of class variable it was assigned to. (This " +"method, if present, is called even if the class is not a descriptor.)" msgstr "" +"それに追加して、デスクリプタは :meth:`__set_name__` メソッドを持つこともでき" +"ます。このメソッドは、デスクリプタが設定されるクラス、あるいはアサインされた" +"クラス変数を知る必要がある場合に利用されます。もし存在していれば、クラスがデ" +"スクリプタでなくても呼ばれます。" #: ../../howto/descriptor.rst:305 msgid "" -"Descriptors get invoked by the dot operator during attribute lookup. If a " -"descriptor is accessed indirectly with ``vars(some_class)" +"Descriptors get invoked by the dot \"operator\" during attribute lookup. If " +"a descriptor is accessed indirectly with ``vars(some_class)" "[descriptor_name]``, the descriptor instance is returned without invoking it." msgstr "" -"デスクリプタは属性のルックアップ中に、ドット演算子によって呼び出されます。 " -"``vars(some_class)[descriptor_name]`` という書き方によって間接的にデスクリプ" -"タがアクセスされると、デスクリプタを実行することなく、デスクリプタのインスタ" -"ンスが返されます。" #: ../../howto/descriptor.rst:309 msgid "" @@ -521,7 +362,7 @@ msgid "" msgstr "" "デスクリプタは、Pythonのさまざまなところで利用されています。これにより、単な" "る関数は、インスタンスに束縛されたメソッドになります。 :func:`classmethod`, :" -"func:`staticmethod`, :func:`property`, :func:`functools.cached_property` と" +"func:`staticmethod`, :func:`property`,:func:`functools.cached_property` と" "いったツールもすべて、デスクリプタとして実装されています。" #: ../../howto/descriptor.rst:326 @@ -554,36 +395,19 @@ msgstr "" #: ../../howto/descriptor.rst:340 msgid "" -"This :class:`!Validator` class is both an :term:`abstract base class` and a " +"This :class:`Validator` class is both an :term:`abstract base class` and a " "managed attribute descriptor:" msgstr "" - -#: ../../howto/descriptor.rst:343 -msgid "" -"from abc import ABC, abstractmethod\n" -"\n" -"class Validator(ABC):\n" -"\n" -" def __set_name__(self, owner, name):\n" -" self.private_name = '_' + name\n" -"\n" -" def __get__(self, obj, objtype=None):\n" -" return getattr(obj, self.private_name)\n" -"\n" -" def __set__(self, obj, value):\n" -" self.validate(value)\n" -" setattr(obj, self.private_name, value)\n" -"\n" -" @abstractmethod\n" -" def validate(self, value):\n" -" pass" -msgstr "" +":class:Valicator` クラスは :term:`abstract base class` であり、属性管理デスク" +"リプタでもあります。" #: ../../howto/descriptor.rst:363 msgid "" -"Custom validators need to inherit from :class:`!Validator` and must supply " -"a :meth:`!validate` method to test various restrictions as needed." +"Custom validators need to inherit from :class:`Validator` and must supply a :" +"meth:`validate` method to test various restrictions as needed." msgstr "" +"カスタムバリデータを作成するには :class:`Valicator` を継承し、 :meth:" +"`validate` メソッドを作成して必要に応じてさまざまな制約の検証を行います。" #: ../../howto/descriptor.rst:368 msgid "Custom validators" @@ -596,138 +420,47 @@ msgstr "" #: ../../howto/descriptor.rst:372 msgid "" -":class:`!OneOf` verifies that a value is one of a restricted set of options." +":class:`OneOf` verifies that a value is one of a restricted set of options." msgstr "" +":class:`OneOf` は制限された候補の集合に含まれる値かどうかを検証します。" #: ../../howto/descriptor.rst:374 msgid "" -":class:`!Number` verifies that a value is either an :class:`int` or :class:" +":class:`Number` verifies that a value is either an :class:`int` or :class:" "`float`. Optionally, it verifies that a value is between a given minimum or " "maximum." msgstr "" +":class:`Number` は値が :class:`int: か :class:`float` かどうかを検証します。" +"オプションで、値が指定された最小値と最大値に含まれるかも検証します。" #: ../../howto/descriptor.rst:378 msgid "" -":class:`!String` verifies that a value is a :class:`str`. Optionally, it " +":class:`String` verifies that a value is a :class:`str`. Optionally, it " "validates a given minimum or maximum length. It can validate a user-defined " "`predicate `_ " "as well." msgstr "" +":class:`String` は値が :calss:`str` かどうか検証します。オプションで、指定さ" +"れた最小、最大の長さの検証をします。ユーザー定義の `術語 `_ 検証も行えます。" -#: ../../howto/descriptor.rst:383 -msgid "" -"class OneOf(Validator):\n" -"\n" -" def __init__(self, *options):\n" -" self.options = set(options)\n" -"\n" -" def validate(self, value):\n" -" if value not in self.options:\n" -" raise ValueError(\n" -" f'Expected {value!r} to be one of {self.options!r}'\n" -" )\n" -"\n" -"class Number(Validator):\n" -"\n" -" def __init__(self, minvalue=None, maxvalue=None):\n" -" self.minvalue = minvalue\n" -" self.maxvalue = maxvalue\n" -"\n" -" def validate(self, value):\n" -" if not isinstance(value, (int, float)):\n" -" raise TypeError(f'Expected {value!r} to be an int or float')\n" -" if self.minvalue is not None and value < self.minvalue:\n" -" raise ValueError(\n" -" f'Expected {value!r} to be at least {self.minvalue!r}'\n" -" )\n" -" if self.maxvalue is not None and value > self.maxvalue:\n" -" raise ValueError(\n" -" f'Expected {value!r} to be no more than {self.maxvalue!r}'\n" -" )\n" -"\n" -"class String(Validator):\n" -"\n" -" def __init__(self, minsize=None, maxsize=None, predicate=None):\n" -" self.minsize = minsize\n" -" self.maxsize = maxsize\n" -" self.predicate = predicate\n" -"\n" -" def validate(self, value):\n" -" if not isinstance(value, str):\n" -" raise TypeError(f'Expected {value!r} to be an str')\n" -" if self.minsize is not None and len(value) < self.minsize:\n" -" raise ValueError(\n" -" f'Expected {value!r} to be no smaller than {self.minsize!" -"r}'\n" -" )\n" -" if self.maxsize is not None and len(value) > self.maxsize:\n" -" raise ValueError(\n" -" f'Expected {value!r} to be no bigger than {self.maxsize!r}'\n" -" )\n" -" if self.predicate is not None and not self.predicate(value):\n" -" raise ValueError(\n" -" f'Expected {self.predicate} to be true for {value!r}'\n" -" )" -msgstr "" - -#: ../../howto/descriptor.rst:439 +#: ../../howto/descriptor.rst:437 msgid "Practical application" msgstr "実践的なアプリケーション" -#: ../../howto/descriptor.rst:441 +#: ../../howto/descriptor.rst:439 msgid "Here's how the data validators can be used in a real class:" msgstr "次のコードは実際のクラスでデータバリデータを使う方法のサンプルです。" -#: ../../howto/descriptor.rst:443 -msgid "" -"class Component:\n" -"\n" -" name = String(minsize=3, maxsize=10, predicate=str.isupper)\n" -" kind = OneOf('wood', 'metal', 'plastic')\n" -" quantity = Number(minvalue=0)\n" -"\n" -" def __init__(self, name, kind, quantity):\n" -" self.name = name\n" -" self.kind = kind\n" -" self.quantity = quantity" -msgstr "" - -#: ../../howto/descriptor.rst:456 +#: ../../howto/descriptor.rst:454 msgid "The descriptors prevent invalid instances from being created:" msgstr "これらのデスクリプタは、不正インスタンスが作成されるのを防ぎます。" -#: ../../howto/descriptor.rst:458 -msgid "" -">>> Component('Widget', 'metal', 5) # Blocked: 'Widget' is not all " -"uppercase\n" -"Traceback (most recent call last):\n" -" ...\n" -"ValueError: Expected to be true for " -"'Widget'\n" -"\n" -">>> Component('WIDGET', 'metle', 5) # Blocked: 'metle' is misspelled\n" -"Traceback (most recent call last):\n" -" ...\n" -"ValueError: Expected 'metle' to be one of {'metal', 'plastic', 'wood'}\n" -"\n" -">>> Component('WIDGET', 'metal', -5) # Blocked: -5 is negative\n" -"Traceback (most recent call last):\n" -" ...\n" -"ValueError: Expected -5 to be at least 0\n" -"\n" -">>> Component('WIDGET', 'metal', 'V') # Blocked: 'V' isn't a number\n" -"Traceback (most recent call last):\n" -" ...\n" -"TypeError: Expected 'V' to be an int or float\n" -"\n" -">>> c = Component('WIDGET', 'metal', 5) # Allowed: The inputs are valid" -msgstr "" - -#: ../../howto/descriptor.rst:484 +#: ../../howto/descriptor.rst:481 msgid "Technical Tutorial" msgstr "技術的なチュートリアル" -#: ../../howto/descriptor.rst:486 +#: ../../howto/descriptor.rst:483 msgid "" "What follows is a more technical tutorial for the mechanics and details of " "how descriptors work." @@ -735,11 +468,11 @@ msgstr "" "これから先はデスクリプタのメカニズムや動作の詳細について、よりテクニカルな" "チュートリアルになります。" -#: ../../howto/descriptor.rst:491 +#: ../../howto/descriptor.rst:488 msgid "Abstract" msgstr "概要" -#: ../../howto/descriptor.rst:493 +#: ../../howto/descriptor.rst:490 msgid "" "Defines descriptors, summarizes the protocol, and shows how descriptors are " "called. Provides an example showing how object relational mappings work." @@ -747,7 +480,7 @@ msgstr "" "デスクリプタの定義、プロトコルのサマリー、デスクリプタがどのように呼び出され" "るかの説明、ORマッパーがどのように動作するかのサンプルを提示します。" -#: ../../howto/descriptor.rst:496 +#: ../../howto/descriptor.rst:493 msgid "" "Learning about descriptors not only provides access to a larger toolset, it " "creates a deeper understanding of how Python works." @@ -755,19 +488,23 @@ msgstr "" "デスクリプタについて学ぶことにより、新しいツールセットが使えるようになるだけ" "でなく、Python の仕組みについてのより深い理解が得られます。" -#: ../../howto/descriptor.rst:501 +#: ../../howto/descriptor.rst:498 msgid "Definition and introduction" msgstr "定義と導入" -#: ../../howto/descriptor.rst:503 +#: ../../howto/descriptor.rst:500 msgid "" "In general, a descriptor is an attribute value that has one of the methods " -"in the descriptor protocol. Those methods are :meth:`~object.__get__`, :" -"meth:`~object.__set__`, and :meth:`~object.__delete__`. If any of those " -"methods are defined for an attribute, it is said to be a :term:`descriptor`." +"in the descriptor protocol. Those methods are :meth:`__get__`, :meth:" +"`__set__`, and :meth:`__delete__`. If any of those methods are defined for " +"an attribute, it is said to be a :term:`descriptor`." msgstr "" +"一般に、デスクリプタは、デスクリプタプロトコルで定義されたメソッドを持つ属性" +"値です。このメソッドは、 :meth:`__get__`, :meth:`__set__`, および :meth:" +"`__delete__` です。これらのメソッドのいずれかが、オブジェクトに定義されていれ" +"ば、それはデスクリプタと呼ばれます。" -#: ../../howto/descriptor.rst:508 +#: ../../howto/descriptor.rst:505 msgid "" "The default behavior for attribute access is to get, set, or delete the " "attribute from an object's dictionary. For instance, ``a.x`` has a lookup " @@ -786,32 +523,36 @@ msgstr "" "デスクリプタメソッドを呼び出します。これがどの連鎖順位で行われるかは、どのデ" "スクリプタメソッドが定義されているかに依ります。" -#: ../../howto/descriptor.rst:517 +#: ../../howto/descriptor.rst:514 msgid "" "Descriptors are a powerful, general purpose protocol. They are the " "mechanism behind properties, methods, static methods, class methods, and :" -"func:`super`. They are used throughout Python itself. Descriptors simplify " -"the underlying C code and offer a flexible set of new tools for everyday " -"Python programs." +"func:`super()`. They are used throughout Python itself. Descriptors " +"simplify the underlying C code and offer a flexible set of new tools for " +"everyday Python programs." msgstr "" +"デスクリプタは、強力な、多目的のプロトコルです。これはプロパティ、メソッド、" +"静的メソッド、クラスメソッド、そして :func:`super()` の背後にある機構です。" +"Python のいたるところで使われています。デスクリプタは、基幹にある C コードを" +"簡潔にし、毎日の Python プログラムに、柔軟な新しいツール群を提供します。" -#: ../../howto/descriptor.rst:525 +#: ../../howto/descriptor.rst:522 msgid "Descriptor protocol" msgstr "デスクリプタプロトコル" -#: ../../howto/descriptor.rst:527 -msgid "``descr.__get__(self, obj, type=None)``" -msgstr "``descr.__get__(self, obj, type=None)``" +#: ../../howto/descriptor.rst:524 +msgid "``descr.__get__(self, obj, type=None) -> value``" +msgstr "``descr.__get__(self, obj, type=None) -> value``" -#: ../../howto/descriptor.rst:529 -msgid "``descr.__set__(self, obj, value)``" -msgstr "``descr.__set__(self, obj, value)``" +#: ../../howto/descriptor.rst:526 +msgid "``descr.__set__(self, obj, value) -> None``" +msgstr "``descr.__set__(self, obj, value) -> None``" -#: ../../howto/descriptor.rst:531 -msgid "``descr.__delete__(self, obj)``" -msgstr "``descr.__delete__(self, obj)``" +#: ../../howto/descriptor.rst:528 +msgid "``descr.__delete__(self, obj) -> None``" +msgstr "``descr.__delete__(self, obj) -> None``" -#: ../../howto/descriptor.rst:533 +#: ../../howto/descriptor.rst:530 msgid "" "That is all there is to it. Define any of these methods and an object is " "considered a descriptor and can override default behavior upon being looked " @@ -821,15 +562,19 @@ msgstr "" "リプタとみなされ、探索された際のデフォルトの振る舞いをオーバーライドできま" "す。" -#: ../../howto/descriptor.rst:537 +#: ../../howto/descriptor.rst:534 msgid "" -"If an object defines :meth:`~object.__set__` or :meth:`~object.__delete__`, " -"it is considered a data descriptor. Descriptors that only define :meth:" -"`~object.__get__` are called non-data descriptors (they are often used for " -"methods but other uses are possible)." +"If an object defines :meth:`__set__` or :meth:`__delete__`, it is considered " +"a data descriptor. Descriptors that only define :meth:`__get__` are called " +"non-data descriptors (they are often used for methods but other uses are " +"possible)." msgstr "" +"あるオブジェクトが :meth:`__set__` と :meth:`__delete__` の両方を定義していた" +"ら、それはデータデスクリプタとみなされます。 :meth:`__get__` だけを定義してい" +"るデスクリプタは、非データデスクリプタと呼ばれます (これらはよくメソッドに使" +"われますが、他の使い方も出来ます)。" -#: ../../howto/descriptor.rst:542 +#: ../../howto/descriptor.rst:539 msgid "" "Data and non-data descriptors differ in how overrides are calculated with " "respect to entries in an instance's dictionary. If an instance's dictionary " @@ -843,19 +588,24 @@ msgstr "" "ます。インスタンスの辞書に、非データデスクリプタと同名の項目があれば、辞書の" "項目の方が優先されます。" -#: ../../howto/descriptor.rst:548 +#: ../../howto/descriptor.rst:545 msgid "" -"To make a read-only data descriptor, define both :meth:`~object.__get__` " -"and :meth:`~object.__set__` with the :meth:`~object.__set__` raising an :exc:" -"`AttributeError` when called. Defining the :meth:`~object.__set__` method " -"with an exception raising placeholder is enough to make it a data descriptor." +"To make a read-only data descriptor, define both :meth:`__get__` and :meth:" +"`__set__` with the :meth:`__set__` raising an :exc:`AttributeError` when " +"called. Defining the :meth:`__set__` method with an exception raising " +"placeholder is enough to make it a data descriptor." msgstr "" +"読み出し専用のデータデスクリプタを作るには、 :meth:`__get__` と :meth:" +"`__set__` の両方を定義し、 :meth:`__set__` が呼び出されたときに :exc:" +"`AttributeError` が送出されるようにしてください。例外を送出する :meth:" +"`__set__` メソッドをプレースホルダとして定義すれば、データデスクリプタにする" +"のに十分です。" -#: ../../howto/descriptor.rst:555 +#: ../../howto/descriptor.rst:552 msgid "Overview of descriptor invocation" msgstr "デスクリプタ呼び出しの概要" -#: ../../howto/descriptor.rst:557 +#: ../../howto/descriptor.rst:554 msgid "" "A descriptor can be called directly with ``desc.__get__(obj)`` or ``desc." "__get__(None, cls)``." @@ -863,7 +613,7 @@ msgstr "" "``desc.__get__(obj)`` や ``desc.__get__(None, cls)`` を使うとデスクリプタを直" "接呼び出すことができます。" -#: ../../howto/descriptor.rst:560 +#: ../../howto/descriptor.rst:557 msgid "" "But it is more common for a descriptor to be invoked automatically from " "attribute access." @@ -871,15 +621,19 @@ msgstr "" "しかし、属性アクセスの際に自動的に呼び出されるのが、一般的なデスクリプタの呼" "び出し方法です。" -#: ../../howto/descriptor.rst:563 +#: ../../howto/descriptor.rst:560 msgid "" "The expression ``obj.x`` looks up the attribute ``x`` in the chain of " "namespaces for ``obj``. If the search finds a descriptor outside of the " -"instance :attr:`~object.__dict__`, its :meth:`~object.__get__` method is " -"invoked according to the precedence rules listed below." +"instance ``__dict__``, its :meth:`__get__` method is invoked according to " +"the precedence rules listed below." msgstr "" +"式 ``obj.x`` は ``obj`` の名前空間のチェーンの中で属性 ``x`` を探索します。も" +"し、その検索のロジックの中で、インスタンスの ``__dict__`` の外でデスクリプタ" +"を見つけた場合、探索ルールのリストのリストに従って、そのデスクリプタの :meth:" +"``__get__` メソッドが呼び出されます。" -#: ../../howto/descriptor.rst:568 +#: ../../howto/descriptor.rst:565 msgid "" "The details of invocation depend on whether ``obj`` is an object, class, or " "instance of super." @@ -887,19 +641,22 @@ msgstr "" "呼び出しの詳細は、``obj`` がオブジェクトかクラスか、superのインスタンスかに依" "ります。" -#: ../../howto/descriptor.rst:573 +#: ../../howto/descriptor.rst:570 msgid "Invocation from an instance" msgstr "インスタンスからの呼び出し" -#: ../../howto/descriptor.rst:575 +#: ../../howto/descriptor.rst:572 msgid "" "Instance lookup scans through a chain of namespaces giving data descriptors " "the highest priority, followed by instance variables, then non-data " -"descriptors, then class variables, and lastly :meth:`~object.__getattr__` if " -"it is provided." +"descriptors, then class variables, and lastly :meth:`__getattr__` if it is " +"provided." msgstr "" +"名前空間のチェーンの中で行われるインスタンスルックアップでは、データデスクリ" +"プタが最優先で、次にインスタンス変数、その次にノンデータデスクリプタ、クラス" +"変数、最後に存在したら :meth:`__getattr__` が呼ばれます。" -#: ../../howto/descriptor.rst:580 +#: ../../howto/descriptor.rst:577 msgid "" "If a descriptor is found for ``a.x``, then it is invoked with: ``desc." "__get__(a, type(a))``." @@ -907,7 +664,7 @@ msgstr "" "``a.x`` に対するデスクリプタが見つかった場合、 ``desc.__get__(a, type(a))`` " "という形式で呼び出されます。" -#: ../../howto/descriptor.rst:583 +#: ../../howto/descriptor.rst:580 msgid "" "The logic for a dotted lookup is in :meth:`object.__getattribute__`. Here " "is a pure Python equivalent:" @@ -915,100 +672,69 @@ msgstr "" "ドットによるルックアップのロジックは\\ :meth:`object.__getattribute__` の中で" "行われます。ピュアPythonで表した等価なロジックは次の通りです。" -#: ../../howto/descriptor.rst:586 -msgid "" -"def find_name_in_mro(cls, name, default):\n" -" \"Emulate _PyType_Lookup() in Objects/typeobject.c\"\n" -" for base in cls.__mro__:\n" -" if name in vars(base):\n" -" return vars(base)[name]\n" -" return default\n" -"\n" -"def object_getattribute(obj, name):\n" -" \"Emulate PyObject_GenericGetAttr() in Objects/object.c\"\n" -" null = object()\n" -" objtype = type(obj)\n" -" cls_var = find_name_in_mro(objtype, name, null)\n" -" descr_get = getattr(type(cls_var), '__get__', null)\n" -" if descr_get is not null:\n" -" if (hasattr(type(cls_var), '__set__')\n" -" or hasattr(type(cls_var), '__delete__')):\n" -" return descr_get(cls_var, obj, objtype) # data descriptor\n" -" if hasattr(obj, '__dict__') and name in vars(obj):\n" -" return vars(obj)[name] # instance variable\n" -" if descr_get is not null:\n" -" return descr_get(cls_var, obj, objtype) # non-data " -"descriptor\n" -" if cls_var is not null:\n" -" return cls_var # class variable\n" -" raise AttributeError(name)" -msgstr "" - -#: ../../howto/descriptor.rst:722 -msgid "" -"Note, there is no :meth:`~object.__getattr__` hook in the :meth:`~object." -"__getattribute__` code. That is why calling :meth:`~object." -"__getattribute__` directly or with ``super().__getattribute__`` will bypass :" -"meth:`~object.__getattr__` entirely." -msgstr "" - -#: ../../howto/descriptor.rst:726 -msgid "" -"Instead, it is the dot operator and the :func:`getattr` function that are " -"responsible for invoking :meth:`~object.__getattr__` whenever :meth:`~object." -"__getattribute__` raises an :exc:`AttributeError`. Their logic is " -"encapsulated in a helper function:" -msgstr "" - -#: ../../howto/descriptor.rst:731 -msgid "" -"def getattr_hook(obj, name):\n" -" \"Emulate slot_tp_getattr_hook() in Objects/typeobject.c\"\n" -" try:\n" -" return obj.__getattribute__(name)\n" -" except AttributeError:\n" -" if not hasattr(type(obj), '__getattr__'):\n" -" raise\n" -" return type(obj).__getattr__(obj, name) # __getattr__" -msgstr "" - -#: ../../howto/descriptor.rst:776 +#: ../../howto/descriptor.rst:700 +msgid "" +"Interestingly, attribute lookup doesn't call :meth:`object.__getattribute__` " +"directly. Instead, both the dot operator and the :func:`getattr` function " +"perform attribute lookup by way of a helper function:" +msgstr "" + +#: ../../howto/descriptor.rst:747 +msgid "" +"So if :meth:`__getattr__` exists, it is called whenever :meth:" +"`__getattribute__` raises :exc:`AttributeError` (either directly or in one " +"of the descriptor calls)." +msgstr "" + +#: ../../howto/descriptor.rst:750 +msgid "" +"Also, if a user calls :meth:`object.__getattribute__` directly, the :meth:" +"`__getattr__` hook is bypassed entirely." +msgstr "" + +#: ../../howto/descriptor.rst:755 msgid "Invocation from a class" msgstr "クラスからの呼び出し" -#: ../../howto/descriptor.rst:778 +#: ../../howto/descriptor.rst:757 msgid "" -"The logic for a dotted lookup such as ``A.x`` is in :meth:`!type." -"__getattribute__`. The steps are similar to those for :meth:`!object." +"The logic for a dotted lookup such as ``A.x`` is in :meth:`type." +"__getattribute__`. The steps are similar to those for :meth:`object." "__getattribute__` but the instance dictionary lookup is replaced by a search " "through the class's :term:`method resolution order`." msgstr "" +"``A.x`` のようなドットを使ったルックアップのロジックは :meth:`type." +"__getattribute__` の中にあります。ロジックのステップは :meth:`object." +"__getattribute__` と似ていますが、インスタンス辞書のルックアップはクラスの :" +"term:`method resolution order` を通じた探索と置き換えられています。" -#: ../../howto/descriptor.rst:783 +#: ../../howto/descriptor.rst:762 msgid "If a descriptor is found, it is invoked with ``desc.__get__(None, A)``." msgstr "" "``a.x`` に対するデスクリプタが見つかった場合、 ``desc.__get__(None, A)`` とい" "う形式で呼び出されます。" -#: ../../howto/descriptor.rst:785 +#: ../../howto/descriptor.rst:764 msgid "" -"The full C implementation can be found in :c:func:`!type_getattro` and :c:" -"func:`!_PyType_Lookup` in :source:`Objects/typeobject.c`." +"The full C implementation can be found in :c:func:`type_getattro()` and :c:" +"func:`_PyType_Lookup()` in :source:`Objects/typeobject.c`." msgstr "" -"完全な C での実装は :source:`Objects/typeobject.c` の中の:c:func:`!" -"type_getattro` と :c:func:`!_PyType_Lookup` を参照してください。" +"完全なC言語による実装は :source:`Objects/typeobject.c` のファイル内の :c:" +"func:`type_getattro()` と :c:func:`_PyType_Lookup()` の中にあります。" -#: ../../howto/descriptor.rst:790 +#: ../../howto/descriptor.rst:769 msgid "Invocation from super" msgstr "superからの呼び出し" -#: ../../howto/descriptor.rst:792 +#: ../../howto/descriptor.rst:771 msgid "" -"The logic for super's dotted lookup is in the :meth:`~object." -"__getattribute__` method for object returned by :func:`super`." +"The logic for super's dotted lookup is in the :meth:`__getattribute__` " +"method for object returned by :class:`super()`." msgstr "" +"superのドットを使ったルックアップは :class:`super()` が返すオブジェクトの :" +"meth:`__getattribute__` メソッドの中で行われます。" -#: ../../howto/descriptor.rst:795 +#: ../../howto/descriptor.rst:774 msgid "" "A dotted lookup such as ``super(A, obj).m`` searches ``obj.__class__." "__mro__`` for the base class ``B`` immediately following ``A`` and then " @@ -1020,38 +746,39 @@ msgstr "" "__dict__['m'].__get__(obj, A)`` を返します。もしデスクリプタでなければ ``m`` " "を変更せずに返します。" -#: ../../howto/descriptor.rst:800 +#: ../../howto/descriptor.rst:779 msgid "" -"The full C implementation can be found in :c:func:`!super_getattro` in :" +"The full C implementation can be found in :c:func:`super_getattro()` in :" "source:`Objects/typeobject.c`. A pure Python equivalent can be found in " "`Guido's Tutorial `_." msgstr "" -"完全な C での実装は :source:`Objects/typeobject.c` の中の :c:func:`!" -"super_getattro` を参照してください。純粋な Python での同等なコードは " -"`Guido's Tutorial `_ を参照してください。" +"完全なC言語による実装は :source:`Objects/typeobject.c` の中の :c:func:" +"`super_getattro()` の中にあります。等価なピュアPython実装は `Guidoのチュート" +"リアル `_ で見られます。" -#: ../../howto/descriptor.rst:807 +#: ../../howto/descriptor.rst:786 msgid "Summary of invocation logic" msgstr "呼び出しロジックのまとめ" -#: ../../howto/descriptor.rst:809 +#: ../../howto/descriptor.rst:788 msgid "" -"The mechanism for descriptors is embedded in the :meth:`~object." -"__getattribute__` methods for :class:`object`, :class:`type`, and :func:" -"`super`." +"The mechanism for descriptors is embedded in the :meth:`__getattribute__()` " +"methods for :class:`object`, :class:`type`, and :func:`super`." msgstr "" +"デスクリプタのメカニズムは、 :class:`object` 、 :class:`type` 、 :func:" +"`super` の :meth:`__getattribute__()` メソッドの中に組み込まれています。" -#: ../../howto/descriptor.rst:812 +#: ../../howto/descriptor.rst:791 msgid "The important points to remember are:" msgstr "憶えておくべき重要な点は:" -#: ../../howto/descriptor.rst:814 -msgid "Descriptors are invoked by the :meth:`~object.__getattribute__` method." -msgstr "" +#: ../../howto/descriptor.rst:793 +msgid "Descriptors are invoked by the :meth:`__getattribute__` method." +msgstr "デスクリプタは :meth:`__getattribute__` メソッドによって呼び出される" -#: ../../howto/descriptor.rst:816 +#: ../../howto/descriptor.rst:795 msgid "" "Classes inherit this machinery from :class:`object`, :class:`type`, or :func:" "`super`." @@ -1059,73 +786,89 @@ msgstr "" "クラスはこの機構を :class:`object` 、 :class:`type` 、 :func:`super` から継承" "する" -#: ../../howto/descriptor.rst:819 +#: ../../howto/descriptor.rst:798 msgid "" -"Overriding :meth:`~object.__getattribute__` prevents automatic descriptor " -"calls because all the descriptor logic is in that method." +"Overriding :meth:`__getattribute__` prevents automatic descriptor calls " +"because all the descriptor logic is in that method." msgstr "" +"すべてのデスクリプタのロジックが :meth:`__getattribute__` にあるため、このメ" +"ソッドをオーバーライドすると、すべての自動的なデスクリプタ呼び出しは抑制され" +"る" -#: ../../howto/descriptor.rst:822 +#: ../../howto/descriptor.rst:801 msgid "" -":meth:`!object.__getattribute__` and :meth:`!type.__getattribute__` make " -"different calls to :meth:`~object.__get__`. The first includes the instance " -"and may include the class. The second puts in ``None`` for the instance and " -"always includes the class." +":meth:`object.__getattribute__` and :meth:`type.__getattribute__` make " +"different calls to :meth:`__get__`. The first includes the instance and may " +"include the class. The second puts in ``None`` for the instance and always " +"includes the class." msgstr "" +":meth:`object.__getattribute__` と :meth:`type.__getattribute__` は :meth:" +"`__get__` の呼び出し方が異なる。前者はインスタンスとおそらくメソッドを含む。" +"後者はインスタンスとして ``None`` を渡し、クラスは常に渡される" -#: ../../howto/descriptor.rst:827 +#: ../../howto/descriptor.rst:806 msgid "Data descriptors always override instance dictionaries." msgstr "データデスクリプタは、必ずインスタンス辞書をオーバーライドする" -#: ../../howto/descriptor.rst:829 +#: ../../howto/descriptor.rst:808 msgid "Non-data descriptors may be overridden by instance dictionaries." msgstr "" "非データデスクリプタは、インスタンス辞書にオーバーライドされることがある" -#: ../../howto/descriptor.rst:833 +#: ../../howto/descriptor.rst:812 msgid "Automatic name notification" msgstr "自動的の名前の伝達" -#: ../../howto/descriptor.rst:835 +#: ../../howto/descriptor.rst:814 msgid "" "Sometimes it is desirable for a descriptor to know what class variable name " "it was assigned to. When a new class is created, the :class:`type` " "metaclass scans the dictionary of the new class. If any of the entries are " -"descriptors and if they define :meth:`~object.__set_name__`, that method is " -"called with two arguments. The *owner* is the class where the descriptor is " -"used, and the *name* is the class variable the descriptor was assigned to." +"descriptors and if they define :meth:`__set_name__`, that method is called " +"with two arguments. The *owner* is the class where the descriptor is used, " +"and the *name* is the class variable the descriptor was assigned to." msgstr "" +"デスクリプタにとって、自分がアサインされるクラス変数名が知りたいことがありま" +"す。新しいクラスが作られると、 :class:`type` メタクラスは新しいクラスの辞書を" +"スキャンします。もし、要素がデスクリプタで、なおかつ :meth:`__set_name__` メ" +"ソッドを持っている場合、このメソッドは2つの引数を伴って呼び出されます。 " +"*owner* はデスクリプタが使用されたクラスで、 *name* はデスクリプタがアサイン" +"されたクラス変数の名前です。" -#: ../../howto/descriptor.rst:842 +#: ../../howto/descriptor.rst:821 msgid "" -"The implementation details are in :c:func:`!type_new` and :c:func:`!" -"set_names` in :source:`Objects/typeobject.c`." +"The implementation details are in :c:func:`type_new()` and :c:func:" +"`set_names()` in :source:`Objects/typeobject.c`." msgstr "" -"実装の詳細は :source:`Objects/typeobject.c` の中の :c:func:`!type_new` と :c:" -"func:`!set_names` を参照してください。" +"完全なC言語による実装は :source:`Objects/typeobject.c` のファイル内の :c:" +"func:`type_new()` と :c:func:`set_names()` の中にあります。" -#: ../../howto/descriptor.rst:845 +#: ../../howto/descriptor.rst:824 msgid "" -"Since the update logic is in :meth:`!type.__new__`, notifications only take " +"Since the update logic is in :meth:`type.__new__`, notifications only take " "place at the time of class creation. If descriptors are added to the class " -"afterwards, :meth:`~object.__set_name__` will need to be called manually." +"afterwards, :meth:`__set_name__` will need to be called manually." msgstr "" +"更新のロジックは :meth:`type.__new__` にあり、通知はクラス作成のタイミングに" +"しかありません。もしデスクリプタが後からクラスに追加された場合は、 :meth:" +"`__set_name__` を手動で呼び出す必要があるでしょう。" -#: ../../howto/descriptor.rst:851 +#: ../../howto/descriptor.rst:830 msgid "ORM example" msgstr "ORMのサンプル" -#: ../../howto/descriptor.rst:853 +#: ../../howto/descriptor.rst:832 msgid "" -"The following code is a simplified skeleton showing how data descriptors " -"could be used to implement an `object relational mapping `_." +"The following code is simplified skeleton showing how data descriptors could " +"be used to implement an `object relational mapping `_." msgstr "" -"以下のコードは、 `オブジェクト関係マッピング `_ を実装するのにデータディスクリプタを使う" -"方法を示した、簡略化された骨格です。" +"次のコードは、 `ORマッピング `_ " +"の実装にデータデスクリプタが利用できることを示すための、シンプル化したスケル" +"トンコードです。" -#: ../../howto/descriptor.rst:857 +#: ../../howto/descriptor.rst:836 msgid "" "The essential idea is that the data is stored in an external database. The " "Python instances only hold keys to the database's tables. Descriptors take " @@ -1135,64 +878,21 @@ msgstr "" "タンスは、データベースのテーブルへのキーのみを保持します。デスクリプタがルッ" "クアップや更新をします。" -#: ../../howto/descriptor.rst:861 +#: ../../howto/descriptor.rst:855 msgid "" -"class Field:\n" -"\n" -" def __set_name__(self, owner, name):\n" -" self.fetch = f'SELECT {name} FROM {owner.table} WHERE {owner.key}" -"=?;'\n" -" self.store = f'UPDATE {owner.table} SET {name}=? WHERE {owner.key}" -"=?;'\n" -"\n" -" def __get__(self, obj, objtype=None):\n" -" return conn.execute(self.fetch, [obj.key]).fetchone()[0]\n" -"\n" -" def __set__(self, obj, value):\n" -" conn.execute(self.store, [value, obj.key])\n" -" conn.commit()" -msgstr "" - -#: ../../howto/descriptor.rst:876 -msgid "" -"We can use the :class:`!Field` class to define `models `_ that describe the schema for each table in a " "database:" msgstr "" +":class:`Field` クラスを使って、データベースのテーブルごとのスキーマを説明する" +"ための `モデル `_ を定義します。" #: ../../howto/descriptor.rst:880 -msgid "" -"class Movie:\n" -" table = 'Movies' # Table name\n" -" key = 'title' # Primary key\n" -" director = Field()\n" -" year = Field()\n" -"\n" -" def __init__(self, key):\n" -" self.key = key\n" -"\n" -"class Song:\n" -" table = 'Music'\n" -" key = 'title'\n" -" artist = Field()\n" -" year = Field()\n" -" genre = Field()\n" -"\n" -" def __init__(self, key):\n" -" self.key = key" -msgstr "" - -#: ../../howto/descriptor.rst:901 msgid "To use the models, first connect to the database::" msgstr "モデルを使用するにはまずデータベースに接続します::" -#: ../../howto/descriptor.rst:903 -msgid "" -">>> import sqlite3\n" -">>> conn = sqlite3.connect('entertainment.db')" -msgstr "" - -#: ../../howto/descriptor.rst:906 +#: ../../howto/descriptor.rst:885 msgid "" "An interactive session shows how data is retrieved from the database and how " "it can be updated:" @@ -1200,27 +900,11 @@ msgstr "" "次のインタラクティブセッションでは、データベースからのデータの取得と、更新方" "法を示しています。" -#: ../../howto/descriptor.rst:934 -msgid "" -">>> Movie('Star Wars').director\n" -"'George Lucas'\n" -">>> jaws = Movie('Jaws')\n" -">>> f'Released in {jaws.year} by {jaws.director}'\n" -"'Released in 1975 by Steven Spielberg'\n" -"\n" -">>> Song('Country Roads').artist\n" -"'John Denver'\n" -"\n" -">>> Movie('Star Wars').director = 'J.J. Abrams'\n" -">>> Movie('Star Wars').director\n" -"'J.J. Abrams'" -msgstr "" - -#: ../../howto/descriptor.rst:955 +#: ../../howto/descriptor.rst:930 msgid "Pure Python Equivalents" msgstr "ピュアPythonの等価実装" -#: ../../howto/descriptor.rst:957 +#: ../../howto/descriptor.rst:932 msgid "" "The descriptor protocol is simple and offers exciting possibilities. " "Several use cases are so common that they have been prepackaged into built-" @@ -1232,11 +916,11 @@ msgstr "" "束縛のメソッド、静的メソッド、クラスメソッド、 \\_\\_slots\\_\\_ は、全てデス" "クリプタプロトコルに基づいています。" -#: ../../howto/descriptor.rst:964 +#: ../../howto/descriptor.rst:939 msgid "Properties" msgstr "プロパティ" -#: ../../howto/descriptor.rst:966 +#: ../../howto/descriptor.rst:941 msgid "" "Calling :func:`property` is a succinct way of building a data descriptor " "that triggers a function call upon access to an attribute. Its signature " @@ -1245,77 +929,22 @@ msgstr "" ":func:`property` を呼び出すことで、属性へアクセスすると関数の呼び出しを引き起" "こす、データデスクリプタを簡潔に組み立てられます。シグネチャはこうです::" -#: ../../howto/descriptor.rst:969 -msgid "property(fget=None, fset=None, fdel=None, doc=None) -> property" -msgstr "" - -#: ../../howto/descriptor.rst:971 +#: ../../howto/descriptor.rst:946 msgid "" "The documentation shows a typical use to define a managed attribute ``x``:" msgstr "" "このドキュメントでは、管理された属性 ``x`` を定義する典型的な使用法を示しま" "す:" -#: ../../howto/descriptor.rst:973 +#: ../../howto/descriptor.rst:970 msgid "" -"class C:\n" -" def getx(self): return self.__x\n" -" def setx(self, value): self.__x = value\n" -" def delx(self): del self.__x\n" -" x = property(getx, setx, delx, \"I'm the 'x' property.\")" +"To see how :func:`property` is implemented in terms of the descriptor " +"protocol, here is a pure Python equivalent:" msgstr "" +"デスクリプタの見地から :func:`property` がどのように実装されているかを見るた" +"めに、等価な Python 版をここに挙げます:" -#: ../../howto/descriptor.rst:995 -msgid "" -"To see how :func:`property` is implemented in terms of the descriptor " -"protocol, here is a pure Python equivalent that implements most of the core " -"functionality:" -msgstr "" - -#: ../../howto/descriptor.rst:998 -msgid "" -"class Property:\n" -" \"Emulate PyProperty_Type() in Objects/descrobject.c\"\n" -"\n" -" def __init__(self, fget=None, fset=None, fdel=None, doc=None):\n" -" self.fget = fget\n" -" self.fset = fset\n" -" self.fdel = fdel\n" -" if doc is None and fget is not None:\n" -" doc = fget.__doc__\n" -" self.__doc__ = doc\n" -"\n" -" def __set_name__(self, owner, name):\n" -" self.__name__ = name\n" -"\n" -" def __get__(self, obj, objtype=None):\n" -" if obj is None:\n" -" return self\n" -" if self.fget is None:\n" -" raise AttributeError\n" -" return self.fget(obj)\n" -"\n" -" def __set__(self, obj, value):\n" -" if self.fset is None:\n" -" raise AttributeError\n" -" self.fset(obj, value)\n" -"\n" -" def __delete__(self, obj):\n" -" if self.fdel is None:\n" -" raise AttributeError\n" -" self.fdel(obj)\n" -"\n" -" def getter(self, fget):\n" -" return type(self)(fget, self.fset, self.fdel, self.__doc__)\n" -"\n" -" def setter(self, fset):\n" -" return type(self)(self.fget, fset, self.fdel, self.__doc__)\n" -"\n" -" def deleter(self, fdel):\n" -" return type(self)(self.fget, self.fset, fdel, self.__doc__)" -msgstr "" - -#: ../../howto/descriptor.rst:1122 +#: ../../howto/descriptor.rst:1063 msgid "" "The :func:`property` builtin helps whenever a user interface has granted " "attribute access and then subsequent changes require the intervention of a " @@ -1324,7 +953,7 @@ msgstr "" "組み込みの :func:`property` 関数は、ユーザインターフェースへの属性アクセスが" "与えられ、続く変更がメソッドの介入を要求するときに役立ちます。" -#: ../../howto/descriptor.rst:1126 +#: ../../howto/descriptor.rst:1067 msgid "" "For instance, a spreadsheet class may grant access to a cell value through " "``Cell('b10').value``. Subsequent improvements to the program require the " @@ -1339,29 +968,19 @@ msgstr "" "ントコードに影響を与えたくありません。この解決策は、property データデスクリプ" "タ内に値属性へのアクセスをラップすることです:" -#: ../../howto/descriptor.rst:1132 -msgid "" -"class Cell:\n" -" ...\n" -"\n" -" @property\n" -" def value(self):\n" -" \"Recalculate the cell before returning value\"\n" -" self.recalc()\n" -" return self._value" -msgstr "" - -#: ../../howto/descriptor.rst:1143 +#: ../../howto/descriptor.rst:1084 msgid "" -"Either the built-in :func:`property` or our :func:`!Property` equivalent " +"Either the built-in :func:`property` or our :func:`Property` equivalent " "would work in this example." msgstr "" +"組み込みの :func:`property` も、この :func:`Property` も、このサンプルの中で" +"同じように利用できます。" -#: ../../howto/descriptor.rst:1148 +#: ../../howto/descriptor.rst:1089 msgid "Functions and methods" msgstr "関数とメソッド" -#: ../../howto/descriptor.rst:1150 +#: ../../howto/descriptor.rst:1091 msgid "" "Python's object oriented features are built upon a function based " "environment. Using non-data descriptors, the two are merged seamlessly." @@ -1369,7 +988,7 @@ msgstr "" "Python のオブジェクト指向機能は、関数に基づく環境の上に構築されています。非" "データデスクリプタを使って、この 2 つはシームレスに組み合わされています。" -#: ../../howto/descriptor.rst:1153 +#: ../../howto/descriptor.rst:1094 msgid "" "Functions stored in class dictionaries get turned into methods when invoked. " "Methods only differ from regular functions in that the object instance is " @@ -1381,7 +1000,7 @@ msgstr "" "ます。監修ではインスタンスは *self* という名前が使われますが、 *this* や他の" "変数名も使えます。" -#: ../../howto/descriptor.rst:1158 +#: ../../howto/descriptor.rst:1099 msgid "" "Methods can be created manually with :class:`types.MethodType` which is " "roughly equivalent to:" @@ -1389,56 +1008,19 @@ msgstr "" "メソッドは、ほぼ次のコードと同等な :class:`types.MethodType` を使えば手動で作" "れます。" -#: ../../howto/descriptor.rst:1161 -msgid "" -"class MethodType:\n" -" \"Emulate PyMethod_Type in Objects/classobject.c\"\n" -"\n" -" def __init__(self, func, obj):\n" -" self.__func__ = func\n" -" self.__self__ = obj\n" -"\n" -" def __call__(self, *args, **kwargs):\n" -" func = self.__func__\n" -" obj = self.__self__\n" -" return func(obj, *args, **kwargs)\n" -"\n" -" def __getattribute__(self, name):\n" -" \"Emulate method_getset() in Objects/classobject.c\"\n" -" if name == '__doc__':\n" -" return self.__func__.__doc__\n" -" return object.__getattribute__(self, name)\n" -"\n" -" def __getattr__(self, name):\n" -" \"Emulate method_getattro() in Objects/classobject.c\"\n" -" return getattr(self.__func__, name)\n" -"\n" -" def __get__(self, obj, objtype=None):\n" -" \"Emulate method_descr_get() in Objects/classobject.c\"\n" -" return self" -msgstr "" - -#: ../../howto/descriptor.rst:1189 +#: ../../howto/descriptor.rst:1116 msgid "" "To support automatic creation of methods, functions include the :meth:" -"`~object.__get__` method for binding methods during attribute access. This " -"means that functions are non-data descriptors that return bound methods " -"during dotted lookup from an instance. Here's how it works:" +"`__get__` method for binding methods during attribute access. This means " +"that functions are non-data descriptors that return bound methods during " +"dotted lookup from an instance. Here's how it works:" msgstr "" +"メソッドの自動作成をサポートするには、関数に対し、属性アクセスでメソッドの束" +"縛に利用される :meth:`__get__` メソッドを追加します。これはつまり、この関数は" +"ドットアクセスされたときに束縛されたメソッドを返す非データデスクリプタである" +"ことを意味します。次のように動作します。" -#: ../../howto/descriptor.rst:1194 -msgid "" -"class Function:\n" -" ...\n" -"\n" -" def __get__(self, obj, objtype=None):\n" -" \"Simulate func_descr_get() in Objects/funcobject.c\"\n" -" if obj is None:\n" -" return self\n" -" return MethodType(self, obj)" -msgstr "" - -#: ../../howto/descriptor.rst:1205 +#: ../../howto/descriptor.rst:1132 msgid "" "Running the following class in the interpreter shows how the function " "descriptor works in practice:" @@ -1446,68 +1028,38 @@ msgstr "" "次のクラスをインタプリタを起動すると、この関数デスクリプタが実際にどう働くか" "を見られます::" -#: ../../howto/descriptor.rst:1208 -msgid "" -"class D:\n" -" def f(self):\n" -" return self\n" -"\n" -"class D2:\n" -" pass" -msgstr "" - -#: ../../howto/descriptor.rst:1226 +#: ../../howto/descriptor.rst:1141 msgid "" "The function has a :term:`qualified name` attribute to support introspection:" msgstr "" "この関数はイントロスペクションをサポートするために :term:`qualified name` も" "持っています。" -#: ../../howto/descriptor.rst:1228 -msgid "" -">>> D.f.__qualname__\n" -"'D.f'" -msgstr "" - -#: ../../howto/descriptor.rst:1233 +#: ../../howto/descriptor.rst:1148 msgid "" "Accessing the function through the class dictionary does not invoke :meth:" -"`~object.__get__`. Instead, it just returns the underlying function object::" -msgstr "" - -#: ../../howto/descriptor.rst:1236 -msgid "" -">>> D.__dict__['f']\n" -"" -msgstr "" - -#: ../../howto/descriptor.rst:1239 -msgid "" -"Dotted access from a class calls :meth:`~object.__get__` which just returns " -"the underlying function unchanged::" +"`__get__`. Instead, it just returns the underlying function object::" msgstr "" +"クラス辞書を通じて関数にアクセスすると :meth:`__get__` が実行されません。その" +"ため、裏にある関数オブジェクトをそのまま返します。" -#: ../../howto/descriptor.rst:1242 +#: ../../howto/descriptor.rst:1154 msgid "" -">>> D.f\n" -"" +"Dotted access from a class calls :meth:`__get__` which just returns the " +"underlying function unchanged::" msgstr "" +"クラスのドットアクセスは :meth:`__get__` は呼び出しますが、これも裏にある関数" +"を変更せずに返します。" -#: ../../howto/descriptor.rst:1245 +#: ../../howto/descriptor.rst:1160 msgid "" "The interesting behavior occurs during dotted access from an instance. The " -"dotted lookup calls :meth:`~object.__get__` which returns a bound method " -"object::" -msgstr "" - -#: ../../howto/descriptor.rst:1248 -msgid "" -">>> d = D()\n" -">>> d.f\n" -">" +"dotted lookup calls :meth:`__get__` which returns a bound method object::" msgstr "" +"インスタンスに対してドットアクセスをすると面白い動作をします。ドットのルック" +"アップは、束縛メソッドオブジェクトを返す :meth:`__get__` を呼び出します。" -#: ../../howto/descriptor.rst:1252 +#: ../../howto/descriptor.rst:1167 msgid "" "Internally, the bound method stores the underlying function and the bound " "instance::" @@ -1515,16 +1067,7 @@ msgstr "" "内部では、束縛メソッドはオリジナルの関数と束縛されたインスタンスを保持してい" "ます。" -#: ../../howto/descriptor.rst:1255 -msgid "" -">>> d.f.__func__\n" -"\n" -"\n" -">>> d.f.__self__\n" -"<__main__.D object at 0x00B18C90>" -msgstr "" - -#: ../../howto/descriptor.rst:1261 +#: ../../howto/descriptor.rst:1176 msgid "" "If you have ever wondered where *self* comes from in regular methods or " "where *cls* comes from in class methods, this is it!" @@ -1532,11 +1075,11 @@ msgstr "" "もし、通常のメソッドの *self* や、クラスメソッドの *cls* がどこから来るの疑問" "に思っている人がいるとしたら、これがその答えになります!" -#: ../../howto/descriptor.rst:1266 +#: ../../howto/descriptor.rst:1181 msgid "Kinds of methods" msgstr "メソッドの種類" -#: ../../howto/descriptor.rst:1268 +#: ../../howto/descriptor.rst:1183 msgid "" "Non-data descriptors provide a simple mechanism for variations on the usual " "patterns of binding functions into methods." @@ -1544,63 +1087,67 @@ msgstr "" "非データデスクリプタは、関数をメソッドに束縛する、各種の一般的なパターンに、" "単純な機構を提供します。" -#: ../../howto/descriptor.rst:1271 +#: ../../howto/descriptor.rst:1186 msgid "" -"To recap, functions have a :meth:`~object.__get__` method so that they can " -"be converted to a method when accessed as attributes. The non-data " -"descriptor transforms an ``obj.f(*args)`` call into ``f(obj, *args)``. " -"Calling ``cls.f(*args)`` becomes ``f(*args)``." +"To recap, functions have a :meth:`__get__` method so that they can be " +"converted to a method when accessed as attributes. The non-data descriptor " +"transforms an ``obj.f(*args)`` call into ``f(obj, *args)``. Calling ``cls." +"f(*args)`` becomes ``f(*args)``." msgstr "" +"まとめると、関数は :meth:`__get__` メソッドを持ち、属性としてアクセスされたと" +"き、メソッドに変換されます。この非データディスクリプタは、 ``obj.f(*args)`` " +"の呼び出しを ``f(obj, *args)`` に変換します。 ``cls.f(*args)`` を呼び出すと " +"``f(*args)`` になります。" -#: ../../howto/descriptor.rst:1276 +#: ../../howto/descriptor.rst:1191 msgid "This chart summarizes the binding and its two most useful variants:" msgstr "このチャートは、束縛と、その 2 つの異なる便利な形をまとめています:" -#: ../../howto/descriptor.rst:1279 +#: ../../howto/descriptor.rst:1194 msgid "Transformation" msgstr "変換" -#: ../../howto/descriptor.rst:1279 +#: ../../howto/descriptor.rst:1194 msgid "Called from an object" msgstr "オブジェクトから呼び出される" -#: ../../howto/descriptor.rst:1279 +#: ../../howto/descriptor.rst:1194 msgid "Called from a class" msgstr "クラスから呼び出される" -#: ../../howto/descriptor.rst:1282 +#: ../../howto/descriptor.rst:1197 msgid "function" msgstr "関数" -#: ../../howto/descriptor.rst:1282 +#: ../../howto/descriptor.rst:1197 msgid "f(obj, \\*args)" msgstr "f(obj, \\*args)" -#: ../../howto/descriptor.rst:1282 ../../howto/descriptor.rst:1284 +#: ../../howto/descriptor.rst:1197 ../../howto/descriptor.rst:1199 msgid "f(\\*args)" msgstr "f(\\*args)" -#: ../../howto/descriptor.rst:1284 +#: ../../howto/descriptor.rst:1199 msgid "staticmethod" msgstr "静的メソッド" -#: ../../howto/descriptor.rst:1286 +#: ../../howto/descriptor.rst:1201 msgid "classmethod" msgstr "クラスメソッド" -#: ../../howto/descriptor.rst:1286 +#: ../../howto/descriptor.rst:1201 msgid "f(type(obj), \\*args)" msgstr "f(type(obj), \\*args)" -#: ../../howto/descriptor.rst:1286 +#: ../../howto/descriptor.rst:1201 msgid "f(cls, \\*args)" msgstr "f(cls, \\*args)" -#: ../../howto/descriptor.rst:1291 +#: ../../howto/descriptor.rst:1206 msgid "Static methods" msgstr "静的メソッド" -#: ../../howto/descriptor.rst:1293 +#: ../../howto/descriptor.rst:1208 msgid "" "Static methods return the underlying function without changes. Calling " "either ``c.f`` or ``C.f`` is the equivalent of a direct lookup into ``object." @@ -1613,14 +1160,14 @@ msgstr "" "\"f\")`` を直接探索するのと同じです。結果として、関数はオブジェクトとクラスか" "ら同じようにアクセスできます。" -#: ../../howto/descriptor.rst:1299 +#: ../../howto/descriptor.rst:1214 msgid "" "Good candidates for static methods are methods that do not reference the " "``self`` variable." msgstr "" "静的メソッドにすると良いのは、 ``self`` 変数への参照を持たないメソッドです。" -#: ../../howto/descriptor.rst:1302 +#: ../../howto/descriptor.rst:1217 msgid "" "For instance, a statistics package may include a container class for " "experimental data. The class provides normal methods for computing the " @@ -1629,33 +1176,23 @@ msgid "" "but do not depend on the data. For instance, ``erf(x)`` is handy conversion " "routine that comes up in statistical work but does not directly depend on a " "particular dataset. It can be called either from an object or the class: " -"``s.erf(1.5) --> 0.9332`` or ``Sample.erf(1.5) --> 0.9332``." +"``s.erf(1.5) --> .9332`` or ``Sample.erf(1.5) --> .9332``." msgstr "" +"例えば、統計パッケージに、実験データのコンテナがあるとします。そのクラスは、" +"平均、メジアン、その他の、データに依る記述統計を計算する標準メソッドを提供し" +"ます。しかし、概念上は関係があっても、データには依らないような便利な関数もあ" +"ります。例えば、 ``erf(x)`` は統計上の便利な変換ルーチンですが、特定のデータ" +"セットに直接には依存しません。これは、オブジェクトからでもクラスからでも呼び" +"出せます: ``s.erf(1.5) --> .9332`` または ``Sample.erf(1.5) --> .9332`` 。" -#: ../../howto/descriptor.rst:1311 +#: ../../howto/descriptor.rst:1226 msgid "" "Since static methods return the underlying function with no changes, the " "example calls are unexciting:" msgstr "" "静的メソッドは下にある関数をそのまま返すので、呼び出しの例は面白くありません:" -#: ../../howto/descriptor.rst:1314 -msgid "" -"class E:\n" -" @staticmethod\n" -" def f(x):\n" -" return x * 10" -msgstr "" - -#: ../../howto/descriptor.rst:1321 -msgid "" -">>> E.f(3)\n" -"30\n" -">>> E().f(3)\n" -"30" -msgstr "" - -#: ../../howto/descriptor.rst:1328 +#: ../../howto/descriptor.rst:1243 msgid "" "Using the non-data descriptor protocol, a pure Python version of :func:" "`staticmethod` would look like this:" @@ -1663,42 +1200,11 @@ msgstr "" "非データデスクリプタプロトコルを使うと、pure Python 版の :func:" "`staticmethod` は以下のようになります:" -#: ../../howto/descriptor.rst:1331 -msgid "" -"import functools\n" -"\n" -"class StaticMethod:\n" -" \"Emulate PyStaticMethod_Type() in Objects/funcobject.c\"\n" -"\n" -" def __init__(self, f):\n" -" self.f = f\n" -" functools.update_wrapper(self, f)\n" -"\n" -" def __get__(self, obj, objtype=None):\n" -" return self.f\n" -"\n" -" def __call__(self, *args, **kwds):\n" -" return self.f(*args, **kwds)\n" -"\n" -" @property\n" -" def __annotations__(self):\n" -" return self.f.__annotations__" -msgstr "" - -#: ../../howto/descriptor.rst:1352 -msgid "" -"The :func:`functools.update_wrapper` call adds a ``__wrapped__`` attribute " -"that refers to the underlying function. Also it carries forward the " -"attributes necessary to make the wrapper look like the wrapped function, " -"including :attr:`~function.__name__`, :attr:`~function.__qualname__`, and :" -"attr:`~function.__doc__`." -msgstr "" - -#: ../../howto/descriptor.rst:1421 +#: ../../howto/descriptor.rst:1275 msgid "Class methods" msgstr "クラスメソッド" -#: ../../howto/descriptor.rst:1423 +#: ../../howto/descriptor.rst:1277 msgid "" "Unlike static methods, class methods prepend the class reference to the " "argument list before calling the function. This format is the same for " @@ -1708,23 +1214,7 @@ msgstr "" "ストの先頭に加えます。このフォーマットは、呼び出し元がオブジェクトでもクラス" "でも同じです:" -#: ../../howto/descriptor.rst:1427 -msgid "" -"class F:\n" -" @classmethod\n" -" def f(cls, x):\n" -" return cls.__name__, x" -msgstr "" - -#: ../../howto/descriptor.rst:1434 -msgid "" -">>> F.f(3)\n" -"('F', 3)\n" -">>> F().f(3)\n" -"('F', 3)" -msgstr "" - -#: ../../howto/descriptor.rst:1441 +#: ../../howto/descriptor.rst:1295 msgid "" "This behavior is useful whenever the method only needs to have a class " "reference and does not rely on data stored in a specific instance. One use " @@ -1737,32 +1227,11 @@ msgstr "" "クラスコンストラクタを作ることです。例えば、クラスメソッド :func:`dict." "fromkeys` は新しい辞書をキーのリストから生成します。等価な pure Python 版は:" -#: ../../howto/descriptor.rst:1447 -msgid "" -"class Dict(dict):\n" -" @classmethod\n" -" def fromkeys(cls, iterable, value=None):\n" -" \"Emulate dict_fromkeys() in Objects/dictobject.c\"\n" -" d = cls()\n" -" for key in iterable:\n" -" d[key] = value\n" -" return d" -msgstr "" - -#: ../../howto/descriptor.rst:1458 +#: ../../howto/descriptor.rst:1312 msgid "Now a new dictionary of unique keys can be constructed like this:" msgstr "これで一意なキーを持つ新しい辞書が以下のように構成できます:" -#: ../../howto/descriptor.rst:1460 -msgid "" -">>> d = Dict.fromkeys('abracadabra')\n" -">>> type(d) is Dict\n" -"True\n" -">>> d\n" -"{'a': None, 'b': None, 'r': None, 'c': None, 'd': None}" -msgstr "" - -#: ../../howto/descriptor.rst:1468 +#: ../../howto/descriptor.rst:1322 msgid "" "Using the non-data descriptor protocol, a pure Python version of :func:" "`classmethod` would look like this:" @@ -1770,43 +1239,22 @@ msgstr "" "非データデスクリプタプロトコルを使った、 :func:`classmethod` の pure Python " "版はこのようになります:" -#: ../../howto/descriptor.rst:1471 -msgid "" -"import functools\n" -"\n" -"class ClassMethod:\n" -" \"Emulate PyClassMethod_Type() in Objects/funcobject.c\"\n" -"\n" -" def __init__(self, f):\n" -" self.f = f\n" -" functools.update_wrapper(self, f)\n" -"\n" -" def __get__(self, obj, cls=None):\n" -" if cls is None:\n" -" cls = type(obj)\n" -" return MethodType(self.f, cls)" -msgstr "" - -#: ../../howto/descriptor.rst:1533 -msgid "" -"The :func:`functools.update_wrapper` call in ``ClassMethod`` adds a " -"``__wrapped__`` attribute that refers to the underlying function. Also it " -"carries forward the attributes necessary to make the wrapper look like the " -"wrapped function: :attr:`~function.__name__`, :attr:`~function." -"__qualname__`, :attr:`~function.__doc__`, and :attr:`~function." -"__annotations__`." -msgstr "" -"``ClassMethod`` 内の :func:`functools.update_wrapper` の呼び出しは、根底にあ" -"る関数を参照する ``__wrapped__`` 属性を追加します。また、ラッパーがそのラップ" -"された関数のように見えるよう、必要な属性を追加します: :attr:`~function." -"__name__` 、 :attr:`~function.__qualname__` 、 :attr:`~function.__doc__` 、 :" -"attr:`~function.__annotations__` 。" - -#: ../../howto/descriptor.rst:1542 +#: ../../howto/descriptor.rst:1371 +msgid "" +"The code path for ``hasattr(type(self.f), '__get__')`` was added in Python " +"3.9 and makes it possible for :func:`classmethod` to support chained " +"decorators. For example, a classmethod and property could be chained " +"together:" +msgstr "" +"``hasattr(type(self.f), '__get__')`` へのコードパスがPython 3.9で追加されたお" +"かげで、 :func:`classmethod` がチェーンされたデコレータがサポート可能になりま" +"した。例えば、クラスメソッドとプロパティを一緒に利用できます。" + +#: ../../howto/descriptor.rst:1391 msgid "Member objects and __slots__" msgstr "メンバーオブジェクトと __slots__" -#: ../../howto/descriptor.rst:1544 +#: ../../howto/descriptor.rst:1393 msgid "" "When a class defines ``__slots__``, it replaces instance dictionaries with a " "fixed-length array of slot values. From a user point of view that has " @@ -1816,7 +1264,7 @@ msgstr "" "の配列と置き換えられます。ユーザーの目線からみると、いくつかの変化がありま" "す。" -#: ../../howto/descriptor.rst:1548 +#: ../../howto/descriptor.rst:1397 msgid "" "1. Provides immediate detection of bugs due to misspelled attribute " "assignments. Only attribute names specified in ``__slots__`` are allowed:" @@ -1824,22 +1272,7 @@ msgstr "" "1. 属性のアサイン時に、すぐにミススペルが原因のバグが検知される。 " "``__slots__`` で指定された属性名だけが許可されます:" -#: ../../howto/descriptor.rst:1551 -msgid "" -"class Vehicle:\n" -" __slots__ = ('id_number', 'make', 'model')" -msgstr "" - -#: ../../howto/descriptor.rst:1556 -msgid "" -">>> auto = Vehicle()\n" -">>> auto.id_nubmer = 'VYE483814LQEX'\n" -"Traceback (most recent call last):\n" -" ...\n" -"AttributeError: 'Vehicle' object has no attribute 'id_nubmer'" -msgstr "" - -#: ../../howto/descriptor.rst:1564 +#: ../../howto/descriptor.rst:1413 msgid "" "2. Helps create immutable objects where descriptors manage access to private " "attributes stored in ``__slots__``:" @@ -1847,42 +1280,7 @@ msgstr "" "2. デスクリプタが ``__slots__`` に格納されたプライベートな属性へのアクセスを" "制御するような、イミュータブルオブジェクトが作りやすくなる。" -#: ../../howto/descriptor.rst:1567 -msgid "" -"class Immutable:\n" -"\n" -" __slots__ = ('_dept', '_name') # Replace the instance " -"dictionary\n" -"\n" -" def __init__(self, dept, name):\n" -" self._dept = dept # Store to private attribute\n" -" self._name = name # Store to private attribute\n" -"\n" -" @property # Read-only descriptor\n" -" def dept(self):\n" -" return self._dept\n" -"\n" -" @property\n" -" def name(self): # Read-only descriptor\n" -" return self._name" -msgstr "" - -#: ../../howto/descriptor.rst:1585 -msgid "" -">>> mark = Immutable('Botany', 'Mark Watney')\n" -">>> mark.dept\n" -"'Botany'\n" -">>> mark.dept = 'Space Pirate'\n" -"Traceback (most recent call last):\n" -" ...\n" -"AttributeError: property 'dept' of 'Immutable' object has no setter\n" -">>> mark.location = 'Mars'\n" -"Traceback (most recent call last):\n" -" ...\n" -"AttributeError: 'Immutable' object has no attribute 'location'" -msgstr "" - -#: ../../howto/descriptor.rst:1599 +#: ../../howto/descriptor.rst:1448 msgid "" "3. Saves memory. On a 64-bit Linux build, an instance with two attributes " "takes 48 bytes with ``__slots__`` and 152 bytes without. This `flyweight " @@ -1895,44 +1293,13 @@ msgstr "" "Flyweight_%E3%83%91%E3%82%BF%E3%83%BC%E3%83%B3>`_ は大量のインスタンスを作成" "するときにのみ問題になります。" -#: ../../howto/descriptor.rst:1604 -msgid "" -"4. Improves speed. Reading instance variables is 35% faster with " -"``__slots__`` (as measured with Python 3.10 on an Apple M1 processor)." -msgstr "" -"4. 速度の改善。 ``__slots__`` を使うとインスタンス変数の読み込み速度が35%早く" -"なります(Apple M1プロセッサで動作させたPython 3.10で測定)" - -#: ../../howto/descriptor.rst:1607 +#: ../../howto/descriptor.rst:1453 msgid "" -"5. Blocks tools like :func:`functools.cached_property` which require an " +"4. Blocks tools like :func:`functools.cached_property` which require an " "instance dictionary to function correctly:" msgstr "" -"5. :func:`functools.cached_property` のような、動作にインスタンス辞書が必要な" -"ツールが使えなくなる。" -#: ../../howto/descriptor.rst:1610 -msgid "" -"from functools import cached_property\n" -"\n" -"class CP:\n" -" __slots__ = () # Eliminates the instance dict\n" -"\n" -" @cached_property # Requires an instance dict\n" -" def pi(self):\n" -" return 4 * sum((-1.0)**n / (2.0*n + 1.0)\n" -" for n in reversed(range(100_000)))" -msgstr "" - -#: ../../howto/descriptor.rst:1622 -msgid "" -">>> CP().pi\n" -"Traceback (most recent call last):\n" -" ...\n" -"TypeError: No '__dict__' attribute on 'CP' instance to cache 'pi' property." -msgstr "" - -#: ../../howto/descriptor.rst:1629 +#: ../../howto/descriptor.rst:1475 msgid "" "It is not possible to create an exact drop-in pure Python version of " "``__slots__`` because it requires direct access to C structures and control " @@ -1947,66 +1314,15 @@ msgstr "" "レートすることはできます。そのプライベートな構造体への読み書きはメンバーのデ" "スクリプタによって管理されます。" -#: ../../howto/descriptor.rst:1636 -msgid "" -"null = object()\n" -"\n" -"class Member:\n" -"\n" -" def __init__(self, name, clsname, offset):\n" -" 'Emulate PyMemberDef in Include/structmember.h'\n" -" # Also see descr_new() in Objects/descrobject.c\n" -" self.name = name\n" -" self.clsname = clsname\n" -" self.offset = offset\n" -"\n" -" def __get__(self, obj, objtype=None):\n" -" 'Emulate member_get() in Objects/descrobject.c'\n" -" # Also see PyMember_GetOne() in Python/structmember.c\n" -" if obj is None:\n" -" return self\n" -" value = obj._slotvalues[self.offset]\n" -" if value is null:\n" -" raise AttributeError(self.name)\n" -" return value\n" -"\n" -" def __set__(self, obj, value):\n" -" 'Emulate member_set() in Objects/descrobject.c'\n" -" obj._slotvalues[self.offset] = value\n" -"\n" -" def __delete__(self, obj):\n" -" 'Emulate member_delete() in Objects/descrobject.c'\n" -" value = obj._slotvalues[self.offset]\n" -" if value is null:\n" -" raise AttributeError(self.name)\n" -" obj._slotvalues[self.offset] = null\n" -"\n" -" def __repr__(self):\n" -" 'Emulate member_repr() in Objects/descrobject.c'\n" -" return f''" -msgstr "" - -#: ../../howto/descriptor.rst:1674 -msgid "" -"The :meth:`!type.__new__` method takes care of adding member objects to " -"class variables:" -msgstr "" - -#: ../../howto/descriptor.rst:1677 -msgid "" -"class Type(type):\n" -" 'Simulate how the type metaclass adds member objects for slots'\n" -"\n" -" def __new__(mcls, clsname, bases, mapping, **kwargs):\n" -" 'Emulate type_new() in Objects/typeobject.c'\n" -" # type_new() calls PyTypeReady() which calls add_methods()\n" -" slot_names = mapping.get('slot_names', [])\n" -" for offset, name in enumerate(slot_names):\n" -" mapping[name] = Member(name, clsname, offset)\n" -" return type.__new__(mcls, clsname, bases, mapping, **kwargs)" -msgstr "" - -#: ../../howto/descriptor.rst:1690 +#: ../../howto/descriptor.rst:1518 +msgid "" +"The :meth:`type.__new__` method takes care of adding member objects to class " +"variables:" +msgstr "" +":meth:`type.__new__` メソッドはクラス変数へのメンバーオブジェクトの追加を処理" +"します。" + +#: ../../howto/descriptor.rst:1534 msgid "" "The :meth:`object.__new__` method takes care of creating instances that have " "slots instead of an instance dictionary. Here is a rough simulation in pure " @@ -2016,75 +1332,21 @@ msgstr "" "スタンスの作成の処理をします。おおざっぱにピュアPythonでのシミュレーションし" "たコードがこちらです。" -#: ../../howto/descriptor.rst:1694 -msgid "" -"class Object:\n" -" 'Simulate how object.__new__() allocates memory for __slots__'\n" -"\n" -" def __new__(cls, *args, **kwargs):\n" -" 'Emulate object_new() in Objects/typeobject.c'\n" -" inst = super().__new__(cls)\n" -" if hasattr(cls, 'slot_names'):\n" -" empty_slots = [null] * len(cls.slot_names)\n" -" object.__setattr__(inst, '_slotvalues', empty_slots)\n" -" return inst\n" -"\n" -" def __setattr__(self, name, value):\n" -" 'Emulate _PyObject_GenericSetAttrWithDict() Objects/object.c'\n" -" cls = type(self)\n" -" if hasattr(cls, 'slot_names') and name not in cls.slot_names:\n" -" raise AttributeError(\n" -" f'{cls.__name__!r} object has no attribute {name!r}'\n" -" )\n" -" super().__setattr__(name, value)\n" -"\n" -" def __delattr__(self, name):\n" -" 'Emulate _PyObject_GenericSetAttrWithDict() Objects/object.c'\n" -" cls = type(self)\n" -" if hasattr(cls, 'slot_names') and name not in cls.slot_names:\n" -" raise AttributeError(\n" -" f'{cls.__name__!r} object has no attribute {name!r}'\n" -" )\n" -" super().__delattr__(name)" -msgstr "" - -#: ../../howto/descriptor.rst:1725 -msgid "" -"To use the simulation in a real class, just inherit from :class:`!Object` " -"and set the :term:`metaclass` to :class:`Type`:" -msgstr "" - -#: ../../howto/descriptor.rst:1728 -msgid "" -"class H(Object, metaclass=Type):\n" -" 'Instance variables stored in slots'\n" -"\n" -" slot_names = ['x', 'y']\n" -"\n" -" def __init__(self, x, y):\n" -" self.x = x\n" -" self.y = y" -msgstr "" - -#: ../../howto/descriptor.rst:1739 +#: ../../howto/descriptor.rst:1569 msgid "" -"At this point, the metaclass has loaded member objects for *x* and *y*::" +"To use the simulation in a real class, just inherit from :class:`Object` and " +"set the :term:`metaclass` to :class:`Type`:" msgstr "" -"この時点ではメタクラスは *x* と *y* のメンバーオブジェクトをロードします。" +"実際のクラスでシミュレーションコードを利用するには、 :class:`Object` を継承" +"し、 :term:`metaclass` を :class:`Type` にします。" -#: ../../howto/descriptor.rst:1741 +#: ../../howto/descriptor.rst:1583 msgid "" -">>> from pprint import pp\n" -">>> pp(dict(vars(H)))\n" -"{'__module__': '__main__',\n" -" '__doc__': 'Instance variables stored in slots',\n" -" 'slot_names': ['x', 'y'],\n" -" '__init__': ,\n" -" 'x': ,\n" -" 'y': }" +"At this point, the metaclass has loaded member objects for *x* and *y*::" msgstr "" +"この時点ではメタクラスは *x* と *y* のメンバーオブジェクトをロードします。" -#: ../../howto/descriptor.rst:1760 +#: ../../howto/descriptor.rst:1604 msgid "" "When instances are created, they have a ``slot_values`` list where the " "attributes are stored:" @@ -2092,24 +1354,6 @@ msgstr "" "インスタンスが作成されると、属性が保持される ``slot_values`` のリストをイン" "スタンスが保持します:" -#: ../../howto/descriptor.rst:1763 -msgid "" -">>> h = H(10, 20)\n" -">>> vars(h)\n" -"{'_slotvalues': [10, 20]}\n" -">>> h.x = 55\n" -">>> vars(h)\n" -"{'_slotvalues': [55, 20]}" -msgstr "" - -#: ../../howto/descriptor.rst:1772 +#: ../../howto/descriptor.rst:1616 msgid "Misspelled or unassigned attributes will raise an exception:" msgstr "スペルミスや、未アサインの属性は例外を送出します。" - -#: ../../howto/descriptor.rst:1774 -msgid "" -">>> h.xz\n" -"Traceback (most recent call last):\n" -" ...\n" -"AttributeError: 'H' object has no attribute 'xz'" -msgstr "" diff --git a/howto/enum.po b/howto/enum.po deleted file mode 100644 index 2edce51fe..000000000 --- a/howto/enum.po +++ /dev/null @@ -1,2559 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation -# This file is distributed under the same license as the Python package. -# FIRST AUTHOR , YEAR. -# -# Translators: -# tomo, 2021 -# 渋川よしき , 2021 -# Takanori Suzuki , 2023 -# souma987, 2023 -# Yosuke Miyashita, 2024 -# Arihiro TAKASE, 2024 -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: Python 3.14\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-30 14:22+0000\n" -"PO-Revision-Date: 2021-06-28 00:53+0000\n" -"Last-Translator: Arihiro TAKASE, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" -"ja/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#: ../../howto/enum.rst:5 -msgid "Enum HOWTO" -msgstr "列挙型 HOWTO" - -#: ../../howto/enum.rst:11 -msgid "" -"An :class:`Enum` is a set of symbolic names bound to unique values. They " -"are similar to global variables, but they offer a more useful :func:`repr`, " -"grouping, type-safety, and a few other features." -msgstr "" -":class:`Enum` は、ユニークな値に束縛されたシンボル名の集合です。グローバル変" -"数に似ていますが、 :func:`repr` がより便利だったり、グルーピングの機能、型安" -"全などいくつかの機能があります。" - -#: ../../howto/enum.rst:15 -msgid "" -"They are most useful when you have a variable that can take one of a limited " -"selection of values. For example, the days of the week::" -msgstr "" -"これらは、限られた選択肢の値の一つを取る変数がある場合に便利です。例えば、曜" -"日情報があります:" - -#: ../../howto/enum.rst:18 -msgid "" -">>> from enum import Enum\n" -">>> class Weekday(Enum):\n" -"... MONDAY = 1\n" -"... TUESDAY = 2\n" -"... WEDNESDAY = 3\n" -"... THURSDAY = 4\n" -"... FRIDAY = 5\n" -"... SATURDAY = 6\n" -"... SUNDAY = 7" -msgstr "" - -#: ../../howto/enum.rst:28 -msgid "Or perhaps the RGB primary colors::" -msgstr "あるいは、RGB三原色でも構いません::" - -#: ../../howto/enum.rst:30 -msgid "" -">>> from enum import Enum\n" -">>> class Color(Enum):\n" -"... RED = 1\n" -"... GREEN = 2\n" -"... BLUE = 3" -msgstr "" - -#: ../../howto/enum.rst:36 -msgid "" -"As you can see, creating an :class:`Enum` is as simple as writing a class " -"that inherits from :class:`Enum` itself." -msgstr "" -"ご覧の通り、 :class:`Enum` の作成は :class:`Enum` 自体を継承するクラスを作成" -"するのと同じくらい簡単です。" - -#: ../../howto/enum.rst:39 -msgid "Case of Enum Members" -msgstr "Enumメンバーは大文字/小文字?" - -#: ../../howto/enum.rst:41 -msgid "" -"Because Enums are used to represent constants, and to help avoid issues with " -"name clashes between mixin-class methods/attributes and enum names, we " -"strongly recommend using UPPER_CASE names for members, and will be using " -"that style in our examples." -msgstr "" -"列挙型は定数を表すために使われるため、また mixin クラスのメソッドや属性との名" -"前の衝突の問題を回避するため、メンバには UPPER_CASE の名前を使うことが強く推" -"奨されており、例でもこのスタイルを用います。" - -#: ../../howto/enum.rst:46 -msgid "" -"Depending on the nature of the enum a member's value may or may not be " -"important, but either way that value can be used to get the corresponding " -"member::" -msgstr "" -"列挙型の性質によって、メンバの値は重要な場合とそうでない場合がありますが、い" -"ずれの場合でも、その値は対応するメンバを取得するのに使えます::" - -#: ../../howto/enum.rst:50 -msgid "" -">>> Weekday(3)\n" -"" -msgstr "" - -#: ../../howto/enum.rst:53 -msgid "" -"As you can see, the ``repr()`` of a member shows the enum name, the member " -"name, and the value. The ``str()`` of a member shows only the enum name and " -"member name::" -msgstr "" -"ご覧の通り、メンバの ``repr()`` は列挙型の名前、メンバの名前、そして値を表示" -"します。メンバの ``str()`` は列挙型の名前とメンバの名前のみを表示します。" - -#: ../../howto/enum.rst:57 -msgid "" -">>> print(Weekday.THURSDAY)\n" -"Weekday.THURSDAY" -msgstr "" - -#: ../../howto/enum.rst:60 -msgid "The *type* of an enumeration member is the enum it belongs to::" -msgstr "列挙型のメンバの型はそのメンバの属する列挙型です::" - -#: ../../howto/enum.rst:62 -msgid "" -">>> type(Weekday.MONDAY)\n" -"\n" -">>> isinstance(Weekday.FRIDAY, Weekday)\n" -"True" -msgstr "" - -#: ../../howto/enum.rst:67 -msgid "Enum members have an attribute that contains just their :attr:`!name`::" -msgstr "" - -#: ../../howto/enum.rst:69 -msgid "" -">>> print(Weekday.TUESDAY.name)\n" -"TUESDAY" -msgstr "" - -#: ../../howto/enum.rst:72 -msgid "Likewise, they have an attribute for their :attr:`!value`::" -msgstr "" - -#: ../../howto/enum.rst:75 -msgid "" -">>> Weekday.WEDNESDAY.value\n" -"3" -msgstr "" - -#: ../../howto/enum.rst:78 -msgid "" -"Unlike many languages that treat enumerations solely as name/value pairs, " -"Python Enums can have behavior added. For example, :class:`datetime.date` " -"has two methods for returning the weekday: :meth:`~datetime.date.weekday` " -"and :meth:`~datetime.date.isoweekday`. The difference is that one of them " -"counts from 0-6 and the other from 1-7. Rather than keep track of that " -"ourselves we can add a method to the :class:`!Weekday` enum to extract the " -"day from the :class:`~datetime.date` instance and return the matching enum " -"member::" -msgstr "" - -#: ../../howto/enum.rst:87 -msgid "" -"@classmethod\n" -"def from_date(cls, date):\n" -" return cls(date.isoweekday())" -msgstr "" - -#: ../../howto/enum.rst:91 -msgid "The complete :class:`!Weekday` enum now looks like this::" -msgstr "" - -#: ../../howto/enum.rst:93 -msgid "" -">>> class Weekday(Enum):\n" -"... MONDAY = 1\n" -"... TUESDAY = 2\n" -"... WEDNESDAY = 3\n" -"... THURSDAY = 4\n" -"... FRIDAY = 5\n" -"... SATURDAY = 6\n" -"... SUNDAY = 7\n" -"... #\n" -"... @classmethod\n" -"... def from_date(cls, date):\n" -"... return cls(date.isoweekday())" -msgstr "" - -#: ../../howto/enum.rst:106 -msgid "Now we can find out what today is! Observe::" -msgstr "さて、これで今日が何曜日か調べることができます! 見てみましょう::" - -#: ../../howto/enum.rst:108 -msgid "" -">>> from datetime import date\n" -">>> Weekday.from_date(date.today())\n" -"" -msgstr "" - -#: ../../howto/enum.rst:112 -msgid "" -"Of course, if you're reading this on some other day, you'll see that day " -"instead." -msgstr "" -"もちろん、あなたがこれを読んでいるのが他の曜日ならば、その曜日が代わりに表示" -"されます。" - -#: ../../howto/enum.rst:114 -msgid "" -"This :class:`!Weekday` enum is great if our variable only needs one day, but " -"what if we need several? Maybe we're writing a function to plot chores " -"during a week, and don't want to use a :class:`list` -- we could use a " -"different type of :class:`Enum`::" -msgstr "" - -#: ../../howto/enum.rst:119 -msgid "" -">>> from enum import Flag\n" -">>> class Weekday(Flag):\n" -"... MONDAY = 1\n" -"... TUESDAY = 2\n" -"... WEDNESDAY = 4\n" -"... THURSDAY = 8\n" -"... FRIDAY = 16\n" -"... SATURDAY = 32\n" -"... SUNDAY = 64" -msgstr "" - -#: ../../howto/enum.rst:129 -msgid "" -"We've changed two things: we're inherited from :class:`Flag`, and the values " -"are all powers of 2." -msgstr "" -"ここでは2つの変更が行われています。:class:`Flag` を継承している点と、値がすべ" -"て2の累乗である点です。" - -#: ../../howto/enum.rst:132 -msgid "" -"Just like the original :class:`!Weekday` enum above, we can have a single " -"selection::" -msgstr "" - -#: ../../howto/enum.rst:134 -msgid "" -">>> first_week_day = Weekday.MONDAY\n" -">>> first_week_day\n" -"" -msgstr "" - -#: ../../howto/enum.rst:138 -msgid "" -"But :class:`Flag` also allows us to combine several members into a single " -"variable::" -msgstr "" -"ただし、:class:`Flag` は複数のメンバーをひとつの変数にまとめることもできま" -"す::" - -#: ../../howto/enum.rst:141 -msgid "" -">>> weekend = Weekday.SATURDAY | Weekday.SUNDAY\n" -">>> weekend\n" -"" -msgstr "" - -#: ../../howto/enum.rst:145 -msgid "You can even iterate over a :class:`Flag` variable::" -msgstr ":class:`Flag` 変数は反復することもできます::" - -#: ../../howto/enum.rst:147 -msgid "" -">>> for day in weekend:\n" -"... print(day)\n" -"Weekday.SATURDAY\n" -"Weekday.SUNDAY" -msgstr "" - -#: ../../howto/enum.rst:152 -msgid "Okay, let's get some chores set up::" -msgstr "さて、いくつかの家事を設定してみましょう::" - -#: ../../howto/enum.rst:154 -msgid "" -">>> chores_for_ethan = {\n" -"... 'feed the cat': Weekday.MONDAY | Weekday.WEDNESDAY | Weekday." -"FRIDAY,\n" -"... 'do the dishes': Weekday.TUESDAY | Weekday.THURSDAY,\n" -"... 'answer SO questions': Weekday.SATURDAY,\n" -"... }" -msgstr "" - -#: ../../howto/enum.rst:160 -msgid "And a function to display the chores for a given day::" -msgstr "指定された日の家事を表示する関数も作成します::" - -#: ../../howto/enum.rst:162 -msgid "" -">>> def show_chores(chores, day):\n" -"... for chore, days in chores.items():\n" -"... if day in days:\n" -"... print(chore)\n" -"...\n" -">>> show_chores(chores_for_ethan, Weekday.SATURDAY)\n" -"answer SO questions" -msgstr "" - -#: ../../howto/enum.rst:170 -msgid "" -"In cases where the actual values of the members do not matter, you can save " -"yourself some work and use :func:`auto` for the values::" -msgstr "" -"メンバーの実際の値が重要でない場合は、:func:`auto` を使用することで手間を省く" -"ことができます::" - -#: ../../howto/enum.rst:173 -msgid "" -">>> from enum import auto\n" -">>> class Weekday(Flag):\n" -"... MONDAY = auto()\n" -"... TUESDAY = auto()\n" -"... WEDNESDAY = auto()\n" -"... THURSDAY = auto()\n" -"... FRIDAY = auto()\n" -"... SATURDAY = auto()\n" -"... SUNDAY = auto()\n" -"... WEEKEND = SATURDAY | SUNDAY" -msgstr "" - -#: ../../howto/enum.rst:189 -msgid "Programmatic access to enumeration members and their attributes" -msgstr "列挙型メンバーおよびそれらの属性へのプログラム的アクセス" - -#: ../../howto/enum.rst:191 -msgid "" -"Sometimes it's useful to access members in enumerations programmatically (i." -"e. situations where ``Color.RED`` won't do because the exact color is not " -"known at program-writing time). ``Enum`` allows such access::" -msgstr "" -"プログラム的にメンバーに番号でアクセスしたほうが便利な場合があります (すなわ" -"ち、プログラムを書いている時点で正確な色がまだわからなく、``Color.RED`` と書" -"くのが無理な場合など)。 ``Enum`` ではそのようなアクセスも可能です::" - -#: ../../howto/enum.rst:195 -msgid "" -">>> Color(1)\n" -"\n" -">>> Color(3)\n" -"" -msgstr "" - -#: ../../howto/enum.rst:200 -msgid "If you want to access enum members by *name*, use item access::" -msgstr "" -"列挙型メンバーに *名前* でアクセスしたい場合はアイテムとしてアクセスできま" -"す::" - -#: ../../howto/enum.rst:202 -msgid "" -">>> Color['RED']\n" -"\n" -">>> Color['GREEN']\n" -"" -msgstr "" - -#: ../../howto/enum.rst:207 -msgid "" -"If you have an enum member and need its :attr:`!name` or :attr:`!value`::" -msgstr "" - -#: ../../howto/enum.rst:209 -msgid "" -">>> member = Color.RED\n" -">>> member.name\n" -"'RED'\n" -">>> member.value\n" -"1" -msgstr "" - -#: ../../howto/enum.rst:217 -msgid "Duplicating enum members and values" -msgstr "列挙型メンバーと値の重複" - -#: ../../howto/enum.rst:219 -msgid "Having two enum members with the same name is invalid::" -msgstr "同じ名前の列挙型メンバーを複数持つことはできません::" - -#: ../../howto/enum.rst:221 -msgid "" -">>> class Shape(Enum):\n" -"... SQUARE = 2\n" -"... SQUARE = 3\n" -"...\n" -"Traceback (most recent call last):\n" -"...\n" -"TypeError: 'SQUARE' already defined as 2" -msgstr "" - -#: ../../howto/enum.rst:229 -msgid "" -"However, an enum member can have other names associated with it. Given two " -"entries ``A`` and ``B`` with the same value (and ``A`` defined first), ``B`` " -"is an alias for the member ``A``. By-value lookup of the value of ``A`` " -"will return the member ``A``. By-name lookup of ``A`` will return the " -"member ``A``. By-name lookup of ``B`` will also return the member ``A``::" -msgstr "" -"しかし、列挙型メンバー は、別の名前を持つことができます。 同じ値を持つ " -"``A`` と``B`` が与えられた場合(そして ``A`` が先に定義されている場合)、 " -"``B`` はメンバー ``A`` に対するエイリアスとなります。 ``A`` の値での検索で" -"は、メンバー ``A`` が返されます。 ``A`` の名前での検索ではメンバー ``A`` を" -"返します。``B`` の名前での検索も、メンバー ``A`` を返します::" - -#: ../../howto/enum.rst:235 -msgid "" -">>> class Shape(Enum):\n" -"... SQUARE = 2\n" -"... DIAMOND = 1\n" -"... CIRCLE = 3\n" -"... ALIAS_FOR_SQUARE = 2\n" -"...\n" -">>> Shape.SQUARE\n" -"\n" -">>> Shape.ALIAS_FOR_SQUARE\n" -"\n" -">>> Shape(2)\n" -"" -msgstr "" - -#: ../../howto/enum.rst:250 -msgid "" -"Attempting to create a member with the same name as an already defined " -"attribute (another member, a method, etc.) or attempting to create an " -"attribute with the same name as a member is not allowed." -msgstr "" -"すでに定義されている属性と同じ名前のメンバー (一方がメンバーでもう一方がメ" -"ソッド、など) の作成、あるいはメンバーと同じ名前の属性の作成はできません。" - -#: ../../howto/enum.rst:256 -msgid "Ensuring unique enumeration values" -msgstr "番号付けの値が一意であることの確認" - -#: ../../howto/enum.rst:258 -msgid "" -"By default, enumerations allow multiple names as aliases for the same value. " -"When this behavior isn't desired, you can use the :func:`unique` decorator::" -msgstr "" -"デフォルトでは、列挙型は同じ値のエイリアスとして複数の名前を許容します。この" -"振る舞いを望まない場合は、 :func:`unique` デコレータを使用できます::" - -#: ../../howto/enum.rst:261 -msgid "" -">>> from enum import Enum, unique\n" -">>> @unique\n" -"... class Mistake(Enum):\n" -"... ONE = 1\n" -"... TWO = 2\n" -"... THREE = 3\n" -"... FOUR = 3\n" -"...\n" -"Traceback (most recent call last):\n" -"...\n" -"ValueError: duplicate values found in : FOUR -> THREE" -msgstr "" - -#: ../../howto/enum.rst:275 -msgid "Using automatic values" -msgstr "値の自動設定を使う" - -#: ../../howto/enum.rst:277 -msgid "If the exact value is unimportant you can use :class:`auto`::" -msgstr "正確な値が重要でない場合、 :class:`auto` が使えます::" - -#: ../../howto/enum.rst:279 -msgid "" -">>> from enum import Enum, auto\n" -">>> class Color(Enum):\n" -"... RED = auto()\n" -"... BLUE = auto()\n" -"... GREEN = auto()\n" -"...\n" -">>> [member.value for member in Color]\n" -"[1, 2, 3]" -msgstr "" - -#: ../../howto/enum.rst:288 -msgid "" -"The values are chosen by :func:`~Enum._generate_next_value_`, which can be " -"overridden::" -msgstr "" - -#: ../../howto/enum.rst:291 -msgid "" -">>> class AutoName(Enum):\n" -"... @staticmethod\n" -"... def _generate_next_value_(name, start, count, last_values):\n" -"... return name\n" -"...\n" -">>> class Ordinal(AutoName):\n" -"... NORTH = auto()\n" -"... SOUTH = auto()\n" -"... EAST = auto()\n" -"... WEST = auto()\n" -"...\n" -">>> [member.value for member in Ordinal]\n" -"['NORTH', 'SOUTH', 'EAST', 'WEST']" -msgstr "" - -#: ../../howto/enum.rst:307 -msgid "" -"The :meth:`~Enum._generate_next_value_` method must be defined before any " -"members." -msgstr "" - -#: ../../howto/enum.rst:310 -msgid "Iteration" -msgstr "イテレーション" - -#: ../../howto/enum.rst:312 -msgid "Iterating over the members of an enum does not provide the aliases::" -msgstr "列挙型のメンバーのイテレートは別名をサポートしていません::" - -#: ../../howto/enum.rst:314 -msgid "" -">>> list(Shape)\n" -"[, , ]\n" -">>> list(Weekday)\n" -"[, , , , , , ]" -msgstr "" - -#: ../../howto/enum.rst:319 -msgid "" -"Note that the aliases ``Shape.ALIAS_FOR_SQUARE`` and ``Weekday.WEEKEND`` " -"aren't shown." -msgstr "" -"エイリアスである ``Shape.ALIAS_FOR_SQUARE`` と``Weekday.WEEKEND`` が表示され" -"ていないことに注意してください。" - -#: ../../howto/enum.rst:321 -msgid "" -"The special attribute ``__members__`` is a read-only ordered mapping of " -"names to members. It includes all names defined in the enumeration, " -"including the aliases::" -msgstr "" -"特殊属性 ``__members__`` は読み出し専用で、順序を保持した、対応する名前と列挙" -"型メンバーのマッピングです。これには別名も含め、列挙されたすべての名前が入っ" -"ています。" - -#: ../../howto/enum.rst:325 -msgid "" -">>> for name, member in Shape.__members__.items():\n" -"... name, member\n" -"...\n" -"('SQUARE', )\n" -"('DIAMOND', )\n" -"('CIRCLE', )\n" -"('ALIAS_FOR_SQUARE', )" -msgstr "" - -#: ../../howto/enum.rst:333 -msgid "" -"The ``__members__`` attribute can be used for detailed programmatic access " -"to the enumeration members. For example, finding all the aliases::" -msgstr "" -"属性 ``__members__`` は列挙型メンバーへの詳細なアクセスに使用できます。以下は" -"すべての別名を探す例です::" - -#: ../../howto/enum.rst:336 -msgid "" -">>> [name for name, member in Shape.__members__.items() if member.name != " -"name]\n" -"['ALIAS_FOR_SQUARE']" -msgstr "" - -#: ../../howto/enum.rst:341 -msgid "" -"Aliases for flags include values with multiple flags set, such as ``3``, and " -"no flags set, i.e. ``0``." -msgstr "" -"フラグのエイリアスには、 複数のフラグが設定された値(例えば ``3``)や、 フラ" -"グが設定されていない値(例えば ``0``)が含まれます。" - -#: ../../howto/enum.rst:346 -msgid "Comparisons" -msgstr "比較" - -#: ../../howto/enum.rst:348 -msgid "Enumeration members are compared by identity::" -msgstr "列挙型メンバーは同一性を比較できます::" - -#: ../../howto/enum.rst:350 -msgid "" -">>> Color.RED is Color.RED\n" -"True\n" -">>> Color.RED is Color.BLUE\n" -"False\n" -">>> Color.RED is not Color.BLUE\n" -"True" -msgstr "" - -#: ../../howto/enum.rst:357 -msgid "" -"Ordered comparisons between enumeration values are *not* supported. Enum " -"members are not integers (but see `IntEnum`_ below)::" -msgstr "" -"列挙型の値の順序の比較はサポートされて *いません*。Enum メンバーは整数ではあ" -"りません (`IntEnum`_ を参照してください)::" - -#: ../../howto/enum.rst:360 -msgid "" -">>> Color.RED < Color.BLUE\n" -"Traceback (most recent call last):\n" -" File \"\", line 1, in \n" -"TypeError: '<' not supported between instances of 'Color' and 'Color'" -msgstr "" - -#: ../../howto/enum.rst:365 -msgid "Equality comparisons are defined though::" -msgstr "ただし等価の比較は定義されています::" - -#: ../../howto/enum.rst:367 -msgid "" -">>> Color.BLUE == Color.RED\n" -"False\n" -">>> Color.BLUE != Color.RED\n" -"True\n" -">>> Color.BLUE == Color.BLUE\n" -"True" -msgstr "" - -#: ../../howto/enum.rst:374 -msgid "" -"Comparisons against non-enumeration values will always compare not equal " -"(again, :class:`IntEnum` was explicitly designed to behave differently, see " -"below)::" -msgstr "" -"非列挙型の値との比較は常に不等となります (繰り返しになりますが、:class:" -"`IntEnum` はこれと異なる挙動になるよう設計されています)::" - -#: ../../howto/enum.rst:378 -msgid "" -">>> Color.BLUE == 2\n" -"False" -msgstr "" - -#: ../../howto/enum.rst:383 -msgid "" -"It is possible to reload modules -- if a reloaded module contains enums, " -"they will be recreated, and the new members may not compare identical/equal " -"to the original members." -msgstr "" -"モジュールは再読み込みすることが可能です。再読み込みされたモジュールに列挙型" -"が含まれている場合、それらは再作成され、新しいメンバーは元のメンバーと同一で" -"ない/等しくない可能性があります。" - -#: ../../howto/enum.rst:388 -msgid "Allowed members and attributes of enumerations" -msgstr "列挙型で許されるメンバーと属性" - -#: ../../howto/enum.rst:390 -msgid "" -"Most of the examples above use integers for enumeration values. Using " -"integers is short and handy (and provided by default by the `Functional " -"API`_), but not strictly enforced. In the vast majority of use-cases, one " -"doesn't care what the actual value of an enumeration is. But if the value " -"*is* important, enumerations can have arbitrary values." -msgstr "" -"これまでのほとんどの例では、列挙型の値に整数を使用しています。 整数を使うの" -"は短くて便利(そして、 `関数 API`_ ではデフォルトで設定される)ですが、これは" -"強制されているわけではありません。大半の使用例では、列挙値の実際の値が何であ" -"るかは意識しません。しかし、値が重要な場合、列挙型は任意の値を持つことができ" -"ます。" - -#: ../../howto/enum.rst:396 -msgid "" -"Enumerations are Python classes, and can have methods and special methods as " -"usual. If we have this enumeration::" -msgstr "" -"列挙型は Python のクラスであり、通常どおりメソッドや特殊メソッドを持つことが" -"できます::" - -#: ../../howto/enum.rst:399 -msgid "" -">>> class Mood(Enum):\n" -"... FUNKY = 1\n" -"... HAPPY = 3\n" -"...\n" -"... def describe(self):\n" -"... # self is the member here\n" -"... return self.name, self.value\n" -"...\n" -"... def __str__(self):\n" -"... return 'my custom str! {0}'.format(self.value)\n" -"...\n" -"... @classmethod\n" -"... def favorite_mood(cls):\n" -"... # cls here is the enumeration\n" -"... return cls.HAPPY\n" -"..." -msgstr "" - -#: ../../howto/enum.rst:416 -msgid "Then::" -msgstr "上記の結果が以下のようになります::" - -#: ../../howto/enum.rst:418 -msgid "" -">>> Mood.favorite_mood()\n" -"\n" -">>> Mood.HAPPY.describe()\n" -"('HAPPY', 3)\n" -">>> str(Mood.FUNKY)\n" -"'my custom str! 1'" -msgstr "" - -#: ../../howto/enum.rst:425 -msgid "" -"The rules for what is allowed are as follows: names that start and end with " -"a single underscore are reserved by enum and cannot be used; all other " -"attributes defined within an enumeration will become members of this " -"enumeration, with the exception of special methods (:meth:`~object." -"__str__`, :meth:`~object.__add__`, etc.), descriptors (methods are also " -"descriptors), and variable names listed in :attr:`~Enum._ignore_`." -msgstr "" - -#: ../../howto/enum.rst:432 -msgid "" -"Note: if your enumeration defines :meth:`~object.__new__` and/or :meth:" -"`~object.__init__`, any value(s) given to the enum member will be passed " -"into those methods. See `Planet`_ for an example." -msgstr "" - -#: ../../howto/enum.rst:438 -msgid "" -"The :meth:`~object.__new__` method, if defined, is used during creation of " -"the Enum members; it is then replaced by Enum's :meth:`~object.__new__` " -"which is used after class creation for lookup of existing members. See :ref:" -"`new-vs-init` for more details." -msgstr "" - -#: ../../howto/enum.rst:445 -msgid "Restricted Enum subclassing" -msgstr "Enumのサブクラス化の制限" - -#: ../../howto/enum.rst:447 -msgid "" -"A new :class:`Enum` class must have one base enum class, up to one concrete " -"data type, and as many :class:`object`-based mixin classes as needed. The " -"order of these base classes is::" -msgstr "" -"新しい :class:`Enum` クラスは、ベースの enum クラスを1つ、具象データ型を1つ、" -"複数の :class:`object` ベースのミックスインクラスが許容されます。これらのベー" -"スクラスの順序は次の通りです::" - -#: ../../howto/enum.rst:451 -msgid "" -"class EnumName([mix-in, ...,] [data-type,] base-enum):\n" -" pass" -msgstr "" - -#: ../../howto/enum.rst:454 -msgid "" -"Also, subclassing an enumeration is allowed only if the enumeration does not " -"define any members. So this is forbidden::" -msgstr "" -"列挙型のサブクラスの作成はその列挙型にメンバーが一つも定義されていない場合の" -"み行なえます。従って以下は許されません::" - -#: ../../howto/enum.rst:457 -msgid "" -">>> class MoreColor(Color):\n" -"... PINK = 17\n" -"...\n" -"Traceback (most recent call last):\n" -"...\n" -"TypeError: cannot extend " -msgstr "" - -#: ../../howto/enum.rst:464 -msgid "But this is allowed::" -msgstr "以下のような場合は許されます::" - -#: ../../howto/enum.rst:466 -msgid "" -">>> class Foo(Enum):\n" -"... def some_behavior(self):\n" -"... pass\n" -"...\n" -">>> class Bar(Foo):\n" -"... HAPPY = 1\n" -"... SAD = 2\n" -"..." -msgstr "" - -#: ../../howto/enum.rst:475 -msgid "" -"Allowing subclassing of enums that define members would lead to a violation " -"of some important invariants of types and instances. On the other hand, it " -"makes sense to allow sharing some common behavior between a group of " -"enumerations. (See `OrderedEnum`_ for an example.)" -msgstr "" -"メンバーが定義された列挙型のサブクラス化を許可すると、いくつかのデータ型およ" -"びインスタンスの重要な不変条件の違反を引き起こします。とはいえ、それが許可さ" -"れると、列挙型のグループ間での共通の挙動を共有するという利点もあります。 " -"(`OrderedEnum`_ の例を参照してください。)" - -#: ../../howto/enum.rst:484 -msgid "Dataclass support" -msgstr "データクラスのサポート" - -#: ../../howto/enum.rst:486 -msgid "" -"When inheriting from a :class:`~dataclasses.dataclass`, the :meth:`~Enum." -"__repr__` omits the inherited class' name. For example::" -msgstr "" -":class:`~dataclasses.dataclass` を継承する場合、 :meth:`~Enum.__repr__` は継" -"承するクラス名を省略します。 例えば::" - -#: ../../howto/enum.rst:489 -msgid "" -">>> from dataclasses import dataclass, field\n" -">>> @dataclass\n" -"... class CreatureDataMixin:\n" -"... size: str\n" -"... legs: int\n" -"... tail: bool = field(repr=False, default=True)\n" -"...\n" -">>> class Creature(CreatureDataMixin, Enum):\n" -"... BEETLE = 'small', 6\n" -"... DOG = 'medium', 4\n" -"...\n" -">>> Creature.DOG\n" -"" -msgstr "" - -#: ../../howto/enum.rst:503 -msgid "" -"Use the :func:`~dataclasses.dataclass` argument ``repr=False`` to use the " -"standard :func:`repr`." -msgstr "" -"標準の :func:`repr` を使うには、:func:`~dataclasses.dataclass` の引数 " -"``repr=False`` を使用してください。" - -#: ../../howto/enum.rst:506 -msgid "" -"Only the dataclass fields are shown in the value area, not the dataclass' " -"name." -msgstr "" -"dataclass のフィールドだけが値の領域に表示され、dataclassの名前は表示されなく" -"なりました" - -#: ../../howto/enum.rst:512 -msgid "" -"Adding :func:`~dataclasses.dataclass` decorator to :class:`Enum` and its " -"subclasses is not supported. It will not raise any errors, but it will " -"produce very strange results at runtime, such as members being equal to each " -"other::" -msgstr "" -":class:`Enum` やそのサブクラスに :func:`~dataclasses.dataclass` デコレータを" -"加えることはサポートされていません。そうしてもエラーは送出されませんが、実行" -"時にそれぞれのメンバが互いに等しいなど、非常に奇妙な結果が起こります::" - -#: ../../howto/enum.rst:517 -msgid "" -">>> @dataclass # don't do this: it does not make any sense\n" -"... class Color(Enum):\n" -"... RED = 1\n" -"... BLUE = 2\n" -"...\n" -">>> Color.RED is Color.BLUE\n" -"False\n" -">>> Color.RED == Color.BLUE # problem is here: they should not be equal\n" -"True" -msgstr "" - -#: ../../howto/enum.rst:529 -msgid "Pickling" -msgstr "Pickle 化" - -#: ../../howto/enum.rst:531 -msgid "Enumerations can be pickled and unpickled::" -msgstr "列挙型は pickle 化と unpickle 化が行えます::" - -#: ../../howto/enum.rst:533 -msgid "" -">>> from test.test_enum import Fruit\n" -">>> from pickle import dumps, loads\n" -">>> Fruit.TOMATO is loads(dumps(Fruit.TOMATO))\n" -"True" -msgstr "" - -#: ../../howto/enum.rst:538 -msgid "" -"The usual restrictions for pickling apply: picklable enums must be defined " -"in the top level of a module, since unpickling requires them to be " -"importable from that module." -msgstr "" -"通常の pickle 化の制限事項が適用されます: pickle 可能な列挙型はモジュールの" -"トップレベルで定義されていなくてはならず、unpickle 化はモジュールからインポー" -"ト可能でなければなりません。" - -#: ../../howto/enum.rst:544 -msgid "" -"With pickle protocol version 4 it is possible to easily pickle enums nested " -"in other classes." -msgstr "" -"pickle プロトコルバージョン 4 では他のクラスで入れ子になった列挙型の pickle " -"化も容易です。" - -#: ../../howto/enum.rst:547 -msgid "" -"It is possible to modify how enum members are pickled/unpickled by defining :" -"meth:`~object.__reduce_ex__` in the enumeration class. The default method " -"is by-value, but enums with complicated values may want to use by-name::" -msgstr "" - -#: ../../howto/enum.rst:551 -msgid "" -">>> import enum\n" -">>> class MyEnum(enum.Enum):\n" -"... __reduce_ex__ = enum.pickle_by_enum_name" -msgstr "" - -#: ../../howto/enum.rst:557 -msgid "" -"Using by-name for flags is not recommended, as unnamed aliases will not " -"unpickle." -msgstr "" -"フラグに名前による pickle 化を使うことは、名前の無いエイリアスが unpickle 化" -"されないため推奨されません。" - -#: ../../howto/enum.rst:562 -msgid "Functional API" -msgstr "関数 API" - -#: ../../howto/enum.rst:564 -msgid "" -"The :class:`Enum` class is callable, providing the following functional API::" -msgstr "" -":class:`Enum` クラスは呼び出し可能で、以下の関数 API を提供しています::" - -#: ../../howto/enum.rst:566 -msgid "" -">>> Animal = Enum('Animal', 'ANT BEE CAT DOG')\n" -">>> Animal\n" -"\n" -">>> Animal.ANT\n" -"\n" -">>> list(Animal)\n" -"[, , , ]" -msgstr "" - -#: ../../howto/enum.rst:574 -msgid "" -"The semantics of this API resemble :class:`~collections.namedtuple`. The " -"first argument of the call to :class:`Enum` is the name of the enumeration." -msgstr "" -"この API の動作は :class:`~collections.namedtuple` と似ています。:class:" -"`Enum` 呼び出しの第 1 引数は列挙型の名前です。" - -#: ../../howto/enum.rst:577 -msgid "" -"The second argument is the *source* of enumeration member names. It can be " -"a whitespace-separated string of names, a sequence of names, a sequence of 2-" -"tuples with key/value pairs, or a mapping (e.g. dictionary) of names to " -"values. The last two options enable assigning arbitrary values to " -"enumerations; the others auto-assign increasing integers starting with 1 " -"(use the ``start`` parameter to specify a different starting value). A new " -"class derived from :class:`Enum` is returned. In other words, the above " -"assignment to :class:`!Animal` is equivalent to::" -msgstr "" - -#: ../../howto/enum.rst:586 -msgid "" -">>> class Animal(Enum):\n" -"... ANT = 1\n" -"... BEE = 2\n" -"... CAT = 3\n" -"... DOG = 4\n" -"..." -msgstr "" - -#: ../../howto/enum.rst:593 -msgid "" -"The reason for defaulting to ``1`` as the starting number and not ``0`` is " -"that ``0`` is ``False`` in a boolean sense, but by default enum members all " -"evaluate to ``True``." -msgstr "" -"``0`` ではなく``1`` をデフォルトの開始番号とする理由は、``0`` が真偽値として" -"は ``False`` であり、デフォルトの列挙メンバーはすべて ``True`` 評価されるよう" -"にするためである。" - -#: ../../howto/enum.rst:597 -msgid "" -"Pickling enums created with the functional API can be tricky as frame stack " -"implementation details are used to try and figure out which module the " -"enumeration is being created in (e.g. it will fail if you use a utility " -"function in a separate module, and also may not work on IronPython or " -"Jython). The solution is to specify the module name explicitly as follows::" -msgstr "" -"機能 API による Enum の pickle 化は、その列挙型がどのモジュールで作成されたか" -"を見つけ出すためにフレームスタックの実装の詳細が使われるので、トリッキーにな" -"ることがあります (例えば別のモジュールのユーティリティ関数を使うと失敗します" -"し、IronPython や Jython ではうまくいきません)。解決策は、以下のようにモ" -"ジュール名を明示的に指定することです::" - -#: ../../howto/enum.rst:603 -msgid ">>> Animal = Enum('Animal', 'ANT BEE CAT DOG', module=__name__)" -msgstr "" - -#: ../../howto/enum.rst:607 -msgid "" -"If ``module`` is not supplied, and Enum cannot determine what it is, the new " -"Enum members will not be unpicklable; to keep errors closer to the source, " -"pickling will be disabled." -msgstr "" -"``module`` が与えられない場合、Enum はそれがなにか決定できないため、新しい " -"Enum メンバーは unpickle 化できなくなります; エラーをソースの近いところで発生" -"させるため、pickle 化は無効になります。" - -#: ../../howto/enum.rst:611 -msgid "" -"The new pickle protocol 4 also, in some circumstances, relies on :attr:" -"`~type.__qualname__` being set to the location where pickle will be able to " -"find the class. For example, if the class was made available in class " -"SomeData in the global scope::" -msgstr "" - -#: ../../howto/enum.rst:616 -msgid "" -">>> Animal = Enum('Animal', 'ANT BEE CAT DOG', qualname='SomeData.Animal')" -msgstr "" - -#: ../../howto/enum.rst:618 -msgid "The complete signature is::" -msgstr "完全な構文は以下のようになります::" - -#: ../../howto/enum.rst:620 -msgid "" -"Enum(\n" -" value='NewEnumName',\n" -" names=<...>,\n" -" *,\n" -" module='...',\n" -" qualname='...',\n" -" type=,\n" -" start=1,\n" -" )" -msgstr "" - -#: ../../howto/enum.rst:630 -msgid "*value*: What the new enum class will record as its name." -msgstr "" - -#: ../../howto/enum.rst:632 -msgid "" -"*names*: The enum members. This can be a whitespace- or comma-separated " -"string (values will start at 1 unless otherwise specified)::" -msgstr "" -"*names*: enumのメンバー。 空白またはカンマで区切られた文字列 (値は特に指定が" -"ない限り1から始まります)::" - -#: ../../howto/enum.rst:635 -msgid "'RED GREEN BLUE' | 'RED,GREEN,BLUE' | 'RED, GREEN, BLUE'" -msgstr "" - -#: ../../howto/enum.rst:637 -msgid "or an iterator of names::" -msgstr "または名前のイテレータで指定もできます::" - -#: ../../howto/enum.rst:639 -msgid "['RED', 'GREEN', 'BLUE']" -msgstr "" - -#: ../../howto/enum.rst:641 -msgid "or an iterator of (name, value) pairs::" -msgstr "または (名前, 値) のペアのイテレータでも指定できます::" - -#: ../../howto/enum.rst:643 -msgid "[('CYAN', 4), ('MAGENTA', 5), ('YELLOW', 6)]" -msgstr "" - -#: ../../howto/enum.rst:645 -msgid "or a mapping::" -msgstr "またはマッピングでも指定できます::" - -#: ../../howto/enum.rst:647 -msgid "{'CHARTREUSE': 7, 'SEA_GREEN': 11, 'ROSEMARY': 42}" -msgstr "" - -#: ../../howto/enum.rst:649 -msgid "*module*: name of module where new enum class can be found." -msgstr "*module*: 新しい enum クラスが属するモジュールの名前です。" - -#: ../../howto/enum.rst:651 -msgid "*qualname*: where in module new enum class can be found." -msgstr "*qualname*: 新しい enum クラスが属するモジュールの場所です。" - -#: ../../howto/enum.rst:653 -msgid "*type*: type to mix in to new enum class." -msgstr "*type*: 新しい列挙型クラスにミックスインする型。" - -#: ../../howto/enum.rst:655 -msgid "*start*: number to start counting at if only names are passed in." -msgstr "*start*:名前だけ渡された場合にカウントを開始する番号。" - -#: ../../howto/enum.rst:657 -msgid "The *start* parameter was added." -msgstr "*start* 引数が追加されました。" - -#: ../../howto/enum.rst:662 -msgid "Derived Enumerations" -msgstr "派生列挙型" - -#: ../../howto/enum.rst:665 -msgid "IntEnum" -msgstr "IntEnum" - -#: ../../howto/enum.rst:667 -msgid "" -"The first variation of :class:`Enum` that is provided is also a subclass of :" -"class:`int`. Members of an :class:`IntEnum` can be compared to integers; by " -"extension, integer enumerations of different types can also be compared to " -"each other::" -msgstr "" -"提供されている 1 つ目の :class:`Enum` の派生型であり、 :class:`int` のサブク" -"ラスでもあります。\n" -":class:`IntEnum` のメンバーは整数と比較できます;\n" -"さらに言うと、異なる整数列挙型どうしでも比較できます::" - -#: ../../howto/enum.rst:672 -msgid "" -">>> from enum import IntEnum\n" -">>> class Shape(IntEnum):\n" -"... CIRCLE = 1\n" -"... SQUARE = 2\n" -"...\n" -">>> class Request(IntEnum):\n" -"... POST = 1\n" -"... GET = 2\n" -"...\n" -">>> Shape == 1\n" -"False\n" -">>> Shape.CIRCLE == 1\n" -"True\n" -">>> Shape.CIRCLE == Request.POST\n" -"True" -msgstr "" - -#: ../../howto/enum.rst:688 -msgid "" -"However, they still can't be compared to standard :class:`Enum` " -"enumerations::" -msgstr "ただし、これらも標準の :class:`Enum` 列挙型とは比較できません::" - -#: ../../howto/enum.rst:690 -msgid "" -">>> class Shape(IntEnum):\n" -"... CIRCLE = 1\n" -"... SQUARE = 2\n" -"...\n" -">>> class Color(Enum):\n" -"... RED = 1\n" -"... GREEN = 2\n" -"...\n" -">>> Shape.CIRCLE == Color.RED\n" -"False" -msgstr "" - -#: ../../howto/enum.rst:701 -msgid "" -":class:`IntEnum` values behave like integers in other ways you'd expect::" -msgstr ":class:`IntEnum` の値は他の用途では整数のように振る舞います::" - -#: ../../howto/enum.rst:703 -msgid "" -">>> int(Shape.CIRCLE)\n" -"1\n" -">>> ['a', 'b', 'c'][Shape.CIRCLE]\n" -"'b'\n" -">>> [i for i in range(Shape.SQUARE)]\n" -"[0, 1]" -msgstr "" - -#: ../../howto/enum.rst:712 -msgid "StrEnum" -msgstr "StrEnum" - -#: ../../howto/enum.rst:714 -msgid "" -"The second variation of :class:`Enum` that is provided is also a subclass " -"of :class:`str`. Members of a :class:`StrEnum` can be compared to strings; " -"by extension, string enumerations of different types can also be compared to " -"each other." -msgstr "" -"提供されている2つ目の :class:`Enum` の派生型もまた、 :class:`str` のサブクラ" -"スでもあります。:class:`StrEnum` のメンバーは、文字列と比較できます; さらに言" -"うと、異なる文字列列挙型どうしでも比較できます。" - -#: ../../howto/enum.rst:723 -msgid "IntFlag" -msgstr "IntFlag" - -#: ../../howto/enum.rst:725 -msgid "" -"The next variation of :class:`Enum` provided, :class:`IntFlag`, is also " -"based on :class:`int`. The difference being :class:`IntFlag` members can be " -"combined using the bitwise operators (&, \\|, ^, ~) and the result is still " -"an :class:`IntFlag` member, if possible. Like :class:`IntEnum`, :class:" -"`IntFlag` members are also integers and can be used wherever an :class:`int` " -"is used." -msgstr "" -"次の :class:`Enum` の派生型 :class:`IntFlag` も、:class:`int` を基底クラスと" -"しています。\n" -"違いは、 :class:`IntFlag` のメンバーをビット演算子 (&, \\|, ^, ~) を使っ" -"て組み合わせられ、その結果も :class:`IntFlag` メンバーになることです。 :" -"class:`IntEnum` と同様、:class:`IntFlag` のメンバーも整数であり、:class:" -"`int` が使用されるところであればどこでも使えます。" - -#: ../../howto/enum.rst:733 -msgid "" -"Any operation on an :class:`IntFlag` member besides the bit-wise operations " -"will lose the :class:`IntFlag` membership." -msgstr "" -":class:`IntFlag` メンバーに対してビット演算以外のどんな演算をしても、その結果" -"は :class:`IntFlag` メンバーではなくなります。" - -#: ../../howto/enum.rst:736 -msgid "" -"Bit-wise operations that result in invalid :class:`IntFlag` values will lose " -"the :class:`IntFlag` membership. See :class:`FlagBoundary` for details." -msgstr "" -"ビット単位演算の結果が :class:`IntFlag` として不正な値な値の場合、値は :" -"class:`IntFlag` メンバーではなくなります。 詳しくは :class:`FlagBoundary` を" -"参照してください。" - -#: ../../howto/enum.rst:743 -msgid "Sample :class:`IntFlag` class::" -msgstr ":class:`IntFlag` クラスの例::" - -#: ../../howto/enum.rst:745 -msgid "" -">>> from enum import IntFlag\n" -">>> class Perm(IntFlag):\n" -"... R = 4\n" -"... W = 2\n" -"... X = 1\n" -"...\n" -">>> Perm.R | Perm.W\n" -"\n" -">>> Perm.R + Perm.W\n" -"6\n" -">>> RW = Perm.R | Perm.W\n" -">>> Perm.R in RW\n" -"True" -msgstr "" - -#: ../../howto/enum.rst:759 -msgid "It is also possible to name the combinations::" -msgstr "組み合わせにも名前を付けられます::" - -#: ../../howto/enum.rst:761 -msgid "" -">>> class Perm(IntFlag):\n" -"... R = 4\n" -"... W = 2\n" -"... X = 1\n" -"... RWX = 7\n" -"...\n" -">>> Perm.RWX\n" -"\n" -">>> ~Perm.RWX\n" -"\n" -">>> Perm(7)\n" -"" -msgstr "" - -#: ../../howto/enum.rst:776 -msgid "" -"Named combinations are considered aliases. Aliases do not show up during " -"iteration, but can be returned from by-value lookups." -msgstr "" -"組み合わせに名前をつけたものはエイリアスとみなされます。エイリアスはイテレー" -"ション中には表示されませんが、値による検索では返却されます。" - -#: ../../howto/enum.rst:781 -msgid "" -"Another important difference between :class:`IntFlag` and :class:`Enum` is " -"that if no flags are set (the value is 0), its boolean evaluation is :data:" -"`False`::" -msgstr "" -":class:`IntFlag` と :class:`Enum` のもう 1 つの重要な違いは、フラグが設定され" -"ていない (値が0である) 場合、その真偽値としての評価は :data:`False` になるこ" -"とです::" - -#: ../../howto/enum.rst:784 -msgid "" -">>> Perm.R & Perm.X\n" -"\n" -">>> bool(Perm.R & Perm.X)\n" -"False" -msgstr "" - -#: ../../howto/enum.rst:789 -msgid "" -"Because :class:`IntFlag` members are also subclasses of :class:`int` they " -"can be combined with them (but may lose :class:`IntFlag` membership::" -msgstr "" -":class:`IntFlag` メンバーも :class:`int` のサブクラスであるため、それらと組み" -"合わせることができます(ただし、 :class:`IntFlag` 型ではなくなる可能性があり" -"ます)::" - -#: ../../howto/enum.rst:792 -msgid "" -">>> Perm.X | 4\n" -"\n" -"\n" -">>> Perm.X + 8\n" -"9" -msgstr "" - -#: ../../howto/enum.rst:800 -msgid "" -"The negation operator, ``~``, always returns an :class:`IntFlag` member with " -"a positive value::" -msgstr "" -"否定の演算子 ``~`` は、常に正の値を持つ :class:`IntFlag` メンバー を返す::" - -#: ../../howto/enum.rst:803 -msgid "" -">>> (~Perm.X).value == (Perm.R|Perm.W).value == 6\n" -"True" -msgstr "" - -#: ../../howto/enum.rst:806 -msgid ":class:`IntFlag` members can also be iterated over::" -msgstr ":class:`IntFlag` メンバーは反復処理することもできます::" - -#: ../../howto/enum.rst:808 -msgid "" -">>> list(RW)\n" -"[, ]" -msgstr "" - -#: ../../howto/enum.rst:815 -msgid "Flag" -msgstr "Flag" - -#: ../../howto/enum.rst:817 -msgid "" -"The last variation is :class:`Flag`. Like :class:`IntFlag`, :class:`Flag` " -"members can be combined using the bitwise operators (&, \\|, ^, ~). Unlike :" -"class:`IntFlag`, they cannot be combined with, nor compared against, any " -"other :class:`Flag` enumeration, nor :class:`int`. While it is possible to " -"specify the values directly it is recommended to use :class:`auto` as the " -"value and let :class:`Flag` select an appropriate value." -msgstr "" -"最後の派生型は :class:`Flag` です。\n" -":class:`IntFlag` と同様に、 :class:`Flag` メンバーもビット演算子 (&, \\|, ^, " -"~) を使って組み合わせられます。\n" -"しかし :class:`IntFlag` とは違い、他のどの :class:`Flag` 列挙型とも :class:" -"`int` とも組み合わせたり、比較したりできません。\n" -"値を直接指定することも可能ですが、値として :class:`auto` を使い、 :class:" -"`Flag` に適切な値を選ばせることが推奨されています。" - -#: ../../howto/enum.rst:826 -msgid "" -"Like :class:`IntFlag`, if a combination of :class:`Flag` members results in " -"no flags being set, the boolean evaluation is :data:`False`::" -msgstr "" -":class:`IntFlag` と同様に、 :class:`Flag` メンバーの組み合わせがどのフラグも" -"設定されていない状態になった場合、その真偽値としての評価は :data:`False` とな" -"ります::" - -#: ../../howto/enum.rst:829 -msgid "" -">>> from enum import Flag, auto\n" -">>> class Color(Flag):\n" -"... RED = auto()\n" -"... BLUE = auto()\n" -"... GREEN = auto()\n" -"...\n" -">>> Color.RED & Color.GREEN\n" -"\n" -">>> bool(Color.RED & Color.GREEN)\n" -"False" -msgstr "" - -#: ../../howto/enum.rst:840 -msgid "" -"Individual flags should have values that are powers of two (1, 2, 4, " -"8, ...), while combinations of flags will not::" -msgstr "" -"個別のフラグは 2 のべき乗 (1, 2, 4, 8, ...) の値を持つべきですが、フラグの組" -"み合わせはそうはなりません::" - -#: ../../howto/enum.rst:843 -msgid "" -">>> class Color(Flag):\n" -"... RED = auto()\n" -"... BLUE = auto()\n" -"... GREEN = auto()\n" -"... WHITE = RED | BLUE | GREEN\n" -"...\n" -">>> Color.WHITE\n" -"" -msgstr "" - -#: ../../howto/enum.rst:852 -msgid "" -"Giving a name to the \"no flags set\" condition does not change its boolean " -"value::" -msgstr "" -"\"フラグが設定されていない\" 状態に名前を付けても、その真偽値は変わりません::" - -#: ../../howto/enum.rst:855 -msgid "" -">>> class Color(Flag):\n" -"... BLACK = 0\n" -"... RED = auto()\n" -"... BLUE = auto()\n" -"... GREEN = auto()\n" -"...\n" -">>> Color.BLACK\n" -"\n" -">>> bool(Color.BLACK)\n" -"False" -msgstr "" - -#: ../../howto/enum.rst:866 -msgid ":class:`Flag` members can also be iterated over::" -msgstr ":class:`Flag` メンバーは反復処理することもできます::" - -#: ../../howto/enum.rst:868 -msgid "" -">>> purple = Color.RED | Color.BLUE\n" -">>> list(purple)\n" -"[, ]" -msgstr "" - -#: ../../howto/enum.rst:876 -msgid "" -"For the majority of new code, :class:`Enum` and :class:`Flag` are strongly " -"recommended, since :class:`IntEnum` and :class:`IntFlag` break some semantic " -"promises of an enumeration (by being comparable to integers, and thus by " -"transitivity to other unrelated enumerations). :class:`IntEnum` and :class:" -"`IntFlag` should be used only in cases where :class:`Enum` and :class:`Flag` " -"will not do; for example, when integer constants are replaced with " -"enumerations, or for interoperability with other systems." -msgstr "" -"ほとんどの新しいコードでは、 :class:`Enum` と :class:`Flag` が強く推奨されま" -"す。\n" -"というのは、 :class:`IntEnum` と :class:`IntFlag` は (整数と比較でき、従って" -"推移的に他の無関係な列挙型と比較できてしまうことにより) 列挙型の意味論的な約" -"束に反するからです。\n" -":class:`IntEnum` と :class:`IntFlag` は、 :class:`Enum` や :class:`Flag` では" -"上手くいかない場合のみに使うべきです;\n" -"例えば、整数定数を列挙型で置き換えるときや、他のシステムとの相互運用性を持た" -"せたいときです。" - -#: ../../howto/enum.rst:886 -msgid "Others" -msgstr "その他" - -#: ../../howto/enum.rst:888 -msgid "" -"While :class:`IntEnum` is part of the :mod:`enum` module, it would be very " -"simple to implement independently::" -msgstr "" -":class:`IntEnum` は :mod:`enum` モジュールの一部ですが、単独での実装もとても" -"簡単に行なえます::" - -#: ../../howto/enum.rst:891 -msgid "" -"class IntEnum(int, ReprEnum): # or Enum instead of ReprEnum\n" -" pass" -msgstr "" - -#: ../../howto/enum.rst:894 -msgid "" -"This demonstrates how similar derived enumerations can be defined; for " -"example a :class:`!FloatEnum` that mixes in :class:`float` instead of :class:" -"`int`." -msgstr "" - -#: ../../howto/enum.rst:897 -msgid "Some rules:" -msgstr "いくつかのルール:" - -#: ../../howto/enum.rst:899 -msgid "" -"When subclassing :class:`Enum`, mix-in types must appear before the :class:" -"`Enum` class itself in the sequence of bases, as in the :class:`IntEnum` " -"example above." -msgstr "" -":class:`Enum` のサブクラスを作成するとき、複合させるデータ型は、基底クラスの" -"並びで :class:`Enum` クラス自身より先に記述しなければなりません (上記 :class:" -"`IntEnum` の例を参照)。" - -#: ../../howto/enum.rst:902 -msgid "" -"Mix-in types must be subclassable. For example, :class:`bool` and :class:" -"`range` are not subclassable and will throw an error during Enum creation if " -"used as the mix-in type." -msgstr "" -"複合させる型はサブクラス化可能でなければいけません。例えば、 :class:`bool` " -"と :class:`range` はサブクラス化できないため、複合させるとEnum作成時にエラー" -"が発生します。" - -#: ../../howto/enum.rst:905 -msgid "" -"While :class:`Enum` can have members of any type, once you mix in an " -"additional type, all the members must have values of that type, e.g. :class:" -"`int` above. This restriction does not apply to mix-ins which only add " -"methods and don't specify another type." -msgstr "" -":class:`Enum` のメンバーはどんなデータ型でも構いませんが、追加のデータ型 (例" -"えば、上の例の :class:`int`) と複合させてしまうと、すべてのメンバーの値はその" -"データ型でなければならなくなります。この制限は、メソッドの追加するだけの、他" -"のデータ型を指定しない複合には適用されません。" - -#: ../../howto/enum.rst:909 -msgid "" -"When another data type is mixed in, the :attr:`~Enum.value` attribute is " -"*not the same* as the enum member itself, although it is equivalent and will " -"compare equal." -msgstr "" - -#: ../../howto/enum.rst:912 -msgid "" -"A ``data type`` is a mixin that defines :meth:`~object.__new__`, or a :class:" -"`~dataclasses.dataclass`" -msgstr "" - -#: ../../howto/enum.rst:914 -msgid "" -"%-style formatting: ``%s`` and ``%r`` call the :class:`Enum` class's :meth:" -"`~object.__str__` and :meth:`~object.__repr__` respectively; other codes " -"(such as ``%i`` or ``%h`` for IntEnum) treat the enum member as its mixed-in " -"type." -msgstr "" - -#: ../../howto/enum.rst:917 -msgid "" -":ref:`Formatted string literals `, :meth:`str.format`, and :func:" -"`format` will use the enum's :meth:`~object.__str__` method." -msgstr "" - -#: ../../howto/enum.rst:922 -msgid "" -"Because :class:`IntEnum`, :class:`IntFlag`, and :class:`StrEnum` are " -"designed to be drop-in replacements for existing constants, their :meth:" -"`~object.__str__` method has been reset to their data types' :meth:`~object." -"__str__` method." -msgstr "" - -#: ../../howto/enum.rst:930 -msgid "When to use :meth:`~object.__new__` vs. :meth:`~object.__init__`" -msgstr "" - -#: ../../howto/enum.rst:932 -msgid "" -":meth:`~object.__new__` must be used whenever you want to customize the " -"actual value of the :class:`Enum` member. Any other modifications may go in " -"either :meth:`~object.__new__` or :meth:`~object.__init__`, with :meth:" -"`~object.__init__` being preferred." -msgstr "" - -#: ../../howto/enum.rst:936 -msgid "" -"For example, if you want to pass several items to the constructor, but only " -"want one of them to be the value::" -msgstr "" -"例えば、複数の値をコンストラクタに渡すが、その中の1つだけを値として使いたい場" -"合は次のようにします:" - -#: ../../howto/enum.rst:939 -msgid "" -">>> class Coordinate(bytes, Enum):\n" -"... \"\"\"\n" -"... Coordinate with binary codes that can be indexed by the int code.\n" -"... \"\"\"\n" -"... def __new__(cls, value, label, unit):\n" -"... obj = bytes.__new__(cls, [value])\n" -"... obj._value_ = value\n" -"... obj.label = label\n" -"... obj.unit = unit\n" -"... return obj\n" -"... PX = (0, 'P.X', 'km')\n" -"... PY = (1, 'P.Y', 'km')\n" -"... VX = (2, 'V.X', 'km/s')\n" -"... VY = (3, 'V.Y', 'km/s')\n" -"...\n" -"\n" -">>> print(Coordinate['PY'])\n" -"Coordinate.PY\n" -"\n" -">>> print(Coordinate(3))\n" -"Coordinate.VY" -msgstr "" - -#: ../../howto/enum.rst:963 -msgid "" -"*Do not* call ``super().__new__()``, as the lookup-only ``__new__`` is the " -"one that is found; instead, use the data type directly." -msgstr "" - -#: ../../howto/enum.rst:968 -msgid "Finer Points" -msgstr "細かい点" - -#: ../../howto/enum.rst:971 -msgid "Supported ``__dunder__`` names" -msgstr "``__dunder__`` 名のサポート" - -#: ../../howto/enum.rst:973 -msgid "" -":attr:`~enum.EnumType.__members__` is a read-only ordered mapping of " -"``member_name``:``member`` items. It is only available on the class." -msgstr "" - -#: ../../howto/enum.rst:976 -msgid "" -":meth:`~object.__new__`, if specified, must create and return the enum " -"members; it is also a very good idea to set the member's :attr:`~Enum." -"_value_` appropriately. Once all the members are created it is no longer " -"used." -msgstr "" - -#: ../../howto/enum.rst:982 -msgid "Supported ``_sunder_`` names" -msgstr "``_sunder_`` 名のサポート" - -#: ../../howto/enum.rst:984 -msgid ":attr:`~Enum._name_` -- name of the member" -msgstr ":attr:`~Enum._name_` -- メンバー名" - -#: ../../howto/enum.rst:985 -msgid ":attr:`~Enum._value_` -- value of the member; can be set in ``__new__``" -msgstr ":attr:`~Enum._value_` -- メンバーの値; ``__new__`` で設定できます" - -#: ../../howto/enum.rst:986 -msgid "" -":meth:`~Enum._missing_` -- a lookup function used when a value is not found; " -"may be overridden" -msgstr "" -":meth:`~Enum._missing_` -- 値が見付からなかったときに使われる検索関数; オー" -"バーライドされていることがあります" - -#: ../../howto/enum.rst:988 -msgid "" -":attr:`~Enum._ignore_` -- a list of names, either as a :class:`list` or a :" -"class:`str`, that will not be transformed into members, and will be removed " -"from the final class" -msgstr "" -":attr:`~Enum._ignore_` -- 名前のリストで、 :class:`list` もしくは :class:" -"`str` です。この名前の要素はメンバーへの変換が行われず、最終的なクラスから削" -"除されます。" - -#: ../../howto/enum.rst:991 -msgid "" -":meth:`~Enum._generate_next_value_` -- used to get an appropriate value for " -"an enum member; may be overridden" -msgstr "" -":meth:`~Enum._generate_next_value_` -- 列挙型のメンバーの適切な値を取得するの" -"に使われます。オーバーライドされます。" - -#: ../../howto/enum.rst:993 -msgid "" -":meth:`~EnumType._add_alias_` -- adds a new name as an alias to an existing " -"member." -msgstr "" - -#: ../../howto/enum.rst:995 -msgid "" -":meth:`~EnumType._add_value_alias_` -- adds a new value as an alias to an " -"existing member. See `MultiValueEnum`_ for an example." -msgstr "" - -#: ../../howto/enum.rst:1000 -msgid "" -"For standard :class:`Enum` classes the next value chosen is the highest " -"value seen incremented by one." -msgstr "" -"標準の :class:`Enum` クラスの場合、次の値として選択されるのは、定義された最大" -"の値に1を加えたものです。" - -#: ../../howto/enum.rst:1003 -msgid "" -"For :class:`Flag` classes the next value chosen will be the next highest " -"power-of-two." -msgstr "" -":class:`Flag` クラスでは、次に選ばれる値は、次の最大の2のべき乗となります。" - -#: ../../howto/enum.rst:1006 -msgid "" -"Prior versions would use the last seen value instead of the highest value." -msgstr "" -"以前のバージョンでは最大の値ではなく最後に定義された値を使っていました。" - -#: ../../howto/enum.rst:1009 -msgid "``_missing_``, ``_order_``, ``_generate_next_value_``" -msgstr "``_missing_``, ``_order_``, ``_generate_next_value_``" - -#: ../../howto/enum.rst:1010 -msgid "``_ignore_``" -msgstr "``_ignore_``" - -#: ../../howto/enum.rst:1011 -msgid "``_add_alias_``, ``_add_value_alias_``" -msgstr "" - -#: ../../howto/enum.rst:1013 -msgid "" -"To help keep Python 2 / Python 3 code in sync an :attr:`~Enum._order_` " -"attribute can be provided. It will be checked against the actual order of " -"the enumeration and raise an error if the two do not match::" -msgstr "" - -#: ../../howto/enum.rst:1017 -msgid "" -">>> class Color(Enum):\n" -"... _order_ = 'RED GREEN BLUE'\n" -"... RED = 1\n" -"... BLUE = 3\n" -"... GREEN = 2\n" -"...\n" -"Traceback (most recent call last):\n" -"...\n" -"TypeError: member order does not match _order_:\n" -" ['RED', 'BLUE', 'GREEN']\n" -" ['RED', 'GREEN', 'BLUE']" -msgstr "" - -#: ../../howto/enum.rst:1031 -msgid "" -"In Python 2 code the :attr:`~Enum._order_` attribute is necessary as " -"definition order is lost before it can be recorded." -msgstr "" - -#: ../../howto/enum.rst:1036 -msgid "_Private__names" -msgstr "_Private__names" - -#: ../../howto/enum.rst:1038 -msgid "" -":ref:`Private names ` are not converted to enum " -"members, but remain normal attributes." -msgstr "" -":ref:`Private names` は列挙型メンバーには変換されず、" -"通常の属性となります。" - -#: ../../howto/enum.rst:1045 -msgid "``Enum`` member type" -msgstr "``Enum`` メンバー型" - -#: ../../howto/enum.rst:1047 -msgid "" -"Enum members are instances of their enum class, and are normally accessed as " -"``EnumClass.member``. In certain situations, such as writing custom enum " -"behavior, being able to access one member directly from another is useful, " -"and is supported; however, in order to avoid name clashes between member " -"names and attributes/methods from mixed-in classes, upper-case names are " -"strongly recommended." -msgstr "" -"列挙型メンバーはその列挙型クラスのインスタンスであり、通常は ``EnumClass." -"member`` としてアクセスされます。 振る舞い メンバー しかし、メンバー の名前" -"と、属性/methodsが混在しているクラスとの名前の衝突を避けるために、大文字の名" -"前を使うことを強く推奨します。" - -#: ../../howto/enum.rst:1058 -msgid "Creating members that are mixed with other data types" -msgstr "" - -#: ../../howto/enum.rst:1060 -msgid "" -"When subclassing other data types, such as :class:`int` or :class:`str`, " -"with an :class:`Enum`, all values after the ``=`` are passed to that data " -"type's constructor. For example::" -msgstr "" -" :class:`int` や:class:`str` などの他のデータ型と :class:`Enum` のサブクラス" -"では、 ``=`` 以降の値はすべて、そのデータ型のコンストラクタに渡される。 例え" -"ば::" - -#: ../../howto/enum.rst:1064 -msgid "" -">>> class MyEnum(IntEnum): # help(int) -> int(x, base=10) -> integer\n" -"... example = '11', 16 # so x='11' and base=16\n" -"...\n" -">>> MyEnum.example.value # and hex(11) is...\n" -"17" -msgstr "" - -#: ../../howto/enum.rst:1072 -msgid "Boolean value of ``Enum`` classes and members" -msgstr "``Enum`` クラスとメンバーの真偽値" - -#: ../../howto/enum.rst:1074 -msgid "" -"Enum classes that are mixed with non-:class:`Enum` types (such as :class:" -"`int`, :class:`str`, etc.) are evaluated according to the mixed-in type's " -"rules; otherwise, all members evaluate as :data:`True`. To make your own " -"enum's boolean evaluation depend on the member's value add the following to " -"your class::" -msgstr "" -"(:class:`int`, :class:`str` などのような) 非 :class:`Enum` 型と複合させた " -"enum クラスは、その複合された型の規則に従って評価されます;\n" -"そうでない場合は、全てのメンバーは :data:`True` と評価されます。\n" -"メンバーの値に依存する独自の enum の真偽値評価を行うには、クラスに次のコード" -"を追加してください::" - -#: ../../howto/enum.rst:1080 -msgid "" -"def __bool__(self):\n" -" return bool(self.value)" -msgstr "" - -#: ../../howto/enum.rst:1083 -msgid "Plain :class:`Enum` classes always evaluate as :data:`True`." -msgstr "プレーンな :class:`Enum` クラスは :data:`True` として評価されます。" - -#: ../../howto/enum.rst:1087 -msgid "``Enum`` classes with methods" -msgstr "メソッド付きの ``Enum`` クラス" - -#: ../../howto/enum.rst:1089 -msgid "" -"If you give your enum subclass extra methods, like the `Planet`_ class " -"below, those methods will show up in a :func:`dir` of the member, but not of " -"the class::" -msgstr "" -"enum サブクラスに追加のメソッドを与えた場合、後述の `Planet`_ クラスのよう" -"に、そのメソッドはメンバーの :func:`dir` に表示されますが、クラスの :func:" -"`dir` には表示されません::" - -#: ../../howto/enum.rst:1093 -msgid "" -">>> dir(Planet)\n" -"['EARTH', 'JUPITER', 'MARS', 'MERCURY', 'NEPTUNE', 'SATURN', 'URANUS', " -"'VENUS', '__class__', '__doc__', '__members__', '__module__']\n" -">>> dir(Planet.EARTH)\n" -"['__class__', '__doc__', '__module__', 'mass', 'name', 'radius', " -"'surface_gravity', 'value']" -msgstr "" - -#: ../../howto/enum.rst:1100 -msgid "Combining members of ``Flag``" -msgstr "``Flag`` のメンバーの組み合わせ" - -#: ../../howto/enum.rst:1102 -msgid "" -"Iterating over a combination of :class:`Flag` members will only return the " -"members that are comprised of a single bit::" -msgstr "" - -#: ../../howto/enum.rst:1105 -msgid "" -">>> class Color(Flag):\n" -"... RED = auto()\n" -"... GREEN = auto()\n" -"... BLUE = auto()\n" -"... MAGENTA = RED | BLUE\n" -"... YELLOW = RED | GREEN\n" -"... CYAN = GREEN | BLUE\n" -"...\n" -">>> Color(3) # named combination\n" -"\n" -">>> Color(7) # not named combination\n" -"" -msgstr "" - -#: ../../howto/enum.rst:1120 -msgid "``Flag`` and ``IntFlag`` minutia" -msgstr "" - -#: ../../howto/enum.rst:1122 -msgid "Using the following snippet for our examples::" -msgstr "例として以下のスニペットを使用します::" - -#: ../../howto/enum.rst:1124 -msgid "" -">>> class Color(IntFlag):\n" -"... BLACK = 0\n" -"... RED = 1\n" -"... GREEN = 2\n" -"... BLUE = 4\n" -"... PURPLE = RED | BLUE\n" -"... WHITE = RED | GREEN | BLUE\n" -"..." -msgstr "" - -#: ../../howto/enum.rst:1133 -msgid "the following are true:" -msgstr "" - -#: ../../howto/enum.rst:1135 -msgid "single-bit flags are canonical" -msgstr "単一ビットのフラグは正規形です" - -#: ../../howto/enum.rst:1136 -msgid "multi-bit and zero-bit flags are aliases" -msgstr "複数ビットや0ビットのフラグはエイリアスです" - -#: ../../howto/enum.rst:1137 -msgid "only canonical flags are returned during iteration::" -msgstr "反復処理では正規形のフラグのみ返却されます::" - -#: ../../howto/enum.rst:1139 -msgid "" -">>> list(Color.WHITE)\n" -"[, , ]" -msgstr "" - -#: ../../howto/enum.rst:1142 -msgid "" -"negating a flag or flag set returns a new flag/flag set with the " -"corresponding positive integer value::" -msgstr "" - -#: ../../howto/enum.rst:1145 -msgid "" -">>> Color.BLUE\n" -"\n" -"\n" -">>> ~Color.BLUE\n" -"" -msgstr "" - -#: ../../howto/enum.rst:1151 -msgid "names of pseudo-flags are constructed from their members' names::" -msgstr "名前のないフラグについては、そのメンバーの名前から名前が生成されます::" - -#: ../../howto/enum.rst:1153 -msgid "" -">>> (Color.RED | Color.GREEN).name\n" -"'RED|GREEN'\n" -"\n" -">>> class Perm(IntFlag):\n" -"... R = 4\n" -"... W = 2\n" -"... X = 1\n" -"...\n" -">>> (Perm.R & Perm.W).name is None # effectively Perm(0)\n" -"True" -msgstr "" - -#: ../../howto/enum.rst:1164 -msgid "multi-bit flags, aka aliases, can be returned from operations::" -msgstr "" - -#: ../../howto/enum.rst:1166 -msgid "" -">>> Color.RED | Color.BLUE\n" -"\n" -"\n" -">>> Color(7) # or Color(-1)\n" -"\n" -"\n" -">>> Color(0)\n" -"" -msgstr "" - -#: ../../howto/enum.rst:1175 -msgid "" -"membership / containment checking: zero-valued flags are always considered " -"to be contained::" -msgstr "" -"メンバーシップ/包含 のチェックでは、値が0のフラグは常に含まれるものとして扱わ" -"れます::" - -#: ../../howto/enum.rst:1178 -msgid "" -">>> Color.BLACK in Color.WHITE\n" -"True" -msgstr "" - -#: ../../howto/enum.rst:1181 -msgid "" -"otherwise, only if all bits of one flag are in the other flag will True be " -"returned::" -msgstr "" -"それ以外では、一方のフラグの全ビットが他方のフラグに含まれる場合のみ、Trueが" -"返されます::" - -#: ../../howto/enum.rst:1184 -msgid "" -">>> Color.PURPLE in Color.WHITE\n" -"True\n" -"\n" -">>> Color.GREEN in Color.PURPLE\n" -"False" -msgstr "" - -#: ../../howto/enum.rst:1190 -msgid "" -"There is a new boundary mechanism that controls how out-of-range / invalid " -"bits are handled: ``STRICT``, ``CONFORM``, ``EJECT``, and ``KEEP``:" -msgstr "" - -#: ../../howto/enum.rst:1193 -msgid "STRICT --> raises an exception when presented with invalid values" -msgstr "STRICT --> 無効な値が指定された場合に例外を発生させる" - -#: ../../howto/enum.rst:1194 -msgid "CONFORM --> discards any invalid bits" -msgstr "CONFORM --> 無効なビットを破棄する" - -#: ../../howto/enum.rst:1195 -msgid "EJECT --> lose Flag status and become a normal int with the given value" -msgstr "" -"EJECT --> フラグのステータスを失い、指定された値を持つ通常の int となります。" - -#: ../../howto/enum.rst:1196 -msgid "KEEP --> keep the extra bits" -msgstr "" - -#: ../../howto/enum.rst:1198 -msgid "keeps Flag status and extra bits" -msgstr "" - -#: ../../howto/enum.rst:1199 -msgid "extra bits do not show up in iteration" -msgstr "" - -#: ../../howto/enum.rst:1200 -msgid "extra bits do show up in repr() and str()" -msgstr "" - -#: ../../howto/enum.rst:1202 -msgid "" -"The default for Flag is ``STRICT``, the default for ``IntFlag`` is " -"``EJECT``, and the default for ``_convert_`` is ``KEEP`` (see ``ssl." -"Options`` for an example of when ``KEEP`` is needed)." -msgstr "" - -#: ../../howto/enum.rst:1210 -msgid "How are Enums and Flags different?" -msgstr "EnumとFlagはどう違うのか?" - -#: ../../howto/enum.rst:1212 -msgid "" -"Enums have a custom metaclass that affects many aspects of both derived :" -"class:`Enum` classes and their instances (members)." -msgstr "" -"Enum は :class:`Enum` 派生クラスやそれらのインスタンス (メンバー) 双方の多く" -"の側面に影響を及ぼすカスタムメタクラスを持っています。" - -#: ../../howto/enum.rst:1217 -msgid "Enum Classes" -msgstr "Enum クラス" - -#: ../../howto/enum.rst:1219 -msgid "" -"The :class:`EnumType` metaclass is responsible for providing the :meth:" -"`~object.__contains__`, :meth:`~object.__dir__`, :meth:`~object.__iter__` " -"and other methods that allow one to do things with an :class:`Enum` class " -"that fail on a typical class, such as ``list(Color)`` or ``some_enum_var in " -"Color``. :class:`EnumType` is responsible for ensuring that various other " -"methods on the final :class:`Enum` class are correct (such as :meth:`~object." -"__new__`, :meth:`~object.__getnewargs__`, :meth:`~object.__str__` and :meth:" -"`~object.__repr__`)." -msgstr "" - -#: ../../howto/enum.rst:1228 -msgid "Flag Classes" -msgstr "Flag クラス" - -#: ../../howto/enum.rst:1230 -msgid "" -"Flags have an expanded view of aliasing: to be canonical, the value of a " -"flag needs to be a power-of-two value, and not a duplicate name. So, in " -"addition to the :class:`Enum` definition of alias, a flag with no value (a.k." -"a. ``0``) or with more than one power-of-two value (e.g. ``3``) is " -"considered an alias." -msgstr "" - -#: ../../howto/enum.rst:1236 -msgid "Enum Members (aka instances)" -msgstr "Enum メンバー (インスタンス)" - -#: ../../howto/enum.rst:1238 -msgid "" -"The most interesting thing about enum members is that they are singletons. :" -"class:`EnumType` creates them all while it is creating the enum class " -"itself, and then puts a custom :meth:`~object.__new__` in place to ensure " -"that no new ones are ever instantiated by returning only the existing member " -"instances." -msgstr "" - -#: ../../howto/enum.rst:1244 -msgid "Flag Members" -msgstr "Flag メンバー" - -#: ../../howto/enum.rst:1246 -msgid "" -"Flag members can be iterated over just like the :class:`Flag` class, and " -"only the canonical members will be returned. For example::" -msgstr "" -"フラグのメンバーは、:class:`Flag` クラスと同様に反復処理することができ、正規" -"のメンバーのみが返されます。 例えば::" - -#: ../../howto/enum.rst:1249 -msgid "" -">>> list(Color)\n" -"[, , ]" -msgstr "" - -#: ../../howto/enum.rst:1252 -msgid "(Note that ``BLACK``, ``PURPLE``, and ``WHITE`` do not show up.)" -msgstr "(``BLACK`` 、 ``PURPLE`` 、 ``WHITE`` は表示されないことに注意。)" - -#: ../../howto/enum.rst:1254 -msgid "" -"Inverting a flag member returns the corresponding positive value, rather " -"than a negative value --- for example::" -msgstr "" -"フラグのメンバーを反転させると、負の値ではなく、対応する正の値が返されます::" - -#: ../../howto/enum.rst:1257 -msgid "" -">>> ~Color.RED\n" -"" -msgstr "" - -#: ../../howto/enum.rst:1260 -msgid "" -"Flag members have a length corresponding to the number of power-of-two " -"values they contain. For example::" -msgstr "" -"フラグのメンバーは、それが含む2のべき乗の値の数に対応するlengthを持ちます。 " -"例えば::" - -#: ../../howto/enum.rst:1263 -msgid "" -">>> len(Color.PURPLE)\n" -"2" -msgstr "" - -#: ../../howto/enum.rst:1270 -msgid "Enum Cookbook" -msgstr "Enum クックブック" - -#: ../../howto/enum.rst:1273 -msgid "" -"While :class:`Enum`, :class:`IntEnum`, :class:`StrEnum`, :class:`Flag`, and :" -"class:`IntFlag` are expected to cover the majority of use-cases, they cannot " -"cover them all. Here are recipes for some different types of enumerations " -"that can be used directly, or as examples for creating one's own." -msgstr "" -":class:`Enum`, :class:`IntEnum`, :class:`StrEnum`, :class:`Flag`, :class:" -"`IntFlag` は用途の大部分をカバーすると予想されますが、そのすべてをカバーでき" -"ているわけではありません。ここでは、そのまま、あるいは独自の列挙型を作る例と" -"して使える、様々なタイプの列挙型を紹介します。" - -#: ../../howto/enum.rst:1280 -msgid "Omitting values" -msgstr "値の省略" - -#: ../../howto/enum.rst:1282 -msgid "" -"In many use-cases, one doesn't care what the actual value of an enumeration " -"is. There are several ways to define this type of simple enumeration:" -msgstr "" -"多くの用途では、列挙型の実際の値が何かは気にされません。\n" -"このタイプの単純な列挙型を定義する方法はいくつかあります:" - -#: ../../howto/enum.rst:1285 -msgid "use instances of :class:`auto` for the value" -msgstr "値に :class:`auto` インスタンスを使用する" - -#: ../../howto/enum.rst:1286 -msgid "use instances of :class:`object` as the value" -msgstr "値として :class:`object` インスタンスを使用する" - -#: ../../howto/enum.rst:1287 -msgid "use a descriptive string as the value" -msgstr "値として解説文字列を使用する" - -#: ../../howto/enum.rst:1288 -msgid "" -"use a tuple as the value and a custom :meth:`~object.__new__` to replace the " -"tuple with an :class:`int` value" -msgstr "" - -#: ../../howto/enum.rst:1291 -msgid "" -"Using any of these methods signifies to the user that these values are not " -"important, and also enables one to add, remove, or reorder members without " -"having to renumber the remaining members." -msgstr "" -"これらのどの方法を使ってもユーザーに対して、値は重要ではなく、他のメンバーの" -"番号の振り直しをする必要無しに、メンバーの追加、削除、並べ替えが行えるという" -"ことを示せます。" - -#: ../../howto/enum.rst:1297 -msgid "Using :class:`auto`" -msgstr ":class:`auto` を使う" - -#: ../../howto/enum.rst:1299 -msgid "Using :class:`auto` would look like::" -msgstr ":class:`auto` を使うと次のようになります::" - -#: ../../howto/enum.rst:1301 -msgid "" -">>> class Color(Enum):\n" -"... RED = auto()\n" -"... BLUE = auto()\n" -"... GREEN = auto()\n" -"...\n" -">>> Color.GREEN\n" -"" -msgstr "" - -#: ../../howto/enum.rst:1311 -msgid "Using :class:`object`" -msgstr ":class:`object` を使う" - -#: ../../howto/enum.rst:1313 -msgid "Using :class:`object` would look like::" -msgstr ":class:`object` を使うと次のようになります::" - -#: ../../howto/enum.rst:1315 -msgid "" -">>> class Color(Enum):\n" -"... RED = object()\n" -"... GREEN = object()\n" -"... BLUE = object()\n" -"...\n" -">>> Color.GREEN\n" -">" -msgstr "" - -#: ../../howto/enum.rst:1323 -msgid "" -"This is also a good example of why you might want to write your own :meth:" -"`~object.__repr__`::" -msgstr "" - -#: ../../howto/enum.rst:1326 -msgid "" -">>> class Color(Enum):\n" -"... RED = object()\n" -"... GREEN = object()\n" -"... BLUE = object()\n" -"... def __repr__(self):\n" -"... return \"<%s.%s>\" % (self.__class__.__name__, self._name_)\n" -"...\n" -">>> Color.GREEN\n" -"" -msgstr "" - -#: ../../howto/enum.rst:1339 -msgid "Using a descriptive string" -msgstr "解説文字列を使う" - -#: ../../howto/enum.rst:1341 -msgid "Using a string as the value would look like::" -msgstr "値として文字列を使うと次のようになります::" - -#: ../../howto/enum.rst:1343 -msgid "" -">>> class Color(Enum):\n" -"... RED = 'stop'\n" -"... GREEN = 'go'\n" -"... BLUE = 'too fast!'\n" -"...\n" -">>> Color.GREEN\n" -"" -msgstr "" - -#: ../../howto/enum.rst:1353 -msgid "Using a custom :meth:`~object.__new__`" -msgstr "" - -#: ../../howto/enum.rst:1355 -msgid "Using an auto-numbering :meth:`~object.__new__` would look like::" -msgstr "" - -#: ../../howto/enum.rst:1357 -msgid "" -">>> class AutoNumber(Enum):\n" -"... def __new__(cls):\n" -"... value = len(cls.__members__) + 1\n" -"... obj = object.__new__(cls)\n" -"... obj._value_ = value\n" -"... return obj\n" -"...\n" -">>> class Color(AutoNumber):\n" -"... RED = ()\n" -"... GREEN = ()\n" -"... BLUE = ()\n" -"...\n" -">>> Color.GREEN\n" -"" -msgstr "" - -#: ../../howto/enum.rst:1372 -msgid "" -"To make a more general purpose ``AutoNumber``, add ``*args`` to the " -"signature::" -msgstr "" -"``AutoNumber`` をより広い用途で使うには、シグニチャに ``*args`` を追加しま" -"す::" - -#: ../../howto/enum.rst:1374 -msgid "" -">>> class AutoNumber(Enum):\n" -"... def __new__(cls, *args): # this is the only change from above\n" -"... value = len(cls.__members__) + 1\n" -"... obj = object.__new__(cls)\n" -"... obj._value_ = value\n" -"... return obj\n" -"..." -msgstr "" - -#: ../../howto/enum.rst:1382 -msgid "" -"Then when you inherit from ``AutoNumber`` you can write your own " -"``__init__`` to handle any extra arguments::" -msgstr "" -"``AutoNumber`` を継承すると、追加の引数を取り扱える独自の ``__init__`` が書け" -"ます。" - -#: ../../howto/enum.rst:1385 -msgid "" -">>> class Swatch(AutoNumber):\n" -"... def __init__(self, pantone='unknown'):\n" -"... self.pantone = pantone\n" -"... AUBURN = '3497'\n" -"... SEA_GREEN = '1246'\n" -"... BLEACHED_CORAL = () # New color, no Pantone code yet!\n" -"...\n" -">>> Swatch.SEA_GREEN\n" -"\n" -">>> Swatch.SEA_GREEN.pantone\n" -"'1246'\n" -">>> Swatch.BLEACHED_CORAL.pantone\n" -"'unknown'" -msgstr "" - -#: ../../howto/enum.rst:1401 -msgid "" -"The :meth:`~object.__new__` method, if defined, is used during creation of " -"the Enum members; it is then replaced by Enum's :meth:`~object.__new__` " -"which is used after class creation for lookup of existing members." -msgstr "" - -#: ../../howto/enum.rst:1407 -msgid "" -"*Do not* call ``super().__new__()``, as the lookup-only ``__new__`` is the " -"one that is found; instead, use the data type directly -- e.g.::" -msgstr "" - -#: ../../howto/enum.rst:1410 -msgid "obj = int.__new__(cls, value)" -msgstr "" - -#: ../../howto/enum.rst:1414 -msgid "OrderedEnum" -msgstr "OrderedEnum" - -#: ../../howto/enum.rst:1416 -msgid "" -"An ordered enumeration that is not based on :class:`IntEnum` and so " -"maintains the normal :class:`Enum` invariants (such as not being comparable " -"to other enumerations)::" -msgstr "" -":class:`IntEnum` をベースとしないため、通常の :class:`Enum` の不変条件 (他の" -"列挙型と比較できないなど) のままで、メンバーを順序付けできる列挙型です::" - -#: ../../howto/enum.rst:1420 -msgid "" -">>> class OrderedEnum(Enum):\n" -"... def __ge__(self, other):\n" -"... if self.__class__ is other.__class__:\n" -"... return self.value >= other.value\n" -"... return NotImplemented\n" -"... def __gt__(self, other):\n" -"... if self.__class__ is other.__class__:\n" -"... return self.value > other.value\n" -"... return NotImplemented\n" -"... def __le__(self, other):\n" -"... if self.__class__ is other.__class__:\n" -"... return self.value <= other.value\n" -"... return NotImplemented\n" -"... def __lt__(self, other):\n" -"... if self.__class__ is other.__class__:\n" -"... return self.value < other.value\n" -"... return NotImplemented\n" -"...\n" -">>> class Grade(OrderedEnum):\n" -"... A = 5\n" -"... B = 4\n" -"... C = 3\n" -"... D = 2\n" -"... F = 1\n" -"...\n" -">>> Grade.C < Grade.A\n" -"True" -msgstr "" - -#: ../../howto/enum.rst:1450 -msgid "DuplicateFreeEnum" -msgstr "DuplicateFreeEnum" - -#: ../../howto/enum.rst:1452 -msgid "" -"Raises an error if a duplicate member value is found instead of creating an " -"alias::" -msgstr "" -"値が重複するメンバーがある場合に、エイリアスを作成するのではなくエラーを発生" -"させます::" - -#: ../../howto/enum.rst:1455 -msgid "" -">>> class DuplicateFreeEnum(Enum):\n" -"... def __init__(self, *args):\n" -"... cls = self.__class__\n" -"... if any(self.value == e.value for e in cls):\n" -"... a = self.name\n" -"... e = cls(self.value).name\n" -"... raise ValueError(\n" -"... \"aliases not allowed in DuplicateFreeEnum: %r --> " -"%r\"\n" -"... % (a, e))\n" -"...\n" -">>> class Color(DuplicateFreeEnum):\n" -"... RED = 1\n" -"... GREEN = 2\n" -"... BLUE = 3\n" -"... GRENE = 2\n" -"...\n" -"Traceback (most recent call last):\n" -" ...\n" -"ValueError: aliases not allowed in DuplicateFreeEnum: 'GRENE' --> 'GREEN'" -msgstr "" - -#: ../../howto/enum.rst:1477 -msgid "" -"This is a useful example for subclassing Enum to add or change other " -"behaviors as well as disallowing aliases. If the only desired change is " -"disallowing aliases, the :func:`unique` decorator can be used instead." -msgstr "" -"これは Enum に別名を無効にするのと同様な振る舞いの追加や変更をおこなうための" -"サブクラス化に役立つ例です。単に別名を無効にしたいだけなら、 :func:`unique` " -"デコレーターを使用して行えます。" - -#: ../../howto/enum.rst:1483 -msgid "MultiValueEnum" -msgstr "" - -#: ../../howto/enum.rst:1485 -msgid "Supports having more than one value per member::" -msgstr "" - -#: ../../howto/enum.rst:1487 -msgid "" -">>> class MultiValueEnum(Enum):\n" -"... def __new__(cls, value, *values):\n" -"... self = object.__new__(cls)\n" -"... self._value_ = value\n" -"... for v in values:\n" -"... self._add_value_alias_(v)\n" -"... return self\n" -"...\n" -">>> class DType(MultiValueEnum):\n" -"... float32 = 'f', 8\n" -"... double64 = 'd', 9\n" -"...\n" -">>> DType('f')\n" -"\n" -">>> DType(9)\n" -"" -msgstr "" - -#: ../../howto/enum.rst:1506 -msgid "Planet" -msgstr "Planet" - -#: ../../howto/enum.rst:1508 -msgid "" -"If :meth:`~object.__new__` or :meth:`~object.__init__` is defined, the value " -"of the enum member will be passed to those methods::" -msgstr "" - -#: ../../howto/enum.rst:1511 -msgid "" -">>> class Planet(Enum):\n" -"... MERCURY = (3.303e+23, 2.4397e6)\n" -"... VENUS = (4.869e+24, 6.0518e6)\n" -"... EARTH = (5.976e+24, 6.37814e6)\n" -"... MARS = (6.421e+23, 3.3972e6)\n" -"... JUPITER = (1.9e+27, 7.1492e7)\n" -"... SATURN = (5.688e+26, 6.0268e7)\n" -"... URANUS = (8.686e+25, 2.5559e7)\n" -"... NEPTUNE = (1.024e+26, 2.4746e7)\n" -"... def __init__(self, mass, radius):\n" -"... self.mass = mass # in kilograms\n" -"... self.radius = radius # in meters\n" -"... @property\n" -"... def surface_gravity(self):\n" -"... # universal gravitational constant (m3 kg-1 s-2)\n" -"... G = 6.67300E-11\n" -"... return G * self.mass / (self.radius * self.radius)\n" -"...\n" -">>> Planet.EARTH.value\n" -"(5.976e+24, 6378140.0)\n" -">>> Planet.EARTH.surface_gravity\n" -"9.802652743337129" -msgstr "" - -#: ../../howto/enum.rst:1537 -msgid "TimePeriod" -msgstr "TimePeriod" - -#: ../../howto/enum.rst:1539 -msgid "An example to show the :attr:`~Enum._ignore_` attribute in use::" -msgstr "" - -#: ../../howto/enum.rst:1541 -msgid "" -">>> from datetime import timedelta\n" -">>> class Period(timedelta, Enum):\n" -"... \"different lengths of time\"\n" -"... _ignore_ = 'Period i'\n" -"... Period = vars()\n" -"... for i in range(367):\n" -"... Period['day_%d' % i] = i\n" -"...\n" -">>> list(Period)[:2]\n" -"[, ]\n" -">>> list(Period)[-2:]\n" -"[, ]" -msgstr "" - -#: ../../howto/enum.rst:1558 -msgid "Subclassing EnumType" -msgstr "EnumType のサブクラスを作る" - -#: ../../howto/enum.rst:1560 -msgid "" -"While most enum needs can be met by customizing :class:`Enum` subclasses, " -"either with class decorators or custom functions, :class:`EnumType` can be " -"subclassed to provide a different Enum experience." -msgstr "" diff --git a/howto/free-threading-extensions.po b/howto/free-threading-extensions.po deleted file mode 100644 index c30cc210f..000000000 --- a/howto/free-threading-extensions.po +++ /dev/null @@ -1,685 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation -# This file is distributed under the same license as the Python package. -# FIRST AUTHOR , YEAR. -# -# Translators: -# tomo, 2024 -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: Python 3.14\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-30 14:22+0000\n" -"PO-Revision-Date: 2024-06-20 06:42+0000\n" -"Last-Translator: tomo, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" -"ja/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#: ../../howto/free-threading-extensions.rst:7 -msgid "C API Extension Support for Free Threading" -msgstr "" - -#: ../../howto/free-threading-extensions.rst:9 -msgid "" -"Starting with the 3.13 release, CPython has experimental support for running " -"with the :term:`global interpreter lock` (GIL) disabled in a configuration " -"called :term:`free threading`. This document describes how to adapt C API " -"extensions to support free threading." -msgstr "" - -#: ../../howto/free-threading-extensions.rst:16 -msgid "Identifying the Free-Threaded Build in C" -msgstr "" - -#: ../../howto/free-threading-extensions.rst:18 -msgid "" -"The CPython C API exposes the ``Py_GIL_DISABLED`` macro: in the free-" -"threaded build it's defined to ``1``, and in the regular build it's not " -"defined. You can use it to enable code that only runs under the free-" -"threaded build::" -msgstr "" - -#: ../../howto/free-threading-extensions.rst:22 -msgid "" -"#ifdef Py_GIL_DISABLED\n" -"/* code that only runs in the free-threaded build */\n" -"#endif" -msgstr "" - -#: ../../howto/free-threading-extensions.rst:28 -msgid "" -"On Windows, this macro is not defined automatically, but must be specified " -"to the compiler when building. The :func:`sysconfig.get_config_var` function " -"can be used to determine whether the current running interpreter had the " -"macro defined." -msgstr "" - -#: ../../howto/free-threading-extensions.rst:35 -msgid "Module Initialization" -msgstr "" - -#: ../../howto/free-threading-extensions.rst:37 -msgid "" -"Extension modules need to explicitly indicate that they support running with " -"the GIL disabled; otherwise importing the extension will raise a warning and " -"enable the GIL at runtime." -msgstr "" - -#: ../../howto/free-threading-extensions.rst:41 -msgid "" -"There are two ways to indicate that an extension module supports running " -"with the GIL disabled depending on whether the extension uses multi-phase or " -"single-phase initialization." -msgstr "" - -#: ../../howto/free-threading-extensions.rst:46 -msgid "Multi-Phase Initialization" -msgstr "" - -#: ../../howto/free-threading-extensions.rst:48 -msgid "" -"Extensions that use multi-phase initialization (i.e., :c:func:" -"`PyModuleDef_Init`) should add a :c:data:`Py_mod_gil` slot in the module " -"definition. If your extension supports older versions of CPython, you " -"should guard the slot with a :c:data:`PY_VERSION_HEX` check." -msgstr "" - -#: ../../howto/free-threading-extensions.rst:55 -msgid "" -"static struct PyModuleDef_Slot module_slots[] = {\n" -" ...\n" -"#if PY_VERSION_HEX >= 0x030D0000\n" -" {Py_mod_gil, Py_MOD_GIL_NOT_USED},\n" -"#endif\n" -" {0, NULL}\n" -"};\n" -"\n" -"static struct PyModuleDef moduledef = {\n" -" PyModuleDef_HEAD_INIT,\n" -" .m_slots = module_slots,\n" -" ...\n" -"};" -msgstr "" - -#: ../../howto/free-threading-extensions.rst:71 -msgid "Single-Phase Initialization" -msgstr "" - -#: ../../howto/free-threading-extensions.rst:73 -msgid "" -"Extensions that use single-phase initialization (i.e., :c:func:" -"`PyModule_Create`) should call :c:func:`PyUnstable_Module_SetGIL` to " -"indicate that they support running with the GIL disabled. The function is " -"only defined in the free-threaded build, so you should guard the call with " -"``#ifdef Py_GIL_DISABLED`` to avoid compilation errors in the regular build." -msgstr "" - -#: ../../howto/free-threading-extensions.rst:81 -msgid "" -"static struct PyModuleDef moduledef = {\n" -" PyModuleDef_HEAD_INIT,\n" -" ...\n" -"};\n" -"\n" -"PyMODINIT_FUNC\n" -"PyInit_mymodule(void)\n" -"{\n" -" PyObject *m = PyModule_Create(&moduledef);\n" -" if (m == NULL) {\n" -" return NULL;\n" -" }\n" -"#ifdef Py_GIL_DISABLED\n" -" PyUnstable_Module_SetGIL(m, Py_MOD_GIL_NOT_USED);\n" -"#endif\n" -" return m;\n" -"}" -msgstr "" - -#: ../../howto/free-threading-extensions.rst:101 -msgid "General API Guidelines" -msgstr "" - -#: ../../howto/free-threading-extensions.rst:103 -msgid "Most of the C API is thread-safe, but there are some exceptions." -msgstr "" - -#: ../../howto/free-threading-extensions.rst:105 -msgid "" -"**Struct Fields**: Accessing fields in Python C API objects or structs " -"directly is not thread-safe if the field may be concurrently modified." -msgstr "" - -#: ../../howto/free-threading-extensions.rst:107 -msgid "" -"**Macros**: Accessor macros like :c:macro:`PyList_GET_ITEM`, :c:macro:" -"`PyList_SET_ITEM`, and macros like :c:macro:`PySequence_Fast_GET_SIZE` that " -"use the object returned by :c:func:`PySequence_Fast` do not perform any " -"error checking or locking. These macros are not thread-safe if the container " -"object may be modified concurrently." -msgstr "" - -#: ../../howto/free-threading-extensions.rst:113 -msgid "" -"**Borrowed References**: C API functions that return :term:`borrowed " -"references ` may not be thread-safe if the containing " -"object is modified concurrently. See the section on :ref:`borrowed " -"references ` for more information." -msgstr "" - -#: ../../howto/free-threading-extensions.rst:120 -msgid "Container Thread Safety" -msgstr "" - -#: ../../howto/free-threading-extensions.rst:122 -msgid "" -"Containers like :c:struct:`PyListObject`, :c:struct:`PyDictObject`, and :c:" -"struct:`PySetObject` perform internal locking in the free-threaded build. " -"For example, the :c:func:`PyList_Append` will lock the list before appending " -"an item." -msgstr "" - -#: ../../howto/free-threading-extensions.rst:130 -msgid "``PyDict_Next``" -msgstr "" - -#: ../../howto/free-threading-extensions.rst:132 -msgid "" -"A notable exception is :c:func:`PyDict_Next`, which does not lock the " -"dictionary. You should use :c:macro:`Py_BEGIN_CRITICAL_SECTION` to protect " -"the dictionary while iterating over it if the dictionary may be concurrently " -"modified::" -msgstr "" - -#: ../../howto/free-threading-extensions.rst:137 -msgid "" -"Py_BEGIN_CRITICAL_SECTION(dict);\n" -"PyObject *key, *value;\n" -"Py_ssize_t pos = 0;\n" -"while (PyDict_Next(dict, &pos, &key, &value)) {\n" -" ...\n" -"}\n" -"Py_END_CRITICAL_SECTION();" -msgstr "" - -#: ../../howto/free-threading-extensions.rst:147 -msgid "Borrowed References" -msgstr "" - -#: ../../howto/free-threading-extensions.rst:151 -msgid "" -"Some C API functions return :term:`borrowed references `. These APIs are not thread-safe if the containing object is " -"modified concurrently. For example, it's not safe to use :c:func:" -"`PyList_GetItem` if the list may be modified concurrently." -msgstr "" - -#: ../../howto/free-threading-extensions.rst:156 -msgid "" -"The following table lists some borrowed reference APIs and their " -"replacements that return :term:`strong references `." -msgstr "" - -#: ../../howto/free-threading-extensions.rst:160 -msgid "Borrowed reference API" -msgstr "" - -#: ../../howto/free-threading-extensions.rst:160 -msgid "Strong reference API" -msgstr "" - -#: ../../howto/free-threading-extensions.rst:162 -msgid ":c:func:`PyList_GetItem`" -msgstr "" - -#: ../../howto/free-threading-extensions.rst:162 -msgid ":c:func:`PyList_GetItemRef`" -msgstr "" - -#: ../../howto/free-threading-extensions.rst:164 -msgid ":c:func:`PyDict_GetItem`" -msgstr "" - -#: ../../howto/free-threading-extensions.rst:164 -#: ../../howto/free-threading-extensions.rst:166 -msgid ":c:func:`PyDict_GetItemRef`" -msgstr "" - -#: ../../howto/free-threading-extensions.rst:166 -msgid ":c:func:`PyDict_GetItemWithError`" -msgstr "" - -#: ../../howto/free-threading-extensions.rst:168 -msgid ":c:func:`PyDict_GetItemString`" -msgstr "" - -#: ../../howto/free-threading-extensions.rst:168 -msgid ":c:func:`PyDict_GetItemStringRef`" -msgstr "" - -#: ../../howto/free-threading-extensions.rst:170 -msgid ":c:func:`PyDict_SetDefault`" -msgstr "" - -#: ../../howto/free-threading-extensions.rst:170 -msgid ":c:func:`PyDict_SetDefaultRef`" -msgstr "" - -#: ../../howto/free-threading-extensions.rst:172 -msgid ":c:func:`PyDict_Next`" -msgstr "" - -#: ../../howto/free-threading-extensions.rst:172 -msgid "none (see :ref:`PyDict_Next`)" -msgstr "" - -#: ../../howto/free-threading-extensions.rst:174 -msgid ":c:func:`PyWeakref_GetObject`" -msgstr "" - -#: ../../howto/free-threading-extensions.rst:174 -#: ../../howto/free-threading-extensions.rst:176 -msgid ":c:func:`PyWeakref_GetRef`" -msgstr "" - -#: ../../howto/free-threading-extensions.rst:176 -msgid ":c:func:`PyWeakref_GET_OBJECT`" -msgstr "" - -#: ../../howto/free-threading-extensions.rst:178 -msgid ":c:func:`PyImport_AddModule`" -msgstr "" - -#: ../../howto/free-threading-extensions.rst:178 -msgid ":c:func:`PyImport_AddModuleRef`" -msgstr "" - -#: ../../howto/free-threading-extensions.rst:180 -msgid ":c:func:`PyCell_GET`" -msgstr "" - -#: ../../howto/free-threading-extensions.rst:180 -msgid ":c:func:`PyCell_Get`" -msgstr "" - -#: ../../howto/free-threading-extensions.rst:183 -msgid "" -"Not all APIs that return borrowed references are problematic. For example, :" -"c:func:`PyTuple_GetItem` is safe because tuples are immutable. Similarly, " -"not all uses of the above APIs are problematic. For example, :c:func:" -"`PyDict_GetItem` is often used for parsing keyword argument dictionaries in " -"function calls; those keyword argument dictionaries are effectively private " -"(not accessible by other threads), so using borrowed references in that " -"context is safe." -msgstr "" - -#: ../../howto/free-threading-extensions.rst:191 -msgid "" -"Some of these functions were added in Python 3.13. You can use the " -"`pythoncapi-compat `_ package " -"to provide implementations of these functions for older Python versions." -msgstr "" - -#: ../../howto/free-threading-extensions.rst:199 -msgid "Memory Allocation APIs" -msgstr "" - -#: ../../howto/free-threading-extensions.rst:201 -msgid "" -"Python's memory management C API provides functions in three different :ref:" -"`allocation domains `: \"raw\", \"mem\", and \"object\". " -"For thread-safety, the free-threaded build requires that only Python objects " -"are allocated using the object domain, and that all Python object 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 "" - -#: ../../howto/free-threading-extensions.rst:210 -msgid "" -"Search for uses of :c:func:`PyObject_Malloc` in your extension and check " -"that the allocated memory is used for Python objects. Use :c:func:" -"`PyMem_Malloc` to allocate buffers instead of :c:func:`PyObject_Malloc`." -msgstr "" - -#: ../../howto/free-threading-extensions.rst:217 -msgid "Thread State and GIL APIs" -msgstr "" - -#: ../../howto/free-threading-extensions.rst:219 -msgid "" -"Python provides a set of functions and macros to manage thread state and the " -"GIL, such as:" -msgstr "" - -#: ../../howto/free-threading-extensions.rst:222 -msgid ":c:func:`PyGILState_Ensure` and :c:func:`PyGILState_Release`" -msgstr "" - -#: ../../howto/free-threading-extensions.rst:223 -msgid ":c:func:`PyEval_SaveThread` and :c:func:`PyEval_RestoreThread`" -msgstr "" - -#: ../../howto/free-threading-extensions.rst:224 -msgid ":c:macro:`Py_BEGIN_ALLOW_THREADS` and :c:macro:`Py_END_ALLOW_THREADS`" -msgstr "" - -#: ../../howto/free-threading-extensions.rst:226 -msgid "" -"These functions should still be used in the free-threaded build to manage " -"thread state even when the :term:`GIL` is disabled. For example, if you " -"create a thread outside of Python, you must call :c:func:`PyGILState_Ensure` " -"before calling into the Python API to ensure that the thread has a valid " -"Python thread state." -msgstr "" - -#: ../../howto/free-threading-extensions.rst:232 -msgid "" -"You should continue to call :c:func:`PyEval_SaveThread` or :c:macro:" -"`Py_BEGIN_ALLOW_THREADS` around blocking operations, such as I/O or lock " -"acquisitions, to allow other threads to run the :term:`cyclic garbage " -"collector `." -msgstr "" - -#: ../../howto/free-threading-extensions.rst:239 -msgid "Protecting Internal Extension State" -msgstr "" - -#: ../../howto/free-threading-extensions.rst:241 -msgid "" -"Your extension may have internal state that was previously protected by the " -"GIL. You may need to add locking to protect this state. The approach will " -"depend on your extension, but some common patterns include:" -msgstr "" - -#: ../../howto/free-threading-extensions.rst:245 -msgid "" -"**Caches**: global caches are a common source of shared state. Consider " -"using a lock to protect the cache or disabling it in the free-threaded build " -"if the cache is not critical for performance." -msgstr "" - -#: ../../howto/free-threading-extensions.rst:248 -msgid "" -"**Global State**: global state may need to be protected by a lock or moved " -"to thread local storage. C11 and C++11 provide the ``thread_local`` or " -"``_Thread_local`` for `thread-local storage `_." -msgstr "" - -#: ../../howto/free-threading-extensions.rst:255 -msgid "Critical Sections" -msgstr "" - -#: ../../howto/free-threading-extensions.rst:259 -msgid "" -"In the free-threaded build, CPython provides a mechanism called \"critical " -"sections\" to protect data that would otherwise be protected by the GIL. " -"While extension authors may not interact with the internal critical section " -"implementation directly, understanding their behavior is crucial when using " -"certain C API functions or managing shared state in the free-threaded build." -msgstr "" - -#: ../../howto/free-threading-extensions.rst:266 -msgid "What Are Critical Sections?" -msgstr "" - -#: ../../howto/free-threading-extensions.rst:268 -msgid "" -"Conceptually, critical sections act as a deadlock avoidance layer built on " -"top of simple mutexes. Each thread maintains a stack of active critical " -"sections. When a thread needs to acquire a lock associated with a critical " -"section (e.g., implicitly when calling a thread-safe C API function like :c:" -"func:`PyDict_SetItem`, or explicitly using macros), it attempts to acquire " -"the underlying mutex." -msgstr "" - -#: ../../howto/free-threading-extensions.rst:276 -msgid "Using Critical Sections" -msgstr "" - -#: ../../howto/free-threading-extensions.rst:278 -msgid "The primary APIs for using critical sections are:" -msgstr "" - -#: ../../howto/free-threading-extensions.rst:280 -msgid "" -":c:macro:`Py_BEGIN_CRITICAL_SECTION` and :c:macro:`Py_END_CRITICAL_SECTION` " -"- For locking a single object" -msgstr "" - -#: ../../howto/free-threading-extensions.rst:283 -msgid "" -":c:macro:`Py_BEGIN_CRITICAL_SECTION2` and :c:macro:" -"`Py_END_CRITICAL_SECTION2` - For locking two objects simultaneously" -msgstr "" - -#: ../../howto/free-threading-extensions.rst:286 -msgid "" -"These macros must be used in matching pairs and must appear in the same C " -"scope, since they establish a new local scope. These macros are no-ops in " -"non-free-threaded builds, so they can be safely added to code that needs to " -"support both build types." -msgstr "" - -#: ../../howto/free-threading-extensions.rst:291 -msgid "" -"A common use of a critical section would be to lock an object while " -"accessing an internal attribute of it. For example, if an extension type " -"has an internal count field, you could use a critical section while reading " -"or writing that field::" -msgstr "" - -#: ../../howto/free-threading-extensions.rst:296 -msgid "" -"// read the count, returns new reference to internal count value\n" -"PyObject *result;\n" -"Py_BEGIN_CRITICAL_SECTION(obj);\n" -"result = Py_NewRef(obj->count);\n" -"Py_END_CRITICAL_SECTION();\n" -"return result;\n" -"\n" -"// write the count, consumes reference from new_count\n" -"Py_BEGIN_CRITICAL_SECTION(obj);\n" -"obj->count = new_count;\n" -"Py_END_CRITICAL_SECTION();" -msgstr "" - -#: ../../howto/free-threading-extensions.rst:310 -msgid "How Critical Sections Work" -msgstr "" - -#: ../../howto/free-threading-extensions.rst:312 -msgid "" -"Unlike traditional locks, critical sections do not guarantee exclusive " -"access throughout their entire duration. If a thread would block while " -"holding a critical section (e.g., by acquiring another lock or performing I/" -"O), the critical section is temporarily suspended—all locks are released—and " -"then resumed when the blocking operation completes." -msgstr "" - -#: ../../howto/free-threading-extensions.rst:318 -msgid "" -"This behavior is similar to what happens with the GIL when a thread makes a " -"blocking call. The key differences are:" -msgstr "" - -#: ../../howto/free-threading-extensions.rst:321 -msgid "Critical sections operate on a per-object basis rather than globally" -msgstr "" - -#: ../../howto/free-threading-extensions.rst:323 -msgid "" -"Critical sections follow a stack discipline within each thread (the " -"\"begin\" and \"end\" macros enforce this since they must be paired and " -"within the same scope)" -msgstr "" - -#: ../../howto/free-threading-extensions.rst:326 -msgid "" -"Critical sections automatically release and reacquire locks around potential " -"blocking operations" -msgstr "" - -#: ../../howto/free-threading-extensions.rst:330 -msgid "Deadlock Avoidance" -msgstr "" - -#: ../../howto/free-threading-extensions.rst:332 -msgid "Critical sections help avoid deadlocks in two ways:" -msgstr "" - -#: ../../howto/free-threading-extensions.rst:334 -msgid "" -"If a thread tries to acquire a lock that's already held by another thread, " -"it first suspends all of its active critical sections, temporarily releasing " -"their locks" -msgstr "" - -#: ../../howto/free-threading-extensions.rst:338 -msgid "" -"When the blocking operation completes, only the top-most critical section is " -"reacquired first" -msgstr "" - -#: ../../howto/free-threading-extensions.rst:341 -msgid "" -"This means you cannot rely on nested critical sections to lock multiple " -"objects at once, as the inner critical section may suspend the outer ones. " -"Instead, use :c:macro:`Py_BEGIN_CRITICAL_SECTION2` to lock two objects " -"simultaneously." -msgstr "" - -#: ../../howto/free-threading-extensions.rst:345 -msgid "" -"Note that the locks described above are only :c:type:`!PyMutex` based locks. " -"The critical section implementation does not know about or affect other " -"locking mechanisms that might be in use, like POSIX mutexes. Also note that " -"while blocking on any :c:type:`!PyMutex` causes the critical sections to be " -"suspended, only the mutexes that are part of the critical sections are " -"released. If :c:type:`!PyMutex` is used without a critical section, it will " -"not be released and therefore does not get the same deadlock avoidance." -msgstr "" - -#: ../../howto/free-threading-extensions.rst:354 -msgid "Important Considerations" -msgstr "" - -#: ../../howto/free-threading-extensions.rst:356 -msgid "" -"Critical sections may temporarily release their locks, allowing other " -"threads to modify the protected data. Be careful about making assumptions " -"about the state of the data after operations that might block." -msgstr "" - -#: ../../howto/free-threading-extensions.rst:360 -msgid "" -"Because locks can be temporarily released (suspended), entering a critical " -"section does not guarantee exclusive access to the protected resource " -"throughout the section's duration. If code within a critical section calls " -"another function that blocks (e.g., acquires another lock, performs blocking " -"I/O), all locks held by the thread via critical sections will be released. " -"This is similar to how the GIL can be released during blocking calls." -msgstr "" - -#: ../../howto/free-threading-extensions.rst:367 -msgid "" -"Only the lock(s) associated with the most recently entered (top-most) " -"critical section are guaranteed to be held at any given time. Locks for " -"outer, nested critical sections might have been suspended." -msgstr "" - -#: ../../howto/free-threading-extensions.rst:371 -msgid "" -"You can lock at most two objects simultaneously with these APIs. If you need " -"to lock more objects, you'll need to restructure your code." -msgstr "" - -#: ../../howto/free-threading-extensions.rst:374 -msgid "" -"While critical sections will not deadlock if you attempt to lock the same " -"object twice, they are less efficient than purpose-built reentrant locks for " -"this use case." -msgstr "" - -#: ../../howto/free-threading-extensions.rst:378 -msgid "" -"When using :c:macro:`Py_BEGIN_CRITICAL_SECTION2`, the order of the objects " -"doesn't affect correctness (the implementation handles deadlock avoidance), " -"but it's good practice to always lock objects in a consistent order." -msgstr "" - -#: ../../howto/free-threading-extensions.rst:382 -msgid "" -"Remember that the critical section macros are primarily for protecting " -"access to *Python objects* that might be involved in internal CPython " -"operations susceptible to the deadlock scenarios described above. For " -"protecting purely internal extension state, standard mutexes or other " -"synchronization primitives might be more appropriate." -msgstr "" - -#: ../../howto/free-threading-extensions.rst:390 -msgid "Building Extensions for the Free-Threaded Build" -msgstr "" - -#: ../../howto/free-threading-extensions.rst:392 -msgid "" -"C API extensions need to be built specifically for the free-threaded build. " -"The wheels, shared libraries, and binaries are indicated by a ``t`` suffix." -msgstr "" - -#: ../../howto/free-threading-extensions.rst:395 -msgid "" -"`pypa/manylinux `_ supports the free-" -"threaded build, with the ``t`` suffix, such as ``python3.13t``." -msgstr "" - -#: ../../howto/free-threading-extensions.rst:397 -msgid "" -"`pypa/cibuildwheel `_ supports the " -"free-threaded build if you set `CIBW_ENABLE to cpython-freethreading " -"`_." -msgstr "" - -#: ../../howto/free-threading-extensions.rst:402 -msgid "Limited C API and Stable ABI" -msgstr "" - -#: ../../howto/free-threading-extensions.rst:404 -msgid "" -"The free-threaded build does not currently support the :ref:`Limited C API " -"` or the stable ABI. If you use `setuptools `_ to build your extension and " -"currently set ``py_limited_api=True`` you can use ``py_limited_api=not " -"sysconfig.get_config_var(\"Py_GIL_DISABLED\")`` to opt out of the limited " -"API when building with the free-threaded build." -msgstr "" - -#: ../../howto/free-threading-extensions.rst:412 -msgid "" -"You will need to build separate wheels specifically for the free-threaded " -"build. If you currently use the stable ABI, you can continue to build a " -"single wheel for multiple non-free-threaded Python versions." -msgstr "" - -#: ../../howto/free-threading-extensions.rst:418 -msgid "Windows" -msgstr "Windows" - -#: ../../howto/free-threading-extensions.rst:420 -msgid "" -"Due to a limitation of the official Windows installer, you will need to " -"manually define ``Py_GIL_DISABLED=1`` when building extensions from source." -msgstr "" - -#: ../../howto/free-threading-extensions.rst:425 -msgid "" -"`Porting Extension Modules to Support Free-Threading `_: A community-maintained porting guide for " -"extension authors." -msgstr "" diff --git a/howto/free-threading-python.po b/howto/free-threading-python.po deleted file mode 100644 index d135d5645..000000000 --- a/howto/free-threading-python.po +++ /dev/null @@ -1,301 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation -# This file is distributed under the same license as the Python package. -# FIRST AUTHOR , YEAR. -# -# Translators: -# tomo, 2024 -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: Python 3.14\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-06 14:20+0000\n" -"PO-Revision-Date: 2024-10-04 14:19+0000\n" -"Last-Translator: tomo, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" -"ja/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#: ../../howto/free-threading-python.rst:5 -msgid "Python experimental support for free threading" -msgstr "" - -#: ../../howto/free-threading-python.rst:7 -msgid "" -"Starting with the 3.13 release, CPython has experimental support for a build " -"of Python called :term:`free threading` where the :term:`global interpreter " -"lock` (GIL) is disabled. Free-threaded execution allows for full " -"utilization of the available processing power by running threads in parallel " -"on available CPU cores. While not all software will benefit from this " -"automatically, programs designed with threading in mind will run faster on " -"multi-core hardware." -msgstr "" - -#: ../../howto/free-threading-python.rst:14 -msgid "" -"**The free-threaded mode is experimental** and work is ongoing to improve " -"it: expect some bugs and a substantial single-threaded performance hit." -msgstr "" - -#: ../../howto/free-threading-python.rst:17 -msgid "" -"This document describes the implications of free threading for Python code. " -"See :ref:`freethreading-extensions-howto` for information on how to write C " -"extensions that support the free-threaded build." -msgstr "" - -#: ../../howto/free-threading-python.rst:23 -msgid "" -":pep:`703` – Making the Global Interpreter Lock Optional in CPython for an " -"overall description of free-threaded Python." -msgstr "" - -#: ../../howto/free-threading-python.rst:28 -msgid "Installation" -msgstr "" - -#: ../../howto/free-threading-python.rst:30 -msgid "" -"Starting with Python 3.13, the official macOS and Windows installers " -"optionally support installing free-threaded Python binaries. The installers " -"are available at https://www.python.org/downloads/." -msgstr "" - -#: ../../howto/free-threading-python.rst:34 -msgid "" -"For information on other platforms, see the `Installing a Free-Threaded " -"Python `_, a " -"community-maintained installation guide for installing free-threaded Python." -msgstr "" - -#: ../../howto/free-threading-python.rst:38 -msgid "" -"When building CPython from source, the :option:`--disable-gil` configure " -"option should be used to build a free-threaded Python interpreter." -msgstr "" - -#: ../../howto/free-threading-python.rst:43 -msgid "Identifying free-threaded Python" -msgstr "" - -#: ../../howto/free-threading-python.rst:45 -msgid "" -"To check if the current interpreter supports free-threading, :option:`python " -"-VV <-V>` and :data:`sys.version` contain \"experimental free-threading " -"build\". The new :func:`sys._is_gil_enabled` function can be used to check " -"whether the GIL is actually disabled in the running process." -msgstr "" - -#: ../../howto/free-threading-python.rst:50 -msgid "" -"The ``sysconfig.get_config_var(\"Py_GIL_DISABLED\")`` configuration variable " -"can be used to determine whether the build supports free threading. If the " -"variable is set to ``1``, then the build supports free threading. This is " -"the recommended mechanism for decisions related to the build configuration." -msgstr "" - -#: ../../howto/free-threading-python.rst:57 -msgid "The global interpreter lock in free-threaded Python" -msgstr "" - -#: ../../howto/free-threading-python.rst:59 -msgid "" -"Free-threaded builds of CPython support optionally running with the GIL " -"enabled at runtime using the environment variable :envvar:`PYTHON_GIL` or " -"the command-line option :option:`-X gil`." -msgstr "" - -#: ../../howto/free-threading-python.rst:63 -msgid "" -"The GIL may also automatically be enabled when importing a C-API extension " -"module that is not explicitly marked as supporting free threading. A " -"warning will be printed in this case." -msgstr "" - -#: ../../howto/free-threading-python.rst:67 -msgid "" -"In addition to individual package documentation, the following websites " -"track the status of popular packages support for free threading:" -msgstr "" - -#: ../../howto/free-threading-python.rst:70 -msgid "https://py-free-threading.github.io/tracking/" -msgstr "" - -#: ../../howto/free-threading-python.rst:71 -msgid "https://hugovk.github.io/free-threaded-wheels/" -msgstr "" - -#: ../../howto/free-threading-python.rst:75 -msgid "Thread safety" -msgstr "" - -#: ../../howto/free-threading-python.rst:77 -msgid "" -"The free-threaded build of CPython aims to provide similar thread-safety " -"behavior at the Python level to the default GIL-enabled build. Built-in " -"types like :class:`dict`, :class:`list`, and :class:`set` use internal locks " -"to protect against concurrent modifications in ways that behave similarly to " -"the GIL. However, Python has not historically guaranteed specific behavior " -"for concurrent modifications to these built-in types, so this should be " -"treated as a description of the current implementation, not a guarantee of " -"current or future behavior." -msgstr "" - -#: ../../howto/free-threading-python.rst:88 -msgid "" -"It's recommended to use the :class:`threading.Lock` or other synchronization " -"primitives instead of relying on the internal locks of built-in types, when " -"possible." -msgstr "" - -#: ../../howto/free-threading-python.rst:94 -msgid "Known limitations" -msgstr "" - -#: ../../howto/free-threading-python.rst:96 -msgid "" -"This section describes known limitations of the free-threaded CPython build." -msgstr "" - -#: ../../howto/free-threading-python.rst:99 -msgid "Immortalization" -msgstr "" - -#: ../../howto/free-threading-python.rst:101 -msgid "" -"The free-threaded build of the 3.13 release makes some objects :term:" -"`immortal`. Immortal objects are not deallocated and have reference counts " -"that are never modified. This is done to avoid reference count contention " -"that would prevent efficient multi-threaded scaling." -msgstr "" - -#: ../../howto/free-threading-python.rst:106 -msgid "" -"An object will be made immortal when a new thread is started for the first " -"time after the main thread is running. The following objects are " -"immortalized:" -msgstr "" - -#: ../../howto/free-threading-python.rst:109 -msgid "" -":ref:`function ` objects declared at the module level" -msgstr "" - -#: ../../howto/free-threading-python.rst:110 -msgid ":ref:`method ` descriptors" -msgstr "" - -#: ../../howto/free-threading-python.rst:111 -msgid ":ref:`code ` objects" -msgstr "" - -#: ../../howto/free-threading-python.rst:112 -msgid ":term:`module` objects and their dictionaries" -msgstr "" - -#: ../../howto/free-threading-python.rst:113 -msgid ":ref:`classes ` (type objects)" -msgstr "" - -#: ../../howto/free-threading-python.rst:115 -msgid "" -"Because immortal objects are never deallocated, applications that create " -"many objects of these types may see increased memory usage. This is " -"expected to be addressed in the 3.14 release." -msgstr "" - -#: ../../howto/free-threading-python.rst:119 -msgid "" -"Additionally, numeric and string literals in the code as well as strings " -"returned by :func:`sys.intern` are also immortalized. This behavior is " -"expected to remain in the 3.14 free-threaded build." -msgstr "" - -#: ../../howto/free-threading-python.rst:125 -msgid "Frame objects" -msgstr "フレーム (frame) オブジェクト" - -#: ../../howto/free-threading-python.rst:127 -msgid "" -"It is not safe to access :ref:`frame ` objects from other " -"threads and doing so may cause your program to crash . This means that :" -"func:`sys._current_frames` is generally not safe to use in a free-threaded " -"build. Functions like :func:`inspect.currentframe` and :func:`sys." -"_getframe` are generally safe as long as the resulting frame object is not " -"passed to another thread." -msgstr "" - -#: ../../howto/free-threading-python.rst:135 -msgid "Iterators" -msgstr "イテレータ (iterator)" - -#: ../../howto/free-threading-python.rst:137 -msgid "" -"Sharing the same iterator object between multiple threads is generally not " -"safe and threads may see duplicate or missing elements when iterating or " -"crash the interpreter." -msgstr "" - -#: ../../howto/free-threading-python.rst:143 -msgid "Single-threaded performance" -msgstr "" - -#: ../../howto/free-threading-python.rst:145 -msgid "" -"The free-threaded build has additional overhead when executing Python code " -"compared to the default GIL-enabled build. In 3.13, this overhead is about " -"40% on the `pyperformance `_ suite. " -"Programs that spend most of their time in C extensions or I/O will see less " -"of an impact. The largest impact is because the specializing adaptive " -"interpreter (:pep:`659`) is disabled in the free-threaded build. We expect " -"to re-enable it in a thread-safe way in the 3.14 release. This overhead is " -"expected to be reduced in upcoming Python release. We are aiming for an " -"overhead of 10% or less on the pyperformance suite compared to the default " -"GIL-enabled build." -msgstr "" - -#: ../../howto/free-threading-python.rst:158 -msgid "Behavioral changes" -msgstr "" - -#: ../../howto/free-threading-python.rst:160 -msgid "" -"This section describes CPython behavioural changes with the free-threaded " -"build." -msgstr "" - -#: ../../howto/free-threading-python.rst:165 -msgid "Context variables" -msgstr "" - -#: ../../howto/free-threading-python.rst:167 -msgid "" -"In the free-threaded build, the flag :data:`~sys.flags." -"thread_inherit_context` is set to true by default which causes threads " -"created with :class:`threading.Thread` to start with a copy of the :class:" -"`~contextvars.Context()` of the caller of :meth:`~threading.Thread.start`. " -"In the default GIL-enabled build, the flag defaults to false so threads " -"start with an empty :class:`~contextvars.Context()`." -msgstr "" - -#: ../../howto/free-threading-python.rst:177 -msgid "Warning filters" -msgstr "" - -#: ../../howto/free-threading-python.rst:179 -msgid "" -"In the free-threaded build, the flag :data:`~sys.flags." -"context_aware_warnings` is set to true by default. In the default GIL-" -"enabled build, the flag defaults to false. If the flag is true then the :" -"class:`warnings.catch_warnings` context manager uses a context variable for " -"warning filters. If the flag is false then :class:`~warnings." -"catch_warnings` modifies the global filters list, which is not thread-safe. " -"See the :mod:`warnings` module for more details." -msgstr "" diff --git a/howto/functional.po b/howto/functional.po index 7516e52b0..aada10adb 100644 --- a/howto/functional.po +++ b/howto/functional.po @@ -1,32 +1,37 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# mollinaca, 2021 -# tomo, 2021 -# Atsuo Ishimoto , 2022 -# 菊池 健志, 2023 -# TENMYO Masakazu, 2024 +# ごはんですよ , 2017 +# Ryuichi Takano , 2017 +# Inada Naoki , 2017 +# Yusuke Miyazaki , 2017 +# Arihiro TAKASE, 2017 +# 秘湯 , 2017 +# Nozomu Kaneko , 2017 +# tomo, 2019 +# Tetsuo Koyama , 2020 +# mollinaca, 2020 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-30 14:22+0000\n" -"PO-Revision-Date: 2021-06-28 00:53+0000\n" -"Last-Translator: TENMYO Masakazu, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 17:44+0000\n" +"Last-Translator: mollinaca, 2020\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: ../../howto/functional.rst:5 +#: ../../howto/functional.rst:3 msgid "Functional Programming HOWTO" msgstr "関数型プログラミング HOWTO" @@ -34,7 +39,7 @@ msgstr "関数型プログラミング HOWTO" msgid "Author" msgstr "著者" -#: ../../howto/functional.rst:7 +#: ../../howto/functional.rst:5 msgid "A. M. Kuchling" msgstr "A. M. Kuchling" @@ -42,11 +47,11 @@ msgstr "A. M. Kuchling" msgid "Release" msgstr "リリース" -#: ../../howto/functional.rst:8 +#: ../../howto/functional.rst:6 msgid "0.32" msgstr "0.32" -#: ../../howto/functional.rst:10 +#: ../../howto/functional.rst:8 msgid "" "In this document, we'll take a tour of Python's features suitable for " "implementing programs in a functional style. After an introduction to the " @@ -60,11 +65,11 @@ msgstr "" "`itertools` や :mod:`functools` といった関連するライブラリモジュールを見るこ" "とにします。" -#: ../../howto/functional.rst:18 +#: ../../howto/functional.rst:16 msgid "Introduction" msgstr "はじめに" -#: ../../howto/functional.rst:20 +#: ../../howto/functional.rst:18 msgid "" "This section explains the basic concept of functional programming; if you're " "just interested in learning about Python language features, skip to the next " @@ -74,14 +79,14 @@ msgstr "" "だけ知りたい人は、次の章の :ref:`functional-howto-iterators` まで飛ばしてくだ" "さい。" -#: ../../howto/functional.rst:24 +#: ../../howto/functional.rst:22 msgid "" "Programming languages support decomposing problems in several different ways:" msgstr "" "プログラミング言語とは問題を分解するものですが、各言語がサポートする分解方法" "にはいくつかの種類があります:" -#: ../../howto/functional.rst:26 +#: ../../howto/functional.rst:24 msgid "" "Most programming languages are **procedural**: programs are lists of " "instructions that tell the computer what to do with the program's input. C, " @@ -91,7 +96,7 @@ msgstr "" "行うべきことをコンピュータに教える指示リストとなります。 C, Pascal, さらには " "Unix シェルまでもが手続き型言語に入ります。" -#: ../../howto/functional.rst:30 +#: ../../howto/functional.rst:28 msgid "" "In **declarative** languages, you write a specification that describes the " "problem to be solved, and the language implementation figures out how to " @@ -106,7 +111,7 @@ msgstr "" "で、テーブルを走査するかインデックスを使うか、どのサブクローズから実行するか" "等々を決めるのは SQL エンジンなのです。" -#: ../../howto/functional.rst:37 +#: ../../howto/functional.rst:35 msgid "" "**Object-oriented** programs manipulate collections of objects. Objects " "have internal state and support methods that query or modify this internal " @@ -120,7 +125,7 @@ msgstr "" "ジェクト指向プログラミングをサポートしていますが、関連する機能を使わなくても" "構わないようになっています。" -#: ../../howto/functional.rst:43 +#: ../../howto/functional.rst:41 msgid "" "**Functional** programming decomposes a problem into a set of functions. " "Ideally, functions only take inputs and produce outputs, and don't have any " @@ -133,7 +138,7 @@ msgstr "" "な内部状態を一切持ちません。有名な関数型言語には ML 一家 (Standard ML, OCaml " "等々) と Haskell があります。" -#: ../../howto/functional.rst:49 +#: ../../howto/functional.rst:47 msgid "" "The designers of some computer languages choose to emphasize one particular " "approach to programming. This often makes it difficult to write programs " @@ -154,7 +159,7 @@ msgstr "" "オブジェクト指向で、でも処理ロジックは手続き型や関数型で、といったようにで" "す。" -#: ../../howto/functional.rst:60 +#: ../../howto/functional.rst:58 msgid "" "In a functional program, input flows through a set of functions. Each " "function operates on its input and produces some output. Functional style " @@ -172,23 +177,24 @@ msgstr "" "構造を持たない、つまり各関数の出力はその入力にしか影響を受けてはいけないとい" "うことです。" -#: ../../howto/functional.rst:68 +#: ../../howto/functional.rst:66 msgid "" "Some languages are very strict about purity and don't even have assignment " "statements such as ``a=3`` or ``c = a + b``, but it's difficult to avoid all " -"side effects, such as printing to the screen or writing to a disk file. " -"Another example is a call to the :func:`print` or :func:`time.sleep` " -"function, neither of which returns a useful value. Both are called only for " -"their side effects of sending some text to the screen or pausing execution " -"for a second." +"side effects. Printing to the screen or writing to a disk file are side " +"effects, for example. For example, in Python a call to the :func:`print` " +"or :func:`time.sleep` function both return no useful value; they're only " +"called for their side effects of sending some text to the screen or pausing " +"execution for a second." msgstr "" -"ある言語では純粋さにとても厳しく ``a=3`` や ``c = a + b`` のような代入文すら" -"存在しないほどですが、画面への表示やディスクファイルへの書き込みなど、すべて" -"の副作用を避けるのは難しいです。別の例として、 :func:`print` や :func:`time." -"sleep` 関数の呼び出しもありますが、どちらも有用な値を返しません。画面にテキス" -"トを送ったり、実行を 1 秒間停めたりといった副作用のためだけに呼ばれるのです。" +"この純粋性を守る面で非常に厳しい言語もあり、そうした言語には ``a=3`` や ``c " +"= a + b`` といった代入文さえありません。しかし副作用を完全になくすのは難しい" +"もので、たとえば画面表示やディスクファイルへの書き込みも副作用なのです。 " +"Python で言うと、たとえば :func:`print` や :func:`time.sleep` 関数の呼び出し" +"はどちらも意味ある値を返しません; ただ画面にテキストを送ったり動作を 1 秒止め" +"たりといった副作用のためだけに呼ばれるのです。" -#: ../../howto/functional.rst:75 +#: ../../howto/functional.rst:74 msgid "" "Python programs written in functional style usually won't go to the extreme " "of avoiding all I/O or all assignments; instead, they'll provide a " @@ -203,7 +209,7 @@ msgstr "" "は使いますが、グローバル変数は変更せず、他の副作用もないように実装するので" "す。" -#: ../../howto/functional.rst:81 +#: ../../howto/functional.rst:80 msgid "" "Functional programming can be considered the opposite of object-oriented " "programming. Objects are little capsules containing some internal state " @@ -223,7 +229,7 @@ msgstr "" "クション、等々) を表現したインスタンスを、関数が受け渡しするようにするので" "す。" -#: ../../howto/functional.rst:90 +#: ../../howto/functional.rst:89 msgid "" "Functional design may seem like an odd constraint to work under. Why should " "you avoid objects and side effects? There are theoretical and practical " @@ -233,27 +239,27 @@ msgstr "" "ジェクトも副作用もないほうが良いのでしょうか。実は、関数型スタイルには理論と" "実践に基づく次の利点があるのです:" -#: ../../howto/functional.rst:94 +#: ../../howto/functional.rst:93 msgid "Formal provability." msgstr "形式的証明可能性。" -#: ../../howto/functional.rst:95 +#: ../../howto/functional.rst:94 msgid "Modularity." msgstr "モジュラー性。" -#: ../../howto/functional.rst:96 +#: ../../howto/functional.rst:95 msgid "Composability." msgstr "結合性。" -#: ../../howto/functional.rst:97 +#: ../../howto/functional.rst:96 msgid "Ease of debugging and testing." msgstr "デバッグやテストの簡単さ。" -#: ../../howto/functional.rst:101 +#: ../../howto/functional.rst:100 msgid "Formal provability" msgstr "形式的証明可能性" -#: ../../howto/functional.rst:103 +#: ../../howto/functional.rst:102 msgid "" "A theoretical benefit is that it's easier to construct a mathematical proof " "that a functional program is correct." @@ -261,7 +267,7 @@ msgstr "" "理論面の利点としては、プログラムが正しいことの数学的証明を他より簡単に構築で" "きるという点があります。" -#: ../../howto/functional.rst:106 +#: ../../howto/functional.rst:105 msgid "" "For a long time researchers have been interested in finding ways to " "mathematically prove programs correct. This is different from testing a " @@ -276,7 +282,7 @@ msgstr "" "そうだ」と言うのとも別の話です; 目指すのは、出現しうる入力すべてに対してプロ" "グラムが正しい結果を出すことの厳密な証明なのです。" -#: ../../howto/functional.rst:113 +#: ../../howto/functional.rst:112 msgid "" "The technique used to prove programs correct is to write down " "**invariants**, properties of the input data and of the program's variables " @@ -293,7 +299,7 @@ msgstr "" "終わりまで続けるわけです。すると最終的な不変式はプログラムの出力に合った条件" "になっているはずです。" -#: ../../howto/functional.rst:121 +#: ../../howto/functional.rst:120 msgid "" "Functional programming's avoidance of assignments arose because assignments " "are difficult to handle with this technique; assignments can break " @@ -304,7 +310,7 @@ msgstr "" "いからです; 代入は、それまで真だった不変式を壊しておいて、自分は次の行に伝え" "てゆける不変式を生み出さないことがあるのです。" -#: ../../howto/functional.rst:126 +#: ../../howto/functional.rst:125 msgid "" "Unfortunately, proving programs correct is largely impractical and not " "relevant to Python software. Even trivial programs require proofs that are " @@ -324,11 +330,11 @@ msgstr "" "ります; 証明に間違いがあるかもしれず、その場合は証明したと自分で勝手に思い込" "んでいただけになるのです。" -#: ../../howto/functional.rst:137 +#: ../../howto/functional.rst:136 msgid "Modularity" msgstr "モジュラー性" -#: ../../howto/functional.rst:139 +#: ../../howto/functional.rst:138 msgid "" "A more practical benefit of functional programming is that it forces you to " "break apart your problem into small pieces. Programs are more modular as a " @@ -342,15 +348,15 @@ msgstr "" "が書きやすいものです。それに、小さいほうが読むのもエラーをチェックするのも簡" "単です。" -#: ../../howto/functional.rst:147 +#: ../../howto/functional.rst:146 msgid "Ease of debugging and testing" -msgstr "デバッグやテストの簡単さ" +msgstr "デバグやテストの簡単さ" -#: ../../howto/functional.rst:149 +#: ../../howto/functional.rst:148 msgid "Testing and debugging a functional-style program is easier." -msgstr "テストやデバッグも関数型プログラムなら簡単です。" +msgstr "テストやデバグも関数型プログラムなら簡単です。" -#: ../../howto/functional.rst:151 +#: ../../howto/functional.rst:150 msgid "" "Debugging is simplified because functions are generally small and clearly " "specified. When a program doesn't work, each function is an interface point " @@ -358,12 +364,12 @@ msgid "" "intermediate inputs and outputs to quickly isolate the function that's " "responsible for a bug." msgstr "" -"関数が一般的に小さくて明確に意味付けされているので、デバッグ方法は単純です。" -"プログラムが正しく動かないときには、関数ひとつひとつがデータの正しさをチェッ" -"クするポイントになるので、それぞれの時点における入力と出力を見ていけば、バグ" -"の原因となる関数を素早く切り出すことができるのです。" +"関数が一般的に小さくて明確に意味付けされているので、デバグ方法は単純です。プ" +"ログラムが正しく動かないときには、関数ひとつひとつがデータの正しさをチェック" +"するポイントになるので、それぞれの時点における入力と出力を見ていけば、バグの" +"原因となる関数を素早く切り出すことができるのです。" -#: ../../howto/functional.rst:156 +#: ../../howto/functional.rst:155 msgid "" "Testing is easier because each function is a potential subject for a unit " "test. Functions don't depend on system state that needs to be replicated " @@ -375,11 +381,11 @@ msgstr "" "再現する必要はありません; 単に適切な入力を合成して、出力が期待どおりかどうか" "チェックするだけで良いのです。" -#: ../../howto/functional.rst:163 +#: ../../howto/functional.rst:162 msgid "Composability" msgstr "結合性" -#: ../../howto/functional.rst:165 +#: ../../howto/functional.rst:164 msgid "" "As you work on a functional-style program, you'll write a number of " "functions with varying inputs and outputs. Some of these functions will be " @@ -395,7 +401,7 @@ msgstr "" "ば、ディレクトリ名を受け取ってその中の XML ファイル一覧を返す関数や、ファイル" "名を受け取って内容を返す関数などは、多様な場面に適用できそうです。" -#: ../../howto/functional.rst:172 +#: ../../howto/functional.rst:171 msgid "" "Over time you'll form a personal library of utilities. Often you'll " "assemble new programs by arranging existing functions in a new configuration " @@ -405,11 +411,11 @@ msgstr "" "グラムも、既存の関数を調整して少し今回に特化した関数を書くだけで組み立てられ" "るようになります。" -#: ../../howto/functional.rst:180 +#: ../../howto/functional.rst:179 msgid "Iterators" msgstr "イテレータ (iterator)" -#: ../../howto/functional.rst:182 +#: ../../howto/functional.rst:181 msgid "" "I'll start by looking at a Python language feature that's an important " "foundation for writing functional-style programs: iterators." @@ -417,7 +423,7 @@ msgstr "" "まずは関数型スタイルのプログラムを書く際の基礎となる重要な Python 機能から見" "ていきましょう: イテレータです。" -#: ../../howto/functional.rst:185 +#: ../../howto/functional.rst:184 msgid "" "An iterator is an object representing a stream of data; this object returns " "the data one element at a time. A Python iterator must support a method " @@ -435,7 +441,7 @@ msgstr "" "る必要はありません; 無限のストリームを生成するイテレータを書くというのもまっ" "たく理に適ったことです。" -#: ../../howto/functional.rst:193 +#: ../../howto/functional.rst:192 msgid "" "The built-in :func:`iter` function takes an arbitrary object and tries to " "return an iterator that will return the object's contents or elements, " @@ -450,11 +456,11 @@ msgstr "" "テレータ化のできるものがあり、 中でもよく使われるのはリストと辞書です。イテ" "レータを作れる オブジェクトは :term:`iterable` オブジェクトと呼ばれます。" -#: ../../howto/functional.rst:200 +#: ../../howto/functional.rst:199 msgid "You can experiment with the iteration interface manually:" msgstr "手を動かしてイテレータ化の実験をしてみましょう:" -#: ../../howto/functional.rst:218 +#: ../../howto/functional.rst:217 msgid "" "Python expects iterable objects in several different contexts, the most " "important being the :keyword:`for` statement. In the statement ``for X in " @@ -466,16 +472,7 @@ msgstr "" "るいは :func:`iter` でイテレータを作れるオブジェクトである必要があります。次" "の二つは同じ意味になります::" -#: ../../howto/functional.rst:224 -msgid "" -"for i in iter(obj):\n" -" print(i)\n" -"\n" -"for i in obj:\n" -" print(i)" -msgstr "" - -#: ../../howto/functional.rst:230 +#: ../../howto/functional.rst:229 msgid "" "Iterators can be materialized as lists or tuples by using the :func:`list` " "or :func:`tuple` constructor functions:" @@ -483,7 +480,7 @@ msgstr "" "イテレータは :func:`list` や :func:`tuple` といったコンストラクタ関数を使って" "リストやタプルに具現化することができます:" -#: ../../howto/functional.rst:239 +#: ../../howto/functional.rst:238 msgid "" "Sequence unpacking also supports iterators: if you know an iterator will " "return N elements, you can unpack them into an N-tuple:" @@ -491,7 +488,7 @@ msgstr "" "シーケンスのアンパックもイテレータに対応しています: イテレータが N 個の要素を" "返すということが事前にわかっていれば、N-タプルにアンパックすることができます:" -#: ../../howto/functional.rst:248 +#: ../../howto/functional.rst:247 msgid "" "Built-in functions such as :func:`max` and :func:`min` can take a single " "iterator argument and will return the largest or smallest element. The " @@ -509,7 +506,7 @@ msgstr "" "素 X がストリームに出てこなければ ``\"in\"``, ``\"not in\"`` オペレータも戻り" "ません。" -#: ../../howto/functional.rst:256 +#: ../../howto/functional.rst:255 msgid "" "Note that you can only go forward in an iterator; there's no way to get the " "previous element, reset the iterator, or make a copy of it. Iterator " @@ -526,11 +523,11 @@ msgstr "" "ら関数はイテレータの出力を使い尽くして しまうかもしれませんし、同じストリーム" "に何か別のことをする 必要があるなら新しいイテレータを作らなくてはいけません。" -#: ../../howto/functional.rst:266 +#: ../../howto/functional.rst:265 msgid "Data Types That Support Iterators" msgstr "イテレータ対応のデータ型" -#: ../../howto/functional.rst:268 +#: ../../howto/functional.rst:267 msgid "" "We've already seen how lists and tuples support iterators. In fact, any " "Python sequence type, such as strings, will automatically support creation " @@ -540,7 +537,7 @@ msgstr "" "ころ Python のシーケンス型はどれでも、たとえば文字列なども、自動でイテレータ" "生成に対応しています。" -#: ../../howto/functional.rst:272 +#: ../../howto/functional.rst:271 msgid "" "Calling :func:`iter` on a dictionary returns an iterator that will loop over " "the dictionary's keys::" @@ -548,27 +545,7 @@ msgstr "" "辞書に対して :func:`iter` すると、辞書のキーでループを回すイテレータが返され" "ます::" -#: ../../howto/functional.rst:275 -msgid "" -">>> m = {'Jan': 1, 'Feb': 2, 'Mar': 3, 'Apr': 4, 'May': 5, 'Jun': 6,\n" -"... 'Jul': 7, 'Aug': 8, 'Sep': 9, 'Oct': 10, 'Nov': 11, 'Dec': 12}\n" -">>> for key in m:\n" -"... print(key, m[key])\n" -"Jan 1\n" -"Feb 2\n" -"Mar 3\n" -"Apr 4\n" -"May 5\n" -"Jun 6\n" -"Jul 7\n" -"Aug 8\n" -"Sep 9\n" -"Oct 10\n" -"Nov 11\n" -"Dec 12" -msgstr "" - -#: ../../howto/functional.rst:292 +#: ../../howto/functional.rst:291 msgid "" "Note that starting with Python 3.7, dictionary iteration order is guaranteed " "to be the same as the insertion order. In earlier versions, the behaviour " @@ -579,7 +556,7 @@ msgstr "" "以前のバージョンでは、その振る舞いは仕様が定められておらず、実装ごとに異なる" "ことがありました。" -#: ../../howto/functional.rst:296 +#: ../../howto/functional.rst:295 msgid "" "Applying :func:`iter` to a dictionary always loops over the keys, but " "dictionaries have methods that return other iterators. If you want to " @@ -591,7 +568,7 @@ msgstr "" "トしたければ、:meth:`~dict.values`, :meth:`~dict.items` というメソッドでイテ" "レータを作ることができます。" -#: ../../howto/functional.rst:302 +#: ../../howto/functional.rst:301 msgid "" "The :func:`dict` constructor can accept an iterator that returns a finite " "stream of ``(key, value)`` tuples:" @@ -599,7 +576,7 @@ msgstr "" "逆に :func:`dict` コンストラクタは、有限な ``(key, value)`` タプルのストリー" "ムを返すイテレータを受け入れることができます:" -#: ../../howto/functional.rst:309 +#: ../../howto/functional.rst:308 msgid "" "Files also support iteration by calling the :meth:`~io.TextIOBase.readline` " "method until there are no more lines in the file. This means you can read " @@ -609,14 +586,7 @@ msgstr "" "ことでイテレータ化に対応しています。つまりこうやってファイルの各行を読んでい" "くことができるわけです::" -#: ../../howto/functional.rst:313 -msgid "" -"for line in file:\n" -" # do something for each line\n" -" ..." -msgstr "" - -#: ../../howto/functional.rst:317 +#: ../../howto/functional.rst:316 msgid "" "Sets can take their contents from an iterable and let you iterate over the " "set's elements::" @@ -624,24 +594,11 @@ msgstr "" "セットはイテラブルを受け取れますし、そのセットの要素でイテレートすることもで" "きます::" -#: ../../howto/functional.rst:320 -msgid "" -">>> S = {2, 3, 5, 7, 11, 13}\n" -">>> for i in S:\n" -"... print(i)\n" -"2\n" -"3\n" -"5\n" -"7\n" -"11\n" -"13" -msgstr "" - -#: ../../howto/functional.rst:333 +#: ../../howto/functional.rst:326 msgid "Generator expressions and list comprehensions" msgstr "ジェネレータ式とリスト内包表記" -#: ../../howto/functional.rst:335 +#: ../../howto/functional.rst:328 msgid "" "Two common operations on an iterator's output are 1) performing some " "operation for every element, 2) selecting a subset of elements that meet " @@ -654,7 +611,7 @@ msgstr "" "リストなら、各行のうしろに付いた邪魔なホワイトスペースを削りたいとか、特定の" "文字列を含む部分をピックアップしたいなどと思うかもしれません。" -#: ../../howto/functional.rst:341 +#: ../../howto/functional.rst:334 msgid "" "List comprehensions and generator expressions (short form: \"listcomps\" and " "\"genexps\") are a concise notation for such operations, borrowed from the " @@ -666,29 +623,12 @@ msgstr "" "(https://www.haskell.org/) にインスパイアされました。文字列のストリームからホ" "ワイトスペースをすべて削るのは次のコードでできます::" -#: ../../howto/functional.rst:346 -msgid "" -">>> line_list = [' line 1\\n', 'line 2 \\n', ' \\n', '']\n" -"\n" -">>> # Generator expression -- returns iterator\n" -">>> stripped_iter = (line.strip() for line in line_list)\n" -"\n" -">>> # List comprehension -- returns list\n" -">>> stripped_list = [line.strip() for line in line_list]" -msgstr "" - -#: ../../howto/functional.rst:354 +#: ../../howto/functional.rst:347 msgid "" "You can select only certain elements by adding an ``\"if\"`` condition::" msgstr "特定の要素だけを選び出すのは ``\"if\"`` 条件式を付けることで可能です::" -#: ../../howto/functional.rst:356 -msgid "" -">>> stripped_list = [line.strip() for line in line_list\n" -"... if line != \"\"]" -msgstr "" - -#: ../../howto/functional.rst:359 +#: ../../howto/functional.rst:352 msgid "" "With a list comprehension, you get back a Python list; ``stripped_list`` is " "a list containing the resulting lines, not an iterator. Generator " @@ -705,7 +645,7 @@ msgstr "" "なデータを返すようなイテレータを扱う際には、あまり役に立たないということで" "す。そういった状況ではジェネレータ式のほうが好ましいと言えます。" -#: ../../howto/functional.rst:366 +#: ../../howto/functional.rst:359 msgid "" "Generator expressions are surrounded by parentheses (\"()\") and list " "comprehensions are surrounded by square brackets (\"[]\"). Generator " @@ -714,20 +654,7 @@ msgstr "" "ジェネレータ式は丸括弧 \"()\" で囲まれ、リスト内包表記は角括弧 \"[]\" で囲ま" "れます。ジェネレータ式の形式は次のとおりです::" -#: ../../howto/functional.rst:370 -msgid "" -"( expression for expr in sequence1\n" -" if condition1\n" -" for expr2 in sequence2\n" -" if condition2\n" -" for expr3 in sequence3\n" -" ...\n" -" if condition3\n" -" for exprN in sequenceN\n" -" if conditionN )" -msgstr "" - -#: ../../howto/functional.rst:380 +#: ../../howto/functional.rst:372 msgid "" "Again, for a list comprehension only the outside brackets are different " "(square brackets instead of parentheses)." @@ -735,7 +662,7 @@ msgstr "" "リスト内包表記も、外側の括弧が違うだけ (丸ではなく角括弧) で、あとは同じで" "す。" -#: ../../howto/functional.rst:383 +#: ../../howto/functional.rst:375 msgid "" "The elements of the generated output will be the successive values of " "``expression``. The ``if`` clauses are all optional; if present, " @@ -746,7 +673,7 @@ msgstr "" "``if`` 節はすべて、なくても大丈夫です; あれば ``condition`` が真のときだけ " "``expression`` が評価されて出力に追加されます。" -#: ../../howto/functional.rst:387 +#: ../../howto/functional.rst:379 msgid "" "Generator expressions always have to be written inside parentheses, but the " "parentheses signalling a function call also count. If you want to create an " @@ -756,11 +683,7 @@ msgstr "" "なっている括弧でも大丈夫です。関数にすぐ渡すイテレータを作りたければこう書け" "るのです::" -#: ../../howto/functional.rst:391 -msgid "obj_total = sum(obj.count for obj in list_all_objects())" -msgstr "" - -#: ../../howto/functional.rst:393 +#: ../../howto/functional.rst:385 msgid "" "The ``for...in`` clauses contain the sequences to be iterated over. The " "sequences do not have to be the same length, because they are iterated over " @@ -776,7 +699,7 @@ msgstr "" "``sequence1`` と ``sequence2`` から出た要素ペアごとに、 ``sequence3`` でルー" "プします。" -#: ../../howto/functional.rst:399 +#: ../../howto/functional.rst:391 msgid "" "To put it another way, a list comprehension or generator expression is " "equivalent to the following Python code::" @@ -784,24 +707,7 @@ msgstr "" "別の書き方をすると、リスト内包表記やジェネレータ式は次の Python コードと同じ" "意味になります::" -#: ../../howto/functional.rst:402 -msgid "" -"for expr1 in sequence1:\n" -" if not (condition1):\n" -" continue # Skip this element\n" -" for expr2 in sequence2:\n" -" if not (condition2):\n" -" continue # Skip this element\n" -" ...\n" -" for exprN in sequenceN:\n" -" if not (conditionN):\n" -" continue # Skip this element\n" -"\n" -" # Output the value of\n" -" # the expression." -msgstr "" - -#: ../../howto/functional.rst:416 +#: ../../howto/functional.rst:408 msgid "" "This means that when there are multiple ``for...in`` clauses but no ``if`` " "clauses, the length of the resulting output will be equal to the product of " @@ -812,7 +718,7 @@ msgstr "" "各シーケンス長の積に等しくなるということです。長さ 3 のリスト二つなら、出力リ" "ストの長さは 9 要素です:" -#: ../../howto/functional.rst:428 +#: ../../howto/functional.rst:420 msgid "" "To avoid introducing an ambiguity into Python's grammar, if ``expression`` " "is creating a tuple, it must be surrounded with parentheses. The first list " @@ -822,19 +728,11 @@ msgstr "" "ら括弧で囲わなくてはなりません。下にあるリスト内包表記で、最初のは構文エラー" "ですが、二番目は有効です::" -#: ../../howto/functional.rst:432 -msgid "" -"# Syntax error\n" -"[x, y for x in seq1 for y in seq2]\n" -"# Correct\n" -"[(x, y) for x in seq1 for y in seq2]" -msgstr "" - -#: ../../howto/functional.rst:439 +#: ../../howto/functional.rst:431 msgid "Generators" msgstr "ジェネレータ (generator)" -#: ../../howto/functional.rst:441 +#: ../../howto/functional.rst:433 msgid "" "Generators are a special class of functions that simplify the task of " "writing iterators. Regular functions compute a value and return it, but " @@ -844,7 +742,7 @@ msgstr "" "数は値を計算して返しますが、ジェネレータが返すのは、一連の値を返すイテレータ" "です。" -#: ../../howto/functional.rst:445 +#: ../../howto/functional.rst:437 msgid "" "You're doubtless familiar with how regular function calls work in Python or " "C. When you call a function, it gets a private namespace where its local " @@ -865,11 +763,11 @@ msgstr "" "しょう。これこそジェネレータが提供する機能です; すなわち、ジェネレータは続行" "できる関数と考えることができます。" -#: ../../howto/functional.rst:454 +#: ../../howto/functional.rst:446 msgid "Here's the simplest example of a generator function:" msgstr "ごく単純なジェネレータ関数の例がこちらにあります:" -#: ../../howto/functional.rst:460 +#: ../../howto/functional.rst:452 msgid "" "Any function containing a :keyword:`yield` keyword is a generator function; " "this is detected by Python's :term:`bytecode` compiler which compiles the " @@ -879,7 +777,7 @@ msgstr "" "の :term:`bytecode` コンパイラがこれを検出して、特別な方法でコンパイルしてく" "れるのです。" -#: ../../howto/functional.rst:464 +#: ../../howto/functional.rst:456 msgid "" "When you call a generator function, it doesn't return a single value; " "instead it returns a generator object that supports the iterator protocol. " @@ -897,11 +795,11 @@ msgstr "" "状態が一時停止になって、ローカル変数が保存される点です。 次回そのジェネレータ" "の :meth:`~generator.__next__` を呼ぶと、そこから関数が実行を再開します。" -#: ../../howto/functional.rst:473 +#: ../../howto/functional.rst:465 msgid "Here's a sample usage of the ``generate_ints()`` generator:" msgstr "上記 ``generate_ints()`` ジェネレータの使用例はこちらです:" -#: ../../howto/functional.rst:490 +#: ../../howto/functional.rst:482 msgid "" "You could equally write ``for i in generate_ints(5)``, or ``a, b, c = " "generate_ints(3)``." @@ -909,7 +807,7 @@ msgstr "" "同じく ``for i in generate_ints(5)`` や ``a, b, c = generate_ints(3)`` といっ" "た書き方もできます。" -#: ../../howto/functional.rst:493 +#: ../../howto/functional.rst:485 msgid "" "Inside a generator function, ``return value`` causes " "``StopIteration(value)`` to be raised from the :meth:`~generator.__next__` " @@ -921,7 +819,7 @@ msgstr "" "た場合や、関数の終わりに到達した場合は、値の生成が終了してジェネレーターがそ" "れ以上の値を返さない。" -#: ../../howto/functional.rst:498 +#: ../../howto/functional.rst:490 msgid "" "You could achieve the effect of generators manually by writing your own " "class and storing all the local variables of the generator as instance " @@ -937,7 +835,7 @@ msgstr "" "ら、ある程度複雑なジェネレータになってくると、同じことをするクラスを書くのは" "格段にややこしいことになります。" -#: ../../howto/functional.rst:506 +#: ../../howto/functional.rst:498 msgid "" "The test suite included with Python's library, :source:`Lib/test/" "test_generators.py`, contains a number of more interesting examples. Here's " @@ -948,21 +846,7 @@ msgstr "" "test_generators.py` には、ほかにも興味深い例が数多く入っています。これは二分" "木の通りがけ順 (in-order) 探索を再帰で実装したジェネレータです。 ::" -#: ../../howto/functional.rst:511 -msgid "" -"# A recursive generator that generates Tree leaves in in-order.\n" -"def inorder(t):\n" -" if t:\n" -" for x in inorder(t.left):\n" -" yield x\n" -"\n" -" yield t.label\n" -"\n" -" for x in inorder(t.right):\n" -" yield x" -msgstr "" - -#: ../../howto/functional.rst:522 +#: ../../howto/functional.rst:514 msgid "" "Two other examples in ``test_generators.py`` produce solutions for the N-" "Queens problem (placing N queens on an NxN chess board so that no queen " @@ -974,11 +858,11 @@ msgstr "" "いに攻撃できないような配置で N 個のクイーンを置く) やナイト・ツアー (N×N 盤の" "全コマをナイトが一度ずつ通るような経路を探す) の解を出す例が入っています。" -#: ../../howto/functional.rst:530 +#: ../../howto/functional.rst:522 msgid "Passing values into a generator" msgstr "ジェネレータに値を渡す" -#: ../../howto/functional.rst:532 +#: ../../howto/functional.rst:524 msgid "" "In Python 2.4 and earlier, generators only produced output. Once a " "generator's code was invoked to create an iterator, there was no way to pass " @@ -993,7 +877,7 @@ msgstr "" "にしたり、ミュータブルなオブジェクトを渡しておいて呼び出し元であとからそれを" "変更したり、といったハックは可能でしたが、どれもゴチャゴチャしていますね。" -#: ../../howto/functional.rst:539 +#: ../../howto/functional.rst:531 msgid "" "In Python 2.5 there's a simple way to pass values into a generator. :keyword:" "`yield` became an expression, returning a value that can be assigned to a " @@ -1002,11 +886,7 @@ msgstr "" "Python 2.5 で、ジェネレータに値を渡す簡単な手段ができました。 :keyword:" "`yield` が、変数に代入したり演算したりできる値を返す式になったのです::" -#: ../../howto/functional.rst:543 -msgid "val = (yield i)" -msgstr "" - -#: ../../howto/functional.rst:545 +#: ../../howto/functional.rst:537 msgid "" "I recommend that you **always** put parentheses around a ``yield`` " "expression when you're doing something with the returned value, as in the " @@ -1017,7 +897,7 @@ msgstr "" "るようお勧めします。括弧は常に必要なわけではありませんが、どんなとき付けなく" "て良いのかを覚えておくより、いつも付けておくほうが楽ですから。" -#: ../../howto/functional.rst:550 +#: ../../howto/functional.rst:542 msgid "" "(:pep:`342` explains the exact rules, which are that a ``yield``-expression " "must always be parenthesized except when it occurs at the top-level " @@ -1030,7 +910,7 @@ msgstr "" "つまり ``val = yield i`` とは書けますが、 ``val = (yield i) + 12`` のように演" "算子があるときは括弧を使わなくてはいけません。)" -#: ../../howto/functional.rst:556 +#: ../../howto/functional.rst:548 msgid "" "Values are sent into a generator by calling its :meth:`send(value) " "` method. This method resumes the generator's code and the " @@ -1042,7 +922,7 @@ msgstr "" "すのです。ふつうの :meth:`~generator.__next__` メソッドを呼ぶと、 ``yield`` " "は ``None`` を返します。" -#: ../../howto/functional.rst:561 +#: ../../howto/functional.rst:553 msgid "" "Here's a simple counter that increments by 1 and allows changing the value " "of the internal counter." @@ -1050,24 +930,11 @@ msgstr "" "下にあるのは 1 ずつ増える単純なカウンタですが、内部カウンタの値を変更すること" "ができるようになっています。" -#: ../../howto/functional.rst:564 -msgid "" -"def counter(maximum):\n" -" i = 0\n" -" while i < maximum:\n" -" val = (yield i)\n" -" # If value provided, change counter\n" -" if val is not None:\n" -" i = val\n" -" else:\n" -" i += 1" -msgstr "" - -#: ../../howto/functional.rst:576 +#: ../../howto/functional.rst:568 msgid "And here's an example of changing the counter:" msgstr "そしてカウンタ変更の例がこちらです:" -#: ../../howto/functional.rst:593 +#: ../../howto/functional.rst:585 msgid "" "Because ``yield`` will often be returning ``None``, you should always check " "for this case. Don't just use its value in expressions unless you're sure " @@ -1079,24 +946,24 @@ msgstr "" "が :meth:`~generator.send` しかないのだと確定してるのでない限り、式の値をその" "まま使ってはいけません。" -#: ../../howto/functional.rst:598 +#: ../../howto/functional.rst:590 msgid "" "In addition to :meth:`~generator.send`, there are two other methods on " "generators:" msgstr "" "ジェネレータには、 :meth:`~generator.send` のほかにもメソッドが二つあります:" -#: ../../howto/functional.rst:601 +#: ../../howto/functional.rst:593 msgid "" -":meth:`throw(value) ` is used to raise an exception inside " -"the generator; the exception is raised by the ``yield`` expression where the " -"generator's execution is paused." +":meth:`throw(type, value=None, traceback=None) ` is used to " +"raise an exception inside the generator; the exception is raised by the " +"``yield`` expression where the generator's execution is paused." msgstr "" -":meth:`throw(value) ` はジェネレータ内で例外を投げるために使" -"います; その例外はジェネレータの実行が停止したところの ``yield`` 式によって投" -"げられます。" +":meth:`throw(type, value=None, traceback=None) ` はジェネ" +"レータ内で例外を投げるために使います; その例外はジェネレータの実行が停止した" +"ところの ``yield`` 式によって投げられます。" -#: ../../howto/functional.rst:605 +#: ../../howto/functional.rst:597 msgid "" ":meth:`~generator.close` raises a :exc:`GeneratorExit` exception inside the " "generator to terminate the iteration. On receiving this exception, the " @@ -1113,7 +980,7 @@ msgstr "" "`RuntimeError` を引き起こします。 :meth:`~generator.close` はジェネレータが " "GC されるときにも呼ばれます。" -#: ../../howto/functional.rst:613 +#: ../../howto/functional.rst:605 msgid "" "If you need to run cleanup code when a :exc:`GeneratorExit` occurs, I " "suggest using a ``try: ... finally:`` suite instead of catching :exc:" @@ -1123,7 +990,7 @@ msgstr "" "ら、 :exc:`GeneratorExit` を捕捉するのではなく ``try: ... finaly:`` するよう" "お勧めします。" -#: ../../howto/functional.rst:616 +#: ../../howto/functional.rst:608 msgid "" "The cumulative effect of these changes is to turn generators from one-way " "producers of information into both producers and consumers." @@ -1131,7 +998,7 @@ msgstr "" "これらの変更の合わせ技で、ジェネレータは情報の一方的な生産者から、生産者かつ" "消費者という存在に変貌を遂げたのです。" -#: ../../howto/functional.rst:619 +#: ../../howto/functional.rst:611 msgid "" "Generators also become **coroutines**, a more generalized form of " "subroutines. Subroutines are entered at one point and exited at another " @@ -1144,18 +1011,18 @@ msgstr "" "文) から出るだけですが、コルーチンはいろいろな場所 (``yield`` 文) から入った" "り出たり再開したりできるのです。" -#: ../../howto/functional.rst:626 +#: ../../howto/functional.rst:618 msgid "Built-in functions" msgstr "組み込み関数 (built-in function)" -#: ../../howto/functional.rst:628 +#: ../../howto/functional.rst:620 msgid "" "Let's look in more detail at built-in functions often used with iterators." msgstr "" "よくイテレータと一緒に使うビルトイン関数について、もっと詳しく見ていきましょ" "う。" -#: ../../howto/functional.rst:630 +#: ../../howto/functional.rst:622 msgid "" "Two of Python's built-in functions, :func:`map` and :func:`filter` duplicate " "the features of generator expressions:" @@ -1163,24 +1030,24 @@ msgstr "" "Python のビルトイン関数 :func:`map` と :func:`filter` は、機能がジェネレータ" "式と重複しています:" -#: ../../howto/functional.rst:633 +#: ../../howto/functional.rst:634 msgid "" ":func:`map(f, iterA, iterB, ...) ` returns an iterator over the sequence" msgstr "" ":func:`map(f, iterA, iterB, ...) ` は以下のシーケンスのイテレータを返し" "ます" -#: ../../howto/functional.rst:634 +#: ../../howto/functional.rst:626 msgid "" "``f(iterA[0], iterB[0]), f(iterA[1], iterB[1]), f(iterA[2], iterB[2]), ...``." msgstr "" "``f(iterA[0], iterB[0]), f(iterA[1], iterB[1]), f(iterA[2], iterB[2]), ...``." -#: ../../howto/functional.rst:644 +#: ../../howto/functional.rst:636 msgid "You can of course achieve the same effect with a list comprehension." msgstr "もちろん、リスト内包表記でも同じ結果が得られます。" -#: ../../howto/functional.rst:646 +#: ../../howto/functional.rst:638 msgid "" ":func:`filter(predicate, iter) ` returns an iterator over all the " "sequence elements that meet a certain condition, and is similarly duplicated " @@ -1193,11 +1060,11 @@ msgstr "" "**predicate** は、ある条件に対する真偽値を返す関数です;\n" ":func:`filter` で使うには、その関数の引数は一つでなければなりません。" -#: ../../howto/functional.rst:659 +#: ../../howto/functional.rst:651 msgid "This can also be written as a list comprehension:" msgstr "これはリスト内包表記でも書けます:" -#: ../../howto/functional.rst:665 +#: ../../howto/functional.rst:657 msgid "" ":func:`enumerate(iter, start=0) ` counts off the elements in the " "iterable returning 2-tuples containing the count (from *start*) and each " @@ -1207,16 +1074,7 @@ msgstr "" "振っていき、(*start* から数え始めたときの) 番号とそれぞれの要素を含む 2 タプ" "ルを返します。" -#: ../../howto/functional.rst:669 -msgid "" -">>> for item in enumerate(['subject', 'verb', 'object']):\n" -"... print(item)\n" -"(0, 'subject')\n" -"(1, 'verb')\n" -"(2, 'object')" -msgstr "" - -#: ../../howto/functional.rst:675 +#: ../../howto/functional.rst:667 msgid "" ":func:`enumerate` is often used when looping through a list and recording " "the indexes at which certain conditions are met::" @@ -1224,15 +1082,7 @@ msgstr "" ":func:`enumerate` はよく、リストに対してループさせて、条件に合う所に印を付け" "ていくときに使われます::" -#: ../../howto/functional.rst:678 -msgid "" -"f = open('data.txt', 'r')\n" -"for i, line in enumerate(f):\n" -" if line.strip() == '':\n" -" print('Blank line at line #%i' % i)" -msgstr "" - -#: ../../howto/functional.rst:683 +#: ../../howto/functional.rst:675 msgid "" ":func:`sorted(iterable, key=None, reverse=False) ` collects all the " "elements of the iterable into a list, sorts the list, and returns the sorted " @@ -1243,25 +1093,12 @@ msgstr "" "をすべて集めたリストを作り、ソートして返します。 引数 *key* および *reverse* " "は、リストの :meth:`~list.sort` メソッドにそのまま渡されます。 ::" -#: ../../howto/functional.rst:688 -msgid "" -">>> import random\n" -">>> # Generate 8 random numbers between [0, 10000)\n" -">>> rand_list = random.sample(range(10000), 8)\n" -">>> rand_list\n" -"[769, 7953, 9828, 6431, 8442, 9878, 6213, 2207]\n" -">>> sorted(rand_list)\n" -"[769, 2207, 6213, 6431, 7953, 8442, 9828, 9878]\n" -">>> sorted(rand_list, reverse=True)\n" -"[9878, 9828, 8442, 7953, 6431, 6213, 2207, 769]" -msgstr "" - -#: ../../howto/functional.rst:698 +#: ../../howto/functional.rst:690 msgid "" "(For a more detailed discussion of sorting, see the :ref:`sortinghowto`.)" msgstr "(ソートに関する詳細な論議は :ref:`sortinghowto` を参照)" -#: ../../howto/functional.rst:701 +#: ../../howto/functional.rst:693 msgid "" "The :func:`any(iter) ` and :func:`all(iter) ` built-ins look at " "the truth values of an iterable's contents. :func:`any` returns ``True`` if " @@ -1272,7 +1109,7 @@ msgstr "" "iterable の値の真偽を調べます。 :func:`any` は要素のどれかが真値なら " "``True`` を返し、 :func:`all` は要素が全て真値なら ``True`` を返します:" -#: ../../howto/functional.rst:720 +#: ../../howto/functional.rst:712 msgid "" ":func:`zip(iterA, iterB, ...) ` takes one element from each iterable " "and returns them in a tuple::" @@ -1280,13 +1117,7 @@ msgstr "" ":func:`zip(iterA, iterB, ...) ` はそれぞれの iterable から1つの要素を取" "り、それらをタプルに入れて返します::" -#: ../../howto/functional.rst:723 -msgid "" -"zip(['a', 'b', 'c'], (1, 2, 3)) =>\n" -" ('a', 1), ('b', 2), ('c', 3)" -msgstr "" - -#: ../../howto/functional.rst:726 +#: ../../howto/functional.rst:718 msgid "" "It doesn't construct an in-memory list and exhaust all the input iterators " "before returning; instead tuples are constructed and returned only if " @@ -1299,7 +1130,7 @@ msgstr "" "Lazy_evaluation>`__ (訳: `遅延評価 `__) と呼びます。)" -#: ../../howto/functional.rst:731 +#: ../../howto/functional.rst:723 msgid "" "This iterator is intended to be used with iterables that are all of the same " "length. If the iterables are of different lengths, the resulting stream " @@ -1309,13 +1140,7 @@ msgstr "" "違っていれば、出力されるストリームは一番短いイテラブルと同じ長さになりま" "す。 ::" -#: ../../howto/functional.rst:735 -msgid "" -"zip(['a', 'b'], (1, 2, 3)) =>\n" -" ('a', 1), ('b', 2)" -msgstr "" - -#: ../../howto/functional.rst:738 +#: ../../howto/functional.rst:730 msgid "" "You should avoid doing this, though, because an element may be taken from " "the longer iterators and discarded. This means you can't go on to use the " @@ -1326,13 +1151,13 @@ msgstr "" "素を抜かしてしまう危険があるので、もうそのイテレータはそれ以上使えなくなって" "しまいます。" -#: ../../howto/functional.rst:744 +#: ../../howto/functional.rst:736 msgid "The itertools module" msgstr "itertools モジュール" -#: ../../howto/functional.rst:746 +#: ../../howto/functional.rst:738 msgid "" -"The :mod:`itertools` module contains a number of commonly used iterators as " +"The :mod:`itertools` module contains a number of commonly-used iterators as " "well as functions for combining several iterators. This section will " "introduce the module's contents by showing small examples." msgstr "" @@ -1340,31 +1165,31 @@ msgstr "" "使う関数がたくさん含まれています。この章では、そのモジュールの内容を小さな例" "で紹介していきたいと思います。" -#: ../../howto/functional.rst:750 +#: ../../howto/functional.rst:742 msgid "The module's functions fall into a few broad classes:" msgstr "このモジュールの関数を大まかに分けるとこうなります:" -#: ../../howto/functional.rst:752 +#: ../../howto/functional.rst:744 msgid "Functions that create a new iterator based on an existing iterator." msgstr "既存のイテレータに基づいて新しいイテレータを作る関数。" -#: ../../howto/functional.rst:753 +#: ../../howto/functional.rst:745 msgid "Functions for treating an iterator's elements as function arguments." msgstr "イテレータの要素を引数として扱う関数。" -#: ../../howto/functional.rst:754 +#: ../../howto/functional.rst:746 msgid "Functions for selecting portions of an iterator's output." msgstr "イテレータの出力から一部を取り出す関数。" -#: ../../howto/functional.rst:755 +#: ../../howto/functional.rst:747 msgid "A function for grouping an iterator's output." msgstr "イテレータの出力をグループ分けする関数。" -#: ../../howto/functional.rst:758 +#: ../../howto/functional.rst:750 msgid "Creating new iterators" msgstr "新しいイテレータを作る" -#: ../../howto/functional.rst:760 +#: ../../howto/functional.rst:752 msgid "" ":func:`itertools.count(start, step) ` returns an infinite " "stream of evenly spaced values. You can optionally supply the starting " @@ -1376,17 +1201,7 @@ msgstr "" "オプションで開始する数 (デフォルトは 0) や数どうしの間隔 (デフォルトは 1) を" "与えられます::" -#: ../../howto/functional.rst:764 -msgid "" -"itertools.count() =>\n" -" 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ...\n" -"itertools.count(10) =>\n" -" 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, ...\n" -"itertools.count(10, 5) =>\n" -" 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, ..." -msgstr "" - -#: ../../howto/functional.rst:771 +#: ../../howto/functional.rst:763 msgid "" ":func:`itertools.cycle(iter) ` saves a copy of the contents " "of a provided iterable and returns a new iterator that returns its elements " @@ -1397,13 +1212,7 @@ msgstr "" "をコピーして、 その要素を最初から最後まで無限に繰り返していくイテレータを返し" "ます。 ::" -#: ../../howto/functional.rst:775 -msgid "" -"itertools.cycle([1, 2, 3, 4, 5]) =>\n" -" 1, 2, 3, 4, 5, 1, 2, 3, 4, 5, ..." -msgstr "" - -#: ../../howto/functional.rst:778 +#: ../../howto/functional.rst:770 msgid "" ":func:`itertools.repeat(elem, [n]) ` returns the provided " "element *n* times, or returns the element endlessly if *n* is not " @@ -1412,15 +1221,7 @@ msgstr "" ":func:`itertools.repeat(elem, [n]) ` は、与えられた要素を " "*n* 回返しますが、 *n* がなければ永遠に返し続けます。 ::" -#: ../../howto/functional.rst:781 -msgid "" -"itertools.repeat('abc') =>\n" -" abc, abc, abc, abc, abc, abc, abc, abc, abc, abc, ...\n" -"itertools.repeat('abc', 5) =>\n" -" abc, abc, abc, abc, abc" -msgstr "" - -#: ../../howto/functional.rst:786 +#: ../../howto/functional.rst:778 msgid "" ":func:`itertools.chain(iterA, iterB, ...) ` takes an " "arbitrary number of iterables as input, and returns all the elements of the " @@ -1431,13 +1232,7 @@ msgstr "" "ラブルを受け取って、最初のイテレータから要素をすべて返し、次に二番目から 要素" "をすべて返し、ということを要素がなくなるまで続けます。 ::" -#: ../../howto/functional.rst:791 -msgid "" -"itertools.chain(['a', 'b', 'c'], (1, 2, 3)) =>\n" -" a, b, c, 1, 2, 3" -msgstr "" - -#: ../../howto/functional.rst:794 +#: ../../howto/functional.rst:786 msgid "" ":func:`itertools.islice(iter, [start], stop, [step]) ` " "returns a stream that's a slice of the iterator. With a single *stop* " @@ -1454,17 +1249,7 @@ msgstr "" "トのスライスとは違って、マイナスの値は *start*, *stop*, *step* に使えませ" "ん。 ::" -#: ../../howto/functional.rst:801 -msgid "" -"itertools.islice(range(10), 8) =>\n" -" 0, 1, 2, 3, 4, 5, 6, 7\n" -"itertools.islice(range(10), 2, 8) =>\n" -" 2, 3, 4, 5, 6, 7\n" -"itertools.islice(range(10), 2, 8, 2) =>\n" -" 2, 4, 6" -msgstr "" - -#: ../../howto/functional.rst:808 +#: ../../howto/functional.rst:800 msgid "" ":func:`itertools.tee(iter, [n]) ` replicates an iterator; it " "returns *n* independent iterators that will all return the contents of the " @@ -1480,23 +1265,11 @@ msgstr "" "たうちの一つが他よりも進んでいってしまうと、大量のメモリを消費することがあり" "ます。 ::" -#: ../../howto/functional.rst:816 -msgid "" -"itertools.tee( itertools.count() ) =>\n" -" iterA, iterB\n" -"\n" -"where iterA ->\n" -" 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ...\n" -"\n" -"and iterB ->\n" -" 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ..." -msgstr "" - -#: ../../howto/functional.rst:827 +#: ../../howto/functional.rst:819 msgid "Calling functions on elements" msgstr "要素に対して関数を呼ぶ" -#: ../../howto/functional.rst:829 +#: ../../howto/functional.rst:821 msgid "" "The :mod:`operator` module contains a set of functions corresponding to " "Python's operators. Some examples are :func:`operator.add(a, b) ` (``.id`` 属" "性を取得するコーラブルを返す) といった関数です。" -#: ../../howto/functional.rst:835 +#: ../../howto/functional.rst:827 msgid "" ":func:`itertools.starmap(func, iter) ` assumes that the " "iterable will return a stream of tuples, and calls *func* using these tuples " @@ -1521,19 +1294,10 @@ msgstr "" "す::" #: ../../howto/functional.rst:839 -msgid "" -"itertools.starmap(os.path.join,\n" -" [('/bin', 'python'), ('/usr', 'bin', 'java'),\n" -" ('/usr', 'bin', 'perl'), ('/usr', 'bin', 'ruby')])\n" -"=>\n" -" /bin/python, /usr/bin/java, /usr/bin/perl, /usr/bin/ruby" -msgstr "" - -#: ../../howto/functional.rst:847 msgid "Selecting elements" msgstr "要素を選択する" -#: ../../howto/functional.rst:849 +#: ../../howto/functional.rst:841 msgid "" "Another group of functions chooses a subset of an iterator's elements based " "on a predicate." @@ -1541,7 +1305,7 @@ msgstr "" "さらに別のグループとして、述語 (predicate) に基づいてイテレータの要素からサブ" "セットを選び出す関数があります。" -#: ../../howto/functional.rst:852 +#: ../../howto/functional.rst:844 msgid "" ":func:`itertools.filterfalse(predicate, iter) ` is " "the opposite of :func:`filter`, returning all elements for which the " @@ -1550,13 +1314,7 @@ msgstr "" ":func:`itertools.filterfalse(predicate, iter) ` は :" "func:`filter` とは反対に、 述語が偽を返す要素をすべて返します::" -#: ../../howto/functional.rst:856 -msgid "" -"itertools.filterfalse(is_even, itertools.count()) =>\n" -" 1, 3, 5, 7, 9, 11, 13, 15, ..." -msgstr "" - -#: ../../howto/functional.rst:859 +#: ../../howto/functional.rst:851 msgid "" ":func:`itertools.takewhile(predicate, iter) ` returns " "elements for as long as the predicate returns true. Once the predicate " @@ -1566,19 +1324,7 @@ msgstr "" "を返している間だけ要素を返します。一度でも述語が偽を返すと、イテレータは出力" "終了の合図をします。 ::" -#: ../../howto/functional.rst:863 -msgid "" -"def less_than_10(x):\n" -" return x < 10\n" -"\n" -"itertools.takewhile(less_than_10, itertools.count()) =>\n" -" 0, 1, 2, 3, 4, 5, 6, 7, 8, 9\n" -"\n" -"itertools.takewhile(is_even, itertools.count()) =>\n" -" 0" -msgstr "" - -#: ../../howto/functional.rst:872 +#: ../../howto/functional.rst:864 msgid "" ":func:`itertools.dropwhile(predicate, iter) ` discards " "elements while the predicate returns true, and then returns the rest of the " @@ -1588,16 +1334,7 @@ msgstr "" "真を返しているうちは要素を無視し、偽になってから残りの出力をすべて返しま" "す。 ::" -#: ../../howto/functional.rst:876 -msgid "" -"itertools.dropwhile(less_than_10, itertools.count()) =>\n" -" 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, ...\n" -"\n" -"itertools.dropwhile(is_even, itertools.count()) =>\n" -" 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, ..." -msgstr "" - -#: ../../howto/functional.rst:882 +#: ../../howto/functional.rst:874 msgid "" ":func:`itertools.compress(data, selectors) ` takes two " "iterators and returns only those elements of *data* for which the " @@ -1608,17 +1345,11 @@ msgstr "" "レータを取り、 どちらかのイテレータを使い果たすまでの、 *selectors* が真とな" "る要素に対応する *data* 要素だけを返します::" -#: ../../howto/functional.rst:886 -msgid "" -"itertools.compress([1, 2, 3, 4, 5], [True, True, False, False, True]) =>\n" -" 1, 2, 5" -msgstr "" - -#: ../../howto/functional.rst:891 +#: ../../howto/functional.rst:883 msgid "Combinatoric functions" msgstr "組合せ関数" -#: ../../howto/functional.rst:893 +#: ../../howto/functional.rst:885 msgid "" "The :func:`itertools.combinations(iterable, r) ` " "returns an iterator giving all possible *r*-tuple combinations of the " @@ -1628,21 +1359,7 @@ msgstr "" "*iterable* から *r*-tuple 選択する全ての組み合わせを提供するイテレータを返し" "ます ::" -#: ../../howto/functional.rst:897 -msgid "" -"itertools.combinations([1, 2, 3, 4, 5], 2) =>\n" -" (1, 2), (1, 3), (1, 4), (1, 5),\n" -" (2, 3), (2, 4), (2, 5),\n" -" (3, 4), (3, 5),\n" -" (4, 5)\n" -"\n" -"itertools.combinations([1, 2, 3, 4, 5], 3) =>\n" -" (1, 2, 3), (1, 2, 4), (1, 2, 5), (1, 3, 4), (1, 3, 5), (1, 4, 5),\n" -" (2, 3, 4), (2, 3, 5), (2, 4, 5),\n" -" (3, 4, 5)" -msgstr "" - -#: ../../howto/functional.rst:908 +#: ../../howto/functional.rst:900 msgid "" "The elements within each tuple remain in the same order as *iterable* " "returned them. For example, the number 1 is always before 2, 3, 4, or 5 in " @@ -1656,22 +1373,7 @@ msgstr "" "permutations>` があり、こちらはこの順序についての制約がなく、 *r* 個選択する" "全ての順列を返します。" -#: ../../howto/functional.rst:915 -msgid "" -"itertools.permutations([1, 2, 3, 4, 5], 2) =>\n" -" (1, 2), (1, 3), (1, 4), (1, 5),\n" -" (2, 1), (2, 3), (2, 4), (2, 5),\n" -" (3, 1), (3, 2), (3, 4), (3, 5),\n" -" (4, 1), (4, 2), (4, 3), (4, 5),\n" -" (5, 1), (5, 2), (5, 3), (5, 4)\n" -"\n" -"itertools.permutations([1, 2, 3, 4, 5]) =>\n" -" (1, 2, 3, 4, 5), (1, 2, 3, 5, 4), (1, 2, 4, 3, 5),\n" -" ...\n" -" (5, 4, 3, 2, 1)" -msgstr "" - -#: ../../howto/functional.rst:927 +#: ../../howto/functional.rst:919 msgid "" "If you don't supply a value for *r* the length of the iterable is used, " "meaning that all the elements are permuted." @@ -1679,7 +1381,7 @@ msgstr "" "*r* を与えない場合は iterable の長さが使われます。つまり iterable の全ての要" "素を選んだ順列を返します。" -#: ../../howto/functional.rst:930 +#: ../../howto/functional.rst:922 msgid "" "Note that these functions produce all of the possible combinations by " "position and don't require that the contents of *iterable* are unique::" @@ -1687,14 +1389,7 @@ msgstr "" "これらの関数が生成する組み合わせは、位置が基準ですので、 *iterable* の内容が" "一意でなくとも良いことに注目してください::" -#: ../../howto/functional.rst:933 -msgid "" -"itertools.permutations('aba', 3) =>\n" -" ('a', 'b', 'a'), ('a', 'a', 'b'), ('b', 'a', 'a'),\n" -" ('b', 'a', 'a'), ('a', 'a', 'b'), ('a', 'b', 'a')" -msgstr "" - -#: ../../howto/functional.rst:937 +#: ../../howto/functional.rst:929 msgid "" "The identical tuple ``('a', 'a', 'b')`` occurs twice, but the two 'a' " "strings came from different positions." @@ -1702,7 +1397,7 @@ msgstr "" "全く同じタプル ``('a', 'a', 'b')`` が 2度現れていますが、これは 2つの 'a' が" "別の位置からのものだからです。" -#: ../../howto/functional.rst:940 +#: ../../howto/functional.rst:932 msgid "" "The :func:`itertools.combinations_with_replacement(iterable, r) ` function relaxes a different constraint: " @@ -1715,21 +1410,11 @@ msgstr "" "じ要素を繰り返し選んでも良い。概念的には、それぞれのタプルの最初のものとして" "一つ要素が選ばれ、続いて 2つ目の選択のかわりにそれで置き換わります ::" -#: ../../howto/functional.rst:946 -msgid "" -"itertools.combinations_with_replacement([1, 2, 3, 4, 5], 2) =>\n" -" (1, 1), (1, 2), (1, 3), (1, 4), (1, 5),\n" -" (2, 2), (2, 3), (2, 4), (2, 5),\n" -" (3, 3), (3, 4), (3, 5),\n" -" (4, 4), (4, 5),\n" -" (5, 5)" -msgstr "" - -#: ../../howto/functional.rst:955 +#: ../../howto/functional.rst:947 msgid "Grouping elements" msgstr "要素をグループ分けする" -#: ../../howto/functional.rst:957 +#: ../../howto/functional.rst:949 msgid "" "The last function I'll discuss, :func:`itertools.groupby(iter, " "key_func=None) `, is the most complicated. " @@ -1742,7 +1427,7 @@ msgstr "" "テラブルから返ってきた要素それぞれのキー値を計算する関数です。この関数が指定" "されていなければ、 キーは単に各要素そのものになります。" -#: ../../howto/functional.rst:962 +#: ../../howto/functional.rst:954 msgid "" ":func:`~itertools.groupby` collects all the consecutive elements from the " "underlying iterable that have the same key value, and returns a stream of 2-" @@ -1752,32 +1437,7 @@ msgstr "" "要素を集めて、キー値とそのキーに対応する要素のイテレータの 2-タプルのストリー" "ムを返します。" -#: ../../howto/functional.rst:968 -msgid "" -"city_list = [('Decatur', 'AL'), ('Huntsville', 'AL'), ('Selma', 'AL'),\n" -" ('Anchorage', 'AK'), ('Nome', 'AK'),\n" -" ('Flagstaff', 'AZ'), ('Phoenix', 'AZ'), ('Tucson', 'AZ'),\n" -" ...\n" -" ]\n" -"\n" -"def get_state(city_state):\n" -" return city_state[1]\n" -"\n" -"itertools.groupby(city_list, get_state) =>\n" -" ('AL', iterator-1),\n" -" ('AK', iterator-2),\n" -" ('AZ', iterator-3), ...\n" -"\n" -"where\n" -"iterator-1 =>\n" -" ('Decatur', 'AL'), ('Huntsville', 'AL'), ('Selma', 'AL')\n" -"iterator-2 =>\n" -" ('Anchorage', 'AK'), ('Nome', 'AK')\n" -"iterator-3 =>\n" -" ('Flagstaff', 'AZ'), ('Phoenix', 'AZ'), ('Tucson', 'AZ')" -msgstr "" - -#: ../../howto/functional.rst:990 +#: ../../howto/functional.rst:982 msgid "" ":func:`~itertools.groupby` assumes that the underlying iterable's contents " "will already be sorted based on the key. Note that the returned iterators " @@ -1789,22 +1449,22 @@ msgstr "" "テラブルを使うということに注意してください。そのため、 iterator-1 の結果を読" "み終わるまでは iterator-2 とそれに対応するキー値を要求することはできません。" -#: ../../howto/functional.rst:997 +#: ../../howto/functional.rst:989 msgid "The functools module" msgstr "functools モジュール" -#: ../../howto/functional.rst:999 +#: ../../howto/functional.rst:991 msgid "" -"The :mod:`functools` module contains some higher-order functions. A **higher-" -"order function** takes one or more functions as input and returns a new " -"function. The most useful tool in this module is the :func:`functools." -"partial` function." +"The :mod:`functools` module in Python 2.5 contains some higher-order " +"functions. A **higher-order function** takes one or more functions as input " +"and returns a new function. The most useful tool in this module is the :" +"func:`functools.partial` function." msgstr "" -":mod:`functools` モジュールには、高階関数がいくつか入っています。 **高階関数" -"** とは、入力として関数を受け取って新たな関数を返す関数です。このモジュールで" -"一番便利なツールは :func:`functools.partial` 関数です。" +"Python 2.5 からの :mod:`functools` モジュールには、高階関数がいくつか入ってい" +"ます。 **高階関数** とは、入力として関数を受け取って新たな関数を返す関数で" +"す。このモジュールで一番便利なツールは :func:`functools.partial` 関数です。" -#: ../../howto/functional.rst:1004 +#: ../../howto/functional.rst:996 msgid "" "For programs written in a functional style, you'll sometimes want to " "construct variants of existing functions that have some of the parameters " @@ -1819,7 +1479,7 @@ msgstr "" "なることがあります; つまり ``f()`` のパラメータを一つ埋めるわけです。これは" "「関数の部分適用」と呼ばれています。" -#: ../../howto/functional.rst:1010 +#: ../../howto/functional.rst:1002 msgid "" "The constructor for :func:`~functools.partial` takes the arguments " "``(function, arg1, arg2, ..., kwarg1=value1, kwarg2=value2)``. The " @@ -1831,24 +1491,11 @@ msgstr "" "トはコーラブルなので、それを呼べば、引数の埋まった状態で ``function`` を実行" "したのと同じことになります。" -#: ../../howto/functional.rst:1015 +#: ../../howto/functional.rst:1007 msgid "Here's a small but realistic example::" msgstr "以下にあるのは、小さいけれども現実的な一つの例です::" -#: ../../howto/functional.rst:1017 -msgid "" -"import functools\n" -"\n" -"def log(message, subsystem):\n" -" \"\"\"Write the contents of 'message' to the specified subsystem.\"\"\"\n" -" print('%s: %s' % (subsystem, message))\n" -" ...\n" -"\n" -"server_log = functools.partial(log, subsystem='server')\n" -"server_log('Unable to open socket')" -msgstr "" - -#: ../../howto/functional.rst:1027 +#: ../../howto/functional.rst:1019 msgid "" ":func:`functools.reduce(func, iter, [initial_value]) ` " "cumulatively performs an operation on all the iterable's elements and, " @@ -1872,22 +1519,7 @@ msgstr "" "も値を返さなければ :exc:`TypeError` が発生します。 初期値 ``initial_value`` " "があるときには、最初の計算で ``func(initial_value, A)`` が実行されます。 ::" -#: ../../howto/functional.rst:1039 -msgid "" -">>> import operator, functools\n" -">>> functools.reduce(operator.concat, ['A', 'BB', 'C'])\n" -"'ABBC'\n" -">>> functools.reduce(operator.concat, [])\n" -"Traceback (most recent call last):\n" -" ...\n" -"TypeError: reduce() of empty sequence with no initial value\n" -">>> functools.reduce(operator.mul, [1, 2, 3], 1)\n" -"6\n" -">>> functools.reduce(operator.mul, [], 1)\n" -"1" -msgstr "" - -#: ../../howto/functional.rst:1051 +#: ../../howto/functional.rst:1043 msgid "" "If you use :func:`operator.add` with :func:`functools.reduce`, you'll add up " "all the elements of the iterable. This case is so common that there's a " @@ -1897,7 +1529,7 @@ msgstr "" "を合計することになります。これは使用頻度が高いので、そのための :func:`sum` と" "いうビルトイン関数があります:" -#: ../../howto/functional.rst:1063 +#: ../../howto/functional.rst:1055 msgid "" "For many uses of :func:`functools.reduce`, though, it can be clearer to just " "write the obvious :keyword:`for` loop::" @@ -1905,44 +1537,23 @@ msgstr "" "とはいえ、多くの場合 :func:`functools.reduce` を使うよりは、単に :keyword:" "`for` ループを書いたほうがわかりやすくなります::" -#: ../../howto/functional.rst:1066 -msgid "" -"import functools\n" -"# Instead of:\n" -"product = functools.reduce(operator.mul, [1, 2, 3], 1)\n" -"\n" -"# You can write:\n" -"product = 1\n" -"for i in [1, 2, 3]:\n" -" product *= i" -msgstr "" - -#: ../../howto/functional.rst:1075 +#: ../../howto/functional.rst:1067 msgid "" "A related function is :func:`itertools.accumulate(iterable, func=operator." "add) `. It performs the same calculation, but instead " -"of returning only the final result, :func:`~itertools.accumulate` returns an " -"iterator that also yields each partial result::" +"of returning only the final result, :func:`accumulate` returns an iterator " +"that also yields each partial result::" msgstr "" "関連する関数は :func:`itertools.accumulate(iterable, func=operator.add) " "` です。この関数は同じ計算をしますが、最終結果を返すの" -"ではなく、 :func:`~itertools.accumulate` はそれぞれの中間結果を生成するイテ" -"レータが返り値となります。" +"ではなく、 :func:`accumulate` はそれぞれの中間結果を返すイテレータが返り値と" +"なります。" #: ../../howto/functional.rst:1080 -msgid "" -"itertools.accumulate([1, 2, 3, 4, 5]) =>\n" -" 1, 3, 6, 10, 15\n" -"\n" -"itertools.accumulate([1, 2, 3, 4, 5], operator.mul) =>\n" -" 1, 2, 6, 24, 120" -msgstr "" - -#: ../../howto/functional.rst:1088 msgid "The operator module" msgstr "operator モジュール" -#: ../../howto/functional.rst:1090 +#: ../../howto/functional.rst:1082 msgid "" "The :mod:`operator` module was mentioned earlier. It contains a set of " "functions corresponding to Python's operators. These functions are often " @@ -1953,43 +1564,43 @@ msgstr "" "関数が入っているモジュールです。関数型スタイルのコードにおいて、演算を一つ実" "行するだけのくだらない関数を書かずに済むので、よく世話になります。" -#: ../../howto/functional.rst:1095 +#: ../../howto/functional.rst:1087 msgid "Some of the functions in this module are:" msgstr "このモジュールの関数を一部だけ紹介しましょう:" -#: ../../howto/functional.rst:1097 +#: ../../howto/functional.rst:1089 msgid "" "Math operations: ``add()``, ``sub()``, ``mul()``, ``floordiv()``, " "``abs()``, ..." msgstr "" "数学演算子: ``add()``, ``sub()``, ``mul()``, ``floordiv()``, ``abs()``, ..." -#: ../../howto/functional.rst:1098 +#: ../../howto/functional.rst:1090 msgid "Logical operations: ``not_()``, ``truth()``." msgstr "論理演算子: ``not_()``, ``truth()``" -#: ../../howto/functional.rst:1099 +#: ../../howto/functional.rst:1091 msgid "Bitwise operations: ``and_()``, ``or_()``, ``invert()``." msgstr "ビット演算子: ``and_()``, ``or_()``, ``invert()``" -#: ../../howto/functional.rst:1100 +#: ../../howto/functional.rst:1092 msgid "" "Comparisons: ``eq()``, ``ne()``, ``lt()``, ``le()``, ``gt()``, and ``ge()``." msgstr "比較: ``eq()``, ``ne()``, ``lt()``, ``le()``, ``gt()``, ``ge()``" -#: ../../howto/functional.rst:1101 +#: ../../howto/functional.rst:1093 msgid "Object identity: ``is_()``, ``is_not()``." msgstr "オブジェクト識別: ``is_()``, ``is_not()``" -#: ../../howto/functional.rst:1103 +#: ../../howto/functional.rst:1095 msgid "Consult the operator module's documentation for a complete list." msgstr "ちゃんとした一覧は operator モジュールの文書でご覧ください。" -#: ../../howto/functional.rst:1107 +#: ../../howto/functional.rst:1099 msgid "Small functions and the lambda expression" msgstr "小さな関数とラムダ式" -#: ../../howto/functional.rst:1109 +#: ../../howto/functional.rst:1101 msgid "" "When writing functional-style programs, you'll often need little functions " "that act as predicates or that combine elements in some way." @@ -1997,7 +1608,7 @@ msgstr "" "関数型スタイルのプログラムを書いていると、述語として働いたり、何らかの形で要" "素をつなぎ合わせたりするミニサイズの関数を必要とすることがよくあります。" -#: ../../howto/functional.rst:1112 +#: ../../howto/functional.rst:1104 msgid "" "If there's a Python built-in or a module function that's suitable, you don't " "need to define a new function at all::" @@ -2005,13 +1616,7 @@ msgstr "" "ちょうど良い関数がビルトインやモジュールで存在していれば、新しい関数を定義す" "る必要はまったくありません::" -#: ../../howto/functional.rst:1115 -msgid "" -"stripped_lines = [line.strip() for line in lines]\n" -"existing_files = filter(os.path.exists, file_list)" -msgstr "" - -#: ../../howto/functional.rst:1118 +#: ../../howto/functional.rst:1110 msgid "" "If the function you need doesn't exist, you need to write it. One way to " "write small functions is to use the :keyword:`lambda` expression. " @@ -2023,29 +1628,13 @@ msgstr "" "の 一つが :keyword:`lambda` 式です。 ``lambda`` は引数として複数のパラメータ" "と それをつなぐ式を取り、その式の値を返す無名の関数を作ります::" -#: ../../howto/functional.rst:1123 -msgid "" -"adder = lambda x, y: x+y\n" -"\n" -"print_assign = lambda name, value: name + '=' + str(value)" -msgstr "" - -#: ../../howto/functional.rst:1127 +#: ../../howto/functional.rst:1119 msgid "" "An alternative is to just use the ``def`` statement and define a function in " "the usual way::" msgstr "もう一つの選択肢は、ふつうに ``def`` 文で関数を定義するだけです::" -#: ../../howto/functional.rst:1130 -msgid "" -"def adder(x, y):\n" -" return x + y\n" -"\n" -"def print_assign(name, value):\n" -" return name + '=' + str(value)" -msgstr "" - -#: ../../howto/functional.rst:1136 +#: ../../howto/functional.rst:1128 msgid "" "Which alternative is preferable? That's a style question; my usual course " "is to avoid using ``lambda``." @@ -2053,7 +1642,7 @@ msgstr "" "どちらのほうが良いのでしょうか。それは好みの問題です; 著者のスタイルとしては" "できるだけ ``lambda`` を使わないようにしています。" -#: ../../howto/functional.rst:1139 +#: ../../howto/functional.rst:1131 msgid "" "One reason for my preference is that ``lambda`` is quite limited in the " "functions it can define. The result has to be computable as a single " @@ -2069,13 +1658,7 @@ msgstr "" "ちゃして読みにくい式になってしまいます。さて、次のコードは何をしているでしょ" "うか、素早くお答えください! ::" -#: ../../howto/functional.rst:1146 -msgid "" -"import functools\n" -"total = functools.reduce(lambda a, b: (0, a[1] + b[1]), items)[1]" -msgstr "" - -#: ../../howto/functional.rst:1149 +#: ../../howto/functional.rst:1141 msgid "" "You can figure it out, but it takes time to disentangle the expression to " "figure out what's going on. Using a short nested ``def`` statements makes " @@ -2084,35 +1667,15 @@ msgstr "" "わかるにはわかるでしょうが、何がどうなっているのか紐解いていくには時間がかか" "るはずです。短い ``def`` 文で入れ子にすると、少し見通しが良くなりますが::" -#: ../../howto/functional.rst:1153 -msgid "" -"import functools\n" -"def combine(a, b):\n" -" return 0, a[1] + b[1]\n" -"\n" -"total = functools.reduce(combine, items)[1]" -msgstr "" - -#: ../../howto/functional.rst:1159 +#: ../../howto/functional.rst:1151 msgid "But it would be best of all if I had simply used a ``for`` loop::" msgstr "でも単純に ``for`` ループにすれば良かったのです::" -#: ../../howto/functional.rst:1161 -msgid "" -"total = 0\n" -"for a, b in items:\n" -" total += b" -msgstr "" - -#: ../../howto/functional.rst:1165 +#: ../../howto/functional.rst:1157 msgid "Or the :func:`sum` built-in and a generator expression::" msgstr "あるいは :func:`sum` ビルトインとジェネレータ式でも良いですね::" -#: ../../howto/functional.rst:1167 -msgid "total = sum(b for a, b in items)" -msgstr "" - -#: ../../howto/functional.rst:1169 +#: ../../howto/functional.rst:1161 msgid "" "Many uses of :func:`functools.reduce` are clearer when written as ``for`` " "loops." @@ -2120,7 +1683,7 @@ msgstr "" "多くの場合、 :func:`functools.reduce` を使っているところは ``for`` ループに " "書き直したほうが見やすいです。" -#: ../../howto/functional.rst:1171 +#: ../../howto/functional.rst:1163 msgid "" "Fredrik Lundh once suggested the following set of rules for refactoring uses " "of ``lambda``:" @@ -2128,29 +1691,29 @@ msgstr "" "Fredrik Lundh は以前 ``lambda`` 利用のリファクタリングに関して以下の指針を提" "案したことがあります:" -#: ../../howto/functional.rst:1174 +#: ../../howto/functional.rst:1166 msgid "Write a lambda function." msgstr "ラムダ関数を書く。" -#: ../../howto/functional.rst:1175 +#: ../../howto/functional.rst:1167 msgid "Write a comment explaining what the heck that lambda does." msgstr "そのラムダが一体ぜんたい何をしているのかコメントで説明する。" -#: ../../howto/functional.rst:1176 +#: ../../howto/functional.rst:1168 msgid "" "Study the comment for a while, and think of a name that captures the essence " "of the comment." msgstr "そのコメントをしばらく研究して、本質をとらえた名前を考える。" -#: ../../howto/functional.rst:1178 +#: ../../howto/functional.rst:1170 msgid "Convert the lambda to a def statement, using that name." msgstr "ラムダをその名前で def 文に書き換える。" -#: ../../howto/functional.rst:1179 +#: ../../howto/functional.rst:1171 msgid "Remove the comment." msgstr "コメントを消す。" -#: ../../howto/functional.rst:1181 +#: ../../howto/functional.rst:1173 msgid "" "I really like these rules, but you're free to disagree about whether this " "lambda-free style is better." @@ -2158,11 +1721,11 @@ msgstr "" "著者はこの指針を本当に気に入っていますが、こうしたラムダなしスタイルが他より" "優れているかどうかについて、異論は認めます。" -#: ../../howto/functional.rst:1186 +#: ../../howto/functional.rst:1178 msgid "Revision History and Acknowledgements" msgstr "更新履歴と謝辞" -#: ../../howto/functional.rst:1188 +#: ../../howto/functional.rst:1180 msgid "" "The author would like to thank the following people for offering " "suggestions, corrections and assistance with various drafts of this article: " @@ -2174,15 +1737,15 @@ msgstr "" "Jewett, Mike Krell, Leandro Lameiro, Jussi Salmela, Collin Winter, Blake " "Winton." -#: ../../howto/functional.rst:1193 +#: ../../howto/functional.rst:1185 msgid "Version 0.1: posted June 30 2006." msgstr "Version 0.1: posted June 30 2006." -#: ../../howto/functional.rst:1195 +#: ../../howto/functional.rst:1187 msgid "Version 0.11: posted July 1 2006. Typo fixes." msgstr "Version 0.11: posted July 1 2006. Typo fixes." -#: ../../howto/functional.rst:1197 +#: ../../howto/functional.rst:1189 msgid "" "Version 0.2: posted July 10 2006. Merged genexp and listcomp sections into " "one. Typo fixes." @@ -2190,13 +1753,13 @@ msgstr "" "Version 0.2: posted July 10 2006. Merged genexp and listcomp sections into " "one. Typo fixes." -#: ../../howto/functional.rst:1200 +#: ../../howto/functional.rst:1192 msgid "" "Version 0.21: Added more references suggested on the tutor mailing list." msgstr "" "Version 0.21: Added more references suggested on the tutor mailing list." -#: ../../howto/functional.rst:1202 +#: ../../howto/functional.rst:1194 msgid "" "Version 0.30: Adds a section on the ``functional`` module written by Collin " "Winter; adds short section on the operator module; a few other edits." @@ -2204,41 +1767,41 @@ msgstr "" "Version 0.30: Adds a section on the ``functional`` module written by Collin " "Winter; adds short section on the operator module; a few other edits." -#: ../../howto/functional.rst:1207 +#: ../../howto/functional.rst:1199 msgid "References" msgstr "参考資料" -#: ../../howto/functional.rst:1210 +#: ../../howto/functional.rst:1202 msgid "General" msgstr "一般論" -#: ../../howto/functional.rst:1212 +#: ../../howto/functional.rst:1204 msgid "" "**Structure and Interpretation of Computer Programs**, by Harold Abelson and " -"Gerald Jay Sussman with Julie Sussman. The book can be found at https://" -"mitpress.mit.edu/sicp. In this classic textbook of computer science, " -"chapters 2 and 3 discuss the use of sequences and streams to organize the " -"data flow inside a program. The book uses Scheme for its examples, but many " -"of the design approaches described in these chapters are applicable to " -"functional-style Python code." -msgstr "" -"**計算機プログラムの構造と解釈**、Harold AbelsonとGerald Jay Sussman、Julie " -"Sussman著。この本は https://mitpress.mit.edu/sicp で見れます。この計算機科学" -"の古典的な教科書では、2章と3章でシーケンスとストリームを使ってプログラム内の" -"データフローを整理する方法について説明しています。この本では例に Scheme を" -"使っていますが、これらの章で説明されている設計アプローチの多くは、関数型スタ" -"イルの Python コードにも適用できます。" +"Gerald Jay Sussman with Julie Sussman. Full text at https://mitpress.mit." +"edu/sicp/. In this classic textbook of computer science, chapters 2 and 3 " +"discuss the use of sequences and streams to organize the data flow inside a " +"program. The book uses Scheme for its examples, but many of the design " +"approaches described in these chapters are applicable to functional-style " +"Python code." +msgstr "" +"Harold Abelson と Gerald Jay Sussman, Julie Sussman による **Structure and " +"Interpretation of Computer Programs**。https://mitpress.mit.edu/sicp/ に全文" +"があります。この計算機科学に関する古典的な教科書では、2 章と 3 章でデータフ" +"ローをプログラム内でまとめるためのシーケンスとストリームの利用について議論し" +"ています。この本は例として Scheme を使っていますが、これらの章内の多くのデザ" +"インアプローチは関数スタイルな Python コードにも適用できます。" -#: ../../howto/functional.rst:1220 +#: ../../howto/functional.rst:1212 msgid "" -"https://www.defmacro.org/ramblings/fp.html:%20A%20general%20introduction%20to" +"http://www.defmacro.org/ramblings/fp.html:%20A%20general%20introduction%20to" "functional programming that uses Java examples and has a lengthy historical " "introduction." msgstr "" -"https://www.defmacro.org/ramblings/fp.html:%20%E9%96%A2%E6%95%B0%E3%83%97%E3%83%AD%E3%82%B0%E3%83%A9%E3%83%9F%E3%83%B3%E3%82%B0%E3%81%AE%E4%B8%80%E8%88%AC%E7%9A%84%E3%81%AA%E5%85%A5%E9%96%80" +"http://www.defmacro.org/ramblings/fp.html:%20%E9%96%A2%E6%95%B0%E3%83%97%E3%83%AD%E3%82%B0%E3%83%A9%E3%83%9F%E3%83%B3%E3%82%B0%E3%81%AE%E4%B8%80%E8%88%AC%E7%9A%84%E3%81%AA%E5%85%A5%E9%96%80" "で Java での例を利用していて、長大な歴史の紹介があります。" -#: ../../howto/functional.rst:1223 +#: ../../howto/functional.rst:1215 msgid "" "https://en.wikipedia.org/wiki/Functional_programming:%20General%20Wikipedia" "entry describing functional programming." @@ -2246,40 +1809,32 @@ msgstr "" "https://en.wikipedia.org/wiki/Functional_programming:%20%E9%96%A2%E6%95%B0%E3%83%97%E3%83%AD%E3%82%B0%E3%83%A9%E3%83%9F%E3%83%B3%E3%82%B0%E3%81%AB%E9%96%A2" "する一般的な内容の記事。" -#: ../../howto/functional.rst:1226 +#: ../../howto/functional.rst:1218 msgid "https://en.wikipedia.org/wiki/Coroutine:%20Entry%20for%20coroutines." msgstr "https://en.wikipedia.org/wiki/Coroutine:%20%E3%82%B3%E3%83%AB%E3%83%BC%E3%83%81%E3%83%B3%E3%81%AB%E9%96%A2%E3%81%99%E3%82%8B%E8%A8%98%E4%BA%8B%E3%80%82" -#: ../../howto/functional.rst:1228 -msgid "" -"https://en.wikipedia.org/wiki/Partial_application:%20Entry%20for%20the%20concept%20of" -"partial function application." -msgstr "" -"https://en.wikipedia.org/wiki/Partial_application:%20%E9%96%A2%E6%95%B0%E3%81%AE%E9%83%A8%E5%88%86%E9%81%A9%E7%94%A8%E3%81%AE%E6%A6%82%E5%BF%B5%E3%81%AB%E3%81%A4%E3%81%84" -"ての記事。" - -#: ../../howto/functional.rst:1230 +#: ../../howto/functional.rst:1220 msgid "" "https://en.wikipedia.org/wiki/Currying:%20Entry%20for%20the%20concept%20of%20currying." msgstr "https://en.wikipedia.org/wiki/Currying:%20%E3%82%AB%E3%83%AA%E3%83%BC%E5%8C%96%E3%81%AE%E6%A6%82%E5%BF%B5%E3%81%AB%E9%96%A2%E3%81%99%E3%82%8B%E8%A8%98%E4%BA%8B%E3%80%82" -#: ../../howto/functional.rst:1233 +#: ../../howto/functional.rst:1223 msgid "Python-specific" msgstr "Python 特有の話" -#: ../../howto/functional.rst:1235 +#: ../../howto/functional.rst:1225 msgid "" -"https://gnosis.cx/TPiP/:%20The%20first%20chapter%20of%20David%20Mertz's book :title-" +"http://gnosis.cx/TPiP/:%20The%20first%20chapter%20of%20David%20Mertz's book :title-" "reference:`Text Processing in Python` discusses functional programming for " "text processing, in the section titled \"Utilizing Higher-Order Functions in " "Text Processing\"." msgstr "" -"https://gnosis.cx/TPiP/:%20David%20Mertz's の本の最初の章 :title-reference:`Text " +"http://gnosis.cx/TPiP/:%20David%20Mertz's の本の最初の章 :title-reference:`Text " "Processing in Python` では文書処理のための関数プログラミングについて議論して" "います、この議論の節には \"Utilizing Higher-Order Functions in Text " "Processing\" というタイトルがついています。" -#: ../../howto/functional.rst:1240 +#: ../../howto/functional.rst:1230 msgid "" "Mertz also wrote a 3-part series of articles on functional programming for " "IBM's DeveloperWorks site; see `part 1 `__, `part 2 `__, `part 3 " "`__," -#: ../../howto/functional.rst:1248 +#: ../../howto/functional.rst:1238 msgid "Python documentation" msgstr "Python 文書" -#: ../../howto/functional.rst:1250 +#: ../../howto/functional.rst:1240 msgid "Documentation for the :mod:`itertools` module." msgstr ":mod:`itertools` モジュールの文書。" -#: ../../howto/functional.rst:1252 +#: ../../howto/functional.rst:1242 msgid "Documentation for the :mod:`functools` module." msgstr ":mod:`functools` モジュールについてのドキュメント。" -#: ../../howto/functional.rst:1254 +#: ../../howto/functional.rst:1244 msgid "Documentation for the :mod:`operator` module." msgstr ":mod:`operator` モジュールの文書。" -#: ../../howto/functional.rst:1256 +#: ../../howto/functional.rst:1246 msgid ":pep:`289`: \"Generator Expressions\"" msgstr ":pep:`289`: \"Generator Expressions\"" -#: ../../howto/functional.rst:1258 +#: ../../howto/functional.rst:1248 msgid "" ":pep:`342`: \"Coroutines via Enhanced Generators\" describes the new " "generator features in Python 2.5." diff --git a/howto/gdb_helpers.po b/howto/gdb_helpers.po deleted file mode 100644 index f57d4baf1..000000000 --- a/howto/gdb_helpers.po +++ /dev/null @@ -1,789 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation -# This file is distributed under the same license as the Python package. -# FIRST AUTHOR , YEAR. -# -# Translators: -# tomo, 2024 -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: Python 3.14\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-06 14:20+0000\n" -"PO-Revision-Date: 2024-02-25 01:11+0000\n" -"Last-Translator: tomo, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" -"ja/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#: ../../howto/gdb_helpers.rst:5 -msgid "Debugging C API extensions and CPython Internals with GDB" -msgstr "" - -#: ../../howto/gdb_helpers.rst:9 -msgid "" -"This document explains how the Python GDB extension, ``python-gdb.py``, can " -"be used with the GDB debugger to debug CPython extensions and the CPython " -"interpreter itself." -msgstr "" - -#: ../../howto/gdb_helpers.rst:13 -msgid "" -"When debugging low-level problems such as crashes or deadlocks, a low-level " -"debugger, such as GDB, is useful to diagnose and correct the issue. By " -"default, GDB (or any of its front-ends) doesn't support high-level " -"information specific to the CPython interpreter." -msgstr "" - -#: ../../howto/gdb_helpers.rst:18 -msgid "" -"The ``python-gdb.py`` extension adds CPython interpreter information to GDB. " -"The extension helps introspect the stack of currently executing Python " -"functions. Given a Python object represented by a :c:expr:`PyObject *` " -"pointer, the extension surfaces the type and value of the object." -msgstr "" - -#: ../../howto/gdb_helpers.rst:23 -msgid "" -"Developers who are working on CPython extensions or tinkering with parts of " -"CPython that are written in C can use this document to learn how to use the " -"``python-gdb.py`` extension with GDB." -msgstr "" - -#: ../../howto/gdb_helpers.rst:29 -msgid "" -"This document assumes that you are familiar with the basics of GDB and the " -"CPython C API. It consolidates guidance from the `devguide `_ and the `Python wiki `_." -msgstr "" - -#: ../../howto/gdb_helpers.rst:36 -msgid "Prerequisites" -msgstr "" - -#: ../../howto/gdb_helpers.rst:38 -msgid "You need to have:" -msgstr "" - -#: ../../howto/gdb_helpers.rst:40 -msgid "" -"GDB 7 or later. (For earlier versions of GDB, see ``Misc/gdbinit`` in the " -"sources of Python 3.11 or earlier.)" -msgstr "" - -#: ../../howto/gdb_helpers.rst:42 -msgid "" -"GDB-compatible debugging information for Python and any extension you are " -"debugging." -msgstr "" - -#: ../../howto/gdb_helpers.rst:44 -msgid "The ``python-gdb.py`` extension." -msgstr "" - -#: ../../howto/gdb_helpers.rst:46 -msgid "" -"The extension is built with Python, but might be distributed separately or " -"not at all. Below, we include tips for a few common systems as examples. " -"Note that even if the instructions match your system, they might be outdated." -msgstr "" - -#: ../../howto/gdb_helpers.rst:52 -msgid "Setup with Python built from source" -msgstr "" - -#: ../../howto/gdb_helpers.rst:54 -msgid "" -"When you build CPython from source, debugging information should be " -"available, and the build should add a ``python-gdb.py`` file to the root " -"directory of your repository." -msgstr "" - -#: ../../howto/gdb_helpers.rst:58 -msgid "" -"To activate support, you must add the directory containing ``python-gdb.py`` " -"to GDB's \"auto-load-safe-path\". If you haven't done this, recent versions " -"of GDB will print out a warning with instructions on how to do this." -msgstr "" - -#: ../../howto/gdb_helpers.rst:65 -msgid "" -"If you do not see instructions for your version of GDB, put this in your " -"configuration file (``~/.gdbinit`` or ``~/.config/gdb/gdbinit``)::" -msgstr "" - -#: ../../howto/gdb_helpers.rst:68 -msgid "add-auto-load-safe-path /path/to/cpython" -msgstr "" - -#: ../../howto/gdb_helpers.rst:70 -msgid "You can also add multiple paths, separated by ``:``." -msgstr "" - -#: ../../howto/gdb_helpers.rst:74 -msgid "Setup for Python from a Linux distro" -msgstr "" - -#: ../../howto/gdb_helpers.rst:76 -msgid "" -"Most Linux systems provide debug information for the system Python in a " -"package called ``python-debuginfo``, ``python-dbg`` or similar. For example:" -msgstr "" - -#: ../../howto/gdb_helpers.rst:80 -msgid "Fedora:" -msgstr "" - -#: ../../howto/gdb_helpers.rst:82 -msgid "" -"sudo dnf install gdb\n" -"sudo dnf debuginfo-install python3" -msgstr "" - -#: ../../howto/gdb_helpers.rst:87 -msgid "Ubuntu:" -msgstr "" - -#: ../../howto/gdb_helpers.rst:89 -msgid "sudo apt install gdb python3-dbg" -msgstr "" - -#: ../../howto/gdb_helpers.rst:93 -msgid "" -"On several recent Linux systems, GDB can download debugging symbols " -"automatically using *debuginfod*. However, this will not install the " -"``python-gdb.py`` extension; you generally do need to install the debug info " -"package separately." -msgstr "" - -#: ../../howto/gdb_helpers.rst:100 -msgid "Using the Debug build and Development mode" -msgstr "" - -#: ../../howto/gdb_helpers.rst:102 -msgid "For easier debugging, you might want to:" -msgstr "" - -#: ../../howto/gdb_helpers.rst:104 -msgid "" -"Use a :ref:`debug build ` of Python. (When building from " -"source, use ``configure --with-pydebug``. On Linux distros, install and run " -"a package like ``python-debug`` or ``python-dbg``, if available.)" -msgstr "" - -#: ../../howto/gdb_helpers.rst:107 -msgid "Use the runtime :ref:`development mode ` (``-X dev``)." -msgstr "" - -#: ../../howto/gdb_helpers.rst:109 -msgid "" -"Both enable extra assertions and disable some optimizations. Sometimes this " -"hides the bug you are trying to find, but in most cases they make the " -"process easier." -msgstr "" - -#: ../../howto/gdb_helpers.rst:115 -msgid "Using the ``python-gdb`` extension" -msgstr "" - -#: ../../howto/gdb_helpers.rst:117 -msgid "" -"When the extension is loaded, it provides two main features: pretty printers " -"for Python values, and additional commands." -msgstr "" - -#: ../../howto/gdb_helpers.rst:121 -msgid "Pretty-printers" -msgstr "" - -#: ../../howto/gdb_helpers.rst:123 -msgid "" -"This is what a GDB backtrace looks like (truncated) when this extension is " -"enabled::" -msgstr "" - -#: ../../howto/gdb_helpers.rst:126 -msgid "" -"#0 0x000000000041a6b1 in PyObject_Malloc (nbytes=Cannot access memory at " -"address 0x7fffff7fefe8\n" -") at Objects/obmalloc.c:748\n" -"#1 0x000000000041b7c0 in _PyObject_DebugMallocApi (id=111 'o', nbytes=24) " -"at Objects/obmalloc.c:1445\n" -"#2 0x000000000041b717 in _PyObject_DebugMalloc (nbytes=24) at Objects/" -"obmalloc.c:1412\n" -"#3 0x000000000044060a in _PyUnicode_New (length=11) at Objects/" -"unicodeobject.c:346\n" -"#4 0x00000000004466aa in PyUnicodeUCS2_DecodeUTF8Stateful (s=0x5c2b8d " -"\"__lltrace__\", size=11, errors=0x0, consumed=\n" -" 0x0) at Objects/unicodeobject.c:2531\n" -"#5 0x0000000000446647 in PyUnicodeUCS2_DecodeUTF8 (s=0x5c2b8d " -"\"__lltrace__\", size=11, errors=0x0)\n" -" at Objects/unicodeobject.c:2495\n" -"#6 0x0000000000440d1b in PyUnicodeUCS2_FromStringAndSize (u=0x5c2b8d " -"\"__lltrace__\", size=11)\n" -" at Objects/unicodeobject.c:551\n" -"#7 0x0000000000440d94 in PyUnicodeUCS2_FromString (u=0x5c2b8d " -"\"__lltrace__\") at Objects/unicodeobject.c:569\n" -"#8 0x0000000000584abd in PyDict_GetItemString (v=\n" -" {'Yuck': , '__builtins__': , '__file__': 'Lib/test/crashers/nasty_eq_vs_dict.py', " -"'__package__': None, 'y': , 'dict': {0: 0, 1: " -"1, 2: 2, 3: 3}, '__cached__': None, '__name__': '__main__', 'z': , '__doc__': None}, key=\n" -" 0x5c2b8d \"__lltrace__\") at Objects/dictobject.c:2171" -msgstr "" - -#: ../../howto/gdb_helpers.rst:142 -msgid "" -"Notice how the dictionary argument to ``PyDict_GetItemString`` is displayed " -"as its ``repr()``, rather than an opaque ``PyObject *`` pointer." -msgstr "" - -#: ../../howto/gdb_helpers.rst:145 -msgid "" -"The extension works by supplying a custom printing routine for values of " -"type ``PyObject *``. If you need to access lower-level details of an " -"object, then cast the value to a pointer of the appropriate type. For " -"example::" -msgstr "" - -#: ../../howto/gdb_helpers.rst:149 -msgid "" -"(gdb) p globals\n" -"$1 = {'__builtins__': , '__name__':\n" -"'__main__', 'ctypes': , '__doc__': None,\n" -"'__package__': None}\n" -"\n" -"(gdb) p *(PyDictObject*)globals\n" -"$2 = {ob_refcnt = 3, ob_type = 0x3dbdf85820, ma_fill = 5, ma_used = 5,\n" -"ma_mask = 7, ma_table = 0x63d0f8, ma_lookup = 0x3dbdc7ea70\n" -", ma_smalltable = {{me_hash = 7065186196740147912,\n" -"me_key = '__builtins__', me_value = },\n" -"{me_hash = -368181376027291943, me_key = '__name__',\n" -"me_value ='__main__'}, {me_hash = 0, me_key = 0x0, me_value = 0x0},\n" -"{me_hash = 0, me_key = 0x0, me_value = 0x0},\n" -"{me_hash = -9177857982131165996, me_key = 'ctypes',\n" -"me_value = },\n" -"{me_hash = -8518757509529533123, me_key = '__doc__', me_value = None},\n" -"{me_hash = 0, me_key = 0x0, me_value = 0x0}, {\n" -" me_hash = 6614918939584953775, me_key = '__package__', me_value = None}}}" -msgstr "" - -#: ../../howto/gdb_helpers.rst:168 -msgid "" -"Note that the pretty-printers do not actually call ``repr()``. For basic " -"types, they try to match its result closely." -msgstr "" - -#: ../../howto/gdb_helpers.rst:171 -msgid "" -"An area that can be confusing is that the custom printer for some types look " -"a lot like GDB's built-in printer for standard types. For example, the " -"pretty-printer for a Python ``int`` (:c:expr:`PyLongObject *`) gives a " -"representation that is not distinguishable from one of a regular machine-" -"level integer::" -msgstr "" - -#: ../../howto/gdb_helpers.rst:177 -msgid "" -"(gdb) p some_machine_integer\n" -"$3 = 42\n" -"\n" -"(gdb) p some_python_integer\n" -"$4 = 42" -msgstr "" - -#: ../../howto/gdb_helpers.rst:183 -msgid "" -"The internal structure can be revealed with a cast to :c:expr:`PyLongObject " -"*`::" -msgstr "" - -#: ../../howto/gdb_helpers.rst:185 -msgid "" -"(gdb) p *(PyLongObject*)some_python_integer\n" -"$5 = {ob_base = {ob_base = {ob_refcnt = 8, ob_type = 0x3dad39f5e0}, ob_size " -"= 1},\n" -"ob_digit = {42}}" -msgstr "" - -#: ../../howto/gdb_helpers.rst:189 -msgid "" -"A similar confusion can arise with the ``str`` type, where the output looks " -"a lot like gdb's built-in printer for ``char *``::" -msgstr "" - -#: ../../howto/gdb_helpers.rst:192 -msgid "" -"(gdb) p ptr_to_python_str\n" -"$6 = '__builtins__'" -msgstr "" - -#: ../../howto/gdb_helpers.rst:195 -msgid "" -"The pretty-printer for ``str`` instances defaults to using single-quotes (as " -"does Python's ``repr`` for strings) whereas the standard printer for ``char " -"*`` values uses double-quotes and contains a hexadecimal address::" -msgstr "" - -#: ../../howto/gdb_helpers.rst:199 -msgid "" -"(gdb) p ptr_to_char_star\n" -"$7 = 0x6d72c0 \"hello world\"" -msgstr "" - -#: ../../howto/gdb_helpers.rst:202 -msgid "" -"Again, the implementation details can be revealed with a cast to :c:expr:" -"`PyUnicodeObject *`::" -msgstr "" - -#: ../../howto/gdb_helpers.rst:205 -msgid "" -"(gdb) p *(PyUnicodeObject*)$6\n" -"$8 = {ob_base = {ob_refcnt = 33, ob_type = 0x3dad3a95a0}, length = 12,\n" -"str = 0x7ffff2128500, hash = 7065186196740147912, state = 1, defenc = 0x0}" -msgstr "" - -#: ../../howto/gdb_helpers.rst:210 -msgid "``py-list``" -msgstr "" - -#: ../../howto/gdb_helpers.rst:212 -msgid "" -"The extension adds a ``py-list`` command, which lists the Python source code " -"(if any) for the current frame in the selected thread. The current line is " -"marked with a \">\"::" -msgstr "" - -#: ../../howto/gdb_helpers.rst:216 -msgid "" -"(gdb) py-list\n" -" 901 if options.profile:\n" -" 902 options.profile = False\n" -" 903 profile_me()\n" -" 904 return\n" -" 905\n" -">906 u = UI()\n" -" 907 if not u.quit:\n" -" 908 try:\n" -" 909 gtk.main()\n" -" 910 except KeyboardInterrupt:\n" -" 911 # properly quit on a keyboard interrupt..." -msgstr "" - -#: ../../howto/gdb_helpers.rst:229 -msgid "" -"Use ``py-list START`` to list at a different line number within the Python " -"source, and ``py-list START,END`` to list a specific range of lines within " -"the Python source." -msgstr "" - -#: ../../howto/gdb_helpers.rst:234 -msgid "``py-up`` and ``py-down``" -msgstr "" - -#: ../../howto/gdb_helpers.rst:236 -msgid "" -"The ``py-up`` and ``py-down`` commands are analogous to GDB's regular ``up`` " -"and ``down`` commands, but try to move at the level of CPython frames, " -"rather than C frames." -msgstr "" - -#: ../../howto/gdb_helpers.rst:240 -msgid "" -"GDB is not always able to read the relevant frame information, depending on " -"the optimization level with which CPython was compiled. Internally, the " -"commands look for C frames that are executing the default frame evaluation " -"function (that is, the core bytecode interpreter loop within CPython) and " -"look up the value of the related ``PyFrameObject *``." -msgstr "" - -#: ../../howto/gdb_helpers.rst:246 -msgid "They emit the frame number (at the C level) within the thread." -msgstr "" - -#: ../../howto/gdb_helpers.rst:248 ../../howto/gdb_helpers.rst:320 -msgid "For example::" -msgstr "例えば::" - -#: ../../howto/gdb_helpers.rst:250 -msgid "" -"(gdb) py-up\n" -"#37 Frame 0x9420b04, for file /usr/lib/python2.6/site-packages/\n" -"gnome_sudoku/main.py, line 906, in start_game ()\n" -" u = UI()\n" -"(gdb) py-up\n" -"#40 Frame 0x948e82c, for file /usr/lib/python2.6/site-packages/\n" -"gnome_sudoku/gnome_sudoku.py, line 22, in start_game(main=)\n" -" main.start_game()\n" -"(gdb) py-up\n" -"Unable to find an older python frame" -msgstr "" - -#: ../../howto/gdb_helpers.rst:261 -msgid "so we're at the top of the Python stack." -msgstr "" - -#: ../../howto/gdb_helpers.rst:263 -msgid "" -"The frame numbers correspond to those displayed by GDB's standard " -"``backtrace`` command. The command skips C frames which are not executing " -"Python code." -msgstr "" - -#: ../../howto/gdb_helpers.rst:267 -msgid "Going back down::" -msgstr "" - -#: ../../howto/gdb_helpers.rst:269 -msgid "" -"(gdb) py-down\n" -"#37 Frame 0x9420b04, for file /usr/lib/python2.6/site-packages/gnome_sudoku/" -"main.py, line 906, in start_game ()\n" -" u = UI()\n" -"(gdb) py-down\n" -"#34 (unable to read python frame information)\n" -"(gdb) py-down\n" -"#23 (unable to read python frame information)\n" -"(gdb) py-down\n" -"#19 (unable to read python frame information)\n" -"(gdb) py-down\n" -"#14 Frame 0x99262ac, for file /usr/lib/python2.6/site-packages/gnome_sudoku/" -"game_selector.py, line 201, in run_swallowed_dialog " -"(self=, puzzle=None, saved_games=[{'gsd.auto_fills': 0, 'tracking': {}, " -"'trackers': {}, 'notes': [], 'saved_at': 1270084485, 'game': '7 8 0 0 0 0 0 " -"5 6 0 0 9 0 8 0 1 0 0 0 4 6 0 0 0 0 7 0 6 5 0 0 0 4 7 9 2 0 0 0 9 0 1 0 0 0 " -"3 9 7 6 0 0 0 1 8 0 6 0 0 0 0 2 8 0 0 0 5 0 4 0 6 0 0 2 1 0 0 0 0 0 4 5\\n7 " -"8 0 0 0 0 0 5 6 0 0 9 0 8 0 1 0 0 0 4 6 0 0 0 0 7 0 6 5 1 8 3 4 7 9 2 0 0 0 " -"9 0 1 0 0 0 3 9 7 6 0 0 0 1 8 0 6 0 0 0 0 2 8 0 0 0 5 0 4 0 6 0 0 2 1 0 0 0 " -"0 0 4 5', 'gsd.impossible_hints': 0, 'timer.__absolute_start_time__': , 'gsd.hints': 0, 'timer.active_time': , 'timer.total_time': }], dialog=, saved_game_model=, sudoku_maker=, main_page=0) " -"at remote 0x98fa6e4>, d=)\n" -" gtk.main()\n" -"(gdb) py-down\n" -"#8 (unable to read python frame information)\n" -"(gdb) py-down\n" -"Unable to find a newer python frame" -msgstr "" - -#: ../../howto/gdb_helpers.rst:289 -msgid "and we're at the bottom of the Python stack." -msgstr "" - -#: ../../howto/gdb_helpers.rst:291 -msgid "" -"Note that in Python 3.12 and newer, the same C stack frame can be used for " -"multiple Python stack frames. This means that ``py-up`` and ``py-down`` may " -"move multiple Python frames at once. For example::" -msgstr "" - -#: ../../howto/gdb_helpers.rst:295 -msgid "" -"(gdb) py-up\n" -"#6 Frame 0x7ffff7fb62b0, for file /tmp/rec.py, line 5, in recursive_function " -"(n=0)\n" -" time.sleep(5)\n" -"#6 Frame 0x7ffff7fb6240, for file /tmp/rec.py, line 7, in recursive_function " -"(n=1)\n" -" recursive_function(n-1)\n" -"#6 Frame 0x7ffff7fb61d0, for file /tmp/rec.py, line 7, in recursive_function " -"(n=2)\n" -" recursive_function(n-1)\n" -"#6 Frame 0x7ffff7fb6160, for file /tmp/rec.py, line 7, in recursive_function " -"(n=3)\n" -" recursive_function(n-1)\n" -"#6 Frame 0x7ffff7fb60f0, for file /tmp/rec.py, line 7, in recursive_function " -"(n=4)\n" -" recursive_function(n-1)\n" -"#6 Frame 0x7ffff7fb6080, for file /tmp/rec.py, line 7, in recursive_function " -"(n=5)\n" -" recursive_function(n-1)\n" -"#6 Frame 0x7ffff7fb6020, for file /tmp/rec.py, line 9, in ()\n" -" recursive_function(5)\n" -"(gdb) py-up\n" -"Unable to find an older python frame" -msgstr "" - -#: ../../howto/gdb_helpers.rst:315 -msgid "``py-bt``" -msgstr "" - -#: ../../howto/gdb_helpers.rst:317 -msgid "" -"The ``py-bt`` command attempts to display a Python-level backtrace of the " -"current thread." -msgstr "" - -#: ../../howto/gdb_helpers.rst:322 -msgid "" -"(gdb) py-bt\n" -"#8 (unable to read python frame information)\n" -"#11 Frame 0x9aead74, for file /usr/lib/python2.6/site-packages/gnome_sudoku/" -"dialog_swallower.py, line 48, in run_dialog " -"(self=, main_page=0) " -"at remote 0x98fa6e4>, d=)\n" -" gtk.main()\n" -"#14 Frame 0x99262ac, for file /usr/lib/python2.6/site-packages/gnome_sudoku/" -"game_selector.py, line 201, in run_swallowed_dialog " -"(self=, puzzle=None, saved_games=[{'gsd.auto_fills': 0, 'tracking': {}, " -"'trackers': {}, 'notes': [], 'saved_at': 1270084485, 'game': '7 8 0 0 0 0 0 " -"5 6 0 0 9 0 8 0 1 0 0 0 4 6 0 0 0 0 7 0 6 5 0 0 0 4 7 9 2 0 0 0 9 0 1 0 0 0 " -"3 9 7 6 0 0 0 1 8 0 6 0 0 0 0 2 8 0 0 0 5 0 4 0 6 0 0 2 1 0 0 0 0 0 4 5\\n7 " -"8 0 0 0 0 0 5 6 0 0 9 0 8 0 1 0 0 0 4 6 0 0 0 0 7 0 6 5 1 8 3 4 7 9 2 0 0 0 " -"9 0 1 0 0 0 3 9 7 6 0 0 0 1 8 0 6 0 0 0 0 2 8 0 0 0 5 0 4 0 6 0 0 2 1 0 0 0 " -"0 0 4 5', 'gsd.impossible_hints': 0, 'timer.__absolute_start_time__': , 'gsd.hints': 0, 'timer.active_time': , 'timer.total_time': }], dialog=, saved_game_model=, sudoku_maker=)\n" -" main.start_game()" -msgstr "" - -#: ../../howto/gdb_helpers.rst:336 -msgid "" -"The frame numbers correspond to those displayed by GDB's standard " -"``backtrace`` command." -msgstr "" - -#: ../../howto/gdb_helpers.rst:340 -msgid "``py-print``" -msgstr "" - -#: ../../howto/gdb_helpers.rst:342 -msgid "" -"The ``py-print`` command looks up a Python name and tries to print it. It " -"looks in locals within the current thread, then globals, then finally " -"builtins::" -msgstr "" - -#: ../../howto/gdb_helpers.rst:346 -msgid "" -"(gdb) py-print self\n" -"local 'self' = ,\n" -"main_page=0) at remote 0x98fa6e4>\n" -"(gdb) py-print __name__\n" -"global '__name__' = 'gnome_sudoku.dialog_swallower'\n" -"(gdb) py-print len\n" -"builtin 'len' = \n" -"(gdb) py-print scarlet_pimpernel\n" -"'scarlet_pimpernel' not found" -msgstr "" - -#: ../../howto/gdb_helpers.rst:356 -msgid "" -"If the current C frame corresponds to multiple Python frames, ``py-print`` " -"only considers the first one." -msgstr "" - -#: ../../howto/gdb_helpers.rst:360 -msgid "``py-locals``" -msgstr "" - -#: ../../howto/gdb_helpers.rst:362 -msgid "" -"The ``py-locals`` command looks up all Python locals within the current " -"Python frame in the selected thread, and prints their representations::" -msgstr "" - -#: ../../howto/gdb_helpers.rst:365 -msgid "" -"(gdb) py-locals\n" -"self = ,\n" -"main_page=0) at remote 0x98fa6e4>\n" -"d = " -msgstr "" - -#: ../../howto/gdb_helpers.rst:370 -msgid "" -"If the current C frame corresponds to multiple Python frames, locals from " -"all of them will be shown::" -msgstr "" - -#: ../../howto/gdb_helpers.rst:373 -msgid "" -"(gdb) py-locals\n" -"Locals for recursive_function\n" -"n = 0\n" -"Locals for recursive_function\n" -"n = 1\n" -"Locals for recursive_function\n" -"n = 2\n" -"Locals for recursive_function\n" -"n = 3\n" -"Locals for recursive_function\n" -"n = 4\n" -"Locals for recursive_function\n" -"n = 5\n" -"Locals for " -msgstr "" - -#: ../../howto/gdb_helpers.rst:390 -msgid "Use with GDB commands" -msgstr "" - -#: ../../howto/gdb_helpers.rst:392 -msgid "" -"The extension commands complement GDB's built-in commands. For example, you " -"can use a frame numbers shown by ``py-bt`` with the ``frame`` command to go " -"a specific frame within the selected thread, like this::" -msgstr "" - -#: ../../howto/gdb_helpers.rst:396 -msgid "" -"(gdb) py-bt\n" -"(output snipped)\n" -"#68 Frame 0xaa4560, for file Lib/test/regrtest.py, line 1548, in " -"()\n" -" main()\n" -"(gdb) frame 68\n" -"#68 0x00000000004cd1e6 in PyEval_EvalFrameEx (f=Frame 0xaa4560, for file Lib/" -"test/regrtest.py, line 1548, in (), throwflag=0) at Python/ceval." -"c:2665\n" -"2665 x = call_function(&sp, oparg);\n" -"(gdb) py-list\n" -"1543 # Run the tests in a context manager that temporary changes the " -"CWD to a\n" -"1544 # temporary and writable directory. If it's not possible to " -"create or\n" -"1545 # change the CWD, the original CWD will be used. The original " -"CWD is\n" -"1546 # available from test_support.SAVEDCWD.\n" -"1547 with test_support.temp_cwd(TESTCWD, quiet=True):\n" -">1548 main()" -msgstr "" - -#: ../../howto/gdb_helpers.rst:411 -msgid "" -"The ``info threads`` command will give you a list of the threads within the " -"process, and you can use the ``thread`` command to select a different one::" -msgstr "" - -#: ../../howto/gdb_helpers.rst:414 -msgid "" -"(gdb) info threads\n" -" 105 Thread 0x7fffefa18710 (LWP 10260) sem_wait () at ../nptl/sysdeps/unix/" -"sysv/linux/x86_64/sem_wait.S:86\n" -" 104 Thread 0x7fffdf5fe710 (LWP 10259) sem_wait () at ../nptl/sysdeps/unix/" -"sysv/linux/x86_64/sem_wait.S:86\n" -"* 1 Thread 0x7ffff7fe2700 (LWP 10145) 0x00000038e46d73e3 in select () at ../" -"sysdeps/unix/syscall-template.S:82" -msgstr "" - -#: ../../howto/gdb_helpers.rst:419 -msgid "" -"You can use ``thread apply all COMMAND`` or (``t a a COMMAND`` for short) to " -"run a command on all threads. With ``py-bt``, this lets you see what every " -"thread is doing at the Python level::" -msgstr "" - -#: ../../howto/gdb_helpers.rst:423 -msgid "" -"(gdb) t a a py-bt\n" -"\n" -"Thread 105 (Thread 0x7fffefa18710 (LWP 10260)):\n" -"#5 Frame 0x7fffd00019d0, for file /home/david/coding/python-svn/Lib/" -"threading.py, line 155, in _acquire_restore " -"(self=<_RLock(_Verbose__verbose=False, _RLock__owner=140737354016512, " -"_RLock__block=, _RLock__count=1) at remote " -"0xd7ff40>, count_owner=(1, 140737213728528), count=1, " -"owner=140737213728528)\n" -" self.__block.acquire()\n" -"#8 Frame 0x7fffac001640, for file /home/david/coding/python-svn/Lib/" -"threading.py, line 269, in wait " -"(self=<_Condition(_Condition__lock=<_RLock(_Verbose__verbose=False, " -"_RLock__owner=140737354016512, _RLock__block=, _RLock__count=1) at remote 0xd7ff40>, acquire=, _is_owned=, " -"_release_save=, release=, _acquire_restore=, " -"_Verbose__verbose=False, _Condition__waiters=[]) at remote 0xd7fd10>, " -"timeout=None, waiter=, saved_state=(1, " -"140737213728528))\n" -" self._acquire_restore(saved_state)\n" -"#12 Frame 0x7fffb8001a10, for file /home/david/coding/python-svn/Lib/test/" -"lock_tests.py, line 348, in f ()\n" -" cond.wait()\n" -"#16 Frame 0x7fffb8001c40, for file /home/david/coding/python-svn/Lib/test/" -"lock_tests.py, line 37, in task (tid=140737213728528)\n" -" f()\n" -"\n" -"Thread 104 (Thread 0x7fffdf5fe710 (LWP 10259)):\n" -"#5 Frame 0x7fffe4001580, for file /home/david/coding/python-svn/Lib/" -"threading.py, line 155, in _acquire_restore " -"(self=<_RLock(_Verbose__verbose=False, _RLock__owner=140737354016512, " -"_RLock__block=, _RLock__count=1) at remote " -"0xd7ff40>, count_owner=(1, 140736940992272), count=1, " -"owner=140736940992272)\n" -" self.__block.acquire()\n" -"#8 Frame 0x7fffc8002090, for file /home/david/coding/python-svn/Lib/" -"threading.py, line 269, in wait " -"(self=<_Condition(_Condition__lock=<_RLock(_Verbose__verbose=False, " -"_RLock__owner=140737354016512, _RLock__block=, _RLock__count=1) at remote 0xd7ff40>, acquire=, _is_owned=, " -"_release_save=, release=, _acquire_restore=, " -"_Verbose__verbose=False, _Condition__waiters=[]) at remote 0xd7fd10>, " -"timeout=None, waiter=, saved_state=(1, " -"140736940992272))\n" -" self._acquire_restore(saved_state)\n" -"#12 Frame 0x7fffac001c90, for file /home/david/coding/python-svn/Lib/test/" -"lock_tests.py, line 348, in f ()\n" -" cond.wait()\n" -"#16 Frame 0x7fffac0011c0, for file /home/david/coding/python-svn/Lib/test/" -"lock_tests.py, line 37, in task (tid=140736940992272)\n" -" f()\n" -"\n" -"Thread 1 (Thread 0x7ffff7fe2700 (LWP 10145)):\n" -"#5 Frame 0xcb5380, for file /home/david/coding/python-svn/Lib/test/" -"lock_tests.py, line 16, in _wait ()\n" -" time.sleep(0.01)\n" -"#8 Frame 0x7fffd00024a0, for file /home/david/coding/python-svn/Lib/test/" -"lock_tests.py, line 378, in _check_notify " -"(self=, skipped=[], _mirrorOutput=False, testsRun=39, " -"buffer=False, _original_stderr=, " -"_stdout_buffer=, " -"_stderr_buffer=, " -"_moduleSetUpFailed=False, expectedFailures=[], errors=[], " -"_previousTestClass=, unexpectedSuccesses=[], " -"failures=[], shouldStop=False, failfast=False) at remote 0xc185a0>, " -"_threads=(0,), _cleanups=[], _type_equality_funcs={: , : " -", : " -", : " -", , YEAR. # # Translators: -# tomo, 2024 +# 秘湯 , 2017 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:53+0000\n" -"Last-Translator: tomo, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 17:45+0000\n" +"Last-Translator: 秘湯 , 2017\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../howto/index.rst:3 @@ -28,116 +28,15 @@ msgstr "Python HOWTO" #: ../../howto/index.rst:5 msgid "" -"Python HOWTOs are documents that cover a specific topic in-depth. Modeled on " -"the Linux Documentation Project's HOWTO collection, this collection is an " -"effort to foster documentation that's more detailed than the Python Library " -"Reference." -msgstr "" - -#: ../../howto/index.rst:39 -msgid "General:" -msgstr "" - -#: ../../howto/index.rst:41 -msgid ":ref:`annotations-howto`" -msgstr "" - -#: ../../howto/index.rst:42 -msgid ":ref:`argparse-tutorial`" -msgstr "" - -#: ../../howto/index.rst:43 -msgid ":ref:`descriptorhowto`" -msgstr "" - -#: ../../howto/index.rst:44 -msgid ":ref:`enum-howto`" -msgstr "" - -#: ../../howto/index.rst:45 -msgid ":ref:`functional-howto`" -msgstr "" - -#: ../../howto/index.rst:46 -msgid ":ref:`ipaddress-howto`" -msgstr "" - -#: ../../howto/index.rst:47 -msgid ":ref:`logging-howto`" -msgstr "" - -#: ../../howto/index.rst:48 -msgid ":ref:`logging-cookbook`" -msgstr "" - -#: ../../howto/index.rst:49 -msgid ":ref:`regex-howto`" -msgstr "" - -#: ../../howto/index.rst:50 -msgid ":ref:`sortinghowto`" -msgstr "" - -#: ../../howto/index.rst:51 -msgid ":ref:`unicode-howto`" -msgstr "" - -#: ../../howto/index.rst:52 -msgid ":ref:`urllib-howto`" -msgstr "" - -#: ../../howto/index.rst:54 -msgid "Advanced development:" -msgstr "" - -#: ../../howto/index.rst:56 -msgid ":ref:`curses-howto`" -msgstr ":ref:`curses-howto`" - -#: ../../howto/index.rst:57 -msgid ":ref:`freethreading-python-howto`" -msgstr "" - -#: ../../howto/index.rst:58 -msgid ":ref:`freethreading-extensions-howto`" -msgstr "" - -#: ../../howto/index.rst:59 -msgid ":ref:`isolating-extensions-howto`" -msgstr "" - -#: ../../howto/index.rst:60 -msgid ":ref:`python_2.3_mro`" -msgstr "" - -#: ../../howto/index.rst:61 -msgid ":ref:`socket-howto`" -msgstr "" - -#: ../../howto/index.rst:62 -msgid ":ref:`timerfd-howto`" -msgstr "" - -#: ../../howto/index.rst:63 -msgid ":ref:`cporting-howto`" -msgstr "" - -#: ../../howto/index.rst:65 -msgid "Debugging and profiling:" -msgstr "" - -#: ../../howto/index.rst:67 -msgid ":ref:`gdb`" -msgstr "" - -#: ../../howto/index.rst:68 -msgid ":ref:`instrumentation`" -msgstr "" - -#: ../../howto/index.rst:69 -msgid ":ref:`perf_profiling`" -msgstr "" - -#: ../../howto/index.rst:70 -msgid ":ref:`remote-debugging`" -msgstr "" +"Python HOWTOs are documents that cover a single, specific topic, and attempt " +"to cover it fairly completely. Modelled on the Linux Documentation Project's " +"HOWTO collection, this collection is an effort to foster documentation " +"that's more detailed than the Python Library Reference." +msgstr "" +"Python HOWTO は、それぞれが単独の話題を取り扱って自己完結した文書群です。" +"Linux Documentation Project の HOWTO 書庫をモデルに、Python ライブラリリファ" +"レンスよりも詳細な文書を作っていこうという努力の成果なのです。" + +#: ../../howto/index.rst:11 +msgid "Currently, the HOWTOs are:" +msgstr "今のところ揃っている HOWTO はこちらです:" diff --git a/howto/instrumentation.po b/howto/instrumentation.po index df3ab2341..03887d2ba 100644 --- a/howto/instrumentation.po +++ b/howto/instrumentation.po @@ -1,25 +1,28 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 +# 秘湯 , 2017 +# Osamu NAKAMURA, 2017 +# tomo, 2017 +# SHIMIZU Taku , 2017 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:53+0000\n" -"Last-Translator: tomo, 2021\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 17:45+0000\n" +"Last-Translator: SHIMIZU Taku , 2017\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../howto/instrumentation.rst:7 @@ -103,146 +106,53 @@ msgid "On a Linux machine, this can be done via::" msgstr "" "Linux マシンでは、 SystemTap 開発ツールのインストールは次のように行えます::" -#: ../../howto/instrumentation.rst:42 -msgid "$ yum install systemtap-sdt-devel" -msgstr "" - #: ../../howto/instrumentation.rst:44 msgid "or::" msgstr "もしくは::" -#: ../../howto/instrumentation.rst:46 -msgid "$ sudo apt-get install systemtap-sdt-dev" -msgstr "" - #: ../../howto/instrumentation.rst:49 -msgid "" -"CPython must then be :option:`configured with the --with-dtrace option <--" -"with-dtrace>`:" +msgid "CPython must then be configured ``--with-dtrace``:" msgstr "" +"次に CPython のビルドでは ``--with-dtrace`` を設定しなければなりません:" -#: ../../howto/instrumentation.rst:52 -msgid "checking for --with-dtrace... yes" -msgstr "" - -#: ../../howto/instrumentation.rst:56 +#: ../../howto/instrumentation.rst:55 msgid "" "On macOS, you can list available DTrace probes by running a Python process " "in the background and listing all probes made available by the Python " "provider::" msgstr "" -#: ../../howto/instrumentation.rst:60 -msgid "" -"$ python3.6 -q &\n" -"$ sudo dtrace -l -P python$! # or: dtrace -l -m python3.6\n" -"\n" -" ID PROVIDER MODULE FUNCTION NAME\n" -"29564 python18035 python3.6 _PyEval_EvalFrameDefault " -"function-entry\n" -"29565 python18035 python3.6 dtrace_function_entry " -"function-entry\n" -"29566 python18035 python3.6 _PyEval_EvalFrameDefault " -"function-return\n" -"29567 python18035 python3.6 dtrace_function_return " -"function-return\n" -"29568 python18035 python3.6 collect gc-" -"done\n" -"29569 python18035 python3.6 collect gc-" -"start\n" -"29570 python18035 python3.6 _PyEval_EvalFrameDefault line\n" -"29571 python18035 python3.6 maybe_dtrace_line line" -msgstr "" - -#: ../../howto/instrumentation.rst:73 +#: ../../howto/instrumentation.rst:72 msgid "" "On Linux, you can verify if the SystemTap static markers are present in the " "built binary by seeing if it contains a \".note.stapsdt\" section." msgstr "" -#: ../../howto/instrumentation.rst:78 -msgid "" -"$ readelf -S ./python | grep .note.stapsdt\n" -"[30] .note.stapsdt NOTE 0000000000000000 00308d78" -msgstr "" - -#: ../../howto/instrumentation.rst:81 -msgid "" -"If you've built Python as a shared library (with the :option:`--enable-" -"shared` configure option), you need to look instead within the shared " -"library. For example::" -msgstr "" - -#: ../../howto/instrumentation.rst:85 +#: ../../howto/instrumentation.rst:80 msgid "" -"$ readelf -S libpython3.3dm.so.1.0 | grep .note.stapsdt\n" -"[29] .note.stapsdt NOTE 0000000000000000 00365b68" +"If you've built Python as a shared library (with --enable-shared), you need " +"to look instead within the shared library. For example::" msgstr "" +"Python を (--enable-shared を指定して) 共有ライブラリとしてビルドした場合は、" +"代わりにその共有ライブラリの中を覗く必要があります。\n" +"例えば次のようにします::" -#: ../../howto/instrumentation.rst:88 +#: ../../howto/instrumentation.rst:86 msgid "Sufficiently modern readelf can print the metadata::" msgstr "十分に新しい readelf ではメタデータを出力できます::" -#: ../../howto/instrumentation.rst:90 -msgid "" -"$ readelf -n ./python\n" -"\n" -"Displaying notes found at file offset 0x00000254 with length 0x00000020:\n" -" Owner Data size Description\n" -" GNU 0x00000010 NT_GNU_ABI_TAG (ABI version " -"tag)\n" -" OS: Linux, ABI: 2.6.32\n" -"\n" -"Displaying notes found at file offset 0x00000274 with length 0x00000024:\n" -" Owner Data size Description\n" -" GNU 0x00000014 NT_GNU_BUILD_ID (unique build " -"ID bitstring)\n" -" Build ID: df924a2b08a7e89f6e11251d4602022977af2670\n" -"\n" -"Displaying notes found at file offset 0x002d6c30 with length 0x00000144:\n" -" Owner Data size Description\n" -" stapsdt 0x00000031 NT_STAPSDT (SystemTap probe " -"descriptors)\n" -" Provider: python\n" -" Name: gc__start\n" -" Location: 0x00000000004371c3, Base: 0x0000000000630ce2, Semaphore: " -"0x00000000008d6bf6\n" -" Arguments: -4@%ebx\n" -" stapsdt 0x00000030 NT_STAPSDT (SystemTap probe " -"descriptors)\n" -" Provider: python\n" -" Name: gc__done\n" -" Location: 0x00000000004374e1, Base: 0x0000000000630ce2, Semaphore: " -"0x00000000008d6bf8\n" -" Arguments: -8@%rax\n" -" stapsdt 0x00000045 NT_STAPSDT (SystemTap probe " -"descriptors)\n" -" Provider: python\n" -" Name: function__entry\n" -" Location: 0x000000000053db6c, Base: 0x0000000000630ce2, Semaphore: " -"0x00000000008d6be8\n" -" Arguments: 8@%rbp 8@%r12 -4@%eax\n" -" stapsdt 0x00000046 NT_STAPSDT (SystemTap probe " -"descriptors)\n" -" Provider: python\n" -" Name: function__return\n" -" Location: 0x000000000053dba8, Base: 0x0000000000630ce2, Semaphore: " -"0x00000000008d6bea\n" -" Arguments: 8@%rbp 8@%r12 -4@%eax" -msgstr "" - -#: ../../howto/instrumentation.rst:125 +#: ../../howto/instrumentation.rst:123 msgid "" "The above metadata contains information for SystemTap describing how it can " -"patch strategically placed machine code instructions to enable the tracing " +"patch strategically-placed machine code instructions to enable the tracing " "hooks used by a SystemTap script." msgstr "" -#: ../../howto/instrumentation.rst:131 +#: ../../howto/instrumentation.rst:129 msgid "Static DTrace probes" msgstr "静的 DTrace プローブ" -#: ../../howto/instrumentation.rst:133 +#: ../../howto/instrumentation.rst:131 msgid "" "The following example DTrace script can be used to show the call/return " "hierarchy of a Python script, only tracing within the invocation of a " @@ -250,89 +160,26 @@ msgid "" "are not going to be listed:" msgstr "" -#: ../../howto/instrumentation.rst:138 -msgid "" -"self int indent;\n" -"\n" -"python$target:::function-entry\n" -"/copyinstr(arg1) == \"start\"/\n" -"{\n" -" self->trace = 1;\n" -"}\n" -"\n" -"python$target:::function-entry\n" -"/self->trace/\n" -"{\n" -" printf(\"%d\\t%*s:\", timestamp, 15, probename);\n" -" printf(\"%*s\", self->indent, \"\");\n" -" printf(\"%s:%s:%d\\n\", basename(copyinstr(arg0)), copyinstr(arg1), " -"arg2);\n" -" self->indent++;\n" -"}\n" -"\n" -"python$target:::function-return\n" -"/self->trace/\n" -"{\n" -" self->indent--;\n" -" printf(\"%d\\t%*s:\", timestamp, 15, probename);\n" -" printf(\"%*s\", self->indent, \"\");\n" -" printf(\"%s:%s:%d\\n\", basename(copyinstr(arg0)), copyinstr(arg1), " -"arg2);\n" -"}\n" -"\n" -"python$target:::function-return\n" -"/copyinstr(arg1) == \"start\"/\n" -"{\n" -" self->trace = 0;\n" -"}" -msgstr "" - -#: ../../howto/instrumentation.rst:172 ../../howto/instrumentation.rst:230 +#: ../../howto/instrumentation.rst:170 ../../howto/instrumentation.rst:228 msgid "It can be invoked like this::" msgstr "この例は次のように実行できます::" -#: ../../howto/instrumentation.rst:174 -msgid "$ sudo dtrace -q -s call_stack.d -c \"python3.6 script.py\"" -msgstr "" - -#: ../../howto/instrumentation.rst:176 ../../howto/instrumentation.rst:236 +#: ../../howto/instrumentation.rst:174 ../../howto/instrumentation.rst:234 msgid "The output looks like this:" msgstr "出力はこのようになります:" -#: ../../howto/instrumentation.rst:178 -msgid "" -"156641360502280 function-entry:call_stack.py:start:23\n" -"156641360518804 function-entry: call_stack.py:function_1:1\n" -"156641360532797 function-entry: call_stack.py:function_3:9\n" -"156641360546807 function-return: call_stack.py:function_3:10\n" -"156641360563367 function-return: call_stack.py:function_1:2\n" -"156641360578365 function-entry: call_stack.py:function_2:5\n" -"156641360591757 function-entry: call_stack.py:function_1:1\n" -"156641360605556 function-entry: call_stack.py:function_3:9\n" -"156641360617482 function-return: call_stack.py:function_3:10\n" -"156641360629814 function-return: call_stack.py:function_1:2\n" -"156641360642285 function-return: call_stack.py:function_2:6\n" -"156641360656770 function-entry: call_stack.py:function_3:9\n" -"156641360669707 function-return: call_stack.py:function_3:10\n" -"156641360687853 function-entry: call_stack.py:function_4:13\n" -"156641360700719 function-return: call_stack.py:function_4:14\n" -"156641360719640 function-entry: call_stack.py:function_5:18\n" -"156641360732567 function-return: call_stack.py:function_5:21\n" -"156641360747370 function-return:call_stack.py:start:28" -msgstr "" - -#: ../../howto/instrumentation.rst:201 +#: ../../howto/instrumentation.rst:199 msgid "Static SystemTap markers" msgstr "静的 SystemTap マーカー" -#: ../../howto/instrumentation.rst:203 +#: ../../howto/instrumentation.rst:201 msgid "" "The low-level way to use the SystemTap integration is to use the static " "markers directly. This requires you to explicitly state the binary file " "containing them." msgstr "" -#: ../../howto/instrumentation.rst:207 +#: ../../howto/instrumentation.rst:205 msgid "" "For example, this SystemTap script can be used to show the call/return " "hierarchy of a Python script:" @@ -340,53 +187,15 @@ msgstr "" "例えば、この SystemTap スクリプトは Python の呼び出し/返却 (call/return) 階層" "を表示するのに使えます:" -#: ../../howto/instrumentation.rst:210 -msgid "" -"probe process(\"python\").mark(\"function__entry\") {\n" -" filename = user_string($arg1);\n" -" funcname = user_string($arg2);\n" -" lineno = $arg3;\n" -"\n" -" printf(\"%s => %s in %s:%d\\\\n\",\n" -" thread_indent(1), funcname, filename, lineno);\n" -"}\n" -"\n" -"probe process(\"python\").mark(\"function__return\") {\n" -" filename = user_string($arg1);\n" -" funcname = user_string($arg2);\n" -" lineno = $arg3;\n" -"\n" -" printf(\"%s <= %s in %s:%d\\\\n\",\n" -" thread_indent(-1), funcname, filename, lineno);\n" -"}" -msgstr "" - -#: ../../howto/instrumentation.rst:232 -msgid "" -"$ stap \\\n" -" show-call-hierarchy.stp \\\n" -" -c \"./python test.py\"" -msgstr "" - -#: ../../howto/instrumentation.rst:238 -msgid "" -"11408 python(8274): => __contains__ in Lib/_abcoll.py:362\n" -"11414 python(8274): => __getitem__ in Lib/os.py:425\n" -"11418 python(8274): => encode in Lib/os.py:490\n" -"11424 python(8274): <= encode in Lib/os.py:493\n" -"11428 python(8274): <= __getitem__ in Lib/os.py:426\n" -"11433 python(8274): <= __contains__ in Lib/_abcoll.py:366" -msgstr "" - -#: ../../howto/instrumentation.rst:247 +#: ../../howto/instrumentation.rst:245 msgid "where the columns are:" msgstr "それぞれの列の内容は次の通りです:" -#: ../../howto/instrumentation.rst:249 +#: ../../howto/instrumentation.rst:247 msgid "time in microseconds since start of script" msgstr "スクリプトを起動してからのマイクロ秒単位の時間" -#: ../../howto/instrumentation.rst:250 +#: ../../howto/instrumentation.rst:249 msgid "name of executable" msgstr "実行可能ファイルの名前" @@ -403,28 +212,18 @@ msgstr "" #: ../../howto/instrumentation.rst:255 msgid "" -"For a :option:`--enable-shared` build of CPython, the markers are contained " -"within the libpython shared library, and the probe's dotted path needs to " -"reflect this. For example, this line from the above example:" -msgstr "" - -#: ../../howto/instrumentation.rst:259 -msgid "probe process(\"python\").mark(\"function__entry\") {" +"For a `--enable-shared` build of CPython, the markers are contained within " +"the libpython shared library, and the probe's dotted path needs to reflect " +"this. For example, this line from the above example:" msgstr "" #: ../../howto/instrumentation.rst:263 msgid "should instead read:" msgstr "" -#: ../../howto/instrumentation.rst:265 -msgid "" -"probe process(\"python\").library(\"libpython3.6dm.so.1.0\")." -"mark(\"function__entry\") {" -msgstr "" - #: ../../howto/instrumentation.rst:269 -msgid "(assuming a :ref:`debug build ` of CPython 3.6)" -msgstr "" +msgid "(assuming a debug build of CPython 3.6)" +msgstr "(CPython 3.6 のデバッグビルドと仮定しています)" #: ../../howto/instrumentation.rst:273 msgid "Available static markers" @@ -469,14 +268,17 @@ msgstr "``$arg3`` : ``int`` 行番号" #: ../../howto/instrumentation.rst:293 msgid "" -"This marker is the converse of :c:func:`!function__entry`, and indicates " -"that execution of a Python function has ended (either via ``return``, or via " -"an exception). It is only triggered for pure-Python (bytecode) functions." +"This marker is the converse of :c:func:`function__entry`, and indicates that " +"execution of a Python function has ended (either via ``return``, or via an " +"exception). It is only triggered for pure-Python (bytecode) functions." msgstr "" +"このマーカーは :c:func:`function__entry` の反対で、 Python 関数の実行が " +"(``return`` もしくは例外によって) 終了したことを示しています。\n" +"このマーカーは、ピュア Python (バイトコード) の関数でしか起動されません。" #: ../../howto/instrumentation.rst:297 -msgid "The arguments are the same as for :c:func:`!function__entry`" -msgstr "" +msgid "The arguments are the same as for :c:func:`function__entry`" +msgstr "引数は :c:func:`function__entry` と同じです。" #: ../../howto/instrumentation.rst:301 msgid "" @@ -489,14 +291,17 @@ msgstr "" "このマーカーは C 関数の内部では起動されません。" #: ../../howto/instrumentation.rst:305 -msgid "The arguments are the same as for :c:func:`!function__entry`." -msgstr "" +msgid "The arguments are the same as for :c:func:`function__entry`." +msgstr "引数は :c:func:`function__entry` と同じです。" #: ../../howto/instrumentation.rst:309 msgid "" "Fires when the Python interpreter starts a garbage collection cycle. " -"``arg0`` is the generation to scan, like :func:`gc.collect`." +"``arg0`` is the generation to scan, like :func:`gc.collect()`." msgstr "" +"Python インタプリタによる循環参照のガベージコレクションが開始されたときに発火" +"します。\n" +":func:`gc.collect()` と同じように ``arg0`` は走査する対象の世代です。" #: ../../howto/instrumentation.rst:314 msgid "" @@ -541,29 +346,6 @@ msgstr "" msgid "Here is a tapset file, based on a non-shared build of CPython:" msgstr "" -#: ../../howto/instrumentation.rst:351 -msgid "" -"/*\n" -" Provide a higher-level wrapping around the function__entry and\n" -" function__return markers:\n" -" \\*/\n" -"probe python.function.entry = process(\"python\").mark(\"function__entry\")\n" -"{\n" -" filename = user_string($arg1);\n" -" funcname = user_string($arg2);\n" -" lineno = $arg3;\n" -" frameptr = $arg4\n" -"}\n" -"probe python.function.return = process(\"python\")." -"mark(\"function__return\")\n" -"{\n" -" filename = user_string($arg1);\n" -" funcname = user_string($arg2);\n" -" lineno = $arg3;\n" -" frameptr = $arg4\n" -"}" -msgstr "" - #: ../../howto/instrumentation.rst:372 msgid "" "If this file is installed in SystemTap's tapset directory (e.g. ``/usr/share/" @@ -595,46 +377,9 @@ msgid "" "needing to directly name the static markers:" msgstr "" -#: ../../howto/instrumentation.rst:395 -msgid "" -"probe python.function.entry\n" -"{\n" -" printf(\"%s => %s in %s:%d\\n\",\n" -" thread_indent(1), funcname, filename, lineno);\n" -"}\n" -"\n" -"probe python.function.return\n" -"{\n" -" printf(\"%s <= %s in %s:%d\\n\",\n" -" thread_indent(-1), funcname, filename, lineno);\n" -"}" -msgstr "" - #: ../../howto/instrumentation.rst:410 msgid "" "The following script uses the tapset above to provide a top-like view of all " -"running CPython code, showing the top 20 most frequently entered bytecode " +"running CPython code, showing the top 20 most frequently-entered bytecode " "frames, each second, across the whole system:" msgstr "" - -#: ../../howto/instrumentation.rst:414 -msgid "" -"global fn_calls;\n" -"\n" -"probe python.function.entry\n" -"{\n" -" fn_calls[pid(), filename, funcname, lineno] += 1;\n" -"}\n" -"\n" -"probe timer.ms(1000) {\n" -" printf(\"\\033[2J\\033[1;1H\") /* clear screen \\*/\n" -" printf(\"%6s %80s %6s %30s %6s\\n\",\n" -" \"PID\", \"FILENAME\", \"LINE\", \"FUNCTION\", \"CALLS\")\n" -" foreach ([pid, filename, funcname, lineno] in fn_calls- limit 20) {\n" -" printf(\"%6d %80s %6d %30s %6d\\n\",\n" -" pid, filename, lineno, funcname,\n" -" fn_calls[pid, filename, funcname, lineno]);\n" -" }\n" -" delete fn_calls;\n" -"}" -msgstr "" diff --git a/howto/ipaddress.po b/howto/ipaddress.po index a86a598be..4f0157186 100644 --- a/howto/ipaddress.po +++ b/howto/ipaddress.po @@ -1,27 +1,30 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 -# mollinaca, 2021 -# Takanori Suzuki , 2021 +# ごはんですよ , 2017 +# Takeshi Fujiwara <1.800.takeshi@gmail.com>, 2017 +# Inada Naoki , 2017 +# SHIMIZU Taku , 2017 +# Arihiro TAKASE, 2018 +# mollinaca, 2020 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-30 14:22+0000\n" -"PO-Revision-Date: 2021-06-28 00:53+0000\n" -"Last-Translator: Takanori Suzuki , 2021\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 17:45+0000\n" +"Last-Translator: mollinaca, 2020\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../howto/ipaddress.rst:9 @@ -40,7 +43,7 @@ msgstr "Peter Moody" msgid "Nick Coghlan" msgstr "Nick Coghlan" -#: ../../howto/ipaddress.rst-1 +#: ../../howto/ipaddress.rstNone msgid "Overview" msgstr "概要" @@ -78,17 +81,16 @@ msgstr "IPバージョンについての注意" #: ../../howto/ipaddress.rst:34 msgid "" "For readers that aren't particularly familiar with IP addressing, it's " -"important to know that the Internet Protocol (IP) is currently in the " -"process of moving from version 4 of the protocol to version 6. This " -"transition is occurring largely because version 4 of the protocol doesn't " -"provide enough addresses to handle the needs of the whole world, especially " -"given the increasing number of devices with direct connections to the " -"internet." -msgstr "" -"IPアドレッシングに詳しくない読者にとっては、インターネットプロトコル(IP)が現" -"在バージョン4プロトコルからバージョン6へと移行している途中であることを知って" -"おくのが重要です。この移行はプロトコルのバージョン4が世界中の需要に対応するた" -"めに十分なアドレスを提供できないことが大きな理由で起こっており、特にインター" +"important to know that the Internet Protocol is currently in the process of " +"moving from version 4 of the protocol to version 6. This transition is " +"occurring largely because version 4 of the protocol doesn't provide enough " +"addresses to handle the needs of the whole world, especially given the " +"increasing number of devices with direct connections to the internet." +msgstr "" +"IPアドレッシングに詳しくない読者にとっては、インターネットプロトコルが現在" +"バージョン4プロトコルからバージョン6へと移行している途中であることを知ってお" +"くのが重要です。この移行はプロトコルのバージョン4が世界中の需要に対応するため" +"に十分なアドレスを提供できないことが大きな理由で起こっており、特にインター" "ネットへ直接接続する機器が増えている状況を踏まえたものです。" #: ../../howto/ipaddress.rst:41 @@ -128,14 +130,6 @@ msgstr "" "アドレスは整数から直接作成することも可能です。32ビットに収まる値はIPv4アドレ" "スであるとみなされます::" -#: ../../howto/ipaddress.rst:64 -msgid "" -">>> ipaddress.ip_address(3221225985)\n" -"IPv4Address('192.0.2.1')\n" -">>> ipaddress.ip_address(42540766411282592856903984951653826561)\n" -"IPv6Address('2001:db8::1')" -msgstr "" - #: ../../howto/ipaddress.rst:69 msgid "" "To force the use of IPv4 or IPv6 addresses, the relevant classes can be " @@ -145,16 +139,6 @@ msgstr "" "IPv4またはIPv6アドレスの使用を強制するには、適切なクラスを直接呼び出す必要が" "あります。これは特にIPv6アドレスを小さな整数で作成する場合に役立ちます::" -#: ../../howto/ipaddress.rst:73 -msgid "" -">>> ipaddress.ip_address(1)\n" -"IPv4Address('0.0.0.1')\n" -">>> ipaddress.IPv4Address(1)\n" -"IPv4Address('0.0.0.1')\n" -">>> ipaddress.IPv6Address(1)\n" -"IPv6Address('::1')" -msgstr "" - #: ../../howto/ipaddress.rst:82 msgid "Defining Networks" msgstr "ネットワークを定義する" @@ -186,14 +170,6 @@ msgstr "" "アドレスについては、正しいIPバージョンを自動的に判断するファクトリー関数が提" "供されます::" -#: ../../howto/ipaddress.rst:96 -msgid "" -">>> ipaddress.ip_network('192.0.2.0/24')\n" -"IPv4Network('192.0.2.0/24')\n" -">>> ipaddress.ip_network('2001:db8::0/96')\n" -"IPv6Network('2001:db8::/96')" -msgstr "" - #: ../../howto/ipaddress.rst:101 msgid "" "Network objects cannot have any host bits set. The practical effect of this " @@ -220,16 +196,6 @@ msgstr "" "グをコンストラクタに渡すと、追加分のビットをゼロとして強制的に処理するように" "要求できます::" -#: ../../howto/ipaddress.rst:112 -msgid "" -">>> ipaddress.ip_network('192.0.2.1/24')\n" -"Traceback (most recent call last):\n" -" ...\n" -"ValueError: 192.0.2.1/24 has host bits set\n" -">>> ipaddress.ip_network('192.0.2.1/24', strict=False)\n" -"IPv4Network('192.0.2.0/24')" -msgstr "" - #: ../../howto/ipaddress.rst:119 msgid "" "While the string form offers significantly more flexibility, networks can " @@ -242,14 +208,6 @@ msgstr "" "特定できる単一のアドレスのみを含むものとして処理され、ネットワークプレフィッ" "クスはネットワークアドレスの全体を含みます::" -#: ../../howto/ipaddress.rst:124 -msgid "" -">>> ipaddress.ip_network(3221225984)\n" -"IPv4Network('192.0.2.0/32')\n" -">>> ipaddress.ip_network(42540766411282592856903984951653826560)\n" -"IPv6Network('2001:db8::/128')" -msgstr "" - #: ../../howto/ipaddress.rst:129 msgid "" "As with addresses, creation of a particular kind of network can be forced by " @@ -309,63 +267,18 @@ msgstr "" msgid "Extracting the IP version::" msgstr "IPバージョンを抽出する::" -#: ../../howto/ipaddress.rst:165 -msgid "" -">>> addr4 = ipaddress.ip_address('192.0.2.1')\n" -">>> addr6 = ipaddress.ip_address('2001:db8::1')\n" -">>> addr6.version\n" -"6\n" -">>> addr4.version\n" -"4" -msgstr "" - #: ../../howto/ipaddress.rst:172 msgid "Obtaining the network from an interface::" msgstr "インターフェースからネットワークを取得する::" -#: ../../howto/ipaddress.rst:174 -msgid "" -">>> host4 = ipaddress.ip_interface('192.0.2.1/24')\n" -">>> host4.network\n" -"IPv4Network('192.0.2.0/24')\n" -">>> host6 = ipaddress.ip_interface('2001:db8::1/96')\n" -">>> host6.network\n" -"IPv6Network('2001:db8::/96')" -msgstr "" - #: ../../howto/ipaddress.rst:181 msgid "Finding out how many individual addresses are in a network::" msgstr "個別なアドレスがいくつネットワークに存在するかを調べる::" -#: ../../howto/ipaddress.rst:183 -msgid "" -">>> net4 = ipaddress.ip_network('192.0.2.0/24')\n" -">>> net4.num_addresses\n" -"256\n" -">>> net6 = ipaddress.ip_network('2001:db8::0/96')\n" -">>> net6.num_addresses\n" -"4294967296" -msgstr "" - #: ../../howto/ipaddress.rst:190 msgid "Iterating through the \"usable\" addresses on a network::" msgstr "「使用可能」なネットワーク上のアドレスを順番にたどる::" -#: ../../howto/ipaddress.rst:192 -msgid "" -">>> net4 = ipaddress.ip_network('192.0.2.0/24')\n" -">>> for x in net4.hosts():\n" -"... print(x)\n" -"192.0.2.1\n" -"192.0.2.2\n" -"192.0.2.3\n" -"192.0.2.4\n" -"...\n" -"192.0.2.252\n" -"192.0.2.253\n" -"192.0.2.254" -msgstr "" - #: ../../howto/ipaddress.rst:205 msgid "" "Obtaining the netmask (i.e. set bits corresponding to the network prefix) or " @@ -378,18 +291,6 @@ msgstr "" msgid "Exploding or compressing the address::" msgstr "アドレスを展開したり圧縮したりする::" -#: ../../howto/ipaddress.rst:222 -msgid "" -">>> addr6.exploded\n" -"'2001:0db8:0000:0000:0000:0000:0000:0001'\n" -">>> addr6.compressed\n" -"'2001:db8::1'\n" -">>> net6.exploded\n" -"'2001:0db8:0000:0000:0000:0000:0000:0000/96'\n" -">>> net6.compressed\n" -"'2001:db8::/96'" -msgstr "" - #: ../../howto/ipaddress.rst:231 msgid "" "While IPv4 doesn't support explosion or compression, the associated objects " @@ -414,18 +315,6 @@ msgstr "" "ネットワークをリストとして扱うと便利な場合があります。これは、ネットワークを" "次のようにインデックス付けすることが可能なことを意味します::" -#: ../../howto/ipaddress.rst:243 -msgid "" -">>> net4[1]\n" -"IPv4Address('192.0.2.1')\n" -">>> net4[-1]\n" -"IPv4Address('192.0.2.255')\n" -">>> net6[1]\n" -"IPv6Address('2001:db8::1')\n" -">>> net6[-1]\n" -"IPv6Address('2001:db8::ffff:ffff')" -msgstr "" - #: ../../howto/ipaddress.rst:253 msgid "" "It also means that network objects lend themselves to using the list " @@ -434,27 +323,12 @@ msgstr "" "以下のようなリストのメンバーシップの判定用文法が使用可能なように、ネットワー" "クオブジェクト自身が適応します::" -#: ../../howto/ipaddress.rst:256 -msgid "" -"if address in network:\n" -" # do something" -msgstr "" - #: ../../howto/ipaddress.rst:259 msgid "Containment testing is done efficiently based on the network prefix::" msgstr "" "ネットワークプレフィックスに基づき、所属しているかどうかの判定が効果的にでき" "ます::" -#: ../../howto/ipaddress.rst:261 -msgid "" -">>> addr4 = ipaddress.ip_address('192.0.2.1')\n" -">>> addr4 in ipaddress.ip_network('192.0.2.0/24')\n" -"True\n" -">>> addr4 in ipaddress.ip_network('192.0.3.0/24')\n" -"False" -msgstr "" - #: ../../howto/ipaddress.rst:269 msgid "Comparisons" msgstr "比較" @@ -467,12 +341,6 @@ msgstr "" ":mod:`ipaddress` はオブジェクトの比較をするための単純で、かつ願わくば直観的な" "方法を意味が通じるように提供します::" -#: ../../howto/ipaddress.rst:274 -msgid "" -">>> ipaddress.ip_address('192.0.2.1') < ipaddress.ip_address('192.0.2.2')\n" -"True" -msgstr "" - #: ../../howto/ipaddress.rst:277 msgid "" "A :exc:`TypeError` exception is raised if you try to compare objects of " @@ -495,15 +363,6 @@ msgstr "" "らオブジェクトを直接受け付けません。直接渡すのではなく、他のモジュールが受け" "付ける整数や文字列に強制的に変換する必要があります::" -#: ../../howto/ipaddress.rst:288 -msgid "" -">>> addr4 = ipaddress.ip_address('192.0.2.1')\n" -">>> str(addr4)\n" -"'192.0.2.1'\n" -">>> int(addr4)\n" -"3221225985" -msgstr "" - #: ../../howto/ipaddress.rst:296 msgid "Getting more detail when instance creation fails" msgstr "インスタンスの生成に失敗した場合にさらに詳細を取得する" @@ -545,28 +404,6 @@ msgstr "" "クラスコンストラクタを直接使用する場合にはこれらのエラーメッセージはさらに非" "常に詳細になっています。例えば::" -#: ../../howto/ipaddress.rst:314 -msgid "" -">>> ipaddress.ip_address(\"192.168.0.256\")\n" -"Traceback (most recent call last):\n" -" ...\n" -"ValueError: '192.168.0.256' does not appear to be an IPv4 or IPv6 address\n" -">>> ipaddress.IPv4Address(\"192.168.0.256\")\n" -"Traceback (most recent call last):\n" -" ...\n" -"ipaddress.AddressValueError: Octet 256 (> 255) not permitted in " -"'192.168.0.256'\n" -"\n" -">>> ipaddress.ip_network(\"192.168.0.1/64\")\n" -"Traceback (most recent call last):\n" -" ...\n" -"ValueError: '192.168.0.1/64' does not appear to be an IPv4 or IPv6 network\n" -">>> ipaddress.IPv4Network(\"192.168.0.1/64\")\n" -"Traceback (most recent call last):\n" -" ...\n" -"ipaddress.NetmaskValueError: '64' is not a valid netmask" -msgstr "" - #: ../../howto/ipaddress.rst:332 msgid "" "However, both of the module specific exceptions have :exc:`ValueError` as " @@ -576,11 +413,3 @@ msgstr "" "しかし、モジュールについて固有の上記例外のどちらも :exc:`ValueError` を親クラ" "スとして持ち、エラーの特定のタイプに興味がない場合でも、以下のようにコードを" "記述できます::" - -#: ../../howto/ipaddress.rst:336 -msgid "" -"try:\n" -" network = ipaddress.IPv4Network(address)\n" -"except ValueError:\n" -" print('address/netmask is invalid for IPv4:', address)" -msgstr "" diff --git a/howto/isolating-extensions.po b/howto/isolating-extensions.po deleted file mode 100644 index 3a7946a53..000000000 --- a/howto/isolating-extensions.po +++ /dev/null @@ -1,937 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation -# This file is distributed under the same license as the Python package. -# FIRST AUTHOR , YEAR. -# -# Translators: -# tomo, 2022 -# Taichi Haradaguchi, 2024 -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: Python 3.14\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-06 14:20+0000\n" -"PO-Revision-Date: 2022-11-05 19:48+0000\n" -"Last-Translator: Taichi Haradaguchi, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" -"ja/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#: ../../howto/isolating-extensions.rst:7 -msgid "Isolating Extension Modules" -msgstr "拡張モジュールを分離する" - -#: ../../howto/isolating-extensions.rst-1 -msgid "Abstract" -msgstr "概要" - -#: ../../howto/isolating-extensions.rst:11 -msgid "" -"Traditionally, state belonging to Python extension modules was kept in C " -"``static`` variables, which have process-wide scope. This document describes " -"problems of such per-process state and shows a safer way: per-module state." -msgstr "" - -#: ../../howto/isolating-extensions.rst:16 -msgid "" -"The document also describes how to switch to per-module state where " -"possible. This transition involves allocating space for that state, " -"potentially switching from static types to heap types, and—perhaps most " -"importantly—accessing per-module state from code." -msgstr "" - -#: ../../howto/isolating-extensions.rst:23 -msgid "Who should read this" -msgstr "" - -#: ../../howto/isolating-extensions.rst:25 -msgid "" -"This guide is written for maintainers of :ref:`C-API ` " -"extensions who would like to make that extension safer to use in " -"applications where Python itself is used as a library." -msgstr "" - -#: ../../howto/isolating-extensions.rst:31 -msgid "Background" -msgstr "背景" - -#: ../../howto/isolating-extensions.rst:33 -msgid "" -"An *interpreter* is the context in which Python code runs. It contains " -"configuration (e.g. the import path) and runtime state (e.g. the set of " -"imported modules)." -msgstr "" - -#: ../../howto/isolating-extensions.rst:37 -msgid "" -"Python supports running multiple interpreters in one process. There are two " -"cases to think about—users may run interpreters:" -msgstr "" - -#: ../../howto/isolating-extensions.rst:40 -msgid "" -"in sequence, with several :c:func:`Py_InitializeEx`/:c:func:`Py_FinalizeEx` " -"cycles, and" -msgstr "" - -#: ../../howto/isolating-extensions.rst:42 -msgid "" -"in parallel, managing \"sub-interpreters\" using :c:func:" -"`Py_NewInterpreter`/:c:func:`Py_EndInterpreter`." -msgstr "" - -#: ../../howto/isolating-extensions.rst:45 -msgid "" -"Both cases (and combinations of them) would be most useful when embedding " -"Python within a library. Libraries generally shouldn't make assumptions " -"about the application that uses them, which include assuming a process-wide " -"\"main Python interpreter\"." -msgstr "" - -#: ../../howto/isolating-extensions.rst:50 -msgid "" -"Historically, Python extension modules don't handle this use case well. Many " -"extension modules (and even some stdlib modules) use *per-process* global " -"state, because C ``static`` variables are extremely easy to use. Thus, data " -"that should be specific to an interpreter ends up being shared between " -"interpreters. Unless the extension developer is careful, it is very easy to " -"introduce edge cases that lead to crashes when a module is loaded in more " -"than one interpreter in the same process." -msgstr "" - -#: ../../howto/isolating-extensions.rst:58 -msgid "" -"Unfortunately, *per-interpreter* state is not easy to achieve. Extension " -"authors tend to not keep multiple interpreters in mind when developing, and " -"it is currently cumbersome to test the behavior." -msgstr "" - -#: ../../howto/isolating-extensions.rst:63 -msgid "Enter Per-Module State" -msgstr "" - -#: ../../howto/isolating-extensions.rst:65 -msgid "" -"Instead of focusing on per-interpreter state, Python's C API is evolving to " -"better support the more granular *per-module* state. This means that C-level " -"data should be attached to a *module object*. Each interpreter creates its " -"own module object, keeping the data separate. For testing the isolation, " -"multiple module objects corresponding to a single extension can even be " -"loaded in a single interpreter." -msgstr "" - -#: ../../howto/isolating-extensions.rst:72 -msgid "" -"Per-module state provides an easy way to think about lifetime and resource " -"ownership: the extension module will initialize when a module object is " -"created, and clean up when it's freed. In this regard, a module is just like " -"any other :c:expr:`PyObject *`; there are no \"on interpreter shutdown\" " -"hooks to think—or forget—about." -msgstr "" - -#: ../../howto/isolating-extensions.rst:78 -msgid "" -"Note that there are use cases for different kinds of \"globals\": per-" -"process, per-interpreter, per-thread or per-task state. With per-module " -"state as the default, these are still possible, but you should treat them as " -"exceptional cases: if you need them, you should give them additional care " -"and testing. (Note that this guide does not cover them.)" -msgstr "" - -#: ../../howto/isolating-extensions.rst:87 -msgid "Isolated Module Objects" -msgstr "" - -#: ../../howto/isolating-extensions.rst:89 -msgid "" -"The key point to keep in mind when developing an extension module is that " -"several module objects can be created from a single shared library. For " -"example:" -msgstr "" - -#: ../../howto/isolating-extensions.rst:93 -msgid "" -">>> import sys\n" -">>> import binascii\n" -">>> old_binascii = binascii\n" -">>> del sys.modules['binascii']\n" -">>> import binascii # create a new module object\n" -">>> old_binascii == binascii\n" -"False" -msgstr "" - -#: ../../howto/isolating-extensions.rst:103 -msgid "" -"As a rule of thumb, the two modules should be completely independent. All " -"objects and state specific to the module should be encapsulated within the " -"module object, not shared with other module objects, and cleaned up when the " -"module object is deallocated. Since this just is a rule of thumb, exceptions " -"are possible (see `Managing Global State`_), but they will need more thought " -"and attention to edge cases." -msgstr "" - -#: ../../howto/isolating-extensions.rst:111 -msgid "" -"While some modules could do with less stringent restrictions, isolated " -"modules make it easier to set clear expectations and guidelines that work " -"across a variety of use cases." -msgstr "" - -#: ../../howto/isolating-extensions.rst:117 -msgid "Surprising Edge Cases" -msgstr "" - -#: ../../howto/isolating-extensions.rst:119 -msgid "" -"Note that isolated modules do create some surprising edge cases. Most " -"notably, each module object will typically not share its classes and " -"exceptions with other similar modules. Continuing from the `example above " -"`__, note that ``old_binascii.Error`` and " -"``binascii.Error`` are separate objects. In the following code, the " -"exception is *not* caught:" -msgstr "" - -#: ../../howto/isolating-extensions.rst:126 -msgid "" -">>> old_binascii.Error == binascii.Error\n" -"False\n" -">>> try:\n" -"... old_binascii.unhexlify(b'qwertyuiop')\n" -"... except binascii.Error:\n" -"... print('boo')\n" -"...\n" -"Traceback (most recent call last):\n" -" File \"\", line 2, in \n" -"binascii.Error: Non-hexadecimal digit found" -msgstr "" - -#: ../../howto/isolating-extensions.rst:139 -msgid "" -"This is expected. Notice that pure-Python modules behave the same way: it is " -"a part of how Python works." -msgstr "" - -#: ../../howto/isolating-extensions.rst:142 -msgid "" -"The goal is to make extension modules safe at the C level, not to make hacks " -"behave intuitively. Mutating ``sys.modules`` \"manually\" counts as a hack." -msgstr "" - -#: ../../howto/isolating-extensions.rst:148 -msgid "Making Modules Safe with Multiple Interpreters" -msgstr "" - -#: ../../howto/isolating-extensions.rst:152 -msgid "Managing Global State" -msgstr "" - -#: ../../howto/isolating-extensions.rst:154 -msgid "" -"Sometimes, the state associated with a Python module is not specific to that " -"module, but to the entire process (or something else \"more global\" than a " -"module). For example:" -msgstr "" - -#: ../../howto/isolating-extensions.rst:158 -msgid "The ``readline`` module manages *the* terminal." -msgstr "" - -#: ../../howto/isolating-extensions.rst:159 -msgid "" -"A module running on a circuit board wants to control *the* on-board LED." -msgstr "" - -#: ../../howto/isolating-extensions.rst:162 -msgid "" -"In these cases, the Python module should provide *access* to the global " -"state, rather than *own* it. If possible, write the module so that multiple " -"copies of it can access the state independently (along with other libraries, " -"whether for Python or other languages). If that is not possible, consider " -"explicit locking." -msgstr "" - -#: ../../howto/isolating-extensions.rst:168 -msgid "" -"If it is necessary to use process-global state, the simplest way to avoid " -"issues with multiple interpreters is to explicitly prevent a module from " -"being loaded more than once per process—see :ref:`isolating-extensions-" -"optout`." -msgstr "" - -#: ../../howto/isolating-extensions.rst:175 -msgid "Managing Per-Module State" -msgstr "" - -#: ../../howto/isolating-extensions.rst:177 -msgid "" -"To use per-module state, use :ref:`multi-phase extension module " -"initialization `. This signals that your module " -"supports multiple interpreters correctly." -msgstr "" - -#: ../../howto/isolating-extensions.rst:181 -msgid "" -"Set ``PyModuleDef.m_size`` to a positive number to request that many bytes " -"of storage local to the module. Usually, this will be set to the size of " -"some module-specific ``struct``, which can store all of the module's C-level " -"state. In particular, it is where you should put pointers to classes " -"(including exceptions, but excluding static types) and settings (e.g. " -"``csv``'s :py:data:`~csv.field_size_limit`) which the C code needs to " -"function." -msgstr "" - -#: ../../howto/isolating-extensions.rst:190 -msgid "" -"Another option is to store state in the module's ``__dict__``, but you must " -"avoid crashing when users modify ``__dict__`` from Python code. This usually " -"means error- and type-checking at the C level, which is easy to get wrong " -"and hard to test sufficiently." -msgstr "" - -#: ../../howto/isolating-extensions.rst:195 -msgid "" -"However, if module state is not needed in C code, storing it in ``__dict__`` " -"only is a good idea." -msgstr "" - -#: ../../howto/isolating-extensions.rst:198 -msgid "" -"If the module state includes ``PyObject`` pointers, the module object must " -"hold references to those objects and implement the module-level hooks " -"``m_traverse``, ``m_clear`` and ``m_free``. These work like ``tp_traverse``, " -"``tp_clear`` and ``tp_free`` of a class. Adding them will require some work " -"and make the code longer; this is the price for modules which can be " -"unloaded cleanly." -msgstr "" - -#: ../../howto/isolating-extensions.rst:205 -msgid "" -"An example of a module with per-module state is currently available as " -"`xxlimited `__; example module initialization shown at the bottom of the file." -msgstr "" - -#: ../../howto/isolating-extensions.rst:213 -msgid "Opt-Out: Limiting to One Module Object per Process" -msgstr "" - -#: ../../howto/isolating-extensions.rst:215 -msgid "" -"A non-negative ``PyModuleDef.m_size`` signals that a module supports " -"multiple interpreters correctly. If this is not yet the case for your " -"module, you can explicitly make your module loadable only once per process. " -"For example::" -msgstr "" - -#: ../../howto/isolating-extensions.rst:220 -msgid "" -"// A process-wide flag\n" -"static int loaded = 0;\n" -"\n" -"// Mutex to provide thread safety (only needed for free-threaded Python)\n" -"static PyMutex modinit_mutex = {0};\n" -"\n" -"static int\n" -"exec_module(PyObject* module)\n" -"{\n" -" PyMutex_Lock(&modinit_mutex);\n" -" if (loaded) {\n" -" PyMutex_Unlock(&modinit_mutex);\n" -" PyErr_SetString(PyExc_ImportError,\n" -" \"cannot load module more than once per process\");\n" -" return -1;\n" -" }\n" -" loaded = 1;\n" -" PyMutex_Unlock(&modinit_mutex);\n" -" // ... rest of initialization\n" -"}" -msgstr "" - -#: ../../howto/isolating-extensions.rst:242 -msgid "" -"If your module's :c:member:`PyModuleDef.m_clear` function is able to prepare " -"for future re-initialization, it should clear the ``loaded`` flag. In this " -"case, your module won't support multiple instances existing *concurrently*, " -"but it will, for example, support being loaded after Python runtime shutdown " -"(:c:func:`Py_FinalizeEx`) and re-initialization (:c:func:`Py_Initialize`)." -msgstr "" - -#: ../../howto/isolating-extensions.rst:251 -msgid "Module State Access from Functions" -msgstr "" - -#: ../../howto/isolating-extensions.rst:253 -msgid "" -"Accessing the state from module-level functions is straightforward. " -"Functions get the module object as their first argument; for extracting the " -"state, you can use ``PyModule_GetState``::" -msgstr "" - -#: ../../howto/isolating-extensions.rst:257 -msgid "" -"static PyObject *\n" -"func(PyObject *module, PyObject *args)\n" -"{\n" -" my_struct *state = (my_struct*)PyModule_GetState(module);\n" -" if (state == NULL) {\n" -" return NULL;\n" -" }\n" -" // ... rest of logic\n" -"}" -msgstr "" - -#: ../../howto/isolating-extensions.rst:268 -msgid "" -"``PyModule_GetState`` may return ``NULL`` without setting an exception if " -"there is no module state, i.e. ``PyModuleDef.m_size`` was zero. In your own " -"module, you're in control of ``m_size``, so this is easy to prevent." -msgstr "" - -#: ../../howto/isolating-extensions.rst:275 -msgid "Heap Types" -msgstr "" - -#: ../../howto/isolating-extensions.rst:277 -msgid "" -"Traditionally, types defined in C code are *static*; that is, ``static " -"PyTypeObject`` structures defined directly in code and initialized using " -"``PyType_Ready()``." -msgstr "" - -#: ../../howto/isolating-extensions.rst:281 -msgid "" -"Such types are necessarily shared across the process. Sharing them between " -"module objects requires paying attention to any state they own or access. To " -"limit the possible issues, static types are immutable at the Python level: " -"for example, you can't set ``str.myattribute = 123``." -msgstr "" - -#: ../../howto/isolating-extensions.rst:287 -msgid "" -"Sharing truly immutable objects between interpreters is fine, as long as " -"they don't provide access to mutable objects. However, in CPython, every " -"Python object has a mutable implementation detail: the reference count. " -"Changes to the refcount are guarded by the GIL. Thus, code that shares any " -"Python objects across interpreters implicitly depends on CPython's current, " -"process-wide GIL." -msgstr "" - -#: ../../howto/isolating-extensions.rst:294 -msgid "" -"Because they are immutable and process-global, static types cannot access " -"\"their\" module state. If any method of such a type requires access to " -"module state, the type must be converted to a *heap-allocated type*, or " -"*heap type* for short. These correspond more closely to classes created by " -"Python's ``class`` statement." -msgstr "" - -#: ../../howto/isolating-extensions.rst:301 -msgid "For new modules, using heap types by default is a good rule of thumb." -msgstr "" - -#: ../../howto/isolating-extensions.rst:305 -msgid "Changing Static Types to Heap Types" -msgstr "" - -#: ../../howto/isolating-extensions.rst:307 -msgid "" -"Static types can be converted to heap types, but note that the heap type API " -"was not designed for \"lossless\" conversion from static types—that is, " -"creating a type that works exactly like a given static type. So, when " -"rewriting the class definition in a new API, you are likely to " -"unintentionally change a few details (e.g. pickleability or inherited " -"slots). Always test the details that are important to you." -msgstr "" - -#: ../../howto/isolating-extensions.rst:316 -msgid "" -"Watch out for the following two points in particular (but note that this is " -"not a comprehensive list):" -msgstr "" - -#: ../../howto/isolating-extensions.rst:319 -msgid "" -"Unlike static types, heap type objects are mutable by default. Use the :c:" -"macro:`Py_TPFLAGS_IMMUTABLETYPE` flag to prevent mutability." -msgstr "" - -#: ../../howto/isolating-extensions.rst:321 -msgid "" -"Heap types inherit :c:member:`~PyTypeObject.tp_new` by default, so it may " -"become possible to instantiate them from Python code. You can prevent this " -"with the :c:macro:`Py_TPFLAGS_DISALLOW_INSTANTIATION` flag." -msgstr "" - -#: ../../howto/isolating-extensions.rst:327 -msgid "Defining Heap Types" -msgstr "" - -#: ../../howto/isolating-extensions.rst:329 -msgid "" -"Heap types can be created by filling a :c:struct:`PyType_Spec` structure, a " -"description or \"blueprint\" of a class, and calling :c:func:" -"`PyType_FromModuleAndSpec` to construct a new class object." -msgstr "" - -#: ../../howto/isolating-extensions.rst:334 -msgid "" -"Other functions, like :c:func:`PyType_FromSpec`, can also create heap types, " -"but :c:func:`PyType_FromModuleAndSpec` associates the module with the class, " -"allowing access to the module state from methods." -msgstr "" - -#: ../../howto/isolating-extensions.rst:338 -msgid "" -"The class should generally be stored in *both* the module state (for safe " -"access from C) and the module's ``__dict__`` (for access from Python code)." -msgstr "" - -#: ../../howto/isolating-extensions.rst:344 -msgid "Garbage-Collection Protocol" -msgstr "" - -#: ../../howto/isolating-extensions.rst:346 -msgid "" -"Instances of heap types hold a reference to their type. This ensures that " -"the type isn't destroyed before all its instances are, but may result in " -"reference cycles that need to be broken by the garbage collector." -msgstr "" - -#: ../../howto/isolating-extensions.rst:351 -msgid "" -"To avoid memory leaks, instances of heap types must implement the garbage " -"collection protocol. That is, heap types should:" -msgstr "" - -#: ../../howto/isolating-extensions.rst:355 -msgid "Have the :c:macro:`Py_TPFLAGS_HAVE_GC` flag." -msgstr "" - -#: ../../howto/isolating-extensions.rst:356 -msgid "" -"Define a traverse function using ``Py_tp_traverse``, which visits the type " -"(e.g. using ``Py_VISIT(Py_TYPE(self))``)." -msgstr "" - -#: ../../howto/isolating-extensions.rst:359 -msgid "" -"Please refer to the documentation of :c:macro:`Py_TPFLAGS_HAVE_GC` and :c:" -"member:`~PyTypeObject.tp_traverse` for additional considerations." -msgstr "" - -#: ../../howto/isolating-extensions.rst:363 -msgid "" -"The API for defining heap types grew organically, leaving it somewhat " -"awkward to use in its current state. The following sections will guide you " -"through common issues." -msgstr "" - -#: ../../howto/isolating-extensions.rst:369 -msgid "``tp_traverse`` in Python 3.8 and lower" -msgstr "" - -#: ../../howto/isolating-extensions.rst:371 -msgid "" -"The requirement to visit the type from ``tp_traverse`` was added in Python " -"3.9. If you support Python 3.8 and lower, the traverse function must *not* " -"visit the type, so it must be more complicated::" -msgstr "" - -#: ../../howto/isolating-extensions.rst:375 -msgid "" -"static int my_traverse(PyObject *self, visitproc visit, void *arg)\n" -"{\n" -" if (Py_Version >= 0x03090000) {\n" -" Py_VISIT(Py_TYPE(self));\n" -" }\n" -" return 0;\n" -"}" -msgstr "" - -#: ../../howto/isolating-extensions.rst:383 -msgid "" -"Unfortunately, :c:data:`Py_Version` was only added in Python 3.11. As a " -"replacement, use:" -msgstr "" - -#: ../../howto/isolating-extensions.rst:386 -msgid ":c:macro:`PY_VERSION_HEX`, if not using the stable ABI, or" -msgstr "" - -#: ../../howto/isolating-extensions.rst:387 -msgid "" -":py:data:`sys.version_info` (via :c:func:`PySys_GetObject` and :c:func:" -"`PyArg_ParseTuple`)." -msgstr "" - -#: ../../howto/isolating-extensions.rst:392 -msgid "Delegating ``tp_traverse``" -msgstr "" - -#: ../../howto/isolating-extensions.rst:394 -msgid "" -"If your traverse function delegates to the :c:member:`~PyTypeObject." -"tp_traverse` of its base class (or another type), ensure that " -"``Py_TYPE(self)`` is visited only once. Note that only heap type are " -"expected to visit the type in ``tp_traverse``." -msgstr "" - -#: ../../howto/isolating-extensions.rst:399 -msgid "For example, if your traverse function includes::" -msgstr "" - -#: ../../howto/isolating-extensions.rst:401 -msgid "base->tp_traverse(self, visit, arg)" -msgstr "" - -#: ../../howto/isolating-extensions.rst:403 -msgid "...and ``base`` may be a static type, then it should also include::" -msgstr "" - -#: ../../howto/isolating-extensions.rst:405 -msgid "" -"if (base->tp_flags & Py_TPFLAGS_HEAPTYPE) {\n" -" // a heap type's tp_traverse already visited Py_TYPE(self)\n" -"} else {\n" -" if (Py_Version >= 0x03090000) {\n" -" Py_VISIT(Py_TYPE(self));\n" -" }\n" -"}" -msgstr "" - -#: ../../howto/isolating-extensions.rst:413 -msgid "" -"It is not necessary to handle the type's reference count in :c:member:" -"`~PyTypeObject.tp_new` and :c:member:`~PyTypeObject.tp_clear`." -msgstr "" - -#: ../../howto/isolating-extensions.rst:418 -msgid "Defining ``tp_dealloc``" -msgstr "" - -#: ../../howto/isolating-extensions.rst:420 -msgid "" -"If your type has a custom :c:member:`~PyTypeObject.tp_dealloc` function, it " -"needs to:" -msgstr "" - -#: ../../howto/isolating-extensions.rst:423 -msgid "" -"call :c:func:`PyObject_GC_UnTrack` before any fields are invalidated, and" -msgstr "" - -#: ../../howto/isolating-extensions.rst:424 -msgid "decrement the reference count of the type." -msgstr "" - -#: ../../howto/isolating-extensions.rst:426 -msgid "" -"To keep the type valid while ``tp_free`` is called, the type's refcount " -"needs to be decremented *after* the instance is deallocated. For example::" -msgstr "" - -#: ../../howto/isolating-extensions.rst:429 -msgid "" -"static void my_dealloc(PyObject *self)\n" -"{\n" -" PyObject_GC_UnTrack(self);\n" -" ...\n" -" PyTypeObject *type = Py_TYPE(self);\n" -" type->tp_free(self);\n" -" Py_DECREF(type);\n" -"}" -msgstr "" - -#: ../../howto/isolating-extensions.rst:438 -msgid "" -"The default ``tp_dealloc`` function does this, so if your type does *not* " -"override ``tp_dealloc`` you don't need to add it." -msgstr "" - -#: ../../howto/isolating-extensions.rst:444 -msgid "Not overriding ``tp_free``" -msgstr "" - -#: ../../howto/isolating-extensions.rst:446 -msgid "" -"The :c:member:`~PyTypeObject.tp_free` slot of a heap type must be set to :c:" -"func:`PyObject_GC_Del`. This is the default; do not override it." -msgstr "" - -#: ../../howto/isolating-extensions.rst:452 -msgid "Avoiding ``PyObject_New``" -msgstr "" - -#: ../../howto/isolating-extensions.rst:454 -msgid "GC-tracked objects need to be allocated using GC-aware functions." -msgstr "" - -#: ../../howto/isolating-extensions.rst:456 -msgid "If you use use :c:func:`PyObject_New` or :c:func:`PyObject_NewVar`:" -msgstr "" - -#: ../../howto/isolating-extensions.rst:458 -msgid "" -"Get and call type's :c:member:`~PyTypeObject.tp_alloc` slot, if possible. " -"That is, replace ``TYPE *o = PyObject_New(TYPE, typeobj)`` with::" -msgstr "" - -#: ../../howto/isolating-extensions.rst:461 -msgid "TYPE *o = typeobj->tp_alloc(typeobj, 0);" -msgstr "" - -#: ../../howto/isolating-extensions.rst:463 -msgid "" -"Replace ``o = PyObject_NewVar(TYPE, typeobj, size)`` with the same, but use " -"size instead of the 0." -msgstr "" - -#: ../../howto/isolating-extensions.rst:466 -msgid "" -"If the above is not possible (e.g. inside a custom ``tp_alloc``), call :c:" -"func:`PyObject_GC_New` or :c:func:`PyObject_GC_NewVar`::" -msgstr "" - -#: ../../howto/isolating-extensions.rst:469 -msgid "" -"TYPE *o = PyObject_GC_New(TYPE, typeobj);\n" -"\n" -"TYPE *o = PyObject_GC_NewVar(TYPE, typeobj, size);" -msgstr "" - -#: ../../howto/isolating-extensions.rst:475 -msgid "Module State Access from Classes" -msgstr "" - -#: ../../howto/isolating-extensions.rst:477 -msgid "" -"If you have a type object defined with :c:func:`PyType_FromModuleAndSpec`, " -"you can call :c:func:`PyType_GetModule` to get the associated module, and " -"then :c:func:`PyModule_GetState` to get the module's state." -msgstr "" - -#: ../../howto/isolating-extensions.rst:481 -msgid "" -"To save a some tedious error-handling boilerplate code, you can combine " -"these two steps with :c:func:`PyType_GetModuleState`, resulting in::" -msgstr "" - -#: ../../howto/isolating-extensions.rst:484 -msgid "" -"my_struct *state = (my_struct*)PyType_GetModuleState(type);\n" -"if (state == NULL) {\n" -" return NULL;\n" -"}" -msgstr "" - -#: ../../howto/isolating-extensions.rst:491 -msgid "Module State Access from Regular Methods" -msgstr "" - -#: ../../howto/isolating-extensions.rst:493 -msgid "" -"Accessing the module-level state from methods of a class is somewhat more " -"complicated, but is possible thanks to API introduced in Python 3.9. To get " -"the state, you need to first get the *defining class*, and then get the " -"module state from it." -msgstr "" - -#: ../../howto/isolating-extensions.rst:498 -msgid "" -"The largest roadblock is getting *the class a method was defined in*, or " -"that method's \"defining class\" for short. The defining class can have a " -"reference to the module it is part of." -msgstr "" - -#: ../../howto/isolating-extensions.rst:502 -msgid "" -"Do not confuse the defining class with ``Py_TYPE(self)``. If the method is " -"called on a *subclass* of your type, ``Py_TYPE(self)`` will refer to that " -"subclass, which may be defined in different module than yours." -msgstr "" - -#: ../../howto/isolating-extensions.rst:507 -msgid "" -"The following Python code can illustrate the concept. ``Base." -"get_defining_class`` returns ``Base`` even if ``type(self) == Sub``:" -msgstr "" - -#: ../../howto/isolating-extensions.rst:511 -msgid "" -"class Base:\n" -" def get_type_of_self(self):\n" -" return type(self)\n" -"\n" -" def get_defining_class(self):\n" -" return __class__\n" -"\n" -"class Sub(Base):\n" -" pass" -msgstr "" - -#: ../../howto/isolating-extensions.rst:523 -msgid "" -"For a method to get its \"defining class\", it must use the :ref:" -"`METH_METHOD | METH_FASTCALL | METH_KEYWORDS ` :c:type:`calling convention ` and the " -"corresponding :c:type:`PyCMethod` signature::" -msgstr "" - -#: ../../howto/isolating-extensions.rst:528 -msgid "" -"PyObject *PyCMethod(\n" -" PyObject *self, // object the method was called on\n" -" PyTypeObject *defining_class, // defining class\n" -" PyObject *const *args, // C array of arguments\n" -" Py_ssize_t nargs, // length of \"args\"\n" -" PyObject *kwnames) // NULL, or dict of keyword arguments" -msgstr "" - -#: ../../howto/isolating-extensions.rst:535 -msgid "" -"Once you have the defining class, call :c:func:`PyType_GetModuleState` to " -"get the state of its associated module." -msgstr "" - -#: ../../howto/isolating-extensions.rst:538 -msgid "For example::" -msgstr "例えば::" - -#: ../../howto/isolating-extensions.rst:540 -msgid "" -"static PyObject *\n" -"example_method(PyObject *self,\n" -" PyTypeObject *defining_class,\n" -" PyObject *const *args,\n" -" Py_ssize_t nargs,\n" -" PyObject *kwnames)\n" -"{\n" -" my_struct *state = (my_struct*)PyType_GetModuleState(defining_class);\n" -" if (state == NULL) {\n" -" return NULL;\n" -" }\n" -" ... // rest of logic\n" -"}\n" -"\n" -"PyDoc_STRVAR(example_method_doc, \"...\");\n" -"\n" -"static PyMethodDef my_methods[] = {\n" -" {\"example_method\",\n" -" (PyCFunction)(void(*)(void))example_method,\n" -" METH_METHOD|METH_FASTCALL|METH_KEYWORDS,\n" -" example_method_doc}\n" -" {NULL},\n" -"}" -msgstr "" - -#: ../../howto/isolating-extensions.rst:566 -msgid "Module State Access from Slot Methods, Getters and Setters" -msgstr "" - -#: ../../howto/isolating-extensions.rst:570 -msgid "This is new in Python 3.11." -msgstr "これは Python 3.11 の新機能です。" - -#: ../../howto/isolating-extensions.rst:578 -msgid "" -"Slot methods—the fast C equivalents for special methods, such as :c:member:" -"`~PyNumberMethods.nb_add` for :py:attr:`~object.__add__` or :c:member:" -"`~PyTypeObject.tp_new` for initialization—have a very simple API that " -"doesn't allow passing in the defining class, unlike with :c:type:" -"`PyCMethod`. The same goes for getters and setters defined with :c:type:" -"`PyGetSetDef`." -msgstr "" - -#: ../../howto/isolating-extensions.rst:585 -msgid "" -"To access the module state in these cases, use the :c:func:" -"`PyType_GetModuleByDef` function, and pass in the module definition. Once " -"you have the module, call :c:func:`PyModule_GetState` to get the state::" -msgstr "" - -#: ../../howto/isolating-extensions.rst:590 -msgid "" -"PyObject *module = PyType_GetModuleByDef(Py_TYPE(self), &module_def);\n" -"my_struct *state = (my_struct*)PyModule_GetState(module);\n" -"if (state == NULL) {\n" -" return NULL;\n" -"}" -msgstr "" - -#: ../../howto/isolating-extensions.rst:596 -msgid "" -":c:func:`!PyType_GetModuleByDef` works by searching the :term:`method " -"resolution order` (i.e. all superclasses) for the first superclass that has " -"a corresponding module." -msgstr "" - -#: ../../howto/isolating-extensions.rst:602 -msgid "" -"In very exotic cases (inheritance chains spanning multiple modules created " -"from the same definition), :c:func:`!PyType_GetModuleByDef` might not return " -"the module of the true defining class. However, it will always return a " -"module with the same definition, ensuring a compatible C memory layout." -msgstr "" - -#: ../../howto/isolating-extensions.rst:610 -msgid "Lifetime of the Module State" -msgstr "" - -#: ../../howto/isolating-extensions.rst:612 -msgid "" -"When a module object is garbage-collected, its module state is freed. For " -"each pointer to (a part of) the module state, you must hold a reference to " -"the module object." -msgstr "" - -#: ../../howto/isolating-extensions.rst:616 -msgid "" -"Usually this is not an issue, because types created with :c:func:" -"`PyType_FromModuleAndSpec`, and their instances, hold a reference to the " -"module. However, you must be careful in reference counting when you " -"reference module state from other places, such as callbacks for external " -"libraries." -msgstr "" - -#: ../../howto/isolating-extensions.rst:625 -msgid "Open Issues" -msgstr "取り掛かり中の問題" - -#: ../../howto/isolating-extensions.rst:627 -msgid "Several issues around per-module state and heap types are still open." -msgstr "" - -#: ../../howto/isolating-extensions.rst:629 -msgid "" -"Discussions about improving the situation are best held on the `capi-sig " -"mailing list `__." -msgstr "" - -#: ../../howto/isolating-extensions.rst:634 -msgid "Per-Class Scope" -msgstr "" - -#: ../../howto/isolating-extensions.rst:636 -msgid "" -"It is currently (as of Python 3.11) not possible to attach state to " -"individual *types* without relying on CPython implementation details (which " -"may change in the future—perhaps, ironically, to allow a proper solution for " -"per-class scope)." -msgstr "" - -#: ../../howto/isolating-extensions.rst:643 -msgid "Lossless Conversion to Heap Types" -msgstr "" - -#: ../../howto/isolating-extensions.rst:645 -msgid "" -"The heap type API was not designed for \"lossless\" conversion from static " -"types; that is, creating a type that works exactly like a given static type." -msgstr "" diff --git a/howto/logging-cookbook.po b/howto/logging-cookbook.po index c128d72fd..6477cab55 100644 --- a/howto/logging-cookbook.po +++ b/howto/logging-cookbook.po @@ -1,29 +1,31 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# mollinaca, 2021 -# 渋川よしき , 2022 -# tomo, 2022 -# TENMYO Masakazu, 2024 -# Takeshi Nakazato, 2024 +# Ryuichi Takano , 2017 +# Arihiro TAKASE, 2017 +# 秘湯 , 2017 +# Osamu NAKAMURA, 2017 +# Inada Naoki , 2017 +# tomo, 2018 +# mollinaca, 2020 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:53+0000\n" -"Last-Translator: Takeshi Nakazato, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-07-26 07:02+0000\n" +"PO-Revision-Date: 2017-02-16 17:45+0000\n" +"Last-Translator: mollinaca, 2020\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../howto/logging-cookbook.rst:5 @@ -41,18 +43,16 @@ msgstr "Vinay Sajip " #: ../../howto/logging-cookbook.rst:9 msgid "" "This page contains a number of recipes related to logging, which have been " -"found useful in the past. For links to tutorial and reference information, " -"please see :ref:`cookbook-ref-links`." +"found useful in the past." msgstr "" -"このページは、過去に有用であるとされていた、logging に関連するいくつものレシ" -"ピを含んでいます。チュートリアルやリファレンス情報へのリンクについては :ref:" -"`cookbook-ref-links` を参照してください。" +"このページでは、過去に見つかった logging に関するいくつかの便利なレシピを紹介" +"します。" -#: ../../howto/logging-cookbook.rst:16 +#: ../../howto/logging-cookbook.rst:15 msgid "Using logging in multiple modules" msgstr "複数のモジュールで logging を使う" -#: ../../howto/logging-cookbook.rst:18 +#: ../../howto/logging-cookbook.rst:17 msgid "" "Multiple calls to ``logging.getLogger('someLogger')`` return a reference to " "the same logger object. This is true not only within the same module, but " @@ -71,99 +71,19 @@ msgstr "" "ない) ことが可能で、すべての子 logger への呼び出しは親にまで渡されます。まず" "はメインのモジュールです::" -#: ../../howto/logging-cookbook.rst:26 -msgid "" -"import logging\n" -"import auxiliary_module\n" -"\n" -"# create logger with 'spam_application'\n" -"logger = logging.getLogger('spam_application')\n" -"logger.setLevel(logging.DEBUG)\n" -"# create file handler which logs even debug messages\n" -"fh = logging.FileHandler('spam.log')\n" -"fh.setLevel(logging.DEBUG)\n" -"# create console handler with a higher log level\n" -"ch = logging.StreamHandler()\n" -"ch.setLevel(logging.ERROR)\n" -"# create formatter and add it to the handlers\n" -"formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - " -"%(message)s')\n" -"fh.setFormatter(formatter)\n" -"ch.setFormatter(formatter)\n" -"# add the handlers to the logger\n" -"logger.addHandler(fh)\n" -"logger.addHandler(ch)\n" -"\n" -"logger.info('creating an instance of auxiliary_module.Auxiliary')\n" -"a = auxiliary_module.Auxiliary()\n" -"logger.info('created an instance of auxiliary_module.Auxiliary')\n" -"logger.info('calling auxiliary_module.Auxiliary.do_something')\n" -"a.do_something()\n" -"logger.info('finished auxiliary_module.Auxiliary.do_something')\n" -"logger.info('calling auxiliary_module.some_function()')\n" -"auxiliary_module.some_function()\n" -"logger.info('done with auxiliary_module.some_function()')" -msgstr "" - -#: ../../howto/logging-cookbook.rst:56 +#: ../../howto/logging-cookbook.rst:55 msgid "Here is the auxiliary module::" msgstr "そして補助モジュール (auxiliary module) がこちらです::" -#: ../../howto/logging-cookbook.rst:58 -msgid "" -"import logging\n" -"\n" -"# create logger\n" -"module_logger = logging.getLogger('spam_application.auxiliary')\n" -"\n" -"class Auxiliary:\n" -" def __init__(self):\n" -" self.logger = logging.getLogger('spam_application.auxiliary." -"Auxiliary')\n" -" self.logger.info('creating an instance of Auxiliary')\n" -"\n" -" def do_something(self):\n" -" self.logger.info('doing something')\n" -" a = 1 + 1\n" -" self.logger.info('done doing something')\n" -"\n" -"def some_function():\n" -" module_logger.info('received a call to \"some_function\"')" -msgstr "" - -#: ../../howto/logging-cookbook.rst:76 +#: ../../howto/logging-cookbook.rst:75 msgid "The output looks like this:" msgstr "出力はこのようになります:" -#: ../../howto/logging-cookbook.rst:78 -msgid "" -"2005-03-23 23:47:11,663 - spam_application - INFO -\n" -" creating an instance of auxiliary_module.Auxiliary\n" -"2005-03-23 23:47:11,665 - spam_application.auxiliary.Auxiliary - INFO -\n" -" creating an instance of Auxiliary\n" -"2005-03-23 23:47:11,665 - spam_application - INFO -\n" -" created an instance of auxiliary_module.Auxiliary\n" -"2005-03-23 23:47:11,668 - spam_application - INFO -\n" -" calling auxiliary_module.Auxiliary.do_something\n" -"2005-03-23 23:47:11,668 - spam_application.auxiliary.Auxiliary - INFO -\n" -" doing something\n" -"2005-03-23 23:47:11,669 - spam_application.auxiliary.Auxiliary - INFO -\n" -" done doing something\n" -"2005-03-23 23:47:11,670 - spam_application - INFO -\n" -" finished auxiliary_module.Auxiliary.do_something\n" -"2005-03-23 23:47:11,671 - spam_application - INFO -\n" -" calling auxiliary_module.some_function()\n" -"2005-03-23 23:47:11,672 - spam_application.auxiliary - INFO -\n" -" received a call to 'some_function'\n" -"2005-03-23 23:47:11,673 - spam_application - INFO -\n" -" done with auxiliary_module.some_function()" -msgstr "" - -#: ../../howto/logging-cookbook.rst:102 +#: ../../howto/logging-cookbook.rst:101 msgid "Logging from multiple threads" msgstr "複数のスレッドからのロギング" -#: ../../howto/logging-cookbook.rst:104 +#: ../../howto/logging-cookbook.rst:103 msgid "" "Logging from multiple threads requires no special effort. The following " "example shows logging from the main (initial) thread and another thread::" @@ -171,62 +91,11 @@ msgstr "" "複数スレッドからのロギングでは特別に何かをする必要はありません。\n" "次の例はmain (初期) スレッドとそれ以外のスレッドからのロギングの例です::" -#: ../../howto/logging-cookbook.rst:107 -msgid "" -"import logging\n" -"import threading\n" -"import time\n" -"\n" -"def worker(arg):\n" -" while not arg['stop']:\n" -" logging.debug('Hi from myfunc')\n" -" time.sleep(0.5)\n" -"\n" -"def main():\n" -" logging.basicConfig(level=logging.DEBUG, format='%(relativeCreated)6d " -"%(threadName)s %(message)s')\n" -" info = {'stop': False}\n" -" thread = threading.Thread(target=worker, args=(info,))\n" -" thread.start()\n" -" while True:\n" -" try:\n" -" logging.debug('Hello from main')\n" -" time.sleep(0.75)\n" -" except KeyboardInterrupt:\n" -" info['stop'] = True\n" -" break\n" -" thread.join()\n" -"\n" -"if __name__ == '__main__':\n" -" main()" -msgstr "" - -#: ../../howto/logging-cookbook.rst:133 +#: ../../howto/logging-cookbook.rst:132 msgid "When run, the script should print something like the following:" msgstr "実行すると、出力は以下のようになるはずです:" -#: ../../howto/logging-cookbook.rst:135 -msgid "" -" 0 Thread-1 Hi from myfunc\n" -" 3 MainThread Hello from main\n" -" 505 Thread-1 Hi from myfunc\n" -" 755 MainThread Hello from main\n" -"1007 Thread-1 Hi from myfunc\n" -"1507 MainThread Hello from main\n" -"1508 Thread-1 Hi from myfunc\n" -"2010 Thread-1 Hi from myfunc\n" -"2258 MainThread Hello from main\n" -"2512 Thread-1 Hi from myfunc\n" -"3009 MainThread Hello from main\n" -"3013 Thread-1 Hi from myfunc\n" -"3515 Thread-1 Hi from myfunc\n" -"3761 MainThread Hello from main\n" -"4017 Thread-1 Hi from myfunc\n" -"4513 MainThread Hello from main\n" -"4518 Thread-1 Hi from myfunc" -msgstr "" - -#: ../../howto/logging-cookbook.rst:155 +#: ../../howto/logging-cookbook.rst:154 msgid "" "This shows the logging output interspersed as one might expect. This " "approach works for more threads than shown here, of course." @@ -234,11 +103,11 @@ msgstr "" "予想した通りかもしれませんが、ログ出力が散らばっているのが分かります。\n" "もちろん、この手法はより多くのスレッドでも上手くいきます。" -#: ../../howto/logging-cookbook.rst:159 +#: ../../howto/logging-cookbook.rst:158 msgid "Multiple handlers and formatters" msgstr "複数の handler と formatter" -#: ../../howto/logging-cookbook.rst:161 +#: ../../howto/logging-cookbook.rst:160 msgid "" "Loggers are plain Python objects. The :meth:`~Logger.addHandler` method has " "no minimum or maximum quota for the number of handlers you may add. " @@ -257,36 +126,7 @@ msgstr "" "コードの中のログ記録の呼び出しは変更されずに残ります。少し前に取り上げた単純" "なモジュール式の例を少し変えるとこうなります::" -#: ../../howto/logging-cookbook.rst:169 -msgid "" -"import logging\n" -"\n" -"logger = logging.getLogger('simple_example')\n" -"logger.setLevel(logging.DEBUG)\n" -"# create file handler which logs even debug messages\n" -"fh = logging.FileHandler('spam.log')\n" -"fh.setLevel(logging.DEBUG)\n" -"# create console handler with a higher log level\n" -"ch = logging.StreamHandler()\n" -"ch.setLevel(logging.ERROR)\n" -"# create formatter and add it to the handlers\n" -"formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - " -"%(message)s')\n" -"ch.setFormatter(formatter)\n" -"fh.setFormatter(formatter)\n" -"# add the handlers to logger\n" -"logger.addHandler(ch)\n" -"logger.addHandler(fh)\n" -"\n" -"# 'application' code\n" -"logger.debug('debug message')\n" -"logger.info('info message')\n" -"logger.warning('warn message')\n" -"logger.error('error message')\n" -"logger.critical('critical message')" -msgstr "" - -#: ../../howto/logging-cookbook.rst:194 +#: ../../howto/logging-cookbook.rst:193 msgid "" "Notice that the 'application' code does not care about multiple handlers. " "All that changed was the addition and configuration of a new handler named " @@ -296,7 +136,7 @@ msgstr "" "目してください。変更した箇所は新しい *fh* という名の handler を追加して設定し" "たところがすべてです。" -#: ../../howto/logging-cookbook.rst:197 +#: ../../howto/logging-cookbook.rst:196 msgid "" "The ability to create new handlers with higher- or lower-severity filters " "can be very helpful when writing and testing an application. Instead of " @@ -315,11 +155,11 @@ msgstr "" "その時必要になるのはただ logger および/または handler の深刻度の設定をいじる" "ことだけです。" -#: ../../howto/logging-cookbook.rst:208 +#: ../../howto/logging-cookbook.rst:207 msgid "Logging to multiple destinations" msgstr "複数の出力先にログを出力する" -#: ../../howto/logging-cookbook.rst:210 +#: ../../howto/logging-cookbook.rst:209 msgid "" "Let's say you want to log to console and file with different message formats " "and in differing circumstances. Say you want to log messages with levels of " @@ -333,70 +173,15 @@ msgstr "" "また、ファイルにはタイムスタンプを記録し、コンソールには出力しないとします。" "以下のようにすれば、こうした挙動を実現できます::" -#: ../../howto/logging-cookbook.rst:216 -msgid "" -"import logging\n" -"\n" -"# set up logging to file - see previous section for more details\n" -"logging.basicConfig(level=logging.DEBUG,\n" -" format='%(asctime)s %(name)-12s %(levelname)-8s " -"%(message)s',\n" -" datefmt='%m-%d %H:%M',\n" -" filename='/tmp/myapp.log',\n" -" filemode='w')\n" -"# define a Handler which writes INFO messages or higher to the sys.stderr\n" -"console = logging.StreamHandler()\n" -"console.setLevel(logging.INFO)\n" -"# set a format which is simpler for console use\n" -"formatter = logging.Formatter('%(name)-12s: %(levelname)-8s %(message)s')\n" -"# tell the handler to use this format\n" -"console.setFormatter(formatter)\n" -"# add the handler to the root logger\n" -"logging.getLogger('').addHandler(console)\n" -"\n" -"# Now, we can log to the root logger, or any other logger. First the " -"root...\n" -"logging.info('Jackdaws love my big sphinx of quartz.')\n" -"\n" -"# Now, define a couple of other loggers which might represent areas in your\n" -"# application:\n" -"\n" -"logger1 = logging.getLogger('myapp.area1')\n" -"logger2 = logging.getLogger('myapp.area2')\n" -"\n" -"logger1.debug('Quick zephyrs blow, vexing daft Jim.')\n" -"logger1.info('How quickly daft jumping zebras vex.')\n" -"logger2.warning('Jail zesty vixen who grabbed pay from quack.')\n" -"logger2.error('The five boxing wizards jump quickly.')" -msgstr "" - -#: ../../howto/logging-cookbook.rst:248 +#: ../../howto/logging-cookbook.rst:247 msgid "When you run this, on the console you will see" msgstr "これを実行すると、コンソールには以下のように出力されます:" -#: ../../howto/logging-cookbook.rst:250 -msgid "" -"root : INFO Jackdaws love my big sphinx of quartz.\n" -"myapp.area1 : INFO How quickly daft jumping zebras vex.\n" -"myapp.area2 : WARNING Jail zesty vixen who grabbed pay from quack.\n" -"myapp.area2 : ERROR The five boxing wizards jump quickly." -msgstr "" - -#: ../../howto/logging-cookbook.rst:257 +#: ../../howto/logging-cookbook.rst:256 msgid "and in the file you will see something like" msgstr "そして、ファイルには以下のように出力されるはずです:" -#: ../../howto/logging-cookbook.rst:259 -msgid "" -"10-22 22:19 root INFO Jackdaws love my big sphinx of quartz.\n" -"10-22 22:19 myapp.area1 DEBUG Quick zephyrs blow, vexing daft Jim.\n" -"10-22 22:19 myapp.area1 INFO How quickly daft jumping zebras vex.\n" -"10-22 22:19 myapp.area2 WARNING Jail zesty vixen who grabbed pay from " -"quack.\n" -"10-22 22:19 myapp.area2 ERROR The five boxing wizards jump quickly." -msgstr "" - -#: ../../howto/logging-cookbook.rst:267 +#: ../../howto/logging-cookbook.rst:266 msgid "" "As you can see, the DEBUG message only shows up in the file. The other " "messages are sent to both destinations." @@ -404,7 +189,7 @@ msgstr "" "これを見て分かる通り、DEBUG メッセージはファイルだけに出力され、その他のメッ" "セージは両方に出力されます。" -#: ../../howto/logging-cookbook.rst:270 +#: ../../howto/logging-cookbook.rst:269 msgid "" "This example uses console and file handlers, but you can use any number and " "combination of handlers you choose." @@ -412,321 +197,15 @@ msgstr "" "この例ではコンソールとファイルのハンドラだけを使っていますが、実際には任意の" "数のハンドラや組み合わせを使えます。" -#: ../../howto/logging-cookbook.rst:273 -msgid "" -"Note that the above choice of log filename ``/tmp/myapp.log`` implies use of " -"a standard location for temporary files on POSIX systems. On Windows, you " -"may need to choose a different directory name for the log - just ensure that " -"the directory exists and that you have the permissions to create and update " -"files in it." -msgstr "" -"ここでファイル名として ``/tmp/myapp.log`` を選んだということは、一時ファイル" -"の標準的な場所として POSIX システムを想定していることに注意してください。 " -"Windows の場合、ディレクトリが存在し、そのディレクトリに対してファイルを更新" -"するための適切な権限を有することを保証するために、ログファイル向けのディレク" -"トリ名として異なる選択を取る必要があるでしょう。" - -#: ../../howto/logging-cookbook.rst:282 -msgid "Custom handling of levels" -msgstr "ログレベルのカスタム処理" - -#: ../../howto/logging-cookbook.rst:284 -msgid "" -"Sometimes, you might want to do something slightly different from the " -"standard handling of levels in handlers, where all levels above a threshold " -"get processed by a handler. To do this, you need to use filters. Let's look " -"at a scenario where you want to arrange things as follows:" -msgstr "" -"しきい値以上のログレベル全てがハンドラによって処理される標準的な処理に対し" -"て、ときにはわずかに異なる振る舞いを必要とすることもあるでしょう。そのような" -"場合はフィルタを使う必要があります。以下のような処理が必要なシナリオについて" -"取り上げてみましょう:" - -#: ../../howto/logging-cookbook.rst:289 -msgid "Send messages of severity ``INFO`` and ``WARNING`` to ``sys.stdout``" -msgstr "深刻度 ``INFO`` と ``WARNING`` のメッセージを ``sys.stdout`` に送る" - -#: ../../howto/logging-cookbook.rst:290 -msgid "Send messages of severity ``ERROR`` and above to ``sys.stderr``" -msgstr "深刻度 ``ERROR`` 以上のメッセージを ``sys.stderr`` に送る" - -#: ../../howto/logging-cookbook.rst:291 -msgid "Send messages of severity ``DEBUG`` and above to file ``app.log``" -msgstr "深刻度 ``DEBUG`` 以上のメッセージをファイル ``app.log`` に送る" - -#: ../../howto/logging-cookbook.rst:293 -msgid "Suppose you configure logging with the following JSON:" -msgstr "logging モジュールを下記の JSON によって構成したとしましょう:" - -#: ../../howto/logging-cookbook.rst:295 -msgid "" -"{\n" -" \"version\": 1,\n" -" \"disable_existing_loggers\": false,\n" -" \"formatters\": {\n" -" \"simple\": {\n" -" \"format\": \"%(levelname)-8s - %(message)s\"\n" -" }\n" -" },\n" -" \"handlers\": {\n" -" \"stdout\": {\n" -" \"class\": \"logging.StreamHandler\",\n" -" \"level\": \"INFO\",\n" -" \"formatter\": \"simple\",\n" -" \"stream\": \"ext://sys.stdout\"\n" -" },\n" -" \"stderr\": {\n" -" \"class\": \"logging.StreamHandler\",\n" -" \"level\": \"ERROR\",\n" -" \"formatter\": \"simple\",\n" -" \"stream\": \"ext://sys.stderr\"\n" -" },\n" -" \"file\": {\n" -" \"class\": \"logging.FileHandler\",\n" -" \"formatter\": \"simple\",\n" -" \"filename\": \"app.log\",\n" -" \"mode\": \"w\"\n" -" }\n" -" },\n" -" \"root\": {\n" -" \"level\": \"DEBUG\",\n" -" \"handlers\": [\n" -" \"stderr\",\n" -" \"stdout\",\n" -" \"file\"\n" -" ]\n" -" }\n" -"}" -msgstr "" - -#: ../../howto/logging-cookbook.rst:335 -msgid "" -"This configuration does *almost* what we want, except that ``sys.stdout`` " -"would show messages of severity ``ERROR`` and only events of this severity " -"and higher will be tracked as well as ``INFO`` and ``WARNING`` messages. To " -"prevent this, we can set up a filter which excludes those messages and add " -"it to the relevant handler. This can be configured by adding a ``filters`` " -"section parallel to ``formatters`` and ``handlers``:" -msgstr "" - -#: ../../howto/logging-cookbook.rst:341 -msgid "" -"{\n" -" \"filters\": {\n" -" \"warnings_and_below\": {\n" -" \"()\" : \"__main__.filter_maker\",\n" -" \"level\": \"WARNING\"\n" -" }\n" -" }\n" -"}" -msgstr "" - -#: ../../howto/logging-cookbook.rst:352 -msgid "and changing the section on the ``stdout`` handler to add it:" -msgstr "" -"そして ``stdout`` のハンドラに関するセクションにフィルターを追加します:" - -#: ../../howto/logging-cookbook.rst:354 -msgid "" -"{\n" -" \"stdout\": {\n" -" \"class\": \"logging.StreamHandler\",\n" -" \"level\": \"INFO\",\n" -" \"formatter\": \"simple\",\n" -" \"stream\": \"ext://sys.stdout\",\n" -" \"filters\": [\"warnings_and_below\"]\n" -" }\n" -"}" -msgstr "" - -#: ../../howto/logging-cookbook.rst:366 -msgid "" -"A filter is just a function, so we can define the ``filter_maker`` (a " -"factory function) as follows:" -msgstr "" -"フィルターは単なる関数なので、 ``filter_maker`` (ファクトリ関数) は以下のよう" -"に定義することができます:" - -#: ../../howto/logging-cookbook.rst:369 -msgid "" -"def filter_maker(level):\n" -" level = getattr(logging, level)\n" -"\n" -" def filter(record):\n" -" return record.levelno <= level\n" -"\n" -" return filter" -msgstr "" - -#: ../../howto/logging-cookbook.rst:379 -msgid "" -"This converts the string argument passed in to a numeric level, and returns " -"a function which only returns ``True`` if the level of the passed in record " -"is at or below the specified level. Note that in this example I have defined " -"the ``filter_maker`` in a test script ``main.py`` that I run from the " -"command line, so its module will be ``__main__`` - hence the ``__main__." -"filter_maker`` in the filter configuration. You will need to change that if " -"you define it in a different module." -msgstr "" -"この関数は引数として与えられた文字列をログレベルの数値に変換し、ログレコード" -"内のログレベルが指定されたレベル以下の場合に ``True`` を返す関数を返します。" -"この例では ``filter_maker`` をコマンドラインから実行するテストスクリプト " -"``main.py`` で関数が定義されているため、フィルター設定上のモジュール名は " -"``__main__`` になります。そのためフィルター設定の中では ``__main__." -"filter_maker`` となります。異なるモジュールで関数を定義した場合、この部分を変" -"更する必要があります。" - -#: ../../howto/logging-cookbook.rst:387 -msgid "With the filter added, we can run ``main.py``, which in full is:" -msgstr "" -"フィルターを追加した ``main.py`` の全体像は以下のようになり、これで実行できる" -"状態になりました:" - -#: ../../howto/logging-cookbook.rst:389 -msgid "" -"import json\n" -"import logging\n" -"import logging.config\n" -"\n" -"CONFIG = '''\n" -"{\n" -" \"version\": 1,\n" -" \"disable_existing_loggers\": false,\n" -" \"formatters\": {\n" -" \"simple\": {\n" -" \"format\": \"%(levelname)-8s - %(message)s\"\n" -" }\n" -" },\n" -" \"filters\": {\n" -" \"warnings_and_below\": {\n" -" \"()\" : \"__main__.filter_maker\",\n" -" \"level\": \"WARNING\"\n" -" }\n" -" },\n" -" \"handlers\": {\n" -" \"stdout\": {\n" -" \"class\": \"logging.StreamHandler\",\n" -" \"level\": \"INFO\",\n" -" \"formatter\": \"simple\",\n" -" \"stream\": \"ext://sys.stdout\",\n" -" \"filters\": [\"warnings_and_below\"]\n" -" },\n" -" \"stderr\": {\n" -" \"class\": \"logging.StreamHandler\",\n" -" \"level\": \"ERROR\",\n" -" \"formatter\": \"simple\",\n" -" \"stream\": \"ext://sys.stderr\"\n" -" },\n" -" \"file\": {\n" -" \"class\": \"logging.FileHandler\",\n" -" \"formatter\": \"simple\",\n" -" \"filename\": \"app.log\",\n" -" \"mode\": \"w\"\n" -" }\n" -" },\n" -" \"root\": {\n" -" \"level\": \"DEBUG\",\n" -" \"handlers\": [\n" -" \"stderr\",\n" -" \"stdout\",\n" -" \"file\"\n" -" ]\n" -" }\n" -"}\n" -"'''\n" -"\n" -"def filter_maker(level):\n" -" level = getattr(logging, level)\n" -"\n" -" def filter(record):\n" -" return record.levelno <= level\n" -"\n" -" return filter\n" -"\n" -"logging.config.dictConfig(json.loads(CONFIG))\n" -"logging.debug('A DEBUG message')\n" -"logging.info('An INFO message')\n" -"logging.warning('A WARNING message')\n" -"logging.error('An ERROR message')\n" -"logging.critical('A CRITICAL message')" -msgstr "" - -#: ../../howto/logging-cookbook.rst:457 -msgid "And after running it like this:" -msgstr "これを以下のように実行します:" - -#: ../../howto/logging-cookbook.rst:459 -msgid "python main.py 2>stderr.log >stdout.log" -msgstr "" - -#: ../../howto/logging-cookbook.rst:463 -msgid "We can see the results are as expected:" -msgstr "すると期待通りの結果を得ることができます:" - -#: ../../howto/logging-cookbook.rst:465 -msgid "" -"$ more *.log\n" -"::::::::::::::\n" -"app.log\n" -"::::::::::::::\n" -"DEBUG - A DEBUG message\n" -"INFO - An INFO message\n" -"WARNING - A WARNING message\n" -"ERROR - An ERROR message\n" -"CRITICAL - A CRITICAL message\n" -"::::::::::::::\n" -"stderr.log\n" -"::::::::::::::\n" -"ERROR - An ERROR message\n" -"CRITICAL - A CRITICAL message\n" -"::::::::::::::\n" -"stdout.log\n" -"::::::::::::::\n" -"INFO - An INFO message\n" -"WARNING - A WARNING message" -msgstr "" - -#: ../../howto/logging-cookbook.rst:489 +#: ../../howto/logging-cookbook.rst:274 msgid "Configuration server example" msgstr "設定サーバの例" -#: ../../howto/logging-cookbook.rst:491 +#: ../../howto/logging-cookbook.rst:276 msgid "Here is an example of a module using the logging configuration server::" msgstr "ログ記録設定サーバを使うモジュールの例です::" -#: ../../howto/logging-cookbook.rst:493 -msgid "" -"import logging\n" -"import logging.config\n" -"import time\n" -"import os\n" -"\n" -"# read initial config file\n" -"logging.config.fileConfig('logging.conf')\n" -"\n" -"# create and start listener on port 9999\n" -"t = logging.config.listen(9999)\n" -"t.start()\n" -"\n" -"logger = logging.getLogger('simpleExample')\n" -"\n" -"try:\n" -" # loop through logging calls to see the difference\n" -" # new configurations make, until Ctrl+C is pressed\n" -" while True:\n" -" logger.debug('debug message')\n" -" logger.info('info message')\n" -" logger.warning('warn message')\n" -" logger.error('error message')\n" -" logger.critical('critical message')\n" -" time.sleep(5)\n" -"except KeyboardInterrupt:\n" -" # cleanup\n" -" logging.config.stopListening()\n" -" t.join()" -msgstr "" - -#: ../../howto/logging-cookbook.rst:522 +#: ../../howto/logging-cookbook.rst:307 msgid "" "And here is a script that takes a filename and sends that file to the " "server, properly preceded with the binary-encoded length, as the new logging " @@ -736,41 +215,21 @@ msgstr "" "に先だってバイナリエンコード長を新しいログ記録の設定として先に送っておきま" "す::" -#: ../../howto/logging-cookbook.rst:526 -msgid "" -"#!/usr/bin/env python\n" -"import socket, sys, struct\n" -"\n" -"with open(sys.argv[1], 'rb') as f:\n" -" data_to_send = f.read()\n" -"\n" -"HOST = 'localhost'\n" -"PORT = 9999\n" -"s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\n" -"print('connecting...')\n" -"s.connect((HOST, PORT))\n" -"print('sending config...')\n" -"s.send(struct.pack('>L', len(data_to_send)))\n" -"s.send(data_to_send)\n" -"s.close()\n" -"print('complete')" -msgstr "" - -#: ../../howto/logging-cookbook.rst:547 +#: ../../howto/logging-cookbook.rst:330 msgid "Dealing with handlers that block" msgstr "ブロックする handler を扱う" -#: ../../howto/logging-cookbook.rst:551 +#: ../../howto/logging-cookbook.rst:334 msgid "" "Sometimes you have to get your logging handlers to do their work without " -"blocking the thread you're logging from. This is common in web applications, " +"blocking the thread you're logging from. This is common in Web applications, " "though of course it also occurs in other scenarios." msgstr "" "ときどき、logging を行っているスレッドをブロックせずに、handler が動くように" "しないといけないときがあります。これは Web アプリケーションではよくあることで" "すし、もちろん他のシナリオでも起きる話です。" -#: ../../howto/logging-cookbook.rst:555 +#: ../../howto/logging-cookbook.rst:338 msgid "" "A common culprit which demonstrates sluggish behaviour is the :class:" "`SMTPHandler`: sending emails can take a long time, for a number of reasons " @@ -788,7 +247,7 @@ msgstr "" "を行うことがあります (そしてこの問い合わせ処理は、 Python の層より下のあなた" "の手の届かない、ソケットライブラリの深いところにある可能性もあります)。" -#: ../../howto/logging-cookbook.rst:563 +#: ../../howto/logging-cookbook.rst:346 msgid "" "One solution is to use a two-part approach. For the first part, attach only " "a :class:`QueueHandler` to those loggers which are accessed from performance-" @@ -810,7 +269,7 @@ msgstr "" "このことを (``QueueHandler`` だけをアタッチした logger についての言及を添え" "て) ドキュメントに書いておきましょう。" -#: ../../howto/logging-cookbook.rst:574 +#: ../../howto/logging-cookbook.rst:357 msgid "" "The second part of the solution is :class:`QueueListener`, which has been " "designed as the counterpart to :class:`QueueHandler`. A :class:" @@ -826,7 +285,7 @@ msgstr "" "元) から送られた LogRecord をキューから受け取るスレッドを起動します。 " "``LogRecord`` をキューから取り出して、 handler に渡して処理させます。" -#: ../../howto/logging-cookbook.rst:582 +#: ../../howto/logging-cookbook.rst:365 msgid "" "The advantage of having a separate :class:`QueueListener` class is that you " "can use the same instance to service multiple ``QueueHandlers``. This is " @@ -839,57 +298,15 @@ msgstr "" "handler のスレッド利用版を使って handler ごとにスレッドを持つよりはずっとリ" "ソースにやさしくなります。" -#: ../../howto/logging-cookbook.rst:587 +#: ../../howto/logging-cookbook.rst:370 msgid "An example of using these two classes follows (imports omitted)::" msgstr "この2つのクラスを利用する例です (import は省略)::" -#: ../../howto/logging-cookbook.rst:589 -msgid "" -"que = queue.Queue(-1) # no limit on size\n" -"queue_handler = QueueHandler(que)\n" -"handler = logging.StreamHandler()\n" -"listener = QueueListener(que, handler)\n" -"root = logging.getLogger()\n" -"root.addHandler(queue_handler)\n" -"formatter = logging.Formatter('%(threadName)s: %(message)s')\n" -"handler.setFormatter(formatter)\n" -"listener.start()\n" -"# The log output will display the thread which generated\n" -"# the event (the main thread) rather than the internal\n" -"# thread which monitors the internal queue. This is what\n" -"# you want to happen.\n" -"root.warning('Look out!')\n" -"listener.stop()" -msgstr "" - -#: ../../howto/logging-cookbook.rst:605 +#: ../../howto/logging-cookbook.rst:388 msgid "which, when run, will produce:" msgstr "実行すると次のように出力します:" -#: ../../howto/logging-cookbook.rst:607 -msgid "MainThread: Look out!" -msgstr "" - -#: ../../howto/logging-cookbook.rst:611 -msgid "" -"Although the earlier discussion wasn't specifically talking about async " -"code, but rather about slow logging handlers, it should be noted that when " -"logging from async code, network and even file handlers could lead to " -"problems (blocking the event loop) because some logging is done from :mod:" -"`asyncio` internals. It might be best, if any async code is used in an " -"application, to use the above approach for logging, so that any blocking " -"code runs only in the ``QueueListener`` thread." -msgstr "" -"上述の議論は特に同期コードにについてのものではなく、むしろ遅いロギングハンド" -"ラについてでしたが、非同期コードやネットワーク、あるいはファイルハンドラから" -"のロギングでさえも (イベントループをブロックしてしまう) 問題につながる可能性" -"があることには注意すべきでしょう。これはいくつかのロギングが :mod:`asyncio` " -"内部で行われることが理由です。何らかの非同期コードがアプリケーションの中で使" -"われている場合、ロギングには上記のアプローチを使っていかなるブロッキングコー" -"ドも ``QueueListener`` スレッド内だけで実行されるようにしておくことが最も良い" -"でしょう。" - -#: ../../howto/logging-cookbook.rst:619 +#: ../../howto/logging-cookbook.rst:394 msgid "" "Prior to Python 3.5, the :class:`QueueListener` always passed every message " "received from the queue to every handler it was initialized with. (This was " @@ -909,27 +326,11 @@ msgstr "" "が行われると、各メッセージのレベルをハンドラーのレベルと比較して、そうするこ" "とが適切な場合のみ、メッセージをハンドラーに渡します。" -#: ../../howto/logging-cookbook.rst:629 -msgid "" -"The :class:`QueueListener` can be started (and stopped) via the :keyword:" -"`with` statement. For example:" -msgstr "" - -#: ../../howto/logging-cookbook.rst:633 -msgid "" -"with QueueListener(que, handler) as listener:\n" -" # The queue listener automatically starts\n" -" # when the 'with' block is entered.\n" -" pass\n" -"# The queue listener automatically stops once\n" -"# the 'with' block is exited." -msgstr "" - -#: ../../howto/logging-cookbook.rst:645 +#: ../../howto/logging-cookbook.rst:407 msgid "Sending and receiving logging events across a network" msgstr "ネットワーク越しの logging イベントの送受信" -#: ../../howto/logging-cookbook.rst:647 +#: ../../howto/logging-cookbook.rst:409 msgid "" "Let's say you want to send logging events across a network, and handle them " "at the receiving end. A simple way of doing this is attaching a :class:" @@ -939,35 +340,7 @@ msgstr "" "う。 :class:`SocketHandler` インスタンスを送信端の root logger にアタッチすれ" "ば、簡単に実現できます::" -#: ../../howto/logging-cookbook.rst:651 -msgid "" -"import logging, logging.handlers\n" -"\n" -"rootLogger = logging.getLogger('')\n" -"rootLogger.setLevel(logging.DEBUG)\n" -"socketHandler = logging.handlers.SocketHandler('localhost',\n" -" logging.handlers.DEFAULT_TCP_LOGGING_PORT)\n" -"# don't bother with a formatter, since a socket handler sends the event as\n" -"# an unformatted pickle\n" -"rootLogger.addHandler(socketHandler)\n" -"\n" -"# Now, we can log to the root logger, or any other logger. First the " -"root...\n" -"logging.info('Jackdaws love my big sphinx of quartz.')\n" -"\n" -"# Now, define a couple of other loggers which might represent areas in your\n" -"# application:\n" -"\n" -"logger1 = logging.getLogger('myapp.area1')\n" -"logger2 = logging.getLogger('myapp.area2')\n" -"\n" -"logger1.debug('Quick zephyrs blow, vexing daft Jim.')\n" -"logger1.info('How quickly daft jumping zebras vex.')\n" -"logger2.warning('Jail zesty vixen who grabbed pay from quack.')\n" -"logger2.error('The five boxing wizards jump quickly.')" -msgstr "" - -#: ../../howto/logging-cookbook.rst:675 +#: ../../howto/logging-cookbook.rst:437 msgid "" "At the receiving end, you can set up a receiver using the :mod:" "`socketserver` module. Here is a basic working example::" @@ -975,98 +348,7 @@ msgstr "" "受信端では :mod:`socketserver` モジュールを使って受信プログラムを作成しておき" "ます。簡単な実用プログラムを以下に示します::" -#: ../../howto/logging-cookbook.rst:678 -msgid "" -"import pickle\n" -"import logging\n" -"import logging.handlers\n" -"import socketserver\n" -"import struct\n" -"\n" -"\n" -"class LogRecordStreamHandler(socketserver.StreamRequestHandler):\n" -" \"\"\"Handler for a streaming logging request.\n" -"\n" -" This basically logs the record using whatever logging policy is\n" -" configured locally.\n" -" \"\"\"\n" -"\n" -" def handle(self):\n" -" \"\"\"\n" -" Handle multiple requests - each expected to be a 4-byte length,\n" -" followed by the LogRecord in pickle format. Logs the record\n" -" according to whatever policy is configured locally.\n" -" \"\"\"\n" -" while True:\n" -" chunk = self.connection.recv(4)\n" -" if len(chunk) < 4:\n" -" break\n" -" slen = struct.unpack('>L', chunk)[0]\n" -" chunk = self.connection.recv(slen)\n" -" while len(chunk) < slen:\n" -" chunk = chunk + self.connection.recv(slen - len(chunk))\n" -" obj = self.unPickle(chunk)\n" -" record = logging.makeLogRecord(obj)\n" -" self.handleLogRecord(record)\n" -"\n" -" def unPickle(self, data):\n" -" return pickle.loads(data)\n" -"\n" -" def handleLogRecord(self, record):\n" -" # if a name is specified, we use the named logger rather than the " -"one\n" -" # implied by the record.\n" -" if self.server.logname is not None:\n" -" name = self.server.logname\n" -" else:\n" -" name = record.name\n" -" logger = logging.getLogger(name)\n" -" # N.B. EVERY record gets logged. This is because Logger.handle\n" -" # is normally called AFTER logger-level filtering. If you want\n" -" # to do filtering, do it at the client end to save wasting\n" -" # cycles and network bandwidth!\n" -" logger.handle(record)\n" -"\n" -"class LogRecordSocketReceiver(socketserver.ThreadingTCPServer):\n" -" \"\"\"\n" -" Simple TCP socket-based logging receiver suitable for testing.\n" -" \"\"\"\n" -"\n" -" allow_reuse_address = True\n" -"\n" -" def __init__(self, host='localhost',\n" -" port=logging.handlers.DEFAULT_TCP_LOGGING_PORT,\n" -" handler=LogRecordStreamHandler):\n" -" socketserver.ThreadingTCPServer.__init__(self, (host, port), " -"handler)\n" -" self.abort = 0\n" -" self.timeout = 1\n" -" self.logname = None\n" -"\n" -" def serve_until_stopped(self):\n" -" import select\n" -" abort = 0\n" -" while not abort:\n" -" rd, wr, ex = select.select([self.socket.fileno()],\n" -" [], [],\n" -" self.timeout)\n" -" if rd:\n" -" self.handle_request()\n" -" abort = self.abort\n" -"\n" -"def main():\n" -" logging.basicConfig(\n" -" format='%(relativeCreated)5d %(name)-15s %(levelname)-8s " -"%(message)s')\n" -" tcpserver = LogRecordSocketReceiver()\n" -" print('About to start TCP server...')\n" -" tcpserver.serve_until_stopped()\n" -"\n" -"if __name__ == '__main__':\n" -" main()" -msgstr "" - -#: ../../howto/logging-cookbook.rst:763 +#: ../../howto/logging-cookbook.rst:525 msgid "" "First run the server, and then the client. On the client side, nothing is " "printed on the console; on the server side, you should see something like:" @@ -1075,236 +357,25 @@ msgstr "" "コンソールには何も出力されません; サーバ側では以下のようなメッセージを目にす" "るはずです::" -#: ../../howto/logging-cookbook.rst:766 -msgid "" -"About to start TCP server...\n" -" 59 root INFO Jackdaws love my big sphinx of quartz.\n" -" 59 myapp.area1 DEBUG Quick zephyrs blow, vexing daft Jim.\n" -" 69 myapp.area1 INFO How quickly daft jumping zebras vex.\n" -" 69 myapp.area2 WARNING Jail zesty vixen who grabbed pay from quack.\n" -" 69 myapp.area2 ERROR The five boxing wizards jump quickly." -msgstr "" - -#: ../../howto/logging-cookbook.rst:775 +#: ../../howto/logging-cookbook.rst:537 msgid "" "Note that there are some security issues with pickle in some scenarios. If " "these affect you, you can use an alternative serialization scheme by " -"overriding the :meth:`~SocketHandler.makePickle` method and implementing " -"your alternative there, as well as adapting the above script to use your " -"alternative serialization." -msgstr "" -"注意: pickle にはいくつかのシナリオでセキュリティ上の問題があります。これら" -"が影響する場合は、 :meth:`~SocketHandler.makePickle` メソッドをオーバーライド" -"し代替シリアライズ手法を実装して、それを使うように上記のスクリプトを修正する" -"こともできます。" - -#: ../../howto/logging-cookbook.rst:783 -msgid "Running a logging socket listener in production" -msgstr "作成中のロギングソケットのリスナーを実行する" - -#: ../../howto/logging-cookbook.rst:787 -msgid "" -"To run a logging listener in production, you may need to use a process-" -"management tool such as `Supervisor `_. `Here is a " -"Gist `__ which provides the bare-bones files to run " -"the above functionality using Supervisor. It consists of the following files:" -msgstr "" -"作成中のロギングリスナーを実行するためには、 `Supervisor `_ のようなプロセス管理ツールを使う必要があるかもしれません。 `こちらの " -"Gist `__ は Supervisor を使って上記の機能を実行するた" -"めの必要最低限のファイルを提供しています。以下のファイルが必要になります:" - -#: ../../howto/logging-cookbook.rst:794 -msgid "File" -msgstr "ファイル" - -#: ../../howto/logging-cookbook.rst:794 -msgid "Purpose" -msgstr "目的" - -#: ../../howto/logging-cookbook.rst:796 -msgid ":file:`prepare.sh`" -msgstr ":file:`prepare.sh`" - -#: ../../howto/logging-cookbook.rst:796 -msgid "A Bash script to prepare the environment for testing" -msgstr "試験用の環境を準備する Bash スクリプト" - -#: ../../howto/logging-cookbook.rst:799 -msgid ":file:`supervisor.conf`" -msgstr ":file:`supervisor.conf`" - -#: ../../howto/logging-cookbook.rst:799 -msgid "" -"The Supervisor configuration file, which has entries for the listener and a " -"multi-process web application" -msgstr "" -"リスナーとマルチプロセスの web アプリケーションのための設定を含む Supervisor " -"の設定ファイル" - -#: ../../howto/logging-cookbook.rst:803 -msgid ":file:`ensure_app.sh`" -msgstr ":file:`ensure_app.sh`" - -#: ../../howto/logging-cookbook.rst:803 -msgid "" -"A Bash script to ensure that Supervisor is running with the above " -"configuration" -msgstr "" -"Supervisor が上記の設定で実行されていることを保証するための Bash スクリプト" - -#: ../../howto/logging-cookbook.rst:806 -msgid ":file:`log_listener.py`" -msgstr ":file:`log_listener.py`" - -#: ../../howto/logging-cookbook.rst:806 -msgid "" -"The socket listener program which receives log events and records them to a " -"file" -msgstr "ログイベントを受信してファイルに記録するソケットリスナープログラム" - -#: ../../howto/logging-cookbook.rst:809 -msgid ":file:`main.py`" -msgstr ":file:`main.py`" - -#: ../../howto/logging-cookbook.rst:809 -msgid "" -"A simple web application which performs logging via a socket connected to " -"the listener" -msgstr "" -"リスナーに接続されたソケットを通じてロギングを実行する簡単な web アプリケー" -"ション" - -#: ../../howto/logging-cookbook.rst:812 -msgid ":file:`webapp.json`" -msgstr ":file:`webapp.json`" - -#: ../../howto/logging-cookbook.rst:812 -msgid "A JSON configuration file for the web application" -msgstr "web アプリケーションのための JSON 設定ファイル" - -#: ../../howto/logging-cookbook.rst:814 -msgid ":file:`client.py`" -msgstr ":file:`client.py`" - -#: ../../howto/logging-cookbook.rst:814 -msgid "A Python script to exercise the web application" -msgstr "web アプリケーションを起動するための Python スクリプト" - -#: ../../howto/logging-cookbook.rst:817 -msgid "" -"The web application uses `Gunicorn `_, which is a " -"popular web application server that starts multiple worker processes to " -"handle requests. This example setup shows how the workers can write to the " -"same log file without conflicting with one another --- they all go through " -"the socket listener." -msgstr "" -"この web アプリケーションは、リクエストを処理する複数のワーカープロセスを起動" -"する web アプリケーションサーバーである `Gunicorn `_ " -"を使っています。ここに例として挙げた設定は、複数のワーカーがいかにして互いに" -"衝突することなく同じログファイルに書き込みを行うことができるかを示しています " -"--- ワーカーは全てソケットリスナーを通じてログを書き込むのです。" - -#: ../../howto/logging-cookbook.rst:822 -msgid "To test these files, do the following in a POSIX environment:" -msgstr "" -"これらのファイルを試すためには、 POSIX 環境において以下を行なってください:" - -#: ../../howto/logging-cookbook.rst:824 -msgid "" -"Download `the Gist `__ as a ZIP archive using the :" -"guilabel:`Download ZIP` button." +"overriding the :meth:`~handlers.SocketHandler.makePickle` method and " +"implementing your alternative there, as well as adapting the above script to " +"use your alternative serialization." msgstr "" -":guilabel:`Download ZIP` ボタンを押して `Gist `__ を " -"ZIP アーカイブとしてダウンロードしてください。" +"特定のシナリオでは pickle にはいくつかのセキュリティ上の問題があることに注意" +"してください。これが問題になる場合、 :meth:`~handlers.SocketHandler." +"makePickle` メソッドをオーバーライドして代替手段を実装することで異なるシリア" +"ライズ手法を使用できます。代替シリアライズ手法を使うように上記のスクリプトを" +"修正することもできます。" -#: ../../howto/logging-cookbook.rst:827 -msgid "Unzip the above files from the archive into a scratch directory." -msgstr "アーカイブファイルをスクラッチディレクトリに展開してください。" - -#: ../../howto/logging-cookbook.rst:829 -msgid "" -"In the scratch directory, run ``bash prepare.sh`` to get things ready. This " -"creates a :file:`run` subdirectory to contain Supervisor-related and log " -"files, and a :file:`venv` subdirectory to contain a virtual environment into " -"which ``bottle``, ``gunicorn`` and ``supervisor`` are installed." -msgstr "" -"準備のために、スクラッチディレクトリにおいて ``bash prepare.sh`` を実行してく" -"ださい。これにより Supervisor 関連のファイルおよびログファイルのための :file:" -"`run` サブディレクトリ、および ``bottle``, ``gunicorn`` そして " -"``supervisor`` がインストールされる仮想環境を含む :file:`venv` サブディレクト" -"リが生成されます。" - -#: ../../howto/logging-cookbook.rst:834 -msgid "" -"Run ``bash ensure_app.sh`` to ensure that Supervisor is running with the " -"above configuration." -msgstr "" -"``bash ensure_app.sh`` を実行して Supervisor が上記の設定で実行されていること" -"を確認してください。" - -#: ../../howto/logging-cookbook.rst:837 -msgid "" -"Run ``venv/bin/python client.py`` to exercise the web application, which " -"will lead to records being written to the log." -msgstr "" -"``venv/bin/python client.py`` を実行して web アプリケーションを起動してくださ" -"い。これによりログにレコードが書き込まれるはずです。" - -#: ../../howto/logging-cookbook.rst:840 -msgid "" -"Inspect the log files in the :file:`run` subdirectory. You should see the " -"most recent log lines in files matching the pattern :file:`app.log*`. They " -"won't be in any particular order, since they have been handled concurrently " -"by different worker processes in a non-deterministic way." -msgstr "" -":file:`run` サブディレクトリにあるログファイルを調べてください。最新のログ" -"は、パターン :file:`app.log*` に一致する名前のファイルにあるはずです。ログは" -"異なるワーカープロセスによって非決定論的な形で並行に処理されるため、特定の決" -"まった順番にはなりません。" - -#: ../../howto/logging-cookbook.rst:845 -msgid "" -"You can shut down the listener and the web application by running ``venv/bin/" -"supervisorctl -c supervisor.conf shutdown``." -msgstr "" -"リスナーと web アプリケーションは ``venv/bin/supervisorctl -c supervisor." -"conf shutdown`` を実行することでシャットダウンできます。" - -#: ../../howto/logging-cookbook.rst:848 -msgid "" -"You may need to tweak the configuration files in the unlikely event that the " -"configured ports clash with something else in your test environment." -msgstr "" -"ありそうもないことですが、テスト環境で設定したポートが別の設定と衝突してし" -"まった場合、設定ファイルを修正する必要があるかもしれません。" - -#: ../../howto/logging-cookbook.rst:851 -msgid "" -"The default configuration uses a TCP socket on port 9020. You can use a Unix " -"Domain socket instead of a TCP socket by doing the following:" -msgstr "" - -#: ../../howto/logging-cookbook.rst:854 -msgid "" -"In :file:`listener.json`, add a ``socket`` key with the path to the domain " -"socket you want to use. If this key is present, the listener listens on the " -"corresponding domain socket and not on a TCP socket (the ``port`` key is " -"ignored)." -msgstr "" - -#: ../../howto/logging-cookbook.rst:859 -msgid "" -"In :file:`webapp.json`, change the socket handler configuration dictionary " -"so that the ``host`` value is the path to the domain socket, and set the " -"``port`` value to ``null``." -msgstr "" - -#: ../../howto/logging-cookbook.rst:869 +#: ../../howto/logging-cookbook.rst:547 msgid "Adding contextual information to your logging output" msgstr "コンテキスト情報をログ記録出力に付加する" -#: ../../howto/logging-cookbook.rst:871 +#: ../../howto/logging-cookbook.rst:549 msgid "" "Sometimes you want logging output to contain contextual information in " "addition to the parameters passed to the logging call. For example, in a " @@ -1331,11 +402,11 @@ msgstr "" "でログ記録が行われるレベルの粒度に依存する場合、 :class:`Logger` インスタンス" "の個数が事実上無制限にならないと、管理が難しくなります。" -#: ../../howto/logging-cookbook.rst:886 +#: ../../howto/logging-cookbook.rst:564 msgid "Using LoggerAdapters to impart contextual information" msgstr "LoggerAdapter を使ったコンテキスト情報の伝達" -#: ../../howto/logging-cookbook.rst:888 +#: ../../howto/logging-cookbook.rst:566 msgid "" "An easy way in which you can pass contextual information to be output along " "with logging event information is to use the :class:`LoggerAdapter` class. " @@ -1353,7 +424,7 @@ msgstr "" "`Logger` のメソッドと同じ引数を取るので、二つの型を取り替えて使うことができま" "す。" -#: ../../howto/logging-cookbook.rst:896 +#: ../../howto/logging-cookbook.rst:574 msgid "" "When you create an instance of :class:`LoggerAdapter`, you pass it a :class:" "`Logger` instance and a dict-like object which contains your contextual " @@ -1370,18 +441,7 @@ msgstr "" "スト情報をその委譲された呼び出しに埋め込みます。 :class:`LoggerAdapter` の" "コードから少し抜き出してみます::" -#: ../../howto/logging-cookbook.rst:904 -msgid "" -"def debug(self, msg, /, *args, **kwargs):\n" -" \"\"\"\n" -" Delegate a debug call to the underlying logger, after adding\n" -" contextual information from this adapter instance.\n" -" \"\"\"\n" -" msg, kwargs = self.process(msg, kwargs)\n" -" self.logger.debug(msg, *args, **kwargs)" -msgstr "" - -#: ../../howto/logging-cookbook.rst:912 +#: ../../howto/logging-cookbook.rst:590 msgid "" "The :meth:`~LoggerAdapter.process` method of :class:`LoggerAdapter` is where " "the contextual information is added to the logging output. It's passed the " @@ -1401,7 +461,7 @@ msgstr "" "て \"extra\" キーが挿入されます。もちろん、呼び出し時に \"extra\" キーワード" "を使った場合には何事もなかったかのように上書きされます。" -#: ../../howto/logging-cookbook.rst:921 +#: ../../howto/logging-cookbook.rst:599 msgid "" "The advantage of using 'extra' is that the values in the dict-like object " "are merged into the :class:`LogRecord` instance's __dict__, allowing you to " @@ -1420,28 +480,11 @@ msgstr "" "要なだけです。次に挙げるのはこのクラスを使った例で、コンストラクタで使われる" "「辞書風」オブジェクトにどの振る舞いが必要なのかも示しています::" -#: ../../howto/logging-cookbook.rst:929 -msgid "" -"class CustomAdapter(logging.LoggerAdapter):\n" -" \"\"\"\n" -" This example adapter expects the passed in dict-like object to have a\n" -" 'connid' key, whose value in brackets is prepended to the log message.\n" -" \"\"\"\n" -" def process(self, msg, kwargs):\n" -" return '[%s] %s' % (self.extra['connid'], msg), kwargs" -msgstr "" - -#: ../../howto/logging-cookbook.rst:937 +#: ../../howto/logging-cookbook.rst:615 msgid "which you can use like this::" msgstr "これを次のように使うことができます::" -#: ../../howto/logging-cookbook.rst:939 -msgid "" -"logger = logging.getLogger(__name__)\n" -"adapter = CustomAdapter(logger, {'connid': some_conn_id})" -msgstr "" - -#: ../../howto/logging-cookbook.rst:942 +#: ../../howto/logging-cookbook.rst:620 msgid "" "Then any events that you log to the adapter will have the value of " "``some_conn_id`` prepended to the log messages." @@ -1449,11 +492,11 @@ msgstr "" "これで、この adapter 経由でログした全てのイベントに対して、``some_conn_id`` " "の値がログメッセージの前に追加されます。" -#: ../../howto/logging-cookbook.rst:946 +#: ../../howto/logging-cookbook.rst:624 msgid "Using objects other than dicts to pass contextual information" msgstr "コンテキスト情報を渡すために dict 以外のオブジェクトを使う" -#: ../../howto/logging-cookbook.rst:948 +#: ../../howto/logging-cookbook.rst:626 msgid "" "You don't need to pass an actual dict to a :class:`LoggerAdapter` - you " "could pass an instance of a class which implements ``__getitem__`` and " @@ -1466,11 +509,11 @@ msgstr "" "ラスのインスタンスを利用することができます。これは (dict の値が固定されるのに" "対して) 値を動的に生成できるので便利です。" -#: ../../howto/logging-cookbook.rst:957 +#: ../../howto/logging-cookbook.rst:635 msgid "Using Filters to impart contextual information" msgstr "Filter を使ったコンテキスト情報の伝達" -#: ../../howto/logging-cookbook.rst:959 +#: ../../howto/logging-cookbook.rst:637 msgid "" "You can also add contextual information to log output using a user-defined :" "class:`Filter`. ``Filter`` instances are allowed to modify the " @@ -1483,7 +526,7 @@ msgstr "" "ができます。これにより、適切なフォーマット文字列や必要なら :class:" "`Formatter` を使って、出力となる属性を新しく追加することも出来ます。" -#: ../../howto/logging-cookbook.rst:964 +#: ../../howto/logging-cookbook.rst:642 msgid "" "For example in a web application, the request being processed (or at least, " "the interesting parts of it) can be stored in a threadlocal (:class:" @@ -1502,419 +545,15 @@ msgstr "" "といったようにです。その場合、同じフォーマット文字列を使って以下に示すように" "似たような出力を得られます。これはスクリプトの例です::" -#: ../../howto/logging-cookbook.rst:973 -msgid "" -"import logging\n" -"from random import choice\n" -"\n" -"class ContextFilter(logging.Filter):\n" -" \"\"\"\n" -" This is a filter which injects contextual information into the log.\n" -"\n" -" Rather than use actual contextual information, we just use random\n" -" data in this demo.\n" -" \"\"\"\n" -"\n" -" USERS = ['jim', 'fred', 'sheila']\n" -" IPS = ['123.231.231.123', '127.0.0.1', '192.168.0.1']\n" -"\n" -" def filter(self, record):\n" -"\n" -" record.ip = choice(ContextFilter.IPS)\n" -" record.user = choice(ContextFilter.USERS)\n" -" return True\n" -"\n" -"if __name__ == '__main__':\n" -" levels = (logging.DEBUG, logging.INFO, logging.WARNING, logging.ERROR, " -"logging.CRITICAL)\n" -" logging.basicConfig(level=logging.DEBUG,\n" -" format='%(asctime)-15s %(name)-5s %(levelname)-8s " -"IP: %(ip)-15s User: %(user)-8s %(message)s')\n" -" a1 = logging.getLogger('a.b.c')\n" -" a2 = logging.getLogger('d.e.f')\n" -"\n" -" f = ContextFilter()\n" -" a1.addFilter(f)\n" -" a2.addFilter(f)\n" -" a1.debug('A debug message')\n" -" a1.info('An info message with %s', 'some parameters')\n" -" for x in range(10):\n" -" lvl = choice(levels)\n" -" lvlname = logging.getLevelName(lvl)\n" -" a2.log(lvl, 'A message at %s level with %d %s', lvlname, 2, " -"'parameters')" -msgstr "" - -#: ../../howto/logging-cookbook.rst:1010 +#: ../../howto/logging-cookbook.rst:688 msgid "which, when run, produces something like:" msgstr "実行すると、以下のようになります:" -#: ../../howto/logging-cookbook.rst:1012 -msgid "" -"2010-09-06 22:38:15,292 a.b.c DEBUG IP: 123.231.231.123 User: fred A " -"debug message\n" -"2010-09-06 22:38:15,300 a.b.c INFO IP: 192.168.0.1 User: sheila An " -"info message with some parameters\n" -"2010-09-06 22:38:15,300 d.e.f CRITICAL IP: 127.0.0.1 User: sheila A " -"message at CRITICAL level with 2 parameters\n" -"2010-09-06 22:38:15,300 d.e.f ERROR IP: 127.0.0.1 User: jim A " -"message at ERROR level with 2 parameters\n" -"2010-09-06 22:38:15,300 d.e.f DEBUG IP: 127.0.0.1 User: sheila A " -"message at DEBUG level with 2 parameters\n" -"2010-09-06 22:38:15,300 d.e.f ERROR IP: 123.231.231.123 User: fred A " -"message at ERROR level with 2 parameters\n" -"2010-09-06 22:38:15,300 d.e.f CRITICAL IP: 192.168.0.1 User: jim A " -"message at CRITICAL level with 2 parameters\n" -"2010-09-06 22:38:15,300 d.e.f CRITICAL IP: 127.0.0.1 User: sheila A " -"message at CRITICAL level with 2 parameters\n" -"2010-09-06 22:38:15,300 d.e.f DEBUG IP: 192.168.0.1 User: jim A " -"message at DEBUG level with 2 parameters\n" -"2010-09-06 22:38:15,301 d.e.f ERROR IP: 127.0.0.1 User: sheila A " -"message at ERROR level with 2 parameters\n" -"2010-09-06 22:38:15,301 d.e.f DEBUG IP: 123.231.231.123 User: fred A " -"message at DEBUG level with 2 parameters\n" -"2010-09-06 22:38:15,301 d.e.f INFO IP: 123.231.231.123 User: fred A " -"message at INFO level with 2 parameters" -msgstr "" - -#: ../../howto/logging-cookbook.rst:1028 -msgid "Use of ``contextvars``" -msgstr "``contextvars`` の利用" - -#: ../../howto/logging-cookbook.rst:1030 -msgid "" -"Since Python 3.7, the :mod:`contextvars` module has provided context-local " -"storage which works for both :mod:`threading` and :mod:`asyncio` processing " -"needs. This type of storage may thus be generally preferable to thread-" -"locals. The following example shows how, in a multi-threaded environment, " -"logs can populated with contextual information such as, for example, request " -"attributes handled by web applications." -msgstr "" -"Python 3.7 以降、 :mod:`contextvars` モジュールは :mod:`threading` と :mod:" -"`asyncio` の両方の処理上のニーズを満たすコンテキストローカルな変数を提供して" -"います。このタイプの変数はスレッドローカルな変数に適しています。以下の例は、" -"マルチスレッド環境において、 いかにして web アプリケーションによって処理され" -"るリクエスト属性のような処理の文脈上の情報とともにログを投入できるかを示しま" -"す。" - -#: ../../howto/logging-cookbook.rst:1036 -msgid "" -"For the purposes of illustration, say that you have different web " -"applications, each independent of the other but running in the same Python " -"process and using a library common to them. How can each of these " -"applications have their own log, where all logging messages from the library " -"(and other request processing code) are directed to the appropriate " -"application's log file, while including in the log additional contextual " -"information such as client IP, HTTP request method and client username?" -msgstr "" -"説明のため、同じ Python プロセス上で共通のライブラリを使っている独立した複数" -"の web アプリケーションがあるとします。これらのアプリケーションが、クライアン" -"トの IP アドレスや HTTP リクエストメソッド、およびクライアントのユーザー名の" -"ようなコンテキスト依存の情報を追加情報として含んだ自身のログを、共通のライブ" -"ラリ (と他のリクエスト処理のためのコード) から各アプリケーションのログファイ" -"ルへ適切に振り向けるためにはどのようにしたら良いでしょうか?" - -#: ../../howto/logging-cookbook.rst:1043 -msgid "Let's assume that the library can be simulated by the following code:" -msgstr "ここで、ライブラリは以下のコードで模することができるとします:" - -#: ../../howto/logging-cookbook.rst:1045 -msgid "" -"# webapplib.py\n" -"import logging\n" -"import time\n" -"\n" -"logger = logging.getLogger(__name__)\n" -"\n" -"def useful():\n" -" # Just a representative event logged from the library\n" -" logger.debug('Hello from webapplib!')\n" -" # Just sleep for a bit so other threads get to run\n" -" time.sleep(0.01)" -msgstr "" - -#: ../../howto/logging-cookbook.rst:1059 -msgid "" -"We can simulate the multiple web applications by means of two simple " -"classes, ``Request`` and ``WebApp``. These simulate how real threaded web " -"applications work - each request is handled by a thread:" -msgstr "" -"複数の web アプリケーションは2つの簡単なクラス, ``Request`` と ``WebApp``, に" -"よって模倣することができます。これらは実際のスレッド化された web アプリケー" -"ションがどのように動作するかを模擬的にあらわしています - すなわち各リクエスト" -"はスレッドで処理される状況です:" - -#: ../../howto/logging-cookbook.rst:1063 -msgid "" -"# main.py\n" -"import argparse\n" -"from contextvars import ContextVar\n" -"import logging\n" -"import os\n" -"from random import choice\n" -"import threading\n" -"import webapplib\n" -"\n" -"logger = logging.getLogger(__name__)\n" -"root = logging.getLogger()\n" -"root.setLevel(logging.DEBUG)\n" -"\n" -"class Request:\n" -" \"\"\"\n" -" A simple dummy request class which just holds dummy HTTP request " -"method,\n" -" client IP address and client username\n" -" \"\"\"\n" -" def __init__(self, method, ip, user):\n" -" self.method = method\n" -" self.ip = ip\n" -" self.user = user\n" -"\n" -"# A dummy set of requests which will be used in the simulation - we'll just " -"pick\n" -"# from this list randomly. Note that all GET requests are from 192.168.2." -"XXX\n" -"# addresses, whereas POST requests are from 192.16.3.XXX addresses. Three " -"users\n" -"# are represented in the sample requests.\n" -"\n" -"REQUESTS = [\n" -" Request('GET', '192.168.2.20', 'jim'),\n" -" Request('POST', '192.168.3.20', 'fred'),\n" -" Request('GET', '192.168.2.21', 'sheila'),\n" -" Request('POST', '192.168.3.21', 'jim'),\n" -" Request('GET', '192.168.2.22', 'fred'),\n" -" Request('POST', '192.168.3.22', 'sheila'),\n" -"]\n" -"\n" -"# Note that the format string includes references to request context " -"information\n" -"# such as HTTP method, client IP and username\n" -"\n" -"formatter = logging.Formatter('%(threadName)-11s %(appName)s %(name)-9s " -"%(user)-6s %(ip)s %(method)-4s %(message)s')\n" -"\n" -"# Create our context variables. These will be filled at the start of " -"request\n" -"# processing, and used in the logging that happens during that processing\n" -"\n" -"ctx_request = ContextVar('request')\n" -"ctx_appname = ContextVar('appname')\n" -"\n" -"class InjectingFilter(logging.Filter):\n" -" \"\"\"\n" -" A filter which injects context-specific information into logs and " -"ensures\n" -" that only information for a specific webapp is included in its log\n" -" \"\"\"\n" -" def __init__(self, app):\n" -" self.app = app\n" -"\n" -" def filter(self, record):\n" -" request = ctx_request.get()\n" -" record.method = request.method\n" -" record.ip = request.ip\n" -" record.user = request.user\n" -" record.appName = appName = ctx_appname.get()\n" -" return appName == self.app.name\n" -"\n" -"class WebApp:\n" -" \"\"\"\n" -" A dummy web application class which has its own handler and filter for " -"a\n" -" webapp-specific log.\n" -" \"\"\"\n" -" def __init__(self, name):\n" -" self.name = name\n" -" handler = logging.FileHandler(name + '.log', 'w')\n" -" f = InjectingFilter(self)\n" -" handler.setFormatter(formatter)\n" -" handler.addFilter(f)\n" -" root.addHandler(handler)\n" -" self.num_requests = 0\n" -"\n" -" def process_request(self, request):\n" -" \"\"\"\n" -" This is the dummy method for processing a request. It's called on a\n" -" different thread for every request. We store the context information " -"into\n" -" the context vars before doing anything else.\n" -" \"\"\"\n" -" ctx_request.set(request)\n" -" ctx_appname.set(self.name)\n" -" self.num_requests += 1\n" -" logger.debug('Request processing started')\n" -" webapplib.useful()\n" -" logger.debug('Request processing finished')\n" -"\n" -"def main():\n" -" fn = os.path.splitext(os.path.basename(__file__))[0]\n" -" adhf = argparse.ArgumentDefaultsHelpFormatter\n" -" ap = argparse.ArgumentParser(formatter_class=adhf, prog=fn,\n" -" description='Simulate a couple of web '\n" -" 'applications handling some '\n" -" 'requests, showing how request " -"'\n" -" 'context can be used to '\n" -" 'populate logs')\n" -" aa = ap.add_argument\n" -" aa('--count', '-c', type=int, default=100, help='How many requests to " -"simulate')\n" -" options = ap.parse_args()\n" -"\n" -" # Create the dummy webapps and put them in a list which we can use to " -"select\n" -" # from randomly\n" -" app1 = WebApp('app1')\n" -" app2 = WebApp('app2')\n" -" apps = [app1, app2]\n" -" threads = []\n" -" # Add a common handler which will capture all events\n" -" handler = logging.FileHandler('app.log', 'w')\n" -" handler.setFormatter(formatter)\n" -" root.addHandler(handler)\n" -"\n" -" # Generate calls to process requests\n" -" for i in range(options.count):\n" -" try:\n" -" # Pick an app at random and a request for it to process\n" -" app = choice(apps)\n" -" request = choice(REQUESTS)\n" -" # Process the request in its own thread\n" -" t = threading.Thread(target=app.process_request, " -"args=(request,))\n" -" threads.append(t)\n" -" t.start()\n" -" except KeyboardInterrupt:\n" -" break\n" -"\n" -" # Wait for the threads to terminate\n" -" for t in threads:\n" -" t.join()\n" -"\n" -" for app in apps:\n" -" print('%s processed %s requests' % (app.name, app.num_requests))\n" -"\n" -"if __name__ == '__main__':\n" -" main()" -msgstr "" - -#: ../../howto/logging-cookbook.rst:1203 -msgid "" -"If you run the above, you should find that roughly half the requests go " -"into :file:`app1.log` and the rest into :file:`app2.log`, and the all the " -"requests are logged to :file:`app.log`. Each webapp-specific log will " -"contain only log entries for only that webapp, and the request information " -"will be displayed consistently in the log (i.e. the information in each " -"dummy request will always appear together in a log line). This is " -"illustrated by the following shell output:" -msgstr "" -"上記のコードを実行すると、およそ半分のリクエストが :file:`app1.log` に、残り" -"半分が :file:`app2.log` にそれぞれ記録され、同時に全てのリクエストが :file:" -"`app.log` に記録されることがわかるでしょう。それぞれの web アプリケーション固" -"有のログはそれぞれのアプリケーションからのログエントリだけを含み、リクエスト" -"情報が矛盾なくログに表示されている (すなわち、各ダミーリクエストの情報は常に" -"ログの行とともに現れる) はずです。このことは以下のシェルコマンドの出力により" -"例示されています:" - -#: ../../howto/logging-cookbook.rst:1210 -msgid "" -"~/logging-contextual-webapp$ python main.py\n" -"app1 processed 51 requests\n" -"app2 processed 49 requests\n" -"~/logging-contextual-webapp$ wc -l *.log\n" -" 153 app1.log\n" -" 147 app2.log\n" -" 300 app.log\n" -" 600 total\n" -"~/logging-contextual-webapp$ head -3 app1.log\n" -"Thread-3 (process_request) app1 __main__ jim 192.168.3.21 POST Request " -"processing started\n" -"Thread-3 (process_request) app1 webapplib jim 192.168.3.21 POST Hello " -"from webapplib!\n" -"Thread-5 (process_request) app1 __main__ jim 192.168.3.21 POST Request " -"processing started\n" -"~/logging-contextual-webapp$ head -3 app2.log\n" -"Thread-1 (process_request) app2 __main__ sheila 192.168.2.21 GET Request " -"processing started\n" -"Thread-1 (process_request) app2 webapplib sheila 192.168.2.21 GET Hello " -"from webapplib!\n" -"Thread-2 (process_request) app2 __main__ jim 192.168.2.20 GET Request " -"processing started\n" -"~/logging-contextual-webapp$ head app.log\n" -"Thread-1 (process_request) app2 __main__ sheila 192.168.2.21 GET Request " -"processing started\n" -"Thread-1 (process_request) app2 webapplib sheila 192.168.2.21 GET Hello " -"from webapplib!\n" -"Thread-2 (process_request) app2 __main__ jim 192.168.2.20 GET Request " -"processing started\n" -"Thread-3 (process_request) app1 __main__ jim 192.168.3.21 POST Request " -"processing started\n" -"Thread-2 (process_request) app2 webapplib jim 192.168.2.20 GET Hello " -"from webapplib!\n" -"Thread-3 (process_request) app1 webapplib jim 192.168.3.21 POST Hello " -"from webapplib!\n" -"Thread-4 (process_request) app2 __main__ fred 192.168.2.22 GET Request " -"processing started\n" -"Thread-5 (process_request) app1 __main__ jim 192.168.3.21 POST Request " -"processing started\n" -"Thread-4 (process_request) app2 webapplib fred 192.168.2.22 GET Hello " -"from webapplib!\n" -"Thread-6 (process_request) app1 __main__ jim 192.168.3.21 POST Request " -"processing started\n" -"~/logging-contextual-webapp$ grep app1 app1.log | wc -l\n" -"153\n" -"~/logging-contextual-webapp$ grep app2 app2.log | wc -l\n" -"147\n" -"~/logging-contextual-webapp$ grep app1 app.log | wc -l\n" -"153\n" -"~/logging-contextual-webapp$ grep app2 app.log | wc -l\n" -"147" -msgstr "" - -#: ../../howto/logging-cookbook.rst:1250 -msgid "Imparting contextual information in handlers" -msgstr "ハンドラ内でのコンテキスト情報の付与" - -#: ../../howto/logging-cookbook.rst:1252 -msgid "" -"Each :class:`~Handler` has its own chain of filters. If you want to add " -"contextual information to a :class:`LogRecord` without leaking it to other " -"handlers, you can use a filter that returns a new :class:`~LogRecord` " -"instead of modifying it in-place, as shown in the following script::" -msgstr "" -":class:`~Handler` はそれぞれ一連のフィルタを独自に持っています。コンテキスト" -"情報を、他のハンドラに漏らすことなく :class:`LogRecord` に付加したい場合、以" -"下に示すスクリプトのように、直接レコードを編集する代わりに新しい :class:" -"`~LogRecord` を返すフィルタを使うことができます::" - -#: ../../howto/logging-cookbook.rst:1257 -msgid "" -"import copy\n" -"import logging\n" -"\n" -"def filter(record: logging.LogRecord):\n" -" record = copy.copy(record)\n" -" record.user = 'jim'\n" -" return record\n" -"\n" -"if __name__ == '__main__':\n" -" logger = logging.getLogger()\n" -" logger.setLevel(logging.INFO)\n" -" handler = logging.StreamHandler()\n" -" formatter = logging.Formatter('%(message)s from %(user)-8s')\n" -" handler.setFormatter(formatter)\n" -" handler.addFilter(filter)\n" -" logger.addHandler(handler)\n" -"\n" -" logger.info('A log message')" -msgstr "" - -#: ../../howto/logging-cookbook.rst:1279 +#: ../../howto/logging-cookbook.rst:709 msgid "Logging to a single file from multiple processes" msgstr "複数のプロセスからの単一ファイルへのログ記録" -#: ../../howto/logging-cookbook.rst:1281 +#: ../../howto/logging-cookbook.rst:711 msgid "" "Although logging is thread-safe, and logging to a single file from multiple " "threads in a single process *is* supported, logging to a single file from " @@ -1942,15 +581,25 @@ msgstr "" "作するソケット受信プログラムが含まれているので、アプリケーションに組み込むた" "めの出発点として使用できるでしょう。" -#: ../../howto/logging-cookbook.rst:1294 +#: ../../howto/logging-cookbook.rst:724 msgid "" "You could also write your own handler which uses the :class:" "`~multiprocessing.Lock` class from the :mod:`multiprocessing` module to " -"serialize access to the file from your processes. The stdlib :class:" -"`FileHandler` and subclasses do not make use of :mod:`multiprocessing`." -msgstr "" - -#: ../../howto/logging-cookbook.rst:1301 +"serialize access to the file from your processes. The existing :class:" +"`FileHandler` and subclasses do not make use of :mod:`multiprocessing` at " +"present, though they may do so in the future. Note that at present, the :mod:" +"`multiprocessing` module does not provide working lock functionality on all " +"platforms (see https://bugs.python.org/issue3770)." +msgstr "" +"複数のプロセスからファイルへのアクセスを直列化するために :mod:" +"`multiprocessing` モジュール の :class:`~multiprocessing.Lock` クラスを使って" +"独自のハンドラを書くことができます。既存の :class:`FileHandler` とそのサブク" +"ラスは現在のところ :mod:`multiprocessing` を利用していませんが、将来は利用す" +"るようになるかもしれません。現在のところ :mod:`multiprocessing` モジュールが" +"提供するロック機能はすべてのプラットホームで動作するわけではないことに注意し" +"てください (https://bugs.python.org/issue3770 参照)。" + +#: ../../howto/logging-cookbook.rst:734 msgid "" "Alternatively, you can use a ``Queue`` and a :class:`QueueHandler` to send " "all logging events to one of the processes in your multi-process " @@ -1973,230 +622,13 @@ msgstr "" "listener とアプリケーション内の他のプロセスで完全に異なる設定を使う例になって" "いるので、各自の要求に応じたコードを書く叩き台になるでしょう::" -#: ../../howto/logging-cookbook.rst:1312 -msgid "" -"# You'll need these imports in your own code\n" -"import logging\n" -"import logging.handlers\n" -"import multiprocessing\n" -"\n" -"# Next two import lines for this demo only\n" -"from random import choice, random\n" -"import time\n" -"\n" -"#\n" -"# Because you'll want to define the logging configurations for listener and " -"workers, the\n" -"# listener and worker process functions take a configurer parameter which is " -"a callable\n" -"# for configuring logging for that process. These functions are also passed " -"the queue,\n" -"# which they use for communication.\n" -"#\n" -"# In practice, you can configure the listener however you want, but note " -"that in this\n" -"# simple example, the listener does not apply level or filter logic to " -"received records.\n" -"# In practice, you would probably want to do this logic in the worker " -"processes, to avoid\n" -"# sending events which would be filtered out between processes.\n" -"#\n" -"# The size of the rotated files is made small so you can see the results " -"easily.\n" -"def listener_configurer():\n" -" root = logging.getLogger()\n" -" h = logging.handlers.RotatingFileHandler('mptest.log', 'a', 300, 10)\n" -" f = logging.Formatter('%(asctime)s %(processName)-10s %(name)s " -"%(levelname)-8s %(message)s')\n" -" h.setFormatter(f)\n" -" root.addHandler(h)\n" -"\n" -"# This is the listener process top-level loop: wait for logging events\n" -"# (LogRecords)on the queue and handle them, quit when you get a None for a\n" -"# LogRecord.\n" -"def listener_process(queue, configurer):\n" -" configurer()\n" -" while True:\n" -" try:\n" -" record = queue.get()\n" -" if record is None: # We send this as a sentinel to tell the " -"listener to quit.\n" -" break\n" -" logger = logging.getLogger(record.name)\n" -" logger.handle(record) # No level or filter logic applied - just " -"do it!\n" -" except Exception:\n" -" import sys, traceback\n" -" print('Whoops! Problem:', file=sys.stderr)\n" -" traceback.print_exc(file=sys.stderr)\n" -"\n" -"# Arrays used for random selections in this demo\n" -"\n" -"LEVELS = [logging.DEBUG, logging.INFO, logging.WARNING,\n" -" logging.ERROR, logging.CRITICAL]\n" -"\n" -"LOGGERS = ['a.b.c', 'd.e.f']\n" -"\n" -"MESSAGES = [\n" -" 'Random message #1',\n" -" 'Random message #2',\n" -" 'Random message #3',\n" -"]\n" -"\n" -"# The worker configuration is done at the start of the worker process run.\n" -"# Note that on Windows you can't rely on fork semantics, so each process\n" -"# will run the logging configuration code when it starts.\n" -"def worker_configurer(queue):\n" -" h = logging.handlers.QueueHandler(queue) # Just the one handler needed\n" -" root = logging.getLogger()\n" -" root.addHandler(h)\n" -" # send all messages, for demo; no other level or filter logic applied.\n" -" root.setLevel(logging.DEBUG)\n" -"\n" -"# This is the worker process top-level loop, which just logs ten events " -"with\n" -"# random intervening delays before terminating.\n" -"# The print messages are just so you know it's doing something!\n" -"def worker_process(queue, configurer):\n" -" configurer(queue)\n" -" name = multiprocessing.current_process().name\n" -" print('Worker started: %s' % name)\n" -" for i in range(10):\n" -" time.sleep(random())\n" -" logger = logging.getLogger(choice(LOGGERS))\n" -" level = choice(LEVELS)\n" -" message = choice(MESSAGES)\n" -" logger.log(level, message)\n" -" print('Worker finished: %s' % name)\n" -"\n" -"# Here's where the demo gets orchestrated. Create the queue, create and " -"start\n" -"# the listener, create ten workers and start them, wait for them to finish,\n" -"# then send a None to the queue to tell the listener to finish.\n" -"def main():\n" -" queue = multiprocessing.Queue(-1)\n" -" listener = multiprocessing.Process(target=listener_process,\n" -" args=(queue, listener_configurer))\n" -" listener.start()\n" -" workers = []\n" -" for i in range(10):\n" -" worker = multiprocessing.Process(target=worker_process,\n" -" args=(queue, worker_configurer))\n" -" workers.append(worker)\n" -" worker.start()\n" -" for w in workers:\n" -" w.join()\n" -" queue.put_nowait(None)\n" -" listener.join()\n" -"\n" -"if __name__ == '__main__':\n" -" main()" -msgstr "" - -#: ../../howto/logging-cookbook.rst:1417 +#: ../../howto/logging-cookbook.rst:850 msgid "" "A variant of the above script keeps the logging in the main process, in a " "separate thread::" msgstr "上のスクリプトの亜種で、logging をメインプロセスの別スレッドで行う例::" -#: ../../howto/logging-cookbook.rst:1420 -msgid "" -"import logging\n" -"import logging.config\n" -"import logging.handlers\n" -"from multiprocessing import Process, Queue\n" -"import random\n" -"import threading\n" -"import time\n" -"\n" -"def logger_thread(q):\n" -" while True:\n" -" record = q.get()\n" -" if record is None:\n" -" break\n" -" logger = logging.getLogger(record.name)\n" -" logger.handle(record)\n" -"\n" -"\n" -"def worker_process(q):\n" -" qh = logging.handlers.QueueHandler(q)\n" -" root = logging.getLogger()\n" -" root.setLevel(logging.DEBUG)\n" -" root.addHandler(qh)\n" -" levels = [logging.DEBUG, logging.INFO, logging.WARNING, logging.ERROR,\n" -" logging.CRITICAL]\n" -" loggers = ['foo', 'foo.bar', 'foo.bar.baz',\n" -" 'spam', 'spam.ham', 'spam.ham.eggs']\n" -" for i in range(100):\n" -" lvl = random.choice(levels)\n" -" logger = logging.getLogger(random.choice(loggers))\n" -" logger.log(lvl, 'Message no. %d', i)\n" -"\n" -"if __name__ == '__main__':\n" -" q = Queue()\n" -" d = {\n" -" 'version': 1,\n" -" 'formatters': {\n" -" 'detailed': {\n" -" 'class': 'logging.Formatter',\n" -" 'format': '%(asctime)s %(name)-15s %(levelname)-8s " -"%(processName)-10s %(message)s'\n" -" }\n" -" },\n" -" 'handlers': {\n" -" 'console': {\n" -" 'class': 'logging.StreamHandler',\n" -" 'level': 'INFO',\n" -" },\n" -" 'file': {\n" -" 'class': 'logging.FileHandler',\n" -" 'filename': 'mplog.log',\n" -" 'mode': 'w',\n" -" 'formatter': 'detailed',\n" -" },\n" -" 'foofile': {\n" -" 'class': 'logging.FileHandler',\n" -" 'filename': 'mplog-foo.log',\n" -" 'mode': 'w',\n" -" 'formatter': 'detailed',\n" -" },\n" -" 'errors': {\n" -" 'class': 'logging.FileHandler',\n" -" 'filename': 'mplog-errors.log',\n" -" 'mode': 'w',\n" -" 'level': 'ERROR',\n" -" 'formatter': 'detailed',\n" -" },\n" -" },\n" -" 'loggers': {\n" -" 'foo': {\n" -" 'handlers': ['foofile']\n" -" }\n" -" },\n" -" 'root': {\n" -" 'level': 'DEBUG',\n" -" 'handlers': ['console', 'file', 'errors']\n" -" },\n" -" }\n" -" workers = []\n" -" for i in range(5):\n" -" wp = Process(target=worker_process, name='worker %d' % (i + 1), " -"args=(q,))\n" -" workers.append(wp)\n" -" wp.start()\n" -" logging.config.dictConfig(d)\n" -" lp = threading.Thread(target=logger_thread, args=(q,))\n" -" lp.start()\n" -" # At this point, the main process could do some useful work of its own\n" -" # Once it's done that, it can wait for the workers to terminate...\n" -" for wp in workers:\n" -" wp.join()\n" -" # And now tell the logging thread to finish up, too\n" -" q.put(None)\n" -" lp.join()" -msgstr "" - -#: ../../howto/logging-cookbook.rst:1512 +#: ../../howto/logging-cookbook.rst:945 msgid "" "This variant shows how you can e.g. apply configuration for particular " "loggers - e.g. the ``foo`` logger has a special handler which stores all " @@ -2211,11 +643,11 @@ msgstr "" "(logging イベントは worker プロセス側で生成されますが) 各メッセージを適切な出" "力先に出力します。" -#: ../../howto/logging-cookbook.rst:1519 +#: ../../howto/logging-cookbook.rst:952 msgid "Using concurrent.futures.ProcessPoolExecutor" msgstr "concurrent.futures.ProcessPoolExecutorの利用" -#: ../../howto/logging-cookbook.rst:1521 +#: ../../howto/logging-cookbook.rst:954 msgid "" "If you want to use :class:`concurrent.futures.ProcessPoolExecutor` to start " "your worker processes, you need to create the queue slightly differently. " @@ -2225,122 +657,40 @@ msgstr "" "ProcessPoolExecutor` を使いたいのであれば、少し違う方法でキューを作る必要があ" "ります。次のような方法の代わりに" -#: ../../howto/logging-cookbook.rst:1525 -msgid "queue = multiprocessing.Queue(-1)" -msgstr "" - -#: ../../howto/logging-cookbook.rst:1529 +#: ../../howto/logging-cookbook.rst:962 msgid "you should use" msgstr "次のコードを利用する必要があります" -#: ../../howto/logging-cookbook.rst:1531 -msgid "" -"queue = multiprocessing.Manager().Queue(-1) # also works with the examples " -"above" -msgstr "" - -#: ../../howto/logging-cookbook.rst:1535 +#: ../../howto/logging-cookbook.rst:968 msgid "and you can then replace the worker creation from this::" msgstr "そして、次のようなワーカー作成コードがあったとすると::" -#: ../../howto/logging-cookbook.rst:1537 -msgid "" -"workers = []\n" -"for i in range(10):\n" -" worker = multiprocessing.Process(target=worker_process,\n" -" args=(queue, worker_configurer))\n" -" workers.append(worker)\n" -" worker.start()\n" -"for w in workers:\n" -" w.join()" -msgstr "" - -#: ../../howto/logging-cookbook.rst:1546 +#: ../../howto/logging-cookbook.rst:979 msgid "to this (remembering to first import :mod:`concurrent.futures`)::" msgstr "" "次のように変更します(最初に :mod:`concurrent.futures` をインポートするのを忘" "れないようにしましょう)::" -#: ../../howto/logging-cookbook.rst:1548 -msgid "" -"with concurrent.futures.ProcessPoolExecutor(max_workers=10) as executor:\n" -" for i in range(10):\n" -" executor.submit(worker_process, queue, worker_configurer)" -msgstr "" - -#: ../../howto/logging-cookbook.rst:1553 -msgid "Deploying Web applications using Gunicorn and uWSGI" -msgstr "Gunicorn と uWSGI を用いた Web アプリケーションのデプロイ" - -#: ../../howto/logging-cookbook.rst:1555 -msgid "" -"When deploying Web applications using `Gunicorn `_ or " -"`uWSGI `_ (or similar), " -"multiple worker processes are created to handle client requests. In such " -"environments, avoid creating file-based handlers directly in your web " -"application. Instead, use a :class:`SocketHandler` to log from the web " -"application to a listener in a separate process. This can be set up using a " -"process management tool such as Supervisor - see `Running a logging socket " -"listener in production`_ for more details." -msgstr "" -"`Gunicorn `_ や `uWSGI `_ (またはそれに類するもの) を使って Web アプリケー" -"ションをデプロイする場合、クライアントのリクエストを処理するために複数のワー" -"カープロセスが作られます。そのような環境では、 web アプリケーションに直接ファ" -"イルベースのハンドラを作ることは避けてください。 代わりに、 :class:" -"`SocketHandler` を使って別のプロセスとして動作するリスナーに web アプリケー" -"ションからログを送信するようにしてください。これは Supervisor のようなプロセ" -"ス管理ツールを使うことで設定できます - 詳しくは `作成中のロギングソケットの" -"リスナーを実行する`_ を参照してください。" - -#: ../../howto/logging-cookbook.rst:1565 +#: ../../howto/logging-cookbook.rst:987 msgid "Using file rotation" msgstr "ファイルをローテートする" -#: ../../howto/logging-cookbook.rst:1570 +#: ../../howto/logging-cookbook.rst:992 msgid "" "Sometimes you want to let a log file grow to a certain size, then open a new " "file and log to that. You may want to keep a certain number of these files, " "and when that many files have been created, rotate the files so that the " "number of files and the size of the files both remain bounded. For this " -"usage pattern, the logging package provides a :class:`RotatingFileHandler`::" +"usage pattern, the logging package provides a :class:`~handlers." +"RotatingFileHandler`::" msgstr "" "ログファイルがある大きさに達したら、新しいファイルを開いてそこにログを取りた" "いことがあります。そのファイルをある数だけ残し、その数のファイルが生成された" "らファイルを循環し、ファイルの数も大きさも制限したいこともあるでしょう。この" -"利用パターンのために、 logging パッケージは :class:`RotatingFileHandler` を提" -"供しています::" - -#: ../../howto/logging-cookbook.rst:1576 -msgid "" -"import glob\n" -"import logging\n" -"import logging.handlers\n" -"\n" -"LOG_FILENAME = 'logging_rotatingfile_example.out'\n" -"\n" -"# Set up a specific logger with our desired output level\n" -"my_logger = logging.getLogger('MyLogger')\n" -"my_logger.setLevel(logging.DEBUG)\n" -"\n" -"# Add the log message handler to the logger\n" -"handler = logging.handlers.RotatingFileHandler(\n" -" LOG_FILENAME, maxBytes=20, backupCount=5)\n" -"\n" -"my_logger.addHandler(handler)\n" -"\n" -"# Log some messages\n" -"for i in range(20):\n" -" my_logger.debug('i = %d' % i)\n" -"\n" -"# See what files are created\n" -"logfiles = glob.glob('%s*' % LOG_FILENAME)\n" -"\n" -"for filename in logfiles:\n" -" print(filename)" -msgstr "" - -#: ../../howto/logging-cookbook.rst:1602 +"利用パターンのために、logging パッケージは :class:`~handlers." +"RotatingFileHandler` を提供しています::" + +#: ../../howto/logging-cookbook.rst:1024 msgid "" "The result should be 6 separate files, each with part of the log history for " "the application:" @@ -2348,17 +698,7 @@ msgstr "" "この結果として、アプリケーションのログ履歴の一部である、6 つに別れたファイル" "が得られます:" -#: ../../howto/logging-cookbook.rst:1605 -msgid "" -"logging_rotatingfile_example.out\n" -"logging_rotatingfile_example.out.1\n" -"logging_rotatingfile_example.out.2\n" -"logging_rotatingfile_example.out.3\n" -"logging_rotatingfile_example.out.4\n" -"logging_rotatingfile_example.out.5" -msgstr "" - -#: ../../howto/logging-cookbook.rst:1614 +#: ../../howto/logging-cookbook.rst:1036 msgid "" "The most current file is always :file:`logging_rotatingfile_example.out`, " "and each time it reaches the size limit it is renamed with the suffix " @@ -2370,7 +710,7 @@ msgstr "" "アップファイルはその拡張子がインクリメントされ (``.1`` が ``.2`` になるな" "ど)、 ``.6`` ファイルは消去されます。" -#: ../../howto/logging-cookbook.rst:1619 +#: ../../howto/logging-cookbook.rst:1041 msgid "" "Obviously this example sets the log length much too small as an extreme " "example. You would want to set *maxBytes* to an appropriate value." @@ -2378,11 +718,11 @@ msgstr "" "明らかに、ここでは極端な例示のためにファイルの大きさをかなり小さな値に設定し" "ています。実際に使うときは *maxBytes* を適切な値に設定してください。" -#: ../../howto/logging-cookbook.rst:1627 +#: ../../howto/logging-cookbook.rst:1047 msgid "Use of alternative formatting styles" msgstr "別の format スタイルを利用する" -#: ../../howto/logging-cookbook.rst:1629 +#: ../../howto/logging-cookbook.rst:1049 msgid "" "When logging was added to the Python standard library, the only way of " "formatting messages with variable content was to use the %-formatting " @@ -2395,7 +735,7 @@ msgstr "" "は新しい文字列フォーマット機構として :class:`string.Template` (Python 2.4 で" "追加) と :meth:`str.format` (Python 2.6 で追加) が加わりました。" -#: ../../howto/logging-cookbook.rst:1635 +#: ../../howto/logging-cookbook.rst:1055 msgid "" "Logging (as of 3.2) provides improved support for these two additional " "formatting styles. The :class:`Formatter` class been enhanced to take an " @@ -2415,32 +755,7 @@ msgstr "" "で、 :meth:`str.format` か :class:`string.Template` を使った format を指定す" "る事ができます。次の例はこの機能を使ってみています:" -#: ../../howto/logging-cookbook.rst:1645 -msgid "" -">>> import logging\n" -">>> root = logging.getLogger()\n" -">>> root.setLevel(logging.DEBUG)\n" -">>> handler = logging.StreamHandler()\n" -">>> bf = logging.Formatter('{asctime} {name} {levelname:8s} {message}',\n" -"... style='{')\n" -">>> handler.setFormatter(bf)\n" -">>> root.addHandler(handler)\n" -">>> logger = logging.getLogger('foo.bar')\n" -">>> logger.debug('This is a DEBUG message')\n" -"2010-10-28 15:11:55,341 foo.bar DEBUG This is a DEBUG message\n" -">>> logger.critical('This is a CRITICAL message')\n" -"2010-10-28 15:12:11,526 foo.bar CRITICAL This is a CRITICAL message\n" -">>> df = logging.Formatter('$asctime $name ${levelname} $message',\n" -"... style='$')\n" -">>> handler.setFormatter(df)\n" -">>> logger.debug('This is a DEBUG message')\n" -"2010-10-28 15:13:06,924 foo.bar DEBUG This is a DEBUG message\n" -">>> logger.critical('This is a CRITICAL message')\n" -"2010-10-28 15:13:11,494 foo.bar CRITICAL This is a CRITICAL message\n" -">>>" -msgstr "" - -#: ../../howto/logging-cookbook.rst:1669 +#: ../../howto/logging-cookbook.rst:1089 msgid "" "Note that the formatting of logging messages for final output to logs is " "completely independent of how an individual logging message is constructed. " @@ -2450,14 +765,7 @@ msgstr "" "全に独立していることに注意してください。次の例でわかるように、メッセージを生" "成する部分では % を使い続けています::" -#: ../../howto/logging-cookbook.rst:1673 -msgid "" -">>> logger.error('This is an%s %s %s', 'other,', 'ERROR,', 'message')\n" -"2010-10-28 15:19:29,833 foo.bar ERROR This is another, ERROR, message\n" -">>>" -msgstr "" - -#: ../../howto/logging-cookbook.rst:1677 +#: ../../howto/logging-cookbook.rst:1097 msgid "" "Logging calls (``logger.debug()``, ``logger.info()`` etc.) only take " "positional parameters for the actual logging message itself, with keyword " @@ -2482,7 +790,7 @@ msgstr "" "ません。既存の logging 呼び出しは %-format を使っているので、後方互換性のため" "にこの部分を変更することはできません。" -#: ../../howto/logging-cookbook.rst:1690 +#: ../../howto/logging-cookbook.rst:1110 msgid "" "There is, however, a way that you can use {}- and $- formatting to construct " "your individual log messages. Recall that for a message you can use an " @@ -2495,28 +803,7 @@ msgstr "" "logging パッケージはそのオブジェクトに対して ``str()`` を使って実際の format " "文字列を生成します。次の2つのクラスを見てください::" -#: ../../howto/logging-cookbook.rst:1696 ../../howto/logging-cookbook.rst:2784 -msgid "" -"class BraceMessage:\n" -" def __init__(self, fmt, /, *args, **kwargs):\n" -" self.fmt = fmt\n" -" self.args = args\n" -" self.kwargs = kwargs\n" -"\n" -" def __str__(self):\n" -" return self.fmt.format(*self.args, **self.kwargs)\n" -"\n" -"class DollarMessage:\n" -" def __init__(self, fmt, /, **kwargs):\n" -" self.fmt = fmt\n" -" self.kwargs = kwargs\n" -"\n" -" def __str__(self):\n" -" from string import Template\n" -" return Template(self.fmt).substitute(**self.kwargs)" -msgstr "" - -#: ../../howto/logging-cookbook.rst:1714 +#: ../../howto/logging-cookbook.rst:1134 msgid "" "Either of these can be used in place of a format string, to allow {}- or $-" "formatting to be used to build the actual \"message\" part which appears in " @@ -2533,7 +820,7 @@ msgstr "" "間によくエイリアスとして使われるアンダースコア1つと混同しないように) などの使" "いやすいエイリアスを使うことができます。" -#: ../../howto/logging-cookbook.rst:1722 +#: ../../howto/logging-cookbook.rst:1142 msgid "" "The above classes are not included in Python, though they're easy enough to " "copy and paste into your own code. They can be used as follows (assuming " @@ -2543,26 +830,7 @@ msgstr "" "です。これらは次の例のようにして利用できます。(上のクラスが ``wherever`` とい" "うモジュールで定義されていると仮定します):" -#: ../../howto/logging-cookbook.rst:1726 -msgid "" -">>> from wherever import BraceMessage as __\n" -">>> print(__('Message with {0} {name}', 2, name='placeholders'))\n" -"Message with 2 placeholders\n" -">>> class Point: pass\n" -"...\n" -">>> p = Point()\n" -">>> p.x = 0.5\n" -">>> p.y = 0.5\n" -">>> print(__('Message with coordinates: ({point.x:.2f}, {point.y:.2f})',\n" -"... point=p))\n" -"Message with coordinates: (0.50, 0.50)\n" -">>> from wherever import DollarMessage as __\n" -">>> print(__('Message with $num $what', num=2, what='placeholders'))\n" -"Message with 2 placeholders\n" -">>>" -msgstr "" - -#: ../../howto/logging-cookbook.rst:1744 +#: ../../howto/logging-cookbook.rst:1164 msgid "" "While the above examples use ``print()`` to show how the formatting works, " "you would of course use ``logger.debug()`` or similar to actually log using " @@ -2571,7 +839,7 @@ msgstr "" "上の例ではフォーマットの動作を示すために ``print()`` を使っていますが、もちろ" "ん実際にこの方法でログを出力するには ``logger.debug()`` などを使います。" -#: ../../howto/logging-cookbook.rst:1748 +#: ../../howto/logging-cookbook.rst:1168 msgid "" "One thing to note is that you pay no significant performance penalty with " "this approach: the actual formatting happens not when you make the logging " @@ -2579,17 +847,17 @@ msgid "" "a log by a handler. So the only slightly unusual thing which might trip you " "up is that the parentheses go around the format string and the arguments, " "not just the format string. That's because the __ notation is just syntax " -"sugar for a constructor call to one of the :samp:`{XXX}Message` classes." +"sugar for a constructor call to one of the XXXMessage classes." msgstr "" "注意点として、この方法には大きなパフォーマンスのペナルティはありません。実際" "のフォーマット操作は logging の呼び出し時ではなくて、メッセージが実際に " "handler によって出力されるときに起こります。(出力されないならフォーマットもさ" -"れません) そのため、この方法で注意しないといけないのは、追加の括弧が書式文字" -"列だけではなく引数も囲わないといけないことだけです。これは __ が :samp:`{XXX}" -"Message` クラスのコンストラクタ呼び出しのシンタックスシュガーでしか無いからで" -"す。" +"れません) そのため、この方法で注意しないといけないのは、追加の括弧がフォー" +"マット文字列だけではなく引数も囲わないといけないことだけです。これは __ が " +"XXXMessage クラスのコンストラクタ呼び出しのシンタックスシュガーでしか無いから" +"です。" -#: ../../howto/logging-cookbook.rst:1756 +#: ../../howto/logging-cookbook.rst:1176 msgid "" "If you prefer, you can use a :class:`LoggerAdapter` to achieve a similar " "effect to the above, as in the following example::" @@ -2597,48 +865,19 @@ msgstr "" "次の例のように、 :class:`LoggerAdapter` を利用して上と似たような効果を実現す" "る方法もあります::" -#: ../../howto/logging-cookbook.rst:1759 -msgid "" -"import logging\n" -"\n" -"class Message:\n" -" def __init__(self, fmt, args):\n" -" self.fmt = fmt\n" -" self.args = args\n" -"\n" -" def __str__(self):\n" -" return self.fmt.format(*self.args)\n" -"\n" -"class StyleAdapter(logging.LoggerAdapter):\n" -" def log(self, level, msg, /, *args, stacklevel=1, **kwargs):\n" -" if self.isEnabledFor(level):\n" -" msg, kwargs = self.process(msg, kwargs)\n" -" self.logger.log(level, Message(msg, args), **kwargs,\n" -" stacklevel=stacklevel+1)\n" -"\n" -"logger = StyleAdapter(logging.getLogger(__name__))\n" -"\n" -"def main():\n" -" logger.debug('Hello, {}', 'world!')\n" -"\n" -"if __name__ == '__main__':\n" -" logging.basicConfig(level=logging.DEBUG)\n" -" main()" -msgstr "" - -#: ../../howto/logging-cookbook.rst:1785 +#: ../../howto/logging-cookbook.rst:1207 msgid "" "The above script should log the message ``Hello, world!`` when run with " -"Python 3.8 or later." +"Python 3.2 or later." msgstr "" -"上のスクリプトは Python 3.8 以降では ``Hello, world!`` というメッセージをログ" +"上のスクリプトは Python 3.2 以降では ``Hello, world!`` というメッセージをログ" "するはずです。" -#: ../../howto/logging-cookbook.rst:1794 +#: ../../howto/logging-cookbook.rst:1216 msgid "Customizing ``LogRecord``" msgstr "``LogRecord`` のカスタマイズ" -#: ../../howto/logging-cookbook.rst:1796 +#: ../../howto/logging-cookbook.rst:1218 msgid "" "Every logging event is represented by a :class:`LogRecord` instance. When an " "event is logged and not filtered out by a logger's level, a :class:" @@ -2654,7 +893,7 @@ msgstr "" "が無効になるまでの上位 logger) の handler に渡されます。 Python 3.2 までは、" "この生成が行われているのは2箇所だけでした:" -#: ../../howto/logging-cookbook.rst:1803 +#: ../../howto/logging-cookbook.rst:1225 msgid "" ":meth:`Logger.makeRecord`, which is called in the normal process of logging " "an event. This invoked :class:`LogRecord` directly to create an instance." @@ -2662,7 +901,7 @@ msgstr "" ":meth:`Logger.makeRecord`: 通常のイベント logging プロセスで呼ばれます。これ" "は :class:`LogRecord` を直接読んでインスタンスを生成します。" -#: ../../howto/logging-cookbook.rst:1806 +#: ../../howto/logging-cookbook.rst:1228 msgid "" ":func:`makeLogRecord`, which is called with a dictionary containing " "attributes to be added to the LogRecord. This is typically invoked when a " @@ -2675,7 +914,7 @@ msgstr "" "SocketHandler` 経由で、あるいは JSON 形式で :class:`~handlers.HTTPHandler` 経" "由で) 辞書を受け取った場合などに利用されます。" -#: ../../howto/logging-cookbook.rst:1812 +#: ../../howto/logging-cookbook.rst:1234 msgid "" "This has usually meant that if you need to do anything special with a :class:" "`LogRecord`, you've had to do one of the following." @@ -2683,7 +922,7 @@ msgstr "" "そのために :class:`LogRecord` で何か特別なことをしたい場合は、次のどちらかを" "しなければなりません。" -#: ../../howto/logging-cookbook.rst:1815 +#: ../../howto/logging-cookbook.rst:1237 msgid "" "Create your own :class:`Logger` subclass, which overrides :meth:`Logger." "makeRecord`, and set it using :func:`~logging.setLoggerClass` before any " @@ -2693,7 +932,7 @@ msgstr "" "ラスを作り、利用したい logger のどれかがインスタンス化される前に、それを :" "func:`~logging.setLoggerClass` を使って登録する。" -#: ../../howto/logging-cookbook.rst:1818 +#: ../../howto/logging-cookbook.rst:1240 msgid "" "Add a :class:`Filter` to a logger or handler, which does the necessary " "special manipulation you need when its :meth:`~Filter.filter` method is " @@ -2702,7 +941,7 @@ msgstr "" ":meth:`~Filter.filter` メソッドで必要な特殊な処理を行う :class:`Filter` を " "logger か handler に追加する。" -#: ../../howto/logging-cookbook.rst:1822 +#: ../../howto/logging-cookbook.rst:1244 msgid "" "The first approach would be a little unwieldy in the scenario where (say) " "several different libraries wanted to do different things. Each would " @@ -2713,7 +952,7 @@ msgstr "" "きません。各ライブラリが独自の :class:`Logger` のサブクラスを登録しようとし" "て、最後に登録されたライブラリが生き残ります。" -#: ../../howto/logging-cookbook.rst:1827 +#: ../../howto/logging-cookbook.rst:1249 msgid "" "The second approach works reasonably well for many cases, but does not allow " "you to e.g. use a specialized subclass of :class:`LogRecord`. Library " @@ -2727,11 +966,7 @@ msgstr "" "れずに設定しないといけなくなります。 (新しいパッケージやモジュールを追加し、" "モジュールレベルで次の式を実行することで、新しい logger が作られます) ::" -#: ../../howto/logging-cookbook.rst:1833 -msgid "logger = logging.getLogger(__name__)" -msgstr "" - -#: ../../howto/logging-cookbook.rst:1835 +#: ../../howto/logging-cookbook.rst:1257 msgid "" "at module level). It's probably one too many things to think about. " "Developers could also add the filter to a :class:`~logging.NullHandler` " @@ -2746,7 +981,7 @@ msgstr "" "ロガーにハンドラを取り付けた場合、フィルタは呼び出されません --- 従って、その" "ハンドラからの出力はライブラリ開発者の意図を反映したものにはなりません。" -#: ../../howto/logging-cookbook.rst:1841 +#: ../../howto/logging-cookbook.rst:1263 msgid "" "In Python 3.2 and later, :class:`~logging.LogRecord` creation is done " "through a factory, which you can specify. The factory is just a callable you " @@ -2762,7 +997,7 @@ msgstr "" "ラクタと同じシグネチャで呼び出され、 :class:`LogRecord` がデフォルトのファク" "トリとして設定されています。" -#: ../../howto/logging-cookbook.rst:1848 +#: ../../howto/logging-cookbook.rst:1270 msgid "" "This approach allows a custom factory to control all aspects of LogRecord " "creation. For example, you could return a subclass, or just add some " @@ -2773,27 +1008,7 @@ msgstr "" "るようにしています。たとえば、サブクラスを返したり、次のようなパターンを使っ" "て単に属性を追加することができます::" -#: ../../howto/logging-cookbook.rst:1852 -msgid "" -"old_factory = logging.getLogRecordFactory()\n" -"\n" -"def record_factory(*args, **kwargs):\n" -" record = old_factory(*args, **kwargs)\n" -" record.custom_attribute = 0xdecafbad\n" -" return record\n" -"\n" -"logging.setLogRecordFactory(record_factory)" -msgstr "" -"old_factory = logging.getLogRecordFactory()\n" -"\n" -"def record_factory(*args, **kwargs):\n" -" record = old_factory(*args, **kwargs)\n" -" record.custom_attribute = 0xdecafbad\n" -" return record\n" -"\n" -"logging.setLogRecordFactory(record_factory)" - -#: ../../howto/logging-cookbook.rst:1861 +#: ../../howto/logging-cookbook.rst:1283 msgid "" "This pattern allows different libraries to chain factories together, and as " "long as they don't overwrite each other's attributes or unintentionally " @@ -2808,15 +1023,11 @@ msgstr "" "しての実行時のオーバーヘッドになることを念頭に置き、このテクニックは :class:" "`Filter` を利用するだけでは望む結果が得られない場合にのみ使うべきです。" -#: ../../howto/logging-cookbook.rst:1873 -msgid "Subclassing QueueHandler and QueueListener- a ZeroMQ example" -msgstr "" - -#: ../../howto/logging-cookbook.rst:1876 ../../howto/logging-cookbook.rst:2009 -msgid "Subclass ``QueueHandler``" -msgstr "" +#: ../../howto/logging-cookbook.rst:1294 +msgid "Subclassing QueueHandler - a ZeroMQ example" +msgstr "QueueHandler を継承する - ZeroMQ を使う例" -#: ../../howto/logging-cookbook.rst:1878 +#: ../../howto/logging-cookbook.rst:1296 msgid "" "You can use a :class:`QueueHandler` subclass to send messages to other kinds " "of queues, for example a ZeroMQ 'publish' socket. In the example below,the " @@ -2826,24 +1037,7 @@ msgstr "" "ZeroMQ の 'publish' ソケットに送信することができます。下の例では、ソケットを" "別に作ってそれを handler に ('queue' として) 渡します::" -#: ../../howto/logging-cookbook.rst:1882 -msgid "" -"import zmq # using pyzmq, the Python binding for ZeroMQ\n" -"import json # for serializing records portably\n" -"\n" -"ctx = zmq.Context()\n" -"sock = zmq.Socket(ctx, zmq.PUB) # or zmq.PUSH, or other suitable value\n" -"sock.bind('tcp://*:5556') # or wherever\n" -"\n" -"class ZeroMQSocketHandler(QueueHandler):\n" -" def enqueue(self, record):\n" -" self.queue.send_json(record.__dict__)\n" -"\n" -"\n" -"handler = ZeroMQSocketHandler(sock)" -msgstr "" - -#: ../../howto/logging-cookbook.rst:1897 +#: ../../howto/logging-cookbook.rst:1315 msgid "" "Of course there are other ways of organizing this, for example passing in " "the data needed by the handler to create the socket::" @@ -2851,27 +1045,11 @@ msgstr "" "もちろん同じことを別の設計でもできます。socket を作るのに必要な情報を " "handler に渡す例です::" -#: ../../howto/logging-cookbook.rst:1900 -msgid "" -"class ZeroMQSocketHandler(QueueHandler):\n" -" def __init__(self, uri, socktype=zmq.PUB, ctx=None):\n" -" self.ctx = ctx or zmq.Context()\n" -" socket = zmq.Socket(self.ctx, socktype)\n" -" socket.bind(uri)\n" -" super().__init__(socket)\n" -"\n" -" def enqueue(self, record):\n" -" self.queue.send_json(record.__dict__)\n" -"\n" -" def close(self):\n" -" self.queue.close()" -msgstr "" +#: ../../howto/logging-cookbook.rst:1333 +msgid "Subclassing QueueListener - a ZeroMQ example" +msgstr "QueueListener のサブクラスを作る - ZeroMQ を使う例" -#: ../../howto/logging-cookbook.rst:1915 ../../howto/logging-cookbook.rst:1945 -msgid "Subclass ``QueueListener``" -msgstr "" - -#: ../../howto/logging-cookbook.rst:1917 +#: ../../howto/logging-cookbook.rst:1335 msgid "" "You can also subclass :class:`QueueListener` to get messages from other " "kinds of queues, for example a ZeroMQ 'subscribe' socket. Here's an example::" @@ -2879,223 +1057,43 @@ msgstr "" ":class:`QueueListener` のサブクラスを作って、メッセージを他のキュー、例えば " "ZeroMQ の 'subscribe' ソケットから取得する事もできます。サンプルです::" -#: ../../howto/logging-cookbook.rst:1920 -msgid "" -"class ZeroMQSocketListener(QueueListener):\n" -" def __init__(self, uri, /, *handlers, **kwargs):\n" -" self.ctx = kwargs.get('ctx') or zmq.Context()\n" -" socket = zmq.Socket(self.ctx, zmq.SUB)\n" -" socket.setsockopt_string(zmq.SUBSCRIBE, '') # subscribe to " -"everything\n" -" socket.connect(uri)\n" -" super().__init__(socket, *handlers, **kwargs)\n" -"\n" -" def dequeue(self):\n" -" msg = self.queue.recv_json()\n" -" return logging.makeLogRecord(msg)" -msgstr "" - -#: ../../howto/logging-cookbook.rst:1935 -msgid "Subclassing QueueHandler and QueueListener- a ``pynng`` example" -msgstr "" - -#: ../../howto/logging-cookbook.rst:1937 -msgid "" -"In a similar way to the above section, we can implement a listener and " -"handler using :pypi:`pynng`, which is a Python binding to `NNG `_, billed as a spiritual successor to ZeroMQ. The following " -"snippets illustrate -- you can test them in an environment which has " -"``pynng`` installed. Just for variety, we present the listener first." -msgstr "" - -#: ../../howto/logging-cookbook.rst:1947 -msgid "" -"# listener.py\n" -"import json\n" -"import logging\n" -"import logging.handlers\n" -"\n" -"import pynng\n" -"\n" -"DEFAULT_ADDR = \"tcp://localhost:13232\"\n" -"\n" -"interrupted = False\n" -"\n" -"class NNGSocketListener(logging.handlers.QueueListener):\n" -"\n" -" def __init__(self, uri, /, *handlers, **kwargs):\n" -" # Have a timeout for interruptability, and open a\n" -" # subscriber socket\n" -" socket = pynng.Sub0(listen=uri, recv_timeout=500)\n" -" # The b'' subscription matches all topics\n" -" topics = kwargs.pop('topics', None) or b''\n" -" socket.subscribe(topics)\n" -" # We treat the socket as a queue\n" -" super().__init__(socket, *handlers, **kwargs)\n" -"\n" -" def dequeue(self, block):\n" -" data = None\n" -" # Keep looping while not interrupted and no data received over the\n" -" # socket\n" -" while not interrupted:\n" -" try:\n" -" data = self.queue.recv(block=block)\n" -" break\n" -" except pynng.Timeout:\n" -" pass\n" -" except pynng.Closed: # sometimes happens when you hit Ctrl-C\n" -" break\n" -" if data is None:\n" -" return None\n" -" # Get the logging event sent from a publisher\n" -" event = json.loads(data.decode('utf-8'))\n" -" return logging.makeLogRecord(event)\n" -"\n" -" def enqueue_sentinel(self):\n" -" # Not used in this implementation, as the socket isn't really a\n" -" # queue\n" -" pass\n" -"\n" -"logging.getLogger('pynng').propagate = False\n" -"listener = NNGSocketListener(DEFAULT_ADDR, logging.StreamHandler(), " -"topics=b'')\n" -"listener.start()\n" -"print('Press Ctrl-C to stop.')\n" -"try:\n" -" while True:\n" -" pass\n" -"except KeyboardInterrupt:\n" -" interrupted = True\n" -"finally:\n" -" listener.stop()" -msgstr "" - -#: ../../howto/logging-cookbook.rst:2013 -msgid "" -"# sender.py\n" -"import json\n" -"import logging\n" -"import logging.handlers\n" -"import time\n" -"import random\n" -"\n" -"import pynng\n" -"\n" -"DEFAULT_ADDR = \"tcp://localhost:13232\"\n" -"\n" -"class NNGSocketHandler(logging.handlers.QueueHandler):\n" -"\n" -" def __init__(self, uri):\n" -" socket = pynng.Pub0(dial=uri, send_timeout=500)\n" -" super().__init__(socket)\n" -"\n" -" def enqueue(self, record):\n" -" # Send the record as UTF-8 encoded JSON\n" -" d = dict(record.__dict__)\n" -" data = json.dumps(d)\n" -" self.queue.send(data.encode('utf-8'))\n" -"\n" -" def close(self):\n" -" self.queue.close()\n" -"\n" -"logging.getLogger('pynng').propagate = False\n" -"handler = NNGSocketHandler(DEFAULT_ADDR)\n" -"# Make sure the process ID is in the output\n" -"logging.basicConfig(level=logging.DEBUG,\n" -" handlers=[logging.StreamHandler(), handler],\n" -" format='%(levelname)-8s %(name)10s %(process)6s " -"%(message)s')\n" -"levels = (logging.DEBUG, logging.INFO, logging.WARNING, logging.ERROR,\n" -" logging.CRITICAL)\n" -"logger_names = ('myapp', 'myapp.lib1', 'myapp.lib2')\n" -"msgno = 1\n" -"while True:\n" -" # Just randomly select some loggers and levels and log away\n" -" level = random.choice(levels)\n" -" logger = logging.getLogger(random.choice(logger_names))\n" -" logger.log(level, 'Message no. %5d' % msgno)\n" -" msgno += 1\n" -" delay = random.random() * 2 + 0.5\n" -" time.sleep(delay)" -msgstr "" +#: ../../howto/logging-cookbook.rst:1354 +msgid "Module :mod:`logging`" +msgstr ":mod:`logging` モジュール" -#: ../../howto/logging-cookbook.rst:2060 -msgid "" -"You can run the above two snippets in separate command shells. If we run the " -"listener in one shell and run the sender in two separate shells, we should " -"see something like the following. In the first sender shell:" -msgstr "" +#: ../../howto/logging-cookbook.rst:1354 +msgid "API reference for the logging module." +msgstr "logging モジュールの API リファレンス。" -#: ../../howto/logging-cookbook.rst:2064 -msgid "" -"$ python sender.py\n" -"DEBUG myapp 613 Message no. 1\n" -"WARNING myapp.lib2 613 Message no. 2\n" -"CRITICAL myapp.lib2 613 Message no. 3\n" -"WARNING myapp.lib2 613 Message no. 4\n" -"CRITICAL myapp.lib1 613 Message no. 5\n" -"DEBUG myapp 613 Message no. 6\n" -"CRITICAL myapp.lib1 613 Message no. 7\n" -"INFO myapp.lib1 613 Message no. 8\n" -"(and so on)" -msgstr "" +#: ../../howto/logging-cookbook.rst:1357 +msgid "Module :mod:`logging.config`" +msgstr ":mod:`logging.config` モジュール" -#: ../../howto/logging-cookbook.rst:2077 -msgid "In the second sender shell:" -msgstr "" +#: ../../howto/logging-cookbook.rst:1357 +msgid "Configuration API for the logging module." +msgstr "logging モジュールの環境設定 API です。" -#: ../../howto/logging-cookbook.rst:2079 -msgid "" -"$ python sender.py\n" -"INFO myapp.lib2 657 Message no. 1\n" -"CRITICAL myapp.lib2 657 Message no. 2\n" -"CRITICAL myapp 657 Message no. 3\n" -"CRITICAL myapp.lib1 657 Message no. 4\n" -"INFO myapp.lib1 657 Message no. 5\n" -"WARNING myapp.lib2 657 Message no. 6\n" -"CRITICAL myapp 657 Message no. 7\n" -"DEBUG myapp.lib1 657 Message no. 8\n" -"(and so on)" -msgstr "" +#: ../../howto/logging-cookbook.rst:1360 +msgid "Module :mod:`logging.handlers`" +msgstr ":mod:`logging.handlers` モジュール" -#: ../../howto/logging-cookbook.rst:2092 -msgid "In the listener shell:" -msgstr "" +#: ../../howto/logging-cookbook.rst:1360 +msgid "Useful handlers included with the logging module." +msgstr "logging モジュールに含まれる、便利なハンドラです。" -#: ../../howto/logging-cookbook.rst:2094 -msgid "" -"$ python listener.py\n" -"Press Ctrl-C to stop.\n" -"DEBUG myapp 613 Message no. 1\n" -"WARNING myapp.lib2 613 Message no. 2\n" -"INFO myapp.lib2 657 Message no. 1\n" -"CRITICAL myapp.lib2 613 Message no. 3\n" -"CRITICAL myapp.lib2 657 Message no. 2\n" -"CRITICAL myapp 657 Message no. 3\n" -"WARNING myapp.lib2 613 Message no. 4\n" -"CRITICAL myapp.lib1 613 Message no. 5\n" -"CRITICAL myapp.lib1 657 Message no. 4\n" -"INFO myapp.lib1 657 Message no. 5\n" -"DEBUG myapp 613 Message no. 6\n" -"WARNING myapp.lib2 657 Message no. 6\n" -"CRITICAL myapp 657 Message no. 7\n" -"CRITICAL myapp.lib1 613 Message no. 7\n" -"INFO myapp.lib1 613 Message no. 8\n" -"DEBUG myapp.lib1 657 Message no. 8\n" -"(and so on)" -msgstr "" +#: ../../howto/logging-cookbook.rst:1362 +msgid ":ref:`A basic logging tutorial `" +msgstr ":ref:`logging 基本チュートリアル `" -#: ../../howto/logging-cookbook.rst:2116 -msgid "" -"As you can see, the logging from the two sender processes is interleaved in " -"the listener's output." -msgstr "" +#: ../../howto/logging-cookbook.rst:1364 +msgid ":ref:`A more advanced logging tutorial `" +msgstr ":ref:`logging 上級チュートリアル `" -#: ../../howto/logging-cookbook.rst:2121 +#: ../../howto/logging-cookbook.rst:1368 msgid "An example dictionary-based configuration" msgstr "辞書ベースで構成する例" -#: ../../howto/logging-cookbook.rst:2123 +#: ../../howto/logging-cookbook.rst:1370 msgid "" "Below is an example of a logging configuration dictionary - it's taken from " "the `documentation on the Django project `_ から持ってきました。この辞書を :func:`~config." "dictConfig` に渡して設定を有効にします::" -#: ../../howto/logging-cookbook.rst:2127 -msgid "" -"LOGGING = {\n" -" 'version': 1,\n" -" 'disable_existing_loggers': False,\n" -" 'formatters': {\n" -" 'verbose': {\n" -" 'format': '{levelname} {asctime} {module} {process:d} {thread:d} " -"{message}',\n" -" 'style': '{',\n" -" },\n" -" 'simple': {\n" -" 'format': '{levelname} {message}',\n" -" 'style': '{',\n" -" },\n" -" },\n" -" 'filters': {\n" -" 'special': {\n" -" '()': 'project.logging.SpecialFilter',\n" -" 'foo': 'bar',\n" -" },\n" -" },\n" -" 'handlers': {\n" -" 'console': {\n" -" 'level': 'INFO',\n" -" 'class': 'logging.StreamHandler',\n" -" 'formatter': 'simple',\n" -" },\n" -" 'mail_admins': {\n" -" 'level': 'ERROR',\n" -" 'class': 'django.utils.log.AdminEmailHandler',\n" -" 'filters': ['special']\n" -" }\n" -" },\n" -" 'loggers': {\n" -" 'django': {\n" -" 'handlers': ['console'],\n" -" 'propagate': True,\n" -" },\n" -" 'django.request': {\n" -" 'handlers': ['mail_admins'],\n" -" 'level': 'ERROR',\n" -" 'propagate': False,\n" -" },\n" -" 'myproject.custom': {\n" -" 'handlers': ['console', 'mail_admins'],\n" -" 'level': 'INFO',\n" -" 'filters': ['special']\n" -" }\n" -" }\n" -"}" -msgstr "" - -#: ../../howto/logging-cookbook.rst:2176 +#: ../../howto/logging-cookbook.rst:1426 msgid "" "For more information about this configuration, you can see the `relevant " "section `_ で見ることができます。" -#: ../../howto/logging-cookbook.rst:2183 +#: ../../howto/logging-cookbook.rst:1433 msgid "Using a rotator and namer to customize log rotation processing" msgstr "rotator と namer を使ってログローテートをカスタマイズする" -#: ../../howto/logging-cookbook.rst:2185 +#: ../../howto/logging-cookbook.rst:1435 msgid "" "An example of how you can define a namer and rotator is given in the " -"following runnable script, which shows gzip compression of the log file::" -msgstr "" -"namer と rotator を定義する方法の例は以下の実行可能なスクリプトに示されていま" -"す。ここではログファイルを gzip により圧縮する例を示しています::" - -#: ../../howto/logging-cookbook.rst:2188 -msgid "" -"import gzip\n" -"import logging\n" -"import logging.handlers\n" -"import os\n" -"import shutil\n" -"\n" -"def namer(name):\n" -" return name + \".gz\"\n" -"\n" -"def rotator(source, dest):\n" -" with open(source, 'rb') as f_in:\n" -" with gzip.open(dest, 'wb') as f_out:\n" -" shutil.copyfileobj(f_in, f_out)\n" -" os.remove(source)\n" -"\n" -"\n" -"rh = logging.handlers.RotatingFileHandler('rotated.log', maxBytes=128, " -"backupCount=5)\n" -"rh.rotator = rotator\n" -"rh.namer = namer\n" -"\n" -"root = logging.getLogger()\n" -"root.setLevel(logging.INFO)\n" -"root.addHandler(rh)\n" -"f = logging.Formatter('%(asctime)s %(message)s')\n" -"rh.setFormatter(f)\n" -"for i in range(1000):\n" -" root.info(f'Message no. {i + 1}')" -msgstr "" - -#: ../../howto/logging-cookbook.rst:2216 -msgid "" -"After running this, you will see six new files, five of which are compressed:" -msgstr "" -"このスクリプトを実行すると、6つの新しいファイルが生成され、そのうち5つは圧縮" -"されています:" - -#: ../../howto/logging-cookbook.rst:2218 -msgid "" -"$ ls rotated.log*\n" -"rotated.log rotated.log.2.gz rotated.log.4.gz\n" -"rotated.log.1.gz rotated.log.3.gz rotated.log.5.gz\n" -"$ zcat rotated.log.1.gz\n" -"2023-01-20 02:28:17,767 Message no. 996\n" -"2023-01-20 02:28:17,767 Message no. 997\n" -"2023-01-20 02:28:17,767 Message no. 998" -msgstr "" - -#: ../../howto/logging-cookbook.rst:2229 +"following snippet, which shows zlib-based compression of the log file::" +msgstr "" +"次の、ログファイルを zlib ベースの圧縮をするスニペットでは、namer と rotater " +"を定義する方法の例を提供してます::" + +#: ../../howto/logging-cookbook.rst:1453 +msgid "" +"These are not \"true\" .gz files, as they are bare compressed data, with no " +"\"container\" such as you’d find in an actual gzip file. This snippet is " +"just for illustration purposes." +msgstr "" +"これは本当の .gz ファイルではなく、実際の gzip ファイルが持っている \"コンテ" +"ナ\" がない生の圧縮データです。このスニペットはただの解説用です。" + +#: ../../howto/logging-cookbook.rst:1458 msgid "A more elaborate multiprocessing example" msgstr "より手の込んだ multiprocessing の例" -#: ../../howto/logging-cookbook.rst:2231 +#: ../../howto/logging-cookbook.rst:1460 msgid "" "The following working example shows how logging can be used with " "multiprocessing using configuration files. The configurations are fairly " @@ -3247,7 +1151,7 @@ msgstr "" "する方法を示しています。設定内容はかなりシンプルですが、より複雑な構成を実際" "の multiprocessing を利用するシナリオで実装する方法を示しています。" -#: ../../howto/logging-cookbook.rst:2236 +#: ../../howto/logging-cookbook.rst:1465 msgid "" "In the example, the main process spawns a listener process and some worker " "processes. Each of the main process, the listener and the workers have three " @@ -3267,240 +1171,17 @@ msgstr "" "た handler に分配する部分を見ることができます。この設定は説明用のものですが、" "この例を自分のシナリオに適応させることができるでしょう。" -#: ../../howto/logging-cookbook.rst:2246 +#: ../../howto/logging-cookbook.rst:1475 msgid "" "Here's the script - the docstrings and the comments hopefully explain how it " "works::" msgstr "これがそのスクリプトです。docstring とコメントで動作を説明しています::" -#: ../../howto/logging-cookbook.rst:2249 -msgid "" -"import logging\n" -"import logging.config\n" -"import logging.handlers\n" -"from multiprocessing import Process, Queue, Event, current_process\n" -"import os\n" -"import random\n" -"import time\n" -"\n" -"class MyHandler:\n" -" \"\"\"\n" -" A simple handler for logging events. It runs in the listener process " -"and\n" -" dispatches events to loggers based on the name in the received record,\n" -" which then get dispatched, by the logging system, to the handlers\n" -" configured for those loggers.\n" -" \"\"\"\n" -"\n" -" def handle(self, record):\n" -" if record.name == \"root\":\n" -" logger = logging.getLogger()\n" -" else:\n" -" logger = logging.getLogger(record.name)\n" -"\n" -" if logger.isEnabledFor(record.levelno):\n" -" # The process name is transformed just to show that it's the " -"listener\n" -" # doing the logging to files and console\n" -" record.processName = '%s (for %s)' % (current_process().name, " -"record.processName)\n" -" logger.handle(record)\n" -"\n" -"def listener_process(q, stop_event, config):\n" -" \"\"\"\n" -" This could be done in the main process, but is just done in a separate\n" -" process for illustrative purposes.\n" -"\n" -" This initialises logging according to the specified configuration,\n" -" starts the listener and waits for the main process to signal completion\n" -" via the event. The listener is then stopped, and the process exits.\n" -" \"\"\"\n" -" logging.config.dictConfig(config)\n" -" listener = logging.handlers.QueueListener(q, MyHandler())\n" -" listener.start()\n" -" if os.name == 'posix':\n" -" # On POSIX, the setup logger will have been configured in the\n" -" # parent process, but should have been disabled following the\n" -" # dictConfig call.\n" -" # On Windows, since fork isn't used, the setup logger won't\n" -" # exist in the child, so it would be created and the message\n" -" # would appear - hence the \"if posix\" clause.\n" -" logger = logging.getLogger('setup')\n" -" logger.critical('Should not appear, because of disabled " -"logger ...')\n" -" stop_event.wait()\n" -" listener.stop()\n" -"\n" -"def worker_process(config):\n" -" \"\"\"\n" -" A number of these are spawned for the purpose of illustration. In\n" -" practice, they could be a heterogeneous bunch of processes rather than\n" -" ones which are identical to each other.\n" -"\n" -" This initialises logging according to the specified configuration,\n" -" and logs a hundred messages with random levels to randomly selected\n" -" loggers.\n" -"\n" -" A small sleep is added to allow other processes a chance to run. This\n" -" is not strictly needed, but it mixes the output from the different\n" -" processes a bit more than if it's left out.\n" -" \"\"\"\n" -" logging.config.dictConfig(config)\n" -" levels = [logging.DEBUG, logging.INFO, logging.WARNING, logging.ERROR,\n" -" logging.CRITICAL]\n" -" loggers = ['foo', 'foo.bar', 'foo.bar.baz',\n" -" 'spam', 'spam.ham', 'spam.ham.eggs']\n" -" if os.name == 'posix':\n" -" # On POSIX, the setup logger will have been configured in the\n" -" # parent process, but should have been disabled following the\n" -" # dictConfig call.\n" -" # On Windows, since fork isn't used, the setup logger won't\n" -" # exist in the child, so it would be created and the message\n" -" # would appear - hence the \"if posix\" clause.\n" -" logger = logging.getLogger('setup')\n" -" logger.critical('Should not appear, because of disabled " -"logger ...')\n" -" for i in range(100):\n" -" lvl = random.choice(levels)\n" -" logger = logging.getLogger(random.choice(loggers))\n" -" logger.log(lvl, 'Message no. %d', i)\n" -" time.sleep(0.01)\n" -"\n" -"def main():\n" -" q = Queue()\n" -" # The main process gets a simple configuration which prints to the " -"console.\n" -" config_initial = {\n" -" 'version': 1,\n" -" 'handlers': {\n" -" 'console': {\n" -" 'class': 'logging.StreamHandler',\n" -" 'level': 'INFO'\n" -" }\n" -" },\n" -" 'root': {\n" -" 'handlers': ['console'],\n" -" 'level': 'DEBUG'\n" -" }\n" -" }\n" -" # The worker process configuration is just a QueueHandler attached to " -"the\n" -" # root logger, which allows all messages to be sent to the queue.\n" -" # We disable existing loggers to disable the \"setup\" logger used in " -"the\n" -" # parent process. This is needed on POSIX because the logger will\n" -" # be there in the child following a fork().\n" -" config_worker = {\n" -" 'version': 1,\n" -" 'disable_existing_loggers': True,\n" -" 'handlers': {\n" -" 'queue': {\n" -" 'class': 'logging.handlers.QueueHandler',\n" -" 'queue': q\n" -" }\n" -" },\n" -" 'root': {\n" -" 'handlers': ['queue'],\n" -" 'level': 'DEBUG'\n" -" }\n" -" }\n" -" # The listener process configuration shows that the full flexibility of\n" -" # logging configuration is available to dispatch events to handlers " -"however\n" -" # you want.\n" -" # We disable existing loggers to disable the \"setup\" logger used in " -"the\n" -" # parent process. This is needed on POSIX because the logger will\n" -" # be there in the child following a fork().\n" -" config_listener = {\n" -" 'version': 1,\n" -" 'disable_existing_loggers': True,\n" -" 'formatters': {\n" -" 'detailed': {\n" -" 'class': 'logging.Formatter',\n" -" 'format': '%(asctime)s %(name)-15s %(levelname)-8s " -"%(processName)-10s %(message)s'\n" -" },\n" -" 'simple': {\n" -" 'class': 'logging.Formatter',\n" -" 'format': '%(name)-15s %(levelname)-8s %(processName)-10s " -"%(message)s'\n" -" }\n" -" },\n" -" 'handlers': {\n" -" 'console': {\n" -" 'class': 'logging.StreamHandler',\n" -" 'formatter': 'simple',\n" -" 'level': 'INFO'\n" -" },\n" -" 'file': {\n" -" 'class': 'logging.FileHandler',\n" -" 'filename': 'mplog.log',\n" -" 'mode': 'w',\n" -" 'formatter': 'detailed'\n" -" },\n" -" 'foofile': {\n" -" 'class': 'logging.FileHandler',\n" -" 'filename': 'mplog-foo.log',\n" -" 'mode': 'w',\n" -" 'formatter': 'detailed'\n" -" },\n" -" 'errors': {\n" -" 'class': 'logging.FileHandler',\n" -" 'filename': 'mplog-errors.log',\n" -" 'mode': 'w',\n" -" 'formatter': 'detailed',\n" -" 'level': 'ERROR'\n" -" }\n" -" },\n" -" 'loggers': {\n" -" 'foo': {\n" -" 'handlers': ['foofile']\n" -" }\n" -" },\n" -" 'root': {\n" -" 'handlers': ['console', 'file', 'errors'],\n" -" 'level': 'DEBUG'\n" -" }\n" -" }\n" -" # Log some initial events, just to show that logging in the parent " -"works\n" -" # normally.\n" -" logging.config.dictConfig(config_initial)\n" -" logger = logging.getLogger('setup')\n" -" logger.info('About to create workers ...')\n" -" workers = []\n" -" for i in range(5):\n" -" wp = Process(target=worker_process, name='worker %d' % (i + 1),\n" -" args=(config_worker,))\n" -" workers.append(wp)\n" -" wp.start()\n" -" logger.info('Started worker: %s', wp.name)\n" -" logger.info('About to create listener ...')\n" -" stop_event = Event()\n" -" lp = Process(target=listener_process, name='listener',\n" -" args=(q, stop_event, config_listener))\n" -" lp.start()\n" -" logger.info('Started listener')\n" -" # We now hang around for the workers to finish their work.\n" -" for wp in workers:\n" -" wp.join()\n" -" # Workers all done, listening can now stop.\n" -" # Logging in the parent still works normally.\n" -" logger.info('Telling listener to stop ...')\n" -" stop_event.set()\n" -" lp.join()\n" -" logger.info('All done.')\n" -"\n" -"if __name__ == '__main__':\n" -" main()" -msgstr "" - -#: ../../howto/logging-cookbook.rst:2458 +#: ../../howto/logging-cookbook.rst:1687 msgid "Inserting a BOM into messages sent to a SysLogHandler" msgstr "SysLogHandler に送るメッセージに BOM を挿入する" -#: ../../howto/logging-cookbook.rst:2460 +#: ../../howto/logging-cookbook.rst:1689 msgid "" ":rfc:`5424` requires that a Unicode message be sent to a syslog daemon as a " "set of bytes which have the following structure: an optional pure-ASCII " @@ -3513,7 +1194,7 @@ msgstr "" "(BOM)、続けて UTF-8 でエンコードされた Unicode. ( :rfc:`仕様の該当セクション " "<5424#section-6>` を参照)" -#: ../../howto/logging-cookbook.rst:2466 +#: ../../howto/logging-cookbook.rst:1695 msgid "" "In Python 3.1, code was added to :class:`~logging.handlers.SysLogHandler` to " "insert a BOM into the message, but unfortunately, it was implemented " @@ -3525,7 +1206,7 @@ msgstr "" "頭に BOM をつけてしまうのでピュアASCII 部分をその前に書くことができませんでし" "た。" -#: ../../howto/logging-cookbook.rst:2472 +#: ../../howto/logging-cookbook.rst:1701 msgid "" "As this behaviour is broken, the incorrect BOM insertion code is being " "removed from Python 3.2.4 and later. However, it is not being replaced, and " @@ -3539,7 +1220,7 @@ msgstr "" "つ UTF-8 でエンコードされた message を生成したい場合、次の手順に従う必要があ" "ります:" -#: ../../howto/logging-cookbook.rst:2478 +#: ../../howto/logging-cookbook.rst:1707 msgid "" "Attach a :class:`~logging.Formatter` instance to your :class:`~logging." "handlers.SysLogHandler` instance, with a format string such as::" @@ -3547,11 +1228,7 @@ msgstr "" ":class:`~logging.handlers.SysLogHandler` のインスタンスに、次のような format " "文字列を持った :class:`~logging.Formatter` インスタンスをアタッチする::" -#: ../../howto/logging-cookbook.rst:2482 -msgid "'ASCII section\\ufeffUnicode section'" -msgstr "" - -#: ../../howto/logging-cookbook.rst:2484 +#: ../../howto/logging-cookbook.rst:1713 msgid "" "The Unicode code point U+FEFF, when encoded using UTF-8, will be encoded as " "a UTF-8 BOM -- the byte-string ``b'\\xef\\xbb\\xbf'``." @@ -3559,7 +1236,7 @@ msgstr "" "Unicode のコードポイント U+FEFF は、UTF-8 でエンコードすると BOM -- " "``b'\\xef\\xbb\\xbf'`` -- になります。" -#: ../../howto/logging-cookbook.rst:2487 +#: ../../howto/logging-cookbook.rst:1716 msgid "" "Replace the ASCII section with whatever placeholders you like, but make sure " "that the data that appears in there after substitution is always ASCII (that " @@ -3569,7 +1246,7 @@ msgstr "" "常に ASCII になるように注意する(UTF-8 でエンコードされてもその部分が変化しな" "いようにする)。" -#: ../../howto/logging-cookbook.rst:2491 +#: ../../howto/logging-cookbook.rst:1720 msgid "" "Replace the Unicode section with whatever placeholders you like; if the data " "which appears there after substitution contains characters outside the ASCII " @@ -3579,7 +1256,7 @@ msgstr "" "タに ASCII 外の文字が含まれていても、それは単に UTF-8 でエンコードされるだけ" "です。" -#: ../../howto/logging-cookbook.rst:2495 +#: ../../howto/logging-cookbook.rst:1724 msgid "" "The formatted message *will* be encoded using UTF-8 encoding by " "``SysLogHandler``. If you follow the above rules, you should be able to " @@ -3593,11 +1270,11 @@ msgstr "" "`5424` に準拠しない形で送られるので、syslog デーモン側で何かエラーが起こる可" "能性があります。" -#: ../../howto/logging-cookbook.rst:2502 +#: ../../howto/logging-cookbook.rst:1731 msgid "Implementing structured logging" msgstr "構造化ログを実装する" -#: ../../howto/logging-cookbook.rst:2504 +#: ../../howto/logging-cookbook.rst:1733 msgid "" "Although most logging messages are intended for reading by humans, and thus " "not readily machine-parseable, there might be circumstances where you want " @@ -3616,42 +1293,17 @@ msgstr "" "実現する方法は幾つもありますが、次の例は JSON を使ってイベントを、機械でパー" "スできる形にシリアライズする単純な方法です::" -#: ../../howto/logging-cookbook.rst:2512 -msgid "" -"import json\n" -"import logging\n" -"\n" -"class StructuredMessage:\n" -" def __init__(self, message, /, **kwargs):\n" -" self.message = message\n" -" self.kwargs = kwargs\n" -"\n" -" def __str__(self):\n" -" return '%s >>> %s' % (self.message, json.dumps(self.kwargs))\n" -"\n" -"_ = StructuredMessage # optional, to improve readability\n" -"\n" -"logging.basicConfig(level=logging.INFO, format='%(message)s')\n" -"logging.info(_('message 1', foo='bar', bar='baz', num=123, fnum=123.456))" -msgstr "" - -#: ../../howto/logging-cookbook.rst:2528 +#: ../../howto/logging-cookbook.rst:1757 msgid "If the above script is run, it prints:" msgstr "上のスクリプトを実行すると次のように出力されます:" -#: ../../howto/logging-cookbook.rst:2530 -msgid "" -"message 1 >>> {\"fnum\": 123.456, \"num\": 123, \"bar\": \"baz\", \"foo\": " -"\"bar\"}" -msgstr "" - -#: ../../howto/logging-cookbook.rst:2534 ../../howto/logging-cookbook.rst:2576 +#: ../../howto/logging-cookbook.rst:1763 ../../howto/logging-cookbook.rst:1812 msgid "" "Note that the order of items might be different according to the version of " "Python used." msgstr "要素の順序は Python のバージョンによって異なることに注意してください。" -#: ../../howto/logging-cookbook.rst:2537 +#: ../../howto/logging-cookbook.rst:1766 msgid "" "If you need more specialised processing, you can use a custom JSON encoder, " "as in the following complete example::" @@ -3659,52 +1311,15 @@ msgstr "" "より特殊な処理が必要な場合、次の例のように、カスタムの JSON エンコーダを作る" "ことができます::" -#: ../../howto/logging-cookbook.rst:2540 -msgid "" -"import json\n" -"import logging\n" -"\n" -"\n" -"class Encoder(json.JSONEncoder):\n" -" def default(self, o):\n" -" if isinstance(o, set):\n" -" return tuple(o)\n" -" elif isinstance(o, str):\n" -" return o.encode('unicode_escape').decode('ascii')\n" -" return super().default(o)\n" -"\n" -"class StructuredMessage:\n" -" def __init__(self, message, /, **kwargs):\n" -" self.message = message\n" -" self.kwargs = kwargs\n" -"\n" -" def __str__(self):\n" -" s = Encoder().encode(self.kwargs)\n" -" return '%s >>> %s' % (self.message, s)\n" -"\n" -"_ = StructuredMessage # optional, to improve readability\n" -"\n" -"def main():\n" -" logging.basicConfig(level=logging.INFO, format='%(message)s')\n" -" logging.info(_('message 1', set_value={1, 2, 3}, snowman='\\u2603'))\n" -"\n" -"if __name__ == '__main__':\n" -" main()" -msgstr "" - -#: ../../howto/logging-cookbook.rst:2570 +#: ../../howto/logging-cookbook.rst:1806 msgid "When the above script is run, it prints:" msgstr "上のスクリプトを実行すると次のように出力されます:" -#: ../../howto/logging-cookbook.rst:2572 -msgid "message 1 >>> {\"snowman\": \"\\u2603\", \"set_value\": [1, 2, 3]}" -msgstr "" - -#: ../../howto/logging-cookbook.rst:2585 +#: ../../howto/logging-cookbook.rst:1821 msgid "Customizing handlers with :func:`dictConfig`" msgstr "handler を :func:`dictConfig` を使ってカスタマイズする" -#: ../../howto/logging-cookbook.rst:2587 +#: ../../howto/logging-cookbook.rst:1823 msgid "" "There are times when you want to customize logging handlers in particular " "ways, and if you use :func:`dictConfig` you may be able to do this without " @@ -3720,17 +1335,7 @@ msgstr "" "handler はこの機能を組み込みでサポートしていません。 handler の生成を通常の関" "数を使ってカスタマイズすることができます::" -#: ../../howto/logging-cookbook.rst:2594 -msgid "" -"def owned_file_handler(filename, mode='a', encoding=None, owner=None):\n" -" if owner:\n" -" if not os.path.exists(filename):\n" -" open(filename, 'a').close()\n" -" shutil.chown(filename, *owner)\n" -" return logging.FileHandler(filename, mode, encoding)" -msgstr "" - -#: ../../howto/logging-cookbook.rst:2601 +#: ../../howto/logging-cookbook.rst:1837 msgid "" "You can then specify, in a logging configuration passed to :func:" "`dictConfig`, that a logging handler be created by calling this function::" @@ -3738,40 +1343,7 @@ msgstr "" "そして、 :func:`dictConfig` に渡される構成設定の中で、この関数を使って " "logging handler を生成するように指定することができます::" -#: ../../howto/logging-cookbook.rst:2604 -msgid "" -"LOGGING = {\n" -" 'version': 1,\n" -" 'disable_existing_loggers': False,\n" -" 'formatters': {\n" -" 'default': {\n" -" 'format': '%(asctime)s %(levelname)s %(name)s %(message)s'\n" -" },\n" -" },\n" -" 'handlers': {\n" -" 'file':{\n" -" # The values below are popped from this dictionary and\n" -" # used to create the handler, set the handler's level and\n" -" # its formatter.\n" -" '()': owned_file_handler,\n" -" 'level':'DEBUG',\n" -" 'formatter': 'default',\n" -" # The values below are passed to the handler creator callable\n" -" # as keyword arguments.\n" -" 'owner': ['pulse', 'pulse'],\n" -" 'filename': 'chowntest.log',\n" -" 'mode': 'w',\n" -" 'encoding': 'utf-8',\n" -" },\n" -" },\n" -" 'root': {\n" -" 'handlers': ['file'],\n" -" 'level': 'DEBUG',\n" -" },\n" -"}" -msgstr "" - -#: ../../howto/logging-cookbook.rst:2634 +#: ../../howto/logging-cookbook.rst:1870 msgid "" "In this example I am setting the ownership using the ``pulse`` user and " "group, just for the purposes of illustration. Putting it together into a " @@ -3780,66 +1352,11 @@ msgstr "" "この例は説明用のものですが、owner の user と group を ``pulse`` に設定してい" "ます。これを動くスクリプトに ``chowntest.py`` に組み込んでみます::" -#: ../../howto/logging-cookbook.rst:2638 -msgid "" -"import logging, logging.config, os, shutil\n" -"\n" -"def owned_file_handler(filename, mode='a', encoding=None, owner=None):\n" -" if owner:\n" -" if not os.path.exists(filename):\n" -" open(filename, 'a').close()\n" -" shutil.chown(filename, *owner)\n" -" return logging.FileHandler(filename, mode, encoding)\n" -"\n" -"LOGGING = {\n" -" 'version': 1,\n" -" 'disable_existing_loggers': False,\n" -" 'formatters': {\n" -" 'default': {\n" -" 'format': '%(asctime)s %(levelname)s %(name)s %(message)s'\n" -" },\n" -" },\n" -" 'handlers': {\n" -" 'file':{\n" -" # The values below are popped from this dictionary and\n" -" # used to create the handler, set the handler's level and\n" -" # its formatter.\n" -" '()': owned_file_handler,\n" -" 'level':'DEBUG',\n" -" 'formatter': 'default',\n" -" # The values below are passed to the handler creator callable\n" -" # as keyword arguments.\n" -" 'owner': ['pulse', 'pulse'],\n" -" 'filename': 'chowntest.log',\n" -" 'mode': 'w',\n" -" 'encoding': 'utf-8',\n" -" },\n" -" },\n" -" 'root': {\n" -" 'handlers': ['file'],\n" -" 'level': 'DEBUG',\n" -" },\n" -"}\n" -"\n" -"logging.config.dictConfig(LOGGING)\n" -"logger = logging.getLogger('mylogger')\n" -"logger.debug('A debug message')" -msgstr "" - -#: ../../howto/logging-cookbook.rst:2681 +#: ../../howto/logging-cookbook.rst:1917 msgid "To run this, you will probably need to run as ``root``:" msgstr "これを実行するには、 ``root`` 権限で実行する必要があるかもしれません:" -#: ../../howto/logging-cookbook.rst:2683 -msgid "" -"$ sudo python3.3 chowntest.py\n" -"$ cat chowntest.log\n" -"2013-11-05 09:34:51,128 DEBUG mylogger A debug message\n" -"$ ls -l chowntest.log\n" -"-rw-r--r-- 1 pulse pulse 55 2013-11-05 09:34 chowntest.log" -msgstr "" - -#: ../../howto/logging-cookbook.rst:2691 +#: ../../howto/logging-cookbook.rst:1927 msgid "" "Note that this example uses Python 3.3 because that's where :func:`shutil." "chown` makes an appearance. This approach should work with any Python " @@ -3853,7 +1370,7 @@ msgstr "" "バージョンでは、オーナーを変更するのに :func:`os.chown` を利用する必要がある" "でしょう。" -#: ../../howto/logging-cookbook.rst:2697 +#: ../../howto/logging-cookbook.rst:1933 msgid "" "In practice, the handler-creating function may be in a utility module " "somewhere in your project. Instead of the line in the configuration::" @@ -3861,19 +1378,11 @@ msgstr "" "実際には、handler を生成する関数はプロジェクト内のどこかにあるユーティリティ" "モジュールに置くことになるでしょう。設定の中で直接関数を参照する代わりに::" -#: ../../howto/logging-cookbook.rst:2700 -msgid "'()': owned_file_handler," -msgstr "" - -#: ../../howto/logging-cookbook.rst:2702 +#: ../../howto/logging-cookbook.rst:1938 msgid "you could use e.g.::" msgstr "次のように書くこともできます::" -#: ../../howto/logging-cookbook.rst:2704 -msgid "'()': 'ext://project.util.owned_file_handler'," -msgstr "" - -#: ../../howto/logging-cookbook.rst:2706 +#: ../../howto/logging-cookbook.rst:1942 msgid "" "where ``project.util`` can be replaced with the actual name of the package " "where the function resides. In the above working script, using ``'ext://" @@ -3884,7 +1393,7 @@ msgstr "" "は ``'ext://__main__.owned_file_handler'`` で動くはずです。 :func:" "`dictConfig` は ``ext://`` から実際の callable を見つけます。" -#: ../../howto/logging-cookbook.rst:2711 +#: ../../howto/logging-cookbook.rst:1947 msgid "" "This example hopefully also points the way to how you could implement other " "types of file change - e.g. setting specific POSIX permission bits - in the " @@ -3893,7 +1402,7 @@ msgstr "" "この例は他のファイルに対する変更を実装する例にもなっています。例えば :func:" "`os.chmod` を使って、同じ方法で POSIX パーミッションを設定できるでしょう。" -#: ../../howto/logging-cookbook.rst:2715 +#: ../../howto/logging-cookbook.rst:1951 msgid "" "Of course, the approach could also be extended to types of handler other " "than a :class:`~logging.FileHandler` - for example, one of the rotating file " @@ -3902,11 +1411,11 @@ msgstr "" "もちろん、このアプローチは :class:`~logging.FileHandler` 以外の handler 、" "ローテートする file handler のいずれかやその他の handler にも適用できます。" -#: ../../howto/logging-cookbook.rst:2725 +#: ../../howto/logging-cookbook.rst:1961 msgid "Using particular formatting styles throughout your application" msgstr "固有の書式化スタイルをアプリケーション全体で使う" -#: ../../howto/logging-cookbook.rst:2727 +#: ../../howto/logging-cookbook.rst:1963 msgid "" "In Python 3.2, the :class:`~logging.Formatter` gained a ``style`` keyword " "parameter which, while defaulting to ``%`` for backward compatibility, " @@ -3924,7 +1433,7 @@ msgstr "" "与えますが、個々のログメッセージが構築される方法とは完全に直交していることに" "注意してください。" -#: ../../howto/logging-cookbook.rst:2734 +#: ../../howto/logging-cookbook.rst:1970 msgid "" "Logging calls (:meth:`~Logger.debug`, :meth:`~Logger.info` etc.) only take " "positional parameters for the actual logging message itself, with keyword " @@ -3934,22 +1443,21 @@ msgid "" "additional contextual information to be added to the log). So you cannot " "directly make logging calls using :meth:`str.format` or :class:`string." "Template` syntax, because internally the logging package uses %-formatting " -"to merge the format string and the variable arguments. There would be no " +"to merge the format string and the variable arguments. There would no " "changing this while preserving backward compatibility, since all logging " "calls which are out there in existing code will be using %-format strings." msgstr "" -"ロギングの呼び出し (:meth:`~Logger.debug`, :meth:`~Logger.info` など) はログ" -"メッセージのためには位置引数しか取らず、ロギングの呼び出しを処理する方法を決" -"定するためだけにキーワード引数を指定できます (たとえば ``exc_info`` キーワー" -"ド引数はトレースバックの情報をログに含めるかどうかを指定し、 ``extra`` キー" -"ワード引数はログに付加する追加のコンテキスト情報を指定します)。ロギングパッ" -"ケージは内部で %-format を使って書式文字列に可変長引数を埋め込んでいるた" -"め、 :meth:`str.format` や :class:`string.Template` の構文を使って直接ロギン" -"グの呼び出しを行うことはできません。既存のコードにおける全てのロギングの呼び" -"出しは %-format 文字列を使っているため、後方互換性を維持する限りこの部分が変" -"更されることはないでしょう。" +"logging の呼び出し (:meth:`~Logger.debug`, :meth:`~Logger.info` など) は、ロ" +"グメッセージのために位置引数しか受け取らず、キーワード引数はそれを処理すると" +"きのオプションを指定するためだけに使われます。 (例えば、 ``exc_info`` キー" +"ワード引数を使ってログを取るトレースバック情報を指定したり、 ``extra`` キー" +"ワード引数を使ってログに付与する追加のコンテキスト情報を指定します。)logging " +"パッケージは内部で % を使って format 文字列と引数をマージしているので、 :" +"meth:`str.format` や :class:`string.Template` を使って logging を呼び出す事は" +"できません。既存の logging 呼び出しは %-format を使っているので、後方互換性の" +"ためにこの部分を変更することはできません。" -#: ../../howto/logging-cookbook.rst:2746 +#: ../../howto/logging-cookbook.rst:1982 msgid "" "There have been suggestions to associate format styles with specific " "loggers, but that approach also runs into backward compatibility problems " @@ -3960,7 +1468,7 @@ msgstr "" "ローチは同時に後方互換性の問題にぶち当たります。あらゆる既存のコードはロガー" "の名前を使っているでしょうし、 % 形式書式化を使っているでしょう。" -#: ../../howto/logging-cookbook.rst:2750 +#: ../../howto/logging-cookbook.rst:1986 msgid "" "For logging to work interoperably between any third-party libraries and your " "code, decisions about formatting need to be made at the level of the " @@ -3972,11 +1480,11 @@ msgstr "" "ルで行う必要があります。これは受け容れ可能な代替書式化スタイルに様々な手段の" "可能性を広げます。" -#: ../../howto/logging-cookbook.rst:2757 +#: ../../howto/logging-cookbook.rst:1993 msgid "Using LogRecord factories" msgstr "LogRecord ファクトリを使う" -#: ../../howto/logging-cookbook.rst:2759 +#: ../../howto/logging-cookbook.rst:1995 msgid "" "In Python 3.2, along with the :class:`~logging.Formatter` changes mentioned " "above, the logging package gained the ability to allow users to set their " @@ -4001,7 +1509,7 @@ msgstr "" "た、%-書式化をデフォルトで認めるべきです。基底クラスの実装がそうしているよう" "に、 ``str(self.msg)`` 呼び出しもしてください。" -#: ../../howto/logging-cookbook.rst:2770 +#: ../../howto/logging-cookbook.rst:2006 msgid "" "Refer to the reference documentation on :func:`setLogRecordFactory` and :" "class:`LogRecord` for more information." @@ -4009,11 +1517,11 @@ msgstr "" "さらに詳しい情報は、リファレンスの :func:`setLogRecordFactory`, :class:" "`LogRecord` を参照してください。" -#: ../../howto/logging-cookbook.rst:2775 +#: ../../howto/logging-cookbook.rst:2011 msgid "Using custom message objects" msgstr "カスタムなメッセージオブジェクトを使う" -#: ../../howto/logging-cookbook.rst:2777 +#: ../../howto/logging-cookbook.rst:2013 msgid "" "There is another, perhaps simpler way that you can use {}- and $- formatting " "to construct your individual log messages. You may recall (from :ref:" @@ -4029,7 +1537,7 @@ msgstr "" "ケージはそのオブジェクトに対して実際の書式文字列を得るために :func:`str` を呼" "び出すことも。以下 2 つのクラスを検討してみましょう::" -#: ../../howto/logging-cookbook.rst:2802 +#: ../../howto/logging-cookbook.rst:2038 msgid "" "Either of these can be used in place of a format string, to allow {}- or $-" "formatting to be used to build the actual \"message\" part which appears in " @@ -4046,7 +1554,7 @@ msgstr "" "か ``_`` のような(あるいは地域化のために既に ``_`` を使っているのであれば " "``__`` が良いかもしれません)。" -#: ../../howto/logging-cookbook.rst:2810 +#: ../../howto/logging-cookbook.rst:2046 msgid "" "Examples of this approach are given below. Firstly, formatting with :meth:" "`str.format`::" @@ -4054,34 +1562,11 @@ msgstr "" "このアプローチによる例をお見せします。最初は :meth:`str.format` を使って" "フォーマットする例です::" -#: ../../howto/logging-cookbook.rst:2813 -msgid "" -">>> __ = BraceMessage\n" -">>> print(__('Message with {0} {1}', 2, 'placeholders'))\n" -"Message with 2 placeholders\n" -">>> class Point: pass\n" -"...\n" -">>> p = Point()\n" -">>> p.x = 0.5\n" -">>> p.y = 0.5\n" -">>> print(__('Message with coordinates: ({point.x:.2f}, {point.y:.2f})', " -"point=p))\n" -"Message with coordinates: (0.50, 0.50)" -msgstr "" - -#: ../../howto/logging-cookbook.rst:2824 +#: ../../howto/logging-cookbook.rst:2060 msgid "Secondly, formatting with :class:`string.Template`::" msgstr "2つめは :class:`string.Template` でフォーマットする例です::" -#: ../../howto/logging-cookbook.rst:2826 -msgid "" -">>> __ = DollarMessage\n" -">>> print(__('Message with $num $what', num=2, what='placeholders'))\n" -"Message with 2 placeholders\n" -">>>" -msgstr "" - -#: ../../howto/logging-cookbook.rst:2831 +#: ../../howto/logging-cookbook.rst:2067 msgid "" "One thing to note is that you pay no significant performance penalty with " "this approach: the actual formatting happens not when you make the logging " @@ -4089,22 +1574,22 @@ msgid "" "a log by a handler. So the only slightly unusual thing which might trip you " "up is that the parentheses go around the format string and the arguments, " "not just the format string. That’s because the __ notation is just syntax " -"sugar for a constructor call to one of the :samp:`{XXX}Message` classes " -"shown above." +"sugar for a constructor call to one of the ``XXXMessage`` classes shown " +"above." msgstr "" -"注意点として、この方法には大きなパフォーマンスのペナルティはありません。実際" -"のフォーマット操作は logging の呼び出し時ではなくて、メッセージが実際に " -"handler によって出力されるときに起こります。(出力されないならフォーマットもさ" -"れません) そのため、この方法で注意しないといけないのは、追加の括弧が書式文字" -"列だけではなく引数も囲わないといけないことだけです。これは上記のとおり __ " -"が :samp:`{XXX}Message` クラスのコンストラクタ呼び出しのシンタックスシュガー" -"でしか無いからです。" +"ひとつ注目すべきは、この方法には大きなパフォーマンス上のペナルティはないこと" +"です。実際のフォーマット操作は logging の呼び出し時ではなくて、メッセージが実" +"際に(そして必要な場合のみ) handler によって出力されるときに起こります。ですの" +"で、この方法での唯一の些細な注意点は、追加の括弧がフォーマット文字列だけでは" +"なく引数も囲わないといけないこと、だけです。__ は上でお見せした通り " +"``XXXMessage`` クラスのコンストラクタ呼び出しのシンタックスシュガーに過ぎませ" +"ん。" -#: ../../howto/logging-cookbook.rst:2845 +#: ../../howto/logging-cookbook.rst:2081 msgid "Configuring filters with :func:`dictConfig`" msgstr "filter を :func:`dictConfig` を使ってカスタマイズする" -#: ../../howto/logging-cookbook.rst:2847 +#: ../../howto/logging-cookbook.rst:2083 msgid "" "You *can* configure filters using :func:`~logging.config.dictConfig`, though " "it might not be obvious at first glance how to do it (hence this recipe). " @@ -4129,52 +1614,7 @@ msgstr "" "が、 :class:`~logging.Filter` インスタンスを返却する callable を提供すること" "でも出来ます)。以下に完全な例を示します::" -#: ../../howto/logging-cookbook.rst:2858 -msgid "" -"import logging\n" -"import logging.config\n" -"import sys\n" -"\n" -"class MyFilter(logging.Filter):\n" -" def __init__(self, param=None):\n" -" self.param = param\n" -"\n" -" def filter(self, record):\n" -" if self.param is None:\n" -" allow = True\n" -" else:\n" -" allow = self.param not in record.msg\n" -" if allow:\n" -" record.msg = 'changed: ' + record.msg\n" -" return allow\n" -"\n" -"LOGGING = {\n" -" 'version': 1,\n" -" 'filters': {\n" -" 'myfilter': {\n" -" '()': MyFilter,\n" -" 'param': 'noshow',\n" -" }\n" -" },\n" -" 'handlers': {\n" -" 'console': {\n" -" 'class': 'logging.StreamHandler',\n" -" 'filters': ['myfilter']\n" -" }\n" -" },\n" -" 'root': {\n" -" 'level': 'DEBUG',\n" -" 'handlers': ['console']\n" -" },\n" -"}\n" -"\n" -"if __name__ == '__main__':\n" -" logging.config.dictConfig(LOGGING)\n" -" logging.debug('hello')\n" -" logging.debug('hello - noshow')" -msgstr "" - -#: ../../howto/logging-cookbook.rst:2900 +#: ../../howto/logging-cookbook.rst:2136 msgid "" "This example shows how you can pass configuration data to the callable which " "constructs the instance, in the form of keyword parameters. When run, the " @@ -4184,19 +1624,15 @@ msgstr "" "ワードパラメータの形で渡すのか、をこの例は教えてくれます。上記スクリプトは実" "行すると、このような出力をします:" -#: ../../howto/logging-cookbook.rst:2904 -msgid "changed: hello" -msgstr "" - -#: ../../howto/logging-cookbook.rst:2908 +#: ../../howto/logging-cookbook.rst:2144 msgid "which shows that the filter is working as configured." msgstr "設定した通りに動いていますね。" -#: ../../howto/logging-cookbook.rst:2910 +#: ../../howto/logging-cookbook.rst:2146 msgid "A couple of extra points to note:" msgstr "ほかにもいくつか特筆すべき点があります:" -#: ../../howto/logging-cookbook.rst:2912 +#: ../../howto/logging-cookbook.rst:2148 msgid "" "If you can't refer to the callable directly in the configuration (e.g. if it " "lives in a different module, and you can't import it directly where the " @@ -4211,7 +1647,7 @@ msgstr "" "す。例えば、上記例のように ``MyFilter`` と指定する代わりに、 ``'ext://" "__main__.MyFilter'`` と記述することが出来ます。" -#: ../../howto/logging-cookbook.rst:2919 +#: ../../howto/logging-cookbook.rst:2155 msgid "" "As well as for filters, this technique can also be used to configure custom " "handlers and formatters. See :ref:`logging-config-dict-userdef` for more " @@ -4225,11 +1661,11 @@ msgstr "" "`logging-config-dict-userdef` と、本クックブックの上の方のレシピ :ref:" "`custom-handlers` を参照してください。" -#: ../../howto/logging-cookbook.rst:2928 +#: ../../howto/logging-cookbook.rst:2164 msgid "Customized exception formatting" msgstr "例外の書式化をカスタマイズする" -#: ../../howto/logging-cookbook.rst:2930 +#: ../../howto/logging-cookbook.rst:2166 msgid "" "There might be times when you want to do customized exception formatting - " "for argument's sake, let's say you want exactly one line per logged event, " @@ -4240,58 +1676,11 @@ msgstr "" "外情報がある場合でもログイベントごとに一行に収まることを死守したいと望むとし" "ましょう。フォーマッタのクラスをカスタマイズして、このように出来ます::" -#: ../../howto/logging-cookbook.rst:2935 -msgid "" -"import logging\n" -"\n" -"class OneLineExceptionFormatter(logging.Formatter):\n" -" def formatException(self, exc_info):\n" -" \"\"\"\n" -" Format an exception so that it prints on a single line.\n" -" \"\"\"\n" -" result = super().formatException(exc_info)\n" -" return repr(result) # or format into one line however you want to\n" -"\n" -" def format(self, record):\n" -" s = super().format(record)\n" -" if record.exc_text:\n" -" s = s.replace('\\n', '') + '|'\n" -" return s\n" -"\n" -"def configure_logging():\n" -" fh = logging.FileHandler('output.txt', 'w')\n" -" f = OneLineExceptionFormatter('%(asctime)s|%(levelname)s|%(message)s|',\n" -" '%d/%m/%Y %H:%M:%S')\n" -" fh.setFormatter(f)\n" -" root = logging.getLogger()\n" -" root.setLevel(logging.DEBUG)\n" -" root.addHandler(fh)\n" -"\n" -"def main():\n" -" configure_logging()\n" -" logging.info('Sample message')\n" -" try:\n" -" x = 1 / 0\n" -" except ZeroDivisionError as e:\n" -" logging.exception('ZeroDivisionError: %s', e)\n" -"\n" -"if __name__ == '__main__':\n" -" main()" -msgstr "" - -#: ../../howto/logging-cookbook.rst:2971 +#: ../../howto/logging-cookbook.rst:2207 msgid "When run, this produces a file with exactly two lines:" msgstr "実行してみましょう。このように正確に2行の出力を生成します:" -#: ../../howto/logging-cookbook.rst:2973 -msgid "" -"28/01/2015 07:21:23|INFO|Sample message|\n" -"28/01/2015 07:21:23|ERROR|ZeroDivisionError: division by zero|'Traceback " -"(most recent call last):\\n File \"logtest7.py\", line 30, in main\\n x " -"= 1 / 0\\nZeroDivisionError: division by zero'|" -msgstr "" - -#: ../../howto/logging-cookbook.rst:2978 +#: ../../howto/logging-cookbook.rst:2214 msgid "" "While the above treatment is simplistic, it points the way to how exception " "information can be formatted to your liking. The :mod:`traceback` module may " @@ -4301,11 +1690,11 @@ msgstr "" "出来るかを示しています。さらに特殊なニーズが必要な場合には :mod:`traceback` " "モジュールが有用です。" -#: ../../howto/logging-cookbook.rst:2985 +#: ../../howto/logging-cookbook.rst:2221 msgid "Speaking logging messages" msgstr "ロギングメッセージを喋る" -#: ../../howto/logging-cookbook.rst:2987 +#: ../../howto/logging-cookbook.rst:2223 msgid "" "There might be situations when it is desirable to have logging messages " "rendered in an audible rather than a visible format. This is easy to do if " @@ -4334,45 +1723,13 @@ msgstr "" "ことになります。 ``espeak`` TTS パッケージが手許にあるとして、このアプローチ" "による短い例はこのようなものです::" -#: ../../howto/logging-cookbook.rst:3000 -msgid "" -"import logging\n" -"import subprocess\n" -"import sys\n" -"\n" -"class TTSHandler(logging.Handler):\n" -" def emit(self, record):\n" -" msg = self.format(record)\n" -" # Speak slowly in a female English voice\n" -" cmd = ['espeak', '-s150', '-ven+f3', msg]\n" -" p = subprocess.Popen(cmd, stdout=subprocess.PIPE,\n" -" stderr=subprocess.STDOUT)\n" -" # wait for the program to finish\n" -" p.communicate()\n" -"\n" -"def configure_logging():\n" -" h = TTSHandler()\n" -" root = logging.getLogger()\n" -" root.addHandler(h)\n" -" # the default formatter just returns the message\n" -" root.setLevel(logging.DEBUG)\n" -"\n" -"def main():\n" -" logging.info('Hello')\n" -" logging.debug('Goodbye')\n" -"\n" -"if __name__ == '__main__':\n" -" configure_logging()\n" -" sys.exit(main())" -msgstr "" - -#: ../../howto/logging-cookbook.rst:3029 +#: ../../howto/logging-cookbook.rst:2265 msgid "" "When run, this script should say \"Hello\" and then \"Goodbye\" in a female " "voice." msgstr "実行すれば、女性の声で \"Hello\" に続き \"Goodbye\" と喋るはずです。" -#: ../../howto/logging-cookbook.rst:3031 +#: ../../howto/logging-cookbook.rst:2267 msgid "" "The above approach can, of course, be adapted to other TTS systems and even " "other systems altogether which can process messages via external programs " @@ -4382,11 +1739,11 @@ msgstr "" "コマンドライン経由で外部プログラムに渡せるようなものであれば、ほかのシステム" "であっても全く同じです。" -#: ../../howto/logging-cookbook.rst:3039 +#: ../../howto/logging-cookbook.rst:2275 msgid "Buffering logging messages and outputting them conditionally" msgstr "ロギングメッセージをバッファリングし、条件に従って出力する" -#: ../../howto/logging-cookbook.rst:3041 +#: ../../howto/logging-cookbook.rst:2277 msgid "" "There might be situations where you want to log messages in a temporary area " "and only output them if a certain condition occurs. For example, you may " @@ -4401,7 +1758,7 @@ msgstr "" "による混雑は喰らいたくはなく、エラーがあった場合にだけエラー出力とともにデ" "バッグ情報を見たいのだ、のようなことがあるでしょう。" -#: ../../howto/logging-cookbook.rst:3048 +#: ../../howto/logging-cookbook.rst:2284 msgid "" "Here is an example which shows how you could do this using a decorator for " "your functions where you want logging to behave this way. It makes use of " @@ -4422,7 +1779,7 @@ msgstr "" "ラッシュされます。何か特別なフラッシュの振る舞いをしたければ、このレシピはさ" "らに特殊化した ``MemoryHandler`` とともに利用出来ます。" -#: ../../howto/logging-cookbook.rst:3058 +#: ../../howto/logging-cookbook.rst:2294 msgid "" "The example script has a simple function, ``foo``, which just cycles through " "all the logging levels, writing to ``sys.stderr`` to say what level it's " @@ -4435,7 +1792,7 @@ msgstr "" "う、という単純な関数を使っています。 ``foo`` に真を与えると ERROR と " "CRITICAL の出力をし、そうでなければ DEBUG, INFO, WARNING だけを出力します。" -#: ../../howto/logging-cookbook.rst:3064 +#: ../../howto/logging-cookbook.rst:2300 msgid "" "The script just arranges to decorate ``foo`` with a decorator which will do " "the conditional logging that's required. The decorator takes a logger as a " @@ -4454,110 +1811,15 @@ msgstr "" "フォルトは順に ``sys.stderr`` へ書き出す :class:`~logging.StreamHandler`, " "``logging.ERROR``, ``100`` です。" -#: ../../howto/logging-cookbook.rst:3072 +#: ../../howto/logging-cookbook.rst:2308 msgid "Here's the script::" msgstr "スクリプトはこれです::" -#: ../../howto/logging-cookbook.rst:3074 -msgid "" -"import logging\n" -"from logging.handlers import MemoryHandler\n" -"import sys\n" -"\n" -"logger = logging.getLogger(__name__)\n" -"logger.addHandler(logging.NullHandler())\n" -"\n" -"def log_if_errors(logger, target_handler=None, flush_level=None, " -"capacity=None):\n" -" if target_handler is None:\n" -" target_handler = logging.StreamHandler()\n" -" if flush_level is None:\n" -" flush_level = logging.ERROR\n" -" if capacity is None:\n" -" capacity = 100\n" -" handler = MemoryHandler(capacity, flushLevel=flush_level, " -"target=target_handler)\n" -"\n" -" def decorator(fn):\n" -" def wrapper(*args, **kwargs):\n" -" logger.addHandler(handler)\n" -" try:\n" -" return fn(*args, **kwargs)\n" -" except Exception:\n" -" logger.exception('call failed')\n" -" raise\n" -" finally:\n" -" super(MemoryHandler, handler).flush()\n" -" logger.removeHandler(handler)\n" -" return wrapper\n" -"\n" -" return decorator\n" -"\n" -"def write_line(s):\n" -" sys.stderr.write('%s\\n' % s)\n" -"\n" -"def foo(fail=False):\n" -" write_line('about to log at DEBUG ...')\n" -" logger.debug('Actually logged at DEBUG')\n" -" write_line('about to log at INFO ...')\n" -" logger.info('Actually logged at INFO')\n" -" write_line('about to log at WARNING ...')\n" -" logger.warning('Actually logged at WARNING')\n" -" if fail:\n" -" write_line('about to log at ERROR ...')\n" -" logger.error('Actually logged at ERROR')\n" -" write_line('about to log at CRITICAL ...')\n" -" logger.critical('Actually logged at CRITICAL')\n" -" return fail\n" -"\n" -"decorated_foo = log_if_errors(logger)(foo)\n" -"\n" -"if __name__ == '__main__':\n" -" logger.setLevel(logging.DEBUG)\n" -" write_line('Calling undecorated foo with False')\n" -" assert not foo(False)\n" -" write_line('Calling undecorated foo with True')\n" -" assert foo(True)\n" -" write_line('Calling decorated foo with False')\n" -" assert not decorated_foo(False)\n" -" write_line('Calling decorated foo with True')\n" -" assert decorated_foo(True)" -msgstr "" - -#: ../../howto/logging-cookbook.rst:3135 +#: ../../howto/logging-cookbook.rst:2371 msgid "When this script is run, the following output should be observed:" msgstr "実行すればこのような出力になるはずです:" -#: ../../howto/logging-cookbook.rst:3137 -msgid "" -"Calling undecorated foo with False\n" -"about to log at DEBUG ...\n" -"about to log at INFO ...\n" -"about to log at WARNING ...\n" -"Calling undecorated foo with True\n" -"about to log at DEBUG ...\n" -"about to log at INFO ...\n" -"about to log at WARNING ...\n" -"about to log at ERROR ...\n" -"about to log at CRITICAL ...\n" -"Calling decorated foo with False\n" -"about to log at DEBUG ...\n" -"about to log at INFO ...\n" -"about to log at WARNING ...\n" -"Calling decorated foo with True\n" -"about to log at DEBUG ...\n" -"about to log at INFO ...\n" -"about to log at WARNING ...\n" -"about to log at ERROR ...\n" -"Actually logged at DEBUG\n" -"Actually logged at INFO\n" -"Actually logged at WARNING\n" -"Actually logged at ERROR\n" -"about to log at CRITICAL ...\n" -"Actually logged at CRITICAL" -msgstr "" - -#: ../../howto/logging-cookbook.rst:3165 +#: ../../howto/logging-cookbook.rst:2401 msgid "" "As you can see, actual logging output only occurs when an event is logged " "whose severity is ERROR or greater, but in that case, any previous events at " @@ -4567,143 +1829,23 @@ msgstr "" "すが、この場合はそれよりも重要度の低い ERROR よりも前に発生したイベントも出力" "されます。" -#: ../../howto/logging-cookbook.rst:3169 +#: ../../howto/logging-cookbook.rst:2405 msgid "You can of course use the conventional means of decoration::" msgstr "当然のことですが、デコレーションはいつものやり方でどうぞ::" -#: ../../howto/logging-cookbook.rst:3171 -msgid "" -"@log_if_errors(logger)\n" -"def foo(fail=False):\n" -" ..." -msgstr "" - -#: ../../howto/logging-cookbook.rst:3179 -msgid "Sending logging messages to email, with buffering" -msgstr "バッファリングしながらロギングメッセージを email で送信する" - -#: ../../howto/logging-cookbook.rst:3181 -msgid "" -"To illustrate how you can send log messages via email, so that a set number " -"of messages are sent per email, you can subclass :class:`~logging.handlers." -"BufferingHandler`. In the following example, which you can adapt to suit " -"your specific needs, a simple test harness is provided which allows you to " -"run the script with command line arguments specifying what you typically " -"need to send things via SMTP. (Run the downloaded script with the ``-h`` " -"argument to see the required and optional arguments.)" -msgstr "" -"ログメッセージをメールで、特に1つのメールにつき複数のログメッセージを、送信す" -"る方法を例示するため、 :class:`~logging.handlers.BufferingHandler` を継承しま" -"す。以下の例は、必要に応じて改変することもできますが、 SMTP 経由でログを送信" -"するのに必要な情報をコマンドライン引数で指定してスクリプトを実行できるように" -"簡単なテストハーネスも提供しています (必須の引数およびオプション引数の詳細を" -"見るためには、ダウンロードしたスクリプトを ``-h`` 引数をつけて実行してくださ" -"い)。" - -#: ../../howto/logging-cookbook.rst:3189 -msgid "" -"import logging\n" -"import logging.handlers\n" -"import smtplib\n" -"\n" -"class BufferingSMTPHandler(logging.handlers.BufferingHandler):\n" -" def __init__(self, mailhost, port, username, password, fromaddr, " -"toaddrs,\n" -" subject, capacity):\n" -" logging.handlers.BufferingHandler.__init__(self, capacity)\n" -" self.mailhost = mailhost\n" -" self.mailport = port\n" -" self.username = username\n" -" self.password = password\n" -" self.fromaddr = fromaddr\n" -" if isinstance(toaddrs, str):\n" -" toaddrs = [toaddrs]\n" -" self.toaddrs = toaddrs\n" -" self.subject = subject\n" -" self.setFormatter(logging.Formatter(\"%(asctime)s %(levelname)-5s " -"%(message)s\"))\n" -"\n" -" def flush(self):\n" -" if len(self.buffer) > 0:\n" -" try:\n" -" smtp = smtplib.SMTP(self.mailhost, self.mailport)\n" -" smtp.starttls()\n" -" smtp.login(self.username, self.password)\n" -" msg = \"From: %s\\r\\nTo: %s\\r\\nSubject: %s\\r\\n\\r\\n\" " -"% (self.fromaddr, ','.join(self.toaddrs), self.subject)\n" -" for record in self.buffer:\n" -" s = self.format(record)\n" -" msg = msg + s + \"\\r\\n\"\n" -" smtp.sendmail(self.fromaddr, self.toaddrs, msg)\n" -" smtp.quit()\n" -" except Exception:\n" -" if logging.raiseExceptions:\n" -" raise\n" -" self.buffer = []\n" -"\n" -"if __name__ == '__main__':\n" -" import argparse\n" -"\n" -" ap = argparse.ArgumentParser()\n" -" aa = ap.add_argument\n" -" aa('host', metavar='HOST', help='SMTP server')\n" -" aa('--port', '-p', type=int, default=587, help='SMTP port')\n" -" aa('user', metavar='USER', help='SMTP username')\n" -" aa('password', metavar='PASSWORD', help='SMTP password')\n" -" aa('to', metavar='TO', help='Addressee for emails')\n" -" aa('sender', metavar='SENDER', help='Sender email address')\n" -" aa('--subject', '-s',\n" -" default='Test Logging email from Python logging module (buffering)',\n" -" help='Subject of email')\n" -" options = ap.parse_args()\n" -" logger = logging.getLogger()\n" -" logger.setLevel(logging.DEBUG)\n" -" h = BufferingSMTPHandler(options.host, options.port, options.user,\n" -" options.password, options.sender,\n" -" options.to, options.subject, 10)\n" -" logger.addHandler(h)\n" -" for i in range(102):\n" -" logger.info(\"Info index = %d\", i)\n" -" h.flush()\n" -" h.close()" -msgstr "" - -#: ../../howto/logging-cookbook.rst:3253 -msgid "" -"If you run this script and your SMTP server is correctly set up, you should " -"find that it sends eleven emails to the addressee you specify. The first ten " -"emails will each have ten log messages, and the eleventh will have two " -"messages. That makes up 102 messages as specified in the script." -msgstr "" -"SMTP サーバーを正しく設定した上でスクリプトを実行すると、指定したアドレス宛て" -"に11通のメールを受け取るでしょう。最初の10通のメールはそれぞれ10個のログメッ" -"セージを含み、11通目のメールは2つのログメッセージを含むはずです。これらのログ" -"メッセージはスクリプト内で指定された102個のログメッセージから構成されていま" -"す。" - -#: ../../howto/logging-cookbook.rst:3261 +#: ../../howto/logging-cookbook.rst:2415 msgid "Formatting times using UTC (GMT) via configuration" msgstr "設定によって時刻を UTC(GMT) で書式化する" -#: ../../howto/logging-cookbook.rst:3263 +#: ../../howto/logging-cookbook.rst:2417 msgid "" "Sometimes you want to format times using UTC, which can be done using a " -"class such as ``UTCFormatter``, shown below::" +"class such as `UTCFormatter`, shown below::" msgstr "" -"時刻を UTC でフォーマットしたい場合もあるでしょう。以下に示すように、そのよう" -"なフォーマット処理は ``UTCFormatter`` のようなクラスを使って行うことができま" -"す::" +"場合によっては、時刻として UTC を使いたいと思うかもしれません。これには以下に" +"示すような `UTCFormatter` のようなクラスを使って出来ます::" -#: ../../howto/logging-cookbook.rst:3266 -msgid "" -"import logging\n" -"import time\n" -"\n" -"class UTCFormatter(logging.Formatter):\n" -" converter = time.gmtime" -msgstr "" - -#: ../../howto/logging-cookbook.rst:3272 +#: ../../howto/logging-cookbook.rst:2426 msgid "" "and you can then use the ``UTCFormatter`` in your code instead of :class:" "`~logging.Formatter`. If you want to do that via configuration, you can use " @@ -4714,58 +1856,11 @@ msgstr "" "えます。これを設定を通して行いたい場合、 :func:`~logging.config.dictConfig` " "API を以下の完全な例で示すようなアプローチで使うことが出来ます::" -#: ../../howto/logging-cookbook.rst:3277 -msgid "" -"import logging\n" -"import logging.config\n" -"import time\n" -"\n" -"class UTCFormatter(logging.Formatter):\n" -" converter = time.gmtime\n" -"\n" -"LOGGING = {\n" -" 'version': 1,\n" -" 'disable_existing_loggers': False,\n" -" 'formatters': {\n" -" 'utc': {\n" -" '()': UTCFormatter,\n" -" 'format': '%(asctime)s %(message)s',\n" -" },\n" -" 'local': {\n" -" 'format': '%(asctime)s %(message)s',\n" -" }\n" -" },\n" -" 'handlers': {\n" -" 'console1': {\n" -" 'class': 'logging.StreamHandler',\n" -" 'formatter': 'utc',\n" -" },\n" -" 'console2': {\n" -" 'class': 'logging.StreamHandler',\n" -" 'formatter': 'local',\n" -" },\n" -" },\n" -" 'root': {\n" -" 'handlers': ['console1', 'console2'],\n" -" }\n" -"}\n" -"\n" -"if __name__ == '__main__':\n" -" logging.config.dictConfig(LOGGING)\n" -" logging.warning('The local time is %s', time.asctime())" -msgstr "" - -#: ../../howto/logging-cookbook.rst:3315 +#: ../../howto/logging-cookbook.rst:2469 msgid "When this script is run, it should print something like:" msgstr "実行すれば、このような出力になるはずです:" -#: ../../howto/logging-cookbook.rst:3317 -msgid "" -"2015-10-17 12:53:29,501 The local time is Sat Oct 17 13:53:29 2015\n" -"2015-10-17 13:53:29,501 The local time is Sat Oct 17 13:53:29 2015" -msgstr "" - -#: ../../howto/logging-cookbook.rst:3322 +#: ../../howto/logging-cookbook.rst:2476 msgid "" "showing how the time is formatted both as local time and UTC, one for each " "handler." @@ -4773,11 +1868,11 @@ msgstr "" "時刻をローカル時刻と UTC の両方に書式化するのに、それぞれのハンドラにそれぞれ" "フォーマッタを与えています。" -#: ../../howto/logging-cookbook.rst:3329 +#: ../../howto/logging-cookbook.rst:2483 msgid "Using a context manager for selective logging" msgstr "ロギングの選択にコンテキストマネージャを使う" -#: ../../howto/logging-cookbook.rst:3331 +#: ../../howto/logging-cookbook.rst:2485 msgid "" "There are times when it would be useful to temporarily change the logging " "configuration and revert it back after doing something. For this, a context " @@ -4794,36 +1889,7 @@ msgstr "" "意にロギングレベルを変更し、コンテキストマネージャのスコープ内で他に影響を及" "ぼさずロギングハンドラを追加できるようになります::" -#: ../../howto/logging-cookbook.rst:3338 -msgid "" -"import logging\n" -"import sys\n" -"\n" -"class LoggingContext:\n" -" def __init__(self, logger, level=None, handler=None, close=True):\n" -" self.logger = logger\n" -" self.level = level\n" -" self.handler = handler\n" -" self.close = close\n" -"\n" -" def __enter__(self):\n" -" if self.level is not None:\n" -" self.old_level = self.logger.level\n" -" self.logger.setLevel(self.level)\n" -" if self.handler:\n" -" self.logger.addHandler(self.handler)\n" -"\n" -" def __exit__(self, et, ev, tb):\n" -" if self.level is not None:\n" -" self.logger.setLevel(self.old_level)\n" -" if self.handler:\n" -" self.logger.removeHandler(self.handler)\n" -" if self.handler and self.close:\n" -" self.handler.close()\n" -" # implicit return of None => don't swallow exceptions" -msgstr "" - -#: ../../howto/logging-cookbook.rst:3364 +#: ../../howto/logging-cookbook.rst:2518 msgid "" "If you specify a level value, the logger's level is set to that value in the " "scope of the with block covered by the context manager. If you specify a " @@ -4839,7 +1905,7 @@ msgstr "" "マネージャに指示することもできます - そのハンドラがそれ以降必要無いのであれば" "クローズしてしまって構いません。" -#: ../../howto/logging-cookbook.rst:3370 +#: ../../howto/logging-cookbook.rst:2524 msgid "" "To illustrate how it works, we can add the following block of code to the " "above::" @@ -4847,27 +1913,7 @@ msgstr "" "どのように動作するのかを示すためには、次のコード群を上のコードに付け加えると" "よいです::" -#: ../../howto/logging-cookbook.rst:3373 -msgid "" -"if __name__ == '__main__':\n" -" logger = logging.getLogger('foo')\n" -" logger.addHandler(logging.StreamHandler())\n" -" logger.setLevel(logging.INFO)\n" -" logger.info('1. This should appear just once on stderr.')\n" -" logger.debug('2. This should not appear.')\n" -" with LoggingContext(logger, level=logging.DEBUG):\n" -" logger.debug('3. This should appear once on stderr.')\n" -" logger.debug('4. This should not appear.')\n" -" h = logging.StreamHandler(sys.stdout)\n" -" with LoggingContext(logger, level=logging.DEBUG, handler=h, " -"close=True):\n" -" logger.debug('5. This should appear twice - once on stderr and once " -"on stdout.')\n" -" logger.info('6. This should appear just once on stderr.')\n" -" logger.debug('7. This should not appear.')" -msgstr "" - -#: ../../howto/logging-cookbook.rst:3388 +#: ../../howto/logging-cookbook.rst:2542 msgid "" "We initially set the logger's level to ``INFO``, so message #1 appears and " "message #2 doesn't. We then change the level to ``DEBUG`` temporarily in the " @@ -4892,21 +1938,11 @@ msgstr "" "``with`` 文が完了すると、前の状態になるので (メッセージ #1 のように) メッセー" "ジ #6 が現れ、(まさにメッセージ #2 のように) メッセージ #7 は現れません。" -#: ../../howto/logging-cookbook.rst:3398 +#: ../../howto/logging-cookbook.rst:2552 msgid "If we run the resulting script, the result is as follows:" msgstr "出来上がったスクリプトを実行すると、結果は次のようになります::" -#: ../../howto/logging-cookbook.rst:3400 -msgid "" -"$ python logctx.py\n" -"1. This should appear just once on stderr.\n" -"3. This should appear once on stderr.\n" -"5. This should appear twice - once on stderr and once on stdout.\n" -"5. This should appear twice - once on stderr and once on stdout.\n" -"6. This should appear just once on stderr." -msgstr "" - -#: ../../howto/logging-cookbook.rst:3409 +#: ../../howto/logging-cookbook.rst:2563 msgid "" "If we run it again, but pipe ``stderr`` to ``/dev/null``, we see the " "following, which is the only message written to ``stdout``:" @@ -4914,28 +1950,13 @@ msgstr "" "``stderr`` を ``/dev/null`` へパイプした状態でもう一度実行すると、次のように" "なり、これは ``stdout`` の方に書かれたメッセージだけが現れています:" -#: ../../howto/logging-cookbook.rst:3412 -msgid "" -"$ python logctx.py 2>/dev/null\n" -"5. This should appear twice - once on stderr and once on stdout." -msgstr "" - -#: ../../howto/logging-cookbook.rst:3417 +#: ../../howto/logging-cookbook.rst:2571 msgid "Once again, but piping ``stdout`` to ``/dev/null``, we get:" msgstr "" "``stdout`` を ``/dev/null`` へパイプした状態でさらにもう一度実行すると、こう" "なります:" -#: ../../howto/logging-cookbook.rst:3419 -msgid "" -"$ python logctx.py >/dev/null\n" -"1. This should appear just once on stderr.\n" -"3. This should appear once on stderr.\n" -"5. This should appear twice - once on stderr and once on stdout.\n" -"6. This should appear just once on stderr." -msgstr "" - -#: ../../howto/logging-cookbook.rst:3427 +#: ../../howto/logging-cookbook.rst:2581 msgid "" "In this case, the message #5 printed to ``stdout`` doesn't appear, as " "expected." @@ -4943,7 +1964,7 @@ msgstr "" "この場合では、 ``stdout`` の方に出力されたメッセージ #5 は予想通り現れませ" "ん。" -#: ../../howto/logging-cookbook.rst:3429 +#: ../../howto/logging-cookbook.rst:2583 msgid "" "Of course, the approach described here can be generalised, for example to " "attach logging filters temporarily. Note that the above code works in Python " @@ -4953,19 +1974,19 @@ msgstr "" "するのに一般化できます。\n" "上のコードは Python 2 だけでなく Python 3 でも動くことに注意してください。" -#: ../../howto/logging-cookbook.rst:3437 +#: ../../howto/logging-cookbook.rst:2591 msgid "A CLI application starter template" msgstr "CLIアプリケーションスターターテンプレート" -#: ../../howto/logging-cookbook.rst:3439 +#: ../../howto/logging-cookbook.rst:2593 msgid "Here's an example which shows how you can:" msgstr "ここのサンプルでは次のことを説明します:" -#: ../../howto/logging-cookbook.rst:3441 +#: ../../howto/logging-cookbook.rst:2595 msgid "Use a logging level based on command-line arguments" msgstr "コマンドライン引数に応じてログレベルを使用する" -#: ../../howto/logging-cookbook.rst:3442 +#: ../../howto/logging-cookbook.rst:2596 msgid "" "Dispatch to multiple subcommands in separate files, all logging at the same " "level in a consistent way" @@ -4973,11 +1994,11 @@ msgstr "" "複数のファイルに分割されたサブコマンドにディスパッチする。すべて一貫して同じ" "レベルでログ出力を行う" -#: ../../howto/logging-cookbook.rst:3444 +#: ../../howto/logging-cookbook.rst:2598 msgid "Make use of simple, minimal configuration" msgstr "シンプルで最小限の設定で行えるようにする" -#: ../../howto/logging-cookbook.rst:3446 +#: ../../howto/logging-cookbook.rst:2600 msgid "" "Suppose we have a command-line application whose job is to stop, start or " "restart some services. This could be organised for the purposes of " @@ -4994,54 +2015,7 @@ msgstr "" "ライン引数を使ってアプリケーションのログの冗長性を制御したいとします。 ``app." "py`` は次のコードのようになるでしょう::" -#: ../../howto/logging-cookbook.rst:3454 -msgid "" -"import argparse\n" -"import importlib\n" -"import logging\n" -"import os\n" -"import sys\n" -"\n" -"def main(args=None):\n" -" scriptname = os.path.basename(__file__)\n" -" parser = argparse.ArgumentParser(scriptname)\n" -" levels = ('DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL')\n" -" parser.add_argument('--log-level', default='INFO', choices=levels)\n" -" subparsers = parser.add_subparsers(dest='command',\n" -" help='Available commands:')\n" -" start_cmd = subparsers.add_parser('start', help='Start a service')\n" -" start_cmd.add_argument('name', metavar='NAME',\n" -" help='Name of service to start')\n" -" stop_cmd = subparsers.add_parser('stop',\n" -" help='Stop one or more services')\n" -" stop_cmd.add_argument('names', metavar='NAME', nargs='+',\n" -" help='Name of service to stop')\n" -" restart_cmd = subparsers.add_parser('restart',\n" -" help='Restart one or more " -"services')\n" -" restart_cmd.add_argument('names', metavar='NAME', nargs='+',\n" -" help='Name of service to restart')\n" -" options = parser.parse_args()\n" -" # the code to dispatch commands could all be in this file. For the " -"purposes\n" -" # of illustration only, we implement each command in a separate module.\n" -" try:\n" -" mod = importlib.import_module(options.command)\n" -" cmd = getattr(mod, 'command')\n" -" except (ImportError, AttributeError):\n" -" print('Unable to find the code for command \\'%s\\'' % options." -"command)\n" -" return 1\n" -" # Could get fancy here and load configuration from file or dictionary\n" -" logging.basicConfig(level=options.log_level,\n" -" format='%(levelname)s %(name)s %(message)s')\n" -" cmd(options)\n" -"\n" -"if __name__ == '__main__':\n" -" sys.exit(main())" -msgstr "" - -#: ../../howto/logging-cookbook.rst:3495 +#: ../../howto/logging-cookbook.rst:2649 msgid "" "And the ``start``, ``stop`` and ``restart`` commands can be implemented in " "separate modules, like so for starting::" @@ -5049,72 +2023,15 @@ msgstr "" "``start`` 、 ``stop`` 、 ``restart`` コマンドは個別のモジュールとして実装され" "ます。次は起動コマンドのソースです::" -#: ../../howto/logging-cookbook.rst:3498 -msgid "" -"# start.py\n" -"import logging\n" -"\n" -"logger = logging.getLogger(__name__)\n" -"\n" -"def command(options):\n" -" logger.debug('About to start %s', options.name)\n" -" # actually do the command processing here ...\n" -" logger.info('Started the \\'%s\\' service.', options.name)" -msgstr "" - -#: ../../howto/logging-cookbook.rst:3508 +#: ../../howto/logging-cookbook.rst:2662 msgid "and thus for stopping::" msgstr "停止コマンドのソースは次の通りです::" -#: ../../howto/logging-cookbook.rst:3510 -msgid "" -"# stop.py\n" -"import logging\n" -"\n" -"logger = logging.getLogger(__name__)\n" -"\n" -"def command(options):\n" -" n = len(options.names)\n" -" if n == 1:\n" -" plural = ''\n" -" services = '\\'%s\\'' % options.names[0]\n" -" else:\n" -" plural = 's'\n" -" services = ', '.join('\\'%s\\'' % name for name in options.names)\n" -" i = services.rfind(', ')\n" -" services = services[:i] + ' and ' + services[i + 2:]\n" -" logger.debug('About to stop %s', services)\n" -" # actually do the command processing here ...\n" -" logger.info('Stopped the %s service%s.', services, plural)" -msgstr "" - -#: ../../howto/logging-cookbook.rst:3529 +#: ../../howto/logging-cookbook.rst:2683 msgid "and similarly for restarting::" msgstr "同様に、再起動のコマンドは次の通りです::" -#: ../../howto/logging-cookbook.rst:3531 -msgid "" -"# restart.py\n" -"import logging\n" -"\n" -"logger = logging.getLogger(__name__)\n" -"\n" -"def command(options):\n" -" n = len(options.names)\n" -" if n == 1:\n" -" plural = ''\n" -" services = '\\'%s\\'' % options.names[0]\n" -" else:\n" -" plural = 's'\n" -" services = ', '.join('\\'%s\\'' % name for name in options.names)\n" -" i = services.rfind(', ')\n" -" services = services[:i] + ' and ' + services[i + 2:]\n" -" logger.debug('About to restart %s', services)\n" -" # actually do the command processing here ...\n" -" logger.info('Restarted the %s service%s.', services, plural)" -msgstr "" - -#: ../../howto/logging-cookbook.rst:3550 +#: ../../howto/logging-cookbook.rst:2704 msgid "" "If we run this application with the default log level, we get output like " "this:" @@ -5122,19 +2039,7 @@ msgstr "" "このアプリケーションをデフォルトのログレベルで実行すると、次のような出力が得" "られます:" -#: ../../howto/logging-cookbook.rst:3552 -msgid "" -"$ python app.py start foo\n" -"INFO start Started the 'foo' service.\n" -"\n" -"$ python app.py stop foo bar\n" -"INFO stop Stopped the 'foo' and 'bar' services.\n" -"\n" -"$ python app.py restart foo bar baz\n" -"INFO restart Restarted the 'foo', 'bar' and 'baz' services." -msgstr "" - -#: ../../howto/logging-cookbook.rst:3563 +#: ../../howto/logging-cookbook.rst:2717 msgid "" "The first word is the logging level, and the second word is the module or " "package name of the place where the event was logged." @@ -5142,7 +2047,7 @@ msgstr "" "最初のワードはログレベルで、次のワードはイベントのログ出力が行われたモジュー" "ルまたはパッケージ名です。" -#: ../../howto/logging-cookbook.rst:3566 +#: ../../howto/logging-cookbook.rst:2720 msgid "" "If we change the logging level, then we can change the information sent to " "the log. For example, if we want more information:" @@ -5150,51 +2055,34 @@ msgstr "" "ログレベルを変更し、ログに出力する情報を変更できるようにしましょう。もし、よ" "り詳細な情報が必要だとしましょう:" -#: ../../howto/logging-cookbook.rst:3569 -msgid "" -"$ python app.py --log-level DEBUG start foo\n" -"DEBUG start About to start foo\n" -"INFO start Started the 'foo' service.\n" -"\n" -"$ python app.py --log-level DEBUG stop foo bar\n" -"DEBUG stop About to stop 'foo' and 'bar'\n" -"INFO stop Stopped the 'foo' and 'bar' services.\n" -"\n" -"$ python app.py --log-level DEBUG restart foo bar baz\n" -"DEBUG restart About to restart 'foo', 'bar' and 'baz'\n" -"INFO restart Restarted the 'foo', 'bar' and 'baz' services." -msgstr "" - -#: ../../howto/logging-cookbook.rst:3583 +#: ../../howto/logging-cookbook.rst:2737 msgid "And if we want less:" msgstr "あるいは情報を減らしたい場合もあるでしょう:" -#: ../../howto/logging-cookbook.rst:3585 -msgid "" -"$ python app.py --log-level WARNING start foo\n" -"$ python app.py --log-level WARNING stop foo bar\n" -"$ python app.py --log-level WARNING restart foo bar baz" -msgstr "" - -#: ../../howto/logging-cookbook.rst:3591 +#: ../../howto/logging-cookbook.rst:2745 msgid "" "In this case, the commands don't print anything to the console, since " "nothing at ``WARNING`` level or above is logged by them." msgstr "この場合、コマンドはコンソールに何も出力しなくなります。" -#: ../../howto/logging-cookbook.rst:3597 +#: ../../howto/logging-cookbook.rst:2751 msgid "A Qt GUI for logging" msgstr "Qt GUIのログ出力" -#: ../../howto/logging-cookbook.rst:3599 +#: ../../howto/logging-cookbook.rst:2753 msgid "" "A question that comes up from time to time is about how to log to a GUI " "application. The `Qt `_ framework is a popular cross-" -"platform UI framework with Python bindings using :pypi:`PySide2` or :pypi:" -"`PyQt5` libraries." +"platform UI framework with Python bindings using `PySide2 `_ or `PyQt5 `_ libraries." msgstr "" +"時々される質問が、GUIアプリケーションでどのようにログ出力を行うかです。 `Qt " +"`_ フレームワークは人気のあるクロスプラットフォームのUIフ" +"レームワークです。Pythonでは `PySide2 `_ " +"や `PyQt5 `_ といったバインディングを使いま" +"す。" -#: ../../howto/logging-cookbook.rst:3604 +#: ../../howto/logging-cookbook.rst:2759 msgid "" "The following example shows how to log to a Qt GUI. This introduces a simple " "``QtHandler`` class which takes a callable, which should be a slot in the " @@ -5210,7 +2098,7 @@ msgstr "" "ンドのタスクを行うワーカースレッドからログ出力を行います(ここではランダムな" "期間にランダムなレベルでメッセージを出しています)。" -#: ../../howto/logging-cookbook.rst:3611 +#: ../../howto/logging-cookbook.rst:2766 msgid "" "The worker thread is implemented using Qt's ``QThread`` class rather than " "the :mod:`threading` module, as there are circumstances where one has to use " @@ -5220,596 +2108,22 @@ msgstr "" "スを使っています。これは他の ``Qt`` コンポーネントとうまく統合できるように、 " "``QThread`` を使う必要があるからです。" -#: ../../howto/logging-cookbook.rst:3615 -msgid "" -"The code should work with recent releases of any of ``PySide6``, ``PyQt6``, " -"``PySide2`` or ``PyQt5``. You should be able to adapt the approach to " -"earlier versions of Qt. Please refer to the comments in the code snippet for " -"more detailed information." -msgstr "" - -#: ../../howto/logging-cookbook.rst:3620 -msgid "" -"import datetime\n" -"import logging\n" -"import random\n" -"import sys\n" -"import time\n" -"\n" -"# Deal with minor differences between different Qt packages\n" -"try:\n" -" from PySide6 import QtCore, QtGui, QtWidgets\n" -" Signal = QtCore.Signal\n" -" Slot = QtCore.Slot\n" -"except ImportError:\n" -" try:\n" -" from PyQt6 import QtCore, QtGui, QtWidgets\n" -" Signal = QtCore.pyqtSignal\n" -" Slot = QtCore.pyqtSlot\n" -" except ImportError:\n" -" try:\n" -" from PySide2 import QtCore, QtGui, QtWidgets\n" -" Signal = QtCore.Signal\n" -" Slot = QtCore.Slot\n" -" except ImportError:\n" -" from PyQt5 import QtCore, QtGui, QtWidgets\n" -" Signal = QtCore.pyqtSignal\n" -" Slot = QtCore.pyqtSlot\n" -"\n" -"logger = logging.getLogger(__name__)\n" -"\n" -"\n" -"#\n" -"# Signals need to be contained in a QObject or subclass in order to be " -"correctly\n" -"# initialized.\n" -"#\n" -"class Signaller(QtCore.QObject):\n" -" signal = Signal(str, logging.LogRecord)\n" -"\n" -"#\n" -"# Output to a Qt GUI is only supposed to happen on the main thread. So, " -"this\n" -"# handler is designed to take a slot function which is set up to run in the " -"main\n" -"# thread. In this example, the function takes a string argument which is a\n" -"# formatted log message, and the log record which generated it. The " -"formatted\n" -"# string is just a convenience - you could format a string for output any " -"way\n" -"# you like in the slot function itself.\n" -"#\n" -"# You specify the slot function to do whatever GUI updates you want. The " -"handler\n" -"# doesn't know or care about specific UI elements.\n" -"#\n" -"class QtHandler(logging.Handler):\n" -" def __init__(self, slotfunc, *args, **kwargs):\n" -" super().__init__(*args, **kwargs)\n" -" self.signaller = Signaller()\n" -" self.signaller.signal.connect(slotfunc)\n" -"\n" -" def emit(self, record):\n" -" s = self.format(record)\n" -" self.signaller.signal.emit(s, record)\n" -"\n" -"#\n" -"# This example uses QThreads, which means that the threads at the Python " -"level\n" -"# are named something like \"Dummy-1\". The function below gets the Qt name " -"of the\n" -"# current thread.\n" -"#\n" -"def ctname():\n" -" return QtCore.QThread.currentThread().objectName()\n" -"\n" -"\n" -"#\n" -"# Used to generate random levels for logging.\n" -"#\n" -"LEVELS = (logging.DEBUG, logging.INFO, logging.WARNING, logging.ERROR,\n" -" logging.CRITICAL)\n" -"\n" -"#\n" -"# This worker class represents work that is done in a thread separate to " -"the\n" -"# main thread. The way the thread is kicked off to do work is via a button " -"press\n" -"# that connects to a slot in the worker.\n" -"#\n" -"# Because the default threadName value in the LogRecord isn't much use, we " -"add\n" -"# a qThreadName which contains the QThread name as computed above, and pass " -"that\n" -"# value in an \"extra\" dictionary which is used to update the LogRecord " -"with the\n" -"# QThread name.\n" -"#\n" -"# This example worker just outputs messages sequentially, interspersed with\n" -"# random delays of the order of a few seconds.\n" -"#\n" -"class Worker(QtCore.QObject):\n" -" @Slot()\n" -" def start(self):\n" -" extra = {'qThreadName': ctname() }\n" -" logger.debug('Started work', extra=extra)\n" -" i = 1\n" -" # Let the thread run until interrupted. This allows reasonably " -"clean\n" -" # thread termination.\n" -" while not QtCore.QThread.currentThread().isInterruptionRequested():\n" -" delay = 0.5 + random.random() * 2\n" -" time.sleep(delay)\n" -" try:\n" -" if random.random() < 0.1:\n" -" raise ValueError('Exception raised: %d' % i)\n" -" else:\n" -" level = random.choice(LEVELS)\n" -" logger.log(level, 'Message after delay of %3.1f: %d', " -"delay, i, extra=extra)\n" -" except ValueError as e:\n" -" logger.exception('Failed: %s', e, extra=extra)\n" -" i += 1\n" -"\n" -"#\n" -"# Implement a simple UI for this cookbook example. This contains:\n" -"#\n" -"# * A read-only text edit window which holds formatted log messages\n" -"# * A button to start work and log stuff in a separate thread\n" -"# * A button to log something from the main thread\n" -"# * A button to clear the log window\n" -"#\n" -"class Window(QtWidgets.QWidget):\n" -"\n" -" COLORS = {\n" -" logging.DEBUG: 'black',\n" -" logging.INFO: 'blue',\n" -" logging.WARNING: 'orange',\n" -" logging.ERROR: 'red',\n" -" logging.CRITICAL: 'purple',\n" -" }\n" -"\n" -" def __init__(self, app):\n" -" super().__init__()\n" -" self.app = app\n" -" self.textedit = te = QtWidgets.QPlainTextEdit(self)\n" -" # Set whatever the default monospace font is for the platform\n" -" f = QtGui.QFont('nosuchfont')\n" -" if hasattr(f, 'Monospace'):\n" -" f.setStyleHint(f.Monospace)\n" -" else:\n" -" f.setStyleHint(f.StyleHint.Monospace) # for Qt6\n" -" te.setFont(f)\n" -" te.setReadOnly(True)\n" -" PB = QtWidgets.QPushButton\n" -" self.work_button = PB('Start background work', self)\n" -" self.log_button = PB('Log a message at a random level', self)\n" -" self.clear_button = PB('Clear log window', self)\n" -" self.handler = h = QtHandler(self.update_status)\n" -" # Remember to use qThreadName rather than threadName in the format " -"string.\n" -" fs = '%(asctime)s %(qThreadName)-12s %(levelname)-8s %(message)s'\n" -" formatter = logging.Formatter(fs)\n" -" h.setFormatter(formatter)\n" -" logger.addHandler(h)\n" -" # Set up to terminate the QThread when we exit\n" -" app.aboutToQuit.connect(self.force_quit)\n" -"\n" -" # Lay out all the widgets\n" -" layout = QtWidgets.QVBoxLayout(self)\n" -" layout.addWidget(te)\n" -" layout.addWidget(self.work_button)\n" -" layout.addWidget(self.log_button)\n" -" layout.addWidget(self.clear_button)\n" -" self.setFixedSize(900, 400)\n" -"\n" -" # Connect the non-worker slots and signals\n" -" self.log_button.clicked.connect(self.manual_update)\n" -" self.clear_button.clicked.connect(self.clear_display)\n" -"\n" -" # Start a new worker thread and connect the slots for the worker\n" -" self.start_thread()\n" -" self.work_button.clicked.connect(self.worker.start)\n" -" # Once started, the button should be disabled\n" -" self.work_button.clicked.connect(lambda : self.work_button." -"setEnabled(False))\n" -"\n" -" def start_thread(self):\n" -" self.worker = Worker()\n" -" self.worker_thread = QtCore.QThread()\n" -" self.worker.setObjectName('Worker')\n" -" self.worker_thread.setObjectName('WorkerThread') # for qThreadName\n" -" self.worker.moveToThread(self.worker_thread)\n" -" # This will start an event loop in the worker thread\n" -" self.worker_thread.start()\n" -"\n" -" def kill_thread(self):\n" -" # Just tell the worker to stop, then tell it to quit and wait for " -"that\n" -" # to happen\n" -" self.worker_thread.requestInterruption()\n" -" if self.worker_thread.isRunning():\n" -" self.worker_thread.quit()\n" -" self.worker_thread.wait()\n" -" else:\n" -" print('worker has already exited.')\n" -"\n" -" def force_quit(self):\n" -" # For use when the window is closed\n" -" if self.worker_thread.isRunning():\n" -" self.kill_thread()\n" -"\n" -" # The functions below update the UI and run in the main thread because\n" -" # that's where the slots are set up\n" -"\n" -" @Slot(str, logging.LogRecord)\n" -" def update_status(self, status, record):\n" -" color = self.COLORS.get(record.levelno, 'black')\n" -" s = '
%s
' % (color, status)\n" -" self.textedit.appendHtml(s)\n" -"\n" -" @Slot()\n" -" def manual_update(self):\n" -" # This function uses the formatted message passed in, but also uses\n" -" # information from the record to format the message in an " -"appropriate\n" -" # color according to its severity (level).\n" -" level = random.choice(LEVELS)\n" -" extra = {'qThreadName': ctname() }\n" -" logger.log(level, 'Manually logged!', extra=extra)\n" -"\n" -" @Slot()\n" -" def clear_display(self):\n" -" self.textedit.clear()\n" -"\n" -"\n" -"def main():\n" -" QtCore.QThread.currentThread().setObjectName('MainThread')\n" -" logging.getLogger().setLevel(logging.DEBUG)\n" -" app = QtWidgets.QApplication(sys.argv)\n" -" example = Window(app)\n" -" example.show()\n" -" if hasattr(app, 'exec'):\n" -" rc = app.exec()\n" -" else:\n" -" rc = app.exec_()\n" -" sys.exit(rc)\n" -"\n" -"if __name__=='__main__':\n" -" main()" -msgstr "" - -#: ../../howto/logging-cookbook.rst:3852 -msgid "Logging to syslog with RFC5424 support" -msgstr "RFC5424 をサポートする syslog へのロギング" - -#: ../../howto/logging-cookbook.rst:3854 -msgid "" -"Although :rfc:`5424` dates from 2009, most syslog servers are configured by " -"default to use the older :rfc:`3164`, which hails from 2001. When " -"``logging`` was added to Python in 2003, it supported the earlier (and only " -"existing) protocol at the time. Since RFC5424 came out, as there has not " -"been widespread deployment of it in syslog servers, the :class:`~logging." -"handlers.SysLogHandler` functionality has not been updated." -msgstr "" -":rfc:`5424` は 2009 年から始まっていますが、ほとんどの syslog サーバーはデ" -"フォルトで、 2001 年から使われている古い :rfc:`3164` を使って構成されていま" -"す。2003年に ``logging`` モジュールが Python に追加されたとき、モジュールは古" -"い (そして当時唯一存在した) プロトコルをサポートしていました。 RFC5424 は、そ" -"れが登場して以来、 syslog サーバーにおいて広く使われることがなかったため" -"に、 :class:`~logging.handlers.SysLogHandler` の機能は更新されてきませんでし" -"た。" - -#: ../../howto/logging-cookbook.rst:3861 -msgid "" -"RFC 5424 contains some useful features such as support for structured data, " -"and if you need to be able to log to a syslog server with support for it, " -"you can do so with a subclassed handler which looks something like this::" -msgstr "" -"RFC 5424 は構造化データのサポートなど、いくつかの有用な機能を持っています。そ" -"の機能をサポートする syslog サーバーへのロギングを可能にする必要がある場合、" -"以下のような派生ハンドラクラスを使うことで実現することができます::" - -#: ../../howto/logging-cookbook.rst:3865 -msgid "" -"import datetime\n" -"import logging.handlers\n" -"import re\n" -"import socket\n" -"import time\n" -"\n" -"class SysLogHandler5424(logging.handlers.SysLogHandler):\n" -"\n" -" tz_offset = re.compile(r'([+-]\\d{2})(\\d{2})$')\n" -" escaped = re.compile(r'([\\]\"\\\\])')\n" -"\n" -" def __init__(self, *args, **kwargs):\n" -" self.msgid = kwargs.pop('msgid', None)\n" -" self.appname = kwargs.pop('appname', None)\n" -" super().__init__(*args, **kwargs)\n" -"\n" -" def format(self, record):\n" -" version = 1\n" -" asctime = datetime.datetime.fromtimestamp(record.created)." -"isoformat()\n" -" m = self.tz_offset.match(time.strftime('%z'))\n" -" has_offset = False\n" -" if m and time.timezone:\n" -" hrs, mins = m.groups()\n" -" if int(hrs) or int(mins):\n" -" has_offset = True\n" -" if not has_offset:\n" -" asctime += 'Z'\n" -" else:\n" -" asctime += f'{hrs}:{mins}'\n" -" try:\n" -" hostname = socket.gethostname()\n" -" except Exception:\n" -" hostname = '-'\n" -" appname = self.appname or '-'\n" -" procid = record.process\n" -" msgid = '-'\n" -" msg = super().format(record)\n" -" sdata = '-'\n" -" if hasattr(record, 'structured_data'):\n" -" sd = record.structured_data\n" -" # This should be a dict where the keys are SD-ID and the value " -"is a\n" -" # dict mapping PARAM-NAME to PARAM-VALUE (refer to the RFC for " -"what these\n" -" # mean)\n" -" # There's no error checking here - it's purely for illustration, " -"and you\n" -" # can adapt this code for use in production environments\n" -" parts = []\n" -"\n" -" def replacer(m):\n" -" g = m.groups()\n" -" return '\\\\' + g[0]\n" -"\n" -" for sdid, dv in sd.items():\n" -" part = f'[{sdid}'\n" -" for k, v in dv.items():\n" -" s = str(v)\n" -" s = self.escaped.sub(replacer, s)\n" -" part += f' {k}=\"{s}\"'\n" -" part += ']'\n" -" parts.append(part)\n" -" sdata = ''.join(parts)\n" -" return f'{version} {asctime} {hostname} {appname} {procid} {msgid} " -"{sdata} {msg}'" -msgstr "" - -#: ../../howto/logging-cookbook.rst:3927 -msgid "" -"You'll need to be familiar with RFC 5424 to fully understand the above code, " -"and it may be that you have slightly different needs (e.g. for how you pass " -"structural data to the log). Nevertheless, the above should be adaptable to " -"your speciric needs. With the above handler, you'd pass structured data " -"using something like this::" -msgstr "" -"上記のコードを完全に理解するには RFC 5424 を熟知する必要があります。また、上" -"記の例とはやや異なる要求を持つこともあるでしょう (たとえば構造化データをログ" -"に渡す方法について)。にもかかわらず、上記のコードは特有の要求に対する順応性が" -"あります。上記のハンドラにより、構造化データは以下のように渡すことができるで" -"しょう::" - -#: ../../howto/logging-cookbook.rst:3932 -msgid "" -"sd = {\n" -" 'foo@12345': {'bar': 'baz', 'baz': 'bozz', 'fizz': r'buzz'},\n" -" 'foo@54321': {'rab': 'baz', 'zab': 'bozz', 'zzif': r'buzz'}\n" -"}\n" -"extra = {'structured_data': sd}\n" -"i = 1\n" -"logger.debug('Message %d', i, extra=extra)" -msgstr "" - -#: ../../howto/logging-cookbook.rst:3941 -msgid "How to treat a logger like an output stream" -msgstr "ロガーを出力ストリームのように取り扱う方法" - -#: ../../howto/logging-cookbook.rst:3943 -msgid "" -"Sometimes, you need to interface to a third-party API which expects a file-" -"like object to write to, but you want to direct the API's output to a " -"logger. You can do this using a class which wraps a logger with a file-like " -"API. Here's a short script illustrating such a class:" -msgstr "" -"書き込み先として file-like オブジェクトを期待するサードパーティの API に接続" -"する必要がある一方で、その API の出力を直接ロガーに送りたいということがときど" -"きあります。これは file-like な API でロガーをラップするクラスを使うことで実" -"現できます。以下はそのようなクラスを例解する短いスクリプトです:" - -#: ../../howto/logging-cookbook.rst:3948 -msgid "" -"import logging\n" -"\n" -"class LoggerWriter:\n" -" def __init__(self, logger, level):\n" -" self.logger = logger\n" -" self.level = level\n" -"\n" -" def write(self, message):\n" -" if message != '\\n': # avoid printing bare newlines, if you like\n" -" self.logger.log(self.level, message)\n" -"\n" -" def flush(self):\n" -" # doesn't actually do anything, but might be expected of a file-" -"like\n" -" # object - so optional depending on your situation\n" -" pass\n" -"\n" -" def close(self):\n" -" # doesn't actually do anything, but might be expected of a file-" -"like\n" -" # object - so optional depending on your situation. You might want\n" -" # to set a flag so that later calls to write raise an exception\n" -" pass\n" -"\n" -"def main():\n" -" logging.basicConfig(level=logging.DEBUG)\n" -" logger = logging.getLogger('demo')\n" -" info_fp = LoggerWriter(logger, logging.INFO)\n" -" debug_fp = LoggerWriter(logger, logging.DEBUG)\n" -" print('An INFO message', file=info_fp)\n" -" print('A DEBUG message', file=debug_fp)\n" -"\n" -"if __name__ == \"__main__\":\n" -" main()" -msgstr "" - -#: ../../howto/logging-cookbook.rst:3983 -msgid "When this script is run, it prints" -msgstr "このスクリプトを実行すると、次のように出力されます。" - -#: ../../howto/logging-cookbook.rst:3985 -msgid "" -"INFO:demo:An INFO message\n" -"DEBUG:demo:A DEBUG message" -msgstr "" - -#: ../../howto/logging-cookbook.rst:3990 -msgid "" -"You could also use ``LoggerWriter`` to redirect ``sys.stdout`` and ``sys." -"stderr`` by doing something like this:" -msgstr "" -"また、 ``sys.stdout`` や ``sys.stderr`` をリダイレクトするには " -"``LoggerWriter`` を使って以下のようにします:" - -#: ../../howto/logging-cookbook.rst:3993 -msgid "" -"import sys\n" -"\n" -"sys.stdout = LoggerWriter(logger, logging.INFO)\n" -"sys.stderr = LoggerWriter(logger, logging.WARNING)" -msgstr "" - -#: ../../howto/logging-cookbook.rst:4000 -msgid "" -"You should do this *after* configuring logging for your needs. In the above " -"example, the :func:`~logging.basicConfig` call does this (using the ``sys." -"stderr`` value *before* it is overwritten by a ``LoggerWriter`` instance). " -"Then, you'd get this kind of result:" -msgstr "" -"上記の操作は、必要に応じてロギングを設定した *後に* 行うべきです。上記の例で" -"は、 :func:`~logging.basicConfig` の呼び出しが (``LoggerWriter`` インスタンス" -"で上書きされる *前の* ``sys.stderr`` を使って) 設定を行います。そして、以下の" -"ような結果を得るでしょう:" - -#: ../../howto/logging-cookbook.rst:4005 -msgid "" -">>> print('Foo')\n" -"INFO:demo:Foo\n" -">>> print('Bar', file=sys.stderr)\n" -"WARNING:demo:Bar\n" -">>>" -msgstr "" - -#: ../../howto/logging-cookbook.rst:4013 -msgid "" -"Of course, the examples above show output according to the format used by :" -"func:`~logging.basicConfig`, but you can use a different formatter when you " -"configure logging." -msgstr "" -"言うまでもなく上記の例は :func:`~logging.basicConfig` で使われている書式にも" -"とづく出力を示していますが、ロギングの設定で異なるフォーマッタを使うことがで" -"きます。" - -#: ../../howto/logging-cookbook.rst:4017 -msgid "" -"Note that with the above scheme, you are somewhat at the mercy of buffering " -"and the sequence of write calls which you are intercepting. For example, " -"with the definition of ``LoggerWriter`` above, if you have the snippet" -msgstr "" -"上記の例では、バッファリングや奪取した書き込み呼び出しのシーケンスの扱いにつ" -"いてはなすがままになっています。たとえば、上記の ``LoggerWriter`` の定義で、" -"次のようなコードの断片があったとします。" - -#: ../../howto/logging-cookbook.rst:4021 -msgid "" -"sys.stderr = LoggerWriter(logger, logging.WARNING)\n" -"1 / 0" -msgstr "" - -#: ../../howto/logging-cookbook.rst:4026 -msgid "then running the script results in" -msgstr "このスクリプトを実行すると以下のような結果が得られます。" - -#: ../../howto/logging-cookbook.rst:4028 -msgid "" -"WARNING:demo:Traceback (most recent call last):\n" -"\n" -"WARNING:demo: File \"/home/runner/cookbook-loggerwriter/test.py\", line 53, " -"in \n" -"\n" -"WARNING:demo:\n" -"WARNING:demo:main()\n" -"WARNING:demo: File \"/home/runner/cookbook-loggerwriter/test.py\", line 49, " -"in main\n" -"\n" -"WARNING:demo:\n" -"WARNING:demo:1 / 0\n" -"WARNING:demo:ZeroDivisionError\n" -"WARNING:demo::\n" -"WARNING:demo:division by zero" -msgstr "" - -#: ../../howto/logging-cookbook.rst:4044 -msgid "" -"As you can see, this output isn't ideal. That's because the underlying code " -"which writes to ``sys.stderr`` makes multiple writes, each of which results " -"in a separate logged line (for example, the last three lines above). To get " -"around this problem, you need to buffer things and only output log lines " -"when newlines are seen. Let's use a slightly better implementation of " -"``LoggerWriter``:" -msgstr "" - -#: ../../howto/logging-cookbook.rst:4050 -msgid "" -"class BufferingLoggerWriter(LoggerWriter):\n" -" def __init__(self, logger, level):\n" -" super().__init__(logger, level)\n" -" self.buffer = ''\n" -"\n" -" def write(self, message):\n" -" if '\\n' not in message:\n" -" self.buffer += message\n" -" else:\n" -" parts = message.split('\\n')\n" -" if self.buffer:\n" -" s = self.buffer + parts.pop(0)\n" -" self.logger.log(self.level, s)\n" -" self.buffer = parts.pop()\n" -" for part in parts:\n" -" self.logger.log(self.level, part)" -msgstr "" - -#: ../../howto/logging-cookbook.rst:4069 -msgid "" -"This just buffers up stuff until a newline is seen, and then logs complete " -"lines. With this approach, you get better output:" -msgstr "" -"この実装は改行があらわれるまでログをバッファリングし、行全体をログに出力する" -"だけです。このアプローチにより、より適切な出力が得られます:" - -#: ../../howto/logging-cookbook.rst:4072 +#: ../../howto/logging-cookbook.rst:2770 msgid "" -"WARNING:demo:Traceback (most recent call last):\n" -"WARNING:demo: File \"/home/runner/cookbook-loggerwriter/main.py\", line 55, " -"in \n" -"WARNING:demo: main()\n" -"WARNING:demo: File \"/home/runner/cookbook-loggerwriter/main.py\", line 52, " -"in main\n" -"WARNING:demo: 1/0\n" -"WARNING:demo:ZeroDivisionError: division by zero" +"The code should work with recent releases of either ``PySide2`` or " +"``PyQt5``. You should be able to adapt the approach to earlier versions of " +"Qt. Please refer to the comments in the code snippet for more detailed " +"information." msgstr "" +"このコードは最新の ``PySide2`` と ``PyQt5`` のどちらでも動作します。このコー" +"ドは以前のバージョンのQtにも適用できるはずです。詳細はコードスニペットのコメ" +"ントを参照してください。" -#: ../../howto/logging-cookbook.rst:4085 +#: ../../howto/logging-cookbook.rst:2987 msgid "Patterns to avoid" msgstr "避けるべきパターン" -#: ../../howto/logging-cookbook.rst:4087 +#: ../../howto/logging-cookbook.rst:2989 msgid "" "Although the preceding sections have described ways of doing things you " "might need to do or deal with, it is worth mentioning some usage patterns " @@ -5821,11 +2135,11 @@ msgstr "" "れます。これは多くの場合避けるべきことです。これらの説明はどこから読んでも構" "いません。" -#: ../../howto/logging-cookbook.rst:4093 +#: ../../howto/logging-cookbook.rst:2996 msgid "Opening the same log file multiple times" msgstr "同じログファイルを何度も開く" -#: ../../howto/logging-cookbook.rst:4095 +#: ../../howto/logging-cookbook.rst:2998 msgid "" "On Windows, you will generally not be able to open the same file multiple " "times as this will lead to a \"file is in use by another process\" error. " @@ -5837,7 +2151,7 @@ msgstr "" "ではエラーがおきることなく、同じファイルを何度も開けます。これは次のように間" "違って使われる可能性があります。" -#: ../../howto/logging-cookbook.rst:4100 +#: ../../howto/logging-cookbook.rst:3003 msgid "" "Adding a file handler more than once which references the same file (e.g. by " "a copy/paste/forget-to-change error)." @@ -5845,7 +2159,7 @@ msgstr "" "同じファイルを指すファイルハンドラを1度以上追加する(例えばコピー&ペーストし" "て書き換え忘れによるエラー)。" -#: ../../howto/logging-cookbook.rst:4103 +#: ../../howto/logging-cookbook.rst:3006 msgid "" "Opening two files that look different, as they have different names, but are " "the same because one is a symbolic link to the other." @@ -5853,7 +2167,7 @@ msgstr "" "異なる名前を持つ、一見異なる2つのファイルを開くが、片方が他方へのシンボリック" "リンクとなっている。" -#: ../../howto/logging-cookbook.rst:4106 +#: ../../howto/logging-cookbook.rst:3009 msgid "" "Forking a process, following which both parent and child have a reference to " "the same file. This might be through use of the :mod:`multiprocessing` " @@ -5863,7 +2177,7 @@ msgstr "" "を維持する。これは例えば、 :mod:`multiprocessing` モジュールなどを使うと発生" "する可能性があります。" -#: ../../howto/logging-cookbook.rst:4110 +#: ../../howto/logging-cookbook.rst:3013 msgid "" "Opening a file multiple times might *appear* to work most of the time, but " "can lead to a number of problems in practice:" @@ -5871,7 +2185,7 @@ msgstr "" "ファイルを複数回開くことは、 *一見* 動作しているように見えますが、さまざまな" "問題を引き起こす可能性があります:" -#: ../../howto/logging-cookbook.rst:4113 +#: ../../howto/logging-cookbook.rst:3016 msgid "" "Logging output can be garbled because multiple threads or processes try to " "write to the same file. Although logging guards against concurrent use of " @@ -5885,23 +2199,15 @@ msgstr "" "ラーのインスタンスに対し、2つのスレッドから同時に書き込みをした場合にはそのよ" "うな保護は働きません。" -#: ../../howto/logging-cookbook.rst:4119 +#: ../../howto/logging-cookbook.rst:3022 msgid "" "An attempt to delete a file (e.g. during file rotation) silently fails, " "because there is another reference pointing to it. This can lead to " "confusion and wasted debugging time - log entries end up in unexpected " -"places, or are lost altogether. Or a file that was supposed to be moved " -"remains in place, and grows in size unexpectedly despite size-based rotation " -"being supposedly in place." +"places, or are lost altogether." msgstr "" -"(たとえばファイルのローテーションの間に) ファイルを削除しようとすると、その" -"ファイルを指す別の参照が残っているために、何のエラーも発しないまま失敗しま" -"す。これは混乱や不要なデバッグの時間のもととなる可能性があります - ログが思い" -"もしない場所に記録されたり、完全に失われたりします。もしくは移動したと思われ" -"ていたファイルが残っていたり、ファイルサイズにもとづくローテーションが行われ" -"ているにもかかわらずファイルサイズが予想外に増加したりすることもあります。" -#: ../../howto/logging-cookbook.rst:4126 +#: ../../howto/logging-cookbook.rst:3027 msgid "" "Use the techniques outlined in :ref:`multiple-processes` to circumvent such " "issues." @@ -5909,11 +2215,11 @@ msgstr "" "この問題を回避するには :ref:`multiple-processes` で紹介したテクニックを使用し" "てください。" -#: ../../howto/logging-cookbook.rst:4130 +#: ../../howto/logging-cookbook.rst:3031 msgid "Using loggers as attributes in a class or passing them as parameters" msgstr "ロガーをクラスの属性にするか、パラメータで渡す" -#: ../../howto/logging-cookbook.rst:4132 +#: ../../howto/logging-cookbook.rst:3033 msgid "" "While there might be unusual cases where you'll need to do this, in general " "there is no point because loggers are singletons. Code can always access a " @@ -5931,15 +2237,12 @@ msgstr "" "このパターンはクラスではなくモジュールがソフトウェア分解の単位となっているた" "め、無意味です。" -#: ../../howto/logging-cookbook.rst:4141 +#: ../../howto/logging-cookbook.rst:3043 msgid "" -"Adding handlers other than :class:`~logging.NullHandler` to a logger in a " -"library" -msgstr "" -"ライブラリ内でロガーに :class:`~logging.NullHandler` 以外のハンドラーを追加す" -"る" +"Adding handlers other than :class:`NullHandler` to a logger in a library" +msgstr "ライブラリ内でロガーに :class:`NullHandler` 以外のハンドラーを追加する" -#: ../../howto/logging-cookbook.rst:4143 +#: ../../howto/logging-cookbook.rst:3045 msgid "" "Configuring logging by adding handlers, formatters and filters is the " "responsibility of the application developer, not the library developer. If " @@ -5951,11 +2254,11 @@ msgstr "" "イブラリのメンテナンスをしているのであれば、 :class:`~logging.NullHandler` イ" "ンスタンス以外のロガーを追加してはいけない、ということを意味します。" -#: ../../howto/logging-cookbook.rst:4149 +#: ../../howto/logging-cookbook.rst:3052 msgid "Creating a lot of loggers" msgstr "大量のロガーを作成する" -#: ../../howto/logging-cookbook.rst:4151 +#: ../../howto/logging-cookbook.rst:3054 msgid "" "Loggers are singletons that are never freed during a script execution, and " "so creating lots of loggers will use up memory which can't then be freed. " @@ -5971,39 +2274,3 @@ msgstr "" "ム ` を使ってコンテキスト依存の情報をログに渡し、ロガーはアプリ" "ケーション内の説明の単位(通常はモジュールだが、場合によってはそれよりも小さ" "い可能性もある)で作るように制限してください。" - -#: ../../howto/logging-cookbook.rst:4162 -msgid "Other resources" -msgstr "その他のリソース" - -#: ../../howto/logging-cookbook.rst:4166 -msgid "Module :mod:`logging`" -msgstr ":mod:`logging` モジュール" - -#: ../../howto/logging-cookbook.rst:4167 -msgid "API reference for the logging module." -msgstr "logging モジュールの API リファレンス。" - -#: ../../howto/logging-cookbook.rst:4169 -msgid "Module :mod:`logging.config`" -msgstr ":mod:`logging.config` モジュール" - -#: ../../howto/logging-cookbook.rst:4170 -msgid "Configuration API for the logging module." -msgstr "logging モジュールの環境設定 API です。" - -#: ../../howto/logging-cookbook.rst:4172 -msgid "Module :mod:`logging.handlers`" -msgstr ":mod:`logging.handlers` モジュール" - -#: ../../howto/logging-cookbook.rst:4173 -msgid "Useful handlers included with the logging module." -msgstr "logging モジュールに含まれる、便利なハンドラです。" - -#: ../../howto/logging-cookbook.rst:4175 -msgid ":ref:`Basic Tutorial `" -msgstr ":ref:`基本チュートリアル `" - -#: ../../howto/logging-cookbook.rst:4177 -msgid ":ref:`Advanced Tutorial `" -msgstr ":ref:`上級チュートリアル `" diff --git a/howto/logging.po b/howto/logging.po index 8b33e1d78..2f22206e5 100644 --- a/howto/logging.po +++ b/howto/logging.po @@ -1,37 +1,36 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Osamu NAKAMURA, 2021 -# 秘湯 , 2021 -# 渋川よしき , 2022 -# Takanori Suzuki , 2023 -# Takeshi Nakazato, 2023 -# Arihiro TAKASE, 2023 -# tomo, 2023 -# souma987, 2023 -# TENMYO Masakazu, 2024 -# Inada Naoki , 2024 +# E. Kawashima, 2017 +# Osamu NAKAMURA, 2017 +# Inada Naoki , 2017 +# Nozomu Kaneko , 2017 +# Arihiro TAKASE, 2017 +# Mukai Shohei , 2018 +# 秘湯 , 2020 +# tomo, 2020 +# mollinaca, 2021 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:53+0000\n" -"Last-Translator: Inada Naoki , 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 17:45+0000\n" +"Last-Translator: mollinaca, 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: ../../howto/logging.rst:5 +#: ../../howto/logging.rst:3 msgid "Logging HOWTO" msgstr "Logging HOWTO" @@ -39,23 +38,15 @@ msgstr "Logging HOWTO" msgid "Author" msgstr "著者" -#: ../../howto/logging.rst:7 +#: ../../howto/logging.rst:5 msgid "Vinay Sajip " msgstr "Vinay Sajip " -#: ../../howto/logging.rst:13 -msgid "" -"This page contains tutorial information. For links to reference information " -"and a logging cookbook, please see :ref:`tutorial-ref-links`." -msgstr "" -"このページはチュートリアルです。レファレンスやロギングクックブックは、 :ref:" -"`tutorial-ref-links` を参照してください。" - -#: ../../howto/logging.rst:17 +#: ../../howto/logging.rst:12 msgid "Basic Logging Tutorial" msgstr "基本 logging チュートリアル" -#: ../../howto/logging.rst:19 +#: ../../howto/logging.rst:14 msgid "" "Logging is a means of tracking events that happen when some software runs. " "The software's developer adds logging calls to their code to indicate that " @@ -72,38 +63,40 @@ msgstr "" "ることもできます。イベントには、開発者がそのイベントに定めた重要性も含まれま" "す。重要性は、*レベル (level)* や *重大度 (severity)* とも呼ばれます。" -#: ../../howto/logging.rst:28 +#: ../../howto/logging.rst:23 msgid "When to use logging" msgstr "logging を使うとき" -#: ../../howto/logging.rst:30 +#: ../../howto/logging.rst:25 msgid "" -"You can access logging functionality by creating a logger via ``logger = " -"getLogger(__name__)``, and then calling the logger's :meth:`~Logger.debug`, :" -"meth:`~Logger.info`, :meth:`~Logger.warning`, :meth:`~Logger.error` and :" -"meth:`~Logger.critical` methods. To determine when to use logging, and to " -"see which logger methods to use when, see the table below. It states, for " -"each of a set of common tasks, the best tool to use for that task." +"Logging provides a set of convenience functions for simple logging usage. " +"These are :func:`debug`, :func:`info`, :func:`warning`, :func:`error` and :" +"func:`critical`. To determine when to use logging, see the table below, " +"which states, for each of a set of common tasks, the best tool to use for it." msgstr "" +"logging は、単純なロギングの用法に便利な関数群を提供しています。この中に" +"は、 :func:`debug`, :func:`info`, :func:`warning`, :func:`error` および :" +"func:`critical` があります。logging を使うべき時を決めるには、よくあるタスク" +"に使う最適なツールを述べた、以下のテーブルを参照してください。" -#: ../../howto/logging.rst:38 +#: ../../howto/logging.rst:31 msgid "Task you want to perform" msgstr "行いたいタスク" -#: ../../howto/logging.rst:38 +#: ../../howto/logging.rst:31 msgid "The best tool for the task" msgstr "そのタスクに最適なツール" -#: ../../howto/logging.rst:40 +#: ../../howto/logging.rst:33 msgid "" "Display console output for ordinary usage of a command line script or program" msgstr "コマンドラインスクリプトやプログラムで普通に使う、コンソール出力の表示" -#: ../../howto/logging.rst:40 +#: ../../howto/logging.rst:33 msgid ":func:`print`" msgstr ":func:`print`" -#: ../../howto/logging.rst:44 +#: ../../howto/logging.rst:37 msgid "" "Report events that occur during normal operation of a program (e.g. for " "status monitoring or fault investigation)" @@ -111,17 +104,19 @@ msgstr "" "プログラムの通常の操作中に発生したイベントの報告 (例えば、状態の監視や障害の" "分析)" -#: ../../howto/logging.rst:44 +#: ../../howto/logging.rst:37 msgid "" -"A logger's :meth:`~Logger.info` (or :meth:`~Logger.debug` method for very " -"detailed output for diagnostic purposes)" +":func:`logging.info` (or :func:`logging.debug` for very detailed output for " +"diagnostic purposes)" msgstr "" +":func:`logging.info` (または、診断のための特に詳細な出力には :func:`logging." +"debug`)" -#: ../../howto/logging.rst:49 +#: ../../howto/logging.rst:42 msgid "Issue a warning regarding a particular runtime event" msgstr "特定のランタイムイベントに関わる警告の発行" -#: ../../howto/logging.rst:49 +#: ../../howto/logging.rst:42 msgid "" ":func:`warnings.warn` in library code if the issue is avoidable and the " "client application should be modified to eliminate the warning" @@ -129,21 +124,23 @@ msgstr "" "その発行が避けられるもので、クライアントアプリケーションを修正してその警告を" "排除するべきなら :func:`warnings.warn`" -#: ../../howto/logging.rst:54 +#: ../../howto/logging.rst:47 msgid "" -"A logger's :meth:`~Logger.warning` method if there is nothing the client " -"application can do about the situation, but the event should still be noted" +":func:`logging.warning` if there is nothing the client application can do " +"about the situation, but the event should still be noted" msgstr "" +"アプリケーションにできることはないが、それでもイベントを記録するべきなら :" +"func:`logging.warning`" -#: ../../howto/logging.rst:60 +#: ../../howto/logging.rst:52 msgid "Report an error regarding a particular runtime event" msgstr "特定のランタイムイベントに関わるエラーの報告" -#: ../../howto/logging.rst:60 +#: ../../howto/logging.rst:52 msgid "Raise an exception" msgstr "例外の送出" -#: ../../howto/logging.rst:63 +#: ../../howto/logging.rst:55 msgid "" "Report suppression of an error without raising an exception (e.g. error " "handler in a long-running server process)" @@ -151,50 +148,54 @@ msgstr "" "例外の送出をしないエラーの抑制 (例えば、長期のサーバプロセス中のエラーハンド" "ラ)" -#: ../../howto/logging.rst:63 +#: ../../howto/logging.rst:55 msgid "" -"A logger's :meth:`~Logger.error`, :meth:`~Logger.exception` or :meth:" -"`~Logger.critical` method as appropriate for the specific error and " -"application domain" +":func:`logging.error`, :func:`logging.exception` or :func:`logging.critical` " +"as appropriate for the specific error and application domain" msgstr "" +"特定のエラーやアプリケーションドメインに応じて :func:`logging.error`, :func:" +"`logging.exception` または :func:`logging.critical`" -#: ../../howto/logging.rst:70 +#: ../../howto/logging.rst:62 msgid "" -"The logger methods are named after the level or severity of the events they " -"are used to track. The standard levels and their applicability are described " -"below (in increasing order of severity):" +"The logging functions are named after the level or severity of the events " +"they are used to track. The standard levels and their applicability are " +"described below (in increasing order of severity):" msgstr "" +"ロギング関数は、そのイベントのレベルや重大度から名前を付けられ、それが追跡に" +"使われます。標準のレベルとその適用範囲は、以下に (重大度が増す順に) 記述され" +"ています:" -#: ../../howto/logging.rst:77 ../../howto/logging.rst:875 +#: ../../howto/logging.rst:69 ../../howto/logging.rst:855 msgid "Level" msgstr "レベル" -#: ../../howto/logging.rst:77 +#: ../../howto/logging.rst:69 msgid "When it's used" msgstr "いつ使うか" -#: ../../howto/logging.rst:79 ../../howto/logging.rst:885 +#: ../../howto/logging.rst:71 ../../howto/logging.rst:865 msgid "``DEBUG``" msgstr "``DEBUG``" -#: ../../howto/logging.rst:79 +#: ../../howto/logging.rst:71 msgid "" "Detailed information, typically of interest only when diagnosing problems." msgstr "おもに問題を診断するときにのみ関心があるような、詳細な情報。" -#: ../../howto/logging.rst:82 ../../howto/logging.rst:883 +#: ../../howto/logging.rst:74 ../../howto/logging.rst:863 msgid "``INFO``" msgstr "``INFO``" -#: ../../howto/logging.rst:82 +#: ../../howto/logging.rst:74 msgid "Confirmation that things are working as expected." msgstr "想定された通りのことが起こったことの確認。" -#: ../../howto/logging.rst:85 ../../howto/logging.rst:881 +#: ../../howto/logging.rst:77 ../../howto/logging.rst:861 msgid "``WARNING``" msgstr "``WARNING``" -#: ../../howto/logging.rst:85 +#: ../../howto/logging.rst:77 msgid "" "An indication that something unexpected happened, or indicative of some " "problem in the near future (e.g. 'disk space low'). The software is still " @@ -203,34 +204,36 @@ msgstr "" "想定外のことが起こった、または問題が近く起こりそうである (例えば、'disk " "space low') ことの表示。" -#: ../../howto/logging.rst:90 ../../howto/logging.rst:879 +#: ../../howto/logging.rst:82 ../../howto/logging.rst:859 msgid "``ERROR``" msgstr "``ERROR``" -#: ../../howto/logging.rst:90 +#: ../../howto/logging.rst:82 msgid "" "Due to a more serious problem, the software has not been able to perform " "some function." msgstr "より重大な問題により、ソフトウェアがある機能を実行できないこと。" -#: ../../howto/logging.rst:93 ../../howto/logging.rst:877 +#: ../../howto/logging.rst:85 ../../howto/logging.rst:857 msgid "``CRITICAL``" msgstr "``CRITICAL``" -#: ../../howto/logging.rst:93 +#: ../../howto/logging.rst:85 msgid "" "A serious error, indicating that the program itself may be unable to " "continue running." msgstr "プログラム自体が実行を続けられないことを表す、重大なエラー。" -#: ../../howto/logging.rst:97 +#: ../../howto/logging.rst:89 msgid "" -"The default level is ``WARNING``, which means that only events of this " -"severity and higher will be tracked, unless the logging package is " -"configured to do otherwise." +"The default level is ``WARNING``, which means that only events of this level " +"and above will be tracked, unless the logging package is configured to do " +"otherwise." msgstr "" +"デフォルトのレベルは ``WARNING`` で、logging パッケージが他に設定されなけれ" +"ば、このレベル以上のイベントのみ追跡されます。" -#: ../../howto/logging.rst:100 +#: ../../howto/logging.rst:93 msgid "" "Events that are tracked can be handled in different ways. The simplest way " "of handling tracked events is to print them to the console. Another common " @@ -240,60 +243,43 @@ msgstr "" "最も単純な方法は、それをコンソールに表示することです。その他のよくある方法" "は、それをディスクファイルに書き出すことです。" -#: ../../howto/logging.rst:108 +#: ../../howto/logging.rst:101 msgid "A simple example" msgstr "簡単な例" -#: ../../howto/logging.rst:110 +#: ../../howto/logging.rst:103 msgid "A very simple example is::" msgstr "ごく簡単な例は::" -#: ../../howto/logging.rst:112 -msgid "" -"import logging\n" -"logging.warning('Watch out!') # will print a message to the console\n" -"logging.info('I told you so') # will not print anything" -msgstr "" - -#: ../../howto/logging.rst:116 +#: ../../howto/logging.rst:109 msgid "If you type these lines into a script and run it, you'll see:" msgstr "" "これらの行をスクリプトにタイプして実行すると、次のようにコンソールに出力され" "ます:" -#: ../../howto/logging.rst:118 -msgid "WARNING:root:Watch out!" -msgstr "" - -#: ../../howto/logging.rst:122 +#: ../../howto/logging.rst:115 msgid "" "printed out on the console. The ``INFO`` message doesn't appear because the " "default level is ``WARNING``. The printed message includes the indication of " "the level and the description of the event provided in the logging call, i." -"e. 'Watch out!'. The actual output can be formatted quite flexibly if you " +"e. 'Watch out!'. Don't worry about the 'root' part for now: it will be " +"explained later. The actual output can be formatted quite flexibly if you " "need that; formatting options will also be explained later." msgstr "" +"デフォルトのレベルは ``WARNING`` なので、``INFO`` メッセージは現れません。表" +"示されたメッセージには、レベルの表示と、ロギングの呼び出しで提供された、イベ" +"ントの説明すなわち 'Watch out!' が含まれます。'root' の部分は今は気にしないで" +"ください。あとで説明します。実際の出力は、必要に応じてかなり柔軟に書式化でき" +"ます。書式化操作もあとで説明します。" -#: ../../howto/logging.rst:128 -msgid "" -"Notice that in this example, we use functions directly on the ``logging`` " -"module, like ``logging.debug``, rather than creating a logger and calling " -"functions on it. These functions operate on the root logger, but can be " -"useful as they will call :func:`~logging.basicConfig` for you if it has not " -"been called yet, like in this example. In larger programs you'll usually " -"want to control the logging configuration explicitly however - so for that " -"reason as well as others, it's better to create loggers and call their " -"methods." -msgstr "" - -#: ../../howto/logging.rst:137 +#: ../../howto/logging.rst:124 msgid "Logging to a file" msgstr "ファイルへの logging" -#: ../../howto/logging.rst:139 +#: ../../howto/logging.rst:126 msgid "" "A very common situation is that of recording logging events in a file, so " -"let's look at that next. Be sure to try the following in a newly started " +"let's look at that next. Be sure to try the following in a newly-started " "Python interpreter, and don't just continue from the session described " "above::" msgstr "" @@ -301,19 +287,7 @@ msgstr "" "を見て行きましょう。以下のサンプルを試すときは Python インタプリタを新しく起" "動して、上のセッションの続きにならないようにしてください::" -#: ../../howto/logging.rst:143 -msgid "" -"import logging\n" -"logger = logging.getLogger(__name__)\n" -"logging.basicConfig(filename='example.log', encoding='utf-8', level=logging." -"DEBUG)\n" -"logger.debug('This message should go to the log file')\n" -"logger.info('So should this')\n" -"logger.warning('And this, too')\n" -"logger.error('And non-ASCII stuff, too, like Øresund and Malmö')" -msgstr "" - -#: ../../howto/logging.rst:151 +#: ../../howto/logging.rst:137 msgid "" "The *encoding* argument was added. In earlier Python versions, or if not " "specified, the encoding used is the default value used by :func:`open`. " @@ -321,27 +295,21 @@ msgid "" "passed, which determines how encoding errors are handled. For available " "values and the default, see the documentation for :func:`open`." msgstr "" -"*encoding* 引数が追加されました。以前のバージョンの Python では、あるいは指定" -"されなかったら、エンコーディングには :func:`open` が使うデフォルト値が使われ" -"ます。上の例に出てきていませんが、同じく渡せるようになった *errors* 引数は、" -"エンコーディングエラーの扱いを決定します。利用可能な値およびデフォルト値につ" -"いては、 :func:`open` のドキュメントを参照してください。" +"*encoding* 引数が追加されました。\n" +"以前のバージョンあるいは無指定の Python では、エンコーディングには :func:" +"`open` が使うデフォルト値が使われます。\n" +"上の例に出てきていませんが、今は省略できる *errors* 引数は、エンコーディング" +"の扱われ方を決定します。\n" +"利用可能な値およびデフォルト値については、 :func:`open` のドキュメントを参照" +"してください。" -#: ../../howto/logging.rst:158 +#: ../../howto/logging.rst:144 msgid "" "And now if we open the file and look at what we have, we should find the log " "messages:" msgstr "そして、ファイルの中身を確認すると、ログメッセージが確認できます:" -#: ../../howto/logging.rst:161 -msgid "" -"DEBUG:__main__:This message should go to the log file\n" -"INFO:__main__:So should this\n" -"WARNING:__main__:And this, too\n" -"ERROR:__main__:And non-ASCII stuff, too, like Øresund and Malmö" -msgstr "" - -#: ../../howto/logging.rst:168 +#: ../../howto/logging.rst:154 msgid "" "This example also shows how you can set the logging level which acts as the " "threshold for tracking. In this case, because we set the threshold to " @@ -351,55 +319,42 @@ msgstr "" "す。この例では、しきい値を ``DEBUG`` に設定しているので、全てのメッセージが表" "示されています。" -#: ../../howto/logging.rst:172 +#: ../../howto/logging.rst:158 msgid "" "If you want to set the logging level from a command-line option such as:" msgstr "次のようなコマンドラインオプションでログレベルを設定したいと考え:" -#: ../../howto/logging.rst:174 -msgid "--log=INFO" -msgstr "" - -#: ../../howto/logging.rst:178 +#: ../../howto/logging.rst:164 msgid "" "and you have the value of the parameter passed for ``--log`` in some " "variable *loglevel*, you can use::" msgstr "" "``--log`` に渡されたパラメータの値を変数 *loglevel* に保存しているとしたら、" -#: ../../howto/logging.rst:181 -msgid "getattr(logging, loglevel.upper())" -msgstr "" - -#: ../../howto/logging.rst:183 +#: ../../howto/logging.rst:169 msgid "" "to get the value which you'll pass to :func:`basicConfig` via the *level* " "argument. You may want to error check any user input value, perhaps as in " "the following example::" msgstr "" "というコードを使い、 :func:`basicConfig` の *level* 引数に渡すべき値が得られ" -"ます。ユーザの入力値をすべてエラーチェックしたくなり、次の例のように実装する" -"こともあるでしょう::" - -#: ../../howto/logging.rst:187 -msgid "" -"# assuming loglevel is bound to the string value obtained from the\n" -"# command line argument. Convert to upper case to allow the user to\n" -"# specify --log=DEBUG or --log=debug\n" -"numeric_level = getattr(logging, loglevel.upper(), None)\n" -"if not isinstance(numeric_level, int):\n" -" raise ValueError('Invalid log level: %s' % loglevel)\n" -"logging.basicConfig(level=numeric_level, ...)" -msgstr "" +"ます。\n" +"ユーザの入力値をすべてエラーチェックしたくなり、次の例のように実装することも" +"あるでしょう::" -#: ../../howto/logging.rst:195 +#: ../../howto/logging.rst:181 msgid "" -"The call to :func:`basicConfig` should come *before* any calls to a logger's " -"methods such as :meth:`~Logger.debug`, :meth:`~Logger.info`, etc. Otherwise, " -"that logging event may not be handled in the desired manner." +"The call to :func:`basicConfig` should come *before* any calls to :func:" +"`debug`, :func:`info` etc. As it's intended as a one-off simple " +"configuration facility, only the first call will actually do anything: " +"subsequent calls are effectively no-ops." msgstr "" +":func:`basicConfig` は、 :func:`debug` や :func:`info` などの呼び出しよりも *" +"前* に呼び出さなければなりません。これは、一度限りの単純な設定機能を意図して" +"いるので、実際に作用するのは最初の呼び出しのみで、続く呼び出しの効果は no-op " +"です。" -#: ../../howto/logging.rst:199 +#: ../../howto/logging.rst:186 msgid "" "If you run the above script several times, the messages from successive runs " "are appended to the file *example.log*. If you want each run to start " @@ -411,13 +366,7 @@ msgstr "" "に新たに始めたいなら、上記の例での呼び出しを次のように変え、*filemode* 引数を" "指定する方法がとれます::" -#: ../../howto/logging.rst:204 -msgid "" -"logging.basicConfig(filename='example.log', filemode='w', level=logging." -"DEBUG)" -msgstr "" - -#: ../../howto/logging.rst:206 +#: ../../howto/logging.rst:193 msgid "" "The output will be the same as before, but the log file is no longer " "appended to, so the messages from earlier runs are lost." @@ -425,11 +374,44 @@ msgstr "" "出力は先ほどと同じになりますが、ログファイルは追記されなくなり、以前の実行に" "よるメッセージは失われます。" -#: ../../howto/logging.rst:211 +#: ../../howto/logging.rst:198 +msgid "Logging from multiple modules" +msgstr "複数のモジュールからのロギング" + +#: ../../howto/logging.rst:200 +msgid "" +"If your program consists of multiple modules, here's an example of how you " +"could organize logging in it::" +msgstr "" +"プログラムが複数のモジュールでできているなら、そのロギングをどのように構成す" +"るかの例はこちらです::" + +#: ../../howto/logging.rst:224 +msgid "If you run *myapp.py*, you should see this in *myapp.log*:" +msgstr "*myapp.py* を実行すれば、*myapp.log* でログが確認できます:" + +#: ../../howto/logging.rst:232 +msgid "" +"which is hopefully what you were expecting to see. You can generalize this " +"to multiple modules, using the pattern in *mylib.py*. Note that for this " +"simple usage pattern, you won't know, by looking in the log file, *where* in " +"your application your messages came from, apart from looking at the event " +"description. If you want to track the location of your messages, you'll need " +"to refer to the documentation beyond the tutorial level -- see :ref:`logging-" +"advanced-tutorial`." +msgstr "" +"この *mylib.py* でのパターンは、複数のモジュールに一般化できます。なお、この" +"簡単な使用パターンでは、ログファイルを見ることで、イベントの説明は見られます" +"が、アプリケーションの *どこから* メッセージが来たのかを知ることはできませ" +"ん。メッセージの位置を追跡したいなら、このチュートリアルレベルを超えたドキュ" +"メントが必要になります -- :ref:`logging-advanced-tutorial` を参照してくださ" +"い。" + +#: ../../howto/logging.rst:242 msgid "Logging variable data" msgstr "変数データのロギング" -#: ../../howto/logging.rst:213 +#: ../../howto/logging.rst:244 msgid "" "To log variable data, use a format string for the event description message " "and append the variable data as arguments. For example::" @@ -437,21 +419,11 @@ msgstr "" "変数データのログを取るには、イベント記述メッセージにフォーマット文字列を使" "い、引数に変数データを加えてください。例えば::" -#: ../../howto/logging.rst:216 -msgid "" -"import logging\n" -"logging.warning('%s before you %s', 'Look', 'leap!')" -msgstr "" - -#: ../../howto/logging.rst:219 +#: ../../howto/logging.rst:250 msgid "will display:" msgstr "により、次のように表示されます:" -#: ../../howto/logging.rst:221 -msgid "WARNING:root:Look before you leap!" -msgstr "" - -#: ../../howto/logging.rst:225 +#: ../../howto/logging.rst:256 msgid "" "As you can see, merging of variable data into the event description message " "uses the old, %-style of string formatting. This is for backwards " @@ -467,11 +439,11 @@ msgstr "" "サポートされて *います* が、その探求はこのチュートリアルでは対象としません。" "詳細は :ref:`formatting-styles` を参照してください。" -#: ../../howto/logging.rst:234 +#: ../../howto/logging.rst:265 msgid "Changing the format of displayed messages" msgstr "表示されるメッセージのフォーマットの変更" -#: ../../howto/logging.rst:236 +#: ../../howto/logging.rst:267 msgid "" "To change the format which is used to display messages, you need to specify " "the format you want to use::" @@ -479,28 +451,11 @@ msgstr "" "メッセージを表示するのに使われるフォーマットを変更するには、使いたいフォー" "マットを指定する必要があります::" -#: ../../howto/logging.rst:239 -msgid "" -"import logging\n" -"logging.basicConfig(format='%(levelname)s:%(message)s', level=logging." -"DEBUG)\n" -"logging.debug('This message should appear on the console')\n" -"logging.info('So should this')\n" -"logging.warning('And this, too')" -msgstr "" - -#: ../../howto/logging.rst:245 +#: ../../howto/logging.rst:276 msgid "which would print:" msgstr "により、次のように表示されます:" -#: ../../howto/logging.rst:247 -msgid "" -"DEBUG:This message should appear on the console\n" -"INFO:So should this\n" -"WARNING:And this, too" -msgstr "" - -#: ../../howto/logging.rst:253 +#: ../../howto/logging.rst:284 msgid "" "Notice that the 'root' which appeared in earlier examples has disappeared. " "For a full set of things that can appear in format strings, you can refer to " @@ -515,11 +470,11 @@ msgstr "" "(変数データを含むイベント記述)、それともしかしたら、イベントがいつ起こったか" "という表示だけです。これは次の節で解説します。" -#: ../../howto/logging.rst:262 +#: ../../howto/logging.rst:293 msgid "Displaying the date/time in messages" msgstr "メッセージ内での日付と時刻の表示" -#: ../../howto/logging.rst:264 +#: ../../howto/logging.rst:295 msgid "" "To display the date and time of an event, you would place '%(asctime)s' in " "your format string::" @@ -527,48 +482,25 @@ msgstr "" "イベントの日付と時刻を表示するには、フォーマット文字列に '%(asctime)s' を置い" "てください::" -#: ../../howto/logging.rst:267 -msgid "" -"import logging\n" -"logging.basicConfig(format='%(asctime)s %(message)s')\n" -"logging.warning('is when this event was logged.')" -msgstr "" - -#: ../../howto/logging.rst:271 +#: ../../howto/logging.rst:302 msgid "which should print something like this:" msgstr "これは以下の様なフォーマットで表示されます:" -#: ../../howto/logging.rst:273 -msgid "2010-12-12 11:41:42,612 is when this event was logged." -msgstr "" - -#: ../../howto/logging.rst:277 +#: ../../howto/logging.rst:308 msgid "" "The default format for date/time display (shown above) is like ISO8601 or :" "rfc:`3339`. If you need more control over the formatting of the date/time, " "provide a *datefmt* argument to ``basicConfig``, as in this example::" msgstr "" -"デフォルトの日付と時間の表示フォーマット (上記の結果) は、ISO8601 や :rfc:" -"`3339` に似ています。日付と時間のフォーマットをより詳細に制御する必要があるな" -"ら、以下の例の様に、 ``basicConfig`` に *datefmt* 引数を指定してください::" - -#: ../../howto/logging.rst:281 -msgid "" -"import logging\n" -"logging.basicConfig(format='%(asctime)s %(message)s', datefmt='%m/%d/%Y %I:" -"%M:%S %p')\n" -"logging.warning('is when this event was logged.')" -msgstr "" +"デフォルトの日付と時間のフォーマットは、ISO8601の規格で表示されます(上記の表" +"示結果)。日付と時間のフォーマットを変更した場合は、以下の例の様に、" +"``basicConfig``関数の *datefmt* 引数に指定する必要があります:" -#: ../../howto/logging.rst:285 +#: ../../howto/logging.rst:316 msgid "which would display something like this:" msgstr "これは次のように表示されます:" -#: ../../howto/logging.rst:287 -msgid "12/12/2010 11:46:36 AM is when this event was logged." -msgstr "" - -#: ../../howto/logging.rst:291 +#: ../../howto/logging.rst:322 msgid "" "The format of the *datefmt* argument is the same as supported by :func:`time." "strftime`." @@ -576,11 +508,11 @@ msgstr "" "*datefmt* 引数のフォーマットは、 :func:`time.strftime` でサポートされているも" "のと同じです。" -#: ../../howto/logging.rst:296 +#: ../../howto/logging.rst:327 msgid "Next Steps" msgstr "次のステップ" -#: ../../howto/logging.rst:298 +#: ../../howto/logging.rst:329 msgid "" "That concludes the basic tutorial. It should be enough to get you up and " "running with logging. There's a lot more that the logging package offers, " @@ -593,21 +525,21 @@ msgstr "" "を使いこなすためには、もうちょっと時間をかけて、以下のセクションを読む必要が" "あります。その用意ができたら、好きな飲み物を持って、次に進みましょう。" -#: ../../howto/logging.rst:304 +#: ../../howto/logging.rst:335 msgid "" "If your logging needs are simple, then use the above examples to incorporate " "logging into your own scripts, and if you run into problems or don't " "understand something, please post a question on the comp.lang.python Usenet " -"group (available at https://groups.google.com/g/comp.lang.python) and you " -"should receive help before too long." +"group (available at https://groups.google.com/forum/#!forum/comp.lang." +"python) and you should receive help before too long." msgstr "" "ロギングを簡潔に行いたいなら、上記の例を使って、ロギングをあなたのスクリプト" "に組み込んでください。問題があったり理解出来ないことがあったら、comp.lang." -"python Usenet group (https://groups.google.com/g/comp.lang.python から利用で" -"きます) に質問を投稿してくだされば、そう遠くないうちに助けが得られるでしょ" -"う。" +"python Usenet group (https://groups.google.com/forum/#!forum/comp.lang." +"python から利用できます) に質問を投稿してくだされば、そう遠くないうちに助けが" +"得られるでしょう。" -#: ../../howto/logging.rst:310 +#: ../../howto/logging.rst:341 msgid "" "Still here? You can carry on reading the next few sections, which provide a " "slightly more advanced/in-depth tutorial than the basic one above. After " @@ -616,11 +548,11 @@ msgstr "" "まだいますか?もう少し上級の、踏み込んだチュートリアルを綴った、幾つかの節を" "読み続けることができます。その後で、 :ref:`logging-cookbook` もご覧ください。" -#: ../../howto/logging.rst:318 +#: ../../howto/logging.rst:349 msgid "Advanced Logging Tutorial" msgstr "上級ロギングチュートリアル" -#: ../../howto/logging.rst:320 +#: ../../howto/logging.rst:351 msgid "" "The logging library takes a modular approach and offers several categories " "of components: loggers, handlers, filters, and formatters." @@ -628,30 +560,30 @@ msgstr "" "logging ライブラリはモジュール方式のアプローチを取り、いくつかのカテゴリの部" "品を提供します。ロガー、ハンドラ、フィルタ、フォーマッタです。" -#: ../../howto/logging.rst:323 +#: ../../howto/logging.rst:354 msgid "Loggers expose the interface that application code directly uses." msgstr "" "ロガーは、アプリケーションコードが直接使うインターフェースを公開します。" -#: ../../howto/logging.rst:324 +#: ../../howto/logging.rst:355 msgid "" "Handlers send the log records (created by loggers) to the appropriate " "destination." msgstr "" "ハンドラは、(ロガーによって生成された) ログ記録を適切な送信先に送ります。" -#: ../../howto/logging.rst:326 +#: ../../howto/logging.rst:357 msgid "" "Filters provide a finer grained facility for determining which log records " "to output." msgstr "" "フィルタは、どのログ記録を出力するかを決定する、きめ細かい機能を提供します。" -#: ../../howto/logging.rst:328 +#: ../../howto/logging.rst:359 msgid "Formatters specify the layout of log records in the final output." msgstr "フォーマッタは、ログ記録が最終的に出力されるレイアウトを指定します。" -#: ../../howto/logging.rst:330 +#: ../../howto/logging.rst:361 msgid "" "Log event information is passed between loggers, handlers, filters and " "formatters in a :class:`LogRecord` instance." @@ -659,7 +591,7 @@ msgstr "" "ログイベント情報は :class:`LogRecord` インスタンスの形で、 logger, handler, " "filter, formatter の間でやりとりされます。" -#: ../../howto/logging.rst:333 +#: ../../howto/logging.rst:364 msgid "" "Logging is performed by calling methods on instances of the :class:`Logger` " "class (hereafter called :dfn:`loggers`). Each instance has a name, and they " @@ -676,7 +608,7 @@ msgstr "" "'scan.pdf'の親です。ロガー名は、何でも望むものにでき、ロギングされたメッセー" "ジが発生した場所を指し示します。" -#: ../../howto/logging.rst:340 +#: ../../howto/logging.rst:371 msgid "" "A good convention to use when naming loggers is to use a module-level " "logger, in each module which uses logging, named as follows::" @@ -684,11 +616,7 @@ msgstr "" "ロガーに名前をつけるときの良い習慣は、ロギングを使う各モジュールに、以下のよ" "うに名付けられた、モジュールレベルロガーを使うことです::" -#: ../../howto/logging.rst:343 -msgid "logger = logging.getLogger(__name__)" -msgstr "" - -#: ../../howto/logging.rst:345 +#: ../../howto/logging.rst:376 msgid "" "This means that logger names track the package/module hierarchy, and it's " "intuitively obvious where events are logged just from the logger name." @@ -696,7 +624,7 @@ msgstr "" "これにより、ロガー名はパッケージ/モジュール階層をなぞり、ロガー名だけで、どこ" "でイベントのログが取られたか、直感的に明らかになります。" -#: ../../howto/logging.rst:348 +#: ../../howto/logging.rst:379 msgid "" "The root of the hierarchy of loggers is called the root logger. That's the " "logger used by the functions :func:`debug`, :func:`info`, :func:`warning`, :" @@ -710,7 +638,7 @@ msgstr "" "の同名のメソッドを呼び出します。これらの関数とメソッドは、同じ署名をもってい" "ます。ルートロガーの名前は、ログ出力では 'root' と表示されます。" -#: ../../howto/logging.rst:354 +#: ../../howto/logging.rst:385 msgid "" "It is, of course, possible to log messages to different destinations. " "Support is included in the package for writing log messages to files, HTTP " @@ -727,7 +655,7 @@ msgstr "" "`handler` クラスによって取り扱われます。組み込みのハンドラクラスでは満たせな" "いような、特殊な要件があるなら、独自のログ送信先を生成できます。" -#: ../../howto/logging.rst:361 +#: ../../howto/logging.rst:392 msgid "" "By default, no destination is set for any logging messages. You can specify " "a destination (such as console or file) by using :func:`basicConfig` as in " @@ -746,17 +674,13 @@ msgstr "" "ガーに委譲して実際にメッセージを出力する前に、コンソール (``sys.stderr``) を" "送信先に、デフォルトのフォーマットを表示されるメッセージに設定します。" -#: ../../howto/logging.rst:369 +#: ../../howto/logging.rst:400 msgid "The default format set by :func:`basicConfig` for messages is:" msgstr "" -":func:`basicConfig` が設定するデフォルトのメッセージのフォーマットは次のよう" -"になります:" - -#: ../../howto/logging.rst:371 -msgid "severity:logger name:message" -msgstr "" +":func:`basicConfig` によるデフォルトのフォーマットメッセージは次のようになり" +"ます:" -#: ../../howto/logging.rst:375 +#: ../../howto/logging.rst:406 msgid "" "You can change this by passing a format string to :func:`basicConfig` with " "the *format* keyword argument. For all options regarding how a format string " @@ -766,22 +690,22 @@ msgstr "" "で、これを変更できます。フォーマット文字列を構成するためのすべてのオプション" "は、 :ref:`formatter-objects` を参照してください。" -#: ../../howto/logging.rst:380 +#: ../../howto/logging.rst:411 msgid "Logging Flow" msgstr "Logging Flow" -#: ../../howto/logging.rst:382 +#: ../../howto/logging.rst:413 msgid "" "The flow of log event information in loggers and handlers is illustrated in " "the following diagram." msgstr "" "次の図はログイベントが logger と handler をどう流れるかを示しています。" -#: ../../howto/logging.rst:433 +#: ../../howto/logging.rst:419 msgid "Loggers" msgstr "ロガー" -#: ../../howto/logging.rst:435 +#: ../../howto/logging.rst:421 msgid "" ":class:`Logger` objects have a threefold job. First, they expose several " "methods to application code so that applications can log messages at " @@ -797,7 +721,7 @@ msgstr "" "オブジェクトに基づいて決定します。三つ目に、ロガーオブジェクトは関心を持って" "いるすべてのログハンドラに関連するログメッセージを回送します。" -#: ../../howto/logging.rst:441 +#: ../../howto/logging.rst:427 msgid "" "The most widely used methods on logger objects fall into two categories: " "configuration and message sending." @@ -805,11 +729,11 @@ msgstr "" "とりわけ広く使われるロガーオブジェクトのメソッドは、二つのカテゴリーに分類で" "きます: 設定とメッセージ送信です。" -#: ../../howto/logging.rst:444 +#: ../../howto/logging.rst:430 msgid "These are the most common configuration methods:" msgstr "これらが設定メソッドの中でよく使われます:" -#: ../../howto/logging.rst:446 +#: ../../howto/logging.rst:432 msgid "" ":meth:`Logger.setLevel` specifies the lowest-severity log message a logger " "will handle, where debug is the lowest built-in severity level and critical " @@ -822,7 +746,7 @@ msgstr "" "す。たとえば、深刻度が INFO と設定されたロガーは INFO, WARNING, ERROR, " "CRITICAL のメッセージしか扱わず、 DEBUG メッセージは無視します。" -#: ../../howto/logging.rst:452 +#: ../../howto/logging.rst:438 msgid "" ":meth:`Logger.addHandler` and :meth:`Logger.removeHandler` add and remove " "handler objects from the logger object. Handlers are covered in more detail " @@ -832,7 +756,7 @@ msgstr "" "ジェクトをロガーオブジェクトから追加または削除します。ハンドラについては、 :" "ref:`handler-basic` で詳しく述べます。" -#: ../../howto/logging.rst:456 +#: ../../howto/logging.rst:442 msgid "" ":meth:`Logger.addFilter` and :meth:`Logger.removeFilter` add and remove " "filter objects from the logger object. Filters are covered in more detail " @@ -842,21 +766,21 @@ msgstr "" "にフィルタオブジェクトを追加または削除します。フィルタについては、 :ref:" "`filter` で詳しく述べます。" -#: ../../howto/logging.rst:460 +#: ../../howto/logging.rst:446 msgid "" "You don't need to always call these methods on every logger you create. See " "the last two paragraphs in this section." msgstr "" "これらのメソッドを、生成したすべてのロガーに毎回呼び出さなければならないわけ" -"ではありません。この節の最後の 2 段落を参照してください。" +"ではありません。最後の 2 段落を参照してください。" -#: ../../howto/logging.rst:463 +#: ../../howto/logging.rst:449 msgid "" "With the logger object configured, the following methods create log messages:" msgstr "" "ロガーオブジェクトが設定されれば、以下のメソッドがログメッセージを生成します:" -#: ../../howto/logging.rst:465 +#: ../../howto/logging.rst:451 msgid "" ":meth:`Logger.debug`, :meth:`Logger.info`, :meth:`Logger.warning`, :meth:" "`Logger.error`, and :meth:`Logger.critical` all create log records with a " @@ -876,7 +800,7 @@ msgstr "" "す。 ``**kwargs`` については、ログ記録メソッドが気にするキーワードは " "``exc_info`` だけで、例外の情報をログに記録するかを決定するのに使います。" -#: ../../howto/logging.rst:475 +#: ../../howto/logging.rst:461 msgid "" ":meth:`Logger.exception` creates a log message similar to :meth:`Logger." "error`. The difference is that :meth:`Logger.exception` dumps a stack trace " @@ -884,9 +808,9 @@ msgid "" msgstr "" ":meth:`Logger.exception` は :meth:`Logger.error` と似たログメッセージを作成し" "ます。違いは :meth:`Logger.exception` がスタックトレースを一緒にダンプするこ" -"とです。このメソッドは例外ハンドラからだけ呼び出すようにしてください。" +"とです。例外ハンドラでだけ使うようにしてください。" -#: ../../howto/logging.rst:479 +#: ../../howto/logging.rst:465 msgid "" ":meth:`Logger.log` takes a log level as an explicit argument. This is a " "little more verbose for logging messages than using the log level " @@ -897,7 +821,7 @@ msgstr "" "げた便宜的なログレベル毎のメソッドを使うより少しコード量が多くなりますが、独" "自のログレベルを使うことができます。" -#: ../../howto/logging.rst:483 +#: ../../howto/logging.rst:469 msgid "" ":func:`getLogger` returns a reference to a logger instance with the " "specified name if it is provided, or ``root`` if not. The names are period-" @@ -916,7 +840,7 @@ msgstr "" "bar``, ``foo.bar.baz``, ``foo.bam`` といった名前のロガーはすべて ``foo`` の子" "孫になります。" -#: ../../howto/logging.rst:491 +#: ../../howto/logging.rst:477 msgid "" "Loggers have a concept of *effective level*. If a level is not explicitly " "set on a logger, the level of its parent is used instead as its effective " @@ -929,13 +853,13 @@ msgid "" msgstr "" "ロガーには、*有効レベル (effective level)* の概念があります。ロガーにレベルが" "明示的に設定されていなければ、代わりに親のレベルがその有効レベルとして使われ" -"ます。親のレベルが設定されなければ、*その* 親のレベルが確かめられ、明示的に設" -"定されたレベルが見つかるまで祖先が探されます。ルートロガーは、必ず明示的なレ" -"ベルが設定されています (デフォルトでは ``WARNING`` です)。イベントを処理する" -"かを決定するとき、ロガーの有効レベルを使って、イベントがロガーのハンドラに渡" -"されるかが決められます。" +"ます。親のレベルが設定されなければ、*その* 親のレベルが確かめられ、以下同様" +"に、明示的に設定されたレベルが見つかるまで祖先が探されます。ルートロガーは、" +"必ず明示的なレベルが設定されています (デフォルトでは ``WARNING`` です)。イベ" +"ントを処理するかを決定するとき、ロガーの有効レベルを使って、イベントがロガー" +"のハンドラに渡されるかが決められます。" -#: ../../howto/logging.rst:499 +#: ../../howto/logging.rst:485 msgid "" "Child loggers propagate messages up to the handlers associated with their " "ancestor loggers. Because of this, it is unnecessary to define and configure " @@ -950,11 +874,11 @@ msgstr "" "ガーを作成すれば十分です。(しかし、ロガーの *propagate* 属性を ``False`` に設" "定することで、伝播を抑制できます。)" -#: ../../howto/logging.rst:510 +#: ../../howto/logging.rst:496 msgid "Handlers" msgstr "ハンドラ" -#: ../../howto/logging.rst:512 +#: ../../howto/logging.rst:498 msgid "" ":class:`~logging.Handler` objects are responsible for dispatching the " "appropriate log messages (based on the log messages' severity) to the " @@ -975,7 +899,7 @@ msgstr "" "いとします。この場合、 3 つの個別のハンドラがそれぞれの深刻度と宛先に応じて必" "要になります。" -#: ../../howto/logging.rst:522 +#: ../../howto/logging.rst:508 msgid "" "The standard library includes quite a few handler types (see :ref:`useful-" "handlers`); the tutorials use mainly :class:`StreamHandler` and :class:" @@ -985,7 +909,7 @@ msgstr "" "参照してください) が、このチュートリアルでは :class:`StreamHandler` と :" "class:`FileHandler` だけを例に取り上げます。" -#: ../../howto/logging.rst:526 +#: ../../howto/logging.rst:512 msgid "" "There are very few methods in a handler for application developers to " "concern themselves with. The only handler methods that seem relevant for " @@ -996,23 +920,22 @@ msgstr "" "られています。組み込みのハンドラオブジェクトを使う (つまり自作ハンドラを作ら" "ない) 開発者に関係あるハンドラのメソッドは、次の設定用のメソッドだけでしょう:" -#: ../../howto/logging.rst:531 +#: ../../howto/logging.rst:517 msgid "" "The :meth:`~Handler.setLevel` method, just as in logger objects, specifies " "the lowest severity that will be dispatched to the appropriate destination. " -"Why are there two :meth:`~Handler.setLevel` methods? The level set in the " -"logger determines which severity of messages it will pass to its handlers. " -"The level set in each handler determines which messages that handler will " -"send on." +"Why are there two :func:`setLevel` methods? The level set in the logger " +"determines which severity of messages it will pass to its handlers. The " +"level set in each handler determines which messages that handler will send " +"on." msgstr "" ":meth:`~Handler.setLevel` メソッドは、ロガーオブジェクトの場合と同様に、適切" -"な出力先に振り分けられるべき最も低い深刻度を指定します。なぜ 2 つも :meth:" -"`~Handler.setLevel` メソッドがあるのでしょうか? ロガーで設定されるレベルは、" -"付随するハンドラにどんな深刻度のメッセージを渡すか決めます。それぞれのハンド" -"ラで設定されるレベルは、そのハンドラがどのメッセージを転送するべきか決めま" -"す。" +"な出力先に振り分けられるべき最も低い深刻度を指定します。なぜ 2 つも :func:" +"`setLevel` メソッドがあるのでしょうか? ロガーで設定されるレベルは、付随するハ" +"ンドラにどんな深刻度のメッセージを渡すか決めます。ハンドラで設定されるレベル" +"は、ハンドラがどのメッセージを送るべきか決めます。" -#: ../../howto/logging.rst:537 +#: ../../howto/logging.rst:523 msgid "" ":meth:`~Handler.setFormatter` selects a Formatter object for this handler to " "use." @@ -1020,7 +943,7 @@ msgstr "" ":meth:`~Handler.setFormatter` でこのハンドラが使用する Formatter オブジェクト" "を選択します。" -#: ../../howto/logging.rst:540 +#: ../../howto/logging.rst:526 msgid "" ":meth:`~Handler.addFilter` and :meth:`~Handler.removeFilter` respectively " "configure and deconfigure filter objects on handlers." @@ -1028,7 +951,7 @@ msgstr "" ":meth:`~Handler.addFilter` および :meth:`~Handler.removeFilter` はそれぞれハ" "ンドラへのフィルタオブジェクトの設定と解除を行います。" -#: ../../howto/logging.rst:543 +#: ../../howto/logging.rst:529 msgid "" "Application code should not directly instantiate and use instances of :class:" "`Handler`. Instead, the :class:`Handler` class is a base class that defines " @@ -1037,14 +960,14 @@ msgid "" msgstr "" "アプリケーションのコード中では :class:`Handler` のインスタンスを直接インスタ" "ンス化して使ってはなりません。代わりに、 :class:`Handler` クラスはすべてのハ" -"ンドラが持つべきインターフェイスを定義する基底クラスであり、子クラスが使える " -"(もしくはオーバライドできる) いくつかのデフォルトの振る舞いを規定します。" +"ンドラが持つべきインターフェイスを定義し、子クラスが使える (もしくはオーバラ" +"イドできる) いくつかのデフォルトの振る舞いを規定します。" -#: ../../howto/logging.rst:550 +#: ../../howto/logging.rst:536 msgid "Formatters" msgstr "フォーマッタ" -#: ../../howto/logging.rst:552 +#: ../../howto/logging.rst:538 msgid "" "Formatter objects configure the final order, structure, and contents of the " "log message. Unlike the base :class:`logging.Handler` class, application " @@ -1060,7 +983,7 @@ msgstr "" "す。コンストラクタは三つのオプション引数を取ります -- メッセージのフォーマッ" "ト文字列、日付のフォーマット文字列、スタイル標識です。" -#: ../../howto/logging.rst:561 +#: ../../howto/logging.rst:547 msgid "" "If there is no message format string, the default is to use the raw " "message. If there is no date format string, the default date format is:" @@ -1069,41 +992,35 @@ msgstr "" "す。また、日付フォーマットに何も渡さない場合は、デフォルトで以下のフォーマッ" "トが利用されます:" -#: ../../howto/logging.rst:564 -msgid "%Y-%m-%d %H:%M:%S" -msgstr "" - -#: ../../howto/logging.rst:568 +#: ../../howto/logging.rst:554 msgid "" -"with the milliseconds tacked on at the end. The ``style`` is one of ``'%'``, " -"``'{'``, or ``'$'``. If one of these is not specified, then ``'%'`` will be " -"used." +"with the milliseconds tacked on at the end. The ``style`` is one of `%`, '{' " +"or '$'. If one of these is not specified, then '%' will be used." msgstr "" -"時刻の末尾にはミリ秒が付きます。 ``style`` は ``'%'``, ``'{'``, または " -"``'{TX-PL-LABEL}#x27;`` のいずれかです。特に指定がなければ ``'%'`` が使われま" -"す。" +"で、最後にミリ秒が付きます。``style`` は '%', '{', '$' のいずれかです。一つ指" +"定されなければ、'%' が使われます。" -#: ../../howto/logging.rst:571 +#: ../../howto/logging.rst:557 msgid "" -"If the ``style`` is ``'%'``, the message format string uses ``%()s`` styled string substitution; the possible keys are documented in :" -"ref:`logrecord-attributes`. If the style is ``'{'``, the message format " -"string is assumed to be compatible with :meth:`str.format` (using keyword " -"arguments), while if the style is ``'$'`` then the message format string " -"should conform to what is expected by :meth:`string.Template.substitute`." -msgstr "" -"``style`` が ``'%'`` の場合、メッセージフォーマット文字列では " -"``%()s`` 形式の置換文字列が使われます; キーに指定できる属性名" -"は :ref:`logrecord-attributes` に文書化されています。 style が ``'{'`` の場" -"合、メッセージフォーマット文字列は (キーワード引数を使う) :meth:`str.format` " -"と互換となります。 style が ``'$'`` の場合、メッセージフォーマット文字列は :" -"meth:`string.Template.substitute` で期待されているものと一致します。" - -#: ../../howto/logging.rst:578 +"ref:`logrecord-attributes`. If the style is '{', the message format string " +"is assumed to be compatible with :meth:`str.format` (using keyword " +"arguments), while if the style is '$' then the message format string should " +"conform to what is expected by :meth:`string.Template.substitute`." +msgstr "" +"``style`` が '%' の場合、メッセージフォーマット文字列では ``%()s`` 形式の置換文字列が使われます; キーに指定できる属性名は :ref:" +"`logrecord-attributes` に文書化されています。 style が '{' の場合、メッセージ" +"フォーマット文字列は (キーワード引数を使う) :meth:`str.format` と互換となりま" +"す。 style が '$' の場合、メッセージフォーマット文字列は :meth:`string." +"Template.substitute` で期待されているものと一致します。" + +#: ../../howto/logging.rst:564 msgid "Added the ``style`` parameter." msgstr "``style`` パラメータが追加されました。" -#: ../../howto/logging.rst:581 +#: ../../howto/logging.rst:567 msgid "" "The following message format string will log the time in a human-readable " "format, the severity of the message, and the contents of the message, in " @@ -1112,11 +1029,7 @@ msgstr "" "次のメッセージフォーマット文字列は、人が読みやすい形式の時刻、メッセージの深" "刻度、およびメッセージの内容を、順番に出力します::" -#: ../../howto/logging.rst:585 -msgid "'%(asctime)s - %(levelname)s - %(message)s'" -msgstr "" - -#: ../../howto/logging.rst:587 +#: ../../howto/logging.rst:573 msgid "" "Formatters use a user-configurable function to convert the creation time of " "a record to a tuple. By default, :func:`time.localtime` is used; to change " @@ -1134,15 +1047,15 @@ msgstr "" "てのロギング時刻を GMT で表示するには、フォーマッタクラスの ``converter`` 属" "性を (GMT 表示の ``time.gmtime`` に) 設定してください。" -#: ../../howto/logging.rst:597 +#: ../../howto/logging.rst:583 msgid "Configuring Logging" msgstr "ロギングの環境設定" -#: ../../howto/logging.rst:601 +#: ../../howto/logging.rst:587 msgid "Programmers can configure logging in three ways:" msgstr "プログラマは、ロギングを 3 種類の方法で設定できます:" -#: ../../howto/logging.rst:603 +#: ../../howto/logging.rst:589 msgid "" "Creating loggers, handlers, and formatters explicitly using Python code that " "calls the configuration methods listed above." @@ -1150,20 +1063,20 @@ msgstr "" "上述の設定メソッドを呼び出す Python コードを明示的に使って、ロガー、ハンド" "ラ、そしてフォーマッタを生成する。" -#: ../../howto/logging.rst:605 +#: ../../howto/logging.rst:591 msgid "" "Creating a logging config file and reading it using the :func:`fileConfig` " "function." msgstr "" "ロギング設定ファイルを作り、それを :func:`fileConfig` 関数を使って読み込む。" -#: ../../howto/logging.rst:607 +#: ../../howto/logging.rst:593 msgid "" "Creating a dictionary of configuration information and passing it to the :" "func:`dictConfig` function." msgstr "設定情報の辞書を作り、それを :func:`dictConfig` 関数に渡す。" -#: ../../howto/logging.rst:610 +#: ../../howto/logging.rst:596 msgid "" "For the reference documentation on the last two options, see :ref:`logging-" "config-api`. The following example configures a very simple logger, a " @@ -1173,53 +1086,13 @@ msgstr "" "下の例では、Python コードを使って、とても簡単なロガー、コンソールハンドラ、そ" "して簡単なフォーマッタを設定しています::" -#: ../../howto/logging.rst:614 -msgid "" -"import logging\n" -"\n" -"# create logger\n" -"logger = logging.getLogger('simple_example')\n" -"logger.setLevel(logging.DEBUG)\n" -"\n" -"# create console handler and set level to debug\n" -"ch = logging.StreamHandler()\n" -"ch.setLevel(logging.DEBUG)\n" -"\n" -"# create formatter\n" -"formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - " -"%(message)s')\n" -"\n" -"# add formatter to ch\n" -"ch.setFormatter(formatter)\n" -"\n" -"# add ch to logger\n" -"logger.addHandler(ch)\n" -"\n" -"# 'application' code\n" -"logger.debug('debug message')\n" -"logger.info('info message')\n" -"logger.warning('warn message')\n" -"logger.error('error message')\n" -"logger.critical('critical message')" -msgstr "" - -#: ../../howto/logging.rst:640 +#: ../../howto/logging.rst:626 msgid "" "Running this module from the command line produces the following output:" msgstr "" "このモジュールを実行すると、コマンドラインによって以下の出力がなされます:" -#: ../../howto/logging.rst:642 -msgid "" -"$ python simple_logging_module.py\n" -"2005-03-19 15:10:26,618 - simple_example - DEBUG - debug message\n" -"2005-03-19 15:10:26,620 - simple_example - INFO - info message\n" -"2005-03-19 15:10:26,695 - simple_example - WARNING - warn message\n" -"2005-03-19 15:10:26,697 - simple_example - ERROR - error message\n" -"2005-03-19 15:10:26,773 - simple_example - CRITICAL - critical message" -msgstr "" - -#: ../../howto/logging.rst:651 +#: ../../howto/logging.rst:637 msgid "" "The following Python module creates a logger, handler, and formatter nearly " "identical to those in the example listed above, with the only difference " @@ -1228,75 +1101,16 @@ msgstr "" "以下の Python モジュールは、ロガー、ハンドラ、フォーマッタをほとんど上述の例" "と同じように生成していますが、オブジェクト名だけが異なります::" -#: ../../howto/logging.rst:655 -msgid "" -"import logging\n" -"import logging.config\n" -"\n" -"logging.config.fileConfig('logging.conf')\n" -"\n" -"# create logger\n" -"logger = logging.getLogger('simpleExample')\n" -"\n" -"# 'application' code\n" -"logger.debug('debug message')\n" -"logger.info('info message')\n" -"logger.warning('warn message')\n" -"logger.error('error message')\n" -"logger.critical('critical message')" -msgstr "" - -#: ../../howto/logging.rst:670 +#: ../../howto/logging.rst:656 msgid "Here is the logging.conf file:" -msgstr "これが logging.conf ファイルです:" - -#: ../../howto/logging.rst:672 -msgid "" -"[loggers]\n" -"keys=root,simpleExample\n" -"\n" -"[handlers]\n" -"keys=consoleHandler\n" -"\n" -"[formatters]\n" -"keys=simpleFormatter\n" -"\n" -"[logger_root]\n" -"level=DEBUG\n" -"handlers=consoleHandler\n" -"\n" -"[logger_simpleExample]\n" -"level=DEBUG\n" -"handlers=consoleHandler\n" -"qualname=simpleExample\n" -"propagate=0\n" -"\n" -"[handler_consoleHandler]\n" -"class=StreamHandler\n" -"level=DEBUG\n" -"formatter=simpleFormatter\n" -"args=(sys.stdout,)\n" -"\n" -"[formatter_simpleFormatter]\n" -"format=%(asctime)s - %(name)s - %(levelname)s - %(message)s" -msgstr "" - -#: ../../howto/logging.rst:702 +msgstr "これは`logging.conf`ファイルに記載する例です:" + +#: ../../howto/logging.rst:689 msgid "" "The output is nearly identical to that of the non-config-file-based example:" msgstr "出力は、設定ファイルに基づく例とだいたい同じです:" -#: ../../howto/logging.rst:704 -msgid "" -"$ python simple_logging_config.py\n" -"2005-03-19 15:38:55,977 - simpleExample - DEBUG - debug message\n" -"2005-03-19 15:38:55,979 - simpleExample - INFO - info message\n" -"2005-03-19 15:38:56,054 - simpleExample - WARNING - warn message\n" -"2005-03-19 15:38:56,055 - simpleExample - ERROR - error message\n" -"2005-03-19 15:38:56,130 - simpleExample - CRITICAL - critical message" -msgstr "" - -#: ../../howto/logging.rst:713 +#: ../../howto/logging.rst:700 msgid "" "You can see that the config file approach has a few advantages over the " "Python code approach, mainly separation of configuration and code and the " @@ -1306,7 +1120,7 @@ msgstr "" "プロパティを変えやすくなるという点で、Python コードの方法より少し優れていま" "す。" -#: ../../howto/logging.rst:717 +#: ../../howto/logging.rst:704 msgid "" "The :func:`fileConfig` function takes a default parameter, " "``disable_existing_loggers``, which defaults to ``True`` for reasons of " @@ -1325,7 +1139,7 @@ msgstr "" "より詳細なことはリファレンスを参照し、望むならこの引数に ``False`` を指定して" "ください。" -#: ../../howto/logging.rst:725 +#: ../../howto/logging.rst:712 msgid "" "The dictionary passed to :func:`dictConfig` can also specify a Boolean value " "with key ``disable_existing_loggers``, which if not specified explicitly in " @@ -1333,13 +1147,13 @@ msgid "" "the logger-disabling behaviour described above, which may not be what you " "want - in which case, provide the key explicitly with a value of ``False``." msgstr "" -":func:`dictConfig` に渡される辞書でも、キー ``disable_existing_loggers`` で真" -"偽値を指定することができ、辞書の中で明示的に指定しなかった場合はデフォルトで " -"``True`` と解釈されます。これは上で説明したロガー無効化につながりますが、それ" -"を望まないこともあるでしょう - その場合は、明示的にキーを与えて値を " -"``False`` にしてください。" +":func:`dictConfig` に渡した辞書で、キー ``disable_existing_loggers`` にブール" +"値を指定することができ、辞書で指定しなかった場合はデフォルトで ``True`` と解" +"釈されます。こうすると上で説明したロガー無効化が動作しますが、これはあなたが" +"望んだものでないかもしれません - その場合は、明示的にキーに ``False`` を指定" +"してください。" -#: ../../howto/logging.rst:735 +#: ../../howto/logging.rst:722 msgid "" "Note that the class names referenced in config files need to be either " "relative to the logging module, or absolute values which can be resolved " @@ -1356,7 +1170,7 @@ msgstr "" "るとき、パッケージ ``mypackage`` のモジュール ``mymodule`` で定義されたクラス" "に) ``mypackage.mymodule.MyHandler`` のどちらかが使えます。" -#: ../../howto/logging.rst:743 +#: ../../howto/logging.rst:730 msgid "" "In Python 3.2, a new means of configuring logging has been introduced, using " "dictionaries to hold configuration information. This provides a superset of " @@ -1379,36 +1193,14 @@ msgstr "" "もちろん、Python コードで辞書を構成し、ソケットを通して pickle 化された形式を" "受け取るなど、アプリケーションで意味があるいかなるやり方でも使えます。" -#: ../../howto/logging.rst:755 +#: ../../howto/logging.rst:742 msgid "" "Here's an example of the same configuration as above, in YAML format for the " "new dictionary-based approach:" msgstr "" -"以下は、上記と同じ設定を辞書ベースの新しい手法で記載した YAML 形式の例です:" - -#: ../../howto/logging.rst:758 -msgid "" -"version: 1\n" -"formatters:\n" -" simple:\n" -" format: '%(asctime)s - %(name)s - %(levelname)s - %(message)s'\n" -"handlers:\n" -" console:\n" -" class: logging.StreamHandler\n" -" level: DEBUG\n" -" formatter: simple\n" -" stream: ext://sys.stdout\n" -"loggers:\n" -" simpleExample:\n" -" level: DEBUG\n" -" handlers: [console]\n" -" propagate: no\n" -"root:\n" -" level: DEBUG\n" -" handlers: [console]" -msgstr "" +"以下は上記と同じ設定を、辞書形式に基づくYAMLフォーマットとして書いたものです:" -#: ../../howto/logging.rst:779 +#: ../../howto/logging.rst:766 msgid "" "For more information about logging using a dictionary, see :ref:`logging-" "config-api`." @@ -1416,70 +1208,77 @@ msgstr "" "辞書を使ったロギングについて詳細は、 :ref:`logging-config-api` を参照してくだ" "さい。" -#: ../../howto/logging.rst:783 +#: ../../howto/logging.rst:770 msgid "What happens if no configuration is provided" msgstr "環境設定が与えられないとどうなるか" -#: ../../howto/logging.rst:785 +#: ../../howto/logging.rst:772 msgid "" "If no logging configuration is provided, it is possible to have a situation " "where a logging event needs to be output, but no handlers can be found to " -"output the event." +"output the event. The behaviour of the logging package in these " +"circumstances is dependent on the Python version." msgstr "" "ロギング環境設定を与えられないと、ロギングイベントを出力しなければならないの" -"に、イベントを出力するハンドラが見つからないことがあります。" +"に、イベントを出力するハンドラが見つからないことがあります。この状況での " +"logging パッケージの振る舞いは、Python のバージョンに依ります。" -#: ../../howto/logging.rst:789 -msgid "" -"The event is output using a 'handler of last resort', stored in :data:" -"`lastResort`. This internal handler is not associated with any logger, and " -"acts like a :class:`~logging.StreamHandler` which writes the event " -"description message to the current value of ``sys.stderr`` (therefore " -"respecting any redirections which may be in effect). No formatting is done " -"on the message - just the bare event description message is printed. The " -"handler's level is set to ``WARNING``, so all events at this and greater " -"severities will be output." -msgstr "" -"イベントは、 :data:`lastResort` に格納された「最終手段ハンドラ」を使用して出" -"力されます。この内部的なハンドラはどんなロガーにも関係しておらず、イベント記" -"述メッセージを現在の ``sys.stderr`` に書く :class:`~logging.StreamHandler` の" -"ように動作します (したがって、あらゆるリダイレクトの効果が反映されます)。メッ" -"セージに対してフォーマットは行われません。イベント記述メッセージだけがそのま" -"ま表示されます。ハンドラのレベルは ``WARNING`` にセットされ、重大度がこれ以上" -"のすべてのイベントが出力されます。" - -#: ../../howto/logging.rst:800 +#: ../../howto/logging.rst:777 msgid "For versions of Python prior to 3.2, the behaviour is as follows:" msgstr "Python 3.2 より前のバージョンでは、振る舞いは以下の通りです:" -#: ../../howto/logging.rst:802 +#: ../../howto/logging.rst:779 msgid "" -"If :data:`raiseExceptions` is ``False`` (production mode), the event is " +"If *logging.raiseExceptions* is ``False`` (production mode), the event is " "silently dropped." msgstr "" -":data:`raiseExceptions` が ``False`` (製品モード) なら、イベントは黙って捨て" -"られます。" +"*logging.raiseExceptions* が ``False`` (製品モード) なら、イベントは黙って捨" +"てられます。" -#: ../../howto/logging.rst:805 +#: ../../howto/logging.rst:782 msgid "" -"If :data:`raiseExceptions` is ``True`` (development mode), a message 'No " +"If *logging.raiseExceptions* is ``True`` (development mode), a message 'No " "handlers could be found for logger X.Y.Z' is printed once." msgstr "" -":data:`raiseExceptions` が ``True`` (開発モード) なら、メッセージ 'No " +"*logging.raiseExceptions* が ``True`` (開発モード) なら、メッセージ 'No " "handlers could be found for logger X.Y.Z' が一度表示されます。" -#: ../../howto/logging.rst:808 +#: ../../howto/logging.rst:785 +msgid "In Python 3.2 and later, the behaviour is as follows:" +msgstr "Python 3.2 以降バージョンでは、振る舞いは以下の通りです:" + +#: ../../howto/logging.rst:787 +msgid "" +"The event is output using a 'handler of last resort', stored in ``logging." +"lastResort``. This internal handler is not associated with any logger, and " +"acts like a :class:`~logging.StreamHandler` which writes the event " +"description message to the current value of ``sys.stderr`` (therefore " +"respecting any redirections which may be in effect). No formatting is done " +"on the message - just the bare event description message is printed. The " +"handler's level is set to ``WARNING``, so all events at this and greater " +"severities will be output." +msgstr "" +"イベントは、 ``logging.lastResort`` に格納された「最終手段ハンドラ」を使用し" +"て出力されます。この内部的なハンドラはどんなロガーにも関係しておらず、イベン" +"ト記述メッセージを現在の ``sys.stderr`` の値に書く :class:`~logging." +"StreamHandler` のように動作します (したがって、あらゆるリダイレクトの効果が反" +"映されます)。メッセージに対してフォーマットは行われません - 裸のイベント記述" +"メッセージだけが印刷されます。ハンドラのレベルは ``WARNING`` にセットされ、こ" +"れより重大度が大きなすべてのイベントが出力されます。" + +#: ../../howto/logging.rst:796 msgid "" -"To obtain the pre-3.2 behaviour, :data:`lastResort` can be set to ``None``." +"To obtain the pre-3.2 behaviour, ``logging.lastResort`` can be set to " +"``None``." msgstr "" -"3.2 より前の動作にするために、:data:`lastResort` を ``None`` に設定することも" -"できます。" +"3.2 より前の動作にするために、``logging.lastResort`` を ``None`` に設定するこ" +"ともできます。" -#: ../../howto/logging.rst:814 +#: ../../howto/logging.rst:801 msgid "Configuring Logging for a Library" msgstr "ライブラリのためのロギングの設定" -#: ../../howto/logging.rst:816 +#: ../../howto/logging.rst:803 msgid "" "When developing a library which uses logging, you should take care to " "document how the library uses logging - for example, the names of loggers " @@ -1497,7 +1296,7 @@ msgstr "" "``sys.stderr`` に表示されます。これが最高のデフォルトの振る舞いと見なされま" "す。" -#: ../../howto/logging.rst:824 +#: ../../howto/logging.rst:811 msgid "" "If for some reason you *don't* want these messages printed in the absence of " "any logging configuration, you can attach a do-nothing handler to the top-" @@ -1508,15 +1307,16 @@ msgid "" "suitably configured then logging calls made in library code will send output " "to those handlers, as normal." msgstr "" -"何らかの理由でロギング設定がなされていないときにメッセージを表示 *させたくな" -"い* のであれば、ライブラリのトップレベルのロガーに何もしないハンドラを取り付" -"けられます。ライブラリの全てのイベントに対してそのハンドラが見つかるので、" -"メッセージが表示されなくなります。ライブラリのユーザーがアプリケーションのた" -"めにロギングを設定する場合、おそらくハンドラが追加され、そしてレベルが適切に" -"設定された場合に、ライブラリコード内でのロギングの呼び出しは通常通りそのハン" -"ドラに出力を送るようになります。" +"何らかの理由で、ロギング設定がなされていないときにメッセージを表示 *させたく" +"ない* なら、あなたのライブラリのトップレベルロガーに何もしないハンドラを取り" +"付けられます。このハンドラは何も処理しないというだけで、全てのライブラリイベ" +"ントに対してハンドラが見つかるので、メッセージが表示されることを防げます。ラ" +"イブラリのユーザがアプリケーションでの使用のためにロギングを設定したら、それ" +"はおそらくハンドラを追加する設定でしょうが、そしてレベルが適切に設定された" +"ら、ライブラリコード内でなされたロギングの呼び出しは、通常通りそのハンドラに" +"出力を送るようになります。" -#: ../../howto/logging.rst:833 +#: ../../howto/logging.rst:820 msgid "" "A do-nothing handler is included in the logging package: :class:`~logging." "NullHandler` (since Python 3.1). An instance of this handler could be added " @@ -1533,13 +1333,7 @@ msgstr "" "ます。ライブラリ *foo* によるすべてのロギングが、 'foo.x', 'foo.x.y' その他に" "該当する名前のロガーによってなされるなら::" -#: ../../howto/logging.rst:841 -msgid "" -"import logging\n" -"logging.getLogger('foo').addHandler(logging.NullHandler())" -msgstr "" - -#: ../../howto/logging.rst:844 +#: ../../howto/logging.rst:831 msgid "" "should have the desired effect. If an organisation produces a number of " "libraries, then the logger name specified can be 'orgname.foo' rather than " @@ -1548,23 +1342,7 @@ msgstr "" "とすれば望んだ効果が得られるでしょう。組織が複数のライブラリを作り出すなら、" "指定されるロガー名は単に 'foo' ではなく、'orgname.foo' になります。" -#: ../../howto/logging.rst:848 -msgid "" -"It is strongly advised that you *do not log to the root logger* in your " -"library. Instead, use a logger with a unique and easily identifiable name, " -"such as the ``__name__`` for your library's top-level package or module. " -"Logging to the root logger will make it difficult or impossible for the " -"application developer to configure the logging verbosity or handlers of your " -"library as they wish." -msgstr "" -"あなたのライブラリから *ルートロガーへ直接ログを記録しない* ことを強く推奨し" -"ます。代わりに、あなたのライブラリのトップレベルまたはモジュールレベルの " -"``__name__`` を使うなど、固有で、簡単に識別できる名前を持ったロガーを使ってく" -"ださい。ルートロガーに直接ログを記録することにより、あなたのライブラリを利用" -"するアプリケーション開発者が、ロギングの詳細度 (verbosity) やハンドラを望みの" -"とおりに設定することを困難にしたり、不可能にしてしまいます。" - -#: ../../howto/logging.rst:855 +#: ../../howto/logging.rst:835 msgid "" "It is strongly advised that you *do not add any handlers other than* :class:" "`~logging.NullHandler` *to your library's loggers*. This is because the " @@ -1581,11 +1359,11 @@ msgstr "" "ています。ハンドラを 'ボンネットの中で' 加えてしまうと、ユニットテストをして" "必要に応じたログを送達する能力に干渉しかねません。" -#: ../../howto/logging.rst:866 +#: ../../howto/logging.rst:846 msgid "Logging Levels" msgstr "ロギングレベル" -#: ../../howto/logging.rst:868 +#: ../../howto/logging.rst:848 msgid "" "The numeric values of logging levels are given in the following table. These " "are primarily of interest if you want to define your own levels, and need " @@ -1598,39 +1376,39 @@ msgstr "" "るためには具体的な値が必要になります。もし数値が他のレベルと同じだったら、既" "存の値は上書きされその名前は失われます。" -#: ../../howto/logging.rst:875 +#: ../../howto/logging.rst:855 msgid "Numeric value" msgstr "数値" -#: ../../howto/logging.rst:877 +#: ../../howto/logging.rst:857 msgid "50" msgstr "50" -#: ../../howto/logging.rst:879 +#: ../../howto/logging.rst:859 msgid "40" msgstr "40" -#: ../../howto/logging.rst:881 +#: ../../howto/logging.rst:861 msgid "30" msgstr "30" -#: ../../howto/logging.rst:883 +#: ../../howto/logging.rst:863 msgid "20" msgstr "20" -#: ../../howto/logging.rst:885 +#: ../../howto/logging.rst:865 msgid "10" msgstr "10" -#: ../../howto/logging.rst:887 +#: ../../howto/logging.rst:867 msgid "``NOTSET``" msgstr "``NOTSET``" -#: ../../howto/logging.rst:887 +#: ../../howto/logging.rst:867 msgid "0" msgstr "0" -#: ../../howto/logging.rst:890 +#: ../../howto/logging.rst:870 msgid "" "Levels can also be associated with loggers, being set either by the " "developer or through loading a saved logging configuration. When a logging " @@ -1646,7 +1424,7 @@ msgstr "" "のログメッセージは生成されません。これはログ出力の冗長性を制御するための基本" "的なメカニズムです。" -#: ../../howto/logging.rst:897 +#: ../../howto/logging.rst:877 msgid "" "Logging messages are encoded as instances of the :class:`~logging.LogRecord` " "class. When a logger decides to actually log an event, a :class:`~logging." @@ -1657,7 +1435,7 @@ msgstr "" "合、ログメッセージから :class:`~logging.LogRecord` インスタンスが生成されま" "す。" -#: ../../howto/logging.rst:901 +#: ../../howto/logging.rst:881 msgid "" "Logging messages are subjected to a dispatch mechanism through the use of :" "dfn:`handlers`, which are instances of subclasses of the :class:`Handler` " @@ -1685,7 +1463,7 @@ msgstr "" "出されます (ただしロガーの *propagate* フラグが false 値にセットされている場" "合を除きます。その場合は、祖先ハンドラへの伝搬はそこで止まります)。" -#: ../../howto/logging.rst:915 +#: ../../howto/logging.rst:895 msgid "" "Just as for loggers, handlers can have levels associated with them. A " "handler's level acts as a filter in the same way as a logger's level does. " @@ -1701,11 +1479,11 @@ msgstr "" "のサブクラスで、この :meth:`~Handler.emit` をオーバライドする必要があるでしょ" "う。" -#: ../../howto/logging.rst:924 +#: ../../howto/logging.rst:904 msgid "Custom Levels" msgstr "カスタムレベル" -#: ../../howto/logging.rst:926 +#: ../../howto/logging.rst:906 msgid "" "Defining your own levels is possible, but should not be necessary, as the " "existing levels have been chosen on the basis of practical experience. " @@ -1724,11 +1502,11 @@ msgstr "" "カスタムレベルを定義すると、与えられた数値が異なるライブラリで異なる意味にな" "りえるため、開発者がこれを制御または解釈するのが難しくなるからです。" -#: ../../howto/logging.rst:939 +#: ../../howto/logging.rst:919 msgid "Useful Handlers" msgstr "便利なハンドラ" -#: ../../howto/logging.rst:941 +#: ../../howto/logging.rst:921 msgid "" "In addition to the base :class:`Handler` class, many useful subclasses are " "provided:" @@ -1736,7 +1514,7 @@ msgstr "" "基底の :class:`Handler` クラスに加え、多くの便利なサブクラスが提供されていま" "す:" -#: ../../howto/logging.rst:944 +#: ../../howto/logging.rst:924 msgid "" ":class:`StreamHandler` instances send messages to streams (file-like " "objects)." @@ -1744,12 +1522,12 @@ msgstr "" ":class:`StreamHandler` インスタンスは、メッセージをストリーム (ファイル風オブ" "ジェクト) に送ります。" -#: ../../howto/logging.rst:947 +#: ../../howto/logging.rst:927 msgid ":class:`FileHandler` instances send messages to disk files." msgstr "" ":class:`FileHandler` インスタンスは、メッセージをディスクファイルに送ります。" -#: ../../howto/logging.rst:949 +#: ../../howto/logging.rst:929 msgid "" ":class:`~handlers.BaseRotatingHandler` is the base class for handlers that " "rotate log files at a certain point. It is not meant to be instantiated " @@ -1761,7 +1539,7 @@ msgstr "" "ん。代わりに、 :class:`~handlers.RotatingFileHandler` や :class:`~handlers." "TimedRotatingFileHandler` を使用してください。" -#: ../../howto/logging.rst:954 +#: ../../howto/logging.rst:934 msgid "" ":class:`~handlers.RotatingFileHandler` instances send messages to disk " "files, with support for maximum log file sizes and log file rotation." @@ -1769,7 +1547,7 @@ msgstr "" ":class:`~handlers.RotatingFileHandler` インスタンスは、メッセージをディスク" "ファイルに送り、最大ログファイル数とログファイル循環をサポートします。" -#: ../../howto/logging.rst:957 +#: ../../howto/logging.rst:937 msgid "" ":class:`~handlers.TimedRotatingFileHandler` instances send messages to disk " "files, rotating the log file at certain timed intervals." @@ -1777,7 +1555,7 @@ msgstr "" ":class:`~handlers.TimedRotatingFileHandler` インスタンスは、メッセージをディ" "スクファイルに送り、ログファイルを特定時間のインターバルで循環します。" -#: ../../howto/logging.rst:960 +#: ../../howto/logging.rst:940 msgid "" ":class:`~handlers.SocketHandler` instances send messages to TCP/IP sockets. " "Since 3.4, Unix domain sockets are also supported." @@ -1785,7 +1563,7 @@ msgstr "" ":class:`~handlers.SocketHandler` インスタンスは、 TCP/IP ソケットにメッセージ" "を送ります。バージョン3.4 から、 Unixドメインソケットもサポートされます。" -#: ../../howto/logging.rst:963 +#: ../../howto/logging.rst:943 msgid "" ":class:`~handlers.DatagramHandler` instances send messages to UDP sockets. " "Since 3.4, Unix domain sockets are also supported." @@ -1793,7 +1571,7 @@ msgstr "" ":class:`~handlers.DatagramHandler` インスタンスは UDP ソケットにメッセージを" "送ります。バージョン 3.4 から、Unix ドメインソケットもサポートされます。" -#: ../../howto/logging.rst:966 +#: ../../howto/logging.rst:946 msgid "" ":class:`~handlers.SMTPHandler` instances send messages to a designated email " "address." @@ -1801,7 +1579,7 @@ msgstr "" ":class:`~handlers.SMTPHandler` インスタンスは、メッセージを指示された email " "アドレスに送ります。" -#: ../../howto/logging.rst:969 +#: ../../howto/logging.rst:949 msgid "" ":class:`~handlers.SysLogHandler` instances send messages to a Unix syslog " "daemon, possibly on a remote machine." @@ -1809,7 +1587,7 @@ msgstr "" ":class:`~handlers.SysLogHandler` インスタンスは、メッセージを、必要ならばリ" "モートマシンの、Unix syslog daemon に送ります。" -#: ../../howto/logging.rst:972 +#: ../../howto/logging.rst:952 msgid "" ":class:`~handlers.NTEventLogHandler` instances send messages to a Windows " "NT/2000/XP event log." @@ -1817,7 +1595,7 @@ msgstr "" ":class:`~handlers.NTEventLogHandler` インスタンスは、メッセージを Windows " "NT/2000/XP イベントログに送ります。" -#: ../../howto/logging.rst:975 +#: ../../howto/logging.rst:955 msgid "" ":class:`~handlers.MemoryHandler` instances send messages to a buffer in " "memory, which is flushed whenever specific criteria are met." @@ -1825,7 +1603,7 @@ msgstr "" ":class:`~handlers.MemoryHandler` インスタンスは、メッセージを、特定の基準が満" "たされる度に流される、メモリ中のバッファに送ります。" -#: ../../howto/logging.rst:978 +#: ../../howto/logging.rst:958 msgid "" ":class:`~handlers.HTTPHandler` instances send messages to an HTTP server " "using either ``GET`` or ``POST`` semantics." @@ -1833,7 +1611,7 @@ msgstr "" ":class:`~handlers.HTTPHandler` インスタンスは、メッセージを、 ``GET`` または " "``POST`` セマンティクスを使って、HTTP サーバに送ります。" -#: ../../howto/logging.rst:981 +#: ../../howto/logging.rst:961 msgid "" ":class:`~handlers.WatchedFileHandler` instances watch the file they are " "logging to. If the file changes, it is closed and reopened using the file " @@ -1845,38 +1623,39 @@ msgstr "" "使って再び開かれます。このハンドラは Unix 系のシステムにのみ便利です。" "Windows は、使われている基の機構をサポートしていません。" -#: ../../howto/logging.rst:986 +#: ../../howto/logging.rst:966 msgid "" ":class:`~handlers.QueueHandler` instances send messages to a queue, such as " "those implemented in the :mod:`queue` or :mod:`multiprocessing` modules." msgstr "" ":class:`~handlers.QueueHandler` インスタンスは、 :mod:`queue` モジュールや :" "mod:`multiprocessing` モジュールなどで実装されているキューにメッセージを送り" -"ます。" +"ます。 instances send messages to a queue, such as those implemented in the :" +"mod:`queue` or :mod:`multiprocessing` modules." -#: ../../howto/logging.rst:989 +#: ../../howto/logging.rst:969 msgid "" ":class:`NullHandler` instances do nothing with error messages. They are used " "by library developers who want to use logging, but want to avoid the 'No " -"handlers could be found for logger *XXX*' message which can be displayed if " +"handlers could be found for logger XXX' message which can be displayed if " "the library user has not configured logging. See :ref:`library-config` for " "more information." msgstr "" -":class:`NullHandler` インスタンスは、エラーメッセージについて何もしません。こ" -"のクラスはライブラリ開発者が、 logging は使いたいが、ライブラリのユーザーが " -"logging の設定をしなかったときに表示されうる 'No handlers could be found for " -"logger *XXX*' のようなメッセージを回避したいときに使います。詳しくは、 :ref:" -"`library-config` を参照してください。" +":class:`NullHandler` インスタンスは、エラーメッセージに対して何もしません。こ" +"れは、ライブラリ開発者がロギングを使いたいが、ライブラリのユーザがロギングを" +"設定してなくても 'No handlers could be found for logger XXX' メッセージを表示" +"させたくない場合に使われます。詳しい情報は :ref:`library-config` を参照してく" +"ださい。" -#: ../../howto/logging.rst:995 +#: ../../howto/logging.rst:975 msgid "The :class:`NullHandler` class." msgstr ":class:`NullHandler` クラス。" -#: ../../howto/logging.rst:998 +#: ../../howto/logging.rst:978 msgid "The :class:`~handlers.QueueHandler` class." msgstr ":class:`~handlers.QueueHandler` クラス。" -#: ../../howto/logging.rst:1001 +#: ../../howto/logging.rst:981 msgid "" "The :class:`NullHandler`, :class:`StreamHandler` and :class:`FileHandler` " "classes are defined in the core logging package. The other handlers are " @@ -1888,7 +1667,7 @@ msgstr "" "ジュールの :mod:`logging.handlers` で定義されています。(環境設定機能のための" "サブモジュール、 :mod:`logging.config` もあります。)" -#: ../../howto/logging.rst:1006 +#: ../../howto/logging.rst:986 msgid "" "Logged messages are formatted for presentation through instances of the :" "class:`Formatter` class. They are initialized with a format string suitable " @@ -1898,18 +1677,18 @@ msgstr "" "ト化してから表示されます。このインスタンスは、 % 演算子と辞書で使うのに適切な" "フォーマット文字列で初期化されます。" -#: ../../howto/logging.rst:1010 +#: ../../howto/logging.rst:990 msgid "" -"For formatting multiple messages in a batch, instances of :class:" -"`BufferingFormatter` can be used. In addition to the format string (which is " +"For formatting multiple messages in a batch, instances of :class:`~handlers." +"BufferingFormatter` can be used. In addition to the format string (which is " "applied to each message in the batch), there is provision for header and " "trailer format strings." msgstr "" -"複数のメッセージを一括してフォーマット化するには、 :class:" -"`BufferingFormatter` が使えます。(一連の文字列のそれぞれに適用される) フォー" +"複数のメッセージを一括してフォーマット化するには、 :class:`~handlers." +"BufferingFormatter` が使えます。(一連の文字列のそれぞれに適用される) フォー" "マット文字列に加え、ヘッダとトレーラフォーマット文字列も提供されています。" -#: ../../howto/logging.rst:1015 +#: ../../howto/logging.rst:995 msgid "" "When filtering based on logger level and/or handler level is not enough, " "instances of :class:`Filter` can be added to both :class:`Logger` and :class:" @@ -1925,7 +1704,7 @@ msgstr "" "求めます。フィルタのいずれかが偽値を返したら、メッセージの処理は続けられませ" "ん。" -#: ../../howto/logging.rst:1022 +#: ../../howto/logging.rst:1002 msgid "" "The basic :class:`Filter` functionality allows filtering by specific logger " "name. If this feature is used, messages sent to the named logger and its " @@ -1935,11 +1714,11 @@ msgstr "" "この機能が使われると、指名されたロガーに送られたメッセージとその子だけがフィ" "ルタを通り、その他は落とされます。" -#: ../../howto/logging.rst:1030 +#: ../../howto/logging.rst:1010 msgid "Exceptions raised during logging" msgstr "ログ記録中に発生する例外" -#: ../../howto/logging.rst:1032 +#: ../../howto/logging.rst:1012 msgid "" "The logging package is designed to swallow exceptions which occur while " "logging in production. This is so that errors which occur while handling " @@ -1951,7 +1730,7 @@ msgstr "" "の設定ミス、ネットワークまたは他の同様のエラー) によってログ記録を使用するア" "プリケーションが早期に終了しないようにするためです。" -#: ../../howto/logging.rst:1037 +#: ../../howto/logging.rst:1017 msgid "" ":class:`SystemExit` and :class:`KeyboardInterrupt` exceptions are never " "swallowed. Other exceptions which occur during the :meth:`~Handler.emit` " @@ -1962,7 +1741,7 @@ msgstr "" "ん。 :class:`Handler` サブクラスの :meth:`~Handler.emit` メソッドの間に起こる" "他の例外は、 :meth:`~Handler.handleError` メソッドに渡されます。" -#: ../../howto/logging.rst:1042 +#: ../../howto/logging.rst:1022 msgid "" "The default implementation of :meth:`~Handler.handleError` in :class:" "`Handler` checks to see if a module-level variable, :data:`raiseExceptions`, " @@ -1974,7 +1753,7 @@ msgstr "" "設定されているなら、トレースバックが :data:`sys.stderr` に出力されます。設定" "されていないなら、例外は飲み込まれます。" -#: ../../howto/logging.rst:1048 +#: ../../howto/logging.rst:1027 msgid "" "The default value of :data:`raiseExceptions` is ``True``. This is because " "during development, you typically want to be notified of any exceptions that " @@ -1985,11 +1764,11 @@ msgstr "" "こるどんな例外についても通常は通知してほしいからです。実運用環境では :data:" "`raiseExceptions` を ``False`` に設定することをお勧めします。" -#: ../../howto/logging.rst:1058 +#: ../../howto/logging.rst:1037 msgid "Using arbitrary objects as messages" msgstr "任意のオブジェクトをメッセージに使用する" -#: ../../howto/logging.rst:1060 +#: ../../howto/logging.rst:1039 msgid "" "In the preceding sections and examples, it has been assumed that the message " "passed when logging the event is a string. However, this is not the only " @@ -2009,11 +1788,11 @@ msgstr "" "SocketHandler` は、イベントを pickle してネットワーク上で送信することでログ出" "力します。" -#: ../../howto/logging.rst:1071 +#: ../../howto/logging.rst:1050 msgid "Optimization" msgstr "最適化" -#: ../../howto/logging.rst:1073 +#: ../../howto/logging.rst:1052 msgid "" "Formatting of message arguments is deferred until it cannot be avoided. " "However, computing the arguments passed to the logging method can also be " @@ -2030,22 +1809,15 @@ msgstr "" "のメソッドは引数にレベルを取って、そのレベルの呼び出しに対して Logger がイベ" "ントを生成するなら true を返します。このようにコードを書くことができます::" -#: ../../howto/logging.rst:1081 -msgid "" -"if logger.isEnabledFor(logging.DEBUG):\n" -" logger.debug('Message with %s, %s', expensive_func1(),\n" -" expensive_func2())" -msgstr "" - -#: ../../howto/logging.rst:1085 +#: ../../howto/logging.rst:1064 msgid "" -"so that if the logger's threshold is set above ``DEBUG``, the calls to " -"``expensive_func1`` and ``expensive_func2`` are never made." +"so that if the logger's threshold is set above ``DEBUG``, the calls to :func:" +"`expensive_func1` and :func:`expensive_func2` are never made." msgstr "" -"このようにすると、ロガーの閾値が ``DEBUG`` より上に設定されている場合、 " -"``expensive_func1`` と ``expensive_func2`` の呼び出しは行われません。" +"このようにすると、ロガーの閾値が ``DEBUG`` より上に設定されている場合、 :" +"func:`expensive_func1` と :func:`expensive_func2` の呼び出しは行われません。" -#: ../../howto/logging.rst:1088 +#: ../../howto/logging.rst:1067 msgid "" "In some cases, :meth:`~Logger.isEnabledFor` can itself be more expensive " "than you'd like (e.g. for deeply nested loggers where an explicit level is " @@ -2065,7 +1837,7 @@ msgstr "" "は、(まったく一般的ではありませんが)ロギング設定がアプリケーション実行中に動" "的に変更された場合にのみ再計算が必要でしょう。" -#: ../../howto/logging.rst:1097 +#: ../../howto/logging.rst:1076 msgid "" "There are other optimizations which can be made for specific applications " "which need more precise control over what logging information is collected. " @@ -2076,19 +1848,19 @@ msgstr "" "要とする、特定のアプリケーションでできる最適化があります。これは、ログ記録の" "間の不要な処理を避けるためにできることのリストです:" -#: ../../howto/logging.rst:1103 +#: ../../howto/logging.rst:1082 msgid "What you don't want to collect" msgstr "不要な情報" -#: ../../howto/logging.rst:1103 +#: ../../howto/logging.rst:1082 msgid "How to avoid collecting it" msgstr "それを避ける方法" -#: ../../howto/logging.rst:1105 +#: ../../howto/logging.rst:1084 msgid "Information about where calls were made from." msgstr "呼び出しがどこから行われたかに関する情報。" -#: ../../howto/logging.rst:1105 +#: ../../howto/logging.rst:1084 msgid "" "Set ``logging._srcfile`` to ``None``. This avoids calling :func:`sys." "_getframe`, which may help to speed up your code in environments like PyPy " @@ -2098,43 +1870,23 @@ msgstr "" "_getframe` 呼び出しを避けることが出来、PyPy のような環境(:func:`sys." "_getframe` の高速化が出来ない)において高速化の役に立ちます。" -#: ../../howto/logging.rst:1111 +#: ../../howto/logging.rst:1091 msgid "Threading information." msgstr "スレッド情報。" -#: ../../howto/logging.rst:1111 -msgid "Set ``logging.logThreads`` to ``False``." -msgstr "``logging.logThreads`` を ``False`` にする。" - -#: ../../howto/logging.rst:1113 -msgid "Current process ID (:func:`os.getpid`)" -msgstr "現在のプロセスID(:func:`os.getpid`)" - -#: ../../howto/logging.rst:1113 -msgid "Set ``logging.logProcesses`` to ``False``." -msgstr "``logging.logProcesses`` を ``False`` にする。" - -#: ../../howto/logging.rst:1115 -msgid "" -"Current process name when using ``multiprocessing`` to manage multiple " -"processes." -msgstr "" -"マルチプロセスの制御に ``multiprocessing`` を使っているときの、現在のプロセス" -"名" - -#: ../../howto/logging.rst:1115 -msgid "Set ``logging.logMultiprocessing`` to ``False``." -msgstr "``logging.logMultiprocessing`` を ``False`` にする。" +#: ../../howto/logging.rst:1091 +msgid "Set ``logging.logThreads`` to ``0``." +msgstr "``logging.logThreads`` を ``0`` にする。" -#: ../../howto/logging.rst:1118 -msgid "Current :class:`asyncio.Task` name when using ``asyncio``." -msgstr "``asyncio`` を使っているときの、現在の :class:`asyncio.Task` の名前。" +#: ../../howto/logging.rst:1093 +msgid "Process information." +msgstr "プロセス情報。" -#: ../../howto/logging.rst:1118 -msgid "Set ``logging.logAsyncioTasks`` to ``False``." -msgstr "``logging.logAsyncioTasks`` を ``False`` に設定する。" +#: ../../howto/logging.rst:1093 +msgid "Set ``logging.logProcesses`` to ``0``." +msgstr "``logging.logProcesses`` を ``0`` にする。" -#: ../../howto/logging.rst:1122 +#: ../../howto/logging.rst:1096 msgid "" "Also note that the core logging module only includes the basic handlers. If " "you don't import :mod:`logging.handlers` and :mod:`logging.config`, they " @@ -2144,34 +1896,30 @@ msgstr "" "ください。 :mod:`logging.handlers` と :mod:`logging.config` をインポートしな" "ければ、余分なメモリを消費することはありません。" -#: ../../howto/logging.rst:1129 -msgid "Other resources" -msgstr "その他のリソース" - -#: ../../howto/logging.rst:1133 +#: ../../howto/logging.rst:1103 msgid "Module :mod:`logging`" msgstr ":mod:`logging` モジュール" -#: ../../howto/logging.rst:1134 +#: ../../howto/logging.rst:1103 msgid "API reference for the logging module." msgstr "logging モジュールの API リファレンス。" -#: ../../howto/logging.rst:1136 +#: ../../howto/logging.rst:1106 msgid "Module :mod:`logging.config`" msgstr ":mod:`logging.config` モジュール" -#: ../../howto/logging.rst:1137 +#: ../../howto/logging.rst:1106 msgid "Configuration API for the logging module." msgstr "logging モジュールの環境設定 API です。" -#: ../../howto/logging.rst:1139 +#: ../../howto/logging.rst:1109 msgid "Module :mod:`logging.handlers`" msgstr ":mod:`logging.handlers` モジュール" -#: ../../howto/logging.rst:1140 +#: ../../howto/logging.rst:1109 msgid "Useful handlers included with the logging module." msgstr "logging モジュールに含まれる、便利なハンドラです。" -#: ../../howto/logging.rst:1142 +#: ../../howto/logging.rst:1111 msgid ":ref:`A logging cookbook `" msgstr ":ref:`ロギングクックブック `" diff --git a/howto/mro.po b/howto/mro.po deleted file mode 100644 index afc6a62c5..000000000 --- a/howto/mro.po +++ /dev/null @@ -1,910 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation -# This file is distributed under the same license as the Python package. -# FIRST AUTHOR , YEAR. -# -# Translators: -# tomo, 2024 -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: Python 3.14\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2024-04-19 14:15+0000\n" -"Last-Translator: tomo, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" -"ja/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#: ../../howto/mro.rst:4 -msgid "The Python 2.3 Method Resolution Order" -msgstr "" - -#: ../../howto/mro.rst:8 -msgid "" -"This is a historical document, provided as an appendix to the official " -"documentation. The Method Resolution Order discussed here was *introduced* " -"in Python 2.3, but it is still used in later versions -- including Python 3." -msgstr "" - -#: ../../howto/mro.rst:13 -msgid "By `Michele Simionato `__." -msgstr "" - -#: ../../howto/mro.rst:0 -msgid "Abstract" -msgstr "概要" - -#: ../../howto/mro.rst:17 -msgid "" -"*This document is intended for Python programmers who want to understand the " -"C3 Method Resolution Order used in Python 2.3. Although it is not intended " -"for newbies, it is quite pedagogical with many worked out examples. I am " -"not aware of other publicly available documents with the same scope, " -"therefore it should be useful.*" -msgstr "" - -#: ../../howto/mro.rst:23 -msgid "Disclaimer:" -msgstr "" - -#: ../../howto/mro.rst:25 -msgid "" -"*I donate this document to the Python Software Foundation, under the Python " -"2.3 license. As usual in these circumstances, I warn the reader that what " -"follows* should *be correct, but I don't give any warranty. Use it at your " -"own risk and peril!*" -msgstr "" - -#: ../../howto/mro.rst:30 -msgid "Acknowledgments:" -msgstr "" - -#: ../../howto/mro.rst:32 -msgid "" -"*All the people of the Python mailing list who sent me their support. Paul " -"Foley who pointed out various imprecisions and made me to add the part on " -"local precedence ordering. David Goodger for help with the formatting in " -"reStructuredText. David Mertz for help with the editing. Finally, Guido van " -"Rossum who enthusiastically added this document to the official Python 2.3 " -"home-page.*" -msgstr "" - -#: ../../howto/mro.rst:40 -msgid "The beginning" -msgstr "" - -#: ../../howto/mro.rst:42 -msgid "*Felix qui potuit rerum cognoscere causas* -- Virgilius" -msgstr "" - -#: ../../howto/mro.rst:44 -msgid "" -"Everything started with a post by Samuele Pedroni to the Python development " -"mailing list [#]_. In his post, Samuele showed that the Python 2.2 method " -"resolution order is not monotonic and he proposed to replace it with the C3 " -"method resolution order. Guido agreed with his arguments and therefore now " -"Python 2.3 uses C3. The C3 method itself has nothing to do with Python, " -"since it was invented by people working on Dylan and it is described in a " -"paper intended for lispers [#]_. The present paper gives a (hopefully) " -"readable discussion of the C3 algorithm for Pythonistas who want to " -"understand the reasons for the change." -msgstr "" - -#: ../../howto/mro.rst:55 -msgid "" -"First of all, let me point out that what I am going to say only applies to " -"the *new style classes* introduced in Python 2.2: *classic classes* " -"maintain their old method resolution order, depth first and then left to " -"right. Therefore, there is no breaking of old code for classic classes; and " -"even if in principle there could be breaking of code for Python 2.2 new " -"style classes, in practice the cases in which the C3 resolution order " -"differs from the Python 2.2 method resolution order are so rare that no real " -"breaking of code is expected. Therefore:" -msgstr "" - -#: ../../howto/mro.rst:64 -msgid "*Don't be scared!*" -msgstr "" - -#: ../../howto/mro.rst:66 -msgid "" -"Moreover, unless you make strong use of multiple inheritance and you have " -"non-trivial hierarchies, you don't need to understand the C3 algorithm, and " -"you can easily skip this paper. On the other hand, if you really want to " -"know how multiple inheritance works, then this paper is for you. The good " -"news is that things are not as complicated as you might expect." -msgstr "" - -#: ../../howto/mro.rst:73 -msgid "Let me begin with some basic definitions." -msgstr "" - -#: ../../howto/mro.rst:75 -msgid "" -"Given a class C in a complicated multiple inheritance hierarchy, it is a non-" -"trivial task to specify the order in which methods are overridden, i.e. to " -"specify the order of the ancestors of C." -msgstr "" - -#: ../../howto/mro.rst:79 -msgid "" -"The list of the ancestors of a class C, including the class itself, ordered " -"from the nearest ancestor to the furthest, is called the class precedence " -"list or the *linearization* of C." -msgstr "" - -#: ../../howto/mro.rst:83 -msgid "" -"The *Method Resolution Order* (MRO) is the set of rules that construct the " -"linearization. In the Python literature, the idiom \"the MRO of C\" is also " -"used as a synonymous for the linearization of the class C." -msgstr "" - -#: ../../howto/mro.rst:88 -msgid "" -"For instance, in the case of single inheritance hierarchy, if C is a " -"subclass of C1, and C1 is a subclass of C2, then the linearization of C is " -"simply the list [C, C1 , C2]. However, with multiple inheritance " -"hierarchies, the construction of the linearization is more cumbersome, since " -"it is more difficult to construct a linearization that respects *local " -"precedence ordering* and *monotonicity*." -msgstr "" - -#: ../../howto/mro.rst:96 -msgid "" -"I will discuss the local precedence ordering later, but I can give the " -"definition of monotonicity here. A MRO is monotonic when the following is " -"true: *if C1 precedes C2 in the linearization of C, then C1 precedes C2 in " -"the linearization of any subclass of C*. Otherwise, the innocuous operation " -"of deriving a new class could change the resolution order of methods, " -"potentially introducing very subtle bugs. Examples where this happens will " -"be shown later." -msgstr "" - -#: ../../howto/mro.rst:104 -msgid "" -"Not all classes admit a linearization. There are cases, in complicated " -"hierarchies, where it is not possible to derive a class such that its " -"linearization respects all the desired properties." -msgstr "" - -#: ../../howto/mro.rst:108 -msgid "Here I give an example of this situation. Consider the hierarchy" -msgstr "" - -#: ../../howto/mro.rst:116 -msgid "" -"which can be represented with the following inheritance graph, where I have " -"denoted with O the ``object`` class, which is the beginning of any hierarchy " -"for new style classes:" -msgstr "" - -#: ../../howto/mro.rst:120 -msgid "" -" -----------\n" -"| |\n" -"| O |\n" -"| / \\ |\n" -" - X Y /\n" -" | / | /\n" -" | / |/\n" -" A B\n" -" \\ /\n" -" ?" -msgstr "" - -#: ../../howto/mro.rst:133 -msgid "" -"In this case, it is not possible to derive a new class C from A and B, since " -"X precedes Y in A, but Y precedes X in B, therefore the method resolution " -"order would be ambiguous in C." -msgstr "" - -#: ../../howto/mro.rst:137 -msgid "" -"Python 2.3 raises an exception in this situation (TypeError: MRO conflict " -"among bases Y, X) forbidding the naive programmer from creating ambiguous " -"hierarchies. Python 2.2 instead does not raise an exception, but chooses an " -"*ad hoc* ordering (CABXYO in this case)." -msgstr "" - -#: ../../howto/mro.rst:143 -msgid "The C3 Method Resolution Order" -msgstr "" - -#: ../../howto/mro.rst:145 -msgid "" -"Let me introduce a few simple notations which will be useful for the " -"following discussion. I will use the shortcut notation::" -msgstr "" - -#: ../../howto/mro.rst:148 -msgid "C1 C2 ... CN" -msgstr "" - -#: ../../howto/mro.rst:150 -msgid "to indicate the list of classes [C1, C2, ... , CN]." -msgstr "" - -#: ../../howto/mro.rst:152 -msgid "The *head* of the list is its first element::" -msgstr "" - -#: ../../howto/mro.rst:154 -msgid "head = C1" -msgstr "" - -#: ../../howto/mro.rst:156 -msgid "whereas the *tail* is the rest of the list::" -msgstr "" - -#: ../../howto/mro.rst:158 -msgid "tail = C2 ... CN." -msgstr "" - -#: ../../howto/mro.rst:160 -msgid "I shall also use the notation::" -msgstr "" - -#: ../../howto/mro.rst:162 -msgid "C + (C1 C2 ... CN) = C C1 C2 ... CN" -msgstr "" - -#: ../../howto/mro.rst:164 -msgid "to denote the sum of the lists [C] + [C1, C2, ... ,CN]." -msgstr "" - -#: ../../howto/mro.rst:166 -msgid "Now I can explain how the MRO works in Python 2.3." -msgstr "" - -#: ../../howto/mro.rst:168 -msgid "" -"Consider a class C in a multiple inheritance hierarchy, with C inheriting " -"from the base classes B1, B2, ... , BN. We want to compute the " -"linearization L[C] of the class C. The rule is the following:" -msgstr "" - -#: ../../howto/mro.rst:173 -msgid "" -"*the linearization of C is the sum of C plus the merge of the linearizations " -"of the parents and the list of the parents.*" -msgstr "" - -#: ../../howto/mro.rst:176 -msgid "In symbolic notation::" -msgstr "" - -#: ../../howto/mro.rst:178 -msgid "L[C(B1 ... BN)] = C + merge(L[B1] ... L[BN], B1 ... BN)" -msgstr "" - -#: ../../howto/mro.rst:180 -msgid "" -"In particular, if C is the ``object`` class, which has no parents, the " -"linearization is trivial::" -msgstr "" - -#: ../../howto/mro.rst:183 -msgid "L[object] = object." -msgstr "" - -#: ../../howto/mro.rst:185 -msgid "" -"However, in general one has to compute the merge according to the following " -"prescription:" -msgstr "" - -#: ../../howto/mro.rst:188 -msgid "" -"*take the head of the first list, i.e L[B1][0]; if this head is not in the " -"tail of any of the other lists, then add it to the linearization of C and " -"remove it from the lists in the merge, otherwise look at the head of the " -"next list and take it, if it is a good head. Then repeat the operation " -"until all the class are removed or it is impossible to find good heads. In " -"this case, it is impossible to construct the merge, Python 2.3 will refuse " -"to create the class C and will raise an exception.*" -msgstr "" - -#: ../../howto/mro.rst:197 -msgid "" -"This prescription ensures that the merge operation *preserves* the ordering, " -"if the ordering can be preserved. On the other hand, if the order cannot be " -"preserved (as in the example of serious order disagreement discussed above) " -"then the merge cannot be computed." -msgstr "" - -#: ../../howto/mro.rst:202 -msgid "" -"The computation of the merge is trivial if C has only one parent (single " -"inheritance); in this case::" -msgstr "" - -#: ../../howto/mro.rst:205 -msgid "L[C(B)] = C + merge(L[B],B) = C + L[B]" -msgstr "" - -#: ../../howto/mro.rst:207 -msgid "" -"However, in the case of multiple inheritance things are more cumbersome and " -"I don't expect you can understand the rule without a couple of examples ;-)" -msgstr "" - -#: ../../howto/mro.rst:212 -msgid "Examples" -msgstr "使用例" - -#: ../../howto/mro.rst:214 -msgid "First example. Consider the following hierarchy:" -msgstr "" - -#: ../../howto/mro.rst:224 -msgid "In this case the inheritance graph can be drawn as:" -msgstr "" - -#: ../../howto/mro.rst:226 -msgid "" -" 6\n" -" ---\n" -"Level 3 | O | (more general)\n" -" / --- \\\n" -" / | \\ |\n" -" / | \\ |\n" -" / | \\ |\n" -" --- --- --- |\n" -"Level 2 3 | D | 4| E | | F | 5 |\n" -" --- --- --- |\n" -" \\ \\ _ / | |\n" -" \\ / \\ _ | |\n" -" \\ / \\ | |\n" -" --- --- |\n" -"Level 1 1 | B | | C | 2 |\n" -" --- --- |\n" -" \\ / |\n" -" \\ / \\ /\n" -" ---\n" -"Level 0 0 | A | (more specialized)\n" -" ---" -msgstr "" - -#: ../../howto/mro.rst:251 -msgid "The linearizations of O,D,E and F are trivial::" -msgstr "" - -#: ../../howto/mro.rst:253 -msgid "" -"L[O] = O\n" -"L[D] = D O\n" -"L[E] = E O\n" -"L[F] = F O" -msgstr "" - -#: ../../howto/mro.rst:258 -msgid "The linearization of B can be computed as::" -msgstr "" - -#: ../../howto/mro.rst:260 -msgid "L[B] = B + merge(DO, EO, DE)" -msgstr "" - -#: ../../howto/mro.rst:262 -msgid "" -"We see that D is a good head, therefore we take it and we are reduced to " -"compute ``merge(O,EO,E)``. Now O is not a good head, since it is in the " -"tail of the sequence EO. In this case the rule says that we have to skip to " -"the next sequence. Then we see that E is a good head; we take it and we are " -"reduced to compute ``merge(O,O)`` which gives O. Therefore::" -msgstr "" - -#: ../../howto/mro.rst:268 -msgid "L[B] = B D E O" -msgstr "" - -#: ../../howto/mro.rst:270 -msgid "Using the same procedure one finds::" -msgstr "" - -#: ../../howto/mro.rst:272 -msgid "" -"L[C] = C + merge(DO,FO,DF)\n" -" = C + D + merge(O,FO,F)\n" -" = C + D + F + merge(O,O)\n" -" = C D F O" -msgstr "" - -#: ../../howto/mro.rst:277 -msgid "Now we can compute::" -msgstr "" - -#: ../../howto/mro.rst:279 -msgid "" -"L[A] = A + merge(BDEO,CDFO,BC)\n" -" = A + B + merge(DEO,CDFO,C)\n" -" = A + B + C + merge(DEO,DFO)\n" -" = A + B + C + D + merge(EO,FO)\n" -" = A + B + C + D + E + merge(O,FO)\n" -" = A + B + C + D + E + F + merge(O,O)\n" -" = A B C D E F O" -msgstr "" - -#: ../../howto/mro.rst:287 -msgid "" -"In this example, the linearization is ordered in a pretty nice way according " -"to the inheritance level, in the sense that lower levels (i.e. more " -"specialized classes) have higher precedence (see the inheritance graph). " -"However, this is not the general case." -msgstr "" - -#: ../../howto/mro.rst:292 -msgid "" -"I leave as an exercise for the reader to compute the linearization for my " -"second example:" -msgstr "" - -#: ../../howto/mro.rst:303 -msgid "" -"The only difference with the previous example is the change B(D,E) --> B(E," -"D); however even such a little modification completely changes the ordering " -"of the hierarchy:" -msgstr "" - -#: ../../howto/mro.rst:307 -msgid "" -" 6\n" -" ---\n" -"Level 3 | O |\n" -" / --- \\\n" -" / | \\\n" -" / | \\\n" -" / | \\\n" -" --- --- ---\n" -"Level 2 2 | E | 4 | D | | F | 5\n" -" --- --- ---\n" -" \\ / \\ /\n" -" \\ / \\ /\n" -" \\ / \\ /\n" -" --- ---\n" -"Level 1 1 | B | | C | 3\n" -" --- ---\n" -" \\ /\n" -" \\ /\n" -" ---\n" -"Level 0 0 | A |\n" -" ---" -msgstr "" - -#: ../../howto/mro.rst:332 -msgid "" -"Notice that the class E, which is in the second level of the hierarchy, " -"precedes the class C, which is in the first level of the hierarchy, i.e. E " -"is more specialized than C, even if it is in a higher level." -msgstr "" - -#: ../../howto/mro.rst:336 -msgid "" -"A lazy programmer can obtain the MRO directly from Python 2.2, since in this " -"case it coincides with the Python 2.3 linearization. It is enough to invoke " -"the :meth:`~type.mro` method of class A:" -msgstr "" - -#: ../../howto/mro.rst:345 -msgid "" -"Finally, let me consider the example discussed in the first section, " -"involving a serious order disagreement. In this case, it is straightforward " -"to compute the linearizations of O, X, Y, A and B:" -msgstr "" - -#: ../../howto/mro.rst:349 -msgid "" -"L[O] = 0\n" -"L[X] = X O\n" -"L[Y] = Y O\n" -"L[A] = A X Y O\n" -"L[B] = B Y X O" -msgstr "" - -#: ../../howto/mro.rst:357 -msgid "" -"However, it is impossible to compute the linearization for a class C that " -"inherits from A and B::" -msgstr "" - -#: ../../howto/mro.rst:360 -msgid "" -"L[C] = C + merge(AXYO, BYXO, AB)\n" -" = C + A + merge(XYO, BYXO, B)\n" -" = C + A + B + merge(XYO, YXO)" -msgstr "" - -#: ../../howto/mro.rst:364 -msgid "" -"At this point we cannot merge the lists XYO and YXO, since X is in the tail " -"of YXO whereas Y is in the tail of XYO: therefore there are no good heads " -"and the C3 algorithm stops. Python 2.3 raises an error and refuses to " -"create the class C." -msgstr "" - -#: ../../howto/mro.rst:370 -msgid "Bad Method Resolution Orders" -msgstr "" - -#: ../../howto/mro.rst:372 -msgid "" -"A MRO is *bad* when it breaks such fundamental properties as local " -"precedence ordering and monotonicity. In this section, I will show that " -"both the MRO for classic classes and the MRO for new style classes in Python " -"2.2 are bad." -msgstr "" - -#: ../../howto/mro.rst:377 -msgid "" -"It is easier to start with the local precedence ordering. Consider the " -"following example:" -msgstr "" - -#: ../../howto/mro.rst:384 -msgid "with inheritance diagram" -msgstr "" - -#: ../../howto/mro.rst:386 -msgid "" -" O\n" -" |\n" -"(buy spam) F\n" -" | \\\n" -" | E (buy eggs)\n" -" | /\n" -" G\n" -"\n" -" (buy eggs or spam ?)" -msgstr "" - -#: ../../howto/mro.rst:399 -msgid "" -"We see that class G inherits from F and E, with F *before* E: therefore we " -"would expect the attribute *G.remember2buy* to be inherited by *F." -"remember2buy* and not by *E.remember2buy*: nevertheless Python 2.2 gives" -msgstr "" - -#: ../../howto/mro.rst:407 -msgid "" -"This is a breaking of local precedence ordering since the order in the local " -"precedence list, i.e. the list of the parents of G, is not preserved in the " -"Python 2.2 linearization of G::" -msgstr "" - -#: ../../howto/mro.rst:411 -msgid "L[G,P22]= G E F object # F *follows* E" -msgstr "" - -#: ../../howto/mro.rst:413 -msgid "" -"One could argue that the reason why F follows E in the Python 2.2 " -"linearization is that F is less specialized than E, since F is the " -"superclass of E; nevertheless the breaking of local precedence ordering is " -"quite non-intuitive and error prone. This is particularly true since it is " -"a different from old style classes:" -msgstr "" - -#: ../../howto/mro.rst:425 -msgid "" -"In this case the MRO is GFEF and the local precedence ordering is preserved." -msgstr "" - -#: ../../howto/mro.rst:428 -msgid "" -"As a general rule, hierarchies such as the previous one should be avoided, " -"since it is unclear if F should override E or vice-versa. Python 2.3 solves " -"the ambiguity by raising an exception in the creation of class G, " -"effectively stopping the programmer from generating ambiguous hierarchies. " -"The reason for that is that the C3 algorithm fails when the merge::" -msgstr "" - -#: ../../howto/mro.rst:435 -msgid "merge(FO,EFO,FE)" -msgstr "" - -#: ../../howto/mro.rst:437 -msgid "" -"cannot be computed, because F is in the tail of EFO and E is in the tail of " -"FE." -msgstr "" - -#: ../../howto/mro.rst:440 -msgid "" -"The real solution is to design a non-ambiguous hierarchy, i.e. to derive G " -"from E and F (the more specific first) and not from F and E; in this case " -"the MRO is GEF without any doubt." -msgstr "" - -#: ../../howto/mro.rst:444 -msgid "" -" O\n" -" |\n" -" F (spam)\n" -" / |\n" -"(eggs) E |\n" -" \\ |\n" -" G\n" -" (eggs, no doubt)" -msgstr "" - -#: ../../howto/mro.rst:456 -msgid "" -"Python 2.3 forces the programmer to write good hierarchies (or, at least, " -"less error-prone ones)." -msgstr "" - -#: ../../howto/mro.rst:459 -msgid "" -"On a related note, let me point out that the Python 2.3 algorithm is smart " -"enough to recognize obvious mistakes, as the duplication of classes in the " -"list of parents:" -msgstr "" - -#: ../../howto/mro.rst:469 -msgid "" -"Python 2.2 (both for classic classes and new style classes) in this " -"situation, would not raise any exception." -msgstr "" - -#: ../../howto/mro.rst:472 -msgid "" -"Finally, I would like to point out two lessons we have learned from this " -"example:" -msgstr "" - -#: ../../howto/mro.rst:475 -msgid "" -"despite the name, the MRO determines the resolution order of attributes, not " -"only of methods;" -msgstr "" - -#: ../../howto/mro.rst:478 -msgid "" -"the default food for Pythonistas is spam ! (but you already knew that ;-)" -msgstr "" - -#: ../../howto/mro.rst:481 -msgid "" -"Having discussed the issue of local precedence ordering, let me now consider " -"the issue of monotonicity. My goal is to show that neither the MRO for " -"classic classes nor that for Python 2.2 new style classes is monotonic." -msgstr "" - -#: ../../howto/mro.rst:486 -msgid "" -"To prove that the MRO for classic classes is non-monotonic is rather " -"trivial, it is enough to look at the diamond diagram:" -msgstr "" - -#: ../../howto/mro.rst:489 -msgid "" -" C\n" -" / \\\n" -" / \\\n" -"A B\n" -" \\ /\n" -" \\ /\n" -" D" -msgstr "" - -#: ../../howto/mro.rst:500 -msgid "One easily discerns the inconsistency::" -msgstr "" - -#: ../../howto/mro.rst:502 -msgid "" -"L[B,P21] = B C # B precedes C : B's methods win\n" -"L[D,P21] = D A C B C # B follows C : C's methods win!" -msgstr "" - -#: ../../howto/mro.rst:505 -msgid "" -"On the other hand, there are no problems with the Python 2.2 and 2.3 MROs, " -"they give both::" -msgstr "" - -#: ../../howto/mro.rst:508 -msgid "L[D] = D A B C" -msgstr "" - -#: ../../howto/mro.rst:510 -msgid "" -"Guido points out in his essay [#]_ that the classic MRO is not so bad in " -"practice, since one can typically avoids diamonds for classic classes. But " -"all new style classes inherit from ``object``, therefore diamonds are " -"unavoidable and inconsistencies shows up in every multiple inheritance graph." -msgstr "" - -#: ../../howto/mro.rst:516 -msgid "" -"The MRO of Python 2.2 makes breaking monotonicity difficult, but not " -"impossible. The following example, originally provided by Samuele Pedroni, " -"shows that the MRO of Python 2.2 is non-monotonic:" -msgstr "" - -#: ../../howto/mro.rst:530 -msgid "" -"Here are the linearizations according to the C3 MRO (the reader should " -"verify these linearizations as an exercise and draw the inheritance " -"diagram ;-) ::" -msgstr "" - -#: ../../howto/mro.rst:534 -msgid "" -"L[A] = A O\n" -"L[B] = B O\n" -"L[C] = C O\n" -"L[D] = D O\n" -"L[E] = E O\n" -"L[K1]= K1 A B C O\n" -"L[K2]= K2 D B E O\n" -"L[K3]= K3 D A O\n" -"L[Z] = Z K1 K2 K3 D A B C E O" -msgstr "" - -#: ../../howto/mro.rst:544 -msgid "" -"Python 2.2 gives exactly the same linearizations for A, B, C, D, E, K1, K2 " -"and K3, but a different linearization for Z::" -msgstr "" - -#: ../../howto/mro.rst:547 -msgid "L[Z,P22] = Z K1 K3 A K2 D B C E O" -msgstr "" - -#: ../../howto/mro.rst:549 -msgid "" -"It is clear that this linearization is *wrong*, since A comes before D " -"whereas in the linearization of K3 A comes *after* D. In other words, in K3 " -"methods derived by D override methods derived by A, but in Z, which still is " -"a subclass of K3, methods derived by A override methods derived by D! This " -"is a violation of monotonicity. Moreover, the Python 2.2 linearization of Z " -"is also inconsistent with local precedence ordering, since the local " -"precedence list of the class Z is [K1, K2, K3] (K2 precedes K3), whereas in " -"the linearization of Z K2 *follows* K3. These problems explain why the 2.2 " -"rule has been dismissed in favor of the C3 rule." -msgstr "" - -#: ../../howto/mro.rst:561 -msgid "The end" -msgstr "" - -#: ../../howto/mro.rst:563 -msgid "" -"This section is for the impatient reader, who skipped all the previous " -"sections and jumped immediately to the end. This section is for the lazy " -"programmer too, who didn't want to exercise her/his brain. Finally, it is " -"for the programmer with some hubris, otherwise s/he would not be reading a " -"paper on the C3 method resolution order in multiple inheritance " -"hierarchies ;-) These three virtues taken all together (and *not* " -"separately) deserve a prize: the prize is a short Python 2.2 script that " -"allows you to compute the 2.3 MRO without risk to your brain. Simply change " -"the last line to play with the various examples I have discussed in this " -"paper.::" -msgstr "" - -#: ../../howto/mro.rst:574 -msgid "" -"#\n" -"\n" -"\"\"\"C3 algorithm by Samuele Pedroni (with readability enhanced by me)." -"\"\"\"\n" -"\n" -"class __metaclass__(type):\n" -" \"All classes are metamagically modified to be nicely printed\"\n" -" __repr__ = lambda cls: cls.__name__\n" -"\n" -"class ex_2:\n" -" \"Serious order disagreement\" #From Guido\n" -" class O: pass\n" -" class X(O): pass\n" -" class Y(O): pass\n" -" class A(X,Y): pass\n" -" class B(Y,X): pass\n" -" try:\n" -" class Z(A,B): pass #creates Z(A,B) in Python 2.2\n" -" except TypeError:\n" -" pass # Z(A,B) cannot be created in Python 2.3\n" -"\n" -"class ex_5:\n" -" \"My first example\"\n" -" class O: pass\n" -" class F(O): pass\n" -" class E(O): pass\n" -" class D(O): pass\n" -" class C(D,F): pass\n" -" class B(D,E): pass\n" -" class A(B,C): pass\n" -"\n" -"class ex_6:\n" -" \"My second example\"\n" -" class O: pass\n" -" class F(O): pass\n" -" class E(O): pass\n" -" class D(O): pass\n" -" class C(D,F): pass\n" -" class B(E,D): pass\n" -" class A(B,C): pass\n" -"\n" -"class ex_9:\n" -" \"Difference between Python 2.2 MRO and C3\" #From Samuele\n" -" class O: pass\n" -" class A(O): pass\n" -" class B(O): pass\n" -" class C(O): pass\n" -" class D(O): pass\n" -" class E(O): pass\n" -" class K1(A,B,C): pass\n" -" class K2(D,B,E): pass\n" -" class K3(D,A): pass\n" -" class Z(K1,K2,K3): pass\n" -"\n" -"def merge(seqs):\n" -" print '\\n\\nCPL[%s]=%s' % (seqs[0][0],seqs),\n" -" res = []; i=0\n" -" while 1:\n" -" nonemptyseqs=[seq for seq in seqs if seq]\n" -" if not nonemptyseqs: return res\n" -" i+=1; print '\\n',i,'round: candidates...',\n" -" for seq in nonemptyseqs: # find merge candidates among seq heads\n" -" cand = seq[0]; print ' ',cand,\n" -" nothead=[s for s in nonemptyseqs if cand in s[1:]]\n" -" if nothead: cand=None #reject candidate\n" -" else: break\n" -" if not cand: raise \"Inconsistent hierarchy\"\n" -" res.append(cand)\n" -" for seq in nonemptyseqs: # remove cand\n" -" if seq[0] == cand: del seq[0]\n" -"\n" -"def mro(C):\n" -" \"Compute the class precedence list (mro) according to C3\"\n" -" return merge([[C]]+map(mro,C.__bases__)+[list(C.__bases__)])\n" -"\n" -"def print_mro(C):\n" -" print '\\nMRO[%s]=%s' % (C,mro(C))\n" -" print '\\nP22 MRO[%s]=%s' % (C,C.mro())\n" -"\n" -"print_mro(ex_9.Z)\n" -"\n" -"#" -msgstr "" - -#: ../../howto/mro.rst:656 -msgid "That's all folks," -msgstr "" - -#: ../../howto/mro.rst:658 -msgid "enjoy !" -msgstr "" - -#: ../../howto/mro.rst:662 -msgid "Resources" -msgstr "" - -#: ../../howto/mro.rst:664 -msgid "" -"The thread on python-dev started by Samuele Pedroni: https://mail.python.org/" -"pipermail/python-dev/2002-October/029035.html" -msgstr "" - -#: ../../howto/mro.rst:667 -msgid "" -"The paper *A Monotonic Superclass Linearization for Dylan*: https://doi." -"org/10.1145/236337.236343" -msgstr "" - -#: ../../howto/mro.rst:670 -msgid "" -"Guido van Rossum's essay, *Unifying types and classes in Python 2.2*: " -"https://web.archive.org/web/20140210194412/http://www.python.org/download/" -"releases/2.2.2/descrintro" -msgstr "" diff --git a/howto/perf_profiling.po b/howto/perf_profiling.po deleted file mode 100644 index da01731ca..000000000 --- a/howto/perf_profiling.po +++ /dev/null @@ -1,458 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation -# This file is distributed under the same license as the Python package. -# FIRST AUTHOR , YEAR. -# -# Translators: -# tomo, 2023 -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: Python 3.14\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2023-05-24 13:07+0000\n" -"Last-Translator: tomo, 2023\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" -"ja/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#: ../../howto/perf_profiling.rst:7 -msgid "Python support for the Linux ``perf`` profiler" -msgstr "" - -#: ../../howto/perf_profiling.rst:0 -msgid "author" -msgstr "author" - -#: ../../howto/perf_profiling.rst:9 -msgid "Pablo Galindo" -msgstr "" - -#: ../../howto/perf_profiling.rst:11 -msgid "" -"`The Linux perf profiler `_ is a very powerful " -"tool that allows you to profile and obtain information about the performance " -"of your application. ``perf`` also has a very vibrant ecosystem of tools " -"that aid with the analysis of the data that it produces." -msgstr "" - -#: ../../howto/perf_profiling.rst:17 -msgid "" -"The main problem with using the ``perf`` profiler with Python applications " -"is that ``perf`` only gets information about native symbols, that is, the " -"names of functions and procedures written in C. This means that the names " -"and file names of Python functions in your code will not appear in the " -"output of ``perf``." -msgstr "" - -#: ../../howto/perf_profiling.rst:22 -msgid "" -"Since Python 3.12, the interpreter can run in a special mode that allows " -"Python functions to appear in the output of the ``perf`` profiler. When this " -"mode is enabled, the interpreter will interpose a small piece of code " -"compiled on the fly before the execution of every Python function and it " -"will teach ``perf`` the relationship between this piece of code and the " -"associated Python function using :doc:`perf map files <../c-api/perfmaps>`." -msgstr "" - -#: ../../howto/perf_profiling.rst:31 -msgid "" -"Support for the ``perf`` profiler is currently only available for Linux on " -"select architectures. Check the output of the ``configure`` build step or " -"check the output of ``python -m sysconfig | grep HAVE_PERF_TRAMPOLINE`` to " -"see if your system is supported." -msgstr "" - -#: ../../howto/perf_profiling.rst:36 -msgid "For example, consider the following script:" -msgstr "" - -#: ../../howto/perf_profiling.rst:38 -msgid "" -"def foo(n):\n" -" result = 0\n" -" for _ in range(n):\n" -" result += 1\n" -" return result\n" -"\n" -"def bar(n):\n" -" foo(n)\n" -"\n" -"def baz(n):\n" -" bar(n)\n" -"\n" -"if __name__ == \"__main__\":\n" -" baz(1000000)" -msgstr "" - -#: ../../howto/perf_profiling.rst:55 -msgid "We can run ``perf`` to sample CPU stack traces at 9999 hertz::" -msgstr "" - -#: ../../howto/perf_profiling.rst:57 -msgid "$ perf record -F 9999 -g -o perf.data python my_script.py" -msgstr "" - -#: ../../howto/perf_profiling.rst:59 -msgid "Then we can use ``perf report`` to analyze the data:" -msgstr "" - -#: ../../howto/perf_profiling.rst:61 -msgid "" -"$ perf report --stdio -n -g\n" -"\n" -"# Children Self Samples Command Shared Object Symbol\n" -"# ........ ........ ............ .......... .................. ..........................................\n" -"#\n" -" 91.08% 0.00% 0 python.exe python.exe [.] " -"_start\n" -" |\n" -" ---_start\n" -" |\n" -" --90.71%--__libc_start_main\n" -" Py_BytesMain\n" -" |\n" -" |--56.88%--pymain_run_python.constprop.0\n" -" | |\n" -" | |--56.13%--_PyRun_AnyFileObject\n" -" | | _PyRun_SimpleFileObject\n" -" | | |\n" -" | | |--55.02%--run_mod\n" -" | | | |\n" -" | | | --54.65%--" -"PyEval_EvalCode\n" -" | | | " -"_PyEval_EvalFrameDefault\n" -" | | | " -"PyObject_Vectorcall\n" -" | | | " -"_PyEval_Vector\n" -" | | | " -"_PyEval_EvalFrameDefault\n" -" | | | " -"PyObject_Vectorcall\n" -" | | | " -"_PyEval_Vector\n" -" | | | " -"_PyEval_EvalFrameDefault\n" -" | | | " -"PyObject_Vectorcall\n" -" | | | " -"_PyEval_Vector\n" -" | | | |\n" -" | | | " -"|--51.67%--_PyEval_EvalFrameDefault\n" -" | | | " -"| |\n" -" | | | " -"| |--11.52%--_PyLong_Add\n" -" | | | " -"| | |\n" -" | | | " -"| | |--2.97%--_PyObject_Malloc\n" -"..." -msgstr "" - -#: ../../howto/perf_profiling.rst:100 -msgid "" -"As you can see, the Python functions are not shown in the output, only " -"``_PyEval_EvalFrameDefault`` (the function that evaluates the Python " -"bytecode) shows up. Unfortunately that's not very useful because all Python " -"functions use the same C function to evaluate bytecode so we cannot know " -"which Python function corresponds to which bytecode-evaluating function." -msgstr "" - -#: ../../howto/perf_profiling.rst:105 -msgid "" -"Instead, if we run the same experiment with ``perf`` support enabled we get:" -msgstr "" - -#: ../../howto/perf_profiling.rst:107 -msgid "" -"$ perf report --stdio -n -g\n" -"\n" -"# Children Self Samples Command Shared Object Symbol\n" -"# ........ ........ ............ .......... .................. .....................................................................\n" -"#\n" -" 90.58% 0.36% 1 python.exe python.exe [.] " -"_start\n" -" |\n" -" ---_start\n" -" |\n" -" --89.86%--__libc_start_main\n" -" Py_BytesMain\n" -" |\n" -" |--55.43%--pymain_run_python.constprop.0\n" -" | |\n" -" | |--54.71%--_PyRun_AnyFileObject\n" -" | | _PyRun_SimpleFileObject\n" -" | | |\n" -" | | |--53.62%--run_mod\n" -" | | | |\n" -" | | | --53.26%--" -"PyEval_EvalCode\n" -" | | | py::" -":/src/script.py\n" -" | | | " -"_PyEval_EvalFrameDefault\n" -" | | | " -"PyObject_Vectorcall\n" -" | | | " -"_PyEval_Vector\n" -" | | | py::baz:/" -"src/script.py\n" -" | | | " -"_PyEval_EvalFrameDefault\n" -" | | | " -"PyObject_Vectorcall\n" -" | | | " -"_PyEval_Vector\n" -" | | | py::bar:/" -"src/script.py\n" -" | | | " -"_PyEval_EvalFrameDefault\n" -" | | | " -"PyObject_Vectorcall\n" -" | | | " -"_PyEval_Vector\n" -" | | | py::foo:/" -"src/script.py\n" -" | | | |\n" -" | | | " -"|--51.81%--_PyEval_EvalFrameDefault\n" -" | | | " -"| |\n" -" | | | " -"| |--13.77%--_PyLong_Add\n" -" | | | " -"| | |\n" -" | | | " -"| | |--3.26%--_PyObject_Malloc" -msgstr "" - -#: ../../howto/perf_profiling.rst:152 -msgid "How to enable ``perf`` profiling support" -msgstr "" - -#: ../../howto/perf_profiling.rst:154 -msgid "" -"``perf`` profiling support can be enabled either from the start using the " -"environment variable :envvar:`PYTHONPERFSUPPORT` or the :option:`-X perf <-" -"X>` option, or dynamically using :func:`sys.activate_stack_trampoline` and :" -"func:`sys.deactivate_stack_trampoline`." -msgstr "" - -#: ../../howto/perf_profiling.rst:160 -msgid "" -"The :mod:`!sys` functions take precedence over the :option:`!-X` option, " -"the :option:`!-X` option takes precedence over the environment variable." -msgstr "" - -#: ../../howto/perf_profiling.rst:163 -msgid "Example, using the environment variable::" -msgstr "" - -#: ../../howto/perf_profiling.rst:165 -msgid "" -"$ PYTHONPERFSUPPORT=1 perf record -F 9999 -g -o perf.data python my_script." -"py\n" -"$ perf report -g -i perf.data" -msgstr "" - -#: ../../howto/perf_profiling.rst:168 -msgid "Example, using the :option:`!-X` option::" -msgstr "" - -#: ../../howto/perf_profiling.rst:170 -msgid "" -"$ perf record -F 9999 -g -o perf.data python -X perf my_script.py\n" -"$ perf report -g -i perf.data" -msgstr "" - -#: ../../howto/perf_profiling.rst:173 -msgid "Example, using the :mod:`sys` APIs in file :file:`example.py`:" -msgstr "" - -#: ../../howto/perf_profiling.rst:175 -msgid "" -"import sys\n" -"\n" -"sys.activate_stack_trampoline(\"perf\")\n" -"do_profiled_stuff()\n" -"sys.deactivate_stack_trampoline()\n" -"\n" -"non_profiled_stuff()" -msgstr "" - -#: ../../howto/perf_profiling.rst:185 -msgid "...then::" -msgstr "" - -#: ../../howto/perf_profiling.rst:187 -msgid "" -"$ perf record -F 9999 -g -o perf.data python ./example.py\n" -"$ perf report -g -i perf.data" -msgstr "" - -#: ../../howto/perf_profiling.rst:192 -msgid "How to obtain the best results" -msgstr "" - -#: ../../howto/perf_profiling.rst:194 -msgid "" -"For best results, Python should be compiled with ``CFLAGS=\"-fno-omit-frame-" -"pointer -mno-omit-leaf-frame-pointer\"`` as this allows profilers to unwind " -"using only the frame pointer and not on DWARF debug information. This is " -"because as the code that is interposed to allow ``perf`` support is " -"dynamically generated it doesn't have any DWARF debugging information " -"available." -msgstr "" - -#: ../../howto/perf_profiling.rst:201 -msgid "" -"You can check if your system has been compiled with this flag by running::" -msgstr "" - -#: ../../howto/perf_profiling.rst:203 -msgid "$ python -m sysconfig | grep 'no-omit-frame-pointer'" -msgstr "" - -#: ../../howto/perf_profiling.rst:205 -msgid "" -"If you don't see any output it means that your interpreter has not been " -"compiled with frame pointers and therefore it may not be able to show Python " -"functions in the output of ``perf``." -msgstr "" - -#: ../../howto/perf_profiling.rst:211 -msgid "How to work without frame pointers" -msgstr "" - -#: ../../howto/perf_profiling.rst:213 -msgid "" -"If you are working with a Python interpreter that has been compiled without " -"frame pointers, you can still use the ``perf`` profiler, but the overhead " -"will be a bit higher because Python needs to generate unwinding information " -"for every Python function call on the fly. Additionally, ``perf`` will take " -"more time to process the data because it will need to use the DWARF " -"debugging information to unwind the stack and this is a slow process." -msgstr "" - -#: ../../howto/perf_profiling.rst:220 -msgid "" -"To enable this mode, you can use the environment variable :envvar:" -"`PYTHON_PERF_JIT_SUPPORT` or the :option:`-X perf_jit <-X>` option, which " -"will enable the JIT mode for the ``perf`` profiler." -msgstr "" - -#: ../../howto/perf_profiling.rst:226 -msgid "" -"Due to a bug in the ``perf`` tool, only ``perf`` versions higher than v6.8 " -"will work with the JIT mode. The fix was also backported to the v6.7.2 " -"version of the tool." -msgstr "" - -#: ../../howto/perf_profiling.rst:230 -msgid "" -"Note that when checking the version of the ``perf`` tool (which can be done " -"by running ``perf version``) you must take into account that some distros " -"add some custom version numbers including a ``-`` character. This means " -"that ``perf 6.7-3`` is not necessarily ``perf 6.7.3``." -msgstr "" - -#: ../../howto/perf_profiling.rst:235 -msgid "" -"When using the perf JIT mode, you need an extra step before you can run " -"``perf report``. You need to call the ``perf inject`` command to inject the " -"JIT information into the ``perf.data`` file.::" -msgstr "" - -#: ../../howto/perf_profiling.rst:239 -msgid "" -"$ perf record -F 9999 -g -k 1 --call-graph dwarf -o perf.data python -" -"Xperf_jit my_script.py\n" -"$ perf inject -i perf.data --jit --output perf.jit.data\n" -"$ perf report -g -i perf.jit.data" -msgstr "" - -#: ../../howto/perf_profiling.rst:243 -msgid "or using the environment variable::" -msgstr "" - -#: ../../howto/perf_profiling.rst:245 -msgid "" -"$ PYTHON_PERF_JIT_SUPPORT=1 perf record -F 9999 -g --call-graph dwarf -o " -"perf.data python my_script.py\n" -"$ perf inject -i perf.data --jit --output perf.jit.data\n" -"$ perf report -g -i perf.jit.data" -msgstr "" - -#: ../../howto/perf_profiling.rst:249 -msgid "" -"``perf inject --jit`` command will read ``perf.data``, automatically pick up " -"the perf dump file that Python creates (in ``/tmp/perf-$PID.dump``), and " -"then create ``perf.jit.data`` which merges all the JIT information together. " -"It should also create a lot of ``jitted-XXXX-N.so`` files in the current " -"directory which are ELF images for all the JIT trampolines that were created " -"by Python." -msgstr "" - -#: ../../howto/perf_profiling.rst:257 -msgid "" -"When using ``--call-graph dwarf``, the ``perf`` tool will take snapshots of " -"the stack of the process being profiled and save the information in the " -"``perf.data`` file. By default, the size of the stack dump is 8192 bytes, " -"but you can change the size by passing it after a comma like ``--call-graph " -"dwarf,16384``." -msgstr "" - -#: ../../howto/perf_profiling.rst:263 -msgid "" -"The size of the stack dump is important because if the size is too small " -"``perf`` will not be able to unwind the stack and the output will be " -"incomplete. On the other hand, if the size is too big, then ``perf`` won't " -"be able to sample the process as frequently as it would like as the overhead " -"will be higher." -msgstr "" - -#: ../../howto/perf_profiling.rst:269 -msgid "" -"The stack size is particularly important when profiling Python code compiled " -"with low optimization levels (like ``-O0``), as these builds tend to have " -"larger stack frames. If you are compiling Python with ``-O0`` and not seeing " -"Python functions in your profiling output, try increasing the stack dump " -"size to 65528 bytes (the maximum)::" -msgstr "" - -#: ../../howto/perf_profiling.rst:275 -msgid "" -"$ perf record -F 9999 -g -k 1 --call-graph dwarf,65528 -o perf.data python -" -"Xperf_jit my_script.py" -msgstr "" - -#: ../../howto/perf_profiling.rst:277 -msgid "Different compilation flags can significantly impact stack sizes:" -msgstr "" - -#: ../../howto/perf_profiling.rst:279 -msgid "" -"Builds with ``-O0`` typically have much larger stack frames than those with " -"``-O1`` or higher" -msgstr "" - -#: ../../howto/perf_profiling.rst:280 -msgid "" -"Adding optimizations (``-O1``, ``-O2``, etc.) typically reduces stack size" -msgstr "" - -#: ../../howto/perf_profiling.rst:281 -msgid "" -"Frame pointers (``-fno-omit-frame-pointer``) generally provide more reliable " -"stack unwinding" -msgstr "" diff --git a/howto/pyporting.po b/howto/pyporting.po index bf15dd932..bd002d887 100644 --- a/howto/pyporting.po +++ b/howto/pyporting.po @@ -1,46 +1,61 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 +# Nozomu Kaneko , 2017 +# ryosuke.mondo , 2017 +# Ikuru K , 2017 +# Arihiro TAKASE, 2017 +# Osamu NAKAMURA, 2017 +# SHIMIZU Taku , 2017 +# 秘湯 , 2018 +# tomo, 2019 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-06 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:53+0000\n" -"Last-Translator: tomo, 2021\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-08-05 07:09+0000\n" +"PO-Revision-Date: 2017-02-16 17:45+0000\n" +"Last-Translator: tomo, 2019\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: ../../howto/pyporting.rst:7 -msgid "How to port Python 2 Code to Python 3" -msgstr "" +#: ../../howto/pyporting.rst:5 +msgid "Porting Python 2 Code to Python 3" +msgstr "Python 2 から Python 3 への移植" #: ../../howto/pyporting.rst:0 msgid "author" msgstr "author" -#: ../../howto/pyporting.rst:9 +#: ../../howto/pyporting.rst:7 msgid "Brett Cannon" msgstr "Brett Cannon" +#: ../../howto/pyporting.rstNone +msgid "Abstract" +msgstr "概要" + #: ../../howto/pyporting.rst:11 msgid "" -"Python 2 reached its official end-of-life at the start of 2020. This means " -"that no new bug reports, fixes, or changes will be made to Python 2 - it's " -"no longer supported: see :pep:`373` and `status of Python versions `_." +"With Python 3 being the future of Python while Python 2 is still in active " +"use, it is good to have your project available for both major releases of " +"Python. This guide is meant to help you figure out how best to support both " +"Python 2 & 3 simultaneously." msgstr "" +"現在は Python 3 が最新版の Python ですが、 Python 2 もまだ活発に利用されてい" +"ます。なのであなたのプロジェクトを両方のメジャーリリースにおいて動作可能にし" +"ておくのがよいでしょう。このガイドでは、 Python 2 と 3 を同時にサポートするに" +"はどうすればよいかを解説します。" #: ../../howto/pyporting.rst:16 msgid "" @@ -52,40 +67,784 @@ msgstr "" #: ../../howto/pyporting.rst:19 msgid "" -"The archived python-porting_ mailing list may contain some useful guidance." +"If you would like to read one core Python developer's take on why Python 3 " +"came into existence, you can read Nick Coghlan's `Python 3 Q & A`_ or Brett " +"Cannon's `Why Python 3 exists`_." msgstr "" +"コア開発者の視点から Python3 が世に出てきたが理由を読みたい場合は、 Nick " +"Coghlan の `Python 3 Q & A`_ または `Brett Cannonによる `Why Python 3 " +"exists`_ がおすすめです。" -#: ../../howto/pyporting.rst:21 +#: ../../howto/pyporting.rst:24 msgid "" -"Since Python 3.11 the original porting guide was discontinued. You can find " -"the old guide in the `archive `_." +"For help with porting, you can view the archived python-porting_ mailing " +"list." msgstr "" #: ../../howto/pyporting.rst:27 -msgid "Third-party guides" -msgstr "" +msgid "The Short Explanation" +msgstr "短い説明" #: ../../howto/pyporting.rst:29 -msgid "There are also multiple third-party guides that might be useful:" +msgid "" +"To make your project be single-source Python 2/3 compatible, the basic steps " +"are:" msgstr "" +"あなたのプロジェクトを、単一ソースで Python 2/3 両方に対応させる基本的なス" +"テップは次のとおりです。" + +#: ../../howto/pyporting.rst:32 +msgid "Only worry about supporting Python 2.7" +msgstr "Python 2.7 だけをサポートすることに気を配ってください。" -#: ../../howto/pyporting.rst:31 -msgid "`Guide by Fedora `_" +#: ../../howto/pyporting.rst:33 +msgid "" +"Make sure you have good test coverage (coverage.py_ can help; ``python -m " +"pip install coverage``)" msgstr "" -#: ../../howto/pyporting.rst:32 -msgid "`PyCon 2020 tutorial `_" +#: ../../howto/pyporting.rst:35 ../../howto/pyporting.rst:122 +msgid "Learn the differences between Python 2 & 3" +msgstr "Python 2 と 3 の違いを学びましょう。" + +#: ../../howto/pyporting.rst:36 +msgid "" +"Use Futurize_ (or Modernize_) to update your code (e.g. ``python -m pip " +"install future``)" msgstr "" -#: ../../howto/pyporting.rst:33 +#: ../../howto/pyporting.rst:37 +msgid "" +"Use Pylint_ to help make sure you don't regress on your Python 3 support " +"(``python -m pip install pylint``)" +msgstr "" + +#: ../../howto/pyporting.rst:39 +msgid "" +"Use caniusepython3_ to find out which of your dependencies are blocking your " +"use of Python 3 (``python -m pip install caniusepython3``)" +msgstr "" + +#: ../../howto/pyporting.rst:41 +msgid "" +"Once your dependencies are no longer blocking you, use continuous " +"integration to make sure you stay compatible with Python 2 & 3 (tox_ can " +"help test against multiple versions of Python; ``python -m pip install tox``)" +msgstr "" + +#: ../../howto/pyporting.rst:44 +msgid "" +"Consider using optional static type checking to make sure your type usage " +"works in both Python 2 & 3 (e.g. use mypy_ to check your typing under both " +"Python 2 & Python 3; ``python -m pip install mypy``)." +msgstr "" + +#: ../../howto/pyporting.rst:50 +msgid "" +"Note: Using ``python -m pip install`` guarantees that the ``pip`` you invoke " +"is the one installed for the Python currently in use, whether it be a system-" +"wide ``pip`` or one installed within a :ref:`virtual environment `." +msgstr "" + +#: ../../howto/pyporting.rst:56 +msgid "Details" +msgstr "詳細" + +#: ../../howto/pyporting.rst:58 +msgid "" +"A key point about supporting Python 2 & 3 simultaneously is that you can " +"start **today**! Even if your dependencies are not supporting Python 3 yet " +"that does not mean you can't modernize your code **now** to support Python " +"3. Most changes required to support Python 3 lead to cleaner code using " +"newer practices even in Python 2 code." +msgstr "" +"Python 2 と 3 の同時サポートについてのキーポイントのひとつは、 **今日から** " +"開始出来る、というものです。たとえあなたが持っている依存物がまだ Python 3 を" +"サポートしていなくとも、それはあなたのコードを Python 3 サポートのために **今" +"すぐ** 現代化出来ないことを意味するのではありません。Python 3 サポートのため" +"に必要なほとんどの変更は、Python 2 コード内にあっても新しいプラクティスを伴う" +"明快なコードに導いてくれます。" + +#: ../../howto/pyporting.rst:64 msgid "" -"`Guide by DigitalOcean `_" +"Another key point is that modernizing your Python 2 code to also support " +"Python 3 is largely automated for you. While you might have to make some API " +"decisions thanks to Python 3 clarifying text data versus binary data, the " +"lower-level work is now mostly done for you and thus can at least benefit " +"from the automated changes immediately." +msgstr "" +"もうひとつのキーポイントは、あなたの Python 2 コードの Python 3 サポートを加" +"える現代化は、あなたのために大部分は自動化されているということです。Python 3 " +"によるテキストデータとバイナリデータの明確な区別のおかげで、あなたはいくつか" +"の API に決断をしなければならないかもしれない一方で、下位レベルの仕事は今やほ" +"とんど済んでいて、それゆえに最低でもその自動化された修正からの恩恵をすぐさま" +"受けることが出来ます。" + +#: ../../howto/pyporting.rst:70 +msgid "" +"Keep those key points in mind while you read on about the details of porting " +"your code to support Python 2 & 3 simultaneously." +msgstr "" +"Python 2 と 3 の同時サポートのために、あなたのコードを移植するための以降の詳" +"細を読む際には、これらのキーポイントを心に留めておいてください。" + +#: ../../howto/pyporting.rst:75 +msgid "Drop support for Python 2.6 and older" +msgstr "Python 2.6 とそれ以前のサポートを落とす" + +#: ../../howto/pyporting.rst:77 +msgid "" +"While you can make Python 2.5 work with Python 3, it is **much** easier if " +"you only have to work with Python 2.7. If dropping Python 2.5 is not an " +"option then the six_ project can help you support Python 2.5 & 3 " +"simultaneously (``python -m pip install six``). Do realize, though, that " +"nearly all the projects listed in this HOWTO will not be available to you." +msgstr "" + +#: ../../howto/pyporting.rst:83 +msgid "" +"If you are able to skip Python 2.5 and older, then the required changes to " +"your code should continue to look and feel like idiomatic Python code. At " +"worst you will have to use a function instead of a method in some instances " +"or have to import a function instead of using a built-in one, but otherwise " +"the overall transformation should not feel foreign to you." +msgstr "" +"Python 2.5 以下のサポートをスキップ出来るならば、あなたのコードに必要な変更" +"は Python の常套句のような外観と雰囲気を壊すべきではありません。最悪の場合あ" +"るインスタンス内のメソッドの代わりに関数を使う必要があったり、ビルトインを使" +"う代わりに関数をインポートする必要があるでしょうが、そうしないならば、全体通" +"した変換はあなたにとって異質に感じさせないものに違いありません。" + +#: ../../howto/pyporting.rst:89 +msgid "" +"But you should aim for only supporting Python 2.7. Python 2.6 is no longer " +"freely supported and thus is not receiving bugfixes. This means **you** will " +"have to work around any issues you come across with Python 2.6. There are " +"also some tools mentioned in this HOWTO which do not support Python 2.6 (e." +"g., Pylint_), and this will become more commonplace as time goes on. It will " +"simply be easier for you if you only support the versions of Python that you " +"have to support." +msgstr "" +"ですが、Python 2.6 以上と言わず Python 2.7 を目標にしてください。Python 2.6 " +"はもう積極的にはサポートされていません。これは **あなたが** Python 2.6 に関係" +"するあらゆる問題に取り組まなければならないことを意味します。この HOWTO で言及" +"しているいくつかのツールも Python 2.6 をサポートしていません (Pylint_ など)" +"し、時につれこのようなことはもっと当たり前になってくるでしょう。2.7 以上だけ" +"をサポートするということは、話をより簡単にしてくれます。" + +#: ../../howto/pyporting.rst:98 +msgid "" +"Make sure you specify the proper version support in your ``setup.py`` file" +msgstr "" +"あなたの ``setup.py`` ファイルに、相応しいサポートバージョンを明記することを" +"忘れないこと" + +#: ../../howto/pyporting.rst:100 +msgid "" +"In your ``setup.py`` file you should have the proper `trove classifier`_ " +"specifying what versions of Python you support. As your project does not " +"support Python 3 yet you should at least have ``Programming Language :: " +"Python :: 2 :: Only`` specified. Ideally you should also specify each major/" +"minor version of Python that you do support, e.g. ``Programming Language :: " +"Python :: 2.7``." +msgstr "" +"``setup.py`` ファイルに、あなたがサポートする Python バージョンを `Trove 分" +"類 `_ で正しく明記すべきです。あなたのプロジェクトはまだ " +"Python 3 をサポートしていないので、少なくとも ``Programming Language :: " +"Python :: 2 :: Only`` と明記すべきです。理想的には Python のメジャー/マイナー" +"バージョンも指定すべきです。例えば ``Programming Language :: Python :: 2.7`` " +"のように。" + +#: ../../howto/pyporting.rst:109 +msgid "Have good test coverage" +msgstr "良いテストカバレッジを確保する。" + +#: ../../howto/pyporting.rst:111 +msgid "" +"Once you have your code supporting the oldest version of Python 2 you want " +"it to, you will want to make sure your test suite has good coverage. A good " +"rule of thumb is that if you want to be confident enough in your test suite " +"that any failures that appear after having tools rewrite your code are " +"actual bugs in the tools and not in your code. If you want a number to aim " +"for, try to get over 80% coverage (and don't feel bad if you find it hard to " +"get better than 90% coverage). If you don't already have a tool to measure " +"test coverage then coverage.py_ is recommended." +msgstr "" +"そうしたい一番古いバージョンの Python 2 をサポート出来ているならば、あなたの" +"テストスイートが十分な網羅性かを確認したいでしょう。あなたのコードをツールで" +"書き換えた後に現れるあらゆる失敗が実際にはツールのバグで、あなたのコードのバ" +"グではないとするのに十分なだけの確信をあなたのテストスイートに持ちたいなら" +"ば、良い経験則がこれです。目標とする数値で言えば、80% 以上の網羅性を目指して" +"みてください (そしてカバレッジ 90% を越えるのが難しかったとしても気に病む必要" +"はありません)。テストカバレッジの計測ツールを手持ちでないならば、 coverage." +"py_ がお奨めです。" + +#: ../../howto/pyporting.rst:124 +msgid "" +"Once you have your code well-tested you are ready to begin porting your code " +"to Python 3! But to fully understand how your code is going to change and " +"what you want to look out for while you code, you will want to learn what " +"changes Python 3 makes in terms of Python 2. Typically the two best ways of " +"doing that is reading the :ref:`\"What's New\" ` doc for " +"each release of Python 3 and the `Porting to Python 3`_ book (which is free " +"online). There is also a handy `cheat sheet`_ from the Python-Future project." +msgstr "" + +#: ../../howto/pyporting.rst:134 +msgid "Update your code" +msgstr "コードをアップデートする。" + +#: ../../howto/pyporting.rst:136 +msgid "" +"Once you feel like you know what is different in Python 3 compared to Python " +"2, it's time to update your code! You have a choice between two tools in " +"porting your code automatically: Futurize_ and Modernize_. Which tool you " +"choose will depend on how much like Python 3 you want your code to be. " +"Futurize_ does its best to make Python 3 idioms and practices exist in " +"Python 2, e.g. backporting the ``bytes`` type from Python 3 so that you have " +"semantic parity between the major versions of Python. Modernize_, on the " +"other hand, is more conservative and targets a Python 2/3 subset of Python, " +"directly relying on six_ to help provide compatibility. As Python 3 is the " +"future, it might be best to consider Futurize to begin adjusting to any new " +"practices that Python 3 introduces which you are not accustomed to yet." +msgstr "" +"Python 2 と比較した Python 3 の違いがわかってきたら、いよいよあなたのコードを" +"更新するそのときです!\n" +"あなたのコードの移植の自動化ツールとしては 2 つの選択肢があります: Futurize_ " +"と Modernize_ です。\n" +"どちらのツールが良いかはあなたのコードをどのくらい Python 3 寄りに近付けたい" +"かによります。\n" +"Futurize_ は、例えば Python のメジャーバージョン間の意味論的な等価性を持つよ" +"うに Python 3 からバックポートされた ``bytes`` 型のように、Python 2 に取り込" +"まれた Python 3 のイディオムと慣例を積極的に使います。\n" +"他方 Modernize_ はより保守的で、互換性保持を six_ によって提供することで、 " +"Python 2/3 のサブセットであることを目標にします。\n" +"Python 3 は確実にやってくる未来なので、 Python 3 で導入された、まだ慣れていな" +"い新しい慣例に合わせ始めるためには Futurize を検討するのが最良かもしれませ" +"ん。" + +#: ../../howto/pyporting.rst:148 +msgid "" +"Regardless of which tool you choose, they will update your code to run under " +"Python 3 while staying compatible with the version of Python 2 you started " +"with. Depending on how conservative you want to be, you may want to run the " +"tool over your test suite first and visually inspect the diff to make sure " +"the transformation is accurate. After you have transformed your test suite " +"and verified that all the tests still pass as expected, then you can " +"transform your application code knowing that any tests which fail is a " +"translation failure." +msgstr "" +"どちらのツールを選ぶにせよ、それらはあなたのコードを、あなたが開始した " +"Python 2 バージョンへの互換性を保ったままで Python 3 で動作するように書き換え" +"ます。念には念を入れたければ、まずはテストスイートに対してツールを適用して、" +"変換が正しいものであることを確認するために差分を視覚的に点検しましょう。あな" +"たのテストスイートを変換して、テストがそれでもまだ期待通りにパスすることが検" +"証出来てしまえば、あなたのアプリケーションコードを、全ての失敗するテストは変" +"換の失敗を意味することがわかる状態で変換出来ます。" + +#: ../../howto/pyporting.rst:156 +msgid "" +"Unfortunately the tools can't automate everything to make your code work " +"under Python 3 and so there are a handful of things you will need to update " +"manually to get full Python 3 support (which of these steps are necessary " +"vary between the tools). Read the documentation for the tool you choose to " +"use to see what it fixes by default and what it can do optionally to know " +"what will (not) be fixed for you and what you may have to fix on your own (e." +"g. using ``io.open()`` over the built-in ``open()`` function is off by " +"default in Modernize). Luckily, though, there are only a couple of things to " +"watch out for which can be considered large issues that may be hard to debug " +"if not watched for." +msgstr "" +"悪い報せ。これらツールは Python 3 であなたのコードを動作させるために、全ての" +"自動化が出来ているわけではありませんので、Python 3 のフルサポートのためには手" +"動で更新しなければならないわずかばかりの事項があります(必要な手作業はツールに" +"よって違います)。選んだツールのドキュメントを読んで、デフォルトでは何が修正さ" +"れて、選択的に何を修正する(しない)を選べるのか、そして何を自身で修正する必要" +"があるのかを理解してください (例えばビルトインの ``open()`` ではなく ``io." +"open()`` を使う修正は、Modernize ではデフォルトでオフです)。良い報せ。です" +"が、注意深くみなければデバッグを困難にするような大きな問題として考えられる、" +"警戒するようなことは、2 つだけです。" + +#: ../../howto/pyporting.rst:168 +msgid "Division" +msgstr "除算" + +#: ../../howto/pyporting.rst:170 +msgid "" +"In Python 3, ``5 / 2 == 2.5`` and not ``2``; all division between ``int`` " +"values result in a ``float``. This change has actually been planned since " +"Python 2.2 which was released in 2002. Since then users have been encouraged " +"to add ``from __future__ import division`` to any and all files which use " +"the ``/`` and ``//`` operators or to be running the interpreter with the ``-" +"Q`` flag. If you have not been doing this then you will need to go through " +"your code and do two things:" +msgstr "" +"Python 3 では、 ``5 / 2 == 2.5`` であり ``2`` ではありません; ``int`` 同士の" +"全ての除算は ``float`` の結果になります。この変更については実際のところ、 " +"2002 年にリリースされた Python 2.2 から計画されました。そのようなわけで、 ``/" +"``, ``//`` 演算子を使うどんなファイルにも ``from __future__ import " +"division`` を追加するか、あるいはインタプリタを ``-Q`` フラグとともに起動する" +"ことが推奨されていました。これをまだやったことがなければ、コードをくまなく調" +"べて対象箇所を見つけ、 2 つのことをします:" + +#: ../../howto/pyporting.rst:178 +msgid "Add ``from __future__ import division`` to your files" +msgstr "``from __future__ import division`` をあなたのファイルに追加します" + +#: ../../howto/pyporting.rst:179 +msgid "" +"Update any division operator as necessary to either use ``//`` to use floor " +"division or continue using ``/`` and expect a float" +msgstr "" +"floor division (訳注: float での結果に :func:`~math.floor` 適用したのと同じ振" +"る舞いをする除算) に対しては ``//`` を、浮動小数点数の演算を期待する箇所では" +"そのまま ``/`` を使うように、除算演算子を必要に応じて変更します。" + +#: ../../howto/pyporting.rst:182 +msgid "" +"The reason that ``/`` isn't simply translated to ``//`` automatically is " +"that if an object defines a ``__truediv__`` method but not ``__floordiv__`` " +"then your code would begin to fail (e.g. a user-defined class that uses ``/" +"`` to signify some operation but not ``//`` for the same thing or at all)." +msgstr "" +"オブジェクトが自身の ``__truediv__`` メソッドを持っているのに " +"``__floordiv__`` を持っていない場合に壊れてしまうので、 ``/`` を ``//`` に単" +"純に自動的に変換することは出来ません(例えばユーザ定義クラスで ``/`` を何かの" +"演算に使っていて、 ``//`` は同じ事をしないか何もしないような場合)。" + +#: ../../howto/pyporting.rst:189 +msgid "Text versus binary data" +msgstr "テキスト対バイナリデータ" + +#: ../../howto/pyporting.rst:191 +msgid "" +"In Python 2 you could use the ``str`` type for both text and binary data. " +"Unfortunately this confluence of two different concepts could lead to " +"brittle code which sometimes worked for either kind of data, sometimes not. " +"It also could lead to confusing APIs if people didn't explicitly state that " +"something that accepted ``str`` accepted either text or binary data instead " +"of one specific type. This complicated the situation especially for anyone " +"supporting multiple languages as APIs wouldn't bother explicitly supporting " +"``unicode`` when they claimed text data support." +msgstr "" +"Python 2 では ``str`` 型をテキストとバイナリデータのどちらにも使うことが出来" +"ていました。不幸なことにこれは、2 つの異なる概念を重ね合わせていて、両方の種" +"類のデータに対して、時々動作して時々はそうではない、といった傷つきやすいコー" +"ドに繋がりやすいものでした。人々が特定の一つの型の代わりに ``str`` を受け付け" +"る何かが、それが許容するのはテキストなのかバイナリデータなのかを名言しないと" +"きの、悩ましい API を生み出してしまう要因でもありました。これはとりわけマルチ" +"リンガルをサポートするための状況を、テキストデータをサポートしていると主張し" +"ているのに明示的に ``unicode`` をサポートすることに注意を払わない API、という" +"形で複雑にしていました。" + +#: ../../howto/pyporting.rst:200 +msgid "" +"To make the distinction between text and binary data clearer and more " +"pronounced, Python 3 did what most languages created in the age of the " +"internet have done and made text and binary data distinct types that cannot " +"blindly be mixed together (Python predates widespread access to the " +"internet). For any code that deals only with text or only binary data, this " +"separation doesn't pose an issue. But for code that has to deal with both, " +"it does mean you might have to now care about when you are using text " +"compared to binary data, which is why this cannot be entirely automated." +msgstr "" +"テキストとバイナリデータの区別をより明快に、よりはっきり宣言するために、 " +"Python 3 はインターネット時代に作られたほとんどの言語がしたこと、すなわちテキ" +"ストとバイナリデータを区別できる別々の型とし、無分別にお互い混ぜこぜには出来" +"ないようにしました (Python はインターネットが広く普及する前からありました)。" +"テキストのみを取り扱うコード、バイナリデータのみを扱うコードのいずれにとって" +"も、この分離は問題を引き起こしません。ですが両方を処理するコードにとっては、" +"それはテキストとバイナリデータの比較をする際に新たな注意点が増えたことを意味" +"していて、これが完全には移行の自動化が出来ない理由なのです。" + +#: ../../howto/pyporting.rst:209 +msgid "" +"To start, you will need to decide which APIs take text and which take binary " +"(it is **highly** recommended you don't design APIs that can take both due " +"to the difficulty of keeping the code working; as stated earlier it is " +"difficult to do well). In Python 2 this means making sure the APIs that take " +"text can work with ``unicode`` and those that work with binary data work " +"with the ``bytes`` type from Python 3 (which is a subset of ``str`` in " +"Python 2 and acts as an alias for ``bytes`` type in Python 2). Usually the " +"biggest issue is realizing which methods exist on which types in Python 2 & " +"3 simultaneously (for text that's ``unicode`` in Python 2 and ``str`` in " +"Python 3, for binary that's ``str``/``bytes`` in Python 2 and ``bytes`` in " +"Python 3). The following table lists the **unique** methods of each data " +"type across Python 2 & 3 (e.g., the ``decode()`` method is usable on the " +"equivalent binary data type in either Python 2 or 3, but it can't be used by " +"the textual data type consistently between Python 2 and 3 because ``str`` in " +"Python 3 doesn't have the method). Do note that as of Python 3.5 the " +"``__mod__`` method was added to the bytes type." +msgstr "" + +#: ../../howto/pyporting.rst:226 +msgid "**Text data**" +msgstr "**テキストデータ**" + +#: ../../howto/pyporting.rst:226 +msgid "**Binary data**" +msgstr "**バイナリデータ**" + +#: ../../howto/pyporting.rst:228 +msgid "\\" +msgstr "\\" + +#: ../../howto/pyporting.rst:228 +msgid "decode" +msgstr "decode" + +#: ../../howto/pyporting.rst:230 +msgid "encode" +msgstr "encode" + +#: ../../howto/pyporting.rst:232 +msgid "format" +msgstr "format" + +#: ../../howto/pyporting.rst:234 +msgid "isdecimal" +msgstr "isdecimal" + +#: ../../howto/pyporting.rst:236 +msgid "isnumeric" +msgstr "isnumeric" + +#: ../../howto/pyporting.rst:239 +msgid "" +"Making the distinction easier to handle can be accomplished by encoding and " +"decoding between binary data and text at the edge of your code. This means " +"that when you receive text in binary data, you should immediately decode it. " +"And if your code needs to send text as binary data then encode it as late as " +"possible. This allows your code to work with only text internally and thus " +"eliminates having to keep track of what type of data you are working with." +msgstr "" +"処理の区別を簡単にするには、バイナリデータとテキストの間のエンコードとデコー" +"ドを、あなたのコードの境界で行うようにすることです。バイナリデータとしてテキ" +"ストを受け取ったならば、即座にデコード。テキストをバイナリデータにして送信す" +"る必要があったら、出来るだけあとでエンコード。このようにすることで、あなたの" +"コードは内部的にはテキストだけで動作し、ですから、今処理しているのがどの型な" +"のかを逐一追跡しなくても良くなります。" + +#: ../../howto/pyporting.rst:246 +msgid "" +"The next issue is making sure you know whether the string literals in your " +"code represent text or binary data. You should add a ``b`` prefix to any " +"literal that presents binary data. For text you should add a ``u`` prefix to " +"the text literal. (there is a :mod:`__future__` import to force all " +"unspecified literals to be Unicode, but usage has shown it isn't as " +"effective as adding a ``b`` or ``u`` prefix to all literals explicitly)" +msgstr "" + +#: ../../howto/pyporting.rst:253 +msgid "" +"As part of this dichotomy you also need to be careful about opening files. " +"Unless you have been working on Windows, there is a chance you have not " +"always bothered to add the ``b`` mode when opening a binary file (e.g., " +"``rb`` for binary reading). Under Python 3, binary files and text files are " +"clearly distinct and mutually incompatible; see the :mod:`io` module for " +"details. Therefore, you **must** make a decision of whether a file will be " +"used for binary access (allowing binary data to be read and/or written) or " +"textual access (allowing text data to be read and/or written). You should " +"also use :func:`io.open` for opening files instead of the built-in :func:" +"`open` function as the :mod:`io` module is consistent from Python 2 to 3 " +"while the built-in :func:`open` function is not (in Python 3 it's actually :" +"func:`io.open`). Do not bother with the outdated practice of using :func:" +"`codecs.open` as that's only necessary for keeping compatibility with Python " +"2.5." +msgstr "" + +#: ../../howto/pyporting.rst:267 +msgid "" +"The constructors of both ``str`` and ``bytes`` have different semantics for " +"the same arguments between Python 2 & 3. Passing an integer to ``bytes`` in " +"Python 2 will give you the string representation of the integer: ``bytes(3) " +"== '3'``. But in Python 3, an integer argument to ``bytes`` will give you a " +"bytes object as long as the integer specified, filled with null bytes: " +"``bytes(3) == b'\\x00\\x00\\x00'``. A similar worry is necessary when " +"passing a bytes object to ``str``. In Python 2 you just get the bytes object " +"back: ``str(b'3') == b'3'``. But in Python 3 you get the string " +"representation of the bytes object: ``str(b'3') == \"b'3'\"``." +msgstr "" +"``str`` と ``bytes`` の両方のコンストラクタは同じ引数を与えても Python 2 と " +"3 で異なる意味を持ちます。Python 2 で ``bytes`` に数値を与えると、整数の文字" +"列表現を生成します: ``bytes(3) == '3'`` 。ですが Python 3 では、 ``bytes`` に" +"整数を与えると、整数値で与えたぶんの長さの、null バイトで埋められたバイト列を" +"生成します: ``bytes(3) == b'\\x00\\x00\\x00'`` 。似たような話はバイト列オブ" +"ジェクトを ``str`` に与える場合にも起こります。Python 2 ではバイト列が渡した" +"ものがそのまま戻ってきます: ``str(b'3') == b'3'`` 。対して Python 3 では、バ" +"イト列オブジェクトの文字列表現になって返ってきます: ``str(b'3') == " +"\"b'3'\"`` 。" + +#: ../../howto/pyporting.rst:277 +msgid "" +"Finally, the indexing of binary data requires careful handling (slicing does " +"**not** require any special handling). In Python 2, ``b'123'[1] == b'2'`` " +"while in Python 3 ``b'123'[1] == 50``. Because binary data is simply a " +"collection of binary numbers, Python 3 returns the integer value for the " +"byte you index on. But in Python 2 because ``bytes == str``, indexing " +"returns a one-item slice of bytes. The six_ project has a function named " +"``six.indexbytes()`` which will return an integer like in Python 3: ``six." +"indexbytes(b'123', 1)``." +msgstr "" +"最後に、バイナリデータに対するインデクシングには取り扱いに注意が必要です(スラ" +"イシングには特別な取り扱いは **不要** です)。Python 2 では、 ``b'123'[1] == " +"b'2'`` ですが、Python 3 では ``b'123'[1] == 50`` です。バイナリデータはただの" +"バイナリ数値の羅列ですから、Python 3 では指示した位置のバイトの整数値を返しま" +"す。ですが Python 2 の場合、 ``bytes == str`` であるために、インデクシングは " +"bytes の要素一つを取り出すスライスとして振舞います。 six_ プロジェクトには " +"``six.indexbytes()`` と名付けられた関数があって、これは Python 3 がそうするよ" +"うに整数値を返します: ``six.indexbytes(b'123', 1)`` 。" + +#: ../../howto/pyporting.rst:286 +msgid "To summarize:" +msgstr "まとめると、以下のようになります:" + +#: ../../howto/pyporting.rst:288 +msgid "Decide which of your APIs take text and which take binary data" +msgstr "" +"どの API がテキストデータを受付け、どの API がバイナリデータを受け付けるのか" +"を決めてください。" + +#: ../../howto/pyporting.rst:289 +msgid "" +"Make sure that your code that works with text also works with ``unicode`` " +"and code for binary data works with ``bytes`` in Python 2 (see the table " +"above for what methods you cannot use for each type)" +msgstr "" +"あなたのコードが Python 2 で確実に、テキストで動くものは ``unicode`` でも動く" +"ように、バイナリデータで動くものは ``bytes`` でも動くようにしてください(どの" +"メソッドがそれぞれの型で使えないのかを示した上記テーブルをみてください)。" + +#: ../../howto/pyporting.rst:292 +msgid "" +"Mark all binary literals with a ``b`` prefix, textual literals with a ``u`` " +"prefix" +msgstr "" + +#: ../../howto/pyporting.rst:294 +msgid "" +"Decode binary data to text as soon as possible, encode text as binary data " +"as late as possible" +msgstr "" +"バイナリデータをテキストにデコードするのは出来るだけ早く、テキストデータをバ" +"イナリデータにエンコードするのは出来るだけ遅く。" + +#: ../../howto/pyporting.rst:296 +msgid "" +"Open files using :func:`io.open` and make sure to specify the ``b`` mode " +"when appropriate" +msgstr "" +"ファイルは :func:`io.open` を使って開き、そうすべきときには必ず ``b`` モード" +"を指定してください。" + +#: ../../howto/pyporting.rst:298 +msgid "Be careful when indexing into binary data" +msgstr "" + +#: ../../howto/pyporting.rst:302 +msgid "Use feature detection instead of version detection" +msgstr "バージョン検出ではなく機能検出を使う" + +#: ../../howto/pyporting.rst:304 +msgid "" +"Inevitably you will have code that has to choose what to do based on what " +"version of Python is running. The best way to do this is with feature " +"detection of whether the version of Python you're running under supports " +"what you need. If for some reason that doesn't work then you should make the " +"version check be against Python 2 and not Python 3. To help explain this, " +"let's look at an example." +msgstr "" + +#: ../../howto/pyporting.rst:311 +msgid "" +"Let's pretend that you need access to a feature of :mod:`importlib` that is " +"available in Python's standard library since Python 3.3 and available for " +"Python 2 through importlib2_ on PyPI. You might be tempted to write code to " +"access e.g. the :mod:`importlib.abc` module by doing the following::" +msgstr "" + +#: ../../howto/pyporting.rst:323 +msgid "" +"The problem with this code is what happens when Python 4 comes out? It would " +"be better to treat Python 2 as the exceptional case instead of Python 3 and " +"assume that future Python versions will be more compatible with Python 3 " +"than Python 2::" +msgstr "" +"このコードの問題は、 Python 4 が出たときに起きます。\n" +"Python 3 ではなく Python 2 を例外的なケースとして扱い、将来の Python のバー" +"ジョンは Python 2 よりも Python 3 と互換性があると仮定する方が良さそうです::" + +#: ../../howto/pyporting.rst:335 +msgid "" +"The best solution, though, is to do no version detection at all and instead " +"rely on feature detection. That avoids any potential issues of getting the " +"version detection wrong and helps keep you future-compatible::" +msgstr "" +"ところが、最適解はバージョン検出を一切せずに、代わりに機能検出に頼ることで" +"す。\n" +"機能検出を使うことで、バージョン検出が上手く行かなくなる潜在的な問題を避けら" +"れ、機能の互換性を保つ助けになります::" + +#: ../../howto/pyporting.rst:346 +msgid "Prevent compatibility regressions" +msgstr "互換性オプション" + +#: ../../howto/pyporting.rst:348 +msgid "" +"Once you have fully translated your code to be compatible with Python 3, you " +"will want to make sure your code doesn't regress and stop working under " +"Python 3. This is especially true if you have a dependency which is blocking " +"you from actually running under Python 3 at the moment." +msgstr "" +"あなたのコードを完全に Python 3 互換に変換できたら、今度は Python 3 での動作" +"が退化したり止まってしまうことがないようにしたいでしょう。この時点ではまだ実" +"際に Python 3 で動作させられない阻害要因となる依存物を持っている場合に、これ" +"は特に当てはまります。" + +#: ../../howto/pyporting.rst:353 +msgid "" +"To help with staying compatible, any new modules you create should have at " +"least the following block of code at the top of it::" +msgstr "" +"互換性を保ち続けるために、あなたが作る全ての新しいモジュールは、最低でもソー" +"スコードの先頭に以下のコードブロックを持つべきです::" + +#: ../../howto/pyporting.rst:360 +msgid "" +"You can also run Python 2 with the ``-3`` flag to be warned about various " +"compatibility issues your code triggers during execution. If you turn " +"warnings into errors with ``-Werror`` then you can make sure that you don't " +"accidentally miss a warning." +msgstr "" +"実行時に種々の互換性問題を警告してもらうために Python 2 を ``-3`` フラグ付き" +"で実行することも出来ます。 ``-Werror`` にすれば警告ではなくエラーになるので、" +"うっかり警告を見逃すことがなくなります。" + +#: ../../howto/pyporting.rst:365 +msgid "" +"You can also use the Pylint_ project and its ``--py3k`` flag to lint your " +"code to receive warnings when your code begins to deviate from Python 3 " +"compatibility. This also prevents you from having to run Modernize_ or " +"Futurize_ over your code regularly to catch compatibility regressions. This " +"does require you only support Python 2.7 and Python 3.4 or newer as that is " +"Pylint's minimum Python version support." +msgstr "" +"Pylint_ プロジェクトとその ``--py3k`` フラグを使って、Python 3 互換性から乖離" +"し始めている際の警告を受け取ることも出来ます。これにより、 Modernize_ や " +"Futurize_ を普通に実行してみて互換性を失っていないかを確認する、という必要が" +"なくなります。この場合 Python 2.7 と Python 3.4 以上だけのサポートにすること" +"が必要になります。それが Pylint がサポートする最小の Python バージョンだから" +"です。" + +#: ../../howto/pyporting.rst:374 +msgid "Check which dependencies block your transition" +msgstr "どの依存性があなたの移行を阻んでいるのかチェックする" + +#: ../../howto/pyporting.rst:376 +msgid "" +"**After** you have made your code compatible with Python 3 you should begin " +"to care about whether your dependencies have also been ported. The " +"caniusepython3_ project was created to help you determine which projects -- " +"directly or indirectly -- are blocking you from supporting Python 3. There " +"is both a command-line tool as well as a web interface at https://" +"caniusepython3.com." +msgstr "" + +#: ../../howto/pyporting.rst:383 +msgid "" +"The project also provides code which you can integrate into your test suite " +"so that you will have a failing test when you no longer have dependencies " +"blocking you from using Python 3. This allows you to avoid having to " +"manually check your dependencies and to be notified quickly when you can " +"start running on Python 3." +msgstr "" +"このプロジェクトは同時にあなたのテストスイートに組み込むことが出来る、もう " +"Python 3 使用を妨げる依存物がなくなった時点で失敗するテストコードも提供してい" +"ます。これにより、Python 3 での動作を開始する際に、依存物を手動でチェックする" +"ことなく即座に気付くことが出来ます。" + +#: ../../howto/pyporting.rst:390 +msgid "Update your ``setup.py`` file to denote Python 3 compatibility" +msgstr "あなたの ``setup.py`` ファイルを更新して Python 3 互換を謳う" + +#: ../../howto/pyporting.rst:392 +msgid "" +"Once your code works under Python 3, you should update the classifiers in " +"your ``setup.py`` to contain ``Programming Language :: Python :: 3`` and to " +"not specify sole Python 2 support. This will tell anyone using your code " +"that you support Python 2 **and** 3. Ideally you will also want to add " +"classifiers for each major/minor version of Python you now support." +msgstr "" +"あなたのコードが Python 3 で動作するようになったら、 ``setup.py`` の " +"classifiers を ``Programming Language :: Python :: 3`` を含めるように更新し" +"て、Python 2 だけのサポートではないことを明記すべきです。これによって、あなた" +"のコードを利用する人はあなたが Python 2 *と* 3 をサポートすることを知ることが" +"出来ます。理想的には、今サポートしている Python のメジャー/マイナーバージョン" +"も classifiers に追加したいでしょう。" + +#: ../../howto/pyporting.rst:400 +msgid "Use continuous integration to stay compatible" +msgstr "継続的インテグレーションを使って互換性を維持し続ける。" + +#: ../../howto/pyporting.rst:402 +msgid "" +"Once you are able to fully run under Python 3 you will want to make sure " +"your code always works under both Python 2 & 3. Probably the best tool for " +"running your tests under multiple Python interpreters is tox_. You can then " +"integrate tox with your continuous integration system so that you never " +"accidentally break Python 2 or 3 support." +msgstr "" +"Python 3 で完全に動作出来てしまったら、あなたのコードが Python 2、3 の両方で" +"いつでも動くことを保障したいでしょう。おそらく、複数バージョンの Python イン" +"タプリタでテストを実施するのに最良のツールは、 tox_ です。継続的インテグレー" +"ションシステムに tox を統合して、うっかり Python 2 か 3 のサポートを壊してし" +"まわないようにすることが出来ます。" + +#: ../../howto/pyporting.rst:408 +msgid "" +"You may also want to use the ``-bb`` flag with the Python 3 interpreter to " +"trigger an exception when you are comparing bytes to strings or bytes to an " +"int (the latter is available starting in Python 3.5). By default type-" +"differing comparisons simply return ``False``, but if you made a mistake in " +"your separation of text/binary data handling or indexing on bytes you " +"wouldn't easily find the mistake. This flag will raise an exception when " +"these kinds of comparisons occur, making the mistake much easier to track " +"down." +msgstr "" +"Python 3 インタプリタで ``-bb`` フラグを使って、 bytes と string 、もしくは " +"bytes と int を比較したときに例外を引き起こしたいと思うでしょう (後者は " +"Python 3.5 から使えます)。\n" +"デフォルトでは型の異なる比較は単純に ``False`` を返しますが、テキスト/バイナ" +"リデータ処理の分離を誤ったり、バイト列への添え字操作を誤ると、簡単には間違い" +"を見つけられません。\n" +"このフラグはそれが起こった場合に例外を起こすことで、その種のケースを追跡する" +"助けになります。" + +#: ../../howto/pyporting.rst:416 +msgid "" +"And that's mostly it! At this point your code base is compatible with both " +"Python 2 and 3 simultaneously. Your testing will also be set up so that you " +"don't accidentally break Python 2 or 3 compatibility regardless of which " +"version you typically run your tests under while developing." +msgstr "" +"そしてこれでほぼ全てです! 今の時点であなたのコードベースは Python 2 と 3 の両" +"方に対して同時に互換です。あなたのテストは、開発時点ではどちらのバージョンで" +"テストすることが多いのかによらずに、誤って Python 2 か 3 の互換性を破壊してし" +"まわないようにも組み立てられるでしょう。" + +#: ../../howto/pyporting.rst:423 +msgid "Consider using optional static type checking" msgstr "" -#: ../../howto/pyporting.rst:34 +#: ../../howto/pyporting.rst:425 msgid "" -"`Guide by ActiveState `_" +"Another way to help port your code is to use a static type checker like " +"mypy_ or pytype_ on your code. These tools can be used to analyze your code " +"as if it's being run under Python 2, then you can run the tool a second time " +"as if your code is running under Python 3. By running a static type checker " +"twice like this you can discover if you're e.g. misusing binary data type in " +"one version of Python compared to another. If you add optional type hints to " +"your code you can also explicitly state whether your APIs use textual or " +"binary data, helping to make sure everything functions as expected in both " +"versions of Python." msgstr "" diff --git a/howto/regex.po b/howto/regex.po index 9e1f30148..6a925f543 100644 --- a/howto/regex.po +++ b/howto/regex.po @@ -1,28 +1,30 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 -# Atsuo Ishimoto , 2022 -# Takeshi Nakazato, 2023 -# Arihiro TAKASE, 2023 +# Ryuichi Takano , 2017 +# Arihiro TAKASE, 2017 +# Nozomu Kaneko , 2017 +# 秘湯 , 2018 +# tomo, 2019 +# Shin Saito, 2021 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:53+0000\n" -"Last-Translator: Arihiro TAKASE, 2023\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 17:45+0000\n" +"Last-Translator: Shin Saito, 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../howto/regex.rst:5 @@ -37,7 +39,7 @@ msgstr "著者" msgid "A.M. Kuchling " msgstr "A.M. Kuchling " -#: ../../howto/regex.rst-1 +#: ../../howto/regex.rstNone msgid "Abstract" msgstr "概要" @@ -173,10 +175,6 @@ msgstr "" "ここに特殊文字の完全な一覧があります; これらの意味はこの HOWTO の残りの部分で" "説明します。" -#: ../../howto/regex.rst:79 -msgid ". ^ $ * + ? { } [ ] \\ | ( )" -msgstr "" - #: ../../howto/regex.rst:83 msgid "" "The first metacharacters we'll look at are ``[`` and ``]``. They're used for " @@ -198,15 +196,14 @@ msgstr "" #: ../../howto/regex.rst:92 msgid "" -"Metacharacters (except ``\\``) are not active inside classes. For example, " -"``[akm$]`` will match any of the characters ``'a'``, ``'k'``, ``'m'``, or " -"``'$'``; ``'$'`` is usually a metacharacter, but inside a character class " -"it's stripped of its special nature." +"Metacharacters are not active inside classes. For example, ``[akm$]`` will " +"match any of the characters ``'a'``, ``'k'``, ``'m'``, or ``'$'``; ``'$'`` " +"is usually a metacharacter, but inside a character class it's stripped of " +"its special nature." msgstr "" -"(``\\`` を除く) 特殊文字は文字クラスの内部では有効になりません。例えば、 " -"``[akm$]`` は ``'a'``, ``'k'``, ``'m'``, または ``'{TX-PL-LABEL}#x27;`` のい" -"ずれかにマッチします; ``'{TX-PL-LABEL}#x27;`` は通常は特殊文字ですが、文字ク" -"ラス内部ではその特別な性質は取り除かれます。" +"特殊文字は文字クラスの内部では有効になりません。例えば、 ``[akm$]`` は " +"``'a'``, ``'k'``, ``'m'`` または ``'$'`` にマッチします; ``'$'`` は通常は特殊" +"文字ですが、文字クラス内部では特殊な性質は取り除かれます。" #: ../../howto/regex.rst:97 msgid "" @@ -281,7 +278,7 @@ msgstr "" "さい。一般的にユニコードバージョンは、ユニコードデータベース内で相応しいカテ" "ゴリに属すればマッチします。" -#: ../../howto/regex.rst:130 +#: ../../howto/regex.rst:131 msgid "``\\d``" msgstr "``\\d``" @@ -289,7 +286,7 @@ msgstr "``\\d``" msgid "Matches any decimal digit; this is equivalent to the class ``[0-9]``." msgstr "任意の十進数とマッチします; これは集合 ``[0-9]`` と同じ意味です。" -#: ../../howto/regex.rst:133 +#: ../../howto/regex.rst:134 msgid "``\\D``" msgstr "``\\D``" @@ -298,7 +295,7 @@ msgid "" "Matches any non-digit character; this is equivalent to the class ``[^0-9]``." msgstr "任意の非数字文字とマッチします; これは集合 ``[^0-9]`` と同じ意味です。" -#: ../../howto/regex.rst:136 +#: ../../howto/regex.rst:138 msgid "``\\s``" msgstr "``\\s``" @@ -310,7 +307,7 @@ msgstr "" "任意の空白文字とマッチします; これは集合 ``[ \\t\\n\\r\\f\\v]`` と同じ意味で" "す。" -#: ../../howto/regex.rst:140 +#: ../../howto/regex.rst:142 msgid "``\\S``" msgstr "``\\S``" @@ -322,7 +319,7 @@ msgstr "" "任意の非空白文字とマッチします; これは集合 ``[^ \\t\\n\\r\\f\\v]`` と同じ意味" "です。" -#: ../../howto/regex.rst:144 +#: ../../howto/regex.rst:146 msgid "``\\w``" msgstr "``\\w``" @@ -334,7 +331,7 @@ msgstr "" "任意の英数文字および下線とマッチします; これは、集合 ``[a-zA-Z0-9_]`` と同じ" "意味です。" -#: ../../howto/regex.rst:148 +#: ../../howto/regex.rst:150 msgid "``\\W``" msgstr "``\\W``" @@ -560,29 +557,31 @@ msgstr "" #: ../../howto/regex.rst:233 msgid "" -"There are two more repeating operators or quantifiers. The question mark " -"character, ``?``, matches either once or zero times; you can think of it as " -"marking something as being optional. For example, ``home-?brew`` matches " -"either ``'homebrew'`` or ``'home-brew'``." +"There are two more repeating qualifiers. The question mark character, ``?" +"``, matches either once or zero times; you can think of it as marking " +"something as being optional. For example, ``home-?brew`` matches either " +"``'homebrew'`` or ``'home-brew'``." msgstr "" -"繰り返しをあらわす演算子または数量子がさらに2つ存在します。クエスチョンマー" -"ク ``?`` は1回または0回の繰り返しにマッチします; これは、何らかの文字やパター" -"ンがオプションであることをあらわすと考えられます。例えば、 ``home-?brew`` は " -"``'homebrew'`` と ``'home-brew'`` のいずれかにマッチします。" +"2回以上の繰り返しを制限する修飾子も存在します。\n" +"クエスチョンマーク ``?`` は0か1回のどちらかにマッチします; これはオプショナル" +"な何かを示しているとも考えられます。\n" +"例えば、``home-?brew`` は ``'homebrew'`` と ``'home-brew'`` のどちらにもマッ" +"チします。" #: ../../howto/regex.rst:238 msgid "" -"The most complicated quantifier is ``{m,n}``, where *m* and *n* are decimal " -"integers. This quantifier means there must be at least *m* repetitions, and " -"at most *n*. For example, ``a/{1,3}b`` will match ``'a/b'``, ``'a//b'``, " -"and ``'a///b'``. It won't match ``'ab'``, which has no slashes, or ``'a////" -"b'``, which has four." +"The most complicated repeated qualifier is ``{m,n}``, where *m* and *n* are " +"decimal integers. This qualifier means there must be at least *m* " +"repetitions, and at most *n*. For example, ``a/{1,3}b`` will match ``'a/" +"b'``, ``'a//b'``, and ``'a///b'``. It won't match ``'ab'``, which has no " +"slashes, or ``'a////b'``, which has four." msgstr "" -"最も複雑な数量子は ``{m,n}`` でしょう。ここで *m* と *n* は10進数の整数です。" -"この数量子は繰り返しの回数が最小で *m* 回、最大で *n* 回であることを意味しま" -"す。例えば、 ``a/{1,3}b`` は ``'a/b'``, ``'a//b'``, および ``'a///b'`` にマッ" -"チします。一方でスラッシュのない ``'ab'`` やスラッシュが4つある ``'a////b'`` " -"にはマッチしません。" +"最も複雑な繰り返しの修飾子は ``{m,n}`` で、ここで *m* と *n* は 10 進整数で" +"す。\n" +"この修飾子は最低 *m* 回、最大で *n* 回の繰り返すことを意味しています。\n" +"例えば、 ``a/{1,3}b`` は ``'a/b'`` と ``'a//b'`` そして ``'a///b'`` にマッチ" +"し、スラッシュの無い ``'ab'`` や4つのスラッシュを持つ ``'a////b'`` にはマッチ" +"しません。" #: ../../howto/regex.rst:244 msgid "" @@ -596,28 +595,24 @@ msgstr "" #: ../../howto/regex.rst:248 msgid "" -"The simplest case ``{m}`` matches the preceding item exactly *m* times. For " -"example, ``a/{2}b`` will only match ``'a//b'``." -msgstr "" - -#: ../../howto/regex.rst:251 -msgid "" -"Readers of a reductionist bent may notice that the three other quantifiers " +"Readers of a reductionist bent may notice that the three other qualifiers " "can all be expressed using this notation. ``{0,}`` is the same as ``*``, " "``{1,}`` is equivalent to ``+``, and ``{0,1}`` is the same as ``?``. It's " "better to use ``*``, ``+``, or ``?`` when you can, simply because they're " "shorter and easier to read." msgstr "" -"還元主義的傾向のある読者は、他の3つの数量子が全てこの表記を使って表現できるこ" -"とに気づくでしょう。 ``{0,}`` は ``*`` と同じであり、 ``{1,}`` は ``+`` と等" -"価です。また ``{0,1}`` は ``?`` と同じです。とはいえ、簡潔さと読みやすさの観" -"点から、可能であれば ``*``, ``+``, ``?`` を使う方が望ましいです。" +"還元主義者傾向のある読者は、3つの修飾子がこの表記を使って表現できることに気付" +"くでしょう。\n" +"``{0,}`` は ``*`` と、 ``{1,}`` は ``+`` と、そして ``{0,1}`` は ``?`` と同じ" +"です。\n" +"できるなら ``*``, ``+``, ``?`` を利用した方が賢明です。それは単に、短く読み易" +"くなるからです。" -#: ../../howto/regex.rst:259 +#: ../../howto/regex.rst:256 msgid "Using Regular Expressions" msgstr "正規表現を使う" -#: ../../howto/regex.rst:261 +#: ../../howto/regex.rst:258 msgid "" "Now that we've looked at some simple regular expressions, how do we actually " "use them in Python? The :mod:`re` module provides an interface to the " @@ -629,11 +624,11 @@ msgstr "" "ンターフェースを提供していて、それらを使うことで正規表現をオブジェクトにコン" "パイルし、マッチを実行することができます。" -#: ../../howto/regex.rst:268 +#: ../../howto/regex.rst:265 msgid "Compiling Regular Expressions" msgstr "正規表現をコンパイルする" -#: ../../howto/regex.rst:270 +#: ../../howto/regex.rst:267 msgid "" "Regular expressions are compiled into pattern objects, which have methods " "for various operations such as searching for pattern matches or performing " @@ -643,15 +638,7 @@ msgstr "" "くの操作、パターンマッチの検索や文字列の置換の実行などのメソッドを持っていま" "す。 ::" -#: ../../howto/regex.rst:274 -msgid "" -">>> import re\n" -">>> p = re.compile('ab*')\n" -">>> p\n" -"re.compile('ab*')" -msgstr "" - -#: ../../howto/regex.rst:279 +#: ../../howto/regex.rst:276 msgid "" ":func:`re.compile` also accepts an optional *flags* argument, used to enable " "various special features and syntax variations. We'll go over the available " @@ -661,11 +648,7 @@ msgstr "" "引数はさまざまな特別な機能を有効にしたり、構文を変化させたりします。利用でき" "る設定に何があるかは後に飛ばすことにして、簡単な例をやることにしましょう::" -#: ../../howto/regex.rst:283 -msgid ">>> p = re.compile('ab*', re.IGNORECASE)" -msgstr "" - -#: ../../howto/regex.rst:285 +#: ../../howto/regex.rst:282 msgid "" "The RE is passed to :func:`re.compile` as a string. REs are handled as " "strings because regular expressions aren't part of the core Python language, " @@ -683,7 +666,7 @@ msgstr "" "や :mod:`zlib` モジュールのような通常の C 拡張モジュールとして Python に含ま" "れています。" -#: ../../howto/regex.rst:292 +#: ../../howto/regex.rst:289 msgid "" "Putting REs in strings keeps the Python language simpler, but has one " "disadvantage which is the topic of the next section." @@ -691,11 +674,11 @@ msgstr "" "正規表現を文字列としておくことで Python 言語はより簡素に保たれていますが、そ" "のため1つの欠点があります、これについては次の節で話題とします。" -#: ../../howto/regex.rst:299 +#: ../../howto/regex.rst:296 msgid "The Backslash Plague" msgstr "バックスラッシュ感染症" -#: ../../howto/regex.rst:301 +#: ../../howto/regex.rst:298 msgid "" "As stated earlier, regular expressions use the backslash character " "(``'\\'``) to indicate special forms or to allow special characters to be " @@ -706,7 +689,7 @@ msgstr "" "とを示すためにバックスラッシュ文字 (``'\\'``) を利用します。これは Python が" "文字列リテラルに対して、同じ文字を同じ目的で使うことと衝突します。" -#: ../../howto/regex.rst:306 +#: ../../howto/regex.rst:303 msgid "" "Let's say you want to write a RE that matches the string ``\\section``, " "which might be found in a LaTeX file. To figure out what to write in the " @@ -725,39 +708,39 @@ msgstr "" "\\section`` でなければいけません。しかし、これを Python の文字列リテラルとし" "て扱うにはこの二つのバックスラッシュを *再び* エスケープする必要があります。" -#: ../../howto/regex.rst:315 +#: ../../howto/regex.rst:312 msgid "Characters" msgstr "文字" -#: ../../howto/regex.rst:315 +#: ../../howto/regex.rst:312 msgid "Stage" msgstr "段階" -#: ../../howto/regex.rst:317 +#: ../../howto/regex.rst:314 msgid "``\\section``" msgstr "``\\section``" -#: ../../howto/regex.rst:317 +#: ../../howto/regex.rst:314 msgid "Text string to be matched" msgstr "マッチさせるテキスト" -#: ../../howto/regex.rst:319 +#: ../../howto/regex.rst:316 msgid "``\\\\section``" msgstr "``\\\\section``" -#: ../../howto/regex.rst:319 +#: ../../howto/regex.rst:316 msgid "Escaped backslash for :func:`re.compile`" msgstr ":func:`re.compile` のためのバックスラッシュエスケープ" -#: ../../howto/regex.rst:321 ../../howto/regex.rst:348 +#: ../../howto/regex.rst:318 ../../howto/regex.rst:345 msgid "``\"\\\\\\\\section\"``" msgstr "``\"\\\\\\\\section\"``" -#: ../../howto/regex.rst:321 +#: ../../howto/regex.rst:318 msgid "Escaped backslashes for a string literal" msgstr "文字列リテラルのためのバックスラッシュエスケープ" -#: ../../howto/regex.rst:324 +#: ../../howto/regex.rst:321 msgid "" "In short, to match a literal backslash, one has to write ``'\\\\\\\\'`` as " "the RE string, because the regular expression must be ``\\\\``, and each " @@ -772,7 +755,7 @@ msgstr "" "スラッシュの繰り返しの機能は、たくさんのバックスラッシュの繰り返しを生むこと" "になり、その結果として作られる文字列は理解することが難しくなります。" -#: ../../howto/regex.rst:330 +#: ../../howto/regex.rst:327 msgid "" "The solution is to use Python's raw string notation for regular expressions; " "backslashes are not handled in any special way in a string literal prefixed " @@ -788,7 +771,7 @@ msgstr "" "ります。多くの場合 Python コードの中の正規表現はこの raw string 記法を使って" "書かれます。" -#: ../../howto/regex.rst:336 +#: ../../howto/regex.rst:333 msgid "" "In addition, special escape sequences that are valid in regular expressions, " "but not valid as Python string literals, now result in a :exc:" @@ -802,39 +785,39 @@ msgstr "" "シーケンスは raw string 記法を使うか、バックスラッシュによるエスケープを使わ" "ないかぎり無効になることを意味します。" -#: ../../howto/regex.rst:344 +#: ../../howto/regex.rst:341 msgid "Regular String" msgstr "通常の文字列" -#: ../../howto/regex.rst:344 +#: ../../howto/regex.rst:341 msgid "Raw string" msgstr "Raw string" -#: ../../howto/regex.rst:346 +#: ../../howto/regex.rst:343 msgid "``\"ab*\"``" msgstr "``\"ab*\"``" -#: ../../howto/regex.rst:346 +#: ../../howto/regex.rst:343 msgid "``r\"ab*\"``" msgstr "``r\"ab*\"``" -#: ../../howto/regex.rst:348 +#: ../../howto/regex.rst:345 msgid "``r\"\\\\section\"``" msgstr "``r\"\\\\section\"``" -#: ../../howto/regex.rst:350 +#: ../../howto/regex.rst:347 msgid "``\"\\\\w+\\\\s+\\\\1\"``" msgstr "``\"\\\\w+\\\\s+\\\\1\"``" -#: ../../howto/regex.rst:350 +#: ../../howto/regex.rst:347 msgid "``r\"\\w+\\s+\\1\"``" msgstr "``r\"\\w+\\s+\\1\"``" -#: ../../howto/regex.rst:355 +#: ../../howto/regex.rst:352 msgid "Performing Matches" msgstr "マッチの実行" -#: ../../howto/regex.rst:357 +#: ../../howto/regex.rst:354 msgid "" "Once you have an object representing a compiled regular expression, what do " "you do with it? Pattern objects have several methods and attributes. Only " @@ -846,45 +829,45 @@ msgstr "" "その中でも最も重要なものについて扱います; 完全なリストは :mod:`re` ドキュメン" "トを参照して下さい。" -#: ../../howto/regex.rst:363 ../../howto/regex.rst:417 -#: ../../howto/regex.rst:1068 +#: ../../howto/regex.rst:360 ../../howto/regex.rst:418 +#: ../../howto/regex.rst:1064 msgid "Method/Attribute" msgstr "メソッド/属性" -#: ../../howto/regex.rst:363 ../../howto/regex.rst:417 -#: ../../howto/regex.rst:1068 +#: ../../howto/regex.rst:360 ../../howto/regex.rst:418 +#: ../../howto/regex.rst:1064 msgid "Purpose" msgstr "目的" -#: ../../howto/regex.rst:365 +#: ../../howto/regex.rst:362 msgid "``match()``" msgstr "``match()``" -#: ../../howto/regex.rst:365 +#: ../../howto/regex.rst:362 msgid "Determine if the RE matches at the beginning of the string." msgstr "文字列の先頭で正規表現とマッチするか判定します。" -#: ../../howto/regex.rst:368 +#: ../../howto/regex.rst:365 msgid "``search()``" msgstr "``search()``" -#: ../../howto/regex.rst:368 +#: ../../howto/regex.rst:365 msgid "Scan through a string, looking for any location where this RE matches." -msgstr "文字列を先頭から走査して、正規表現がどこにマッチするか調べます。" +msgstr "文字列を操作して、正規表現がどこにマッチするか調べます。" -#: ../../howto/regex.rst:371 +#: ../../howto/regex.rst:368 msgid "``findall()``" msgstr "``findall()``" -#: ../../howto/regex.rst:371 +#: ../../howto/regex.rst:368 msgid "Find all substrings where the RE matches, and returns them as a list." msgstr "正規表現にマッチする部分文字列を全て探しだしリストとして返します。" -#: ../../howto/regex.rst:374 +#: ../../howto/regex.rst:371 msgid "``finditer()``" msgstr "``finditer()``" -#: ../../howto/regex.rst:374 +#: ../../howto/regex.rst:371 msgid "" "Find all substrings where the RE matches, and returns them as an :term:" "`iterator`." @@ -892,7 +875,7 @@ msgstr "" "正規表現にマッチする部分文字列を全て探しだし :term:`iterator` として返しま" "す。" -#: ../../howto/regex.rst:378 +#: ../../howto/regex.rst:375 msgid "" ":meth:`~re.Pattern.match` and :meth:`~re.Pattern.search` return ``None`` if " "no match can be found. If they're successful, a :ref:`match object >> import re\n" -">>> p = re.compile('[a-z]+')\n" -">>> p\n" -"re.compile('[a-z]+')" -msgstr "" - -#: ../../howto/regex.rst:394 +#: ../../howto/regex.rst:395 msgid "" "Now, you can try matching various strings against the RE ``[a-z]+``. An " "empty string shouldn't match at all, since ``+`` means 'one or more " @@ -942,14 +926,7 @@ msgstr "" "を返すべきで、インタプタは何も出力しません。明確にするために :meth:`!match` " "の結果を明示的に出力することもできます::" -#: ../../howto/regex.rst:400 -msgid "" -">>> p.match(\"\")\n" -">>> print(p.match(\"\"))\n" -"None" -msgstr "" - -#: ../../howto/regex.rst:404 +#: ../../howto/regex.rst:405 msgid "" "Now, let's try it on a string that it should match, such as ``tempo``. In " "this case, :meth:`~re.Pattern.match` will return a :ref:`match object ` を返すので、後で使うために結果を変数に記憶しておくべきです。 ::" -#: ../../howto/regex.rst:408 -msgid "" -">>> m = p.match('tempo')\n" -">>> m\n" -"" -msgstr "" - -#: ../../howto/regex.rst:412 +#: ../../howto/regex.rst:413 msgid "" "Now you can query the :ref:`match object ` for information " "about the matching string. Match object instances also have several methods " @@ -977,53 +947,43 @@ msgstr "" "Match オブジェクトインスタンスはいくつかのメソッドと属性も持っていて、最も重" "要なのは次のものです:" -#: ../../howto/regex.rst:419 +#: ../../howto/regex.rst:420 msgid "``group()``" msgstr "``group()``" -#: ../../howto/regex.rst:419 +#: ../../howto/regex.rst:420 msgid "Return the string matched by the RE" msgstr "正規表現にマッチした文字列を返す" -#: ../../howto/regex.rst:421 +#: ../../howto/regex.rst:422 msgid "``start()``" msgstr "``start()``" -#: ../../howto/regex.rst:421 +#: ../../howto/regex.rst:422 msgid "Return the starting position of the match" msgstr "マッチの開始位置を返す" -#: ../../howto/regex.rst:423 +#: ../../howto/regex.rst:424 msgid "``end()``" msgstr "``end()``" -#: ../../howto/regex.rst:423 +#: ../../howto/regex.rst:424 msgid "Return the ending position of the match" msgstr "マッチの終了位置を返す" -#: ../../howto/regex.rst:425 +#: ../../howto/regex.rst:426 msgid "``span()``" msgstr "``span()``" -#: ../../howto/regex.rst:425 +#: ../../howto/regex.rst:426 msgid "Return a tuple containing the (start, end) positions of the match" msgstr "マッチの位置 (start, end) を含むタプルを返す" -#: ../../howto/regex.rst:429 +#: ../../howto/regex.rst:430 msgid "Trying these methods will soon clarify their meaning::" msgstr "これらのメソッドを試せば、その意味はすぐに理解できます::" -#: ../../howto/regex.rst:431 -msgid "" -">>> m.group()\n" -"'tempo'\n" -">>> m.start(), m.end()\n" -"(0, 5)\n" -">>> m.span()\n" -"(0, 5)" -msgstr "" - -#: ../../howto/regex.rst:438 +#: ../../howto/regex.rst:439 msgid "" ":meth:`~re.Match.group` returns the substring that was matched by the RE. :" "meth:`~re.Match.start` and :meth:`~re.Match.end` return the starting and " @@ -1043,19 +1003,7 @@ msgstr "" "しかし、 :meth:`~re.Pattern.search` メソッドではパターンを文字列全体について" "走査するので、マッチの開始はゼロにならないかもしれません。 ::" -#: ../../howto/regex.rst:446 -msgid "" -">>> print(p.match('::: message'))\n" -"None\n" -">>> m = p.search('::: message'); print(m)\n" -"\n" -">>> m.group()\n" -"'message'\n" -">>> m.span()\n" -"(4, 11)" -msgstr "" - -#: ../../howto/regex.rst:455 +#: ../../howto/regex.rst:456 msgid "" "In actual programs, the most common style is to store the :ref:`match object " "` in a variable, and then check if it was ``None``. This " @@ -1065,17 +1013,7 @@ msgstr "" "ておき, その次に ``None`` なのか調べるのが一般的なスタイルです。普通このよう" "にします::" -#: ../../howto/regex.rst:459 -msgid "" -"p = re.compile( ... )\n" -"m = p.match( 'string goes here' )\n" -"if m:\n" -" print('Match found: ', m.group())\n" -"else:\n" -" print('No match')" -msgstr "" - -#: ../../howto/regex.rst:466 +#: ../../howto/regex.rst:467 msgid "" "Two pattern methods return all of the matches for a pattern. :meth:`~re." "Pattern.findall` returns a list of matching strings::" @@ -1084,14 +1022,7 @@ msgstr "" "ります。\n" ":meth:`~re.Pattern.findall` はマッチした文字列のリストを返します::" -#: ../../howto/regex.rst:469 -msgid "" -">>> p = re.compile(r'\\d+')\n" -">>> p.findall('12 drummers drumming, 11 pipers piping, 10 lords a-leaping')\n" -"['12', '11', '10']" -msgstr "" - -#: ../../howto/regex.rst:473 +#: ../../howto/regex.rst:474 msgid "" "The ``r`` prefix, making the literal a raw string literal, is needed in this " "example because escape sequences in a normal \"cooked\" string literal that " @@ -1105,7 +1036,7 @@ msgstr "" "`DeprecationWarning` を引き起こし、最終的には :exc:`SyntaxError` となります。" "詳しくは :ref:`the-backslash-plague` を参照してください。" -#: ../../howto/regex.rst:479 +#: ../../howto/regex.rst:480 msgid "" ":meth:`~re.Pattern.findall` has to create the entire list before it can be " "returned as the result. The :meth:`~re.Pattern.finditer` method returns a " @@ -1117,24 +1048,11 @@ msgstr "" "ト ` インスタンスのシーケンスを :term:`iterator` として返しま" "す::" -#: ../../howto/regex.rst:483 -msgid "" -">>> iterator = p.finditer('12 drummers drumming, 11 ... 10 ...')\n" -">>> iterator\n" -"\n" -">>> for match in iterator:\n" -"... print(match.span())\n" -"...\n" -"(0, 2)\n" -"(22, 24)\n" -"(29, 31)" -msgstr "" - -#: ../../howto/regex.rst:495 +#: ../../howto/regex.rst:496 msgid "Module-Level Functions" msgstr "モジュールレベルの関数" -#: ../../howto/regex.rst:497 +#: ../../howto/regex.rst:498 msgid "" "You don't have to create a pattern object and call its methods; the :mod:" "`re` module also provides top-level functions called :func:`~re.match`, :" @@ -1150,15 +1068,7 @@ msgstr "" "じで、 ``None`` か :ref:`Match オブジェクト ` インスタンスを返" "すのも同じです::" -#: ../../howto/regex.rst:504 -msgid "" -">>> print(re.match(r'From\\s+', 'Fromage amk'))\n" -"None\n" -">>> re.match(r'From\\s+', 'From amk Thu May 14 19:12:10 1998')\n" -"" -msgstr "" - -#: ../../howto/regex.rst:509 +#: ../../howto/regex.rst:510 msgid "" "Under the hood, these functions simply create a pattern object for you and " "call the appropriate method on it. They also store the compiled object in a " @@ -1170,7 +1080,7 @@ msgstr "" "パースが何度も何度も必要とならないよう、コンパイル済みオブジェクトはキャッ" "シュされます。" -#: ../../howto/regex.rst:514 +#: ../../howto/regex.rst:515 msgid "" "Should you use these module-level functions, or should you get the pattern " "and call its methods yourself? If you're accessing a regex within a loop, " @@ -1182,11 +1092,11 @@ msgstr "" "イルは関数呼び出しを減らします。ループの外側であれば、内部キャッシュのおかげ" "で、どちらでも大差ありません。" -#: ../../howto/regex.rst:522 +#: ../../howto/regex.rst:523 msgid "Compilation Flags" msgstr "コンパイルフラグ" -#: ../../howto/regex.rst:526 +#: ../../howto/regex.rst:525 msgid "" "Compilation flags let you modify some aspects of how regular expressions " "work. Flags are available in the :mod:`re` module under two names, a long " @@ -1205,7 +1115,7 @@ msgstr "" "指定することができます; 例えば ``re.I | re.M`` は :const:`I` と :const:`M` フ" "ラグの両方を設定します。" -#: ../../howto/regex.rst:534 +#: ../../howto/regex.rst:533 msgid "" "Here's a table of the available flags, followed by a more detailed " "explanation of each one." @@ -1213,19 +1123,19 @@ msgstr "" "ここに利用可能なフラグの表があります、それぞれについてのより詳細な説明が後に" "続きます。" -#: ../../howto/regex.rst:538 +#: ../../howto/regex.rst:537 msgid "Flag" msgstr "Flag" -#: ../../howto/regex.rst:538 +#: ../../howto/regex.rst:537 msgid "Meaning" msgstr "意味" -#: ../../howto/regex.rst:540 +#: ../../howto/regex.rst:539 msgid ":const:`ASCII`, :const:`A`" msgstr ":const:`ASCII`, :const:`A`" -#: ../../howto/regex.rst:540 +#: ../../howto/regex.rst:539 msgid "" "Makes several escapes like ``\\w``, ``\\b``, ``\\s`` and ``\\d`` match only " "on ASCII characters with the respective property." @@ -1233,51 +1143,51 @@ msgstr "" "``\\w``, ``\\b``, ``\\s``, そして ``\\d`` などをそれぞれのプロパティをもつ " "ASCII 文字だけにマッチさせます。" -#: ../../howto/regex.rst:544 +#: ../../howto/regex.rst:543 msgid ":const:`DOTALL`, :const:`S`" msgstr ":const:`DOTALL`, :const:`S`" -#: ../../howto/regex.rst:544 +#: ../../howto/regex.rst:543 msgid "Make ``.`` match any character, including newlines." msgstr "``.`` を改行を含む任意の文字にマッチするようにします。" -#: ../../howto/regex.rst:547 +#: ../../howto/regex.rst:546 msgid ":const:`IGNORECASE`, :const:`I`" msgstr ":const:`IGNORECASE`, :const:`I`" -#: ../../howto/regex.rst:547 +#: ../../howto/regex.rst:546 msgid "Do case-insensitive matches." msgstr "大文字小文字を区別しないマッチを行います。" -#: ../../howto/regex.rst:549 +#: ../../howto/regex.rst:548 msgid ":const:`LOCALE`, :const:`L`" msgstr ":const:`LOCALE`, :const:`L`" -#: ../../howto/regex.rst:549 +#: ../../howto/regex.rst:548 msgid "Do a locale-aware match." msgstr "ロケールに対応したマッチを行います。" -#: ../../howto/regex.rst:551 +#: ../../howto/regex.rst:550 msgid ":const:`MULTILINE`, :const:`M`" msgstr ":const:`MULTILINE`, :const:`M`" -#: ../../howto/regex.rst:551 +#: ../../howto/regex.rst:550 msgid "Multi-line matching, affecting ``^`` and ``$``." msgstr "" "``^`` や ``$`` の意味を変更し、複数行文字列に対するマッチングを行います。" -#: ../../howto/regex.rst:554 +#: ../../howto/regex.rst:553 msgid ":const:`VERBOSE`, :const:`X` (for 'extended')" msgstr ":const:`VERBOSE`, :const:`X` ('X' は 'extended' の 'X')" -#: ../../howto/regex.rst:554 +#: ../../howto/regex.rst:553 msgid "" "Enable verbose REs, which can be organized more cleanly and understandably." msgstr "" "冗長な正規表現を利用できるようにして、よりきれいで理解しやすくまとめることが" "できます。" -#: ../../howto/regex.rst:563 +#: ../../howto/regex.rst:562 msgid "" "Perform case-insensitive matching; character class and literal strings will " "match letters by ignoring case. For example, ``[A-Z]`` will match lowercase " @@ -1305,7 +1215,7 @@ msgstr "" "モードの場合のみマッチします)。この「小文字化」は現在のロケールを考慮しませ" "ん; ただし :const:`LOCALE` フラグをセットした場合はロケールを考慮します。" -#: ../../howto/regex.rst:581 +#: ../../howto/regex.rst:580 msgid "" "Make ``\\w``, ``\\W``, ``\\b``, ``\\B`` and case-insensitive matching " "dependent on the current locale instead of the Unicode database." @@ -1313,7 +1223,7 @@ msgstr "" "``\\w``, ``\\W``, ``\\b``, ``\\B`` と小文字大文字の区別を無視したマッチング" "を、 Unicode データベースではなく現在のロケールに従って行います。" -#: ../../howto/regex.rst:584 +#: ../../howto/regex.rst:583 msgid "" "Locales are a feature of the C library intended to help in writing programs " "that take account of language differences. For example, if you're " @@ -1348,7 +1258,7 @@ msgstr "" "ングがデフォルトで有効化されており、これにより異なるロケールまたは言語を同時" "に扱うことができます。 " -#: ../../howto/regex.rst:606 +#: ../../howto/regex.rst:605 msgid "" "(``^`` and ``$`` haven't been explained yet; they'll be introduced in " "section :ref:`more-metacharacters`.)" @@ -1356,7 +1266,7 @@ msgstr "" "(``^`` と ``$`` についてはまだ説明していません; これらは :ref:`more-" "metacharacters` の節で説明します。)" -#: ../../howto/regex.rst:609 +#: ../../howto/regex.rst:608 msgid "" "Usually ``^`` matches only at the beginning of the string, and ``$`` matches " "only at the end of the string and immediately before the newline (if any) at " @@ -1371,7 +1281,7 @@ msgstr "" "の先頭と文字列の中の改行に続く各行の先頭にマッチします。同様に ``$`` 特殊文字" "は文字列の末尾と各行の末尾(各改行の直前)のどちらにもマッチします。" -#: ../../howto/regex.rst:622 +#: ../../howto/regex.rst:621 msgid "" "Makes the ``'.'`` special character match any character at all, including a " "newline; without this flag, ``'.'`` will match anything *except* a newline." @@ -1379,7 +1289,7 @@ msgstr "" "特別な文字 ``'.'`` を改行を含む全ての任意の文字とマッチするようにします; この" "フラグが無しでは、 ``'.'`` は改行 *以外* の全てにマッチします。" -#: ../../howto/regex.rst:630 +#: ../../howto/regex.rst:629 msgid "" "Make ``\\w``, ``\\W``, ``\\b``, ``\\B``, ``\\s`` and ``\\S`` perform ASCII-" "only matching instead of full Unicode matching. This is only meaningful for " @@ -1389,7 +1299,7 @@ msgstr "" "チングではなく、ASCII のみのマッチングをするようにします。これは Unicode パ" "ターンにのみ意味があり、byte パターンには無視されます。" -#: ../../howto/regex.rst:639 +#: ../../howto/regex.rst:638 msgid "" "This flag allows you to write regular expressions that are more readable by " "granting you more flexibility in how you can format them. When this flag " @@ -1408,7 +1318,7 @@ msgstr "" "コメントは ``'#'`` で示します、これは文字クラスやエスケープされていないバック" "スラッシュに続くものであってはいけません。" -#: ../../howto/regex.rst:648 +#: ../../howto/regex.rst:647 msgid "" "For example, here's a RE that uses :const:`re.VERBOSE`; see how much easier " "it is to read? ::" @@ -1416,31 +1326,11 @@ msgstr "" "例えば、ここに :const:`re.VERBOSE` を利用した正規表現があります; 読み易いと思" "いませんか? ::" -#: ../../howto/regex.rst:651 -msgid "" -"charref = re.compile(r\"\"\"\n" -" &[#] # Start of a numeric entity reference\n" -" (\n" -" 0[0-7]+ # Octal form\n" -" | [0-9]+ # Decimal form\n" -" | x[0-9a-fA-F]+ # Hexadecimal form\n" -" )\n" -" ; # Trailing semicolon\n" -"\"\"\", re.VERBOSE)" -msgstr "" - -#: ../../howto/regex.rst:661 +#: ../../howto/regex.rst:660 msgid "Without the verbose setting, the RE would look like this::" msgstr "冗長な表現を利用しない設定の場合、正規表現はこうなります::" -#: ../../howto/regex.rst:663 -msgid "" -"charref = re.compile(\"&#(0[0-7]+\"\n" -" \"|[0-9]+\"\n" -" \"|x[0-9a-fA-F]+);\")" -msgstr "" - -#: ../../howto/regex.rst:667 +#: ../../howto/regex.rst:666 msgid "" "In the above example, Python's automatic concatenation of string literals " "has been used to break up the RE into smaller pieces, but it's still more " @@ -1450,11 +1340,11 @@ msgstr "" "割しています、それでも :const:`re.VERBOSE` を使った場合に比べるとまだ難しく" "なっています。" -#: ../../howto/regex.rst:673 +#: ../../howto/regex.rst:672 msgid "More Pattern Power" msgstr "パターンの能力をさらに" -#: ../../howto/regex.rst:675 +#: ../../howto/regex.rst:674 msgid "" "So far we've only covered a part of the features of regular expressions. In " "this section, we'll cover some new metacharacters, and how to use groups to " @@ -1464,11 +1354,11 @@ msgstr "" "くつかの特殊文字とグループを使ってマッチしたテキストの一部をどう取得するかに" "ついて扱います。" -#: ../../howto/regex.rst:683 +#: ../../howto/regex.rst:682 msgid "More Metacharacters" msgstr "さらなる特殊文字" -#: ../../howto/regex.rst:685 +#: ../../howto/regex.rst:684 msgid "" "There are some metacharacters that we haven't covered yet. Most of them " "will be covered in this section." @@ -1476,7 +1366,7 @@ msgstr "" "これまでで、まだ扱っていない特殊文字がいくつかありました。そのほとんどをこの" "節で扱っていきます。" -#: ../../howto/regex.rst:688 +#: ../../howto/regex.rst:687 msgid "" "Some of the remaining metacharacters to be discussed are :dfn:`zero-width " "assertions`. They don't cause the engine to advance through the string; " @@ -1494,11 +1384,11 @@ msgstr "" "全く変化しません。つまり、これはゼロ幅アサーションは繰り返し使うことがありま" "せん、一度ある位置でマッチしたら、明らかに無限回マッチできます。" -#: ../../howto/regex.rst:696 +#: ../../howto/regex.rst:703 msgid "``|``" msgstr "``|``" -#: ../../howto/regex.rst:697 +#: ../../howto/regex.rst:696 msgid "" "Alternation, or the \"or\" operator. If *A* and *B* are regular " "expressions, ``A|B`` will match any string that matches either *A* or *B*. " @@ -1514,7 +1404,7 @@ msgstr "" "らかにマッチするパターンであり、 「``'Cro'`` に続いて ``'w'`` または ``'S'`` " "があり、さらに ``'ervo'`` が続く」という意味ではありません。" -#: ../../howto/regex.rst:703 +#: ../../howto/regex.rst:702 msgid "" "To match a literal ``'|'``, use ``\\|``, or enclose it inside a character " "class, as in ``[|]``." @@ -1522,11 +1412,11 @@ msgstr "" "リテラル ``'|'`` にマッチするには、 ``\\|`` を利用するか、 ``[|]`` のように文" "字クラス内に収めて下さい。" -#: ../../howto/regex.rst:706 +#: ../../howto/regex.rst:718 msgid "``^``" msgstr "``^``" -#: ../../howto/regex.rst:707 +#: ../../howto/regex.rst:706 msgid "" "Matches at the beginning of lines. Unless the :const:`MULTILINE` flag has " "been set, this will only match at the beginning of the string. In :const:" @@ -1537,7 +1427,7 @@ msgstr "" "字列の先頭にのみマッチします。 :const:`MULTILINE` モードでは文字列内の各改行" "の直後にマッチします。" -#: ../../howto/regex.rst:711 +#: ../../howto/regex.rst:710 msgid "" "For example, if you wish to match the word ``From`` only at the beginning of " "a line, the RE to use is ``^From``. ::" @@ -1545,23 +1435,15 @@ msgstr "" "例えば、行の先頭の ``From`` にのみマッチさせたい場合には ``^From`` 正規表現を" "利用します。 ::" -#: ../../howto/regex.rst:714 -msgid "" -">>> print(re.search('^From', 'From Here to Eternity'))\n" -"\n" -">>> print(re.search('^From', 'Reciting From Memory'))\n" -"None" -msgstr "" - -#: ../../howto/regex.rst:719 +#: ../../howto/regex.rst:718 msgid "To match a literal ``'^'``, use ``\\^``." msgstr "リテラル ``'^'`` にマッチするには ``\\^`` を利用してください。" -#: ../../howto/regex.rst:721 +#: ../../howto/regex.rst:732 msgid "``$``" msgstr "``$``" -#: ../../howto/regex.rst:722 +#: ../../howto/regex.rst:721 msgid "" "Matches at the end of a line, which is defined as either the end of the " "string, or any location followed by a newline character. ::" @@ -1569,17 +1451,7 @@ msgstr "" "行の末尾にマッチします、行の末尾は文字列の末尾と改行文字の直前として定義され" "ます。 ::" -#: ../../howto/regex.rst:725 -msgid "" -">>> print(re.search('}$', '{block}'))\n" -"\n" -">>> print(re.search('}$', '{block} '))\n" -"None\n" -">>> print(re.search('}$', '{block}\\n'))\n" -"" -msgstr "" - -#: ../../howto/regex.rst:732 +#: ../../howto/regex.rst:731 msgid "" "To match a literal ``'$'``, use ``\\$`` or enclose it inside a character " "class, as in ``[$]``." @@ -1587,11 +1459,11 @@ msgstr "" "リテラル ``'$'`` にマッチするには、 ``\\$`` を利用するか、 ``[$]`` のように文" "字クラス内に収めて下さい。" -#: ../../howto/regex.rst:735 +#: ../../howto/regex.rst:738 msgid "``\\A``" msgstr "``\\A``" -#: ../../howto/regex.rst:736 +#: ../../howto/regex.rst:735 msgid "" "Matches only at the start of the string. When not in :const:`MULTILINE` " "mode, ``\\A`` and ``^`` are effectively the same. In :const:`MULTILINE` " @@ -1605,26 +1477,18 @@ msgstr "" "に改行文字に続く部分があればそこにマッチすることです。" #: ../../howto/regex.rst:741 -msgid "``\\z``" -msgstr "" - -#: ../../howto/regex.rst:742 -msgid "Matches only at the end of the string." -msgstr "文字列の末尾でのみマッチします。" - -#: ../../howto/regex.rst:744 msgid "``\\Z``" msgstr "``\\Z``" -#: ../../howto/regex.rst:745 -msgid "The same as ``\\z``. For compatibility with old Python versions." -msgstr "" +#: ../../howto/regex.rst:741 +msgid "Matches only at the end of the string." +msgstr "文字列の末尾でのみマッチします。" -#: ../../howto/regex.rst:747 +#: ../../howto/regex.rst:776 msgid "``\\b``" msgstr "``\\b``" -#: ../../howto/regex.rst:748 +#: ../../howto/regex.rst:744 msgid "" "Word boundary. This is a zero-width assertion that matches only at the " "beginning or end of a word. A word is defined as a sequence of alphanumeric " @@ -1635,7 +1499,7 @@ msgstr "" "す。単語は英数文字のシーケンスとして定義されます、つまり単語の終わりは空白か" "非英数文字として表われます。" -#: ../../howto/regex.rst:753 +#: ../../howto/regex.rst:749 msgid "" "The following example matches ``class`` only when it's a complete word; it " "won't match when it's contained inside another word. ::" @@ -1643,18 +1507,7 @@ msgstr "" "以下の例では ``class`` がそのものの単語のときのみマッチします; 別の単語内に含" "まれている場合はマッチしません。 ::" -#: ../../howto/regex.rst:756 -msgid "" -">>> p = re.compile(r'\\bclass\\b')\n" -">>> print(p.search('no class at all'))\n" -"\n" -">>> print(p.search('the declassified algorithm'))\n" -"None\n" -">>> print(p.search('one subclass is'))\n" -"None" -msgstr "" - -#: ../../howto/regex.rst:764 +#: ../../howto/regex.rst:760 msgid "" "There are two subtleties you should remember when using this special " "sequence. First, this is the worst collision between Python's string " @@ -1672,16 +1525,7 @@ msgstr "" "じ正規表現のように見えますが、正規表現文字列の前の ``'r'`` が省略されていま" "す。 ::" -#: ../../howto/regex.rst:772 -msgid "" -">>> p = re.compile('\\bclass\\b')\n" -">>> print(p.search('no class at all'))\n" -"None\n" -">>> print(p.search('\\b' + 'class' + '\\b'))\n" -"" -msgstr "" - -#: ../../howto/regex.rst:778 +#: ../../howto/regex.rst:774 msgid "" "Second, inside a character class, where there's no use for this assertion, " "``\\b`` represents the backspace character, for compatibility with Python's " @@ -1691,11 +1535,11 @@ msgstr "" "列リテラルとの互換性のために、 ``\\b`` はバックスペース文字を表わすことになる" "ということです。" -#: ../../howto/regex.rst:782 +#: ../../howto/regex.rst:781 msgid "``\\B``" msgstr "``\\B``" -#: ../../howto/regex.rst:783 +#: ../../howto/regex.rst:779 msgid "" "Another zero-width assertion, this is the opposite of ``\\b``, only matching " "when the current position is not at a word boundary." @@ -1703,11 +1547,11 @@ msgstr "" "別のゼロ幅アサーションで、 ``\\b`` と逆で、現在の位置が単語の境界でないときに" "のみマッチします。" -#: ../../howto/regex.rst:788 +#: ../../howto/regex.rst:784 msgid "Grouping" msgstr "グルーピング" -#: ../../howto/regex.rst:790 +#: ../../howto/regex.rst:786 msgid "" "Frequently you need to obtain more information than just whether the RE " "matched or not. Regular expressions are often used to dissect strings by " @@ -1720,15 +1564,7 @@ msgstr "" "て興味ある部分にマッチするようにして、文字列を分割するのに使われます。例え" "ば、RFC-822 ヘッダ行は ``':'`` を挟んでこのようにヘッダ名と値に分割されます:" -#: ../../howto/regex.rst:796 -msgid "" -"From: author@example.com\n" -"User-Agent: Thunderbird 1.5.0.9 (X11/20061227)\n" -"MIME-Version: 1.0\n" -"To: editor@example.com" -msgstr "" - -#: ../../howto/regex.rst:803 +#: ../../howto/regex.rst:799 msgid "" "This can be handled by writing a regular expression which matches an entire " "header line, and has one group which matches the header name, and another " @@ -1737,30 +1573,23 @@ msgstr "" "これはヘッダ全体にマッチし、そしてヘッダ名にマッチするグループとヘッダの値に" "マッチする別のグループを持つように正規表現を書くことで扱うことができます。" -#: ../../howto/regex.rst:807 +#: ../../howto/regex.rst:803 msgid "" "Groups are marked by the ``'('``, ``')'`` metacharacters. ``'('`` and " "``')'`` have much the same meaning as they do in mathematical expressions; " "they group together the expressions contained inside them, and you can " -"repeat the contents of a group with a quantifier, such as ``*``, ``+``, ``?" -"``, or ``{m,n}``. For example, ``(ab)*`` will match zero or more " +"repeat the contents of a group with a repeating qualifier, such as ``*``, " +"``+``, ``?``, or ``{m,n}``. For example, ``(ab)*`` will match zero or more " "repetitions of ``ab``. ::" msgstr "" -"グループはメタ文字 ``'('`` と ``')'`` であらわされます。 ``'('`` と ``')'`` " -"は数式における意味とほぼ同じ意味を持っています; その中に含まれる表現をひとま" -"とまりにし、それらに対して ``*``, ``+``, ``?``, または ``{m,n}`` のような数量" -"子を使った繰り返しを表現することもできます。例えば、 ``(ab)*`` は ``ab`` の0" -"回以上の繰り返しにマッチします。 ::" +"グループは特殊文字 ``'('``, ``')'`` で表わされます。 ``'('`` と ``')'`` は数" +"学での意味とほぼ同じ意味を持っています; その中に含まれた表現はまとめてグルー" +"プ化され、グループの中身を ``*``, ``+``, ``?`` や ``{m,n}`` のような繰り返し" +"の修飾子を使って繰り返すことができます。例えば、 ``(ab)*`` は ``ab`` の0回以" +"上の繰り返しにマッチします。 ::" #: ../../howto/regex.rst:814 msgid "" -">>> p = re.compile('(ab)*')\n" -">>> print(p.match('ababababab').span())\n" -"(0, 10)" -msgstr "" - -#: ../../howto/regex.rst:818 -msgid "" "Groups indicated with ``'('``, ``')'`` also capture the starting and ending " "index of the text that they match; this can be retrieved by passing an " "argument to :meth:`~re.Match.group`, :meth:`~re.Match.start`, :meth:`~re." @@ -1778,17 +1607,7 @@ msgstr "" "デフォルト引数にしています。マッチするテキストの範囲をキャプチャしないグルー" "プの書き方はのちほど見ることにします。 ::" -#: ../../howto/regex.rst:827 -msgid "" -">>> p = re.compile('(a)b')\n" -">>> m = p.match('ab')\n" -">>> m.group()\n" -"'ab'\n" -">>> m.group(0)\n" -"'ab'" -msgstr "" - -#: ../../howto/regex.rst:834 +#: ../../howto/regex.rst:830 msgid "" "Subgroups are numbered from left to right, from 1 upward. Groups can be " "nested; to determine the number, just count the opening parenthesis " @@ -1797,19 +1616,7 @@ msgstr "" "サブグループは左から右へ1づつ番号付けされます。グループはネストしてもかまいま" "せん; 番号を決めるには、単に開き括弧を左から右へ数え上げます。 ::" -#: ../../howto/regex.rst:838 -msgid "" -">>> p = re.compile('(a(b)c)d')\n" -">>> m = p.match('abcd')\n" -">>> m.group(0)\n" -"'abcd'\n" -">>> m.group(1)\n" -"'abc'\n" -">>> m.group(2)\n" -"'b'" -msgstr "" - -#: ../../howto/regex.rst:847 +#: ../../howto/regex.rst:843 msgid "" ":meth:`~re.Match.group` can be passed multiple group numbers at a time, in " "which case it will return a tuple containing the corresponding values for " @@ -1818,13 +1625,7 @@ msgstr "" ":meth:`~re.Match.group` には一回に複数の引数を渡してもかまいません、その場合" "にはそれらのグループに対応する値を含むタプルを返します。 ::" -#: ../../howto/regex.rst:850 -msgid "" -">>> m.group(2,1,2)\n" -"('b', 'abc', 'b')" -msgstr "" - -#: ../../howto/regex.rst:853 +#: ../../howto/regex.rst:849 msgid "" "The :meth:`~re.Match.groups` method returns a tuple containing the strings " "for all the subgroups, from 1 up to however many there are. ::" @@ -1832,13 +1633,7 @@ msgstr "" ":meth:`~re.Match.groups` メソッドは 1 から全てのサブグループの文字列を含むタ" "プルを返します。::" -#: ../../howto/regex.rst:856 -msgid "" -">>> m.groups()\n" -"('abc', 'b')" -msgstr "" - -#: ../../howto/regex.rst:859 +#: ../../howto/regex.rst:855 msgid "" "Backreferences in a pattern allow you to specify that the contents of an " "earlier capturing group must also be found at the current location in the " @@ -1855,19 +1650,12 @@ msgstr "" "いうことを心に留めておいて下さい、そのため正規表現で後方参照を含む場合には " "raw string を必ず利用して下さい。" -#: ../../howto/regex.rst:867 +#: ../../howto/regex.rst:863 msgid "For example, the following RE detects doubled words in a string. ::" msgstr "例えば、以下の正規表現は二重になった単語を検出します。 ::" #: ../../howto/regex.rst:869 msgid "" -">>> p = re.compile(r'\\b(\\w+)\\s+\\1\\b')\n" -">>> p.search('Paris in the the spring').group()\n" -"'the the'" -msgstr "" - -#: ../../howto/regex.rst:873 -msgid "" "Backreferences like this aren't often useful for just searching through a " "string --- there are few text formats which repeat data in this way --- but " "you'll soon find out that they're *very* useful when performing string " @@ -1877,11 +1665,11 @@ msgstr "" "ん。--- このように繰り返されるテキストフォーマットは少数です。--- しかし、文" "字列の置換をする場合には *とても* 有効であることに気づくでしょう。" -#: ../../howto/regex.rst:879 +#: ../../howto/regex.rst:875 msgid "Non-capturing and Named Groups" msgstr "取り出さないグループと名前つきグループ" -#: ../../howto/regex.rst:881 +#: ../../howto/regex.rst:877 msgid "" "Elaborate REs may use many groups, both to capture substrings of interest, " "and to group and structure the RE itself. In complex REs, it becomes " @@ -1895,7 +1683,7 @@ msgstr "" "なっていきます。この問題の解決を助ける二つの機能があります。その両方が正規表" "現を拡張するための一般的な構文を利用します、まずはそれらをみてみましょう。" -#: ../../howto/regex.rst:887 +#: ../../howto/regex.rst:883 msgid "" "Perl 5 is well known for its powerful additions to standard regular " "expressions. For these new features the Perl developers couldn't choose new " @@ -1913,7 +1701,7 @@ msgstr "" "は ``\\&`` や ``[&]`` のように書くことでエスケープされなければならなかったで" "しょう。" -#: ../../howto/regex.rst:894 +#: ../../howto/regex.rst:890 msgid "" "The solution chosen by the Perl developers was to use ``(?...)`` as the " "extension syntax. ``?`` immediately after a parenthesis was a syntax error " @@ -1930,7 +1718,7 @@ msgstr "" "の拡張を利用したもの (肯定先読みアサーション) となり、 ``(?:foo)`` は別の拡張" "を利用した表現(``foo`` を含む取り込まないグループ)となります。" -#: ../../howto/regex.rst:902 +#: ../../howto/regex.rst:898 msgid "" "Python supports several of Perl's extensions and adds an extension syntax to " "Perl's extension syntax. If the first character after the question mark is " @@ -1940,7 +1728,7 @@ msgstr "" "えています。クエスチョンマークに続く最初の文字が ``P`` のものは、そうです、" "Python 固有の拡張です。" -#: ../../howto/regex.rst:907 +#: ../../howto/regex.rst:903 msgid "" "Now that we've looked at the general extension syntax, we can return to the " "features that simplify working with groups in complex REs." @@ -1948,7 +1736,7 @@ msgstr "" "一般化された拡張構文についてはわかりましたので、いよいよ複雑な正規表現内での" "グループの扱いを単純化する機能に話を戻しましょう。" -#: ../../howto/regex.rst:910 +#: ../../howto/regex.rst:906 msgid "" "Sometimes you'll want to use a group to denote a part of a regular " "expression, but aren't interested in retrieving the group's contents. You " @@ -1960,17 +1748,7 @@ msgstr "" "出さないグループ: ``(?:...)`` を使います。 ``...`` 部分は任意の正規表現で" "す。 ::" -#: ../../howto/regex.rst:915 -msgid "" -">>> m = re.match(\"([abc])+\", \"abc\")\n" -">>> m.groups()\n" -"('c',)\n" -">>> m = re.match(\"(?:[abc])+\", \"abc\")\n" -">>> m.groups()\n" -"()" -msgstr "" - -#: ../../howto/regex.rst:922 +#: ../../howto/regex.rst:918 msgid "" "Except for the fact that you can't retrieve the contents of what the group " "matched, a non-capturing group behaves exactly the same as a capturing " @@ -1991,7 +1769,7 @@ msgstr "" "いグループで検索のパフォーマンスに差がないことにも触れておくべきことです; ど" "ちらも同じ速度で動作します。" -#: ../../howto/regex.rst:931 +#: ../../howto/regex.rst:927 msgid "" "A more significant feature is named groups: instead of referring to them by " "numbers, groups can be referenced by a name." @@ -1999,7 +1777,7 @@ msgstr "" "より重要な機能は名前つきグループです: 番号で参照する代わりに、グループに対し" "て名前で参照できます。" -#: ../../howto/regex.rst:934 +#: ../../howto/regex.rst:930 msgid "" "The syntax for a named group is one of the Python-specific extensions: ``(?" "P...)``. *name* is, obviously, the name of the group. Named groups " @@ -2018,17 +1796,7 @@ msgstr "" "容しています。名前つきグループにも番号が振られますので、グループについての情" "報を、2つの方法で取り出せます::" -#: ../../howto/regex.rst:942 -msgid "" -">>> p = re.compile(r'(?P\\b\\w+\\b)')\n" -">>> m = p.search( '(((( Lots of punctuation )))' )\n" -">>> m.group('word')\n" -"'Lots'\n" -">>> m.group(1)\n" -"'Lots'" -msgstr "" - -#: ../../howto/regex.rst:949 +#: ../../howto/regex.rst:945 msgid "" "Additionally, you can retrieve named groups as a dictionary with :meth:`~re." "Match.groupdict`::" @@ -2038,32 +1806,15 @@ msgstr "" #: ../../howto/regex.rst:952 msgid "" -">>> m = re.match(r'(?P\\w+) (?P\\w+)', 'Jane Doe')\n" -">>> m.groupdict()\n" -"{'first': 'Jane', 'last': 'Doe'}" -msgstr "" - -#: ../../howto/regex.rst:956 -msgid "" -"Named groups are handy because they let you use easily remembered names, " +"Named groups are handy because they let you use easily-remembered names, " "instead of having to remember numbers. Here's an example RE from the :mod:" "`imaplib` module::" msgstr "" -"名前つきグループは、番号を覚える代わりに簡単に覚えられる名前で管理できるた" -"め、便利です。以下は :mod:`imaplib` モジュールで使われている正規表現の例で" -"す::" +"名前つきグループは、番号を覚える代わりに、簡単に覚えられる名前を利用できるの" +"で、簡単に扱うことができます。これは :mod:`imaplib` モジュールから正規表現の" +"例です::" -#: ../../howto/regex.rst:960 -msgid "" -"InternalDate = re.compile(r'INTERNALDATE \"'\n" -" r'(?P[ 123][0-9])-(?P[A-Z][a-z][a-z])-'\n" -" r'(?P[0-9][0-9][0-9][0-9])'\n" -" r' (?P[0-9][0-9]):(?P[0-9][0-9]):(?P[0-9][0-9])'\n" -" r' (?P[-+])(?P[0-9][0-9])(?P[0-9][0-9])'\n" -" r'\"')" -msgstr "" - -#: ../../howto/regex.rst:967 +#: ../../howto/regex.rst:963 msgid "" "It's obviously much easier to retrieve ``m.group('zonem')``, instead of " "having to remember to retrieve group 9." @@ -2071,7 +1822,7 @@ msgstr "" "取得する番号9を覚えるよりも、 ``m.group('zonem')`` で取得した方が明らかに簡単" "にすみます。" -#: ../../howto/regex.rst:970 +#: ../../howto/regex.rst:966 msgid "" "The syntax for backreferences in an expression such as ``(...)\\1`` refers " "to the number of the group. There's naturally a variant that uses the group " @@ -2088,18 +1839,11 @@ msgstr "" "同じ単語が2つ連なっているのを見つける正規表現 ``\\b(\\w+)\\s+\\1\\b`` は " "``\\b(?P\\w+)\\s+(?P=word)\\b`` のように書けます::" -#: ../../howto/regex.rst:977 -msgid "" -">>> p = re.compile(r'\\b(?P\\w+)\\s+(?P=word)\\b')\n" -">>> p.search('Paris in the the spring').group()\n" -"'the the'" -msgstr "" - -#: ../../howto/regex.rst:983 +#: ../../howto/regex.rst:979 msgid "Lookahead Assertions" msgstr "先読みアサーション (Lookahead Assertions)" -#: ../../howto/regex.rst:985 +#: ../../howto/regex.rst:981 msgid "" "Another zero-width assertion is the lookahead assertion. Lookahead " "assertions are available in both positive and negative form, and look like " @@ -2108,11 +1852,11 @@ msgstr "" "他のゼロ幅アサーションは先読みアサーションです。先読みアサーションは肯定、否" "定の両方の形式が利用可能です、これを見てください:" -#: ../../howto/regex.rst:988 +#: ../../howto/regex.rst:989 msgid "``(?=...)``" msgstr "``(?=...)``" -#: ../../howto/regex.rst:989 +#: ../../howto/regex.rst:985 msgid "" "Positive lookahead assertion. This succeeds if the contained regular " "expression, represented here by ``...``, successfully matches at the current " @@ -2124,11 +1868,11 @@ msgstr "" "し、それ以外の場合失敗します。しかし、表現が試行された場合でもエンジンは先に" "進みません; パターンの残りの部分はアサーションの開始時点から右に試行します。" -#: ../../howto/regex.rst:995 +#: ../../howto/regex.rst:994 msgid "``(?!...)``" msgstr "``(?!...)``" -#: ../../howto/regex.rst:996 +#: ../../howto/regex.rst:992 msgid "" "Negative lookahead assertion. This is the opposite of the positive " "assertion; it succeeds if the contained expression *doesn't* match at the " @@ -2137,7 +1881,7 @@ msgstr "" "否定先読みアサーション。これは肯定アサーションの逆で、正規表現が文字列の現在" "位置にマッチ *しなかった* 場合に成功します。" -#: ../../howto/regex.rst:1000 +#: ../../howto/regex.rst:996 msgid "" "To make this concrete, let's look at a case where a lookahead is useful. " "Consider a simple pattern to match a filename and split it apart into a base " @@ -2149,15 +1893,15 @@ msgstr "" "う。例えば、 ``news.rc`` は ``news`` が基本部分で ``rc`` がファイル名の拡張子" "です。" -#: ../../howto/regex.rst:1005 +#: ../../howto/regex.rst:1001 msgid "The pattern to match this is quite simple:" msgstr "マッチするパターンはとても単純です:" -#: ../../howto/regex.rst:1007 +#: ../../howto/regex.rst:1003 msgid "``.*[.].*$``" msgstr "``.*[.].*$``" -#: ../../howto/regex.rst:1009 +#: ../../howto/regex.rst:1005 msgid "" "Notice that the ``.`` needs to be treated specially because it's a " "metacharacter, so it's inside a character class to only match that specific " @@ -2172,7 +1916,7 @@ msgstr "" "を保障するために追加しています。この正規表現は ``foo.bar``, ``autoexec." "bat``, ``sendmail.cf``, ``printers.conf`` にマッチします。" -#: ../../howto/regex.rst:1016 +#: ../../howto/regex.rst:1012 msgid "" "Now, consider complicating the problem a bit; what if you want to match " "filenames where the extension is not ``bat``? Some incorrect attempts:" @@ -2180,7 +1924,7 @@ msgstr "" "さて、問題を少し複雑にしてみましょう; 拡張子が ``bat`` でないファイル名にマッ" "チしたい場合はどうでしょう?間違った試み:" -#: ../../howto/regex.rst:1019 +#: ../../howto/regex.rst:1015 msgid "" "``.*[.][^b].*$`` The first attempt above tries to exclude ``bat`` by " "requiring that the first character of the extension is not a ``b``. This is " @@ -2190,11 +1934,11 @@ msgstr "" "とを要求します。これは誤っています、なぜなら ``foo.bar`` にもマッチしないから" "です。" -#: ../../howto/regex.rst:1023 +#: ../../howto/regex.rst:1019 msgid "``.*[.]([^b]..|.[^a].|..[^t])$``" msgstr "``.*[.]([^b]..|.[^a].|..[^t])$``" -#: ../../howto/regex.rst:1025 +#: ../../howto/regex.rst:1021 msgid "" "The expression gets messier when you try to patch up the first solution by " "requiring one of the following cases to match: the first character of the " @@ -2211,11 +1955,11 @@ msgstr "" "cf`` のような二文字の拡張子を受け付けません。これを修正するのにパターンを再び" "複雑にすることになります。" -#: ../../howto/regex.rst:1033 +#: ../../howto/regex.rst:1029 msgid "``.*[.]([^b].?.?|.[^a]?.?|..?[^t]?)$``" msgstr "``.*[.]([^b].?.?|.[^a]?.?|..?[^t]?)$``" -#: ../../howto/regex.rst:1035 +#: ../../howto/regex.rst:1031 msgid "" "In the third attempt, the second and third letters are all made optional in " "order to allow matching extensions shorter than three characters, such as " @@ -2224,7 +1968,7 @@ msgstr "" "三番目の試みでは、 ``sendmail.cf`` のように三文字より短い拡張子とマッチするた" "めに第二第三の文字を全てオプションにしています。" -#: ../../howto/regex.rst:1039 +#: ../../howto/regex.rst:1035 msgid "" "The pattern's getting really complicated now, which makes it hard to read " "and understand. Worse, if the problem changes and you want to exclude both " @@ -2235,11 +1979,11 @@ msgstr "" "とに、問題が ``bat`` と ``exe`` 両方を拡張子から除きたい場合に変わった場合、" "パターンはより複雑で混乱しやすいものになります。" -#: ../../howto/regex.rst:1044 +#: ../../howto/regex.rst:1040 msgid "A negative lookahead cuts through all this confusion:" msgstr "否定先読みはこの混乱全てを取り除きます:" -#: ../../howto/regex.rst:1046 +#: ../../howto/regex.rst:1042 msgid "" "``.*[.](?!bat$)[^.]*$`` The negative lookahead means: if the expression " "``bat`` doesn't match at this point, try the rest of the pattern; if " @@ -2255,7 +1999,7 @@ msgstr "" "このパターンで ``[^.]*`` を使うことで、ファイル名に複数のドットがあったときに" "も上手くいくようになります。" -#: ../../howto/regex.rst:1053 +#: ../../howto/regex.rst:1049 msgid "" "Excluding another filename extension is now easy; simply add it as an " "alternative inside the assertion. The following pattern excludes filenames " @@ -2265,15 +2009,15 @@ msgstr "" "替 (or) で加えます。以下のパターンは ``bat`` や ``exe`` のどちらかで終わる" "ファイル名を除外します:" -#: ../../howto/regex.rst:1057 +#: ../../howto/regex.rst:1053 msgid "``.*[.](?!bat$|exe$)[^.]*$``" msgstr "``.*[.](?!bat$|exe$)[^.]*$``" -#: ../../howto/regex.rst:1061 +#: ../../howto/regex.rst:1057 msgid "Modifying Strings" msgstr "文字列を変更する" -#: ../../howto/regex.rst:1063 +#: ../../howto/regex.rst:1059 msgid "" "Up to this point, we've simply performed searches against a static string. " "Regular expressions are also commonly used to modify strings in various " @@ -2283,40 +2027,40 @@ msgstr "" "列を様々な方法で変更するのにもよく使われます。変更には以下のパターンメソッド" "が利用されます:" -#: ../../howto/regex.rst:1070 +#: ../../howto/regex.rst:1066 msgid "``split()``" msgstr "``split()``" -#: ../../howto/regex.rst:1070 +#: ../../howto/regex.rst:1066 msgid "Split the string into a list, splitting it wherever the RE matches" msgstr "文字列をリストに分割する、正規表現がマッチした全ての場所で分割を行う" -#: ../../howto/regex.rst:1073 +#: ../../howto/regex.rst:1069 msgid "``sub()``" msgstr "``sub()``" -#: ../../howto/regex.rst:1073 +#: ../../howto/regex.rst:1069 msgid "" "Find all substrings where the RE matches, and replace them with a different " "string" msgstr "正規表現にマッチした全ての文字列を発見し、別の文字列に置き換えます" -#: ../../howto/regex.rst:1076 +#: ../../howto/regex.rst:1072 msgid "``subn()``" msgstr "``subn()``" -#: ../../howto/regex.rst:1076 +#: ../../howto/regex.rst:1072 msgid "" "Does the same thing as :meth:`!sub`, but returns the new string and the " "number of replacements" msgstr "" ":meth:`!sub` と同じことをしますが、新しい文字列と置き換えの回数を返します" -#: ../../howto/regex.rst:1083 +#: ../../howto/regex.rst:1079 msgid "Splitting Strings" msgstr "文字列の分割" -#: ../../howto/regex.rst:1085 +#: ../../howto/regex.rst:1081 msgid "" "The :meth:`~re.Pattern.split` method of a pattern splits a string apart " "wherever the RE matches, returning a list of the pieces. It's similar to " @@ -2331,7 +2075,7 @@ msgstr "" "ドは単に空白文字か固定文字列で分割出来るだけです。ご想像通り、モジュールレベ" "ルの :func:`re.split` 関数もあります。" -#: ../../howto/regex.rst:1096 +#: ../../howto/regex.rst:1092 msgid "" "Split *string* by the matches of the regular expression. If capturing " "parentheses are used in the RE, then their contents will also be returned as " @@ -2342,7 +2086,7 @@ msgstr "" "されている場合、その内容も結果のリストの一部として返されます。 *maxsplit* が" "非ゼロの場合、最大で *maxsplit* の分割が実行されます。" -#: ../../howto/regex.rst:1101 +#: ../../howto/regex.rst:1097 msgid "" "You can limit the number of splits made, by passing a value for *maxsplit*. " "When *maxsplit* is nonzero, at most *maxsplit* splits will be made, and the " @@ -2355,16 +2099,7 @@ msgstr "" "リストの最終要素として返されます。以下の例では、デリミタは任意の英数文字の" "シーケンスです。 ::" -#: ../../howto/regex.rst:1107 -msgid "" -">>> p = re.compile(r'\\W+')\n" -">>> p.split('This is a test, short and sweet, of split().')\n" -"['This', 'is', 'a', 'test', 'short', 'and', 'sweet', 'of', 'split', '']\n" -">>> p.split('This is a test, short and sweet, of split().', 3)\n" -"['This', 'is', 'a', 'test, short and sweet, of split().']" -msgstr "" - -#: ../../howto/regex.rst:1113 +#: ../../howto/regex.rst:1109 msgid "" "Sometimes you're not only interested in what the text between delimiters is, " "but also need to know what the delimiter was. If capturing parentheses are " @@ -2375,17 +2110,7 @@ msgstr "" "知りたい場合はよくあります。取りこみ用の括弧を正規表現に使った場合、その値も" "リストの一部として返されます。以下の呼び出しを比較してみましょう::" -#: ../../howto/regex.rst:1118 -msgid "" -">>> p = re.compile(r'\\W+')\n" -">>> p2 = re.compile(r'(\\W+)')\n" -">>> p.split('This... is a test.')\n" -"['This', 'is', 'a', 'test', '']\n" -">>> p2.split('This... is a test.')\n" -"['This', '... ', 'is', ' ', 'a', ' ', 'test', '.', '']" -msgstr "" - -#: ../../howto/regex.rst:1125 +#: ../../howto/regex.rst:1121 msgid "" "The module-level function :func:`re.split` adds the RE to be used as the " "first argument, but is otherwise the same. ::" @@ -2393,21 +2118,11 @@ msgstr "" "モジュールレベル関数 :func:`re.split` は最初の引数に利用する正規表現を追加し" "ますが、それ以外は同じです。 ::" -#: ../../howto/regex.rst:1128 -msgid "" -">>> re.split(r'[\\W]+', 'Words, words, words.')\n" -"['Words', 'words', 'words', '']\n" -">>> re.split(r'([\\W]+)', 'Words, words, words.')\n" -"['Words', ', ', 'words', ', ', 'words', '.', '']\n" -">>> re.split(r'[\\W]+', 'Words, words, words.', 1)\n" -"['Words', 'words, words.']" -msgstr "" - -#: ../../howto/regex.rst:1137 +#: ../../howto/regex.rst:1133 msgid "Search and Replace" msgstr "検索と置換" -#: ../../howto/regex.rst:1139 +#: ../../howto/regex.rst:1135 msgid "" "Another common task is to find all the matches for a pattern, and replace " "them with a different string. The :meth:`~re.Pattern.sub` method takes a " @@ -2419,17 +2134,17 @@ msgstr "" ":meth:`~re.Pattern.sub` メソッドは置換する値をとります、文字列と関数の両方を" "とることができ、文字列を処理します。" -#: ../../howto/regex.rst:1146 +#: ../../howto/regex.rst:1142 msgid "" "Returns the string obtained by replacing the leftmost non-overlapping " "occurrences of the RE in *string* by the replacement *replacement*. If the " "pattern isn't found, *string* is returned unchanged." msgstr "" -"*string* 内で最も長く、他の部分と重複するところがない正規表現を " +"*string* 内で最も長く、他の部分と重複するところがない正規表現をを " "*replacement* に置換した文字列を返します。パターンが見つからなかった場合 " "*string* は変更されずに返されます。" -#: ../../howto/regex.rst:1150 +#: ../../howto/regex.rst:1146 msgid "" "The optional argument *count* is the maximum number of pattern occurrences " "to be replaced; *count* must be a non-negative integer. The default value " @@ -2439,7 +2154,7 @@ msgstr "" "数でなければいけません。デフォルト値 0 は全ての出現で置換することを意味しま" "す。" -#: ../../howto/regex.rst:1154 +#: ../../howto/regex.rst:1150 msgid "" "Here's a simple example of using the :meth:`~re.Pattern.sub` method. It " "replaces colour names with the word ``colour``::" @@ -2447,16 +2162,7 @@ msgstr "" "ここに :meth:`~re.Pattern.sub` メソッドを使った単純な例があります。これは色の" "名前を ``colour`` に置換します::" -#: ../../howto/regex.rst:1157 -msgid "" -">>> p = re.compile('(blue|white|red)')\n" -">>> p.sub('colour', 'blue socks and red shoes')\n" -"'colour socks and colour shoes'\n" -">>> p.sub('colour', 'blue socks and red shoes', count=1)\n" -"'colour socks and red shoes'" -msgstr "" - -#: ../../howto/regex.rst:1163 +#: ../../howto/regex.rst:1159 msgid "" "The :meth:`~re.Pattern.subn` method does the same work, but returns a 2-" "tuple containing the new string value and the number of replacements that " @@ -2465,16 +2171,7 @@ msgstr "" ":meth:`~re.Pattern.subn` メソッドも同じ働きをしますが、新しい文字列と置換の実" "行回数を含む 2-タプルを返します::" -#: ../../howto/regex.rst:1166 -msgid "" -">>> p = re.compile('(blue|white|red)')\n" -">>> p.subn('colour', 'blue socks and red shoes')\n" -"('colour socks and colour shoes', 2)\n" -">>> p.subn('colour', 'no colours at all')\n" -"('no colours at all', 0)" -msgstr "" - -#: ../../howto/regex.rst:1172 +#: ../../howto/regex.rst:1168 msgid "" "Empty matches are replaced only when they're not adjacent to a previous " "empty match. ::" @@ -2484,13 +2181,6 @@ msgstr "" #: ../../howto/regex.rst:1175 msgid "" -">>> p = re.compile('x*')\n" -">>> p.sub('-', 'abxd')\n" -"'-a-b--d-'" -msgstr "" - -#: ../../howto/regex.rst:1179 -msgid "" "If *replacement* is a string, any backslash escapes in it are processed. " "That is, ``\\n`` is converted to a single newline character, ``\\r`` is " "converted to a carriage return, and so forth. Unknown escapes such as " @@ -2506,7 +2196,7 @@ msgstr "" "す。これを使うことで元のテキストの一部を、置換後の文字列に組み込むことができ" "ます。" -#: ../../howto/regex.rst:1186 +#: ../../howto/regex.rst:1182 msgid "" "This example matches the word ``section`` followed by a string enclosed in " "``{``, ``}``, and changes ``section`` to ``subsection``::" @@ -2516,13 +2206,6 @@ msgstr "" #: ../../howto/regex.rst:1189 msgid "" -">>> p = re.compile('section{ ( [^}]* ) }', re.VERBOSE)\n" -">>> p.sub(r'subsection{\\1}','section{First} section{second}')\n" -"'subsection{First} subsection{second}'" -msgstr "" - -#: ../../howto/regex.rst:1193 -msgid "" "There's also a syntax for referring to named groups as defined by the ``(?" "P...)`` syntax. ``\\g`` will use the substring matched by the " "group named ``name``, and ``\\g`` uses the corresponding group " @@ -2540,18 +2223,7 @@ msgstr "" "後にリテラル文字 ``'0'`` が続くとは解釈されません。) 以下に示す置換は全て等価" "ですが、これらは文字列置換に全部で3種の変種を利用しています。 ::" -#: ../../howto/regex.rst:1202 -msgid "" -">>> p = re.compile('section{ (?P [^}]* ) }', re.VERBOSE)\n" -">>> p.sub(r'subsection{\\1}','section{First}')\n" -"'subsection{First}'\n" -">>> p.sub(r'subsection{\\g<1>}','section{First}')\n" -"'subsection{First}'\n" -">>> p.sub(r'subsection{\\g}','section{First}')\n" -"'subsection{First}'" -msgstr "" - -#: ../../howto/regex.rst:1210 +#: ../../howto/regex.rst:1206 msgid "" "*replacement* can also be a function, which gives you even more control. If " "*replacement* is a function, the function is called for every non-" @@ -2565,25 +2237,13 @@ msgstr "" "クト ` が引数として渡されるので、望みの置換と返却のためにこの" "情報を利用出来ます。" -#: ../../howto/regex.rst:1216 +#: ../../howto/regex.rst:1212 msgid "" "In the following example, the replacement function translates decimals into " "hexadecimal::" msgstr "続く例では、置換関数は十進数文字列を十六進数文字列に変換しています::" -#: ../../howto/regex.rst:1219 -msgid "" -">>> def hexrepl(match):\n" -"... \"Return the hex string for a decimal number\"\n" -"... value = int(match.group())\n" -"... return hex(value)\n" -"...\n" -">>> p = re.compile(r'\\d+')\n" -">>> p.sub(hexrepl, 'Call 65490 for printing, 49152 for user code.')\n" -"'Call 0xffd2 for printing, 0xc000 for user code.'" -msgstr "" - -#: ../../howto/regex.rst:1228 +#: ../../howto/regex.rst:1224 msgid "" "When using the module-level :func:`re.sub` function, the pattern is passed " "as the first argument. The pattern may be provided as an object or as a " @@ -2598,11 +2258,11 @@ msgstr "" "埋め込んだパターン文字列を使うかしなければいけません、例えば ``sub(\"(?i)b+" "\", \"x\", \"bbbb BBBB\")`` は ``'x x'`` を返します。" -#: ../../howto/regex.rst:1236 +#: ../../howto/regex.rst:1232 msgid "Common Problems" msgstr "よくある問題" -#: ../../howto/regex.rst:1238 +#: ../../howto/regex.rst:1234 msgid "" "Regular expressions are a powerful tool for some applications, but in some " "ways their behaviour isn't intuitive and at times they don't behave the way " @@ -2613,11 +2273,11 @@ msgstr "" "振る舞いは直感的ではなく、期待通りに振る舞わないことがあります。この節では最" "もよくある落とし穴を指摘します。" -#: ../../howto/regex.rst:1244 +#: ../../howto/regex.rst:1240 msgid "Use String Methods" msgstr "文字列メソッドを利用する" -#: ../../howto/regex.rst:1246 +#: ../../howto/regex.rst:1242 msgid "" "Sometimes using the :mod:`re` module is a mistake. If you're matching a " "fixed string, or a single character class, and you're not using any :mod:" @@ -2635,7 +2295,7 @@ msgstr "" "ソッドを持っていて、大きな汎用化された正規表現エンジンではなく、目的のために" "最適化された単一の小さな C loop で実装されているため、大抵の場合高速です." -#: ../../howto/regex.rst:1254 +#: ../../howto/regex.rst:1250 msgid "" "One example might be replacing a single fixed string with another one; for " "example, you might replace ``word`` with ``deed``. :func:`re.sub` seems " @@ -2657,7 +2317,7 @@ msgstr "" "``\\bword\\b`` として、 ``word`` の両側に単語の境界が要求されるようにします。" "これは :meth:`!replace` の能力を越えた作業です。)" -#: ../../howto/regex.rst:1263 +#: ../../howto/regex.rst:1259 msgid "" "Another common task is deleting every occurrence of a single character from " "a string or replacing it with another single character. You might do this " @@ -2670,7 +2330,7 @@ msgstr "" "れませんが、 :meth:`~str.translate` は削除と置換の両方の作業をこなし、正規表" "現操作よりも高速に行うことができます。" -#: ../../howto/regex.rst:1269 +#: ../../howto/regex.rst:1265 msgid "" "In short, before turning to the :mod:`re` module, consider whether your " "problem can be solved with a faster and simpler string method." @@ -2678,11 +2338,11 @@ msgstr "" "要は、 :mod:`re` モジュールに向う前に問題が高速で単純な文字列メソッドで解決で" "きるか考えましょうということです。" -#: ../../howto/regex.rst:1274 +#: ../../howto/regex.rst:1270 msgid "match() versus search()" msgstr "match() 対 search()" -#: ../../howto/regex.rst:1276 +#: ../../howto/regex.rst:1272 msgid "" "The :func:`~re.match` function only checks if the RE matches at the " "beginning of the string while :func:`~re.search` will scan forward through " @@ -2699,15 +2359,7 @@ msgstr "" "マッチしなければ、 :func:`!match` はそれを報告 *しない* 、ということを覚えて" "おいてください。 ::" -#: ../../howto/regex.rst:1282 -msgid "" -">>> print(re.match('super', 'superstition').span())\n" -"(0, 5)\n" -">>> print(re.match('super', 'insuperable'))\n" -"None" -msgstr "" - -#: ../../howto/regex.rst:1287 +#: ../../howto/regex.rst:1283 msgid "" "On the other hand, :func:`~re.search` will scan forward through the string, " "reporting the first match it finds. ::" @@ -2715,15 +2367,7 @@ msgstr "" "一方 :func:`~re.search` は文字列の先の方まで走査し、最初にみつけたマッチを報" "告します。::" -#: ../../howto/regex.rst:1290 -msgid "" -">>> print(re.search('super', 'superstition').span())\n" -"(0, 5)\n" -">>> print(re.search('super', 'insuperable').span())\n" -"(2, 7)" -msgstr "" - -#: ../../howto/regex.rst:1295 +#: ../../howto/regex.rst:1291 msgid "" "Sometimes you'll be tempted to keep using :func:`re.match`, and just add ``." "*`` to the front of your RE. Resist this temptation and use :func:`re." @@ -2742,7 +2386,7 @@ msgstr "" "ら始まらなければいけません。解析によってエンジンは速やかに開始文字を探して走" "査します、 ``'C'`` が発見された場合にはじめて完全なマッチを試みます。" -#: ../../howto/regex.rst:1304 +#: ../../howto/regex.rst:1300 msgid "" "Adding ``.*`` defeats this optimization, requiring scanning to the end of " "the string and then backtracking to find a match for the rest of the RE. " @@ -2752,11 +2396,11 @@ msgstr "" "となり、走査後には残りの正規表現とのマッチ部分を見つけるために引き返すことに" "なります。代わりに :func:`re.search` を利用して下さい。" -#: ../../howto/regex.rst:1310 +#: ../../howto/regex.rst:1306 msgid "Greedy versus Non-Greedy" msgstr "貪欲 (greedy) 対非貪欲 (non-greedy)" -#: ../../howto/regex.rst:1312 +#: ../../howto/regex.rst:1308 msgid "" "When repeating a regular expression, as in ``a*``, the resulting action is " "to consume as much of the pattern as possible. This fact often bites you " @@ -2770,18 +2414,7 @@ msgstr "" "す。単一の HTML タグにマッチする素朴な正規表現はうまく動作しません、なぜなら" "ば ``.*`` は貪欲に動作するからです。 ::" -#: ../../howto/regex.rst:1318 -msgid "" -">>> s = 'Title'\n" -">>> len(s)\n" -"32\n" -">>> print(re.match('<.*>', s).span())\n" -"(0, 32)\n" -">>> print(re.match('<.*>', s).group())\n" -"Title" -msgstr "" - -#: ../../howto/regex.rst:1326 +#: ../../howto/regex.rst:1322 msgid "" "The RE matches the ``'<'`` in ``''``, and the ``.*`` consumes the rest " "of the string. There's still more left in the RE, though, and the ``>`` " @@ -2798,28 +2431,21 @@ msgstr "" "最終的にマッチする領域は ``''`` の ``'<'`` から ``''`` の " "``'>'`` まで広がりますが、これは望んだ結果ではありません。" -#: ../../howto/regex.rst:1333 +#: ../../howto/regex.rst:1329 msgid "" -"In this case, the solution is to use the non-greedy quantifiers ``*?``, ``+?" +"In this case, the solution is to use the non-greedy qualifiers ``*?``, ``+?" "``, ``??``, or ``{m,n}?``, which match as *little* text as possible. In the " "above example, the ``'>'`` is tried immediately after the first ``'<'`` " "matches, and when it fails, the engine advances a character at a time, " "retrying the ``'>'`` at every step. This produces just the right result::" msgstr "" -"この場合の解決策は、非貪欲 (non-greedy) な数量子 ``*?``, ``+?``, ``??``, ある" -"いは ``{m,n}?`` を使うことです。これらはできるだけ *少ない* テキストにマッチ" -"しようとします。上記の例では、 ``'>'`` は ``'<'`` がマッチした直後の文字から" -"マッチするかどうかを調べられ、失敗すると同時にエンジンは文字を先に進めなが" -"ら、各ステップで ``'>'`` のマッチを試みます。この動作は正しい結果を生成しま" -"す::" - -#: ../../howto/regex.rst:1339 -msgid "" -">>> print(re.match('<.*?>', s).group())\n" -"" -msgstr "" +"この場合、解決法は非貪欲を示す修飾子 ``*?``, ``+?``, ``??`` または ``{m,n}?" +"`` を利用することです、これらはテキストに可能な限り *少なく* マッチします。上" +"の例では、 ``'>'`` は最初の ``'<'`` とのマッチ後すぐに ``'>'`` を試みま、失敗" +"した場合にはエンジンが文字を先に進め、``'>'`` が毎ステップ再試行されます。こ" +"の動作は正しい結果を生み出します::" -#: ../../howto/regex.rst:1342 +#: ../../howto/regex.rst:1338 msgid "" "(Note that parsing HTML or XML with regular expressions is painful. Quick-" "and-dirty patterns will handle common cases, but HTML and XML have special " @@ -2834,11 +2460,11 @@ msgstr "" "現を書き上げたときには、パターンは *非常に* 複雑なものになります。そのような" "作業をする場合には HTML や XML パーサを利用しましょう。)" -#: ../../howto/regex.rst:1350 +#: ../../howto/regex.rst:1346 msgid "Using re.VERBOSE" msgstr "re.VERBOSE の利用" -#: ../../howto/regex.rst:1352 +#: ../../howto/regex.rst:1348 msgid "" "By now you've probably noticed that regular expressions are a very compact " "notation, but they're not terribly readable. REs of moderate complexity can " @@ -2850,7 +2476,7 @@ msgstr "" "入り組んだ正規表現ははバックスラッシュ、括弧、特殊文字が長く続いて、読みにく" "く、理解しづらいものになります。" -#: ../../howto/regex.rst:1357 +#: ../../howto/regex.rst:1353 msgid "" "For such REs, specifying the :const:`re.VERBOSE` flag when compiling the " "regular expression can be helpful, because it allows you to format the " @@ -2860,7 +2486,7 @@ msgstr "" "VERBOSE` フラグを指定することが助けになります。なぜなら、より明確な書式で正規" "表現を書けるからです。" -#: ../../howto/regex.rst:1361 +#: ../../howto/regex.rst:1357 msgid "" "The ``re.VERBOSE`` flag has several effects. Whitespace in the regular " "expression that *isn't* inside a character class is ignored. This means " @@ -2878,31 +2504,15 @@ msgstr "" "す。三重クォートを利用することで、正規表現をきちんとフォーマットすることがで" "きます::" -#: ../../howto/regex.rst:1369 -msgid "" -"pat = re.compile(r\"\"\"\n" -" \\s* # Skip leading whitespace\n" -" (?P
[^:]+) # Header name\n" -" \\s* : # Whitespace, and a colon\n" -" (?P.*?) # The header's value -- *? used to\n" -" # lose the following trailing whitespace\n" -" \\s*$ # Trailing whitespace to end-of-line\n" -"\"\"\", re.VERBOSE)" -msgstr "" - -#: ../../howto/regex.rst:1378 +#: ../../howto/regex.rst:1374 msgid "This is far more readable than::" msgstr "これは下よりはるかに読みやすいです::" #: ../../howto/regex.rst:1380 -msgid "pat = re.compile(r\"\\s*(?P
[^:]+)\\s*:(?P.*?)\\s*$\")" -msgstr "" - -#: ../../howto/regex.rst:1384 msgid "Feedback" msgstr "フィードバック" -#: ../../howto/regex.rst:1386 +#: ../../howto/regex.rst:1382 msgid "" "Regular expressions are a complicated topic. Did this document help you " "understand them? Were there parts that were unclear, or Problems you " @@ -2913,7 +2523,7 @@ msgstr "" "くかったところや、あなたが遭遇した問題が扱われていない等なかったでしょうか?" "もしそんな問題があれば、著者に改善の提案を送って下さい。" -#: ../../howto/regex.rst:1391 +#: ../../howto/regex.rst:1387 msgid "" "The most complete book on regular expressions is almost certainly Jeffrey " "Friedl's Mastering Regular Expressions, published by O'Reilly. " diff --git a/howto/remote_debugging.po b/howto/remote_debugging.po deleted file mode 100644 index d7908bcf1..000000000 --- a/howto/remote_debugging.po +++ /dev/null @@ -1,851 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 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.14\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-13 14:21+0000\n" -"PO-Revision-Date: 2025-05-08 06:04+0000\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" -"ja/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#: ../../howto/remote_debugging.rst:4 -msgid "Remote debugging attachment protocol" -msgstr "" - -#: ../../howto/remote_debugging.rst:6 -msgid "" -"This section describes the low-level protocol that enables external tools to " -"inject and execute a Python script within a running CPython process." -msgstr "" - -#: ../../howto/remote_debugging.rst:9 -msgid "" -"This mechanism forms the basis of the :func:`sys.remote_exec` function, " -"which instructs a remote Python process to execute a ``.py`` file. However, " -"this section does not document the usage of that function. Instead, it " -"provides a detailed explanation of the underlying protocol, which takes as " -"input the ``pid`` of a target Python process and the path to a Python source " -"file to be executed. This information supports independent reimplementation " -"of the protocol, regardless of programming language." -msgstr "" - -#: ../../howto/remote_debugging.rst:19 -msgid "" -"The execution of the injected script depends on the interpreter reaching a " -"safe evaluation point. As a result, execution may be delayed depending on " -"the runtime state of the target process." -msgstr "" - -#: ../../howto/remote_debugging.rst:23 -msgid "" -"Once injected, the script is executed by the interpreter within the target " -"process the next time a safe evaluation point is reached. This approach " -"enables remote execution capabilities without modifying the behavior or " -"structure of the running Python application." -msgstr "" - -#: ../../howto/remote_debugging.rst:28 -msgid "" -"Subsequent sections provide a step-by-step description of the protocol, " -"including techniques for locating interpreter structures in memory, safely " -"accessing internal fields, and triggering code execution. Platform-specific " -"variations are noted where applicable, and example implementations are " -"included to clarify each operation." -msgstr "" - -#: ../../howto/remote_debugging.rst:35 -msgid "Locating the PyRuntime structure" -msgstr "" - -#: ../../howto/remote_debugging.rst:37 -msgid "" -"CPython places the ``PyRuntime`` structure in a dedicated binary section to " -"help external tools find it at runtime. The name and format of this section " -"vary by platform. For example, ``.PyRuntime`` is used on ELF systems, and " -"``__DATA,__PyRuntime`` is used on macOS. Tools can find the offset of this " -"structure by examining the binary on disk." -msgstr "" - -#: ../../howto/remote_debugging.rst:43 -msgid "" -"The ``PyRuntime`` structure contains CPython’s global interpreter state and " -"provides access to other internal data, including the list of interpreters, " -"thread states, and debugger support fields." -msgstr "" - -#: ../../howto/remote_debugging.rst:47 -msgid "" -"To work with a remote Python process, a debugger must first find the memory " -"address of the ``PyRuntime`` structure in the target process. This address " -"can’t be hardcoded or calculated from a symbol name, because it depends on " -"where the operating system loaded the binary." -msgstr "" - -#: ../../howto/remote_debugging.rst:52 -msgid "" -"The method for finding ``PyRuntime`` depends on the platform, but the steps " -"are the same in general:" -msgstr "" - -#: ../../howto/remote_debugging.rst:55 -msgid "" -"Find the base address where the Python binary or shared library was loaded " -"in the target process." -msgstr "" - -#: ../../howto/remote_debugging.rst:57 -msgid "" -"Use the on-disk binary to locate the offset of the ``.PyRuntime`` section." -msgstr "" - -#: ../../howto/remote_debugging.rst:58 -msgid "" -"Add the section offset to the base address to compute the address in memory." -msgstr "" - -#: ../../howto/remote_debugging.rst:60 -msgid "" -"The sections below explain how to do this on each supported platform and " -"include example code." -msgstr "" - -#: ../../howto/remote_debugging.rst:64 -msgid "Linux (ELF)" -msgstr "" - -#: ../../howto/remote_debugging.rst:65 -msgid "To find the ``PyRuntime`` structure on Linux:" -msgstr "" - -#: ../../howto/remote_debugging.rst:67 -msgid "" -"Read the process’s memory map (for example, ``/proc//maps``) to find " -"the address where the Python executable or ``libpython`` was loaded." -msgstr "" - -#: ../../howto/remote_debugging.rst:69 -msgid "" -"Parse the ELF section headers in the binary to get the offset of the ``." -"PyRuntime`` section." -msgstr "" - -#: ../../howto/remote_debugging.rst:71 -msgid "" -"Add that offset to the base address from step 1 to get the memory address of " -"``PyRuntime``." -msgstr "" - -#: ../../howto/remote_debugging.rst:74 ../../howto/remote_debugging.rst:136 -#: ../../howto/remote_debugging.rst:206 ../../howto/remote_debugging.rst:475 -msgid "The following is an example implementation::" -msgstr "" - -#: ../../howto/remote_debugging.rst:76 -msgid "" -"def find_py_runtime_linux(pid: int) -> int:\n" -" # Step 1: Try to find the Python executable in memory\n" -" binary_path, base_address = find_mapped_binary(\n" -" pid, name_contains=\"python\"\n" -" )\n" -"\n" -" # Step 2: Fallback to shared library if executable is not found\n" -" if binary_path is None:\n" -" binary_path, base_address = find_mapped_binary(\n" -" pid, name_contains=\"libpython\"\n" -" )\n" -"\n" -" # Step 3: Parse ELF headers to get .PyRuntime section offset\n" -" section_offset = parse_elf_section_offset(\n" -" binary_path, \".PyRuntime\"\n" -" )\n" -"\n" -" # Step 4: Compute PyRuntime address in memory\n" -" return base_address + section_offset" -msgstr "" - -#: ../../howto/remote_debugging.rst:97 -msgid "" -"On Linux systems, there are two main approaches to read memory from another " -"process. The first is through the ``/proc`` filesystem, specifically by " -"reading from ``/proc/[pid]/mem`` which provides direct access to the " -"process's memory. This requires appropriate permissions - either being the " -"same user as the target process or having root access. The second approach " -"is using the ``process_vm_readv()`` system call which provides a more " -"efficient way to copy memory between processes. While ptrace's " -"``PTRACE_PEEKTEXT`` operation can also be used to read memory, it is " -"significantly slower as it only reads one word at a time and requires " -"multiple context switches between the tracer and tracee processes." -msgstr "" - -#: ../../howto/remote_debugging.rst:108 -msgid "" -"For parsing ELF sections, the process involves reading and interpreting the " -"ELF file format structures from the binary file on disk. The ELF header " -"contains a pointer to the section header table. Each section header contains " -"metadata about a section including its name (stored in a separate string " -"table), offset, and size. To find a specific section like .PyRuntime, you " -"need to walk through these headers and match the section name. The section " -"header then provides the offset where that section exists in the file, which " -"can be used to calculate its runtime address when the binary is loaded into " -"memory." -msgstr "" - -#: ../../howto/remote_debugging.rst:117 -msgid "" -"You can read more about the ELF file format in the `ELF specification " -"`_." -msgstr "" - -#: ../../howto/remote_debugging.rst:122 -msgid "macOS (Mach-O)" -msgstr "" - -#: ../../howto/remote_debugging.rst:123 -msgid "To find the ``PyRuntime`` structure on macOS:" -msgstr "" - -#: ../../howto/remote_debugging.rst:125 -msgid "" -"Call ``task_for_pid()`` to get the ``mach_port_t`` task port for the target " -"process. This handle is needed to read memory using APIs like " -"``mach_vm_read_overwrite`` and ``mach_vm_region``." -msgstr "" - -#: ../../howto/remote_debugging.rst:128 -msgid "" -"Scan the memory regions to find the one containing the Python executable or " -"``libpython``." -msgstr "" - -#: ../../howto/remote_debugging.rst:130 -msgid "" -"Load the binary file from disk and parse the Mach-O headers to find the " -"section named ``PyRuntime`` in the ``__DATA`` segment. On macOS, symbol " -"names are automatically prefixed with an underscore, so the ``PyRuntime`` " -"symbol appears as ``_PyRuntime`` in the symbol table, but the section name " -"is not affected." -msgstr "" - -#: ../../howto/remote_debugging.rst:138 -msgid "" -"def find_py_runtime_macos(pid: int) -> int:\n" -" # Step 1: Get access to the process's memory\n" -" handle = get_memory_access_handle(pid)\n" -"\n" -" # Step 2: Try to find the Python executable in memory\n" -" binary_path, base_address = find_mapped_binary(\n" -" handle, name_contains=\"python\"\n" -" )\n" -"\n" -" # Step 3: Fallback to libpython if the executable is not found\n" -" if binary_path is None:\n" -" binary_path, base_address = find_mapped_binary(\n" -" handle, name_contains=\"libpython\"\n" -" )\n" -"\n" -" # Step 4: Parse Mach-O headers to get __DATA,__PyRuntime section offset\n" -" section_offset = parse_macho_section_offset(\n" -" binary_path, \"__DATA\", \"__PyRuntime\"\n" -" )\n" -"\n" -" # Step 5: Compute the PyRuntime address in memory\n" -" return base_address + section_offset" -msgstr "" - -#: ../../howto/remote_debugging.rst:161 -msgid "" -"On macOS, accessing another process's memory requires using Mach-O specific " -"APIs and file formats. The first step is obtaining a ``task_port`` handle " -"via ``task_for_pid()``, which provides access to the target process's memory " -"space. This handle enables memory operations through APIs like " -"``mach_vm_read_overwrite()``." -msgstr "" - -#: ../../howto/remote_debugging.rst:167 -msgid "" -"The process memory can be examined using ``mach_vm_region()`` to scan " -"through the virtual memory space, while ``proc_regionfilename()`` helps " -"identify which binary files are loaded at each memory region. When the " -"Python binary or library is found, its Mach-O headers need to be parsed to " -"locate the ``PyRuntime`` structure." -msgstr "" - -#: ../../howto/remote_debugging.rst:172 -msgid "" -"The Mach-O format organizes code and data into segments and sections. The " -"``PyRuntime`` structure lives in a section named ``__PyRuntime`` within the " -"``__DATA`` segment. The actual runtime address calculation involves finding " -"the ``__TEXT`` segment which serves as the binary's base address, then " -"locating the ``__DATA`` segment containing our target section. The final " -"address is computed by combining the base address with the appropriate " -"section offsets from the Mach-O headers." -msgstr "" - -#: ../../howto/remote_debugging.rst:180 -msgid "" -"Note that accessing another process's memory on macOS typically requires " -"elevated privileges - either root access or special security entitlements " -"granted to the debugging process." -msgstr "" - -#: ../../howto/remote_debugging.rst:186 -msgid "Windows (PE)" -msgstr "" - -#: ../../howto/remote_debugging.rst:187 -msgid "To find the ``PyRuntime`` structure on Windows:" -msgstr "" - -#: ../../howto/remote_debugging.rst:189 -msgid "" -"Use the ToolHelp API to enumerate all modules loaded in the target process. " -"This is done using functions such as `CreateToolhelp32Snapshot `_, `Module32First `_, and " -"`Module32Next `_." -msgstr "" - -#: ../../howto/remote_debugging.rst:196 -msgid "" -"Identify the module corresponding to :file:`python.exe` or :file:`python{XY}." -"dll`, where ``X`` and ``Y`` are the major and minor version numbers of the " -"Python version, and record its base address." -msgstr "" - -#: ../../howto/remote_debugging.rst:199 -msgid "" -"Locate the ``PyRuntim`` section. Due to the PE format's 8-character limit on " -"section names (defined as ``IMAGE_SIZEOF_SHORT_NAME``), the original name " -"``PyRuntime`` is truncated. This section contains the ``PyRuntime`` " -"structure." -msgstr "" - -#: ../../howto/remote_debugging.rst:203 -msgid "" -"Retrieve the section’s relative virtual address (RVA) and add it to the base " -"address of the module." -msgstr "" - -#: ../../howto/remote_debugging.rst:208 -msgid "" -"def find_py_runtime_windows(pid: int) -> int:\n" -" # Step 1: Try to find the Python executable in memory\n" -" binary_path, base_address = find_loaded_module(\n" -" pid, name_contains=\"python\"\n" -" )\n" -"\n" -" # Step 2: Fallback to shared pythonXY.dll if the executable is not\n" -" # found\n" -" if binary_path is None:\n" -" binary_path, base_address = find_loaded_module(\n" -" pid, name_contains=\"python3\"\n" -" )\n" -"\n" -" # Step 3: Parse PE section headers to get the RVA of the PyRuntime\n" -" # section. The section name appears as \"PyRuntim\" due to the\n" -" # 8-character limit defined by the PE format (IMAGE_SIZEOF_SHORT_NAME).\n" -" section_rva = parse_pe_section_offset(binary_path, \"PyRuntim\")\n" -"\n" -" # Step 4: Compute PyRuntime address in memory\n" -" return base_address + section_rva" -msgstr "" - -#: ../../howto/remote_debugging.rst:230 -msgid "" -"On Windows, accessing another process's memory requires using the Windows " -"API functions like ``CreateToolhelp32Snapshot()`` and ``Module32First()/" -"Module32Next()`` to enumerate loaded modules. The ``OpenProcess()`` function " -"provides a handle to access the target process's memory space, enabling " -"memory operations through ``ReadProcessMemory()``." -msgstr "" - -#: ../../howto/remote_debugging.rst:236 -msgid "" -"The process memory can be examined by enumerating loaded modules to find the " -"Python binary or DLL. When found, its PE headers need to be parsed to locate " -"the ``PyRuntime`` structure." -msgstr "" - -#: ../../howto/remote_debugging.rst:240 -msgid "" -"The PE format organizes code and data into sections. The ``PyRuntime`` " -"structure lives in a section named \"PyRuntim\" (truncated from " -"\"PyRuntime\" due to PE's 8-character name limit). The actual runtime " -"address calculation involves finding the module's base address from the " -"module entry, then locating our target section in the PE headers. The final " -"address is computed by combining the base address with the section's virtual " -"address from the PE section headers." -msgstr "" - -#: ../../howto/remote_debugging.rst:247 -msgid "" -"Note that accessing another process's memory on Windows typically requires " -"appropriate privileges - either administrative access or the " -"``SeDebugPrivilege`` privilege granted to the debugging process." -msgstr "" - -#: ../../howto/remote_debugging.rst:253 -msgid "Reading _Py_DebugOffsets" -msgstr "" - -#: ../../howto/remote_debugging.rst:255 -msgid "" -"Once the address of the ``PyRuntime`` structure has been determined, the " -"next step is to read the ``_Py_DebugOffsets`` structure located at the " -"beginning of the ``PyRuntime`` block." -msgstr "" - -#: ../../howto/remote_debugging.rst:259 -msgid "" -"This structure provides version-specific field offsets that are needed to " -"safely read interpreter and thread state memory. These offsets vary between " -"CPython versions and must be checked before use to ensure they are " -"compatible." -msgstr "" - -#: ../../howto/remote_debugging.rst:263 -msgid "To read and check the debug offsets, follow these steps:" -msgstr "" - -#: ../../howto/remote_debugging.rst:265 -msgid "" -"Read memory from the target process starting at the ``PyRuntime`` address, " -"covering the same number of bytes as the ``_Py_DebugOffsets`` structure. " -"This structure is located at the very start of the ``PyRuntime`` memory " -"block. Its layout is defined in CPython’s internal headers and stays the " -"same within a given minor version, but may change in major versions." -msgstr "" - -#: ../../howto/remote_debugging.rst:271 -msgid "Check that the structure contains valid data:" -msgstr "" - -#: ../../howto/remote_debugging.rst:273 -msgid "The ``cookie`` field must match the expected debug marker." -msgstr "" - -#: ../../howto/remote_debugging.rst:274 -msgid "" -"The ``version`` field must match the version of the Python interpreter used " -"by the debugger." -msgstr "" - -#: ../../howto/remote_debugging.rst:276 -msgid "" -"If either the debugger or the target process is using a pre-release version " -"(for example, an alpha, beta, or release candidate), the versions must match " -"exactly." -msgstr "" - -#: ../../howto/remote_debugging.rst:279 -msgid "" -"The ``free_threaded`` field must have the same value in both the debugger " -"and the target process." -msgstr "" - -#: ../../howto/remote_debugging.rst:282 -msgid "" -"If the structure is valid, the offsets it contains can be used to locate " -"fields in memory. If any check fails, the debugger should stop the operation " -"to avoid reading memory in the wrong format." -msgstr "" - -#: ../../howto/remote_debugging.rst:286 -msgid "" -"The following is an example implementation that reads and checks " -"``_Py_DebugOffsets``::" -msgstr "" - -#: ../../howto/remote_debugging.rst:289 -msgid "" -"def read_debug_offsets(pid: int, py_runtime_addr: int) -> DebugOffsets:\n" -" # Step 1: Read memory from the target process at the PyRuntime address\n" -" data = read_process_memory(\n" -" pid, address=py_runtime_addr, size=DEBUG_OFFSETS_SIZE\n" -" )\n" -"\n" -" # Step 2: Deserialize the raw bytes into a _Py_DebugOffsets structure\n" -" debug_offsets = parse_debug_offsets(data)\n" -"\n" -" # Step 3: Validate the contents of the structure\n" -" if debug_offsets.cookie != EXPECTED_COOKIE:\n" -" raise RuntimeError(\"Invalid or missing debug cookie\")\n" -" if debug_offsets.version != LOCAL_PYTHON_VERSION:\n" -" raise RuntimeError(\n" -" \"Mismatch between caller and target Python versions\"\n" -" )\n" -" if debug_offsets.free_threaded != LOCAL_FREE_THREADED:\n" -" raise RuntimeError(\"Mismatch in free-threaded configuration\")\n" -"\n" -" return debug_offsets" -msgstr "" - -#: ../../howto/remote_debugging.rst:314 -msgid "**Process suspension recommended**" -msgstr "" - -#: ../../howto/remote_debugging.rst:316 -msgid "" -"To avoid race conditions and ensure memory consistency, it is strongly " -"recommended that the target process be suspended before performing any " -"operations that read or write internal interpreter state. The Python runtime " -"may concurrently mutate interpreter data structures—such as creating or " -"destroying threads—during normal execution. This can result in invalid " -"memory reads or writes." -msgstr "" - -#: ../../howto/remote_debugging.rst:323 -msgid "" -"A debugger may suspend execution by attaching to the process with ``ptrace`` " -"or by sending a ``SIGSTOP`` signal. Execution should only be resumed after " -"debugger-side memory operations are complete." -msgstr "" - -#: ../../howto/remote_debugging.rst:329 -msgid "" -"Some tools, such as profilers or sampling-based debuggers, may operate on a " -"running process without suspension. In such cases, tools must be explicitly " -"designed to handle partially updated or inconsistent memory. For most " -"debugger implementations, suspending the process remains the safest and most " -"robust approach." -msgstr "" - -#: ../../howto/remote_debugging.rst:337 -msgid "Locating the interpreter and thread state" -msgstr "" - -#: ../../howto/remote_debugging.rst:339 -msgid "" -"Before code can be injected and executed in a remote Python process, the " -"debugger must choose a thread in which to schedule execution. This is " -"necessary because the control fields used to perform remote code injection " -"are located in the ``_PyRemoteDebuggerSupport`` structure, which is embedded " -"in a ``PyThreadState`` object. These fields are modified by the debugger to " -"request execution of injected scripts." -msgstr "" - -#: ../../howto/remote_debugging.rst:346 -msgid "" -"The ``PyThreadState`` structure represents a thread running inside a Python " -"interpreter. It maintains the thread’s evaluation context and contains the " -"fields required for debugger coordination. Locating a valid " -"``PyThreadState`` is therefore a key prerequisite for triggering execution " -"remotely." -msgstr "" - -#: ../../howto/remote_debugging.rst:351 -msgid "" -"A thread is typically selected based on its role or ID. In most cases, the " -"main thread is used, but some tools may target a specific thread by its " -"native thread ID. Once the target thread is chosen, the debugger must locate " -"both the interpreter and the associated thread state structures in memory." -msgstr "" - -#: ../../howto/remote_debugging.rst:356 -msgid "The relevant internal structures are defined as follows:" -msgstr "" - -#: ../../howto/remote_debugging.rst:358 -msgid "" -"``PyInterpreterState`` represents an isolated Python interpreter instance. " -"Each interpreter maintains its own set of imported modules, built-in state, " -"and thread state list. Although most Python applications use a single " -"interpreter, CPython supports multiple interpreters in the same process." -msgstr "" - -#: ../../howto/remote_debugging.rst:363 -msgid "" -"``PyThreadState`` represents a thread running within an interpreter. It " -"contains execution state and the control fields used by the debugger." -msgstr "" - -#: ../../howto/remote_debugging.rst:366 -msgid "To locate a thread:" -msgstr "" - -#: ../../howto/remote_debugging.rst:368 -msgid "" -"Use the offset ``runtime_state.interpreters_head`` to obtain the address of " -"the first interpreter in the ``PyRuntime`` structure. This is the entry " -"point to the linked list of active interpreters." -msgstr "" - -#: ../../howto/remote_debugging.rst:372 -msgid "" -"Use the offset ``interpreter_state.threads_main`` to access the main thread " -"state associated with the selected interpreter. This is typically the most " -"reliable thread to target." -msgstr "" - -#: ../../howto/remote_debugging.rst:376 -msgid "" -"3. Optionally, use the offset ``interpreter_state.threads_head`` to iterate " -"through the linked list of all thread states. Each ``PyThreadState`` " -"structure contains a ``native_thread_id`` field, which may be compared to a " -"target thread ID to find a specific thread." -msgstr "" - -#: ../../howto/remote_debugging.rst:381 -msgid "" -"1. Once a valid ``PyThreadState`` has been found, its address can be used in " -"later steps of the protocol, such as writing debugger control fields and " -"scheduling execution." -msgstr "" - -#: ../../howto/remote_debugging.rst:385 -msgid "" -"The following is an example implementation that locates the main thread " -"state::" -msgstr "" - -#: ../../howto/remote_debugging.rst:387 -msgid "" -"def find_main_thread_state(\n" -" pid: int, py_runtime_addr: int, debug_offsets: DebugOffsets,\n" -") -> int:\n" -" # Step 1: Read interpreters_head from PyRuntime\n" -" interp_head_ptr = (\n" -" py_runtime_addr + debug_offsets.runtime_state.interpreters_head\n" -" )\n" -" interp_addr = read_pointer(pid, interp_head_ptr)\n" -" if interp_addr == 0:\n" -" raise RuntimeError(\"No interpreter found in the target process\")\n" -"\n" -" # Step 2: Read the threads_main pointer from the interpreter\n" -" threads_main_ptr = (\n" -" interp_addr + debug_offsets.interpreter_state.threads_main\n" -" )\n" -" thread_state_addr = read_pointer(pid, threads_main_ptr)\n" -" if thread_state_addr == 0:\n" -" raise RuntimeError(\"Main thread state is not available\")\n" -"\n" -" return thread_state_addr" -msgstr "" - -#: ../../howto/remote_debugging.rst:408 -msgid "" -"The following example demonstrates how to locate a thread by its native " -"thread ID::" -msgstr "" - -#: ../../howto/remote_debugging.rst:411 -msgid "" -"def find_thread_by_id(\n" -" pid: int,\n" -" interp_addr: int,\n" -" debug_offsets: DebugOffsets,\n" -" target_tid: int,\n" -") -> int:\n" -" # Start at threads_head and walk the linked list\n" -" thread_ptr = read_pointer(\n" -" pid,\n" -" interp_addr + debug_offsets.interpreter_state.threads_head\n" -" )\n" -"\n" -" while thread_ptr:\n" -" native_tid_ptr = (\n" -" thread_ptr + debug_offsets.thread_state.native_thread_id\n" -" )\n" -" native_tid = read_int(pid, native_tid_ptr)\n" -" if native_tid == target_tid:\n" -" return thread_ptr\n" -" thread_ptr = read_pointer(\n" -" pid,\n" -" thread_ptr + debug_offsets.thread_state.next\n" -" )\n" -"\n" -" raise RuntimeError(\"Thread with the given ID was not found\")" -msgstr "" - -#: ../../howto/remote_debugging.rst:438 -msgid "" -"Once a valid thread state has been located, the debugger can proceed with " -"modifying its control fields and scheduling execution, as described in the " -"next section." -msgstr "" - -#: ../../howto/remote_debugging.rst:443 -msgid "Writing control information" -msgstr "" - -#: ../../howto/remote_debugging.rst:445 -msgid "" -"Once a valid ``PyThreadState`` structure has been identified, the debugger " -"may modify control fields within it to schedule the execution of a specified " -"Python script. These control fields are checked periodically by the " -"interpreter, and when set correctly, they trigger the execution of remote " -"code at a safe point in the evaluation loop." -msgstr "" - -#: ../../howto/remote_debugging.rst:451 -msgid "" -"Each ``PyThreadState`` contains a ``_PyRemoteDebuggerSupport`` structure " -"used for communication between the debugger and the interpreter. The " -"locations of its fields are defined by the ``_Py_DebugOffsets`` structure " -"and include the following:" -msgstr "" - -#: ../../howto/remote_debugging.rst:456 -msgid "" -"``debugger_script_path``: A fixed-size buffer that holds the full path to a" -msgstr "" - -#: ../../howto/remote_debugging.rst:457 -msgid "" -"Python source file (``.py``). This file must be accessible and readable by " -"the target process when execution is triggered." -msgstr "" - -#: ../../howto/remote_debugging.rst:460 -msgid "" -"``debugger_pending_call``: An integer flag. Setting this to ``1`` tells the" -msgstr "" - -#: ../../howto/remote_debugging.rst:461 -msgid "interpreter that a script is ready to be executed." -msgstr "" - -#: ../../howto/remote_debugging.rst:463 -msgid "``eval_breaker``: A field checked by the interpreter during execution." -msgstr "" - -#: ../../howto/remote_debugging.rst:464 -msgid "" -"Setting bit 5 (``_PY_EVAL_PLEASE_STOP_BIT``, value ``1U << 5``) in this " -"field causes the interpreter to pause and check for debugger activity." -msgstr "" - -#: ../../howto/remote_debugging.rst:467 -msgid "" -"To complete the injection, the debugger must perform the following steps:" -msgstr "" - -#: ../../howto/remote_debugging.rst:469 -msgid "Write the full script path into the ``debugger_script_path`` buffer." -msgstr "" - -#: ../../howto/remote_debugging.rst:470 -msgid "Set ``debugger_pending_call`` to ``1``." -msgstr "" - -#: ../../howto/remote_debugging.rst:471 -msgid "" -"Read the current value of ``eval_breaker``, set bit 5 " -"(``_PY_EVAL_PLEASE_STOP_BIT``), and write the updated value back. This " -"signals the interpreter to check for debugger activity." -msgstr "" - -#: ../../howto/remote_debugging.rst:477 -msgid "" -"def inject_script(\n" -" pid: int,\n" -" thread_state_addr: int,\n" -" debug_offsets: DebugOffsets,\n" -" script_path: str\n" -") -> None:\n" -" # Compute the base offset of _PyRemoteDebuggerSupport\n" -" support_base = (\n" -" thread_state_addr +\n" -" debug_offsets.debugger_support.remote_debugger_support\n" -" )\n" -"\n" -" # Step 1: Write the script path into debugger_script_path\n" -" script_path_ptr = (\n" -" support_base +\n" -" debug_offsets.debugger_support.debugger_script_path\n" -" )\n" -" write_string(pid, script_path_ptr, script_path)\n" -"\n" -" # Step 2: Set debugger_pending_call to 1\n" -" pending_ptr = (\n" -" support_base +\n" -" debug_offsets.debugger_support.debugger_pending_call\n" -" )\n" -" write_int(pid, pending_ptr, 1)\n" -"\n" -" # Step 3: Set _PY_EVAL_PLEASE_STOP_BIT (bit 5, value 1 << 5) in\n" -" # eval_breaker\n" -" eval_breaker_ptr = (\n" -" thread_state_addr +\n" -" debug_offsets.debugger_support.eval_breaker\n" -" )\n" -" breaker = read_int(pid, eval_breaker_ptr)\n" -" breaker |= (1 << 5)\n" -" write_int(pid, eval_breaker_ptr, breaker)" -msgstr "" - -#: ../../howto/remote_debugging.rst:514 -msgid "" -"Once these fields are set, the debugger may resume the process (if it was " -"suspended). The interpreter will process the request at the next safe " -"evaluation point, load the script from disk, and execute it." -msgstr "" - -#: ../../howto/remote_debugging.rst:518 -msgid "" -"It is the responsibility of the debugger to ensure that the script file " -"remains present and accessible to the target process during execution." -msgstr "" - -#: ../../howto/remote_debugging.rst:523 -msgid "" -"Script execution is asynchronous. The script file cannot be deleted " -"immediately after injection. The debugger should wait until the injected " -"script has produced an observable effect before removing the file. This " -"effect depends on what the script is designed to do. For example, a debugger " -"might wait until the remote process connects back to a socket before " -"removing the script. Once such an effect is observed, it is safe to assume " -"the file is no longer needed." -msgstr "" - -#: ../../howto/remote_debugging.rst:532 -msgid "Summary" -msgstr "" - -#: ../../howto/remote_debugging.rst:534 -msgid "To inject and execute a Python script in a remote process:" -msgstr "" - -#: ../../howto/remote_debugging.rst:536 -msgid "Locate the ``PyRuntime`` structure in the target process’s memory." -msgstr "" - -#: ../../howto/remote_debugging.rst:537 -msgid "" -"Read and validate the ``_Py_DebugOffsets`` structure at the beginning of " -"``PyRuntime``." -msgstr "" - -#: ../../howto/remote_debugging.rst:539 -msgid "Use the offsets to locate a valid ``PyThreadState``." -msgstr "" - -#: ../../howto/remote_debugging.rst:540 -msgid "Write the path to a Python script into ``debugger_script_path``." -msgstr "" - -#: ../../howto/remote_debugging.rst:541 -msgid "Set the ``debugger_pending_call`` flag to ``1``." -msgstr "" - -#: ../../howto/remote_debugging.rst:542 -msgid "Set ``_PY_EVAL_PLEASE_STOP_BIT`` in the ``eval_breaker`` field." -msgstr "" - -#: ../../howto/remote_debugging.rst:543 -msgid "" -"Resume the process (if suspended). The script will execute at the next safe " -"evaluation point." -msgstr "" diff --git a/howto/sockets.po b/howto/sockets.po index b81f1a05f..bd4f57417 100644 --- a/howto/sockets.po +++ b/howto/sockets.po @@ -1,27 +1,31 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 -# Tetsuo Koyama , 2021 -# Takanori Suzuki , 2021 +# Inada Naoki , 2017 +# Nozomu Kaneko , 2017 +# Arihiro TAKASE, 2017 +# Shun Sakurai, 2017 +# tomo, 2017 +# 秘湯 , 2018 +# Tetsuo Koyama , 2020 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:53+0000\n" -"Last-Translator: Takanori Suzuki , 2021\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 17:46+0000\n" +"Last-Translator: Tetsuo Koyama , 2020\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../howto/sockets.rst:5 @@ -36,7 +40,7 @@ msgstr "著者" msgid "Gordon McMillan" msgstr "Gordon McMillan" -#: ../../howto/sockets.rst-1 +#: ../../howto/sockets.rstNone msgid "Abstract" msgstr "概要" @@ -114,7 +118,7 @@ msgstr "" #: ../../howto/sockets.rst:47 msgid "" "They were invented in Berkeley as part of the BSD flavor of Unix. They " -"spread like wildfire with the internet. With good reason --- the combination " +"spread like wildfire with the Internet. With good reason --- the combination " "of sockets with INET makes talking to arbitrary machines around the world " "unbelievably easy (at least compared to other schemes)." msgstr "" @@ -135,14 +139,6 @@ msgstr "" "あなたがリンクをクリックしてこのページに来たとき、ブラウザは大雑把に言って次" "のようなことをしたのである::" -#: ../../howto/sockets.rst:59 -msgid "" -"# create an INET, STREAMing socket\n" -"s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\n" -"# now connect to the web server on port 80 - the normal http port\n" -"s.connect((\"www.python.org\", 80))" -msgstr "" - #: ../../howto/sockets.rst:64 msgid "" "When the ``connect`` completes, the socket ``s`` can be used to send in a " @@ -162,16 +158,6 @@ msgid "" msgstr "" "ウェブサーバで起こる事柄はもう少し複雑だ。まず「サーバソケット」を作る::" -#: ../../howto/sockets.rst:73 -msgid "" -"# create an INET, STREAMing socket\n" -"serversocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\n" -"# bind the socket to a public host, and a well-known port\n" -"serversocket.bind((socket.gethostname(), 80))\n" -"# become a server socket\n" -"serversocket.listen(5)" -msgstr "" - #: ../../howto/sockets.rst:80 msgid "" "A couple things to notice: we used ``socket.gethostname()`` so that the " @@ -216,17 +202,6 @@ msgstr "" "よし、「サーバーソケット」ができて、80 番ポートで耳を澄ましているところまで来" "た。では、ウェブサーバのメインループに入ろう::" -#: ../../howto/sockets.rst:98 -msgid "" -"while True:\n" -" # accept connections from outside\n" -" (clientsocket, address) = serversocket.accept()\n" -" # now do something with the clientsocket\n" -" # in this case, we'll pretend this is a threaded server\n" -" ct = make_client_thread(clientsocket)\n" -" ct.start()" -msgstr "" - #: ../../howto/sockets.rst:106 msgid "" "There's actually 3 general ways in which this loop could work - dispatching " @@ -392,43 +367,6 @@ msgstr "" "毎回接続を終わらせるのはイヤだとして、最も単純な解決策は固定長メッセージだろ" "う::" -#: ../../howto/sockets.rst:183 -msgid "" -"class MySocket:\n" -" \"\"\"demonstration class only\n" -" - coded for clarity, not efficiency\n" -" \"\"\"\n" -"\n" -" def __init__(self, sock=None):\n" -" if sock is None:\n" -" self.sock = socket.socket(\n" -" socket.AF_INET, socket.SOCK_STREAM)\n" -" else:\n" -" self.sock = sock\n" -"\n" -" def connect(self, host, port):\n" -" self.sock.connect((host, port))\n" -"\n" -" def mysend(self, msg):\n" -" totalsent = 0\n" -" while totalsent < MSGLEN:\n" -" sent = self.sock.send(msg[totalsent:])\n" -" if sent == 0:\n" -" raise RuntimeError(\"socket connection broken\")\n" -" totalsent = totalsent + sent\n" -"\n" -" def myreceive(self):\n" -" chunks = []\n" -" bytes_recd = 0\n" -" while bytes_recd < MSGLEN:\n" -" chunk = self.sock.recv(min(MSGLEN - bytes_recd, 2048))\n" -" if chunk == b'':\n" -" raise RuntimeError(\"socket connection broken\")\n" -" chunks.append(chunk)\n" -" bytes_recd = bytes_recd + len(chunk)\n" -" return b''.join(chunks)" -msgstr "" - #: ../../howto/sockets.rst:217 msgid "" "The sending code here is usable for almost any messaging scheme - in Python " @@ -511,38 +449,42 @@ msgstr "バイナリデータ" msgid "" "It is perfectly possible to send binary data over a socket. The major " "problem is that not all machines use the same formats for binary data. For " -"example, `network byte order `_ is big-endian, with the most significant byte " -"first, so a 16 bit integer with the value ``1`` would be the two hex bytes " -"``00 01``. However, most common processors (x86/AMD64, ARM, RISC-V), are " -"little-endian, with the least significant byte first - that same ``1`` would " -"be ``01 00``." -msgstr "" - -#: ../../howto/sockets.rst:262 -msgid "" -"Socket libraries have calls for converting 16 and 32 bit integers - ``ntohl, " -"htonl, ntohs, htons`` where \"n\" means *network* and \"h\" means *host*, " -"\"s\" means *short* and \"l\" means *long*. Where network order is host " -"order, these do nothing, but where the machine is byte-reversed, these swap " -"the bytes around appropriately." -msgstr "" - -#: ../../howto/sockets.rst:268 -msgid "" -"In these days of 64-bit machines, the ASCII representation of binary data is " +"example, a Motorola chip will represent a 16 bit integer with the value 1 as " +"the two hex bytes 00 01. Intel and DEC, however, are byte-reversed - that " +"same 1 is 01 00. Socket libraries have calls for converting 16 and 32 bit " +"integers - ``ntohl, htonl, ntohs, htons`` where \"n\" means *network* and " +"\"h\" means *host*, \"s\" means *short* and \"l\" means *long*. Where " +"network order is host order, these do nothing, but where the machine is byte-" +"reversed, these swap the bytes around appropriately." +msgstr "" +"バイナリデータはまったく問題なくソケットに乗せられる。問題は、すべてのマシン" +"で同じ形式を使っているわけではないことにある。たとえば Motorola のチップなら " +"16 ビット整数の 1 という値をふたつの 16 進バイト列 00 01 で表現するが、Intel " +"や DEC は逆バイトだ - 同じ 1 が 01 00 になるのだ。ソケットライブラリは 16 " +"ビットや 32 ビット整数の変換用コールを持っている - ``ntohl, htonl, ntohs, " +"htons`` である。\"n\" は *network*\\ 、 \"h\" は *host* を意味する。 \"s\" " +"は *short* で \"l\" は *long* だ。これらのコールは、「ネットワーク並び = ホス" +"ト並び」なら何もしないが、マシンが逆バイトならそれに合わせてぐるっと交換して" +"くれる。" + +#: ../../howto/sockets.rst:264 +msgid "" +"In these days of 32 bit machines, the ascii representation of binary data is " "frequently smaller than the binary representation. That's because a " -"surprising amount of the time, most integers have the value 0, or maybe 1. " -"The string ``\"0\"`` would be two bytes, while a full 64-bit integer would " -"be 8. Of course, this doesn't fit well with fixed-length messages. " -"Decisions, decisions." +"surprising amount of the time, all those longs have the value 0, or maybe 1. " +"The string \"0\" would be two bytes, while binary is four. Of course, this " +"doesn't fit well with fixed-length messages. Decisions, decisions." msgstr "" +"この 32 ビット時代、バイナリデータは ASCII 表現のほうが小さくなることが多い。" +"というのも、long なのに値が 0 ばっかりでたまに 1 だとかいうことは驚くほど多い" +"からだ。文字列なら \"0\" は 2 バイトなのに、バイナリは 4 バイトも喰う。もちろ" +"んこれは固定長メッセージには合わないが。さあ、どうする、どうする。" -#: ../../howto/sockets.rst:277 +#: ../../howto/sockets.rst:272 msgid "Disconnecting" msgstr "切断" -#: ../../howto/sockets.rst:279 +#: ../../howto/sockets.rst:274 msgid "" "Strictly speaking, you're supposed to use ``shutdown`` on a socket before " "you ``close`` it. The ``shutdown`` is an advisory to the socket at the " @@ -561,7 +503,7 @@ msgstr "" "``shutdown(); close()`` と同じことになる。だから大抵はわざわざ ``shutdown`` " "しなくてもいい。" -#: ../../howto/sockets.rst:287 +#: ../../howto/sockets.rst:282 msgid "" "One way to use ``shutdown`` effectively is in an HTTP-like exchange. The " "client sends a request and then does a ``shutdown(1)``. This tells the " @@ -577,7 +519,7 @@ msgstr "" "返答を送る。その ``send`` が成功したなら、クライアントは実際にまだ受信してい" "たことになる。" -#: ../../howto/sockets.rst:294 +#: ../../howto/sockets.rst:289 msgid "" "Python takes the automatic shutdown a step further, and says that when a " "socket is garbage collected, it will automatically do a ``close`` if it's " @@ -592,11 +534,11 @@ msgstr "" "けだと思ってハングしてしまうかもしれない。 *お願いだから* 終わったらちゃんと " "``close`` してくれ。" -#: ../../howto/sockets.rst:302 +#: ../../howto/sockets.rst:297 msgid "When Sockets Die" msgstr "ソケットが死ぬと" -#: ../../howto/sockets.rst:304 +#: ../../howto/sockets.rst:299 msgid "" "Probably the worst thing about using blocking sockets is what happens when " "the other side comes down hard (without doing a ``close``). Your socket is " @@ -622,11 +564,11 @@ msgstr "" "ると、どうにかしてそのスレッドを殺したなら、プロセス全体がぐちゃぐちゃになっ" "てしまうだろうということだ。" -#: ../../howto/sockets.rst:318 +#: ../../howto/sockets.rst:313 msgid "Non-blocking Sockets" msgstr "ノンブロッキングソケット" -#: ../../howto/sockets.rst:320 +#: ../../howto/sockets.rst:315 msgid "" "If you've understood the preceding, you already know most of what you need " "to know about the mechanics of using sockets. You'll still use the same " @@ -637,7 +579,7 @@ msgstr "" "知っていることになる。これからも同じコールを、ほぼ同じように使っていくだけ、" "それだけだ。これをちゃんとやっていれば、そのアプリはだいたい完璧であろう。" -#: ../../howto/sockets.rst:325 +#: ../../howto/sockets.rst:320 msgid "" "In Python, you use ``socket.setblocking(False)`` to make it non-blocking. In " "C, it's more complex, (for one thing, you'll need to choose between the BSD " @@ -653,7 +595,7 @@ msgstr "" "れは、ソケットを作成した後、使用する前に行う。(実際、常識破りなら、切り替える" "ことができます。)" -#: ../../howto/sockets.rst:332 +#: ../../howto/sockets.rst:327 msgid "" "The major mechanical difference is that ``send``, ``recv``, ``connect`` and " "``accept`` can return without having done anything. You have (of course) a " @@ -668,11 +610,11 @@ msgstr "" "合いだ。信じないなら、いつかやってみるといい。アプリは肥大化し、バグが増え、" "CPU を喰い尽くすだろう。だからそんな愚かな解法は飛ばして、正解に進もう。" -#: ../../howto/sockets.rst:339 +#: ../../howto/sockets.rst:334 msgid "Use ``select``." msgstr "``select`` を使え。" -#: ../../howto/sockets.rst:341 +#: ../../howto/sockets.rst:336 msgid "" "In C, coding ``select`` is fairly complex. In Python, it's a piece of cake, " "but it's close enough to the C version that if you understand ``select`` in " @@ -682,17 +624,7 @@ msgstr "" "い。しかし Python で ``select`` を理解しておけば C でもほとんど問題なく書け" "る、という程度には似ている::" -#: ../../howto/sockets.rst:345 -msgid "" -"ready_to_read, ready_to_write, in_error = \\\n" -" select.select(\n" -" potential_readers,\n" -" potential_writers,\n" -" potential_errs,\n" -" timeout)" -msgstr "" - -#: ../../howto/sockets.rst:352 +#: ../../howto/sockets.rst:347 msgid "" "You pass ``select`` three lists: the first contains all sockets that you " "might want to try reading; the second all the sockets you might want to try " @@ -710,7 +642,7 @@ msgstr "" "は、やっておいて損はない - 特に理由がなければ、かなり長い (たとえば 1 分とか" "の) 時間制限を付けておくことだ。" -#: ../../howto/sockets.rst:360 +#: ../../howto/sockets.rst:355 msgid "" "In return, you will get three lists. They contain the sockets that are " "actually readable, writable and in error. Each of these lists is a subset " @@ -720,7 +652,7 @@ msgstr "" "けるソケット、エラー中のソケットが入っていて、渡したリストの部分集合 (空集合" "かもしれない) になっている。" -#: ../../howto/sockets.rst:364 +#: ../../howto/sockets.rst:359 msgid "" "If a socket is in the output readable list, you can be as-close-to-certain-" "as-we-ever-get-in-this-business that a ``recv`` on that socket will return " @@ -736,7 +668,7 @@ msgstr "" "で返ってくることができる - それは外向きネットワークバッファに空きがあるという" "だけの意味しかないのだから)" -#: ../../howto/sockets.rst:371 +#: ../../howto/sockets.rst:366 msgid "" "If you have a \"server\" socket, put it in the potential_readers list. If it " "comes out in the readable list, your ``accept`` will (almost certainly) " @@ -750,7 +682,7 @@ msgstr "" "れる。それが writable リストに現れたら、接続が成功している可能性は高いと言え" "る。" -#: ../../howto/sockets.rst:377 +#: ../../howto/sockets.rst:372 msgid "" "Actually, ``select`` can be handy even with blocking sockets. It's one way " "of determining whether you will block - the socket returns as readable when " @@ -763,7 +695,7 @@ msgstr "" "返ってくるのだ。しかしこれも、相手の用事がもう済んでいるのか、それとも単に他" "のことで忙しいだけなのかを見極める役には立たない。" -#: ../../howto/sockets.rst:382 +#: ../../howto/sockets.rst:377 msgid "" "**Portability alert**: On Unix, ``select`` works both with the sockets and " "files. Don't try this on Windows. On Windows, ``select`` works with sockets " diff --git a/howto/sorting.po b/howto/sorting.po index e0330415c..bd8fcf382 100644 --- a/howto/sorting.po +++ b/howto/sorting.po @@ -1,34 +1,37 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: +# Inada Naoki , 2017 +# 秘湯 , 2017 +# mnamihdk, 2017 +# Osamu NAKAMURA, 2017 +# Arihiro TAKASE, 2017 +# Nozomu Kaneko , 2017 +# tomo, 2019 # Shin Saito, 2021 -# tomo, 2022 -# Takanori Suzuki , 2023 -# souma987, 2023 -# Arihiro TAKASE, 2024 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:53+0000\n" -"Last-Translator: Arihiro TAKASE, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 17:46+0000\n" +"Last-Translator: Shin Saito, 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../howto/sorting.rst:4 -msgid "Sorting Techniques" -msgstr "ソートのテクニック" +msgid "Sorting HOW TO" +msgstr "ソート HOW TO" #: ../../howto/sorting.rst:0 msgid "Author" @@ -38,7 +41,15 @@ msgstr "著者" msgid "Andrew Dalke and Raymond Hettinger" msgstr "Andrew Dalke and Raymond Hettinger" -#: ../../howto/sorting.rst:9 +#: ../../howto/sorting.rst:0 +msgid "Release" +msgstr "リリース" + +#: ../../howto/sorting.rst:7 +msgid "0.1" +msgstr "0.1" + +#: ../../howto/sorting.rst:10 msgid "" "Python lists have a built-in :meth:`list.sort` method that modifies the list " "in-place. There is also a :func:`sorted` built-in function that builds a " @@ -48,32 +59,26 @@ msgstr "" "`list.sort` があります。他にもイテラブルからソートしたリストを作成する組み込" "み関数 :func:`sorted` があります。" -#: ../../howto/sorting.rst:13 +#: ../../howto/sorting.rst:14 msgid "" "In this document, we explore the various techniques for sorting data using " "Python." msgstr "" "このドキュメントでは Python を使った様々なソートのテクニックを探索します。" -#: ../../howto/sorting.rst:17 +#: ../../howto/sorting.rst:18 msgid "Sorting Basics" msgstr "ソートの基本" -#: ../../howto/sorting.rst:19 +#: ../../howto/sorting.rst:20 msgid "" "A simple ascending sort is very easy: just call the :func:`sorted` function. " -"It returns a new sorted list:" +"It returns a new sorted list::" msgstr "" "単純な昇順のソートはとても簡単です: :func:`sorted` 関数を呼ぶだけです。そうす" "れば、新たにソートされたリストが返されます::" -#: ../../howto/sorting.rst:22 -msgid "" -">>> sorted([5, 2, 3, 1, 4])\n" -"[1, 2, 3, 4, 5]" -msgstr "" - -#: ../../howto/sorting.rst:27 +#: ../../howto/sorting.rst:26 msgid "" "You can also use the :meth:`list.sort` method. It modifies the list in-place " "(and returns ``None`` to avoid confusion). Usually it's less convenient " @@ -85,15 +90,7 @@ msgstr "" "します)。多くの場合、こちらの方法は :func:`sorted` と比べると不便です - ただ" "し、元々のリストが不要な場合には、わずかですがより効率的です。" -#: ../../howto/sorting.rst:32 -msgid "" -">>> a = [5, 2, 3, 1, 4]\n" -">>> a.sort()\n" -">>> a\n" -"[1, 2, 3, 4, 5]" -msgstr "" - -#: ../../howto/sorting.rst:39 +#: ../../howto/sorting.rst:36 msgid "" "Another difference is that the :meth:`list.sort` method is only defined for " "lists. In contrast, the :func:`sorted` function accepts any iterable." @@ -101,37 +98,25 @@ msgstr "" "違いは他にもあります、 :meth:`list.sort` メソッドはリストにのみ定義されていま" "す。一方 :func:`sorted` 関数は任意のイテラブルを受け付けます。" -#: ../../howto/sorting.rst:42 -msgid "" -">>> sorted({1: 'D', 2: 'B', 3: 'B', 4: 'E', 5: 'A'})\n" -"[1, 2, 3, 4, 5]" -msgstr "" - -#: ../../howto/sorting.rst:48 +#: ../../howto/sorting.rst:43 msgid "Key Functions" msgstr "Key 関数" -#: ../../howto/sorting.rst:50 +#: ../../howto/sorting.rst:45 msgid "" -"The :meth:`list.sort` method and the functions :func:`sorted`, :func:`min`, :" -"func:`max`, :func:`heapq.nsmallest`, and :func:`heapq.nlargest` have a *key* " -"parameter to specify a function (or other callable) to be called on each " -"list element prior to making comparisons." +"Both :meth:`list.sort` and :func:`sorted` have a *key* parameter to specify " +"a function (or other callable) to be called on each list element prior to " +"making comparisons." msgstr "" +":meth:`list.sort` と :func:`sorted` には *key* パラメータがあります。 これは" +"比較を行う前にリストの各要素に対して呼び出される関数 (または呼び出し可能オブ" +"ジェクト) を指定するパラメータです。" -#: ../../howto/sorting.rst:56 -msgid "" -"For example, here's a case-insensitive string comparison using :meth:`str." -"casefold`:" -msgstr "" +#: ../../howto/sorting.rst:49 +msgid "For example, here's a case-insensitive string comparison:" +msgstr "例えば、大文字小文字を区別しない文字列比較の例:" -#: ../../howto/sorting.rst:59 -msgid "" -">>> sorted(\"This is a test string from Andrew\".split(), key=str.casefold)\n" -"['a', 'Andrew', 'from', 'is', 'string', 'test', 'This']" -msgstr "" - -#: ../../howto/sorting.rst:64 +#: ../../howto/sorting.rst:54 msgid "" "The value of the *key* parameter should be a function (or other callable) " "that takes a single argument and returns a key to use for sorting purposes. " @@ -143,7 +128,7 @@ msgstr "" "りソートを高速に行えます、キー関数は各入力レコードに対してきっちり一回だけ呼" "び出されるからです。" -#: ../../howto/sorting.rst:69 +#: ../../howto/sorting.rst:59 msgid "" "A common pattern is to sort complex objects using some of the object's " "indices as keys. For example:" @@ -151,86 +136,34 @@ msgstr "" "よくある利用パターンはいくつかの要素から成る対象をインデクスのどれかをキーと" "してソートすることです。例えば:" -#: ../../howto/sorting.rst:72 -msgid "" -">>> student_tuples = [\n" -"... ('john', 'A', 15),\n" -"... ('jane', 'B', 12),\n" -"... ('dave', 'B', 10),\n" -"... ]\n" -">>> sorted(student_tuples, key=lambda student: student[2]) # sort by age\n" -"[('dave', 'B', 10), ('jane', 'B', 12), ('john', 'A', 15)]" -msgstr "" - -#: ../../howto/sorting.rst:82 +#: ../../howto/sorting.rst:70 msgid "" "The same technique works for objects with named attributes. For example:" msgstr "" "同じテクニックは名前づけされた属性 (named attributes) を使うことでオブジェク" "トに対しても動作します。例えば:" -#: ../../howto/sorting.rst:84 -msgid "" -">>> class Student:\n" -"... def __init__(self, name, grade, age):\n" -"... self.name = name\n" -"... self.grade = grade\n" -"... self.age = age\n" -"... def __repr__(self):\n" -"... return repr((self.name, self.grade, self.age))\n" -"\n" -">>> student_objects = [\n" -"... Student('john', 'A', 15),\n" -"... Student('jane', 'B', 12),\n" -"... Student('dave', 'B', 10),\n" -"... ]\n" -">>> sorted(student_objects, key=lambda student: student.age) # sort by " -"age\n" -"[('dave', 'B', 10), ('jane', 'B', 12), ('john', 'A', 15)]" -msgstr "" - -#: ../../howto/sorting.rst:102 -msgid "" -"Objects with named attributes can be made by a regular class as shown above, " -"or they can be instances of :class:`~dataclasses.dataclass` or a :term:" -"`named tuple`." -msgstr "" -"名前づけされた属性を持つオブジェクトは上で示したとおり通常のクラスから作れま" -"すし、:class:`~dataclasses.dataclass` や :term:`named tuple` のインスタンスで" -"もよいです。" - -#: ../../howto/sorting.rst:107 -msgid "Operator Module Functions and Partial Function Evaluation" -msgstr "operator モジュールの関数や partial 関数による評価" - -#: ../../howto/sorting.rst:109 -msgid "" -"The :term:`key function` patterns shown above are very common, so Python " -"provides convenience functions to make accessor functions easier and faster. " -"The :mod:`operator` module has :func:`~operator.itemgetter`, :func:" -"`~operator.attrgetter`, and a :func:`~operator.methodcaller` function." -msgstr "" -"上で示した :term:`key function` パターンは非常に一般的なので、Python はアクセ" -"サ関数を簡単に速く作れる便利な関数を提供しています。:mod:`operator` モジュー" -"ルに :func:`~operator.itemgetter`、:func:`~operator.attrgetter`、および :" -"func:`~operator.methodcaller` 関数があります。" - -#: ../../howto/sorting.rst:114 -msgid "Using those functions, the above examples become simpler and faster:" -msgstr "これらの関数を利用すると、上の例はもっと簡単で高速になります:" +#: ../../howto/sorting.rst:89 +msgid "Operator Module Functions" +msgstr "operator モジュール関数" -#: ../../howto/sorting.rst:116 +#: ../../howto/sorting.rst:91 msgid "" -">>> from operator import itemgetter, attrgetter\n" -"\n" -">>> sorted(student_tuples, key=itemgetter(2))\n" -"[('dave', 'B', 10), ('jane', 'B', 12), ('john', 'A', 15)]\n" -"\n" -">>> sorted(student_objects, key=attrgetter('age'))\n" -"[('dave', 'B', 10), ('jane', 'B', 12), ('john', 'A', 15)]" +"The key-function patterns shown above are very common, so Python provides " +"convenience functions to make accessor functions easier and faster. The :mod:" +"`operator` module has :func:`~operator.itemgetter`, :func:`~operator." +"attrgetter`, and a :func:`~operator.methodcaller` function." msgstr "" +"上述した key 関数のパターンはとても一般的です、 そのため、Python は高速で扱い" +"やすいアクセサ関数を提供しています。 :mod:`operator` モジュールには :func:" +"`~operator.itemgetter`, :func:`~operator.attrgetter` そして :func:`~operator." +"methodcaller` 関数があります。" -#: ../../howto/sorting.rst:126 +#: ../../howto/sorting.rst:96 +msgid "Using those functions, the above examples become simpler and faster:" +msgstr "これらの関数を利用すると、上の例はもっと簡単で高速になります:" + +#: ../../howto/sorting.rst:106 msgid "" "The operator module functions allow multiple levels of sorting. For example, " "to sort by *grade* then by *age*:" @@ -238,45 +171,11 @@ msgstr "" "operator モジュールの関数は複数の段階でのソートを可能にします。例えば、 " "*grade* でソートしてさらに *age* でソートする場合:" -#: ../../howto/sorting.rst:129 -msgid "" -">>> sorted(student_tuples, key=itemgetter(1,2))\n" -"[('john', 'A', 15), ('dave', 'B', 10), ('jane', 'B', 12)]\n" -"\n" -">>> sorted(student_objects, key=attrgetter('grade', 'age'))\n" -"[('john', 'A', 15), ('dave', 'B', 10), ('jane', 'B', 12)]" -msgstr "" - -#: ../../howto/sorting.rst:137 -msgid "" -"The :mod:`functools` module provides another helpful tool for making key-" -"functions. The :func:`~functools.partial` function can reduce the `arity " -"`_ of a multi-argument function making " -"it suitable for use as a key-function." -msgstr "" -":mod:`functools` モジュールには他にもキー関数を作るための便利なツールがありま" -"す。:func:`~functools.partial` 関数は複数引数の関数の `アリティ `_ を減らし、キー関数に適したものにできます。" - -#: ../../howto/sorting.rst:142 -msgid "" -">>> from functools import partial\n" -">>> from unicodedata import normalize\n" -"\n" -">>> names = 'Zoë Åbjørn Núñez Élana Zeke Abe Nubia Eloise'.split()\n" -"\n" -">>> sorted(names, key=partial(normalize, 'NFD'))\n" -"['Abe', 'Åbjørn', 'Eloise', 'Élana', 'Nubia', 'Núñez', 'Zeke', 'Zoë']\n" -"\n" -">>> sorted(names, key=partial(normalize, 'NFC'))\n" -"['Abe', 'Eloise', 'Nubia', 'Núñez', 'Zeke', 'Zoë', 'Åbjørn', 'Élana']" -msgstr "" - -#: ../../howto/sorting.rst:156 +#: ../../howto/sorting.rst:116 msgid "Ascending and Descending" msgstr "昇順と降順" -#: ../../howto/sorting.rst:158 +#: ../../howto/sorting.rst:118 msgid "" "Both :meth:`list.sort` and :func:`sorted` accept a *reverse* parameter with " "a boolean value. This is used to flag descending sorts. For example, to get " @@ -286,20 +185,11 @@ msgstr "" "として受け付けます。このパラメータは降順ソートを行うかどうかの フラグとして利" "用されます。 例えば、学生のデータを *age* の逆順で得たい場合:" -#: ../../howto/sorting.rst:162 -msgid "" -">>> sorted(student_tuples, key=itemgetter(2), reverse=True)\n" -"[('john', 'A', 15), ('jane', 'B', 12), ('dave', 'B', 10)]\n" -"\n" -">>> sorted(student_objects, key=attrgetter('age'), reverse=True)\n" -"[('john', 'A', 15), ('jane', 'B', 12), ('dave', 'B', 10)]" -msgstr "" - -#: ../../howto/sorting.rst:171 +#: ../../howto/sorting.rst:129 msgid "Sort Stability and Complex Sorts" msgstr "ソートの安定性と複合的なソート" -#: ../../howto/sorting.rst:173 +#: ../../howto/sorting.rst:131 msgid "" "Sorts are guaranteed to be `stable `_\\. That means that when multiple records have " @@ -309,22 +199,15 @@ msgstr "" "Sorting_algorithm#Stability>`_ であることが保証されています。これはレコードの" "中に同じキーがある場合、元々の順序が維持されるということを意味します。" -#: ../../howto/sorting.rst:177 -msgid "" -">>> data = [('red', 1), ('blue', 1), ('red', 2), ('blue', 2)]\n" -">>> sorted(data, key=itemgetter(0))\n" -"[('blue', 1), ('blue', 2), ('red', 1), ('red', 2)]" -msgstr "" - -#: ../../howto/sorting.rst:183 +#: ../../howto/sorting.rst:139 msgid "" "Notice how the two records for *blue* retain their original order so that " "``('blue', 1)`` is guaranteed to precede ``('blue', 2)``." msgstr "" "二つの *blue* のレコードが元々の順序を維持して、 ``('blue', 1)`` が " -"``('blue', 2)`` の前にあることに注意してください。" +"``('blue', 2)`` の前にあること注意してください。" -#: ../../howto/sorting.rst:186 +#: ../../howto/sorting.rst:142 msgid "" "This wonderful property lets you build complex sorts in a series of sorting " "steps. For example, to sort the student data by descending *grade* and then " @@ -334,16 +217,7 @@ msgstr "" "えば、学生データを *grade* の降順にソートし、さらに *age* の昇順にソートした" "い場合には、まず *age* でソートし、次に *grade* でもう一度ソートします:" -#: ../../howto/sorting.rst:190 -msgid "" -">>> s = sorted(student_objects, key=attrgetter('age')) # sort on " -"secondary key\n" -">>> sorted(s, key=attrgetter('grade'), reverse=True) # now sort on " -"primary key, descending\n" -"[('dave', 'B', 10), ('jane', 'B', 12), ('john', 'A', 15)]" -msgstr "" - -#: ../../howto/sorting.rst:196 +#: ../../howto/sorting.rst:150 msgid "" "This can be abstracted out into a wrapper function that can take a list and " "tuples of field and order to sort them on multiple passes." @@ -351,18 +225,7 @@ msgstr "" "この処理は、リストおよびフィールド名とソート順序のタプルを複数受け取れるラッ" "パー関数へ抽象化できます。" -#: ../../howto/sorting.rst:199 -msgid "" -">>> def multisort(xs, specs):\n" -"... for key, reverse in reversed(specs):\n" -"... xs.sort(key=attrgetter(key), reverse=reverse)\n" -"... return xs\n" -"\n" -">>> multisort(list(student_objects), (('grade', True), ('age', False)))\n" -"[('dave', 'B', 10), ('jane', 'B', 12), ('john', 'A', 15)]" -msgstr "" - -#: ../../howto/sorting.rst:209 +#: ../../howto/sorting.rst:161 msgid "" "The `Timsort `_ algorithm used in " "Python does multiple sorts efficiently because it can take advantage of any " @@ -372,28 +235,28 @@ msgstr "" "利用されていて、効率良く複数のソートを行うことができます、これは現在のデータ" "セット中のあらゆる順序をそのまま利用できるからです。" -#: ../../howto/sorting.rst:214 -msgid "Decorate-Sort-Undecorate" -msgstr "デコレート - ソート - アンデコレート (DSU)" +#: ../../howto/sorting.rst:166 +msgid "The Old Way Using Decorate-Sort-Undecorate" +msgstr "デコレート-ソート-アンデコレートを利用した古いやり方" -#: ../../howto/sorting.rst:216 +#: ../../howto/sorting.rst:168 msgid "This idiom is called Decorate-Sort-Undecorate after its three steps:" msgstr "" "このイディオムは以下の3つのステップにちなんでデコレート-ソート-アンデコレー" "ト (Decorate-Sort-Undecorate) と呼ばれています:" -#: ../../howto/sorting.rst:218 +#: ../../howto/sorting.rst:170 msgid "" "First, the initial list is decorated with new values that control the sort " "order." msgstr "" "まず、元となるリストをソートしたい順序を制御する新しい値でデコレートします。" -#: ../../howto/sorting.rst:220 +#: ../../howto/sorting.rst:172 msgid "Second, the decorated list is sorted." msgstr "次に、デコレートしたリストをソートします。" -#: ../../howto/sorting.rst:222 +#: ../../howto/sorting.rst:174 msgid "" "Finally, the decorations are removed, creating a list that contains only the " "initial values in the new order." @@ -401,21 +264,12 @@ msgstr "" "最後に、デコレートを取り除き、新しい順序で元々の値のみを持つリストを作りま" "す。" -#: ../../howto/sorting.rst:225 +#: ../../howto/sorting.rst:177 msgid "" "For example, to sort the student data by *grade* using the DSU approach:" msgstr "例えば、DSU アプローチを利用して学生データを *grade* でソートする場合:" -#: ../../howto/sorting.rst:227 -msgid "" -">>> decorated = [(student.grade, i, student) for i, student in " -"enumerate(student_objects)]\n" -">>> decorated.sort()\n" -">>> [student for grade, i, student in decorated] # undecorate\n" -"[('john', 'A', 15), ('jane', 'B', 12), ('dave', 'B', 10)]" -msgstr "" - -#: ../../howto/sorting.rst:234 +#: ../../howto/sorting.rst:184 msgid "" "This idiom works because tuples are compared lexicographically; the first " "items are compared; if they are the same then the second items are compared, " @@ -424,7 +278,7 @@ msgstr "" "このイディオムはタブルが辞書編集的に比較されるため正しく動作します; 最初の要" "素が比較され、同じ場合には第二の要素が比較され、以下も同様に動きます。" -#: ../../howto/sorting.rst:238 +#: ../../howto/sorting.rst:188 msgid "" "It is not strictly necessary in all cases to include the index *i* in the " "decorated list, but including it gives two benefits:" @@ -432,7 +286,7 @@ msgstr "" "デコレートしたリストのインデクス *i* は全ての場合で含まれる必要はありません" "が、そうすることで二つの利点があります:" -#: ../../howto/sorting.rst:241 +#: ../../howto/sorting.rst:191 msgid "" "The sort is stable -- if two items have the same key, their order will be " "preserved in the sorted list." @@ -440,7 +294,7 @@ msgstr "" "ソートが安定になります -- もし二つの要素が同じキーを持つ場合、それらの順序が" "ソートされたリストでも維持されます。" -#: ../../howto/sorting.rst:244 +#: ../../howto/sorting.rst:194 msgid "" "The original items do not have to be comparable because the ordering of the " "decorated tuples will be determined by at most the first two items. So for " @@ -451,7 +305,7 @@ msgstr "" "ルの順序は多くの場合、最初の二つの要素で決定されるからです。例として元のリス" "トは直接比較できない複素数を含むことができます。" -#: ../../howto/sorting.rst:249 +#: ../../howto/sorting.rst:199 msgid "" "Another name for this idiom is `Schwartzian transform `_\\, after Randal L. Schwartz, who " @@ -461,7 +315,7 @@ msgstr "" "Schwartzian_transform>`_ があります。これは Perl プログラマの間で有名な " "Randal L. Schwartz にちなんでいます。" -#: ../../howto/sorting.rst:253 +#: ../../howto/sorting.rst:203 msgid "" "Now that Python sorting provides key-functions, this technique is not often " "needed." @@ -469,168 +323,83 @@ msgstr "" "いまや Python のソートは key 関数による方法を提供しているので、このテクニック" "は不要でしょう。" -#: ../../howto/sorting.rst:256 -msgid "Comparison Functions" -msgstr "比較関数" - -#: ../../howto/sorting.rst:258 -msgid "" -"Unlike key functions that return an absolute value for sorting, a comparison " -"function computes the relative ordering for two inputs." -msgstr "" -"ソートのための絶対的な値を返すキー関数と違って、2つの入力を受け取り、その相対" -"的な順序を計算するような関数を比較関数といいます。" - -#: ../../howto/sorting.rst:261 -msgid "" -"For example, a `balance scale `_ compares two samples giving a " -"relative ordering: lighter, equal, or heavier. Likewise, a comparison " -"function such as ``cmp(a, b)`` will return a negative value for less-than, " -"zero if the inputs are equal, or a positive value for greater-than." -msgstr "" -"例えば、 `天秤 `_ は2つのサンプルを比較し、より軽いか、同じか、より" -"重いかの相対的な順序を与えます。同じように、 ``cmp(a, b)`` などの比較関数はよ" -"り小さいときは負の値を、入力が等しい場合は 0 を、より大きい場合は正の値を返し" -"ます。" - -#: ../../howto/sorting.rst:268 -msgid "" -"It is common to encounter comparison functions when translating algorithms " -"from other languages. Also, some libraries provide comparison functions as " -"part of their API. For example, :func:`locale.strcoll` is a comparison " -"function." -msgstr "" -"他のプログラミング言語で書かれたアルゴリズムを Python に書き直すときに比較関" -"数を目にすることがよくあります。また、その API の一部として比較関数を提供して" -"いるライブラリもあります。例えば、 :func:`locale.strcoll` は比較関数です。" - -#: ../../howto/sorting.rst:272 -msgid "" -"To accommodate those situations, Python provides :class:`functools." -"cmp_to_key` to wrap the comparison function to make it usable as a key " -"function::" -msgstr "" -"このような場合に対処するため、Python は比較関数をラップしてキー関数として使え" -"るようにする関数 :class:`functools.cmp_to_key` を提供しています。" - -#: ../../howto/sorting.rst:276 -msgid "sorted(words, key=cmp_to_key(strcoll)) # locale-aware sort order" -msgstr "" - -#: ../../howto/sorting.rst:279 -msgid "Strategies For Unorderable Types and Values" -msgstr "" +#: ../../howto/sorting.rst:207 +msgid "The Old Way Using the *cmp* Parameter" +msgstr "*cmp* パラメータを利用した古い方法" -#: ../../howto/sorting.rst:281 -msgid "" -"A number of type and value issues can arise when sorting. Here are some " -"strategies that can help:" -msgstr "" - -#: ../../howto/sorting.rst:284 -msgid "Convert non-comparable input types to strings prior to sorting:" -msgstr "" - -#: ../../howto/sorting.rst:286 -msgid "" -">>> data = ['twelve', '11', 10]\n" -">>> sorted(map(str, data))\n" -"['10', '11', 'twelve']" -msgstr "" - -#: ../../howto/sorting.rst:292 -msgid "" -"This is needed because most cross-type comparisons raise a :exc:`TypeError`." -msgstr "" - -#: ../../howto/sorting.rst:295 -msgid "Remove special values prior to sorting:" -msgstr "" - -#: ../../howto/sorting.rst:297 +#: ../../howto/sorting.rst:209 msgid "" -">>> from math import isnan\n" -">>> from itertools import filterfalse\n" -">>> data = [3.3, float('nan'), 1.1, 2.2]\n" -">>> sorted(filterfalse(isnan, data))\n" -"[1.1, 2.2, 3.3]" +"Many constructs given in this HOWTO assume Python 2.4 or later. Before that, " +"there was no :func:`sorted` builtin and :meth:`list.sort` took no keyword " +"arguments. Instead, all of the Py2.x versions supported a *cmp* parameter to " +"handle user specified comparison functions." msgstr "" +"この HOWTO の内容の多くは Python 2.4 以降を仮定しています。それ以前では組み込" +"み関数 :func:`sorted` と :meth:`list.sort` はキーワード引数をとりませんでし" +"た。その代わりに Py2.x バージョンの全ては、ユーザが比較関数を指定するための " +"*cmp* パラメータをサポートしました。" -#: ../../howto/sorting.rst:305 +#: ../../howto/sorting.rst:214 msgid "" -"This is needed because the `IEEE-754 standard `_ specifies that, \"Every NaN shall compare unordered with " -"everything, including itself.\"" -msgstr "" - -#: ../../howto/sorting.rst:309 -msgid "Likewise, ``None`` can be stripped from datasets as well:" +"In Py3.0, the *cmp* parameter was removed entirely (as part of a larger " +"effort to simplify and unify the language, eliminating the conflict between " +"rich comparisons and the :meth:`__cmp__` magic method)." msgstr "" +"Py3.0 では *cmp* パラメータは完全に削除されました (ぜいたくな比較と :meth:" +"`__cmp__` マジックメソッドの衝突を除き、言語を単純化しまとめるための多大な労" +"力の一環として)。" -#: ../../howto/sorting.rst:311 +#: ../../howto/sorting.rst:218 msgid "" -">>> data = [3.3, None, 1.1, 2.2]\n" -">>> sorted(x for x in data if x is not None)\n" -"[1.1, 2.2, 3.3]" -msgstr "" - -#: ../../howto/sorting.rst:317 -msgid "This is needed because ``None`` is not comparable to other types." +"In Py2.x, sort allowed an optional function which can be called for doing " +"the comparisons. That function should take two arguments to be compared and " +"then return a negative value for less-than, return zero if they are equal, " +"or return a positive value for greater-than. For example, we can do:" msgstr "" +"Py2.x ではソートにオプションとして比較に利用できる関数を与えることができま" +"す。関数は比較される二つの引数をとり、小さい場合には負の値を、等しい場合には " +"0 を、大きい場合には正の値を返さなければいけません。例えば、以下のようにでき" +"ます:" -#: ../../howto/sorting.rst:319 -msgid "Convert mapping types into sorted item lists before sorting:" -msgstr "" +#: ../../howto/sorting.rst:228 +msgid "Or you can reverse the order of comparison with:" +msgstr "また、比較順を逆にすることもできます:" -#: ../../howto/sorting.rst:321 +#: ../../howto/sorting.rst:235 msgid "" -">>> data = [{'a': 1}, {'b': 2}]\n" -">>> sorted(data, key=lambda d: sorted(d.items()))\n" -"[{'a': 1}, {'b': 2}]" +"When porting code from Python 2.x to 3.x, the situation can arise when you " +"have the user supplying a comparison function and you need to convert that " +"to a key function. The following wrapper makes that easy to do::" msgstr "" +"Python 2.x から 3.x にコードを移植する場合、比較関数を持っている場合には key " +"関数に比較しなければならないような状況に陥るかもしれません。以下のラッパーが" +"それを簡単にしてくれるでしょう::" -#: ../../howto/sorting.rst:327 -msgid "" -"This is needed because dict-to-dict comparisons raise a :exc:`TypeError`." -msgstr "" - -#: ../../howto/sorting.rst:330 -msgid "Convert set types into sorted lists before sorting:" -msgstr "" - -#: ../../howto/sorting.rst:332 -msgid "" -">>> data = [{'a', 'b', 'c'}, {'b', 'c', 'd'}]\n" -">>> sorted(map(sorted, data))\n" -"[['a', 'b', 'c'], ['b', 'c', 'd']]" -msgstr "" +#: ../../howto/sorting.rst:258 +msgid "To convert to a key function, just wrap the old comparison function:" +msgstr "key 関数を変換するには、古い比較関数をラップするだけです:" -#: ../../howto/sorting.rst:338 +#: ../../howto/sorting.rst:269 msgid "" -"This is needed because the elements contained in set types do not have a " -"deterministic order. For example, ``list({'a', 'b'})`` may produce either " -"``['a', 'b']`` or ``['b', 'a']``." +"In Python 3.2, the :func:`functools.cmp_to_key` function was added to the :" +"mod:`functools` module in the standard library." msgstr "" +"Python 3.2 には、標準ライブラリの :mod:`functools` モジュールに :func:" +"`functools.cmp_to_key` 関数が追加されました。" -#: ../../howto/sorting.rst:343 -msgid "Odds and Ends" -msgstr "残りのはしばし" +#: ../../howto/sorting.rst:273 +msgid "Odd and Ends" +msgstr "残りいくつかとまとめ" -#: ../../howto/sorting.rst:345 +#: ../../howto/sorting.rst:275 msgid "" "For locale aware sorting, use :func:`locale.strxfrm` for a key function or :" -"func:`locale.strcoll` for a comparison function. This is necessary because " -"\"alphabetical\" sort orderings can vary across cultures even if the " -"underlying alphabet is the same." +"func:`locale.strcoll` for a comparison function." msgstr "" -"ロケールに対応したソートを行うには、キー関数に :func:`locale.strxfrm` を使う" -"か、比較関数に :func:`locale.strcoll` を使ってください。これが必要なのは、同" -"じアルファベットを使っていたとしても、文化が違えば \"アルファベット順\" の意" -"味するものが変わることがあるからです。" +"ロケールに配慮したソートをするには、キー関数 :func:`locale.strxfrm` を利用す" +"るか、比較関数に :func:`locale.strcoll` を利用します。" -#: ../../howto/sorting.rst:350 +#: ../../howto/sorting.rst:278 msgid "" "The *reverse* parameter still maintains sort stability (so that records with " "equal keys retain the original order). Interestingly, that effect can be " @@ -641,49 +410,17 @@ msgstr "" "しい場合元々の順序が維持されます)。面白いことにこの影響はパラメータ無しで :" "func:`reversed` 関数を二回使うことで模倣することができます:" -#: ../../howto/sorting.rst:355 -msgid "" -">>> data = [('red', 1), ('blue', 1), ('red', 2), ('blue', 2)]\n" -">>> standard_way = sorted(data, key=itemgetter(0), reverse=True)\n" -">>> double_reversed = list(reversed(sorted(reversed(data), " -"key=itemgetter(0))))\n" -">>> assert standard_way == double_reversed\n" -">>> standard_way\n" -"[('red', 1), ('red', 2), ('blue', 1), ('blue', 2)]" -msgstr "" - -#: ../../howto/sorting.rst:364 -msgid "" -"The sort routines use ``<`` when making comparisons between two objects. So, " -"it is easy to add a standard sort order to a class by defining an :meth:" -"`~object.__lt__` method:" -msgstr "" -"ソート関数は、2つのオブジェクトを比較する際 ``<`` を用います。したがって、ク" -"ラスに標準のソート順序を追加することは :meth:`~object.__lt__` メソッドを定義" -"することで達成できます。" - -#: ../../howto/sorting.rst:368 -msgid "" -">>> Student.__lt__ = lambda self, other: self.age < other.age\n" -">>> sorted(student_objects)\n" -"[('dave', 'B', 10), ('jane', 'B', 12), ('john', 'A', 15)]" -msgstr "" - -#: ../../howto/sorting.rst:374 +#: ../../howto/sorting.rst:290 msgid "" -"However, note that ``<`` can fall back to using :meth:`~object.__gt__` if :" -"meth:`~object.__lt__` is not implemented (see :func:`object.__lt__` for " -"details on the mechanics). To avoid surprises, :pep:`8` recommends that all " -"six comparison methods be implemented. The :func:`~functools.total_ordering` " -"decorator is provided to make that task easier." +"The sort routines are guaranteed to use :meth:`__lt__` when making " +"comparisons between two objects. So, it is easy to add a standard sort order " +"to a class by defining an :meth:`__lt__` method::" msgstr "" -"ただし、``<`` は :meth:`~object.__lt__` が実装されていなければ :meth:" -"`~object.__gt__` を使って代替することに注意してください (この技法について詳し" -"くは :func:`object.__lt__` を参照してください)。驚きを防ぐため、:pep:`8` は6" -"つの比較メソッドを全て実装することを推奨しています。この作業を簡単にするた" -"め、:func:`~functools.total_ordering` デコレータが提供されています。" +"ソートルーチンは二つのオブジェクトを比較するのに :meth:`__lt__` を利用するこ" +"とを保証しています。そのため :meth:`__lt__` メソッドを定義することで、標準の" +"ソート順序を追加できます::" -#: ../../howto/sorting.rst:381 +#: ../../howto/sorting.rst:298 msgid "" "Key functions need not depend directly on the objects being sorted. A key " "function can also access external resources. For instance, if the student " @@ -693,58 +430,3 @@ msgstr "" "key 関数はソートするオブジェクトに依存する必要はありません。 key 関数は外部リ" "ソースにアクセスすることもできます。例えば学生の成績が辞書に保存されている場" "合、それを利用して別の学生の名前のリストをソートすることができます:" - -#: ../../howto/sorting.rst:386 -msgid "" -">>> students = ['dave', 'john', 'jane']\n" -">>> newgrades = {'john': 'F', 'jane':'A', 'dave': 'C'}\n" -">>> sorted(students, key=newgrades.__getitem__)\n" -"['jane', 'dave', 'john']" -msgstr "" - -#: ../../howto/sorting.rst:394 -msgid "Partial Sorts" -msgstr "部分的なソート" - -#: ../../howto/sorting.rst:396 -msgid "" -"Some applications require only some of the data to be ordered. The standard " -"library provides several tools that do less work than a full sort:" -msgstr "" -"アプリケーションには、データの一部のみが整列されていればよいものがあります。" -"標準ライブラリは完全なソートより少ない作業をするいくつかのツールを提供しま" -"す。" - -#: ../../howto/sorting.rst:399 -msgid "" -":func:`min` and :func:`max` return the smallest and largest values, " -"respectively. These functions make a single pass over the input data and " -"require almost no auxiliary memory." -msgstr "" -":func:`min` と :func:`max` はそれぞれ最小値と最大値を返します。これらの関数は" -"入力データを一度だけ通過し、補助的なメモリをほとんど要求しません。" - -#: ../../howto/sorting.rst:403 -msgid "" -":func:`heapq.nsmallest` and :func:`heapq.nlargest` return the *n* smallest " -"and largest values, respectively. These functions make a single pass over " -"the data keeping only *n* elements in memory at a time. For values of *n* " -"that are small relative to the number of inputs, these functions make far " -"fewer comparisons than a full sort." -msgstr "" -":func:`heapq.nsmallest` と :func:`heapq.nlargest` はそれぞれ最小と最大の値 " -"*n* 個を返します。これらの関数はデータを一度だけ通過し、一度に *n* 要素だけを" -"記憶します。入力の数に対して小さい *n* の値では、これらの関数は完全なソートよ" -"り比較の回数がはるかに少なくなります。" - -#: ../../howto/sorting.rst:409 -msgid "" -":func:`heapq.heappush` and :func:`heapq.heappop` create and maintain a " -"partially sorted arrangement of data that keeps the smallest element at " -"position ``0``. These functions are suitable for implementing priority " -"queues which are commonly used for task scheduling." -msgstr "" -":func:`heapq.heappush` と :func:`heapq.heappop` は最小の要素がつねに位置 " -"``0`` になる、部分的にソートされたデータの配列を作り維持します。これらの関数" -"はタスクスケジューリングに一般的に使われる優先度キューを実装するのに適してい" -"ます。" diff --git a/howto/timerfd.po b/howto/timerfd.po deleted file mode 100644 index 9e1a511fe..000000000 --- a/howto/timerfd.po +++ /dev/null @@ -1,290 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation -# This file is distributed under the same license as the Python package. -# FIRST AUTHOR , YEAR. -# -# Translators: -# tomo, 2024 -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: Python 3.14\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2024-05-11 01:08+0000\n" -"Last-Translator: tomo, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" -"ja/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#: ../../howto/timerfd.rst:5 -msgid "timer file descriptor HOWTO" -msgstr "" - -#: ../../howto/timerfd.rst:0 -msgid "Release" -msgstr "リリース" - -#: ../../howto/timerfd.rst:7 -msgid "1.13" -msgstr "" - -#: ../../howto/timerfd.rst:9 -msgid "" -"This HOWTO discusses Python's support for the linux timer file descriptor." -msgstr "" - -#: ../../howto/timerfd.rst:13 -msgid "Examples" -msgstr "使用例" - -#: ../../howto/timerfd.rst:15 -msgid "" -"The following example shows how to use a timer file descriptor to execute a " -"function twice a second:" -msgstr "" - -#: ../../howto/timerfd.rst:18 -msgid "" -"# Practical scripts should use really use a non-blocking timer,\n" -"# we use a blocking timer here for simplicity.\n" -"import os, time\n" -"\n" -"# Create the timer file descriptor\n" -"fd = os.timerfd_create(time.CLOCK_REALTIME)\n" -"\n" -"# Start the timer in 1 second, with an interval of half a second\n" -"os.timerfd_settime(fd, initial=1, interval=0.5)\n" -"\n" -"try:\n" -" # Process timer events four times.\n" -" for _ in range(4):\n" -" # read() will block until the timer expires\n" -" _ = os.read(fd, 8)\n" -" print(\"Timer expired\")\n" -"finally:\n" -" # Remember to close the timer file descriptor!\n" -" os.close(fd)" -msgstr "" - -#: ../../howto/timerfd.rst:40 -msgid "" -"To avoid the precision loss caused by the :class:`float` type, timer file " -"descriptors allow specifying initial expiration and interval in integer " -"nanoseconds with ``_ns`` variants of the functions." -msgstr "" - -#: ../../howto/timerfd.rst:44 -msgid "" -"This example shows how :func:`~select.epoll` can be used with timer file " -"descriptors to wait until the file descriptor is ready for reading:" -msgstr "" - -#: ../../howto/timerfd.rst:47 -msgid "" -"import os, time, select, socket, sys\n" -"\n" -"# Create an epoll object\n" -"ep = select.epoll()\n" -"\n" -"# In this example, use loopback address to send \"stop\" command to the " -"server.\n" -"#\n" -"# $ telnet 127.0.0.1 1234\n" -"# Trying 127.0.0.1...\n" -"# Connected to 127.0.0.1.\n" -"# Escape character is '^]'.\n" -"# stop\n" -"# Connection closed by foreign host.\n" -"#\n" -"sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\n" -"sock.bind((\"127.0.0.1\", 1234))\n" -"sock.setblocking(False)\n" -"sock.listen(1)\n" -"ep.register(sock, select.EPOLLIN)\n" -"\n" -"# Create timer file descriptors in non-blocking mode.\n" -"num = 3\n" -"fds = []\n" -"for _ in range(num):\n" -" fd = os.timerfd_create(time.CLOCK_REALTIME, flags=os.TFD_NONBLOCK)\n" -" fds.append(fd)\n" -" # Register the timer file descriptor for read events\n" -" ep.register(fd, select.EPOLLIN)\n" -"\n" -"# Start the timer with os.timerfd_settime_ns() in nanoseconds.\n" -"# Timer 1 fires every 0.25 seconds; timer 2 every 0.5 seconds; etc\n" -"for i, fd in enumerate(fds, start=1):\n" -" one_sec_in_nsec = 10**9\n" -" i = i * one_sec_in_nsec\n" -" os.timerfd_settime_ns(fd, initial=i//4, interval=i//4)\n" -"\n" -"timeout = 3\n" -"try:\n" -" conn = None\n" -" is_active = True\n" -" while is_active:\n" -" # Wait for the timer to expire for 3 seconds.\n" -" # epoll.poll() returns a list of (fd, event) pairs.\n" -" # fd is a file descriptor.\n" -" # sock and conn[=returned value of socket.accept()] are socket " -"objects, not file descriptors.\n" -" # So use sock.fileno() and conn.fileno() to get the file " -"descriptors.\n" -" events = ep.poll(timeout)\n" -"\n" -" # If more than one timer file descriptors are ready for reading at " -"once,\n" -" # epoll.poll() returns a list of (fd, event) pairs.\n" -" #\n" -" # In this example settings,\n" -" # 1st timer fires every 0.25 seconds in 0.25 seconds. (0.25, 0.5, " -"0.75, 1.0, ...)\n" -" # 2nd timer every 0.5 seconds in 0.5 seconds. (0.5, 1.0, 1.5, " -"2.0, ...)\n" -" # 3rd timer every 0.75 seconds in 0.75 seconds. (0.75, 1.5, 2.25, " -"3.0, ...)\n" -" #\n" -" # In 0.25 seconds, only 1st timer fires.\n" -" # In 0.5 seconds, 1st timer and 2nd timer fires at once.\n" -" # In 0.75 seconds, 1st timer and 3rd timer fires at once.\n" -" # In 1.5 seconds, 1st timer, 2nd timer and 3rd timer fires at " -"once.\n" -" #\n" -" # If a timer file descriptor is signaled more than once since\n" -" # the last os.read() call, os.read() returns the number of signaled\n" -" # as host order of class bytes.\n" -" print(f\"Signaled events={events}\")\n" -" for fd, event in events:\n" -" if event & select.EPOLLIN:\n" -" if fd == sock.fileno():\n" -" # Check if there is a connection request.\n" -" print(f\"Accepting connection {fd}\")\n" -" conn, addr = sock.accept()\n" -" conn.setblocking(False)\n" -" print(f\"Accepted connection {conn} from {addr}\")\n" -" ep.register(conn, select.EPOLLIN)\n" -" elif conn and fd == conn.fileno():\n" -" # Check if there is data to read.\n" -" print(f\"Reading data {fd}\")\n" -" data = conn.recv(1024)\n" -" if data:\n" -" # You should catch UnicodeDecodeError exception for " -"safety.\n" -" cmd = data.decode()\n" -" if cmd.startswith(\"stop\"):\n" -" print(f\"Stopping server\")\n" -" is_active = False\n" -" else:\n" -" print(f\"Unknown command: {cmd}\")\n" -" else:\n" -" # No more data, close connection\n" -" print(f\"Closing connection {fd}\")\n" -" ep.unregister(conn)\n" -" conn.close()\n" -" conn = None\n" -" elif fd in fds:\n" -" print(f\"Reading timer {fd}\")\n" -" count = int.from_bytes(os.read(fd, 8), byteorder=sys." -"byteorder)\n" -" print(f\"Timer {fds.index(fd) + 1} expired {count} " -"times\")\n" -" else:\n" -" print(f\"Unknown file descriptor {fd}\")\n" -"finally:\n" -" for fd in fds:\n" -" ep.unregister(fd)\n" -" os.close(fd)\n" -" ep.close()" -msgstr "" - -#: ../../howto/timerfd.rst:153 -msgid "" -"This example shows how :func:`~select.select` can be used with timer file " -"descriptors to wait until the file descriptor is ready for reading:" -msgstr "" - -#: ../../howto/timerfd.rst:156 -msgid "" -"import os, time, select, socket, sys\n" -"\n" -"# In this example, use loopback address to send \"stop\" command to the " -"server.\n" -"#\n" -"# $ telnet 127.0.0.1 1234\n" -"# Trying 127.0.0.1...\n" -"# Connected to 127.0.0.1.\n" -"# Escape character is '^]'.\n" -"# stop\n" -"# Connection closed by foreign host.\n" -"#\n" -"sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\n" -"sock.bind((\"127.0.0.1\", 1234))\n" -"sock.setblocking(False)\n" -"sock.listen(1)\n" -"\n" -"# Create timer file descriptors in non-blocking mode.\n" -"num = 3\n" -"fds = [os.timerfd_create(time.CLOCK_REALTIME, flags=os.TFD_NONBLOCK)\n" -" for _ in range(num)]\n" -"select_fds = fds + [sock]\n" -"\n" -"# Start the timers with os.timerfd_settime() in seconds.\n" -"# Timer 1 fires every 0.25 seconds; timer 2 every 0.5 seconds; etc\n" -"for i, fd in enumerate(fds, start=1):\n" -" os.timerfd_settime(fd, initial=i/4, interval=i/4)\n" -"\n" -"timeout = 3\n" -"try:\n" -" conn = None\n" -" is_active = True\n" -" while is_active:\n" -" # Wait for the timer to expire for 3 seconds.\n" -" # select.select() returns a list of file descriptors or objects.\n" -" rfd, wfd, xfd = select.select(select_fds, select_fds, select_fds, " -"timeout)\n" -" for fd in rfd:\n" -" if fd == sock:\n" -" # Check if there is a connection request.\n" -" print(f\"Accepting connection {fd}\")\n" -" conn, addr = sock.accept()\n" -" conn.setblocking(False)\n" -" print(f\"Accepted connection {conn} from {addr}\")\n" -" select_fds.append(conn)\n" -" elif conn and fd == conn:\n" -" # Check if there is data to read.\n" -" print(f\"Reading data {fd}\")\n" -" data = conn.recv(1024)\n" -" if data:\n" -" # You should catch UnicodeDecodeError exception for " -"safety.\n" -" cmd = data.decode()\n" -" if cmd.startswith(\"stop\"):\n" -" print(f\"Stopping server\")\n" -" is_active = False\n" -" else:\n" -" print(f\"Unknown command: {cmd}\")\n" -" else:\n" -" # No more data, close connection\n" -" print(f\"Closing connection {fd}\")\n" -" select_fds.remove(conn)\n" -" conn.close()\n" -" conn = None\n" -" elif fd in fds:\n" -" print(f\"Reading timer {fd}\")\n" -" count = int.from_bytes(os.read(fd, 8), byteorder=sys." -"byteorder)\n" -" print(f\"Timer {fds.index(fd) + 1} expired {count} times\")\n" -" else:\n" -" print(f\"Unknown file descriptor {fd}\")\n" -"finally:\n" -" for fd in fds:\n" -" os.close(fd)\n" -" sock.close()\n" -" sock = None" -msgstr "" diff --git a/howto/unicode.po b/howto/unicode.po index 2224b012a..a3d90b11e 100644 --- a/howto/unicode.po +++ b/howto/unicode.po @@ -1,27 +1,33 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 +# 秘湯 , 2017 +# ごはんですよ , 2017 +# Arihiro TAKASE, 2017 +# mnamihdk, 2017 +# Nozomu Kaneko , 2017 +# tomo, 2019 +# Inada Naoki , 2019 +# Yusuke Miyazaki , 2020 # Shin Saito, 2021 -# Takanori Suzuki , 2023 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-30 14:22+0000\n" -"PO-Revision-Date: 2021-06-28 00:53+0000\n" -"Last-Translator: Takanori Suzuki , 2023\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 17:46+0000\n" +"Last-Translator: Shin Saito, 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../howto/unicode.rst:5 @@ -120,25 +126,6 @@ msgstr "" "Unicode 標準は、文字とそれに対応するコードポイントを列挙した多くの表を含んで" "います:" -#: ../../howto/unicode.rst:53 -msgid "" -"0061 'a'; LATIN SMALL LETTER A\n" -"0062 'b'; LATIN SMALL LETTER B\n" -"0063 'c'; LATIN SMALL LETTER C\n" -"...\n" -"007B '{'; LEFT CURLY BRACKET\n" -"...\n" -"2167 'Ⅷ'; ROMAN NUMERAL EIGHT\n" -"2168 'Ⅸ'; ROMAN NUMERAL NINE\n" -"...\n" -"265E '♞'; BLACK CHESS KNIGHT\n" -"265F '♟'; BLACK CHESS PAWN\n" -"...\n" -"1F600 '😀'; GRINNING FACE\n" -"1F609 '😉'; WINKING FACE\n" -"..." -msgstr "" - #: ../../howto/unicode.rst:71 msgid "" "Strictly, these definitions imply that it's meaningless to say 'this is " @@ -196,13 +183,6 @@ msgid "" "representation, the string \"Python\" might look like this:" msgstr "" -#: ../../howto/unicode.rst:101 -msgid "" -" P y t h o n\n" -"0x50 00 00 00 79 00 00 00 74 00 00 00 68 00 00 00 6f 00 00 00 6e 00 00 00\n" -" 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23" -msgstr "" - #: ../../howto/unicode.rst:107 msgid "" "This representation is straightforward but using it presents a number of " @@ -346,11 +326,9 @@ msgstr "" #: ../../howto/unicode.rst:169 msgid "" "To help understand the standard, Jukka Korpela has written `an introductory " -"guide `_ to reading the Unicode " +"guide `_ to reading the Unicode " "character tables." msgstr "" -"標準を理解する助けにするために、Jukka Korpela が Unicode 文字表を読むための `" -"入門ガイド `_ を書いています。" #: ../../howto/unicode.rst:173 msgid "" @@ -403,28 +381,11 @@ msgstr "" "Python ソースコードのデフォルトエンコーディングは UTF-8 なので、文字列リテラ" "ルの中に Unicode 文字をそのまま含めることができます::" -#: ../../howto/unicode.rst:199 -msgid "" -"try:\n" -" with open('/tmp/input.txt', 'r') as f:\n" -" ...\n" -"except OSError:\n" -" # 'File not found' error message.\n" -" print(\"Fichier non trouvé\")" -msgstr "" - #: ../../howto/unicode.rst:206 msgid "" "Side note: Python 3 also supports using Unicode characters in identifiers::" msgstr "追記: Python3 は Unicode 文字を使った識別子もサポートしています::" -#: ../../howto/unicode.rst:208 -msgid "" -"répertoire = \"/tmp/records.log\"\n" -"with open(répertoire, \"w\") as f:\n" -" f.write(\"test\\n\")" -msgstr "" - #: ../../howto/unicode.rst:212 msgid "" "If you can't enter a particular character in your editor or want to keep the " @@ -437,16 +398,6 @@ msgstr "" "(使ってるシステムによっては、\\u でエスケープされた文字列ではなく、実物の大文" "字のラムダのグリフが見えるかもしれません。)::" -#: ../../howto/unicode.rst:217 -msgid "" -">>> \"\\N{GREEK CAPITAL LETTER DELTA}\" # Using the character name\n" -"'\\u0394'\n" -">>> \"\\u0394\" # Using a 16-bit hex value\n" -"'\\u0394'\n" -">>> \"\\U00000394\" # Using a 32-bit hex value\n" -"'\\u0394'" -msgstr "" - #: ../../howto/unicode.rst:224 msgid "" "In addition, one can create a string using the :func:`~bytes.decode` method " @@ -474,21 +425,6 @@ msgstr "" "く) 、``'backslashreplace'`` (エスケープシーケンス ``\\xNN`` を挿入する) で" "す。次の例はこれらの違いを示しています::" -#: ../../howto/unicode.rst:236 -msgid "" -">>> b'\\x80abc'.decode(\"utf-8\", \"strict\")\n" -"Traceback (most recent call last):\n" -" ...\n" -"UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 0:\n" -" invalid start byte\n" -">>> b'\\x80abc'.decode(\"utf-8\", \"replace\")\n" -"'\\ufffdabc'\n" -">>> b'\\x80abc'.decode(\"utf-8\", \"backslashreplace\")\n" -"'\\\\x80abc'\n" -">>> b'\\x80abc'.decode(\"utf-8\", \"ignore\")\n" -"'abc'" -msgstr "" - #: ../../howto/unicode.rst:248 msgid "" "Encodings are specified as strings containing the encoding's name. Python " @@ -516,14 +452,6 @@ msgstr "" "文字列を返します。逆の操作は :func:`ord` 組み込み関数です、この関数は一文字" "の Unicode 文字列を引数にとり、コードポイント値を返します::" -#: ../../howto/unicode.rst:260 -msgid "" -">>> chr(57344)\n" -"'\\ue000'\n" -">>> ord('\\ue000')\n" -"57344" -msgstr "" - #: ../../howto/unicode.rst:266 msgid "Converting to Bytes" msgstr "バイト列への変換" @@ -560,28 +488,6 @@ msgstr "" msgid "The following example shows the different results::" msgstr "次の例では、それぞれの異なる処理結果が示されています::" -#: ../../howto/unicode.rst:282 -msgid "" -">>> u = chr(40960) + 'abcd' + chr(1972)\n" -">>> u.encode('utf-8')\n" -"b'\\xea\\x80\\x80abcd\\xde\\xb4'\n" -">>> u.encode('ascii')\n" -"Traceback (most recent call last):\n" -" ...\n" -"UnicodeEncodeError: 'ascii' codec can't encode character '\\ua000' in\n" -" position 0: ordinal not in range(128)\n" -">>> u.encode('ascii', 'ignore')\n" -"b'abcd'\n" -">>> u.encode('ascii', 'replace')\n" -"b'?abcd?'\n" -">>> u.encode('ascii', 'xmlcharrefreplace')\n" -"b'ꀀabcd޴'\n" -">>> u.encode('ascii', 'backslashreplace')\n" -"b'\\\\ua000abcd\\\\u07b4'\n" -">>> u.encode('ascii', 'namereplace')\n" -"b'\\\\N{YI SYLLABLE IT}abcd\\\\u07b4'" -msgstr "" - #: ../../howto/unicode.rst:301 msgid "" "The low-level routines for registering and accessing the available encodings " @@ -613,16 +519,6 @@ msgstr "" "``\\u`` を使い、続けてコードポイントを4桁の16進数を書きます。エスケープシーケ" "ンス ``\\U`` も同様です、ただし4桁ではなく8桁の16進数を使います::" -#: ../../howto/unicode.rst:317 -msgid "" -">>> s = \"a\\xac\\u1234\\u20ac\\U00008000\"\n" -"... # ^^^^ two-digit hex escape\n" -"... # ^^^^^^ four-digit Unicode escape\n" -"... # ^^^^^^^^^^ eight-digit Unicode escape\n" -">>> [ord(c) for c in s]\n" -"[97, 172, 4660, 8364, 32768]" -msgstr "" - #: ../../howto/unicode.rst:324 msgid "" "Using escape sequences for code points greater than 127 is fine in small " @@ -660,15 +556,6 @@ msgstr "" "はソースファイルの一行目や二行目に特別なコメントを含めることによってできま" "す::" -#: ../../howto/unicode.rst:339 -msgid "" -"#!/usr/bin/env python\n" -"# -*- coding: latin-1 -*-\n" -"\n" -"u = 'abcdé'\n" -"print(ord(u[-1]))" -msgstr "" - #: ../../howto/unicode.rst:345 msgid "" "The syntax is inspired by Emacs's notation for specifying variables local to " @@ -714,34 +601,10 @@ msgstr "" "以下のプログラムはいくつかの文字に対する情報を表示し、特定の文字の数値を印字" "します::" -#: ../../howto/unicode.rst:369 -msgid "" -"import unicodedata\n" -"\n" -"u = chr(233) + chr(0x0bf2) + chr(3972) + chr(6000) + chr(13231)\n" -"\n" -"for i, c in enumerate(u):\n" -" print(i, '%04x' % ord(c), unicodedata.category(c), end=\" \")\n" -" print(unicodedata.name(c))\n" -"\n" -"# Get numeric value of second character\n" -"print(unicodedata.numeric(u[1]))" -msgstr "" - #: ../../howto/unicode.rst:380 msgid "When run, this prints:" msgstr "実行すると、このように出力されます::" -#: ../../howto/unicode.rst:382 -msgid "" -"0 00e9 Ll LATIN SMALL LETTER E WITH ACUTE\n" -"1 0bf2 No TAMIL NUMBER ONE THOUSAND\n" -"2 0f84 Mn TIBETAN MARK HALANTA\n" -"3 1770 Lo TAGBANWA LETTER SA\n" -"4 33af So SQUARE RAD OVER S SQUARED\n" -"1000.0" -msgstr "" - #: ../../howto/unicode.rst:391 msgid "" "The category codes are abbreviations describing the nature of the character. " @@ -786,53 +649,20 @@ msgid "" "which becomes the pair of lowercase letters 'ss'." msgstr "" -#: ../../howto/unicode.rst:421 -msgid "" -">>> street = 'Gürzenichstraße'\n" -">>> street.casefold()\n" -"'gürzenichstrasse'" -msgstr "" - #: ../../howto/unicode.rst:425 msgid "" "A second tool is the :mod:`unicodedata` module's :func:`~unicodedata." "normalize` function that converts strings to one of several normal forms, " "where letters followed by a combining character are replaced with single " -"characters. :func:`~unicodedata.normalize` can be used to perform string " -"comparisons that won't falsely report inequality if two strings use " -"combining characters differently:" -msgstr "" - -#: ../../howto/unicode.rst:434 -msgid "" -"import unicodedata\n" -"\n" -"def compare_strs(s1, s2):\n" -" def NFD(s):\n" -" return unicodedata.normalize('NFD', s)\n" -"\n" -" return NFD(s1) == NFD(s2)\n" -"\n" -"single_char = 'ê'\n" -"multiple_chars = '\\N{LATIN SMALL LETTER E}\\N{COMBINING CIRCUMFLEX " -"ACCENT}'\n" -"print('length of first string=', len(single_char))\n" -"print('length of second string=', len(multiple_chars))\n" -"print(compare_strs(single_char, multiple_chars))" +"characters. :func:`normalize` can be used to perform string comparisons " +"that won't falsely report inequality if two strings use combining characters " +"differently:" msgstr "" #: ../../howto/unicode.rst:448 msgid "When run, this outputs:" msgstr "実行すると、このように出力されます:" -#: ../../howto/unicode.rst:450 -msgid "" -"$ python compare-strs.py\n" -"length of first string= 1\n" -"length of second string= 2\n" -"True" -msgstr "" - #: ../../howto/unicode.rst:457 msgid "" "The first argument to the :func:`~unicodedata.normalize` function is a " @@ -844,30 +674,12 @@ msgstr "" msgid "The Unicode Standard also specifies how to do caseless comparisons::" msgstr "" -#: ../../howto/unicode.rst:463 -msgid "" -"import unicodedata\n" -"\n" -"def compare_caseless(s1, s2):\n" -" def NFD(s):\n" -" return unicodedata.normalize('NFD', s)\n" -"\n" -" return NFD(NFD(s1).casefold()) == NFD(NFD(s2).casefold())\n" -"\n" -"# Example usage\n" -"single_char = 'ê'\n" -"multiple_chars = '\\N{LATIN CAPITAL LETTER E}\\N{COMBINING CIRCUMFLEX " -"ACCENT}'\n" -"\n" -"print(compare_caseless(single_char, multiple_chars))" -msgstr "" - #: ../../howto/unicode.rst:477 msgid "" -"This will print ``True``. (Why is :func:`!NFD` invoked twice? Because " -"there are a few characters that make :meth:`~str.casefold` return a non-" -"normalized string, so the result needs to be normalized again. See section " -"3.13 of the Unicode Standard for a discussion and an example.)" +"This will print ``True``. (Why is :func:`NFD` invoked twice? Because there " +"are a few characters that make :meth:`casefold` return a non-normalized " +"string, so the result needs to be normalized again. See section 3.13 of the " +"Unicode Standard for a discussion and an example.)" msgstr "" #: ../../howto/unicode.rst:484 @@ -897,16 +709,6 @@ msgstr "" "この例にある文字列には、タイ語の数字とアラビア数字の両方で数字の 57 が書いて" "あります。" -#: ../../howto/unicode.rst:496 -msgid "" -"import re\n" -"p = re.compile(r'\\d+')\n" -"\n" -"s = \"Over \\u0e55\\u0e57 57 flavours\"\n" -"m = p.search(s)\n" -"print(repr(m.group()))" -msgstr "" - #: ../../howto/unicode.rst:503 msgid "" "When executed, ``\\d+`` will match the Thai numerals and print them out. If " @@ -934,10 +736,10 @@ msgstr "Python の Unicode サポートについての参考になる議論は #: ../../howto/unicode.rst:520 msgid "" -"`Processing Text Files in Python 3 `_, by Nick Coghlan." msgstr "" -"Nick Coghlan による `Processing Text Files in Python 3 `_" #: ../../howto/unicode.rst:521 @@ -1059,27 +861,12 @@ msgstr "" msgid "Reading Unicode from a file is therefore simple::" msgstr "そのためファイルから Unicode を読むのは単純です::" -#: ../../howto/unicode.rst:576 -msgid "" -"with open('unicode.txt', encoding='utf-8') as f:\n" -" for line in f:\n" -" print(repr(line))" -msgstr "" - #: ../../howto/unicode.rst:580 msgid "" "It's also possible to open files in update mode, allowing both reading and " "writing::" msgstr "読み書きの両方ができる update モードでファイルを開くことも可能です::" -#: ../../howto/unicode.rst:583 -msgid "" -"with open('test', encoding='utf-8', mode='w+') as f:\n" -" f.write('\\u4500 blah blah blah\\n')\n" -" f.seek(0)\n" -" print(repr(f.readline()[:1]))" -msgstr "" - #: ../../howto/unicode.rst:588 msgid "" "The Unicode character ``U+FEFF`` is used as a byte-order mark (BOM), and is " @@ -1121,10 +908,9 @@ msgid "" "converting the Unicode string into some encoding that varies depending on " "the system. Today Python is converging on using UTF-8: Python on MacOS has " "used UTF-8 for several versions, and Python 3.6 switched to using UTF-8 on " -"Windows as well. On Unix systems, there will only be a :term:`filesystem " -"encoding `. if you've set the " -"``LANG`` or ``LC_CTYPE`` environment variables; if you haven't, the default " -"encoding is again UTF-8." +"Windows as well. On Unix systems, there will only be a filesystem encoding " +"if you've set the ``LANG`` or ``LC_CTYPE`` environment variables; if you " +"haven't, the default encoding is again UTF-8." msgstr "" #: ../../howto/unicode.rst:616 @@ -1141,13 +927,6 @@ msgstr "" "イル名を Unicode 文字列として渡すだけで正しいエンコーディングに自動的に変更さ" "れます::" -#: ../../howto/unicode.rst:622 -msgid "" -"filename = 'filename\\u4500abc'\n" -"with open(filename, 'w') as f:\n" -" f.write('blah\\n')" -msgstr "" - #: ../../howto/unicode.rst:626 msgid "" "Functions in the :mod:`os` module such as :func:`os.stat` will also accept " @@ -1165,32 +944,14 @@ msgid "" "you pass a Unicode string as the path, filenames will be decoded using the " "filesystem's encoding and a list of Unicode strings will be returned, while " "passing a byte path will return the filenames as bytes. For example, " -"assuming the default :term:`filesystem encoding ` is UTF-8, running the following program::" -msgstr "" - -#: ../../howto/unicode.rst:639 -msgid "" -"fn = 'filename\\u4500abc'\n" -"f = open(fn, 'w')\n" -"f.close()\n" -"\n" -"import os\n" -"print(os.listdir(b'.'))\n" -"print(os.listdir('.'))" +"assuming the default filesystem encoding is UTF-8, running the following " +"program::" msgstr "" #: ../../howto/unicode.rst:647 msgid "will produce the following output:" msgstr "以下の出力結果が生成されます:" -#: ../../howto/unicode.rst:649 -msgid "" -"$ python listdir-test.py\n" -"[b'filename\\xe4\\x94\\x80abc', ...]\n" -"['filename\\u4500abc', ...]" -msgstr "" - #: ../../howto/unicode.rst:655 msgid "" "The first list contains UTF-8-encoded filenames, and the second list " @@ -1277,17 +1038,6 @@ msgid "" "it with a :class:`~codecs.StreamRecoder` to return bytes encoded in UTF-8::" msgstr "" -#: ../../howto/unicode.rst:701 -msgid "" -"new_f = codecs.StreamRecoder(f,\n" -" # en/decoder: used by read() to encode its results and\n" -" # by write() to decode its input.\n" -" codecs.getencoder('utf-8'), codecs.getdecoder('utf-8'),\n" -"\n" -" # reader/writer: used to read and write to the stream.\n" -" codecs.getreader('latin-1'), codecs.getwriter('latin-1') )" -msgstr "" - #: ../../howto/unicode.rst:711 msgid "Files in an Unknown Encoding" msgstr "不明なエンコーディングのファイル" @@ -1300,18 +1050,6 @@ msgid "" "``surrogateescape`` error handler::" msgstr "" -#: ../../howto/unicode.rst:718 -msgid "" -"with open(fname, 'r', encoding=\"ascii\", errors=\"surrogateescape\") as f:\n" -" data = f.read()\n" -"\n" -"# make changes to the string 'data'\n" -"\n" -"with open(fname + '.new', 'w',\n" -" encoding=\"ascii\", errors=\"surrogateescape\") as f:\n" -" f.write(data)" -msgstr "" - #: ../../howto/unicode.rst:727 msgid "" "The ``surrogateescape`` error handler will decode any non-ASCII bytes as " @@ -1322,7 +1060,7 @@ msgstr "" #: ../../howto/unicode.rst:737 msgid "" -"One section of `Mastering Python 3 Input/Output `_, a PyCon 2010 talk by David " "Beazley, discusses text processing and binary data handling." msgstr "" @@ -1343,7 +1081,7 @@ msgstr "" #: ../../howto/unicode.rst:747 msgid "" -"`The Guts of Unicode in Python `_ is a PyCon 2013 talk by Benjamin Peterson that " "discusses the internal Unicode representation in Python 3.3." msgstr "" diff --git a/howto/urllib2.po b/howto/urllib2.po index 8b266ea1c..e510c6efa 100644 --- a/howto/urllib2.po +++ b/howto/urllib2.po @@ -1,29 +1,32 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 +# Nozomu Kaneko , 2017 +# Yusuke Miyazaki , 2017 +# Arihiro TAKASE, 2017 +# 秘湯 , 2017 +# tomo, 2017 +# Nakamura Masahito , 2018 +# Hiroyuki Kurosawa , 2019 # Tetsuo Koyama , 2021 -# Takanori Suzuki , 2023 -# souma987, 2023 -# TENMYO Masakazu, 2024 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-06 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:53+0000\n" -"Last-Translator: TENMYO Masakazu, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-02-06 05:23+0000\n" +"PO-Revision-Date: 2017-02-16 17:46+0000\n" +"Last-Translator: Tetsuo Koyama , 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../howto/urllib2.rst:5 @@ -35,14 +38,24 @@ msgid "Author" msgstr "著者" #: ../../howto/urllib2.rst:7 -msgid "`Michael Foord `_" -msgstr "`Michael Foord `_" +msgid "`Michael Foord `_" +msgstr "`Michael Foord `_" #: ../../howto/urllib2.rst:11 +msgid "" +"There is a French translation of an earlier revision of this HOWTO, " +"available at `urllib2 - Le Manuel manquant `_." +msgstr "" +"この HOWTO の前段階の版のフランス語訳が `urllib2 - Le Manuel manquant " +"`_ で入手" +"できます。" + +#: ../../howto/urllib2.rst:18 msgid "Introduction" msgstr "はじめに" -#: ../../howto/urllib2.rst:15 +#: ../../howto/urllib2.rst:22 msgid "" "You may also find useful the following article on fetching web resources " "with Python:" @@ -50,19 +63,19 @@ msgstr "" "同じように Python でインターネットリソースを取得するのに以下の記事が役に立ち" "ます:" -#: ../../howto/urllib2.rst:18 +#: ../../howto/urllib2.rst:25 msgid "" -"`Basic Authentication `_" +"`Basic Authentication `_" msgstr "" -"`Basic Authentication `_" +"`Basic Authentication `_" -#: ../../howto/urllib2.rst:20 +#: ../../howto/urllib2.rst:27 msgid "A tutorial on *Basic Authentication*, with examples in Python." msgstr "*Basic 認証* についてのチュートリアルで Python の例がついています。" -#: ../../howto/urllib2.rst:22 +#: ../../howto/urllib2.rst:29 msgid "" "**urllib.request** is a Python module for fetching URLs (Uniform Resource " "Locators). It offers a very simple interface, in the form of the *urlopen* " @@ -78,7 +91,7 @@ msgstr "" "キー、プロキシ等。これらは handler や opener と呼ばれるオブジェクトとして提供" "されます。" -#: ../../howto/urllib2.rst:29 +#: ../../howto/urllib2.rst:36 msgid "" "urllib.request supports fetching URLs for many \"URL schemes\" (identified " "by the string before the ``\":\"`` in URL - for example ``\"ftp\"`` is the " @@ -90,7 +103,7 @@ msgstr "" "るもの - 例えば \"ftp://python.org/\" では \"ftp\") の URL を、関連するネット" "ワークプロトコル(例えば FTP, HTTP) を利用することで、取得できます。" -#: ../../howto/urllib2.rst:34 +#: ../../howto/urllib2.rst:41 msgid "" "For straightforward situations *urlopen* is very easy to use. But as soon as " "you encounter errors or non-trivial cases when opening HTTP URLs, you will " @@ -110,46 +123,25 @@ msgstr "" "は :mod:`urllib.request` のドキュメントの代わりにはなりませんが、補完する役割" "を持っています。" -#: ../../howto/urllib2.rst:44 +#: ../../howto/urllib2.rst:51 msgid "Fetching URLs" msgstr "URL を取得する" -#: ../../howto/urllib2.rst:46 +#: ../../howto/urllib2.rst:53 msgid "The simplest way to use urllib.request is as follows::" msgstr "urllib.request を利用する最も簡単な方法は以下です::" -#: ../../howto/urllib2.rst:48 -msgid "" -"import urllib.request\n" -"with urllib.request.urlopen('http://python.org/') as response:\n" -" html = response.read()" -msgstr "" - -#: ../../howto/urllib2.rst:52 +#: ../../howto/urllib2.rst:59 msgid "" "If you wish to retrieve a resource via URL and store it in a temporary " "location, you can do so via the :func:`shutil.copyfileobj` and :func:" "`tempfile.NamedTemporaryFile` functions::" msgstr "" "URL によってリソースを取得し、それを一時的な場所に保存しておきたいときは、 :" -"func:`shutil.copyfileobj` と :func:`tempfile.NamedTemporaryFile` 関数を使って" +"func:`shutil.copyfileobj` と:func:`tempfile.NamedTemporaryFile` 関数を使って" "行うことができます::" -#: ../../howto/urllib2.rst:56 -msgid "" -"import shutil\n" -"import tempfile\n" -"import urllib.request\n" -"\n" -"with urllib.request.urlopen('http://python.org/') as response:\n" -" with tempfile.NamedTemporaryFile(delete=False) as tmp_file:\n" -" shutil.copyfileobj(response, tmp_file)\n" -"\n" -"with open(tmp_file.name) as html:\n" -" pass" -msgstr "" - -#: ../../howto/urllib2.rst:67 +#: ../../howto/urllib2.rst:74 msgid "" "Many uses of urllib will be that simple (note that instead of an 'http:' URL " "we could have used a URL starting with 'ftp:', 'file:', etc.). However, " @@ -160,7 +152,7 @@ msgstr "" "や 'file:' 等で始めればできます)。しかし、このチュートリアルの目的は、特に " "HTTP に絞って、より複雑な状況を説明することです。" -#: ../../howto/urllib2.rst:72 +#: ../../howto/urllib2.rst:79 msgid "" "HTTP is based on requests and responses - the client makes requests and " "servers send responses. urllib.request mirrors this with a ``Request`` " @@ -179,16 +171,7 @@ msgstr "" "オブジェクトで、これはつまりレスポンスに ``.read()`` と呼び出せることを意味し" "ています::" -#: ../../howto/urllib2.rst:80 -msgid "" -"import urllib.request\n" -"\n" -"req = urllib.request.Request('http://python.org/')\n" -"with urllib.request.urlopen(req) as response:\n" -" the_page = response.read()" -msgstr "" - -#: ../../howto/urllib2.rst:86 +#: ../../howto/urllib2.rst:93 msgid "" "Note that urllib.request makes use of the same Request interface to handle " "all URL schemes. For example, you can make an FTP request like so::" @@ -196,11 +179,7 @@ msgstr "" "urllib.request は同じリクエストインターフェースを全ての URL スキームに対して" "利用できるようにしています。例えば、FTP リクエストの場合はこうできます::" -#: ../../howto/urllib2.rst:89 -msgid "req = urllib.request.Request('ftp://example.com/')" -msgstr "" - -#: ../../howto/urllib2.rst:91 +#: ../../howto/urllib2.rst:98 msgid "" "In the case of HTTP, there are two extra things that Request objects allow " "you to do: First, you can pass data to be sent to the server. Second, you " @@ -214,11 +193,11 @@ msgstr "" "これらの送られる情報は HTTP 「ヘッダ」です。今度はこれらに関してひとつひとつ" "見ていきましょう。" -#: ../../howto/urllib2.rst:98 +#: ../../howto/urllib2.rst:105 msgid "Data" msgstr "データ" -#: ../../howto/urllib2.rst:100 +#: ../../howto/urllib2.rst:107 msgid "" "Sometimes you want to send data to a URL (often the URL will refer to a CGI " "(Common Gateway Interface) script or other web application). With HTTP, this " @@ -240,24 +219,7 @@ msgstr "" "ストオブジェクトに ``data`` 引数として渡します。エンコーディングは :mod:" "`urllib.parse` ライブラリの関数を使って行います。 ::" -#: ../../howto/urllib2.rst:110 -msgid "" -"import urllib.parse\n" -"import urllib.request\n" -"\n" -"url = 'http://www.someserver.com/cgi-bin/register.cgi'\n" -"values = {'name' : 'Michael Foord',\n" -" 'location' : 'Northampton',\n" -" 'language' : 'Python' }\n" -"\n" -"data = urllib.parse.urlencode(values)\n" -"data = data.encode('ascii') # data should be bytes\n" -"req = urllib.request.Request(url, data)\n" -"with urllib.request.urlopen(req) as response:\n" -" the_page = response.read()" -msgstr "" - -#: ../../howto/urllib2.rst:124 +#: ../../howto/urllib2.rst:131 msgid "" "Note that other encodings are sometimes required (e.g. for file upload from " "HTML forms - see `HTML Specification, Form Submission `_ を見て下さい)。" -#: ../../howto/urllib2.rst:129 +#: ../../howto/urllib2.rst:136 msgid "" "If you do not pass the ``data`` argument, urllib uses a **GET** request. One " "way in which GET and POST requests differ is that POST requests often have " @@ -290,27 +252,11 @@ msgstr "" "られません。HTTP の GET リクエストでもデータ自身をエンコーディングすることで" "データを渡すことができます。" -#: ../../howto/urllib2.rst:139 +#: ../../howto/urllib2.rst:146 msgid "This is done as follows::" msgstr "以下のようにして行います::" -#: ../../howto/urllib2.rst:141 -msgid "" -">>> import urllib.request\n" -">>> import urllib.parse\n" -">>> data = {}\n" -">>> data['name'] = 'Somebody Here'\n" -">>> data['location'] = 'Northampton'\n" -">>> data['language'] = 'Python'\n" -">>> url_values = urllib.parse.urlencode(data)\n" -">>> print(url_values) # The order may differ from below.\n" -"name=Somebody+Here&language=Python&location=Northampton\n" -">>> url = 'http://www.example.com/example.cgi'\n" -">>> full_url = url + '?' + url_values\n" -">>> data = urllib.request.urlopen(full_url)" -msgstr "" - -#: ../../howto/urllib2.rst:154 +#: ../../howto/urllib2.rst:161 msgid "" "Notice that the full URL is created by adding a ``?`` to the URL, followed " "by the encoded values." @@ -318,11 +264,11 @@ msgstr "" "``?`` を URL に加え、それにエンコードされた値が続くことで、完全な URL が作ら" "れていることに注意して下さい。" -#: ../../howto/urllib2.rst:158 +#: ../../howto/urllib2.rst:165 msgid "Headers" msgstr "ヘッダ" -#: ../../howto/urllib2.rst:160 +#: ../../howto/urllib2.rst:167 msgid "" "We'll discuss here one particular HTTP header, to illustrate how to add " "headers to your HTTP request." @@ -330,7 +276,7 @@ msgstr "" "ここでは特定の HTTP ヘッダについて議論します、 HTTP リクエストにヘッダを追加" "する方法について例示します。" -#: ../../howto/urllib2.rst:163 +#: ../../howto/urllib2.rst:170 msgid "" "Some websites [#]_ dislike being browsed by programs, or send different " "versions to different browsers [#]_. By default urllib identifies itself as " @@ -352,26 +298,7 @@ msgstr "" "できます。以下の例は上の例と同じですが、自身を Internet Explorer [#]_ のバー" "ジョンの一つとして扱っています。 ::" -#: ../../howto/urllib2.rst:174 -msgid "" -"import urllib.parse\n" -"import urllib.request\n" -"\n" -"url = 'http://www.someserver.com/cgi-bin/register.cgi'\n" -"user_agent = 'Mozilla/5.0 (Windows NT 6.1; Win64; x64)'\n" -"values = {'name': 'Michael Foord',\n" -" 'location': 'Northampton',\n" -" 'language': 'Python' }\n" -"headers = {'User-Agent': user_agent}\n" -"\n" -"data = urllib.parse.urlencode(values)\n" -"data = data.encode('ascii')\n" -"req = urllib.request.Request(url, data, headers)\n" -"with urllib.request.urlopen(req) as response:\n" -" the_page = response.read()" -msgstr "" - -#: ../../howto/urllib2.rst:190 +#: ../../howto/urllib2.rst:197 msgid "" "The response also has two useful methods. See the section on `info and " "geturl`_ which comes after we have a look at what happens when things go " @@ -380,32 +307,37 @@ msgstr "" "レスポンスは二つの便利なメソッドも持っています。 `info と geturl`_ の節を見て" "下さい、この節は後で問題が起きた場合に見ておくべき内容です。" -#: ../../howto/urllib2.rst:195 +#: ../../howto/urllib2.rst:202 msgid "Handling Exceptions" msgstr "例外を処理する" -#: ../../howto/urllib2.rst:197 +#: ../../howto/urllib2.rst:204 msgid "" -"*urlopen* raises :exc:`~urllib.error.URLError` when it cannot handle a " -"response (though as usual with Python APIs, built-in exceptions such as :exc:" -"`ValueError`, :exc:`TypeError` etc. may also be raised)." +"*urlopen* raises :exc:`URLError` when it cannot handle a response (though as " +"usual with Python APIs, built-in exceptions such as :exc:`ValueError`, :exc:" +"`TypeError` etc. may also be raised)." msgstr "" +"*urlopen* はレスポンスを処理できなかった場合、 :exc:`URLError` を送出します " +"(ふつうの Python API では、組み込み例外の :exc:`ValueError`, :exc:" +"`TypeError` などが送出されますが)。" -#: ../../howto/urllib2.rst:201 +#: ../../howto/urllib2.rst:208 msgid "" -":exc:`~urllib.error.HTTPError` is the subclass of :exc:`~urllib.error." -"URLError` raised in the specific case of HTTP URLs." +":exc:`HTTPError` is the subclass of :exc:`URLError` raised in the specific " +"case of HTTP URLs." msgstr "" +":exc:`HTTPError` は :exc:`URLError` のサブクラスで HTTP URLs の特定の状況で送" +"出されます。" -#: ../../howto/urllib2.rst:204 +#: ../../howto/urllib2.rst:211 msgid "The exception classes are exported from the :mod:`urllib.error` module." msgstr "例外クラスは :mod:`urllib.error` モジュールから提供されています。" -#: ../../howto/urllib2.rst:207 +#: ../../howto/urllib2.rst:214 msgid "URLError" msgstr "URLError" -#: ../../howto/urllib2.rst:209 +#: ../../howto/urllib2.rst:216 msgid "" "Often, URLError is raised because there is no network connection (no route " "to the specified server), or the specified server doesn't exist. In this " @@ -416,52 +348,52 @@ msgstr "" "や、指定したサーバが無い場合です。この場合、例外は 'reason' 属性を持ってい" "て、この属性はエラーコードとエラーメッセージのテキストを含むタプルです。" -#: ../../howto/urllib2.rst:214 +#: ../../howto/urllib2.rst:221 msgid "e.g. ::" msgstr "例::" -#: ../../howto/urllib2.rst:216 -msgid "" -">>> req = urllib.request.Request('http://www.pretend_server.org/')\n" -">>> try: urllib.request.urlopen(req)\n" -"... except urllib.error.URLError as e:\n" -"... print(e.reason)\n" -"...\n" -"(4, 'getaddrinfo failed')" -msgstr "" - -#: ../../howto/urllib2.rst:225 +#: ../../howto/urllib2.rst:232 msgid "HTTPError" msgstr "HTTPError" -#: ../../howto/urllib2.rst:227 +#: ../../howto/urllib2.rst:234 msgid "" "Every HTTP response from the server contains a numeric \"status code\". " "Sometimes the status code indicates that the server is unable to fulfil the " "request. The default handlers will handle some of these responses for you " "(for example, if the response is a \"redirection\" that requests the client " "fetch the document from a different URL, urllib will handle that for you). " -"For those it can't handle, urlopen will raise an :exc:`~urllib.error." -"HTTPError`. Typical errors include '404' (page not found), '403' (request " -"forbidden), and '401' (authentication required)." +"For those it can't handle, urlopen will raise an :exc:`HTTPError`. Typical " +"errors include '404' (page not found), '403' (request forbidden), and " +"'401' (authentication required)." msgstr "" +"サーバーからの全ての HTTP レスポンスは「ステータスコード」の数値を持っていま" +"す。多くの場合ステータスコードはサーバーがリクエストを実現できなかったことを" +"意味します。デフォルトハンドラーはこれらのレスポンスのいくつかを処理してくれ" +"ます(例えばレスポンスが「リダイレクション」、つまりクライアントが別の URL を" +"取得するように要求する場合には urllib はこの処理を行ってくれます。) 処理でき" +"ないものに対しては urlopen は :exc:`HTTPError` を送出します。典型的なエラーに" +"は '404' (page not found), '403' (request forbidden) と " +"'401' (authentication required) が含まれます。" -#: ../../howto/urllib2.rst:235 +#: ../../howto/urllib2.rst:242 msgid "" "See section 10 of :rfc:`2616` for a reference on all the HTTP error codes." msgstr "HTTP のエラーコード全てについては :rfc:`2616` の10節を参照して下さい。" -#: ../../howto/urllib2.rst:237 +#: ../../howto/urllib2.rst:244 msgid "" -"The :exc:`~urllib.error.HTTPError` instance raised will have an integer " -"'code' attribute, which corresponds to the error sent by the server." +"The :exc:`HTTPError` instance raised will have an integer 'code' attribute, " +"which corresponds to the error sent by the server." msgstr "" +"送出された :exc:`HTTPError` インスタンスは整数の 'code' 属性を持っていて、" +"サーバーによって送られた応答に対応しています。" -#: ../../howto/urllib2.rst:241 +#: ../../howto/urllib2.rst:248 msgid "Error Codes" msgstr "エラーコード" -#: ../../howto/urllib2.rst:243 +#: ../../howto/urllib2.rst:250 msgid "" "Because the default handlers handle redirects (codes in the 300 range), and " "codes in the 100--299 range indicate success, you will usually only see " @@ -471,142 +403,74 @@ msgstr "" "100--299番台のコードは成功を意味しているので、たいていの場合は400--599番台の" "エラーコードのみを見るだけですみます。" -#: ../../howto/urllib2.rst:247 +#: ../../howto/urllib2.rst:254 msgid "" ":attr:`http.server.BaseHTTPRequestHandler.responses` is a useful dictionary " -"of response codes that shows all the response codes used by :rfc:`2616`. An " -"excerpt from the dictionary is shown below ::" -msgstr "" - -#: ../../howto/urllib2.rst:251 -msgid "" -"responses = {\n" -" ...\n" -" : ('OK', 'Request fulfilled, document follows'),\n" -" ...\n" -" : ('Forbidden',\n" -" 'Request forbidden -- authorization will " -"'\n" -" 'not help'),\n" -" : ('Not Found',\n" -" 'Nothing matches the given URI'),\n" -" ...\n" -" : (\"I'm a Teapot\",\n" -" 'Server refuses to brew coffee because " -"'\n" -" 'it is a teapot'),\n" -" ...\n" -" : ('Service Unavailable',\n" -" 'The server cannot process the " -"'\n" -" 'request due to a high load'),\n" -" ...\n" -" }" -msgstr "" - -#: ../../howto/urllib2.rst:271 +"of response codes in that shows all the response codes used by :rfc:`2616`. " +"The dictionary is reproduced here for convenience ::" +msgstr "" +":attr:`http.server.BaseHTTPRequestHandler.responses` は :rfc:`2616` で利用さ" +"れるレスポンスコード全てを示す便利な辞書です。この辞書は便利なのでここに載せ" +"ておきます ::" + +#: ../../howto/urllib2.rst:326 msgid "" "When an error is raised the server responds by returning an HTTP error code " -"*and* an error page. You can use the :exc:`~urllib.error.HTTPError` instance " -"as a response on the page returned. This means that as well as the code " -"attribute, it also has read, geturl, and info, methods as returned by the " -"``urllib.response`` module::" -msgstr "" -"エラーが起きた場合、サーバーは HTTP エラーコード *および* エラーページを返し" -"て応答します。 :exc:`~urllib.error.HTTPError` インスタンスはエラーページのレ" -"スポンスとして扱えます。これは code 属性だけでなく、 ``urllib.response`` モ" -"ジュールが返すような read, geturl, info メソッドも持つことを意味します::" - -#: ../../howto/urllib2.rst:276 -msgid "" -">>> req = urllib.request.Request('http://www.python.org/fish.html')\n" -">>> try:\n" -"... urllib.request.urlopen(req)\n" -"... except urllib.error.HTTPError as e:\n" -"... print(e.code)\n" -"... print(e.read())\n" -"...\n" -"404\n" -"b'\\n\\n\\nPage Not Found\\n\n" -" ..." -msgstr "" - -#: ../../howto/urllib2.rst:291 +"*and* an error page. You can use the :exc:`HTTPError` instance as a response " +"on the page returned. This means that as well as the code attribute, it also " +"has read, geturl, and info, methods as returned by the ``urllib.response`` " +"module::" +msgstr "" +"エラーが起きた場合、サーバーは HTTP エラーコード *と* エラーページを返して応" +"答します。返されたページに対する応答として :exc:`HTTPError` インスタンスを使" +"うことができます。これは code 属性に対しても同様です、これらは ``urllib." +"response`` モジュールによって返された read も geturl, info などのメソッドも" +"持っています::" + +#: ../../howto/urllib2.rst:346 msgid "Wrapping it Up" msgstr "エラーをラップする" -#: ../../howto/urllib2.rst:293 +#: ../../howto/urllib2.rst:348 msgid "" -"So if you want to be prepared for :exc:`~urllib.error.HTTPError` *or* :exc:" -"`~urllib.error.URLError` there are two basic approaches. I prefer the second " -"approach." +"So if you want to be prepared for :exc:`HTTPError` *or* :exc:`URLError` " +"there are two basic approaches. I prefer the second approach." msgstr "" +":exc:`HTTPError` *または* :exc:`URLError` が起きたときのために準備しておきた" +"い場合には。二つの基本的なアプローチがあります。私は二つ目のアプローチを好み" +"ます。" -#: ../../howto/urllib2.rst:297 +#: ../../howto/urllib2.rst:352 msgid "Number 1" msgstr "その1" -#: ../../howto/urllib2.rst:302 -msgid "" -"from urllib.request import Request, urlopen\n" -"from urllib.error import URLError, HTTPError\n" -"req = Request(someurl)\n" -"try:\n" -" response = urlopen(req)\n" -"except HTTPError as e:\n" -" print('The server couldn\\'t fulfill the request.')\n" -" print('Error code: ', e.code)\n" -"except URLError as e:\n" -" print('We failed to reach a server.')\n" -" print('Reason: ', e.reason)\n" -"else:\n" -" # everything is fine" -msgstr "" - -#: ../../howto/urllib2.rst:319 +#: ../../howto/urllib2.rst:374 msgid "" "The ``except HTTPError`` *must* come first, otherwise ``except URLError`` " -"will *also* catch an :exc:`~urllib.error.HTTPError`." +"will *also* catch an :exc:`HTTPError`." msgstr "" +"``except HTTPError`` が *必ず* 最初に来る必要があります、そうしないと " +"``except URLError`` も :exc:`HTTPError` を捕捉してしまいます。" -#: ../../howto/urllib2.rst:323 +#: ../../howto/urllib2.rst:378 msgid "Number 2" msgstr "その2" -#: ../../howto/urllib2.rst:327 -msgid "" -"from urllib.request import Request, urlopen\n" -"from urllib.error import URLError\n" -"req = Request(someurl)\n" -"try:\n" -" response = urlopen(req)\n" -"except URLError as e:\n" -" if hasattr(e, 'reason'):\n" -" print('We failed to reach a server.')\n" -" print('Reason: ', e.reason)\n" -" elif hasattr(e, 'code'):\n" -" print('The server couldn\\'t fulfill the request.')\n" -" print('Error code: ', e.code)\n" -"else:\n" -" # everything is fine" -msgstr "" - -#: ../../howto/urllib2.rst:344 +#: ../../howto/urllib2.rst:399 msgid "info and geturl" msgstr "info と geturl" -#: ../../howto/urllib2.rst:346 +#: ../../howto/urllib2.rst:401 msgid "" -"The response returned by urlopen (or the :exc:`~urllib.error.HTTPError` " -"instance) has two useful methods :meth:`!info` and :meth:`!geturl` and is " -"defined in the module :mod:`urllib.response`." +"The response returned by urlopen (or the :exc:`HTTPError` instance) has two " +"useful methods :meth:`info` and :meth:`geturl` and is defined in the module :" +"mod:`urllib.response`.." msgstr "" +"レスポンスは urlopen (または :exc:`HTTPError` インスタンス) によって返さ" +"れ、 :meth:`info` と :meth:`geturl` の二つの便利なメソッドを持っていて、モ" +"ジュール :mod:`urllib.response` で定義されています。" -#: ../../howto/urllib2.rst:350 +#: ../../howto/urllib2.rst:405 msgid "" "**geturl** - this returns the real URL of the page fetched. This is useful " "because ``urlopen`` (or the opener object used) may have followed a " @@ -617,7 +481,7 @@ msgstr "" "は利用される opener オブジェクト) はリダイレクトに追従するため、有用です。取" "得したページの URL は要求した URL と同じとは限りません。" -#: ../../howto/urllib2.rst:354 +#: ../../howto/urllib2.rst:409 msgid "" "**info** - this returns a dictionary-like object that describes the page " "fetched, particularly the headers sent by the server. It is currently an :" @@ -627,25 +491,25 @@ msgstr "" "トを返します。これは現在では :class:`http.client.HTTPMessage` インスタンスで" "す。" -#: ../../howto/urllib2.rst:358 +#: ../../howto/urllib2.rst:413 msgid "" "Typical headers include 'Content-length', 'Content-type', and so on. See the " -"`Quick Reference to HTTP Headers `_ for a " +"`Quick Reference to HTTP Headers `_ for a " "useful listing of HTTP headers with brief explanations of their meaning and " "use." msgstr "" "典型的なヘッダは 'Content-length', 'Content-type' 等を含んでいます。 HTTP " "ヘッダの意味と利用法について簡単な説明つきの便利な一覧 `Quick Reference to " -"HTTP Headers `_ を参照して下さい。" +"HTTP Headers `_ を参照して下さい。" -#: ../../howto/urllib2.rst:365 +#: ../../howto/urllib2.rst:420 msgid "Openers and Handlers" msgstr "Openers と Handlers" -#: ../../howto/urllib2.rst:367 +#: ../../howto/urllib2.rst:422 msgid "" "When you fetch a URL you use an opener (an instance of the perhaps " -"confusingly named :class:`urllib.request.OpenerDirector`). Normally we have " +"confusingly-named :class:`urllib.request.OpenerDirector`). Normally we have " "been using the default opener - via ``urlopen`` - but you can create custom " "openers. Openers use handlers. All the \"heavy lifting\" is done by the " "handlers. Each handler knows how to open URLs for a particular URL scheme " @@ -655,12 +519,12 @@ msgstr "" "URL を取得する場合、opener (混乱を招きやすい名前ですが、 :class:`urllib." "request.OpenerDirector` のインスタンス) を利用します。標準的にはデフォルトの " "opener を - ``urlopen`` を通して - 利用していますが、カスタムの opener を作成" -"することもできます。 opener は handler を利用します。全ての「一番厄介な仕事」" -"はハンドラによって行なわれます。各 handler は特定の URL スキーム (http, ftp, " -"等) での URL の開き方を知っていたり、 URL を開く局面でどう処理するかを知って" -"います、例えば HTTP リダイレクションや HTTP のクッキーなど。" +"することもできます。 oppener は handler を利用します。全ての「一番厄介な仕" +"事」はハンドラによって行なわれます。各 handler は特定の URL スキーム (http, " +"ftp, 等) での URL の開き方を知っていたり、 URL を開く局面でどう処理するかを" +"知っています、例えば HTTP リダイレクションや HTTP のクッキーなど。" -#: ../../howto/urllib2.rst:375 +#: ../../howto/urllib2.rst:430 msgid "" "You will want to create openers if you want to fetch URLs with specific " "handlers installed, for example to get an opener that handles cookies, or to " @@ -670,7 +534,7 @@ msgstr "" "たいと思うでしょう、例えばクッキーを処理する opener が得たい場合や、リダイレ" "クションを処理しない opener を得たい場合。" -#: ../../howto/urllib2.rst:379 +#: ../../howto/urllib2.rst:434 msgid "" "To create an opener, instantiate an ``OpenerDirector``, and then call ``." "add_handler(some_handler_instance)`` repeatedly." @@ -678,7 +542,7 @@ msgstr "" "opener を作成するには、 ``OpenerDirector`` をインスタンス化して、続けて、 ``." "add_handler(some_handler_instance)`` を呼び出します。" -#: ../../howto/urllib2.rst:382 +#: ../../howto/urllib2.rst:437 msgid "" "Alternatively, you can use ``build_opener``, which is a convenience function " "for creating opener objects with a single function call. ``build_opener`` " @@ -691,7 +555,7 @@ msgstr "" "ハンドラに対して追加、継承のどちらかまたは両方を行うのに手っ取り早い方法を提" "供してくれます。" -#: ../../howto/urllib2.rst:387 +#: ../../howto/urllib2.rst:442 msgid "" "Other sorts of handlers you might want to can handle proxies, " "authentication, and other common but slightly specialised situations." @@ -699,7 +563,7 @@ msgstr "" "追加したくなる可能性がある handler としては、プロキシ処理、認証など、一般的で" "すがいくらか特定の状況に限られるものでしょう。" -#: ../../howto/urllib2.rst:390 +#: ../../howto/urllib2.rst:445 msgid "" "``install_opener`` can be used to make an ``opener`` object the (global) " "default opener. This means that calls to ``urlopen`` will use the opener you " @@ -709,7 +573,7 @@ msgstr "" "に利用できます。つまり、 ``urlopen`` を呼び出すと、インストールした opener が" "利用されます。" -#: ../../howto/urllib2.rst:394 +#: ../../howto/urllib2.rst:449 msgid "" "Opener objects have an ``open`` method, which can be called directly to " "fetch urls in the same way as the ``urlopen`` function: there's no need to " @@ -719,20 +583,24 @@ msgstr "" "様に、url を取得するのに直接呼び出すことができます: 利便性を除けば " "``install_opener`` を使う必要はありません。" -#: ../../howto/urllib2.rst:400 +#: ../../howto/urllib2.rst:455 msgid "Basic Authentication" msgstr "Basic 認証" -#: ../../howto/urllib2.rst:402 +#: ../../howto/urllib2.rst:457 msgid "" "To illustrate creating and installing a handler we will use the " "``HTTPBasicAuthHandler``. For a more detailed discussion of this subject -- " "including an explanation of how Basic Authentication works - see the `Basic " -"Authentication Tutorial `__." +"Authentication Tutorial `_." msgstr "" +"ハンドラの作成とインストールを例示するのに、 ``HTTPBasicAuthHandler`` を利用" +"してみます。この話題についてのより詳しい議論は -- Basic 認証がどうやって動作" +"するのかの説明も含んでいる `Basic Authentication Tutorial `_ を参照して下さい。" -#: ../../howto/urllib2.rst:408 +#: ../../howto/urllib2.rst:463 msgid "" "When authentication is required, the server sends a header (as well as the " "401 error code) requesting authentication. This specifies the " @@ -743,15 +611,11 @@ msgstr "" "を送ります。これによって認証スキームと 'realm' が指定されます。ヘッダはこのよ" "うになっています: ``WWW-Authenticate: SCHEME realm=\"REALM\"`` 。" -#: ../../howto/urllib2.rst:413 +#: ../../howto/urllib2.rst:468 msgid "e.g." msgstr "例" -#: ../../howto/urllib2.rst:415 -msgid "WWW-Authenticate: Basic realm=\"cPanel Users\"" -msgstr "" - -#: ../../howto/urllib2.rst:420 +#: ../../howto/urllib2.rst:475 msgid "" "The client should then retry the request with the appropriate name and " "password for the realm included as a header in the request. This is 'basic " @@ -763,7 +627,7 @@ msgstr "" "の流れを簡単化するために、 ``HTTPBasicAuthHandler`` のインスタンスを作成し、 " "opener が handler を利用するようにします。" -#: ../../howto/urllib2.rst:425 +#: ../../howto/urllib2.rst:480 msgid "" "The ``HTTPBasicAuthHandler`` uses an object called a password manager to " "handle the mapping of URLs and realms to passwords and usernames. If you " @@ -785,7 +649,7 @@ msgstr "" "利用できるようになります。このことは ``add_password`` メソッドの realm 引数と" "して ``None`` を与えることで明示することができます。" -#: ../../howto/urllib2.rst:435 +#: ../../howto/urllib2.rst:490 msgid "" "The top-level URL is the first URL that requires authentication. URLs " "\"deeper\" than the URL you pass to .add_password() will also match. ::" @@ -793,40 +657,23 @@ msgstr "" "トップレベルの URL が認証が必要なはじめに URL です。この URL よりも「深い」" "URL を渡しても .add_password() は同様にマッチします。::" -#: ../../howto/urllib2.rst:438 -msgid "" -"# create a password manager\n" -"password_mgr = urllib.request.HTTPPasswordMgrWithDefaultRealm()\n" -"\n" -"# Add the username and password.\n" -"# If we knew the realm, we could use it instead of None.\n" -"top_level_url = \"http://example.com/foo//"\n" -"password_mgr.add_password(None, top_level_url, username, password)\n" -"\n" -"handler = urllib.request.HTTPBasicAuthHandler(password_mgr)\n" -"\n" -"# create \"opener\" (OpenerDirector instance)\n" -"opener = urllib.request.build_opener(handler)\n" -"\n" -"# use the opener to fetch a URL\n" -"opener.open(a_url)\n" -"\n" -"# Install the opener.\n" -"# Now all calls to urllib.request.urlopen use our opener.\n" -"urllib.request.install_opener(opener)" -msgstr "" - -#: ../../howto/urllib2.rst:460 +#: ../../howto/urllib2.rst:515 msgid "" "In the above example we only supplied our ``HTTPBasicAuthHandler`` to " "``build_opener``. By default openers have the handlers for normal situations " -"-- ``ProxyHandler`` (if a proxy setting such as an :envvar:`!http_proxy` " +"-- ``ProxyHandler`` (if a proxy setting such as an :envvar:`http_proxy` " "environment variable is set), ``UnknownHandler``, ``HTTPHandler``, " "``HTTPDefaultErrorHandler``, ``HTTPRedirectHandler``, ``FTPHandler``, " "``FileHandler``, ``DataHandler``, ``HTTPErrorProcessor``." msgstr "" +"上の例では ``build_opener`` に ``HTTPBasicAuthHandler`` のみを与えました。デ" +"フォルトで opener は普通の状況に適用するためにいくつかのハンドラを備えていま" +"す -- ``ProxyHandler`` (:envvar:`http_proxy` 環境変数のようなプロキシ設定が" +"セットされている場合), ``UnknownHandler``, ``HTTPHandler``, " +"``HTTPDefaultErrorHandler``, ``HTTPRedirectHandler``, ``FTPHandler``, " +"``FileHandler``, ``DataHandler``, ``HTTPErrorProcessor`` 。" -#: ../../howto/urllib2.rst:467 +#: ../../howto/urllib2.rst:522 msgid "" "``top_level_url`` is in fact *either* a full URL (including the 'http:' " "scheme component and the hostname and optionally the port number) e.g. " @@ -843,11 +690,11 @@ msgstr "" "でも* かまいません。authority の場合には \"userinfo\" 要素は含んではいけませ" "ん - 例えば \"joe:password@example.com\" は不適切です。" -#: ../../howto/urllib2.rst:477 +#: ../../howto/urllib2.rst:532 msgid "Proxies" msgstr "プロキシ" -#: ../../howto/urllib2.rst:479 +#: ../../howto/urllib2.rst:534 msgid "" "**urllib** will auto-detect your proxy settings and use those. This is " "through the ``ProxyHandler``, which is part of the normal handler chain when " @@ -863,14 +710,7 @@ msgstr "" "`Basic Authentication`_ handler を設定したときと同じような流れで行うことがで" "きます: ::" -#: ../../howto/urllib2.rst:486 -msgid "" -">>> proxy_support = urllib.request.ProxyHandler({})\n" -">>> opener = urllib.request.build_opener(proxy_support)\n" -">>> urllib.request.install_opener(opener)" -msgstr "" - -#: ../../howto/urllib2.rst:492 +#: ../../howto/urllib2.rst:547 msgid "" "Currently ``urllib.request`` *does not* support fetching of ``https`` " "locations through a proxy. However, this can be enabled by extending urllib." @@ -880,7 +720,7 @@ msgstr "" "をサポートしていません。しかし、urllib.request をこのレシピ [#]_ で拡張するこ" "とで可能にすることができます。" -#: ../../howto/urllib2.rst:498 +#: ../../howto/urllib2.rst:553 msgid "" "``HTTP_PROXY`` will be ignored if a variable ``REQUEST_METHOD`` is set; see " "the documentation on :func:`~urllib.request.getproxies`." @@ -889,20 +729,20 @@ msgstr "" "す; :func:`~urllib.request.getproxies` のドキュメンテーションを参照してくださ" "い。" -#: ../../howto/urllib2.rst:503 +#: ../../howto/urllib2.rst:558 msgid "Sockets and Layers" msgstr "ソケットとレイヤー" -#: ../../howto/urllib2.rst:505 +#: ../../howto/urllib2.rst:560 msgid "" "The Python support for fetching resources from the web is layered. urllib " "uses the :mod:`http.client` library, which in turn uses the socket library." msgstr "" -"Web 上からリソースを取得する Python の機能はレイヤー化されています。urllib " -"は :mod:`http.client` ライブラリを利用していますが、そのライブラリはさらに " -"socket ライブラリを利用しています。" +"Python はレイヤー化された web 上からリソース取得もサポートしています。 " +"urllib は :mod:`http.client` ライブラリを利用します、 httplib はさらに " +"socket ライブラリを利用します。" -#: ../../howto/urllib2.rst:508 +#: ../../howto/urllib2.rst:563 msgid "" "As of Python 2.3 you can specify how long a socket should wait for a " "response before timing out. This can be useful in applications which have to " @@ -918,34 +758,19 @@ msgstr "" "ベルからは隠蔽されていています。しかし、以下を利用することで全てのソケットに" "対してグローバルにデフォルトタイムアウトを設定することができます ::" -#: ../../howto/urllib2.rst:514 -msgid "" -"import socket\n" -"import urllib.request\n" -"\n" -"# timeout in seconds\n" -"timeout = 10\n" -"socket.setdefaulttimeout(timeout)\n" -"\n" -"# this call to urllib.request.urlopen now uses the default timeout\n" -"# we have set in the socket module\n" -"req = urllib.request.Request('http://www.voidspace.org.uk/')\n" -"response = urllib.request.urlopen(req)" -msgstr "" - -#: ../../howto/urllib2.rst:531 +#: ../../howto/urllib2.rst:586 msgid "Footnotes" msgstr "脚注" -#: ../../howto/urllib2.rst:533 +#: ../../howto/urllib2.rst:588 msgid "This document was reviewed and revised by John Lee." msgstr "このドキュメントは John Lee によって査読、改訂されました。" -#: ../../howto/urllib2.rst:535 +#: ../../howto/urllib2.rst:590 msgid "Google for example." msgstr "Google を例題にする。" -#: ../../howto/urllib2.rst:536 +#: ../../howto/urllib2.rst:591 msgid "" "Browser sniffing is a very bad practice for website design - building sites " "using web standards is much more sensible. Unfortunately a lot of sites " @@ -956,7 +781,7 @@ msgstr "" "不幸なことに未だに多くの web サイトが異なるブラウザに対して異なるバージョンを" "返しています。" -#: ../../howto/urllib2.rst:539 +#: ../../howto/urllib2.rst:594 msgid "" "The user agent for MSIE 6 is *'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT " "5.1; SV1; .NET CLR 1.1.4322)'*" @@ -964,7 +789,7 @@ msgstr "" "MSIE 6 のユーザエージェントは *'Mozilla/4.0 (compatible; MSIE 6.0; Windows " "NT 5.1; SV1; .NET CLR 1.1.4322)'* です。" -#: ../../howto/urllib2.rst:541 +#: ../../howto/urllib2.rst:596 msgid "" "For details of more HTTP request headers, see `Quick Reference to HTTP " "Headers`_." @@ -972,7 +797,7 @@ msgstr "" "HTTP リクエストヘッダの詳細については、 `Quick Reference to HTTP Headers`_ を" "参照して下さい。" -#: ../../howto/urllib2.rst:543 +#: ../../howto/urllib2.rst:598 msgid "" "In my case I have to use a proxy to access the internet at work. If you " "attempt to fetch *localhost* URLs through this proxy it blocks them. IE is " @@ -985,9 +810,10 @@ msgstr "" "報を利用します。localhost のサーバでスクリプトをテストしようとすると、urllib " "がプロキシを利用するのを止めなければいけません。" -#: ../../howto/urllib2.rst:548 +#: ../../howto/urllib2.rst:603 msgid "" "urllib opener for SSL proxy (CONNECT method): `ASPN Cookbook Recipe `_." +"code.activestate.com/recipes/456195/>`_." msgstr "" +"urllib opener for SSL proxy (CONNECT method): `ASPN Cookbook Recipe `_." diff --git a/includes/wasm-notavail.po b/includes/wasm-notavail.po deleted file mode 100644 index afcae3c83..000000000 --- a/includes/wasm-notavail.po +++ /dev/null @@ -1,38 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2023, Python Software Foundation -# This file is distributed under the same license as the Python package. -# FIRST AUTHOR , YEAR. -# -# Translators: -# souma987, 2023 -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: Python 3.11\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-03-24 14:14+0000\n" -"PO-Revision-Date: 2022-11-05 19:48+0000\n" -"Last-Translator: souma987, 2023\n" -"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" -"ja/)\n" -"Language: ja\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#: ../../includes/wasm-notavail.rst:3 -msgid ":ref:`Availability `: not Emscripten, not WASI." -msgstr "" -":ref:`利用可能性`: Emscripten でなく、WASI でもないこと。" - -#: ../../includes/wasm-notavail.rst:5 -msgid "" -"This module does not work or is not available on WebAssembly platforms " -"``wasm32-emscripten`` and ``wasm32-wasi``. See :ref:`wasm-availability` for " -"more information." -msgstr "" -"このモジュールは WebAssembly プラットフォーム ``wasm32-emscripten`` と " -"``wasm32-wasi`` では動作しないか、利用不可です。詳しくは、:ref:`wasm-" -"availability` を見てください。" diff --git a/install/index.po b/install/index.po index dd8808bd0..3162d0a31 100644 --- a/install/index.po +++ b/install/index.po @@ -1,27 +1,29 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2023, Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Tetsuo Koyama , 2021 -# mollinaca, 2021 -# tomo, 2021 -# Shin Saito, 2021 -# Takeshi Nakazato, 2021 -# 菊池 健志, 2023 -# Arihiro TAKASE, 2023 -# Transifex Bot <>, 2023 +# Yoshikazu KARASAWA , 2017 +# Ryuichi Takano , 2017 +# Masato HASHIMOTO , 2017 +# Inada Naoki , 2017 +# 秘湯 , 2017 +# Nozomu Kaneko , 2017 +# Arihiro TAKASE, 2017 +# tomo, 2019 +# Tetsuo Koyama , 2020 +# mollinaca, 2020 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.12\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-08-04 14:13+0000\n" -"PO-Revision-Date: 2021-06-28 00:53+0000\n" -"Last-Translator: Transifex Bot <>, 2023\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-02-19 05:30+0000\n" +"PO-Revision-Date: 2017-02-16 17:46+0000\n" +"Last-Translator: mollinaca, 2020\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" "Language: ja\n" "MIME-Version: 1.0\n" @@ -41,23 +43,11 @@ msgstr "著者" msgid "Greg Ward" msgstr "Greg Ward --- 日本語訳: Python ドキュメント翻訳プロジェクト" -#: ../../install/index.rst:15 -msgid "" -"The entire ``distutils`` package has been deprecated and will be removed in " -"Python 3.12. This documentation is retained as a reference only, and will be " -"removed with the package. See the :ref:`What's New ` " -"entry for more information." -msgstr "" -"``distutils`` パッケージ全体の使用は非推奨 (deprecated) であり、Python 3.12 " -"で削除されます。この文書は参照のために維持されており、パッケージとともに削除" -"されます。詳しくは :ref:`What's New ` エントリを参照し" -"てください。" - -#: ../../install/index.rst:23 +#: ../../install/index.rst:16 msgid ":ref:`installing-index`" msgstr ":ref:`installing-index`" -#: ../../install/index.rst:23 +#: ../../install/index.rst:16 msgid "" "The up to date module installation documentation. For regular Python usage, " "you almost certainly want that document rather than this one." @@ -66,7 +56,7 @@ msgstr "" "Python の利用の場合、このページよりも、ほぼ確実にこちらのドキュメントを参照し" "たほうがよいでしょう。" -#: ../../install/index.rst:28 +#: ../../distutils/_setuptools_disclaimer.rst:3 msgid "" "This document is being retained solely until the ``setuptools`` " "documentation at https://setuptools.readthedocs.io/en/latest/setuptools.html " @@ -76,7 +66,7 @@ msgstr "" "html にある ``setuptools`` のドキュメントが現時点でここにある関連情報を全て網" "羅するまで、単独でここに載せておかれます。" -#: ../../install/index.rst:34 +#: ../../install/index.rst:23 msgid "" "This guide only covers the basic tools for building and distributing " "extensions that are provided as part of this version of Python. Third party " @@ -90,11 +80,11 @@ msgstr "" "`quick recommendations section `__ にある Python パッケージングユーザガイドから得られます。" -#: ../../install/index.rst:45 +#: ../../install/index.rst:34 msgid "Introduction" msgstr "はじめに" -#: ../../install/index.rst:47 +#: ../../install/index.rst:36 msgid "" "In Python 2.0, the ``distutils`` API was first added to the standard " "library. This provided Linux distro maintainers with a standard way of " @@ -108,7 +98,7 @@ msgstr "" "供しました。また、システム管理者には Python プロジェクトを対象のシステムにイ" "ンストールする標準的な方法を提供しました。" -#: ../../install/index.rst:52 +#: ../../install/index.rst:41 msgid "" "In the many years since Python 2.0 was released, tightly coupling the build " "system and package installer to the language runtime release cycle has " @@ -122,14 +112,14 @@ msgstr "" "うよりも ``pip`` パッケージインストーラーと ``setuptools`` ビルドシステムを使" "うことが推奨されています。" -#: ../../install/index.rst:58 +#: ../../install/index.rst:47 msgid "" "See :ref:`installing-index` and :ref:`distributing-index` for more details." msgstr "" "詳しくは :ref:`installing-index` と :ref:`distributing-index` を参照してくだ" "さい。" -#: ../../install/index.rst:60 +#: ../../install/index.rst:49 msgid "" "This legacy documentation is being retained only until we're confident that " "the ``setuptools`` documentation covers everything needed." @@ -137,18 +127,18 @@ msgstr "" "このレガシードキュメントは、 ``setuptools`` のドキュメントが必要な全ての情報" "を網羅していると自信を持って言えるようになるまで保持されます。" -#: ../../install/index.rst:66 +#: ../../install/index.rst:55 msgid "Distutils based source distributions" msgstr "Distutils にもとづくソースコードの配布" -#: ../../install/index.rst:68 +#: ../../install/index.rst:57 msgid "" "If you download a module source distribution, you can tell pretty quickly if " "it was packaged and distributed in the standard way, i.e. using the " "Distutils. First, the distribution's name and version number will be " "featured prominently in the name of the downloaded archive, e.g. :file:" "`foo-1.0.tar.gz` or :file:`widget-0.9.7.zip`. Next, the archive will unpack " -"into a similarly named directory: :file:`foo-1.0` or :file:`widget-0.9.7`. " +"into a similarly-named directory: :file:`foo-1.0` or :file:`widget-0.9.7`. " "Additionally, the distribution will contain a setup script :file:`setup.py`, " "and a file named :file:`README.txt` or possibly just :file:`README`, which " "should explain that building and installing the module distribution is a " @@ -165,7 +155,7 @@ msgstr "" "入っていて、そこには、モジュール配布物の構築とインストールは簡単で、このよう" "にするだけだ、とするだけだ、という説明が書かれているはずです ::" -#: ../../install/index.rst:81 +#: ../../install/index.rst:70 msgid "" "For Windows, this command should be run from a command prompt window (:" "menuselection:`Start --> Accessories`)::" @@ -174,7 +164,7 @@ msgstr "" "menuselection:`スタート --> アクセサリ`)、このように実行するのに違いありませ" "ん ::" -#: ../../install/index.rst:86 +#: ../../install/index.rst:75 msgid "" "If all these things are true, then you already know how to build and install " "the modules you've just downloaded: Run the command above. Unless you need " @@ -188,11 +178,11 @@ msgstr "" "い限り、このマニュアルは必要ありません。別の言葉で言えば、上のコマンドこそ" "が、このマニュアルから習得すべき全てということになります。" -#: ../../install/index.rst:96 +#: ../../install/index.rst:85 msgid "Standard Build and Install" msgstr "標準的なビルド・インストール作業" -#: ../../install/index.rst:98 +#: ../../install/index.rst:87 msgid "" "As described in section :ref:`inst-new-standard`, building and installing a " "module distribution using the Distutils is usually one simple command to run " @@ -201,11 +191,11 @@ msgstr "" ":ref:`inst-new-standard` 節で述べたように、 Distutils を使ったモジュール配布" "物のビルドとインストールは、通常は端末からの単純な以下コマンドで行います::" -#: ../../install/index.rst:108 +#: ../../install/index.rst:97 msgid "Platform variations" msgstr "プラットフォームによる違い" -#: ../../install/index.rst:110 +#: ../../install/index.rst:99 msgid "" "You should always run the setup command from the distribution root " "directory, i.e. the top-level subdirectory that the module source " @@ -218,7 +208,7 @@ msgstr "" "例えば、あるモジュールのソース配布物 :file:`foo-1.0.tar.gz` を Unix システム" "上にダウンロードしたなら、通常は以下の操作を行います::" -#: ../../install/index.rst:119 +#: ../../install/index.rst:108 msgid "" "On Windows, you'd probably download :file:`foo-1.0.zip`. If you downloaded " "the archive file to :file:`C:\\\\Temp`, then it would unpack into :file:`C:\\" @@ -234,11 +224,11 @@ msgstr "" "アーカイブを :file:`C:\\\\Temp\\\\foo-1.0` に展開します。次に、コマンドプロン" "プトウィンドウを開いて、以下を実行します:" -#: ../../install/index.rst:133 +#: ../../install/index.rst:122 msgid "Splitting the job up" msgstr "ビルド作業とインストール作業を分割する" -#: ../../install/index.rst:135 +#: ../../install/index.rst:124 msgid "" "Running ``setup.py install`` builds and installs all modules in one run. If " "you prefer to work incrementally---especially useful if you want to " @@ -257,7 +247,7 @@ msgstr "" "てシステム管理者に渡して (または、自分でスーパユーザになって)、インストールし" "たくなるかもしれません." -#: ../../install/index.rst:143 +#: ../../install/index.rst:132 msgid "" "For example, you can build everything in one step, and then install " "everything in a second step, by invoking the setup script twice::" @@ -265,7 +255,7 @@ msgstr "" "最初のステップでは全てをビルドしておき、次のステップで全てをインストールする" "には、setup スクリプトを二度起動します::" -#: ../../install/index.rst:149 +#: ../../install/index.rst:138 msgid "" "If you do this, you will notice that running the :command:`install` command " "first runs the :command:`build` command, which---in this case---quickly " @@ -277,7 +267,7 @@ msgstr "" "ディレクトリの中が全て最新の状態になっているので、 :command:`build` は何も行" "わなくてよいと判断していることがわかるでしょう。" -#: ../../install/index.rst:154 +#: ../../install/index.rst:143 msgid "" "You may not need this ability to break things down often if all you do is " "install modules downloaded off the 'net, but it's very handy for more " @@ -290,11 +280,11 @@ msgstr "" "布することになれば、個々の Distutils コマンドを自分で何度も実行することになる" "でしょう。" -#: ../../install/index.rst:163 +#: ../../install/index.rst:152 msgid "How building works" msgstr "ビルドの仕組み" -#: ../../install/index.rst:165 +#: ../../install/index.rst:154 msgid "" "As implied above, the :command:`build` command is responsible for putting " "the files to install into a *build directory*. By default, this is :file:" @@ -308,7 +298,7 @@ msgstr "" "だわりがあったり、ソースツリーに指一本触れたくないのなら、 :option:`!--build-" "base` オプションを使ってビルドディレクトリを変更できます。例えば::" -#: ../../install/index.rst:173 +#: ../../install/index.rst:162 msgid "" "(Or you could do this permanently with a directive in your system or " "personal Distutils configuration file; see section :ref:`inst-config-" @@ -318,11 +308,11 @@ msgstr "" "クティブを書いて、永続的に設定を変えられます; :ref:`inst-config-files` 節を参" "照してください。) 通常は必要ない作業です。" -#: ../../install/index.rst:177 +#: ../../install/index.rst:166 msgid "The default layout for the build tree is as follows::" msgstr "ビルドツリーのデフォルトのレイアウトは以下のようになっています::" -#: ../../install/index.rst:184 +#: ../../install/index.rst:173 msgid "" "where ```` expands to a brief description of the current OS/hardware " "platform and Python version. The first form, with just a :file:`lib` " @@ -346,7 +336,7 @@ msgstr "" "`lib.{plat}`) ディレクトリには、最終的にインストールされることになる全ての " "Python モジュール (pure Python モジュールおよび拡張モジュール) が入ります。" -#: ../../install/index.rst:194 +#: ../../install/index.rst:183 msgid "" "In the future, more directories will be added to handle Python scripts, " "documentation, binary executables, and whatever else is needed to handle the " @@ -356,11 +346,11 @@ msgstr "" "ジュールやアプリケーションのインストール作業に必要なディレクトリが追加される" "かもしれません。" -#: ../../install/index.rst:202 +#: ../../install/index.rst:191 msgid "How installation works" msgstr "インストールの仕組み" -#: ../../install/index.rst:204 +#: ../../install/index.rst:193 msgid "" "After the :command:`build` command runs (whether you run it explicitly, or " "the :command:`install` command does it for you), the work of the :command:" @@ -374,13 +364,13 @@ msgstr "" "{plat}`) の下にあるもの全ての指定したインストールディレクトリへのコピー、にな" "ります。" -#: ../../install/index.rst:210 +#: ../../install/index.rst:199 msgid "" "If you don't choose an installation directory---i.e., if you just run " "``setup.py install``\\ ---then the :command:`install` command installs to " "the standard location for third-party Python modules. This location varies " -"by platform and by how you built/installed Python itself. On Unix (and " -"macOS, which is also Unix-based), it also depends on whether the module " +"by platform and by how you built/installed Python itself. On Unix (and Mac " +"OS X, which is also Unix-based), it also depends on whether the module " "distribution being installed is pure Python or contains extensions (\"non-" "pure\"):" msgstr "" @@ -388,73 +378,73 @@ msgstr "" "install`` を実行しただけの場合 --- には、 :command:`install` コマンドはサード" "パーティ製 Python モジュールを置くための標準の場所にインストールを行います。" "この場所は、プラットフォームや、Python 自体をどのようにビルド/インストールし" -"たかで変わります。 Unix (と、Unix をベースとしたmacOS) では、インストールしよ" -"うとするモジュール配布物が pure Python なのか、拡張モジュールを含む (\"非 " -"pure\") のかによっても異なります:" +"たかで変わります。 Unix (と、Unix をベースとしたMac OS X) では、インストール" +"しようとするモジュール配布物が pure Python なのか、拡張モジュールを含む " +"(\"非 pure\") のかによっても異なります:" -#: ../../install/index.rst:220 +#: ../../install/index.rst:209 msgid "Platform" msgstr "プラットフォーム" -#: ../../install/index.rst:220 +#: ../../install/index.rst:209 msgid "Standard installation location" msgstr "標準のインストール場所" -#: ../../install/index.rst:220 +#: ../../install/index.rst:209 msgid "Default value" msgstr "デフォルト値" -#: ../../install/index.rst:220 ../../install/index.rst:746 -#: ../../install/index.rst:758 +#: ../../install/index.rst:209 ../../install/index.rst:735 +#: ../../install/index.rst:747 msgid "Notes" msgstr "注釈" -#: ../../install/index.rst:222 +#: ../../install/index.rst:211 msgid "Unix (pure)" msgstr "Unix (pure)" -#: ../../install/index.rst:222 ../../install/index.rst:435 +#: ../../install/index.rst:211 ../../install/index.rst:424 msgid ":file:`{prefix}/lib/python{X.Y}/site-packages`" msgstr ":file:`{prefix}/lib/python{X.Y}/site-packages`" -#: ../../install/index.rst:222 ../../install/index.rst:224 +#: ../../install/index.rst:211 ../../install/index.rst:213 msgid ":file:`/usr/local/lib/python{X.Y}/site-packages`" msgstr ":file:`/usr/local/lib/python{X.Y}/site-packages`" -#: ../../install/index.rst:222 ../../install/index.rst:224 -#: ../../install/index.rst:748 +#: ../../install/index.rst:211 ../../install/index.rst:213 +#: ../../install/index.rst:737 msgid "\\(1)" msgstr "\\(1)" -#: ../../install/index.rst:224 +#: ../../install/index.rst:213 msgid "Unix (non-pure)" msgstr "Unix (非 pure)" -#: ../../install/index.rst:224 ../../install/index.rst:436 +#: ../../install/index.rst:213 ../../install/index.rst:425 msgid ":file:`{exec-prefix}/lib/python{X.Y}/site-packages`" msgstr ":file:`{exec-prefix}/lib/python{X.Y}/site-packages`" -#: ../../install/index.rst:226 +#: ../../install/index.rst:215 msgid "Windows" msgstr "Windows" -#: ../../install/index.rst:226 ../../install/index.rst:487 +#: ../../install/index.rst:215 ../../install/index.rst:476 msgid ":file:`{prefix}\\\\Lib\\\\site-packages`" msgstr ":file:`{prefix}\\\\Lib\\\\site-packages`" -#: ../../install/index.rst:226 +#: ../../install/index.rst:215 msgid ":file:`C:\\\\Python{XY}\\\\Lib\\\\site-packages`" msgstr ":file:`C:\\\\Python{XY}\\\\Lib\\\\site-packages`" -#: ../../install/index.rst:226 ../../install/index.rst:750 +#: ../../install/index.rst:215 ../../install/index.rst:739 msgid "\\(2)" msgstr "\\(2)" -#: ../../install/index.rst:229 ../../install/index.rst:770 +#: ../../install/index.rst:218 ../../install/index.rst:759 msgid "Notes:" msgstr "注釈:" -#: ../../install/index.rst:232 +#: ../../install/index.rst:221 msgid "" "Most Linux distributions include Python as a standard part of the system, " "so :file:`{prefix}` and :file:`{exec-prefix}` are usually both :file:`/usr` " @@ -468,7 +458,7 @@ msgstr "" "クなシステム) 上で自分で Python をビルドした場合、デフォルトの :file:" "`{prefix}` および :file:`{exec-prefix}` は :file:`/usr/local` になります。" -#: ../../install/index.rst:238 +#: ../../install/index.rst:227 msgid "" "The default installation directory on Windows was :file:`C:\\\\Program " "Files\\\\Python` under Python 1.6a1, 1.5.2, and earlier." @@ -477,12 +467,12 @@ msgstr "" "1.5.2、およびそれ以前のバージョンでは :file:`C:\\\\Program Files\\\\Python` " "です。" -#: ../../install/index.rst:241 +#: ../../install/index.rst:230 msgid "" ":file:`{prefix}` and :file:`{exec-prefix}` stand for the directories that " "Python is installed to, and where it finds its libraries at run-time. They " "are always the same under Windows, and very often the same under Unix and " -"macOS. You can find out what your Python installation uses for :file:" +"Mac OS X. You can find out what your Python installation uses for :file:" "`{prefix}` and :file:`{exec-prefix}` by running Python in interactive mode " "and typing a few simple commands. Under Unix, just type ``python`` at the " "shell prompt. Under Windows, choose :menuselection:`Start --> Programs --> " @@ -493,17 +483,17 @@ msgid "" msgstr "" ":file:`{prefix}` および :file:`{exec-prefix}` は、 Python がインストールされ" "ているディレクトリと、実行時にライブラリを探しにいく場所を表します。これらの" -"ディレクトリは、Windows では常に同じで、 Unixと macOS でもほぼ常に同じです。" -"自分の Python がどんな :file:`{prefix}` や :file:`{exec-prefix}` を使っている" -"かは、Python を対話モードで起動して、単純なコマンドをいくつか入力すればわかり" -"ます。 Windows では、 :menuselection:`スタート --> (すべての) プログラム --" -"> Python X.Y --> Python (command line)` を選びます。Unix では、シェルプロン" -"プトで単に ``python`` と入力します。インタプリタを起動すると、プロンプトに " +"ディレクトリは、Windows では常に同じで、 Unixと Mac OS X でもほぼ常に同じで" +"す。自分の Python がどんな :file:`{prefix}` や :file:`{exec-prefix}` を使って" +"いるかは、Python を対話モードで起動して、単純なコマンドをいくつか入力すればわ" +"かります。 Windows では、 :menuselection:`スタート --> (すべての) プログラム " +"--> Python X.Y --> Python (command line)` を選びます。Unix では、シェルプロ" +"ンプトで単に ``python`` と入力します。インタプリタを起動すると、プロンプトに " "Python コードを入力できます。例えば、著者の使っている Linux システムで、三つ" "の Python 文を以下のように入力すると、出力から著者のシステムの :file:" "`{prefix}` と :file:`{exec-prefix}` を得られます:" -#: ../../install/index.rst:263 +#: ../../install/index.rst:252 msgid "" "A few other placeholders are used in this document: :file:`{X.Y}` stands for " "the version of Python, for example ``3.2``; :file:`{abiflags}` will be " @@ -521,7 +511,7 @@ msgstr "" "ズはパス内で重要です; 例えば UNIX では ``python3.2`` が使われる値が、Windows " "では普通 ``Python32`` を使います。" -#: ../../install/index.rst:271 +#: ../../install/index.rst:260 msgid "" "If you don't want to install modules to the standard location, or if you " "don't have permission to write there, then you need to read about alternate " @@ -535,11 +525,11 @@ msgstr "" "レクトリを大幅にカスタマイズしければ、 :ref:`inst-custom-install` 節のカスタ" "ムインストールに関する説明を読んでください。" -#: ../../install/index.rst:281 +#: ../../install/index.rst:270 msgid "Alternate Installation" msgstr "別の場所へのインストール" -#: ../../install/index.rst:283 +#: ../../install/index.rst:272 msgid "" "Often, it is necessary or desirable to install modules to a location other " "than the standard location for third-party Python modules. For example, on " @@ -559,7 +549,7 @@ msgstr "" "際には特にそうでしょう: 実際にアップグレードする前に、既存のスクリプトの基本" "となる部分が新たなバージョンでも動作するか確認したいはずです。" -#: ../../install/index.rst:291 +#: ../../install/index.rst:280 msgid "" "The Distutils :command:`install` command is designed to make installing " "module distributions to an alternate location simple and painless. The " @@ -577,7 +567,7 @@ msgstr "" "ものです。詳細はプラットフォームによって異なるので、以下の節から自分のプラッ" "トフォームに当てはまるものを読んでください。" -#: ../../install/index.rst:299 +#: ../../install/index.rst:288 msgid "" "Note that the various alternate installation schemes are mutually exclusive: " "you can pass ``--user``, or ``--home``, or ``--prefix`` and ``--exec-" @@ -589,11 +579,11 @@ msgstr "" "は ``--install-base`` と ``--install-platbase`` を指定できますが、それらグ" "ループを混ぜこぜには使えません。" -#: ../../install/index.rst:308 +#: ../../install/index.rst:297 msgid "Alternate installation: the user scheme" msgstr "別の場所へのインストール: user スキーム" -#: ../../install/index.rst:310 +#: ../../install/index.rst:299 msgid "" "This scheme is designed to be the most convenient solution for users that " "don't have write permission to the global site-packages directory or don't " @@ -603,83 +593,87 @@ msgstr "" "いユーザあるいはそこにインストールしたくないユーザに最も便利な解法となるよう" "デザインされています。簡単なオプションでこれが可能です::" -#: ../../install/index.rst:316 +#: ../../install/index.rst:305 msgid "" -"Files will be installed into subdirectories of :const:`site.USER_BASE` " +"Files will be installed into subdirectories of :data:`site.USER_BASE` " "(written as :file:`{userbase}` hereafter). This scheme installs pure Python " -"modules and extension modules in the same location (also known as :const:" -"`site.USER_SITE`). Here are the values for UNIX, including macOS:" -msgstr "" - -#: ../../install/index.rst:322 ../../install/index.rst:333 -#: ../../install/index.rst:384 ../../install/index.rst:433 -#: ../../install/index.rst:485 ../../install/index.rst:510 -#: ../../install/index.rst:746 ../../install/index.rst:758 +"modules and extension modules in the same location (also known as :data:" +"`site.USER_SITE`). Here are the values for UNIX, including Mac OS X:" +msgstr "" +"ファイルは :data:`site.USER_BASE` (以降 :file:`{userbase}` と書きます) のサブ" +"ディレクトリにインストールされます。このスキームでは pure Python モジュールと" +"拡張モジュールは(:data:`site.USER_SITE` としても知られる)同じ場所にインストー" +"ルされます。Mac OS X を含む UNIX の場合は下表の通りです:" + +#: ../../install/index.rst:311 ../../install/index.rst:322 +#: ../../install/index.rst:373 ../../install/index.rst:422 +#: ../../install/index.rst:474 ../../install/index.rst:499 +#: ../../install/index.rst:735 ../../install/index.rst:747 msgid "Type of file" msgstr "ファイルのタイプ" -#: ../../install/index.rst:322 ../../install/index.rst:333 -#: ../../install/index.rst:384 ../../install/index.rst:433 -#: ../../install/index.rst:485 +#: ../../install/index.rst:311 ../../install/index.rst:322 +#: ../../install/index.rst:373 ../../install/index.rst:422 +#: ../../install/index.rst:474 msgid "Installation directory" msgstr "インストールディレクトリ" -#: ../../install/index.rst:324 ../../install/index.rst:335 -#: ../../install/index.rst:386 ../../install/index.rst:487 +#: ../../install/index.rst:313 ../../install/index.rst:324 +#: ../../install/index.rst:375 ../../install/index.rst:476 msgid "modules" msgstr "モジュール" -#: ../../install/index.rst:324 +#: ../../install/index.rst:313 msgid ":file:`{userbase}/lib/python{X.Y}/site-packages`" msgstr ":file:`{userbase}/lib/python{X.Y}/site-packages`" -#: ../../install/index.rst:325 ../../install/index.rst:336 -#: ../../install/index.rst:387 ../../install/index.rst:437 -#: ../../install/index.rst:488 ../../install/index.rst:515 +#: ../../install/index.rst:314 ../../install/index.rst:325 +#: ../../install/index.rst:376 ../../install/index.rst:426 +#: ../../install/index.rst:477 ../../install/index.rst:504 msgid "scripts" msgstr "スクリプト" -#: ../../install/index.rst:325 +#: ../../install/index.rst:314 msgid ":file:`{userbase}/bin`" msgstr ":file:`{userbase}/bin`" -#: ../../install/index.rst:326 ../../install/index.rst:337 -#: ../../install/index.rst:388 ../../install/index.rst:438 -#: ../../install/index.rst:489 ../../install/index.rst:516 +#: ../../install/index.rst:315 ../../install/index.rst:326 +#: ../../install/index.rst:377 ../../install/index.rst:427 +#: ../../install/index.rst:478 ../../install/index.rst:505 msgid "data" msgstr "データ" -#: ../../install/index.rst:326 ../../install/index.rst:337 +#: ../../install/index.rst:315 ../../install/index.rst:326 msgid ":file:`{userbase}`" msgstr ":file:`{userbase}`" -#: ../../install/index.rst:327 ../../install/index.rst:338 -#: ../../install/index.rst:389 ../../install/index.rst:439 -#: ../../install/index.rst:490 ../../install/index.rst:517 +#: ../../install/index.rst:316 ../../install/index.rst:327 +#: ../../install/index.rst:378 ../../install/index.rst:428 +#: ../../install/index.rst:479 ../../install/index.rst:506 msgid "C headers" msgstr "C ヘッダー" -#: ../../install/index.rst:327 +#: ../../install/index.rst:316 msgid ":file:`{userbase}/include/python{X.Y}{abiflags}/{distname}`" msgstr ":file:`{userbase}/include/python{X.Y}{abiflags}/{distname}`" -#: ../../install/index.rst:330 +#: ../../install/index.rst:319 msgid "And here are the values used on Windows:" msgstr "Windows の場合は以下の通り:" -#: ../../install/index.rst:335 +#: ../../install/index.rst:324 msgid ":file:`{userbase}\\\\Python{XY}\\\\site-packages`" msgstr ":file:`{userbase}\\\\Python{XY}\\\\site-packages`" -#: ../../install/index.rst:336 +#: ../../install/index.rst:325 msgid ":file:`{userbase}\\\\Python{XY}\\\\Scripts`" msgstr ":file:`{userbase}\\\\Python{XY}\\\\Scripts`" -#: ../../install/index.rst:338 +#: ../../install/index.rst:327 msgid ":file:`{userbase}\\\\Python{XY}\\\\Include\\\\{distname}`" msgstr ":file:`{userbase}\\\\Python{XY}\\\\Include\\\\{distname}`" -#: ../../install/index.rst:341 +#: ../../install/index.rst:330 msgid "" "The advantage of using this scheme compared to the other ones described " "below is that the user site-packages directory is under normal conditions " @@ -692,7 +686,7 @@ msgstr "" "は :mod:`site` 参照)ということで、つまり :file:`setup.py` スクリプト後にイン" "ストールを完成させるための特別なステップが不要ということです。" -#: ../../install/index.rst:347 +#: ../../install/index.rst:336 msgid "" "The :command:`build_ext` command also has a ``--user`` option to add :file:" "`{userbase}/include` to the compiler search path for header files and :file:" @@ -704,11 +698,11 @@ msgstr "" "有ライブラリを探すためのパス(rpath)を追加するために、 :command:`build_ext` コ" "マンドには ``--user`` オプションがあります。" -#: ../../install/index.rst:356 +#: ../../install/index.rst:345 msgid "Alternate installation: the home scheme" msgstr "別の場所へのインストール: home スキーム" -#: ../../install/index.rst:358 +#: ../../install/index.rst:347 msgid "" "The idea behind the \"home scheme\" is that you build and maintain a " "personal stash of Python modules. This scheme's name is derived from the " @@ -724,11 +718,11 @@ msgstr "" "トするのはよくあることだからです。とはいえ、このスキームはどのオペレーティン" "グシステムのユーザでも使えます。" -#: ../../install/index.rst:365 +#: ../../install/index.rst:354 msgid "Installing a new module distribution is as simple as ::" msgstr "新たなモジュールのインストールは単純で ::" -#: ../../install/index.rst:369 +#: ../../install/index.rst:358 msgid "" "where you can supply any directory you like for the :option:`!--home` " "option. On Unix, lazy typists can just type a tilde (``~``); the :command:" @@ -740,15 +734,19 @@ msgstr "" "ん; :command:`install` コマンドがチルダをホームディレクトリに展開してくれま" "す::" -#: ../../install/index.rst:375 +#: ../../install/index.rst:364 msgid "" "To make Python find the distributions installed with this scheme, you may " -"have to :ref:`modify Python's search path ` or edit :mod:`!" -"sitecustomize` (see :mod:`site`) to call :func:`site.addsitedir` or edit :" +"have to :ref:`modify Python's search path ` or edit :mod:" +"`sitecustomize` (see :mod:`site`) to call :func:`site.addsitedir` or edit :" "data:`sys.path`." msgstr "" +"このスキームでインストールされた配布物を Python が見つけられるようにするため" +"に、 :ref:`Python サーチパスの変更 ` をするか、 :mod:" +"`sitecustomize` (:mod:`site` 参照) を編集して :func:`site.addsitedir` を呼び" +"出すか、 :data:`sys.path` を編集するかしないといけないかもしれません。" -#: ../../install/index.rst:380 +#: ../../install/index.rst:369 msgid "" "The :option:`!--home` option defines the installation base directory. Files " "are installed to the following directories under the installation base as " @@ -758,31 +756,31 @@ msgstr "" "す。\n" "ファイルはインストールベース下の以下のディレクトリに保存されます:" -#: ../../install/index.rst:386 +#: ../../install/index.rst:375 msgid ":file:`{home}/lib/python`" msgstr ":file:`{home}/lib/python`" -#: ../../install/index.rst:387 +#: ../../install/index.rst:376 msgid ":file:`{home}/bin`" msgstr ":file:`{home}/bin`" -#: ../../install/index.rst:388 +#: ../../install/index.rst:377 msgid ":file:`{home}`" msgstr ":file:`{home}`" -#: ../../install/index.rst:389 +#: ../../install/index.rst:378 msgid ":file:`{home}/include/python/{distname}`" msgstr ":file:`{home}/include/python/{distname}`" -#: ../../install/index.rst:392 +#: ../../install/index.rst:381 msgid "(Mentally replace slashes with backslashes if you're on Windows.)" msgstr "(Windows の場合はスラッシュをバックスラッシュに脳内変換)" -#: ../../install/index.rst:398 +#: ../../install/index.rst:387 msgid "Alternate installation: Unix (the prefix scheme)" msgstr "別の場所へのインストール: Unix (prefix スキーム)" -#: ../../install/index.rst:400 +#: ../../install/index.rst:389 msgid "" "The \"prefix scheme\" is useful when you wish to use one Python installation " "to perform the build/install (i.e., to run the setup script), but install " @@ -800,7 +798,7 @@ msgstr "" "にその通りです --- \"home スキーム\" を先に説明したのもそのためです。とはい" "え、prefix スキームが有用なケースは少なくとも二つあります。" -#: ../../install/index.rst:407 +#: ../../install/index.rst:396 msgid "" "First, consider that many Linux distributions put Python in :file:`/usr`, " "rather than the more traditional :file:`/usr/local`. This is entirely " @@ -817,7 +815,7 @@ msgstr "" "lib/python2.{X}` ではなく :file:`/usr/local/lib/python2.{X}` に置きたいと思う" "かもしれません。これを行うには、以下のように指定します ::" -#: ../../install/index.rst:416 +#: ../../install/index.rst:405 msgid "" "Another possibility is a network filesystem where the name used to write to " "a remote directory is different from the name used to read it: for example, " @@ -833,7 +831,7 @@ msgstr "" "所、例えば :file:`/mnt/{@server}/export/lib/python2.{X}` にインストールしなけ" "ればならないかもしれません。この場合には、以下のようにします ::" -#: ../../install/index.rst:425 +#: ../../install/index.rst:414 msgid "" "In either case, the :option:`!--prefix` option defines the installation " "base, and the :option:`!--exec-prefix` option defines the platform-specific " @@ -854,27 +852,27 @@ msgstr "" "prefix` になります。\n" "ファイルは以下のようにインストールされます:" -#: ../../install/index.rst:435 ../../install/index.rst:512 +#: ../../install/index.rst:424 ../../install/index.rst:501 msgid "Python modules" msgstr "pure Python モジュール" -#: ../../install/index.rst:436 ../../install/index.rst:513 +#: ../../install/index.rst:425 ../../install/index.rst:502 msgid "extension modules" msgstr "拡張モジュール" -#: ../../install/index.rst:437 +#: ../../install/index.rst:426 msgid ":file:`{prefix}/bin`" msgstr ":file:`{prefix}/bin`" -#: ../../install/index.rst:438 ../../install/index.rst:489 +#: ../../install/index.rst:427 ../../install/index.rst:478 msgid ":file:`{prefix}`" msgstr ":file:`{prefix}`" -#: ../../install/index.rst:439 +#: ../../install/index.rst:428 msgid ":file:`{prefix}/include/python{X.Y}{abiflags}/{distname}`" msgstr ":file:`{prefix}/include/python{X.Y}{abiflags}/{distname}`" -#: ../../install/index.rst:442 +#: ../../install/index.rst:431 msgid "" "There is no requirement that :option:`!--prefix` or :option:`!--exec-prefix` " "actually point to an alternate Python installation; if the directories " @@ -884,7 +882,7 @@ msgstr "" "Python の場所を指している必要はありません; 上に挙げたディレクトリがまだ存在し" "なければ、インストール時に作成されます。" -#: ../../install/index.rst:446 +#: ../../install/index.rst:435 msgid "" "Incidentally, the real reason the prefix scheme is important is simply that " "a standard Unix installation uses the prefix scheme, but with :option:`!--" @@ -901,7 +899,7 @@ msgstr "" "もしれませんが、 ``python setup.py install`` をオプションを何もつけずに実行" "していれば、常に prefix スキームを使っていることになるのです。" -#: ../../install/index.rst:453 +#: ../../install/index.rst:442 msgid "" "Note that installing extensions to an alternate Python installation has no " "effect on how those extensions are built: in particular, the Python header " @@ -927,11 +925,11 @@ msgstr "" "prefix` や :option:`!--exec-prefix` が別のインストール済み Python の場所すら" "指していなければどうにもなりません。)" -#: ../../install/index.rst:468 +#: ../../install/index.rst:457 msgid "Alternate installation: Windows (the prefix scheme)" msgstr "別の場所へのインストール (prefix を使う方法): Windows" -#: ../../install/index.rst:470 +#: ../../install/index.rst:459 msgid "" "Windows has no concept of a user's home directory, and since the standard " "Python installation under Windows is simpler than under Unix, the :option:" @@ -943,7 +941,7 @@ msgstr "" "で追加のパッケージを別の場所に入れる場合には、伝統的に :option:`!--prefix` が" "使われてきました。 ::" -#: ../../install/index.rst:477 +#: ../../install/index.rst:466 msgid "" "to install modules to the :file:`\\\\Temp\\\\Python` directory on the " "current drive." @@ -951,7 +949,7 @@ msgstr "" "とすると、モジュールを現在のドライブの :file:`\\\\Temp\\\\Python` ディレクト" "リにインストールします。" -#: ../../install/index.rst:479 +#: ../../install/index.rst:468 msgid "" "The installation base is defined by the :option:`!--prefix` option; the :" "option:`!--exec-prefix` option is not supported under Windows, which means " @@ -963,19 +961,19 @@ msgstr "" "ん。pure モジュールと拡張モジュールは同じ場所にインストールされます。ファイル" "は以下のような構成でインストールされます:" -#: ../../install/index.rst:488 +#: ../../install/index.rst:477 msgid ":file:`{prefix}\\\\Scripts`" msgstr ":file:`{prefix}\\\\Scripts`" -#: ../../install/index.rst:490 +#: ../../install/index.rst:479 msgid ":file:`{prefix}\\\\Include\\\\{distname}`" msgstr ":file:`{prefix}\\\\Include\\\\{distname}`" -#: ../../install/index.rst:497 +#: ../../install/index.rst:486 msgid "Custom Installation" msgstr "カスタムのインストール" -#: ../../install/index.rst:499 +#: ../../install/index.rst:488 msgid "" "Sometimes, the alternate installation schemes described in section :ref:" "`inst-alt-install` just don't do what you want. You might want to tweak " @@ -990,7 +988,7 @@ msgstr "" "らの場合にせよ、こうした操作では *カスタムのインストールスキーム* を作成する" "ことになります。" -#: ../../install/index.rst:505 +#: ../../install/index.rst:494 msgid "" "To create a custom installation scheme, you start with one of the alternate " "schemes and override some of the installation directories used for the " @@ -999,39 +997,39 @@ msgstr "" "カスタムインストールのためには、スキームの中のひとつから始めて、ファイルのタ" "イプごとに使われるインストールディレクトリを以下オプションで上書きします:" -#: ../../install/index.rst:510 +#: ../../install/index.rst:499 msgid "Override option" msgstr "上書きオプション" -#: ../../install/index.rst:512 +#: ../../install/index.rst:501 msgid "``--install-purelib``" msgstr "``--install-purelib``" -#: ../../install/index.rst:513 +#: ../../install/index.rst:502 msgid "``--install-platlib``" msgstr "``--install-platlib``" -#: ../../install/index.rst:514 +#: ../../install/index.rst:503 msgid "all modules" msgstr "全てのモジュール" -#: ../../install/index.rst:514 +#: ../../install/index.rst:503 msgid "``--install-lib``" msgstr "``--install-lib``" -#: ../../install/index.rst:515 +#: ../../install/index.rst:504 msgid "``--install-scripts``" msgstr "``--install-scripts``" -#: ../../install/index.rst:516 +#: ../../install/index.rst:505 msgid "``--install-data``" msgstr "``--install-data``" -#: ../../install/index.rst:517 +#: ../../install/index.rst:506 msgid "``--install-headers``" msgstr "``--install-headers``" -#: ../../install/index.rst:520 +#: ../../install/index.rst:509 msgid "" "These override options can be relative, absolute, or explicitly defined in " "terms of one of the installation base directories. (There are two " @@ -1051,7 +1049,7 @@ msgstr "" "で、この方法が pure モジュールと拡張モジュールのインストール先を同一とするよ" "うなスキームでは推奨されます)。" -#: ../../install/index.rst:529 +#: ../../install/index.rst:518 msgid "" "For example, say you're installing a module distribution to your home " "directory under Unix---but you want scripts to go in :file:`~/scripts` " @@ -1068,7 +1066,7 @@ msgstr "" "インストールベースディレクトリ (この場合にはホームディレクトリ) からの相対パ" "スとして解釈されます::" -#: ../../install/index.rst:538 +#: ../../install/index.rst:527 msgid "" "Another Unix example: suppose your Python installation was built and " "installed with a prefix of :file:`/usr/local/python`, so under a standard " @@ -1082,7 +1080,7 @@ msgstr "" "とします。 :file:`/usr/local/bin` に入るようにしたければ、絶対パスを :option:" "`!--install-scripts` オプションに与えて上書きすることになるでしょう::" -#: ../../install/index.rst:546 +#: ../../install/index.rst:535 msgid "" "(This performs an installation using the \"prefix scheme\", where the prefix " "is whatever your Python interpreter was installed with--- :file:`/usr/local/" @@ -1092,7 +1090,7 @@ msgstr "" "Python インタープリタがインストールされている場所 --- この例では :file:`/" "usr/local/python` --- になります。)" -#: ../../install/index.rst:550 +#: ../../install/index.rst:539 msgid "" "If you maintain Python on Windows, you might want third-party modules to " "live in a subdirectory of :file:`{prefix}`, rather than right in :file:" @@ -1109,7 +1107,7 @@ msgstr "" "のインストール先はただひとつのオプションで簡単にコントロールできる、というこ" "とだけです。" -#: ../../install/index.rst:559 +#: ../../install/index.rst:548 msgid "" "The specified installation directory is relative to :file:`{prefix}`. Of " "course, you also have to ensure that this directory is in Python's module " @@ -1123,7 +1121,7 @@ msgstr "" "のモジュール検索パスを修正する方法は、 :ref:`inst-search-path` 節を参照して" "ください。" -#: ../../install/index.rst:565 +#: ../../install/index.rst:554 msgid "" "If you want to define an entire installation scheme, you just have to supply " "all of the installation directory options. The recommended way to do this " @@ -1139,11 +1137,11 @@ msgstr "" "る各プラットフォームごとに別のディレクトリを置きたければ、以下のようにインス" "トールスキームを定義します::" -#: ../../install/index.rst:578 +#: ../../install/index.rst:567 msgid "or, equivalently, ::" msgstr "また、以下のようにも指定できます、 ::" -#: ../../install/index.rst:586 +#: ../../install/index.rst:575 msgid "" "``$PLAT`` is not (necessarily) an environment variable---it will be expanded " "by the Distutils as it parses your command line options, just as it does " @@ -1153,7 +1151,7 @@ msgstr "" "コマンドラインオプションの解釈と同じやり方で展開します。設定ファイルを解釈す" "る際と同じです。" -#: ../../install/index.rst:590 +#: ../../install/index.rst:579 msgid "" "Obviously, specifying the entire installation scheme every time you install " "a new module distribution would be very tedious. Thus, you can put these " @@ -1165,11 +1163,11 @@ msgstr "" "オプションは Distutils 設定ファイル (:ref:`inst-config-files` 参照) にも指定" "できます:" -#: ../../install/index.rst:603 +#: ../../install/index.rst:592 msgid "or, equivalently," msgstr "また、以下のようにも指定できます、 " -#: ../../install/index.rst:614 +#: ../../install/index.rst:603 msgid "" "Note that these two are *not* equivalent if you supply a different " "installation base directory when you run the setup script. For example, ::" @@ -1177,7 +1175,7 @@ msgstr "" "これら二つは、setup スクリプトを異なるインストールベースディレクトリから実行" "した場合には同じには *ならない* ので注意してください。例えば、 ::" -#: ../../install/index.rst:619 +#: ../../install/index.rst:608 msgid "" "would install pure modules to :file:`/tmp/python/lib` in the first case, and " "to :file:`/tmp/lib` in the second case. (For the second case, you probably " @@ -1187,7 +1185,7 @@ msgstr "" "り、二番目の書き方では :file:`/tmp/lib` に入ります。(二番目のケースでは、イン" "ストールベースを :file:`/tmp/python` に指定しようと考えるでしょう。)" -#: ../../install/index.rst:623 +#: ../../install/index.rst:612 msgid "" "You probably noticed the use of ``$HOME`` and ``$PLAT`` in the sample " "configuration file input. These are Distutils configuration variables, " @@ -1208,7 +1206,7 @@ msgstr "" "Distutils が提供しているものだけです。) 詳細は :ref:`inst-config-files` を参" "照してください。" -#: ../../install/index.rst:633 +#: ../../install/index.rst:622 msgid "" "When a :ref:`virtual environment ` is activated, any options that " "change the installation path will be ignored from all distutils " @@ -1219,11 +1217,11 @@ msgstr "" "ロジェクトをインストールしてしまうことを避けるために、インストールパスを変更" "するあらゆるオプションは distutils の全ての設定ファイルによって無視されます。" -#: ../../install/index.rst:647 +#: ../../install/index.rst:636 msgid "Modifying Python's Search Path" msgstr "Python サーチパスの変更" -#: ../../install/index.rst:649 +#: ../../install/index.rst:638 msgid "" "When the Python interpreter executes an :keyword:`import` statement, it " "searches for both Python code and extension modules along a search path. A " @@ -1237,12 +1235,12 @@ msgstr "" "す。検索パスは、 :mod:`sys` を import して、 ``sys.path`` を出力すればわかり" "ます。 ::" -#: ../../install/index.rst:666 +#: ../../install/index.rst:655 msgid "" "The null string in ``sys.path`` represents the current working directory." msgstr "``sys.path`` 内の空文字列は、現在の作業ディレクトリを表します。" -#: ../../install/index.rst:668 +#: ../../install/index.rst:657 msgid "" "The expected convention for locally installed packages is to put them in " "the :file:`{...}/site-packages/` directory, but you may want to install " @@ -1261,7 +1259,7 @@ msgstr "" "path`` に追加せねばなりません。ディレクトリを検索パスに追加するには、いくつか" "の異なる方法が存在します。" -#: ../../install/index.rst:676 +#: ../../install/index.rst:665 msgid "" "The most convenient way is to add a path configuration file to a directory " "that's already on Python's path, usually to the :file:`.../site-packages/` " @@ -1279,7 +1277,7 @@ msgstr "" "のモジュールセットを上書きすることはありません。つまり、このメカニズムを使っ" "て、標準モジュールに対する修正版のインストールはできないということです。)" -#: ../../install/index.rst:684 +#: ../../install/index.rst:673 msgid "" "Paths can be absolute or relative, in which case they're relative to the " "directory containing the :file:`.pth` file. See the documentation of the :" @@ -1289,7 +1287,7 @@ msgstr "" "のあるパスからの相対になります。詳しくは :mod:`site` モジュールを参照してくだ" "さい。" -#: ../../install/index.rst:688 +#: ../../install/index.rst:677 msgid "" "A slightly less convenient way is to edit the :file:`site.py` file in " "Python's standard library, and modify ``sys.path``. :file:`site.py` is " @@ -1303,15 +1301,19 @@ msgstr "" "行される際に自動的に import されます。ただし、設定するには、単に :file:" "`site.py` を編集して、例えば以下のような二行を加えます:" -#: ../../install/index.rst:699 +#: ../../install/index.rst:688 msgid "" -"However, if you reinstall the same minor version of Python (perhaps when " +"However, if you reinstall the same major version of Python (perhaps when " "upgrading from 2.2 to 2.2.2, for example) :file:`site.py` will be " "overwritten by the stock version. You'd have to remember that it was " "modified and save a copy before doing the installation." msgstr "" +"しかしながら、(例えば 2.2 から 2.2.2 にアップグレードするときのように) 同じメ" +"ジャーバージョンの Python を再インストールすると、 :file:`site.py` は手持ちの" +"バージョンで上書きされてしまいます。ファイルが変更されていることを覚えてお" +"き、インストールを行う前にコピーを忘れずとっておかねばなりません。" -#: ../../install/index.rst:704 +#: ../../install/index.rst:693 msgid "" "There are two environment variables that can modify ``sys.path``. :envvar:" "`PYTHONHOME` sets an alternate value for the prefix of the Python " @@ -1325,7 +1327,7 @@ msgstr "" "検索パスは ``['', '/www/python/lib/pythonX.Y/', '/www/python/lib/pythonX.Y/" "plat-linux2', ...]`` といった具合になります。" -#: ../../install/index.rst:710 +#: ../../install/index.rst:699 msgid "" "The :envvar:`PYTHONPATH` variable can be set to a list of paths that will be " "added to the beginning of ``sys.path``. For example, if :envvar:" @@ -1340,7 +1342,7 @@ msgstr "" "ディレクトリを追加するには、そのディレクトリが実在しなければなりません; :mod:" "`site` は実在しないディレクトリを除去します。)" -#: ../../install/index.rst:717 +#: ../../install/index.rst:706 msgid "" "Finally, ``sys.path`` is just a regular Python list, so any Python " "application can modify it by adding or removing entries." @@ -1348,11 +1350,11 @@ msgstr "" "最後に、``sys.path`` はただの普通の Python のリストなので、どんな Python アプ" "リケーションもエントリを追加したり除去したりといった修正を行えます。" -#: ../../install/index.rst:724 +#: ../../install/index.rst:713 msgid "Distutils Configuration Files" msgstr "Distutils 設定ファイル" -#: ../../install/index.rst:726 +#: ../../install/index.rst:715 msgid "" "As mentioned above, you can use Distutils configuration files to record " "personal or site preferences for any Distutils options. That is, any option " @@ -1372,81 +1374,81 @@ msgstr "" "の設定ファイルが適用されると、\"先に\" 適用されたファイルに指定されていた値" "は \"後に\" 適用されたファイル内の値で上書きされます。" -#: ../../install/index.rst:739 +#: ../../install/index.rst:728 msgid "Location and names of config files" msgstr "設定ファイルの場所と名前" -#: ../../install/index.rst:741 +#: ../../install/index.rst:730 msgid "" "The names and locations of the configuration files vary slightly across " -"platforms. On Unix and macOS, the three configuration files (in the order " -"they are processed) are:" +"platforms. On Unix and Mac OS X, the three configuration files (in the " +"order they are processed) are:" msgstr "" "設定ファイルの名前と場所は、非常にわずかですがプラットフォーム間で異なりま" -"す。Unix と macOS では、三種類の設定ファイルは以下のようになります (処理され" -"る順に並んでいます):" +"す。Unix と Mac OS X では、三種類の設定ファイルは以下のようになります (処理さ" +"れる順に並んでいます):" -#: ../../install/index.rst:746 ../../install/index.rst:758 +#: ../../install/index.rst:735 ../../install/index.rst:747 msgid "Location and filename" msgstr "場所とファイル名" -#: ../../install/index.rst:748 ../../install/index.rst:760 +#: ../../install/index.rst:737 ../../install/index.rst:749 msgid "system" msgstr "system" -#: ../../install/index.rst:748 +#: ../../install/index.rst:737 msgid ":file:`{prefix}/lib/python{ver}/distutils/distutils.cfg`" msgstr ":file:`{prefix}/lib/python{ver}/distutils/distutils.cfg`" -#: ../../install/index.rst:750 ../../install/index.rst:762 +#: ../../install/index.rst:739 ../../install/index.rst:751 msgid "personal" msgstr "personal" -#: ../../install/index.rst:750 +#: ../../install/index.rst:739 msgid ":file:`$HOME/.pydistutils.cfg`" msgstr ":file:`$HOME/.pydistutils.cfg`" -#: ../../install/index.rst:752 ../../install/index.rst:764 +#: ../../install/index.rst:741 ../../install/index.rst:753 msgid "local" msgstr "local" -#: ../../install/index.rst:752 ../../install/index.rst:764 +#: ../../install/index.rst:741 ../../install/index.rst:753 msgid ":file:`setup.cfg`" msgstr ":file:`setup.cfg`" -#: ../../install/index.rst:752 ../../install/index.rst:764 +#: ../../install/index.rst:741 ../../install/index.rst:753 msgid "\\(3)" msgstr "\\(3)" -#: ../../install/index.rst:755 +#: ../../install/index.rst:744 msgid "And on Windows, the configuration files are:" msgstr "Windows では設定ファイルは以下のようになります:" -#: ../../install/index.rst:760 +#: ../../install/index.rst:749 msgid ":file:`{prefix}\\\\Lib\\\\distutils\\\\distutils.cfg`" msgstr ":file:`{prefix}\\\\Lib\\\\distutils\\\\distutils.cfg`" -#: ../../install/index.rst:760 +#: ../../install/index.rst:749 msgid "\\(4)" msgstr "\\(4)" -#: ../../install/index.rst:762 +#: ../../install/index.rst:751 msgid ":file:`%HOME%\\\\pydistutils.cfg`" msgstr ":file:`%HOME%\\\\pydistutils.cfg`" -#: ../../install/index.rst:762 +#: ../../install/index.rst:751 msgid "\\(5)" msgstr "\\(5)" -#: ../../install/index.rst:767 +#: ../../install/index.rst:756 msgid "" "On all platforms, the \"personal\" file can be temporarily disabled by " -"passing the ``--no-user-cfg`` option." +"passing the `--no-user-cfg` option." msgstr "" -"全てのプラットフォームにおいて、\"個人の\" ファイルは ``--no-user-cfg`` オプ" +"全てのプラットフォームにおいて、\"個人の\" ファイルは `--no-user-cfg` オプ" "ションを使って一時的に無効にすることができます。" -#: ../../install/index.rst:773 +#: ../../install/index.rst:762 msgid "" "Strictly speaking, the system-wide configuration file lives in the directory " "where the Distutils are installed; under Python 1.6 and later on Unix, this " @@ -1460,20 +1462,24 @@ msgstr "" "site-packages/distutils` にインストールされるため、 Python 1.5.2 では設定ファ" "イルをそこに置かなければなりません。" -#: ../../install/index.rst:780 +#: ../../install/index.rst:769 msgid "" "On Unix, if the :envvar:`HOME` environment variable is not defined, the " -"user's home directory will be determined with the :func:`~pwd.getpwuid` " -"function from the standard :mod:`pwd` module. This is done by the :func:`os." -"path.expanduser` function used by Distutils." +"user's home directory will be determined with the :func:`getpwuid` function " +"from the standard :mod:`pwd` module. This is done by the :func:`os.path." +"expanduser` function used by Distutils." msgstr "" +"Unixでは、環境変数 :envvar:`HOME` が定義されていない場合、標準モジュール :" +"mod:`pwd` の :func:`getpwuid` 関数を使ってユーザのホームディレクトリを決定し" +"ます。このとき同時に Distutils によって :func:`os.path.expanduser` が実行され" +"ます。" -#: ../../install/index.rst:786 +#: ../../install/index.rst:775 msgid "" "I.e., in the current directory (usually the location of the setup script)." msgstr "現在のディレクトリ (通常は setup スクリプトがある場所) です。" -#: ../../install/index.rst:789 +#: ../../install/index.rst:778 msgid "" "(See also note (1).) Under Python 1.6 and later, Python's default " "\"installation prefix\" is :file:`C:\\\\Python`, so the system configuration " @@ -1493,7 +1499,7 @@ msgstr "" "Python 1.5.2 では :file:`C:\\\\Program Files\\\\Python\\\\distutils\\" "\\distutils.cfg` になります。" -#: ../../install/index.rst:798 +#: ../../install/index.rst:787 msgid "" "On Windows, if the :envvar:`HOME` environment variable is not defined, :" "envvar:`USERPROFILE` then :envvar:`HOMEDRIVE` and :envvar:`HOMEPATH` will be " @@ -1504,11 +1510,11 @@ msgstr "" "`USERPROFILE` 、 :envvar:`HOMEDRIVE` 、 :envvar:`HOMEPATH` を順々に試します。" "このとき同時に Distutils によって :func:`os.path.expanduser` が実行されます。" -#: ../../install/index.rst:807 +#: ../../install/index.rst:796 msgid "Syntax of config files" msgstr "設定ファイルの構文" -#: ../../install/index.rst:809 +#: ../../install/index.rst:798 msgid "" "The Distutils configuration files all have the same syntax. The config " "files are grouped into sections. There is one section for each Distutils " @@ -1522,7 +1528,7 @@ msgstr "" "``global`` セクションがあります。各セクションには ``option=value`` の形で、一" "行あたり一つのオプションを指定します。" -#: ../../install/index.rst:814 +#: ../../install/index.rst:803 msgid "" "For example, the following is a complete config file that just forces all " "commands to run quietly by default:" @@ -1530,7 +1536,7 @@ msgstr "" "例えば、以下は全てのコマンドに対してデフォルトでメッセージを出さないよう強制" "するための完全な設定ファイルです:" -#: ../../install/index.rst:822 +#: ../../install/index.rst:811 msgid "" "If this is installed as the system config file, it will affect all " "processing of any Python module distribution by any user on the current " @@ -1546,7 +1552,7 @@ msgstr "" "配布物にのみ影響します。この内容を特定のモジュール配布物の :file:`setup.cfg` " "として使えば、その配布物だけに影響します。" -#: ../../install/index.rst:829 +#: ../../install/index.rst:818 msgid "" "You could override the default \"build base\" directory and make the :" "command:`build\\*` commands always forcibly rebuild all files with the " @@ -1556,11 +1562,11 @@ msgstr "" "したり、 :command:`build\\*` コマンドが常に強制的にリビルドを行うようにもでき" "ます:" -#: ../../install/index.rst:839 +#: ../../install/index.rst:828 msgid "which corresponds to the command-line arguments ::" msgstr "この設定は、コマンドライン引数の ::" -#: ../../install/index.rst:843 +#: ../../install/index.rst:832 msgid "" "except that including the :command:`build` command on the command-line means " "that command will be run. Including a particular command in config files " @@ -1576,7 +1582,7 @@ msgstr "" "行した場合、それらのコマンドもまた設定ファイル内の対応するオプションの値を使" "います。)" -#: ../../install/index.rst:849 +#: ../../install/index.rst:838 msgid "" "You can find out the complete list of options for any command using the :" "option:`!--help` option, e.g.::" @@ -1584,7 +1590,7 @@ msgstr "" "あるコマンドに対するオプションの完全なリストは、例えば以下のように、 :option:" "`!--help` を使って調べます::" -#: ../../install/index.rst:854 +#: ../../install/index.rst:843 msgid "" "and you can find out the complete list of global options by using :option:" "`!--help` without a command::" @@ -1592,7 +1598,7 @@ msgstr "" "グローバルオプションの完全なリストを得るには、コマンドを指定せずに :option:" "`!--help` オプションを使います::" -#: ../../install/index.rst:859 +#: ../../install/index.rst:848 msgid "" "See also the \"Reference\" section of the \"Distributing Python Modules\" " "manual." @@ -1600,11 +1606,11 @@ msgstr "" "\"Python モジュールの配布\" マニュアルの、\"リファレンスマニュアル\" の節も参" "照してください。" -#: ../../install/index.rst:865 +#: ../../install/index.rst:854 msgid "Building Extensions: Tips and Tricks" msgstr "拡張モジュールのビルド: 小技と豆知識" -#: ../../install/index.rst:867 +#: ../../install/index.rst:856 msgid "" "Whenever possible, the Distutils try to use the configuration information " "made available by the Python interpreter used to run the :file:`setup.py` " @@ -1620,11 +1626,11 @@ msgstr "" "ると不適切な設定になることもあります。この節では、通常の Distutils の動作を" "オーバライドする方法について議論します。" -#: ../../install/index.rst:878 +#: ../../install/index.rst:867 msgid "Tweaking compiler/linker flags" msgstr "コンパイラ/リンカのフラグをいじるには" -#: ../../install/index.rst:880 +#: ../../install/index.rst:869 msgid "" "Compiling a Python extension written in C or C++ will sometimes require " "specifying custom flags for the compiler and linker in order to use a " @@ -1638,7 +1644,7 @@ msgstr "" "のプラットフォームではテストされていなかったり、クロスコンパイルを行わねばな" "らない場合にはこれが当てはまります。" -#: ../../install/index.rst:886 +#: ../../install/index.rst:875 msgid "" "In the most general case, the extension author might have foreseen that " "compiling the extensions would be complicated, and provided a :file:`Setup` " @@ -1653,7 +1659,7 @@ msgstr "" "めに細かくフラグをセットする必要があるような場合にのみ行うことになるでしょ" "う。" -#: ../../install/index.rst:892 +#: ../../install/index.rst:881 msgid "" "A :file:`Setup` file, if present, is parsed in order to get a list of " "extensions to build. Each line in a :file:`Setup` describes a single " @@ -1663,11 +1669,11 @@ msgstr "" "得るために解釈されます。 :file:`Setup` ファイルの各行には単一のモジュールを書" "きます。各行は以下のような構造をとります::" -#: ../../install/index.rst:899 +#: ../../install/index.rst:888 msgid "Let's examine each of the fields in turn." msgstr "次に、各フィールドについて見てみましょう。" -#: ../../install/index.rst:901 +#: ../../install/index.rst:890 msgid "" "*module* is the name of the extension module to be built, and should be a " "valid Python identifier. You can't just change this in order to rename a " @@ -1679,7 +1685,7 @@ msgstr "" "ない (ソースコードの編集も必要です) ので、このフィールドに手を加えるべきでは" "ありません。" -#: ../../install/index.rst:905 +#: ../../install/index.rst:894 msgid "" "*sourcefile* is anything that's likely to be a source code file, at least " "judging by the filename. Filenames ending in :file:`.c` are assumed to be " @@ -1693,7 +1699,7 @@ msgstr "" "るファイルは C++ で書かれているとみなされます。 :file:`.m` や :file:`.mm` で" "終わるファイルは Objective C で書かれているとみなされます。" -#: ../../install/index.rst:911 +#: ../../install/index.rst:900 msgid "" "*cpparg* is an argument for the C preprocessor, and is anything starting " "with :option:`!-I`, :option:`!-D`, :option:`!-U` or :option:`!-C`." @@ -1701,7 +1707,7 @@ msgstr "" "*cpparg* は C プリプロセッサへの引数で、 :option:`!-I` 、 :option:`!-D` 、 :" "option:`!-U` または :option:`!-C` のいずれかから始まる文字列です。" -#: ../../install/index.rst:914 +#: ../../install/index.rst:903 msgid "" "*library* is anything ending in :file:`.a` or beginning with :option:`!-l` " "or :option:`!-L`." @@ -1709,7 +1715,7 @@ msgstr "" "*library* は :file:`.a` で終わるか、 :option:`!-l` または :option:`!-L` のい" "ずれかから始まる文字列です。" -#: ../../install/index.rst:917 +#: ../../install/index.rst:906 msgid "" "If a particular platform requires a special library on your platform, you " "can add it by editing the :file:`Setup` file and running ``python setup.py " @@ -1719,7 +1725,7 @@ msgstr "" "場合、 :file:`Setup` ファイルを編集して ``python setup.py build`` を実行すれ" "ばライブラリを追加できます。例えば、以下の行 ::" -#: ../../install/index.rst:923 +#: ../../install/index.rst:912 msgid "" "must be linked with the math library :file:`libm.a` on your platform, simply " "add :option:`!-lm` to the line::" @@ -1728,7 +1734,7 @@ msgstr "" "`libm.a` とリンクしなければならない場合、 :file:`Setup` 内の行に :option:`!-" "lm` を追加するだけです::" -#: ../../install/index.rst:928 +#: ../../install/index.rst:917 msgid "" "Arbitrary switches intended for the compiler or the linker can be supplied " "with the :option:`!-Xcompiler` *arg* and :option:`!-Xlinker` *arg* options::" @@ -1736,7 +1742,7 @@ msgstr "" "コンパイラやリンカ向けの任意のスイッチオプションは、 :option:`!-Xcompiler` " "*arg* や :option:`!-Xlinker` *arg* オプションで与えます::" -#: ../../install/index.rst:933 +#: ../../install/index.rst:922 msgid "" "The next option after :option:`!-Xcompiler` and :option:`!-Xlinker` will be " "appended to the proper command line, so in the above example the compiler " @@ -1753,7 +1759,7 @@ msgstr "" "プションを与えます; 例えば、 ``-x c++`` を渡すには、 :file:`Setup` ファイルに" "は ``-Xcompiler -x -Xcompiler c++`` を渡さねばなりません。" -#: ../../install/index.rst:940 +#: ../../install/index.rst:929 msgid "" "Compiler flags can also be supplied through setting the :envvar:`CFLAGS` " "environment variable. If set, the contents of :envvar:`CFLAGS` will be " @@ -1763,20 +1769,20 @@ msgstr "" "envvar:`CFLAGS` が設定されていれば、 :file:`Setup` ファイル内で指定されている" "コンパイラフラグに :envvar:`CFLAGS` の内容が追加されます。" -#: ../../install/index.rst:948 +#: ../../install/index.rst:937 msgid "Using non-Microsoft compilers on Windows" msgstr "Windows で非 Microsoft コンパイラを使ってビルドするには" -#: ../../install/index.rst:955 +#: ../../install/index.rst:944 msgid "Borland/CodeGear C++" msgstr "Borland/CodeGear C++" -#: ../../install/index.rst:957 +#: ../../install/index.rst:946 msgid "" "This subsection describes the necessary steps to use Distutils with the " "Borland C++ compiler version 5.5. First you have to know that Borland's " "object file format (OMF) is different from the format used by the Python " -"version you can download from the Python or ActiveState web site. (Python " +"version you can download from the Python or ActiveState Web site. (Python " "is built with Microsoft Visual C++, which uses COFF as the object file " "format.) For this reason you have to convert Python's library :file:" "`python25.lib` into the Borland format. You can do this as follows:" @@ -1790,7 +1796,7 @@ msgstr "" "うにして、 Python のライブラリ :file:`python25.lib` を Borland の形式に変換" "する必要があります:" -#: ../../install/index.rst:972 +#: ../../install/index.rst:961 msgid "" "The :file:`coff2omf` program comes with the Borland compiler. The file :" "file:`python25.lib` is in the :file:`Libs` directory of your Python " @@ -1802,7 +1808,7 @@ msgstr "" "リ内にあります。拡張モジュールで他のライブラリ (zlib, ...) を使っている場合、" "それらのライブラリも変換しなければなりません。" -#: ../../install/index.rst:977 +#: ../../install/index.rst:966 msgid "" "The converted files have to reside in the same directories as the normal " "libraries." @@ -1810,7 +1816,7 @@ msgstr "" "変換されたファイルは、通常のライブラリと同じディレクトリに置かねばなりませ" "ん。" -#: ../../install/index.rst:980 +#: ../../install/index.rst:969 msgid "" "How does Distutils manage to use these libraries with their changed names? " "If the extension needs a library (eg. :file:`foo`) Distutils checks first if " @@ -1825,7 +1831,7 @@ msgstr "" "するライブラリがなければ、デフォルトの名前 (:file:`foo.lib`) を使います。 " "[#]_" -#: ../../install/index.rst:986 +#: ../../install/index.rst:975 msgid "" "To let Distutils compile your extension with Borland C++ you now have to " "type::" @@ -1833,7 +1839,7 @@ msgstr "" "Borland C++ を使って Distutils に拡張モジュールをコンパイルさせるには、以下の" "ように入力します::" -#: ../../install/index.rst:990 +#: ../../install/index.rst:979 msgid "" "If you want to use the Borland C++ compiler as the default, you could " "specify this in your personal or system-wide configuration file for " @@ -1843,11 +1849,11 @@ msgstr "" "けに、 Distutils の設定ファイルを書くことを検討した方がよいでしょう (:ref:" "`inst-config-files` 節を参照してください)。" -#: ../../install/index.rst:999 +#: ../../install/index.rst:988 msgid "`C++Builder Compiler `_" msgstr "`C++Builder Compiler `_" -#: ../../install/index.rst:998 +#: ../../install/index.rst:987 msgid "" "Information about the free C++ compiler from Borland, including links to the " "download pages." @@ -1855,7 +1861,7 @@ msgstr "" "Borland によるフリーの C++ コンパイラに関する情報で、コンパイラのダウンロード" "ページへのリンクもあります。" -#: ../../install/index.rst:1002 +#: ../../install/index.rst:991 msgid "" "`Creating Python Extensions Using Borland's Free Compiler `_" @@ -1863,7 +1869,7 @@ msgstr "" "`Creating Python Extensions Using Borland's Free Compiler `_" -#: ../../install/index.rst:1002 +#: ../../install/index.rst:991 msgid "" "Document describing how to use Borland's free command-line C++ compiler to " "build Python." @@ -1871,11 +1877,11 @@ msgstr "" "Borland 製のフリーのコマンドライン C++ を使って Python をビルドする方法につい" "て述べたドキュメントです。" -#: ../../install/index.rst:1007 +#: ../../install/index.rst:996 msgid "GNU C / Cygwin / MinGW" msgstr "GNU C / Cygwin / MinGW" -#: ../../install/index.rst:1009 +#: ../../install/index.rst:998 msgid "" "This section describes the necessary steps to use Distutils with the GNU C/C+" "+ compilers in their Cygwin and MinGW distributions. [#]_ For a Python " @@ -1887,7 +1893,7 @@ msgstr "" "インタプリタを使っているなら、以下の手順をとらなくても Distutils はまったく問" "題なく動作します。" -#: ../../install/index.rst:1014 +#: ../../install/index.rst:1003 msgid "" "Not all extensions can be built with MinGW or Cygwin, but many can. " "Extensions most likely to not work are those that use C++ or depend on " @@ -1897,19 +1903,19 @@ msgstr "" "くの場合はビルドできます。ビルドできない拡張ライブラリは、大抵C++を利用してい" "たり Microsoft Visual Cの拡張に依存していたりします。" -#: ../../install/index.rst:1018 +#: ../../install/index.rst:1007 msgid "To let Distutils compile your extension with Cygwin you have to type::" msgstr "" "distutils に Cygwin を使って拡張をコンパイルさせるには次のようにタイプしま" "す::" -#: ../../install/index.rst:1022 +#: ../../install/index.rst:1011 msgid "and for Cygwin in no-cygwin mode [#]_ or for MinGW type::" msgstr "" "Cygwin を no-cygwin モード [#]_ で使うときや MinGW を使うときは次のようにしま" "す::" -#: ../../install/index.rst:1026 +#: ../../install/index.rst:1015 msgid "" "If you want to use any of these options/compilers as default, you should " "consider writing it in your personal or system-wide configuration file for " @@ -1919,11 +1925,11 @@ msgstr "" "るいはシステム全体用の設定ファイルを書くことを検討するべきです。 (:ref:`inst-" "config-files` を参照してください)" -#: ../../install/index.rst:1031 +#: ../../install/index.rst:1020 msgid "Older Versions of Python and MinGW" msgstr "古いバージョンの Python と MinGW" -#: ../../install/index.rst:1032 +#: ../../install/index.rst:1021 msgid "" "The following instructions only apply if you're using a version of Python " "inferior to 2.4.1 with a MinGW inferior to 3.0.0 (with " @@ -1932,7 +1938,7 @@ msgstr "" "以下の手順は Python 2.4.1 以前と MinGW 3.0.0 (binutils-2.13.90-20030111-1) 以" "前を利用しているときのものです。" -#: ../../install/index.rst:1036 +#: ../../install/index.rst:1025 msgid "" "These compilers require some special libraries. This task is more complex " "than for Borland's C++, because there is no program to convert the library. " @@ -1947,7 +1953,7 @@ msgstr "" "https://sourceforge.net/projects/mingw/files/MinGW/Extension/pexports/%20%E3%81%8B%E3%82%89%E5%85%A5" "手できます。)" -#: ../../install/index.rst:1049 +#: ../../install/index.rst:1038 msgid "" "The location of an installed :file:`python25.dll` will depend on the " "installation options and the version and language of Windows. In a \"just " @@ -1960,14 +1966,14 @@ msgstr "" "には、インストールディレクトリのルートに配置されます。共有インストールの場合" "にはシステムディレクトリに配置されます。" -#: ../../install/index.rst:1054 +#: ../../install/index.rst:1043 msgid "" "Then you can create from these information an import library for gcc. ::" msgstr "" "これで、上で得られた情報をもとに、gcc 用の import ライブラリを作成できま" "す。 ::" -#: ../../install/index.rst:1058 +#: ../../install/index.rst:1047 msgid "" "The resulting library has to be placed in the same directory as :file:" "`python25.lib`. (Should be the :file:`libs` directory under your Python " @@ -1977,7 +1983,7 @@ msgstr "" "ればなりません。 (Python インストールディレクトリの :file:`libs` ディレクトリ" "になるはずです。)" -#: ../../install/index.rst:1062 +#: ../../install/index.rst:1051 msgid "" "If your extension uses other libraries (zlib,...) you might have to convert " "them too. The converted files have to reside in the same directories as the " @@ -1987,24 +1993,24 @@ msgstr "" "リも変換しなければなりません。変換されたファイルは、それぞれ通常のライブラリ" "が置かれているのと同じディレクトリに置かねばなりません。" -#: ../../install/index.rst:1069 +#: ../../install/index.rst:1058 msgid "" -"`Building Python modules on MS Windows platform with MinGW `_" +"`Building Python modules on MS Windows platform with MinGW `_" msgstr "" -"`Building Python modules on MS Windows platform with MinGW `_" +"`Building Python modules on MS Windows platform with MinGW `_" -#: ../../install/index.rst:1070 +#: ../../install/index.rst:1059 msgid "" "Information about building the required libraries for the MinGW environment." msgstr "MinGW 環境で必要なライブラリのビルドに関する情報があります。" -#: ../../install/index.rst:1074 +#: ../../install/index.rst:1063 msgid "Footnotes" msgstr "脚注" -#: ../../install/index.rst:1075 +#: ../../install/index.rst:1064 msgid "" "This also means you could replace all existing COFF-libraries with OMF-" "libraries of the same name." @@ -2012,13 +2018,13 @@ msgstr "" "つまり、全ての既存の COFF ライブラリを同名の OMF ライブラリに置き換えてもかま" "わないということです。" -#: ../../install/index.rst:1078 +#: ../../install/index.rst:1067 msgid "Check https://www.sourceware.org/cygwin/ for more information" msgstr "" "より詳細な情報については https://www.sourceware.org/cygwin/ を参照して下さ" "い。" -#: ../../install/index.rst:1080 +#: ../../install/index.rst:1069 msgid "" "Then you have no POSIX emulation available, but you also don't need :file:" "`cygwin1.dll`." diff --git a/installing/index.po b/installing/index.po index 8d3b33d4e..263e9fb36 100644 --- a/installing/index.po +++ b/installing/index.po @@ -1,28 +1,34 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 -# 菊池 健志, 2023 -# Arihiro TAKASE, 2023 -# 石井明久, 2024 +# Shun Sakurai, 2017 +# NOZOMI KAWAMOTO <73circumference14@gmail.com>, 2017 +# Arihiro TAKASE, 2017 +# mnamihdk, 2017 +# E. Kawashima, 2017 +# 秘湯 , 2017 +# Osamu NAKAMURA, 2017 +# Inada Naoki , 2017 +# yuji takesue , 2018 +# tomo, 2019 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-13 14:21+0000\n" -"PO-Revision-Date: 2021-06-28 00:54+0000\n" -"Last-Translator: 石井明久, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 17:46+0000\n" +"Last-Translator: tomo, 2019\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../installing/index.rst:7 @@ -62,14 +68,14 @@ msgstr "" #: ../../installing/index.rst:20 msgid "" "This guide covers the installation part of the process. For a guide to " -"creating and sharing your own Python projects, refer to the `Python " -"packaging user guide`_." +"creating and sharing your own Python projects, refer to the :ref:" +"`distribution guide `." msgstr "" "このガイドはこれらプロセスのうち、インストールについてをカバーします。あなた" -"自身の Python プロジェクトを作成し、共有するためのガイドについては `Python " -"packaging user guide`_ を参照してください。" +"自身の Python プロジェクトを作成し、シェアするためのガイドについては :ref:" +"`distribution guide ` を参照してください。" -#: ../../installing/index.rst:28 +#: ../../installing/index.rst:26 msgid "" "For corporate and other institutional users, be aware that many " "organisations have their own policies around using and contributing to open " @@ -81,11 +87,11 @@ msgstr "" "Python によって提供される配布とインストールのツールを利用する際には、そのよう" "なポリシーを考慮に入れてください。" -#: ../../installing/index.rst:35 +#: ../../installing/index.rst:33 msgid "Key terms" msgstr "重要用語集" -#: ../../installing/index.rst:37 +#: ../../installing/index.rst:35 msgid "" "``pip`` is the preferred installer program. Starting with Python 3.4, it is " "included by default with the Python binary installers." @@ -93,7 +99,7 @@ msgstr "" "``pip`` は推奨されるインストーラ・プログラムです。 Python 3.4 からは、 " "Python バイナリ・インストーラに最初から付属するようになりました。" -#: ../../installing/index.rst:39 +#: ../../installing/index.rst:37 msgid "" "A *virtual environment* is a semi-isolated Python environment that allows " "packages to be installed for use by a particular application, rather than " @@ -103,7 +109,7 @@ msgstr "" "ンで使用するためにパッケージをインストールできるようにする半独立型のPython環" "境です。" -#: ../../installing/index.rst:42 +#: ../../installing/index.rst:40 msgid "" "``venv`` is the standard tool for creating virtual environments, and has " "been part of Python since Python 3.3. Starting with Python 3.4, it defaults " @@ -113,7 +119,7 @@ msgstr "" "部になりました。 Python 3.4 以降では、仮想環境をつくる際はそのすべてで " "``pip`` をインストールするように、あらかじめ設定されています。" -#: ../../installing/index.rst:45 +#: ../../installing/index.rst:43 msgid "" "``virtualenv`` is a third party alternative (and predecessor) to ``venv``. " "It allows virtual environments to be used on versions of Python prior to " @@ -126,29 +132,31 @@ msgstr "" "以前のバージョンは ``venv`` を提供していませんし、作成された環境に ``pip`` を" "自動的にインストールすることも出来ません。" -#: ../../installing/index.rst:49 +#: ../../installing/index.rst:47 msgid "" -"The `Python Package Index `__ is a public repository of " +"The `Python Packaging Index `__ is a public repository of " "open source licensed packages made available for use by other Python users." msgstr "" -"`Python Package Index `__ は Python パッケージのパブリッ" +"`Python Packaging Index `__ は Python パッケージのパブリッ" "ク・リポジトリです。このリポジトリのパッケージは、他の Python ユーザが利用で" "きるように、オープンソースでライセンスされています。" -#: ../../installing/index.rst:52 +#: ../../installing/index.rst:50 msgid "" "the `Python Packaging Authority `__ is the group of " "developers and documentation authors responsible for the maintenance and " "evolution of the standard packaging tools and the associated metadata and " "file format standards. They maintain a variety of tools, documentation, and " -"issue trackers on `GitHub `__." +"issue trackers on both `GitHub `__ and `Bitbucket " +"`__." msgstr "" "`Python Packaging Authority `__ は、標準のパッケージン" "グツール、関連するメタデータとファイルフォーマット標準の保守と発展を担ってい" "る、開発者・ドキュメントの著者のグループです。彼らは様々なツールやドキュメン" -"ト、issue tracker を `GitHub `__ で管理しています。" +"ト、issue tracker を `GitHub `__ と `Bitbucket " +"`__ の両方で管理しています。" -#: ../../installing/index.rst:58 +#: ../../installing/index.rst:57 msgid "" "``distutils`` is the original build and distribution system first added to " "the Python standard library in 1998. While direct use of ``distutils`` is " @@ -157,19 +165,19 @@ msgid "" "library, but its name lives on in other ways (such as the name of the " "mailing list used to coordinate Python packaging standards development)." msgstr "" -"``distutils`` はオリジナルのビルド・配布システムで、 Python 標準ライブラリに " -"1998 年に最初に追加されました。 ``distutils`` の直接的な利用は段階的に取り払" -"われていきますが、それは今でも現時点でのパッケージングと配布のインフラストラ" -"クチャの基礎として鎮座していて、標準ライブラリの一部として残っているだけでな" -"く、その名前はほかの文脈でも生き続けています(Python のパッケージング標準の開" -"発をまとめるのに使われているメーリングリストの名前のように)。" +":mod:`distutils` はオリジナルのビルド・配布システムで、 Python 標準ライブラリ" +"に 1998 年に最初に追加されました。 :mod:`distutils` の直接的な利用は段階的に" +"取り払われていきますが、それは今でも現時点でのパッケージングと配布のインフラ" +"ストラクチャの基礎として鎮座していて、標準ライブラリの一部として残っているだ" +"けでなく、その名前はほかの文脈でも生き続けています(Python のパッケージング標" +"準の開発をまとめるのに使われているメーリングリストの名前のように)。" -#: ../../installing/index.rst:66 +#: ../../installing/index.rst:65 msgid "" "The use of ``venv`` is now recommended for creating virtual environments." msgstr "仮想環境の作成には、 ``venv`` の使用をお勧めします。" -#: ../../installing/index.rst:71 +#: ../../installing/index.rst:70 msgid "" "`Python Packaging User Guide: Creating and using virtual environments " "`__" @@ -177,11 +185,11 @@ msgstr "" "`Python Packaging User Guide: Creating and using virtual environments " "`__" -#: ../../installing/index.rst:76 +#: ../../installing/index.rst:75 msgid "Basic usage" msgstr "基本的な使い方" -#: ../../installing/index.rst:78 +#: ../../installing/index.rst:77 msgid "" "The standard packaging tools are all designed to be used from the command " "line." @@ -189,27 +197,23 @@ msgstr "" "パッケージングのための標準ツールはすべてコマンドラインから使われることを想定" "しています。" -#: ../../installing/index.rst:81 +#: ../../installing/index.rst:80 msgid "" "The following command will install the latest version of a module and its " -"dependencies from the Python Package Index::" +"dependencies from the Python Packaging Index::" msgstr "" "以下のコマンドは、モジュールの最新バージョンとそれが依存するモジュールを、 " -"Python Package Index からインストールします。" +"Python Packaging Index からインストールします。" -#: ../../installing/index.rst:84 -msgid "python -m pip install SomePackage" -msgstr "" - -#: ../../installing/index.rst:88 +#: ../../installing/index.rst:87 msgid "" -"For POSIX users (including macOS and Linux users), the examples in this " +"For POSIX users (including Mac OS X and Linux users), the examples in this " "guide assume the use of a :term:`virtual environment`." msgstr "" -"POSIX ユーザ(macOS と Linux ユーザを含みます)向けには、このガイド内の例は、 :" -"term:`virtual environment` の利用を前提にしています。" +"POSIX ユーザ(Max OS X と Linux ユーザを含みます)向けには、このガイド内の例" +"は、 :term:`virtual environment` の利用を前提にしています。" -#: ../../installing/index.rst:91 +#: ../../installing/index.rst:90 msgid "" "For Windows users, the examples in this guide assume that the option to " "adjust the system PATH environment variable was selected when installing " @@ -218,7 +222,7 @@ msgstr "" "Windows ユーザ向けには、このガイド内の例は、Python インストール時にシステム" "の PATH 環境変数が調整されていることを前提にしています。" -#: ../../installing/index.rst:95 +#: ../../installing/index.rst:94 msgid "" "It's also possible to specify an exact or minimum version directly on the " "command line. When using comparator operators such as ``>``, ``<`` or some " @@ -229,13 +233,7 @@ msgstr "" "ます。``>`` や ``<`` などの比較演算子など、シェルが解釈する特殊文字を使う場" "合、パッケージ名とバージョンを二重引用符で囲んでください::" -#: ../../installing/index.rst:100 -msgid "" -"python -m pip install SomePackage==1.0.4 # specific version\n" -"python -m pip install \"SomePackage>=1.0.4\" # minimum version" -msgstr "" - -#: ../../installing/index.rst:103 +#: ../../installing/index.rst:102 msgid "" "Normally, if a suitable module is already installed, attempting to install " "it again will have no effect. Upgrading existing modules must be requested " @@ -245,11 +243,7 @@ msgstr "" "試みても効果はありません。既に存在しているモジュールのアップグレードには、明" "示的にそれを要求しなければなりません::" -#: ../../installing/index.rst:107 -msgid "python -m pip install --upgrade SomePackage" -msgstr "" - -#: ../../installing/index.rst:109 +#: ../../installing/index.rst:108 msgid "" "More information and resources regarding ``pip`` and its capabilities can be " "found in the `Python Packaging User Guide `__." @@ -257,7 +251,7 @@ msgstr "" "``pip`` とその機能についての詳しい情報とリソースは `Python Packaging User " "Guide `__ にあります。" -#: ../../installing/index.rst:112 +#: ../../installing/index.rst:111 msgid "" "Creation of virtual environments is done through the :mod:`venv` module. " "Installing packages into an active virtual environment uses the commands " @@ -266,7 +260,7 @@ msgstr "" "仮想環境の作成は :mod:`venv` モジュールを通して行われます。\n" "有効な仮想環境にインストールするには 上記のコマンドを使います。 " -#: ../../installing/index.rst:118 +#: ../../installing/index.rst:117 msgid "" "`Python Packaging User Guide: Installing Python Distribution Packages " "`__" @@ -274,19 +268,19 @@ msgstr "" "`Python Packaging User Guide: Installing Python Distribution Packages " "`__" -#: ../../installing/index.rst:123 +#: ../../installing/index.rst:122 msgid "How do I ...?" msgstr "どうすればいいの...?" -#: ../../installing/index.rst:125 +#: ../../installing/index.rst:124 msgid "These are quick answers or links for some common tasks." msgstr "以下はよくある課題への簡単な回答もしくは回答へのリンクです。" -#: ../../installing/index.rst:128 +#: ../../installing/index.rst:127 msgid "... install ``pip`` in versions of Python prior to Python 3.4?" msgstr "... pip を 3.4 より前のバージョンの Python でインストールするには?" -#: ../../installing/index.rst:130 +#: ../../installing/index.rst:129 msgid "" "Python only started bundling ``pip`` with Python 3.4. For earlier versions, " "``pip`` needs to be \"bootstrapped\" as described in the Python Packaging " @@ -296,7 +290,7 @@ msgstr "" "\"Python Packaging User Guide\" の記載にしたがって ``pip`` 自体をインストール" "する必要があります。" -#: ../../installing/index.rst:136 +#: ../../installing/index.rst:135 msgid "" "`Python Packaging User Guide: Requirements for Installing Packages `__" @@ -304,11 +298,11 @@ msgstr "" "`Python Packaging User Guide: Requirements for Installing Packages `__" -#: ../../installing/index.rst:143 +#: ../../installing/index.rst:142 msgid "... install packages just for the current user?" msgstr "... パッケージを現在のユーザ用のみにインストールするには?" -#: ../../installing/index.rst:145 +#: ../../installing/index.rst:144 msgid "" "Passing the ``--user`` option to ``python -m pip install`` will install a " "package just for the current user, rather than for all users of the system." @@ -317,11 +311,11 @@ msgstr "" "ジはシステムのすべてのユーザ用にではなく、現在のユーザ用のみにインストールさ" "れます。" -#: ../../installing/index.rst:150 +#: ../../installing/index.rst:149 msgid "... install scientific Python packages?" msgstr "... 科学技術計算用の Python パッケージをインストールするには?" -#: ../../installing/index.rst:152 +#: ../../installing/index.rst:151 msgid "" "A number of scientific Python packages have complex binary dependencies, and " "aren't currently easy to install using ``pip`` directly. At this point in " @@ -335,7 +329,7 @@ msgstr "" "`__ を用いてインストールするほうが、多" "くの場合簡単でしょう。" -#: ../../installing/index.rst:160 +#: ../../installing/index.rst:159 msgid "" "`Python Packaging User Guide: Installing Scientific Packages `__" @@ -343,34 +337,26 @@ msgstr "" "`Python Packaging User Guide: Installing Scientific Packages `__" -#: ../../installing/index.rst:165 +#: ../../installing/index.rst:164 msgid "... work with multiple versions of Python installed in parallel?" msgstr "... インストールされた複数のバージョンの Python を並行して使うには?" -#: ../../installing/index.rst:167 -msgid "" -"On Linux, macOS, and other POSIX systems, use the versioned Python commands " -"in combination with the ``-m`` switch to run the appropriate copy of " -"``pip``::" -msgstr "" -"Linux や macOS、その他の POSIX システムでは、バージョン番号付きの Python コマ" -"ンドと ``-m`` スイッチを組み合わせて用いて、適切なバージョンの ``pip`` を実行" -"してください。" - -#: ../../installing/index.rst:171 +#: ../../installing/index.rst:166 msgid "" -"python2 -m pip install SomePackage # default Python 2\n" -"python2.7 -m pip install SomePackage # specifically Python 2.7\n" -"python3 -m pip install SomePackage # default Python 3\n" -"python3.4 -m pip install SomePackage # specifically Python 3.4" +"On Linux, Mac OS X, and other POSIX systems, use the versioned Python " +"commands in combination with the ``-m`` switch to run the appropriate copy " +"of ``pip``::" msgstr "" +"Linux や Mac OS X、その他の POSIX システムでは、バージョン番号付きの Python " +"コマンドと ``-m`` スイッチを組み合わせて用いて、適切なバージョンの ``pip`` を" +"実行してください。" -#: ../../installing/index.rst:176 +#: ../../installing/index.rst:175 msgid "Appropriately versioned ``pip`` commands may also be available." msgstr "" "適切にバージョン番号が付された ``pip`` コマンドが使えることもあります。" -#: ../../installing/index.rst:178 +#: ../../installing/index.rst:177 msgid "" "On Windows, use the ``py`` Python launcher in combination with the ``-m`` " "switch::" @@ -378,23 +364,15 @@ msgstr "" "Windows では、 Python ランチャーの ``py`` を ``-m`` スイッチとの組み合わせで" "使ってください。" -#: ../../installing/index.rst:181 -msgid "" -"py -2 -m pip install SomePackage # default Python 2\n" -"py -2.7 -m pip install SomePackage # specifically Python 2.7\n" -"py -3 -m pip install SomePackage # default Python 3\n" -"py -3.4 -m pip install SomePackage # specifically Python 3.4" -msgstr "" - -#: ../../installing/index.rst:195 +#: ../../installing/index.rst:194 msgid "Common installation issues" msgstr "よくあるインストールに関する問題" -#: ../../installing/index.rst:198 +#: ../../installing/index.rst:197 msgid "Installing into the system Python on Linux" msgstr "Linux で、システムの Python 内にインストールする" -#: ../../installing/index.rst:200 +#: ../../installing/index.rst:199 msgid "" "On Linux systems, a Python installation will typically be included as part " "of the distribution. Installing into this Python installation requires root " @@ -409,7 +387,7 @@ msgstr "" "ネージャのオペレーションやシステムのほかのコンポーネントの邪魔をするかもしれ" "ません。" -#: ../../installing/index.rst:206 +#: ../../installing/index.rst:205 msgid "" "On such systems, it is often better to use a virtual environment or a per-" "user installation when installing packages with ``pip``." @@ -417,11 +395,11 @@ msgstr "" "そのようなシステムでは、 ``pip`` でパッケージをインストールする際には仮想環境" "を使うか、ユーザごとのインストールを行うのが、大抵良い方法です。" -#: ../../installing/index.rst:211 +#: ../../installing/index.rst:210 msgid "Pip not installed" msgstr "pip がインストールされていない" -#: ../../installing/index.rst:213 +#: ../../installing/index.rst:212 msgid "" "It is possible that ``pip`` does not get installed by default. One potential " "fix is::" @@ -429,25 +407,21 @@ msgstr "" "``pip`` がデフォルトでインストールされていないことがあります。\n" "次のコマンドで問題の解決が見込めます::" -#: ../../installing/index.rst:215 -msgid "python -m ensurepip --default-pip" -msgstr "" - -#: ../../installing/index.rst:217 +#: ../../installing/index.rst:216 msgid "" "There are also additional resources for `installing pip. `__" +"python.org/tutorials/installing-packages/#install-pip-setuptools-and-" +"wheel>`__" msgstr "" -"他にも `pip のインストール `__ につ" -"いての資料があります。" +"他にも `pip のインストール `__ についての資料があ" +"ります。" -#: ../../installing/index.rst:222 +#: ../../installing/index.rst:221 msgid "Installing binary extensions" msgstr "バイナリの拡張のインストール" -#: ../../installing/index.rst:224 +#: ../../installing/index.rst:223 msgid "" "Python has typically relied heavily on source based distribution, with end " "users being expected to compile extension modules from source as part of the " @@ -457,21 +431,21 @@ msgstr "" "プロセスの一環として、エンドユーザ環境でソースから拡張モジュールをコンパイル" "することを期待します。" -#: ../../installing/index.rst:228 +#: ../../installing/index.rst:227 msgid "" "With the introduction of support for the binary ``wheel`` format, and the " -"ability to publish wheels for at least Windows and macOS through the Python " -"Package Index, this problem is expected to diminish over time, as users are " -"more regularly able to install pre-built extensions rather than needing to " -"build them themselves." +"ability to publish wheels for at least Windows and Mac OS X through the " +"Python Packaging Index, this problem is expected to diminish over time, as " +"users are more regularly able to install pre-built extensions rather than " +"needing to build them themselves." msgstr "" "バイナリ ``wheel`` フォーマットのサポートが導入されたことで、また、少なくと" -"も Windows と macOS についての wheels の公開が Python Package Index を通して" -"出来るようになったことで、この問題についての開発者の時間の節約と、ユーザに" -"とっては自身でビルドせずにビルド済み拡張をインストールするさらなる標準化に繋" -"がるかもしれません。" +"も Windows と Mac OS X についての wheels の公開が Python Packaging Index を通" +"して出来るようになったことで、この問題についての開発者の時間の節約と、ユーザ" +"にとっては自身でビルドせずにビルド済み拡張をインストールするさらなる標準化に" +"繋がるかもしれません。" -#: ../../installing/index.rst:234 +#: ../../installing/index.rst:233 msgid "" "Some of the solutions for installing `scientific software `__ that are not yet available as pre-built ``wheel`` " @@ -483,7 +457,7 @@ msgstr "" "法が、ローカルにビルドすることなく他のバイナリ拡張を得る助けになるかもしれま" "せん。" -#: ../../installing/index.rst:241 +#: ../../installing/index.rst:240 msgid "" "`Python Packaging User Guide: Binary Extensions `__" diff --git a/library/2to3.po b/library/2to3.po index 745a5eaa0..cfab40d24 100644 --- a/library/2to3.po +++ b/library/2to3.po @@ -1,24 +1,27 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2024, Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Tetsuo Koyama , 2021 -# Keigo Fushio , 2021 +# Nozomu Kaneko , 2017 +# 秘湯 , 2017 +# Masato HASHIMOTO , 2017 +# Yusuke Miyazaki , 2017 +# Arihiro TAKASE, 2017 +# Keigo Fushio , 2020 +# Tetsuo Koyama , 2020 # Shin Saito, 2021 -# tomo, 2022 -# Arihiro TAKASE, 2023 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.12\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-05-04 01:27+0000\n" -"PO-Revision-Date: 2021-06-28 00:54+0000\n" -"Last-Translator: Arihiro TAKASE, 2023\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 17:46+0000\n" +"Last-Translator: Shin Saito, 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" "Language: ja\n" "MIME-Version: 1.0\n" @@ -27,8 +30,8 @@ msgstr "" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/2to3.rst:4 -msgid "2to3 --- Automated Python 2 to 3 code translation" -msgstr "2to3 --- Python 2 から 3 への自動コード変換" +msgid "2to3 - Automated Python 2 to 3 code translation" +msgstr "2to3 - Python 2 から 3 への自動コード変換" #: ../../library/2to3.rst:8 msgid "" @@ -44,19 +47,11 @@ msgstr "" "ます。ただし 2to3 を構成している :mod:`lib2to3` は柔軟かつ一般的なライブラリ" "なので、 2to3 のために独自の fixer を書くこともできます。" -#: ../../library/2to3.rst:19 -msgid "" -"The ``lib2to3`` module was marked pending for deprecation in Python 3.9 " -"(raising :exc:`PendingDeprecationWarning` on import) and fully deprecated in " -"Python 3.11 (raising :exc:`DeprecationWarning`). The ``2to3`` tool is part " -"of that. It will be removed in Python 3.13." -msgstr "" - -#: ../../library/2to3.rst:23 +#: ../../library/2to3.rst:18 msgid "Using 2to3" msgstr "2to3 の使用" -#: ../../library/2to3.rst:25 +#: ../../library/2to3.rst:20 msgid "" "2to3 will usually be installed with the Python interpreter as a script. It " "is also located in the :file:`Tools/scripts` directory of the Python root." @@ -65,7 +60,7 @@ msgstr "" "ルされます。場所は、 Python のルートディレクトリにある、 :file:`Tools/" "scripts` ディレクトリです。" -#: ../../library/2to3.rst:28 +#: ../../library/2to3.rst:23 msgid "" "2to3's basic arguments are a list of files or directories to transform. The " "directories are recursively traversed for Python sources." @@ -73,17 +68,17 @@ msgstr "" "2to3 に与える基本の引数は、変換対象のファイル、もしくは、ディレクトリのリスト" "です。ディレクトリの場合は、 Python ソースコードを再帰的に探索します。" -#: ../../library/2to3.rst:31 +#: ../../library/2to3.rst:26 msgid "Here is a sample Python 2.x source file, :file:`example.py`::" msgstr "Python 2.x のサンプルコード、 :file:`example.py` を示します::" -#: ../../library/2to3.rst:39 +#: ../../library/2to3.rst:34 msgid "It can be converted to Python 3.x code via 2to3 on the command line:" msgstr "" "これは、コマンドラインから 2to3 を呼び出すことで、Python 3.x コードに変換され" "ます:" -#: ../../library/2to3.rst:45 +#: ../../library/2to3.rst:40 msgid "" "A diff against the original source file is printed. 2to3 can also write the " "needed modifications right back to the source file. (A backup of the " @@ -95,17 +90,17 @@ msgstr "" "オリジナルのバックアップも作成されます)。変更の書き戻しは :option:`!-w` フラ" "グによって有効化されます:" -#: ../../library/2to3.rst:54 +#: ../../library/2to3.rst:49 msgid "After transformation, :file:`example.py` looks like this::" msgstr "変換後、 :file:`example.py` は以下のようになります::" -#: ../../library/2to3.rst:62 +#: ../../library/2to3.rst:57 msgid "" "Comments and exact indentation are preserved throughout the translation " "process." msgstr "変換処理を通じて、コメントと、インデントは保存されます。" -#: ../../library/2to3.rst:64 +#: ../../library/2to3.rst:59 msgid "" "By default, 2to3 runs a set of :ref:`predefined fixers <2to3-fixers>`. The :" "option:`!-l` flag lists all available fixers. An explicit set of fixers to " @@ -120,11 +115,11 @@ msgstr "" "します。下記の例では、 ``imports`` と ``has_key`` 変換プログラムだけを実行し" "ます:" -#: ../../library/2to3.rst:73 +#: ../../library/2to3.rst:68 msgid "This command runs every fixer except the ``apply`` fixer:" msgstr "このコマンドは ``apply`` 以外のすべての変換プログラムを実行します:" -#: ../../library/2to3.rst:79 +#: ../../library/2to3.rst:74 msgid "" "Some fixers are *explicit*, meaning they aren't run by default and must be " "listed on the command line to be run. Here, in addition to the default " @@ -134,13 +129,13 @@ msgstr "" "ドラインで実行するものとして列記する必要があります。デフォルトの変換プログラ" "ムに ``idioms`` 変換プログラムを追加して実行するには、下記のようにします:" -#: ../../library/2to3.rst:87 +#: ../../library/2to3.rst:82 msgid "Notice how passing ``all`` enables all default fixers." msgstr "" "ここで、 ``all`` を指定することで、全てのデフォルトの変換プログラムを有効化で" "きることに注意して下さい。" -#: ../../library/2to3.rst:89 +#: ../../library/2to3.rst:84 msgid "" "Sometimes 2to3 will find a place in your source code that needs to be " "changed, but 2to3 cannot fix automatically. In this case, 2to3 will print a " @@ -151,7 +146,7 @@ msgstr "" "ります。この場合、 2to3 はファイルの変更点の下に警告を表示します。 3.x に準拠" "したコードにするために、あなたはこの警告に対処しなくてはなりません。" -#: ../../library/2to3.rst:94 +#: ../../library/2to3.rst:89 msgid "" "2to3 can also refactor doctests. To enable this mode, use the :option:`!-d` " "flag. Note that *only* doctests will be refactored. This also doesn't " @@ -164,13 +159,13 @@ msgstr "" "ます。例えば、 reST ドキュメント中の doctest に似たサンプルコードなども、この" "オプションで修正することができます。" -#: ../../library/2to3.rst:99 +#: ../../library/2to3.rst:94 msgid "" "The :option:`!-v` option enables output of more information on the " "translation process." msgstr ":option:`!-v` は、変換処理のより詳しい情報の出力を有効化します。" -#: ../../library/2to3.rst:102 +#: ../../library/2to3.rst:97 msgid "" "Since some print statements can be parsed as function calls or statements, " "2to3 cannot always read files containing the print function. When 2to3 " @@ -190,7 +185,7 @@ msgstr "" "を使用してください。同様に、:func:`exec` を関数として解釈させるには :option:" "`!-e` を使用してください。" -#: ../../library/2to3.rst:110 +#: ../../library/2to3.rst:105 msgid "" "The :option:`!-o` or :option:`!--output-dir` option allows specification of " "an alternate directory for processed output files to be written to. The :" @@ -201,11 +196,11 @@ msgstr "" "変更出来ます。入力ファイルを上書きしないならバックアップは意味をなさないの" "で、オプション :option:`!-n` フラグが要ります。" -#: ../../library/2to3.rst:115 +#: ../../library/2to3.rst:110 msgid "The :option:`!-o` option was added." msgstr ":option:`!-o` オプションが追加されました。" -#: ../../library/2to3.rst:118 +#: ../../library/2to3.rst:113 msgid "" "The :option:`!-W` or :option:`!--write-unchanged-files` flag tells 2to3 to " "always write output files even if no changes were required to the file. " @@ -218,11 +213,11 @@ msgstr "" "ます。これは、 :option:`!-o` とともに使って、Python ソースツリー全体を変換し" "て別のディレクトリに書き出す際に最も有用です。" -#: ../../library/2to3.rst:124 +#: ../../library/2to3.rst:119 msgid "The :option:`!-W` flag was added." msgstr ":option:`!-W` フラグが追加されました。" -#: ../../library/2to3.rst:127 +#: ../../library/2to3.rst:122 msgid "" "The :option:`!--add-suffix` option specifies a string to append to all " "output filenames. The :option:`!-n` flag is required when specifying this " @@ -232,25 +227,25 @@ msgstr "" "加します。これを指定するのであれば別名で書き出されるためバックアップは必要な" "いので、オプション :option:`!-n` フラグが要ります。例えば:" -#: ../../library/2to3.rst:135 +#: ../../library/2to3.rst:130 msgid "Will cause a converted file named ``example.py3`` to be written." msgstr "とすれば変換後ファイルは ``example.py3`` として書き出されます。" -#: ../../library/2to3.rst:137 +#: ../../library/2to3.rst:132 msgid "The :option:`!--add-suffix` option was added." msgstr ":option:`!--add-suffix` オプションが追加されました。" -#: ../../library/2to3.rst:140 +#: ../../library/2to3.rst:135 msgid "To translate an entire project from one directory tree to another use:" msgstr "" "ひとつのディレクトリツリーからプロジェクト全体を変換したければこのように使い" "ます:" -#: ../../library/2to3.rst:150 +#: ../../library/2to3.rst:145 msgid "Fixers" msgstr "変換プログラム" -#: ../../library/2to3.rst:152 +#: ../../library/2to3.rst:147 msgid "" "Each step of transforming code is encapsulated in a fixer. The command " "``2to3 -l`` lists them. As :ref:`documented above <2to3-using>`, each can " @@ -261,7 +256,7 @@ msgstr "" "れの変換プログラムを個別に有効化したり無効化したりすることができます。ここで" "はそれらをさらに詳細に説明します。" -#: ../../library/2to3.rst:159 +#: ../../library/2to3.rst:154 msgid "" "Removes usage of :func:`apply`. For example ``apply(function, *args, " "**kwargs)`` is converted to ``function(*args, **kwargs)``." @@ -269,101 +264,101 @@ msgstr "" ":func:`apply` の使用を削除します。例えば ``apply(function, *args, " "**kwargs)`` は ``function(*args, **kwargs)`` に変換されます。" -#: ../../library/2to3.rst:164 +#: ../../library/2to3.rst:159 msgid "Replaces deprecated :mod:`unittest` method names with the correct ones." msgstr "廃止になった :mod:`unittest` メソッド名を新しい名前に置換します。" -#: ../../library/2to3.rst:167 ../../library/2to3.rst:356 +#: ../../library/2to3.rst:162 ../../library/2to3.rst:350 msgid "From" msgstr "対象" -#: ../../library/2to3.rst:167 ../../library/2to3.rst:356 +#: ../../library/2to3.rst:162 ../../library/2to3.rst:350 msgid "To" msgstr "変換先" -#: ../../library/2to3.rst:169 +#: ../../library/2to3.rst:164 msgid "``failUnlessEqual(a, b)``" msgstr "``failUnlessEqual(a, b)``" -#: ../../library/2to3.rst:169 ../../library/2to3.rst:171 +#: ../../library/2to3.rst:164 ../../library/2to3.rst:166 msgid ":meth:`assertEqual(a, b) `" msgstr ":meth:`assertEqual(a, b) `" -#: ../../library/2to3.rst:171 +#: ../../library/2to3.rst:166 msgid "``assertEquals(a, b)``" msgstr "``assertEquals(a, b)``" -#: ../../library/2to3.rst:173 +#: ../../library/2to3.rst:168 msgid "``failIfEqual(a, b)``" msgstr "``failIfEqual(a, b)``" -#: ../../library/2to3.rst:173 ../../library/2to3.rst:175 +#: ../../library/2to3.rst:168 ../../library/2to3.rst:170 msgid ":meth:`assertNotEqual(a, b) `" msgstr ":meth:`assertNotEqual(a, b) `" -#: ../../library/2to3.rst:175 +#: ../../library/2to3.rst:170 msgid "``assertNotEquals(a, b)``" msgstr "``assertNotEquals(a, b)``" -#: ../../library/2to3.rst:177 +#: ../../library/2to3.rst:172 msgid "``failUnless(a)``" msgstr "``failUnless(a)``" -#: ../../library/2to3.rst:177 ../../library/2to3.rst:179 +#: ../../library/2to3.rst:172 ../../library/2to3.rst:174 msgid ":meth:`assertTrue(a) `" msgstr ":meth:`assertTrue(a) `" -#: ../../library/2to3.rst:179 +#: ../../library/2to3.rst:174 msgid "``assert_(a)``" msgstr "``assert_(a)``" -#: ../../library/2to3.rst:181 +#: ../../library/2to3.rst:176 msgid "``failIf(a)``" msgstr "``failIf(a)``" -#: ../../library/2to3.rst:181 +#: ../../library/2to3.rst:176 msgid ":meth:`assertFalse(a) `" msgstr ":meth:`assertFalse(a) `" -#: ../../library/2to3.rst:183 +#: ../../library/2to3.rst:178 msgid "``failUnlessRaises(exc, cal)``" msgstr "``failUnlessRaises(exc, cal)``" -#: ../../library/2to3.rst:183 +#: ../../library/2to3.rst:178 msgid ":meth:`assertRaises(exc, cal) `" msgstr ":meth:`assertRaises(exc, cal) `" -#: ../../library/2to3.rst:185 +#: ../../library/2to3.rst:180 msgid "``failUnlessAlmostEqual(a, b)``" msgstr "``failUnlessAlmostEqual(a, b)``" -#: ../../library/2to3.rst:185 ../../library/2to3.rst:187 +#: ../../library/2to3.rst:180 ../../library/2to3.rst:182 msgid ":meth:`assertAlmostEqual(a, b) `" msgstr ":meth:`assertAlmostEqual(a, b) `" -#: ../../library/2to3.rst:187 +#: ../../library/2to3.rst:182 msgid "``assertAlmostEquals(a, b)``" msgstr "``assertAlmostEquals(a, b)``" -#: ../../library/2to3.rst:189 +#: ../../library/2to3.rst:184 msgid "``failIfAlmostEqual(a, b)``" msgstr "``failIfAlmostEqual(a, b)``" -#: ../../library/2to3.rst:189 ../../library/2to3.rst:191 +#: ../../library/2to3.rst:184 ../../library/2to3.rst:186 msgid "" ":meth:`assertNotAlmostEqual(a, b) `" msgstr "" ":meth:`assertNotAlmostEqual(a, b) `" -#: ../../library/2to3.rst:191 +#: ../../library/2to3.rst:186 msgid "``assertNotAlmostEquals(a, b)``" msgstr "``assertNotAlmostEquals(a, b)``" -#: ../../library/2to3.rst:197 +#: ../../library/2to3.rst:192 msgid "Converts :class:`basestring` to :class:`str`." msgstr ":class:`basestring` を :class:`str` に変換します。" -#: ../../library/2to3.rst:201 +#: ../../library/2to3.rst:196 msgid "" "Converts :class:`buffer` to :class:`memoryview`. This fixer is optional " "because the :class:`memoryview` API is similar but not exactly the same as " @@ -373,7 +368,7 @@ msgstr "" "API は :class:`buffer` と似ているものの厳密に同じではないので、この変換プログ" "ラムはオプションです。" -#: ../../library/2to3.rst:207 +#: ../../library/2to3.rst:202 msgid "" "Fixes dictionary iteration methods. :meth:`dict.iteritems` is converted to :" "meth:`dict.items`, :meth:`dict.iterkeys` to :meth:`dict.keys`, and :meth:" @@ -391,15 +386,15 @@ msgstr "" "class:`list` の呼び出しの中で :meth:`dict.items`, :meth:`dict.keys`, :meth:" "`dict.values` を使用している場合はそれをラップします。" -#: ../../library/2to3.rst:217 +#: ../../library/2to3.rst:212 msgid "Converts ``except X, T`` to ``except X as T``." msgstr "``except X, T`` を ``except X as T`` に変換します。" -#: ../../library/2to3.rst:221 +#: ../../library/2to3.rst:216 msgid "Converts the ``exec`` statement to the :func:`exec` function." msgstr "``exec`` 文を :func:`exec` 関数に変換します。" -#: ../../library/2to3.rst:225 +#: ../../library/2to3.rst:220 msgid "" "Removes usage of :func:`execfile`. The argument to :func:`execfile` is " "wrapped in calls to :func:`open`, :func:`compile`, and :func:`exec`." @@ -407,20 +402,20 @@ msgstr "" ":func:`execfile` の使用を削除します。 :func:`execfile` への引数は :func:" "`open`, :func:`compile`, :func:`exec` の呼び出しでラップされます。" -#: ../../library/2to3.rst:230 +#: ../../library/2to3.rst:225 msgid "" "Changes assignment of :attr:`sys.exitfunc` to use of the :mod:`atexit` " "module." msgstr "" ":attr:`sys.exitfunc` への代入を :mod:`atexit` モジュールの使用に変更します。" -#: ../../library/2to3.rst:235 +#: ../../library/2to3.rst:230 msgid "Wraps :func:`filter` usage in a :class:`list` call." msgstr "" ":class:`list` 呼び出しの中で :func:`filter` を使用している部分をラップしま" "す。" -#: ../../library/2to3.rst:239 +#: ../../library/2to3.rst:234 msgid "" "Fixes function attributes that have been renamed. For example, " "``my_function.func_closure`` is converted to ``my_function.__closure__``." @@ -428,19 +423,19 @@ msgstr "" "名前が変更された関数の属性を修正します。例えば ``my_function.func_closure`` " "は ``my_function.__closure__`` に変換されます。" -#: ../../library/2to3.rst:244 +#: ../../library/2to3.rst:239 msgid "Removes ``from __future__ import new_feature`` statements." msgstr "``from __future__ import new_feature`` 文を削除します。" -#: ../../library/2to3.rst:248 +#: ../../library/2to3.rst:243 msgid "Renames :func:`os.getcwdu` to :func:`os.getcwd`." msgstr ":func:`os.getcwdu` を :func:`os.getcwd` に置き換えます。" -#: ../../library/2to3.rst:252 +#: ../../library/2to3.rst:247 msgid "Changes ``dict.has_key(key)`` to ``key in dict``." msgstr "``dict.has_key(key)`` を ``key in dict`` に変更します。" -#: ../../library/2to3.rst:256 +#: ../../library/2to3.rst:251 msgid "" "This optional fixer performs several transformations that make Python code " "more idiomatic. Type comparisons like ``type(x) is SomeClass`` and " @@ -454,21 +449,21 @@ msgstr "" "``while 1`` は ``while True`` になります。また、適切な場所では :func:" "`sorted` が使われるようにします。例えば、このブロックは ::" -#: ../../library/2to3.rst:265 +#: ../../library/2to3.rst:260 msgid "is changed to ::" msgstr "次のように変更されます ::" -#: ../../library/2to3.rst:271 +#: ../../library/2to3.rst:266 msgid "Detects sibling imports and converts them to relative imports." msgstr "" "暗黙の相対インポート (sibling imports) を検出して、明示的な相対インポート " "(relative imports) に変換します。" -#: ../../library/2to3.rst:275 +#: ../../library/2to3.rst:270 msgid "Handles module renames in the standard library." msgstr "標準ライブラリ中のモジュール名の変更を扱います。" -#: ../../library/2to3.rst:279 +#: ../../library/2to3.rst:274 msgid "" "Handles other modules renames in the standard library. It is separate from " "the :2to3fixer:`imports` fixer only because of technical limitations." @@ -476,15 +471,15 @@ msgstr "" "標準ライブラリ中の別のモジュール名の変更を扱います。単に技術的な制約のため" "に :2to3fixer:`imports` とは別になっています。" -#: ../../library/2to3.rst:284 +#: ../../library/2to3.rst:279 msgid "Converts ``input(prompt)`` to ``eval(input(prompt))``." msgstr "``input(prompt)`` を ``eval(input(prompt))`` に変換します。" -#: ../../library/2to3.rst:288 +#: ../../library/2to3.rst:283 msgid "Converts :func:`intern` to :func:`sys.intern`." msgstr ":func:`intern` を :func:`sys.intern` に変換します。" -#: ../../library/2to3.rst:292 +#: ../../library/2to3.rst:287 msgid "" "Fixes duplicate types in the second argument of :func:`isinstance`. For " "example, ``isinstance(x, (int, int))`` is converted to ``isinstance(x, " @@ -495,7 +490,7 @@ msgstr "" "(int, int))`` は ``isinstance(x, int)`` に ``isinstance(x, (int, float, " "int))`` は ``isinstance(x, (int, float))`` に変換されます。" -#: ../../library/2to3.rst:299 +#: ../../library/2to3.rst:294 msgid "" "Removes imports of :func:`itertools.ifilter`, :func:`itertools.izip`, and :" "func:`itertools.imap`. Imports of :func:`itertools.ifilterfalse` are also " @@ -505,7 +500,7 @@ msgstr "" "インポートを削除します。また :func:`itertools.ifilterfalse` のインポートを :" "func:`itertools.filterfalse` に変換します。" -#: ../../library/2to3.rst:305 +#: ../../library/2to3.rst:300 msgid "" "Changes usage of :func:`itertools.ifilter`, :func:`itertools.izip`, and :" "func:`itertools.imap` to their built-in equivalents. :func:`itertools." @@ -515,11 +510,11 @@ msgstr "" "使っている箇所を同等の組み込み関数で置き換えます。 :func:`itertools." "ifilterfalse` は :func:`itertools.filterfalse` に変換されます。" -#: ../../library/2to3.rst:311 +#: ../../library/2to3.rst:306 msgid "Renames :class:`long` to :class:`int`." msgstr ":class:`long` を :class:`int` に変更します。" -#: ../../library/2to3.rst:315 +#: ../../library/2to3.rst:310 msgid "" "Wraps :func:`map` in a :class:`list` call. It also changes ``map(None, x)`` " "to ``list(x)``. Using ``from future_builtins import map`` disables this " @@ -529,7 +524,7 @@ msgstr "" "x)`` を ``list(x)`` に変換します。 ``from future_builtins import map`` を使う" "と、この変換プログラムを無効にできます。" -#: ../../library/2to3.rst:321 +#: ../../library/2to3.rst:316 msgid "" "Converts the old metaclass syntax (``__metaclass__ = Meta`` in the class " "body) to the new (``class X(metaclass=Meta)``)." @@ -537,7 +532,7 @@ msgstr "" "古いメタクラス構文 (クラス定義中の ``__metaclass__ = Meta``) を、新しい構文 " "(``class X(metaclass=Meta)``) に変換します。" -#: ../../library/2to3.rst:326 +#: ../../library/2to3.rst:321 msgid "" "Fixes old method attribute names. For example, ``meth.im_func`` is " "converted to ``meth.__func__``." @@ -545,11 +540,11 @@ msgstr "" "古いメソッドの属性名を修正します。例えば ``meth.im_func`` は ``meth." "__func__`` に変換されます。" -#: ../../library/2to3.rst:331 +#: ../../library/2to3.rst:326 msgid "Converts the old not-equal syntax, ``<>``, to ``!=``." msgstr "古い不等号の構文 ``<>`` を ``!=`` に変換します。" -#: ../../library/2to3.rst:335 +#: ../../library/2to3.rst:330 msgid "" "Converts the use of iterator's :meth:`~iterator.next` methods to the :func:" "`next` function. It also renames :meth:`next` methods to :meth:`~iterator." @@ -559,17 +554,15 @@ msgstr "" "します。また :meth:`next` メソッドを :meth:`~iterator.__next__` に変更しま" "す。" -#: ../../library/2to3.rst:341 -msgid "" -"Renames definitions of methods called :meth:`__nonzero__` to :meth:`~object." -"__bool__`." +#: ../../library/2to3.rst:336 +msgid "Renames :meth:`__nonzero__` to :meth:`~object.__bool__`." msgstr ":meth:`__nonzero__` を :meth:`~object.__bool__` に変更します。" -#: ../../library/2to3.rst:346 +#: ../../library/2to3.rst:340 msgid "Converts octal literals into the new syntax." msgstr "8 進数リテラルを新しい構文に変換します。" -#: ../../library/2to3.rst:350 +#: ../../library/2to3.rst:344 msgid "" "Converts calls to various functions in the :mod:`operator` module to other, " "but equivalent, function calls. When needed, the appropriate ``import`` " @@ -581,63 +574,63 @@ msgstr "" "どの適切な ``import`` ステートメントが追加されます。以下のマッピングが行われ" "ます。" -#: ../../library/2to3.rst:358 +#: ../../library/2to3.rst:352 msgid "``operator.isCallable(obj)``" msgstr "``operator.isCallable(obj)``" -#: ../../library/2to3.rst:358 +#: ../../library/2to3.rst:352 msgid "``callable(obj)``" msgstr "``callable(obj)``" -#: ../../library/2to3.rst:359 +#: ../../library/2to3.rst:353 msgid "``operator.sequenceIncludes(obj)``" msgstr "``operator.sequenceIncludes(obj)``" -#: ../../library/2to3.rst:359 +#: ../../library/2to3.rst:353 msgid "``operator.contains(obj)``" msgstr "``operator.contains(obj)``" -#: ../../library/2to3.rst:360 +#: ../../library/2to3.rst:354 msgid "``operator.isSequenceType(obj)``" msgstr "``operator.isSequenceType(obj)``" -#: ../../library/2to3.rst:360 +#: ../../library/2to3.rst:354 msgid "``isinstance(obj, collections.abc.Sequence)``" msgstr "``isinstance(obj, collections.abc.Sequence)``" -#: ../../library/2to3.rst:361 +#: ../../library/2to3.rst:355 msgid "``operator.isMappingType(obj)``" msgstr "``operator.isMappingType(obj)``" -#: ../../library/2to3.rst:361 +#: ../../library/2to3.rst:355 msgid "``isinstance(obj, collections.abc.Mapping)``" msgstr "``isinstance(obj, collections.abc.Mapping)``" -#: ../../library/2to3.rst:362 +#: ../../library/2to3.rst:356 msgid "``operator.isNumberType(obj)``" msgstr "``operator.isNumberType(obj)``" -#: ../../library/2to3.rst:362 +#: ../../library/2to3.rst:356 msgid "``isinstance(obj, numbers.Number)``" msgstr "``isinstance(obj, numbers.Number)``" -#: ../../library/2to3.rst:363 +#: ../../library/2to3.rst:357 msgid "``operator.repeat(obj, n)``" msgstr "``operator.repeat(obj, n)``" -#: ../../library/2to3.rst:363 +#: ../../library/2to3.rst:357 msgid "``operator.mul(obj, n)``" msgstr "``operator.mul(obj, n)``" -#: ../../library/2to3.rst:364 +#: ../../library/2to3.rst:358 msgid "``operator.irepeat(obj, n)``" msgstr "``operator.irepeat(obj, n)``" -#: ../../library/2to3.rst:364 +#: ../../library/2to3.rst:358 msgid "``operator.imul(obj, n)``" msgstr "``operator.imul(obj, n)``" -#: ../../library/2to3.rst:369 +#: ../../library/2to3.rst:363 msgid "" "Add extra parenthesis where they are required in list comprehensions. For " "example, ``[x for x in 1, 2]`` becomes ``[x for x in (1, 2)]``." @@ -645,11 +638,11 @@ msgstr "" "リスト内包表記で必要になる括弧を追加します。例えば ``[x for x in 1, 2]`` は " "``[x for x in (1, 2)]`` になります。" -#: ../../library/2to3.rst:374 +#: ../../library/2to3.rst:368 msgid "Converts the ``print`` statement to the :func:`print` function." msgstr "``print`` 文を :func:`print` 関数に変換します。" -#: ../../library/2to3.rst:378 +#: ../../library/2to3.rst:372 msgid "" "Converts ``raise E, V`` to ``raise E(V)``, and ``raise E, V, T`` to ``raise " "E(V).with_traceback(T)``. If ``E`` is a tuple, the translation will be " @@ -659,28 +652,28 @@ msgstr "" "with_traceback(T)`` に変換します。例外の代わりにタプルを使用することは 3.0 で" "削除されたので、``E`` がタプルならこの変換は不正確になります。" -#: ../../library/2to3.rst:384 +#: ../../library/2to3.rst:378 msgid "Converts :func:`raw_input` to :func:`input`." msgstr ":func:`raw_input` を :func:`input` に変換します。" -#: ../../library/2to3.rst:388 +#: ../../library/2to3.rst:382 msgid "Handles the move of :func:`reduce` to :func:`functools.reduce`." msgstr "" ":func:`reduce` が :func:`functools.reduce` に移動されたことを扱います。" -#: ../../library/2to3.rst:392 +#: ../../library/2to3.rst:386 msgid "Converts :func:`reload` to :func:`importlib.reload`." msgstr ":func:`reload` を :func:`importlib.reload` に変換します。" -#: ../../library/2to3.rst:396 +#: ../../library/2to3.rst:390 msgid "Changes :data:`sys.maxint` to :data:`sys.maxsize`." msgstr ":data:`sys.maxint` を :data:`sys.maxsize` に変更します。" -#: ../../library/2to3.rst:400 +#: ../../library/2to3.rst:394 msgid "Replaces backtick repr with the :func:`repr` function." msgstr "バッククォートを使った repr を :func:`repr` 関数に置き換えます。" -#: ../../library/2to3.rst:404 +#: ../../library/2to3.rst:398 msgid "" "Replaces use of the :class:`set` constructor with set literals. This fixer " "is optional." @@ -688,11 +681,11 @@ msgstr "" ":class:`set` コンストラクタの使用を set リテラルに置換します。この変換プログ" "ラムはオプションです。" -#: ../../library/2to3.rst:409 +#: ../../library/2to3.rst:403 msgid "Renames :exc:`StandardError` to :exc:`Exception`." msgstr ":exc:`StandardError` を :exc:`Exception` に変更します。" -#: ../../library/2to3.rst:413 +#: ../../library/2to3.rst:407 msgid "" "Changes the deprecated :data:`sys.exc_value`, :data:`sys.exc_type`, :data:" "`sys.exc_traceback` to use :func:`sys.exc_info`." @@ -700,11 +693,11 @@ msgstr "" "廃止された :data:`sys.exc_value`, :data:`sys.exc_type`, :data:`sys." "exc_traceback` の代わりに :func:`sys.exc_info` を使うように変更します。" -#: ../../library/2to3.rst:418 +#: ../../library/2to3.rst:412 msgid "Fixes the API change in generator's :meth:`throw` method." msgstr "ジェネレータの :meth:`throw` メソッドの API 変更を修正します。" -#: ../../library/2to3.rst:422 +#: ../../library/2to3.rst:416 msgid "" "Removes implicit tuple parameter unpacking. This fixer inserts temporary " "variables." @@ -712,7 +705,7 @@ msgstr "" "関数定義における暗黙的なタプルパラメータの展開を取り除きます。この変換プログ" "ラムによって一時変数が追加されます。" -#: ../../library/2to3.rst:427 +#: ../../library/2to3.rst:421 msgid "" "Fixes code broken from the removal of some members in the :mod:`types` " "module." @@ -720,11 +713,11 @@ msgstr "" ":mod:`types` モジュールのいくつかのメンバオブジェクトが削除されたことによって" "壊れたコードを修正します。" -#: ../../library/2to3.rst:432 +#: ../../library/2to3.rst:426 msgid "Renames :class:`unicode` to :class:`str`." msgstr ":class:`unicode` を :class:`str` に変更します。" -#: ../../library/2to3.rst:436 +#: ../../library/2to3.rst:430 msgid "" "Handles the rename of :mod:`urllib` and :mod:`urllib2` to the :mod:`urllib` " "package." @@ -732,7 +725,7 @@ msgstr "" ":mod:`urllib` と :mod:`urllib2` が :mod:`urllib` パッケージに変更されたことを" "扱います。" -#: ../../library/2to3.rst:441 +#: ../../library/2to3.rst:435 msgid "" "Removes excess whitespace from comma separated items. This fixer is " "optional." @@ -740,7 +733,7 @@ msgstr "" "コンマ区切りの要素から余計な空白を取り除きます。この変換プログラムはオプショ" "ンです。" -#: ../../library/2to3.rst:446 +#: ../../library/2to3.rst:440 msgid "" "Renames :func:`xrange` to :func:`range` and wraps existing :func:`range` " "calls with :class:`list`." @@ -748,11 +741,11 @@ msgstr "" ":func:`xrange` を :func:`range` に変更して、既存の :func:`range` 呼び出しを :" "class:`list` でラップします。" -#: ../../library/2to3.rst:451 +#: ../../library/2to3.rst:445 msgid "Changes ``for x in file.xreadlines()`` to ``for x in file``." msgstr "``for x in file.xreadlines()`` を ``for x in file`` に変更します。" -#: ../../library/2to3.rst:455 +#: ../../library/2to3.rst:449 msgid "" "Wraps :func:`zip` usage in a :class:`list` call. This is disabled when " "``from future_builtins import zip`` appears." @@ -760,27 +753,30 @@ msgstr "" ":class:`list` 呼び出しの中で使われている :func:`zip` をラップします。これは " "``from future_builtins import zip`` が見つかった場合は無効にされます。" -#: ../../library/2to3.rst:460 -msgid ":mod:`lib2to3` --- 2to3's library" -msgstr ":mod:`lib2to3` --- 2to3's library" +#: ../../library/2to3.rst:454 +msgid ":mod:`lib2to3` - 2to3's library" +msgstr ":mod:`lib2to3` - 2to3's library" -#: ../../library/2to3.rst:469 +#: ../../library/2to3.rst:463 msgid "**Source code:** :source:`Lib/lib2to3/`" msgstr "**ソースコード:** :source:`Lib/lib2to3/`" -#: ../../library/2to3.rst:482 +#: ../../library/2to3.rst:467 msgid "" -"Python 3.9 switched to a PEG parser (see :pep:`617`) while lib2to3 is using " -"a less flexible LL(1) parser. Python 3.10 includes new language syntax that " -"is not parsable by lib2to3's LL(1) parser (see :pep:`634`). The ``lib2to3`` " -"module was marked pending for deprecation in Python 3.9 (raising :exc:" -"`PendingDeprecationWarning` on import) and fully deprecated in Python 3.11 " -"(raising :exc:`DeprecationWarning`). It will be removed from the standard " -"library in Python 3.13. Consider third-party alternatives such as `LibCST`_ " -"or `parso`_." +"Python 3.9 will switch to a PEG parser (see :pep:`617`), and Python 3.10 may " +"include new language syntax that is not parsable by lib2to3's LL(1) parser. " +"The ``lib2to3`` module may be removed from the standard library in a future " +"Python version. Consider third-party alternatives such as `LibCST`_ or " +"`parso`_." msgstr "" +"Python 3.9 から構文解析器が PEG パーサに変更になり (:pep:`617` を参照のこ" +"と)、Python 3.10 には lib2to3 の使用する LL(1) パーサでは解析できない文法が導" +"入される可能性があります。Python の将来のバージョンでは ``lib2to3`` モジュー" +"ルが標準ライブラリから削除される可能性があります。その場合、代替として " +"`LibCST`_ や `parso`_ のようなサードパーティ・ライブラリの使用を検討してくだ" +"さい。" -#: ../../library/2to3.rst:485 +#: ../../library/2to3.rst:476 msgid "" "The :mod:`lib2to3` API should be considered unstable and may change " "drastically in the future." diff --git a/library/__future__.po b/library/__future__.po index 0fe71d5ed..ae1313d38 100644 --- a/library/__future__.po +++ b/library/__future__.po @@ -1,61 +1,43 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2024 -# 石井明久, 2024 +# Inada Naoki , 2017 +# Arihiro TAKASE, 2017 +# Hiroyuki Kurosawa , 2019 +# tomo, 2021 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:54+0000\n" -"Last-Translator: 石井明久, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 17:47+0000\n" +"Last-Translator: tomo, 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/__future__.rst:2 -msgid ":mod:`!__future__` --- Future statement definitions" -msgstr ":mod:`!__future__` --- future 文の定義" +msgid ":mod:`__future__` --- Future statement definitions" +msgstr ":mod:`__future__` --- future 文の定義" #: ../../library/__future__.rst:7 msgid "**Source code:** :source:`Lib/__future__.py`" msgstr "**ソースコード:** :source:`Lib/__future__.py`" #: ../../library/__future__.rst:11 -msgid "" -"Imports of the form ``from __future__ import feature`` are called :ref:" -"`future statements `. These are special-cased by the Python compiler " -"to allow the use of new Python features in modules containing the future " -"statement before the release in which the feature becomes standard." -msgstr "" -"``from __future__ import feature`` の形式でのインポートは :ref:`future 文 " -"` の定義と呼ばれています。これらは特殊なケースで、 Python の新機能が" -"標準になるリリースの前に Python コンパイラーが future 文を含むモジュールで " -"Python の新機能を使用できるようにします。" - -#: ../../library/__future__.rst:16 -msgid "" -"While these future statements are given additional special meaning by the " -"Python compiler, they are still executed like any other import statement and " -"the :mod:`__future__` exists and is handled by the import system the same " -"way any other Python module would be. This design serves three purposes:" -msgstr "" -"これらの future 文が Python コンパイラーによって追加の特殊な意味を与えられる" -"一方で、それらは依然として他のインポート文のように実行され、 :mod:" -"`__future__` は存在し、他の Python モジュールと同じようにインポートシステムに" -"よって処理されます。この設計は3つの目的にかなっています:" +msgid ":mod:`__future__` is a real module, and serves three purposes:" +msgstr ":mod:`__future__` は実物のモジュールであり、次の3つの役割があります:" -#: ../../library/__future__.rst:21 +#: ../../library/__future__.rst:13 msgid "" "To avoid confusing existing tools that analyze import statements and expect " "to find the modules they're importing." @@ -63,7 +45,17 @@ msgstr "" "import 文を解析する既存のツールを混乱させることを避け、インポートしようとして" "いるモジュールを見つけられるようにするため。" -#: ../../library/__future__.rst:24 +#: ../../library/__future__.rst:16 +msgid "" +"To ensure that :ref:`future statements ` run under releases prior to " +"2.1 at least yield runtime exceptions (the import of :mod:`__future__` will " +"fail, because there was no module of that name prior to 2.1)." +msgstr "" +"2.1 以前のリリースで :ref:`future 文 ` が実行された場合に、最低でもラ" +"ンタイム例外を投げるようにするため (:mod:`__future__` のインポートは失敗しま" +"す。なぜなら、 2.1 以前にはそういう名前のモジュールはなかったからです)。" + +#: ../../library/__future__.rst:20 msgid "" "To document when incompatible changes were introduced, and when they will be " "--- or were --- made mandatory. This is a form of executable documentation, " @@ -75,23 +67,73 @@ msgstr "" "で、 :mod:`__future__` をインポートしてその中身を調べることでプログラムから調" "査することができます。" -#: ../../library/__future__.rst:29 +#: ../../library/__future__.rst:25 +msgid "Each statement in :file:`__future__.py` is of the form::" +msgstr ":file:`__future__.py` のそれぞれの文は次のような形式をしています::" + +#: ../../library/__future__.rst:31 msgid "" -"To ensure that :ref:`future statements ` run under releases prior to " -"Python 2.1 at least yield runtime exceptions (the import of :mod:" -"`__future__` will fail, because there was no module of that name prior to " -"2.1)." +"where, normally, *OptionalRelease* is less than *MandatoryRelease*, and both " +"are 5-tuples of the same form as :data:`sys.version_info`::" msgstr "" -"Python 2.1 以前のリリースで :ref:`future 文 ` が実行された場合に、最" -"低でもランタイム例外を投げるようにするため (:mod:`__future__` のインポートは" -"失敗します。なぜなら、 2.1 以前にはそういう名前のモジュールはなかったからで" -"す)。" +"ここで、普通は、 *OptionalRelease* は *MandatoryRelease* より小さく、2つと" +"も :data:`sys.version_info` と同じフォーマットの5つのタプルからなります::" -#: ../../library/__future__.rst:34 -msgid "Module Contents" -msgstr "モジュールコンテンツ" +#: ../../library/__future__.rst:41 +msgid "" +"*OptionalRelease* records the first release in which the feature was " +"accepted." +msgstr "*OptionalRelease* はその機能が導入された最初のリリースを記録します。" + +#: ../../library/__future__.rst:43 +msgid "" +"In the case of a *MandatoryRelease* that has not yet occurred, " +"*MandatoryRelease* predicts the release in which the feature will become " +"part of the language." +msgstr "" +"まだ時期が来ていない *MandatoryRelease* の場合、*MandatoryRelease* はその機能" +"が言語の一部となるリリースを記します。" -#: ../../library/__future__.rst:36 +#: ../../library/__future__.rst:47 +msgid "" +"Else *MandatoryRelease* records when the feature became part of the " +"language; in releases at or after that, modules no longer need a future " +"statement to use the feature in question, but may continue to use such " +"imports." +msgstr "" +"その他の場合、*MandatoryRelease* はその機能がいつ言語の一部になったのかを記録" +"します。そのリリースから、あるいはそれ以降のリリースでは、この機能を使う際に " +"future 文は必要ではありませんが、future 文を使い続けても構いません。" + +#: ../../library/__future__.rst:51 +msgid "" +"*MandatoryRelease* may also be ``None``, meaning that a planned feature got " +"dropped." +msgstr "" +"*MandatoryRelease* は ``None`` になるかもしれません。つまり、予定された機能が" +"破棄されたということです。" + +#: ../../library/__future__.rst:54 +msgid "" +"Instances of class :class:`_Feature` have two corresponding methods, :meth:" +"`getOptionalRelease` and :meth:`getMandatoryRelease`." +msgstr "" +":class:`_Feature` クラスのインスタンスには対応する2つのメソッド、 :meth:" +"`getOptionalRelease` と :meth:`getMandatoryRelease` があります。" + +#: ../../library/__future__.rst:57 +msgid "" +"*CompilerFlag* is the (bitfield) flag that should be passed in the fourth " +"argument to the built-in function :func:`compile` to enable the feature in " +"dynamically compiled code. This flag is stored in the :attr:`compiler_flag` " +"attribute on :class:`_Feature` instances." +msgstr "" +"*CompilerFlag* は、動的にコンパイルされるコードでその機能を有効にするために、" +"組み込み関数 :func:`compile` の第4引数に渡す(ビットフィールド)フラグです。こ" +"のフラグは :class:`_Feature` インスタンスの :attr:`compiler_flag` 属性に保存" +"されています。" + +#: ../../library/__future__.rst:62 msgid "" "No feature description will ever be deleted from :mod:`__future__`. Since " "its introduction in Python 2.1 the following features have found their way " @@ -101,244 +143,151 @@ msgstr "" "2.1 で future 文が導入されて以来、この仕組みを使って以下の機能が言語に導入さ" "れてきました:" -#: ../../library/__future__.rst:41 +#: ../../library/__future__.rst:67 msgid "feature" msgstr "feature" -#: ../../library/__future__.rst:41 +#: ../../library/__future__.rst:67 msgid "optional in" msgstr "optional in" -#: ../../library/__future__.rst:41 +#: ../../library/__future__.rst:67 msgid "mandatory in" msgstr "mandatory in" -#: ../../library/__future__.rst:41 +#: ../../library/__future__.rst:67 msgid "effect" msgstr "effect" -#: ../../library/__future__.rst:43 +#: ../../library/__future__.rst:69 msgid "nested_scopes" msgstr "nested_scopes" -#: ../../library/__future__.rst:43 +#: ../../library/__future__.rst:69 msgid "2.1.0b1" msgstr "2.1.0b1" -#: ../../library/__future__.rst:43 +#: ../../library/__future__.rst:69 msgid "2.2" msgstr "2.2" -#: ../../library/__future__.rst:43 +#: ../../library/__future__.rst:69 msgid ":pep:`227`: *Statically Nested Scopes*" msgstr ":pep:`227`: *Statically Nested Scopes*" -#: ../../library/__future__.rst:46 +#: ../../library/__future__.rst:72 msgid "generators" msgstr "generators" -#: ../../library/__future__.rst:46 +#: ../../library/__future__.rst:72 msgid "2.2.0a1" msgstr "2.2.0a1" -#: ../../library/__future__.rst:46 +#: ../../library/__future__.rst:72 msgid "2.3" msgstr "2.3" -#: ../../library/__future__.rst:46 +#: ../../library/__future__.rst:72 msgid ":pep:`255`: *Simple Generators*" msgstr ":pep:`255`: *Simple Generators*" -#: ../../library/__future__.rst:49 +#: ../../library/__future__.rst:75 msgid "division" msgstr "division" -#: ../../library/__future__.rst:49 +#: ../../library/__future__.rst:75 msgid "2.2.0a2" msgstr "2.2.0a2" -#: ../../library/__future__.rst:49 ../../library/__future__.rst:52 -#: ../../library/__future__.rst:58 ../../library/__future__.rst:61 +#: ../../library/__future__.rst:75 ../../library/__future__.rst:78 +#: ../../library/__future__.rst:84 ../../library/__future__.rst:87 msgid "3.0" msgstr "3.0" -#: ../../library/__future__.rst:49 +#: ../../library/__future__.rst:75 msgid ":pep:`238`: *Changing the Division Operator*" msgstr ":pep:`238`: *Changing the Division Operator*" -#: ../../library/__future__.rst:52 +#: ../../library/__future__.rst:78 msgid "absolute_import" msgstr "absolute_import" -#: ../../library/__future__.rst:52 ../../library/__future__.rst:55 +#: ../../library/__future__.rst:78 ../../library/__future__.rst:81 msgid "2.5.0a1" msgstr "2.5.0a1" -#: ../../library/__future__.rst:52 +#: ../../library/__future__.rst:78 msgid ":pep:`328`: *Imports: Multi-Line and Absolute/Relative*" msgstr ":pep:`328`: *Imports: Multi-Line and Absolute/Relative*" -#: ../../library/__future__.rst:55 +#: ../../library/__future__.rst:81 msgid "with_statement" msgstr "with_statement" -#: ../../library/__future__.rst:55 +#: ../../library/__future__.rst:81 msgid "2.6" msgstr "2.6" -#: ../../library/__future__.rst:55 +#: ../../library/__future__.rst:81 msgid ":pep:`343`: *The \"with\" Statement*" msgstr ":pep:`343`: *The \"with\" Statement*" -#: ../../library/__future__.rst:58 +#: ../../library/__future__.rst:84 msgid "print_function" msgstr "print_function" -#: ../../library/__future__.rst:58 ../../library/__future__.rst:61 +#: ../../library/__future__.rst:84 ../../library/__future__.rst:87 msgid "2.6.0a2" msgstr "2.6.0a2" -#: ../../library/__future__.rst:58 +#: ../../library/__future__.rst:84 msgid ":pep:`3105`: *Make print a function*" msgstr ":pep:`3105`: *Make print a function*" -#: ../../library/__future__.rst:61 +#: ../../library/__future__.rst:87 msgid "unicode_literals" msgstr "unicode_literals" -#: ../../library/__future__.rst:61 +#: ../../library/__future__.rst:87 msgid ":pep:`3112`: *Bytes literals in Python 3000*" msgstr ":pep:`3112`: *Bytes literals in Python 3000*" -#: ../../library/__future__.rst:64 +#: ../../library/__future__.rst:90 msgid "generator_stop" msgstr "generator_stop" -#: ../../library/__future__.rst:64 +#: ../../library/__future__.rst:90 msgid "3.5.0b1" msgstr "3.5.0b1" -#: ../../library/__future__.rst:64 +#: ../../library/__future__.rst:90 msgid "3.7" msgstr "3.7" -#: ../../library/__future__.rst:64 +#: ../../library/__future__.rst:90 msgid ":pep:`479`: *StopIteration handling inside generators*" msgstr ":pep:`479`: *StopIteration handling inside generators*" -#: ../../library/__future__.rst:67 +#: ../../library/__future__.rst:93 msgid "annotations" msgstr "annotations" -#: ../../library/__future__.rst:67 +#: ../../library/__future__.rst:93 msgid "3.7.0b1" msgstr "3.7.0b1" -#: ../../library/__future__.rst:67 -msgid "Never [1]_" -msgstr "" - -#: ../../library/__future__.rst:67 -msgid "" -":pep:`563`: *Postponed evaluation of annotations*, :pep:`649`: *Deferred " -"evaluation of annotations using descriptors*" -msgstr "" - -#: ../../library/__future__.rst:79 -msgid "Each statement in :file:`__future__.py` is of the form::" -msgstr ":file:`__future__.py` のそれぞれの文は次のような形式をしています::" - -#: ../../library/__future__.rst:81 -msgid "" -"FeatureName = _Feature(OptionalRelease, MandatoryRelease,\n" -" CompilerFlag)" -msgstr "" - -#: ../../library/__future__.rst:84 -msgid "" -"where, normally, *OptionalRelease* is less than *MandatoryRelease*, and both " -"are 5-tuples of the same form as :data:`sys.version_info`::" -msgstr "" -"ここで、普通は、 *OptionalRelease* は *MandatoryRelease* より小さく、2つと" -"も :data:`sys.version_info` と同じフォーマットの5つのタプルからなります::" - -#: ../../library/__future__.rst:87 -msgid "" -"(PY_MAJOR_VERSION, # the 2 in 2.1.0a3; an int\n" -" PY_MINOR_VERSION, # the 1; an int\n" -" PY_MICRO_VERSION, # the 0; an int\n" -" PY_RELEASE_LEVEL, # \"alpha\", \"beta\", \"candidate\" or \"final\"; " -"string\n" -" PY_RELEASE_SERIAL # the 3; an int\n" -")" -msgstr "" - -#: ../../library/__future__.rst:96 -msgid "" -"*OptionalRelease* records the first release in which the feature was " -"accepted." -msgstr "*OptionalRelease* はその機能が導入された最初のリリースを記録します。" - -#: ../../library/__future__.rst:100 -msgid "" -"In the case of a *MandatoryRelease* that has not yet occurred, " -"*MandatoryRelease* predicts the release in which the feature will become " -"part of the language." -msgstr "" -"まだ時期が来ていない *MandatoryRelease* の場合、*MandatoryRelease* はその機能" -"が言語の一部となるリリースを記します。" - -#: ../../library/__future__.rst:104 -msgid "" -"Else *MandatoryRelease* records when the feature became part of the " -"language; in releases at or after that, modules no longer need a future " -"statement to use the feature in question, but may continue to use such " -"imports." -msgstr "" -"その他の場合、*MandatoryRelease* はその機能がいつ言語の一部になったのかを記録" -"します。そのリリースから、あるいはそれ以降のリリースでは、この機能を使う際に " -"future 文は必要ではありませんが、future 文を使い続けても構いません。" - -#: ../../library/__future__.rst:108 -msgid "" -"*MandatoryRelease* may also be ``None``, meaning that a planned feature got " -"dropped or that it is not yet decided." -msgstr "" -"*MandatoryRelease* は ``None`` になるかもしれません。つまり、予定された機能が" -"破棄されたか、まだ決定されていないということです。" - -#: ../../library/__future__.rst:113 -msgid "" -"*CompilerFlag* is the (bitfield) flag that should be passed in the fourth " -"argument to the built-in function :func:`compile` to enable the feature in " -"dynamically compiled code. This flag is stored in the :attr:`_Feature." -"compiler_flag` attribute on :class:`_Feature` instances." -msgstr "" -"*CompilerFlag* は、動的にコンパイルされるコードでその機能を有効にするために、" -"組み込み関数 :func:`compile` の第4引数に渡す(ビットフィールド)フラグです。こ" -"のフラグは :class:`_Feature` インスタンスの :attr:`_Feature.compiler_flag` 属" -"性に保存されています。" +#: ../../library/__future__.rst:93 +msgid "3.10" +msgstr "3.10" -#: ../../library/__future__.rst:119 -msgid "" -"``from __future__ import annotations`` was previously scheduled to become " -"mandatory in Python 3.10, but the change was delayed and ultimately " -"canceled. This feature will eventually be deprecated and removed. See :pep:" -"`649` and :pep:`749`." -msgstr "" +#: ../../library/__future__.rst:93 +msgid ":pep:`563`: *Postponed evaluation of annotations*" +msgstr ":pep:`563`: *Postponed evaluation of annotations*" -#: ../../library/__future__.rst:127 +#: ../../library/__future__.rst:102 msgid ":ref:`future`" msgstr ":ref:`future`" -#: ../../library/__future__.rst:128 +#: ../../library/__future__.rst:103 msgid "How the compiler treats future imports." msgstr "コンパイラがどのように future インポートを扱うか。" - -#: ../../library/__future__.rst:130 -msgid ":pep:`236` - Back to the __future__" -msgstr ":pep:`236` - Back to the __future__" - -#: ../../library/__future__.rst:131 -msgid "The original proposal for the __future__ mechanism." -msgstr "__future__ 機構の原案" diff --git a/library/__main__.po b/library/__main__.po index ca5e7a80d..ed8c06733 100644 --- a/library/__main__.po +++ b/library/__main__.po @@ -1,602 +1,61 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2022 -# digdugdog, 2023 -# 石井明久, 2024 +# Masato HASHIMOTO , 2017 +# Arihiro TAKASE, 2017 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:54+0000\n" -"Last-Translator: 石井明久, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 17:47+0000\n" +"Last-Translator: Arihiro TAKASE, 2017\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: ../../library/__main__.rst:2 -msgid ":mod:`!__main__` --- Top-level code environment" -msgstr ":mod:`!__main__` --- トップレベルのコード環境" +#: ../../library/__main__.rst:3 +msgid ":mod:`__main__` --- Top-level script environment" +msgstr ":mod:`__main__` --- トップレベルのスクリプト環境" #: ../../library/__main__.rst:10 msgid "" -"In Python, the special name ``__main__`` is used for two important " -"constructs:" -msgstr "" -"Python では、 ``__main__`` という特別な名前が次の二つの重要な用途で使われま" -"す:" - -#: ../../library/__main__.rst:12 -msgid "" -"the name of the top-level environment of the program, which can be checked " -"using the ``__name__ == '__main__'`` expression; and" +"``'__main__'`` is the name of the scope in which top-level code executes. A " +"module's __name__ is set equal to ``'__main__'`` when read from standard " +"input, a script, or from an interactive prompt." msgstr "" -"プログラムのトップレベル環境の名前。\n" -"``__name__ == '__main__'`` という式でチェックすることができる。" +"``'__main__'`` はトップレベルのコードが実行されるスコープの名前です。モジュー" +"ルが、標準入力から読み込まれたとき、スクリプトとして実行されたとき、あるいは" +"インタラクティブプロンプトのとき、__name__ には ``'__main__'`` が設定されま" +"す。" #: ../../library/__main__.rst:14 -msgid "the ``__main__.py`` file in Python packages." -msgstr "Python パッケージにおける ``__main__.py`` ファイル。" - -#: ../../library/__main__.rst:16 -msgid "" -"Both of these mechanisms are related to Python modules; how users interact " -"with them and how they interact with each other. They are explained in " -"detail below. If you're new to Python modules, see the tutorial section :" -"ref:`tut-modules` for an introduction." -msgstr "" -"どちらも Python のモジュールに関わる機能です。\n" -"1つ目はユーザーがどうモジュールを使うか、2つ目はモジュールとモジュールがど" -"うやりとりするかに関係します。\n" -"詳細は以下で説明します。\n" -"Python モジュールがどういうものかについては、 :ref:`tut-modules` を参照してく" -"ださい。" - -#: ../../library/__main__.rst:25 -msgid "``__name__ == '__main__'``" -msgstr "``__name__ == '__main__'``" - -#: ../../library/__main__.rst:27 -msgid "" -"When a Python module or package is imported, ``__name__`` is set to the " -"module's name. Usually, this is the name of the Python file itself without " -"the ``.py`` extension::" -msgstr "" -"Python モジュールやパッケージがインポートされるとき、 ``__name__`` の値はその" -"モジュールの名前となります。\n" -"通常、インポートされる Python ファイル自体のファイル名から拡張子``.py`` を除" -"いたものとなります::" - -#: ../../library/__main__.rst:31 -msgid "" -">>> import configparser\n" -">>> configparser.__name__\n" -"'configparser'" -msgstr "" - -#: ../../library/__main__.rst:35 -msgid "" -"If the file is part of a package, ``__name__`` will also include the parent " -"package's path::" -msgstr "" -"インポートされるファイルがパッケージの一部である場合は、 ``__name__`` にはそ" -"のパッケージのパスも含まれます::" - -#: ../../library/__main__.rst:38 -msgid "" -">>> from concurrent.futures import process\n" -">>> process.__name__\n" -"'concurrent.futures.process'" -msgstr "" - -#: ../../library/__main__.rst:42 -msgid "" -"However, if the module is executed in the top-level code environment, its " -"``__name__`` is set to the string ``'__main__'``." -msgstr "" -"しかし、モジュールがトップレベルのスクリプト環境で実行される場合は、 " -"``__name__`` が ``'__main__'`` という文字列になります。" - -#: ../../library/__main__.rst:46 -msgid "What is the \"top-level code environment\"?" -msgstr "「トップレベルのスクリプト環境」とは" - -#: ../../library/__main__.rst:48 -msgid "" -"``__main__`` is the name of the environment where top-level code is run. " -"\"Top-level code\" is the first user-specified Python module that starts " -"running. It's \"top-level\" because it imports all other modules that the " -"program needs. Sometimes \"top-level code\" is called an *entry point* to " -"the application." -msgstr "" -"``__main__`` は、トップレベルのコードが実行される環境の名前です。 \"トップレ" -"ベルのコード\" は、実行を開始する最初のユーザー指定の Python モジュールです。" -"これは、このモジュールがプログラムに必要なすべての他のモジュールをインポート" -"するために、 \"トップレベル\" なのです。時折、 \"トップレベルのコード\" は、" -"アプリケーションには *エントリーポイント* と呼ばれます。" - -#: ../../library/__main__.rst:53 -msgid "The top-level code environment can be:" -msgstr "以下のものがトップレベルのスクリプト環境となります:" - -#: ../../library/__main__.rst:55 -msgid "the scope of an interactive prompt::" -msgstr "インタラクティブプロンプトのスコープ::" - -#: ../../library/__main__.rst:57 -msgid "" -">>> __name__\n" -"'__main__'" -msgstr "" - -#: ../../library/__main__.rst:60 -msgid "the Python module passed to the Python interpreter as a file argument:" -msgstr "Python インタープリタにファイル引数として渡される Python モジュール:" - -#: ../../library/__main__.rst:62 -msgid "" -"$ python helloworld.py\n" -"Hello, world!" -msgstr "" - -#: ../../library/__main__.rst:67 -msgid "" -"the Python module or package passed to the Python interpreter with the :" -"option:`-m` argument:" -msgstr "" -"Python インタープリタにPython :option:`-m` オプションとして渡される Python モ" -"ジュールまたはパッケージ:" - -#: ../../library/__main__.rst:70 -msgid "" -"$ python -m tarfile\n" -"usage: tarfile.py [-h] [-v] (...)" -msgstr "" - -#: ../../library/__main__.rst:75 -msgid "Python code read by the Python interpreter from standard input:" -msgstr "標準入力から Python インタープリタが読み込む Python コード:" - -#: ../../library/__main__.rst:77 -msgid "" -"$ echo \"import this\" | python\n" -"The Zen of Python, by Tim Peters\n" -"\n" -"Beautiful is better than ugly.\n" -"Explicit is better than implicit.\n" -"..." -msgstr "" - -#: ../../library/__main__.rst:86 -msgid "" -"Python code passed to the Python interpreter with the :option:`-c` argument:" -msgstr "" -"Python インタープリタに :option:`-c` オプションで渡される Python コード:" - -#: ../../library/__main__.rst:88 -msgid "" -"$ python -c \"import this\"\n" -"The Zen of Python, by Tim Peters\n" -"\n" -"Beautiful is better than ugly.\n" -"Explicit is better than implicit.\n" -"..." -msgstr "" - -#: ../../library/__main__.rst:97 -msgid "" -"In each of these situations, the top-level module's ``__name__`` is set to " -"``'__main__'``." -msgstr "" -"上記それぞれの場合で、トップレベルのモジュールの ``__name__`` の値が " -"``'__main__'`` となります。" - -#: ../../library/__main__.rst:100 -msgid "" -"As a result, a module can discover whether or not it is running in the top-" -"level environment by checking its own ``__name__``, which allows a common " -"idiom for conditionally executing code when the module is not initialized " -"from an import statement::" -msgstr "" -"これにより、 ``__name__`` をチェックすれば各モジュールは自分がトップレベル環" -"境で実行されているかどうかを知ることができます。\n" -"このことから、モジュールが import 文で初期化された場合以外の場合でのみコード" -"を実行するため、次のコードがしばしば用いられます::" - -#: ../../library/__main__.rst:105 -msgid "" -"if __name__ == '__main__':\n" -" # Execute when the module is not initialized from an import statement.\n" -" ..." -msgstr "" - -#: ../../library/__main__.rst:111 -msgid "" -"For a more detailed look at how ``__name__`` is set in all situations, see " -"the tutorial section :ref:`tut-modules`." -msgstr "" -"あらゆる場合に ``__name__`` の値がどうセットされるのかについて、詳しくは" -"チュートリアルの :ref:`tut-modules` セクションを参照してください。" - -#: ../../library/__main__.rst:116 ../../library/__main__.rst:239 -msgid "Idiomatic Usage" -msgstr "通常の使われ方" - -#: ../../library/__main__.rst:118 -msgid "" -"Some modules contain code that is intended for script use only, like parsing " -"command-line arguments or fetching data from standard input. If a module " -"like this was imported from a different module, for example to unit test it, " -"the script code would unintentionally execute as well." -msgstr "" -"一部のモジュールでは、コマンドライン引数をパースしたり標準入力からデータを取" -"得したなど、スクリプト用途のみのコードが含まれています。\n" -"このようなモジュールが、例えばユニットテストのため、別のモジュールからイン" -"ポートされると、そのスクリプト用コードが意図に反して実行されてしまいます。" - -#: ../../library/__main__.rst:123 -msgid "" -"This is where using the ``if __name__ == '__main__'`` code block comes in " -"handy. Code within this block won't run unless the module is executed in the " -"top-level environment." -msgstr "" -"``if __name__ == '__main__'`` というコードは、このようなときに役立ちます。\n" -"このブロックの中にあるコードは、当該のモジュールがトップレベル環境で実行され" -"ていない限り、実行されません。" - -#: ../../library/__main__.rst:127 -msgid "" -"Putting as few statements as possible in the block below ``if __name__ == " -"'__main__'`` can improve code clarity and correctness. Most often, a " -"function named ``main`` encapsulates the program's primary behavior::" -msgstr "" -"``if __name__ == '__main__'`` の下のブロックにあるコードはできるだけ少なくし" -"た方が、コードの分かりやすさや正確さにつながります。\n" -"最もよくあるのが、プログラムの主要な処理を ``main`` 関数の中にカプセル化する" -"ことです::" - -#: ../../library/__main__.rst:131 -msgid "" -"# echo.py\n" -"\n" -"import shlex\n" -"import sys\n" -"\n" -"def echo(phrase: str) -> None:\n" -" \"\"\"A dummy wrapper around print.\"\"\"\n" -" # for demonstration purposes, you can imagine that there is some\n" -" # valuable and reusable logic inside this function\n" -" print(phrase)\n" -"\n" -"def main() -> int:\n" -" \"\"\"Echo the input arguments to standard output\"\"\"\n" -" phrase = shlex.join(sys.argv)\n" -" echo(phrase)\n" -" return 0\n" -"\n" -"if __name__ == '__main__':\n" -" sys.exit(main()) # next section explains the use of sys.exit" -msgstr "" - -#: ../../library/__main__.rst:151 -msgid "" -"Note that if the module didn't encapsulate code inside the ``main`` function " -"but instead put it directly within the ``if __name__ == '__main__'`` block, " -"the ``phrase`` variable would be global to the entire module. This is error-" -"prone as other functions within the module could be unintentionally using " -"the global variable instead of a local name. A ``main`` function solves " -"this problem." -msgstr "" -"注意すべき点として、もし ``main`` 関数内のコードをカプセル化せず ``if " -"__name__ == '__main__'`` の下に直接書いた場合、 ``phrase`` 変数はモジュール全" -"体からグローバルにアクセスできてしまいます。\n" -"モジュール内の他の関数が意図せずローカル変数ではなくそのグローバル変数を使用" -"してしまう可能性があるため、ミスにつながります。\n" -"``main`` 関数を用意することでこの問題は解決できます。" - -#: ../../library/__main__.rst:158 -msgid "" -"Using a ``main`` function has the added benefit of the ``echo`` function " -"itself being isolated and importable elsewhere. When ``echo.py`` is " -"imported, the ``echo`` and ``main`` functions will be defined, but neither " -"of them will be called, because ``__name__ != '__main__'``." -msgstr "" -"``main`` 関数を使うことのもう一つのメリットとして、 ``echo`` 関数が分離し、別" -"の場所からインポートできるようになることです。\n" -"``echo.py`` がインポートされるとき、 ``echo`` 関数と ``main`` 関数が定義され" -"ますが、 ``__name__ != '__main__'`` であるため、どちらの関数も呼び出されませ" -"ん。" - -#: ../../library/__main__.rst:165 -msgid "Packaging Considerations" -msgstr "パッケージングで考慮すべき点" - -#: ../../library/__main__.rst:167 -msgid "" -"``main`` functions are often used to create command-line tools by specifying " -"them as entry points for console scripts. When this is done, `pip `_ inserts the function call into a template script, where the " -"return value of ``main`` is passed into :func:`sys.exit`. For example::" -msgstr "" - -#: ../../library/__main__.rst:173 -msgid "sys.exit(main())" -msgstr "" - -#: ../../library/__main__.rst:175 -msgid "" -"Since the call to ``main`` is wrapped in :func:`sys.exit`, the expectation " -"is that your function will return some value acceptable as an input to :func:" -"`sys.exit`; typically, an integer or ``None`` (which is implicitly returned " -"if your function does not have a return statement)." -msgstr "" - -#: ../../library/__main__.rst:180 -msgid "" -"By proactively following this convention ourselves, our module will have the " -"same behavior when run directly (i.e. ``python echo.py``) as it will have if " -"we later package it as a console script entry-point in a pip-installable " -"package." -msgstr "" - -#: ../../library/__main__.rst:185 -msgid "" -"In particular, be careful about returning strings from your ``main`` " -"function. :func:`sys.exit` will interpret a string argument as a failure " -"message, so your program will have an exit code of ``1``, indicating " -"failure, and the string will be written to :data:`sys.stderr`. The ``echo." -"py`` example from earlier exemplifies using the ``sys.exit(main())`` " -"convention." -msgstr "" - -#: ../../library/__main__.rst:193 -msgid "" -"`Python Packaging User Guide `_ contains a " -"collection of tutorials and references on how to distribute and install " -"Python packages with modern tools." -msgstr "" - -#: ../../library/__main__.rst:199 -msgid "``__main__.py`` in Python Packages" -msgstr "" - -#: ../../library/__main__.rst:201 -msgid "" -"If you are not familiar with Python packages, see section :ref:`tut-" -"packages` of the tutorial. Most commonly, the ``__main__.py`` file is used " -"to provide a command-line interface for a package. Consider the following " -"hypothetical package, \"bandclass\":" -msgstr "" - -#: ../../library/__main__.rst:206 -msgid "" -"bandclass\n" -" ├── __init__.py\n" -" ├── __main__.py\n" -" └── student.py" -msgstr "" - -#: ../../library/__main__.rst:213 -msgid "" -"``__main__.py`` will be executed when the package itself is invoked directly " -"from the command line using the :option:`-m` flag. For example:" -msgstr "" - -#: ../../library/__main__.rst:216 -msgid "$ python -m bandclass" -msgstr "" - -#: ../../library/__main__.rst:220 -msgid "" -"This command will cause ``__main__.py`` to run. How you utilize this " -"mechanism will depend on the nature of the package you are writing, but in " -"this hypothetical case, it might make sense to allow the teacher to search " -"for students::" -msgstr "" - -#: ../../library/__main__.rst:225 -msgid "" -"# bandclass/__main__.py\n" -"\n" -"import sys\n" -"from .student import search_students\n" -"\n" -"student_name = sys.argv[1] if len(sys.argv) >= 2 else ''\n" -"print(f'Found student: {search_students(student_name)}')" -msgstr "" - -#: ../../library/__main__.rst:233 -msgid "" -"Note that ``from .student import search_students`` is an example of a " -"relative import. This import style can be used when referencing modules " -"within a package. For more details, see :ref:`intra-package-references` in " -"the :ref:`tut-modules` section of the tutorial." -msgstr "" - -#: ../../library/__main__.rst:241 -msgid "" -"The content of ``__main__.py`` typically isn't fenced with an ``if __name__ " -"== '__main__'`` block. Instead, those files are kept short and import " -"functions to execute from other modules. Those other modules can then be " -"easily unit-tested and are properly reusable." -msgstr "" - -#: ../../library/__main__.rst:246 -msgid "" -"If used, an ``if __name__ == '__main__'`` block will still work as expected " -"for a ``__main__.py`` file within a package, because its ``__name__`` " -"attribute will include the package's path if imported::" -msgstr "" - -#: ../../library/__main__.rst:250 -msgid "" -">>> import asyncio.__main__\n" -">>> asyncio.__main__.__name__\n" -"'asyncio.__main__'" -msgstr "" - -#: ../../library/__main__.rst:254 -msgid "" -"This won't work for ``__main__.py`` files in the root directory of a ``." -"zip`` file though. Hence, for consistency, a minimal ``__main__.py`` " -"without a ``__name__`` check is preferred." -msgstr "" - -#: ../../library/__main__.rst:260 -msgid "" -"See :mod:`venv` for an example of a package with a minimal ``__main__.py`` " -"in the standard library. It doesn't contain a ``if __name__ == '__main__'`` " -"block. You can invoke it with ``python -m venv [directory]``." -msgstr "" - -#: ../../library/__main__.rst:264 -msgid "" -"See :mod:`runpy` for more details on the :option:`-m` flag to the " -"interpreter executable." -msgstr "" - -#: ../../library/__main__.rst:267 -msgid "" -"See :mod:`zipapp` for how to run applications packaged as *.zip* files. In " -"this case Python looks for a ``__main__.py`` file in the root directory of " -"the archive." -msgstr "" - -#: ../../library/__main__.rst:274 -msgid "``import __main__``" -msgstr "``import __main__``" - -#: ../../library/__main__.rst:276 -msgid "" -"Regardless of which module a Python program was started with, other modules " -"running within that same program can import the top-level environment's " -"scope (:term:`namespace`) by importing the ``__main__`` module. This " -"doesn't import a ``__main__.py`` file but rather whichever module that " -"received the special name ``'__main__'``." -msgstr "" - -#: ../../library/__main__.rst:282 -msgid "Here is an example module that consumes the ``__main__`` namespace::" -msgstr "" - -#: ../../library/__main__.rst:284 -msgid "" -"# namely.py\n" -"\n" -"import __main__\n" -"\n" -"def did_user_define_their_name():\n" -" return 'my_name' in dir(__main__)\n" -"\n" -"def print_user_name():\n" -" if not did_user_define_their_name():\n" -" raise ValueError('Define the variable `my_name`!')\n" -"\n" -" print(__main__.my_name)" -msgstr "" - -#: ../../library/__main__.rst:297 -msgid "Example usage of this module could be as follows::" -msgstr "" - -#: ../../library/__main__.rst:299 -msgid "" -"# start.py\n" -"\n" -"import sys\n" -"\n" -"from namely import print_user_name\n" -"\n" -"# my_name = \"Dinsdale\"\n" -"\n" -"def main():\n" -" try:\n" -" print_user_name()\n" -" except ValueError as ve:\n" -" return str(ve)\n" -"\n" -"if __name__ == \"__main__\":\n" -" sys.exit(main())" -msgstr "" - -#: ../../library/__main__.rst:316 -msgid "Now, if we started our program, the result would look like this:" -msgstr "" - -#: ../../library/__main__.rst:318 -msgid "" -"$ python start.py\n" -"Define the variable `my_name`!" -msgstr "" - -#: ../../library/__main__.rst:323 -msgid "" -"The exit code of the program would be 1, indicating an error. Uncommenting " -"the line with ``my_name = \"Dinsdale\"`` fixes the program and now it exits " -"with status code 0, indicating success:" -msgstr "" - -#: ../../library/__main__.rst:327 -msgid "" -"$ python start.py\n" -"Dinsdale" -msgstr "" - -#: ../../library/__main__.rst:332 -msgid "" -"Note that importing ``__main__`` doesn't cause any issues with " -"unintentionally running top-level code meant for script use which is put in " -"the ``if __name__ == \"__main__\"`` block of the ``start`` module. Why does " -"this work?" -msgstr "" - -#: ../../library/__main__.rst:336 -msgid "" -"Python inserts an empty ``__main__`` module in :data:`sys.modules` at " -"interpreter startup, and populates it by running top-level code. In our " -"example this is the ``start`` module which runs line by line and imports " -"``namely``. In turn, ``namely`` imports ``__main__`` (which is really " -"``start``). That's an import cycle! Fortunately, since the partially " -"populated ``__main__`` module is present in :data:`sys.modules`, Python " -"passes that to ``namely``. See :ref:`Special considerations for __main__ " -"` in the import system's reference for details on how " -"this works." -msgstr "" - -#: ../../library/__main__.rst:345 -msgid "" -"The Python REPL is another example of a \"top-level environment\", so " -"anything defined in the REPL becomes part of the ``__main__`` scope::" -msgstr "" - -#: ../../library/__main__.rst:348 msgid "" -">>> import namely\n" -">>> namely.did_user_define_their_name()\n" -"False\n" -">>> namely.print_user_name()\n" -"Traceback (most recent call last):\n" -"...\n" -"ValueError: Define the variable `my_name`!\n" -">>> my_name = 'Jabberwocky'\n" -">>> namely.did_user_define_their_name()\n" -"True\n" -">>> namely.print_user_name()\n" -"Jabberwocky" +"A module can discover whether or not it is running in the main scope by " +"checking its own ``__name__``, which allows a common idiom for conditionally " +"executing code in a module when it is run as a script or with ``python -m`` " +"but not when it is imported::" msgstr "" +"モジュールは、自身の ``__name__`` をチェックすることでメインスコープで実行さ" +"れているかどうかを確認できます。これはモジュールがスクリプトとして、あるいは" +"インポートでなく ``python -m`` で起動されたときに実行するコードの条件として使" +"用できる一般的なイディオムです::" -#: ../../library/__main__.rst:361 +#: ../../library/__main__.rst:23 msgid "" -"The ``__main__`` scope is used in the implementation of :mod:`pdb` and :mod:" -"`rlcompleter`." +"For a package, the same effect can be achieved by including a ``__main__." +"py`` module, the contents of which will be executed when the module is run " +"with ``-m``." msgstr "" +"パッケージについては、``__main__.py`` モジュールを用意することで同じ効果を得" +"られます。``__main__.py`` にモジュールが ``-m`` オプションで呼びだされたとき" +"に実行したいコードを書くことができます。" diff --git a/library/_thread.po b/library/_thread.po index af5c2db0e..67f15e803 100644 --- a/library/_thread.po +++ b/library/_thread.po @@ -1,33 +1,36 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: +# Inada Naoki , 2017 +# Shun Sakurai, 2017 +# E. Kawashima, 2017 +# Arihiro TAKASE, 2017 +# 秘湯 , 2017 +# tomo, 2019 # Takanori Suzuki , 2021 -# tomo, 2023 -# Inada Naoki , 2023 -# 石井明久, 2024 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:54+0000\n" -"Last-Translator: 石井明久, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 17:47+0000\n" +"Last-Translator: Takanori Suzuki , 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/_thread.rst:2 -msgid ":mod:`!_thread` --- Low-level threading API" -msgstr ":mod:`!_thread` --- 低水準なスレッド API" +msgid ":mod:`_thread` --- Low-level threading API" +msgstr ":mod:`_thread` --- 低水準の スレッド API" #: ../../library/_thread.rst:15 msgid "" @@ -96,46 +99,24 @@ msgid "" msgstr "" #: ../../library/_thread.rst:60 -msgid "" -"Raises an :ref:`auditing event ` ``_thread.start_new_thread`` with " -"arguments ``function``, ``args``, ``kwargs``." -msgstr "" - -#: ../../library/_thread.rst:62 msgid ":func:`sys.unraisablehook` is now used to handle unhandled exceptions." msgstr "" -#: ../../library/_thread.rst:68 -msgid "" -"Simulate the effect of a signal arriving in the main thread. A thread can " -"use this function to interrupt the main thread, though there is no guarantee " -"that the interruption will happen immediately." -msgstr "" - -#: ../../library/_thread.rst:72 -msgid "" -"If given, *signum* is the number of the signal to simulate. If *signum* is " -"not given, :const:`signal.SIGINT` is simulated." -msgstr "" - -#: ../../library/_thread.rst:75 +#: ../../library/_thread.rst:66 msgid "" -"If the given signal isn't handled by Python (it was set to :const:`signal." -"SIG_DFL` or :const:`signal.SIG_IGN`), this function does nothing." +"Simulate the effect of a :data:`signal.SIGINT` signal arriving in the main " +"thread. A thread can use this function to interrupt the main thread." msgstr "" -#: ../../library/_thread.rst:79 -msgid "The *signum* argument is added to customize the signal number." -msgstr "" - -#: ../../library/_thread.rst:83 +#: ../../library/_thread.rst:69 msgid "" -"This does not emit the corresponding signal but schedules a call to the " -"associated handler (if it exists). If you want to truly emit the signal, " -"use :func:`signal.raise_signal`." +"If :data:`signal.SIGINT` isn't handled by Python (it was set to :data:" +"`signal.SIG_DFL` or :data:`signal.SIG_IGN`), this function does nothing." msgstr "" +":data:`signal.SIGINT` が Python に対処されなかった (:data:`signal.SIG_DFL` ま" +"たは :data:`signal.SIG_IGN` に設定されていた) 場合、この関数は何もしません。" -#: ../../library/_thread.rst:90 +#: ../../library/_thread.rst:76 msgid "" "Raise the :exc:`SystemExit` exception. When not caught, this will cause the " "thread to exit silently." @@ -143,7 +124,7 @@ msgstr "" ":exc:`SystemExit` を送出します。それが捕えられないときは、静かにスレッドを終" "了させます。" -#: ../../library/_thread.rst:104 +#: ../../library/_thread.rst:90 msgid "" "Return a new lock object. Methods of locks are described below. The lock " "is initially unlocked." @@ -151,7 +132,7 @@ msgstr "" "新しいロックオブジェクトを返します。ロックのメソッドはこの後に記述されます。" "ロックは初期状態としてアンロック状態です。" -#: ../../library/_thread.rst:110 +#: ../../library/_thread.rst:96 msgid "" "Return the 'thread identifier' of the current thread. This is a nonzero " "integer. Its value has no direct meaning; it is intended as a magic cookie " @@ -164,7 +145,7 @@ msgstr "" "な、マジッククッキーとして意図されています。スレッドが終了し、他のスレッドが" "作られたとき、スレッド ID は再利用されるかもしれません。" -#: ../../library/_thread.rst:118 +#: ../../library/_thread.rst:104 msgid "" "Return the native integral Thread ID of the current thread assigned by the " "kernel. This is a non-negative integer. Its value may be used to uniquely " @@ -172,15 +153,15 @@ msgid "" "after which the value may be recycled by the OS)." msgstr "" -#: ../../library/_thread.rst:123 ../../library/_thread.rst:148 -msgid "Availability" -msgstr "" - -#: ../../library/_thread.rst:127 -msgid "Added support for GNU/kFreeBSD." +#: ../../library/_thread.rst:110 +msgid "" +":ref:`Availability `: Windows, FreeBSD, Linux, macOS, OpenBSD, " +"NetBSD, AIX." msgstr "" +":ref:`利用可能な環境 `: Windows, FreeBSD, Linux, macOS, " +"OpenBSD, NetBSD, AIX。" -#: ../../library/_thread.rst:133 +#: ../../library/_thread.rst:116 msgid "" "Return the thread stack size used when creating new threads. The optional " "*size* argument specifies the stack size to be used for subsequently created " @@ -213,22 +194,25 @@ msgstr "" "トフォームに関する情報がない場合は 4096 の整数倍のスタックサイズを選ぶといい" "かもしれません)。" -#: ../../library/_thread.rst:150 -msgid "Unix platforms with POSIX threads support." +#: ../../library/_thread.rst:131 +msgid "" +":ref:`Availability `: Windows, systems with POSIX threads." msgstr "" -#: ../../library/_thread.rst:155 +#: ../../library/_thread.rst:136 msgid "" -"The maximum value allowed for the *timeout* parameter of :meth:`Lock.acquire " -"`. Specifying a timeout greater than this value will " -"raise an :exc:`OverflowError`." +"The maximum value allowed for the *timeout* parameter of :meth:`Lock." +"acquire`. Specifying a timeout greater than this value will raise an :exc:" +"`OverflowError`." msgstr "" +":meth:`Lock.acquire` の *timeout* 引数に許される最大値です。これ以上の値を " +"timeout に指定すると :exc:`OverflowError` を発生させます。" -#: ../../library/_thread.rst:162 +#: ../../library/_thread.rst:143 msgid "Lock objects have the following methods:" msgstr "ロックオブジェクトは次のようなメソッドを持っています:" -#: ../../library/_thread.rst:167 +#: ../../library/_thread.rst:148 msgid "" "Without any optional argument, this method acquires the lock " "unconditionally, if necessary waiting until it is released by another thread " @@ -240,23 +224,29 @@ msgstr "" "ている場合には解除されるまで待ってからロックを獲得します (同時にロックを獲得" "できるスレッドはひとつだけであり、これこそがロックの存在理由です)。" -#: ../../library/_thread.rst:171 +#: ../../library/_thread.rst:152 msgid "" -"If the *blocking* argument is present, the action depends on its value: if " -"it is false, the lock is only acquired if it can be acquired immediately " -"without waiting, while if it is true, the lock is acquired unconditionally " -"as above." +"If the integer *waitflag* argument is present, the action depends on its " +"value: if it is zero, the lock is only acquired if it can be acquired " +"immediately without waiting, while if it is nonzero, the lock is acquired " +"unconditionally as above." msgstr "" +"整数の引数 *waitflag* を指定すると、その値によって動作が変わります。引数が " +"``0`` のときは、待たずにすぐ獲得できる場合にだけロックを獲得します。``0`` 以" +"外の値を与えると、先の例と同様、ロックの状態にかかわらず獲得をおこないます。" -#: ../../library/_thread.rst:176 +#: ../../library/_thread.rst:157 msgid "" "If the floating-point *timeout* argument is present and positive, it " "specifies the maximum wait time in seconds before returning. A negative " "*timeout* argument specifies an unbounded wait. You cannot specify a " -"*timeout* if *blocking* is false." +"*timeout* if *waitflag* is zero." msgstr "" +"*timeout* 引数に正の float 値が指定された場合、返る前に待つ最大の時間を秒数で" +"指定します。負の *timeout* 引数は無制限に待つことを指定します。*waitflag* が " +"0 の時は *timeout* を指定することはできません。" -#: ../../library/_thread.rst:181 +#: ../../library/_thread.rst:162 msgid "" "The return value is ``True`` if the lock is acquired successfully, ``False`` " "if not." @@ -264,19 +254,15 @@ msgstr "" "なお、ロックを獲得できた場合は ``True``、できなかった場合は ``False`` を返し" "ます。" -#: ../../library/_thread.rst:184 +#: ../../library/_thread.rst:165 msgid "The *timeout* parameter is new." msgstr "新しい *timeout* 引数。" -#: ../../library/_thread.rst:187 +#: ../../library/_thread.rst:168 msgid "Lock acquires can now be interrupted by signals on POSIX." msgstr "POSIX ではロックの取得がシグナルに割り込まれるようになりました。" -#: ../../library/_thread.rst:190 -msgid "Lock acquires can now be interrupted by signals on Windows." -msgstr "" - -#: ../../library/_thread.rst:196 +#: ../../library/_thread.rst:174 msgid "" "Releases the lock. The lock must have been acquired earlier, but not " "necessarily by the same thread." @@ -284,7 +270,7 @@ msgstr "" "ロックを解放します。そのロックは既に獲得されたものでなければなりませんが、し" "かし同じスレッドによって獲得されたものである必要はありません。" -#: ../../library/_thread.rst:202 +#: ../../library/_thread.rst:180 msgid "" "Return the status of the lock: ``True`` if it has been acquired by some " "thread, ``False`` if not." @@ -292,7 +278,7 @@ msgstr "" "ロックの状態を返します: 同じスレッドによって獲得されたものなら ``True`` 、違" "うのなら ``False`` を返します。" -#: ../../library/_thread.rst:205 +#: ../../library/_thread.rst:183 msgid "" "In addition to these methods, lock objects can also be used via the :keyword:" "`with` statement, e.g.::" @@ -300,27 +286,21 @@ msgstr "" "これらのメソッドに加えて、ロックオブジェクトは :keyword:`with` 文を通じて以下" "の例のように使うこともできます。 ::" -#: ../../library/_thread.rst:208 -msgid "" -"import _thread\n" -"\n" -"a_lock = _thread.allocate_lock()\n" -"\n" -"with a_lock:\n" -" print(\"a_lock is locked while this executes\")" -msgstr "" - -#: ../../library/_thread.rst:215 +#: ../../library/_thread.rst:193 msgid "**Caveats:**" msgstr "**警告:**" -#: ../../library/_thread.rst:219 +#: ../../library/_thread.rst:197 msgid "" -"Interrupts always go to the main thread (the :exc:`KeyboardInterrupt` " -"exception will be received by that thread.)" +"Threads interact strangely with interrupts: the :exc:`KeyboardInterrupt` " +"exception will be received by an arbitrary thread. (When the :mod:`signal` " +"module is available, interrupts always go to the main thread.)" msgstr "" +"スレッドは割り込みと奇妙な相互作用をします: :exc:`KeyboardInterrupt` 例外は任" +"意のスレッドによって受け取られます。 (:mod:`signal` モジュールが利用可能なと" +"き、割り込みは常にメインスレッドへ行きます。)" -#: ../../library/_thread.rst:222 +#: ../../library/_thread.rst:201 msgid "" "Calling :func:`sys.exit` or raising the :exc:`SystemExit` exception is " "equivalent to calling :func:`_thread.exit`." @@ -328,7 +308,16 @@ msgstr "" ":func:`sys.exit` を呼び出す、あるいは :exc:`SystemExit` 例外を送出すること" "は、 :func:`_thread.exit` を呼び出すことと同じです。" -#: ../../library/_thread.rst:225 +#: ../../library/_thread.rst:204 +msgid "" +"It is not possible to interrupt the :meth:`acquire` method on a lock --- " +"the :exc:`KeyboardInterrupt` exception will happen after the lock has been " +"acquired." +msgstr "" +"ロックの :meth:`acquire` メソッドに割り込むことはできません --- :exc:" +"`KeyboardInterrupt` 例外は、ロックが獲得された後に発生します。" + +#: ../../library/_thread.rst:207 msgid "" "When the main thread exits, it is system defined whether the other threads " "survive. On most systems, they are killed without executing :keyword:" @@ -338,38 +327,12 @@ msgstr "" "存します。多くのシステムでは、 :keyword:`try` ... :keyword:`finally` 節や、オ" "ブジェクトデストラクタを実行せずに終了されます。" -#: ../../library/_thread.rst:7 -msgid "light-weight processes" -msgstr "light-weight processes" - -#: ../../library/_thread.rst:7 -msgid "processes, light-weight" -msgstr "processes, light-weight" - -#: ../../library/_thread.rst:7 -msgid "binary semaphores" -msgstr "binary semaphores" - -#: ../../library/_thread.rst:7 -msgid "semaphores, binary" -msgstr "semaphores, binary" - -#: ../../library/_thread.rst:22 -msgid "pthreads" -msgstr "pthreads" - -#: ../../library/_thread.rst:22 -msgid "threads" -msgstr "threads" - -#: ../../library/_thread.rst:22 -msgid "POSIX" -msgstr "POSIX" - -#: ../../library/_thread.rst:217 -msgid "module" -msgstr "module" - -#: ../../library/_thread.rst:217 -msgid "signal" -msgstr "signal" +#: ../../library/_thread.rst:212 +msgid "" +"When the main thread exits, it does not do any of its usual cleanup (except " +"that :keyword:`try` ... :keyword:`finally` clauses are honored), and the " +"standard I/O files are not flushed." +msgstr "" +"メインスレッドが終了したとき、それの通常のクリーンアップは行なわれず、 (:" +"keyword:`try` ... :keyword:`finally` 節が尊重されることは除きます)、標準 I/O " +"ファイルはフラッシュされません。" diff --git a/library/abc.po b/library/abc.po index 7b49c4bdb..540cf127b 100644 --- a/library/abc.po +++ b/library/abc.po @@ -1,31 +1,38 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 -# 石井明久, 2024 +# 秘湯 , 2017 +# MATSUI Fe2+ Tetsushi , 2017 +# Inada Naoki , 2017 +# Arihiro TAKASE, 2017 +# hitsumabushi.org, 2018 +# Yusuke Miyazaki , 2018 +# tomo, 2019 +# mollinaca, 2021 +# Osamu NAKAMURA, 2021 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-06 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:54+0000\n" -"Last-Translator: 石井明久, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 17:47+0000\n" +"Last-Translator: Osamu NAKAMURA, 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/abc.rst:2 -msgid ":mod:`!abc` --- Abstract Base Classes" -msgstr ":mod:`!abc` --- 抽象基底クラス" +msgid ":mod:`abc` --- Abstract Base Classes" +msgstr ":mod:`abc` --- 抽象基底クラス" #: ../../library/abc.rst:11 msgid "**Source code:** :source:`Lib/abc.py`" @@ -49,9 +56,15 @@ msgid "" "The :mod:`collections` module has some concrete classes that derive from " "ABCs; these can, of course, be further derived. In addition, the :mod:" "`collections.abc` submodule has some ABCs that can be used to test whether a " -"class or instance provides a particular interface, for example, if it is :" -"term:`hashable` or if it is a :term:`mapping`." +"class or instance provides a particular interface, for example, if it is " +"hashable or if it is a mapping." msgstr "" +":mod:`collections.abc` サブモジュールには ABC から派生した具象クラスがいくつ" +"かあります。\n" +"もちろん、このクラスから、さらに派生させることもできます。\n" +"また :mod:`collections.abs` サブモジュールにはいくつかの ABC もあって、あるク" +"ラスやインスタンスが特定のインターフェースを提供しているかどうか、たとえば、" +"ハッシュ可能なのかやマッピングなのか、をテストできます。" #: ../../library/abc.rst:27 msgid "" @@ -65,34 +78,26 @@ msgstr "" #: ../../library/abc.rst:32 msgid "" "A helper class that has :class:`ABCMeta` as its metaclass. With this class, " -"an abstract base class can be created by simply deriving from :class:`!ABC` " +"an abstract base class can be created by simply deriving from :class:`ABC` " "avoiding sometimes confusing metaclass usage, for example::" msgstr "" - -#: ../../library/abc.rst:36 -msgid "" -"from abc import ABC\n" -"\n" -"class MyABC(ABC):\n" -" pass" -msgstr "" +":class:`ABCMeta` をメタクラスとするヘルパークラスです。このクラスを使うと、混" +"乱しがちなメタクラスを使わずに、単に :class:`ABC` を継承するだけで抽象基底ク" +"ラスを作成できます。例::" #: ../../library/abc.rst:41 msgid "" -"Note that the type of :class:`!ABC` is still :class:`ABCMeta`, therefore " -"inheriting from :class:`!ABC` requires the usual precautions regarding " +"Note that the type of :class:`ABC` is still :class:`ABCMeta`, therefore " +"inheriting from :class:`ABC` requires the usual precautions regarding " "metaclass usage, as multiple inheritance may lead to metaclass conflicts. " "One may also define an abstract base class by passing the metaclass keyword " -"and using :class:`!ABCMeta` directly, for example::" -msgstr "" - -#: ../../library/abc.rst:47 -msgid "" -"from abc import ABCMeta\n" -"\n" -"class MyABC(metaclass=ABCMeta):\n" -" pass" +"and using :class:`ABCMeta` directly, for example::" msgstr "" +":class:`ABC` の型はやはり :class:`ABCMeta` であり、そのため :class:`ABC` から" +"継承するときは、メタクラスの衝突を引き起こし得る多重継承のような、メタクラス" +"を使う上でのいつもの用心が求められることに注意してください。 metaclass キー" +"ワードを渡し、 :class:`ABCMeta` を直接利用することで、抽象基底クラスを直接定" +"義することもできます。例::" #: ../../library/abc.rst:57 msgid "Metaclass for defining Abstract Base Classes (ABCs)." @@ -119,9 +124,11 @@ msgstr "" #: ../../library/abc.rst:68 msgid "" -"Classes created with a metaclass of :class:`!ABCMeta` have the following " +"Classes created with a metaclass of :class:`ABCMeta` have the following " "method:" msgstr "" +"メタクラス :class:`ABCMeta` を使って作られたクラスには以下のメソッドがありま" +"す:" #: ../../library/abc.rst:72 msgid "" @@ -129,19 +136,6 @@ msgid "" msgstr "" "*subclass* を \"仮想的サブクラス\" としてこの ABC に登録します。たとえば::" -#: ../../library/abc.rst:75 -msgid "" -"from abc import ABC\n" -"\n" -"class MyABC(ABC):\n" -" pass\n" -"\n" -"MyABC.register(tuple)\n" -"\n" -"assert issubclass(tuple, MyABC)\n" -"assert isinstance((), MyABC)" -msgstr "" - #: ../../library/abc.rst:85 msgid "Returns the registered subclass, to allow usage as a class decorator." msgstr "" @@ -150,9 +144,11 @@ msgstr "" #: ../../library/abc.rst:88 msgid "" -"To detect calls to :meth:`!register`, you can use the :func:" -"`get_cache_token` function." +"To detect calls to :meth:`register`, you can use the :func:`get_cache_token` " +"function." msgstr "" +":meth:`register` の呼び出しを検出するために、:func:`get_cache_token` 関数を" +"使うことができます。" #: ../../library/abc.rst:92 msgid "You can also override this method in an abstract base class:" @@ -165,86 +161,79 @@ msgstr "(クラスメソッドとして定義しなければなりません。)" #: ../../library/abc.rst:98 msgid "" "Check whether *subclass* is considered a subclass of this ABC. This means " -"that you can customize the behavior of :func:`issubclass` further without " -"the need to call :meth:`register` on every class you want to consider a " -"subclass of the ABC. (This class method is called from the :meth:`~type." -"__subclasscheck__` method of the ABC.)" +"that you can customize the behavior of ``issubclass`` further without the " +"need to call :meth:`register` on every class you want to consider a subclass " +"of the ABC. (This class method is called from the :meth:`__subclasscheck__` " +"method of the ABC.)" msgstr "" +"*subclass* がこの ABC のサブクラスと見なせるかどうかチェックします。これに" +"よって ABC のサブクラスと見なしたい全てのクラスについて :meth:`register` を呼" +"び出すことなく ``issubclass`` の振る舞いをさらにカスタマイズできます。 (この" +"クラスメソッドは ABC の :meth:`__subclasscheck__` メソッドから呼び出されま" +"す。)" #: ../../library/abc.rst:104 msgid "" -"This method should return ``True``, ``False`` or :data:`NotImplemented`. If " -"it returns ``True``, the *subclass* is considered a subclass of this ABC. If " -"it returns ``False``, the *subclass* is not considered a subclass of this " -"ABC, even if it would normally be one. If it returns :data:`!" -"NotImplemented`, the subclass check is continued with the usual mechanism." +"This method should return ``True``, ``False`` or ``NotImplemented``. If it " +"returns ``True``, the *subclass* is considered a subclass of this ABC. If it " +"returns ``False``, the *subclass* is not considered a subclass of this ABC, " +"even if it would normally be one. If it returns ``NotImplemented``, the " +"subclass check is continued with the usual mechanism." msgstr "" +"このメソッドは ``True``, ``False`` または ``NotImplemented`` を返さなければな" +"りません。``True`` を返す場合は、*subclass* はこの ABC のサブクラスと見なされ" +"ます。``False`` を返す場合は、*subclass* はたとえ通常の意味でサブクラスであっ" +"ても ABC のサブクラスではないと見なされます。``NotImplemented`` の場合、サブ" +"クラスチェックは通常のメカニズムに戻ります。" #: ../../library/abc.rst:114 msgid "" "For a demonstration of these concepts, look at this example ABC definition::" msgstr "この概念のデモとして、次の ABC 定義の例を見てください::" -#: ../../library/abc.rst:116 -msgid "" -"class Foo:\n" -" def __getitem__(self, index):\n" -" ...\n" -" def __len__(self):\n" -" ...\n" -" def get_iterator(self):\n" -" return iter(self)\n" -"\n" -"class MyIterable(ABC):\n" -"\n" -" @abstractmethod\n" -" def __iter__(self):\n" -" while False:\n" -" yield None\n" -"\n" -" def get_iterator(self):\n" -" return self.__iter__()\n" -"\n" -" @classmethod\n" -" def __subclasshook__(cls, C):\n" -" if cls is MyIterable:\n" -" if any(\"__iter__\" in B.__dict__ for B in C.__mro__):\n" -" return True\n" -" return NotImplemented\n" -"\n" -"MyIterable.register(Foo)" -msgstr "" - #: ../../library/abc.rst:143 msgid "" -"The ABC ``MyIterable`` defines the standard iterable method, :meth:`~object." -"__iter__`, as an abstract method. The implementation given here can still " -"be called from subclasses. The :meth:`!get_iterator` method is also part of " -"the ``MyIterable`` abstract base class, but it does not have to be " -"overridden in non-abstract derived classes." +"The ABC ``MyIterable`` defines the standard iterable method, :meth:" +"`~iterator.__iter__`, as an abstract method. The implementation given here " +"can still be called from subclasses. The :meth:`get_iterator` method is " +"also part of the ``MyIterable`` abstract base class, but it does not have to " +"be overridden in non-abstract derived classes." msgstr "" +"ABC ``MyIterable`` は標準的なイテラブルのメソッド :meth:`~iterator.__iter__` " +"を抽象メソッドとして定義します。ここで与えられている抽象クラスの実装は、サブ" +"クラスから呼び出すことができます。 :meth:`get_iterator` メソッドも " +"``MyIterable`` 抽象基底クラスの一部ですが、抽象的でない派生クラスはこれをオー" +"バーライドする必要はありません。" #: ../../library/abc.rst:149 msgid "" "The :meth:`__subclasshook__` class method defined here says that any class " -"that has an :meth:`~object.__iter__` method in its :attr:`~object.__dict__` " -"(or in that of one of its base classes, accessed via the :attr:`~type." -"__mro__` list) is considered a ``MyIterable`` too." +"that has an :meth:`~iterator.__iter__` method in its :attr:`~object." +"__dict__` (or in that of one of its base classes, accessed via the :attr:" +"`~class.__mro__` list) is considered a ``MyIterable`` too." msgstr "" +"ここで定義されるクラスメソッド :meth:`__subclasshook__` の意味は、 :meth:" +"`~iterator.__iter__` メソッドがクラスの(または :attr:`~class.__mro__` でアク" +"セスされる基底クラスの一つの) :attr:`~object.__dict__` にある場合にもそのクラ" +"スが ``MyIterable`` だと見なされるということです。" #: ../../library/abc.rst:154 msgid "" "Finally, the last line makes ``Foo`` a virtual subclass of ``MyIterable``, " -"even though it does not define an :meth:`~object.__iter__` method (it uses " -"the old-style iterable protocol, defined in terms of :meth:`~object.__len__` " -"and :meth:`~object.__getitem__`). Note that this will not make " -"``get_iterator`` available as a method of ``Foo``, so it is provided " -"separately." +"even though it does not define an :meth:`~iterator.__iter__` method (it uses " +"the old-style iterable protocol, defined in terms of :meth:`__len__` and :" +"meth:`__getitem__`). Note that this will not make ``get_iterator`` " +"available as a method of ``Foo``, so it is provided separately." msgstr "" +"最後に、一番下の行は ``Foo`` を :meth:`~iterator.__iter__` メソッドを定義しな" +"いにもかかわらず ``MyIterable`` の仮想的サブクラスにします(``Foo`` は古い様式" +"の :meth:`__len__` と :meth:`__getitem__` を用いたイテレータプロトコルを使っ" +"ています。)。これによって ``Foo`` のメソッドとして ``get_iterator`` が手に入" +"るわけではないことに注意してください。それは別に提供されています。" #: ../../library/abc.rst:163 -msgid "The :mod:`!abc` module also provides the following decorator:" -msgstr "" +msgid "The :mod:`abc` module also provides the following decorator:" +msgstr ":mod:`abc` モジュールは以下のデコレータも提供しています:" #: ../../library/abc.rst:167 msgid "A decorator indicating abstract methods." @@ -253,83 +242,57 @@ msgstr "抽象メソッドを示すデコレータです。" #: ../../library/abc.rst:169 msgid "" "Using this decorator requires that the class's metaclass is :class:`ABCMeta` " -"or is derived from it. A class that has a metaclass derived from :class:`!" -"ABCMeta` cannot be instantiated unless all of its abstract methods and " +"or is derived from it. A class that has a metaclass derived from :class:" +"`ABCMeta` cannot be instantiated unless all of its abstract methods and " "properties are overridden. The abstract methods can be called using any of " -"the normal 'super' call mechanisms. :func:`!abstractmethod` may be used to " +"the normal 'super' call mechanisms. :func:`abstractmethod` may be used to " "declare abstract methods for properties and descriptors." msgstr "" +"このデコレータを使うには、クラスのメタクラスが :class:`ABCMeta` かそれを継承" +"したものである必要があります。 :class:`ABCMeta` の派生クラスをメタクラスに持" +"つクラスは、全ての抽象メソッドとプロパティをオーバーライドしない限りインスタ" +"ンス化することができません。抽象メソッドは通常の 'super' 呼び出し方法で呼ぶこ" +"とができます。 :func:`abstractmethod` はプロパティやデスクリプタのために抽象" +"メソッドを定義することもできます。" #: ../../library/abc.rst:176 msgid "" "Dynamically adding abstract methods to a class, or attempting to modify the " -"abstraction status of a method or class once it is created, are only " -"supported using the :func:`update_abstractmethods` function. The :func:`!" -"abstractmethod` only affects subclasses derived using regular inheritance; " -"\"virtual subclasses\" registered with the ABC's :meth:`~ABCMeta.register` " -"method are not affected." +"abstraction status of a method or class once it is created, are not " +"supported. The :func:`abstractmethod` only affects subclasses derived using " +"regular inheritance; \"virtual subclasses\" registered with the ABC's :meth:" +"`register` method are not affected." msgstr "" +"クラスに動的に抽象メソッドを追加する、あるいはメソッドやクラスが作られた後か" +"ら抽象的かどうかの状態を変更しようと試みることは、サポートされません。 :func:" +"`abstractmethod` が影響を与えるのは正規の継承により派生したサブクラスのみで、" +"ABC の :meth:`register` メソッドで登録された \"仮想的サブクラス\" は影響され" +"ません。" -#: ../../library/abc.rst:183 +#: ../../library/abc.rst:182 msgid "" -"When :func:`!abstractmethod` is applied in combination with other method " +"When :func:`abstractmethod` is applied in combination with other method " "descriptors, it should be applied as the innermost decorator, as shown in " "the following usage examples::" msgstr "" +":func:`abstractmethod` が他のメソッドデスクリプタと組み合わされる場合、次の例" +"のように、一番内側のデコレータとして適用しなければなりません::" -#: ../../library/abc.rst:187 -msgid "" -"class C(ABC):\n" -" @abstractmethod\n" -" def my_abstract_method(self, arg1):\n" -" ...\n" -" @classmethod\n" -" @abstractmethod\n" -" def my_abstract_classmethod(cls, arg2):\n" -" ...\n" -" @staticmethod\n" -" @abstractmethod\n" -" def my_abstract_staticmethod(arg3):\n" -" ...\n" -"\n" -" @property\n" -" @abstractmethod\n" -" def my_abstract_property(self):\n" -" ...\n" -" @my_abstract_property.setter\n" -" @abstractmethod\n" -" def my_abstract_property(self, val):\n" -" ...\n" -"\n" -" @abstractmethod\n" -" def _get_x(self):\n" -" ...\n" -" @abstractmethod\n" -" def _set_x(self, val):\n" -" ...\n" -" x = property(_get_x, _set_x)" -msgstr "" - -#: ../../library/abc.rst:217 +#: ../../library/abc.rst:216 msgid "" "In order to correctly interoperate with the abstract base class machinery, " -"the descriptor must identify itself as abstract using :attr:`!" -"__isabstractmethod__`. In general, this attribute should be ``True`` if any " +"the descriptor must identify itself as abstract using :attr:" +"`__isabstractmethod__`. In general, this attribute should be ``True`` if any " "of the methods used to compose the descriptor are abstract. For example, " "Python's built-in :class:`property` does the equivalent of::" msgstr "" +"デスクリプタをABC 機構と協調させるために、デスクリプタは :attr:" +"`__isabstractmethod__` を使って自身が抽象であることを示さなければなりません。" +"一般的に、この属性は、そのデスクリプタを構成するのに使われたメソッドのいずれ" +"かが抽象である場合に ``True`` になります。例えば、 Python 組み込みの :class:" +"`property` は、次のコードと透過に振る舞います::" -#: ../../library/abc.rst:223 -msgid "" -"class Descriptor:\n" -" ...\n" -" @property\n" -" def __isabstractmethod__(self):\n" -" return any(getattr(f, '__isabstractmethod__', False) for\n" -" f in (self._fget, self._fset, self._fdel))" -msgstr "" - -#: ../../library/abc.rst:232 +#: ../../library/abc.rst:231 msgid "" "Unlike Java abstract methods, these abstract methods may have an " "implementation. This implementation can be called via the :func:`super` " @@ -343,8 +306,8 @@ msgstr "" "出しの終点として有効です。" #: ../../library/abc.rst:239 -msgid "The :mod:`!abc` module also supports the following legacy decorators:" -msgstr "" +msgid "The :mod:`abc` module also supports the following legacy decorators:" +msgstr ":mod:`abc` モジュールは以下のレガシーなデコレータも提供しています:" #: ../../library/abc.rst:244 msgid "" @@ -370,15 +333,6 @@ msgstr "" "この特殊ケースは :func:`classmethod` デコレータが抽象メソッドに適用された場合" "に抽象的だと正しく認識されるようになったため撤廃されます::" -#: ../../library/abc.rst:255 -msgid "" -"class C(ABC):\n" -" @classmethod\n" -" @abstractmethod\n" -" def my_abstract_classmethod(cls, arg):\n" -" ..." -msgstr "" - #: ../../library/abc.rst:265 msgid "" "It is now possible to use :class:`staticmethod` with :func:`abstractmethod`, " @@ -403,15 +357,6 @@ msgstr "" "この特殊ケースは :func:`staticmethod` デコレータが抽象メソッドに適用された場" "合に抽象的だと正しく認識されるようになったため撤廃されます::" -#: ../../library/abc.rst:276 -msgid "" -"class C(ABC):\n" -" @staticmethod\n" -" @abstractmethod\n" -" def my_abstract_staticmethod(arg):\n" -" ..." -msgstr "" - #: ../../library/abc.rst:285 msgid "" "It is now possible to use :class:`property`, :meth:`property.getter`, :meth:" @@ -437,15 +382,6 @@ msgstr "" "この特殊ケースは :func:`property` デコレータが抽象メソッドに適用された場合に" "抽象的だと正しく認識されるようになったため撤廃されます::" -#: ../../library/abc.rst:297 -msgid "" -"class C(ABC):\n" -" @property\n" -" @abstractmethod\n" -" def my_abstract_property(self):\n" -" ..." -msgstr "" - #: ../../library/abc.rst:303 msgid "" "The above example defines a read-only property; you can also define a read-" @@ -456,19 +392,6 @@ msgstr "" "ドの1つ以上を abstract にすることで、読み書きできる抽象プロパティを定義するこ" "とができます::" -#: ../../library/abc.rst:307 -msgid "" -"class C(ABC):\n" -" @property\n" -" def x(self):\n" -" ...\n" -"\n" -" @x.setter\n" -" @abstractmethod\n" -" def x(self, val):\n" -" ..." -msgstr "" - #: ../../library/abc.rst:317 msgid "" "If only some components are abstract, only those components need to be " @@ -477,17 +400,9 @@ msgstr "" "構成するメソッド全てが abstract でない場合、abstract と定義されたメソッドのみ" "が、具象サブクラスによってオーバーライドする必要があります::" -#: ../../library/abc.rst:320 -msgid "" -"class D(C):\n" -" @C.x.setter\n" -" def x(self, val):\n" -" ..." -msgstr "" - #: ../../library/abc.rst:326 -msgid "The :mod:`!abc` module also provides the following functions:" -msgstr "" +msgid "The :mod:`abc` module also provides the following functions:" +msgstr ":mod:`abc` モジュールは以下の関数も提供しています:" #: ../../library/abc.rst:330 msgid "Returns the current abstract base class cache token." @@ -505,32 +420,10 @@ msgstr "" "す。" #: ../../library/abc.rst:340 -msgid "" -"A function to recalculate an abstract class's abstraction status. This " -"function should be called if a class's abstract methods have been " -"implemented or changed after it was created. Usually, this function should " -"be called from within a class decorator." -msgstr "" - -#: ../../library/abc.rst:345 -msgid "Returns *cls*, to allow usage as a class decorator." -msgstr "" - -#: ../../library/abc.rst:347 -msgid "If *cls* is not an instance of :class:`ABCMeta`, does nothing." -msgstr "" - -#: ../../library/abc.rst:351 -msgid "" -"This function assumes that *cls*'s superclasses are already updated. It does " -"not update any subclasses." -msgstr "" - -#: ../../library/abc.rst:357 msgid "Footnotes" msgstr "脚注" -#: ../../library/abc.rst:358 +#: ../../library/abc.rst:341 msgid "" "C++ programmers should note that Python's virtual base class concept is not " "the same as C++'s." diff --git a/library/aifc.po b/library/aifc.po index cc1e88f5b..da608ef73 100644 --- a/library/aifc.po +++ b/library/aifc.po @@ -1,36 +1,341 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # +# Translators: +# Yusuke Miyazaki , 2017 +# Inada Naoki , 2017 +# 秘湯 , 2017 +# Arihiro TAKASE, 2017 +# tomo, 2019 +# #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-13 14:21+0000\n" -"PO-Revision-Date: 2024-11-19 01:02+0000\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 17:47+0000\n" +"Last-Translator: tomo, 2019\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/aifc.rst:2 -msgid ":mod:`!aifc` --- Read and write AIFF and AIFC files" +msgid ":mod:`aifc` --- Read and write AIFF and AIFC files" +msgstr ":mod:`aifc` --- AIFFおよびAIFCファイルの読み書き" + +#: ../../library/aifc.rst:7 +msgid "**Source code:** :source:`Lib/aifc.py`" +msgstr "**ソースコード:** :source:`Lib/aifc.py`" + +#: ../../library/aifc.rst:16 +msgid "" +"This module provides support for reading and writing AIFF and AIFF-C files. " +"AIFF is Audio Interchange File Format, a format for storing digital audio " +"samples in a file. AIFF-C is a newer version of the format that includes " +"the ability to compress the audio data." msgstr "" +"このモジュールはAIFFとAIFF-Cファイルの読み書きをサポートします。AIFF(Audio " +"Interchange File Format)はデジタルオーディオサンプルをファイルに保存するため" +"のフォーマットです。AIFF-CはAIFFの新しいバージョンで、オーディオデータの圧縮" +"に対応しています。" + +#: ../../library/aifc.rst:21 +msgid "" +"Audio files have a number of parameters that describe the audio data. The " +"sampling rate or frame rate is the number of times per second the sound is " +"sampled. The number of channels indicate if the audio is mono, stereo, or " +"quadro. Each frame consists of one sample per channel. The sample size is " +"the size in bytes of each sample. Thus a frame consists of ``nchannels * " +"samplesize`` bytes, and a second's worth of audio consists of ``nchannels * " +"samplesize * framerate`` bytes." +msgstr "" +"オーディオファイルには、オーディオデータについて記述したパラメータがたくさん" +"含まれています。サンプリングレートあるいはフレームレートは、1秒あたりのオー" +"ディオサンプル数です。チャンネル数は、モノラル、ステレオ、4チャンネルかどうか" +"を示します。フレームはそれぞれ、チャンネルごとに一つのサンプルからなります。" +"サンプルサイズは、一つのサンプルの大きさをバイト数で示したものです。したがっ" +"て、一つのフレームは ``nchannels * samplesize`` バイト からなり、1秒間では " +"``nchannels * samplesize * framerate`` バイトで構成されます。" + +#: ../../library/aifc.rst:29 +msgid "" +"For example, CD quality audio has a sample size of two bytes (16 bits), uses " +"two channels (stereo) and has a frame rate of 44,100 frames/second. This " +"gives a frame size of 4 bytes (2\\*2), and a second's worth occupies " +"2\\*2\\*44100 bytes (176,400 bytes)." +msgstr "" +"例えば、CD品質のオーディオは2バイト(16ビット)のサンプルサイズを持っていて、" +"2チャンネル(ステレオ)であり、44,100フレーム/秒のフレームレートを持っていま" +"す。そのため、フレームサイズは4バイト(2\\*2)で、1秒間では2\\*2\\*44100バイ" +"ト(176,400バイト)になります。" + +#: ../../library/aifc.rst:34 +msgid "Module :mod:`aifc` defines the following function:" +msgstr ":mod:`aifc` モジュールは以下の関数を定義しています:" + +#: ../../library/aifc.rst:39 +msgid "" +"Open an AIFF or AIFF-C file and return an object instance with methods that " +"are described below. The argument *file* is either a string naming a file " +"or a :term:`file object`. *mode* must be ``'r'`` or ``'rb'`` when the file " +"must be opened for reading, or ``'w'`` or ``'wb'`` when the file must be " +"opened for writing. If omitted, ``file.mode`` is used if it exists, " +"otherwise ``'rb'`` is used. When used for writing, the file object should " +"be seekable, unless you know ahead of time how many samples you are going to " +"write in total and use :meth:`writeframesraw` and :meth:`setnframes`. The :" +"func:`.open` function may be used in a :keyword:`with` statement. When the :" +"keyword:`!with` block completes, the :meth:`~aifc.close` method is called." +msgstr "" +"AIFFあるいはAIFF-Cファイルを開き、後述するメソッドを持つインスタンスを返しま" +"す。引数 *file* はファイルを示す文字列か、 :term:`file object` のいずれかで" +"す。 *mode* は、読み込み用に開くときには ``'r'`` か ``'rb'`` のどちらかでなけ" +"ればならず、書き込み用に開くときには ``'w'`` か ``'wb'`` のどちらかでなければ" +"なりません。もし省略されたら、 ``file.mode`` が存在すればそれが使用され、なけ" +"れば ``'rb'`` が使われます。書き込み用にこのメソッドを使用するときには、これ" +"から全部でどれだけのサンプル数を書き込むのか分からなかったり、 :meth:" +"`writeframesraw` と :meth:`setnframes` を使わないなら、ファイルオブジェクトは" +"シーク可能でなければなりません。:func:`.open` 関数は :keyword:`with` 文の中で" +"使われるかもしれません。:keyword:`!with` ブロックの実行が終了したら、:meth:" +"`~aifc.close` メソッドが呼び出されます。" + +#: ../../library/aifc.rst:50 +msgid "Support for the :keyword:`with` statement was added." +msgstr ":keyword:`with` 構文のサポートが追加されました。" + +#: ../../library/aifc.rst:53 +msgid "" +"Objects returned by :func:`.open` when a file is opened for reading have the " +"following methods:" +msgstr "" +"ファイルが :func:`.open` によって読み込み用に開かれたときに返されるオブジェク" +"トには、以下のメソッドがあります:" + +#: ../../library/aifc.rst:59 +msgid "Return the number of audio channels (1 for mono, 2 for stereo)." +msgstr "オーディオチャンネル数(モノラルなら1、ステレオなら2)を返します。" + +#: ../../library/aifc.rst:64 +msgid "Return the size in bytes of individual samples." +msgstr "サンプルサイズをバイト数で返します。" + +#: ../../library/aifc.rst:69 +msgid "Return the sampling rate (number of audio frames per second)." +msgstr "サンプリングレート(1秒あたりのオーディオフレーム数)を返します。" + +#: ../../library/aifc.rst:74 +msgid "Return the number of audio frames in the file." +msgstr "ファイルの中のオーディオフレーム数を返します。" + +#: ../../library/aifc.rst:79 +msgid "" +"Return a bytes array of length 4 describing the type of compression used in " +"the audio file. For AIFF files, the returned value is ``b'NONE'``." +msgstr "" +"オーディオファイルで使用されている圧縮形式を示す4バイトの bytes を返します。" +"AIFFファイルでは ``b'NONE'`` が返されます。" + +#: ../../library/aifc.rst:86 +msgid "" +"Return a bytes array convertible to a human-readable description of the type " +"of compression used in the audio file. For AIFF files, the returned value " +"is ``b'not compressed'``." +msgstr "" +"オーディオファイルの圧縮形式を人に判読可能な形に変換できる bytes で返します。" +"AIFFファイルでは ``b'not compressed'`` が返されます。" + +#: ../../library/aifc.rst:93 +msgid "" +"Returns a :func:`~collections.namedtuple` ``(nchannels, sampwidth, " +"framerate, nframes, comptype, compname)``, equivalent to output of the :meth:" +"`get\\*` methods." +msgstr "" +":meth:`get\\*` メソッドが返すのと同じ ``(nchannels, sampwidth, framerate, " +"nframes, comptype, compname)`` の :func:`~collections.namedtuple` を返しま" +"す。" + +#: ../../library/aifc.rst:100 +msgid "" +"Return a list of markers in the audio file. A marker consists of a tuple of " +"three elements. The first is the mark ID (an integer), the second is the " +"mark position in frames from the beginning of the data (an integer), the " +"third is the name of the mark (a string)." +msgstr "" +"オーディオファイルのマーカーのリストを返します。一つのマーカーは三つの要素の" +"タプルです。要素の1番目はマークID(整数)、2番目はマーク位置のフレーム数を" +"データの始めから数えた値(整数)、3番目はマークの名称(文字列)です。" + +#: ../../library/aifc.rst:108 +msgid "" +"Return the tuple as described in :meth:`getmarkers` for the mark with the " +"given *id*." +msgstr "" +"与えられた *id* のマークの要素を :meth:`getmarkers` で述べたタプルで返しま" +"す。" + +#: ../../library/aifc.rst:114 +msgid "" +"Read and return the next *nframes* frames from the audio file. The returned " +"data is a string containing for each frame the uncompressed samples of all " +"channels." +msgstr "" +"オーディオファイルの次の *nframes* 個のフレームを読み込んで返します。返される" +"データは、全チャンネルの圧縮されていないサンプルをフレームごとに文字列にした" +"ものです。" + +#: ../../library/aifc.rst:121 +msgid "" +"Rewind the read pointer. The next :meth:`readframes` will start from the " +"beginning." +msgstr "" +"読み込むポインタをデータの始めに巻き戻します。次に :meth:`readframes` を使用" +"すると、データの始めから読み込みます。" + +#: ../../library/aifc.rst:127 +msgid "Seek to the specified frame number." +msgstr "指定したフレーム数の位置にポインタを設定します。" + +#: ../../library/aifc.rst:132 +msgid "Return the current frame number." +msgstr "現在のポインタのフレーム位置を返します。" + +#: ../../library/aifc.rst:137 +msgid "" +"Close the AIFF file. After calling this method, the object can no longer be " +"used." +msgstr "" +"AIFFファイルを閉じます。このメソッドを呼び出したあとでは、オブジェクトはもう" +"使用できません。" + +#: ../../library/aifc.rst:140 +msgid "" +"Objects returned by :func:`.open` when a file is opened for writing have all " +"the above methods, except for :meth:`readframes` and :meth:`setpos`. In " +"addition the following methods exist. The :meth:`get\\*` methods can only " +"be called after the corresponding :meth:`set\\*` methods have been called. " +"Before the first :meth:`writeframes` or :meth:`writeframesraw`, all " +"parameters except for the number of frames must be filled in." +msgstr "" +"ファイルが :func:`.open` によって書き込み用に開かれたときに返されるオブジェク" +"トには、 :meth:`readframes` と :meth:`setpos` を除く上述の全てのメソッドがあ" +"ります。さらに以下のメソッドが定義されています。 :meth:`get\\*` メソッドは、" +"対応する :meth:`set\\*` を呼び出したあとでのみ呼び出し可能です。最初に :meth:" +"`writeframes` あるいは :meth:`writeframesraw` を呼び出す前に、フレーム数を除" +"く全てのパラメータが設定されていなければなりません。" + +#: ../../library/aifc.rst:150 +msgid "" +"Create an AIFF file. The default is that an AIFF-C file is created, unless " +"the name of the file ends in ``'.aiff'`` in which case the default is an " +"AIFF file." +msgstr "" +"AIFFファイルを作ります。デフォルトではAIFF-Cファイルが作られますが、ファイル" +"名が ``'.aiff'`` で終わっていればAIFFファイルが作られます。" + +#: ../../library/aifc.rst:156 +msgid "" +"Create an AIFF-C file. The default is that an AIFF-C file is created, " +"unless the name of the file ends in ``'.aiff'`` in which case the default is " +"an AIFF file." +msgstr "" +"AIFF-Cファイルを作ります。デフォルトではAIFF-Cファイルが作られますが、ファイ" +"ル名が ``'.aiff'`` で終わっていればAIFFファイルが作られます。" + +#: ../../library/aifc.rst:163 +msgid "Specify the number of channels in the audio file." +msgstr "オーディオファイルのチャンネル数を設定します。" + +#: ../../library/aifc.rst:168 +msgid "Specify the size in bytes of audio samples." +msgstr "オーディオのサンプルサイズをバイト数で設定します。" + +#: ../../library/aifc.rst:173 +msgid "Specify the sampling frequency in frames per second." +msgstr "サンプリングレートを1秒あたりのフレーム数で設定します。" + +#: ../../library/aifc.rst:178 +msgid "" +"Specify the number of frames that are to be written to the audio file. If " +"this parameter is not set, or not set correctly, the file needs to support " +"seeking." +msgstr "" +"オーディオファイルに書き込まれるフレーム数を設定します。もしこのパラメータが" +"設定されていなかったり正しくなかったら、ファイルはシークに対応していなければ" +"なりません。" + +#: ../../library/aifc.rst:189 +msgid "" +"Specify the compression type. If not specified, the audio data will not be " +"compressed. In AIFF files, compression is not possible. The name parameter " +"should be a human-readable description of the compression type as a bytes " +"array, the type parameter should be a bytes array of length 4. Currently " +"the following compression types are supported: ``b'NONE'``, ``b'ULAW'``, " +"``b'ALAW'``, ``b'G722'``." +msgstr "" +"圧縮形式を設定します。もし設定しなければ、オーディオデータは圧縮されません。" +"AIFFファイルは圧縮できません。name 引数は人間が読める圧縮形式の説明を bytes " +"にしたもので、type 引数は4バイトの bytes でなければなりません。現在のところ、" +"以下の圧縮形式がサポートされています: ``b'NONE'``, ``b'ULAW'``, " +"``b'ALAW'``, ``b'G722'``。" + +#: ../../library/aifc.rst:199 +msgid "" +"Set all the above parameters at once. The argument is a tuple consisting of " +"the various parameters. This means that it is possible to use the result of " +"a :meth:`getparams` call as argument to :meth:`setparams`." +msgstr "" +"上の全パラメータを一度に設定します。引数はそれぞれのパラメータからなるタプル" +"です。つまり、 :meth:`setparams` の引数として、 :meth:`getparams` を呼び出し" +"た結果を使うことができます。" + +#: ../../library/aifc.rst:206 +msgid "" +"Add a mark with the given id (larger than 0), and the given name at the " +"given position. This method can be called at any time before :meth:`close`." +msgstr "" +"指定したID(1以上)、位置、名称でマークを加えます。このメソッドは、 :meth:" +"`close` の前ならいつでも呼び出すことができます。" + +#: ../../library/aifc.rst:213 +msgid "" +"Return the current write position in the output file. Useful in combination " +"with :meth:`setmark`." +msgstr "" +"出力ファイルの現在の書き込み位置を返します。 :meth:`setmark` との組み合わせで" +"使うと便利です。" + +#: ../../library/aifc.rst:219 +msgid "" +"Write data to the output file. This method can only be called after the " +"audio file parameters have been set." +msgstr "" +"出力ファイルにデータを書き込みます。このメソッドは、オーディオファイルのパラ" +"メータを設定したあとでのみ呼び出し可能です。" + +#: ../../library/aifc.rst:222 ../../library/aifc.rst:231 +msgid "Any :term:`bytes-like object` is now accepted." +msgstr "どのような :term:`bytes-like object` も使用できるようになりました。" -#: ../../library/aifc.rst:10 +#: ../../library/aifc.rst:228 msgid "" -"This module is no longer part of the Python standard library. It was :ref:" -"`removed in Python 3.13 ` after being deprecated in " -"Python 3.11. The removal was decided in :pep:`594`." +"Like :meth:`writeframes`, except that the header of the audio file is not " +"updated." msgstr "" +"オーディオファイルのヘッダ情報が更新されないことを除いて、 :meth:" +"`writeframes` と同じです。" -#: ../../library/aifc.rst:14 +#: ../../library/aifc.rst:238 msgid "" -"The last version of Python that provided the :mod:`!aifc` module was `Python " -"3.12 `_." +"Close the AIFF file. The header of the file is updated to reflect the " +"actual size of the audio data. After calling this method, the object can no " +"longer be used." msgstr "" +"AIFFファイルを閉じます。ファイルのヘッダ情報は、オーディオデータの実際のサイ" +"ズを反映して更新されます。このメソッドを呼び出したあとでは、オブジェクトはも" +"う使用できません。" diff --git a/library/allos.po b/library/allos.po index f8725c548..ebb697069 100644 --- a/library/allos.po +++ b/library/allos.po @@ -1,26 +1,26 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 -# mollinaca, 2021 +# Arihiro TAKASE, 2017 +# mollinaca, 2020 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-30 14:22+0000\n" -"PO-Revision-Date: 2021-06-28 00:54+0000\n" -"Last-Translator: mollinaca, 2021\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 17:47+0000\n" +"Last-Translator: mollinaca, 2020\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/allos.rst:5 diff --git a/library/annotationlib.po b/library/annotationlib.po deleted file mode 100644 index 553866508..000000000 --- a/library/annotationlib.po +++ /dev/null @@ -1,946 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation -# This file is distributed under the same license as the Python package. -# FIRST AUTHOR , YEAR. -# -# Translators: -# tomo, 2025 -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: Python 3.14\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-30 14:22+0000\n" -"PO-Revision-Date: 2025-05-08 06:04+0000\n" -"Last-Translator: tomo, 2025\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" -"ja/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#: ../../library/annotationlib.rst:2 -msgid ":mod:`!annotationlib` --- Functionality for introspecting annotations" -msgstr "" - -#: ../../library/annotationlib.rst:8 -msgid "**Source code:** :source:`Lib/annotationlib.py`" -msgstr "" - -#: ../../library/annotationlib.rst:17 -msgid "" -"The :mod:`!annotationlib` module provides tools for introspecting :term:" -"`annotations ` on modules, classes, and functions." -msgstr "" - -#: ../../library/annotationlib.rst:20 -msgid "" -"Annotations are :ref:`lazily evaluated ` and often contain " -"forward references to objects that are not yet defined when the annotation " -"is created. This module provides a set of low-level tools that can be used " -"to retrieve annotations in a reliable way, even in the presence of forward " -"references and other edge cases." -msgstr "" - -#: ../../library/annotationlib.rst:25 -msgid "" -"This module supports retrieving annotations in three main formats (see :" -"class:`Format`), each of which works best for different use cases:" -msgstr "" - -#: ../../library/annotationlib.rst:28 -msgid "" -":attr:`~Format.VALUE` evaluates the annotations and returns their value. " -"This is most straightforward to work with, but it may raise errors, for " -"example if the annotations contain references to undefined names." -msgstr "" - -#: ../../library/annotationlib.rst:31 -msgid "" -":attr:`~Format.FORWARDREF` returns :class:`ForwardRef` objects for " -"annotations that cannot be resolved, allowing you to inspect the annotations " -"without evaluating them. This is useful when you need to work with " -"annotations that may contain unresolved forward references." -msgstr "" - -#: ../../library/annotationlib.rst:35 -msgid "" -":attr:`~Format.STRING` returns the annotations as a string, similar to how " -"it would appear in the source file. This is useful for documentation " -"generators that want to display annotations in a readable way." -msgstr "" - -#: ../../library/annotationlib.rst:39 -msgid "" -"The :func:`get_annotations` function is the main entry point for retrieving " -"annotations. Given a function, class, or module, it returns an annotations " -"dictionary in the requested format. This module also provides functionality " -"for working directly with the :term:`annotate function` that is used to " -"evaluate annotations, such as :func:`get_annotate_from_class_namespace` and :" -"func:`call_annotate_function`, as well as the :func:`call_evaluate_function` " -"function for working with :term:`evaluate functions `." -msgstr "" - -#: ../../library/annotationlib.rst:51 -msgid "" -":pep:`649` proposed the current model for how annotations work in Python." -msgstr "" - -#: ../../library/annotationlib.rst:53 -msgid "" -":pep:`749` expanded on various aspects of :pep:`649` and introduced the :mod:" -"`!annotationlib` module." -msgstr "" - -#: ../../library/annotationlib.rst:56 -msgid "" -":ref:`annotations-howto` provides best practices for working with " -"annotations." -msgstr "" - -#: ../../library/annotationlib.rst:59 -msgid "" -":pypi:`typing-extensions` provides a backport of :func:`get_annotations` " -"that works on earlier versions of Python." -msgstr "" - -#: ../../library/annotationlib.rst:63 -msgid "Annotation semantics" -msgstr "" - -#: ../../library/annotationlib.rst:65 -msgid "" -"The way annotations are evaluated has changed over the history of Python 3, " -"and currently still depends on a :ref:`future import `. There have " -"been execution models for annotations:" -msgstr "" - -#: ../../library/annotationlib.rst:69 -msgid "" -"*Stock semantics* (default in Python 3.0 through 3.13; see :pep:`3107` and :" -"pep:`526`): Annotations are evaluated eagerly, as they are encountered in " -"the source code." -msgstr "" - -#: ../../library/annotationlib.rst:72 -msgid "" -"*Stringified annotations* (used with ``from __future__ import annotations`` " -"in Python 3.7 and newer; see :pep:`563`): Annotations are stored as strings " -"only." -msgstr "" - -#: ../../library/annotationlib.rst:75 -msgid "" -"*Deferred evaluation* (default in Python 3.14 and newer; see :pep:`649` and :" -"pep:`749`): Annotations are evaluated lazily, only when they are accessed." -msgstr "" - -#: ../../library/annotationlib.rst:78 -msgid "As an example, consider the following program::" -msgstr "" - -#: ../../library/annotationlib.rst:80 -msgid "" -"def func(a: Cls) -> None:\n" -" print(a)\n" -"\n" -"class Cls: pass\n" -"\n" -"print(func.__annotations__)" -msgstr "" - -#: ../../library/annotationlib.rst:87 -msgid "This will behave as follows:" -msgstr "" - -#: ../../library/annotationlib.rst:89 -msgid "" -"Under stock semantics (Python 3.13 and earlier), it will throw a :exc:" -"`NameError` at the line where ``func`` is defined, because ``Cls`` is an " -"undefined name at that point." -msgstr "" - -#: ../../library/annotationlib.rst:92 -msgid "" -"Under stringified annotations (if ``from __future__ import annotations`` is " -"used), it will print ``{'a': 'Cls', 'return': 'None'}``." -msgstr "" - -#: ../../library/annotationlib.rst:94 -msgid "" -"Under deferred evaluation (Python 3.14 and later), it will print ``{'a': " -", 'return': None}``." -msgstr "" - -#: ../../library/annotationlib.rst:97 -msgid "" -"Stock semantics were used when function annotations were first introduced in " -"Python 3.0 (by :pep:`3107`) because this was the simplest, most obvious way " -"to implement annotations. The same execution model was used when variable " -"annotations were introduced in Python 3.6 (by :pep:`526`). However, stock " -"semantics caused problems when using annotations as type hints, such as a " -"need to refer to names that are not yet defined when the annotation is " -"encountered. In addition, there were performance problems with executing " -"annotations at module import time. Therefore, in Python 3.7, :pep:`563` " -"introduced the ability to store annotations as strings using the ``from " -"__future__ import annotations`` syntax. The plan at the time was to " -"eventually make this behavior the default, but a problem appeared: " -"stringified annotations are more difficult to process for those who " -"introspect annotations at runtime. An alternative proposal, :pep:`649`, " -"introduced the third execution model, deferred evaluation, and was " -"implemented in Python 3.14. Stringified annotations are still used if ``from " -"__future__ import annotations`` is present, but this behavior will " -"eventually be removed." -msgstr "" - -#: ../../library/annotationlib.rst:116 -msgid "Classes" -msgstr "クラス" - -#: ../../library/annotationlib.rst:120 -msgid "" -"An :class:`~enum.IntEnum` describing the formats in which annotations can be " -"returned. Members of the enum, or their equivalent integer values, can be " -"passed to :func:`get_annotations` and other functions in this module, as " -"well as to :attr:`~object.__annotate__` functions." -msgstr "" - -#: ../../library/annotationlib.rst:128 -msgid "Values are the result of evaluating the annotation expressions." -msgstr "" - -#: ../../library/annotationlib.rst:133 -msgid "" -"Special value used to signal that an annotate function is being evaluated in " -"a special environment with fake globals. When passed this value, annotate " -"functions should either return the same value as for the :attr:`Format." -"VALUE` format, or raise :exc:`NotImplementedError` to signal that they do " -"not support execution in this environment. This format is only used " -"internally and should not be passed to the functions in this module." -msgstr "" - -#: ../../library/annotationlib.rst:144 -msgid "" -"Values are real annotation values (as per :attr:`Format.VALUE` format) for " -"defined values, and :class:`ForwardRef` proxies for undefined values. Real " -"objects may contain references to :class:`ForwardRef` proxy objects." -msgstr "" - -#: ../../library/annotationlib.rst:152 -msgid "" -"Values are the text string of the annotation as it appears in the source " -"code, up to modifications including, but not restricted to, whitespace " -"normalizations and constant values optimizations." -msgstr "" - -#: ../../library/annotationlib.rst:156 -msgid "" -"The exact values of these strings may change in future versions of Python." -msgstr "" - -#: ../../library/annotationlib.rst:162 -msgid "A proxy object for forward references in annotations." -msgstr "" - -#: ../../library/annotationlib.rst:164 -msgid "" -"Instances of this class are returned when the :attr:`~Format.FORWARDREF` " -"format is used and annotations contain a name that cannot be resolved. This " -"can happen when a forward reference is used in an annotation, such as when a " -"class is referenced before it is defined." -msgstr "" - -#: ../../library/annotationlib.rst:171 -msgid "" -"A string containing the code that was evaluated to produce the :class:" -"`~ForwardRef`. The string may not be exactly equivalent to the original " -"source." -msgstr "" - -#: ../../library/annotationlib.rst:177 -msgid "Evaluate the forward reference, returning its value." -msgstr "" - -#: ../../library/annotationlib.rst:179 -msgid "" -"If the *format* argument is :attr:`~Format.VALUE` (the default), this method " -"may throw an exception, such as :exc:`NameError`, if the forward reference " -"refers to a name that cannot be resolved. The arguments to this method can " -"be used to provide bindings for names that would otherwise be undefined. If " -"the *format* argument is :attr:`~Format.FORWARDREF`, the method will never " -"throw an exception, but may return a :class:`~ForwardRef` instance. For " -"example, if the forward reference object contains the code " -"``list[undefined]``, where ``undefined`` is a name that is not defined, " -"evaluating it with the :attr:`~Format.FORWARDREF` format will return " -"``list[ForwardRef('undefined')]``. If the *format* argument is :attr:" -"`~Format.STRING`, the method will return :attr:`~ForwardRef.__forward_arg__`." -msgstr "" - -#: ../../library/annotationlib.rst:191 -msgid "" -"The *owner* parameter provides the preferred mechanism for passing scope " -"information to this method. The owner of a :class:`~ForwardRef` is the " -"object that contains the annotation from which the :class:`~ForwardRef` " -"derives, such as a module object, type object, or function object." -msgstr "" - -#: ../../library/annotationlib.rst:196 -msgid "" -"The *globals*, *locals*, and *type_params* parameters provide a more precise " -"mechanism for influencing the names that are available when the :class:" -"`~ForwardRef` is evaluated. *globals* and *locals* are passed to :func:" -"`eval`, representing the global and local namespaces in which the name is " -"evaluated. The *type_params* parameter is relevant for objects created using " -"the native syntax for :ref:`generic classes ` and :ref:" -"`functions `. It is a tuple of :ref:`type parameters " -"` that are in scope while the forward reference is being " -"evaluated. For example, if evaluating a :class:`~ForwardRef` retrieved from " -"an annotation found in the class namespace of a generic class ``C``, " -"*type_params* should be set to ``C.__type_params__``." -msgstr "" - -#: ../../library/annotationlib.rst:207 -msgid "" -":class:`~ForwardRef` instances returned by :func:`get_annotations` retain " -"references to information about the scope they originated from, so calling " -"this method with no further arguments may be sufficient to evaluate such " -"objects. :class:`~ForwardRef` instances created by other means may not have " -"any information about their scope, so passing arguments to this method may " -"be necessary to evaluate them successfully." -msgstr "" - -#: ../../library/annotationlib.rst:214 -msgid "" -"If no *owner*, *globals*, *locals*, or *type_params* are provided and the :" -"class:`~ForwardRef` does not contain information about its origin, empty " -"globals and locals dictionaries are used." -msgstr "" - -#: ../../library/annotationlib.rst:222 -msgid "Functions" -msgstr "関数" - -#: ../../library/annotationlib.rst:226 -msgid "" -"Convert an annotations dict containing runtime values to a dict containing " -"only strings. If the values are not already strings, they are converted " -"using :func:`type_repr`. This is meant as a helper for user-provided " -"annotate functions that support the :attr:`~Format.STRING` format but do not " -"have access to the code creating the annotations." -msgstr "" - -#: ../../library/annotationlib.rst:233 -msgid "" -"For example, this is used to implement the :attr:`~Format.STRING` for :class:" -"`typing.TypedDict` classes created through the functional syntax:" -msgstr "" - -#: ../../library/annotationlib.rst:236 -msgid "" -">>> from typing import TypedDict\n" -">>> Movie = TypedDict(\"movie\", {\"name\": str, \"year\": int})\n" -">>> get_annotations(Movie, format=Format.STRING)\n" -"{'name': 'str', 'year': 'int'}" -msgstr "" - -#: ../../library/annotationlib.rst:247 -msgid "" -"Call the :term:`annotate function` *annotate* with the given *format*, a " -"member of the :class:`Format` enum, and return the annotations dictionary " -"produced by the function." -msgstr "" - -#: ../../library/annotationlib.rst:251 -msgid "" -"This helper function is required because annotate functions generated by the " -"compiler for functions, classes, and modules only support the :attr:`~Format." -"VALUE` format when called directly. To support other formats, this function " -"calls the annotate function in a special environment that allows it to " -"produce annotations in the other formats. This is a useful building block " -"when implementing functionality that needs to partially evaluate annotations " -"while a class is being constructed." -msgstr "" - -#: ../../library/annotationlib.rst:260 -msgid "" -"*owner* is the object that owns the annotation function, usually a function, " -"class, or module. If provided, it is used in the :attr:`~Format.FORWARDREF` " -"format to produce a :class:`ForwardRef` object that carries more information." -msgstr "" - -#: ../../library/annotationlib.rst:267 -msgid "" -":PEP:`PEP 649 <649#the-stringizer-and-the-fake-globals-environment>` " -"contains an explanation of the implementation technique used by this " -"function." -msgstr "" - -#: ../../library/annotationlib.rst:275 -msgid "" -"Call the :term:`evaluate function` *evaluate* with the given *format*, a " -"member of the :class:`Format` enum, and return the value produced by the " -"function. This is similar to :func:`call_annotate_function`, but the latter " -"always returns a dictionary mapping strings to annotations, while this " -"function returns a single value." -msgstr "" - -#: ../../library/annotationlib.rst:281 -msgid "" -"This is intended for use with the evaluate functions generated for lazily " -"evaluated elements related to type aliases and type parameters:" -msgstr "" - -#: ../../library/annotationlib.rst:284 -msgid ":meth:`typing.TypeAliasType.evaluate_value`, the value of type aliases" -msgstr "" - -#: ../../library/annotationlib.rst:285 -msgid ":meth:`typing.TypeVar.evaluate_bound`, the bound of type variables" -msgstr "" - -#: ../../library/annotationlib.rst:286 -msgid "" -":meth:`typing.TypeVar.evaluate_constraints`, the constraints of type " -"variables" -msgstr "" - -#: ../../library/annotationlib.rst:288 -msgid "" -":meth:`typing.TypeVar.evaluate_default`, the default value of type variables" -msgstr "" - -#: ../../library/annotationlib.rst:290 -msgid "" -":meth:`typing.ParamSpec.evaluate_default`, the default value of parameter " -"specifications" -msgstr "" - -#: ../../library/annotationlib.rst:292 -msgid "" -":meth:`typing.TypeVarTuple.evaluate_default`, the default value of type " -"variable tuples" -msgstr "" - -#: ../../library/annotationlib.rst:295 -msgid "" -"*owner* is the object that owns the evaluate function, such as the type " -"alias or type variable object." -msgstr "" - -#: ../../library/annotationlib.rst:298 -msgid "" -"*format* can be used to control the format in which the value is returned:" -msgstr "" - -#: ../../library/annotationlib.rst:300 -msgid "" -">>> type Alias = undefined\n" -">>> call_evaluate_function(Alias.evaluate_value, Format.VALUE)\n" -"Traceback (most recent call last):\n" -"...\n" -"NameError: name 'undefined' is not defined\n" -">>> call_evaluate_function(Alias.evaluate_value, Format.FORWARDREF)\n" -"ForwardRef('undefined')\n" -">>> call_evaluate_function(Alias.evaluate_value, Format.STRING)\n" -"'undefined'" -msgstr "" - -#: ../../library/annotationlib.rst:316 -msgid "" -"Retrieve the :term:`annotate function` from a class namespace dictionary " -"*namespace*. Return :const:`!None` if the namespace does not contain an " -"annotate function. This is primarily useful before the class has been fully " -"created (e.g., in a metaclass); after the class exists, the annotate " -"function can be retrieved with ``cls.__annotate__``. See :ref:`below " -"` for an example using this function in a metaclass." -msgstr "" - -#: ../../library/annotationlib.rst:326 -msgid "Compute the annotations dict for an object." -msgstr "" - -#: ../../library/annotationlib.rst:328 -msgid "" -"*obj* may be a callable, class, module, or other object with :attr:`~object." -"__annotate__` or :attr:`~object.__annotations__` attributes. Passing any " -"other object raises :exc:`TypeError`." -msgstr "" - -#: ../../library/annotationlib.rst:332 -msgid "" -"The *format* parameter controls the format in which annotations are " -"returned, and must be a member of the :class:`Format` enum or its integer " -"equivalent. The different formats work as follows:" -msgstr "" - -#: ../../library/annotationlib.rst:336 -msgid "" -"VALUE: :attr:`!object.__annotations__` is tried first; if that does not " -"exist, the :attr:`!object.__annotate__` function is called if it exists." -msgstr "" - -#: ../../library/annotationlib.rst:338 -msgid "" -"FORWARDREF: If :attr:`!object.__annotations__` exists and can be evaluated " -"successfully, it is used; otherwise, the :attr:`!object.__annotate__` " -"function is called. If it does not exist either, :attr:`!object." -"__annotations__` is tried again and any error from accessing it is re-raised." -msgstr "" - -#: ../../library/annotationlib.rst:342 -msgid "" -"STRING: If :attr:`!object.__annotate__` exists, it is called first; " -"otherwise, :attr:`!object.__annotations__` is used and stringified using :" -"func:`annotations_to_string`." -msgstr "" - -#: ../../library/annotationlib.rst:346 -msgid "" -"Returns a dict. :func:`!get_annotations` returns a new dict every time it's " -"called; calling it twice on the same object will return two different but " -"equivalent dicts." -msgstr "" - -#: ../../library/annotationlib.rst:350 -msgid "This function handles several details for you:" -msgstr "" - -#: ../../library/annotationlib.rst:352 -msgid "" -"If *eval_str* is true, values of type :class:`!str` will be un-stringized " -"using :func:`eval`. This is intended for use with stringized annotations " -"(``from __future__ import annotations``). It is an error to set *eval_str* " -"to true with formats other than :attr:`Format.VALUE`." -msgstr "" - -#: ../../library/annotationlib.rst:357 -msgid "" -"If *obj* doesn't have an annotations dict, returns an empty dict. (Functions " -"and methods always have an annotations dict; classes, modules, and other " -"types of callables may not.)" -msgstr "" - -#: ../../library/annotationlib.rst:361 -msgid "" -"Ignores inherited annotations on classes, as well as annotations on " -"metaclasses. If a class doesn't have its own annotations dict, returns an " -"empty dict." -msgstr "" - -#: ../../library/annotationlib.rst:364 -msgid "" -"All accesses to object members and dict values are done using ``getattr()`` " -"and ``dict.get()`` for safety." -msgstr "" - -#: ../../library/annotationlib.rst:367 -msgid "" -"*eval_str* controls whether or not values of type :class:`!str` are replaced " -"with the result of calling :func:`eval` on those values:" -msgstr "" - -#: ../../library/annotationlib.rst:370 -msgid "" -"If eval_str is true, :func:`eval` is called on values of type :class:`!str`. " -"(Note that :func:`!get_annotations` doesn't catch exceptions; if :func:" -"`eval` raises an exception, it will unwind the stack past the :func:`!" -"get_annotations` call.)" -msgstr "" - -#: ../../library/annotationlib.rst:374 -msgid "" -"If *eval_str* is false (the default), values of type :class:`!str` are " -"unchanged." -msgstr "" - -#: ../../library/annotationlib.rst:377 -msgid "" -"*globals* and *locals* are passed in to :func:`eval`; see the documentation " -"for :func:`eval` for more information. If *globals* or *locals* is :const:`!" -"None`, this function may replace that value with a context-specific default, " -"contingent on ``type(obj)``:" -msgstr "" - -#: ../../library/annotationlib.rst:382 -msgid "If *obj* is a module, *globals* defaults to ``obj.__dict__``." -msgstr "" - -#: ../../library/annotationlib.rst:383 -msgid "" -"If *obj* is a class, *globals* defaults to ``sys.modules[obj.__module__]." -"__dict__`` and *locals* defaults to the *obj* class namespace." -msgstr "" - -#: ../../library/annotationlib.rst:386 -msgid "" -"If *obj* is a callable, *globals* defaults to :attr:`obj.__globals__ " -"`, although if *obj* is a wrapped function (using :" -"func:`functools.update_wrapper`) or a :class:`functools.partial` object, it " -"is unwrapped until a non-wrapped function is found." -msgstr "" - -#: ../../library/annotationlib.rst:392 -msgid "" -"Calling :func:`!get_annotations` is best practice for accessing the " -"annotations dict of any object. See :ref:`annotations-howto` for more " -"information on annotations best practices." -msgstr "" - -#: ../../library/annotationlib.rst:396 -msgid "" -">>> def f(a: int, b: str) -> float:\n" -"... pass\n" -">>> get_annotations(f)\n" -"{'a': , 'b': , 'return': }" -msgstr "" - -#: ../../library/annotationlib.rst:407 -msgid "" -"Convert an arbitrary Python value to a format suitable for use by the :attr:" -"`~Format.STRING` format. This calls :func:`repr` for most objects, but has " -"special handling for some objects, such as type objects." -msgstr "" - -#: ../../library/annotationlib.rst:411 -msgid "" -"This is meant as a helper for user-provided annotate functions that support " -"the :attr:`~Format.STRING` format but do not have access to the code " -"creating the annotations. It can also be used to provide a user-friendly " -"string representation for other objects that contain values that are " -"commonly encountered in annotations." -msgstr "" - -#: ../../library/annotationlib.rst:421 -msgid "Recipes" -msgstr "レシピ" - -#: ../../library/annotationlib.rst:426 -msgid "Using annotations in a metaclass" -msgstr "" - -#: ../../library/annotationlib.rst:428 -msgid "" -"A :ref:`metaclass ` may want to inspect or even modify the " -"annotations in a class body during class creation. Doing so requires " -"retrieving annotations from the class namespace dictionary. For classes " -"created with ``from __future__ import annotations``, the annotations will be " -"in the ``__annotations__`` key of the dictionary. For other classes with " -"annotations, :func:`get_annotate_from_class_namespace` can be used to get " -"the annotate function, and :func:`call_annotate_function` can be used to " -"call it and retrieve the annotations. Using the :attr:`~Format.FORWARDREF` " -"format will usually be best, because this allows the annotations to refer to " -"names that cannot yet be resolved when the class is created." -msgstr "" - -#: ../../library/annotationlib.rst:439 -msgid "" -"To modify the annotations, it is best to create a wrapper annotate function " -"that calls the original annotate function, makes any necessary adjustments, " -"and returns the result." -msgstr "" - -#: ../../library/annotationlib.rst:443 -msgid "" -"Below is an example of a metaclass that filters out all :class:`typing." -"ClassVar` annotations from the class and puts them in a separate attribute:" -msgstr "" - -#: ../../library/annotationlib.rst:446 -msgid "" -"import annotationlib\n" -"import typing\n" -"\n" -"class ClassVarSeparator(type):\n" -" def __new__(mcls, name, bases, ns):\n" -" if \"__annotations__\" in ns: # from __future__ import annotations\n" -" annotations = ns[\"__annotations__\"]\n" -" classvar_keys = {\n" -" key for key, value in annotations.items()\n" -" # Use string comparison for simplicity; a more robust solution\n" -" # could use annotationlib.ForwardRef.evaluate\n" -" if value.startswith(\"ClassVar\")\n" -" }\n" -" classvars = {key: annotations[key] for key in classvar_keys}\n" -" ns[\"__annotations__\"] = {\n" -" key: value for key, value in annotations.items()\n" -" if key not in classvar_keys\n" -" }\n" -" wrapped_annotate = None\n" -" elif annotate := annotationlib.get_annotate_from_class_namespace(ns):\n" -" annotations = annotationlib.call_annotate_function(\n" -" annotate, format=annotationlib.Format.FORWARDREF\n" -" )\n" -" classvar_keys = {\n" -" key for key, value in annotations.items()\n" -" if typing.get_origin(value) is typing.ClassVar\n" -" }\n" -" classvars = {key: annotations[key] for key in classvar_keys}\n" -"\n" -" def wrapped_annotate(format):\n" -" annos = annotationlib.call_annotate_function(annotate, format, " -"owner=typ)\n" -" return {key: value for key, value in annos.items() if key not in " -"classvar_keys}\n" -"\n" -" else: # no annotations\n" -" classvars = {}\n" -" wrapped_annotate = None\n" -" typ = super().__new__(mcls, name, bases, ns)\n" -"\n" -" if wrapped_annotate is not None:\n" -" # Wrap the original __annotate__ with a wrapper that removes " -"ClassVars\n" -" typ.__annotate__ = wrapped_annotate\n" -" typ.classvars = classvars # Store the ClassVars in a separate " -"attribute\n" -" return typ" -msgstr "" - -#: ../../library/annotationlib.rst:494 -msgid "Limitations of the ``STRING`` format" -msgstr "" - -#: ../../library/annotationlib.rst:496 -msgid "" -"The :attr:`~Format.STRING` format is meant to approximate the source code of " -"the annotation, but the implementation strategy used means that it is not " -"always possible to recover the exact source code." -msgstr "" - -#: ../../library/annotationlib.rst:500 -msgid "" -"First, the stringifier of course cannot recover any information that is not " -"present in the compiled code, including comments, whitespace, " -"parenthesization, and operations that get simplified by the compiler." -msgstr "" - -#: ../../library/annotationlib.rst:504 -msgid "" -"Second, the stringifier can intercept almost all operations that involve " -"names looked up in some scope, but it cannot intercept operations that " -"operate fully on constants. As a corollary, this also means it is not safe " -"to request the ``STRING`` format on untrusted code: Python is powerful " -"enough that it is possible to achieve arbitrary code execution even with no " -"access to any globals or builtins. For example:" -msgstr "" - -#: ../../library/annotationlib.rst:510 -msgid "" -">>> def f(x: (1).__class__.__base__.__subclasses__()[-1].__init__." -"__builtins__[\"print\"](\"Hello world\")): pass\n" -"...\n" -">>> annotationlib.get_annotations(f, format=annotationlib.Format.SOURCE)\n" -"Hello world\n" -"{'x': 'None'}" -msgstr "" - -#: ../../library/annotationlib.rst:519 -msgid "" -"This particular example works as of the time of writing, but it relies on " -"implementation details and is not guaranteed to work in the future." -msgstr "" - -#: ../../library/annotationlib.rst:522 -msgid "" -"Among the different kinds of expressions that exist in Python, as " -"represented by the :mod:`ast` module, some expressions are supported, " -"meaning that the ``STRING`` format can generally recover the original source " -"code; others are unsupported, meaning that they may result in incorrect " -"output or an error." -msgstr "" - -#: ../../library/annotationlib.rst:527 -msgid "The following are supported (sometimes with caveats):" -msgstr "" - -#: ../../library/annotationlib.rst:529 -msgid ":class:`ast.BinOp`" -msgstr "" - -#: ../../library/annotationlib.rst:530 -msgid ":class:`ast.UnaryOp`" -msgstr "" - -#: ../../library/annotationlib.rst:532 -msgid "" -":class:`ast.Invert` (``~``), :class:`ast.UAdd` (``+``), and :class:`ast." -"USub` (``-``) are supported" -msgstr "" - -#: ../../library/annotationlib.rst:533 -msgid ":class:`ast.Not` (``not``) is not supported" -msgstr "" - -#: ../../library/annotationlib.rst:535 -msgid ":class:`ast.Dict` (except when using ``**`` unpacking)" -msgstr "" - -#: ../../library/annotationlib.rst:536 -msgid ":class:`ast.Set`" -msgstr "" - -#: ../../library/annotationlib.rst:537 -msgid ":class:`ast.Compare`" -msgstr "" - -#: ../../library/annotationlib.rst:539 -msgid ":class:`ast.Eq` and :class:`ast.NotEq` are supported" -msgstr "" - -#: ../../library/annotationlib.rst:540 -msgid "" -":class:`ast.Lt`, :class:`ast.LtE`, :class:`ast.Gt`, and :class:`ast.GtE` are " -"supported, but the operand may be flipped" -msgstr "" - -#: ../../library/annotationlib.rst:541 -msgid "" -":class:`ast.Is`, :class:`ast.IsNot`, :class:`ast.In`, and :class:`ast.NotIn` " -"are not supported" -msgstr "" - -#: ../../library/annotationlib.rst:543 -msgid ":class:`ast.Call` (except when using ``**`` unpacking)" -msgstr "" - -#: ../../library/annotationlib.rst:544 -msgid "" -":class:`ast.Constant` (though not the exact representation of the constant; " -"for example, escape sequences in strings are lost; hexadecimal numbers are " -"converted to decimal)" -msgstr "" - -#: ../../library/annotationlib.rst:546 -msgid ":class:`ast.Attribute` (assuming the value is not a constant)" -msgstr "" - -#: ../../library/annotationlib.rst:547 -msgid ":class:`ast.Subscript` (assuming the value is not a constant)" -msgstr "" - -#: ../../library/annotationlib.rst:548 -msgid ":class:`ast.Starred` (``*`` unpacking)" -msgstr "" - -#: ../../library/annotationlib.rst:549 -msgid ":class:`ast.Name`" -msgstr "" - -#: ../../library/annotationlib.rst:550 -msgid ":class:`ast.List`" -msgstr "" - -#: ../../library/annotationlib.rst:551 -msgid ":class:`ast.Tuple`" -msgstr "" - -#: ../../library/annotationlib.rst:552 -msgid ":class:`ast.Slice`" -msgstr "" - -#: ../../library/annotationlib.rst:554 -msgid "" -"The following are unsupported, but throw an informative error when " -"encountered by the stringifier:" -msgstr "" - -#: ../../library/annotationlib.rst:557 -msgid "" -":class:`ast.FormattedValue` (f-strings; error is not detected if conversion " -"specifiers like ``!r`` are used)" -msgstr "" - -#: ../../library/annotationlib.rst:559 -msgid ":class:`ast.JoinedStr` (f-strings)" -msgstr "" - -#: ../../library/annotationlib.rst:561 -msgid "The following are unsupported and result in incorrect output:" -msgstr "" - -#: ../../library/annotationlib.rst:563 -msgid ":class:`ast.BoolOp` (``and`` and ``or``)" -msgstr "" - -#: ../../library/annotationlib.rst:564 -msgid ":class:`ast.IfExp`" -msgstr "" - -#: ../../library/annotationlib.rst:565 -msgid ":class:`ast.Lambda`" -msgstr "" - -#: ../../library/annotationlib.rst:566 -msgid ":class:`ast.ListComp`" -msgstr "" - -#: ../../library/annotationlib.rst:567 -msgid ":class:`ast.SetComp`" -msgstr "" - -#: ../../library/annotationlib.rst:568 -msgid ":class:`ast.DictComp`" -msgstr "" - -#: ../../library/annotationlib.rst:569 -msgid ":class:`ast.GeneratorExp`" -msgstr "" - -#: ../../library/annotationlib.rst:571 -msgid "" -"The following are disallowed in annotation scopes and therefore not relevant:" -msgstr "" - -#: ../../library/annotationlib.rst:573 -msgid ":class:`ast.NamedExpr` (``:=``)" -msgstr "" - -#: ../../library/annotationlib.rst:574 -msgid ":class:`ast.Await`" -msgstr "" - -#: ../../library/annotationlib.rst:575 -msgid ":class:`ast.Yield`" -msgstr "" - -#: ../../library/annotationlib.rst:576 -msgid ":class:`ast.YieldFrom`" -msgstr "" - -#: ../../library/annotationlib.rst:580 -msgid "Limitations of the ``FORWARDREF`` format" -msgstr "" - -#: ../../library/annotationlib.rst:582 -msgid "" -"The :attr:`~Format.FORWARDREF` format aims to produce real values as much as " -"possible, with anything that cannot be resolved replaced with :class:" -"`ForwardRef` objects. It is affected by broadly the same Limitations as the :" -"attr:`~Format.STRING` format: annotations that perform operations on " -"literals or that use unsupported expression types may raise exceptions when " -"evaluated using the :attr:`~Format.FORWARDREF` format." -msgstr "" - -#: ../../library/annotationlib.rst:589 -msgid "Below are a few examples of the behavior with unsupported expressions:" -msgstr "" - -#: ../../library/annotationlib.rst:591 -msgid "" -">>> from annotationlib import get_annotations, Format\n" -">>> def zerodiv(x: 1 / 0): ...\n" -">>> get_annotations(zerodiv, format=Format.STRING)\n" -"Traceback (most recent call last):\n" -" ...\n" -"ZeroDivisionError: division by zero\n" -">>> get_annotations(zerodiv, format=Format.FORWARDREF)\n" -"Traceback (most recent call last):\n" -" ...\n" -"ZeroDivisionError: division by zero\n" -">>> def ifexp(x: 1 if y else 0): ...\n" -">>> get_annotations(ifexp, format=Format.STRING)\n" -"{'x': '1'}" -msgstr "" diff --git a/library/archiving.po b/library/archiving.po index 269db3a80..e5fd256b5 100644 --- a/library/archiving.po +++ b/library/archiving.po @@ -1,25 +1,25 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 +# Arihiro TAKASE, 2017 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-06 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:54+0000\n" -"Last-Translator: tomo, 2021\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 17:47+0000\n" +"Last-Translator: Arihiro TAKASE, 2017\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/archiving.rst:5 @@ -29,7 +29,11 @@ msgstr "データ圧縮とアーカイブ" #: ../../library/archiving.rst:7 msgid "" "The modules described in this chapter support data compression with the " -"zlib, gzip, bzip2, lzma, and zstd algorithms, and the creation of ZIP- and " -"tar-format archives. See also :ref:`archiving-operations` provided by the :" -"mod:`shutil` module." +"zlib, gzip, bzip2 and lzma algorithms, and the creation of ZIP- and tar-" +"format archives. See also :ref:`archiving-operations` provided by the :mod:" +"`shutil` module." msgstr "" +"この章で説明されるモジュールは zlib, gzip, bzip2, lzma アルゴリズムによるデー" +"タの圧縮と、 ZIP, tar フォーマットのアーカイブ作成をサポートします。 :mod:" +"`shutil` モジュールで提供される :ref:`archiving-operations` も参照してくださ" +"い。" diff --git a/library/argparse.po b/library/argparse.po index d1815e609..4d69cf400 100644 --- a/library/argparse.po +++ b/library/argparse.po @@ -1,61 +1,54 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# mollinaca, 2021 +# Arihiro TAKASE, 2017 +# shirou - しろう , 2017 +# Nozomu Kaneko , 2017 +# Shun Sakurai, 2017 +# Masato HASHIMOTO , 2017 +# E. Kawashima, 2017 +# 秘湯 , 2018 +# Naoki Nakamura , 2020 +# tomo, 2021 # Shin Saito, 2021 -# Atsuo Ishimoto , 2022 -# Takeshi Nakazato, 2023 -# Takanori Suzuki , 2024 -# Arihiro TAKASE, 2024 -# tomo, 2025 +# Osamu NAKAMURA, 2021 +# mollinaca, 2021 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-06 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:54+0000\n" -"Last-Translator: tomo, 2025\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-07-13 06:53+0000\n" +"PO-Revision-Date: 2017-02-16 17:48+0000\n" +"Last-Translator: mollinaca, 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/argparse.rst:2 msgid "" -":mod:`!argparse` --- Parser for command-line options, arguments and " -"subcommands" +":mod:`argparse` --- Parser for command-line options, arguments and sub-" +"commands" msgstr "" +":mod:`argparse` --- コマンドラインオプション、引数、サブコマンドのパーサー" #: ../../library/argparse.rst:12 msgid "**Source code:** :source:`Lib/argparse.py`" msgstr "**ソースコード:** :source:`Lib/argparse.py`" -#: ../../library/argparse.rst:16 -msgid "" -"While :mod:`argparse` is the default recommended standard library module for " -"implementing basic command line applications, authors with more exacting " -"requirements for exactly how their command line applications behave may find " -"it doesn't provide the necessary level of control. Refer to :ref:`choosing-" -"an-argument-parser` for alternatives to consider when ``argparse`` doesn't " -"support behaviors that the application requires (such as entirely disabling " -"support for interspersed options and positional arguments, or accepting " -"option parameter values that start with ``-`` even when they correspond to " -"another defined option)." -msgstr "" - -#: ../../library/argparse.rst-1 +#: ../../library/argparse.rstNone msgid "Tutorial" msgstr "チュートリアル" -#: ../../library/argparse.rst:30 +#: ../../library/argparse.rst:18 msgid "" "This page contains the API reference information. For a more gentle " "introduction to Python command-line parsing, have a look at the :ref:" @@ -65,76 +58,143 @@ msgstr "" "リアル ` では、コマンドラインの解析についてより優しく説明" "しています。" -#: ../../library/argparse.rst:34 +#: ../../library/argparse.rst:22 msgid "" -"The :mod:`!argparse` module makes it easy to write user-friendly command-" -"line interfaces. The program defines what arguments it requires, and :mod:`!" -"argparse` will figure out how to parse those out of :data:`sys.argv`. The :" -"mod:`!argparse` module also automatically generates help and usage " -"messages. The module will also issue errors when users give the program " -"invalid arguments." +"The :mod:`argparse` module makes it easy to write user-friendly command-line " +"interfaces. The program defines what arguments it requires, and :mod:" +"`argparse` will figure out how to parse those out of :data:`sys.argv`. The :" +"mod:`argparse` module also automatically generates help and usage messages " +"and issues errors when users give the program invalid arguments." msgstr "" +":mod:`argparse` モジュールはユーザーフレンドリなコマンドラインインターフェー" +"スの作成を簡単にします。プログラムがどんな引数を必要としているのかを定義する" +"と、:mod:`argparse` が :data:`sys.argv` からそのオプションを解析する方法を見" +"つけ出します。:mod:`argparse` モジュールは自動的にヘルプと使用方法メッセージ" +"を生成し、ユーザーが不正な引数をプログラムに指定したときにエラーを発生させま" +"す。" + +#: ../../library/argparse.rst:30 +msgid "Example" +msgstr "使用例" -#: ../../library/argparse.rst:40 +#: ../../library/argparse.rst:32 msgid "" -"The :mod:`!argparse` module's support for command-line interfaces is built " -"around an instance of :class:`argparse.ArgumentParser`. It is a container " -"for argument specifications and has options that apply to the parser as " -"whole::" +"The following code is a Python program that takes a list of integers and " +"produces either the sum or the max::" msgstr "" +"次のコードは、整数のリストを受け取って合計か最大値を返す Python プログラムで" +"す::" -#: ../../library/argparse.rst:44 +#: ../../library/argparse.rst:47 msgid "" -"parser = argparse.ArgumentParser(\n" -" prog='ProgramName',\n" -" description='What the program does',\n" -" epilog='Text at the bottom of help')" +"Assuming the Python code above is saved into a file called ``prog.py``, it " +"can be run at the command line and provides useful help messages:" msgstr "" +"上の Python コードが ``prog.py`` という名前のファイルに保存されたと仮定しま" +"す。コマンドラインから便利なヘルプメッセージを表示できます:" -#: ../../library/argparse.rst:49 +#: ../../library/argparse.rst:64 msgid "" -"The :meth:`ArgumentParser.add_argument` method attaches individual argument " -"specifications to the parser. It supports positional arguments, options " -"that accept values, and on/off flags::" +"When run with the appropriate arguments, it prints either the sum or the max " +"of the command-line integers:" msgstr "" -":meth:`ArgumentParser.add_argument` メソッドは各引数の仕様をパーサーに付属さ" -"せます。このメソッドは位置引数、値を受け取るオプション、機能のオン/オフを切" -"り替えるフラグをサポートします::" +"適切な引数を与えて実行した場合、このプログラムはコマンドライン引数の整数列の" +"合計か最大値を表示します:" + +#: ../../library/argparse.rst:75 +msgid "If invalid arguments are passed in, it will issue an error:" +msgstr "不正な引数が与えられた場合、エラーを発生させます:" + +#: ../../library/argparse.rst:83 +msgid "The following sections walk you through this example." +msgstr "以降の節では、この例をひと通り説明して行きます。" -#: ../../library/argparse.rst:53 +#: ../../library/argparse.rst:87 +msgid "Creating a parser" +msgstr "パーサーを作る" + +#: ../../library/argparse.rst:89 msgid "" -"parser.add_argument('filename') # positional argument\n" -"parser.add_argument('-c', '--count') # option that takes a value\n" -"parser.add_argument('-v', '--verbose',\n" -" action='http://github.com/store_true') # on/off flag" +"The first step in using the :mod:`argparse` is creating an :class:" +"`ArgumentParser` object::" msgstr "" +":mod:`argparse` を使うときの最初のステップは、:class:`ArgumentParser` オブ" +"ジェクトを生成することです::" -#: ../../library/argparse.rst:58 +#: ../../library/argparse.rst:94 msgid "" -"The :meth:`ArgumentParser.parse_args` method runs the parser and places the " -"extracted data in a :class:`argparse.Namespace` object::" +"The :class:`ArgumentParser` object will hold all the information necessary " +"to parse the command line into Python data types." msgstr "" -":meth:`ArgumentParser.parse_args` メソッドはパーサーを実行し、抽出したデータ" -"を :class:`argparse.Namespace` オブジェクト内に配置します::" +":class:`ArgumentParser` オブジェクトはコマンドラインを解析して Python データ" +"型にするために必要なすべての情報を保持します。" + +#: ../../library/argparse.rst:99 +msgid "Adding arguments" +msgstr "引数を追加する" -#: ../../library/argparse.rst:61 +#: ../../library/argparse.rst:101 msgid "" -"args = parser.parse_args()\n" -"print(args.filename, args.count, args.verbose)" +"Filling an :class:`ArgumentParser` with information about program arguments " +"is done by making calls to the :meth:`~ArgumentParser.add_argument` method. " +"Generally, these calls tell the :class:`ArgumentParser` how to take the " +"strings on the command line and turn them into objects. This information is " +"stored and used when :meth:`~ArgumentParser.parse_args` is called. For " +"example::" msgstr "" +":class:`ArgumentParser` にプログラム引数の情報を与えるために、:meth:" +"`~ArgumentParser.add_argument` メソッドを呼び出します。一般的に、このメソッド" +"の呼び出しは :class:`ArgumentParser` に、コマンドラインの文字列を受け取ってそ" +"れをオブジェクトにする方法を教えます。この情報は保存され、:meth:" +"`~ArgumentParser.parse_args` が呼び出されたときに利用されます。例えば::" -#: ../../library/argparse.rst:65 +#: ../../library/argparse.rst:113 msgid "" -"If you're looking for a guide about how to upgrade :mod:`optparse` code to :" -"mod:`!argparse`, see :ref:`Upgrading Optparse Code `." +"Later, calling :meth:`~ArgumentParser.parse_args` will return an object with " +"two attributes, ``integers`` and ``accumulate``. The ``integers`` attribute " +"will be a list of one or more ints, and the ``accumulate`` attribute will be " +"either the :func:`sum` function, if ``--sum`` was specified at the command " +"line, or the :func:`max` function if it was not." +msgstr "" +"あとで :meth:`~ArgumentParser.parse_args` を呼び出すと、``integers`` と " +"``accumulate`` という2つの属性を持ったオブジェクトを返します。``integers`` 属" +"性は1つ以上の整数のリストで、``accumulate`` 属性はコマンドラインから ``--" +"sum`` が指定された場合は :func:`sum` 関数に、それ以外の場合は :func:`max` 関" +"数になります。" + +#: ../../library/argparse.rst:121 +msgid "Parsing arguments" +msgstr "引数を解析する" + +#: ../../library/argparse.rst:123 +msgid "" +":class:`ArgumentParser` parses arguments through the :meth:`~ArgumentParser." +"parse_args` method. This will inspect the command line, convert each " +"argument to the appropriate type and then invoke the appropriate action. In " +"most cases, this means a simple :class:`Namespace` object will be built up " +"from attributes parsed out of the command line::" +msgstr "" +":class:`ArgumentParser` は引数を :meth:`~ArgumentParser.parse_args` メソッド" +"で解析します。このメソッドはコマンドラインを調べ、各引数を正しい型に変換し" +"て、適切なアクションを実行します。ほとんどの場合、これはコマンドラインの解析" +"結果から、シンプルな :class:`Namespace` オブジェクトを構築することを意味しま" +"す::" + +#: ../../library/argparse.rst:132 +msgid "" +"In a script, :meth:`~ArgumentParser.parse_args` will typically be called " +"with no arguments, and the :class:`ArgumentParser` will automatically " +"determine the command-line arguments from :data:`sys.argv`." msgstr "" +"スクリプト内では、:meth:`~ArgumentParser.parse_args` は通常引数なしで呼び出さ" +"れ、:class:`ArgumentParser` は自動的に :data:`sys.argv` からコマンドライン引" +"数を取得します。" -#: ../../library/argparse.rst:69 +#: ../../library/argparse.rst:138 msgid "ArgumentParser objects" msgstr "ArgumentParser オブジェクト" -#: ../../library/argparse.rst:79 +#: ../../library/argparse.rst:147 msgid "" "Create a new :class:`ArgumentParser` object. All parameters should be passed " "as keyword arguments. Each parameter has its own more detailed description " @@ -144,13 +204,11 @@ msgstr "" "ワード引数として渡すべきです。各引数についてはあとで詳しく説明しますが、簡単" "に言うと:" -#: ../../library/argparse.rst:83 -msgid "" -"prog_ - The name of the program (default: generated from the ``__main__`` " -"module attributes and ``sys.argv[0]``)" -msgstr "" +#: ../../library/argparse.rst:151 +msgid "prog_ - The name of the program (default: ``sys.argv[0]``)" +msgstr "prog_ - プログラム名 (デフォルト: ``sys.argv[0]``)" -#: ../../library/argparse.rst:86 +#: ../../library/argparse.rst:153 msgid "" "usage_ - The string describing the program usage (default: generated from " "arguments added to parser)" @@ -158,19 +216,15 @@ msgstr "" "usage_ - プログラムの利用方法を記述する文字列 (デフォルト: パーサーに追加され" "た引数から生成されます)" -#: ../../library/argparse.rst:89 -msgid "" -"description_ - Text to display before the argument help (by default, no text)" -msgstr "" -"description_ - 引数のヘルプの前に表示されるテキスト (デフォルトはテキストなし" -"です)" +#: ../../library/argparse.rst:156 +msgid "description_ - Text to display before the argument help (default: none)" +msgstr "description_ - 引数のヘルプの前に表示されるテキスト (デフォルト: none)" -#: ../../library/argparse.rst:92 -msgid "epilog_ - Text to display after the argument help (by default, no text)" -msgstr "" -"epilog_ - 引数のヘルプの後に表示されるテキスト (デフォルトはテキストなしです)" +#: ../../library/argparse.rst:158 +msgid "epilog_ - Text to display after the argument help (default: none)" +msgstr "epilog_ - 引数のヘルプの後で表示されるテキスト (デフォルト: none)" -#: ../../library/argparse.rst:94 +#: ../../library/argparse.rst:160 msgid "" "parents_ - A list of :class:`ArgumentParser` objects whose arguments should " "also be included" @@ -178,18 +232,18 @@ msgstr "" "parents_ - :class:`ArgumentParser` オブジェクトのリストで、このオブジェクトの" "引数が追加されます" -#: ../../library/argparse.rst:97 +#: ../../library/argparse.rst:163 msgid "formatter_class_ - A class for customizing the help output" msgstr "formatter_class_ - ヘルプ出力をカスタマイズするためのクラス" -#: ../../library/argparse.rst:99 +#: ../../library/argparse.rst:165 msgid "" "prefix_chars_ - The set of characters that prefix optional arguments " "(default: '-')" msgstr "" "prefix_chars_ - オプションの引数の prefix になる文字集合 (デフォルト: '-')" -#: ../../library/argparse.rst:102 +#: ../../library/argparse.rst:168 msgid "" "fromfile_prefix_chars_ - The set of characters that prefix files from which " "additional arguments should be read (default: ``None``)" @@ -197,53 +251,47 @@ msgstr "" "fromfile_prefix_chars_ - 追加の引数を読み込むファイルの prefix になる文字集" "合 (デフォルト: ``None``)" -#: ../../library/argparse.rst:105 +#: ../../library/argparse.rst:171 msgid "" "argument_default_ - The global default value for arguments (default: " "``None``)" msgstr "" "argument_default_ - 引数のグローバルなデフォルト値 (デフォルト: ``None``)" -#: ../../library/argparse.rst:108 +#: ../../library/argparse.rst:174 msgid "" "conflict_handler_ - The strategy for resolving conflicting optionals " "(usually unnecessary)" msgstr "conflict_handler_ - 衝突するオプションを解決する方法 (通常は不要)" -#: ../../library/argparse.rst:111 +#: ../../library/argparse.rst:177 msgid "" "add_help_ - Add a ``-h/--help`` option to the parser (default: ``True``)" msgstr "" "add_help_ - ``-h/--help`` オプションをパーサーに追加する (デフォルト: " "``True``)" -#: ../../library/argparse.rst:113 +#: ../../library/argparse.rst:179 msgid "" "allow_abbrev_ - Allows long options to be abbreviated if the abbreviation is " -"unambiguous (default: ``True``)" -msgstr "" - -#: ../../library/argparse.rst:116 -msgid "" -"exit_on_error_ - Determines whether or not :class:`!ArgumentParser` exits " -"with error info when an error occurs. (default: ``True``)" +"unambiguous. (default: ``True``)" msgstr "" +"allow_abbrev_ - 長いオプションが先頭文字列に短縮可能 (先頭の文字が一意) であ" +"る場合に短縮指定を許可する。(デフォルト: ``True``)" -#: ../../library/argparse.rst:119 +#: ../../library/argparse.rst:182 msgid "" -"suggest_on_error_ - Enables suggestions for mistyped argument choices and " -"subparser names (default: ``False``)" +"exit_on_error_ - Determines whether or not ArgumentParser exits with error " +"info when an error occurs. (default: ``True``)" msgstr "" +"exit_on_error_ - エラーが起きたときに、ArgumentParser がエラー情報を出力して " +"(訳注: プログラムが) 終了する。 (デフォルト: ``True``)" -#: ../../library/argparse.rst:122 -msgid "color_ - Allow color output (default: ``False``)" -msgstr "" - -#: ../../library/argparse.rst:124 +#: ../../library/argparse.rst:185 msgid "*allow_abbrev* parameter was added." msgstr "*allow_abbrev* 引数が追加されました。" -#: ../../library/argparse.rst:127 +#: ../../library/argparse.rst:188 msgid "" "In previous versions, *allow_abbrev* also disabled grouping of short flags " "such as ``-vv`` to mean ``-v -v``." @@ -251,118 +299,76 @@ msgstr "" "以前のバージョンでは、 *allow_abbrev* は、``-vv`` が ``-v -v`` と等価になるよ" "うな、短いフラグのグループ化を無効にしていました。" -#: ../../library/argparse.rst:131 +#: ../../library/argparse.rst:192 msgid "*exit_on_error* parameter was added." msgstr "*exit_on_error* 引数が追加されました。" -#: ../../library/argparse.rst:134 -msgid "*suggest_on_error* and *color* parameters were added." -msgstr "" - -#: ../../library/argparse.rst:137 ../../library/argparse.rst:686 +#: ../../library/argparse.rst:195 ../../library/argparse.rst:715 msgid "The following sections describe how each of these are used." msgstr "以下の節では各オプションの利用方法を説明します。" -#: ../../library/argparse.rst:143 +#: ../../library/argparse.rst:199 msgid "prog" msgstr "``prog``" -#: ../../library/argparse.rst:146 -msgid "" -"By default, :class:`ArgumentParser` calculates the name of the program to " -"display in help messages depending on the way the Python interpreter was run:" -msgstr "" - -#: ../../library/argparse.rst:149 -msgid "" -"The :func:`base name ` of ``sys.argv[0]`` if a file was " -"passed as argument." -msgstr "" - -#: ../../library/argparse.rst:151 -msgid "" -"The Python interpreter name followed by ``sys.argv[0]`` if a directory or a " -"zipfile was passed as argument." -msgstr "" - -#: ../../library/argparse.rst:153 -msgid "" -"The Python interpreter name followed by ``-m`` followed by the module or " -"package name if the :option:`-m` option was used." -msgstr "" - -#: ../../library/argparse.rst:156 -msgid "" -"This default is almost always desirable because it will make the help " -"messages match the string that was used to invoke the program on the command " -"line. However, to change this default behavior, another value can be " -"supplied using the ``prog=`` argument to :class:`ArgumentParser`::" -msgstr "" - -#: ../../library/argparse.rst:161 +#: ../../library/argparse.rst:201 msgid "" -">>> parser = argparse.ArgumentParser(prog='myprogram')\n" -">>> parser.print_help()\n" -"usage: myprogram [-h]\n" -"\n" -"options:\n" -" -h, --help show this help message and exit" +"By default, :class:`ArgumentParser` objects use ``sys.argv[0]`` to determine " +"how to display the name of the program in help messages. This default is " +"almost always desirable because it will make the help messages match how the " +"program was invoked on the command line. For example, consider a file named " +"``myprogram.py`` with the following code::" msgstr "" +"デフォルトでは、:class:`ArgumentParser` オブジェクトはヘルプメッセージ中に表" +"示するプログラム名を ``sys.argv[0]`` から取得します。\n" +"このデフォルトの動作は、プログラムがコマンドライン上の起動方法に合わせてヘル" +"プメッセージを作成するため、ほとんどの場合望ましい挙動になります。\n" +"例えば、``myprogram.py`` という名前のファイルに次のコードがあるとします::" -#: ../../library/argparse.rst:168 +#: ../../library/argparse.rst:212 msgid "" -"Note that the program name, whether determined from ``sys.argv[0]``, from " -"the ``__main__`` module attributes or from the ``prog=`` argument, is " -"available to help messages using the ``%(prog)s`` format specifier." +"The help for this program will display ``myprogram.py`` as the program name " +"(regardless of where the program was invoked from):" msgstr "" +"このプログラムのヘルプは、プログラム名として (プログラムがどこから起動された" +"のかに関わらず) ``myprogram.py`` を表示します:" -#: ../../library/argparse.rst:175 +#: ../../library/argparse.rst:231 msgid "" -">>> parser = argparse.ArgumentParser(prog='myprogram')\n" -">>> parser.add_argument('--foo', help='foo of the %(prog)s program')\n" -">>> parser.print_help()\n" -"usage: myprogram [-h] [--foo FOO]\n" -"\n" -"options:\n" -" -h, --help show this help message and exit\n" -" --foo FOO foo of the myprogram program" +"To change this default behavior, another value can be supplied using the " +"``prog=`` argument to :class:`ArgumentParser`::" msgstr "" +"このデフォルトの動作を変更するには、:class:`ArgumentParser` の ``prog=`` 引数" +"に他の値を指定します::" -#: ../../library/argparse.rst:184 +#: ../../library/argparse.rst:241 msgid "" -"The default ``prog`` value now reflects how ``__main__`` was actually " -"executed, rather than always being ``os.path.basename(sys.argv[0])``." +"Note that the program name, whether determined from ``sys.argv[0]`` or from " +"the ``prog=`` argument, is available to help messages using the ``%(prog)s`` " +"format specifier." msgstr "" +"プログラム名は、``sys.argv[0]`` から取られた場合でも ``prog=`` 引数で与えられ" +"た場合でも、ヘルプメッセージ中では ``%(prog)s`` フォーマット指定子で利用でき" +"ます。" -#: ../../library/argparse.rst:189 +#: ../../library/argparse.rst:258 msgid "usage" msgstr "usage" -#: ../../library/argparse.rst:191 +#: ../../library/argparse.rst:260 msgid "" "By default, :class:`ArgumentParser` calculates the usage message from the " -"arguments it contains. The default message can be overridden with the " -"``usage=`` keyword argument::" +"arguments it contains::" msgstr "" +"デフォルトでは、 :class:`ArgumentParser` は使用法メッセージを、保持している引" +"数から生成します::" -#: ../../library/argparse.rst:195 +#: ../../library/argparse.rst:276 msgid "" -">>> parser = argparse.ArgumentParser(prog='PROG', usage='%(prog)s " -"[options]')\n" -">>> parser.add_argument('--foo', nargs='?', help='foo help')\n" -">>> parser.add_argument('bar', nargs='+', help='bar help')\n" -">>> parser.print_help()\n" -"usage: PROG [options]\n" -"\n" -"positional arguments:\n" -" bar bar help\n" -"\n" -"options:\n" -" -h, --help show this help message and exit\n" -" --foo [FOO] foo help" -msgstr "" +"The default message can be overridden with the ``usage=`` keyword argument::" +msgstr "デフォルトのメッセージは ``usage=`` キーワード引数で変更できます::" -#: ../../library/argparse.rst:208 +#: ../../library/argparse.rst:291 msgid "" "The ``%(prog)s`` format specifier is available to fill in the program name " "in your usage messages." @@ -370,29 +376,24 @@ msgstr "" "``%(prog)s`` フォーマット指定子を、使用法メッセージ内でプログラム名として利用" "できます。" -#: ../../library/argparse.rst:211 -msgid "" -"When a custom usage message is specified for the main parser, you may also " -"want to consider passing the ``prog`` argument to :meth:`~ArgumentParser." -"add_subparsers` or the ``prog`` and the ``usage`` arguments to :meth:" -"`~_SubParsersAction.add_parser`, to ensure consistent command prefixes and " -"usage information across subparsers." -msgstr "" - -#: ../../library/argparse.rst:221 +#: ../../library/argparse.rst:296 msgid "description" msgstr "description" -#: ../../library/argparse.rst:223 +#: ../../library/argparse.rst:298 msgid "" "Most calls to the :class:`ArgumentParser` constructor will use the " "``description=`` keyword argument. This argument gives a brief description " "of what the program does and how it works. In help messages, the " "description is displayed between the command-line usage string and the help " -"messages for the various arguments." +"messages for the various arguments::" msgstr "" +"多くの場合、:class:`ArgumentParser` のコンストラクターを呼び出すときに " +"``description=`` キーワード引数が使用されます。この引数はプログラムが何をして" +"どう動くのかについての短い説明になります。ヘルプメッセージで、この説明がコマ" +"ンドラインの利用法と引数のヘルプメッセージの間に表示されます::" -#: ../../library/argparse.rst:229 +#: ../../library/argparse.rst:313 msgid "" "By default, the description will be line-wrapped so that it fits within the " "given space. To change this behavior, see the formatter_class_ argument." @@ -400,11 +401,11 @@ msgstr "" "デフォルトでは、説明は与えられたスペースに合わせて折り返されます。この挙動を" "変更するには、formatter_class_ 引数を参照してください。" -#: ../../library/argparse.rst:234 +#: ../../library/argparse.rst:318 msgid "epilog" msgstr "epilog" -#: ../../library/argparse.rst:236 +#: ../../library/argparse.rst:320 msgid "" "Some programs like to display additional description of the program after " "the description of the arguments. Such text can be specified using the " @@ -414,23 +415,7 @@ msgstr "" "します。このテキストは :class:`ArgumentParser` の ``epilog=`` 引数に指定でき" "ます::" -#: ../../library/argparse.rst:240 -msgid "" -">>> parser = argparse.ArgumentParser(\n" -"... description='A foo that bars',\n" -"... epilog=\"And that's how you'd foo a bar\")\n" -">>> parser.print_help()\n" -"usage: argparse.py [-h]\n" -"\n" -"A foo that bars\n" -"\n" -"options:\n" -" -h, --help show this help message and exit\n" -"\n" -"And that's how you'd foo a bar" -msgstr "" - -#: ../../library/argparse.rst:253 +#: ../../library/argparse.rst:337 msgid "" "As with the description_ argument, the ``epilog=`` text is by default line-" "wrapped, but this behavior can be adjusted with the formatter_class_ " @@ -439,11 +424,11 @@ msgstr "" "description_ 引数と同じく、``epilog=`` テキストもデフォルトで折り返され、:" "class:`ArgumentParser` の formatter_class_ 引数で動作を調整できます。" -#: ../../library/argparse.rst:259 +#: ../../library/argparse.rst:343 msgid "parents" msgstr "parents" -#: ../../library/argparse.rst:261 +#: ../../library/argparse.rst:345 msgid "" "Sometimes, several parsers share a common set of arguments. Rather than " "repeating the definitions of these arguments, a single parser with all the " @@ -460,23 +445,7 @@ msgstr "" "すべての位置アクションとオプションのアクションをそれらから集め、そのアクショ" "ンを構築中の :class:`ArgumentParser` オブジェクトに追加します::" -#: ../../library/argparse.rst:268 -msgid "" -">>> parent_parser = argparse.ArgumentParser(add_help=False)\n" -">>> parent_parser.add_argument('--parent', type=int)\n" -"\n" -">>> foo_parser = argparse.ArgumentParser(parents=[parent_parser])\n" -">>> foo_parser.add_argument('foo')\n" -">>> foo_parser.parse_args(['--parent', '2', 'XXX'])\n" -"Namespace(foo='XXX', parent=2)\n" -"\n" -">>> bar_parser = argparse.ArgumentParser(parents=[parent_parser])\n" -">>> bar_parser.add_argument('--bar')\n" -">>> bar_parser.parse_args(['--bar', 'YYY'])\n" -"Namespace(bar='YYY', parent=None)" -msgstr "" - -#: ../../library/argparse.rst:281 +#: ../../library/argparse.rst:365 msgid "" "Note that most parent parsers will specify ``add_help=False``. Otherwise, " "the :class:`ArgumentParser` will see two ``-h/--help`` options (one in the " @@ -486,7 +455,7 @@ msgstr "" "い。こうしないと、:class:`ArgumentParser` は2つの ``-h/--help`` オプションを" "与えられる (1つは親から、もうひとつは子から) ことになり、エラーを発生します。" -#: ../../library/argparse.rst:286 +#: ../../library/argparse.rst:370 msgid "" "You must fully initialize the parsers before passing them via ``parents=``. " "If you change the parent parsers after the child parser, those changes will " @@ -495,11 +464,11 @@ msgstr "" "``parents=`` に渡す前にパーサーを完全に初期化する必要があります。子パーサーを" "作成してから親パーサーを変更した場合、その変更は子パーサーに反映されません。" -#: ../../library/argparse.rst:294 +#: ../../library/argparse.rst:376 msgid "formatter_class" msgstr "formatter_class" -#: ../../library/argparse.rst:296 +#: ../../library/argparse.rst:378 msgid "" ":class:`ArgumentParser` objects allow the help formatting to be customized " "by specifying an alternate formatting class. Currently, there are four such " @@ -509,7 +478,7 @@ msgstr "" "とでヘルプのフォーマットをカスタマイズできます。現在、4つのフォーマットクラス" "があります:" -#: ../../library/argparse.rst:305 +#: ../../library/argparse.rst:387 msgid "" ":class:`RawDescriptionHelpFormatter` and :class:`RawTextHelpFormatter` give " "more control over how textual descriptions are displayed. By default, :class:" @@ -521,31 +490,7 @@ msgstr "" "`ArgumentParser` オブジェクトはコマンドラインヘルプの中の description_ と " "epilog_ を折り返して表示します::" -#: ../../library/argparse.rst:310 -msgid "" -">>> parser = argparse.ArgumentParser(\n" -"... prog='PROG',\n" -"... description='''this description\n" -"... was indented weird\n" -"... but that is okay''',\n" -"... epilog='''\n" -"... likewise for this epilog whose whitespace will\n" -"... be cleaned up and whose words will be wrapped\n" -"... across a couple lines''')\n" -">>> parser.print_help()\n" -"usage: PROG [-h]\n" -"\n" -"this description was indented weird but that is okay\n" -"\n" -"options:\n" -" -h, --help show this help message and exit\n" -"\n" -"likewise for this epilog whose whitespace will be cleaned up and whose " -"words\n" -"will be wrapped across a couple lines" -msgstr "" - -#: ../../library/argparse.rst:330 +#: ../../library/argparse.rst:412 msgid "" "Passing :class:`RawDescriptionHelpFormatter` as ``formatter_class=`` " "indicates that description_ and epilog_ are already correctly formatted and " @@ -554,40 +499,18 @@ msgstr "" "``formatter_class=`` に :class:`RawDescriptionHelpFormatter` を渡した場合、 " "description_ と epilog_ は整形済みとされ改行されません::" -#: ../../library/argparse.rst:334 -msgid "" -">>> parser = argparse.ArgumentParser(\n" -"... prog='PROG',\n" -"... formatter_class=argparse.RawDescriptionHelpFormatter,\n" -"... description=textwrap.dedent('''\\\n" -"... Please do not mess up this text!\n" -"... --------------------------------\n" -"... I have indented it\n" -"... exactly the way\n" -"... I want it\n" -"... '''))\n" -">>> parser.print_help()\n" -"usage: PROG [-h]\n" -"\n" -"Please do not mess up this text!\n" -"--------------------------------\n" -" I have indented it\n" -" exactly the way\n" -" I want it\n" -"\n" -"options:\n" -" -h, --help show this help message and exit" -msgstr "" - -#: ../../library/argparse.rst:356 +#: ../../library/argparse.rst:438 msgid "" ":class:`RawTextHelpFormatter` maintains whitespace for all sorts of help " -"text, including argument descriptions. However, multiple newlines are " +"text, including argument descriptions. However, multiple new lines are " "replaced with one. If you wish to preserve multiple blank lines, add spaces " "between the newlines." msgstr "" +":class:`RawTextHelpFormatter` は引数の説明を含めてすべての種類のヘルプテキス" +"トで空白を維持します。例外として、複数の空行はひとつにまとめられます。複数の" +"空白行を保ちたい場合には、行に空白を含めるようにして下さい。" -#: ../../library/argparse.rst:361 +#: ../../library/argparse.rst:443 msgid "" ":class:`ArgumentDefaultsHelpFormatter` automatically adds information about " "default values to each of the argument help messages::" @@ -595,25 +518,7 @@ msgstr "" ":class:`ArgumentDefaultsHelpFormatter` は各引数のデフォルト値を自動的にヘルプ" "に追加します::" -#: ../../library/argparse.rst:364 -msgid "" -">>> parser = argparse.ArgumentParser(\n" -"... prog='PROG',\n" -"... formatter_class=argparse.ArgumentDefaultsHelpFormatter)\n" -">>> parser.add_argument('--foo', type=int, default=42, help='FOO!')\n" -">>> parser.add_argument('bar', nargs='*', default=[1, 2, 3], help='BAR!')\n" -">>> parser.print_help()\n" -"usage: PROG [-h] [--foo FOO] [bar ...]\n" -"\n" -"positional arguments:\n" -" bar BAR! (default: [1, 2, 3])\n" -"\n" -"options:\n" -" -h, --help show this help message and exit\n" -" --foo FOO FOO! (default: 42)" -msgstr "" - -#: ../../library/argparse.rst:379 +#: ../../library/argparse.rst:461 msgid "" ":class:`MetavarTypeHelpFormatter` uses the name of the type_ argument for " "each argument as the display name for its values (rather than using the " @@ -622,46 +527,23 @@ msgstr "" ":class:`MetavarTypeHelpFormatter` は、各引数の値の表示名に type_ 引数の値を使" "用します (通常は dest_ の値が使用されます)::" -#: ../../library/argparse.rst:383 -msgid "" -">>> parser = argparse.ArgumentParser(\n" -"... prog='PROG',\n" -"... formatter_class=argparse.MetavarTypeHelpFormatter)\n" -">>> parser.add_argument('--foo', type=int)\n" -">>> parser.add_argument('bar', type=float)\n" -">>> parser.print_help()\n" -"usage: PROG [-h] [--foo int] float\n" -"\n" -"positional arguments:\n" -" float\n" -"\n" -"options:\n" -" -h, --help show this help message and exit\n" -" --foo int" -msgstr "" - -#: ../../library/argparse.rst:400 +#: ../../library/argparse.rst:482 msgid "prefix_chars" msgstr "prefix_chars" -#: ../../library/argparse.rst:402 +#: ../../library/argparse.rst:484 msgid "" "Most command-line options will use ``-`` as the prefix, e.g. ``-f/--foo``. " "Parsers that need to support different or additional prefix characters, e.g. " "for options like ``+f`` or ``/foo``, may specify them using the " -"``prefix_chars=`` argument to the :class:`ArgumentParser` constructor::" +"``prefix_chars=`` argument to the ArgumentParser constructor::" msgstr "" +"ほとんどのコマンドラインオプションは、``-f/--foo`` のように接頭辞に ``-`` を" +"使います。``+f`` や ``/foo`` のような、他の、あるいは追加の接頭辞文字をサポー" +"トしなければならない場合、ArgumentParser のコンストラクターに " +"``prefix_chars=`` 引数を使って指定します::" -#: ../../library/argparse.rst:408 -msgid "" -">>> parser = argparse.ArgumentParser(prog='PROG', prefix_chars='-+')\n" -">>> parser.add_argument('+f')\n" -">>> parser.add_argument('++bar')\n" -">>> parser.parse_args('+f X ++bar Y'.split())\n" -"Namespace(bar='Y', f='X')" -msgstr "" - -#: ../../library/argparse.rst:414 +#: ../../library/argparse.rst:496 msgid "" "The ``prefix_chars=`` argument defaults to ``'-'``. Supplying a set of " "characters that does not include ``-`` will cause ``-f/--foo`` options to be " @@ -670,37 +552,26 @@ msgstr "" "``prefix_chars=`` 引数のデフォルトは ``'-'`` です。``-`` を含まない文字セット" "を指定すると、``-f/--foo`` オプションが使用できなくなります。" -#: ../../library/argparse.rst:420 +#: ../../library/argparse.rst:502 msgid "fromfile_prefix_chars" msgstr "fromfile_prefix_chars" -#: ../../library/argparse.rst:422 +#: ../../library/argparse.rst:504 msgid "" -"Sometimes, when dealing with a particularly long argument list, it may make " -"sense to keep the list of arguments in a file rather than typing it out at " -"the command line. If the ``fromfile_prefix_chars=`` argument is given to " -"the :class:`ArgumentParser` constructor, then arguments that start with any " -"of the specified characters will be treated as files, and will be replaced " -"by the arguments they contain. For example::" +"Sometimes, for example when dealing with a particularly long argument lists, " +"it may make sense to keep the list of arguments in a file rather than typing " +"it out at the command line. If the ``fromfile_prefix_chars=`` argument is " +"given to the :class:`ArgumentParser` constructor, then arguments that start " +"with any of the specified characters will be treated as files, and will be " +"replaced by the arguments they contain. For example::" msgstr "" -"ときどき、非常に長い引数リストを扱う場合に、その引数リストを毎回コマンドライ" -"ンにタイプする代わりにファイルに置いておきたい場合があります。:class:" +"ときどき、例えば非常に長い引数リストを扱う場合に、その引数リストを毎回コマン" +"ドラインにタイプする代わりにファイルに置いておきたい場合があります。:class:" "`ArgumentParser` のコンストラクターに ``fromfile_prefix_chars=`` 引数が渡され" "た場合、指定された文字のいずれかで始まる引数はファイルとして扱われ、そのファ" "イルに含まれる引数リストに置換されます。例えば::" -#: ../../library/argparse.rst:429 -msgid "" -">>> with open('args.txt', 'w', encoding=sys.getfilesystemencoding()) as fp:\n" -"... fp.write('-f\\nbar')\n" -"...\n" -">>> parser = argparse.ArgumentParser(fromfile_prefix_chars='@')\n" -">>> parser.add_argument('-f')\n" -">>> parser.parse_args(['-f', 'foo', '@args.txt'])\n" -"Namespace(f='bar')" -msgstr "" - -#: ../../library/argparse.rst:437 +#: ../../library/argparse.rst:518 msgid "" "Arguments read from a file must by default be one per line (but see also :" "meth:`~ArgumentParser.convert_arg_line_to_args`) and are treated as if they " @@ -715,13 +586,7 @@ msgstr "" "ます。このため、上の例では、``['-f', 'foo', '@args.txt']`` は ``['-f', " "'foo', '-f', 'bar']`` と等価になります。" -#: ../../library/argparse.rst:443 -msgid "" -":class:`ArgumentParser` uses :term:`filesystem encoding and error handler` " -"to read the file containing arguments." -msgstr "" - -#: ../../library/argparse.rst:446 +#: ../../library/argparse.rst:524 msgid "" "The ``fromfile_prefix_chars=`` argument defaults to ``None``, meaning that " "arguments will never be treated as file references." @@ -729,20 +594,11 @@ msgstr "" "``fromfile_prefix_chars=`` 引数のデフォルト値は ``None`` で、引数がファイル参" "照として扱われることがないことを意味しています。" -#: ../../library/argparse.rst:449 -msgid "" -":class:`ArgumentParser` changed encoding and errors to read arguments files " -"from default (e.g. :func:`locale.getpreferredencoding(False) ` and ``\"strict\"``) to the :term:`filesystem encoding " -"and error handler`. Arguments file should be encoded in UTF-8 instead of " -"ANSI Codepage on Windows." -msgstr "" - -#: ../../library/argparse.rst:457 +#: ../../library/argparse.rst:529 msgid "argument_default" msgstr "argument_default" -#: ../../library/argparse.rst:459 +#: ../../library/argparse.rst:531 msgid "" "Generally, argument defaults are specified either by passing a default to :" "meth:`~ArgumentParser.add_argument` or by calling the :meth:`~ArgumentParser." @@ -761,22 +617,11 @@ msgstr "" "全体で :meth:`~ArgumentParser.parse_args` メソッド呼び出しの属性の生成を抑制" "するには、``argument_default=SUPPRESS`` を指定します::" -#: ../../library/argparse.rst:468 -msgid "" -">>> parser = argparse.ArgumentParser(argument_default=argparse.SUPPRESS)\n" -">>> parser.add_argument('--foo')\n" -">>> parser.add_argument('bar', nargs='?')\n" -">>> parser.parse_args(['--foo', '1', 'BAR'])\n" -"Namespace(bar='BAR', foo='1')\n" -">>> parser.parse_args([])\n" -"Namespace()" -msgstr "" - -#: ../../library/argparse.rst:479 +#: ../../library/argparse.rst:551 msgid "allow_abbrev" msgstr "allow_abbrev" -#: ../../library/argparse.rst:481 +#: ../../library/argparse.rst:553 msgid "" "Normally, when you pass an argument list to the :meth:`~ArgumentParser." "parse_args` method of an :class:`ArgumentParser`, it :ref:`recognizes " @@ -786,26 +631,16 @@ msgstr "" "リストを渡すとき、長いオプションは :ref:`短縮しても認識されます `。" -#: ../../library/argparse.rst:485 +#: ../../library/argparse.rst:557 msgid "This feature can be disabled by setting ``allow_abbrev`` to ``False``::" msgstr "" "この機能は、``allow_abbrev`` に ``False`` を指定することで無効にできます::" -#: ../../library/argparse.rst:487 -msgid "" -">>> parser = argparse.ArgumentParser(prog='PROG', allow_abbrev=False)\n" -">>> parser.add_argument('--foobar', action='http://github.com/store_true')\n" -">>> parser.add_argument('--foonley', action='http://github.com/store_false')\n" -">>> parser.parse_args(['--foon'])\n" -"usage: PROG [-h] [--foobar] [--foonley]\n" -"PROG: error: unrecognized arguments: --foon" -msgstr "" - -#: ../../library/argparse.rst:498 +#: ../../library/argparse.rst:570 msgid "conflict_handler" msgstr "conflict_handler" -#: ../../library/argparse.rst:500 +#: ../../library/argparse.rst:572 msgid "" ":class:`ArgumentParser` objects do not allow two actions with the same " "option string. By default, :class:`ArgumentParser` objects raise an " @@ -817,17 +652,7 @@ msgstr "" "デフォルトでは、:class:`ArgumentParser` オブジェクトは、すでに利用されている" "オプション文字列を使って新しい引数をつくろうとしたときに例外を送出します::" -#: ../../library/argparse.rst:505 -msgid "" -">>> parser = argparse.ArgumentParser(prog='PROG')\n" -">>> parser.add_argument('-f', '--foo', help='old foo help')\n" -">>> parser.add_argument('--foo', help='new foo help')\n" -"Traceback (most recent call last):\n" -" ..\n" -"ArgumentError: argument --foo: conflicting option string(s): --foo" -msgstr "" - -#: ../../library/argparse.rst:512 +#: ../../library/argparse.rst:584 msgid "" "Sometimes (e.g. when using parents_) it may be useful to simply override any " "older arguments with the same option string. To get this behavior, the " @@ -838,22 +663,7 @@ msgstr "" "で上書きするほうが便利な場合があります。この動作をするには、:class:" "`ArgumentParser` の ``conflict_handler=`` 引数に ``'resolve'`` を渡します::" -#: ../../library/argparse.rst:517 -msgid "" -">>> parser = argparse.ArgumentParser(prog='PROG', " -"conflict_handler='resolve')\n" -">>> parser.add_argument('-f', '--foo', help='old foo help')\n" -">>> parser.add_argument('--foo', help='new foo help')\n" -">>> parser.print_help()\n" -"usage: PROG [-h] [-f FOO] [--foo FOO]\n" -"\n" -"options:\n" -" -h, --help show this help message and exit\n" -" -f FOO old foo help\n" -" --foo FOO new foo help" -msgstr "" - -#: ../../library/argparse.rst:528 +#: ../../library/argparse.rst:600 msgid "" "Note that :class:`ArgumentParser` objects only remove an action if all of " "its option strings are overridden. So, in the example above, the old ``-f/--" @@ -865,18 +675,29 @@ msgstr "" "foo`` オプション文字列だけが上書きされているので、古い ``-f/--foo`` アクショ" "ンは ``-f`` アクションとして残っています。" -#: ../../library/argparse.rst:535 +#: ../../library/argparse.rst:607 msgid "add_help" msgstr "add_help" -#: ../../library/argparse.rst:537 +#: ../../library/argparse.rst:609 +msgid "" +"By default, ArgumentParser objects add an option which simply displays the " +"parser's help message. For example, consider a file named ``myprogram.py`` " +"containing the following code::" +msgstr "" +"デフォルトでは、ArgumentParser オブジェクトはシンプルにパーサーのヘルプメッ" +"セージを表示するオプションを自動的に追加します。例えば、以下のコードを含む " +"``myprogram.py`` ファイルについて考えてください::" + +#: ../../library/argparse.rst:618 msgid "" -"By default, :class:`ArgumentParser` objects add an option which simply " -"displays the parser's help message. If ``-h`` or ``--help`` is supplied at " -"the command line, the :class:`!ArgumentParser` help will be printed." +"If ``-h`` or ``--help`` is supplied at the command line, the ArgumentParser " +"help will be printed:" msgstr "" +"コマンドラインに ``-h`` か ``--help`` が指定された場合、ArgumentParser の " +"help が表示されます:" -#: ../../library/argparse.rst:541 +#: ../../library/argparse.rst:630 msgid "" "Occasionally, it may be useful to disable the addition of this help option. " "This can be achieved by passing ``False`` as the ``add_help=`` argument to :" @@ -885,18 +706,7 @@ msgstr "" "必要に応じて、この help オプションを無効にする場合があります。これは :class:" "`ArgumentParser` の ``add_help=`` 引数に ``False`` を渡すことで可能です::" -#: ../../library/argparse.rst:545 -msgid "" -">>> parser = argparse.ArgumentParser(prog='PROG', add_help=False)\n" -">>> parser.add_argument('--foo', help='foo help')\n" -">>> parser.print_help()\n" -"usage: PROG [--foo FOO]\n" -"\n" -"options:\n" -" --foo FOO foo help" -msgstr "" - -#: ../../library/argparse.rst:553 +#: ../../library/argparse.rst:642 msgid "" "The help option is typically ``-h/--help``. The exception to this is if the " "``prefix_chars=`` is specified and does not include ``-``, in which case ``-" @@ -908,28 +718,21 @@ msgstr "" "オプションではありません。この場合、``prefix_chars`` の最初の文字がヘルプオプ" "ションの接頭辞として利用されます::" -#: ../../library/argparse.rst:559 -msgid "" -">>> parser = argparse.ArgumentParser(prog='PROG', prefix_chars='+/')\n" -">>> parser.print_help()\n" -"usage: PROG [+h]\n" -"\n" -"options:\n" -" +h, ++help show this help message and exit" -msgstr "" - -#: ../../library/argparse.rst:568 +#: ../../library/argparse.rst:657 msgid "exit_on_error" msgstr "exit_on_error" -#: ../../library/argparse.rst:570 +#: ../../library/argparse.rst:659 msgid "" "Normally, when you pass an invalid argument list to the :meth:" "`~ArgumentParser.parse_args` method of an :class:`ArgumentParser`, it will " -"print a *message* to :data:`sys.stderr` and exit with a status code of 2." +"exit with error info." msgstr "" +"通常、不正な引数リストが :class:`ArgumentParser` の :meth:`~ArgumentParser." +"parse_args` メソッドに渡された場合、プログラムはエラー情報を出力して終了しま" +"す。" -#: ../../library/argparse.rst:574 +#: ../../library/argparse.rst:662 msgid "" "If the user would like to catch errors manually, the feature can be enabled " "by setting ``exit_on_error`` to ``False``::" @@ -937,112 +740,11 @@ msgstr "" "もしエラーを例外としてプログラム内でキャッチしたい場合は、``exit_on_error`` " "を ``False`` に設定してください::" -#: ../../library/argparse.rst:577 -msgid "" -">>> parser = argparse.ArgumentParser(exit_on_error=False)\n" -">>> parser.add_argument('--integers', type=int)\n" -"_StoreAction(option_strings=['--integers'], dest='integers', nargs=None, " -"const=None, default=None, type=, choices=None, help=None, " -"metavar=None)\n" -">>> try:\n" -"... parser.parse_args('--integers a'.split())\n" -"... except argparse.ArgumentError:\n" -"... print('Catching an argumentError')\n" -"...\n" -"Catching an argumentError" -msgstr "" - -#: ../../library/argparse.rst:590 -msgid "suggest_on_error" -msgstr "" - -#: ../../library/argparse.rst:592 -msgid "" -"By default, when a user passes an invalid argument choice or subparser " -"name, :class:`ArgumentParser` will exit with error info and list the " -"permissible argument choices (if specified) or subparser names as part of " -"the error message." -msgstr "" - -#: ../../library/argparse.rst:596 -msgid "" -"If the user would like to enable suggestions for mistyped argument choices " -"and subparser names, the feature can be enabled by setting " -"``suggest_on_error`` to ``True``. Note that this only applies for arguments " -"when the choices specified are strings::" -msgstr "" - -#: ../../library/argparse.rst:601 -msgid "" -">>> parser = argparse.ArgumentParser(description='Process some integers.',\n" -" suggest_on_error=True)\n" -">>> parser.add_argument('--action', choices=['sum', 'max'])\n" -">>> parser.add_argument('integers', metavar='N', type=int, nargs='+',\n" -"... help='an integer for the accumulator')\n" -">>> parser.parse_args(['--action', 'sumn', 1, 2, 3])\n" -"tester.py: error: argument --action: invalid choice: 'sumn', maybe you meant " -"'sum'? (choose from 'sum', 'max')" -msgstr "" - -#: ../../library/argparse.rst:609 -msgid "" -"If you're writing code that needs to be compatible with older Python " -"versions and want to opportunistically use ``suggest_on_error`` when it's " -"available, you can set it as an attribute after initializing the parser " -"instead of using the keyword argument::" -msgstr "" - -#: ../../library/argparse.rst:614 -msgid "" -">>> parser = argparse.ArgumentParser(description='Process some integers.')\n" -">>> parser.suggest_on_error = True" -msgstr "" - -#: ../../library/argparse.rst:621 -msgid "color" -msgstr "color" - -#: ../../library/argparse.rst:623 -msgid "" -"By default, the help message is printed in plain text. If you want to allow " -"color in help messages, you can enable it by setting ``color`` to ``True``::" -msgstr "" - -#: ../../library/argparse.rst:626 -msgid "" -">>> parser = argparse.ArgumentParser(description='Process some integers.',\n" -"... color=True)\n" -">>> parser.add_argument('--action', choices=['sum', 'max'])\n" -">>> parser.add_argument('integers', metavar='N', type=int, nargs='+',\n" -"... help='an integer for the accumulator')\n" -">>> parser.parse_args(['--help'])" -msgstr "" - -#: ../../library/argparse.rst:633 -msgid "" -"Even if a CLI author has enabled color, it can be :ref:`controlled using " -"environment variables `." -msgstr "" - -#: ../../library/argparse.rst:636 -msgid "" -"If you're writing code that needs to be compatible with older Python " -"versions and want to opportunistically use ``color`` when it's available, " -"you can set it as an attribute after initializing the parser instead of " -"using the keyword argument::" -msgstr "" - -#: ../../library/argparse.rst:641 -msgid "" -">>> parser = argparse.ArgumentParser(description='Process some integers.')\n" -">>> parser.color = True" -msgstr "" - -#: ../../library/argparse.rst:648 +#: ../../library/argparse.rst:679 msgid "The add_argument() method" msgstr "add_argument() メソッド" -#: ../../library/argparse.rst:654 +#: ../../library/argparse.rst:685 msgid "" "Define how a single command-line argument should be parsed. Each parameter " "has its own more detailed description below, but in short they are:" @@ -1050,28 +752,30 @@ msgstr "" "1つのコマンドライン引数がどう解析されるかを定義します。各引数についての詳細は" "後述しますが、簡単に言うと:" -#: ../../library/argparse.rst:657 +#: ../../library/argparse.rst:688 msgid "" -"`name or flags`_ - Either a name or a list of option strings, e.g. ``'foo'`` " -"or ``'-f', '--foo'``." +"`name or flags`_ - Either a name or a list of option strings, e.g. ``foo`` " +"or ``-f, --foo``." msgstr "" +"`name または flags`_ - 名前か、あるいはオプション文字列のリスト (例: ``foo`` " +"や ``-f, --foo``)。" -#: ../../library/argparse.rst:660 +#: ../../library/argparse.rst:691 msgid "" "action_ - The basic type of action to be taken when this argument is " "encountered at the command line." msgstr "action_ - コマンドラインにこの引数があったときのアクション。" -#: ../../library/argparse.rst:663 +#: ../../library/argparse.rst:694 msgid "nargs_ - The number of command-line arguments that should be consumed." msgstr "nargs_ - 受け取るべきコマンドライン引数の数。" -#: ../../library/argparse.rst:665 +#: ../../library/argparse.rst:696 msgid "" "const_ - A constant value required by some action_ and nargs_ selections." msgstr "const_ - 一部の action_ と nargs_ の組み合わせで利用される定数。" -#: ../../library/argparse.rst:667 +#: ../../library/argparse.rst:698 msgid "" "default_ - The value produced if the argument is absent from the command " "line and if it is absent from the namespace object." @@ -1079,75 +783,61 @@ msgstr "" "default_ - コマンドラインに対応する引数が存在せず、さらに namespace オブジェ" "クトにも存在しない場合に利用される値。 " -#: ../../library/argparse.rst:670 +#: ../../library/argparse.rst:701 msgid "" "type_ - The type to which the command-line argument should be converted." msgstr "type_ - コマンドライン引数が変換されるべき型。" -#: ../../library/argparse.rst:672 -msgid "choices_ - A sequence of the allowable values for the argument." -msgstr "choices_ - 引数として許される値のシーケンス。" +#: ../../library/argparse.rst:703 +msgid "choices_ - A container of the allowable values for the argument." +msgstr "choices_ - 引数として許される値のコンテナー。" -#: ../../library/argparse.rst:674 +#: ../../library/argparse.rst:705 msgid "" "required_ - Whether or not the command-line option may be omitted (optionals " "only)." msgstr "" "required_ - コマンドラインオプションが省略可能かどうか (オプション引数のみ)。" -#: ../../library/argparse.rst:677 +#: ../../library/argparse.rst:708 msgid "help_ - A brief description of what the argument does." msgstr "help_ - 引数が何なのかを示す簡潔な説明。" -#: ../../library/argparse.rst:679 +#: ../../library/argparse.rst:710 msgid "metavar_ - A name for the argument in usage messages." msgstr "metavar_ - 使用法メッセージの中で使われる引数の名前。" -#: ../../library/argparse.rst:681 +#: ../../library/argparse.rst:712 msgid "" "dest_ - The name of the attribute to be added to the object returned by :" "meth:`parse_args`." msgstr "dest_ - :meth:`parse_args` が返すオブジェクトに追加される属性名。" -#: ../../library/argparse.rst:684 -msgid "deprecated_ - Whether or not use of the argument is deprecated." -msgstr "" - -#: ../../library/argparse.rst:692 +#: ../../library/argparse.rst:719 msgid "name or flags" msgstr "name または flags" -#: ../../library/argparse.rst:694 +#: ../../library/argparse.rst:721 msgid "" "The :meth:`~ArgumentParser.add_argument` method must know whether an " "optional argument, like ``-f`` or ``--foo``, or a positional argument, like " "a list of filenames, is expected. The first arguments passed to :meth:" "`~ArgumentParser.add_argument` must therefore be either a series of flags, " -"or a simple argument name." +"or a simple argument name. For example, an optional argument could be " +"created like::" msgstr "" ":meth:`~ArgumentParser.add_argument` メソッドは、指定されている引数が ``-f`` " "や ``--foo`` のようなオプション引数なのか、ファイル名リストなどの位置引数なの" "かを知る必要があります。\n" "そのため、 :meth:`~ArgumentParser.add_argument` に初めに渡される引数は、一連" -"のフラグか、単一の引数名のどちらかになります。" - -#: ../../library/argparse.rst:700 -msgid "For example, an optional argument could be created like::" -msgstr "たとえば、オプション引数は次のように作成します::" +"のフラグか、単一の引数名のどちらかになります。\n" +"例えば、オプション引数は次のようにして作成されます::" -#: ../../library/argparse.rst:702 -msgid ">>> parser.add_argument('-f', '--foo')" -msgstr "" - -#: ../../library/argparse.rst:704 +#: ../../library/argparse.rst:730 msgid "while a positional argument could be created like::" msgstr "一方、位置引数は次のように作成します::" -#: ../../library/argparse.rst:706 -msgid ">>> parser.add_argument('bar')" -msgstr "" - -#: ../../library/argparse.rst:708 +#: ../../library/argparse.rst:734 msgid "" "When :meth:`~ArgumentParser.parse_args` is called, optional arguments will " "be identified by the ``-`` prefix, and the remaining arguments will be " @@ -1156,49 +846,11 @@ msgstr "" ":meth:`~ArgumentParser.parse_args` が呼ばれたとき、オプション引数は接頭辞 ``-" "`` により識別され、それ以外の引数は位置引数として扱われます::" -#: ../../library/argparse.rst:712 -msgid "" -">>> parser = argparse.ArgumentParser(prog='PROG')\n" -">>> parser.add_argument('-f', '--foo')\n" -">>> parser.add_argument('bar')\n" -">>> parser.parse_args(['BAR'])\n" -"Namespace(bar='BAR', foo=None)\n" -">>> parser.parse_args(['BAR', '--foo', 'FOO'])\n" -"Namespace(bar='BAR', foo='FOO')\n" -">>> parser.parse_args(['--foo', 'FOO'])\n" -"usage: PROG [-h] [-f FOO] bar\n" -"PROG: error: the following arguments are required: bar" -msgstr "" - -#: ../../library/argparse.rst:723 -msgid "" -"By default, :mod:`!argparse` automatically handles the internal naming and " -"display names of arguments, simplifying the process without requiring " -"additional configuration. As such, you do not need to specify the dest_ and " -"metavar_ parameters. The dest_ parameter defaults to the argument name with " -"underscores ``_`` replacing hyphens ``-`` . The metavar_ parameter defaults " -"to the upper-cased name. For example::" -msgstr "" - -#: ../../library/argparse.rst:731 -msgid "" -">>> parser = argparse.ArgumentParser(prog='PROG')\n" -">>> parser.add_argument('--foo-bar')\n" -">>> parser.parse_args(['--foo-bar', 'FOO-BAR']\n" -"Namespace(foo_bar='FOO-BAR')\n" -">>> parser.print_help()\n" -"usage: [-h] [--foo-bar FOO-BAR]\n" -"\n" -"optional arguments:\n" -" -h, --help show this help message and exit\n" -" --foo-bar FOO-BAR" -msgstr "" - -#: ../../library/argparse.rst:746 +#: ../../library/argparse.rst:751 msgid "action" msgstr "action" -#: ../../library/argparse.rst:748 +#: ../../library/argparse.rst:753 msgid "" ":class:`ArgumentParser` objects associate command-line arguments with " "actions. These actions can do just about anything with the command-line " @@ -1214,115 +866,58 @@ msgstr "" "引数は、コマンドライン引数がどう処理されるかを指定します。提供されているアク" "ションは:" -#: ../../library/argparse.rst:754 +#: ../../library/argparse.rst:759 msgid "" "``'store'`` - This just stores the argument's value. This is the default " -"action." +"action. For example::" msgstr "" +"``'store'`` - これは単に引数の値を格納します。これはデフォルトのアクションで" +"す。例えば::" -#: ../../library/argparse.rst:757 +#: ../../library/argparse.rst:767 msgid "" "``'store_const'`` - This stores the value specified by the const_ keyword " -"argument; note that the const_ keyword argument defaults to ``None``. The " -"``'store_const'`` action is most commonly used with optional arguments that " -"specify some sort of flag. For example::" +"argument. The ``'store_const'`` action is most commonly used with optional " +"arguments that specify some sort of flag. For example::" msgstr "" "``'store_const'`` - このアクションは const_ キーワード引数で指定された値を格" -"納します。const_ キーワード引数のデフォルト値は ``None`` であることに注意して" -"ください。``'store_const'`` アクションは、何かの種類のフラグを指定するオプ" -"ション引数によく使われます。例えば::" +"納します。``'store_const'`` アクションは、何かの種類のフラグを指定するオプ" +"ション引数によく使われます。例えば:" -#: ../../library/argparse.rst:762 -msgid "" -">>> parser = argparse.ArgumentParser()\n" -">>> parser.add_argument('--foo', action='http://github.com/store_const', const=42)\n" -">>> parser.parse_args(['--foo'])\n" -"Namespace(foo=42)" -msgstr "" - -#: ../../library/argparse.rst:767 +#: ../../library/argparse.rst:776 msgid "" "``'store_true'`` and ``'store_false'`` - These are special cases of " "``'store_const'`` used for storing the values ``True`` and ``False`` " "respectively. In addition, they create default values of ``False`` and " -"``True`` respectively::" -msgstr "" - -#: ../../library/argparse.rst:772 -msgid "" -">>> parser = argparse.ArgumentParser()\n" -">>> parser.add_argument('--foo', action='http://github.com/store_true')\n" -">>> parser.add_argument('--bar', action='http://github.com/store_false')\n" -">>> parser.add_argument('--baz', action='http://github.com/store_false')\n" -">>> parser.parse_args('--foo --bar'.split())\n" -"Namespace(foo=True, bar=False, baz=True)" +"``True`` respectively. For example::" msgstr "" +"``'store_true'``, ``'store_false'`` - これらは ``'store_const'`` の、それぞ" +"れ ``True`` と ``False`` を格納する特別版になります。加えて、これらはそれぞれ" +"デフォルト値を順に ``False`` と ``True`` にします。例えば::" -#: ../../library/argparse.rst:779 +#: ../../library/argparse.rst:788 msgid "" "``'append'`` - This stores a list, and appends each argument value to the " -"list. It is useful to allow an option to be specified multiple times. If the " -"default value is non-empty, the default elements will be present in the " -"parsed value for the option, with any values from the command line appended " -"after those default values. Example usage::" -msgstr "" -"``'append'`` - このアクションはリストを格納し、それぞれの引数として与えられた" -"値をリストに追加します。これは複数回指定可能なオプション引数に対して有用で" -"す。デフォルト値が空でない場合、デフォルト値は常にパースされたリストに含ま" -"れ、コマンドラインで指定した値はデフォルト値の後に追加されます。使用例::" - -#: ../../library/argparse.rst:785 -msgid "" -">>> parser = argparse.ArgumentParser()\n" -">>> parser.add_argument('--foo', action='http://github.com/append')\n" -">>> parser.parse_args('--foo 1 --foo 2'.split())\n" -"Namespace(foo=['1', '2'])" +"list. This is useful to allow an option to be specified multiple times. " +"Example usage::" msgstr "" +"``'append'`` - このアクションはリストを格納して、各引数の値をそのリストに追加" +"します。このアクションは複数回指定を許可したいオプションに便利です。利用例::" -#: ../../library/argparse.rst:790 +#: ../../library/argparse.rst:797 msgid "" "``'append_const'`` - This stores a list, and appends the value specified by " -"the const_ keyword argument to the list; note that the const_ keyword " -"argument defaults to ``None``. The ``'append_const'`` action is typically " +"the const_ keyword argument to the list. (Note that the const_ keyword " +"argument defaults to ``None``.) The ``'append_const'`` action is typically " "useful when multiple arguments need to store constants to the same list. For " "example::" msgstr "" "``'append_const'`` - このアクションはリストを格納して、const_ キーワード引数" -"に与えられた値をそのリストに追加します。const_ キーワード引数のデフォルト値" -"は ``None`` であることに注意してください。``'append_const'`` アクションは、定" -"数を同じリストに複数回格納する場合に便利です。例えば::" +"に与えられた値をそのリストに追加します (const_ キーワード引数のデフォルト値は" +"あまり役に立たない ``None`` であることに注意)。``'append_const'`` アクション" +"は、定数を同じリストに複数回格納する場合に便利です。例えば::" -#: ../../library/argparse.rst:796 -msgid "" -">>> parser = argparse.ArgumentParser()\n" -">>> parser.add_argument('--str', dest='types', action='http://github.com/append_const', " -"const=str)\n" -">>> parser.add_argument('--int', dest='types', action='http://github.com/append_const', " -"const=int)\n" -">>> parser.parse_args('--str --int'.split())\n" -"Namespace(types=[, ])" -msgstr "" - -#: ../../library/argparse.rst:802 -msgid "" -"``'extend'`` - This stores a list and appends each item from the multi-value " -"argument list to it. The ``'extend'`` action is typically used with the " -"nargs_ keyword argument value ``'+'`` or ``'*'``. Note that when nargs_ is " -"``None`` (the default) or ``'?'``, each character of the argument string " -"will be appended to the list. Example usage::" -msgstr "" - -#: ../../library/argparse.rst:810 -msgid "" -">>> parser = argparse.ArgumentParser()\n" -">>> parser.add_argument(\"--foo\", action=\"extend\", nargs=\"+\", " -"type=str)\n" -">>> parser.parse_args([\"--foo\", \"f1\", \"--foo\", \"f2\", \"f3\", " -"\"f4\"])\n" -"Namespace(foo=['f1', 'f2', 'f3', 'f4'])" -msgstr "" - -#: ../../library/argparse.rst:817 +#: ../../library/argparse.rst:809 msgid "" "``'count'`` - This counts the number of times a keyword argument occurs. For " "example, this is useful for increasing verbosity levels::" @@ -1330,21 +925,13 @@ msgstr "" "``'count'`` - このアクションはキーワード引数の数を数えます。例えば、verboseレ" "ベルを上げるのに役立ちます::" -#: ../../library/argparse.rst:820 -msgid "" -">>> parser = argparse.ArgumentParser()\n" -">>> parser.add_argument('--verbose', '-v', action='http://github.com/count', default=0)\n" -">>> parser.parse_args(['-vvv'])\n" -"Namespace(verbose=3)" -msgstr "" - -#: ../../library/argparse.rst:825 +#: ../../library/argparse.rst:817 msgid "Note, the *default* will be ``None`` unless explicitly set to *0*." msgstr "" "*default* は明示的に *0* と指定されない場合は ``None`` であることに注意してく" "ださい。" -#: ../../library/argparse.rst:827 +#: ../../library/argparse.rst:819 msgid "" "``'help'`` - This prints a complete help message for all the options in the " "current parser and then exits. By default a help action is automatically " @@ -1355,7 +942,7 @@ msgstr "" "セージを表示し、終了します。出力の生成方法の詳細については :class:" "`ArgumentParser` を参照してください。" -#: ../../library/argparse.rst:832 +#: ../../library/argparse.rst:824 msgid "" "``'version'`` - This expects a ``version=`` keyword argument in the :meth:" "`~ArgumentParser.add_argument` call, and prints version information and " @@ -1365,91 +952,61 @@ msgstr "" "出しに ``version=`` キーワード引数を期待します。指定されたときはバージョン情" "報を表示して終了します::" -#: ../../library/argparse.rst:836 -msgid "" -">>> import argparse\n" -">>> parser = argparse.ArgumentParser(prog='PROG')\n" -">>> parser.add_argument('--version', action='http://github.com/version', version='%(prog)s " -"2.0')\n" -">>> parser.parse_args(['--version'])\n" -"PROG 2.0" -msgstr "" - -#: ../../library/argparse.rst:842 +#: ../../library/argparse.rst:834 msgid "" -"Only actions that consume command-line arguments (e.g. ``'store'``, " -"``'append'`` or ``'extend'``) can be used with positional arguments." +"``'extend'`` - This stores a list, and extends each argument value to the " +"list. Example usage::" msgstr "" +"``'extend'`` - このアクションはリストを格納して、各引数の値でそのリストを拡張" +"します。利用例::" -#: ../../library/argparse.rst:847 +#: ../../library/argparse.rst:845 msgid "" -"You may also specify an arbitrary action by passing an :class:`Action` " -"subclass or other object that implements the same interface. The :class:`!" -"BooleanOptionalAction` is available in :mod:`!argparse` and adds support for " +"You may also specify an arbitrary action by passing an Action subclass or " +"other object that implements the same interface. The " +"``BooleanOptionalAction`` is available in ``argparse`` and adds support for " "boolean actions such as ``--foo`` and ``--no-foo``::" msgstr "" +"また、Action のサブクラス、またはそれと同じインターフェースを実装するオブジェ" +"クトを渡すことにより、任意のアクションを指定することができます。例えば " +"``argparse`` モジュールには ``BooleanOptionalAction`` があり、``--foo`` や " +"``--no-foo`` のようなオプションに対して真偽値を設定するアクションをサポートし" +"ています::" -#: ../../library/argparse.rst:852 -msgid "" -">>> import argparse\n" -">>> parser = argparse.ArgumentParser()\n" -">>> parser.add_argument('--foo', action=argparse.BooleanOptionalAction)\n" -">>> parser.parse_args(['--no-foo'])\n" -"Namespace(foo=False)" -msgstr "" - -#: ../../library/argparse.rst:860 +#: ../../library/argparse.rst:858 msgid "" "The recommended way to create a custom action is to extend :class:`Action`, " -"overriding the :meth:`!__call__` method and optionally the :meth:`!__init__` " -"and :meth:`!format_usage` methods. You can also register custom actions " -"using the :meth:`~ArgumentParser.register` method and reference them by " -"their registered name." +"overriding the ``__call__`` method and optionally the ``__init__`` and " +"``format_usage`` methods." msgstr "" +"カスタムアクションを作成する推奨の方法は、:class:`Action` クラスを継承し、" +"``__call__`` メソッド (および、任意で ``__init__`` および ``format_usage`` メ" +"ソッド) をオーバーライドすることです。" -#: ../../library/argparse.rst:865 +#: ../../library/argparse.rst:862 msgid "An example of a custom action::" msgstr "カスタムアクションの例です::" -#: ../../library/argparse.rst:867 -msgid "" -">>> class FooAction(argparse.Action):\n" -"... def __init__(self, option_strings, dest, nargs=None, **kwargs):\n" -"... if nargs is not None:\n" -"... raise ValueError(\"nargs not allowed\")\n" -"... super().__init__(option_strings, dest, **kwargs)\n" -"... def __call__(self, parser, namespace, values, option_string=None):\n" -"... print('%r %r %r' % (namespace, values, option_string))\n" -"... setattr(namespace, self.dest, values)\n" -"...\n" -">>> parser = argparse.ArgumentParser()\n" -">>> parser.add_argument('--foo', action=FooAction)\n" -">>> parser.add_argument('bar', action=FooAction)\n" -">>> args = parser.parse_args('1 --foo 2'.split())\n" -"Namespace(bar=None, foo=None) '1' None\n" -"Namespace(bar='1', foo=None) '2' '--foo'\n" -">>> args\n" -"Namespace(bar='1', foo='2')" -msgstr "" - -#: ../../library/argparse.rst:885 +#: ../../library/argparse.rst:882 msgid "For more details, see :class:`Action`." msgstr "詳細は :class:`Action` を参照してください。" -#: ../../library/argparse.rst:891 +#: ../../library/argparse.rst:885 msgid "nargs" msgstr "nargs" -#: ../../library/argparse.rst:893 +#: ../../library/argparse.rst:887 msgid "" -":class:`ArgumentParser` objects usually associate a single command-line " -"argument with a single action to be taken. The ``nargs`` keyword argument " -"associates a different number of command-line arguments with a single " -"action. See also :ref:`specifying-ambiguous-arguments`. The supported values " -"are:" +"ArgumentParser objects usually associate a single command-line argument with " +"a single action to be taken. The ``nargs`` keyword argument associates a " +"different number of command-line arguments with a single action. The " +"supported values are:" msgstr "" +"ArgumentParser オブジェクトは通常1つのコマンドライン引数を1つのアクションに渡" +"します。``nargs`` キーワード引数は1つのアクションにそれ以外の数のコマンドライ" +"ン引数を割り当てます。指定できる値は:" -#: ../../library/argparse.rst:898 +#: ../../library/argparse.rst:892 msgid "" "``N`` (an integer). ``N`` arguments from the command line will be gathered " "together into a list. For example::" @@ -1459,22 +1016,13 @@ msgstr "" #: ../../library/argparse.rst:901 msgid "" -">>> parser = argparse.ArgumentParser()\n" -">>> parser.add_argument('--foo', nargs=2)\n" -">>> parser.add_argument('bar', nargs=1)\n" -">>> parser.parse_args('c --foo a b'.split())\n" -"Namespace(bar=['c'], foo=['a', 'b'])" -msgstr "" - -#: ../../library/argparse.rst:907 -msgid "" "Note that ``nargs=1`` produces a list of one item. This is different from " "the default, in which the item is produced by itself." msgstr "" "``nargs=1`` は1要素のリストを作ることに注意してください。これはデフォルトの、" "要素がそのまま属性になる動作とは異なります。" -#: ../../library/argparse.rst:912 +#: ../../library/argparse.rst:906 msgid "" "``'?'``. One argument will be consumed from the command line if possible, " "and produced as a single item. If no command-line argument is present, the " @@ -1489,40 +1037,14 @@ msgstr "" "いというケースもありえます。この場合は const_ の値が生成されます。この動作の" "例です::" -#: ../../library/argparse.rst:919 -msgid "" -">>> parser = argparse.ArgumentParser()\n" -">>> parser.add_argument('--foo', nargs='?', const='c', default='d')\n" -">>> parser.add_argument('bar', nargs='?', default='d')\n" -">>> parser.parse_args(['XX', '--foo', 'YY'])\n" -"Namespace(bar='XX', foo='YY')\n" -">>> parser.parse_args(['XX', '--foo'])\n" -"Namespace(bar='XX', foo='c')\n" -">>> parser.parse_args([])\n" -"Namespace(bar='d', foo='d')" -msgstr "" - -#: ../../library/argparse.rst:929 +#: ../../library/argparse.rst:923 msgid "" "One of the more common uses of ``nargs='?'`` is to allow optional input and " "output files::" msgstr "" "``nargs='?'`` のよくある利用例の1つは、入出力ファイルの指定オプションです::" -#: ../../library/argparse.rst:932 -msgid "" -">>> parser = argparse.ArgumentParser()\n" -">>> parser.add_argument('infile', nargs='?')\n" -">>> parser.add_argument('outfile', nargs='?')\n" -">>> parser.parse_args(['input.txt', 'output.txt'])\n" -"Namespace(infile='input.txt', outfile='output.txt')\n" -">>> parser.parse_args(['input.txt'])\n" -"Namespace(infile='input.txt', outfile=None)\n" -">>> parser.parse_args([])\n" -"Namespace(infile=None, outfile=None)" -msgstr "" - -#: ../../library/argparse.rst:944 +#: ../../library/argparse.rst:940 msgid "" "``'*'``. All command-line arguments present are gathered into a list. Note " "that it generally doesn't make much sense to have more than one positional " @@ -1533,17 +1055,7 @@ msgstr "" "が ``nargs='*'`` を持つことにあまり意味はありませんが、複数のオプション引数" "が ``nargs='*'`` を持つことはありえます。例えば::" -#: ../../library/argparse.rst:949 -msgid "" -">>> parser = argparse.ArgumentParser()\n" -">>> parser.add_argument('--foo', nargs='*')\n" -">>> parser.add_argument('--bar', nargs='*')\n" -">>> parser.add_argument('baz', nargs='*')\n" -">>> parser.parse_args('a b --foo x y --bar 1 2'.split())\n" -"Namespace(bar=['1', '2'], baz=['a', 'b'], foo=['x', 'y'])" -msgstr "" - -#: ../../library/argparse.rst:958 +#: ../../library/argparse.rst:954 msgid "" "``'+'``. Just like ``'*'``, all command-line args present are gathered into " "a list. Additionally, an error message will be generated if there wasn't at " @@ -1553,31 +1065,22 @@ msgstr "" "す。加えて、最低でも1つのコマンドライン引数が存在しない場合にエラーメッセージ" "を生成します。例えば::" -#: ../../library/argparse.rst:962 -msgid "" -">>> parser = argparse.ArgumentParser(prog='PROG')\n" -">>> parser.add_argument('foo', nargs='+')\n" -">>> parser.parse_args(['a', 'b'])\n" -"Namespace(foo=['a', 'b'])\n" -">>> parser.parse_args([])\n" -"usage: PROG [-h] foo [foo ...]\n" -"PROG: error: the following arguments are required: foo" -msgstr "" - -#: ../../library/argparse.rst:970 +#: ../../library/argparse.rst:966 msgid "" "If the ``nargs`` keyword argument is not provided, the number of arguments " "consumed is determined by the action_. Generally this means a single " "command-line argument will be consumed and a single item (not a list) will " -"be produced. Actions that do not consume command-line arguments (e.g. " -"``'store_const'``) set ``nargs=0``." +"be produced." msgstr "" +"``nargs`` キーワード引数が指定されない場合、受け取る引数の数は action_ によっ" +"て決定されます。通常これは、1つのコマンドライン引数は1つのアイテムになる (リ" +"ストにはならない) ことを意味します。" -#: ../../library/argparse.rst:980 +#: ../../library/argparse.rst:972 msgid "const" msgstr "const" -#: ../../library/argparse.rst:982 +#: ../../library/argparse.rst:974 msgid "" "The ``const`` argument of :meth:`~ArgumentParser.add_argument` is used to " "hold constant values that are not read from the command line but are " @@ -1588,50 +1091,47 @@ msgstr "" "から読み込まれないけれども :class:`ArgumentParser` のいくつかのアクションで必" "要とされる値のために使われます。この引数のよくある2つの使用法は:" -#: ../../library/argparse.rst:986 +#: ../../library/argparse.rst:978 msgid "" "When :meth:`~ArgumentParser.add_argument` is called with " "``action='http://github.com/store_const'`` or ``action='http://github.com/append_const'``. These actions add " "the ``const`` value to one of the attributes of the object returned by :meth:" -"`~ArgumentParser.parse_args`. See the action_ description for examples. If " -"``const`` is not provided to :meth:`~ArgumentParser.add_argument`, it will " -"receive a default value of ``None``." +"`~ArgumentParser.parse_args`. See the action_ description for examples." msgstr "" ":meth:`~ArgumentParser.add_argument` が ``action='http://github.com/store_const'`` か " "``action='http://github.com/append_const'`` で呼び出されたとき、これらのアクションは ``const`` " "の値を :meth:`~ArgumentParser.parse_args` が返すオブジェクトの属性に追加しま" -"す。サンプルは action_ の説明を参照してください。``const`` が :meth:" -"`~ArgumentParser.add_argument` に与えられなければ、``None`` のデフォルト値を" -"受け取ります。" +"す。サンプルは action_ の説明を参照してください。" -#: ../../library/argparse.rst:994 +#: ../../library/argparse.rst:983 msgid "" "When :meth:`~ArgumentParser.add_argument` is called with option strings " "(like ``-f`` or ``--foo``) and ``nargs='?'``. This creates an optional " "argument that can be followed by zero or one command-line arguments. When " "parsing the command line, if the option string is encountered with no " "command-line argument following it, the value of ``const`` will be assumed " -"to be ``None`` instead. See the nargs_ description for examples." +"instead. See the nargs_ description for examples." msgstr "" ":meth:`~ArgumentParser.add_argument` がオプション文字列 (``-f`` や ``--" "foo``) と ``nargs='?'`` で呼び出された場合。この場合0個か1つのコマンドライン" "引数を取るオプション引数が作られます。オプション引数にコマンドライン引数が続" -"かなかった場合、代わりに ``const`` の値が ``None`` であると見なされます。サン" -"プルは nargs_ の説明を参照してください。" +"かなかった場合、 ``const`` の値が代わりに利用されます。サンプルは nargs_ の説" +"明を参照してください。" -#: ../../library/argparse.rst:1001 +#: ../../library/argparse.rst:990 msgid "" -"``const=None`` by default, including when ``action='http://github.com/append_const'`` or " -"``action='http://github.com/store_const'``." +"With the ``'store_const'`` and ``'append_const'`` actions, the ``const`` " +"keyword argument must be given. For other actions, it defaults to ``None``." msgstr "" -"``action='http://github.com/append_const'`` や ``action='http://github.com/store_const'`` の場合も含め、デフォル" -"トでは ``const=None`` です。" +"``'store_const'`` と ``'append_const'`` アクションでは、 ``const`` キーワード" +"引数を与える必要があります。他のアクションでは、デフォルトは ``None`` になり" +"ます。" -#: ../../library/argparse.rst:1008 +#: ../../library/argparse.rst:995 msgid "default" msgstr "default" -#: ../../library/argparse.rst:1010 +#: ../../library/argparse.rst:997 msgid "" "All optional arguments and some positional arguments may be omitted at the " "command line. The ``default`` keyword argument of :meth:`~ArgumentParser." @@ -1646,31 +1146,15 @@ msgstr "" "る値を指定します。オプション引数では、オプション文字列がコマンドライン上に存" "在しなかったときに ``default`` の値が利用されます::" -#: ../../library/argparse.rst:1017 -msgid "" -">>> parser = argparse.ArgumentParser()\n" -">>> parser.add_argument('--foo', default=42)\n" -">>> parser.parse_args(['--foo', '2'])\n" -"Namespace(foo='2')\n" -">>> parser.parse_args([])\n" -"Namespace(foo=42)" -msgstr "" - -#: ../../library/argparse.rst:1024 +#: ../../library/argparse.rst:1011 msgid "" "If the target namespace already has an attribute set, the action *default* " -"will not overwrite it::" -msgstr "" - -#: ../../library/argparse.rst:1027 -msgid "" -">>> parser = argparse.ArgumentParser()\n" -">>> parser.add_argument('--foo', default=42)\n" -">>> parser.parse_args([], namespace=argparse.Namespace(foo=101))\n" -"Namespace(foo=101)" +"will not over write it::" msgstr "" +"対象となる namespace がすでにその属性を持っている場合、それは default の値で" +"は上書きされません::" -#: ../../library/argparse.rst:1032 +#: ../../library/argparse.rst:1019 msgid "" "If the ``default`` value is a string, the parser parses the value as if it " "were a command-line argument. In particular, the parser applies any type_ " @@ -1682,16 +1166,7 @@ msgstr "" "に、type_ 変換引数が与えられていればそれらを適用します。そうでない場合、パー" "サーは値をそのまま使用します::" -#: ../../library/argparse.rst:1037 -msgid "" -">>> parser = argparse.ArgumentParser()\n" -">>> parser.add_argument('--length', default='10', type=int)\n" -">>> parser.add_argument('--width', default=10.5, type=int)\n" -">>> parser.parse_args()\n" -"Namespace(length=10, width=10.5)" -msgstr "" - -#: ../../library/argparse.rst:1043 +#: ../../library/argparse.rst:1030 msgid "" "For positional arguments with nargs_ equal to ``?`` or ``*``, the " "``default`` value is used when no command-line argument was present::" @@ -1699,24 +1174,7 @@ msgstr "" "nargs_ が ``?`` か ``*`` である位置引数では、コマンドライン引数が指定されな" "かった場合 ``default`` の値が使われます。例えば::" -#: ../../library/argparse.rst:1046 -msgid "" -">>> parser = argparse.ArgumentParser()\n" -">>> parser.add_argument('foo', nargs='?', default=42)\n" -">>> parser.parse_args(['a'])\n" -"Namespace(foo='a')\n" -">>> parser.parse_args([])\n" -"Namespace(foo=42)" -msgstr "" - -#: ../../library/argparse.rst:1053 -msgid "" -"For required_ arguments, the ``default`` value is ignored. For example, this " -"applies to positional arguments with nargs_ values other than ``?`` or " -"``*``, or optional arguments marked as ``required=True``." -msgstr "" - -#: ../../library/argparse.rst:1057 +#: ../../library/argparse.rst:1041 msgid "" "Providing ``default=argparse.SUPPRESS`` causes no attribute to be added if " "the command-line argument was not present::" @@ -1724,21 +1182,11 @@ msgstr "" "``default=argparse.SUPPRESS`` を渡すと、コマンドライン引数が存在しないときに" "属性の追加をしなくなります::" -#: ../../library/argparse.rst:1060 -msgid "" -">>> parser = argparse.ArgumentParser()\n" -">>> parser.add_argument('--foo', default=argparse.SUPPRESS)\n" -">>> parser.parse_args([])\n" -"Namespace()\n" -">>> parser.parse_args(['--foo', '1'])\n" -"Namespace(foo='1')" -msgstr "" - -#: ../../library/argparse.rst:1071 +#: ../../library/argparse.rst:1053 msgid "type" msgstr "type" -#: ../../library/argparse.rst:1073 +#: ../../library/argparse.rst:1055 msgid "" "By default, the parser reads command-line arguments in as simple strings. " "However, quite often the command-line string should instead be interpreted " @@ -1746,13 +1194,13 @@ msgid "" "keyword for :meth:`~ArgumentParser.add_argument` allows any necessary type-" "checking and type conversions to be performed." msgstr "" -"デフォルトでは、パーサーはコマンドライン引数を単なる文字列として読み込みま" -"す。しかし、それらの文字列を :class:`float`, :class:`int` など別の型として扱" -"うべき事がよくあります。:meth:`~ArgumentParser.add_argument` の ``type`` キー" -"ワード引数に指定する type converter により、必要な型チェックと型変換を行うこ" -"とができます。" +"デフォルトでは、:class:`ArgumentParser` オブジェクトはコマンドライン引数を単" +"なる文字列として読み込みます。しかし、それらの文字列を :class:`float`, :" +"class:`int` など別の型として扱うべき事がよくあります。:meth:`~ArgumentParser." +"add_argument` の ``type`` キーワード引数に指定する type converter により、必" +"要な型チェックと型変換を行うことができます。" -#: ../../library/argparse.rst:1079 +#: ../../library/argparse.rst:1061 msgid "" "If the type_ keyword is used with the default_ keyword, the type converter " "is only applied if the default is a string." @@ -1760,49 +1208,29 @@ msgstr "" "もし type_ キーワードが default_ キーワードとともに使用された場合、default_ " "の値が文字列のときのみ、type converter による変換などが行われます。" -#: ../../library/argparse.rst:1082 +#: ../../library/argparse.rst:1064 msgid "" -"The argument to ``type`` can be a callable that accepts a single string or " -"the name of a registered type (see :meth:`~ArgumentParser.register`) If the " -"function raises :exc:`ArgumentTypeError`, :exc:`TypeError`, or :exc:" +"The argument to ``type`` can be any callable that accepts a single string. " +"If the function raises :exc:`ArgumentTypeError`, :exc:`TypeError`, or :exc:" "`ValueError`, the exception is caught and a nicely formatted error message " -"is displayed. Other exception types are not handled." +"is displayed. No other exception types are handled." msgstr "" +"``type`` キーワードの引数として、単一の文字列を受け取るような任意の呼び出しオ" +"ブジェクト (callable) が使用できます。もし呼び出しが :exc:" +"`ArgumentTypeError`, :exc:`TypeError`, または :exc:`ValueError` 型の例外を送" +"出した場合は、parser がそれをキャッチして適切なエラーメッセージが表示されま" +"す。それ以外の型の例外は処理されません。" -#: ../../library/argparse.rst:1088 +#: ../../library/argparse.rst:1069 msgid "Common built-in types and functions can be used as type converters:" msgstr "" "一般的なビルトインデータ型や関数を ``type`` 引数の値として直接指定できます::" -#: ../../library/argparse.rst:1090 -msgid "" -"import argparse\n" -"import pathlib\n" -"\n" -"parser = argparse.ArgumentParser()\n" -"parser.add_argument('count', type=int)\n" -"parser.add_argument('distance', type=float)\n" -"parser.add_argument('street', type=ascii)\n" -"parser.add_argument('code_point', type=ord)\n" -"parser.add_argument('datapath', type=pathlib.Path)" -msgstr "" - -#: ../../library/argparse.rst:1102 +#: ../../library/argparse.rst:1085 msgid "User defined functions can be used as well:" msgstr "ユーザが定義した関数も使用できます::" -#: ../../library/argparse.rst:1104 -msgid "" -">>> def hyphenated(string):\n" -"... return '-'.join([word[:4] for word in string.casefold().split()])\n" -"...\n" -">>> parser = argparse.ArgumentParser()\n" -">>> _ = parser.add_argument('short_title', type=hyphenated)\n" -">>> parser.parse_args(['\"The Tale of Two Cities\"'])\n" -"Namespace(short_title='\"the-tale-of-two-citi')" -msgstr "" - -#: ../../library/argparse.rst:1114 +#: ../../library/argparse.rst:1097 msgid "" "The :func:`bool` function is not recommended as a type converter. All it " "does is convert empty strings to ``False`` and non-empty strings to " @@ -1813,7 +1241,7 @@ msgstr "" "これはおそらく望まれる動作ではないからです (訳注: 文字列 ``'false'`` を " "``False`` に変換してくれたりはしません)。" -#: ../../library/argparse.rst:1118 +#: ../../library/argparse.rst:1101 msgid "" "In general, the ``type`` keyword is a convenience that should only be used " "for simple conversions that can only raise one of the three supported " @@ -1825,29 +1253,33 @@ msgstr "" "ラー処理、またはリソース管理を伴うものは、引数を解析したあとに別個の処理とし" "て行うべきです。" -#: ../../library/argparse.rst:1123 +#: ../../library/argparse.rst:1106 msgid "" "For example, JSON or YAML conversions have complex error cases that require " -"better reporting than can be given by the ``type`` keyword. A :exc:`~json." -"JSONDecodeError` would not be well formatted and a :exc:`FileNotFoundError` " +"better reporting than can be given by the ``type`` keyword. An :exc:`~json." +"JSONDecodeError` would not be well formatted and a :exc:`FileNotFound` " "exception would not be handled at all." msgstr "" "たとえば、JSON または YAML からの変換は複雑なエラーケースを持つので、" "``type`` がサポートする以上のエラー表示を必要とするでしょう。(JSON デコーダが" "発生しうる) :exc:`~json.JSONDecodeError` は適切に整形されて表示されません。ま" -"た、:exc:`FileNotFoundError` が発生しても parser は何も処理しません。" +"た、:exc:`FileNotFound` が発生しても parser は何も処理しません。" -#: ../../library/argparse.rst:1128 +#: ../../library/argparse.rst:1111 msgid "" "Even :class:`~argparse.FileType` has its limitations for use with the " -"``type`` keyword. If one argument uses :class:`~argparse.FileType` and then " -"a subsequent argument fails, an error is reported but the file is not " -"automatically closed. In this case, it would be better to wait until after " -"the parser has run and then use the :keyword:`with`-statement to manage the " -"files." +"``type`` keyword. If one argument uses *FileType* and then a subsequent " +"argument fails, an error is reported but the file is not automatically " +"closed. In this case, it would be better to wait until after the parser has " +"run and then use the :keyword:`with`-statement to manage the files." msgstr "" +"また、``type`` キーワードに :class:`~argparse.FileType` を指定した場合には制" +"限があります。ある引数に *FileType* を指定してファイルが開かれ、その後ろのど" +"こかの引数で処理が失敗した場合、エラーが表示されますが、開かれたファイルは自" +"動では close されません。これを好まない場合は、parser による引数の処理が終わ" +"るまで待ち、その後に :keyword:`with` 文などでファイルを開くのがよいでしょう。" -#: ../../library/argparse.rst:1135 +#: ../../library/argparse.rst:1117 msgid "" "For type checkers that simply check against a fixed set of values, consider " "using the choices_ keyword instead." @@ -1855,53 +1287,42 @@ msgstr "" "なお、引数が、あらかじめ決められた値の候補のいずれかに一致するかをチェックし" "たいだけの場合には、代わりに choices_ キーワードの使用を検討してください。" -#: ../../library/argparse.rst:1142 +#: ../../library/argparse.rst:1122 msgid "choices" msgstr "choices" -#: ../../library/argparse.rst:1144 +#: ../../library/argparse.rst:1124 msgid "" "Some command-line arguments should be selected from a restricted set of " -"values. These can be handled by passing a sequence object as the *choices* " +"values. These can be handled by passing a container object as the *choices* " "keyword argument to :meth:`~ArgumentParser.add_argument`. When the command " "line is parsed, argument values will be checked, and an error message will " "be displayed if the argument was not one of the acceptable values::" msgstr "" "コマンドライン引数をいくつかの選択肢の中から選ばせたい場合があります。 これ" -"は :meth:`~ArgumentParser.add_argument` に シーケンスオブジェクトを " -"*choices* キーワード引数として渡すことで可能です。コマンドラインを解析すると" -"き、引数の値がチェックされ、その値が選択肢の中に含まれていない場合はエラー" -"メッセージを表示します::" +"は :meth:`~ArgumentParser.add_argument` に *choices* キーワード引数を渡すこと" +"で可能です。コマンドラインを解析するとき、引数の値がチェックされ、その値が選" +"択肢の中に含まれていない場合はエラーメッセージを表示します::" -#: ../../library/argparse.rst:1150 +#: ../../library/argparse.rst:1139 msgid "" -">>> parser = argparse.ArgumentParser(prog='game.py')\n" -">>> parser.add_argument('move', choices=['rock', 'paper', 'scissors'])\n" -">>> parser.parse_args(['rock'])\n" -"Namespace(move='rock')\n" -">>> parser.parse_args(['fire'])\n" -"usage: game.py [-h] {rock,paper,scissors}\n" -"game.py: error: argument move: invalid choice: 'fire' (choose from 'rock',\n" -"'paper', 'scissors')" -msgstr "" - -#: ../../library/argparse.rst:1159 -msgid "" -"Note that inclusion in the *choices* sequence is checked after any type_ " +"Note that inclusion in the *choices* container is checked after any type_ " "conversions have been performed, so the type of the objects in the *choices* " -"sequence should match the type_ specified." +"container should match the type_ specified::" msgstr "" +"*choices* コンテナーに含まれているかどうかのチェックは、type_ による型変換が" +"実行された後であることに注意してください。このため、*choices* に格納するオブ" +"ジェクトの型は指定された type_ にマッチしている必要があります::" -#: ../../library/argparse.rst:1163 +#: ../../library/argparse.rst:1151 msgid "" -"Any sequence can be passed as the *choices* value, so :class:`list` " -"objects, :class:`tuple` objects, and custom sequences are all supported." +"Any container can be passed as the *choices* value, so :class:`list` " +"objects, :class:`set` objects, and custom containers are all supported." msgstr "" -"任意のシーケンスを *choices* に渡すことができます。すなわち、:class:`list` オ" -"ブジェクト、 :class:`tuple` オブジェクト、カスタムシーケンスはすべてサポート" -"されています。" +"任意のコンテナを *choices* に渡すことができます。すなわち、:class:`list` 、 :" +"class:`set`、カスタムコンテナなどはすべてサポートされています。" -#: ../../library/argparse.rst:1166 +#: ../../library/argparse.rst:1154 msgid "" "Use of :class:`enum.Enum` is not recommended because it is difficult to " "control its appearance in usage, help, and error messages." @@ -1909,43 +1330,36 @@ msgstr "" "ただし、:class:`enum.Enum` を渡すことは推奨されません。使用方法、ヘルプ、エ" "ラーメッセージなどでどのように表示されるかを制御することが難いからです。" -#: ../../library/argparse.rst:1169 +#: ../../library/argparse.rst:1157 msgid "" -"Formatted choices override the default *metavar* which is normally derived " +"Formatted choices overrides the default *metavar* which is normally derived " "from *dest*. This is usually what you want because the user never sees the " "*dest* parameter. If this display isn't desirable (perhaps because there " "are many choices), just specify an explicit metavar_." msgstr "" -"ヘルプテキストにおいて整形された choices の値は、通常 *dest* から生成されるデ" -"フォルトの *metavar* に優先します。ユーザーは *dest* パラメータを目にすること" -"がないため、この振る舞いは基本的には望ましいものです。もしこの表示方法が望ま" -"しくない場合 (おそらく多くの選択肢がある場合など) は、 metavar_ を明示的に指" -"定してください。" +"デフォルトでは *metavar* の値は *dest* から生成されますが、*choices* が指定さ" +"れた場合は、それが整形されて *metaver* の値となります。*dest* パラメータが" +"ユーザの目に入らないため、これが一般的には望まれる挙動であると思いますが、選" +"択肢が多すぎるなど、そのような表示を望まない場合は、明示的に metavar_ を指定" +"してください。" -#: ../../library/argparse.rst:1178 +#: ../../library/argparse.rst:1164 msgid "required" msgstr "required" -#: ../../library/argparse.rst:1180 +#: ../../library/argparse.rst:1166 msgid "" -"In general, the :mod:`!argparse` module assumes that flags like ``-f`` and " +"In general, the :mod:`argparse` module assumes that flags like ``-f`` and " "``--bar`` indicate *optional* arguments, which can always be omitted at the " "command line. To make an option *required*, ``True`` can be specified for " "the ``required=`` keyword argument to :meth:`~ArgumentParser.add_argument`::" msgstr "" +"通常 :mod:`argparse` モジュールは、``-f`` や ``--bar`` といったフラグは *任意" +"* の引数 (オプション引数) だと仮定し、コマンドライン上になくても良いものとし" +"て扱います。フラグの指定を *必須* にするには、:meth:`~ArgumentParser." +"add_argument` の ``required=`` キーワード引数に ``True`` を指定します::" -#: ../../library/argparse.rst:1185 -msgid "" -">>> parser = argparse.ArgumentParser()\n" -">>> parser.add_argument('--foo', required=True)\n" -">>> parser.parse_args(['--foo', 'BAR'])\n" -"Namespace(foo='BAR')\n" -">>> parser.parse_args([])\n" -"usage: [-h] --foo FOO\n" -": error: the following arguments are required: --foo" -msgstr "" - -#: ../../library/argparse.rst:1193 +#: ../../library/argparse.rst:1179 msgid "" "As the example shows, if an option is marked as ``required``, :meth:" "`~ArgumentParser.parse_args` will report an error if that option is not " @@ -1955,7 +1369,7 @@ msgstr "" "parse_args` はそのフラグがコマンドラインに存在しないときにエラーを表示しま" "す。" -#: ../../library/argparse.rst:1199 +#: ../../library/argparse.rst:1185 msgid "" "Required options are generally considered bad form because users expect " "*options* to be *optional*, and thus they should be avoided when possible." @@ -1963,19 +1377,22 @@ msgstr "" "ユーザーは、通常 *フラグ* の指定は *任意* であると認識しているため、必須にす" "るのは一般的には悪いやり方で、できる限り避けるべきです。" -#: ../../library/argparse.rst:1206 +#: ../../library/argparse.rst:1190 msgid "help" msgstr "help" -#: ../../library/argparse.rst:1208 +#: ../../library/argparse.rst:1192 msgid "" "The ``help`` value is a string containing a brief description of the " "argument. When a user requests help (usually by using ``-h`` or ``--help`` " "at the command line), these ``help`` descriptions will be displayed with " -"each argument." +"each argument::" msgstr "" +"``help`` の値はその引数の簡潔な説明を含む文字列です。ユーザーが (コマンドライ" +"ン上で ``-h`` か ``--help`` を指定するなどして) ヘルプを要求したとき、この " +"``help`` の説明が各引数に表示されます::" -#: ../../library/argparse.rst:1213 +#: ../../library/argparse.rst:1212 msgid "" "The ``help`` strings can include various format specifiers to avoid " "repetition of things like the program name or the argument default_. The " @@ -1988,22 +1405,7 @@ msgstr "" "プログラム名 ``%(prog)s`` と、 ``%(default)s`` や ``%(type)s`` など :meth:" "`~ArgumentParser.add_argument` のキーワード引数の多くが含まれます::" -#: ../../library/argparse.rst:1218 -msgid "" -">>> parser = argparse.ArgumentParser(prog='frobble')\n" -">>> parser.add_argument('bar', nargs='?', type=int, default=42,\n" -"... help='the bar to %(prog)s (default: %(default)s)')\n" -">>> parser.print_help()\n" -"usage: frobble [-h] [bar]\n" -"\n" -"positional arguments:\n" -" bar the bar to frobble (default: 42)\n" -"\n" -"options:\n" -" -h, --help show this help message and exit" -msgstr "" - -#: ../../library/argparse.rst:1230 +#: ../../library/argparse.rst:1229 msgid "" "As the help string supports %-formatting, if you want a literal ``%`` to " "appear in the help string, you must escape it as ``%%``." @@ -2011,80 +1413,42 @@ msgstr "" "ヘルプ文字列は %-フォーマットをサポートしているので、ヘルプ文字列内にリテラ" "ル ``%`` を表示したい場合は ``%%`` のようにエスケープしなければなりません。" -#: ../../library/argparse.rst:1233 +#: ../../library/argparse.rst:1232 msgid "" -":mod:`!argparse` supports silencing the help entry for certain options, by " +":mod:`argparse` supports silencing the help entry for certain options, by " "setting the ``help`` value to ``argparse.SUPPRESS``::" msgstr "" +":mod:`argparse` は ``help`` に ``argparse.SUPPRESS`` を設定することで、特定の" +"オプションをヘルプに表示させないことができます::" -#: ../../library/argparse.rst:1236 -msgid "" -">>> parser = argparse.ArgumentParser(prog='frobble')\n" -">>> parser.add_argument('--foo', help=argparse.SUPPRESS)\n" -">>> parser.print_help()\n" -"usage: frobble [-h]\n" -"\n" -"options:\n" -" -h, --help show this help message and exit" -msgstr "" - -#: ../../library/argparse.rst:1248 +#: ../../library/argparse.rst:1245 msgid "metavar" msgstr "metavar" -#: ../../library/argparse.rst:1250 +#: ../../library/argparse.rst:1247 msgid "" "When :class:`ArgumentParser` generates help messages, it needs some way to " -"refer to each expected argument. By default, :class:`!ArgumentParser` " -"objects use the dest_ value as the \"name\" of each object. By default, for " -"positional argument actions, the dest_ value is used directly, and for " -"optional argument actions, the dest_ value is uppercased. So, a single " -"positional argument with ``dest='bar'`` will be referred to as ``bar``. A " -"single optional argument ``--foo`` that should be followed by a single " -"command-line argument will be referred to as ``FOO``. An example::" -msgstr "" - -#: ../../library/argparse.rst:1259 -msgid "" -">>> parser = argparse.ArgumentParser()\n" -">>> parser.add_argument('--foo')\n" -">>> parser.add_argument('bar')\n" -">>> parser.parse_args('X --foo Y'.split())\n" -"Namespace(bar='X', foo='Y')\n" -">>> parser.print_help()\n" -"usage: [-h] [--foo FOO] bar\n" -"\n" -"positional arguments:\n" -" bar\n" -"\n" -"options:\n" -" -h, --help show this help message and exit\n" -" --foo FOO" -msgstr "" - -#: ../../library/argparse.rst:1274 +"refer to each expected argument. By default, ArgumentParser objects use the " +"dest_ value as the \"name\" of each object. By default, for positional " +"argument actions, the dest_ value is used directly, and for optional " +"argument actions, the dest_ value is uppercased. So, a single positional " +"argument with ``dest='bar'`` will be referred to as ``bar``. A single " +"optional argument ``--foo`` that should be followed by a single command-line " +"argument will be referred to as ``FOO``. An example::" +msgstr "" +":class:`ArgumentParser` がヘルプメッセージを出力するとき、各引数に対してなん" +"らかの参照方法が必要です。デフォルトでは、 ArgumentParser オブジェクトは各オ" +"ブジェクトの \"名前\" として dest_ を利用します。デフォルトでは、位置引数に" +"は dest_ の値をそのまま 利用し、オプション引数については dest_ の値を大文字に" +"変換して利用します。このため、1つの ``dest='bar'`` である位置引数は ``bar`` " +"として参照されます。 1つのオプション引数 ``--foo`` が1つのコマンドライン引数" +"を要求するときは、その引数は ``FOO`` として参照されます。以下に例を示します::" + +#: ../../library/argparse.rst:1271 msgid "An alternative name can be specified with ``metavar``::" msgstr "代わりの名前を、``metavar`` として指定できます::" -#: ../../library/argparse.rst:1276 -msgid "" -">>> parser = argparse.ArgumentParser()\n" -">>> parser.add_argument('--foo', metavar='YYY')\n" -">>> parser.add_argument('bar', metavar='XXX')\n" -">>> parser.parse_args('X --foo Y'.split())\n" -"Namespace(bar='X', foo='Y')\n" -">>> parser.print_help()\n" -"usage: [-h] [--foo YYY] XXX\n" -"\n" -"positional arguments:\n" -" XXX\n" -"\n" -"options:\n" -" -h, --help show this help message and exit\n" -" --foo YYY" -msgstr "" - -#: ../../library/argparse.rst:1291 +#: ../../library/argparse.rst:1288 msgid "" "Note that ``metavar`` only changes the *displayed* name - the name of the " "attribute on the :meth:`~ArgumentParser.parse_args` object is still " @@ -2094,7 +1458,7 @@ msgstr "" "`~ArgumentParser.parse_args` の返すオブジェクトの属性名は dest_ の値のままで" "す。" -#: ../../library/argparse.rst:1295 +#: ../../library/argparse.rst:1292 msgid "" "Different values of ``nargs`` may cause the metavar to be used multiple " "times. Providing a tuple to ``metavar`` specifies a different display for " @@ -2103,25 +1467,11 @@ msgstr "" "``nargs`` を指定した場合、metavar が複数回利用されるかもしれません。" "``metavar`` にタプルを渡すと、各引数に対して異なる名前を指定できます::" -#: ../../library/argparse.rst:1299 -msgid "" -">>> parser = argparse.ArgumentParser(prog='PROG')\n" -">>> parser.add_argument('-x', nargs=2)\n" -">>> parser.add_argument('--foo', nargs=2, metavar=('bar', 'baz'))\n" -">>> parser.print_help()\n" -"usage: PROG [-h] [-x X X] [--foo bar baz]\n" -"\n" -"options:\n" -" -h, --help show this help message and exit\n" -" -x X X\n" -" --foo bar baz" -msgstr "" - -#: ../../library/argparse.rst:1314 +#: ../../library/argparse.rst:1309 msgid "dest" msgstr "dest" -#: ../../library/argparse.rst:1316 +#: ../../library/argparse.rst:1311 msgid "" "Most :class:`ArgumentParser` actions add some value as an attribute of the " "object returned by :meth:`~ArgumentParser.parse_args`. The name of this " @@ -2138,14 +1488,6 @@ msgstr "" #: ../../library/argparse.rst:1323 msgid "" -">>> parser = argparse.ArgumentParser()\n" -">>> parser.add_argument('bar')\n" -">>> parser.parse_args(['XXX'])\n" -"Namespace(bar='XXX')" -msgstr "" - -#: ../../library/argparse.rst:1328 -msgid "" "For optional argument actions, the value of ``dest`` is normally inferred " "from the option strings. :class:`ArgumentParser` generates the value of " "``dest`` by taking the first long option string and stripping away the " @@ -2163,138 +1505,119 @@ msgstr "" "な属性名になるように ``_`` 文字へ変換されます。次の例はこの動作を示していま" "す::" -#: ../../library/argparse.rst:1337 -msgid "" -">>> parser = argparse.ArgumentParser()\n" -">>> parser.add_argument('-f', '--foo-bar', '--foo')\n" -">>> parser.add_argument('-x', '-y')\n" -">>> parser.parse_args('-f 1 -x 2'.split())\n" -"Namespace(foo_bar='1', x='2')\n" -">>> parser.parse_args('--foo 1 -y 2'.split())\n" -"Namespace(foo_bar='1', x='2')" -msgstr "" - -#: ../../library/argparse.rst:1345 +#: ../../library/argparse.rst:1340 msgid "``dest`` allows a custom attribute name to be provided::" msgstr "``dest`` にカスタムの属性名を与えることも可能です::" -#: ../../library/argparse.rst:1347 -msgid "" -">>> parser = argparse.ArgumentParser()\n" -">>> parser.add_argument('--foo', dest='bar')\n" -">>> parser.parse_args('--foo XXX'.split())\n" -"Namespace(bar='XXX')" -msgstr "" - -#: ../../library/argparse.rst:1356 -msgid "deprecated" -msgstr "" - -#: ../../library/argparse.rst:1358 -msgid "" -"During a project's lifetime, some arguments may need to be removed from the " -"command line. Before removing them, you should inform your users that the " -"arguments are deprecated and will be removed. The ``deprecated`` keyword " -"argument of :meth:`~ArgumentParser.add_argument`, which defaults to " -"``False``, specifies if the argument is deprecated and will be removed in " -"the future. For arguments, if ``deprecated`` is ``True``, then a warning " -"will be printed to :data:`sys.stderr` when the argument is used::" -msgstr "" - -#: ../../library/argparse.rst:1368 -msgid "" -">>> import argparse\n" -">>> parser = argparse.ArgumentParser(prog='snake.py')\n" -">>> parser.add_argument('--legs', default=0, type=int, deprecated=True)\n" -">>> parser.parse_args([])\n" -"Namespace(legs=0)\n" -">>> parser.parse_args(['--legs', '4'])\n" -"snake.py: warning: option '--legs' is deprecated\n" -"Namespace(legs=4)" -msgstr "" - -#: ../../library/argparse.rst:1381 +#: ../../library/argparse.rst:1348 msgid "Action classes" msgstr "Action クラス" -#: ../../library/argparse.rst:1383 +#: ../../library/argparse.rst:1350 msgid "" -":class:`!Action` classes implement the Action API, a callable which returns " -"a callable which processes arguments from the command-line. Any object which " -"follows this API may be passed as the ``action`` parameter to :meth:" -"`~ArgumentParser.add_argument`." +"Action classes implement the Action API, a callable which returns a callable " +"which processes arguments from the command-line. Any object which follows " +"this API may be passed as the ``action`` parameter to :meth:`add_argument`." msgstr "" +"Acrtion クラスは Action API、すなわちコマンドラインからの引数を処理する呼び出" +"し可能オブジェクトを返す呼び出し可能オブジェクトを実装します。この API に従う" +"あらゆるオブジェクトは ``action`` 引数として :meth:`add_argument` に渡すこと" +"ができます。" -#: ../../library/argparse.rst:1392 +#: ../../library/argparse.rst:1359 msgid "" -":class:`!Action` objects are used by an :class:`ArgumentParser` to represent " -"the information needed to parse a single argument from one or more strings " -"from the command line. The :class:`!Action` class must accept the two " -"positional arguments plus any keyword arguments passed to :meth:" -"`ArgumentParser.add_argument` except for the ``action`` itself." +"Action objects are used by an ArgumentParser to represent the information " +"needed to parse a single argument from one or more strings from the command " +"line. The Action class must accept the two positional arguments plus any " +"keyword arguments passed to :meth:`ArgumentParser.add_argument` except for " +"the ``action`` itself." msgstr "" +"Action オブジェクトは、コマンドラインからの一つ以上の文字列から単一の引数を解" +"析するのに必要とされる情報を表現するために ArgumentParser によって使われま" +"す。Action クラス 2 つの位置引数と、``action`` それ自身を除く :meth:" +"`ArgumentParser.add_argument` に渡されるすべてのキーワード引数を受け付けなけ" +"ればなりません。" -#: ../../library/argparse.rst:1398 +#: ../../library/argparse.rst:1365 msgid "" -"Instances of :class:`!Action` (or return value of any callable to the " -"``action`` parameter) should have attributes :attr:`!dest`, :attr:`!" -"option_strings`, :attr:`!default`, :attr:`!type`, :attr:`!required`, :attr:`!" -"help`, etc. defined. The easiest way to ensure these attributes are defined " -"is to call :meth:`!Action.__init__`." +"Instances of Action (or return value of any callable to the ``action`` " +"parameter) should have attributes \"dest\", \"option_strings\", \"default\", " +"\"type\", \"required\", \"help\", etc. defined. The easiest way to ensure " +"these attributes are defined is to call ``Action.__init__``." msgstr "" +"Action のインスタンス (あるいは ``action`` 引数に渡す任意の呼び出し可能オブ" +"ジェクトの返り値) は、属性 \"dest\", \"option_strings\", \"default\", " +"\"type\", \"required\", \"help\", などを定義しなければなりません。これらの属" +"性を定義するのを確実にするためにもっとも簡単な方法は、``Action.__init__`` を" +"呼び出すことです。" -#: ../../library/argparse.rst:1406 +#: ../../library/argparse.rst:1370 msgid "" -":class:`!Action` instances should be callable, so subclasses must override " -"the :meth:`!__call__` method, which should accept four parameters:" +"Action instances should be callable, so subclasses must override the " +"``__call__`` method, which should accept four parameters:" msgstr "" +"Action インスタンスは呼び出し可能でなければならず、したがって、サブクラスは " +"4 つの引数を受け取る ``__call__`` メソッドをオーバライドしなければなりません:" -#: ../../library/argparse.rst:1409 -msgid "" -"*parser* - The :class:`ArgumentParser` object which contains this action." -msgstr "" +#: ../../library/argparse.rst:1373 +msgid "``parser`` - The ArgumentParser object which contains this action." +msgstr "``parser`` - このアクションを持っている ArgumentParser オブジェクト。" -#: ../../library/argparse.rst:1411 +#: ../../library/argparse.rst:1375 msgid "" -"*namespace* - The :class:`Namespace` object that will be returned by :meth:" +"``namespace`` - The :class:`Namespace` object that will be returned by :meth:" "`~ArgumentParser.parse_args`. Most actions add an attribute to this object " "using :func:`setattr`." msgstr "" +"``namespace`` - :meth:`~ArgumentParser.parse_args` が返す :class:`Namespace` " +"オブジェクト。ほとんどのアクションはこのオブジェクトに属性を :func:`setattr` " +"を使って追加します。" -#: ../../library/argparse.rst:1415 +#: ../../library/argparse.rst:1379 msgid "" -"*values* - The associated command-line arguments, with any type conversions " -"applied. Type conversions are specified with the type_ keyword argument to :" -"meth:`~ArgumentParser.add_argument`." +"``values`` - The associated command-line arguments, with any type " +"conversions applied. Type conversions are specified with the type_ keyword " +"argument to :meth:`~ArgumentParser.add_argument`." msgstr "" +"``values`` - 型変換が適用された後の、関連付けられたコマンドライン引数。型変換" +"は :meth:`~ArgumentParser.add_argument` メソッドの type_ キーワード引数で指定" +"されます。" -#: ../../library/argparse.rst:1419 +#: ../../library/argparse.rst:1383 msgid "" -"*option_string* - The option string that was used to invoke this action. The " -"``option_string`` argument is optional, and will be absent if the action is " -"associated with a positional argument." +"``option_string`` - The option string that was used to invoke this action. " +"The ``option_string`` argument is optional, and will be absent if the action " +"is associated with a positional argument." msgstr "" +"``option_string`` - このアクションを実行したオプション文字列。" +"``option_string`` 引数はオプションで、アクションが位置引数に関連付けられた場" +"合は渡されません。" -#: ../../library/argparse.rst:1423 +#: ../../library/argparse.rst:1387 msgid "" -"The :meth:`!__call__` method may perform arbitrary actions, but will " -"typically set attributes on the ``namespace`` based on ``dest`` and " -"``values``." +"The ``__call__`` method may perform arbitrary actions, but will typically " +"set attributes on the ``namespace`` based on ``dest`` and ``values``." msgstr "" +"``__call__`` メソッドでは任意のアクションを行えます。典型的には ``dest`` およ" +"び ``values`` に基いて ``namespace`` に属性をセットします。" -#: ../../library/argparse.rst:1428 +#: ../../library/argparse.rst:1390 msgid "" -":class:`!Action` subclasses can define a :meth:`!format_usage` method that " -"takes no argument and return a string which will be used when printing the " -"usage of the program. If such method is not provided, a sensible default " -"will be used." +"Action subclasses can define a ``format_usage`` method that takes no " +"argument and return a string which will be used when printing the usage of " +"the program. If such method is not provided, a sensible default will be used." msgstr "" +"Action のサブクラスを定義する際に ``format_usage`` メソッドを実装することがで" +"きます。このメソッドは引数を受け取らず、プログラムの使用方法 (usage) を表示す" +"る際に使われる文字列を返すようにします。このメソッドが実装されていない場合" +"は、sensible default (訳注: システムにより上手く設定されたデフォルト値) が使" +"われます。" -#: ../../library/argparse.rst:1434 +#: ../../library/argparse.rst:1395 msgid "The parse_args() method" msgstr "parse_args() メソッド" -#: ../../library/argparse.rst:1438 +#: ../../library/argparse.rst:1399 msgid "" "Convert argument strings to objects and assign them as attributes of the " "namespace. Return the populated namespace." @@ -2302,14 +1625,17 @@ msgstr "" "引数の文字列をオブジェクトに変換し、namespace オブジェクトの属性に代入しま" "す。結果の namespace オブジェクトを返します。" -#: ../../library/argparse.rst:1441 +#: ../../library/argparse.rst:1402 msgid "" "Previous calls to :meth:`add_argument` determine exactly what objects are " -"created and how they are assigned. See the documentation for :meth:`!" -"add_argument` for details." +"created and how they are assigned. See the documentation for :meth:" +"`add_argument` for details." msgstr "" +"事前の :meth:`add_argument` メソッドの呼び出しにより、どのオブジェクトが生成" +"されてどう代入されるかが決定されます。詳細は :meth:`add_argument` のドキュメ" +"ントを参照してください。" -#: ../../library/argparse.rst:1445 +#: ../../library/argparse.rst:1406 msgid "" "args_ - List of strings to parse. The default is taken from :data:`sys." "argv`." @@ -2317,7 +1643,7 @@ msgstr "" "args_ - 解析する文字列のリスト。デフォルトでは :data:`sys.argv` から取得され" "ます。" -#: ../../library/argparse.rst:1448 +#: ../../library/argparse.rst:1409 msgid "" "namespace_ - An object to take the attributes. The default is a new empty :" "class:`Namespace` object." @@ -2325,11 +1651,11 @@ msgstr "" "namespace_ - 属性を代入するオブジェクト。デフォルトでは、新しい空の :class:" "`Namespace` オブジェクトです。" -#: ../../library/argparse.rst:1453 +#: ../../library/argparse.rst:1414 msgid "Option value syntax" msgstr "オプション値の文法" -#: ../../library/argparse.rst:1455 +#: ../../library/argparse.rst:1416 msgid "" "The :meth:`~ArgumentParser.parse_args` method supports several ways of " "specifying the value of an option (if it takes one). In the simplest case, " @@ -2339,18 +1665,7 @@ msgstr "" "オプションの値の指定に複数の方法をサポートしています。もっとも単純な場合に" "は、オプションとその値は次のように2つの別々の引数として渡されます::" -#: ../../library/argparse.rst:1459 -msgid "" -">>> parser = argparse.ArgumentParser(prog='PROG')\n" -">>> parser.add_argument('-x')\n" -">>> parser.add_argument('--foo')\n" -">>> parser.parse_args(['-x', 'X'])\n" -"Namespace(foo=None, x='X')\n" -">>> parser.parse_args(['--foo', 'FOO'])\n" -"Namespace(foo='FOO', x=None)" -msgstr "" - -#: ../../library/argparse.rst:1467 +#: ../../library/argparse.rst:1428 msgid "" "For long options (options with names longer than a single character), the " "option and value can also be passed as a single command-line argument, using " @@ -2360,13 +1675,7 @@ msgstr "" "値は次のように ``=`` で区切られた1つのコマンドライン引数として渡すこともでき" "ます::" -#: ../../library/argparse.rst:1471 -msgid "" -">>> parser.parse_args(['--foo=FOO'])\n" -"Namespace(foo='FOO', x=None)" -msgstr "" - -#: ../../library/argparse.rst:1474 +#: ../../library/argparse.rst:1435 msgid "" "For short options (options only one character long), the option and its " "value can be concatenated::" @@ -2374,13 +1683,7 @@ msgstr "" "短いオプション (1文字のオプション) では、オプションとその値は次のように連結し" "て渡すことができます::" -#: ../../library/argparse.rst:1477 -msgid "" -">>> parser.parse_args(['-xX'])\n" -"Namespace(foo=None, x='X')" -msgstr "" - -#: ../../library/argparse.rst:1480 +#: ../../library/argparse.rst:1441 msgid "" "Several short options can be joined together, using only a single ``-`` " "prefix, as long as only the last option (or none of them) requires a value::" @@ -2389,21 +1692,11 @@ msgstr "" "い場合、複数の短いオプションは次のように1つの接頭辞 ``-`` だけで連結できま" "す::" -#: ../../library/argparse.rst:1483 -msgid "" -">>> parser = argparse.ArgumentParser(prog='PROG')\n" -">>> parser.add_argument('-x', action='http://github.com/store_true')\n" -">>> parser.add_argument('-y', action='http://github.com/store_true')\n" -">>> parser.add_argument('-z')\n" -">>> parser.parse_args(['-xyzZ'])\n" -"Namespace(x=True, y=True, z='Z')" -msgstr "" - -#: ../../library/argparse.rst:1492 +#: ../../library/argparse.rst:1453 msgid "Invalid arguments" msgstr "不正な引数" -#: ../../library/argparse.rst:1494 +#: ../../library/argparse.rst:1455 msgid "" "While parsing the command line, :meth:`~ArgumentParser.parse_args` checks " "for a variety of errors, including ambiguous options, invalid types, invalid " @@ -2415,33 +1708,11 @@ msgstr "" "ます。それらのエラーが発生した場合、エラーメッセージと使用法メッセージを表示" "して終了します::" -#: ../../library/argparse.rst:1499 -msgid "" -">>> parser = argparse.ArgumentParser(prog='PROG')\n" -">>> parser.add_argument('--foo', type=int)\n" -">>> parser.add_argument('bar', nargs='?')\n" -"\n" -">>> # invalid type\n" -">>> parser.parse_args(['--foo', 'spam'])\n" -"usage: PROG [-h] [--foo FOO] [bar]\n" -"PROG: error: argument --foo: invalid int value: 'spam'\n" -"\n" -">>> # invalid option\n" -">>> parser.parse_args(['--bar'])\n" -"usage: PROG [-h] [--foo FOO] [bar]\n" -"PROG: error: no such option: --bar\n" -"\n" -">>> # wrong number of arguments\n" -">>> parser.parse_args(['spam', 'badger'])\n" -"usage: PROG [-h] [--foo FOO] [bar]\n" -"PROG: error: extra arguments found: badger" -msgstr "" - -#: ../../library/argparse.rst:1520 +#: ../../library/argparse.rst:1481 msgid "Arguments containing ``-``" msgstr "``-`` を含む引数" -#: ../../library/argparse.rst:1522 +#: ../../library/argparse.rst:1483 msgid "" "The :meth:`~ArgumentParser.parse_args` method attempts to give errors " "whenever the user has clearly made a mistake, but some situations are " @@ -2459,40 +1730,7 @@ msgstr "" "負の数として解釈でき、パーサーに負の数のように解釈できるオプションが存在しな" "い場合にのみ、``-`` で始まる位置引数になりえます::" -#: ../../library/argparse.rst:1530 -msgid "" -">>> parser = argparse.ArgumentParser(prog='PROG')\n" -">>> parser.add_argument('-x')\n" -">>> parser.add_argument('foo', nargs='?')\n" -"\n" -">>> # no negative number options, so -1 is a positional argument\n" -">>> parser.parse_args(['-x', '-1'])\n" -"Namespace(foo=None, x='-1')\n" -"\n" -">>> # no negative number options, so -1 and -5 are positional arguments\n" -">>> parser.parse_args(['-x', '-1', '-5'])\n" -"Namespace(foo='-5', x='-1')\n" -"\n" -">>> parser = argparse.ArgumentParser(prog='PROG')\n" -">>> parser.add_argument('-1', dest='one')\n" -">>> parser.add_argument('foo', nargs='?')\n" -"\n" -">>> # negative number options present, so -1 is an option\n" -">>> parser.parse_args(['-1', 'X'])\n" -"Namespace(foo=None, one='X')\n" -"\n" -">>> # negative number options present, so -2 is an option\n" -">>> parser.parse_args(['-2'])\n" -"usage: PROG [-h] [-1 ONE] [foo]\n" -"PROG: error: no such option: -2\n" -"\n" -">>> # negative number options present, so both -1s are options\n" -">>> parser.parse_args(['-1', '-1'])\n" -"usage: PROG [-h] [-1 ONE] [foo]\n" -"PROG: error: argument -1: expected one argument" -msgstr "" - -#: ../../library/argparse.rst:1560 +#: ../../library/argparse.rst:1521 msgid "" "If you have positional arguments that must begin with ``-`` and don't look " "like negative numbers, you can insert the pseudo-argument ``'--'`` which " @@ -2503,23 +1741,11 @@ msgstr "" "引数 ``'--'`` を挿入して、:meth:`~ArgumentParser.parse_args` にそれ以降のすべ" "てが位置引数だと教えることができます::" -#: ../../library/argparse.rst:1565 -msgid "" -">>> parser.parse_args(['--', '-f'])\n" -"Namespace(foo='-f', one=None)" -msgstr "" - -#: ../../library/argparse.rst:1568 -msgid "" -"See also :ref:`the argparse howto on ambiguous arguments ` for more details." -msgstr "" - -#: ../../library/argparse.rst:1574 +#: ../../library/argparse.rst:1532 msgid "Argument abbreviations (prefix matching)" msgstr "引数の短縮形 (先頭文字でのマッチング)" -#: ../../library/argparse.rst:1576 +#: ../../library/argparse.rst:1534 msgid "" "The :meth:`~ArgumentParser.parse_args` method :ref:`by default " "` allows long options to be abbreviated to a prefix, if the " @@ -2529,21 +1755,7 @@ msgstr "" "`、長いオプションに曖昧さがない (先頭文字列が一意である) かぎ" "り、先頭文字列に短縮して指定できます::" -#: ../../library/argparse.rst:1580 -msgid "" -">>> parser = argparse.ArgumentParser(prog='PROG')\n" -">>> parser.add_argument('-bacon')\n" -">>> parser.add_argument('-badger')\n" -">>> parser.parse_args('-bac MMM'.split())\n" -"Namespace(bacon='MMM', badger=None)\n" -">>> parser.parse_args('-bad WOOD'.split())\n" -"Namespace(bacon=None, badger='WOOD')\n" -">>> parser.parse_args('-ba BA'.split())\n" -"usage: PROG [-h] [-bacon BACON] [-badger BADGER]\n" -"PROG: error: ambiguous option: -ba could match -badger, -bacon" -msgstr "" - -#: ../../library/argparse.rst:1591 +#: ../../library/argparse.rst:1549 msgid "" "An error is produced for arguments that could produce more than one options. " "This feature can be disabled by setting :ref:`allow_abbrev` to ``False``." @@ -2551,38 +1763,26 @@ msgstr "" "先頭の文字が同じ引数が複数ある場合に短縮指定を行うとエラーを発生させます。こ" "の機能は :ref:`allow_abbrev` に ``False`` を指定することで無効にできます。" -#: ../../library/argparse.rst:1597 +#: ../../library/argparse.rst:1555 msgid "Beyond ``sys.argv``" msgstr "``sys.argv`` 以外" -#: ../../library/argparse.rst:1599 +#: ../../library/argparse.rst:1557 msgid "" -"Sometimes it may be useful to have an :class:`ArgumentParser` parse " -"arguments other than those of :data:`sys.argv`. This can be accomplished by " -"passing a list of strings to :meth:`~ArgumentParser.parse_args`. This is " -"useful for testing at the interactive prompt::" +"Sometimes it may be useful to have an ArgumentParser parse arguments other " +"than those of :data:`sys.argv`. This can be accomplished by passing a list " +"of strings to :meth:`~ArgumentParser.parse_args`. This is useful for " +"testing at the interactive prompt::" msgstr "" +"ArgumentParser が :data:`sys.argv` 以外の引数を解析できると役に立つ場合があり" +"ます。その場合は文字列のリストを :meth:`~ArgumentParser.parse_args` に渡しま" +"す。これはインタラクティブプロンプトからテストするときに便利です::" -#: ../../library/argparse.rst:1604 -msgid "" -">>> parser = argparse.ArgumentParser()\n" -">>> parser.add_argument(\n" -"... 'integers', metavar='int', type=int, choices=range(10),\n" -"... nargs='+', help='an integer in the range 0..9')\n" -">>> parser.add_argument(\n" -"... '--sum', dest='accumulate', action='http://github.com/store_const', const=sum,\n" -"... default=max, help='sum the integers (default: find the max)')\n" -">>> parser.parse_args(['1', '2', '3', '4'])\n" -"Namespace(accumulate=, integers=[1, 2, 3, 4])\n" -">>> parser.parse_args(['1', '2', '3', '4', '--sum'])\n" -"Namespace(accumulate=, integers=[1, 2, 3, 4])" -msgstr "" - -#: ../../library/argparse.rst:1619 +#: ../../library/argparse.rst:1577 msgid "The Namespace object" msgstr "Namespace オブジェクト" -#: ../../library/argparse.rst:1623 +#: ../../library/argparse.rst:1581 msgid "" "Simple class used by default by :meth:`~ArgumentParser.parse_args` to create " "an object holding attributes and return it." @@ -2590,26 +1790,19 @@ msgstr "" ":meth:`~ArgumentParser.parse_args` が属性を格納して返すためのオブジェクトにデ" "フォルトで使用されるシンプルなクラスです。" -#: ../../library/argparse.rst:1626 +#: ../../library/argparse.rst:1584 msgid "" "This class is deliberately simple, just an :class:`object` subclass with a " "readable string representation. If you prefer to have dict-like view of the " "attributes, you can use the standard Python idiom, :func:`vars`::" msgstr "" -"このクラスはシンプルに設計されており、単に読みやすい文字列表現を持った :" -"class:`object` のサブクラスです。もし属性を辞書のように扱える方が良ければ、標" -"準的な Python のイディオム :func:`vars` を利用できます::" +"デフォルトでは、 :meth:`~ArgumentParser.parse_args` は :class:`Namespace` の" +"新しいオブジェクトに必要な属性を設定して返します。このクラスはシンプルに設計" +"されており、単に読みやすい文字列表現を持った :class:`object` のサブクラスで" +"す。もし属性を辞書のように扱える方が良ければ、標準的な Python のイディオム :" +"func:`vars` を利用できます::" -#: ../../library/argparse.rst:1630 -msgid "" -">>> parser = argparse.ArgumentParser()\n" -">>> parser.add_argument('--foo')\n" -">>> args = parser.parse_args(['--foo', 'BAR'])\n" -">>> vars(args)\n" -"{'foo': 'BAR'}" -msgstr "" - -#: ../../library/argparse.rst:1636 +#: ../../library/argparse.rst:1594 msgid "" "It may also be useful to have an :class:`ArgumentParser` assign attributes " "to an already existing object, rather than a new :class:`Namespace` object. " @@ -2619,79 +1812,86 @@ msgstr "" "既存のオブジェクトに属性を設定する方が良い場合があります。これは " "``namespace=`` キーワード引数を指定することで可能です::" -#: ../../library/argparse.rst:1640 -msgid "" -">>> class C:\n" -"... pass\n" -"...\n" -">>> c = C()\n" -">>> parser = argparse.ArgumentParser()\n" -">>> parser.add_argument('--foo')\n" -">>> parser.parse_args(args=['--foo', 'BAR'], namespace=c)\n" -">>> c.foo\n" -"'BAR'" -msgstr "" - -#: ../../library/argparse.rst:1652 +#: ../../library/argparse.rst:1610 msgid "Other utilities" msgstr "その他のユーティリティ" -#: ../../library/argparse.rst:1655 +#: ../../library/argparse.rst:1613 msgid "Sub-commands" msgstr "サブコマンド" -#: ../../library/argparse.rst:1662 -msgid "" -"Many programs split up their functionality into a number of subcommands, for " -"example, the ``svn`` program can invoke subcommands like ``svn checkout``, " -"``svn update``, and ``svn commit``. Splitting up functionality this way can " -"be a particularly good idea when a program performs several different " -"functions which require different kinds of command-line arguments. :class:" -"`ArgumentParser` supports the creation of such subcommands with the :meth:`!" -"add_subparsers` method. The :meth:`!add_subparsers` method is normally " -"called with no arguments and returns a special action object. This object " -"has a single method, :meth:`~_SubParsersAction.add_parser`, which takes a " -"command name and any :class:`!ArgumentParser` constructor arguments, and " -"returns an :class:`!ArgumentParser` object that can be modified as usual." -msgstr "" - -#: ../../library/argparse.rst:1674 +#: ../../library/argparse.rst:1620 +msgid "" +"Many programs split up their functionality into a number of sub-commands, " +"for example, the ``svn`` program can invoke sub-commands like ``svn " +"checkout``, ``svn update``, and ``svn commit``. Splitting up functionality " +"this way can be a particularly good idea when a program performs several " +"different functions which require different kinds of command-line " +"arguments. :class:`ArgumentParser` supports the creation of such sub-" +"commands with the :meth:`add_subparsers` method. The :meth:`add_subparsers` " +"method is normally called with no arguments and returns a special action " +"object. This object has a single method, :meth:`~ArgumentParser." +"add_parser`, which takes a command name and any :class:`ArgumentParser` " +"constructor arguments, and returns an :class:`ArgumentParser` object that " +"can be modified as usual." +msgstr "" +"多くのプログラムは、その機能をサブコマンドへと分割します。 例えば ``svn`` プ" +"ログラムは ``svn checkout``, ``svn update``, ``svn commit`` などのサブコマン" +"ドを利用できます。 機能をサブコマンドに分割するのは、プログラムがいくつかの異" +"なった機能を持っていて、 それぞれが異なるコマンドライン引数を必要とする場合に" +"は良いアイデアです。 :class:`ArgumentParser` は :meth:`add_subparsers` メソッ" +"ドによりサブコマンドを サポートしています。 :meth:`add_subparsers` メソッドは" +"通常引数なしに呼び出され、 特殊なアクションオブジェクトを返します。このオブ" +"ジェクトには1つのメソッド :meth:`~ArgumentParser.add_parser` があり、コマンド" +"名と :class:`ArgumentParser` コンストラクターの任意の引数を受け取り、通常の方" +"法で操作できる :class:`ArgumentParser` オブジェクトを返します。" + +#: ../../library/argparse.rst:1632 msgid "Description of parameters:" msgstr "引数の説明:" -#: ../../library/argparse.rst:1676 +#: ../../library/argparse.rst:1634 msgid "" -"*title* - title for the sub-parser group in help output; by default " +"title - title for the sub-parser group in help output; by default " "\"subcommands\" if description is provided, otherwise uses title for " "positional arguments" msgstr "" +"title - ヘルプ出力でのサブパーサーグループのタイトルです。デフォルトは、" +"description が指定されている場合は \"subcommands\" に、指定されていない場合は" +"位置引数のタイトルになります" -#: ../../library/argparse.rst:1680 +#: ../../library/argparse.rst:1638 msgid "" -"*description* - description for the sub-parser group in help output, by " +"description - description for the sub-parser group in help output, by " "default ``None``" msgstr "" +"description - ヘルプ出力に表示されるサブパーサーグループの説明です。デフォル" +"トは ``None`` になります" -#: ../../library/argparse.rst:1683 +#: ../../library/argparse.rst:1641 msgid "" -"*prog* - usage information that will be displayed with sub-command help, by " +"prog - usage information that will be displayed with sub-command help, by " "default the name of the program and any positional arguments before the " "subparser argument" msgstr "" +"prog - サブコマンドのヘルプに表示される使用方法の説明です。デフォルトではプロ" +"グラム名と位置引数の後ろに、サブパーサーの引数が続きます" -#: ../../library/argparse.rst:1687 +#: ../../library/argparse.rst:1645 msgid "" -"*parser_class* - class which will be used to create sub-parser instances, by " -"default the class of the current parser (e.g. :class:`ArgumentParser`)" +"parser_class - class which will be used to create sub-parser instances, by " +"default the class of the current parser (e.g. ArgumentParser)" msgstr "" +"parser_class - サブパーサーのインスタンスを作成するときに使用されるクラスで" +"す。デフォルトでは現在のパーサーのクラス (例: ArgumentParser) になります" -#: ../../library/argparse.rst:1690 +#: ../../library/argparse.rst:1648 msgid "" "action_ - the basic type of action to be taken when this argument is " "encountered at the command line" msgstr "action_ - コマンドラインにこの引数があったときの基本のアクション。" -#: ../../library/argparse.rst:1693 +#: ../../library/argparse.rst:1651 msgid "" "dest_ - name of the attribute under which sub-command name will be stored; " "by default ``None`` and no value is stored" @@ -2699,7 +1899,7 @@ msgstr "" "dest_ - サブコマンド名を格納する属性の名前です。デフォルトは ``None`` で値は" "格納されません" -#: ../../library/argparse.rst:1696 +#: ../../library/argparse.rst:1654 msgid "" "required_ - Whether or not a subcommand must be provided, by default " "``False`` (added in 3.7)" @@ -2707,46 +1907,25 @@ msgstr "" "required_ - サブコマンドが必須であるかどうかを指定し、デフォルトは ``False`` " "です。(3.7 より追加)" -#: ../../library/argparse.rst:1699 +#: ../../library/argparse.rst:1657 msgid "help_ - help for sub-parser group in help output, by default ``None``" msgstr "" "help_ - ヘルプ出力に表示されるサブパーサーグループのヘルプです。デフォルトは " "``None`` です" -#: ../../library/argparse.rst:1701 +#: ../../library/argparse.rst:1659 msgid "" -"metavar_ - string presenting available subcommands in help; by default it is " -"``None`` and presents subcommands in form {cmd1, cmd2, ..}" +"metavar_ - string presenting available sub-commands in help; by default it " +"is ``None`` and presents sub-commands in form {cmd1, cmd2, ..}" msgstr "" +"metavar_ - 利用可能なサブコマンドをヘルプ内で表示するための文字列です。デフォ" +"ルトは ``None`` で、サブコマンドを {cmd1, cmd2, ..} のような形式で表します" -#: ../../library/argparse.rst:1704 +#: ../../library/argparse.rst:1662 msgid "Some example usage::" msgstr "いくつかの使用例::" -#: ../../library/argparse.rst:1706 -msgid "" -">>> # create the top-level parser\n" -">>> parser = argparse.ArgumentParser(prog='PROG')\n" -">>> parser.add_argument('--foo', action='http://github.com/store_true', help='foo help')\n" -">>> subparsers = parser.add_subparsers(help='subcommand help')\n" -">>>\n" -">>> # create the parser for the \"a\" command\n" -">>> parser_a = subparsers.add_parser('a', help='a help')\n" -">>> parser_a.add_argument('bar', type=int, help='bar help')\n" -">>>\n" -">>> # create the parser for the \"b\" command\n" -">>> parser_b = subparsers.add_parser('b', help='b help')\n" -">>> parser_b.add_argument('--baz', choices=('X', 'Y', 'Z'), help='baz " -"help')\n" -">>>\n" -">>> # parse some argument lists\n" -">>> parser.parse_args(['a', '12'])\n" -"Namespace(bar=12, foo=False)\n" -">>> parser.parse_args(['--foo', 'b', '--baz', 'Z'])\n" -"Namespace(baz='Z', foo=True)" -msgstr "" - -#: ../../library/argparse.rst:1725 +#: ../../library/argparse.rst:1683 msgid "" "Note that the object returned by :meth:`parse_args` will only contain " "attributes for the main parser and the subparser that was selected by the " @@ -2761,52 +1940,21 @@ msgstr "" "では、``a`` コマンドが指定されたときは ``foo``, ``bar`` 属性だけが存在し、" "``b`` コマンドが指定されたときは ``foo``, ``baz`` 属性だけが存在しています。" -#: ../../library/argparse.rst:1732 +#: ../../library/argparse.rst:1690 msgid "" "Similarly, when a help message is requested from a subparser, only the help " "for that particular parser will be printed. The help message will not " "include parent parser or sibling parser messages. (A help message for each " "subparser command, however, can be given by supplying the ``help=`` argument " -"to :meth:`~_SubParsersAction.add_parser` as above.)" +"to :meth:`add_parser` as above.)" msgstr "" "同じように、サブパーサーにヘルプメッセージが要求された場合は、そのパーサーに" "対するヘルプだけが表示されます。ヘルプメッセージには親パーサーや兄弟パーサー" "のヘルプメッセージを表示しません。 (ただし、各サブパーサーコマンドのヘルプ" -"メッセージは、上の例にもあるように :meth:`~_SubParsersAction.add_parser` の " -"``help=`` 引数によって指定できます)" - -#: ../../library/argparse.rst:1740 -msgid "" -">>> parser.parse_args(['--help'])\n" -"usage: PROG [-h] [--foo] {a,b} ...\n" -"\n" -"positional arguments:\n" -" {a,b} subcommand help\n" -" a a help\n" -" b b help\n" -"\n" -"options:\n" -" -h, --help show this help message and exit\n" -" --foo foo help\n" -"\n" -">>> parser.parse_args(['a', '--help'])\n" -"usage: PROG a [-h] bar\n" -"\n" -"positional arguments:\n" -" bar bar help\n" -"\n" -"options:\n" -" -h, --help show this help message and exit\n" -"\n" -">>> parser.parse_args(['b', '--help'])\n" -"usage: PROG b [-h] [--baz {X,Y,Z}]\n" -"\n" -"options:\n" -" -h, --help show this help message and exit\n" -" --baz {X,Y,Z} baz help" -msgstr "" - -#: ../../library/argparse.rst:1768 +"メッセージは、上の例にもあるように :meth:`add_parser` の ``help=`` 引数によっ" +"て指定できます)" + +#: ../../library/argparse.rst:1726 msgid "" "The :meth:`add_subparsers` method also supports ``title`` and " "``description`` keyword arguments. When either is present, the subparser's " @@ -2816,94 +1964,28 @@ msgstr "" "もサポートしています。どちらかが存在する場合、サブパーサーのコマンドはヘルプ" "出力でそれぞれのグループの中に表示されます。例えば::" -#: ../../library/argparse.rst:1772 -msgid "" -">>> parser = argparse.ArgumentParser()\n" -">>> subparsers = parser.add_subparsers(title='subcommands',\n" -"... description='valid subcommands',\n" -"... help='additional help')\n" -">>> subparsers.add_parser('foo')\n" -">>> subparsers.add_parser('bar')\n" -">>> parser.parse_args(['-h'])\n" -"usage: [-h] {foo,bar} ...\n" -"\n" -"options:\n" -" -h, --help show this help message and exit\n" -"\n" -"subcommands:\n" -" valid subcommands\n" -"\n" -" {foo,bar} additional help" -msgstr "" - -#: ../../library/argparse.rst:1789 +#: ../../library/argparse.rst:1747 msgid "" -"Furthermore, :meth:`~_SubParsersAction.add_parser` supports an additional " -"*aliases* argument, which allows multiple strings to refer to the same " -"subparser. This example, like ``svn``, aliases ``co`` as a shorthand for " -"``checkout``::" +"Furthermore, ``add_parser`` supports an additional ``aliases`` argument, " +"which allows multiple strings to refer to the same subparser. This example, " +"like ``svn``, aliases ``co`` as a shorthand for ``checkout``::" msgstr "" +"さらに、``add_parser`` は ``aliases`` 引数もサポートしており、同じサブパー" +"サーに対して複数の文字列で参照することもできます。以下の例では ``svn`` のよう" +"に ``checkout`` の短縮形として ``co`` を使用できるようにしています::" -#: ../../library/argparse.rst:1794 +#: ../../library/argparse.rst:1758 msgid "" -">>> parser = argparse.ArgumentParser()\n" -">>> subparsers = parser.add_subparsers()\n" -">>> checkout = subparsers.add_parser('checkout', aliases=['co'])\n" -">>> checkout.add_argument('foo')\n" -">>> parser.parse_args(['co', 'bar'])\n" -"Namespace(foo='bar')" -msgstr "" - -#: ../../library/argparse.rst:1801 -msgid "" -":meth:`~_SubParsersAction.add_parser` supports also an additional " -"*deprecated* argument, which allows to deprecate the subparser." -msgstr "" - -#: ../../library/argparse.rst:1815 -msgid "" -"One particularly effective way of handling subcommands is to combine the use " -"of the :meth:`add_subparsers` method with calls to :meth:`set_defaults` so " -"that each subparser knows which Python function it should execute. For " +"One particularly effective way of handling sub-commands is to combine the " +"use of the :meth:`add_subparsers` method with calls to :meth:`set_defaults` " +"so that each subparser knows which Python function it should execute. For " "example::" msgstr "" +"サブコマンドを扱う1つの便利な方法は :meth:`add_subparsers` メソッドと :meth:" +"`set_defaults` を組み合わせて、各サブパーサーにどの Python 関数を実行するかを" +"教えることです。例えば::" -#: ../../library/argparse.rst:1820 -msgid "" -">>> # subcommand functions\n" -">>> def foo(args):\n" -"... print(args.x * args.y)\n" -"...\n" -">>> def bar(args):\n" -"... print('((%s))' % args.z)\n" -"...\n" -">>> # create the top-level parser\n" -">>> parser = argparse.ArgumentParser()\n" -">>> subparsers = parser.add_subparsers(required=True)\n" -">>>\n" -">>> # create the parser for the \"foo\" command\n" -">>> parser_foo = subparsers.add_parser('foo')\n" -">>> parser_foo.add_argument('-x', type=int, default=1)\n" -">>> parser_foo.add_argument('y', type=float)\n" -">>> parser_foo.set_defaults(func=foo)\n" -">>>\n" -">>> # create the parser for the \"bar\" command\n" -">>> parser_bar = subparsers.add_parser('bar')\n" -">>> parser_bar.add_argument('z')\n" -">>> parser_bar.set_defaults(func=bar)\n" -">>>\n" -">>> # parse the args and call whatever function was selected\n" -">>> args = parser.parse_args('foo 1 -x 2'.split())\n" -">>> args.func(args)\n" -"2.0\n" -">>>\n" -">>> # parse the args and call whatever function was selected\n" -">>> args = parser.parse_args('bar XYZYX'.split())\n" -">>> args.func(args)\n" -"((XYZYX))" -msgstr "" - -#: ../../library/argparse.rst:1852 +#: ../../library/argparse.rst:1795 msgid "" "This way, you can let :meth:`parse_args` do the job of calling the " "appropriate function after argument parsing is complete. Associating " @@ -2918,33 +2000,15 @@ msgstr "" "ブパーサーの名前を確認する必要がある場合は、:meth:`add_subparsers` を呼び出す" "ときに ``dest`` キーワードを指定できます::" -#: ../../library/argparse.rst:1859 -msgid "" -">>> parser = argparse.ArgumentParser()\n" -">>> subparsers = parser.add_subparsers(dest='subparser_name')\n" -">>> subparser1 = subparsers.add_parser('1')\n" -">>> subparser1.add_argument('-x')\n" -">>> subparser2 = subparsers.add_parser('2')\n" -">>> subparser2.add_argument('y')\n" -">>> parser.parse_args(['2', 'frobble'])\n" -"Namespace(subparser_name='2', y='frobble')" -msgstr "" - -#: ../../library/argparse.rst:1868 -msgid "New *required* keyword-only parameter." -msgstr "" - -#: ../../library/argparse.rst:1871 -msgid "" -"Subparser's *prog* is no longer affected by a custom usage message in the " -"main parser." -msgstr "" +#: ../../library/argparse.rst:1811 +msgid "New *required* keyword argument." +msgstr "新しい *required* キーワード引数。" -#: ../../library/argparse.rst:1877 +#: ../../library/argparse.rst:1816 msgid "FileType objects" msgstr "FileType オブジェクト" -#: ../../library/argparse.rst:1881 +#: ../../library/argparse.rst:1820 msgid "" "The :class:`FileType` factory creates objects that can be passed to the type " "argument of :meth:`ArgumentParser.add_argument`. Arguments that have :class:" @@ -2958,117 +2022,55 @@ msgstr "" "ズ、エンコーディング、エラー処理でファイルとして開きます (詳細は :func:" "`open` 関数を参照してください。)::" -#: ../../library/argparse.rst:1887 -msgid "" -">>> parser = argparse.ArgumentParser()\n" -">>> parser.add_argument('--raw', type=argparse.FileType('wb', 0))\n" -">>> parser.add_argument('out', type=argparse.FileType('w', " -"encoding='UTF-8'))\n" -">>> parser.parse_args(['--raw', 'raw.dat', 'file.txt'])\n" -"Namespace(out=<_io.TextIOWrapper name='file.txt' mode='w' encoding='UTF-8'>, " -"raw=<_io.FileIO name='raw.dat' mode='wb'>)" -msgstr "" - -#: ../../library/argparse.rst:1893 +#: ../../library/argparse.rst:1832 msgid "" "FileType objects understand the pseudo-argument ``'-'`` and automatically " -"convert this into :data:`sys.stdin` for readable :class:`FileType` objects " -"and :data:`sys.stdout` for writable :class:`FileType` objects::" +"convert this into ``sys.stdin`` for readable :class:`FileType` objects and " +"``sys.stdout`` for writable :class:`FileType` objects::" msgstr "" "FileType オブジェクトは擬似引数 ``'-'`` を識別し、読み込み用の :class:" -"`FileType` であれば :data:`sys.stdin` を、書き込み用の :class:`FileType` であ" -"れば :data:`sys.stdout` に変換します::" +"`FileType` であれば ``sys.stdin`` を、書き込み用の :class:`FileType` であれ" +"ば ``sys.stdout`` に変換します::" -#: ../../library/argparse.rst:1897 -msgid "" -">>> parser = argparse.ArgumentParser()\n" -">>> parser.add_argument('infile', type=argparse.FileType('r'))\n" -">>> parser.parse_args(['-'])\n" -"Namespace(infile=<_io.TextIOWrapper name='' encoding='UTF-8'>)" -msgstr "" +#: ../../library/argparse.rst:1841 +msgid "The *encodings* and *errors* keyword arguments." +msgstr "*encoding* および *errors* キーワードが追加されました。" -#: ../../library/argparse.rst:1904 -msgid "" -"If one argument uses *FileType* and then a subsequent argument fails, an " -"error is reported but the file is not automatically closed. This can also " -"clobber the output files. In this case, it would be better to wait until " -"after the parser has run and then use the :keyword:`with`-statement to " -"manage the files." -msgstr "" - -#: ../../library/argparse.rst:1910 -msgid "Added the *encodings* and *errors* parameters." -msgstr "*encodings* と *errors* がパラメータに追加されました。" - -#: ../../library/argparse.rst:1917 +#: ../../library/argparse.rst:1846 msgid "Argument groups" msgstr "引数グループ" -#: ../../library/argparse.rst:1922 +#: ../../library/argparse.rst:1850 msgid "" "By default, :class:`ArgumentParser` groups command-line arguments into " -"\"positional arguments\" and \"options\" when displaying help messages. When " -"there is a better conceptual grouping of arguments than this default one, " -"appropriate groups can be created using the :meth:`!add_argument_group` " -"method::" +"\"positional arguments\" and \"optional arguments\" when displaying help " +"messages. When there is a better conceptual grouping of arguments than this " +"default one, appropriate groups can be created using the :meth:" +"`add_argument_group` method::" msgstr "" +"デフォルトでは、 :class:`ArgumentParser` はヘルプメッセージを表示するときに、" +"コマンドライン引数を \"位置引数\" と \"オプション引数\" にグループ化します。" +"このデフォルトの動作よりも良い引数のグループ化方法がある場合、 :meth:" +"`add_argument_group` メソッドで適切なグループを作成できます::" -#: ../../library/argparse.rst:1928 -msgid "" -">>> parser = argparse.ArgumentParser(prog='PROG', add_help=False)\n" -">>> group = parser.add_argument_group('group')\n" -">>> group.add_argument('--foo', help='foo help')\n" -">>> group.add_argument('bar', help='bar help')\n" -">>> parser.print_help()\n" -"usage: PROG [--foo FOO] bar\n" -"\n" -"group:\n" -" bar bar help\n" -" --foo FOO foo help" -msgstr "" - -#: ../../library/argparse.rst:1939 +#: ../../library/argparse.rst:1867 msgid "" "The :meth:`add_argument_group` method returns an argument group object which " "has an :meth:`~ArgumentParser.add_argument` method just like a regular :" "class:`ArgumentParser`. When an argument is added to the group, the parser " "treats it just like a normal argument, but displays the argument in a " -"separate group for help messages. The :meth:`!add_argument_group` method " +"separate group for help messages. The :meth:`add_argument_group` method " "accepts *title* and *description* arguments which can be used to customize " "this display::" msgstr "" +":meth:`add_argument_group` メソッドは、通常の :class:`ArgumentParser` と同じ" +"ような :meth:`~ArgumentParser.add_argument` メソッドを持つ引数グループオブ" +"ジェクトを返します。引数がグループに追加された時、パーサーはその引数を通常の" +"引数のように扱いますが、ヘルプメッセージではその引数を分離されたグループの中" +"に表示します。 :meth:`add_argument_group` メソッドには、この表示をカスタマイ" +"ズするための *title* と *description* 引数があります::" -#: ../../library/argparse.rst:1947 -msgid "" -">>> parser = argparse.ArgumentParser(prog='PROG', add_help=False)\n" -">>> group1 = parser.add_argument_group('group1', 'group1 description')\n" -">>> group1.add_argument('foo', help='foo help')\n" -">>> group2 = parser.add_argument_group('group2', 'group2 description')\n" -">>> group2.add_argument('--bar', help='bar help')\n" -">>> parser.print_help()\n" -"usage: PROG [--bar BAR] foo\n" -"\n" -"group1:\n" -" group1 description\n" -"\n" -" foo foo help\n" -"\n" -"group2:\n" -" group2 description\n" -"\n" -" --bar BAR bar help" -msgstr "" - -#: ../../library/argparse.rst:1965 -msgid "" -"The optional, keyword-only parameters argument_default_ and " -"conflict_handler_ allow for finer-grained control of the behavior of the " -"argument group. These parameters have the same meaning as in the :class:" -"`ArgumentParser` constructor, but apply specifically to the argument group " -"rather than the entire parser." -msgstr "" - -#: ../../library/argparse.rst:1970 +#: ../../library/argparse.rst:1893 msgid "" "Note that any arguments not in your user-defined groups will end up back in " "the usual \"positional arguments\" and \"optional arguments\" sections." @@ -3076,104 +2078,42 @@ msgstr "" "ユーザー定義グループにないすべての引数は通常の \"位置引数\" と \"オプション引" "数\" セクションに表示されます。" -#: ../../library/argparse.rst:1973 -msgid "" -"Calling :meth:`add_argument_group` on an argument group now raises an " -"exception. This nesting was never supported, often failed to work correctly, " -"and was unintentionally exposed through inheritance." -msgstr "" - -#: ../../library/argparse.rst:1978 -msgid "Passing prefix_chars_ to :meth:`add_argument_group` is now deprecated." -msgstr "" - -#: ../../library/argparse.rst:1984 +#: ../../library/argparse.rst:1898 msgid "Mutual exclusion" msgstr "相互排他" -#: ../../library/argparse.rst:1988 +#: ../../library/argparse.rst:1902 msgid "" -"Create a mutually exclusive group. :mod:`!argparse` will make sure that only " +"Create a mutually exclusive group. :mod:`argparse` will make sure that only " "one of the arguments in the mutually exclusive group was present on the " "command line::" msgstr "" +"相互排他グループを作ります。:mod:`argparse` は相互排他グループの中でただ1つの" +"引数のみが存在することを確認します::" -#: ../../library/argparse.rst:1992 -msgid "" -">>> parser = argparse.ArgumentParser(prog='PROG')\n" -">>> group = parser.add_mutually_exclusive_group()\n" -">>> group.add_argument('--foo', action='http://github.com/store_true')\n" -">>> group.add_argument('--bar', action='http://github.com/store_false')\n" -">>> parser.parse_args(['--foo'])\n" -"Namespace(bar=True, foo=True)\n" -">>> parser.parse_args(['--bar'])\n" -"Namespace(bar=False, foo=False)\n" -">>> parser.parse_args(['--foo', '--bar'])\n" -"usage: PROG [-h] [--foo | --bar]\n" -"PROG: error: argument --bar: not allowed with argument --foo" -msgstr "" - -#: ../../library/argparse.rst:2004 +#: ../../library/argparse.rst:1918 msgid "" "The :meth:`add_mutually_exclusive_group` method also accepts a *required* " "argument, to indicate that at least one of the mutually exclusive arguments " "is required::" msgstr "" ":meth:`add_mutually_exclusive_group` メソッドの引数 *required* に True 値を指" -"定すると、その相互排他引数のどれか1つを選ぶことが要求されます::" +"定すると、その相互排他引数のどれか 1つを選ぶことが要求さます::" -#: ../../library/argparse.rst:2008 -msgid "" -">>> parser = argparse.ArgumentParser(prog='PROG')\n" -">>> group = parser.add_mutually_exclusive_group(required=True)\n" -">>> group.add_argument('--foo', action='http://github.com/store_true')\n" -">>> group.add_argument('--bar', action='http://github.com/store_false')\n" -">>> parser.parse_args([])\n" -"usage: PROG [-h] (--foo | --bar)\n" -"PROG: error: one of the arguments --foo --bar is required" -msgstr "" - -#: ../../library/argparse.rst:2016 +#: ../../library/argparse.rst:1930 msgid "" "Note that currently mutually exclusive argument groups do not support the " "*title* and *description* arguments of :meth:`~ArgumentParser." -"add_argument_group`. However, a mutually exclusive group can be added to an " -"argument group that has a title and description. For example::" +"add_argument_group`." msgstr "" +"現在のところ、相互排他引数グループは :meth:`~ArgumentParser." +"add_argument_group` の *title* と *description* 引数をサポートしていません。" -#: ../../library/argparse.rst:2022 -msgid "" -">>> parser = argparse.ArgumentParser(prog='PROG')\n" -">>> group = parser.add_argument_group('Group title', 'Group description')\n" -">>> exclusive_group = group.add_mutually_exclusive_group(required=True)\n" -">>> exclusive_group.add_argument('--foo', help='foo help')\n" -">>> exclusive_group.add_argument('--bar', help='bar help')\n" -">>> parser.print_help()\n" -"usage: PROG [-h] (--foo FOO | --bar BAR)\n" -"\n" -"options:\n" -" -h, --help show this help message and exit\n" -"\n" -"Group title:\n" -" Group description\n" -"\n" -" --foo FOO foo help\n" -" --bar BAR bar help" -msgstr "" - -#: ../../library/argparse.rst:2039 -msgid "" -"Calling :meth:`add_argument_group` or :meth:`add_mutually_exclusive_group` " -"on a mutually exclusive group now raises an exception. This nesting was " -"never supported, often failed to work correctly, and was unintentionally " -"exposed through inheritance." -msgstr "" - -#: ../../library/argparse.rst:2047 +#: ../../library/argparse.rst:1936 msgid "Parser defaults" msgstr "パーサーのデフォルト値" -#: ../../library/argparse.rst:2051 +#: ../../library/argparse.rst:1940 msgid "" "Most of the time, the attributes of the object returned by :meth:" "`parse_args` will be fully determined by inspecting the command-line " @@ -3186,31 +2126,13 @@ msgstr "" "を使うと与えられたコマンドライン引数の内容によらず追加の属性を決定することが" "可能です::" -#: ../../library/argparse.rst:2057 -msgid "" -">>> parser = argparse.ArgumentParser()\n" -">>> parser.add_argument('foo', type=int)\n" -">>> parser.set_defaults(bar=42, baz='badger')\n" -">>> parser.parse_args(['736'])\n" -"Namespace(bar=42, baz='badger', foo=736)" -msgstr "" - -#: ../../library/argparse.rst:2063 +#: ../../library/argparse.rst:1952 msgid "" "Note that parser-level defaults always override argument-level defaults::" msgstr "" "パーサーレベルのデフォルト値は常に引数レベルのデフォルト値を上書きします::" -#: ../../library/argparse.rst:2065 -msgid "" -">>> parser = argparse.ArgumentParser()\n" -">>> parser.add_argument('--foo', default='bar')\n" -">>> parser.set_defaults(foo='spam')\n" -">>> parser.parse_args([])\n" -"Namespace(foo='spam')" -msgstr "" - -#: ../../library/argparse.rst:2071 +#: ../../library/argparse.rst:1960 msgid "" "Parser-level defaults can be particularly useful when working with multiple " "parsers. See the :meth:`~ArgumentParser.add_subparsers` method for an " @@ -3220,7 +2142,7 @@ msgstr "" "プの例については :meth:`~ArgumentParser.add_subparsers` メソッドを参照してく" "ださい。" -#: ../../library/argparse.rst:2077 +#: ../../library/argparse.rst:1966 msgid "" "Get the default value for a namespace attribute, as set by either :meth:" "`~ArgumentParser.add_argument` or by :meth:`~ArgumentParser.set_defaults`::" @@ -3228,19 +2150,11 @@ msgstr "" ":meth:`~ArgumentParser.add_argument` か :meth:`~ArgumentParser.set_defaults` " "によって指定された、 namespace の属性のデフォルト値を取得します::" -#: ../../library/argparse.rst:2081 -msgid "" -">>> parser = argparse.ArgumentParser()\n" -">>> parser.add_argument('--foo', default='badger')\n" -">>> parser.get_default('foo')\n" -"'badger'" -msgstr "" - -#: ../../library/argparse.rst:2088 +#: ../../library/argparse.rst:1977 msgid "Printing help" msgstr "ヘルプの表示" -#: ../../library/argparse.rst:2090 +#: ../../library/argparse.rst:1979 msgid "" "In most typical applications, :meth:`~ArgumentParser.parse_args` will take " "care of formatting and printing any usage or error messages. However, " @@ -3250,7 +2164,7 @@ msgstr "" "使用法やエラーメッセージのフォーマットと表示について面倒を見ます。しかし、い" "くつかのフォーマットメソッドが利用できます:" -#: ../../library/argparse.rst:2096 +#: ../../library/argparse.rst:1985 msgid "" "Print a brief description of how the :class:`ArgumentParser` should be " "invoked on the command line. If *file* is ``None``, :data:`sys.stdout` is " @@ -3259,7 +2173,7 @@ msgstr "" ":class:`ArgumentParser` がコマンドラインからどう実行されるべきかの短い説明を" "表示します。 *file* が ``None`` の時は、 :data:`sys.stdout` に出力されます。" -#: ../../library/argparse.rst:2102 +#: ../../library/argparse.rst:1991 msgid "" "Print a help message, including the program usage and information about the " "arguments registered with the :class:`ArgumentParser`. If *file* is " @@ -3269,7 +2183,7 @@ msgstr "" "含むヘルプメッセージを表示します。 *file* が ``None`` の時は、 :data:`sys." "stdout` に出力されます。" -#: ../../library/argparse.rst:2106 +#: ../../library/argparse.rst:1995 msgid "" "There are also variants of these methods that simply return a string instead " "of printing it:" @@ -3277,7 +2191,7 @@ msgstr "" "これらのメソッドの、表示する代わりにシンプルに文字列を返すバージョンもありま" "す:" -#: ../../library/argparse.rst:2111 +#: ../../library/argparse.rst:2000 msgid "" "Return a string containing a brief description of how the :class:" "`ArgumentParser` should be invoked on the command line." @@ -3285,7 +2199,7 @@ msgstr "" ":class:`ArgumentParser` がコマンドラインからどう実行されるべきかの短い説明を" "格納した文字列を返します。" -#: ../../library/argparse.rst:2116 +#: ../../library/argparse.rst:2005 msgid "" "Return a string containing a help message, including the program usage and " "information about the arguments registered with the :class:`ArgumentParser`." @@ -3293,52 +2207,44 @@ msgstr "" "プログラムの使用法と :class:`ArgumentParser` に登録された引数についての情報を" "含むヘルプメッセージを格納した文字列を返します。" -#: ../../library/argparse.rst:2121 +#: ../../library/argparse.rst:2010 msgid "Partial parsing" msgstr "部分解析" -#: ../../library/argparse.rst:2125 +#: ../../library/argparse.rst:2014 msgid "" -"Sometimes a script only needs to handle a specific set of command-line " -"arguments, leaving any unrecognized arguments for another script or program. " -"In these cases, the :meth:`~ArgumentParser.parse_known_args` method can be " -"useful." +"Sometimes a script may only parse a few of the command-line arguments, " +"passing the remaining arguments on to another script or program. In these " +"cases, the :meth:`~ArgumentParser.parse_known_args` method can be useful. " +"It works much like :meth:`~ArgumentParser.parse_args` except that it does " +"not produce an error when extra arguments are present. Instead, it returns " +"a two item tuple containing the populated namespace and the list of " +"remaining argument strings." msgstr "" +"ときどき、スクリプトがコマンドライン引数のいくつかだけを解析し、残りの引数は" +"別のスクリプトやプログラムに渡すことがあります。こういった場合、 :meth:" +"`~ArgumentParser.parse_known_args` メソッドが便利です。これは :meth:" +"`~ArgumentParser.parse_args` と同じように動作しますが、余分な引数が存在しても" +"エラーを生成しません。代わりに、評価された namespace オブジェクトと、残りの引" +"数文字列のリストからなる2要素タプルを返します。" -#: ../../library/argparse.rst:2130 -msgid "" -"This method works similarly to :meth:`~ArgumentParser.parse_args`, but it " -"does not raise an error for extra, unrecognized arguments. Instead, it " -"parses the known arguments and returns a two item tuple that contains the " -"populated namespace and the list of any unrecognized arguments." -msgstr "" - -#: ../../library/argparse.rst:2137 -msgid "" -">>> parser = argparse.ArgumentParser()\n" -">>> parser.add_argument('--foo', action='http://github.com/store_true')\n" -">>> parser.add_argument('bar')\n" -">>> parser.parse_known_args(['--foo', '--badger', 'BAR', 'spam'])\n" -"(Namespace(bar='BAR', foo=True), ['--badger', 'spam'])" -msgstr "" - -#: ../../library/argparse.rst:2144 +#: ../../library/argparse.rst:2030 msgid "" ":ref:`Prefix matching ` rules apply to :meth:" -"`~ArgumentParser.parse_known_args`. The parser may consume an option even if " -"it's just a prefix of one of its known options, instead of leaving it in the " -"remaining arguments list." +"`parse_known_args`. The parser may consume an option even if it's just a " +"prefix of one of its known options, instead of leaving it in the remaining " +"arguments list." msgstr "" ":ref:`先頭文字でのマッチング ` ルールは :meth:" -"`~ArgumentParser.parse_known_args` にも適用されます。たとえ既知のオプションの" -"先頭文字に過ぎない場合でも、パーサは引数リストに残さずに、オプションを受け取" -"る場合があります。" +"`parse_known_args` にも適用されます。たとえ既知のオプションの先頭文字に過ぎな" +"い場合でも、パーサは引数リストに残さずに、オプションを受け取る場合がありま" +"す。" -#: ../../library/argparse.rst:2151 +#: ../../library/argparse.rst:2037 msgid "Customizing file parsing" msgstr "ファイル解析のカスタマイズ" -#: ../../library/argparse.rst:2155 +#: ../../library/argparse.rst:2041 msgid "" "Arguments that are read from a file (see the *fromfile_prefix_chars* keyword " "argument to the :class:`ArgumentParser` constructor) are read one argument " @@ -3350,7 +2256,7 @@ msgstr "" "す。 :meth:`convert_arg_line_to_args` を変更することでこの動作をカスタマイズ" "できます。" -#: ../../library/argparse.rst:2160 +#: ../../library/argparse.rst:2046 msgid "" "This method takes a single argument *arg_line* which is a string read from " "the argument file. It returns a list of arguments parsed from this string. " @@ -3360,52 +2266,41 @@ msgstr "" "け取ります。そしてその文字列を解析した結果の引数のリストを返します。このメ" "ソッドはファイルから1行読みこむごとに、順番に呼ばれます。" -#: ../../library/argparse.rst:2164 +#: ../../library/argparse.rst:2050 msgid "" "A useful override of this method is one that treats each space-separated " "word as an argument. The following example demonstrates how to do this::" msgstr "" -"このメソッドをオーバーライドすると便利なこととして、スペースで区切られた行の" -"単語1つ1つを別々の引数として扱えます。次の例でその方法を示します::" +"このメソッドをオーバーライドすると便利なこととして、スペースで区切られた単語" +"を 1 つの引数として扱えます。次の例でその方法を示します::" -#: ../../library/argparse.rst:2167 -msgid "" -"class MyArgumentParser(argparse.ArgumentParser):\n" -" def convert_arg_line_to_args(self, arg_line):\n" -" return arg_line.split()" -msgstr "" - -#: ../../library/argparse.rst:2173 +#: ../../library/argparse.rst:2059 msgid "Exiting methods" msgstr "終了メソッド" -#: ../../library/argparse.rst:2177 +#: ../../library/argparse.rst:2063 msgid "" "This method terminates the program, exiting with the specified *status* and, " -"if given, it prints a *message* to :data:`sys.stderr` before that. The user " -"can override this method to handle these steps differently::" -msgstr "" - -#: ../../library/argparse.rst:2181 -msgid "" -"class ErrorCatchingArgumentParser(argparse.ArgumentParser):\n" -" def exit(self, status=0, message=None):\n" -" if status:\n" -" raise Exception(f'Exiting because of an error: {message}')\n" -" exit(status)" +"if given, it prints a *message* before that. The user can override this " +"method to handle these steps differently::" msgstr "" +"このメソッドはプログラムを、*status* のステータスで終了させ、指定された場合" +"は *message* を終了前に表示します。ユーザは、この振る舞いを違うものにするため" +"に、メソッドをオーバーライドすることができます。" -#: ../../library/argparse.rst:2189 +#: ../../library/argparse.rst:2075 msgid "" -"This method prints a usage message, including the *message*, to :data:`sys." -"stderr` and terminates the program with a status code of 2." +"This method prints a usage message including the *message* to the standard " +"error and terminates the program with a status code of 2." msgstr "" +"このメソッドは *message* を含む使用法メッセージを標準エラーに表示して、終了ス" +"テータス 2 でプログラムを終了します。" -#: ../../library/argparse.rst:2194 +#: ../../library/argparse.rst:2080 msgid "Intermixed parsing" msgstr "混在した引数の解析" -#: ../../library/argparse.rst:2199 +#: ../../library/argparse.rst:2085 msgid "" "A number of Unix commands allow the user to intermix optional arguments with " "positional arguments. The :meth:`~ArgumentParser.parse_intermixed_args` " @@ -3417,15 +2312,19 @@ msgstr "" "parse_known_intermixed_args` メソッドは、このような方法での解析をサポートして" "います。" -#: ../../library/argparse.rst:2204 +#: ../../library/argparse.rst:2090 msgid "" -"These parsers do not support all the :mod:`!argparse` features, and will " -"raise exceptions if unsupported features are used. In particular, " -"subparsers, and mutually exclusive groups that include both optionals and " -"positionals are not supported." +"These parsers do not support all the argparse features, and will raise " +"exceptions if unsupported features are used. In particular, subparsers, " +"``argparse.REMAINDER``, and mutually exclusive groups that include both " +"optionals and positionals are not supported." msgstr "" +"このパーサーは、argparse のすべての機能をサポートしておらず、対応しない機能が" +"使われた場合、例外を送出します。特に、サブパーサーや ``argparse.REMAINDER``、" +"位置引数とオプション引数を両方含むような相互排他的なグループは、サポートされ" +"ていません。" -#: ../../library/argparse.rst:2209 +#: ../../library/argparse.rst:2095 msgid "" "The following example shows the difference between :meth:`~ArgumentParser." "parse_known_args` and :meth:`~ArgumentParser.parse_intermixed_args`: the " @@ -3436,19 +2335,7 @@ msgstr "" "parse_intermixed_args` の違いを表しています: 前者は ``['2', '3']`` を、解析さ" "れない引数として返し、後者は全ての位置引数を ``rest`` に入れて返しています::" -#: ../../library/argparse.rst:2215 -msgid "" -">>> parser = argparse.ArgumentParser()\n" -">>> parser.add_argument('--foo')\n" -">>> parser.add_argument('cmd')\n" -">>> parser.add_argument('rest', nargs='*', type=int)\n" -">>> parser.parse_known_args('doit 1 --foo bar 2 3'.split())\n" -"(Namespace(cmd='doit', foo='bar', rest=[1]), ['2', '3'])\n" -">>> parser.parse_intermixed_args('doit 1 --foo bar 2 3'.split())\n" -"Namespace(cmd='doit', foo='bar', rest=[1, 2, 3])" -msgstr "" - -#: ../../library/argparse.rst:2224 +#: ../../library/argparse.rst:2110 msgid "" ":meth:`~ArgumentParser.parse_known_intermixed_args` returns a two item tuple " "containing the populated namespace and the list of remaining argument " @@ -3460,87 +2347,136 @@ msgstr "" ":meth:`~ArgumentParser.parse_intermixed_args` は、解析されない引数が残された" "場合にはエラーを送出します。" -#: ../../library/argparse.rst:2233 -msgid "Registering custom types or actions" -msgstr "" +#: ../../library/argparse.rst:2120 +msgid "Upgrading optparse code" +msgstr "optparse からのアップグレード" -#: ../../library/argparse.rst:2237 +#: ../../library/argparse.rst:2122 msgid "" -"Sometimes it's desirable to use a custom string in error messages to provide " -"more user-friendly output. In these cases, :meth:`!register` can be used to " -"register custom actions or types with a parser and allow you to reference " -"the type by their registered name instead of their callable name." +"Originally, the :mod:`argparse` module had attempted to maintain " +"compatibility with :mod:`optparse`. However, :mod:`optparse` was difficult " +"to extend transparently, particularly with the changes required to support " +"the new ``nargs=`` specifiers and better usage messages. When most " +"everything in :mod:`optparse` had either been copy-pasted over or monkey-" +"patched, it no longer seemed practical to try to maintain the backwards " +"compatibility." msgstr "" +"もともと、:mod:`argparse` モジュールは :mod:`optparse` モジュールとの互換性を" +"保って開発しようと試みられました。しかし、特に新しい ``nargs=`` 指定子とより" +"良い使用法メッセージのために必要な変更のために、:mod:`optparse` を透過的に拡" +"張することは難しかったのです。:mod:`optparse` のほとんどすべてがコピーアンド" +"ペーストされたりモンキーパッチを当てられたりしたとき、もはや後方互換性を保と" +"うとすることは現実的ではありませんでした。" -#: ../../library/argparse.rst:2242 +#: ../../library/argparse.rst:2129 msgid "" -"The :meth:`!register` method accepts three arguments - a *registry_name*, " -"specifying the internal registry where the object will be stored (e.g., " -"``action``, ``type``), *value*, which is the key under which the object will " -"be registered, and object, the callable to be registered." +"The :mod:`argparse` module improves on the standard library :mod:`optparse` " +"module in a number of ways including:" msgstr "" +":mod:`argparse` モジュールは標準ライブラリ :mod:`optparse` モジュールを、以下" +"を含むたくさんの方法で改善しています:" -#: ../../library/argparse.rst:2247 -msgid "" -"The following example shows how to register a custom type with a parser::" -msgstr "" +#: ../../library/argparse.rst:2132 +msgid "Handling positional arguments." +msgstr "位置引数を扱う" -#: ../../library/argparse.rst:2249 -msgid "" -">>> import argparse\n" -">>> parser = argparse.ArgumentParser()\n" -">>> parser.register('type', 'hexadecimal integer', lambda s: int(s, 16))\n" -">>> parser.add_argument('--foo', type='hexadecimal integer')\n" -"_StoreAction(option_strings=['--foo'], dest='foo', nargs=None, const=None, " -"default=None, type='hexadecimal integer', choices=None, required=False, " -"help=None, metavar=None, deprecated=False)\n" -">>> parser.parse_args(['--foo', '0xFA'])\n" -"Namespace(foo=250)\n" -">>> parser.parse_args(['--foo', '1.2'])\n" -"usage: PROG [-h] [--foo FOO]\n" -"PROG: error: argument --foo: invalid 'hexadecimal integer' value: '1.2'" +#: ../../library/argparse.rst:2133 +msgid "Supporting sub-commands." +msgstr "サブコマンドのサポート" + +#: ../../library/argparse.rst:2134 +msgid "Allowing alternative option prefixes like ``+`` and ``/``." +msgstr "``+``, ``/`` のような代替オプションプレフィクスを許容する" + +#: ../../library/argparse.rst:2135 +msgid "Handling zero-or-more and one-or-more style arguments." +msgstr "zero-or-more スタイル、one-or-more スタイルの引数を扱う" + +#: ../../library/argparse.rst:2136 +msgid "Producing more informative usage messages." +msgstr "より有益な使用方法メッセージの生成" + +#: ../../library/argparse.rst:2137 +msgid "Providing a much simpler interface for custom ``type`` and ``action``." msgstr "" +"カスタム ``type``, カスタム ``action`` のために遥かに簡単なインターフェイスを" +"提供する" -#: ../../library/argparse.rst:2261 -msgid "Exceptions" -msgstr "例外" +#: ../../library/argparse.rst:2139 +msgid "A partial upgrade path from :mod:`optparse` to :mod:`argparse`:" +msgstr ":mod:`optparse` から :mod:`argparse` への現実的なアップグレードパス:" -#: ../../library/argparse.rst:2265 -msgid "An error from creating or using an argument (optional or positional)." -msgstr "引数 (オプション引数または位置引数) の生成時または利用時のエラーです。" +#: ../../library/argparse.rst:2141 +msgid "" +"Replace all :meth:`optparse.OptionParser.add_option` calls with :meth:" +"`ArgumentParser.add_argument` calls." +msgstr "" +"すべての :meth:`optparse.OptionParser.add_option` の呼び出しを、:meth:" +"`ArgumentParser.add_argument` の呼び出しに置き換える。" -#: ../../library/argparse.rst:2267 +#: ../../library/argparse.rst:2144 msgid "" -"The string value of this exception is the message, augmented with " -"information about the argument that caused it." +"Replace ``(options, args) = parser.parse_args()`` with ``args = parser." +"parse_args()`` and add additional :meth:`ArgumentParser.add_argument` calls " +"for the positional arguments. Keep in mind that what was previously called " +"``options``, now in the :mod:`argparse` context is called ``args``." msgstr "" -"この例外の文字列表現は、エラーの原因となった引数についての情報を補足するメッ" -"セージです。" +"``(options, args) = parser.parse_args()`` を ``args = parser.parse_args()`` " +"に置き換え、位置引数のために必要に応じて :meth:`ArgumentParser.add_argument` " +"の呼び出しを追加する。これまで ``options`` と呼ばれていたものが、:mod:" +"`argparse` では ``args`` と呼ばれていることに留意してください。" -#: ../../library/argparse.rst:2272 +#: ../../library/argparse.rst:2149 msgid "" -"Raised when something goes wrong converting a command line string to a type." +"Replace :meth:`optparse.OptionParser.disable_interspersed_args` by using :" +"meth:`~ArgumentParser.parse_intermixed_args` instead of :meth:" +"`~ArgumentParser.parse_args`." msgstr "" -"コマンドラインの文字列を、指定された型に変換するのに失敗した時に送出されま" -"す。" +":meth:`optparse.OptionParser.disable_interspersed_args` を、:meth:" +"`~ArgumentParser.parse_args` ではなく :meth:`~ArgumentParser." +"parse_intermixed_args` で置き換える。" -#: ../../library/argparse.rst:2276 -msgid "Guides and Tutorials" -msgstr "ガイドとチュートリアル" +#: ../../library/argparse.rst:2153 +msgid "" +"Replace callback actions and the ``callback_*`` keyword arguments with " +"``type`` or ``action`` arguments." +msgstr "" +"コールバック・アクションと ``callback_*`` キーワード引数を ``type`` や " +"``action`` 引数に置き換える。" -#: ../../library/argparse.rst:910 -msgid "? (question mark)" -msgstr "? (クエスチョンマーク)" +#: ../../library/argparse.rst:2156 +msgid "" +"Replace string names for ``type`` keyword arguments with the corresponding " +"type objects (e.g. int, float, complex, etc)." +msgstr "" +"``type`` キーワード引数に渡していた文字列の名前を、それに応じたオブジェクト " +"(例: int, float, complex, ...) に置き換える。" -#: ../../library/argparse.rst:910 ../../library/argparse.rst:942 -#: ../../library/argparse.rst:956 -msgid "in argparse module" -msgstr "argparse モジュール内" +#: ../../library/argparse.rst:2159 +msgid "" +"Replace :class:`optparse.Values` with :class:`Namespace` and :exc:`optparse." +"OptionError` and :exc:`optparse.OptionValueError` with :exc:`ArgumentError`." +msgstr "" +":class:`optparse.Values` を :class:`Namespace` に置き換え、:exc:`optparse." +"OptionError` と :exc:`optparse.OptionValueError` を :exc:`ArgumentError` に置" +"き換える。" -#: ../../library/argparse.rst:942 -msgid "* (asterisk)" -msgstr "* (アスタリスク)" +#: ../../library/argparse.rst:2163 +msgid "" +"Replace strings with implicit arguments such as ``%default`` or ``%prog`` " +"with the standard Python syntax to use dictionaries to format strings, that " +"is, ``%(default)s`` and ``%(prog)s``." +msgstr "" +"``%default`` や ``%prog`` などの暗黙の引数を含む文字列を、``%(default)s`` や " +"``%(prog)s`` などの、通常の Python で辞書を使う場合のフォーマット文字列に置き" +"換える。" -#: ../../library/argparse.rst:956 -msgid "+ (plus)" -msgstr "+ (プラス記号)" +#: ../../library/argparse.rst:2167 +msgid "" +"Replace the OptionParser constructor ``version`` argument with a call to " +"``parser.add_argument('--version', action='http://github.com/version', version='')``." +msgstr "" +"OptionParser のコンストラクターの ``version`` 引数を、``parser." +"add_argument('--version', action='http://github.com/version', version='')`` に置き" +"換える" diff --git a/library/array.po b/library/array.po index 3c5a4239e..66fb4c15d 100644 --- a/library/array.po +++ b/library/array.po @@ -1,45 +1,53 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: +# Masato HASHIMOTO , 2017 +# Shun Sakurai, 2017 +# Nozomu Kaneko , 2017 +# 秘湯 , 2017 +# Arihiro TAKASE, 2017 +# Inada Naoki , 2017 +# tomo, 2019 +# mollinaca, 2020 # Takanori Suzuki , 2021 -# mollinaca, 2021 -# Arihiro TAKASE, 2023 -# Inada Naoki , 2023 -# 石井明久, 2024 -# tomo, 2024 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-13 14:21+0000\n" -"PO-Revision-Date: 2021-06-28 00:54+0000\n" -"Last-Translator: tomo, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-04-27 06:12+0000\n" +"PO-Revision-Date: 2017-02-16 17:48+0000\n" +"Last-Translator: Takanori Suzuki , 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/array.rst:2 -msgid ":mod:`!array` --- Efficient arrays of numeric values" -msgstr ":mod:`!array` --- 効率的な数値配列" +msgid ":mod:`array` --- Efficient arrays of numeric values" +msgstr ":mod:`array` --- 効率のよい数値アレイ" #: ../../library/array.rst:11 msgid "" "This module defines an object type which can compactly represent an array of " -"basic values: characters, integers, floating-point numbers. Arrays are " +"basic values: characters, integers, floating point numbers. Arrays are " "sequence types and behave very much like lists, except that the type of " "objects stored in them is constrained. The type is specified at object " "creation time by using a :dfn:`type code`, which is a single character. The " "following type codes are defined:" msgstr "" +"このモジュールでは、基本的な値 (文字、整数、浮動小数点数) のアレイ (array、配" +"列) をコンパクトに表現できるオブジェクト型を定義しています。アレイはシーケン" +"ス (sequence) 型であり、中に入れるオブジェクトの型に制限があることを除けば、" +"リストとまったく同じように振る舞います。オブジェクト生成時に一文字の :dfn:`型" +"コード` を用いて型を指定します。次の型コードが定義されています:" #: ../../library/array.rst:19 msgid "Type code" @@ -70,10 +78,10 @@ msgid "signed char" msgstr "signed char" #: ../../library/array.rst:21 ../../library/array.rst:23 -#: ../../library/array.rst:29 ../../library/array.rst:31 -#: ../../library/array.rst:33 ../../library/array.rst:35 -#: ../../library/array.rst:37 ../../library/array.rst:39 -#: ../../library/array.rst:41 ../../library/array.rst:43 +#: ../../library/array.rst:27 ../../library/array.rst:29 +#: ../../library/array.rst:31 ../../library/array.rst:33 +#: ../../library/array.rst:35 ../../library/array.rst:37 +#: ../../library/array.rst:39 ../../library/array.rst:41 msgid "int" msgstr "int" @@ -97,13 +105,13 @@ msgstr "``'u'``" msgid "wchar_t" msgstr "wchar_t" -#: ../../library/array.rst:25 ../../library/array.rst:27 +#: ../../library/array.rst:25 msgid "Unicode character" msgstr "Unicode文字(unicode型)" -#: ../../library/array.rst:25 ../../library/array.rst:29 -#: ../../library/array.rst:31 ../../library/array.rst:33 -#: ../../library/array.rst:35 +#: ../../library/array.rst:25 ../../library/array.rst:27 +#: ../../library/array.rst:29 ../../library/array.rst:31 +#: ../../library/array.rst:33 msgid "2" msgstr "2" @@ -112,161 +120,158 @@ msgid "\\(1)" msgstr "\\(1)" #: ../../library/array.rst:27 -msgid "``'w'``" -msgstr "``'w'``" - -#: ../../library/array.rst:27 -msgid "Py_UCS4" -msgstr "" - -#: ../../library/array.rst:27 ../../library/array.rst:37 -#: ../../library/array.rst:39 ../../library/array.rst:45 -msgid "4" -msgstr "4" - -#: ../../library/array.rst:29 msgid "``'h'``" msgstr "``'h'``" -#: ../../library/array.rst:29 +#: ../../library/array.rst:27 msgid "signed short" msgstr "signed short" -#: ../../library/array.rst:31 +#: ../../library/array.rst:29 msgid "``'H'``" msgstr "``'H'``" -#: ../../library/array.rst:31 +#: ../../library/array.rst:29 msgid "unsigned short" msgstr "unsigned short" -#: ../../library/array.rst:33 +#: ../../library/array.rst:31 msgid "``'i'``" msgstr "``'i'``" -#: ../../library/array.rst:33 +#: ../../library/array.rst:31 msgid "signed int" msgstr "signed int" -#: ../../library/array.rst:35 +#: ../../library/array.rst:33 msgid "``'I'``" msgstr "``'I'``" -#: ../../library/array.rst:35 +#: ../../library/array.rst:33 msgid "unsigned int" msgstr "unsigned int" -#: ../../library/array.rst:37 +#: ../../library/array.rst:35 msgid "``'l'``" msgstr "``'l'``" -#: ../../library/array.rst:37 +#: ../../library/array.rst:35 msgid "signed long" msgstr "signed long" -#: ../../library/array.rst:39 +#: ../../library/array.rst:35 ../../library/array.rst:37 +#: ../../library/array.rst:43 +msgid "4" +msgstr "4" + +#: ../../library/array.rst:37 msgid "``'L'``" msgstr "``'L'``" -#: ../../library/array.rst:39 +#: ../../library/array.rst:37 msgid "unsigned long" msgstr "unsigned long" -#: ../../library/array.rst:41 +#: ../../library/array.rst:39 msgid "``'q'``" msgstr "``'q'``" -#: ../../library/array.rst:41 +#: ../../library/array.rst:39 msgid "signed long long" msgstr "signed long long" -#: ../../library/array.rst:41 ../../library/array.rst:43 -#: ../../library/array.rst:47 +#: ../../library/array.rst:39 ../../library/array.rst:41 +#: ../../library/array.rst:45 msgid "8" msgstr "8" -#: ../../library/array.rst:43 +#: ../../library/array.rst:41 msgid "``'Q'``" msgstr "``'Q'``" -#: ../../library/array.rst:43 +#: ../../library/array.rst:41 msgid "unsigned long long" msgstr "unsigned long long" -#: ../../library/array.rst:45 +#: ../../library/array.rst:43 msgid "``'f'``" msgstr "``'f'``" -#: ../../library/array.rst:45 ../../library/array.rst:47 +#: ../../library/array.rst:43 ../../library/array.rst:45 msgid "float" msgstr "浮動小数点数" -#: ../../library/array.rst:47 +#: ../../library/array.rst:45 msgid "``'d'``" msgstr "``'d'``" -#: ../../library/array.rst:47 +#: ../../library/array.rst:45 msgid "double" msgstr "double" -#: ../../library/array.rst:50 +#: ../../library/array.rst:48 msgid "Notes:" msgstr "注釈:" -#: ../../library/array.rst:53 +#: ../../library/array.rst:51 msgid "It can be 16 bits or 32 bits depending on the platform." msgstr "" -#: ../../library/array.rst:55 +#: ../../library/array.rst:53 msgid "" -"``array('u')`` now uses :c:type:`wchar_t` as C type instead of deprecated " -"``Py_UNICODE``. This change doesn't affect its behavior because " -"``Py_UNICODE`` is alias of :c:type:`wchar_t` since Python 3.3." -msgstr "" - -#: ../../library/array.rst:60 -msgid "Please migrate to ``'w'`` typecode." +"``array('u')`` now uses ``wchar_t`` as C type instead of deprecated " +"``Py_UNICODE``. This change doesn't affect to its behavior because " +"``Py_UNICODE`` is alias of ``wchar_t`` since Python 3.3." msgstr "" -#: ../../library/array.rst:64 +#: ../../library/array.rst:61 msgid "" "The actual representation of values is determined by the machine " "architecture (strictly speaking, by the C implementation). The actual size " -"can be accessed through the :attr:`array.itemsize` attribute." +"can be accessed through the :attr:`itemsize` attribute." msgstr "" "値の実際の表現はマシンアーキテクチャ (厳密に言うとCの実装) によって決まりま" -"す。値の実際のサイズは :attr:`array.itemsize` 属性から得られます。" - -#: ../../library/array.rst:68 -msgid "The module defines the following item:" -msgstr "このモジュールは以下の項目を定義しています:" +"す。値の実際のサイズは :attr:`itemsize` 属性から得られます。" -#: ../../library/array.rst:73 -msgid "A string with all available type codes." -msgstr "すべての利用可能なタイプコードを含む文字列" - -#: ../../library/array.rst:76 +#: ../../library/array.rst:65 msgid "The module defines the following type:" msgstr "このモジュールでは次の型を定義しています:" -#: ../../library/array.rst:81 +#: ../../library/array.rst:70 msgid "" "A new array whose items are restricted by *typecode*, and initialized from " -"the optional *initializer* value, which must be a :class:`bytes` or :class:" -"`bytearray` object, a Unicode string, or iterable over elements of the " -"appropriate type." +"the optional *initializer* value, which must be a list, a :term:`bytes-like " +"object`, or iterable over elements of the appropriate type." msgstr "" +"要素のデータ型が *typecode* に限定される新しいアレイで、 オプションの値 " +"*initializer* を渡すと初期値になりますが、 リスト、 :term:`bytes-like " +"object` または適当な型のイテレーション可能オブジェクトでなければなりません。" -#: ../../library/array.rst:86 +#: ../../library/array.rst:75 msgid "" -"If given a :class:`bytes` or :class:`bytearray` object, the initializer is " -"passed to the new array's :meth:`frombytes` method; if given a Unicode " -"string, the initializer is passed to the :meth:`fromunicode` method; " -"otherwise, the initializer's iterator is passed to the :meth:`extend` method " -"to add initial items to the array." +"If given a list or string, the initializer is passed to the new array's :" +"meth:`fromlist`, :meth:`frombytes`, or :meth:`fromunicode` method (see " +"below) to add initial items to the array. Otherwise, the iterable " +"initializer is passed to the :meth:`extend` method." msgstr "" +"リストか文字列を渡した場合、initializer は新たに作成されたアレイの :meth:" +"`fromlist` 、 :meth:`frombytes` あるいは :meth:`fromunicode` メソッド (以下を" +"参照) に渡され、アレイに初期項目を追加します。それ以外の場合には、イテラブル" +"の *initializer* は :meth:`extend` メソッドに渡されます。" -#: ../../library/array.rst:93 +#: ../../library/array.rst:80 +msgid "" +"Raises an :ref:`auditing event ` ``array.__new__`` with arguments " +"``typecode``, ``initializer``." +msgstr "" +"引数 ``typecode``, ``initializer`` 付きで :ref:`監査イベント ` " +"``array.__new__`` を送出します。" + +#: ../../library/array.rst:84 +msgid "A string with all available type codes." +msgstr "すべての利用可能なタイプコードを含む文字列" + +#: ../../library/array.rst:86 msgid "" "Array objects support the ordinary sequence operations of indexing, slicing, " "concatenation, and multiplication. When using slice assignment, the " @@ -282,46 +287,42 @@ msgstr "" "ターフェースを実装しており、 :term:`bytes-like objects ` " "をサポートしている場所ならどこでも利用できます。" -#: ../../library/array.rst:99 -msgid "" -"Raises an :ref:`auditing event ` ``array.__new__`` with arguments " -"``typecode``, ``initializer``." -msgstr "" -"引数 ``typecode``, ``initializer`` 付きで :ref:`監査イベント ` " -"``array.__new__`` を送出します。" +#: ../../library/array.rst:92 +msgid "The following data items and methods are also supported:" +msgstr "次のデータ要素やメソッドもサポートされています:" -#: ../../library/array.rst:104 +#: ../../library/array.rst:96 msgid "The typecode character used to create the array." msgstr "アレイを作るときに使う型コード文字です。" -#: ../../library/array.rst:109 +#: ../../library/array.rst:101 msgid "The length in bytes of one array item in the internal representation." msgstr "アレイの要素 1 つの内部表現に使われるバイト長です。" -#: ../../library/array.rst:114 +#: ../../library/array.rst:106 msgid "Append a new item with value *x* to the end of the array." msgstr "値 *x* の新たな要素をアレイの末尾に追加します。" -#: ../../library/array.rst:119 +#: ../../library/array.rst:111 msgid "" "Return a tuple ``(address, length)`` giving the current memory address and " "the length in elements of the buffer used to hold array's contents. The " "size of the memory buffer in bytes can be computed as ``array.buffer_info()" "[1] * array.itemsize``. This is occasionally useful when working with low-" "level (and inherently unsafe) I/O interfaces that require memory addresses, " -"such as certain :c:func:`!ioctl` operations. The returned numbers are valid " +"such as certain :c:func:`ioctl` operations. The returned numbers are valid " "as long as the array exists and no length-changing operations are applied to " "it." msgstr "" "アレイの内容を記憶するために使っているバッファの、現在のメモリアドレスと要素" "数の入ったタプル ``(address, length)`` を返します。バイト単位で表したメモリ" "バッファの大きさは ``array.buffer_info()[1] * array.itemsize`` で計算できま" -"す。例えば :c:func:`!ioctl` 操作のような、メモリアドレスを必要とする低レベル" +"す。例えば :c:func:`ioctl` 操作のような、メモリアドレスを必要とする低レベル" "な (そして、本質的に危険な) I/Oインターフェースを使って作業する場合に、ときど" "き便利です。アレイ自体が存在し、長さを変えるような演算を適用しない限り、有効" "な値を返します。" -#: ../../library/array.rst:129 +#: ../../library/array.rst:121 msgid "" "When using array objects from code written in C or C++ (the only way to " "effectively make use of this information), it makes more sense to use the " @@ -335,7 +336,7 @@ msgstr "" "方互換性のために保守されており、新しいコードでの使用は避けるべきです。バッ" "ファインターフェースの説明は :ref:`bufferobjects` にあります。" -#: ../../library/array.rst:138 +#: ../../library/array.rst:130 msgid "" "\"Byteswap\" all items of the array. This is only supported for values " "which are 1, 2, 4, or 8 bytes in size; for other types of values, :exc:" @@ -348,11 +349,11 @@ msgstr "" "します。異なるバイトオーダを使うマシンで書かれたファイルからデータを読み込む" "ときに役に立ちます。" -#: ../../library/array.rst:146 +#: ../../library/array.rst:138 msgid "Return the number of occurrences of *x* in the array." msgstr "シーケンス中の *x* の出現回数を返します。" -#: ../../library/array.rst:151 +#: ../../library/array.rst:143 msgid "" "Append items from *iterable* to the end of the array. If *iterable* is " "another array, it must have *exactly* the same type code; if not, :exc:" @@ -365,20 +366,22 @@ msgstr "" "ない場合、アレイに値を追加できるような正しい型の要素からなるイテレーション可" "能オブジェクトでなければなりません。" -#: ../../library/array.rst:159 +#: ../../library/array.rst:151 msgid "" -"Appends items from the :term:`bytes-like object`, interpreting its content " -"as an array of machine values (as if it had been read from a file using the :" -"meth:`fromfile` method)." +"Appends items from the string, interpreting the string as an array of " +"machine values (as if it had been read from a file using the :meth:" +"`fromfile` method)." msgstr "" +"文字列から要素を追加します。文字列は、 (ファイルから :meth:`fromfile` メソッ" +"ドを使って値を読み込んだときのように) マシンのデータ形式で表された値の配列と" +"して解釈されます。" -#: ../../library/array.rst:163 -msgid ":meth:`!fromstring` is renamed to :meth:`frombytes` for clarity." +#: ../../library/array.rst:154 +msgid ":meth:`fromstring` is renamed to :meth:`frombytes` for clarity." msgstr "" -"明確化のため :meth:`!fromstring` の名前が :meth:`frombytes` に変更されまし" -"た。" +"明確化のため :meth:`fromstring` の名前が :meth:`frombytes` に変更されました。" -#: ../../library/array.rst:169 +#: ../../library/array.rst:160 msgid "" "Read *n* items (as machine values) from the :term:`file object` *f* and " "append them to the end of the array. If less than *n* items are available, :" @@ -390,7 +393,7 @@ msgstr "" "素しか読めなかった場合は :exc:`EOFError` を送出しますが、それまでに読み出せた" "値はアレイに追加されます。" -#: ../../library/array.rst:177 +#: ../../library/array.rst:168 msgid "" "Append items from the list. This is equivalent to ``for x in list: a." "append(x)`` except that if there is a type error, the array is unchanged." @@ -398,27 +401,25 @@ msgstr "" "リストから要素を追加します。型に関するエラーが発生した場合にアレイが変更され" "ないことを除き、 ``for x in list: a.append(x)`` と同じです。" -#: ../../library/array.rst:183 +#: ../../library/array.rst:174 msgid "" -"Extends this array with data from the given Unicode string. The array must " -"have type code ``'u'`` or ``'w'``; otherwise a :exc:`ValueError` is raised. " -"Use ``array.frombytes(unicodestring.encode(enc))`` to append Unicode data to " -"an array of some other type." +"Extends this array with data from the given unicode string. The array must " +"be a type ``'u'`` array; otherwise a :exc:`ValueError` is raised. Use " +"``array.frombytes(unicodestring.encode(enc))`` to append Unicode data to an " +"array of some other type." msgstr "" +"指定した Unicode 文字列のデータを使ってアレイを拡張します。アレイの型コード" +"は ``'u'`` でなければなりません。それ以外の場合には、 :exc:`ValueError` を送" +"出します。他の型のアレイに Unicode 型のデータを追加するには、 ``array." +"frombytes(unicodestring.encode(enc))`` を使ってください。" -#: ../../library/array.rst:191 +#: ../../library/array.rst:182 msgid "" "Return the smallest *i* such that *i* is the index of the first occurrence " -"of *x* in the array. The optional arguments *start* and *stop* can be " -"specified to search for *x* within a subsection of the array. Raise :exc:" -"`ValueError` if *x* is not found." -msgstr "" - -#: ../../library/array.rst:196 -msgid "Added optional *start* and *stop* parameters." -msgstr "" +"of *x* in the array." +msgstr "アレイ中で *x* が出現するインデクスのうち最小の値 *i* を返します。" -#: ../../library/array.rst:202 +#: ../../library/array.rst:188 msgid "" "Insert a new item with value *x* in the array before position *i*. Negative " "values are treated as being relative to the end of the array." @@ -426,7 +427,7 @@ msgstr "" "アレイ中の位置 *i* の前に値 *x* をもつ新しい要素を挿入します。 *i* の値が負の" "場合、アレイの末尾からの相対位置として扱います。" -#: ../../library/array.rst:208 +#: ../../library/array.rst:194 msgid "" "Removes the item with the index *i* from the array and returns it. The " "optional argument defaults to ``-1``, so that by default the last item is " @@ -436,19 +437,15 @@ msgstr "" "フォルトで ``-1`` になっていて、最後の要素を取り除いて返すようになっていま" "す。" -#: ../../library/array.rst:215 +#: ../../library/array.rst:201 msgid "Remove the first occurrence of *x* from the array." msgstr "アレイ中の *x* のうち、最初に現れたものを取り除きます。" -#: ../../library/array.rst:220 -msgid "Remove all elements from the array." -msgstr "" - -#: ../../library/array.rst:227 +#: ../../library/array.rst:206 msgid "Reverse the order of the items in the array." msgstr "アレイの要素の順番を逆にします。" -#: ../../library/array.rst:232 +#: ../../library/array.rst:211 msgid "" "Convert the array to an array of machine values and return the bytes " "representation (the same sequence of bytes that would be written to a file " @@ -457,63 +454,80 @@ msgstr "" "array をマシンの値の array に変換して、 bytes の形で返します (:meth:`tofile` " "メソッドを使ってファイルに書かれるバイト列と同じです)。" -#: ../../library/array.rst:236 -msgid ":meth:`!tostring` is renamed to :meth:`tobytes` for clarity." +#: ../../library/array.rst:215 +msgid ":meth:`tostring` is renamed to :meth:`tobytes` for clarity." msgstr "" +"明確化のため :meth:`tostring` の名前が :meth:`tobytes` に変更されました。" -#: ../../library/array.rst:242 +#: ../../library/array.rst:221 msgid "Write all items (as machine values) to the :term:`file object` *f*." msgstr "" "すべての要素を (マシンの値の形式で) :term:`file object` *f* に書き込みます。" -#: ../../library/array.rst:247 +#: ../../library/array.rst:226 msgid "Convert the array to an ordinary list with the same items." msgstr "アレイを同じ要素を持つ普通のリストに変換します。" -#: ../../library/array.rst:252 +#: ../../library/array.rst:231 msgid "" -"Convert the array to a Unicode string. The array must have a type ``'u'`` " -"or ``'w'``; otherwise a :exc:`ValueError` is raised. Use ``array.tobytes()." -"decode(enc)`` to obtain a Unicode string from an array of some other type." +"Convert the array to a unicode string. The array must be a type ``'u'`` " +"array; otherwise a :exc:`ValueError` is raised. Use ``array.tobytes()." +"decode(enc)`` to obtain a unicode string from an array of some other type." msgstr "" +"アレイを Unicode 文字列に変換します。アレイの型コードは ``'u'`` でなければな" +"りません。それ以外の場合には :exc:`ValueError` を送出します。他の型のアレイか" +"ら Unicode 文字列を得るには、 ``array.tobytes().decode(enc)`` を使ってくださ" +"い。" -#: ../../library/array.rst:257 -msgid "" -"The string representation of array objects has the form ``array(typecode, " -"initializer)``. The *initializer* is omitted if the array is empty, " -"otherwise it is a Unicode string if the *typecode* is ``'u'`` or ``'w'``, " -"otherwise it is a list of numbers. The string representation is guaranteed " -"to be able to be converted back to an array with the same type and value " -"using :func:`eval`, so long as the :class:`~array.array` class has been " -"imported using ``from array import array``. Variables ``inf`` and ``nan`` " -"must also be defined if it contains corresponding floating-point values. " -"Examples::" -msgstr "" - -#: ../../library/array.rst:269 +#: ../../library/array.rst:236 msgid "" -"array('l')\n" -"array('w', 'hello \\u2641')\n" -"array('l', [1, 2, 3, 4, 5])\n" -"array('d', [1.0, 2.0, 3.14, -inf, nan])" +"When an array object is printed or converted to a string, it is represented " +"as ``array(typecode, initializer)``. The *initializer* is omitted if the " +"array is empty, otherwise it is a string if the *typecode* is ``'u'``, " +"otherwise it is a list of numbers. The string is guaranteed to be able to " +"be converted back to an array with the same type and value using :func:" +"`eval`, so long as the :class:`~array.array` class has been imported using " +"``from array import array``. Examples::" msgstr "" - -#: ../../library/array.rst:277 +"アレイオブジェクトを表示したり文字列に変換したりすると、 ``array(typecode, " +"initializer)`` という形式で表現されます。\n" +"アレイが空の場合、 *initializer* の表示を省略します。\n" +"アレイが空でなければ、 *typecode* が ``'u'`` の場合には文字列に、それ以外の場" +"合には数値のリストになります。\n" +":class:`~array.array` クラスが ``from array import array`` というふうにイン" +"ポートされている限り、変換後の文字列に :func:`eval` を用いると元のアレイオブ" +"ジェクトと同じデータ型と値を持つアレイに逆変換できることが保証されています。" +"文字列表現の例を以下に示します::" + +#: ../../library/array.rst:253 msgid "Module :mod:`struct`" msgstr ":mod:`struct` モジュール" -#: ../../library/array.rst:278 +#: ../../library/array.rst:253 msgid "Packing and unpacking of heterogeneous binary data." msgstr "異なる種類のバイナリデータのパックおよびアンパック。" -#: ../../library/array.rst:280 -msgid "`NumPy `_" -msgstr "`NumPy `_" +#: ../../library/array.rst:257 +msgid "Module :mod:`xdrlib`" +msgstr ":mod:`xdrlib` モジュール" + +#: ../../library/array.rst:256 +msgid "" +"Packing and unpacking of External Data Representation (XDR) data as used in " +"some remote procedure call systems." +msgstr "" +"遠隔手続き呼び出しシステムで使われる外部データ表現仕様 (External Data " +"Representation, XDR) のデータのパックおよびアンパック。" -#: ../../library/array.rst:281 -msgid "The NumPy package defines another array type." -msgstr "NumPy パッケージは、別の配列型を定義しています。" +#: ../../library/array.rst:260 +msgid "`The Numerical Python Documentation `_" +msgstr "`Numerical Python ドキュメント `_" -#: ../../library/array.rst:7 -msgid "arrays" -msgstr "arrays" +#: ../../library/array.rst:260 +msgid "" +"The Numeric Python extension (NumPy) defines another array type; see http://" +"www.numpy.org/ for further information about Numerical Python." +msgstr "" +"Numeric Python 拡張モジュール (NumPy) では、別の方法でシーケンス型を定義して" +"います。 Numerical Python に関する詳しい情報は http://www.numpy.org/ を参照し" +"てください。" diff --git a/library/ast.po b/library/ast.po index ab9cccd00..456230941 100644 --- a/library/ast.po +++ b/library/ast.po @@ -1,35 +1,36 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 -# Yusuke Miyazaki , 2022 -# Takeshi Nakazato, 2023 -# Arihiro TAKASE, 2023 -# 石井明久, 2024 -# Takanori Suzuki , 2025 +# 秘湯 , 2017 +# Arihiro TAKASE, 2017 +# Osamu NAKAMURA, 2019 +# Tetsuo Koyama , 2020 +# Amasaka Kota , 2020 +# tomo, 2020 +# Yusuke Miyazaki , 2020 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-06 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:54+0000\n" -"Last-Translator: Takanori Suzuki , 2025\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-07-31 07:07+0000\n" +"PO-Revision-Date: 2017-02-16 17:48+0000\n" +"Last-Translator: Yusuke Miyazaki , 2020\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/ast.rst:2 -msgid ":mod:`!ast` --- Abstract syntax trees" -msgstr "" +msgid ":mod:`ast` --- Abstract Syntax Trees" +msgstr ":mod:`ast` --- 抽象構文木" #: ../../library/ast.rst:14 msgid "**Source code:** :source:`Lib/ast.py`" @@ -64,190 +65,13 @@ msgstr "" "す。" #: ../../library/ast.rst:33 -msgid "Abstract grammar" -msgstr "" +msgid "Abstract Grammar" +msgstr "抽象文法 (Abstract Grammar)" #: ../../library/ast.rst:35 msgid "The abstract grammar is currently defined as follows:" msgstr "抽象文法は、現在次のように定義されています:" -#: ../../library/ast.rst:37 -msgid "" -"-- ASDL's 4 builtin types are:\n" -"-- identifier, int, string, constant\n" -"\n" -"module Python\n" -"{\n" -" mod = Module(stmt* body, type_ignore* type_ignores)\n" -" | Interactive(stmt* body)\n" -" | Expression(expr body)\n" -" | FunctionType(expr* argtypes, expr returns)\n" -"\n" -" stmt = FunctionDef(identifier name, arguments args,\n" -" stmt* body, expr* decorator_list, expr? returns,\n" -" string? type_comment, type_param* type_params)\n" -" | AsyncFunctionDef(identifier name, arguments args,\n" -" stmt* body, expr* decorator_list, expr? " -"returns,\n" -" string? type_comment, type_param* type_params)\n" -"\n" -" | ClassDef(identifier name,\n" -" expr* bases,\n" -" keyword* keywords,\n" -" stmt* body,\n" -" expr* decorator_list,\n" -" type_param* type_params)\n" -" | Return(expr? value)\n" -"\n" -" | Delete(expr* targets)\n" -" | Assign(expr* targets, expr value, string? type_comment)\n" -" | TypeAlias(expr name, type_param* type_params, expr value)\n" -" | AugAssign(expr target, operator op, expr value)\n" -" -- 'simple' indicates that we annotate simple name without parens\n" -" | AnnAssign(expr target, expr annotation, expr? value, int " -"simple)\n" -"\n" -" -- use 'orelse' because else is a keyword in target languages\n" -" | For(expr target, expr iter, stmt* body, stmt* orelse, string? " -"type_comment)\n" -" | AsyncFor(expr target, expr iter, stmt* body, stmt* orelse, " -"string? type_comment)\n" -" | While(expr test, stmt* body, stmt* orelse)\n" -" | If(expr test, stmt* body, stmt* orelse)\n" -" | With(withitem* items, stmt* body, string? type_comment)\n" -" | AsyncWith(withitem* items, stmt* body, string? type_comment)\n" -"\n" -" | Match(expr subject, match_case* cases)\n" -"\n" -" | Raise(expr? exc, expr? cause)\n" -" | Try(stmt* body, excepthandler* handlers, stmt* orelse, stmt* " -"finalbody)\n" -" | TryStar(stmt* body, excepthandler* handlers, stmt* orelse, stmt* " -"finalbody)\n" -" | Assert(expr test, expr? msg)\n" -"\n" -" | Import(alias* names)\n" -" | ImportFrom(identifier? module, alias* names, int? level)\n" -"\n" -" | Global(identifier* names)\n" -" | Nonlocal(identifier* names)\n" -" | Expr(expr value)\n" -" | Pass | Break | Continue\n" -"\n" -" -- col_offset is the byte offset in the utf8 string the parser " -"uses\n" -" attributes (int lineno, int col_offset, int? end_lineno, int? " -"end_col_offset)\n" -"\n" -" -- BoolOp() can use left & right?\n" -" expr = BoolOp(boolop op, expr* values)\n" -" | NamedExpr(expr target, expr value)\n" -" | BinOp(expr left, operator op, expr right)\n" -" | UnaryOp(unaryop op, expr operand)\n" -" | Lambda(arguments args, expr body)\n" -" | IfExp(expr test, expr body, expr orelse)\n" -" | Dict(expr?* keys, expr* values)\n" -" | Set(expr* elts)\n" -" | ListComp(expr elt, comprehension* generators)\n" -" | SetComp(expr elt, comprehension* generators)\n" -" | DictComp(expr key, expr value, comprehension* generators)\n" -" | GeneratorExp(expr elt, comprehension* generators)\n" -" -- the grammar constrains where yield expressions can occur\n" -" | Await(expr value)\n" -" | Yield(expr? value)\n" -" | YieldFrom(expr value)\n" -" -- need sequences for compare to distinguish between\n" -" -- x < 4 < 3 and (x < 4) < 3\n" -" | Compare(expr left, cmpop* ops, expr* comparators)\n" -" | Call(expr func, expr* args, keyword* keywords)\n" -" | FormattedValue(expr value, int conversion, expr? format_spec)\n" -" | Interpolation(expr value, constant str, int conversion, expr? " -"format_spec)\n" -" | JoinedStr(expr* values)\n" -" | TemplateStr(expr* values)\n" -" | Constant(constant value, string? kind)\n" -"\n" -" -- the following expression can appear in assignment context\n" -" | Attribute(expr value, identifier attr, expr_context ctx)\n" -" | Subscript(expr value, expr slice, expr_context ctx)\n" -" | Starred(expr value, expr_context ctx)\n" -" | Name(identifier id, expr_context ctx)\n" -" | List(expr* elts, expr_context ctx)\n" -" | Tuple(expr* elts, expr_context ctx)\n" -"\n" -" -- can appear only in Subscript\n" -" | Slice(expr? lower, expr? upper, expr? step)\n" -"\n" -" -- col_offset is the byte offset in the utf8 string the parser " -"uses\n" -" attributes (int lineno, int col_offset, int? end_lineno, int? " -"end_col_offset)\n" -"\n" -" expr_context = Load | Store | Del\n" -"\n" -" boolop = And | Or\n" -"\n" -" operator = Add | Sub | Mult | MatMult | Div | Mod | Pow | LShift\n" -" | RShift | BitOr | BitXor | BitAnd | FloorDiv\n" -"\n" -" unaryop = Invert | Not | UAdd | USub\n" -"\n" -" cmpop = Eq | NotEq | Lt | LtE | Gt | GtE | Is | IsNot | In | NotIn\n" -"\n" -" comprehension = (expr target, expr iter, expr* ifs, int is_async)\n" -"\n" -" excepthandler = ExceptHandler(expr? type, identifier? name, stmt* body)\n" -" attributes (int lineno, int col_offset, int? end_lineno, " -"int? end_col_offset)\n" -"\n" -" arguments = (arg* posonlyargs, arg* args, arg? vararg, arg* kwonlyargs,\n" -" expr* kw_defaults, arg? kwarg, expr* defaults)\n" -"\n" -" arg = (identifier arg, expr? annotation, string? type_comment)\n" -" attributes (int lineno, int col_offset, int? end_lineno, int? " -"end_col_offset)\n" -"\n" -" -- keyword arguments supplied to call (NULL identifier for **kwargs)\n" -" keyword = (identifier? arg, expr value)\n" -" attributes (int lineno, int col_offset, int? end_lineno, int? " -"end_col_offset)\n" -"\n" -" -- import name with optional 'as' alias.\n" -" alias = (identifier name, identifier? asname)\n" -" attributes (int lineno, int col_offset, int? end_lineno, int? " -"end_col_offset)\n" -"\n" -" withitem = (expr context_expr, expr? optional_vars)\n" -"\n" -" match_case = (pattern pattern, expr? guard, stmt* body)\n" -"\n" -" pattern = MatchValue(expr value)\n" -" | MatchSingleton(constant value)\n" -" | MatchSequence(pattern* patterns)\n" -" | MatchMapping(expr* keys, pattern* patterns, identifier? rest)\n" -" | MatchClass(expr cls, pattern* patterns, identifier* kwd_attrs, " -"pattern* kwd_patterns)\n" -"\n" -" | MatchStar(identifier? name)\n" -" -- The optional \"rest\" MatchMapping parameter handles " -"capturing extra mapping keys\n" -"\n" -" | MatchAs(pattern? pattern, identifier? name)\n" -" | MatchOr(pattern* patterns)\n" -"\n" -" attributes (int lineno, int col_offset, int end_lineno, int " -"end_col_offset)\n" -"\n" -" type_ignore = TypeIgnore(int lineno, string tag)\n" -"\n" -" type_param = TypeVar(identifier name, expr? bound, expr? default_value)\n" -" | ParamSpec(identifier name, expr? default_value)\n" -" | TypeVarTuple(identifier name, expr? default_value)\n" -" attributes (int lineno, int col_offset, int end_lineno, int " -"end_col_offset)\n" -"}\n" -msgstr "" - #: ../../library/ast.rst:42 msgid "Node classes" msgstr "Node クラス" @@ -256,12 +80,12 @@ msgstr "Node クラス" msgid "" "This is the base of all AST node classes. The actual node classes are " "derived from the :file:`Parser/Python.asdl` file, which is reproduced :ref:" -"`above `. They are defined in the :mod:`!_ast` C module " +"`below `. They are defined in the :mod:`_ast` C module " "and re-exported in :mod:`ast`." msgstr "" "このクラスは全ての AST ノード・クラスの基底です。実際のノード・クラスは :ref:" -"`先に ` 示した :file:`Parser/Python.asdl` ファイルから派生" -"したものです。これらのクラスは :mod:`!_ast` C モジュールで定義され、 :mod:" +"`後ほど ` 示す :file:`Parser/Python.asdl` ファイルから派生" +"したものです。これらのクラスは :mod:`_ast` C モジュールで定義され、 :mod:" "`ast` にもエクスポートし直されています。" #: ../../library/ast.rst:51 @@ -284,11 +108,11 @@ msgstr "" #: ../../library/ast.rst:64 msgid "" -"Each concrete class has an attribute :attr:`!_fields` which gives the names " +"Each concrete class has an attribute :attr:`_fields` which gives the names " "of all child nodes." msgstr "" -"各具象クラスは属性 :attr:`!_fields` を持っており、すべての子ノードの名前をそ" -"こに保持しています。" +"各具象クラスは属性 :attr:`_fields` を持っており、すべての子ノードの名前をそこ" +"に保持しています。" #: ../../library/ast.rst:67 msgid "" @@ -315,39 +139,19 @@ msgstr "" "ストで表されます。全ての属性は AST を :func:`compile` でコンパイルする際には" "存在しなければならず、そして妥当な値でなければなりません。" -#: ../../library/ast.rst:79 -msgid "" -"The :attr:`!_field_types` attribute on each concrete class is a dictionary " -"mapping field names (as also listed in :attr:`_fields`) to their types." -msgstr "" - #: ../../library/ast.rst:82 msgid "" -">>> ast.TypeVar._field_types\n" -"{'name': , 'bound': ast.expr | None, 'default_value': ast.expr " -"| None}" -msgstr "" - -#: ../../library/ast.rst:94 -msgid "" "Instances of :class:`ast.expr` and :class:`ast.stmt` subclasses have :attr:" "`lineno`, :attr:`col_offset`, :attr:`end_lineno`, and :attr:`end_col_offset` " "attributes. The :attr:`lineno` and :attr:`end_lineno` are the first and " -"last line numbers of source text span (1-indexed so the first line is line " -"1) and the :attr:`col_offset` and :attr:`end_col_offset` are the " +"last line numbers of the source text span (1-indexed so the first line is " +"line 1), and the :attr:`col_offset` and :attr:`end_col_offset` are the " "corresponding UTF-8 byte offsets of the first and last tokens that generated " "the node. The UTF-8 offset is recorded because the parser uses UTF-8 " "internally." msgstr "" -":class:`ast.expr` や :class:`ast.stmt` のサブクラスのインスタンスは :attr:" -"`lineno`, :attr:`col_offset`, :attr:`end_lineno`, および :attr:" -"`end_col_offset` 属性を持ちます。 :attr:`lineno` と :attr:`end_lineno` はソー" -"ステキストの範囲を最初と最後の行番号で表し (1 から数え始めるので、最初の行の" -"行番号は 1 となります)、 :attr:`col_offset` と :attr:`end_col_offset` はノー" -"ドが生成した最初と最後のトークンの UTF-8 バイトオフセットです。 UTF-8 オフ" -"セットはパーサが内部で使用するので記録されます。" -#: ../../library/ast.rst:103 +#: ../../library/ast.rst:91 msgid "" "Note that the end positions are not required by the compiler and are " "therefore optional. The end offset is *after* the last symbol, for example " @@ -359,12 +163,12 @@ msgstr "" "す。例えば一行で書かれた式のソースコードのセグメントは ``source_line[node." "col_offset : node.end_col_offset]`` により取得できます。" -#: ../../library/ast.rst:108 +#: ../../library/ast.rst:96 msgid "" "The constructor of a class :class:`ast.T` parses its arguments as follows:" msgstr "クラス :class:`ast.T` のコンストラクタは引数を次のように解析します:" -#: ../../library/ast.rst:110 +#: ../../library/ast.rst:98 msgid "" "If there are positional arguments, there must be as many as there are items " "in :attr:`T._fields`; they will be assigned as attributes of these names." @@ -372,7 +176,7 @@ msgstr "" "位置引数があるとすれば、 :attr:`T._fields` にあるのと同じだけの個数が無ければ" "なりません。これらの引数はそこにある名前を持った属性として割り当てられます。" -#: ../../library/ast.rst:112 +#: ../../library/ast.rst:100 msgid "" "If there are keyword arguments, they will set the attributes of the same " "names to the given values." @@ -380,7 +184,7 @@ msgstr "" "キーワード引数があるとすれば、それらはその名前の属性にその値を割り当てられま" "す。" -#: ../../library/ast.rst:115 +#: ../../library/ast.rst:103 msgid "" "For example, to create and populate an :class:`ast.UnaryOp` node, you could " "use ::" @@ -388,27 +192,15 @@ msgstr "" "たとえば、 :class:`ast.UnaryOp` ノードを生成して属性を埋めるには、次のように" "することができます ::" -#: ../../library/ast.rst:118 -msgid "" -"node = ast.UnaryOp(ast.USub(), ast.Constant(5, lineno=0, col_offset=0),\n" -" lineno=0, col_offset=0)" -msgstr "" - -#: ../../library/ast.rst:121 -msgid "" -"If a field that is optional in the grammar is omitted from the constructor, " -"it defaults to ``None``. If a list field is omitted, it defaults to the " -"empty list. If a field of type :class:`!ast.expr_context` is omitted, it " -"defaults to :class:`Load() `. If any other field is omitted, a :" -"exc:`DeprecationWarning` is raised and the AST node will not have this " -"field. In Python 3.15, this condition will raise an error." -msgstr "" +#: ../../library/ast.rst:115 +msgid "or the more compact ::" +msgstr "もしくはよりコンパクトにも書けます ::" -#: ../../library/ast.rst:130 +#: ../../library/ast.rst:122 msgid "Class :class:`ast.Constant` is now used for all constants." msgstr ":class:`ast.Constant` が全ての定数に使われるようになりました。" -#: ../../library/ast.rst:134 +#: ../../library/ast.rst:126 msgid "" "Simple indices are represented by their value, extended slices are " "represented as tuples." @@ -416,37 +208,29 @@ msgstr "" "単純なインデックスはその値で表現され、幅を持つスライスはタプルで表現されま" "す。" -#: ../../library/ast.rst:139 +#: ../../library/ast.rst:131 msgid "" -"The :meth:`~object.__repr__` output of :class:`~ast.AST` nodes includes the " -"values of the node fields." +"Old classes :class:`ast.Num`, :class:`ast.Str`, :class:`ast.Bytes`, :class:" +"`ast.NameConstant` and :class:`ast.Ellipsis` are still available, but they " +"will be removed in future Python releases. In the meantime, instantiating " +"them will return an instance of a different class." msgstr "" +"古いクラスである :class:`ast.Num`, :class:`ast.Str`, :class:`ast.Bytes`, :" +"class:`ast.NameConstant` および :class:`ast.Ellipsis` は現バージョンでは利用" +"可能ですが、将来の Python リリースで削除される予定です。それまでは、これらの" +"クラスをインスタンス化すると異なるクラスのインスタンスが返されます。" -#: ../../library/ast.rst:144 +#: ../../library/ast.rst:138 msgid "" -"Old classes :class:`!ast.Num`, :class:`!ast.Str`, :class:`!ast.Bytes`, :" -"class:`!ast.NameConstant` and :class:`!ast.Ellipsis` are still available, " -"but they will be removed in future Python releases. In the meantime, " -"instantiating them will return an instance of a different class." -msgstr "" - -#: ../../library/ast.rst:151 -msgid "" -"Old classes :class:`!ast.Index` and :class:`!ast.ExtSlice` are still " +"Old classes :class:`ast.Index` and :class:`ast.ExtSlice` are still " "available, but they will be removed in future Python releases. In the " "meantime, instantiating them will return an instance of a different class." msgstr "" +"古いクラスである :class:`ast.Index` と :class:`ast.ExtSlice` は現バージョンで" +"は利用可能ですが、将来の Python リリースで削除される予定です。それまでは、こ" +"れらのクラスをインスタンス化すると異なるクラスのインスタンスが返されます。" -#: ../../library/ast.rst:158 -msgid "" -"Previous versions of Python allowed the creation of AST nodes that were " -"missing required fields. Similarly, AST node constructors allowed arbitrary " -"keyword arguments that were set as attributes of the AST node, even if they " -"did not match any of the fields of the AST node. This behavior is deprecated " -"and will be removed in Python 3.15." -msgstr "" - -#: ../../library/ast.rst:165 +#: ../../library/ast.rst:144 msgid "" "The descriptions of the specific node classes displayed here were initially " "adapted from the fantastic `Green Tree Snakes `__ プロジェクトと" "そのすべての貢献者の成果物をもとにしています。" -#: ../../library/ast.rst:174 -msgid "Root nodes" -msgstr "" - -#: ../../library/ast.rst:178 -msgid "" -"A Python module, as with :ref:`file input `. Node type generated " -"by :func:`ast.parse` in the default ``\"exec\"`` *mode*." -msgstr "" - -#: ../../library/ast.rst:181 -msgid "``body`` is a :class:`list` of the module's :ref:`ast-statements`." -msgstr "" - -#: ../../library/ast.rst:183 -msgid "" -"``type_ignores`` is a :class:`list` of the module's type ignore comments; " -"see :func:`ast.parse` for more details." -msgstr "" - -#: ../../library/ast.rst:186 -msgid "" -">>> print(ast.dump(ast.parse('x = 1'), indent=4))\n" -"Module(\n" -" body=[\n" -" Assign(\n" -" targets=[\n" -" Name(id='x', ctx=Store())],\n" -" value=Constant(value=1))])" -msgstr "" - -#: ../../library/ast.rst:199 -msgid "" -"A single Python :ref:`expression input `. Node type " -"generated by :func:`ast.parse` when *mode* is ``\"eval\"``." -msgstr "" - -#: ../../library/ast.rst:202 -msgid "" -"``body`` is a single node, one of the :ref:`expression types `." -msgstr "" - -#: ../../library/ast.rst:205 ../../library/ast.rst:275 -msgid "" -">>> print(ast.dump(ast.parse('123', mode='eval'), indent=4))\n" -"Expression(\n" -" body=Constant(value=123))" -msgstr "" - -#: ../../library/ast.rst:214 -msgid "" -"A single :ref:`interactive input `, like in :ref:`tut-interac`. " -"Node type generated by :func:`ast.parse` when *mode* is ``\"single\"``." -msgstr "" - -#: ../../library/ast.rst:217 -msgid "``body`` is a :class:`list` of :ref:`statement nodes `." -msgstr "" - -#: ../../library/ast.rst:219 -msgid "" -">>> print(ast.dump(ast.parse('x = 1; y = 2', mode='single'), indent=4))\n" -"Interactive(\n" -" body=[\n" -" Assign(\n" -" targets=[\n" -" Name(id='x', ctx=Store())],\n" -" value=Constant(value=1)),\n" -" Assign(\n" -" targets=[\n" -" Name(id='y', ctx=Store())],\n" -" value=Constant(value=2))])" -msgstr "" - -#: ../../library/ast.rst:236 -msgid "" -"A representation of an old-style type comments for functions, as Python " -"versions prior to 3.5 didn't support :pep:`484` annotations. Node type " -"generated by :func:`ast.parse` when *mode* is ``\"func_type\"``." -msgstr "" - -#: ../../library/ast.rst:240 -msgid "Such type comments would look like this::" -msgstr "" - -#: ../../library/ast.rst:242 -msgid "" -"def sum_two_number(a, b):\n" -" # type: (int, int) -> int\n" -" return a + b" -msgstr "" - -#: ../../library/ast.rst:246 -msgid "" -"``argtypes`` is a :class:`list` of :ref:`expression nodes `." -msgstr "" - -#: ../../library/ast.rst:248 -msgid "``returns`` is a single :ref:`expression node `." -msgstr "" - -#: ../../library/ast.rst:250 -msgid "" -">>> print(ast.dump(ast.parse('(int, str) -> List[int]', mode='func_type'), " -"indent=4))\n" -"FunctionType(\n" -" argtypes=[\n" -" Name(id='int', ctx=Load()),\n" -" Name(id='str', ctx=Load())],\n" -" returns=Subscript(\n" -" value=Name(id='List', ctx=Load()),\n" -" slice=Name(id='int', ctx=Load()),\n" -" ctx=Load()))" -msgstr "" - -#: ../../library/ast.rst:266 +#: ../../library/ast.rst:150 msgid "Literals" msgstr "リテラル" -#: ../../library/ast.rst:270 +#: ../../library/ast.rst:154 msgid "" "A constant value. The ``value`` attribute of the ``Constant`` literal " "contains the Python object it represents. The values represented can be " -"instances of :class:`str`, :class:`bytes`, :class:`int`, :class:`float`, :" -"class:`complex`, and :class:`bool`, and the constants :data:`None` and :data:" -"`Ellipsis`." +"simple types such as a number, string or ``None``, but also immutable " +"container types (tuples and frozensets) if all of their elements are " +"constant." msgstr "" +"定数です。 ``Constant`` リテラルの ``value`` 属性は定数値を表す Python オブ" +"ジェクトを保持します。定数として表現される値は数値、文字列、または ``None`` " +"のような単純な型のほかに、全ての要素が定数であるイミュータブルなコンテナ型 " +"(tuples および frozensets) も設定可能です。" -#: ../../library/ast.rst:284 +#: ../../library/ast.rst:168 msgid "" "Node representing a single formatting field in an f-string. If the string " "contains a single formatting field and nothing else the node can be isolated " @@ -595,7 +267,7 @@ msgstr "" "列が単一の置換フィールドしか持たず、他に何も含まない場合は、ノードは単独で存" "在できます。そうでない場合は :class:`JoinedStr` の一部としてあらわれます。" -#: ../../library/ast.rst:288 +#: ../../library/ast.rst:172 msgid "" "``value`` is any expression node (such as a literal, a variable, or a " "function call)." @@ -603,27 +275,27 @@ msgstr "" "``value`` は式ツリーのノードのいずれか (リテラル、変数、関数呼び出しなど) で" "す。" -#: ../../library/ast.rst:290 +#: ../../library/ast.rst:174 msgid "``conversion`` is an integer:" msgstr "``conversion`` は整数です:" -#: ../../library/ast.rst:292 +#: ../../library/ast.rst:176 msgid "-1: no formatting" msgstr "-1: 書式指定なし" -#: ../../library/ast.rst:293 +#: ../../library/ast.rst:177 msgid "115: ``!s`` string formatting" msgstr "115: ``!s`` 文字列書式指定" -#: ../../library/ast.rst:294 +#: ../../library/ast.rst:178 msgid "114: ``!r`` repr formatting" msgstr "114: ``!r`` repr 書式指定" -#: ../../library/ast.rst:295 +#: ../../library/ast.rst:179 msgid "97: ``!a`` ascii formatting" msgstr "97: ``!a`` ascii 書式指定" -#: ../../library/ast.rst:297 +#: ../../library/ast.rst:181 msgid "" "``format_spec`` is a :class:`JoinedStr` node representing the formatting of " "the value, or ``None`` if no format was specified. Both ``conversion`` and " @@ -633,7 +305,7 @@ msgstr "" "書式指定がない場合は ``None`` です。 ``conversion`` と ``format_spec`` を同時" "に設定することができます。" -#: ../../library/ast.rst:304 +#: ../../library/ast.rst:188 msgid "" "An f-string, comprising a series of :class:`FormattedValue` and :class:" "`Constant` nodes." @@ -641,30 +313,7 @@ msgstr "" ":class:`FormattedValue` ノードと :class:`Constant` ノードの集まりからなる f-" "string です。" -#: ../../library/ast.rst:307 -msgid "" -">>> print(ast.dump(ast.parse('f\"sin({a}) is {sin(a):.3}\"', mode='eval'), " -"indent=4))\n" -"Expression(\n" -" body=JoinedStr(\n" -" values=[\n" -" Constant(value='sin('),\n" -" FormattedValue(\n" -" value=Name(id='a', ctx=Load()),\n" -" conversion=-1),\n" -" Constant(value=') is '),\n" -" FormattedValue(\n" -" value=Call(\n" -" func=Name(id='sin', ctx=Load()),\n" -" args=[\n" -" Name(id='a', ctx=Load())]),\n" -" conversion=-1,\n" -" format_spec=JoinedStr(\n" -" values=[\n" -" Constant(value='.3')]))]))" -msgstr "" - -#: ../../library/ast.rst:332 +#: ../../library/ast.rst:217 msgid "" "A list or tuple. ``elts`` holds a list of nodes representing the elements. " "``ctx`` is :class:`Store` if the container is an assignment target (i.e. " @@ -675,44 +324,13 @@ msgstr "" "ば ``(x,y)=something`` のような場合) は :class:`Store` であり、そうでない場合" "は :class:`Load` です。" -#: ../../library/ast.rst:336 -msgid "" -">>> print(ast.dump(ast.parse('[1, 2, 3]', mode='eval'), indent=4))\n" -"Expression(\n" -" body=List(\n" -" elts=[\n" -" Constant(value=1),\n" -" Constant(value=2),\n" -" Constant(value=3)],\n" -" ctx=Load()))\n" -">>> print(ast.dump(ast.parse('(1, 2, 3)', mode='eval'), indent=4))\n" -"Expression(\n" -" body=Tuple(\n" -" elts=[\n" -" Constant(value=1),\n" -" Constant(value=2),\n" -" Constant(value=3)],\n" -" ctx=Load()))" -msgstr "" - -#: ../../library/ast.rst:358 +#: ../../library/ast.rst:243 msgid "A set. ``elts`` holds a list of nodes representing the set's elements." msgstr "" "集合 (set) をあらわします。 ``elts`` は集合の各要素を表現するノードのリストを" "保持します。" -#: ../../library/ast.rst:360 -msgid "" -">>> print(ast.dump(ast.parse('{1, 2, 3}', mode='eval'), indent=4))\n" -"Expression(\n" -" body=Set(\n" -" elts=[\n" -" Constant(value=1),\n" -" Constant(value=2),\n" -" Constant(value=3)]))" -msgstr "" - -#: ../../library/ast.rst:373 +#: ../../library/ast.rst:258 msgid "" "A dictionary. ``keys`` and ``values`` hold lists of nodes representing the " "keys and the values respectively, in matching order (what would be returned " @@ -722,7 +340,7 @@ msgstr "" "ト を順序が一致した形で (それぞれ :code:`dictionary.keys()` と :code:" "`dictionary.values()` を呼び出したときに返される順序で) 保持します。" -#: ../../library/ast.rst:377 +#: ../../library/ast.rst:262 msgid "" "When doing dictionary unpacking using dictionary literals the expression to " "be expanded goes in the ``values`` list, with a ``None`` at the " @@ -731,24 +349,11 @@ msgstr "" "辞書リテラルを使って辞書を展開した場合、展開された式ツリーにおいて辞書は " "``values`` リストに入り、 ``keys`` の対応する位置には ``None`` が入ります。" -#: ../../library/ast.rst:381 -msgid "" -">>> print(ast.dump(ast.parse('{\"a\":1, **d}', mode='eval'), indent=4))\n" -"Expression(\n" -" body=Dict(\n" -" keys=[\n" -" Constant(value='a'),\n" -" None],\n" -" values=[\n" -" Constant(value=1),\n" -" Name(id='d', ctx=Load())]))" -msgstr "" - -#: ../../library/ast.rst:395 +#: ../../library/ast.rst:280 msgid "Variables" msgstr "変数" -#: ../../library/ast.rst:399 +#: ../../library/ast.rst:284 msgid "" "A variable name. ``id`` holds the name as a string, and ``ctx`` is one of " "the following types." @@ -756,7 +361,7 @@ msgstr "" "変数名をあらわします。 ``id`` は変数名を文字列で保持し、 ``ctx`` は以下に示す" "型のいずれかです。" -#: ../../library/ast.rst:407 +#: ../../library/ast.rst:292 msgid "" "Variable references can be used to load the value of a variable, to assign a " "new value to it, or to delete it. Variable references are given a context to " @@ -766,31 +371,7 @@ msgstr "" "るために使うことができます。変数の参照はこれら3つの場合を区別するためのコンテ" "キストによって与えられます。" -#: ../../library/ast.rst:411 -msgid "" -">>> print(ast.dump(ast.parse('a'), indent=4))\n" -"Module(\n" -" body=[\n" -" Expr(\n" -" value=Name(id='a', ctx=Load()))])\n" -"\n" -">>> print(ast.dump(ast.parse('a = 1'), indent=4))\n" -"Module(\n" -" body=[\n" -" Assign(\n" -" targets=[\n" -" Name(id='a', ctx=Store())],\n" -" value=Constant(value=1))])\n" -"\n" -">>> print(ast.dump(ast.parse('del a'), indent=4))\n" -"Module(\n" -" body=[\n" -" Delete(\n" -" targets=[\n" -" Name(id='a', ctx=Del())])])" -msgstr "" - -#: ../../library/ast.rst:437 +#: ../../library/ast.rst:325 msgid "" "A ``*var`` variable reference. ``value`` holds the variable, typically a :" "class:`Name` node. This type must be used when building a :class:`Call` node " @@ -800,28 +381,11 @@ msgstr "" "class:`Name` ノード、を保持します。この型は ``*args`` を伴う関数呼び出しノー" "ド :class:`Call` を構築する際に使用します。 " -#: ../../library/ast.rst:441 -msgid "" -">>> print(ast.dump(ast.parse('a, *b = it'), indent=4))\n" -"Module(\n" -" body=[\n" -" Assign(\n" -" targets=[\n" -" Tuple(\n" -" elts=[\n" -" Name(id='a', ctx=Store()),\n" -" Starred(\n" -" value=Name(id='b', ctx=Store()),\n" -" ctx=Store())],\n" -" ctx=Store())],\n" -" value=Name(id='it', ctx=Load()))])" -msgstr "" - -#: ../../library/ast.rst:461 +#: ../../library/ast.rst:348 msgid "Expressions" msgstr "式 (expression)" -#: ../../library/ast.rst:465 +#: ../../library/ast.rst:352 msgid "" "When an expression, such as a function call, appears as a statement by " "itself with its return value not used or stored, it is wrapped in this " @@ -835,18 +399,7 @@ msgstr "" "`Lambda` ノード :class:`Yield` ノードまたは :class:`YieldFrom` ノードのいずれ" "かを保持します。" -#: ../../library/ast.rst:470 -msgid "" -">>> print(ast.dump(ast.parse('-a'), indent=4))\n" -"Module(\n" -" body=[\n" -" Expr(\n" -" value=UnaryOp(\n" -" op=USub(),\n" -" operand=Name(id='a', ctx=Load())))])" -msgstr "" - -#: ../../library/ast.rst:483 +#: ../../library/ast.rst:371 msgid "" "A unary operation. ``op`` is the operator, and ``operand`` any expression " "node." @@ -854,7 +407,7 @@ msgstr "" "単項演算をあらわします。 ``op`` は演算子で、 ``operand`` は任意の式ツリーの" "ノードです。" -#: ../../library/ast.rst:492 +#: ../../library/ast.rst:380 msgid "" "Unary operator tokens. :class:`Not` is the ``not`` keyword, :class:`Invert` " "is the ``~`` operator." @@ -862,16 +415,7 @@ msgstr "" "単項演算の演算子をあらわします。 :class:`Not` は論理否定キーワード ``not`` で" "あり、 :class:`Invert` はビット反転演算子 ``~`` です。" -#: ../../library/ast.rst:495 -msgid "" -">>> print(ast.dump(ast.parse('not x', mode='eval'), indent=4))\n" -"Expression(\n" -" body=UnaryOp(\n" -" op=Not(),\n" -" operand=Name(id='x', ctx=Load())))" -msgstr "" - -#: ../../library/ast.rst:506 +#: ../../library/ast.rst:394 msgid "" "A binary operation (like addition or division). ``op`` is the operator, and " "``left`` and ``right`` are any expression nodes." @@ -879,21 +423,11 @@ msgstr "" "(加算や減算のような) 二項演算をあらわします。 ``op`` は演算子、 ``left`` と " "``right`` は任意の式ツリーのノードです。" -#: ../../library/ast.rst:509 -msgid "" -">>> print(ast.dump(ast.parse('x + y', mode='eval'), indent=4))\n" -"Expression(\n" -" body=BinOp(\n" -" left=Name(id='x', ctx=Load()),\n" -" op=Add(),\n" -" right=Name(id='y', ctx=Load())))" -msgstr "" - -#: ../../library/ast.rst:533 +#: ../../library/ast.rst:421 msgid "Binary operator tokens." msgstr "二項演算の演算子をあらわします。" -#: ../../library/ast.rst:538 +#: ../../library/ast.rst:426 msgid "" "A boolean operation, 'or' or 'and'. ``op`` is :class:`Or` or :class:`And`. " "``values`` are the values involved. Consecutive operations with the same " @@ -905,26 +439,15 @@ msgstr "" "に同じ演算子を使う連続した演算は、複数の値を持った単一のノードとして表現され" "ます。" -#: ../../library/ast.rst:543 +#: ../../library/ast.rst:431 msgid "This doesn't include ``not``, which is a :class:`UnaryOp`." msgstr "``not`` は単項演算 :class:`UnaryOp` のため、ここには含まれません。" -#: ../../library/ast.rst:545 -msgid "" -">>> print(ast.dump(ast.parse('x or y', mode='eval'), indent=4))\n" -"Expression(\n" -" body=BoolOp(\n" -" op=Or(),\n" -" values=[\n" -" Name(id='x', ctx=Load()),\n" -" Name(id='y', ctx=Load())]))" -msgstr "" - -#: ../../library/ast.rst:559 +#: ../../library/ast.rst:447 msgid "Boolean operator tokens." msgstr "論理演算の演算子をあらわします。" -#: ../../library/ast.rst:564 +#: ../../library/ast.rst:452 msgid "" "A comparison of two or more values. ``left`` is the first value in the " "comparison, ``ops`` the list of operators, and ``comparators`` the list of " @@ -933,25 +456,11 @@ msgstr "" "2つ以上の値の比較をあらわします。 ``left`` 比較の中の最初の値、``ops`` は演算" "子のリスト、 ``comparators`` は2つ目以降の値のリストです。" -#: ../../library/ast.rst:568 -msgid "" -">>> print(ast.dump(ast.parse('1 <= a < 10', mode='eval'), indent=4))\n" -"Expression(\n" -" body=Compare(\n" -" left=Constant(value=1),\n" -" ops=[\n" -" LtE(),\n" -" Lt()],\n" -" comparators=[\n" -" Name(id='a', ctx=Load()),\n" -" Constant(value=10)]))" -msgstr "" - -#: ../../library/ast.rst:593 +#: ../../library/ast.rst:481 msgid "Comparison operator tokens." msgstr "比較演算の演算子をあらわします。" -#: ../../library/ast.rst:598 +#: ../../library/ast.rst:486 msgid "" "A function call. ``func`` is the function, which will often be a :class:" "`Name` or :class:`Attribute` object. Of the arguments:" @@ -959,43 +468,28 @@ msgstr "" "関数呼び出しをあらわします。 ``func`` は関数で、多くの場合 :class:`Name` また" "は :class:`Attribute` のオブジェクトです。 関数呼び出しの引数:" -#: ../../library/ast.rst:601 +#: ../../library/ast.rst:489 msgid "``args`` holds a list of the arguments passed by position." msgstr "``args`` は位置引数のリストを保持します。 " -#: ../../library/ast.rst:602 -msgid "" -"``keywords`` holds a list of :class:`.keyword` objects representing " -"arguments passed by keyword." -msgstr "" - -#: ../../library/ast.rst:605 +#: ../../library/ast.rst:490 msgid "" -"The ``args`` and ``keywords`` arguments are optional and default to empty " -"lists." +"``keywords`` holds a list of :class:`keyword` objects representing arguments " +"passed by keyword." msgstr "" +"``keywords`` は :class:`keyword` クラスのオブジェクトのリスト保持し、キーワー" +"ド引数をあらわします。" -#: ../../library/ast.rst:607 +#: ../../library/ast.rst:493 msgid "" -">>> print(ast.dump(ast.parse('func(a, b=c, *d, **e)', mode='eval'), " -"indent=4))\n" -"Expression(\n" -" body=Call(\n" -" func=Name(id='func', ctx=Load()),\n" -" args=[\n" -" Name(id='a', ctx=Load()),\n" -" Starred(\n" -" value=Name(id='d', ctx=Load()),\n" -" ctx=Load())],\n" -" keywords=[\n" -" keyword(\n" -" arg='b',\n" -" value=Name(id='c', ctx=Load())),\n" -" keyword(\n" -" value=Name(id='e', ctx=Load()))]))" +"When creating a ``Call`` node, ``args`` and ``keywords`` are required, but " +"they can be empty lists. ``starargs`` and ``kwargs`` are optional." msgstr "" +"``Call`` ノードを生成するときに ``args`` と ``keywords`` は必須ですが、空のリ" +"ストであってもかまいません。 ``starargs`` と ``kwargs`` はオプション引数で" +"す。" -#: ../../library/ast.rst:628 +#: ../../library/ast.rst:517 msgid "" "A keyword argument to a function call or class definition. ``arg`` is a raw " "string of the parameter name, ``value`` is a node to pass in." @@ -1003,7 +497,7 @@ msgstr "" "関数呼び出しまたはクラス定義のキーワード引数をあらわします。 ``arg`` はパラ" "メータ名をあらわす文字列、 ``value`` は引数に渡す値をあらわすノードです。" -#: ../../library/ast.rst:634 +#: ../../library/ast.rst:523 msgid "" "An expression such as ``a if b else c``. Each field holds a single node, so " "in the following example, all three are :class:`Name` nodes." @@ -1011,17 +505,7 @@ msgstr "" "``a if b else c`` のような式をあらわします。各フィールドは単一のノードを保持" "します。以下の例では、3つの式ノードはすべて :class:`Name` ノードです。" -#: ../../library/ast.rst:637 -msgid "" -">>> print(ast.dump(ast.parse('a if b else c', mode='eval'), indent=4))\n" -"Expression(\n" -" body=IfExp(\n" -" test=Name(id='b', ctx=Load()),\n" -" body=Name(id='a', ctx=Load()),\n" -" orelse=Name(id='c', ctx=Load())))" -msgstr "" - -#: ../../library/ast.rst:649 +#: ../../library/ast.rst:538 msgid "" "Attribute access, e.g. ``d.keys``. ``value`` is a node, typically a :class:" "`Name`. ``attr`` is a bare string giving the name of the attribute, and " @@ -1033,17 +517,7 @@ msgstr "" "はその属性がどのように振る舞うかに応じて :class:`Load`、 :class:`Store` また" "は :class:`Del` のいずれかです。" -#: ../../library/ast.rst:654 -msgid "" -">>> print(ast.dump(ast.parse('snake.colour', mode='eval'), indent=4))\n" -"Expression(\n" -" body=Attribute(\n" -" value=Name(id='snake', ctx=Load()),\n" -" attr='colour',\n" -" ctx=Load()))" -msgstr "" - -#: ../../library/ast.rst:666 +#: ../../library/ast.rst:555 msgid "" "A named expression. This AST node is produced by the assignment expressions " "operator (also known as the walrus operator). As opposed to the :class:" @@ -1055,20 +529,11 @@ msgstr "" "であってもよい :class:`Assign` ノードと異なり、このノードの場合は ``target`` " "と ``value`` の両方が単一のノードでなければなりません。" -#: ../../library/ast.rst:671 -msgid "" -">>> print(ast.dump(ast.parse('(x := 4)', mode='eval'), indent=4))\n" -"Expression(\n" -" body=NamedExpr(\n" -" target=Name(id='x', ctx=Store()),\n" -" value=Constant(value=4)))" -msgstr "" - -#: ../../library/ast.rst:682 +#: ../../library/ast.rst:570 msgid "Subscripting" msgstr "配列要素の参照 (Subscripting)" -#: ../../library/ast.rst:686 +#: ../../library/ast.rst:574 msgid "" "A subscript, such as ``l[1]``. ``value`` is the subscripted object (usually " "sequence or mapping). ``slice`` is an index, slice or key. It can be a :" @@ -1081,23 +546,7 @@ msgstr "" "ん。 ``ctx`` は要素の参照により実行されるアクションに応じて :class:`Load`、 :" "class:`Store` または :class:`Del` のいずれかです。" -#: ../../library/ast.rst:692 -msgid "" -">>> print(ast.dump(ast.parse('l[1:2, 3]', mode='eval'), indent=4))\n" -"Expression(\n" -" body=Subscript(\n" -" value=Name(id='l', ctx=Load()),\n" -" slice=Tuple(\n" -" elts=[\n" -" Slice(\n" -" lower=Constant(value=1),\n" -" upper=Constant(value=2)),\n" -" Constant(value=3)],\n" -" ctx=Load()),\n" -" ctx=Load()))" -msgstr "" - -#: ../../library/ast.rst:710 +#: ../../library/ast.rst:598 msgid "" "Regular slicing (on the form ``lower:upper`` or ``lower:upper:step``). Can " "occur only inside the *slice* field of :class:`Subscript`, either directly " @@ -1107,23 +556,11 @@ msgstr "" "わします。 :class:`Subscript` の *slice* フィールドでの直接指定か、または :" "class:`Tuple` の要素として指定する場合のみ利用可能です。" -#: ../../library/ast.rst:714 -msgid "" -">>> print(ast.dump(ast.parse('l[1:2]', mode='eval'), indent=4))\n" -"Expression(\n" -" body=Subscript(\n" -" value=Name(id='l', ctx=Load()),\n" -" slice=Slice(\n" -" lower=Constant(value=1),\n" -" upper=Constant(value=2)),\n" -" ctx=Load()))" -msgstr "" - -#: ../../library/ast.rst:727 +#: ../../library/ast.rst:615 msgid "Comprehensions" msgstr "内包表記 (Comprehension)" -#: ../../library/ast.rst:734 +#: ../../library/ast.rst:622 msgid "" "List and set comprehensions, generator expressions, and dictionary " "comprehensions. ``elt`` (or ``key`` and ``value``) is a single node " @@ -1133,55 +570,11 @@ msgstr "" "たは ``key`` と ``value``) は各要素として評価される部品をあらわす単一のノード" "です。" -#: ../../library/ast.rst:738 +#: ../../library/ast.rst:626 msgid "``generators`` is a list of :class:`comprehension` nodes." msgstr "``generators`` は :class:`comprehension` ノードのリストです。" -#: ../../library/ast.rst:740 -msgid "" -">>> print(ast.dump(\n" -"... ast.parse('[x for x in numbers]', mode='eval'),\n" -"... indent=4,\n" -"... ))\n" -"Expression(\n" -" body=ListComp(\n" -" elt=Name(id='x', ctx=Load()),\n" -" generators=[\n" -" comprehension(\n" -" target=Name(id='x', ctx=Store()),\n" -" iter=Name(id='numbers', ctx=Load()),\n" -" is_async=0)]))\n" -">>> print(ast.dump(\n" -"... ast.parse('{x: x**2 for x in numbers}', mode='eval'),\n" -"... indent=4,\n" -"... ))\n" -"Expression(\n" -" body=DictComp(\n" -" key=Name(id='x', ctx=Load()),\n" -" value=BinOp(\n" -" left=Name(id='x', ctx=Load()),\n" -" op=Pow(),\n" -" right=Constant(value=2)),\n" -" generators=[\n" -" comprehension(\n" -" target=Name(id='x', ctx=Store()),\n" -" iter=Name(id='numbers', ctx=Load()),\n" -" is_async=0)]))\n" -">>> print(ast.dump(\n" -"... ast.parse('{x for x in numbers}', mode='eval'),\n" -"... indent=4,\n" -"... ))\n" -"Expression(\n" -" body=SetComp(\n" -" elt=Name(id='x', ctx=Load()),\n" -" generators=[\n" -" comprehension(\n" -" target=Name(id='x', ctx=Store()),\n" -" iter=Name(id='numbers', ctx=Load()),\n" -" is_async=0)]))" -msgstr "" - -#: ../../library/ast.rst:786 +#: ../../library/ast.rst:668 msgid "" "One ``for`` clause in a comprehension. ``target`` is the reference to use " "for each element - typically a :class:`Name` or :class:`Tuple` node. " @@ -1193,7 +586,7 @@ msgstr "" "``iter`` はイテレートする対象のオブジェクトです。 ``ifs`` は条件節のリストで" "す: 各 ``for`` 節は複数の ``ifs`` を持つことができます。" -#: ../../library/ast.rst:791 +#: ../../library/ast.rst:673 msgid "" "``is_async`` indicates a comprehension is asynchronous (using an ``async " "for`` instead of ``for``). The value is an integer (0 or 1)." @@ -1201,79 +594,18 @@ msgstr "" "``is_async`` は内包表記が非同期であることを示します (``async for`` を " "``for`` の代わりに使います)。値は整数です (0 または 1)。" -#: ../../library/ast.rst:794 -msgid "" -">>> print(ast.dump(ast.parse('[ord(c) for line in file for c in line]', " -"mode='eval'),\n" -"... indent=4)) # Multiple comprehensions in one.\n" -"Expression(\n" -" body=ListComp(\n" -" elt=Call(\n" -" func=Name(id='ord', ctx=Load()),\n" -" args=[\n" -" Name(id='c', ctx=Load())]),\n" -" generators=[\n" -" comprehension(\n" -" target=Name(id='line', ctx=Store()),\n" -" iter=Name(id='file', ctx=Load()),\n" -" is_async=0),\n" -" comprehension(\n" -" target=Name(id='c', ctx=Store()),\n" -" iter=Name(id='line', ctx=Load()),\n" -" is_async=0)]))\n" -"\n" -">>> print(ast.dump(ast.parse('(n**2 for n in it if n>5 if n<10)', " -"mode='eval'),\n" -"... indent=4)) # generator comprehension\n" -"Expression(\n" -" body=GeneratorExp(\n" -" elt=BinOp(\n" -" left=Name(id='n', ctx=Load()),\n" -" op=Pow(),\n" -" right=Constant(value=2)),\n" -" generators=[\n" -" comprehension(\n" -" target=Name(id='n', ctx=Store()),\n" -" iter=Name(id='it', ctx=Load()),\n" -" ifs=[\n" -" Compare(\n" -" left=Name(id='n', ctx=Load()),\n" -" ops=[\n" -" Gt()],\n" -" comparators=[\n" -" Constant(value=5)]),\n" -" Compare(\n" -" left=Name(id='n', ctx=Load()),\n" -" ops=[\n" -" Lt()],\n" -" comparators=[\n" -" Constant(value=10)])],\n" -" is_async=0)]))\n" -"\n" -">>> print(ast.dump(ast.parse('[i async for i in soc]', mode='eval'),\n" -"... indent=4)) # Async comprehension\n" -"Expression(\n" -" body=ListComp(\n" -" elt=Name(id='i', ctx=Load()),\n" -" generators=[\n" -" comprehension(\n" -" target=Name(id='i', ctx=Store()),\n" -" iter=Name(id='soc', ctx=Load()),\n" -" is_async=1)]))" -msgstr "" - -#: ../../library/ast.rst:856 +#: ../../library/ast.rst:739 msgid "Statements" msgstr "文 (Statements)" -#: ../../library/ast.rst:860 +#: ../../library/ast.rst:743 msgid "" "An assignment. ``targets`` is a list of nodes, and ``value`` is a single " "node." msgstr "" "代入です。 ``targets`` はノードのリスト、 ``value`` は単一のノードです。" -#: ../../library/ast.rst:862 +#: ../../library/ast.rst:745 msgid "" "Multiple nodes in ``targets`` represents assigning the same value to each. " "Unpacking is represented by putting a :class:`Tuple` or :class:`List` within " @@ -1283,100 +615,32 @@ msgstr "" "ます。分割代入は ``targets`` 内に :class:`Tuple` または :class:`List` を置く" "ことで表現されます。" -#: ../../library/ast.rst:868 ../../library/ast.rst:1163 -#: ../../library/ast.rst:1357 ../../library/ast.rst:1923 +#: ../../library/ast.rst:751 ../../library/ast.rst:1038 +#: ../../library/ast.rst:1211 ../../library/ast.rst:1264 msgid "" "``type_comment`` is an optional string with the type annotation as a comment." msgstr "" "``type_comment`` はコメントとして型アノテーションをあらわすオプション文字列で" "す。" -#: ../../library/ast.rst:870 -msgid "" -">>> print(ast.dump(ast.parse('a = b = 1'), indent=4)) # Multiple assignment\n" -"Module(\n" -" body=[\n" -" Assign(\n" -" targets=[\n" -" Name(id='a', ctx=Store()),\n" -" Name(id='b', ctx=Store())],\n" -" value=Constant(value=1))])\n" -"\n" -">>> print(ast.dump(ast.parse('a,b = c'), indent=4)) # Unpacking\n" -"Module(\n" -" body=[\n" -" Assign(\n" -" targets=[\n" -" Tuple(\n" -" elts=[\n" -" Name(id='a', ctx=Store()),\n" -" Name(id='b', ctx=Store())],\n" -" ctx=Store())],\n" -" value=Name(id='c', ctx=Load()))])" -msgstr "" - -#: ../../library/ast.rst:896 +#: ../../library/ast.rst:781 msgid "" "An assignment with a type annotation. ``target`` is a single node and can be " -"a :class:`Name`, an :class:`Attribute` or a :class:`Subscript`. " +"a :class:`Name`, a :class:`Attribute` or a :class:`Subscript`. " "``annotation`` is the annotation, such as a :class:`Constant` or :class:" -"`Name` node. ``value`` is a single optional node." -msgstr "" - -#: ../../library/ast.rst:901 -msgid "" -"``simple`` is always either 0 (indicating a \"complex\" target) or 1 " -"(indicating a \"simple\" target). A \"simple\" target consists solely of a :" -"class:`Name` node that does not appear between parentheses; all other " -"targets are considered complex. Only simple targets appear in the :attr:" -"`~object.__annotations__` dictionary of modules and classes." -msgstr "" - -#: ../../library/ast.rst:907 -msgid "" -">>> print(ast.dump(ast.parse('c: int'), indent=4))\n" -"Module(\n" -" body=[\n" -" AnnAssign(\n" -" target=Name(id='c', ctx=Store()),\n" -" annotation=Name(id='int', ctx=Load()),\n" -" simple=1)])\n" -"\n" -">>> print(ast.dump(ast.parse('(a): int = 1'), indent=4)) # Annotation with " -"parenthesis\n" -"Module(\n" -" body=[\n" -" AnnAssign(\n" -" target=Name(id='a', ctx=Store()),\n" -" annotation=Name(id='int', ctx=Load()),\n" -" value=Constant(value=1),\n" -" simple=0)])\n" -"\n" -">>> print(ast.dump(ast.parse('a.b: int'), indent=4)) # Attribute annotation\n" -"Module(\n" -" body=[\n" -" AnnAssign(\n" -" target=Attribute(\n" -" value=Name(id='a', ctx=Load()),\n" -" attr='b',\n" -" ctx=Store()),\n" -" annotation=Name(id='int', ctx=Load()),\n" -" simple=0)])\n" -"\n" -">>> print(ast.dump(ast.parse('a[1]: int'), indent=4)) # Subscript " -"annotation\n" -"Module(\n" -" body=[\n" -" AnnAssign(\n" -" target=Subscript(\n" -" value=Name(id='a', ctx=Load()),\n" -" slice=Constant(value=1),\n" -" ctx=Store()),\n" -" annotation=Name(id='int', ctx=Load()),\n" -" simple=0)])" -msgstr "" - -#: ../../library/ast.rst:951 +"`Name` node. ``value`` is a single optional node. ``simple`` is a boolean " +"integer set to True for a :class:`Name` node in ``target`` that do not " +"appear in between parenthesis and are hence pure names and not expressions." +msgstr "" +"型アノテーションを伴う代入です。 ``target`` は単一のノードで、 :class:" +"`Name`, :class:`Attribute` または :class:`Subscript` のいずれかです。 " +"``annotation`` は :class:`Constant` や :class:`Name` node のようなアノテー" +"ションです。 ``value`` はオプションで、代入する値を単一のノードであらわしたも" +"のです。 ``simple`` 真偽値と解釈される整数で、 ``target`` の :class:`Name` " +"ノードが丸かっこに囲まれておらず、したがって式ではなく純粋な名前である場合に " +"True を設定します。" + +#: ../../library/ast.rst:836 msgid "" "Augmented assignment, such as ``a += 1``. In the following example, " "``target`` is a :class:`Name` node for ``x`` (with the :class:`Store` " @@ -1388,26 +652,13 @@ msgstr "" "``op`` は :class:`Add` 演算子、そして ``value`` は定数1をあらわす :class:" "`Constant` ノードです。" -#: ../../library/ast.rst:956 +#: ../../library/ast.rst:841 msgid "" -"The ``target`` attribute cannot be of class :class:`Tuple` or :class:`List`, " +"The ``target`` attribute connot be of class :class:`Tuple` or :class:`List`, " "unlike the targets of :class:`Assign`." msgstr "" -":class:`Assign` と異なり、 ``target`` 属性は class :class:`Tuple` や :class:" -"`List` であってはいけません。" - -#: ../../library/ast.rst:959 -msgid "" -">>> print(ast.dump(ast.parse('x += 2'), indent=4))\n" -"Module(\n" -" body=[\n" -" AugAssign(\n" -" target=Name(id='x', ctx=Store()),\n" -" op=Add(),\n" -" value=Constant(value=2))])" -msgstr "" -#: ../../library/ast.rst:972 +#: ../../library/ast.rst:858 msgid "" "A ``raise`` statement. ``exc`` is the exception object to be raised, " "normally a :class:`Call` or :class:`Name`, or ``None`` for a standalone " @@ -1418,17 +669,7 @@ msgstr "" "指定します。 ``cause`` はオプションで、 ``raise x from y`` の ``y`` にあたり" "ます。" -#: ../../library/ast.rst:976 -msgid "" -">>> print(ast.dump(ast.parse('raise x from y'), indent=4))\n" -"Module(\n" -" body=[\n" -" Raise(\n" -" exc=Name(id='x', ctx=Load()),\n" -" cause=Name(id='y', ctx=Load()))])" -msgstr "" - -#: ../../library/ast.rst:988 +#: ../../library/ast.rst:875 msgid "" "An assertion. ``test`` holds the condition, such as a :class:`Compare` node. " "``msg`` holds the failure message." @@ -1436,17 +677,7 @@ msgstr "" "アサーションです。 ``test`` は :class:`Compare` ノードなどのような条件を保持" "します。 ``msg`` は失敗した時のメッセージを保持します。" -#: ../../library/ast.rst:991 -msgid "" -">>> print(ast.dump(ast.parse('assert x,y'), indent=4))\n" -"Module(\n" -" body=[\n" -" Assert(\n" -" test=Name(id='x', ctx=Load()),\n" -" msg=Name(id='y', ctx=Load()))])" -msgstr "" - -#: ../../library/ast.rst:1003 +#: ../../library/ast.rst:891 msgid "" "Represents a ``del`` statement. ``targets`` is a list of nodes, such as :" "class:`Name`, :class:`Attribute` or :class:`Subscript` nodes." @@ -1454,76 +685,26 @@ msgstr "" "``del`` 文をあらわします。 ``targets`` は :class:`Name`, :class:" "`Attribute`, :class:`Subscript` などのノードのリストです。" -#: ../../library/ast.rst:1006 -msgid "" -">>> print(ast.dump(ast.parse('del x,y,z'), indent=4))\n" -"Module(\n" -" body=[\n" -" Delete(\n" -" targets=[\n" -" Name(id='x', ctx=Del()),\n" -" Name(id='y', ctx=Del()),\n" -" Name(id='z', ctx=Del())])])" -msgstr "" - -#: ../../library/ast.rst:1020 +#: ../../library/ast.rst:909 msgid "A ``pass`` statement." msgstr "``pass`` 文をあらわします。" -#: ../../library/ast.rst:1022 -msgid "" -">>> print(ast.dump(ast.parse('pass'), indent=4))\n" -"Module(\n" -" body=[\n" -" Pass()])" -msgstr "" - -#: ../../library/ast.rst:1032 -msgid "" -"A :ref:`type alias ` created through the :keyword:`type` " -"statement. ``name`` is the name of the alias, ``type_params`` is a list of :" -"ref:`type parameters `, and ``value`` is the value of the " -"type alias." -msgstr "" - -#: ../../library/ast.rst:1037 -msgid "" -">>> print(ast.dump(ast.parse('type Alias = int'), indent=4))\n" -"Module(\n" -" body=[\n" -" TypeAlias(\n" -" name=Name(id='Alias', ctx=Store()),\n" -" value=Name(id='int', ctx=Load()))])" -msgstr "" - -#: ../../library/ast.rst:1048 +#: ../../library/ast.rst:920 msgid "" "Other statements which are only applicable inside functions or loops are " "described in other sections." msgstr "" "関数またはループの内部でのみ適用可能な他の文は、別のセクションで説明します。" -#: ../../library/ast.rst:1052 +#: ../../library/ast.rst:924 msgid "Imports" msgstr "インポート" -#: ../../library/ast.rst:1056 +#: ../../library/ast.rst:928 msgid "An import statement. ``names`` is a list of :class:`alias` nodes." msgstr "インポート文です。 ``names`` は :class:`alias` ノードのリストです。" -#: ../../library/ast.rst:1058 -msgid "" -">>> print(ast.dump(ast.parse('import x,y,z'), indent=4))\n" -"Module(\n" -" body=[\n" -" Import(\n" -" names=[\n" -" alias(name='x'),\n" -" alias(name='y'),\n" -" alias(name='z')])])" -msgstr "" - -#: ../../library/ast.rst:1072 +#: ../../library/ast.rst:945 msgid "" "Represents ``from x import y``. ``module`` is a raw string of the 'from' " "name, without any leading dots, or ``None`` for statements such as ``from . " @@ -1535,21 +716,7 @@ msgstr "" "のような構文の場合は ``None`` を指定します。 ``level`` は相対インポートのレベ" "ルを表す整数を保持します (0 は絶対インポートを意味します)。" -#: ../../library/ast.rst:1077 -msgid "" -">>> print(ast.dump(ast.parse('from y import x,y,z'), indent=4))\n" -"Module(\n" -" body=[\n" -" ImportFrom(\n" -" module='y',\n" -" names=[\n" -" alias(name='x'),\n" -" alias(name='y'),\n" -" alias(name='z')],\n" -" level=0)])" -msgstr "" - -#: ../../library/ast.rst:1093 +#: ../../library/ast.rst:967 msgid "" "Both parameters are raw strings of the names. ``asname`` can be ``None`` if " "the regular name is to be used." @@ -1557,24 +724,11 @@ msgstr "" "いずれのパラメータも名前をあらわす生の文字列です。 ``asname`` は標準の名前を" "使う場合は ``None`` を指定できます。" -#: ../../library/ast.rst:1096 -msgid "" -">>> print(ast.dump(ast.parse('from ..foo.bar import a as b, c'), indent=4))\n" -"Module(\n" -" body=[\n" -" ImportFrom(\n" -" module='foo.bar',\n" -" names=[\n" -" alias(name='a', asname='b'),\n" -" alias(name='c')],\n" -" level=2)])" -msgstr "" - -#: ../../library/ast.rst:1109 +#: ../../library/ast.rst:984 msgid "Control flow" msgstr "制御フロー" -#: ../../library/ast.rst:1112 +#: ../../library/ast.rst:987 msgid "" "Optional clauses such as ``else`` are stored as an empty list if they're not " "present." @@ -1582,7 +736,7 @@ msgstr "" "``else`` 節のようなオプションの節が存在しない場合は、空のリストとして保存され" "ます。" -#: ../../library/ast.rst:1117 +#: ../../library/ast.rst:992 msgid "" "An ``if`` statement. ``test`` holds a single node, such as a :class:" "`Compare` node. ``body`` and ``orelse`` each hold a list of nodes." @@ -1590,7 +744,7 @@ msgstr "" "``if`` 文です。 ``test`` は :class:`Compare` ノードなどの単一のノードを保持し" "ます。 ``body`` と ``orelse`` はそれぞれノードのリストを保持します。" -#: ../../library/ast.rst:1120 +#: ../../library/ast.rst:995 msgid "" "``elif`` clauses don't have a special representation in the AST, but rather " "appear as extra :class:`If` nodes within the ``orelse`` section of the " @@ -1599,66 +753,22 @@ msgstr "" "``elif`` 節は AST において固有の表現を持たず、先行する節をあらわすノードの " "``orelse`` セクションに追加の :class:`If` ノードとして現れます。" -#: ../../library/ast.rst:1124 -msgid "" -">>> print(ast.dump(ast.parse(\"\"\"\n" -"... if x:\n" -"... ...\n" -"... elif y:\n" -"... ...\n" -"... else:\n" -"... ...\n" -"... \"\"\"), indent=4))\n" -"Module(\n" -" body=[\n" -" If(\n" -" test=Name(id='x', ctx=Load()),\n" -" body=[\n" -" Expr(\n" -" value=Constant(value=Ellipsis))],\n" -" orelse=[\n" -" If(\n" -" test=Name(id='y', ctx=Load()),\n" -" body=[\n" -" Expr(\n" -" value=Constant(value=Ellipsis))],\n" -" orelse=[\n" -" Expr(\n" -" value=Constant(value=Ellipsis))])])])" -msgstr "" - -#: ../../library/ast.rst:1154 +#: ../../library/ast.rst:1030 msgid "" "A ``for`` loop. ``target`` holds the variable(s) the loop assigns to, as a " -"single :class:`Name`, :class:`Tuple`, :class:`List`, :class:`Attribute` or :" -"class:`Subscript` node. ``iter`` holds the item to be looped over, again as " -"a single node. ``body`` and ``orelse`` contain lists of nodes to execute. " -"Those in ``orelse`` are executed if the loop finishes normally, rather than " -"via a ``break`` statement." -msgstr "" - -#: ../../library/ast.rst:1165 -msgid "" -">>> print(ast.dump(ast.parse(\"\"\"\n" -"... for x in y:\n" -"... ...\n" -"... else:\n" -"... ...\n" -"... \"\"\"), indent=4))\n" -"Module(\n" -" body=[\n" -" For(\n" -" target=Name(id='x', ctx=Store()),\n" -" iter=Name(id='y', ctx=Load()),\n" -" body=[\n" -" Expr(\n" -" value=Constant(value=Ellipsis))],\n" -" orelse=[\n" -" Expr(\n" -" value=Constant(value=Ellipsis))])])" -msgstr "" - -#: ../../library/ast.rst:1188 +"single :class:`Name`, :class:`Tuple` or :class:`List` node. ``iter`` holds " +"the item to be looped over, again as a single node. ``body`` and ``orelse`` " +"contain lists of nodes to execute. Those in ``orelse`` are executed if the " +"loop finishes normally, rather than via a ``break`` statement." +msgstr "" +"``for`` ループです。 ``target`` はループが割り当てる単一または複数の変数を :" +"class:`Name`, :class:`Tuple` または :class:`List` のいずれかを単一のノードで" +"保持します。 ``iter`` はループ対象の変数を、同じく単一のノードで保持します。 " +"``body`` と ``orelse`` は実行するノードのリストを含んでいます。 ``orelse`` に" +"含まれるノードは、ループが ``break`` 文によって中断せず、正常終了した場合に実" +"行されます。" + +#: ../../library/ast.rst:1064 msgid "" "A ``while`` loop. ``test`` holds the condition, such as a :class:`Compare` " "node." @@ -1666,60 +776,11 @@ msgstr "" "``while`` ループです。 ``test`` は :class:`Compare` のような条件をあらわす" "ノードを保持します。" -#: ../../library/ast.rst:1191 -msgid "" -">>> print(ast.dump(ast.parse(\"\"\"\n" -"... while x:\n" -"... ...\n" -"... else:\n" -"... ...\n" -"... \"\"\"), indent=4))\n" -"Module(\n" -" body=[\n" -" While(\n" -" test=Name(id='x', ctx=Load()),\n" -" body=[\n" -" Expr(\n" -" value=Constant(value=Ellipsis))],\n" -" orelse=[\n" -" Expr(\n" -" value=Constant(value=Ellipsis))])])" -msgstr "" - -#: ../../library/ast.rst:1214 +#: ../../library/ast.rst:1091 msgid "The ``break`` and ``continue`` statements." msgstr "``break`` 文および ``continue`` 文です。" -#: ../../library/ast.rst:1216 -msgid "" -">>> print(ast.dump(ast.parse(\"\"\"\\\n" -"... for a in b:\n" -"... if a > 5:\n" -"... break\n" -"... else:\n" -"... continue\n" -"...\n" -"... \"\"\"), indent=4))\n" -"Module(\n" -" body=[\n" -" For(\n" -" target=Name(id='a', ctx=Store()),\n" -" iter=Name(id='b', ctx=Load()),\n" -" body=[\n" -" If(\n" -" test=Compare(\n" -" left=Name(id='a', ctx=Load()),\n" -" ops=[\n" -" Gt()],\n" -" comparators=[\n" -" Constant(value=5)]),\n" -" body=[\n" -" Break()],\n" -" orelse=[\n" -" Continue()])])])" -msgstr "" - -#: ../../library/ast.rst:1247 +#: ../../library/ast.rst:1126 msgid "" "``try`` blocks. All attributes are list of nodes to execute, except for " "``handlers``, which is a list of :class:`ExceptHandler` nodes." @@ -1727,76 +788,7 @@ msgstr "" "``try`` ブロックです。 :class:`ExceptHandler` ノードのリストである " "``handlers`` を除き、全ての属性はそれぞれの節で実行するノードのリストです。" -#: ../../library/ast.rst:1250 -msgid "" -">>> print(ast.dump(ast.parse(\"\"\"\n" -"... try:\n" -"... ...\n" -"... except Exception:\n" -"... ...\n" -"... except OtherException as e:\n" -"... ...\n" -"... else:\n" -"... ...\n" -"... finally:\n" -"... ...\n" -"... \"\"\"), indent=4))\n" -"Module(\n" -" body=[\n" -" Try(\n" -" body=[\n" -" Expr(\n" -" value=Constant(value=Ellipsis))],\n" -" handlers=[\n" -" ExceptHandler(\n" -" type=Name(id='Exception', ctx=Load()),\n" -" body=[\n" -" Expr(\n" -" value=Constant(value=Ellipsis))]),\n" -" ExceptHandler(\n" -" type=Name(id='OtherException', ctx=Load()),\n" -" name='e',\n" -" body=[\n" -" Expr(\n" -" value=Constant(value=Ellipsis))])],\n" -" orelse=[\n" -" Expr(\n" -" value=Constant(value=Ellipsis))],\n" -" finalbody=[\n" -" Expr(\n" -" value=Constant(value=Ellipsis))])])" -msgstr "" - -#: ../../library/ast.rst:1292 -msgid "" -"``try`` blocks which are followed by ``except*`` clauses. The attributes are " -"the same as for :class:`Try` but the :class:`ExceptHandler` nodes in " -"``handlers`` are interpreted as ``except*`` blocks rather then ``except``." -msgstr "" - -#: ../../library/ast.rst:1296 -msgid "" -">>> print(ast.dump(ast.parse(\"\"\"\n" -"... try:\n" -"... ...\n" -"... except* Exception:\n" -"... ...\n" -"... \"\"\"), indent=4))\n" -"Module(\n" -" body=[\n" -" TryStar(\n" -" body=[\n" -" Expr(\n" -" value=Constant(value=Ellipsis))],\n" -" handlers=[\n" -" ExceptHandler(\n" -" type=Name(id='Exception', ctx=Load()),\n" -" body=[\n" -" Expr(\n" -" value=Constant(value=Ellipsis))])])])" -msgstr "" - -#: ../../library/ast.rst:1321 +#: ../../library/ast.rst:1172 msgid "" "A single ``except`` clause. ``type`` is the exception type it will match, " "typically a :class:`Name` node (or ``None`` for a catch-all ``except:`` " @@ -1809,31 +801,7 @@ msgstr "" "持する変数の名前をあらわす生の文字列で、 ``as foo`` を持たない節の場合は " "``None`` を指定します。 ``body`` はノードのリストです。" -#: ../../library/ast.rst:1326 -msgid "" -">>> print(ast.dump(ast.parse(\"\"\"\\\n" -"... try:\n" -"... a + 1\n" -"... except TypeError:\n" -"... pass\n" -"... \"\"\"), indent=4))\n" -"Module(\n" -" body=[\n" -" Try(\n" -" body=[\n" -" Expr(\n" -" value=BinOp(\n" -" left=Name(id='a', ctx=Load()),\n" -" op=Add(),\n" -" right=Constant(value=1)))],\n" -" handlers=[\n" -" ExceptHandler(\n" -" type=Name(id='TypeError', ctx=Load()),\n" -" body=[\n" -" Pass()])])])" -msgstr "" - -#: ../../library/ast.rst:1352 +#: ../../library/ast.rst:1206 msgid "" "A ``with`` block. ``items`` is a list of :class:`withitem` nodes " "representing the context managers, and ``body`` is the indented block inside " @@ -1843,7 +811,7 @@ msgstr "" "テキストマネージャのリストをあらわします。また ``body`` はコンテキスト内にイ" "ンデントされたブロックです。" -#: ../../library/ast.rst:1362 +#: ../../library/ast.rst:1216 msgid "" "A single context manager in a ``with`` block. ``context_expr`` is the " "context manager, often a :class:`Call` node. ``optional_vars`` is a :class:" @@ -1856,591 +824,27 @@ msgstr "" "class:`Tuple` または :class:`List` のいずれかのノードか、または、この部分が不" "要な場合は ``None`` を設定します。" -#: ../../library/ast.rst:1367 -msgid "" -">>> print(ast.dump(ast.parse(\"\"\"\\\n" -"... with a as b, c as d:\n" -"... something(b, d)\n" -"... \"\"\"), indent=4))\n" -"Module(\n" -" body=[\n" -" With(\n" -" items=[\n" -" withitem(\n" -" context_expr=Name(id='a', ctx=Load()),\n" -" optional_vars=Name(id='b', ctx=Store())),\n" -" withitem(\n" -" context_expr=Name(id='c', ctx=Load()),\n" -" optional_vars=Name(id='d', ctx=Store()))],\n" -" body=[\n" -" Expr(\n" -" value=Call(\n" -" func=Name(id='something', ctx=Load()),\n" -" args=[\n" -" Name(id='b', ctx=Load()),\n" -" Name(id='d', ctx=Load())]))])])" -msgstr "" - -#: ../../library/ast.rst:1393 -msgid "Pattern matching" -msgstr "" - -#: ../../library/ast.rst:1398 -msgid "" -"A ``match`` statement. ``subject`` holds the subject of the match (the " -"object that is being matched against the cases) and ``cases`` contains an " -"iterable of :class:`match_case` nodes with the different cases." -msgstr "" - -#: ../../library/ast.rst:1406 -msgid "" -"A single case pattern in a ``match`` statement. ``pattern`` contains the " -"match pattern that the subject will be matched against. Note that the :class:" -"`AST` nodes produced for patterns differ from those produced for " -"expressions, even when they share the same syntax." -msgstr "" - -#: ../../library/ast.rst:1411 -msgid "" -"The ``guard`` attribute contains an expression that will be evaluated if the " -"pattern matches the subject." -msgstr "" - -#: ../../library/ast.rst:1414 -msgid "" -"``body`` contains a list of nodes to execute if the pattern matches and the " -"result of evaluating the guard expression is true." -msgstr "" - -#: ../../library/ast.rst:1417 -msgid "" -">>> print(ast.dump(ast.parse(\"\"\"\n" -"... match x:\n" -"... case [x] if x>0:\n" -"... ...\n" -"... case tuple():\n" -"... ...\n" -"... \"\"\"), indent=4))\n" -"Module(\n" -" body=[\n" -" Match(\n" -" subject=Name(id='x', ctx=Load()),\n" -" cases=[\n" -" match_case(\n" -" pattern=MatchSequence(\n" -" patterns=[\n" -" MatchAs(name='x')]),\n" -" guard=Compare(\n" -" left=Name(id='x', ctx=Load()),\n" -" ops=[\n" -" Gt()],\n" -" comparators=[\n" -" Constant(value=0)]),\n" -" body=[\n" -" Expr(\n" -" value=Constant(value=Ellipsis))]),\n" -" match_case(\n" -" pattern=MatchClass(\n" -" cls=Name(id='tuple', ctx=Load())),\n" -" body=[\n" -" Expr(\n" -" value=Constant(value=Ellipsis))])])])" -msgstr "" - -#: ../../library/ast.rst:1455 -msgid "" -"A match literal or value pattern that compares by equality. ``value`` is an " -"expression node. Permitted value nodes are restricted as described in the " -"match statement documentation. This pattern succeeds if the match subject is " -"equal to the evaluated value." -msgstr "" - -#: ../../library/ast.rst:1460 -msgid "" -">>> print(ast.dump(ast.parse(\"\"\"\n" -"... match x:\n" -"... case \"Relevant\":\n" -"... ...\n" -"... \"\"\"), indent=4))\n" -"Module(\n" -" body=[\n" -" Match(\n" -" subject=Name(id='x', ctx=Load()),\n" -" cases=[\n" -" match_case(\n" -" pattern=MatchValue(\n" -" value=Constant(value='Relevant')),\n" -" body=[\n" -" Expr(\n" -" value=Constant(value=Ellipsis))])])])" -msgstr "" - -#: ../../library/ast.rst:1483 -msgid "" -"A match literal pattern that compares by identity. ``value`` is the " -"singleton to be compared against: ``None``, ``True``, or ``False``. This " -"pattern succeeds if the match subject is the given constant." -msgstr "" - -#: ../../library/ast.rst:1487 -msgid "" -">>> print(ast.dump(ast.parse(\"\"\"\n" -"... match x:\n" -"... case None:\n" -"... ...\n" -"... \"\"\"), indent=4))\n" -"Module(\n" -" body=[\n" -" Match(\n" -" subject=Name(id='x', ctx=Load()),\n" -" cases=[\n" -" match_case(\n" -" pattern=MatchSingleton(value=None),\n" -" body=[\n" -" Expr(\n" -" value=Constant(value=Ellipsis))])])])" -msgstr "" - -#: ../../library/ast.rst:1509 -msgid "" -"A match sequence pattern. ``patterns`` contains the patterns to be matched " -"against the subject elements if the subject is a sequence. Matches a " -"variable length sequence if one of the subpatterns is a ``MatchStar`` node, " -"otherwise matches a fixed length sequence." -msgstr "" - -#: ../../library/ast.rst:1514 -msgid "" -">>> print(ast.dump(ast.parse(\"\"\"\n" -"... match x:\n" -"... case [1, 2]:\n" -"... ...\n" -"... \"\"\"), indent=4))\n" -"Module(\n" -" body=[\n" -" Match(\n" -" subject=Name(id='x', ctx=Load()),\n" -" cases=[\n" -" match_case(\n" -" pattern=MatchSequence(\n" -" patterns=[\n" -" MatchValue(\n" -" value=Constant(value=1)),\n" -" MatchValue(\n" -" value=Constant(value=2))]),\n" -" body=[\n" -" Expr(\n" -" value=Constant(value=Ellipsis))])])])" -msgstr "" - -#: ../../library/ast.rst:1541 -msgid "" -"Matches the rest of the sequence in a variable length match sequence " -"pattern. If ``name`` is not ``None``, a list containing the remaining " -"sequence elements is bound to that name if the overall sequence pattern is " -"successful." -msgstr "" - -#: ../../library/ast.rst:1545 -msgid "" -">>> print(ast.dump(ast.parse(\"\"\"\n" -"... match x:\n" -"... case [1, 2, *rest]:\n" -"... ...\n" -"... case [*_]:\n" -"... ...\n" -"... \"\"\"), indent=4))\n" -"Module(\n" -" body=[\n" -" Match(\n" -" subject=Name(id='x', ctx=Load()),\n" -" cases=[\n" -" match_case(\n" -" pattern=MatchSequence(\n" -" patterns=[\n" -" MatchValue(\n" -" value=Constant(value=1)),\n" -" MatchValue(\n" -" value=Constant(value=2)),\n" -" MatchStar(name='rest')]),\n" -" body=[\n" -" Expr(\n" -" value=Constant(value=Ellipsis))]),\n" -" match_case(\n" -" pattern=MatchSequence(\n" -" patterns=[\n" -" MatchStar()]),\n" -" body=[\n" -" Expr(\n" -" value=Constant(value=Ellipsis))])])])" -msgstr "" - -#: ../../library/ast.rst:1582 -msgid "" -"A match mapping pattern. ``keys`` is a sequence of expression nodes. " -"``patterns`` is a corresponding sequence of pattern nodes. ``rest`` is an " -"optional name that can be specified to capture the remaining mapping " -"elements. Permitted key expressions are restricted as described in the match " -"statement documentation." -msgstr "" - -#: ../../library/ast.rst:1588 -msgid "" -"This pattern succeeds if the subject is a mapping, all evaluated key " -"expressions are present in the mapping, and the value corresponding to each " -"key matches the corresponding subpattern. If ``rest`` is not ``None``, a " -"dict containing the remaining mapping elements is bound to that name if the " -"overall mapping pattern is successful." -msgstr "" - -#: ../../library/ast.rst:1594 -msgid "" -">>> print(ast.dump(ast.parse(\"\"\"\n" -"... match x:\n" -"... case {1: _, 2: _}:\n" -"... ...\n" -"... case {**rest}:\n" -"... ...\n" -"... \"\"\"), indent=4))\n" -"Module(\n" -" body=[\n" -" Match(\n" -" subject=Name(id='x', ctx=Load()),\n" -" cases=[\n" -" match_case(\n" -" pattern=MatchMapping(\n" -" keys=[\n" -" Constant(value=1),\n" -" Constant(value=2)],\n" -" patterns=[\n" -" MatchAs(),\n" -" MatchAs()]),\n" -" body=[\n" -" Expr(\n" -" value=Constant(value=Ellipsis))]),\n" -" match_case(\n" -" pattern=MatchMapping(rest='rest'),\n" -" body=[\n" -" Expr(\n" -" value=Constant(value=Ellipsis))])])])" -msgstr "" - -#: ../../library/ast.rst:1629 -msgid "" -"A match class pattern. ``cls`` is an expression giving the nominal class to " -"be matched. ``patterns`` is a sequence of pattern nodes to be matched " -"against the class defined sequence of pattern matching attributes. " -"``kwd_attrs`` is a sequence of additional attributes to be matched " -"(specified as keyword arguments in the class pattern), ``kwd_patterns`` are " -"the corresponding patterns (specified as keyword values in the class " -"pattern)." -msgstr "" - -#: ../../library/ast.rst:1636 -msgid "" -"This pattern succeeds if the subject is an instance of the nominated class, " -"all positional patterns match the corresponding class-defined attributes, " -"and any specified keyword attributes match their corresponding pattern." -msgstr "" - -#: ../../library/ast.rst:1640 -msgid "" -"Note: classes may define a property that returns self in order to match a " -"pattern node against the instance being matched. Several builtin types are " -"also matched that way, as described in the match statement documentation." -msgstr "" - -#: ../../library/ast.rst:1644 -msgid "" -">>> print(ast.dump(ast.parse(\"\"\"\n" -"... match x:\n" -"... case Point2D(0, 0):\n" -"... ...\n" -"... case Point3D(x=0, y=0, z=0):\n" -"... ...\n" -"... \"\"\"), indent=4))\n" -"Module(\n" -" body=[\n" -" Match(\n" -" subject=Name(id='x', ctx=Load()),\n" -" cases=[\n" -" match_case(\n" -" pattern=MatchClass(\n" -" cls=Name(id='Point2D', ctx=Load()),\n" -" patterns=[\n" -" MatchValue(\n" -" value=Constant(value=0)),\n" -" MatchValue(\n" -" value=Constant(value=0))]),\n" -" body=[\n" -" Expr(\n" -" value=Constant(value=Ellipsis))]),\n" -" match_case(\n" -" pattern=MatchClass(\n" -" cls=Name(id='Point3D', ctx=Load()),\n" -" kwd_attrs=[\n" -" 'x',\n" -" 'y',\n" -" 'z'],\n" -" kwd_patterns=[\n" -" MatchValue(\n" -" value=Constant(value=0)),\n" -" MatchValue(\n" -" value=Constant(value=0)),\n" -" MatchValue(\n" -" value=Constant(value=0))]),\n" -" body=[\n" -" Expr(\n" -" value=Constant(value=Ellipsis))])])])" -msgstr "" - -#: ../../library/ast.rst:1691 -msgid "" -"A match \"as-pattern\", capture pattern or wildcard pattern. ``pattern`` " -"contains the match pattern that the subject will be matched against. If the " -"pattern is ``None``, the node represents a capture pattern (i.e a bare name) " -"and will always succeed." -msgstr "" - -#: ../../library/ast.rst:1696 -msgid "" -"The ``name`` attribute contains the name that will be bound if the pattern " -"is successful. If ``name`` is ``None``, ``pattern`` must also be ``None`` " -"and the node represents the wildcard pattern." -msgstr "" - -#: ../../library/ast.rst:1700 -msgid "" -">>> print(ast.dump(ast.parse(\"\"\"\n" -"... match x:\n" -"... case [x] as y:\n" -"... ...\n" -"... case _:\n" -"... ...\n" -"... \"\"\"), indent=4))\n" -"Module(\n" -" body=[\n" -" Match(\n" -" subject=Name(id='x', ctx=Load()),\n" -" cases=[\n" -" match_case(\n" -" pattern=MatchAs(\n" -" pattern=MatchSequence(\n" -" patterns=[\n" -" MatchAs(name='x')]),\n" -" name='y'),\n" -" body=[\n" -" Expr(\n" -" value=Constant(value=Ellipsis))]),\n" -" match_case(\n" -" pattern=MatchAs(),\n" -" body=[\n" -" Expr(\n" -" value=Constant(value=Ellipsis))])])])" -msgstr "" - -#: ../../library/ast.rst:1733 -msgid "" -"A match \"or-pattern\". An or-pattern matches each of its subpatterns in " -"turn to the subject, until one succeeds. The or-pattern is then deemed to " -"succeed. If none of the subpatterns succeed the or-pattern fails. The " -"``patterns`` attribute contains a list of match pattern nodes that will be " -"matched against the subject." -msgstr "" - -#: ../../library/ast.rst:1739 -msgid "" -">>> print(ast.dump(ast.parse(\"\"\"\n" -"... match x:\n" -"... case [x] | (y):\n" -"... ...\n" -"... \"\"\"), indent=4))\n" -"Module(\n" -" body=[\n" -" Match(\n" -" subject=Name(id='x', ctx=Load()),\n" -" cases=[\n" -" match_case(\n" -" pattern=MatchOr(\n" -" patterns=[\n" -" MatchSequence(\n" -" patterns=[\n" -" MatchAs(name='x')]),\n" -" MatchAs(name='y')]),\n" -" body=[\n" -" Expr(\n" -" value=Constant(value=Ellipsis))])])])" -msgstr "" - -#: ../../library/ast.rst:1766 -msgid "Type annotations" -msgstr "" - -#: ../../library/ast.rst:1770 -msgid "" -"A ``# type: ignore`` comment located at *lineno*. *tag* is the optional tag " -"specified by the form ``# type: ignore ``." -msgstr "" - -#: ../../library/ast.rst:1773 -msgid "" -">>> print(ast.dump(ast.parse('x = 1 # type: ignore', type_comments=True), " -"indent=4))\n" -"Module(\n" -" body=[\n" -" Assign(\n" -" targets=[\n" -" Name(id='x', ctx=Store())],\n" -" value=Constant(value=1))],\n" -" type_ignores=[\n" -" TypeIgnore(lineno=1, tag='')])\n" -">>> print(ast.dump(ast.parse('x: bool = 1 # type: ignore[assignment]', " -"type_comments=True), indent=4))\n" -"Module(\n" -" body=[\n" -" AnnAssign(\n" -" target=Name(id='x', ctx=Store()),\n" -" annotation=Name(id='bool', ctx=Load()),\n" -" value=Constant(value=1),\n" -" simple=1)],\n" -" type_ignores=[\n" -" TypeIgnore(lineno=1, tag='[assignment]')])" -msgstr "" - -#: ../../library/ast.rst:1796 -msgid "" -":class:`!TypeIgnore` nodes are not generated when the *type_comments* " -"parameter is set to ``False`` (default). See :func:`ast.parse` for more " -"details." -msgstr "" - -#: ../../library/ast.rst:1804 -msgid "Type parameters" -msgstr "" - -#: ../../library/ast.rst:1806 -msgid "" -":ref:`Type parameters ` can exist on classes, functions, and " -"type aliases." -msgstr "" - -#: ../../library/ast.rst:1811 -msgid "" -"A :class:`typing.TypeVar`. ``name`` is the name of the type variable. " -"``bound`` is the bound or constraints, if any. If ``bound`` is a :class:" -"`Tuple`, it represents constraints; otherwise it represents the bound. " -"``default_value`` is the default value; if the :class:`!TypeVar` has no " -"default, this attribute will be set to ``None``." -msgstr "" - -#: ../../library/ast.rst:1817 -msgid "" -">>> print(ast.dump(ast.parse(\"type Alias[T: int = bool] = list[T]\"), " -"indent=4))\n" -"Module(\n" -" body=[\n" -" TypeAlias(\n" -" name=Name(id='Alias', ctx=Store()),\n" -" type_params=[\n" -" TypeVar(\n" -" name='T',\n" -" bound=Name(id='int', ctx=Load()),\n" -" default_value=Name(id='bool', ctx=Load()))],\n" -" value=Subscript(\n" -" value=Name(id='list', ctx=Load()),\n" -" slice=Name(id='T', ctx=Load()),\n" -" ctx=Load()))])" -msgstr "" - -#: ../../library/ast.rst:1836 ../../library/ast.rst:1871 -#: ../../library/ast.rst:1903 -msgid "Added the *default_value* parameter." -msgstr "" - -#: ../../library/ast.rst:1841 -msgid "" -"A :class:`typing.ParamSpec`. ``name`` is the name of the parameter " -"specification. ``default_value`` is the default value; if the :class:`!" -"ParamSpec` has no default, this attribute will be set to ``None``." -msgstr "" - -#: ../../library/ast.rst:1845 -msgid "" -">>> print(ast.dump(ast.parse(\"type Alias[**P = [int, str]] = Callable[P, " -"int]\"), indent=4))\n" -"Module(\n" -" body=[\n" -" TypeAlias(\n" -" name=Name(id='Alias', ctx=Store()),\n" -" type_params=[\n" -" ParamSpec(\n" -" name='P',\n" -" default_value=List(\n" -" elts=[\n" -" Name(id='int', ctx=Load()),\n" -" Name(id='str', ctx=Load())],\n" -" ctx=Load()))],\n" -" value=Subscript(\n" -" value=Name(id='Callable', ctx=Load()),\n" -" slice=Tuple(\n" -" elts=[\n" -" Name(id='P', ctx=Load()),\n" -" Name(id='int', ctx=Load())],\n" -" ctx=Load()),\n" -" ctx=Load()))])" -msgstr "" - -#: ../../library/ast.rst:1876 -msgid "" -"A :class:`typing.TypeVarTuple`. ``name`` is the name of the type variable " -"tuple. ``default_value`` is the default value; if the :class:`!TypeVarTuple` " -"has no default, this attribute will be set to ``None``." -msgstr "" - -#: ../../library/ast.rst:1880 -msgid "" -">>> print(ast.dump(ast.parse(\"type Alias[*Ts = ()] = tuple[*Ts]\"), " -"indent=4))\n" -"Module(\n" -" body=[\n" -" TypeAlias(\n" -" name=Name(id='Alias', ctx=Store()),\n" -" type_params=[\n" -" TypeVarTuple(\n" -" name='Ts',\n" -" default_value=Tuple(ctx=Load()))],\n" -" value=Subscript(\n" -" value=Name(id='tuple', ctx=Load()),\n" -" slice=Tuple(\n" -" elts=[\n" -" Starred(\n" -" value=Name(id='Ts', ctx=Load()),\n" -" ctx=Load())],\n" -" ctx=Load()),\n" -" ctx=Load()))])" -msgstr "" - -#: ../../library/ast.rst:1907 +#: ../../library/ast.rst:1249 msgid "Function and class definitions" msgstr "関数およびクラス定義" -#: ../../library/ast.rst:1911 +#: ../../library/ast.rst:1253 msgid "A function definition." msgstr "関数定義です。" -#: ../../library/ast.rst:1913 +#: ../../library/ast.rst:1255 msgid "``name`` is a raw string of the function name." msgstr "``name`` は関数名をあらわす生の文字列です。" -#: ../../library/ast.rst:1914 +#: ../../library/ast.rst:1256 msgid "``args`` is an :class:`arguments` node." msgstr "``args`` は引数をあらわす :class:`arguments` ノードです。" -#: ../../library/ast.rst:1915 +#: ../../library/ast.rst:1257 msgid "``body`` is the list of nodes inside the function." msgstr "``body`` は関数の本体をあらわすノードのリストです。" -#: ../../library/ast.rst:1916 +#: ../../library/ast.rst:1258 msgid "" "``decorator_list`` is the list of decorators to be applied, stored outermost " "first (i.e. the first in the list will be applied last)." @@ -2449,20 +853,11 @@ msgstr "" "リストの先頭に保存されます (すなわち、リストの先頭にあるデコレータが最後に適" "用されます)。" -#: ../../library/ast.rst:1918 +#: ../../library/ast.rst:1260 msgid "``returns`` is the return annotation." msgstr "``returns`` は戻り値に対する注釈です。" -#: ../../library/ast.rst:1919 ../../library/ast.rst:2082 -msgid "``type_params`` is a list of :ref:`type parameters `." -msgstr "" - -#: ../../library/ast.rst:1925 ../../library/ast.rst:2109 -#: ../../library/ast.rst:2120 -msgid "Added ``type_params``." -msgstr "" - -#: ../../library/ast.rst:1931 +#: ../../library/ast.rst:1269 msgid "" "``lambda`` is a minimal function definition that can be used inside an " "expression. Unlike :class:`FunctionDef`, ``body`` holds a single node." @@ -2470,32 +865,18 @@ msgstr "" "``lambda`` は式の中で使うことができる最小限の関数定義です。 :class:" "`FunctionDef` ノードと異なり、 ``body`` は単一のノードとなります。" -#: ../../library/ast.rst:1934 -msgid "" -">>> print(ast.dump(ast.parse('lambda x,y: ...'), indent=4))\n" -"Module(\n" -" body=[\n" -" Expr(\n" -" value=Lambda(\n" -" args=arguments(\n" -" args=[\n" -" arg(arg='x'),\n" -" arg(arg='y')]),\n" -" body=Constant(value=Ellipsis)))])" -msgstr "" - -#: ../../library/ast.rst:1950 +#: ../../library/ast.rst:1293 msgid "The arguments for a function." msgstr "関数の引数" -#: ../../library/ast.rst:1952 +#: ../../library/ast.rst:1295 msgid "" "``posonlyargs``, ``args`` and ``kwonlyargs`` are lists of :class:`arg` nodes." msgstr "" "``posonlyargs``, ``args`` および ``kwonlyargs`` はそれぞれ :class:`arg` ノー" "ドのリストです。" -#: ../../library/ast.rst:1953 +#: ../../library/ast.rst:1296 msgid "" "``vararg`` and ``kwarg`` are single :class:`arg` nodes, referring to the " "``*args, **kwargs`` parameters." @@ -2503,7 +884,7 @@ msgstr "" "``vararg`` と ``kwarg`` はそれぞれ単一の :class:`arg` ノードで、 ``*args, " "**kwargs`` パラメータに相当します。" -#: ../../library/ast.rst:1955 +#: ../../library/ast.rst:1298 msgid "" "``kw_defaults`` is a list of default values for keyword-only arguments. If " "one is ``None``, the corresponding argument is required." @@ -2511,7 +892,7 @@ msgstr "" "``kw_defaults`` はキーワード専用引数に対するデフォルト値のリストです。値が " "``None`` の場合、対応する引数は必須となります。" -#: ../../library/ast.rst:1957 +#: ../../library/ast.rst:1300 msgid "" "``defaults`` is a list of default values for arguments that can be passed " "positionally. If there are fewer defaults, they correspond to the last n " @@ -2521,184 +902,88 @@ msgstr "" "です。デフォルト値の数nが位置引数の数より少ない場合、それらは最後のn個の引数" "に割り当てられます。" -#: ../../library/ast.rst:1964 +#: ../../library/ast.rst:1307 msgid "" -"A single argument in a list. ``arg`` is a raw string of the argument name; " -"``annotation`` is its annotation, such as a :class:`Name` node." +"A single argument in a list. ``arg`` is a raw string of the argument name, " +"``annotation`` is its annotation, such as a :class:`Str` or :class:`Name` " +"node." msgstr "" +"単一の引数をあらわします。 ``arg`` は引数名をあらわす生の文字列、 " +"``annotation`` は、 :class:`Str` や :class:`Name` ノードのような引数に対する" +"注釈です。" -#: ../../library/ast.rst:1969 +#: ../../library/ast.rst:1313 msgid "" "``type_comment`` is an optional string with the type annotation as a comment" msgstr "" "``type_comment`` はコメントとして型アノテーションをあらわすオプション文字列で" "す。" -#: ../../library/ast.rst:1971 -msgid "" -">>> print(ast.dump(ast.parse(\"\"\"\\\n" -"... @decorator1\n" -"... @decorator2\n" -"... def f(a: 'annotation', b=1, c=2, *d, e, f=3, **g) -> 'return " -"annotation':\n" -"... pass\n" -"... \"\"\"), indent=4))\n" -"Module(\n" -" body=[\n" -" FunctionDef(\n" -" name='f',\n" -" args=arguments(\n" -" args=[\n" -" arg(\n" -" arg='a',\n" -" annotation=Constant(value='annotation')),\n" -" arg(arg='b'),\n" -" arg(arg='c')],\n" -" vararg=arg(arg='d'),\n" -" kwonlyargs=[\n" -" arg(arg='e'),\n" -" arg(arg='f')],\n" -" kw_defaults=[\n" -" None,\n" -" Constant(value=3)],\n" -" kwarg=arg(arg='g'),\n" -" defaults=[\n" -" Constant(value=1),\n" -" Constant(value=2)]),\n" -" body=[\n" -" Pass()],\n" -" decorator_list=[\n" -" Name(id='decorator1', ctx=Load()),\n" -" Name(id='decorator2', ctx=Load())],\n" -" returns=Constant(value='return annotation'))])" -msgstr "" - -#: ../../library/ast.rst:2011 +#: ../../library/ast.rst:1357 msgid "A ``return`` statement." msgstr "``return`` 文です。" -#: ../../library/ast.rst:2013 -msgid "" -">>> print(ast.dump(ast.parse('return 4'), indent=4))\n" -"Module(\n" -" body=[\n" -" Return(\n" -" value=Constant(value=4))])" -msgstr "" - -#: ../../library/ast.rst:2025 +#: ../../library/ast.rst:1372 msgid "" "A ``yield`` or ``yield from`` expression. Because these are expressions, " -"they must be wrapped in an :class:`Expr` node if the value sent back is not " +"they must be wrapped in a :class:`Expr` node if the value sent back is not " "used." msgstr "" +"``yield`` または ``yield from`` 式をあらわします。これらは式なので、送り返さ" +"れる値が使われない場合は :class:`Expr` ノードでラップされなければなりません。" -#: ../../library/ast.rst:2028 -msgid "" -">>> print(ast.dump(ast.parse('yield x'), indent=4))\n" -"Module(\n" -" body=[\n" -" Expr(\n" -" value=Yield(\n" -" value=Name(id='x', ctx=Load())))])\n" -"\n" -">>> print(ast.dump(ast.parse('yield from x'), indent=4))\n" -"Module(\n" -" body=[\n" -" Expr(\n" -" value=YieldFrom(\n" -" value=Name(id='x', ctx=Load())))])" -msgstr "" - -#: ../../library/ast.rst:2048 +#: ../../library/ast.rst:1397 msgid "" "``global`` and ``nonlocal`` statements. ``names`` is a list of raw strings." msgstr "" "``global`` および ``nonlocal`` 文です。 ``names`` は生の文字列のリストです。" -#: ../../library/ast.rst:2050 -msgid "" -">>> print(ast.dump(ast.parse('global x,y,z'), indent=4))\n" -"Module(\n" -" body=[\n" -" Global(\n" -" names=[\n" -" 'x',\n" -" 'y',\n" -" 'z'])])\n" -"\n" -">>> print(ast.dump(ast.parse('nonlocal x,y,z'), indent=4))\n" -"Module(\n" -" body=[\n" -" Nonlocal(\n" -" names=[\n" -" 'x',\n" -" 'y',\n" -" 'z'])])" -msgstr "" - -#: ../../library/ast.rst:2073 +#: ../../library/ast.rst:1424 msgid "A class definition." msgstr "クラス定義です。" -#: ../../library/ast.rst:2075 +#: ../../library/ast.rst:1426 msgid "``name`` is a raw string for the class name" msgstr "``name`` はクラス名をあらわす生の文字列です。" -#: ../../library/ast.rst:2076 +#: ../../library/ast.rst:1427 msgid "``bases`` is a list of nodes for explicitly specified base classes." msgstr "``bases`` は明示的に指定された基底クラスをあらわすノードのリストです。" -#: ../../library/ast.rst:2077 +#: ../../library/ast.rst:1428 msgid "" -"``keywords`` is a list of :class:`.keyword` nodes, principally for " -"'metaclass'. Other keywords will be passed to the metaclass, as per :pep:" -"`3115`." +"``keywords`` is a list of :class:`keyword` nodes, principally for " +"'metaclass'. Other keywords will be passed to the metaclass, as per " +"`PEP-3115 `_." msgstr "" -#: ../../library/ast.rst:2079 +#: ../../library/ast.rst:1431 +msgid "" +"``starargs`` and ``kwargs`` are each a single node, as in a function call. " +"starargs will be expanded to join the list of base classes, and kwargs will " +"be passed to the metaclass." +msgstr "" +"``starargs`` と ``kwargs`` は、関数呼び出しの場合と同様にそれぞれ単一のノード" +"です。 starargs はベースクラスのリストと結合するために展開され、 kwargs はメ" +"タクラスに渡されます。" + +#: ../../library/ast.rst:1434 msgid "" "``body`` is a list of nodes representing the code within the class " "definition." msgstr "``body`` はクラス定義に含まれるコードをあらわすノードのリストです。" -#: ../../library/ast.rst:2081 +#: ../../library/ast.rst:1436 msgid "``decorator_list`` is a list of nodes, as in :class:`FunctionDef`." msgstr "" "``decorator_list`` はノードのリストで、関数定義 :class:`FunctionDef` の場合と" "同様に解釈されます。" -#: ../../library/ast.rst:2084 -msgid "" -">>> print(ast.dump(ast.parse(\"\"\"\\\n" -"... @decorator1\n" -"... @decorator2\n" -"... class Foo(base1, base2, metaclass=meta):\n" -"... pass\n" -"... \"\"\"), indent=4))\n" -"Module(\n" -" body=[\n" -" ClassDef(\n" -" name='Foo',\n" -" bases=[\n" -" Name(id='base1', ctx=Load()),\n" -" Name(id='base2', ctx=Load())],\n" -" keywords=[\n" -" keyword(\n" -" arg='metaclass',\n" -" value=Name(id='meta', ctx=Load()))],\n" -" body=[\n" -" Pass()],\n" -" decorator_list=[\n" -" Name(id='decorator1', ctx=Load()),\n" -" Name(id='decorator2', ctx=Load())])])" -msgstr "" - -#: ../../library/ast.rst:2113 +#: ../../library/ast.rst:1465 msgid "Async and await" msgstr "async と await" -#: ../../library/ast.rst:2117 +#: ../../library/ast.rst:1469 msgid "" "An ``async def`` function definition. Has the same fields as :class:" "`FunctionDef`." @@ -2706,7 +991,7 @@ msgstr "" "``async def`` 形式の関数定義です。通常の関数定義 :class:`FunctionDef` と同じ" "フィールドを持ちます。" -#: ../../library/ast.rst:2126 +#: ../../library/ast.rst:1475 msgid "" "An ``await`` expression. ``value`` is what it waits for. Only valid in the " "body of an :class:`AsyncFunctionDef`." @@ -2714,25 +999,7 @@ msgstr "" "``await`` 式をあらわします。 ``value`` は待ち受ける値です。 :class:" "`AsyncFunctionDef` の本体 (body) の中でのみ有効です。" -#: ../../library/ast.rst:2129 -msgid "" -">>> print(ast.dump(ast.parse(\"\"\"\\\n" -"... async def f():\n" -"... await other_func()\n" -"... \"\"\"), indent=4))\n" -"Module(\n" -" body=[\n" -" AsyncFunctionDef(\n" -" name='f',\n" -" args=arguments(),\n" -" body=[\n" -" Expr(\n" -" value=Await(\n" -" value=Call(\n" -" func=Name(id='other_func', ctx=Load()))))])])" -msgstr "" - -#: ../../library/ast.rst:2150 +#: ../../library/ast.rst:1508 msgid "" "``async for`` loops and ``async with`` context managers. They have the same " "fields as :class:`For` and :class:`With`, respectively. Only valid in the " @@ -2742,20 +1009,26 @@ msgstr "" "class:`For` および :class:`With` と同じフィールドを持ちます。 :class:" "`AsyncFunctionDef` の本体 (body) の中でのみ有効です。" -#: ../../library/ast.rst:2155 +#: ../../library/ast.rst:1513 msgid "" "When a string is parsed by :func:`ast.parse`, operator nodes (subclasses of :" "class:`ast.operator`, :class:`ast.unaryop`, :class:`ast.cmpop`, :class:`ast." "boolop` and :class:`ast.expr_context`) on the returned tree will be " "singletons. Changes to one will be reflected in all other occurrences of the " -"same value (for example, :class:`ast.Add`)." +"same value (e.g. :class:`ast.Add`)." msgstr "" +"文字列が :func:`ast.parse` によってパースされたとき、戻り値のツリーに含まれる" +"演算子ノード (:class:`ast.operator`, :class:`ast.unaryop`, :class:`ast." +"cmpop`, :class:`ast.boolop` および :class:`ast.expr_context` のサブクラス) は" +"シングルトンです。したがっていずれかの演算子ノードを変更すると、その変更は他" +"の全ての同じ値 (たとえば :class:`ast.Add` ノードを変更した場合はその他全て" +"の :class:`ast.Add` ノード) に反映されます。" -#: ../../library/ast.rst:2163 -msgid ":mod:`ast` helpers" -msgstr "" +#: ../../library/ast.rst:1521 +msgid ":mod:`ast` Helpers" +msgstr ":mod:`ast` ヘルパー" -#: ../../library/ast.rst:2165 +#: ../../library/ast.rst:1523 msgid "" "Apart from the node classes, the :mod:`ast` module defines these utility " "functions and classes for traversing abstract syntax trees:" @@ -2763,28 +1036,36 @@ msgstr "" "ノード・クラスの他に、 :mod:`ast` モジュールは以下のような抽象構文木をトラ" "バースするためのユーティリティ関数やクラスも定義しています:" -#: ../../library/ast.rst:2170 +#: ../../library/ast.rst:1528 msgid "" "Parse the source into an AST node. Equivalent to ``compile(source, " -"filename, mode, flags=FLAGS_VALUE, optimize=optimize)``, where " -"``FLAGS_VALUE`` is ``ast.PyCF_ONLY_AST`` if ``optimize <= 0`` and ``ast." -"PyCF_OPTIMIZED_AST`` otherwise." +"filename, mode, ast.PyCF_ONLY_AST)``." msgstr "" +"*source* を解析して AST ノードにします。``compile(source, filename, mode, " +"ast.PyCF_ONLY_AST)`` と等価です。" -#: ../../library/ast.rst:2175 +#: ../../library/ast.rst:1531 msgid "" "If ``type_comments=True`` is given, the parser is modified to check and " "return type comments as specified by :pep:`484` and :pep:`526`. This is " "equivalent to adding :data:`ast.PyCF_TYPE_COMMENTS` to the flags passed to :" -"func:`compile`. This will report syntax errors for misplaced type " +"func:`compile()`. This will report syntax errors for misplaced type " "comments. Without this flag, type comments will be ignored, and the " "``type_comment`` field on selected AST nodes will always be ``None``. In " "addition, the locations of ``# type: ignore`` comments will be returned as " "the ``type_ignores`` attribute of :class:`Module` (otherwise it is always an " "empty list)." msgstr "" +"``type_comments=True`` が与えられると、パーサは :pep:`484` および :pep:`526` " +"で規定された型コメントをチェックし、返すように修正されます。これは :data:" +"`ast.PyCF_TYPE_COMMENTS` を追加したフラグを :func:`compile()` に渡すことと等" +"価です。パーサは不適切な場所に配置された型コメントに対してシンタックスエラー" +"をレポートします。 このフラグがない場合、型コメントは無視されて AST ノードの " +"``type_comment`` フィールドは常に ``None`` になります。さらに、 ``# type: " +"ignore`` コメントの位置は :class:`Module` の ``type_ignores`` 属性として返さ" +"れます (それ以外の場合は常に空のリストになります)。" -#: ../../library/ast.rst:2185 +#: ../../library/ast.rst:1541 msgid "" "In addition, if ``mode`` is ``'func_type'``, the input syntax is modified to " "correspond to :pep:`484` \"signature type comments\", e.g. ``(str, int) -> " @@ -2794,41 +1075,22 @@ msgstr "" "-> List[str]`` のような :pep:`484` の \"シグネチャ型コメント (signature type " "comments)\" に対応するように修正されます。" -#: ../../library/ast.rst:2189 -msgid "" -"Setting ``feature_version`` to a tuple ``(major, minor)`` will result in a " -"\"best-effort\" attempt to parse using that Python version's grammar. For " -"example, setting ``feature_version=(3, 9)`` will attempt to disallow parsing " -"of :keyword:`match` statements. Currently ``major`` must equal to ``3``. The " -"lowest supported version is ``(3, 7)`` (and this may increase in future " -"Python versions); the highest is ``sys.version_info[0:2]``. \"Best-effort\" " -"attempt means there is no guarantee that the parse (or success of the parse) " -"is the same as when run on the Python version corresponding to " -"``feature_version``." -msgstr "" - -#: ../../library/ast.rst:2199 -msgid "" -"If source contains a null character (``\\0``), :exc:`ValueError` is raised." -msgstr "" - -#: ../../library/ast.rst:2202 -msgid "" -"Note that successfully parsing source code into an AST object doesn't " -"guarantee that the source code provided is valid Python code that can be " -"executed as the compilation step can raise further :exc:`SyntaxError` " -"exceptions. For instance, the source ``return 42`` generates a valid AST " -"node for a return statement, but it cannot be compiled alone (it needs to be " -"inside a function node)." -msgstr "" - -#: ../../library/ast.rst:2209 +#: ../../library/ast.rst:1545 msgid "" -"In particular, :func:`ast.parse` won't do any scoping checks, which the " -"compilation step does." +"Also, setting ``feature_version`` to a tuple ``(major, minor)`` will attempt " +"to parse using that Python version's grammar. Currently ``major`` must equal " +"to ``3``. For example, setting ``feature_version=(3, 4)`` will allow the " +"use of ``async`` and ``await`` as variable names. The lowest supported " +"version is ``(3, 4)``; the highest is ``sys.version_info[0:2]``." msgstr "" +"また、 ``feature_version`` を ``(major, minor)`` のタプルに設定すると、パーサ" +"は指定された Python バージョンの文法で構文解析を試みます。今のところ " +"``major`` は ``3`` でなければなりません。たとえば、 ``feature_version=(3, " +"4)`` と設定すると ``async`` と ``await`` を変数名として使うことが可能になりま" +"す。 サポートされている最低のバージョンは ``(3, 4)``; 最高のバージョンは " +"``sys.version_info[0:2]`` です。" -#: ../../library/ast.rst:2213 +#: ../../library/ast.rst:1553 ../../library/ast.rst:1592 msgid "" "It is possible to crash the Python interpreter with a sufficiently large/" "complex string due to stack depth limitations in Python's AST compiler." @@ -2837,19 +1099,13 @@ msgstr "" "タックの深さの限界を越えることで、 Python インタプリタをクラッシュさせること" "ができます。" -#: ../../library/ast.rst:2217 +#: ../../library/ast.rst:1557 msgid "Added ``type_comments``, ``mode='func_type'`` and ``feature_version``." msgstr "" -"``type_comments``、``mode='func_type'``、``feature_version`` が追加されまし" +"``type_comments``、``mode='func_type'``、``feature_version``が追加されまし" "た。" -#: ../../library/ast.rst:2220 -msgid "" -"The minimum supported version for ``feature_version`` is now ``(3, 7)``. The " -"``optimize`` argument was added." -msgstr "" - -#: ../../library/ast.rst:2227 +#: ../../library/ast.rst:1563 msgid "" "Unparse an :class:`ast.AST` object and generate a string with code that " "would produce an equivalent :class:`ast.AST` object if parsed back with :" @@ -2858,7 +1114,7 @@ msgstr "" ":class:`ast.AST` オブジェクトを逆に構文解析して、 :func:`ast.parse` が元の :" "class:`ast.AST` と等価なオブジェクトを生成できるような文字列を生成します。" -#: ../../library/ast.rst:2232 +#: ../../library/ast.rst:1568 msgid "" "The produced code string will not necessarily be equal to the original code " "that generated the :class:`ast.AST` object (without any compiler " @@ -2868,74 +1124,45 @@ msgstr "" "と必ずしも等価であるとは限りません (定数タプルや frozenset などに対するコンパ" "イラ最適化なしのコードです)。" -#: ../../library/ast.rst:2237 +#: ../../library/ast.rst:1573 msgid "" "Trying to unparse a highly complex expression would result with :exc:" "`RecursionError`." msgstr "" "非常に複雑な式を逆構文解析すると :exc:`RecursionError` となることがあります。" -#: ../../library/ast.rst:2245 +#: ../../library/ast.rst:1581 msgid "" -"Evaluate an expression node or a string containing only a Python literal or " -"container display. The string or node provided may only consist of the " +"Safely evaluate an expression node or a string containing a Python literal " +"or container display. The string or node provided may only consist of the " "following Python literal structures: strings, bytes, numbers, tuples, lists, " -"dicts, sets, booleans, ``None`` and ``Ellipsis``." +"dicts, sets, booleans, and ``None``." msgstr "" -"Python のリテラルやコンテナ表現のみを含む式ノードまたは文字列を評価します。与" -"えられる文字列またはノードは次の Python リテラル構造のみからなるものに限られ" -"ます: 文字列、バイト列、数、タプル、リスト、辞書、集合、ブール値、``None``、" -"``Ellipsis``。" +"式ノードまたは Python のリテラルまたはコンテナのディスプレイ表現を表す文字列" +"を安全に評価します。与えられる文字列またはノードは次のリテラルのみからなるも" +"のに限られます: 文字列、バイト列、数、タプル、リスト、辞書、集合、ブール値、 " +"``None`` 。" -#: ../../library/ast.rst:2250 +#: ../../library/ast.rst:1586 msgid "" -"This can be used for evaluating strings containing Python values without the " -"need to parse the values oneself. It is not capable of evaluating " -"arbitrarily complex expressions, for example involving operators or indexing." +"This can be used for safely evaluating strings containing Python values from " +"untrusted sources without the need to parse the values oneself. It is not " +"capable of evaluating arbitrarily complex expressions, for example involving " +"operators or indexing." msgstr "" -"この関数は Python の式を含んだ文字列を、値自身を解析することなしに評価するの" -"に使えます。この関数は、例えば演算や添え字を含んだ任意の複雑な表現を評価する" -"のには使えません。" +"この関数は Python の式を含んだ信頼出来ない出どころからの文字列を、値自身を解" +"析することなしに安全に評価するのに使えます。この関数は、例えば演算や添え字を" +"含んだ任意の複雑な表現を評価するのには使えません。" -#: ../../library/ast.rst:2255 -msgid "" -"This function had been documented as \"safe\" in the past without defining " -"what that meant. That was misleading. This is specifically designed not to " -"execute Python code, unlike the more general :func:`eval`. There is no " -"namespace, no name lookups, or ability to call out. But it is not free from " -"attack: A relatively small input can lead to memory exhaustion or to C stack " -"exhaustion, crashing the process. There is also the possibility for " -"excessive CPU consumption denial of service on some inputs. Calling it on " -"untrusted data is thus not recommended." -msgstr "" - -#: ../../library/ast.rst:2265 -msgid "" -"It is possible to crash the Python interpreter due to stack depth " -"limitations in Python's AST compiler." -msgstr "" -"Python の抽象構文木コンパイラのスタックの深さの限界を越えることで、 Python イ" -"ンタプリタをクラッシュさせる可能性があります。" - -#: ../../library/ast.rst:2268 -msgid "" -"It can raise :exc:`ValueError`, :exc:`TypeError`, :exc:`SyntaxError`, :exc:" -"`MemoryError` and :exc:`RecursionError` depending on the malformed input." -msgstr "" - -#: ../../library/ast.rst:2272 +#: ../../library/ast.rst:1596 msgid "Now allows bytes and set literals." msgstr "バイト列リテラルと集合リテラルが受け取れるようになりました。" -#: ../../library/ast.rst:2275 +#: ../../library/ast.rst:1599 msgid "Now supports creating empty sets with ``'set()'``." msgstr "``'set()'`` による空の集合の生成をサポートするようになりました。" -#: ../../library/ast.rst:2278 -msgid "For string inputs, leading spaces and tabs are now stripped." -msgstr "" - -#: ../../library/ast.rst:2284 +#: ../../library/ast.rst:1605 msgid "" "Return the docstring of the given *node* (which must be a :class:" "`FunctionDef`, :class:`AsyncFunctionDef`, :class:`ClassDef`, or :class:" @@ -2948,19 +1175,21 @@ msgstr "" "します。 *clean* が真ならば、ドキュメント文字列のインデントを :func:`inspect." "cleandoc` を用いて一掃します。" -#: ../../library/ast.rst:2290 +#: ../../library/ast.rst:1611 msgid ":class:`AsyncFunctionDef` is now supported." msgstr ":class:`AsyncFunctionDef` がサポートされました。" -#: ../../library/ast.rst:2296 +#: ../../library/ast.rst:1617 msgid "" "Get source code segment of the *source* that generated *node*. If some " -"location information (:attr:`~ast.AST.lineno`, :attr:`~ast.AST.end_lineno`, :" -"attr:`~ast.AST.col_offset`, or :attr:`~ast.AST.end_col_offset`) is missing, " -"return ``None``." +"location information (:attr:`lineno`, :attr:`end_lineno`, :attr:" +"`col_offset`, or :attr:`end_col_offset`) is missing, return ``None``." msgstr "" +"*source* のうちで *node* を生成したソースコードのセグメントを取得します。位置" +"情報 (:attr:`lineno`, :attr:`end_lineno`, :attr:`col_offset`, または :attr:" +"`end_col_offset`) が欠けている場合 ``None`` を返します。" -#: ../../library/ast.rst:2300 +#: ../../library/ast.rst:1621 msgid "" "If *padded* is ``True``, the first line of a multi-line statement will be " "padded with spaces to match its original position." @@ -2968,17 +1197,21 @@ msgstr "" "*padded* が ``True`` の場合、複数行にわたる文の最初の行が元の位置に一致するよ" "うに空白文字でパディングされます。" -#: ../../library/ast.rst:2308 +#: ../../library/ast.rst:1629 msgid "" "When you compile a node tree with :func:`compile`, the compiler expects :" -"attr:`~ast.AST.lineno` and :attr:`~ast.AST.col_offset` attributes for every " -"node that supports them. This is rather tedious to fill in for generated " -"nodes, so this helper adds these attributes recursively where not already " -"set, by setting them to the values of the parent node. It works recursively " -"starting at *node*." +"attr:`lineno` and :attr:`col_offset` attributes for every node that supports " +"them. This is rather tedious to fill in for generated nodes, so this helper " +"adds these attributes recursively where not already set, by setting them to " +"the values of the parent node. It works recursively starting at *node*." msgstr "" +":func:`compile` はノード・ツリーをコンパイルする際、 :attr:`lineno` と :attr:" +"`col_offset` 両属性をサポートする全てのノードに対しそれが存在するものと想定し" +"ます。生成されたノードに対しこれらを埋めて回るのはどちらかというと退屈な作業" +"なので、このヘルパーが再帰的に二つの属性がセットされていないものに親ノードと" +"同じ値をセットしていきます。再帰の出発点が *node* です。" -#: ../../library/ast.rst:2317 +#: ../../library/ast.rst:1638 msgid "" "Increment the line number and end line number of each node in the tree " "starting at *node* by *n*. This is useful to \"move code\" to a different " @@ -2987,14 +1220,17 @@ msgstr "" "*node* で始まるツリー内の各ノードの行番号と終了行番号を *n* ずつ増やします。" "これはファイルの中で別の場所に \"コードを移動する\" ときに便利です。" -#: ../../library/ast.rst:2324 +#: ../../library/ast.rst:1645 msgid "" -"Copy source location (:attr:`~ast.AST.lineno`, :attr:`~ast.AST.col_offset`, :" -"attr:`~ast.AST.end_lineno`, and :attr:`~ast.AST.end_col_offset`) from " -"*old_node* to *new_node* if possible, and return *new_node*." +"Copy source location (:attr:`lineno`, :attr:`col_offset`, :attr:" +"`end_lineno`, and :attr:`end_col_offset`) from *old_node* to *new_node* if " +"possible, and return *new_node*." msgstr "" +"ソースの場所 (:attr:`lineno`, :attr:`col_offset`, :attr:`end_lineno`, およ" +"び :attr:`end_col_offset`) を *old_node* から *new_node* に可能ならばコピー" +"し、 *new_node* を返します。" -#: ../../library/ast.rst:2331 +#: ../../library/ast.rst:1652 msgid "" "Yield a tuple of ``(fieldname, value)`` for each field in ``node._fields`` " "that is present on *node*." @@ -3002,7 +1238,7 @@ msgstr "" "*node* にある ``node._fields`` のそれぞれのフィールドを ``(フィールド名, " "値)`` のタプルとして yield します。" -#: ../../library/ast.rst:2337 +#: ../../library/ast.rst:1658 msgid "" "Yield all direct child nodes of *node*, that is, all fields that are nodes " "and all items of fields that are lists of nodes." @@ -3011,7 +1247,7 @@ msgstr "" "ドであるような全てのフィールドおよびノードのリストであるようなフィールドの全" "てのアイテムです。" -#: ../../library/ast.rst:2343 +#: ../../library/ast.rst:1664 msgid "" "Recursively yield all descendant nodes in the tree starting at *node* " "(including *node* itself), in no specified order. This is useful if you " @@ -3021,7 +1257,7 @@ msgstr "" "められていません。この関数はノードをその場で変更するだけで文脈を気にしないよ" "うな場合に便利です。" -#: ../../library/ast.rst:2350 +#: ../../library/ast.rst:1671 msgid "" "A node visitor base class that walks the abstract syntax tree and calls a " "visitor function for every node found. This function may return a value " @@ -3031,7 +1267,7 @@ msgstr "" "ターの基底クラスです。この関数は :meth:`visit` メソッドに送られる値を返しても" "かまいません。" -#: ../../library/ast.rst:2354 +#: ../../library/ast.rst:1675 msgid "" "This class is meant to be subclassed, with the subclass adding visitor " "methods." @@ -3039,7 +1275,7 @@ msgstr "" "このクラスはビジター・メソッドを付け加えたサブクラスを派生させることを意図し" "ています。" -#: ../../library/ast.rst:2359 +#: ../../library/ast.rst:1680 msgid "" "Visit a node. The default implementation calls the method called :samp:" "`self.visit_{classname}` where *classname* is the name of the node class, " @@ -3049,11 +1285,11 @@ msgstr "" "メソッド (ここで *classname* はノードのクラス名です) を呼び出すか、そのメソッ" "ドがなければ :meth:`generic_visit` を呼び出します。" -#: ../../library/ast.rst:2365 +#: ../../library/ast.rst:1686 msgid "This visitor calls :meth:`visit` on all children of the node." msgstr "このビジターはノードの全ての子について :meth:`visit` を呼び出します。" -#: ../../library/ast.rst:2367 +#: ../../library/ast.rst:1688 msgid "" "Note that child nodes of nodes that have a custom visitor method won't be " "visited unless the visitor calls :meth:`generic_visit` or visits them itself." @@ -3062,11 +1298,7 @@ msgstr "" "ビジターが :meth:`generic_visit` を呼び出すかそれ自身で子ノードを訪れない限り" "訪れられないということです。" -#: ../../library/ast.rst:2373 -msgid "Handles all constant nodes." -msgstr "" - -#: ../../library/ast.rst:2375 +#: ../../library/ast.rst:1692 msgid "" "Don't use the :class:`NodeVisitor` if you want to apply changes to nodes " "during traversal. For this a special visitor exists (:class:" @@ -3076,15 +1308,19 @@ msgstr "" "いけません。そうした目的のために変更を許す特別なビジター (:class:" "`NodeTransformer`) があります。" -#: ../../library/ast.rst:2381 +#: ../../library/ast.rst:1698 msgid "" -"Methods :meth:`!visit_Num`, :meth:`!visit_Str`, :meth:`!visit_Bytes`, :meth:" -"`!visit_NameConstant` and :meth:`!visit_Ellipsis` are deprecated now and " -"will not be called in future Python versions. Add the :meth:" -"`visit_Constant` method to handle all constant nodes." +"Methods :meth:`visit_Num`, :meth:`visit_Str`, :meth:`visit_Bytes`, :meth:" +"`visit_NameConstant` and :meth:`visit_Ellipsis` are deprecated now and will " +"not be called in future Python versions. Add the :meth:`visit_Constant` " +"method to handle all constant nodes." msgstr "" +":meth:`visit_Num`, :meth:`visit_Str`, :meth:`visit_Bytes`, :meth:" +"`visit_NameConstant` および :meth:`visit_Ellipsis` の各メソッドは非推奨です。" +"また将来の Python バージョンでは呼び出されなくなります。全ての定数ノードを扱" +"うには :meth:`visit_Constant` を追加してください。" -#: ../../library/ast.rst:2389 +#: ../../library/ast.rst:1706 msgid "" "A :class:`NodeVisitor` subclass that walks the abstract syntax tree and " "allows modification of nodes." @@ -3092,7 +1328,7 @@ msgstr "" ":class:`NodeVisitor` のサブクラスで抽象構文木を渡り歩きながらノードを変更する" "ことを許すものです。" -#: ../../library/ast.rst:2392 +#: ../../library/ast.rst:1709 msgid "" "The :class:`NodeTransformer` will walk the AST and use the return value of " "the visitor methods to replace or remove the old node. If the return value " @@ -3106,7 +1342,7 @@ msgstr "" "置き換えられます。置き換えない場合は戻り値が元のノードそのものであってもかま" "いません。" -#: ../../library/ast.rst:2398 +#: ../../library/ast.rst:1715 msgid "" "Here is an example transformer that rewrites all occurrences of name lookups " "(``foo``) to ``data['foo']``::" @@ -3114,26 +1350,17 @@ msgstr "" "それでは例を示しましょう。Name (たとえば ``foo``) を見つけるたび全て " "``data['foo']`` に書き換える変換器 (transformer) です::" -#: ../../library/ast.rst:2401 -msgid "" -"class RewriteName(NodeTransformer):\n" -"\n" -" def visit_Name(self, node):\n" -" return Subscript(\n" -" value=Name(id='data', ctx=Load()),\n" -" slice=Constant(value=node.id),\n" -" ctx=node.ctx\n" -" )" -msgstr "" - -#: ../../library/ast.rst:2410 +#: ../../library/ast.rst:1727 msgid "" "Keep in mind that if the node you're operating on has child nodes you must " -"either transform the child nodes yourself or call the :meth:`~ast." -"NodeVisitor.generic_visit` method for the node first." +"either transform the child nodes yourself or call the :meth:`generic_visit` " +"method for the node first." msgstr "" +"操作しようとしているノードが子ノードを持つならば、その子ノードの変形も自分で" +"行うか、またはそのノードに対し最初に :meth:`generic_visit` メソッドを呼び出す" +"か、それを行うのはあなたの責任だということを肝に銘じましょう。" -#: ../../library/ast.rst:2414 +#: ../../library/ast.rst:1731 msgid "" "For nodes that were part of a collection of statements (that applies to all " "statement nodes), the visitor may also return a list of nodes rather than " @@ -3142,29 +1369,23 @@ msgstr "" "文のコレクションであるようなノード (全ての文のノードが当てはまります) に対し" "て、このビジターは単独のノードではなくノードのリストを返すかもしれません。" -#: ../../library/ast.rst:2418 +#: ../../library/ast.rst:1735 msgid "" "If :class:`NodeTransformer` introduces new nodes (that weren't part of " -"original tree) without giving them location information (such as :attr:`~ast." -"AST.lineno`), :func:`fix_missing_locations` should be called with the new " -"sub-tree to recalculate the location information::" -msgstr "" - -#: ../../library/ast.rst:2423 -msgid "" -"tree = ast.parse('foo', mode='eval')\n" -"new_tree = fix_missing_locations(RewriteName().visit(tree))" +"original tree) without giving them location information (such as :attr:" +"`lineno`), :func:`fix_missing_locations` should be called with the new sub-" +"tree to recalculate the location information::" msgstr "" +":class:`NodeTransformer` が(たとえば、 :attr:`lineno` のような)位置情報を与え" +"ずに(元の木の一部ではなく)新しいノードを導入する場合、 :func:" +"`fix_missing_locations` を新しいサブツリーで呼び出して、位置情報を再計算する" +"必要があります。" -#: ../../library/ast.rst:2426 +#: ../../library/ast.rst:1743 msgid "Usually you use the transformer like this::" msgstr "たいてい、変換器の使い方は次のようになります::" -#: ../../library/ast.rst:2428 -msgid "node = YourTransformer().visit(node)" -msgstr "" - -#: ../../library/ast.rst:2433 +#: ../../library/ast.rst:1750 msgid "" "Return a formatted dump of the tree in *node*. This is mainly useful for " "debugging purposes. If *annotate_fields* is true (by default), the returned " @@ -3175,13 +1396,13 @@ msgid "" "true." msgstr "" "*node* 内のツリーのフォーマットされたダンプを返します。主な使い道はデバッグで" -"す。 *annotate_fields* が true の場合 (デフォルト)、返される文字列はフィール" -"ドの名前と値を示します。 *annotate_fields* が false の場合、あいまいさのない" +"す。 *annotate_fields* が(デフォルトで)trueの場合、返される文字列はフィールド" +"の名前と値を示します。 *annotate_fields* がfalseの場合、あいまいさのない" "フィールド名を省略することにより、結果文字列はよりコンパクトになります。行番" -"号や列オフセットのような属性はデフォルトではダンプされません。これが必要であ" -"れば、 *include_attributes* を true にすると表示できます。" +"号や列オフセットのような属性はデフォルトではダンプされません。これがほ欲しけ" +"れば、 *include_attributes* をtrueにセットすることができます。" -#: ../../library/ast.rst:2441 +#: ../../library/ast.rst:1758 msgid "" "If *indent* is a non-negative integer or string, then the tree will be " "pretty-printed with that indent level. An indent level of 0, negative, or " @@ -3197,53 +1418,15 @@ msgstr "" "インデントされます。 *indent* が文字列 (``\"\\t\"`` など) の場合、その文字列" "が各レベルのインデントに使われます。" -#: ../../library/ast.rst:2448 -msgid "" -"If *show_empty* is false (the default), optional empty lists will be omitted " -"from the output. Optional ``None`` values are always omitted." -msgstr "" - -#: ../../library/ast.rst:2452 +#: ../../library/ast.rst:1765 msgid "Added the *indent* option." msgstr "*indent* オプションを追加しました。" -#: ../../library/ast.rst:2455 -msgid "Added the *show_empty* option." -msgstr "" - -#: ../../library/ast.rst:2458 -msgid "" -">>> print(ast.dump(ast.parse(\"\"\"\\\n" -"... async def f():\n" -"... await other_func()\n" -"... \"\"\"), indent=4, show_empty=True))\n" -"Module(\n" -" body=[\n" -" AsyncFunctionDef(\n" -" name='f',\n" -" args=arguments(\n" -" posonlyargs=[],\n" -" args=[],\n" -" kwonlyargs=[],\n" -" kw_defaults=[],\n" -" defaults=[]),\n" -" body=[\n" -" Expr(\n" -" value=Await(\n" -" value=Call(\n" -" func=Name(id='other_func', ctx=Load()),\n" -" args=[],\n" -" keywords=[])))],\n" -" decorator_list=[],\n" -" type_params=[])],\n" -" type_ignores=[])" -msgstr "" - -#: ../../library/ast.rst:2489 -msgid "Compiler flags" -msgstr "" +#: ../../library/ast.rst:1772 +msgid "Compiler Flags" +msgstr "コンパイラフラグ" -#: ../../library/ast.rst:2491 +#: ../../library/ast.rst:1774 msgid "" "The following flags may be passed to :func:`compile` in order to change " "effects on the compilation of a program:" @@ -3251,7 +1434,7 @@ msgstr "" "以下のフラグはプログラムのコンパイルにおける効果を変更するために :func:" "`compile` に渡すことができます:" -#: ../../library/ast.rst:2496 +#: ../../library/ast.rst:1779 msgid "" "Enables support for top-level ``await``, ``async for``, ``async with`` and " "async comprehensions." @@ -3259,20 +1442,14 @@ msgstr "" "トップレベルの ``await``, ``async for``, ``async with`` および async 内包表記" "のサポートを有効化します。" -#: ../../library/ast.rst:2503 +#: ../../library/ast.rst:1786 msgid "" "Generates and returns an abstract syntax tree instead of returning a " "compiled code object." msgstr "" "コンパイルされたコードオブジェクトの代わりに抽象構文木を生成して返します。" -#: ../../library/ast.rst:2508 -msgid "" -"The returned AST is optimized according to the *optimize* argument in :func:" -"`compile` or :func:`ast.parse`." -msgstr "" - -#: ../../library/ast.rst:2515 +#: ../../library/ast.rst:1791 msgid "" "Enables support for :pep:`484` and :pep:`526` style type comments (``# type: " "``, ``# type: ignore ``)." @@ -3280,24 +1457,11 @@ msgstr "" ":pep:`484` および :pep:`526` 形式の型コメント (``# type: ``, ``# type: " "ignore ``) のサポートを有効化します。" -#: ../../library/ast.rst:2523 -msgid "Recursively compares two ASTs." -msgstr "" - -#: ../../library/ast.rst:2525 -msgid "" -"*compare_attributes* affects whether AST attributes are considered in the " -"comparison. If *compare_attributes* is ``False`` (default), then attributes " -"are ignored. Otherwise they must all be equal. This option is useful to " -"check whether the ASTs are structurally equal but differ in whitespace or " -"similar details. Attributes include line numbers and column offsets." -msgstr "" - -#: ../../library/ast.rst:2538 -msgid "Command-line usage" -msgstr "コマンドラインでの使用" +#: ../../library/ast.rst:1800 +msgid "Command-Line Usage" +msgstr "コマンドラインからの使用" -#: ../../library/ast.rst:2542 +#: ../../library/ast.rst:1804 msgid "" "The :mod:`ast` module can be executed as a script from the command line. It " "is as simple as:" @@ -3305,19 +1469,15 @@ msgstr "" ":mod:`ast` モジュールはコマンドラインからスクリプトとして実行することができま" "す。実行方法は単純です:" -#: ../../library/ast.rst:2545 -msgid "python -m ast [-m ] [-a] [infile]" -msgstr "" - -#: ../../library/ast.rst:2549 +#: ../../library/ast.rst:1811 msgid "The following options are accepted:" msgstr "以下のオプションが使用できます:" -#: ../../library/ast.rst:2555 +#: ../../library/ast.rst:1817 msgid "Show the help message and exit." msgstr "ヘルプメッセージを表示して終了します。" -#: ../../library/ast.rst:2560 +#: ../../library/ast.rst:1822 msgid "" "Specify what kind of code must be compiled, like the *mode* argument in :" "func:`parse`." @@ -3325,35 +1485,19 @@ msgstr "" ":func:`parse` 関数の *mode* 引数と同様、コンパイルするコードの種類を指定しま" "す。" -#: ../../library/ast.rst:2565 +#: ../../library/ast.rst:1827 msgid "Don't parse type comments." msgstr "型コメントをパースしません。" -#: ../../library/ast.rst:2569 +#: ../../library/ast.rst:1831 msgid "Include attributes such as line numbers and column offsets." msgstr "行番号や列オフセットなどの属性を含めます。" -#: ../../library/ast.rst:2574 +#: ../../library/ast.rst:1836 msgid "Indentation of nodes in AST (number of spaces)." msgstr "AST におけるノードのインデント (空白の数) です。" -#: ../../library/ast.rst:2578 -msgid "" -"Python version in the format 3.x (for example, 3.10). Defaults to the " -"current version of the interpreter." -msgstr "" - -#: ../../library/ast.rst:2586 -msgid "Optimization level for parser. Defaults to no optimization." -msgstr "" - -#: ../../library/ast.rst:2592 -msgid "" -"Show empty lists and fields that are ``None``. Defaults to not showing empty " -"objects." -msgstr "" - -#: ../../library/ast.rst:2598 +#: ../../library/ast.rst:1838 msgid "" "If :file:`infile` is specified its contents are parsed to AST and dumped to " "stdout. Otherwise, the content is read from stdin." @@ -3361,7 +1505,7 @@ msgstr "" ":file:`infile` を指定するとその内容が AST にパースされて標準出力に出力されま" "す。そうでない場合は標準入力から入力を読み込みます。" -#: ../../library/ast.rst:2604 +#: ../../library/ast.rst:1844 msgid "" "`Green Tree Snakes `_, an external " "documentation resource, has good details on working with Python ASTs." @@ -3369,7 +1513,7 @@ msgstr "" "外部ドキュメント `Green Tree Snakes `_ には Python AST についての詳細が書かれています。" -#: ../../library/ast.rst:2607 +#: ../../library/ast.rst:1847 msgid "" "`ASTTokens `_ " "annotates Python ASTs with the positions of tokens and text in the source " @@ -3380,14 +1524,14 @@ msgstr "" "Python AST を、生成元のソースコードのトークン位置やテキストで注解します。これ" "はソースコード変換を行うツールで有用です。 " -#: ../../library/ast.rst:2612 +#: ../../library/ast.rst:1852 msgid "" -"`leoAst.py `_ unifies the token-based and parse-tree-based views of python programs " -"by inserting two-way links between tokens and ast nodes." +"`leoAst.py `_ unifies the " +"token-based and parse-tree-based views of python programs by inserting two-" +"way links between tokens and ast nodes." msgstr "" -#: ../../library/ast.rst:2617 +#: ../../library/ast.rst:1856 msgid "" "`LibCST `_ parses code as a Concrete Syntax " "Tree that looks like an ast tree and keeps all formatting details. It's " @@ -3398,22 +1542,14 @@ msgstr "" "は自動リファクタリングアプリケーション (codemod) やリンタを作成する際に有用で" "す。" -#: ../../library/ast.rst:2622 +#: ../../library/ast.rst:1861 msgid "" "`Parso `_ is a Python parser that supports " "error recovery and round-trip parsing for different Python versions (in " "multiple Python versions). Parso is also able to list multiple syntax errors " -"in your Python file." +"in your python file." msgstr "" - -#: ../../library/ast.rst:59 -msgid "? (question mark)" -msgstr "? (クエスチョンマーク)" - -#: ../../library/ast.rst:59 ../../library/ast.rst:60 -msgid "in AST grammar" -msgstr "" - -#: ../../library/ast.rst:60 -msgid "* (asterisk)" -msgstr "* (アスタリスク)" +"`Parso `_ はエラーリカバリや異なる Python バー" +"ジョン (複数の Python バージョン) での復元可能なパース (round-trip parsing) " +"をサポートします。また、 Parso は Python ファイル内の複数の文法エラーをリスト" +"することもできます。" diff --git a/library/asynchat.po b/library/asynchat.po index 6c43f32ba..c4108350b 100644 --- a/library/asynchat.po +++ b/library/asynchat.po @@ -1,40 +1,310 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # +# Translators: +# Yusuke Miyazaki , 2017 +# 秘湯 , 2017 +# Arihiro TAKASE, 2017 +# Inada Naoki , 2017 +# Takanori Suzuki , 2021 +# #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-13 14:21+0000\n" -"PO-Revision-Date: 2024-11-19 01:02+0000\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 17:48+0000\n" +"Last-Translator: Takanori Suzuki , 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/asynchat.rst:2 -msgid ":mod:`!asynchat` --- Asynchronous socket command/response handler" -msgstr "" +msgid ":mod:`asynchat` --- Asynchronous socket command/response handler" +msgstr ":mod:`asynchat` --- 非同期ソケットコマンド/レスポンスハンドラ" #: ../../library/asynchat.rst:10 +msgid "**Source code:** :source:`Lib/asynchat.py`" +msgstr "**ソースコード:** :source:`Lib/asynchat.py`" + +#: ../../library/asynchat.rst:12 +msgid "Please use :mod:`asyncio` instead." +msgstr "代わりに :mod:`asyncio` を使ってください。" + +#: ../../library/asynchat.rst:19 +msgid "" +"This module exists for backwards compatibility only. For new code we " +"recommend using :mod:`asyncio`." +msgstr "" +"このモジュールは後方互換性のためだけに存在します。新しいコードでは :mod:" +"`asyncio` を利用することを推奨します。" + +#: ../../library/asynchat.rst:22 +msgid "" +"This module builds on the :mod:`asyncore` infrastructure, simplifying " +"asynchronous clients and servers and making it easier to handle protocols " +"whose elements are terminated by arbitrary strings, or are of variable " +"length. :mod:`asynchat` defines the abstract class :class:`async_chat` that " +"you subclass, providing implementations of the :meth:`collect_incoming_data` " +"and :meth:`found_terminator` methods. It uses the same asynchronous loop as :" +"mod:`asyncore`, and the two types of channel, :class:`asyncore.dispatcher` " +"and :class:`asynchat.async_chat`, can freely be mixed in the channel map. " +"Typically an :class:`asyncore.dispatcher` server channel generates new :" +"class:`asynchat.async_chat` channel objects as it receives incoming " +"connection requests." +msgstr "" +":mod:`asynchat` を使うと、 :mod:`asyncore` を基盤とした非同期なサーバ・クライ" +"アントをより簡単に開発する事ができます。 :mod:`asynchat` では、プロトコルの要" +"素が任意の文字列で終了するか、または可変長の文字列であるようなプロトコルを容" +"易に制御できるようになっています。 :mod:`asynchat` は、抽象クラス :class:" +"`async_chat` を定義しており、 :class:`async_chat` を継承して :meth:" +"`collect_incoming_data` メソッドと :meth:`found_terminator` メソッドを実装す" +"れば使うことができます。 :class:`async_chat` と :mod:`asyncore` は同じ非同期" +"ループを使用しており、 :class:`asyncore.dispatcher` も :class:`asynchat." +"async_chat` も同じチャネルマップに登録する事ができます。通常、 :class:" +"`asyncore.dispatcher` はサーバチャネルとして使用し、リクエストの受け付け時" +"に :class:`asynchat.async_chat` オブジェクトを生成します。" + +#: ../../library/asynchat.rst:37 +msgid "" +"This class is an abstract subclass of :class:`asyncore.dispatcher`. To make " +"practical use of the code you must subclass :class:`async_chat`, providing " +"meaningful :meth:`collect_incoming_data` and :meth:`found_terminator` " +"methods. The :class:`asyncore.dispatcher` methods can be used, although not " +"all make sense in a message/response context." +msgstr "" +"このクラスは、 :class:`asyncore.dispatcher` から継承した抽象クラスです。使用" +"する際には :class:`async_chat` のサブクラスを作成し、 :meth:" +"`collect_incoming_data` と :meth:`found_terminator` を定義しなければなりませ" +"ん。 :class:`asyncore.dispatcher` のメソッドを使用する事もできますが、メッ" +"セージ/レスポンス処理を中心に行う場合には使えないメソッドもあります。" + +#: ../../library/asynchat.rst:44 +msgid "" +"Like :class:`asyncore.dispatcher`, :class:`async_chat` defines a set of " +"events that are generated by an analysis of socket conditions after a :c:" +"func:`select` call. Once the polling loop has been started the :class:" +"`async_chat` object's methods are called by the event-processing framework " +"with no action on the part of the programmer." +msgstr "" +":class:`asyncore.dispatcher` と同様に、 :class:`async_chat` も :c:func:" +"`select` 呼出し後のソケットの状態からイベントを生成します。ポーリングループ開" +"始後、イベント処理フレームワークが自動的に :class:`async_chat` のメソッドを呼" +"び出しますので、プログラマが処理を記述する必要はありません。" + +#: ../../library/asynchat.rst:50 +msgid "" +"Two class attributes can be modified, to improve performance, or possibly " +"even to conserve memory." +msgstr "" +"パフォーマンスの向上やメモリの節約のために、2つのクラス属性を調整することがで" +"きます。" + +#: ../../library/asynchat.rst:56 +msgid "The asynchronous input buffer size (default ``4096``)." +msgstr "非同期入力バッファサイズ (デフォルト値: ``4096``)。" + +#: ../../library/asynchat.rst:61 +msgid "The asynchronous output buffer size (default ``4096``)." +msgstr "非同期出力バッファサイズ (デフォルト値: ``4096``)。" + +#: ../../library/asynchat.rst:63 +msgid "" +"Unlike :class:`asyncore.dispatcher`, :class:`async_chat` allows you to " +"define a :abbr:`FIFO (first-in, first-out)` queue of *producers*. A producer " +"need have only one method, :meth:`more`, which should return data to be " +"transmitted on the channel. The producer indicates exhaustion (*i.e.* that " +"it contains no more data) by having its :meth:`more` method return the empty " +"bytes object. At this point the :class:`async_chat` object removes the " +"producer from the queue and starts using the next producer, if any. When the " +"producer queue is empty the :meth:`handle_write` method does nothing. You " +"use the channel object's :meth:`set_terminator` method to describe how to " +"recognize the end of, or an important breakpoint in, an incoming " +"transmission from the remote endpoint." +msgstr "" +":class:`asyncore.dispatcher` と違い、 :class:`async_chat` では *producer* " +"の :abbr:`FIFO (first-in, first-out)` キューを作成する事ができます。producer" +"は :meth:`more` メソッドを必ず持ち、このメソッドでチャネル上に送出するデータ" +"を返します。producerが枯渇状態 (*i.e.* これ以上のデータを持たない状態)にある" +"場合、 :meth:`more` は空のバイトオブジェクトを返します。この時、 :class:" +"`async_chat` は枯渇状態にあるproducerをキューから除去し、次のproducerが存在す" +"ればそのproducerを使用します。キューにproducerが存在しない場合、 :meth:" +"`handle_write` は何もしません。リモート端点からの入力の終了や重要な中断点を検" +"出する場合は、 :meth:`set_terminator` に記述します。" + +#: ../../library/asynchat.rst:76 +msgid "" +"To build a functioning :class:`async_chat` subclass your input methods :" +"meth:`collect_incoming_data` and :meth:`found_terminator` must handle the " +"data that the channel receives asynchronously. The methods are described " +"below." +msgstr "" +":class:`async_chat` のサブクラスでは、入力メソッド :meth:" +"`collect_incoming_data` と :meth:`found_terminator` を定義し、チャネルが非同" +"期に受信するデータを処理します。これらのメソッドについては後ろで解説します。" + +#: ../../library/asynchat.rst:84 +msgid "" +"Pushes a ``None`` on to the producer queue. When this producer is popped off " +"the queue it causes the channel to be closed." +msgstr "" +"producer キューのトップに ``None`` をプッシュします。このproducerがキューから" +"ポップされると、チャネルが閉じられます。" + +#: ../../library/asynchat.rst:90 +msgid "" +"Called with *data* holding an arbitrary amount of received data. The " +"default method, which must be overridden, raises a :exc:" +"`NotImplementedError` exception." +msgstr "" +"チャネルが受信した不定長のデータを *data* に指定して呼び出されます。このメ" +"ソッドは必ずオーバライドする必要があり、デフォルトの実装では、 :exc:" +"`NotImplementedError` 例外を送出します。" + +#: ../../library/asynchat.rst:97 +msgid "" +"In emergencies this method will discard any data held in the input and/or " +"output buffers and the producer queue." +msgstr "" +"非常用のメソッドで、全ての入出力バッファとproducer キューを廃棄します。" + +#: ../../library/asynchat.rst:103 +msgid "" +"Called when the incoming data stream matches the termination condition set " +"by :meth:`set_terminator`. The default method, which must be overridden, " +"raises a :exc:`NotImplementedError` exception. The buffered input data " +"should be available via an instance attribute." +msgstr "" +"入力データストリームが、 :meth:`set_terminator` で指定した終了条件と一致した" +"場合に呼び出されます。このメソッドは必ずオーバライドする必要があり、デフォル" +"トの実装では、 :exc:`NotImplementedError` 例外を送出します。入力データを参照" +"する必要がある場合でも引数としては与えられないため、入力バッファをインスタン" +"ス属性として参照しなければなりません。" + +#: ../../library/asynchat.rst:111 +msgid "Returns the current terminator for the channel." +msgstr "現在のチャネルの終了条件を返します。" + +#: ../../library/asynchat.rst:116 +msgid "" +"Pushes data on to the channel's queue to ensure its transmission. This is " +"all you need to do to have the channel write the data out to the network, " +"although it is possible to use your own producers in more complex schemes to " +"implement encryption and chunking, for example." +msgstr "" +"チャネルのキューにデータをプッシュして転送します。データをチャネルに書き出す" +"ために必要なのはこれだけですが、データの暗号化やチャンク化などを行う場合には" +"独自の producer を使用する事もできます。" + +#: ../../library/asynchat.rst:124 +msgid "" +"Takes a producer object and adds it to the producer queue associated with " +"the channel. When all currently-pushed producers have been exhausted the " +"channel will consume this producer's data by calling its :meth:`more` method " +"and send the data to the remote endpoint." +msgstr "" +"指定したproducerオブジェクトをチャネルのキューに追加します。これより前にpush" +"されたproducerが全て枯渇した後、チャネルはこのproducer から :meth:`more` メ" +"ソッドでデータを取得し、リモート端点に送信します。" + +#: ../../library/asynchat.rst:132 +msgid "" +"Sets the terminating condition to be recognized on the channel. ``term`` " +"may be any of three types of value, corresponding to three different ways to " +"handle incoming protocol data." +msgstr "" +"チャネルで検出する終了条件を設定します。``term`` は入力プロトコルデータの処理" +"方式によって以下の3つの型の何れかを指定します。" + +#: ../../library/asynchat.rst:137 +msgid "term" +msgstr "term" + +#: ../../library/asynchat.rst:137 +msgid "Description" +msgstr "説明" + +#: ../../library/asynchat.rst:139 +msgid "*string*" +msgstr "*string*" + +#: ../../library/asynchat.rst:139 msgid "" -"This module is no longer part of the Python standard library. It was :ref:" -"`removed in Python 3.12 ` after being deprecated in " -"Python 3.6. The removal was decided in :pep:`594`." +"Will call :meth:`found_terminator` when the string is found in the input " +"stream" msgstr "" +"入力ストリーム中でstringが検出された時、 :meth:`found_terminator` を呼び出し" +"ます" + +#: ../../library/asynchat.rst:142 +msgid "*integer*" +msgstr "*integer*" + +#: ../../library/asynchat.rst:142 +msgid "" +"Will call :meth:`found_terminator` when the indicated number of characters " +"have been received" +msgstr "" +"指定された文字数が読み込まれた時、 :meth:`found_terminator` を呼び出します" + +#: ../../library/asynchat.rst:146 +msgid "``None``" +msgstr "``None``" + +#: ../../library/asynchat.rst:146 +msgid "The channel continues to collect data forever" +msgstr "永久にデータを読み込みます" -#: ../../library/asynchat.rst:14 -msgid "Applications should use the :mod:`asyncio` module instead." +#: ../../library/asynchat.rst:150 +msgid "" +"Note that any data following the terminator will be available for reading by " +"the channel after :meth:`found_terminator` is called." +msgstr "" +"終了条件が成立しても、その後に続くデータは、 :meth:`found_terminator` の呼出" +"し後に再びチャネルを読み込めば取得する事ができます。" + +#: ../../library/asynchat.rst:157 +msgid "asynchat Example" +msgstr "asynchat 使用例" + +#: ../../library/asynchat.rst:159 +msgid "" +"The following partial example shows how HTTP requests can be read with :" +"class:`async_chat`. A web server might create an :class:" +"`http_request_handler` object for each incoming client connection. Notice " +"that initially the channel terminator is set to match the blank line at the " +"end of the HTTP headers, and a flag indicates that the headers are being " +"read." +msgstr "" +"以下のサンプルは、 :class:`async_chat` でHTTPリクエストを読み込む処理の一部で" +"す。Webサーバは、クライアントからの接続毎に :class:`http_request_handler` オ" +"ブジェクトを作成します。最初はチャネルの終了条件に空行を指定してHTTPヘッダの" +"末尾までを検出し、その後ヘッダ読み込み済みを示すフラグを立てています。" + +#: ../../library/asynchat.rst:166 +msgid "" +"Once the headers have been read, if the request is of type POST (indicating " +"that further data are present in the input stream) then the ``Content-Length:" +"`` header is used to set a numeric terminator to read the right amount of " +"data from the channel." msgstr "" +"ヘッダ読み込んだ後、リクエストの種類がPOSTであればデータが入力ストリームに流" +"れるため、``Content-Length:`` ヘッダの値を数値として終了条件に指定し、適切な" +"長さのデータをチャネルから読み込みます。" -#: ../../library/asynchat.rst:16 +#: ../../library/asynchat.rst:171 msgid "" -"The last version of Python that provided the :mod:`!asynchat` module was " -"`Python 3.11 `_." +"The :meth:`handle_request` method is called once all relevant input has been " +"marshalled, after setting the channel terminator to ``None`` to ensure that " +"any extraneous data sent by the web client are ignored. ::" msgstr "" +"必要な入力データを全て入手したら、チャネルの終了条件に ``None`` を指定して残" +"りのデータを無視するようにしています。この後、 :meth:`handle_request` が呼び" +"出されます。 ::" diff --git a/library/asyncio-api-index.po b/library/asyncio-api-index.po index 88183e677..4089fb371 100644 --- a/library/asyncio-api-index.po +++ b/library/asyncio-api-index.po @@ -1,29 +1,26 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 -# Takeshi Nakazato, 2022 -# souma987, 2023 -# Arihiro TAKASE, 2023 -# 石井明久, 2024 +# tomo, 2018 +# Yuuki Ebihara , 2018 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-13 14:21+0000\n" -"PO-Revision-Date: 2021-06-28 00:54+0000\n" -"Last-Translator: 石井明久, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2018-09-18 00:23+0000\n" +"Last-Translator: Yuuki Ebihara , 2018\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/asyncio-api-index.rst:6 @@ -57,140 +54,111 @@ msgid "Create event loop, run a coroutine, close the loop." msgstr "イベントループを作成し、コルーチンを実行し、ループを閉じます。" #: ../../library/asyncio-api-index.rst:24 -msgid ":class:`Runner`" -msgstr ":class:`Runner`" - -#: ../../library/asyncio-api-index.rst:25 -msgid "A context manager that simplifies multiple async function calls." -msgstr "複数の非同期関数呼び出しをシンプルにするコンテキストマネージャ。" - -#: ../../library/asyncio-api-index.rst:27 -msgid ":class:`Task`" -msgstr ":class:`Task`" - -#: ../../library/asyncio-api-index.rst:28 -msgid "Task object." -msgstr "Task オブジェクト" - -#: ../../library/asyncio-api-index.rst:30 -msgid ":class:`TaskGroup`" -msgstr ":class:`TaskGroup`" - -#: ../../library/asyncio-api-index.rst:31 -msgid "" -"A context manager that holds a group of tasks. Provides a convenient and " -"reliable way to wait for all tasks in the group to finish." -msgstr "" -"タスクのグループを保持するコンテキストマネージャ。グループに属するすべてのタ" -"スクが完了するのを待つのに便利で信頼性のある方法を提供します。" - -#: ../../library/asyncio-api-index.rst:35 msgid ":func:`create_task`" msgstr ":func:`create_task`" -#: ../../library/asyncio-api-index.rst:36 -msgid "Start an asyncio Task, then returns it." -msgstr "asyncio タスクを開始し、それを返します。" - -#: ../../library/asyncio-api-index.rst:38 -msgid ":func:`current_task`" -msgstr ":func:`current_task`" - -#: ../../library/asyncio-api-index.rst:39 -msgid "Return the current Task." -msgstr "現在のタスクを返します。" - -#: ../../library/asyncio-api-index.rst:41 -msgid ":func:`all_tasks`" -msgstr ":func:`all_tasks`" - -#: ../../library/asyncio-api-index.rst:42 -msgid "Return all tasks that are not yet finished for an event loop." -msgstr "イベントループのまだ終了していないすべてのタスクを返します。" +#: ../../library/asyncio-api-index.rst:25 +msgid "Start an asyncio Task." +msgstr "asyncio タスクを開始します。" -#: ../../library/asyncio-api-index.rst:44 +#: ../../library/asyncio-api-index.rst:27 msgid "``await`` :func:`sleep`" msgstr "``await`` :func:`sleep`" -#: ../../library/asyncio-api-index.rst:45 +#: ../../library/asyncio-api-index.rst:28 msgid "Sleep for a number of seconds." msgstr "数秒間スリープします。" -#: ../../library/asyncio-api-index.rst:47 +#: ../../library/asyncio-api-index.rst:30 msgid "``await`` :func:`gather`" msgstr "``await`` :func:`gather`" -#: ../../library/asyncio-api-index.rst:48 +#: ../../library/asyncio-api-index.rst:31 msgid "Schedule and wait for things concurrently." msgstr "並行してスケジュールして、待ちます。" -#: ../../library/asyncio-api-index.rst:50 +#: ../../library/asyncio-api-index.rst:33 msgid "``await`` :func:`wait_for`" msgstr "``await`` :func:`wait_for`" -#: ../../library/asyncio-api-index.rst:51 +#: ../../library/asyncio-api-index.rst:34 msgid "Run with a timeout." msgstr "タイムアウトで実行します。" -#: ../../library/asyncio-api-index.rst:53 +#: ../../library/asyncio-api-index.rst:36 msgid "``await`` :func:`shield`" msgstr "``await`` :func:`shield`" -#: ../../library/asyncio-api-index.rst:54 +#: ../../library/asyncio-api-index.rst:37 msgid "Shield from cancellation." msgstr "取り消しから保護します。" -#: ../../library/asyncio-api-index.rst:56 +#: ../../library/asyncio-api-index.rst:39 msgid "``await`` :func:`wait`" msgstr "``await`` :func:`wait`" -#: ../../library/asyncio-api-index.rst:57 +#: ../../library/asyncio-api-index.rst:40 msgid "Monitor for completion." msgstr "完了かどうかを監視します。" -#: ../../library/asyncio-api-index.rst:59 -msgid ":func:`timeout`" -msgstr ":func:`timeout`" +#: ../../library/asyncio-api-index.rst:42 +msgid ":func:`current_task`" +msgstr ":func:`current_task`" -#: ../../library/asyncio-api-index.rst:60 -msgid "Run with a timeout. Useful in cases when ``wait_for`` is not suitable." -msgstr "" -"タイムアウト付きで実行します。 ``wait_for`` が適していない場合に有用です。" +#: ../../library/asyncio-api-index.rst:43 +msgid "Return the current Task." +msgstr "現在のタスクを返します。" -#: ../../library/asyncio-api-index.rst:62 +#: ../../library/asyncio-api-index.rst:45 +msgid ":func:`all_tasks`" +msgstr ":func:`all_tasks`" + +#: ../../library/asyncio-api-index.rst:46 +msgid "Return all tasks for an event loop." +msgstr "イベントループのすべてのタスクを返します。" + +#: ../../library/asyncio-api-index.rst:48 +msgid ":class:`Task`" +msgstr ":class:`Task`" + +#: ../../library/asyncio-api-index.rst:49 +msgid "Task object." +msgstr "Task オブジェクト" + +#: ../../library/asyncio-api-index.rst:51 msgid ":func:`to_thread`" msgstr ":func:`to_thread`" -#: ../../library/asyncio-api-index.rst:63 -msgid "Asynchronously run a function in a separate OS thread." -msgstr "別の OS スレッドで非同期的に関数を実行します。" +#: ../../library/asyncio-api-index.rst:52 +msgid "Asychronously run a function in a separate OS thread." +msgstr "" -#: ../../library/asyncio-api-index.rst:65 +#: ../../library/asyncio-api-index.rst:54 msgid ":func:`run_coroutine_threadsafe`" msgstr ":func:`run_coroutine_threadsafe`" -#: ../../library/asyncio-api-index.rst:66 +#: ../../library/asyncio-api-index.rst:55 msgid "Schedule a coroutine from another OS thread." msgstr "別の OS スレッドからコルーチンの実行をスケジュールします。" -#: ../../library/asyncio-api-index.rst:68 +#: ../../library/asyncio-api-index.rst:57 msgid "``for in`` :func:`as_completed`" msgstr "``for in`` :func:`as_completed`" -#: ../../library/asyncio-api-index.rst:69 +#: ../../library/asyncio-api-index.rst:58 msgid "Monitor for completion with a ``for`` loop." msgstr "``for`` ループ向けにコルーチンの完了を監視します。" -#: ../../library/asyncio-api-index.rst:73 -#: ../../library/asyncio-api-index.rst:109 -#: ../../library/asyncio-api-index.rst:133 -#: ../../library/asyncio-api-index.rst:169 -#: ../../library/asyncio-api-index.rst:205 -#: ../../library/asyncio-api-index.rst:230 +#: ../../library/asyncio-api-index.rst:62 +#: ../../library/asyncio-api-index.rst:98 +#: ../../library/asyncio-api-index.rst:122 +#: ../../library/asyncio-api-index.rst:158 +#: ../../library/asyncio-api-index.rst:191 +#: ../../library/asyncio-api-index.rst:216 msgid "Examples" msgstr "使用例" -#: ../../library/asyncio-api-index.rst:74 +#: ../../library/asyncio-api-index.rst:63 msgid "" ":ref:`Using asyncio.gather() to run things in parallel " "`." @@ -198,7 +166,7 @@ msgstr "" ":ref:`asyncio.gather() を使って複数の処理を並列に実行する " "` 。" -#: ../../library/asyncio-api-index.rst:77 +#: ../../library/asyncio-api-index.rst:66 msgid "" ":ref:`Using asyncio.wait_for() to enforce a timeout " "`." @@ -206,23 +174,23 @@ msgstr "" ":ref:`asyncio.wait_for() を使って強制的にタイムアウトする " "` 。" -#: ../../library/asyncio-api-index.rst:80 +#: ../../library/asyncio-api-index.rst:69 msgid ":ref:`Cancellation `." msgstr ":ref:`非同期処理をキャンセルする ` 。" -#: ../../library/asyncio-api-index.rst:82 +#: ../../library/asyncio-api-index.rst:71 msgid ":ref:`Using asyncio.sleep() `." msgstr ":ref:`asyncio.sleep() を使う` 。" -#: ../../library/asyncio-api-index.rst:84 +#: ../../library/asyncio-api-index.rst:73 msgid "See also the main :ref:`Tasks documentation page `." msgstr ":ref:`Tasks のドキュメント ` も参照してください。" -#: ../../library/asyncio-api-index.rst:88 +#: ../../library/asyncio-api-index.rst:77 msgid "Queues" msgstr "キュー" -#: ../../library/asyncio-api-index.rst:90 +#: ../../library/asyncio-api-index.rst:79 msgid "" "Queues should be used to distribute work amongst multiple asyncio Tasks, " "implement connection pools, and pub/sub patterns." @@ -230,31 +198,31 @@ msgstr "" "キューは複数の非同期タスクの分散処理、コネクションプールやpub/subパターンの実" "装に適しています。" -#: ../../library/asyncio-api-index.rst:98 +#: ../../library/asyncio-api-index.rst:87 msgid ":class:`Queue`" msgstr ":class:`Queue`" -#: ../../library/asyncio-api-index.rst:99 +#: ../../library/asyncio-api-index.rst:88 msgid "A FIFO queue." msgstr "FIFO キューです。" -#: ../../library/asyncio-api-index.rst:101 +#: ../../library/asyncio-api-index.rst:90 msgid ":class:`PriorityQueue`" msgstr ":class:`PriorityQueue`" -#: ../../library/asyncio-api-index.rst:102 +#: ../../library/asyncio-api-index.rst:91 msgid "A priority queue." msgstr "優先度付きのキューです。" -#: ../../library/asyncio-api-index.rst:104 +#: ../../library/asyncio-api-index.rst:93 msgid ":class:`LifoQueue`" msgstr ":class:`LifoQueue`" -#: ../../library/asyncio-api-index.rst:105 +#: ../../library/asyncio-api-index.rst:94 msgid "A LIFO queue." msgstr "LIFO キュー (スタック) です。" -#: ../../library/asyncio-api-index.rst:110 +#: ../../library/asyncio-api-index.rst:99 msgid "" ":ref:`Using asyncio.Queue to distribute workload between several Tasks " "`." @@ -262,177 +230,165 @@ msgstr "" ":ref:`asyncio.Queue を使って複数のタスクを分散処理する " "`." -#: ../../library/asyncio-api-index.rst:113 +#: ../../library/asyncio-api-index.rst:102 msgid "See also the :ref:`Queues documentation page `." msgstr ":ref:`Queue のドキュメント ` も参照してください。" -#: ../../library/asyncio-api-index.rst:117 +#: ../../library/asyncio-api-index.rst:106 msgid "Subprocesses" msgstr "サブプロセス" -#: ../../library/asyncio-api-index.rst:119 +#: ../../library/asyncio-api-index.rst:108 msgid "Utilities to spawn subprocesses and run shell commands." msgstr "" "サブプロセスを生成したり、シェルコマンドを実行するためのユーティリティです。" -#: ../../library/asyncio-api-index.rst:125 +#: ../../library/asyncio-api-index.rst:114 msgid "``await`` :func:`create_subprocess_exec`" msgstr "``await`` :func:`create_subprocess_exec`" -#: ../../library/asyncio-api-index.rst:126 +#: ../../library/asyncio-api-index.rst:115 msgid "Create a subprocess." msgstr "サブプロセスを作成します。" -#: ../../library/asyncio-api-index.rst:128 +#: ../../library/asyncio-api-index.rst:117 msgid "``await`` :func:`create_subprocess_shell`" msgstr "``await`` :func:`create_subprocess_shell`" -#: ../../library/asyncio-api-index.rst:129 +#: ../../library/asyncio-api-index.rst:118 msgid "Run a shell command." msgstr "シェルコマンドを実行します。" -#: ../../library/asyncio-api-index.rst:134 +#: ../../library/asyncio-api-index.rst:123 msgid ":ref:`Executing a shell command `." msgstr ":ref:`シェルコマンドを実行する `。" -#: ../../library/asyncio-api-index.rst:136 +#: ../../library/asyncio-api-index.rst:125 msgid "See also the :ref:`subprocess APIs ` documentation." msgstr "" ":ref:`サブプロセス API ` のドキュメントも参照してくださ" "い。" -#: ../../library/asyncio-api-index.rst:141 +#: ../../library/asyncio-api-index.rst:130 msgid "Streams" msgstr "ストリーム" -#: ../../library/asyncio-api-index.rst:143 +#: ../../library/asyncio-api-index.rst:132 msgid "High-level APIs to work with network IO." msgstr "ネットワーク IO を利用するための高水準の APIs です。" -#: ../../library/asyncio-api-index.rst:149 +#: ../../library/asyncio-api-index.rst:138 msgid "``await`` :func:`open_connection`" msgstr "``await`` :func:`open_connection`" -#: ../../library/asyncio-api-index.rst:150 +#: ../../library/asyncio-api-index.rst:139 msgid "Establish a TCP connection." msgstr "TCP コネクションを確立します。" -#: ../../library/asyncio-api-index.rst:152 +#: ../../library/asyncio-api-index.rst:141 msgid "``await`` :func:`open_unix_connection`" msgstr "``await`` :func:`open_unix_connection`" -#: ../../library/asyncio-api-index.rst:153 +#: ../../library/asyncio-api-index.rst:142 msgid "Establish a Unix socket connection." msgstr "Unix のソケット接続を確立します。" -#: ../../library/asyncio-api-index.rst:155 +#: ../../library/asyncio-api-index.rst:144 msgid "``await`` :func:`start_server`" msgstr "``await`` :func:`start_server`" -#: ../../library/asyncio-api-index.rst:156 +#: ../../library/asyncio-api-index.rst:145 msgid "Start a TCP server." msgstr "TCP サーバーを起動します。" -#: ../../library/asyncio-api-index.rst:158 +#: ../../library/asyncio-api-index.rst:147 msgid "``await`` :func:`start_unix_server`" msgstr "``await`` :func:`start_unix_server`" -#: ../../library/asyncio-api-index.rst:159 +#: ../../library/asyncio-api-index.rst:148 msgid "Start a Unix socket server." msgstr "Unix のソケットサーバーを起動します。" -#: ../../library/asyncio-api-index.rst:161 +#: ../../library/asyncio-api-index.rst:150 msgid ":class:`StreamReader`" msgstr ":class:`StreamReader`" -#: ../../library/asyncio-api-index.rst:162 +#: ../../library/asyncio-api-index.rst:151 msgid "High-level async/await object to receive network data." msgstr "" "ネットワークからデータを受信するための高水準の async/await オブジェクトです。" -#: ../../library/asyncio-api-index.rst:164 +#: ../../library/asyncio-api-index.rst:153 msgid ":class:`StreamWriter`" msgstr ":class:`StreamWriter`" -#: ../../library/asyncio-api-index.rst:165 +#: ../../library/asyncio-api-index.rst:154 msgid "High-level async/await object to send network data." msgstr "" "ネットワークにデータを送信するための高水準の async/await オブジェクトです。" -#: ../../library/asyncio-api-index.rst:170 +#: ../../library/asyncio-api-index.rst:159 msgid ":ref:`Example TCP client `." msgstr ":ref:`TCPクライアントの例 `." -#: ../../library/asyncio-api-index.rst:172 +#: ../../library/asyncio-api-index.rst:161 msgid "See also the :ref:`streams APIs ` documentation." msgstr "" ":ref:`ストリーム API ` のドキュメントも参照してください。" -#: ../../library/asyncio-api-index.rst:177 +#: ../../library/asyncio-api-index.rst:166 msgid "Synchronization" msgstr "同期" -#: ../../library/asyncio-api-index.rst:179 +#: ../../library/asyncio-api-index.rst:168 msgid "Threading-like synchronization primitives that can be used in Tasks." msgstr "タスク内で利用できるスレッド並列処理に似た同期プリミティブです。" -#: ../../library/asyncio-api-index.rst:185 +#: ../../library/asyncio-api-index.rst:174 msgid ":class:`Lock`" msgstr ":class:`Lock`" -#: ../../library/asyncio-api-index.rst:186 +#: ../../library/asyncio-api-index.rst:175 msgid "A mutex lock." msgstr "ミューテックスロックです。" -#: ../../library/asyncio-api-index.rst:188 +#: ../../library/asyncio-api-index.rst:177 msgid ":class:`Event`" msgstr ":class:`Event`" -#: ../../library/asyncio-api-index.rst:189 +#: ../../library/asyncio-api-index.rst:178 msgid "An event object." msgstr "イベントオブジェクトです。" -#: ../../library/asyncio-api-index.rst:191 +#: ../../library/asyncio-api-index.rst:180 msgid ":class:`Condition`" msgstr ":class:`Condition`" -#: ../../library/asyncio-api-index.rst:192 +#: ../../library/asyncio-api-index.rst:181 msgid "A condition object." msgstr "条件変数オブジェクトです。" -#: ../../library/asyncio-api-index.rst:194 +#: ../../library/asyncio-api-index.rst:183 msgid ":class:`Semaphore`" msgstr ":class:`Semaphore`" -#: ../../library/asyncio-api-index.rst:195 +#: ../../library/asyncio-api-index.rst:184 msgid "A semaphore." msgstr "セマフォ (semaphore) です。" -#: ../../library/asyncio-api-index.rst:197 +#: ../../library/asyncio-api-index.rst:186 msgid ":class:`BoundedSemaphore`" msgstr ":class:`BoundedSemaphore`" -#: ../../library/asyncio-api-index.rst:198 +#: ../../library/asyncio-api-index.rst:187 msgid "A bounded semaphore." msgstr "有限セマフォ (bounded semaphore) です。" -#: ../../library/asyncio-api-index.rst:200 -msgid ":class:`Barrier`" -msgstr ":class:`Barrier`" - -#: ../../library/asyncio-api-index.rst:201 -msgid "A barrier object." -msgstr "バリアーオブジェクト。" - -#: ../../library/asyncio-api-index.rst:206 +#: ../../library/asyncio-api-index.rst:192 msgid ":ref:`Using asyncio.Event `." msgstr ":ref:`asyncio.Event の使用例` 。" -#: ../../library/asyncio-api-index.rst:208 -msgid ":ref:`Using asyncio.Barrier `." -msgstr ":ref:`asyncio.Barrier を使う `。" - -#: ../../library/asyncio-api-index.rst:210 +#: ../../library/asyncio-api-index.rst:194 msgid "" "See also the documentation of asyncio :ref:`synchronization primitives " "`." @@ -440,31 +396,32 @@ msgstr "" "asyncio の :ref:`同期プリミティブ ` についてのドキュメントも参" "照してください。" -#: ../../library/asyncio-api-index.rst:215 +#: ../../library/asyncio-api-index.rst:199 msgid "Exceptions" msgstr "例外" -#: ../../library/asyncio-api-index.rst:222 +#: ../../library/asyncio-api-index.rst:206 +msgid ":exc:`asyncio.TimeoutError`" +msgstr "" + +#: ../../library/asyncio-api-index.rst:207 +msgid "" +"Raised on timeout by functions like :func:`wait_for`. Keep in mind that " +"``asyncio.TimeoutError`` is **unrelated** to the built-in :exc:" +"`TimeoutError` exception." +msgstr "" + +#: ../../library/asyncio-api-index.rst:211 msgid ":exc:`asyncio.CancelledError`" msgstr ":exc:`asyncio.CancelledError`" -#: ../../library/asyncio-api-index.rst:223 +#: ../../library/asyncio-api-index.rst:212 msgid "Raised when a Task is cancelled. See also :meth:`Task.cancel`." msgstr "" "タスクがキャンセルされた場合に送出されます。 :meth:`Task.cancel` も参照してく" "ださい。" -#: ../../library/asyncio-api-index.rst:225 -msgid ":exc:`asyncio.BrokenBarrierError`" -msgstr ":exc:`asyncio.BrokenBarrierError`" - -#: ../../library/asyncio-api-index.rst:226 -msgid "Raised when a Barrier is broken. See also :meth:`Barrier.wait`." -msgstr "" -"バリアーが破壊された場合に送出されます。 :meth:`Barrier.wait` も参照してくだ" -"さい。" - -#: ../../library/asyncio-api-index.rst:231 +#: ../../library/asyncio-api-index.rst:217 msgid "" ":ref:`Handling CancelledError to run code on cancellation request " "`." @@ -472,7 +429,7 @@ msgstr "" ":ref:`CancelledError を処理してキャンセル要求に対応するコードを実行する " "`." -#: ../../library/asyncio-api-index.rst:234 +#: ../../library/asyncio-api-index.rst:220 msgid "" "See also the full list of :ref:`asyncio-specific exceptions `." diff --git a/library/asyncio-dev.po b/library/asyncio-dev.po index 47f504241..5db4cd17f 100644 --- a/library/asyncio-dev.po +++ b/library/asyncio-dev.po @@ -1,27 +1,26 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 -# Takeshi Nakazato, 2022 -# 石井明久, 2024 +# Arihiro TAKASE, 2017 +# Masato HASHIMOTO , 2017 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-06 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:54+0000\n" -"Last-Translator: 石井明久, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 17:48+0000\n" +"Last-Translator: Masato HASHIMOTO , 2017\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/asyncio-dev.rst:7 @@ -81,16 +80,12 @@ msgstr "デバッグモードを有効化することに加え、以下も検討 #: ../../library/asyncio-dev.rst:36 msgid "" "setting the log level of the :ref:`asyncio logger ` to :py:" -"const:`logging.DEBUG`, for example the following snippet of code can be run " +"data:`logging.DEBUG`, for example the following snippet of code can be run " "at startup of the application::" msgstr "" -":ref:`asyncio ロガー ` のログレベルを :py:const:`logging." +":ref:`asyncio ロガー ` のログレベルを :py:data:`logging." "DEBUG` に設定します。例えばアプリケーションの起動時に以下を実行します::" -#: ../../library/asyncio-dev.rst:40 -msgid "logging.basicConfig(level=logging.DEBUG)" -msgstr "" - #: ../../library/asyncio-dev.rst:42 msgid "" "configuring the :mod:`warnings` module to display :exc:`ResourceWarning` " @@ -107,6 +102,16 @@ msgstr "デバッグモードが有効化されたときの動作:" #: ../../library/asyncio-dev.rst:49 msgid "" +"asyncio checks for :ref:`coroutines that were not awaited ` and logs them; this mitigates the \"forgotten await\" " +"pitfall." +msgstr "" +"asyncio は :ref:`待ち受け処理 (await) を伴わないコルーチン ` がないかをチェックし、それらを記録します; これによ" +"り \"待ち受け忘れ\" の落とし穴にはまる可能性を軽減します。" + +#: ../../library/asyncio-dev.rst:53 +msgid "" "Many non-threadsafe asyncio APIs (such as :meth:`loop.call_soon` and :meth:" "`loop.call_at` methods) raise an exception if they are called from a wrong " "thread." @@ -115,7 +120,7 @@ msgstr "" "`loop.call_at` など) は、誤ったスレッドから呼び出されたときに例外を送出しま" "す。" -#: ../../library/asyncio-dev.rst:53 +#: ../../library/asyncio-dev.rst:57 msgid "" "The execution time of the I/O selector is logged if it takes too long to " "perform an I/O operation." @@ -123,21 +128,18 @@ msgstr "" "I/O セレクタが I/O 処理を実行する時間が長すぎる場合、その実行時間が記録されま" "す。" -#: ../../library/asyncio-dev.rst:56 +#: ../../library/asyncio-dev.rst:60 msgid "" -"Callbacks taking longer than 100 milliseconds are logged. The :attr:`loop." +"Callbacks taking longer than 100ms are logged. The :attr:`loop." "slow_callback_duration` attribute can be used to set the minimum execution " "duration in seconds that is considered \"slow\"." msgstr "" -"実行時間が100ミリ秒を超えるコールバックは記録されます。 \"遅い\" の判断基準と" -"なる実行時間の最小値は :attr:`loop.slow_callback_duration` 属性で設定できま" -"す。" -#: ../../library/asyncio-dev.rst:64 +#: ../../library/asyncio-dev.rst:68 msgid "Concurrency and Multithreading" msgstr "並行処理とマルチスレッド処理" -#: ../../library/asyncio-dev.rst:66 +#: ../../library/asyncio-dev.rst:70 msgid "" "An event loop runs in a thread (typically the main thread) and executes all " "callbacks and Tasks in its thread. While a Task is running in the event " @@ -151,7 +153,7 @@ msgstr "" "クが ``await`` 式を実行すると、実行中のタスクはサスペンドされ、イベントループ" "は次のタスクを実行します。" -#: ../../library/asyncio-dev.rst:72 +#: ../../library/asyncio-dev.rst:76 msgid "" "To schedule a :term:`callback` from another OS thread, the :meth:`loop." "call_soon_threadsafe` method should be used. Example::" @@ -159,11 +161,7 @@ msgstr "" "別の OS スレッドからのコールバック (:term:`callback`) をスケジュールする場" "合、 :meth:`loop.call_soon_threadsafe` メソッドを使ってください。例:" -#: ../../library/asyncio-dev.rst:75 -msgid "loop.call_soon_threadsafe(callback, *args)" -msgstr "" - -#: ../../library/asyncio-dev.rst:77 +#: ../../library/asyncio-dev.rst:81 msgid "" "Almost all asyncio objects are not thread safe, which is typically not a " "problem unless there is code that works with them from outside of a Task or " @@ -176,11 +174,7 @@ msgstr "" "び出すようなコードを書く必要がある場合、 :meth:`loop.call_soon_threadsafe` メ" "ソッドを使ってください。例: " -#: ../../library/asyncio-dev.rst:83 -msgid "loop.call_soon_threadsafe(fut.cancel)" -msgstr "" - -#: ../../library/asyncio-dev.rst:85 +#: ../../library/asyncio-dev.rst:89 msgid "" "To schedule a coroutine object from a different OS thread, the :func:" "`run_coroutine_threadsafe` function should be used. It returns a :class:" @@ -191,59 +185,44 @@ msgstr "" "`run_coroutine_threadsafe` は結果にアクセスするための :class:`concurrent." "futures.Future` オブジェクトを返します:" -#: ../../library/asyncio-dev.rst:89 +#: ../../library/asyncio-dev.rst:102 msgid "" -"async def coro_func():\n" -" return await asyncio.sleep(1, 42)\n" -"\n" -"# Later in another OS thread:\n" -"\n" -"future = asyncio.run_coroutine_threadsafe(coro_func(), loop)\n" -"# Wait for the result:\n" -"result = future.result()" +"To handle signals and to execute subprocesses, the event loop must be run in " +"the main thread." msgstr "" +"シグナルの処理やサブプロセスの実行を行うには、イベントループはメインスレッド" +"内で実行しなければなりません。" -#: ../../library/asyncio-dev.rst:98 -msgid "To handle signals the event loop must be run in the main thread." -msgstr "" -"シグナルの処理を行うには、イベントループはメインスレッド内で実行しなければな" -"りません。" - -#: ../../library/asyncio-dev.rst:101 +#: ../../library/asyncio-dev.rst:105 msgid "" "The :meth:`loop.run_in_executor` method can be used with a :class:" -"`concurrent.futures.ThreadPoolExecutor` or :class:`~concurrent.futures." -"InterpreterPoolExecutor` to execute blocking code in a different OS thread " -"without blocking the OS thread that the event loop runs in." +"`concurrent.futures.ThreadPoolExecutor` to execute blocking code in a " +"different OS thread without blocking the OS thread that the event loop runs " +"in." msgstr "" +"The :meth:`loop.run_in_executor` メソッドを :class:`concurrent.futures." +"ThreadPoolExecutor` とともに使用することで、イベントループの OS スレッドをブ" +"ロックすることなく、別の OS スレッド内でブロッキングコードを実行することがで" +"きます。 " -#: ../../library/asyncio-dev.rst:107 +#: ../../library/asyncio-dev.rst:110 msgid "" "There is currently no way to schedule coroutines or callbacks directly from " "a different process (such as one started with :mod:`multiprocessing`). The :" -"ref:`asyncio-event-loop-methods` section lists APIs that can read from pipes " -"and watch file descriptors without blocking the event loop. In addition, " -"asyncio's :ref:`Subprocess ` APIs provide a way to start " -"a process and communicate with it from the event loop. Lastly, the " -"aforementioned :meth:`loop.run_in_executor` method can also be used with a :" -"class:`concurrent.futures.ProcessPoolExecutor` to execute code in a " +"ref:`Event Loop Methods ` section lists APIs that can " +"read from pipes and watch file descriptors without blocking the event loop. " +"In addition, asyncio's :ref:`Subprocess ` APIs provide a " +"way to start a process and communicate with it from the event loop. Lastly, " +"the aforementioned :meth:`loop.run_in_executor` method can also be used with " +"a :class:`concurrent.futures.ProcessPoolExecutor` to execute code in a " "different process." msgstr "" -"現在のところ、 (たとえば :mod:`multiprocessing` で開始したような) 別のプロセ" -"スからコルーチンやコールバックを直接スケジュールすることはできません。 :ref:" -"`asyncio-event-loop-methods` 節では、イベントループをブロックすることなくパイ" -"プからの読み込みやファイルデスクリプタの監視ができる API のリストを掲載してい" -"ます。さらに、 asyncio の :ref:`サブプロセス ` API はイベ" -"ントループからプロセスを開始したりプロセスと通信したりする方法を提供します。 " -"最後に、前述の :meth:`loop.run_in_executor` メソッドは :class:`concurrent." -"futures.ProcessPoolExecutor` とともに使用することで、別のプロセス内でコードを" -"実行することもできます。" - -#: ../../library/asyncio-dev.rst:121 + +#: ../../library/asyncio-dev.rst:124 msgid "Running Blocking Code" msgstr "ブロッキングコードの実行" -#: ../../library/asyncio-dev.rst:123 +#: ../../library/asyncio-dev.rst:126 msgid "" "Blocking (CPU-bound) code should not be called directly. For example, if a " "function performs a CPU-intensive calculation for 1 second, all concurrent " @@ -253,19 +232,21 @@ msgstr "" "たとえば、 CPU 負荷の高い関数を1秒実行したとすると、並行に処理されている全て" "の非同期タスクと I/O 処理は1秒遅れる可能性があります。 " -#: ../../library/asyncio-dev.rst:128 +#: ../../library/asyncio-dev.rst:131 msgid "" -"An executor can be used to run a task in a different thread, including in a " -"different interpreter, or even in a different process to avoid blocking the " -"OS thread with the event loop. See the :meth:`loop.run_in_executor` method " -"for more details." +"An executor can be used to run a task in a different thread or even in a " +"different process to avoid blocking the OS thread with the event loop. See " +"the :meth:`loop.run_in_executor` method for more details." msgstr "" +"エグゼキューターを使用することにより、イベントループの OS スレッドをブロック" +"することなく、別のスレッドや別のプロセス上でタスクを実行することができます。" +"詳しくは :meth:`loop.run_in_executor` メソッドを参照してください。" -#: ../../library/asyncio-dev.rst:138 +#: ../../library/asyncio-dev.rst:140 msgid "Logging" msgstr "ログ記録" -#: ../../library/asyncio-dev.rst:140 +#: ../../library/asyncio-dev.rst:142 msgid "" "asyncio uses the :mod:`logging` module and all logging is performed via the " "``\"asyncio\"`` logger." @@ -273,33 +254,19 @@ msgstr "" "asyncio は :mod:`logging` モジュールを利用し、 全てのログ記録は " "``\"asyncio\"`` ロガーを通じて行われます。" -#: ../../library/asyncio-dev.rst:143 +#: ../../library/asyncio-dev.rst:145 msgid "" -"The default log level is :py:const:`logging.INFO`, which can be easily " +"The default log level is :py:data:`logging.INFO`, which can be easily " "adjusted::" msgstr "" -"デフォルトのログレベルは :py:const:`logging.INFO` ですが、これは簡単に調節で" -"きます:" - -#: ../../library/asyncio-dev.rst:146 -msgid "logging.getLogger(\"asyncio\").setLevel(logging.WARNING)" -msgstr "" +"デフォルトのログレベルは :py:data:`logging.INFO` ですが、これは簡単に調節でき" +"ます:" -#: ../../library/asyncio-dev.rst:149 -msgid "" -"Network logging can block the event loop. It is recommended to use a " -"separate thread for handling logs or use non-blocking IO. For example, see :" -"ref:`blocking-handlers`." -msgstr "" -"ネットワークログ記録は、イベントループをブロックし得ます。ログ処理のスレッド" -"を分離するか、ノンブロッキング IO を使用することを推奨します。例えば、 :ref:" -"`blocking-handlers` を見てください。" - -#: ../../library/asyncio-dev.rst:157 +#: ../../library/asyncio-dev.rst:154 msgid "Detect never-awaited coroutines" msgstr "待ち受け処理を伴わないコルーチンの検出" -#: ../../library/asyncio-dev.rst:159 +#: ../../library/asyncio-dev.rst:156 msgid "" "When a coroutine function is called, but not awaited (e.g. ``coro()`` " "instead of ``await coro()``) or the coroutine is not scheduled with :meth:" @@ -310,48 +277,15 @@ msgstr "" "meth:`asyncio.create_task` を使わずにスケジュールされた場合、 asyncio は :" "exc:`RuntimeWarning` 警告を送出します:" -#: ../../library/asyncio-dev.rst:164 -msgid "" -"import asyncio\n" -"\n" -"async def test():\n" -" print(\"never scheduled\")\n" -"\n" -"async def main():\n" -" test()\n" -"\n" -"asyncio.run(main())" -msgstr "" - -#: ../../library/asyncio-dev.rst:174 ../../library/asyncio-dev.rst:219 +#: ../../library/asyncio-dev.rst:171 ../../library/asyncio-dev.rst:216 msgid "Output::" msgstr "出力::" -#: ../../library/asyncio-dev.rst:176 -msgid "" -"test.py:7: RuntimeWarning: coroutine 'test' was never awaited\n" -" test()" -msgstr "" - -#: ../../library/asyncio-dev.rst:179 ../../library/asyncio-dev.rst:235 +#: ../../library/asyncio-dev.rst:176 ../../library/asyncio-dev.rst:232 msgid "Output in debug mode::" msgstr "デバッグモードの出力::" -#: ../../library/asyncio-dev.rst:181 -msgid "" -"test.py:7: RuntimeWarning: coroutine 'test' was never awaited\n" -"Coroutine created at (most recent call last)\n" -" File \"../t.py\", line 9, in \n" -" asyncio.run(main(), debug=True)\n" -"\n" -" < .. >\n" -"\n" -" File \"../t.py\", line 7, in main\n" -" test()\n" -" test()" -msgstr "" - -#: ../../library/asyncio-dev.rst:192 +#: ../../library/asyncio-dev.rst:189 msgid "" "The usual fix is to either await the coroutine or call the :meth:`asyncio." "create_task` function::" @@ -359,17 +293,11 @@ msgstr "" "通常の修正方法はコルーチンを待ち受ける (await) か、 :meth:`asyncio." "create_task` 関数を呼び出すことです:" -#: ../../library/asyncio-dev.rst:195 -msgid "" -"async def main():\n" -" await test()" -msgstr "" - -#: ../../library/asyncio-dev.rst:200 +#: ../../library/asyncio-dev.rst:197 msgid "Detect never-retrieved exceptions" msgstr "回収されない例外の検出" -#: ../../library/asyncio-dev.rst:202 +#: ../../library/asyncio-dev.rst:199 msgid "" "If a :meth:`Future.set_exception` is called but the Future object is never " "awaited on, the exception would never be propagated to the user code. In " @@ -381,61 +309,14 @@ msgstr "" "この場合 asyncio は、 Future オブジェクトがガベージコレクションの対象となった" "ときにログメッセージを送出することがあります。" -#: ../../library/asyncio-dev.rst:207 +#: ../../library/asyncio-dev.rst:204 msgid "Example of an unhandled exception::" msgstr "処理されない例外の例:" -#: ../../library/asyncio-dev.rst:209 -msgid "" -"import asyncio\n" -"\n" -"async def bug():\n" -" raise Exception(\"not consumed\")\n" -"\n" -"async def main():\n" -" asyncio.create_task(bug())\n" -"\n" -"asyncio.run(main())" -msgstr "" - -#: ../../library/asyncio-dev.rst:221 -msgid "" -"Task exception was never retrieved\n" -"future: \n" -" exception=Exception('not consumed')>\n" -"\n" -"Traceback (most recent call last):\n" -" File \"test.py\", line 4, in bug\n" -" raise Exception(\"not consumed\")\n" -"Exception: not consumed" -msgstr "" - -#: ../../library/asyncio-dev.rst:230 +#: ../../library/asyncio-dev.rst:227 msgid "" ":ref:`Enable the debug mode ` to get the traceback where " "the task was created::" msgstr "" "タスクが生成された箇所を特定するには、 :ref:`デバッグモードを有効化して " "` トレースバックを取得してください:" - -#: ../../library/asyncio-dev.rst:233 -msgid "asyncio.run(main(), debug=True)" -msgstr "" - -#: ../../library/asyncio-dev.rst:237 -msgid "" -"Task exception was never retrieved\n" -"future: \n" -" exception=Exception('not consumed') created at asyncio/tasks.py:321>\n" -"\n" -"source_traceback: Object created at (most recent call last):\n" -" File \"../t.py\", line 9, in \n" -" asyncio.run(main(), debug=True)\n" -"\n" -"< .. >\n" -"\n" -"Traceback (most recent call last):\n" -" File \"../t.py\", line 4, in bug\n" -" raise Exception(\"not consumed\")\n" -"Exception: not consumed" -msgstr "" diff --git a/library/asyncio-eventloop.po b/library/asyncio-eventloop.po index 1c8b1f34f..7f47a321b 100644 --- a/library/asyncio-eventloop.po +++ b/library/asyncio-eventloop.po @@ -1,36 +1,40 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 -# Tetsuo Koyama , 2021 -# Takeshi Nakazato, 2022 -# Arihiro TAKASE, 2023 -# souma987, 2023 +# Arihiro TAKASE, 2017 +# E. Kawashima, 2017 +# Suguru Yamamoto , 2017 +# Shun Sakurai, 2017 +# Masato HASHIMOTO , 2018 +# Osamu NAKAMURA, 2019 +# MS_H, 2019 +# tomo, 2019 +# Naoki Nakamura , 2020 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-06 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:54+0000\n" -"Last-Translator: souma987, 2023\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-08-18 07:17+0000\n" +"PO-Revision-Date: 2017-02-16 17:48+0000\n" +"Last-Translator: Naoki Nakamura , 2020\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: ../../library/asyncio-eventloop.rst:8 +#: ../../library/asyncio-eventloop.rst:6 msgid "Event Loop" msgstr "イベントループ" -#: ../../library/asyncio-eventloop.rst:10 +#: ../../library/asyncio-eventloop.rst:8 msgid "" "**Source code:** :source:`Lib/asyncio/events.py`, :source:`Lib/asyncio/" "base_events.py`" @@ -38,11 +42,11 @@ msgstr "" "**ソースコード:** :source:`Lib/asyncio/profile.py` と :source:`Lib/asyncio/" "pstats.py`" -#: ../../library/asyncio-eventloop.rst:16 +#: ../../library/asyncio-eventloop.rst:14 msgid "Preface" msgstr "まえがき" -#: ../../library/asyncio-eventloop.rst:17 +#: ../../library/asyncio-eventloop.rst:15 msgid "" "The event loop is the core of every asyncio application. Event loops run " "asynchronous tasks and callbacks, perform network IO operations, and run " @@ -52,7 +56,7 @@ msgstr "" "ループは非同期タスクやコールバックを実行し、ネットワーク I/O を処理し、サブプ" "ロセスを実行します。" -#: ../../library/asyncio-eventloop.rst:21 +#: ../../library/asyncio-eventloop.rst:19 msgid "" "Application developers should typically use the high-level asyncio " "functions, such as :func:`asyncio.run`, and should rarely need to reference " @@ -66,45 +70,43 @@ msgstr "" "に対して細かい調整が必要な、低水準のコード、ライブラリ、フレームワークの開発" "者向けです。" -#: ../../library/asyncio-eventloop.rst:28 +#: ../../library/asyncio-eventloop.rst:26 msgid "Obtaining the Event Loop" msgstr "イベントループの取得" -#: ../../library/asyncio-eventloop.rst:29 +#: ../../library/asyncio-eventloop.rst:27 msgid "" "The following low-level functions can be used to get, set, or create an " "event loop:" msgstr "以下の低水準関数はイベントループの取得、設定、生成するために使います:" -#: ../../library/asyncio-eventloop.rst:34 +#: ../../library/asyncio-eventloop.rst:32 msgid "Return the running event loop in the current OS thread." msgstr "現在の OS スレッドで実行中のイベントループを取得します。" -#: ../../library/asyncio-eventloop.rst:36 -msgid "Raise a :exc:`RuntimeError` if there is no running event loop." -msgstr "" - -#: ../../library/asyncio-eventloop.rst:38 -msgid "This function can only be called from a coroutine or a callback." +#: ../../library/asyncio-eventloop.rst:34 +msgid "" +"If there is no running event loop a :exc:`RuntimeError` is raised. This " +"function can only be called from a coroutine or a callback." msgstr "" +"実行中のイベントループがない場合は :exc:`RuntimeError` 例外を送出します。この" +"関数はコルーチンまたはコールバックからのみ呼び出し可能です。" -#: ../../library/asyncio-eventloop.rst:44 +#: ../../library/asyncio-eventloop.rst:41 msgid "Get the current event loop." msgstr "現在のイベントループを取得します。" -#: ../../library/asyncio-eventloop.rst:46 +#: ../../library/asyncio-eventloop.rst:43 msgid "" -"When called from a coroutine or a callback (e.g. scheduled with call_soon or " -"similar API), this function will always return the running event loop." +"If there is no current event loop set in the current OS thread, the OS " +"thread is main, and :func:`set_event_loop` has not yet been called, asyncio " +"will create a new event loop and set it as the current one." msgstr "" +"OS スレッドに現在のイベントループが未設定で、 OS スレッドがメインスレッドであ" +"り、かつ :func:`set_event_loop` がまだ呼び出されていない場合、 asyncio は新し" +"いイベントループを生成し、それを現在のイベントループに設定します。" -#: ../../library/asyncio-eventloop.rst:50 -msgid "" -"If there is no running event loop set, the function will return the result " -"of the ``get_event_loop_policy().get_event_loop()`` call." -msgstr "" - -#: ../../library/asyncio-eventloop.rst:53 +#: ../../library/asyncio-eventloop.rst:48 msgid "" "Because this function has rather complex behavior (especially when custom " "event loop policies are in use), using the :func:`get_running_loop` function " @@ -114,34 +116,23 @@ msgstr "" "なため、コルーチンやコールバックでは :func:`get_event_loop` よりも :func:" "`get_running_loop` を使うほうが好ましいと考えられます。" -#: ../../library/asyncio-eventloop.rst:58 +#: ../../library/asyncio-eventloop.rst:53 msgid "" -"As noted above, consider using the higher-level :func:`asyncio.run` " -"function, instead of using these lower level functions to manually create " -"and close an event loop." +"Consider also using the :func:`asyncio.run` function instead of using lower " +"level functions to manually create and close an event loop." msgstr "" +"また、低水準の関数を使って手作業でイベントループの管理をするかわりに、 :func:" +"`asyncio.run` を使うことを検討してください。" + +#: ../../library/asyncio-eventloop.rst:58 +msgid "Set *loop* as a current event loop for the current OS thread." +msgstr "*loop* を OS スレッドの現在のイベントループに設定します。" #: ../../library/asyncio-eventloop.rst:62 -msgid "Raises a :exc:`RuntimeError` if there is no current event loop." +msgid "Create a new event loop object." msgstr "" -#: ../../library/asyncio-eventloop.rst:67 -msgid "" -"The :mod:`!asyncio` policy system is deprecated and will be removed in " -"Python 3.16; from there on, this function will return the current running " -"event loop if present else it will return the loop set by :func:" -"`set_event_loop`." -msgstr "" - -#: ../../library/asyncio-eventloop.rst:74 -msgid "Set *loop* as the current event loop for the current OS thread." -msgstr "" - -#: ../../library/asyncio-eventloop.rst:78 -msgid "Create and return a new event loop object." -msgstr "新しいイベントループオブジェクトを生成して返します。" - -#: ../../library/asyncio-eventloop.rst:80 +#: ../../library/asyncio-eventloop.rst:64 msgid "" "Note that the behaviour of :func:`get_event_loop`, :func:`set_event_loop`, " "and :func:`new_event_loop` functions can be altered by :ref:`setting a " @@ -151,22 +142,22 @@ msgstr "" "`new_event_loop` 関数の振る舞いは、 :ref:`カスタムイベントループポリシーを設" "定する ` ことにより変更することができます。" -#: ../../library/asyncio-eventloop.rst:86 +#: ../../library/asyncio-eventloop.rst:70 msgid "Contents" msgstr "内容" -#: ../../library/asyncio-eventloop.rst:87 +#: ../../library/asyncio-eventloop.rst:71 msgid "This documentation page contains the following sections:" msgstr "このページは以下の節から構成されます:" -#: ../../library/asyncio-eventloop.rst:89 +#: ../../library/asyncio-eventloop.rst:73 msgid "" "The `Event Loop Methods`_ section is the reference documentation of the " "event loop APIs;" msgstr "" "`イベントループのメソッド`_ 節は、イベントループ API のリファレンスです。" -#: ../../library/asyncio-eventloop.rst:92 +#: ../../library/asyncio-eventloop.rst:76 msgid "" "The `Callback Handles`_ section documents the :class:`Handle` and :class:" "`TimerHandle` instances which are returned from scheduling methods such as :" @@ -176,7 +167,7 @@ msgstr "" "call_later` などのスケジューリングメソッドが返す :class:`Handle` や :class:" "`TimerHandle` インスタンスについて解説しています。 " -#: ../../library/asyncio-eventloop.rst:96 +#: ../../library/asyncio-eventloop.rst:80 msgid "" "The `Server Objects`_ section documents types returned from event loop " "methods like :meth:`loop.create_server`;" @@ -184,7 +175,7 @@ msgstr "" "`サーバーオブジェクト`_ 節は :meth:`loop.create_server` のようなメソッドが返" "す型について解説しています。" -#: ../../library/asyncio-eventloop.rst:99 +#: ../../library/asyncio-eventloop.rst:83 msgid "" "The `Event Loop Implementations`_ section documents the :class:" "`SelectorEventLoop` and :class:`ProactorEventLoop` classes;" @@ -192,29 +183,29 @@ msgstr "" "`イベントループの実装`_ 節は :class:`SelectorEventLoop` と :class:" "`ProactorEventLoop` の2つのクラスについて解説しています。" -#: ../../library/asyncio-eventloop.rst:102 +#: ../../library/asyncio-eventloop.rst:86 msgid "" "The `Examples`_ section showcases how to work with some event loop APIs." msgstr "`使用例`_ 節ではイベントループ API の具体的な使い方を紹介しています。" -#: ../../library/asyncio-eventloop.rst:109 +#: ../../library/asyncio-eventloop.rst:93 msgid "Event Loop Methods" msgstr "イベントループのメソッド" -#: ../../library/asyncio-eventloop.rst:111 +#: ../../library/asyncio-eventloop.rst:95 msgid "Event loops have **low-level** APIs for the following:" msgstr "イベントループは以下の **低水準な** API を持っています:" -#: ../../library/asyncio-eventloop.rst:119 +#: ../../library/asyncio-eventloop.rst:103 msgid "Running and stopping the loop" msgstr "ループの開始と停止" -#: ../../library/asyncio-eventloop.rst:123 +#: ../../library/asyncio-eventloop.rst:107 msgid "Run until the *future* (an instance of :class:`Future`) has completed." msgstr "" "*フューチャー* (:class:`Future` インスタンス) が完了するまで実行します。" -#: ../../library/asyncio-eventloop.rst:126 +#: ../../library/asyncio-eventloop.rst:110 msgid "" "If the argument is a :ref:`coroutine object ` it is implicitly " "scheduled to run as a :class:`asyncio.Task`." @@ -222,23 +213,27 @@ msgstr "" "引数が :ref:`コルーチンオブジェクト ` の場合、暗黙のうちに :class:" "`asyncio.Task` として実行されるようにスケジュールされます。" -#: ../../library/asyncio-eventloop.rst:129 +#: ../../library/asyncio-eventloop.rst:113 msgid "Return the Future's result or raise its exception." msgstr "Future の結果を返すか、例外を送出します。" -#: ../../library/asyncio-eventloop.rst:133 +#: ../../library/asyncio-eventloop.rst:117 msgid "Run the event loop until :meth:`stop` is called." msgstr ":meth:`stop` が呼び出されるまでイベントループを実行します。" -#: ../../library/asyncio-eventloop.rst:135 +#: ../../library/asyncio-eventloop.rst:119 msgid "" -"If :meth:`stop` is called before :meth:`run_forever` is called, the loop " +"If :meth:`stop` is called before :meth:`run_forever()` is called, the loop " "will poll the I/O selector once with a timeout of zero, run all callbacks " "scheduled in response to I/O events (and those that were already scheduled), " "and then exit." msgstr "" +":meth:`run_forever()` メソッドが呼ばれるより前に :meth:`stop` メソッドが呼ば" +"れた場合、イベントループはタイムアウトをゼロにして一度だけ I/O セレクタの問い" +"合わせ処理を行い、 I/O イベントに対してスケジュールされた全てのコールバック " +"(および既にスケジュール済みのコールバック) を実行したのち、終了します。" -#: ../../library/asyncio-eventloop.rst:140 +#: ../../library/asyncio-eventloop.rst:124 msgid "" "If :meth:`stop` is called while :meth:`run_forever` is running, the loop " "will run the current batch of callbacks and then exit. Note that new " @@ -253,23 +248,23 @@ msgstr "" "は、次に :meth:`run_forever` または :meth:`run_until_complete` が呼び出された" "ときに実行されます。" -#: ../../library/asyncio-eventloop.rst:148 +#: ../../library/asyncio-eventloop.rst:132 msgid "Stop the event loop." msgstr "イベントループを停止します。" -#: ../../library/asyncio-eventloop.rst:152 +#: ../../library/asyncio-eventloop.rst:136 msgid "Return ``True`` if the event loop is currently running." msgstr "イベントループが現在実行中の場合 ``True`` を返します。" -#: ../../library/asyncio-eventloop.rst:156 +#: ../../library/asyncio-eventloop.rst:140 msgid "Return ``True`` if the event loop was closed." msgstr "イベントループが閉じられていた場合 ``True`` を返します。" -#: ../../library/asyncio-eventloop.rst:160 +#: ../../library/asyncio-eventloop.rst:144 msgid "Close the event loop." msgstr "イベントループをクローズします。" -#: ../../library/asyncio-eventloop.rst:162 +#: ../../library/asyncio-eventloop.rst:146 msgid "" "The loop must not be running when this function is called. Any pending " "callbacks will be discarded." @@ -277,7 +272,7 @@ msgstr "" "この関数が呼び出される時点で、イベントループが実行中であってはいけません。保" "留中のコールバックはすべて破棄されます。" -#: ../../library/asyncio-eventloop.rst:165 +#: ../../library/asyncio-eventloop.rst:149 msgid "" "This method clears all queues and shuts down the executor, but does not wait " "for the executor to finish." @@ -285,7 +280,7 @@ msgstr "" "このメソッドは全てのキューをクリアし、エグゼキューターが実行完了するのを待た" "ずにシャットダウンします。" -#: ../../library/asyncio-eventloop.rst:168 +#: ../../library/asyncio-eventloop.rst:152 msgid "" "This method is idempotent and irreversible. No other methods should be " "called after the event loop is closed." @@ -294,72 +289,51 @@ msgstr "" "トループがクローズされた後、他のいかなるメソッドも呼び出すべきではありませ" "ん。" -#: ../../library/asyncio-eventloop.rst:174 +#: ../../library/asyncio-eventloop.rst:157 msgid "" "Schedule all currently open :term:`asynchronous generator` objects to close " -"with an :meth:`~agen.aclose` call. After calling this method, the event " +"with an :meth:`~agen.aclose()` call. After calling this method, the event " "loop will issue a warning if a new asynchronous generator is iterated. This " "should be used to reliably finalize all scheduled asynchronous generators." msgstr "" +"現在オープンになっているすべての :term:`asynchronous generator` (非同期ジェネ" +"レータ) オブジェクトをスケジュールし、 :meth:`~agen.aclose()` メソッドを呼び" +"出すことでそれらをクローズします。 このメソッドの呼び出し後に新しい非同期ジェ" +"ネレータがイテレートされると、イベントループは警告を発します。このメソッドは" +"スケジュールされたすべての非同期ジェネレータの終了処理を確実に行うために使用" +"すべきです。" -#: ../../library/asyncio-eventloop.rst:180 +#: ../../library/asyncio-eventloop.rst:163 +#: ../../library/asyncio-eventloop.rst:183 msgid "" "Note that there is no need to call this function when :func:`asyncio.run` is " "used." msgstr ":func:`asyncio.run` を使った場合はこの関数を呼び出す必要はありません。" -#: ../../library/asyncio-eventloop.rst:183 -#: ../../library/asyncio-eventloop.rst:1336 -#: ../../library/asyncio-eventloop.rst:1792 +#: ../../library/asyncio-eventloop.rst:166 +#: ../../library/asyncio-eventloop.rst:1078 +#: ../../library/asyncio-eventloop.rst:1460 msgid "Example::" msgstr "以下はプログラム例です::" -#: ../../library/asyncio-eventloop.rst:185 -msgid "" -"try:\n" -" loop.run_forever()\n" -"finally:\n" -" loop.run_until_complete(loop.shutdown_asyncgens())\n" -" loop.close()" -msgstr "" - -#: ../../library/asyncio-eventloop.rst:196 +#: ../../library/asyncio-eventloop.rst:178 msgid "" "Schedule the closure of the default executor and wait for it to join all of " -"the threads in the :class:`~concurrent.futures.ThreadPoolExecutor`. Once " -"this method has been called, using the default executor with :meth:`loop." -"run_in_executor` will raise a :exc:`RuntimeError`." -msgstr "" - -#: ../../library/asyncio-eventloop.rst:202 -msgid "" -"The *timeout* parameter specifies the amount of time (in :class:`float` " -"seconds) the executor will be given to finish joining. With the default, " -"``None``, the executor is allowed an unlimited amount of time." -msgstr "" - -#: ../../library/asyncio-eventloop.rst:207 -msgid "" -"If the *timeout* is reached, a :exc:`RuntimeWarning` is emitted and the " -"default executor is terminated without waiting for its threads to finish " -"joining." +"the threads in the :class:`ThreadPoolExecutor`. After calling this method, " +"a :exc:`RuntimeError` will be raised if :meth:`loop.run_in_executor` is " +"called while using the default executor." msgstr "" +"デフォルトエグゼキューターのクローズをスケジュールし、 :class:" +"`ThreadPoolExecutor` 内の全てのスレッドの処理が完了するまで待機 (join同期処" +"理) します。 この関数呼び出し後、デフォルトエグゼキューターを使っている状態" +"で :meth:`loop.run_in_executor` メソッドが呼び出されると、 :exc:" +"`RuntimeError` 例外を送出します。" -#: ../../library/asyncio-eventloop.rst:213 -msgid "" -"Do not call this method when using :func:`asyncio.run`, as the latter " -"handles default executor shutdown automatically." -msgstr "" - -#: ../../library/asyncio-eventloop.rst:218 -msgid "Added the *timeout* parameter." -msgstr "" - -#: ../../library/asyncio-eventloop.rst:222 +#: ../../library/asyncio-eventloop.rst:190 msgid "Scheduling callbacks" msgstr "コールバックのスケジューリング" -#: ../../library/asyncio-eventloop.rst:226 +#: ../../library/asyncio-eventloop.rst:194 msgid "" "Schedule the *callback* :term:`callback` to be called with *args* arguments " "at the next iteration of the event loop." @@ -367,13 +341,7 @@ msgstr "" "イベントループの次のイテレーションで *callback* に指定したコールバック (:" "term:`callback`) を *args* 引数で呼び出すようにスケジュールします。" -#: ../../library/asyncio-eventloop.rst:229 -msgid "" -"Return an instance of :class:`asyncio.Handle`, which can be used later to " -"cancel the callback." -msgstr "" - -#: ../../library/asyncio-eventloop.rst:232 +#: ../../library/asyncio-eventloop.rst:197 msgid "" "Callbacks are called in the order in which they are registered. Each " "callback will be called exactly once." @@ -381,32 +349,38 @@ msgstr "" "コールバックは登録された順に呼び出されます。各コールバックは厳密に1回だけ呼び" "出されます。" -#: ../../library/asyncio-eventloop.rst:235 +#: ../../library/asyncio-eventloop.rst:200 +#: ../../library/asyncio-eventloop.rst:267 msgid "" -"The optional keyword-only *context* argument specifies a custom :class:" -"`contextvars.Context` for the *callback* to run in. Callbacks use the " -"current context when no *context* is provided." -msgstr "" - -#: ../../library/asyncio-eventloop.rst:239 -msgid "Unlike :meth:`call_soon_threadsafe`, this method is not thread-safe." +"An optional keyword-only *context* argument allows specifying a custom :" +"class:`contextvars.Context` for the *callback* to run in. The current " +"context is used when no *context* is provided." msgstr "" +"オプションのキーワード引数 *context* を使って、コールバック*callback* を実行" +"する際のコンテキスト :class:`contextvars.Context` を設定することができます。" +"コンテキスト *context* が指定されない場合は現在のコンテキストが使われます。" -#: ../../library/asyncio-eventloop.rst:243 +#: ../../library/asyncio-eventloop.rst:204 msgid "" -"A thread-safe variant of :meth:`call_soon`. When scheduling callbacks from " -"another thread, this function *must* be used, since :meth:`call_soon` is not " -"thread-safe." +"An instance of :class:`asyncio.Handle` is returned, which can be used later " +"to cancel the callback." msgstr "" +":class:`asyncio.Handle` のインスタンスを返します。このインスタンスを使ってス" +"ケジュールしたコールバックをキャンセルすることができます。" -#: ../../library/asyncio-eventloop.rst:247 +#: ../../library/asyncio-eventloop.rst:207 +msgid "This method is not thread-safe." +msgstr "このメソッドはスレッドセーフではありません。" + +#: ../../library/asyncio-eventloop.rst:211 msgid "" -"This function is safe to be called from a reentrant context or signal " -"handler, however, it is not safe or fruitful to use the returned handle in " -"such contexts." +"A thread-safe variant of :meth:`call_soon`. Must be used to schedule " +"callbacks *from another thread*." msgstr "" +":meth:`call_soon` のスレッドセーフ版です。必ず *別のスレッドから* コールバッ" +"クをスケジュールする際に使ってください。" -#: ../../library/asyncio-eventloop.rst:250 +#: ../../library/asyncio-eventloop.rst:214 msgid "" "Raises :exc:`RuntimeError` if called on a loop that's been closed. This can " "happen on a secondary thread when the main application is shutting down." @@ -416,16 +390,16 @@ msgstr "" "るにもかかわらずセカンダリスレッドでメソッドが呼び出されるといった場合に起こ" "りえます。" -#: ../../library/asyncio-eventloop.rst:254 +#: ../../library/asyncio-eventloop.rst:218 msgid "" "See the :ref:`concurrency and multithreading ` " "section of the documentation." msgstr "" "このドキュメントの :ref:`asyncio-multithreading` 節を参照してください。" -#: ../../library/asyncio-eventloop.rst:257 -#: ../../library/asyncio-eventloop.rst:307 -#: ../../library/asyncio-eventloop.rst:327 +#: ../../library/asyncio-eventloop.rst:221 +#: ../../library/asyncio-eventloop.rst:271 +#: ../../library/asyncio-eventloop.rst:291 msgid "" "The *context* keyword-only parameter was added. See :pep:`567` for more " "details." @@ -433,7 +407,7 @@ msgstr "" "キーワード引数 *context* が追加されました。詳細は :pep:`567` を参照してくださ" "い。" -#: ../../library/asyncio-eventloop.rst:265 +#: ../../library/asyncio-eventloop.rst:229 msgid "" "Most :mod:`asyncio` scheduling functions don't allow passing keyword " "arguments. To do that, use :func:`functools.partial`::" @@ -442,14 +416,7 @@ msgstr "" "をコールバックに渡すことを許していません。キーワード引数を渡すためには :func:" "`functools.partial` を使ってください:" -#: ../../library/asyncio-eventloop.rst:268 -msgid "" -"# will schedule \"print(\"Hello\", flush=True)\"\n" -"loop.call_soon(\n" -" functools.partial(print, \"Hello\", flush=True))" -msgstr "" - -#: ../../library/asyncio-eventloop.rst:272 +#: ../../library/asyncio-eventloop.rst:236 msgid "" "Using partial objects is usually more convenient than using lambdas, as " "asyncio can render partial objects better in debug and error messages." @@ -458,11 +425,11 @@ msgstr "" "く可視化することができるため、通常はラムダ式よりも partial オブジェクトを使う" "方が便利です。" -#: ../../library/asyncio-eventloop.rst:280 +#: ../../library/asyncio-eventloop.rst:244 msgid "Scheduling delayed callbacks" msgstr "遅延コールバックのスケジューリング" -#: ../../library/asyncio-eventloop.rst:282 +#: ../../library/asyncio-eventloop.rst:246 msgid "" "Event loop provides mechanisms to schedule callback functions to be called " "at some point in the future. Event loop uses monotonic clocks to track time." @@ -471,7 +438,7 @@ msgstr "" "ジュールする仕組みを提供します。イベントループは時刻が戻らない単調な時計 " "(monotonic clock) を使って時刻を追跡します。" -#: ../../library/asyncio-eventloop.rst:289 +#: ../../library/asyncio-eventloop.rst:253 msgid "" "Schedule *callback* to be called after the given *delay* number of seconds " "(can be either an int or a float)." @@ -479,8 +446,8 @@ msgstr "" "*delay* 秒経過後にコールバック関数 *callback* を呼び出すようにスケジュールし" "ます。 *delay* には整数または浮動小数点数を指定します。" -#: ../../library/asyncio-eventloop.rst:292 -#: ../../library/asyncio-eventloop.rst:324 +#: ../../library/asyncio-eventloop.rst:256 +#: ../../library/asyncio-eventloop.rst:288 msgid "" "An instance of :class:`asyncio.TimerHandle` is returned which can be used to " "cancel the callback." @@ -488,7 +455,7 @@ msgstr "" ":class:`asyncio.TimerHandle` のインスタンスを返します。このインスタンスを使っ" "てスケジュールしたコールバックをキャンセルすることができます。" -#: ../../library/asyncio-eventloop.rst:295 +#: ../../library/asyncio-eventloop.rst:259 msgid "" "*callback* will be called exactly once. If two callbacks are scheduled for " "exactly the same time, the order in which they are called is undefined." @@ -496,7 +463,7 @@ msgstr "" "*callback* は厳密に一度だけ呼び出されます。2つのコールバックが完全に同じ時間" "にスケジュールされた場合、呼び出しの順序は未定義です。" -#: ../../library/asyncio-eventloop.rst:299 +#: ../../library/asyncio-eventloop.rst:263 msgid "" "The optional positional *args* will be passed to the callback when it is " "called. If you want the callback to be called with keyword arguments use :" @@ -506,17 +473,7 @@ msgstr "" "渡されます。キーワード引数を指定してコールバックを呼び出したい場合は :func:" "`functools.partial` を使用してください。" -#: ../../library/asyncio-eventloop.rst:303 -msgid "" -"An optional keyword-only *context* argument allows specifying a custom :" -"class:`contextvars.Context` for the *callback* to run in. The current " -"context is used when no *context* is provided." -msgstr "" -"オプションのキーワード引数 *context* を使って、コールバック*callback* を実行" -"する際のコンテキスト :class:`contextvars.Context` を設定することができます。" -"コンテキスト *context* が指定されない場合は現在のコンテキストが使われます。" - -#: ../../library/asyncio-eventloop.rst:311 +#: ../../library/asyncio-eventloop.rst:275 msgid "" "In Python 3.7 and earlier with the default event loop implementation, the " "*delay* could not exceed one day. This has been fixed in Python 3.8." @@ -525,7 +482,7 @@ msgstr "" "用した場合に遅延時間 *delay* が1日を超えることができませんでした。この問題は " "Python 3.8 で修正されました。" -#: ../../library/asyncio-eventloop.rst:318 +#: ../../library/asyncio-eventloop.rst:282 msgid "" "Schedule *callback* to be called at the given absolute timestamp *when* (an " "int or a float), using the same time reference as :meth:`loop.time`." @@ -533,11 +490,11 @@ msgstr "" "絶対値の時刻 *when* (整数または浮動小数点数) にコールバックを呼び出すようにス" "ケジュールします。 :meth:`loop.time` と同じ参照時刻を使用します。" -#: ../../library/asyncio-eventloop.rst:322 +#: ../../library/asyncio-eventloop.rst:286 msgid "This method's behavior is the same as :meth:`call_later`." msgstr "このメソッドの振る舞いは :meth:`call_later` と同じです。" -#: ../../library/asyncio-eventloop.rst:331 +#: ../../library/asyncio-eventloop.rst:295 msgid "" "In Python 3.7 and earlier with the default event loop implementation, the " "difference between *when* and the current time could not exceed one day. " @@ -547,7 +504,7 @@ msgstr "" "用した場合に現在の時刻と *when* との差が1日を超えることができませんでした。こ" "の問題は Python 3.8 で修正されました。" -#: ../../library/asyncio-eventloop.rst:338 +#: ../../library/asyncio-eventloop.rst:302 msgid "" "Return the current time, as a :class:`float` value, according to the event " "loop's internal monotonic clock." @@ -555,7 +512,7 @@ msgstr "" "現在の時刻を :class:`float` 値で返します。時刻はイベントループが内部で参照し" "ている時刻が戻らない単調な時計 (monotonic clock) に従います。" -#: ../../library/asyncio-eventloop.rst:342 +#: ../../library/asyncio-eventloop.rst:306 msgid "" "In Python 3.7 and earlier timeouts (relative *delay* or absolute *when*) " "should not exceed one day. This has been fixed in Python 3.8." @@ -564,20 +521,20 @@ msgstr "" "くは絶対値 *when*) は1日を超えることができませんでした。この問題は Python " "3.8 で修正されました。" -#: ../../library/asyncio-eventloop.rst:348 +#: ../../library/asyncio-eventloop.rst:312 msgid "The :func:`asyncio.sleep` function." msgstr "関数 :func:`asyncio.sleep`。" -#: ../../library/asyncio-eventloop.rst:352 +#: ../../library/asyncio-eventloop.rst:316 msgid "Creating Futures and Tasks" msgstr "フューチャーとタスクの生成" -#: ../../library/asyncio-eventloop.rst:356 +#: ../../library/asyncio-eventloop.rst:320 msgid "Create an :class:`asyncio.Future` object attached to the event loop." msgstr "" "イベントループに接続した :class:`asyncio.Future` オブジェクトを生成します。" -#: ../../library/asyncio-eventloop.rst:358 +#: ../../library/asyncio-eventloop.rst:322 msgid "" "This is the preferred way to create Futures in asyncio. This lets third-" "party event loops provide alternative implementations of the Future object " @@ -587,13 +544,14 @@ msgstr "" "ソッドにより、サードパーティ製のイベントループがFutures クラスの(パフォーマン" "スや計測方法が優れた) 代替実装を提供することを可能にします。 " -#: ../../library/asyncio-eventloop.rst:366 +#: ../../library/asyncio-eventloop.rst:330 msgid "" -"Schedule the execution of :ref:`coroutine ` *coro*. Return a :" -"class:`Task` object." +"Schedule the execution of a :ref:`coroutine`. Return a :class:`Task` object." msgstr "" +":ref:`コルーチン` の実行をスケジュールします。 :class:`Task` オブジェクトを返" +"します。" -#: ../../library/asyncio-eventloop.rst:369 +#: ../../library/asyncio-eventloop.rst:333 msgid "" "Third-party event loops can use their own subclass of :class:`Task` for " "interoperability. In this case, the result type is a subclass of :class:" @@ -602,14 +560,7 @@ msgstr "" "サードパーティのイベントループは相互運用のための自身の :class:`Task` のサブク" "ラスを使用できます。この場合、結果は :class:`Task` のサブクラスになります。" -#: ../../library/asyncio-eventloop.rst:373 -msgid "" -"The full function signature is largely the same as that of the :class:`Task` " -"constructor (or factory) - all of the keyword arguments to this function are " -"passed through to that interface." -msgstr "" - -#: ../../library/asyncio-eventloop.rst:377 +#: ../../library/asyncio-eventloop.rst:337 msgid "" "If the *name* argument is provided and not ``None``, it is set as the name " "of the task using :meth:`Task.set_name`." @@ -617,91 +568,40 @@ msgstr "" "*name* 引数が指定され、値が ``None`` でない場合、 :meth:`Task.set_name` メ" "ソッドにより *name* がタスクの名前として設定されます。" -#: ../../library/asyncio-eventloop.rst:380 -msgid "" -"An optional keyword-only *context* argument allows specifying a custom :" -"class:`contextvars.Context` for the *coro* to run in. The current context " -"copy is created when no *context* is provided." -msgstr "" -"省略可能なキーワード引数 *context* によって、*coro* を実行するためのカスタム" -"の :class:`contextvars.Context` を指定できます。*context* が省略された場合、" -"現在のコンテキストのコピーが作成されます。" +#: ../../library/asyncio-eventloop.rst:340 +msgid "Added the ``name`` parameter." +msgstr "``name`` パラメータが追加されました。" -#: ../../library/asyncio-eventloop.rst:384 -msgid "" -"An optional keyword-only *eager_start* argument allows specifying if the " -"task should execute eagerly during the call to create_task, or be scheduled " -"later. If *eager_start* is not passed the mode set by :meth:`loop." -"set_task_factory` will be used." -msgstr "" - -#: ../../library/asyncio-eventloop.rst:389 -msgid "Added the *name* parameter." -msgstr "*name* パラメータを追加しました。" - -#: ../../library/asyncio-eventloop.rst:392 -msgid "Added the *context* parameter." -msgstr "*context* パラメータを追加しました。" - -#: ../../library/asyncio-eventloop.rst:395 -msgid "" -"Added ``kwargs`` which passes on arbitrary extra parameters, including " -"``name`` and ``context``." -msgstr "" - -#: ../../library/asyncio-eventloop.rst:398 -msgid "" -"Rolled back the change that passes on *name* and *context* (if it is None), " -"while still passing on other arbitrary keyword arguments (to avoid breaking " -"backwards compatibility with 3.13.3)." -msgstr "" - -#: ../../library/asyncio-eventloop.rst:402 -msgid "" -"All *kwargs* are now passed on. The *eager_start* parameter works with eager " -"task factories." -msgstr "" - -#: ../../library/asyncio-eventloop.rst:407 +#: ../../library/asyncio-eventloop.rst:345 msgid "Set a task factory that will be used by :meth:`loop.create_task`." msgstr ":meth:`loop.create_task` が使用するタスクファクトリーを設定します。" -#: ../../library/asyncio-eventloop.rst:410 +#: ../../library/asyncio-eventloop.rst:348 msgid "" "If *factory* is ``None`` the default task factory will be set. Otherwise, " -"*factory* must be a *callable* with the signature matching ``(loop, coro, " -"**kwargs)``, where *loop* is a reference to the active event loop, and " -"*coro* is a coroutine object. The callable must pass on all *kwargs*, and " -"return a :class:`asyncio.Task`-compatible object." -msgstr "" - -#: ../../library/asyncio-eventloop.rst:416 -msgid "Required that all *kwargs* are passed on to :class:`asyncio.Task`." -msgstr "" +"*factory* must be a *callable* with the signature matching ``(loop, coro)``, " +"where *loop* is a reference to the active event loop, and *coro* is a " +"coroutine object. The callable must return a :class:`asyncio.Future`-" +"compatible object." +msgstr "" +"*factory* が ``None`` の場合、デフォルトのタスクファクトリーが設定されます。" +"そうでなければ、 *factory* は ``(loop, coro)`` に一致する関数シグネチャを持っ" +"た *呼び出し可能オブジェクト* でなければなりません。ここで *loop* はアクティ" +"ブなイベントループへの参照であり、 *coro* はコルーチンオブジェクトです。呼び" +"出し可能オブジェクトは :class:`asyncio.Future` と互換性のあるオブジェクトを返" +"さなければなりません。" -#: ../../library/asyncio-eventloop.rst:419 -msgid "" -"*name* is no longer passed to task factories. *context* is no longer passed " -"to task factories if it is ``None``." -msgstr "" - -#: ../../library/asyncio-eventloop.rst:423 -msgid "" -"*name* and *context* are now unconditionally passed on to task factories " -"again." -msgstr "" - -#: ../../library/asyncio-eventloop.rst:428 +#: ../../library/asyncio-eventloop.rst:356 msgid "Return a task factory or ``None`` if the default one is in use." msgstr "" "タスクファクトリを返します。デフォルトのタスクファクトリを使用中の場合は " "``None`` を返します。" -#: ../../library/asyncio-eventloop.rst:432 +#: ../../library/asyncio-eventloop.rst:360 msgid "Opening network connections" msgstr "ネットワーク接続の確立" -#: ../../library/asyncio-eventloop.rst:444 +#: ../../library/asyncio-eventloop.rst:369 msgid "" "Open a streaming transport connection to a given address specified by *host* " "and *port*." @@ -709,20 +609,23 @@ msgstr "" "*host* と *port* で指定されたアドレスとのストリーミングトランスポート接続を" "オープンします。" -#: ../../library/asyncio-eventloop.rst:447 +#: ../../library/asyncio-eventloop.rst:372 msgid "" -"The socket family can be either :py:const:`~socket.AF_INET` or :py:const:" +"The socket family can be either :py:data:`~socket.AF_INET` or :py:data:" "`~socket.AF_INET6` depending on *host* (or the *family* argument, if " "provided)." msgstr "" +"ソケットファミリーは *host* (または *family* 引数が与えられた場合は " +"*family*) に依存し、 :py:data:`~socket.AF_INET` か :py:data:`~socket." +"AF_INET6` のいずれかを指定します。" -#: ../../library/asyncio-eventloop.rst:451 -msgid "The socket type will be :py:const:`~socket.SOCK_STREAM`." -msgstr "" +#: ../../library/asyncio-eventloop.rst:376 +msgid "The socket type will be :py:data:`~socket.SOCK_STREAM`." +msgstr "ソケットタイプは :py:data:`~socket.SOCK_STREAM` になります。" -#: ../../library/asyncio-eventloop.rst:453 -#: ../../library/asyncio-eventloop.rst:1246 -#: ../../library/asyncio-eventloop.rst:1263 +#: ../../library/asyncio-eventloop.rst:378 +#: ../../library/asyncio-eventloop.rst:994 +#: ../../library/asyncio-eventloop.rst:1010 msgid "" "*protocol_factory* must be a callable returning an :ref:`asyncio protocol " "` implementation." @@ -730,7 +633,7 @@ msgstr "" "*protocol_factory* は :ref:`asyncio プロトコル ` の実装を返" "す呼び出し可能オブジェクトでなければなりません。" -#: ../../library/asyncio-eventloop.rst:456 +#: ../../library/asyncio-eventloop.rst:381 msgid "" "This method will try to establish the connection in the background. When " "successful, it returns a ``(transport, protocol)`` pair." @@ -738,11 +641,11 @@ msgstr "" "このメソッドはバックグラウンドで接続の確立を試みます。成功した場合、メソッド" "は ``(transport, protocol)`` のペアを返します。" -#: ../../library/asyncio-eventloop.rst:459 +#: ../../library/asyncio-eventloop.rst:384 msgid "The chronological synopsis of the underlying operation is as follows:" msgstr "時系列での下層処理の概要は以下のとおりです:" -#: ../../library/asyncio-eventloop.rst:461 +#: ../../library/asyncio-eventloop.rst:386 msgid "" "The connection is established and a :ref:`transport ` is " "created for it." @@ -750,7 +653,7 @@ msgstr "" "接続を確立し、その接続に対する :ref:`トランスポート ` が生" "成されます。" -#: ../../library/asyncio-eventloop.rst:464 +#: ../../library/asyncio-eventloop.rst:389 msgid "" "*protocol_factory* is called without arguments and is expected to return a :" "ref:`protocol ` instance." @@ -758,7 +661,7 @@ msgstr "" "*protocol_factory* が引数なしで呼び出され、ファクトリが :ref:`プロトコル " "` インスタンスを返すよう要求します。" -#: ../../library/asyncio-eventloop.rst:467 +#: ../../library/asyncio-eventloop.rst:392 msgid "" "The protocol instance is coupled with the transport by calling its :meth:" "`~BaseProtocol.connection_made` method." @@ -766,21 +669,21 @@ msgstr "" "プロトコルインスタンスが :meth:`~BaseProtocol.connection_made` メソッドを呼び" "出すことにより、トランスポートと紐付けられます。" -#: ../../library/asyncio-eventloop.rst:470 +#: ../../library/asyncio-eventloop.rst:395 msgid "A ``(transport, protocol)`` tuple is returned on success." msgstr "成功すると ``(transport, protocol)`` タプルが返されます。" -#: ../../library/asyncio-eventloop.rst:472 +#: ../../library/asyncio-eventloop.rst:397 msgid "" "The created transport is an implementation-dependent bidirectional stream." msgstr "作成されたトランスポートは実装依存の双方向ストリームです。" -#: ../../library/asyncio-eventloop.rst:475 -#: ../../library/asyncio-eventloop.rst:608 +#: ../../library/asyncio-eventloop.rst:400 +#: ../../library/asyncio-eventloop.rst:522 msgid "Other arguments:" msgstr "その他の引数:" -#: ../../library/asyncio-eventloop.rst:477 +#: ../../library/asyncio-eventloop.rst:402 msgid "" "*ssl*: if given and not false, a SSL/TLS transport is created (by default a " "plain TCP transport is created). If *ssl* is a :class:`ssl.SSLContext` " @@ -794,11 +697,11 @@ msgstr "" "るために使用されます; *ssl* が :const:`True` の場合、 :func:`ssl." "create_default_context` が返すデフォルトのコンテキストが使われます。" -#: ../../library/asyncio-eventloop.rst:483 +#: ../../library/asyncio-eventloop.rst:408 msgid ":ref:`SSL/TLS security considerations `" msgstr ":ref:`SSL/TLS セキュリティについての考察 `" -#: ../../library/asyncio-eventloop.rst:485 +#: ../../library/asyncio-eventloop.rst:410 msgid "" "*server_hostname* sets or overrides the hostname that the target server's " "certificate will be matched against. Should only be passed if *ssl* is not " @@ -816,7 +719,7 @@ msgstr "" "致確認は行われません (これは深刻なセキュリティリスクであり、中間者攻撃を受け" "る可能性があります)。" -#: ../../library/asyncio-eventloop.rst:493 +#: ../../library/asyncio-eventloop.rst:418 msgid "" "*family*, *proto*, *flags* are the optional address family, protocol and " "flags to be passed through to getaddrinfo() for *host* resolution. If given, " @@ -828,7 +731,7 @@ msgstr "" "ンが与えられた場合、これらはすべて :mod:`socket` モジュール定数に従った整数で" "なければなりません。" -#: ../../library/asyncio-eventloop.rst:498 +#: ../../library/asyncio-eventloop.rst:423 msgid "" "*happy_eyeballs_delay*, if given, enables Happy Eyeballs for this " "connection. It should be a floating-point number representing the amount of " @@ -843,7 +746,7 @@ msgstr "" "定義されている \"接続試行遅延\" に相当します。RFC で推奨されている実用的なデ" "フォルト値は ``0.25`` (250 ミリ秒) です。" -#: ../../library/asyncio-eventloop.rst:506 +#: ../../library/asyncio-eventloop.rst:431 msgid "" "*interleave* controls address reordering when a host name resolves to " "multiple IP addresses. If ``0`` or unspecified, no reordering is done, and " @@ -862,7 +765,7 @@ msgstr "" "*happy_eyeballs_delay* が指定されない場合は ``0`` であり、指定された場合は " "``1`` です。" -#: ../../library/asyncio-eventloop.rst:515 +#: ../../library/asyncio-eventloop.rst:440 msgid "" "*sock*, if given, should be an existing, already connected :class:`socket." "socket` object to be used by the transport. If *sock* is given, none of " @@ -874,16 +777,7 @@ msgstr "" "*port*、 *family*、 *proto*、 *flags*、 *happy_eyeballs_delay*、 " "*interleave* および *local_addr* のいずれも指定してはいけません。" -#: ../../library/asyncio-eventloop.rst:523 -#: ../../library/asyncio-eventloop.rst:639 -#: ../../library/asyncio-eventloop.rst:887 -msgid "" -"The *sock* argument transfers ownership of the socket to the transport " -"created. To close the socket, call the transport's :meth:`~asyncio." -"BaseTransport.close` method." -msgstr "" - -#: ../../library/asyncio-eventloop.rst:527 +#: ../../library/asyncio-eventloop.rst:446 msgid "" "*local_addr*, if given, is a ``(local_host, local_port)`` tuple used to bind " "the socket locally. The *local_host* and *local_port* are looked up using " @@ -894,8 +788,8 @@ msgstr "" "*local_port* は、 *host* および *port* と同じく ``getaddrinfo()`` を使って" "ルックアップされます。" -#: ../../library/asyncio-eventloop.rst:531 -#: ../../library/asyncio-eventloop.rst:983 +#: ../../library/asyncio-eventloop.rst:450 +#: ../../library/asyncio-eventloop.rst:803 msgid "" "*ssl_handshake_timeout* is (for a TLS connection) the time in seconds to " "wait for the TLS handshake to complete before aborting the connection. " @@ -905,76 +799,47 @@ msgstr "" "の) 待ち時間を秒単位で指定します。指定した待ち時間を超えると接続は中断しま" "す。 ``None`` が与えられた場合はデフォルト値 ``60.0`` が使われます。" -#: ../../library/asyncio-eventloop.rst:535 -#: ../../library/asyncio-eventloop.rst:794 -#: ../../library/asyncio-eventloop.rst:898 -#: ../../library/asyncio-eventloop.rst:987 -msgid "" -"*ssl_shutdown_timeout* is the time in seconds to wait for the SSL shutdown " -"to complete before aborting the connection. ``30.0`` seconds if ``None`` " -"(default)." -msgstr "" - -#: ../../library/asyncio-eventloop.rst:539 -msgid "" -"*all_errors* determines what exceptions are raised when a connection cannot " -"be created. By default, only a single ``Exception`` is raised: the first " -"exception if there is only one or all errors have same message, or a single " -"``OSError`` with the error messages combined. When ``all_errors`` is " -"``True``, an ``ExceptionGroup`` will be raised containing all exceptions " -"(even if there is only one)." -msgstr "" - -#: ../../library/asyncio-eventloop.rst:549 -#: ../../library/asyncio-eventloop.rst:806 -msgid "Added support for SSL/TLS in :class:`ProactorEventLoop`." -msgstr "" -":class:`ProactorEventLoop` において SSL/TLS のサポートが追加されました。" - -#: ../../library/asyncio-eventloop.rst:553 -msgid "" -"The socket option :ref:`socket.TCP_NODELAY ` is set " -"by default for all TCP connections." -msgstr "" - -#: ../../library/asyncio-eventloop.rst:558 -#: ../../library/asyncio-eventloop.rst:908 -msgid "Added the *ssl_handshake_timeout* parameter." -msgstr "" - -#: ../../library/asyncio-eventloop.rst:562 +#: ../../library/asyncio-eventloop.rst:456 msgid "Added the *happy_eyeballs_delay* and *interleave* parameters." msgstr "*happy_eyeballs_delay* と *interleave* が追加されました。" -#: ../../library/asyncio-eventloop.rst:564 +#: ../../library/asyncio-eventloop.rst:458 msgid "" "Happy Eyeballs Algorithm: Success with Dual-Stack Hosts. When a server's " "IPv4 path and protocol are working, but the server's IPv6 path and protocol " "are not working, a dual-stack client application experiences significant " "connection delay compared to an IPv4-only client. This is undesirable " -"because it causes the dual-stack client to have a worse user experience. " +"because it causes the dual- stack client to have a worse user experience. " "This document specifies requirements for algorithms that reduce this user-" "visible delay and provides an algorithm." msgstr "" -#: ../../library/asyncio-eventloop.rst:573 -msgid "For more information: https://datatracker.ietf.org/doc/html/rfc6555" +#: ../../library/asyncio-eventloop.rst:467 +msgid "For more information: https://tools.ietf.org/html/rfc6555" +msgstr "詳しくは右記を参照してください: https://tools.ietf.org/html/rfc6555" + +#: ../../library/asyncio-eventloop.rst:471 +#: ../../library/asyncio-eventloop.rst:588 +#: ../../library/asyncio-eventloop.rst:741 +msgid "The *ssl_handshake_timeout* parameter." msgstr "" -#: ../../library/asyncio-eventloop.rst:577 -#: ../../library/asyncio-eventloop.rst:703 -#: ../../library/asyncio-eventloop.rst:820 -#: ../../library/asyncio-eventloop.rst:860 -#: ../../library/asyncio-eventloop.rst:912 -#: ../../library/asyncio-eventloop.rst:995 -msgid "Added the *ssl_shutdown_timeout* parameter." -msgstr "*ssl_shutdown_timeout* パラメータが追加されました。" +#: ../../library/asyncio-eventloop.rst:475 +#: ../../library/asyncio-eventloop.rst:671 +msgid "" +"The socket option :py:data:`~socket.TCP_NODELAY` is set by default for all " +"TCP connections." +msgstr "" +"全ての TCP 接続に対してデフォルトでソケットオプション :py:data:`~socket." +"TCP_NODELAY` が設定されるようになりました。" -#: ../../library/asyncio-eventloop.rst:579 -msgid "*all_errors* was added." -msgstr "*all_errors* が追加されました" +#: ../../library/asyncio-eventloop.rst:480 +#: ../../library/asyncio-eventloop.rst:676 +msgid "Added support for SSL/TLS in :class:`ProactorEventLoop`." +msgstr "" +":class:`ProactorEventLoop` において SSL/TLS のサポートが追加されました。" -#: ../../library/asyncio-eventloop.rst:584 +#: ../../library/asyncio-eventloop.rst:484 msgid "" "The :func:`open_connection` function is a high-level alternative API. It " "returns a pair of (:class:`StreamReader`, :class:`StreamWriter`) that can be " @@ -984,24 +849,59 @@ msgstr "" "`StreamReader`, :class:`StreamWriter`) のペアを返し、 async/await コードから" "直接使うことができます。" -#: ../../library/asyncio-eventloop.rst:595 +#: ../../library/asyncio-eventloop.rst:495 +msgid "" +"The parameter *reuse_address* is no longer supported, as using :py:data:" +"`~sockets.SO_REUSEADDR` poses a significant security concern for UDP. " +"Explicitly passing ``reuse_address=True`` will raise an exception." +msgstr "" +":py:data:`~sockets.SO_REUSEADDR` の利用が UDP に対して重大なセキュリティ上の" +"懸念をもたらすため、 *reuse_address* パラメータはサポートされなくなりました。" +"明示的に ``reuse_address=True`` を設定すると例外を送出します。" + +#: ../../library/asyncio-eventloop.rst:499 +msgid "" +"When multiple processes with differing UIDs assign sockets to an identical " +"UDP socket address with ``SO_REUSEADDR``, incoming packets can become " +"randomly distributed among the sockets." +msgstr "" +"``SO_REUSEADDR`` を使って、同一の UDP ソケットアドレスに対して複数のプロセス" +"が異なる UID でソケットを割り当てている場合、受信パケットは複数のソケット間に" +"ランダムに分散する可能性があります。" + +#: ../../library/asyncio-eventloop.rst:503 +msgid "" +"For supported platforms, *reuse_port* can be used as a replacement for " +"similar functionality. With *reuse_port*, :py:data:`~sockets.SO_REUSEPORT` " +"is used instead, which specifically prevents processes with differing UIDs " +"from assigning sockets to the same socket address." +msgstr "" +"サポートされているプラットフォームでは、 *reuse_port* が同様の機能に対する代" +"用品として利用できます。 *reuse_port* は代替機能として :py:data:`~sockets." +"SO_REUSEPORT` を使っており、複数のプロセスが異なる UID で同一のソケットに対し" +"て割り当てられるのを明確に禁止します。" + +#: ../../library/asyncio-eventloop.rst:509 msgid "Create a datagram connection." msgstr "データグラム接続 (UDP) を生成します。" -#: ../../library/asyncio-eventloop.rst:597 +#: ../../library/asyncio-eventloop.rst:511 msgid "" -"The socket family can be either :py:const:`~socket.AF_INET`, :py:const:" -"`~socket.AF_INET6`, or :py:const:`~socket.AF_UNIX`, depending on *host* (or " +"The socket family can be either :py:data:`~socket.AF_INET`, :py:data:" +"`~socket.AF_INET6`, or :py:data:`~socket.AF_UNIX`, depending on *host* (or " "the *family* argument, if provided)." msgstr "" +"ソケットファミリーは *host* (または *family* 引数が与えられた場合は " +"*family*) に依存し、 :py:data:`~socket.AF_INET`、 :py:data:`~socket." +"AF_INET6`、 :py:data:`~socket.AF_UNIX` のいずれかを指定します。" -#: ../../library/asyncio-eventloop.rst:601 -msgid "The socket type will be :py:const:`~socket.SOCK_DGRAM`." -msgstr "" +#: ../../library/asyncio-eventloop.rst:515 +msgid "The socket type will be :py:data:`~socket.SOCK_DGRAM`." +msgstr "ソケットタイプは :py:data:`~socket.SOCK_DGRAM` になります。" -#: ../../library/asyncio-eventloop.rst:603 -#: ../../library/asyncio-eventloop.rst:730 -#: ../../library/asyncio-eventloop.rst:879 +#: ../../library/asyncio-eventloop.rst:517 +#: ../../library/asyncio-eventloop.rst:613 +#: ../../library/asyncio-eventloop.rst:724 msgid "" "*protocol_factory* must be a callable returning a :ref:`protocol ` implementation." @@ -1009,12 +909,12 @@ msgstr "" "*protocol_factory* は :ref:`asyncio プロトコル ` の実装を返" "す呼び出し可能オブジェクトでなければなりません。" -#: ../../library/asyncio-eventloop.rst:606 -#: ../../library/asyncio-eventloop.rst:685 +#: ../../library/asyncio-eventloop.rst:520 +#: ../../library/asyncio-eventloop.rst:574 msgid "A tuple of ``(transport, protocol)`` is returned on success." msgstr "成功すると ``(transport, protocol)`` タプルが返されます。" -#: ../../library/asyncio-eventloop.rst:610 +#: ../../library/asyncio-eventloop.rst:524 msgid "" "*local_addr*, if given, is a ``(local_host, local_port)`` tuple used to bind " "the socket locally. The *local_host* and *local_port* are looked up using :" @@ -1024,7 +924,7 @@ msgstr "" "``(local_host, local_port)`` のタプルを指定します。 *local_host* と " "*local_port* は :meth:`getaddrinfo` メソッドを使用して検索されます。" -#: ../../library/asyncio-eventloop.rst:614 +#: ../../library/asyncio-eventloop.rst:528 msgid "" "*remote_addr*, if given, is a ``(remote_host, remote_port)`` tuple used to " "connect the socket to a remote address. The *remote_host* and *remote_port* " @@ -1034,7 +934,7 @@ msgstr "" "ケットをリモートアドレスに束縛するために使用されます。*remote_host* と " "*remote_port* は :meth:`getaddrinfo` を使用して検索されます。" -#: ../../library/asyncio-eventloop.rst:618 +#: ../../library/asyncio-eventloop.rst:532 msgid "" "*family*, *proto*, *flags* are the optional address family, protocol and " "flags to be passed through to :meth:`getaddrinfo` for *host* resolution. If " @@ -1046,16 +946,22 @@ msgstr "" "渡されます。これらのオプションを指定する場合、すべて :mod:`socket` モジュール" "定数に従った整数でなければなりません。" -#: ../../library/asyncio-eventloop.rst:623 +#: ../../library/asyncio-eventloop.rst:537 msgid "" "*reuse_port* tells the kernel to allow this endpoint to be bound to the same " "port as other existing endpoints are bound to, so long as they all set this " "flag when being created. This option is not supported on Windows and some " -"Unixes. If the :ref:`socket.SO_REUSEPORT ` constant " -"is not defined then this capability is unsupported." +"Unixes. If the :py:data:`~socket.SO_REUSEPORT` constant is not defined then " +"this capability is unsupported." msgstr "" +"*reuse_port* は、同じポートにバインドされた既存の端点すべてがこのフラグを設定" +"して生成されている場合に限り、この端点を既存の端点と同じポートにバインドする" +"ことを許可するよう、カーネルに指示します(訳註: ソケットのオプション " +"SO_REUSEPORT を使用します)。このオプションは、Windows やいくつかの UNIX シス" +"テムではサポートされていません。:py:data:`~socket.SO_REUSEPORT` 定数が定義さ" +"れていなければ、この機能はサポートされません。" -#: ../../library/asyncio-eventloop.rst:629 +#: ../../library/asyncio-eventloop.rst:543 msgid "" "*allow_broadcast* tells the kernel to allow this endpoint to send messages " "to the broadcast address." @@ -1063,7 +969,7 @@ msgstr "" "*allow_broadcast* は、カーネルに、このエンドポイントがブロードキャストアドレ" "スにメッセージを送信することを許可するように指示します。" -#: ../../library/asyncio-eventloop.rst:632 +#: ../../library/asyncio-eventloop.rst:546 msgid "" "*sock* can optionally be specified in order to use a preexisting, already " "connected, :class:`socket.socket` object to be used by the transport. If " @@ -1075,7 +981,7 @@ msgstr "" "用する場合、*local_addr* と *remote_addr* は省略してください (:const:`None` " "でなければなりません)。" -#: ../../library/asyncio-eventloop.rst:643 +#: ../../library/asyncio-eventloop.rst:551 msgid "" "See :ref:`UDP echo client protocol ` and :" "ref:`UDP echo server protocol ` examples." @@ -1084,58 +990,39 @@ msgstr "" "よび :ref:`UDP echo サーバープロトコル ` の" "例を参照してください。" -#: ../../library/asyncio-eventloop.rst:646 +#: ../../library/asyncio-eventloop.rst:554 msgid "" -"The *family*, *proto*, *flags*, *reuse_address*, *reuse_port*, " +"The *family*, *proto*, *flags*, *reuse_address*, *reuse_port, " "*allow_broadcast*, and *sock* parameters were added." msgstr "" +"*family*, *proto*, *flags*, *reuse_address*, *reuse_port, *allow_broadcast*, " +"*sock* パラメータが追加されました。" -#: ../../library/asyncio-eventloop.rst:650 -msgid "Added support for Windows." -msgstr "Windows サポートが追加されました。" - -#: ../../library/asyncio-eventloop.rst:653 -msgid "" -"The *reuse_address* parameter is no longer supported, as using :ref:`socket." -"SO_REUSEADDR ` poses a significant security concern " -"for UDP. Explicitly passing ``reuse_address=True`` will raise an exception." -msgstr "" - -#: ../../library/asyncio-eventloop.rst:659 -msgid "" -"When multiple processes with differing UIDs assign sockets to an identical " -"UDP socket address with ``SO_REUSEADDR``, incoming packets can become " -"randomly distributed among the sockets." -msgstr "" -"``SO_REUSEADDR`` を使って、同一の UDP ソケットアドレスに対して複数のプロセス" -"が異なる UID でソケットを割り当てている場合、受信パケットは複数のソケット間に" -"ランダムに分散する可能性があります。" - -#: ../../library/asyncio-eventloop.rst:663 +#: ../../library/asyncio-eventloop.rst:558 msgid "" -"For supported platforms, *reuse_port* can be used as a replacement for " -"similar functionality. With *reuse_port*, :ref:`socket.SO_REUSEPORT ` is used instead, which specifically prevents processes with " -"differing UIDs from assigning sockets to the same socket address." +"The *reuse_address* parameter is no longer supported due to security " +"concerns." msgstr "" +"セキュリティ上の懸念により、 *reuse_address* パラメータはサポートされなくなり" +"ました。" -#: ../../library/asyncio-eventloop.rst:670 -msgid "" -"The *reuse_address* parameter, disabled since Python 3.8.1, 3.7.6 and " -"3.6.10, has been entirely removed." -msgstr "" +#: ../../library/asyncio-eventloop.rst:562 +msgid "Added support for Windows." +msgstr "Windows サポートが追加されました。" -#: ../../library/asyncio-eventloop.rst:680 +#: ../../library/asyncio-eventloop.rst:569 msgid "Create a Unix connection." msgstr "Unix 接続を生成します。" -#: ../../library/asyncio-eventloop.rst:682 +#: ../../library/asyncio-eventloop.rst:571 msgid "" -"The socket family will be :py:const:`~socket.AF_UNIX`; socket type will be :" -"py:const:`~socket.SOCK_STREAM`." +"The socket family will be :py:data:`~socket.AF_UNIX`; socket type will be :" +"py:data:`~socket.SOCK_STREAM`." msgstr "" +"ソケットファミリーは :py:data:`~socket.AF_UNIX` になります; また、ソケットタ" +"イプは :py:data:`~socket.SOCK_STREAM` になります。" -#: ../../library/asyncio-eventloop.rst:687 +#: ../../library/asyncio-eventloop.rst:576 msgid "" "*path* is the name of a Unix domain socket and is required, unless a *sock* " "parameter is specified. Abstract Unix sockets, :class:`str`, :class:" @@ -1145,7 +1032,7 @@ msgstr "" "須です。 抽象 Unix ソケット、 :class:`str`、 :class:`bytes`、 and :class:" "`~pathlib.Path` 形式でのパスがサポートされています。" -#: ../../library/asyncio-eventloop.rst:692 +#: ../../library/asyncio-eventloop.rst:581 msgid "" "See the documentation of the :meth:`loop.create_connection` method for " "information about arguments to this method." @@ -1153,39 +1040,37 @@ msgstr "" "このメソッドの引数についての詳細は :meth:`loop.create_connection` メソッドの" "ドキュメントを参照してください。" -#: ../../library/asyncio-eventloop.rst:695 -#: ../../library/asyncio-eventloop.rst:851 -#: ../../library/asyncio-eventloop.rst:1316 -#: ../../library/asyncio-eventloop.rst:1862 -#: ../../library/asyncio-eventloop.rst:1869 -msgid "Availability" -msgstr "" +#: ../../library/asyncio-eventloop.rst:585 +#: ../../library/asyncio-eventloop.rst:705 +#: ../../library/asyncio-eventloop.rst:1061 +msgid ":ref:`Availability `: Unix." +msgstr ":ref:`利用可能な環境 `: Unix。" -#: ../../library/asyncio-eventloop.rst:697 -msgid "" -"Added the *ssl_handshake_timeout* parameter. The *path* parameter can now be " -"a :term:`path-like object`." +#: ../../library/asyncio-eventloop.rst:592 +msgid "The *path* parameter can now be a :term:`path-like object`." msgstr "" -#: ../../library/asyncio-eventloop.rst:707 +#: ../../library/asyncio-eventloop.rst:596 msgid "Creating network servers" msgstr "ネットワークサーバの生成" -#: ../../library/asyncio-eventloop.rst:723 +#: ../../library/asyncio-eventloop.rst:606 msgid "" -"Create a TCP server (socket type :const:`~socket.SOCK_STREAM`) listening on " +"Create a TCP server (socket type :data:`~socket.SOCK_STREAM`) listening on " "*port* of the *host* address." msgstr "" +"アドレス *host* のポート *port* をリッスンする (ソケットタイプが :data:" +"`~socket.SOCK_STREAM` である) TCP サーバーを生成します。" -#: ../../library/asyncio-eventloop.rst:726 +#: ../../library/asyncio-eventloop.rst:609 msgid "Returns a :class:`Server` object." msgstr ":class:`Server` オブジェクトを返します。" -#: ../../library/asyncio-eventloop.rst:728 +#: ../../library/asyncio-eventloop.rst:611 msgid "Arguments:" msgstr "引数:" -#: ../../library/asyncio-eventloop.rst:733 +#: ../../library/asyncio-eventloop.rst:616 msgid "" "The *host* parameter can be set to several types which determine where the " "server would be listening:" @@ -1193,7 +1078,7 @@ msgstr "" "*host* パラメータはいくつかの方法で指定することができ、その値によってサーバー" "がどこをリッスンするかが決まります。" -#: ../../library/asyncio-eventloop.rst:736 +#: ../../library/asyncio-eventloop.rst:619 msgid "" "If *host* is a string, the TCP server is bound to a single network interface " "specified by *host*." @@ -1201,7 +1086,7 @@ msgstr "" "*host* が文字列の場合、 TCP サーバーは *host* で指定した単一のネットワークイ" "ンターフェースに束縛されます。" -#: ../../library/asyncio-eventloop.rst:739 +#: ../../library/asyncio-eventloop.rst:622 msgid "" "If *host* is a sequence of strings, the TCP server is bound to all network " "interfaces specified by the sequence." @@ -1209,7 +1094,7 @@ msgstr "" "*host* が文字列のシーケンスである場合、 TCP サーバーはそのシーケンスで指定さ" "れた全てのネットワークインターフェースに束縛されます。" -#: ../../library/asyncio-eventloop.rst:742 +#: ../../library/asyncio-eventloop.rst:625 msgid "" "If *host* is an empty string or ``None``, all interfaces are assumed and a " "list of multiple sockets will be returned (most likely one for IPv4 and " @@ -1218,26 +1103,22 @@ msgstr "" "*host* が空の文字列か ``None`` の場合、すべてのインターフェースが想定され、複" "合的なソケットのリスト (通常は一つが IPv4、もう一つが IPv6) が返されます。" -#: ../../library/asyncio-eventloop.rst:746 -msgid "" -"The *port* parameter can be set to specify which port the server should " -"listen on. If ``0`` or ``None`` (the default), a random unused port will be " -"selected (note that if *host* resolves to multiple network interfaces, a " -"different random port will be selected for each interface)." -msgstr "" - -#: ../../library/asyncio-eventloop.rst:751 +#: ../../library/asyncio-eventloop.rst:629 msgid "" -"*family* can be set to either :const:`socket.AF_INET` or :const:`~socket." +"*family* can be set to either :data:`socket.AF_INET` or :data:`~socket." "AF_INET6` to force the socket to use IPv4 or IPv6. If not set, the *family* " -"will be determined from host name (defaults to :const:`~socket.AF_UNSPEC`)." +"will be determined from host name (defaults to :data:`~socket.AF_UNSPEC`)." msgstr "" +"*family* に :data:`socket.AF_INET` または :data:`~socket.AF_INET6` を指定する" +"ことにより、ソケットでそれぞれ IPv4 または IPv6 の使用を強制することができま" +"す。設定されない場合、 *family* はホスト名から決定されます (:data:`socket." +"AF_UNSPEC` がデフォルトになります)。" -#: ../../library/asyncio-eventloop.rst:756 +#: ../../library/asyncio-eventloop.rst:634 msgid "*flags* is a bitmask for :meth:`getaddrinfo`." msgstr "*flags* は :meth:`getaddrinfo` のためのビットマスクになります。" -#: ../../library/asyncio-eventloop.rst:758 +#: ../../library/asyncio-eventloop.rst:636 msgid "" "*sock* can optionally be specified in order to use a preexisting socket " "object. If specified, *host* and *port* must not be specified." @@ -1246,13 +1127,7 @@ msgstr "" "*sock* にソケットオブジェクトを設定することができます。指定した場合、 *host* " "と *port* を指定してはいけません。" -#: ../../library/asyncio-eventloop.rst:763 -msgid "" -"The *sock* argument transfers ownership of the socket to the server created. " -"To close the socket, call the server's :meth:`~asyncio.Server.close` method." -msgstr "" - -#: ../../library/asyncio-eventloop.rst:767 +#: ../../library/asyncio-eventloop.rst:639 msgid "" "*backlog* is the maximum number of queued connections passed to :meth:" "`~socket.socket.listen` (defaults to 100)." @@ -1260,7 +1135,7 @@ msgstr "" "*backlog* は :meth:`~socket.socket.listen` に渡される、キューに入るコネクショ" "ンの最大数になります (デフォルトは 100)。" -#: ../../library/asyncio-eventloop.rst:770 +#: ../../library/asyncio-eventloop.rst:642 msgid "" "*ssl* can be set to an :class:`~ssl.SSLContext` instance to enable TLS over " "the accepted connections." @@ -1268,7 +1143,7 @@ msgstr "" "確立した接続の上で TLS を有効化するために、 *ssl* に :class:`~ssl." "SSLContext` のインスタンスを指定することができます。" -#: ../../library/asyncio-eventloop.rst:773 +#: ../../library/asyncio-eventloop.rst:645 msgid "" "*reuse_address* tells the kernel to reuse a local socket in ``TIME_WAIT`` " "state, without waiting for its natural timeout to expire. If not specified " @@ -1279,7 +1154,7 @@ msgstr "" "註: ソケットのオプション SO_REUSEADDR を使用します)。指定しない場合、UNIX で" "は自動的に ``True`` が設定されます。" -#: ../../library/asyncio-eventloop.rst:778 +#: ../../library/asyncio-eventloop.rst:650 msgid "" "*reuse_port* tells the kernel to allow this endpoint to be bound to the same " "port as other existing endpoints are bound to, so long as they all set this " @@ -1291,17 +1166,7 @@ msgstr "" "SO_REUSEPORT を使用します)。このオプションは、Windows ではサポートされていま" "せん。" -#: ../../library/asyncio-eventloop.rst:783 -msgid "" -"*keep_alive* set to ``True`` keeps connections active by enabling the " -"periodic transmission of messages." -msgstr "" - -#: ../../library/asyncio-eventloop.rst:788 -msgid "Added the *keep_alive* parameter." -msgstr "" - -#: ../../library/asyncio-eventloop.rst:790 +#: ../../library/asyncio-eventloop.rst:655 msgid "" "*ssl_handshake_timeout* is (for a TLS server) the time in seconds to wait " "for the TLS handshake to complete before aborting the connection. ``60.0`` " @@ -1311,7 +1176,7 @@ msgstr "" "ための) 待ち時間を秒単位で指定します。指定した待ち時間を超えると接続は中断し" "ます。 ``None`` が与えられた場合はデフォルト値 ``60.0`` が使われます。" -#: ../../library/asyncio-eventloop.rst:798 +#: ../../library/asyncio-eventloop.rst:659 msgid "" "*start_serving* set to ``True`` (the default) causes the created server to " "start accepting connections immediately. When set to ``False``, the user " @@ -1323,18 +1188,15 @@ msgstr "" "ユーザーは接続の受け付けを開始するために :meth:`Server.start_serving` また" "は :meth:`Server.serve_forever` を待ち受け (await) る必要があります。" -#: ../../library/asyncio-eventloop.rst:810 +#: ../../library/asyncio-eventloop.rst:667 +msgid "Added *ssl_handshake_timeout* and *start_serving* parameters." +msgstr "" + +#: ../../library/asyncio-eventloop.rst:680 msgid "The *host* parameter can be a sequence of strings." msgstr "*host* パラメータに文字列のシーケンスを指定できるようになりました。" -#: ../../library/asyncio-eventloop.rst:814 -msgid "" -"Added *ssl_handshake_timeout* and *start_serving* parameters. The socket " -"option :ref:`socket.TCP_NODELAY ` is set by default " -"for all TCP connections." -msgstr "" - -#: ../../library/asyncio-eventloop.rst:824 +#: ../../library/asyncio-eventloop.rst:684 msgid "" "The :func:`start_server` function is a higher-level alternative API that " "returns a pair of :class:`StreamReader` and :class:`StreamWriter` that can " @@ -1344,13 +1206,15 @@ msgstr "" "`StreamReader` と :class:`StreamWriter` のペアを返し、async/await コードから" "使うことができます。" -#: ../../library/asyncio-eventloop.rst:836 +#: ../../library/asyncio-eventloop.rst:693 msgid "" -"Similar to :meth:`loop.create_server` but works with the :py:const:`~socket." +"Similar to :meth:`loop.create_server` but works with the :py:data:`~socket." "AF_UNIX` socket family." msgstr "" +":meth:`loop.create_server` と似ていますが、 :py:data:`~socket.AF_UNIX` ソケッ" +"トファミリーとともに動作します。" -#: ../../library/asyncio-eventloop.rst:839 +#: ../../library/asyncio-eventloop.rst:696 msgid "" "*path* is the name of a Unix domain socket, and is required, unless a *sock* " "argument is provided. Abstract Unix sockets, :class:`str`, :class:`bytes`, " @@ -1360,14 +1224,7 @@ msgstr "" "須です。 抽象 Unix ソケット、 :class:`str`、 :class:`bytes`、 and :class:" "`~pathlib.Path` 形式でのパスがサポートされています。" -#: ../../library/asyncio-eventloop.rst:844 -msgid "" -"If *cleanup_socket* is true then the Unix socket will automatically be " -"removed from the filesystem when the server is closed, unless the socket has " -"been replaced after the server has been created." -msgstr "" - -#: ../../library/asyncio-eventloop.rst:848 +#: ../../library/asyncio-eventloop.rst:701 msgid "" "See the documentation of the :meth:`loop.create_server` method for " "information about arguments to this method." @@ -1375,21 +1232,19 @@ msgstr "" "このメソッドの引数についての詳細は :meth:`loop.create_server` メソッドのド" "キュメントを参照してください。" -#: ../../library/asyncio-eventloop.rst:855 -msgid "" -"Added the *ssl_handshake_timeout* and *start_serving* parameters. The *path* " -"parameter can now be a :class:`~pathlib.Path` object." +#: ../../library/asyncio-eventloop.rst:708 +msgid "The *ssl_handshake_timeout* and *start_serving* parameters." msgstr "" -#: ../../library/asyncio-eventloop.rst:864 -msgid "Added the *cleanup_socket* parameter." +#: ../../library/asyncio-eventloop.rst:712 +msgid "The *path* parameter can now be a :class:`~pathlib.Path` object." msgstr "" -#: ../../library/asyncio-eventloop.rst:872 +#: ../../library/asyncio-eventloop.rst:717 msgid "Wrap an already accepted connection into a transport/protocol pair." msgstr "すでに確立した接続を transport と protocol のペアでラップします。" -#: ../../library/asyncio-eventloop.rst:874 +#: ../../library/asyncio-eventloop.rst:719 msgid "" "This method can be used by servers that accept connections outside of " "asyncio but that use asyncio to handle them." @@ -1397,12 +1252,12 @@ msgstr "" "このメソッドは asyncio の範囲外で確立された接続を使うサーバーに対しても使えま" "すが、その場合でも接続は asyncio を使って処理されます。" -#: ../../library/asyncio-eventloop.rst:877 -#: ../../library/asyncio-eventloop.rst:969 +#: ../../library/asyncio-eventloop.rst:722 +#: ../../library/asyncio-eventloop.rst:789 msgid "Parameters:" msgstr "引数:" -#: ../../library/asyncio-eventloop.rst:882 +#: ../../library/asyncio-eventloop.rst:727 msgid "" "*sock* is a preexisting socket object returned from :meth:`socket.accept " "`." @@ -1410,7 +1265,7 @@ msgstr "" "*sock* は :meth:`socket.accept ` メソッドが返す既存のソ" "ケットオブジェクトです。" -#: ../../library/asyncio-eventloop.rst:891 +#: ../../library/asyncio-eventloop.rst:730 msgid "" "*ssl* can be set to an :class:`~ssl.SSLContext` to enable SSL over the " "accepted connections." @@ -1418,7 +1273,7 @@ msgstr "" "*ssl* には :class:`~ssl.SSLContext` を指定できます。指定すると、受け付けたコ" "ネクション上での SSL を有効にします。" -#: ../../library/asyncio-eventloop.rst:894 +#: ../../library/asyncio-eventloop.rst:733 msgid "" "*ssl_handshake_timeout* is (for an SSL connection) the time in seconds to " "wait for the SSL handshake to complete before aborting the connection. " @@ -1428,35 +1283,35 @@ msgstr "" "の) 待ち時間を秒単位で指定します。 ``None`` が与えられた場合はデフォルト値 " "``60.0`` が使われます。" -#: ../../library/asyncio-eventloop.rst:902 +#: ../../library/asyncio-eventloop.rst:737 msgid "Returns a ``(transport, protocol)`` pair." msgstr "``(transport, protocol)`` のペアを返します。" -#: ../../library/asyncio-eventloop.rst:916 +#: ../../library/asyncio-eventloop.rst:747 msgid "Transferring files" msgstr "ファイルの転送" -#: ../../library/asyncio-eventloop.rst:922 +#: ../../library/asyncio-eventloop.rst:752 msgid "" "Send a *file* over a *transport*. Return the total number of bytes sent." msgstr "" "*transport* を通じて *file* を送信します。送信したデータの総バイト数を返しま" "す。" -#: ../../library/asyncio-eventloop.rst:925 +#: ../../library/asyncio-eventloop.rst:755 msgid "The method uses high-performance :meth:`os.sendfile` if available." msgstr "" "このメソッドは、もし利用可能であれば高性能な :meth:`os.sendfile` を利用しま" "す。" -#: ../../library/asyncio-eventloop.rst:927 +#: ../../library/asyncio-eventloop.rst:757 msgid "*file* must be a regular file object opened in binary mode." msgstr "" "*file* はバイナリモードでオープンされた通常のファイルオブジェクトでなければな" "りません。" -#: ../../library/asyncio-eventloop.rst:929 -#: ../../library/asyncio-eventloop.rst:1190 +#: ../../library/asyncio-eventloop.rst:759 +#: ../../library/asyncio-eventloop.rst:949 msgid "" "*offset* tells from where to start reading the file. If specified, *count* " "is the total number of bytes to transmit as opposed to sending the file " @@ -1470,7 +1325,7 @@ msgstr "" "ラーを送出した場合でも更新されます。この場合実際に送信されたバイト数は :meth:" "`file.tell() ` メソッドで取得することができます。" -#: ../../library/asyncio-eventloop.rst:936 +#: ../../library/asyncio-eventloop.rst:766 msgid "" "*fallback* set to ``True`` makes asyncio to manually read and send the file " "when the platform does not support the sendfile system call (e.g. Windows or " @@ -1481,7 +1336,7 @@ msgstr "" "SSL ソケットなど) に別の方法でファイルの読み込みと送信を行うようにすることが" "できます。" -#: ../../library/asyncio-eventloop.rst:940 +#: ../../library/asyncio-eventloop.rst:770 msgid "" "Raise :exc:`SendfileNotAvailableError` if the system does not support the " "*sendfile* syscall and *fallback* is ``False``." @@ -1489,36 +1344,25 @@ msgstr "" "システムが *sendfile* システムコールをサポートしておらず、かつ *fallback* が " "``False`` の場合、 :exc:`SendfileNotAvailableError` 例外を送出します。" -#: ../../library/asyncio-eventloop.rst:947 +#: ../../library/asyncio-eventloop.rst:777 msgid "TLS Upgrade" msgstr "TLS へのアップグレード" -#: ../../library/asyncio-eventloop.rst:955 +#: ../../library/asyncio-eventloop.rst:783 msgid "Upgrade an existing transport-based connection to TLS." msgstr "既存のトランスポートベースの接続を TLS にアップグレードします。" -#: ../../library/asyncio-eventloop.rst:957 -msgid "" -"Create a TLS coder/decoder instance and insert it between the *transport* " -"and the *protocol*. The coder/decoder implements both *transport*-facing " -"protocol and *protocol*-facing transport." -msgstr "" - -#: ../../library/asyncio-eventloop.rst:961 -msgid "" -"Return the created two-interface instance. After *await*, the *protocol* " -"must stop using the original *transport* and communicate with the returned " -"object only because the coder caches *protocol*-side data and sporadically " -"exchanges extra TLS session packets with *transport*." -msgstr "" - -#: ../../library/asyncio-eventloop.rst:966 +#: ../../library/asyncio-eventloop.rst:785 msgid "" -"In some situations (e.g. when the passed transport is already closing) this " -"may return ``None``." +"Return a new transport instance, that the *protocol* must start using " +"immediately after the *await*. The *transport* instance passed to the " +"*start_tls* method should never be used again." msgstr "" +"新しいトランスポートのインスタンスを返します。 *protocol* は必ず *await* 直後" +"に利用を開始しなければなりません。 *start_tls* メソッドに渡した *transport* " +"は、このメソッドの呼び出し以後決して使ってはいけません。" -#: ../../library/asyncio-eventloop.rst:971 +#: ../../library/asyncio-eventloop.rst:791 msgid "" "*transport* and *protocol* instances that methods like :meth:`~loop." "create_server` and :meth:`~loop.create_connection` return." @@ -1526,11 +1370,11 @@ msgstr "" "*transport* と *protocol* には、 :meth:`~loop.create_server` や :meth:`~loop." "create_connection` が返すものと同等のインスタンスを指定します。" -#: ../../library/asyncio-eventloop.rst:975 +#: ../../library/asyncio-eventloop.rst:795 msgid "*sslcontext*: a configured instance of :class:`~ssl.SSLContext`." msgstr "*sslcontext*: 構成済みの :class:`~ssl.SSLContext` インスタンスです。" -#: ../../library/asyncio-eventloop.rst:977 +#: ../../library/asyncio-eventloop.rst:797 msgid "" "*server_side* pass ``True`` when a server-side connection is being upgraded " "(like the one created by :meth:`~loop.create_server`)." @@ -1538,7 +1382,7 @@ msgstr "" "(:meth:`~loop.create_server` で生成されたような) サーバーサイドの接続をアップ" "グレードする場合は *server_side* に ``True`` を渡します。" -#: ../../library/asyncio-eventloop.rst:980 +#: ../../library/asyncio-eventloop.rst:800 msgid "" "*server_hostname*: sets or overrides the host name that the target server's " "certificate will be matched against." @@ -1546,11 +1390,11 @@ msgstr "" "*server_hostname*: 対象のサーバーの証明書との照合に使われるホスト名を設定また" "は上書きします。" -#: ../../library/asyncio-eventloop.rst:1000 +#: ../../library/asyncio-eventloop.rst:811 msgid "Watching file descriptors" msgstr "ファイル記述子の監視" -#: ../../library/asyncio-eventloop.rst:1004 +#: ../../library/asyncio-eventloop.rst:815 msgid "" "Start monitoring the *fd* file descriptor for read availability and invoke " "*callback* with the specified arguments once *fd* is available for reading." @@ -1558,20 +1402,11 @@ msgstr "" "ファイル記述子 *fd* に対する読み込みが可能かどうかの監視を開始し、 *fd* が読" "み込み可能になると、指定した引数でコールバック *callback* を呼び出します。" -#: ../../library/asyncio-eventloop.rst:1008 -#: ../../library/asyncio-eventloop.rst:1022 -msgid "" -"Any preexisting callback registered for *fd* is cancelled and replaced by " -"*callback*." -msgstr "" +#: ../../library/asyncio-eventloop.rst:821 +msgid "Stop monitoring the *fd* file descriptor for read availability." +msgstr "ファイル記述子 *fd* に対する読み込みが可能かどうかの監視を停止します。" -#: ../../library/asyncio-eventloop.rst:1013 -msgid "" -"Stop monitoring the *fd* file descriptor for read availability. Returns " -"``True`` if *fd* was previously being monitored for reads." -msgstr "" - -#: ../../library/asyncio-eventloop.rst:1018 +#: ../../library/asyncio-eventloop.rst:825 msgid "" "Start monitoring the *fd* file descriptor for write availability and invoke " "*callback* with the specified arguments once *fd* is available for writing." @@ -1579,8 +1414,8 @@ msgstr "" "ファイル記述子 *fd* に対する書き込みが可能かどうかの監視を開始し、 *fd* が書" "き込み可能になると、指定した引数でコールバック *callback* を呼び出します。" -#: ../../library/asyncio-eventloop.rst:1025 -#: ../../library/asyncio-eventloop.rst:1303 +#: ../../library/asyncio-eventloop.rst:829 +#: ../../library/asyncio-eventloop.rst:1048 msgid "" "Use :func:`functools.partial` :ref:`to pass keyword arguments ` to *callback*." @@ -1588,13 +1423,11 @@ msgstr "" "コールバック *callback* に :ref:`キーワード引数を渡す ` 場合は :func:`functools.partial` を使ってください。" -#: ../../library/asyncio-eventloop.rst:1030 -msgid "" -"Stop monitoring the *fd* file descriptor for write availability. Returns " -"``True`` if *fd* was previously being monitored for writes." -msgstr "" +#: ../../library/asyncio-eventloop.rst:834 +msgid "Stop monitoring the *fd* file descriptor for write availability." +msgstr "ファイル記述子 *fd* に対する書き込みが可能かどうかの監視を停止します。" -#: ../../library/asyncio-eventloop.rst:1033 +#: ../../library/asyncio-eventloop.rst:836 msgid "" "See also :ref:`Platform Support ` section for some " "limitations of these methods." @@ -1602,11 +1435,11 @@ msgstr "" "これらのメソッドに対する制限事項については :ref:`プラットフォームのサポート状" "況 ` 節も参照してください。" -#: ../../library/asyncio-eventloop.rst:1038 +#: ../../library/asyncio-eventloop.rst:841 msgid "Working with socket objects directly" msgstr "ソケットオブジェクトと直接やりとりする" -#: ../../library/asyncio-eventloop.rst:1040 +#: ../../library/asyncio-eventloop.rst:843 msgid "" "In general, protocol implementations that use transport-based APIs such as :" "meth:`loop.create_connection` and :meth:`loop.create_server` are faster than " @@ -1620,7 +1453,7 @@ msgstr "" "class:`~socket.socket` オブジェクトとやりとりした方が便利なユースケースがいく" "つかあります。" -#: ../../library/asyncio-eventloop.rst:1050 +#: ../../library/asyncio-eventloop.rst:852 msgid "" "Receive up to *nbytes* from *sock*. Asynchronous version of :meth:`socket." "recv() `." @@ -1628,23 +1461,20 @@ msgstr "" "*nbytes* で指定したバイト数までのデータをソケット *sock* から受信します。 こ" "のメソッドは :meth:`socket.recv() ` の非同期版です。" -#: ../../library/asyncio-eventloop.rst:1053 +#: ../../library/asyncio-eventloop.rst:855 msgid "Return the received data as a bytes object." msgstr "受信したデータをバイトオブジェクトとして返します。" -#: ../../library/asyncio-eventloop.rst:1055 -#: ../../library/asyncio-eventloop.rst:1070 -#: ../../library/asyncio-eventloop.rst:1082 -#: ../../library/asyncio-eventloop.rst:1095 -#: ../../library/asyncio-eventloop.rst:1111 -#: ../../library/asyncio-eventloop.rst:1127 -#: ../../library/asyncio-eventloop.rst:1138 -#: ../../library/asyncio-eventloop.rst:1165 -#: ../../library/asyncio-eventloop.rst:1204 +#: ../../library/asyncio-eventloop.rst:857 +#: ../../library/asyncio-eventloop.rst:871 +#: ../../library/asyncio-eventloop.rst:886 +#: ../../library/asyncio-eventloop.rst:899 +#: ../../library/asyncio-eventloop.rst:925 +#: ../../library/asyncio-eventloop.rst:963 msgid "*sock* must be a non-blocking socket." msgstr "*sock* はノンブロッキングソケットでなければなりません。" -#: ../../library/asyncio-eventloop.rst:1057 +#: ../../library/asyncio-eventloop.rst:859 msgid "" "Even though this method was always documented as a coroutine method, " "releases before Python 3.7 returned a :class:`Future`. Since Python 3.7 this " @@ -1654,7 +1484,7 @@ msgstr "" "が、 Python 3.7 以前のリリースでは :class:`Future` オブジェクトを返していまし" "た。 Python 3.7 からは ``async def`` メソッドになりました。" -#: ../../library/asyncio-eventloop.rst:1065 +#: ../../library/asyncio-eventloop.rst:866 msgid "" "Receive data from *sock* into the *buf* buffer. Modeled after the blocking :" "meth:`socket.recv_into() ` method." @@ -1663,31 +1493,11 @@ msgstr "" "コードの :meth:`socket.recv_into() ` メソッドをモデ" "ルとしています。" -#: ../../library/asyncio-eventloop.rst:1068 +#: ../../library/asyncio-eventloop.rst:869 msgid "Return the number of bytes written to the buffer." msgstr "バッファに書き込んだデータのバイト数を返します。" -#: ../../library/asyncio-eventloop.rst:1077 -msgid "" -"Receive a datagram of up to *bufsize* from *sock*. Asynchronous version of :" -"meth:`socket.recvfrom() `." -msgstr "" - -#: ../../library/asyncio-eventloop.rst:1080 -msgid "Return a tuple of (received data, remote address)." -msgstr "" - -#: ../../library/asyncio-eventloop.rst:1089 -msgid "" -"Receive a datagram of up to *nbytes* from *sock* into *buf*. Asynchronous " -"version of :meth:`socket.recvfrom_into() `." -msgstr "" - -#: ../../library/asyncio-eventloop.rst:1093 -msgid "Return a tuple of (number of bytes received, remote address)." -msgstr "" - -#: ../../library/asyncio-eventloop.rst:1102 +#: ../../library/asyncio-eventloop.rst:877 msgid "" "Send *data* to the *sock* socket. Asynchronous version of :meth:`socket." "sendall() `." @@ -1695,7 +1505,7 @@ msgstr "" "データ *data* をソケット *sock* に送信します。 :meth:`socket.sendall() " "` メソッドの非同期版です。" -#: ../../library/asyncio-eventloop.rst:1105 +#: ../../library/asyncio-eventloop.rst:880 msgid "" "This method continues to send to the socket until either all data in *data* " "has been sent or an error occurs. ``None`` is returned on success. On " @@ -1708,37 +1518,26 @@ msgstr "" "場合は例外が送出されます。エラーとなった場合、接続の受信側で正しく処理された" "データの総量を特定する方法はありません。" -#: ../../library/asyncio-eventloop.rst:1113 -#: ../../library/asyncio-eventloop.rst:1167 +#: ../../library/asyncio-eventloop.rst:888 msgid "" "Even though the method was always documented as a coroutine method, before " -"Python 3.7 it returned a :class:`Future`. Since Python 3.7, this is an " +"Python 3.7 it returned an :class:`Future`. Since Python 3.7, this is an " "``async def`` method." msgstr "" "このメソッドは常にコルーチンメソッドとしてドキュメントに記載されてきました" "が、 Python 3.7 以前のリリースでは :class:`Future` オブジェクトを返していまし" "た。 Python 3.7 からは ``async def`` メソッドになりました。" -#: ../../library/asyncio-eventloop.rst:1121 -msgid "" -"Send a datagram from *sock* to *address*. Asynchronous version of :meth:" -"`socket.sendto() `." -msgstr "" - -#: ../../library/asyncio-eventloop.rst:1125 -msgid "Return the number of bytes sent." -msgstr "" - -#: ../../library/asyncio-eventloop.rst:1134 +#: ../../library/asyncio-eventloop.rst:895 msgid "Connect *sock* to a remote socket at *address*." msgstr "ソケット *sock* をアドレス *address* のリモートソケットに接続します。" -#: ../../library/asyncio-eventloop.rst:1136 +#: ../../library/asyncio-eventloop.rst:897 msgid "" "Asynchronous version of :meth:`socket.connect() `." msgstr ":meth:`socket.connect() ` の非同期版です。" -#: ../../library/asyncio-eventloop.rst:1140 +#: ../../library/asyncio-eventloop.rst:901 msgid "" "``address`` no longer needs to be resolved. ``sock_connect`` will try to " "check if the *address* is already resolved by calling :func:`socket." @@ -1750,7 +1549,7 @@ msgstr "" "解決の場合、 *address* の名前解決には :meth:`loop.getaddrinfo` メソッドが使わ" "れます。" -#: ../../library/asyncio-eventloop.rst:1149 +#: ../../library/asyncio-eventloop.rst:910 msgid "" ":meth:`loop.create_connection` and :func:`asyncio.open_connection() " "`." @@ -1758,7 +1557,7 @@ msgstr "" ":meth:`loop.create_connection` および :func:`asyncio.open_connection() " "`。" -#: ../../library/asyncio-eventloop.rst:1156 +#: ../../library/asyncio-eventloop.rst:916 msgid "" "Accept a connection. Modeled after the blocking :meth:`socket.accept() " "` method." @@ -1766,7 +1565,7 @@ msgstr "" "接続を受け付けます。ブロッキングコールの :meth:`socket.accept() ` メソッドをモデルとしています。" -#: ../../library/asyncio-eventloop.rst:1159 +#: ../../library/asyncio-eventloop.rst:919 msgid "" "The socket must be bound to an address and listening for connections. The " "return value is a pair ``(conn, address)`` where *conn* is a *new* socket " @@ -1778,11 +1577,21 @@ msgstr "" "めの *新しい* ソケットオブジェクト、*address* は接続先の端点でソケットに束縛" "されているアドレスを示します。" -#: ../../library/asyncio-eventloop.rst:1174 +#: ../../library/asyncio-eventloop.rst:927 +msgid "" +"Even though the method was always documented as a coroutine method, before " +"Python 3.7 it returned a :class:`Future`. Since Python 3.7, this is an " +"``async def`` method." +msgstr "" +"このメソッドは常にコルーチンメソッドとしてドキュメントに記載されてきました" +"が、 Python 3.7 以前のリリースでは :class:`Future` オブジェクトを返していまし" +"た。 Python 3.7 からは ``async def`` メソッドになりました。" + +#: ../../library/asyncio-eventloop.rst:934 msgid ":meth:`loop.create_server` and :func:`start_server`." msgstr ":meth:`loop.create_server` および :func:`start_server`。" -#: ../../library/asyncio-eventloop.rst:1180 +#: ../../library/asyncio-eventloop.rst:939 msgid "" "Send a file using high-performance :mod:`os.sendfile` if possible. Return " "the total number of bytes sent." @@ -1790,13 +1599,13 @@ msgstr "" "ファイルを送信します。利用可能なら高性能な :mod:`os.sendfile` を使います。送" "信したデータの総バイト数を返します。" -#: ../../library/asyncio-eventloop.rst:1183 +#: ../../library/asyncio-eventloop.rst:942 msgid "" "Asynchronous version of :meth:`socket.sendfile() `." msgstr "" ":meth:`socket.sendfile() ` メソッドの非同期版です。" -#: ../../library/asyncio-eventloop.rst:1185 +#: ../../library/asyncio-eventloop.rst:944 msgid "" "*sock* must be a non-blocking :const:`socket.SOCK_STREAM` :class:`~socket." "socket`." @@ -1804,13 +1613,13 @@ msgstr "" "*sock* は :const:`socket.SOCK_STREAM` タイプのノンブロッキングな :class:" "`~socket.socket` でなければなりません。" -#: ../../library/asyncio-eventloop.rst:1188 +#: ../../library/asyncio-eventloop.rst:947 msgid "*file* must be a regular file object open in binary mode." msgstr "" "*file* はバイナリモードでオープンされた通常のファイルオブジェクトでなければな" "りません。" -#: ../../library/asyncio-eventloop.rst:1197 +#: ../../library/asyncio-eventloop.rst:956 msgid "" "*fallback*, when set to ``True``, makes asyncio manually read and send the " "file when the platform does not support the sendfile syscall (e.g. Windows " @@ -1821,7 +1630,7 @@ msgstr "" "ど) に asyncio が別の方法でファイルの読み込みと送信を行うようにすることができ" "ます。" -#: ../../library/asyncio-eventloop.rst:1201 +#: ../../library/asyncio-eventloop.rst:960 msgid "" "Raise :exc:`SendfileNotAvailableError` if the system does not support " "*sendfile* syscall and *fallback* is ``False``." @@ -1829,29 +1638,19 @@ msgstr "" "システムが *sendfile* システムコールをサポートしておらず、かつ *fallback* が " "``False`` の場合、 :exc:`SendfileNotAvailableError` 例外を送出します。" -#: ../../library/asyncio-eventloop.rst:1210 +#: ../../library/asyncio-eventloop.rst:969 msgid "DNS" msgstr "DNS" -#: ../../library/asyncio-eventloop.rst:1216 +#: ../../library/asyncio-eventloop.rst:974 msgid "Asynchronous version of :meth:`socket.getaddrinfo`." msgstr ":meth:`socket.getaddrinfo` の非同期版です。" -#: ../../library/asyncio-eventloop.rst:1221 +#: ../../library/asyncio-eventloop.rst:978 msgid "Asynchronous version of :meth:`socket.getnameinfo`." msgstr ":meth:`socket.getnameinfo` の非同期版です。" -#: ../../library/asyncio-eventloop.rst:1224 -msgid "" -"Both *getaddrinfo* and *getnameinfo* internally utilize their synchronous " -"versions through the loop's default thread pool executor. When this executor " -"is saturated, these methods may experience delays, which higher-level " -"networking libraries may report as increased timeouts. To mitigate this, " -"consider using a custom executor for other user tasks, or setting a default " -"executor with a larger number of workers." -msgstr "" - -#: ../../library/asyncio-eventloop.rst:1231 +#: ../../library/asyncio-eventloop.rst:980 msgid "" "Both *getaddrinfo* and *getnameinfo* methods were always documented to " "return a coroutine, but prior to Python 3.7 they were, in fact, returning :" @@ -1863,20 +1662,20 @@ msgstr "" "は、実際には :class:`asyncio.Future` オブジェクトを返していました。 Python " "3.7 からはどちらのメソッドもコルーチンになりました。" -#: ../../library/asyncio-eventloop.rst:1239 +#: ../../library/asyncio-eventloop.rst:988 msgid "Working with pipes" msgstr "パイプとやりとりする" -#: ../../library/asyncio-eventloop.rst:1244 +#: ../../library/asyncio-eventloop.rst:992 msgid "Register the read end of *pipe* in the event loop." msgstr "イベントループの読み込み側終端に *pipe* を登録します。" -#: ../../library/asyncio-eventloop.rst:1249 +#: ../../library/asyncio-eventloop.rst:997 msgid "*pipe* is a :term:`file-like object `." msgstr "" "*pipe* には :term:`file-like オブジェクト ` を指定します。" -#: ../../library/asyncio-eventloop.rst:1251 +#: ../../library/asyncio-eventloop.rst:999 msgid "" "Return pair ``(transport, protocol)``, where *transport* supports the :class:" "`ReadTransport` interface and *protocol* is an object instantiated by the " @@ -1886,8 +1685,8 @@ msgstr "" "`ReadTransport` のインターフェースをサポートし、 *protocol* は " "*protocol_factory* ファクトリでインスタンス化されたオブジェクトです。" -#: ../../library/asyncio-eventloop.rst:1255 -#: ../../library/asyncio-eventloop.rst:1272 +#: ../../library/asyncio-eventloop.rst:1003 +#: ../../library/asyncio-eventloop.rst:1019 msgid "" "With :class:`SelectorEventLoop` event loop, the *pipe* is set to non-" "blocking mode." @@ -1895,15 +1694,15 @@ msgstr "" ":class:`SelectorEventLoop` イベントループの場合、*pipe* は非ブロックモードに" "設定されていなければなりません。" -#: ../../library/asyncio-eventloop.rst:1261 +#: ../../library/asyncio-eventloop.rst:1008 msgid "Register the write end of *pipe* in the event loop." msgstr "*pipe* の書き込み側終端をイベントループに登録します。" -#: ../../library/asyncio-eventloop.rst:1266 +#: ../../library/asyncio-eventloop.rst:1013 msgid "*pipe* is :term:`file-like object `." msgstr "*pipe* は :term:`file-like オブジェクト ` です。" -#: ../../library/asyncio-eventloop.rst:1268 +#: ../../library/asyncio-eventloop.rst:1015 msgid "" "Return pair ``(transport, protocol)``, where *transport* supports :class:" "`WriteTransport` interface and *protocol* is an object instantiated by the " @@ -1913,7 +1712,7 @@ msgstr "" "`WriteTransport` のインスタンスであり、 *protocol* は *protocol_factory* ファ" "クトリでインスタンス化されたオブジェクトです。" -#: ../../library/asyncio-eventloop.rst:1277 +#: ../../library/asyncio-eventloop.rst:1024 msgid "" ":class:`SelectorEventLoop` does not support the above methods on Windows. " "Use :class:`ProactorEventLoop` instead for Windows." @@ -1921,22 +1720,22 @@ msgstr "" ":class:`SelectorEventLoop` は Windows 上で上記のメソッドをサポートしていませ" "ん。 Windowsでは代わりに :class:`ProactorEventLoop` を使ってください。" -#: ../../library/asyncio-eventloop.rst:1282 +#: ../../library/asyncio-eventloop.rst:1029 msgid "" "The :meth:`loop.subprocess_exec` and :meth:`loop.subprocess_shell` methods." msgstr "" ":meth:`loop.subprocess_exec` および :meth:`loop.subprocess_shell` メソッド。" -#: ../../library/asyncio-eventloop.rst:1287 +#: ../../library/asyncio-eventloop.rst:1034 msgid "Unix signals" msgstr "Unix シグナル" -#: ../../library/asyncio-eventloop.rst:1293 +#: ../../library/asyncio-eventloop.rst:1038 msgid "Set *callback* as the handler for the *signum* signal." msgstr "" "コールバック *callback* をシグナル *signum* に対するハンドラに設定します。" -#: ../../library/asyncio-eventloop.rst:1295 +#: ../../library/asyncio-eventloop.rst:1040 msgid "" "The callback will be invoked by *loop*, along with other queued callbacks " "and runnable coroutines of that event loop. Unlike signal handlers " @@ -1948,7 +1747,7 @@ msgstr "" "シグナルハンドラと異なり、この関数で登録されたコールバックはイベントループと" "相互作用することが可能です。" -#: ../../library/asyncio-eventloop.rst:1300 +#: ../../library/asyncio-eventloop.rst:1045 msgid "" "Raise :exc:`ValueError` if the signal number is invalid or uncatchable. " "Raise :exc:`RuntimeError` if there is a problem setting up the handler." @@ -1956,18 +1755,18 @@ msgstr "" "シグナルナンバーが誤っているか捕捉不可能な場合 :exc:`ValueError` が送出されま" "す。ハンドラーの設定に問題があった場合 :exc:`RuntimeError` が送出されます。" -#: ../../library/asyncio-eventloop.rst:1306 +#: ../../library/asyncio-eventloop.rst:1051 msgid "" "Like :func:`signal.signal`, this function must be invoked in the main thread." msgstr "" ":func:`signal.signal` と同じく、この関数はメインスレッドから呼び出されなけれ" "ばなりません。" -#: ../../library/asyncio-eventloop.rst:1311 +#: ../../library/asyncio-eventloop.rst:1056 msgid "Remove the handler for the *sig* signal." msgstr "シグナル *sig* に対するハンドラを削除します。" -#: ../../library/asyncio-eventloop.rst:1313 +#: ../../library/asyncio-eventloop.rst:1058 msgid "" "Return ``True`` if the signal handler was removed, or ``False`` if no " "handler was set for the given signal." @@ -1975,89 +1774,32 @@ msgstr "" "シグナルハンドラが削除された場合 ``True`` を返します。シグナルに対してハンド" "ラが設定されていない場合には ``False`` を返します。" -#: ../../library/asyncio-eventloop.rst:1320 +#: ../../library/asyncio-eventloop.rst:1065 msgid "The :mod:`signal` module." msgstr ":mod:`signal` モジュール。" -#: ../../library/asyncio-eventloop.rst:1324 +#: ../../library/asyncio-eventloop.rst:1069 msgid "Executing code in thread or process pools" msgstr "スレッドまたはプロセスプールでコードを実行する" -#: ../../library/asyncio-eventloop.rst:1328 +#: ../../library/asyncio-eventloop.rst:1073 msgid "Arrange for *func* to be called in the specified executor." msgstr "指定したエグゼキュータで関数 *func* が実行されるように準備します。" -#: ../../library/asyncio-eventloop.rst:1330 +#: ../../library/asyncio-eventloop.rst:1075 msgid "" "The *executor* argument should be an :class:`concurrent.futures.Executor` " -"instance. The default executor is used if *executor* is ``None``. The " -"default executor can be set by :meth:`loop.set_default_executor`, otherwise, " -"a :class:`concurrent.futures.ThreadPoolExecutor` will be lazy-initialized " -"and used by :func:`run_in_executor` if needed." +"instance. The default executor is used if *executor* is ``None``." msgstr "" +"引数 *executor* は :class:`concurrent.futures.Executor` のインスタンスでなけ" +"ればなりません。 *executor* が ``None`` の場合はデフォルトのエグゼキュータが" +"使われます。" -#: ../../library/asyncio-eventloop.rst:1338 -msgid "" -"import asyncio\n" -"import concurrent.futures\n" -"\n" -"def blocking_io():\n" -" # File operations (such as logging) can block the\n" -" # event loop: run them in a thread pool.\n" -" with open('/dev/urandom', 'rb') as f:\n" -" return f.read(100)\n" -"\n" -"def cpu_bound():\n" -" # CPU-bound operations will block the event loop:\n" -" # in general it is preferable to run them in a\n" -" # process pool.\n" -" return sum(i * i for i in range(10 ** 7))\n" -"\n" -"async def main():\n" -" loop = asyncio.get_running_loop()\n" -"\n" -" ## Options:\n" -"\n" -" # 1. Run in the default loop's executor:\n" -" result = await loop.run_in_executor(\n" -" None, blocking_io)\n" -" print('default thread pool', result)\n" -"\n" -" # 2. Run in a custom thread pool:\n" -" with concurrent.futures.ThreadPoolExecutor() as pool:\n" -" result = await loop.run_in_executor(\n" -" pool, blocking_io)\n" -" print('custom thread pool', result)\n" -"\n" -" # 3. Run in a custom process pool:\n" -" with concurrent.futures.ProcessPoolExecutor() as pool:\n" -" result = await loop.run_in_executor(\n" -" pool, cpu_bound)\n" -" print('custom process pool', result)\n" -"\n" -" # 4. Run in a custom interpreter pool:\n" -" with concurrent.futures.InterpreterPoolExecutor() as pool:\n" -" result = await loop.run_in_executor(\n" -" pool, cpu_bound)\n" -" print('custom interpreter pool', result)\n" -"\n" -"if __name__ == '__main__':\n" -" asyncio.run(main())" -msgstr "" - -#: ../../library/asyncio-eventloop.rst:1384 -msgid "" -"Note that the entry point guard (``if __name__ == '__main__'``) is required " -"for option 3 due to the peculiarities of :mod:`multiprocessing`, which is " -"used by :class:`~concurrent.futures.ProcessPoolExecutor`. See :ref:`Safe " -"importing of main module `." -msgstr "" - -#: ../../library/asyncio-eventloop.rst:1389 +#: ../../library/asyncio-eventloop.rst:1119 msgid "This method returns a :class:`asyncio.Future` object." msgstr "このメソッドは :class:`asyncio.Future` オブジェクトを返します。" -#: ../../library/asyncio-eventloop.rst:1391 +#: ../../library/asyncio-eventloop.rst:1121 msgid "" "Use :func:`functools.partial` :ref:`to pass keyword arguments ` to *func*." @@ -2065,7 +1807,7 @@ msgstr "" "関数 *func* に :ref:`キーワード引数を渡す ` 場合は :" "func:`functools.partial` を使ってください。" -#: ../../library/asyncio-eventloop.rst:1394 +#: ../../library/asyncio-eventloop.rst:1124 msgid "" ":meth:`loop.run_in_executor` no longer configures the ``max_workers`` of the " "thread pool executor it creates, instead leaving it up to the thread pool " @@ -2077,33 +1819,45 @@ msgstr "" "`~concurrent.futures.ThreadPoolExecutor`) にデフォルト値を設定させるようにな" "りました。" -#: ../../library/asyncio-eventloop.rst:1403 +#: ../../library/asyncio-eventloop.rst:1133 msgid "" "Set *executor* as the default executor used by :meth:`run_in_executor`. " -"*executor* must be an instance of :class:`~concurrent.futures." -"ThreadPoolExecutor`, which includes :class:`~concurrent.futures." -"InterpreterPoolExecutor`." +"*executor* should be an instance of :class:`~concurrent.futures." +"ThreadPoolExecutor`." +msgstr "" +"*executor* を :meth:`run_in_executor` が使うデフォルトのエグゼキュータに設定" +"します。 *executor* は :class:`~concurrent.futures.ThreadPoolExecutor` のイン" +"スタンスでなければなりません。" + +#: ../../library/asyncio-eventloop.rst:1137 +msgid "" +"Using an executor that is not an instance of :class:`~concurrent.futures." +"ThreadPoolExecutor` is deprecated and will trigger an error in Python 3.9." msgstr "" +":class:`~concurrent.futures.ThreadPoolExecutor` のインスタンスでないエグゼ" +"キュータの使用は非推奨となり、 Python 3.9 ではエラーになります。" -#: ../../library/asyncio-eventloop.rst:1408 +#: ../../library/asyncio-eventloop.rst:1142 msgid "" -"*executor* must be an instance of :class:`~concurrent.futures." +"*executor* must be an instance of :class:`concurrent.futures." "ThreadPoolExecutor`." msgstr "" +"*executor* は :class:`concurrent.futures.ThreadPoolExecutor` のインスタンスで" +"なければなりません。" -#: ../../library/asyncio-eventloop.rst:1414 +#: ../../library/asyncio-eventloop.rst:1147 msgid "Error Handling API" msgstr "エラーハンドリング API" -#: ../../library/asyncio-eventloop.rst:1416 +#: ../../library/asyncio-eventloop.rst:1149 msgid "Allows customizing how exceptions are handled in the event loop." msgstr "イベントループ内での例外の扱い方をカスタマイズできます。" -#: ../../library/asyncio-eventloop.rst:1420 +#: ../../library/asyncio-eventloop.rst:1153 msgid "Set *handler* as the new event loop exception handler." msgstr "*handler* を新しいイベントループ例外ハンドラーとして設定します。" -#: ../../library/asyncio-eventloop.rst:1422 +#: ../../library/asyncio-eventloop.rst:1155 msgid "" "If *handler* is ``None``, the default exception handler will be set. " "Otherwise, *handler* must be a callable with the signature matching ``(loop, " @@ -2118,20 +1872,7 @@ msgstr "" "``dict`` オブジェクトです (*context* についての詳細は :meth:" "`call_exception_handler` メソッドのドキュメントを参照してください)。" -#: ../../library/asyncio-eventloop.rst:1430 -msgid "" -"If the handler is called on behalf of a :class:`~asyncio.Task` or :class:" -"`~asyncio.Handle`, it is run in the :class:`contextvars.Context` of that " -"task or callback handle." -msgstr "" - -#: ../../library/asyncio-eventloop.rst:1436 -msgid "" -"The handler may be called in the :class:`~contextvars.Context` of the task " -"or handle where the exception originated." -msgstr "" - -#: ../../library/asyncio-eventloop.rst:1441 +#: ../../library/asyncio-eventloop.rst:1165 msgid "" "Return the current exception handler, or ``None`` if no custom exception " "handler was set." @@ -2139,11 +1880,11 @@ msgstr "" "現在の例外ハンドラを返します。カスタム例外ハンドラが設定されていない場合は " "``None`` を返します。" -#: ../../library/asyncio-eventloop.rst:1448 +#: ../../library/asyncio-eventloop.rst:1172 msgid "Default exception handler." msgstr "デフォルトの例外ハンドラーです。" -#: ../../library/asyncio-eventloop.rst:1450 +#: ../../library/asyncio-eventloop.rst:1174 msgid "" "This is called when an exception occurs and no exception handler is set. " "This can be called by a custom exception handler that wants to defer to the " @@ -2153,17 +1894,17 @@ msgstr "" "出されます。デフォルト例外ハンドラの挙動を受け入れるために、カスタム例外ハン" "ドラから呼び出すことも可能です。" -#: ../../library/asyncio-eventloop.rst:1454 +#: ../../library/asyncio-eventloop.rst:1178 msgid "" "*context* parameter has the same meaning as in :meth:" "`call_exception_handler`." msgstr "引数 *context* の意味は :meth:`call_exception_handler` と同じです。" -#: ../../library/asyncio-eventloop.rst:1459 +#: ../../library/asyncio-eventloop.rst:1183 msgid "Call the current event loop exception handler." msgstr "現在のイベントループ例外ハンドラーを呼び出します。" -#: ../../library/asyncio-eventloop.rst:1461 +#: ../../library/asyncio-eventloop.rst:1185 msgid "" "*context* is a ``dict`` object containing the following keys (new keys may " "be introduced in future Python versions):" @@ -2171,70 +1912,53 @@ msgstr "" "*context* は以下のキーを含む ``dict`` オブジェクトです (将来の Python バー" "ジョンで新しいキーが追加される可能性があります):" -#: ../../library/asyncio-eventloop.rst:1464 +#: ../../library/asyncio-eventloop.rst:1188 msgid "'message': Error message;" msgstr "'message': エラーメッセージ;" -#: ../../library/asyncio-eventloop.rst:1465 +#: ../../library/asyncio-eventloop.rst:1189 msgid "'exception' (optional): Exception object;" msgstr "'exception' (任意): 例外オブジェクト;" -#: ../../library/asyncio-eventloop.rst:1466 +#: ../../library/asyncio-eventloop.rst:1190 msgid "'future' (optional): :class:`asyncio.Future` instance;" msgstr "'future' (任意): :class:`asyncio.Future` インスタンス;" -#: ../../library/asyncio-eventloop.rst:1467 -msgid "'task' (optional): :class:`asyncio.Task` instance;" -msgstr "" - -#: ../../library/asyncio-eventloop.rst:1468 +#: ../../library/asyncio-eventloop.rst:1191 msgid "'handle' (optional): :class:`asyncio.Handle` instance;" msgstr "'handle' (任意): :class:`asyncio.Handle` インスタンス;" -#: ../../library/asyncio-eventloop.rst:1469 +#: ../../library/asyncio-eventloop.rst:1192 msgid "'protocol' (optional): :ref:`Protocol ` instance;" msgstr "'protocol' (任意): :ref:`プロトコル ` インスタンス;" -#: ../../library/asyncio-eventloop.rst:1470 +#: ../../library/asyncio-eventloop.rst:1193 msgid "'transport' (optional): :ref:`Transport ` instance;" msgstr "" "'transport' (任意): :ref:`トランスポート ` インスタンス;" -#: ../../library/asyncio-eventloop.rst:1471 -msgid "'socket' (optional): :class:`socket.socket` instance;" -msgstr "" - -#: ../../library/asyncio-eventloop.rst:1472 -msgid "'source_traceback' (optional): Traceback of the source;" -msgstr "" - -#: ../../library/asyncio-eventloop.rst:1473 -msgid "'handle_traceback' (optional): Traceback of the handle;" -msgstr "" - -#: ../../library/asyncio-eventloop.rst:1474 -msgid "'asyncgen' (optional): Asynchronous generator that caused" -msgstr "" +#: ../../library/asyncio-eventloop.rst:1194 +msgid "'socket' (optional): :class:`socket.socket` instance." +msgstr "'socket' (任意): :class:`socket.socket` インスタンス;" -#: ../../library/asyncio-eventloop.rst:1475 -msgid "the exception." -msgstr "" - -#: ../../library/asyncio-eventloop.rst:1479 +#: ../../library/asyncio-eventloop.rst:1198 msgid "" "This method should not be overloaded in subclassed event loops. For custom " -"exception handling, use the :meth:`set_exception_handler` method." +"exception handling, use the :meth:`set_exception_handler()` method." msgstr "" +"このメソッドはイベントループの派生クラスでオーバーロードされてはいけません。" +"カスタム例外ハンドラの設定には :meth:`set_exception_handler()` メソッドを使っ" +"てください。" -#: ../../library/asyncio-eventloop.rst:1484 +#: ../../library/asyncio-eventloop.rst:1203 msgid "Enabling debug mode" msgstr "デバッグモードの有効化" -#: ../../library/asyncio-eventloop.rst:1488 +#: ../../library/asyncio-eventloop.rst:1207 msgid "Get the debug mode (:class:`bool`) of the event loop." msgstr "イベントループのデバッグモード (:class:`bool`) を取得します。" -#: ../../library/asyncio-eventloop.rst:1490 +#: ../../library/asyncio-eventloop.rst:1209 msgid "" "The default value is ``True`` if the environment variable :envvar:" "`PYTHONASYNCIODEBUG` is set to a non-empty string, ``False`` otherwise." @@ -2242,11 +1966,11 @@ msgstr "" "環境変数 :envvar:`PYTHONASYNCIODEBUG` に空でない文字列が設定されている場合の" "デフォルト値は ``True``、そうでない場合は ``False`` になります。" -#: ../../library/asyncio-eventloop.rst:1496 +#: ../../library/asyncio-eventloop.rst:1215 msgid "Set the debug mode of the event loop." msgstr "イベントループのデバッグモードを設定します。" -#: ../../library/asyncio-eventloop.rst:1500 +#: ../../library/asyncio-eventloop.rst:1219 msgid "" "The new :ref:`Python Development Mode ` can now also be used to " "enable the debug mode." @@ -2254,26 +1978,15 @@ msgstr "" "新しい :ref:`Python 開発モード ` を使ってデバッグモードを有効化する" "ことができるようになりました。" -#: ../../library/asyncio-eventloop.rst:1505 -msgid "" -"This attribute can be used to set the minimum execution duration in seconds " -"that is considered \"slow\". When debug mode is enabled, \"slow\" callbacks " -"are logged." -msgstr "" - -#: ../../library/asyncio-eventloop.rst:1509 -msgid "Default value is 100 milliseconds." -msgstr "" - -#: ../../library/asyncio-eventloop.rst:1513 +#: ../../library/asyncio-eventloop.rst:1224 msgid "The :ref:`debug mode of asyncio `." msgstr ":ref:`asyncio のデバッグモード `。" -#: ../../library/asyncio-eventloop.rst:1517 +#: ../../library/asyncio-eventloop.rst:1228 msgid "Running Subprocesses" msgstr "サブプロセスの実行" -#: ../../library/asyncio-eventloop.rst:1519 +#: ../../library/asyncio-eventloop.rst:1230 msgid "" "Methods described in this subsections are low-level. In regular async/await " "code consider using the high-level :func:`asyncio.create_subprocess_shell` " @@ -2283,29 +1996,29 @@ msgstr "" "高水準の関数である :func:`asyncio.create_subprocess_shell` や :func:`asyncio." "create_subprocess_exec` を代わりに使うことを検討してください。" -#: ../../library/asyncio-eventloop.rst:1526 +#: ../../library/asyncio-eventloop.rst:1237 msgid "" -"On Windows, the default event loop :class:`ProactorEventLoop` supports " -"subprocesses, whereas :class:`SelectorEventLoop` does not. See :ref:" -"`Subprocess Support on Windows ` for details." +"The default asyncio event loop on **Windows** does not support subprocesses. " +"See :ref:`Subprocess Support on Windows ` for " +"details." msgstr "" -#: ../../library/asyncio-eventloop.rst:1538 +#: ../../library/asyncio-eventloop.rst:1245 msgid "" "Create a subprocess from one or more string arguments specified by *args*." msgstr "" "*args* で指定されたひとつの、または複数の文字列引数からサブプロセスを生成しま" "す。" -#: ../../library/asyncio-eventloop.rst:1541 +#: ../../library/asyncio-eventloop.rst:1248 msgid "*args* must be a list of strings represented by:" msgstr "*args* は下記のいずれかに当てはまる文字列のリストでなければなりません:" -#: ../../library/asyncio-eventloop.rst:1543 +#: ../../library/asyncio-eventloop.rst:1250 msgid ":class:`str`;" msgstr ":class:`str`;" -#: ../../library/asyncio-eventloop.rst:1544 +#: ../../library/asyncio-eventloop.rst:1251 msgid "" "or :class:`bytes`, encoded to the :ref:`filesystem encoding `." @@ -2313,7 +2026,7 @@ msgstr "" "または :ref:`ファイルシステムのエンコーディング ` にエン" "コードされた :class:`bytes`" -#: ../../library/asyncio-eventloop.rst:1547 +#: ../../library/asyncio-eventloop.rst:1254 msgid "" "The first string specifies the program executable, and the remaining strings " "specify the arguments. Together, string arguments form the ``argv`` of the " @@ -2322,7 +2035,7 @@ msgstr "" "引数の最初の文字列はプログラムの実行ファイルを指定します。それに続く残りの文" "字列は引数を指定し、そのプログラムに対する ``argv`` を構成します。" -#: ../../library/asyncio-eventloop.rst:1551 +#: ../../library/asyncio-eventloop.rst:1258 msgid "" "This is similar to the standard library :class:`subprocess.Popen` class " "called with ``shell=False`` and the list of strings passed as the first " @@ -2335,7 +2048,7 @@ msgstr "" "ひとつだけ取るのに対して、 *subprocess_exec* は複数の文字列引数をとることがで" "きます。" -#: ../../library/asyncio-eventloop.rst:1557 +#: ../../library/asyncio-eventloop.rst:1264 msgid "" "The *protocol_factory* must be a callable returning a subclass of the :class:" "`asyncio.SubprocessProtocol` class." @@ -2343,29 +2056,25 @@ msgstr "" "*protocol_factory* は :class:`asyncio.SubprocessProtocol` クラスの派生クラス" "を返す呼び出し可能オブジェクトでなければなりません。" -#: ../../library/asyncio-eventloop.rst:1560 +#: ../../library/asyncio-eventloop.rst:1267 msgid "Other parameters:" msgstr "その他の引数:" -#: ../../library/asyncio-eventloop.rst:1562 +#: ../../library/asyncio-eventloop.rst:1269 msgid "*stdin* can be any of these:" -msgstr "*stdin* は下記のいずれかをとることができます:" +msgstr "*stdin* 下記のいずれかをとることができます:" -#: ../../library/asyncio-eventloop.rst:1564 -#: ../../library/asyncio-eventloop.rst:1575 -#: ../../library/asyncio-eventloop.rst:1585 -msgid "a file-like object" -msgstr "" - -#: ../../library/asyncio-eventloop.rst:1565 +#: ../../library/asyncio-eventloop.rst:1271 msgid "" -"an existing file descriptor (a positive integer), for example those created " -"with :meth:`os.pipe`" +"a file-like object representing a pipe to be connected to the subprocess's " +"standard input stream using :meth:`~loop.connect_write_pipe`" msgstr "" +":meth:`~loop.connect_write_pipe` メソッドを使ってサブプロセスの標準入力スト" +"リームに接続されたパイプを表す file-like オブジェクト" -#: ../../library/asyncio-eventloop.rst:1566 -#: ../../library/asyncio-eventloop.rst:1576 -#: ../../library/asyncio-eventloop.rst:1586 +#: ../../library/asyncio-eventloop.rst:1274 +#: ../../library/asyncio-eventloop.rst:1286 +#: ../../library/asyncio-eventloop.rst:1298 msgid "" "the :const:`subprocess.PIPE` constant (default) which will create a new pipe " "and connect it," @@ -2373,9 +2082,9 @@ msgstr "" "デフォルト値は :const:`subprocess.PIPE` 定数で、この場合新規にパイプを生成し" "て接続します。" -#: ../../library/asyncio-eventloop.rst:1568 -#: ../../library/asyncio-eventloop.rst:1578 -#: ../../library/asyncio-eventloop.rst:1588 +#: ../../library/asyncio-eventloop.rst:1276 +#: ../../library/asyncio-eventloop.rst:1288 +#: ../../library/asyncio-eventloop.rst:1300 msgid "" "the value ``None`` which will make the subprocess inherit the file " "descriptor from this process" @@ -2383,9 +2092,9 @@ msgstr "" "``None`` が設定された場合、サブプロセスは元のプロセスのファイルデスクリプタを" "引き継ぎます。" -#: ../../library/asyncio-eventloop.rst:1570 -#: ../../library/asyncio-eventloop.rst:1580 -#: ../../library/asyncio-eventloop.rst:1590 +#: ../../library/asyncio-eventloop.rst:1278 +#: ../../library/asyncio-eventloop.rst:1290 +#: ../../library/asyncio-eventloop.rst:1302 msgid "" "the :const:`subprocess.DEVNULL` constant which indicates that the special :" "data:`os.devnull` file will be used" @@ -2393,15 +2102,31 @@ msgstr "" ":const:`subprocess.DEVNULL` 定数を設定すると、特別なファイル :data:`os." "devnull` を使います。" -#: ../../library/asyncio-eventloop.rst:1573 +#: ../../library/asyncio-eventloop.rst:1281 msgid "*stdout* can be any of these:" msgstr "*stdout* は下記のいずれかをとることができます:" -#: ../../library/asyncio-eventloop.rst:1583 +#: ../../library/asyncio-eventloop.rst:1283 +msgid "" +"a file-like object representing a pipe to be connected to the subprocess's " +"standard output stream using :meth:`~loop.connect_write_pipe`" +msgstr "" +":meth:`~loop.connect_write_pipe` メソッドを使ってサブプロセスの標準出力スト" +"リームに接続されたパイプを表す file-like オブジェクト" + +#: ../../library/asyncio-eventloop.rst:1293 msgid "*stderr* can be any of these:" msgstr "*stderr* は下記のいずれかをとることができます:" -#: ../../library/asyncio-eventloop.rst:1592 +#: ../../library/asyncio-eventloop.rst:1295 +msgid "" +"a file-like object representing a pipe to be connected to the subprocess's " +"standard error stream using :meth:`~loop.connect_write_pipe`" +msgstr "" +":meth:`~loop.connect_write_pipe` メソッドを使ってサブプロセスの標準エラー出力" +"ストリームに接続されたパイプを表す file-like オブジェクト" + +#: ../../library/asyncio-eventloop.rst:1304 msgid "" "the :const:`subprocess.STDOUT` constant which will connect the standard " "error stream to the process' standard output stream" @@ -2409,7 +2134,7 @@ msgstr "" ":const:`subprocess.STDOUT` 定数を設定すると、標準エラー出力ストリームをプロセ" "スの標準出力ストリームに接続します。" -#: ../../library/asyncio-eventloop.rst:1595 +#: ../../library/asyncio-eventloop.rst:1307 msgid "" "All other keyword arguments are passed to :class:`subprocess.Popen` without " "interpretation, except for *bufsize*, *universal_newlines*, *shell*, *text*, " @@ -2419,25 +2144,17 @@ msgstr "" "Popen` に渡されます。ただし、 *bufsize*、 *universal_newlines*、 *shell*、 " "*text*、 *encoding* および *errors* は指定してはいけません。" -#: ../../library/asyncio-eventloop.rst:1600 +#: ../../library/asyncio-eventloop.rst:1312 msgid "" "The ``asyncio`` subprocess API does not support decoding the streams as " "text. :func:`bytes.decode` can be used to convert the bytes returned from " "the stream to text." msgstr "" -"``asyncio`` のサブプロセス API はストリームからテキストへのデコードをサポート" +"``asyncio`` のサブプロセス API はストリームからテキストへのデコードをサポ0と" "していません。ストリームからテキストに変換するには :func:`bytes.decode` 関数" "を使ってください。" -#: ../../library/asyncio-eventloop.rst:1604 -msgid "" -"If a file-like object passed as *stdin*, *stdout* or *stderr* represents a " -"pipe, then the other side of this pipe should be registered with :meth:" -"`~loop.connect_write_pipe` or :meth:`~loop.connect_read_pipe` for use with " -"the event loop." -msgstr "" - -#: ../../library/asyncio-eventloop.rst:1609 +#: ../../library/asyncio-eventloop.rst:1316 msgid "" "See the constructor of the :class:`subprocess.Popen` class for documentation " "on other arguments." @@ -2445,7 +2162,7 @@ msgstr "" "他の引数についての詳細は :class:`subprocess.Popen` クラスのコンストラクタを参" "照してください。" -#: ../../library/asyncio-eventloop.rst:1612 +#: ../../library/asyncio-eventloop.rst:1319 msgid "" "Returns a pair of ``(transport, protocol)``, where *transport* conforms to " "the :class:`asyncio.SubprocessTransport` base class and *protocol* is an " @@ -2455,7 +2172,7 @@ msgstr "" "`asyncio.SubprocessTransport` 基底クラスに適合するオブジェクトで、 " "*protocol* は *protocol_factory* によりインスタンス化されたオブジェクトです。" -#: ../../library/asyncio-eventloop.rst:1621 +#: ../../library/asyncio-eventloop.rst:1327 msgid "" "Create a subprocess from *cmd*, which can be a :class:`str` or a :class:" "`bytes` string encoded to the :ref:`filesystem encoding ` でエンコードされた :class:" "`bytes` 文字列です。" -#: ../../library/asyncio-eventloop.rst:1626 +#: ../../library/asyncio-eventloop.rst:1332 msgid "" "This is similar to the standard library :class:`subprocess.Popen` class " "called with ``shell=True``." @@ -2474,7 +2191,7 @@ msgstr "" "これは標準ライブラリの :class:`subprocess.Popen` クラスを ``shell=True`` で呼" "び出した場合と似ています。" -#: ../../library/asyncio-eventloop.rst:1629 +#: ../../library/asyncio-eventloop.rst:1335 msgid "" "The *protocol_factory* must be a callable returning a subclass of the :class:" "`SubprocessProtocol` class." @@ -2482,7 +2199,7 @@ msgstr "" "*protocol_factory* は :class:`SubprocessProtocol` の派生クラスを返す呼び出し" "可能オブジェクトでなければなりません。" -#: ../../library/asyncio-eventloop.rst:1632 +#: ../../library/asyncio-eventloop.rst:1338 msgid "" "See :meth:`~loop.subprocess_exec` for more details about the remaining " "arguments." @@ -2490,17 +2207,17 @@ msgstr "" "その他の引数についての詳細は :meth:`~loop.subprocess_exec` メソッドを参照して" "ください。" -#: ../../library/asyncio-eventloop.rst:1635 +#: ../../library/asyncio-eventloop.rst:1341 msgid "" "Returns a pair of ``(transport, protocol)``, where *transport* conforms to " "the :class:`SubprocessTransport` base class and *protocol* is an object " "instantiated by the *protocol_factory*." msgstr "" -"``(transport, protocol)`` のペアを返します。ここで *transport* は :class:" +"``(transport, protocol)``のペアを返します。ここで *transport* は :class:" "`SubprocessTransport` 基底クラスに適合するオブジェクトで、 *protocol* は " "*protocol_factory* によりインスタンス化されたオブジェクトです。" -#: ../../library/asyncio-eventloop.rst:1640 +#: ../../library/asyncio-eventloop.rst:1346 msgid "" "It is the application's responsibility to ensure that all whitespace and " "special characters are quoted appropriately to avoid `shell injection " @@ -2515,11 +2232,11 @@ msgstr "" "ください。シェルコマンドを構成する文字列内の空白文字と特殊文字のエスケープ" "は、 :func:`shlex.quote` 関数を使うと適切に行うことができます。" -#: ../../library/asyncio-eventloop.rst:1649 +#: ../../library/asyncio-eventloop.rst:1355 msgid "Callback Handles" msgstr "コールバックのハンドル" -#: ../../library/asyncio-eventloop.rst:1653 +#: ../../library/asyncio-eventloop.rst:1359 msgid "" "A callback wrapper object returned by :meth:`loop.call_soon`, :meth:`loop." "call_soon_threadsafe`." @@ -2527,12 +2244,7 @@ msgstr "" ":meth:`loop.call_soon` や :meth:`loop.call_soon_threadsafe` が返すコールバッ" "クのラッパーです。" -#: ../../library/asyncio-eventloop.rst:1658 -msgid "" -"Return the :class:`contextvars.Context` object associated with the handle." -msgstr "" - -#: ../../library/asyncio-eventloop.rst:1665 +#: ../../library/asyncio-eventloop.rst:1364 msgid "" "Cancel the callback. If the callback has already been canceled or executed, " "this method has no effect." @@ -2540,11 +2252,11 @@ msgstr "" "コールバックをキャンセルします。コールバックがキャンセル済みまたは実行済みの" "場合、このメソッドは何の影響もありません。" -#: ../../library/asyncio-eventloop.rst:1670 +#: ../../library/asyncio-eventloop.rst:1369 msgid "Return ``True`` if the callback was cancelled." msgstr "コールバックがキャンセルされた場合 ``True`` を返します。" -#: ../../library/asyncio-eventloop.rst:1676 +#: ../../library/asyncio-eventloop.rst:1375 msgid "" "A callback wrapper object returned by :meth:`loop.call_later`, and :meth:" "`loop.call_at`." @@ -2552,15 +2264,15 @@ msgstr "" " :meth:`loop.call_later` や :meth:`loop.call_at` が返すコールバックのラッパー" "オブジェクトです。" -#: ../../library/asyncio-eventloop.rst:1679 +#: ../../library/asyncio-eventloop.rst:1378 msgid "This class is a subclass of :class:`Handle`." msgstr "このクラスは :class:`Handle` の派生クラスです。" -#: ../../library/asyncio-eventloop.rst:1683 +#: ../../library/asyncio-eventloop.rst:1382 msgid "Return a scheduled callback time as :class:`float` seconds." msgstr "コールバックのスケジュール時刻を秒単位の :class:`float` で返します。" -#: ../../library/asyncio-eventloop.rst:1685 +#: ../../library/asyncio-eventloop.rst:1384 msgid "" "The time is an absolute timestamp, using the same time reference as :meth:" "`loop.time`." @@ -2568,11 +2280,11 @@ msgstr "" "戻り値の時刻は絶対値で、 :meth:`loop.time` と同じ参照時刻を使って定義されてい" "ます。" -#: ../../library/asyncio-eventloop.rst:1692 +#: ../../library/asyncio-eventloop.rst:1391 msgid "Server Objects" msgstr "Serverオブジェクト" -#: ../../library/asyncio-eventloop.rst:1694 +#: ../../library/asyncio-eventloop.rst:1393 msgid "" "Server objects are created by :meth:`loop.create_server`, :meth:`loop." "create_unix_server`, :func:`start_server`, and :func:`start_unix_server` " @@ -2582,11 +2294,11 @@ msgstr "" "create_unix_server`、 :func:`start_server` および :func:`start_unix_server` " "関数により生成されます。" -#: ../../library/asyncio-eventloop.rst:1698 -msgid "Do not instantiate the :class:`Server` class directly." -msgstr "" +#: ../../library/asyncio-eventloop.rst:1397 +msgid "Do not instantiate the class directly." +msgstr "クラスを直接インスタンス化しないでください。" -#: ../../library/asyncio-eventloop.rst:1702 +#: ../../library/asyncio-eventloop.rst:1401 msgid "" "*Server* objects are asynchronous context managers. When used in an ``async " "with`` statement, it's guaranteed that the Server object is closed and not " @@ -2596,29 +2308,13 @@ msgstr "" "の中で使われた場合、 ``async with`` 文が完了した時に Server オブジェクトがク" "ローズされること、およびそれ以降に接続を受け付けないことが保証されます。" -#: ../../library/asyncio-eventloop.rst:1707 -msgid "" -"srv = await loop.create_server(...)\n" -"\n" -"async with srv:\n" -" # some code\n" -"\n" -"# At this point, srv is closed and no longer accepts new connections." -msgstr "" - -#: ../../library/asyncio-eventloop.rst:1715 +#: ../../library/asyncio-eventloop.rst:1414 msgid "Server object is an asynchronous context manager since Python 3.7." msgstr "" "Python 3.7 から、 Server オブジェクトは非同期のコンテキストマネージャになりま" "した。" -#: ../../library/asyncio-eventloop.rst:1718 -msgid "" -"This class was exposed publicly as ``asyncio.Server`` in Python 3.9.11, " -"3.10.3 and 3.11." -msgstr "" - -#: ../../library/asyncio-eventloop.rst:1723 +#: ../../library/asyncio-eventloop.rst:1419 msgid "" "Stop serving: close listening sockets and set the :attr:`sockets` attribute " "to ``None``." @@ -2626,65 +2322,37 @@ msgstr "" "サーバーを停止します: 待機しているソケットをクローズし :attr:`sockets` 属性" "に ``None`` を設定します。" -#: ../../library/asyncio-eventloop.rst:1726 +#: ../../library/asyncio-eventloop.rst:1422 msgid "" "The sockets that represent existing incoming client connections are left " "open." msgstr "既存の受信中のクライアントとの接続を表すソケットはオープンのままです。" -#: ../../library/asyncio-eventloop.rst:1729 -msgid "" -"The server is closed asynchronously; use the :meth:`wait_closed` coroutine " -"to wait until the server is closed (and no more connections are active)." -msgstr "" - -#: ../../library/asyncio-eventloop.rst:1735 -msgid "Close all existing incoming client connections." -msgstr "" - -#: ../../library/asyncio-eventloop.rst:1737 -msgid "" -"Calls :meth:`~asyncio.BaseTransport.close` on all associated transports." -msgstr "" - -#: ../../library/asyncio-eventloop.rst:1740 -msgid "" -":meth:`close` should be called before :meth:`close_clients` when closing the " -"server to avoid races with new clients connecting." -msgstr "" - -#: ../../library/asyncio-eventloop.rst:1747 +#: ../../library/asyncio-eventloop.rst:1425 msgid "" -"Close all existing incoming client connections immediately, without waiting " -"for pending operations to complete." +"The server is closed asynchronously, use the :meth:`wait_closed` coroutine " +"to wait until the server is closed." msgstr "" +"サーバーは非同期に停止されます。サーバーの停止を待ちたい場合は :meth:" +"`wait_closed` コルーチンを使用します。" -#: ../../library/asyncio-eventloop.rst:1750 -msgid "" -"Calls :meth:`~asyncio.WriteTransport.abort` on all associated transports." -msgstr "" - -#: ../../library/asyncio-eventloop.rst:1753 -msgid "" -":meth:`close` should be called before :meth:`abort_clients` when closing the " -"server to avoid races with new clients connecting." -msgstr "" - -#: ../../library/asyncio-eventloop.rst:1760 +#: ../../library/asyncio-eventloop.rst:1430 msgid "Return the event loop associated with the server object." msgstr "サーバオブジェクトに付随するイベントループを返します。" -#: ../../library/asyncio-eventloop.rst:1767 +#: ../../library/asyncio-eventloop.rst:1436 msgid "Start accepting connections." msgstr "接続の受け付けを開始します。" -#: ../../library/asyncio-eventloop.rst:1769 +#: ../../library/asyncio-eventloop.rst:1438 msgid "" "This method is idempotent, so it can be called when the server is already " -"serving." +"being serving." msgstr "" +"このメソッドはべき等です。すなわちサーバがすでにサービスを開始した後でも呼び" +"出すことができます。" -#: ../../library/asyncio-eventloop.rst:1772 +#: ../../library/asyncio-eventloop.rst:1441 msgid "" "The *start_serving* keyword-only parameter to :meth:`loop.create_server` " "and :meth:`asyncio.start_server` allows creating a Server object that is not " @@ -2698,7 +2366,7 @@ msgstr "" "start_serving()`` または :meth:`Server.serve_forever` メソッドを使ってオブ" "ジェクトが接続の受け付けを開始するようにすることができます。" -#: ../../library/asyncio-eventloop.rst:1784 +#: ../../library/asyncio-eventloop.rst:1452 msgid "" "Start accepting connections until the coroutine is cancelled. Cancellation " "of ``serve_forever`` task causes the server to be closed." @@ -2706,7 +2374,7 @@ msgstr "" "接続の受け入れを開始し、コルーチンがキャンセルされるまで継続します。 " "``serve_forever`` タスクのキャンセルによりサーバーもクローズされます。 " -#: ../../library/asyncio-eventloop.rst:1788 +#: ../../library/asyncio-eventloop.rst:1456 msgid "" "This method can be called if the server is already accepting connections. " "Only one ``serve_forever`` task can exist per one *Server* object." @@ -2715,38 +2383,20 @@ msgstr "" "す。ひとつの *Server* オブジェクトにつき ``serve_forever`` タスクはひとつだけ" "存在できます。" -#: ../../library/asyncio-eventloop.rst:1794 -msgid "" -"async def client_connected(reader, writer):\n" -" # Communicate with the client with\n" -" # reader/writer streams. For example:\n" -" await reader.readline()\n" -"\n" -"async def main(host, port):\n" -" srv = await asyncio.start_server(\n" -" client_connected, host, port)\n" -" await srv.serve_forever()\n" -"\n" -"asyncio.run(main('127.0.0.1', 0))" -msgstr "" - -#: ../../library/asyncio-eventloop.rst:1810 +#: ../../library/asyncio-eventloop.rst:1478 msgid "Return ``True`` if the server is accepting new connections." msgstr "サーバーが新規に接続の受け入れを開始した場合 ``True`` を返します。" -#: ../../library/asyncio-eventloop.rst:1817 -msgid "" -"Wait until the :meth:`close` method completes and all active connections " -"have finished." -msgstr "" +#: ../../library/asyncio-eventloop.rst:1484 +msgid "Wait until the :meth:`close` method completes." +msgstr ":meth:`close` メソッドが完了するまで待ちます。" -#: ../../library/asyncio-eventloop.rst:1822 -msgid "" -"List of socket-like objects, ``asyncio.trsock.TransportSocket``, which the " -"server is listening on." +#: ../../library/asyncio-eventloop.rst:1488 +msgid "List of :class:`socket.socket` objects the server is listening on." msgstr "" +"サーバーがリッスンしている :class:`socket.socket` オブジェクトのリストです。 " -#: ../../library/asyncio-eventloop.rst:1825 +#: ../../library/asyncio-eventloop.rst:1490 msgid "" "Prior to Python 3.7 ``Server.sockets`` used to return an internal list of " "server sockets directly. In 3.7 a copy of that list is returned." @@ -2755,29 +2405,31 @@ msgstr "" "バーソケットのリストを直接返していました。 Python 3.7 ではリストのコピーが返" "されるようになりました。" -#: ../../library/asyncio-eventloop.rst:1835 +#: ../../library/asyncio-eventloop.rst:1499 msgid "Event Loop Implementations" msgstr "イベントループの実装" -#: ../../library/asyncio-eventloop.rst:1837 +#: ../../library/asyncio-eventloop.rst:1501 msgid "" "asyncio ships with two different event loop implementations: :class:" "`SelectorEventLoop` and :class:`ProactorEventLoop`." msgstr "" -"asyncio は2つの異なるイベントループの実装、 :class:`SelectorEventLoop` と :" +"asyncio は2つの異なるイベントループの実装、 class:`SelectorEventLoop` と :" "class:`ProactorEventLoop`、 を提供します: " -#: ../../library/asyncio-eventloop.rst:1840 -msgid "By default asyncio is configured to use :class:`EventLoop`." -msgstr "" - -#: ../../library/asyncio-eventloop.rst:1845 +#: ../../library/asyncio-eventloop.rst:1504 msgid "" -"A subclass of :class:`AbstractEventLoop` based on the :mod:`selectors` " -"module." +"By default asyncio is configured to use :class:`SelectorEventLoop` on Unix " +"and :class:`ProactorEventLoop` on Windows." msgstr "" +"デフォルトでは、 asyncio は Unix では :class:`SelectorEventLoop` 、 Windows " +"では :class:`ProactorEventLoop` 、をそれぞれ使うように構成されています。" + +#: ../../library/asyncio-eventloop.rst:1510 +msgid "An event loop based on the :mod:`selectors` module." +msgstr ":mod:`selectors` に基づくイベントループです。" -#: ../../library/asyncio-eventloop.rst:1848 +#: ../../library/asyncio-eventloop.rst:1512 msgid "" "Uses the most efficient *selector* available for the given platform. It is " "also possible to manually configure the exact selector implementation to be " @@ -2786,58 +2438,44 @@ msgstr "" "プラットフォーム上で利用可能な最も効率の良い *selector* を使います。特定のセ" "レクタ実装を使うように手動で構成することも可能です::" -#: ../../library/asyncio-eventloop.rst:1852 -msgid "" -"import asyncio\n" -"import selectors\n" -"\n" -"async def main():\n" -" ...\n" -"\n" -"loop_factory = lambda: asyncio.SelectorEventLoop(selectors." -"SelectSelector())\n" -"asyncio.run(main(), loop_factory=loop_factory)" -msgstr "" +#: ../../library/asyncio-eventloop.rst:1524 +msgid ":ref:`Availability `: Unix, Windows." +msgstr ":ref:`Availability `: Unix, Windows。" -#: ../../library/asyncio-eventloop.rst:1867 -msgid "" -"A subclass of :class:`AbstractEventLoop` for Windows that uses \"I/O " -"Completion Ports\" (IOCP)." -msgstr "" +#: ../../library/asyncio-eventloop.rst:1529 +msgid "An event loop for Windows that uses \"I/O Completion Ports\" (IOCP)." +msgstr "\"I/O 完了ポート\" (IOCP) を使った Windows 向けのイベントループです。" -#: ../../library/asyncio-eventloop.rst:1873 -msgid "" -"`MSDN documentation on I/O Completion Ports `_." -msgstr "" - -#: ../../library/asyncio-eventloop.rst:1878 -msgid "" -"An alias to the most efficient available subclass of :class:" -"`AbstractEventLoop` for the given platform." -msgstr "" +#: ../../library/asyncio-eventloop.rst:1532 +msgid ":ref:`Availability `: Windows." +msgstr ":ref:`利用可能な環境 `: Windows 。" -#: ../../library/asyncio-eventloop.rst:1881 +#: ../../library/asyncio-eventloop.rst:1535 msgid "" -"It is an alias to :class:`SelectorEventLoop` on Unix and :class:" -"`ProactorEventLoop` on Windows." +"`MSDN documentation on I/O Completion Ports `_." msgstr "" +"`I/O 完了ポートに関する MSDN のドキュメント `_." -#: ../../library/asyncio-eventloop.rst:1887 +#: ../../library/asyncio-eventloop.rst:1541 msgid "Abstract base class for asyncio-compliant event loops." msgstr "asyncio に適合するイベントループの抽象基底クラスです。" -#: ../../library/asyncio-eventloop.rst:1889 +#: ../../library/asyncio-eventloop.rst:1543 msgid "" -"The :ref:`asyncio-event-loop-methods` section lists all methods that an " -"alternative implementation of ``AbstractEventLoop`` should have defined." +"The :ref:`Event Loop Methods ` section lists all methods " +"that an alternative implementation of ``AbstractEventLoop`` should have " +"defined." msgstr "" +":ref:`イベントループのメソッド ` 節は、 " +"``AbstractEventLoop`` の代替実装が定義すべき全てのメソッドを列挙しています。" -#: ../../library/asyncio-eventloop.rst:1895 +#: ../../library/asyncio-eventloop.rst:1549 msgid "Examples" msgstr "使用例" -#: ../../library/asyncio-eventloop.rst:1897 +#: ../../library/asyncio-eventloop.rst:1551 msgid "" "Note that all examples in this section **purposefully** show how to use the " "low-level event loop APIs, such as :meth:`loop.run_forever` and :meth:`loop." @@ -2849,11 +2487,11 @@ msgstr "" "現代的な asyncio アプリケーションはここに示すような方法をほとんど必要としませ" "ん。 :func:`asyncio.run` のような高水準の関数の使用を検討してください。" -#: ../../library/asyncio-eventloop.rst:1907 +#: ../../library/asyncio-eventloop.rst:1561 msgid "Hello World with call_soon()" msgstr "call_soon() を使った Hello World" -#: ../../library/asyncio-eventloop.rst:1909 +#: ../../library/asyncio-eventloop.rst:1563 msgid "" "An example using the :meth:`loop.call_soon` method to schedule a callback. " "The callback displays ``\"Hello World\"`` and then stops the event loop::" @@ -2861,28 +2499,7 @@ msgstr "" ":meth:`loop.call_soon` メソッドを使ってコールバックをスケジュールする例です。" "コールバックは ``\"Hello World\"`` を出力しイベントループを停止します::" -#: ../../library/asyncio-eventloop.rst:1913 -msgid "" -"import asyncio\n" -"\n" -"def hello_world(loop):\n" -" \"\"\"A callback to print 'Hello World' and stop the event loop\"\"\"\n" -" print('Hello World')\n" -" loop.stop()\n" -"\n" -"loop = asyncio.new_event_loop()\n" -"\n" -"# Schedule a call to hello_world()\n" -"loop.call_soon(hello_world, loop)\n" -"\n" -"# Blocking call interrupted by loop.stop()\n" -"try:\n" -" loop.run_forever()\n" -"finally:\n" -" loop.close()" -msgstr "" - -#: ../../library/asyncio-eventloop.rst:1933 +#: ../../library/asyncio-eventloop.rst:1587 msgid "" "A similar :ref:`Hello World ` example created with a coroutine " "and the :func:`run` function." @@ -2890,11 +2507,11 @@ msgstr "" "コルーチンと :func:`run` 関数を使用した同じような :ref:`Hello World " "` の例。" -#: ../../library/asyncio-eventloop.rst:1940 +#: ../../library/asyncio-eventloop.rst:1594 msgid "Display the current date with call_later()" msgstr "call_later() で現在の日時を表示する" -#: ../../library/asyncio-eventloop.rst:1942 +#: ../../library/asyncio-eventloop.rst:1596 msgid "" "An example of a callback displaying the current date every second. The " "callback uses the :meth:`loop.call_later` method to reschedule itself after " @@ -2904,32 +2521,7 @@ msgstr "" "call_later` メソッドを使って自身を5秒後に実行するよう再スケジュールし、イベン" "トループを停止します::" -#: ../../library/asyncio-eventloop.rst:1946 -msgid "" -"import asyncio\n" -"import datetime\n" -"\n" -"def display_date(end_time, loop):\n" -" print(datetime.datetime.now())\n" -" if (loop.time() + 1.0) < end_time:\n" -" loop.call_later(1, display_date, end_time, loop)\n" -" else:\n" -" loop.stop()\n" -"\n" -"loop = asyncio.new_event_loop()\n" -"\n" -"# Schedule the first call to display_date()\n" -"end_time = loop.time() + 5.0\n" -"loop.call_soon(display_date, end_time, loop)\n" -"\n" -"# Blocking call interrupted by loop.stop()\n" -"try:\n" -" loop.run_forever()\n" -"finally:\n" -" loop.close()" -msgstr "" - -#: ../../library/asyncio-eventloop.rst:1970 +#: ../../library/asyncio-eventloop.rst:1624 msgid "" "A similar :ref:`current date ` example created with a " "coroutine and the :func:`run` function." @@ -2937,11 +2529,11 @@ msgstr "" "コルーチンと :func:`run` 関数を使用した同じような :ref:`現在時刻出力 " "` の例。" -#: ../../library/asyncio-eventloop.rst:1977 +#: ../../library/asyncio-eventloop.rst:1631 msgid "Watch a file descriptor for read events" msgstr "読み込みイベント用ファイル記述子の監視" -#: ../../library/asyncio-eventloop.rst:1979 +#: ../../library/asyncio-eventloop.rst:1633 msgid "" "Wait until a file descriptor received some data using the :meth:`loop." "add_reader` method and then close the event loop::" @@ -2949,43 +2541,7 @@ msgstr "" "ファイル記述子が :meth:`loop.add_reader` メソッドを使って何らかのデータを受信" "するまで待機し、その後イベントループをクローズします::" -#: ../../library/asyncio-eventloop.rst:1982 -msgid "" -"import asyncio\n" -"from socket import socketpair\n" -"\n" -"# Create a pair of connected file descriptors\n" -"rsock, wsock = socketpair()\n" -"\n" -"loop = asyncio.new_event_loop()\n" -"\n" -"def reader():\n" -" data = rsock.recv(100)\n" -" print(\"Received:\", data.decode())\n" -"\n" -" # We are done: unregister the file descriptor\n" -" loop.remove_reader(rsock)\n" -"\n" -" # Stop the event loop\n" -" loop.stop()\n" -"\n" -"# Register the file descriptor for read event\n" -"loop.add_reader(rsock, reader)\n" -"\n" -"# Simulate the reception of data from the network\n" -"loop.call_soon(wsock.send, 'abc'.encode())\n" -"\n" -"try:\n" -" # Run the event loop\n" -" loop.run_forever()\n" -"finally:\n" -" # We are done. Close sockets and the event loop.\n" -" rsock.close()\n" -" wsock.close()\n" -" loop.close()" -msgstr "" - -#: ../../library/asyncio-eventloop.rst:2017 +#: ../../library/asyncio-eventloop.rst:1671 msgid "" "A similar :ref:`example ` using " "transports, protocols, and the :meth:`loop.create_connection` method." @@ -2993,7 +2549,7 @@ msgstr "" "トランスポート、プロトコル、および :meth:`loop.create_connection` メソッドを" "使用した同じような :ref:`例 `。 " -#: ../../library/asyncio-eventloop.rst:2021 +#: ../../library/asyncio-eventloop.rst:1675 msgid "" "Another similar :ref:`example ` " "using the high-level :func:`asyncio.open_connection` function and streams." @@ -3001,43 +2557,18 @@ msgstr "" "高水準の :func:`asyncio.open_connection` 関数とストリームを使用したもうひとつ" "の :ref:`実装例 `。" -#: ../../library/asyncio-eventloop.rst:2029 +#: ../../library/asyncio-eventloop.rst:1683 msgid "Set signal handlers for SIGINT and SIGTERM" msgstr "SIGINT および SIGTERM 用のシグナルハンドラーの設定" -#: ../../library/asyncio-eventloop.rst:2031 +#: ../../library/asyncio-eventloop.rst:1685 msgid "(This ``signals`` example only works on Unix.)" msgstr "(ここに挙げる ``signals`` の例は Unix でのみ動きます。)" -#: ../../library/asyncio-eventloop.rst:2033 -msgid "" -"Register handlers for signals :const:`~signal.SIGINT` and :const:`~signal." -"SIGTERM` using the :meth:`loop.add_signal_handler` method::" -msgstr "" - -#: ../../library/asyncio-eventloop.rst:2036 -msgid "" -"import asyncio\n" -"import functools\n" -"import os\n" -"import signal\n" -"\n" -"def ask_exit(signame, loop):\n" -" print(\"got signal %s: exit\" % signame)\n" -" loop.stop()\n" -"\n" -"async def main():\n" -" loop = asyncio.get_running_loop()\n" -"\n" -" for signame in {'SIGINT', 'SIGTERM'}:\n" -" loop.add_signal_handler(\n" -" getattr(signal, signame),\n" -" functools.partial(ask_exit, signame, loop))\n" -"\n" -" await asyncio.sleep(3600)\n" -"\n" -"print(\"Event loop running for 1 hour, press Ctrl+C to interrupt.\")\n" -"print(f\"pid {os.getpid()}: send SIGINT or SIGTERM to exit.\")\n" -"\n" -"asyncio.run(main())" +#: ../../library/asyncio-eventloop.rst:1687 +msgid "" +"Register handlers for signals :py:data:`SIGINT` and :py:data:`SIGTERM` using " +"the :meth:`loop.add_signal_handler` method::" msgstr "" +":meth:`loop.add_signal_handler` メソッドを使用して :py:data:`SIGINT` と :py:" +"data:`SIGTERM` の2つのシグナルに対するハンドラを登録します::" diff --git a/library/asyncio-exceptions.po b/library/asyncio-exceptions.po index 5391bbca3..d66432e14 100644 --- a/library/asyncio-exceptions.po +++ b/library/asyncio-exceptions.po @@ -1,27 +1,25 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2024 -# Takeshi Nakazato, 2024 -# 石井明久, 2024 +# tomo, 2018 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:54+0000\n" -"Last-Translator: 石井明久, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2018-09-18 00:23+0000\n" +"Last-Translator: tomo, 2018\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/asyncio-exceptions.rst:8 @@ -33,22 +31,19 @@ msgid "**Source code:** :source:`Lib/asyncio/exceptions.py`" msgstr "**ソースコード:** :source:`Lib/asyncio/exceptions.py`" #: ../../library/asyncio-exceptions.rst:16 -msgid "" -"A deprecated alias of :exc:`TimeoutError`, raised when the operation has " -"exceeded the given deadline." +msgid "The operation has exceeded the given deadline." msgstr "" -"操作が指定された期限を超えたときに送出される、非推奨な :exc:`TimeoutError` の" -"エイリアス。" -#: ../../library/asyncio-exceptions.rst:21 -msgid "This class was made an alias of :exc:`TimeoutError`." -msgstr "このクラスは :exc:`TimeoutError` のエイリアスになりました。" +#: ../../library/asyncio-exceptions.rst:19 +msgid "" +"This exception is different from the builtin :exc:`TimeoutError` exception." +msgstr "" -#: ../../library/asyncio-exceptions.rst:26 +#: ../../library/asyncio-exceptions.rst:25 msgid "The operation has been cancelled." msgstr "処理がキャンセルされました。" -#: ../../library/asyncio-exceptions.rst:28 +#: ../../library/asyncio-exceptions.rst:27 msgid "" "This exception can be caught to perform custom operations when asyncio Tasks " "are cancelled. In almost all situations the exception must be re-raised." @@ -57,19 +52,16 @@ msgstr "" "を一旦キャッチすることができます。 ほとんどの場合、キャッチした例外は再度送出" "しなければなりません。" -#: ../../library/asyncio-exceptions.rst:34 -msgid "" -":exc:`CancelledError` is now a subclass of :class:`BaseException` rather " -"than :class:`Exception`." +#: ../../library/asyncio-exceptions.rst:33 +msgid ":exc:`CancelledError` is now a subclass of :class:`BaseException`." msgstr "" -":exc:`CancelledError` は :class:`Exception` ではなく :class:`BaseException` " -"のサブクラスになりました。" +":exc:`CancelledError` は :class:`BaseException` の派生クラスになりました。" -#: ../../library/asyncio-exceptions.rst:39 +#: ../../library/asyncio-exceptions.rst:38 msgid "Invalid internal state of :class:`Task` or :class:`Future`." msgstr ":class:`Task` または :class:`Future` の内部状態が不正になりました。" -#: ../../library/asyncio-exceptions.rst:41 +#: ../../library/asyncio-exceptions.rst:40 msgid "" "Can be raised in situations like setting a result value for a *Future* " "object that already has a result value set." @@ -77,45 +69,45 @@ msgstr "" "すでに結果の値が設定されている *Future* オブジェクトに対してさらに結果の値を" "再び設定しようとする場合などに送出されることがあります。" -#: ../../library/asyncio-exceptions.rst:47 +#: ../../library/asyncio-exceptions.rst:46 msgid "" "The \"sendfile\" syscall is not available for the given socket or file type." msgstr "" "与えられたソケットまたはファイルタイプに対して \"sendfile\" システムコールが" "利用可能ではありません。" -#: ../../library/asyncio-exceptions.rst:50 +#: ../../library/asyncio-exceptions.rst:49 msgid "A subclass of :exc:`RuntimeError`." msgstr ":exc:`RuntimeError` の派生クラスです。" -#: ../../library/asyncio-exceptions.rst:55 +#: ../../library/asyncio-exceptions.rst:54 msgid "The requested read operation did not complete fully." msgstr "要求された読み込み処理が完了できませんでした。" -#: ../../library/asyncio-exceptions.rst:57 +#: ../../library/asyncio-exceptions.rst:56 msgid "Raised by the :ref:`asyncio stream APIs`." msgstr ":ref:`asyncio ストリーム API` から送出されます。" -#: ../../library/asyncio-exceptions.rst:59 +#: ../../library/asyncio-exceptions.rst:58 msgid "This exception is a subclass of :exc:`EOFError`." msgstr "この例外は :exc:`EOFError` の派生クラスです。" -#: ../../library/asyncio-exceptions.rst:63 +#: ../../library/asyncio-exceptions.rst:62 msgid "The total number (:class:`int`) of expected bytes." msgstr "期待される総バイト数 (:class:`int`) です。" -#: ../../library/asyncio-exceptions.rst:67 +#: ../../library/asyncio-exceptions.rst:66 msgid "A string of :class:`bytes` read before the end of stream was reached." msgstr "ストリームの終端に達するまでに読み込んだ :class:`bytes` 文字列です。" -#: ../../library/asyncio-exceptions.rst:72 +#: ../../library/asyncio-exceptions.rst:71 msgid "Reached the buffer size limit while looking for a separator." msgstr "区切り文字を探している間にバッファサイズの上限に到達しました。" -#: ../../library/asyncio-exceptions.rst:74 +#: ../../library/asyncio-exceptions.rst:73 msgid "Raised by the :ref:`asyncio stream APIs `." msgstr ":ref:`asyncio ストリーム API ` から送出されます。" -#: ../../library/asyncio-exceptions.rst:78 +#: ../../library/asyncio-exceptions.rst:77 msgid "The total number of to be consumed bytes." msgstr "未消費のバイトの合計数です。" diff --git a/library/asyncio-extending.po b/library/asyncio-extending.po deleted file mode 100644 index 4f2a279a3..000000000 --- a/library/asyncio-extending.po +++ /dev/null @@ -1,156 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 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.14\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-13 14:21+0000\n" -"PO-Revision-Date: 2022-11-05 19:48+0000\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" -"ja/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#: ../../library/asyncio-extending.rst:6 -msgid "Extending" -msgstr "" - -#: ../../library/asyncio-extending.rst:8 -msgid "" -"The main direction for :mod:`asyncio` extending is writing custom *event " -"loop* classes. Asyncio has helpers that could be used to simplify this task." -msgstr "" - -#: ../../library/asyncio-extending.rst:13 -msgid "" -"Third-parties should reuse existing asyncio code with caution, a new Python " -"version is free to break backward compatibility in *internal* part of API." -msgstr "" - -#: ../../library/asyncio-extending.rst:19 -msgid "Writing a Custom Event Loop" -msgstr "" - -#: ../../library/asyncio-extending.rst:21 -msgid "" -":class:`asyncio.AbstractEventLoop` declares very many methods. Implementing " -"all them from scratch is a tedious job." -msgstr "" - -#: ../../library/asyncio-extending.rst:24 -msgid "" -"A loop can get many common methods implementation for free by inheriting " -"from :class:`asyncio.BaseEventLoop`." -msgstr "" - -#: ../../library/asyncio-extending.rst:27 -msgid "" -"In turn, the successor should implement a bunch of *private* methods " -"declared but not implemented in :class:`asyncio.BaseEventLoop`." -msgstr "" - -#: ../../library/asyncio-extending.rst:30 -msgid "" -"For example, ``loop.create_connection()`` checks arguments, resolves DNS " -"addresses, and calls ``loop._make_socket_transport()`` that should be " -"implemented by inherited class. The ``_make_socket_transport()`` method is " -"not documented and is considered as an *internal* API." -msgstr "" - -#: ../../library/asyncio-extending.rst:38 -msgid "Future and Task private constructors" -msgstr "" - -#: ../../library/asyncio-extending.rst:40 -msgid "" -":class:`asyncio.Future` and :class:`asyncio.Task` should be never created " -"directly, please use corresponding :meth:`loop.create_future` and :meth:" -"`loop.create_task`, or :func:`asyncio.create_task` factories instead." -msgstr "" - -#: ../../library/asyncio-extending.rst:44 -msgid "" -"However, third-party *event loops* may *reuse* built-in future and task " -"implementations for the sake of getting a complex and highly optimized code " -"for free." -msgstr "" - -#: ../../library/asyncio-extending.rst:47 -msgid "For this purpose the following, *private* constructors are listed:" -msgstr "" - -#: ../../library/asyncio-extending.rst:51 -msgid "Create a built-in future instance." -msgstr "" - -#: ../../library/asyncio-extending.rst:53 -msgid "*loop* is an optional event loop instance." -msgstr "" - -#: ../../library/asyncio-extending.rst:57 -msgid "Create a built-in task instance." -msgstr "" - -#: ../../library/asyncio-extending.rst:59 -msgid "" -"*loop* is an optional event loop instance. The rest of arguments are " -"described in :meth:`loop.create_task` description." -msgstr "" - -#: ../../library/asyncio-extending.rst:64 -msgid "*context* argument is added." -msgstr "" - -#: ../../library/asyncio-extending.rst:69 -msgid "Task lifetime support" -msgstr "" - -#: ../../library/asyncio-extending.rst:71 -msgid "" -"A third party task implementation should call the following functions to " -"keep a task visible by :func:`asyncio.all_tasks` and :func:`asyncio." -"current_task`:" -msgstr "" - -#: ../../library/asyncio-extending.rst:76 -msgid "Register a new *task* as managed by *asyncio*." -msgstr "" - -#: ../../library/asyncio-extending.rst:78 -msgid "Call the function from a task constructor." -msgstr "" - -#: ../../library/asyncio-extending.rst:82 -msgid "Unregister a *task* from *asyncio* internal structures." -msgstr "" - -#: ../../library/asyncio-extending.rst:84 -msgid "The function should be called when a task is about to finish." -msgstr "" - -#: ../../library/asyncio-extending.rst:88 -msgid "Switch the current task to the *task* argument." -msgstr "" - -#: ../../library/asyncio-extending.rst:90 -msgid "" -"Call the function just before executing a portion of embedded *coroutine* (:" -"meth:`coroutine.send` or :meth:`coroutine.throw`)." -msgstr "" - -#: ../../library/asyncio-extending.rst:95 -msgid "Switch the current task back from *task* to ``None``." -msgstr "" - -#: ../../library/asyncio-extending.rst:97 -msgid "" -"Call the function just after :meth:`coroutine.send` or :meth:`coroutine." -"throw` execution." -msgstr "" diff --git a/library/asyncio-future.po b/library/asyncio-future.po index 604676445..f7960894c 100644 --- a/library/asyncio-future.po +++ b/library/asyncio-future.po @@ -1,27 +1,26 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2024 -# Rafael Fontenelle , 2024 -# Takeshi Nakazato, 2024 +# tomo, 2018 +# Naoki Nakamura , 2020 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:55+0000\n" -"Last-Translator: Takeshi Nakazato, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2018-09-18 00:23+0000\n" +"Last-Translator: Naoki Nakamura , 2020\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/asyncio-future.rst:8 @@ -103,30 +102,19 @@ msgstr "" #: ../../library/asyncio-future.rst:54 msgid "" -"Save a reference to the result of this function, to avoid a task " -"disappearing mid-execution." -msgstr "" - -#: ../../library/asyncio-future.rst:57 -msgid "" "See also the :func:`create_task` function which is the preferred way for " -"creating new tasks or use :class:`asyncio.TaskGroup` which keeps reference " -"to the task internally." +"creating new Tasks." msgstr "" +"Task を生成するより好ましい方法である :func:`create_task` 関数も参照してくだ" +"さい。" -#: ../../library/asyncio-future.rst:61 +#: ../../library/asyncio-future.rst:57 msgid "The function accepts any :term:`awaitable` object." msgstr "" "この関数はどんな :term:`awaitable` なオブジェクトでも受け入れるようになりまし" "た。" -#: ../../library/asyncio-future.rst:64 -msgid "" -"Deprecation warning is emitted if *obj* is not a Future-like object and " -"*loop* is not specified and there is no running event loop." -msgstr "" - -#: ../../library/asyncio-future.rst:71 +#: ../../library/asyncio-future.rst:63 msgid "" "Wrap a :class:`concurrent.futures.Future` object in a :class:`asyncio." "Future` object." @@ -134,31 +122,28 @@ msgstr "" ":class:`concurrent.futures.Future` オブジェクトを :class:`asyncio.Future` オ" "ブジェクトでラップします。" -#: ../../library/asyncio-future.rst:74 -msgid "" -"Deprecation warning is emitted if *future* is not a Future-like object and " -"*loop* is not specified and there is no running event loop." -msgstr "" - -#: ../../library/asyncio-future.rst:80 +#: ../../library/asyncio-future.rst:68 msgid "Future Object" msgstr "Future オブジェクト" -#: ../../library/asyncio-future.rst:84 +#: ../../library/asyncio-future.rst:72 msgid "" "A Future represents an eventual result of an asynchronous operation. Not " "thread-safe." msgstr "" "Future は非同期処理の最終結果を表すクラスです。スレッドセーフではありません。" -#: ../../library/asyncio-future.rst:87 +#: ../../library/asyncio-future.rst:75 msgid "" "Future is an :term:`awaitable` object. Coroutines can await on Future " "objects until they either have a result or an exception set, or until they " -"are cancelled. A Future can be awaited multiple times and the result is same." +"are cancelled." msgstr "" +"Future は :term:`awaitable` オブジェクトです。コルーチンは Future オブジェク" +"トが結果を返すか、例外をセットするか、もしくはキャンセルされるまで待機する " +"(await) ことができます。" -#: ../../library/asyncio-future.rst:92 +#: ../../library/asyncio-future.rst:79 msgid "" "Typically Futures are used to enable low-level callback-based code (e.g. in " "protocols implemented using asyncio :ref:`transports , YEAR. -# -# Translators: -# Takeshi Nakazato, 2025 -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: Python 3.14\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2025-05-08 06:04+0000\n" -"Last-Translator: Takeshi Nakazato, 2025\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" -"ja/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#: ../../library/asyncio-graph.rst:8 -msgid "Call Graph Introspection" -msgstr "" - -#: ../../library/asyncio-graph.rst:10 -msgid "**Source code:** :source:`Lib/asyncio/graph.py`" -msgstr "" - -#: ../../library/asyncio-graph.rst:14 -msgid "" -"asyncio has powerful runtime call graph introspection utilities to trace the " -"entire call graph of a running *coroutine* or *task*, or a suspended " -"*future*. These utilities and the underlying machinery can be used from " -"within a Python program or by external profilers and debuggers." -msgstr "" - -#: ../../library/asyncio-graph.rst:25 -msgid "" -"Print the async call graph for the current task or the provided :class:" -"`Task` or :class:`Future`." -msgstr "" - -#: ../../library/asyncio-graph.rst:28 -msgid "" -"This function prints entries starting from the top frame and going down " -"towards the invocation point." -msgstr "" - -#: ../../library/asyncio-graph.rst:31 -msgid "" -"The function receives an optional *future* argument. If not passed, the " -"current running task will be used." -msgstr "" - -#: ../../library/asyncio-graph.rst:34 ../../library/asyncio-graph.rst:93 -msgid "" -"If the function is called on *the current task*, the optional keyword-only " -"*depth* argument can be used to skip the specified number of frames from top " -"of the stack." -msgstr "" - -#: ../../library/asyncio-graph.rst:38 -msgid "" -"If the optional keyword-only *limit* argument is provided, each call stack " -"in the resulting graph is truncated to include at most ``abs(limit)`` " -"entries. If *limit* is positive, the entries left are the closest to the " -"invocation point. If *limit* is negative, the topmost entries are left. If " -"*limit* is omitted or ``None``, all entries are present. If *limit* is " -"``0``, the call stack is not printed at all, only \"awaited by\" information " -"is printed." -msgstr "" - -#: ../../library/asyncio-graph.rst:46 -msgid "" -"If *file* is omitted or ``None``, the function will print to :data:`sys." -"stdout`." -msgstr "" - -#: ../../library/asyncio-graph.rst:49 -msgid "**Example:**" -msgstr "" - -#: ../../library/asyncio-graph.rst:51 -msgid "The following Python code:" -msgstr "" - -#: ../../library/asyncio-graph.rst:53 -msgid "" -"import asyncio\n" -"\n" -"async def test():\n" -" asyncio.print_call_graph()\n" -"\n" -"async def main():\n" -" async with asyncio.TaskGroup() as g:\n" -" g.create_task(test(), name='test')\n" -"\n" -"asyncio.run(main())" -msgstr "" - -#: ../../library/asyncio-graph.rst:66 -msgid "will print::" -msgstr "このサンプルコードは以下を出力します::" - -#: ../../library/asyncio-graph.rst:68 -msgid "" -"* Task(name='test', id=0x1039f0fe0)\n" -"+ Call stack:\n" -"| File 't2.py', line 4, in async test()\n" -"+ Awaited by:\n" -" * Task(name='Task-1', id=0x103a5e060)\n" -" + Call stack:\n" -" | File 'taskgroups.py', line 107, in async TaskGroup.__aexit__()\n" -" | File 't2.py', line 7, in async main()" -msgstr "" - -#: ../../library/asyncio-graph.rst:79 -msgid "" -"Like :func:`print_call_graph`, but returns a string. If *future* is ``None`` " -"and there's no current task, the function returns an empty string." -msgstr "" - -#: ../../library/asyncio-graph.rst:86 -msgid "" -"Capture the async call graph for the current task or the provided :class:" -"`Task` or :class:`Future`." -msgstr "" - -#: ../../library/asyncio-graph.rst:89 -msgid "" -"The function receives an optional *future* argument. If not passed, the " -"current running task will be used. If there's no current task, the function " -"returns ``None``." -msgstr "" - -#: ../../library/asyncio-graph.rst:97 -msgid "Returns a ``FutureCallGraph`` data class object:" -msgstr "" - -#: ../../library/asyncio-graph.rst:99 -msgid "``FutureCallGraph(future, call_stack, awaited_by)``" -msgstr "" - -#: ../../library/asyncio-graph.rst:101 -msgid "" -"Where *future* is a reference to a :class:`Future` or a :class:`Task` (or " -"their subclasses.)" -msgstr "" - -#: ../../library/asyncio-graph.rst:104 -msgid "``call_stack`` is a tuple of ``FrameCallGraphEntry`` objects." -msgstr "" - -#: ../../library/asyncio-graph.rst:106 -msgid "``awaited_by`` is a tuple of ``FutureCallGraph`` objects." -msgstr "" - -#: ../../library/asyncio-graph.rst:108 -msgid "``FrameCallGraphEntry(frame)``" -msgstr "" - -#: ../../library/asyncio-graph.rst:110 -msgid "" -"Where *frame* is a frame object of a regular Python function in the call " -"stack." -msgstr "" - -#: ../../library/asyncio-graph.rst:115 -msgid "Low level utility functions" -msgstr "" - -#: ../../library/asyncio-graph.rst:117 -msgid "" -"To introspect an async call graph asyncio requires cooperation from control " -"flow structures, such as :func:`shield` or :class:`TaskGroup`. Any time an " -"intermediate :class:`Future` object with low-level APIs like :meth:`Future." -"add_done_callback() ` is involved, the " -"following two functions should be used to inform asyncio about how exactly " -"such intermediate future objects are connected with the tasks they wrap or " -"control." -msgstr "" - -#: ../../library/asyncio-graph.rst:128 -msgid "Record that *future* is awaited on by *waiter*." -msgstr "" - -#: ../../library/asyncio-graph.rst:130 ../../library/asyncio-graph.rst:143 -msgid "" -"Both *future* and *waiter* must be instances of :class:`Future` or :class:" -"`Task` or their subclasses, otherwise the call would have no effect." -msgstr "" - -#: ../../library/asyncio-graph.rst:134 -msgid "" -"A call to ``future_add_to_awaited_by()`` must be followed by an eventual " -"call to the :func:`future_discard_from_awaited_by` function with the same " -"arguments." -msgstr "" - -#: ../../library/asyncio-graph.rst:141 -msgid "Record that *future* is no longer awaited on by *waiter*." -msgstr "" diff --git a/library/asyncio-llapi-index.po b/library/asyncio-llapi-index.po index 75b4b4011..3f7f97457 100644 --- a/library/asyncio-llapi-index.po +++ b/library/asyncio-llapi-index.po @@ -1,27 +1,25 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 -# Takeshi Nakazato, 2022 -# Arihiro TAKASE, 2023 +# tomo, 2018 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:55+0000\n" -"Last-Translator: Arihiro TAKASE, 2023\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2018-09-18 00:23+0000\n" +"Last-Translator: tomo, 2018\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/asyncio-llapi-index.rst:6 @@ -49,7 +47,7 @@ msgid ":func:`asyncio.get_event_loop`" msgstr ":func:`asyncio.get_event_loop`" #: ../../library/asyncio-llapi-index.rst:22 -msgid "Get an event loop instance (running or current via the current policy)." +msgid "Get an event loop instance (current or via the policy)." msgstr "" #: ../../library/asyncio-llapi-index.rst:24 @@ -71,13 +69,13 @@ msgid "Create a new event loop." msgstr "新しいイベントループのインスタンスを生成します。" #: ../../library/asyncio-llapi-index.rst:32 -#: ../../library/asyncio-llapi-index.rst:269 +#: ../../library/asyncio-llapi-index.rst:260 msgid "Examples" msgstr "使用例" #: ../../library/asyncio-llapi-index.rst:33 msgid ":ref:`Using asyncio.get_running_loop() `." -msgstr ":ref:`asyncio.get_running_loop() を使う `。" +msgstr ":ref:`asyncio.get_running_loop() を使う `。" #: ../../library/asyncio-llapi-index.rst:37 msgid "Event Loop Methods" @@ -85,8 +83,8 @@ msgstr "イベントループのメソッド" #: ../../library/asyncio-llapi-index.rst:39 msgid "" -"See also the main documentation section about the :ref:`asyncio-event-loop-" -"methods`." +"See also the main documentation section about the :ref:`event loop methods " +"`." msgstr "" #: ../../library/asyncio-llapi-index.rst:42 @@ -126,16 +124,16 @@ msgid "Close the event loop." msgstr "イベントループをクローズします。" #: ../../library/asyncio-llapi-index.rst:59 -msgid ":meth:`loop.is_running`" -msgstr "" +msgid ":meth:`loop.is_running()`" +msgstr ":meth:`loop.is_running()`" #: ../../library/asyncio-llapi-index.rst:60 msgid "Return ``True`` if the event loop is running." msgstr "イベントループが実行中の場合 ``True`` を返します。" #: ../../library/asyncio-llapi-index.rst:62 -msgid ":meth:`loop.is_closed`" -msgstr "" +msgid ":meth:`loop.is_closed()`" +msgstr ":meth:`loop.is_closed()`" #: ../../library/asyncio-llapi-index.rst:63 msgid "Return ``True`` if the event loop is closed." @@ -206,8 +204,8 @@ msgid "Invoke a callback *at* the given time." msgstr "*与えられた時刻に* コールバックを実行します。" #: ../../library/asyncio-llapi-index.rst:99 -msgid "Thread/Interpreter/Process Pool" -msgstr "" +msgid "Thread/Process Pool" +msgstr "スレッドプール/プロセスプール" #: ../../library/asyncio-llapi-index.rst:104 msgid "``await`` :meth:`loop.run_in_executor`" @@ -401,180 +399,156 @@ msgid "Receive data from the :class:`~socket.socket` into a buffer." msgstr ":class:`~socket.socket` からデータを受信し、バッファに送信します。" #: ../../library/asyncio-llapi-index.rst:192 -msgid "``await`` :meth:`loop.sock_recvfrom`" -msgstr "" - -#: ../../library/asyncio-llapi-index.rst:193 -msgid "Receive a datagram from the :class:`~socket.socket`." -msgstr "" - -#: ../../library/asyncio-llapi-index.rst:195 -msgid "``await`` :meth:`loop.sock_recvfrom_into`" -msgstr "" - -#: ../../library/asyncio-llapi-index.rst:196 -msgid "Receive a datagram from the :class:`~socket.socket` into a buffer." -msgstr "" - -#: ../../library/asyncio-llapi-index.rst:198 msgid "``await`` :meth:`loop.sock_sendall`" msgstr "``await`` :meth:`loop.sock_sendall`" -#: ../../library/asyncio-llapi-index.rst:199 +#: ../../library/asyncio-llapi-index.rst:193 msgid "Send data to the :class:`~socket.socket`." msgstr ":class:`~socket.socket` にデータを送信します。" -#: ../../library/asyncio-llapi-index.rst:201 -msgid "``await`` :meth:`loop.sock_sendto`" -msgstr "" - -#: ../../library/asyncio-llapi-index.rst:202 -msgid "Send a datagram via the :class:`~socket.socket` to the given address." -msgstr "" - -#: ../../library/asyncio-llapi-index.rst:204 +#: ../../library/asyncio-llapi-index.rst:195 msgid "``await`` :meth:`loop.sock_connect`" msgstr "``await`` :meth:`loop.sock_connect`" -#: ../../library/asyncio-llapi-index.rst:205 +#: ../../library/asyncio-llapi-index.rst:196 msgid "Connect the :class:`~socket.socket`." msgstr ":class:`~socket.socket` を接続します。" -#: ../../library/asyncio-llapi-index.rst:207 +#: ../../library/asyncio-llapi-index.rst:198 msgid "``await`` :meth:`loop.sock_accept`" msgstr "``await`` :meth:`loop.sock_accept`" -#: ../../library/asyncio-llapi-index.rst:208 +#: ../../library/asyncio-llapi-index.rst:199 msgid "Accept a :class:`~socket.socket` connection." msgstr ":class:`~socket.socket` の接続を受け入れます。" -#: ../../library/asyncio-llapi-index.rst:210 +#: ../../library/asyncio-llapi-index.rst:201 msgid "``await`` :meth:`loop.sock_sendfile`" msgstr "``await`` :meth:`loop.sock_sendfile`" -#: ../../library/asyncio-llapi-index.rst:211 +#: ../../library/asyncio-llapi-index.rst:202 msgid "Send a file over the :class:`~socket.socket`." msgstr "Send a file over the :class:`~socket.socket`." -#: ../../library/asyncio-llapi-index.rst:213 +#: ../../library/asyncio-llapi-index.rst:204 msgid ":meth:`loop.add_reader`" msgstr ":meth:`loop.add_reader`" -#: ../../library/asyncio-llapi-index.rst:214 +#: ../../library/asyncio-llapi-index.rst:205 msgid "Start watching a file descriptor for read availability." msgstr "ファイル記述子が読み込み可能かどうかの監視を開始します。" -#: ../../library/asyncio-llapi-index.rst:216 +#: ../../library/asyncio-llapi-index.rst:207 msgid ":meth:`loop.remove_reader`" msgstr ":meth:`loop.remove_reader`" -#: ../../library/asyncio-llapi-index.rst:217 +#: ../../library/asyncio-llapi-index.rst:208 msgid "Stop watching a file descriptor for read availability." msgstr "ファイル記述子が読み込み可能かどうかの監視を停止します。" -#: ../../library/asyncio-llapi-index.rst:219 +#: ../../library/asyncio-llapi-index.rst:210 msgid ":meth:`loop.add_writer`" msgstr ":meth:`loop.add_writer`" -#: ../../library/asyncio-llapi-index.rst:220 +#: ../../library/asyncio-llapi-index.rst:211 msgid "Start watching a file descriptor for write availability." msgstr "ファイル記述子が書き込み可能かどうかの監視を開始します。" -#: ../../library/asyncio-llapi-index.rst:222 +#: ../../library/asyncio-llapi-index.rst:213 msgid ":meth:`loop.remove_writer`" msgstr ":meth:`loop.remove_writer`" -#: ../../library/asyncio-llapi-index.rst:223 +#: ../../library/asyncio-llapi-index.rst:214 msgid "Stop watching a file descriptor for write availability." msgstr "ファイル記述子が書き込み可能かどうかの監視を停止します。" -#: ../../library/asyncio-llapi-index.rst:226 +#: ../../library/asyncio-llapi-index.rst:217 msgid "Unix Signals" msgstr "Unix シグナル" -#: ../../library/asyncio-llapi-index.rst:231 +#: ../../library/asyncio-llapi-index.rst:222 msgid ":meth:`loop.add_signal_handler`" msgstr ":meth:`loop.add_signal_handler`" -#: ../../library/asyncio-llapi-index.rst:232 +#: ../../library/asyncio-llapi-index.rst:223 msgid "Add a handler for a :mod:`signal`." msgstr ":mod:`signal` 用のハンドラーを追加します。" -#: ../../library/asyncio-llapi-index.rst:234 +#: ../../library/asyncio-llapi-index.rst:225 msgid ":meth:`loop.remove_signal_handler`" msgstr ":meth:`loop.remove_signal_handler`" -#: ../../library/asyncio-llapi-index.rst:235 +#: ../../library/asyncio-llapi-index.rst:226 msgid "Remove a handler for a :mod:`signal`." msgstr ":mod:`signal` 用のハンドラーを削除します。" -#: ../../library/asyncio-llapi-index.rst:238 +#: ../../library/asyncio-llapi-index.rst:229 msgid "Subprocesses" msgstr "サブプロセス" -#: ../../library/asyncio-llapi-index.rst:243 +#: ../../library/asyncio-llapi-index.rst:234 msgid ":meth:`loop.subprocess_exec`" msgstr ":meth:`loop.subprocess_exec`" -#: ../../library/asyncio-llapi-index.rst:244 +#: ../../library/asyncio-llapi-index.rst:235 msgid "Spawn a subprocess." msgstr "サブプロセスを生成します。" -#: ../../library/asyncio-llapi-index.rst:246 +#: ../../library/asyncio-llapi-index.rst:237 msgid ":meth:`loop.subprocess_shell`" msgstr ":meth:`loop.subprocess_shell`" -#: ../../library/asyncio-llapi-index.rst:247 +#: ../../library/asyncio-llapi-index.rst:238 msgid "Spawn a subprocess from a shell command." msgstr "シェルコマンドからサブプロセスを生成します。" -#: ../../library/asyncio-llapi-index.rst:250 +#: ../../library/asyncio-llapi-index.rst:241 msgid "Error Handling" msgstr "エラー処理" -#: ../../library/asyncio-llapi-index.rst:255 +#: ../../library/asyncio-llapi-index.rst:246 msgid ":meth:`loop.call_exception_handler`" msgstr ":meth:`loop.call_exception_handler`" -#: ../../library/asyncio-llapi-index.rst:256 +#: ../../library/asyncio-llapi-index.rst:247 msgid "Call the exception handler." msgstr "例外ハンドラを呼び出します。" -#: ../../library/asyncio-llapi-index.rst:258 +#: ../../library/asyncio-llapi-index.rst:249 msgid ":meth:`loop.set_exception_handler`" msgstr ":meth:`loop.set_exception_handler`" -#: ../../library/asyncio-llapi-index.rst:259 +#: ../../library/asyncio-llapi-index.rst:250 msgid "Set a new exception handler." msgstr "新しい例外ハンドラーを設定します。" -#: ../../library/asyncio-llapi-index.rst:261 +#: ../../library/asyncio-llapi-index.rst:252 msgid ":meth:`loop.get_exception_handler`" msgstr ":meth:`loop.get_exception_handler`" -#: ../../library/asyncio-llapi-index.rst:262 +#: ../../library/asyncio-llapi-index.rst:253 msgid "Get the current exception handler." msgstr "現在の例外ハンドラーを取得します。" -#: ../../library/asyncio-llapi-index.rst:264 +#: ../../library/asyncio-llapi-index.rst:255 msgid ":meth:`loop.default_exception_handler`" msgstr ":meth:`loop.default_exception_handler`" -#: ../../library/asyncio-llapi-index.rst:265 +#: ../../library/asyncio-llapi-index.rst:256 msgid "The default exception handler implementation." msgstr "デフォルトの例外ハンドラー実装です。" -#: ../../library/asyncio-llapi-index.rst:270 +#: ../../library/asyncio-llapi-index.rst:261 msgid "" -":ref:`Using asyncio.new_event_loop() and loop.run_forever() " +":ref:`Using asyncio.get_event_loop() and loop.run_forever() " "`." msgstr "" -#: ../../library/asyncio-llapi-index.rst:273 +#: ../../library/asyncio-llapi-index.rst:264 msgid ":ref:`Using loop.call_later() `." msgstr ":ref:`loop.call_later() を使う `。" -#: ../../library/asyncio-llapi-index.rst:275 +#: ../../library/asyncio-llapi-index.rst:266 msgid "" "Using ``loop.create_connection()`` to implement :ref:`an echo-client " "`." @@ -582,7 +556,7 @@ msgstr "" "``loop.create_connection()`` を使って :ref:`an echo-client " "` を実装する。" -#: ../../library/asyncio-llapi-index.rst:278 +#: ../../library/asyncio-llapi-index.rst:269 msgid "" "Using ``loop.create_connection()`` to :ref:`connect a socket " "`." @@ -590,7 +564,7 @@ msgstr "" "``loop.create_connection()`` を使って :ref:`ソケットに接続する " "`。" -#: ../../library/asyncio-llapi-index.rst:281 +#: ../../library/asyncio-llapi-index.rst:272 msgid "" ":ref:`Using add_reader() to watch an FD for read events " "`." @@ -598,65 +572,65 @@ msgstr "" ":ref:`add_reader() を使ってファイルデスクリプタの読み込みイベントを監視する " "`。" -#: ../../library/asyncio-llapi-index.rst:284 +#: ../../library/asyncio-llapi-index.rst:275 msgid ":ref:`Using loop.add_signal_handler() `." msgstr "" ":ref:`loop.add_signal_handler() を使う `。" -#: ../../library/asyncio-llapi-index.rst:286 +#: ../../library/asyncio-llapi-index.rst:277 msgid ":ref:`Using loop.subprocess_exec() `." msgstr "" ":ref:`loop.subprocess_exec() を使う `。" -#: ../../library/asyncio-llapi-index.rst:290 +#: ../../library/asyncio-llapi-index.rst:281 msgid "Transports" msgstr "トランスポート" -#: ../../library/asyncio-llapi-index.rst:292 +#: ../../library/asyncio-llapi-index.rst:283 msgid "All transports implement the following methods:" msgstr "全てのトランスポートは以下のメソッドを実装します:" -#: ../../library/asyncio-llapi-index.rst:298 +#: ../../library/asyncio-llapi-index.rst:289 msgid ":meth:`transport.close() `" msgstr ":meth:`transport.close() `" -#: ../../library/asyncio-llapi-index.rst:299 +#: ../../library/asyncio-llapi-index.rst:290 msgid "Close the transport." msgstr "トランスポートをクローズします。" -#: ../../library/asyncio-llapi-index.rst:301 +#: ../../library/asyncio-llapi-index.rst:292 msgid ":meth:`transport.is_closing() `" msgstr ":meth:`transport.is_closing() `" -#: ../../library/asyncio-llapi-index.rst:302 +#: ../../library/asyncio-llapi-index.rst:293 msgid "Return ``True`` if the transport is closing or is closed." msgstr "トランスポートを閉じている最中か閉じていた場合 ``True`` を返します。" -#: ../../library/asyncio-llapi-index.rst:304 +#: ../../library/asyncio-llapi-index.rst:295 msgid ":meth:`transport.get_extra_info() `" msgstr ":meth:`transport.get_extra_info() `" -#: ../../library/asyncio-llapi-index.rst:305 +#: ../../library/asyncio-llapi-index.rst:296 msgid "Request for information about the transport." msgstr "トランスポートについての情報をリクエストします。" -#: ../../library/asyncio-llapi-index.rst:307 +#: ../../library/asyncio-llapi-index.rst:298 msgid ":meth:`transport.set_protocol() `" msgstr ":meth:`transport.set_protocol() `" -#: ../../library/asyncio-llapi-index.rst:308 +#: ../../library/asyncio-llapi-index.rst:299 msgid "Set a new protocol." msgstr "トランスポートに新しいプロトコルを設定します。" -#: ../../library/asyncio-llapi-index.rst:310 +#: ../../library/asyncio-llapi-index.rst:301 msgid ":meth:`transport.get_protocol() `" msgstr ":meth:`transport.get_protocol() `" -#: ../../library/asyncio-llapi-index.rst:311 +#: ../../library/asyncio-llapi-index.rst:302 msgid "Return the current protocol." msgstr "現在のプロトコルを返します。" -#: ../../library/asyncio-llapi-index.rst:314 +#: ../../library/asyncio-llapi-index.rst:305 msgid "" "Transports that can receive data (TCP and Unix connections, pipes, etc). " "Returned from methods like :meth:`loop.create_connection`, :meth:`loop." @@ -666,35 +640,35 @@ msgstr "" "ドです。該当するトランスポートは :meth:`loop.create_connection`, :meth:`loop." "create_unix_connection`, :meth:`loop.connect_read_pipe` などの戻り値です:" -#: ../../library/asyncio-llapi-index.rst:319 +#: ../../library/asyncio-llapi-index.rst:310 msgid "Read Transports" msgstr "読み込みトランスポート" -#: ../../library/asyncio-llapi-index.rst:324 +#: ../../library/asyncio-llapi-index.rst:315 msgid ":meth:`transport.is_reading() `" msgstr ":meth:`transport.is_reading() `" -#: ../../library/asyncio-llapi-index.rst:325 +#: ../../library/asyncio-llapi-index.rst:316 msgid "Return ``True`` if the transport is receiving." msgstr "トランスポートがデータを受信中の場合 ``True`` を返します。" -#: ../../library/asyncio-llapi-index.rst:327 +#: ../../library/asyncio-llapi-index.rst:318 msgid ":meth:`transport.pause_reading() `" msgstr ":meth:`transport.pause_reading() `" -#: ../../library/asyncio-llapi-index.rst:328 +#: ../../library/asyncio-llapi-index.rst:319 msgid "Pause receiving." msgstr "データの受信を停止します。" -#: ../../library/asyncio-llapi-index.rst:330 +#: ../../library/asyncio-llapi-index.rst:321 msgid ":meth:`transport.resume_reading() `" msgstr ":meth:`transport.resume_reading() `" -#: ../../library/asyncio-llapi-index.rst:331 +#: ../../library/asyncio-llapi-index.rst:322 msgid "Resume receiving." msgstr "データの受信を再開します。" -#: ../../library/asyncio-llapi-index.rst:334 +#: ../../library/asyncio-llapi-index.rst:325 msgid "" "Transports that can Send data (TCP and Unix connections, pipes, etc). " "Returned from methods like :meth:`loop.create_connection`, :meth:`loop." @@ -704,56 +678,56 @@ msgstr "" "ドです。該当するトランスポートは :meth:`loop.create_connection`, :meth:`loop." "create_unix_connection`, :meth:`loop.connect_write_pipe` などの戻り値です:" -#: ../../library/asyncio-llapi-index.rst:339 +#: ../../library/asyncio-llapi-index.rst:330 msgid "Write Transports" msgstr "トランスポートにデータを書き込みます。" -#: ../../library/asyncio-llapi-index.rst:344 +#: ../../library/asyncio-llapi-index.rst:335 msgid ":meth:`transport.write() `" msgstr ":meth:`transport.write() `" -#: ../../library/asyncio-llapi-index.rst:345 +#: ../../library/asyncio-llapi-index.rst:336 msgid "Write data to the transport." msgstr "トランスポートにデータを書き込みます。" -#: ../../library/asyncio-llapi-index.rst:347 +#: ../../library/asyncio-llapi-index.rst:338 msgid ":meth:`transport.writelines() `" msgstr ":meth:`transport.writelines() `" -#: ../../library/asyncio-llapi-index.rst:348 +#: ../../library/asyncio-llapi-index.rst:339 msgid "Write buffers to the transport." msgstr "トランスポートにバッファの内容を書き込みます。" -#: ../../library/asyncio-llapi-index.rst:350 +#: ../../library/asyncio-llapi-index.rst:341 msgid ":meth:`transport.can_write_eof() `" msgstr ":meth:`transport.can_write_eof() `" -#: ../../library/asyncio-llapi-index.rst:351 +#: ../../library/asyncio-llapi-index.rst:342 msgid "Return :const:`True` if the transport supports sending EOF." msgstr "" "トランスポートが 終端 (EOF) の送信をサポートしている場合 :const:`True` を返し" "ます。" -#: ../../library/asyncio-llapi-index.rst:353 +#: ../../library/asyncio-llapi-index.rst:344 msgid ":meth:`transport.write_eof() `" msgstr ":meth:`transport.write_eof() `" -#: ../../library/asyncio-llapi-index.rst:354 +#: ../../library/asyncio-llapi-index.rst:345 msgid "Close and send EOF after flushing buffered data." msgstr "" "バッファに残っているデータをフラッシュしてから終端 (EOF) を送信して、トランス" "ポートをクローズします。" -#: ../../library/asyncio-llapi-index.rst:356 +#: ../../library/asyncio-llapi-index.rst:347 msgid ":meth:`transport.abort() `" msgstr ":meth:`transport.abort() `" -#: ../../library/asyncio-llapi-index.rst:357 -#: ../../library/asyncio-llapi-index.rst:383 +#: ../../library/asyncio-llapi-index.rst:348 +#: ../../library/asyncio-llapi-index.rst:370 msgid "Close the transport immediately." msgstr "トランスポートを即座にクローズします。" -#: ../../library/asyncio-llapi-index.rst:359 +#: ../../library/asyncio-llapi-index.rst:350 msgid "" ":meth:`transport.get_write_buffer_size() `" @@ -761,21 +735,11 @@ msgstr "" ":meth:`transport.get_write_buffer_size() `" -#: ../../library/asyncio-llapi-index.rst:361 -msgid "Return the current size of the output buffer." -msgstr "" - -#: ../../library/asyncio-llapi-index.rst:363 -msgid "" -":meth:`transport.get_write_buffer_limits() `" -msgstr "" - -#: ../../library/asyncio-llapi-index.rst:365 +#: ../../library/asyncio-llapi-index.rst:352 msgid "Return high and low water marks for write flow control." msgstr "書き込みフロー制御の高水位点と低水位点を取得します。" -#: ../../library/asyncio-llapi-index.rst:367 +#: ../../library/asyncio-llapi-index.rst:354 msgid "" ":meth:`transport.set_write_buffer_limits() `" @@ -783,31 +747,31 @@ msgstr "" ":meth:`transport.set_write_buffer_limits() `" -#: ../../library/asyncio-llapi-index.rst:369 +#: ../../library/asyncio-llapi-index.rst:356 msgid "Set new high and low water marks for write flow control." msgstr "書き込みフロー制御の高水位点と低水位点を設定します。" -#: ../../library/asyncio-llapi-index.rst:372 +#: ../../library/asyncio-llapi-index.rst:359 msgid "Transports returned by :meth:`loop.create_datagram_endpoint`:" msgstr ":meth:`loop.create_datagram_endpoint` が返すトランスポート:" -#: ../../library/asyncio-llapi-index.rst:374 +#: ../../library/asyncio-llapi-index.rst:361 msgid "Datagram Transports" msgstr "データグラムトランスポート" -#: ../../library/asyncio-llapi-index.rst:379 +#: ../../library/asyncio-llapi-index.rst:366 msgid ":meth:`transport.sendto() `" msgstr ":meth:`transport.sendto() `" -#: ../../library/asyncio-llapi-index.rst:380 +#: ../../library/asyncio-llapi-index.rst:367 msgid "Send data to the remote peer." msgstr "リモートピアにデータを送信します。" -#: ../../library/asyncio-llapi-index.rst:382 +#: ../../library/asyncio-llapi-index.rst:369 msgid ":meth:`transport.abort() `" msgstr ":meth:`transport.abort() `" -#: ../../library/asyncio-llapi-index.rst:386 +#: ../../library/asyncio-llapi-index.rst:373 msgid "" "Low-level transport abstraction over subprocesses. Returned by :meth:`loop." "subprocess_exec` and :meth:`loop.subprocess_shell`:" @@ -815,19 +779,19 @@ msgstr "" "サブプロセスに対するトランスポートの低レベルな抽象化です。 :meth:`loop." "subprocess_exec` や :meth:`loop.subprocess_shell` の戻り値です:" -#: ../../library/asyncio-llapi-index.rst:390 +#: ../../library/asyncio-llapi-index.rst:377 msgid "Subprocess Transports" msgstr "サブプロセス化されたトランスポート" -#: ../../library/asyncio-llapi-index.rst:395 +#: ../../library/asyncio-llapi-index.rst:382 msgid ":meth:`transport.get_pid() `" msgstr ":meth:`transport.get_pid() `" -#: ../../library/asyncio-llapi-index.rst:396 +#: ../../library/asyncio-llapi-index.rst:383 msgid "Return the subprocess process id." msgstr "サブプロセスのプロセス ID を返します。" -#: ../../library/asyncio-llapi-index.rst:398 +#: ../../library/asyncio-llapi-index.rst:385 msgid "" ":meth:`transport.get_pipe_transport() `" @@ -835,7 +799,7 @@ msgstr "" ":meth:`transport.get_pipe_transport() `" -#: ../../library/asyncio-llapi-index.rst:400 +#: ../../library/asyncio-llapi-index.rst:387 msgid "" "Return the transport for the requested communication pipe (*stdin*, " "*stdout*, or *stderr*)." @@ -843,206 +807,211 @@ msgstr "" "リクエストされた通信パイプ (標準入力 *stdin*, 標準出力 *stdout*, または標準エ" "ラー出力 *stderr*) のためのトランスポートを返します。" -#: ../../library/asyncio-llapi-index.rst:403 +#: ../../library/asyncio-llapi-index.rst:390 msgid ":meth:`transport.get_returncode() `" msgstr "" ":meth:`transport.get_returncode() `" -#: ../../library/asyncio-llapi-index.rst:404 +#: ../../library/asyncio-llapi-index.rst:391 msgid "Return the subprocess return code." msgstr "サブプロセスの終了ステータスを返します。" -#: ../../library/asyncio-llapi-index.rst:406 +#: ../../library/asyncio-llapi-index.rst:393 msgid ":meth:`transport.kill() `" msgstr ":meth:`transport.kill() `" -#: ../../library/asyncio-llapi-index.rst:407 +#: ../../library/asyncio-llapi-index.rst:394 msgid "Kill the subprocess." msgstr "サブプロセスを強制終了 (kill) します。" -#: ../../library/asyncio-llapi-index.rst:409 +#: ../../library/asyncio-llapi-index.rst:396 msgid ":meth:`transport.send_signal() `" msgstr ":meth:`transport.send_signal() `" -#: ../../library/asyncio-llapi-index.rst:410 +#: ../../library/asyncio-llapi-index.rst:397 msgid "Send a signal to the subprocess." msgstr "サブプロセスにシグナルを送信します。" -#: ../../library/asyncio-llapi-index.rst:412 +#: ../../library/asyncio-llapi-index.rst:399 msgid ":meth:`transport.terminate() `" msgstr ":meth:`transport.terminate() `" -#: ../../library/asyncio-llapi-index.rst:413 +#: ../../library/asyncio-llapi-index.rst:400 msgid "Stop the subprocess." msgstr "サブプロセスを停止します。" -#: ../../library/asyncio-llapi-index.rst:415 +#: ../../library/asyncio-llapi-index.rst:402 msgid ":meth:`transport.close() `" msgstr ":meth:`transport.close() `" -#: ../../library/asyncio-llapi-index.rst:416 +#: ../../library/asyncio-llapi-index.rst:403 msgid "Kill the subprocess and close all pipes." msgstr "サブプロセスを強制終了 (kill) し、全てのパイプをクローズします。" -#: ../../library/asyncio-llapi-index.rst:420 +#: ../../library/asyncio-llapi-index.rst:407 msgid "Protocols" msgstr "プロトコル" -#: ../../library/asyncio-llapi-index.rst:422 +#: ../../library/asyncio-llapi-index.rst:409 msgid "Protocol classes can implement the following **callback methods**:" msgstr "" "プロトコルクラスは以下の **コールバックメソッド** を実装することができます:" -#: ../../library/asyncio-llapi-index.rst:428 +#: ../../library/asyncio-llapi-index.rst:415 msgid "``callback`` :meth:`connection_made() `" msgstr "``callback`` :meth:`connection_made() `" -#: ../../library/asyncio-llapi-index.rst:429 +#: ../../library/asyncio-llapi-index.rst:416 msgid "Called when a connection is made." msgstr "コネクションが作成されたときに呼び出されます。" -#: ../../library/asyncio-llapi-index.rst:431 +#: ../../library/asyncio-llapi-index.rst:418 msgid "``callback`` :meth:`connection_lost() `" msgstr "``callback`` :meth:`connection_lost() `" -#: ../../library/asyncio-llapi-index.rst:432 +#: ../../library/asyncio-llapi-index.rst:419 msgid "Called when the connection is lost or closed." msgstr "コネクションが失われた、あるいはクローズされたときに呼び出されます。" -#: ../../library/asyncio-llapi-index.rst:434 +#: ../../library/asyncio-llapi-index.rst:421 msgid "``callback`` :meth:`pause_writing() `" msgstr "``callback`` :meth:`pause_writing() `" -#: ../../library/asyncio-llapi-index.rst:435 +#: ../../library/asyncio-llapi-index.rst:422 msgid "Called when the transport's buffer goes over the high water mark." msgstr "" "トランスポートのバッファーサイズが最高水位点 (High-Water Mark) を超えたときに" "呼び出されます。" -#: ../../library/asyncio-llapi-index.rst:437 +#: ../../library/asyncio-llapi-index.rst:424 msgid "``callback`` :meth:`resume_writing() `" msgstr "``callback`` :meth:`resume_writing() `" -#: ../../library/asyncio-llapi-index.rst:438 +#: ../../library/asyncio-llapi-index.rst:425 msgid "Called when the transport's buffer drains below the low water mark." msgstr "" "トランスポートのバッファーサイズが最低水位点 (Low-Water Mark) に達したきに呼" "び出されます。" -#: ../../library/asyncio-llapi-index.rst:441 +#: ../../library/asyncio-llapi-index.rst:428 msgid "Streaming Protocols (TCP, Unix Sockets, Pipes)" msgstr "ストリーミングプロトコル (TCP, Unix ソケット, パイプ)" -#: ../../library/asyncio-llapi-index.rst:446 +#: ../../library/asyncio-llapi-index.rst:433 msgid "``callback`` :meth:`data_received() `" msgstr "``callback`` :meth:`data_received() `" -#: ../../library/asyncio-llapi-index.rst:447 +#: ../../library/asyncio-llapi-index.rst:434 msgid "Called when some data is received." msgstr "データを受信したときに呼び出されます。" -#: ../../library/asyncio-llapi-index.rst:449 +#: ../../library/asyncio-llapi-index.rst:436 msgid "``callback`` :meth:`eof_received() `" msgstr "``callback`` :meth:`eof_received() `" -#: ../../library/asyncio-llapi-index.rst:450 -#: ../../library/asyncio-llapi-index.rst:465 +#: ../../library/asyncio-llapi-index.rst:437 +#: ../../library/asyncio-llapi-index.rst:452 msgid "Called when an EOF is received." msgstr "終端 (EOF) を受信したときに呼び出されます。" -#: ../../library/asyncio-llapi-index.rst:453 +#: ../../library/asyncio-llapi-index.rst:440 msgid "Buffered Streaming Protocols" msgstr "バッファリングされたストリーミングプロトコル" -#: ../../library/asyncio-llapi-index.rst:458 +#: ../../library/asyncio-llapi-index.rst:445 msgid "``callback`` :meth:`get_buffer() `" msgstr "``callback`` :meth:`get_buffer() `" -#: ../../library/asyncio-llapi-index.rst:459 +#: ../../library/asyncio-llapi-index.rst:446 msgid "Called to allocate a new receive buffer." msgstr "新しい受信バッファを割り当てるために呼び出します。" -#: ../../library/asyncio-llapi-index.rst:461 +#: ../../library/asyncio-llapi-index.rst:448 msgid "``callback`` :meth:`buffer_updated() `" msgstr "" "``callback`` :meth:`buffer_updated() `" -#: ../../library/asyncio-llapi-index.rst:462 +#: ../../library/asyncio-llapi-index.rst:449 msgid "Called when the buffer was updated with the received data." msgstr "受信データによりバッファが更新された場合に呼び出されます。" -#: ../../library/asyncio-llapi-index.rst:464 +#: ../../library/asyncio-llapi-index.rst:451 msgid "``callback`` :meth:`eof_received() `" msgstr "``callback`` :meth:`eof_received() `" -#: ../../library/asyncio-llapi-index.rst:468 +#: ../../library/asyncio-llapi-index.rst:455 msgid "Datagram Protocols" msgstr "データグラムプロトコル" -#: ../../library/asyncio-llapi-index.rst:473 +#: ../../library/asyncio-llapi-index.rst:460 msgid "" "``callback`` :meth:`datagram_received() `" msgstr "" "``callback`` :meth:`datagram_received() `" -#: ../../library/asyncio-llapi-index.rst:475 +#: ../../library/asyncio-llapi-index.rst:462 msgid "Called when a datagram is received." msgstr "データグラムを受信したときに呼び出されます。" -#: ../../library/asyncio-llapi-index.rst:477 +#: ../../library/asyncio-llapi-index.rst:464 msgid "``callback`` :meth:`error_received() `" msgstr "" "``callback`` :meth:`error_received() `" -#: ../../library/asyncio-llapi-index.rst:478 +#: ../../library/asyncio-llapi-index.rst:465 msgid "" "Called when a previous send or receive operation raises an :class:`OSError`." msgstr "" "直前の送信あるいは受信が :class:`OSError` を送出したときに呼び出されます。" -#: ../../library/asyncio-llapi-index.rst:482 +#: ../../library/asyncio-llapi-index.rst:469 msgid "Subprocess Protocols" msgstr "サブプロセスプロトコル" -#: ../../library/asyncio-llapi-index.rst:487 -msgid "``callback`` :meth:`~SubprocessProtocol.pipe_data_received`" +#: ../../library/asyncio-llapi-index.rst:474 +msgid "" +"``callback`` :meth:`pipe_data_received() `" msgstr "" +"``callback`` :meth:`pipe_data_received() `" -#: ../../library/asyncio-llapi-index.rst:488 +#: ../../library/asyncio-llapi-index.rst:476 msgid "" "Called when the child process writes data into its *stdout* or *stderr* pipe." msgstr "" "子プロセスが標準出力 (*stdout*) または標準エラー出力 (*stderr*) のパイプに" "データを書き込んだときに呼び出されます。" -#: ../../library/asyncio-llapi-index.rst:491 -msgid "``callback`` :meth:`~SubprocessProtocol.pipe_connection_lost`" +#: ../../library/asyncio-llapi-index.rst:479 +msgid "" +"``callback`` :meth:`pipe_connection_lost() `" msgstr "" +"``callback`` :meth:`pipe_connection_lost() `" -#: ../../library/asyncio-llapi-index.rst:492 +#: ../../library/asyncio-llapi-index.rst:481 msgid "" "Called when one of the pipes communicating with the child process is closed." msgstr "" "子プロセスと通信するパイプのいずれかがクローズされたときに呼び出されます。" -#: ../../library/asyncio-llapi-index.rst:495 +#: ../../library/asyncio-llapi-index.rst:484 msgid "" "``callback`` :meth:`process_exited() `" msgstr "" "``callback`` :meth:`process_exited() `" -#: ../../library/asyncio-llapi-index.rst:497 -msgid "" -"Called when the child process has exited. It can be called before :meth:" -"`~SubprocessProtocol.pipe_data_received` and :meth:`~SubprocessProtocol." -"pipe_connection_lost` methods." -msgstr "" +#: ../../library/asyncio-llapi-index.rst:486 +msgid "Called when the child process has exited." +msgstr "子プロセスが終了したときに呼び出されます。" -#: ../../library/asyncio-llapi-index.rst:503 +#: ../../library/asyncio-llapi-index.rst:490 msgid "Event Loop Policies" msgstr "イベントループのポリシー" -#: ../../library/asyncio-llapi-index.rst:505 +#: ../../library/asyncio-llapi-index.rst:492 msgid "" "Policies is a low-level mechanism to alter the behavior of functions like :" "func:`asyncio.get_event_loop`. See also the main :ref:`policies section " @@ -1052,30 +1021,30 @@ msgstr "" "ベルなメカニズムです。詳細は :ref:`ポリシーについてのセクション ` を参照してください。" -#: ../../library/asyncio-llapi-index.rst:511 +#: ../../library/asyncio-llapi-index.rst:498 msgid "Accessing Policies" msgstr "ポリシーへのアクセス" -#: ../../library/asyncio-llapi-index.rst:516 +#: ../../library/asyncio-llapi-index.rst:503 msgid ":meth:`asyncio.get_event_loop_policy`" msgstr ":meth:`asyncio.get_event_loop_policy`" -#: ../../library/asyncio-llapi-index.rst:517 +#: ../../library/asyncio-llapi-index.rst:504 msgid "Return the current process-wide policy." msgstr "プロセス全体にわたる現在のポリシーを返します。" -#: ../../library/asyncio-llapi-index.rst:519 +#: ../../library/asyncio-llapi-index.rst:506 msgid ":meth:`asyncio.set_event_loop_policy`" msgstr ":meth:`asyncio.set_event_loop_policy`" -#: ../../library/asyncio-llapi-index.rst:520 +#: ../../library/asyncio-llapi-index.rst:507 msgid "Set a new process-wide policy." msgstr "新たなプロセス全体にわたるポリシーを設定します。" -#: ../../library/asyncio-llapi-index.rst:522 +#: ../../library/asyncio-llapi-index.rst:509 msgid ":class:`AbstractEventLoopPolicy`" msgstr ":class:`AbstractEventLoopPolicy`" -#: ../../library/asyncio-llapi-index.rst:523 +#: ../../library/asyncio-llapi-index.rst:510 msgid "Base class for policy objects." msgstr "ポリシーオブジェクトの基底クラスです。" diff --git a/library/asyncio-platforms.po b/library/asyncio-platforms.po index ad7d39dc8..9eaff2ed3 100644 --- a/library/asyncio-platforms.po +++ b/library/asyncio-platforms.po @@ -1,27 +1,25 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 -# Takeshi Nakazato, 2022 -# 石井明久, 2024 +# tomo, 2020 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:55+0000\n" -"Last-Translator: 石井明久, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2018-09-18 00:23+0000\n" +"Last-Translator: tomo, 2020\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/asyncio-platforms.rst:9 @@ -75,10 +73,10 @@ msgstr "全ての Windows 上のイベントループは以下のメソッドを #: ../../library/asyncio-platforms.rst:38 msgid "" ":meth:`loop.create_unix_connection` and :meth:`loop.create_unix_server` are " -"not supported. The :const:`socket.AF_UNIX` socket family is specific to Unix." +"not supported. The :data:`socket.AF_UNIX` socket family is specific to Unix." msgstr "" ":meth:`loop.create_unix_connection` と :meth:`loop.create_unix_server` はサ" -"ポートされません。 :const:`socket.AF_UNIX` ソケットファミリーは Unix 固有で" +"ポートされません。 :data:`socket.AF_UNIX` ソケットファミリーは Unix 固有で" "す。" #: ../../library/asyncio-platforms.rst:42 @@ -141,14 +139,10 @@ msgstr "" #: ../../library/asyncio-platforms.rst:65 msgid "" "The resolution of the monotonic clock on Windows is usually around 15.6 " -"milliseconds. The best resolution is 0.5 milliseconds. The resolution " -"depends on the hardware (availability of `HPET `_) and on the Windows configuration." +"msec. The best resolution is 0.5 msec. The resolution depends on the " +"hardware (availability of `HPET `_) and on the Windows configuration." msgstr "" -"Windows のモノトニッククロックの時間分解能は、通常約15.6ミリ秒です。最高分解" -"能は0.5ミリ秒です。分解能はハードウエア (`HPET `_ が利用可能かどうか) および WIndows の設定" -"に依存します。" #: ../../library/asyncio-platforms.rst:75 msgid "Subprocess Support on Windows" @@ -163,19 +157,29 @@ msgstr "" "ブプロセスをサポートしますが、 :class:`SelectorEventLoop` はサポートしませ" "ん。" -#: ../../library/asyncio-platforms.rst:82 +#: ../../library/asyncio-platforms.rst:80 +msgid "" +"The :meth:`policy.set_child_watcher() ` function is also not supported, as :class:" +"`ProactorEventLoop` has a different mechanism to watch child processes." +msgstr "" +":meth:`policy.set_child_watcher() ` 関数もサポートされません。 :class:`ProactorEventLoop` は" +"子プロセスを監視するための異なる仕組みを持っています。" + +#: ../../library/asyncio-platforms.rst:87 msgid "macOS" msgstr "macOS" -#: ../../library/asyncio-platforms.rst:84 +#: ../../library/asyncio-platforms.rst:89 msgid "Modern macOS versions are fully supported." msgstr "最近の macOS バージョンは完全にサポートされています。" -#: ../../library/asyncio-platforms.rst:87 +#: ../../library/asyncio-platforms.rst:92 msgid "macOS <= 10.8" msgstr "10.8 以前の macOS" -#: ../../library/asyncio-platforms.rst:88 +#: ../../library/asyncio-platforms.rst:93 msgid "" "On macOS 10.6, 10.7 and 10.8, the default event loop uses :class:`selectors." "KqueueSelector`, which does not support character devices on these " @@ -189,13 +193,3 @@ msgstr "" "でキャラクターデバイスをサポートするためには :class:`SelectorEventLoop` で :" "class:`~selectors.SelectSelector` または :class:`~selectors.PollSelector` を" "使うように手動で設定します。以下はその例です::" - -#: ../../library/asyncio-platforms.rst:95 -msgid "" -"import asyncio\n" -"import selectors\n" -"\n" -"selector = selectors.SelectSelector()\n" -"loop = asyncio.SelectorEventLoop(selector)\n" -"asyncio.set_event_loop(loop)" -msgstr "" diff --git a/library/asyncio-policy.po b/library/asyncio-policy.po index fef22dd2d..7005bb45a 100644 --- a/library/asyncio-policy.po +++ b/library/asyncio-policy.po @@ -1,63 +1,52 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 -# Takeshi Nakazato, 2022 +# tomo, 2019 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:55+0000\n" -"Last-Translator: Takeshi Nakazato, 2022\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2018-09-18 00:23+0000\n" +"Last-Translator: tomo, 2019\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/asyncio-policy.rst:8 msgid "Policies" msgstr "ポリシー" -#: ../../library/asyncio-policy.rst:12 -msgid "" -"Policies are deprecated and will be removed in Python 3.16. Users are " -"encouraged to use the :func:`asyncio.run` function or the :class:`asyncio." -"Runner` with *loop_factory* to use the desired loop implementation." -msgstr "" - -#: ../../library/asyncio-policy.rst:18 +#: ../../library/asyncio-policy.rst:10 msgid "" -"An event loop policy is a global object used to get and set the current :ref:" -"`event loop `, as well as create new event loops. The " -"default policy can be :ref:`replaced ` with :ref:" -"`built-in alternatives ` to use different event loop " -"implementations, or substituted by a :ref:`custom policy ` that can override these behaviors." +"An event loop policy is a global per-process object that controls the " +"management of the event loop. Each event loop has a default policy, which " +"can be changed and customized using the policy API." msgstr "" -#: ../../library/asyncio-policy.rst:27 +#: ../../library/asyncio-policy.rst:14 msgid "" -"The :ref:`policy object ` gets and sets a separate " -"event loop per *context*. This is per-thread by default, though custom " -"policies could define *context* differently." +"A policy defines the notion of *context* and manages a separate event loop " +"per context. The default policy defines *context* to be the current thread." msgstr "" -#: ../../library/asyncio-policy.rst:32 +#: ../../library/asyncio-policy.rst:18 msgid "" -"Custom event loop policies can control the behavior of :func:" -"`get_event_loop`, :func:`set_event_loop`, and :func:`new_event_loop`." +"By using a custom event loop policy, the behavior of :func:" +"`get_event_loop`, :func:`set_event_loop`, and :func:`new_event_loop` " +"functions can be customized." msgstr "" -#: ../../library/asyncio-policy.rst:35 +#: ../../library/asyncio-policy.rst:22 msgid "" "Policy objects should implement the APIs defined in the :class:" "`AbstractEventLoopPolicy` abstract base class." @@ -65,59 +54,47 @@ msgstr "" "ポリシーオブジェクトは :class:`AbstractEventLoopPolicy` 抽象基底クラスで定義" "された API を実装しなければなりません。" -#: ../../library/asyncio-policy.rst:42 +#: ../../library/asyncio-policy.rst:27 msgid "Getting and Setting the Policy" msgstr "ポリシーの取得と設定" -#: ../../library/asyncio-policy.rst:44 +#: ../../library/asyncio-policy.rst:29 msgid "" "The following functions can be used to get and set the policy for the " "current process:" msgstr "" "以下の関数は現在のプロセスに対するポリシーの取得や設定をするために使われます:" -#: ../../library/asyncio-policy.rst:49 +#: ../../library/asyncio-policy.rst:34 msgid "Return the current process-wide policy." msgstr "プロセス全体にわたる現在のポリシーを返します。" -#: ../../library/asyncio-policy.rst:51 -msgid "" -"The :func:`get_event_loop_policy` function is deprecated and will be removed " -"in Python 3.16." -msgstr "" - -#: ../../library/asyncio-policy.rst:57 +#: ../../library/asyncio-policy.rst:38 msgid "Set the current process-wide policy to *policy*." msgstr "プロセス全体にわたる現在のポリシーを *policy* に設定します。" -#: ../../library/asyncio-policy.rst:59 +#: ../../library/asyncio-policy.rst:40 msgid "If *policy* is set to ``None``, the default policy is restored." msgstr "" "*policy* が ``None`` の場合、デフォルトポリシーが現在のポリシーに戻されます。" -#: ../../library/asyncio-policy.rst:61 -msgid "" -"The :func:`set_event_loop_policy` function is deprecated and will be removed " -"in Python 3.16." -msgstr "" - -#: ../../library/asyncio-policy.rst:69 +#: ../../library/asyncio-policy.rst:44 msgid "Policy Objects" msgstr "ポリシーオブジェクト" -#: ../../library/asyncio-policy.rst:71 +#: ../../library/asyncio-policy.rst:46 msgid "The abstract event loop policy base class is defined as follows:" msgstr "イベントループポリシーの抽象基底クラスは以下のように定義されています:" -#: ../../library/asyncio-policy.rst:75 +#: ../../library/asyncio-policy.rst:50 msgid "An abstract base class for asyncio policies." msgstr "asyncio ポリシーの抽象基底クラスです。" -#: ../../library/asyncio-policy.rst:79 +#: ../../library/asyncio-policy.rst:54 msgid "Get the event loop for the current context." msgstr "現在のコンテキストのイベントループを取得します。" -#: ../../library/asyncio-policy.rst:81 +#: ../../library/asyncio-policy.rst:56 msgid "" "Return an event loop object implementing the :class:`AbstractEventLoop` " "interface." @@ -125,29 +102,44 @@ msgstr "" ":class:`AbstractEventLoop` のインターフェースを実装したイベントループオブジェ" "クトを返します。" -#: ../../library/asyncio-policy.rst:84 ../../library/asyncio-policy.rst:96 +#: ../../library/asyncio-policy.rst:59 ../../library/asyncio-policy.rst:71 msgid "This method should never return ``None``." msgstr "このメソッドは ``None`` を返してはいけません。" -#: ../../library/asyncio-policy.rst:90 +#: ../../library/asyncio-policy.rst:65 msgid "Set the event loop for the current context to *loop*." msgstr "現在のコンテキストにイベントループ *loop* を設定します。" -#: ../../library/asyncio-policy.rst:94 +#: ../../library/asyncio-policy.rst:69 msgid "Create and return a new event loop object." msgstr "新しいイベントループオブジェクトを生成して返します。" -#: ../../library/asyncio-policy.rst:98 +#: ../../library/asyncio-policy.rst:75 +msgid "Get a child process watcher object." +msgstr "子プロセスを監視するウオッチャーオブジェクトを返します。" + +#: ../../library/asyncio-policy.rst:77 msgid "" -"The :class:`AbstractEventLoopPolicy` class is deprecated and will be removed " -"in Python 3.16." +"Return a watcher object implementing the :class:`AbstractChildWatcher` " +"interface." +msgstr "" +":class:`AbstractChildWatcher` のインターフェースを実装したウオッチャーオブ" +"ジェクトを返します。" + +#: ../../library/asyncio-policy.rst:80 ../../library/asyncio-policy.rst:86 +msgid "This function is Unix specific." +msgstr "この関数は Unix 特有です。" + +#: ../../library/asyncio-policy.rst:84 +msgid "Set the current child process watcher to *watcher*." msgstr "" +"子プロセスに対する現在のウオッチャーオブジェクトを *watcher* に設定します。" -#: ../../library/asyncio-policy.rst:105 +#: ../../library/asyncio-policy.rst:89 msgid "asyncio ships with the following built-in policies:" msgstr "asyncio は以下の組み込みポリシーを提供します:" -#: ../../library/asyncio-policy.rst:110 +#: ../../library/asyncio-policy.rst:94 msgid "" "The default asyncio policy. Uses :class:`SelectorEventLoop` on Unix and :" "class:`ProactorEventLoop` on Windows." @@ -155,7 +147,7 @@ msgstr "" "デフォルトの asyncio ポリシーです。Unix では :class:`SelectorEventLoop` 、" "Windows では :class:`ProactorEventLoop` を使います。" -#: ../../library/asyncio-policy.rst:113 +#: ../../library/asyncio-policy.rst:97 msgid "" "There is no need to install the default policy manually. asyncio is " "configured to use the default policy automatically." @@ -163,61 +155,317 @@ msgstr "" "デフォルトのポリシーを手動でインストールする必要はありません。 asyncio はデ" "フォルトポリシーを使うように自動的に構成されます。 " -#: ../../library/asyncio-policy.rst:118 +#: ../../library/asyncio-policy.rst:102 msgid "On Windows, :class:`ProactorEventLoop` is now used by default." msgstr "" "Windows では :class:`ProactorEventLoop` がデフォルトで使われるようになりまし" "た。" -#: ../../library/asyncio-policy.rst:120 +#: ../../library/asyncio-policy.rst:107 +msgid "" +"An alternative event loop policy that uses the :class:`SelectorEventLoop` " +"event loop implementation." +msgstr "" +":class:`SelectorEventLoop` イベントループ実装を使った別のイベントループポリ" +"シーです。" + +#: ../../library/asyncio-policy.rst:110 ../../library/asyncio-policy.rst:118 +msgid ":ref:`Availability `: Windows." +msgstr ":ref:`利用可能な環境 `: Windows 。" + +#: ../../library/asyncio-policy.rst:115 msgid "" -"The :meth:`get_event_loop` method of the default asyncio policy now raises " -"a :exc:`RuntimeError` if there is no set event loop." +"An alternative event loop policy that uses the :class:`ProactorEventLoop` " +"event loop implementation." msgstr "" +":class:`ProactorEventLoop` イベントループ実装を使った別のイベントループポリ" +"シーです。" -#: ../../library/asyncio-policy.rst:124 +#: ../../library/asyncio-policy.rst:123 +msgid "Process Watchers" +msgstr "プロセスのウオッチャー" + +#: ../../library/asyncio-policy.rst:125 msgid "" -"The :class:`DefaultEventLoopPolicy` class is deprecated and will be removed " -"in Python 3.16." +"A process watcher allows customization of how an event loop monitors child " +"processes on Unix. Specifically, the event loop needs to know when a child " +"process has exited." msgstr "" +"プロセスのウオッチャーは Unix 上でイベントループが子プロセスを監視する方法を" +"カスタマイズすることを可能にします。特に、子プロセスがいつ終了したかをイベン" +"トループは知る必要があります。" -#: ../../library/asyncio-policy.rst:131 +#: ../../library/asyncio-policy.rst:129 msgid "" -"An alternative event loop policy that uses the :class:`SelectorEventLoop` " -"event loop implementation." +"In asyncio, child processes are created with :func:`create_subprocess_exec` " +"and :meth:`loop.subprocess_exec` functions." msgstr "" -":class:`SelectorEventLoop` イベントループ実装を使った別のイベントループポリ" -"シーです。" +"asyncio では、子プロセスは :func:`create_subprocess_exec` や :meth:`loop." +"subprocess_exec` 関数により生成されます。" -#: ../../library/asyncio-policy.rst:134 ../../library/asyncio-policy.rst:146 -msgid "Availability" +#: ../../library/asyncio-policy.rst:133 +msgid "" +"asyncio defines the :class:`AbstractChildWatcher` abstract base class, which " +"child watchers should implement, and has four different implementations: :" +"class:`ThreadedChildWatcher` (configured to be used by default), :class:" +"`MultiLoopChildWatcher`, :class:`SafeChildWatcher`, and :class:" +"`FastChildWatcher`." msgstr "" +"asyncio は、子プロセスのウオッチャーが実装すべき :class:" +"`AbstractChildWatcher` 抽象基底クラスを定義しており、さらに異なる4つの実装ク" +"ラスを提供しています: :class:`ThreadedChildWatcher` (デフォルトでこのクラスが" +"使われるように構成されます), :class:`MultiLoopChildWatcher`, :class:" +"`SafeChildWatcher`, そして :class:`FastChildWatcher` です。" -#: ../../library/asyncio-policy.rst:136 +#: ../../library/asyncio-policy.rst:139 msgid "" -"The :class:`WindowsSelectorEventLoopPolicy` class is deprecated and will be " -"removed in Python 3.16." +"See also the :ref:`Subprocess and Threads ` " +"section." msgstr "" +":ref:`サブプロセスとスレッド ` 節も参照してくださ" +"い。" -#: ../../library/asyncio-policy.rst:143 +#: ../../library/asyncio-policy.rst:142 msgid "" -"An alternative event loop policy that uses the :class:`ProactorEventLoop` " -"event loop implementation." +"The following two functions can be used to customize the child process " +"watcher implementation used by the asyncio event loop:" msgstr "" -":class:`ProactorEventLoop` イベントループ実装を使った別のイベントループポリ" -"シーです。" +"以下の2つの関数は asyncio のイベントループが使う子プロセスのウオッチャーの実" +"装をカスタマイズするために使うことができます:" + +#: ../../library/asyncio-policy.rst:147 +msgid "Return the current child watcher for the current policy." +msgstr "現在のポリシーにおける子プロセスのウオッチャーを返します。" -#: ../../library/asyncio-policy.rst:148 +#: ../../library/asyncio-policy.rst:151 msgid "" -"The :class:`WindowsProactorEventLoopPolicy` class is deprecated and will be " -"removed in Python 3.16." +"Set the current child watcher to *watcher* for the current policy. " +"*watcher* must implement methods defined in the :class:" +"`AbstractChildWatcher` base class." msgstr "" +"現在ポリシーにおける子プロセスのウオッチャーを *watcher* に設定します。 " +"*watcher* は :class:`AbstractChildWatcher` 基底クラスで定義されたメソッドを実" +"装していなければなりません。" #: ../../library/asyncio-policy.rst:156 +msgid "" +"Third-party event loops implementations might not support custom child " +"watchers. For such event loops, using :func:`set_child_watcher` might be " +"prohibited or have no effect." +msgstr "" +"サードパーティのイベントループ実装は子プロセスのウオッチャーのカスタマイズを" +"サポートしていない可能性があります。そのようなイベントループでは、 :func:" +"`set_child_watcher` 関数の利用は禁止されているか、または何の効果もありませ" +"ん。" + +#: ../../library/asyncio-policy.rst:164 +msgid "Register a new child handler." +msgstr "新しい子プロセスのハンドラを登録します。" + +#: ../../library/asyncio-policy.rst:166 +msgid "" +"Arrange for ``callback(pid, returncode, *args)`` to be called when a process " +"with PID equal to *pid* terminates. Specifying another callback for the " +"same process replaces the previous handler." +msgstr "" +"プロセス ID (PID) が *pid* であるプロセスが終了した時に ``callback(pid, " +"returncode, *args)`` コールバック関数が呼び出されるように手配します。同じプロ" +"セスに対して別のコールバックを登録した場合、以前登録したハンドラを置き換えま" +"す。" + +#: ../../library/asyncio-policy.rst:171 +msgid "The *callback* callable must be thread-safe." +msgstr "" +"*callback* はスレッドセーフな呼び出し可能オブジェクトでなければなりません。" + +#: ../../library/asyncio-policy.rst:175 +msgid "Removes the handler for process with PID equal to *pid*." +msgstr "" +"プロセス ID (PID) が *pid* であるプロセスに対して登録されたハンドラを削除しま" +"す。" + +#: ../../library/asyncio-policy.rst:177 +msgid "" +"The function returns ``True`` if the handler was successfully removed, " +"``False`` if there was nothing to remove." +msgstr "" +"ハンドラが正しく削除された場合 ``True`` を返します。削除するハンドラがない場" +"合は ``False`` を返します。" + +#: ../../library/asyncio-policy.rst:182 +msgid "Attach the watcher to an event loop." +msgstr "ウオッチャーをイベントループに接続します。" + +#: ../../library/asyncio-policy.rst:184 +msgid "" +"If the watcher was previously attached to an event loop, then it is first " +"detached before attaching to the new loop." +msgstr "" +"ウオッチャーがイベントループに接続されている場合、新しいイベントループに接続" +"される前に接続済みのイベントループから切り離されます。" + +#: ../../library/asyncio-policy.rst:187 +msgid "Note: loop may be ``None``." +msgstr "注: 引数は ``None`` をとることができます。" + +#: ../../library/asyncio-policy.rst:191 +msgid "Return ``True`` if the watcher is ready to use." +msgstr "ウオッチャーが利用可能な状態なら ``True`` を返します。" + +#: ../../library/asyncio-policy.rst:193 +msgid "" +"Spawning a subprocess with *inactive* current child watcher raises :exc:" +"`RuntimeError`." +msgstr "" +"現在の子プロセスのウオッチャーが *アクティブでない* 場合にサブプロセスを生成" +"すると :exc:`RuntimeError` 例外が送出されます。" + +#: ../../library/asyncio-policy.rst:200 +msgid "Close the watcher." +msgstr "ウオッチャーをクローズします。" + +#: ../../library/asyncio-policy.rst:202 +msgid "" +"This method has to be called to ensure that underlying resources are cleaned-" +"up." +msgstr "" +"このメソッドは、ウオッチャーの背後にあるリソースを確実にクリーンアップするた" +"めに必ず呼び出さなければなりません。" + +#: ../../library/asyncio-policy.rst:207 +msgid "" +"This implementation starts a new waiting thread for every subprocess spawn." +msgstr "" +"この実装は、各サブプロセスの生成時に新しい待ち受けスレッドを開始します。" + +#: ../../library/asyncio-policy.rst:209 +msgid "" +"It works reliably even when the asyncio event loop is run in a non-main OS " +"thread." +msgstr "" +"このクラスは asyncio イベントループがメインでない OS スレッド上で実行されてい" +"ても期待通りに動きます。" + +#: ../../library/asyncio-policy.rst:211 +msgid "" +"There is no noticeable overhead when handling a big number of children " +"(*O(1)* each time a child terminates), but starting a thread per process " +"requires extra memory." +msgstr "" +"大量の子プロセスを処理する際に顕著なオーバーヘッドはありません (子プロセスが" +"終了するごとに *O(1)* 程度です) が、各プロセスに対してスレッドを開始するため" +"の追加のメモリが必要になります。" + +#: ../../library/asyncio-policy.rst:214 +msgid "This watcher is used by default." +msgstr "このウオッチャーはデフォルトで使われます。" + +#: ../../library/asyncio-policy.rst:220 +msgid "" +"This implementation registers a :py:data:`SIGCHLD` signal handler on " +"instantiation. That can break third-party code that installs a custom " +"handler for :py:data:`SIGCHLD` signal." +msgstr "" +"この実装はインスタンス化の際に :py:data:`SIGCHLD` シグナルハンドラを登録しま" +"す。これにより、独自の :py:data:`SIGCHLD` シグナルハンドラをインストールする" +"ようなサードパーティのコードを壊す可能性があります。" + +#: ../../library/asyncio-policy.rst:224 ../../library/asyncio-policy.rst:242 +msgid "" +"The watcher avoids disrupting other code spawning processes by polling every " +"process explicitly on a :py:data:`SIGCHLD` signal." +msgstr "" +"このウオッチャーは、各プロセスに明示的に :py:data:`SIGCHLD` シグナルをポーリ" +"ングさせることにより、プロセスを生成する他のコードを中断させないようにしま" +"す。" + +#: ../../library/asyncio-policy.rst:227 +msgid "" +"There is no limitation for running subprocesses from different threads once " +"the watcher is installed." +msgstr "" +"いったんウオッチャーがインストールされると、異なるスレッドからのサブプロセス" +"の実行について特に制限はありません。" + +#: ../../library/asyncio-policy.rst:230 +msgid "" +"The solution is safe but it has a significant overhead when handling a big " +"number of processes (*O(n)* each time a :py:data:`SIGCHLD` is received)." +msgstr "" +"このソリューションは安全ですが、大量の子プロセスを処理する際に非常に大きな" +"オーバーヘッドを伴います (:py:data:`SIGCHLD` シグナルを受信するごとに *O(n)* " +"程度)。" + +#: ../../library/asyncio-policy.rst:238 +msgid "" +"This implementation uses active event loop from the main thread to handle :" +"py:data:`SIGCHLD` signal. If the main thread has no running event loop " +"another thread cannot spawn a subprocess (:exc:`RuntimeError` is raised)." +msgstr "" +"この実装はメインスレッドでアクティブなイベントループを使って :py:data:" +"`SIGCHLD` シグナルを処理します。メインスレッドでイベントループが実行中でない" +"場合、別のスレッドからサブプロセスを生成することはできません (:exc:" +"`RuntimeError` 例外が送出されます)。" + +#: ../../library/asyncio-policy.rst:245 +msgid "" +"This solution is as safe as :class:`MultiLoopChildWatcher` and has the same " +"*O(N)* complexity but requires a running event loop in the main thread to " +"work." +msgstr "" +"このソリューションは :class:`MultiLoopChildWatcher` と同じように安全で、同程" +"度の *O(N)* オーバーヘッドがあります。一方で、このソリューションはメインス" +"レッドで実行中のイベントループが必要です。" + +#: ../../library/asyncio-policy.rst:250 +msgid "" +"This implementation reaps every terminated processes by calling ``os." +"waitpid(-1)`` directly, possibly breaking other code spawning processes and " +"waiting for their termination." +msgstr "" +"この実装は終了した子プロセスを得るために直接 ``os.waitpid(-1)`` を呼び出しま" +"す。これにより、プロセスを生成してその終了を待ち受ける別のコードを壊す可能性" +"があります。" + +#: ../../library/asyncio-policy.rst:254 +msgid "" +"There is no noticeable overhead when handling a big number of children " +"(*O(1)* each time a child terminates)." +msgstr "" +"大量の子プロセスを処理する際に顕著なオーバーヘッドはありません (子プロセスが" +"終了するごとに *O(1)* 程度です)。" + +#: ../../library/asyncio-policy.rst:257 +msgid "" +"This solution requires a running event loop in the main thread to work, as :" +"class:`SafeChildWatcher`." +msgstr "" +"このソリューションは、 :class:`SafeChildWatcher` と同様にメインスレッドで実行" +"中のイベントループが必要です。" + +#: ../../library/asyncio-policy.rst:262 +msgid "" +"This implementation polls process file descriptors (pidfds) to await child " +"process termination. In some respects, :class:`PidfdChildWatcher` is a " +"\"Goldilocks\" child watcher implementation. It doesn't require signals or " +"threads, doesn't interfere with any processes launched outside the event " +"loop, and scales linearly with the number of subprocesses launched by the " +"event loop. The main disadvantage is that pidfds are specific to Linux, and " +"only work on recent (5.3+) kernels." +msgstr "" +"この実装は子プロセスの終了を待ち受けるためにプロセスのファイル記述子 " +"(pidfds) をポーリングします。いくつかの点で、 :class:`PidfdChildWatcher` は " +"\"Goldilocks\" 的な子プロセスのウオッチャー実装です。この実装はシグナルもス" +"レッドも必要とせず、イベントループの外で生成されたいかなるプロセスとも干渉せ" +"ず、しかもイベントループから生成されたサブプロセスの数に対して線形にスケール" +"します。主な欠点は pidfds が Linux 特有であり、最近のカーネル (5.3+) でしか動" +"かないことです。" + +#: ../../library/asyncio-policy.rst:274 msgid "Custom Policies" msgstr "ポリシーのカスタマイズ" -#: ../../library/asyncio-policy.rst:158 +#: ../../library/asyncio-policy.rst:276 msgid "" "To implement a new event loop policy, it is recommended to subclass :class:" "`DefaultEventLoopPolicy` and override the methods for which custom behavior " @@ -226,19 +474,3 @@ msgstr "" "新しいイベントループのポリシーを実装するためには、以下に示すように :class:" "`DefaultEventLoopPolicy` を継承して振る舞いを変更したいメソッドをオーバーライ" "ドすることが推奨されます。::" - -#: ../../library/asyncio-policy.rst:162 -msgid "" -"class MyEventLoopPolicy(asyncio.DefaultEventLoopPolicy):\n" -"\n" -" def get_event_loop(self):\n" -" \"\"\"Get the event loop.\n" -"\n" -" This may be None or an instance of EventLoop.\n" -" \"\"\"\n" -" loop = super().get_event_loop()\n" -" # Do something with loop ...\n" -" return loop\n" -"\n" -"asyncio.set_event_loop_policy(MyEventLoopPolicy())" -msgstr "" diff --git a/library/asyncio-protocol.po b/library/asyncio-protocol.po index 8b87e76f5..645606de3 100644 --- a/library/asyncio-protocol.po +++ b/library/asyncio-protocol.po @@ -1,27 +1,30 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 -# Takeshi Nakazato, 2022 -# 石井明久, 2024 +# E. Kawashima, 2017 +# Arihiro TAKASE, 2017 +# Masato HASHIMOTO , 2017 +# Shun Sakurai, 2017 +# tomo, 2018 +# MS_H, 2019 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-13 14:21+0000\n" -"PO-Revision-Date: 2021-06-28 00:55+0000\n" -"Last-Translator: 石井明久, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-05-15 06:22+0000\n" +"PO-Revision-Date: 2017-02-16 17:49+0000\n" +"Last-Translator: MS_H, 2019\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/asyncio-protocol.rst:9 @@ -300,30 +303,29 @@ msgid "" "flushed asynchronously. No more data will be received. After all buffered " "data is flushed, the protocol's :meth:`protocol.connection_lost() " "` method will be called with :const:`None` as " -"its argument. The transport should not be used once it is closed." +"its argument." msgstr "" "トランスポートが発信データのバッファーを持っていた場合、バッファーされたデー" "タは非同期にフラッシュされます。それ以降データは受信されません。バッファーさ" "れていたデータがすべてフラッシュされた後、そのプロトコルの :meth:`protocol." "connection_lost() ` メソッドが引数 :const:" -"`None` で呼び出されます。一度閉じたトランスポートは、使用されるべきではありま" -"せん。" +"`None` で呼び出されます。" -#: ../../library/asyncio-protocol.rst:164 +#: ../../library/asyncio-protocol.rst:163 msgid "Return ``True`` if the transport is closing or is closed." msgstr "トランスポートを閉じている最中か閉じていた場合 ``True`` を返します。" -#: ../../library/asyncio-protocol.rst:168 +#: ../../library/asyncio-protocol.rst:167 msgid "Return information about the transport or underlying resources it uses." msgstr "トランスポートまたはそれが背後で利用しているリソースの情報を返します。" -#: ../../library/asyncio-protocol.rst:171 +#: ../../library/asyncio-protocol.rst:170 msgid "" "*name* is a string representing the piece of transport-specific information " "to get." msgstr "*name* は取得するトランスポート特有の情報を表す文字列です。" -#: ../../library/asyncio-protocol.rst:174 +#: ../../library/asyncio-protocol.rst:173 msgid "" "*default* is the value to return if the information is not available, or if " "the transport does not support querying it with the given third-party event " @@ -333,7 +335,7 @@ msgstr "" "ループ実装や現在のプラットフォームがその情報の問い合わせをサポートしていない" "場合に返される値です。" -#: ../../library/asyncio-protocol.rst:179 +#: ../../library/asyncio-protocol.rst:178 msgid "" "For example, the following code attempts to get the underlying socket object " "of the transport::" @@ -341,22 +343,15 @@ msgstr "" "例えば、以下のコードはトランスポート内のソケットオブジェクトを取得しようとし" "ます::" -#: ../../library/asyncio-protocol.rst:182 -msgid "" -"sock = transport.get_extra_info('socket')\n" -"if sock is not None:\n" -" print(sock.getsockopt(...))" -msgstr "" - -#: ../../library/asyncio-protocol.rst:186 +#: ../../library/asyncio-protocol.rst:185 msgid "Categories of information that can be queried on some transports:" msgstr "いくつかのトランスポートで問い合わせ可能な情報のカテゴリを示します:" -#: ../../library/asyncio-protocol.rst:188 +#: ../../library/asyncio-protocol.rst:187 msgid "socket:" msgstr "ソケット:" -#: ../../library/asyncio-protocol.rst:190 +#: ../../library/asyncio-protocol.rst:189 msgid "" "``'peername'``: the remote address to which the socket is connected, result " "of :meth:`socket.socket.getpeername` (``None`` on error)" @@ -364,11 +359,11 @@ msgstr "" "``'peername'``: ソケットが接続されているリモートアドレスで、:meth:`socket." "socket.getpeername` の結果になります (エラーのときは ``None``)" -#: ../../library/asyncio-protocol.rst:194 +#: ../../library/asyncio-protocol.rst:193 msgid "``'socket'``: :class:`socket.socket` instance" msgstr "``'socket'``: :class:`socket.socket` のインスタンスになります" -#: ../../library/asyncio-protocol.rst:196 +#: ../../library/asyncio-protocol.rst:195 msgid "" "``'sockname'``: the socket's own address, result of :meth:`socket.socket." "getsockname`" @@ -376,11 +371,11 @@ msgstr "" "``'sockname'``: ソケット自身のアドレスで、:meth:`socket.socket.getsockname` " "の結果になります" -#: ../../library/asyncio-protocol.rst:199 +#: ../../library/asyncio-protocol.rst:198 msgid "SSL socket:" msgstr "SSL ソケット:" -#: ../../library/asyncio-protocol.rst:201 +#: ../../library/asyncio-protocol.rst:200 msgid "" "``'compression'``: the compression algorithm being used as a string, or " "``None`` if the connection isn't compressed; result of :meth:`ssl.SSLSocket." @@ -389,7 +384,7 @@ msgstr "" "``'compression'``: 圧縮アルゴリズムで、:meth:`ssl.SSLSocket.compression` の結" "果になります。圧縮されていないときは ``None`` になります" -#: ../../library/asyncio-protocol.rst:205 +#: ../../library/asyncio-protocol.rst:204 msgid "" "``'cipher'``: a three-value tuple containing the name of the cipher being " "used, the version of the SSL protocol that defines its use, and the number " @@ -399,45 +394,45 @@ msgstr "" "ている SSL プロトコルのバージョン、および使用されている秘密鍵のビット数) から" "なるタプルで、:meth:`ssl.SSLSocket.cipher` の結果になります" -#: ../../library/asyncio-protocol.rst:210 +#: ../../library/asyncio-protocol.rst:209 msgid "" "``'peercert'``: peer certificate; result of :meth:`ssl.SSLSocket.getpeercert`" msgstr "" "``'peercert'``: ピアの証明書で、:meth:`ssl.SSLSocket.getpeercert` の結果にな" "ります" -#: ../../library/asyncio-protocol.rst:213 +#: ../../library/asyncio-protocol.rst:212 msgid "``'sslcontext'``: :class:`ssl.SSLContext` instance" msgstr "``'sslcontext'``: :class:`ssl.SSLContext` のインスタンスになります" -#: ../../library/asyncio-protocol.rst:215 +#: ../../library/asyncio-protocol.rst:214 msgid "" "``'ssl_object'``: :class:`ssl.SSLObject` or :class:`ssl.SSLSocket` instance" msgstr "" "``'ssl_object'``: :class:`ssl.SSLObject` または :class:`ssl.SSLSocket` インス" "タンス" -#: ../../library/asyncio-protocol.rst:218 +#: ../../library/asyncio-protocol.rst:217 msgid "pipe:" msgstr "パイプ:" -#: ../../library/asyncio-protocol.rst:220 +#: ../../library/asyncio-protocol.rst:219 msgid "``'pipe'``: pipe object" msgstr "``'pipe'``: パイプオブジェクトです" -#: ../../library/asyncio-protocol.rst:222 +#: ../../library/asyncio-protocol.rst:221 msgid "subprocess:" msgstr "サブプロセス:" -#: ../../library/asyncio-protocol.rst:224 +#: ../../library/asyncio-protocol.rst:223 msgid "``'subprocess'``: :class:`subprocess.Popen` instance" msgstr "``'subprocess'``: :class:`subprocess.Popen` のインスタンスになります" -#: ../../library/asyncio-protocol.rst:228 +#: ../../library/asyncio-protocol.rst:227 msgid "Set a new protocol." msgstr "トランスポートに新しいプロトコルを設定します。" -#: ../../library/asyncio-protocol.rst:230 +#: ../../library/asyncio-protocol.rst:229 msgid "" "Switching protocol should only be done when both protocols are documented to " "support the switch." @@ -445,19 +440,19 @@ msgstr "" "プロトコルの切り替えは、両方のプロトコルのドキュメントで切り替えがサポートさ" "れている場合にのみ行うべきです。" -#: ../../library/asyncio-protocol.rst:235 +#: ../../library/asyncio-protocol.rst:234 msgid "Return the current protocol." msgstr "現在のプロトコルを返します。" -#: ../../library/asyncio-protocol.rst:239 +#: ../../library/asyncio-protocol.rst:238 msgid "Read-only Transports" msgstr "読み出し専用のトランスポート" -#: ../../library/asyncio-protocol.rst:243 +#: ../../library/asyncio-protocol.rst:242 msgid "Return ``True`` if the transport is receiving new data." msgstr "トランスポートが新しいデータを受信中の場合 ``True`` を返します。" -#: ../../library/asyncio-protocol.rst:249 +#: ../../library/asyncio-protocol.rst:248 msgid "" "Pause the receiving end of the transport. No data will be passed to the " "protocol's :meth:`protocol.data_received() ` method " @@ -467,7 +462,7 @@ msgstr "" "び出されるまでプロトコルの :meth:`protocol.data_received() ` メソッドにデータは渡されません。" -#: ../../library/asyncio-protocol.rst:253 +#: ../../library/asyncio-protocol.rst:252 msgid "" "The method is idempotent, i.e. it can be called when the transport is " "already paused or closed." @@ -475,7 +470,7 @@ msgstr "" "このメソッドはべき等です。すなわちトランスポートがすでに停止していたりクロー" "ズしていても呼び出すことができます。" -#: ../../library/asyncio-protocol.rst:259 +#: ../../library/asyncio-protocol.rst:258 msgid "" "Resume the receiving end. The protocol's :meth:`protocol.data_received() " "` method will be called once again if some data is " @@ -485,7 +480,7 @@ msgstr "" "data_received() ` メソッドが再び呼び出されるようにな" "ります。" -#: ../../library/asyncio-protocol.rst:263 +#: ../../library/asyncio-protocol.rst:262 msgid "" "The method is idempotent, i.e. it can be called when the transport is " "already reading." @@ -493,11 +488,11 @@ msgstr "" "このメソッドはべき等です。すなわちトランスポートがすでにデータを読み込み中で" "あっても呼び出すことができます。" -#: ../../library/asyncio-protocol.rst:269 +#: ../../library/asyncio-protocol.rst:268 msgid "Write-only Transports" msgstr "書き込み専用のトランスポート" -#: ../../library/asyncio-protocol.rst:273 +#: ../../library/asyncio-protocol.rst:272 msgid "" "Close the transport immediately, without waiting for pending operations to " "complete. Buffered data will be lost. No more data will be received. The " @@ -510,7 +505,7 @@ msgstr "" "` メソッドが引数 :const:`None` で呼び出されま" "す。" -#: ../../library/asyncio-protocol.rst:281 +#: ../../library/asyncio-protocol.rst:280 msgid "" "Return :const:`True` if the transport supports :meth:`~WriteTransport." "write_eof`, :const:`False` if not." @@ -518,11 +513,11 @@ msgstr "" "トランスポートが :meth:`~WriteTransport.write_eof` メソッドをサポートしている" "場合 :const:`True` を返し、そうでない場合は :const:`False` を返します。" -#: ../../library/asyncio-protocol.rst:286 +#: ../../library/asyncio-protocol.rst:285 msgid "Return the current size of the output buffer used by the transport." msgstr "トランスポートで使用されている出力バッファーの現在のサイズを返します。" -#: ../../library/asyncio-protocol.rst:290 +#: ../../library/asyncio-protocol.rst:289 msgid "" "Get the *high* and *low* watermarks for write flow control. Return a tuple " "``(low, high)`` where *low* and *high* are positive number of bytes." @@ -531,15 +526,15 @@ msgstr "" "high)`` タプルを返します。ここで *low* と *high* はバイト数をあらわす正の整数" "です。" -#: ../../library/asyncio-protocol.rst:294 +#: ../../library/asyncio-protocol.rst:293 msgid "Use :meth:`set_write_buffer_limits` to set the limits." msgstr "水位点の設定は :meth:`set_write_buffer_limits` で行います。" -#: ../../library/asyncio-protocol.rst:300 +#: ../../library/asyncio-protocol.rst:299 msgid "Set the *high* and *low* watermarks for write flow control." msgstr "書き込みフロー制御の *最高* および *最低* 水位点を設定します。" -#: ../../library/asyncio-protocol.rst:302 +#: ../../library/asyncio-protocol.rst:301 msgid "" "These two values (measured in number of bytes) control when the protocol's :" "meth:`protocol.pause_writing() ` and :meth:" @@ -554,7 +549,7 @@ msgstr "" "さくなければなりません。また、 *high* も *low* も負の値を指定することはできま" "せん。" -#: ../../library/asyncio-protocol.rst:310 +#: ../../library/asyncio-protocol.rst:309 msgid "" ":meth:`~BaseProtocol.pause_writing` is called when the buffer size becomes " "greater than or equal to the *high* value. If writing has been paused, :meth:" @@ -566,7 +561,7 @@ msgstr "" "が *low* の値以下になると :meth:`~BaseProtocol.resume_writing` メソッドが呼び" "出されます。" -#: ../../library/asyncio-protocol.rst:315 +#: ../../library/asyncio-protocol.rst:314 msgid "" "The defaults are implementation-specific. If only the high watermark is " "given, the low watermark defaults to an implementation-specific value less " @@ -585,18 +580,18 @@ msgstr "" "呼び出されるようになります。どちらかにゼロを設定することは I/O と計算を並行に" "実行する機会を減少させるため、一般に最適ではありません。" -#: ../../library/asyncio-protocol.rst:326 +#: ../../library/asyncio-protocol.rst:325 msgid "Use :meth:`~WriteTransport.get_write_buffer_limits` to get the limits." msgstr "" "上限値と下限値を取得するには :meth:`~WriteTransport.get_write_buffer_limits` " "メソッドを使ってください。" -#: ../../library/asyncio-protocol.rst:331 +#: ../../library/asyncio-protocol.rst:330 msgid "Write some *data* bytes to the transport." msgstr "トランスポートにバイト列 *data* を書き込みます。" -#: ../../library/asyncio-protocol.rst:333 -#: ../../library/asyncio-protocol.rst:362 +#: ../../library/asyncio-protocol.rst:332 +#: ../../library/asyncio-protocol.rst:361 msgid "" "This method does not block; it buffers the data and arranges for it to be " "sent out asynchronously." @@ -604,7 +599,7 @@ msgstr "" "このメソッドはブロックしません; データをバッファーし、非同期に送信する準備を" "行います。" -#: ../../library/asyncio-protocol.rst:338 +#: ../../library/asyncio-protocol.rst:337 msgid "" "Write a list (or any iterable) of data bytes to the transport. This is " "functionally equivalent to calling :meth:`write` on each element yielded by " @@ -614,7 +609,7 @@ msgstr "" "この振る舞いはイテラブルを yield して各要素で :meth:`write` を呼び出すことと" "等価ですが、より効率的な実装となる場合があります。" -#: ../../library/asyncio-protocol.rst:345 +#: ../../library/asyncio-protocol.rst:344 msgid "" "Close the write end of the transport after flushing all buffered data. Data " "may still be received." @@ -622,7 +617,7 @@ msgstr "" "バッファーされた全てのデータをフラッシュした後トランスポートの送信側をクロー" "ズします。送信側をクローズした後もデータを受信することは可能です。" -#: ../../library/asyncio-protocol.rst:348 +#: ../../library/asyncio-protocol.rst:347 msgid "" "This method can raise :exc:`NotImplementedError` if the transport (e.g. SSL) " "doesn't support half-closed connections." @@ -630,11 +625,11 @@ msgstr "" "このメソッドはトランスポート (例えば SSL) がハーフクローズドな接続をサポート" "していない場合 :exc:`NotImplementedError` を送出します。" -#: ../../library/asyncio-protocol.rst:353 +#: ../../library/asyncio-protocol.rst:352 msgid "Datagram Transports" msgstr "データグラムトランスポート" -#: ../../library/asyncio-protocol.rst:357 +#: ../../library/asyncio-protocol.rst:356 msgid "" "Send the *data* bytes to the remote peer given by *addr* (a transport-" "dependent target address). If *addr* is :const:`None`, the data is sent to " @@ -644,17 +639,7 @@ msgstr "" "信します。*addr* が :const:`None` の場合、データはトランスポートの作成時に指" "定された送信先に送られます。" -#: ../../library/asyncio-protocol.rst:365 -msgid "" -"This method can be called with an empty bytes object to send a zero-length " -"datagram. The buffer size calculation used for flow control is also updated " -"to account for the datagram header." -msgstr "" -"このメソッドは、長さがゼロのデータグラムを送信するために、空のバイトオブジェ" -"クトで呼び出すこともできます。フロー制御に使用されるバッファサイズ計算も、" -"データグラムヘッダーを考慮するように更新されました。" - -#: ../../library/asyncio-protocol.rst:372 +#: ../../library/asyncio-protocol.rst:366 msgid "" "Close the transport immediately, without waiting for pending operations to " "complete. Buffered data will be lost. No more data will be received. The " @@ -667,22 +652,22 @@ msgstr "" "` メソッドが引数 :const:`None` で呼び出されま" "す。" -#: ../../library/asyncio-protocol.rst:382 +#: ../../library/asyncio-protocol.rst:376 msgid "Subprocess Transports" msgstr "サブプロセス化されたトランスポート" -#: ../../library/asyncio-protocol.rst:386 +#: ../../library/asyncio-protocol.rst:380 msgid "Return the subprocess process id as an integer." msgstr "サブプロセスのプロセス ID (整数) を返します。" -#: ../../library/asyncio-protocol.rst:390 +#: ../../library/asyncio-protocol.rst:384 msgid "" "Return the transport for the communication pipe corresponding to the integer " "file descriptor *fd*:" msgstr "" "整数のファイル記述子 *fd* に該当する通信パイプのトランスポートを返します:" -#: ../../library/asyncio-protocol.rst:393 +#: ../../library/asyncio-protocol.rst:387 msgid "" "``0``: readable streaming transport of the standard input (*stdin*), or :" "const:`None` if the subprocess was not created with ``stdin=PIPE``" @@ -690,7 +675,7 @@ msgstr "" "``0``: 標準入力 (*stdin*) の読み込み可能ストリーミングトランスポート。サブプ" "ロセスが ``stdin=PIPE`` で作成されていない場合は :const:`None`" -#: ../../library/asyncio-protocol.rst:395 +#: ../../library/asyncio-protocol.rst:389 msgid "" "``1``: writable streaming transport of the standard output (*stdout*), or :" "const:`None` if the subprocess was not created with ``stdout=PIPE``" @@ -698,7 +683,7 @@ msgstr "" "``1``: 標準出力 (*stdout*) の書き込み可能ストリーミングトランスポート。サブプ" "ロセスが ``stdout=PIPE`` で作成されていない場合は :const:`None`" -#: ../../library/asyncio-protocol.rst:397 +#: ../../library/asyncio-protocol.rst:391 msgid "" "``2``: writable streaming transport of the standard error (*stderr*), or :" "const:`None` if the subprocess was not created with ``stderr=PIPE``" @@ -706,11 +691,11 @@ msgstr "" "``2``: 標準エラー出力 (*stderr*) の書き込み可能ストリーミングトランスポート。" "サブプロセスが ``stderr=PIPE`` で作成されていない場合は :const:`None`" -#: ../../library/asyncio-protocol.rst:399 +#: ../../library/asyncio-protocol.rst:393 msgid "other *fd*: :const:`None`" msgstr "その他の *fd*: :const:`None`" -#: ../../library/asyncio-protocol.rst:403 +#: ../../library/asyncio-protocol.rst:397 msgid "" "Return the subprocess return code as an integer or :const:`None` if it " "hasn't returned, which is similar to the :attr:`subprocess.Popen.returncode` " @@ -720,11 +705,11 @@ msgstr "" "た場合は :const:`None` を返します。 :attr:`subprocess.Popen.returncode` 属性" "と同じです。" -#: ../../library/asyncio-protocol.rst:409 +#: ../../library/asyncio-protocol.rst:403 msgid "Kill the subprocess." msgstr "サブプロセスを強制終了 (kill) します。" -#: ../../library/asyncio-protocol.rst:411 +#: ../../library/asyncio-protocol.rst:405 msgid "" "On POSIX systems, the function sends SIGKILL to the subprocess. On Windows, " "this method is an alias for :meth:`terminate`." @@ -732,11 +717,11 @@ msgstr "" "POSIX システムでは、この関数はサブプロセスに SIGKILL を送信します。Windows で" "は、このメソッドは :meth:`terminate` の別名です。" -#: ../../library/asyncio-protocol.rst:414 +#: ../../library/asyncio-protocol.rst:408 msgid "See also :meth:`subprocess.Popen.kill`." msgstr ":meth:`subprocess.Popen.kill` も参照してください。" -#: ../../library/asyncio-protocol.rst:418 +#: ../../library/asyncio-protocol.rst:412 msgid "" "Send the *signal* number to the subprocess, as in :meth:`subprocess.Popen." "send_signal`." @@ -744,29 +729,27 @@ msgstr "" "サブプロセスにシグナル *signal* を送信します。:meth:`subprocess.Popen." "send_signal` と同じです。" -#: ../../library/asyncio-protocol.rst:423 +#: ../../library/asyncio-protocol.rst:417 msgid "Stop the subprocess." msgstr "サブプロセスを停止します。" -#: ../../library/asyncio-protocol.rst:425 +#: ../../library/asyncio-protocol.rst:419 msgid "" -"On POSIX systems, this method sends :py:const:`~signal.SIGTERM` to the " -"subprocess. On Windows, the Windows API function :c:func:`!TerminateProcess` " -"is called to stop the subprocess." +"On POSIX systems, this method sends SIGTERM to the subprocess. On Windows, " +"the Windows API function TerminateProcess() is called to stop the subprocess." msgstr "" -"POSIX システムでは、このメソッドはサブプロセスに :py:const:`~signal.SIGTERM` " -"を送信します。Windows では、Windows API 関数 :c:func:`!TerminateProcess` がサ" -"ブプロセスを停止するために呼び出されます。" +"POSIX システムでは、このメソッドはサブプロセスに SIGTERM を送信します。" +"Windows では、Windows API 関数 TerminateProcess() が呼び出されます。" -#: ../../library/asyncio-protocol.rst:429 +#: ../../library/asyncio-protocol.rst:423 msgid "See also :meth:`subprocess.Popen.terminate`." msgstr ":meth:`subprocess.Popen.terminate` も参照してください。" -#: ../../library/asyncio-protocol.rst:433 +#: ../../library/asyncio-protocol.rst:427 msgid "Kill the subprocess by calling the :meth:`kill` method." msgstr ":meth:`kill` メソッドを呼び出すことでサブプロセスを強制終了します。" -#: ../../library/asyncio-protocol.rst:435 +#: ../../library/asyncio-protocol.rst:429 msgid "" "If the subprocess hasn't returned yet, and close transports of *stdin*, " "*stdout*, and *stderr* pipes." @@ -774,15 +757,15 @@ msgstr "" "サブプロセスがまだリターンしていない場合、 *stdin*, *stdout*, および " "*stderr* の各パイプのトランスポートをクローズします。" -#: ../../library/asyncio-protocol.rst:442 +#: ../../library/asyncio-protocol.rst:436 msgid "Protocols" msgstr "プロトコル" -#: ../../library/asyncio-protocol.rst:444 +#: ../../library/asyncio-protocol.rst:438 msgid "**Source code:** :source:`Lib/asyncio/protocols.py`" msgstr "**ソースコード:** :source:`Lib/asyncio/protocols.py`" -#: ../../library/asyncio-protocol.rst:448 +#: ../../library/asyncio-protocol.rst:442 msgid "" "asyncio provides a set of abstract base classes that should be used to " "implement network protocols. Those classes are meant to be used together " @@ -792,7 +775,7 @@ msgstr "" "ます。これらのクラスは :ref:`トランスポート ` と組み合わせ" "て使うことが想定されています。" -#: ../../library/asyncio-protocol.rst:452 +#: ../../library/asyncio-protocol.rst:446 msgid "" "Subclasses of abstract base protocol classes may implement some or all " "methods. All these methods are callbacks: they are called by transports on " @@ -804,24 +787,24 @@ msgstr "" "た、などの決まったイベントに対してトランスポートから呼び出されます。基底プロ" "トコルメソッドは対応するトランスポートから呼び出されるべきです。" -#: ../../library/asyncio-protocol.rst:459 +#: ../../library/asyncio-protocol.rst:453 msgid "Base Protocols" msgstr "基底プロトコル" -#: ../../library/asyncio-protocol.rst:463 +#: ../../library/asyncio-protocol.rst:457 msgid "Base protocol with methods that all protocols share." msgstr "" "全てのプロトコルクラスが共有する全てのメソッドを持った基底プロトコルクラスで" "す。" -#: ../../library/asyncio-protocol.rst:467 +#: ../../library/asyncio-protocol.rst:461 msgid "" "The base class for implementing streaming protocols (TCP, Unix sockets, etc)." msgstr "" "ストリーミングプロトコル (TCP, Unix ソケットなど) を実装するための基底クラス" "です。" -#: ../../library/asyncio-protocol.rst:472 +#: ../../library/asyncio-protocol.rst:466 msgid "" "A base class for implementing streaming protocols with manual control of the " "receive buffer." @@ -829,11 +812,11 @@ msgstr "" "受信バッファーを手動で制御するストリーミングプロトコルを実装するための基底ク" "ラスです。" -#: ../../library/asyncio-protocol.rst:477 +#: ../../library/asyncio-protocol.rst:471 msgid "The base class for implementing datagram (UDP) protocols." msgstr "データグラム (UDP) プロトコルを実装するための基底クラスです。" -#: ../../library/asyncio-protocol.rst:481 +#: ../../library/asyncio-protocol.rst:475 msgid "" "The base class for implementing protocols communicating with child processes " "(unidirectional pipes)." @@ -841,21 +824,21 @@ msgstr "" "子プロセスと (一方向パイプを通じて) 通信するプロトコルを実装するための基底ク" "ラスです。" -#: ../../library/asyncio-protocol.rst:486 +#: ../../library/asyncio-protocol.rst:480 msgid "Base Protocol" msgstr "基底プロトコル" -#: ../../library/asyncio-protocol.rst:488 +#: ../../library/asyncio-protocol.rst:482 msgid "All asyncio protocols can implement Base Protocol callbacks." msgstr "" "全ての asyncio プロトコルは基底プロトコルのコールバックを実装することができま" "す。" -#: ../../library/asyncio-protocol.rst:491 +#: ../../library/asyncio-protocol.rst:485 msgid "Connection Callbacks" msgstr "通信のコールバック" -#: ../../library/asyncio-protocol.rst:492 +#: ../../library/asyncio-protocol.rst:486 msgid "" "Connection callbacks are called on all protocols, exactly once per a " "successful connection. All other protocol callbacks can only be called " @@ -865,11 +848,11 @@ msgstr "" "につきただ一度だけ呼び出されます。その他の全てのプロトコルコールバックはこれ" "ら2つのメソッドの間に呼び出すことができます。 " -#: ../../library/asyncio-protocol.rst:498 +#: ../../library/asyncio-protocol.rst:492 msgid "Called when a connection is made." msgstr "コネクションが作成されたときに呼び出されます。" -#: ../../library/asyncio-protocol.rst:500 +#: ../../library/asyncio-protocol.rst:494 msgid "" "The *transport* argument is the transport representing the connection. The " "protocol is responsible for storing the reference to its transport." @@ -877,11 +860,11 @@ msgstr "" "引数 *transport* はコネクションをあらわすトランスポートです。プロトコルはトラ" "ンスポートへの参照を保存する責任を負います。" -#: ../../library/asyncio-protocol.rst:506 +#: ../../library/asyncio-protocol.rst:500 msgid "Called when the connection is lost or closed." msgstr "コネクションが失われた、あるいはクローズされたときに呼び出されます。" -#: ../../library/asyncio-protocol.rst:508 +#: ../../library/asyncio-protocol.rst:502 msgid "" "The argument is either an exception object or :const:`None`. The latter " "means a regular EOF is received, or the connection was aborted or closed by " @@ -891,11 +874,11 @@ msgstr "" "通常の EOF が受信されたか、あるいはコネクションがこちら側から中止またはクロー" "ズされたことを意味します。" -#: ../../library/asyncio-protocol.rst:514 +#: ../../library/asyncio-protocol.rst:508 msgid "Flow Control Callbacks" msgstr "フロー制御コールバック" -#: ../../library/asyncio-protocol.rst:515 +#: ../../library/asyncio-protocol.rst:509 msgid "" "Flow control callbacks can be called by transports to pause or resume " "writing performed by the protocol." @@ -903,7 +886,7 @@ msgstr "" "フロー制御コールバックは、プロトコルによって実行される書き込み処理を停止また" "は再開するためにトランスポートから呼び出されます。" -#: ../../library/asyncio-protocol.rst:518 +#: ../../library/asyncio-protocol.rst:512 msgid "" "See the documentation of the :meth:`~WriteTransport.set_write_buffer_limits` " "method for more details." @@ -911,19 +894,19 @@ msgstr "" "詳しくは :meth:`~WriteTransport.set_write_buffer_limits` メソッドのドキュメン" "トを参照してください。" -#: ../../library/asyncio-protocol.rst:523 +#: ../../library/asyncio-protocol.rst:517 msgid "Called when the transport's buffer goes over the high watermark." msgstr "" "トランスポートのバッファーサイズが最高水位点 (high watermark) を超えたときに" "呼び出されます。" -#: ../../library/asyncio-protocol.rst:527 +#: ../../library/asyncio-protocol.rst:521 msgid "Called when the transport's buffer drains below the low watermark." msgstr "" "トランスポートのバッファーサイズが最低水位点 (low watermark) に達したきに呼び" "出されます。" -#: ../../library/asyncio-protocol.rst:529 +#: ../../library/asyncio-protocol.rst:523 msgid "" "If the buffer size equals the high watermark, :meth:`~BaseProtocol." "pause_writing` is not called: the buffer size must go strictly over." @@ -932,7 +915,7 @@ msgstr "" "pause_writing` は呼び出されません: バッファーサイズは必ず制限値を超えなければ" "なりません。" -#: ../../library/asyncio-protocol.rst:533 +#: ../../library/asyncio-protocol.rst:527 msgid "" "Conversely, :meth:`~BaseProtocol.resume_writing` is called when the buffer " "size is equal or lower than the low watermark. These end conditions are " @@ -943,11 +926,11 @@ msgstr "" "ちらの基準値もゼロである場合の処理が期待通りとなることを保証するために重要で" "す。" -#: ../../library/asyncio-protocol.rst:540 +#: ../../library/asyncio-protocol.rst:534 msgid "Streaming Protocols" msgstr "ストリーミングプロトコル" -#: ../../library/asyncio-protocol.rst:542 +#: ../../library/asyncio-protocol.rst:536 msgid "" "Event methods, such as :meth:`loop.create_server`, :meth:`loop." "create_unix_server`, :meth:`loop.create_connection`, :meth:`loop." @@ -961,7 +944,7 @@ msgstr "" "connect_write_pipe` などのイベントメソッドはストリーミングプロトコルを返す" "ファクトリを受け付けます。" -#: ../../library/asyncio-protocol.rst:550 +#: ../../library/asyncio-protocol.rst:544 msgid "" "Called when some data is received. *data* is a non-empty bytes object " "containing the incoming data." @@ -969,7 +952,7 @@ msgstr "" "データを受信したときに呼び出されます。*data* は受信したデータを含む空ではない" "バイト列オブジェクトになります。" -#: ../../library/asyncio-protocol.rst:553 +#: ../../library/asyncio-protocol.rst:547 msgid "" "Whether the data is buffered, chunked or reassembled depends on the " "transport. In general, you shouldn't rely on specific semantics and instead " @@ -981,7 +964,7 @@ msgstr "" "く、代わりにデータのパースを全般的かつ柔軟に行うべきです。ただし、データは常" "に正しい順序で受信されます。" -#: ../../library/asyncio-protocol.rst:558 +#: ../../library/asyncio-protocol.rst:552 msgid "" "The method can be called an arbitrary number of times while a connection is " "open." @@ -989,17 +972,17 @@ msgstr "" "このメソッドは、コネクションがオープンである間は何度でも呼び出すことができま" "す。" -#: ../../library/asyncio-protocol.rst:561 +#: ../../library/asyncio-protocol.rst:555 msgid "" "However, :meth:`protocol.eof_received() ` is called " -"at most once. Once ``eof_received()`` is called, ``data_received()`` is not " +"at most once. Once `eof_received()` is called, ``data_received()`` is not " "called anymore." msgstr "" "いっぽうで、 :meth:`protocol.eof_received() ` メソッド" -"は最大でも一度だけ呼び出されます。いったん ``eof_received()`` が呼び出される" +"は最大でも一度だけ呼び出されます。いったん `eof_received()` が呼び出される" "と、それ以降 ``data_received()`` は呼び出されません。" -#: ../../library/asyncio-protocol.rst:567 +#: ../../library/asyncio-protocol.rst:561 msgid "" "Called when the other end signals it won't send any more data (for example " "by calling :meth:`transport.write_eof() `, if the " @@ -1009,7 +992,7 @@ msgstr "" "相手方が asyncio を使用しており、 :meth:`transport.write_eof() " "` を呼び出した場合) に呼び出されます。" -#: ../../library/asyncio-protocol.rst:572 +#: ../../library/asyncio-protocol.rst:566 msgid "" "This method may return a false value (including ``None``), in which case the " "transport will close itself. Conversely, if this method returns a true " @@ -1022,7 +1005,7 @@ msgstr "" "コルがトランスポートをクローズするかどうかを決めます。デフォルトの実装は " "``None`` を返すため、コネクションは暗黙のうちにクローズされます。" -#: ../../library/asyncio-protocol.rst:578 +#: ../../library/asyncio-protocol.rst:572 msgid "" "Some transports, including SSL, don't support half-closed connections, in " "which case returning true from this method will result in the connection " @@ -1031,24 +1014,16 @@ msgstr "" "SSL を含む一部のトランスポートはハーフクローズ接続をサポートしません。そのよ" "うな場合このメソッドが真値を返すとコネクションはクローズされます。" -#: ../../library/asyncio-protocol.rst:583 -#: ../../library/asyncio-protocol.rst:641 +#: ../../library/asyncio-protocol.rst:577 +#: ../../library/asyncio-protocol.rst:635 msgid "State machine:" msgstr "ステートマシン:" -#: ../../library/asyncio-protocol.rst:585 -msgid "" -"start -> connection_made\n" -" [-> data_received]*\n" -" [-> eof_received]?\n" -"-> connection_lost -> end" -msgstr "" - -#: ../../library/asyncio-protocol.rst:594 +#: ../../library/asyncio-protocol.rst:588 msgid "Buffered Streaming Protocols" msgstr "バッファリングされたストリーミングプロトコル" -#: ../../library/asyncio-protocol.rst:598 +#: ../../library/asyncio-protocol.rst:592 msgid "" "Buffered Protocols can be used with any event loop method that supports " "`Streaming Protocols`_." @@ -1056,7 +1031,7 @@ msgstr "" "バッファー付きプロトコルは `ストリーミングプロトコル`_ をサポートするイベン" "トループメソッドで利用することができます。" -#: ../../library/asyncio-protocol.rst:601 +#: ../../library/asyncio-protocol.rst:595 msgid "" "``BufferedProtocol`` implementations allow explicit manual allocation and " "control of the receive buffer. Event loops can then use the buffer provided " @@ -1071,18 +1046,18 @@ msgstr "" "信するプロトコルにおいて顕著なパフォーマンスの向上をもたらします。精巧なプロ" "トコル実装によりバッファー割り当ての数を劇的に減少させることができます。" -#: ../../library/asyncio-protocol.rst:608 +#: ../../library/asyncio-protocol.rst:602 msgid "" "The following callbacks are called on :class:`BufferedProtocol` instances:" msgstr "" "以下に示すコールバックは :class:`BufferedProtocol` インスタンスに対して呼び出" "されます:" -#: ../../library/asyncio-protocol.rst:613 +#: ../../library/asyncio-protocol.rst:607 msgid "Called to allocate a new receive buffer." msgstr "新しい受信バッファを割り当てるために呼び出します。" -#: ../../library/asyncio-protocol.rst:615 +#: ../../library/asyncio-protocol.rst:609 msgid "" "*sizehint* is the recommended minimum size for the returned buffer. It is " "acceptable to return smaller or larger buffers than what *sizehint* " @@ -1094,7 +1069,7 @@ msgstr "" "ています。 -1 がセットされた場合、バッファーサイズは任意となります。サイズが" "ゼロのバッファーを返すとエラーになります。" -#: ../../library/asyncio-protocol.rst:620 +#: ../../library/asyncio-protocol.rst:614 msgid "" "``get_buffer()`` must return an object implementing the :ref:`buffer " "protocol `." @@ -1102,15 +1077,15 @@ msgstr "" "``get_buffer()`` は :ref:`バッファープロトコル ` を実装したオ" "ブジェクトを返さなければなりません。" -#: ../../library/asyncio-protocol.rst:625 +#: ../../library/asyncio-protocol.rst:619 msgid "Called when the buffer was updated with the received data." msgstr "受信データによりバッファが更新された場合に呼び出されます。" -#: ../../library/asyncio-protocol.rst:627 +#: ../../library/asyncio-protocol.rst:621 msgid "*nbytes* is the total number of bytes that were written to the buffer." msgstr "*nbytes* はバッファに書き込まれた総バイト数です。" -#: ../../library/asyncio-protocol.rst:631 +#: ../../library/asyncio-protocol.rst:625 msgid "" "See the documentation of the :meth:`protocol.eof_received() ` method." @@ -1118,7 +1093,7 @@ msgstr "" ":meth:`protocol.eof_received() ` メソッドのドキュメン" "トを参照してください。" -#: ../../library/asyncio-protocol.rst:635 +#: ../../library/asyncio-protocol.rst:629 msgid "" ":meth:`~BufferedProtocol.get_buffer` can be called an arbitrary number of " "times during a connection. However, :meth:`protocol.eof_received() " @@ -1132,21 +1107,11 @@ msgstr "" "`~BufferedProtocol.get_buffer` と :meth:`~BufferedProtocol.buffer_updated` が" "呼び出されることはありません。" -#: ../../library/asyncio-protocol.rst:643 -msgid "" -"start -> connection_made\n" -" [-> get_buffer\n" -" [-> buffer_updated]?\n" -" ]*\n" -" [-> eof_received]?\n" -"-> connection_lost -> end" -msgstr "" - -#: ../../library/asyncio-protocol.rst:654 +#: ../../library/asyncio-protocol.rst:648 msgid "Datagram Protocols" msgstr "データグラムプロトコル" -#: ../../library/asyncio-protocol.rst:656 +#: ../../library/asyncio-protocol.rst:650 msgid "" "Datagram Protocol instances should be constructed by protocol factories " "passed to the :meth:`loop.create_datagram_endpoint` method." @@ -1154,7 +1119,7 @@ msgstr "" "データグラムプロトコルのインスタンスは :meth:`loop.create_datagram_endpoint` " "メソッドに渡されたプロトコルファクトリによって生成されるべきです。" -#: ../../library/asyncio-protocol.rst:661 +#: ../../library/asyncio-protocol.rst:655 msgid "" "Called when a datagram is received. *data* is a bytes object containing the " "incoming data. *addr* is the address of the peer sending the data; the " @@ -1164,7 +1129,7 @@ msgstr "" "ブジェクトです。*addr* はデータを送信するピアのアドレスです; 正確な形式はトラ" "ンスポートに依存します。" -#: ../../library/asyncio-protocol.rst:667 +#: ../../library/asyncio-protocol.rst:661 msgid "" "Called when a previous send or receive operation raises an :class:" "`OSError`. *exc* is the :class:`OSError` instance." @@ -1172,7 +1137,7 @@ msgstr "" "直前の送信あるいは受信が :class:`OSError` を送出したときに呼び出されます。" "*exc* は :class:`OSError` のインスタンスになります。" -#: ../../library/asyncio-protocol.rst:670 +#: ../../library/asyncio-protocol.rst:664 msgid "" "This method is called in rare conditions, when the transport (e.g. UDP) " "detects that a datagram could not be delivered to its recipient. In many " @@ -1183,7 +1148,7 @@ msgstr "" "どの場合、データグラムが配信できなければそのまま通知されることなく破棄されま" "す。" -#: ../../library/asyncio-protocol.rst:677 +#: ../../library/asyncio-protocol.rst:671 msgid "" "On BSD systems (macOS, FreeBSD, etc.) flow control is not supported for " "datagram protocols, because there is no reliable way to detect send failures " @@ -1193,7 +1158,7 @@ msgstr "" "れは非常に多くのパケットを書き込もうとしたことによる送信の失敗を検出する信頼" "できる方法が存在しないためです。" -#: ../../library/asyncio-protocol.rst:681 +#: ../../library/asyncio-protocol.rst:675 msgid "" "The socket always appears 'ready' and excess packets are dropped. An :class:" "`OSError` with ``errno`` set to :const:`errno.ENOBUFS` may or may not be " @@ -1206,11 +1171,11 @@ msgstr "" "`DatagramProtocol.error_received` に通知されますが、送出されない場合は単に無" "視されます。" -#: ../../library/asyncio-protocol.rst:690 +#: ../../library/asyncio-protocol.rst:684 msgid "Subprocess Protocols" msgstr "サブプロセスプロトコル" -#: ../../library/asyncio-protocol.rst:692 +#: ../../library/asyncio-protocol.rst:686 msgid "" "Subprocess Protocol instances should be constructed by protocol factories " "passed to the :meth:`loop.subprocess_exec` and :meth:`loop.subprocess_shell` " @@ -1220,53 +1185,44 @@ msgstr "" "meth:`loop.subprocess_shell` メソッドに渡されたプロトコルファクトリにより生成" "されるべきです。" -#: ../../library/asyncio-protocol.rst:698 +#: ../../library/asyncio-protocol.rst:692 msgid "" "Called when the child process writes data into its stdout or stderr pipe." msgstr "" "子プロセスが標準出力または標準エラー出力のパイプにデータを書き込んだ時に呼び" "出されます。" -#: ../../library/asyncio-protocol.rst:701 +#: ../../library/asyncio-protocol.rst:695 msgid "*fd* is the integer file descriptor of the pipe." msgstr "*fd* はパイプのファイル記述子を表す整数です。" -#: ../../library/asyncio-protocol.rst:703 +#: ../../library/asyncio-protocol.rst:697 msgid "*data* is a non-empty bytes object containing the received data." msgstr "*data* は受信データを含む空でないバイトオブジェクトです。" -#: ../../library/asyncio-protocol.rst:707 +#: ../../library/asyncio-protocol.rst:701 msgid "" "Called when one of the pipes communicating with the child process is closed." msgstr "" "子プロセスと通信するパイプのいずれかがクローズされたときに呼び出されます。" -#: ../../library/asyncio-protocol.rst:710 +#: ../../library/asyncio-protocol.rst:704 msgid "*fd* is the integer file descriptor that was closed." msgstr "*fd* はクローズされたファイル記述子を表す整数です。" -#: ../../library/asyncio-protocol.rst:714 +#: ../../library/asyncio-protocol.rst:708 msgid "Called when the child process has exited." msgstr "子プロセスが終了したときに呼び出されます。" -#: ../../library/asyncio-protocol.rst:716 -msgid "" -"It can be called before :meth:`~SubprocessProtocol.pipe_data_received` and :" -"meth:`~SubprocessProtocol.pipe_connection_lost` methods." -msgstr "" -"これは、 :meth:`~SubprocessProtocol.pipe_data_received` と :meth:" -"`~SubprocessProtocol.pipe_connection_lost` メソッドの前に呼び出すことができま" -"す。" - -#: ../../library/asyncio-protocol.rst:721 +#: ../../library/asyncio-protocol.rst:712 msgid "Examples" msgstr "使用例" -#: ../../library/asyncio-protocol.rst:726 +#: ../../library/asyncio-protocol.rst:717 msgid "TCP Echo Server" msgstr "TCP エコーサーバー" -#: ../../library/asyncio-protocol.rst:728 +#: ../../library/asyncio-protocol.rst:719 msgid "" "Create a TCP echo server using the :meth:`loop.create_server` method, send " "back received data, and close the connection::" @@ -1274,45 +1230,7 @@ msgstr "" ":meth:`loop.create_server` メソッドを使って TCP エコーサーバーを生成し、受信" "したデータをそのまま送り返して、最後にコネクションをクローズします::" -#: ../../library/asyncio-protocol.rst:731 -msgid "" -"import asyncio\n" -"\n" -"\n" -"class EchoServerProtocol(asyncio.Protocol):\n" -" def connection_made(self, transport):\n" -" peername = transport.get_extra_info('peername')\n" -" print('Connection from {}'.format(peername))\n" -" self.transport = transport\n" -"\n" -" def data_received(self, data):\n" -" message = data.decode()\n" -" print('Data received: {!r}'.format(message))\n" -"\n" -" print('Send: {!r}'.format(message))\n" -" self.transport.write(data)\n" -"\n" -" print('Close the client socket')\n" -" self.transport.close()\n" -"\n" -"\n" -"async def main():\n" -" # Get a reference to the event loop as we plan to use\n" -" # low-level APIs.\n" -" loop = asyncio.get_running_loop()\n" -"\n" -" server = await loop.create_server(\n" -" EchoServerProtocol,\n" -" '127.0.0.1', 8888)\n" -"\n" -" async with server:\n" -" await server.serve_forever()\n" -"\n" -"\n" -"asyncio.run(main())" -msgstr "" - -#: ../../library/asyncio-protocol.rst:769 +#: ../../library/asyncio-protocol.rst:760 msgid "" "The :ref:`TCP echo server using streams ` " "example uses the high-level :func:`asyncio.start_server` function." @@ -1320,11 +1238,11 @@ msgstr "" ":ref:`ストリームを使った TCP エコーサーバー ` の例では高水準の :func:`asyncio.start_server` 関数を使っています。" -#: ../../library/asyncio-protocol.rst:775 +#: ../../library/asyncio-protocol.rst:766 msgid "TCP Echo Client" msgstr "TCP エコークライアント" -#: ../../library/asyncio-protocol.rst:777 +#: ../../library/asyncio-protocol.rst:768 msgid "" "A TCP echo client using the :meth:`loop.create_connection` method, sends " "data, and waits until the connection is closed::" @@ -1332,52 +1250,7 @@ msgstr "" ":meth:`loop.create_connection` メソッドを使った TCP エコークライアントは、" "データを送信したあとコネクションがクローズされるまで待機します::" -#: ../../library/asyncio-protocol.rst:780 -msgid "" -"import asyncio\n" -"\n" -"\n" -"class EchoClientProtocol(asyncio.Protocol):\n" -" def __init__(self, message, on_con_lost):\n" -" self.message = message\n" -" self.on_con_lost = on_con_lost\n" -"\n" -" def connection_made(self, transport):\n" -" transport.write(self.message.encode())\n" -" print('Data sent: {!r}'.format(self.message))\n" -"\n" -" def data_received(self, data):\n" -" print('Data received: {!r}'.format(data.decode()))\n" -"\n" -" def connection_lost(self, exc):\n" -" print('The server closed the connection')\n" -" self.on_con_lost.set_result(True)\n" -"\n" -"\n" -"async def main():\n" -" # Get a reference to the event loop as we plan to use\n" -" # low-level APIs.\n" -" loop = asyncio.get_running_loop()\n" -"\n" -" on_con_lost = loop.create_future()\n" -" message = 'Hello World!'\n" -"\n" -" transport, protocol = await loop.create_connection(\n" -" lambda: EchoClientProtocol(message, on_con_lost),\n" -" '127.0.0.1', 8888)\n" -"\n" -" # Wait until the protocol signals that the connection\n" -" # is lost and close the transport.\n" -" try:\n" -" await on_con_lost\n" -" finally:\n" -" transport.close()\n" -"\n" -"\n" -"asyncio.run(main())" -msgstr "" - -#: ../../library/asyncio-protocol.rst:825 +#: ../../library/asyncio-protocol.rst:816 msgid "" "The :ref:`TCP echo client using streams ` " "example uses the high-level :func:`asyncio.open_connection` function." @@ -1386,11 +1259,11 @@ msgstr "" "streams>` の例では高水準の :func:`asyncio.open_connection` 関数を使っていま" "す。" -#: ../../library/asyncio-protocol.rst:832 +#: ../../library/asyncio-protocol.rst:823 msgid "UDP Echo Server" msgstr "UDP エコーサーバー" -#: ../../library/asyncio-protocol.rst:834 +#: ../../library/asyncio-protocol.rst:825 msgid "" "A UDP echo server, using the :meth:`loop.create_datagram_endpoint` method, " "sends back received data::" @@ -1398,49 +1271,11 @@ msgstr "" ":meth:`loop.create_datagram_endpoint` メソッドを使った UDP エコーサーバーは受" "信したデータをそのまま送り返します::" -#: ../../library/asyncio-protocol.rst:837 -msgid "" -"import asyncio\n" -"\n" -"\n" -"class EchoServerProtocol:\n" -" def connection_made(self, transport):\n" -" self.transport = transport\n" -"\n" -" def datagram_received(self, data, addr):\n" -" message = data.decode()\n" -" print('Received %r from %s' % (message, addr))\n" -" print('Send %r to %s' % (message, addr))\n" -" self.transport.sendto(data, addr)\n" -"\n" -"\n" -"async def main():\n" -" print(\"Starting UDP server\")\n" -"\n" -" # Get a reference to the event loop as we plan to use\n" -" # low-level APIs.\n" -" loop = asyncio.get_running_loop()\n" -"\n" -" # One protocol instance will be created to serve all\n" -" # client requests.\n" -" transport, protocol = await loop.create_datagram_endpoint(\n" -" EchoServerProtocol,\n" -" local_addr=('127.0.0.1', 9999))\n" -"\n" -" try:\n" -" await asyncio.sleep(3600) # Serve for 1 hour.\n" -" finally:\n" -" transport.close()\n" -"\n" -"\n" -"asyncio.run(main())" -msgstr "" - -#: ../../library/asyncio-protocol.rst:876 +#: ../../library/asyncio-protocol.rst:867 msgid "UDP Echo Client" msgstr "UDP エコークライアント" -#: ../../library/asyncio-protocol.rst:878 +#: ../../library/asyncio-protocol.rst:869 msgid "" "A UDP echo client, using the :meth:`loop.create_datagram_endpoint` method, " "sends data and closes the transport when it receives the answer::" @@ -1448,62 +1283,11 @@ msgstr "" ":meth:`loop.create_datagram_endpoint` メソッドを使った UDP エコークライアント" "はデータを送信し、応答を受信するとトランスポートをクローズします::" -#: ../../library/asyncio-protocol.rst:881 -msgid "" -"import asyncio\n" -"\n" -"\n" -"class EchoClientProtocol:\n" -" def __init__(self, message, on_con_lost):\n" -" self.message = message\n" -" self.on_con_lost = on_con_lost\n" -" self.transport = None\n" -"\n" -" def connection_made(self, transport):\n" -" self.transport = transport\n" -" print('Send:', self.message)\n" -" self.transport.sendto(self.message.encode())\n" -"\n" -" def datagram_received(self, data, addr):\n" -" print(\"Received:\", data.decode())\n" -"\n" -" print(\"Close the socket\")\n" -" self.transport.close()\n" -"\n" -" def error_received(self, exc):\n" -" print('Error received:', exc)\n" -"\n" -" def connection_lost(self, exc):\n" -" print(\"Connection closed\")\n" -" self.on_con_lost.set_result(True)\n" -"\n" -"\n" -"async def main():\n" -" # Get a reference to the event loop as we plan to use\n" -" # low-level APIs.\n" -" loop = asyncio.get_running_loop()\n" -"\n" -" on_con_lost = loop.create_future()\n" -" message = \"Hello World!\"\n" -"\n" -" transport, protocol = await loop.create_datagram_endpoint(\n" -" lambda: EchoClientProtocol(message, on_con_lost),\n" -" remote_addr=('127.0.0.1', 9999))\n" -"\n" -" try:\n" -" await on_con_lost\n" -" finally:\n" -" transport.close()\n" -"\n" -"\n" -"asyncio.run(main())" -msgstr "" - -#: ../../library/asyncio-protocol.rst:933 +#: ../../library/asyncio-protocol.rst:924 msgid "Connecting Existing Sockets" msgstr "既存のソケットへの接続" -#: ../../library/asyncio-protocol.rst:935 +#: ../../library/asyncio-protocol.rst:926 msgid "" "Wait until a socket receives data using the :meth:`loop.create_connection` " "method with a protocol::" @@ -1511,59 +1295,7 @@ msgstr "" "プロトコルを設定した :meth:`loop.create_connection` メソッドを使ってソケット" "がデータを受信するまで待機します::" -#: ../../library/asyncio-protocol.rst:938 -msgid "" -"import asyncio\n" -"import socket\n" -"\n" -"\n" -"class MyProtocol(asyncio.Protocol):\n" -"\n" -" def __init__(self, on_con_lost):\n" -" self.transport = None\n" -" self.on_con_lost = on_con_lost\n" -"\n" -" def connection_made(self, transport):\n" -" self.transport = transport\n" -"\n" -" def data_received(self, data):\n" -" print(\"Received:\", data.decode())\n" -"\n" -" # We are done: close the transport;\n" -" # connection_lost() will be called automatically.\n" -" self.transport.close()\n" -"\n" -" def connection_lost(self, exc):\n" -" # The socket has been closed\n" -" self.on_con_lost.set_result(True)\n" -"\n" -"\n" -"async def main():\n" -" # Get a reference to the event loop as we plan to use\n" -" # low-level APIs.\n" -" loop = asyncio.get_running_loop()\n" -" on_con_lost = loop.create_future()\n" -"\n" -" # Create a pair of connected sockets\n" -" rsock, wsock = socket.socketpair()\n" -"\n" -" # Register the socket to wait for data.\n" -" transport, protocol = await loop.create_connection(\n" -" lambda: MyProtocol(on_con_lost), sock=rsock)\n" -"\n" -" # Simulate the reception of data from the network.\n" -" loop.call_soon(wsock.send, 'abc'.encode())\n" -"\n" -" try:\n" -" await protocol.on_con_lost\n" -" finally:\n" -" transport.close()\n" -" wsock.close()\n" -"\n" -"asyncio.run(main())" -msgstr "" - -#: ../../library/asyncio-protocol.rst:989 +#: ../../library/asyncio-protocol.rst:980 msgid "" "The :ref:`watch a file descriptor for read events " "` example uses the low-level :meth:`loop." @@ -1573,7 +1305,7 @@ msgstr "" "例では低レベルの :meth:`loop.add_reader` メソッドを使ってファイル記述子 (FD) " "を登録しています。" -#: ../../library/asyncio-protocol.rst:993 +#: ../../library/asyncio-protocol.rst:984 msgid "" "The :ref:`register an open socket to wait for data using streams " "` example uses high-level streams " @@ -1583,11 +1315,11 @@ msgstr "" "` 例ではコルーチン内で :func:" "`open_connection` 関数によって生成されたストリームを使っています。" -#: ../../library/asyncio-protocol.rst:1000 +#: ../../library/asyncio-protocol.rst:991 msgid "loop.subprocess_exec() and SubprocessProtocol" msgstr "loop.subprocess_exec() と SubprocessProtocol" -#: ../../library/asyncio-protocol.rst:1002 +#: ../../library/asyncio-protocol.rst:993 msgid "" "An example of a subprocess protocol used to get the output of a subprocess " "and to wait for the subprocess exit." @@ -1595,73 +1327,12 @@ msgstr "" "サブプロセスからの出力を受け取り、サブプロセスが終了するまで待機するために使" "われるサブプロセスプロトコルの例です。" -#: ../../library/asyncio-protocol.rst:1005 +#: ../../library/asyncio-protocol.rst:996 msgid "The subprocess is created by the :meth:`loop.subprocess_exec` method::" msgstr "" "サブプロセスは :meth:`loop.subprocess_exec` メソッドにより生成されます::" -#: ../../library/asyncio-protocol.rst:1007 -msgid "" -"import asyncio\n" -"import sys\n" -"\n" -"class DateProtocol(asyncio.SubprocessProtocol):\n" -" def __init__(self, exit_future):\n" -" self.exit_future = exit_future\n" -" self.output = bytearray()\n" -" self.pipe_closed = False\n" -" self.exited = False\n" -"\n" -" def pipe_connection_lost(self, fd, exc):\n" -" self.pipe_closed = True\n" -" self.check_for_exit()\n" -"\n" -" def pipe_data_received(self, fd, data):\n" -" self.output.extend(data)\n" -"\n" -" def process_exited(self):\n" -" self.exited = True\n" -" # process_exited() method can be called before\n" -" # pipe_connection_lost() method: wait until both methods are\n" -" # called.\n" -" self.check_for_exit()\n" -"\n" -" def check_for_exit(self):\n" -" if self.pipe_closed and self.exited:\n" -" self.exit_future.set_result(True)\n" -"\n" -"async def get_date():\n" -" # Get a reference to the event loop as we plan to use\n" -" # low-level APIs.\n" -" loop = asyncio.get_running_loop()\n" -"\n" -" code = 'import datetime; print(datetime.datetime.now())'\n" -" exit_future = asyncio.Future(loop=loop)\n" -"\n" -" # Create the subprocess controlled by DateProtocol;\n" -" # redirect the standard output into a pipe.\n" -" transport, protocol = await loop.subprocess_exec(\n" -" lambda: DateProtocol(exit_future),\n" -" sys.executable, '-c', code,\n" -" stdin=None, stderr=None)\n" -"\n" -" # Wait for the subprocess exit using the process_exited()\n" -" # method of the protocol.\n" -" await exit_future\n" -"\n" -" # Close the stdout pipe.\n" -" transport.close()\n" -"\n" -" # Read the output which was collected by the\n" -" # pipe_data_received() method of the protocol.\n" -" data = bytes(protocol.output)\n" -" return data.decode('ascii').rstrip()\n" -"\n" -"date = asyncio.run(get_date())\n" -"print(f\"Current date: {date}\")" -msgstr "" - -#: ../../library/asyncio-protocol.rst:1065 +#: ../../library/asyncio-protocol.rst:1042 msgid "" "See also the :ref:`same example ` " "written using high-level APIs." diff --git a/library/asyncio-queue.po b/library/asyncio-queue.po index c26e0038b..84645a008 100644 --- a/library/asyncio-queue.po +++ b/library/asyncio-queue.po @@ -1,27 +1,30 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 -# Takeshi Nakazato, 2022 -# Arihiro TAKASE, 2023 +# Arihiro TAKASE, 2017 +# Osamu NAKAMURA, 2017 +# E. Kawashima, 2017 +# Masato HASHIMOTO , 2017 +# tomo, 2019 +# Naoki Nakamura , 2020 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-06 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:55+0000\n" -"Last-Translator: Arihiro TAKASE, 2023\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 17:49+0000\n" +"Last-Translator: Naoki Nakamura , 2020\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/asyncio-queue.rst:7 @@ -82,9 +85,9 @@ msgstr "" "キューのサイズは常に既知であり、 :meth:`qsize` メソッドを呼び出すことによって" "取得することができます。" -#: ../../library/asyncio-queue.rst:39 -msgid "Removed the *loop* parameter." -msgstr "*loop* パラメータが削除されました。" +#: ../../library/asyncio-queue.rst:42 +msgid "The *loop* parameter." +msgstr "*loop* パラメータ。" #: ../../library/asyncio-queue.rst:43 msgid "This class is :ref:`not thread safe `." @@ -106,10 +109,12 @@ msgstr "キューに要素が :attr:`maxsize` 個あれば ``True`` を返しま #: ../../library/asyncio-queue.rst:57 msgid "" "If the queue was initialized with ``maxsize=0`` (the default), then :meth:" -"`full` never returns ``True``." +"`full()` never returns ``True``." msgstr "" +"キューが ``maxsize=0`` (デフォルト値) で初期化された場合、 :meth:`full()` メ" +"ソッドが ``True`` を返すことはありません。" -#: ../../library/asyncio-queue.rst:63 +#: ../../library/asyncio-queue.rst:62 msgid "" "Remove and return an item from the queue. If queue is empty, wait until an " "item is available." @@ -117,24 +122,18 @@ msgstr "" "キューから要素を削除して返します。キューが空の場合項目が利用可能になるまで待" "機します。" -#: ../../library/asyncio-queue.rst:66 -msgid "" -"Raises :exc:`QueueShutDown` if the queue has been shut down and is empty, or " -"if the queue has been shut down immediately." -msgstr "" - -#: ../../library/asyncio-queue.rst:71 +#: ../../library/asyncio-queue.rst:67 msgid "" "Return an item if one is immediately available, else raise :exc:`QueueEmpty`." msgstr "" "直ちに利用できるアイテムがあるときはそれを、そうでなければ :exc:`QueueEmpty` " "を返します。" -#: ../../library/asyncio-queue.rst:77 +#: ../../library/asyncio-queue.rst:72 msgid "Block until all items in the queue have been received and processed." msgstr "キューにある全ての要素が取得され、処理されるまでブロックします。" -#: ../../library/asyncio-queue.rst:79 +#: ../../library/asyncio-queue.rst:74 msgid "" "The count of unfinished tasks goes up whenever an item is added to the " "queue. The count goes down whenever a consumer coroutine calls :meth:" @@ -147,7 +146,7 @@ msgstr "" "知するために :meth:`task_done` を呼び出すと減算されます。未完了のタスクのカウ" "ント値がゼロになると、 :meth:`join` のブロックは解除されます。" -#: ../../library/asyncio-queue.rst:88 +#: ../../library/asyncio-queue.rst:82 msgid "" "Put an item into the queue. If the queue is full, wait until a free slot is " "available before adding the item." @@ -155,55 +154,33 @@ msgstr "" "要素をキューに入力します。キューが満杯の場合、要素を追加する前に空きスロット" "が利用できるようになるまで待機します。" -#: ../../library/asyncio-queue.rst:91 -msgid "Raises :exc:`QueueShutDown` if the queue has been shut down." -msgstr "" - -#: ../../library/asyncio-queue.rst:95 +#: ../../library/asyncio-queue.rst:87 msgid "Put an item into the queue without blocking." msgstr "ブロックせずにアイテムをキューに追加します。" -#: ../../library/asyncio-queue.rst:97 +#: ../../library/asyncio-queue.rst:89 msgid "If no free slot is immediately available, raise :exc:`QueueFull`." msgstr "直ちに利用できるスロットがない場合、:exc:`QueueFull` を送出します。" -#: ../../library/asyncio-queue.rst:101 +#: ../../library/asyncio-queue.rst:93 msgid "Return the number of items in the queue." msgstr "キュー内の要素数を返します。" -#: ../../library/asyncio-queue.rst:105 -msgid "" -"Shut down the queue, making :meth:`~Queue.get` and :meth:`~Queue.put` raise :" -"exc:`QueueShutDown`." -msgstr "" - -#: ../../library/asyncio-queue.rst:108 -msgid "" -"By default, :meth:`~Queue.get` on a shut down queue will only raise once the " -"queue is empty. Set *immediate* to true to make :meth:`~Queue.get` raise " -"immediately instead." -msgstr "" - -#: ../../library/asyncio-queue.rst:112 -msgid "" -"All blocked callers of :meth:`~Queue.put` and :meth:`~Queue.get` will be " -"unblocked. If *immediate* is true, a task will be marked as done for each " -"remaining item in the queue, which may unblock callers of :meth:`~Queue." -"join`." -msgstr "" - -#: ../../library/asyncio-queue.rst:121 -msgid "Indicate that a formerly enqueued work item is complete." -msgstr "" +#: ../../library/asyncio-queue.rst:97 +msgid "Indicate that a formerly enqueued task is complete." +msgstr "キューに入っていたタスクが完了したことを示します。" -#: ../../library/asyncio-queue.rst:123 +#: ../../library/asyncio-queue.rst:99 msgid "" -"Used by queue consumers. For each :meth:`~Queue.get` used to fetch a work " -"item, a subsequent call to :meth:`task_done` tells the queue that the " -"processing on the work item is complete." +"Used by queue consumers. For each :meth:`~Queue.get` used to fetch a task, a " +"subsequent call to :meth:`task_done` tells the queue that the processing on " +"the task is complete." msgstr "" +"キューコンシューマーによって使用されます。タスクの取得に :meth:`~Queue.get` " +"を使用し、その後の :meth:`task_done` の呼び出しでタスクの処理が完了したことを" +"キューに通知します。" -#: ../../library/asyncio-queue.rst:127 +#: ../../library/asyncio-queue.rst:103 msgid "" "If a :meth:`join` is currently blocking, it will resume when all items have " "been processed (meaning that a :meth:`task_done` call was received for every " @@ -213,13 +190,7 @@ msgstr "" "`~Queue.put` でキューに追加された全アイテムの :meth:`task_done` の呼び出しを" "受信したとき) に再開します。" -#: ../../library/asyncio-queue.rst:132 -msgid "" -"``shutdown(immediate=True)`` calls :meth:`task_done` for each remaining item " -"in the queue." -msgstr "" - -#: ../../library/asyncio-queue.rst:135 +#: ../../library/asyncio-queue.rst:108 msgid "" "Raises :exc:`ValueError` if called more times than there were items placed " "in the queue." @@ -227,11 +198,11 @@ msgstr "" "キューに追加されているアイテム数以上の呼び出しが行われたときに :exc:" "`ValueError` を送出します。" -#: ../../library/asyncio-queue.rst:140 +#: ../../library/asyncio-queue.rst:113 msgid "Priority Queue" msgstr "優先度付きのキュー" -#: ../../library/asyncio-queue.rst:144 +#: ../../library/asyncio-queue.rst:117 msgid "" "A variant of :class:`Queue`; retrieves entries in priority order (lowest " "first)." @@ -239,15 +210,15 @@ msgstr "" ":class:`Queue` の変種です; 優先順位にしたがって要素を取り出します (最低順位が" "最初に取り出されます)。" -#: ../../library/asyncio-queue.rst:147 +#: ../../library/asyncio-queue.rst:120 msgid "Entries are typically tuples of the form ``(priority_number, data)``." msgstr "項目は典型的には ``(priority_number, data)`` 形式のタプルです。" -#: ../../library/asyncio-queue.rst:152 +#: ../../library/asyncio-queue.rst:125 msgid "LIFO Queue" msgstr "LIFO キュー" -#: ../../library/asyncio-queue.rst:156 +#: ../../library/asyncio-queue.rst:129 msgid "" "A variant of :class:`Queue` that retrieves most recently added entries first " "(last in, first out)." @@ -255,11 +226,11 @@ msgstr "" ":class:`Queue` の変種で、最後に追加された項目を最初に取り出します (後入れ先出" "し、またはスタック)。" -#: ../../library/asyncio-queue.rst:161 +#: ../../library/asyncio-queue.rst:134 msgid "Exceptions" msgstr "例外" -#: ../../library/asyncio-queue.rst:165 +#: ../../library/asyncio-queue.rst:138 msgid "" "This exception is raised when the :meth:`~Queue.get_nowait` method is called " "on an empty queue." @@ -267,7 +238,7 @@ msgstr "" "この例外は :meth:`~Queue.get_nowait` メソッドが空のキューに対して呼ばれたとき" "に送出されます。" -#: ../../library/asyncio-queue.rst:171 +#: ../../library/asyncio-queue.rst:144 msgid "" "Exception raised when the :meth:`~Queue.put_nowait` method is called on a " "queue that has reached its *maxsize*." @@ -275,76 +246,13 @@ msgstr "" "サイズが *maxsize* に達したキューに対して :meth:`~Queue.put_nowait` メソッド" "が 呼ばれたときに送出される例外です。" -#: ../../library/asyncio-queue.rst:177 -msgid "" -"Exception raised when :meth:`~Queue.put` or :meth:`~Queue.get` is called on " -"a queue which has been shut down." -msgstr "" - -#: ../../library/asyncio-queue.rst:184 +#: ../../library/asyncio-queue.rst:149 msgid "Examples" msgstr "使用例" -#: ../../library/asyncio-queue.rst:188 +#: ../../library/asyncio-queue.rst:153 msgid "" "Queues can be used to distribute workload between several concurrent tasks::" msgstr "" "キューを使って、並行処理を行う複数のタスクにワークロードを分散させることがで" "きます::" - -#: ../../library/asyncio-queue.rst:191 -msgid "" -"import asyncio\n" -"import random\n" -"import time\n" -"\n" -"\n" -"async def worker(name, queue):\n" -" while True:\n" -" # Get a \"work item\" out of the queue.\n" -" sleep_for = await queue.get()\n" -"\n" -" # Sleep for the \"sleep_for\" seconds.\n" -" await asyncio.sleep(sleep_for)\n" -"\n" -" # Notify the queue that the \"work item\" has been processed.\n" -" queue.task_done()\n" -"\n" -" print(f'{name} has slept for {sleep_for:.2f} seconds')\n" -"\n" -"\n" -"async def main():\n" -" # Create a queue that we will use to store our \"workload\".\n" -" queue = asyncio.Queue()\n" -"\n" -" # Generate random timings and put them into the queue.\n" -" total_sleep_time = 0\n" -" for _ in range(20):\n" -" sleep_for = random.uniform(0.05, 1.0)\n" -" total_sleep_time += sleep_for\n" -" queue.put_nowait(sleep_for)\n" -"\n" -" # Create three worker tasks to process the queue concurrently.\n" -" tasks = []\n" -" for i in range(3):\n" -" task = asyncio.create_task(worker(f'worker-{i}', queue))\n" -" tasks.append(task)\n" -"\n" -" # Wait until the queue is fully processed.\n" -" started_at = time.monotonic()\n" -" await queue.join()\n" -" total_slept_for = time.monotonic() - started_at\n" -"\n" -" # Cancel our worker tasks.\n" -" for task in tasks:\n" -" task.cancel()\n" -" # Wait until all worker tasks are cancelled.\n" -" await asyncio.gather(*tasks, return_exceptions=True)\n" -"\n" -" print('====')\n" -" print(f'3 workers slept in parallel for {total_slept_for:.2f} seconds')\n" -" print(f'total expected sleep time: {total_sleep_time:.2f} seconds')\n" -"\n" -"\n" -"asyncio.run(main())" -msgstr "" diff --git a/library/asyncio-runner.po b/library/asyncio-runner.po deleted file mode 100644 index 0a77f0dc3..000000000 --- a/library/asyncio-runner.po +++ /dev/null @@ -1,278 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation -# This file is distributed under the same license as the Python package. -# FIRST AUTHOR , YEAR. -# -# Translators: -# Takeshi Nakazato, 2022 -# tomo, 2022 -# 菊池 健志, 2023 -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: Python 3.14\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2022-11-05 19:48+0000\n" -"Last-Translator: 菊池 健志, 2023\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" -"ja/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#: ../../library/asyncio-runner.rst:6 -msgid "Runners" -msgstr "" - -#: ../../library/asyncio-runner.rst:8 -msgid "**Source code:** :source:`Lib/asyncio/runners.py`" -msgstr "" - -#: ../../library/asyncio-runner.rst:11 -msgid "" -"This section outlines high-level asyncio primitives to run asyncio code." -msgstr "" -"この節では、asyncio のコードを実行するための高レベルの asyncio のプリミティブ" -"の概略を解説します。" - -#: ../../library/asyncio-runner.rst:13 -msgid "" -"They are built on top of an :ref:`event loop ` with the " -"aim to simplify async code usage for common wide-spread scenarios." -msgstr "" -"これらは :ref:`イベントループ ` の上に構築されており、一" -"般的な広く普及しているシナリオでの非同期コードの使用を簡素化することを目的と" -"しています。" - -#: ../../library/asyncio-runner.rst:23 -msgid "Running an asyncio Program" -msgstr "非同期プログラムの実行" - -#: ../../library/asyncio-runner.rst:27 -msgid "Execute *coro* in an asyncio event loop and return the result." -msgstr "" - -#: ../../library/asyncio-runner.rst:29 ../../library/asyncio-runner.rst:121 -msgid "The argument can be any awaitable object." -msgstr "" - -#: ../../library/asyncio-runner.rst:31 -msgid "" -"This function runs the awaitable, taking care of managing the asyncio event " -"loop, *finalizing asynchronous generators*, and closing the executor." -msgstr "" - -#: ../../library/asyncio-runner.rst:35 ../../library/asyncio-runner.rst:131 -msgid "" -"This function cannot be called when another asyncio event loop is running in " -"the same thread." -msgstr "" -"この関数は、同じスレッドで他の非同期イベントループが実行中のときは呼び出せま" -"せん。" - -#: ../../library/asyncio-runner.rst:38 ../../library/asyncio-runner.rst:97 -msgid "" -"If *debug* is ``True``, the event loop will be run in debug mode. ``False`` " -"disables debug mode explicitly. ``None`` is used to respect the global :ref:" -"`asyncio-debug-mode` settings." -msgstr "" -"*debug* が ``True`` の場合、イベントループはデバッグモードで実行されます。" -"``False`` は明示的にデバッグモードを無効化します。 グローバルな :ref:" -"`asyncio-debug-mode` 設定を尊重するために ``None`` が使用されます。" - -#: ../../library/asyncio-runner.rst:42 -msgid "" -"If *loop_factory* is not ``None``, it is used to create a new event loop; " -"otherwise :func:`asyncio.new_event_loop` is used. The loop is closed at the " -"end. This function should be used as a main entry point for asyncio " -"programs, and should ideally only be called once. It is recommended to use " -"*loop_factory* to configure the event loop instead of policies. Passing :" -"class:`asyncio.EventLoop` allows running asyncio without the policy system." -msgstr "" - -#: ../../library/asyncio-runner.rst:50 -msgid "" -"The executor is given a timeout duration of 5 minutes to shutdown. If the " -"executor hasn't finished within that duration, a warning is emitted and the " -"executor is closed." -msgstr "" - -#: ../../library/asyncio-runner.rst:54 -msgid "Example::" -msgstr "以下はプログラム例です::" - -#: ../../library/asyncio-runner.rst:56 -msgid "" -"async def main():\n" -" await asyncio.sleep(1)\n" -" print('hello')\n" -"\n" -"asyncio.run(main())" -msgstr "" - -#: ../../library/asyncio-runner.rst:64 -msgid "Updated to use :meth:`loop.shutdown_default_executor`." -msgstr "" -":meth:`loop.shutdown_default_executor` メソッドを使うように更新されました。" - -#: ../../library/asyncio-runner.rst:69 -msgid "" -"*debug* is ``None`` by default to respect the global debug mode settings." -msgstr "" -"*debug* はグローバルなデバッグモード設定を尊重するためにデフォルトで " -"``None`` です。" - -#: ../../library/asyncio-runner.rst:73 -msgid "Added *loop_factory* parameter." -msgstr "" - -#: ../../library/asyncio-runner.rst:77 ../../library/asyncio-runner.rst:136 -msgid "*coro* can be any awaitable object." -msgstr "" - -#: ../../library/asyncio-runner.rst:81 -msgid "" -"The :mod:`!asyncio` policy system is deprecated and will be removed in " -"Python 3.16; from there on, an explicit *loop_factory* is needed to " -"configure the event loop." -msgstr "" - -#: ../../library/asyncio-runner.rst:87 -msgid "Runner context manager" -msgstr "" - -#: ../../library/asyncio-runner.rst:91 -msgid "" -"A context manager that simplifies *multiple* async function calls in the " -"same context." -msgstr "" -"同じコンテキスト上での *複数* の非同期関数呼び出しをシンプルにするコンテキス" -"トマネージャ。" - -#: ../../library/asyncio-runner.rst:94 -msgid "" -"Sometimes several top-level async functions should be called in the same :" -"ref:`event loop ` and :class:`contextvars.Context`." -msgstr "" - -#: ../../library/asyncio-runner.rst:101 -msgid "" -"*loop_factory* could be used for overriding the loop creation. It is the " -"responsibility of the *loop_factory* to set the created loop as the current " -"one. By default :func:`asyncio.new_event_loop` is used and set as current " -"event loop with :func:`asyncio.set_event_loop` if *loop_factory* is ``None``." -msgstr "" - -#: ../../library/asyncio-runner.rst:106 -msgid "" -"Basically, :func:`asyncio.run` example can be rewritten with the runner " -"usage::" -msgstr "" - -#: ../../library/asyncio-runner.rst:108 -msgid "" -"async def main():\n" -" await asyncio.sleep(1)\n" -" print('hello')\n" -"\n" -"with asyncio.Runner() as runner:\n" -" runner.run(main())" -msgstr "" - -#: ../../library/asyncio-runner.rst:119 -msgid "Execute *coro* in the embedded event loop." -msgstr "" - -#: ../../library/asyncio-runner.rst:123 -msgid "If the argument is a coroutine, it is wrapped in a Task." -msgstr "" - -#: ../../library/asyncio-runner.rst:125 -msgid "" -"An optional keyword-only *context* argument allows specifying a custom :" -"class:`contextvars.Context` for the code to run in. The runner's default " -"context is used if context is ``None``." -msgstr "" - -#: ../../library/asyncio-runner.rst:129 -msgid "Returns the awaitable's result or raises an exception." -msgstr "" - -#: ../../library/asyncio-runner.rst:140 -msgid "Close the runner." -msgstr "" - -#: ../../library/asyncio-runner.rst:142 -msgid "" -"Finalize asynchronous generators, shutdown default executor, close the event " -"loop and release embedded :class:`contextvars.Context`." -msgstr "" - -#: ../../library/asyncio-runner.rst:147 -msgid "Return the event loop associated with the runner instance." -msgstr "" - -#: ../../library/asyncio-runner.rst:151 -msgid "" -":class:`Runner` uses the lazy initialization strategy, its constructor " -"doesn't initialize underlying low-level structures." -msgstr "" - -#: ../../library/asyncio-runner.rst:154 -msgid "" -"Embedded *loop* and *context* are created at the :keyword:`with` body " -"entering or the first call of :meth:`run` or :meth:`get_loop`." -msgstr "" - -#: ../../library/asyncio-runner.rst:159 -msgid "Handling Keyboard Interruption" -msgstr "" - -#: ../../library/asyncio-runner.rst:163 -msgid "" -"When :const:`signal.SIGINT` is raised by :kbd:`Ctrl-C`, :exc:" -"`KeyboardInterrupt` exception is raised in the main thread by default. " -"However this doesn't work with :mod:`asyncio` because it can interrupt " -"asyncio internals and can hang the program from exiting." -msgstr "" - -#: ../../library/asyncio-runner.rst:168 -msgid "" -"To mitigate this issue, :mod:`asyncio` handles :const:`signal.SIGINT` as " -"follows:" -msgstr "" - -#: ../../library/asyncio-runner.rst:170 -msgid "" -":meth:`asyncio.Runner.run` installs a custom :const:`signal.SIGINT` handler " -"before any user code is executed and removes it when exiting from the " -"function." -msgstr "" - -#: ../../library/asyncio-runner.rst:172 -msgid "" -"The :class:`~asyncio.Runner` creates the main task for the passed coroutine " -"for its execution." -msgstr "" - -#: ../../library/asyncio-runner.rst:174 -msgid "" -"When :const:`signal.SIGINT` is raised by :kbd:`Ctrl-C`, the custom signal " -"handler cancels the main task by calling :meth:`asyncio.Task.cancel` which " -"raises :exc:`asyncio.CancelledError` inside the main task. This causes the " -"Python stack to unwind, ``try/except`` and ``try/finally`` blocks can be " -"used for resource cleanup. After the main task is cancelled, :meth:`asyncio." -"Runner.run` raises :exc:`KeyboardInterrupt`." -msgstr "" - -#: ../../library/asyncio-runner.rst:180 -msgid "" -"A user could write a tight loop which cannot be interrupted by :meth:" -"`asyncio.Task.cancel`, in which case the second following :kbd:`Ctrl-C` " -"immediately raises the :exc:`KeyboardInterrupt` without cancelling the main " -"task." -msgstr "" diff --git a/library/asyncio-stream.po b/library/asyncio-stream.po index 60bdcca02..8aaad74a5 100644 --- a/library/asyncio-stream.po +++ b/library/asyncio-stream.po @@ -1,28 +1,29 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Takeshi Nakazato, 2022 -# Arihiro TAKASE, 2023 -# tomo, 2023 -# Rafael Fontenelle , 2024 +# Yusuke Miyazaki , 2017 +# Masato HASHIMOTO , 2017 +# E. Kawashima, 2017 +# Shun Sakurai, 2017 +# tomo, 2019 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-30 14:22+0000\n" -"PO-Revision-Date: 2021-06-28 00:55+0000\n" -"Last-Translator: Rafael Fontenelle , 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 17:49+0000\n" +"Last-Translator: tomo, 2019\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/asyncio-stream.rst:7 @@ -48,28 +49,6 @@ msgid "Here is an example of a TCP echo client written using asyncio streams::" msgstr "" "以下は asyncio ストリームを使って書いた TCP エコークライアントの例です::" -#: ../../library/asyncio-stream.rst:22 ../../library/asyncio-stream.rst:437 -msgid "" -"import asyncio\n" -"\n" -"async def tcp_echo_client(message):\n" -" reader, writer = await asyncio.open_connection(\n" -" '127.0.0.1', 8888)\n" -"\n" -" print(f'Send: {message!r}')\n" -" writer.write(message.encode())\n" -" await writer.drain()\n" -"\n" -" data = await reader.read(100)\n" -" print(f'Received: {data.decode()!r}')\n" -"\n" -" print('Close the connection')\n" -" writer.close()\n" -" await writer.wait_closed()\n" -"\n" -"asyncio.run(tcp_echo_client('Hello World!'))" -msgstr "" - #: ../../library/asyncio-stream.rst:42 msgid "See also the `Examples`_ section below." msgstr "下記の `使用例`_ 節も参照してください。" @@ -86,7 +65,7 @@ msgstr "" "以下の asyncio のトップレベル関数はストリームの作成や操作を行うことができま" "す:" -#: ../../library/asyncio-stream.rst:59 +#: ../../library/asyncio-stream.rst:56 msgid "" "Establish a network connection and return a pair of ``(reader, writer)`` " "objects." @@ -94,7 +73,7 @@ msgstr "" "ネットワークコネクションを確立し、 ``(reader, writer)`` のオブジェクトのペア" "を返します。" -#: ../../library/asyncio-stream.rst:62 +#: ../../library/asyncio-stream.rst:59 msgid "" "The returned *reader* and *writer* objects are instances of :class:" "`StreamReader` and :class:`StreamWriter` classes." @@ -102,7 +81,13 @@ msgstr "" "戻り値の *reader* と *writer* はそれぞれ :class:`StreamReader` と :class:" "`StreamWriter` クラスのインスタンスです。" -#: ../../library/asyncio-stream.rst:65 ../../library/asyncio-stream.rst:112 +#: ../../library/asyncio-stream.rst:62 +msgid "" +"The *loop* argument is optional and can always be determined automatically " +"when this function is awaited from a coroutine." +msgstr "" + +#: ../../library/asyncio-stream.rst:65 ../../library/asyncio-stream.rst:98 msgid "" "*limit* determines the buffer size limit used by the returned :class:" "`StreamReader` instance. By default the *limit* is set to 64 KiB." @@ -116,37 +101,15 @@ msgid "" "create_connection`." msgstr "残りの引数は直接 :meth:`loop.create_connection` に渡されます。" -#: ../../library/asyncio-stream.rst:74 ../../library/asyncio-stream.rst:154 -msgid "" -"The *sock* argument transfers ownership of the socket to the :class:" -"`StreamWriter` created. To close the socket, call its :meth:`~asyncio." -"StreamWriter.close` method." +#: ../../library/asyncio-stream.rst:74 ../../library/asyncio-stream.rst:127 +msgid "The *ssl_handshake_timeout* parameter." msgstr "" -#: ../../library/asyncio-stream.rst:78 -msgid "Added the *ssl_handshake_timeout* parameter." -msgstr "" - -#: ../../library/asyncio-stream.rst:81 -msgid "Added the *happy_eyeballs_delay* and *interleave* parameters." -msgstr "*happy_eyeballs_delay* と *interleave* が追加されました。" - -#: ../../library/asyncio-stream.rst:84 ../../library/asyncio-stream.rst:128 -#: ../../library/asyncio-stream.rst:164 ../../library/asyncio-stream.rst:199 -msgid "Removed the *loop* parameter." -msgstr "*loop* パラメータが削除されました。" - -#: ../../library/asyncio-stream.rst:87 ../../library/asyncio-stream.rst:131 -#: ../../library/asyncio-stream.rst:167 ../../library/asyncio-stream.rst:202 -#: ../../library/asyncio-stream.rst:404 -msgid "Added the *ssl_shutdown_timeout* parameter." -msgstr "*ssl_shutdown_timeout* パラメータが追加されました。" - -#: ../../library/asyncio-stream.rst:101 +#: ../../library/asyncio-stream.rst:84 msgid "Start a socket server." msgstr "ソケットサーバーを起動します。" -#: ../../library/asyncio-stream.rst:103 +#: ../../library/asyncio-stream.rst:86 msgid "" "The *client_connected_cb* callback is called whenever a new client " "connection is established. It receives a ``(reader, writer)`` pair as two " @@ -158,7 +121,7 @@ msgstr "" "`StreamWriter` クラスのインスタンスのペア ``(reader, writer)`` を2つの引数と" "して受け取ります。" -#: ../../library/asyncio-stream.rst:108 +#: ../../library/asyncio-stream.rst:91 msgid "" "*client_connected_cb* can be a plain callable or a :ref:`coroutine function " "`; if it is a coroutine function, it will be automatically " @@ -168,98 +131,79 @@ msgstr "" "ルーチン関数 ` を指定します; コルーチン関数が指定された場合、コー" "ルバックの呼び出しは自動的に :class:`Task` としてスケジュールされます。" -#: ../../library/asyncio-stream.rst:116 +#: ../../library/asyncio-stream.rst:95 msgid "" -"The rest of the arguments are passed directly to :meth:`loop.create_server`." -msgstr "残りの引数は直接 :meth:`loop.create_server` に渡されます。" - -#: ../../library/asyncio-stream.rst:121 ../../library/asyncio-stream.rst:189 -msgid "" -"The *sock* argument transfers ownership of the socket to the server created. " -"To close the socket, call the server's :meth:`~asyncio.Server.close` method." +"The *loop* argument is optional and can always be determined automatically " +"when this method is awaited from a coroutine." msgstr "" -#: ../../library/asyncio-stream.rst:125 -msgid "Added the *ssl_handshake_timeout* and *start_serving* parameters." -msgstr "" -"*ssl_handshake_timeout* と *start_serving* パラメータが追加されました。" +#: ../../library/asyncio-stream.rst:102 +msgid "" +"The rest of the arguments are passed directly to :meth:`loop.create_server`." +msgstr "残りの引数は直接 :meth:`loop.create_server` に渡されます。" -#: ../../library/asyncio-stream.rst:134 -msgid "Added the *keep_alive* parameter." +#: ../../library/asyncio-stream.rst:107 ../../library/asyncio-stream.rst:149 +msgid "The *ssl_handshake_timeout* and *start_serving* parameters." msgstr "" -#: ../../library/asyncio-stream.rst:139 +#: ../../library/asyncio-stream.rst:111 msgid "Unix Sockets" msgstr "Unix ソケット" -#: ../../library/asyncio-stream.rst:145 +#: ../../library/asyncio-stream.rst:116 msgid "" "Establish a Unix socket connection and return a pair of ``(reader, writer)``." msgstr "" "Unix ソケットコネクションを確立し、 ``(reader, writer)`` のオブジェクトのペア" "を返します。" -#: ../../library/asyncio-stream.rst:148 +#: ../../library/asyncio-stream.rst:119 msgid "Similar to :func:`open_connection` but operates on Unix sockets." msgstr "" "この関数は :func:`open_connection` と似ていますが Unix ソケットに対して動作し" "ます。" -#: ../../library/asyncio-stream.rst:150 +#: ../../library/asyncio-stream.rst:121 msgid "See also the documentation of :meth:`loop.create_unix_connection`." msgstr ":meth:`loop.create_unix_connection` のドキュメントも参照してください。" -#: ../../library/asyncio-stream.rst:158 ../../library/asyncio-stream.rst:193 -msgid "Availability" -msgstr "" +#: ../../library/asyncio-stream.rst:124 ../../library/asyncio-stream.rst:146 +msgid ":ref:`Availability `: Unix." +msgstr ":ref:`利用可能な環境 `: Unix。" -#: ../../library/asyncio-stream.rst:160 -msgid "" -"Added the *ssl_handshake_timeout* parameter. The *path* parameter can now be " -"a :term:`path-like object`" +#: ../../library/asyncio-stream.rst:131 +msgid "The *path* parameter can now be a :term:`path-like object`" msgstr "" -#: ../../library/asyncio-stream.rst:177 +#: ../../library/asyncio-stream.rst:139 msgid "Start a Unix socket server." msgstr "Unix のソケットサーバーを起動します。" -#: ../../library/asyncio-stream.rst:179 +#: ../../library/asyncio-stream.rst:141 msgid "Similar to :func:`start_server` but works with Unix sockets." msgstr ":func:`start_server` と似ていますが Unix ソケットに対して動作します。" -#: ../../library/asyncio-stream.rst:181 -msgid "" -"If *cleanup_socket* is true then the Unix socket will automatically be " -"removed from the filesystem when the server is closed, unless the socket has " -"been replaced after the server has been created." -msgstr "" - -#: ../../library/asyncio-stream.rst:185 +#: ../../library/asyncio-stream.rst:143 msgid "See also the documentation of :meth:`loop.create_unix_server`." msgstr ":meth:`loop.create_unix_server` のドキュメントも参照してください。" -#: ../../library/asyncio-stream.rst:195 -msgid "" -"Added the *ssl_handshake_timeout* and *start_serving* parameters. The *path* " -"parameter can now be a :term:`path-like object`." -msgstr "" - -#: ../../library/asyncio-stream.rst:205 -msgid "Added the *cleanup_socket* parameter." +#: ../../library/asyncio-stream.rst:153 +msgid "The *path* parameter can now be a :term:`path-like object`." msgstr "" -#: ../../library/asyncio-stream.rst:210 +#: ../../library/asyncio-stream.rst:157 msgid "StreamReader" msgstr "StreamReader" -#: ../../library/asyncio-stream.rst:214 +#: ../../library/asyncio-stream.rst:161 msgid "" "Represents a reader object that provides APIs to read data from the IO " -"stream. As an :term:`asynchronous iterable`, the object supports the :" -"keyword:`async for` statement." +"stream." msgstr "" +"IO ストリームからデータを読み出すための API を提供するリーダーオブジェクトを" +"表します。" -#: ../../library/asyncio-stream.rst:218 +#: ../../library/asyncio-stream.rst:164 msgid "" "It is not recommended to instantiate *StreamReader* objects directly; use :" "func:`open_connection` and :func:`start_server` instead." @@ -267,45 +211,29 @@ msgstr "" "*StreamReader* オブジェクトを直接インスタンス化することは推奨されません; 代わ" "りに :func:`open_connection` や :func:`start_server` を使ってください。" -#: ../../library/asyncio-stream.rst:224 -msgid "Acknowledge the EOF." -msgstr "EOF の肯定応答を行います。" - -#: ../../library/asyncio-stream.rst:229 -msgid "Read up to *n* bytes from the stream." -msgstr "ストリームから最大 *n* バイト読み込みます。" - -#: ../../library/asyncio-stream.rst:231 +#: ../../library/asyncio-stream.rst:170 msgid "" -"If *n* is not provided or set to ``-1``, read until EOF, then return all " -"read :class:`bytes`. If EOF was received and the internal buffer is empty, " -"return an empty ``bytes`` object." +"Read up to *n* bytes. If *n* is not provided, or set to ``-1``, read until " +"EOF and return all read bytes." msgstr "" -"*n* が指定されないか ``-1`` が指定されていた場合 EOF になるまで読み込み、読み" -"込まれた全ての :class:`bytes` を返します。EOF を受信し、かつ内部バッファーが" -"空の場合、空の ``bytes`` オブジェクトを返します。" +"*n* バイト読み込みます。*n* が指定されないか ``-1`` が指定されていた場合 EOF " +"になるまで読み込み、全データを返します。" -#: ../../library/asyncio-stream.rst:236 -msgid "If *n* is ``0``, return an empty ``bytes`` object immediately." -msgstr "*n* が ``0`` なら、ただちに空の ``bytes`` オブジェクトを返します。" - -#: ../../library/asyncio-stream.rst:238 +#: ../../library/asyncio-stream.rst:173 msgid "" -"If *n* is positive, return at most *n* available ``bytes`` as soon as at " -"least 1 byte is available in the internal buffer. If EOF is received before " -"any byte is read, return an empty ``bytes`` object." +"If EOF was received and the internal buffer is empty, return an empty " +"``bytes`` object." msgstr "" -"*n* が正なら、内部バッファで最低でも 1 バイトが利用可能になり次第、利用可能な" -"最大 *n* ``bytes`` を返します。1 バイトも読み込まないうちに EOF を受信したな" -"ら、空の ``bytes`` オブジェクトを返します。" +"EOF を受信し、かつ内部バッファーが空の場合、空の ``bytes`` オブジェクトを返し" +"ます。" -#: ../../library/asyncio-stream.rst:246 +#: ../../library/asyncio-stream.rst:178 msgid "" "Read one line, where \"line\" is a sequence of bytes ending with ``\\n``." msgstr "" "1 行読み込みます。 \"行\" とは、``\\n`` で終了するバイト列のシーケンスです。" -#: ../../library/asyncio-stream.rst:249 +#: ../../library/asyncio-stream.rst:181 msgid "" "If EOF is received and ``\\n`` was not found, the method returns partially " "read data." @@ -313,7 +241,7 @@ msgstr "" "EOF を受信し、かつ ``\\n`` が見つからない場合、このメソッドは部分的に読み込ん" "だデータを返します。" -#: ../../library/asyncio-stream.rst:252 +#: ../../library/asyncio-stream.rst:184 msgid "" "If EOF is received and the internal buffer is empty, return an empty " "``bytes`` object." @@ -321,11 +249,11 @@ msgstr "" "EOF を受信し、かつ内部バッファーが空の場合、空の ``bytes`` オブジェクトを返し" "ます。" -#: ../../library/asyncio-stream.rst:258 +#: ../../library/asyncio-stream.rst:189 msgid "Read exactly *n* bytes." msgstr "厳密に *n* バイトのデータを読み出します。" -#: ../../library/asyncio-stream.rst:260 +#: ../../library/asyncio-stream.rst:191 msgid "" "Raise an :exc:`IncompleteReadError` if EOF is reached before *n* can be " "read. Use the :attr:`IncompleteReadError.partial` attribute to get the " @@ -335,11 +263,11 @@ msgstr "" "ます。部分的に読み出したデータを取得するには :attr:`IncompleteReadError." "partial` 属性を使ってください。" -#: ../../library/asyncio-stream.rst:267 +#: ../../library/asyncio-stream.rst:197 msgid "Read data from the stream until *separator* is found." msgstr "*separator* が見つかるまでストリームからデータを読み出します。" -#: ../../library/asyncio-stream.rst:269 +#: ../../library/asyncio-stream.rst:199 msgid "" "On success, the data and separator will be removed from the internal buffer " "(consumed). Returned data will include the separator at the end." @@ -347,7 +275,7 @@ msgstr "" "成功時には、データと区切り文字は内部バッファから削除されます (消費されます)。" "返されるデータの最後には区切り文字が含まれます。" -#: ../../library/asyncio-stream.rst:273 +#: ../../library/asyncio-stream.rst:203 msgid "" "If the amount of data read exceeds the configured stream limit, a :exc:" "`LimitOverrunError` exception is raised, and the data is left in the " @@ -357,7 +285,7 @@ msgstr "" "`LimitOverrunError` 例外が送出されます。このときデータは内部バッファーに残さ" "れ、再度読み出すことができます。" -#: ../../library/asyncio-stream.rst:277 +#: ../../library/asyncio-stream.rst:207 msgid "" "If EOF is reached before the complete separator is found, an :exc:" "`IncompleteReadError` exception is raised, and the internal buffer is " @@ -368,35 +296,23 @@ msgstr "" "外が送出され、内部バッファーがリセットされます。このとき :attr:" "`IncompleteReadError.partial` 属性は区切り文字の一部を含むかもしれません。" -#: ../../library/asyncio-stream.rst:282 -msgid "" -"The *separator* may also be a tuple of separators. In this case the return " -"value will be the shortest possible that has any separator as the suffix. " -"For the purposes of :exc:`LimitOverrunError`, the shortest possible " -"separator is considered to be the one that matched." -msgstr "" - -#: ../../library/asyncio-stream.rst:292 -msgid "The *separator* parameter may now be a :class:`tuple` of separators." -msgstr "" - -#: ../../library/asyncio-stream.rst:297 +#: ../../library/asyncio-stream.rst:216 msgid "Return ``True`` if the buffer is empty and :meth:`feed_eof` was called." msgstr "" "バッファーが空で :meth:`feed_eof` が呼ばれていた場合 ``True`` を返します。" -#: ../../library/asyncio-stream.rst:302 +#: ../../library/asyncio-stream.rst:221 msgid "StreamWriter" msgstr "StreamWriter" -#: ../../library/asyncio-stream.rst:306 +#: ../../library/asyncio-stream.rst:225 msgid "" "Represents a writer object that provides APIs to write data to the IO stream." msgstr "" "IO ストリームにデータを書き込むための API を提供するライターオブジェクトを表" "します。" -#: ../../library/asyncio-stream.rst:309 +#: ../../library/asyncio-stream.rst:228 msgid "" "It is not recommended to instantiate *StreamWriter* objects directly; use :" "func:`open_connection` and :func:`start_server` instead." @@ -404,7 +320,7 @@ msgstr "" "*StreamWriter* オブジェクトを直接インスタンス化することは推奨されません; 代わ" "りに :func:`open_connection` や :func:`start_server` を使ってください。" -#: ../../library/asyncio-stream.rst:315 +#: ../../library/asyncio-stream.rst:234 msgid "" "The method attempts to write the *data* to the underlying socket " "immediately. If that fails, the data is queued in an internal write buffer " @@ -414,17 +330,11 @@ msgstr "" "込みに失敗した場合、データは送信可能になるまで内部の書き込みバッファーに格納" "されて待機します。" -#: ../../library/asyncio-stream.rst:319 ../../library/asyncio-stream.rst:331 +#: ../../library/asyncio-stream.rst:238 ../../library/asyncio-stream.rst:250 msgid "The method should be used along with the ``drain()`` method::" msgstr "このメソッドは ``drain()`` メソッドと組み合わせて使うべきです::" -#: ../../library/asyncio-stream.rst:321 -msgid "" -"stream.write(data)\n" -"await stream.drain()" -msgstr "" - -#: ../../library/asyncio-stream.rst:326 +#: ../../library/asyncio-stream.rst:245 msgid "" "The method writes a list (or any iterable) of bytes to the underlying socket " "immediately. If that fails, the data is queued in an internal write buffer " @@ -434,29 +344,15 @@ msgstr "" "を即座に書き込みます。書き込みに失敗した場合、データは送信可能になるまで内部" "の書き込みバッファーに格納されて待機します。" -#: ../../library/asyncio-stream.rst:333 -msgid "" -"stream.writelines(lines)\n" -"await stream.drain()" -msgstr "" - -#: ../../library/asyncio-stream.rst:338 +#: ../../library/asyncio-stream.rst:257 msgid "The method closes the stream and the underlying socket." msgstr "このメソッドはストリームと背後にあるソケットをクローズします。" -#: ../../library/asyncio-stream.rst:340 -msgid "" -"The method should be used, though not mandatory, along with the " -"``wait_closed()`` method::" -msgstr "" +#: ../../library/asyncio-stream.rst:259 +msgid "The method should be used along with the ``wait_closed()`` method::" +msgstr "このメソッドは ``wait_closed()`` メソッドと組み合わせて使うべきです::" -#: ../../library/asyncio-stream.rst:343 -msgid "" -"stream.close()\n" -"await stream.wait_closed()" -msgstr "" - -#: ../../library/asyncio-stream.rst:348 +#: ../../library/asyncio-stream.rst:266 msgid "" "Return ``True`` if the underlying transport supports the :meth:`write_eof` " "method, ``False`` otherwise." @@ -464,18 +360,18 @@ msgstr "" "背後にあるトランスポートが :meth:`write_eof` メソッドをサポートしている場合 " "``True`` を返し、そうでない場合は ``False`` を返します。" -#: ../../library/asyncio-stream.rst:353 +#: ../../library/asyncio-stream.rst:271 msgid "" "Close the write end of the stream after the buffered write data is flushed." msgstr "" "バッファーされた書き込みデータを全て書き込んでから、ストリームの書き込み側終" "端をクローズします。" -#: ../../library/asyncio-stream.rst:358 +#: ../../library/asyncio-stream.rst:276 msgid "Return the underlying asyncio transport." msgstr "背後にある asyncio トランスポートを返します。" -#: ../../library/asyncio-stream.rst:362 +#: ../../library/asyncio-stream.rst:280 msgid "" "Access optional transport information; see :meth:`BaseTransport." "get_extra_info` for details." @@ -483,17 +379,11 @@ msgstr "" "オプションのトランスポート情報にアクセスします。詳細は :meth:`BaseTransport." "get_extra_info` を参照してください。" -#: ../../library/asyncio-stream.rst:368 +#: ../../library/asyncio-stream.rst:285 msgid "Wait until it is appropriate to resume writing to the stream. Example::" msgstr "ストリームへの書き込み再開に適切な状態になるまで待ちます。使用例::" -#: ../../library/asyncio-stream.rst:371 -msgid "" -"writer.write(data)\n" -"await writer.drain()" -msgstr "" - -#: ../../library/asyncio-stream.rst:374 +#: ../../library/asyncio-stream.rst:291 msgid "" "This is a flow control method that interacts with the underlying IO write " "buffer. When the size of the buffer reaches the high watermark, *drain()* " @@ -507,72 +397,39 @@ msgstr "" "をブロックします。待ち受けの必要がない場合、 :meth:`drain` は即座にリターンし" "ます。" -#: ../../library/asyncio-stream.rst:385 -msgid "Upgrade an existing stream-based connection to TLS." -msgstr "" - -#: ../../library/asyncio-stream.rst:387 -msgid "Parameters:" -msgstr "引数:" - -#: ../../library/asyncio-stream.rst:389 -msgid "*sslcontext*: a configured instance of :class:`~ssl.SSLContext`." -msgstr "*sslcontext*: 構成済みの :class:`~ssl.SSLContext` インスタンスです。" - -#: ../../library/asyncio-stream.rst:391 -msgid "" -"*server_hostname*: sets or overrides the host name that the target server's " -"certificate will be matched against." -msgstr "" -"*server_hostname*: 対象のサーバーの証明書との照合に使われるホスト名を設定また" -"は上書きします。" - -#: ../../library/asyncio-stream.rst:394 -msgid "" -"*ssl_handshake_timeout* is the time in seconds to wait for the TLS handshake " -"to complete before aborting the connection. ``60.0`` seconds if ``None`` " -"(default)." -msgstr "" - -#: ../../library/asyncio-stream.rst:398 -msgid "" -"*ssl_shutdown_timeout* is the time in seconds to wait for the SSL shutdown " -"to complete before aborting the connection. ``30.0`` seconds if ``None`` " -"(default)." -msgstr "" - -#: ../../library/asyncio-stream.rst:410 +#: ../../library/asyncio-stream.rst:300 msgid "" "Return ``True`` if the stream is closed or in the process of being closed." msgstr "" "ストリームがクローズされたか、またはクローズ処理中の場合に ``True`` を返しま" "す。" -#: ../../library/asyncio-stream.rst:418 +#: ../../library/asyncio-stream.rst:307 msgid "Wait until the stream is closed." msgstr "ストリームがクローズされるまで待機します。" -#: ../../library/asyncio-stream.rst:420 +#: ../../library/asyncio-stream.rst:309 msgid "" "Should be called after :meth:`close` to wait until the underlying connection " -"is closed, ensuring that all data has been flushed before e.g. exiting the " -"program." +"is closed." msgstr "" +"このメソッドは、 :meth:`close` を呼び出した後に、コネクションがクローズされる" +"まで待機するために呼び出すべきです。" -#: ../../library/asyncio-stream.rst:428 +#: ../../library/asyncio-stream.rst:316 msgid "Examples" msgstr "使用例" -#: ../../library/asyncio-stream.rst:433 +#: ../../library/asyncio-stream.rst:321 msgid "TCP echo client using streams" msgstr "ストリームを使った TCP Echo クライアント" -#: ../../library/asyncio-stream.rst:435 +#: ../../library/asyncio-stream.rst:323 msgid "TCP echo client using the :func:`asyncio.open_connection` function::" msgstr "" ":func:`asyncio.open_connection` 関数を使った TCP Echo クライアントです::" -#: ../../library/asyncio-stream.rst:459 +#: ../../library/asyncio-stream.rst:345 msgid "" "The :ref:`TCP echo client protocol " "` example uses the low-level :meth:" @@ -582,47 +439,15 @@ msgstr "" "` の例は低水準の :meth:`loop." "create_connection` メソッドを使っています。" -#: ../../library/asyncio-stream.rst:466 +#: ../../library/asyncio-stream.rst:352 msgid "TCP echo server using streams" msgstr "ストリームを使った TCP Echo サーバー" -#: ../../library/asyncio-stream.rst:468 +#: ../../library/asyncio-stream.rst:354 msgid "TCP echo server using the :func:`asyncio.start_server` function::" msgstr ":func:`asyncio.start_server` 関数を使った TCP Echo サーバーです::" -#: ../../library/asyncio-stream.rst:470 -msgid "" -"import asyncio\n" -"\n" -"async def handle_echo(reader, writer):\n" -" data = await reader.read(100)\n" -" message = data.decode()\n" -" addr = writer.get_extra_info('peername')\n" -"\n" -" print(f\"Received {message!r} from {addr!r}\")\n" -"\n" -" print(f\"Send: {message!r}\")\n" -" writer.write(data)\n" -" await writer.drain()\n" -"\n" -" print(\"Close the connection\")\n" -" writer.close()\n" -" await writer.wait_closed()\n" -"\n" -"async def main():\n" -" server = await asyncio.start_server(\n" -" handle_echo, '127.0.0.1', 8888)\n" -"\n" -" addrs = ', '.join(str(sock.getsockname()) for sock in server.sockets)\n" -" print(f'Serving on {addrs}')\n" -"\n" -" async with server:\n" -" await server.serve_forever()\n" -"\n" -"asyncio.run(main())" -msgstr "" - -#: ../../library/asyncio-stream.rst:502 +#: ../../library/asyncio-stream.rst:387 msgid "" "The :ref:`TCP echo server protocol " "` example uses the :meth:`loop." @@ -632,76 +457,29 @@ msgstr "" "` の例は :meth:`loop." "create_server` メソッドを使っています。" -#: ../../library/asyncio-stream.rst:507 +#: ../../library/asyncio-stream.rst:392 msgid "Get HTTP headers" msgstr "HTTP ヘッダーの取得" -#: ../../library/asyncio-stream.rst:509 +#: ../../library/asyncio-stream.rst:394 msgid "" "Simple example querying HTTP headers of the URL passed on the command line::" msgstr "" "コマンドラインから渡された URL の HTTP ヘッダーを問い合わせる簡単な例です::" -#: ../../library/asyncio-stream.rst:511 -msgid "" -"import asyncio\n" -"import urllib.parse\n" -"import sys\n" -"\n" -"async def print_http_headers(url):\n" -" url = urllib.parse.urlsplit(url)\n" -" if url.scheme == 'https':\n" -" reader, writer = await asyncio.open_connection(\n" -" url.hostname, 443, ssl=True)\n" -" else:\n" -" reader, writer = await asyncio.open_connection(\n" -" url.hostname, 80)\n" -"\n" -" query = (\n" -" f\"HEAD {url.path or '/'} HTTP/1.0\\r\\n\"\n" -" f\"Host: {url.hostname}\\r\\n\"\n" -" f\"\\r\\n\"\n" -" )\n" -"\n" -" writer.write(query.encode('latin-1'))\n" -" while True:\n" -" line = await reader.readline()\n" -" if not line:\n" -" break\n" -"\n" -" line = line.decode('latin1').rstrip()\n" -" if line:\n" -" print(f'HTTP header> {line}')\n" -"\n" -" # Ignore the body, close the socket\n" -" writer.close()\n" -" await writer.wait_closed()\n" -"\n" -"url = sys.argv[1]\n" -"asyncio.run(print_http_headers(url))" -msgstr "" - -#: ../../library/asyncio-stream.rst:548 +#: ../../library/asyncio-stream.rst:432 msgid "Usage::" msgstr "使い方::" -#: ../../library/asyncio-stream.rst:550 -msgid "python example.py http://example.com/path/page.html" -msgstr "" - -#: ../../library/asyncio-stream.rst:552 +#: ../../library/asyncio-stream.rst:436 msgid "or with HTTPS::" msgstr "または HTTPS を使用::" -#: ../../library/asyncio-stream.rst:554 -msgid "python example.py https://example.com/path/page.html" -msgstr "" - -#: ../../library/asyncio-stream.rst:560 +#: ../../library/asyncio-stream.rst:444 msgid "Register an open socket to wait for data using streams" msgstr "ストリームを使ってデータを待つオープンソケットの登録" -#: ../../library/asyncio-stream.rst:562 +#: ../../library/asyncio-stream.rst:446 msgid "" "Coroutine waiting until a socket receives data using the :func:" "`open_connection` function::" @@ -709,40 +487,7 @@ msgstr "" ":func:`open_connection` 関数を使ってソケットがデータを受信するまで待つコルー" "チンです::" -#: ../../library/asyncio-stream.rst:565 -msgid "" -"import asyncio\n" -"import socket\n" -"\n" -"async def wait_for_data():\n" -" # Get a reference to the current event loop because\n" -" # we want to access low-level APIs.\n" -" loop = asyncio.get_running_loop()\n" -"\n" -" # Create a pair of connected sockets.\n" -" rsock, wsock = socket.socketpair()\n" -"\n" -" # Register the open socket to wait for data.\n" -" reader, writer = await asyncio.open_connection(sock=rsock)\n" -"\n" -" # Simulate the reception of data from the network\n" -" loop.call_soon(wsock.send, 'abc'.encode())\n" -"\n" -" # Wait for data\n" -" data = await reader.read(100)\n" -"\n" -" # Got data, we are done: close the socket\n" -" print(\"Received:\", data.decode())\n" -" writer.close()\n" -" await writer.wait_closed()\n" -"\n" -" # Close the second socket\n" -" wsock.close()\n" -"\n" -"asyncio.run(wait_for_data())" -msgstr "" - -#: ../../library/asyncio-stream.rst:597 +#: ../../library/asyncio-stream.rst:480 msgid "" "The :ref:`register an open socket to wait for data using a protocol " "` example uses a low-level protocol and " @@ -752,7 +497,7 @@ msgstr "" "` 例では、低水準のプロトコルと :meth:" "`loop.create_connection` メソッドを使っています。" -#: ../../library/asyncio-stream.rst:601 +#: ../../library/asyncio-stream.rst:484 msgid "" "The :ref:`watch a file descriptor for read events " "` example uses the low-level :meth:`loop." diff --git a/library/asyncio-subprocess.po b/library/asyncio-subprocess.po index bd2a34755..b537b33df 100644 --- a/library/asyncio-subprocess.po +++ b/library/asyncio-subprocess.po @@ -1,28 +1,29 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 -# Takeshi Nakazato, 2022 -# Arihiro TAKASE, 2023 -# souma987, 2023 +# E. Kawashima, 2017 +# 秘湯 , 2017 +# Masato HASHIMOTO , 2017 +# tomo, 2018 +# Naoki Nakamura , 2020 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:55+0000\n" -"Last-Translator: souma987, 2023\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-04-26 06:10+0000\n" +"PO-Revision-Date: 2017-02-16 17:49+0000\n" +"Last-Translator: Naoki Nakamura , 2020\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/asyncio-subprocess.rst:7 @@ -53,38 +54,10 @@ msgstr "" "以下は、 asyncio モジュールがどのようにシェルコマンドを実行し、結果を取得でき" "るかを示す例です::" -#: ../../library/asyncio-subprocess.rst:22 -msgid "" -"import asyncio\n" -"\n" -"async def run(cmd):\n" -" proc = await asyncio.create_subprocess_shell(\n" -" cmd,\n" -" stdout=asyncio.subprocess.PIPE,\n" -" stderr=asyncio.subprocess.PIPE)\n" -"\n" -" stdout, stderr = await proc.communicate()\n" -"\n" -" print(f'[{cmd!r} exited with {proc.returncode}]')\n" -" if stdout:\n" -" print(f'[stdout]\\n{stdout.decode()}')\n" -" if stderr:\n" -" print(f'[stderr]\\n{stderr.decode()}')\n" -"\n" -"asyncio.run(run('ls /zzz'))" -msgstr "" - #: ../../library/asyncio-subprocess.rst:40 msgid "will print::" msgstr "このサンプルコードは以下を出力します::" -#: ../../library/asyncio-subprocess.rst:42 -msgid "" -"['ls /zzz' exited with 1]\n" -"[stderr]\n" -"ls: /zzz: No such file or directory" -msgstr "" - #: ../../library/asyncio-subprocess.rst:46 msgid "" "Because all asyncio subprocess functions are asynchronous and asyncio " @@ -94,18 +67,8 @@ msgid "" msgstr "" "全ての asyncio のサブプロセス関数は非同期ですが、 asyncio モジュールはこれら" "の非同期関数と協調するための多くのツールを提供しているので、複数のサブプロセ" -"スを並列に実行して監視することは簡単です。実際、上記のサンプルコードを複数の" -"コマンドを同時に実行するように修正するのはきわめて単純です::" - -#: ../../library/asyncio-subprocess.rst:51 -msgid "" -"async def main():\n" -" await asyncio.gather(\n" -" run('ls /zzz'),\n" -" run('sleep 1; echo \"hello\"'))\n" -"\n" -"asyncio.run(main())" -msgstr "" +"スを並列に実行して監視することは簡単です。実際、上記のサンプル小0どを複数のコ" +"マンドを同時に実行するように修正するのはきわめて単純です::" #: ../../library/asyncio-subprocess.rst:58 msgid "See also the `Examples`_ subsection." @@ -123,10 +86,12 @@ msgstr "サブプロセスを作成します。" #: ../../library/asyncio-subprocess.rst:89 msgid "" "The *limit* argument sets the buffer limit for :class:`StreamReader` " -"wrappers for :attr:`~asyncio.subprocess.Process.stdout` and :attr:`~asyncio." -"subprocess.Process.stderr` (if :const:`subprocess.PIPE` is passed to " -"*stdout* and *stderr* arguments)." +"wrappers for :attr:`Process.stdout` and :attr:`Process.stderr` (if :attr:" +"`subprocess.PIPE` is passed to *stdout* and *stderr* arguments)." msgstr "" +"引数 *limit* は (:attr:`subprocess.PIPE` を *stdout* と *stderr* に設定した場" +"合の) :attr:`Process.stdout` と :attr:`Process.stderr` のための :class:" +"`StreamReader` ラッパーのバッファー上限値を設定します。" #: ../../library/asyncio-subprocess.rst:74 #: ../../library/asyncio-subprocess.rst:93 @@ -139,10 +104,10 @@ msgid "" msgstr "" "他のパラメータについては :meth:`loop.subprocess_exec` を参照してください。" -#: ../../library/asyncio-subprocess.rst:79 -#: ../../library/asyncio-subprocess.rst:107 -msgid "Removed the *loop* parameter." -msgstr "*loop* パラメータが削除されました。" +#: ../../library/asyncio-subprocess.rst:81 +#: ../../library/asyncio-subprocess.rst:109 +msgid "The *loop* parameter." +msgstr "*loop* パラメータ。" #: ../../library/asyncio-subprocess.rst:87 msgid "Run the *cmd* shell command." @@ -170,7 +135,7 @@ msgstr "" "ください。シェルコマンドを構成する文字列内の空白文字と特殊文字のエスケープ" "は、 :func:`shlex.quote` 関数を使うと適切に行うことができます。" -#: ../../library/asyncio-subprocess.rst:112 +#: ../../library/asyncio-subprocess.rst:113 msgid "" "Subprocesses are available for Windows if a :class:`ProactorEventLoop` is " "used. See :ref:`Subprocess Support on Windows ` " @@ -180,7 +145,7 @@ msgstr "" "す。詳しくは :ref:`Windows におけるサブプロセスのサポート ` を参照してください。" -#: ../../library/asyncio-subprocess.rst:118 +#: ../../library/asyncio-subprocess.rst:119 msgid "" "asyncio also has the following *low-level* APIs to work with subprocesses: :" "meth:`loop.subprocess_exec`, :meth:`loop.subprocess_shell`, :meth:`loop." @@ -194,7 +159,7 @@ msgstr "" "`Subprocess Transports ` と :ref:`Subprocess " "Protocols `。" -#: ../../library/asyncio-subprocess.rst:126 +#: ../../library/asyncio-subprocess.rst:127 msgid "Constants" msgstr "定数" @@ -205,19 +170,26 @@ msgstr "*stdin*, *stdout* または *stderr* に渡すことができます。" #: ../../library/asyncio-subprocess.rst:133 msgid "" "If *PIPE* is passed to *stdin* argument, the :attr:`Process.stdin ` attribute will point to a :class:`~asyncio." -"StreamWriter` instance." +"subprocess.Process.stdin>` attribute will point to a :class:`StreamWriter` " +"instance." msgstr "" +"*PIPE* が *stdin* 引数に渡された場合、 :attr:`Process.stdin ` 属性は :class:`StreamWriter` インスタンスを指しま" +"す。" #: ../../library/asyncio-subprocess.rst:137 msgid "" "If *PIPE* is passed to *stdout* or *stderr* arguments, the :attr:`Process." "stdout ` and :attr:`Process.stderr " "` attributes will point to :class:" -"`~asyncio.StreamReader` instances." +"`StreamReader` instances." msgstr "" +"*PIPE* が *stdout* や *stderr* 引数に渡された場合、 :attr:`Process.stdout " +"` と :attr:`Process.stderr ` 属性は :class:`StreamReader` インスタンスを指しま" +"す。" -#: ../../library/asyncio-subprocess.rst:145 +#: ../../library/asyncio-subprocess.rst:144 msgid "" "Special value that can be used as the *stderr* argument and indicates that " "standard error should be redirected into standard output." @@ -225,7 +197,7 @@ msgstr "" "*stderr* 引数に対して利用できる特殊な値で、標準エラー出力が標準出力にリダイレ" "クトされることを意味します。" -#: ../../library/asyncio-subprocess.rst:151 +#: ../../library/asyncio-subprocess.rst:149 msgid "" "Special value that can be used as the *stdin*, *stdout* or *stderr* argument " "to process creation functions. It indicates that the special file :data:`os." @@ -235,11 +207,11 @@ msgstr "" "殊な値です。対応するサブプロセスのストリームに特殊なファイル :data:`os." "devnull` が使われることを意味します。" -#: ../../library/asyncio-subprocess.rst:157 +#: ../../library/asyncio-subprocess.rst:155 msgid "Interacting with Subprocesses" msgstr "サブプロセスとやりとりする" -#: ../../library/asyncio-subprocess.rst:159 +#: ../../library/asyncio-subprocess.rst:157 msgid "" "Both :func:`create_subprocess_exec` and :func:`create_subprocess_shell` " "functions return instances of the *Process* class. *Process* is a high-" @@ -251,14 +223,15 @@ msgstr "" "プロセスと通信したり、サブプロセスの完了を監視したりするための高水準のラッ" "パーです。" -#: ../../library/asyncio-subprocess.rst:167 +#: ../../library/asyncio-subprocess.rst:164 msgid "" -"An object that wraps OS processes created by the :func:`~asyncio." -"create_subprocess_exec` and :func:`~asyncio.create_subprocess_shell` " -"functions." +"An object that wraps OS processes created by the :func:" +"`create_subprocess_exec` and :func:`create_subprocess_shell` functions." msgstr "" +"関数 :func:`create_subprocess_exec` や :func:`create_subprocess_shell` によっ" +"て生成された OS のプロセスをラップするオブジェクトです。" -#: ../../library/asyncio-subprocess.rst:171 +#: ../../library/asyncio-subprocess.rst:168 msgid "" "This class is designed to have a similar API to the :class:`subprocess." "Popen` class, but there are some notable differences:" @@ -266,7 +239,7 @@ msgstr "" "このクラスは :class:`subprocess.Popen` クラスと同様の API を持つように設計さ" "れていますが、いくつかの注意すべき違いがあります:" -#: ../../library/asyncio-subprocess.rst:175 +#: ../../library/asyncio-subprocess.rst:172 msgid "" "unlike Popen, Process instances do not have an equivalent to the :meth:" "`~subprocess.Popen.poll` method;" @@ -274,14 +247,14 @@ msgstr "" "Popen と異なり、 Process インスタンスは :meth:`~subprocess.Popen.poll` メソッ" "ドに相当するメソッドを持っていません;" -#: ../../library/asyncio-subprocess.rst:178 +#: ../../library/asyncio-subprocess.rst:175 msgid "" "the :meth:`~asyncio.subprocess.Process.communicate` and :meth:`~asyncio." "subprocess.Process.wait` methods don't have a *timeout* parameter: use the :" -"func:`~asyncio.wait_for` function;" +"func:`wait_for` function;" msgstr "" -#: ../../library/asyncio-subprocess.rst:182 +#: ../../library/asyncio-subprocess.rst:179 msgid "" "the :meth:`Process.wait() ` method is " "asynchronous, whereas :meth:`subprocess.Popen.wait` method is implemented as " @@ -291,16 +264,16 @@ msgstr "" "ているのに対して、 :meth:`Process.wait() ` " "メソッドは非同期処理です;" -#: ../../library/asyncio-subprocess.rst:186 +#: ../../library/asyncio-subprocess.rst:183 msgid "the *universal_newlines* parameter is not supported." msgstr "*universal_newlines* パラメータはサポートされていません。" -#: ../../library/asyncio-subprocess.rst:188 +#: ../../library/asyncio-subprocess.rst:185 msgid "This class is :ref:`not thread safe `." msgstr "" "このクラスは :ref:`スレッド安全ではありません `。" -#: ../../library/asyncio-subprocess.rst:190 +#: ../../library/asyncio-subprocess.rst:187 msgid "" "See also the :ref:`Subprocess and Threads ` " "section." @@ -308,15 +281,15 @@ msgstr "" ":ref:`サブプロセスとスレッド ` 節も参照してくださ" "い。" -#: ../../library/asyncio-subprocess.rst:196 +#: ../../library/asyncio-subprocess.rst:192 msgid "Wait for the child process to terminate." msgstr "子プロセスが終了するのを待ち受けます。" -#: ../../library/asyncio-subprocess.rst:198 +#: ../../library/asyncio-subprocess.rst:194 msgid "Set and return the :attr:`returncode` attribute." msgstr ":attr:`returncode` 属性を設定し、その値を返します。" -#: ../../library/asyncio-subprocess.rst:202 +#: ../../library/asyncio-subprocess.rst:198 msgid "" "This method can deadlock when using ``stdout=PIPE`` or ``stderr=PIPE`` and " "the child process generates so much output that it blocks waiting for the OS " @@ -328,27 +301,23 @@ msgstr "" "生成場合、このメソッドはデッドロックする可能性があります。この条件を避けるた" "め、パイプを使用する場合は :meth:`communicate` メソッドを使ってください。" -#: ../../library/asyncio-subprocess.rst:211 +#: ../../library/asyncio-subprocess.rst:206 msgid "Interact with process:" msgstr "プロセスとのやりとりを行います:" -#: ../../library/asyncio-subprocess.rst:213 +#: ../../library/asyncio-subprocess.rst:208 msgid "send data to *stdin* (if *input* is not ``None``);" msgstr "*stdin* にデータを送信します (*input* が ``None`` でない場合);" -#: ../../library/asyncio-subprocess.rst:214 -msgid "closes *stdin*;" -msgstr "*stdin* を閉じます;" - -#: ../../library/asyncio-subprocess.rst:215 +#: ../../library/asyncio-subprocess.rst:209 msgid "read data from *stdout* and *stderr*, until EOF is reached;" msgstr "EOF に達するまで *stdout* および *stderr* からデータを読み出します;" -#: ../../library/asyncio-subprocess.rst:216 +#: ../../library/asyncio-subprocess.rst:210 msgid "wait for process to terminate." msgstr "プロセスが終了するまで待ち受けます。" -#: ../../library/asyncio-subprocess.rst:218 +#: ../../library/asyncio-subprocess.rst:212 msgid "" "The optional *input* argument is the data (:class:`bytes` object) that will " "be sent to the child process." @@ -356,11 +325,11 @@ msgstr "" "*input* オプション引数は子プロセスに送信されるデータ (:class:`bytes` オブジェ" "クト) です。" -#: ../../library/asyncio-subprocess.rst:221 +#: ../../library/asyncio-subprocess.rst:215 msgid "Return a tuple ``(stdout_data, stderr_data)``." msgstr "``(stdout_data, stderr_data)`` のタプルを返します。" -#: ../../library/asyncio-subprocess.rst:223 +#: ../../library/asyncio-subprocess.rst:217 msgid "" "If either :exc:`BrokenPipeError` or :exc:`ConnectionResetError` exception is " "raised when writing *input* into *stdin*, the exception is ignored. This " @@ -372,7 +341,7 @@ msgstr "" "ような条件は、全てのデータが *stdin* に書き込まれる前にプロセスが終了した場合" "に起こります。" -#: ../../library/asyncio-subprocess.rst:228 +#: ../../library/asyncio-subprocess.rst:222 msgid "" "If it is desired to send data to the process' *stdin*, the process needs to " "be created with ``stdin=PIPE``. Similarly, to get anything other than " @@ -384,7 +353,7 @@ msgstr "" "かのデータを戻り値のタプルで受け取りたい場合、プロセスは ``stdout=PIPE`` と " "``stderr=PIPE`` のいずれかまたは両方を指定して生成しなければなりません。" -#: ../../library/asyncio-subprocess.rst:234 +#: ../../library/asyncio-subprocess.rst:228 msgid "" "Note, that the data read is buffered in memory, so do not use this method if " "the data size is large or unlimited." @@ -393,99 +362,111 @@ msgstr "" "い。そのため、返されるデータのサイズが大きいかまたは無制限の場合はこのメソッ" "ドを使わないようにしてください。" -#: ../../library/asyncio-subprocess.rst:239 -msgid "*stdin* gets closed when ``input=None`` too." -msgstr "" - -#: ../../library/asyncio-subprocess.rst:243 +#: ../../library/asyncio-subprocess.rst:233 msgid "Sends the signal *signal* to the child process." msgstr "子プロセスにシグナル *signal* を送信します。" -#: ../../library/asyncio-subprocess.rst:247 +#: ../../library/asyncio-subprocess.rst:237 msgid "" -"On Windows, :py:const:`~signal.SIGTERM` is an alias for :meth:`terminate`. " +"On Windows, :py:data:`SIGTERM` is an alias for :meth:`terminate`. " "``CTRL_C_EVENT`` and ``CTRL_BREAK_EVENT`` can be sent to processes started " "with a *creationflags* parameter which includes ``CREATE_NEW_PROCESS_GROUP``." msgstr "" +"Windows では、:py:data:`SIGTERM` は :meth:`terminate` の別名になります。" +"``CTRL_C_EVENT`` および ``CTRL_BREAK_EVENT`` で、*creationflags* で始まり、" +"``CREATE_NEW_PROCESS_GROUP`` を含むパラメータをプロセスに送信することができま" +"す。" -#: ../../library/asyncio-subprocess.rst:254 +#: ../../library/asyncio-subprocess.rst:244 msgid "Stop the child process." msgstr "子プロセスを停止します。" -#: ../../library/asyncio-subprocess.rst:256 +#: ../../library/asyncio-subprocess.rst:246 msgid "" -"On POSIX systems this method sends :py:const:`~signal.SIGTERM` to the child " +"On POSIX systems this method sends :py:data:`signal.SIGTERM` to the child " "process." msgstr "" +"POSIX システムでは、このメソッドは子プロセスに :py:data:`signal.SIGTERM` シグ" +"ナルを送信します" -#: ../../library/asyncio-subprocess.rst:259 +#: ../../library/asyncio-subprocess.rst:249 msgid "" -"On Windows the Win32 API function :c:func:`!TerminateProcess` is called to " +"On Windows the Win32 API function :c:func:`TerminateProcess` is called to " "stop the child process." msgstr "" +"Windows では、子プロセスを停止するために Win32 API 関数 :c:func:" +"`TerminateProcess` を呼び出します。" -#: ../../library/asyncio-subprocess.rst:264 +#: ../../library/asyncio-subprocess.rst:254 msgid "Kill the child process." msgstr "子プロセスを強制終了 (kill) します。" -#: ../../library/asyncio-subprocess.rst:266 +#: ../../library/asyncio-subprocess.rst:256 msgid "" -"On POSIX systems this method sends :py:data:`~signal.SIGKILL` to the child " -"process." +"On POSIX systems this method sends :py:data:`SIGKILL` to the child process." msgstr "" +"POSIX システムの場合、このメソッドは子プロセスに :py:data:`SIGKILL` シグナル" +"を送信します。" -#: ../../library/asyncio-subprocess.rst:269 +#: ../../library/asyncio-subprocess.rst:259 msgid "On Windows this method is an alias for :meth:`terminate`." msgstr "Windows では、このメソッドは :meth:`terminate` のエイリアスです。" -#: ../../library/asyncio-subprocess.rst:273 +#: ../../library/asyncio-subprocess.rst:263 msgid "" -"Standard input stream (:class:`~asyncio.StreamWriter`) or ``None`` if the " -"process was created with ``stdin=None``." +"Standard input stream (:class:`StreamWriter`) or ``None`` if the process was " +"created with ``stdin=None``." msgstr "" +"標準入力ストリーム (:class:`StreamWriter`) です。プロセスが ``stdin=None`` で" +"生成された場合は ``None`` になります。" -#: ../../library/asyncio-subprocess.rst:278 +#: ../../library/asyncio-subprocess.rst:268 msgid "" -"Standard output stream (:class:`~asyncio.StreamReader`) or ``None`` if the " -"process was created with ``stdout=None``." +"Standard output stream (:class:`StreamReader`) or ``None`` if the process " +"was created with ``stdout=None``." msgstr "" +"標準出力ストリーム (:class:`StreamReader`) です。プロセスが ``stdout=None`` " +"で生成された場合は ``None`` になります。" -#: ../../library/asyncio-subprocess.rst:283 +#: ../../library/asyncio-subprocess.rst:273 msgid "" -"Standard error stream (:class:`~asyncio.StreamReader`) or ``None`` if the " -"process was created with ``stderr=None``." +"Standard error stream (:class:`StreamReader`) or ``None`` if the process was " +"created with ``stderr=None``." msgstr "" +"標準エラー出力ストリーム (:class:`StreamReader`) です。プロセスが " +"``stderr=None`` で生成された場合は ``None`` になります。" -#: ../../library/asyncio-subprocess.rst:288 +#: ../../library/asyncio-subprocess.rst:278 msgid "" "Use the :meth:`communicate` method rather than :attr:`process.stdin.write() " "`, :attr:`await process.stdout.read() ` or :attr:`await " -"process.stderr.read() `. This avoids deadlocks due to streams " -"pausing reading or writing and blocking the child process." +"process.stderr.read `. This avoids deadlocks due to streams pausing " +"reading or writing and blocking the child process." msgstr "" -#: ../../library/asyncio-subprocess.rst:297 +#: ../../library/asyncio-subprocess.rst:287 msgid "Process identification number (PID)." msgstr "子プロセスのプロセス番号 (PID) です。" -#: ../../library/asyncio-subprocess.rst:299 +#: ../../library/asyncio-subprocess.rst:289 msgid "" -"Note that for processes created by the :func:`~asyncio." -"create_subprocess_shell` function, this attribute is the PID of the spawned " -"shell." +"Note that for processes created by the :func:`create_subprocess_shell` " +"function, this attribute is the PID of the spawned shell." msgstr "" +":func:`create_subprocess_shell` 関数によって生成されたプロセスの場合、この属" +"性は生成されたシェルの PID になることに注意してください。" -#: ../../library/asyncio-subprocess.rst:304 +#: ../../library/asyncio-subprocess.rst:294 msgid "Return code of the process when it exits." msgstr "プロセスが終了した時の終了ステータスを返します。" -#: ../../library/asyncio-subprocess.rst:306 +#: ../../library/asyncio-subprocess.rst:296 msgid "A ``None`` value indicates that the process has not terminated yet." msgstr "" "この属性が ``None`` であることは、プロセスがまだ終了していないことを示してい" "ます。" -#: ../../library/asyncio-subprocess.rst:308 +#: ../../library/asyncio-subprocess.rst:298 msgid "" "A negative value ``-N`` indicates that the child was terminated by signal " "``N`` (POSIX only)." @@ -493,11 +474,11 @@ msgstr "" "負の値 ``-N`` は子プロセスがシグナル ``N`` により中止させられたことを示しま" "す (POSIX のみ)。" -#: ../../library/asyncio-subprocess.rst:315 +#: ../../library/asyncio-subprocess.rst:305 msgid "Subprocess and Threads" msgstr "サブプロセスとスレッド" -#: ../../library/asyncio-subprocess.rst:317 +#: ../../library/asyncio-subprocess.rst:307 msgid "" "Standard asyncio event loop supports running subprocesses from different " "threads by default." @@ -505,7 +486,7 @@ msgstr "" "標準的な asyncio のイベントループは、異なるスレッドからサブプロセスを実行する" "のをデフォルトでサポートしています。" -#: ../../library/asyncio-subprocess.rst:320 +#: ../../library/asyncio-subprocess.rst:310 msgid "" "On Windows subprocesses are provided by :class:`ProactorEventLoop` only " "(default), :class:`SelectorEventLoop` has no subprocess support." @@ -513,7 +494,31 @@ msgstr "" "Windows のサブプロセスは :class:`ProactorEventLoop` (デフォルト) のみ提供さ" "れ、 :class:`SelectorEventLoop` はサブプロセスをサポートしていません。" -#: ../../library/asyncio-subprocess.rst:323 +#: ../../library/asyncio-subprocess.rst:313 +msgid "" +"On UNIX *child watchers* are used for subprocess finish waiting, see :ref:" +"`asyncio-watchers` for more info." +msgstr "" +"UNIX の *child watchers* はサブプロセスの終了を待ち受けるために使われます。よ" +"り詳しい情報については :ref:`asyncio-watchers` を参照してください。" + +#: ../../library/asyncio-subprocess.rst:319 +msgid "" +"UNIX switched to use :class:`ThreadedChildWatcher` for spawning subprocesses " +"from different threads without any limitation." +msgstr "" +"UNIX では、異なるスレッドから何らの制限なくサブプロセスを生成するために :" +"class:`ThreadedChildWatcher` を使うようになりました。" + +#: ../../library/asyncio-subprocess.rst:322 +msgid "" +"Spawning a subprocess with *inactive* current child watcher raises :exc:" +"`RuntimeError`." +msgstr "" +"現在の子プロセスのウオッチャーが *アクティブでない* 場合にサブプロセスを生成" +"すると :exc:`RuntimeError` 例外が送出されます。" + +#: ../../library/asyncio-subprocess.rst:325 msgid "" "Note that alternative event loop implementations might have own limitations; " "please refer to their documentation." @@ -521,17 +526,17 @@ msgstr "" "標準で提供されない別のイベントループ実装の場合、固有の制限がある可能性があり" "ます; それぞれの実装のドキュメントを参照してください。" -#: ../../library/asyncio-subprocess.rst:328 +#: ../../library/asyncio-subprocess.rst:330 msgid "" "The :ref:`Concurrency and multithreading in asyncio ` section." msgstr ":ref:`asyncio-multithreading`" -#: ../../library/asyncio-subprocess.rst:333 +#: ../../library/asyncio-subprocess.rst:335 msgid "Examples" msgstr "使用例" -#: ../../library/asyncio-subprocess.rst:335 +#: ../../library/asyncio-subprocess.rst:337 msgid "" "An example using the :class:`~asyncio.subprocess.Process` class to control a " "subprocess and the :class:`StreamReader` class to read from its standard " @@ -541,38 +546,12 @@ msgstr "" "い、サブプロセスの標準出力を読み出すために :class:`StreamReader` を使う例で" "す。" -#: ../../library/asyncio-subprocess.rst:341 +#: ../../library/asyncio-subprocess.rst:343 msgid "" "The subprocess is created by the :func:`create_subprocess_exec` function::" msgstr "サブプロセスは :func:`create_subprocess_exec` 関数により生成されます::" -#: ../../library/asyncio-subprocess.rst:344 -msgid "" -"import asyncio\n" -"import sys\n" -"\n" -"async def get_date():\n" -" code = 'import datetime; print(datetime.datetime.now())'\n" -"\n" -" # Create the subprocess; redirect the standard output\n" -" # into a pipe.\n" -" proc = await asyncio.create_subprocess_exec(\n" -" sys.executable, '-c', code,\n" -" stdout=asyncio.subprocess.PIPE)\n" -"\n" -" # Read one line of output.\n" -" data = await proc.stdout.readline()\n" -" line = data.decode('ascii').rstrip()\n" -"\n" -" # Wait for the subprocess exit.\n" -" await proc.wait()\n" -" return line\n" -"\n" -"date = asyncio.run(get_date())\n" -"print(f\"Current date: {date}\")" -msgstr "" - -#: ../../library/asyncio-subprocess.rst:368 +#: ../../library/asyncio-subprocess.rst:370 msgid "" "See also the :ref:`same example ` written " "using low-level APIs." diff --git a/library/asyncio-sync.po b/library/asyncio-sync.po index d5aa3bf46..3976eefd0 100644 --- a/library/asyncio-sync.po +++ b/library/asyncio-sync.po @@ -1,29 +1,29 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Takeshi Nakazato, 2022 -# tomo, 2022 -# Arihiro TAKASE, 2023 -# Takuya Futatsugi, 2024 -# 石井明久, 2024 +# Arihiro TAKASE, 2017 +# Masato HASHIMOTO , 2017 +# E. Kawashima, 2017 +# tomo, 2019 +# Naoki Nakamura , 2020 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-06 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:55+0000\n" -"Last-Translator: 石井明久, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 17:49+0000\n" +"Last-Translator: Naoki Nakamura , 2020\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/asyncio-sync.rst:7 @@ -83,21 +83,17 @@ msgstr ":class:`Semaphore`" msgid ":class:`BoundedSemaphore`" msgstr ":class:`BoundedSemaphore`" -#: ../../library/asyncio-sync.rst:31 -msgid ":class:`Barrier`" -msgstr ":class:`Barrier`" - -#: ../../library/asyncio-sync.rst:38 +#: ../../library/asyncio-sync.rst:37 msgid "Lock" msgstr "Lock" -#: ../../library/asyncio-sync.rst:42 +#: ../../library/asyncio-sync.rst:41 msgid "Implements a mutex lock for asyncio tasks. Not thread-safe." msgstr "" "asyncio タスクのためのミューテックスロックを実装しています。スレッドセーフで" "はありません。" -#: ../../library/asyncio-sync.rst:44 +#: ../../library/asyncio-sync.rst:43 msgid "" "An asyncio lock can be used to guarantee exclusive access to a shared " "resource." @@ -105,49 +101,28 @@ msgstr "" "asyncio ロックは、共有リソースに対する排他的なアクセスを保証するために使うこ" "とができます。" -#: ../../library/asyncio-sync.rst:47 +#: ../../library/asyncio-sync.rst:46 msgid "The preferred way to use a Lock is an :keyword:`async with` statement::" msgstr "" "Lock の望ましい使用方法は、 :keyword:`async with` 文と組み合わせて使うことで" "す::" -#: ../../library/asyncio-sync.rst:50 -msgid "" -"lock = asyncio.Lock()\n" -"\n" -"# ... later\n" -"async with lock:\n" -" # access shared state" -msgstr "" - -#: ../../library/asyncio-sync.rst:56 ../../library/asyncio-sync.rst:201 -#: ../../library/asyncio-sync.rst:309 +#: ../../library/asyncio-sync.rst:55 ../../library/asyncio-sync.rst:200 +#: ../../library/asyncio-sync.rst:300 msgid "which is equivalent to::" msgstr "これは以下のコードと等価です::" -#: ../../library/asyncio-sync.rst:58 -msgid "" -"lock = asyncio.Lock()\n" -"\n" -"# ... later\n" -"await lock.acquire()\n" -"try:\n" -" # access shared state\n" -"finally:\n" -" lock.release()" -msgstr "" - -#: ../../library/asyncio-sync.rst:67 ../../library/asyncio-sync.rst:113 -#: ../../library/asyncio-sync.rst:189 ../../library/asyncio-sync.rst:297 -#: ../../library/asyncio-sync.rst:353 -msgid "Removed the *loop* parameter." -msgstr "*loop* パラメータが削除されました。" +#: ../../library/asyncio-sync.rst:68 ../../library/asyncio-sync.rst:114 +#: ../../library/asyncio-sync.rst:190 ../../library/asyncio-sync.rst:290 +#: ../../library/asyncio-sync.rst:345 +msgid "The *loop* parameter." +msgstr "*loop* パラメータ。" -#: ../../library/asyncio-sync.rst:73 +#: ../../library/asyncio-sync.rst:71 msgid "Acquire the lock." msgstr "ロックを獲得します。" -#: ../../library/asyncio-sync.rst:75 +#: ../../library/asyncio-sync.rst:73 msgid "" "This method waits until the lock is *unlocked*, sets it to *locked* and " "returns ``True``." @@ -155,7 +130,7 @@ msgstr "" "このメソッドはロックが *解除される* まで待機し、ロックを *ロック状態* に変更" "して ``True`` を返します。" -#: ../../library/asyncio-sync.rst:78 +#: ../../library/asyncio-sync.rst:76 msgid "" "When more than one coroutine is blocked in :meth:`acquire` waiting for the " "lock to be unlocked, only one coroutine eventually proceeds." @@ -163,7 +138,7 @@ msgstr "" "複数のコルーチンが :meth:`acquire` メソッドによりロックの解除を待ち受けている" "場合、最終的にただひとつのコルーチンが実行されます。" -#: ../../library/asyncio-sync.rst:82 +#: ../../library/asyncio-sync.rst:80 msgid "" "Acquiring a lock is *fair*: the coroutine that proceeds will be the first " "coroutine that started waiting on the lock." @@ -171,32 +146,32 @@ msgstr "" "ロックの獲得は *公平* です: すなわちロックを獲得して実行されるコルーチンは、" "最初にロックの待ち受けを開始したコルーチンです。" -#: ../../library/asyncio-sync.rst:87 +#: ../../library/asyncio-sync.rst:85 msgid "Release the lock." msgstr "ロックを解放します。" -#: ../../library/asyncio-sync.rst:89 +#: ../../library/asyncio-sync.rst:87 msgid "When the lock is *locked*, reset it to *unlocked* and return." msgstr "" "ロックが *ロック状態* の場合、 ロックを *解除状態* にしてリターンします。" -#: ../../library/asyncio-sync.rst:91 +#: ../../library/asyncio-sync.rst:89 msgid "If the lock is *unlocked*, a :exc:`RuntimeError` is raised." msgstr "ロックが *解除状態* の場合、 :exc:`RuntimeError` 例外が送出されます。" -#: ../../library/asyncio-sync.rst:95 +#: ../../library/asyncio-sync.rst:93 msgid "Return ``True`` if the lock is *locked*." msgstr "*ロック状態* の場合に ``True`` を返します。" -#: ../../library/asyncio-sync.rst:99 +#: ../../library/asyncio-sync.rst:97 msgid "Event" msgstr "Event" -#: ../../library/asyncio-sync.rst:103 +#: ../../library/asyncio-sync.rst:101 msgid "An event object. Not thread-safe." msgstr "イベントオブジェクトです。スレッドセーフではありません。" -#: ../../library/asyncio-sync.rst:105 +#: ../../library/asyncio-sync.rst:103 msgid "" "An asyncio event can be used to notify multiple asyncio tasks that some " "event has happened." @@ -204,7 +179,7 @@ msgstr "" "asyncio イベントは、複数の asyncio タスクに対して何らかのイベントが発生したこ" "とを通知するために使うことができます。" -#: ../../library/asyncio-sync.rst:108 +#: ../../library/asyncio-sync.rst:106 msgid "" "An Event object manages an internal flag that can be set to *true* with the :" "meth:`~Event.set` method and reset to *false* with the :meth:`clear` " @@ -216,39 +191,15 @@ msgstr "" "ることができます。 :meth:`~Event.wait` メソッドはフラグが *true* になるまで処" "理をブロックします。フラグの初期値は *false* です。" -#: ../../library/asyncio-sync.rst:118 ../../library/asyncio-sync.rst:377 +#: ../../library/asyncio-sync.rst:117 msgid "Example::" msgstr "以下はプログラム例です::" -#: ../../library/asyncio-sync.rst:120 -msgid "" -"async def waiter(event):\n" -" print('waiting for it ...')\n" -" await event.wait()\n" -" print('... got it!')\n" -"\n" -"async def main():\n" -" # Create an Event object.\n" -" event = asyncio.Event()\n" -"\n" -" # Spawn a Task to wait until 'event' is set.\n" -" waiter_task = asyncio.create_task(waiter(event))\n" -"\n" -" # Sleep for 1 second and set the event.\n" -" await asyncio.sleep(1)\n" -" event.set()\n" -"\n" -" # Wait until the waiter task is finished.\n" -" await waiter_task\n" -"\n" -"asyncio.run(main())" -msgstr "" - -#: ../../library/asyncio-sync.rst:144 +#: ../../library/asyncio-sync.rst:142 msgid "Wait until the event is set." msgstr "イベントがセットされるまで待機します。" -#: ../../library/asyncio-sync.rst:146 +#: ../../library/asyncio-sync.rst:144 msgid "" "If the event is set, return ``True`` immediately. Otherwise block until " "another task calls :meth:`~Event.set`." @@ -256,21 +207,21 @@ msgstr "" "イベントがセットされると、即座に ``True`` を返します。 そうでなければ、他のタ" "スクが :meth:`~Event.set` メソッドを呼び出すまで処理をブロックします。" -#: ../../library/asyncio-sync.rst:151 +#: ../../library/asyncio-sync.rst:149 msgid "Set the event." msgstr "イベントをセットします。" -#: ../../library/asyncio-sync.rst:153 +#: ../../library/asyncio-sync.rst:151 msgid "All tasks waiting for event to be set will be immediately awakened." msgstr "" "イベントがセットされるまで待機している全てのタスクは、即座に通知を受けて実行" "を再開します。" -#: ../../library/asyncio-sync.rst:158 +#: ../../library/asyncio-sync.rst:156 msgid "Clear (unset) the event." msgstr "イベントをクリア (アンセット) します" -#: ../../library/asyncio-sync.rst:160 +#: ../../library/asyncio-sync.rst:158 msgid "" "Tasks awaiting on :meth:`~Event.wait` will now block until the :meth:`~Event." "set` method is called again." @@ -278,19 +229,19 @@ msgstr "" ":meth:`~Event.wait` メソッドで待ち受けを行うタスクは :meth:`~Event.set` メ" "ソッドが再度呼び出されるまで処理をブロックします。" -#: ../../library/asyncio-sync.rst:165 +#: ../../library/asyncio-sync.rst:163 msgid "Return ``True`` if the event is set." msgstr "イベントがセットされている場合 ``True`` を返します。" -#: ../../library/asyncio-sync.rst:169 +#: ../../library/asyncio-sync.rst:167 msgid "Condition" msgstr "Condition" -#: ../../library/asyncio-sync.rst:173 +#: ../../library/asyncio-sync.rst:171 msgid "A Condition object. Not thread-safe." msgstr "条件変数オブジェクトです。スレッドセーフではありません。" -#: ../../library/asyncio-sync.rst:175 +#: ../../library/asyncio-sync.rst:173 msgid "" "An asyncio condition primitive can be used by a task to wait for some event " "to happen and then get exclusive access to a shared resource." @@ -299,7 +250,7 @@ msgstr "" "トを契機として共有リソースへの排他的なアクセスを得るために利用することができ" "ます。" -#: ../../library/asyncio-sync.rst:179 +#: ../../library/asyncio-sync.rst:177 msgid "" "In essence, a Condition object combines the functionality of an :class:" "`Event` and a :class:`Lock`. It is possible to have multiple Condition " @@ -313,7 +264,7 @@ msgstr "" "連する異なるタスクの間で、そのリソースへの排他的アクセスを調整することが可能" "になります。" -#: ../../library/asyncio-sync.rst:185 +#: ../../library/asyncio-sync.rst:183 msgid "" "The optional *lock* argument must be a :class:`Lock` object or ``None``. In " "the latter case a new Lock object is created automatically." @@ -321,39 +272,18 @@ msgstr "" "オプション引数 *lock* は :class:`Lock` または ``None`` でなければなりません。" "後者の場合自動的に新しい Lock オブジェクトが生成されます。" -#: ../../library/asyncio-sync.rst:192 +#: ../../library/asyncio-sync.rst:191 msgid "" "The preferred way to use a Condition is an :keyword:`async with` statement::" msgstr "" "Condition の望ましい使用方法は :keyword:`async with` 文と組み合わせて使うこと" "です::" -#: ../../library/asyncio-sync.rst:195 -msgid "" -"cond = asyncio.Condition()\n" -"\n" -"# ... later\n" -"async with cond:\n" -" await cond.wait()" -msgstr "" - -#: ../../library/asyncio-sync.rst:203 -msgid "" -"cond = asyncio.Condition()\n" -"\n" -"# ... later\n" -"await cond.acquire()\n" -"try:\n" -" await cond.wait()\n" -"finally:\n" -" cond.release()" -msgstr "" - -#: ../../library/asyncio-sync.rst:215 +#: ../../library/asyncio-sync.rst:213 msgid "Acquire the underlying lock." msgstr "下層でのロックを獲得します。" -#: ../../library/asyncio-sync.rst:217 +#: ../../library/asyncio-sync.rst:215 msgid "" "This method waits until the underlying lock is *unlocked*, sets it to " "*locked* and returns ``True``." @@ -361,13 +291,15 @@ msgstr "" "このメソッドは下層のロックが *解除される* まで待機し、ロックを *ロック状態* " "に変更して ``True`` を返します。" -#: ../../library/asyncio-sync.rst:222 +#: ../../library/asyncio-sync.rst:220 msgid "" -"Wake up *n* tasks (1 by default) waiting on this condition. If fewer than " -"*n* tasks are waiting they are all awakened." +"Wake up at most *n* tasks (1 by default) waiting on this condition. The " +"method is no-op if no tasks are waiting." msgstr "" +"この条件を待ち受けている最大で *n* 個のタスク (*n* のデフォルト値は 1) を起動" +"します。待ち受けているタスクがいない場合、このメソッドは何もしません。" -#: ../../library/asyncio-sync.rst:225 ../../library/asyncio-sync.rst:240 +#: ../../library/asyncio-sync.rst:223 ../../library/asyncio-sync.rst:238 msgid "" "The lock must be acquired before this method is called and released shortly " "after. If called with an *unlocked* lock a :exc:`RuntimeError` error is " @@ -377,35 +309,35 @@ msgstr "" "メソッド呼び出し後速やかにロックを解除しなければなりません。 *解除された* " "ロックとと共に呼び出された場合、 :exc:`RuntimeError` 例外が送出されます。" -#: ../../library/asyncio-sync.rst:231 +#: ../../library/asyncio-sync.rst:229 msgid "Return ``True`` if the underlying lock is acquired." msgstr "下層のロックを獲得していれば ``True`` を返します。" -#: ../../library/asyncio-sync.rst:235 +#: ../../library/asyncio-sync.rst:233 msgid "Wake up all tasks waiting on this condition." msgstr "この条件を待ち受けている全てのタスクを起動します。" -#: ../../library/asyncio-sync.rst:237 +#: ../../library/asyncio-sync.rst:235 msgid "This method acts like :meth:`notify`, but wakes up all waiting tasks." msgstr "" "このメソッドは :meth:`notify` と同じように振る舞いますが、待ち受けている全て" "のタスクを起動します。" -#: ../../library/asyncio-sync.rst:246 +#: ../../library/asyncio-sync.rst:244 msgid "Release the underlying lock." msgstr "下層のロックを解除します。" -#: ../../library/asyncio-sync.rst:248 +#: ../../library/asyncio-sync.rst:246 msgid "When invoked on an unlocked lock, a :exc:`RuntimeError` is raised." msgstr "" "アンロック状態のロックに対して呼び出された場合、:exc:`RuntimeError` が送出さ" "れます。" -#: ../../library/asyncio-sync.rst:254 +#: ../../library/asyncio-sync.rst:251 msgid "Wait until notified." msgstr "通知を受けるまで待機します。" -#: ../../library/asyncio-sync.rst:256 +#: ../../library/asyncio-sync.rst:253 msgid "" "If the calling task has not acquired the lock when this method is called, a :" "exc:`RuntimeError` is raised." @@ -413,7 +345,7 @@ msgstr "" "このメソッドが呼び出された時点で呼び出し元のタスクがロックを獲得していない場" "合、 :exc:`RuntimeError` 例外が送出されます。" -#: ../../library/asyncio-sync.rst:259 +#: ../../library/asyncio-sync.rst:256 msgid "" "This method releases the underlying lock, and then blocks until it is " "awakened by a :meth:`notify` or :meth:`notify_all` call. Once awakened, the " @@ -424,34 +356,27 @@ msgstr "" "動されると、 Condition は再びロックを獲得し、メソッドは ``True`` を返しま" "す。" -#: ../../library/asyncio-sync.rst:264 -msgid "" -"Note that a task *may* return from this call spuriously, which is why the " -"caller should always re-check the state and be prepared to :meth:`~Condition." -"wait` again. For this reason, you may prefer to use :meth:`~Condition." -"wait_for` instead." -msgstr "" - -#: ../../library/asyncio-sync.rst:272 +#: ../../library/asyncio-sync.rst:263 msgid "Wait until a predicate becomes *true*." msgstr "引数 predicate の条件が *真* になるまで待機します。" -#: ../../library/asyncio-sync.rst:274 +#: ../../library/asyncio-sync.rst:265 msgid "" "The predicate must be a callable which result will be interpreted as a " -"boolean value. The method will repeatedly :meth:`~Condition.wait` until the " -"predicate evaluates to *true*. The final value is the return value." +"boolean value. The final value is the return value." msgstr "" +"引数 predicate は戻り値が真偽地として解釈可能な呼び出し可能オブジェクトでなけ" +"ればなりません。 predicate の最終的な値が戻り値になります。" -#: ../../library/asyncio-sync.rst:281 +#: ../../library/asyncio-sync.rst:271 msgid "Semaphore" msgstr "Semaphore" -#: ../../library/asyncio-sync.rst:285 +#: ../../library/asyncio-sync.rst:275 msgid "A Semaphore object. Not thread-safe." msgstr "セマフォオブジェクトです。スレッドセーフではありません。" -#: ../../library/asyncio-sync.rst:287 +#: ../../library/asyncio-sync.rst:277 msgid "" "A semaphore manages an internal counter which is decremented by each :meth:" "`acquire` call and incremented by each :meth:`release` call. The counter can " @@ -464,7 +389,7 @@ msgstr "" "ソッドが呼び出された時にカウンターがゼロになっていると、セマフォは処理をブ" "ロックし、他のタスクが :meth:`release` メソッドを呼び出すまで待機します。" -#: ../../library/asyncio-sync.rst:293 +#: ../../library/asyncio-sync.rst:283 msgid "" "The optional *value* argument gives the initial value for the internal " "counter (``1`` by default). If the given value is less than ``0`` a :exc:" @@ -474,39 +399,18 @@ msgstr "" "``1`` です)。 指定された値が ``0`` より小さい場合、 :exc:`ValueError` 例外が" "送出されます。" -#: ../../library/asyncio-sync.rst:300 +#: ../../library/asyncio-sync.rst:291 msgid "" "The preferred way to use a Semaphore is an :keyword:`async with` statement::" msgstr "" -"セマフォの望ましい使用方法は、 :keyword:`async with` 文と組み合わせて使うこと" +"Semaphore 望ましい使用方法は、 :keyword:`async with` 文と組み合わせて使うこと" "です::" -#: ../../library/asyncio-sync.rst:303 -msgid "" -"sem = asyncio.Semaphore(10)\n" -"\n" -"# ... later\n" -"async with sem:\n" -" # work with shared resource" -msgstr "" - -#: ../../library/asyncio-sync.rst:311 -msgid "" -"sem = asyncio.Semaphore(10)\n" -"\n" -"# ... later\n" -"await sem.acquire()\n" -"try:\n" -" # work with shared resource\n" -"finally:\n" -" sem.release()" -msgstr "" - -#: ../../library/asyncio-sync.rst:323 +#: ../../library/asyncio-sync.rst:313 msgid "Acquire a semaphore." msgstr "セマフォを獲得します。" -#: ../../library/asyncio-sync.rst:325 +#: ../../library/asyncio-sync.rst:315 msgid "" "If the internal counter is greater than zero, decrement it by one and return " "``True`` immediately. If it is zero, wait until a :meth:`release` is called " @@ -516,11 +420,11 @@ msgstr "" "返します。内部カウンターがゼロの場合、 :meth:`release` が呼び出されるまで待機" "してから ``True`` を返します。" -#: ../../library/asyncio-sync.rst:331 +#: ../../library/asyncio-sync.rst:321 msgid "Returns ``True`` if semaphore can not be acquired immediately." msgstr "セマフォを直ちに獲得できない場合 ``True`` を返します。" -#: ../../library/asyncio-sync.rst:335 +#: ../../library/asyncio-sync.rst:325 msgid "" "Release a semaphore, incrementing the internal counter by one. Can wake up a " "task waiting to acquire the semaphore." @@ -528,7 +432,7 @@ msgstr "" "セマフォを解放し、内部カウンターを1つ加算します。セマフォ待ちをしているタスク" "を起動する可能性があります。" -#: ../../library/asyncio-sync.rst:338 +#: ../../library/asyncio-sync.rst:328 msgid "" "Unlike :class:`BoundedSemaphore`, :class:`Semaphore` allows making more " "``release()`` calls than ``acquire()`` calls." @@ -536,15 +440,15 @@ msgstr "" ":class:`BoundedSemaphore` と異なり、 :class:`Semaphore` は ``release()`` を " "``acquire()`` よりも多く呼び出すことを許容します。" -#: ../../library/asyncio-sync.rst:343 +#: ../../library/asyncio-sync.rst:333 msgid "BoundedSemaphore" msgstr "BoundedSemaphore" -#: ../../library/asyncio-sync.rst:347 +#: ../../library/asyncio-sync.rst:337 msgid "A bounded semaphore object. Not thread-safe." msgstr "有限セマフォオブジェクトです。スレッドセーフではありません。" -#: ../../library/asyncio-sync.rst:349 +#: ../../library/asyncio-sync.rst:339 msgid "" "Bounded Semaphore is a version of :class:`Semaphore` that raises a :exc:" "`ValueError` in :meth:`~Semaphore.release` if it increases the internal " @@ -554,146 +458,7 @@ msgstr "" "ソッドの呼び出しにより内部カウンターが *初期値* よりも増加してしまう場合は :" "exc:`ValueError` 例外を送出します。" -#: ../../library/asyncio-sync.rst:358 -msgid "Barrier" -msgstr "" - -#: ../../library/asyncio-sync.rst:362 -msgid "A barrier object. Not thread-safe." -msgstr "" - -#: ../../library/asyncio-sync.rst:364 -msgid "" -"A barrier is a simple synchronization primitive that allows to block until " -"*parties* number of tasks are waiting on it. Tasks can wait on the :meth:" -"`~Barrier.wait` method and would be blocked until the specified number of " -"tasks end up waiting on :meth:`~Barrier.wait`. At that point all of the " -"waiting tasks would unblock simultaneously." -msgstr "" - -#: ../../library/asyncio-sync.rst:370 -msgid "" -":keyword:`async with` can be used as an alternative to awaiting on :meth:" -"`~Barrier.wait`." -msgstr "" - -#: ../../library/asyncio-sync.rst:373 -msgid "The barrier can be reused any number of times." -msgstr "" - -#: ../../library/asyncio-sync.rst:379 -msgid "" -"async def example_barrier():\n" -" # barrier with 3 parties\n" -" b = asyncio.Barrier(3)\n" -"\n" -" # create 2 new waiting tasks\n" -" asyncio.create_task(b.wait())\n" -" asyncio.create_task(b.wait())\n" -"\n" -" await asyncio.sleep(0)\n" -" print(b)\n" -"\n" -" # The third .wait() call passes the barrier\n" -" await b.wait()\n" -" print(b)\n" -" print(\"barrier passed\")\n" -"\n" -" await asyncio.sleep(0)\n" -" print(b)\n" -"\n" -"asyncio.run(example_barrier())" -msgstr "" - -#: ../../library/asyncio-sync.rst:400 -msgid "Result of this example is::" -msgstr "" - -#: ../../library/asyncio-sync.rst:402 -msgid "" -"\n" -"\n" -"barrier passed\n" -"" -msgstr "" - -#: ../../library/asyncio-sync.rst:412 -msgid "" -"Pass the barrier. When all the tasks party to the barrier have called this " -"function, they are all unblocked simultaneously." -msgstr "" - -#: ../../library/asyncio-sync.rst:415 -msgid "" -"When a waiting or blocked task in the barrier is cancelled, this task exits " -"the barrier which stays in the same state. If the state of the barrier is " -"\"filling\", the number of waiting task decreases by 1." -msgstr "" - -#: ../../library/asyncio-sync.rst:420 -msgid "" -"The return value is an integer in the range of 0 to ``parties-1``, different " -"for each task. This can be used to select a task to do some special " -"housekeeping, e.g.::" -msgstr "" - -#: ../../library/asyncio-sync.rst:424 -msgid "" -"...\n" -"async with barrier as position:\n" -" if position == 0:\n" -" # Only one task prints this\n" -" print('End of *draining phase*')" -msgstr "" - -#: ../../library/asyncio-sync.rst:430 -msgid "" -"This method may raise a :class:`BrokenBarrierError` exception if the barrier " -"is broken or reset while a task is waiting. It could raise a :exc:" -"`CancelledError` if a task is cancelled." -msgstr "" - -#: ../../library/asyncio-sync.rst:437 -msgid "" -"Return the barrier to the default, empty state. Any tasks waiting on it " -"will receive the :class:`BrokenBarrierError` exception." -msgstr "" - -#: ../../library/asyncio-sync.rst:440 -msgid "" -"If a barrier is broken it may be better to just leave it and create a new " -"one." -msgstr "" - -#: ../../library/asyncio-sync.rst:445 -msgid "" -"Put the barrier into a broken state. This causes any active or future calls " -"to :meth:`~Barrier.wait` to fail with the :class:`BrokenBarrierError`. Use " -"this for example if one of the tasks needs to abort, to avoid infinite " -"waiting tasks." -msgstr "" - -#: ../../library/asyncio-sync.rst:452 -msgid "The number of tasks required to pass the barrier." -msgstr "" - -#: ../../library/asyncio-sync.rst:456 -msgid "The number of tasks currently waiting in the barrier while filling." -msgstr "" - -#: ../../library/asyncio-sync.rst:460 -msgid "A boolean that is ``True`` if the barrier is in the broken state." -msgstr "バリアが broken な状態である場合に ``True`` となるブール値。" - -#: ../../library/asyncio-sync.rst:465 -msgid "" -"This exception, a subclass of :exc:`RuntimeError`, is raised when the :class:" -"`Barrier` object is reset or broken." -msgstr "" -":class:`Barrier` オブジェクトがリセットされるか broken な場合に、この例外 (:" -"exc:`RuntimeError` のサブクラス) が送出されます。" - -#: ../../library/asyncio-sync.rst:473 +#: ../../library/asyncio-sync.rst:352 msgid "" "Acquiring a lock using ``await lock`` or ``yield from lock`` and/or :keyword:" "`with` statement (``with await lock``, ``with (yield from lock)``) was " diff --git a/library/asyncio-task.po b/library/asyncio-task.po index 8df1570ef..a386ee46e 100644 --- a/library/asyncio-task.po +++ b/library/asyncio-task.po @@ -1,32 +1,33 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Atsuo Ishimoto , 2021 -# Yuto Oguchi, 2021 -# souma987, 2022 -# Tetsuo Koyama , 2022 -# 菊池 健志, 2023 -# Arihiro TAKASE, 2023 -# Takeshi Nakazato, 2023 -# tomo, 2024 +# 秘湯 , 2017 +# Yusuke Miyazaki , 2017 +# Arihiro TAKASE, 2017 +# E. Kawashima, 2017 +# Masato HASHIMOTO , 2018 +# SHIMIZU Taku , 2019 +# Yuto , 2019 +# Naoki Nakamura , 2020 +# tomo, 2020 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-06 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:55+0000\n" -"Last-Translator: tomo, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-05-19 06:27+0000\n" +"PO-Revision-Date: 2017-02-16 17:49+0000\n" +"Last-Translator: tomo, 2020\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/asyncio-task.rst:6 @@ -41,58 +42,35 @@ msgstr "" "この節では、コルーチンと Task を利用する高レベルの asyncio の API の概略を解" "説します。" -#: ../../library/asyncio-task.rst:19 ../../library/asyncio-task.rst:148 +#: ../../library/asyncio-task.rst:19 ../../library/asyncio-task.rst:121 msgid "Coroutines" msgstr "コルーチン" #: ../../library/asyncio-task.rst:21 -msgid "**Source code:** :source:`Lib/asyncio/coroutines.py`" -msgstr "" - -#: ../../library/asyncio-task.rst:25 msgid "" ":term:`Coroutines ` declared with the async/await syntax is the " "preferred way of writing asyncio applications. For example, the following " -"snippet of code prints \"hello\", waits 1 second, and then prints \"world\"::" +"snippet of code (requires Python 3.7+) prints \"hello\", waits 1 second, and " +"then prints \"world\"::" msgstr "" "async/await 構文で宣言された :term:`コルーチン ` は、 asyncio を" "使ったアプリケーションを書くのに推奨される方法です。例えば、次のコードスニ" -"ペットは \"hello\" を出力し、そこから 1 秒待って \"world\" を出力します:: " - -#: ../../library/asyncio-task.rst:30 -msgid "" -">>> import asyncio\n" -"\n" -">>> async def main():\n" -"... print('hello')\n" -"... await asyncio.sleep(1)\n" -"... print('world')\n" -"\n" -">>> asyncio.run(main())\n" -"hello\n" -"world" -msgstr "" +"ペット (Python 3.7 以降が必要) は \"hello\" を出力し、そこから 1 秒待って " +"\"world\" を出力します:: " -#: ../../library/asyncio-task.rst:41 +#: ../../library/asyncio-task.rst:37 msgid "" "Note that simply calling a coroutine will not schedule it to be executed::" msgstr "" "単にコルーチンを呼び出しただけでは、コルーチンの実行スケジュールは予約されて" "いないことに注意してください::" -#: ../../library/asyncio-task.rst:44 -msgid "" -">>> main()\n" -"" -msgstr "" - -#: ../../library/asyncio-task.rst:47 -msgid "To actually run a coroutine, asyncio provides the following mechanisms:" +#: ../../library/asyncio-task.rst:43 +msgid "To actually run a coroutine, asyncio provides three main mechanisms:" msgstr "" -"実際にコルーチンを実行するために、asyncio は以下のメカニズムを提供していま" -"す::" +"実際にコルーチンを走らせるために、 asyncio は3つの機構を提供しています:" -#: ../../library/asyncio-task.rst:49 +#: ../../library/asyncio-task.rst:45 msgid "" "The :func:`asyncio.run` function to run the top-level entry point \"main()\" " "function (see the above example.)" @@ -100,7 +78,7 @@ msgstr "" "最上位のエントリーポイントである \"main()\" 関数を実行する :func:`asyncio." "run` 関数 (上の例を参照してください。)" -#: ../../library/asyncio-task.rst:52 +#: ../../library/asyncio-task.rst:48 msgid "" "Awaiting on a coroutine. The following snippet of code will print \"hello\" " "after waiting for 1 second, and then print \"world\" after waiting for " @@ -109,39 +87,11 @@ msgstr "" "コルーチンを await すること。次のコード片は 1 秒間待機した後に \"hello\" と出" "力し、 *更に* 2 秒間待機してから \"world\" と出力します::" -#: ../../library/asyncio-task.rst:56 -msgid "" -"import asyncio\n" -"import time\n" -"\n" -"async def say_after(delay, what):\n" -" await asyncio.sleep(delay)\n" -" print(what)\n" -"\n" -"async def main():\n" -" print(f\"started at {time.strftime('%X')}\")\n" -"\n" -" await say_after(1, 'hello')\n" -" await say_after(2, 'world')\n" -"\n" -" print(f\"finished at {time.strftime('%X')}\")\n" -"\n" -"asyncio.run(main())" -msgstr "" - -#: ../../library/asyncio-task.rst:73 +#: ../../library/asyncio-task.rst:69 msgid "Expected output::" msgstr "予想される出力::" -#: ../../library/asyncio-task.rst:75 -msgid "" -"started at 17:13:52\n" -"hello\n" -"world\n" -"finished at 17:13:55" -msgstr "" - -#: ../../library/asyncio-task.rst:80 +#: ../../library/asyncio-task.rst:76 msgid "" "The :func:`asyncio.create_task` function to run coroutines concurrently as " "asyncio :class:`Tasks `." @@ -149,7 +99,7 @@ msgstr "" "asyncio の :class:`Tasks ` としてコルーチンを並行して走らせる :func:" "`asyncio.create_task` 関数。" -#: ../../library/asyncio-task.rst:83 +#: ../../library/asyncio-task.rst:79 msgid "" "Let's modify the above example and run two ``say_after`` coroutines " "*concurrently*::" @@ -157,26 +107,7 @@ msgstr "" "上のコード例を編集して、ふたつの ``say_after`` コルーチンを *並行して* 走らせ" "てみましょう::" -#: ../../library/asyncio-task.rst:86 -msgid "" -"async def main():\n" -" task1 = asyncio.create_task(\n" -" say_after(1, 'hello'))\n" -"\n" -" task2 = asyncio.create_task(\n" -" say_after(2, 'world'))\n" -"\n" -" print(f\"started at {time.strftime('%X')}\")\n" -"\n" -" # Wait until both tasks are completed (should take\n" -" # around 2 seconds.)\n" -" await task1\n" -" await task2\n" -"\n" -" print(f\"finished at {time.strftime('%X')}\")" -msgstr "" - -#: ../../library/asyncio-task.rst:102 +#: ../../library/asyncio-task.rst:98 msgid "" "Note that expected output now shows that the snippet runs 1 second faster " "than before::" @@ -184,50 +115,11 @@ msgstr "" "予想される出力が、スニペットの実行が前回よりも 1 秒早いことを示していることに" "注意してください::" -#: ../../library/asyncio-task.rst:105 -msgid "" -"started at 17:14:32\n" -"hello\n" -"world\n" -"finished at 17:14:34" -msgstr "" - #: ../../library/asyncio-task.rst:110 -msgid "" -"The :class:`asyncio.TaskGroup` class provides a more modern alternative to :" -"func:`create_task`. Using this API, the last example becomes::" -msgstr "" - -#: ../../library/asyncio-task.rst:114 -msgid "" -"async def main():\n" -" async with asyncio.TaskGroup() as tg:\n" -" task1 = tg.create_task(\n" -" say_after(1, 'hello'))\n" -"\n" -" task2 = tg.create_task(\n" -" say_after(2, 'world'))\n" -"\n" -" print(f\"started at {time.strftime('%X')}\")\n" -"\n" -" # The await is implicit when the context manager exits.\n" -"\n" -" print(f\"finished at {time.strftime('%X')}\")" -msgstr "" - -#: ../../library/asyncio-task.rst:128 -msgid "The timing and output should be the same as for the previous version." -msgstr "" - -#: ../../library/asyncio-task.rst:130 -msgid ":class:`asyncio.TaskGroup`." -msgstr ":class:`asyncio.TaskGroup`." - -#: ../../library/asyncio-task.rst:137 msgid "Awaitables" msgstr "Awaitable" -#: ../../library/asyncio-task.rst:139 +#: ../../library/asyncio-task.rst:112 msgid "" "We say that an object is an **awaitable** object if it can be used in an :" "keyword:`await` expression. Many asyncio APIs are designed to accept " @@ -237,7 +129,7 @@ msgstr "" "ジェクトを **awaitable** オブジェクトと言います。多くの asyncio API は " "awaitable を受け取るように設計されています。" -#: ../../library/asyncio-task.rst:143 +#: ../../library/asyncio-task.rst:116 msgid "" "There are three main types of *awaitable* objects: **coroutines**, " "**Tasks**, and **Futures**." @@ -245,34 +137,15 @@ msgstr "" "*awaitable* オブジェクトには主に3つの種類があります: **コルーチン**, " "**Task**, そして **Future** です" -#: ../../library/asyncio-task.rst:149 +#: ../../library/asyncio-task.rst:122 msgid "" "Python coroutines are *awaitables* and therefore can be awaited from other " "coroutines::" msgstr "" -"Python のコルーチンは *awaitable* であり、他のコルーチンから待機されることが" -"できます::" - -#: ../../library/asyncio-task.rst:152 -msgid "" -"import asyncio\n" -"\n" -"async def nested():\n" -" return 42\n" -"\n" -"async def main():\n" -" # Nothing happens if we just call \"nested()\".\n" -" # A coroutine object is created but not awaited,\n" -" # so it *won't run at all*.\n" -" nested() # will raise a \"RuntimeWarning\".\n" -"\n" -" # Let's do it differently now and await it:\n" -" print(await nested()) # will print \"42\".\n" -"\n" -"asyncio.run(main())" -msgstr "" +"Python のコルーチンは *awaitable* であり、そのため他のコルーチンを待機させら" +"れます::" -#: ../../library/asyncio-task.rst:170 +#: ../../library/asyncio-task.rst:143 msgid "" "In this documentation the term \"coroutine\" can be used for two closely " "related concepts:" @@ -280,26 +153,34 @@ msgstr "" "このドキュメントにおいて「コルーチン」という用語は以下2つの密接に関連した概念" "に対して使用できます:" -#: ../../library/asyncio-task.rst:173 +#: ../../library/asyncio-task.rst:146 msgid "a *coroutine function*: an :keyword:`async def` function;" msgstr "*コルーチン関数*: :keyword:`async def` 関数;" -#: ../../library/asyncio-task.rst:175 +#: ../../library/asyncio-task.rst:148 msgid "" "a *coroutine object*: an object returned by calling a *coroutine function*." msgstr "" "*コルーチンオブジェクト*: *コルーチン関数* を呼び出すと返ってくるオブジェク" "ト." -#: ../../library/asyncio-task.rst:180 +#: ../../library/asyncio-task.rst:151 +msgid "" +"asyncio also supports legacy :ref:`generator-based " +"` coroutines." +msgstr "" +"asyncio は、古くからある :ref:`ジェネレータベース " +"` のコルーチンもサポートしています。" + +#: ../../library/asyncio-task.rst:156 msgid "Tasks" msgstr "Task" -#: ../../library/asyncio-task.rst:181 +#: ../../library/asyncio-task.rst:157 msgid "*Tasks* are used to schedule coroutines *concurrently*." msgstr "*Task* は、コルーチンを *並行に* スケジュールするのに使います。" -#: ../../library/asyncio-task.rst:183 +#: ../../library/asyncio-task.rst:159 msgid "" "When a coroutine is wrapped into a *Task* with functions like :func:`asyncio." "create_task` the coroutine is automatically scheduled to run soon::" @@ -307,30 +188,11 @@ msgstr "" ":func:`asyncio.create_task` のような関数で、コルーチンが *Task* にラップされ" "ているとき、自動的にコルーチンは即時実行されるようにスケジュールされます::" -#: ../../library/asyncio-task.rst:187 -msgid "" -"import asyncio\n" -"\n" -"async def nested():\n" -" return 42\n" -"\n" -"async def main():\n" -" # Schedule nested() to run soon concurrently\n" -" # with \"main()\".\n" -" task = asyncio.create_task(nested())\n" -"\n" -" # \"task\" can now be used to cancel \"nested()\", or\n" -" # can simply be awaited to wait until it is complete:\n" -" await task\n" -"\n" -"asyncio.run(main())" -msgstr "" - -#: ../../library/asyncio-task.rst:205 +#: ../../library/asyncio-task.rst:181 msgid "Futures" msgstr "Future" -#: ../../library/asyncio-task.rst:206 +#: ../../library/asyncio-task.rst:182 msgid "" "A :class:`Future` is a special **low-level** awaitable object that " "represents an **eventual result** of an asynchronous operation." @@ -338,15 +200,15 @@ msgstr "" ":class:`Future` は、非同期処理の **最終結果** を表現する特別な **低レベルの" "** awaitable オブジェクトです。" -#: ../../library/asyncio-task.rst:209 +#: ../../library/asyncio-task.rst:185 msgid "" "When a Future object is *awaited* it means that the coroutine will wait " "until the Future is resolved in some other place." msgstr "" -"Future オブジェクトが *待機 (await) されている* とは、Future がどこか他の場所" -"で解決されるまでコルーチンが待機するということです。" +"Future オブジェクトが他の awaitable を *待機させている* と言うときは、ある場" +"所で Future が解決されるまでコルーチンが待機するということです。" -#: ../../library/asyncio-task.rst:212 +#: ../../library/asyncio-task.rst:188 msgid "" "Future objects in asyncio are needed to allow callback-based code to be used " "with async/await." @@ -354,7 +216,7 @@ msgstr "" "asyncioのFutureオブジェクトを使うと、async/awaitとコールバック形式のコードを" "併用できます。" -#: ../../library/asyncio-task.rst:215 +#: ../../library/asyncio-task.rst:191 msgid "" "Normally **there is no need** to create Future objects at the application " "level code." @@ -362,27 +224,15 @@ msgstr "" "通常、アプリケーション水準のコードで Future オブジェクトを作る **必要はありま" "せん** 。" -#: ../../library/asyncio-task.rst:218 +#: ../../library/asyncio-task.rst:194 msgid "" "Future objects, sometimes exposed by libraries and some asyncio APIs, can be " "awaited::" msgstr "" -"Future オブジェクトはライブラリや asyncio のAPIで外部に提供されることもあり、" -"await (待機)されることができます::" - -#: ../../library/asyncio-task.rst:221 -msgid "" -"async def main():\n" -" await function_that_returns_a_future_object()\n" -"\n" -" # this is also valid:\n" -" await asyncio.gather(\n" -" function_that_returns_a_future_object(),\n" -" some_python_coroutine()\n" -" )" -msgstr "" +"Future オブジェクトはライブラリや asyncio の API で表に出ることもあり、他の " +"awaitable を待機させられます::" -#: ../../library/asyncio-task.rst:230 +#: ../../library/asyncio-task.rst:206 msgid "" "A good example of a low-level function that returns a Future object is :meth:" "`loop.run_in_executor`." @@ -390,331 +240,116 @@ msgstr "" "Future オブジェクトを返す低レベル関数の良い例は :meth:`loop.run_in_executor` " "です。" -#: ../../library/asyncio-task.rst:235 -msgid "Creating Tasks" -msgstr "Task の作成" - -#: ../../library/asyncio-task.rst:237 -msgid "**Source code:** :source:`Lib/asyncio/tasks.py`" -msgstr "**ソースコード:** :source:`Lib/asyncio/tasks.py`" - -#: ../../library/asyncio-task.rst:243 -msgid "" -"Wrap the *coro* :ref:`coroutine ` into a :class:`Task` and " -"schedule its execution. Return the Task object." -msgstr "" -"*coro* :ref:`coroutine ` を :class:`Task` でラップし、その実行をス" -"ケジュールします。\n" -"Task オブジェクトを返します。" - -#: ../../library/asyncio-task.rst:246 -msgid "" -"The full function signature is largely the same as that of the :class:`Task` " -"constructor (or factory) - all of the keyword arguments to this function are " -"passed through to that interface." -msgstr "" - -#: ../../library/asyncio-task.rst:250 -msgid "" -"An optional keyword-only *context* argument allows specifying a custom :" -"class:`contextvars.Context` for the *coro* to run in. The current context " -"copy is created when no *context* is provided." -msgstr "" -"省略可能なキーワード引数 *context* によって、*coro* を実行するためのカスタム" -"の :class:`contextvars.Context` を指定できます。*context* が省略された場合、" -"現在のコンテキストのコピーが作成されます。" +#: ../../library/asyncio-task.rst:211 +msgid "Running an asyncio Program" +msgstr "非同期プログラムの実行" -#: ../../library/asyncio-task.rst:254 -msgid "" -"An optional keyword-only *eager_start* argument allows specifying if the " -"task should execute eagerly during the call to create_task, or be scheduled " -"later. If *eager_start* is not passed the mode set by :meth:`loop." -"set_task_factory` will be used." -msgstr "" - -#: ../../library/asyncio-task.rst:259 -msgid "" -"The task is executed in the loop returned by :func:`get_running_loop`, :exc:" -"`RuntimeError` is raised if there is no running loop in current thread." -msgstr "" -"その Task オブジェクトは :func:`get_running_loop` から返されたループの中で実" -"行されます。現在のスレッドに実行中のループが無い場合は、 :exc:`RuntimeError` " -"が送出されます。" - -#: ../../library/asyncio-task.rst:265 -msgid "" -":meth:`asyncio.TaskGroup.create_task` is a new alternative leveraging " -"structural concurrency; it allows for waiting for a group of related tasks " -"with strong safety guarantees." -msgstr "" - -#: ../../library/asyncio-task.rst:271 -msgid "" -"Save a reference to the result of this function, to avoid a task " -"disappearing mid-execution. The event loop only keeps weak references to " -"tasks. A task that isn't referenced elsewhere may get garbage collected at " -"any time, even before it's done. For reliable \"fire-and-forget\" background " -"tasks, gather them in a collection::" -msgstr "" -"タスクが実行中に消えないように、この関数の結果の参照を保存してください。イベ" -"ントループは弱い参照のみを保持します。ほかに参照元のないタスクは、完了してい" -"なくてもガーベジコレクションされる可能性があります。信頼性のある \"fire-and-" -"forget\" バックグラウンドタスクが必要な場合、コレクションを使ってください。" - -#: ../../library/asyncio-task.rst:278 -msgid "" -"background_tasks = set()\n" -"\n" -"for i in range(10):\n" -" task = asyncio.create_task(some_coro(param=i))\n" -"\n" -" # Add task to the set. This creates a strong reference.\n" -" background_tasks.add(task)\n" -"\n" -" # To prevent keeping references to finished tasks forever,\n" -" # make each task remove its own reference from the set after\n" -" # completion:\n" -" task.add_done_callback(background_tasks.discard)" -msgstr "" - -#: ../../library/asyncio-task.rst:293 ../../library/asyncio-task.rst:1250 -msgid "Added the *name* parameter." -msgstr "*name* パラメータを追加しました。" - -#: ../../library/asyncio-task.rst:296 ../../library/asyncio-task.rst:1257 -msgid "Added the *context* parameter." -msgstr "*context* パラメータを追加しました。" - -#: ../../library/asyncio-task.rst:299 -msgid "Added the *eager_start* parameter by passing on all *kwargs*." -msgstr "" - -#: ../../library/asyncio-task.rst:304 -msgid "Task Cancellation" -msgstr "タスクのキャンセル" - -#: ../../library/asyncio-task.rst:306 -msgid "" -"Tasks can easily and safely be cancelled. When a task is cancelled, :exc:" -"`asyncio.CancelledError` will be raised in the task at the next opportunity." -msgstr "" -"タスクは簡単に、そして安全にキャンセルできます。タスクがキャンセルされた場" -"合、:exc:`asyncio.CancelledError` が次の機会に送出されます。" - -#: ../../library/asyncio-task.rst:310 -msgid "" -"It is recommended that coroutines use ``try/finally`` blocks to robustly " -"perform clean-up logic. In case :exc:`asyncio.CancelledError` is explicitly " -"caught, it should generally be propagated when clean-up is complete. :exc:" -"`asyncio.CancelledError` directly subclasses :exc:`BaseException` so most " -"code will not need to be aware of it." -msgstr "" +#: ../../library/asyncio-task.rst:215 +msgid "Execute the :term:`coroutine` *coro* and return the result." +msgstr ":term:`coroutine` *coro* を実行し、結果を返します。" -#: ../../library/asyncio-task.rst:316 +#: ../../library/asyncio-task.rst:217 msgid "" -"The asyncio components that enable structured concurrency, like :class:" -"`asyncio.TaskGroup` and :func:`asyncio.timeout`, are implemented using " -"cancellation internally and might misbehave if a coroutine swallows :exc:" -"`asyncio.CancelledError`. Similarly, user code should not generally call :" -"meth:`uncancel `. However, in cases when suppressing :" -"exc:`asyncio.CancelledError` is truly desired, it is necessary to also call " -"``uncancel()`` to completely remove the cancellation state." -msgstr "" - -#: ../../library/asyncio-task.rst:328 -msgid "Task Groups" +"This function runs the passed coroutine, taking care of managing the asyncio " +"event loop, *finalizing asynchronous generators*, and closing the threadpool." msgstr "" +"この関数は、非同期イベントループの管理と *非同期ジェネレータの終了処理* およ" +"びスレッドプールのクローズ処理を行いながら、渡されたコルーチンを実行します。" -#: ../../library/asyncio-task.rst:330 +#: ../../library/asyncio-task.rst:221 msgid "" -"Task groups combine a task creation API with a convenient and reliable way " -"to wait for all tasks in the group to finish." +"This function cannot be called when another asyncio event loop is running in " +"the same thread." msgstr "" +"この関数は、同じスレッドで他の非同期イベントループが実行中のときは呼び出せま" +"せん。" -#: ../../library/asyncio-task.rst:335 -msgid "" -"An :ref:`asynchronous context manager ` holding a " -"group of tasks. Tasks can be added to the group using :meth:`create_task`. " -"All tasks are awaited when the context manager exits." +#: ../../library/asyncio-task.rst:224 +msgid "If *debug* is ``True``, the event loop will be run in debug mode." msgstr "" +"*debug* が ``True`` の場合、イベントループはデバッグモードで実行されます。" -#: ../../library/asyncio-task.rst:344 +#: ../../library/asyncio-task.rst:226 msgid "" -"Create a task in this task group. The signature matches that of :func:" -"`asyncio.create_task`. If the task group is inactive (e.g. not yet entered, " -"already finished, or in the process of shutting down), we will close the " -"given ``coro``." +"This function always creates a new event loop and closes it at the end. It " +"should be used as a main entry point for asyncio programs, and should " +"ideally only be called once." msgstr "" +"この関数は常に新しいイベントループを作成し、終了したらそのイベントループを閉" +"じます。\n" +"この関数は非同期プログラムのメインのエントリーポイントとして使われるべきで、" +"理想的には 1 回だけ呼び出されるべきです。" -#: ../../library/asyncio-task.rst:352 -msgid "Close the given coroutine if the task group is not active." -msgstr "" - -#: ../../library/asyncio-task.rst:356 -msgid "Passes on all *kwargs* to :meth:`loop.create_task`" -msgstr "" - -#: ../../library/asyncio-task.rst:358 ../../library/asyncio-task.rst:564 -#: ../../library/asyncio-task.rst:737 ../../library/asyncio-task.rst:795 -#: ../../library/asyncio-task.rst:821 ../../library/asyncio-task.rst:862 +#: ../../library/asyncio-task.rst:230 ../../library/asyncio-task.rst:360 +#: ../../library/asyncio-task.rst:481 ../../library/asyncio-task.rst:613 msgid "Example::" msgstr "以下はプログラム例です::" -#: ../../library/asyncio-task.rst:360 -msgid "" -"async def main():\n" -" async with asyncio.TaskGroup() as tg:\n" -" task1 = tg.create_task(some_coro(...))\n" -" task2 = tg.create_task(another_coro(...))\n" -" print(f\"Both tasks have completed now: {task1.result()}, {task2." -"result()}\")" +#: ../../library/asyncio-task.rst:240 +msgid "Updated to use :meth:`loop.shutdown_default_executor`." msgstr "" +":meth:`loop.shutdown_default_executor` メソッドを使うように更新されました。" -#: ../../library/asyncio-task.rst:366 +#: ../../library/asyncio-task.rst:244 msgid "" -"The ``async with`` statement will wait for all tasks in the group to finish. " -"While waiting, new tasks may still be added to the group (for example, by " -"passing ``tg`` into one of the coroutines and calling ``tg.create_task()`` " -"in that coroutine). Once the last task has finished and the ``async with`` " -"block is exited, no new tasks may be added to the group." -msgstr "" - -#: ../../library/asyncio-task.rst:373 -msgid "" -"The first time any of the tasks belonging to the group fails with an " -"exception other than :exc:`asyncio.CancelledError`, the remaining tasks in " -"the group are cancelled. No further tasks can then be added to the group. At " -"this point, if the body of the ``async with`` statement is still active (i." -"e., :meth:`~object.__aexit__` hasn't been called yet), the task directly " -"containing the ``async with`` statement is also cancelled. The resulting :" -"exc:`asyncio.CancelledError` will interrupt an ``await``, but it will not " -"bubble out of the containing ``async with`` statement." -msgstr "" - -#: ../../library/asyncio-task.rst:383 -msgid "" -"Once all tasks have finished, if any tasks have failed with an exception " -"other than :exc:`asyncio.CancelledError`, those exceptions are combined in " -"an :exc:`ExceptionGroup` or :exc:`BaseExceptionGroup` (as appropriate; see " -"their documentation) which is then raised." -msgstr "" - -#: ../../library/asyncio-task.rst:390 -msgid "" -"Two base exceptions are treated specially: If any task fails with :exc:" -"`KeyboardInterrupt` or :exc:`SystemExit`, the task group still cancels the " -"remaining tasks and waits for them, but then the initial :exc:" -"`KeyboardInterrupt` or :exc:`SystemExit` is re-raised instead of :exc:" -"`ExceptionGroup` or :exc:`BaseExceptionGroup`." +"The source code for ``asyncio.run()`` can be found in :source:`Lib/asyncio/" +"runners.py`." msgstr "" +"``asyncio.run()`` のソースコードは :source:`Lib/asyncio/runners.py` にありま" +"す。" -#: ../../library/asyncio-task.rst:396 -msgid "" -"If the body of the ``async with`` statement exits with an exception (so :" -"meth:`~object.__aexit__` is called with an exception set), this is treated " -"the same as if one of the tasks failed: the remaining tasks are cancelled " -"and then waited for, and non-cancellation exceptions are grouped into an " -"exception group and raised. The exception passed into :meth:`~object." -"__aexit__`, unless it is :exc:`asyncio.CancelledError`, is also included in " -"the exception group. The same special case is made for :exc:" -"`KeyboardInterrupt` and :exc:`SystemExit` as in the previous paragraph." -msgstr "" +#: ../../library/asyncio-task.rst:248 +msgid "Creating Tasks" +msgstr "Task の作成" -#: ../../library/asyncio-task.rst:408 +#: ../../library/asyncio-task.rst:252 msgid "" -"Task groups are careful not to mix up the internal cancellation used to " -"\"wake up\" their :meth:`~object.__aexit__` with cancellation requests for " -"the task in which they are running made by other parties. In particular, " -"when one task group is syntactically nested in another, and both experience " -"an exception in one of their child tasks simultaneously, the inner task " -"group will process its exceptions, and then the outer task group will " -"receive another cancellation and process its own exceptions." +"Wrap the *coro* :ref:`coroutine ` into a :class:`Task` and " +"schedule its execution. Return the Task object." msgstr "" +"*coro* :ref:`coroutine ` を :class:`Task` でラップし、その実行をス" +"ケジュールします。\n" +"Task オブジェクトを返します。" -#: ../../library/asyncio-task.rst:416 +#: ../../library/asyncio-task.rst:255 msgid "" -"In the case where a task group is cancelled externally and also must raise " -"an :exc:`ExceptionGroup`, it will call the parent task's :meth:`~asyncio." -"Task.cancel` method. This ensures that a :exc:`asyncio.CancelledError` will " -"be raised at the next :keyword:`await`, so the cancellation is not lost." +"If *name* is not ``None``, it is set as the name of the task using :meth:" +"`Task.set_name`." msgstr "" +"もし *name* が ``None`` でない場合、:meth:`Task.set_name` を使用し、*name* が" +"タスクの名前として設定されます。" -#: ../../library/asyncio-task.rst:422 +#: ../../library/asyncio-task.rst:258 msgid "" -"Task groups preserve the cancellation count reported by :meth:`asyncio.Task." -"cancelling`." +"The task is executed in the loop returned by :func:`get_running_loop`, :exc:" +"`RuntimeError` is raised if there is no running loop in current thread." msgstr "" +"その Task オブジェクトは :func:`get_running_loop` から返されたループの中で実" +"行されます。現在のスレッドに実行中のループが無い場合は、 :exc:`RuntimeError` " +"が送出されます。" -#: ../../library/asyncio-task.rst:427 +#: ../../library/asyncio-task.rst:262 msgid "" -"Improved handling of simultaneous internal and external cancellations and " -"correct preservation of cancellation counts." -msgstr "" - -#: ../../library/asyncio-task.rst:431 -msgid "Terminating a Task Group" +"This function has been **added in Python 3.7**. Prior to Python 3.7, the " +"low-level :func:`asyncio.ensure_future` function can be used instead::" msgstr "" +"この関数は **Python 3.7 で追加** されました。\n" +"Python 3.7 より前では、代わりに低レベルの :func:`asyncio.ensure_future` 関数" +"が使えます::" -#: ../../library/asyncio-task.rst:433 -msgid "" -"While terminating a task group is not natively supported by the standard " -"library, termination can be achieved by adding an exception-raising task to " -"the task group and ignoring the raised exception:" -msgstr "" +#: ../../library/asyncio-task.rst:279 ../../library/asyncio-task.rst:795 +msgid "Added the ``name`` parameter." +msgstr "``name`` パラメータが追加されました。" -#: ../../library/asyncio-task.rst:437 -msgid "" -"import asyncio\n" -"from asyncio import TaskGroup\n" -"\n" -"class TerminateTaskGroup(Exception):\n" -" \"\"\"Exception raised to terminate a task group.\"\"\"\n" -"\n" -"async def force_terminate_task_group():\n" -" \"\"\"Used to force termination of a task group.\"\"\"\n" -" raise TerminateTaskGroup()\n" -"\n" -"async def job(task_id, sleep_time):\n" -" print(f'Task {task_id}: start')\n" -" await asyncio.sleep(sleep_time)\n" -" print(f'Task {task_id}: done')\n" -"\n" -"async def main():\n" -" try:\n" -" async with TaskGroup() as group:\n" -" # spawn some tasks\n" -" group.create_task(job(1, 0.5))\n" -" group.create_task(job(2, 1.5))\n" -" # sleep for 1 second\n" -" await asyncio.sleep(1)\n" -" # add an exception-raising task to force the group to terminate\n" -" group.create_task(force_terminate_task_group())\n" -" except* TerminateTaskGroup:\n" -" pass\n" -"\n" -"asyncio.run(main())" -msgstr "" - -#: ../../library/asyncio-task.rst:469 -msgid "Expected output:" -msgstr "予想される出力:" - -#: ../../library/asyncio-task.rst:471 -msgid "" -"Task 1: start\n" -"Task 2: start\n" -"Task 1: done" -msgstr "" - -#: ../../library/asyncio-task.rst:478 +#: ../../library/asyncio-task.rst:284 msgid "Sleeping" msgstr "スリープ" -#: ../../library/asyncio-task.rst:483 +#: ../../library/asyncio-task.rst:288 msgid "Block for *delay* seconds." msgstr "*delay* 秒だけ停止します。" -#: ../../library/asyncio-task.rst:485 +#: ../../library/asyncio-task.rst:290 msgid "" "If *result* is provided, it is returned to the caller when the coroutine " "completes." @@ -722,14 +357,14 @@ msgstr "" "*result* が提供されている場合は、コルーチン完了時にそれが呼び出し元に返されま" "す。" -#: ../../library/asyncio-task.rst:488 +#: ../../library/asyncio-task.rst:293 msgid "" "``sleep()`` always suspends the current task, allowing other tasks to run." msgstr "" "``sleep()`` は常に現在の Task を一時中断し、他の Task が実行されるのを許可し" "ます。" -#: ../../library/asyncio-task.rst:491 +#: ../../library/asyncio-task.rst:296 msgid "" "Setting the delay to 0 provides an optimized path to allow other tasks to " "run. This can be used by long-running functions to avoid blocking the event " @@ -739,43 +374,23 @@ msgstr "" "す。この方法は、実行時間の長い関数が、その実行時間全体にわたってイベントルー" "プをブロックしないようにするために利用できます。" -#: ../../library/asyncio-task.rst:497 +#: ../../library/asyncio-task.rst:302 ../../library/asyncio-task.rst:357 +#: ../../library/asyncio-task.rst:447 ../../library/asyncio-task.rst:478 +#: ../../library/asyncio-task.rst:565 ../../library/asyncio-task.rst:612 +#: ../../library/asyncio-task.rst:800 +msgid "The *loop* parameter." +msgstr "*loop* パラメータ。" + +#: ../../library/asyncio-task.rst:305 msgid "" "Example of coroutine displaying the current date every second for 5 seconds::" msgstr "現在の時刻を5秒間、毎秒表示するコルーチンの例::" -#: ../../library/asyncio-task.rst:500 -msgid "" -"import asyncio\n" -"import datetime\n" -"\n" -"async def display_date():\n" -" loop = asyncio.get_running_loop()\n" -" end_time = loop.time() + 5.0\n" -" while True:\n" -" print(datetime.datetime.now())\n" -" if (loop.time() + 1.0) >= end_time:\n" -" break\n" -" await asyncio.sleep(1)\n" -"\n" -"asyncio.run(display_date())" -msgstr "" - -#: ../../library/asyncio-task.rst:515 ../../library/asyncio-task.rst:613 -#: ../../library/asyncio-task.rst:712 ../../library/asyncio-task.rst:887 -#: ../../library/asyncio-task.rst:942 ../../library/asyncio-task.rst:999 -msgid "Removed the *loop* parameter." -msgstr "*loop* パラメータが削除されました。" - -#: ../../library/asyncio-task.rst:518 -msgid "Raises :exc:`ValueError` if *delay* is :data:`~math.nan`." -msgstr "" - -#: ../../library/asyncio-task.rst:523 +#: ../../library/asyncio-task.rst:324 msgid "Running Tasks Concurrently" msgstr "並行な Task 実行" -#: ../../library/asyncio-task.rst:527 +#: ../../library/asyncio-task.rst:328 msgid "" "Run :ref:`awaitable objects ` in the *aws* sequence " "*concurrently*." @@ -783,7 +398,7 @@ msgstr "" "*aws* シーケンスにある :ref:`awaitable オブジェクト ` を " "*並行* 実行します。" -#: ../../library/asyncio-task.rst:530 +#: ../../library/asyncio-task.rst:331 msgid "" "If any awaitable in *aws* is a coroutine, it is automatically scheduled as a " "Task." @@ -791,7 +406,7 @@ msgstr "" "*aws* にある awaitable がコルーチンである場合、自動的に Task としてスケジュー" "ルされます。" -#: ../../library/asyncio-task.rst:533 +#: ../../library/asyncio-task.rst:334 msgid "" "If all awaitables are completed successfully, the result is an aggregate " "list of returned values. The order of result values corresponds to the " @@ -801,7 +416,7 @@ msgstr "" "す。\n" "返り値の順序は、 *aws* での awaitable の順序に相当します。" -#: ../../library/asyncio-task.rst:537 +#: ../../library/asyncio-task.rst:338 msgid "" "If *return_exceptions* is ``False`` (default), the first raised exception is " "immediately propagated to the task that awaits on ``gather()``. Other " @@ -812,7 +427,7 @@ msgstr "" "await しているタスクに対して、最初の例外が直接伝えられます。*aws* に並んでい" "る他の awaitable は、**キャンセルされずに** 引き続いて実行されます。" -#: ../../library/asyncio-task.rst:542 +#: ../../library/asyncio-task.rst:343 msgid "" "If *return_exceptions* is ``True``, exceptions are treated the same as " "successful results, and aggregated in the result list." @@ -820,7 +435,7 @@ msgstr "" "*return_exceptions* が ``True`` だった場合、例外は成功した結果と同じように取" "り扱われ、結果リストに集められます。" -#: ../../library/asyncio-task.rst:545 +#: ../../library/asyncio-task.rst:346 msgid "" "If ``gather()`` is *cancelled*, all submitted awaitables (that have not " "completed yet) are also *cancelled*." @@ -828,7 +443,7 @@ msgstr "" "``gather()`` が *キャンセル* された場合、起動された全ての (未完了の) " "awaitable も *キャンセル* されます。" -#: ../../library/asyncio-task.rst:548 +#: ../../library/asyncio-task.rst:349 msgid "" "If any Task or Future from the *aws* sequence is *cancelled*, it is treated " "as if it raised :exc:`CancelledError` -- the ``gather()`` call is **not** " @@ -841,65 +456,22 @@ msgstr "" "これは、起動された 1 つの Task あるいは Future のキャンセルが、他の Task ある" "いは Future のキャンセルを引き起こすのを避けるためです。" -#: ../../library/asyncio-task.rst:555 -msgid "" -"A new alternative to create and run tasks concurrently and wait for their " -"completion is :class:`asyncio.TaskGroup`. *TaskGroup* provides stronger " -"safety guarantees than *gather* for scheduling a nesting of subtasks: if a " -"task (or a subtask, a task scheduled by a task) raises an exception, " -"*TaskGroup* will, while *gather* will not, cancel the remaining scheduled " -"tasks)." -msgstr "" - -#: ../../library/asyncio-task.rst:566 -msgid "" -"import asyncio\n" -"\n" -"async def factorial(name, number):\n" -" f = 1\n" -" for i in range(2, number + 1):\n" -" print(f\"Task {name}: Compute factorial({number}), currently i={i}..." -"\")\n" -" await asyncio.sleep(1)\n" -" f *= i\n" -" print(f\"Task {name}: factorial({number}) = {f}\")\n" -" return f\n" -"\n" -"async def main():\n" -" # Schedule three calls *concurrently*:\n" -" L = await asyncio.gather(\n" -" factorial(\"A\", 2),\n" -" factorial(\"B\", 3),\n" -" factorial(\"C\", 4),\n" -" )\n" -" print(L)\n" -"\n" -"asyncio.run(main())\n" -"\n" -"# Expected output:\n" -"#\n" -"# Task A: Compute factorial(2), currently i=2...\n" -"# Task B: Compute factorial(3), currently i=2...\n" -"# Task C: Compute factorial(4), currently i=2...\n" -"# Task A: factorial(2) = 2\n" -"# Task B: Compute factorial(3), currently i=3...\n" -"# Task C: Compute factorial(4), currently i=3...\n" -"# Task B: factorial(3) = 6\n" -"# Task C: Compute factorial(4), currently i=4...\n" -"# Task C: factorial(4) = 24\n" -"# [2, 6, 24]" -msgstr "" - -#: ../../library/asyncio-task.rst:602 +#: ../../library/asyncio-task.rst:398 msgid "" -"If *return_exceptions* is false, cancelling gather() after it has been " +"If *return_exceptions* is False, cancelling gather() after it has been " "marked done won't cancel any submitted awaitables. For instance, gather can " "be marked done after propagating an exception to the caller, therefore, " "calling ``gather.cancel()`` after catching an exception (raised by one of " "the awaitables) from gather won't cancel any other awaitables." msgstr "" +"*return_exceptions* が False の場合、いったん完了状態となった gather() をキャ" +"ンセルしても起動された awaitables がキャンセルされないことがあります。例え" +"ば、 gather は例外を呼び出し元に送出したあと完了状態になることがあるため、 " +"(起動した awaitable のいずれかから送出された) gather からの例外をキャッチした" +"後で ``gather.cancel()`` を呼び出しても、他の awaitable がキャンセルされない" +"可能性があります。" -#: ../../library/asyncio-task.rst:609 +#: ../../library/asyncio-task.rst:405 msgid "" "If the *gather* itself is cancelled, the cancellation is propagated " "regardless of *return_exceptions*." @@ -907,72 +479,11 @@ msgstr "" "*gather* 自身がキャンセルされた場合は、 *return_exceptions* の値に関わらず" "キャンセルが伝搬されます。" -#: ../../library/asyncio-task.rst:616 -msgid "" -"Deprecation warning is emitted if no positional arguments are provided or " -"not all positional arguments are Future-like objects and there is no running " -"event loop." -msgstr "" - -#: ../../library/asyncio-task.rst:625 -msgid "Eager Task Factory" -msgstr "" - -#: ../../library/asyncio-task.rst:629 -msgid "A task factory for eager task execution." -msgstr "" - -#: ../../library/asyncio-task.rst:631 -msgid "" -"When using this factory (via :meth:`loop.set_task_factory(asyncio." -"eager_task_factory) `), coroutines begin execution " -"synchronously during :class:`Task` construction. Tasks are only scheduled on " -"the event loop if they block. This can be a performance improvement as the " -"overhead of loop scheduling is avoided for coroutines that complete " -"synchronously." -msgstr "" - -#: ../../library/asyncio-task.rst:637 -msgid "" -"A common example where this is beneficial is coroutines which employ caching " -"or memoization to avoid actual I/O when possible." -msgstr "" - -#: ../../library/asyncio-task.rst:642 -msgid "" -"Immediate execution of the coroutine is a semantic change. If the coroutine " -"returns or raises, the task is never scheduled to the event loop. If the " -"coroutine execution blocks, the task is scheduled to the event loop. This " -"change may introduce behavior changes to existing applications. For example, " -"the application's task execution order is likely to change." -msgstr "" - -#: ../../library/asyncio-task.rst:653 -msgid "" -"Create an eager task factory, similar to :func:`eager_task_factory`, using " -"the provided *custom_task_constructor* when creating a new task instead of " -"the default :class:`Task`." -msgstr "" - -#: ../../library/asyncio-task.rst:657 -msgid "" -"*custom_task_constructor* must be a *callable* with the signature matching " -"the signature of :class:`Task.__init__ `. The callable must return a :" -"class:`asyncio.Task`-compatible object." -msgstr "" - -#: ../../library/asyncio-task.rst:661 -msgid "" -"This function returns a *callable* intended to be used as a task factory of " -"an event loop via :meth:`loop.set_task_factory(factory) `)." -msgstr "" - -#: ../../library/asyncio-task.rst:668 +#: ../../library/asyncio-task.rst:411 msgid "Shielding From Cancellation" msgstr "キャンセルからの保護" -#: ../../library/asyncio-task.rst:672 +#: ../../library/asyncio-task.rst:415 msgid "" "Protect an :ref:`awaitable object ` from being :meth:" "`cancelled `." @@ -980,30 +491,20 @@ msgstr "" ":meth:`キャンセル ` から :ref:`awaitable オブジェクト ` を保護します。" -#: ../../library/asyncio-task.rst:675 ../../library/asyncio-task.rst:842 +#: ../../library/asyncio-task.rst:418 ../../library/asyncio-task.rst:458 msgid "If *aw* is a coroutine it is automatically scheduled as a Task." msgstr "" "*aw* がコルーチンだった場合、自動的に Task としてスケジュールされます。" -#: ../../library/asyncio-task.rst:677 +#: ../../library/asyncio-task.rst:420 msgid "The statement::" msgstr "文::" -#: ../../library/asyncio-task.rst:679 -msgid "" -"task = asyncio.create_task(something())\n" -"res = await shield(task)" -msgstr "" - -#: ../../library/asyncio-task.rst:682 +#: ../../library/asyncio-task.rst:424 msgid "is equivalent to::" msgstr "は、以下と同じです ::" -#: ../../library/asyncio-task.rst:684 -msgid "res = await something()" -msgstr "" - -#: ../../library/asyncio-task.rst:686 +#: ../../library/asyncio-task.rst:428 msgid "" "*except* that if the coroutine containing it is cancelled, the Task running " "in ``something()`` is not cancelled. From the point of view of " @@ -1017,7 +518,7 @@ msgstr "" "呼び出し元がキャンセルされた場合でも、 \"await\" 式は :exc:`CancelledError` " "を送出します。" -#: ../../library/asyncio-task.rst:692 +#: ../../library/asyncio-task.rst:434 msgid "" "If ``something()`` is cancelled by other means (i.e. from within itself) " "that would also cancel ``shield()``." @@ -1025,7 +526,7 @@ msgstr "" "注意: ``something()`` が他の理由 (例えば、原因が自分自身) でキャンセルされた" "場合は ``shield()`` でも保護できません。" -#: ../../library/asyncio-task.rst:695 +#: ../../library/asyncio-task.rst:437 msgid "" "If it is desired to completely ignore cancellation (not recommended) the " "``shield()`` function should be combined with a try/except clause, as " @@ -1034,174 +535,11 @@ msgstr "" "完全にキャンセルを無視したい場合 (推奨はしません) は、 ``shield()`` 関数は次" "のように try/except 節と組み合わせることになるでしょう::" -#: ../../library/asyncio-task.rst:699 -msgid "" -"task = asyncio.create_task(something())\n" -"try:\n" -" res = await shield(task)\n" -"except CancelledError:\n" -" res = None" -msgstr "" - -#: ../../library/asyncio-task.rst:707 -msgid "" -"Save a reference to tasks passed to this function, to avoid a task " -"disappearing mid-execution. The event loop only keeps weak references to " -"tasks. A task that isn't referenced elsewhere may get garbage collected at " -"any time, even before it's done." -msgstr "" - -#: ../../library/asyncio-task.rst:715 -msgid "" -"Deprecation warning is emitted if *aw* is not Future-like object and there " -"is no running event loop." -msgstr "" - -#: ../../library/asyncio-task.rst:721 +#: ../../library/asyncio-task.rst:451 msgid "Timeouts" msgstr "タイムアウト" -#: ../../library/asyncio-task.rst:725 -msgid "" -"Return an :ref:`asynchronous context manager ` that " -"can be used to limit the amount of time spent waiting on something." -msgstr "" - -#: ../../library/asyncio-task.rst:729 -msgid "" -"*delay* can either be ``None``, or a float/int number of seconds to wait. If " -"*delay* is ``None``, no time limit will be applied; this can be useful if " -"the delay is unknown when the context manager is created." -msgstr "" - -#: ../../library/asyncio-task.rst:734 -msgid "" -"In either case, the context manager can be rescheduled after creation using :" -"meth:`Timeout.reschedule`." -msgstr "" - -#: ../../library/asyncio-task.rst:739 -msgid "" -"async def main():\n" -" async with asyncio.timeout(10):\n" -" await long_running_task()" -msgstr "" - -#: ../../library/asyncio-task.rst:743 -msgid "" -"If ``long_running_task`` takes more than 10 seconds to complete, the context " -"manager will cancel the current task and handle the resulting :exc:`asyncio." -"CancelledError` internally, transforming it into a :exc:`TimeoutError` which " -"can be caught and handled." -msgstr "" - -#: ../../library/asyncio-task.rst:750 -msgid "" -"The :func:`asyncio.timeout` context manager is what transforms the :exc:" -"`asyncio.CancelledError` into a :exc:`TimeoutError`, which means the :exc:" -"`TimeoutError` can only be caught *outside* of the context manager." -msgstr "" - -#: ../../library/asyncio-task.rst:755 -msgid "Example of catching :exc:`TimeoutError`::" -msgstr "" - -#: ../../library/asyncio-task.rst:757 -msgid "" -"async def main():\n" -" try:\n" -" async with asyncio.timeout(10):\n" -" await long_running_task()\n" -" except TimeoutError:\n" -" print(\"The long operation timed out, but we've handled it.\")\n" -"\n" -" print(\"This statement will run regardless.\")" -msgstr "" - -#: ../../library/asyncio-task.rst:766 -msgid "" -"The context manager produced by :func:`asyncio.timeout` can be rescheduled " -"to a different deadline and inspected." -msgstr "" - -#: ../../library/asyncio-task.rst:771 -msgid "" -"An :ref:`asynchronous context manager ` for " -"cancelling overdue coroutines." -msgstr "" - -#: ../../library/asyncio-task.rst:774 -msgid "" -"``when`` should be an absolute time at which the context should time out, as " -"measured by the event loop's clock:" -msgstr "" - -#: ../../library/asyncio-task.rst:777 -msgid "If ``when`` is ``None``, the timeout will never trigger." -msgstr "" - -#: ../../library/asyncio-task.rst:778 -msgid "" -"If ``when < loop.time()``, the timeout will trigger on the next iteration of " -"the event loop." -msgstr "" - -#: ../../library/asyncio-task.rst:783 -msgid "" -"Return the current deadline, or ``None`` if the current deadline is not set." -msgstr "" - -#: ../../library/asyncio-task.rst:788 -msgid "Reschedule the timeout." -msgstr "" - -#: ../../library/asyncio-task.rst:792 -msgid "Return whether the context manager has exceeded its deadline (expired)." -msgstr "" - -#: ../../library/asyncio-task.rst:797 -msgid "" -"async def main():\n" -" try:\n" -" # We do not know the timeout when starting, so we pass ``None``.\n" -" async with asyncio.timeout(None) as cm:\n" -" # We know the timeout now, so we reschedule it.\n" -" new_deadline = get_running_loop().time() + 10\n" -" cm.reschedule(new_deadline)\n" -"\n" -" await long_running_task()\n" -" except TimeoutError:\n" -" pass\n" -"\n" -" if cm.expired():\n" -" print(\"Looks like we haven't finished on time.\")" -msgstr "" - -#: ../../library/asyncio-task.rst:812 -msgid "Timeout context managers can be safely nested." -msgstr "" - -#: ../../library/asyncio-task.rst:818 -msgid "" -"Similar to :func:`asyncio.timeout`, except *when* is the absolute time to " -"stop waiting, or ``None``." -msgstr "" - -#: ../../library/asyncio-task.rst:823 -msgid "" -"async def main():\n" -" loop = get_running_loop()\n" -" deadline = loop.time() + 20\n" -" try:\n" -" async with asyncio.timeout_at(deadline):\n" -" await long_running_task()\n" -" except TimeoutError:\n" -" print(\"The long operation timed out, but we've handled it.\")\n" -"\n" -" print(\"This statement will run regardless.\")" -msgstr "" - -#: ../../library/asyncio-task.rst:839 +#: ../../library/asyncio-task.rst:455 msgid "" "Wait for the *aw* :ref:`awaitable ` to complete with a " "timeout." @@ -1209,7 +547,7 @@ msgstr "" "*aw* :ref:`awaitable ` が、完了するかタイムアウトになるの" "を待ちます。" -#: ../../library/asyncio-task.rst:844 +#: ../../library/asyncio-task.rst:460 msgid "" "*timeout* can either be ``None`` or a float or int number of seconds to wait " "for. If *timeout* is ``None``, block until the future completes." @@ -1218,12 +556,15 @@ msgstr "" "す。\n" "*timeout* が ``None`` の場合、 Future が完了するまで待ちます。" -#: ../../library/asyncio-task.rst:848 +#: ../../library/asyncio-task.rst:464 msgid "" -"If a timeout occurs, it cancels the task and raises :exc:`TimeoutError`." +"If a timeout occurs, it cancels the task and raises :exc:`asyncio." +"TimeoutError`." msgstr "" +"タイムアウトが起きた場合は、 Task をキャンセルし :exc:`asyncio.TimeoutError` " +"を送出します。" -#: ../../library/asyncio-task.rst:851 +#: ../../library/asyncio-task.rst:467 msgid "" "To avoid the task :meth:`cancellation `, wrap it in :func:" "`shield`." @@ -1231,7 +572,7 @@ msgstr "" "Task の :meth:`キャンセル ` を避けるためには、 :func:`shield` の" "中にラップしてください。" -#: ../../library/asyncio-task.rst:854 +#: ../../library/asyncio-task.rst:470 msgid "" "The function will wait until the future is actually cancelled, so the total " "wait time may exceed the *timeout*. If an exception happens during " @@ -1241,69 +582,42 @@ msgstr "" "*timeout* を超えることがあります。キャンセル中に例外が発生した場合は、その例" "外は伝達されます。" -#: ../../library/asyncio-task.rst:858 +#: ../../library/asyncio-task.rst:474 msgid "If the wait is cancelled, the future *aw* is also cancelled." msgstr "待機が中止された場合 *aw* も中止されます。" -#: ../../library/asyncio-task.rst:864 -msgid "" -"async def eternity():\n" -" # Sleep for one hour\n" -" await asyncio.sleep(3600)\n" -" print('yay!')\n" -"\n" -"async def main():\n" -" # Wait for at most 1 second\n" -" try:\n" -" await asyncio.wait_for(eternity(), timeout=1.0)\n" -" except TimeoutError:\n" -" print('timeout!')\n" -"\n" -"asyncio.run(main())\n" -"\n" -"# Expected output:\n" -"#\n" -"# timeout!" -msgstr "" - -#: ../../library/asyncio-task.rst:882 +#: ../../library/asyncio-task.rst:501 msgid "" "When *aw* is cancelled due to a timeout, ``wait_for`` waits for *aw* to be " -"cancelled. Previously, it raised :exc:`TimeoutError` immediately." -msgstr "" - -#: ../../library/asyncio-task.rst:890 -msgid "Raises :exc:`TimeoutError` instead of :exc:`asyncio.TimeoutError`." +"cancelled. Previously, it raised :exc:`asyncio.TimeoutError` immediately." msgstr "" +"*aw* がタイムアウトでキャンセルされたとき、 ``wait_for`` は *aw* がキャンセル" +"されるまで待ちます。\n" +"以前は、すぐに :exc:`asyncio.TimeoutError` を送出していました。" -#: ../../library/asyncio-task.rst:895 +#: ../../library/asyncio-task.rst:508 msgid "Waiting Primitives" msgstr "要素の終了待機" -#: ../../library/asyncio-task.rst:900 +#: ../../library/asyncio-task.rst:513 msgid "" -"Run :class:`~asyncio.Future` and :class:`~asyncio.Task` instances in the " -"*aws* iterable concurrently and block until the condition specified by " -"*return_when*." +"Run :ref:`awaitable objects ` in the *aws* iterable " +"concurrently and block until the condition specified by *return_when*." msgstr "" -#: ../../library/asyncio-task.rst:904 +#: ../../library/asyncio-task.rst:517 msgid "The *aws* iterable must not be empty." msgstr "イテラブル *aws* は空であってはなりません。" -#: ../../library/asyncio-task.rst:906 +#: ../../library/asyncio-task.rst:519 msgid "Returns two sets of Tasks/Futures: ``(done, pending)``." msgstr "Task/Future からなる 2 つの集合 ``(done, pending)`` を返します。" -#: ../../library/asyncio-task.rst:908 +#: ../../library/asyncio-task.rst:521 msgid "Usage::" msgstr "使い方::" -#: ../../library/asyncio-task.rst:910 -msgid "done, pending = await asyncio.wait(aws)" -msgstr "" - -#: ../../library/asyncio-task.rst:912 +#: ../../library/asyncio-task.rst:525 msgid "" "*timeout* (a float or int), if specified, can be used to control the maximum " "number of seconds to wait before returning." @@ -1311,14 +625,17 @@ msgstr "" "*timeout* (浮動小数点数または整数) が指定されていたら、処理を返すのを待つ最大" "秒数を制御するのに使われます。" -#: ../../library/asyncio-task.rst:915 +#: ../../library/asyncio-task.rst:528 msgid "" -"Note that this function does not raise :exc:`TimeoutError`. Futures or Tasks " -"that aren't done when the timeout occurs are simply returned in the second " -"set." +"Note that this function does not raise :exc:`asyncio.TimeoutError`. Futures " +"or Tasks that aren't done when the timeout occurs are simply returned in the " +"second set." msgstr "" +"この関数は :exc:`asyncio.TimeoutError` を送出しないことに注意してください。\n" +"タイムアウトが起きたときに完了していなかった Future や Task は、2 つ目の集合" +"の要素として返されるだけです。" -#: ../../library/asyncio-task.rst:919 +#: ../../library/asyncio-task.rst:532 msgid "" "*return_when* indicates when this function should return. It must be one of " "the following constants:" @@ -1326,30 +643,44 @@ msgstr "" "*return_when* でこの関数がいつ結果を返すか指定します。指定できる値は以下の 定" "数のどれか一つです:" -#: ../../library/asyncio-task.rst:925 +#: ../../library/asyncio-task.rst:538 msgid "Constant" msgstr "定数" -#: ../../library/asyncio-task.rst:926 +#: ../../library/asyncio-task.rst:538 msgid "Description" msgstr "説明" -#: ../../library/asyncio-task.rst:929 +#: ../../library/asyncio-task.rst:540 +msgid ":const:`FIRST_COMPLETED`" +msgstr ":const:`FIRST_COMPLETED`" + +#: ../../library/asyncio-task.rst:540 msgid "The function will return when any future finishes or is cancelled." msgstr "いずれかのフューチャが終了したかキャンセルされたときに返します。" -#: ../../library/asyncio-task.rst:932 +#: ../../library/asyncio-task.rst:543 +msgid ":const:`FIRST_EXCEPTION`" +msgstr ":const:`FIRST_EXCEPTION`" + +#: ../../library/asyncio-task.rst:543 msgid "" -"The function will return when any future finishes by raising an exception. " +"The function will return when any future finishes by raising an exception. " "If no future raises an exception then it is equivalent to :const:" "`ALL_COMPLETED`." msgstr "" +"いずれかのフューチャが例外の送出で終了した場合に返します。例外を送出した" +"フューチャがない場合は、:const:`ALL_COMPLETED` と等価になります。" + +#: ../../library/asyncio-task.rst:549 +msgid ":const:`ALL_COMPLETED`" +msgstr ":const:`ALL_COMPLETED`" -#: ../../library/asyncio-task.rst:937 +#: ../../library/asyncio-task.rst:549 msgid "The function will return when all futures finish or are cancelled." msgstr "すべてのフューチャが終了したかキャンセルされたときに返します。" -#: ../../library/asyncio-task.rst:939 +#: ../../library/asyncio-task.rst:553 msgid "" "Unlike :func:`~asyncio.wait_for`, ``wait()`` does not cancel the futures " "when a timeout occurs." @@ -1357,101 +688,64 @@ msgstr "" ":func:`~asyncio.wait_for` と異なり、 ``wait()`` はタイムアウトが起きたとき" "に Future をキャンセルしません。" -#: ../../library/asyncio-task.rst:945 -msgid "Passing coroutine objects to ``wait()`` directly is forbidden." -msgstr "" - -#: ../../library/asyncio-task.rst:948 ../../library/asyncio-task.rst:1006 -msgid "Added support for generators yielding tasks." -msgstr "" - -#: ../../library/asyncio-task.rst:954 -msgid "" -"Run :ref:`awaitable objects ` in the *aws* iterable " -"concurrently. The returned object can be iterated to obtain the results of " -"the awaitables as they finish." -msgstr "" - -#: ../../library/asyncio-task.rst:958 +#: ../../library/asyncio-task.rst:558 msgid "" -"The object returned by ``as_completed()`` can be iterated as an :term:" -"`asynchronous iterator` or a plain :term:`iterator`. When asynchronous " -"iteration is used, the originally-supplied awaitables are yielded if they " -"are tasks or futures. This makes it easy to correlate previously-scheduled " -"tasks with their results. Example::" -msgstr "" - -#: ../../library/asyncio-task.rst:964 -msgid "" -"ipv4_connect = create_task(open_connection(\"127.0.0.1\", 80))\n" -"ipv6_connect = create_task(open_connection(\"::1\", 80))\n" -"tasks = [ipv4_connect, ipv6_connect]\n" -"\n" -"async for earliest_connect in as_completed(tasks):\n" -" # earliest_connect is done. The result can be obtained by\n" -" # awaiting it or calling earliest_connect.result()\n" -" reader, writer = await earliest_connect\n" -"\n" -" if earliest_connect is ipv6_connect:\n" -" print(\"IPv6 connection established.\")\n" -" else:\n" -" print(\"IPv4 connection established.\")" -msgstr "" - -#: ../../library/asyncio-task.rst:978 -msgid "" -"During asynchronous iteration, implicitly-created tasks will be yielded for " -"supplied awaitables that aren't tasks or futures." +"If any awaitable in *aws* is a coroutine, it is automatically scheduled as a " +"Task. Passing coroutines objects to ``wait()`` directly is deprecated as it " +"leads to :ref:`confusing behavior `." msgstr "" +"*aws* にある awaitable のどれかがコルーチンの場合、自動的に Task としてスケ" +"ジュールされます。\n" +"コルーチンオブジェクトを ``wait()`` に直接渡すのは :ref:`紛らわしい振る舞い " +"` を引き起こすため非推奨です。" -#: ../../library/asyncio-task.rst:981 +#: ../../library/asyncio-task.rst:570 msgid "" -"When used as a plain iterator, each iteration yields a new coroutine that " -"returns the result or raises the exception of the next completed awaitable. " -"This pattern is compatible with Python versions older than 3.13::" +"``wait()`` schedules coroutines as Tasks automatically and later returns " +"those implicitly created Task objects in ``(done, pending)`` sets. " +"Therefore the following code won't work as expected::" msgstr "" +"``wait()`` は自動的にコルーチンを Task としてスケジュールし、その後、暗黙的に" +"作成された Task オブジェクトを組になった集合 ``(done, pending)`` に入れて返し" +"ます。\n" +"従って、次のコードは予想した通りには動作しません::" -#: ../../library/asyncio-task.rst:985 -msgid "" -"ipv4_connect = create_task(open_connection(\"127.0.0.1\", 80))\n" -"ipv6_connect = create_task(open_connection(\"::1\", 80))\n" -"tasks = [ipv4_connect, ipv6_connect]\n" -"\n" -"for next_connect in as_completed(tasks):\n" -" # next_connect is not one of the original task objects. It must be\n" -" # awaited to obtain the result value or raise the exception of the\n" -" # awaitable that finishes next.\n" -" reader, writer = await next_connect" -msgstr "" +#: ../../library/asyncio-task.rst:583 +msgid "Here is how the above snippet can be fixed::" +msgstr "上のスクリプト片は次のように修正できます::" -#: ../../library/asyncio-task.rst:995 -msgid "" -"A :exc:`TimeoutError` is raised if the timeout occurs before all awaitables " -"are done. This is raised by the ``async for`` loop during asynchronous " -"iteration or by the coroutines yielded during plain iteration." -msgstr "" +#: ../../library/asyncio-task.rst:596 +msgid "Passing coroutine objects to ``wait()`` directly is deprecated." +msgstr "``wait()`` にコルーチンオブジェクトを直接渡すのは非推奨です。" -#: ../../library/asyncio-task.rst:1002 +#: ../../library/asyncio-task.rst:602 msgid "" -"Deprecation warning is emitted if not all awaitable objects in the *aws* " -"iterable are Future-like objects and there is no running event loop." +"Run :ref:`awaitable objects ` in the *aws* iterable " +"concurrently. Return an iterator of coroutines. Each coroutine returned can " +"be awaited to get the earliest next result from the iterable of the " +"remaining awaitables." msgstr "" +"イテラブル *aws* 内の :ref:`awaitable オブジェクト ` を並" +"列実行します。コルーチンのイテレータを返します。戻り値の各コルーチンは、残り" +"の awaitable のうちで最も早く得られた結果を待ち受けることができます。" -#: ../../library/asyncio-task.rst:1009 +#: ../../library/asyncio-task.rst:607 msgid "" -"The result can now be used as either an :term:`asynchronous iterator` or as " -"a plain :term:`iterator` (previously it was only a plain iterator)." +"Raises :exc:`asyncio.TimeoutError` if the timeout occurs before all Futures " +"are done." msgstr "" +"全フューチャが終了する前にタイムアウトが発生した場合 :exc:`asyncio." +"TimeoutError` を送出します。" -#: ../../library/asyncio-task.rst:1015 +#: ../../library/asyncio-task.rst:621 msgid "Running in Threads" msgstr "スレッド内での実行" -#: ../../library/asyncio-task.rst:1020 +#: ../../library/asyncio-task.rst:625 msgid "Asynchronously run function *func* in a separate thread." msgstr "別のスレッドで非同期的に関数 *func* を実行します。" -#: ../../library/asyncio-task.rst:1022 +#: ../../library/asyncio-task.rst:627 msgid "" "Any \\*args and \\*\\*kwargs supplied for this function are directly passed " "to *func*. Also, the current :class:`contextvars.Context` is propagated, " @@ -1462,74 +756,45 @@ msgstr "" "た、イベントループスレッドのコンテキスト変数に関数を実行するスレッドからアク" "セスできるように、現在の :class:`contextvars.Context` も伝播されます。" -#: ../../library/asyncio-task.rst:1027 +#: ../../library/asyncio-task.rst:632 msgid "" "Return a coroutine that can be awaited to get the eventual result of *func*." msgstr "関数 *func* の最終結果を待ち受けできるコルーチンを返します。" -#: ../../library/asyncio-task.rst:1029 +#: ../../library/asyncio-task.rst:634 msgid "" "This coroutine function is primarily intended to be used for executing IO-" "bound functions/methods that would otherwise block the event loop if they " -"were run in the main thread. For example::" +"were ran in the main thread. For example::" msgstr "" -#: ../../library/asyncio-task.rst:1033 +#: ../../library/asyncio-task.rst:664 +msgid "" +"Directly calling `blocking_io()` in any coroutine would block the event loop " +"for its duration, resulting in an additional 1 second of run time. Instead, " +"by using `asyncio.to_thread()`, we can run it in a separate thread without " +"blocking the event loop." +msgstr "" + +#: ../../library/asyncio-task.rst:671 msgid "" -"def blocking_io():\n" -" print(f\"start blocking_io at {time.strftime('%X')}\")\n" -" # Note that time.sleep() can be replaced with any blocking\n" -" # IO-bound operation, such as file operations.\n" -" time.sleep(1)\n" -" print(f\"blocking_io complete at {time.strftime('%X')}\")\n" -"\n" -"async def main():\n" -" print(f\"started main at {time.strftime('%X')}\")\n" -"\n" -" await asyncio.gather(\n" -" asyncio.to_thread(blocking_io),\n" -" asyncio.sleep(1))\n" -"\n" -" print(f\"finished main at {time.strftime('%X')}\")\n" -"\n" -"\n" -"asyncio.run(main())\n" -"\n" -"# Expected output:\n" -"#\n" -"# started main at 19:50:53\n" -"# start blocking_io at 19:50:53\n" -"# blocking_io complete at 19:50:54\n" -"# finished main at 19:50:54" -msgstr "" - -#: ../../library/asyncio-task.rst:1059 -msgid "" -"Directly calling ``blocking_io()`` in any coroutine would block the event " -"loop for its duration, resulting in an additional 1 second of run time. " -"Instead, by using ``asyncio.to_thread()``, we can run it in a separate " -"thread without blocking the event loop." -msgstr "" - -#: ../../library/asyncio-task.rst:1066 -msgid "" -"Due to the :term:`GIL`, ``asyncio.to_thread()`` can typically only be used " -"to make IO-bound functions non-blocking. However, for extension modules that " +"Due to the :term:`GIL`, `asyncio.to_thread()` can typically only be used to " +"make IO-bound functions non-blocking. However, for extension modules that " "release the GIL or alternative Python implementations that don't have one, " -"``asyncio.to_thread()`` can also be used for CPU-bound functions." +"`asyncio.to_thread()` can also be used for CPU-bound functions." msgstr "" -#: ../../library/asyncio-task.rst:1075 +#: ../../library/asyncio-task.rst:680 msgid "Scheduling From Other Threads" msgstr "外部スレッドからのスケジュール" -#: ../../library/asyncio-task.rst:1079 +#: ../../library/asyncio-task.rst:684 msgid "Submit a coroutine to the given event loop. Thread-safe." msgstr "" "与えられたイベントループにコルーチンを送ります。\n" "この処理は、スレッドセーフです。" -#: ../../library/asyncio-task.rst:1081 +#: ../../library/asyncio-task.rst:686 msgid "" "Return a :class:`concurrent.futures.Future` to wait for the result from " "another OS thread." @@ -1537,7 +802,7 @@ msgstr "" "他の OS スレッドから結果を待つための :class:`concurrent.futures.Future` を返" "します。" -#: ../../library/asyncio-task.rst:1084 +#: ../../library/asyncio-task.rst:689 msgid "" "This function is meant to be called from a different OS thread than the one " "where the event loop is running. Example::" @@ -1546,71 +811,7 @@ msgstr "" "び出すためのものです。\n" "例えば次のように使います::" -#: ../../library/asyncio-task.rst:1087 -msgid "" -"def in_thread(loop: asyncio.AbstractEventLoop) -> None:\n" -" # Run some blocking IO\n" -" pathlib.Path(\"example.txt\").write_text(\"hello world\", " -"encoding=\"utf8\")\n" -"\n" -" # Create a coroutine\n" -" coro = asyncio.sleep(1, result=3)\n" -"\n" -" # Submit the coroutine to a given loop\n" -" future = asyncio.run_coroutine_threadsafe(coro, loop)\n" -"\n" -" # Wait for the result with an optional timeout argument\n" -" assert future.result(timeout=2) == 3\n" -"\n" -"async def amain() -> None:\n" -" # Get the running loop\n" -" loop = asyncio.get_running_loop()\n" -"\n" -" # Run something in a thread\n" -" await asyncio.to_thread(in_thread, loop)" -msgstr "" - -#: ../../library/asyncio-task.rst:1107 -msgid "It's also possible to run the other way around. Example::" -msgstr "" - -#: ../../library/asyncio-task.rst:1109 -msgid "" -"@contextlib.contextmanager\n" -"def loop_in_thread() -> Generator[asyncio.AbstractEventLoop]:\n" -" loop_fut = concurrent.futures.Future[asyncio.AbstractEventLoop]()\n" -" stop_event = asyncio.Event()\n" -"\n" -" async def main() -> None:\n" -" loop_fut.set_result(asyncio.get_running_loop())\n" -" await stop_event.wait()\n" -"\n" -" with concurrent.futures.ThreadPoolExecutor(1) as tpe:\n" -" complete_fut = tpe.submit(asyncio.run, main())\n" -" for fut in concurrent.futures.as_completed((loop_fut, " -"complete_fut)):\n" -" if fut is loop_fut:\n" -" loop = loop_fut.result()\n" -" try:\n" -" yield loop\n" -" finally:\n" -" loop.call_soon_threadsafe(stop_event.set)\n" -" else:\n" -" fut.result()\n" -"\n" -"# Create a loop in another thread\n" -"with loop_in_thread() as loop:\n" -" # Create a coroutine\n" -" coro = asyncio.sleep(1, result=3)\n" -"\n" -" # Submit the coroutine to a given loop\n" -" future = asyncio.run_coroutine_threadsafe(coro, loop)\n" -"\n" -" # Wait for the result with an optional timeout argument\n" -" assert future.result(timeout=2) == 3" -msgstr "" - -#: ../../library/asyncio-task.rst:1141 +#: ../../library/asyncio-task.rst:701 msgid "" "If an exception is raised in the coroutine, the returned Future will be " "notified. It can also be used to cancel the task in the event loop::" @@ -1618,27 +819,14 @@ msgstr "" "コルーチンから例外が送出された場合、返された Future に通知されます。\n" "これはイベントループの Task をキャンセルするのにも使えます::" -#: ../../library/asyncio-task.rst:1145 -msgid "" -"try:\n" -" result = future.result(timeout)\n" -"except TimeoutError:\n" -" print('The coroutine took too long, cancelling the task...')\n" -" future.cancel()\n" -"except Exception as exc:\n" -" print(f'The coroutine raised an exception: {exc!r}')\n" -"else:\n" -" print(f'The coroutine returned: {result!r}')" -msgstr "" - -#: ../../library/asyncio-task.rst:1155 +#: ../../library/asyncio-task.rst:715 msgid "" "See the :ref:`concurrency and multithreading ` " "section of the documentation." msgstr "" "このドキュメントの :ref:`asyncio-multithreading` 節を参照してください。" -#: ../../library/asyncio-task.rst:1158 +#: ../../library/asyncio-task.rst:718 msgid "" "Unlike other asyncio functions this function requires the *loop* argument to " "be passed explicitly." @@ -1646,11 +834,11 @@ msgstr "" "他の asyncio 関数とは異なり、この関数は明示的に渡される *loop* 引数を必要とし" "ます。" -#: ../../library/asyncio-task.rst:1165 +#: ../../library/asyncio-task.rst:725 msgid "Introspection" msgstr "イントロスペクション" -#: ../../library/asyncio-task.rst:1170 +#: ../../library/asyncio-task.rst:730 msgid "" "Return the currently running :class:`Task` instance, or ``None`` if no task " "is running." @@ -1658,7 +846,7 @@ msgstr "" "現在実行中の :class:`Task` インスタンスを返します。実行中の Task が無い場合" "は ``None`` を返します。" -#: ../../library/asyncio-task.rst:1173 +#: ../../library/asyncio-task.rst:733 msgid "" "If *loop* is ``None`` :func:`get_running_loop` is used to get the current " "loop." @@ -1666,13 +854,13 @@ msgstr "" "*loop* が ``None`` の場合、 :func:`get_running_loop` が現在のループを取得する" "のに使われます。" -#: ../../library/asyncio-task.rst:1181 +#: ../../library/asyncio-task.rst:741 msgid "Return a set of not yet finished :class:`Task` objects run by the loop." msgstr "" "ループで実行された :class:`Task` オブジェクトでまだ完了していないものの集合を" "返します。" -#: ../../library/asyncio-task.rst:1184 +#: ../../library/asyncio-task.rst:744 msgid "" "If *loop* is ``None``, :func:`get_running_loop` is used for getting current " "loop." @@ -1680,15 +868,11 @@ msgstr "" "*loop* が ``None`` の場合、 :func:`get_running_loop` は現在のループを取得する" "のに使われます。" -#: ../../library/asyncio-task.rst:1192 -msgid "Return ``True`` if *obj* is a coroutine object." -msgstr "" - -#: ../../library/asyncio-task.rst:1198 +#: ../../library/asyncio-task.rst:751 msgid "Task Object" msgstr "Task オブジェクト" -#: ../../library/asyncio-task.rst:1202 +#: ../../library/asyncio-task.rst:755 msgid "" "A :class:`Future-like ` object that runs a Python :ref:`coroutine " "`. Not thread-safe." @@ -1697,7 +881,7 @@ msgstr "" "オブジェクトです。\n" "スレッドセーフではありません。" -#: ../../library/asyncio-task.rst:1205 +#: ../../library/asyncio-task.rst:758 msgid "" "Tasks are used to run coroutines in event loops. If a coroutine awaits on a " "Future, the Task suspends the execution of the coroutine and waits for the " @@ -1709,7 +893,7 @@ msgstr "" "止させ、 Future の完了を待ちます。\n" "Future が *完了* したら、 Task が内包しているコルーチンの実行を再開します。" -#: ../../library/asyncio-task.rst:1211 +#: ../../library/asyncio-task.rst:764 msgid "" "Event loops use cooperative scheduling: an event loop runs one Task at a " "time. While a Task awaits for the completion of a Future, the event loop " @@ -1720,7 +904,7 @@ msgstr "" "Task が Future の完了を待っているときは、イベントループは他の Task やコール" "バックを動作させるか、 IO 処理を実行します。" -#: ../../library/asyncio-task.rst:1216 +#: ../../library/asyncio-task.rst:769 msgid "" "Use the high-level :func:`asyncio.create_task` function to create Tasks, or " "the low-level :meth:`loop.create_task` or :func:`ensure_future` functions. " @@ -1731,7 +915,7 @@ msgstr "" "ださい。\n" "手作業での Task の実装は推奨されません。" -#: ../../library/asyncio-task.rst:1221 +#: ../../library/asyncio-task.rst:774 msgid "" "To cancel a running Task use the :meth:`cancel` method. Calling it will " "cause the Task to throw a :exc:`CancelledError` exception into the wrapped " @@ -1743,7 +927,7 @@ msgstr "" "`CancelledError` 例外を送出します。キャンセルの際にコルーチンが Future オブ" "ジェクトを待っていた場合、その Future オブジェクトはキャンセルされます。" -#: ../../library/asyncio-task.rst:1226 +#: ../../library/asyncio-task.rst:779 msgid "" ":meth:`cancelled` can be used to check if the Task was cancelled. The method " "returns ``True`` if the wrapped coroutine did not suppress the :exc:" @@ -1754,7 +938,7 @@ msgstr "" "タスクが実際にキャンセルされている場合に、このメソッドは ``True`` を変えま" "す。" -#: ../../library/asyncio-task.rst:1231 +#: ../../library/asyncio-task.rst:784 msgid "" ":class:`asyncio.Task` inherits from :class:`Future` all of its APIs except :" "meth:`Future.set_result` and :meth:`Future.set_exception`." @@ -1762,43 +946,80 @@ msgstr "" ":class:`asyncio.Task` は、:meth:`Future.set_result` と :meth:`Future." "set_exception` を除いて、:class:`Future` の API をすべて継承しています。" -#: ../../library/asyncio-task.rst:1235 +#: ../../library/asyncio-task.rst:788 msgid "" -"An optional keyword-only *context* argument allows specifying a custom :" -"class:`contextvars.Context` for the *coro* to run in. If no *context* is " -"provided, the Task copies the current context and later runs its coroutine " -"in the copied context." +"Tasks support the :mod:`contextvars` module. When a Task is created it " +"copies the current context and later runs its coroutine in the copied " +"context." msgstr "" +"Task は :mod:`contextvars` モジュールをサポートします。Task が作られたときに" +"現在のコンテキストがコピーされ、のちに Task のコルーチンを実行する際に、コ" +"ピーされたコンテキストが使用されます。" -#: ../../library/asyncio-task.rst:1240 +#: ../../library/asyncio-task.rst:792 +msgid "Added support for the :mod:`contextvars` module." +msgstr ":mod:`contextvars` モジュールのサポートを追加。" + +#: ../../library/asyncio-task.rst:803 +msgid "Request the Task to be cancelled." +msgstr "このタスクに、自身のキャンセルを要求します。" + +#: ../../library/asyncio-task.rst:805 msgid "" -"An optional keyword-only *eager_start* argument allows eagerly starting the " -"execution of the :class:`asyncio.Task` at task creation time. If set to " -"``True`` and the event loop is running, the task will start executing the " -"coroutine immediately, until the first time the coroutine blocks. If the " -"coroutine returns or raises without blocking, the task will be finished " -"eagerly and will skip scheduling to the event loop." +"This arranges for a :exc:`CancelledError` exception to be thrown into the " +"wrapped coroutine on the next cycle of the event loop." msgstr "" +"このメソッドは、イベントループの次のステップにおいて、タスクがラップしている" +"コルーチン内で :exc:`CancelledError` 例外が送出されるように準備します。" -#: ../../library/asyncio-task.rst:1247 -msgid "Added support for the :mod:`contextvars` module." -msgstr ":mod:`contextvars` モジュールのサポートを追加。" +#: ../../library/asyncio-task.rst:808 +msgid "" +"The coroutine then has a chance to clean up or even deny the request by " +"suppressing the exception with a :keyword:`try` ... ... ``except " +"CancelledError`` ... :keyword:`finally` block. Therefore, unlike :meth:" +"`Future.cancel`, :meth:`Task.cancel` does not guarantee that the Task will " +"be cancelled, although suppressing cancellation completely is not common and " +"is actively discouraged." +msgstr "" +"コルーチン側では :keyword:`try` ... ... ``except CancelledError`` ... :" +"keyword:`finally` ブロックで例外を処理することにより、クリーンアップ処理を行" +"なったり、リクエストを拒否したりする機会が与えられます。この特性を使ってキャ" +"ンセル処理を完全に抑え込むことも可能であることから、 :meth:`Future.cancel` と" +"異なり、 :meth:`Task.cancel` は Task が実際にキャンセルされることを保証しませ" +"ん。ただしそのような処理は一般的ではありませんし、そのような処理をしないこと" +"が望ましいです。" + +#: ../../library/asyncio-task.rst:816 +msgid "Added the ``msg`` parameter." +msgstr "" -#: ../../library/asyncio-task.rst:1253 +#: ../../library/asyncio-task.rst:821 msgid "" -"Deprecation warning is emitted if *loop* is not specified and there is no " -"running event loop." +"The following example illustrates how coroutines can intercept the " +"cancellation request::" msgstr "" +"以下の例は、コルーチンがどのようにしてキャンセルのリクエストを阻止するかを示" +"しています::" + +#: ../../library/asyncio-task.rst:860 +msgid "Return ``True`` if the Task is *cancelled*." +msgstr "Task が *キャンセルされた* 場合に ``True`` を返します。" -#: ../../library/asyncio-task.rst:1260 -msgid "Added the *eager_start* parameter." +#: ../../library/asyncio-task.rst:862 +msgid "" +"The Task is *cancelled* when the cancellation was requested with :meth:" +"`cancel` and the wrapped coroutine propagated the :exc:`CancelledError` " +"exception thrown into it." msgstr "" +":meth:`cancel` メソッドによりキャンセルがリクエストされ、かつ Task がラップし" +"ているコルーチンが内部で送出された :exc:`CancelledError` 例外を伝達したと" +"き、 Task は実際に *キャンセル* されます。" -#: ../../library/asyncio-task.rst:1265 +#: ../../library/asyncio-task.rst:868 msgid "Return ``True`` if the Task is *done*." msgstr "Task が *完了* しているなら ``True`` を返します。" -#: ../../library/asyncio-task.rst:1267 +#: ../../library/asyncio-task.rst:870 msgid "" "A Task is *done* when the wrapped coroutine either returned a value, raised " "an exception, or the Task was cancelled." @@ -1806,11 +1027,11 @@ msgstr "" "Task がラップしているコルーチンが値を返すか、例外を送出するか、または Task が" "キャンセルされたとき、 Task は *完了* します。" -#: ../../library/asyncio-task.rst:1272 +#: ../../library/asyncio-task.rst:875 msgid "Return the result of the Task." msgstr "Task の結果を返します。" -#: ../../library/asyncio-task.rst:1274 +#: ../../library/asyncio-task.rst:877 msgid "" "If the Task is *done*, the result of the wrapped coroutine is returned (or " "if the coroutine raised an exception, that exception is re-raised.)" @@ -1818,7 +1039,7 @@ msgstr "" "Task が *完了* している場合、ラップしているコルーチンの結果が返されます (コ" "ルーチンが例外を送出された場合、その例外が例外が再送出されます)" -#: ../../library/asyncio-task.rst:1278 ../../library/asyncio-task.rst:1292 +#: ../../library/asyncio-task.rst:881 ../../library/asyncio-task.rst:895 msgid "" "If the Task has been *cancelled*, this method raises a :exc:`CancelledError` " "exception." @@ -1826,17 +1047,19 @@ msgstr "" "Task が *キャンセル* されている場合、このメソッドは :exc:`CancelledError` 例" "外を送出します。" -#: ../../library/asyncio-task.rst:1281 +#: ../../library/asyncio-task.rst:884 msgid "" -"If the Task's result isn't yet available, this method raises an :exc:" +"If the Task's result isn't yet available, this method raises a :exc:" "`InvalidStateError` exception." msgstr "" +"Task の結果がまだ未設定の場合、このメソッドは :exc:`InvalidStateError` 例外を" +"送出します。" -#: ../../library/asyncio-task.rst:1286 +#: ../../library/asyncio-task.rst:889 msgid "Return the exception of the Task." msgstr "Task の例外を返します。" -#: ../../library/asyncio-task.rst:1288 +#: ../../library/asyncio-task.rst:891 msgid "" "If the wrapped coroutine raised an exception that exception is returned. If " "the wrapped coroutine returned normally this method returns ``None``." @@ -1844,7 +1067,7 @@ msgstr "" "ラップされたコルーチンが例外を送出した場合、その例外が返されます。ラップされ" "たコルーチンが正常終了した場合、このメソッドは ``None`` を返します。" -#: ../../library/asyncio-task.rst:1295 +#: ../../library/asyncio-task.rst:898 msgid "" "If the Task isn't *done* yet, this method raises an :exc:`InvalidStateError` " "exception." @@ -1852,26 +1075,26 @@ msgstr "" "Task がまだ *完了* していない場合、このメソッドは :exc:`InvalidStateError` 例" "外を送出します。" -#: ../../library/asyncio-task.rst:1300 +#: ../../library/asyncio-task.rst:903 msgid "Add a callback to be run when the Task is *done*." msgstr "Task が *完了* したときに実行されるコールバックを追加します。" -#: ../../library/asyncio-task.rst:1302 ../../library/asyncio-task.rst:1311 +#: ../../library/asyncio-task.rst:905 ../../library/asyncio-task.rst:914 msgid "This method should only be used in low-level callback-based code." msgstr "このメソッドは低水準のコールバックベースのコードでのみ使うべきです。" -#: ../../library/asyncio-task.rst:1304 +#: ../../library/asyncio-task.rst:907 msgid "" "See the documentation of :meth:`Future.add_done_callback` for more details." msgstr "" "詳細については :meth:`Future.add_done_callback` のドキュメントを参照してくだ" "さい。" -#: ../../library/asyncio-task.rst:1309 +#: ../../library/asyncio-task.rst:912 msgid "Remove *callback* from the callbacks list." msgstr "コールバックリストから *callback* を削除します。" -#: ../../library/asyncio-task.rst:1313 +#: ../../library/asyncio-task.rst:916 msgid "" "See the documentation of :meth:`Future.remove_done_callback` for more " "details." @@ -1879,11 +1102,11 @@ msgstr "" "詳細については :meth:`Future.remove_done_callback` のドキュメントを参照してく" "ださい。" -#: ../../library/asyncio-task.rst:1318 +#: ../../library/asyncio-task.rst:921 msgid "Return the list of stack frames for this Task." msgstr "このタスクのスタックフレームのリストを返します。" -#: ../../library/asyncio-task.rst:1320 +#: ../../library/asyncio-task.rst:923 msgid "" "If the wrapped coroutine is not done, this returns the stack where it is " "suspended. If the coroutine has completed successfully or was cancelled, " @@ -1895,16 +1118,16 @@ msgstr "" "トを返します。コルーチンが例外で終了した場合はトレースバックフレームのリスト" "を返します。" -#: ../../library/asyncio-task.rst:1326 +#: ../../library/asyncio-task.rst:929 msgid "The frames are always ordered from oldest to newest." msgstr "フレームは常に古いものから新しい物へ並んでいます。" -#: ../../library/asyncio-task.rst:1328 +#: ../../library/asyncio-task.rst:931 msgid "Only one stack frame is returned for a suspended coroutine." msgstr "" "サスペンドされているコルーチンの場合スタックフレームが 1 個だけ返されます。" -#: ../../library/asyncio-task.rst:1330 +#: ../../library/asyncio-task.rst:933 msgid "" "The optional *limit* argument sets the maximum number of frames to return; " "by default all available frames are returned. The ordering of the returned " @@ -1918,11 +1141,11 @@ msgstr "" "だリストが返されますが、トレースバックでは古い順に並んだリストが返されます" "(これは traceback モジュールの振る舞いと一致します)。" -#: ../../library/asyncio-task.rst:1339 +#: ../../library/asyncio-task.rst:942 msgid "Print the stack or traceback for this Task." msgstr "このタスクのスタックまたはトレースバックを出力します。" -#: ../../library/asyncio-task.rst:1341 +#: ../../library/asyncio-task.rst:944 msgid "" "This produces output similar to that of the traceback module for the frames " "retrieved by :meth:`get_stack`." @@ -1930,40 +1153,27 @@ msgstr "" "このメソッドは :meth:`get_stack` によって取得されるフレームに対し、 " "traceback モジュールと同じような出力を生成します。" -#: ../../library/asyncio-task.rst:1344 +#: ../../library/asyncio-task.rst:947 msgid "The *limit* argument is passed to :meth:`get_stack` directly." msgstr "引数 *limit* は :meth:`get_stack` にそのまま渡されます。" -#: ../../library/asyncio-task.rst:1346 +#: ../../library/asyncio-task.rst:949 msgid "" "The *file* argument is an I/O stream to which the output is written; by " -"default output is written to :data:`sys.stdout`." +"default output is written to :data:`sys.stderr`." msgstr "" +"引数 *file* は出力を書き込む I/O ストリームを指定します; デフォルトでは出力は" +"標準エラー出力 :data:`sys.stderr` に書き込まれます。" -#: ../../library/asyncio-task.rst:1351 +#: ../../library/asyncio-task.rst:954 msgid "Return the coroutine object wrapped by the :class:`Task`." msgstr ":class:`Task` がラップしているコルーチンオブジェクトを返します。" -#: ../../library/asyncio-task.rst:1355 -msgid "" -"This will return ``None`` for Tasks which have already completed eagerly. " -"See the :ref:`Eager Task Factory `." -msgstr "" - -#: ../../library/asyncio-task.rst:1362 -msgid "Newly added eager task execution means result may be ``None``." -msgstr "" - -#: ../../library/asyncio-task.rst:1366 -msgid "" -"Return the :class:`contextvars.Context` object associated with the task." -msgstr "" - -#: ../../library/asyncio-task.rst:1373 +#: ../../library/asyncio-task.rst:960 msgid "Return the name of the Task." msgstr "Task の名前を返します。" -#: ../../library/asyncio-task.rst:1375 +#: ../../library/asyncio-task.rst:962 msgid "" "If no name has been explicitly assigned to the Task, the default asyncio " "Task implementation generates a default name during instantiation." @@ -1971,17 +1181,17 @@ msgstr "" "Task に対して明示的に名前が設定されていない場合, デフォルトの asyncio Task 実" "装はタスクをインスタンス化する際にデフォルトの名前を生成します。" -#: ../../library/asyncio-task.rst:1383 +#: ../../library/asyncio-task.rst:970 msgid "Set the name of the Task." msgstr "Task に名前を設定します。" -#: ../../library/asyncio-task.rst:1385 +#: ../../library/asyncio-task.rst:972 msgid "" "The *value* argument can be any object, which is then converted to a string." msgstr "" "引数 *value* は文字列に変換可能なオブジェクトであれば何でもかまいません。" -#: ../../library/asyncio-task.rst:1388 +#: ../../library/asyncio-task.rst:975 msgid "" "In the default Task implementation, the name will be visible in the :func:" "`repr` output of a task object." @@ -1989,184 +1199,66 @@ msgstr "" "Task のデフォルト実装では、名前はオブジェクトの :func:`repr` メソッドの出力で" "確認できます。" -#: ../../library/asyncio-task.rst:1395 -msgid "Request the Task to be cancelled." -msgstr "このタスクに、自身のキャンセルを要求します。" - -#: ../../library/asyncio-task.rst:1397 -msgid "" -"If the Task is already *done* or *cancelled*, return ``False``, otherwise, " -"return ``True``." -msgstr "" - -#: ../../library/asyncio-task.rst:1400 -msgid "" -"The method arranges for a :exc:`CancelledError` exception to be thrown into " -"the wrapped coroutine on the next cycle of the event loop." -msgstr "" - -#: ../../library/asyncio-task.rst:1403 -msgid "" -"The coroutine then has a chance to clean up or even deny the request by " -"suppressing the exception with a :keyword:`try` ... ... ``except " -"CancelledError`` ... :keyword:`finally` block. Therefore, unlike :meth:" -"`Future.cancel`, :meth:`Task.cancel` does not guarantee that the Task will " -"be cancelled, although suppressing cancellation completely is not common and " -"is actively discouraged. Should the coroutine nevertheless decide to " -"suppress the cancellation, it needs to call :meth:`Task.uncancel` in " -"addition to catching the exception." -msgstr "" - -#: ../../library/asyncio-task.rst:1413 -msgid "Added the *msg* parameter." -msgstr "" - -#: ../../library/asyncio-task.rst:1416 -msgid "The ``msg`` parameter is propagated from cancelled task to its awaiter." -msgstr "" - -#: ../../library/asyncio-task.rst:1421 -msgid "" -"The following example illustrates how coroutines can intercept the " -"cancellation request::" +#: ../../library/asyncio-task.rst:984 +msgid "Generator-based Coroutines" msgstr "" -"以下の例は、コルーチンがどのようにしてキャンセルのリクエストを阻止するかを示" -"しています::" - -#: ../../library/asyncio-task.rst:1424 -msgid "" -"async def cancel_me():\n" -" print('cancel_me(): before sleep')\n" -"\n" -" try:\n" -" # Wait for 1 hour\n" -" await asyncio.sleep(3600)\n" -" except asyncio.CancelledError:\n" -" print('cancel_me(): cancel sleep')\n" -" raise\n" -" finally:\n" -" print('cancel_me(): after sleep')\n" -"\n" -"async def main():\n" -" # Create a \"cancel_me\" Task\n" -" task = asyncio.create_task(cancel_me())\n" -"\n" -" # Wait for 1 second\n" -" await asyncio.sleep(1)\n" -"\n" -" task.cancel()\n" -" try:\n" -" await task\n" -" except asyncio.CancelledError:\n" -" print(\"main(): cancel_me is cancelled now\")\n" -"\n" -"asyncio.run(main())\n" -"\n" -"# Expected output:\n" -"#\n" -"# cancel_me(): before sleep\n" -"# cancel_me(): cancel sleep\n" -"# cancel_me(): after sleep\n" -"# main(): cancel_me is cancelled now" -msgstr "" - -#: ../../library/asyncio-task.rst:1460 -msgid "Return ``True`` if the Task is *cancelled*." -msgstr "Task が *キャンセルされた* 場合に ``True`` を返します。" -#: ../../library/asyncio-task.rst:1462 +#: ../../library/asyncio-task.rst:988 msgid "" -"The Task is *cancelled* when the cancellation was requested with :meth:" -"`cancel` and the wrapped coroutine propagated the :exc:`CancelledError` " -"exception thrown into it." -msgstr "" -":meth:`cancel` メソッドによりキャンセルがリクエストされ、かつ Task がラップし" -"ているコルーチンが内部で送出された :exc:`CancelledError` 例外を伝達したと" -"き、 Task は実際に *キャンセル* されます。" - -#: ../../library/asyncio-task.rst:1468 -msgid "Decrement the count of cancellation requests to this Task." -msgstr "" - -#: ../../library/asyncio-task.rst:1470 -msgid "Returns the remaining number of cancellation requests." +"Support for generator-based coroutines is **deprecated** and is scheduled " +"for removal in Python 3.10." msgstr "" -#: ../../library/asyncio-task.rst:1472 +#: ../../library/asyncio-task.rst:991 msgid "" -"Note that once execution of a cancelled task completed, further calls to :" -"meth:`uncancel` are ineffective." +"Generator-based coroutines predate async/await syntax. They are Python " +"generators that use ``yield from`` expressions to await on Futures and other " +"coroutines." msgstr "" -#: ../../library/asyncio-task.rst:1477 +#: ../../library/asyncio-task.rst:995 msgid "" -"This method is used by asyncio's internals and isn't expected to be used by " -"end-user code. In particular, if a Task gets successfully uncancelled, this " -"allows for elements of structured concurrency like :ref:`taskgroups` and :" -"func:`asyncio.timeout` to continue running, isolating cancellation to the " -"respective structured block. For example::" +"Generator-based coroutines should be decorated with :func:`@asyncio." +"coroutine `, although this is not enforced." msgstr "" -#: ../../library/asyncio-task.rst:1484 -msgid "" -"async def make_request_with_timeout():\n" -" try:\n" -" async with asyncio.timeout(1):\n" -" # Structured block affected by the timeout:\n" -" await make_request()\n" -" await make_another_request()\n" -" except TimeoutError:\n" -" log(\"There was a timeout\")\n" -" # Outer code not affected by the timeout:\n" -" await unrelated_code()" +#: ../../library/asyncio-task.rst:1002 +msgid "Decorator to mark generator-based coroutines." msgstr "" -#: ../../library/asyncio-task.rst:1495 +#: ../../library/asyncio-task.rst:1004 msgid "" -"While the block with ``make_request()`` and ``make_another_request()`` might " -"get cancelled due to the timeout, ``unrelated_code()`` should continue " -"running even in case of the timeout. This is implemented with :meth:" -"`uncancel`. :class:`TaskGroup` context managers use :func:`uncancel` in a " -"similar fashion." +"This decorator enables legacy generator-based coroutines to be compatible " +"with async/await code::" msgstr "" -#: ../../library/asyncio-task.rst:1501 -msgid "" -"If end-user code is, for some reason, suppressing cancellation by catching :" -"exc:`CancelledError`, it needs to call this method to remove the " -"cancellation state." +#: ../../library/asyncio-task.rst:1014 +msgid "This decorator should not be used for :keyword:`async def` coroutines." msgstr "" -#: ../../library/asyncio-task.rst:1505 -msgid "" -"When this method decrements the cancellation count to zero, the method " -"checks if a previous :meth:`cancel` call had arranged for :exc:" -"`CancelledError` to be thrown into the task. If it hasn't been thrown yet, " -"that arrangement will be rescinded (by resetting the internal " -"``_must_cancel`` flag)." +#: ../../library/asyncio-task.rst:1019 +msgid "Use :keyword:`async def` instead." msgstr "" -#: ../../library/asyncio-task.rst:1511 -msgid "Changed to rescind pending cancellation requests upon reaching zero." +#: ../../library/asyncio-task.rst:1023 +msgid "Return ``True`` if *obj* is a :ref:`coroutine object `." msgstr "" +"*obj* が :ref:`コルーチンオブジェクト ` であれば ``True`` を返しま" +"す。" -#: ../../library/asyncio-task.rst:1516 +#: ../../library/asyncio-task.rst:1025 msgid "" -"Return the number of pending cancellation requests to this Task, i.e., the " -"number of calls to :meth:`cancel` less the number of :meth:`uncancel` calls." +"This method is different from :func:`inspect.iscoroutine` because it returns " +"``True`` for generator-based coroutines." msgstr "" -#: ../../library/asyncio-task.rst:1520 -msgid "" -"Note that if this number is greater than zero but the Task is still " -"executing, :meth:`cancelled` will still return ``False``. This is because " -"this number can be lowered by calling :meth:`uncancel`, which can lead to " -"the task not being cancelled after all if the cancellation requests go down " -"to zero." +#: ../../library/asyncio-task.rst:1030 +msgid "Return ``True`` if *func* is a :ref:`coroutine function `." msgstr "" -#: ../../library/asyncio-task.rst:1526 +#: ../../library/asyncio-task.rst:1033 msgid "" -"This method is used by asyncio's internals and isn't expected to be used by " -"end-user code. See :meth:`uncancel` for more details." +"This method is different from :func:`inspect.iscoroutinefunction` because it " +"returns ``True`` for generator-based coroutine functions decorated with :" +"func:`@coroutine `." msgstr "" diff --git a/library/asyncio.po b/library/asyncio.po index 14e580ba4..55d57e2e5 100644 --- a/library/asyncio.po +++ b/library/asyncio.po @@ -1,62 +1,48 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 -# 石井明久, 2024 -# Takanori Suzuki , 2024 +# tomo, 2019 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:55+0000\n" -"Last-Translator: Takanori Suzuki , 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 17:49+0000\n" +"Last-Translator: tomo, 2019\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" -#: ../../library/asyncio.rst:91 +#: ../../library/asyncio.rst:66 msgid "High-level APIs" -msgstr "高水準 API" +msgstr "高レベル API" -#: ../../library/asyncio.rst:104 +#: ../../library/asyncio.rst:77 msgid "Low-level APIs" -msgstr "低水準 API" +msgstr "低レベル API" -#: ../../library/asyncio.rst:115 +#: ../../library/asyncio.rst:87 msgid "Guides and Tutorials" msgstr "ガイドとチュートリアル" #: ../../library/asyncio.rst:2 -msgid ":mod:`!asyncio` --- Asynchronous I/O" -msgstr ":mod:`!asyncio` --- 非同期 I/O" +msgid ":mod:`asyncio` --- Asynchronous I/O" +msgstr ":mod:`asyncio` --- 非同期 I/O" -#: ../../library/asyncio.rst-1 +#: ../../library/asyncio.rstNone msgid "Hello World!" msgstr "Hello World!" -#: ../../library/asyncio.rst:13 -msgid "" -"import asyncio\n" -"\n" -"async def main():\n" -" print('Hello ...')\n" -" await asyncio.sleep(1)\n" -" print('... World!')\n" -"\n" -"asyncio.run(main())" -msgstr "" - -#: ../../library/asyncio.rst:22 +#: ../../library/asyncio.rst:23 msgid "" "asyncio is a library to write **concurrent** code using the **async/await** " "syntax." @@ -64,7 +50,7 @@ msgstr "" "asyncio は **async/await** 構文を使い **並行処理の** コードを書くためのライブ" "ラリです。" -#: ../../library/asyncio.rst:25 +#: ../../library/asyncio.rst:26 msgid "" "asyncio is used as a foundation for multiple Python asynchronous frameworks " "that provide high-performance network and web-servers, database connection " @@ -74,7 +60,7 @@ msgstr "" "分散タスクキューなどの複数の非同期 Python フレームワークの基盤として使われて" "います。" -#: ../../library/asyncio.rst:29 +#: ../../library/asyncio.rst:30 msgid "" "asyncio is often a perfect fit for IO-bound and high-level **structured** " "network code." @@ -82,34 +68,34 @@ msgstr "" "asyncio は多くの場合、 IOバウンドだったり高レベルの **構造化された** ネット" "ワークコードに完璧に適しています。" -#: ../../library/asyncio.rst:32 +#: ../../library/asyncio.rst:33 msgid "asyncio provides a set of **high-level** APIs to:" msgstr "asyncio は次の目的で **高レベル** API を提供しています:" -#: ../../library/asyncio.rst:34 +#: ../../library/asyncio.rst:35 msgid "" ":ref:`run Python coroutines ` concurrently and have full control " "over their execution;" msgstr "" "並行に :ref:`Python コルーチンを起動 ` し、実行全体を管理する" -#: ../../library/asyncio.rst:37 +#: ../../library/asyncio.rst:38 msgid "perform :ref:`network IO and IPC `;" msgstr ":ref:`ネットワーク IO と IPC ` を執り行う" -#: ../../library/asyncio.rst:39 +#: ../../library/asyncio.rst:40 msgid "control :ref:`subprocesses `;" msgstr ":ref:`subprocesses ` を管理する" -#: ../../library/asyncio.rst:41 +#: ../../library/asyncio.rst:42 msgid "distribute tasks via :ref:`queues `;" msgstr ":ref:`キュー ` を使ってタスクを分散する" -#: ../../library/asyncio.rst:43 +#: ../../library/asyncio.rst:44 msgid ":ref:`synchronize ` concurrent code;" msgstr "並列処理のコードを :ref:`同期 ` させる" -#: ../../library/asyncio.rst:45 +#: ../../library/asyncio.rst:46 msgid "" "Additionally, there are **low-level** APIs for *library and framework " "developers* to:" @@ -117,19 +103,19 @@ msgstr "" "これに加えて、 *ライブラリやフレームワークの開発者* が次のことをするための **" "低レベル** API があります:" -#: ../../library/asyncio.rst:48 +#: ../../library/asyncio.rst:49 msgid "" "create and manage :ref:`event loops `, which provide " -"asynchronous APIs for :ref:`networking `, running :ref:" -"`subprocesses `, handling :ref:`OS signals " -"`, etc;" +"asynchronous APIs for :meth:`networking `, running :meth:" +"`subprocesses `, handling :meth:`OS signals `, etc;" msgstr "" -":ref:`ネットワーク通信 ` 、 :ref:`サブプロセス " -"` の実行、 :ref:`OS シグナル " -"` の取り扱いなどのための非同期 API を提供する :ref:`" -"イベントループ ` の作成と管理を行う" +":meth:`ネットワーク通信 ` 、 :meth:`サブプロセス ` の実行、 :meth:`OS シグナル ` の取" +"り扱いなどのための非同期 API を提供する :ref:`イベントループ ` の作成と管理を行う" -#: ../../library/asyncio.rst:53 +#: ../../library/asyncio.rst:54 msgid "" "implement efficient protocols using :ref:`transports `;" @@ -137,7 +123,7 @@ msgstr "" ":ref:`Transport ` を使った効率的な protocol を" "実装します" -#: ../../library/asyncio.rst:56 +#: ../../library/asyncio.rst:57 msgid "" ":ref:`bridge ` callback-based libraries and code with async/" "await syntax." @@ -145,62 +131,10 @@ msgstr "" "コールバックを用いたライブラリと async/await 構文を使ったコードの :ref:`橋渡" "し `" -#: ../../includes/wasm-notavail.rst:3 -msgid "Availability" -msgstr "" - -#: ../../includes/wasm-notavail.rst:5 -msgid "" -"This module does not work or is not available on WebAssembly. See :ref:`wasm-" -"availability` for more information." -msgstr "" -"このモジュールは WebAssembly では動作しないか、利用不可です。詳しくは、:ref:" -"`wasm-availability` を見てください。" - -#: ../../library/asyncio.rst:64 -msgid "asyncio REPL" -msgstr "" - #: ../../library/asyncio.rst:65 -msgid "" -"You can experiment with an ``asyncio`` concurrent context in the :term:" -"`REPL`:" -msgstr "" - -#: ../../library/asyncio.rst:67 -msgid "" -"$ python -m asyncio\n" -"asyncio REPL ...\n" -"Use \"await\" directly instead of \"asyncio.run()\".\n" -"Type \"help\", \"copyright\", \"credits\" or \"license\" for more " -"information.\n" -">>> import asyncio\n" -">>> await asyncio.sleep(10, result='hello')\n" -"'hello'" -msgstr "" - -#: ../../library/asyncio.rst:77 -msgid "" -"Raises an :ref:`auditing event ` ``cpython.run_stdin`` with no " -"arguments." -msgstr "" -"引数無しで :ref:`監査イベント ` ``cpython.run_stdin`` を送出しま" -"す。 " - -#: ../../library/asyncio.rst:79 -msgid "(also 3.11.10, 3.10.15, 3.9.20, and 3.8.20) Emits audit events." -msgstr "" - -#: ../../library/asyncio.rst:82 -msgid "" -"Uses PyREPL if possible, in which case :envvar:`PYTHONSTARTUP` is also " -"executed. Emits audit events." -msgstr "" - -#: ../../library/asyncio.rst:90 msgid "Reference" msgstr "リファレンス" -#: ../../library/asyncio.rst:124 +#: ../../library/asyncio.rst:96 msgid "The source code for asyncio can be found in :source:`Lib/asyncio/`." msgstr "asyncio のソースコードは :source:`Lib/asyncio/` にあります。" diff --git a/library/asyncore.po b/library/asyncore.po index 7650985d0..9efd01429 100644 --- a/library/asyncore.po +++ b/library/asyncore.po @@ -1,40 +1,498 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # +# Translators: +# Yusuke Miyazaki , 2017 +# 秘湯 , 2017 +# Masato HASHIMOTO , 2017 +# Arihiro TAKASE, 2017 +# Inada Naoki , 2017 +# Shun Sakurai, 2017 +# tomo, 2019 +# #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-13 14:21+0000\n" -"PO-Revision-Date: 2024-11-19 01:02+0000\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 17:50+0000\n" +"Last-Translator: tomo, 2019\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/asyncore.rst:2 -msgid ":mod:`!asyncore` --- Asynchronous socket handler" +msgid ":mod:`asyncore` --- Asynchronous socket handler" +msgstr ":mod:`asyncore` --- 非同期ソケットハンドラ" + +#: ../../library/asyncore.rst:13 +msgid "**Source code:** :source:`Lib/asyncore.py`" +msgstr "**ソースコード:** :source:`Lib/asyncore.py`" + +#: ../../library/asyncore.rst:15 +msgid "Please use :mod:`asyncio` instead." +msgstr "代わりに :mod:`asyncio` を使ってください。" + +#: ../../library/asyncore.rst:22 +msgid "" +"This module exists for backwards compatibility only. For new code we " +"recommend using :mod:`asyncio`." +msgstr "" +"このモジュールは後方互換性のためだけに存在します。新しいコードでは :mod:" +"`asyncio` を利用することを推奨します。" + +#: ../../library/asyncore.rst:25 +msgid "" +"This module provides the basic infrastructure for writing asynchronous " +"socket service clients and servers." +msgstr "" +"このモジュールは、非同期ソケットサービスのクライアント・サーバを開発するため" +"の基盤として使われます。" + +#: ../../library/asyncore.rst:28 +msgid "" +"There are only two ways to have a program on a single processor do \"more " +"than one thing at a time.\" Multi-threaded programming is the simplest and " +"most popular way to do it, but there is another very different technique, " +"that lets you have nearly all the advantages of multi-threading, without " +"actually using multiple threads. It's really only practical if your " +"program is largely I/O bound. If your program is processor bound, then pre-" +"emptive scheduled threads are probably what you really need. Network " +"servers are rarely processor bound, however." +msgstr "" +"CPUが一つしかない場合、プログラムが\"二つのことを同時に\"実行する方法は二つし" +"かありません。もっとも簡単で一般的なのはマルチスレッドを利用する方法ですが、" +"これとはまったく異なるテクニックで、一つのスレッドだけでマルチスレッドと同じ" +"ような効果を得られるテクニックがあります。このテクニックはI/O処理が中心である" +"場合にのみ有効で、CPU負荷の高いプログラムでは効果が無く、この場合にはプリエン" +"プティブなスケジューリングが可能なスレッドが有効でしょう。しかし、多くの場" +"合、ネットワークサーバではCPU負荷よりはIO負荷が問題となります。" + +#: ../../library/asyncore.rst:37 +msgid "" +"If your operating system supports the :c:func:`select` system call in its I/" +"O library (and nearly all do), then you can use it to juggle multiple " +"communication channels at once; doing other work while your I/O is taking " +"place in the \"background.\" Although this strategy can seem strange and " +"complex, especially at first, it is in many ways easier to understand and " +"control than multi-threaded programming. The :mod:`asyncore` module solves " +"many of the difficult problems for you, making the task of building " +"sophisticated high-performance network servers and clients a snap. For " +"\"conversational\" applications and protocols the companion :mod:`asynchat` " +"module is invaluable." +msgstr "" +"もしOSのI/Oライブラリがシステムコール :c:func:`select` をサポートしている場合" +"(ほとんどの場合はサポートされている)、I/O処理は\"バックグラウンド\"で実行" +"し、その間に他の処理を実行すれば、複数の通信チャネルを同時にこなすことができ" +"ます。一見、この戦略は奇妙で複雑に思えるかもしれませんが、いろいろな面でマル" +"チスレッドよりも理解しやすく、制御も容易です。 :mod:`asyncore` は多くの複雑な" +"問題を解決済みなので、洗練され、パフォーマンスにも優れたネットワークサーバと" +"クライアントを簡単に開発することができます。とくに、 :mod:`asynchat` のよう" +"な、対話型のアプリケーションやプロトコルには非常に有効でしょう。" + +#: ../../library/asyncore.rst:48 +msgid "" +"The basic idea behind both modules is to create one or more network " +"*channels*, instances of class :class:`asyncore.dispatcher` and :class:" +"`asynchat.async_chat`. Creating the channels adds them to a global map, " +"used by the :func:`loop` function if you do not provide it with your own " +"*map*." +msgstr "" +"基本的には、この二つのモジュールを使う場合は一つ以上のネットワーク *チャネル" +"* を :class:`asyncore.dispatcher` クラス、または :class:`asynchat." +"async_chat` のインスタンスとして作成します。作成されたチャネルはグローバル" +"マップに登録され、 :func:`loop` 関数で参照されます。 :func:`loop` には、専用" +"の *マップ* を渡す事も可能です。" + +#: ../../library/asyncore.rst:54 +msgid "" +"Once the initial channel(s) is(are) created, calling the :func:`loop` " +"function activates channel service, which continues until the last channel " +"(including any that have been added to the map during asynchronous service) " +"is closed." +msgstr "" +"チャネルを生成後、 :func:`loop` を呼び出すとチャネル処理が開始し、最後のチャ" +"ネル(非同期処理中にマップに追加されたチャネルを含む)が閉じるまで継続しま" +"す。" + +#: ../../library/asyncore.rst:61 +msgid "" +"Enter a polling loop that terminates after count passes or all open channels " +"have been closed. All arguments are optional. The *count* parameter " +"defaults to ``None``, resulting in the loop terminating only when all " +"channels have been closed. The *timeout* argument sets the timeout " +"parameter for the appropriate :func:`~select.select` or :func:`~select.poll` " +"call, measured in seconds; the default is 30 seconds. The *use_poll* " +"parameter, if true, indicates that :func:`~select.poll` should be used in " +"preference to :func:`~select.select` (the default is ``False``)." +msgstr "" +"ポーリングループを開始し、count 回が過ぎるか、全てのオープン済みチャネルがク" +"ローズされた場合のみ終了します。全ての引数はオプションです。引数 *count* のデ" +"フォルト値は ``None`` で、ループは全てのチャネルがクローズされた場合のみ終了" +"します。引数 *timeout* は :func:`~select.select` または :func:`~select.poll` " +"の引数 timeout として渡され、秒単位で指定します。デフォルト値は 30 秒です。引" +"数 *use_poll* が真の場合、 :func:`~select.select` ではなく :func:`~select." +"poll` が使われます (デフォルト値は ``False`` です)。" + +#: ../../library/asyncore.rst:70 +msgid "" +"The *map* parameter is a dictionary whose items are the channels to watch. " +"As channels are closed they are deleted from their map. If *map* is " +"omitted, a global map is used. Channels (instances of :class:`asyncore." +"dispatcher`, :class:`asynchat.async_chat` and subclasses thereof) can freely " +"be mixed in the map." +msgstr "" +"引数 *map* には、監視するチャネルをアイテムとして格納した辞書を指定します。" +"チャネルがクローズされた時に *map* からそのチャネルが削除されます。 *map* が" +"省略された場合、グローバルなマップが使用されます。チャネル (:class:`asyncore." +"dispatcher`, :class:`asynchat.async_chat` とそのサブクラス) は自由に混ぜて " +"map に入れることができます。" + +#: ../../library/asyncore.rst:79 +msgid "" +"The :class:`dispatcher` class is a thin wrapper around a low-level socket " +"object. To make it more useful, it has a few methods for event-handling " +"which are called from the asynchronous loop. Otherwise, it can be treated " +"as a normal non-blocking socket object." msgstr "" +":class:`dispatcher` クラスは、低レベルソケットオブジェクトの薄いラッパーで" +"す。便宜上、非同期ループから呼び出されるイベント処理メソッドを追加しています" +"が、これ以外の点では、non-blockingなソケットと同様です。" -#: ../../library/asyncore.rst:10 +#: ../../library/asyncore.rst:84 msgid "" -"This module is no longer part of the Python standard library. It was :ref:" -"`removed in Python 3.12 ` after being deprecated in " -"Python 3.6. The removal was decided in :pep:`594`." +"The firing of low-level events at certain times or in certain connection " +"states tells the asynchronous loop that certain higher-level events have " +"taken place. For example, if we have asked for a socket to connect to " +"another host, we know that the connection has been made when the socket " +"becomes writable for the first time (at this point you know that you may " +"write to it with the expectation of success). The implied higher-level " +"events are:" msgstr "" +"非同期ループ内で低レベルイベントが発生した場合、発生のタイミングやコネクショ" +"ンの状態から特定の高レベルイベントへと置き換えることができます。例えばソケッ" +"トを他のホストに接続する場合、最初の書き込み可能イベントが発生すれば接続が完" +"了した事が分かります(この時点で、ソケットへの書き込みは成功すると考えられ" +"る)。このように判定できる高レベルイベントを以下に示します:" + +#: ../../library/asyncore.rst:93 +msgid "Event" +msgstr "Event" + +#: ../../library/asyncore.rst:93 +msgid "Description" +msgstr "説明" + +#: ../../library/asyncore.rst:95 +msgid "``handle_connect()``" +msgstr "``handle_connect()``" + +#: ../../library/asyncore.rst:95 +msgid "Implied by the first read or write event" +msgstr "最初にreadもしくはwriteイベントが発生した時" + +#: ../../library/asyncore.rst:98 +msgid "``handle_close()``" +msgstr "``handle_close()``" + +#: ../../library/asyncore.rst:98 +msgid "Implied by a read event with no data available" +msgstr "読み込み可能なデータなしでreadイベントが発生した時" -#: ../../library/asyncore.rst:14 -msgid "Applications should use the :mod:`asyncio` module instead." +#: ../../library/asyncore.rst:101 +msgid "``handle_accepted()``" +msgstr "``handle_accepted()``" + +#: ../../library/asyncore.rst:101 +msgid "Implied by a read event on a listening socket" +msgstr "listen中のソケットでreadイベントが発生した時" + +#: ../../library/asyncore.rst:105 +msgid "" +"During asynchronous processing, each mapped channel's :meth:`readable` and :" +"meth:`writable` methods are used to determine whether the channel's socket " +"should be added to the list of channels :c:func:`select`\\ ed or :c:func:" +"`poll`\\ ed for read and write events." msgstr "" +"非同期処理中、マップに登録されたチャネルの :meth:`readable` メソッドと :meth:" +"`writable` メソッドが呼び出され、 :c:func:`select` か :c:func:`poll` でread/" +"writeイベントを検出するリストに登録するか否かを判定します。" + +#: ../../library/asyncore.rst:110 +msgid "" +"Thus, the set of channel events is larger than the basic socket events. The " +"full set of methods that can be overridden in your subclass follows:" +msgstr "" +"このようにして、チャネルでは低レベルなソケットイベントの種類より多くの種類の" +"イベントを検出する事ができます。以下にあげるイベントは、サブクラスでオーバラ" +"イドすることが可能です:" + +#: ../../library/asyncore.rst:116 +msgid "" +"Called when the asynchronous loop detects that a :meth:`read` call on the " +"channel's socket will succeed." +msgstr "" +"非同期ループで、チャネルのソケットの :meth:`read` メソッドの呼び出しが成功し" +"た時に呼び出されます。" + +#: ../../library/asyncore.rst:122 +msgid "" +"Called when the asynchronous loop detects that a writable socket can be " +"written. Often this method will implement the necessary buffering for " +"performance. For example::" +msgstr "" +"非同期ループで、書き込み可能ソケットが実際に書き込み可能になった時に呼び出さ" +"れます。このメソッドでは、しばしばパフォーマンスの向上のために必要なバッファ" +"リングを実装します。例::" + +#: ../../library/asyncore.rst:133 +msgid "" +"Called when there is out of band (OOB) data for a socket connection. This " +"will almost never happen, as OOB is tenuously supported and rarely used." +msgstr "" +"out of band (OOB)データが検出された時に呼び出されます。OOBはあまりサポートさ" +"れておらず、また滅多に使われないので、:meth:`handle_expt` が呼び出されること" +"はほとんどありません。" + +#: ../../library/asyncore.rst:139 +msgid "" +"Called when the active opener's socket actually makes a connection. Might " +"send a \"welcome\" banner, or initiate a protocol negotiation with the " +"remote endpoint, for example." +msgstr "" +"ソケットの接続が確立した時に呼び出されます。\"welcome\"バナーの送信、プロトコ" +"ルネゴシエーションの初期化などを行います。" + +#: ../../library/asyncore.rst:146 +msgid "Called when the socket is closed." +msgstr "ソケットが閉じた時に呼び出されます。" + +#: ../../library/asyncore.rst:151 +msgid "" +"Called when an exception is raised and not otherwise handled. The default " +"version prints a condensed traceback." +msgstr "" +"捕捉されない例外が発生した時に呼び出されます。デフォルトでは、短縮したトレー" +"スバック情報が出力されます。" + +#: ../../library/asyncore.rst:157 +msgid "" +"Called on listening channels (passive openers) when a connection can be " +"established with a new remote endpoint that has issued a :meth:`connect` " +"call for the local endpoint. Deprecated in version 3.2; use :meth:" +"`handle_accepted` instead." +msgstr "" +"listen 中のチャネル (受動的にオープンしたもの) がリモートホストからの :meth:" +"`connect` で接続され、接続が確立した時に呼び出されます。\n" +"バージョン 3.2 で非推奨になりました; 代わりに :meth:`handle_accepted` を使っ" +"てください。" + +#: ../../library/asyncore.rst:167 +msgid "" +"Called on listening channels (passive openers) when a connection has been " +"established with a new remote endpoint that has issued a :meth:`connect` " +"call for the local endpoint. *sock* is a *new* socket object usable to send " +"and receive data on the connection, and *addr* is the address bound to the " +"socket on the other end of the connection." +msgstr "" +"listen 中のチャネル (受動的にオープンしたもの) がリモートホストからの :meth:" +"`connect` で接続され、接続が確立した時に呼び出されます。\n" +"*sock* はその接続でデータを送受信するのに使える *新しい* ソケットオブジェクト" +"で、 *addr* は接続の対向のソケットに bind されているアドレスです。" + +#: ../../library/asyncore.rst:178 +msgid "" +"Called each time around the asynchronous loop to determine whether a " +"channel's socket should be added to the list on which read events can " +"occur. The default method simply returns ``True``, indicating that by " +"default, all channels will be interested in read events." +msgstr "" +"非同期ループ中に呼び出され、readイベントの監視リストに加えるか否かを決定しま" +"す。デフォルトのメソッドでは ``True`` を返し、readイベントの発生を監視しま" +"す。" + +#: ../../library/asyncore.rst:186 +msgid "" +"Called each time around the asynchronous loop to determine whether a " +"channel's socket should be added to the list on which write events can " +"occur. The default method simply returns ``True``, indicating that by " +"default, all channels will be interested in write events." +msgstr "" +"非同期ループ中に呼び出され、writeイベントの監視リストに加えるか否かを決定しま" +"す。デフォルトのメソッドでは ``True`` を返し、writeイベントの発生を監視しま" +"す。" + +#: ../../library/asyncore.rst:192 +msgid "" +"In addition, each channel delegates or extends many of the socket methods. " +"Most of these are nearly identical to their socket partners." +msgstr "" +"さらに、チャネルにはソケットのメソッドとほぼ同じメソッドがあり、チャネルはソ" +"ケットのメソッドの多くを委譲・拡張しており、ソケットとほぼ同じメソッドを持っ" +"ています。" + +#: ../../library/asyncore.rst:198 +msgid "" +"This is identical to the creation of a normal socket, and will use the same " +"options for creation. Refer to the :mod:`socket` documentation for " +"information on creating sockets." +msgstr "" +"引数も含め、通常のソケット生成と同一です。ソケットの生成については、 :mod:" +"`socket` モジュールのドキュメントを参照してください。" + +#: ../../library/asyncore.rst:202 +msgid "*family* and *type* arguments can be omitted." +msgstr "*family* 引数と *type* 引数が省略可能になりました。" + +#: ../../library/asyncore.rst:208 +msgid "" +"As with the normal socket object, *address* is a tuple with the first " +"element the host to connect to, and the second the port number." +msgstr "" +"通常のソケットオブジェクトと同様、*address* には一番目の値が接続先ホスト、\\ " +"2番目の値がポート番号であるタプルを指定します。" + +#: ../../library/asyncore.rst:214 +msgid "Send *data* to the remote end-point of the socket." +msgstr "リモート側の端点に *data* を送出します。" + +#: ../../library/asyncore.rst:219 +msgid "" +"Read at most *buffer_size* bytes from the socket's remote end-point. An " +"empty bytes object implies that the channel has been closed from the other " +"end." +msgstr "" +"リモート側の端点より、最大 *buffer_size* バイトのデータを読み込みます。長さ0" +"のバイト列オブジェクトが返ってきた場合、チャネルはリモートから切断された事を" +"示します。" + +#: ../../library/asyncore.rst:223 +msgid "" +"Note that :meth:`recv` may raise :exc:`BlockingIOError` , even though :func:" +"`select.select` or :func:`select.poll` has reported the socket ready for " +"reading." +msgstr "" +":func:`select.select` や :func:`select.poll` がソケットが読み込みできる状態に" +"あると報告したとしても、 :meth:`recv` が :exc:`BlockingIOError` を送出する場" +"合があります。" + +#: ../../library/asyncore.rst:230 +msgid "" +"Listen for connections made to the socket. The *backlog* argument specifies " +"the maximum number of queued connections and should be at least 1; the " +"maximum value is system-dependent (usually 5)." +msgstr "" +"ソケットへの接続を待ちます。引数 *backlog* は、キューに追加できるコネクション" +"の最大数 (1 以上) を指定します。最大値はシステムに依存します(通常は5)。" + +#: ../../library/asyncore.rst:237 +msgid "" +"Bind the socket to *address*. The socket must not already be bound. (The " +"format of *address* depends on the address family --- refer to the :mod:" +"`socket` documentation for more information.) To mark the socket as re-" +"usable (setting the :const:`SO_REUSEADDR` option), call the :class:" +"`dispatcher` object's :meth:`set_reuse_addr` method." +msgstr "" +"ソケットを *address* にバインドします。ソケットはバインド済みであってはなりま" +"せん。 (*address* の形式は、アドレスファミリに依存します。 :mod:`socket` モ" +"ジュールを参照のこと。) ソケットを再利用可能にする (:const:`SO_REUSEADDR` オ" +"プションを設定する) には、 :class:`dispatcher` オブジェクトの :meth:" +"`set_reuse_addr` メソッドを呼び出してください。" + +#: ../../library/asyncore.rst:246 +msgid "" +"Accept a connection. The socket must be bound to an address and listening " +"for connections. The return value can be either ``None`` or a pair ``(conn, " +"address)`` where *conn* is a *new* socket object usable to send and receive " +"data on the connection, and *address* is the address bound to the socket on " +"the other end of the connection. When ``None`` is returned it means the " +"connection didn't take place, in which case the server should just ignore " +"this event and keep listening for further incoming connections." +msgstr "" +"接続を受け入れます。ソケットはアドレスにバインド済みであり、:meth:`listen` で" +"接続待ち状態でなければなりません。戻り値は ``None`` か ``(conn, address)`` の" +"ペアで、*conn* はデータの送受信を行う **新しい** ソケットオブジェクト、" +"*address* は接続先ソケットがバインドされているアドレスです。``None`` が返され" +"た場合、接続が起こらなかったことを意味します。その場合、サーバーはこのイベン" +"トを無視して後続の接続を待ち続けるべきです。" + +#: ../../library/asyncore.rst:258 +msgid "" +"Close the socket. All future operations on the socket object will fail. The " +"remote end-point will receive no more data (after queued data is flushed). " +"Sockets are automatically closed when they are garbage-collected." +msgstr "" +"ソケットをクローズします。以降の全ての操作は失敗します。リモート端点では、" +"キューに溜まったデータ以外、これ以降のデータ受信は行えません。ソケットはガ" +"ベージコレクト時に自動的にクローズされます。" + +#: ../../library/asyncore.rst:266 +msgid "" +"A :class:`dispatcher` subclass which adds simple buffered output capability, " +"useful for simple clients. For more sophisticated usage use :class:`asynchat." +"async_chat`." +msgstr "" +":class:`dispatcher` のサブクラスで、シンプルなバッファされた出力機能を持ちま" +"す。シンプルなクライアントプログラムに適しています。もっと高レベルな場合に" +"は :class:`asynchat.async_chat` を利用してください。" + +#: ../../library/asyncore.rst:272 +msgid "" +"A file_dispatcher takes a file descriptor or :term:`file object` along with " +"an optional map argument and wraps it for use with the :c:func:`poll` or :c:" +"func:`loop` functions. If provided a file object or anything with a :c:func:" +"`fileno` method, that method will be called and passed to the :class:" +"`file_wrapper` constructor." +msgstr "" +"file_dispatcher はファイルデスクリプタか :term:`ファイルオブジェクト ` とオプションとして map を引数にとって、 :c:func:`poll` か :c:func:" +"`loop` 関数で利用できるようにラップします。与えられたファイルオブジェクトなど" +"が :c:func:`fileno` メソッドを持っているとき、そのメソッドが呼び出されて戻り" +"値が :class:`file_wrapper` のコンストラクタに渡されます。" + +#: ../../library/asyncore.rst:278 ../../library/asyncore.rst:287 +msgid ":ref:`Availability `: Unix." +msgstr ":ref:`利用可能な環境 `: Unix。" + +#: ../../library/asyncore.rst:282 +msgid "" +"A file_wrapper takes an integer file descriptor and calls :func:`os.dup` to " +"duplicate the handle so that the original handle may be closed independently " +"of the file_wrapper. This class implements sufficient methods to emulate a " +"socket for use by the :class:`file_dispatcher` class." +msgstr "" +"file_wrapper は整数のファイルデスクリプタを受け取って :func:`os.dup` を呼び出" +"してハンドルを複製するので、元のハンドルは file_wrapper と独立して\\ close さ" +"れます。このクラスは :class:`file_dispatcher` クラスが使うために必要なソケッ" +"トをエミュレートするメソッドを実装しています。" + +#: ../../library/asyncore.rst:293 +msgid "asyncore Example basic HTTP client" +msgstr "asyncoreの例: 簡単なHTTPクライアント" + +#: ../../library/asyncore.rst:295 +msgid "" +"Here is a very basic HTTP client that uses the :class:`dispatcher` class to " +"implement its socket handling::" +msgstr "" +"基本的なサンプルとして、以下に非常に単純なHTTPクライアントを示します。この" +"HTTPクライアントは :class:`dispatcher` クラスでソケットを利用しています::" + +#: ../../library/asyncore.rst:332 +msgid "asyncore Example basic echo server" +msgstr "基本的な echo サーバーの例" -#: ../../library/asyncore.rst:16 +#: ../../library/asyncore.rst:334 msgid "" -"The last version of Python that provided the :mod:`!asyncore` module was " -"`Python 3.11 `_." +"Here is a basic echo server that uses the :class:`dispatcher` class to " +"accept connections and dispatches the incoming connections to a handler::" msgstr "" +"この例の基本的な echoサーバーは、 :class:`dispatcher` を利用して接続を受けつ" +"け、接続をハンドラーにディスパッチします::" diff --git a/library/atexit.po b/library/atexit.po index 255b09002..701588406 100644 --- a/library/atexit.po +++ b/library/atexit.po @@ -1,32 +1,33 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 +# Arihiro TAKASE, 2017 +# Masato HASHIMOTO , 2017 +# tomo, 2019 # Shin Saito, 2021 -# 石井明久, 2024 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-13 14:21+0000\n" -"PO-Revision-Date: 2021-06-28 00:55+0000\n" -"Last-Translator: 石井明久, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-06-30 06:46+0000\n" +"PO-Revision-Date: 2017-02-16 17:50+0000\n" +"Last-Translator: Shin Saito, 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/atexit.rst:2 -msgid ":mod:`!atexit` --- Exit handlers" -msgstr ":mod:`!atexit` --- 終了ハンドラー" +msgid ":mod:`atexit` --- Exit handlers" +msgstr ":mod:`atexit` --- 終了ハンドラ" #: ../../library/atexit.rst:12 msgid "" @@ -55,21 +56,13 @@ msgstr "" #: ../../library/atexit.rst:23 msgid "" -"**Note:** The effect of registering or unregistering functions from within a " -"cleanup function is undefined." -msgstr "" -"**注意:** クリーンアップ関数内からの関数の登録・登録解除効果は定義されていま" -"せん。" - -#: ../../library/atexit.rst:26 -msgid "" "When used with C-API subinterpreters, registered functions are local to the " "interpreter they were registered in." msgstr "" "C-API のサブインタープリタで使われているとき、登録された関数は登録先のイン" "タープリタのローカルな関数になります。" -#: ../../library/atexit.rst:32 +#: ../../library/atexit.rst:29 msgid "" "Register *func* as a function to be executed at termination. Any optional " "arguments that are to be passed to *func* must be passed as arguments to :" @@ -80,7 +73,7 @@ msgstr "" "`register` の引数として指定しなければなりません。同じ関数を同じ引数で複数回登" "録できます。" -#: ../../library/atexit.rst:37 +#: ../../library/atexit.rst:34 msgid "" "At normal program termination (for instance, if :func:`sys.exit` is called " "or the main module's execution completes), all functions registered are " @@ -94,7 +87,7 @@ msgstr "" "ルのモジュールより前に import されるので、後で後始末が行われるという仮定に基" "づいています。" -#: ../../library/atexit.rst:43 +#: ../../library/atexit.rst:40 msgid "" "If an exception is raised during execution of the exit handlers, a traceback " "is printed (unless :exc:`SystemExit` is raised) and the exception " @@ -105,34 +98,13 @@ msgstr "" "レースバックを表示して、例外の情報を保存します。全ての終了ハンドラに動作する" "チャンスを与えた後に、最後に送出された例外を再送出します。" -#: ../../library/atexit.rst:48 +#: ../../library/atexit.rst:45 msgid "" "This function returns *func*, which makes it possible to use it as a " "decorator." msgstr "この関数は *func* を返し、これをデコレータとして利用できます。" -#: ../../library/atexit.rst:52 -msgid "" -"Starting new threads or calling :func:`os.fork` from a registered function " -"can lead to race condition between the main Python runtime thread freeing " -"thread states while internal :mod:`threading` routines or the new process " -"try to use that state. This can lead to crashes rather than clean shutdown." -msgstr "" -"登録された関数から新しいスレッドを開始したり、 :func:`os.fork` を呼び出したり" -"すると、メインの Python ランタイムスレッドがスレッド状態を開放する一方で、内" -"部の :mod:`threading` ルーチンや新しいプロセスがそのスレッド状態を使用しよう" -"と試みる競合が発生します。これはクリーンなシャットダウンではなく、クラッシュ" -"につながる恐れがあります。" - -#: ../../library/atexit.rst:58 -msgid "" -"Attempts to start a new thread or :func:`os.fork` a new process in a " -"registered function now leads to :exc:`RuntimeError`." -msgstr "" -"登録された関数から新しいスレッドの開始または新しいプロセスの :func:`os.fork` " -"が試みられた場合は、 :exc:`RuntimeError` が発生するようになりました。" - -#: ../../library/atexit.rst:64 +#: ../../library/atexit.rst:51 msgid "" "Remove *func* from the list of functions to be run at interpreter shutdown. :" "func:`unregister` silently does nothing if *func* was not previously " @@ -147,11 +119,11 @@ msgstr "" "現が削除されます。削除の際の比較には等価比較 (``==``) が使われます。したがっ" "て削除したいものと同一の関数を *func* に指定する必要はありません。" -#: ../../library/atexit.rst:74 +#: ../../library/atexit.rst:62 msgid "Module :mod:`readline`" msgstr ":mod:`readline` モジュール" -#: ../../library/atexit.rst:75 +#: ../../library/atexit.rst:62 msgid "" "Useful example of :mod:`atexit` to read and write :mod:`readline` history " "files." @@ -159,11 +131,11 @@ msgstr "" ":mod:`readline` ヒストリファイルを読み書きするための :mod:`atexit` の有用な例" "です。" -#: ../../library/atexit.rst:82 +#: ../../library/atexit.rst:69 msgid ":mod:`atexit` Example" msgstr ":mod:`atexit` の例" -#: ../../library/atexit.rst:84 +#: ../../library/atexit.rst:71 msgid "" "The following simple example demonstrates how a module can initialize a " "counter from a file when it is imported and save the counter's updated value " @@ -174,28 +146,7 @@ msgstr "" "プログラムが終了するときにアプリケーションがこのモジュールを明示的に呼び出さ" "なくてもカウンタが更新されるようにする方法を示しています。 ::" -#: ../../library/atexit.rst:89 -msgid "" -"try:\n" -" with open('counterfile') as infile:\n" -" _count = int(infile.read())\n" -"except FileNotFoundError:\n" -" _count = 0\n" -"\n" -"def incrcounter(n):\n" -" global _count\n" -" _count = _count + n\n" -"\n" -"def savecounter():\n" -" with open('counterfile', 'w') as outfile:\n" -" outfile.write('%d' % _count)\n" -"\n" -"import atexit\n" -"\n" -"atexit.register(savecounter)" -msgstr "" - -#: ../../library/atexit.rst:107 +#: ../../library/atexit.rst:94 msgid "" "Positional and keyword arguments may also be passed to :func:`register` to " "be passed along to the registered function when it is called::" @@ -203,32 +154,11 @@ msgstr "" ":func:`register` に指定した位置引数とキーワード引数は登録した関数を呼び出す際" "に渡されます::" -#: ../../library/atexit.rst:110 -msgid "" -"def goodbye(name, adjective):\n" -" print('Goodbye %s, it was %s to meet you.' % (name, adjective))\n" -"\n" -"import atexit\n" -"\n" -"atexit.register(goodbye, 'Donny', 'nice')\n" -"# or:\n" -"atexit.register(goodbye, adjective='nice', name='Donny')" -msgstr "" - -#: ../../library/atexit.rst:119 +#: ../../library/atexit.rst:106 msgid "Usage as a :term:`decorator`::" msgstr ":term:`デコレータ ` として利用する例::" -#: ../../library/atexit.rst:121 -msgid "" -"import atexit\n" -"\n" -"@atexit.register\n" -"def goodbye():\n" -" print('You are now leaving the Python sector.')" -msgstr "" - -#: ../../library/atexit.rst:127 +#: ../../library/atexit.rst:114 msgid "This only works with functions that can be called without arguments." msgstr "" "デコレータとして利用できるのは、その関数が引数なしで呼び出された場合に限られ" diff --git a/library/audioop.po b/library/audioop.po index b112461ca..dbb436729 100644 --- a/library/audioop.po +++ b/library/audioop.po @@ -1,36 +1,417 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # +# Translators: +# Yusuke Miyazaki , 2017 +# Nozomu Kaneko , 2017 +# Takeshi Mizumoto , 2017 +# Arihiro TAKASE, 2017 +# #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-13 14:21+0000\n" -"PO-Revision-Date: 2024-11-19 01:02+0000\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 17:50+0000\n" +"Last-Translator: Arihiro TAKASE, 2017\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/audioop.rst:2 -msgid ":mod:`!audioop` --- Manipulate raw audio data" -msgstr "" +msgid ":mod:`audioop` --- Manipulate raw audio data" +msgstr ":mod:`audioop` --- 生の音声データを操作する" -#: ../../library/audioop.rst:10 +#: ../../library/audioop.rst:9 msgid "" -"This module is no longer part of the Python standard library. It was :ref:" -"`removed in Python 3.13 ` after being deprecated in " -"Python 3.11. The removal was decided in :pep:`594`." +"The :mod:`audioop` module contains some useful operations on sound " +"fragments. It operates on sound fragments consisting of signed integer " +"samples 8, 16, 24 or 32 bits wide, stored in :term:`bytes-like objects " +"`. All scalar items are integers, unless specified " +"otherwise." msgstr "" +":mod:`audioop` モジュールは音声データの便利な操作を含んでいます。このモ" +"ジュールは、 :term:`bytes-like オブジェクト ` に保存され" +"た、符号付き整数の、ビット幅が 8, 16, 24, あるいは 32 ビットの音声データを対" +"象として操作します。特に指定されていない限り、すべての波形データ(スカラー要" +"素)は整数です。" #: ../../library/audioop.rst:14 msgid "" -"The last version of Python that provided the :mod:`!audioop` module was " -"`Python 3.12 `_." +"Support for 24-bit samples was added. All functions now accept any :term:" +"`bytes-like object`. String input now results in an immediate error." +msgstr "" +"24 bit サンプルのサポートが追加されました。すべての関数はどんな :term:`bytes-" +"like object` でも使用できます。文字列の入力は即座にエラーになります。" + +#: ../../library/audioop.rst:25 +msgid "" +"This module provides support for a-LAW, u-LAW and Intel/DVI ADPCM encodings." +msgstr "" +"このモジュールはa-LAW、u-LAWそしてIntel/DVI ADPCMエンコードをサポートしていま" +"す。" + +#: ../../library/audioop.rst:29 +msgid "" +"A few of the more complicated operations only take 16-bit samples, otherwise " +"the sample size (in bytes) is always a parameter of the operation." +msgstr "" +"複雑な操作のうちいくつかはサンプル幅が 16 ビットのデータに対してのみ働きます" +"が、それ以外は常にサンプル幅を操作のパラメタとして (バイト単位で) 渡します。" + +#: ../../library/audioop.rst:32 +msgid "The module defines the following variables and functions:" +msgstr "このモジュールでは以下の変数と関数を定義しています:" + +#: ../../library/audioop.rst:37 +msgid "" +"This exception is raised on all errors, such as unknown number of bytes per " +"sample, etc." +msgstr "" +"この例外は、未知のサンプル当たりのバイト数を指定した時など、全般的なエラーに" +"対して送出されます。" + +#: ../../library/audioop.rst:43 +msgid "" +"Return a fragment which is the addition of the two samples passed as " +"parameters. *width* is the sample width in bytes, either ``1``, ``2``, ``3`` " +"or ``4``. Both fragments should have the same length. Samples are " +"truncated in case of overflow." +msgstr "" +"パラメータとして渡された2つのサンプルの和のデータを返します。*width* はバイト" +"単位のサンプル幅で、``1``, ``2``, ``3``, ``4`` のいずれかです。両方のデータは" +"同じ長さでなければなりません。オーバーフローした場合は、切り捨てされます。" + +#: ../../library/audioop.rst:50 +msgid "" +"Decode an Intel/DVI ADPCM coded fragment to a linear fragment. See the " +"description of :func:`lin2adpcm` for details on ADPCM coding. Return a tuple " +"``(sample, newstate)`` where the sample has the width specified in *width*." +msgstr "" +"Intel/DVI ADPCM 形式のデータをリニア (linear) 形式にデコードします。 ADPCM 符" +"号化方式の詳細については :func:`lin2adpcm` の説明を参照して下さい。 " +"``(sample, newstate)`` からなるタプルを返し、サンプルは *width* に指定した幅" +"になります。" + +#: ../../library/audioop.rst:57 +msgid "" +"Convert sound fragments in a-LAW encoding to linearly encoded sound " +"fragments. a-LAW encoding always uses 8 bits samples, so *width* refers only " +"to the sample width of the output fragment here." +msgstr "" +"a-LAW形式のデータをリニア (linear) 形式に変換します。a-LAW形式は常に 8 ビット" +"のサンプルを使用するので、ここでは *width* は単に出力データのサンプル幅となり" +"ます。" + +#: ../../library/audioop.rst:64 +msgid "Return the average over all samples in the fragment." +msgstr "データ中の全サンプルの平均値を返します。" + +#: ../../library/audioop.rst:69 +msgid "" +"Return the average peak-peak value over all samples in the fragment. No " +"filtering is done, so the usefulness of this routine is questionable." +msgstr "" +"データ中の全サンプルの平均 peak-peak 振幅を返します。フィルタリングを行ってい" +"ない場合、このルーチンの有用性は疑問です。" + +#: ../../library/audioop.rst:75 +msgid "" +"Return a fragment that is the original fragment with a bias added to each " +"sample. Samples wrap around in case of overflow." +msgstr "" +"元の音声データの各サンプルにバイアスを加算した音声データを返します。オーバー" +"フローした場合はラップアラウンドされます。" + +#: ../../library/audioop.rst:81 +msgid "" +"\"Byteswap\" all samples in a fragment and returns the modified fragment. " +"Converts big-endian samples to little-endian and vice versa." +msgstr "" +"fragment のすべてのサンプルを \"byteswap\" して、修正された fragment を返しま" +"す。ビッグエンディアンのサンプルをリトルエンディアンに、またはその逆に変換し" +"ます。" + +#: ../../library/audioop.rst:89 +msgid "" +"Return the number of zero crossings in the fragment passed as an argument." +msgstr "引数に渡したデータ中のゼロ交差回数を返します。" + +#: ../../library/audioop.rst:94 +msgid "" +"Return a factor *F* such that ``rms(add(fragment, mul(reference, -F)))`` is " +"minimal, i.e., return the factor with which you should multiply *reference* " +"to make it match as well as possible to *fragment*. The fragments should " +"both contain 2-byte samples." +msgstr "" +"``rms(add(fragment, mul(reference, -F)))`` を最小にするような係数 *F*、すなわ" +"ち、*reference* に乗算したときにもっとも *fragment* に近くなるような値を返し" +"ます。*fragment* と *reference* のサンプル幅はいずれも 2バイトでなければなり" +"ません。" + +#: ../../library/audioop.rst:99 +msgid "The time taken by this routine is proportional to ``len(fragment)``." +msgstr "このルーチンの実行に要する時間は ``len(fragment)`` に比例します。" + +#: ../../library/audioop.rst:104 +msgid "" +"Try to match *reference* as well as possible to a portion of *fragment* " +"(which should be the longer fragment). This is (conceptually) done by " +"taking slices out of *fragment*, using :func:`findfactor` to compute the " +"best match, and minimizing the result. The fragments should both contain 2-" +"byte samples. Return a tuple ``(offset, factor)`` where *offset* is the " +"(integer) offset into *fragment* where the optimal match started and " +"*factor* is the (floating-point) factor as per :func:`findfactor`." +msgstr "" +"*reference* を可能な限り *fragment* に一致させようとします (*fragment* は " +"*reference* より長くなければなりません)。この処理は (概念的には) *fragment* " +"からスライスをいくつか取り出し、それぞれについて :func:`findfactor` を使って" +"最良な一致を計算し、誤差が最小の結果を選ぶことで実現します。 *fragment* と " +"*reference* のサンプル幅は両方とも2バイトでなければなりません。 ``(offset, " +"factor)`` からなるタプルを返します。 *offset* は最適な一致箇所が始まる " +"*fragment* のオフセット値(整数)で、 *factor* は :func:`findfactor` の返す係" +"数 (浮動小数点数) です。" + +#: ../../library/audioop.rst:115 +msgid "" +"Search *fragment* for a slice of length *length* samples (not bytes!) with " +"maximum energy, i.e., return *i* for which ``rms(fragment[i*2:" +"(i+length)*2])`` is maximal. The fragments should both contain 2-byte " +"samples." +msgstr "" +"*fragment* から、長さが *length* サンプル (バイトではありません!) で最大のエ" +"ネルギーを持つスライス、すなわち、``rms(fragment[i*2:(i+length)* 2])`` を最大" +"にするようなスライスを探し、*i* を返します。データのはサンプル幅は 2バイトで" +"なければなりません。" + +#: ../../library/audioop.rst:119 +msgid "The routine takes time proportional to ``len(fragment)``." +msgstr "このルーチンの実行に要する時間は ``len(fragment)`` に比例します。" + +#: ../../library/audioop.rst:124 +msgid "Return the value of sample *index* from the fragment." +msgstr "データ中の *index* サンプル目の値を返します。" + +#: ../../library/audioop.rst:129 +msgid "" +"Convert samples to 4 bit Intel/DVI ADPCM encoding. ADPCM coding is an " +"adaptive coding scheme, whereby each 4 bit number is the difference between " +"one sample and the next, divided by a (varying) step. The Intel/DVI ADPCM " +"algorithm has been selected for use by the IMA, so it may well become a " +"standard." +msgstr "" +"データを 4 ビットの Intel/DVI ADPCM 符号化方式に変換します。ADPCM 符号化方式" +"とは適応符号化方式の一つで、あるサンプルと (可変の) ステップだけ離れたその次" +"のサンプルとの差を 4 ビットの整数で表現する方式です。Intel/DVI ADPCMアルゴリ" +"ズムは IMA (国際MIDI協会) に採用されているので、おそらく標準になるはずです。" + +#: ../../library/audioop.rst:134 +msgid "" +"*state* is a tuple containing the state of the coder. The coder returns a " +"tuple ``(adpcmfrag, newstate)``, and the *newstate* should be passed to the " +"next call of :func:`lin2adpcm`. In the initial call, ``None`` can be passed " +"as the state. *adpcmfrag* is the ADPCM coded fragment packed 2 4-bit values " +"per byte." +msgstr "" +"*state* はエンコーダの内部状態が入ったタプルです。エンコーダは ``(adpcmfrag, " +"newstate)`` のタプルを返し、次に :func:`lin2adpcm` を呼び出す時に *newstate* " +"を渡さねばなりません。最初に呼び出す時には *state* に ``None`` を渡してもかま" +"いません。 *adpcmfrag* は ADPCMで符号化されたデータで、バイト当たり 2 つの4" +"ビット値がパックされています。" + +#: ../../library/audioop.rst:142 +msgid "" +"Convert samples in the audio fragment to a-LAW encoding and return this as a " +"bytes object. a-LAW is an audio encoding format whereby you get a dynamic " +"range of about 13 bits using only 8 bit samples. It is used by the Sun " +"audio hardware, among others." +msgstr "" +"音声データのサンプルを a-LAW エンコーディングに変換し、バイトオブジェクトとし" +"て返します。a-LAW とは 13ビットのダイナミックレンジを 8bit だけで表現できる音" +"声エンコーディングです。Sun の音声ハードウェアなどで使われています。" + +#: ../../library/audioop.rst:150 +msgid "Convert samples between 1-, 2-, 3- and 4-byte formats." +msgstr "サンプル幅を 1、2、3、4 バイト形式の間で変換します。" + +#: ../../library/audioop.rst:154 +msgid "" +"In some audio formats, such as .WAV files, 16, 24 and 32 bit samples are " +"signed, but 8 bit samples are unsigned. So when converting to 8 bit wide " +"samples for these formats, you need to also add 128 to the result::" +msgstr "" +".WAV ファイルのような幾つかのオーディオフォーマットでは、16、24 と 32 bit の" +"サンプルは符号付きですが、8 bit のサンプルは符号なしです。そのため、そのよう" +"なフォーマットで 8 bit に変換する場合は、変換結果に128を足さなければなりませ" +"ん::" + +#: ../../library/audioop.rst:161 +msgid "" +"The same, in reverse, has to be applied when converting from 8 to 16, 24 or " +"32 bit width samples." +msgstr "逆に、8 bit から 16、24、32 bit に変換する場合も、同じことが言えます。" + +#: ../../library/audioop.rst:167 +msgid "" +"Convert samples in the audio fragment to u-LAW encoding and return this as a " +"bytes object. u-LAW is an audio encoding format whereby you get a dynamic " +"range of about 14 bits using only 8 bit samples. It is used by the Sun " +"audio hardware, among others." +msgstr "" +"音声データのサンプルを u-LAW エンコーディングに変換し、バイトオブジェクトとし" +"て返します。u-LAW とは 14ビットのダイナミックレンジを 8bit だけで表現できる音" +"声エンコーディングです。Sun の音声ハードウェアなどで使われています。" + +#: ../../library/audioop.rst:175 +msgid "" +"Return the maximum of the *absolute value* of all samples in a fragment." +msgstr "音声データ全サンプルの *絶対値* の最大値を返します。" + +#: ../../library/audioop.rst:180 +msgid "Return the maximum peak-peak value in the sound fragment." +msgstr "音声データの最大 peak-peak 振幅を返します。" + +#: ../../library/audioop.rst:185 +msgid "" +"Return a tuple consisting of the minimum and maximum values of all samples " +"in the sound fragment." +msgstr "音声データ全サンプル中における最小値と最大値からなるタプルを返します。" + +#: ../../library/audioop.rst:191 +msgid "" +"Return a fragment that has all samples in the original fragment multiplied " +"by the floating-point value *factor*. Samples are truncated in case of " +"overflow." +msgstr "" +"元の音声データの各サンプルに浮動小数点数 *factor* を乗算した音声データを返し" +"ます。オーバーフローした場合は切り捨てられます。" + +#: ../../library/audioop.rst:197 +msgid "Convert the frame rate of the input fragment." +msgstr "入力したデータのフレームレートを変換します。" + +#: ../../library/audioop.rst:199 +msgid "" +"*state* is a tuple containing the state of the converter. The converter " +"returns a tuple ``(newfragment, newstate)``, and *newstate* should be passed " +"to the next call of :func:`ratecv`. The initial call should pass ``None`` " +"as the state." +msgstr "" +"*state* は変換ルーチンの内部状態を入れたタプルです。変換ルーチンは " +"``(newfragment, newstate)`` を返し、次に :func:`ratecv` を呼び出す時には " +"*newstate* を渡さなねばなりません。最初の呼び出しでは ``None`` を渡します。" + +#: ../../library/audioop.rst:203 +msgid "" +"The *weightA* and *weightB* arguments are parameters for a simple digital " +"filter and default to ``1`` and ``0`` respectively." +msgstr "" +"引数 *weightA* と *weightB* は単純なデジタルフィルタのパラメタで、デフォルト" +"値はそれぞれ ``1`` と ``0`` です。" + +#: ../../library/audioop.rst:209 +msgid "Reverse the samples in a fragment and returns the modified fragment." +msgstr "データ内のサンプルの順序を逆転し、変更されたデータを返します。" + +#: ../../library/audioop.rst:214 +msgid "" +"Return the root-mean-square of the fragment, i.e. ``sqrt(sum(S_i^2)/n)``." +msgstr "" +"データの自乗平均根(root-mean-square)、すなわち ``sqrt(sum(S_i^2)/n)`` を返し" +"ます。" + +#: ../../library/audioop.rst:216 +msgid "This is a measure of the power in an audio signal." +msgstr "これはオーディオ信号の強度 (power) を測る一つの目安です。" + +#: ../../library/audioop.rst:221 +msgid "" +"Convert a stereo fragment to a mono fragment. The left channel is " +"multiplied by *lfactor* and the right channel by *rfactor* before adding the " +"two channels to give a mono signal." +msgstr "" +"ステレオ音声データをモノラル音声データに変換します。左チャネルのデータに " +"*lfactor*、右チャネルのデータに *rfactor* を掛けた後、二つのチャネルの値を加" +"算して単一チャネルの信号を生成します。" + +#: ../../library/audioop.rst:228 +msgid "" +"Generate a stereo fragment from a mono fragment. Each pair of samples in " +"the stereo fragment are computed from the mono sample, whereby left channel " +"samples are multiplied by *lfactor* and right channel samples by *rfactor*." +msgstr "" +"モノラル音声データをステレオ音声データに変換します。ステレオ音声データの各サ" +"ンプル対は、モノラル音声データの各サンプルをそれぞれ左チャネルは *lfactor* " +"倍、右チャネルは *rfactor* 倍して生成します。" + +#: ../../library/audioop.rst:235 +msgid "" +"Convert sound fragments in u-LAW encoding to linearly encoded sound " +"fragments. u-LAW encoding always uses 8 bits samples, so *width* refers only " +"to the sample width of the output fragment here." +msgstr "" +"u-LAW で符号化されている音声データを線形に符号化された音声データに変換しま" +"す。u-LAW 符号化は常にサンプル当たり 8 ビットを使うため、*width* は出力音声" +"データのサンプル幅にしか使われません。" + +#: ../../library/audioop.rst:239 +msgid "" +"Note that operations such as :func:`.mul` or :func:`.max` make no " +"distinction between mono and stereo fragments, i.e. all samples are treated " +"equal. If this is a problem the stereo fragment should be split into two " +"mono fragments first and recombined later. Here is an example of how to do " +"that::" +msgstr "" +":func:`.mul` や :func:`.max` といった操作はモノラルとステレオを区別しない、す" +"なわち全てのデータを平等に扱うということに注意してください。この仕様が問題に" +"なるようなら、あらかじめステレオ音声データを二つのモノラル音声データに分割し" +"ておき、操作後に再度統合してください。そのような例を以下に示します::" + +#: ../../library/audioop.rst:253 +msgid "" +"If you use the ADPCM coder to build network packets and you want your " +"protocol to be stateless (i.e. to be able to tolerate packet loss) you " +"should not only transmit the data but also the state. Note that you should " +"send the *initial* state (the one you passed to :func:`lin2adpcm`) along to " +"the decoder, not the final state (as returned by the coder). If you want to " +"use :class:`struct.Struct` to store the state in binary you can code the " +"first element (the predicted value) in 16 bits and the second (the delta " +"index) in 8." +msgstr "" +"もし ADPCM 符号をネットワークパケットの構築に使って独自のプロトコルをステート" +"レスにしたい場合 (つまり、パケットロスを許容したい場合)は、データだけを送信し" +"て、ステートを送信すべきではありません。デコーダに従って *initial* ステート " +"(:func:`lin2adpcm` に渡される値) を送るべきで、最終状態 (符号化器が返す値) を" +"送るべきではないことに注意してください。 もし、:class:`struct.Struct` をバイ" +"ナリでの状態保存に使いたい場合は、最初の要素 (予測値) を 16bit で符号化し、2" +"番目の要素 (デルタインデックス) を 8bit で符号化できます。" + +#: ../../library/audioop.rst:261 +msgid "" +"The ADPCM coders have never been tried against other ADPCM coders, only " +"against themselves. It could well be that I misinterpreted the standards in " +"which case they will not be interoperable with the respective standards." +msgstr "" +"このモジュールの ADPCM 符号のテストは自分自身に対してのみ行っており、他の " +"ADPCM 符号との間では行っていません。作者が仕様を誤解している部分もあるかもし" +"れず、それぞれの標準との間で相互運用できない場合もあり得ます。" + +#: ../../library/audioop.rst:265 +msgid "" +"The :func:`find\\*` routines might look a bit funny at first sight. They are " +"primarily meant to do echo cancellation. A reasonably fast way to do this " +"is to pick the most energetic piece of the output sample, locate that in the " +"input sample and subtract the whole output sample from the input sample::" msgstr "" +":func:`find\\*` ルーチンは一見滑稽に見えるかもしれません。これらの関数の主な" +"目的はエコー除去 (echo cancellation) にあります。エコー除去を十分高速に行うに" +"は、出力サンプル中から最も大きなエネルギーを持った部分を取り出し、この部分が" +"入力サンプル中のどこにあるかを調べ、入力サンプルから出力サンプル自体を減算し" +"ます::" diff --git a/library/audit_events.po b/library/audit_events.po index d9f0105d4..cfb15197f 100644 --- a/library/audit_events.po +++ b/library/audit_events.po @@ -1,27 +1,26 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: +# tomo, 2020 # Takanori Suzuki , 2021 -# tomo, 2021 -# 石井明久, 2024 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:55+0000\n" -"Last-Translator: 石井明久, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-05-04 06:48+0000\n" +"PO-Revision-Date: 2019-09-01 14:38+0000\n" +"Last-Translator: Takanori Suzuki , 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/audit_events.rst:6 @@ -32,11 +31,8 @@ msgstr "監査イベント表" msgid "" "This table contains all events raised by :func:`sys.audit` or :c:func:" "`PySys_Audit` calls throughout the CPython runtime and the standard " -"library. These calls were added in 3.8 or later (see :pep:`578`)." +"library. These calls were added in 3.8.0 or later (see :pep:`578`)." msgstr "" -"この表は、 CPython ランタイムと標準ライブラリ全体で :func:`sys.audit` また" -"は :c:func:`PySys_Audit` の呼び出しによって送出されるすべてのイベントを含んで" -"います。これらの呼び出しは、 3.8 以降に追加されました (:pep:`578` を参照) 。" #: ../../library/audit_events.rst:12 msgid "" @@ -127,25 +123,9 @@ msgid "``handle``, ``exit_code``" msgstr "``handle``, ``exit_code``" #: ../../library/audit_events.rst:46 -msgid "_posixsubprocess.fork_exec" -msgstr "" - -#: ../../library/audit_events.rst:46 -msgid "``exec_list``, ``args``, ``env``" -msgstr "" - -#: ../../library/audit_events.rst:48 msgid "ctypes.PyObj_FromPtr" msgstr "ctypes.PyObj_FromPtr" -#: ../../library/audit_events.rst:48 +#: ../../library/audit_events.rst:46 msgid "``obj``" msgstr "``obj``" - -#: ../../library/audit_events.rst:51 -msgid "The ``_posixsubprocess.fork_exec`` internal audit event." -msgstr "" - -#: ../../library/audit_events.rst:3 -msgid "audit events" -msgstr "監査イベント" diff --git a/library/base64.po b/library/base64.po index bf451cdca..f1cf4b4bd 100644 --- a/library/base64.po +++ b/library/base64.po @@ -1,34 +1,36 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Inada Naoki , 2023 -# Nozomu Kaneko , 2023 -# tomo, 2023 -# Arihiro TAKASE, 2023 -# 石井明久, 2024 +# E. Kawashima, 2017 +# Nozomu Kaneko , 2017 +# Inada Naoki , 2017 +# Yusuke Miyazaki , 2017 +# 秘湯 , 2017 +# Arihiro TAKASE, 2017 +# Naoki Nakamura , 2020 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-06 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:55+0000\n" -"Last-Translator: 石井明久, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 18:42+0000\n" +"Last-Translator: Naoki Nakamura , 2020\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/base64.rst:2 -msgid ":mod:`!base64` --- Base16, Base32, Base64, Base85 Data Encodings" -msgstr ":mod:`!base64` --- Base16, Base32, Base64, Base85 データのエンコード" +msgid ":mod:`base64` --- Base16, Base32, Base64, Base85 Data Encodings" +msgstr ":mod:`base64` --- Base16, Base32, Base64, Base85 データの符号化" #: ../../library/base64.rst:8 msgid "**Source code:** :source:`Lib/base64.py`" @@ -37,37 +39,59 @@ msgstr "**ソースコード:** :source:`Lib/base64.py`" #: ../../library/base64.rst:16 msgid "" "This module provides functions for encoding binary data to printable ASCII " -"characters and decoding such encodings back to binary data. This includes " -"the :ref:`encodings specified in ` :rfc:`4648` (Base64, " -"Base32 and Base16) and the non-standard :ref:`Base85 encodings `." +"characters and decoding such encodings back to binary data. It provides " +"encoding and decoding functions for the encodings specified in :rfc:`3548`, " +"which defines the Base16, Base32, and Base64 algorithms, and for the de-" +"facto standard Ascii85 and Base85 encodings." msgstr "" +"このモジュールはバイナリデータを印字可能な ASCII にエンコード関数、およびその" +"ようなエンコードデータをバイナリにデコードする関数を提供します。それらは、:" +"rfc:`3548` が定義する Base16, Base32, Base64 のエンコーディング、デファクトス" +"タンダードになっている Ascii85, Base85 のエンコーディングについてのエンコー" +"ド、デコード関数です。" #: ../../library/base64.rst:22 msgid "" +"The :rfc:`3548` encodings are suitable for encoding binary data so that it " +"can safely sent by email, used as parts of URLs, or included as part of an " +"HTTP POST request. The encoding algorithm is not the same as the :program:" +"`uuencode` program." +msgstr "" +":rfc:`3548` エンコーディングは、email で安全に送信したり、 URL の一部として" +"使ったり、あるいは HTTP POST リクエストの一部に含めるために用いるのに適してい" +"ます。このエンコーディングで使われているアルゴリズムは :program:`uuencode` プ" +"ログラムで用いられているものとは同じではありません。" + +#: ../../library/base64.rst:27 +msgid "" "There are two interfaces provided by this module. The modern interface " "supports encoding :term:`bytes-like objects ` to ASCII :" "class:`bytes`, and decoding :term:`bytes-like objects ` " "or strings containing ASCII to :class:`bytes`. Both base-64 alphabets " -"defined in :rfc:`4648` (normal, and URL- and filesystem-safe) are supported." +"defined in :rfc:`3548` (normal, and URL- and filesystem-safe) are supported." msgstr "" "このモジュールは、2つのインターフェースを提供します。このモダンなインター" "フェースは、:term:`bytes-like object` を ASCII :class:`bytes` にエンコード" "し、:term:`bytes-like object` か ASCII 文字列を、:class:`bytes` にデコードす" -"ることができます。:rfc:`4648` に定義されている base-64 アルファベット (一般" +"ることができます。:rfc:`3548` に定義されている base-64 アルファベット (一般" "の、URL あるいはファイルシステムセーフなもの) の両方が使用できます。" -#: ../../library/base64.rst:28 +#: ../../library/base64.rst:33 msgid "" -"The :ref:`legacy interface ` does not support decoding from " -"strings, but it does provide functions for encoding and decoding to and " -"from :term:`file objects `. It only supports the Base64 " -"standard alphabet, and it adds newlines every 76 characters as per :rfc:" -"`2045`. Note that if you are looking for :rfc:`2045` support you probably " -"want to be looking at the :mod:`email` package instead." +"The legacy interface does not support decoding from strings, but it does " +"provide functions for encoding and decoding to and from :term:`file objects " +"`. It only supports the Base64 standard alphabet, and it adds " +"newlines every 76 characters as per :rfc:`2045`. Note that if you are " +"looking for :rfc:`2045` support you probably want to be looking at the :mod:" +"`email` package instead." msgstr "" +"従来のインターフェースは文字列からのデコードができませんが、:term:`file " +"object` との間のエンコードとデコードが可能な関数を提供します。これは標準の " +"base64 アルファベットのみをサポートし、:rfc:`2045` の規定にあるように、76文字" +"ごとに改行されます。:rfc:`2045` のサポートのためには、代わりに :mod:`email` " +"パッケージを参照する必要があるかもしれません。" -#: ../../library/base64.rst:36 +#: ../../library/base64.rst:41 msgid "" "ASCII-only Unicode strings are now accepted by the decoding functions of the " "modern interface." @@ -75,7 +99,7 @@ msgstr "" "モダンなインターフェイスのデコード関数が ASCII のみの Unicode 文字列を受け付" "けるようになりました。" -#: ../../library/base64.rst:40 +#: ../../library/base64.rst:45 msgid "" "Any :term:`bytes-like objects ` are now accepted by all " "encoding and decoding functions in this module. Ascii85/Base85 support " @@ -85,18 +109,11 @@ msgstr "" "ブジェクト ` を受け取るようになりました。Ascii85/Base85 の" "サポートが追加されました。" -#: ../../library/base64.rst:48 -msgid "RFC 4648 Encodings" -msgstr "" +#: ../../library/base64.rst:49 +msgid "The modern interface provides:" +msgstr "モダンなインターフェイスは以下のものを提供します:" -#: ../../library/base64.rst:50 -msgid "" -"The :rfc:`4648` encodings are suitable for encoding binary data so that it " -"can be safely sent by email, used as parts of URLs, or included as part of " -"an HTTP POST request." -msgstr "" - -#: ../../library/base64.rst:56 +#: ../../library/base64.rst:53 msgid "" "Encode the :term:`bytes-like object` *s* using Base64 and return the " "encoded :class:`bytes`." @@ -104,31 +121,22 @@ msgstr "" "Base64 を使って :term:`bytes-like object` の *s* をエンコードし、エンコードさ" "れた :class:`bytes` を返します。" -#: ../../library/base64.rst:59 -msgid "" -"Optional *altchars* must be a :term:`bytes-like object` of length 2 which " -"specifies an alternative alphabet for the ``+`` and ``/`` characters. This " -"allows an application to e.g. generate URL or filesystem safe Base64 " -"strings. The default is ``None``, for which the standard Base64 alphabet is " -"used." -msgstr "" -"オプション引数 *altchars* は長さ 2 の :term:`bytes-like object` で 、``+`` " -"と ``/`` の代わりに使われる代替アルファベットを指定します。これにより、アプリ" -"ケーションはたとえば URL やファイルシステムの影響を受けない Base64 文字列を生" -"成できます。デフォルトは ``None`` で、標準の Base64 アルファベットが使われま" -"す。" - -#: ../../library/base64.rst:64 +#: ../../library/base64.rst:56 msgid "" -"May assert or raise a :exc:`ValueError` if the length of *altchars* is not " -"2. Raises a :exc:`TypeError` if *altchars* is not a :term:`bytes-like " -"object`." +"Optional *altchars* must be a :term:`bytes-like object` of at least length 2 " +"(additional characters are ignored) which specifies an alternative alphabet " +"for the ``+`` and ``/`` characters. This allows an application to e.g. " +"generate URL or filesystem safe Base64 strings. The default is ``None``, " +"for which the standard Base64 alphabet is used." msgstr "" -"*altchars* の長さが2でない場合は、 assert または :exc:`ValueError` が発生しま" -"す。 *altchars* が :term:`bytes-like object` でない場合は、 :exc:`TypeError` " -"が発生します。" +"オプション引数 *altchars* は最低でも 2 の長さをもつ :term:`bytes-like " +"object` で (これ以降の文字は無視されます)、これは ``+`` と ``/`` の代わりに" +"使われる代替アルファベットを指定します。これにより、アプリケーションはたとえ" +"ば URL やファイルシステムの影響をうけない Base64 文字列を生成することができま" +"す。デフォルトの値は ``None`` で、これは標準の Base64 アルファベット集合が使" +"われることを意味します。" -#: ../../library/base64.rst:70 +#: ../../library/base64.rst:65 msgid "" "Decode the Base64 encoded :term:`bytes-like object` or ASCII string *s* and " "return the decoded :class:`bytes`." @@ -136,24 +144,24 @@ msgstr "" "Base64 エンコードされた :term:`bytes-like object` または ASCII 文字列 *s* を" "デコードし、デコードされた :class:`bytes` を返します。" -#: ../../library/base64.rst:73 +#: ../../library/base64.rst:68 msgid "" "Optional *altchars* must be a :term:`bytes-like object` or ASCII string of " -"length 2 which specifies the alternative alphabet used instead of the ``+`` " -"and ``/`` characters." +"at least length 2 (additional characters are ignored) which specifies the " +"alternative alphabet used instead of the ``+`` and ``/`` characters." msgstr "" -"オプション引数の *altchars* は長さ 2 の :term:`bytes-like object` または " -"ASCII 文字列で、``+`` と ``/`` の代わりに使われる代替アルファベットを指定しま" -"す。" +"オプション引数の *altchars* は最低でも 2 の長さをもつ :term:`bytes-like " +"object` または ASCII 文字列で (これ以降の文字は無視されます)、これは ``+`` " +"と ``/`` の代わりに使われる代替アルファベットを指定します。" -#: ../../library/base64.rst:77 +#: ../../library/base64.rst:72 msgid "" "A :exc:`binascii.Error` exception is raised if *s* is incorrectly padded." msgstr "" "*s* が正しくパディングされていない場合は :exc:`binascii.Error` 例外を発生させ" "ます。" -#: ../../library/base64.rst:80 +#: ../../library/base64.rst:75 msgid "" "If *validate* is ``False`` (the default), characters that are neither in the " "normal base-64 alphabet nor the alternative alphabet are discarded prior to " @@ -165,20 +173,7 @@ msgstr "" "``True`` の場合、入力に base64 アルファベット以外の文字があると :exc:" "`binascii.Error` を発生させます。" -#: ../../library/base64.rst:86 -msgid "" -"For more information about the strict base64 check, see :func:`binascii." -"a2b_base64`" -msgstr "" -"厳密な base64 チェックのについての詳細は :func:`binascii.a2b_base64` を参照し" -"てください" - -#: ../../library/base64.rst:88 -msgid "" -"May assert or raise a :exc:`ValueError` if the length of *altchars* is not 2." -msgstr "" - -#: ../../library/base64.rst:92 +#: ../../library/base64.rst:84 msgid "" "Encode :term:`bytes-like object` *s* using the standard Base64 alphabet and " "return the encoded :class:`bytes`." @@ -186,7 +181,7 @@ msgstr "" "標準の base64 アルファベットを使用して :term:`bytes-like object` の *s* をエ" "ンコードし、エンコードされた :class:`bytes` を返します。" -#: ../../library/base64.rst:98 +#: ../../library/base64.rst:90 msgid "" "Decode :term:`bytes-like object` or ASCII string *s* using the standard " "Base64 alphabet and return the decoded :class:`bytes`." @@ -194,7 +189,7 @@ msgstr "" "標準の base64 アルファベットを使用した :term:`bytes-like object` または " "ASCII 文字列 *s* をデコードし、デコードされた :class:`bytes` を返します。" -#: ../../library/base64.rst:104 +#: ../../library/base64.rst:96 msgid "" "Encode :term:`bytes-like object` *s* using the URL- and filesystem-safe " "alphabet, which substitutes ``-`` instead of ``+`` and ``_`` instead of ``/" @@ -206,7 +201,7 @@ msgstr "" "base64 アルファベットに比べて、``+`` の替わりに ``-`` を、``/`` の替わりに " "``_`` を利用します。結果は ``=`` を含みます。 " -#: ../../library/base64.rst:113 +#: ../../library/base64.rst:105 msgid "" "Decode :term:`bytes-like object` or ASCII string *s* using the URL- and " "filesystem-safe alphabet, which substitutes ``-`` instead of ``+`` and ``_`` " @@ -218,7 +213,7 @@ msgstr "" "返します。標準 base64 アルファベットに比べて、``+`` の替わりに ``-`` を、``/" "`` の替わりに ``_`` を置換します。" -#: ../../library/base64.rst:122 +#: ../../library/base64.rst:114 msgid "" "Encode the :term:`bytes-like object` *s* using Base32 and return the " "encoded :class:`bytes`." @@ -226,7 +221,7 @@ msgstr "" "Base32 を使って :term:`bytes-like object` の *s* をエンコードし、エンコードさ" "れた :class:`bytes` を返します。" -#: ../../library/base64.rst:128 +#: ../../library/base64.rst:120 msgid "" "Decode the Base32 encoded :term:`bytes-like object` or ASCII string *s* and " "return the decoded :class:`bytes`." @@ -234,7 +229,7 @@ msgstr "" "Base32 エンコードされた :term:`bytes-like object` または ASCII 文字列 *s* を" "デコードし、デコードされた :class:`bytes` を返します。" -#: ../../library/base64.rst:131 ../../library/base64.rst:179 +#: ../../library/base64.rst:123 ../../library/base64.rst:150 msgid "" "Optional *casefold* is a flag specifying whether a lowercase alphabet is " "acceptable as input. For security purposes, the default is ``False``." @@ -243,9 +238,9 @@ msgstr "" "します。セキュリティ上の理由により、デフォルトではこれは ``False`` になってい" "ます。" -#: ../../library/base64.rst:135 +#: ../../library/base64.rst:127 msgid "" -":rfc:`4648` allows for optional mapping of the digit 0 (zero) to the letter " +":rfc:`3548` allows for optional mapping of the digit 0 (zero) to the letter " "O (oh), and for optional mapping of the digit 1 (one) to either the letter I " "(eye) or letter L (el). The optional argument *map01* when not ``None``, " "specifies which letter the digit 1 should be mapped to (when *map01* is not " @@ -253,7 +248,7 @@ msgid "" "purposes the default is ``None``, so that 0 and 1 are not allowed in the " "input." msgstr "" -":rfc:`4648` は付加的なマッピングとして、数字の 0 (零) をアルファベットの O " +":rfc:`3548` は付加的なマッピングとして、数字の 0 (零) をアルファベットの O " "(オー) に、数字の 1 (壱) をアルファベットの I (アイ) または L (エル) に対応さ" "せることを許しています。オプション引数は *map01* は、 ``None`` でないときは、" "数字の 1 をどの文字に対応づけるかを指定します (*map01* が ``None`` でないと" @@ -261,7 +256,7 @@ msgstr "" "ティ上の理由により、これはデフォルトでは ``None`` になっているため、 0 およ" "び 1 は入力として許可されていません。" -#: ../../library/base64.rst:142 ../../library/base64.rst:183 +#: ../../library/base64.rst:134 ../../library/base64.rst:154 msgid "" "A :exc:`binascii.Error` is raised if *s* is incorrectly padded or if there " "are non-alphabet characters present in the input." @@ -269,27 +264,7 @@ msgstr "" "*s* が正しくパディングされていない場合や、入力にアルファベットでない文字が含" "まれていた場合に、 :exc:`binascii.Error` 例外を発生させます。" -#: ../../library/base64.rst:149 -msgid "" -"Similar to :func:`b32encode` but uses the Extended Hex Alphabet, as defined " -"in :rfc:`4648`." -msgstr "" - -#: ../../library/base64.rst:157 -msgid "" -"Similar to :func:`b32decode` but uses the Extended Hex Alphabet, as defined " -"in :rfc:`4648`." -msgstr "" - -#: ../../library/base64.rst:160 -msgid "" -"This version does not allow the digit 0 (zero) to the letter O (oh) and " -"digit 1 (one) to either the letter I (eye) or letter L (el) mappings, all " -"these characters are included in the Extended Hex Alphabet and are not " -"interchangeable." -msgstr "" - -#: ../../library/base64.rst:170 +#: ../../library/base64.rst:141 msgid "" "Encode the :term:`bytes-like object` *s* using Base16 and return the " "encoded :class:`bytes`." @@ -297,7 +272,7 @@ msgstr "" "Base16 を使って :term:`bytes-like object` の *s* をエンコードし、エンコードさ" "れた :class:`bytes` を返します。" -#: ../../library/base64.rst:176 +#: ../../library/base64.rst:147 msgid "" "Decode the Base16 encoded :term:`bytes-like object` or ASCII string *s* and " "return the decoded :class:`bytes`." @@ -305,51 +280,7 @@ msgstr "" "Base16 エンコードされた :term:`bytes-like object` または ASCII 文字列 *s* を" "デコードし、デコードされた :class:`bytes` を返します。" -#: ../../library/base64.rst:190 -msgid "Base85 Encodings" -msgstr "" - -#: ../../library/base64.rst:192 -msgid "" -"Base85 encoding is not formally specified but rather a de facto standard, " -"thus different systems perform the encoding differently." -msgstr "" - -#: ../../library/base64.rst:195 -msgid "" -"The :func:`a85encode` and :func:`b85encode` functions in this module are two " -"implementations of the de facto standard. You should call the function with " -"the Base85 implementation used by the software you intend to work with." -msgstr "" - -#: ../../library/base64.rst:199 -msgid "" -"The two functions present in this module differ in how they handle the " -"following:" -msgstr "" - -#: ../../library/base64.rst:201 -msgid "Whether to include enclosing ``<~`` and ``~>`` markers" -msgstr "" - -#: ../../library/base64.rst:202 -msgid "Whether to include newline characters" -msgstr "" - -#: ../../library/base64.rst:203 -msgid "The set of ASCII characters used for encoding" -msgstr "" - -#: ../../library/base64.rst:204 -msgid "Handling of null bytes" -msgstr "" - -#: ../../library/base64.rst:206 -msgid "" -"Refer to the documentation of the individual functions for more information." -msgstr "" - -#: ../../library/base64.rst:210 +#: ../../library/base64.rst:161 msgid "" "Encode the :term:`bytes-like object` *b* using Ascii85 and return the " "encoded :class:`bytes`." @@ -357,7 +288,7 @@ msgstr "" "Ascii85 を使って :term:`bytes-like object` の *b* をエンコードし、エンコード" "された :class:`bytes` を返します。 " -#: ../../library/base64.rst:213 +#: ../../library/base64.rst:164 msgid "" "*foldspaces* is an optional flag that uses the special short sequence 'y' " "instead of 4 consecutive spaces (ASCII 0x20) as supported by 'btoa'. This " @@ -367,14 +298,16 @@ msgstr "" "ポートされている短い特殊文字 'y' に置き換えます。この機能は \"標準\" Ascii85 " "ではサポートされていません。" -#: ../../library/base64.rst:217 +#: ../../library/base64.rst:168 msgid "" "*wrapcol* controls whether the output should have newline (``b'\\n'``) " "characters added to it. If this is non-zero, each output line will be at " -"most this many characters long, excluding the trailing newline." +"most this many characters long." msgstr "" +"*wrapcol* は何文字ごとに改行文字 (``b'\\n'``) を挿入するかを制御します。ゼロ" +"でない場合、出力の各行はこの与えられた文字数を超えません。" -#: ../../library/base64.rst:221 +#: ../../library/base64.rst:172 msgid "" "*pad* controls whether the input is padded to a multiple of 4 before " "encoding. Note that the ``btoa`` implementation always pads." @@ -382,7 +315,7 @@ msgstr "" "*pad* を指定すると、エンコード前に入力が 4 の倍数になるようにパディングされま" "す。なお、 ``btoa`` の実装は常にパディングします。" -#: ../../library/base64.rst:224 +#: ../../library/base64.rst:175 msgid "" "*adobe* controls whether the encoded byte sequence is framed with ``<~`` and " "``~>``, which is used by the Adobe implementation." @@ -390,7 +323,7 @@ msgstr "" "*adobe* を指定すると、エンコードしたバイトシーケンスを ``<~`` と ``~>`` で囲" "みます。これは Adobe の実装で使われています。" -#: ../../library/base64.rst:232 +#: ../../library/base64.rst:183 msgid "" "Decode the Ascii85 encoded :term:`bytes-like object` or ASCII string *b* and " "return the decoded :class:`bytes`." @@ -398,7 +331,7 @@ msgstr "" "Ascii85 エンコードされた :term:`bytes-like object` または ASCII 文字列 *b* を" "デコードし、デコードされた :class:`bytes` を返します。 " -#: ../../library/base64.rst:235 +#: ../../library/base64.rst:186 msgid "" "*foldspaces* is a flag that specifies whether the 'y' short sequence should " "be accepted as shorthand for 4 consecutive spaces (ASCII 0x20). This feature " @@ -408,7 +341,7 @@ msgstr "" "0x20)と解釈するかどうかを制御します。この機能は \"標準\" Ascii85 ではサポート" "されていません。" -#: ../../library/base64.rst:239 +#: ../../library/base64.rst:190 msgid "" "*adobe* controls whether the input sequence is in Adobe Ascii85 format (i.e. " "is framed with <~ and ~>)." @@ -416,7 +349,7 @@ msgstr "" "*adobe* で、入力シーケンスが Adobe Ascii85 (つまり ``<~`` と ``~>`` で囲まれ" "ている)かどうかを伝えます。" -#: ../../library/base64.rst:242 +#: ../../library/base64.rst:193 msgid "" "*ignorechars* should be a :term:`bytes-like object` or ASCII string " "containing characters to ignore from the input. This should only contain " @@ -427,7 +360,7 @@ msgstr "" "`bytes-like object` または ASCII 文字列を指定してください。これは空白文字だけ" "で構成されているべきです。デフォルトは ASCII における空白文字全てです。" -#: ../../library/base64.rst:252 +#: ../../library/base64.rst:203 msgid "" "Encode the :term:`bytes-like object` *b* using base85 (as used in e.g. git-" "style binary diffs) and return the encoded :class:`bytes`." @@ -436,7 +369,7 @@ msgstr "" "て :term:`bytes-like object` の *b* をエンコードし、エンコードされた :class:" "`bytes` を返します。" -#: ../../library/base64.rst:255 +#: ../../library/base64.rst:206 msgid "" "If *pad* is true, the input is padded with ``b'\\0'`` so its length is a " "multiple of 4 bytes before encoding." @@ -444,7 +377,7 @@ msgstr "" "*pad* が真ならば、エンコードに先立って、バイト数が 4 の倍数となるように入力" "が ``b'\\0'`` でパディングされます。" -#: ../../library/base64.rst:263 +#: ../../library/base64.rst:214 msgid "" "Decode the base85-encoded :term:`bytes-like object` or ASCII string *b* and " "return the decoded :class:`bytes`. Padding is implicitly removed, if " @@ -454,25 +387,11 @@ msgstr "" "*b* をデコードし、デコードされた :class:`bytes` を返します。パディングは、も" "しあれば、暗黙に削除されます。" -#: ../../library/base64.rst:272 -msgid "" -"Encode the :term:`bytes-like object` *s* using Z85 (as used in ZeroMQ) and " -"return the encoded :class:`bytes`. See `Z85 specification `_ for more information." -msgstr "" - -#: ../../library/base64.rst:281 -msgid "" -"Decode the Z85-encoded :term:`bytes-like object` or ASCII string *s* and " -"return the decoded :class:`bytes`. See `Z85 specification `_ for more information." -msgstr "" - -#: ../../library/base64.rst:291 -msgid "Legacy Interface" -msgstr "" +#: ../../library/base64.rst:221 +msgid "The legacy interface:" +msgstr "レガシーなインターフェイスは以下のものを提供します:" -#: ../../library/base64.rst:295 +#: ../../library/base64.rst:225 msgid "" "Decode the contents of the binary *input* file and write the resulting " "binary data to the *output* file. *input* and *output* must be :term:`file " @@ -484,7 +403,7 @@ msgstr "" "object>` でなければなりません。 *input* は ``input.readline()`` が空バイト列" "を返すまで読まれます。" -#: ../../library/base64.rst:303 +#: ../../library/base64.rst:233 msgid "" "Decode the :term:`bytes-like object` *s*, which must contain one or more " "lines of base64 encoded data, and return the decoded :class:`bytes`." @@ -493,7 +412,7 @@ msgstr "" "返します。 *s* には一行以上の base64 形式でエンコードされたデータが含まれてい" "る必要があります。" -#: ../../library/base64.rst:311 +#: ../../library/base64.rst:241 msgid "" "Encode the contents of the binary *input* file and write the resulting " "base64 encoded data to the *output* file. *input* and *output* must be :term:" @@ -509,7 +428,7 @@ msgstr "" "字(``b'\\n'``)を挿入し、:rfc:`2045` (MIME) の規定にあるように常に出力が新しい" "行で終わることを保証します。" -#: ../../library/base64.rst:321 +#: ../../library/base64.rst:251 msgid "" "Encode the :term:`bytes-like object` *s*, which can contain arbitrary binary " "data, and return :class:`bytes` containing the base64-encoded data, with " @@ -521,32 +440,21 @@ msgstr "" "ごとに新しい行 (``b'\\n'``) が挿入された、base64 形式でエンコードしたデータを" "含む :class:`bytes` を返します。" -#: ../../library/base64.rst:329 +#: ../../library/base64.rst:259 msgid "An example usage of the module:" msgstr "モジュールの使用例:" -#: ../../library/base64.rst:342 -msgid "Security Considerations" -msgstr "セキュリティで考慮すべき点" - -#: ../../library/base64.rst:344 -msgid "" -"A new security considerations section was added to :rfc:`4648` (section 12); " -"it's recommended to review the security section for any code deployed to " -"production." -msgstr "" - -#: ../../library/base64.rst:349 +#: ../../library/base64.rst:273 msgid "Module :mod:`binascii`" msgstr "モジュール :mod:`binascii`" -#: ../../library/base64.rst:350 +#: ../../library/base64.rst:273 msgid "" "Support module containing ASCII-to-binary and binary-to-ASCII conversions." msgstr "" "ASCII からバイナリへ、バイナリから ASCII への変換をサポートするモジュール。" -#: ../../library/base64.rst:352 +#: ../../library/base64.rst:276 msgid "" ":rfc:`1521` - MIME (Multipurpose Internet Mail Extensions) Part One: " "Mechanisms for Specifying and Describing the Format of Internet Message " @@ -556,26 +464,10 @@ msgstr "" "Mechanisms for Specifying and Describing the Format of Internet Message " "Bodies" -#: ../../library/base64.rst:353 +#: ../../library/base64.rst:276 msgid "" "Section 5.2, \"Base64 Content-Transfer-Encoding,\" provides the definition " "of the base64 encoding." msgstr "" "Section 5.2, \"Base64 Content-Transfer-Encoding,\" provides the definition " "of the base64 encoding." - -#: ../../library/base64.rst:10 -msgid "base64" -msgstr "base64" - -#: ../../library/base64.rst:10 -msgid "encoding" -msgstr "encoding" - -#: ../../library/base64.rst:10 -msgid "MIME" -msgstr "MIME" - -#: ../../library/base64.rst:10 -msgid "base64 encoding" -msgstr "base64 encoding" diff --git a/library/bdb.po b/library/bdb.po index c3afe0f39..048f6493b 100644 --- a/library/bdb.po +++ b/library/bdb.po @@ -1,33 +1,34 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 -# Arihiro TAKASE, 2023 -# Takanori Suzuki , 2024 -# 石井明久, 2024 +# Masato HASHIMOTO , 2017 +# Nozomu Kaneko , 2017 +# Arihiro TAKASE, 2017 +# 秘湯 , 2017 +# tomo, 2019 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:55+0000\n" -"Last-Translator: 石井明久, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 18:42+0000\n" +"Last-Translator: tomo, 2019\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/bdb.rst:2 -msgid ":mod:`!bdb` --- Debugger framework" -msgstr ":mod:`!bdb` --- デバッガーフレームワーク" +msgid ":mod:`bdb` --- Debugger framework" +msgstr ":mod:`bdb` --- デバッガーフレームワーク" #: ../../library/bdb.rst:7 msgid "**Source code:** :source:`Lib/bdb.py`" @@ -76,23 +77,21 @@ msgstr "" #: ../../library/bdb.rst:33 msgid "" -"When creating a breakpoint, its associated :attr:`file name ` should " -"be in canonical form. If a :attr:`funcname` is defined, a breakpoint :attr:" -"`hit ` will be counted when the first line of that function is " -"executed. A :attr:`conditional ` breakpoint always counts a :attr:" -"`hit `." +"When creating a breakpoint, its associated filename should be in canonical " +"form. If a *funcname* is defined, a breakpoint hit will be counted when the " +"first line of that function is executed. A conditional breakpoint always " +"counts a hit." msgstr "" -"ブレークポイントを作るとき、関連付けられる :attr:`ファイル名 ` は正規化" -"されていなければなりません。:attr:`funcname` が定義されると、ブレークポイント" -"の :attr:`ヒット ` はその関数の最初の行が実行されたときにカウントされま" -"す。:attr:`条件付き ` ブレークポイントは毎回 :attr:`ヒット ` をカ" -"ウントします。" +"ブレークポイントを作るとき、設定されるファイル名は正規化されていなければなり" +"ません。*funcname* が設定されたとき、ブレークポイントはその関数の最初の行が実" +"行されたときにヒットカウントにカウントされます。条件付ブレークポイントは毎回" +"カウントされます。" -#: ../../library/bdb.rst:39 +#: ../../library/bdb.rst:38 msgid ":class:`Breakpoint` instances have the following methods:" msgstr ":class:`Breakpoint` インスタンスは以下のメソッドを持ちます:" -#: ../../library/bdb.rst:43 +#: ../../library/bdb.rst:42 msgid "" "Delete the breakpoint from the list associated to a file/line. If it is the " "last breakpoint in that position, it also deletes the entry for the file/" @@ -102,45 +101,45 @@ msgstr "" "レークポイントがその行に設定された最後のブレークポイントだった場合、そのファ" "イル/行に対するエントリ自体を削除します。" -#: ../../library/bdb.rst:50 +#: ../../library/bdb.rst:49 msgid "Mark the breakpoint as enabled." msgstr "このブレークポイントを有効にします。" -#: ../../library/bdb.rst:55 +#: ../../library/bdb.rst:54 msgid "Mark the breakpoint as disabled." msgstr "このブレークポイントを無効にします。" -#: ../../library/bdb.rst:60 +#: ../../library/bdb.rst:59 msgid "" "Return a string with all the information about the breakpoint, nicely " "formatted:" msgstr "ブレークポイントに関する情報を持つ文字列をフォーマットして返します:" +#: ../../library/bdb.rst:62 +msgid "The breakpoint number." +msgstr "ブレークポイント番号。" + #: ../../library/bdb.rst:63 -msgid "Breakpoint number." -msgstr "" +msgid "If it is temporary or not." +msgstr "テンポラリブレークポイントかどうか。" #: ../../library/bdb.rst:64 -msgid "Temporary status (del or keep)." -msgstr "" +msgid "Its file,line position." +msgstr "ファイル/行の位置。" #: ../../library/bdb.rst:65 -msgid "File/line position." -msgstr "" +msgid "The condition that causes a break." +msgstr "ブレークする条件。" #: ../../library/bdb.rst:66 -msgid "Break condition." -msgstr "" +msgid "If it must be ignored the next N times." +msgstr "次のN回無視されるか。" #: ../../library/bdb.rst:67 -msgid "Number of times to ignore." -msgstr "" +msgid "The breakpoint hit count." +msgstr "ヒットカウント。" -#: ../../library/bdb.rst:68 -msgid "Number of times hit." -msgstr "" - -#: ../../library/bdb.rst:74 +#: ../../library/bdb.rst:73 msgid "" "Print the output of :meth:`bpformat` to the file *out*, or if it is " "``None``, to standard output." @@ -148,60 +147,12 @@ msgstr "" "ファイル *out* に、またはそれが ``None`` の場合は標準出力に、 :meth:" "`bpformat` の出力を表示する。" -#: ../../library/bdb.rst:77 -msgid ":class:`Breakpoint` instances have the following attributes:" -msgstr ":class:`Breakpoint` インスタンスは以下の属性を持ちます:" - -#: ../../library/bdb.rst:81 -msgid "File name of the :class:`Breakpoint`." -msgstr "" - -#: ../../library/bdb.rst:85 -msgid "Line number of the :class:`Breakpoint` within :attr:`file`." -msgstr "" - -#: ../../library/bdb.rst:89 -msgid "``True`` if a :class:`Breakpoint` at (file, line) is temporary." -msgstr "" - -#: ../../library/bdb.rst:93 -msgid "Condition for evaluating a :class:`Breakpoint` at (file, line)." -msgstr "" - -#: ../../library/bdb.rst:97 -msgid "" -"Function name that defines whether a :class:`Breakpoint` is hit upon " -"entering the function." -msgstr "" - -#: ../../library/bdb.rst:102 -msgid "``True`` if :class:`Breakpoint` is enabled." -msgstr "" - -#: ../../library/bdb.rst:106 -msgid "Numeric index for a single instance of a :class:`Breakpoint`." -msgstr "" - -#: ../../library/bdb.rst:110 -msgid "" -"Dictionary of :class:`Breakpoint` instances indexed by (:attr:`file`, :attr:" -"`line`) tuples." -msgstr "" - -#: ../../library/bdb.rst:115 -msgid "Number of times to ignore a :class:`Breakpoint`." -msgstr "" - -#: ../../library/bdb.rst:119 -msgid "Count of the number of times a :class:`Breakpoint` has been hit." -msgstr "" - -#: ../../library/bdb.rst:123 +#: ../../library/bdb.rst:79 msgid "The :class:`Bdb` class acts as a generic Python debugger base class." msgstr "" ":class:`Bdb` クラスは一般的なPythonデバッガーの基本クラスとして振舞います。" -#: ../../library/bdb.rst:125 +#: ../../library/bdb.rst:81 msgid "" "This class takes care of the details of the trace facility; a derived class " "should implement user interaction. The standard debugger class (:class:`pdb." @@ -211,7 +162,7 @@ msgstr "" "生クラスが実装するべきです。標準ライブラリのデバッガクラス (:class:`pdb." "Pdb`) がその利用例です。" -#: ../../library/bdb.rst:129 +#: ../../library/bdb.rst:85 msgid "" "The *skip* argument, if given, must be an iterable of glob-style module name " "patterns. The debugger will not step into frames that originate in a module " @@ -225,64 +176,36 @@ msgstr "" "で発生したかどうかは、フレームのグローバル変数の ``__name__`` によって決定さ" "れます。" -#: ../../library/bdb.rst:135 -msgid "" -"The *backend* argument specifies the backend to use for :class:`Bdb`. It can " -"be either ``'settrace'`` or ``'monitoring'``. ``'settrace'`` uses :func:`sys." -"settrace` which has the best backward compatibility. The ``'monitoring'`` " -"backend uses the new :mod:`sys.monitoring` that was introduced in Python " -"3.12, which can be much more efficient because it can disable unused events. " -"We are trying to keep the exact interfaces for both backends, but there are " -"some differences. The debugger developers are encouraged to use the " -"``'monitoring'`` backend to achieve better performance." -msgstr "" - -#: ../../library/bdb.rst:145 -msgid "Added the *skip* parameter." -msgstr "*skip* パラメータが追加されました。" +#: ../../library/bdb.rst:91 +msgid "The *skip* argument." +msgstr "*skip* 引数が追加されました。" -#: ../../library/bdb.rst:148 -msgid "Added the *backend* parameter." -msgstr "" - -#: ../../library/bdb.rst:151 +#: ../../library/bdb.rst:94 msgid "" "The following methods of :class:`Bdb` normally don't need to be overridden." msgstr "" "以下の :class:`Bdb` のメソッドは、通常オーバーライドする必要はありません。" -#: ../../library/bdb.rst:155 -msgid "Return canonical form of *filename*." -msgstr "" - -#: ../../library/bdb.rst:157 -msgid "" -"For real file names, the canonical form is an operating-system-dependent, :" -"func:`case-normalized ` :func:`absolute path `. A *filename* with angle brackets, such as ``\"\"`` " -"generated in interactive mode, is returned unchanged." -msgstr "" - -#: ../../library/bdb.rst:164 +#: ../../library/bdb.rst:98 msgid "" -"Start tracing. For ``'settrace'`` backend, this method is equivalent to " -"``sys.settrace(self.trace_dispatch)``" +"Auxiliary method for getting a filename in a canonical form, that is, as a " +"case-normalized (on case-insensitive filesystems) absolute path, stripped of " +"surrounding angle brackets." msgstr "" +"標準化されたファイル名を取得するための補助関数。標準化されたファイル名とは、" +"(大文字小文字を区別しないファイルシステムにおいて)大文字小文字を正規化し、絶" +"対パスにしたものです。ファイル名が \"<\" と \">\" で囲まれていた場合はそれを" +"取り除いたものです。" -#: ../../library/bdb.rst:171 -msgid "" -"Stop tracing. For ``'settrace'`` backend, this method is equivalent to ``sys." -"settrace(None)``" -msgstr "" - -#: ../../library/bdb.rst:178 +#: ../../library/bdb.rst:104 msgid "" -"Set the :attr:`!botframe`, :attr:`!stopframe`, :attr:`!returnframe` and :" -"attr:`quitting ` attributes with values ready to start " -"debugging." +"Set the :attr:`botframe`, :attr:`stopframe`, :attr:`returnframe` and :attr:" +"`quitting` attributes with values ready to start debugging." msgstr "" +":attr:`botframe`, :attr:`stopframe`, :attr:`returnframe`, :attr:`quitting` 属" +"性を、デバッグを始められる状態に設定します。" -#: ../../library/bdb.rst:183 +#: ../../library/bdb.rst:109 msgid "" "This function is installed as the trace function of debugged frames. Its " "return value is the new trace function (in most cases, that is, itself)." @@ -290,7 +213,7 @@ msgstr "" "この関数は、デバッグされているフレームのトレース関数としてインストールされま" "す。戻り値は新しいトレース関数(殆どの場合はこの関数自身)です。" -#: ../../library/bdb.rst:186 +#: ../../library/bdb.rst:112 msgid "" "The default implementation decides how to dispatch a frame, depending on the " "type of event (passed as a string) that is about to be executed. *event* can " @@ -300,37 +223,37 @@ msgstr "" "種類に基づいてフレームのディスパッチ方法を決定します。*event* は次のうちのど" "れかです:" -#: ../../library/bdb.rst:190 +#: ../../library/bdb.rst:116 msgid "``\"line\"``: A new line of code is going to be executed." msgstr "``\"line\"``: 新しい行を実行しようとしています。" -#: ../../library/bdb.rst:191 +#: ../../library/bdb.rst:117 msgid "" "``\"call\"``: A function is about to be called, or another code block " "entered." msgstr "``\"call\"``: 関数が呼び出されているか、別のコードブロックに入ります。" -#: ../../library/bdb.rst:193 +#: ../../library/bdb.rst:119 msgid "``\"return\"``: A function or other code block is about to return." msgstr "``\"return\"``: 関数か別のコードブロックからreturnしようとしています。" -#: ../../library/bdb.rst:194 +#: ../../library/bdb.rst:120 msgid "``\"exception\"``: An exception has occurred." msgstr "``\"exception\"``: 例外が発生しました。" -#: ../../library/bdb.rst:195 +#: ../../library/bdb.rst:121 msgid "``\"c_call\"``: A C function is about to be called." msgstr "``\"c_call\"``: C関数を呼び出そうとしています。" -#: ../../library/bdb.rst:196 +#: ../../library/bdb.rst:122 msgid "``\"c_return\"``: A C function has returned." msgstr "``\"c_return\"``: C関数からreturnしました。" -#: ../../library/bdb.rst:197 +#: ../../library/bdb.rst:123 msgid "``\"c_exception\"``: A C function has raised an exception." msgstr "``\"c_exception\"``: C関数が例外を発生させました。" -#: ../../library/bdb.rst:199 +#: ../../library/bdb.rst:125 msgid "" "For the Python events, specialized functions (see below) are called. For " "the C events, no action is taken." @@ -338,11 +261,11 @@ msgstr "" "Pythonのイベントに対しては、以下の専用の関数群が呼ばれます。Cのイベントに対し" "ては何もしません。" -#: ../../library/bdb.rst:202 +#: ../../library/bdb.rst:128 msgid "The *arg* parameter depends on the previous event." msgstr "*arg* 引数は以前のイベントに依存します。" -#: ../../library/bdb.rst:204 +#: ../../library/bdb.rst:130 msgid "" "See the documentation for :func:`sys.settrace` for more information on the " "trace function. For more information on code and frame objects, refer to :" @@ -352,43 +275,63 @@ msgstr "" "を参照してください。コードとフレームオブジェクトについてのより詳しい情報" "は、 :ref:`types` を参照してください。" -#: ../../library/bdb.rst:210 +#: ../../library/bdb.rst:136 msgid "" "If the debugger should stop on the current line, invoke the :meth:" "`user_line` method (which should be overridden in subclasses). Raise a :exc:" -"`BdbQuit` exception if the :attr:`quitting ` flag is set " -"(which can be set from :meth:`user_line`). Return a reference to the :meth:" +"`BdbQuit` exception if the :attr:`Bdb.quitting` flag is set (which can be " +"set from :meth:`user_line`). Return a reference to the :meth:" "`trace_dispatch` method for further tracing in that scope." msgstr "" +"デバッガーが現在の行で止まるべきであれば、 :meth:`user_line` メソッド (サブク" +"ラスでオーバーライドされる)を呼び出します。 :attr:`Bdb.quitting` フラグ(:" +"meth:`user_line` から設定できます)が設定されていた場合、 :exc:`BdbQuit` 例外" +"を発生させます。このスコープのこれからのトレースのために、 :meth:" +"`trace_dispatch` メソッドの参照を返します。" -#: ../../library/bdb.rst:218 +#: ../../library/bdb.rst:144 msgid "" "If the debugger should stop on this function call, invoke the :meth:" "`user_call` method (which should be overridden in subclasses). Raise a :exc:" -"`BdbQuit` exception if the :attr:`quitting ` flag is set " -"(which can be set from :meth:`user_call`). Return a reference to the :meth:" +"`BdbQuit` exception if the :attr:`Bdb.quitting` flag is set (which can be " +"set from :meth:`user_call`). Return a reference to the :meth:" "`trace_dispatch` method for further tracing in that scope." msgstr "" +"デバッガーがこの関数呼び出しで止まるべきであれば、 :meth:`user_call` メソッ" +"ド (サブクラスでオーバーライドされる)を呼び出します。 :attr:`Bdb.quitting` フ" +"ラグ(:meth:`user_call` から設定できます)が設定されていた場合、 :exc:" +"`BdbQuit` 例外を発生させます。このスコープのこれからのトレースのために、 :" +"meth:`trace_dispatch` メソッドの参照を返します。" -#: ../../library/bdb.rst:226 +#: ../../library/bdb.rst:152 msgid "" "If the debugger should stop on this function return, invoke the :meth:" "`user_return` method (which should be overridden in subclasses). Raise a :" -"exc:`BdbQuit` exception if the :attr:`quitting ` flag is set " -"(which can be set from :meth:`user_return`). Return a reference to the :" -"meth:`trace_dispatch` method for further tracing in that scope." +"exc:`BdbQuit` exception if the :attr:`Bdb.quitting` flag is set (which can " +"be set from :meth:`user_return`). Return a reference to the :meth:" +"`trace_dispatch` method for further tracing in that scope." msgstr "" +"デバッガーがこの関数からのリターンで止まるべきであれば、 :meth:`user_return` " +"メソッド (サブクラスでオーバーライドされる)を呼び出します。 :attr:`Bdb." +"quitting` フラグ(:meth:`user_return` から設定できます)が設定されていた場" +"合、 :exc:`BdbQuit` 例外を発生させます。このスコープのこれからのトレースのた" +"めに、 :meth:`trace_dispatch` メソッドの参照を返します。" -#: ../../library/bdb.rst:234 +#: ../../library/bdb.rst:160 msgid "" "If the debugger should stop at this exception, invokes the :meth:" "`user_exception` method (which should be overridden in subclasses). Raise a :" -"exc:`BdbQuit` exception if the :attr:`quitting ` flag is set " -"(which can be set from :meth:`user_exception`). Return a reference to the :" -"meth:`trace_dispatch` method for further tracing in that scope." +"exc:`BdbQuit` exception if the :attr:`Bdb.quitting` flag is set (which can " +"be set from :meth:`user_exception`). Return a reference to the :meth:" +"`trace_dispatch` method for further tracing in that scope." msgstr "" +"デバッガーがこの例外発生で止まるべきであれば、 :meth:`user_exception` メソッ" +"ド (サブクラスでオーバーライドされる)を呼び出します。 :attr:`Bdb.quitting` フ" +"ラグ(:meth:`user_exception` から設定できます)が設定されていた場合、 :exc:" +"`BdbQuit` 例外を発生させます。このスコープのこれからのトレースのために、 :" +"meth:`trace_dispatch` メソッドの参照を返します。" -#: ../../library/bdb.rst:240 +#: ../../library/bdb.rst:166 msgid "" "Normally derived classes don't override the following methods, but they may " "if they want to redefine the definition of stopping and breakpoints." @@ -396,29 +339,34 @@ msgstr "" "通常、継承クラスは以下のメソッド群をオーバーライドしません。しかし、停止やブ" "レークポイント機能を再定義したい場合には、オーバーライドすることもあります。" -#: ../../library/bdb.rst:245 -msgid "Return ``True`` if *module_name* matches any skip pattern." -msgstr "" - -#: ../../library/bdb.rst:249 -msgid "Return ``True`` if *frame* is below the starting frame in the stack." -msgstr "" - -#: ../../library/bdb.rst:253 -msgid "Return ``True`` if there is an effective breakpoint for this line." +#: ../../library/bdb.rst:171 +msgid "" +"This method checks if the *frame* is somewhere below :attr:`botframe` in the " +"call stack. :attr:`botframe` is the frame in which debugging started." msgstr "" +"このメソッドは *frame* がコールスタック中で :attr:`botframe` よりも下にあるか" +"チェックします。 :attr:`botframe` はデバッグを開始したフレームです。" -#: ../../library/bdb.rst:255 +#: ../../library/bdb.rst:176 msgid "" -"Check whether a line or function breakpoint exists and is in effect. Delete " -"temporary breakpoints based on information from :func:`effective`." +"This method checks if there is a breakpoint in the filename and line " +"belonging to *frame* or, at least, in the current function. If the " +"breakpoint is a temporary one, this method deletes it." msgstr "" +"このメソッドは、*frame* に属するファイル名と行に、あるいは、少なくとも現在の" +"関数にブレークポイントがあるかどうかをチェックします。ブレークポイントがテン" +"ポラリブレークポイントだった場合、このメソッドはそのブレークポイントを削除し" +"ます。" -#: ../../library/bdb.rst:260 -msgid "Return ``True`` if any breakpoint exists for *frame*'s filename." +#: ../../library/bdb.rst:182 +msgid "" +"This method checks if there is a breakpoint in the filename of the current " +"frame." msgstr "" +"このメソッドは、現在のフレームのファイル名の中にブレークポイントが存在するか" +"どうかをチェックします。" -#: ../../library/bdb.rst:262 +#: ../../library/bdb.rst:185 msgid "" "Derived classes should override these methods to gain control over debugger " "operation." @@ -426,52 +374,50 @@ msgstr "" "継承クラスはデバッガー操作をするために以下のメソッド群をオーバーライドするべ" "きです。" -#: ../../library/bdb.rst:267 +#: ../../library/bdb.rst:190 msgid "" -"Called from :meth:`dispatch_call` if a break might stop inside the called " +"This method is called from :meth:`dispatch_call` when there is the " +"possibility that a break might be necessary anywhere inside the called " "function." msgstr "" +"このメソッドは、呼ばれた関数の中でブレークする必要がある可能性がある場合" +"に、 :meth:`dispatch_call` から呼び出されます。" -#: ../../library/bdb.rst:270 -msgid "" -"*argument_list* is not used anymore and will always be ``None``. The " -"argument is kept for backwards compatibility." -msgstr "" - -#: ../../library/bdb.rst:275 +#: ../../library/bdb.rst:196 msgid "" -"Called from :meth:`dispatch_line` when either :meth:`stop_here` or :meth:" -"`break_here` returns ``True``." +"This method is called from :meth:`dispatch_line` when either :meth:" +"`stop_here` or :meth:`break_here` yields ``True``." msgstr "" -":meth:`stop_here` か :meth:`break_here` が ``True`` を返したときに、 :meth:" -"`dispatch_line` から呼び出されます。" +"このメソッドは、 :meth:`stop_here` か :meth:`break_here` が ``True`` を返した" +"ときに、 :meth:`dispatch_line` から呼び出されます。" -#: ../../library/bdb.rst:280 +#: ../../library/bdb.rst:201 msgid "" -"Called from :meth:`dispatch_return` when :meth:`stop_here` returns ``True``." +"This method is called from :meth:`dispatch_return` when :meth:`stop_here` " +"yields ``True``." msgstr "" -":meth:`stop_here` が ``True`` を返したときに、 :meth:`dispatch_return` から呼" -"び出されます。" +"このメソッドは、 :meth:`stop_here` が ``True`` を返したときに、 :meth:" +"`dispatch_return` から呼び出されます。" -#: ../../library/bdb.rst:284 +#: ../../library/bdb.rst:206 msgid "" -"Called from :meth:`dispatch_exception` when :meth:`stop_here` returns " -"``True``." +"This method is called from :meth:`dispatch_exception` when :meth:`stop_here` " +"yields ``True``." msgstr "" -":meth:`stop_here` が ``True`` を返したときに、 :meth:`dispatch_exception` か" -"ら呼び出されます。" +"このメソッドは、 :meth:`stop_here` が ``True`` を返したときに、 :meth:" +"`dispatch_exception` から呼び出されます。" -#: ../../library/bdb.rst:289 +#: ../../library/bdb.rst:211 msgid "Handle how a breakpoint must be removed when it is a temporary one." msgstr "" "ブレークポイントがテンポラリブレークポイントだったときに、それをどう削除する" "かを決定します。" -#: ../../library/bdb.rst:291 +#: ../../library/bdb.rst:213 msgid "This method must be implemented by derived classes." msgstr "継承クラスはこのメソッドを実装しなければなりません。" -#: ../../library/bdb.rst:294 +#: ../../library/bdb.rst:216 msgid "" "Derived classes and clients can call the following methods to affect the " "stepping state." @@ -479,28 +425,28 @@ msgstr "" "継承クラスとクライアントは、ステップ状態に影響を及ぼすために以下のメソッドを" "呼び出すことができます。" -#: ../../library/bdb.rst:299 +#: ../../library/bdb.rst:221 msgid "Stop after one line of code." msgstr "コードの次の行でストップします。" -#: ../../library/bdb.rst:303 +#: ../../library/bdb.rst:225 msgid "Stop on the next line in or below the given frame." msgstr "" "与えられたフレームかそれより下(のフレーム)にある、次の行でストップします。" -#: ../../library/bdb.rst:307 +#: ../../library/bdb.rst:229 msgid "Stop when returning from the given frame." msgstr "指定されたフレームから抜けるときにストップします。" -#: ../../library/bdb.rst:311 +#: ../../library/bdb.rst:233 msgid "" -"Stop when the line with the *lineno* greater than the current one is reached " +"Stop when the line with the line no greater than the current one is reached " "or when returning from current frame." msgstr "" -"現在の行番号よりも大きい *lineno* に到達したとき、あるいは、現在のフレームか" -"ら戻るときにストップします。" +"現在の行番号よりも大きい行番号に到達したとき、あるいは、現在のフレームから戻" +"るときにストップします。" -#: ../../library/bdb.rst:316 +#: ../../library/bdb.rst:238 msgid "" "Start debugging from *frame*. If *frame* is not specified, debugging starts " "from caller's frame." @@ -508,13 +454,7 @@ msgstr "" "*frame* からデバッグを開始します。*frame* が指定されなかった場合、デバッグは" "呼び出し元のフレームから開始します。" -#: ../../library/bdb.rst:319 -msgid "" -":func:`set_trace` will enter the debugger immediately, rather than on the " -"next line of code to be executed." -msgstr "" - -#: ../../library/bdb.rst:325 +#: ../../library/bdb.rst:243 msgid "" "Stop only at breakpoints or when finished. If there are no breakpoints, set " "the system trace function to ``None``." @@ -522,13 +462,16 @@ msgstr "" "ブレークポイントに到達するか終了したときにストップします。もしブレークポイン" "トが1つも無い場合、システムのトレース関数を ``None`` に設定します。" -#: ../../library/bdb.rst:332 +#: ../../library/bdb.rst:248 msgid "" -"Set the :attr:`!quitting` attribute to ``True``. This raises :exc:`BdbQuit` " -"in the next call to one of the :meth:`!dispatch_\\*` methods." +"Set the :attr:`quitting` attribute to ``True``. This raises :exc:`BdbQuit` " +"in the next call to one of the :meth:`dispatch_\\*` methods." msgstr "" +":attr:`quitting` 属性を ``True`` に設定します。これにより、次回の :meth:" +"`dispatch_\\*` メソッドのどれかの呼び出しで、 :exc:`BdbQuit` 例外を発生させま" +"す。" -#: ../../library/bdb.rst:336 +#: ../../library/bdb.rst:252 msgid "" "Derived classes and clients can call the following methods to manipulate " "breakpoints. These methods return a string containing an error message if " @@ -538,7 +481,7 @@ msgstr "" "す。これらのメソッドは、何か悪いことがあればエラーメッセージを含む文字列を返" "し、すべてが順調であれば ``None`` を返します。" -#: ../../library/bdb.rst:342 +#: ../../library/bdb.rst:258 msgid "" "Set a new breakpoint. If the *lineno* line doesn't exist for the *filename* " "passed as argument, return an error message. The *filename* should be in " @@ -548,15 +491,15 @@ msgstr "" "ない場合、エラーメッセージを返します。 *filename* は、 :meth:`canonic` メソッ" "ドで説明されているような、標準形である必要があります。" -#: ../../library/bdb.rst:348 +#: ../../library/bdb.rst:264 msgid "" -"Delete the breakpoints in *filename* and *lineno*. If none were set, return " -"an error message." +"Delete the breakpoints in *filename* and *lineno*. If none were set, an " +"error message is returned." msgstr "" "*filename* の *lineno* 行にあるブレークポイントを削除します。もしブレークポイ" "ントが無かった場合、エラーメッセージを返します。" -#: ../../library/bdb.rst:353 +#: ../../library/bdb.rst:269 msgid "" "Delete the breakpoint which has the index *arg* in the :attr:`Breakpoint." "bpbynumber`. If *arg* is not numeric or out of range, return an error " @@ -566,22 +509,19 @@ msgstr "" "トを削除します。 *arg* が数値でないか範囲外の場合、エラーメッセージを返しま" "す。" -#: ../../library/bdb.rst:359 +#: ../../library/bdb.rst:275 msgid "" -"Delete all breakpoints in *filename*. If none were set, return an error " -"message." +"Delete all breakpoints in *filename*. If none were set, an error message is " +"returned." msgstr "" -"*filename* にあるすべてのブレークポイントを削除します。もしブレークポイントが" -"無かった場合、エラーメッセージを返します。" +"*filename* に含まれるすべてのブレークポイントを削除します。もしブレークポイン" +"トが無い場合、エラーメッセージを返します。" -#: ../../library/bdb.rst:364 -msgid "" -"Delete all existing breakpoints. If none were set, return an error message." -msgstr "" -"存在するすべてのブレークポイントを削除します。もしブレークポイントが無かった" -"場合、エラーメッセージを返します。" +#: ../../library/bdb.rst:280 +msgid "Delete all existing breakpoints." +msgstr "すべてのブレークポイントを削除します。" -#: ../../library/bdb.rst:369 +#: ../../library/bdb.rst:284 msgid "" "Return a breakpoint specified by the given number. If *arg* is a string, it " "will be converted to a number. If *arg* is a non-numeric string, if the " @@ -592,11 +532,12 @@ msgstr "" "ら数値に変換されます。 *arg* が非数値の文字列である場合、指定されたブレークポ" "イントが存在しないか削除された場合、 :exc:`ValueError` が上げられます。" -#: ../../library/bdb.rst:378 -msgid "Return ``True`` if there is a breakpoint for *lineno* in *filename*." +#: ../../library/bdb.rst:293 +msgid "Check if there is a breakpoint for *lineno* of *filename*." msgstr "" +"*filename* の *lineno* にブレークポイントが存在するかどうかをチェックします。" -#: ../../library/bdb.rst:382 +#: ../../library/bdb.rst:297 msgid "" "Return all breakpoints for *lineno* in *filename*, or an empty list if none " "are set." @@ -604,39 +545,17 @@ msgstr "" "*filename* の *lineno* にあるすべてのブレークポイントを返します。ブレークポイ" "ントが存在しない場合は空のリストを返します。" -#: ../../library/bdb.rst:387 +#: ../../library/bdb.rst:302 msgid "Return all breakpoints in *filename*, or an empty list if none are set." msgstr "" "*filename* の中のすべてのブレークポイントを返します。ブレークポイントが存在し" "ない場合は空のリストを返します。" -#: ../../library/bdb.rst:391 +#: ../../library/bdb.rst:306 msgid "Return all breakpoints that are set." msgstr "セットされているすべてのブレークポイントを返します。" -#: ../../library/bdb.rst:394 -msgid "" -"Derived classes and clients can call the following methods to disable and " -"restart events to achieve better performance. These methods only work when " -"using the ``'monitoring'`` backend." -msgstr "" - -#: ../../library/bdb.rst:400 -msgid "" -"Disable the current event until the next time :func:`restart_events` is " -"called. This is helpful when the debugger is not interested in the current " -"line." -msgstr "" - -#: ../../library/bdb.rst:408 -msgid "" -"Restart all the disabled events. This function is automatically called in " -"``dispatch_*`` methods after ``user_*`` methods are called. If the " -"``dispatch_*`` methods are not overridden, the disabled events will be " -"restarted after each user interaction." -msgstr "" - -#: ../../library/bdb.rst:416 +#: ../../library/bdb.rst:309 msgid "" "Derived classes and clients can call the following methods to get a data " "structure representing a stack trace." @@ -644,43 +563,43 @@ msgstr "" "継承クラスとクライアントは以下のメソッドを呼んでスタックトレースを表現する" "データ構造を取得することができます。" -#: ../../library/bdb.rst:421 -msgid "Return a list of (frame, lineno) tuples in a stack trace, and a size." -msgstr "" - -#: ../../library/bdb.rst:423 +#: ../../library/bdb.rst:314 msgid "" -"The most recently called frame is last in the list. The size is the number " -"of frames below the frame where the debugger was invoked." +"Get a list of records for a frame and all higher (calling) and lower frames, " +"and the size of the higher part." msgstr "" +"与えられたフレームおよび上位(呼び出し側)と下位のすべてのフレームに対するレ" +"コードのリストと、上位フレームのサイズを得ます。" -#: ../../library/bdb.rst:428 +#: ../../library/bdb.rst:319 msgid "" -"Return a string with information about a stack entry, which is a ``(frame, " -"lineno)`` tuple. The return string contains:" +"Return a string with information about a stack entry, identified by a " +"``(frame, lineno)`` tuple:" msgstr "" +"``(frame, lineno)`` で指定されたスタックエントリに関する次のような情報を持つ" +"文字列を返します:" -#: ../../library/bdb.rst:431 -msgid "The canonical filename which contains the frame." -msgstr "" +#: ../../library/bdb.rst:322 +msgid "The canonical form of the filename which contains the frame." +msgstr "そのフレームを含むファイル名の標準形。" -#: ../../library/bdb.rst:432 -msgid "The function name or ``\"\"``." -msgstr "関数名もしくは ``\"\"``。" +#: ../../library/bdb.rst:323 +msgid "The function name, or ``\"\"``." +msgstr "関数名、もしくは ``\"\"``。" -#: ../../library/bdb.rst:433 +#: ../../library/bdb.rst:324 msgid "The input arguments." msgstr "入力された引数。" -#: ../../library/bdb.rst:434 +#: ../../library/bdb.rst:325 msgid "The return value." msgstr "戻り値。" -#: ../../library/bdb.rst:435 +#: ../../library/bdb.rst:326 msgid "The line of code (if it exists)." msgstr "(あれば)その行のコード。" -#: ../../library/bdb.rst:438 +#: ../../library/bdb.rst:329 msgid "" "The following two methods can be called by clients to use a debugger to " "debug a :term:`statement`, given as a string." @@ -688,13 +607,16 @@ msgstr "" "以下の2つのメソッドは、文字列として渡された :term:`文 ` をデバッグ" "するもので、クライアントから利用されます。" -#: ../../library/bdb.rst:443 +#: ../../library/bdb.rst:334 msgid "" "Debug a statement executed via the :func:`exec` function. *globals* " -"defaults to :attr:`!__main__.__dict__`, *locals* defaults to *globals*." +"defaults to :attr:`__main__.__dict__`, *locals* defaults to *globals*." msgstr "" +":func:`exec` 関数を利用して文を実行しデバッグします。 *globals* はデフォルト" +"では :attr:`__main__.__dict__` で、 *locals* はデフォルトでは *globals* で" +"す。" -#: ../../library/bdb.rst:448 +#: ../../library/bdb.rst:339 msgid "" "Debug an expression executed via the :func:`eval` function. *globals* and " "*locals* have the same meaning as in :meth:`run`." @@ -702,62 +624,52 @@ msgstr "" ":func:`eval` 関数を利用して式を実行しデバッグします。 *globals* と *locals* " "は :meth:`run` と同じ意味です。" -#: ../../library/bdb.rst:453 +#: ../../library/bdb.rst:344 msgid "For backwards compatibility. Calls the :meth:`run` method." msgstr "後方互換性のためのメソッドです。 :meth:`run` を使ってください。" -#: ../../library/bdb.rst:457 +#: ../../library/bdb.rst:348 msgid "Debug a single function call, and return its result." msgstr "1つの関数呼び出しをデバッグし、その結果を返します。" -#: ../../library/bdb.rst:460 +#: ../../library/bdb.rst:351 msgid "Finally, the module defines the following functions:" msgstr "最後に、このモジュールは以下の関数を提供しています:" -#: ../../library/bdb.rst:464 -msgid "" -"Return ``True`` if we should break here, depending on the way the :class:" -"`Breakpoint` *b* was set." -msgstr "" - -#: ../../library/bdb.rst:467 +#: ../../library/bdb.rst:355 msgid "" -"If it was set via line number, it checks if :attr:`b.line ` is the same as the one in *frame*. If the breakpoint was set via :" -"attr:`function name `, we have to check we are in " -"the right *frame* (the right function) and if we are on its first executable " -"line." +"Check whether we should break here, depending on the way the breakpoint *b* " +"was set." msgstr "" +"この場所でブレークする必要があるかどうかを、ブレークポイント *b* が設定された" +"方法に依存する方法でチェックします。" -#: ../../library/bdb.rst:476 +#: ../../library/bdb.rst:358 msgid "" -"Return ``(active breakpoint, delete temporary flag)`` or ``(None, None)`` as " -"the breakpoint to act upon." +"If it was set via line number, it checks if ``b.line`` is the same as the " +"one in the frame also passed as argument. If the breakpoint was set via " +"function name, we have to check we are in the right frame (the right " +"function) and if we are in its first executable line." msgstr "" +"ブレークポイントが行番号で設定されていた場合、この関数は ``b.line`` が、同じ" +"く引数として与えられた *frame* の中の行に一致するかどうかをチェックします。ブ" +"レークポイントが関数名で設定されていた場合、この関数は *frame* が指定された関" +"数のものであるかどうかと、その関数の最初の行であるかどうかをチェックします。" -#: ../../library/bdb.rst:479 +#: ../../library/bdb.rst:365 msgid "" -"The *active breakpoint* is the first entry in :attr:`bplist ` for the (:attr:`file `, :attr:`line `) (which must exist) that is :attr:`enabled `, for which :func:`checkfuncname` is true, and that has neither a " -"false :attr:`condition ` nor positive :attr:`ignore " -"` count. The *flag*, meaning that a temporary " -"breakpoint should be deleted, is ``False`` only when the :attr:`cond ` cannot be evaluated (in which case, :attr:`ignore ` count is ignored)." +"Determine if there is an effective (active) breakpoint at this line of code. " +"Return a tuple of the breakpoint and a boolean that indicates if it is ok to " +"delete a temporary breakpoint. Return ``(None, None)`` if there is no " +"matching breakpoint." msgstr "" +"指定されたソースコード中の行に(有効な)ブレークポイントがあるかどうかを判断し" +"ます。ブレークポイントと、テンポラリブレークポイントを削除して良いかどうかを" +"示すフラグからなるタプルを返します。マッチするブレークポイントが存在しない場" +"合は ``(None, None)`` を返します。" -#: ../../library/bdb.rst:490 -msgid "If no such entry exists, then ``(None, None)`` is returned." -msgstr "" - -#: ../../library/bdb.rst:495 +#: ../../library/bdb.rst:372 msgid "Start debugging with a :class:`Bdb` instance from caller's frame." msgstr "" ":class:`Bdb` クラスのインスタンスを使って、呼び出し元のフレームからデバッグを" "開始します。" - -#: ../../library/bdb.rst:330 -msgid "quitting (bdb.Bdb attribute)" -msgstr "" diff --git a/library/binary.po b/library/binary.po index 0ebc3e188..b59ebc0ba 100644 --- a/library/binary.po +++ b/library/binary.po @@ -1,25 +1,27 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 +# Inada Naoki , 2017 +# Arihiro TAKASE, 2017 +# Shun Sakurai, 2017 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-30 14:22+0000\n" -"PO-Revision-Date: 2021-06-28 00:56+0000\n" -"Last-Translator: tomo, 2021\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 18:42+0000\n" +"Last-Translator: Shun Sakurai, 2017\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/binary.rst:5 diff --git a/library/binascii.po b/library/binascii.po index 1cbf728fa..8f6f8471d 100644 --- a/library/binascii.po +++ b/library/binascii.po @@ -1,51 +1,54 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Tetsuo Koyama , 2024 -# Rafael Fontenelle , 2024 -# Arihiro TAKASE, 2024 -# 石井明久, 2024 -# Takanori Suzuki , 2024 -# tomo, 2024 +# Nozomu Kaneko , 2017 +# 秘湯 , 2017 +# Arihiro TAKASE, 2017 +# E. Kawashima, 2017 +# tomo, 2019 +# Tetsuo Koyama , 2020 +# Takanori Suzuki , 2021 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-13 14:21+0000\n" -"PO-Revision-Date: 2021-06-28 00:56+0000\n" -"Last-Translator: tomo, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 18:42+0000\n" +"Last-Translator: Takanori Suzuki , 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/binascii.rst:2 -msgid ":mod:`!binascii` --- Convert between binary and ASCII" -msgstr ":mod:`!binascii` --- バイナリ と ASCII 間の変換" +msgid ":mod:`binascii` --- Convert between binary and ASCII" +msgstr ":mod:`binascii` --- バイナリデータと ASCII データとの間での変換" -#: ../../library/binascii.rst:13 +#: ../../library/binascii.rst:15 msgid "" "The :mod:`binascii` module contains a number of methods to convert between " "binary and various ASCII-encoded binary representations. Normally, you will " -"not use these functions directly but use wrapper modules like :mod:`base64` " -"instead. The :mod:`binascii` module contains low-level functions written in " -"C for greater speed that are used by the higher-level modules." +"not use these functions directly but use wrapper modules like :mod:`uu`, :" +"mod:`base64`, or :mod:`binhex` instead. The :mod:`binascii` module contains " +"low-level functions written in C for greater speed that are used by the " +"higher-level modules." msgstr "" ":mod:`binascii` モジュールにはバイナリと ASCII コード化されたバイナリ表現との" -"間の変換を行うための多数のメソッドが含まれています。通常はこれらの関数を直接" -"使わずに :mod:`base64` といったラッパーモジュールを使います。:mod:" -"`binascii` モジュールは C で書かれた高速な低水準関数を提供していて、それらは" -"上記の高水準なモジュールで利用されます。" +"間の変換を行うための多数のメソッドが含まれています。通常、これらの関数を直接" +"使う必要はなく、 :mod:`uu` 、 :mod:`base64` や :mod:`binhex` といった、ラッ" +"パ (wrapper) モジュールを使うことになるでしょう。 :mod:`binascii` モジュール" +"は C で書かれた高速な低水準関数を提供していて、それらは上記の高水準なモジュー" +"ルで利用されます。" -#: ../../library/binascii.rst:22 +#: ../../library/binascii.rst:24 msgid "" "``a2b_*`` functions accept Unicode strings containing only ASCII characters. " "Other functions only accept :term:`bytes-like objects ` " @@ -57,16 +60,16 @@ msgstr "" "するその他のオブジェクトのような) :term:`bytes-like オブジェクト ` だけを受け取ります。" -#: ../../library/binascii.rst:27 +#: ../../library/binascii.rst:29 msgid "ASCII-only unicode strings are now accepted by the ``a2b_*`` functions." msgstr "" "``a2b_*`` 関数は ASCII のみのユニコード文字列を受け取るようになりました。" -#: ../../library/binascii.rst:31 +#: ../../library/binascii.rst:33 msgid "The :mod:`binascii` module defines the following functions:" msgstr ":mod:`binascii` モジュールでは以下の関数を定義します:" -#: ../../library/binascii.rst:36 +#: ../../library/binascii.rst:38 msgid "" "Convert a single line of uuencoded data back to binary and return the binary " "data. Lines normally contain 45 (binary) bytes, except for the last line. " @@ -76,7 +79,7 @@ msgstr "" "ます。最後の行を除いて、通常 1 行には (バイナリデータで) 45 バイトが含まれま" "す。入力データの先頭には空白文字が連続していてもかまいません。" -#: ../../library/binascii.rst:43 +#: ../../library/binascii.rst:45 msgid "" "Convert binary data to a line of ASCII characters, the return value is the " "converted line, including a newline char. The length of *data* should be at " @@ -84,11 +87,11 @@ msgid "" "spaces." msgstr "" -#: ../../library/binascii.rst:47 +#: ../../library/binascii.rst:49 msgid "Added the *backtick* parameter." msgstr "*backtick* パラメータを追加しました." -#: ../../library/binascii.rst:53 +#: ../../library/binascii.rst:55 msgid "" "Convert a block of base64 data back to binary and return the binary data. " "More than one line may be passed at a time." @@ -96,39 +99,7 @@ msgstr "" "base64 でエンコードされたデータのブロックをバイナリに変換し、変換後のバイナリ" "データを返します。一度に 1 行以上のデータを与えてもかまいません。" -#: ../../library/binascii.rst:56 -msgid "" -"If *strict_mode* is true, only valid base64 data will be converted. Invalid " -"base64 data will raise :exc:`binascii.Error`." -msgstr "" - -#: ../../library/binascii.rst:59 -msgid "Valid base64:" -msgstr "" - #: ../../library/binascii.rst:61 -msgid "Conforms to :rfc:`3548`." -msgstr "" - -#: ../../library/binascii.rst:62 -msgid "Contains only characters from the base64 alphabet." -msgstr "" - -#: ../../library/binascii.rst:63 -msgid "" -"Contains no excess data after padding (including excess padding, newlines, " -"etc.)." -msgstr "" - -#: ../../library/binascii.rst:64 -msgid "Does not start with a padding." -msgstr "" - -#: ../../library/binascii.rst:66 -msgid "Added the *strict_mode* parameter." -msgstr "" - -#: ../../library/binascii.rst:72 msgid "" "Convert binary data to a line of ASCII characters in base64 coding. The " "return value is the converted line, including a newline char if *newline* is " @@ -138,11 +109,11 @@ msgstr "" "戻り値は変換後の 1 行の文字列で、*newline* が真の場合改行文字を含みます。この" "関数の出力は :rfc:`3548` を遵守します。" -#: ../../library/binascii.rst:76 +#: ../../library/binascii.rst:65 msgid "Added the *newline* parameter." msgstr "パラメータに *newline* を追加しました。" -#: ../../library/binascii.rst:82 +#: ../../library/binascii.rst:71 msgid "" "Convert a block of quoted-printable data back to binary and return the " "binary data. More than one line may be passed at a time. If the optional " @@ -152,7 +123,7 @@ msgstr "" "度に 1 行以上のデータを渡すことができます。オプション引数 *header* が与えられ" "ており、かつその値が真であれば、アンダースコアは空白文字にデコードされます。" -#: ../../library/binascii.rst:89 +#: ../../library/binascii.rst:78 msgid "" "Convert binary data to a line(s) of ASCII characters in quoted-printable " "encoding. The return value is the converted line(s). If the optional " @@ -175,7 +146,52 @@ msgstr "" "合、復帰 (linefeed) 文字の変換によってバイナリデータストリームが破損してしま" "うかもしれません。" -#: ../../library/binascii.rst:102 +#: ../../library/binascii.rst:91 +msgid "" +"Convert binhex4 formatted ASCII data to binary, without doing RLE-" +"decompression. The string should contain a complete number of binary bytes, " +"or (in case of the last portion of the binhex4 data) have the remaining bits " +"zero." +msgstr "" +"binhex4 形式の ASCII 文字列データを RLE 展開を行わないでバイナリに変換しま" +"す。文字列はバイナリのバイトデータを完全に含むような長さか、または (binhex4 " +"データの最後の部分の場合) 余白のビットがゼロになっていなければなりません。" + +#: ../../library/binascii.rst:100 +msgid "" +"Perform RLE-decompression on the data, as per the binhex4 standard. The " +"algorithm uses ``0x90`` after a byte as a repeat indicator, followed by a " +"count. A count of ``0`` specifies a byte value of ``0x90``. The routine " +"returns the decompressed data, unless data input data ends in an orphaned " +"repeat indicator, in which case the :exc:`Incomplete` exception is raised." +msgstr "" +"*data* に対し、 binhex4 標準に従って RLE 展開を行います。このアルゴリズムで" +"は、あるバイトの後ろに ``0x90`` がきた場合、そのバイトの反復を指示しており、" +"さらにその後ろに反復カウントが続きます。カウントが ``0`` の場合 ``0x90`` 自体" +"を示します。このルーチンは入力データの末端における反復指定が不完全でないかぎ" +"り解凍されたデータを返しますが、不完全な場合、例外 :exc:`Incomplete` が送出さ" +"れます。" + +#: ../../library/binascii.rst:106 +msgid "Accept only bytestring or bytearray objects as input." +msgstr "" +"入力として bytestring または bytearray オブジェクトのみを受け取ります。" + +#: ../../library/binascii.rst:114 +msgid "Perform binhex4 style RLE-compression on *data* and return the result." +msgstr "binhex4 方式の RLE 圧縮を *data* に対して行い、その結果を返します。" + +#: ../../library/binascii.rst:121 +msgid "" +"Perform hexbin4 binary-to-ASCII translation and return the resulting string. " +"The argument should already be RLE-coded, and have a length divisible by 3 " +"(except possibly the last fragment)." +msgstr "" +"バイナリを hexbin4 エンコードして ASCII 文字列に変換し、変換後の文字列を返し" +"ます。引数の *data* はすでに RLE エンコードされていなければならず、その長さ" +"は (最後のフラグメントを除いて) 3 で割り切れなければなりません。" + +#: ../../library/binascii.rst:130 msgid "" "Compute a 16-bit CRC value of *data*, starting with *value* as the initial " "CRC, and return the result. This uses the CRC-CCITT polynomial *x*:sup:`16` " @@ -188,34 +204,29 @@ msgstr "" "`12` + *x*:sup:`5` + 1 を使います。\n" "この CRC は binhex4 形式で使われています。" -#: ../../library/binascii.rst:110 +#: ../../library/binascii.rst:138 msgid "" -"Compute CRC-32, the unsigned 32-bit checksum of *data*, starting with an " -"initial CRC of *value*. The default initial CRC is zero. The algorithm is " -"consistent with the ZIP file checksum. Since the algorithm is designed for " -"use as a checksum algorithm, it is not suitable for use as a general hash " -"algorithm. Use as follows::" +"Compute CRC-32, the 32-bit checksum of *data*, starting with an initial CRC " +"of *value*. The default initial CRC is zero. The algorithm is consistent " +"with the ZIP file checksum. Since the algorithm is designed for use as a " +"checksum algorithm, it is not suitable for use as a general hash algorithm. " +"Use as follows::" msgstr "" -"符号無し 32 ビットチェックサムである CRC-32 を *data* に対して計算します。 " -"crc の初期値は *value* です。デフォルトの CRC の初期値はゼロです。このアルゴ" -"リズムは ZIP ファイルのチェックサムと同じです。このアルゴリズムはチェックサム" -"アルゴリズムとして設計されたもので、一般的なハッシュアルゴリズムには向きませ" -"ん。以下のようにして使います::" +"32 ビットチェックサムである CRC-32 を *data* に対して計算します。 crc の初期" +"値は *value* です。デフォルトの CRC の初期値はゼロです。このアルゴリズムは " +"ZIP ファイルのチェックサムと同じです。このアルゴリズムはチェックサムアルゴリ" +"ズムとして設計されたもので、一般的なハッシュアルゴリズムには向きません。以下" +"のようにして使います::" -#: ../../library/binascii.rst:116 +#: ../../library/binascii.rst:150 msgid "" -"print(binascii.crc32(b\"hello world\"))\n" -"# Or, in two pieces:\n" -"crc = binascii.crc32(b\"hello\")\n" -"crc = binascii.crc32(b\" world\", crc)\n" -"print('crc32 = {:#010x}'.format(crc))" -msgstr "" - -#: ../../library/binascii.rst:122 -msgid "The result is always unsigned." +"The result is always unsigned. To generate the same numeric value across all " +"Python versions and platforms, use ``crc32(data) & 0xffffffff``." msgstr "" +"結果は常に unsigned です。すべてのバージョンとプラットフォームの Python に" +"渡って同一の数値を生成するには、``crc32(data) & 0xffffffff`` を使用します。" -#: ../../library/binascii.rst:128 +#: ../../library/binascii.rst:159 msgid "" "Return the hexadecimal representation of the binary *data*. Every byte of " "*data* is converted into the corresponding 2-digit hex representation. The " @@ -225,13 +236,13 @@ msgstr "" "表現に変換されます。したがって、返されるバイトオブジェクトは *data* の2倍の長" "さになります。" -#: ../../library/binascii.rst:132 +#: ../../library/binascii.rst:163 msgid "" "Similar functionality (but returning a text string) is also conveniently " "accessible using the :meth:`bytes.hex` method." msgstr "" -#: ../../library/binascii.rst:135 +#: ../../library/binascii.rst:166 msgid "" "If *sep* is specified, it must be a single character str or bytes object. It " "will be inserted in the output after every *bytes_per_sep* input bytes. " @@ -239,11 +250,11 @@ msgid "" "if you wish to count from the left, supply a negative *bytes_per_sep* value." msgstr "" -#: ../../library/binascii.rst:150 +#: ../../library/binascii.rst:181 msgid "The *sep* and *bytes_per_sep* parameters were added." msgstr "引数 *sep* と *bytes_per_sep* が追加されました." -#: ../../library/binascii.rst:156 +#: ../../library/binascii.rst:187 msgid "" "Return the binary data represented by the hexadecimal string *hexstr*. This " "function is the inverse of :func:`b2a_hex`. *hexstr* must contain an even " @@ -255,18 +266,18 @@ msgstr "" "偶数個含んでいなければなりません。そうでない場合、例外 :exc:`Error` が送出さ" "れます。" -#: ../../library/binascii.rst:161 +#: ../../library/binascii.rst:192 msgid "" "Similar functionality (accepting only text string arguments, but more " "liberal towards whitespace) is also accessible using the :meth:`bytes." "fromhex` class method." msgstr "" -#: ../../library/binascii.rst:167 +#: ../../library/binascii.rst:198 msgid "Exception raised on errors. These are usually programming errors." msgstr "エラーが発生した際に送出される例外です。通常はプログラムのエラーです。" -#: ../../library/binascii.rst:172 +#: ../../library/binascii.rst:203 msgid "" "Exception raised on incomplete data. These are usually not programming " "errors, but may be handled by reading a little more data and trying again." @@ -274,28 +285,36 @@ msgstr "" "変換するデータが不完全な場合に送出される例外です。通常はプログラムのエラーで" "はなく、多少追加読み込みを行って再度変換を試みることで対処できます。" -#: ../../library/binascii.rst:178 +#: ../../library/binascii.rst:211 msgid "Module :mod:`base64`" msgstr ":mod:`base64` モジュール" -#: ../../library/binascii.rst:179 +#: ../../library/binascii.rst:210 msgid "" "Support for RFC compliant base64-style encoding in base 16, 32, 64, and 85." msgstr "RFC 準拠の base64 形式の、底が 16、32、64、85 のエンコーディング。" -#: ../../library/binascii.rst:182 +#: ../../library/binascii.rst:214 +msgid "Module :mod:`binhex`" +msgstr ":mod:`binhex` モジュール" + +#: ../../library/binascii.rst:214 +msgid "Support for the binhex format used on the Macintosh." +msgstr "Macintosh で使われる binhex フォーマットのサポート。" + +#: ../../library/binascii.rst:217 +msgid "Module :mod:`uu`" +msgstr ":mod:`uu` モジュール" + +#: ../../library/binascii.rst:217 +msgid "Support for UU encoding used on Unix." +msgstr "Unix で使われる UU エンコードのサポート。" + +#: ../../library/binascii.rst:219 msgid "Module :mod:`quopri`" msgstr ":mod:`quopri` モジュール" -#: ../../library/binascii.rst:183 +#: ../../library/binascii.rst:220 msgid "Support for quoted-printable encoding used in MIME email messages." msgstr "" "MIME 電子メールメッセージで使われる quoted-printable エンコードのサポート。" - -#: ../../library/binascii.rst:8 -msgid "module" -msgstr "module" - -#: ../../library/binascii.rst:8 -msgid "base64" -msgstr "base64" diff --git a/library/binhex.po b/library/binhex.po index 938f7cb18..79230eaa5 100644 --- a/library/binhex.po +++ b/library/binhex.po @@ -1,20 +1,23 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001-2022, Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 -# mollinaca, 2021 +# 秘湯 , 2017 +# E. Kawashima, 2017 +# Arihiro TAKASE, 2017 +# Nozomu Kaneko , 2017 +# mollinaca, 2020 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.10\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2022-11-05 16:26+0000\n" -"PO-Revision-Date: 2021-06-28 00:56+0000\n" -"Last-Translator: mollinaca, 2021\n" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 18:42+0000\n" +"Last-Translator: mollinaca, 2020\n" "Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" "Language: ja\n" diff --git a/library/bisect.po b/library/bisect.po index ce9dd0b6f..00d93b80f 100644 --- a/library/bisect.po +++ b/library/bisect.po @@ -1,32 +1,33 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 -# Takanori Suzuki , 2021 -# 石井明久, 2024 +# Shun Sakurai, 2017 +# Nozomu Kaneko , 2017 +# Arihiro TAKASE, 2017 +# tomo, 2018 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-13 14:21+0000\n" -"PO-Revision-Date: 2021-06-28 00:56+0000\n" -"Last-Translator: 石井明久, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 18:42+0000\n" +"Last-Translator: tomo, 2018\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/bisect.rst:2 -msgid ":mod:`!bisect` --- Array bisection algorithm" -msgstr ":mod:`!bisect` --- 配列二分法アルゴリズム" +msgid ":mod:`bisect` --- Array bisection algorithm" +msgstr ":mod:`bisect` --- 配列二分法アルゴリズム" #: ../../library/bisect.rst:10 msgid "**Source code:** :source:`Lib/bisect.py`" @@ -36,26 +37,24 @@ msgstr "**ソースコード:** :source:`Lib/bisect.py`" msgid "" "This module provides support for maintaining a list in sorted order without " "having to sort the list after each insertion. For long lists of items with " -"expensive comparison operations, this can be an improvement over linear " -"searches or frequent resorting." -msgstr "" - -#: ../../library/bisect.rst:19 -msgid "" -"The module is called :mod:`bisect` because it uses a basic bisection " -"algorithm to do its work. Unlike other bisection tools that search for a " -"specific value, the functions in this module are designed to locate an " -"insertion point. Accordingly, the functions never call an :meth:`~object." -"__eq__` method to determine whether a value has been found. Instead, the " -"functions only call the :meth:`~object.__lt__` method and will return an " -"insertion point between values in an array." -msgstr "" - -#: ../../library/bisect.rst:29 +"expensive comparison operations, this can be an improvement over the more " +"common approach. The module is called :mod:`bisect` because it uses a basic " +"bisection algorithm to do its work. The source code may be most useful as a " +"working example of the algorithm (the boundary conditions are already " +"right!)." +msgstr "" +"このモジュールは、挿入の度にリストをソートすることなく、リストをソートされた" +"順序に保つことをサポートします。大量の比較操作を伴うような、アイテムがたくさ" +"んあるリストでは、より一般的なアプローチに比べて、パフォーマンスが向上しま" +"す。動作に基本的な二分法アルゴリズムを使っているので、 :mod:`bisect` と呼ばれ" +"ています。ソースコードはこのアルゴリズムの実例として一番役に立つかもしれませ" +"ん (境界条件はすでに正しいです!)。" + +#: ../../library/bisect.rst:21 msgid "The following functions are provided:" msgstr "次の関数が用意されています:" -#: ../../library/bisect.rst:34 +#: ../../library/bisect.rst:26 msgid "" "Locate the insertion point for *x* in *a* to maintain sorted order. The " "parameters *lo* and *hi* may be used to specify a subset of the list which " @@ -71,264 +70,112 @@ msgstr "" "insert()`` の第一引数として使うのに適しています。*a* はすでにソートされている" "ものとします。" -#: ../../library/bisect.rst:41 -msgid "" -"The returned insertion point *ip* partitions the array *a* into two slices " -"such that ``all(elem < x for elem in a[lo : ip])`` is true for the left " -"slice and ``all(elem >= x for elem in a[ip : hi])`` is true for the right " -"slice." -msgstr "" - -#: ../../library/bisect.rst:46 -msgid "" -"*key* specifies a :term:`key function` of one argument that is used to " -"extract a comparison key from each element in the array. To support " -"searching complex records, the key function is not applied to the *x* value." -msgstr "" - -#: ../../library/bisect.rst:50 -msgid "" -"If *key* is ``None``, the elements are compared directly and no key function " -"is called." -msgstr "" - -#: ../../library/bisect.rst:53 ../../library/bisect.rst:67 -#: ../../library/bisect.rst:85 ../../library/bisect.rst:105 -msgid "Added the *key* parameter." -msgstr "*key* パラメータが追加されました。" - -#: ../../library/bisect.rst:60 -msgid "" -"Similar to :py:func:`~bisect.bisect_left`, but returns an insertion point " -"which comes after (to the right of) any existing entries of *x* in *a*." -msgstr "" - -#: ../../library/bisect.rst:63 -msgid "" -"The returned insertion point *ip* partitions the array *a* into two slices " -"such that ``all(elem <= x for elem in a[lo : ip])`` is true for the left " -"slice and ``all(elem > x for elem in a[ip : hi])`` is true for the right " -"slice." -msgstr "" - -#: ../../library/bisect.rst:73 -msgid "Insert *x* in *a* in sorted order." -msgstr "*x* を *a* にソート順で挿入します。" - -#: ../../library/bisect.rst:75 -msgid "" -"This function first runs :py:func:`~bisect.bisect_left` to locate an " -"insertion point. Next, it runs the :meth:`!insert` method on *a* to insert " -"*x* at the appropriate position to maintain sort order." -msgstr "" - -#: ../../library/bisect.rst:79 ../../library/bisect.rst:99 -msgid "" -"To support inserting records in a table, the *key* function (if any) is " -"applied to *x* for the search step but not for the insertion step." -msgstr "" - -#: ../../library/bisect.rst:82 ../../library/bisect.rst:102 -msgid "" -"Keep in mind that the *O*\\ (log *n*) search is dominated by the slow *O*\\ " -"(*n*) insertion step." -msgstr "" - -#: ../../library/bisect.rst:92 -msgid "" -"Similar to :py:func:`~bisect.insort_left`, but inserting *x* in *a* after " -"any existing entries of *x*." -msgstr "" - -#: ../../library/bisect.rst:95 +#: ../../library/bisect.rst:33 msgid "" -"This function first runs :py:func:`~bisect.bisect_right` to locate an " -"insertion point. Next, it runs the :meth:`!insert` method on *a* to insert " -"*x* at the appropriate position to maintain sort order." +"The returned insertion point *i* partitions the array *a* into two halves so " +"that ``all(val < x for val in a[lo:i])`` for the left side and ``all(val >= " +"x for val in a[i:hi])`` for the right side." msgstr "" +"返された挿入点 *i* は、配列 *a* を二つに分け、``all(val < x for val in a[lo:" +"i])`` が左側に、``all(val >= x for val in a[i:hi])`` が右側になるようにしま" +"す。" -#: ../../library/bisect.rst:110 -msgid "Performance Notes" -msgstr "パフォーマンスに関するメモ" - -#: ../../library/bisect.rst:112 +#: ../../library/bisect.rst:40 msgid "" -"When writing time sensitive code using *bisect()* and *insort()*, keep these " -"thoughts in mind:" +"Similar to :func:`bisect_left`, but returns an insertion point which comes " +"after (to the right of) any existing entries of *x* in *a*." msgstr "" +":func:`bisect_left` と似ていますが、 *a* に含まれる *x* のうち、どのエント" +"リーよりも後ろ(右)にくるような挿入点を返します。" -#: ../../library/bisect.rst:115 +#: ../../library/bisect.rst:43 msgid "" -"Bisection is effective for searching ranges of values. For locating specific " -"values, dictionaries are more performant." +"The returned insertion point *i* partitions the array *a* into two halves so " +"that ``all(val <= x for val in a[lo:i])`` for the left side and ``all(val > " +"x for val in a[i:hi])`` for the right side." msgstr "" +"返された挿入点 *i* は、配列 *a* を二つに分け、``all(val <= x for val in a[lo:" +"i])`` が左側に、``all(val > x for val in a[i:hi])`` が右側になるようにしま" +"す。" -#: ../../library/bisect.rst:118 +#: ../../library/bisect.rst:49 msgid "" -"The *insort()* functions are *O*\\ (*n*) because the logarithmic search step " -"is dominated by the linear time insertion step." +"Insert *x* in *a* in sorted order. This is equivalent to ``a.insert(bisect." +"bisect_left(a, x, lo, hi), x)`` assuming that *a* is already sorted. Keep " +"in mind that the O(log n) search is dominated by the slow O(n) insertion " +"step." msgstr "" +"*x* を *a* にソート順で挿入します。これは、*a* がすでにソートされている場合、" +"``a.insert(bisect.bisect_left(a, x, lo, hi), x)`` と等価です。なお、O(log n) " +"の探索に対して、遅い O(n) の挿入の段階が律速となります。" -#: ../../library/bisect.rst:121 +#: ../../library/bisect.rst:57 msgid "" -"The search functions are stateless and discard key function results after " -"they are used. Consequently, if the search functions are used in a loop, " -"the key function may be called again and again on the same array elements. " -"If the key function isn't fast, consider wrapping it with :py:func:" -"`functools.cache` to avoid duplicate computations. Alternatively, consider " -"searching an array of precomputed keys to locate the insertion point (as " -"shown in the examples section below)." +"Similar to :func:`insort_left`, but inserting *x* in *a* after any existing " +"entries of *x*." msgstr "" +":func:`insort_left` と似ていますが、 *a* に含まれる *x* のうち、どのエント" +"リーよりも後ろに *x* を挿入します。" -#: ../../library/bisect.rst:131 -msgid "" -"`Sorted Collections `_ is a " -"high performance module that uses *bisect* to managed sorted collections of " -"data." -msgstr "" - -#: ../../library/bisect.rst:135 +#: ../../library/bisect.rst:62 msgid "" -"The `SortedCollection recipe `_ uses bisect to build a full-featured collection class " -"with straight-forward search methods and support for a key-function. The " -"keys are precomputed to save unnecessary calls to the key function during " -"searches." +"`SortedCollection recipe `_ that uses bisect to build a full-featured collection " +"class with straight-forward search methods and support for a key-function. " +"The keys are precomputed to save unnecessary calls to the key function " +"during searches." msgstr "" "bisect を利用して、直接の探索ができ、キー関数をサポートする、完全な機能を持つ" "コレクションクラスを組み立てる `SortedCollection recipe `_\\ 。キーは、探索中に不必" "要な呼び出しをさせないために、予め計算しておきます。" -#: ../../library/bisect.rst:143 +#: ../../library/bisect.rst:70 msgid "Searching Sorted Lists" msgstr "ソート済みリストの探索" -#: ../../library/bisect.rst:145 +#: ../../library/bisect.rst:72 msgid "" -"The above `bisect functions`_ are useful for finding insertion points but " -"can be tricky or awkward to use for common searching tasks. The following " -"five functions show how to transform them into the standard lookups for " -"sorted lists::" +"The above :func:`bisect` functions are useful for finding insertion points " +"but can be tricky or awkward to use for common searching tasks. The " +"following five functions show how to transform them into the standard " +"lookups for sorted lists::" msgstr "" +"上記の :func:`bisect` 関数群は挿入点を探索するのには便利ですが、普通の探索タ" +"スクに使うのはトリッキーだったり不器用だったりします。以下の 5 関数は、これら" +"をどのように標準の探索やソート済みリストに変換するかを説明します::" -#: ../../library/bisect.rst:150 -msgid "" -"def index(a, x):\n" -" 'Locate the leftmost value exactly equal to x'\n" -" i = bisect_left(a, x)\n" -" if i != len(a) and a[i] == x:\n" -" return i\n" -" raise ValueError\n" -"\n" -"def find_lt(a, x):\n" -" 'Find rightmost value less than x'\n" -" i = bisect_left(a, x)\n" -" if i:\n" -" return a[i-1]\n" -" raise ValueError\n" -"\n" -"def find_le(a, x):\n" -" 'Find rightmost value less than or equal to x'\n" -" i = bisect_right(a, x)\n" -" if i:\n" -" return a[i-1]\n" -" raise ValueError\n" -"\n" -"def find_gt(a, x):\n" -" 'Find leftmost value greater than x'\n" -" i = bisect_right(a, x)\n" -" if i != len(a):\n" -" return a[i]\n" -" raise ValueError\n" -"\n" -"def find_ge(a, x):\n" -" 'Find leftmost item greater than or equal to x'\n" -" i = bisect_left(a, x)\n" -" if i != len(a):\n" -" return a[i]\n" -" raise ValueError" -msgstr "" - -#: ../../library/bisect.rst:187 -msgid "Examples" -msgstr "使用例" - -#: ../../library/bisect.rst:191 -msgid "" -"The :py:func:`~bisect.bisect` function can be useful for numeric table " -"lookups. This example uses :py:func:`~bisect.bisect` to look up a letter " -"grade for an exam score (say) based on a set of ordered numeric breakpoints: " -"90 and up is an 'A', 80 to 89 is a 'B', and so on::" -msgstr "" - -#: ../../library/bisect.rst:196 -msgid "" -">>> def grade(score, breakpoints=[60, 70, 80, 90], grades='FDCBA'):\n" -"... i = bisect(breakpoints, score)\n" -"... return grades[i]\n" -"...\n" -">>> [grade(score) for score in [33, 99, 77, 70, 89, 90, 100]]\n" -"['F', 'A', 'C', 'C', 'B', 'A', 'A']" -msgstr "" +#: ../../library/bisect.rst:114 +msgid "Other Examples" +msgstr "その他の使用例" -#: ../../library/bisect.rst:203 -msgid "" -"The :py:func:`~bisect.bisect` and :py:func:`~bisect.insort` functions also " -"work with lists of tuples. The *key* argument can serve to extract the " -"field used for ordering records in a table::" -msgstr "" - -#: ../../library/bisect.rst:207 +#: ../../library/bisect.rst:118 msgid "" -">>> from collections import namedtuple\n" -">>> from operator import attrgetter\n" -">>> from bisect import bisect, insort\n" -">>> from pprint import pprint\n" -"\n" -">>> Movie = namedtuple('Movie', ('name', 'released', 'director'))\n" -"\n" -">>> movies = [\n" -"... Movie('Jaws', 1975, 'Spielberg'),\n" -"... Movie('Titanic', 1997, 'Cameron'),\n" -"... Movie('The Birds', 1963, 'Hitchcock'),\n" -"... Movie('Aliens', 1986, 'Cameron')\n" -"... ]\n" -"\n" -">>> # Find the first movie released after 1960\n" -">>> by_year = attrgetter('released')\n" -">>> movies.sort(key=by_year)\n" -">>> movies[bisect(movies, 1960, key=by_year)]\n" -"Movie(name='The Birds', released=1963, director='Hitchcock')\n" -"\n" -">>> # Insert a movie while maintaining sort order\n" -">>> romance = Movie('Love Story', 1970, 'Hiller')\n" -">>> insort(movies, romance, key=by_year)\n" -">>> pprint(movies)\n" -"[Movie(name='The Birds', released=1963, director='Hitchcock'),\n" -" Movie(name='Love Story', released=1970, director='Hiller'),\n" -" Movie(name='Jaws', released=1975, director='Spielberg'),\n" -" Movie(name='Aliens', released=1986, director='Cameron'),\n" -" Movie(name='Titanic', released=1997, director='Cameron')]" +"The :func:`bisect` function can be useful for numeric table lookups. This " +"example uses :func:`bisect` to look up a letter grade for an exam score " +"(say) based on a set of ordered numeric breakpoints: 90 and up is an 'A', 80 " +"to 89 is a 'B', and so on::" msgstr "" +":func:`bisect` 関数は数値テーブルの探索に役に立ちます。この例では、 :func:" +"`bisect` を使って、(たとえば)順序のついた数値の区切り点の集合に基づいて、試験" +"の成績の等級を表す文字を調べます。区切り点は 90 以上は 'A'、 80 から 89 は " +"'B'、などです::" -#: ../../library/bisect.rst:237 +#: ../../library/bisect.rst:130 msgid "" -"If the key function is expensive, it is possible to avoid repeated function " -"calls by searching a list of precomputed keys to find the index of a record::" +"Unlike the :func:`sorted` function, it does not make sense for the :func:" +"`bisect` functions to have *key* or *reversed* arguments because that would " +"lead to an inefficient design (successive calls to bisect functions would " +"not \"remember\" all of the previous key lookups)." msgstr "" +":func:`sorted` 関数と違い、 :func:`bisect` 関数に *key* や *reversed* 引数を" +"用意するのは、設計が非効率になるので、非合理的です (連続する bisect 関数の呼" +"び出しは前回の key 参照の結果を \"記憶\" しません)。" -#: ../../library/bisect.rst:240 +#: ../../library/bisect.rst:135 msgid "" -">>> data = [('red', 5), ('blue', 1), ('yellow', 8), ('black', 0)]\n" -">>> data.sort(key=lambda r: r[1]) # Or use operator.itemgetter(1).\n" -">>> keys = [r[1] for r in data] # Precompute a list of keys.\n" -">>> data[bisect_left(keys, 0)]\n" -"('black', 0)\n" -">>> data[bisect_left(keys, 1)]\n" -"('blue', 1)\n" -">>> data[bisect_left(keys, 5)]\n" -"('red', 5)\n" -">>> data[bisect_left(keys, 8)]\n" -"('yellow', 8)" +"Instead, it is better to search a list of precomputed keys to find the index " +"of the record in question::" msgstr "" +"代わりに、事前に計算しておいたキーのリストから検索して、レコードのインデック" +"スを見つけます::" diff --git a/library/builtins.po b/library/builtins.po index 9bd7727fe..d0f6d6260 100644 --- a/library/builtins.po +++ b/library/builtins.po @@ -1,40 +1,45 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 -# 石井明久, 2024 +# Arihiro TAKASE, 2017 +# Nozomu Kaneko , 2017 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-06 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:56+0000\n" -"Last-Translator: 石井明久, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 19:36+0000\n" +"Last-Translator: Nozomu Kaneko , 2017\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/builtins.rst:2 -msgid ":mod:`!builtins` --- Built-in objects" -msgstr ":mod:`!builtins` --- 組み込みオブジェクト" +msgid ":mod:`builtins` --- Built-in objects" +msgstr ":mod:`builtins` --- 組み込みオブジェクト" #: ../../library/builtins.rst:9 msgid "" "This module provides direct access to all 'built-in' identifiers of Python; " "for example, ``builtins.open`` is the full name for the built-in function :" -"func:`open`." +"func:`open`. See :ref:`built-in-funcs` and :ref:`built-in-consts` for " +"documentation." msgstr "" +"このモジュールは Python の全ての「組み込み」識別子に直接アクセスするためのも" +"のです。例えば ``builtins.open`` は組み込み関数 :func:`open` の完全な名前で" +"す。ドキュメントは :ref:`built-in-funcs` と :ref:`built-in-consts` を参照して" +"ください。" -#: ../../library/builtins.rst:12 +#: ../../library/builtins.rst:15 msgid "" "This module is not normally accessed explicitly by most applications, but " "can be useful in modules that provide objects with the same name as a built-" @@ -48,27 +53,7 @@ msgstr "" "ば、組み込みの :func:`open` をラップした :func:`open` という関数を実装したい" "モジュールがあったとすると、このモジュールは次のように直接的に使われます::" -#: ../../library/builtins.rst:18 -msgid "" -"import builtins\n" -"\n" -"def open(path):\n" -" f = builtins.open(path, 'r')\n" -" return UpperCaser(f)\n" -"\n" -"class UpperCaser:\n" -" '''Wrapper around a file that converts output to uppercase.'''\n" -"\n" -" def __init__(self, f):\n" -" self._f = f\n" -"\n" -" def read(self, count=-1):\n" -" return self._f.read(count).upper()\n" -"\n" -" # ..." -msgstr "" - -#: ../../library/builtins.rst:35 +#: ../../library/builtins.rst:38 msgid "" "As an implementation detail, most modules have the name ``__builtins__`` " "made available as part of their globals. The value of ``__builtins__`` is " @@ -81,19 +66,3 @@ msgstr "" "か、あるいはこのモジュールの :attr:`~object.__dict__` 属性です。これは実装の" "詳細部分なので、異なる Python の実装では ``__builtins__`` は使われていないこ" "ともあります。" - -#: ../../library/builtins.rst:43 -msgid ":ref:`built-in-consts`" -msgstr "" - -#: ../../library/builtins.rst:44 -msgid ":ref:`bltin-exceptions`" -msgstr "" - -#: ../../library/builtins.rst:45 -msgid ":ref:`built-in-funcs`" -msgstr "" - -#: ../../library/builtins.rst:46 -msgid ":ref:`bltin-types`" -msgstr "" diff --git a/library/bz2.po b/library/bz2.po index 3c6de681d..e87080f3d 100644 --- a/library/bz2.po +++ b/library/bz2.po @@ -1,33 +1,39 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: +# Nozomu Kaneko , 2017 +# 秘湯 , 2017 +# fujimoto , 2017 +# Arihiro TAKASE, 2017 +# Yusuke Miyazaki , 2017 +# Shun Sakurai, 2017 +# E. Kawashima, 2017 +# Masato HASHIMOTO , 2017 +# Osamu NAKAMURA, 2017 # tomo, 2021 -# Arihiro TAKASE, 2023 -# Taichi Haradaguchi, 2024 -# 石井明久, 2024 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-13 14:21+0000\n" -"PO-Revision-Date: 2021-06-28 00:56+0000\n" -"Last-Translator: 石井明久, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 19:36+0000\n" +"Last-Translator: tomo, 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/bz2.rst:2 -msgid ":mod:`!bz2` --- Support for :program:`bzip2` compression" -msgstr ":mod:`!bz2` --- :program:`bzip2` 圧縮のサポート" +msgid ":mod:`bz2` --- Support for :program:`bzip2` compression" +msgstr ":mod:`bz2` --- :program:`bzip2` 圧縮のサポート" #: ../../library/bz2.rst:12 msgid "**Source code:** :source:`Lib/bz2.py`" @@ -68,11 +74,18 @@ msgid "" msgstr "" "一度に圧縮・展開を行う :func:`compress` および :func:`decompress` 関数。" -#: ../../library/bz2.rst:30 +#: ../../library/bz2.rst:28 +msgid "" +"All of the classes in this module may safely be accessed from multiple " +"threads." +msgstr "" +"このモジュールのクラスはすべて、複数のスレッドから安全にアクセスできます。" + +#: ../../library/bz2.rst:32 msgid "(De)compression of files" msgstr "ファイルの圧縮/解凍" -#: ../../library/bz2.rst:34 +#: ../../library/bz2.rst:36 msgid "" "Open a bzip2-compressed file in binary or text mode, returning a :term:`file " "object`." @@ -80,7 +93,7 @@ msgstr "" "bzip2 圧縮されたファイルを、バイナリモードかテキストモードでオープンし、:" "term:`ファイルオブジェクト ` を返します。" -#: ../../library/bz2.rst:37 +#: ../../library/bz2.rst:39 msgid "" "As with the constructor for :class:`BZ2File`, the *filename* argument can be " "an actual filename (a :class:`str` or :class:`bytes` object), or an existing " @@ -90,7 +103,7 @@ msgstr "" "名 (:class:`str` または :class:`bytes` オブジェクト) か、読み書きする既存の" "ファイルオブジェクトを指定します。" -#: ../../library/bz2.rst:41 +#: ../../library/bz2.rst:43 msgid "" "The *mode* argument can be any of ``'r'``, ``'rb'``, ``'w'``, ``'wb'``, " "``'x'``, ``'xb'``, ``'a'`` or ``'ab'`` for binary mode, or ``'rt'``, " @@ -101,7 +114,7 @@ msgstr "" "``'wt'``、``'xt'``、あるいは ``'at'`` を指定できます。デフォルトは ``'rb'`` " "です。" -#: ../../library/bz2.rst:45 +#: ../../library/bz2.rst:47 msgid "" "The *compresslevel* argument is an integer from 1 to 9, as for the :class:" "`BZ2File` constructor." @@ -109,7 +122,7 @@ msgstr "" "引数 *compresslevel* には :class:`BZ2File` コンストラクタと同様に 1 から 9 の" "整数を指定します。" -#: ../../library/bz2.rst:48 +#: ../../library/bz2.rst:50 msgid "" "For binary mode, this function is equivalent to the :class:`BZ2File` " "constructor: ``BZ2File(filename, mode, compresslevel=compresslevel)``. In " @@ -120,7 +133,7 @@ msgstr "" "``BZ2File(filename, mode, compresslevel=compresslevel)`` と等価です。この時、" "引数 *encoding*、*errors*、および *newline* を指定してはいけません。" -#: ../../library/bz2.rst:53 +#: ../../library/bz2.rst:55 msgid "" "For text mode, a :class:`BZ2File` object is created, and wrapped in an :" "class:`io.TextIOWrapper` instance with the specified encoding, error " @@ -130,19 +143,19 @@ msgstr "" "コーディング、エラーハンドラの挙動、および改行文字で :class:`io." "TextIOWrapper` にラップされます。" -#: ../../library/bz2.rst:59 ../../library/bz2.rst:175 +#: ../../library/bz2.rst:61 ../../library/bz2.rst:126 msgid "The ``'x'`` (exclusive creation) mode was added." msgstr "``'x'`` (排他的作成) モードが追加されました。" -#: ../../library/bz2.rst:62 ../../library/bz2.rst:182 +#: ../../library/bz2.rst:64 ../../library/bz2.rst:133 msgid "Accepts a :term:`path-like object`." msgstr ":term:`path-like object` を受け入れるようになりました。" -#: ../../library/bz2.rst:68 +#: ../../library/bz2.rst:70 msgid "Open a bzip2-compressed file in binary mode." msgstr "bzip2 圧縮ファイルをバイナリモードでオープンします。" -#: ../../library/bz2.rst:70 +#: ../../library/bz2.rst:72 msgid "" "If *filename* is a :class:`str` or :class:`bytes` object, open the named " "file directly. Otherwise, *filename* should be a :term:`file object`, which " @@ -152,7 +165,7 @@ msgstr "" "名前とするファイルを直接開きます。そうでない場合、*filename* は圧縮データを読" "み書きする :term:`ファイルオブジェクト ` でなくてはなりません。" -#: ../../library/bz2.rst:74 +#: ../../library/bz2.rst:76 msgid "" "The *mode* argument can be either ``'r'`` for reading (default), ``'w'`` for " "overwriting, ``'x'`` for exclusive creation, or ``'a'`` for appending. These " @@ -164,7 +177,7 @@ msgstr "" "ます。これらはそれぞれ ``'rb'``、``'wb'``、``'xb'`` および ``'ab'`` と等価で" "す。" -#: ../../library/bz2.rst:79 +#: ../../library/bz2.rst:81 msgid "" "If *filename* is a file object (rather than an actual file name), a mode of " "``'w'`` does not truncate the file, and is instead equivalent to ``'a'``." @@ -172,7 +185,7 @@ msgstr "" "*filename* が (実際のファイル名でなく) ファイルオブジェクトの場合、``'w'`` は" "ファイルを上書きせず、``'a'`` と等価になります。" -#: ../../library/bz2.rst:82 +#: ../../library/bz2.rst:84 msgid "" "If *mode* is ``'w'`` or ``'a'``, *compresslevel* can be an integer between " "``1`` and ``9`` specifying the level of compression: ``1`` produces the " @@ -182,7 +195,7 @@ msgstr "" "``1`` から ``9`` の整数で指定できます。\n" "圧縮率は ``1`` が最低で、``9`` (デフォルト値) が最高です。" -#: ../../library/bz2.rst:86 +#: ../../library/bz2.rst:88 msgid "" "If *mode* is ``'r'``, the input file may be the concatenation of multiple " "compressed streams." @@ -190,22 +203,21 @@ msgstr "" "*mode* の値が ``'r'`` の場合、入力ファイルは複数の圧縮ストリームでも構いませ" "ん。" -#: ../../library/bz2.rst:89 +#: ../../library/bz2.rst:91 msgid "" ":class:`BZ2File` provides all of the members specified by the :class:`io." -"BufferedIOBase`, except for :meth:`~io.BufferedIOBase.detach` and :meth:`~io." -"IOBase.truncate`. Iteration and the :keyword:`with` statement are supported." +"BufferedIOBase`, except for :meth:`detach` and :meth:`truncate`. Iteration " +"and the :keyword:`with` statement are supported." msgstr "" ":class:`BZ2File` には、 :class:`io.BufferedIOBase` で規定されているメソッドや" -"属性のうち、 :meth:`~io.BufferedIOBase.detach` と :meth:`~io.IOBase." -"truncate` を除くすべてが備わっています。イテレーションと :keyword:`with` 文を" -"サポートしています。" +"属性のうち、 :meth:`detach` と :meth:`truncate` を除くすべてが備わっていま" +"す。イテレーションと :keyword:`with` 文をサポートしています。" -#: ../../library/bz2.rst:94 -msgid ":class:`BZ2File` also provides the following methods and attributes:" -msgstr "" +#: ../../library/bz2.rst:95 +msgid ":class:`BZ2File` also provides the following method:" +msgstr ":class:`BZ2File` は以下のメソッドも提供しています:" -#: ../../library/bz2.rst:98 +#: ../../library/bz2.rst:99 msgid "" "Return buffered data without advancing the file position. At least one byte " "of data will be returned (unless at EOF). The exact number of bytes returned " @@ -215,7 +227,7 @@ msgstr "" "なくとも 1 バイトのデータを返します (EOF の場合を除く)。返される正確なバイト" "数は規定されていません。" -#: ../../library/bz2.rst:102 +#: ../../library/bz2.rst:103 msgid "" "While calling :meth:`peek` does not change the file position of the :class:" "`BZ2File`, it may change the position of the underlying file object (e.g. if " @@ -227,55 +239,18 @@ msgstr "" "を *filename* にファイルオブジェクトを渡して作成した場合)。" #: ../../library/bz2.rst:111 -msgid "Return the file descriptor for the underlying file." -msgstr "" - -#: ../../library/bz2.rst:117 -msgid "Return whether the file was opened for reading." -msgstr "" - -#: ../../library/bz2.rst:123 -msgid "Return whether the file supports seeking." -msgstr "" - -#: ../../library/bz2.rst:129 -msgid "Return whether the file was opened for writing." -msgstr "" - -#: ../../library/bz2.rst:135 -msgid "" -"Read up to *size* uncompressed bytes, while trying to avoid making multiple " -"reads from the underlying stream. Reads up to a buffer's worth of data if " -"size is negative." -msgstr "" - -#: ../../library/bz2.rst:139 -msgid "Returns ``b''`` if the file is at EOF." -msgstr "" - -#: ../../library/bz2.rst:145 -msgid "Read bytes into *b*." -msgstr "" - -#: ../../library/bz2.rst:147 -msgid "Returns the number of bytes read (0 for EOF)." -msgstr "" - -#: ../../library/bz2.rst:153 -msgid "``'rb'`` for reading and ``'wb'`` for writing." -msgstr "``'rb'`` は読み込み用、 ``'wb'`` は書き込み用です。" +msgid "Support for the :keyword:`with` statement was added." +msgstr ":keyword:`with` 構文のサポートが追加されました。" -#: ../../library/bz2.rst:159 +#: ../../library/bz2.rst:114 msgid "" -"The bzip2 file name. Equivalent to the :attr:`~io.FileIO.name` attribute of " -"the underlying :term:`file object`." +"The :meth:`fileno`, :meth:`readable`, :meth:`seekable`, :meth:`writable`, :" +"meth:`read1` and :meth:`readinto` methods were added." msgstr "" +":meth:`fileno` 、 :meth:`readable` 、 :meth:`seekable` 、 :meth:" +"`writable` 、 :meth:`read1` 、 :meth:`readinto` メソッドが追加されました。" -#: ../../library/bz2.rst:165 -msgid "Support for the :keyword:`with` statement was added." -msgstr ":keyword:`with` 構文のサポートが追加されました。" - -#: ../../library/bz2.rst:168 +#: ../../library/bz2.rst:118 msgid "" "Support was added for *filename* being a :term:`file object` instead of an " "actual filename." @@ -283,7 +258,7 @@ msgstr "" "*filename* が実際のファイル名でなく :term:`ファイルオブジェクト ` だった場合のサポートが追加されました。" -#: ../../library/bz2.rst:172 +#: ../../library/bz2.rst:122 msgid "" "The ``'a'`` (append) mode was added, along with support for reading multi-" "stream files." @@ -291,7 +266,7 @@ msgstr "" "``'a'`` (追記) モードが追加され、複数のストリームの読み込みがサポートされまし" "た。" -#: ../../library/bz2.rst:178 +#: ../../library/bz2.rst:129 msgid "" "The :meth:`~io.BufferedIOBase.read` method now accepts an argument of " "``None``." @@ -299,7 +274,7 @@ msgstr "" ":meth:`~io.BufferedIOBase.read` メソッドが ``None`` を引数として受け取るよう" "になりました。" -#: ../../library/bz2.rst:185 +#: ../../library/bz2.rst:136 msgid "" "The *buffering* parameter has been removed. It was ignored and deprecated " "since Python 3.0. Pass an open file object to control how the file is opened." @@ -308,24 +283,15 @@ msgstr "" "なっています。開かれたファイルオブジェクトを渡し、ファイルの開きかたを制御し" "ます。" -#: ../../library/bz2.rst:190 +#: ../../library/bz2.rst:141 msgid "The *compresslevel* parameter became keyword-only." msgstr "*compresslevel* パラメータはキーワード専用になりました。" -#: ../../library/bz2.rst:192 -msgid "" -"This class is thread unsafe in the face of multiple simultaneous readers or " -"writers, just like its equivalent classes in :mod:`gzip` and :mod:`lzma` " -"have always been." -msgstr "" -"このクラスは、複数の同時読み出しや書き込みにおいては、既存の :mod:`gzip` や :" -"mod:`lzma` などの同等のクラスのように、スレッド安全ではありません。" - -#: ../../library/bz2.rst:199 +#: ../../library/bz2.rst:145 msgid "Incremental (de)compression" msgstr "逐次圧縮および展開" -#: ../../library/bz2.rst:203 +#: ../../library/bz2.rst:149 msgid "" "Create a new compressor object. This object may be used to compress data " "incrementally. For one-shot compression, use the :func:`compress` function " @@ -335,7 +301,7 @@ msgstr "" "な圧縮に使用できます。一度に圧縮したい場合は、:func:`compress` 関数を使ってく" "ださい。" -#: ../../library/bz2.rst:207 ../../library/bz2.rst:295 +#: ../../library/bz2.rst:153 ../../library/bz2.rst:241 msgid "" "*compresslevel*, if given, must be an integer between ``1`` and ``9``. The " "default is ``9``." @@ -344,7 +310,7 @@ msgstr "" "ださい。\n" "デフォルト値は ``9`` です。" -#: ../../library/bz2.rst:212 +#: ../../library/bz2.rst:158 msgid "" "Provide data to the compressor object. Returns a chunk of compressed data if " "possible, or an empty byte string otherwise." @@ -352,7 +318,7 @@ msgstr "" "データをコンプレッサオブジェクトに渡します。戻り値は圧縮されたデータですが、" "圧縮データを返すことができない場合は空のバイト文字列を返します。" -#: ../../library/bz2.rst:215 +#: ../../library/bz2.rst:161 msgid "" "When you have finished providing data to the compressor, call the :meth:" "`flush` method to finish the compression process." @@ -360,21 +326,21 @@ msgstr "" "コンプレッサオブジェクトにデータをすべて渡し終えたら、:meth:`flush` メソッド" "を呼び出し、圧縮プロセスを完了させてください。" -#: ../../library/bz2.rst:221 +#: ../../library/bz2.rst:167 msgid "" "Finish the compression process. Returns the compressed data left in internal " "buffers." msgstr "" "圧縮プロセスを完了させ、内部バッファに残っている圧縮済みデータを返します。" -#: ../../library/bz2.rst:224 +#: ../../library/bz2.rst:170 msgid "" "The compressor object may not be used after this method has been called." msgstr "" "このメソッドを呼び出すと、それ以後コンプレッサオブジェクトは使用できなくなり" "ます。" -#: ../../library/bz2.rst:229 +#: ../../library/bz2.rst:175 msgid "" "Create a new decompressor object. This object may be used to decompress data " "incrementally. For one-shot compression, use the :func:`decompress` function " @@ -384,7 +350,7 @@ msgstr "" "タ展開に使用できます。一度に展開したい場合は、:func:`decompress` 関数を使って" "ください。" -#: ../../library/bz2.rst:234 +#: ../../library/bz2.rst:180 msgid "" "This class does not transparently handle inputs containing multiple " "compressed streams, unlike :func:`decompress` and :class:`BZ2File`. If you " @@ -397,7 +363,7 @@ msgstr "" "合は、それぞれのストリームについてデコンプレッサオブジェクトを用意してくださ" "い。" -#: ../../library/bz2.rst:241 +#: ../../library/bz2.rst:187 msgid "" "Decompress *data* (a :term:`bytes-like object`), returning uncompressed data " "as bytes. Some of *data* may be buffered internally, for use in later calls " @@ -411,7 +377,7 @@ msgstr "" "返されたデータは、以前の :meth:`decompress` の呼び出しの出力に連結する必要が" "あります。" -#: ../../library/bz2.rst:247 +#: ../../library/bz2.rst:193 msgid "" "If *max_length* is nonnegative, returns at most *max_length* bytes of " "decompressed data. If this limit is reached and further output can be " @@ -424,7 +390,7 @@ msgstr "" "``False`` に設定されます。この場合、 :meth:`~.decompress` を次に呼び出すと、" "*data* を ``b''`` として提供し、出力をさらに取得することができます。" -#: ../../library/bz2.rst:254 +#: ../../library/bz2.rst:200 msgid "" "If all of the input data was decompressed and returned (either because this " "was less than *max_length* bytes, or because *max_length* was negative), " @@ -434,30 +400,30 @@ msgstr "" "*max_length* が負のため) 場合、\n" ":attr:`~.needs_input` 属性は ``True`` になります。" -#: ../../library/bz2.rst:259 +#: ../../library/bz2.rst:205 msgid "" -"Attempting to decompress data after the end of stream is reached raises an :" -"exc:`EOFError`. Any data found after the end of the stream is ignored and " -"saved in the :attr:`~.unused_data` attribute." +"Attempting to decompress data after the end of stream is reached raises an " +"`EOFError`. Any data found after the end of the stream is ignored and saved " +"in the :attr:`~.unused_data` attribute." msgstr "" -"ストリームの終端に到達した後にデータを展開しようとすると :exc:`EOFError` が送" -"出されます。\n" +"ストリームの終端に到達した後にデータを展開しようとすると `EOFError` が送出さ" +"れます。\n" "ストリームの終端の後ろの全てのデータは無視され、その部分は :attr:" "`unused_data` 属性に保存されます。" -#: ../../library/bz2.rst:263 +#: ../../library/bz2.rst:209 msgid "Added the *max_length* parameter." msgstr "``max_length`` パラメータが追加されました。" -#: ../../library/bz2.rst:268 +#: ../../library/bz2.rst:214 msgid "``True`` if the end-of-stream marker has been reached." msgstr "ストリーム終端記号に到達した場合 ``True`` を返します。" -#: ../../library/bz2.rst:275 +#: ../../library/bz2.rst:221 msgid "Data found after the end of the compressed stream." msgstr "圧縮ストリームの末尾以降に存在したデータを表します。" -#: ../../library/bz2.rst:277 +#: ../../library/bz2.rst:223 msgid "" "If this attribute is accessed before the end of the stream has been reached, " "its value will be ``b''``." @@ -465,7 +431,7 @@ msgstr "" "ストリームの末尾に達する前には、この属性には ``b''`` という値が収められていま" "す。" -#: ../../library/bz2.rst:282 +#: ../../library/bz2.rst:228 msgid "" "``False`` if the :meth:`.decompress` method can provide more decompressed " "data before requiring new uncompressed input." @@ -473,48 +439,48 @@ msgstr "" ":meth:`.decompress` メソッドが、新しい非圧縮入力を必要とせずにさらに展開デー" "タを提供できる場合、 ``False`` です。" -#: ../../library/bz2.rst:289 +#: ../../library/bz2.rst:235 msgid "One-shot (de)compression" msgstr "一括圧縮/解凍" -#: ../../library/bz2.rst:293 +#: ../../library/bz2.rst:239 msgid "Compress *data*, a :term:`bytes-like object `." msgstr "" ":term:`バイト類オブジェクト ` の *data* を圧縮します。" -#: ../../library/bz2.rst:298 +#: ../../library/bz2.rst:244 msgid "For incremental compression, use a :class:`BZ2Compressor` instead." msgstr "" "逐次的にデータを圧縮したい場合は、:class:`BZ2Compressor` を使ってください。" -#: ../../library/bz2.rst:303 +#: ../../library/bz2.rst:249 msgid "Decompress *data*, a :term:`bytes-like object `." msgstr "" ":term:`バイト類オブジェクト ` の *data* を展開します。" -#: ../../library/bz2.rst:305 +#: ../../library/bz2.rst:251 msgid "" "If *data* is the concatenation of multiple compressed streams, decompress " "all of the streams." msgstr "*data* が複数の圧縮ストリームから成る場合、そのすべてを展開します。" -#: ../../library/bz2.rst:308 +#: ../../library/bz2.rst:254 msgid "For incremental decompression, use a :class:`BZ2Decompressor` instead." msgstr "逐次的に展開を行う場合は、:class:`BZ2Decompressor` を使ってください。" -#: ../../library/bz2.rst:310 +#: ../../library/bz2.rst:256 msgid "Support for multi-stream inputs was added." msgstr "複数ストリームの入力をサポートしました。" -#: ../../library/bz2.rst:316 +#: ../../library/bz2.rst:262 msgid "Examples of usage" msgstr "使い方の例" -#: ../../library/bz2.rst:318 +#: ../../library/bz2.rst:264 msgid "Below are some examples of typical usage of the :mod:`bz2` module." msgstr "以下は、典型的な :mod:`bz2` モジュールの利用方法です。" -#: ../../library/bz2.rst:320 +#: ../../library/bz2.rst:266 msgid "" "Using :func:`compress` and :func:`decompress` to demonstrate round-trip " "compression:" @@ -522,21 +488,21 @@ msgstr "" ":func:`compress` と :func:`decompress` を使い、圧縮して展開する実演をしていま" "す:" -#: ../../library/bz2.rst:338 +#: ../../library/bz2.rst:284 msgid "Using :class:`BZ2Compressor` for incremental compression:" msgstr ":class:`BZ2Compressor` を使い、逐次圧縮をしています:" -#: ../../library/bz2.rst:356 +#: ../../library/bz2.rst:302 msgid "" "The example above uses a very \"nonrandom\" stream of data (a stream of " -"``b\"z\"`` chunks). Random data tends to compress poorly, while ordered, " +"`b\"z\"` chunks). Random data tends to compress poorly, while ordered, " "repetitive data usually yields a high compression ratio." msgstr "" -"上の例は、非常に \"ランダムでない\" データストリーム (チャンク ``b\"z\"`` の" -"ストリーム) です。\n" +"上の例は、非常に \"ランダムでない\" データストリーム (チャンク `b\"z\"` のス" +"トリーム) です。\n" "ランダムなデータは圧縮率が低い傾向にある一方、揃っていて、繰り返しのあるデー" "タは通常は高い圧縮率を叩き出します。" -#: ../../library/bz2.rst:360 +#: ../../library/bz2.rst:306 msgid "Writing and reading a bzip2-compressed file in binary mode:" msgstr "bzip2 圧縮されたファイルをバイナリモードで読み書きしています:" diff --git a/library/calendar.po b/library/calendar.po index 92521975c..db89cd014 100644 --- a/library/calendar.po +++ b/library/calendar.po @@ -1,35 +1,36 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# mollinaca, 2021 -# souma987, 2023 -# tomo, 2023 -# Takeshi Nakazato, 2023 -# 石井明久, 2024 -# Takanori Suzuki , 2025 +# 秘湯 , 2017 +# tomo, 2017 +# E. Kawashima, 2017 +# Nozomu Kaneko , 2017 +# Arihiro TAKASE, 2017 +# mollinaca, 2020 +# Takanori Suzuki , 2021 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:56+0000\n" -"Last-Translator: Takanori Suzuki , 2025\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 19:36+0000\n" +"Last-Translator: Takanori Suzuki , 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/calendar.rst:2 -msgid ":mod:`!calendar` --- General calendar-related functions" -msgstr ":mod:`!calendar` --- 一般的なカレンダーに関係する機能群" +msgid ":mod:`calendar` --- General calendar-related functions" +msgstr ":mod:`calendar` --- 一般的なカレンダーに関する関数群" #: ../../library/calendar.rst:10 msgid "**Source code:** :source:`Lib/calendar.py`" @@ -73,12 +74,10 @@ msgstr "" #: ../../library/calendar.rst:33 msgid "" "Creates a :class:`Calendar` object. *firstweekday* is an integer specifying " -"the first day of the week. :const:`MONDAY` is ``0`` (the default), :const:" -"`SUNDAY` is ``6``." +"the first day of the week. ``0`` is Monday (the default), ``6`` is Sunday." msgstr "" ":class:`Calendar` オブジェクトを作ります。 *firstweekday* は整数で週の始まり" -"の曜日を指定するものです。:const:`MONDAY` が ``0`` (デフォルト)、:const:" -"`SUNDAY` なら ``6`` です。" +"の曜日を指定するものです。 ``0`` が月曜(デフォルト)、 ``6`` なら日曜です。" #: ../../library/calendar.rst:36 msgid "" @@ -91,44 +90,19 @@ msgstr "" "ません。それはサブクラスの仕事なのです。" #: ../../library/calendar.rst:41 -msgid ":class:`Calendar` instances have the following methods and attributes:" -msgstr "" +msgid ":class:`Calendar` instances have the following methods:" +msgstr ":class:`Calendar` インスタンスには以下のメソッドがあります:" #: ../../library/calendar.rst:45 -msgid "The first weekday as an integer (0--6)." -msgstr "" - -#: ../../library/calendar.rst:47 -msgid "" -"This property can also be set and read using :meth:`~Calendar." -"setfirstweekday` and :meth:`~Calendar.getfirstweekday` respectively." -msgstr "" - -#: ../../library/calendar.rst:53 -msgid "Return an :class:`int` for the current first weekday (0--6)." -msgstr "" - -#: ../../library/calendar.rst:55 -msgid "Identical to reading the :attr:`~Calendar.firstweekday` property." -msgstr "" - -#: ../../library/calendar.rst:59 -msgid "" -"Set the first weekday to *firstweekday*, passed as an :class:`int` (0--6)" -msgstr "" - -#: ../../library/calendar.rst:61 -msgid "Identical to setting the :attr:`~Calendar.firstweekday` property." -msgstr "" - -#: ../../library/calendar.rst:65 msgid "" "Return an iterator for the week day numbers that will be used for one week. " "The first value from the iterator will be the same as the value of the :attr:" -"`~Calendar.firstweekday` property." +"`firstweekday` property." msgstr "" +"曜日の数字を一週間分生成するイテレータを返します。イテレータから得られる最初" +"の数字は :attr:`firstweekday` が返す数字と同じになります。" -#: ../../library/calendar.rst:72 +#: ../../library/calendar.rst:52 msgid "" "Return an iterator for the month *month* (1--12) in the year *year*. This " "iterator will return all days (as :class:`datetime.date` objects) for the " @@ -140,7 +114,7 @@ msgstr "" "た後の日のうち、週の欠けを埋めるために必要な日を (:class:`datetime.date` オブ" "ジェクトとして) 返します。" -#: ../../library/calendar.rst:80 +#: ../../library/calendar.rst:60 msgid "" "Return an iterator for the month *month* in the year *year* similar to :meth:" "`itermonthdates`, but not restricted by the :class:`datetime.date` range. " @@ -148,7 +122,7 @@ msgid "" "of the specified month, the day number is ``0``." msgstr "" -#: ../../library/calendar.rst:88 +#: ../../library/calendar.rst:68 msgid "" "Return an iterator for the month *month* in the year *year* similar to :meth:" "`itermonthdates`, but not restricted by the :class:`datetime.date` range. " @@ -156,7 +130,7 @@ msgid "" "week day number." msgstr "" -#: ../../library/calendar.rst:96 +#: ../../library/calendar.rst:76 msgid "" "Return an iterator for the month *month* in the year *year* similar to :meth:" "`itermonthdates`, but not restricted by the :class:`datetime.date` range. " @@ -164,7 +138,7 @@ msgid "" "month numbers." msgstr "" -#: ../../library/calendar.rst:106 +#: ../../library/calendar.rst:86 msgid "" "Return an iterator for the month *month* in the year *year* similar to :meth:" "`itermonthdates`, but not restricted by the :class:`datetime.date` range. " @@ -172,7 +146,7 @@ msgid "" "month, and a day of the week numbers." msgstr "" -#: ../../library/calendar.rst:116 +#: ../../library/calendar.rst:96 msgid "" "Return a list of the weeks in the month *month* of the *year* as full " "weeks. Weeks are lists of seven :class:`datetime.date` objects." @@ -180,7 +154,7 @@ msgstr "" "*year* 年 *month* 月の週のリストを返します。週は全て七つの :class:`datetime." "date` オブジェクトからなるリストです。" -#: ../../library/calendar.rst:122 +#: ../../library/calendar.rst:102 msgid "" "Return a list of the weeks in the month *month* of the *year* as full " "weeks. Weeks are lists of seven tuples of day numbers and weekday numbers." @@ -188,7 +162,7 @@ msgstr "" "*year* 年 *month* 月の週のリストを返します。週は全て七つの日付の数字と曜日を" "表す数字のタプルからなるリストです。" -#: ../../library/calendar.rst:129 +#: ../../library/calendar.rst:109 msgid "" "Return a list of the weeks in the month *month* of the *year* as full " "weeks. Weeks are lists of seven day numbers." @@ -196,7 +170,7 @@ msgstr "" "*year* 年 *month* 月の週のリストを返します。週は全て七つの日付の数字からなる" "リストです。" -#: ../../library/calendar.rst:135 +#: ../../library/calendar.rst:115 msgid "" "Return the data for the specified year ready for formatting. The return " "value is a list of month rows. Each month row contains up to *width* months " @@ -208,7 +182,7 @@ msgstr "" "からなり、各週は1ないし7日からなります。各日は :class:`datetime.date` オブ" "ジェクトです。" -#: ../../library/calendar.rst:143 +#: ../../library/calendar.rst:123 msgid "" "Return the data for the specified year ready for formatting (similar to :" "meth:`yeardatescalendar`). Entries in the week lists are tuples of day " @@ -218,7 +192,7 @@ msgstr "" "様です)。週のリストの中が日付の数字と曜日の数字のタプルになります。月の範囲外" "の部分の日付はゼロです。" -#: ../../library/calendar.rst:150 +#: ../../library/calendar.rst:130 msgid "" "Return the data for the specified year ready for formatting (similar to :" "meth:`yeardatescalendar`). Entries in the week lists are day numbers. Day " @@ -227,44 +201,15 @@ msgstr "" "指定された年のデータを整形に向く形で返します (:meth:`yeardatescalendar` と同" "様です)。週のリストの中が日付の数字になります。月の範囲外の日付はゼロです。" -#: ../../library/calendar.rst:157 +#: ../../library/calendar.rst:137 msgid "This class can be used to generate plain text calendars." msgstr "このクラスはプレインテキストのカレンダーを生成するのに使えます。" -#: ../../library/calendar.rst:159 +#: ../../library/calendar.rst:139 msgid ":class:`TextCalendar` instances have the following methods:" msgstr ":class:`TextCalendar` インスタンスには以下のメソッドがあります:" -#: ../../library/calendar.rst:164 -msgid "" -"Return a string representing a single day formatted with the given *width*. " -"If *theday* is ``0``, return a string of spaces of the specified width, " -"representing an empty day. The *weekday* parameter is unused." -msgstr "" - -#: ../../library/calendar.rst:171 -msgid "" -"Return a single week in a string with no newline. If *w* is provided, it " -"specifies the width of the date columns, which are centered. Depends on the " -"first weekday as specified in the constructor or set by the :meth:" -"`setfirstweekday` method." -msgstr "" - -#: ../../library/calendar.rst:179 -msgid "" -"Return a string representing the name of a single weekday formatted to the " -"specified *width*. The *weekday* parameter is an integer representing the " -"day of the week, where ``0`` is Monday and ``6`` is Sunday." -msgstr "" - -#: ../../library/calendar.rst:186 -msgid "" -"Return a string containing the header row of weekday names, formatted with " -"the given *width* for each column. The names depend on the locale settings " -"and are padded to the specified width." -msgstr "" - -#: ../../library/calendar.rst:193 +#: ../../library/calendar.rst:143 msgid "" "Return a month's calendar in a multi-line string. If *w* is provided, it " "specifies the width of the date columns, which are centered. If *l* is " @@ -277,19 +222,11 @@ msgstr "" "とができます。 :meth:`setfirstweekday` メソッドでセットされた週の最初の曜日に" "依存します。" -#: ../../library/calendar.rst:202 -msgid "" -"Return a string representing the month's name centered within the specified " -"*width*. If *withyear* is ``True``, include the year in the output. The " -"*theyear* and *themonth* parameters specify the year and month for the name " -"to be formatted respectively." -msgstr "" - -#: ../../library/calendar.rst:210 +#: ../../library/calendar.rst:152 msgid "Print a month's calendar as returned by :meth:`formatmonth`." msgstr ":meth:`formatmonth` で返されるひと月分のカレンダーを出力します。" -#: ../../library/calendar.rst:215 +#: ../../library/calendar.rst:157 msgid "" "Return a *m*-column calendar for an entire year as a multi-line string. " "Optional parameters *w*, *l*, and *c* are for date column width, lines per " @@ -304,20 +241,20 @@ msgstr "" "初の曜日に依存します。カレンダーを出力できる最初の年はプラットフォームに依存" "します。" -#: ../../library/calendar.rst:225 +#: ../../library/calendar.rst:167 msgid "" "Print the calendar for an entire year as returned by :meth:`formatyear`." msgstr ":meth:`formatyear` で返される一年間のカレンダーを出力します。" -#: ../../library/calendar.rst:230 +#: ../../library/calendar.rst:172 msgid "This class can be used to generate HTML calendars." msgstr "このクラスは HTML のカレンダーを生成するのに使えます。" -#: ../../library/calendar.rst:233 +#: ../../library/calendar.rst:175 msgid ":class:`!HTMLCalendar` instances have the following methods:" msgstr ":class:`!HTMLCalendar` インスタンスには以下のメソッドがあります:" -#: ../../library/calendar.rst:237 +#: ../../library/calendar.rst:179 msgid "" "Return a month's calendar as an HTML table. If *withyear* is true the year " "will be included in the header, otherwise just the month name will be used." @@ -325,7 +262,7 @@ msgstr "" "ひと月分のカレンダーを HTML のテーブルとして返します。*withyear* が真であれば" "ヘッダには年も含まれます。そうでなければ月の名前だけが使われます。" -#: ../../library/calendar.rst:244 +#: ../../library/calendar.rst:186 msgid "" "Return a year's calendar as an HTML table. *width* (defaulting to 3) " "specifies the number of months per row." @@ -333,7 +270,7 @@ msgstr "" "一年分のカレンダーを HTML のテーブルとして返します。*width* の値 (デフォルト" "では 3 です) は何ヶ月分を一行に収めるかを指定します。" -#: ../../library/calendar.rst:250 +#: ../../library/calendar.rst:192 msgid "" "Return a year's calendar as a complete HTML page. *width* (defaulting to 3) " "specifies the number of months per row. *css* is the name for the cascading " @@ -348,128 +285,112 @@ msgstr "" "コーディングを指定します (デフォルトではシステムデフォルトのエンコーディング" "です)。" -#: ../../library/calendar.rst:259 -msgid "" -"Return a month name as an HTML table row. If *withyear* is true the year " -"will be included in the row, otherwise just the month name will be used." -msgstr "" - -#: ../../library/calendar.rst:264 +#: ../../library/calendar.rst:199 msgid "" ":class:`!HTMLCalendar` has the following attributes you can override to " "customize the CSS classes used by the calendar:" msgstr "" -#: ../../library/calendar.rst:269 +#: ../../library/calendar.rst:204 msgid "" "A list of CSS classes used for each weekday. The default class list is::" msgstr "" -#: ../../library/calendar.rst:271 -msgid "" -"cssclasses = [\"mon\", \"tue\", \"wed\", \"thu\", \"fri\", \"sat\", \"sun\"]" -msgstr "" - -#: ../../library/calendar.rst:273 +#: ../../library/calendar.rst:208 msgid "more styles can be added for each day::" msgstr "" -#: ../../library/calendar.rst:275 -msgid "" -"cssclasses = [\"mon text-bold\", \"tue\", \"wed\", \"thu\", \"fri\", " -"\"sat\", \"sun red\"]" -msgstr "" - -#: ../../library/calendar.rst:277 +#: ../../library/calendar.rst:212 msgid "Note that the length of this list must be seven items." msgstr "" -#: ../../library/calendar.rst:282 +#: ../../library/calendar.rst:217 msgid "The CSS class for a weekday occurring in the previous or coming month." msgstr "" -#: ../../library/calendar.rst:289 +#: ../../library/calendar.rst:224 msgid "" "A list of CSS classes used for weekday names in the header row. The default " "is the same as :attr:`cssclasses`." msgstr "" -#: ../../library/calendar.rst:297 +#: ../../library/calendar.rst:232 msgid "" "The month's head CSS class (used by :meth:`formatmonthname`). The default " "value is ``\"month\"``." msgstr "" -#: ../../library/calendar.rst:305 +#: ../../library/calendar.rst:240 msgid "" "The CSS class for the whole month's table (used by :meth:`formatmonth`). The " "default value is ``\"month\"``." msgstr "" -#: ../../library/calendar.rst:313 +#: ../../library/calendar.rst:248 msgid "" "The CSS class for the whole year's table of tables (used by :meth:" "`formatyear`). The default value is ``\"year\"``." msgstr "" -#: ../../library/calendar.rst:321 +#: ../../library/calendar.rst:256 msgid "" "The CSS class for the table head for the whole year (used by :meth:" "`formatyear`). The default value is ``\"year\"``." msgstr "" -#: ../../library/calendar.rst:327 +#: ../../library/calendar.rst:262 msgid "" "Note that although the naming for the above described class attributes is " "singular (e.g. ``cssclass_month`` ``cssclass_noday``), one can replace the " "single CSS class with a space separated list of CSS classes, for example::" msgstr "" -#: ../../library/calendar.rst:331 -msgid "\"text-bold text-red\"" -msgstr "" - -#: ../../library/calendar.rst:333 +#: ../../library/calendar.rst:268 msgid "Here is an example how :class:`!HTMLCalendar` can be customized::" msgstr "" -#: ../../library/calendar.rst:335 -msgid "" -"class CustomHTMLCal(calendar.HTMLCalendar):\n" -" cssclasses = [style + \" text-nowrap\" for style in\n" -" calendar.HTMLCalendar.cssclasses]\n" -" cssclass_month_head = \"text-center month-head\"\n" -" cssclass_month = \"text-center month\"\n" -" cssclass_year = \"text-italic lead\"" -msgstr "" - -#: ../../library/calendar.rst:345 +#: ../../library/calendar.rst:280 msgid "" "This subclass of :class:`TextCalendar` can be passed a locale name in the " -"constructor and will return month and weekday names in the specified locale." +"constructor and will return month and weekday names in the specified locale. " +"If this locale includes an encoding all strings containing month and weekday " +"names will be returned as unicode." msgstr "" +"この :class:`TextCalendar` のサブクラスではコンストラクタにロケール名を渡すこ" +"とができ、メソッドの返り値で月や曜日が指定されたロケールのものになります。こ" +"のロケールがエンコーディングを含む場合には、月や曜日の入った文字列はユニコー" +"ドとして返されます。" -#: ../../library/calendar.rst:351 +#: ../../library/calendar.rst:288 msgid "" "This subclass of :class:`HTMLCalendar` can be passed a locale name in the " -"constructor and will return month and weekday names in the specified locale." +"constructor and will return month and weekday names in the specified locale. " +"If this locale includes an encoding all strings containing month and weekday " +"names will be returned as unicode." msgstr "" +"この :class:`HTMLCalendar` のサブクラスではコンストラクタにロケール名を渡すこ" +"とができ、メソッドの返り値で月や曜日が指定されたロケールのものになります。こ" +"のロケールがエンコーディングを含む場合には、月や曜日の入った文字列はユニコー" +"ドとして返されます。" -#: ../../library/calendar.rst:357 +#: ../../library/calendar.rst:295 msgid "" -"The constructor, :meth:`!formatweekday` and :meth:`!formatmonthname` methods " -"of these two classes temporarily change the ``LC_TIME`` locale to the given " -"*locale*. Because the current locale is a process-wide setting, they are not " -"thread-safe." +"The :meth:`formatweekday` and :meth:`formatmonthname` methods of these two " +"classes temporarily change the current locale to the given *locale*. " +"Because the current locale is a process-wide setting, they are not thread-" +"safe." msgstr "" +"これら2つのクラスの :meth:`formatweekday` と :meth:`formatmonthname` メソッド" +"は、一時的に現在の locale を指定された *locale* に変更します。現在の locale " +"はプロセス全体に影響するので、これらはスレッドセーフではありません。" -#: ../../library/calendar.rst:363 +#: ../../library/calendar.rst:300 msgid "For simple text calendars this module provides the following functions." msgstr "" "単純なテキストのカレンダーに関して、このモジュールには以下のような関数が提供" "されています。" -#: ../../library/calendar.rst:367 +#: ../../library/calendar.rst:304 msgid "" "Sets the weekday (``0`` is Monday, ``6`` is Sunday) to start each week. The " "values :const:`MONDAY`, :const:`TUESDAY`, :const:`WEDNESDAY`, :const:" @@ -481,24 +402,18 @@ msgstr "" "`FRIDAY`, :const:`SATURDAY` 及び :const:`SUNDAY` は便宜上提供されています。例" "えば、日曜日を週の開始日に設定するときは::" -#: ../../library/calendar.rst:372 -msgid "" -"import calendar\n" -"calendar.setfirstweekday(calendar.SUNDAY)" -msgstr "" - -#: ../../library/calendar.rst:378 +#: ../../library/calendar.rst:315 msgid "Returns the current setting for the weekday to start each week." msgstr "現在設定されている週の最初の曜日を返します。" -#: ../../library/calendar.rst:383 +#: ../../library/calendar.rst:320 msgid "" "Returns :const:`True` if *year* is a leap year, otherwise :const:`False`." msgstr "" "*year* が閏年なら :const:`True` を、そうでなければ :const:`False` を返しま" "す。" -#: ../../library/calendar.rst:388 +#: ../../library/calendar.rst:325 msgid "" "Returns the number of leap years in the range from *y1* to *y2* (exclusive), " "where *y1* and *y2* are years." @@ -506,11 +421,11 @@ msgstr "" "範囲(*y1* ... *y2*)指定された期間の閏年の回数を返します。ここで *y1* や *y2* " "は年を表します。" -#: ../../library/calendar.rst:391 +#: ../../library/calendar.rst:328 msgid "This function works for ranges spanning a century change." msgstr "この関数は、世紀の境目をまたぐ範囲でも正しく動作します。" -#: ../../library/calendar.rst:396 +#: ../../library/calendar.rst:333 msgid "" "Returns the day of the week (``0`` is Monday) for *year* (``1970``--...), " "*month* (``1``--``12``), *day* (``1``--``31``)." @@ -518,7 +433,7 @@ msgstr "" "*year* (``1970``--...), *month* (``1``--``12``), *day* (``1``--``31``) で与え" "られた日の曜日(``0`` は月曜日)を返します。" -#: ../../library/calendar.rst:402 +#: ../../library/calendar.rst:339 msgid "" "Return a header containing abbreviated weekday names. *n* specifies the " "width in characters for one weekday." @@ -526,13 +441,13 @@ msgstr "" "短縮された曜日名を含むヘッダを返します。*n* は各曜日を何文字で表すかを指定し" "ます。" -#: ../../library/calendar.rst:408 +#: ../../library/calendar.rst:345 msgid "" "Returns weekday of first day of the month and number of days in month, for " "the specified *year* and *month*." msgstr "*year* と *month* で指定された月の一日の曜日と日数を返します。" -#: ../../library/calendar.rst:414 +#: ../../library/calendar.rst:351 msgid "" "Returns a matrix representing a month's calendar. Each row represents a " "week; days outside of the month are represented by zeros. Each week begins " @@ -542,28 +457,32 @@ msgstr "" "それぞれの週は :func:`setfirstweekday` で設定をしていない限り月曜日から始まり" "ます。" -#: ../../library/calendar.rst:421 +#: ../../library/calendar.rst:358 msgid "Prints a month's calendar as returned by :func:`month`." msgstr ":func:`month` 関数によって返される月のカレンダーを出力します。" -#: ../../library/calendar.rst:426 +#: ../../library/calendar.rst:363 msgid "" "Returns a month's calendar in a multi-line string using the :meth:" -"`~TextCalendar.formatmonth` of the :class:`TextCalendar` class." +"`formatmonth` of the :class:`TextCalendar` class." msgstr "" +":class:`TextCalendar` の :meth:`formatmonth` メソッドを利用して、ひと月分のカ" +"レンダーを複数行の文字列で返します。" -#: ../../library/calendar.rst:432 +#: ../../library/calendar.rst:369 msgid "" "Prints the calendar for an entire year as returned by :func:`calendar`." msgstr ":func:`calendar` 関数で返される一年間のカレンダーを出力します。" -#: ../../library/calendar.rst:437 +#: ../../library/calendar.rst:374 msgid "" "Returns a 3-column calendar for an entire year as a multi-line string using " -"the :meth:`~TextCalendar.formatyear` of the :class:`TextCalendar` class." +"the :meth:`formatyear` of the :class:`TextCalendar` class." msgstr "" +":class:`TextCalendar` の :meth:`formatyear` メソッドを利用して、 3列からなる" +"一年間のカレンダーを複数行の文字列で返します。" -#: ../../library/calendar.rst:443 +#: ../../library/calendar.rst:380 msgid "" "An unrelated but handy function that takes a time tuple such as returned by " "the :func:`~time.gmtime` function in the :mod:`time` module, and returns the " @@ -577,91 +496,45 @@ msgstr "" "返します。実際には、 :func:`time.gmtime` と :func:`timegm` はお互いの逆関数で" "す。" -#: ../../library/calendar.rst:450 +#: ../../library/calendar.rst:387 msgid "The :mod:`calendar` module exports the following data attributes:" msgstr ":mod:`calendar` モジュールの以下のデータ属性を利用することができます:" -#: ../../library/calendar.rst:454 -msgid "" -"A sequence that represents the days of the week in the current locale, where " -"Monday is day number 0." -msgstr "" - -#: ../../library/calendar.rst:464 -msgid "" -"A sequence that represents the abbreviated days of the week in the current " -"locale, where Mon is day number 0." -msgstr "" - -#: ../../library/calendar.rst:479 -msgid "" -"Aliases for the days of the week, where ``MONDAY`` is ``0`` and ``SUNDAY`` " -"is ``6``." -msgstr "" +#: ../../library/calendar.rst:391 +msgid "An array that represents the days of the week in the current locale." +msgstr "現在のロケールでの曜日を表す配列です。" -#: ../../library/calendar.rst:487 +#: ../../library/calendar.rst:396 msgid "" -"Enumeration defining days of the week as integer constants. The members of " -"this enumeration are exported to the module scope as :data:`MONDAY` through :" -"data:`SUNDAY`." -msgstr "" +"An array that represents the abbreviated days of the week in the current " +"locale." +msgstr "現在のロケールでの短縮された曜日を表す配列です。" -#: ../../library/calendar.rst:496 +#: ../../library/calendar.rst:401 msgid "" -"A sequence that represents the months of the year in the current locale. " -"This follows normal convention of January being month number 1, so it has a " -"length of 13 and ``month_name[0]`` is the empty string." +"An array that represents the months of the year in the current locale. This " +"follows normal convention of January being month number 1, so it has a " +"length of 13 and ``month_name[0]`` is the empty string." msgstr "" +"現在のロケールでの月の名を表す配列です。この配列は通常の約束事に従って、1月を" +"数字の 1 で表しますので、長さが 13 ある代わりに ``month_name[0]`` が空文字列" +"になります。" -#: ../../library/calendar.rst:507 +#: ../../library/calendar.rst:408 msgid "" -"A sequence that represents the abbreviated months of the year in the current " +"An array that represents the abbreviated months of the year in the current " "locale. This follows normal convention of January being month number 1, so " "it has a length of 13 and ``month_abbr[0]`` is the empty string." msgstr "" +"現在のロケールでの短縮された月の名を表す配列です。この配列は通常の約束事に" +"従って、1月を数字の 1 で表しますので、長さが 13 ある代わりに " +"``month_abbr[0]`` が空文字列になります。" -#: ../../library/calendar.rst:528 -msgid "" -"Aliases for the months of the year, where ``JANUARY`` is ``1`` and " -"``DECEMBER`` is ``12``." -msgstr "" - -#: ../../library/calendar.rst:536 -msgid "" -"Enumeration defining months of the year as integer constants. The members of " -"this enumeration are exported to the module scope as :data:`JANUARY` " -"through :data:`DECEMBER`." -msgstr "" - -#: ../../library/calendar.rst:543 -msgid "The :mod:`calendar` module defines the following exceptions:" -msgstr "" - -#: ../../library/calendar.rst:547 -msgid "" -"A subclass of :exc:`ValueError`, raised when the given month number is " -"outside of the range 1-12 (inclusive)." -msgstr "" - -#: ../../library/calendar.rst:552 -msgid "The invalid month number." -msgstr "" - -#: ../../library/calendar.rst:557 -msgid "" -"A subclass of :exc:`ValueError`, raised when the given weekday number is " -"outside of the range 0-6 (inclusive)." -msgstr "" - -#: ../../library/calendar.rst:562 -msgid "The invalid weekday number." -msgstr "" - -#: ../../library/calendar.rst:567 +#: ../../library/calendar.rst:417 msgid "Module :mod:`datetime`" msgstr ":mod:`datetime` モジュール" -#: ../../library/calendar.rst:568 +#: ../../library/calendar.rst:416 msgid "" "Object-oriented interface to dates and times with similar functionality to " "the :mod:`time` module." @@ -669,153 +542,10 @@ msgstr "" ":mod:`time` モジュールと似た機能を持った日付と時間用のオブジェクト指向イン" "ターフェース。" -#: ../../library/calendar.rst:571 +#: ../../library/calendar.rst:419 msgid "Module :mod:`time`" msgstr ":mod:`time` モジュール" -#: ../../library/calendar.rst:572 +#: ../../library/calendar.rst:420 msgid "Low-level time related functions." msgstr "時間に関連した低水準の関数群。" - -#: ../../library/calendar.rst:578 -msgid "Command-line usage" -msgstr "コマンドラインでの使用" - -#: ../../library/calendar.rst:582 -msgid "" -"The :mod:`calendar` module can be executed as a script from the command line " -"to interactively print a calendar." -msgstr "" - -#: ../../library/calendar.rst:585 -msgid "" -"python -m calendar [-h] [-L LOCALE] [-e ENCODING] [-t {text,html}]\n" -" [-w WIDTH] [-l LINES] [-s SPACING] [-m MONTHS] [-c CSS]\n" -" [-f FIRST_WEEKDAY] [year] [month]" -msgstr "" - -#: ../../library/calendar.rst:592 -msgid "For example, to print a calendar for the year 2000:" -msgstr "" - -#: ../../library/calendar.rst:594 -msgid "" -"$ python -m calendar 2000\n" -" 2000\n" -"\n" -" January February March\n" -"Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su\n" -" 1 2 1 2 3 4 5 6 1 2 3 4 5\n" -" 3 4 5 6 7 8 9 7 8 9 10 11 12 13 6 7 8 9 10 11 12\n" -"10 11 12 13 14 15 16 14 15 16 17 18 19 20 13 14 15 16 17 18 19\n" -"17 18 19 20 21 22 23 21 22 23 24 25 26 27 20 21 22 23 24 25 26\n" -"24 25 26 27 28 29 30 28 29 27 28 29 30 31\n" -"31\n" -"\n" -" April May June\n" -"Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su\n" -" 1 2 1 2 3 4 5 6 7 1 2 3 4\n" -" 3 4 5 6 7 8 9 8 9 10 11 12 13 14 5 6 7 8 9 10 11\n" -"10 11 12 13 14 15 16 15 16 17 18 19 20 21 12 13 14 15 16 17 18\n" -"17 18 19 20 21 22 23 22 23 24 25 26 27 28 19 20 21 22 23 24 25\n" -"24 25 26 27 28 29 30 29 30 31 26 27 28 29 30\n" -"\n" -" July August September\n" -"Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su\n" -" 1 2 1 2 3 4 5 6 1 2 3\n" -" 3 4 5 6 7 8 9 7 8 9 10 11 12 13 4 5 6 7 8 9 10\n" -"10 11 12 13 14 15 16 14 15 16 17 18 19 20 11 12 13 14 15 16 17\n" -"17 18 19 20 21 22 23 21 22 23 24 25 26 27 18 19 20 21 22 23 24\n" -"24 25 26 27 28 29 30 28 29 30 31 25 26 27 28 29 30\n" -"31\n" -"\n" -" October November December\n" -"Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su\n" -" 1 1 2 3 4 5 1 2 3\n" -" 2 3 4 5 6 7 8 6 7 8 9 10 11 12 4 5 6 7 8 9 10\n" -" 9 10 11 12 13 14 15 13 14 15 16 17 18 19 11 12 13 14 15 16 17\n" -"16 17 18 19 20 21 22 20 21 22 23 24 25 26 18 19 20 21 22 23 24\n" -"23 24 25 26 27 28 29 27 28 29 30 25 26 27 28 29 30 31\n" -"30 31" -msgstr "" - -#: ../../library/calendar.rst:635 -msgid "The following options are accepted:" -msgstr "以下のオプションが使用できます:" - -#: ../../library/calendar.rst:642 -msgid "Show the help message and exit." -msgstr "ヘルプメッセージを表示して終了します。" - -#: ../../library/calendar.rst:647 -msgid "The locale to use for month and weekday names. Defaults to English." -msgstr "" - -#: ../../library/calendar.rst:653 -msgid "" -"The encoding to use for output. :option:`--encoding` is required if :option:" -"`--locale` is set." -msgstr "" - -#: ../../library/calendar.rst:659 -msgid "Print the calendar to the terminal as text, or as an HTML document." -msgstr "" - -#: ../../library/calendar.rst:665 -msgid "" -"The weekday to start each week. Must be a number between 0 (Monday) and 6 " -"(Sunday). Defaults to 0." -msgstr "" - -#: ../../library/calendar.rst:673 -msgid "The year to print the calendar for. Defaults to the current year." -msgstr "" - -#: ../../library/calendar.rst:679 -msgid "" -"The month of the specified :option:`year` to print the calendar for. Must be " -"a number between 1 and 12, and may only be used in text mode. Defaults to " -"printing a calendar for the full year." -msgstr "" - -#: ../../library/calendar.rst:685 -msgid "*Text-mode options:*" -msgstr "" - -#: ../../library/calendar.rst:689 -msgid "" -"The width of the date column in terminal columns. The date is printed " -"centred in the column. Any value lower than 2 is ignored. Defaults to 2." -msgstr "" - -#: ../../library/calendar.rst:697 -msgid "" -"The number of lines for each week in terminal rows. The date is printed top-" -"aligned. Any value lower than 1 is ignored. Defaults to 1." -msgstr "" - -#: ../../library/calendar.rst:705 -msgid "" -"The space between months in columns. Any value lower than 2 is ignored. " -"Defaults to 6." -msgstr "" - -#: ../../library/calendar.rst:712 -msgid "The number of months printed per row. Defaults to 3." -msgstr "" - -#: ../../library/calendar.rst:715 -msgid "" -"By default, today's date is highlighted in color and can be :ref:`controlled " -"using environment variables `." -msgstr "" - -#: ../../library/calendar.rst:719 -msgid "*HTML-mode options:*" -msgstr "" - -#: ../../library/calendar.rst:723 -msgid "" -"The path of a CSS stylesheet to use for the calendar. This must either be " -"relative to the generated HTML, or an absolute HTTP or ``file:///`` URL." -msgstr "" diff --git a/library/cgi.po b/library/cgi.po index 119af47f6..6981d7d47 100644 --- a/library/cgi.po +++ b/library/cgi.po @@ -1,43 +1,912 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # +# Translators: +# Nozomu Kaneko , 2017 +# 秘湯 , 2017 +# Arihiro TAKASE, 2017 +# Shun Sakurai, 2017 +# mollinaca, 2020 +# Takanori Suzuki , 2021 +# #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-13 14:21+0000\n" -"PO-Revision-Date: 2024-11-19 01:02+0000\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-05-15 06:22+0000\n" +"PO-Revision-Date: 2017-02-16 19:36+0000\n" +"Last-Translator: Takanori Suzuki , 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/cgi.rst:2 -msgid ":mod:`!cgi` --- Common Gateway Interface support" +msgid ":mod:`cgi` --- Common Gateway Interface support" +msgstr ":mod:`cgi` --- CGI (ゲートウェイインターフェース規格) のサポート" + +#: ../../library/cgi.rst:7 +msgid "**Source code:** :source:`Lib/cgi.py`" +msgstr "**ソースコード:** :source:`Lib/cgi.py`" + +#: ../../library/cgi.rst:19 +msgid "Support module for Common Gateway Interface (CGI) scripts." +msgstr "" +"ゲートウェイインターフェース規格 (CGI) に準拠したスクリプトをサポートするため" +"のモジュールです。" + +#: ../../library/cgi.rst:21 +msgid "" +"This module defines a number of utilities for use by CGI scripts written in " +"Python." +msgstr "" +"このモジュールでは、Python で CGI スクリプトを書く際に使える様々なユーティリ" +"ティを定義しています。" + +#: ../../library/cgi.rst:26 +msgid "Introduction" +msgstr "はじめに" + +#: ../../library/cgi.rst:30 +msgid "" +"A CGI script is invoked by an HTTP server, usually to process user input " +"submitted through an HTML ``
`` or ```` element." +msgstr "" +"CGI スクリプトは、HTTP サーバによって起動され、通常は HTML の ```` また" +"は ```` エレメントを通じてユーザが入力した内容を処理します。" + +#: ../../library/cgi.rst:33 +msgid "" +"Most often, CGI scripts live in the server's special :file:`cgi-bin` " +"directory. The HTTP server places all sorts of information about the request " +"(such as the client's hostname, the requested URL, the query string, and " +"lots of other goodies) in the script's shell environment, executes the " +"script, and sends the script's output back to the client." +msgstr "" +"ほとんどの場合、CGI スクリプトはサーバ上の特殊なディレクトリ :file:`cgi-bin` " +"の下に置きます。HTTP サーバは、まずスクリプトを駆動するためのシェルの環境変数" +"に、リクエストの全ての情報 (クライアントのホスト名、リクエストされている " +"URL、クエリ文字列、その他諸々) を設定し、スクリプトを実行した後、スクリプトの" +"出力をクライアントに送信します。" + +#: ../../library/cgi.rst:39 +msgid "" +"The script's input is connected to the client too, and sometimes the form " +"data is read this way; at other times the form data is passed via the " +"\"query string\" part of the URL. This module is intended to take care of " +"the different cases and provide a simpler interface to the Python script. " +"It also provides a number of utilities that help in debugging scripts, and " +"the latest addition is support for file uploads from a form (if your browser " +"supports it)." +msgstr "" +"スクリプトの入力端もクライアントに接続されていて、この経路を通じてフォーム" +"データを読み込むこともあります。それ以外の場合には、フォームデータは URL の一" +"部分である「クエリ文字列」を介して渡されます。このモジュールでは、上記のケー" +"スの違いに注意しつつ、Python スクリプトに対しては単純なインターフェースを提供" +"しています。このモジュールではまた、スクリプトをデバッグするためのユーティリ" +"ティも多数提供しています。また、最近はフォームを経由したファイルのアップロー" +"ドをサポートしています (ブラウザ側がサポートしていればです)。" + +#: ../../library/cgi.rst:46 +msgid "" +"The output of a CGI script should consist of two sections, separated by a " +"blank line. The first section contains a number of headers, telling the " +"client what kind of data is following. Python code to generate a minimal " +"header section looks like this::" +msgstr "" +"CGI スクリプトの出力は 2 つのセクションからなり、空行で分割されています。最初" +"のセクションは複数のヘッダからなり、後続するデータがどのようなものかをクライ" +"アントに通知します。最小のヘッダセクションを生成するための Python のコードは" +"以下のようなものです::" + +#: ../../library/cgi.rst:54 +msgid "" +"The second section is usually HTML, which allows the client software to " +"display nicely formatted text with header, in-line images, etc. Here's " +"Python code that prints a simple piece of HTML::" +msgstr "" +"二つ目のセクションは通常、ヘッダやインラインイメージ等の付属したテキストをう" +"まくフォーマットして表示できるようにした HTML です。以下に単純な HTML を出力" +"する Python コードを示します::" + +#: ../../library/cgi.rst:66 +msgid "Using the cgi module" +msgstr "cgi モジュールを使う" + +#: ../../library/cgi.rst:68 +msgid "Begin by writing ``import cgi``." +msgstr "``import cgi`` と記述して開始します。" + +#: ../../library/cgi.rst:70 +msgid "When you write a new script, consider adding these lines::" +msgstr "" +"新たにスクリプトを書く際には、以下の行を付加するかどうか検討してください::" + +#: ../../library/cgi.rst:75 +msgid "" +"This activates a special exception handler that will display detailed " +"reports in the Web browser if any errors occur. If you'd rather not show " +"the guts of your program to users of your script, you can have the reports " +"saved to files instead, with code like this::" +msgstr "" +"これによって、特別な例外処理が有効にされ、エラーが発生した際にブラウザ上に詳" +"細なレポートを出力するようになります。ユーザにスクリプトの内部を見せたくない" +"のなら、以下のようにしてレポートをファイルに保存できます::" + +#: ../../library/cgi.rst:83 +msgid "" +"It's very helpful to use this feature during script development. The reports " +"produced by :mod:`cgitb` provide information that can save you a lot of time " +"in tracking down bugs. You can always remove the ``cgitb`` line later when " +"you have tested your script and are confident that it works correctly." +msgstr "" +"スクリプトを開発する際には、この機能はとても役に立ちます。 :mod:`cgitb` が生" +"成する報告はバグを追跡するためにかかる時間を大幅に減らせるような情報を提供し" +"てくれます。スクリプトをテストし終わり、正確に動作することを確認したら、いつ" +"でも ``cgitb`` の行を削除できます。" + +#: ../../library/cgi.rst:88 +msgid "" +"To get at submitted form data, use the :class:`FieldStorage` class. If the " +"form contains non-ASCII characters, use the *encoding* keyword parameter set " +"to the value of the encoding defined for the document. It is usually " +"contained in the META tag in the HEAD section of the HTML document or by " +"the :mailheader:`Content-Type` header). This reads the form contents from " +"the standard input or the environment (depending on the value of various " +"environment variables set according to the CGI standard). Since it may " +"consume standard input, it should be instantiated only once." +msgstr "" +"入力されたフォームデータを取得するには、 :class:`FieldStorage` クラスを使いま" +"す。フォームが非 ASCII 文字を含んでいる場合は、 *encoding* キーワードパラメー" +"タを使用してドキュメントに対して定義されたエンコーディングの値を設定してくだ" +"さい。それは、通常 HTML ドキュメントの HEAD セクション中の META タグ、あるい" +"は :mailheader:`Content-Type` ヘッダーに含まれています。これは、標準入力また" +"は環境変数からフォームの内容を読み出します (どちらから読み出すかは、複数の環" +"境変数の値が CGI 標準に従ってどのように設定されているかで決まります)。インス" +"タンスが標準入力を使うかもしれないので、インスタンス生成を行うのは一度だけに" +"しなければなりません。" + +#: ../../library/cgi.rst:97 +msgid "" +"The :class:`FieldStorage` instance can be indexed like a Python dictionary. " +"It allows membership testing with the :keyword:`in` operator, and also " +"supports the standard dictionary method :meth:`~dict.keys` and the built-in " +"function :func:`len`. Form fields containing empty strings are ignored and " +"do not appear in the dictionary; to keep such values, provide a true value " +"for the optional *keep_blank_values* keyword parameter when creating the :" +"class:`FieldStorage` instance." +msgstr "" +":class:`FieldStorage` のインスタンスは Python の辞書型のように添え字アクセス" +"が可能です。 :keyword:`in` を使用することによって要素が含まれているかの判定も" +"出来ますし、標準の辞書メソッド :meth:`~dict.keys` 及び組み込み関数 :func:" +"`len` もサポートしています。空の文字列を含むフォーム要素は無視され、辞書には" +"現れません。そのような値を保持するには、:class:`FieldStorage` のインスタンス" +"作成の際にオプションのキーワードパラメータ *keep_blank_values* に true を指定" +"してください。" + +#: ../../library/cgi.rst:105 +msgid "" +"For instance, the following code (which assumes that the :mailheader:" +"`Content-Type` header and blank line have already been printed) checks that " +"the fields ``name`` and ``addr`` are both set to a non-empty string::" +msgstr "" +"例えば、以下のコード (:mailheader:`Content-Type` ヘッダと空行はすでに出力され" +"た後とします) は ``name`` および ``addr`` フィールドが両方とも空の文字列に設" +"定されていないか調べます::" + +#: ../../library/cgi.rst:119 +msgid "" +"Here the fields, accessed through ``form[key]``, are themselves instances " +"of :class:`FieldStorage` (or :class:`MiniFieldStorage`, depending on the " +"form encoding). The :attr:`~FieldStorage.value` attribute of the instance " +"yields the string value of the field. The :meth:`~FieldStorage.getvalue` " +"method returns this string value directly; it also accepts an optional " +"second argument as a default to return if the requested key is not present." +msgstr "" +"ここで、 ``form[key]`` で参照される各フィールドはそれ自体が :class:" +"`FieldStorage` (または :class:`MiniFieldStorage` 。フォームのエンコードによっ" +"て変わります) のインスタンスです。インスタンスの属性 :attr:`~FieldStorage." +"value` の内容は対応するフィールドの値で、文字列になります。 :meth:" +"`~FieldStorage.getvalue` メソッドはこの文字列値を直接返します。 :meth:" +"`getvalue` の 2 つめの引数にオプションの値を与えると、リクエストされたキーが" +"存在しない場合に返すデフォルトの値になります。" + +#: ../../library/cgi.rst:126 +msgid "" +"If the submitted form data contains more than one field with the same name, " +"the object retrieved by ``form[key]`` is not a :class:`FieldStorage` or :" +"class:`MiniFieldStorage` instance but a list of such instances. Similarly, " +"in this situation, ``form.getvalue(key)`` would return a list of strings. If " +"you expect this possibility (when your HTML form contains multiple fields " +"with the same name), use the :meth:`~FieldStorage.getlist` method, which " +"always returns a list of values (so that you do not need to special-case the " +"single item case). For example, this code concatenates any number of " +"username fields, separated by commas::" +msgstr "" +"入力されたフォームデータに同じ名前のフィールドが二つ以上あれば、 " +"``form[key]`` で得られるオブジェクトは :class:`FieldStorage` や :class:" +"`MiniFieldStorage` のインスタンスではなく、そうしたインスタンスのリストになり" +"ます。この場合、 ``form.getvalue(key)`` も同様に、文字列からなるリストを返し" +"ます。もしこうした状況が起きうると思うなら (HTML のフォームに同じ名前をもった" +"フィールドが複数含まれているのなら) 、 :meth:`~FieldStorage.getlist` メソッド" +"を使ってください。これは常に値のリストを返します (単一要素のケースを特別扱い" +"する必要はありません)。例えば、以下のコードは任意の数のユーザ名フィールドを結" +"合し、コンマで分割された文字列にします::" + +#: ../../library/cgi.rst:139 +msgid "" +"If a field represents an uploaded file, accessing the value via the :attr:" +"`~FieldStorage.value` attribute or the :meth:`~FieldStorage.getvalue` method " +"reads the entire file in memory as bytes. This may not be what you want. " +"You can test for an uploaded file by testing either the :attr:`~FieldStorage." +"filename` attribute or the :attr:`~FieldStorage.file` attribute. You can " +"then read the data from the :attr:`!file` attribute before it is " +"automatically closed as part of the garbage collection of the :class:" +"`FieldStorage` instance (the :func:`~io.RawIOBase.read` and :func:`~io." +"IOBase.readline` methods will return bytes)::" +msgstr "" +"フィールドがアップロードされたファイルを表している場合、 :attr:" +"`~FieldStorage.value` 属性や :meth:`~FieldStorage.getvalue` メソッドを使って" +"フィールドの値にアクセスすると、ファイルの内容をすべてメモリ上にバイト列とし" +"て読み込みます。これは場合によっては望ましい動作ではないかもしれません。アッ" +"プロードされたファイルがあるかどうかは :attr:`~FieldStorage.filename` 属性お" +"よび :attr:`~FieldStorage.file` 属性のいずれかで調べられます。そして、 :" +"class:`FieldStorage` インスタンスのガベージコレクションの一部として自動的に閉" +"じられるまでの間に、 :attr:`!file` 属性から以下のようにデータを読み込むことが" +"できます (:func:`~io.RawIOBase.read` および :func:`~io.IOBase.readline` メ" +"ソッドはバイト列を返します):" + +#: ../../library/cgi.rst:159 +msgid "" +":class:`FieldStorage` objects also support being used in a :keyword:`with` " +"statement, which will automatically close them when done." +msgstr "" +":class:`FieldStorage` オブジェクトは :keyword:`with` 文での使用にも対応してい" +"ます。 with 文を使用した場合、オブジェクトは終了時に自動的に閉じられます。" + +#: ../../library/cgi.rst:162 +msgid "" +"If an error is encountered when obtaining the contents of an uploaded file " +"(for example, when the user interrupts the form submission by clicking on a " +"Back or Cancel button) the :attr:`~FieldStorage.done` attribute of the " +"object for the field will be set to the value -1." +msgstr "" +"アップロードされたファイルの内容を取得している間にエラーが発生した場合 (例え" +"ば、ユーザーが戻るボタンやキャンセルボタンで submit を中断した場合)、その" +"フィールドのオブジェクトの :attr:`~FieldStorage.done` 属性には -1 が設定され" +"ます。" + +#: ../../library/cgi.rst:167 +msgid "" +"The file upload draft standard entertains the possibility of uploading " +"multiple files from one field (using a recursive :mimetype:`multipart/\\*` " +"encoding). When this occurs, the item will be a dictionary-like :class:" +"`FieldStorage` item. This can be determined by testing its :attr:`!type` " +"attribute, which should be :mimetype:`multipart/form-data` (or perhaps " +"another MIME type matching :mimetype:`multipart/\\*`). In this case, it can " +"be iterated over recursively just like the top-level form object." +msgstr "" +"現在ドラフトとなっているファイルアップロードの標準仕様では、一つのフィールド" +"から (再帰的な :mimetype:`multipart/\\*` エンコーディングを使って) 複数のファ" +"イルがアップロードされる可能性を受け入れています。この場合、アイテムは辞書形" +"式の :class:`FieldStorage` アイテムとなります。複数ファイルかどうかは :attr:" +"`!type` 属性が :mimetype:`multipart/form-data` (または :mimetype:`multipart/" +"\\*` にマッチする他の MIME 型) になっているかどうかを調べれば判別できます。こ" +"の場合、トップレベルのフォームオブジェクトと同様にして再帰的に個別処理できま" +"す。" + +#: ../../library/cgi.rst:175 +msgid "" +"When a form is submitted in the \"old\" format (as the query string or as a " +"single data part of type :mimetype:`application/x-www-form-urlencoded`), the " +"items will actually be instances of the class :class:`MiniFieldStorage`. In " +"this case, the :attr:`!list`, :attr:`!file`, and :attr:`filename` attributes " +"are always ``None``." +msgstr "" +"フォームが「古い」形式で入力された場合 (クエリ文字列または単一の :mimetype:" +"`application/x-www-form-urlencoded` データで入力された場合)、データ要素の実体" +"は :class:`MiniFieldStorage` クラスのインスタンスになります。この場合、 :" +"attr:`!list` 、 :attr:`!file` 、および :attr:`filename` 属性は常に ``None`` " +"になります。" + +#: ../../library/cgi.rst:180 +msgid "" +"A form submitted via POST that also has a query string will contain both :" +"class:`FieldStorage` and :class:`MiniFieldStorage` items." +msgstr "" +"フォームがPOSTによって送信され、クエリー文字列も持っていた場合、 :class:" +"`FieldStorage` と :class:`MiniFieldStorage` の両方が含まれます。" + +#: ../../library/cgi.rst:183 +msgid "" +"The :attr:`~FieldStorage.file` attribute is automatically closed upon the " +"garbage collection of the creating :class:`FieldStorage` instance." +msgstr "" +":attr:`~FieldStorage.file` 属性は、それを作成した :class:`FieldStorage` イン" +"スタンスのガベージコレクションによって自動的に閉じられます。" + +#: ../../library/cgi.rst:187 +msgid "" +"Added support for the context management protocol to the :class:" +"`FieldStorage` class." +msgstr "" +":class:`FieldStorage` クラスにコンテキスト管理プロトコルのサポートが追加され" +"ました。" + +#: ../../library/cgi.rst:193 +msgid "Higher Level Interface" +msgstr "高水準インターフェース" + +#: ../../library/cgi.rst:195 +msgid "" +"The previous section explains how to read CGI form data using the :class:" +"`FieldStorage` class. This section describes a higher level interface which " +"was added to this class to allow one to do it in a more readable and " +"intuitive way. The interface doesn't make the techniques described in " +"previous sections obsolete --- they are still useful to process file uploads " +"efficiently, for example." +msgstr "" +"前節では CGI フォームデータを :class:`FieldStorage` クラスを使って読み出す方" +"法について解説しました。この節では、フォームデータを分かりやすく直感的な方法" +"で読み出せるようにするために追加された、より高水準のインターフェースについて" +"記述します。このインターフェースは前節で説明した技術を撤廃するものではありま" +"せん --- 例えば、前節の技術は依然としてファイルのアップロードを効率的に行う上" +"で便利です。" + +#: ../../library/cgi.rst:204 +msgid "" +"The interface consists of two simple methods. Using the methods you can " +"process form data in a generic way, without the need to worry whether only " +"one or more values were posted under one name." +msgstr "" +"このインターフェースは 2 つの単純なメソッドからなります。このメソッドを使え" +"ば、一般的な方法でフォームデータを処理でき、ある名前のフィールドに入力された" +"値が一つなのかそれ以上なのかを心配する必要がなくなります。" + +#: ../../library/cgi.rst:208 +msgid "" +"In the previous section, you learned to write following code anytime you " +"expected a user to post more than one value under one name::" +msgstr "" +"前節では、一つのフィールド名に対して二つ以上の値が入力されるかもしれない場合" +"には、常に以下のようなコードを書くよう学びました::" + +#: ../../library/cgi.rst:217 +msgid "" +"This situation is common for example when a form contains a group of " +"multiple checkboxes with the same name::" +msgstr "" +"こういった状況は、例えば以下のように、同じ名前を持った複数のチェックボックス" +"からなるグループがフォームに入っているような場合によく起きます::" + +#: ../../library/cgi.rst:223 +msgid "" +"In most situations, however, there's only one form control with a particular " +"name in a form and then you expect and need only one value associated with " +"this name. So you write a script containing for example this code::" +msgstr "" +"しかしながら、ほとんどの場合、あるフォーム中で特定の名前を持ったコントロール" +"はただ一つしかないので、その名前に関連付けられた値はただ一つしかないはずだと" +"考えるでしょう。そこで、スクリプトには例えば以下のようなコードを書くでしょ" +"う::" + +#: ../../library/cgi.rst:229 +msgid "" +"The problem with the code is that you should never expect that a client will " +"provide valid input to your scripts. For example, if a curious user appends " +"another ``user=foo`` pair to the query string, then the script would crash, " +"because in this situation the ``getvalue(\"user\")`` method call returns a " +"list instead of a string. Calling the :meth:`~str.upper` method on a list " +"is not valid (since lists do not have a method of this name) and results in " +"an :exc:`AttributeError` exception." +msgstr "" +"このコードの問題点は、クライアントがスクリプトにとって常に有効な入力を提供す" +"るとは期待できないところにあります。例えば、もし好奇心旺盛なユーザがもう一つ" +"の ``user=foo`` ペアをクエリ文字列に追加したら、 ``getvalue(\"user\")`` メ" +"ソッドは文字列ではなくリストを返すため、このスクリプトはクラッシュするでしょ" +"う。リストに対して :meth:`~str.upper` メソッドを呼び出すと、引数が有効でない " +"(リスト型はその名前のメソッドを持っていない) ため、例外 :exc:" +"`AttributeError` を送出します。" + +#: ../../library/cgi.rst:237 +msgid "" +"Therefore, the appropriate way to read form data values was to always use " +"the code which checks whether the obtained value is a single value or a list " +"of values. That's annoying and leads to less readable scripts." +msgstr "" +"従って、フォームデータの値を読み出しには、得られた値が単一の値なのか値のリス" +"トなのかを常に調べるコードを使うのが適切でした。これでは煩わしく、より読みに" +"くいスクリプトになってしまいます。" + +#: ../../library/cgi.rst:241 +msgid "" +"A more convenient approach is to use the methods :meth:`~FieldStorage." +"getfirst` and :meth:`~FieldStorage.getlist` provided by this higher level " +"interface." +msgstr "" +"ここで述べる高水準のインターフェースで提供している :meth:`~FieldStorage." +"getfirst` や :meth:`~FieldStorage.getlist` メソッドを使うと、もっと便利にアプ" +"ローチできます。" + +#: ../../library/cgi.rst:247 +msgid "" +"This method always returns only one value associated with form field *name*. " +"The method returns only the first value in case that more values were posted " +"under such name. Please note that the order in which the values are " +"received may vary from browser to browser and should not be counted on. " +"[#]_ If no such form field or value exists then the method returns the " +"value specified by the optional parameter *default*. This parameter " +"defaults to ``None`` if not specified." +msgstr "" +"フォームフィールド *name* に関連付けられた値をつねに一つだけ返す軽量メソッド" +"です。同じ名前で 1 つ以上の値がポストされている場合、このメソッドは最初の値だ" +"けを返します。フォームから値を受信する際の値の並び順はブラウザ間で異なる可能" +"性があり、特定の順番であるとは期待できないので注意してください。[#]_ 指定した" +"フォームフィールドや値がない場合、このメソッドはオプションの引数 *default* を" +"返します。このパラメタを指定しない場合、標準の値は ``None`` に設定されます。" + +#: ../../library/cgi.rst:258 +msgid "" +"This method always returns a list of values associated with form field " +"*name*. The method returns an empty list if no such form field or value " +"exists for *name*. It returns a list consisting of one item if only one " +"such value exists." +msgstr "" +"このメソッドはフォームフィールド *name* に関連付けられた値を常にリストにして" +"返します。*name* に指定したフォームフィールドや値が存在しない場合、このメソッ" +"ドは空のリストを返します。値が一つだけ存在する場合、要素を一つだけ含むリスト" +"を返します。" + +#: ../../library/cgi.rst:262 +msgid "Using these methods you can write nice compact code::" +msgstr "" +"これらのメソッドを使うことで、以下のようにナイスでコンパクトにコードを書けま" +"す::" + +#: ../../library/cgi.rst:274 +msgid "Functions" +msgstr "関数" + +#: ../../library/cgi.rst:276 +msgid "" +"These are useful if you want more control, or if you want to employ some of " +"the algorithms implemented in this module in other circumstances." +msgstr "" +"より細かく CGI をコントロールしたり、このモジュールで実装されているアルゴリズ" +"ムを他の状況で利用したい場合には、以下の関数が便利です。" + +#: ../../library/cgi.rst:282 +msgid "" +"Parse a query in the environment or from a file (the file defaults to ``sys." +"stdin``). The *keep_blank_values*, *strict_parsing* and *separator* " +"parameters are passed to :func:`urllib.parse.parse_qs` unchanged." +msgstr "" +"環境変数、またはファイルからからクエリを解釈します (ファイルは標準で ``sys." +"stdin`` になります) *keep_blank_values*, *strict_parsing*, *separator* 引数は" +"そのまま :func:`urllib.parse.parse_qs` に渡されます。" + +#: ../../library/cgi.rst:289 +msgid "" +"Parse input of type :mimetype:`multipart/form-data` (for file uploads). " +"Arguments are *fp* for the input file, *pdict* for a dictionary containing " +"other parameters in the :mailheader:`Content-Type` header, and *encoding*, " +"the request encoding." +msgstr "" + +#: ../../library/cgi.rst:294 +msgid "" +"Returns a dictionary just like :func:`urllib.parse.parse_qs`: keys are the " +"field names, each value is a list of values for that field. For non-file " +"fields, the value is a list of strings." +msgstr "" + +#: ../../library/cgi.rst:298 +msgid "" +"This is easy to use but not much good if you are expecting megabytes to be " +"uploaded --- in that case, use the :class:`FieldStorage` class instead which " +"is much more flexible." +msgstr "" +"この関数は簡単に使えますが、数メガバイトのデータがアップロードされると考えら" +"れる場合にはあまり適していません --- その場合、より柔軟性のある :class:" +"`FieldStorage` を代りに使ってください。" + +#: ../../library/cgi.rst:302 +msgid "" +"Added the *encoding* and *errors* parameters. For non-file fields, the " +"value is now a list of strings, not bytes." +msgstr "" + +#: ../../library/cgi.rst:306 +msgid "Added the *separator* parameter." +msgstr " *separator* 引数が追加されました。" + +#: ../../library/cgi.rst:312 +msgid "" +"Parse a MIME header (such as :mailheader:`Content-Type`) into a main value " +"and a dictionary of parameters." +msgstr "" +"(:mailheader:`Content-Type` のような) MIME ヘッダを解釈し、ヘッダの主要値と各" +"パラメタからなる辞書にします。" + +#: ../../library/cgi.rst:318 +msgid "" +"Robust test CGI script, usable as main program. Writes minimal HTTP headers " +"and formats all information provided to the script in HTML format." +msgstr "" +"メインプログラムから利用できる堅牢性テストを行う CGI スクリプトです。最小の " +"HTTP ヘッダと、スクリプトで供給された全ての情報をHTML形式で書式化して出力しま" +"す。" + +#: ../../library/cgi.rst:324 +msgid "Format the shell environment in HTML." +msgstr "シェル変数を HTML に書式化して出力します。" + +#: ../../library/cgi.rst:329 +msgid "Format a form in HTML." +msgstr "フォームを HTML に初期化して出力します。" + +#: ../../library/cgi.rst:334 +msgid "Format the current directory in HTML." +msgstr "現在のディレクトリを HTML に書式化して出力します。" + +#: ../../library/cgi.rst:339 +msgid "Print a list of useful (used by CGI) environment variables in HTML." +msgstr "意味のある (CGI の使う) 環境変数を HTML で出力します。" + +#: ../../library/cgi.rst:345 +msgid "Caring about security" +msgstr "セキュリティへの配慮" + +#: ../../library/cgi.rst:349 +msgid "" +"There's one important rule: if you invoke an external program (via :func:`os." +"system`, :func:`os.popen` or other functions with similar functionality), " +"make very sure you don't pass arbitrary strings received from the client to " +"the shell. This is a well-known security hole whereby clever hackers " +"anywhere on the Web can exploit a gullible CGI script to invoke arbitrary " +"shell commands. Even parts of the URL or field names cannot be trusted, " +"since the request doesn't have to come from your form!" +msgstr "" +"重要なルールが一つあります: (:func:`os.system`, :func:`os.popen` またはその他" +"の同様の機能によって) 外部プログラムを呼び出すなら、クライアントから受信した" +"任意の文字列をシェルに渡していないことをよく確かめてください。これはよく知ら" +"れているセキュリティホールであり、これによって Web のどこかにいる悪賢いハッ" +"カーが、だまされやすい CGI スクリプトに任意のシェルコマンドを実行させてしまえ" +"ます。URL の一部やフィールド名でさえも信用してはいけません。CGI へのリクエス" +"トはあなたの作ったフォームから送信されるとは限らないからです!" + +#: ../../library/cgi.rst:357 +msgid "" +"To be on the safe side, if you must pass a string gotten from a form to a " +"shell command, you should make sure the string contains only alphanumeric " +"characters, dashes, underscores, and periods." +msgstr "" +"安全な方法をとるために、フォームから入力された文字をシェルに渡す場合、文字列" +"に入っているのが英数文字、ダッシュ、アンダースコア、およびピリオドだけかどう" +"かを確認してください。" + +#: ../../library/cgi.rst:363 +msgid "Installing your CGI script on a Unix system" +msgstr "CGI スクリプトを Unix システムにインストールする" + +#: ../../library/cgi.rst:365 +msgid "" +"Read the documentation for your HTTP server and check with your local system " +"administrator to find the directory where CGI scripts should be installed; " +"usually this is in a directory :file:`cgi-bin` in the server tree." +msgstr "" +"あなたの使っている HTTP サーバのドキュメントを読んでください。そしてローカル" +"システムの管理者と一緒にどのディレクトリに CGI スクリプトをインストールすべき" +"かを調べてください; 通常これはサーバのファイルシステムツリー内の :file:`cgi-" +"bin` ディレクトリです。" + +#: ../../library/cgi.rst:369 +msgid "" +"Make sure that your script is readable and executable by \"others\"; the " +"Unix file mode should be ``0o755`` octal (use ``chmod 0755 filename``). " +"Make sure that the first line of the script contains ``#!`` starting in " +"column 1 followed by the pathname of the Python interpreter, for instance::" +msgstr "" +"あなたのスクリプトが \"others\" によって読み取り可能および実行可能であること" +"を確認してください; Unix ファイルモードは 8 進表記で ``0o755`` です (``chmod " +"0755 filename`` を使ってください)。スクリプトの最初の行の 1 カラム目が、``#!" +"`` で開始し、その後に Python インタプリタへのパス名が続いていることを確認して" +"ください。例えば::" + +#: ../../library/cgi.rst:376 +msgid "" +"Make sure the Python interpreter exists and is executable by \"others\"." +msgstr "" +"Python インタプリタが存在し、\"others\" によって実行可能であることを確かめて" +"ください。" + +#: ../../library/cgi.rst:378 +msgid "" +"Make sure that any files your script needs to read or write are readable or " +"writable, respectively, by \"others\" --- their mode should be ``0o644`` for " +"readable and ``0o666`` for writable. This is because, for security reasons, " +"the HTTP server executes your script as user \"nobody\", without any special " +"privileges. It can only read (write, execute) files that everybody can read " +"(write, execute). The current directory at execution time is also different " +"(it is usually the server's cgi-bin directory) and the set of environment " +"variables is also different from what you get when you log in. In " +"particular, don't count on the shell's search path for executables (:envvar:" +"`PATH`) or the Python module search path (:envvar:`PYTHONPATH`) to be set to " +"anything interesting." +msgstr "" +"あなたのスクリプトが読み書きしなければならないファイルが全て \"others\" に" +"よって読み出しや書き込み可能であることを確かめてください --- 読み出し可能の" +"ファイルモードは ``0o644`` で、書き込み可能のファイルモードは ``0o666`` にな" +"るはずです。これは、セキュリティ上の理由から、 HTTP サーバがあなたのスクリプ" +"トを特権を全く持たないユーザ \"nobody\" の権限で実行するからです。この権限下" +"では、誰でもが読める (書ける、実行できる) ファイルしか読み出し (書き込み、実" +"行) できません。スクリプト実行時のディレクトリや環境変数のセットもあなたがロ" +"グインしたときの設定と異なります。特に、実行ファイルに対するシェルの検索パス " +"(:envvar:`PATH`) や Python のモジュール検索パス (:envvar:`PYTHONPATH`)が何ら" +"かの値に設定されていると期待してはいけません。" + +#: ../../library/cgi.rst:389 +msgid "" +"If you need to load modules from a directory which is not on Python's " +"default module search path, you can change the path in your script, before " +"importing other modules. For example::" +msgstr "" +"モジュールを Python の標準設定におけるモジュール検索パス上にないディレクトリ" +"からロードする必要がある場合、他のモジュールを取り込む前にスクリプト内で検索" +"パスを変更できます。例えば::" + +#: ../../library/cgi.rst:397 +msgid "(This way, the directory inserted last will be searched first!)" +msgstr "(この方法では、最後に挿入されたディレクトリが最初に検索されます!)" + +#: ../../library/cgi.rst:399 +msgid "" +"Instructions for non-Unix systems will vary; check your HTTP server's " +"documentation (it will usually have a section on CGI scripts)." +msgstr "" +"非 Unix システムにおける説明は変わるでしょう; あなたの使っている HTTP サーバ" +"のドキュメントを調べてください (普通は CGI スクリプトに関する節があります)。" + +#: ../../library/cgi.rst:404 +msgid "Testing your CGI script" +msgstr "CGI スクリプトをテストする" + +#: ../../library/cgi.rst:406 +msgid "" +"Unfortunately, a CGI script will generally not run when you try it from the " +"command line, and a script that works perfectly from the command line may " +"fail mysteriously when run from the server. There's one reason why you " +"should still test your script from the command line: if it contains a syntax " +"error, the Python interpreter won't execute it at all, and the HTTP server " +"will most likely send a cryptic error to the client." +msgstr "" +"残念ながら、CGI スクリプトは普通、コマンドラインから起動しようとしても動きま" +"せん。また、コマンドラインから起動した場合には完璧に動作するスクリプトが、不" +"思議なことにサーバからの起動では失敗することがあります。しかし、スクリプトを" +"コマンドラインから実行してみなければならない理由が一つあります: もしスクリプ" +"トが文法エラーを含んでいれば、Python インタプリタはそのプログラムを全く実行し" +"ないため、HTTP サーバはほとんどの場合クライアントに謎めいたエラーを送信するか" +"らです。" + +#: ../../library/cgi.rst:413 +msgid "" +"Assuming your script has no syntax errors, yet it does not work, you have no " +"choice but to read the next section." +msgstr "" +"スクリプトが構文エラーを含まないのにうまく動作しないなら、次の節に読み進むし" +"かありません。" + +#: ../../library/cgi.rst:418 +msgid "Debugging CGI scripts" +msgstr "CGI スクリプトをデバッグする" + +#: ../../library/cgi.rst:422 +msgid "" +"First of all, check for trivial installation errors --- reading the section " +"above on installing your CGI script carefully can save you a lot of time. " +"If you wonder whether you have understood the installation procedure " +"correctly, try installing a copy of this module file (:file:`cgi.py`) as a " +"CGI script. When invoked as a script, the file will dump its environment " +"and the contents of the form in HTML format. Give it the right mode etc., " +"and send it a request. If it's installed in the standard :file:`cgi-bin` " +"directory, it should be possible to send it a request by entering a URL into " +"your browser of the form:" +msgstr "" +"何よりもまず、些細なインストール関連のエラーでないか確認してください --- 上" +"の CGI スクリプトのインストールに関する節を注意深く読めば時間を大いに節約でき" +"ます。もしインストールの手続きを正しく理解しているか不安なら、このモジュール" +"のファイル (:file:`cgi.py`) をコピーして、CGI スクリプトとしてインストールし" +"てみてください。このファイルはスクリプトとして呼び出すと、スクリプトの実行環" +"境とフォームの内容を HTML 形式で出力します。ファイルに正しいモードを設定する" +"などして、リクエストを送ってみてください。標準的な :file:`cgi-bin` ディレクト" +"リにインストールされていれば、以下のような URL をブラウザに入力してリクエスト" +"を送信できるはずです:" + +#: ../../library/cgi.rst:435 +msgid "" +"If this gives an error of type 404, the server cannot find the script -- " +"perhaps you need to install it in a different directory. If it gives " +"another error, there's an installation problem that you should fix before " +"trying to go any further. If you get a nicely formatted listing of the " +"environment and form content (in this example, the fields should be listed " +"as \"addr\" with value \"At Home\" and \"name\" with value \"Joe Blow\"), " +"the :file:`cgi.py` script has been installed correctly. If you follow the " +"same procedure for your own script, you should now be able to debug it." +msgstr "" +"もしタイプ 404 のエラーになるなら、サーバはスクリプトを発見できないでいます " +"-- おそらくあなたはスクリプトを別のディレクトリに入れる必要があるのでしょう。" +"他のエラーになるなら、先に進む前に解決しなければならないインストール上の問題" +"があります。もし実行環境の情報とフォーム内容 (この例では、各フィールドは" +"フィールド名 \"addr\" に対して値 \"At Home\"、およびフィールド名 \"name\" に" +"対して \"Joe Blow\") が綺麗にフォーマットされて表示されるなら、 :file:`cgi." +"py` スクリプトは正しくインストールされています。同じ操作をあなたの自作スクリ" +"プトに対して行えば、スクリプトをデバッグできるようになるはずです。" + +#: ../../library/cgi.rst:444 +msgid "" +"The next step could be to call the :mod:`cgi` module's :func:`test` function " +"from your script: replace its main code with the single statement ::" +msgstr "" +"次のステップでは :mod:`cgi` モジュールの :func:`test` 関数を呼び出すことにな" +"ります: メインプログラムコードを以下の 1 文と置き換えてください ::" + +#: ../../library/cgi.rst:449 +msgid "" +"This should produce the same results as those gotten from installing the :" +"file:`cgi.py` file itself." +msgstr "" +"この操作で :file:`cgi.py` ファイル自体をインストールした時と同じ結果を出力す" +"るはずです。" + +#: ../../library/cgi.rst:452 +msgid "" +"When an ordinary Python script raises an unhandled exception (for whatever " +"reason: of a typo in a module name, a file that can't be opened, etc.), the " +"Python interpreter prints a nice traceback and exits. While the Python " +"interpreter will still do this when your CGI script raises an exception, " +"most likely the traceback will end up in one of the HTTP server's log files, " +"or be discarded altogether." +msgstr "" +"通常の Python スクリプトが例外を処理しきれずに送出した場合 (様々な理由: モ" +"ジュール名のタイプミス、ファイルが開けなかった、など)、Python インタプリタは" +"ナイスなトレースバックを出力して終了します。Python インタプリタはあなたの " +"CGI スクリプトが例外を送出した場合にも同様に振舞うので、トレースバックは大抵" +"HTTP サーバのいずれかのログファイルに残るかまったく無視されるかです。" + +#: ../../library/cgi.rst:459 +msgid "" +"Fortunately, once you have managed to get your script to execute *some* " +"code, you can easily send tracebacks to the Web browser using the :mod:" +"`cgitb` module. If you haven't done so already, just add the lines::" msgstr "" +"幸運なことに、あなたが自作のスクリプトで *何らかの* コードを実行できるように" +"なったら、 :mod:`cgitb` モジュールを使って簡単にトレースバックをブラウザに送" +"信できます。まだそうでないなら、以下の2行::" -#: ../../library/cgi.rst:10 +#: ../../library/cgi.rst:466 msgid "" -"This module is no longer part of the Python standard library. It was :ref:" -"`removed in Python 3.13 ` after being deprecated in " -"Python 3.11. The removal was decided in :pep:`594`." +"to the top of your script. Then try running it again; when a problem " +"occurs, you should see a detailed report that will likely make apparent the " +"cause of the crash." msgstr "" +"をスクリプトの先頭に追加してください。そしてスクリプトを再度走らせます; 問題" +"が発生すれば、クラッシュの原因を見出せるような詳細な報告を読めます。" -#: ../../library/cgi.rst:14 +#: ../../library/cgi.rst:470 msgid "" -"A fork of the module on PyPI can be used instead: :pypi:`legacy-cgi`. This " -"is a copy of the cgi module, no longer maintained or supported by the core " -"Python team." +"If you suspect that there may be a problem in importing the :mod:`cgitb` " +"module, you can use an even more robust approach (which only uses built-in " +"modules)::" msgstr "" +":mod:`cgitb` モジュールのインポートに問題がありそうだと思うなら、(組み込みモ" +"ジュールだけを使った) もっと堅牢なアプローチを取れます::" + +#: ../../library/cgi.rst:479 +msgid "" +"This relies on the Python interpreter to print the traceback. The content " +"type of the output is set to plain text, which disables all HTML " +"processing. If your script works, the raw HTML will be displayed by your " +"client. If it raises an exception, most likely after the first two lines " +"have been printed, a traceback will be displayed. Because no HTML " +"interpretation is going on, the traceback will be readable." +msgstr "" +"このコードは Python インタプリタがトレースバックを出力することに依存していま" +"す。出力のコンテント型はプレーンテキストに設定されており、全ての HTML 処理を" +"無効にしています。スクリプトがうまく動作する場合、生の HTML コードがクライア" +"ントに表示されます。スクリプトが例外を送出する場合、最初の 2 行が出力された" +"後、トレースバックが表示されます。HTML の解釈は行われないので、トレースバック" +"を読めるはずです。" + +#: ../../library/cgi.rst:488 +msgid "Common problems and solutions" +msgstr "よくある問題と解決法" + +#: ../../library/cgi.rst:490 +msgid "" +"Most HTTP servers buffer the output from CGI scripts until the script is " +"completed. This means that it is not possible to display a progress report " +"on the client's display while the script is running." +msgstr "" +"ほとんどの HTTP サーバはスクリプトの実行が完了するまで CGI からの出力をバッ" +"ファします。このことは、スクリプトの実行中にクライアントが進捗状況報告を表示" +"できないことを意味します。" + +#: ../../library/cgi.rst:494 +msgid "Check the installation instructions above." +msgstr "上のインストールに関する説明を調べましょう。" + +#: ../../library/cgi.rst:496 +msgid "" +"Check the HTTP server's log files. (``tail -f logfile`` in a separate " +"window may be useful!)" +msgstr "" +"HTTP サーバのログファイルを調べましょう。(別のウィンドウで ``tail -f " +"logfile`` を実行すると便利かもしれません!)" + +#: ../../library/cgi.rst:499 +msgid "" +"Always check a script for syntax errors first, by doing something like " +"``python script.py``." +msgstr "" +"常に ``python script.py`` などとして、スクリプトが構文エラーでないか調べま" +"しょう。" + +#: ../../library/cgi.rst:502 +msgid "" +"If your script does not have any syntax errors, try adding ``import cgitb; " +"cgitb.enable()`` to the top of the script." +msgstr "" +"スクリプトに構文エラーがないなら、``import cgitb; cgitb.enable()`` をスクリプ" +"トの先頭に追加してみましょう。" + +#: ../../library/cgi.rst:505 +msgid "" +"When invoking external programs, make sure they can be found. Usually, this " +"means using absolute path names --- :envvar:`PATH` is usually not set to a " +"very useful value in a CGI script." +msgstr "" +"外部プログラムを起動するときには、スクリプトがそのプログラムを見つけられるよ" +"うにしましょう。これは通常、絶対パス名を使うことを意味します --- :envvar:" +"`PATH` は普通、あまり CGI スクリプトにとって便利でない値に設定されています。" + +#: ../../library/cgi.rst:509 +msgid "" +"When reading or writing external files, make sure they can be read or " +"written by the userid under which your CGI script will be running: this is " +"typically the userid under which the web server is running, or some " +"explicitly specified userid for a web server's ``suexec`` feature." +msgstr "" +"外部のファイルを読み書きする際には、CGI スクリプトを動作させるときに使われる " +"userid でファイルを読み書きできるようになっているか確認しましょう: userid は" +"通常、Web サーバを動作させている userid か、Web サーバの ``suexec`` 機能で明" +"示的に指定している userid になります。" + +#: ../../library/cgi.rst:514 +msgid "" +"Don't try to give a CGI script a set-uid mode. This doesn't work on most " +"systems, and is a security liability as well." +msgstr "" +"CGI スクリプトを set-uid モードにしてはいけません。これはほとんどのシステムで" +"動作せず、セキュリティ上の信頼性もありません。" + +#: ../../library/cgi.rst:518 +msgid "Footnotes" +msgstr "脚注" -#: ../../library/cgi.rst:18 +#: ../../library/cgi.rst:519 msgid "" -"The last version of Python that provided the :mod:`!cgi` module was `Python " -"3.12 `_." +"Note that some recent versions of the HTML specification do state what order " +"the field values should be supplied in, but knowing whether a request was " +"received from a conforming browser, or even from a browser at all, is " +"tedious and error-prone." msgstr "" +"最近のバージョンの HTML 仕様ではフィールドの値を供給する順番を取り決めてはい" +"ますが、ある HTTP リクエストがその取り決めに準拠したブラウザから受信したもの" +"かどうか、そもそもブラウザから送信されたものかどうかの判別は退屈で間違いやす" +"いので注意してください。" diff --git a/library/cgitb.po b/library/cgitb.po index ccb6f5b84..bbd2f3ac3 100644 --- a/library/cgitb.po +++ b/library/cgitb.po @@ -1,43 +1,147 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # +# Translators: +# Nozomu Kaneko , 2017 +# Arihiro TAKASE, 2017 +# tomo, 2019 +# #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-13 14:21+0000\n" -"PO-Revision-Date: 2024-11-19 01:02+0000\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 19:37+0000\n" +"Last-Translator: tomo, 2019\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/cgitb.rst:2 -msgid ":mod:`!cgitb` --- Traceback manager for CGI scripts" -msgstr "" +msgid ":mod:`cgitb` --- Traceback manager for CGI scripts" +msgstr ":mod:`cgitb` --- CGI スクリプトのトレースバック管理機構" #: ../../library/cgitb.rst:10 +msgid "**Source code:** :source:`Lib/cgitb.py`" +msgstr "**ソースコード:** :source:`Lib/cgitb.py`" + +#: ../../library/cgitb.rst:20 +msgid "" +"The :mod:`cgitb` module provides a special exception handler for Python " +"scripts. (Its name is a bit misleading. It was originally designed to " +"display extensive traceback information in HTML for CGI scripts. It was " +"later generalized to also display this information in plain text.) After " +"this module is activated, if an uncaught exception occurs, a detailed, " +"formatted report will be displayed. The report includes a traceback showing " +"excerpts of the source code for each level, as well as the values of the " +"arguments and local variables to currently running functions, to help you " +"debug the problem. Optionally, you can save this information to a file " +"instead of sending it to the browser." +msgstr "" +":mod:`cgitb` モジュールでは、Python スクリプトのための特殊な例外処理を提供し" +"ます。(実はこの説明は少し的外れです。このモジュールはもともと徹底的なトレース" +"バック情報を CGI スクリプトで生成した HTML 内に表示するための設計されました。" +"その後この情報を平文テキストでも表示できるように一般化されています。) このモ" +"ジュールの有効化後に捕捉されない例外が生じた場合、詳細で書式化された報告が " +"Web ブラウザに送信されます。この報告には各レベルにおけるソースコードの抜粋が" +"示されたトレースバックと、現在動作している関数の引数やローカルな変数が収めら" +"れており、問題のデバッグを助けます。オプションとして、この情報をブラウザに送" +"信する代わりにファイルに保存することもできます。" + +#: ../../library/cgitb.rst:30 +msgid "To enable this feature, simply add this to the top of your CGI script::" +msgstr "" +"この機能を有効化するためには、単に自作の CGI スクリプトの最初に以下の2行を追" +"加します::" + +#: ../../library/cgitb.rst:35 +msgid "" +"The options to the :func:`enable` function control whether the report is " +"displayed in the browser and whether the report is logged to a file for " +"later analysis." +msgstr "" +":func:`enable` 関数のオプションは、報告をブラウザに表示するかどうかと、後で解" +"析するためにファイルに報告をログ記録するかどうかを制御します。" + +#: ../../library/cgitb.rst:44 +msgid "" +"This function causes the :mod:`cgitb` module to take over the interpreter's " +"default handling for exceptions by setting the value of :attr:`sys." +"excepthook`." +msgstr "" +"この関数は、 :attr:`sys.excepthook` を設定することで、インタプリタの標準の例" +"外処理を :mod:`cgitb` モジュールに肩代わりさせるようにします。" + +#: ../../library/cgitb.rst:47 +msgid "" +"The optional argument *display* defaults to ``1`` and can be set to ``0`` to " +"suppress sending the traceback to the browser. If the argument *logdir* is " +"present, the traceback reports are written to files. The value of *logdir* " +"should be a directory where these files will be placed. The optional " +"argument *context* is the number of lines of context to display around the " +"current line of source code in the traceback; this defaults to ``5``. If the " +"optional argument *format* is ``\"html\"``, the output is formatted as " +"HTML. Any other value forces plain text output. The default value is " +"``\"html\"``." +msgstr "" +"オプションの引数 *display* は標準で ``1`` になっており、この値は ``0`` にして" +"トレースバックをブラウザに送らないように抑制することもできます。引数 " +"*logdir* が存在すれば、トレースバックレポートはそのファイルに書き込まれます。" +"*logdir* の値はログファイルを配置するディレクトリです。オプション引数 " +"*context* は、トレースバックの中で現在の行の周辺の何行を表示するかです; この" +"値は標準で ``5`` です。オプション引数 *format* が ``\"html\"`` の場合、出力" +"は HTML に書式化されます。その他の値を指定すると平文テキストの出力を強制しま" +"す。デフォルトの値は ``\"html\"`` です。" + +#: ../../library/cgitb.rst:59 msgid "" -"This module is no longer part of the Python standard library. It was :ref:" -"`removed in Python 3.13 ` after being deprecated in " -"Python 3.11. The removal was decided in :pep:`594`." +"This function handles the exception described by *info* (a 3-tuple " +"containing the result of :func:`sys.exc_info`), formatting its traceback as " +"text and returning the result as a string. The optional argument *context* " +"is the number of lines of context to display around the current line of " +"source code in the traceback; this defaults to ``5``." msgstr "" +"この関数は *info* (:func:`sys.exc_info` の結果を含む 3 タプル) に記述されてい" +"る例外を取り扱い、 テキストとしてトレースバックをフォーマットし、結果を文字列" +"として返します。\n" +"オプションの引数 *context* は、トレースバックにおいてソースコード行の前後のコ" +"ンテキストを表示する行数です。デフォルトは ``5`` です。" -#: ../../library/cgitb.rst:14 +#: ../../library/cgitb.rst:68 msgid "" -"A fork of the module on PyPI can now be used instead: :pypi:`legacy-cgi`. " -"This is a copy of the cgi module, no longer maintained or supported by the " -"core Python team." +"This function handles the exception described by *info* (a 3-tuple " +"containing the result of :func:`sys.exc_info`), formatting its traceback as " +"HTML and returning the result as a string. The optional argument *context* " +"is the number of lines of context to display around the current line of " +"source code in the traceback; this defaults to ``5``." msgstr "" +"この関数は *info* (:func:`sys.exc_info` の結果を含む 3 タプル) に記述されてい" +"る例外を取り扱い、 HTML としてトレースバックをフォーマットし、結果を文字列と" +"して返します。\n" +"オプションの引数 *context* は、トレースバックにおいてソースコード行の前後のコ" +"ンテキストを表示する行数です。デフォルトは ``5`` です。" -#: ../../library/cgitb.rst:18 +#: ../../library/cgitb.rst:77 msgid "" -"The last version of Python that provided the :mod:`!cgitb` module was " -"`Python 3.12 `_." +"This function handles an exception using the default settings (that is, show " +"a report in the browser, but don't log to a file). This can be used when " +"you've caught an exception and want to report it using :mod:`cgitb`. The " +"optional *info* argument should be a 3-tuple containing an exception type, " +"exception value, and traceback object, exactly like the tuple returned by :" +"func:`sys.exc_info`. If the *info* argument is not supplied, the current " +"exception is obtained from :func:`sys.exc_info`." msgstr "" +"この関数は標準の設定 (ブラウザに報告を表示しますがファイルにはログを書き込み" +"ません) を使って例外を処理します。この関数は、例外を捕捉した際に :mod:" +"`cgitb` を使って報告したい場合に使うことができます。オプションの *info* 引数" +"は、例外の型、例外の値、トレースバックオブジェクトからなる 3 要素のタプルでな" +"ければなりません。これは :func:`sys.exc_info` によって返される値と全く同じで" +"す。 *info* 引数が与えられていない場合、現在の例外は :func:`sys.exc_info` か" +"ら取得されます。" diff --git a/library/chunk.po b/library/chunk.po index 0fdbf8314..18c89d9c7 100644 --- a/library/chunk.po +++ b/library/chunk.po @@ -1,36 +1,247 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # +# Translators: +# Nozomu Kaneko , 2017 +# 秘湯 , 2017 +# Arihiro TAKASE, 2017 +# #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-13 14:21+0000\n" -"PO-Revision-Date: 2024-11-19 01:02+0000\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 19:37+0000\n" +"Last-Translator: Arihiro TAKASE, 2017\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/chunk.rst:2 -msgid ":mod:`!chunk` --- Read IFF chunked data" -msgstr "" +msgid ":mod:`chunk` --- Read IFF chunked data" +msgstr ":mod:`chunk` --- IFFチャンクデータの読み込み" #: ../../library/chunk.rst:10 +msgid "**Source code:** :source:`Lib/chunk.py`" +msgstr "**ソースコード:** :source:`Lib/chunk.py`" + +#: ../../library/chunk.rst:21 +msgid "" +"This module provides an interface for reading files that use EA IFF 85 " +"chunks. [#]_ This format is used in at least the Audio Interchange File " +"Format (AIFF/AIFF-C) and the Real Media File Format (RMFF). The WAVE audio " +"file format is closely related and can also be read using this module." +msgstr "" +"このモジュールはEA IFF 85チャンクを使用しているファイルの読み込みのためのイン" +"ターフェースを提供します。[#]_ このフォーマットは少なくとも、Audio " +"Interchange File Format (AIFF/AIFF-C) とReal Media File Format (RMFF)で使われ" +"ています。WAVEオーディオファイルフォーマットも厳密に対応しているので、このモ" +"ジュールで読み込みできます。" + +#: ../../library/chunk.rst:26 +msgid "A chunk has the following structure:" +msgstr "チャンクは以下の構造を持っています:" + +#: ../../library/chunk.rst:29 +msgid "Offset" +msgstr "Offset値" + +#: ../../library/chunk.rst:29 +msgid "Length" +msgstr "長さ" + +#: ../../library/chunk.rst:29 +msgid "Contents" +msgstr "内容" + +#: ../../library/chunk.rst:31 +msgid "0" +msgstr "0" + +#: ../../library/chunk.rst:31 ../../library/chunk.rst:33 +msgid "4" +msgstr "4" + +#: ../../library/chunk.rst:31 +msgid "Chunk ID" +msgstr "チャンクID" + +#: ../../library/chunk.rst:33 +msgid "Size of chunk in big-endian byte order, not including the header" +msgstr "big- endianで示したチャンクのサイズで、ヘッダは含みません" + +#: ../../library/chunk.rst:37 +msgid "8" +msgstr "8" + +#: ../../library/chunk.rst:37 +msgid "*n*" +msgstr "*n*" + +#: ../../library/chunk.rst:37 +msgid "Data bytes, where *n* is the size given in the preceding field" +msgstr "バイトデータで、*n* はこれより先のフィールドのサイズ" + +#: ../../library/chunk.rst:41 +msgid "8 + *n*" +msgstr "8 + *n*" + +#: ../../library/chunk.rst:41 +msgid "0 or 1" +msgstr "0 or 1" + +#: ../../library/chunk.rst:41 +msgid "Pad byte needed if *n* is odd and chunk alignment is used" +msgstr "*n* が奇数ならチャンクの整頓のために埋められるバイト" + +#: ../../library/chunk.rst:45 +msgid "The ID is a 4-byte string which identifies the type of chunk." +msgstr "IDはチャンクの種類を識別する4バイトの文字列です。" + +#: ../../library/chunk.rst:47 +msgid "" +"The size field (a 32-bit value, encoded using big-endian byte order) gives " +"the size of the chunk data, not including the 8-byte header." +msgstr "" +"サイズフィールド(big-endianでエンコードされた32ビット値)は、8バイトのヘッダ" +"を含まないチャンクデータのサイズを示します。" + +#: ../../library/chunk.rst:50 msgid "" -"This module is no longer part of the Python standard library. It was :ref:" -"`removed in Python 3.13 ` after being deprecated in " -"Python 3.11. The removal was decided in :pep:`594`." +"Usually an IFF-type file consists of one or more chunks. The proposed usage " +"of the :class:`Chunk` class defined here is to instantiate an instance at " +"the start of each chunk and read from the instance until it reaches the end, " +"after which a new instance can be instantiated. At the end of the file, " +"creating a new instance will fail with an :exc:`EOFError` exception." msgstr "" +"普通、IFFタイプのファイルは1個かそれ以上のチャンクからなります。このモジュー" +"ルで定義される :class:`Chunk` クラスの使い方として提案しているのは、それぞれ" +"のチャンクの始めにインスタンスを作り、終わりに達するまでそのインスタンスから" +"読み取り、その後で新しいインスタンスを作るということです。ファイルの終わりで" +"新しいインスタンスを作ろうとすると、 :exc:`EOFError` の例外が発生して失敗しま" +"す。" + +#: ../../library/chunk.rst:59 +msgid "" +"Class which represents a chunk. The *file* argument is expected to be a " +"file-like object. An instance of this class is specifically allowed. The " +"only method that is needed is :meth:`~io.IOBase.read`. If the methods :meth:" +"`~io.IOBase.seek` and :meth:`~io.IOBase.tell` are present and don't raise an " +"exception, they are also used. If these methods are present and raise an " +"exception, they are expected to not have altered the object. If the " +"optional argument *align* is true, chunks are assumed to be aligned on 2-" +"byte boundaries. If *align* is false, no alignment is assumed. The default " +"value is true. If the optional argument *bigendian* is false, the chunk " +"size is assumed to be in little-endian order. This is needed for WAVE audio " +"files. The default value is true. If the optional argument *inclheader* is " +"true, the size given in the chunk header includes the size of the header. " +"The default value is false." +msgstr "" +"チャンクを表わすクラス。 *file* 引数はファイル風オブジェクトであると期待され" +"ます。このクラスのインスタンスは特別に許可されます。唯一の必要なメソッドは :" +"meth:`~io.IOBase.read` です。メソッド :meth:`~io.IOBase.seek` および :meth:" +"`~io.IOBase.tell` が存在し、例外を上げない場合、それらも使用されます。これら" +"のメソッドが存在し、例外を上げる場合、それらのメソッドはオブジェクトを変更し" +"ないことが想定されます。オプションの引数 *align* が true の場合、チャンクは2" +"バイト境界上で整列されていると仮定されます。 *align* が false の場合、整列は" +"仮定されません。デフォルト値は true です。オプションの引数 *bigendian* が " +"false の場合、チャンクサイズはリトルエンディアン順になっていると仮定されま" +"す。これは WAVE オーディオファイルに必要とされます。デフォルト値は true で" +"す。オプションの引数 *inclheader* が true の場合、チャンクヘッダ中で与えられ" +"たサイズはヘッダのサイズを含んでいます。デフォルト値は false です。" + +#: ../../library/chunk.rst:73 +msgid "A :class:`Chunk` object supports the following methods:" +msgstr ":class:`Chunk` オブジェクトには以下のメソッドが定義されています:" + +#: ../../library/chunk.rst:78 +msgid "" +"Returns the name (ID) of the chunk. This is the first 4 bytes of the chunk." +msgstr "チャンクの名前(ID)を返します。これはチャンクの始めの4バイトです。" + +#: ../../library/chunk.rst:84 +msgid "Returns the size of the chunk." +msgstr "チャンクのサイズを返します。" + +#: ../../library/chunk.rst:89 +msgid "" +"Close and skip to the end of the chunk. This does not close the underlying " +"file." +msgstr "" +"オブジェクトを閉じて、チャンクの終わりまで飛びます。これは元のファイル自体は" +"閉じません。" + +#: ../../library/chunk.rst:92 +msgid "" +"The remaining methods will raise :exc:`OSError` if called after the :meth:" +"`close` method has been called. Before Python 3.3, they used to raise :exc:" +"`IOError`, now an alias of :exc:`OSError`." +msgstr "" +":meth:`close` メソッドが呼ばれた後で他のメソッドを呼ぶと :exc:`OSError` が送" +"出されます。 Python 3.3 以前は :exc:`IOError` (現在は :exc:`OSError` の別名) " +"が送出されていました。" + +#: ../../library/chunk.rst:99 +msgid "Returns ``False``." +msgstr "``False`` を返します。" + +#: ../../library/chunk.rst:104 +msgid "" +"Set the chunk's current position. The *whence* argument is optional and " +"defaults to ``0`` (absolute file positioning); other values are ``1`` (seek " +"relative to the current position) and ``2`` (seek relative to the file's " +"end). There is no return value. If the underlying file does not allow seek, " +"only forward seeks are allowed." +msgstr "" +"チャンクの現在位置を設定します。引数 *whence* は省略可能で、デフォルト値は " +"``0`` (ファイルの絶対位置)です; 他に ``1`` (現在位置から相対的にシークしま" +"す)と ``2`` (ファイルの末尾から相対的にシークします)の値を取ります。何も値" +"は返しません。もし元のファイルがシークに対応していなければ、前方へのシークの" +"みが可能です。" + +#: ../../library/chunk.rst:113 +msgid "Return the current position into the chunk." +msgstr "チャンク内の現在位置を返します。" + +#: ../../library/chunk.rst:118 +msgid "" +"Read at most *size* bytes from the chunk (less if the read hits the end of " +"the chunk before obtaining *size* bytes). If the *size* argument is " +"negative or omitted, read all data until the end of the chunk. An empty " +"bytes object is returned when the end of the chunk is encountered " +"immediately." +msgstr "" +"チャンクから最大で *size* バイト読み込みます ( *size* バイトを読み込むより前" +"にチャンクの最後に行き着いたら、それより少なくなります) 。もし引数 *size* が" +"負か省略されたら、チャンクの最後まで全てのデータを読み込みます。チャンクの最" +"後に行き着いたら、空の bytes オブジェクトを返します。" + +#: ../../library/chunk.rst:127 +msgid "" +"Skip to the end of the chunk. All further calls to :meth:`read` for the " +"chunk will return ``b''``. If you are not interested in the contents of the " +"chunk, this method should be called so that the file points to the start of " +"the next chunk." +msgstr "" +"チャンクの最後まで飛びます。さらにチャンクの :meth:`read` を呼び出すと、 " +"``b''`` が返されます。もしチャンクの内容に興味がないなら、このメソッドを呼び" +"出してファイルポインタを次のチャンクの始めに設定します。" + +#: ../../library/chunk.rst:134 +msgid "Footnotes" +msgstr "脚注" -#: ../../library/chunk.rst:14 +#: ../../library/chunk.rst:135 msgid "" -"The last version of Python that provided the :mod:`!chunk` module was " -"`Python 3.12 `_." +"\"EA IFF 85\" Standard for Interchange Format Files, Jerry Morrison, " +"Electronic Arts, January 1985." msgstr "" +"\"EA IFF 85\" Standard for Interchange Format Files, Jerry Morrison, " +"Electronic Arts, January 1985." diff --git a/library/cmath.po b/library/cmath.po index 832d1d587..12e9d604c 100644 --- a/library/cmath.po +++ b/library/cmath.po @@ -1,364 +1,81 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Arihiro TAKASE, 2023 -# tomo, 2023 -# TENMYO Masakazu, 2023 -# 石井明久, 2024 +# 秘湯 , 2017 +# ごはんですよ , 2017 +# Arihiro TAKASE, 2017 +# E. Kawashima, 2017 +# tomo, 2019 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:56+0000\n" -"Last-Translator: 石井明久, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 23:02+0000\n" +"Last-Translator: tomo, 2019\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/cmath.rst:2 -msgid ":mod:`!cmath` --- Mathematical functions for complex numbers" -msgstr ":mod:`!cmath` --- 複素数用の数学関数" +msgid ":mod:`cmath` --- Mathematical functions for complex numbers" +msgstr ":mod:`cmath` --- 複素数のための数学関数" #: ../../library/cmath.rst:9 msgid "" "This module provides access to mathematical functions for complex numbers. " "The functions in this module accept integers, floating-point numbers or " "complex numbers as arguments. They will also accept any Python object that " -"has either a :meth:`~object.__complex__` or a :meth:`~object.__float__` " -"method: these methods are used to convert the object to a complex or " -"floating-point number, respectively, and the function is then applied to the " -"result of the conversion." +"has either a :meth:`__complex__` or a :meth:`__float__` method: these " +"methods are used to convert the object to a complex or floating-point " +"number, respectively, and the function is then applied to the result of the " +"conversion." msgstr "" "このモジュールは、複素数を扱う数学関数へのアクセスを提供しています。\n" "このモジュール中の関数は整数、浮動小数点数または複素数を引数にとります。\n" -"また、 :meth:`~object.__complex__` または :meth:`~object.__float__` どちらか" -"のメソッドを提供している Python オブジェクトも受け付けます。\n" +"また、 :meth:`__complex__` または :meth:`__float__` どちらかのメソッドを提供" +"している Python オブジェクトも受け付けます。\n" "これらのメソッドはそのオブジェクトを複素数または浮動小数点数に変換するのにそ" "れぞれ使われ、呼び出された関数はそうして変換された結果を利用します。" #: ../../library/cmath.rst:18 msgid "" -"For functions involving branch cuts, we have the problem of deciding how to " -"define those functions on the cut itself. Following Kahan's \"Branch cuts " -"for complex elementary functions\" paper, as well as Annex G of C99 and " -"later C standards, we use the sign of zero to distinguish one side of the " -"branch cut from the other: for a branch cut along (a portion of) the real " -"axis we look at the sign of the imaginary part, while for a branch cut along " -"the imaginary axis we look at the sign of the real part." +"On platforms with hardware and system-level support for signed zeros, " +"functions involving branch cuts are continuous on *both* sides of the branch " +"cut: the sign of the zero distinguishes one side of the branch cut from the " +"other. On platforms that do not support signed zeros the continuity is as " +"specified below." msgstr "" +"ハードウェア及びシステムレベルでの符号付きゼロのサポートがあるプラットフォー" +"ムでは、分枝切断 (branch cut) の関わる関数において切断された *両側* の分枝で" +"連続になります。ゼロの符号でどちらの分枝であるかを区別するのです。符号付きゼ" +"ロがサポートされないプラットフォームでは連続性は以下の仕様で述べるようになり" +"ます。" #: ../../library/cmath.rst:26 -msgid "" -"For example, the :func:`cmath.sqrt` function has a branch cut along the " -"negative real axis. An argument of ``-2-0j`` is treated as though it lies " -"*below* the branch cut, and so gives a result on the negative imaginary " -"axis::" -msgstr "" - -#: ../../library/cmath.rst:31 -msgid "" -">>> cmath.sqrt(-2-0j)\n" -"-1.4142135623730951j" -msgstr "" - -#: ../../library/cmath.rst:34 -msgid "" -"But an argument of ``-2+0j`` is treated as though it lies above the branch " -"cut::" -msgstr "" - -#: ../../library/cmath.rst:37 -msgid "" -">>> cmath.sqrt(-2+0j)\n" -"1.4142135623730951j" -msgstr "" - -#: ../../library/cmath.rst:42 -msgid "**Conversions to and from polar coordinates**" -msgstr "" - -#: ../../library/cmath.rst:44 -msgid ":func:`phase(z) `" -msgstr "" - -#: ../../library/cmath.rst:44 -msgid "Return the phase of *z*" -msgstr "" - -#: ../../library/cmath.rst:45 -msgid ":func:`polar(z) `" -msgstr "" - -#: ../../library/cmath.rst:45 -msgid "Return the representation of *z* in polar coordinates" -msgstr "" - -#: ../../library/cmath.rst:46 -msgid ":func:`rect(r, phi) `" -msgstr "" - -#: ../../library/cmath.rst:46 -msgid "Return the complex number *z* with polar coordinates *r* and *phi*" -msgstr "" - -#: ../../library/cmath.rst:48 -msgid "**Power and logarithmic functions**" -msgstr "" - -#: ../../library/cmath.rst:50 -msgid ":func:`exp(z) `" -msgstr "" - -#: ../../library/cmath.rst:50 -msgid "Return *e* raised to the power *z*" -msgstr "" - -#: ../../library/cmath.rst:51 -msgid ":func:`log(z[, base]) `" -msgstr "" - -#: ../../library/cmath.rst:51 -msgid "Return the logarithm of *z* to the given *base* (*e* by default)" -msgstr "" - -#: ../../library/cmath.rst:52 -msgid ":func:`log10(z) `" -msgstr "" - -#: ../../library/cmath.rst:52 -msgid "Return the base-10 logarithm of *z*" -msgstr "" - -#: ../../library/cmath.rst:53 -msgid ":func:`sqrt(z) `" -msgstr "" - -#: ../../library/cmath.rst:53 -msgid "Return the square root of *z*" -msgstr "" - -#: ../../library/cmath.rst:55 -msgid "**Trigonometric functions**" -msgstr "" - -#: ../../library/cmath.rst:57 -msgid ":func:`acos(z) `" -msgstr "" - -#: ../../library/cmath.rst:57 -msgid "Return the arc cosine of *z*" -msgstr "" - -#: ../../library/cmath.rst:58 -msgid ":func:`asin(z) `" -msgstr "" - -#: ../../library/cmath.rst:58 -msgid "Return the arc sine of *z*" -msgstr "" - -#: ../../library/cmath.rst:59 -msgid ":func:`atan(z) `" -msgstr "" - -#: ../../library/cmath.rst:59 -msgid "Return the arc tangent of *z*" -msgstr "" - -#: ../../library/cmath.rst:60 -msgid ":func:`cos(z) `" -msgstr "" - -#: ../../library/cmath.rst:60 -msgid "Return the cosine of *z*" -msgstr "" - -#: ../../library/cmath.rst:61 -msgid ":func:`sin(z) `" -msgstr "" - -#: ../../library/cmath.rst:61 -msgid "Return the sine of *z*" -msgstr "" - -#: ../../library/cmath.rst:62 -msgid ":func:`tan(z) `" -msgstr "" - -#: ../../library/cmath.rst:62 -msgid "Return the tangent of *z*" -msgstr "" - -#: ../../library/cmath.rst:64 -msgid "**Hyperbolic functions**" -msgstr "" - -#: ../../library/cmath.rst:66 -msgid ":func:`acosh(z) `" -msgstr "" - -#: ../../library/cmath.rst:66 -msgid "Return the inverse hyperbolic cosine of *z*" -msgstr "" - -#: ../../library/cmath.rst:67 -msgid ":func:`asinh(z) `" -msgstr "" - -#: ../../library/cmath.rst:67 -msgid "Return the inverse hyperbolic sine of *z*" -msgstr "" - -#: ../../library/cmath.rst:68 -msgid ":func:`atanh(z) `" -msgstr "" - -#: ../../library/cmath.rst:68 -msgid "Return the inverse hyperbolic tangent of *z*" -msgstr "" - -#: ../../library/cmath.rst:69 -msgid ":func:`cosh(z) `" -msgstr "" - -#: ../../library/cmath.rst:69 -msgid "Return the hyperbolic cosine of *z*" -msgstr "" - -#: ../../library/cmath.rst:70 -msgid ":func:`sinh(z) `" -msgstr "" - -#: ../../library/cmath.rst:70 -msgid "Return the hyperbolic sine of *z*" -msgstr "" - -#: ../../library/cmath.rst:71 -msgid ":func:`tanh(z) `" -msgstr "" - -#: ../../library/cmath.rst:71 -msgid "Return the hyperbolic tangent of *z*" -msgstr "" - -#: ../../library/cmath.rst:73 -msgid "**Classification functions**" -msgstr "" - -#: ../../library/cmath.rst:75 -msgid ":func:`isfinite(z) `" -msgstr "" - -#: ../../library/cmath.rst:75 -msgid "Check if all components of *z* are finite" -msgstr "" - -#: ../../library/cmath.rst:76 -msgid ":func:`isinf(z) `" -msgstr "" - -#: ../../library/cmath.rst:76 -msgid "Check if any component of *z* is infinite" -msgstr "" - -#: ../../library/cmath.rst:77 -msgid ":func:`isnan(z) `" -msgstr "" - -#: ../../library/cmath.rst:77 -msgid "Check if any component of *z* is a NaN" -msgstr "" - -#: ../../library/cmath.rst:78 -msgid ":func:`isclose(a, b, *, rel_tol, abs_tol) `" -msgstr "" - -#: ../../library/cmath.rst:78 -msgid "Check if the values *a* and *b* are close to each other" -msgstr "" - -#: ../../library/cmath.rst:80 -msgid "**Constants**" -msgstr "" - -#: ../../library/cmath.rst:82 -msgid ":data:`pi`" -msgstr "" - -#: ../../library/cmath.rst:82 -msgid "*π* = 3.141592..." -msgstr "" - -#: ../../library/cmath.rst:83 -msgid ":data:`e`" -msgstr "" - -#: ../../library/cmath.rst:83 -msgid "*e* = 2.718281..." -msgstr "" - -#: ../../library/cmath.rst:84 -msgid ":data:`tau`" -msgstr "" - -#: ../../library/cmath.rst:84 -msgid "*τ* = 2\\ *π* = 6.283185..." -msgstr "" - -#: ../../library/cmath.rst:85 -msgid ":data:`inf`" -msgstr "" - -#: ../../library/cmath.rst:85 -msgid "Positive infinity" -msgstr "" - -#: ../../library/cmath.rst:86 -msgid ":data:`infj`" -msgstr "" - -#: ../../library/cmath.rst:86 -msgid "Pure imaginary infinity" -msgstr "" - -#: ../../library/cmath.rst:87 -msgid ":data:`nan`" -msgstr "" - -#: ../../library/cmath.rst:87 -msgid "\"Not a number\" (NaN)" -msgstr "" - -#: ../../library/cmath.rst:88 -msgid ":data:`nanj`" -msgstr "" - -#: ../../library/cmath.rst:88 -msgid "Pure imaginary NaN" -msgstr "" - -#: ../../library/cmath.rst:93 msgid "Conversions to and from polar coordinates" msgstr "極座標変換" -#: ../../library/cmath.rst:95 +#: ../../library/cmath.rst:28 msgid "" "A Python complex number ``z`` is stored internally using *rectangular* or " "*Cartesian* coordinates. It is completely determined by its *real part* ``z." -"real`` and its *imaginary part* ``z.imag``." +"real`` and its *imaginary part* ``z.imag``. In other words::" msgstr "" +"Python の複素数 ``z`` は内部的には *直交座標* もしくは *デカルト座標* と呼ば" +"れる座標を使って格納されています。この座標はその複素数の *実部* ``z.real`` " +"と *虚部* ``z.imag`` で決まります。言い換えると::" -#: ../../library/cmath.rst:99 +#: ../../library/cmath.rst:35 msgid "" "*Polar coordinates* give an alternative way to represent a complex number. " "In polar coordinates, a complex number *z* is defined by the modulus *r* and " @@ -372,172 +89,205 @@ msgstr "" "*phi* は x 軸の正の部分から原点と *z* を結んだ線分までの角度を反時計回りにラ" "ジアンで測った値です。" -#: ../../library/cmath.rst:106 +#: ../../library/cmath.rst:42 msgid "" "The following functions can be used to convert from the native rectangular " "coordinates to polar coordinates and back." msgstr "" "次の関数はネイティブの直交座標を極座標に変換したりその逆を行うのに使えます。" -#: ../../library/cmath.rst:111 +#: ../../library/cmath.rst:47 msgid "" -"Return the phase of *z* (also known as the *argument* of *z*), as a float. " -"``phase(z)`` is equivalent to ``math.atan2(z.imag, z.real)``. The result " +"Return the phase of *x* (also known as the *argument* of *x*), as a float. " +"``phase(x)`` is equivalent to ``math.atan2(x.imag, x.real)``. The result " "lies in the range [-\\ *π*, *π*], and the branch cut for this operation lies " -"along the negative real axis. The sign of the result is the same as the " -"sign of ``z.imag``, even when ``z.imag`` is zero::" -msgstr "" - -#: ../../library/cmath.rst:117 -msgid "" -">>> phase(-1+0j)\n" -"3.141592653589793\n" -">>> phase(-1-0j)\n" -"-3.141592653589793" -msgstr "" +"along the negative real axis, continuous from above. On systems with " +"support for signed zeros (which includes most systems in current use), this " +"means that the sign of the result is the same as the sign of ``x.imag``, " +"even when ``x.imag`` is zero::" +msgstr "" +"*x* の位相 (*x* の *偏角* とも呼びます) を浮動小数点数で返します。" +"``phase(x)`` は ``math.atan2(x.imag, x.real)`` と同等です。返り値は [-\\ " +"*π*, *π*] の範囲にあり、この演算の分枝切断は負の実軸に沿って延びていて、上か" +"ら連続です。(現在のほとんどのシステムはそうですが) 符号付きゼロをサポートして" +"いるシステムでは、結果の符号は ``x.imag`` がゼロであってさえ ``x.imag`` の符" +"号と等しくなります::" -#: ../../library/cmath.rst:125 +#: ../../library/cmath.rst:64 msgid "" -"The modulus (absolute value) of a complex number *z* can be computed using " +"The modulus (absolute value) of a complex number *x* can be computed using " "the built-in :func:`abs` function. There is no separate :mod:`cmath` module " "function for this operation." msgstr "" +"複素数 *x* のモジュラス (絶対値) は組み込みの :func:`abs` 関数で計算できま" +"す。この演算を行う :mod:`cmath` モジュールの関数はありません。" -#: ../../library/cmath.rst:132 +#: ../../library/cmath.rst:71 msgid "" -"Return the representation of *z* in polar coordinates. Returns a pair ``(r, " -"phi)`` where *r* is the modulus of *z* and *phi* is the phase of *z*. " -"``polar(z)`` is equivalent to ``(abs(z), phase(z))``." +"Return the representation of *x* in polar coordinates. Returns a pair ``(r, " +"phi)`` where *r* is the modulus of *x* and phi is the phase of *x*. " +"``polar(x)`` is equivalent to ``(abs(x), phase(x))``." msgstr "" +"*x* の極座標表現を返します。*x* の半径 *r* と *x* の位相 *phi* の組 ``(r, " +"phi)`` を返します。``polar(x)`` は ``(abs(x), phase(x))`` に等しいです。" -#: ../../library/cmath.rst:140 +#: ../../library/cmath.rst:79 msgid "" -"Return the complex number *z* with polar coordinates *r* and *phi*. " -"Equivalent to ``complex(r * math.cos(phi), r * math.sin(phi))``." +"Return the complex number *x* with polar coordinates *r* and *phi*. " +"Equivalent to ``r * (math.cos(phi) + math.sin(phi)*1j)``." msgstr "" +"極座標 *r*, *phi* を持つ複素数 *x* を返します。値は ``r * (math.cos(phi) + " +"math.sin(phi)*1j)`` に等しいです。" -#: ../../library/cmath.rst:145 +#: ../../library/cmath.rst:84 msgid "Power and logarithmic functions" msgstr "指数関数と対数関数" -#: ../../library/cmath.rst:149 +#: ../../library/cmath.rst:88 msgid "" -"Return *e* raised to the power *z*, where *e* is the base of natural " +"Return *e* raised to the power *x*, where *e* is the base of natural " "logarithms." -msgstr "" +msgstr "*e* を自然対数の底として、 *e* の *x* 乗を返します。" -#: ../../library/cmath.rst:155 +#: ../../library/cmath.rst:94 msgid "" -"Return the logarithm of *z* to the given *base*. If the *base* is not " -"specified, returns the natural logarithm of *z*. There is one branch cut, " -"from 0 along the negative real axis to -∞." +"Returns the logarithm of *x* to the given *base*. If the *base* is not " +"specified, returns the natural logarithm of *x*. There is one branch cut, " +"from 0 along the negative real axis to -∞, continuous from above." msgstr "" +"*base* を底とする *x* の対数を返します。もし *base* が指定されていない場合に" +"は、*x* の自然対数を返します。分枝切断を一つもち、``0`` から負の実数軸に沿っ" +"て ``-∞`` へと延びており、上から連続しています。" -#: ../../library/cmath.rst:162 +#: ../../library/cmath.rst:101 msgid "" -"Return the base-10 logarithm of *z*. This has the same branch cut as :func:" +"Return the base-10 logarithm of *x*. This has the same branch cut as :func:" "`log`." msgstr "" +"*x* の底を 10 とする対数を返します。 :func:`log` と同じ分枝切断を持ちます。" -#: ../../library/cmath.rst:168 +#: ../../library/cmath.rst:107 msgid "" -"Return the square root of *z*. This has the same branch cut as :func:`log`." -msgstr "" +"Return the square root of *x*. This has the same branch cut as :func:`log`." +msgstr "*x* の平方根を返します。 :func:`log` と同じ分枝切断を持ちます。" -#: ../../library/cmath.rst:172 +#: ../../library/cmath.rst:111 msgid "Trigonometric functions" msgstr "三角関数" -#: ../../library/cmath.rst:176 +#: ../../library/cmath.rst:115 msgid "" -"Return the arc cosine of *z*. There are two branch cuts: One extends right " -"from 1 along the real axis to ∞. The other extends left from -1 along the " -"real axis to -∞." +"Return the arc cosine of *x*. There are two branch cuts: One extends right " +"from 1 along the real axis to ∞, continuous from below. The other extends " +"left from -1 along the real axis to -∞, continuous from above." msgstr "" +"*x* の逆余弦を返します。この関数には二つの分枝切断 (branch cut) があります: " +"一つは 1 から右側に実数軸に沿って∞へと延びていて、下から連続しています。もう" +"一つは -1 から左側に実数軸に沿って -∞へと延びていて、上から連続しています。" -#: ../../library/cmath.rst:183 +#: ../../library/cmath.rst:122 msgid "" -"Return the arc sine of *z*. This has the same branch cuts as :func:`acos`." -msgstr "" +"Return the arc sine of *x*. This has the same branch cuts as :func:`acos`." +msgstr "*x* の逆正弦を返します。 :func:`acos` と同じ分枝切断を持ちます。" -#: ../../library/cmath.rst:188 +#: ../../library/cmath.rst:127 msgid "" -"Return the arc tangent of *z*. There are two branch cuts: One extends from " -"``1j`` along the imaginary axis to ``∞j``. The other extends from ``-1j`` " -"along the imaginary axis to ``-∞j``." +"Return the arc tangent of *x*. There are two branch cuts: One extends from " +"``1j`` along the imaginary axis to ``∞j``, continuous from the right. The " +"other extends from ``-1j`` along the imaginary axis to ``-∞j``, continuous " +"from the left." msgstr "" +"*x* の逆正接を返します。二つの分枝切断があります: 一つは ``1j`` から虚数軸に" +"沿って ``∞j`` へと延びており、右から連続です。もう一つは ``-1j`` から虚数軸に" +"沿って ``-∞j`` へと延びており、左から連続です。" -#: ../../library/cmath.rst:195 -msgid "Return the cosine of *z*." -msgstr "" +#: ../../library/cmath.rst:135 +msgid "Return the cosine of *x*." +msgstr "*x* の余弦を返します。" -#: ../../library/cmath.rst:200 -msgid "Return the sine of *z*." -msgstr "" +#: ../../library/cmath.rst:140 +msgid "Return the sine of *x*." +msgstr "*x* の正弦を返します。" -#: ../../library/cmath.rst:205 -msgid "Return the tangent of *z*." -msgstr "" +#: ../../library/cmath.rst:145 +msgid "Return the tangent of *x*." +msgstr "*x* の正接を返します。" -#: ../../library/cmath.rst:209 +#: ../../library/cmath.rst:149 msgid "Hyperbolic functions" msgstr "双曲線関数" -#: ../../library/cmath.rst:213 +#: ../../library/cmath.rst:153 msgid "" -"Return the inverse hyperbolic cosine of *z*. There is one branch cut, " -"extending left from 1 along the real axis to -∞." +"Return the inverse hyperbolic cosine of *x*. There is one branch cut, " +"extending left from 1 along the real axis to -∞, continuous from above." msgstr "" +"*x* の逆双曲線余弦を返します。分枝切断が一つあり、1 の左側に実数軸に沿って -∞" +"へと延びていて、上から連続しています。" -#: ../../library/cmath.rst:219 +#: ../../library/cmath.rst:159 msgid "" -"Return the inverse hyperbolic sine of *z*. There are two branch cuts: One " -"extends from ``1j`` along the imaginary axis to ``∞j``. The other extends " -"from ``-1j`` along the imaginary axis to ``-∞j``." +"Return the inverse hyperbolic sine of *x*. There are two branch cuts: One " +"extends from ``1j`` along the imaginary axis to ``∞j``, continuous from the " +"right. The other extends from ``-1j`` along the imaginary axis to ``-∞j``, " +"continuous from the left." msgstr "" +"*x* の逆双曲線正弦を返します。二つの分枝切断があります: 一つは ``1j`` から虚" +"数軸に沿って ``∞j`` へと延びており、右から連続です。もう一つは ``-1j`` から虚" +"数軸に沿って ``-∞j`` へと延びており、左から連続です。" -#: ../../library/cmath.rst:226 +#: ../../library/cmath.rst:167 msgid "" -"Return the inverse hyperbolic tangent of *z*. There are two branch cuts: One " -"extends from ``1`` along the real axis to ``∞``. The other extends from " -"``-1`` along the real axis to ``-∞``." +"Return the inverse hyperbolic tangent of *x*. There are two branch cuts: One " +"extends from ``1`` along the real axis to ``∞``, continuous from below. The " +"other extends from ``-1`` along the real axis to ``-∞``, continuous from " +"above." msgstr "" +"*x* の逆双曲線正接を返します。二つの分枝切断があります: 一つは ``1`` から実数" +"軸に沿って ``∞`` へと延びており、下から連続です。もう一つは ``-1`` から実数軸" +"に沿って ``-∞`` へと延びており、上から連続です。" -#: ../../library/cmath.rst:233 -msgid "Return the hyperbolic cosine of *z*." -msgstr "" +#: ../../library/cmath.rst:175 +msgid "Return the hyperbolic cosine of *x*." +msgstr "*x* の双曲線余弦を返します。" -#: ../../library/cmath.rst:238 -msgid "Return the hyperbolic sine of *z*." -msgstr "" +#: ../../library/cmath.rst:180 +msgid "Return the hyperbolic sine of *x*." +msgstr "*x* の双曲線正弦を返します。" -#: ../../library/cmath.rst:243 -msgid "Return the hyperbolic tangent of *z*." -msgstr "" +#: ../../library/cmath.rst:185 +msgid "Return the hyperbolic tangent of *x*." +msgstr "*x* の双曲線正接を返します。" -#: ../../library/cmath.rst:247 +#: ../../library/cmath.rst:189 msgid "Classification functions" msgstr "類別関数" -#: ../../library/cmath.rst:251 +#: ../../library/cmath.rst:193 msgid "" -"Return ``True`` if both the real and imaginary parts of *z* are finite, and " +"Return ``True`` if both the real and imaginary parts of *x* are finite, and " "``False`` otherwise." msgstr "" +"*x* の実部、虚部ともに有限であれば ``True`` を返し、それ以外の場合 " +"``False`` を返します。" -#: ../../library/cmath.rst:259 +#: ../../library/cmath.rst:201 msgid "" -"Return ``True`` if either the real or the imaginary part of *z* is an " +"Return ``True`` if either the real or the imaginary part of *x* is an " "infinity, and ``False`` otherwise." msgstr "" +"*x* の実数部または虚数部が正または負の無限大であれば ``True`` を、そうでなけ" +"れば ``False`` を返します。" -#: ../../library/cmath.rst:265 +#: ../../library/cmath.rst:207 msgid "" -"Return ``True`` if either the real or the imaginary part of *z* is a NaN, " +"Return ``True`` if either the real or the imaginary part of *x* is a NaN, " "and ``False`` otherwise." msgstr "" +"*x* の実部と虚部のどちらかが NaN のとき ``True`` を返し、それ以外の場合 " +"``False`` を返します。" -#: ../../library/cmath.rst:271 +#: ../../library/cmath.rst:213 msgid "" "Return ``True`` if the values *a* and *b* are close to each other and " "``False`` otherwise." @@ -545,33 +295,45 @@ msgstr "" "値 *a* と *b* が互いに近い場合 ``True`` を、そうでない場合は ``False`` を返し" "ます。" -#: ../../library/cmath.rst:274 +#: ../../library/cmath.rst:216 msgid "" "Whether or not two values are considered close is determined according to " -"given absolute and relative tolerances. If no errors occur, the result will " -"be: ``abs(a-b) <= max(rel_tol * max(abs(a), abs(b)), abs_tol)``." +"given absolute and relative tolerances." msgstr "" +"2値が近いと見なされるかどうかは与えられた絶対または相対許容差により決定されま" +"す。" -#: ../../library/cmath.rst:278 +#: ../../library/cmath.rst:219 msgid "" "*rel_tol* is the relative tolerance -- it is the maximum allowed difference " "between *a* and *b*, relative to the larger absolute value of *a* or *b*. " "For example, to set a tolerance of 5%, pass ``rel_tol=0.05``. The default " "tolerance is ``1e-09``, which assures that the two values are the same " -"within about 9 decimal digits. *rel_tol* must be nonnegative and less than " -"``1.0``." +"within about 9 decimal digits. *rel_tol* must be greater than zero." +msgstr "" +"*rel_tol* は相対許容差、すなわち *a* と *b* の絶対値の大きい方に対する *a* " +"と *b* の許容される最大の差です。\n" +"例えば許容差を 5% に設定する場合 ``rel_tol=0.05`` を渡します。\n" +"デフォルトの許容差は ``1e-09`` で、2値が9桁同じことを保証します。\n" +"*rel_tol* は0より大きくなければなりません。" + +#: ../../library/cmath.rst:225 +msgid "" +"*abs_tol* is the minimum absolute tolerance -- useful for comparisons near " +"zero. *abs_tol* must be at least zero." msgstr "" +"*abs_tol* は最小の絶対許容差です。0に近い値を比較するのに有用です。*abs_tol* " +"は0以上でなければなりません。" -#: ../../library/cmath.rst:285 +#: ../../library/cmath.rst:228 msgid "" -"*abs_tol* is the absolute tolerance; it defaults to ``0.0`` and it must be " -"nonnegative. When comparing ``x`` to ``0.0``, ``isclose(x, 0)`` is computed " -"as ``abs(x) <= rel_tol * abs(x)``, which is ``False`` for any ``x`` and " -"rel_tol less than ``1.0``. So add an appropriate positive abs_tol argument " -"to the call." +"If no errors occur, the result will be: ``abs(a-b) <= max(rel_tol * " +"max(abs(a), abs(b)), abs_tol)``." msgstr "" +"エラーが起こらなければ結果は ``abs(a-b) <= max(rel_tol * max(abs(a), " +"abs(b)), abs_tol)`` です。" -#: ../../library/cmath.rst:291 +#: ../../library/cmath.rst:231 msgid "" "The IEEE 754 special values of ``NaN``, ``inf``, and ``-inf`` will be " "handled according to IEEE rules. Specifically, ``NaN`` is not considered " @@ -583,31 +345,31 @@ msgstr "" "具体的には、``NaN`` は自身を含めたあらゆる値に近いとは見なされません。\n" "``inf`` と ``-inf`` は自身とのみ近いと見なされます。" -#: ../../library/cmath.rst:300 +#: ../../library/cmath.rst:240 msgid ":pep:`485` -- A function for testing approximate equality" -msgstr ":pep:`485` -- 近似的に等しいことを調べる関数" +msgstr ":pep:`485` -- A function for testing approximate equality" -#: ../../library/cmath.rst:304 +#: ../../library/cmath.rst:244 msgid "Constants" msgstr "定数" -#: ../../library/cmath.rst:308 +#: ../../library/cmath.rst:248 msgid "The mathematical constant *π*, as a float." msgstr "定数 *π* (円周率)で、浮動小数点数です。" -#: ../../library/cmath.rst:313 +#: ../../library/cmath.rst:253 msgid "The mathematical constant *e*, as a float." msgstr "定数 *e* (自然対数の底)で、浮動小数点数です。" -#: ../../library/cmath.rst:318 +#: ../../library/cmath.rst:258 msgid "The mathematical constant *τ*, as a float." msgstr "数学定数 *τ* で、浮動小数点数です。" -#: ../../library/cmath.rst:325 +#: ../../library/cmath.rst:265 msgid "Floating-point positive infinity. Equivalent to ``float('inf')``." msgstr "浮動小数点数の正の無限大です。``float('inf')`` と等価です。" -#: ../../library/cmath.rst:332 +#: ../../library/cmath.rst:272 msgid "" "Complex number with zero real part and positive infinity imaginary part. " "Equivalent to ``complex(0.0, float('inf'))``." @@ -615,14 +377,14 @@ msgstr "" "実部がゼロ、虚部が正の無限大の複素数です。``complex(0.0, float('inf'))`` と等" "価です。" -#: ../../library/cmath.rst:340 +#: ../../library/cmath.rst:280 msgid "" "A floating-point \"not a number\" (NaN) value. Equivalent to " "``float('nan')``." msgstr "" "浮動小数点数の非数 \"not a number\" (NaN) です。``float('nan')`` と等価です。" -#: ../../library/cmath.rst:348 +#: ../../library/cmath.rst:288 msgid "" "Complex number with zero real part and NaN imaginary part. Equivalent to " "``complex(0.0, float('nan'))``." @@ -630,7 +392,7 @@ msgstr "" "実部がゼロ、虚部が NaN の複素数です。``complex(0.0, float('nan'))`` と等価で" "す。" -#: ../../library/cmath.rst:356 +#: ../../library/cmath.rst:296 msgid "" "Note that the selection of functions is similar, but not identical, to that " "in module :mod:`math`. The reason for having two modules is that some users " @@ -649,7 +411,7 @@ msgstr "" "可能な場合 (虚数部がゼロの複素数) でも、常に複素数を返すので注意してくださ" "い。" -#: ../../library/cmath.rst:364 +#: ../../library/cmath.rst:304 msgid "" "A note on branch cuts: They are curves along which the given function fails " "to be continuous. They are a necessary feature of many complex functions. " @@ -666,7 +428,7 @@ msgstr "" "ひもといてください。数値計算を目的とした分枝切断の正しい選択方法についての情" "報としては、以下がよい参考文献となります:" -#: ../../library/cmath.rst:374 +#: ../../library/cmath.rst:314 msgid "" "Kahan, W: Branch cuts for complex elementary functions; or, Much ado about " "nothing's sign bit. In Iserles, A., and Powell, M. (eds.), The state of the " @@ -675,11 +437,3 @@ msgstr "" "Kahan, W: Branch cuts for complex elementary functions; or, Much ado about " "nothings's sign bit. In Iserles, A., and Powell, M. (eds.), The state of " "the art in numerical analysis. Clarendon Press (1987) pp165--211." - -#: ../../library/cmath.rst:354 -msgid "module" -msgstr "module" - -#: ../../library/cmath.rst:354 -msgid "math" -msgstr "math" diff --git a/library/cmd.po b/library/cmd.po index 19400ee73..bad6c04f9 100644 --- a/library/cmd.po +++ b/library/cmd.po @@ -1,33 +1,34 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 -# Takeshi Nakazato, 2023 -# Arihiro TAKASE, 2023 -# 石井明久, 2024 +# E. Kawashima, 2017 +# 秘湯 , 2017 +# Arihiro TAKASE, 2017 +# Osamu NAKAMURA, 2017 +# tomo, 2018 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-13 14:21+0000\n" -"PO-Revision-Date: 2021-06-28 00:56+0000\n" -"Last-Translator: 石井明久, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 23:02+0000\n" +"Last-Translator: tomo, 2018\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/cmd.rst:2 -msgid ":mod:`!cmd` --- Support for line-oriented command interpreters" -msgstr ":mod:`!cmd` --- 行指向のコマンドインタープリターのサポート" +msgid ":mod:`cmd` --- Support for line-oriented command interpreters" +msgstr ":mod:`cmd` --- 行指向のコマンドインタープリタのサポート" #: ../../library/cmd.rst:9 msgid "**Source code:** :source:`Lib/cmd.py`" @@ -72,15 +73,6 @@ msgstr "" #: ../../library/cmd.rst:29 msgid "" -"The default, ``'tab'``, is treated specially, so that it refers to the :kbd:" -"`Tab` key on every :data:`readline.backend`. Specifically, if :data:" -"`readline.backend` is ``editline``, ``Cmd`` will use ``'^I'`` instead of " -"``'tab'``. Note that other values are not treated this way, and might only " -"work with a specific backend." -msgstr "" - -#: ../../library/cmd.rst:36 -msgid "" "The optional arguments *stdin* and *stdout* specify the input and output " "file objects that the Cmd instance or subclass instance will use for input " "and output. If not specified, they will default to :data:`sys.stdin` and :" @@ -90,7 +82,7 @@ msgstr "" "ンスが入出力に使用するファイルオブジェクトを指定します。省略時には :data:" "`sys.stdin` と :data:`sys.stdout` が使用されます。" -#: ../../library/cmd.rst:41 +#: ../../library/cmd.rst:34 msgid "" "If you want a given *stdin* to be used, make sure to set the instance's :" "attr:`use_rawinput` attribute to ``False``, otherwise *stdin* will be " @@ -99,19 +91,15 @@ msgstr "" "引数に渡した *stdin* を使いたい場合は、インスタンスの :attr:`use_rawinput` 属" "性を ``False`` にセットしてください。そうしないと *stdin* は無視されます。" -#: ../../library/cmd.rst:45 -msgid "``completekey='tab'`` is replaced by ``'^I'`` for ``editline``." -msgstr "" - -#: ../../library/cmd.rst:52 +#: ../../library/cmd.rst:42 msgid "Cmd Objects" msgstr "Cmdオブジェクト" -#: ../../library/cmd.rst:54 +#: ../../library/cmd.rst:44 msgid "A :class:`Cmd` instance has the following methods:" msgstr ":class:`Cmd` インスタンスは、次のメソッドを持ちます:" -#: ../../library/cmd.rst:59 +#: ../../library/cmd.rst:49 msgid "" "Repeatedly issue a prompt, accept input, parse an initial prefix off the " "received input, and dispatch to action methods, passing them the remainder " @@ -121,7 +109,7 @@ msgstr "" "の語を解析し、その行の残りを引数としてアクションメソッドへディスパッチしま" "す。" -#: ../../library/cmd.rst:63 +#: ../../library/cmd.rst:53 msgid "" "The optional argument is a banner or intro string to be issued before the " "first prompt (this overrides the :attr:`intro` class attribute)." @@ -129,7 +117,7 @@ msgstr "" "オプションの引数は、最初のプロンプトの前に表示されるバナーあるいはイントロ用" "の文字列です (これはクラス属性 :attr:`intro` をオーバーライドします)。" -#: ../../library/cmd.rst:66 +#: ../../library/cmd.rst:56 msgid "" "If the :mod:`readline` module is loaded, input will automatically inherit :" "program:`bash`\\ -like history-list editing (e.g. :kbd:`Control-P` scrolls " @@ -143,61 +131,91 @@ msgstr "" "kbd:`Control-F` はカーソルを右へ非破壊的に進める、 :kbd:`Control-B` はカーソ" "ルを非破壊的に左へ移動させる等)。" -#: ../../library/cmd.rst:72 +#: ../../library/cmd.rst:62 msgid "An end-of-file on input is passed back as the string ``'EOF'``." msgstr "入力のファイル終端は、文字列 ``'EOF'`` として渡されます。" -#: ../../library/cmd.rst:78 +#: ../../library/cmd.rst:68 msgid "" "An interpreter instance will recognize a command name ``foo`` if and only if " -"it has a method :meth:`!do_foo`. As a special case, a line beginning with " +"it has a method :meth:`do_foo`. As a special case, a line beginning with " "the character ``'?'`` is dispatched to the method :meth:`do_help`. As " "another special case, a line beginning with the character ``'!'`` is " -"dispatched to the method :meth:`!do_shell` (if such a method is defined)." +"dispatched to the method :meth:`do_shell` (if such a method is defined)." msgstr "" +"メソッド :meth:`do_foo` を持っている場合に限って、インタープリタのインスタン" +"スはコマンド名 ``foo`` を認識します。特別な場合として、文字 ``'?'`` で始まる" +"行はメソッド :meth:`do_help` へディスパッチします。他の特別な場合として、文" +"字 ``'!'`` で始まる行はメソッド :meth:`do_shell` へディスパッチします(このよ" +"うなメソッドが定義されている場合)。" -#: ../../library/cmd.rst:84 +#: ../../library/cmd.rst:74 msgid "" "This method will return when the :meth:`postcmd` method returns a true " "value. The *stop* argument to :meth:`postcmd` is the return value from the " -"command's corresponding :meth:`!do_\\*` method." +"command's corresponding :meth:`do_\\*` method." msgstr "" +"このメソッドは :meth:`postcmd` メソッドが真を返したときに return します。 :" +"meth:`postcmd` に対する *stop* 引数は、このコマンドが対応する :meth:`do_\\*` " +"メソッドからの返り値です。" -#: ../../library/cmd.rst:88 +#: ../../library/cmd.rst:78 msgid "" "If completion is enabled, completing commands will be done automatically, " -"and completing of commands args is done by calling :meth:`!complete_foo` " -"with arguments *text*, *line*, *begidx*, and *endidx*. *text* is the string " +"and completing of commands args is done by calling :meth:`complete_foo` with " +"arguments *text*, *line*, *begidx*, and *endidx*. *text* is the string " "prefix we are attempting to match: all returned matches must begin with it. " "*line* is the current input line with leading whitespace removed, *begidx* " "and *endidx* are the beginning and ending indexes of the prefix text, which " "could be used to provide different completion depending upon which position " "the argument is in." msgstr "" +"補完が有効になっているなら、コマンドの補完が自動的に行われます。また、コマン" +"ド引数の補完は、引数 *text*, *line*, *begidx*, および *endidx* と共に :meth:" +"`complete_foo` を呼び出すことによって行われます。 *text* は、マッチしようとし" +"ている文字列の先頭の語です。返されるマッチは全てそれで始まっていなければなり" +"ません。 *line* は始めの空白を除いた現在の入力行です。 *begidx* と *endidx* " +"は先頭のテキストの始まりと終わりのインデックスで、引数の位置に依存した異なる" +"補完を提供するのに使えます。" -#: ../../library/cmd.rst:99 +#: ../../library/cmd.rst:86 msgid "" -"All subclasses of :class:`Cmd` inherit a predefined :meth:`!do_help`. This " +"All subclasses of :class:`Cmd` inherit a predefined :meth:`do_help`. This " "method, called with an argument ``'bar'``, invokes the corresponding method :" -"meth:`!help_bar`, and if that is not present, prints the docstring of :meth:" -"`!do_bar`, if available. With no argument, :meth:`!do_help` lists all " -"available help topics (that is, all commands with corresponding :meth:`!" -"help_\\*` methods or commands that have docstrings), and also lists any " +"meth:`help_bar`, and if that is not present, prints the docstring of :meth:" +"`do_bar`, if available. With no argument, :meth:`do_help` lists all " +"available help topics (that is, all commands with corresponding :meth:" +"`help_\\*` methods or commands that have docstrings), and also lists any " "undocumented commands." msgstr "" +":class:`Cmd` のすべてのサブクラスは、定義済みの :meth:`do_help` を継承しま" +"す。このメソッドは、(引数 ``'bar'`` と共に呼ばれたとすると)対応するメソッド :" +"meth:`help_bar` を呼び出します。そのメソッドが存在しない場合、 :meth:" +"`do_bar` の docstring があればそれを表示します。引数がなければ、 :meth:" +"`do_help` は、すべての利用可能なヘルプ見出し(すなわち、対応する :meth:" +"`help_\\*` メソッドを持つすべてのコマンドまたは docstring を持つコマンド)をリ" +"ストアップします。また、文書化されていないコマンドでも、すべてリストアップし" +"ます。" -#: ../../library/cmd.rst:110 +#: ../../library/cmd.rst:97 msgid "" "Interpret the argument as though it had been typed in response to the " "prompt. This may be overridden, but should not normally need to be; see the :" "meth:`precmd` and :meth:`postcmd` methods for useful execution hooks. The " "return value is a flag indicating whether interpretation of commands by the " -"interpreter should stop. If there is a :meth:`!do_\\*` method for the " +"interpreter should stop. If there is a :meth:`do_\\*` method for the " "command *str*, the return value of that method is returned, otherwise the " "return value from the :meth:`default` method is returned." msgstr "" +"プロンプトに答えてタイプしたかのように引数を解釈実行します。これをオーバーラ" +"イドすることがあるかもしれませんが、通常は必要ないでしょう。便利な実行フック" +"については、 :meth:`precmd` と :meth:`postcmd` メソッドを参照してください。戻" +"り値は、インタープリタによるコマンドの解釈実行をやめるかどうかを示すフラグで" +"す。コマンド *str* に対応する :meth:`do_\\*` メソッドがある場合、そのメソッド" +"の返り値が返されます。そうでない場合は :meth:`default` メソッドからの返り値が" +"返されます。" -#: ../../library/cmd.rst:121 +#: ../../library/cmd.rst:108 msgid "" "Method called when an empty line is entered in response to the prompt. If " "this method is not overridden, it repeats the last nonempty command entered." @@ -206,7 +224,7 @@ msgstr "" "バーライドされていないなら、最後に入力された空行でないコマンドが繰り返されま" "す。" -#: ../../library/cmd.rst:127 +#: ../../library/cmd.rst:114 msgid "" "Method called on an input line when the command prefix is not recognized. If " "this method is not overridden, it prints an error message and returns." @@ -214,20 +232,15 @@ msgstr "" "コマンドの先頭の語が認識されないときに、入力行に対して呼び出されます。このメ" "ソッドがオーバーライドされていないなら、エラーメッセージを表示して戻ります。" -#: ../../library/cmd.rst:133 -msgid "" -"Method called to complete an input line when no command-specific :meth:`!" -"complete_\\*` method is available. By default, it returns an empty list." -msgstr "" - -#: ../../library/cmd.rst:139 +#: ../../library/cmd.rst:120 msgid "" -"Method called to display a list of strings as a compact set of columns. Each " -"column is only as wide as necessary. Columns are separated by two spaces for " -"readability." +"Method called to complete an input line when no command-specific :meth:" +"`complete_\\*` method is available. By default, it returns an empty list." msgstr "" +"利用可能なコマンド固有の :meth:`complete_\\*` が存在しないときに、入力行を補" +"完するために呼び出されるメソッド。デフォルトでは、空行を返します。" -#: ../../library/cmd.rst:146 +#: ../../library/cmd.rst:126 msgid "" "Hook method executed just before the command line *line* is interpreted, but " "after the input prompt is generated and issued. This method is a stub in :" @@ -243,7 +256,7 @@ msgstr "" "は、コマンドを書き換えるかもしれないし、あるいは単に変更していない *line* を" "返すかもしれません。" -#: ../../library/cmd.rst:156 +#: ../../library/cmd.rst:136 msgid "" "Hook method executed just after a command dispatch is finished. This method " "is a stub in :class:`Cmd`; it exists to be overridden by subclasses. *line* " @@ -260,7 +273,7 @@ msgstr "" "戻り値です。このメソッドの戻り値は、 *stop* に対応する内部フラグの新しい値と" "して使われます。偽を返すと、実行を続けます。" -#: ../../library/cmd.rst:167 +#: ../../library/cmd.rst:147 msgid "" "Hook method executed once when :meth:`cmdloop` is called. This method is a " "stub in :class:`Cmd`; it exists to be overridden by subclasses." @@ -269,7 +282,7 @@ msgstr "" "ソッドは :class:`Cmd` 内のスタブであって、サブクラスでオーバーライドされるた" "めに存在します。" -#: ../../library/cmd.rst:173 +#: ../../library/cmd.rst:153 msgid "" "Hook method executed once when :meth:`cmdloop` is about to return. This " "method is a stub in :class:`Cmd`; it exists to be overridden by subclasses." @@ -278,26 +291,26 @@ msgstr "" "は :class:`Cmd` 内のスタブであって、サブクラスでオーバーライドされるために存" "在します。" -#: ../../library/cmd.rst:177 +#: ../../library/cmd.rst:157 msgid "" "Instances of :class:`Cmd` subclasses have some public instance variables:" msgstr "" ":class:`Cmd` のサブクラスのインスタンスは、公開されたインスタンス変数をいくつ" "か持っています:" -#: ../../library/cmd.rst:181 +#: ../../library/cmd.rst:161 msgid "The prompt issued to solicit input." msgstr "入力を求めるために表示されるプロンプト。" -#: ../../library/cmd.rst:186 +#: ../../library/cmd.rst:166 msgid "The string of characters accepted for the command prefix." msgstr "コマンドの先頭の語として受け入れられる文字の文字列。" -#: ../../library/cmd.rst:191 +#: ../../library/cmd.rst:171 msgid "The last nonempty command prefix seen." msgstr "最後の空でないコマンド接頭辞。" -#: ../../library/cmd.rst:196 +#: ../../library/cmd.rst:176 msgid "" "A list of queued input lines. The cmdqueue list is checked in :meth:" "`cmdloop` when new input is needed; if it is nonempty, its elements will be " @@ -307,7 +320,7 @@ msgstr "" "meth:`cmdloop` 内でチェックされます; これが空でない場合、その要素は、あたかも" "プロンプトから入力されたかのように順に処理されます。" -#: ../../library/cmd.rst:203 +#: ../../library/cmd.rst:183 msgid "" "A string to issue as an intro or banner. May be overridden by giving the :" "meth:`cmdloop` method an argument." @@ -315,27 +328,32 @@ msgstr "" "イントロあるいはバナーとして表示される文字列。 :meth:`cmdloop` メソッドに引数" "を与えるために、オーバーライドされるかもしれません。" -#: ../../library/cmd.rst:209 +#: ../../library/cmd.rst:189 msgid "" "The header to issue if the help output has a section for documented commands." msgstr "" "ヘルプ出力に文書化されたコマンドのセクションがある場合に表示するヘッダ。" -#: ../../library/cmd.rst:214 +#: ../../library/cmd.rst:194 msgid "" "The header to issue if the help output has a section for miscellaneous help " -"topics (that is, there are :meth:`!help_\\*` methods without corresponding :" -"meth:`!do_\\*` methods)." +"topics (that is, there are :meth:`help_\\*` methods without corresponding :" +"meth:`do_\\*` methods)." msgstr "" +"ヘルプの出力にその他のヘルプ見出しがある(すなわち、 :meth:`do_\\*` メソッドに" +"対応していない :meth:`help_\\*` メソッドが存在する)場合に表示するヘッダ。" -#: ../../library/cmd.rst:221 +#: ../../library/cmd.rst:201 msgid "" "The header to issue if the help output has a section for undocumented " -"commands (that is, there are :meth:`!do_\\*` methods without corresponding :" -"meth:`!help_\\*` methods)." +"commands (that is, there are :meth:`do_\\*` methods without corresponding :" +"meth:`help_\\*` methods)." msgstr "" +"ヘルプ出力に文書化されていないコマンドのセクションがある(すなわち、対応する :" +"meth:`help_\\*` メソッドを持たない :meth:`do_\\*` メソッドが存在する)場合に表" +"示するヘッダ。" -#: ../../library/cmd.rst:228 +#: ../../library/cmd.rst:208 msgid "" "The character used to draw separator lines under the help-message headers. " "If empty, no ruler line is drawn. It defaults to ``'='``." @@ -343,21 +361,27 @@ msgstr "" "ヘルプメッセージのヘッダの下に、区切り行を表示するために使われる文字。空のと" "きは、ルーラ行が表示されません。デフォルトでは、``'='`` です。" -#: ../../library/cmd.rst:234 +#: ../../library/cmd.rst:214 msgid "" "A flag, defaulting to true. If true, :meth:`cmdloop` uses :func:`input` to " -"display a prompt and read the next command; if false, :data:`sys.stdout." -"write() ` and :data:`sys.stdin.readline() ` are used. " -"(This means that by importing :mod:`readline`, on systems that support it, " -"the interpreter will automatically support :program:`Emacs`\\ -like line " -"editing and command-history keystrokes.)" -msgstr "" - -#: ../../library/cmd.rst:244 +"display a prompt and read the next command; if false, :meth:`sys.stdout." +"write` and :meth:`sys.stdin.readline` are used. (This means that by " +"importing :mod:`readline`, on systems that support it, the interpreter will " +"automatically support :program:`Emacs`\\ -like line editing and command-" +"history keystrokes.)" +msgstr "" +"フラグで、デフォルトでは真です。真ならば、 :meth:`cmdloop` はプロンプトを表示" +"して次のコマンド読み込むために :func:`input` を使います。偽ならば、 :meth:" +"`sys.stdout.write` と :meth:`sys.stdin.readline` が使われます。 (これが意味す" +"るのは、 :mod:`readline` を import することによって、それをサポートするシステ" +"ム上では、インタープリタが自動的に :program:`Emacs` 形式の行編集とコマンド履" +"歴のキーストロークをサポートするということです。)" + +#: ../../library/cmd.rst:224 msgid "Cmd Example" msgstr "Cmd の例" -#: ../../library/cmd.rst:248 +#: ../../library/cmd.rst:228 msgid "" "The :mod:`cmd` module is mainly useful for building custom shells that let a " "user work with a program interactively." @@ -365,7 +389,7 @@ msgstr "" ":mod:`cmd` モジュールは、ユーザーがプログラムと対話的に連携できるカスタムシェ" "ルを構築するのに主に役立ちます。" -#: ../../library/cmd.rst:251 +#: ../../library/cmd.rst:231 msgid "" "This section presents a simple example of how to build a shell around a few " "of the commands in the :mod:`turtle` module." @@ -373,104 +397,34 @@ msgstr "" "この節では、:mod:`turtle` モジュールのいくつかのコマンドを持ったシェルの作成" "方法の簡単な例を示します。" -#: ../../library/cmd.rst:254 +#: ../../library/cmd.rst:234 msgid "" "Basic turtle commands such as :meth:`~turtle.forward` are added to a :class:" -"`Cmd` subclass with method named :meth:`!do_forward`. The argument is " +"`Cmd` subclass with method named :meth:`do_forward`. The argument is " "converted to a number and dispatched to the turtle module. The docstring is " "used in the help utility provided by the shell." msgstr "" +":meth:`~turtle.forward` のような基本的な turtle コマンドは\n" +":class:`Cmd` のサブクラスに :meth:`do_forward` と名付けられたメソッドで追加さ" +"れます。\n" +"引数は数値に変換され、 turtle モジュールに振り分けられます。ドキュメント文字" +"列はシェルによって提供されるヘルプユーティリティで使用されます。" -#: ../../library/cmd.rst:259 +#: ../../library/cmd.rst:239 msgid "" "The example also includes a basic record and playback facility implemented " "with the :meth:`~Cmd.precmd` method which is responsible for converting the " -"input to lowercase and writing the commands to a file. The :meth:`!" -"do_playback` method reads the file and adds the recorded commands to the :" -"attr:`~Cmd.cmdqueue` for immediate playback::" -msgstr "" - -#: ../../library/cmd.rst:265 -msgid "" -"import cmd, sys\n" -"from turtle import *\n" -"\n" -"class TurtleShell(cmd.Cmd):\n" -" intro = 'Welcome to the turtle shell. Type help or ? to list commands." -"\\n'\n" -" prompt = '(turtle) '\n" -" file = None\n" -"\n" -" # ----- basic turtle commands -----\n" -" def do_forward(self, arg):\n" -" 'Move the turtle forward by the specified distance: FORWARD 10'\n" -" forward(*parse(arg))\n" -" def do_right(self, arg):\n" -" 'Turn turtle right by given number of degrees: RIGHT 20'\n" -" right(*parse(arg))\n" -" def do_left(self, arg):\n" -" 'Turn turtle left by given number of degrees: LEFT 90'\n" -" left(*parse(arg))\n" -" def do_goto(self, arg):\n" -" 'Move turtle to an absolute position with changing orientation. " -"GOTO 100 200'\n" -" goto(*parse(arg))\n" -" def do_home(self, arg):\n" -" 'Return turtle to the home position: HOME'\n" -" home()\n" -" def do_circle(self, arg):\n" -" 'Draw circle with given radius an options extent and steps: CIRCLE " -"50'\n" -" circle(*parse(arg))\n" -" def do_position(self, arg):\n" -" 'Print the current turtle position: POSITION'\n" -" print('Current position is %d %d\\n' % position())\n" -" def do_heading(self, arg):\n" -" 'Print the current turtle heading in degrees: HEADING'\n" -" print('Current heading is %d\\n' % (heading(),))\n" -" def do_color(self, arg):\n" -" 'Set the color: COLOR BLUE'\n" -" color(arg.lower())\n" -" def do_undo(self, arg):\n" -" 'Undo (repeatedly) the last turtle action(s): UNDO'\n" -" def do_reset(self, arg):\n" -" 'Clear the screen and return turtle to center: RESET'\n" -" reset()\n" -" def do_bye(self, arg):\n" -" 'Stop recording, close the turtle window, and exit: BYE'\n" -" print('Thank you for using Turtle')\n" -" self.close()\n" -" bye()\n" -" return True\n" -"\n" -" # ----- record and playback -----\n" -" def do_record(self, arg):\n" -" 'Save future commands to filename: RECORD rose.cmd'\n" -" self.file = open(arg, 'w')\n" -" def do_playback(self, arg):\n" -" 'Playback commands from a file: PLAYBACK rose.cmd'\n" -" self.close()\n" -" with open(arg) as f:\n" -" self.cmdqueue.extend(f.read().splitlines())\n" -" def precmd(self, line):\n" -" line = line.lower()\n" -" if self.file and 'playback' not in line:\n" -" print(line, file=self.file)\n" -" return line\n" -" def close(self):\n" -" if self.file:\n" -" self.file.close()\n" -" self.file = None\n" -"\n" -"def parse(arg):\n" -" 'Convert a series of zero or more numbers to an argument tuple'\n" -" return tuple(map(int, arg.split()))\n" -"\n" -"if __name__ == '__main__':\n" -" TurtleShell().cmdloop()" -msgstr "" - -#: ../../library/cmd.rst:340 +"input to lowercase and writing the commands to a file. The :meth:" +"`do_playback` method reads the file and adds the recorded commands to the :" +"attr:`cmdqueue` for immediate playback::" +msgstr "" +"この例には、基本的な記録機能と再実行機能が含まれていて、入力を小文字に変換し" +"コマンドをファイルに書き込む責務を持たせた :meth:`~Cmd.precmd` メソッドに実装" +"されています。\n" +":meth:`do_playback` メソッドはファイルを読み込み、そこに記録されているコマン" +"ドをすぐに再実行するために :attr:`cmdqueue` に追加します::" + +#: ../../library/cmd.rst:320 msgid "" "Here is a sample session with the turtle shell showing the help functions, " "using blank lines to repeat commands, and the simple record and playback " @@ -478,76 +432,3 @@ msgid "" msgstr "" "以下は、turtle シェルでの機能のヘルプ表示、空行によるコマンドの繰り返し、単純" "な記録と再実行のセッション例です:" - -#: ../../library/cmd.rst:343 -msgid "" -"Welcome to the turtle shell. Type help or ? to list commands.\n" -"\n" -"(turtle) ?\n" -"\n" -"Documented commands (type help ):\n" -"========================================\n" -"bye color goto home playback record right\n" -"circle forward heading left position reset undo\n" -"\n" -"(turtle) help forward\n" -"Move the turtle forward by the specified distance: FORWARD 10\n" -"(turtle) record spiral.cmd\n" -"(turtle) position\n" -"Current position is 0 0\n" -"\n" -"(turtle) heading\n" -"Current heading is 0\n" -"\n" -"(turtle) reset\n" -"(turtle) circle 20\n" -"(turtle) right 30\n" -"(turtle) circle 40\n" -"(turtle) right 30\n" -"(turtle) circle 60\n" -"(turtle) right 30\n" -"(turtle) circle 80\n" -"(turtle) right 30\n" -"(turtle) circle 100\n" -"(turtle) right 30\n" -"(turtle) circle 120\n" -"(turtle) right 30\n" -"(turtle) circle 120\n" -"(turtle) heading\n" -"Current heading is 180\n" -"\n" -"(turtle) forward 100\n" -"(turtle)\n" -"(turtle) right 90\n" -"(turtle) forward 100\n" -"(turtle)\n" -"(turtle) right 90\n" -"(turtle) forward 400\n" -"(turtle) right 90\n" -"(turtle) forward 500\n" -"(turtle) right 90\n" -"(turtle) forward 400\n" -"(turtle) right 90\n" -"(turtle) forward 300\n" -"(turtle) playback spiral.cmd\n" -"Current position is 0 0\n" -"\n" -"Current heading is 0\n" -"\n" -"Current heading is 180\n" -"\n" -"(turtle) bye\n" -"Thank you for using Turtle" -msgstr "" - -#: ../../library/cmd.rst:74 -msgid "? (question mark)" -msgstr "? (クエスチョンマーク)" - -#: ../../library/cmd.rst:74 -msgid "in a command interpreter" -msgstr "" - -#: ../../library/cmd.rst:74 -msgid "! (exclamation)" -msgstr "! (エクスクラメーション)" diff --git a/library/cmdline.po b/library/cmdline.po deleted file mode 100644 index 3ac9777a9..000000000 --- a/library/cmdline.po +++ /dev/null @@ -1,238 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation -# This file is distributed under the same license as the Python package. -# FIRST AUTHOR , YEAR. -# -# Translators: -# Taichi Haradaguchi, 2024 -# 石井明久, 2024 -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: Python 3.14\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2023-10-13 14:16+0000\n" -"Last-Translator: 石井明久, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" -"ja/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#: ../../library/cmdline.rst:5 -msgid "Modules command-line interface (CLI)" -msgstr "モジュールのコマンドラインインターフェース (CLI)" - -#: ../../library/cmdline.rst:7 -msgid "The following modules have a command-line interface." -msgstr "以下のモジュールにはコマンドラインインターフェースがあります。" - -#: ../../library/cmdline.rst:9 -msgid ":ref:`ast `" -msgstr ":ref:`ast `" - -#: ../../library/cmdline.rst:10 -msgid ":ref:`asyncio `" -msgstr ":ref:`asyncio `" - -#: ../../library/cmdline.rst:11 -msgid ":mod:`base64`" -msgstr ":mod:`base64`" - -#: ../../library/cmdline.rst:12 -msgid ":ref:`calendar `" -msgstr ":ref:`calendar `" - -#: ../../library/cmdline.rst:13 -msgid ":mod:`code`" -msgstr ":mod:`code`" - -#: ../../library/cmdline.rst:14 -msgid ":ref:`compileall `" -msgstr ":ref:`compileall `" - -#: ../../library/cmdline.rst:15 -msgid ":mod:`cProfile`: see :ref:`profile `" -msgstr ":mod:`cProfile`: :ref:`profile ` を参照" - -#: ../../library/cmdline.rst:16 -msgid ":ref:`dis `" -msgstr ":ref:`dis `" - -#: ../../library/cmdline.rst:17 -msgid ":ref:`doctest `" -msgstr "" - -#: ../../library/cmdline.rst:18 -msgid ":mod:`!encodings.rot_13`" -msgstr ":mod:`!encodings.rot_13`" - -#: ../../library/cmdline.rst:19 -msgid ":mod:`ensurepip`" -msgstr ":mod:`ensurepip`" - -#: ../../library/cmdline.rst:20 -msgid ":mod:`filecmp`" -msgstr ":mod:`filecmp`" - -#: ../../library/cmdline.rst:21 -msgid ":mod:`fileinput`" -msgstr ":mod:`fileinput`" - -#: ../../library/cmdline.rst:22 -msgid ":mod:`ftplib`" -msgstr ":mod:`ftplib`" - -#: ../../library/cmdline.rst:23 -msgid ":ref:`gzip `" -msgstr ":ref:`gzip `" - -#: ../../library/cmdline.rst:24 -msgid ":ref:`http.server `" -msgstr ":ref:`http.server `" - -#: ../../library/cmdline.rst:25 -msgid ":mod:`!idlelib`" -msgstr ":mod:`!idlelib`" - -#: ../../library/cmdline.rst:26 -msgid ":ref:`inspect `" -msgstr ":ref:`inspect `" - -#: ../../library/cmdline.rst:27 -msgid ":ref:`json `" -msgstr "" - -#: ../../library/cmdline.rst:28 -msgid ":ref:`mimetypes `" -msgstr "" - -#: ../../library/cmdline.rst:29 -msgid ":mod:`pdb`" -msgstr ":mod:`pdb`" - -#: ../../library/cmdline.rst:30 -msgid ":ref:`pickle `" -msgstr "" - -#: ../../library/cmdline.rst:31 -msgid ":ref:`pickletools `" -msgstr ":ref:`pickletools `" - -#: ../../library/cmdline.rst:32 -msgid ":ref:`platform `" -msgstr "" - -#: ../../library/cmdline.rst:33 -msgid ":mod:`poplib`" -msgstr ":mod:`poplib`" - -#: ../../library/cmdline.rst:34 -msgid ":ref:`profile `" -msgstr ":ref:`profile `" - -#: ../../library/cmdline.rst:35 -msgid ":mod:`pstats`" -msgstr ":mod:`pstats`" - -#: ../../library/cmdline.rst:36 -msgid ":ref:`py_compile `" -msgstr ":ref:`py_compile `" - -#: ../../library/cmdline.rst:37 -msgid ":mod:`pyclbr`" -msgstr ":mod:`pyclbr`" - -#: ../../library/cmdline.rst:38 -msgid ":mod:`pydoc`" -msgstr ":mod:`pydoc`" - -#: ../../library/cmdline.rst:39 -msgid ":mod:`quopri`" -msgstr ":mod:`quopri`" - -#: ../../library/cmdline.rst:40 -msgid ":ref:`random `" -msgstr ":ref:`random `" - -#: ../../library/cmdline.rst:41 -msgid ":mod:`runpy`" -msgstr ":mod:`runpy`" - -#: ../../library/cmdline.rst:42 -msgid ":ref:`site `" -msgstr ":ref:`site `" - -#: ../../library/cmdline.rst:43 -msgid ":ref:`sqlite3 `" -msgstr ":ref:`sqlite3 `" - -#: ../../library/cmdline.rst:44 -msgid ":ref:`symtable `" -msgstr "" - -#: ../../library/cmdline.rst:45 -msgid ":ref:`sysconfig `" -msgstr ":ref:`sysconfig `" - -#: ../../library/cmdline.rst:46 -msgid ":mod:`tabnanny`" -msgstr ":mod:`tabnanny`" - -#: ../../library/cmdline.rst:47 -msgid ":ref:`tarfile `" -msgstr ":ref:`tarfile `" - -#: ../../library/cmdline.rst:48 -msgid ":mod:`!this`" -msgstr ":mod:`!this`" - -#: ../../library/cmdline.rst:49 -msgid ":ref:`timeit `" -msgstr ":ref:`timeit `" - -#: ../../library/cmdline.rst:50 -msgid ":ref:`tokenize `" -msgstr ":ref:`tokenize `" - -#: ../../library/cmdline.rst:51 -msgid ":ref:`trace `" -msgstr ":ref:`trace `" - -#: ../../library/cmdline.rst:52 -msgid ":mod:`turtledemo`" -msgstr ":mod:`turtledemo`" - -#: ../../library/cmdline.rst:53 -msgid ":ref:`unittest `" -msgstr ":ref:`unittest `" - -#: ../../library/cmdline.rst:54 -msgid ":ref:`uuid `" -msgstr ":ref:`uuid `" - -#: ../../library/cmdline.rst:55 -msgid ":mod:`venv`" -msgstr ":mod:`venv`" - -#: ../../library/cmdline.rst:56 -msgid ":mod:`webbrowser`" -msgstr ":mod:`webbrowser`" - -#: ../../library/cmdline.rst:57 -msgid ":ref:`zipapp `" -msgstr ":ref:`zipapp `" - -#: ../../library/cmdline.rst:58 -msgid ":ref:`zipfile `" -msgstr ":ref:`zipfile `" - -#: ../../library/cmdline.rst:60 -msgid "See also the :ref:`Python command-line interface `." -msgstr "" -":ref:`Python コマンドラインインターフェース ` も参照してく" -"ださい。" diff --git a/library/cmdlinelibs.po b/library/cmdlinelibs.po deleted file mode 100644 index 5018ef675..000000000 --- a/library/cmdlinelibs.po +++ /dev/null @@ -1,33 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 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.14\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-13 14:21+0000\n" -"PO-Revision-Date: 2024-12-27 14:18+0000\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" -"ja/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#: ../../library/cmdlinelibs.rst:5 -msgid "Command Line Interface Libraries" -msgstr "" - -#: ../../library/cmdlinelibs.rst:7 -msgid "" -"The modules described in this chapter assist with implementing command line " -"and terminal interfaces for applications." -msgstr "" - -#: ../../library/cmdlinelibs.rst:10 -msgid "Here's an overview:" -msgstr "" diff --git a/library/code.po b/library/code.po index 906e9d46e..453ed8711 100644 --- a/library/code.po +++ b/library/code.po @@ -1,32 +1,35 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 -# Tetsuo Koyama , 2021 -# 石井明久, 2024 +# Nozomu Kaneko , 2017 +# Yusuke Miyazaki , 2017 +# 秘湯 , 2017 +# Arihiro TAKASE, 2017 +# Osamu NAKAMURA, 2017 +# Tetsuo Koyama , 2020 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-06 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:56+0000\n" -"Last-Translator: 石井明久, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 23:02+0000\n" +"Last-Translator: Tetsuo Koyama , 2020\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/code.rst:2 -msgid ":mod:`!code` --- Interpreter base classes" -msgstr ":mod:`!code` --- インタープリター基底クラス" +msgid ":mod:`code` --- Interpreter base classes" +msgstr ":mod:`code` --- インタプリタ基底クラス" #: ../../library/code.rst:7 msgid "**Source code:** :source:`Lib/code.py`" @@ -47,71 +50,52 @@ msgid "" "This class deals with parsing and interpreter state (the user's namespace); " "it does not deal with input buffering or prompting or input file naming (the " "filename is always passed in explicitly). The optional *locals* argument " -"specifies a mapping to use as the namespace in which code will be executed; " -"it defaults to a newly created dictionary with key ``'__name__'`` set to " -"``'__console__'`` and key ``'__doc__'`` set to ``None``." -msgstr "" -"このクラスは構文解析とインタープリター状態(ユーザの名前空間)を取り扱います。" -"入力バッファリングやプロンプト出力、または入力ファイル指定を扱いません(ファイ" -"ル名は常に明示的に渡されます)。オプションの *locals* 引数はその中でコードが実" -"行される名前空間として使用されるマッピングを指定します。その初期値は、キー " -"``'__name__'`` が ``'__console__'`` に設定され、キー ``'__doc__'`` が " -"``None`` に設定された新しく作られた辞書です。" - -#: ../../library/code.rst:25 -msgid "" -"Note that functions and classes objects created under an :class:`!" -"InteractiveInterpreter` instance will belong to the namespace specified by " -"*locals*. They are only pickleable if *locals* is the namespace of an " -"existing module." +"specifies the dictionary in which code will be executed; it defaults to a " +"newly created dictionary with key ``'__name__'`` set to ``'__console__'`` " +"and key ``'__doc__'`` set to ``None``." msgstr "" - -#: ../../library/code.rst:34 +"このクラスは構文解析とインタプリタ状態(ユーザの名前空間)を取り扱います。入力" +"バッファリングやプロンプト出力、または入力ファイル指定を扱いません(ファイル名" +"は常に明示的に渡されます)。オプションの *locals* 引数はその中でコードが実行さ" +"れる辞書を指定します。その初期値は、キー ``'__name__'`` が ``'__console__'`` " +"に設定され、キー ``'__doc__'`` が ``None`` に設定された新しく作られた辞書で" +"す。" + +#: ../../library/code.rst:28 msgid "" "Closely emulate the behavior of the interactive Python interpreter. This " "class builds on :class:`InteractiveInterpreter` and adds prompting using the " -"familiar ``sys.ps1`` and ``sys.ps2``, and input buffering. If *local_exit* " -"is true, ``exit()`` and ``quit()`` in the console will not raise :exc:" -"`SystemExit`, but instead return to the calling code." +"familiar ``sys.ps1`` and ``sys.ps2``, and input buffering." msgstr "" -"Python の対話型インタープリターの振る舞いを忠実にエミュレートします。このクラ" -"スは :class:`InteractiveInterpreter` を継承しており、よく知られた ``sys." -"ps1`` と ``sys.ps2`` を使用してプロンプトと入力バッファリングを追加します。 " -"*local_exit* が真の場合、コンソールでの ``exit()`` と ``quit()`` は :exc:" -"`SystemExit` を送出せず、代わりに呼び出し元のコードに戻ります。" - -#: ../../library/code.rst:40 ../../library/code.rst:58 -msgid "Added *local_exit* parameter." -msgstr "*local_exit* 引数が追加されました。" +"対話的なPythonインタプリタの振る舞いを厳密にエミュレートします。このクラス" +"は :class:`InteractiveInterpreter` を元に作られていて、通常の ``sys.ps1`` と " +"``sys.ps2`` をつかったプロンプト出力と入力バッファリングが追加されています。" -#: ../../library/code.rst:45 +#: ../../library/code.rst:35 msgid "" "Convenience function to run a read-eval-print loop. This creates a new " "instance of :class:`InteractiveConsole` and sets *readfunc* to be used as " "the :meth:`InteractiveConsole.raw_input` method, if provided. If *local* is " "provided, it is passed to the :class:`InteractiveConsole` constructor for " -"use as the default namespace for the interpreter loop. If *local_exit* is " -"provided, it is passed to the :class:`InteractiveConsole` constructor. The :" -"meth:`~InteractiveConsole.interact` method of the instance is then run with " -"*banner* and *exitmsg* passed as the banner and exit message to use, if " -"provided. The console object is discarded after use." +"use as the default namespace for the interpreter loop. The :meth:`interact` " +"method of the instance is then run with *banner* and *exitmsg* passed as the " +"banner and exit message to use, if provided. The console object is " +"discarded after use." msgstr "" "read-eval-print ループを実行するための便利な関数。これは :class:" "`InteractiveConsole` の新しいインスタンスを作り、 *readfunc* が与えられた場合" "は :meth:`InteractiveConsole.raw_input` メソッドとして使われるように設定しま" -"す。 *local* が与えられた場合は、インタープリターループのデフォルト名前空間と" -"して使うために :class:`InteractiveConsole` コンストラクタへ渡されます。 " -"*local_exit* が与えられた場合は、 :class:`InteractiveConsole` コンストラクタ" -"へ渡されます。そして、インスタンスの :meth:`~InteractiveConsole.interact` メ" -"ソッドは、もし提供されていれば、見出しと終了メッセージして使うために " -"*banner* と *exitmsg* を受け取り実行されます。コンソールオブジェクトは使われ" -"た後捨てられます。" +"す。 *local* が与えられた場合は、インタプリタループのデフォルト名前空間として" +"使うために :class:`InteractiveConsole` コンストラクタへ渡されます。そして、イ" +"ンスタンスの :meth:`interact` メソッドは(もし提供されていれば)見出しと終了" +"メッセージして使うために *banner* と *exitmsg* を受け取り実行されます。コン" +"ソールオブジェクトは使われた後捨てられます。" -#: ../../library/code.rst:55 +#: ../../library/code.rst:44 msgid "Added *exitmsg* parameter." msgstr "*exitmsg* 引数が追加されました." -#: ../../library/code.rst:63 +#: ../../library/code.rst:50 msgid "" "This function is useful for programs that want to emulate Python's " "interpreter main loop (a.k.a. the read-eval-print loop). The tricky part is " @@ -126,7 +110,7 @@ msgstr "" "うる不完全なコマンドを入力したときを決定することです。この関数は *ほとんど* " "の場合に実際のインタプリタメインループと同じ決定を行います。" -#: ../../library/code.rst:70 +#: ../../library/code.rst:57 msgid "" "*source* is the source string; *filename* is the optional filename from " "which source was read, defaulting to ``''``; and *symbol* is the " @@ -138,7 +122,7 @@ msgstr "" "開始記号で、``'single'`` (デフォルト)または ``'eval'`` か ``'exec'`` にすべき" "です。" -#: ../../library/code.rst:75 +#: ../../library/code.rst:62 msgid "" "Returns a code object (the same as ``compile(source, filename, symbol)``) if " "the command is complete and valid; ``None`` if the command is incomplete; " @@ -152,11 +136,11 @@ msgstr "" "す。または、コマンドが無効なリテラルを含む場合は、 :exc:`OverflowError` もし" "くは :exc:`ValueError` を発生させます。" -#: ../../library/code.rst:85 +#: ../../library/code.rst:72 msgid "Interactive Interpreter Objects" msgstr "対話的なインタプリタオブジェクト" -#: ../../library/code.rst:90 +#: ../../library/code.rst:77 msgid "" "Compile and run some source in the interpreter. Arguments are the same as " "for :func:`compile_command`; the default for *filename* is ``''``, " @@ -167,7 +151,7 @@ msgstr "" "で、 *symbol* は ``'single'`` です。あるいくつかのことが起きる可能性がありま" "す:" -#: ../../library/code.rst:94 +#: ../../library/code.rst:81 msgid "" "The input is incorrect; :func:`compile_command` raised an exception (:exc:" "`SyntaxError` or :exc:`OverflowError`). A syntax traceback will be printed " @@ -179,7 +163,7 @@ msgstr "" "よって、構文トレースバックが表示されるでしょう。 :meth:`runsource` は " "``False`` を返します。" -#: ../../library/code.rst:99 +#: ../../library/code.rst:86 msgid "" "The input is incomplete, and more input is required; :func:`compile_command` " "returned ``None``. :meth:`runsource` returns ``True``." @@ -187,7 +171,7 @@ msgstr "" "入力が完全でなく、さらに入力が必要。 :func:`compile_command` が ``None`` を返" "した場合。 :meth:`runsource` は ``True`` を返します。" -#: ../../library/code.rst:102 +#: ../../library/code.rst:89 msgid "" "The input is complete; :func:`compile_command` returned a code object. The " "code is executed by calling the :meth:`runcode` (which also handles run-time " @@ -198,7 +182,7 @@ msgstr "" "exc:`SystemExit` を除く実行時例外も処理する) :meth:`runcode` を呼び出すことに" "よって、コードは実行されます。 :meth:`runsource` は ``False`` を返します。" -#: ../../library/code.rst:106 +#: ../../library/code.rst:93 msgid "" "The return value can be used to decide whether to use ``sys.ps1`` or ``sys." "ps2`` to prompt the next line." @@ -206,7 +190,7 @@ msgstr "" "戻り値は、次の行のプロンプトに ``sys.ps1`` か ``sys.ps2`` のどちらを使うのか" "判断するために使えます。" -#: ../../library/code.rst:112 +#: ../../library/code.rst:99 msgid "" "Execute a code object. When an exception occurs, :meth:`showtraceback` is " "called to display a traceback. All exceptions are caught except :exc:" @@ -216,7 +200,7 @@ msgstr "" "ために :meth:`showtraceback` が呼び出されます。伝搬することが許されている :" "exc:`SystemExit` を除くすべての例外が捉えられます。" -#: ../../library/code.rst:116 +#: ../../library/code.rst:103 msgid "" "A note about :exc:`KeyboardInterrupt`: this exception may occur elsewhere in " "this code, and may not always be caught. The caller should be prepared to " @@ -226,7 +210,7 @@ msgstr "" "る可能性がありますし、常に捕らえることができるとは限りません。呼び出し側はそ" "れを処理するために準備しておくべきです。" -#: ../../library/code.rst:123 +#: ../../library/code.rst:110 msgid "" "Display the syntax error that just occurred. This does not display a stack " "trace because there isn't one for syntax errors. If *filename* is given, it " @@ -240,7 +224,7 @@ msgstr "" "ます。なぜなら、文字列から読み込んでいるときはパーサは常に ``''`` を" "使うからです。出力は :meth:`write` メソッドによって書き込まれます。" -#: ../../library/code.rst:132 +#: ../../library/code.rst:119 msgid "" "Display the exception that just occurred. We remove the first stack item " "because it is within the interpreter object implementation. The output is " @@ -250,14 +234,14 @@ msgstr "" "ら、それはインタプリタオブジェクトの実装の内部にあるからです。出力は :meth:" "`write` メソッドによって書き込まれます。" -#: ../../library/code.rst:136 +#: ../../library/code.rst:123 msgid "" "The full chained traceback is displayed instead of just the primary " "traceback." msgstr "" "最初のトレースバックではなく、完全なトレースバックの連鎖が表示されます。" -#: ../../library/code.rst:142 +#: ../../library/code.rst:129 msgid "" "Write a string to the standard error stream (``sys.stderr``). Derived " "classes should override this to provide the appropriate output handling as " @@ -266,11 +250,11 @@ msgstr "" "文字列を標準エラーストリーム(``sys.stderr``)へ書き込みます。必要に応じて適切" "な出力処理を提供するために、派生クラスはこれをオーバーライドすべきです。" -#: ../../library/code.rst:149 +#: ../../library/code.rst:136 msgid "Interactive Console Objects" msgstr "対話的なコンソールオブジェクト" -#: ../../library/code.rst:151 +#: ../../library/code.rst:138 msgid "" "The :class:`InteractiveConsole` class is a subclass of :class:" "`InteractiveInterpreter`, and so offers all the methods of the interpreter " @@ -280,7 +264,7 @@ msgstr "" "ラスです。以下の追加メソッドだけでなく、インタプリタオブジェクトのすべてのメ" "ソッドも提供します。" -#: ../../library/code.rst:158 +#: ../../library/code.rst:145 msgid "" "Closely emulate the interactive Python console. The optional *banner* " "argument specify the banner to print before the first interaction; by " @@ -295,7 +279,7 @@ msgstr "" "れに続けて、実際のインタプリタと混乱しないように (とても似ているから!) 括弧の" "中にコンソールオブジェクトのクラス名を表示します。" -#: ../../library/code.rst:164 +#: ../../library/code.rst:151 msgid "" "The optional *exitmsg* argument specifies an exit message printed when " "exiting. Pass the empty string to suppress the exit message. If *exitmsg* is " @@ -305,40 +289,40 @@ msgstr "" "空文字列を渡すと、出力メッセージを抑止します。もし、 *exitmsg* が与えられない" "か、``None`` の場合は、デフォルトのメッセージが出力されます。" -#: ../../library/code.rst:168 +#: ../../library/code.rst:155 msgid "To suppress printing any banner, pass an empty string." msgstr "バナーの表示を抑制するには、空の文字列を渡してください。" -#: ../../library/code.rst:171 +#: ../../library/code.rst:158 msgid "Print an exit message when exiting." msgstr "終了時に、終了メッセージを表示します。" -#: ../../library/code.rst:177 +#: ../../library/code.rst:164 msgid "" "Push a line of source text to the interpreter. The line should not have a " "trailing newline; it may have internal newlines. The line is appended to a " -"buffer and the interpreter's :meth:`~InteractiveInterpreter.runsource` " -"method is called with the concatenated contents of the buffer as source. If " -"this indicates that the command was executed or invalid, the buffer is " -"reset; otherwise, the command is incomplete, and the buffer is left as it " -"was after the line was appended. The return value is ``True`` if more input " -"is required, ``False`` if the line was dealt with in some way (this is the " -"same as :meth:`!runsource`)." +"buffer and the interpreter's :meth:`runsource` method is called with the " +"concatenated contents of the buffer as source. If this indicates that the " +"command was executed or invalid, the buffer is reset; otherwise, the command " +"is incomplete, and the buffer is left as it was after the line was " +"appended. The return value is ``True`` if more input is required, ``False`` " +"if the line was dealt with in some way (this is the same as :meth:" +"`runsource`)." msgstr "" -"ソーステキストの一行をインタープリターへ送ります。その行の末尾に改行がついて" -"いてはいけません。内部に改行を持っているかもしれません。その行はバッファへ追" -"加され、ソースとして連結されたバッファの内容が渡されインタープリターの :meth:" -"`~InteractiveInterpreter.runsource` メソッドが呼び出されます。コマンドが実行" -"されたか、有効であることをこれが示している場合は、バッファはリセットされま" -"す。そうでなければ、コマンドが不完全で、その行が付加された後のままバッファは" -"残されます。さらに入力が必要ならば、戻り値は ``True`` です。その行がある方法" -"で処理されたならば、 ``False`` です(これは :meth:`!runsource` と同じです)。" - -#: ../../library/code.rst:189 +"ソーステキストの一行をインタプリタへ送ります。その行の末尾に改行がついていて" +"はいけません。内部に改行を持っているかもしれません。その行はバッファへ追加さ" +"れ、ソースとして連結された内容が渡されインタプリタの :meth:`runsource` メソッ" +"ドが呼び出されます。コマンドが実行されたか、有効であることをこれが示している" +"場合は、バッファはリセットされます。そうでなければ、コマンドが不完全で、その" +"行が付加された後のままバッファは残されます。さらに入力が必要ならば、戻り値は " +"``True`` です。その行がある方法で処理されたならば、 ``False`` です(これは :" +"meth:`runsource` と同じです)。" + +#: ../../library/code.rst:176 msgid "Remove any unhandled source text from the input buffer." msgstr "入力バッファから処理されていないソーステキストを取り除きます。" -#: ../../library/code.rst:194 +#: ../../library/code.rst:181 msgid "" "Write a prompt and read a line. The returned line does not include the " "trailing newline. When the user enters the EOF key sequence, :exc:" diff --git a/library/codecs.po b/library/codecs.po index 65d7b78a6..78ce09edd 100644 --- a/library/codecs.po +++ b/library/codecs.po @@ -1,39 +1,40 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: +# mnamihdk, 2017 +# Yusuke Miyazaki , 2017 +# Nozomu Kaneko , 2017 +# Inada Naoki , 2017 +# Shun Sakurai, 2017 +# 秘湯 , 2017 +# Masato HASHIMOTO , 2017 +# Arihiro TAKASE, 2017 +# tomo, 2019 +# mollinaca, 2020 # Osamu NAKAMURA, 2021 -# mollinaca, 2021 -# Arihiro TAKASE, 2023 -# Nozomu Kaneko , 2023 -# tomo, 2023 -# Takeshi Nakazato, 2023 -# 秘湯 , 2023 -# Masato HASHIMOTO , 2023 -# Takanori Suzuki , 2023 -# 石井明久, 2024 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:56+0000\n" -"Last-Translator: 石井明久, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-04-28 06:12+0000\n" +"PO-Revision-Date: 2017-02-16 23:02+0000\n" +"Last-Translator: Osamu NAKAMURA, 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/codecs.rst:2 -msgid ":mod:`!codecs` --- Codec registry and base classes" -msgstr ":mod:`!codecs` --- codec レジストリと基底クラス" +msgid ":mod:`codecs` --- Codec registry and base classes" +msgstr ":mod:`codecs` --- codec レジストリと基底クラス" #: ../../library/codecs.rst:11 msgid "**Source code:** :source:`Lib/codecs.py`" @@ -44,21 +45,20 @@ msgid "" "This module defines base classes for standard Python codecs (encoders and " "decoders) and provides access to the internal Python codec registry, which " "manages the codec and error handling lookup process. Most standard codecs " -"are :term:`text encodings `, which encode text to bytes (and " -"decode bytes to text), but there are also codecs provided that encode text " -"to text, and bytes to bytes. Custom codecs may encode and decode between " -"arbitrary types, but some module features are restricted to be used " -"specifically with :term:`text encodings ` or with codecs that " -"encode to :class:`bytes`." +"are :term:`text encodings `, which encode text to bytes, but " +"there are also codecs provided that encode text to text, and bytes to bytes. " +"Custom codecs may encode and decode between arbitrary types, but some module " +"features are restricted to use specifically with :term:`text encodings `, or with codecs that encode to :class:`bytes`." msgstr "" "このモジュールは、標準的な Python codec (エンコーダとデコーダ) 用の基底クラス" "を定義し、codec とエラー処理検索プロセスを管理する内部の Python codec レジス" -"トリへのアクセスを提供します。多くの codec はテキストをバイトにエンコードす" -"る (そしてバイトをテキストにデコードする) :term:`テキストエンコーディング " -"` ですが、テキストをテキストに、またはバイトをバイトにエンコー" -"ドする codec も提供されています。カスタムの codec は任意の型間でエンコードと" -"デコードを行えますが、一部のモジュール機能は :term:`テキストエンコーディング " -"` か :class:`bytes` へのエンコードのみに制限されています。" +"トリへのアクセスを提供します。多くの codec はテキストをバイト形式にエンコード" +"する :term:`テキストエンコーディング ` ですが、テキストをテキ" +"ストに、またはバイトをバイトにエンコードする codec も提供されています。カスタ" +"ムの codec は任意の型間でエンコードとデコードを行えますが、一部のモジュール機" +"能は :term:`テキストエンコーディング ` か :class:`bytes` への" +"エンコードのみに制限されています。" #: ../../library/codecs.rst:33 msgid "" @@ -274,13 +274,15 @@ msgstr "" msgid "Hyphens and spaces are converted to underscore." msgstr "" -#: ../../library/codecs.rst:173 +#: ../../library/codecs.rst:172 msgid "" -"Unregister a codec search function and clear the registry's cache. If the " -"search function is not registered, do nothing." +"Search function registration is not currently reversible, which may cause " +"problems in some cases, such as unit testing or module reloading." msgstr "" +"現在、検索関数の登録は不可逆的です。このため、ユニットテストやモジュールの再" +"ロード時などに問題が生じることがあります。" -#: ../../library/codecs.rst:179 +#: ../../library/codecs.rst:176 msgid "" "While the builtin :func:`open` and the associated :mod:`io` module are the " "recommended approach for working with encoded text files, this module " @@ -292,7 +294,7 @@ msgstr "" "ジュールは追加のユーティリティ関数とクラスを提供し、バイナリファイルを処理す" "る場合に幅広い codecs を利用できるようにします。" -#: ../../library/codecs.rst:186 +#: ../../library/codecs.rst:183 msgid "" "Open an encoded file using the given *mode* and return an instance of :class:" "`StreamReaderWriter`, providing transparent encoding/decoding. The default " @@ -302,19 +304,19 @@ msgstr "" "提供する :class:`StreamReaderWriter` のインスタンスを返します。デフォルトの" "ファイルモードは ``'r'`` 、つまり、読み出しモードでファイルを開きます。" -#: ../../library/codecs.rst:192 +#: ../../library/codecs.rst:189 msgid "" -"If *encoding* is not ``None``, then the underlying encoded files are always " -"opened in binary mode. No automatic conversion of ``'\\n'`` is done on " -"reading and writing. The *mode* argument may be any binary mode acceptable " -"to the built-in :func:`open` function; the ``'b'`` is automatically added." +"Underlying encoded files are always opened in binary mode. No automatic " +"conversion of ``'\\n'`` is done on reading and writing. The *mode* argument " +"may be any binary mode acceptable to the built-in :func:`open` function; the " +"``'b'`` is automatically added." msgstr "" -"*encoding* が ``None`` でなければ、下層のエンコードされたファイルは、常にバイ" -"ナリモードで開きます。読み書き時に、 ``'\\n'`` の自動変換は行われません。" -"*mode* 引数は、組み込みの :func:`open` 関数が受け入れる任意のバイナリモードに" -"することができます。``'b'`` が自動的に付加されます。" +"下層のエンコードされたファイルは、常にバイナリモードで開きます。読み書き時" +"に、 ``'\\n'`` の自動変換は行われません。*mode* 引数は、組み込みの :func:" +"`open` 関数が受け入れる任意のバイナリモードにすることができます。``'b'`` が自" +"動的に付加されます。" -#: ../../library/codecs.rst:198 +#: ../../library/codecs.rst:194 msgid "" "*encoding* specifies the encoding which is to be used for the file. Any " "encoding that encodes to and decodes from bytes is allowed, and the data " @@ -325,7 +327,7 @@ msgstr "" "が許可されます。ファイルメソッドがサポートするデータ型は、使用される codec に" "よって異なります。" -#: ../../library/codecs.rst:202 +#: ../../library/codecs.rst:198 msgid "" "*errors* may be given to define the error handling. It defaults to " "``'strict'`` which causes a :exc:`ValueError` to be raised in case an " @@ -335,21 +337,13 @@ msgstr "" "は ``'strict'`` で、エンコード時にエラーがあれば :exc:`ValueError` を送出しま" "す。" -#: ../../library/codecs.rst:205 +#: ../../library/codecs.rst:201 msgid "" "*buffering* has the same meaning as for the built-in :func:`open` function. " "It defaults to -1 which means that the default buffer size will be used." msgstr "" -#: ../../library/codecs.rst:208 -msgid "The ``'U'`` mode has been removed." -msgstr "``'U'`` モードは削除されました。" - -#: ../../library/codecs.rst:213 -msgid ":func:`codecs.open` has been superseded by :func:`open`." -msgstr "" - -#: ../../library/codecs.rst:218 +#: ../../library/codecs.rst:207 msgid "" "Return a :class:`StreamRecoder` instance, a wrapped version of *file* which " "provides transparent transcoding. The original file is closed when the " @@ -359,7 +353,7 @@ msgstr "" "`StreamRecoder` インスタンスを返します。元のファイルは、ラップされたバージョ" "ンが閉じられる時に、閉じられます。" -#: ../../library/codecs.rst:222 +#: ../../library/codecs.rst:211 msgid "" "Data written to the wrapped file is decoded according to the given " "*data_encoding* and then written to the original file as bytes using " @@ -371,12 +365,12 @@ msgstr "" "出されます。元のファイルから読み出されたバイトは、*file_encoding* に従ってデ" "コードされ、結果は *data_encoding* を使用してエンコードされます。" -#: ../../library/codecs.rst:228 +#: ../../library/codecs.rst:217 msgid "If *file_encoding* is not given, it defaults to *data_encoding*." msgstr "" "*file_encoding* が与えられなければ、*data_encoding* がデフォルトになります。" -#: ../../library/codecs.rst:230 +#: ../../library/codecs.rst:219 msgid "" "*errors* may be given to define the error handling. It defaults to " "``'strict'``, which causes :exc:`ValueError` to be raised in case an " @@ -386,7 +380,7 @@ msgstr "" "は ``'strict'`` で、エンコード時にエラーがあれば :exc:`ValueError` を送出しま" "す。" -#: ../../library/codecs.rst:237 +#: ../../library/codecs.rst:226 msgid "" "Uses an incremental encoder to iteratively encode the input provided by " "*iterator*. This function is a :term:`generator`. The *errors* argument (as " @@ -398,7 +392,7 @@ msgstr "" "あらゆるキーワード引数と同様に) インクリメンタル・エンコーダにそのまま引き渡" "されます。" -#: ../../library/codecs.rst:242 +#: ../../library/codecs.rst:231 msgid "" "This function requires that the codec accept text :class:`str` objects to " "encode. Therefore it does not support bytes-to-bytes encoders such as " @@ -409,7 +403,7 @@ msgstr "" "従って、 ``base64_codec`` のようなバイトからバイトへのエンコーダはサポートし" "ていません。" -#: ../../library/codecs.rst:249 +#: ../../library/codecs.rst:238 msgid "" "Uses an incremental decoder to iteratively decode the input provided by " "*iterator*. This function is a :term:`generator`. The *errors* argument (as " @@ -421,7 +415,7 @@ msgstr "" "ゆるキーワード引数と同様に) インクリメンタル・デコーダにそのまま引き渡されま" "す。" -#: ../../library/codecs.rst:254 +#: ../../library/codecs.rst:243 msgid "" "This function requires that the codec accept :class:`bytes` objects to " "decode. Therefore it does not support text-to-text encoders such as " @@ -433,7 +427,7 @@ msgstr "" "従って、 ``rot_13`` のようなテキストからテキストへのエンコーダが :func:" "`iterencode` で同等に使えるとしても、この関数ではサポートしていません。" -#: ../../library/codecs.rst:260 +#: ../../library/codecs.rst:249 msgid "" "The module also provides the following constants which are useful for " "reading and writing to platform dependent files:" @@ -441,7 +435,7 @@ msgstr "" "このモジュールは以下のような定数も定義しています。プラットフォーム依存なファ" "イルを読み書きするのに役立ちます:" -#: ../../library/codecs.rst:275 +#: ../../library/codecs.rst:264 msgid "" "These constants define various byte sequences, being Unicode byte order " "marks (BOMs) for several encodings. They are used in UTF-16 and UTF-32 data " @@ -462,11 +456,11 @@ msgstr "" "`BOM_UTF16_BE` のエイリアスです。その他の定数は UTF-8 と UTF-32 エンコーディ" "ングの BOM を表します。" -#: ../../library/codecs.rst:289 +#: ../../library/codecs.rst:278 msgid "Codec Base Classes" msgstr "Codec 基底クラス" -#: ../../library/codecs.rst:291 +#: ../../library/codecs.rst:280 msgid "" "The :mod:`codecs` module defines a set of base classes which define the " "interfaces for working with codec objects, and can also be used as the basis " @@ -476,7 +470,7 @@ msgstr "" "義する一連の基底クラスを定義します。このモジュールは、カスタムの codec の実装" "の基礎として使用することもできます。" -#: ../../library/codecs.rst:295 +#: ../../library/codecs.rst:284 msgid "" "Each codec has to define four interfaces to make it usable as codec in " "Python: stateless encoder, stateless decoder, stream reader and stream " @@ -490,52 +484,44 @@ msgstr "" "ダとデコーダを再利用して、ファイルプロトコルを実装します。codec の作者は、" "codec がエンコードとデコードのエラーの処理方法も定義する必要があります。" -#: ../../library/codecs.rst:306 +#: ../../library/codecs.rst:295 msgid "Error Handlers" msgstr "エラーハンドラ" -#: ../../library/codecs.rst:308 +#: ../../library/codecs.rst:297 msgid "" "To simplify and standardize error handling, codecs may implement different " -"error handling schemes by accepting the *errors* string argument:" +"error handling schemes by accepting the *errors* string argument. The " +"following string values are defined and implemented by all standard Python " +"codecs:" msgstr "" -"エラー処理の簡便化と標準化のため、コーデックは、*errors* 文字列引数を指定した" -"場合に別のエラー処理を行うような仕組みを実装してもかまいません\\:" -#: ../../library/codecs.rst:328 -msgid "" -"The following error handlers can be used with all Python :ref:`standard-" -"encodings` codecs:" -msgstr "" - -#: ../../library/codecs.rst:334 ../../library/codecs.rst:377 -#: ../../library/codecs.rst:397 +#: ../../library/codecs.rst:305 ../../library/codecs.rst:328 +#: ../../library/codecs.rst:361 msgid "Value" msgstr "値" -#: ../../library/codecs.rst:334 ../../library/codecs.rst:377 -#: ../../library/codecs.rst:397 ../../library/codecs.rst:1342 -#: ../../library/codecs.rst:1410 ../../library/codecs.rst:1465 +#: ../../library/codecs.rst:305 ../../library/codecs.rst:328 +#: ../../library/codecs.rst:361 ../../library/codecs.rst:1273 +#: ../../library/codecs.rst:1340 ../../library/codecs.rst:1395 msgid "Meaning" msgstr "意味" -#: ../../library/codecs.rst:336 +#: ../../library/codecs.rst:307 msgid "``'strict'``" msgstr "``'strict'``" -#: ../../library/codecs.rst:336 +#: ../../library/codecs.rst:307 msgid "" -"Raise :exc:`UnicodeError` (or a subclass), this is the default. Implemented " +"Raise :exc:`UnicodeError` (or a subclass); this is the default. Implemented " "in :func:`strict_errors`." msgstr "" -":exc:`UnicodeError` (または、そのサブクラス) を送出します。これがデフォルトの" -"動作です。 :func:`strict_errors` で実装されています。" -#: ../../library/codecs.rst:340 +#: ../../library/codecs.rst:311 msgid "``'ignore'``" msgstr "``'ignore'``" -#: ../../library/codecs.rst:340 +#: ../../library/codecs.rst:311 msgid "" "Ignore the malformed data and continue without further notice. Implemented " "in :func:`ignore_errors`." @@ -543,34 +529,62 @@ msgstr "" "不正な形式のデータを無視し、何も通知することなく処理を継続します。:func:" "`ignore_errors` で実装されています。" -#: ../../library/codecs.rst:344 +#: ../../library/codecs.rst:316 +msgid "" +"The following error handlers are only applicable to :term:`text encodings " +"`:" +msgstr "" +"以下のエラーハンドラは、 :term:`テキストエンコーディング ` に" +"のみ適用されます。" + +#: ../../library/codecs.rst:330 msgid "``'replace'``" msgstr "``'replace'``" -#: ../../library/codecs.rst:344 +#: ../../library/codecs.rst:330 msgid "" -"Replace with a replacement marker. On encoding, use ``?`` (ASCII character). " -"On decoding, use ``�`` (U+FFFD, the official REPLACEMENT CHARACTER). " -"Implemented in :func:`replace_errors`." +"Replace with a suitable replacement marker; Python will use the official " +"``U+FFFD`` REPLACEMENT CHARACTER for the built-in codecs on decoding, and " +"'?' on encoding. Implemented in :func:`replace_errors`." msgstr "" -#: ../../library/codecs.rst:350 +#: ../../library/codecs.rst:337 +msgid "``'xmlcharrefreplace'``" +msgstr "``'xmlcharrefreplace'``" + +#: ../../library/codecs.rst:337 +msgid "" +"Replace with the appropriate XML character reference (only for encoding). " +"Implemented in :func:`xmlcharrefreplace_errors`." +msgstr "" + +#: ../../library/codecs.rst:341 msgid "``'backslashreplace'``" msgstr "``'backslashreplace'``" -#: ../../library/codecs.rst:350 +#: ../../library/codecs.rst:341 +msgid "" +"Replace with backslashed escape sequences. Implemented in :func:" +"`backslashreplace_errors`." +msgstr "" +"バックスラッシュつきのエスケープシーケンスで置換します。 :func:" +"`backslashreplace_errors` で実装されています。" + +#: ../../library/codecs.rst:345 +msgid "``'namereplace'``" +msgstr "``'namereplace'``" + +#: ../../library/codecs.rst:345 msgid "" -"Replace with backslashed escape sequences. On encoding, use hexadecimal form " -"of Unicode code point with formats :samp:`\\\\x{hh}` :samp:`\\\\u{xxxx}` :" -"samp:`\\\\U{xxxxxxxx}`. On decoding, use hexadecimal form of byte value with " -"format :samp:`\\\\x{hh}`. Implemented in :func:`backslashreplace_errors`." +"Replace with ``\\N{...}`` escape sequences (only for encoding). Implemented " +"in :func:`namereplace_errors`." msgstr "" -#: ../../library/codecs.rst:359 +#: ../../library/codecs.rst:349 msgid "``'surrogateescape'``" msgstr "``'surrogateescape'``" -#: ../../library/codecs.rst:359 +#: ../../library/codecs.rst:349 msgid "" "On decoding, replace byte with individual surrogate code ranging from " "``U+DC80`` to ``U+DCFF``. This code will then be turned back into the same " @@ -582,79 +596,54 @@ msgstr "" "ンドラが使用されると、このコードは同じバイト列に戻されます。 (詳しくは :pep:" "`383` を参照。)" -#: ../../library/codecs.rst:373 -msgid "" -"The following error handlers are only applicable to encoding (within :term:" -"`text encodings `):" -msgstr "" - -#: ../../library/codecs.rst:379 -msgid "``'xmlcharrefreplace'``" -msgstr "``'xmlcharrefreplace'``" - -#: ../../library/codecs.rst:379 -msgid "" -"Replace with XML/HTML numeric character reference, which is a decimal form " -"of Unicode code point with format :samp:`&#{num};`. Implemented in :func:" -"`xmlcharrefreplace_errors`." -msgstr "" - -#: ../../library/codecs.rst:385 -msgid "``'namereplace'``" -msgstr "``'namereplace'``" - -#: ../../library/codecs.rst:385 -msgid "" -"Replace with ``\\N{...}`` escape sequences, what appears in the braces is " -"the Name property from Unicode Character Database. Implemented in :func:" -"`namereplace_errors`." -msgstr "" - -#: ../../library/codecs.rst:394 +#: ../../library/codecs.rst:358 msgid "" "In addition, the following error handler is specific to the given codecs:" msgstr "さらに、次のエラーハンドラは与えられた codec に特有です:" -#: ../../library/codecs.rst:13 ../../library/codecs.rst:397 +#: ../../library/codecs.rst:361 msgid "Codecs" msgstr "Codecs" -#: ../../library/codecs.rst:399 +#: ../../library/codecs.rst:363 msgid "``'surrogatepass'``" msgstr "``'surrogatepass'``" -#: ../../library/codecs.rst:399 +#: ../../library/codecs.rst:363 msgid "utf-8, utf-16, utf-32, utf-16-be, utf-16-le, utf-32-be, utf-32-le" msgstr "utf-8, utf-16, utf-32, utf-16-be, utf-16-le, utf-32-be, utf-32-le" -#: ../../library/codecs.rst:399 +#: ../../library/codecs.rst:363 msgid "" -"Allow encoding and decoding surrogate code point (``U+D800`` - ``U+DFFF``) " -"as normal code point. Otherwise these codecs treat the presence of surrogate " -"code point in :class:`str` as an error." +"Allow encoding and decoding of surrogate codes. These codecs normally treat " +"the presence of surrogates as an error." msgstr "" -#: ../../library/codecs.rst:406 +#: ../../library/codecs.rst:368 msgid "The ``'surrogateescape'`` and ``'surrogatepass'`` error handlers." msgstr "``'surrogateescape'`` および ``'surrogatepass'`` エラーハンドラ。" -#: ../../library/codecs.rst:409 +#: ../../library/codecs.rst:371 msgid "" -"The ``'surrogatepass'`` error handler now works with utf-16\\* and utf-32\\* " -"codecs." +"The ``'surrogatepass'`` error handlers now works with utf-16\\* and " +"utf-32\\* codecs." msgstr "" +"``'surrogatepass'`` エラーハンドラは utf-16\\* コーデックと utf-32\\* コー" +"デックで動作するようになりました。" -#: ../../library/codecs.rst:413 +#: ../../library/codecs.rst:374 msgid "The ``'namereplace'`` error handler." msgstr "``'namereplace'`` エラーハンドラです。" -#: ../../library/codecs.rst:416 +#: ../../library/codecs.rst:377 msgid "" -"The ``'backslashreplace'`` error handler now works with decoding and " +"The ``'backslashreplace'`` error handlers now works with decoding and " "translating." msgstr "" +"``'backslashreplace'`` エラーハンドラは、デコード時と翻訳時に動作するようにな" +"りました。" -#: ../../library/codecs.rst:420 +#: ../../library/codecs.rst:381 msgid "" "The set of allowed values can be extended by registering a new named error " "handler:" @@ -662,7 +651,7 @@ msgstr "" "次のように、名前付きの新しいエラーハンドラを登録することで、許可される値の集" "合を拡張することができます。" -#: ../../library/codecs.rst:425 +#: ../../library/codecs.rst:386 msgid "" "Register the error handling function *error_handler* under the name *name*. " "The *error_handler* argument will be called during encoding and decoding in " @@ -672,7 +661,7 @@ msgstr "" "デコード中にエラーが送出された場合、*name* が errors 引数として指定されていれ" "ば *error_handler* が呼び出されます。" -#: ../../library/codecs.rst:429 +#: ../../library/codecs.rst:390 msgid "" "For encoding, *error_handler* will be called with a :exc:" "`UnicodeEncodeError` instance, which contains information about the location " @@ -697,7 +686,7 @@ msgstr "" "対位置として扱われます。境界の外側にある位置を返した場合には :exc:" "`IndexError` が送出されます。" -#: ../../library/codecs.rst:441 +#: ../../library/codecs.rst:402 msgid "" "Decoding and translating works similarly, except :exc:`UnicodeDecodeError` " "or :exc:`UnicodeTranslateError` will be passed to the handler and that the " @@ -707,7 +696,7 @@ msgstr "" "`UnicodeDecodeError` か :exc:`UnicodeTranslateError` である点と、エラーハンド" "ラの置換した内容が直接出力されるという点が異なります。" -#: ../../library/codecs.rst:446 +#: ../../library/codecs.rst:407 msgid "" "Previously registered error handlers (including the standard error handlers) " "can be looked up by name:" @@ -715,96 +704,83 @@ msgstr "" "登録済みのエラーハンドラ (標準エラーハンドラを含む) は、次のようにその名前で" "検索することができます。" -#: ../../library/codecs.rst:451 +#: ../../library/codecs.rst:412 msgid "Return the error handler previously registered under the name *name*." msgstr "名前 *name* で登録済みのエラーハンドラを返します。" -#: ../../library/codecs.rst:453 +#: ../../library/codecs.rst:414 msgid "Raises a :exc:`LookupError` in case the handler cannot be found." msgstr "エラーハンドラが見つからなければ :exc:`LookupError` を送出します。" -#: ../../library/codecs.rst:455 +#: ../../library/codecs.rst:416 msgid "" "The following standard error handlers are also made available as module " "level functions:" msgstr "以下の標準エラーハンドラも、モジュールレベルの関数として利用できます。" -#: ../../library/codecs.rst:460 -msgid "Implements the ``'strict'`` error handling." -msgstr "" - -#: ../../library/codecs.rst:462 -msgid "Each encoding or decoding error raises a :exc:`UnicodeError`." -msgstr "" - -#: ../../library/codecs.rst:467 -msgid "Implements the ``'ignore'`` error handling." -msgstr "" - -#: ../../library/codecs.rst:469 +#: ../../library/codecs.rst:421 msgid "" -"Malformed data is ignored; encoding or decoding is continued without further " -"notice." -msgstr "" - -#: ../../library/codecs.rst:475 -msgid "Implements the ``'replace'`` error handling." +"Implements the ``'strict'`` error handling: each encoding or decoding error " +"raises a :exc:`UnicodeError`." msgstr "" +"``strict`` エラー処理を実装します。エンコードエラーまたはデコードエラーはそれ" +"ぞれ :exc:`UnicodeError` を送出します。" -#: ../../library/codecs.rst:477 +#: ../../library/codecs.rst:427 msgid "" -"Substitutes ``?`` (ASCII character) for encoding errors or ``�`` (U+FFFD, " -"the official REPLACEMENT CHARACTER) for decoding errors." -msgstr "" - -#: ../../library/codecs.rst:483 -msgid "Implements the ``'backslashreplace'`` error handling." +"Implements the ``'replace'`` error handling (for :term:`text encodings ` only): substitutes ``'?'`` for encoding errors (to be encoded by " +"the codec), and ``'\\ufffd'`` (the Unicode replacement character) for " +"decoding errors." msgstr "" +"``'replace'`` エラー処理を実装します ( :term:`テキストエンコーディング ` のみ)。(codec によりエンコードする必要のある) エンコードエラーに対" +"しては ``'?'`` に、デコードエラーに対しては ``'\\ufffd'`` (Unicode 代替文字) " +"に置き換えます。" -#: ../../library/codecs.rst:485 +#: ../../library/codecs.rst:435 msgid "" -"Malformed data is replaced by a backslashed escape sequence. On encoding, " -"use the hexadecimal form of Unicode code point with formats :samp:`\\\\x{hh}" -"` :samp:`\\\\u{xxxx}` :samp:`\\\\U{xxxxxxxx}`. On decoding, use the " -"hexadecimal form of byte value with format :samp:`\\\\x{hh}`." +"Implements the ``'ignore'`` error handling: malformed data is ignored and " +"encoding or decoding is continued without further notice." msgstr "" +"``ignore`` エラー処理を実装します。不正な形式のデータは無視され、エンコードま" +"たはデコードは何も通知することなく継続されます。" -#: ../../library/codecs.rst:491 -msgid "Works with decoding and translating." -msgstr "" - -#: ../../library/codecs.rst:497 -msgid "" -"Implements the ``'xmlcharrefreplace'`` error handling (for encoding within :" -"term:`text encoding` only)." -msgstr "" - -#: ../../library/codecs.rst:500 +#: ../../library/codecs.rst:441 msgid "" -"The unencodable character is replaced by an appropriate XML/HTML numeric " -"character reference, which is a decimal form of Unicode code point with " -"format :samp:`&#{num};` ." +"Implements the ``'xmlcharrefreplace'`` error handling (for encoding with :" +"term:`text encodings ` only): the unencodable character is " +"replaced by an appropriate XML character reference." msgstr "" +"``'xmlcharrefreplace'`` エラー処理を実装します ( :term:`テキストエンコーディ" +"ング ` のエンコードのみ)。エンコードできない文字は、適切な " +"XML 文字参照に置き換えます。" -#: ../../library/codecs.rst:507 +#: ../../library/codecs.rst:448 msgid "" -"Implements the ``'namereplace'`` error handling (for encoding within :term:" -"`text encoding` only)." +"Implements the ``'backslashreplace'`` error handling (for :term:`text " +"encodings ` only): malformed data is replaced by a " +"backslashed escape sequence." msgstr "" +"``'backslashreplace'`` エラー処理を実装します ( :term:`テキストエンコーディン" +"グ ` のエンコードのみ)。不正な形式のデータは、バックスラッシュ" +"付きのエスケープシーケンスに置き換えます。" -#: ../../library/codecs.rst:510 +#: ../../library/codecs.rst:454 msgid "" -"The unencodable character is replaced by a ``\\N{...}`` escape sequence. The " -"set of characters that appear in the braces is the Name property from " -"Unicode Character Database. For example, the German lowercase letter ``'ß'`` " -"will be converted to byte sequence ``\\N{LATIN SMALL LETTER SHARP S}`` ." +"Implements the ``'namereplace'`` error handling (for encoding with :term:" +"`text encodings ` only): the unencodable character is " +"replaced by a ``\\N{...}`` escape sequence." msgstr "" +"``'namereplace'`` エラー処理を実装します ( :term:`テキストエンコーディング " +"` のエンコードのみ)。エンコードできない文字は、``\\N{...}`` エ" +"スケープシーケンスに置き換えます。" -#: ../../library/codecs.rst:521 +#: ../../library/codecs.rst:464 msgid "Stateless Encoding and Decoding" msgstr "ステートレスなエンコードとデコード" -#: ../../library/codecs.rst:523 +#: ../../library/codecs.rst:466 msgid "" "The base :class:`Codec` class defines these methods which also define the " "function interfaces of the stateless encoder and decoder:" @@ -812,7 +788,7 @@ msgstr "" "基底の :class:`Codec` クラスは以下のメソッドを定義します。これらのメソッド" "は、内部状態を持たないエンコーダ/デコーダ関数のインターフェースを定義します:" -#: ../../library/codecs.rst:531 +#: ../../library/codecs.rst:472 msgid "" "Encodes the object *input* and returns a tuple (output object, length " "consumed). For instance, :term:`text encoding` converts a string object to a " @@ -824,7 +800,7 @@ msgstr "" "列オブジェクトを特有の文字セット (例えば ``cp1252`` や ``iso-8859-1``) を用い" "てバイト列オブジェクトに変換します。" -#: ../../library/codecs.rst:536 ../../library/codecs.rst:558 +#: ../../library/codecs.rst:477 ../../library/codecs.rst:499 msgid "" "The *errors* argument defines the error handling to apply. It defaults to " "``'strict'`` handling." @@ -832,7 +808,7 @@ msgstr "" "*errors* 引数は適用するエラー処理を定義します。``'strict'`` 処理がデフォルト" "です。" -#: ../../library/codecs.rst:539 +#: ../../library/codecs.rst:480 msgid "" "The method may not store state in the :class:`Codec` instance. Use :class:" "`StreamWriter` for codecs which have to keep state in order to make encoding " @@ -842,7 +818,7 @@ msgstr "" "コードするために状態を保持しなければならないような codecs には :class:" "`StreamWriter` を使ってください。" -#: ../../library/codecs.rst:543 +#: ../../library/codecs.rst:484 msgid "" "The encoder must be able to handle zero length input and return an empty " "object of the output object type in this situation." @@ -850,7 +826,7 @@ msgstr "" "エンコーダは長さが 0 の入力を処理できなければなりません。この場合、空のオブ" "ジェクトを出力オブジェクトとして返さなければなりません。" -#: ../../library/codecs.rst:549 +#: ../../library/codecs.rst:490 msgid "" "Decodes the object *input* and returns a tuple (output object, length " "consumed). For instance, for a :term:`text encoding`, decoding converts a " @@ -862,7 +838,7 @@ msgstr "" "定の文字集合エンコーディングでエンコードされたバイト列オブジェクトを文字列オ" "ブジェクトに変換します。" -#: ../../library/codecs.rst:554 +#: ../../library/codecs.rst:495 msgid "" "For text encodings and bytes-to-bytes codecs, *input* must be a bytes object " "or one which provides the read-only buffer interface -- for example, buffer " @@ -873,7 +849,7 @@ msgstr "" "ブジェクトである必要があります。例えば、buffer オブジェクトやメモリマップド" "ファイルでなければなりません。" -#: ../../library/codecs.rst:561 +#: ../../library/codecs.rst:502 msgid "" "The method may not store state in the :class:`Codec` instance. Use :class:" "`StreamReader` for codecs which have to keep state in order to make decoding " @@ -883,7 +859,7 @@ msgstr "" "ん。効率よくエンコード/デコードするために状態を保持しなければならないような " "codecs には :class:`StreamReader` を使ってください。" -#: ../../library/codecs.rst:565 +#: ../../library/codecs.rst:506 msgid "" "The decoder must be able to handle zero length input and return an empty " "object of the output object type in this situation." @@ -891,11 +867,11 @@ msgstr "" "デコーダは長さが 0 の入力を処理できなければなりません。この場合、空のオブジェ" "クトを出力オブジェクトとして返さなければなりません。" -#: ../../library/codecs.rst:570 +#: ../../library/codecs.rst:511 msgid "Incremental Encoding and Decoding" msgstr "インクリメンタルなエンコードとデコード" -#: ../../library/codecs.rst:572 +#: ../../library/codecs.rst:513 msgid "" "The :class:`IncrementalEncoder` and :class:`IncrementalDecoder` classes " "provide the basic interface for incremental encoding and decoding. Encoding/" @@ -914,7 +890,7 @@ msgstr "" "コーダ/デコーダはメソッド呼び出しの間エンコード/デコード処理の進行を管理し" "ます。" -#: ../../library/codecs.rst:580 +#: ../../library/codecs.rst:521 msgid "" "The joined output of calls to the :meth:`~IncrementalEncoder.encode`/:meth:" "`~IncrementalDecoder.decode` method is the same as if all the single inputs " @@ -925,11 +901,11 @@ msgstr "" "ド呼び出しの出力結果をまとめたものは、入力をひとまとめにして内部状態を持たな" "いエンコーダ/デコーダでエンコード/デコードしたものと同じになります。" -#: ../../library/codecs.rst:589 +#: ../../library/codecs.rst:530 msgid "IncrementalEncoder Objects" msgstr "IncrementalEncoder オブジェクト" -#: ../../library/codecs.rst:591 +#: ../../library/codecs.rst:532 msgid "" "The :class:`IncrementalEncoder` class is used for encoding an input in " "multiple steps. It defines the following methods which every incremental " @@ -940,11 +916,11 @@ msgstr "" "性を持つために定義すべきメソッドとして、このクラスには以下のメソッドが定義さ" "れています。" -#: ../../library/codecs.rst:598 +#: ../../library/codecs.rst:539 msgid "Constructor for an :class:`IncrementalEncoder` instance." msgstr ":class:`IncrementalEncoder` インスタンスのコンストラクタ。" -#: ../../library/codecs.rst:600 +#: ../../library/codecs.rst:541 msgid "" "All incremental encoders must provide this constructor interface. They are " "free to add additional keyword arguments, but only the ones defined here are " @@ -954,7 +930,7 @@ msgstr "" "しなければなりません。さらにキーワード引数を付け加えるのは構いませんが、" "Python codec レジストリで利用されるのはここで定義されているものだけです。" -#: ../../library/codecs.rst:604 +#: ../../library/codecs.rst:545 msgid "" "The :class:`IncrementalEncoder` may implement different error handling " "schemes by providing the *errors* keyword argument. See :ref:`error-" @@ -964,7 +940,7 @@ msgstr "" "様々なエラー取扱方法を実装することができます。取り得る値については :ref:" "`error-handlers` を参照してください。" -#: ../../library/codecs.rst:608 +#: ../../library/codecs.rst:549 msgid "" "The *errors* argument will be assigned to an attribute of the same name. " "Assigning to this attribute makes it possible to switch between different " @@ -975,7 +951,7 @@ msgstr "" "`IncrementalEncoder` オブジェクトが生きている間に、異なるエラー処理方法に切り" "替えることができるようになります。" -#: ../../library/codecs.rst:616 +#: ../../library/codecs.rst:557 msgid "" "Encodes *object* (taking the current state of the encoder into account) and " "returns the resulting encoded object. If this is the last call to :meth:" @@ -985,7 +961,7 @@ msgstr "" "コードされたオブジェクトを返します。 :meth:`encode` 呼び出しがこれで最後とい" "う時には *final* は真でなければなりません(デフォルトは偽です)。" -#: ../../library/codecs.rst:623 +#: ../../library/codecs.rst:564 msgid "" "Reset the encoder to the initial state. The output is discarded: call ``." "encode(object, final=True)``, passing an empty byte or text string if " @@ -995,7 +971,7 @@ msgstr "" "final=True)`` を呼び出して、必要に応じて空バイト列またはテキスト文字列を渡す" "ことにより、エンコーダをリセットし、出力を取得します。" -#: ../../library/codecs.rst:630 +#: ../../library/codecs.rst:571 msgid "" "Return the current state of the encoder which must be an integer. The " "implementation should make sure that ``0`` is the most common state. (States " @@ -1008,7 +984,7 @@ msgstr "" "は、状態を marshal/pickle して生じた文字列のバイトを整数にコード化することに" "よって整数に変換することができます。)" -#: ../../library/codecs.rst:639 +#: ../../library/codecs.rst:580 msgid "" "Set the state of the encoder to *state*. *state* must be an encoder state " "returned by :meth:`getstate`." @@ -1016,11 +992,11 @@ msgstr "" "エンコーダの状態を *state* にセットします。 *state* は :meth:`getstate` に" "よって返されたエンコーダ状態でなければなりません。" -#: ../../library/codecs.rst:646 +#: ../../library/codecs.rst:587 msgid "IncrementalDecoder Objects" msgstr "IncrementalDecoder オブジェクト" -#: ../../library/codecs.rst:648 +#: ../../library/codecs.rst:589 msgid "" "The :class:`IncrementalDecoder` class is used for decoding an input in " "multiple steps. It defines the following methods which every incremental " @@ -1031,11 +1007,11 @@ msgstr "" "持つために定義すべきメソッドとして、このクラスには以下のメソッドが定義されて" "います。" -#: ../../library/codecs.rst:655 +#: ../../library/codecs.rst:596 msgid "Constructor for an :class:`IncrementalDecoder` instance." msgstr ":class:`IncrementalDecoder` インスタンスのコンストラクタ。" -#: ../../library/codecs.rst:657 +#: ../../library/codecs.rst:598 msgid "" "All incremental decoders must provide this constructor interface. They are " "free to add additional keyword arguments, but only the ones defined here are " @@ -1045,7 +1021,7 @@ msgstr "" "なければなりません。さらにキーワード引数を付け加えるのは構いませんが、Python " "codec レジストリで利用されるのはここで定義されているものだけです。" -#: ../../library/codecs.rst:661 +#: ../../library/codecs.rst:602 msgid "" "The :class:`IncrementalDecoder` may implement different error handling " "schemes by providing the *errors* keyword argument. See :ref:`error-" @@ -1055,7 +1031,7 @@ msgstr "" "様々なエラー取扱方法を実装することができます。取り得る値については :ref:" "`error-handlers` を参照してください。" -#: ../../library/codecs.rst:665 +#: ../../library/codecs.rst:606 msgid "" "The *errors* argument will be assigned to an attribute of the same name. " "Assigning to this attribute makes it possible to switch between different " @@ -1066,7 +1042,7 @@ msgstr "" "`IncrementalDecoder` オブジェクトが生きている間に、異なるエラー処理方法に切り" "替えることができるようになります。" -#: ../../library/codecs.rst:673 +#: ../../library/codecs.rst:614 msgid "" "Decodes *object* (taking the current state of the decoder into account) and " "returns the resulting decoded object. If this is the last call to :meth:" @@ -1084,11 +1060,11 @@ msgstr "" "ダは内部状態を持たない場合と同じようにエラーの取り扱いを開始しなければなりま" "せん(例外を送出するかもしれません)。" -#: ../../library/codecs.rst:684 +#: ../../library/codecs.rst:625 msgid "Reset the decoder to the initial state." msgstr "デコーダを初期状態にリセットします。" -#: ../../library/codecs.rst:689 +#: ../../library/codecs.rst:630 msgid "" "Return the current state of the decoder. This must be a tuple with two " "items, the first must be the buffer containing the still undecoded input. " @@ -1112,7 +1088,7 @@ msgstr "" "報は、情報を marshal/pickle して、結果として生じる文字列のバイト列を整数にエ" "ンコードすることで、整数に変換することができます。)" -#: ../../library/codecs.rst:704 +#: ../../library/codecs.rst:645 msgid "" "Set the state of the decoder to *state*. *state* must be a decoder state " "returned by :meth:`getstate`." @@ -1121,22 +1097,25 @@ msgstr "" "*state* は :meth:`getstate` によって返されたデコーダの状態でなければなりませ" "ん。" -#: ../../library/codecs.rst:709 +#: ../../library/codecs.rst:650 msgid "Stream Encoding and Decoding" msgstr "ストリームのエンコードとデコード" -#: ../../library/codecs.rst:712 +#: ../../library/codecs.rst:653 msgid "" "The :class:`StreamWriter` and :class:`StreamReader` classes provide generic " "working interfaces which can be used to implement new encoding submodules " -"very easily. See :mod:`!encodings.utf_8` for an example of how this is done." +"very easily. See :mod:`encodings.utf_8` for an example of how this is done." msgstr "" +":class:`StreamWriter` と :class:`StreamReader` クラスは、新しいエンコーディン" +"グサブモジュールを非常に簡単に実装するのに使用できる、一般的なインターフェイ" +"スを提供します。実装例は :mod:`encodings.utf_8` をご覧ください。" -#: ../../library/codecs.rst:720 +#: ../../library/codecs.rst:661 msgid "StreamWriter Objects" msgstr "StreamWriter オブジェクト" -#: ../../library/codecs.rst:722 +#: ../../library/codecs.rst:663 msgid "" "The :class:`StreamWriter` class is a subclass of :class:`Codec` and defines " "the following methods which every stream writer must define in order to be " @@ -1146,11 +1125,11 @@ msgstr "" "を定義しています。全てのストリームライタは、 Python の codec レジストリとの互" "換性を保つために、これらのメソッドを定義する必要があります。" -#: ../../library/codecs.rst:729 +#: ../../library/codecs.rst:670 msgid "Constructor for a :class:`StreamWriter` instance." msgstr ":class:`StreamWriter` インスタンスのコンストラクタです。" -#: ../../library/codecs.rst:731 +#: ../../library/codecs.rst:672 msgid "" "All stream writers must provide this constructor interface. They are free to " "add additional keyword arguments, but only the ones defined here are used by " @@ -1160,7 +1139,7 @@ msgstr "" "ればなりません。キーワード引数を追加しても構いませんが、Python の codec レジ" "ストリはここで定義されている引数だけを使います。" -#: ../../library/codecs.rst:735 +#: ../../library/codecs.rst:676 msgid "" "The *stream* argument must be a file-like object open for writing text or " "binary data, as appropriate for the specific codec." @@ -1168,7 +1147,7 @@ msgstr "" "*stream* 引数は、特定の codec に対応して、テキストまたはバイナリデータの書き" "込みが可能なファイルライクオブジェクトである必要があります。" -#: ../../library/codecs.rst:738 +#: ../../library/codecs.rst:679 msgid "" "The :class:`StreamWriter` may implement different error handling schemes by " "providing the *errors* keyword argument. See :ref:`error-handlers` for the " @@ -1178,7 +1157,7 @@ msgstr "" "ラー取扱方法を実装することができます。下層のストリーム codec がサポートできる" "標準エラーハンドラについては :ref:`error-handlers` を参照してください。" -#: ../../library/codecs.rst:742 +#: ../../library/codecs.rst:683 msgid "" "The *errors* argument will be assigned to an attribute of the same name. " "Assigning to this attribute makes it possible to switch between different " @@ -1188,22 +1167,25 @@ msgstr "" "*errors* 引数は、同名の属性に代入されます。この属性を変更すると、 :class:" "`StreamWriter` オブジェクトが生きている間に、異なるエラー処理に変更できます。" -#: ../../library/codecs.rst:748 +#: ../../library/codecs.rst:689 msgid "Writes the object's contents encoded to the stream." msgstr "*object* の内容をエンコードしてストリームに書き出します。" -#: ../../library/codecs.rst:753 +#: ../../library/codecs.rst:694 msgid "" -"Writes the concatenated iterable of strings to the stream (possibly by " -"reusing the :meth:`write` method). Infinite or very large iterables are not " -"supported. The standard bytes-to-bytes codecs do not support this method." +"Writes the concatenated list of strings to the stream (possibly by reusing " +"the :meth:`write` method). The standard bytes-to-bytes codecs do not support " +"this method." msgstr "" +"文字列からなるリストを連結して、ストリームに書き出します (可能な場合には :" +"meth:`write` を再利用します) 。バイト列からバイト列への標準 codecs は、このメ" +"ソッドをサポートしません。" -#: ../../library/codecs.rst:761 ../../library/codecs.rst:856 +#: ../../library/codecs.rst:701 ../../library/codecs.rst:796 msgid "Resets the codec buffers used for keeping internal state." msgstr "内部状態保持に使われた codec のバッファをリセットします。" -#: ../../library/codecs.rst:763 +#: ../../library/codecs.rst:703 msgid "" "Calling this method should ensure that the data on the output is put into a " "clean state that allows appending of new fresh data without having to rescan " @@ -1213,7 +1195,7 @@ msgstr "" "リーム全体を再スキャンして状態を元に戻さなくても新しくデータを追加できるよう" "にしなければなりません。" -#: ../../library/codecs.rst:768 +#: ../../library/codecs.rst:708 msgid "" "In addition to the above methods, the :class:`StreamWriter` must also " "inherit all other methods and attributes from the underlying stream." @@ -1221,11 +1203,11 @@ msgstr "" "ここまでで挙げたメソッドの他にも、 :class:`StreamWriter` では背後にあるスト" "リームの他の全てのメソッドや属性を継承しなければなりません。" -#: ../../library/codecs.rst:775 +#: ../../library/codecs.rst:715 msgid "StreamReader Objects" msgstr "StreamReader オブジェクト" -#: ../../library/codecs.rst:777 +#: ../../library/codecs.rst:717 msgid "" "The :class:`StreamReader` class is a subclass of :class:`Codec` and defines " "the following methods which every stream reader must define in order to be " @@ -1235,11 +1217,11 @@ msgstr "" "を定義しています。全てのストリームリーダは、 Python の codec レジストリとの互" "換性を保つために、これらのメソッドを定義する必要があります。" -#: ../../library/codecs.rst:784 +#: ../../library/codecs.rst:724 msgid "Constructor for a :class:`StreamReader` instance." msgstr ":class:`StreamReader` インスタンスのコンストラクタです。" -#: ../../library/codecs.rst:786 +#: ../../library/codecs.rst:726 msgid "" "All stream readers must provide this constructor interface. They are free to " "add additional keyword arguments, but only the ones defined here are used by " @@ -1249,7 +1231,7 @@ msgstr "" "ればなりません。キーワード引数を追加しても構いませんが、Python の codec レジ" "ストリはここで定義されている引数だけを使います。" -#: ../../library/codecs.rst:790 +#: ../../library/codecs.rst:730 msgid "" "The *stream* argument must be a file-like object open for reading text or " "binary data, as appropriate for the specific codec." @@ -1257,7 +1239,7 @@ msgstr "" "*stream* 引数は、特定の codec に対応して、テキストまたはバイナリデータの読み" "出しが可能なファイルライクオブジェクトである必要があります。" -#: ../../library/codecs.rst:793 +#: ../../library/codecs.rst:733 msgid "" "The :class:`StreamReader` may implement different error handling schemes by " "providing the *errors* keyword argument. See :ref:`error-handlers` for the " @@ -1267,7 +1249,7 @@ msgstr "" "ラー取扱方法を実装することができます。下層のストリーム codec がサポートできる" "標準エラーハンドラについては :ref:`error-handlers` を参照してください。" -#: ../../library/codecs.rst:797 +#: ../../library/codecs.rst:737 msgid "" "The *errors* argument will be assigned to an attribute of the same name. " "Assigning to this attribute makes it possible to switch between different " @@ -1277,19 +1259,19 @@ msgstr "" "*errors* 引数は、同名の属性に代入されます。この属性を変更すると、 :class:" "`StreamReader` オブジェクトが生きている間に、異なるエラー処理に変更できます。" -#: ../../library/codecs.rst:801 +#: ../../library/codecs.rst:741 msgid "" "The set of allowed values for the *errors* argument can be extended with :" "func:`register_error`." msgstr "" "*errors* 引数に許される値の集合は :func:`register_error` で拡張できます。" -#: ../../library/codecs.rst:807 +#: ../../library/codecs.rst:747 msgid "Decodes data from the stream and returns the resulting object." msgstr "" "ストリームからのデータをデコードし、デコード済のオブジェクトを返します。" -#: ../../library/codecs.rst:809 +#: ../../library/codecs.rst:749 msgid "" "The *chars* argument indicates the number of decoded code points or bytes to " "return. The :func:`read` method will never return more data than requested, " @@ -1300,7 +1282,7 @@ msgstr "" "ませんが、データがそれより少ない場合には要求された数未満のデータを返す場合が" "あります。" -#: ../../library/codecs.rst:814 +#: ../../library/codecs.rst:754 msgid "" "The *size* argument indicates the approximate maximum number of encoded " "bytes or code points to read for decoding. The decoder can modify this " @@ -1313,7 +1295,7 @@ msgstr "" "す。デフォルト値 -1 の場合、可能な限り多くのデータを読み込みます。この引数の" "目的は、巨大なファイルの一括デコードを防ぐことにあります。" -#: ../../library/codecs.rst:821 +#: ../../library/codecs.rst:761 msgid "" "The *firstline* flag indicates that it would be sufficient to only return " "the first line, if there are decoding errors on later lines." @@ -1321,7 +1303,7 @@ msgstr "" "*firstline* フラグは、1行目さえ返せばその後の行でデコードエラーがあっても無視" "して十分だ、ということを示します。" -#: ../../library/codecs.rst:825 +#: ../../library/codecs.rst:765 msgid "" "The method should use a greedy read strategy meaning that it should read as " "much data as is allowed within the definition of the encoding and the given " @@ -1333,11 +1315,11 @@ msgstr "" "す。たとえば、ストリーム上にエンコーディングの終端や状態の目印があれば、それ" "も読み込みます。" -#: ../../library/codecs.rst:833 +#: ../../library/codecs.rst:773 msgid "Read one line from the input stream and return the decoded data." msgstr "入力ストリームから1行読み込み、デコード済みのデータを返します。" -#: ../../library/codecs.rst:835 +#: ../../library/codecs.rst:775 msgid "" "*size*, if given, is passed as size argument to the stream's :meth:`read` " "method." @@ -1345,18 +1327,18 @@ msgstr "" "*size* が与えられた場合、ストリームの :meth:`read` メソッドに size 引数として" "渡されます。" -#: ../../library/codecs.rst:838 +#: ../../library/codecs.rst:778 msgid "" "If *keepends* is false line-endings will be stripped from the lines returned." msgstr "*keepends* が偽の場合には行末の改行が削除された行が返ります。" -#: ../../library/codecs.rst:844 +#: ../../library/codecs.rst:784 msgid "" "Read all lines available on the input stream and return them as a list of " "lines." msgstr "入力ストリームから全ての行を読み込み、行のリストとして返します。" -#: ../../library/codecs.rst:847 +#: ../../library/codecs.rst:787 msgid "" "Line-endings are implemented using the codec's :meth:`decode` method and are " "included in the list entries if *keepends* is true." @@ -1364,7 +1346,7 @@ msgstr "" "*keepends* が真なら、改行は、codec の :meth:`decode` メソッドを使って実装さ" "れ、リスト要素の中に含まれます。" -#: ../../library/codecs.rst:850 +#: ../../library/codecs.rst:790 msgid "" "*sizehint*, if given, is passed as the *size* argument to the stream's :meth:" "`read` method." @@ -1372,7 +1354,7 @@ msgstr "" "*sizehint* が与えられた場合、ストリームの :meth:`read` メソッドに *size* 引数" "として渡されます。" -#: ../../library/codecs.rst:858 +#: ../../library/codecs.rst:798 msgid "" "Note that no stream repositioning should take place. This method is " "primarily intended to be able to recover from decoding errors." @@ -1380,7 +1362,7 @@ msgstr "" "ストリームの読み位置を再設定してはならないので注意してください。このメソッド" "はデコードの際にエラーから復帰できるようにするためのものです。" -#: ../../library/codecs.rst:862 +#: ../../library/codecs.rst:802 msgid "" "In addition to the above methods, the :class:`StreamReader` must also " "inherit all other methods and attributes from the underlying stream." @@ -1388,11 +1370,11 @@ msgstr "" "ここまでで挙げたメソッドの他にも、 :class:`StreamReader` では背後にあるスト" "リームの他の全てのメソッドや属性を継承しなければなりません。" -#: ../../library/codecs.rst:868 +#: ../../library/codecs.rst:808 msgid "StreamReaderWriter Objects" msgstr "StreamReaderWriter オブジェクト" -#: ../../library/codecs.rst:870 +#: ../../library/codecs.rst:810 msgid "" "The :class:`StreamReaderWriter` is a convenience class that allows wrapping " "streams which work in both read and write modes." @@ -1400,7 +1382,7 @@ msgstr "" ":class:`StreamReaderWriter` は、読み書き両方に使えるストリームをラップできる" "便利なクラスです。" -#: ../../library/codecs.rst:873 ../../library/codecs.rst:897 +#: ../../library/codecs.rst:813 ../../library/codecs.rst:837 msgid "" "The design is such that one can use the factory functions returned by the :" "func:`lookup` function to construct the instance." @@ -1408,7 +1390,7 @@ msgstr "" ":func:`lookup` 関数が返すファクトリ関数を使って、インスタンスを生成するという" "設計です。" -#: ../../library/codecs.rst:879 +#: ../../library/codecs.rst:819 msgid "" "Creates a :class:`StreamReaderWriter` instance. *stream* must be a file-like " "object. *Reader* and *Writer* must be factory functions or classes providing " @@ -1422,7 +1404,7 @@ msgstr "" "関数かファクトリクラスでなければなりません。エラー処理は、ストリームリーダと" "ライタで定義したものと同じように行われます。" -#: ../../library/codecs.rst:884 +#: ../../library/codecs.rst:824 msgid "" ":class:`StreamReaderWriter` instances define the combined interfaces of :" "class:`StreamReader` and :class:`StreamWriter` classes. They inherit all " @@ -1432,11 +1414,11 @@ msgstr "" "class:`StreamWriter` クラスを合わせたインターフェースを継承します。元になるス" "トリームからは、他のメソッドや属性を継承します。" -#: ../../library/codecs.rst:892 +#: ../../library/codecs.rst:832 msgid "StreamRecoder Objects" msgstr "StreamRecoder オブジェクト" -#: ../../library/codecs.rst:894 +#: ../../library/codecs.rst:834 msgid "" "The :class:`StreamRecoder` translates data from one encoding to another, " "which is sometimes useful when dealing with different encoding environments." @@ -1444,15 +1426,19 @@ msgstr "" ":class:`StreamRecoder` はデータをあるエンコーディングから別のエンコーディング" "に変換します。異なるエンコーディング環境を扱うとき、便利な場合があります。" -#: ../../library/codecs.rst:903 +#: ../../library/codecs.rst:843 msgid "" "Creates a :class:`StreamRecoder` instance which implements a two-way " -"conversion: *encode* and *decode* work on the frontend — the data visible to " -"code calling :meth:`~StreamReader.read` and :meth:`~StreamWriter.write`, " -"while *Reader* and *Writer* work on the backend — the data in *stream*." +"conversion: *encode* and *decode* work on the frontend — the data visible to " +"code calling :meth:`read` and :meth:`write`, while *Reader* and *Writer* " +"work on the backend — the data in *stream*." msgstr "" +"双方向変換を実装する :class:`StreamRecoder` インスタンスを生成します。 " +"*encode* と *decode* はフロントエンド (:meth:`read` および :meth:`write` を呼" +"び出すコードから見えるデータ) ではたらき、 *Reader* と *Writer* はバックエン" +"ド (*stream* 内のデータ) ではたらきます。" -#: ../../library/codecs.rst:909 +#: ../../library/codecs.rst:848 msgid "" "You can use these objects to do transparent transcodings, e.g., from Latin-1 " "to UTF-8 and back." @@ -1460,11 +1446,11 @@ msgstr "" "これらのオブジェクトを使って、たとえば、 Latin-1 から UTF-8 への変換、あるい" "は逆向きの変換を、透過的に行うことができます。" -#: ../../library/codecs.rst:912 +#: ../../library/codecs.rst:851 msgid "The *stream* argument must be a file-like object." msgstr "*stream* 引数はファイルライクオブジェクトでなくてはなりません。" -#: ../../library/codecs.rst:914 +#: ../../library/codecs.rst:853 msgid "" "The *encode* and *decode* arguments must adhere to the :class:`Codec` " "interface. *Reader* and *Writer* must be factory functions or classes " @@ -1476,7 +1462,7 @@ msgstr "" "class:`StreamWriter` のインターフェースを提供するオブジェクトのファクトリ関数" "かクラスでなくてはなりません。" -#: ../../library/codecs.rst:919 +#: ../../library/codecs.rst:858 msgid "" "Error handling is done in the same way as defined for the stream readers and " "writers." @@ -1484,7 +1470,7 @@ msgstr "" "エラー処理はストリーム・リーダやライタで定義されている方法と同じように行われ" "ます。" -#: ../../library/codecs.rst:923 +#: ../../library/codecs.rst:862 msgid "" ":class:`StreamRecoder` instances define the combined interfaces of :class:" "`StreamReader` and :class:`StreamWriter` classes. They inherit all other " @@ -1494,35 +1480,23 @@ msgstr "" "`StreamWriter` クラスを合わせたインターフェースを定義します。また、元のスト" "リームのメソッドと属性も継承します。" -#: ../../library/codecs.rst:931 +#: ../../library/codecs.rst:870 msgid "Encodings and Unicode" msgstr "エンコーディングと Unicode" -#: ../../library/codecs.rst:933 -msgid "" -"Strings are stored internally as sequences of code points in range " -"``U+0000``--``U+10FFFF``. (See :pep:`393` for more details about the " -"implementation.) Once a string object is used outside of CPU and memory, " -"endianness and how these arrays are stored as bytes become an issue. As with " -"other codecs, serialising a string into a sequence of bytes is known as " -"*encoding*, and recreating the string from the sequence of bytes is known as " -"*decoding*. There are a variety of different text serialisation codecs, " -"which are collectivity referred to as :term:`text encodings `." -msgstr "" -"文字列は内部的に ``U+0000``--``U+10FFFF`` の範囲のコードポイントのシーケンス" -"として格納されます (実装に関する詳細については :pep:`393` を参照してくださ" -"い)。\n" -"文字列オブジェクトが CPU とメモリの外で使用されるようになると、エンディアンや" -"これらの配列をバイト列として格納する方法が問題になります。\n" -"他のコーデックでも同様ですが、文字列オブジェクトをバイト列に変換することは *" -"エンコード* と呼ばれます。\n" -"また、バイト列から文字列オブジェクトを再生成することは *デコード* と呼ばれま" -"す。\n" -"テキストをシリアライズするコーデックには多くの種類があります。\n" -"それらは、集合的に term:`テキストエンコーディング ` と呼ばれま" -"す。" +#: ../../library/codecs.rst:872 +msgid "" +"Strings are stored internally as sequences of code points in range ``0x0``--" +"``0x10FFFF``. (See :pep:`393` for more details about the implementation.) " +"Once a string object is used outside of CPU and memory, endianness and how " +"these arrays are stored as bytes become an issue. As with other codecs, " +"serialising a string into a sequence of bytes is known as *encoding*, and " +"recreating the string from the sequence of bytes is known as *decoding*. " +"There are a variety of different text serialisation codecs, which are " +"collectivity referred to as :term:`text encodings `." +msgstr "" -#: ../../library/codecs.rst:943 +#: ../../library/codecs.rst:882 msgid "" "The simplest text encoding (called ``'latin-1'`` or ``'iso-8859-1'``) maps " "the code points 0--255 to the bytes ``0x0``--``0xff``, which means that a " @@ -1542,7 +1516,7 @@ msgstr "" "があります。): ``UnicodeEncodeError: 'latin-1' codec can't encode character " "'\\u1234' in position 3: ordinal not in range(256)`` 。" -#: ../../library/codecs.rst:951 +#: ../../library/codecs.rst:890 msgid "" "There's another group of encodings (the so called charmap encodings) that " "choose a different subset of all Unicode code points and how these code " @@ -1559,7 +1533,7 @@ msgstr "" "256 文字のひとつの文字列定数があり、どの文字がどのバイト値へ対応付けられるか" "が示されています。" -#: ../../library/codecs.rst:958 +#: ../../library/codecs.rst:897 msgid "" "All of these encodings can only encode 256 of the 1114112 code points " "defined in Unicode. A simple and straightforward way that can store each " @@ -1575,7 +1549,7 @@ msgid "" "Order Mark\"). This is the Unicode character ``U+FEFF``. This character can " "be prepended to every ``UTF-16`` or ``UTF-32`` byte sequence. The byte " "swapped version of this character (``0xFFFE``) is an illegal character that " -"may not appear in a Unicode text. So when the first character in a " +"may not appear in a Unicode text. So when the first character in an " "``UTF-16`` or ``UTF-32`` byte sequence appears to be a ``U+FFFE`` the bytes " "have to be swapped on decoding. Unfortunately the character ``U+FEFF`` had a " "second purpose as a ``ZERO WIDTH NO-BREAK SPACE``: a character that has no " @@ -1616,9 +1590,9 @@ msgstr "" "ト列が文字列にデコードされたならば消えます; ``ZERO WIDTH NO-BREAK SPACE`` と" "して、他の任意の文字のようにデコードされる通常の文字です。" -#: ../../library/codecs.rst:984 +#: ../../library/codecs.rst:923 msgid "" -"There's another encoding that is able to encode the full range of Unicode " +"There's another encoding that is able to encoding the full range of Unicode " "characters: UTF-8. UTF-8 is an 8-bit encoding, which means there are no " "issues with byte order in UTF-8. Each byte in a UTF-8 byte sequence consists " "of two parts: marker bits (the most significant bits) and payload bits. The " @@ -1634,52 +1608,52 @@ msgstr "" "にエンコードされます (x はペイロードを表わし、連結されると一つの Unicode 文字" "を表わします):" -#: ../../library/codecs.rst:993 +#: ../../library/codecs.rst:932 msgid "Range" msgstr "範囲" -#: ../../library/codecs.rst:993 +#: ../../library/codecs.rst:932 msgid "Encoding" msgstr "エンコーディング" -#: ../../library/codecs.rst:995 +#: ../../library/codecs.rst:934 msgid "``U-00000000`` ... ``U-0000007F``" msgstr "``U-00000000`` ... ``U-0000007F``" -#: ../../library/codecs.rst:995 +#: ../../library/codecs.rst:934 msgid "0xxxxxxx" msgstr "0xxxxxxx" -#: ../../library/codecs.rst:997 +#: ../../library/codecs.rst:936 msgid "``U-00000080`` ... ``U-000007FF``" msgstr "``U-00000080`` ... ``U-000007FF``" -#: ../../library/codecs.rst:997 +#: ../../library/codecs.rst:936 msgid "110xxxxx 10xxxxxx" msgstr "110xxxxx 10xxxxxx" -#: ../../library/codecs.rst:999 +#: ../../library/codecs.rst:938 msgid "``U-00000800`` ... ``U-0000FFFF``" msgstr "``U-00000800`` ... ``U-0000FFFF``" -#: ../../library/codecs.rst:999 +#: ../../library/codecs.rst:938 msgid "1110xxxx 10xxxxxx 10xxxxxx" msgstr "1110xxxx 10xxxxxx 10xxxxxx" -#: ../../library/codecs.rst:1001 +#: ../../library/codecs.rst:940 msgid "``U-00010000`` ... ``U-0010FFFF``" msgstr "``U-00010000`` ... ``U-0010FFFF``" -#: ../../library/codecs.rst:1001 +#: ../../library/codecs.rst:940 msgid "11110xxx 10xxxxxx 10xxxxxx 10xxxxxx" msgstr "11110xxx 10xxxxxx 10xxxxxx 10xxxxxx" -#: ../../library/codecs.rst:1004 +#: ../../library/codecs.rst:943 msgid "" "The least significant bit of the Unicode character is the rightmost x bit." msgstr "Unicode 文字の最下位ビットとは最も右にある x のビットです。" -#: ../../library/codecs.rst:1006 +#: ../../library/codecs.rst:945 msgid "" "As UTF-8 is an 8-bit encoding no BOM is required and any ``U+FEFF`` " "character in the decoded string (even if it's the first character) is " @@ -1689,29 +1663,30 @@ msgstr "" "中の ``U+FEFF`` は(たとえ最初の文字であったとしても) ``ZERO WIDTH NO-BREAK " "SPACE`` として扱われます。" -#: ../../library/codecs.rst:1010 +#: ../../library/codecs.rst:949 msgid "" "Without external information it's impossible to reliably determine which " "encoding was used for encoding a string. Each charmap encoding can decode " "any random byte sequence. However that's not possible with UTF-8, as UTF-8 " "byte sequences have a structure that doesn't allow arbitrary byte sequences. " "To increase the reliability with which a UTF-8 encoding can be detected, " -"Microsoft invented a variant of UTF-8 (that Python calls ``\"utf-8-sig\"``) " -"for its Notepad program: Before any of the Unicode characters is written to " -"the file, a UTF-8 encoded BOM (which looks like this as a byte sequence: " -"``0xef``, ``0xbb``, ``0xbf``) is written. As it's rather improbable that any " -"charmap encoded file starts with these byte values (which would e.g. map to" +"Microsoft invented a variant of UTF-8 (that Python 2.5 calls ``\"utf-8-" +"sig\"``) for its Notepad program: Before any of the Unicode characters is " +"written to the file, a UTF-8 encoded BOM (which looks like this as a byte " +"sequence: ``0xef``, ``0xbb``, ``0xbf``) is written. As it's rather " +"improbable that any charmap encoded file starts with these byte values " +"(which would e.g. map to" msgstr "" "外部からの情報無しには、文字列のエンコーディングにどのエンコーディングが使わ" "れたのか信頼できる形で決定することは不可能です。どの charmap エンコーディング" "もどんなランダムなバイト列でもデコードできます。しかし UTF-8 ではそれは可能で" "はありません。任意のバイト列を許さないような構造を持っているからです。UTF-8 " "エンコーディングであることを検知する信頼性を向上させるために、Microsoft は " -"Notepad プログラム用に UTF-8 の変種 (Python では ``\"utf-8-sig\"`` と呼んでい" -"ます) を考案しました。Unicode 文字がファイルに書き込まれる前に UTF-8 でエン" -"コードした BOM (バイト列では ``0xef``, ``0xbb``, ``0xbf`` のように見えます) " -"が書き込まれます。このようなバイト値で charmap エンコードされたファイルが始ま" -"ることはほとんどあり得ない (たとえば iso-8859-1 では" +"Notepad プログラム用に UTF-8 の変種 (Python 2.5 では ``\"utf-8-sig\"`` と呼ん" +"でいます) を考案しました。Unicode 文字がファイルに書き込まれる前に UTF-8 でエ" +"ンコードした BOM (バイト列では ``0xef``, ``0xbb``, ``0xbf`` のように見えま" +"す) が書き込まれます。このようなバイト値で charmap エンコードされたファイルが" +"始まることはほとんどあり得ない (たとえば iso-8859-1 では" #: ../../library/codecs.rst:0 msgid "LATIN SMALL LETTER I WITH DIAERESIS" @@ -1725,7 +1700,7 @@ msgstr "RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK" msgid "INVERTED QUESTION MARK" msgstr "INVERTED QUESTION MARK" -#: ../../library/codecs.rst:1026 +#: ../../library/codecs.rst:965 msgid "" "in iso-8859-1), this increases the probability that a ``utf-8-sig`` encoding " "can be correctly guessed from the byte sequence. So here the BOM is not used " @@ -1744,11 +1719,11 @@ msgstr "" "際はファイルの先頭に現れたこれら3バイトはスキップします。UTF-8 では BOM の使" "用は推奨されておらず、一般的には避けるべきです。" -#: ../../library/codecs.rst:1039 +#: ../../library/codecs.rst:978 msgid "Standard Encodings" msgstr "標準エンコーディング" -#: ../../library/codecs.rst:1041 +#: ../../library/codecs.rst:980 msgid "" "Python comes with a number of codecs built-in, either implemented as C " "functions or with dictionaries as mapping tables. The following table lists " @@ -1767,14 +1742,7 @@ msgstr "" "別名です; そのため、例えば ``'utf-8'`` は ``'utf_8'`` codec の正当な別名で" "す。" -#: ../../library/codecs.rst:1049 -msgid "" -"On Windows, ``cpXXX`` codecs are available for all code pages. But only " -"codecs listed in the following table are guarantead to exist on other " -"platforms." -msgstr "" - -#: ../../library/codecs.rst:1055 +#: ../../library/codecs.rst:990 msgid "" "Some common encodings can bypass the codecs lookup machinery to improve " "performance. These optimization opportunities are only recognized by CPython " @@ -1792,11 +1760,11 @@ msgstr "" "これらのエンコーディングの別のつづりを使用すると実行時間の低下を招くかもしれ" "ません。" -#: ../../library/codecs.rst:1063 +#: ../../library/codecs.rst:998 msgid "Optimization opportunity recognized for us-ascii." msgstr "us-ascii に対して最適化の機会が認識されるようになりました。" -#: ../../library/codecs.rst:1066 +#: ../../library/codecs.rst:1001 msgid "" "Many of the character sets support the same languages. They vary in " "individual characters (e.g. whether the EURO SIGN is supported or not), and " @@ -1807,11 +1775,11 @@ msgstr "" "字 (例えば、EURO SIGN がサポートされているかどうか) や、文字のコード部分への" "割り付けが異なります。特に欧州言語では、典型的に以下の変種が存在します:" -#: ../../library/codecs.rst:1071 +#: ../../library/codecs.rst:1006 msgid "an ISO 8859 codeset" msgstr "ISO 8859 コードセット" -#: ../../library/codecs.rst:1073 +#: ../../library/codecs.rst:1008 msgid "" "a Microsoft Windows code page, which is typically derived from an 8859 " "codeset, but replaces control characters with additional graphic characters" @@ -1819,494 +1787,494 @@ msgstr "" "Microsoft Windows コードページで、8859 コード形式から導出されているが、制御文" "字を追加のグラフィック文字と置き換えたもの" -#: ../../library/codecs.rst:1076 +#: ../../library/codecs.rst:1011 msgid "an IBM EBCDIC code page" msgstr "IBM EBCDIC コードページ" -#: ../../library/codecs.rst:1078 +#: ../../library/codecs.rst:1013 msgid "an IBM PC code page, which is ASCII compatible" msgstr "ASCII 互換の IBM PC コードページ" -#: ../../library/codecs.rst:1083 ../../library/codecs.rst:1342 -#: ../../library/codecs.rst:1410 ../../library/codecs.rst:1465 +#: ../../library/codecs.rst:1018 ../../library/codecs.rst:1273 +#: ../../library/codecs.rst:1340 ../../library/codecs.rst:1395 msgid "Codec" msgstr "Codec" -#: ../../library/codecs.rst:1083 ../../library/codecs.rst:1342 -#: ../../library/codecs.rst:1410 ../../library/codecs.rst:1465 +#: ../../library/codecs.rst:1018 ../../library/codecs.rst:1273 +#: ../../library/codecs.rst:1340 ../../library/codecs.rst:1395 msgid "Aliases" msgstr "別名" -#: ../../library/codecs.rst:1083 +#: ../../library/codecs.rst:1018 msgid "Languages" msgstr "言語" -#: ../../library/codecs.rst:1085 +#: ../../library/codecs.rst:1020 msgid "ascii" msgstr "ascii" -#: ../../library/codecs.rst:1085 +#: ../../library/codecs.rst:1020 msgid "646, us-ascii" msgstr "646, us-ascii" -#: ../../library/codecs.rst:1085 ../../library/codecs.rst:1091 -#: ../../library/codecs.rst:1099 +#: ../../library/codecs.rst:1020 ../../library/codecs.rst:1026 +#: ../../library/codecs.rst:1034 msgid "English" msgstr "英語" -#: ../../library/codecs.rst:1087 +#: ../../library/codecs.rst:1022 msgid "big5" msgstr "big5" -#: ../../library/codecs.rst:1087 +#: ../../library/codecs.rst:1022 msgid "big5-tw, csbig5" msgstr "big5-tw, csbig5" -#: ../../library/codecs.rst:1087 ../../library/codecs.rst:1089 -#: ../../library/codecs.rst:1148 +#: ../../library/codecs.rst:1022 ../../library/codecs.rst:1024 +#: ../../library/codecs.rst:1082 msgid "Traditional Chinese" msgstr "繁体字中国語" -#: ../../library/codecs.rst:1089 +#: ../../library/codecs.rst:1024 msgid "big5hkscs" msgstr "big5hkscs" -#: ../../library/codecs.rst:1089 +#: ../../library/codecs.rst:1024 msgid "big5-hkscs, hkscs" msgstr "big5-hkscs, hkscs" -#: ../../library/codecs.rst:1091 +#: ../../library/codecs.rst:1026 msgid "cp037" msgstr "cp037" -#: ../../library/codecs.rst:1091 +#: ../../library/codecs.rst:1026 msgid "IBM037, IBM039" msgstr "IBM037, IBM039" -#: ../../library/codecs.rst:1093 +#: ../../library/codecs.rst:1028 msgid "cp273" msgstr "cp273" -#: ../../library/codecs.rst:1093 +#: ../../library/codecs.rst:1028 msgid "273, IBM273, csIBM273" msgstr "273, IBM273, csIBM273" -#: ../../library/codecs.rst:1093 +#: ../../library/codecs.rst:1028 msgid "German" msgstr "ドイツ語" -#: ../../library/codecs.rst:1097 +#: ../../library/codecs.rst:1032 msgid "cp424" msgstr "cp424" -#: ../../library/codecs.rst:1097 +#: ../../library/codecs.rst:1032 msgid "EBCDIC-CP-HE, IBM424" msgstr "EBCDIC-CP-HE, IBM424" -#: ../../library/codecs.rst:1097 ../../library/codecs.rst:1117 -#: ../../library/codecs.rst:1127 ../../library/codecs.rst:1171 -#: ../../library/codecs.rst:1234 +#: ../../library/codecs.rst:1032 ../../library/codecs.rst:1052 +#: ../../library/codecs.rst:1062 ../../library/codecs.rst:1105 +#: ../../library/codecs.rst:1168 msgid "Hebrew" msgstr "ヘブライ語" -#: ../../library/codecs.rst:1099 +#: ../../library/codecs.rst:1034 msgid "cp437" msgstr "cp437" -#: ../../library/codecs.rst:1099 +#: ../../library/codecs.rst:1034 msgid "437, IBM437" msgstr "437, IBM437" -#: ../../library/codecs.rst:1101 +#: ../../library/codecs.rst:1036 msgid "cp500" msgstr "cp500" -#: ../../library/codecs.rst:1101 +#: ../../library/codecs.rst:1036 msgid "EBCDIC-CP-BE, EBCDIC-CP-CH, IBM500" msgstr "EBCDIC-CP-BE, EBCDIC-CP-CH, IBM500" -#: ../../library/codecs.rst:1101 ../../library/codecs.rst:1110 -#: ../../library/codecs.rst:1121 ../../library/codecs.rst:1158 -#: ../../library/codecs.rst:1165 ../../library/codecs.rst:1218 -#: ../../library/codecs.rst:1246 ../../library/codecs.rst:1274 +#: ../../library/codecs.rst:1036 ../../library/codecs.rst:1045 +#: ../../library/codecs.rst:1056 ../../library/codecs.rst:1092 +#: ../../library/codecs.rst:1099 ../../library/codecs.rst:1152 +#: ../../library/codecs.rst:1180 ../../library/codecs.rst:1208 msgid "Western Europe" msgstr "西ヨーロッパ言語" -#: ../../library/codecs.rst:1104 +#: ../../library/codecs.rst:1039 msgid "cp720" msgstr "cp720" -#: ../../library/codecs.rst:1104 ../../library/codecs.rst:1131 -#: ../../library/codecs.rst:1173 ../../library/codecs.rst:1230 +#: ../../library/codecs.rst:1039 ../../library/codecs.rst:1066 +#: ../../library/codecs.rst:1107 ../../library/codecs.rst:1164 msgid "Arabic" msgstr "アラビア語" -#: ../../library/codecs.rst:1106 +#: ../../library/codecs.rst:1041 msgid "cp737" msgstr "cp737" -#: ../../library/codecs.rst:1106 ../../library/codecs.rst:1137 -#: ../../library/codecs.rst:1141 ../../library/codecs.rst:1167 -#: ../../library/codecs.rst:1232 ../../library/codecs.rst:1267 +#: ../../library/codecs.rst:1041 ../../library/codecs.rst:1072 +#: ../../library/codecs.rst:1076 ../../library/codecs.rst:1101 +#: ../../library/codecs.rst:1166 ../../library/codecs.rst:1201 msgid "Greek" msgstr "ギリシャ語" -#: ../../library/codecs.rst:1108 +#: ../../library/codecs.rst:1043 msgid "cp775" msgstr "cp775" -#: ../../library/codecs.rst:1108 +#: ../../library/codecs.rst:1043 msgid "IBM775" msgstr "IBM775" -#: ../../library/codecs.rst:1108 ../../library/codecs.rst:1175 -#: ../../library/codecs.rst:1225 ../../library/codecs.rst:1242 +#: ../../library/codecs.rst:1043 ../../library/codecs.rst:1109 +#: ../../library/codecs.rst:1159 ../../library/codecs.rst:1176 msgid "Baltic languages" msgstr "バルト沿岸国" -#: ../../library/codecs.rst:1110 +#: ../../library/codecs.rst:1045 msgid "cp850" msgstr "cp850" -#: ../../library/codecs.rst:1110 +#: ../../library/codecs.rst:1045 msgid "850, IBM850" msgstr "850, IBM850" -#: ../../library/codecs.rst:1112 +#: ../../library/codecs.rst:1047 msgid "cp852" msgstr "cp852" -#: ../../library/codecs.rst:1112 +#: ../../library/codecs.rst:1047 msgid "852, IBM852" msgstr "852, IBM852" -#: ../../library/codecs.rst:1112 ../../library/codecs.rst:1160 -#: ../../library/codecs.rst:1221 ../../library/codecs.rst:1271 +#: ../../library/codecs.rst:1047 ../../library/codecs.rst:1094 +#: ../../library/codecs.rst:1155 ../../library/codecs.rst:1205 msgid "Central and Eastern Europe" msgstr "中央および東ヨーロッパ" -#: ../../library/codecs.rst:1114 +#: ../../library/codecs.rst:1049 msgid "cp855" msgstr "cp855" -#: ../../library/codecs.rst:1114 +#: ../../library/codecs.rst:1049 msgid "855, IBM855" msgstr "855, IBM855" -#: ../../library/codecs.rst:1114 ../../library/codecs.rst:1162 -#: ../../library/codecs.rst:1227 ../../library/codecs.rst:1264 -msgid "Belarusian, Bulgarian, Macedonian, Russian, Serbian" -msgstr "" +#: ../../library/codecs.rst:1049 ../../library/codecs.rst:1096 +#: ../../library/codecs.rst:1161 ../../library/codecs.rst:1198 +msgid "Bulgarian, Byelorussian, Macedonian, Russian, Serbian" +msgstr "ブルガリア、ベラルーシ、マケドニア、ロシア、セルビア" -#: ../../library/codecs.rst:1117 +#: ../../library/codecs.rst:1052 msgid "cp856" msgstr "cp856" -#: ../../library/codecs.rst:1119 +#: ../../library/codecs.rst:1054 msgid "cp857" msgstr "cp857" -#: ../../library/codecs.rst:1119 +#: ../../library/codecs.rst:1054 msgid "857, IBM857" msgstr "857, IBM857" -#: ../../library/codecs.rst:1119 ../../library/codecs.rst:1152 -#: ../../library/codecs.rst:1169 ../../library/codecs.rst:1236 -#: ../../library/codecs.rst:1276 +#: ../../library/codecs.rst:1054 ../../library/codecs.rst:1086 +#: ../../library/codecs.rst:1103 ../../library/codecs.rst:1170 +#: ../../library/codecs.rst:1210 msgid "Turkish" msgstr "トルコ語" -#: ../../library/codecs.rst:1121 +#: ../../library/codecs.rst:1056 msgid "cp858" msgstr "cp858" -#: ../../library/codecs.rst:1121 +#: ../../library/codecs.rst:1056 msgid "858, IBM858" msgstr "858, IBM858" -#: ../../library/codecs.rst:1123 +#: ../../library/codecs.rst:1058 msgid "cp860" msgstr "cp860" -#: ../../library/codecs.rst:1123 +#: ../../library/codecs.rst:1058 msgid "860, IBM860" msgstr "860, IBM860" -#: ../../library/codecs.rst:1123 +#: ../../library/codecs.rst:1058 msgid "Portuguese" msgstr "ポルトガル語" -#: ../../library/codecs.rst:1125 +#: ../../library/codecs.rst:1060 msgid "cp861" msgstr "cp861" -#: ../../library/codecs.rst:1125 +#: ../../library/codecs.rst:1060 msgid "861, CP-IS, IBM861" msgstr "861, CP-IS, IBM861" -#: ../../library/codecs.rst:1125 ../../library/codecs.rst:1269 +#: ../../library/codecs.rst:1060 ../../library/codecs.rst:1203 msgid "Icelandic" msgstr "アイスランド語" -#: ../../library/codecs.rst:1127 +#: ../../library/codecs.rst:1062 msgid "cp862" msgstr "cp862" -#: ../../library/codecs.rst:1127 +#: ../../library/codecs.rst:1062 msgid "862, IBM862" msgstr "862, IBM862" -#: ../../library/codecs.rst:1129 +#: ../../library/codecs.rst:1064 msgid "cp863" msgstr "cp863" -#: ../../library/codecs.rst:1129 +#: ../../library/codecs.rst:1064 msgid "863, IBM863" msgstr "863, IBM863" -#: ../../library/codecs.rst:1129 +#: ../../library/codecs.rst:1064 msgid "Canadian" msgstr "カナダ" -#: ../../library/codecs.rst:1131 +#: ../../library/codecs.rst:1066 msgid "cp864" msgstr "cp864" -#: ../../library/codecs.rst:1131 +#: ../../library/codecs.rst:1066 msgid "IBM864" msgstr "IBM864" -#: ../../library/codecs.rst:1133 +#: ../../library/codecs.rst:1068 msgid "cp865" msgstr "cp865" -#: ../../library/codecs.rst:1133 +#: ../../library/codecs.rst:1068 msgid "865, IBM865" msgstr "865, IBM865" -#: ../../library/codecs.rst:1133 +#: ../../library/codecs.rst:1068 msgid "Danish, Norwegian" msgstr "デンマーク、ノルウェー" -#: ../../library/codecs.rst:1135 +#: ../../library/codecs.rst:1070 msgid "cp866" msgstr "cp866" -#: ../../library/codecs.rst:1135 +#: ../../library/codecs.rst:1070 msgid "866, IBM866" msgstr "866, IBM866" -#: ../../library/codecs.rst:1135 ../../library/codecs.rst:1252 +#: ../../library/codecs.rst:1070 ../../library/codecs.rst:1186 msgid "Russian" msgstr "ロシア語" -#: ../../library/codecs.rst:1137 +#: ../../library/codecs.rst:1072 msgid "cp869" msgstr "cp869" -#: ../../library/codecs.rst:1137 +#: ../../library/codecs.rst:1072 msgid "869, CP-GR, IBM869" msgstr "869, CP-GR, IBM869" -#: ../../library/codecs.rst:1139 +#: ../../library/codecs.rst:1074 msgid "cp874" msgstr "cp874" -#: ../../library/codecs.rst:1139 +#: ../../library/codecs.rst:1074 msgid "Thai" msgstr "タイ語" -#: ../../library/codecs.rst:1141 +#: ../../library/codecs.rst:1076 msgid "cp875" msgstr "cp875" -#: ../../library/codecs.rst:1143 +#: ../../library/codecs.rst:1078 msgid "cp932" msgstr "cp932" -#: ../../library/codecs.rst:1143 -msgid "932, ms932, mskanji, ms-kanji, windows-31j" -msgstr "" - -#: ../../library/codecs.rst:1143 ../../library/codecs.rst:1179 -#: ../../library/codecs.rst:1181 ../../library/codecs.rst:1183 -#: ../../library/codecs.rst:1200 ../../library/codecs.rst:1203 -#: ../../library/codecs.rst:1208 ../../library/codecs.rst:1211 -#: ../../library/codecs.rst:1213 ../../library/codecs.rst:1281 -#: ../../library/codecs.rst:1284 ../../library/codecs.rst:1287 +#: ../../library/codecs.rst:1078 +msgid "932, ms932, mskanji, ms-kanji" +msgstr "932, ms932, mskanji, ms-kanji" + +#: ../../library/codecs.rst:1078 ../../library/codecs.rst:1113 +#: ../../library/codecs.rst:1115 ../../library/codecs.rst:1117 +#: ../../library/codecs.rst:1134 ../../library/codecs.rst:1137 +#: ../../library/codecs.rst:1142 ../../library/codecs.rst:1145 +#: ../../library/codecs.rst:1147 ../../library/codecs.rst:1215 +#: ../../library/codecs.rst:1218 ../../library/codecs.rst:1221 msgid "Japanese" msgstr "日本語" -#: ../../library/codecs.rst:1146 +#: ../../library/codecs.rst:1080 msgid "cp949" msgstr "cp949" -#: ../../library/codecs.rst:1146 +#: ../../library/codecs.rst:1080 msgid "949, ms949, uhc" msgstr "949, ms949, uhc" -#: ../../library/codecs.rst:1146 ../../library/codecs.rst:1185 -#: ../../library/codecs.rst:1215 ../../library/codecs.rst:1250 +#: ../../library/codecs.rst:1080 ../../library/codecs.rst:1119 +#: ../../library/codecs.rst:1149 ../../library/codecs.rst:1184 msgid "Korean" msgstr "韓国語" -#: ../../library/codecs.rst:1148 +#: ../../library/codecs.rst:1082 msgid "cp950" msgstr "cp950" -#: ../../library/codecs.rst:1148 +#: ../../library/codecs.rst:1082 msgid "950, ms950" msgstr "950, ms950" -#: ../../library/codecs.rst:1150 +#: ../../library/codecs.rst:1084 msgid "cp1006" msgstr "cp1006" -#: ../../library/codecs.rst:1150 +#: ../../library/codecs.rst:1084 msgid "Urdu" msgstr "Urdu" -#: ../../library/codecs.rst:1152 +#: ../../library/codecs.rst:1086 msgid "cp1026" msgstr "cp1026" -#: ../../library/codecs.rst:1152 +#: ../../library/codecs.rst:1086 msgid "ibm1026" msgstr "ibm1026" -#: ../../library/codecs.rst:1154 +#: ../../library/codecs.rst:1088 msgid "cp1125" msgstr "cp1125" -#: ../../library/codecs.rst:1154 +#: ../../library/codecs.rst:1088 msgid "1125, ibm1125, cp866u, ruscii" msgstr "1125, ibm1125, cp866u, ruscii" -#: ../../library/codecs.rst:1154 ../../library/codecs.rst:1258 +#: ../../library/codecs.rst:1088 ../../library/codecs.rst:1192 msgid "Ukrainian" msgstr "ウクライナ語" -#: ../../library/codecs.rst:1158 +#: ../../library/codecs.rst:1092 msgid "cp1140" msgstr "cp1140" -#: ../../library/codecs.rst:1158 +#: ../../library/codecs.rst:1092 msgid "ibm1140" msgstr "ibm1140" -#: ../../library/codecs.rst:1160 +#: ../../library/codecs.rst:1094 msgid "cp1250" msgstr "cp1250" -#: ../../library/codecs.rst:1160 +#: ../../library/codecs.rst:1094 msgid "windows-1250" msgstr "windows-1250" -#: ../../library/codecs.rst:1162 +#: ../../library/codecs.rst:1096 msgid "cp1251" msgstr "cp1251" -#: ../../library/codecs.rst:1162 +#: ../../library/codecs.rst:1096 msgid "windows-1251" msgstr "windows-1251" -#: ../../library/codecs.rst:1165 +#: ../../library/codecs.rst:1099 msgid "cp1252" msgstr "cp1252" -#: ../../library/codecs.rst:1165 +#: ../../library/codecs.rst:1099 msgid "windows-1252" msgstr "windows-1252" -#: ../../library/codecs.rst:1167 +#: ../../library/codecs.rst:1101 msgid "cp1253" msgstr "cp1253" -#: ../../library/codecs.rst:1167 +#: ../../library/codecs.rst:1101 msgid "windows-1253" msgstr "windows-1253" -#: ../../library/codecs.rst:1169 +#: ../../library/codecs.rst:1103 msgid "cp1254" msgstr "cp1254" -#: ../../library/codecs.rst:1169 +#: ../../library/codecs.rst:1103 msgid "windows-1254" msgstr "windows-1254" -#: ../../library/codecs.rst:1171 +#: ../../library/codecs.rst:1105 msgid "cp1255" msgstr "cp1255" -#: ../../library/codecs.rst:1171 +#: ../../library/codecs.rst:1105 msgid "windows-1255" msgstr "windows-1255" -#: ../../library/codecs.rst:1173 +#: ../../library/codecs.rst:1107 msgid "cp1256" msgstr "cp1256" -#: ../../library/codecs.rst:1173 +#: ../../library/codecs.rst:1107 msgid "windows-1256" msgstr "windows-1256" -#: ../../library/codecs.rst:1175 +#: ../../library/codecs.rst:1109 msgid "cp1257" msgstr "cp1257" -#: ../../library/codecs.rst:1175 +#: ../../library/codecs.rst:1109 msgid "windows-1257" msgstr "windows-1257" -#: ../../library/codecs.rst:1177 +#: ../../library/codecs.rst:1111 msgid "cp1258" msgstr "cp1258" -#: ../../library/codecs.rst:1177 +#: ../../library/codecs.rst:1111 msgid "windows-1258" msgstr "windows-1258" -#: ../../library/codecs.rst:1177 +#: ../../library/codecs.rst:1111 msgid "Vietnamese" msgstr "ベトナム" -#: ../../library/codecs.rst:1179 +#: ../../library/codecs.rst:1113 msgid "euc_jp" msgstr "euc_jp" -#: ../../library/codecs.rst:1179 +#: ../../library/codecs.rst:1113 msgid "eucjp, ujis, u-jis" msgstr "eucjp, ujis, u-jis" -#: ../../library/codecs.rst:1181 +#: ../../library/codecs.rst:1115 msgid "euc_jis_2004" msgstr "euc_jis_2004" -#: ../../library/codecs.rst:1181 +#: ../../library/codecs.rst:1115 msgid "jisx0213, eucjis2004" msgstr "jisx0213, eucjis2004" -#: ../../library/codecs.rst:1183 +#: ../../library/codecs.rst:1117 msgid "euc_jisx0213" msgstr "euc_jisx0213" -#: ../../library/codecs.rst:1183 +#: ../../library/codecs.rst:1117 msgid "eucjisx0213" msgstr "eucjisx0213" -#: ../../library/codecs.rst:1185 +#: ../../library/codecs.rst:1119 msgid "euc_kr" msgstr "euc_kr" -#: ../../library/codecs.rst:1185 +#: ../../library/codecs.rst:1119 msgid "euckr, korean, ksc5601, ks_c-5601, ks_c-5601-1987, ksx1001, ks_x-1001" msgstr "euckr, korean, ksc5601, ks_c-5601, ks_c-5601-1987, ksx1001, ks_x-1001" -#: ../../library/codecs.rst:1189 +#: ../../library/codecs.rst:1123 msgid "gb2312" msgstr "gb2312" -#: ../../library/codecs.rst:1189 +#: ../../library/codecs.rst:1123 msgid "" "chinese, csiso58gb231280, euc-cn, euccn, eucgb2312-cn, gb2312-1980, " "gb2312-80, iso-ir-58" @@ -2314,431 +2282,431 @@ msgstr "" "chinese, csiso58gb231280, euc-cn, euccn, eucgb2312-cn, gb2312-1980, " "gb2312-80, iso-ir-58" -#: ../../library/codecs.rst:1189 ../../library/codecs.rst:1198 +#: ../../library/codecs.rst:1123 ../../library/codecs.rst:1132 msgid "Simplified Chinese" msgstr "簡体字中国語" -#: ../../library/codecs.rst:1194 +#: ../../library/codecs.rst:1128 msgid "gbk" msgstr "gbk" -#: ../../library/codecs.rst:1194 +#: ../../library/codecs.rst:1128 msgid "936, cp936, ms936" msgstr "936, cp936, ms936" -#: ../../library/codecs.rst:1194 ../../library/codecs.rst:1196 +#: ../../library/codecs.rst:1128 ../../library/codecs.rst:1130 msgid "Unified Chinese" msgstr "Unified Chinese" -#: ../../library/codecs.rst:1196 +#: ../../library/codecs.rst:1130 msgid "gb18030" msgstr "gb18030" -#: ../../library/codecs.rst:1196 +#: ../../library/codecs.rst:1130 msgid "gb18030-2000" msgstr "gb18030-2000" -#: ../../library/codecs.rst:1198 +#: ../../library/codecs.rst:1132 msgid "hz" msgstr "hz" -#: ../../library/codecs.rst:1198 +#: ../../library/codecs.rst:1132 msgid "hzgb, hz-gb, hz-gb-2312" msgstr "hzgb, hz-gb, hz-gb-2312" -#: ../../library/codecs.rst:1200 +#: ../../library/codecs.rst:1134 msgid "iso2022_jp" msgstr "iso2022_jp" -#: ../../library/codecs.rst:1200 +#: ../../library/codecs.rst:1134 msgid "csiso2022jp, iso2022jp, iso-2022-jp" msgstr "csiso2022jp, iso2022jp, iso-2022-jp" -#: ../../library/codecs.rst:1203 +#: ../../library/codecs.rst:1137 msgid "iso2022_jp_1" msgstr "iso2022_jp_1" -#: ../../library/codecs.rst:1203 +#: ../../library/codecs.rst:1137 msgid "iso2022jp-1, iso-2022-jp-1" msgstr "iso2022jp-1, iso-2022-jp-1" -#: ../../library/codecs.rst:1205 +#: ../../library/codecs.rst:1139 msgid "iso2022_jp_2" msgstr "iso2022_jp_2" -#: ../../library/codecs.rst:1205 +#: ../../library/codecs.rst:1139 msgid "iso2022jp-2, iso-2022-jp-2" msgstr "iso2022jp-2, iso-2022-jp-2" -#: ../../library/codecs.rst:1205 +#: ../../library/codecs.rst:1139 msgid "Japanese, Korean, Simplified Chinese, Western Europe, Greek" msgstr "日本語, 韓国語, 簡体字中国語, 西欧, ギリシャ語" -#: ../../library/codecs.rst:1208 +#: ../../library/codecs.rst:1142 msgid "iso2022_jp_2004" msgstr "iso2022_jp_2004" -#: ../../library/codecs.rst:1208 +#: ../../library/codecs.rst:1142 msgid "iso2022jp-2004, iso-2022-jp-2004" msgstr "iso2022jp-2004, iso-2022-jp-2004" -#: ../../library/codecs.rst:1211 +#: ../../library/codecs.rst:1145 msgid "iso2022_jp_3" msgstr "iso2022_jp_3" -#: ../../library/codecs.rst:1211 +#: ../../library/codecs.rst:1145 msgid "iso2022jp-3, iso-2022-jp-3" msgstr "iso2022jp-3, iso-2022-jp-3" -#: ../../library/codecs.rst:1213 +#: ../../library/codecs.rst:1147 msgid "iso2022_jp_ext" msgstr "iso2022_jp_ext" -#: ../../library/codecs.rst:1213 +#: ../../library/codecs.rst:1147 msgid "iso2022jp-ext, iso-2022-jp-ext" msgstr "iso2022jp-ext, iso-2022-jp-ext" -#: ../../library/codecs.rst:1215 +#: ../../library/codecs.rst:1149 msgid "iso2022_kr" msgstr "iso2022_kr" -#: ../../library/codecs.rst:1215 +#: ../../library/codecs.rst:1149 msgid "csiso2022kr, iso2022kr, iso-2022-kr" msgstr "csiso2022kr, iso2022kr, iso-2022-kr" -#: ../../library/codecs.rst:1218 +#: ../../library/codecs.rst:1152 msgid "latin_1" msgstr "latin_1" -#: ../../library/codecs.rst:1218 +#: ../../library/codecs.rst:1152 msgid "iso-8859-1, iso8859-1, 8859, cp819, latin, latin1, L1" msgstr "iso-8859-1, iso8859-1, 8859, cp819, latin, latin1, L1" -#: ../../library/codecs.rst:1221 +#: ../../library/codecs.rst:1155 msgid "iso8859_2" msgstr "iso8859_2" -#: ../../library/codecs.rst:1221 +#: ../../library/codecs.rst:1155 msgid "iso-8859-2, latin2, L2" msgstr "iso-8859-2, latin2, L2" -#: ../../library/codecs.rst:1223 +#: ../../library/codecs.rst:1157 msgid "iso8859_3" msgstr "iso8859_3" -#: ../../library/codecs.rst:1223 +#: ../../library/codecs.rst:1157 msgid "iso-8859-3, latin3, L3" msgstr "iso-8859-3, latin3, L3" -#: ../../library/codecs.rst:1223 +#: ../../library/codecs.rst:1157 msgid "Esperanto, Maltese" msgstr "エスペラント、マルタ" -#: ../../library/codecs.rst:1225 +#: ../../library/codecs.rst:1159 msgid "iso8859_4" msgstr "iso8859_4" -#: ../../library/codecs.rst:1225 +#: ../../library/codecs.rst:1159 msgid "iso-8859-4, latin4, L4" msgstr "iso-8859-4, latin4, L4" -#: ../../library/codecs.rst:1227 +#: ../../library/codecs.rst:1161 msgid "iso8859_5" msgstr "iso8859_5" -#: ../../library/codecs.rst:1227 +#: ../../library/codecs.rst:1161 msgid "iso-8859-5, cyrillic" msgstr "iso-8859-5, cyrillic" -#: ../../library/codecs.rst:1230 +#: ../../library/codecs.rst:1164 msgid "iso8859_6" msgstr "iso8859_6" -#: ../../library/codecs.rst:1230 +#: ../../library/codecs.rst:1164 msgid "iso-8859-6, arabic" msgstr "iso-8859-6, arabic" -#: ../../library/codecs.rst:1232 +#: ../../library/codecs.rst:1166 msgid "iso8859_7" msgstr "iso8859_7" -#: ../../library/codecs.rst:1232 +#: ../../library/codecs.rst:1166 msgid "iso-8859-7, greek, greek8" msgstr "iso-8859-7, greek, greek8" -#: ../../library/codecs.rst:1234 +#: ../../library/codecs.rst:1168 msgid "iso8859_8" msgstr "iso8859_8" -#: ../../library/codecs.rst:1234 +#: ../../library/codecs.rst:1168 msgid "iso-8859-8, hebrew" msgstr "iso-8859-8, hebrew" -#: ../../library/codecs.rst:1236 +#: ../../library/codecs.rst:1170 msgid "iso8859_9" msgstr "iso8859_9" -#: ../../library/codecs.rst:1236 +#: ../../library/codecs.rst:1170 msgid "iso-8859-9, latin5, L5" msgstr "iso-8859-9, latin5, L5" -#: ../../library/codecs.rst:1238 +#: ../../library/codecs.rst:1172 msgid "iso8859_10" msgstr "iso8859_10" -#: ../../library/codecs.rst:1238 +#: ../../library/codecs.rst:1172 msgid "iso-8859-10, latin6, L6" msgstr "iso-8859-10, latin6, L6" -#: ../../library/codecs.rst:1238 +#: ../../library/codecs.rst:1172 msgid "Nordic languages" msgstr "北欧語" -#: ../../library/codecs.rst:1240 +#: ../../library/codecs.rst:1174 msgid "iso8859_11" msgstr "iso8859_11" -#: ../../library/codecs.rst:1240 +#: ../../library/codecs.rst:1174 msgid "iso-8859-11, thai" msgstr "iso-8859-11, thai" -#: ../../library/codecs.rst:1240 +#: ../../library/codecs.rst:1174 msgid "Thai languages" msgstr "タイ語" -#: ../../library/codecs.rst:1242 +#: ../../library/codecs.rst:1176 msgid "iso8859_13" msgstr "iso8859_13" -#: ../../library/codecs.rst:1242 +#: ../../library/codecs.rst:1176 msgid "iso-8859-13, latin7, L7" msgstr "iso-8859-13, latin7, L7" -#: ../../library/codecs.rst:1244 +#: ../../library/codecs.rst:1178 msgid "iso8859_14" msgstr "iso8859_14" -#: ../../library/codecs.rst:1244 +#: ../../library/codecs.rst:1178 msgid "iso-8859-14, latin8, L8" msgstr "iso-8859-14, latin8, L8" -#: ../../library/codecs.rst:1244 +#: ../../library/codecs.rst:1178 msgid "Celtic languages" msgstr "ケルト語" -#: ../../library/codecs.rst:1246 +#: ../../library/codecs.rst:1180 msgid "iso8859_15" msgstr "iso8859_15" -#: ../../library/codecs.rst:1246 +#: ../../library/codecs.rst:1180 msgid "iso-8859-15, latin9, L9" msgstr "iso-8859-15, latin9, L9" -#: ../../library/codecs.rst:1248 +#: ../../library/codecs.rst:1182 msgid "iso8859_16" msgstr "iso8859_16" -#: ../../library/codecs.rst:1248 +#: ../../library/codecs.rst:1182 msgid "iso-8859-16, latin10, L10" msgstr "iso-8859-16, latin10, L10" -#: ../../library/codecs.rst:1248 +#: ../../library/codecs.rst:1182 msgid "South-Eastern Europe" msgstr "南東ヨーロッパ" -#: ../../library/codecs.rst:1250 +#: ../../library/codecs.rst:1184 msgid "johab" msgstr "johab" -#: ../../library/codecs.rst:1250 +#: ../../library/codecs.rst:1184 msgid "cp1361, ms1361" msgstr "cp1361, ms1361" -#: ../../library/codecs.rst:1252 +#: ../../library/codecs.rst:1186 msgid "koi8_r" msgstr "koi8_r" -#: ../../library/codecs.rst:1254 +#: ../../library/codecs.rst:1188 msgid "koi8_t" msgstr "koi8_t" -#: ../../library/codecs.rst:1254 +#: ../../library/codecs.rst:1188 msgid "Tajik" msgstr "タジク" -#: ../../library/codecs.rst:1258 +#: ../../library/codecs.rst:1192 msgid "koi8_u" msgstr "koi8_u" -#: ../../library/codecs.rst:1260 +#: ../../library/codecs.rst:1194 msgid "kz1048" msgstr "kz1048" -#: ../../library/codecs.rst:1260 +#: ../../library/codecs.rst:1194 msgid "kz_1048, strk1048_2002, rk1048" msgstr "kz_1048, strk1048_2002, rk1048" -#: ../../library/codecs.rst:1260 ../../library/codecs.rst:1278 +#: ../../library/codecs.rst:1194 ../../library/codecs.rst:1212 msgid "Kazakh" msgstr "カザフ" -#: ../../library/codecs.rst:1264 +#: ../../library/codecs.rst:1198 msgid "mac_cyrillic" msgstr "mac_cyrillic" -#: ../../library/codecs.rst:1264 +#: ../../library/codecs.rst:1198 msgid "maccyrillic" msgstr "maccyrillic" -#: ../../library/codecs.rst:1267 +#: ../../library/codecs.rst:1201 msgid "mac_greek" msgstr "mac_greek" -#: ../../library/codecs.rst:1267 +#: ../../library/codecs.rst:1201 msgid "macgreek" msgstr "macgreek" -#: ../../library/codecs.rst:1269 +#: ../../library/codecs.rst:1203 msgid "mac_iceland" msgstr "mac_iceland" -#: ../../library/codecs.rst:1269 +#: ../../library/codecs.rst:1203 msgid "maciceland" msgstr "maciceland" -#: ../../library/codecs.rst:1271 +#: ../../library/codecs.rst:1205 msgid "mac_latin2" msgstr "mac_latin2" -#: ../../library/codecs.rst:1271 +#: ../../library/codecs.rst:1205 msgid "maclatin2, maccentraleurope, mac_centeuro" msgstr "" -#: ../../library/codecs.rst:1274 +#: ../../library/codecs.rst:1208 msgid "mac_roman" msgstr "mac_roman" -#: ../../library/codecs.rst:1274 +#: ../../library/codecs.rst:1208 msgid "macroman, macintosh" msgstr "macroman, macintosh" -#: ../../library/codecs.rst:1276 +#: ../../library/codecs.rst:1210 msgid "mac_turkish" msgstr "mac_turkish" -#: ../../library/codecs.rst:1276 +#: ../../library/codecs.rst:1210 msgid "macturkish" msgstr "macturkish" -#: ../../library/codecs.rst:1278 +#: ../../library/codecs.rst:1212 msgid "ptcp154" msgstr "ptcp154" -#: ../../library/codecs.rst:1278 +#: ../../library/codecs.rst:1212 msgid "csptcp154, pt154, cp154, cyrillic-asian" msgstr "csptcp154, pt154, cp154, cyrillic-asian" -#: ../../library/codecs.rst:1281 +#: ../../library/codecs.rst:1215 msgid "shift_jis" msgstr "shift_jis" -#: ../../library/codecs.rst:1281 +#: ../../library/codecs.rst:1215 msgid "csshiftjis, shiftjis, sjis, s_jis" msgstr "csshiftjis, shiftjis, sjis, s_jis" -#: ../../library/codecs.rst:1284 +#: ../../library/codecs.rst:1218 msgid "shift_jis_2004" msgstr "shift_jis_2004" -#: ../../library/codecs.rst:1284 +#: ../../library/codecs.rst:1218 msgid "shiftjis2004, sjis_2004, sjis2004" msgstr "shiftjis2004, sjis_2004, sjis2004" -#: ../../library/codecs.rst:1287 +#: ../../library/codecs.rst:1221 msgid "shift_jisx0213" msgstr "shift_jisx0213" -#: ../../library/codecs.rst:1287 +#: ../../library/codecs.rst:1221 msgid "shiftjisx0213, sjisx0213, s_jisx0213" msgstr "shiftjisx0213, sjisx0213, s_jisx0213" -#: ../../library/codecs.rst:1290 +#: ../../library/codecs.rst:1224 msgid "utf_32" msgstr "utf_32" -#: ../../library/codecs.rst:1290 +#: ../../library/codecs.rst:1224 msgid "U32, utf32" msgstr "U32, utf32" -#: ../../library/codecs.rst:1290 ../../library/codecs.rst:1292 -#: ../../library/codecs.rst:1294 ../../library/codecs.rst:1296 -#: ../../library/codecs.rst:1298 ../../library/codecs.rst:1300 -#: ../../library/codecs.rst:1302 ../../library/codecs.rst:1304 -#: ../../library/codecs.rst:1306 +#: ../../library/codecs.rst:1224 ../../library/codecs.rst:1226 +#: ../../library/codecs.rst:1228 ../../library/codecs.rst:1230 +#: ../../library/codecs.rst:1232 ../../library/codecs.rst:1234 +#: ../../library/codecs.rst:1236 ../../library/codecs.rst:1238 +#: ../../library/codecs.rst:1240 msgid "all languages" msgstr "全ての言語" -#: ../../library/codecs.rst:1292 +#: ../../library/codecs.rst:1226 msgid "utf_32_be" msgstr "utf_32_be" -#: ../../library/codecs.rst:1292 +#: ../../library/codecs.rst:1226 msgid "UTF-32BE" msgstr "UTF-32BE" -#: ../../library/codecs.rst:1294 +#: ../../library/codecs.rst:1228 msgid "utf_32_le" msgstr "utf_32_le" -#: ../../library/codecs.rst:1294 +#: ../../library/codecs.rst:1228 msgid "UTF-32LE" msgstr "UTF-32LE" -#: ../../library/codecs.rst:1296 +#: ../../library/codecs.rst:1230 msgid "utf_16" msgstr "utf_16" -#: ../../library/codecs.rst:1296 +#: ../../library/codecs.rst:1230 msgid "U16, utf16" msgstr "U16, utf16" -#: ../../library/codecs.rst:1298 +#: ../../library/codecs.rst:1232 msgid "utf_16_be" msgstr "utf_16_be" -#: ../../library/codecs.rst:1298 +#: ../../library/codecs.rst:1232 msgid "UTF-16BE" msgstr "UTF-16BE" -#: ../../library/codecs.rst:1300 +#: ../../library/codecs.rst:1234 msgid "utf_16_le" msgstr "utf_16_le" -#: ../../library/codecs.rst:1300 +#: ../../library/codecs.rst:1234 msgid "UTF-16LE" msgstr "UTF-16LE" -#: ../../library/codecs.rst:1302 +#: ../../library/codecs.rst:1236 msgid "utf_7" msgstr "utf_7" -#: ../../library/codecs.rst:1302 +#: ../../library/codecs.rst:1236 msgid "U7, unicode-1-1-utf-7" msgstr "U7, unicode-1-1-utf-7" -#: ../../library/codecs.rst:1304 +#: ../../library/codecs.rst:1238 msgid "utf_8" msgstr "utf_8" -#: ../../library/codecs.rst:1304 +#: ../../library/codecs.rst:1238 msgid "U8, UTF, utf8, cp65001" msgstr "" -#: ../../library/codecs.rst:1306 +#: ../../library/codecs.rst:1240 msgid "utf_8_sig" msgstr "utf_8_sig" -#: ../../library/codecs.rst:1309 +#: ../../library/codecs.rst:1243 msgid "" "The utf-16\\* and utf-32\\* encoders no longer allow surrogate code points " "(``U+D800``--``U+DFFF``) to be encoded. The utf-32\\* decoders no longer " @@ -2748,19 +2716,15 @@ msgstr "" "``U+DFFF``) がエンコードされることを許可しなくなりました。utf-32\\* デコーダ" "は、サロゲートコードポイントに対応するバイト列をデコードしなくなりました。" -#: ../../library/codecs.rst:1315 +#: ../../library/codecs.rst:1249 msgid "``cp65001`` is now an alias to ``utf_8``." msgstr "" -#: ../../library/codecs.rst:1318 -msgid "On Windows, ``cpXXX`` codecs are now available for all code pages." -msgstr "" - -#: ../../library/codecs.rst:1323 +#: ../../library/codecs.rst:1254 msgid "Python Specific Encodings" msgstr "Python 特有のエンコーディング" -#: ../../library/codecs.rst:1325 +#: ../../library/codecs.rst:1256 msgid "" "A number of predefined codecs are specific to Python, so their codec names " "have no meaning outside Python. These are listed in the tables below based " @@ -2777,11 +2741,11 @@ msgstr "" "い)。非対称的な codec については、記載された意味がエンコーディングの方向を説" "明しています。" -#: ../../library/codecs.rst:1333 +#: ../../library/codecs.rst:1264 msgid "Text Encodings" msgstr "テキストエンコーディング" -#: ../../library/codecs.rst:1335 +#: ../../library/codecs.rst:1266 msgid "" "The following codecs provide :class:`str` to :class:`bytes` encoding and :" "term:`bytes-like object` to :class:`str` decoding, similar to the Unicode " @@ -2791,11 +2755,11 @@ msgstr "" "`str` から :class:`bytes` へのエンコードと、 :term:`bytes-like object` から :" "class:`str` へのデコードを提供します。" -#: ../../library/codecs.rst:1344 +#: ../../library/codecs.rst:1275 msgid "idna" msgstr "idna" -#: ../../library/codecs.rst:1344 +#: ../../library/codecs.rst:1275 msgid "" "Implement :rfc:`3490`, see also :mod:`encodings.idna`. Only " "``errors='strict'`` is supported." @@ -2803,64 +2767,67 @@ msgstr "" ":rfc:`3490` の実装です。 :mod:`encodings.idna` も参照してください。 " "``errors='strict'`` のみがサポートされています。" -#: ../../library/codecs.rst:1350 +#: ../../library/codecs.rst:1281 msgid "mbcs" msgstr "mbcs" -#: ../../library/codecs.rst:1350 +#: ../../library/codecs.rst:1281 msgid "ansi, dbcs" msgstr "ansi, dbcs" -#: ../../library/codecs.rst:1350 +#: ../../library/codecs.rst:1281 msgid "" "Windows only: Encode the operand according to the ANSI codepage (CP_ACP)." msgstr "" "Windows のみ: 被演算子を ANSI コードページ (CP_ACP) に従ってエンコードしま" "す。" -#: ../../library/codecs.rst:1354 +#: ../../library/codecs.rst:1285 msgid "oem" msgstr "oem" -#: ../../library/codecs.rst:1354 +#: ../../library/codecs.rst:1285 msgid "" "Windows only: Encode the operand according to the OEM codepage (CP_OEMCP)." msgstr "" "Windows のみ: 被演算子を OEM コードページ (CP_OEMCP) に従ってエンコードしま" "す。" -#: ../../library/codecs.rst:1360 +#: ../../library/codecs.rst:1291 msgid "palmos" msgstr "palmos" -#: ../../library/codecs.rst:1360 +#: ../../library/codecs.rst:1291 msgid "Encoding of PalmOS 3.5." msgstr "PalmOS 3.5 のエンコーディングです。" -#: ../../library/codecs.rst:1362 +#: ../../library/codecs.rst:1293 msgid "punycode" msgstr "punycode" -#: ../../library/codecs.rst:1362 +#: ../../library/codecs.rst:1293 msgid "Implement :rfc:`3492`. Stateful codecs are not supported." msgstr ":rfc:`3492` の実装です。ステートフル codecs は、サポートされません。" -#: ../../library/codecs.rst:1366 +#: ../../library/codecs.rst:1297 msgid "raw_unicode_escape" msgstr "raw_unicode_escape" -#: ../../library/codecs.rst:1366 +#: ../../library/codecs.rst:1297 msgid "" -"Latin-1 encoding with :samp:`\\\\u{XXXX}` and :samp:`\\\\U{XXXXXXXX}` for " -"other code points. Existing backslashes are not escaped in any way. It is " -"used in the Python pickle protocol." +"Latin-1 encoding with ``\\uXXXX`` and ``\\UXXXXXXXX`` for other code points. " +"Existing backslashes are not escaped in any way. It is used in the Python " +"pickle protocol." msgstr "" +"別のコードポイントに ``\\uXXXX`` と ``\\UXXXXXXXX`` を使用する Latin-1 エン" +"コーディングです。既存のバックスラッシュは、いかなる方法でもエスケープされま" +"せん。Python の pickle プロトコルで使用されます。" -#: ../../library/codecs.rst:1376 +#: ../../library/codecs.rst:1306 msgid "undefined" msgstr "undefined" -#: ../../library/codecs.rst:1376 +#: ../../library/codecs.rst:1306 msgid "" "Raise an exception for all conversions, even empty strings. The error " "handler is ignored." @@ -2868,11 +2835,11 @@ msgstr "" "空文字列を含む全ての変換に対して例外を送出します。エラーハンドラは無視されま" "す。" -#: ../../library/codecs.rst:1381 +#: ../../library/codecs.rst:1311 msgid "unicode_escape" msgstr "unicode_escape" -#: ../../library/codecs.rst:1381 +#: ../../library/codecs.rst:1311 msgid "" "Encoding suitable as the contents of a Unicode literal in ASCII-encoded " "Python source code, except that quotes are not escaped. Decode from Latin-1 " @@ -2883,15 +2850,15 @@ msgstr "" "ドからデコードします。実際には、Python のソースコードはデフォルトでは UTF-8 " "を使用することに注意してください。" -#: ../../library/codecs.rst:1393 +#: ../../library/codecs.rst:1323 msgid "\"unicode_internal\" codec is removed." msgstr "" -#: ../../library/codecs.rst:1400 +#: ../../library/codecs.rst:1330 msgid "Binary Transforms" msgstr "バイナリ変換 (Binary Transforms)" -#: ../../library/codecs.rst:1402 +#: ../../library/codecs.rst:1332 msgid "" "The following codecs provide binary transforms: :term:`bytes-like object` " "to :class:`bytes` mappings. They are not supported by :meth:`bytes.decode` " @@ -2901,19 +2868,19 @@ msgstr "" "バイナリ変換を提供します。:meth:`bytes.decode` はこの変換をサポートしておら" "ず、 :class:`str` を出力するだけです。" -#: ../../library/codecs.rst:1410 +#: ../../library/codecs.rst:1340 msgid "Encoder / decoder" msgstr "エンコーダ / デコーダ" -#: ../../library/codecs.rst:1412 +#: ../../library/codecs.rst:1342 msgid "base64_codec [#b64]_" msgstr "base64_codec [#b64]_" -#: ../../library/codecs.rst:1412 +#: ../../library/codecs.rst:1342 msgid "base64, base_64" msgstr "base64, base_64" -#: ../../library/codecs.rst:1412 +#: ../../library/codecs.rst:1342 msgid "" "Convert the operand to multiline MIME base64 (the result always includes a " "trailing ``'\\n'``)." @@ -2921,96 +2888,100 @@ msgstr "" "被演算子をマルチラインの MIME base64 に変換します (結果は常に末尾の " "``'\\n'`` を含みます)。" -#: ../../library/codecs.rst:1417 +#: ../../library/codecs.rst:1347 msgid "" "accepts any :term:`bytes-like object` as input for encoding and decoding" msgstr "" "任意の :term:`bytes-like object` をエンコードとデコード用の入力として受け取り" "ます。" -#: ../../library/codecs.rst:1412 +#: ../../library/codecs.rst:1342 msgid ":meth:`base64.encodebytes` / :meth:`base64.decodebytes`" msgstr ":meth:`base64.encodebytes` / :meth:`base64.decodebytes`" -#: ../../library/codecs.rst:1423 +#: ../../library/codecs.rst:1353 msgid "bz2_codec" msgstr "bz2_codec" -#: ../../library/codecs.rst:1423 +#: ../../library/codecs.rst:1353 msgid "bz2" msgstr "bz2" -#: ../../library/codecs.rst:1423 +#: ../../library/codecs.rst:1353 msgid "Compress the operand using bz2." msgstr "被演算子をbz2を使って圧縮します。" -#: ../../library/codecs.rst:1423 +#: ../../library/codecs.rst:1353 msgid ":meth:`bz2.compress` / :meth:`bz2.decompress`" msgstr ":meth:`bz2.compress` / :meth:`bz2.decompress`" -#: ../../library/codecs.rst:1426 +#: ../../library/codecs.rst:1356 msgid "hex_codec" msgstr "hex_codec" -#: ../../library/codecs.rst:1426 +#: ../../library/codecs.rst:1356 msgid "hex" msgstr "hex" -#: ../../library/codecs.rst:1426 +#: ../../library/codecs.rst:1356 msgid "" "Convert the operand to hexadecimal representation, with two digits per byte." msgstr "被演算子をバイトあたり 2 桁の 16 進数の表現に変換します。" -#: ../../library/codecs.rst:1426 +#: ../../library/codecs.rst:1356 msgid ":meth:`binascii.b2a_hex` / :meth:`binascii.a2b_hex`" msgstr ":meth:`binascii.b2a_hex` / :meth:`binascii.a2b_hex`" -#: ../../library/codecs.rst:1431 +#: ../../library/codecs.rst:1361 msgid "quopri_codec" msgstr "quopri_codec" -#: ../../library/codecs.rst:1431 +#: ../../library/codecs.rst:1361 msgid "quopri, quotedprintable, quoted_printable" msgstr "quopri, quotedprintable, quoted_printable" -#: ../../library/codecs.rst:1431 +#: ../../library/codecs.rst:1361 msgid "Convert the operand to MIME quoted printable." msgstr "被演算子を MIME quoted printable 形式に変換します。" -#: ../../library/codecs.rst:1431 +#: ../../library/codecs.rst:1361 msgid ":meth:`quopri.encode` with ``quotetabs=True`` / :meth:`quopri.decode`" msgstr "" "``quotetabs=True`` を指定した :meth:`quopri.encode` / :meth:`quopri.decode`" -#: ../../library/codecs.rst:1435 +#: ../../library/codecs.rst:1365 msgid "uu_codec" msgstr "uu_codec" -#: ../../library/codecs.rst:1435 +#: ../../library/codecs.rst:1365 msgid "uu" msgstr "uu" -#: ../../library/codecs.rst:1435 +#: ../../library/codecs.rst:1365 msgid "Convert the operand using uuencode." msgstr "被演算子を uuencode を用いて変換します。" -#: ../../library/codecs.rst:1438 +#: ../../library/codecs.rst:1365 +msgid ":meth:`uu.encode` / :meth:`uu.decode`" +msgstr ":meth:`uu.encode` / :meth:`uu.decode`" + +#: ../../library/codecs.rst:1368 msgid "zlib_codec" msgstr "zlib_codec" -#: ../../library/codecs.rst:1438 +#: ../../library/codecs.rst:1368 msgid "zip, zlib" msgstr "zip, zlib" -#: ../../library/codecs.rst:1438 +#: ../../library/codecs.rst:1368 msgid "Compress the operand using gzip." msgstr "被演算子を gzip を用いて圧縮します。" -#: ../../library/codecs.rst:1438 +#: ../../library/codecs.rst:1368 msgid ":meth:`zlib.compress` / :meth:`zlib.decompress`" msgstr ":meth:`zlib.compress` / :meth:`zlib.decompress`" -#: ../../library/codecs.rst:1442 +#: ../../library/codecs.rst:1372 msgid "" "In addition to :term:`bytes-like objects `, " "``'base64_codec'`` also accepts ASCII-only instances of :class:`str` for " @@ -3020,23 +2991,23 @@ msgstr "" "``'base64_codec'`` も :class:`str` の ASCII のみのインスタンスをデコード用に" "受け入れるようになりました" -#: ../../library/codecs.rst:1446 +#: ../../library/codecs.rst:1376 msgid "Restoration of the binary transforms." msgstr "" "バイナリ変換が復活しました。(訳注: 2.x にはあったものが 3.0 で削除されてい" "た。)" -#: ../../library/codecs.rst:1449 +#: ../../library/codecs.rst:1379 msgid "Restoration of the aliases for the binary transforms." msgstr "" "バイナリ変換のエイリアスが復活しました。(訳注: 2.x にはあったエイリアス。3.2 " "でエイリアスは復活しなかった。)" -#: ../../library/codecs.rst:1456 +#: ../../library/codecs.rst:1386 msgid "Text Transforms" msgstr "テキスト変換 (Text Transforms)" -#: ../../library/codecs.rst:1458 +#: ../../library/codecs.rst:1388 msgid "" "The following codec provides a text transform: a :class:`str` to :class:" "`str` mapping. It is not supported by :meth:`str.encode` (which only " @@ -3046,37 +3017,37 @@ msgstr "" "提供します。:meth:`str.encode` はこの変換をサポートしておらず、 :class:" "`bytes` を出力するだけです。" -#: ../../library/codecs.rst:1467 +#: ../../library/codecs.rst:1397 msgid "rot_13" msgstr "rot_13" -#: ../../library/codecs.rst:1467 +#: ../../library/codecs.rst:1397 msgid "rot13" msgstr "rot13" -#: ../../library/codecs.rst:1467 +#: ../../library/codecs.rst:1397 msgid "Return the Caesar-cypher encryption of the operand." msgstr "被演算子のシーザー暗号 (Caesar-cypher) を返します。" -#: ../../library/codecs.rst:1472 +#: ../../library/codecs.rst:1402 msgid "Restoration of the ``rot_13`` text transform." msgstr "" "``rot_13`` テキスト変換が復活しました。(訳注: 2.x にはあったものが 3.0 で削除" "されていた。)" -#: ../../library/codecs.rst:1475 +#: ../../library/codecs.rst:1405 msgid "Restoration of the ``rot13`` alias." msgstr "" "``rot13`` エイリアスが復活しました。(訳注: 2.x にはあったエイリアス。3.2 でエ" "イリアスは復活しなかった。)" -#: ../../library/codecs.rst:1480 +#: ../../library/codecs.rst:1410 msgid "" ":mod:`encodings.idna` --- Internationalized Domain Names in Applications" msgstr "" ":mod:`encodings.idna` --- アプリケーションにおける国際化ドメイン名 (IDNA)" -#: ../../library/codecs.rst:1486 +#: ../../library/codecs.rst:1416 msgid "" "This module implements :rfc:`3490` (Internationalized Domain Names in " "Applications) and :rfc:`3492` (Nameprep: A Stringprep Profile for " @@ -3089,13 +3060,13 @@ msgstr "" "ています。このモジュールは ``punycode`` エンコーディングおよび :mod:" "`stringprep` の上に構築されています。" -#: ../../library/codecs.rst:1491 +#: ../../library/codecs.rst:1421 msgid "" "If you need the IDNA 2008 standard from :rfc:`5891` and :rfc:`5895`, use the " -"third-party :pypi:`idna` module." +"third-party `idna module _`." msgstr "" -#: ../../library/codecs.rst:1494 +#: ../../library/codecs.rst:1424 msgid "" "These RFCs together define a protocol to support non-ASCII characters in " "domain names. A domain name containing non-ASCII characters (such as ``www." @@ -3119,7 +3090,7 @@ msgstr "" "インラベルをユーザに提供する前に Unicode に、それぞれ透過的に変換しなければな" "りません。" -#: ../../library/codecs.rst:1505 +#: ../../library/codecs.rst:1435 msgid "" "Python supports this conversion in several ways: the ``idna`` codec " "performs conversion between Unicode and ACE, separating an input string into " @@ -3147,7 +3118,7 @@ msgstr "" "します (:mod:`http.client` でもまた、 :mailheader:`Host` フィールドにある " "IDNA ホスト名を、フィールド全体を送信する場合に透過的に送信します)。" -#: ../../library/codecs.rst:1518 +#: ../../library/codecs.rst:1448 msgid "" "When receiving host names from the wire (such as in reverse name lookup), no " "automatic conversion to Unicode is performed: applications wishing to " @@ -3157,7 +3128,7 @@ msgstr "" "変換は行われません: こうしたホスト名をユーザに提供したいアプリケーションで" "は、Unicode にデコードしてやる必要があります。" -#: ../../library/codecs.rst:1522 +#: ../../library/codecs.rst:1452 msgid "" "The module :mod:`encodings.idna` also implements the nameprep procedure, " "which performs certain normalizations on host names, to achieve case-" @@ -3169,7 +3140,7 @@ msgstr "" "ようにするとともに、類似の文字を一元化します。 nameprep 関数は必要なら直接使" "うこともできます。" -#: ../../library/codecs.rst:1530 +#: ../../library/codecs.rst:1460 msgid "" "Return the nameprepped version of *label*. The implementation currently " "assumes query strings, so ``AllowUnassigned`` is true." @@ -3177,7 +3148,7 @@ msgstr "" "*label* を nameprep したバージョンを返します。現在の実装ではクエリ文字列を仮" "定しているので、``AllowUnassigned`` は真です。" -#: ../../library/codecs.rst:1536 +#: ../../library/codecs.rst:1466 msgid "" "Convert a label to ASCII, as specified in :rfc:`3490`. ``UseSTD3ASCIIRules`` " "is assumed to be false." @@ -3185,23 +3156,27 @@ msgstr "" ":rfc:`3490` 仕様に従ってラベルを ASCIIに変換します。 ``UseSTD3ASCIIRules`` は" "偽であると仮定します。" -#: ../../library/codecs.rst:1542 +#: ../../library/codecs.rst:1472 msgid "Convert a label to Unicode, as specified in :rfc:`3490`." msgstr ":rfc:`3490` 仕様に従ってラベルを Unicode に変換します。" -#: ../../library/codecs.rst:1546 +#: ../../library/codecs.rst:1476 msgid ":mod:`encodings.mbcs` --- Windows ANSI codepage" msgstr ":mod:`encodings.mbcs` --- Windows ANSI コードページ" -#: ../../library/codecs.rst:1551 +#: ../../library/codecs.rst:1481 msgid "This module implements the ANSI codepage (CP_ACP)." msgstr "" -#: ../../library/codecs.rst:1553 -msgid "Availability" -msgstr "" +#: ../../library/codecs.rst:1484 +msgid ":ref:`Availability `: Windows only." +msgstr ":ref:`利用可能な環境 `: Windows のみ。" -#: ../../library/codecs.rst:1555 +#: ../../library/codecs.rst:1485 +msgid "Support any error handler." +msgstr "任意のエラーハンドラのサポート。" + +#: ../../library/codecs.rst:1488 msgid "" "Before 3.2, the *errors* argument was ignored; ``'replace'`` was always used " "to encode, and ``'ignore'`` to decode." @@ -3209,15 +3184,11 @@ msgstr "" "3.2 以前は *errors* 引数は無視されました; エンコードには常に ``'replace'`` " "が、デコードには ``'ignore'`` が使われました。" -#: ../../library/codecs.rst:1559 -msgid "Support any error handler." -msgstr "任意のエラーハンドラのサポート。" - -#: ../../library/codecs.rst:1564 +#: ../../library/codecs.rst:1494 msgid ":mod:`encodings.utf_8_sig` --- UTF-8 codec with BOM signature" msgstr ":mod:`encodings.utf_8_sig` --- BOM 印付き UTF-8" -#: ../../library/codecs.rst:1570 +#: ../../library/codecs.rst:1500 msgid "" "This module implements a variant of the UTF-8 codec. On encoding, a UTF-8 " "encoded BOM will be prepended to the UTF-8 encoded bytes. For the stateful " @@ -3230,88 +3201,3 @@ msgstr "" "は内部状態を持つエンコーダで、この動作は (バイトストリームの最初の書き込み時" "に) 一度だけ行なわれます。デコーディング時は、データの最初に UTF-8 でエンコー" "ドされた BOM があれば、それをスキップします。" - -#: ../../library/codecs.rst:13 -msgid "Unicode" -msgstr "Unicode 文字列型" - -#: ../../library/codecs.rst:13 -msgid "encode" -msgstr "encode" - -#: ../../library/codecs.rst:13 -msgid "decode" -msgstr "decode" - -#: ../../library/codecs.rst:13 -msgid "streams" -msgstr "ストリーム" - -#: ../../library/codecs.rst:13 -msgid "stackable" -msgstr "スタック可能" - -#: ../../library/codecs.rst:316 -msgid "strict" -msgstr "" - -#: ../../library/codecs.rst:316 ../../library/codecs.rst:368 -#: ../../library/codecs.rst:391 -msgid "error handler's name" -msgstr "" - -#: ../../library/codecs.rst:316 -msgid "ignore" -msgstr "ignore" - -#: ../../library/codecs.rst:316 -msgid "replace" -msgstr "" - -#: ../../library/codecs.rst:316 -msgid "backslashreplace" -msgstr "" - -#: ../../library/codecs.rst:316 -msgid "surrogateescape" -msgstr "" - -#: ../../library/codecs.rst:316 -msgid "? (question mark)" -msgstr "? (クエスチョンマーク)" - -#: ../../library/codecs.rst:316 -msgid "replacement character" -msgstr "" - -#: ../../library/codecs.rst:316 -msgid "\\ (backslash)" -msgstr "" - -#: ../../library/codecs.rst:316 ../../library/codecs.rst:368 -msgid "escape sequence" -msgstr "エスケープシーケンス" - -#: ../../library/codecs.rst:316 -msgid "\\x" -msgstr "\\x" - -#: ../../library/codecs.rst:316 -msgid "\\u" -msgstr "\\u" - -#: ../../library/codecs.rst:316 -msgid "\\U" -msgstr "\\U" - -#: ../../library/codecs.rst:368 -msgid "xmlcharrefreplace" -msgstr "" - -#: ../../library/codecs.rst:368 -msgid "namereplace" -msgstr "" - -#: ../../library/codecs.rst:391 -msgid "surrogatepass" -msgstr "" diff --git a/library/codeop.po b/library/codeop.po index 58180586b..3f4d51c7c 100644 --- a/library/codeop.po +++ b/library/codeop.po @@ -1,32 +1,32 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 -# Arihiro TAKASE, 2023 -# 石井明久, 2024 +# Nozomu Kaneko , 2017 +# Arihiro TAKASE, 2017 +# Tetsuo Koyama , 2020 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-13 14:21+0000\n" -"PO-Revision-Date: 2021-06-28 00:56+0000\n" -"Last-Translator: 石井明久, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 23:02+0000\n" +"Last-Translator: Tetsuo Koyama , 2020\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/codeop.rst:2 -msgid ":mod:`!codeop` --- Compile Python code" -msgstr ":mod:`!codeop` --- Python コードをコンパイルする" +msgid ":mod:`codeop` --- Compile Python code" +msgstr ":mod:`codeop` --- Pythonコードをコンパイルする" #: ../../library/codeop.rst:10 msgid "**Source code:** :source:`Lib/codeop.py`" @@ -51,7 +51,7 @@ msgstr "この仕事には二つの部分があります:" #: ../../library/codeop.rst:22 msgid "" -"Being able to tell if a line of input completes a Python statement: in " +"Being able to tell if a line of input completes a Python statement: in " "short, telling whether to print '``>>>``' or '``...``' next." msgstr "" "入力の一行がPythonの文として完全であるかどうかを見分けられること: 簡単に言え" @@ -59,7 +59,7 @@ msgstr "" #: ../../library/codeop.rst:25 msgid "" -"Remembering which future statements the user has entered, so subsequent " +"Remembering which future statements the user has entered, so subsequent " "input can be compiled with these in effect." msgstr "" "どのfuture文をユーザが入力したのかを覚えていること。したがって、実質的にそれ" @@ -80,9 +80,9 @@ msgstr "前者は実行するには:" #: ../../library/codeop.rst:35 msgid "" "Tries to compile *source*, which should be a string of Python code and " -"return a code object if *source* is valid Python code. In that case, the " +"return a code object if *source* is valid Python code. In that case, the " "filename attribute of the code object will be *filename*, which defaults to " -"``''``. Returns ``None`` if *source* is *not* valid Python code, but " +"``''``. Returns ``None`` if *source* is *not* valid Python code, but " "is a prefix of valid Python code." msgstr "" "Pythonコードの文字列であるべき *source* をコンパイルしてみて、*source* が有効" @@ -104,14 +104,14 @@ msgstr "" #: ../../library/codeop.rst:45 msgid "" "The *symbol* argument determines whether *source* is compiled as a statement " -"(``'single'``, the default), as a sequence of :term:`statement` (``'exec'``) " -"or as an :term:`expression` (``'eval'``). Any other value will cause :exc:" -"`ValueError` to be raised." +"(``'single'``, the default), as a sequence of statements (``'exec'``) or as " +"an :term:`expression` (``'eval'``). Any other value will cause :exc:" +"`ValueError` to be raised." msgstr "" "*symbol* 引数は *source* が文としてコンパイルされるか(``'single'`` 、デフォル" -"ト) 、:term:`文 ` のシーケンスとしてか (``'exec'``) 、または :" -"term:`式 ` としてコンパイルされるかを決定します(``'eval'``)。他の" -"どんな値も :exc:`ValueError` を送出させます。" +"ト) 、文のシーケンスとしてか (``'exec'``) 、または :term:`式 ` と" +"してコンパイルされるかを決定します(``'eval'``)。他のどんな値も :exc:" +"`ValueError` を発生させる原因となります。" #: ../../library/codeop.rst:52 msgid "" @@ -128,28 +128,27 @@ msgstr "" #: ../../library/codeop.rst:61 msgid "" -"Instances of this class have :meth:`~object.__call__` methods identical in " -"signature to the built-in function :func:`compile`, but with the difference " -"that if the instance compiles program text containing a :mod:`__future__` " -"statement, the instance 'remembers' and compiles all subsequent program " -"texts with the statement in force." +"Instances of this class have :meth:`__call__` methods identical in signature " +"to the built-in function :func:`compile`, but with the difference that if " +"the instance compiles program text containing a :mod:`__future__` statement, " +"the instance 'remembers' and compiles all subsequent program texts with the " +"statement in force." msgstr "" "このクラスのインスタンスは組み込み関数 :func:`compile` とシグネチャが一致す" -"る :meth:`~object.__call__` メソッドを持っていますが、インスタンスが :mod:" +"る :meth:`__call__` メソッドを持っていますが、インスタンスが :mod:" "`__future__` 文を含むプログラムテキストをコンパイルする場合は、インスタンスは" "有効なその文とともに続くすべてのプログラムテキストを'覚えていて'コンパイルす" "るという違いがあります。" #: ../../library/codeop.rst:70 msgid "" -"Instances of this class have :meth:`~object.__call__` methods identical in " -"signature to :func:`compile_command`; the difference is that if the instance " -"compiles program text containing a :mod:`__future__` statement, the instance " -"'remembers' and compiles all subsequent program texts with the statement in " -"force." +"Instances of this class have :meth:`__call__` methods identical in signature " +"to :func:`compile_command`; the difference is that if the instance compiles " +"program text containing a ``__future__`` statement, the instance 'remembers' " +"and compiles all subsequent program texts with the statement in force." msgstr "" "このクラスのインスタンスは :func:`compile_command` とシグネチャが一致する :" -"meth:`~object.__call__` メソッドを持っています。インスタンスが :mod:" -"`__future__` 文を含むプログラムテキストをコンパイルする場合に、インスタンスは" -"有効なその文とともにそれに続くすべてのプログラムテキストを'覚えていて'コンパ" -"イルするという違いがあります。" +"meth:`__call__` メソッドを持っています。インスタンスが ``__future__`` 文を含" +"むプログラムテキストをコンパイルする場合に、インスタンスは有効なその文ととも" +"にそれに続くすべてのプログラムテキストを'覚えていて'コンパイルするという違い" +"があります。" diff --git a/library/collections.abc.po b/library/collections.abc.po index 0762e219d..ab30bbdb4 100644 --- a/library/collections.abc.po +++ b/library/collections.abc.po @@ -1,34 +1,38 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2022 -# souma987, 2023 -# 石井明久, 2024 -# Takanori Suzuki , 2024 -# Takeshi Nakazato, 2024 +# Shun Sakurai, 2017 +# 秘湯 , 2017 +# Nozomu Kaneko , 2017 +# Arihiro TAKASE, 2017 +# E. Kawashima, 2017 +# Nakamura Masahito , 2018 +# mollinaca, 2020 +# Takanori Suzuki , 2021 +# tomo, 2021 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:56+0000\n" -"Last-Translator: Takeshi Nakazato, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 23:03+0000\n" +"Last-Translator: tomo, 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/collections.abc.rst:2 -msgid ":mod:`!collections.abc` --- Abstract Base Classes for Containers" -msgstr ":mod:`!collections.abc` --- コンテナの抽象基底クラス" +msgid ":mod:`collections.abc` --- Abstract Base Classes for Containers" +msgstr ":mod:`collections.abc` --- コレクションの抽象基底クラス" #: ../../library/collections.abc.rst:10 msgid "Formerly, this module was part of the :mod:`collections` module." @@ -42,173 +46,17 @@ msgstr "**ソースコード:** :source:`Lib/_collections_abc.py`" msgid "" "This module provides :term:`abstract base classes ` " "that can be used to test whether a class provides a particular interface; " -"for example, whether it is :term:`hashable` or whether it is a :term:" -"`mapping`." +"for example, whether it is hashable or whether it is a mapping." msgstr "" "このモジュールは、 :term:`抽象基底クラス ` を提供しま" -"す。抽象基底クラスは、クラスが特定のインターフェースを提供しているか、例え" -"ば :term:`ハッシュ可能 ` であるかや :term:`マッピング ` で" -"あるかを判定します。" - -#: ../../library/collections.abc.rst:27 -msgid "" -"An :func:`issubclass` or :func:`isinstance` test for an interface works in " -"one of three ways." -msgstr "" -":func:`issubclass` や :func:`isinstance` を使ったインターフェースに対するテス" -"トは、以下の3つのいずれかの方法で動作します。" - -#: ../../library/collections.abc.rst:30 -msgid "" -"A newly written class can inherit directly from one of the abstract base " -"classes. The class must supply the required abstract methods. The " -"remaining mixin methods come from inheritance and can be overridden if " -"desired. Other methods may be added as needed:" -msgstr "" - -#: ../../library/collections.abc.rst:35 -msgid "" -"class C(Sequence): # Direct inheritance\n" -" def __init__(self): ... # Extra method not required by the " -"ABC\n" -" def __getitem__(self, index): ... # Required abstract method\n" -" def __len__(self): ... # Required abstract method\n" -" def count(self, value): ... # Optionally override a mixin method" -msgstr "" -"class C(Sequence): # Direct inheritance\n" -" def __init__(self): ... # Extra method not required by the " -"ABC\n" -" def __getitem__(self, index): ... # Required abstract method\n" -" def __len__(self): ... # Required abstract method\n" -" def count(self, value): ... # Optionally override a mixin method" - -#: ../../library/collections.abc.rst:43 -msgid "" -">>> issubclass(C, Sequence)\n" -"True\n" -">>> isinstance(C(), Sequence)\n" -"True" -msgstr "" -">>> issubclass(C, Sequence)\n" -"True\n" -">>> isinstance(C(), Sequence)\n" -"True" - -#: ../../library/collections.abc.rst:50 -msgid "" -"Existing classes and built-in classes can be registered as \"virtual " -"subclasses\" of the ABCs. Those classes should define the full API " -"including all of the abstract methods and all of the mixin methods. This " -"lets users rely on :func:`issubclass` or :func:`isinstance` tests to " -"determine whether the full interface is supported. The exception to this " -"rule is for methods that are automatically inferred from the rest of the API:" -msgstr "" - -#: ../../library/collections.abc.rst:58 -msgid "" -"class D: # No inheritance\n" -" def __init__(self): ... # Extra method not required by the " -"ABC\n" -" def __getitem__(self, index): ... # Abstract method\n" -" def __len__(self): ... # Abstract method\n" -" def count(self, value): ... # Mixin method\n" -" def index(self, value): ... # Mixin method\n" -"\n" -"Sequence.register(D) # Register instead of inherit" -msgstr "" -"class D: # No inheritance\n" -" def __init__(self): ... # Extra method not required by the " -"ABC\n" -" def __getitem__(self, index): ... # Abstract method\n" -" def __len__(self): ... # Abstract method\n" -" def count(self, value): ... # Mixin method\n" -" def index(self, value): ... # Mixin method\n" -"\n" -"Sequence.register(D) # Register instead of inherit" - -#: ../../library/collections.abc.rst:69 -msgid "" -">>> issubclass(D, Sequence)\n" -"True\n" -">>> isinstance(D(), Sequence)\n" -"True" -msgstr "" -">>> issubclass(D, Sequence)\n" -"True\n" -">>> isinstance(D(), Sequence)\n" -"True" - -#: ../../library/collections.abc.rst:76 -msgid "" -"In this example, class :class:`!D` does not need to define ``__contains__``, " -"``__iter__``, and ``__reversed__`` because the :ref:`in-operator " -"`, the :term:`iteration ` logic, and the :func:" -"`reversed` function automatically fall back to using ``__getitem__`` and " -"``__len__``." -msgstr "" -"この例では、クラス :class:`!D` は ``__contains__``, ``__iter__``, " -"``__reversed__`` を定義する必要がありません。なぜなら :ref:`in 演算子 " -"`, the :term:`反復 ` ロジック, および :func:" -"`reversed` 関数は自動的に ``__getitem__`` と ``__len__`` を使うようにフォール" -"バックするからです。" - -#: ../../library/collections.abc.rst:82 -msgid "" -"Some simple interfaces are directly recognizable by the presence of the " -"required methods (unless those methods have been set to :const:`None`):" -msgstr "" - -#: ../../library/collections.abc.rst:85 -msgid "" -"class E:\n" -" def __iter__(self): ...\n" -" def __next__(self): ..." -msgstr "" -"class E:\n" -" def __iter__(self): ...\n" -" def __next__(self): ..." - -#: ../../library/collections.abc.rst:91 -msgid "" -">>> issubclass(E, Iterable)\n" -"True\n" -">>> isinstance(E(), Iterable)\n" -"True" -msgstr "" -">>> issubclass(E, Iterable)\n" -"True\n" -">>> isinstance(E(), Iterable)\n" -"True" - -#: ../../library/collections.abc.rst:98 -msgid "" -"Complex interfaces do not support this last technique because an interface " -"is more than just the presence of method names. Interfaces specify " -"semantics and relationships between methods that cannot be inferred solely " -"from the presence of specific method names. For example, knowing that a " -"class supplies ``__getitem__``, ``__len__``, and ``__iter__`` is " -"insufficient for distinguishing a :class:`Sequence` from a :class:`Mapping`." -msgstr "" -"複雑なインターフェースは、単に特定のメソッドが存在すること以上の定義を持つた" -"め、3番目のテクニックをサポートしていません。それらのインターフェースはメソッ" -"ドの意味やメソッド間の関係まで指定するので、特定のメソッド名の存在からだけで" -"はインターフェースの推測ができません。たとえば、あるクラスが " -"``__getitem__``, ``__len__``, および ``__iter__`` を提供するというだけで" -"は、 :class:`Sequence` と :class:`Mapping` を区別するには不十分です。" - -#: ../../library/collections.abc.rst:106 -msgid "" -"These abstract classes now support ``[]``. See :ref:`types-genericalias` " -"and :pep:`585`." -msgstr "" -"これらの抽象クラスは ``[]`` をサポートするようになりました。 :ref:`types-" -"genericalias` および :pep:`585` を参照してください。" +"す。抽象基底クラスは、クラスが特定のインターフェースを提供しているか、例えば" +"ハッシュ可能であるかやマッピングであるかを判定します。" -#: ../../library/collections.abc.rst:113 +#: ../../library/collections.abc.rst:31 msgid "Collections Abstract Base Classes" msgstr "コレクション抽象基底クラス" -#: ../../library/collections.abc.rst:115 +#: ../../library/collections.abc.rst:33 msgid "" "The collections module offers the following :term:`ABCs `:" @@ -216,169 +64,169 @@ msgstr "" "collections モジュールは以下の :term:`ABC (抽象基底クラス) ` を提供します:" -#: ../../library/collections.abc.rst:120 +#: ../../library/collections.abc.rst:38 msgid "ABC" msgstr "ABC" -#: ../../library/collections.abc.rst:120 +#: ../../library/collections.abc.rst:38 msgid "Inherits from" msgstr "継承しているクラス" -#: ../../library/collections.abc.rst:120 +#: ../../library/collections.abc.rst:38 msgid "Abstract Methods" msgstr "抽象メソッド" -#: ../../library/collections.abc.rst:120 +#: ../../library/collections.abc.rst:38 msgid "Mixin Methods" msgstr "mixin メソッド" -#: ../../library/collections.abc.rst:122 -msgid ":class:`Container` [1]_" -msgstr ":class:`Container` [1]_" +#: ../../library/collections.abc.rst:40 +msgid ":class:`Container`" +msgstr ":class:`Container`" -#: ../../library/collections.abc.rst:122 +#: ../../library/collections.abc.rst:40 msgid "``__contains__``" msgstr "``__contains__``" -#: ../../library/collections.abc.rst:123 -msgid ":class:`Hashable` [1]_" -msgstr ":class:`Hashable` [1]_" +#: ../../library/collections.abc.rst:41 +msgid ":class:`Hashable`" +msgstr ":class:`Hashable`" -#: ../../library/collections.abc.rst:123 +#: ../../library/collections.abc.rst:41 msgid "``__hash__``" msgstr "``__hash__``" -#: ../../library/collections.abc.rst:124 -msgid ":class:`Iterable` [1]_ [2]_" -msgstr ":class:`Iterable` [1]_ [2]_" +#: ../../library/collections.abc.rst:42 ../../library/collections.abc.rst:43 +#: ../../library/collections.abc.rst:44 +msgid ":class:`Iterable`" +msgstr ":class:`Iterable`" -#: ../../library/collections.abc.rst:124 ../../library/collections.abc.rst:125 +#: ../../library/collections.abc.rst:42 ../../library/collections.abc.rst:43 msgid "``__iter__``" msgstr "``__iter__``" -#: ../../library/collections.abc.rst:125 -msgid ":class:`Iterator` [1]_" -msgstr ":class:`Iterator` [1]_" - -#: ../../library/collections.abc.rst:125 ../../library/collections.abc.rst:126 -msgid ":class:`Iterable`" -msgstr ":class:`Iterable`" +#: ../../library/collections.abc.rst:43 ../../library/collections.abc.rst:45 +msgid ":class:`Iterator`" +msgstr ":class:`Iterator`" -#: ../../library/collections.abc.rst:125 +#: ../../library/collections.abc.rst:43 msgid "``__next__``" msgstr "``__next__``" -#: ../../library/collections.abc.rst:126 -msgid ":class:`Reversible` [1]_" -msgstr ":class:`Reversible` [1]_" +#: ../../library/collections.abc.rst:44 +msgid ":class:`Reversible`" +msgstr ":class:`Reversible`" -#: ../../library/collections.abc.rst:126 +#: ../../library/collections.abc.rst:44 msgid "``__reversed__``" msgstr "``__reversed__``" -#: ../../library/collections.abc.rst:127 -msgid ":class:`Generator` [1]_" -msgstr ":class:`Generator` [1]_" +#: ../../library/collections.abc.rst:45 +msgid ":class:`Generator`" +msgstr ":class:`Generator`" -#: ../../library/collections.abc.rst:127 -msgid ":class:`Iterator`" -msgstr ":class:`Iterator`" - -#: ../../library/collections.abc.rst:127 ../../library/collections.abc.rst:173 +#: ../../library/collections.abc.rst:45 ../../library/collections.abc.rst:93 msgid "``send``, ``throw``" msgstr "``send``, ``throw``" -#: ../../library/collections.abc.rst:127 +#: ../../library/collections.abc.rst:45 msgid "``close``, ``__iter__``, ``__next__``" msgstr "``close``, ``__iter__``, ``__next__``" -#: ../../library/collections.abc.rst:128 -msgid ":class:`Sized` [1]_" -msgstr ":class:`Sized` [1]_" +#: ../../library/collections.abc.rst:46 ../../library/collections.abc.rst:85 +msgid ":class:`Sized`" +msgstr ":class:`Sized`" -#: ../../library/collections.abc.rst:128 +#: ../../library/collections.abc.rst:46 ../../library/collections.abc.rst:85 msgid "``__len__``" msgstr "``__len__``" -#: ../../library/collections.abc.rst:129 -msgid ":class:`Callable` [1]_" -msgstr ":class:`Callable` [1]_" +#: ../../library/collections.abc.rst:47 +msgid ":class:`Callable`" +msgstr ":class:`Callable`" -#: ../../library/collections.abc.rst:129 +#: ../../library/collections.abc.rst:47 msgid "``__call__``" msgstr "``__call__``" -#: ../../library/collections.abc.rst:130 -msgid ":class:`Collection` [1]_" -msgstr ":class:`Collection` [1]_" +#: ../../library/collections.abc.rst:48 ../../library/collections.abc.rst:64 +#: ../../library/collections.abc.rst:74 +msgid ":class:`Collection`" +msgstr ":class:`Collection`" -#: ../../library/collections.abc.rst:130 +#: ../../library/collections.abc.rst:48 msgid ":class:`Sized`, :class:`Iterable`, :class:`Container`" msgstr ":class:`Sized`, :class:`Iterable`, :class:`Container`" -#: ../../library/collections.abc.rst:130 ../../library/collections.abc.rst:143 +#: ../../library/collections.abc.rst:48 ../../library/collections.abc.rst:64 msgid "``__contains__``, ``__iter__``, ``__len__``" msgstr "``__contains__``, ``__iter__``, ``__len__``" -#: ../../library/collections.abc.rst:134 ../../library/collections.abc.rst:137 +#: ../../library/collections.abc.rst:52 ../../library/collections.abc.rst:55 +#: ../../library/collections.abc.rst:61 msgid ":class:`Sequence`" msgstr ":class:`Sequence`" -#: ../../library/collections.abc.rst:134 +#: ../../library/collections.abc.rst:52 msgid ":class:`Reversible`, :class:`Collection`" msgstr ":class:`Reversible`, :class:`Collection`" -#: ../../library/collections.abc.rst:134 +#: ../../library/collections.abc.rst:52 ../../library/collections.abc.rst:61 msgid "``__getitem__``, ``__len__``" msgstr "``__getitem__``, ``__len__``" -#: ../../library/collections.abc.rst:134 +#: ../../library/collections.abc.rst:52 msgid "" "``__contains__``, ``__iter__``, ``__reversed__``, ``index``, and ``count``" msgstr "``__contains__``, ``__iter__``, ``__reversed__``, ``index``, ``count``" -#: ../../library/collections.abc.rst:137 +#: ../../library/collections.abc.rst:55 msgid ":class:`MutableSequence`" msgstr ":class:`MutableSequence`" -#: ../../library/collections.abc.rst:137 +#: ../../library/collections.abc.rst:55 msgid "" "``__getitem__``, ``__setitem__``, ``__delitem__``, ``__len__``, ``insert``" msgstr "" "``__getitem__``, ``__setitem__``, ``__delitem__``, ``__len__``, ``insert``" -#: ../../library/collections.abc.rst:137 +#: ../../library/collections.abc.rst:55 msgid "" -"Inherited :class:`Sequence` methods and ``append``, ``clear``, ``reverse``, " -"``extend``, ``pop``, ``remove``, and ``__iadd__``" +"Inherited :class:`Sequence` methods and ``append``, ``reverse``, ``extend``, " +"``pop``, ``remove``, and ``__iadd__``" msgstr "" -":class:`Sequence` から継承したメソッドと、 ``append``, ``clear``, " -"``reverse``, ``extend``, ``pop``, ``remove``, ``__iadd__``" +":class:`Sequence` から継承したメソッドと、 ``append``, ``reverse``, " +"``extend``, ``pop``, ``remove``, ``__iadd__``" + +#: ../../library/collections.abc.rst:61 +msgid ":class:`ByteString`" +msgstr ":class:`ByteString`" -#: ../../library/collections.abc.rst:143 ../../library/collections.abc.rst:148 +#: ../../library/collections.abc.rst:61 +msgid "Inherited :class:`Sequence` methods" +msgstr ":class:`Sequence` から継承したメソッド" + +#: ../../library/collections.abc.rst:64 ../../library/collections.abc.rst:68 msgid ":class:`Set`" msgstr ":class:`Set`" -#: ../../library/collections.abc.rst:143 ../../library/collections.abc.rst:154 -msgid ":class:`Collection`" -msgstr ":class:`Collection`" - -#: ../../library/collections.abc.rst:143 +#: ../../library/collections.abc.rst:64 msgid "" "``__le__``, ``__lt__``, ``__eq__``, ``__ne__``, ``__gt__``, ``__ge__``, " -"``__and__``, ``__or__``, ``__sub__``, ``__rsub__``, ``__xor__``, " -"``__rxor__`` and ``isdisjoint``" +"``__and__``, ``__or__``, ``__sub__``, ``__xor__``, and ``isdisjoint``" msgstr "" +"``__le__``, ``__lt__``, ``__eq__``, ``__ne__``, ``__gt__``, ``__ge__``, " +"``__and__``, ``__or__``, ``__sub__``, ``__xor__``, ``isdisjoint``" -#: ../../library/collections.abc.rst:148 +#: ../../library/collections.abc.rst:68 msgid ":class:`MutableSet`" msgstr ":class:`MutableSet`" -#: ../../library/collections.abc.rst:148 +#: ../../library/collections.abc.rst:68 msgid "``__contains__``, ``__iter__``, ``__len__``, ``add``, ``discard``" msgstr "``__contains__``, ``__iter__``, ``__len__``, ``add``, ``discard``" -#: ../../library/collections.abc.rst:148 +#: ../../library/collections.abc.rst:68 msgid "" "Inherited :class:`Set` methods and ``clear``, ``pop``, ``remove``, " "``__ior__``, ``__iand__``, ``__ixor__``, and ``__isub__``" @@ -386,15 +234,15 @@ msgstr "" ":class:`Set` から継承したメソッドと、 ``clear``, ``pop``, ``remove``, " "``__ior__``, ``__iand__``, ``__ixor__``, ``__isub__``" -#: ../../library/collections.abc.rst:154 ../../library/collections.abc.rst:158 +#: ../../library/collections.abc.rst:74 ../../library/collections.abc.rst:78 msgid ":class:`Mapping`" msgstr ":class:`Mapping`" -#: ../../library/collections.abc.rst:154 +#: ../../library/collections.abc.rst:74 msgid "``__getitem__``, ``__iter__``, ``__len__``" msgstr "``__getitem__``, ``__iter__``, ``__len__``" -#: ../../library/collections.abc.rst:154 +#: ../../library/collections.abc.rst:74 msgid "" "``__contains__``, ``keys``, ``items``, ``values``, ``get``, ``__eq__``, and " "``__ne__``" @@ -402,17 +250,17 @@ msgstr "" "``__contains__``, ``keys``, ``items``, ``values``, ``get``, ``__eq__``, " "``__ne__``" -#: ../../library/collections.abc.rst:158 +#: ../../library/collections.abc.rst:78 msgid ":class:`MutableMapping`" msgstr ":class:`MutableMapping`" -#: ../../library/collections.abc.rst:158 +#: ../../library/collections.abc.rst:78 msgid "" "``__getitem__``, ``__setitem__``, ``__delitem__``, ``__iter__``, ``__len__``" msgstr "" "``__getitem__``, ``__setitem__``, ``__delitem__``, ``__iter__``, ``__len__``" -#: ../../library/collections.abc.rst:158 +#: ../../library/collections.abc.rst:78 msgid "" "Inherited :class:`Mapping` methods and ``pop``, ``popitem``, ``clear``, " "``update``, and ``setdefault``" @@ -420,189 +268,118 @@ msgstr "" ":class:`Mapping` から継承したメソッドと、 ``pop``, ``popitem``, ``clear``, " "``update``, ``setdefault``" -#: ../../library/collections.abc.rst:165 +#: ../../library/collections.abc.rst:85 msgid ":class:`MappingView`" msgstr ":class:`MappingView`" -#: ../../library/collections.abc.rst:165 -msgid ":class:`Sized`" -msgstr ":class:`Sized`" - -#: ../../library/collections.abc.rst:165 -msgid "``__init__``, ``__len__`` and ``__repr__``" -msgstr "" - -#: ../../library/collections.abc.rst:166 +#: ../../library/collections.abc.rst:86 msgid ":class:`ItemsView`" msgstr ":class:`ItemsView`" -#: ../../library/collections.abc.rst:166 ../../library/collections.abc.rst:168 +#: ../../library/collections.abc.rst:86 ../../library/collections.abc.rst:88 msgid ":class:`MappingView`, :class:`Set`" msgstr ":class:`MappingView`, :class:`Set`" -#: ../../library/collections.abc.rst:166 ../../library/collections.abc.rst:168 -#: ../../library/collections.abc.rst:170 +#: ../../library/collections.abc.rst:86 ../../library/collections.abc.rst:88 +#: ../../library/collections.abc.rst:90 msgid "``__contains__``, ``__iter__``" msgstr "``__contains__``, ``__iter__``" -#: ../../library/collections.abc.rst:168 +#: ../../library/collections.abc.rst:88 msgid ":class:`KeysView`" msgstr ":class:`KeysView`" -#: ../../library/collections.abc.rst:170 +#: ../../library/collections.abc.rst:90 msgid ":class:`ValuesView`" msgstr ":class:`ValuesView`" -#: ../../library/collections.abc.rst:170 +#: ../../library/collections.abc.rst:90 msgid ":class:`MappingView`, :class:`Collection`" msgstr ":class:`MappingView`, :class:`Collection`" -#: ../../library/collections.abc.rst:172 -msgid ":class:`Awaitable` [1]_" -msgstr ":class:`Awaitable` [1]_" +#: ../../library/collections.abc.rst:92 ../../library/collections.abc.rst:93 +msgid ":class:`Awaitable`" +msgstr ":class:`Awaitable`" -#: ../../library/collections.abc.rst:172 +#: ../../library/collections.abc.rst:92 msgid "``__await__``" msgstr "``__await__``" -#: ../../library/collections.abc.rst:173 -msgid ":class:`Coroutine` [1]_" -msgstr ":class:`Coroutine` [1]_" +#: ../../library/collections.abc.rst:93 +msgid ":class:`Coroutine`" +msgstr ":class:`Coroutine`" -#: ../../library/collections.abc.rst:173 -msgid ":class:`Awaitable`" -msgstr ":class:`Awaitable`" - -#: ../../library/collections.abc.rst:173 +#: ../../library/collections.abc.rst:93 msgid "``close``" msgstr "``close``" -#: ../../library/collections.abc.rst:174 -msgid ":class:`AsyncIterable` [1]_" -msgstr ":class:`AsyncIterable` [1]_" +#: ../../library/collections.abc.rst:94 ../../library/collections.abc.rst:95 +msgid ":class:`AsyncIterable`" +msgstr ":class:`AsyncIterable`" -#: ../../library/collections.abc.rst:174 ../../library/collections.abc.rst:175 +#: ../../library/collections.abc.rst:94 ../../library/collections.abc.rst:95 msgid "``__aiter__``" msgstr "``__aiter__``" -#: ../../library/collections.abc.rst:175 -msgid ":class:`AsyncIterator` [1]_" -msgstr ":class:`AsyncIterator` [1]_" - -#: ../../library/collections.abc.rst:175 -msgid ":class:`AsyncIterable`" -msgstr ":class:`AsyncIterable`" +#: ../../library/collections.abc.rst:95 ../../library/collections.abc.rst:96 +msgid ":class:`AsyncIterator`" +msgstr ":class:`AsyncIterator`" -#: ../../library/collections.abc.rst:175 +#: ../../library/collections.abc.rst:95 msgid "``__anext__``" msgstr "``__anext__``" -#: ../../library/collections.abc.rst:176 -msgid ":class:`AsyncGenerator` [1]_" -msgstr ":class:`AsyncGenerator` [1]_" +#: ../../library/collections.abc.rst:96 +msgid ":class:`AsyncGenerator`" +msgstr ":class:`AsyncGenerator`" -#: ../../library/collections.abc.rst:176 -msgid ":class:`AsyncIterator`" -msgstr ":class:`AsyncIterator`" - -#: ../../library/collections.abc.rst:176 +#: ../../library/collections.abc.rst:96 msgid "``asend``, ``athrow``" msgstr "``asend``, ``athrow``" -#: ../../library/collections.abc.rst:176 +#: ../../library/collections.abc.rst:96 msgid "``aclose``, ``__aiter__``, ``__anext__``" msgstr "``aclose``, ``__aiter__``, ``__anext__``" -#: ../../library/collections.abc.rst:177 -msgid ":class:`Buffer` [1]_" -msgstr ":class:`Buffer` [1]_" - -#: ../../library/collections.abc.rst:177 -msgid "``__buffer__``" -msgstr "``__buffer__``" - -#: ../../library/collections.abc.rst:182 -msgid "Footnotes" -msgstr "脚注" - -#: ../../library/collections.abc.rst:183 -msgid "" -"These ABCs override :meth:`~abc.ABCMeta.__subclasshook__` to support testing " -"an interface by verifying the required methods are present and have not been " -"set to :const:`None`. This only works for simple interfaces. More complex " -"interfaces require registration or direct subclassing." -msgstr "" -"これらの抽象基底クラスは :meth:`~abc.ABCMeta.__subclasshook__` をオーバーライ" -"ドして、必要なメソッドが存在し、かつ :const:`None` に指定されていないことを確" -"かめることによってインターフェースをテストすることをサポートします。このテス" -"トは単純なインターフェースに対してのみ有効に働きます。より複雑なインター" -"フェースは基底クラスへの登録や直接派生することが必要になります。" - -#: ../../library/collections.abc.rst:189 -msgid "" -"Checking ``isinstance(obj, Iterable)`` detects classes that are registered " -"as :class:`Iterable` or that have an :meth:`~container.__iter__` method, but " -"it does not detect classes that iterate with the :meth:`~object.__getitem__` " -"method. The only reliable way to determine whether an object is :term:" -"`iterable` is to call ``iter(obj)``." -msgstr "" -"``isinstance(obj, Iterable)`` によるチェックは :class:`Iterable` として登録さ" -"れたクラスや :meth:`~container.__iter__` メソッドを持つクラスを検出します" -"が、 :meth:`~object.__getitem__` メソッドにより反復処理を行うクラスは検出しま" -"せん。オブジェクトがイテラブル (:term:`iterable`) かどうかを確認する唯一の信" -"頼できる方法は ``iter(obj)`` を呼び出すことです。" - -#: ../../library/collections.abc.rst:197 -msgid "Collections Abstract Base Classes -- Detailed Descriptions" -msgstr "コレクションの抽象基底クラス -- 詳細な説明" +#: ../../library/collections.abc.rst:102 +msgid "ABC for classes that provide the :meth:`__contains__` method." +msgstr ":meth:`__contains__` メソッドを提供するクラスの ABC です。" -#: ../../library/collections.abc.rst:202 -msgid "ABC for classes that provide the :meth:`~object.__contains__` method." -msgstr ":meth:`~object.__contains__` メソッドを提供するクラスの ABC です。" +#: ../../library/collections.abc.rst:106 +msgid "ABC for classes that provide the :meth:`__hash__` method." +msgstr ":meth:`__hash__` メソッドを提供するクラスの ABC です。" -#: ../../library/collections.abc.rst:206 -msgid "ABC for classes that provide the :meth:`~object.__hash__` method." -msgstr ":meth:`~object.__hash__` メソッドを提供するクラスの ABC です。" +#: ../../library/collections.abc.rst:110 +msgid "ABC for classes that provide the :meth:`__len__` method." +msgstr ":meth:`__len__` メソッドを提供するクラスの ABC です。" -#: ../../library/collections.abc.rst:210 -msgid "ABC for classes that provide the :meth:`~object.__len__` method." -msgstr ":meth:`~object.__len__` メソッドを提供するクラスの ABC です。" +#: ../../library/collections.abc.rst:114 +msgid "ABC for classes that provide the :meth:`__call__` method." +msgstr ":meth:`__call__` メソッドを提供するクラスの ABC です。" -#: ../../library/collections.abc.rst:214 -msgid "ABC for classes that provide the :meth:`~object.__call__` method." -msgstr ":meth:`~object.__call__` メソッドを提供するクラスの ABC です。" +#: ../../library/collections.abc.rst:118 +msgid "ABC for classes that provide the :meth:`__iter__` method." +msgstr ":meth:`__iter__` メソッドを提供するクラスの ABC です。" -#: ../../library/collections.abc.rst:216 +#: ../../library/collections.abc.rst:120 msgid "" -"See :ref:`annotating-callables` for details on how to use :class:`!Callable` " -"in type annotations." +"Checking ``isinstance(obj, Iterable)`` detects classes that are registered " +"as :class:`Iterable` or that have an :meth:`__iter__` method, but it does " +"not detect classes that iterate with the :meth:`__getitem__` method. The " +"only reliable way to determine whether an object is :term:`iterable` is to " +"call ``iter(obj)``." msgstr "" -":class:`!Callable` を型アノテーションで使う方法の詳細は、 :ref:`annotating-" -"callables` を参照してください。" - -#: ../../library/collections.abc.rst:221 -msgid "ABC for classes that provide the :meth:`~container.__iter__` method." -msgstr ":meth:`~container.__iter__` メソッドを提供するクラスの ABC です。" +"メソッド ``isinstance(obj, Iterable)`` で使用すると、 :class:`Iterable` や :" +"meth:`__iter__` メソッドを持っているクラスを検出できます。しかし、:meth:" +"`__getitem__` メソッドで反復するクラスは検出しません。\n" +"オブジェクトが :term:`iterable` であるかどうかを判別するにあたって、信頼でき" +"る唯一の方法は ``iter(obj)`` を呼び出す方法です。" -#: ../../library/collections.abc.rst:223 -msgid "" -"Checking ``isinstance(obj, Iterable)`` detects classes that are registered " -"as :class:`Iterable` or that have an :meth:`~container.__iter__` method, but " -"it does not detect classes that iterate with the :meth:`~object.__getitem__` " -"method. The only reliable way to determine whether an object is :term:" -"`iterable` is to call ``iter(obj)``." -msgstr "" -"``isinstance(obj, Iterable)`` によるチェックは :class:`Iterable` として登録さ" -"れたクラスや :meth:`~container.__iter__` メソッドを持つクラスを検出します" -"が、 :meth:`~object.__getitem__` メソッドにより反復処理を行うクラスは検出しま" -"せん。オブジェクトがイテラブル (:term:`iterable`) かどうかを確認する唯一の信" -"頼できる方法は ``iter(obj)`` を呼び出すことです。" - -#: ../../library/collections.abc.rst:232 +#: ../../library/collections.abc.rst:128 msgid "ABC for sized iterable container classes." msgstr "サイズ付きのイテラブルなコンテナクラスの ABC です。" -#: ../../library/collections.abc.rst:238 +#: ../../library/collections.abc.rst:134 msgid "" "ABC for classes that provide the :meth:`~iterator.__iter__` and :meth:" "`~iterator.__next__` methods. See also the definition of :term:`iterator`." @@ -610,87 +387,76 @@ msgstr "" ":meth:`~iterator.__iter__` メソッドと :meth:`~iterator.__next__` メソッドを提" "供するクラスの ABC です。 :term:`iterator` の定義も参照してください。" -#: ../../library/collections.abc.rst:244 +#: ../../library/collections.abc.rst:140 msgid "" -"ABC for iterable classes that also provide the :meth:`~object.__reversed__` " -"method." -msgstr "" -":meth:`~object.__reversed__` メソッドを提供するイテラブルクラスの ABC です。" +"ABC for iterable classes that also provide the :meth:`__reversed__` method." +msgstr ":meth:`__reversed__` メソッドを提供するイテラブルクラスの ABC です。" -#: ../../library/collections.abc.rst:251 +#: ../../library/collections.abc.rst:147 msgid "" -"ABC for :term:`generator` classes that implement the protocol defined in :" -"pep:`342` that extends :term:`iterators ` with the :meth:" -"`~generator.send`, :meth:`~generator.throw` and :meth:`~generator.close` " -"methods." +"ABC for generator classes that implement the protocol defined in :pep:`342` " +"that extends iterators with the :meth:`~generator.send`, :meth:`~generator." +"throw` and :meth:`~generator.close` methods. See also the definition of :" +"term:`generator`." msgstr "" -":pep:`342` で定義された、:term:`イテレータ ` を :meth:`~generator." -"send`, :meth:`~generator.throw`, :meth:`~generator.close` の各メソッドに拡張" -"するプロトコルを実装する、:term:`ジェネレータ ` クラスの ABC で" -"す。" +":pep:`342` で定義された、イテレータを :meth:`~generator.send`, :meth:" +"`~generator.throw`, :meth:`~generator.close` の各メソッドに拡張するプロトコル" +"を実装する、ジェネレータクラスの ABC です。:term:`generator` の定義も参照して" +"ください。" -#: ../../library/collections.abc.rst:256 -msgid "" -"See :ref:`annotating-generators-and-coroutines` for details on using :class:" -"`!Generator` in type annotations." -msgstr "" -":class:`!Generator` を型アノテーションで使う方法の詳細は、 :ref:`annotating-" -"generators-and-coroutines` を参照してください。" - -#: ../../library/collections.abc.rst:264 +#: ../../library/collections.abc.rst:158 msgid "ABCs for read-only and mutable :term:`sequences `." msgstr "" "読み出し専用の :term:`シーケンス ` およびミュータブルな :term:`シー" "ケンス ` の ABC です。" -#: ../../library/collections.abc.rst:266 +#: ../../library/collections.abc.rst:160 msgid "" -"Implementation note: Some of the mixin methods, such as :meth:`~container." -"__iter__`, :meth:`~object.__reversed__` and :meth:`index`, make repeated " -"calls to the underlying :meth:`~object.__getitem__` method. Consequently, " -"if :meth:`~object.__getitem__` is implemented with constant access speed, " -"the mixin methods will have linear performance; however, if the underlying " -"method is linear (as it would be with a linked list), the mixins will have " -"quadratic performance and will likely need to be overridden." -msgstr "" -"実装における注意: :meth:`~container.__iter__`, :meth:`~object." -"__reversed__`, :meth:`index` など、一部の mixin メソッドは、下層の :meth:" -"`~object.__getitem__` メソッドを繰り返し呼び出します。その結果、:meth:" -"`~object.__getitem__` が定数のアクセス速度で実装されている場合、mixin メソッ" -"ドは線形のパフォーマンスとなります。下層のメソッドが線形 (リンクされたリスト" -"の場合など) の場合、mixin は 2 乗のパフォーマンスとなるため、多くの場合上書き" -"する必要があるでしょう。" - -#: ../../library/collections.abc.rst:275 +"Implementation note: Some of the mixin methods, such as :meth:`__iter__`, :" +"meth:`__reversed__` and :meth:`index`, make repeated calls to the " +"underlying :meth:`__getitem__` method. Consequently, if :meth:`__getitem__` " +"is implemented with constant access speed, the mixin methods will have " +"linear performance; however, if the underlying method is linear (as it would " +"be with a linked list), the mixins will have quadratic performance and will " +"likely need to be overridden." +msgstr "" +"実装における注意: :meth:`__iter__`, :meth:`__reversed__`, :meth:`index` な" +"ど、一部の mixin メソッドは、下層の :meth:`__getitem__` メソッドを繰り返し呼" +"び出します。その結果、:meth:`__getitem__` が定数のアクセス速度で実装されてい" +"る場合、mixin メソッドは線形のパフォーマンスとなります。下層のメソッドが線形 " +"(リンクされたリストの場合など) の場合、mixin は 2 乗のパフォーマンスとなるた" +"め、多くの場合上書きする必要があるでしょう。" + +#: ../../library/collections.abc.rst:169 msgid "The index() method added support for *stop* and *start* arguments." msgstr "index() メソッドは *stop* と *start* 引数をサポートしました。" -#: ../../library/collections.abc.rst:282 -msgid "ABCs for read-only and mutable :ref:`sets `." -msgstr "読み出し専用でミュータブルな :ref:`集合 ` の ABC です。" +#: ../../library/collections.abc.rst:176 +msgid "ABCs for read-only and mutable sets." +msgstr "読み出し専用の集合およびミュータブルな集合の ABC です。" -#: ../../library/collections.abc.rst:287 +#: ../../library/collections.abc.rst:181 msgid "ABCs for read-only and mutable :term:`mappings `." msgstr "" "読み出し専用の :term:`マッピング ` およびミュータブルな :term:`マッ" "ピング ` の ABC です。" -#: ../../library/collections.abc.rst:294 +#: ../../library/collections.abc.rst:188 msgid "" "ABCs for mapping, items, keys, and values :term:`views `." msgstr "" "マッピング、要素、キー、値の :term:`ビュー ` の ABC です。" -#: ../../library/collections.abc.rst:298 +#: ../../library/collections.abc.rst:192 msgid "" "ABC for :term:`awaitable` objects, which can be used in :keyword:`await` " -"expressions. Custom implementations must provide the :meth:`~object." -"__await__` method." +"expressions. Custom implementations must provide the :meth:`__await__` " +"method." msgstr "" ":keyword:`await` で使用できる :term:`awaitable` オブジェクトの ABC です。カス" -"タムの実装は、:meth:`~object.__await__` メソッドを提供しなければなりません。" +"タムの実装は、:meth:`__await__` メソッドを提供しなければなりません。" -#: ../../library/collections.abc.rst:302 +#: ../../library/collections.abc.rst:196 msgid "" ":term:`Coroutine ` objects and instances of the :class:" "`~collections.abc.Coroutine` ABC are all instances of this ABC." @@ -698,70 +464,59 @@ msgstr "" ":class:`~collections.abc.Coroutine` ABC の :term:`Coroutine ` オブ" "ジェクトとインスタンスは、すべてこの ABC のインスタンスです。" -#: ../../library/collections.abc.rst:306 +#: ../../library/collections.abc.rst:200 msgid "" -"In CPython, generator-based coroutines (:term:`generators ` " -"decorated with :func:`@types.coroutine `) are *awaitables*, " -"even though they do not have an :meth:`~object.__await__` method. Using " +"In CPython, generator-based coroutines (generators decorated with :func:" +"`types.coroutine` or :func:`asyncio.coroutine`) are *awaitables*, even " +"though they do not have an :meth:`__await__` method. Using " "``isinstance(gencoro, Awaitable)`` for them will return ``False``. Use :func:" "`inspect.isawaitable` to detect them." msgstr "" -"CPython では、ジェネレータベースのコルーチン (:func:`@types.coroutine ` で修飾された :term:`ジェネレータ `) は、 :meth:" -"`~object.__await__` メソッドを持たないにもかかわらず*待機可能* " -"(*awaitables*) です。 ``isinstance(gencoro, Awaitable)`` はそのようなコルーチ" -"ンに対して ``False`` を返します。そのようなコルーチンを検出するためには :" -"func:`inspect.isawaitable` を使ってください。" +"CPython では、ジェネレータベースのコルーチン (:func:`types.coroutine` また" +"は :func:`asyncio.coroutine` でデコレートされたジェネレータ) は、 :meth:" +"`__await__` メソッドを持ちませんが、待機可能 (*awaitables*) です。これらに対" +"して ``isinstance(gencoro, Awaitable)`` を使用すると、 ``False`` が返されま" +"す。これらを検出するには、 :func:`inspect.isawaitable` を使用します。" -#: ../../library/collections.abc.rst:316 +#: ../../library/collections.abc.rst:210 msgid "" -"ABC for :term:`coroutine` compatible classes. These implement the following " +"ABC for coroutine compatible classes. These implement the following " "methods, defined in :ref:`coroutine-objects`: :meth:`~coroutine.send`, :meth:" "`~coroutine.throw`, and :meth:`~coroutine.close`. Custom implementations " -"must also implement :meth:`~object.__await__`. All :class:`Coroutine` " -"instances are also instances of :class:`Awaitable`." -msgstr "" -":term:`コルーチン ` と互換性のあるクラスの ABC です。これらは、:" -"ref:`coroutine-objects` で定義された :meth:`~coroutine.send`, :meth:" -"`~coroutine.throw`, :meth:`~coroutine.close` のメソッドを実装します。カスタム" -"の実装は、:meth:`~object.__await__` も実装しなければなりません。:class:" -"`Coroutine` のすべてのインスタンスは、 :class:`Awaitable` のインスタンスでも" -"あります。" - -#: ../../library/collections.abc.rst:324 -msgid "" -"In CPython, generator-based coroutines (:term:`generators ` " -"decorated with :func:`@types.coroutine `) are *awaitables*, " -"even though they do not have an :meth:`~object.__await__` method. Using " +"must also implement :meth:`__await__`. All :class:`Coroutine` instances are " +"also instances of :class:`Awaitable`. See also the definition of :term:" +"`coroutine`." +msgstr "" +"コルーチンと互換性のあるクラスの ABC です。これらは、:ref:`coroutine-" +"objects` で定義された :meth:`~coroutine.send`, :meth:`~coroutine.throw`, :" +"meth:`~coroutine.close` のメソッドを実装します。カスタムの実装は、:meth:" +"`__await__` も実装しなければなりません。:class:`Coroutine` のすべてのインスタ" +"ンスは、 :class:`Awaitable` のインスタンスでもあります。:term:`coroutine` の" +"定義も参照してください。" + +#: ../../library/collections.abc.rst:218 +msgid "" +"In CPython, generator-based coroutines (generators decorated with :func:" +"`types.coroutine` or :func:`asyncio.coroutine`) are *awaitables*, even " +"though they do not have an :meth:`__await__` method. Using " "``isinstance(gencoro, Coroutine)`` for them will return ``False``. Use :func:" "`inspect.isawaitable` to detect them." msgstr "" -"CPython では、ジェネレータベースのコルーチン (:func:`@types.coroutine ` で修飾された :term:`ジェネレータ `) は、 :meth:" -"`~object.__await__` メソッドを持たないにもかかわらず*待機可能* " -"(*awaitables*) です。 ``isinstance(gencoro, Coroutine)`` はそのようなコルーチ" -"ンに対して ``False`` を返します。そのようなコルーチンを検出するためには :" -"func:`inspect.isawaitable` を使ってください。" +"CPython では、ジェネレータベースのコルーチン (:func:`types.coroutine` また" +"は :func:`asyncio.coroutine` でデコレートされたジェネレータ) は、 :meth:" +"`__await__` メソッドを持ちませんが、待機可能 (*awaitables*) です。これらに対" +"して ``isinstance(gencoro, Coroutine)`` を使用すると、 ``False`` が返されま" +"す。これらを検出するには、 :func:`inspect.isawaitable` を使用します。" -#: ../../library/collections.abc.rst:330 +#: ../../library/collections.abc.rst:228 msgid "" -"See :ref:`annotating-generators-and-coroutines` for details on using :class:" -"`!Coroutine` in type annotations. The variance and order of type parameters " -"correspond to those of :class:`Generator`." -msgstr "" -":class:`!Coroutine` を型アノテーションで使う方法の詳細は、 :ref:`annotating-" -"generators-and-coroutines` を参照してください。型パラメータの意味と順序は :" -"class:`Generator` と同様です。" - -#: ../../library/collections.abc.rst:339 -msgid "" -"ABC for classes that provide an ``__aiter__`` method. See also the " -"definition of :term:`asynchronous iterable`." +"ABC for classes that provide ``__aiter__`` method. See also the definition " +"of :term:`asynchronous iterable`." msgstr "" "``__aiter__`` メソッドを提供するクラスの ABC です。:term:`asynchronous " "iterable` の定義も参照してください。" -#: ../../library/collections.abc.rst:346 +#: ../../library/collections.abc.rst:235 msgid "" "ABC for classes that provide ``__aiter__`` and ``__anext__`` methods. See " "also the definition of :term:`asynchronous iterator`." @@ -769,166 +524,88 @@ msgstr "" "``__aiter__`` および ``__anext__`` メソッドを提供するクラスの ABC です。:" "term:`asynchronous iterator` の定義も参照してください。" -#: ../../library/collections.abc.rst:353 -msgid "" -"ABC for :term:`asynchronous generator` classes that implement the protocol " -"defined in :pep:`525` and :pep:`492`." -msgstr "" -":pep:`525` と :pep:`492` に定義されているプロトコルを実装した :term:`非同期" -"ジェネレータ ` クラスの ABC です。" - -#: ../../library/collections.abc.rst:356 -msgid "" -"See :ref:`annotating-generators-and-coroutines` for details on using :class:" -"`!AsyncGenerator` in type annotations." -msgstr "" -":class:`!AsyncGenerator` を型アノテーションで使う方法の詳細は、 :ref:" -"`annotating-generators-and-coroutines` を参照してください。" - -#: ../../library/collections.abc.rst:363 +#: ../../library/collections.abc.rst:242 msgid "" -"ABC for classes that provide the :meth:`~object.__buffer__` method, " -"implementing the :ref:`buffer protocol `. See :pep:`688`." +"ABC for asynchronous generator classes that implement the protocol defined " +"in :pep:`525` and :pep:`492`." msgstr "" -":ref:`buffer protocol ` を実装する :meth:`~object.__buffer__` " -"メソッドを提供するクラスのABCです。:pep:`688` を参照してください。" +":pep:`525` と :pep:`492` に定義されているプロトコルを実装した非同期ジェネレー" +"タクラスの ABC です。" -#: ../../library/collections.abc.rst:369 -msgid "Examples and Recipes" -msgstr "例とレシピ" - -#: ../../library/collections.abc.rst:371 +#: ../../library/collections.abc.rst:248 msgid "" -"ABCs allow us to ask classes or instances if they provide particular " +"These ABCs allow us to ask classes or instances if they provide particular " "functionality, for example::" msgstr "" -"抽象基底クラスは、クラスやインスタンスが特定の機能を提供しているかどうかを調" -"べることを可能にします。例えば::" +"これらの ABC はクラスやインスタンスが特定の機能を提供しているかどうかを調べる" +"のに使えます。例えば::" -#: ../../library/collections.abc.rst:374 -msgid "" -"size = None\n" -"if isinstance(myvar, collections.abc.Sized):\n" -" size = len(myvar)" -msgstr "" -"size = None\n" -"if isinstance(myvar, collections.abc.Sized):\n" -" size = len(myvar)" - -#: ../../library/collections.abc.rst:378 +#: ../../library/collections.abc.rst:255 msgid "" "Several of the ABCs are also useful as mixins that make it easier to develop " "classes supporting container APIs. For example, to write a class supporting " "the full :class:`Set` API, it is only necessary to supply the three " -"underlying abstract methods: :meth:`~object.__contains__`, :meth:`~container." -"__iter__`, and :meth:`~object.__len__`. The ABC supplies the remaining " -"methods such as :meth:`!__and__` and :meth:`~frozenset.isdisjoint`::" +"underlying abstract methods: :meth:`__contains__`, :meth:`__iter__`, and :" +"meth:`__len__`. The ABC supplies the remaining methods such as :meth:" +"`__and__` and :meth:`isdisjoint`::" msgstr "" "幾つかの ABC はコンテナ型 API を提供するクラスを開発するのを助ける mixin 型と" "しても使えます。例えば、 :class:`Set` API を提供するクラスを作る場合、3つの基" -"本になる抽象メソッド :meth:`~object.__contains__`, :meth:`~container." -"__iter__`, :meth:`~object.__len__` だけが必要です。ABC が残りの :meth:`!" -"__and__` や :meth:`~frozenset.isdisjoint` といったメソッドを提供します::" +"本になる抽象メソッド :meth:`__contains__`, :meth:`__iter__`, :meth:`__len__` " +"だけが必要です。ABC が残りの :meth:`__and__` や :meth:`isdisjoint` といったメ" +"ソッドを提供します::" -#: ../../library/collections.abc.rst:385 -msgid "" -"class ListBasedSet(collections.abc.Set):\n" -" ''' Alternate set implementation favoring space over speed\n" -" and not requiring the set elements to be hashable. '''\n" -" def __init__(self, iterable):\n" -" self.elements = lst = []\n" -" for value in iterable:\n" -" if value not in lst:\n" -" lst.append(value)\n" -"\n" -" def __iter__(self):\n" -" return iter(self.elements)\n" -"\n" -" def __contains__(self, value):\n" -" return value in self.elements\n" -"\n" -" def __len__(self):\n" -" return len(self.elements)\n" -"\n" -"s1 = ListBasedSet('abcdef')\n" -"s2 = ListBasedSet('defghi')\n" -"overlap = s1 & s2 # The __and__() method is supported " -"automatically" -msgstr "" -"class ListBasedSet(collections.abc.Set):\n" -" ''' Alternate set implementation favoring space over speed\n" -" and not requiring the set elements to be hashable. '''\n" -" def __init__(self, iterable):\n" -" self.elements = lst = []\n" -" for value in iterable:\n" -" if value not in lst:\n" -" lst.append(value)\n" -"\n" -" def __iter__(self):\n" -" return iter(self.elements)\n" -"\n" -" def __contains__(self, value):\n" -" return value in self.elements\n" -"\n" -" def __len__(self):\n" -" return len(self.elements)\n" -"\n" -"s1 = ListBasedSet('abcdef')\n" -"s2 = ListBasedSet('defghi')\n" -"overlap = s1 & s2 # The __and__() method is supported " -"automatically" - -#: ../../library/collections.abc.rst:407 +#: ../../library/collections.abc.rst:284 msgid "Notes on using :class:`Set` and :class:`MutableSet` as a mixin:" msgstr "" ":class:`Set` と :class:`MutableSet` を mixin 型として利用するときの注意点:" -#: ../../library/collections.abc.rst:410 +#: ../../library/collections.abc.rst:287 msgid "" "Since some set operations create new sets, the default mixin methods need a " -"way to create new instances from an :term:`iterable`. The class constructor " -"is assumed to have a signature in the form ``ClassName(iterable)``. That " -"assumption is factored-out to an internal :class:`classmethod` called :meth:" -"`!_from_iterable` which calls ``cls(iterable)`` to produce a new set. If " -"the :class:`Set` mixin is being used in a class with a different constructor " -"signature, you will need to override :meth:`!_from_iterable` with a " +"way to create new instances from an iterable. The class constructor is " +"assumed to have a signature in the form ``ClassName(iterable)``. That " +"assumption is factored-out to an internal classmethod called :meth:" +"`_from_iterable` which calls ``cls(iterable)`` to produce a new set. If the :" +"class:`Set` mixin is being used in a class with a different constructor " +"signature, you will need to override :meth:`_from_iterable` with a " "classmethod or regular method that can construct new instances from an " "iterable argument." msgstr "" -"幾つかの set の操作は新しい set を作るので、デフォルトの mixin メソッドは :" -"term:`イテラブル ` から新しいインスタンスを作成する方法を必要としま" -"す。クラスのコンストラクタは ``ClassName(iterable)`` の形のシグネチャを持つと" -"仮定されます。内部の :meth:`!_from_iterable` という :class:`classmethod` が " -"``cls(iterable)`` を呼び出して新しい set を作る部分でこの仮定が使われていま" -"す。コンストラクタのシグネチャが異なるクラスで :class:`Set` を使う場合は、 " -"iterable 引数から新しいインスタンスを生成できるクラスメソッドあるいは仕様に" -"沿ったメソッドで :meth:`!_from_iterable` をオーバーライドする必要があります。" +"幾つかの set の操作は新しい set を作るので、デフォルトの mixin メソッドは " +"iterable から新しいインスタンスを作成する方法を必要とします。クラスのコンスト" +"ラクタは ``ClassName(iterable)`` の形のシグネチャを持つと仮定されます。内部" +"の :meth:`_from_iterable` というクラスメソッドが ``cls(iterable)`` を呼び出し" +"て新しい set を作る部分でこの仮定が使われています。コンストラクタのシグネチャ" +"が異なるクラスで :class:`Set` を使う場合は、 iterable 引数から新しいインスタ" +"ンスを生成できるクラスメソッドあるいは仕様に沿ったメソッドで :meth:" +"`_from_iterable` をオーバーライドする必要があります。" -#: ../../library/collections.abc.rst:421 +#: ../../library/collections.abc.rst:298 msgid "" "To override the comparisons (presumably for speed, as the semantics are " -"fixed), redefine :meth:`~object.__le__` and :meth:`~object.__ge__`, then the " -"other operations will automatically follow suit." +"fixed), redefine :meth:`__le__` and :meth:`__ge__`, then the other " +"operations will automatically follow suit." msgstr "" "(たぶん意味はそのままに速度を向上する目的で)比較をオーバーライドする場合、 :" -"meth:`~object.__le__` と :meth:`~object.__ge__` だけを再定義すれば、その他の" -"演算は自動的に追随します。" +"meth:`__le__` と :meth:`__ge__` だけを再定義すれば、その他の演算は自動的に追" +"随します。" -#: ../../library/collections.abc.rst:427 +#: ../../library/collections.abc.rst:303 msgid "" -"The :class:`Set` mixin provides a :meth:`!_hash` method to compute a hash " -"value for the set; however, :meth:`~object.__hash__` is not defined because " -"not all sets are :term:`hashable` or immutable. To add set hashability " -"using mixins, inherit from both :meth:`Set` and :meth:`Hashable`, then " -"define ``__hash__ = Set._hash``." -msgstr "" -":class:`Set` mixin型は set のハッシュ値を計算する :meth:`!_hash` メソッドを提" -"供しますが、すべての set が :term:`hashable` や immutable とは限らないの" -"で、 :meth:`~object.__hash__` は提供しません。 mixin を使ってハッシュ可能な " -"set を作る場合は、 :class:`Set` と :meth:`Hashable` の両方を継承して、 " -"``__hash__ = Set._hash`` と定義してください。" - -#: ../../library/collections.abc.rst:435 +"The :class:`Set` mixin provides a :meth:`_hash` method to compute a hash " +"value for the set; however, :meth:`__hash__` is not defined because not all " +"sets are hashable or immutable. To add set hashability using mixins, " +"inherit from both :meth:`Set` and :meth:`Hashable`, then define ``__hash__ = " +"Set._hash``." +msgstr "" +":class:`Set` mixin型は set のハッシュ値を計算する :meth:`_hash` メソッドを提" +"供しますが、すべての set が hashable や immutable とは限らないので、 :meth:" +"`__hash__` は提供しません。 mixin を使ってハッシュ可能な set を作る場合は、 :" +"class:`Set` と :class:`Hashable` の両方を継承して、 ``__hash__ = Set._hash`` " +"と定義してください。" + +#: ../../library/collections.abc.rst:311 msgid "" "`OrderedSet recipe `_ for an " "example built on :class:`MutableSet`." @@ -936,7 +613,7 @@ msgstr "" ":class:`MutableSet` を使った例として `OrderedSet recipe `_。" -#: ../../library/collections.abc.rst:438 +#: ../../library/collections.abc.rst:314 msgid "For more about ABCs, see the :mod:`abc` module and :pep:`3119`." msgstr "" "ABCs についての詳細は、 :mod:`abc` モジュールと :pep:`3119` を参照してくださ" diff --git a/library/collections.po b/library/collections.po index 3565d7631..75d288693 100644 --- a/library/collections.po +++ b/library/collections.po @@ -1,36 +1,39 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: +# Yusuke Miyazaki , 2017 +# Nozomu Kaneko , 2017 +# Shun Sakurai, 2017 +# Arihiro TAKASE, 2017 +# E. Kawashima, 2017 +# Osamu NAKAMURA, 2017 +# 秘湯 , 2017 +# tomo, 2019 +# mollinaca, 2020 # Takanori Suzuki , 2021 -# mollinaca, 2021 -# tomo, 2021 -# Takeshi Nakazato, 2022 -# souma987, 2023 -# Arihiro TAKASE, 2023 -# 石井明久, 2024 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:56+0000\n" -"Last-Translator: 石井明久, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-08-03 07:07+0000\n" +"PO-Revision-Date: 2017-02-16 23:03+0000\n" +"Last-Translator: Takanori Suzuki , 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/collections.rst:2 -msgid ":mod:`!collections` --- Container datatypes" -msgstr ":mod:`!collections` --- コンテナデータ型" +msgid ":mod:`collections` --- Container datatypes" +msgstr ":mod:`collections` --- コンテナデータ型" #: ../../library/collections.rst:10 msgid "**Source code:** :source:`Lib/collections/__init__.py`" @@ -75,9 +78,8 @@ msgid ":class:`Counter`" msgstr ":class:`Counter`" #: ../../library/collections.rst:28 -msgid "dict subclass for counting :term:`hashable` objects" -msgstr "" -":term:`ハッシュ可能 ` なオブジェクトを数え上げる辞書のサブクラス" +msgid "dict subclass for counting hashable objects" +msgstr "ハッシュ可能なオブジェクトを数え上げる辞書のサブクラス" #: ../../library/collections.rst:29 msgid ":class:`OrderedDict`" @@ -119,11 +121,21 @@ msgstr ":class:`UserString`" msgid "wrapper around string objects for easier string subclassing" msgstr "文字列のサブクラス化を簡単にする文字列オブジェクトのラッパ" -#: ../../library/collections.rst:38 +#: ../../library/collections.rst:41 +msgid "" +"Moved :ref:`collections-abstract-base-classes` to the :mod:`collections.abc` " +"module. For backwards compatibility, they continue to be visible in this " +"module through Python 3.9." +msgstr "" +":ref:`collections-abstract-base-classes` が :mod:`collections.abc` モジュール" +"に移動されました。後方互換性のため、それらは引き続きPython 3.9モジュールでも" +"利用できます。" + +#: ../../library/collections.rst:43 msgid ":class:`ChainMap` objects" msgstr ":class:`ChainMap` オブジェクト" -#: ../../library/collections.rst:42 +#: ../../library/collections.rst:47 msgid "" "A :class:`ChainMap` class is provided for quickly linking a number of " "mappings so they can be treated as a single unit. It is often much faster " @@ -134,14 +146,14 @@ msgstr "" "扱うために提供されています。これはたいてい、新しい辞書を作成して :meth:" "`~dict.update` を繰り返すよりも早いです。" -#: ../../library/collections.rst:46 +#: ../../library/collections.rst:51 msgid "" "The class can be used to simulate nested scopes and is useful in templating." msgstr "" "このクラスはネストされたスコープをシミュレートするのに使え、テンプレート化に" "便利です。" -#: ../../library/collections.rst:50 +#: ../../library/collections.rst:55 msgid "" "A :class:`ChainMap` groups multiple dicts or other mappings together to " "create a single, updateable view. If no *maps* are specified, a single " @@ -152,7 +164,7 @@ msgstr "" "可能なビューを作成します。 *maps* が指定されないなら、一つの空辞書が与えられ" "ますから、新しいチェーンは必ず一つ以上のマッピングをもちます。" -#: ../../library/collections.rst:54 +#: ../../library/collections.rst:59 msgid "" "The underlying mappings are stored in a list. That list is public and can " "be accessed or updated using the *maps* attribute. There is no other state." @@ -160,7 +172,7 @@ msgstr "" "根底のマッピングはリストに保存されます。このリストはパブリックで、 *maps* 属" "性を使ってアクセスや更新できます。それ以外に状態はありません。" -#: ../../library/collections.rst:57 +#: ../../library/collections.rst:62 msgid "" "Lookups search the underlying mappings successively until a key is found. " "In contrast, writes, updates, and deletions only operate on the first " @@ -169,7 +181,7 @@ msgstr "" "探索は、根底のマッピングをキーが見つかるまで引き続き探します。対して、書き込" "み、更新、削除は、最初のマッピングのみ操作します。" -#: ../../library/collections.rst:60 +#: ../../library/collections.rst:65 msgid "" "A :class:`ChainMap` incorporates the underlying mappings by reference. So, " "if one of the underlying mappings gets updated, those changes will be " @@ -179,7 +191,7 @@ msgstr "" "根底のマッピングの一つが更新されると、その変更は :class:`ChainMap` に反映され" "ます。" -#: ../../library/collections.rst:64 +#: ../../library/collections.rst:69 msgid "" "All of the usual dictionary methods are supported. In addition, there is a " "*maps* attribute, a method for creating new subcontexts, and a property for " @@ -189,7 +201,7 @@ msgstr "" "サブコンテキストを作成するメソッド、最初のマッピング以外のすべてにアクセスす" "るためのプロパティがあります:" -#: ../../library/collections.rst:70 +#: ../../library/collections.rst:75 msgid "" "A user updateable list of mappings. The list is ordered from first-searched " "to last-searched. It is the only stored state and can be modified to change " @@ -201,33 +213,27 @@ msgstr "" "あり、変更してマッピングが探される順番を変更できます。このリストは常に一つ以" "上のマッピングを含んでいなければなりません。" -#: ../../library/collections.rst:77 +#: ../../library/collections.rst:82 msgid "" "Returns a new :class:`ChainMap` containing a new map followed by all of the " "maps in the current instance. If ``m`` is specified, it becomes the new map " "at the front of the list of mappings; if not specified, an empty dict is " "used, so that a call to ``d.new_child()`` is equivalent to: ``ChainMap({}, " -"*d.maps)``. If any keyword arguments are specified, they update passed map " -"or new empty dict. This method is used for creating subcontexts that can be " +"*d.maps)``. This method is used for creating subcontexts that can be " "updated without altering values in any of the parent mappings." msgstr "" -"新しいマッピングに現在のインスタンスが持つ全てのマッピングを追加したものを持" -"つ新しい :class:`ChainMap` インスタンスを返します。 ``m`` が指定された場合、" -"新しいマッピングのリストの先頭部分になります; 指定されない場合は空の辞書が使" -"われます。すなわち ``d.new_child()`` は ``ChainMap({}, *d.maps)`` と等価にな" -"ります。キーワード引数が指定された場合、それらによって指定されたマッピングま" -"たは空の辞書が更新されます。このメソッドは、元のマッピングに変更を加えること" -"なく値を更新できるサブコンテキストを生成するのに使われます。" +"新しい辞書の後ろに現在のインスタンスにある全ての辞書が続いたものを持つ、新し" +"い :class:`ChainMap` を返します。 ``m`` が指定された場合、それがマッピングの" +"リストの先頭の新しい辞書になります; 指定されていない場合、 ``d.new_child()`` " +"が ``ChainMap({}, *d.maps)`` と同等となるように空の辞書が使われます。このメ" +"ソッドは、親マッピングを変更することなく値を更新できるサブコンテキストを作成" +"するのに使われます。" -#: ../../library/collections.rst:86 +#: ../../library/collections.rst:90 msgid "The optional ``m`` parameter was added." msgstr "オプションの ``m`` 引数が追加されました。" -#: ../../library/collections.rst:89 -msgid "Keyword arguments support was added." -msgstr "キーワード引数のサポートが追加されました。" - -#: ../../library/collections.rst:94 +#: ../../library/collections.rst:95 msgid "" "Property returning a new :class:`ChainMap` containing all of the maps in the " "current instance except the first one. This is useful for skipping the " @@ -243,23 +249,15 @@ msgstr "" "func:`super` 関数にも似ています。 ``d.parents`` への参照は ``ChainMap(*d." "maps[1:])`` と等価です。" -#: ../../library/collections.rst:102 +#: ../../library/collections.rst:103 msgid "" -"Note, the iteration order of a :class:`ChainMap` is determined by scanning " +"Note, the iteration order of a :class:`ChainMap()` is determined by scanning " "the mappings last to first::" msgstr "" -":class:`ChainMap` の反復順序は、マッピングを最後から最初へスキャンして決定さ" -"れることに注意してください。" +":class:`ChainMap()` の反復順序は、マッピングオブジェクトを末尾から先頭に向か" +"う走査で決まることに注意してください。" -#: ../../library/collections.rst:105 -msgid "" -">>> baseline = {'music': 'bach', 'art': 'rembrandt'}\n" -">>> adjustments = {'art': 'van gogh', 'opera': 'carmen'}\n" -">>> list(ChainMap(adjustments, baseline))\n" -"['music', 'art', 'opera']" -msgstr "" - -#: ../../library/collections.rst:110 +#: ../../library/collections.rst:111 msgid "" "This gives the same ordering as a series of :meth:`dict.update` calls " "starting with the last mapping::" @@ -267,21 +265,13 @@ msgstr "" "これは、末尾のマッピングオブジェクトから始めた一連の :meth:`dict.update` の呼" "び出しと同じ順序になります。" -#: ../../library/collections.rst:113 -msgid "" -">>> combined = baseline.copy()\n" -">>> combined.update(adjustments)\n" -">>> list(combined)\n" -"['music', 'art', 'opera']" -msgstr "" - -#: ../../library/collections.rst:118 +#: ../../library/collections.rst:119 msgid "Added support for ``|`` and ``|=`` operators, specified in :pep:`584`." msgstr "" ":pep:`584` で規定されている ``|`` 演算子と ``|=`` 演算子のサポートを追加しま" "した。" -#: ../../library/collections.rst:123 +#: ../../library/collections.rst:124 msgid "" "The `MultiContext class `_ in the Enthought `CodeTools package " @@ -293,7 +283,7 @@ msgstr "" "codetools/blob/4.0.0/codetools/contexts/multi_context.py>`_ は、チェーン内の" "すべてのマッピングへの書き込みをサポートするオプションを持ちます。" -#: ../../library/collections.rst:129 +#: ../../library/collections.rst:130 msgid "" "Django's `Context class `_ for templating is a read-only chain of mappings. It " @@ -301,25 +291,22 @@ msgid "" "`~collections.ChainMap.new_child` method and the :attr:`~collections." "ChainMap.parents` property." msgstr "" -"Django のテンプレート用の `Context class `_ は、読み出し専用のマッピングのチェー" -"ンです。 :meth:`~collections.ChainMap.new_child` メソッドや :attr:" +"Django のテンプレート用の `Context class `_ は、読み出し専用のマッピングの" +"チェーンです。 :meth:`~collections.ChainMap.new_child` メソッドや :attr:" "`~collections.ChainMap.parents` プロパティに似た push や pop の機能もありま" "す。" -#: ../../library/collections.rst:136 +#: ../../library/collections.rst:137 msgid "" -"The `Nested Contexts recipe `_ has options to control " -"whether writes and other mutations apply only to the first mapping or to any " -"mapping in the chain." +"The `Nested Contexts recipe `_ " +"has options to control whether writes and other mutations apply only to the " +"first mapping or to any mapping in the chain." msgstr "" -"`Nested Contexts recipe `_ は、書き込み・その他の変更が最初の" -"マッピングにのみ適用されるか、チェーンのすべてのマッピングに適用されるか、制" -"御するオプションを持ちます。" +"`Nested Contexts recipe `_ は、" +"書き込みその他の変更が最初のマッピングにのみ適用されるか、チェーンのすべての" +"マッピングに適用されるか、制御するオプションを持ちます。" -#: ../../library/collections.rst:141 +#: ../../library/collections.rst:142 msgid "" "A `greatly simplified read-only version of Chainmap `_." @@ -327,25 +314,19 @@ msgstr "" "`非常に単純化した読み出し専用バージョンの Chainmap `_。" -#: ../../library/collections.rst:146 +#: ../../library/collections.rst:147 msgid ":class:`ChainMap` Examples and Recipes" msgstr ":class:`ChainMap` の例とレシピ" -#: ../../library/collections.rst:148 +#: ../../library/collections.rst:149 msgid "This section shows various approaches to working with chained maps." msgstr "この節では、チェーンされたマッピングを扱う様々な手法を示します。" -#: ../../library/collections.rst:151 +#: ../../library/collections.rst:152 msgid "Example of simulating Python's internal lookup chain::" msgstr "Python の内部探索チェーンをシミュレートする例::" -#: ../../library/collections.rst:153 -msgid "" -"import builtins\n" -"pylookup = ChainMap(locals(), globals(), vars(builtins))" -msgstr "" - -#: ../../library/collections.rst:156 +#: ../../library/collections.rst:157 msgid "" "Example of letting user specified command-line arguments take precedence " "over environment variables which in turn take precedence over default " @@ -353,25 +334,7 @@ msgid "" msgstr "" "ユーザ指定のコマンドライン引数、環境変数、デフォルト値、の順に優先させる例::" -#: ../../library/collections.rst:159 -msgid "" -"import os, argparse\n" -"\n" -"defaults = {'color': 'red', 'user': 'guest'}\n" -"\n" -"parser = argparse.ArgumentParser()\n" -"parser.add_argument('-u', '--user')\n" -"parser.add_argument('-c', '--color')\n" -"namespace = parser.parse_args()\n" -"command_line_args = {k: v for k, v in vars(namespace).items() if v is not " -"None}\n" -"\n" -"combined = ChainMap(command_line_args, os.environ, defaults)\n" -"print(combined['color'])\n" -"print(combined['user'])" -msgstr "" - -#: ../../library/collections.rst:173 +#: ../../library/collections.rst:174 msgid "" "Example patterns for using the :class:`ChainMap` class to simulate nested " "contexts::" @@ -379,27 +342,7 @@ msgstr "" ":class:`ChainMap` を使ってネストされたコンテキストをシミュレートするパターン" "の例::" -#: ../../library/collections.rst:176 -msgid "" -"c = ChainMap() # Create root context\n" -"d = c.new_child() # Create nested child context\n" -"e = c.new_child() # Child of c, independent from d\n" -"e.maps[0] # Current context dictionary -- like Python's " -"locals()\n" -"e.maps[-1] # Root context -- like Python's globals()\n" -"e.parents # Enclosing context chain -- like Python's nonlocals\n" -"\n" -"d['x'] = 1 # Set value in current context\n" -"d['x'] # Get first key in the chain of contexts\n" -"del d['x'] # Delete from current context\n" -"list(d) # All nested values\n" -"k in d # Check all nested values\n" -"len(d) # Number of nested values\n" -"d.items() # All nested items\n" -"dict(d) # Flatten into a regular dictionary" -msgstr "" - -#: ../../library/collections.rst:192 +#: ../../library/collections.rst:193 msgid "" "The :class:`ChainMap` class only makes updates (writes and deletions) to the " "first mapping in the chain while lookups will search the full chain. " @@ -411,76 +354,30 @@ msgstr "" "除を望むなら、チェーンの深いところで見つかったキーを更新するサブクラスを簡単" "に作れます::" -#: ../../library/collections.rst:197 -msgid "" -"class DeepChainMap(ChainMap):\n" -" 'Variant of ChainMap that allows direct updates to inner scopes'\n" -"\n" -" def __setitem__(self, key, value):\n" -" for mapping in self.maps:\n" -" if key in mapping:\n" -" mapping[key] = value\n" -" return\n" -" self.maps[0][key] = value\n" -"\n" -" def __delitem__(self, key):\n" -" for mapping in self.maps:\n" -" if key in mapping:\n" -" del mapping[key]\n" -" return\n" -" raise KeyError(key)\n" -"\n" -">>> d = DeepChainMap({'zebra': 'black'}, {'elephant': 'blue'}, {'lion': " -"'yellow'})\n" -">>> d['lion'] = 'orange' # update an existing key two levels down\n" -">>> d['snake'] = 'red' # new keys get added to the topmost dict\n" -">>> del d['elephant'] # remove an existing key one level down\n" -">>> d # display result\n" -"DeepChainMap({'zebra': 'black', 'snake': 'red'}, {}, {'lion': 'orange'})" -msgstr "" - -#: ../../library/collections.rst:223 +#: ../../library/collections.rst:224 msgid ":class:`Counter` objects" msgstr ":class:`Counter` オブジェクト" -#: ../../library/collections.rst:225 +#: ../../library/collections.rst:226 msgid "" "A counter tool is provided to support convenient and rapid tallies. For " "example::" msgstr "" "便利で迅速な検数をサポートするカウンタツールが提供されています。例えば::" -#: ../../library/collections.rst:228 -msgid "" -">>> # Tally occurrences of words in a list\n" -">>> cnt = Counter()\n" -">>> for word in ['red', 'blue', 'red', 'green', 'blue', 'blue']:\n" -"... cnt[word] += 1\n" -"...\n" -">>> cnt\n" -"Counter({'blue': 3, 'red': 2, 'green': 1})\n" -"\n" -">>> # Find the ten most common words in Hamlet\n" -">>> import re\n" -">>> words = re.findall(r'\\w+', open('hamlet.txt').read().lower())\n" -">>> Counter(words).most_common(10)\n" -"[('the', 1143), ('and', 966), ('to', 762), ('of', 669), ('i', 631),\n" -" ('you', 554), ('a', 546), ('my', 514), ('hamlet', 471), ('in', 451)]" -msgstr "" - #: ../../library/collections.rst:245 msgid "" -"A :class:`Counter` is a :class:`dict` subclass for counting :term:`hashable` " +"A :class:`Counter` is a :class:`dict` subclass for counting hashable " "objects. It is a collection where elements are stored as dictionary keys and " "their counts are stored as dictionary values. Counts are allowed to be any " "integer value including zero or negative counts. The :class:`Counter` class " "is similar to bags or multisets in other languages." msgstr "" -":class:`Counter` は :term:`ハッシュ可能 ` なオブジェクトをカウント" -"する :class:`dict` のサブクラスです。これは、要素を辞書のキーとして保存し、そ" -"のカウントを辞書の値として保存するコレクションです。カウントは、0 や負のカウ" -"ントを含む整数値をとれます。 :class:`Counter` クラスは、他の言語のバッグや多" -"重集合のようなものです。" +":class:`Counter` はハッシュ可能なオブジェクトをカウントする :class:`dict` の" +"サブクラスです。これは、要素を辞書のキーとして保存し、そのカウントを辞書の値" +"として保存するコレクションです。カウントは、0 や負のカウントを含む整数値をと" +"れます。 :class:`Counter` クラスは、他の言語のバッグや多重集合のようなもので" +"す。" #: ../../library/collections.rst:251 msgid "" @@ -508,24 +405,24 @@ msgstr "" #: ../../library/collections.rst:274 msgid "" -"As a :class:`dict` subclass, :class:`Counter` inherited the capability to " +"As a :class:`dict` subclass, :class:`Counter` Inherited the capability to " "remember insertion order. Math operations on *Counter* objects also " "preserve order. Results are ordered according to when an element is first " "encountered in the left operand and then by the order encountered in the " "right operand." msgstr "" -":class:`Counter` は :class:`dict` のサブクラスとして要素の挿入順を維持する機" -"能を継承しました。 *Counter* オブジェクトに対する数学演算も順序を維持します。" -"結果の順序はまず左の被演算子における要素の出現順に従い、その後右の被演算子に" -"おいて要素が出現する順序になります。" +":class:`Counter` は class:`dict` のサブクラスとして要素の挿入順を維持する機能" +"を継承しました。 *Counter* オブジェクトに対する数学演算も順序を維持します。結" +"果は左の被演算子で最初に要素が出現するあとに、右の被演算子で要素が出現する順" +"序になります。" #: ../../library/collections.rst:280 msgid "" -"Counter objects support additional methods beyond those available for all " +"Counter objects support three methods beyond those available for all " "dictionaries:" msgstr "" -"カウンタオブジェクトは全ての辞書で利用できるメソッドに加えて、以下に示す追加" -"のメソッドをサポートしています。" +"カウンタオブジェクトは、すべての辞書で利用できるメソッドに加えて、次の 3 つの" +"メソッドをサポートしています。" #: ../../library/collections.rst:285 msgid "" @@ -558,11 +455,7 @@ msgstr "" "update` に似ていますが、カウントを置き換えるのではなく引きます。入力も出力" "も、 0 や負になりえます。" -#: ../../library/collections.rst:319 -msgid "Compute the sum of the counts." -msgstr "カウントの合計を計算します。" - -#: ../../library/collections.rst:327 +#: ../../library/collections.rst:317 msgid "" "The usual dictionary methods are available for :class:`Counter` objects " "except for two which work differently for counters." @@ -570,12 +463,12 @@ msgstr "" "普通の辞書のメソッドは、以下の 2 つのメソッドがカウンタに対して異なる振る舞い" "をするのを除き、 :class:`Counter` オブジェクトにも利用できます。" -#: ../../library/collections.rst:332 +#: ../../library/collections.rst:322 msgid "This class method is not implemented for :class:`Counter` objects." msgstr "" "このクラスメソッドは :class:`Counter` オブジェクトには実装されていません。" -#: ../../library/collections.rst:336 +#: ../../library/collections.rst:326 msgid "" "Elements are counted from an *iterable* or added-in from another *mapping* " "(or counter). Like :meth:`dict.update` but adds counts instead of replacing " @@ -587,86 +480,28 @@ msgstr "" "加します。また、 *iterable* には ``(key, value)`` 対のシーケンスではなく、要" "素のシーケンスが求められます。" -#: ../../library/collections.rst:341 -msgid "" -"Counters support rich comparison operators for equality, subset, and " -"superset relationships: ``==``, ``!=``, ``<``, ``<=``, ``>``, ``>=``. All of " -"those tests treat missing elements as having zero counts so that " -"``Counter(a=1) == Counter(a=1, b=0)`` returns true." -msgstr "" -"カウンタオブジェクトは等価、部分集合、上位集合のための次の拡張比較 (rich " -"comparison) 演算子をサポートします: ``==``, ``!=``, ``<``, ``<=``, ``>``, " -"``>=``。これらの比較は、存在しない要素をカウントがゼロであるとみなします。す" -"なわち、 ``Counter(a=1) == Counter(a=1, b=0)`` は真を返します。" - -#: ../../library/collections.rst:346 -msgid "Rich comparison operations were added." -msgstr "拡張比較 (rich comparison) 演算が追加されました。" - -#: ../../library/collections.rst:349 -msgid "" -"In equality tests, missing elements are treated as having zero counts. " -"Formerly, ``Counter(a=3)`` and ``Counter(a=3, b=0)`` were considered " -"distinct." -msgstr "" -"等価比較において、存在しない要素はカウントがゼロであるとみなされるようになり" -"ました。かつては ``Counter(a=3)`` と ``Counter(a=3, b=0)`` は異なるとみなされ" -"ていました。" - -#: ../../library/collections.rst:354 +#: ../../library/collections.rst:331 msgid "Common patterns for working with :class:`Counter` objects::" msgstr ":class:`Counter` オブジェクトを使ったよくあるパターン::" -#: ../../library/collections.rst:356 -msgid "" -"c.total() # total of all counts\n" -"c.clear() # reset all counts\n" -"list(c) # list unique elements\n" -"set(c) # convert to a set\n" -"dict(c) # convert to a regular dictionary\n" -"c.items() # access the (elem, cnt) pairs\n" -"Counter(dict(list_of_pairs)) # convert from a list of (elem, cnt) pairs\n" -"c.most_common()[:-n-1:-1] # n least common elements\n" -"+c # remove zero and negative counts" -msgstr "" - -#: ../../library/collections.rst:366 +#: ../../library/collections.rst:343 msgid "" "Several mathematical operations are provided for combining :class:`Counter` " "objects to produce multisets (counters that have counts greater than zero). " "Addition and subtraction combine counters by adding or subtracting the " "counts of corresponding elements. Intersection and union return the minimum " -"and maximum of corresponding counts. Equality and inclusion compare " -"corresponding counts. Each operation can accept inputs with signed counts, " -"but the output will exclude results with counts of zero or less." -msgstr "" -":class:`Counter` オブジェクトを組み合わせて多重集合 (0より大きいカウントを持" -"つカウンタ) を作るためのいくつかの数学演算が提供されています。加算と減算はそ" -"れぞれの要素のカウンタを加算または減算することによりカウンタオブジェクトを組" -"み合わせます。積集合と和集合は、それぞれのカウントの最大値と最小値を返しま" -"す。等価と包含はそれぞれのカウントを比較します。それぞれの演算は符号付きカウ" -"ントを持った入力を受け付けますが、カウントが0以下の要素は結果から取り除かれま" -"す。" - -#: ../../library/collections.rst:374 -msgid "" -">>> c = Counter(a=3, b=1)\n" -">>> d = Counter(a=1, b=2)\n" -">>> c + d # add two counters together: c[x] + d[x]\n" -"Counter({'a': 4, 'b': 3})\n" -">>> c - d # subtract (keeping only positive counts)\n" -"Counter({'a': 2})\n" -">>> c & d # intersection: min(c[x], d[x])\n" -"Counter({'a': 1, 'b': 1})\n" -">>> c | d # union: max(c[x], d[x])\n" -"Counter({'a': 3, 'b': 2})\n" -">>> c == d # equality: c[x] == d[x]\n" -"False\n" -">>> c <= d # inclusion: c[x] <= d[x]\n" -"False" +"and maximum of corresponding counts. Each operation can accept inputs with " +"signed counts, but the output will exclude results with counts of zero or " +"less." msgstr "" +":class:`Counter` オブジェクトを組み合わせて多重集合 (1 以上のカウントをもつカ" +"ウンタ) を作るために、いくつかの数学演算が提供されています。足し算と引き算" +"は、対応する要素を足したり引いたりすることによってカウンタを組み合わせます。" +"積集合と和集合は、対応するカウントの最大値と最小値を返します。それぞれの演算" +"はカウントに符号がついた入力を受け付けますが、カウントが 0 以下である結果は出" +"力から除かれます。" -#: ../../library/collections.rst:391 +#: ../../library/collections.rst:361 msgid "" "Unary addition and subtraction are shortcuts for adding an empty counter or " "subtracting from an empty counter." @@ -674,13 +509,13 @@ msgstr "" "単項加算および減算は、空カウンタの加算や空カウンタからの減算へのショートカッ" "トです。" -#: ../../library/collections.rst:400 +#: ../../library/collections.rst:370 msgid "" "Added support for unary plus, unary minus, and in-place multiset operations." msgstr "" "単項加算、単項減算、in-place の多重集合操作のサポートが追加されました。" -#: ../../library/collections.rst:405 +#: ../../library/collections.rst:375 msgid "" "Counters were primarily designed to work with positive integers to represent " "running counts; however, care was taken to not unnecessarily preclude use " @@ -692,7 +527,7 @@ msgstr "" "に配慮されています。このようなユースケースの助けになるように、この節で最低限" "の範囲と型の制限について記述します。" -#: ../../library/collections.rst:410 +#: ../../library/collections.rst:380 msgid "" "The :class:`Counter` class itself is a dictionary subclass with no " "restrictions on its keys and values. The values are intended to be numbers " @@ -702,7 +537,7 @@ msgstr "" "値はカウントを表す数であることを意図していますが、値フィールドに任意のものを" "保存 *できます* 。" -#: ../../library/collections.rst:414 +#: ../../library/collections.rst:384 msgid "" "The :meth:`~Counter.most_common` method requires only that the values be " "orderable." @@ -710,7 +545,7 @@ msgstr "" ":meth:`~Counter.most_common` メソッドが要求するのは、値が順序付け可能なことだ" "けです。" -#: ../../library/collections.rst:416 +#: ../../library/collections.rst:386 msgid "" "For in-place operations such as ``c[key] += 1``, the value type need only " "support addition and subtraction. So fractions, floats, and decimals would " @@ -723,7 +558,7 @@ msgstr "" "トされています。これと同じことが、 負や 0 の値を入力と出力に許す :meth:" "`~Counter.update` と :meth:`~Counter.subtract` メソッド にも言えます。" -#: ../../library/collections.rst:422 +#: ../../library/collections.rst:392 msgid "" "The multiset methods are designed only for use cases with positive values. " "The inputs may be negative or zero, but only outputs with positive values " @@ -734,7 +569,7 @@ msgstr "" "は負や 0 に出来ますが、正の値の出力のみが生成されます。型の制限はありません" "が、値の型は足し算、引き算、比較をサポートしている必要があります。" -#: ../../library/collections.rst:427 +#: ../../library/collections.rst:397 msgid "" "The :meth:`~Counter.elements` method requires integer counts. It ignores " "zero and negative counts." @@ -742,7 +577,7 @@ msgstr "" ":meth:`~Counter.elements` メソッドは整数のカウントを要求します。これは 0 と負" "のカウントを無視します。" -#: ../../library/collections.rst:432 +#: ../../library/collections.rst:402 msgid "" "`Bag class `_ in Smalltalk." @@ -750,13 +585,13 @@ msgstr "" "Smalltalk の `Bag class `_ 。" -#: ../../library/collections.rst:435 +#: ../../library/collections.rst:405 msgid "" "Wikipedia entry for `Multisets `_." msgstr "" "Wikipedia の `Multisets `_ の項目。" -#: ../../library/collections.rst:437 +#: ../../library/collections.rst:407 msgid "" "`C++ multisets `_ tutorial with examples." @@ -764,7 +599,7 @@ msgstr "" "`C++ multisets `_ の例を交えたチュートリアル。" -#: ../../library/collections.rst:440 +#: ../../library/collections.rst:410 msgid "" "For mathematical operations on multisets and their use cases, see *Knuth, " "Donald. The Art of Computer Programming Volume II, Section 4.6.3, Exercise " @@ -774,7 +609,7 @@ msgstr "" "Computer Programming Volume II, Section 4.6.3, Exercise 19* を参照してくださ" "い。" -#: ../../library/collections.rst:444 +#: ../../library/collections.rst:414 msgid "" "To enumerate all distinct multisets of a given size over a given set of " "elements, see :func:`itertools.combinations_with_replacement`::" @@ -783,16 +618,11 @@ msgstr "" "上げるには、 :func:`itertools.combinations_with_replacement` を参照してくださ" "い::" -#: ../../library/collections.rst:447 -msgid "" -"map(Counter, combinations_with_replacement('ABC', 2)) # --> AA AB AC BB BC CC" -msgstr "" - -#: ../../library/collections.rst:451 +#: ../../library/collections.rst:421 msgid ":class:`deque` objects" msgstr ":class:`deque` オブジェクト" -#: ../../library/collections.rst:455 +#: ../../library/collections.rst:425 msgid "" "Returns a new deque object initialized left-to-right (using :meth:`append`) " "with data from *iterable*. If *iterable* is not specified, the new deque is " @@ -802,31 +632,31 @@ msgstr "" "`append` をつかって) 左から右に初期化して返します。 *iterable* が指定されない" "場合、新しい deque オブジェクトは空になります。" -#: ../../library/collections.rst:458 +#: ../../library/collections.rst:428 msgid "" "Deques are a generalization of stacks and queues (the name is pronounced " "\"deck\" and is short for \"double-ended queue\"). Deques support thread-" "safe, memory efficient appends and pops from either side of the deque with " -"approximately the same *O*\\ (1) performance in either direction." +"approximately the same O(1) performance in either direction." msgstr "" "Deque とは、スタックとキューを一般化したものです (この名前は「デック」と発音" "され、これは「double-ended queue」の省略形です)。Deque はどちらの側からも " "append と pop が可能で、スレッドセーフでメモリ効率がよく、どちらの方向からも" -"およそ *O*\\ (1) のパフォーマンスで実行できます。" +"およそ ``O(1)`` のパフォーマンスで実行できます。" -#: ../../library/collections.rst:463 +#: ../../library/collections.rst:433 msgid "" "Though :class:`list` objects support similar operations, they are optimized " -"for fast fixed-length operations and incur *O*\\ (*n*) memory movement costs " -"for ``pop(0)`` and ``insert(0, v)`` operations which change both the size " -"and position of the underlying data representation." +"for fast fixed-length operations and incur O(n) memory movement costs for " +"``pop(0)`` and ``insert(0, v)`` operations which change both the size and " +"position of the underlying data representation." msgstr "" ":class:`list` オブジェクトでも同様の操作を実現できますが、これは高速な固定長" -"の操作に特化されており、基礎のデータ表現形式のサイズと位置を両方変えるような " -"``pop(0)`` や ``insert(0, v)`` などの操作ではメモリ移動のために *O*\\ (*n*) " -"のコストを必要とします。" +"の操作に特化されており、内部のデータ表現形式のサイズと位置を両方変えるような " +"``pop(0)`` や ``insert(0, v)`` などの操作ではメモリ移動のために ``O(n)`` のコ" +"ストを必要とします。" -#: ../../library/collections.rst:469 +#: ../../library/collections.rst:439 msgid "" "If *maxlen* is not specified or is ``None``, deques may grow to an arbitrary " "length. Otherwise, the deque is bounded to the specified maximum length. " @@ -846,38 +676,38 @@ msgstr "" "トランザクションの tracking や最近使った要素だけを残したいデータプール (pool " "of data) などにも便利です。" -#: ../../library/collections.rst:478 +#: ../../library/collections.rst:448 msgid "Deque objects support the following methods:" msgstr "Deque オブジェクトは以下のようなメソッドをサポートしています:" -#: ../../library/collections.rst:482 +#: ../../library/collections.rst:452 msgid "Add *x* to the right side of the deque." msgstr "*x* を deque の右側につけ加えます。" -#: ../../library/collections.rst:487 +#: ../../library/collections.rst:457 msgid "Add *x* to the left side of the deque." msgstr "*x* を deque の左側につけ加えます。" -#: ../../library/collections.rst:492 +#: ../../library/collections.rst:462 msgid "Remove all elements from the deque leaving it with length 0." msgstr "deque からすべての要素を削除し、長さを 0 にします。" -#: ../../library/collections.rst:497 +#: ../../library/collections.rst:467 msgid "Create a shallow copy of the deque." msgstr "deque の浅いコピーを作成します。" -#: ../../library/collections.rst:504 +#: ../../library/collections.rst:474 msgid "Count the number of deque elements equal to *x*." msgstr "deque の *x* に等しい要素を数え上げます。" -#: ../../library/collections.rst:511 +#: ../../library/collections.rst:481 msgid "" "Extend the right side of the deque by appending elements from the iterable " "argument." msgstr "" "イテラブルな引数 iterable から得られる要素を deque の右側に追加し拡張します。" -#: ../../library/collections.rst:517 +#: ../../library/collections.rst:487 msgid "" "Extend the left side of the deque by appending elements from *iterable*. " "Note, the series of left appends results in reversing the order of elements " @@ -886,7 +716,7 @@ msgstr "" "イテラブルな引数 iterable から得られる要素を deque の左側に追加し拡張します。" "注意: 左から追加した結果は、イテラブルな引数の順序とは逆になります。" -#: ../../library/collections.rst:524 +#: ../../library/collections.rst:494 msgid "" "Return the position of *x* in the deque (at or after index *start* and " "before index *stop*). Returns the first match or raises :exc:`ValueError` " @@ -896,11 +726,11 @@ msgstr "" "*stop* の両端を含む範囲で)。最初のマッチを返すか、見つからない場合には :exc:" "`ValueError` を発生させます。" -#: ../../library/collections.rst:533 +#: ../../library/collections.rst:503 msgid "Insert *x* into the deque at position *i*." msgstr "*x* を deque の位置 *i* に挿入します。" -#: ../../library/collections.rst:535 +#: ../../library/collections.rst:505 msgid "" "If the insertion would cause a bounded deque to grow beyond *maxlen*, an :" "exc:`IndexError` is raised." @@ -908,7 +738,7 @@ msgstr "" "挿入によって、長さに制限のある deque の長さが *maxlen* を超える場合、:exc:" "`IndexError` が発生します。" -#: ../../library/collections.rst:543 +#: ../../library/collections.rst:513 msgid "" "Remove and return an element from the right side of the deque. If no " "elements are present, raises an :exc:`IndexError`." @@ -916,7 +746,7 @@ msgstr "" "deque の右側から要素をひとつ削除し、その要素を返します。要素がひとつも存在し" "ない場合は :exc:`IndexError` を発生させます。" -#: ../../library/collections.rst:549 +#: ../../library/collections.rst:519 msgid "" "Remove and return an element from the left side of the deque. If no elements " "are present, raises an :exc:`IndexError`." @@ -924,7 +754,7 @@ msgstr "" "deque の左側から要素をひとつ削除し、その要素を返します。要素がひとつも存在し" "ない場合は :exc:`IndexError` を発生させます。" -#: ../../library/collections.rst:555 +#: ../../library/collections.rst:525 msgid "" "Remove the first occurrence of *value*. If not found, raises a :exc:" "`ValueError`." @@ -932,11 +762,11 @@ msgstr "" "*value* の最初に現れるものを削除します。要素が見付からないない場合は :exc:" "`ValueError` を送出します。" -#: ../../library/collections.rst:561 +#: ../../library/collections.rst:531 msgid "Reverse the elements of the deque in-place and then return ``None``." msgstr "deque の要素をインプレースに反転し、``None`` を返します。" -#: ../../library/collections.rst:568 +#: ../../library/collections.rst:538 msgid "" "Rotate the deque *n* steps to the right. If *n* is negative, rotate to the " "left." @@ -944,7 +774,7 @@ msgstr "" "deque の要素を全体で *n* ステップだけ右にローテートします。*n* が負の値の場合" "は、左にローテートします。" -#: ../../library/collections.rst:571 +#: ../../library/collections.rst:541 msgid "" "When the deque is not empty, rotating one step to the right is equivalent to " "``d.appendleft(d.pop())``, and rotating one step to the left is equivalent " @@ -954,30 +784,29 @@ msgstr "" "appendleft(d.pop())`` と同じで、 deque をひとつ左にローテートすることは ``d." "append(d.popleft())`` と同じです。" -#: ../../library/collections.rst:576 +#: ../../library/collections.rst:546 msgid "Deque objects also provide one read-only attribute:" msgstr "deque オブジェクトは読み出し専用属性も 1 つ提供しています:" -#: ../../library/collections.rst:580 +#: ../../library/collections.rst:550 msgid "Maximum size of a deque or ``None`` if unbounded." msgstr "deque の最大長で、制限されていなければ ``None`` です。" -#: ../../library/collections.rst:585 +#: ../../library/collections.rst:555 msgid "" "In addition to the above, deques support iteration, pickling, ``len(d)``, " "``reversed(d)``, ``copy.copy(d)``, ``copy.deepcopy(d)``, membership testing " "with the :keyword:`in` operator, and subscript references such as ``d[0]`` " -"to access the first element. Indexed access is *O*\\ (1) at both ends but " -"slows to *O*\\ (*n*) in the middle. For fast random access, use lists " -"instead." +"to access the first element. Indexed access is O(1) at both ends but slows " +"to O(n) in the middle. For fast random access, use lists instead." msgstr "" "上記に加え、 deque はイテレーション, pickle 化, ``len(d)``, ``reversed(d)``, " "``copy.copy(d)``, ``copy.deepcopy(d)``, :keyword:`in` 演算子による包含の検" "査, ``d[0]`` のような添字による参照をサポートしています。添字によるアクセス" -"は、両端の要素では *O*\\ (1) ですが、中央部分の要素では *O*\\ (*n*) と遅くな" -"ります。高速なランダムアクセスのためには、代わりにリストを使ってください。" +"は、両端の要素では O(1) ですが、中央部分の要素では O(n) と遅くなります。高速" +"なランダムアクセスのためには、代わりにリストを使ってください。" -#: ../../library/collections.rst:591 +#: ../../library/collections.rst:561 msgid "" "Starting in version 3.5, deques support ``__add__()``, ``__mul__()``, and " "``__imul__()``." @@ -985,75 +814,19 @@ msgstr "" "バージョン 3.5 から deque は ``__add__()``, ``__mul__()``, ``__imul__()`` を" "サポートしました。" -#: ../../library/collections.rst:594 +#: ../../library/collections.rst:564 msgid "Example:" msgstr "例:" -#: ../../library/collections.rst:596 -msgid "" -">>> from collections import deque\n" -">>> d = deque('ghi') # make a new deque with three items\n" -">>> for elem in d: # iterate over the deque's elements\n" -"... print(elem.upper())\n" -"G\n" -"H\n" -"I\n" -"\n" -">>> d.append('j') # add a new entry to the right side\n" -">>> d.appendleft('f') # add a new entry to the left side\n" -">>> d # show the representation of the deque\n" -"deque(['f', 'g', 'h', 'i', 'j'])\n" -"\n" -">>> d.pop() # return and remove the rightmost item\n" -"'j'\n" -">>> d.popleft() # return and remove the leftmost item\n" -"'f'\n" -">>> list(d) # list the contents of the deque\n" -"['g', 'h', 'i']\n" -">>> d[0] # peek at leftmost item\n" -"'g'\n" -">>> d[-1] # peek at rightmost item\n" -"'i'\n" -"\n" -">>> list(reversed(d)) # list the contents of a deque in " -"reverse\n" -"['i', 'h', 'g']\n" -">>> 'h' in d # search the deque\n" -"True\n" -">>> d.extend('jkl') # add multiple elements at once\n" -">>> d\n" -"deque(['g', 'h', 'i', 'j', 'k', 'l'])\n" -">>> d.rotate(1) # right rotation\n" -">>> d\n" -"deque(['l', 'g', 'h', 'i', 'j', 'k'])\n" -">>> d.rotate(-1) # left rotation\n" -">>> d\n" -"deque(['g', 'h', 'i', 'j', 'k', 'l'])\n" -"\n" -">>> deque(reversed(d)) # make a new deque in reverse order\n" -"deque(['l', 'k', 'j', 'i', 'h', 'g'])\n" -">>> d.clear() # empty the deque\n" -">>> d.pop() # cannot pop from an empty deque\n" -"Traceback (most recent call last):\n" -" File \"\", line 1, in -toplevel-\n" -" d.pop()\n" -"IndexError: pop from an empty deque\n" -"\n" -">>> d.extendleft('abc') # extendleft() reverses the input " -"order\n" -">>> d\n" -"deque(['c', 'b', 'a'])" -msgstr "" - -#: ../../library/collections.rst:651 +#: ../../library/collections.rst:621 msgid ":class:`deque` Recipes" msgstr ":class:`deque` のレシピ" -#: ../../library/collections.rst:653 +#: ../../library/collections.rst:623 msgid "This section shows various approaches to working with deques." msgstr "この節では deque を使った様々なアプローチを紹介します。" -#: ../../library/collections.rst:655 +#: ../../library/collections.rst:625 msgid "" "Bounded length deques provide functionality similar to the ``tail`` filter " "in Unix::" @@ -1061,15 +834,7 @@ msgstr "" "長さが制限された deque は Unix における ``tail`` フィルタに相当する機能を提供" "します::" -#: ../../library/collections.rst:658 -msgid "" -"def tail(filename, n=10):\n" -" 'Return the last n lines of a file'\n" -" with open(filename) as f:\n" -" return deque(f, n)" -msgstr "" - -#: ../../library/collections.rst:663 +#: ../../library/collections.rst:633 msgid "" "Another approach to using deques is to maintain a sequence of recently added " "elements by appending to the right and popping to the left::" @@ -1077,22 +842,7 @@ msgstr "" "deque を使用する別のアプローチは、右に要素を追加し左から要素を取り出すことで" "最近追加した要素のシーケンスを保持することです::" -#: ../../library/collections.rst:666 -msgid "" -"def moving_average(iterable, n=3):\n" -" # moving_average([40, 30, 50, 46, 39, 44]) --> 40.0 42.0 45.0 43.0\n" -" # https://en.wikipedia.org/wiki/Moving_average\n" -" it = iter(iterable)\n" -" d = deque(itertools.islice(it, n-1))\n" -" d.appendleft(0)\n" -" s = sum(d)\n" -" for elem in it:\n" -" s += elem - d.popleft()\n" -" d.append(elem)\n" -" yield s / n" -msgstr "" - -#: ../../library/collections.rst:678 +#: ../../library/collections.rst:648 msgid "" "A `round-robin scheduler `_ can be implemented with input iterators stored in a :" @@ -1108,22 +858,7 @@ msgstr "" "そのイテレータが値を出し切った場合は、 :meth:`~deque.popleft` で除去できま" "す; そうでない場合は、 :meth:`~deque.rotate` メソッドで末尾に回せます::" -#: ../../library/collections.rst:685 -msgid "" -"def roundrobin(*iterables):\n" -" \"roundrobin('ABC', 'D', 'EF') --> A D E B F C\"\n" -" iterators = deque(map(iter, iterables))\n" -" while iterators:\n" -" try:\n" -" while True:\n" -" yield next(iterators[0])\n" -" iterators.rotate(-1)\n" -" except StopIteration:\n" -" # Remove an exhausted iterator.\n" -" iterators.popleft()" -msgstr "" - -#: ../../library/collections.rst:697 +#: ../../library/collections.rst:667 msgid "" "The :meth:`~deque.rotate` method provides a way to implement :class:`deque` " "slicing and deletion. For example, a pure Python implementation of ``del " @@ -1134,15 +869,7 @@ msgstr "" "例えば、 純粋な Python 実装の ``del d[n]`` は ``rotate()`` メソッドを頼りに、" "pop される要素の位置を割り出します::" -#: ../../library/collections.rst:701 -msgid "" -"def delete_nth(d, n):\n" -" d.rotate(-n)\n" -" d.popleft()\n" -" d.rotate(n)" -msgstr "" - -#: ../../library/collections.rst:706 +#: ../../library/collections.rst:676 msgid "" "To implement :class:`deque` slicing, use a similar approach applying :meth:" "`~deque.rotate` to bring a target element to the left side of the deque. " @@ -1158,11 +885,11 @@ msgstr "" "として、Forth スタイルのスタック操作、つまり ``dup``, ``drop``, ``swap``, " "``over``, ``pick``, ``rot``, および ``roll`` を実装するのも簡単です。" -#: ../../library/collections.rst:716 +#: ../../library/collections.rst:686 msgid ":class:`defaultdict` objects" msgstr ":class:`defaultdict` オブジェクト" -#: ../../library/collections.rst:720 +#: ../../library/collections.rst:690 msgid "" "Return a new dictionary-like object. :class:`defaultdict` is a subclass of " "the built-in :class:`dict` class. It overrides one method and adds one " @@ -1174,7 +901,7 @@ msgstr "" "書き込み可能なインスタンス変数をひとつ追加しています。それ以外の機能は :" "class:`dict` クラスと同じですので、ここでは説明しません。" -#: ../../library/collections.rst:725 +#: ../../library/collections.rst:695 msgid "" "The first argument provides the initial value for the :attr:" "`default_factory` attribute; it defaults to ``None``. All remaining " @@ -1185,7 +912,7 @@ msgstr "" "``None`` です。残りの引数はキーワード引数も含め、 :class:`dict` のコンストラ" "クタに与えられた場合と同様に扱われます。" -#: ../../library/collections.rst:731 +#: ../../library/collections.rst:701 msgid "" ":class:`defaultdict` objects support the following method in addition to the " "standard :class:`dict` operations:" @@ -1193,7 +920,7 @@ msgstr "" ":class:`defaultdict` オブジェクトは標準の :class:`dict` に加えて、以下のメ" "ソッドを実装しています:" -#: ../../library/collections.rst:736 +#: ../../library/collections.rst:706 msgid "" "If the :attr:`default_factory` attribute is ``None``, this raises a :exc:" "`KeyError` exception with the *key* as argument." @@ -1201,7 +928,7 @@ msgstr "" "もし :attr:`default_factory` 属性が ``None`` であれば、このメソッドは :exc:" "`KeyError` 例外を、 *key* を引数として発生させます。" -#: ../../library/collections.rst:739 +#: ../../library/collections.rst:709 msgid "" "If :attr:`default_factory` is not ``None``, it is called without arguments " "to provide a default value for the given *key*, this value is inserted in " @@ -1211,7 +938,7 @@ msgstr "" "しで呼び出され、与えらえた *key* に対応するデフォルト値を提供します。この値" "は、辞書内に *key* に対応して登録され、最後に返されます。" -#: ../../library/collections.rst:743 +#: ../../library/collections.rst:713 msgid "" "If calling :attr:`default_factory` raises an exception this exception is " "propagated unchanged." @@ -1219,32 +946,34 @@ msgstr "" "もし :attr:`default_factory` の呼出が例外を発生させた場合には、変更せずそのま" "ま例外を投げます。" -#: ../../library/collections.rst:746 +#: ../../library/collections.rst:716 msgid "" -"This method is called by the :meth:`~object.__getitem__` method of the :" -"class:`dict` class when the requested key is not found; whatever it returns " -"or raises is then returned or raised by :meth:`~object.__getitem__`." +"This method is called by the :meth:`__getitem__` method of the :class:`dict` " +"class when the requested key is not found; whatever it returns or raises is " +"then returned or raised by :meth:`__getitem__`." msgstr "" -"このメソッドは :class:`dict` クラスの :meth:`~object.__getitem__` メソッド" -"で、キーが存在しなかった場合によびだされます。値を返すか例外を発生させるのど" -"ちらにしても、 :meth:`~object.__getitem__` からもそのまま値が返るか例外が発生" -"します。" +"このメソッドは :class:`dict` クラスの :meth:`__getitem__` メソッドで、キーが" +"存在しなかった場合によびだされます。値を返すか例外を発生させるのどちらにして" +"も、 :meth:`__getitem__` からもそのまま値が返るか例外が発生します。" -#: ../../library/collections.rst:750 +#: ../../library/collections.rst:720 msgid "" "Note that :meth:`__missing__` is *not* called for any operations besides :" -"meth:`~object.__getitem__`. This means that :meth:`~dict.get` will, like " -"normal dictionaries, return ``None`` as a default rather than using :attr:" +"meth:`__getitem__`. This means that :meth:`get` will, like normal " +"dictionaries, return ``None`` as a default rather than using :attr:" "`default_factory`." msgstr "" +"なお、 :meth:`__missing__` は :meth:`__getitem__` 以外のいかなる演算に対して" +"も呼び出され *ません* 。よって :meth:`get` は、普通の辞書と同様に、 :attr:" +"`default_factory` を使うのではなくデフォルトとして ``None`` を返します。" -#: ../../library/collections.rst:756 +#: ../../library/collections.rst:726 msgid ":class:`defaultdict` objects support the following instance variable:" msgstr "" ":class:`defaultdict` オブジェクトは以下のインスタンス変数をサポートしていま" "す:" -#: ../../library/collections.rst:761 +#: ../../library/collections.rst:731 msgid "" "This attribute is used by the :meth:`__missing__` method; it is initialized " "from the first argument to the constructor, if present, or to ``None``, if " @@ -1253,18 +982,18 @@ msgstr "" "この属性は :meth:`__missing__` メソッドによって使われます。これは存在すればコ" "ンストラクタの第1引数によって初期化され、そうでなければ ``None`` になります。" -#: ../../library/collections.rst:765 ../../library/collections.rst:1192 +#: ../../library/collections.rst:735 ../../library/collections.rst:1132 msgid "" "Added merge (``|``) and update (``|=``) operators, specified in :pep:`584`." msgstr "" ":pep:`584` で規定されている合成演算子 (``|``) と更新演算子 (``|=``)が追加され" "ました。" -#: ../../library/collections.rst:771 +#: ../../library/collections.rst:741 msgid ":class:`defaultdict` Examples" msgstr ":class:`defaultdict` の使用例" -#: ../../library/collections.rst:773 +#: ../../library/collections.rst:743 msgid "" "Using :class:`list` as the :attr:`~defaultdict.default_factory`, it is easy " "to group a sequence of key-value pairs into a dictionary of lists:" @@ -1272,19 +1001,26 @@ msgstr "" ":class:`list` を :attr:`~defaultdict.default_factory` とすることで、キー=値ペ" "アのシーケンスをリストの辞書へ簡単にグループ化できます。:" -#: ../../library/collections.rst:784 +#: ../../library/collections.rst:754 msgid "" "When each key is encountered for the first time, it is not already in the " "mapping; so an entry is automatically created using the :attr:`~defaultdict." -"default_factory` function which returns an empty :class:`list`. The :meth:`!" -"list.append` operation then attaches the value to the new list. When keys " +"default_factory` function which returns an empty :class:`list`. The :meth:" +"`list.append` operation then attaches the value to the new list. When keys " "are encountered again, the look-up proceeds normally (returning the list for " -"that key) and the :meth:`!list.append` operation adds another value to the " +"that key) and the :meth:`list.append` operation adds another value to the " "list. This technique is simpler and faster than an equivalent technique " "using :meth:`dict.setdefault`:" msgstr "" +"それぞれのキーが最初に登場したとき、マッピングにはまだ存在しません。そのため" +"エントリは :attr:`~defaultdict.default_factory` 関数が返す空の :class:`list` " +"を使って自動的に作成されます。 :meth:`list.append` 操作は新しいリストに紐付け" +"られます。キーが再度出現した場合には、通常の参照動作が行われます(そのキーに対" +"応するリストが返ります)。そして :meth:`list.append` 操作で別の値をリストに追" +"加します。このテクニックは :meth:`dict.setdefault` を使った等価なものよりシン" +"プルで速いです:" -#: ../../library/collections.rst:799 +#: ../../library/collections.rst:769 msgid "" "Setting the :attr:`~defaultdict.default_factory` to :class:`int` makes the :" "class:`defaultdict` useful for counting (like a bag or multiset in other " @@ -1294,7 +1030,7 @@ msgstr "" "`defaultdict` を(他の言語の bag や multisetのように)要素の数え上げに便利に使" "うことができます:" -#: ../../library/collections.rst:811 +#: ../../library/collections.rst:781 msgid "" "When a letter is first encountered, it is missing from the mapping, so the :" "attr:`~defaultdict.default_factory` function calls :func:`int` to supply a " @@ -1305,7 +1041,7 @@ msgstr "" "default_factory` 関数が :func:`int` を呼んでデフォルトのカウント0を生成しま" "す。インクリメント操作が各文字を数え上げます。" -#: ../../library/collections.rst:815 +#: ../../library/collections.rst:785 msgid "" "The function :func:`int` which always returns zero is just a special case of " "constant functions. A faster and more flexible way to create constant " @@ -1315,7 +1051,7 @@ msgstr "" "常に0を返す :func:`int` は特殊な関数でした。定数を生成するより速くて柔軟な方" "法は、 0に限らず何でも定数を生成するラムダ関数を使うことです:" -#: ../../library/collections.rst:828 +#: ../../library/collections.rst:797 msgid "" "Setting the :attr:`~defaultdict.default_factory` to :class:`set` makes the :" "class:`defaultdict` useful for building a dictionary of sets:" @@ -1323,11 +1059,11 @@ msgstr "" ":attr:`~defaultdict.default_factory` を :class:`set` に設定することで、 :" "class:`defaultdict` をセットの辞書を作るために利用することができます:" -#: ../../library/collections.rst:841 +#: ../../library/collections.rst:810 msgid ":func:`namedtuple` Factory Function for Tuples with Named Fields" msgstr ":func:`namedtuple` 名前付きフィールドを持つタプルのファクトリ関数" -#: ../../library/collections.rst:843 +#: ../../library/collections.rst:812 msgid "" "Named tuples assign meaning to each position in a tuple and allow for more " "readable, self-documenting code. They can be used wherever regular tuples " @@ -1339,17 +1075,22 @@ msgstr "" "でも利用でき、場所に対するインデックスの代わりに名前を使ってフィールドにアク" "セスできるようになります。" -#: ../../library/collections.rst:849 +#: ../../library/collections.rst:818 msgid "" "Returns a new tuple subclass named *typename*. The new subclass is used to " "create tuple-like objects that have fields accessible by attribute lookup as " "well as being indexable and iterable. Instances of the subclass also have a " -"helpful docstring (with *typename* and *field_names*) and a helpful :meth:" -"`~object.__repr__` method which lists the tuple contents in a ``name=value`` " -"format." -msgstr "" +"helpful docstring (with typename and field_names) and a helpful :meth:" +"`__repr__` method which lists the tuple contents in a ``name=value`` format." +msgstr "" +"*typename* という名前の tuple の新しいサブクラスを返します。新しいサブクラス" +"は、 tuple に似ているけれどもインデックスやイテレータだけでなく属性名によるア" +"クセスもできるオブジェクトを作るのに使います。このサブクラスのインスタンス" +"は、わかりやすい docstring (型名と属性名が入っています) や、 tuple の内容を " +"``name=value`` という形のリストで返す使いやすい :meth:`__repr__` も持っていま" +"す。" -#: ../../library/collections.rst:856 +#: ../../library/collections.rst:824 msgid "" "The *field_names* are a sequence of strings such as ``['x', 'y']``. " "Alternatively, *field_names* can be a single string with each fieldname " @@ -1360,7 +1101,7 @@ msgstr "" "マ (,) で区切った文字列を渡すこともできます。例えば、 ``'x y'`` や ``'x, " "y'`` です。" -#: ../../library/collections.rst:860 +#: ../../library/collections.rst:828 msgid "" "Any valid Python identifier may be used for a fieldname except for names " "starting with an underscore. Valid identifiers consist of letters, digits, " @@ -1373,7 +1114,7 @@ msgstr "" "で始まる名前や、 *class*, *for*, *return*, *global*, *pass*, *raise* などと" "いった :mod:`keyword` は使えません。" -#: ../../library/collections.rst:866 +#: ../../library/collections.rst:834 msgid "" "If *rename* is true, invalid fieldnames are automatically replaced with " "positional names. For example, ``['abc', 'def', 'ghi', 'abc']`` is " @@ -1385,7 +1126,7 @@ msgstr "" "しているフィールド名の ``abc`` が除去され、``['abc', '_1', 'ghi', '_3']`` に" "変換されます。" -#: ../../library/collections.rst:871 +#: ../../library/collections.rst:839 msgid "" "*defaults* can be ``None`` or an :term:`iterable` of default values. Since " "fields with a default value must come after any fields without a default, " @@ -1402,13 +1143,15 @@ msgstr "" "合、 ``x`` は必須の引数、 ``y`` は ``1`` がデフォルト、 ``z`` は ``2`` がデ" "フォルトとなります。" -#: ../../library/collections.rst:878 +#: ../../library/collections.rst:846 msgid "" -"If *module* is defined, the :attr:`~type.__module__` attribute of the named " -"tuple is set to that value." +"If *module* is defined, the ``__module__`` attribute of the named tuple is " +"set to that value." msgstr "" +"もし *module* が指定されていれば、名前付きタプルの ``__module__`` 属性は、指" +"定された値に設定されます" -#: ../../library/collections.rst:881 +#: ../../library/collections.rst:849 msgid "" "Named tuple instances do not have per-instance dictionaries, so they are " "lightweight and require no more memory than regular tuples." @@ -1416,7 +1159,7 @@ msgstr "" "名前付きタプルのインスタンスはインスタンスごとの辞書を持たないので、軽量で、" "普通のタプル以上のメモリを使用しません。" -#: ../../library/collections.rst:884 +#: ../../library/collections.rst:852 msgid "" "To support pickling, the named tuple class should be assigned to a variable " "that matches *typename*." @@ -1424,11 +1167,11 @@ msgstr "" "pickle 化をサポートするには、名前付きタプルのクラス定義は *typename* と同じ名" "前の変数に割り当てなければなりません。" -#: ../../library/collections.rst:887 +#: ../../library/collections.rst:855 msgid "Added support for *rename*." msgstr "*rename* のサポートが追加されました。" -#: ../../library/collections.rst:890 +#: ../../library/collections.rst:858 msgid "" "The *verbose* and *rename* parameters became :ref:`keyword-only arguments " "`." @@ -1436,38 +1179,20 @@ msgstr "" "*verbose* と *rename* 引数が :ref:`キーワード専用引数 ` になりました." -#: ../../library/collections.rst:894 +#: ../../library/collections.rst:862 msgid "Added the *module* parameter." msgstr "*module* 引数が追加されました。" -#: ../../library/collections.rst:897 -msgid "Removed the *verbose* parameter and the :attr:`!_source` attribute." -msgstr "" +#: ../../library/collections.rst:865 +msgid "Removed the *verbose* parameter and the :attr:`_source` attribute." +msgstr "*verbose* 引数と :attr:`_source` 属性が削除されました。" -#: ../../library/collections.rst:900 +#: ../../library/collections.rst:868 msgid "" -"Added the *defaults* parameter and the :attr:`~somenamedtuple." -"_field_defaults` attribute." -msgstr "" +"Added the *defaults* parameter and the :attr:`_field_defaults` attribute." +msgstr "*defaults* 引数と :attr:`_field_defaults` 属性が追加されました。" -#: ../../library/collections.rst:904 -msgid "" -">>> # Basic example\n" -">>> Point = namedtuple('Point', ['x', 'y'])\n" -">>> p = Point(11, y=22) # instantiate with positional or keyword " -"arguments\n" -">>> p[0] + p[1] # indexable like the plain tuple (11, 22)\n" -"33\n" -">>> x, y = p # unpack like a regular tuple\n" -">>> x, y\n" -"(11, 22)\n" -">>> p.x + p.y # fields also accessible by name\n" -"33\n" -">>> p # readable __repr__ with a name=value style\n" -"Point(x=11, y=22)" -msgstr "" - -#: ../../library/collections.rst:920 +#: ../../library/collections.rst:888 msgid "" "Named tuples are especially useful for assigning field names to result " "tuples returned by the :mod:`csv` or :mod:`sqlite3` modules::" @@ -1475,26 +1200,7 @@ msgstr "" "名前付きタプルは :mod:`csv` や :mod:`sqlite3` モジュールが返すタプルのフィー" "ルドに名前を付けるときにとても便利です::" -#: ../../library/collections.rst:923 -msgid "" -"EmployeeRecord = namedtuple('EmployeeRecord', 'name, age, title, department, " -"paygrade')\n" -"\n" -"import csv\n" -"for emp in map(EmployeeRecord._make, csv.reader(open(\"employees.csv\", " -"\"rb\"))):\n" -" print(emp.name, emp.title)\n" -"\n" -"import sqlite3\n" -"conn = sqlite3.connect('/companydata')\n" -"cursor = conn.cursor()\n" -"cursor.execute('SELECT name, age, title, department, paygrade FROM " -"employees')\n" -"for emp in map(EmployeeRecord._make, cursor.fetchall()):\n" -" print(emp.name, emp.title)" -msgstr "" - -#: ../../library/collections.rst:936 +#: ../../library/collections.rst:904 msgid "" "In addition to the methods inherited from tuples, named tuples support three " "additional methods and two attributes. To prevent conflicts with field " @@ -1504,39 +1210,25 @@ msgstr "" "属性をサポートしています。フィールド名との衝突を避けるために、メソッド名と属" "性名はアンダースコアで始まります。" -#: ../../library/collections.rst:942 +#: ../../library/collections.rst:910 msgid "" "Class method that makes a new instance from an existing sequence or iterable." msgstr "" "既存の sequence や Iterable から新しいインスタンスを作るクラスメソッド." -#: ../../library/collections.rst:944 -msgid "" -">>> t = [11, 22]\n" -">>> Point._make(t)\n" -"Point(x=11, y=22)" -msgstr "" - -#: ../../library/collections.rst:952 +#: ../../library/collections.rst:920 msgid "" "Return a new :class:`dict` which maps field names to their corresponding " "values:" msgstr "" "フィールド名を対応する値にマッピングする新しい :class:`dict` を返します::" -#: ../../library/collections.rst:955 -msgid "" -">>> p = Point(x=11, y=22)\n" -">>> p._asdict()\n" -"{'x': 11, 'y': 22}" -msgstr "" - -#: ../../library/collections.rst:961 +#: ../../library/collections.rst:929 msgid "Returns an :class:`OrderedDict` instead of a regular :class:`dict`." msgstr "" "通常の :class:`dict` の代わりに :class:`OrderedDict` を返すようになりました。" -#: ../../library/collections.rst:964 +#: ../../library/collections.rst:932 msgid "" "Returns a regular :class:`dict` instead of an :class:`OrderedDict`. As of " "Python 3.7, regular dicts are guaranteed to be ordered. If the extra " @@ -1548,7 +1240,7 @@ msgstr "" "`OrderedDict` 特有の機能を使いたい場合は、結果を ``OrderedDict(nt." "_asdict())`` 型にキャストして使用することを推奨します。" -#: ../../library/collections.rst:973 +#: ../../library/collections.rst:941 msgid "" "Return a new instance of the named tuple replacing specified fields with new " "values::" @@ -1556,32 +1248,7 @@ msgstr "" "指定されたフィールドを新しい値で置き換えた、新しい名前付きタプルを作って返し" "ます::" -#: ../../library/collections.rst:976 -msgid "" -">>> p = Point(x=11, y=22)\n" -">>> p._replace(x=33)\n" -"Point(x=33, y=22)\n" -"\n" -">>> for partnum, record in inventory.items():\n" -"... inventory[partnum] = record._replace(price=newprices[partnum], " -"timestamp=time.now())" -msgstr "" - -#: ../../library/collections.rst:983 -msgid "" -"Named tuples are also supported by generic function :func:`copy.replace`." -msgstr "" -"名前付きタプルは汎用的な関数 :func:`copy.replace` にもサポートされています。" - -#: ../../library/collections.rst:985 -msgid "" -"Raise :exc:`TypeError` instead of :exc:`ValueError` for invalid keyword " -"arguments." -msgstr "" -"キーワード引数が無効な場合は :exc:`ValueError` のかわりに :exc:`TypeError` が" -"発生します。" - -#: ../../library/collections.rst:991 +#: ../../library/collections.rst:953 msgid "" "Tuple of strings listing the field names. Useful for introspection and for " "creating new named tuple types from existing named tuples." @@ -1589,31 +1256,11 @@ msgstr "" "フィールド名をリストにしたタプルです。内省 (introspection) したり、既存の名前" "付きタプルをもとに新しい名前つきタプルを作成する時に便利です。" -#: ../../library/collections.rst:994 -msgid "" -">>> p._fields # view the field names\n" -"('x', 'y')\n" -"\n" -">>> Color = namedtuple('Color', 'red green blue')\n" -">>> Pixel = namedtuple('Pixel', Point._fields + Color._fields)\n" -">>> Pixel(11, 22, 128, 255, 0)\n" -"Pixel(x=11, y=22, red=128, green=255, blue=0)" -msgstr "" - -#: ../../library/collections.rst:1006 +#: ../../library/collections.rst:968 msgid "Dictionary mapping field names to default values." msgstr "フィールド名からデフォルト値への対応を持つ辞書です。" -#: ../../library/collections.rst:1008 -msgid "" -">>> Account = namedtuple('Account', ['type', 'balance'], defaults=[0])\n" -">>> Account._field_defaults\n" -"{'balance': 0}\n" -">>> Account('premium')\n" -"Account(type='premium', balance=0)" -msgstr "" - -#: ../../library/collections.rst:1016 +#: ../../library/collections.rst:978 msgid "" "To retrieve a field whose name is stored in a string, use the :func:" "`getattr` function:" @@ -1621,7 +1268,7 @@ msgstr "" "文字列に格納された名前を使って名前つきタプルから値を取得するには :func:" "`getattr` 関数を使います:" -#: ../../library/collections.rst:1022 +#: ../../library/collections.rst:984 msgid "" "To convert a dictionary to a named tuple, use the double-star-operator (as " "described in :ref:`tut-unpacking-arguments`):" @@ -1629,7 +1276,7 @@ msgstr "" "辞書を名前付きタプルに変換するには、 ``**`` 演算子 (double-star-operator, :" "ref:`tut-unpacking-arguments` で説明しています) を使います。:" -#: ../../library/collections.rst:1029 +#: ../../library/collections.rst:991 msgid "" "Since a named tuple is a regular Python class, it is easy to add or change " "functionality with a subclass. Here is how to add a calculated field and a " @@ -1639,24 +1286,7 @@ msgstr "" "のは容易です。次の例では計算済みフィールドと固定幅の print format を追加して" "います:" -#: ../../library/collections.rst:1033 -msgid "" -">>> class Point(namedtuple('Point', ['x', 'y'])):\n" -"... __slots__ = ()\n" -"... @property\n" -"... def hypot(self):\n" -"... return (self.x ** 2 + self.y ** 2) ** 0.5\n" -"... def __str__(self):\n" -"... return 'Point: x=%6.3f y=%6.3f hypot=%6.3f' % (self.x, self.y, " -"self.hypot)\n" -"\n" -">>> for p in Point(3, 4), Point(14, 5/7):\n" -"... print(p)\n" -"Point: x= 3.000 y= 4.000 hypot= 5.000\n" -"Point: x=14.000 y= 0.714 hypot=14.018" -msgstr "" - -#: ../../library/collections.rst:1048 +#: ../../library/collections.rst:1010 msgid "" "The subclass shown above sets ``__slots__`` to an empty tuple. This helps " "keep memory requirements low by preventing the creation of instance " @@ -1665,7 +1295,7 @@ msgstr "" "このサブクラスは ``__slots__`` に空のタプルをセットしています。これにより、イ" "ンスタンス辞書の作成を抑制してメモリ使用量を低く保つのに役立ちます。" -#: ../../library/collections.rst:1051 +#: ../../library/collections.rst:1013 msgid "" "Subclassing is not useful for adding new, stored fields. Instead, simply " "create a new named tuple type from the :attr:`~somenamedtuple._fields` " @@ -1675,7 +1305,7 @@ msgstr "" "い名前付きタプルを :attr:`~somenamedtuple._fields` 属性を元に作成してくださ" "い:" -#: ../../library/collections.rst:1056 +#: ../../library/collections.rst:1018 msgid "" "Docstrings can be customized by making direct assignments to the ``__doc__`` " "fields:" @@ -1683,11 +1313,11 @@ msgstr "" "``__doc__`` フィールドに直接代入することでドックストリングをカスタマイズする" "ことが出来ます:" -#: ../../library/collections.rst:1065 +#: ../../library/collections.rst:1027 msgid "Property docstrings became writeable." msgstr "属性ドックストリングが書き込み可能になりました。" -#: ../../library/collections.rst:1070 +#: ../../library/collections.rst:1032 msgid "" "See :class:`typing.NamedTuple` for a way to add type hints for named " "tuples. It also provides an elegant notation using the :keyword:`class` " @@ -1697,15 +1327,7 @@ msgstr "" "NamedTuple` を参照してください。\n" ":keyword:`class` キーワードを使った洗練された記法も紹介されています::" -#: ../../library/collections.rst:1074 -msgid "" -"class Component(NamedTuple):\n" -" part_number: int\n" -" weight: float\n" -" description: Optional[str] = None" -msgstr "" - -#: ../../library/collections.rst:1079 +#: ../../library/collections.rst:1041 msgid "" "See :meth:`types.SimpleNamespace` for a mutable namespace based on an " "underlying dictionary instead of a tuple." @@ -1713,7 +1335,7 @@ msgstr "" "タプルではなく、辞書をもとにした変更可能な名前空間を作成するには :meth:" "`types.SimpleNamespace` を参照してください。" -#: ../../library/collections.rst:1082 +#: ../../library/collections.rst:1044 msgid "" "The :mod:`dataclasses` module provides a decorator and functions for " "automatically adding generated special methods to user-defined classes." @@ -1721,11 +1343,11 @@ msgstr "" ":mod:`dataclasses` モジュールは、生成される特殊メソッドをユーザー定義クラスに" "自動的に追加するためのデコレータや関数を提供しています。" -#: ../../library/collections.rst:1087 +#: ../../library/collections.rst:1049 msgid ":class:`OrderedDict` objects" msgstr ":class:`OrderedDict` オブジェクト" -#: ../../library/collections.rst:1089 +#: ../../library/collections.rst:1051 msgid "" "Ordered dictionaries are just like regular dictionaries but have some extra " "capabilities relating to ordering operations. They have become less " @@ -1738,11 +1360,11 @@ msgstr "" "いは Python 3.7 で保証されるようになりました) を獲得した今となっては、順序付" "き辞書の重要性は薄れました。" -#: ../../library/collections.rst:1095 +#: ../../library/collections.rst:1057 msgid "Some differences from :class:`dict` still remain:" msgstr "いまだ残っている :class:`dict` との差分:" -#: ../../library/collections.rst:1097 +#: ../../library/collections.rst:1059 msgid "" "The regular :class:`dict` was designed to be very good at mapping " "operations. Tracking insertion order was secondary." @@ -1750,7 +1372,7 @@ msgstr "" "通常の :class:`dict` は対応付けに向いているように設計されました。\n" "挿入順序の追跡は二の次です。" -#: ../../library/collections.rst:1100 +#: ../../library/collections.rst:1062 msgid "" "The :class:`OrderedDict` was designed to be good at reordering operations. " "Space efficiency, iteration speed, and the performance of update operations " @@ -1759,88 +1381,48 @@ msgstr "" ":class:`OrderedDict` は並べ替え操作に向いているように設計されました。\n" "空間効率、反復処理の速度、更新操作のパフォーマンスは二の次です。" -#: ../../library/collections.rst:1104 +#: ../../library/collections.rst:1066 msgid "" -"The :class:`OrderedDict` algorithm can handle frequent reordering operations " -"better than :class:`dict`. As shown in the recipes below, this makes it " -"suitable for implementing various kinds of LRU caches." +"Algorithmically, :class:`OrderedDict` can handle frequent reordering " +"operations better than :class:`dict`. This makes it suitable for tracking " +"recent accesses (for example in an `LRU cache `_)." msgstr "" -":class:`OrderedDict` のアルゴリズムは、頻繁な並べ替え処理を :class:`dict` よ" -"りもうまく扱うことができます。後述のレシピに示されている通り、この性質はさま" -"ざまな種類の LRU キャッシュの実装に適しています。" +"アルゴリズム的に、 :class:`OrderedDict` は高頻度の並べ替え操作を :class:" +"`dict` よりも上手く扱えます。\n" +"この性質により、 :class:`OrderedDict` は直近のアクセスの追跡 (例えば、 `LRU " +"キャッシュ `_) に向いています。" -#: ../../library/collections.rst:1108 +#: ../../library/collections.rst:1071 msgid "" "The equality operation for :class:`OrderedDict` checks for matching order." msgstr "" ":class:`OrderedDict` に対する等価演算は突き合わせ順序もチェックします。" -#: ../../library/collections.rst:1110 +#: ../../library/collections.rst:1073 msgid "" -"A regular :class:`dict` can emulate the order sensitive equality test with " -"``p == q and all(k1 == k2 for k1, k2 in zip(p, q))``." +"The :meth:`popitem` method of :class:`OrderedDict` has a different " +"signature. It accepts an optional argument to specify which item is popped." msgstr "" -"組み込みの :class:`dict` では、順序を考慮した等価演算は ``p == q and all(k1 " -"== k2 for k1, k2 in zip(p, q))`` で実現することができます。" +":class:`OrderedDict` の :meth:`popitem` メソッドはシグネチャが異なります。\n" +"どの要素を取り出すかを指定するオプション引数を受け付けます。" -#: ../../library/collections.rst:1113 +#: ../../library/collections.rst:1076 msgid "" -"The :meth:`~OrderedDict.popitem` method of :class:`OrderedDict` has a " -"different signature. It accepts an optional argument to specify which item " -"is popped." +":class:`OrderedDict` has a :meth:`move_to_end` method to efficiently " +"reposition an element to an endpoint." msgstr "" +":class:`OrderedDict` には、 効率的に要素を末尾に置き直す :meth:`move_to_end` " +"メソッドがあります。" -#: ../../library/collections.rst:1116 -msgid "" -"A regular :class:`dict` can emulate OrderedDict's ``od.popitem(last=True)`` " -"with ``d.popitem()`` which is guaranteed to pop the rightmost (last) item." -msgstr "" -"組み込みの :class:`dict` の場合、 OrderedDict の ``od.popitem(last=True)`` と" -"同じ機能は、最も右側の (最後の) 要素を取り出すことが保証されている ``d." -"popitem()`` が果たします。" - -#: ../../library/collections.rst:1119 -msgid "" -"A regular :class:`dict` can emulate OrderedDict's ``od.popitem(last=False)`` " -"with ``(k := next(iter(d)), d.pop(k))`` which will return and remove the " -"leftmost (first) item if it exists." -msgstr "" -"組み込みの :class:`dict` の場合、 OrderedDict の ``od.popitem(last=False)`` " -"は ``(k := next(iter(d)), d.pop(k))`` で実現できます。これにより、該当する要" -"素のうちで最も左側の (先頭の) ものを辞書から削除して返すことができます。" - -#: ../../library/collections.rst:1123 -msgid "" -":class:`OrderedDict` has a :meth:`~OrderedDict.move_to_end` method to " -"efficiently reposition an element to an endpoint." -msgstr "" - -#: ../../library/collections.rst:1126 -msgid "" -"A regular :class:`dict` can emulate OrderedDict's ``od.move_to_end(k, " -"last=True)`` with ``d[k] = d.pop(k)`` which will move the key and its " -"associated value to the rightmost (last) position." -msgstr "" -"組み込みの :class:`dict` の場合、キーと値のペアを最も右側 (末尾) に移動する " -"OrderedDict の ``od.move_to_end(k, last=True)`` は ``d[k] = d.pop(k)`` で実現" -"できます。" - -#: ../../library/collections.rst:1130 -msgid "" -"A regular :class:`dict` does not have an efficient equivalent for " -"OrderedDict's ``od.move_to_end(k, last=False)`` which moves the key and its " -"associated value to the leftmost (first) position." -msgstr "" -"組み込みの :class:`dict` では、キーと値のペアを最も左側 (先頭) に移動する " -"OrderedDict の ``od.move_to_end(k, last=False)`` を実現する効率の良い方法はあ" -"りません。 " - -#: ../../library/collections.rst:1134 -msgid "" -"Until Python 3.8, :class:`dict` lacked a :meth:`~object.__reversed__` method." +#: ../../library/collections.rst:1079 +msgid "Until Python 3.8, :class:`dict` lacked a :meth:`__reversed__` method." msgstr "" +"Python 3.8 以前は、 :class:`dict` には :meth:`__reversed__` メソッドが欠けて" +"います。" -#: ../../library/collections.rst:1139 +#: ../../library/collections.rst:1084 msgid "" "Return an instance of a :class:`dict` subclass that has methods specialized " "for rearranging dictionary order." @@ -1848,7 +1430,7 @@ msgstr "" "辞書の順序を並べ直すためのメソッドを持つ :class:`dict` のサブクラスのインスタ" "ンスを返します。" -#: ../../library/collections.rst:1146 +#: ../../library/collections.rst:1091 msgid "" "The :meth:`popitem` method for ordered dictionaries returns and removes a " "(key, value) pair. The pairs are returned in :abbr:`LIFO (last-in, first-" @@ -1859,29 +1441,17 @@ msgstr "" "す。この対は *last* が真なら :abbr:`LIFO (last-in, first-out, 後入先出)` で、" "偽なら :abbr:`FIFO (first-in, first-out, 先入先出)` で返されます。" -#: ../../library/collections.rst:1153 +#: ../../library/collections.rst:1098 msgid "" "Move an existing *key* to either end of an ordered dictionary. The item is " "moved to the right end if *last* is true (the default) or to the beginning " -"if *last* is false. Raises :exc:`KeyError` if the *key* does not exist:" +"if *last* is false. Raises :exc:`KeyError` if the *key* does not exist::" msgstr "" -"存在する *key* を順序付き辞書の先頭または末尾に移動します。要素は *last* が" -"真 (デフォルト) の場合に最も右側すなわち末尾に移動します。また *last* が偽の" -"場合には先頭に移動します。指定した *key* が存在しない場合は :exc:`KeyError` " -"を送出します。" +"既存の *key* を順序付き辞書の両端に移動します。項目は、 *last* が真 (デフォル" +"ト) なら右端に、 *last* が偽なら最初に移動されます。 *key* が存在しなければ :" +"exc:`KeyError` を送出します::" -#: ../../library/collections.rst:1158 -msgid "" -">>> d = OrderedDict.fromkeys('abcde')\n" -">>> d.move_to_end('b')\n" -">>> ''.join(d)\n" -"'acdeb'\n" -">>> d.move_to_end('b', last=False)\n" -">>> ''.join(d)\n" -"'bacde'" -msgstr "" - -#: ../../library/collections.rst:1170 +#: ../../library/collections.rst:1113 msgid "" "In addition to the usual mapping methods, ordered dictionaries also support " "reverse iteration using :func:`reversed`." @@ -1889,21 +1459,23 @@ msgstr "" "通常のマッピングのメソッドに加え、順序付き辞書は :func:`reversed` による逆順" "の反復もサポートしています。" -#: ../../library/collections.rst:1175 +#: ../../library/collections.rst:1116 msgid "" "Equality tests between :class:`OrderedDict` objects are order-sensitive and " -"are roughly equivalent to ``list(od1.items())==list(od2.items())``." -msgstr "" - -#: ../../library/collections.rst:1178 -msgid "" -"Equality tests between :class:`OrderedDict` objects and other :class:" -"`~collections.abc.Mapping` objects are order-insensitive like regular " -"dictionaries. This allows :class:`OrderedDict` objects to be substituted " -"anywhere a regular dictionary is used." -msgstr "" +"are implemented as ``list(od1.items())==list(od2.items())``. Equality tests " +"between :class:`OrderedDict` objects and other :class:`~collections.abc." +"Mapping` objects are order-insensitive like regular dictionaries. This " +"allows :class:`OrderedDict` objects to be substituted anywhere a regular " +"dictionary is used." +msgstr "" +":class:`OrderedDict` 間の等価判定は順序が影響し、 ``list(od1." +"items())==list(od2.items())`` のように実装されます。 :class:`OrderedDict` オ" +"ブジェクトと他のマッピング (:class:`~collections.abc.Mapping`) オブジェクトの" +"等価判定は、順序に影響されず、通常の辞書と同様です。これによって、 :class:" +"`OrderedDict` オブジェクトは通常の辞書が使われるところならどこでも使用できま" +"す。" -#: ../../library/collections.rst:1183 +#: ../../library/collections.rst:1123 msgid "" "The items, keys, and values :term:`views ` of :class:" "`OrderedDict` now support reverse iteration using :func:`reversed`." @@ -1911,18 +1483,19 @@ msgstr "" ":class:`OrderedDict` の項目、キー、値の :term:`ビュー ` が :" "func:`reversed` による逆順の反復をサポートするようになりました。" -#: ../../library/collections.rst:1187 +#: ../../library/collections.rst:1127 msgid "" "With the acceptance of :pep:`468`, order is retained for keyword arguments " -"passed to the :class:`OrderedDict` constructor and its :meth:`~dict.update` " -"method." +"passed to the :class:`OrderedDict` constructor and its :meth:`update` method." msgstr "" +":pep:`468` の受理によって、:class:`OrderedDict` のコンストラクタと、:meth:" +"`update` メソッドに渡したキーワード引数の順序は保持されます。" -#: ../../library/collections.rst:1197 +#: ../../library/collections.rst:1137 msgid ":class:`OrderedDict` Examples and Recipes" msgstr ":class:`OrderedDict` の例とレシピ" -#: ../../library/collections.rst:1199 +#: ../../library/collections.rst:1139 msgid "" "It is straightforward to create an ordered dictionary variant that remembers " "the order the keys were *last* inserted. If a new entry overwrites an " @@ -1933,17 +1506,7 @@ msgstr "" "簡単です。\n" "新しい値が既存の値を上書きする場合、元々の挿入位置が最後尾へ変更されます::" -#: ../../library/collections.rst:1204 -msgid "" -"class LastUpdatedOrderedDict(OrderedDict):\n" -" 'Store items in the order the keys were last added'\n" -"\n" -" def __setitem__(self, key, value):\n" -" super().__setitem__(key, value)\n" -" self.move_to_end(key)" -msgstr "" - -#: ../../library/collections.rst:1211 +#: ../../library/collections.rst:1151 msgid "" "An :class:`OrderedDict` would also be useful for implementing variants of :" "func:`functools.lru_cache`:" @@ -1951,76 +1514,11 @@ msgstr "" ":class:`OrderedDict` は :func:`functools.lru_cache` の変種を実装するのにも役" "に立ちます:" -#: ../../library/collections.rst:1214 -msgid "" -"from collections import OrderedDict\n" -"from time import time\n" -"\n" -"class TimeBoundedLRU:\n" -" \"LRU Cache that invalidates and refreshes old entries.\"\n" -"\n" -" def __init__(self, func, maxsize=128, maxage=30):\n" -" self.cache = OrderedDict() # { args : (timestamp, result)}\n" -" self.func = func\n" -" self.maxsize = maxsize\n" -" self.maxage = maxage\n" -"\n" -" def __call__(self, *args):\n" -" if args in self.cache:\n" -" self.cache.move_to_end(args)\n" -" timestamp, result = self.cache[args]\n" -" if time() - timestamp <= self.maxage:\n" -" return result\n" -" result = self.func(*args)\n" -" self.cache[args] = time(), result\n" -" if len(self.cache) > self.maxsize:\n" -" self.cache.popitem(last=False)\n" -" return result" -msgstr "" - -#: ../../library/collections.rst:1241 -msgid "" -"class MultiHitLRUCache:\n" -" \"\"\" LRU cache that defers caching a result until\n" -" it has been requested multiple times.\n" -"\n" -" To avoid flushing the LRU cache with one-time requests,\n" -" we don't cache until a request has been made more than once.\n" -"\n" -" \"\"\"\n" -"\n" -" def __init__(self, func, maxsize=128, maxrequests=4096, cache_after=1):\n" -" self.requests = OrderedDict() # { uncached_key : request_count }\n" -" self.cache = OrderedDict() # { cached_key : function_result }\n" -" self.func = func\n" -" self.maxrequests = maxrequests # max number of uncached requests\n" -" self.maxsize = maxsize # max number of stored return " -"values\n" -" self.cache_after = cache_after\n" -"\n" -" def __call__(self, *args):\n" -" if args in self.cache:\n" -" self.cache.move_to_end(args)\n" -" return self.cache[args]\n" -" result = self.func(*args)\n" -" self.requests[args] = self.requests.get(args, 0) + 1\n" -" if self.requests[args] <= self.cache_after:\n" -" self.requests.move_to_end(args)\n" -" if len(self.requests) > self.maxrequests:\n" -" self.requests.popitem(last=False)\n" -" else:\n" -" self.requests.pop(args, None)\n" -" self.cache[args] = result\n" -" if len(self.cache) > self.maxsize:\n" -" self.cache.popitem(last=False)\n" -" return result" -msgstr "" - -#: ../../library/collections.rst:1310 +#: ../../library/collections.rst:1192 msgid ":class:`UserDict` objects" msgstr ":class:`UserDict` オブジェクト" -#: ../../library/collections.rst:1312 +#: ../../library/collections.rst:1194 msgid "" "The class, :class:`UserDict` acts as a wrapper around dictionary objects. " "The need for this class has been partially supplanted by the ability to " @@ -2032,7 +1530,7 @@ msgstr "" "取って代わられました; しかし、根底の辞書に属性としてアクセスできるので、この" "クラスを使った方が簡単になることもあります。" -#: ../../library/collections.rst:1320 +#: ../../library/collections.rst:1202 msgid "" "Class that simulates a dictionary. The instance's contents are kept in a " "regular dictionary, which is accessible via the :attr:`data` attribute of :" @@ -2046,7 +1544,7 @@ msgstr "" "他の目的のために使えるように、 *initialdata* への参照が保存されないことに注意" "してください。" -#: ../../library/collections.rst:1326 +#: ../../library/collections.rst:1208 msgid "" "In addition to supporting the methods and operations of mappings, :class:" "`UserDict` instances provide the following attribute:" @@ -2054,16 +1552,16 @@ msgstr "" "マッピングのメソッドと演算をサポートするのに加え、 :class:`UserDict` インスタ" "ンスは以下の属性を提供します:" -#: ../../library/collections.rst:1331 +#: ../../library/collections.rst:1213 msgid "" "A real dictionary used to store the contents of the :class:`UserDict` class." msgstr ":class:`UserDict` クラスの内容を保存するために使われる実際の辞書です。" -#: ../../library/collections.rst:1337 +#: ../../library/collections.rst:1219 msgid ":class:`UserList` objects" msgstr ":class:`UserList` オブジェクト" -#: ../../library/collections.rst:1339 +#: ../../library/collections.rst:1221 msgid "" "This class acts as a wrapper around list objects. It is a useful base class " "for your own list-like classes which can inherit from them and override " @@ -2074,7 +1572,7 @@ msgstr "" "風クラスの基底クラスとして便利で、既存のメソッドをオーバーライドしたり新しい" "メソッドを加えたりできます。こうして、リストに新しい振る舞いを加えられます。" -#: ../../library/collections.rst:1344 +#: ../../library/collections.rst:1226 msgid "" "The need for this class has been partially supplanted by the ability to " "subclass directly from :class:`list`; however, this class can be easier to " @@ -2084,7 +1582,7 @@ msgstr "" "的に取って代わられました; しかし、根底のリストに属性としてアクセスできるの" "で、このクラスを使った方が簡単になることもあります。" -#: ../../library/collections.rst:1350 +#: ../../library/collections.rst:1232 msgid "" "Class that simulates a list. The instance's contents are kept in a regular " "list, which is accessible via the :attr:`data` attribute of :class:" @@ -2098,7 +1596,7 @@ msgstr "" "は空リスト ``[]`` です。 *list* は何らかのイテラブル、例えば通常の Python リ" "ストや :class:`UserList` オブジェクト、です。" -#: ../../library/collections.rst:1356 +#: ../../library/collections.rst:1238 msgid "" "In addition to supporting the methods and operations of mutable sequences, :" "class:`UserList` instances provide the following attribute:" @@ -2106,7 +1604,7 @@ msgstr "" "ミュータブルシーケンスのメソッドと演算をサポートするのに加え、 :class:" "`UserList` インスタンスは以下の属性を提供します:" -#: ../../library/collections.rst:1361 +#: ../../library/collections.rst:1243 msgid "" "A real :class:`list` object used to store the contents of the :class:" "`UserList` class." @@ -2114,7 +1612,7 @@ msgstr "" ":class:`UserList` クラスの内容を保存するために使われる実際の :class:`list` オ" "ブジェクトです。" -#: ../../library/collections.rst:1364 +#: ../../library/collections.rst:1246 msgid "" "**Subclassing requirements:** Subclasses of :class:`UserList` are expected " "to offer a constructor which can be called with either no arguments or one " @@ -2129,7 +1627,7 @@ msgstr "" "作成しようとします。そのために、データ元として使われるシーケンスオブジェクト" "である一つのパラメータとともにコンストラクタを呼び出せると想定しています。" -#: ../../library/collections.rst:1371 +#: ../../library/collections.rst:1253 msgid "" "If a derived class does not wish to comply with this requirement, all of the " "special methods supported by this class will need to be overridden; please " @@ -2140,11 +1638,11 @@ msgstr "" "の特殊メソッドはオーバーライドされる必要があります。その場合に提供される必要" "のあるメソッドについての情報は、ソースを参考にしてください。" -#: ../../library/collections.rst:1377 +#: ../../library/collections.rst:1259 msgid ":class:`UserString` objects" msgstr ":class:`UserString` オブジェクト" -#: ../../library/collections.rst:1379 +#: ../../library/collections.rst:1261 msgid "" "The class, :class:`UserString` acts as a wrapper around string objects. The " "need for this class has been partially supplanted by the ability to subclass " @@ -2156,7 +1654,7 @@ msgstr "" "的に取って代わられました; しかし、根底の文字列に属性としてアクセスできるの" "で、このクラスを使った方が簡単になることもあります。" -#: ../../library/collections.rst:1387 +#: ../../library/collections.rst:1269 msgid "" "Class that simulates a string object. The instance's content is kept in a " "regular string object, which is accessible via the :attr:`data` attribute " @@ -2171,7 +1669,7 @@ msgstr "" "*seq* 引数は、組み込みの :func:`str` 関数で文字列に変換できる任意のオブジェク" "トです。" -#: ../../library/collections.rst:1394 +#: ../../library/collections.rst:1276 msgid "" "In addition to supporting the methods and operations of strings, :class:" "`UserString` instances provide the following attribute:" @@ -2179,7 +1677,7 @@ msgstr "" "文字列のメソッドと演算をサポートするのに加え、 :class:`UserString` インスタン" "スは次の属性を提供します:" -#: ../../library/collections.rst:1399 +#: ../../library/collections.rst:1281 msgid "" "A real :class:`str` object used to store the contents of the :class:" "`UserString` class." @@ -2187,7 +1685,7 @@ msgstr "" ":class:`UserString` クラスの内容を保存するために使われる実際の :class:`str` " "オブジェクトです。" -#: ../../library/collections.rst:1402 +#: ../../library/collections.rst:1284 msgid "" "New methods ``__getnewargs__``, ``__rmod__``, ``casefold``, ``format_map``, " "``isprintable``, and ``maketrans``." diff --git a/library/colorsys.po b/library/colorsys.po index 502ea4ab1..56dd8cb92 100644 --- a/library/colorsys.po +++ b/library/colorsys.po @@ -1,32 +1,32 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 -# Tetsuo Koyama , 2021 -# 石井明久, 2024 +# 秘湯 , 2017 +# Arihiro TAKASE, 2017 +# Tetsuo Koyama , 2020 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-13 14:21+0000\n" -"PO-Revision-Date: 2021-06-28 00:57+0000\n" -"Last-Translator: 石井明久, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 23:03+0000\n" +"Last-Translator: Tetsuo Koyama , 2020\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/colorsys.rst:2 -msgid ":mod:`!colorsys` --- Conversions between color systems" -msgstr ":mod:`!colorsys` --- 色体系間の変換" +msgid ":mod:`colorsys` --- Conversions between color systems" +msgstr ":mod:`colorsys` --- 色体系間の変換" #: ../../library/colorsys.rst:9 msgid "**Source code:** :source:`Lib/colorsys.py`" @@ -38,10 +38,17 @@ msgid "" "between colors expressed in the RGB (Red Green Blue) color space used in " "computer monitors and three other coordinate systems: YIQ, HLS (Hue " "Lightness Saturation) and HSV (Hue Saturation Value). Coordinates in all of " -"these color spaces are floating-point values. In the YIQ space, the Y " +"these color spaces are floating point values. In the YIQ space, the Y " "coordinate is between 0 and 1, but the I and Q coordinates can be positive " "or negative. In all other spaces, the coordinates are all between 0 and 1." msgstr "" +":mod:`colorsys` モジュールは、計算機のディスプレイモニタで使われている RGB " +"(Red Green Blue) 色空間で表された色と、他の 3 種類の色座標系: YIQ, HLS (Hue " +"Lightness Saturation: 色相、彩度、飽和) および HSV (Hue Saturation Value: 色" +"相、彩度、明度) との間の双方向の色値変換を定義します。これらの色空間における" +"色座標系は全て浮動小数点数で表されます。 YIQ 空間では、Y 軸は 0 から 1 です" +"が、 I および Q 軸は正の値も負の値もとり得ます。他の色空間では、各軸は全て 0 " +"から 1 の値をとります。" #: ../../library/colorsys.rst:23 msgid "" @@ -83,12 +90,3 @@ msgstr "HSV から RGB に変換します。" #: ../../library/colorsys.rst:59 msgid "Example::" msgstr "以下はプログラム例です::" - -#: ../../library/colorsys.rst:61 -msgid "" -">>> import colorsys\n" -">>> colorsys.rgb_to_hsv(0.2, 0.4, 0.4)\n" -"(0.5, 0.5, 0.4)\n" -">>> colorsys.hsv_to_rgb(0.5, 0.5, 0.4)\n" -"(0.2, 0.4, 0.4)" -msgstr "" diff --git a/library/compileall.po b/library/compileall.po index f0d8bf338..0a563aca0 100644 --- a/library/compileall.po +++ b/library/compileall.po @@ -1,33 +1,37 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 -# Yusuke Miyazaki , 2021 -# Tetsuo Koyama , 2021 -# 石井明久, 2024 +# 秘湯 , 2017 +# Arihiro TAKASE, 2017 +# Inada Naoki , 2017 +# E. Kawashima, 2017 +# Osamu NAKAMURA, 2019 +# tomo, 2019 +# Tetsuo Koyama , 2020 +# Yusuke Miyazaki , 2020 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-06 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:57+0000\n" -"Last-Translator: 石井明久, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-05-05 06:14+0000\n" +"PO-Revision-Date: 2017-02-16 23:03+0000\n" +"Last-Translator: Yusuke Miyazaki , 2020\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/compileall.rst:2 -msgid ":mod:`!compileall` --- Byte-compile Python libraries" -msgstr ":mod:`!compileall` --- Python ライブラリをバイトコンパイルする" +msgid ":mod:`compileall` --- Byte-compile Python libraries" +msgstr ":mod:`compileall` --- Python ライブラリをバイトコンパイル" #: ../../library/compileall.rst:7 msgid "**Source code:** :source:`Lib/compileall.py`" @@ -47,23 +51,11 @@ msgstr "" "をライブラリのインストール時に生成することで、ライブラリディレクトリに書き込" "み権限をもたないユーザでも、これらを利用できるようになります。" -#: ../../includes/wasm-notavail.rst:3 -msgid "Availability" -msgstr "" - -#: ../../includes/wasm-notavail.rst:5 -msgid "" -"This module does not work or is not available on WebAssembly. See :ref:`wasm-" -"availability` for more information." -msgstr "" -"このモジュールは WebAssembly では動作しないか、利用不可です。詳しくは、:ref:" -"`wasm-availability` を見てください。" - -#: ../../library/compileall.rst:22 +#: ../../library/compileall.rst:19 msgid "Command-line use" msgstr "コマンドラインでの使用" -#: ../../library/compileall.rst:24 +#: ../../library/compileall.rst:21 msgid "" "This module can work as a script (using :program:`python -m compileall`) to " "compile Python sources." @@ -71,17 +63,17 @@ msgstr "" "このモジュールは、 (:program:`python -m compileall` を使って) Python ソースを" "コンパイルするスクリプトとして機能します。" -#: ../../library/compileall.rst:32 +#: ../../library/compileall.rst:29 msgid "" "Positional arguments are files to compile or directories that contain source " "files, traversed recursively. If no argument is given, behave as if the " -"command line was :samp:`-l {}`." +"command line was ``-l ``." msgstr "" "位置引数は、コンパイルするファイル群か、再帰的に横断されるディレクトリでソー" -"スファイル群を含むものです。引数が与えられなければ、 :samp:`-l {}` を渡したのと同じように動作します。" +"スファイル群を含むものです。引数が与えられなければ、``-l `` を渡したのと同じように動作します。" -#: ../../library/compileall.rst:38 +#: ../../library/compileall.rst:35 msgid "" "Do not recurse into subdirectories, only compile source code files directly " "contained in the named or implied directories." @@ -89,11 +81,11 @@ msgstr "" "サブディレクトリを再帰処理せず、指名または暗示されたディレクトリ群に含まれる" "ソースコードファイル群だけをコンパイルします。" -#: ../../library/compileall.rst:43 +#: ../../library/compileall.rst:40 msgid "Force rebuild even if timestamps are up-to-date." msgstr "タイムスタンプが最新であってもリビルドを強制します。" -#: ../../library/compileall.rst:47 +#: ../../library/compileall.rst:44 msgid "" "Do not print the list of files compiled. If passed once, error messages will " "still be printed. If passed twice (``-qq``), all output is suppressed." @@ -102,7 +94,7 @@ msgstr "" "一つ渡された場合でもエラーメッセージは出力されます。\n" "二つ (``-qq``) の場合全ての出力は抑制されます。" -#: ../../library/compileall.rst:52 +#: ../../library/compileall.rst:49 msgid "" "Directory prepended to the path to each file being compiled. This will " "appear in compilation time tracebacks, and is also compiled in to the byte-" @@ -115,27 +107,13 @@ msgstr "" "る時点でソースファイルが存在しない場合に、トレースバックやその他のメッセージ" "に使われるバイトコードファイルにもコンパイルされます。" -#: ../../library/compileall.rst:60 +#: ../../library/compileall.rst:58 msgid "" -"Remove the given prefix from paths recorded in the ``.pyc`` files. Paths are " -"made relative to the prefix." +"Remove (``-s``) or append (``-p``) the given prefix of paths recorded in the " +"``.pyc`` files. Cannot be combined with ``-d``." msgstr "" -#: ../../library/compileall.rst:63 -msgid "This option can be used with ``-p`` but not with ``-d``." -msgstr "" - -#: ../../library/compileall.rst:67 -msgid "" -"Prepend the given prefix to paths recorded in the ``.pyc`` files. Use ``-p /" -"`` to make the paths absolute." -msgstr "" - -#: ../../library/compileall.rst:70 -msgid "This option can be used with ``-s`` but not with ``-d``." -msgstr "" - -#: ../../library/compileall.rst:74 +#: ../../library/compileall.rst:64 msgid "" "regex is used to search the full path to each file considered for " "compilation, and if the regex produces a match, the file is skipped." @@ -143,7 +121,7 @@ msgstr "" "regex を使って、コンパイル候補のそれぞれのファイルのフルパスを検索し、regex " "がマッチしたファイルを除外します。" -#: ../../library/compileall.rst:79 +#: ../../library/compileall.rst:69 msgid "" "Read the file ``list`` and add each line that it contains to the list of " "files and directories to compile. If ``list`` is ``-``, read lines from " @@ -153,7 +131,7 @@ msgstr "" "ファイルとディレクトリのリストに加えます。``list`` が ``-`` なら、``stdin`` " "の行を読み込みます。" -#: ../../library/compileall.rst:85 +#: ../../library/compileall.rst:75 msgid "" "Write the byte-code files to their legacy locations and names, which may " "overwrite byte-code files created by another version of Python. The default " @@ -165,7 +143,7 @@ msgstr "" "は :pep:`3147` で決められた場所と名前を使い、複数のバージョンの Python が共存" "できるようにします。" -#: ../../library/compileall.rst:92 +#: ../../library/compileall.rst:82 msgid "" "Control the maximum recursion level for subdirectories. If this is given, " "then ``-l`` option will not be taken into account. :program:`python -m " @@ -177,13 +155,15 @@ msgstr "" ":program:`python -m compileall -r 0` は :program:`python -m " "compileall -l` と等価です。" -#: ../../library/compileall.rst:99 +#: ../../library/compileall.rst:89 msgid "" "Use *N* workers to compile the files within the given directory. If ``0`` is " -"used, then the result of :func:`os.process_cpu_count` will be used." +"used, then the result of :func:`os.cpu_count()` will be used." msgstr "" +"与えられたディレクトリ内のファイルを *N* ワーカでコンパイルします。``0`` の場" +"合 :func:`os.cpu_count()` の結果が使用されます。" -#: ../../library/compileall.rst:105 +#: ../../library/compileall.rst:95 msgid "" "Control how the generated byte-code files are invalidated at runtime. The " "``timestamp`` value, means that ``.pyc`` files with the source timestamp and " @@ -206,28 +186,28 @@ msgstr "" "``SOURCE_DATE_EPOCH`` 環境変数が設定されていれば、``checked-hash`` になりま" "す。" -#: ../../library/compileall.rst:118 +#: ../../library/compileall.rst:108 msgid "" "Compile with the given optimization level. May be used multiple times to " "compile for multiple levels at a time (for example, ``compileall -o 1 -o " "2``)." msgstr "" -#: ../../library/compileall.rst:124 +#: ../../library/compileall.rst:114 msgid "Ignore symlinks pointing outside the given directory." msgstr "" -#: ../../library/compileall.rst:128 +#: ../../library/compileall.rst:118 msgid "" "If two ``.pyc`` files with different optimization level have the same " "content, use hard links to consolidate duplicate files." msgstr "" -#: ../../library/compileall.rst:131 +#: ../../library/compileall.rst:121 msgid "Added the ``-i``, ``-b`` and ``-h`` options." msgstr "``-i``, ``-b``, ``-h`` オプションを追加。" -#: ../../library/compileall.rst:134 +#: ../../library/compileall.rst:124 msgid "" "Added the ``-j``, ``-r``, and ``-qq`` options. ``-q`` option was changed " "to a multilevel value. ``-b`` will always produce a byte-code file ending " @@ -237,18 +217,18 @@ msgstr "" "レベルの値に変更されました。``-b`` は常に拡張子 ``.pyc`` のバイトエンコーディ" "ングファイルを生成し、``.pyo`` を作りません。" -#: ../../library/compileall.rst:139 +#: ../../library/compileall.rst:129 msgid "Added the ``--invalidation-mode`` option." msgstr "``--invalidation-mode`` オプションが追加されました。" -#: ../../library/compileall.rst:142 +#: ../../library/compileall.rst:132 msgid "" "Added the ``-s``, ``-p``, ``-e`` and ``--hardlink-dupes`` options. Raised " "the default recursion limit from 10 to :py:func:`sys.getrecursionlimit()`. " "Added the possibility to specify the ``-o`` option multiple times." msgstr "" -#: ../../library/compileall.rst:149 +#: ../../library/compileall.rst:139 msgid "" "There is no command-line option to control the optimization level used by " "the :func:`compile` function, because the Python interpreter itself already " @@ -258,19 +238,19 @@ msgstr "" "ンはありません。 Python インタプリタ自体のオプションを使ってください: :" "program:`python -O -m compileall`." -#: ../../library/compileall.rst:153 +#: ../../library/compileall.rst:143 msgid "" -"Similarly, the :func:`compile` function respects the :data:`sys." +"Similarly, the :func:`compile` function respects the :attr:`sys." "pycache_prefix` setting. The generated bytecode cache will only be useful " -"if :func:`compile` is run with the same :data:`sys.pycache_prefix` (if any) " +"if :func:`compile` is run with the same :attr:`sys.pycache_prefix` (if any) " "that will be used at runtime." msgstr "" -#: ../../library/compileall.rst:159 +#: ../../library/compileall.rst:149 msgid "Public functions" msgstr "パブリックな関数" -#: ../../library/compileall.rst:163 +#: ../../library/compileall.rst:153 msgid "" "Recursively descend the directory tree named by *dir*, compiling all :file:`." "py` files along the way. Return a true value if all the files compiled " @@ -280,7 +260,7 @@ msgstr "" "py` をコンパイルします。全ファイルのコンパイルが成功した場合は真を、それ以外" "の場合は偽を返します。" -#: ../../library/compileall.rst:167 +#: ../../library/compileall.rst:157 msgid "" "The *maxlevels* parameter is used to limit the depth of the recursion; it " "defaults to ``sys.getrecursionlimit()``." @@ -288,7 +268,7 @@ msgstr "" "*maxlevels* パラメータで最大再帰深度を制限します。デフォルトは ``sys." "getrecursionlimit()`` です。" -#: ../../library/compileall.rst:170 +#: ../../library/compileall.rst:160 msgid "" "If *ddir* is given, it is prepended to the path to each file being compiled " "for use in compilation time tracebacks, and is also compiled in to the byte-" @@ -302,7 +282,7 @@ msgstr "" "バックやその他のメッセージに使われるバイトコードファイルにもコンパイルされま" "す。" -#: ../../library/compileall.rst:176 +#: ../../library/compileall.rst:166 msgid "" "If *force* is true, modules are re-compiled even if the timestamps are up to " "date." @@ -310,7 +290,7 @@ msgstr "" "*force* が真の場合、タイムスタンプが最新のであってもモジュールは再コンパイル" "されます。" -#: ../../library/compileall.rst:179 +#: ../../library/compileall.rst:169 msgid "" "If *rx* is given, its ``search`` method is called on the complete path to " "each file considered for compilation, and if it returns a true value, the " @@ -318,7 +298,7 @@ msgid "" "expression, given as a :ref:`re.Pattern ` object." msgstr "" -#: ../../library/compileall.rst:184 ../../library/compileall.rst:261 +#: ../../library/compileall.rst:174 ../../library/compileall.rst:251 msgid "" "If *quiet* is ``False`` or ``0`` (the default), the filenames and other " "information are printed to standard out. Set to ``1``, only errors are " @@ -329,7 +309,7 @@ msgstr "" "``1`` の場合エラーのみが表示されます。\n" "``2`` の場合出力はすべて抑制されます。" -#: ../../library/compileall.rst:188 ../../library/compileall.rst:265 +#: ../../library/compileall.rst:178 ../../library/compileall.rst:255 msgid "" "If *legacy* is true, byte-code files are written to their legacy locations " "and names, which may overwrite byte-code files created by another version of " @@ -342,7 +322,7 @@ msgstr "" "す。デフォルトは :pep:`3147` で決められた場所と名前を使い、複数のバージョン" "の Python のバイトコードファイルが共存できるようにします。" -#: ../../library/compileall.rst:194 ../../library/compileall.rst:271 +#: ../../library/compileall.rst:184 ../../library/compileall.rst:261 msgid "" "*optimize* specifies the optimization level for the compiler. It is passed " "to the built-in :func:`compile` function. Accepts also a sequence of " @@ -350,7 +330,7 @@ msgid "" "file in one call." msgstr "" -#: ../../library/compileall.rst:198 +#: ../../library/compileall.rst:188 msgid "" "The argument *workers* specifies how many workers are used to compile files " "in parallel. The default is to not use multiple workers. If the platform " @@ -360,7 +340,7 @@ msgid "" "`ValueError` will be raised." msgstr "" -#: ../../library/compileall.rst:205 ../../library/compileall.rst:275 +#: ../../library/compileall.rst:195 ../../library/compileall.rst:265 msgid "" "*invalidation_mode* should be a member of the :class:`py_compile." "PycInvalidationMode` enum and controls how the generated pycs are " @@ -369,35 +349,35 @@ msgstr "" "*invalidation_mode* は、:class:`py_compile.PycInvalidationMode` のメンバーで" "なければならず、生成されたpycファイルを実行時に無効化する方法を制御します。" -#: ../../library/compileall.rst:209 ../../library/compileall.rst:279 +#: ../../library/compileall.rst:199 ../../library/compileall.rst:269 msgid "" "The *stripdir*, *prependdir* and *limit_sl_dest* arguments correspond to the " "``-s``, ``-p`` and ``-e`` options described above. They may be specified as " -"``str`` or :py:class:`os.PathLike`." +"``str``, ``bytes`` or :py:class:`os.PathLike`." msgstr "" -#: ../../library/compileall.rst:213 ../../library/compileall.rst:283 +#: ../../library/compileall.rst:203 ../../library/compileall.rst:273 msgid "" "If *hardlink_dupes* is true and two ``.pyc`` files with different " "optimization level have the same content, use hard links to consolidate " "duplicate files." msgstr "" -#: ../../library/compileall.rst:216 ../../library/compileall.rst:314 +#: ../../library/compileall.rst:206 ../../library/compileall.rst:304 msgid "Added the *legacy* and *optimize* parameter." msgstr "*legacy* と *optimize* 引数が追加されました。" -#: ../../library/compileall.rst:219 +#: ../../library/compileall.rst:209 msgid "Added the *workers* parameter." msgstr "``workers`` パラメータが追加されました。" -#: ../../library/compileall.rst:222 ../../library/compileall.rst:288 -#: ../../library/compileall.rst:317 +#: ../../library/compileall.rst:212 ../../library/compileall.rst:278 +#: ../../library/compileall.rst:307 msgid "*quiet* parameter was changed to a multilevel value." msgstr "*quiet* 引数が複数のレベルの値に変更されました。" -#: ../../library/compileall.rst:225 ../../library/compileall.rst:291 -#: ../../library/compileall.rst:320 +#: ../../library/compileall.rst:215 ../../library/compileall.rst:281 +#: ../../library/compileall.rst:310 msgid "" "The *legacy* parameter only writes out ``.pyc`` files, not ``.pyo`` files no " "matter what the value of *optimize* is." @@ -405,33 +385,32 @@ msgstr "" "*optimize* の値に関わらず、*legacy* 引数は ``.pyc`` ファイルのみを書き出し、" "``.pyo`` ファイルを書き出さないようになりました。" -#: ../../library/compileall.rst:229 +#: ../../library/compileall.rst:219 msgid "Accepts a :term:`path-like object`." msgstr ":term:`path-like object` を受け入れるようになりました。" -#: ../../library/compileall.rst:232 ../../library/compileall.rst:295 -#: ../../library/compileall.rst:324 +#: ../../library/compileall.rst:222 ../../library/compileall.rst:285 +#: ../../library/compileall.rst:314 msgid "The *invalidation_mode* parameter was added." msgstr "*invalidation_mode* 引数を追加しました。" -#: ../../library/compileall.rst:235 ../../library/compileall.rst:298 -#: ../../library/compileall.rst:327 -msgid "" -"The *invalidation_mode* parameter's default value is updated to ``None``." -msgstr "" +#: ../../library/compileall.rst:225 ../../library/compileall.rst:288 +#: ../../library/compileall.rst:317 +msgid "The *invalidation_mode* parameter's default value is updated to None." +msgstr "*invalidation_mode* 引数のデフォルト値が None に変更されました。" -#: ../../library/compileall.rst:238 +#: ../../library/compileall.rst:228 msgid "Setting *workers* to 0 now chooses the optimal number of cores." msgstr "" -#: ../../library/compileall.rst:241 +#: ../../library/compileall.rst:231 msgid "" "Added *stripdir*, *prependdir*, *limit_sl_dest* and *hardlink_dupes* " "arguments. Default value of *maxlevels* was changed from ``10`` to ``sys." "getrecursionlimit()``" msgstr "" -#: ../../library/compileall.rst:247 +#: ../../library/compileall.rst:237 msgid "" "Compile the file with path *fullname*. Return a true value if the file " "compiled successfully, and a false value otherwise." @@ -439,7 +418,7 @@ msgstr "" "パス *fullname* のファイルをコンパイルします。コンパイルが成功すれば真を、そ" "うでなければ偽を返します。" -#: ../../library/compileall.rst:250 +#: ../../library/compileall.rst:240 msgid "" "If *ddir* is given, it is prepended to the path to the file being compiled " "for use in compilation time tracebacks, and is also compiled in to the byte-" @@ -452,7 +431,7 @@ msgstr "" "ルが実行される時点でソースファイルが存在しない場合に、トレースバックやその他" "のメッセージに使われるバイトコードファイルにもコンパイルされます。" -#: ../../library/compileall.rst:256 +#: ../../library/compileall.rst:246 msgid "" "If *rx* is given, its ``search`` method is passed the full path name to the " "file being compiled, and if it returns a true value, the file is not " @@ -461,7 +440,7 @@ msgid "" "object." msgstr "" -#: ../../library/compileall.rst:301 +#: ../../library/compileall.rst:291 msgid "" "Added *stripdir*, *prependdir*, *limit_sl_dest* and *hardlink_dupes* " "arguments." @@ -469,7 +448,7 @@ msgstr "" "引数 *stripdir* 、 *prependdir* 、 *limit_sl_dest* 、および *hardlink_dupes* " "を追加しました。" -#: ../../library/compileall.rst:306 +#: ../../library/compileall.rst:296 msgid "" "Byte-compile all the :file:`.py` files found along ``sys.path``. Return a " "true value if all the files compiled successfully, and a false value " @@ -480,7 +459,7 @@ msgstr "" "すべてのファイルを問題なくコンパイルできたときに真を、それ以外のときに偽を返" "します。" -#: ../../library/compileall.rst:309 +#: ../../library/compileall.rst:299 msgid "" "If *skip_curdir* is true (the default), the current directory is not " "included in the search. All other parameters are passed to the :func:" @@ -493,7 +472,7 @@ msgstr "" "その他の compile 関数群と異なり、 ``maxlevels`` のデフォルトが ``0`` になって" "いることに注意してください。" -#: ../../library/compileall.rst:330 +#: ../../library/compileall.rst:320 msgid "" "To force a recompile of all the :file:`.py` files in the :file:`Lib/` " "subdirectory and all its subdirectories::" @@ -501,25 +480,10 @@ msgstr "" ":file:`Lib/` ディレクトリ以下にある全ての :file:`.py` ファイルを強制的に再コ" "ンパイルするには、以下のようにします::" -#: ../../library/compileall.rst:333 -msgid "" -"import compileall\n" -"\n" -"compileall.compile_dir('Lib/', force=True)\n" -"\n" -"# Perform same compilation, excluding files in .svn directories.\n" -"import re\n" -"compileall.compile_dir('Lib/', rx=re.compile(r'[/\\\\][.]svn'), force=True)\n" -"\n" -"# pathlib.Path objects can also be used.\n" -"import pathlib\n" -"compileall.compile_dir(pathlib.Path('Lib/'), force=True)" -msgstr "" - -#: ../../library/compileall.rst:347 +#: ../../library/compileall.rst:337 msgid "Module :mod:`py_compile`" msgstr "Module :mod:`py_compile`" -#: ../../library/compileall.rst:348 +#: ../../library/compileall.rst:338 msgid "Byte-compile a single source file." msgstr "一つのソースファイルをバイトコンパイルします。" diff --git a/library/compression.po b/library/compression.po deleted file mode 100644 index f3527ae4a..000000000 --- a/library/compression.po +++ /dev/null @@ -1,54 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 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.14\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-13 14:21+0000\n" -"PO-Revision-Date: 2025-05-23 14:22+0000\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" -"ja/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#: ../../library/compression.rst:2 -msgid "The :mod:`!compression` package" -msgstr "" - -#: ../../library/compression.rst:6 -msgid "" -"The :mod:`!compression` package contains the canonical compression modules " -"containing interfaces to several different compression algorithms. Some of " -"these modules have historically been available as separate modules; those " -"will continue to be available under their original names for compatibility " -"reasons, and will not be removed without a deprecation cycle. The use of " -"modules in :mod:`!compression` is encouraged where practical." -msgstr "" - -#: ../../library/compression.rst:13 -msgid ":mod:`!compression.bz2` -- Re-exports :mod:`bz2`" -msgstr "" - -#: ../../library/compression.rst:14 -msgid ":mod:`!compression.gzip` -- Re-exports :mod:`gzip`" -msgstr "" - -#: ../../library/compression.rst:15 -msgid ":mod:`!compression.lzma` -- Re-exports :mod:`lzma`" -msgstr "" - -#: ../../library/compression.rst:16 -msgid ":mod:`!compression.zlib` -- Re-exports :mod:`zlib`" -msgstr "" - -#: ../../library/compression.rst:17 -msgid "" -":mod:`compression.zstd` -- Wrapper for the Zstandard compression library" -msgstr "" diff --git a/library/compression.zstd.po b/library/compression.zstd.po deleted file mode 100644 index 7b593d250..000000000 --- a/library/compression.zstd.po +++ /dev/null @@ -1,1156 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation -# This file is distributed under the same license as the Python package. -# FIRST AUTHOR , YEAR. -# -# Translators: -# 石井明久, 2025 -# tomo, 2025 -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: Python 3.14\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-06 14:20+0000\n" -"PO-Revision-Date: 2025-05-23 14:22+0000\n" -"Last-Translator: tomo, 2025\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" -"ja/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#: ../../library/compression.zstd.rst:2 -msgid "" -":mod:`!compression.zstd` --- Compression compatible with the Zstandard format" -msgstr "" - -#: ../../library/compression.zstd.rst:10 -msgid "**Source code:** :source:`Lib/compression/zstd/__init__.py`" -msgstr "" - -#: ../../library/compression.zstd.rst:14 -msgid "" -"This module provides classes and functions for compressing and decompressing " -"data using the Zstandard (or *zstd*) compression algorithm. The `zstd manual " -"`__ describes " -"Zstandard as \"a fast lossless compression algorithm, targeting real-time " -"compression scenarios at zlib-level and better compression ratios.\" Also " -"included is a file interface that supports reading and writing the contents " -"of ``.zst`` files created by the :program:`zstd` utility, as well as raw " -"zstd compressed streams." -msgstr "" - -#: ../../library/compression.zstd.rst:23 -msgid "The :mod:`!compression.zstd` module contains:" -msgstr "" - -#: ../../library/compression.zstd.rst:25 -msgid "" -"The :func:`.open` function and :class:`ZstdFile` class for reading and " -"writing compressed files." -msgstr "" - -#: ../../library/compression.zstd.rst:27 -msgid "" -"The :class:`ZstdCompressor` and :class:`ZstdDecompressor` classes for " -"incremental (de)compression." -msgstr "" - -#: ../../library/compression.zstd.rst:29 -msgid "" -"The :func:`compress` and :func:`decompress` functions for one-shot " -"(de)compression." -msgstr "" -"一度に圧縮・展開を行う :func:`compress` および :func:`decompress` 関数。" - -#: ../../library/compression.zstd.rst:31 -msgid "" -"The :func:`train_dict` and :func:`finalize_dict` functions and the :class:" -"`ZstdDict` class to train and manage Zstandard dictionaries." -msgstr "" - -#: ../../library/compression.zstd.rst:33 -msgid "" -"The :class:`CompressionParameter`, :class:`DecompressionParameter`, and :" -"class:`Strategy` classes for setting advanced (de)compression parameters." -msgstr "" - -#: ../../library/compression.zstd.rst:38 -msgid "Exceptions" -msgstr "例外" - -#: ../../library/compression.zstd.rst:42 -msgid "" -"This exception is raised when an error occurs during compression or " -"decompression, or while initializing the (de)compressor state." -msgstr "" - -#: ../../library/compression.zstd.rst:47 -msgid "Reading and writing compressed files" -msgstr "圧縮ファイルへの読み書き" - -#: ../../library/compression.zstd.rst:52 -msgid "" -"Open a Zstandard-compressed file in binary or text mode, returning a :term:" -"`file object`." -msgstr "" - -#: ../../library/compression.zstd.rst:55 -msgid "" -"The *file* argument can be either a file name (given as a :class:`str`, :" -"class:`bytes` or :term:`path-like ` object), in which case " -"the named file is opened, or it can be an existing file object to read from " -"or write to." -msgstr "" - -#: ../../library/compression.zstd.rst:60 -msgid "" -"The mode argument can be either ``'rb'`` for reading (default), ``'wb'`` for " -"overwriting, ``'ab'`` for appending, or ``'xb'`` for exclusive creation. " -"These can equivalently be given as ``'r'``, ``'w'``, ``'a'``, and ``'x'`` " -"respectively. You may also open in text mode with ``'rt'``, ``'wt'``, " -"``'at'``, and ``'xt'`` respectively." -msgstr "" - -#: ../../library/compression.zstd.rst:66 ../../library/compression.zstd.rst:110 -msgid "" -"When reading, the *options* argument can be a dictionary providing advanced " -"decompression parameters; see :class:`DecompressionParameter` for detailed " -"information about supported parameters. The *zstd_dict* argument is a :class:" -"`ZstdDict` instance to be used during decompression. When reading, if the " -"*level* argument is not None, a :exc:`!TypeError` will be raised." -msgstr "" - -#: ../../library/compression.zstd.rst:73 -msgid "" -"When writing, the *options* argument can be a dictionary providing advanced " -"decompression parameters; see :class:`CompressionParameter` for detailed " -"information about supported parameters. The *level* argument is the " -"compression level to use when writing compressed data. Only one of *level* " -"or *options* may be non-None. The *zstd_dict* argument is a :class:" -"`ZstdDict` instance to be used during compression." -msgstr "" - -#: ../../library/compression.zstd.rst:81 -msgid "" -"In binary mode, this function is equivalent to the :class:`ZstdFile` " -"constructor: ``ZstdFile(file, mode, ...)``. In this case, the *encoding*, " -"*errors*, and *newline* parameters must not be provided." -msgstr "" - -#: ../../library/compression.zstd.rst:85 -msgid "" -"In text mode, a :class:`ZstdFile` object is created, and wrapped in an :" -"class:`io.TextIOWrapper` instance with the specified encoding, error " -"handling behavior, and line endings." -msgstr "" - -#: ../../library/compression.zstd.rst:93 -msgid "Open a Zstandard-compressed file in binary mode." -msgstr "" - -#: ../../library/compression.zstd.rst:95 -msgid "" -"A :class:`ZstdFile` can wrap an already-open :term:`file object`, or operate " -"directly on a named file. The *file* argument specifies either the file " -"object to wrap, or the name of the file to open (as a :class:`str`, :class:" -"`bytes` or :term:`path-like ` object). If wrapping an " -"existing file object, the wrapped file will not be closed when the :class:" -"`ZstdFile` is closed." -msgstr "" - -#: ../../library/compression.zstd.rst:102 -msgid "" -"The *mode* argument can be either ``'rb'`` for reading (default), ``'wb'`` " -"for overwriting, ``'xb'`` for exclusive creation, or ``'ab'`` for appending. " -"These can equivalently be given as ``'r'``, ``'w'``, ``'x'`` and ``'a'`` " -"respectively." -msgstr "" - -#: ../../library/compression.zstd.rst:107 -msgid "" -"If *file* is a file object (rather than an actual file name), a mode of " -"``'w'`` does not truncate the file, and is instead equivalent to ``'a'``." -msgstr "" - -#: ../../library/compression.zstd.rst:117 -msgid "" -"When writing, the *options* argument can be a dictionary providing advanced " -"decompression parameters; see :class:`CompressionParameter` for detailed " -"information about supported parameters. The *level* argument is the " -"compression level to use when writing compressed data. Only one of *level* " -"or *options* may be passed. The *zstd_dict* argument is a :class:`ZstdDict` " -"instance to be used during compression." -msgstr "" - -#: ../../library/compression.zstd.rst:125 -msgid "" -":class:`!ZstdFile` supports all the members specified by :class:`io." -"BufferedIOBase`, except for :meth:`~io.BufferedIOBase.detach` and :meth:`~io." -"IOBase.truncate`. Iteration and the :keyword:`with` statement are supported." -msgstr "" - -#: ../../library/compression.zstd.rst:130 -msgid "The following method and attributes are also provided:" -msgstr "以下のメソッドと属性も提供されています:" - -#: ../../library/compression.zstd.rst:134 -msgid "" -"Return buffered data without advancing the file position. At least one byte " -"of data will be returned, unless EOF has been reached. The exact number of " -"bytes returned is unspecified (the *size* argument is ignored)." -msgstr "" -"ファイル上の現在位置を変更せずにバッファのデータを返します。EOF に達しない限" -"り、少なくとも 1 バイトが返されます。返される正確なバイト数は規定されていませ" -"ん (引数 *size* は無視されます)。" - -#: ../../library/compression.zstd.rst:138 -msgid "" -"While calling :meth:`peek` does not change the file position of the :class:" -"`ZstdFile`, it may change the position of the underlying file object (for " -"example, if the :class:`ZstdFile` was constructed by passing a file object " -"for *file*)." -msgstr "" - -#: ../../library/compression.zstd.rst:145 -msgid "``'rb'`` for reading and ``'wb'`` for writing." -msgstr "``'rb'`` は読み込み用、 ``'wb'`` は書き込み用です。" - -#: ../../library/compression.zstd.rst:149 -msgid "" -"The name of the Zstandard file. Equivalent to the :attr:`~io.FileIO.name` " -"attribute of the underlying :term:`file object`." -msgstr "" - -#: ../../library/compression.zstd.rst:154 -msgid "Compressing and decompressing data in memory" -msgstr "メモリ上での圧縮と展開" - -#: ../../library/compression.zstd.rst:158 -msgid "" -"Compress *data* (a :term:`bytes-like object`), returning the compressed data " -"as a :class:`bytes` object." -msgstr "" - -#: ../../library/compression.zstd.rst:161 -#: ../../library/compression.zstd.rst:205 -msgid "" -"The *level* argument is an integer controlling the level of compression. " -"*level* is an alternative to setting :attr:`CompressionParameter." -"compression_level` in *options*. Use :meth:`~CompressionParameter.bounds` " -"on :attr:`~CompressionParameter.compression_level` to get the values that " -"can be passed for *level*. If advanced compression options are needed, the " -"*level* argument must be omitted and in the *options* dictionary the :attr:`!" -"CompressionParameter.compression_level` parameter should be set." -msgstr "" - -#: ../../library/compression.zstd.rst:170 -#: ../../library/compression.zstd.rst:214 -msgid "" -"The *options* argument is a Python dictionary containing advanced " -"compression parameters. The valid keys and values for compression parameters " -"are documented as part of the :class:`CompressionParameter` documentation." -msgstr "" - -#: ../../library/compression.zstd.rst:174 -msgid "" -"The *zstd_dict* argument is an instance of :class:`ZstdDict` containing " -"trained data to improve compression efficiency. The function :func:" -"`train_dict` can be used to generate a Zstandard dictionary." -msgstr "" - -#: ../../library/compression.zstd.rst:181 -msgid "" -"Decompress *data* (a :term:`bytes-like object`), returning the uncompressed " -"data as a :class:`bytes` object." -msgstr "" - -#: ../../library/compression.zstd.rst:184 -#: ../../library/compression.zstd.rst:306 -msgid "" -"The *options* argument is a Python dictionary containing advanced " -"decompression parameters. The valid keys and values for compression " -"parameters are documented as part of the :class:`DecompressionParameter` " -"documentation." -msgstr "" - -#: ../../library/compression.zstd.rst:189 -#: ../../library/compression.zstd.rst:311 -msgid "" -"The *zstd_dict* argument is an instance of :class:`ZstdDict` containing " -"trained data used during compression. This must be the same Zstandard " -"dictionary used during compression." -msgstr "" - -#: ../../library/compression.zstd.rst:193 -msgid "" -"If *data* is the concatenation of multiple distinct compressed frames, " -"decompress all of these frames, and return the concatenation of the results." -msgstr "" - -#: ../../library/compression.zstd.rst:199 -msgid "" -"Create a compressor object, which can be used to compress data incrementally." -msgstr "データをインクリメンタルに圧縮する圧縮オブジェクトを作成します。" - -#: ../../library/compression.zstd.rst:202 -msgid "" -"For a more convenient way of compressing a single chunk of data, see the " -"module-level function :func:`compress`." -msgstr "" - -#: ../../library/compression.zstd.rst:218 -msgid "" -"The *zstd_dict* argument is an optional instance of :class:`ZstdDict` " -"containing trained data to improve compression efficiency. The function :" -"func:`train_dict` can be used to generate a Zstandard dictionary." -msgstr "" - -#: ../../library/compression.zstd.rst:225 -msgid "" -"Compress *data* (a :term:`bytes-like object`), returning a :class:`bytes` " -"object with compressed data if possible, or otherwise an empty :class:`!" -"bytes` object. Some of *data* may be buffered internally, for use in later " -"calls to :meth:`!compress` and :meth:`~.flush`. The returned data should be " -"concatenated with the output of any previous calls to :meth:`~.compress`." -msgstr "" - -#: ../../library/compression.zstd.rst:232 -msgid "" -"The *mode* argument is a :class:`ZstdCompressor` attribute, either :attr:`~." -"CONTINUE`, :attr:`~.FLUSH_BLOCK`, or :attr:`~.FLUSH_FRAME`." -msgstr "" - -#: ../../library/compression.zstd.rst:236 -msgid "" -"When all data has been provided to the compressor, call the :meth:`~.flush` " -"method to finish the compression process. If :meth:`~.compress` is called " -"with *mode* set to :attr:`~.FLUSH_FRAME`, :meth:`~.flush` should not be " -"called, as it would write out a new empty frame." -msgstr "" - -#: ../../library/compression.zstd.rst:244 -msgid "" -"Finish the compression process, returning a :class:`bytes` object containing " -"any data stored in the compressor's internal buffers." -msgstr "" -"圧縮処理を終了し、コンプレッサの内部バッファにあるあらゆるデータを格納する :" -"class:`bytes` オブジェクトを返します。" - -#: ../../library/compression.zstd.rst:247 -msgid "" -"The *mode* argument is a :class:`ZstdCompressor` attribute, either :attr:`~." -"FLUSH_BLOCK`, or :attr:`~.FLUSH_FRAME`." -msgstr "" - -#: ../../library/compression.zstd.rst:252 -msgid "" -"Specify the amount of uncompressed data *size* that will be provided for the " -"next frame. *size* will be written into the frame header of the next frame " -"unless :attr:`CompressionParameter.content_size_flag` is ``False`` or ``0``. " -"A size of ``0`` means that the frame is empty. If *size* is ``None``, the " -"frame header will omit the frame size. Frames that include the uncompressed " -"data size require less memory to decompress, especially at higher " -"compression levels." -msgstr "" - -#: ../../library/compression.zstd.rst:260 -msgid "" -"If :attr:`last_mode` is not :attr:`FLUSH_FRAME`, a :exc:`ValueError` is " -"raised as the compressor is not at the start of a frame. If the pledged size " -"does not match the actual size of data provided to :meth:`.compress`, future " -"calls to :meth:`!compress` or :meth:`flush` may raise :exc:`ZstdError` and " -"the last chunk of data may be lost." -msgstr "" - -#: ../../library/compression.zstd.rst:267 -msgid "" -"After :meth:`flush` or :meth:`.compress` are called with mode :attr:" -"`FLUSH_FRAME`, the next frame will not include the frame size into the " -"header unless :meth:`!set_pledged_input_size` is called again." -msgstr "" - -#: ../../library/compression.zstd.rst:273 -msgid "" -"Collect more data for compression, which may or may not generate output " -"immediately. This mode optimizes the compression ratio by maximizing the " -"amount of data per block and frame." -msgstr "" - -#: ../../library/compression.zstd.rst:279 -msgid "" -"Complete and write a block to the data stream. The data returned so far can " -"be immediately decompressed. Past data can still be referenced in future " -"blocks generated by calls to :meth:`~.compress`, improving compression." -msgstr "" - -#: ../../library/compression.zstd.rst:286 -msgid "" -"Complete and write out a frame. Future data provided to :meth:`~.compress` " -"will be written into a new frame and *cannot* reference past data." -msgstr "" - -#: ../../library/compression.zstd.rst:292 -msgid "" -"The last mode passed to either :meth:`~.compress` or :meth:`~.flush`. The " -"value can be one of :attr:`~.CONTINUE`, :attr:`~.FLUSH_BLOCK`, or :attr:`~." -"FLUSH_FRAME`. The initial value is :attr:`~.FLUSH_FRAME`, signifying that " -"the compressor is at the start of a new frame." -msgstr "" - -#: ../../library/compression.zstd.rst:300 -msgid "" -"Create a decompressor object, which can be used to decompress data " -"incrementally." -msgstr "" -"データをインクリメンタルに展開するために使用できる展開オブジェクトを作成しま" -"す。" - -#: ../../library/compression.zstd.rst:303 -msgid "" -"For a more convenient way of decompressing an entire compressed stream at " -"once, see the module-level function :func:`decompress`." -msgstr "" - -#: ../../library/compression.zstd.rst:316 -msgid "" -"This class does not transparently handle inputs containing multiple " -"compressed frames, unlike the :func:`decompress` function and :class:" -"`ZstdFile` class. To decompress a multi-frame input, you should use :func:" -"`decompress`, :class:`ZstdFile` if working with a :term:`file object`, or " -"multiple :class:`!ZstdDecompressor` instances." -msgstr "" - -#: ../../library/compression.zstd.rst:324 -msgid "" -"Decompress *data* (a :term:`bytes-like object`), returning uncompressed data " -"as bytes. Some of *data* may be buffered internally, for use in later calls " -"to :meth:`!decompress`. The returned data should be concatenated with the " -"output of any previous calls to :meth:`!decompress`." -msgstr "" - -#: ../../library/compression.zstd.rst:330 -msgid "" -"If *max_length* is non-negative, the method returns at most *max_length* " -"bytes of decompressed data. If this limit is reached and further output can " -"be produced, the :attr:`~.needs_input` attribute will be set to ``False``. " -"In this case, the next call to :meth:`~.decompress` may provide *data* as " -"``b''`` to obtain more of the output." -msgstr "" - -#: ../../library/compression.zstd.rst:337 -msgid "" -"If all of the input data was decompressed and returned (either because this " -"was less than *max_length* bytes, or because *max_length* was negative), " -"the :attr:`~.needs_input` attribute will be set to ``True``." -msgstr "" -"入力データの全てが圧縮され返された (*max_length* バイトより少ないためか " -"*max_length* が負のため) 場合、\n" -":attr:`~.needs_input` 属性は ``True`` になります。" - -#: ../../library/compression.zstd.rst:342 -msgid "" -"Attempting to decompress data after the end of a frame will raise a :exc:" -"`ZstdError`. Any data found after the end of the frame is ignored and saved " -"in the :attr:`~.unused_data` attribute." -msgstr "" - -#: ../../library/compression.zstd.rst:348 -msgid "``True`` if the end-of-stream marker has been reached." -msgstr "ストリーム終端記号に到達した場合 ``True`` を返します。" - -#: ../../library/compression.zstd.rst:352 -msgid "Data found after the end of the compressed stream." -msgstr "圧縮ストリームの末尾以降に存在したデータを表します。" - -#: ../../library/compression.zstd.rst:354 -msgid "Before the end of the stream is reached, this will be ``b''``." -msgstr "" - -#: ../../library/compression.zstd.rst:358 -msgid "" -"``False`` if the :meth:`.decompress` method can provide more decompressed " -"data before requiring new compressed input." -msgstr "" - -#: ../../library/compression.zstd.rst:363 -msgid "Zstandard dictionaries" -msgstr "" - -#: ../../library/compression.zstd.rst:368 -msgid "" -"Train a Zstandard dictionary, returning a :class:`ZstdDict` instance. " -"Zstandard dictionaries enable more efficient compression of smaller sizes of " -"data, which is traditionally difficult to compress due to less repetition. " -"If you are compressing multiple similar groups of data (such as similar " -"files), Zstandard dictionaries can improve compression ratios and speed " -"significantly." -msgstr "" - -#: ../../library/compression.zstd.rst:375 -msgid "" -"The *samples* argument (an iterable of :class:`bytes` objects), is the " -"population of samples used to train the Zstandard dictionary." -msgstr "" - -#: ../../library/compression.zstd.rst:378 -msgid "" -"The *dict_size* argument, an integer, is the maximum size (in bytes) the " -"Zstandard dictionary should be. The Zstandard documentation suggests an " -"absolute maximum of no more than 100 KB, but the maximum can often be " -"smaller depending on the data. Larger dictionaries generally slow down " -"compression, but improve compression ratios. Smaller dictionaries lead to " -"faster compression, but reduce the compression ratio." -msgstr "" - -#: ../../library/compression.zstd.rst:388 -msgid "" -"An advanced function for converting a \"raw content\" Zstandard dictionary " -"into a regular Zstandard dictionary. \"Raw content\" dictionaries are a " -"sequence of bytes that do not need to follow the structure of a normal " -"Zstandard dictionary." -msgstr "" - -#: ../../library/compression.zstd.rst:393 -msgid "" -"The *zstd_dict* argument is a :class:`ZstdDict` instance with the :attr:" -"`~ZstdDict.dict_content` containing the raw dictionary contents." -msgstr "" - -#: ../../library/compression.zstd.rst:396 -msgid "" -"The *samples* argument (an iterable of :class:`bytes` objects), contains " -"sample data for generating the Zstandard dictionary." -msgstr "" - -#: ../../library/compression.zstd.rst:399 -msgid "" -"The *dict_size* argument, an integer, is the maximum size (in bytes) the " -"Zstandard dictionary should be. See :func:`train_dict` for suggestions on " -"the maximum dictionary size." -msgstr "" - -#: ../../library/compression.zstd.rst:403 -msgid "" -"The *level* argument (an integer) is the compression level expected to be " -"passed to the compressors using this dictionary. The dictionary information " -"varies for each compression level, so tuning for the proper compression " -"level can make compression more efficient." -msgstr "" - -#: ../../library/compression.zstd.rst:411 -msgid "" -"A wrapper around Zstandard dictionaries. Dictionaries can be used to improve " -"the compression of many small chunks of data. Use :func:`train_dict` if you " -"need to train a new dictionary from sample data." -msgstr "" - -#: ../../library/compression.zstd.rst:415 -msgid "" -"The *dict_content* argument (a :term:`bytes-like object`), is the already " -"trained dictionary information." -msgstr "" - -#: ../../library/compression.zstd.rst:418 -msgid "" -"The *is_raw* argument, a boolean, is an advanced parameter controlling the " -"meaning of *dict_content*. ``True`` means *dict_content* is a \"raw " -"content\" dictionary, without any format restrictions. ``False`` means " -"*dict_content* is an ordinary Zstandard dictionary, created from Zstandard " -"functions, for example, :func:`train_dict` or the external :program:`zstd` " -"CLI." -msgstr "" - -#: ../../library/compression.zstd.rst:424 -msgid "" -"When passing a :class:`!ZstdDict` to a function, the :attr:`!" -"as_digested_dict` and :attr:`!as_undigested_dict` attributes can control how " -"the dictionary is loaded by passing them as the ``zstd_dict`` argument, for " -"example, ``compress(data, zstd_dict=zd.as_digested_dict)``. Digesting a " -"dictionary is a costly operation that occurs when loading a Zstandard " -"dictionary. When making multiple calls to compression or decompression, " -"passing a digested dictionary will reduce the overhead of loading the " -"dictionary." -msgstr "" - -#: ../../library/compression.zstd.rst:433 -msgid "Difference for compression" -msgstr "" - -#: ../../library/compression.zstd.rst:438 -msgid "Digested dictionary" -msgstr "" - -#: ../../library/compression.zstd.rst:439 -msgid "Undigested dictionary" -msgstr "" - -#: ../../library/compression.zstd.rst:440 -msgid "" -"Advanced parameters of the compressor which may be overridden by the " -"dictionary's parameters" -msgstr "" - -#: ../../library/compression.zstd.rst:442 -msgid "" -"``window_log``, ``hash_log``, ``chain_log``, ``search_log``, ``min_match``, " -"``target_length``, ``strategy``, ``enable_long_distance_matching``, " -"``ldm_hash_log``, ``ldm_min_match``, ``ldm_bucket_size_log``, " -"``ldm_hash_rate_log``, and some non-public parameters." -msgstr "" - -#: ../../library/compression.zstd.rst:447 -msgid "None" -msgstr "None" - -#: ../../library/compression.zstd.rst:448 -msgid ":class:`!ZstdDict` internally caches the dictionary" -msgstr "" - -#: ../../library/compression.zstd.rst:449 -msgid "" -"Yes. It's faster when loading a digested dictionary again with the same " -"compression level." -msgstr "" - -#: ../../library/compression.zstd.rst:451 -msgid "" -"No. If you wish to load an undigested dictionary multiple times, consider " -"reusing a compressor object." -msgstr "" - -#: ../../library/compression.zstd.rst:454 -msgid "" -"If passing a :class:`!ZstdDict` without any attribute, an undigested " -"dictionary is passed by default when compressing and a digested dictionary " -"is generated if necessary and passed by default when decompressing." -msgstr "" - -#: ../../library/compression.zstd.rst:460 -msgid "" -"The content of the Zstandard dictionary, a ``bytes`` object. It's the same " -"as the *dict_content* argument in the ``__init__`` method. It can be used " -"with other programs, such as the ``zstd`` CLI program." -msgstr "" - -#: ../../library/compression.zstd.rst:466 -msgid "Identifier of the Zstandard dictionary, a non-negative int value." -msgstr "" - -#: ../../library/compression.zstd.rst:468 -msgid "" -"Non-zero means the dictionary is ordinary, created by Zstandard functions " -"and following the Zstandard format." -msgstr "" - -#: ../../library/compression.zstd.rst:471 -msgid "" -"``0`` means a \"raw content\" dictionary, free of any format restriction, " -"used for advanced users." -msgstr "" - -#: ../../library/compression.zstd.rst:476 -msgid "" -"The meaning of ``0`` for :attr:`!ZstdDict.dict_id` is different from the " -"``dictionary_id`` attribute to the :func:`get_frame_info` function." -msgstr "" - -#: ../../library/compression.zstd.rst:482 -msgid "Load as a digested dictionary." -msgstr "" - -#: ../../library/compression.zstd.rst:486 -msgid "Load as an undigested dictionary." -msgstr "" - -#: ../../library/compression.zstd.rst:490 -msgid "Advanced parameter control" -msgstr "" - -#: ../../library/compression.zstd.rst:494 -msgid "" -"An :class:`~enum.IntEnum` containing the advanced compression parameter keys " -"that can be used when compressing data." -msgstr "" - -#: ../../library/compression.zstd.rst:497 -#: ../../library/compression.zstd.rst:725 -msgid "" -"The :meth:`~.bounds` method can be used on any attribute to get the valid " -"values for that parameter." -msgstr "" - -#: ../../library/compression.zstd.rst:500 -msgid "" -"Parameters are optional; any omitted parameter will have it's value selected " -"automatically." -msgstr "" - -#: ../../library/compression.zstd.rst:503 -msgid "" -"Example getting the lower and upper bound of :attr:`~.compression_level`::" -msgstr "" - -#: ../../library/compression.zstd.rst:505 -msgid "lower, upper = CompressionParameter.compression_level.bounds()" -msgstr "" - -#: ../../library/compression.zstd.rst:507 -msgid "Example setting the :attr:`~.window_log` to the maximum size::" -msgstr "" - -#: ../../library/compression.zstd.rst:509 -msgid "" -"_lower, upper = CompressionParameter.window_log.bounds()\n" -"options = {CompressionParameter.window_log: upper}\n" -"compress(b'venezuelan beaver cheese', options=options)" -msgstr "" - -#: ../../library/compression.zstd.rst:515 -msgid "" -"Return the tuple of int bounds, ``(lower, upper)``, of a compression " -"parameter. This method should be called on the attribute you wish to " -"retrieve the bounds of. For example, to get the valid values for :attr:`~." -"compression_level`, one may check the result of ``CompressionParameter." -"compression_level.bounds()``." -msgstr "" - -#: ../../library/compression.zstd.rst:521 -#: ../../library/compression.zstd.rst:743 -msgid "Both the lower and upper bounds are inclusive." -msgstr "" - -#: ../../library/compression.zstd.rst:525 -msgid "" -"A high-level means of setting other compression parameters that affect the " -"speed and ratio of compressing data. Setting the level to zero uses :attr:" -"`COMPRESSION_LEVEL_DEFAULT`." -msgstr "" - -#: ../../library/compression.zstd.rst:531 -msgid "" -"Maximum allowed back-reference distance the compressor can use when " -"compressing data, expressed as power of two, ``1 << window_log`` bytes. This " -"parameter greatly influences the memory usage of compression. Higher values " -"require more memory but gain better compression values." -msgstr "" - -#: ../../library/compression.zstd.rst:536 -#: ../../library/compression.zstd.rst:545 -#: ../../library/compression.zstd.rst:556 -#: ../../library/compression.zstd.rst:564 -#: ../../library/compression.zstd.rst:575 -#: ../../library/compression.zstd.rst:590 -#: ../../library/compression.zstd.rst:621 -#: ../../library/compression.zstd.rst:628 -#: ../../library/compression.zstd.rst:636 -#: ../../library/compression.zstd.rst:644 -#: ../../library/compression.zstd.rst:703 -#: ../../library/compression.zstd.rst:752 -msgid "A value of zero causes the value to be selected automatically." -msgstr "" - -#: ../../library/compression.zstd.rst:540 -msgid "" -"Size of the initial probe table, as a power of two. The resulting memory " -"usage is ``1 << (hash_log+2)`` bytes. Larger tables improve compression " -"ratio of strategies <= :attr:`~Strategy.dfast`, and improve compression " -"speed of strategies > :attr:`~Strategy.dfast`." -msgstr "" - -#: ../../library/compression.zstd.rst:549 -msgid "" -"Size of the multi-probe search table, as a power of two. The resulting " -"memory usage is ``1 << (chain_log+2)`` bytes. Larger tables result in better " -"and slower compression. This parameter has no effect for the :attr:" -"`~Strategy.fast` strategy. It's still useful when using :attr:`~Strategy." -"dfast` strategy, in which case it defines a secondary probe table." -msgstr "" - -#: ../../library/compression.zstd.rst:560 -msgid "" -"Number of search attempts, as a power of two. More attempts result in better " -"and slower compression. This parameter is useless for :attr:`~Strategy.fast` " -"and :attr:`~Strategy.dfast` strategies." -msgstr "" - -#: ../../library/compression.zstd.rst:568 -msgid "" -"Minimum size of searched matches. Larger values increase compression and " -"decompression speed, but decrease ratio. Note that Zstandard can still find " -"matches of smaller size, it just tweaks its search algorithm to look for " -"this size and larger. For all strategies < :attr:`~Strategy.btopt`, the " -"effective minimum is ``4``; for all strategies > :attr:`~Strategy.fast`, the " -"effective maximum is ``6``." -msgstr "" - -#: ../../library/compression.zstd.rst:579 -msgid "The impact of this field depends on the selected :class:`Strategy`." -msgstr "" - -#: ../../library/compression.zstd.rst:581 -msgid "" -"For strategies :attr:`~Strategy.btopt`, :attr:`~Strategy.btultra` and :attr:" -"`~Strategy.btultra2`, the value is the length of a match considered \"good " -"enough\" to stop searching. Larger values make compression ratios better, " -"but compresses slower." -msgstr "" - -#: ../../library/compression.zstd.rst:586 -msgid "" -"For strategy :attr:`~Strategy.fast`, it is the distance between match " -"sampling. Larger values make compression faster, but with a worse " -"compression ratio." -msgstr "" - -#: ../../library/compression.zstd.rst:594 -msgid "" -"The higher the value of selected strategy, the more complex the compression " -"technique used by zstd, resulting in higher compression ratios but slower " -"compression." -msgstr "" - -#: ../../library/compression.zstd.rst:598 -msgid ":class:`Strategy`" -msgstr "" - -#: ../../library/compression.zstd.rst:602 -msgid "" -"Long distance matching can be used to improve compression for large inputs " -"by finding large matches at greater distances. It increases memory usage and " -"window size." -msgstr "" - -#: ../../library/compression.zstd.rst:606 -msgid "" -"``True`` or ``1`` enable long distance matching while ``False`` or ``0`` " -"disable it." -msgstr "" - -#: ../../library/compression.zstd.rst:609 -msgid "" -"Enabling this parameter increases default :attr:`~CompressionParameter." -"window_log` to 128 MiB except when expressly set to a different value. This " -"setting is enabled by default if :attr:`!window_log` >= 128 MiB and the " -"compression strategy >= :attr:`~Strategy.btopt` (compression level 16+)." -msgstr "" - -#: ../../library/compression.zstd.rst:617 -msgid "" -"Size of the table for long distance matching, as a power of two. Larger " -"values increase memory usage and compression ratio, but decrease compression " -"speed." -msgstr "" - -#: ../../library/compression.zstd.rst:625 -msgid "" -"Minimum match size for long distance matcher. Larger or too small values can " -"often decrease the compression ratio." -msgstr "" - -#: ../../library/compression.zstd.rst:632 -msgid "" -"Log size of each bucket in the long distance matcher hash table for " -"collision resolution. Larger values improve collision resolution but " -"decrease compression speed." -msgstr "" - -#: ../../library/compression.zstd.rst:640 -msgid "" -"Frequency of inserting/looking up entries into the long distance matcher " -"hash table. Larger values improve compression speed. Deviating far from the " -"default value will likely result in a compression ratio decrease." -msgstr "" - -#: ../../library/compression.zstd.rst:648 -msgid "" -"Write the size of the data to be compressed into the Zstandard frame header " -"when known prior to compressing." -msgstr "" - -#: ../../library/compression.zstd.rst:651 -msgid "This flag only takes effect under the following scenarios:" -msgstr "" - -#: ../../library/compression.zstd.rst:653 -msgid "Calling :func:`compress` for one-shot compression" -msgstr "" - -#: ../../library/compression.zstd.rst:654 -msgid "" -"Providing all of the data to be compressed in the frame in a single :meth:" -"`ZstdCompressor.compress` call, with the :attr:`ZstdCompressor.FLUSH_FRAME` " -"mode." -msgstr "" - -#: ../../library/compression.zstd.rst:657 -msgid "" -"Calling :meth:`ZstdCompressor.set_pledged_input_size` with the exact amount " -"of data that will be provided to the compressor prior to any calls to :meth:" -"`ZstdCompressor.compress` for the current frame. :meth:`!ZstdCompressor." -"set_pledged_input_size` must be called for each new frame." -msgstr "" - -#: ../../library/compression.zstd.rst:663 -msgid "" -"All other compression calls may not write the size information into the " -"frame header." -msgstr "" - -#: ../../library/compression.zstd.rst:666 -msgid "" -"``True`` or ``1`` enable the content size flag while ``False`` or ``0`` " -"disable it." -msgstr "" - -#: ../../library/compression.zstd.rst:671 -msgid "" -"A four-byte checksum using XXHash64 of the uncompressed content is written " -"at the end of each frame. Zstandard's decompression code verifies the " -"checksum. If there is a mismatch a :class:`ZstdError` exception is raised." -msgstr "" - -#: ../../library/compression.zstd.rst:676 -msgid "" -"``True`` or ``1`` enable checksum generation while ``False`` or ``0`` " -"disable it." -msgstr "" - -#: ../../library/compression.zstd.rst:681 -msgid "" -"When compressing with a :class:`ZstdDict`, the dictionary's ID is written " -"into the frame header." -msgstr "" - -#: ../../library/compression.zstd.rst:684 -msgid "" -"``True`` or ``1`` enable storing the dictionary ID while ``False`` or ``0`` " -"disable it." -msgstr "" - -#: ../../library/compression.zstd.rst:689 -msgid "" -"Select how many threads will be spawned to compress in parallel. When :attr:" -"`!nb_workers` > 0, enables multi-threaded compression, a value of ``1`` " -"means \"one-thread multi-threaded mode\". More workers improve speed, but " -"also increase memory usage and slightly reduce compression ratio." -msgstr "" - -#: ../../library/compression.zstd.rst:694 -msgid "A value of zero disables multi-threading." -msgstr "" - -#: ../../library/compression.zstd.rst:698 -msgid "" -"Size of a compression job, in bytes. This value is enforced only when :attr:" -"`~CompressionParameter.nb_workers` >= 1. Each compression job is completed " -"in parallel, so this value can indirectly impact the number of active " -"threads." -msgstr "" - -#: ../../library/compression.zstd.rst:707 -msgid "" -"Sets how much data is reloaded from previous jobs (threads) for new jobs to " -"be used by the look behind window during compression. This value is only " -"used when :attr:`~CompressionParameter.nb_workers` >= 1. Acceptable values " -"vary from 0 to 9." -msgstr "" - -#: ../../library/compression.zstd.rst:712 -msgid "0 means dynamically set the overlap amount" -msgstr "" - -#: ../../library/compression.zstd.rst:713 -msgid "1 means no overlap" -msgstr "" - -#: ../../library/compression.zstd.rst:714 -msgid "9 means use a full window size from the previous job" -msgstr "" - -#: ../../library/compression.zstd.rst:716 -msgid "" -"Each increment halves/doubles the overlap size. \"8\" means an overlap of " -"``window_size/2``, \"7\" means an overlap of ``window_size/4``, etc." -msgstr "" - -#: ../../library/compression.zstd.rst:721 -msgid "" -"An :class:`~enum.IntEnum` containing the advanced decompression parameter " -"keys that can be used when decompressing data. Parameters are optional; any " -"omitted parameter will have it's value selected automatically." -msgstr "" - -#: ../../library/compression.zstd.rst:728 -msgid "Example setting the :attr:`~.window_log_max` to the maximum size::" -msgstr "" - -#: ../../library/compression.zstd.rst:730 -msgid "" -"data = compress(b'Some very long buffer of bytes...')\n" -"\n" -"_lower, upper = DecompressionParameter.window_log_max.bounds()\n" -"\n" -"options = {DecompressionParameter.window_log_max: upper}\n" -"decompress(data, options=options)" -msgstr "" - -#: ../../library/compression.zstd.rst:739 -msgid "" -"Return the tuple of int bounds, ``(lower, upper)``, of a decompression " -"parameter. This method should be called on the attribute you wish to " -"retrieve the bounds of." -msgstr "" - -#: ../../library/compression.zstd.rst:747 -msgid "" -"The base-two logarithm of the maximum size of the window used during " -"decompression. This can be useful to limit the amount of memory used when " -"decompressing data. A larger maximum window size leads to faster " -"decompression." -msgstr "" - -#: ../../library/compression.zstd.rst:757 -msgid "" -"An :class:`~enum.IntEnum` containing strategies for compression. Higher-" -"numbered strategies correspond to more complex and slower compression." -msgstr "" - -#: ../../library/compression.zstd.rst:763 -msgid "" -"The values of attributes of :class:`!Strategy` are not necessarily stable " -"across zstd versions. Only the ordering of the attributes may be relied " -"upon. The attributes are listed below in order." -msgstr "" - -#: ../../library/compression.zstd.rst:767 -msgid "The following strategies are available:" -msgstr "" - -#: ../../library/compression.zstd.rst:789 -msgid "Miscellaneous" -msgstr "その他" - -#: ../../library/compression.zstd.rst:793 -msgid "" -"Retrieve a :class:`FrameInfo` object containing metadata about a Zstandard " -"frame. Frames contain metadata related to the compressed data they hold." -msgstr "" - -#: ../../library/compression.zstd.rst:799 -msgid "Metadata related to a Zstandard frame." -msgstr "" - -#: ../../library/compression.zstd.rst:803 -msgid "The size of the decompressed contents of the frame." -msgstr "" - -#: ../../library/compression.zstd.rst:807 -msgid "" -"An integer representing the Zstandard dictionary ID needed for decompressing " -"the frame. ``0`` means the dictionary ID was not recorded in the frame " -"header. This may mean that a Zstandard dictionary is not needed, or that the " -"ID of a required dictionary was not recorded." -msgstr "" - -#: ../../library/compression.zstd.rst:815 -msgid "The default compression level for Zstandard: ``3``." -msgstr "" - -#: ../../library/compression.zstd.rst:820 -msgid "" -"Version number of the runtime zstd library as a tuple of integers (major, " -"minor, release)." -msgstr "" - -#: ../../library/compression.zstd.rst:825 -msgid "Examples" -msgstr "使用例" - -#: ../../library/compression.zstd.rst:827 -msgid "Reading in a compressed file:" -msgstr "" - -#: ../../library/compression.zstd.rst:829 -msgid "" -"from compression import zstd\n" -"\n" -"with zstd.open(\"file.zst\") as f:\n" -" file_content = f.read()" -msgstr "" - -#: ../../library/compression.zstd.rst:836 -msgid "Creating a compressed file:" -msgstr "" - -#: ../../library/compression.zstd.rst:838 -msgid "" -"from compression import zstd\n" -"\n" -"data = b\"Insert Data Here\"\n" -"with zstd.open(\"file.zst\", \"w\") as f:\n" -" f.write(data)" -msgstr "" - -#: ../../library/compression.zstd.rst:846 -msgid "Compressing data in memory:" -msgstr "" - -#: ../../library/compression.zstd.rst:848 -msgid "" -"from compression import zstd\n" -"\n" -"data_in = b\"Insert Data Here\"\n" -"data_out = zstd.compress(data_in)" -msgstr "" - -#: ../../library/compression.zstd.rst:855 -msgid "Incremental compression:" -msgstr "" - -#: ../../library/compression.zstd.rst:857 -msgid "" -"from compression import zstd\n" -"\n" -"comp = zstd.ZstdCompressor()\n" -"out1 = comp.compress(b\"Some data\\n\")\n" -"out2 = comp.compress(b\"Another piece of data\\n\")\n" -"out3 = comp.compress(b\"Even more data\\n\")\n" -"out4 = comp.flush()\n" -"# Concatenate all the partial results:\n" -"result = b\"\".join([out1, out2, out3, out4])" -msgstr "" - -#: ../../library/compression.zstd.rst:869 -msgid "Writing compressed data to an already-open file:" -msgstr "" - -#: ../../library/compression.zstd.rst:871 -msgid "" -"from compression import zstd\n" -"\n" -"with open(\"myfile\", \"wb\") as f:\n" -" f.write(b\"This data will not be compressed\\n\")\n" -" with zstd.open(f, \"w\") as zstf:\n" -" zstf.write(b\"This *will* be compressed\\n\")\n" -" f.write(b\"Not compressed\\n\")" -msgstr "" - -#: ../../library/compression.zstd.rst:881 -msgid "Creating a compressed file using compression parameters:" -msgstr "" - -#: ../../library/compression.zstd.rst:883 -msgid "" -"from compression import zstd\n" -"\n" -"options = {\n" -" zstd.CompressionParameter.checksum_flag: 1\n" -"}\n" -"with zstd.open(\"file.zst\", \"w\", options=options) as f:\n" -" f.write(b\"Mind if I squeeze in?\")" -msgstr "" diff --git a/library/concurrency.po b/library/concurrency.po index 9b6752e9d..66939bcb2 100644 --- a/library/concurrency.po +++ b/library/concurrency.po @@ -1,25 +1,26 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 +# Inada Naoki , 2017 +# Nozomu Kaneko , 2017 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-13 14:21+0000\n" -"PO-Revision-Date: 2021-06-28 00:57+0000\n" -"Last-Translator: tomo, 2021\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-03-07 05:38+0000\n" +"PO-Revision-Date: 2017-02-16 23:03+0000\n" +"Last-Translator: Nozomu Kaneko , 2017\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/concurrency.rst:5 @@ -39,7 +40,7 @@ msgstr "" "発スタイル (イベントドリブンな協調的マルチタスク vs プリエンプティブマルチタ" "スク) に依存します。ここに概観を示します:" -#: ../../library/concurrency.rst:28 +#: ../../library/concurrency.rst:27 msgid "The following are support modules for some of the above services:" msgstr "" "以下のモジュールは上記のサービスの一部で使われるサポートモジュールです:" diff --git a/library/concurrent.futures.po b/library/concurrent.futures.po index 6f771c100..7b95732af 100644 --- a/library/concurrent.futures.po +++ b/library/concurrent.futures.po @@ -1,45 +1,49 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: +# Masato HASHIMOTO , 2017 +# 秘湯 , 2017 +# Nozomu Kaneko , 2017 +# Yusuke Miyazaki , 2017 +# Shun Sakurai, 2017 +# Arihiro TAKASE, 2017 +# E. Kawashima, 2017 +# Osamu NAKAMURA, 2017 +# mollinaca, 2020 # Takanori Suzuki , 2021 -# tomo, 2021 -# mollinaca, 2021 -# Osamu NAKAMURA, 2022 -# 菊池 健志, 2023 -# Arihiro TAKASE, 2023 -# 石井明久, 2024 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:57+0000\n" -"Last-Translator: 石井明久, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-07-29 07:05+0000\n" +"PO-Revision-Date: 2017-02-16 23:03+0000\n" +"Last-Translator: Takanori Suzuki , 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/concurrent.futures.rst:2 -msgid ":mod:`!concurrent.futures` --- Launching parallel tasks" -msgstr ":mod:`!concurrent.futures` --- 並列タスク実行" +msgid ":mod:`concurrent.futures` --- Launching parallel tasks" +msgstr ":mod:`concurrent.futures` -- 並列タスク実行" #: ../../library/concurrent.futures.rst:9 msgid "" -"**Source code:** :source:`Lib/concurrent/futures/thread.py`, :source:`Lib/" -"concurrent/futures/process.py`, and :source:`Lib/concurrent/futures/" -"interpreter.py`" +"**Source code:** :source:`Lib/concurrent/futures/thread.py` and :source:`Lib/" +"concurrent/futures/process.py`" msgstr "" +"**ソースコード:** :source:`Lib/concurrent/futures/thread.py` および :source:" +"`Lib/concurrent/futures/process.py`" -#: ../../library/concurrent.futures.rst:15 +#: ../../library/concurrent.futures.rst:14 msgid "" "The :mod:`concurrent.futures` module provides a high-level interface for " "asynchronously executing callables." @@ -47,31 +51,23 @@ msgstr "" ":mod:`concurrent.futures` モジュールは、非同期に実行できる呼び出し可能オブ" "ジェクトの高水準のインターフェースを提供します。" -#: ../../library/concurrent.futures.rst:18 +#: ../../library/concurrent.futures.rst:17 msgid "" "The asynchronous execution can be performed with threads, using :class:" -"`ThreadPoolExecutor` or :class:`InterpreterPoolExecutor`, or separate " -"processes, using :class:`ProcessPoolExecutor`. Each implements the same " -"interface, which is defined by the abstract :class:`Executor` class." +"`ThreadPoolExecutor`, or separate processes, using :class:" +"`ProcessPoolExecutor`. Both implement the same interface, which is defined " +"by the abstract :class:`Executor` class." msgstr "" +"非同期実行は :class:`ThreadPoolExecutor` を用いてスレッドで実行すること" +"も、 :class:`ProcessPoolExecutor` を用いて別々のプロセスで実行することもでき" +"ます. どちらも :class:`Executor` 抽象クラスで定義された同じインターフェース" +"を実装します。" -#: ../../includes/wasm-notavail.rst:3 -msgid "Availability" -msgstr "" - -#: ../../includes/wasm-notavail.rst:5 -msgid "" -"This module does not work or is not available on WebAssembly. See :ref:`wasm-" -"availability` for more information." -msgstr "" -"このモジュールは WebAssembly では動作しないか、利用不可です。詳しくは、:ref:" -"`wasm-availability` を見てください。" - -#: ../../library/concurrent.futures.rst:27 +#: ../../library/concurrent.futures.rst:24 msgid "Executor Objects" msgstr "Executor オブジェクト" -#: ../../library/concurrent.futures.rst:31 +#: ../../library/concurrent.futures.rst:28 msgid "" "An abstract class that provides methods to execute calls asynchronously. It " "should not be used directly, but through its concrete subclasses." @@ -79,80 +75,67 @@ msgstr "" "非同期呼び出しを実行するためのメソッドを提供する抽象クラスです。このクラスを" "直接使ってはならず、具象サブクラスを介して使います。" -#: ../../library/concurrent.futures.rst:36 +#: ../../library/concurrent.futures.rst:33 msgid "" -"Schedules the callable, *fn*, to be executed as ``fn(*args, **kwargs)`` and " +"Schedules the callable, *fn*, to be executed as ``fn(*args **kwargs)`` and " "returns a :class:`Future` object representing the execution of the " "callable. ::" msgstr "" -"呼び出し可能オブジェクト *fn* を、 ``fn(*args, **kwargs)`` として実行するよう" +"呼び出し可能オブジェクト *fn* を、 ``fn(*args **kwargs)`` として実行するよう" "にスケジュールし、呼び出し可能オブジェクトの実行を表現する :class:`Future` オ" "ブジェクトを返します。 ::" -#: ../../library/concurrent.futures.rst:40 -msgid "" -"with ThreadPoolExecutor(max_workers=1) as executor:\n" -" future = executor.submit(pow, 323, 1235)\n" -" print(future.result())" -msgstr "" - -#: ../../library/concurrent.futures.rst:46 -msgid "Similar to :func:`map(fn, *iterables) ` except:" +#: ../../library/concurrent.futures.rst:43 +msgid "Similar to :func:`map(func, *iterables) ` except:" msgstr "" -#: ../../library/concurrent.futures.rst:48 -msgid "" -"The *iterables* are collected immediately rather than lazily, unless a " -"*buffersize* is specified to limit the number of submitted tasks whose " -"results have not yet been yielded. If the buffer is full, iteration over the " -"*iterables* pauses until a result is yielded from the buffer." +#: ../../library/concurrent.futures.rst:45 +msgid "the *iterables* are collected immediately rather than lazily;" msgstr "" -#: ../../library/concurrent.futures.rst:53 +#: ../../library/concurrent.futures.rst:47 msgid "" -"*fn* is executed asynchronously and several calls to *fn* may be made " +"*func* is executed asynchronously and several calls to *func* may be made " "concurrently." msgstr "" -#: ../../library/concurrent.futures.rst:56 +#: ../../library/concurrent.futures.rst:50 msgid "" -"The returned iterator raises a :exc:`TimeoutError` if :meth:`~iterator." -"__next__` is called and the result isn't available after *timeout* seconds " -"from the original call to :meth:`Executor.map`. *timeout* can be an int or a " -"float. If *timeout* is not specified or ``None``, there is no limit to the " -"wait time." +"The returned iterator raises a :exc:`concurrent.futures.TimeoutError` if :" +"meth:`~iterator.__next__` is called and the result isn't available after " +"*timeout* seconds from the original call to :meth:`Executor.map`. *timeout* " +"can be an int or a float. If *timeout* is not specified or ``None``, there " +"is no limit to the wait time." msgstr "" -"もし :meth:`~iterator.__next__` が呼ばれその結果が元々の :meth:`Executor." -"map` の呼び出しから *timeout* 秒経った後も利用できない場合、返されるイテレー" -"タは :exc:`TimeoutError` を送出します。*timeout* は整数または浮動小数点数で" -"す。もし *timeout* が指定されないか の場合、待ち時間に制限はありません。" +"もし :meth:`~iterator.__next__` が呼ばれその結果が元々の呼び出しから " +"*timeout* 秒経った後も利用できない場合、返されるイテレータは :exc:" +"`concurrent.futures.TimeoutError` を送出します。*timeout* は整数または浮動小" +"数点数です。もし *timeout* が指定されないか の場合、待ち時間に制限はありませ" +"ん。" -#: ../../library/concurrent.futures.rst:62 +#: ../../library/concurrent.futures.rst:56 msgid "" -"If a *fn* call raises an exception, then that exception will be raised when " -"its value is retrieved from the iterator." +"If a *func* call raises an exception, then that exception will be raised " +"when its value is retrieved from the iterator." msgstr "" +"もし *func* の呼び出しが例外を送出した場合、その例外はイテレータから値を受け" +"取る時に送出されます。" -#: ../../library/concurrent.futures.rst:65 +#: ../../library/concurrent.futures.rst:59 msgid "" "When using :class:`ProcessPoolExecutor`, this method chops *iterables* into " "a number of chunks which it submits to the pool as separate tasks. The " "(approximate) size of these chunks can be specified by setting *chunksize* " "to a positive integer. For very long iterables, using a large value for " "*chunksize* can significantly improve performance compared to the default " -"size of 1. With :class:`ThreadPoolExecutor` and :class:" -"`InterpreterPoolExecutor`, *chunksize* has no effect." -msgstr "" - -#: ../../library/concurrent.futures.rst:74 -msgid "Added the *chunksize* parameter." +"size of 1. With :class:`ThreadPoolExecutor`, *chunksize* has no effect." msgstr "" -#: ../../library/concurrent.futures.rst:77 -msgid "Added the *buffersize* parameter." -msgstr "" +#: ../../library/concurrent.futures.rst:67 +msgid "Added the *chunksize* argument." +msgstr "*chunksize* 引数が追加されました。" -#: ../../library/concurrent.futures.rst:82 +#: ../../library/concurrent.futures.rst:72 msgid "" "Signal the executor that it should free any resources that it is using when " "the currently pending futures are done executing. Calls to :meth:`Executor." @@ -164,7 +147,7 @@ msgstr "" "submit` と :meth:`Executor.map` を呼び出すと :exc:`RuntimeError` が送出されま" "す。" -#: ../../library/concurrent.futures.rst:87 +#: ../../library/concurrent.futures.rst:77 msgid "" "If *wait* is ``True`` then this method will not return until all the pending " "futures are done executing and the resources associated with the executor " @@ -181,21 +164,21 @@ msgstr "" "れます。 *wait* の値に関係なく、すべての未完了のフューチャの実行が完了するま" "で Python プログラム全体は終了しません。" -#: ../../library/concurrent.futures.rst:95 +#: ../../library/concurrent.futures.rst:85 msgid "" "If *cancel_futures* is ``True``, this method will cancel all pending futures " "that the executor has not started running. Any futures that are completed or " "running won't be cancelled, regardless of the value of *cancel_futures*." msgstr "" -#: ../../library/concurrent.futures.rst:100 +#: ../../library/concurrent.futures.rst:90 msgid "" "If both *cancel_futures* and *wait* are ``True``, all futures that the " "executor has started running will be completed prior to this method " "returning. The remaining futures are cancelled." msgstr "" -#: ../../library/concurrent.futures.rst:104 +#: ../../library/concurrent.futures.rst:94 msgid "" "You can avoid having to call this method explicitly if you use the :keyword:" "`with` statement, which will shutdown the :class:`Executor` (waiting as if :" @@ -206,25 +189,15 @@ msgstr "" "(*wait* を ``True`` にセットして :meth:`Executor.shutdown` が呼ばれたかのよう" "に待ちます)。" -#: ../../library/concurrent.futures.rst:109 -msgid "" -"import shutil\n" -"with ThreadPoolExecutor(max_workers=4) as e:\n" -" e.submit(shutil.copy, 'src1.txt', 'dest1.txt')\n" -" e.submit(shutil.copy, 'src2.txt', 'dest2.txt')\n" -" e.submit(shutil.copy, 'src3.txt', 'dest3.txt')\n" -" e.submit(shutil.copy, 'src4.txt', 'dest4.txt')" -msgstr "" - -#: ../../library/concurrent.futures.rst:116 +#: ../../library/concurrent.futures.rst:106 msgid "Added *cancel_futures*." msgstr "*cancel_futures* が追加されました。" -#: ../../library/concurrent.futures.rst:121 +#: ../../library/concurrent.futures.rst:111 msgid "ThreadPoolExecutor" msgstr "ThreadPoolExecutor" -#: ../../library/concurrent.futures.rst:123 +#: ../../library/concurrent.futures.rst:113 msgid "" ":class:`ThreadPoolExecutor` is an :class:`Executor` subclass that uses a " "pool of threads to execute calls asynchronously." @@ -232,7 +205,7 @@ msgstr "" ":class:`ThreadPoolExecutor` はスレッドのプールを使用して非同期に呼び出しを行" "う、 :class:`Executor` のサブクラスです。" -#: ../../library/concurrent.futures.rst:126 +#: ../../library/concurrent.futures.rst:116 msgid "" "Deadlocks can occur when the callable associated with a :class:`Future` " "waits on the results of another :class:`Future`. For example::" @@ -240,42 +213,11 @@ msgstr "" ":class:`Future` に関連づけられた呼び出し可能オブジェクトが、別の :class:" "`Future` の結果を待つ時にデッドロックすることがあります。例::" -#: ../../library/concurrent.futures.rst:129 -msgid "" -"import time\n" -"def wait_on_b():\n" -" time.sleep(5)\n" -" print(b.result()) # b will never complete because it is waiting on a.\n" -" return 5\n" -"\n" -"def wait_on_a():\n" -" time.sleep(5)\n" -" print(a.result()) # a will never complete because it is waiting on b.\n" -" return 6\n" -"\n" -"\n" -"executor = ThreadPoolExecutor(max_workers=2)\n" -"a = executor.submit(wait_on_b)\n" -"b = executor.submit(wait_on_a)" -msgstr "" - -#: ../../library/concurrent.futures.rst:145 +#: ../../library/concurrent.futures.rst:135 msgid "And::" msgstr "以下でも同様です::" -#: ../../library/concurrent.futures.rst:147 -msgid "" -"def wait_on_future():\n" -" f = executor.submit(pow, 5, 2)\n" -" # This will never complete because there is only one worker thread and\n" -" # it is executing this function.\n" -" print(f.result())\n" -"\n" -"executor = ThreadPoolExecutor(max_workers=1)\n" -"executor.submit(wait_on_future)" -msgstr "" - -#: ../../library/concurrent.futures.rst:159 +#: ../../library/concurrent.futures.rst:149 msgid "" "An :class:`Executor` subclass that uses a pool of at most *max_workers* " "threads to execute calls asynchronously." @@ -283,17 +225,7 @@ msgstr "" "最大で *max_workers* 個のスレッドを非同期実行に使う :class:`Executor` のサブ" "クラスです。" -#: ../../library/concurrent.futures.rst:162 -msgid "" -"All threads enqueued to ``ThreadPoolExecutor`` will be joined before the " -"interpreter can exit. Note that the exit handler which does this is executed " -"*before* any exit handlers added using ``atexit``. This means exceptions in " -"the main thread must be caught and handled in order to signal threads to " -"exit gracefully. For this reason, it is recommended that " -"``ThreadPoolExecutor`` not be used for long-running tasks." -msgstr "" - -#: ../../library/concurrent.futures.rst:169 +#: ../../library/concurrent.futures.rst:152 msgid "" "*initializer* is an optional callable that is called at the start of each " "worker thread; *initargs* is a tuple of arguments passed to the " @@ -302,7 +234,7 @@ msgid "" "well as any attempt to submit more jobs to the pool." msgstr "" -#: ../../library/concurrent.futures.rst:175 +#: ../../library/concurrent.futures.rst:158 msgid "" "If *max_workers* is ``None`` or not given, it will default to the number of " "processors on the machine, multiplied by ``5``, assuming that :class:" @@ -316,19 +248,22 @@ msgstr "" "`ProcessPoolExecutor` のワーカーの数よりもこのワーカーの数を増やすべきである" "という想定に基づいています。" -#: ../../library/concurrent.futures.rst:183 +#: ../../library/concurrent.futures.rst:166 msgid "" -"Added the *thread_name_prefix* parameter to allow users to control the :" +"The *thread_name_prefix* argument was added to allow users to control the :" "class:`threading.Thread` names for worker threads created by the pool for " "easier debugging." msgstr "" +"*thread_name_prefix* 引数が追加され、デバッグしやすくなるようにプールから作ら" +"れたワーカスレッド :class:`threading.Thread` の名前を管理できるようになりまし" +"た。" -#: ../../library/concurrent.futures.rst:188 -#: ../../library/concurrent.futures.rst:401 +#: ../../library/concurrent.futures.rst:171 +#: ../../library/concurrent.futures.rst:265 msgid "Added the *initializer* and *initargs* arguments." msgstr "*initializer* と *initargs* 引数が追加されました。" -#: ../../library/concurrent.futures.rst:191 +#: ../../library/concurrent.futures.rst:174 msgid "" "Default value of *max_workers* is changed to ``min(32, os.cpu_count() + " "4)``. This default value preserves at least 5 workers for I/O bound tasks. " @@ -336,190 +271,21 @@ msgid "" "And it avoids using very large resources implicitly on many-core machines." msgstr "" -#: ../../library/concurrent.futures.rst:197 +#: ../../library/concurrent.futures.rst:180 msgid "" "ThreadPoolExecutor now reuses idle worker threads before starting " "*max_workers* worker threads too." msgstr "" -#: ../../library/concurrent.futures.rst:200 -msgid "" -"Default value of *max_workers* is changed to ``min(32, (os." -"process_cpu_count() or 1) + 4)``." -msgstr "" - -#: ../../library/concurrent.futures.rst:208 +#: ../../library/concurrent.futures.rst:187 msgid "ThreadPoolExecutor Example" msgstr "ThreadPoolExecutor の例" -#: ../../library/concurrent.futures.rst:211 -msgid "" -"import concurrent.futures\n" -"import urllib.request\n" -"\n" -"URLS = ['http://www.foxnews.com/',\n" -" 'http://www.cnn.com/',\n" -" 'http://europe.wsj.com/',\n" -" 'http://www.bbc.co.uk/',\n" -" 'http://nonexistent-subdomain.python.org/']\n" -"\n" -"# Retrieve a single page and report the URL and contents\n" -"def load_url(http://github.com/url,%20timeout):\n" -" with urllib.request.urlopen(url, timeout=timeout) as conn:\n" -" return conn.read()\n" -"\n" -"# We can use a with statement to ensure threads are cleaned up promptly\n" -"with concurrent.futures.ThreadPoolExecutor(max_workers=5) as executor:\n" -" # Start the load operations and mark each future with its URL\n" -" future_to_url = {executor.submit(load_url, url, 60): url for url in " -"URLS}\n" -" for future in concurrent.futures.as_completed(future_to_url):\n" -" url = future_to_url[future]\n" -" try:\n" -" data = future.result()\n" -" except Exception as exc:\n" -" print('%r generated an exception: %s' % (url, exc))\n" -" else:\n" -" print('%r page is %d bytes' % (url, len(data)))" -msgstr "" - -#: ../../library/concurrent.futures.rst:240 -msgid "InterpreterPoolExecutor" -msgstr "" - -#: ../../library/concurrent.futures.rst:242 -msgid "" -"The :class:`InterpreterPoolExecutor` class uses a pool of interpreters to " -"execute calls asynchronously. It is a :class:`ThreadPoolExecutor` subclass, " -"which means each worker is running in its own thread. The difference here is " -"that each worker has its own interpreter, and runs each task using that " -"interpreter." -msgstr "" - -#: ../../library/concurrent.futures.rst:248 -msgid "" -"The biggest benefit to using interpreters instead of only threads is true " -"multi-core parallelism. Each interpreter has its own :term:`Global " -"Interpreter Lock `, so code running in one " -"interpreter can run on one CPU core, while code in another interpreter runs " -"unblocked on a different core." -msgstr "" - -#: ../../library/concurrent.futures.rst:254 -msgid "" -"The tradeoff is that writing concurrent code for use with multiple " -"interpreters can take extra effort. However, this is because it forces you " -"to be deliberate about how and when interpreters interact, and to be " -"explicit about what data is shared between interpreters. This results in " -"several benefits that help balance the extra effort, including true multi-" -"core parallelism, For example, code written this way can make it easier to " -"reason about concurrency. Another major benefit is that you don't have to " -"deal with several of the big pain points of using threads, like race " -"conditions." -msgstr "" - -#: ../../library/concurrent.futures.rst:264 -msgid "" -"Each worker's interpreter is isolated from all the other interpreters. " -"\"Isolated\" means each interpreter has its own runtime state and operates " -"completely independently. For example, if you redirect :data:`sys.stdout` " -"in one interpreter, it will not be automatically redirected any other " -"interpreter. If you import a module in one interpreter, it is not " -"automatically imported in any other. You would need to import the module " -"separately in interpreter where you need it. In fact, each module imported " -"in an interpreter is a completely separate object from the same module in a " -"different interpreter, including :mod:`sys`, :mod:`builtins`, and even " -"``__main__``." -msgstr "" - -#: ../../library/concurrent.futures.rst:276 -msgid "" -"Isolation means a mutable object, or other data, cannot be used by more than " -"one interpreter at the same time. That effectively means interpreters " -"cannot actually share such objects or data. Instead, each interpreter must " -"have its own copy, and you will have to synchronize any changes between the " -"copies manually. Immutable objects and data, like the builtin singletons, " -"strings, and tuples of immutable objects, don't have these limitations." -msgstr "" - -#: ../../library/concurrent.futures.rst:284 -msgid "" -"Communicating and synchronizing between interpreters is most effectively " -"done using dedicated tools, like those proposed in :pep:`734`. One less " -"efficient alternative is to serialize with :mod:`pickle` and then send the " -"bytes over a shared :mod:`socket ` or :func:`pipe `." -msgstr "" - -#: ../../library/concurrent.futures.rst:292 -msgid "" -"A :class:`ThreadPoolExecutor` subclass that executes calls asynchronously " -"using a pool of at most *max_workers* threads. Each thread runs tasks in " -"its own interpreter. The worker interpreters are isolated from each other, " -"which means each has its own runtime state and that they can't share any " -"mutable objects or other data. Each interpreter has its own :term:`Global " -"Interpreter Lock `, which means code run with this " -"executor has true multi-core parallelism." -msgstr "" - -#: ../../library/concurrent.futures.rst:300 -msgid "" -"The optional *initializer* and *initargs* arguments have the same meaning as " -"for :class:`!ThreadPoolExecutor`: the initializer is run when each worker is " -"created, though in this case it is run in the worker's interpreter. The " -"executor serializes the *initializer* and *initargs* using :mod:`pickle` " -"when sending them to the worker's interpreter." -msgstr "" - -#: ../../library/concurrent.futures.rst:308 -#: ../../library/concurrent.futures.rst:330 -msgid "" -"Functions defined in the ``__main__`` module cannot be pickled and thus " -"cannot be used." -msgstr "" - -#: ../../library/concurrent.futures.rst:312 -msgid "" -"The executor may replace uncaught exceptions from *initializer* with :class:" -"`~concurrent.futures.interpreter.ExecutionFailed`." -msgstr "" - -#: ../../library/concurrent.futures.rst:315 -msgid "" -"The optional *shared* argument is a :class:`dict` of objects that all " -"interpreters in the pool share. The *shared* items are added to each " -"interpreter's ``__main__`` module. Not all objects are shareable. Shareable " -"objects include the builtin singletons, :class:`str` and :class:`bytes`, " -"and :class:`memoryview`. See :pep:`734` for more info." -msgstr "" - -#: ../../library/concurrent.futures.rst:322 -msgid "Other caveats from parent :class:`ThreadPoolExecutor` apply here." -msgstr "" - -#: ../../library/concurrent.futures.rst:324 -msgid "" -":meth:`~Executor.submit` and :meth:`~Executor.map` work like normal, except " -"the worker serializes the callable and arguments using :mod:`pickle` when " -"sending them to its interpreter. The worker likewise serializes the return " -"value when sending it back." -msgstr "" - -#: ../../library/concurrent.futures.rst:333 -msgid "" -"When a worker's current task raises an uncaught exception, the worker always " -"tries to preserve the exception as-is. If that is successful then it also " -"sets the ``__cause__`` to a corresponding :class:`~concurrent.futures." -"interpreter.ExecutionFailed` instance, which contains a summary of the " -"original exception. In the uncommon case that the worker is not able to " -"preserve the original as-is then it directly preserves the corresponding :" -"class:`~concurrent.futures.interpreter.ExecutionFailed` instance instead." -msgstr "" - -#: ../../library/concurrent.futures.rst:345 +#: ../../library/concurrent.futures.rst:219 msgid "ProcessPoolExecutor" msgstr "ProcessPoolExecutor" -#: ../../library/concurrent.futures.rst:347 +#: ../../library/concurrent.futures.rst:221 msgid "" "The :class:`ProcessPoolExecutor` class is an :class:`Executor` subclass that " "uses a pool of processes to execute calls asynchronously. :class:" @@ -534,7 +300,7 @@ msgstr "" "Lock ` を回避することができますが、pickle 化できるオ" "ブジェクトしか実行したり返したりすることができません。" -#: ../../library/concurrent.futures.rst:354 +#: ../../library/concurrent.futures.rst:228 msgid "" "The ``__main__`` module must be importable by worker subprocesses. This " "means that :class:`ProcessPoolExecutor` will not work in the interactive " @@ -545,7 +311,7 @@ msgstr "" "すなわち、 :class:`ProcessPoolExecutor` は対話的インタープリタでは動きませ" "ん。" -#: ../../library/concurrent.futures.rst:357 +#: ../../library/concurrent.futures.rst:231 msgid "" "Calling :class:`Executor` or :class:`Future` methods from a callable " "submitted to a :class:`ProcessPoolExecutor` will result in deadlock." @@ -553,22 +319,21 @@ msgstr "" ":class:`ProcessPoolExecutor` に渡された呼び出し可能オブジェクトから :class:" "`Executor` や :class:`Future` メソッドを呼ぶとデッドロックに陥ります。" -#: ../../library/concurrent.futures.rst:362 +#: ../../library/concurrent.futures.rst:236 msgid "" "An :class:`Executor` subclass that executes calls asynchronously using a " "pool of at most *max_workers* processes. If *max_workers* is ``None`` or " -"not given, it will default to :func:`os.process_cpu_count`. If *max_workers* " -"is less than or equal to ``0``, then a :exc:`ValueError` will be raised. On " -"Windows, *max_workers* must be less than or equal to ``61``. If it is not " -"then :exc:`ValueError` will be raised. If *max_workers* is ``None``, then " -"the default chosen will be at most ``61``, even if more processors are " -"available. *mp_context* can be a :mod:`multiprocessing` context or ``None``. " -"It will be used to launch the workers. If *mp_context* is ``None`` or not " -"given, the default :mod:`multiprocessing` context is used. See :ref:" -"`multiprocessing-start-methods`." +"not given, it will default to the number of processors on the machine. If " +"*max_workers* is less than or equal to ``0``, then a :exc:`ValueError` will " +"be raised. On Windows, *max_workers* must be less than or equal to ``61``. " +"If it is not then :exc:`ValueError` will be raised. If *max_workers* is " +"``None``, then the default chosen will be at most ``61``, even if more " +"processors are available. *mp_context* can be a multiprocessing context or " +"None. It will be used to launch the workers. If *mp_context* is ``None`` or " +"not given, the default multiprocessing context is used." msgstr "" -#: ../../library/concurrent.futures.rst:376 +#: ../../library/concurrent.futures.rst:249 msgid "" "*initializer* is an optional callable that is called at the start of each " "worker process; *initargs* is a tuple of arguments passed to the " @@ -577,128 +342,33 @@ msgid "" "well as any attempt to submit more jobs to the pool." msgstr "" -#: ../../library/concurrent.futures.rst:382 -msgid "" -"*max_tasks_per_child* is an optional argument that specifies the maximum " -"number of tasks a single process can execute before it will exit and be " -"replaced with a fresh worker process. By default *max_tasks_per_child* is " -"``None`` which means worker processes will live as long as the pool. When a " -"max is specified, the \"spawn\" multiprocessing start method will be used by " -"default in absence of a *mp_context* parameter. This feature is incompatible " -"with the \"fork\" start method." -msgstr "" - -#: ../../library/concurrent.futures.rst:390 +#: ../../library/concurrent.futures.rst:255 msgid "" -"When one of the worker processes terminates abruptly, a :exc:`~concurrent." -"futures.process.BrokenProcessPool` error is now raised. Previously, " -"behaviour was undefined but operations on the executor or its futures would " -"often freeze or deadlock." +"When one of the worker processes terminates abruptly, a :exc:" +"`BrokenProcessPool` error is now raised. Previously, behaviour was " +"undefined but operations on the executor or its futures would often freeze " +"or deadlock." msgstr "" +"ワーカプロセスの1つが突然終了した場合、:exc:`BrokenProcessPool` エラーが送出" +"されるようになりました。\n" +"以前は挙動は未定義でしたが、 executor や futures がフリーズしたりデッドロッ" +"クを起こすことがしばしばでした。" -#: ../../library/concurrent.futures.rst:397 +#: ../../library/concurrent.futures.rst:261 msgid "" "The *mp_context* argument was added to allow users to control the " "start_method for worker processes created by the pool." msgstr "" -#: ../../library/concurrent.futures.rst:403 -msgid "" -"The *max_tasks_per_child* argument was added to allow users to control the " -"lifetime of workers in the pool." -msgstr "" - -#: ../../library/concurrent.futures.rst:407 -msgid "" -"On POSIX systems, if your application has multiple threads and the :mod:" -"`multiprocessing` context uses the ``\"fork\"`` start method: The :func:`os." -"fork` function called internally to spawn workers may raise a :exc:" -"`DeprecationWarning`. Pass a *mp_context* configured to use a different " -"start method. See the :func:`os.fork` documentation for further explanation." -msgstr "" - -#: ../../library/concurrent.futures.rst:415 -msgid "" -"*max_workers* uses :func:`os.process_cpu_count` by default, instead of :func:" -"`os.cpu_count`." -msgstr "" - -#: ../../library/concurrent.futures.rst:419 -msgid "" -"The default process start method (see :ref:`multiprocessing-start-methods`) " -"changed away from *fork*. If you require the *fork* start method for :class:" -"`ProcessPoolExecutor` you must explicitly pass ``mp_context=multiprocessing." -"get_context(\"fork\")``." -msgstr "" - -#: ../../library/concurrent.futures.rst:427 -msgid "" -"Attempt to terminate all living worker processes immediately by calling :" -"meth:`Process.terminate ` on each of " -"them. Internally, it will also call :meth:`Executor.shutdown` to ensure that " -"all other resources associated with the executor are freed." -msgstr "" - -#: ../../library/concurrent.futures.rst:432 -#: ../../library/concurrent.futures.rst:444 -msgid "" -"After calling this method the caller should no longer submit tasks to the " -"executor." -msgstr "" - -#: ../../library/concurrent.futures.rst:439 -msgid "" -"Attempt to kill all living worker processes immediately by calling :meth:" -"`Process.kill ` on each of them. Internally, " -"it will also call :meth:`Executor.shutdown` to ensure that all other " -"resources associated with the executor are freed." -msgstr "" - -#: ../../library/concurrent.futures.rst:452 +#: ../../library/concurrent.futures.rst:271 msgid "ProcessPoolExecutor Example" msgstr "ProcessPoolExecutor の例" -#: ../../library/concurrent.futures.rst:455 -msgid "" -"import concurrent.futures\n" -"import math\n" -"\n" -"PRIMES = [\n" -" 112272535095293,\n" -" 112582705942171,\n" -" 112272535095293,\n" -" 115280095190773,\n" -" 115797848077099,\n" -" 1099726899285419]\n" -"\n" -"def is_prime(n):\n" -" if n < 2:\n" -" return False\n" -" if n == 2:\n" -" return True\n" -" if n % 2 == 0:\n" -" return False\n" -"\n" -" sqrt_n = int(math.floor(math.sqrt(n)))\n" -" for i in range(3, sqrt_n + 1, 2):\n" -" if n % i == 0:\n" -" return False\n" -" return True\n" -"\n" -"def main():\n" -" with concurrent.futures.ProcessPoolExecutor() as executor:\n" -" for number, prime in zip(PRIMES, executor.map(is_prime, PRIMES)):\n" -" print('%d is prime: %s' % (number, prime))\n" -"\n" -"if __name__ == '__main__':\n" -" main()" -msgstr "" - -#: ../../library/concurrent.futures.rst:490 +#: ../../library/concurrent.futures.rst:309 msgid "Future Objects" msgstr "Future オブジェクト" -#: ../../library/concurrent.futures.rst:492 +#: ../../library/concurrent.futures.rst:311 msgid "" "The :class:`Future` class encapsulates the asynchronous execution of a " "callable. :class:`Future` instances are created by :meth:`Executor.submit`." @@ -707,7 +377,7 @@ msgstr "" "す。 :class:`Future` のインスタンスは :meth:`Executor.submit` によって生成さ" "れます。" -#: ../../library/concurrent.futures.rst:497 +#: ../../library/concurrent.futures.rst:316 msgid "" "Encapsulates the asynchronous execution of a callable. :class:`Future` " "instances are created by :meth:`Executor.submit` and should not be created " @@ -717,7 +387,7 @@ msgstr "" "スタンスは :meth:`Executor.submit` で生成され、テストを除いて直接生成すべきで" "はありません。" -#: ../../library/concurrent.futures.rst:503 +#: ../../library/concurrent.futures.rst:322 msgid "" "Attempt to cancel the call. If the call is currently being executed or " "finished running and cannot be cancelled then the method will return " @@ -725,37 +395,37 @@ msgid "" "``True``." msgstr "" -#: ../../library/concurrent.futures.rst:510 +#: ../../library/concurrent.futures.rst:329 msgid "Return ``True`` if the call was successfully cancelled." msgstr "呼び出しが正常にキャンセルされた場合 ``True`` を返します。" -#: ../../library/concurrent.futures.rst:514 +#: ../../library/concurrent.futures.rst:333 msgid "" "Return ``True`` if the call is currently being executed and cannot be " "cancelled." msgstr "現在呼び出しが実行中でキャンセルできない場合 ``True`` を返します。" -#: ../../library/concurrent.futures.rst:519 +#: ../../library/concurrent.futures.rst:338 msgid "" "Return ``True`` if the call was successfully cancelled or finished running." msgstr "呼び出しが正常にキャンセルされたか終了した場合 ``True`` を返します。" -#: ../../library/concurrent.futures.rst:524 +#: ../../library/concurrent.futures.rst:343 msgid "" "Return the value returned by the call. If the call hasn't yet completed then " "this method will wait up to *timeout* seconds. If the call hasn't completed " -"in *timeout* seconds, then a :exc:`TimeoutError` will be raised. *timeout* " -"can be an int or float. If *timeout* is not specified or ``None``, there is " -"no limit to the wait time." +"in *timeout* seconds, then a :exc:`concurrent.futures.TimeoutError` will be " +"raised. *timeout* can be an int or float. If *timeout* is not specified or " +"``None``, there is no limit to the wait time." msgstr "" -"呼び出しによって返された値を返します。もし呼び出しがまだ完了していなければ、" -"このメソッドは *timeout* 秒の間、待機します。もし呼び出しが *timeout* 秒間の" -"間に完了しなければ、 :exc:`TimeoutError` が送出されます。 *timeout* はintか" -"floatを指定できます。もし *timeout* が指定されていないか、 ``None`` であれ" -"ば、待機時間に制限はありません。" +"呼び出しによって返された値を返します。呼び出しがまだ完了していない場合、この" +"メソッドは *timeout* 秒の間待機します。呼び出しが *timeout* 秒間の間に完了し" +"ない場合、 :exc:`concurrent.futures.TimeoutError` が送出されます。 *timeout* " +"にはintかfloatを指定できます。*timeout* が指定されていないか、 ``None`` であ" +"る場合、待機時間に制限はありません。" -#: ../../library/concurrent.futures.rst:531 -#: ../../library/concurrent.futures.rst:545 +#: ../../library/concurrent.futures.rst:350 +#: ../../library/concurrent.futures.rst:364 msgid "" "If the future is cancelled before completing then :exc:`.CancelledError` " "will be raised." @@ -763,30 +433,30 @@ msgstr "" "future が完了する前にキャンセルされた場合 :exc:`CancelledError` が送出されま" "す。" -#: ../../library/concurrent.futures.rst:534 +#: ../../library/concurrent.futures.rst:353 msgid "" "If the call raised an exception, this method will raise the same exception." msgstr "" -#: ../../library/concurrent.futures.rst:538 +#: ../../library/concurrent.futures.rst:357 msgid "" "Return the exception raised by the call. If the call hasn't yet completed " "then this method will wait up to *timeout* seconds. If the call hasn't " -"completed in *timeout* seconds, then a :exc:`TimeoutError` will be raised. " -"*timeout* can be an int or float. If *timeout* is not specified or " -"``None``, there is no limit to the wait time." +"completed in *timeout* seconds, then a :exc:`concurrent.futures." +"TimeoutError` will be raised. *timeout* can be an int or float. If " +"*timeout* is not specified or ``None``, there is no limit to the wait time." msgstr "" -"呼び出しによって送出された例外を返します。もし呼び出しがまだ完了されていなけ" -"れば、このメソッドは *timeout* 秒だけ待機します。もし呼び出しが *timeout* 秒" -"の間に完了しなければ、 :exc:`TimeoutError` が送出されます。 *timeout* にはint" -"かfloatを指定できます。 *timeout* が指定されていないか、 ``None`` であれば、" -"待機時間に制限はありません。" +"呼び出しによって送出された例外を返します。呼び出しがまだ完了していない場合、" +"このメソッドは *timeout* 秒だけ待機します。呼び出しが *timeout* 秒の間に完了" +"しない場合、 :exc:`concurrent.futures.TimeoutError` が送出されます。 " +"*timeout* にはintかfloatを指定できます。 *timeout* が指定されていないか、 " +"``None`` である場合、待機時間に制限はありません。" -#: ../../library/concurrent.futures.rst:548 +#: ../../library/concurrent.futures.rst:367 msgid "If the call completed without raising, ``None`` is returned." msgstr "呼び出しが例外を送出することなく完了した場合、``None`` を返します。" -#: ../../library/concurrent.futures.rst:552 +#: ../../library/concurrent.futures.rst:371 msgid "" "Attaches the callable *fn* to the future. *fn* will be called, with the " "future as its only argument, when the future is cancelled or finishes " @@ -796,7 +466,7 @@ msgstr "" "ルされたか、実行を終了した際に、future をそのただ一つの引数として *fn* が呼び" "出されます。" -#: ../../library/concurrent.futures.rst:556 +#: ../../library/concurrent.futures.rst:375 msgid "" "Added callables are called in the order that they were added and are always " "called in a thread belonging to the process that added them. If the " @@ -810,7 +480,7 @@ msgstr "" "ます。呼び出し可能オブジェクトが :exc:`BaseException` のサブクラスを送出した" "場合の動作は未定義です。" -#: ../../library/concurrent.futures.rst:562 +#: ../../library/concurrent.futures.rst:381 msgid "" "If the future has already completed or been cancelled, *fn* will be called " "immediately." @@ -818,7 +488,7 @@ msgstr "" "もしfutureがすでに完了しているか、キャンセル済みであれば、*fn* は即座に実行さ" "れます。" -#: ../../library/concurrent.futures.rst:565 +#: ../../library/concurrent.futures.rst:384 msgid "" "The following :class:`Future` methods are meant for use in unit tests and :" "class:`Executor` implementations." @@ -826,7 +496,7 @@ msgstr "" "以下の :class:`Future` メソッドは、ユニットテストでの使用と :class:" "`Executor` を実装することを意図しています。" -#: ../../library/concurrent.futures.rst:570 +#: ../../library/concurrent.futures.rst:389 msgid "" "This method should only be called by :class:`Executor` implementations " "before executing the work associated with the :class:`Future` and by unit " @@ -835,29 +505,29 @@ msgstr "" "このメソッドは、:class:`Future` に関連付けられたワークやユニットテストによる" "ワークの実行前に、 :class:`Executor` の実装によってのみ呼び出してください。" -#: ../../library/concurrent.futures.rst:574 +#: ../../library/concurrent.futures.rst:393 msgid "" "If the method returns ``False`` then the :class:`Future` was cancelled, i." -"e. :meth:`Future.cancel` was called and returned ``True``. Any threads " +"e. :meth:`Future.cancel` was called and returned `True`. Any threads " "waiting on the :class:`Future` completing (i.e. through :func:`as_completed` " "or :func:`wait`) will be woken up." msgstr "" "このメソッドが ``False`` を返す場合、 :class:`Future` はキャンセルされていま" -"す。つまり、 :meth:`Future.cancel` が呼び出されて ``True`` が返っています。:" +"す。つまり、 :meth:`Future.cancel` が呼び出されて `True` が返っています。:" "class:`Future` の完了を (:func:`as_completed` または :func:`wait` により) " "待機するすべてのスレッドが起動します。" -#: ../../library/concurrent.futures.rst:579 +#: ../../library/concurrent.futures.rst:398 msgid "" "If the method returns ``True`` then the :class:`Future` was not cancelled " "and has been put in the running state, i.e. calls to :meth:`Future.running` " -"will return ``True``." +"will return `True`." msgstr "" "このメソッドが ``True`` を返す場合、 :class:`Future` はキャンセルされて、実行" -"状態に移行されています。つまり、 :meth:`Future.running` を呼び出すと " -"``True`` が返ります。" +"状態に移行されています。つまり、 :meth:`Future.running` を呼び出すと `True` " +"が返ります。" -#: ../../library/concurrent.futures.rst:583 +#: ../../library/concurrent.futures.rst:402 msgid "" "This method can only be called once and cannot be called after :meth:`Future." "set_result` or :meth:`Future.set_exception` have been called." @@ -866,13 +536,13 @@ msgstr "" "は :meth:`Future.set_exception` がキャンセルされた後には呼び出すことができま" "せん。" -#: ../../library/concurrent.futures.rst:589 +#: ../../library/concurrent.futures.rst:408 msgid "" "Sets the result of the work associated with the :class:`Future` to *result*." msgstr ":class:`Future` に関連付けられたワークの結果を *result* に設定します。" -#: ../../library/concurrent.futures.rst:592 -#: ../../library/concurrent.futures.rst:605 +#: ../../library/concurrent.futures.rst:411 +#: ../../library/concurrent.futures.rst:424 msgid "" "This method should only be used by :class:`Executor` implementations and " "unit tests." @@ -880,14 +550,14 @@ msgstr "" "このメソッドは、 :class:`Executor` の実装またはユニットテストによってのみ使用" "してください。" -#: ../../library/concurrent.futures.rst:595 -#: ../../library/concurrent.futures.rst:608 +#: ../../library/concurrent.futures.rst:414 +#: ../../library/concurrent.futures.rst:427 msgid "" "This method raises :exc:`concurrent.futures.InvalidStateError` if the :class:" "`Future` is already done." msgstr "" -#: ../../library/concurrent.futures.rst:602 +#: ../../library/concurrent.futures.rst:421 msgid "" "Sets the result of the work associated with the :class:`Future` to the :" "class:`Exception` *exception*." @@ -895,22 +565,21 @@ msgstr "" ":class:`Future` に関連付けられたワークの結果を :class:`Exception` " "*exception* に設定します。" -#: ../../library/concurrent.futures.rst:614 +#: ../../library/concurrent.futures.rst:433 msgid "Module Functions" msgstr "モジュール関数" -#: ../../library/concurrent.futures.rst:618 +#: ../../library/concurrent.futures.rst:437 msgid "" "Wait for the :class:`Future` instances (possibly created by different :class:" -"`Executor` instances) given by *fs* to complete. Duplicate futures given to " -"*fs* are removed and will be returned only once. Returns a named 2-tuple of " +"`Executor` instances) given by *fs* to complete. Returns a named 2-tuple of " "sets. The first set, named ``done``, contains the futures that completed " "(finished or cancelled futures) before the wait completed. The second set, " "named ``not_done``, contains the futures that did not complete (pending or " "running futures)." msgstr "" -#: ../../library/concurrent.futures.rst:626 +#: ../../library/concurrent.futures.rst:444 msgid "" "*timeout* can be used to control the maximum number of seconds to wait " "before returning. *timeout* can be an int or float. If *timeout* is not " @@ -920,7 +589,7 @@ msgstr "" "浮動小数点数をとります。*timeout* が指定されないか ``None`` の場合、無期限に" "待機します。" -#: ../../library/concurrent.futures.rst:630 +#: ../../library/concurrent.futures.rst:448 msgid "" "*return_when* indicates when this function should return. It must be one of " "the following constants:" @@ -928,108 +597,107 @@ msgstr "" "*return_when* でこの関数がいつ結果を返すか指定します。指定できる値は以下の 定" "数のどれか一つです:" -#: ../../library/concurrent.futures.rst:636 +#: ../../library/concurrent.futures.rst:454 msgid "Constant" msgstr "定数" -#: ../../library/concurrent.futures.rst:637 +#: ../../library/concurrent.futures.rst:454 msgid "Description" msgstr "説明" -#: ../../library/concurrent.futures.rst:640 +#: ../../library/concurrent.futures.rst:456 +msgid ":const:`FIRST_COMPLETED`" +msgstr ":const:`FIRST_COMPLETED`" + +#: ../../library/concurrent.futures.rst:456 msgid "The function will return when any future finishes or is cancelled." msgstr "いずれかのフューチャが終了したかキャンセルされたときに返します。" -#: ../../library/concurrent.futures.rst:643 +#: ../../library/concurrent.futures.rst:459 +msgid ":const:`FIRST_EXCEPTION`" +msgstr ":const:`FIRST_EXCEPTION`" + +#: ../../library/concurrent.futures.rst:459 msgid "" -"The function will return when any future finishes by raising an exception. " +"The function will return when any future finishes by raising an exception. " "If no future raises an exception then it is equivalent to :const:" "`ALL_COMPLETED`." msgstr "" +"いずれかのフューチャが例外の送出で終了した場合に返します。例外を送出した" +"フューチャがない場合は、:const:`ALL_COMPLETED` と等価になります。" -#: ../../library/concurrent.futures.rst:648 +#: ../../library/concurrent.futures.rst:465 +msgid ":const:`ALL_COMPLETED`" +msgstr ":const:`ALL_COMPLETED`" + +#: ../../library/concurrent.futures.rst:465 msgid "The function will return when all futures finish or are cancelled." msgstr "すべてのフューチャが終了したかキャンセルされたときに返します。" -#: ../../library/concurrent.futures.rst:652 +#: ../../library/concurrent.futures.rst:471 msgid "" "Returns an iterator over the :class:`Future` instances (possibly created by " "different :class:`Executor` instances) given by *fs* that yields futures as " "they complete (finished or cancelled futures). Any futures given by *fs* " "that are duplicated will be returned once. Any futures that completed " "before :func:`as_completed` is called will be yielded first. The returned " -"iterator raises a :exc:`TimeoutError` if :meth:`~iterator.__next__` is " -"called and the result isn't available after *timeout* seconds from the " -"original call to :func:`as_completed`. *timeout* can be an int or float. If " -"*timeout* is not specified or ``None``, there is no limit to the wait time." +"iterator raises a :exc:`concurrent.futures.TimeoutError` if :meth:`~iterator." +"__next__` is called and the result isn't available after *timeout* seconds " +"from the original call to :func:`as_completed`. *timeout* can be an int or " +"float. If *timeout* is not specified or ``None``, there is no limit to the " +"wait time." msgstr "" -#: ../../library/concurrent.futures.rst:665 +#: ../../library/concurrent.futures.rst:485 msgid ":pep:`3148` -- futures - execute computations asynchronously" msgstr ":pep:`3148` -- futures - execute computations asynchronously" -#: ../../library/concurrent.futures.rst:666 +#: ../../library/concurrent.futures.rst:485 msgid "" "The proposal which described this feature for inclusion in the Python " "standard library." msgstr "この機能を Python 標準ライブラリに含めることを述べた提案です。" -#: ../../library/concurrent.futures.rst:671 +#: ../../library/concurrent.futures.rst:490 msgid "Exception classes" msgstr "例外クラス" -#: ../../library/concurrent.futures.rst:677 +#: ../../library/concurrent.futures.rst:496 msgid "Raised when a future is cancelled." msgstr "future がキャンセルされたときに送出されます。" -#: ../../library/concurrent.futures.rst:681 -msgid "" -"A deprecated alias of :exc:`TimeoutError`, raised when a future operation " -"exceeds the given timeout." -msgstr "" - -#: ../../library/concurrent.futures.rst:686 -msgid "This class was made an alias of :exc:`TimeoutError`." -msgstr "このクラスは :exc:`TimeoutError` のエイリアスになりました。" +#: ../../library/concurrent.futures.rst:500 +msgid "Raised when a future operation exceeds the given timeout." +msgstr "future の操作が与えられたタイムアウトを超過したときに送出されます。" -#: ../../library/concurrent.futures.rst:691 +#: ../../library/concurrent.futures.rst:504 msgid "" "Derived from :exc:`RuntimeError`, this exception class is raised when an " "executor is broken for some reason, and cannot be used to submit or execute " "new tasks." msgstr "" -#: ../../library/concurrent.futures.rst:699 +#: ../../library/concurrent.futures.rst:512 msgid "" "Raised when an operation is performed on a future that is not allowed in the " "current state." msgstr "" -#: ../../library/concurrent.futures.rst:708 +#: ../../library/concurrent.futures.rst:521 msgid "" "Derived from :exc:`~concurrent.futures.BrokenExecutor`, this exception class " -"is raised when one of the workers of a :class:`~concurrent.futures." -"ThreadPoolExecutor` has failed initializing." -msgstr "" - -#: ../../library/concurrent.futures.rst:719 -msgid "" -"Derived from :exc:`~concurrent.futures.thread.BrokenThreadPool`, this " -"exception class is raised when one of the workers of a :class:`~concurrent." -"futures.InterpreterPoolExecutor` has failed initializing." +"is raised when one of the workers of a :class:`ThreadPoolExecutor` has " +"failed initializing." msgstr "" -#: ../../library/concurrent.futures.rst:728 -msgid "" -"Raised from :class:`~concurrent.futures.InterpreterPoolExecutor` when the " -"given initializer fails or from :meth:`~concurrent.futures.Executor.submit` " -"when there's an uncaught exception from the submitted task." -msgstr "" - -#: ../../library/concurrent.futures.rst:739 +#: ../../library/concurrent.futures.rst:531 msgid "" "Derived from :exc:`~concurrent.futures.BrokenExecutor` (formerly :exc:" "`RuntimeError`), this exception class is raised when one of the workers of " -"a :class:`~concurrent.futures.ProcessPoolExecutor` has terminated in a non-" -"clean fashion (for example, if it was killed from the outside)." +"a :class:`ProcessPoolExecutor` has terminated in a non-clean fashion (for " +"example, if it was killed from the outside)." msgstr "" +":exc:`~concurrent.futures.BrokenExecutor` から派生しています(以前は :exc:" +"`RuntimeError` でした)。\n" +"この例外クラスは :class:`ProcessPoolExecutor` のワーカの1つが正常に終了されな" +"かったとき (例えば外部から kill されたとき) に送出されます。" diff --git a/library/concurrent.interpreters.po b/library/concurrent.interpreters.po deleted file mode 100644 index 8c6fbd609..000000000 --- a/library/concurrent.interpreters.po +++ /dev/null @@ -1,259 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation -# This file is distributed under the same license as the Python package. -# FIRST AUTHOR , YEAR. -# -# Translators: -# 石井明久, 2025 -# tomo, 2025 -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: Python 3.14\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-13 14:21+0000\n" -"PO-Revision-Date: 2025-06-13 14:23+0000\n" -"Last-Translator: tomo, 2025\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" -"ja/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#: ../../library/concurrent.interpreters.rst:2 -msgid "" -":mod:`!concurrent.interpreters` --- Multiple interpreters in the same process" -msgstr "" - -#: ../../library/concurrent.interpreters.rst:12 -msgid "**Source code:** :source:`Lib/concurrent/interpreters.py`" -msgstr "" - -#: ../../library/concurrent.interpreters.rst:18 -msgid "Introduction" -msgstr "はじめに" - -#: ../../library/concurrent.interpreters.rst:20 -msgid "" -"The :mod:`!concurrent.interpreters` module constructs higher-level " -"interfaces on top of the lower level :mod:`!_interpreters` module." -msgstr "" - -#: ../../library/concurrent.interpreters.rst:27 -msgid ":ref:`isolating-extensions-howto`" -msgstr "" - -#: ../../library/concurrent.interpreters.rst:28 -msgid "how to update an extension module to support multiple interpreters" -msgstr "" - -#: ../../library/concurrent.interpreters.rst:30 -msgid ":pep:`554`" -msgstr "" - -#: ../../library/concurrent.interpreters.rst:32 -msgid ":pep:`734`" -msgstr "" - -#: ../../library/concurrent.interpreters.rst:34 -msgid ":pep:`684`" -msgstr "" - -#: ../../includes/wasm-notavail.rst:3 -msgid "Availability" -msgstr "" - -#: ../../includes/wasm-notavail.rst:5 -msgid "" -"This module does not work or is not available on WebAssembly. See :ref:`wasm-" -"availability` for more information." -msgstr "" -"このモジュールは WebAssembly では動作しないか、利用不可です。詳しくは、:ref:" -"`wasm-availability` を見てください。" - -#: ../../library/concurrent.interpreters.rst:42 -msgid "Key details" -msgstr "" - -#: ../../library/concurrent.interpreters.rst:44 -msgid "" -"Before we dive into examples, there are a small number of details to keep in " -"mind about using multiple interpreters:" -msgstr "" - -#: ../../library/concurrent.interpreters.rst:47 -msgid "isolated, by default" -msgstr "" - -#: ../../library/concurrent.interpreters.rst:48 -msgid "no implicit threads" -msgstr "" - -#: ../../library/concurrent.interpreters.rst:49 -msgid "not all PyPI packages support use in multiple interpreters yet" -msgstr "" - -#: ../../library/concurrent.interpreters.rst:53 -msgid "" -"In the context of multiple interpreters, \"isolated\" means that different " -"interpreters do not share any state. In practice, there is some process-" -"global data they all share, but that is managed by the runtime." -msgstr "" - -#: ../../library/concurrent.interpreters.rst:59 -msgid "Reference" -msgstr "リファレンス" - -#: ../../library/concurrent.interpreters.rst:61 -msgid "This module defines the following functions:" -msgstr "このモジュールは以下の関数を定義しています:" - -#: ../../library/concurrent.interpreters.rst:65 -msgid "" -"Return a :class:`list` of :class:`Interpreter` objects, one for each " -"existing interpreter." -msgstr "" - -#: ../../library/concurrent.interpreters.rst:70 -msgid "" -"Return an :class:`Interpreter` object for the currently running interpreter." -msgstr "" - -#: ../../library/concurrent.interpreters.rst:75 -msgid "Return an :class:`Interpreter` object for the main interpreter." -msgstr "" - -#: ../../library/concurrent.interpreters.rst:79 -msgid "" -"Initialize a new (idle) Python interpreter and return a :class:`Interpreter` " -"object for it." -msgstr "" - -#: ../../library/concurrent.interpreters.rst:84 -msgid "Interpreter objects" -msgstr "" - -#: ../../library/concurrent.interpreters.rst:88 -msgid "A single interpreter in the current process." -msgstr "" - -#: ../../library/concurrent.interpreters.rst:90 -msgid "" -"Generally, :class:`Interpreter` shouldn't be called directly. Instead, use :" -"func:`create` or one of the other module functions." -msgstr "" - -#: ../../library/concurrent.interpreters.rst:95 -#: ../../library/concurrent.interpreters.rst:101 -msgid "(read-only)" -msgstr "" - -#: ../../library/concurrent.interpreters.rst:97 -msgid "The interpreter's ID." -msgstr "" - -#: ../../library/concurrent.interpreters.rst:103 -msgid "A string describing where the interpreter came from." -msgstr "" - -#: ../../library/concurrent.interpreters.rst:107 -msgid "" -"Return ``True`` if the interpreter is currently executing code in its :mod:`!" -"__main__` module and ``False`` otherwise." -msgstr "" - -#: ../../library/concurrent.interpreters.rst:112 -msgid "Finalize and destroy the interpreter." -msgstr "" - -#: ../../library/concurrent.interpreters.rst:116 -msgid "" -"Bind \"shareable\" objects in the interpreter's :mod:`!__main__` module." -msgstr "" - -#: ../../library/concurrent.interpreters.rst:121 -msgid "Run the given source code in the interpreter (in the current thread)." -msgstr "" - -#: ../../library/concurrent.interpreters.rst:125 -msgid "" -"Return the result of calling running the given function in the interpreter " -"(in the current thread)." -msgstr "" - -#: ../../library/concurrent.interpreters.rst:130 -msgid "Run the given function in the interpreter (in a new thread)." -msgstr "" - -#: ../../library/concurrent.interpreters.rst:133 -msgid "Exceptions" -msgstr "例外" - -#: ../../library/concurrent.interpreters.rst:137 -msgid "" -"This exception, a subclass of :exc:`Exception`, is raised when an " -"interpreter-related error happens." -msgstr "" - -#: ../../library/concurrent.interpreters.rst:142 -msgid "" -"This exception, a subclass of :exc:`InterpreterError`, is raised when the " -"targeted interpreter no longer exists." -msgstr "" - -#: ../../library/concurrent.interpreters.rst:147 -msgid "" -"This exception, a subclass of :exc:`InterpreterError`, is raised when the " -"running code raised an uncaught exception." -msgstr "" - -#: ../../library/concurrent.interpreters.rst:152 -msgid "A basic snapshot of the exception raised in the other interpreter." -msgstr "" - -#: ../../library/concurrent.interpreters.rst:158 -msgid "" -"This exception, a subclass of :exc:`TypeError`, is raised when an object " -"cannot be sent to another interpreter." -msgstr "" - -#: ../../library/concurrent.interpreters.rst:166 -msgid "Basic usage" -msgstr "基本的な使い方" - -#: ../../library/concurrent.interpreters.rst:168 -msgid "Creating an interpreter and running code in it::" -msgstr "" - -#: ../../library/concurrent.interpreters.rst:170 -msgid "" -"from concurrent import interpreters\n" -"\n" -"interp = interpreters.create()\n" -"\n" -"# Run in the current OS thread.\n" -"\n" -"interp.exec('print(\"spam!\")')\n" -"\n" -"interp.exec(\"\"\"if True:\n" -" print('spam!')\n" -" \"\"\")\n" -"\n" -"from textwrap import dedent\n" -"interp.exec(dedent(\"\"\"\n" -" print('spam!')\n" -" \"\"\"))\n" -"\n" -"def run():\n" -" print('spam!')\n" -"\n" -"interp.call(run)\n" -"\n" -"# Run in new OS thread.\n" -"\n" -"t = interp.call_in_thread(run)\n" -"t.join()" -msgstr "" diff --git a/library/concurrent.po b/library/concurrent.po index 11614d82c..f1aec1743 100644 --- a/library/concurrent.po +++ b/library/concurrent.po @@ -1,41 +1,36 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 -# 石井明久, 2024 +# Inada Naoki , 2017 +# Arihiro TAKASE, 2017 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-13 14:21+0000\n" -"PO-Revision-Date: 2021-06-28 00:57+0000\n" -"Last-Translator: 石井明久, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 23:03+0000\n" +"Last-Translator: Arihiro TAKASE, 2017\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/concurrent.rst:2 -msgid "The :mod:`!concurrent` package" -msgstr ":mod:`!concurrent` パッケージ" +msgid "The :mod:`concurrent` package" +msgstr ":mod:`concurrent` パッケージ" #: ../../library/concurrent.rst:4 -msgid "This package contains the following modules:" -msgstr "" +msgid "Currently, there is only one module in this package:" +msgstr "現在のところ、このパッケージにはモジュールが1つだけあります:" #: ../../library/concurrent.rst:6 msgid ":mod:`concurrent.futures` -- Launching parallel tasks" msgstr ":mod:`concurrent.futures` -- 並列タスク実行" - -#: ../../library/concurrent.rst:7 -msgid "" -":mod:`concurrent.interpreters` -- Multiple interpreters in the same process" -msgstr "" diff --git a/library/configparser.po b/library/configparser.po index 8021314ff..368a2fc59 100644 --- a/library/configparser.po +++ b/library/configparser.po @@ -1,39 +1,39 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 +# E. Kawashima, 2017 +# Nozomu Kaneko , 2017 +# 秘湯 , 2017 +# Inada Naoki , 2017 +# Yusuke Miyazaki , 2017 +# Arihiro TAKASE, 2017 +# Shun Sakurai, 2019 +# tomo, 2020 +# Takanori Suzuki , 2021 # Osamu NAKAMURA, 2021 -# souma987, 2023 -# Takanori Suzuki , 2023 -# Yusuke Miyazaki , 2023 -# Arihiro TAKASE, 2023 -# Masato HASHIMOTO , 2023 -# Taichi Haradaguchi, 2024 -# 石井明久, 2024 -# Takeshi Nakazato, 2024 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:57+0000\n" -"Last-Translator: Takeshi Nakazato, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-07-14 06:53+0000\n" +"PO-Revision-Date: 2017-02-16 23:04+0000\n" +"Last-Translator: Osamu NAKAMURA, 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/configparser.rst:2 -msgid ":mod:`!configparser` --- Configuration file parser" -msgstr ":mod:`!configparser` --- 設定ファイルのパーサー" +msgid ":mod:`configparser` --- Configuration file parser" +msgstr ":mod:`configparser` --- 設定ファイルのパーサー" #: ../../library/configparser.rst:14 msgid "**Source code:** :source:`Lib/configparser.py`" @@ -59,63 +59,39 @@ msgstr "" "このライブラリでは、Windowsのレジストリ用に拡張された INI 文法はサポート *し" "ていません* 。" -#: ../../library/configparser.rst:36 -msgid "Module :mod:`tomllib`" -msgstr "モジュール :mod:`tomllib`" - -#: ../../library/configparser.rst:37 -msgid "" -"TOML is a well-specified format for application configuration files. It is " -"specifically designed to be an improved version of INI." -msgstr "" - -#: ../../library/configparser.rst:40 +#: ../../library/configparser.rst:38 msgid "Module :mod:`shlex`" msgstr ":mod:`shlex` モジュール" -#: ../../library/configparser.rst:41 +#: ../../library/configparser.rst:37 msgid "" -"Support for creating Unix shell-like mini-languages which can also be used " -"for application configuration files." +"Support for creating Unix shell-like mini-languages which can be used as an " +"alternate format for application configuration files." msgstr "" -"アプリケーション設定ファイルにも使える、Unix シェルに似たミニ言語の作成を支援" -"します。" +"アプリケーション設定ファイルのフォーマットとして使える、Unix シェルに似たミニ" +"言語の作成を支援します。" -#: ../../library/configparser.rst:44 +#: ../../library/configparser.rst:41 msgid "Module :mod:`json`" msgstr ":mod:`json` モジュール" -#: ../../library/configparser.rst:45 +#: ../../library/configparser.rst:41 msgid "" -"The ``json`` module implements a subset of JavaScript syntax which is " -"sometimes used for configuration, but does not support comments." +"The json module implements a subset of JavaScript syntax which can also be " +"used for this purpose." msgstr "" +"json モジュールは、同じ目的に利用できる JavaScript の文法のサブセットを実装し" +"ています。" -#: ../../library/configparser.rst:61 +#: ../../library/configparser.rst:56 msgid "Quick Start" msgstr "クイックスタート" -#: ../../library/configparser.rst:63 +#: ../../library/configparser.rst:58 msgid "Let's take a very basic configuration file that looks like this:" msgstr "次のような、非常に簡単な設定ファイルを例に考えましょう:" -#: ../../library/configparser.rst:65 -msgid "" -"[DEFAULT]\n" -"ServerAliveInterval = 45\n" -"Compression = yes\n" -"CompressionLevel = 9\n" -"ForwardX11 = yes\n" -"\n" -"[forge.example]\n" -"User = hg\n" -"\n" -"[topsecret.server.example]\n" -"Port = 50022\n" -"ForwardX11 = no" -msgstr "" - -#: ../../library/configparser.rst:80 +#: ../../library/configparser.rst:75 msgid "" "The structure of INI files is described `in the following section " "<#supported-ini-file-structure>`_. Essentially, the file consists of " @@ -130,26 +106,7 @@ msgstr "" ":mod:`configparser` のクラス群はそれらのファイルを読み書きできます。\n" "まずは上のような設定ファイルをプログラムから作成してみましょう。" -#: ../../library/configparser.rst:86 -msgid "" -">>> import configparser\n" -">>> config = configparser.ConfigParser()\n" -">>> config['DEFAULT'] = {'ServerAliveInterval': '45',\n" -"... 'Compression': 'yes',\n" -"... 'CompressionLevel': '9'}\n" -">>> config['forge.example'] = {}\n" -">>> config['forge.example']['User'] = 'hg'\n" -">>> config['topsecret.server.example'] = {}\n" -">>> topsecret = config['topsecret.server.example']\n" -">>> topsecret['Port'] = '50022' # mutates the parser\n" -">>> topsecret['ForwardX11'] = 'no' # same here\n" -">>> config['DEFAULT']['ForwardX11'] = 'yes'\n" -">>> with open('example.ini', 'w') as configfile:\n" -"... config.write(configfile)\n" -"..." -msgstr "" - -#: ../../library/configparser.rst:104 +#: ../../library/configparser.rst:99 msgid "" "As you can see, we can treat a config parser much like a dictionary. There " "are differences, `outlined later <#mapping-protocol-access>`_, but the " @@ -159,7 +116,7 @@ msgstr "" "の違いは `後に <#mapping-protocol-access>`_ 説明しますが、このインターフェイ" "スは辞書に対して期待するのととても近い動作をします。" -#: ../../library/configparser.rst:108 +#: ../../library/configparser.rst:103 msgid "" "Now that we have created and saved a configuration file, let's read it back " "and explore the data it holds." @@ -167,40 +124,7 @@ msgstr "" "これで設定ファイルを作成して保存できました。次はこれを読み込み直して、中の" "データを取り出してみましょう。" -#: ../../library/configparser.rst:111 -msgid "" -">>> config = configparser.ConfigParser()\n" -">>> config.sections()\n" -"[]\n" -">>> config.read('example.ini')\n" -"['example.ini']\n" -">>> config.sections()\n" -"['forge.example', 'topsecret.server.example']\n" -">>> 'forge.example' in config\n" -"True\n" -">>> 'python.org' in config\n" -"False\n" -">>> config['forge.example']['User']\n" -"'hg'\n" -">>> config['DEFAULT']['Compression']\n" -"'yes'\n" -">>> topsecret = config['topsecret.server.example']\n" -">>> topsecret['ForwardX11']\n" -"'no'\n" -">>> topsecret['Port']\n" -"'50022'\n" -">>> for key in config['forge.example']:\n" -"... print(key)\n" -"user\n" -"compressionlevel\n" -"serveraliveinterval\n" -"compression\n" -"forwardx11\n" -">>> config['forge.example']['ForwardX11']\n" -"'yes'" -msgstr "" - -#: ../../library/configparser.rst:143 +#: ../../library/configparser.rst:138 msgid "" "As we can see above, the API is pretty straightforward. The only bit of " "magic involves the ``DEFAULT`` section which provides default values for all " @@ -212,47 +136,11 @@ msgstr "" "[1]_。 また、セクション内の各キーは大文字小文字を区別せず、全て小文字で保存さ" "れていることにも注意してください [1]_。" -#: ../../library/configparser.rst:148 ../../library/configparser.rst:1003 -msgid "" -"It is possible to read several configurations into a single :class:" -"`ConfigParser`, where the most recently added configuration has the highest " -"priority. Any conflicting keys are taken from the more recent configuration " -"while the previously existing keys are retained. The example below reads in " -"an ``override.ini`` file, which will override any conflicting keys from the " -"``example.ini`` file." -msgstr "" - -#: ../../library/configparser.rst:155 ../../library/configparser.rst:1010 -msgid "" -"[DEFAULT]\n" -"ServerAliveInterval = -1" -msgstr "" - -#: ../../library/configparser.rst:160 ../../library/configparser.rst:1015 -msgid "" -">>> config_override = configparser.ConfigParser()\n" -">>> config_override['DEFAULT'] = {'ServerAliveInterval': '-1'}\n" -">>> with open('override.ini', 'w') as configfile:\n" -"... config_override.write(configfile)\n" -"...\n" -">>> config_override = configparser.ConfigParser()\n" -">>> config_override.read(['example.ini', 'override.ini'])\n" -"['example.ini', 'override.ini']\n" -">>> print(config_override.get('DEFAULT', 'ServerAliveInterval'))\n" -"-1" -msgstr "" - -#: ../../library/configparser.rst:174 -msgid "" -"This behaviour is equivalent to a :meth:`ConfigParser.read` call with " -"several files passed to the *filenames* parameter." -msgstr "" - -#: ../../library/configparser.rst:179 +#: ../../library/configparser.rst:145 msgid "Supported Datatypes" msgstr "サポートされるデータ型" -#: ../../library/configparser.rst:181 +#: ../../library/configparser.rst:147 msgid "" "Config parsers do not guess datatypes of values in configuration files, " "always storing them internally as strings. This means that if you need " @@ -261,15 +149,7 @@ msgstr "" "Config parser は値のデータ型について何も推論せず、常に文字列のまま内部に保存" "します。他のデータ型が必要な場合は自分で変換する必要があります:" -#: ../../library/configparser.rst:185 -msgid "" -">>> int(topsecret['Port'])\n" -"50022\n" -">>> float(topsecret['CompressionLevel'])\n" -"9.0" -msgstr "" - -#: ../../library/configparser.rst:192 +#: ../../library/configparser.rst:158 msgid "" "Since this task is so common, config parsers provide a range of handy getter " "methods to handle integers, floats and booleans. The last one is the most " @@ -287,17 +167,7 @@ msgstr "" "``'on'``/``'off'``、``'true'``/``'false'``、``'1'``/``'0'`` を真偽値として認" "識します [1]_。例えば:" -#: ../../library/configparser.rst:200 -msgid "" -">>> topsecret.getboolean('ForwardX11')\n" -"False\n" -">>> config['forge.example'].getboolean('ForwardX11')\n" -"True\n" -">>> config.getboolean('forge.example', 'Compression')\n" -"True" -msgstr "" - -#: ../../library/configparser.rst:209 +#: ../../library/configparser.rst:175 msgid "" "Apart from :meth:`~ConfigParser.getboolean`, config parsers also provide " "equivalent :meth:`~ConfigParser.getint` and :meth:`~ConfigParser.getfloat` " @@ -309,62 +179,44 @@ msgstr "" "います。独自のコンバーターの登録、提供されたメソッドのカスタマイズもできま" "す。 [1]_" -#: ../../library/configparser.rst:215 +#: ../../library/configparser.rst:181 msgid "Fallback Values" msgstr "代替値" -#: ../../library/configparser.rst:217 -msgid "" -"As with a dictionary, you can use a section's :meth:`~ConfigParser.get` " -"method to provide fallback values:" -msgstr "" - -#: ../../library/configparser.rst:220 +#: ../../library/configparser.rst:183 msgid "" -">>> topsecret.get('Port')\n" -"'50022'\n" -">>> topsecret.get('CompressionLevel')\n" -"'9'\n" -">>> topsecret.get('Cipher')\n" -">>> topsecret.get('Cipher', '3des-cbc')\n" -"'3des-cbc'" +"As with a dictionary, you can use a section's :meth:`get` method to provide " +"fallback values:" msgstr "" +"辞書と同じように、セクションの :meth:`get` メソッドは代替値を提供しています:" -#: ../../library/configparser.rst:230 +#: ../../library/configparser.rst:196 msgid "" "Please note that default values have precedence over fallback values. For " "instance, in our example the ``'CompressionLevel'`` key was specified only " "in the ``'DEFAULT'`` section. If we try to get it from the section " -"``'topsecret.server.example'``, we will always get the default, even if we " +"``'topsecret.server.com'``, we will always get the default, even if we " "specify a fallback:" msgstr "" "デフォルト値は代替値よりも優先されることに注意してください。例えば上の例で" "は、``'CompressionLevel'`` キーは ``'DEFAULT'`` セクションにしか存在しませ" -"ん。その値を ``'topsecret.server.example'`` から取得しようとした場合、代替値" -"を指定しても常にデフォルト値を返します:" +"ん。その値を ``'topsecret.server.com'`` から取得しようとした場合、代替値を指" +"定しても常にデフォルト値を返します:" -#: ../../library/configparser.rst:236 +#: ../../library/configparser.rst:207 msgid "" -">>> topsecret.get('CompressionLevel', '3')\n" -"'9'" +"One more thing to be aware of is that the parser-level :meth:`get` method " +"provides a custom, more complex interface, maintained for backwards " +"compatibility. When using this method, a fallback value can be provided via " +"the ``fallback`` keyword-only argument:" msgstr "" +"もう一つ注意すべき点は、パーサーレベルの (訳注: ConfigParserクラスの) :meth:" +"`get` メソッドは、後方互換性のために、カスタムのより複雑なインターフェースを" +"提供します。\n" +"このメソッドを使用する際には、フォールバック値はキーワード専用引数 " +"``fallback`` を介して提供されます:" -#: ../../library/configparser.rst:241 -msgid "" -"One more thing to be aware of is that the parser-level :meth:`~ConfigParser." -"get` method provides a custom, more complex interface, maintained for " -"backwards compatibility. When using this method, a fallback value can be " -"provided via the ``fallback`` keyword-only argument:" -msgstr "" - -#: ../../library/configparser.rst:246 -msgid "" -">>> config.get('forge.example', 'monster',\n" -"... fallback='No such things as monsters')\n" -"'No such things as monsters'" -msgstr "" - -#: ../../library/configparser.rst:252 +#: ../../library/configparser.rst:218 msgid "" "The same ``fallback`` argument can be used with the :meth:`~ConfigParser." "getint`, :meth:`~ConfigParser.getfloat` and :meth:`~ConfigParser.getboolean` " @@ -374,49 +226,31 @@ msgstr "" "`~ConfigParser.getfloat` と :meth:`~ConfigParser.getboolean` メソッドでも使え" "ます。例えば:" -#: ../../library/configparser.rst:256 -msgid "" -">>> 'BatchMode' in topsecret\n" -"False\n" -">>> topsecret.getboolean('BatchMode', fallback=True)\n" -"True\n" -">>> config['DEFAULT']['BatchMode'] = 'no'\n" -">>> topsecret.getboolean('BatchMode', fallback=True)\n" -"False" -msgstr "" - -#: ../../library/configparser.rst:268 +#: ../../library/configparser.rst:234 msgid "Supported INI File Structure" msgstr "サポートするINI ファイルの構造" -#: ../../library/configparser.rst:270 +#: ../../library/configparser.rst:236 msgid "" "A configuration file consists of sections, each led by a ``[section]`` " "header, followed by key/value entries separated by a specific string (``=`` " "or ``:`` by default [1]_). By default, section names are case sensitive but " "keys are not [1]_. Leading and trailing whitespace is removed from keys and " -"values. Values can be omitted if the parser is configured to allow it [1]_, " -"in which case the key/value delimiter may also be left out. Values can also " -"span multiple lines, as long as they are indented deeper than the first line " -"of the value. Depending on the parser's mode, blank lines may be treated as " -"parts of multiline values or ignored." -msgstr "" - -#: ../../library/configparser.rst:280 -msgid "" -"By default, a valid section name can be any string that does not contain '\\" -"\\n'. To change this, see :attr:`ConfigParser.SECTCRE`." -msgstr "" - -#: ../../library/configparser.rst:283 -msgid "" -"The first section name may be omitted if the parser is configured to allow " -"an unnamed top level section with ``allow_unnamed_section=True``. In this " -"case, the keys/values may be retrieved by :const:`UNNAMED_SECTION` as in " -"``config[UNNAMED_SECTION]``." -msgstr "" - -#: ../../library/configparser.rst:288 +"values. Values can be omitted, in which case the key/value delimiter may " +"also be left out. Values can also span multiple lines, as long as they are " +"indented deeper than the first line of the value. Depending on the parser's " +"mode, blank lines may be treated as parts of multiline values or ignored." +msgstr "" +"設定ファイルは複数のセクションから構成されます。セクションは、``[section]`` " +"ヘッダに続いた、特定の文字列(デフォルトでは ``=`` または ``:`` [1]_ )で区切ら" +"れたキーと値のエントリです。デフォルトでは、セクション名は大文字と小文字を区" +"別しますが、キーはそうではありません [1]_。キーと値、それぞれの先頭と末尾の空" +"白は取り除かれます。値は省略することができ、その際でも、キーと値の区切り文字" +"は残しておけます。値はまた、値の先頭の行より深くインデントされていれば、複数" +"の行にまたがっても構いません。パーサーのモードによって、空白行は、複数行から" +"なる値の一部として扱われるか、無視されます。" + +#: ../../library/configparser.rst:245 msgid "" "Configuration files may include comments, prefixed by specific characters " "(``#`` and ``;`` by default [1]_). Comments may appear on their own on an " @@ -426,84 +260,15 @@ msgstr "" "つけてコメントをつけることができます。コメントは、他の内容がない行に置くこと" "ができ、インデントされていても構いません。[1]_" -#: ../../library/configparser.rst:292 ../../library/configparser.rst:376 +#: ../../library/configparser.rst:249 ../../library/configparser.rst:312 msgid "For example:" msgstr "例えば:" -#: ../../library/configparser.rst:294 -msgid "" -"[Simple Values]\n" -"key=value\n" -"spaces in keys=allowed\n" -"spaces in values=allowed as well\n" -"spaces around the delimiter = obviously\n" -"you can also use : to delimit keys from values\n" -"\n" -"[All Values Are Strings]\n" -"values like this: 1000000\n" -"or this: 3.14159265359\n" -"are they treated as numbers? : no\n" -"integers, floats and booleans are held as: strings\n" -"can use the API to get converted values directly: true\n" -"\n" -"[Multiline Values]\n" -"chorus: I'm a lumberjack, and I'm okay\n" -" I sleep all night and I work all day\n" -"\n" -"[No Values]\n" -"key_without_value\n" -"empty string value here =\n" -"\n" -"[You can use comments]\n" -"# like this\n" -"; or this\n" -"\n" -"# By default only in an empty line.\n" -"# Inline comments can be harmful because they prevent users\n" -"# from using the delimiting characters as parts of values.\n" -"# That being said, this can be customized.\n" -"\n" -" [Sections Can Be Indented]\n" -" can_values_be_as_well = True\n" -" does_that_mean_anything_special = False\n" -" purpose = formatting for readability\n" -" multiline_values = are\n" -" handled just fine as\n" -" long as they are indented\n" -" deeper than the first line\n" -" of a value\n" -" # Did I mention we can indent comments, too?" -msgstr "" - -#: ../../library/configparser.rst:342 -msgid "Unnamed Sections" -msgstr "" - -#: ../../library/configparser.rst:344 -msgid "" -"The name of the first section (or unique) may be omitted and values " -"retrieved by the :const:`UNNAMED_SECTION` attribute." -msgstr "" - -#: ../../library/configparser.rst:347 -msgid "" -">>> config = \"\"\"\n" -"... option = value\n" -"...\n" -"... [ Section 2 ]\n" -"... another = val\n" -"... \"\"\"\n" -">>> unnamed = configparser.ConfigParser(allow_unnamed_section=True)\n" -">>> unnamed.read_string(config)\n" -">>> unnamed.get(configparser.UNNAMED_SECTION, 'option')\n" -"'value'" -msgstr "" - -#: ../../library/configparser.rst:361 +#: ../../library/configparser.rst:297 msgid "Interpolation of values" msgstr "値の補間" -#: ../../library/configparser.rst:363 +#: ../../library/configparser.rst:299 msgid "" "On top of the core functionality, :class:`ConfigParser` supports " "interpolation. This means values can be preprocessed before returning them " @@ -513,7 +278,7 @@ msgstr "" "ポートします。これは ``get()`` コールが値を返す前に、その値に対して前処理を行" "えることを意味します。" -#: ../../library/configparser.rst:371 +#: ../../library/configparser.rst:307 msgid "" "The default implementation used by :class:`ConfigParser`. It enables values " "to contain format strings which refer to other values in the same section, " @@ -524,20 +289,7 @@ msgstr "" "別なデフォルトセクション中 [1]_ の他の値を参照するフォーマット文字列を含める" "ことができます。追加のデフォルト値を初期化時に提供できます。" -#: ../../library/configparser.rst:378 -msgid "" -"[Paths]\n" -"home_dir: /Users\n" -"my_dir: %(home_dir)s/lumberjack\n" -"my_pictures: %(my_dir)s/Pictures\n" -"\n" -"[Escape]\n" -"# use a %% to escape the % sign (% is the only character that needs to be " -"escaped):\n" -"gain: 80%%" -msgstr "" - -#: ../../library/configparser.rst:389 +#: ../../library/configparser.rst:324 msgid "" "In the example above, :class:`ConfigParser` with *interpolation* set to " "``BasicInterpolation()`` would resolve ``%(home_dir)s`` to the value of " @@ -552,7 +304,7 @@ msgstr "" "lumberjack`` になります。全ての補間は必要に応じて実行されるため、設定ファイル" "中で参照の連鎖をもつキーを特定の順序で記述する必要はありません。" -#: ../../library/configparser.rst:396 +#: ../../library/configparser.rst:331 msgid "" "With ``interpolation`` set to ``None``, the parser would simply return " "``%(my_dir)s/Pictures`` as the value of ``my_pictures`` and ``%(home_dir)s/" @@ -562,7 +314,7 @@ msgstr "" "値として ``%(my_dir)s/Pictures`` を返し、``my_dir`` の値として " "``%(home_dir)s/lumberjack`` を返します。" -#: ../../library/configparser.rst:404 +#: ../../library/configparser.rst:339 msgid "" "An alternative handler for interpolation which implements a more advanced " "syntax, used for instance in ``zc.buildout``. Extended interpolation is " @@ -577,7 +329,7 @@ msgstr "" "``section:`` の部分が省略されると、現在のセクションがデフォルト値となります" "(スペシャルセクション中のデフォルト値を使用することもできます)。" -#: ../../library/configparser.rst:411 +#: ../../library/configparser.rst:346 msgid "" "For example, the configuration specified above with basic interpolation, " "would look like this with extended interpolation:" @@ -585,48 +337,15 @@ msgstr "" "たとえば、上記の basic interpolation で指定した設定は、extended " "interpolation を使うと下記のようになります:" -#: ../../library/configparser.rst:414 -msgid "" -"[Paths]\n" -"home_dir: /Users\n" -"my_dir: ${home_dir}/lumberjack\n" -"my_pictures: ${my_dir}/Pictures\n" -"\n" -"[Escape]\n" -"# use a $$ to escape the $ sign ($ is the only character that needs to be " -"escaped):\n" -"cost: $$80" -msgstr "" - -#: ../../library/configparser.rst:425 +#: ../../library/configparser.rst:359 msgid "Values from other sections can be fetched as well:" msgstr "他のセクションから値を持ってくることもできます:" -#: ../../library/configparser.rst:427 -msgid "" -"[Common]\n" -"home_dir: /Users\n" -"library_dir: /Library\n" -"system_dir: /System\n" -"macports_dir: /opt/local\n" -"\n" -"[Frameworks]\n" -"Python: 3.2\n" -"path: ${Common:system_dir}/Library/Frameworks/\n" -"\n" -"[Arthur]\n" -"nickname: Two Sheds\n" -"last_name: Jackson\n" -"my_dir: ${Common:home_dir}/twosheds\n" -"my_pictures: ${my_dir}/Pictures\n" -"python_dir: ${Frameworks:path}/Python/Versions/${Frameworks:Python}" -msgstr "" - -#: ../../library/configparser.rst:447 +#: ../../library/configparser.rst:381 msgid "Mapping Protocol Access" msgstr "マップ型プロトコルアクセス" -#: ../../library/configparser.rst:451 +#: ../../library/configparser.rst:385 msgid "" "Mapping protocol access is a generic name for functionality that enables " "using custom objects as if they were dictionaries. In case of :mod:" @@ -637,7 +356,7 @@ msgstr "" "ための機能の総称です。 :mod:`configparser` の場合、マップ型インターフェースの" "実装は ``parser['section']['option']`` 表記を使います。" -#: ../../library/configparser.rst:456 +#: ../../library/configparser.rst:390 msgid "" "``parser['section']`` in particular returns a proxy for the section's data " "in the parser. This means that the values are not copied but they are taken " @@ -650,7 +369,7 @@ msgstr "" "サーから取られます。さらに重要なことに、セクションのプロキシの値が変更される" "と、オリジナルのパーサー中の値が実際に変更されます。" -#: ../../library/configparser.rst:462 +#: ../../library/configparser.rst:396 msgid "" ":mod:`configparser` objects behave as close to actual dictionaries as " "possible. The mapping interface is complete and adheres to the :class:" @@ -661,7 +380,7 @@ msgstr "" "ンターフェースは :class:`~collections.abc.MutableMapping` を矛盾なく完成しま" "す。しかし、考慮するべき違いがいくつかあります:" -#: ../../library/configparser.rst:467 +#: ../../library/configparser.rst:401 msgid "" "By default, all keys in sections are accessible in a case-insensitive manner " "[1]_. E.g. ``for option in parser[\"section\"]`` yields only " @@ -675,13 +394,7 @@ msgstr "" "す。同時に、キー ``'a'`` を含むセクションにおいて、どちらの式も ``True`` を返" "します::" -#: ../../library/configparser.rst:472 -msgid "" -"\"a\" in parser[\"section\"]\n" -"\"A\" in parser[\"section\"]" -msgstr "" - -#: ../../library/configparser.rst:475 +#: ../../library/configparser.rst:409 msgid "" "All sections include ``DEFAULTSECT`` values as well which means that ``." "clear()`` on a section may not leave the section visibly empty. This is " @@ -696,23 +409,23 @@ msgstr "" "上書きされた場合、それが削除されるとデフォルト値が再び見えるようになります。" "デフォルト値を削除しようとすると :exc:`KeyError` が発生します。" -#: ../../library/configparser.rst:482 +#: ../../library/configparser.rst:416 msgid "``DEFAULTSECT`` cannot be removed from the parser:" msgstr "``DEFAULTSECT`` はパーサーから取り除けません:" -#: ../../library/configparser.rst:484 +#: ../../library/configparser.rst:418 msgid "trying to delete it raises :exc:`ValueError`," msgstr "削除しようとすると :exc:`ValueError` が発生します。" -#: ../../library/configparser.rst:486 +#: ../../library/configparser.rst:420 msgid "``parser.clear()`` leaves it intact," msgstr "``parser.clear()`` はこれをそのまま残し、" -#: ../../library/configparser.rst:488 +#: ../../library/configparser.rst:422 msgid "``parser.popitem()`` never returns it." msgstr "``parser.popitem()`` がこれを返すことはありません。" -#: ../../library/configparser.rst:490 +#: ../../library/configparser.rst:424 msgid "" "``parser.get(section, option, **kwargs)`` - the second argument is **not** a " "fallback value. Note however that the section-level ``get()`` methods are " @@ -722,7 +435,7 @@ msgstr "" "*。ただし、セクションごとの ``get()`` メソッドはマップ型プロトコルと旧式の " "configparser API の両方に互換です。" -#: ../../library/configparser.rst:494 +#: ../../library/configparser.rst:428 msgid "" "``parser.items()`` is compatible with the mapping protocol (returns a list " "of *section_name*, *section_proxy* pairs including the DEFAULTSECT). " @@ -737,7 +450,7 @@ msgstr "" "出せます。後者の呼び出しは指定された ``section`` の *option*, *value* 対のリ" "ストを、(``raw=True`` が与えられない限り) 全ての補間を展開して返します。" -#: ../../library/configparser.rst:501 +#: ../../library/configparser.rst:435 msgid "" "The mapping protocol is implemented on top of the existing legacy API so " "that subclasses overriding the original interface still should have mappings " @@ -746,11 +459,11 @@ msgstr "" "マップ型プロトコルは、既存のレガシーな API の上に実装されているので、オリジナ" "ルのインターフェースを上書きする派生クラスもまたは期待どおりにはたらきます。" -#: ../../library/configparser.rst:507 +#: ../../library/configparser.rst:441 msgid "Customizing Parser Behaviour" msgstr "パーサーの振る舞いをカスタマイズする" -#: ../../library/configparser.rst:509 +#: ../../library/configparser.rst:443 msgid "" "There are nearly as many INI format variants as there are applications using " "it. :mod:`configparser` goes a long way to provide support for the largest " @@ -763,17 +476,19 @@ msgstr "" "合をサポートするために、非常に役立ちます。デフォルトの機能は主に歴史的背景に" "よって決められたので、機能によってはカスタマイズしてお使いください。" -#: ../../library/configparser.rst:515 +#: ../../library/configparser.rst:449 msgid "" "The most common way to change the way a specific config parser works is to " -"use the :meth:`!__init__` options:" +"use the :meth:`__init__` options:" msgstr "" +"特定の設定パーサーのはたらきを変える最も一般的な方法は :meth:`__init__` オプ" +"ションを使うことです:" -#: ../../library/configparser.rst:518 +#: ../../library/configparser.rst:452 msgid "*defaults*, default value: ``None``" msgstr "*defaults*, デフォルト値: ``None``" -#: ../../library/configparser.rst:520 +#: ../../library/configparser.rst:454 msgid "" "This option accepts a dictionary of key-value pairs which will be initially " "put in the ``DEFAULT`` section. This makes for an elegant way to support " @@ -783,17 +498,19 @@ msgstr "" "このオプションは最初に ``DEFAULT`` セクションに加えられるキー-値の対の辞書を" "受け付けます。" -#: ../../library/configparser.rst:525 +#: ../../library/configparser.rst:459 msgid "" "Hint: if you want to specify default values for a specific section, use :" -"meth:`~ConfigParser.read_dict` before you read the actual file." +"meth:`read_dict` before you read the actual file." msgstr "" +"ヒント: 特定のセクションにデフォルト値を指定したいなら、実際のファイルを読み" +"込む前に :meth:`read_dict` を使ってください。" -#: ../../library/configparser.rst:528 +#: ../../library/configparser.rst:462 msgid "*dict_type*, default value: :class:`dict`" msgstr "*dict_type*, デフォルト値: :class:`dict`" -#: ../../library/configparser.rst:530 +#: ../../library/configparser.rst:464 msgid "" "This option has a major impact on how the mapping protocol will behave and " "how the written configuration files look. With the standard dictionary, " @@ -804,7 +521,7 @@ msgstr "" "た目に大きく影響します。標準の辞書では、全てのセクションはパーサーに加えられ" "た順に並びます。同じことがセクション内のオプションにも言えます。" -#: ../../library/configparser.rst:535 +#: ../../library/configparser.rst:469 msgid "" "An alternative dictionary type can be used for example to sort sections and " "options on write-back." @@ -812,7 +529,7 @@ msgstr "" "セクションとオプションをライトバック時にソートするためなどに、別の辞書型も使" "えます。" -#: ../../library/configparser.rst:538 +#: ../../library/configparser.rst:472 msgid "" "Please note: there are ways to add a set of key-value pairs in a single " "operation. When you use a regular dictionary in those operations, the order " @@ -821,30 +538,11 @@ msgstr "" "注意: 一度の操作でキー-値の対を複数追加する方法もあります。そのような操作に普" "通の辞書を使うと、キーの並びは挿入順になります。例えば:" -#: ../../library/configparser.rst:542 -msgid "" -">>> parser = configparser.ConfigParser()\n" -">>> parser.read_dict({'section1': {'key1': 'value1',\n" -"... 'key2': 'value2',\n" -"... 'key3': 'value3'},\n" -"... 'section2': {'keyA': 'valueA',\n" -"... 'keyB': 'valueB',\n" -"... 'keyC': 'valueC'},\n" -"... 'section3': {'foo': 'x',\n" -"... 'bar': 'y',\n" -"... 'baz': 'z'}\n" -"... })\n" -">>> parser.sections()\n" -"['section1', 'section2', 'section3']\n" -">>> [option for option in parser['section3']]\n" -"['foo', 'bar', 'baz']" -msgstr "" - -#: ../../library/configparser.rst:560 +#: ../../library/configparser.rst:494 msgid "*allow_no_value*, default value: ``False``" msgstr "*allow_no_value*, デフォルト値: ``False``" -#: ../../library/configparser.rst:562 +#: ../../library/configparser.rst:496 msgid "" "Some configuration files are known to include settings without values, but " "which otherwise conform to the syntax supported by :mod:`configparser`. The " @@ -855,42 +553,11 @@ msgstr "" "`ConfigParser` がサポートする文法に従います。コンストラクタの " "*allow_no_value* 引数で、そのような値を許可することができます。" -#: ../../library/configparser.rst:567 -msgid "" -">>> import configparser\n" -"\n" -">>> sample_config = \"\"\"\n" -"... [mysqld]\n" -"... user = mysql\n" -"... pid-file = /var/run/mysqld/mysqld.pid\n" -"... skip-external-locking\n" -"... old_passwords = 1\n" -"... skip-bdb\n" -"... # we don't need ACID today\n" -"... skip-innodb\n" -"... \"\"\"\n" -">>> config = configparser.ConfigParser(allow_no_value=True)\n" -">>> config.read_string(sample_config)\n" -"\n" -">>> # Settings with values are treated as before:\n" -">>> config[\"mysqld\"][\"user\"]\n" -"'mysql'\n" -"\n" -">>> # Settings without values provide None:\n" -">>> config[\"mysqld\"][\"skip-bdb\"]\n" -"\n" -">>> # Settings which aren't specified still raise an error:\n" -">>> config[\"mysqld\"][\"does-not-exist\"]\n" -"Traceback (most recent call last):\n" -" ...\n" -"KeyError: 'does-not-exist'" -msgstr "" - -#: ../../library/configparser.rst:597 +#: ../../library/configparser.rst:531 msgid "*delimiters*, default value: ``('=', ':')``" msgstr "*delimiters*, デフォルト値: ``('=', ':')``" -#: ../../library/configparser.rst:599 +#: ../../library/configparser.rst:533 msgid "" "Delimiters are substrings that delimit keys from values within a section. " "The first occurrence of a delimiting substring on a line is considered a " @@ -900,7 +567,7 @@ msgstr "" "区切り部分文字列がデリミタと見なされます。つまり値にはデリミタを含めることが" "できます (キーには含めることができません)。" -#: ../../library/configparser.rst:603 +#: ../../library/configparser.rst:537 msgid "" "See also the *space_around_delimiters* argument to :meth:`ConfigParser." "write`." @@ -908,15 +575,15 @@ msgstr "" ":meth:`ConfigParser.write` の *space_around_delimiters* 引数も参照してくださ" "い。" -#: ../../library/configparser.rst:606 +#: ../../library/configparser.rst:540 msgid "*comment_prefixes*, default value: ``('#', ';')``" msgstr "*comment_prefixes*, デフォルト値: ``('#', ';')``" -#: ../../library/configparser.rst:608 +#: ../../library/configparser.rst:542 msgid "*inline_comment_prefixes*, default value: ``None``" msgstr "*inline_comment_prefixes*, デフォルト値: ``None``" -#: ../../library/configparser.rst:610 +#: ../../library/configparser.rst:544 msgid "" "Comment prefixes are strings that indicate the start of a valid comment " "within a config file. *comment_prefixes* are used only on otherwise empty " @@ -931,7 +598,7 @@ msgstr "" "ン、空行も可能) の後に使えます。デフォルトではインラインコメントは無効化され" "ていて、``'#'`` と ``';'`` を行全体のコメントに使用します。" -#: ../../library/configparser.rst:617 +#: ../../library/configparser.rst:551 msgid "" "In previous versions of :mod:`configparser` behaviour matched " "``comment_prefixes=('#',';')`` and ``inline_comment_prefixes=(';',)``." @@ -940,7 +607,7 @@ msgstr "" "``comment_prefixes=('#',';')`` および ``inline_comment_prefixes=(';',)`` に該" "当します。" -#: ../../library/configparser.rst:621 +#: ../../library/configparser.rst:555 msgid "" "Please note that config parsers don't support escaping of comment prefixes " "so using *inline_comment_prefixes* may prevent users from specifying option " @@ -956,61 +623,23 @@ msgstr "" "も、複数行にわたる値で、行の先頭にコメント接頭辞文字を保存する唯一の方法は、" "次の例のように接頭辞を補間することです::" -#: ../../library/configparser.rst:628 -msgid "" -">>> from configparser import ConfigParser, ExtendedInterpolation\n" -">>> parser = ConfigParser(interpolation=ExtendedInterpolation())\n" -">>> # the default BasicInterpolation could be used as well\n" -">>> parser.read_string(\"\"\"\n" -"... [DEFAULT]\n" -"... hash = #\n" -"...\n" -"... [hashes]\n" -"... shebang =\n" -"... ${hash}!/usr/bin/env python\n" -"... ${hash} -*- coding: utf-8 -*-\n" -"...\n" -"... extensions =\n" -"... enabled_extension\n" -"... another_extension\n" -"... #disabled_by_comment\n" -"... yet_another_extension\n" -"...\n" -"... interpolation not necessary = if # is not at line start\n" -"... even in multiline values = line #1\n" -"... line #2\n" -"... line #3\n" -"... \"\"\")\n" -">>> print(parser['hashes']['shebang'])\n" -"\n" -"#!/usr/bin/env python\n" -"# -*- coding: utf-8 -*-\n" -">>> print(parser['hashes']['extensions'])\n" -"\n" -"enabled_extension\n" -"another_extension\n" -"yet_another_extension\n" -">>> print(parser['hashes']['interpolation not necessary'])\n" -"if # is not at line start\n" -">>> print(parser['hashes']['even in multiline values'])\n" -"line #1\n" -"line #2\n" -"line #3" -msgstr "" - -#: ../../library/configparser.rst:667 +#: ../../library/configparser.rst:601 msgid "*strict*, default value: ``True``" msgstr "*strict*, デフォルト値: ``True``" -#: ../../library/configparser.rst:669 +#: ../../library/configparser.rst:603 msgid "" "When set to ``True``, the parser will not allow for any section or option " -"duplicates while reading from a single source (using :meth:`~ConfigParser." -"read_file`, :meth:`~ConfigParser.read_string` or :meth:`~ConfigParser." -"read_dict`). It is recommended to use strict parsers in new applications." +"duplicates while reading from a single source (using :meth:`read_file`, :" +"meth:`read_string` or :meth:`read_dict`). It is recommended to use strict " +"parsers in new applications." msgstr "" +"``True`` に設定された場合、パーサーは単一のソースから (:meth:`read_file`, :" +"meth:`read_string` または :meth:`read_dict` を使って) 読み込むときにセクショ" +"ンやオプションの重複を許さなくなります。新しいアプリケーションには strict な" +"パーサーを使うことが推奨されます。" -#: ../../library/configparser.rst:674 +#: ../../library/configparser.rst:608 msgid "" "In previous versions of :mod:`configparser` behaviour matched " "``strict=False``." @@ -1018,11 +647,11 @@ msgstr "" "以前のバージョンの :mod:`configparser` の振る舞いは ``strict=False`` に該当し" "ます。" -#: ../../library/configparser.rst:678 +#: ../../library/configparser.rst:612 msgid "*empty_lines_in_values*, default value: ``True``" msgstr "*empty_lines_in_values*, デフォルト値: ``True``" -#: ../../library/configparser.rst:680 +#: ../../library/configparser.rst:614 msgid "" "In config parsers, values can span multiple lines as long as they are " "indented more than the key that holds them. By default parsers also let " @@ -1037,16 +666,7 @@ msgstr "" "ルが大きく複雑になったとき、ユーザーがファイル構造を見失いやすいです。この例" "をご覧ください:" -#: ../../library/configparser.rst:687 -msgid "" -"[Section]\n" -"key = multiline\n" -" value with a gotcha\n" -"\n" -" this = is still a part of the multiline value of 'key'" -msgstr "" - -#: ../../library/configparser.rst:695 +#: ../../library/configparser.rst:629 msgid "" "This can be especially problematic for the user to see if she's using a " "proportional font to edit the file. That is why when your application does " @@ -1059,7 +679,7 @@ msgstr "" "なら、空行を認めないべきです。これによって空行で必ずキーが分かれます。上の例" "では、2 つのキー、``key`` および ``this`` が作られます。" -#: ../../library/configparser.rst:701 +#: ../../library/configparser.rst:635 msgid "" "*default_section*, default value: ``configparser.DEFAULTSECT`` (that is: " "``\"DEFAULT\"``)" @@ -1067,7 +687,7 @@ msgstr "" "*default_section*, デフォルト値: ``configparser.DEFAULTSECT`` (すなわち: " "``\"DEFAULT\"``)" -#: ../../library/configparser.rst:704 +#: ../../library/configparser.rst:638 msgid "" "The convention of allowing a special section of default values for other " "sections or interpolation purposes is a powerful concept of this library, " @@ -1090,11 +710,11 @@ msgstr "" "時 (すなわちファイルを別のフォーマットに変換するとき) に変更することもできま" "す。" -#: ../../library/configparser.rst:715 +#: ../../library/configparser.rst:649 msgid "*interpolation*, default value: ``configparser.BasicInterpolation``" msgstr "*interpolation*, デフォルト値: ``configparser.BasicInterpolation``" -#: ../../library/configparser.rst:717 +#: ../../library/configparser.rst:651 msgid "" "Interpolation behaviour may be customized by providing a custom handler " "through the *interpolation* argument. ``None`` can be used to turn off " @@ -1110,11 +730,11 @@ msgstr "" "of-values>`_ をご覧ください。 :class:`RawConfigParser` のデフォルト値は " "``None`` です。" -#: ../../library/configparser.rst:724 +#: ../../library/configparser.rst:658 msgid "*converters*, default value: not set" msgstr "*converters*, デフォルト値: 未設定" -#: ../../library/configparser.rst:726 +#: ../../library/configparser.rst:660 msgid "" "Config parsers provide option value getters that perform type conversion. " "By default :meth:`~ConfigParser.getint`, :meth:`~ConfigParser.getfloat`, " @@ -1122,13 +742,23 @@ msgid "" "be desirable, users may define them in a subclass or pass a dictionary where " "each key is a name of the converter and each value is a callable " "implementing said conversion. For instance, passing ``{'decimal': decimal." -"Decimal}`` would add :meth:`!getdecimal` on both the parser object and all " +"Decimal}`` would add :meth:`getdecimal` on both the parser object and all " "section proxies. In other words, it will be possible to write both " "``parser_instance.getdecimal('section', 'key', fallback=0)`` and " "``parser_instance['section'].getdecimal('key', 0)``." msgstr "" +"設定パーサーは、型変換を実行するオプションの値ゲッターを提供します。デフォル" +"トでは、 :meth:`~ConfigParser.getint`、 :meth:`~ConfigParser.getfloat`、 :" +"meth:`~ConfigParser.getboolean` が実装されています。他のゲッターが必要な場" +"合、ユーザーはそれらをサブクラスで定義するか、辞書を渡します。辞書を渡す場" +"合、各キーはコンバーターの名前で、値は当該変換を実装する呼び出し可能オブジェ" +"クトです。例えば、 ``{'decimal': decimal.Decimal}`` を渡すと、パーサーオブ" +"ジェクトとすべてのセクションプロキシの両方に、 :meth:`getdecimal` が追加され" +"ます。つまり、``parser_instance.getdecimal('section', 'key', fallback=0)`` " +"と ``parser_instance['section'].getdecimal('key', 0)`` の両方の方法で書くこと" +"ができます。" -#: ../../library/configparser.rst:737 +#: ../../library/configparser.rst:671 msgid "" "If the converter needs to access the state of the parser, it can be " "implemented as a method on a config parser subclass. If the name of this " @@ -1140,7 +770,7 @@ msgstr "" "始まる場合、すべてのセクションプロキシで、辞書と互換性のある形式で利用できま" "す (上記の ``getdecimal()`` の例を参照)。" -#: ../../library/configparser.rst:742 +#: ../../library/configparser.rst:676 msgid "" "More advanced customization may be achieved by overriding default values of " "these parser attributes. The defaults are defined on the classes, so they " @@ -1150,7 +780,7 @@ msgstr "" "できます。デフォルトはクラスで定義されているので、派生クラスや属性の代入で上" "書きできます。" -#: ../../library/configparser.rst:748 +#: ../../library/configparser.rst:682 msgid "" "By default when using :meth:`~ConfigParser.getboolean`, config parsers " "consider the following values ``True``: ``'1'``, ``'yes'``, ``'true'``, " @@ -1164,20 +794,7 @@ msgstr "" "``'false'``, ``'off'`` 。文字列と対応するブール値のカスタム辞書を指定すること" "でこれを上書きできます。たとえば:" -#: ../../library/configparser.rst:754 -msgid "" -">>> custom = configparser.ConfigParser()\n" -">>> custom['section1'] = {'funky': 'nope'}\n" -">>> custom['section1'].getboolean('funky')\n" -"Traceback (most recent call last):\n" -"...\n" -"ValueError: Not a boolean: nope\n" -">>> custom.BOOLEAN_STATES = {'sure': True, 'nope': False}\n" -">>> custom['section1'].getboolean('funky')\n" -"False" -msgstr "" - -#: ../../library/configparser.rst:766 +#: ../../library/configparser.rst:700 msgid "" "Other typical Boolean pairs include ``accept``/``reject`` or ``enabled``/" "``disabled``." @@ -1185,7 +802,7 @@ msgstr "" "ほかの典型的なブール値ペアには ``accept``/``reject`` や ``enabled``/" "``disabled`` などがあります。" -#: ../../library/configparser.rst:772 +#: ../../library/configparser.rst:706 msgid "" "This method transforms option names on every read, get, or set operation. " "The default converts the name to lowercase. This also means that when a " @@ -1197,38 +814,14 @@ msgstr "" "すべてのキーは小文字になります。それがふさわしくなければ、このメソッドを上書" "きしてください。例えば:" -#: ../../library/configparser.rst:778 -msgid "" -">>> config = \"\"\"\n" -"... [Section1]\n" -"... Key = Value\n" -"...\n" -"... [Section2]\n" -"... AnotherKey = Value\n" -"... \"\"\"\n" -">>> typical = configparser.ConfigParser()\n" -">>> typical.read_string(config)\n" -">>> list(typical['Section1'].keys())\n" -"['key']\n" -">>> list(typical['Section2'].keys())\n" -"['anotherkey']\n" -">>> custom = configparser.RawConfigParser()\n" -">>> custom.optionxform = lambda option: option\n" -">>> custom.read_string(config)\n" -">>> list(custom['Section1'].keys())\n" -"['Key']\n" -">>> list(custom['Section2'].keys())\n" -"['AnotherKey']" -msgstr "" - -#: ../../library/configparser.rst:802 +#: ../../library/configparser.rst:736 msgid "" "The optionxform function transforms option names to a canonical form. This " "should be an idempotent function: if the name is already in canonical form, " "it should be returned unchanged." msgstr "" -#: ../../library/configparser.rst:809 +#: ../../library/configparser.rst:743 msgid "" "A compiled regular expression used to parse section headers. The default " "matches ``[section]`` to the name ``\"section\"``. Whitespace is considered " @@ -1242,28 +835,7 @@ msgstr "" "名のセクションとして読み込まれます。これがふさわしくない場合、このメソッドを" "上書きしてください。例えば:" -#: ../../library/configparser.rst:815 -msgid "" -">>> import re\n" -">>> config = \"\"\"\n" -"... [Section 1]\n" -"... option = value\n" -"...\n" -"... [ Section 2 ]\n" -"... another = val\n" -"... \"\"\"\n" -">>> typical = configparser.ConfigParser()\n" -">>> typical.read_string(config)\n" -">>> typical.sections()\n" -"['Section 1', ' Section 2 ']\n" -">>> custom = configparser.ConfigParser()\n" -">>> custom.SECTCRE = re.compile(r\"\\[ *(?P
[^]]+?) *\\]\")\n" -">>> custom.read_string(config)\n" -">>> custom.sections()\n" -"['Section 1', 'Section 2']" -msgstr "" - -#: ../../library/configparser.rst:837 +#: ../../library/configparser.rst:771 msgid "" "While ConfigParser objects also use an ``OPTCRE`` attribute for recognizing " "option lines, it's not recommended to override it because that would " @@ -1273,11 +845,11 @@ msgstr "" "これを上書きすることは推奨されません。上書きするとコンストラクタオプション " "*allow_no_value* および *delimiters* に干渉します。" -#: ../../library/configparser.rst:843 +#: ../../library/configparser.rst:777 msgid "Legacy API Examples" msgstr "レガシーな API の例" -#: ../../library/configparser.rst:845 +#: ../../library/configparser.rst:779 msgid "" "Mainly because of backwards compatibility concerns, :mod:`configparser` " "provides also a legacy API with explicit ``get``/``set`` methods. While " @@ -1291,97 +863,19 @@ msgstr "" "いです。レガシーな API は時折高度で、低レベルで、まったく直感的ではありませ" "ん。" -#: ../../library/configparser.rst:851 +#: ../../library/configparser.rst:785 msgid "An example of writing to a configuration file::" msgstr "設定ファイルを書き出す例::" -#: ../../library/configparser.rst:853 -msgid "" -"import configparser\n" -"\n" -"config = configparser.RawConfigParser()\n" -"\n" -"# Please note that using RawConfigParser's set functions, you can assign\n" -"# non-string values to keys internally, but will receive an error when\n" -"# attempting to write to a file or when you get it in non-raw mode. Setting\n" -"# values using the mapping protocol or ConfigParser's set() does not allow\n" -"# such assignments to take place.\n" -"config.add_section('Section1')\n" -"config.set('Section1', 'an_int', '15')\n" -"config.set('Section1', 'a_bool', 'true')\n" -"config.set('Section1', 'a_float', '3.1415')\n" -"config.set('Section1', 'baz', 'fun')\n" -"config.set('Section1', 'bar', 'Python')\n" -"config.set('Section1', 'foo', '%(bar)s is %(baz)s!')\n" -"\n" -"# Writing our configuration file to 'example.cfg'\n" -"with open('example.cfg', 'w') as configfile:\n" -" config.write(configfile)" -msgstr "" - -#: ../../library/configparser.rst:874 +#: ../../library/configparser.rst:808 msgid "An example of reading the configuration file again::" msgstr "設定ファイルを読み込む例::" -#: ../../library/configparser.rst:876 -msgid "" -"import configparser\n" -"\n" -"config = configparser.RawConfigParser()\n" -"config.read('example.cfg')\n" -"\n" -"# getfloat() raises an exception if the value is not a float\n" -"# getint() and getboolean() also do this for their respective types\n" -"a_float = config.getfloat('Section1', 'a_float')\n" -"an_int = config.getint('Section1', 'an_int')\n" -"print(a_float + an_int)\n" -"\n" -"# Notice that the next output does not interpolate '%(bar)s' or '%(baz)s'.\n" -"# This is because we are using a RawConfigParser().\n" -"if config.getboolean('Section1', 'a_bool'):\n" -" print(config.get('Section1', 'foo'))" -msgstr "" - -#: ../../library/configparser.rst:892 +#: ../../library/configparser.rst:826 msgid "To get interpolation, use :class:`ConfigParser`::" msgstr "補間するには、 :class:`ConfigParser` を使ってください::" -#: ../../library/configparser.rst:894 -msgid "" -"import configparser\n" -"\n" -"cfg = configparser.ConfigParser()\n" -"cfg.read('example.cfg')\n" -"\n" -"# Set the optional *raw* argument of get() to True if you wish to disable\n" -"# interpolation in a single get operation.\n" -"print(cfg.get('Section1', 'foo', raw=False)) # -> \"Python is fun!\"\n" -"print(cfg.get('Section1', 'foo', raw=True)) # -> \"%(bar)s is %(baz)s!\"\n" -"\n" -"# The optional *vars* argument is a dict with members that will take\n" -"# precedence in interpolation.\n" -"print(cfg.get('Section1', 'foo', vars={'bar': 'Documentation',\n" -" 'baz': 'evil'}))\n" -"\n" -"# The optional *fallback* argument can be used to provide a fallback value\n" -"print(cfg.get('Section1', 'foo'))\n" -" # -> \"Python is fun!\"\n" -"\n" -"print(cfg.get('Section1', 'foo', fallback='Monty is not.'))\n" -" # -> \"Python is fun!\"\n" -"\n" -"print(cfg.get('Section1', 'monster', fallback='No such things as " -"monsters.'))\n" -" # -> \"No such things as monsters.\"\n" -"\n" -"# A bare print(cfg.get('Section1', 'monster')) would raise NoOptionError\n" -"# but we can also use:\n" -"\n" -"print(cfg.get('Section1', 'monster', fallback=None))\n" -" # -> None" -msgstr "" - -#: ../../library/configparser.rst:925 +#: ../../library/configparser.rst:859 msgid "" "Default values are available in both types of ConfigParsers. They are used " "in interpolation if an option used is not defined elsewhere. ::" @@ -1389,25 +883,11 @@ msgstr "" "どちらの型の ConfigParsers でもデフォルト値が利用できます。使われているオプ" "ションがどこにも定義されていなければ、そのデフォルト値が補間に使われます。 ::" -#: ../../library/configparser.rst:928 -msgid "" -"import configparser\n" -"\n" -"# New instance with 'bar' and 'baz' defaulting to 'Life' and 'hard' each\n" -"config = configparser.ConfigParser({'bar': 'Life', 'baz': 'hard'})\n" -"config.read('example.cfg')\n" -"\n" -"print(config.get('Section1', 'foo')) # -> \"Python is fun!\"\n" -"config.remove_option('Section1', 'bar')\n" -"config.remove_option('Section1', 'baz')\n" -"print(config.get('Section1', 'foo')) # -> \"Life is hard!\"" -msgstr "" - -#: ../../library/configparser.rst:943 +#: ../../library/configparser.rst:877 msgid "ConfigParser Objects" msgstr "ConfigParser オブジェクト" -#: ../../library/configparser.rst:953 +#: ../../library/configparser.rst:881 msgid "" "The main configuration parser. When *defaults* is given, it is initialized " "into the dictionary of intrinsic defaults. When *dict_type* is given, it " @@ -1418,7 +898,7 @@ msgstr "" "化されます。*dict_type* が与えられれば、それがセクションの一覧、セクション中" "のオプション、およびデフォルト値の辞書オブジェクトを作成するのに使われます。" -#: ../../library/configparser.rst:958 +#: ../../library/configparser.rst:886 msgid "" "When *delimiters* is given, it is used as the set of substrings that divide " "keys from values. When *comment_prefixes* is given, it will be used as the " @@ -1432,7 +912,7 @@ msgstr "" "す。*inline_comment_prefixes* が与えられた場合、非空行のコメントに接頭する部" "分文字列としての組み合わせとして使われます。" -#: ../../library/configparser.rst:964 +#: ../../library/configparser.rst:892 msgid "" "When *strict* is ``True`` (the default), the parser won't allow for any " "section or option duplicates while reading from a single source (file, " @@ -1452,17 +932,19 @@ msgstr "" "``False``) なら、値のないオプションが受け付けられます。そのオプションの値は " "``None`` となり、後端のデリミタを除いてシリアル化されます。" -#: ../../library/configparser.rst:974 +#: ../../library/configparser.rst:902 msgid "" "When *default_section* is given, it specifies the name for the special " "section holding default values for other sections and interpolation purposes " "(normally named ``\"DEFAULT\"``). This value can be retrieved and changed " -"at runtime using the ``default_section`` instance attribute. This won't re-" -"evaluate an already parsed config file, but will be used when writing parsed " -"settings to a new config file." +"on runtime using the ``default_section`` instance attribute." msgstr "" +"*default_section* が与えられた場合、他のセクションへのデフォルト値や補間のた" +"めのデフォルト値を保持する特別なセクションの名前を指定します (通常は " +"``\"DEFAULT\"`` という名前です)。この値は実行時に ``default_section`` インス" +"タンス属性を使って取得や変更ができます。" -#: ../../library/configparser.rst:981 +#: ../../library/configparser.rst:907 msgid "" "Interpolation behaviour may be customized by providing a custom handler " "through the *interpolation* argument. ``None`` can be used to turn off " @@ -1476,7 +958,7 @@ msgstr "" "を提供します。この件に `特化したドキュメントのセクション <#interpolation-of-" "values>`_ を参照してください。" -#: ../../library/configparser.rst:987 +#: ../../library/configparser.rst:913 msgid "" "All option names used in interpolation will be passed through the :meth:" "`optionxform` method just like any other option name reference. For " @@ -1489,27 +971,24 @@ msgstr "" "フォルトの実装を使うと、値 ``foo %(bar)s`` と ``foo %(BAR)s`` は等しくなりま" "す。" -#: ../../library/configparser.rst:993 +#: ../../library/configparser.rst:919 msgid "" "When *converters* is given, it should be a dictionary where each key " "represents the name of a type converter and each value is a callable " "implementing the conversion from string to the desired datatype. Every " -"converter gets its own corresponding :meth:`!get*` method on the parser " +"converter gets its own corresponding :meth:`get*()` method on the parser " "object and section proxies." msgstr "" +"*converters* が与えられた場合、各キーが型コンバーターの名前を表し、各値が文字" +"列から目的のデータ型への変換を実装する呼び出し可能オブジェクトです。各コン" +"バーターは、自身の対応する :meth:`get*()` メソッドをパーサーオブジェクトとセ" +"クションプロキシで取得します。" -#: ../../library/configparser.rst:999 -msgid "" -"When *allow_unnamed_section* is ``True`` (default: ``False``), the first " -"section name can be omitted. See the `\"Unnamed Sections\" section <#unnamed-" -"sections>`_." -msgstr "" - -#: ../../library/configparser.rst:1028 +#: ../../library/configparser.rst:925 msgid "The default *dict_type* is :class:`collections.OrderedDict`." msgstr "デフォルトの *dict_type* は :class:`collections.OrderedDict` です。" -#: ../../library/configparser.rst:1031 ../../library/configparser.rst:1324 +#: ../../library/configparser.rst:928 msgid "" "*allow_no_value*, *delimiters*, *comment_prefixes*, *strict*, " "*empty_lines_in_values*, *default_section* and *interpolation* were added." @@ -1518,38 +997,28 @@ msgstr "" "*empty_lines_in_values*, *default_section* および *interpolation* が追加され" "ました。" -#: ../../library/configparser.rst:1036 ../../library/configparser.rst:1329 +#: ../../library/configparser.rst:933 msgid "The *converters* argument was added." msgstr "*converters* 引数が追加されました。" -#: ../../library/configparser.rst:1039 +#: ../../library/configparser.rst:936 msgid "" -"The *defaults* argument is read with :meth:`read_dict`, providing consistent " -"behavior across the parser: non-string keys and values are implicitly " -"converted to strings." +"The *defaults* argument is read with :meth:`read_dict()`, providing " +"consistent behavior across the parser: non-string keys and values are " +"implicitly converted to strings." msgstr "" -#: ../../library/configparser.rst:1044 ../../library/configparser.rst:1332 +#: ../../library/configparser.rst:941 ../../library/configparser.rst:1226 msgid "" "The default *dict_type* is :class:`dict`, since it now preserves insertion " "order." msgstr "" -#: ../../library/configparser.rst:1048 -msgid "" -"Raise a :exc:`MultilineContinuationError` when *allow_no_value* is ``True``, " -"and a key without a value is continued with an indented line." -msgstr "" - -#: ../../library/configparser.rst:1052 ../../library/configparser.rst:1336 -msgid "The *allow_unnamed_section* argument was added." -msgstr "" - -#: ../../library/configparser.rst:1057 +#: ../../library/configparser.rst:947 msgid "Return a dictionary containing the instance-wide defaults." msgstr "インスタンス全体で使われるデフォルト値の辞書を返します。" -#: ../../library/configparser.rst:1062 +#: ../../library/configparser.rst:952 msgid "" "Return a list of the sections available; the *default section* is not " "included in the list." @@ -1557,7 +1026,7 @@ msgstr "" "利用できるセクションのリストを返します。*default section* はリストに含まれま" "せん。" -#: ../../library/configparser.rst:1068 +#: ../../library/configparser.rst:958 msgid "" "Add a section named *section* to the instance. If a section by the given " "name already exists, :exc:`DuplicateSectionError` is raised. If the " @@ -1570,11 +1039,11 @@ msgstr "" "ンの名前は文字列でなければなりません。そうでなければ、 :exc:`TypeError` が送" "出されます。" -#: ../../library/configparser.rst:1073 +#: ../../library/configparser.rst:963 msgid "Non-string section names raise :exc:`TypeError`." msgstr "文字列でないセクション名は :exc:`TypeError` を送出します。" -#: ../../library/configparser.rst:1079 +#: ../../library/configparser.rst:969 msgid "" "Indicates whether the named *section* is present in the configuration. The " "*default section* is not acknowledged." @@ -1582,11 +1051,11 @@ msgstr "" "指名された *section* が設定中に存在するかを示します。*default section* は認識" "されません。" -#: ../../library/configparser.rst:1085 +#: ../../library/configparser.rst:975 msgid "Return a list of options available in the specified *section*." msgstr "指定された *section* 中で利用できるオプションのリストを返します。" -#: ../../library/configparser.rst:1090 +#: ../../library/configparser.rst:980 msgid "" "If the given *section* exists, and contains the given *option*, return :" "const:`True`; otherwise return :const:`False`. If the specified *section* " @@ -1596,7 +1065,7 @@ msgstr "" "`True` を返します。それ以外の場合には、 :const:`False` を返します。指定され" "た *section* が :const:`None` または空文字列の場合、 DEFAULT が仮定されます。" -#: ../../library/configparser.rst:1097 +#: ../../library/configparser.rst:987 msgid "" "Attempt to read and parse an iterable of filenames, returning a list of " "filenames which were successfully parsed." @@ -1604,7 +1073,7 @@ msgstr "" "ファイル名の iterable を読み込んでパースしようと試みます。正常にパースできた" "ファイル名のリストを返します。" -#: ../../library/configparser.rst:1100 +#: ../../library/configparser.rst:990 msgid "" "If *filenames* is a string, a :class:`bytes` object or a :term:`path-like " "object`, it is treated as a single filename. If a file named in *filenames* " @@ -1614,14 +1083,14 @@ msgid "" "wide directory), and all existing configuration files in the iterable will " "be read." msgstr "" -"もし *filenames* が文字列か :class:`bytes` オブジェクトか :term:`path-like " -"object` なら、この引数は1つのファイル名として扱われます。 *filenames* 中に開" -"けないファイルがある場合、そのファイルは無視されます。この挙動は、設定ファイ" -"ルが置かれる可能性のある場所(例えば、 カレントディレクトリ、ホームディレクト" -"リ、システム全体の設定を行うディレクトリ)のイテラブルを指定して、イテラブルの" -"中で存在する全ての設定ファイルを読むことを想定して設計されています。 " +"もし *filenames* が文字列か :term:`path-like object` なら、この引数は1つの" +"ファイル名として扱われます。 *filenames* 中に開けないファイルがある場合、その" +"ファイルは無視されます。この挙動は、設定ファイルが置かれる可能性のある場所(例" +"えば、 カレントディレクトリ、ホームディレクトリ、システム全体の設定を行うディ" +"レクトリ)のイテラブルを指定して、イテラブルの中で存在する全ての設定ファイルを" +"読むことを想定して設計されています。 " -#: ../../library/configparser.rst:1109 +#: ../../library/configparser.rst:999 msgid "" "If none of the named files exist, the :class:`ConfigParser` instance will " "contain an empty dataset. An application which requires initial values to " @@ -1634,33 +1103,25 @@ msgstr "" "を呼ぶ前に 、まず :meth:`read_file` を用いて必要なファイルを読み込んでくださ" "い::" -#: ../../library/configparser.rst:1115 -msgid "" -"import configparser, os\n" -"\n" -"config = configparser.ConfigParser()\n" -"config.read_file(open('defaults.cfg'))\n" -"config.read(['site.cfg', os.path.expanduser('~/.myapp.cfg')],\n" -" encoding='cp1250')" -msgstr "" - -#: ../../library/configparser.rst:1122 +#: ../../library/configparser.rst:1012 msgid "" -"Added the *encoding* parameter. Previously, all files were read using the " -"default encoding for :func:`open`." +"The *encoding* parameter. Previously, all files were read using the default " +"encoding for :func:`open`." msgstr "" +"*encoding* 引数。以前は、すべてのファイルが :func:`open` のデフォルトエンコー" +"ディングを使って読まれていました。" -#: ../../library/configparser.rst:1126 +#: ../../library/configparser.rst:1016 msgid "The *filenames* parameter accepts a :term:`path-like object`." msgstr "" "*filenames* 引数が :term:`path-like object` を受け入れるようになりました。" -#: ../../library/configparser.rst:1129 +#: ../../library/configparser.rst:1019 msgid "The *filenames* parameter accepts a :class:`bytes` object." msgstr "" "*filenames* 引数が :class:`bytes` オブジェクトを受け入れるようになりました。" -#: ../../library/configparser.rst:1135 +#: ../../library/configparser.rst:1025 msgid "" "Read and parse configuration data from *f* which must be an iterable " "yielding Unicode strings (for example files opened in text mode)." @@ -1668,22 +1129,25 @@ msgstr "" "設定データを *f* から読み込んで解析します。*f* は Unicode 文字列を yield する" "イテラブル (例えばテキストモードで開かれたファイル) です。" -#: ../../library/configparser.rst:1138 +#: ../../library/configparser.rst:1028 msgid "" "Optional argument *source* specifies the name of the file being read. If " -"not given and *f* has a :attr:`!name` attribute, that is used for *source*; " +"not given and *f* has a :attr:`name` attribute, that is used for *source*; " "the default is ``''``." msgstr "" +"オプションの引数 *source* は読み込まれるファイルの名前を指定します。与えられ" +"ず、 *f* に :attr:`name` 属性があれば、それが *source* として使われます。デ" +"フォルトは ``''`` です。" -#: ../../library/configparser.rst:1142 -msgid "Replaces :meth:`!readfp`." -msgstr ":meth:`!readfp` を置き換えます。" +#: ../../library/configparser.rst:1032 +msgid "Replaces :meth:`readfp`." +msgstr ":meth:`readfp` を置き換えます。" -#: ../../library/configparser.rst:1147 +#: ../../library/configparser.rst:1037 msgid "Parse configuration data from a string." msgstr "設定データを文字列から解析します。" -#: ../../library/configparser.rst:1149 +#: ../../library/configparser.rst:1039 msgid "" "Optional argument *source* specifies a context-specific name of the string " "passed. If not given, ``''`` is used. This should commonly be a " @@ -1693,7 +1157,7 @@ msgstr "" "ます。与えられなければ、``''`` が使われます。これは一般にファイルシス" "テムパスや URL にします。" -#: ../../library/configparser.rst:1158 +#: ../../library/configparser.rst:1048 msgid "" "Load configuration from any object that provides a dict-like ``items()`` " "method. Keys are section names, values are dictionaries with keys and " @@ -1706,7 +1170,7 @@ msgstr "" "使われた辞書型が順序を保存するなら、セクションおよびそのキーは順に加えられま" "す。値は自動で文字列に変換されます。" -#: ../../library/configparser.rst:1164 +#: ../../library/configparser.rst:1054 msgid "" "Optional argument *source* specifies a context-specific name of the " "dictionary passed. If not given, ```` is used." @@ -1714,11 +1178,11 @@ msgstr "" "オプションの引数 *source* はコンテキストにおける渡された辞書の名前を指定しま" "す。与えられなければ、```` が使われます。" -#: ../../library/configparser.rst:1167 +#: ../../library/configparser.rst:1057 msgid "This method can be used to copy state between parsers." msgstr "このメソッドを使ってパーサー間で状態をコピーできます。" -#: ../../library/configparser.rst:1174 +#: ../../library/configparser.rst:1064 msgid "" "Get an *option* value for the named *section*. If *vars* is provided, it " "must be a dictionary. The *option* is looked up in *vars* (if provided), " @@ -1731,7 +1195,7 @@ msgstr "" "*DEFAULTSECT* 内からこの順で *option* が探索されます。*fallback* の値として " "``None`` を与えられます。" -#: ../../library/configparser.rst:1180 +#: ../../library/configparser.rst:1070 msgid "" "All the ``'%'`` interpolations are expanded in the return values, unless the " "*raw* argument is true. Values for interpolation keys are looked up in the " @@ -1740,7 +1204,7 @@ msgstr "" "*raw* が真でない時には、全ての ``'%'`` 置換は展開されてから返されます。置換後" "の値はオプションと同じ順序で探されます。" -#: ../../library/configparser.rst:1184 +#: ../../library/configparser.rst:1074 msgid "" "Arguments *raw*, *vars* and *fallback* are keyword only to protect users " "from trying to use the third argument as the *fallback* fallback (especially " @@ -1750,7 +1214,7 @@ msgstr "" "ときに) ユーザーが第 3 引数を *fallback* フォールバックとして使おうとしないよ" "うに、キーワード専用となりました。" -#: ../../library/configparser.rst:1192 +#: ../../library/configparser.rst:1082 msgid "" "A convenience method which coerces the *option* in the specified *section* " "to an integer. See :meth:`get` for explanation of *raw*, *vars* and " @@ -1759,14 +1223,17 @@ msgstr "" "指定された *section* 中の *option* を整数に型強制する補助メソッドです。 " "*raw*, *vars* および *fallback* の説明は :meth:`get` を参照してください。" -#: ../../library/configparser.rst:1199 +#: ../../library/configparser.rst:1089 msgid "" "A convenience method which coerces the *option* in the specified *section* " -"to a floating-point number. See :meth:`get` for explanation of *raw*, " +"to a floating point number. See :meth:`get` for explanation of *raw*, " "*vars* and *fallback*." msgstr "" +"指定された *section* 中の *option* を浮動小数点数に型強制する補助メソッドで" +"す。 *raw*, *vars* および *fallback* の説明は :meth:`get` を参照してくださ" +"い。" -#: ../../library/configparser.rst:1206 +#: ../../library/configparser.rst:1096 msgid "" "A convenience method which coerces the *option* in the specified *section* " "to a Boolean value. Note that the accepted values for the option are " @@ -1784,7 +1251,7 @@ msgstr "" "も :exc:`ValueError` を送出します。 *raw*, *vars* および *fallback* の説明" "は :meth:`get` を参照してください。" -#: ../../library/configparser.rst:1219 +#: ../../library/configparser.rst:1109 msgid "" "When *section* is not given, return a list of *section_name*, " "*section_proxy* pairs, including DEFAULTSECT." @@ -1792,7 +1259,7 @@ msgstr "" "*section* が与えられなければ、DEFAULTSECT を含めた *section_name*, " "*section_proxy* の対のリストを返します。" -#: ../../library/configparser.rst:1222 +#: ../../library/configparser.rst:1112 msgid "" "Otherwise, return a list of *name*, *value* pairs for the options in the " "given *section*. Optional arguments have the same meaning as for the :meth:" @@ -1802,7 +1269,7 @@ msgstr "" "ストを返します。オプションの引数は :meth:`get` メソッドに与えるものと同じ意味" "を持ちます。" -#: ../../library/configparser.rst:1226 +#: ../../library/configparser.rst:1116 msgid "" "Items present in *vars* no longer appear in the result. The previous " "behaviour mixed actual parser options with variables provided for " @@ -1811,7 +1278,7 @@ msgstr "" "*vars* に現れる項目は結果に表れなくなりました。以前の挙動は、実際のパーサーオ" "プションを補間のために与えられた変数と混合していました。" -#: ../../library/configparser.rst:1234 +#: ../../library/configparser.rst:1124 msgid "" "If the given section exists, set the given option to the specified value; " "otherwise raise :exc:`NoSectionError`. *option* and *value* must be " @@ -1822,7 +1289,7 @@ msgstr "" "*value* は文字列でなければなりません。そうでなければ :exc:`TypeError` が送出" "されます。" -#: ../../library/configparser.rst:1241 +#: ../../library/configparser.rst:1131 msgid "" "Write a representation of the configuration to the specified :term:`file " "object`, which must be opened in text mode (accepting strings). This " @@ -1835,20 +1302,14 @@ msgstr "" "後で :meth:`read` を呼び出すことでパースできます。 *space_around_delimiters* " "が真なら、キーと値の間のデリミタはスペースで囲まれます。" -#: ../../library/configparser.rst:1247 -msgid "" -"Raises InvalidWriteError if this would write a representation which cannot " -"be accurately parsed by a future :meth:`read` call from this parser." -msgstr "" - -#: ../../library/configparser.rst:1253 +#: ../../library/configparser.rst:1139 msgid "" "Comments in the original configuration file are not preserved when writing " "the configuration back. What is considered a comment, depends on the given " "values for *comment_prefix* and *inline_comment_prefix*." msgstr "" -#: ../../library/configparser.rst:1261 +#: ../../library/configparser.rst:1147 msgid "" "Remove the specified *option* from the specified *section*. If the section " "does not exist, raise :exc:`NoSectionError`. If the option existed to be " @@ -1858,7 +1319,7 @@ msgstr "" "なければ、 :exc:`NoSectionError` を送出します。オプションが存在して削除されれ" "ば、 :const:`True` を返します。そうでなければ :const:`False` を返します。" -#: ../../library/configparser.rst:1269 +#: ../../library/configparser.rst:1155 msgid "" "Remove the specified *section* from the configuration. If the section in " "fact existed, return ``True``. Otherwise return ``False``." @@ -1866,7 +1327,7 @@ msgstr "" "指定された *section* を設定から削除します。セクションが実際に存在すれば、" "``True`` を返します。そうでなければ ``False`` を返します。" -#: ../../library/configparser.rst:1275 +#: ../../library/configparser.rst:1161 msgid "" "Transforms the option name *option* as found in an input file or as passed " "in by client code to the form that should be used in the internal " @@ -1880,7 +1341,7 @@ msgstr "" "コードでインスタンス上のこの名前の属性を設定して、この動作に影響を与えること" "ができます。" -#: ../../library/configparser.rst:1281 +#: ../../library/configparser.rst:1167 msgid "" "You don't need to subclass the parser to use this method, you can also set " "it on an instance, to a function that takes a string argument and returns a " @@ -1891,13 +1352,7 @@ msgstr "" "上で、これを文字列引数をとって文字列を返す関数に設定できます。例えば、これを " "``str`` に設定すると、オプション名に大文字小文字の区別をつけられます::" -#: ../../library/configparser.rst:1286 -msgid "" -"cfgparser = ConfigParser()\n" -"cfgparser.optionxform = str" -msgstr "" - -#: ../../library/configparser.rst:1289 +#: ../../library/configparser.rst:1175 msgid "" "Note that when reading configuration files, whitespace around the option " "names is stripped before :meth:`optionxform` is called." @@ -1905,24 +1360,49 @@ msgstr "" "なお、設定ファイルを読み込むとき、オプション名の周りの空白は :meth:" "`optionxform` が呼び出される前に取り除かれます。" -#: ../../library/configparser.rst:1295 +#: ../../library/configparser.rst:1181 +msgid "Use :meth:`read_file` instead." +msgstr "代わりに :meth:`read_file` を使ってください。" + +#: ../../library/configparser.rst:1184 +msgid "" +":meth:`readfp` now iterates on *fp* instead of calling ``fp.readline()``." +msgstr "" +":meth:`readfp` は ``fp.readline()`` を呼び出す代わりに *fp* をイテレートする" +"ようになりました。" + +#: ../../library/configparser.rst:1187 msgid "" -"A special object representing a section name used to reference the unnamed " -"section (see :ref:`unnamed-sections`)." +"For existing code calling :meth:`readfp` with arguments which don't support " +"iteration, the following generator may be used as a wrapper around the file-" +"like object::" msgstr "" +":meth:`readfp` をイテレーションをサポートしない引数で呼び出す既存のコードに" +"は、ファイル的なオブジェクトまわりのラッパーとして以下のジェネレーターが使え" +"ます::" -#: ../../library/configparser.rst:1300 +#: ../../library/configparser.rst:1197 msgid "" -"The maximum depth for recursive interpolation for :meth:`~configparser." -"ConfigParser.get` when the *raw* parameter is false. This is relevant only " -"when the default *interpolation* is used." +"Instead of ``parser.readfp(fp)`` use ``parser." +"read_file(readline_generator(fp))``." msgstr "" +"``parser.readfp(fp)`` の代わりに ``parser." +"read_file(readline_generator(fp))`` を使ってください。" -#: ../../library/configparser.rst:1308 +#: ../../library/configparser.rst:1203 +msgid "" +"The maximum depth for recursive interpolation for :meth:`get` when the *raw* " +"parameter is false. This is relevant only when the default *interpolation* " +"is used." +msgstr "" +":meth:`get` の *raw* が偽であるときの再帰的な補間の最大の深さです。これはデ" +"フォルトの *interpolation* を使うときのみ関係します。" + +#: ../../library/configparser.rst:1211 msgid "RawConfigParser Objects" msgstr "RawConfigParser オブジェクト" -#: ../../library/configparser.rst:1319 +#: ../../library/configparser.rst:1221 msgid "" "Legacy variant of the :class:`ConfigParser`. It has interpolation disabled " "by default and allows for non-string section names, option names, and values " @@ -1930,7 +1410,7 @@ msgid "" "``defaults=`` keyword argument handling." msgstr "" -#: ../../library/configparser.rst:1340 +#: ../../library/configparser.rst:1231 msgid "" "Consider using :class:`ConfigParser` instead which checks types of the " "values to be stored internally. If you don't want interpolation, you can " @@ -1940,20 +1420,17 @@ msgstr "" "してください。補間を望まない場合、 ``ConfigParser(interpolation=None)`` を使" "用できます。" -#: ../../library/configparser.rst:1347 -msgid "" -"Add a section named *section* or :const:`UNNAMED_SECTION` to the instance." -msgstr "" - -#: ../../library/configparser.rst:1349 +#: ../../library/configparser.rst:1238 msgid "" -"If the given section already exists, :exc:`DuplicateSectionError` is raised. " -"If the *default section* name is passed, :exc:`ValueError` is raised. If :" -"const:`UNNAMED_SECTION` is passed and support is disabled, :exc:" -"`UnnamedSectionDisabledError` is raised." +"Add a section named *section* to the instance. If a section by the given " +"name already exists, :exc:`DuplicateSectionError` is raised. If the " +"*default section* name is passed, :exc:`ValueError` is raised." msgstr "" +"インスタンスに *section* という名のセクションを追加します。与えられた名前のセ" +"クションがすでに存在すれば、 :exc:`DuplicateSectionError` が送出されます。 " +"*default section* 名が渡されると、 :exc:`ValueError` が送出されます。" -#: ../../library/configparser.rst:1354 +#: ../../library/configparser.rst:1242 msgid "" "Type of *section* is not checked which lets users create non-string named " "sections. This behaviour is unsupported and may cause internal errors." @@ -1962,11 +1439,7 @@ msgstr "" "ることができます。この振る舞いはサポートされておらず、内部エラーを起こす可能" "性があります。" -#: ../../library/configparser.rst:1357 -msgid "Added support for :const:`UNNAMED_SECTION`." -msgstr "" - -#: ../../library/configparser.rst:1363 +#: ../../library/configparser.rst:1248 msgid "" "If the given section exists, set the given option to the specified value; " "otherwise raise :exc:`NoSectionError`. While it is possible to use :class:" @@ -1982,7 +1455,7 @@ msgstr "" "ですが、すべての機能 (置換やファイルへの出力を含む) がサポートされるのは文字" "列を値として使った場合だけです。" -#: ../../library/configparser.rst:1370 +#: ../../library/configparser.rst:1255 msgid "" "This method lets users assign non-string values to keys internally. This " "behaviour is unsupported and will cause errors when attempting to write to a " @@ -1994,32 +1467,37 @@ msgstr "" "みた際にエラーの原因となりえます。このような代入を許さない **マッピングプロ" "トコルAPIを使用してください**。" -#: ../../library/configparser.rst:1377 +#: ../../library/configparser.rst:1262 msgid "Exceptions" msgstr "例外" -#: ../../library/configparser.rst:1381 +#: ../../library/configparser.rst:1266 msgid "Base class for all other :mod:`configparser` exceptions." msgstr "他の全ての :mod:`configparser` 例外の基底クラスです。" -#: ../../library/configparser.rst:1386 +#: ../../library/configparser.rst:1271 msgid "Exception raised when a specified section is not found." msgstr "指定したセクションが見つからなかった時に起きる例外です。" -#: ../../library/configparser.rst:1391 +#: ../../library/configparser.rst:1276 msgid "" -"Exception raised if :meth:`~ConfigParser.add_section` is called with the " -"name of a section that is already present or in strict parsers when a " -"section if found more than once in a single input file, string or dictionary." +"Exception raised if :meth:`add_section` is called with the name of a section " +"that is already present or in strict parsers when a section if found more " +"than once in a single input file, string or dictionary." msgstr "" +":meth:`add_section` がすでに存在するセクションの名前で呼び出された場合や、" +"strict なパーサーで単一の入力ファイル、文字列、辞書中に同じセクションが複数回" +"現れたときに送出される例外です。" -#: ../../library/configparser.rst:1395 +#: ../../library/configparser.rst:1280 msgid "" -"Added the optional *source* and *lineno* attributes and parameters to :meth:" -"`!__init__`." +"Optional ``source`` and ``lineno`` attributes and arguments to :meth:" +"`__init__` were added." msgstr "" +"オプションの ``source`` と ``lineno`` が属性および :meth:`__init__` への引数" +"として加えられました。" -#: ../../library/configparser.rst:1402 +#: ../../library/configparser.rst:1287 msgid "" "Exception raised by strict parsers if a single option appears twice during " "reading from a single file, string or dictionary. This catches misspellings " @@ -2031,7 +1509,7 @@ msgstr "" "するエラー、例えば辞書の二つのキーが同じ大文字小文字の区別のない設定キーを表" "すこと、を捕捉します。" -#: ../../library/configparser.rst:1410 +#: ../../library/configparser.rst:1295 msgid "" "Exception raised when a specified option is not found in the specified " "section." @@ -2039,13 +1517,13 @@ msgstr "" "指定されたオプションが指定されたセクションに見つからないときに送出される例外" "です。" -#: ../../library/configparser.rst:1416 +#: ../../library/configparser.rst:1301 msgid "" "Base class for exceptions raised when problems occur performing string " "interpolation." msgstr "文字列の補間中に問題が起きた時に発生する例外の基底クラスです。" -#: ../../library/configparser.rst:1422 +#: ../../library/configparser.rst:1307 msgid "" "Exception raised when string interpolation cannot be completed because the " "number of iterations exceeds :const:`MAX_INTERPOLATION_DEPTH`. Subclass of :" @@ -2055,7 +1533,7 @@ msgstr "" "完了しなかったときに送出される例外です。 :exc:`InterpolationError` の派生クラ" "スです。" -#: ../../library/configparser.rst:1429 +#: ../../library/configparser.rst:1314 msgid "" "Exception raised when an option referenced from a value does not exist. " "Subclass of :exc:`InterpolationError`." @@ -2063,7 +1541,7 @@ msgstr "" ":exc:`InterpolationError` の派生クラスで、値が参照しているオプションが見つか" "らない場合に発生する例外です。" -#: ../../library/configparser.rst:1435 +#: ../../library/configparser.rst:1320 msgid "" "Exception raised when the source text into which substitutions are made does " "not conform to the required syntax. Subclass of :exc:`InterpolationError`." @@ -2071,53 +1549,30 @@ msgstr "" "置換がなされるソーステキストが要求された文法を満たさないときに送出される例外" "です。 :exc:`InterpolationError` の派生クラスです。" -#: ../../library/configparser.rst:1441 +#: ../../library/configparser.rst:1326 msgid "" "Exception raised when attempting to parse a file which has no section " "headers." msgstr "" "セクションヘッダを持たないファイルを構文解析しようとした時に起きる例外です。" -#: ../../library/configparser.rst:1446 +#: ../../library/configparser.rst:1332 msgid "Exception raised when errors occur attempting to parse a file." msgstr "ファイルの構文解析中にエラーが起きた場合に発生する例外です。" -#: ../../library/configparser.rst:1448 +#: ../../library/configparser.rst:1334 msgid "" -"The ``filename`` attribute and :meth:`!__init__` constructor argument were " -"removed. They have been available using the name ``source`` since 3.2." +"The ``filename`` attribute and :meth:`__init__` argument were renamed to " +"``source`` for consistency." msgstr "" +"``filename`` という属性および :meth:`__init__` の引数は ``source`` に名前が変" +"更されました。" -#: ../../library/configparser.rst:1454 -msgid "" -"Exception raised when a key without a corresponding value is continued with " -"an indented line." -msgstr "" - -#: ../../library/configparser.rst:1461 -msgid "" -"Exception raised when attempting to use the :const:`UNNAMED_SECTION` without " -"enabling it." -msgstr "" - -#: ../../library/configparser.rst:1468 -msgid "" -"Exception raised when an attempted :meth:`ConfigParser.write` would not be " -"parsed accurately with a future :meth:`ConfigParser.read` call." -msgstr "" - -#: ../../library/configparser.rst:1471 -msgid "" -"Ex: Writing a key beginning with the :attr:`ConfigParser.SECTCRE` pattern " -"would parse as a section header when read. Attempting to write this will " -"raise this exception." -msgstr "" - -#: ../../library/configparser.rst:1478 +#: ../../library/configparser.rst:1340 msgid "Footnotes" msgstr "脚注" -#: ../../library/configparser.rst:1479 +#: ../../library/configparser.rst:1341 msgid "" "Config parsers allow for heavy customization. If you are interested in " "changing the behaviour outlined by the footnote reference, consult the " @@ -2126,35 +1581,3 @@ msgstr "" "設定パーサーは大々的にカスタマイズできます。脚注の参照で概説された挙動の変更" "に関心がある場合、`Customizing Parser Behaviour`_ セクションを参照してくださ" "い。" - -#: ../../library/configparser.rst:16 -msgid ".ini" -msgstr ".ini" - -#: ../../library/configparser.rst:16 -msgid "file" -msgstr "ファイル" - -#: ../../library/configparser.rst:16 -msgid "configuration" -msgstr "設定" - -#: ../../library/configparser.rst:16 -msgid "ini file" -msgstr "ini ファイル" - -#: ../../library/configparser.rst:16 -msgid "Windows ini file" -msgstr "Windows ini ファイル" - -#: ../../library/configparser.rst:367 -msgid "% (percent)" -msgstr "% (パーセント)" - -#: ../../library/configparser.rst:367 ../../library/configparser.rst:400 -msgid "interpolation in configuration files" -msgstr "" - -#: ../../library/configparser.rst:400 -msgid "$ (dollar)" -msgstr "$ (ダラー)" diff --git a/library/constants.po b/library/constants.po index 3c6df5379..d68d66fd6 100644 --- a/library/constants.po +++ b/library/constants.po @@ -1,27 +1,29 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: +# Nozomu Kaneko , 2017 +# Arihiro TAKASE, 2017 +# Osamu NAKAMURA, 2017 +# Suguru Yamamoto , 2017 # tomo, 2021 -# Arihiro TAKASE, 2023 -# Takanori Suzuki , 2024 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:57+0000\n" -"Last-Translator: Takanori Suzuki , 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 23:04+0000\n" +"Last-Translator: tomo, 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/constants.rst:4 @@ -50,87 +52,83 @@ msgstr "" #: ../../library/constants.rst:22 msgid "" -"An object frequently used to represent the absence of a value, as when " -"default arguments are not passed to a function. Assignments to ``None`` are " -"illegal and raise a :exc:`SyntaxError`. ``None`` is the sole instance of " -"the :data:`~types.NoneType` type." +"The sole value of the type ``NoneType``. ``None`` is frequently used to " +"represent the absence of a value, as when default arguments are not passed " +"to a function. Assignments to ``None`` are illegal and raise a :exc:" +"`SyntaxError`." msgstr "" -"関数にデフォルト引数が渡されなかったときなどに、値の非存在を表すのに頻繁に用" -"いられるオブジェクトです。``None`` への代入は不正で、:exc:`SyntaxError` を送" -"出します。``None`` が :data:`~types.NoneType` 型の唯一のインスタンスです。" +"型 ``NoneType`` の唯一の値です。 ``None`` は、関数にデフォルト引数が渡されな" +"かったときなどに、値の非存在を表すのに頻繁に用いられます。 ``None`` への代入" +"は不正で、:exc:`SyntaxError` を送出します。" -#: ../../library/constants.rst:30 +#: ../../library/constants.rst:29 msgid "" -"A special value which should be returned by the binary special methods (e." -"g. :meth:`~object.__eq__`, :meth:`~object.__lt__`, :meth:`~object.__add__`, :" -"meth:`~object.__rsub__`, etc.) to indicate that the operation is not " -"implemented with respect to the other type; may be returned by the in-place " -"binary special methods (e.g. :meth:`~object.__imul__`, :meth:`~object." -"__iand__`, etc.) for the same purpose. It should not be evaluated in a " -"boolean context. :data:`!NotImplemented` is the sole instance of the :data:" -"`types.NotImplementedType` type." -msgstr "" -"特殊な二項演算のメソッド (e.g. :meth:`~object.__eq__`, :meth:`~object." -"__lt__`, :meth:`~object.__add__`, :meth:`~object.__rsub__`, etc.) が、他の型" -"に対して演算が実装されていないことを示すために返す特殊値です。インプレースの" -"特殊な二項演算のメソッド (e.g. :meth:`~object.__imul__`, :meth:`~object." -"__iand__`, etc.) も同じ理由でこの値を返すことがあります。この処理では真偽値コ" -"ンテキストでの評価はしてはいけません。:data:`!NotImplemented` が :data:" -"`types.NotImplementedType` 型の唯一のインスタンスです。" - -#: ../../library/constants.rst:40 +"Special value which should be returned by the binary special methods (e.g. :" +"meth:`__eq__`, :meth:`__lt__`, :meth:`__add__`, :meth:`__rsub__`, etc.) to " +"indicate that the operation is not implemented with respect to the other " +"type; may be returned by the in-place binary special methods (e.g. :meth:" +"`__imul__`, :meth:`__iand__`, etc.) for the same purpose. It should not be " +"evaluated in a boolean context." +msgstr "" +"特殊な二項演算のメソッド (e.g. :meth:`__eq__`, :meth:`__lt__`, :meth:" +"`__add__`, :meth:`__rsub__`, etc.) が、他の型に対して演算が実装されていないこ" +"とを示すために返す特殊値です。インプレースの特殊な二項演算のメソッド (e.g. :" +"meth:`__imul__`, :meth:`__iand__`, etc.) も同じ理由でこの値を返すことがありま" +"す。この処理では真偽値コンテキストでの評価はしてはいけません。" + +#: ../../library/constants.rst:38 msgid "" -"When a binary (or in-place) method returns :data:`!NotImplemented` the " +"When a binary (or in-place) method returns ``NotImplemented`` the " "interpreter will try the reflected operation on the other type (or some " -"other fallback, depending on the operator). If all attempts return :data:`!" -"NotImplemented`, the interpreter will raise an appropriate exception. " -"Incorrectly returning :data:`!NotImplemented` will result in a misleading " -"error message or the :data:`!NotImplemented` value being returned to Python " -"code." -msgstr "" -"二項演算の (あるいはインプレースの) メソッドが :data:`!NotImplemented` を返し" -"た場合、インタープリタはもう一方の型で定義された対の演算で代用を試みます (あ" -"るいは演算によっては他の代替手段も試みます)。試行された演算全てが :data:`!" -"NotImplemented` を返した場合、インタープリタは適切な例外を送出します。 :data:" -"`!NotImplemented` を正しく返さないと、誤解を招きかねないエラーメッセージに" -"なったり、 :data:`!NotImplemented` が Python コードに返されるようなことになり" -"ます。" - -#: ../../library/constants.rst:47 +"other fallback, depending on the operator). If all attempts return " +"``NotImplemented``, the interpreter will raise an appropriate exception. " +"Incorrectly returning ``NotImplemented`` will result in a misleading error " +"message or the ``NotImplemented`` value being returned to Python code." +msgstr "" +"二項演算の (あるいはインプレースの) メソッドが ``NotImplemented`` を返した場" +"合、インタープリタはもう一方の型で定義された対の演算で代用を試みます (あるい" +"は演算によっては他の代替手段も試みます)。試行された演算全てが " +"``NotImplemented`` を返した場合、インタープリタは適切な例外を送出します。 " +"``NotImplemented`` を正しく返さないと、誤解を招きかねないエラーメッセージに" +"なったり、 ``NotImplemented`` が Python コードに返されるようなことになりま" +"す。" + +#: ../../library/constants.rst:45 msgid "See :ref:`implementing-the-arithmetic-operations` for examples." msgstr "" "例として :ref:`implementing-the-arithmetic-operations` を参照してください。" -#: ../../library/constants.rst:51 +#: ../../library/constants.rst:49 msgid "" -":data:`!NotImplemented` and :exc:`!NotImplementedError` are not " -"interchangeable. This constant should only be used as described above; see :" -"exc:`NotImplementedError` for details on correct usage of the exception." -msgstr "" - -#: ../../library/constants.rst:56 -msgid "Evaluating :data:`!NotImplemented` in a boolean context was deprecated." +"``NotImplementedError`` and ``NotImplemented`` are not interchangeable, even " +"though they have similar names and purposes. See :exc:`NotImplementedError` " +"for details on when to use it." msgstr "" +"``NotImplementedError`` と ``NotImplemented`` は、似たような名前と目的を持っ" +"ていますが、相互に変換できません。 利用する際には、 :exc:" +"`NotImplementedError` を参照してください。" -#: ../../library/constants.rst:59 +#: ../../library/constants.rst:53 msgid "" -"Evaluating :data:`!NotImplemented` in a boolean context now raises a :exc:" -"`TypeError`. It previously evaluated to :const:`True` and emitted a :exc:" -"`DeprecationWarning` since Python 3.9." +"Evaluating ``NotImplemented`` in a boolean context is deprecated. While it " +"currently evaluates as true, it will emit a :exc:`DeprecationWarning`. It " +"will raise a :exc:`TypeError` in a future version of Python." msgstr "" +"``NotImplemented`` の評価は非推奨です。\n" +"現時点で真と評価されていても :exc:`DeprecationWarning` が出ます。\n" +"この警告は将来のバージョンの Python で :exc:`TypeError` を送出します。" -#: ../../library/constants.rst:68 +#: ../../library/constants.rst:62 msgid "" -"The same as the ellipsis literal \"``...``\". Special value used mostly in " +"The same as the ellipsis literal \"``...``\". Special value used mostly in " "conjunction with extended slicing syntax for user-defined container data " -"types. ``Ellipsis`` is the sole instance of the :data:`types.EllipsisType` " -"type." +"types." msgstr "" "Ellipsis リテラル \"``...``\" と同じです。\n" "主に拡張スライス構文やユーザ定義のコンテナデータ型において使われる特殊な値で" -"す。``Ellipsis`` が :data:`types.EllipsisType` 型の唯一のインスタンスです。" +"す。" -#: ../../library/constants.rst:75 +#: ../../library/constants.rst:68 msgid "" "This constant is true if Python was not started with an :option:`-O` option. " "See also the :keyword:`assert` statement." @@ -138,7 +136,7 @@ msgstr "" "この定数は、Python が :option:`-O` オプションを有効にして開始されたのでなけれ" "ば真です。 :keyword:`assert` 文も参照して下さい。" -#: ../../library/constants.rst:81 +#: ../../library/constants.rst:74 msgid "" "The names :data:`None`, :data:`False`, :data:`True` and :data:`__debug__` " "cannot be reassigned (assignments to them, even as an attribute name, raise :" @@ -149,11 +147,11 @@ msgstr "" "`SyntaxError` が送出されます) ので、これらは「真の」定数であると考えられま" "す。" -#: ../../library/constants.rst:89 +#: ../../library/constants.rst:80 msgid "Constants added by the :mod:`site` module" msgstr ":mod:`site` モジュールで追加される定数" -#: ../../library/constants.rst:91 +#: ../../library/constants.rst:82 msgid "" "The :mod:`site` module (which is imported automatically during startup, " "except if the :option:`-S` command-line option is given) adds several " @@ -165,7 +163,7 @@ msgstr "" "かの定数を追加します。それらは対話的インタープリタシェルで有用ですが、プログ" "ラム中では使うべきではありません。" -#: ../../library/constants.rst:99 +#: ../../library/constants.rst:90 msgid "" "Objects that when printed, print a message like \"Use quit() or Ctrl-D (i.e. " "EOF) to exit\", and when called, raise :exc:`SystemExit` with the specified " @@ -175,14 +173,7 @@ msgstr "" "ジを表示し、呼び出されたときには指定された終了コードを伴って :exc:" "`SystemExit` を送出するオブジェクトです。" -#: ../../library/constants.rst:106 -msgid "" -"Object that when printed, prints the message \"Type help() for interactive " -"help, or help(object) for help about object.\", and when called, acts as " -"described :func:`elsewhere `." -msgstr "" - -#: ../../library/constants.rst:113 +#: ../../library/constants.rst:97 msgid "" "Objects that when printed or called, print the text of copyright or credits, " "respectively." @@ -190,7 +181,7 @@ msgstr "" "表示あるいは呼び出されたときに、それぞれ著作権あるいはクレジットのテキストが" "表示されるオブジェクトです。" -#: ../../library/constants.rst:118 +#: ../../library/constants.rst:102 msgid "" "Object that when printed, prints the message \"Type license() to see the " "full license text\", and when called, displays the full license text in a " @@ -199,11 +190,3 @@ msgstr "" "表示されたときに \"Type license() to see the full license text\" というメッ" "セージを表示し、呼び出されたときには完全なライセンスのテキストをページャのよ" "うな形式で (1画面分づつ) 表示するオブジェクトです。" - -#: ../../library/constants.rst:65 -msgid "..." -msgstr "..." - -#: ../../library/constants.rst:65 -msgid "ellipsis literal" -msgstr "ellipsisリテラル" diff --git a/library/contextlib.po b/library/contextlib.po index f55d86baa..c0f36470c 100644 --- a/library/contextlib.po +++ b/library/contextlib.po @@ -1,29 +1,31 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: +# Shun Sakurai, 2017 +# Masato HASHIMOTO , 2017 +# 秘湯 , 2017 +# Arihiro TAKASE, 2017 +# Inada Naoki , 2017 # Takanori Suzuki , 2021 -# tomo, 2021 # Osamu NAKAMURA, 2021 -# Takeshi Nakazato, 2022 -# 石井明久, 2024 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-06 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:57+0000\n" -"Last-Translator: 石井明久, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-06-05 06:33+0000\n" +"PO-Revision-Date: 2017-02-16 23:04+0000\n" +"Last-Translator: Osamu NAKAMURA, 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/contextlib.rst:2 @@ -85,21 +87,24 @@ msgstr "" msgid "" "This function is a :term:`decorator` that can be used to define a factory " "function for :keyword:`with` statement context managers, without needing to " -"create a class or separate :meth:`~object.__enter__` and :meth:`~object." -"__exit__` methods." +"create a class or separate :meth:`__enter__` and :meth:`__exit__` methods." msgstr "" "この関数は :keyword:`with` 文コンテキストマネージャのファクトリ関数を定義する" "ために利用できる :term:`デコレータ ` です。新しいクラスや :meth:" -"`~object.__enter__` と :meth:`~object.__exit__` メソッドを別々に定義しなくて" -"も、ファクトリ関数を定義することができます。" +"`__enter__` と :meth:`__exit__` メソッドを別々に定義しなくても、ファクトリ関" +"数を定義することができます。" #: ../../library/contextlib.rst:50 msgid "" "While many objects natively support use in with statements, sometimes a " "resource needs to be managed that isn't a context manager in its own right, " "and doesn't implement a ``close()`` method for use with ``contextlib." -"closing``." +"closing``" msgstr "" +"多くのオブジェクトが with 文の仕様を固有にサポートしていますが、コンテキスト" +"マネージャの権限に属さず、 ``close()`` メソッドを実装していないために " +"``contextlib.closing`` の利用もできないリソースを管理する必要があることがあり" +"ます。" #: ../../library/contextlib.rst:54 msgid "" @@ -108,33 +113,7 @@ msgid "" msgstr "" "リソースを正しく管理するよう保証する抽象的な例は以下のようなものでしょう::" -#: ../../library/contextlib.rst:57 -msgid "" -"from contextlib import contextmanager\n" -"\n" -"@contextmanager\n" -"def managed_resource(*args, **kwds):\n" -" # Code to acquire resource, e.g.:\n" -" resource = acquire_resource(*args, **kwds)\n" -" try:\n" -" yield resource\n" -" finally:\n" -" # Code to release resource, e.g.:\n" -" release_resource(resource)" -msgstr "" - -#: ../../library/contextlib.rst:69 -msgid "The function can then be used like this::" -msgstr "このとき、関数は次のように使うことができます::" - -#: ../../library/contextlib.rst:71 -msgid "" -">>> with managed_resource(timeout=3600) as resource:\n" -"... # Resource is released at the end of this block,\n" -"... # even if code in the block raises an exception" -msgstr "" - -#: ../../library/contextlib.rst:75 +#: ../../library/contextlib.rst:73 msgid "" "The function being decorated must return a :term:`generator`-iterator when " "called. This iterator must yield exactly one value, which will be bound to " @@ -145,7 +124,7 @@ msgstr "" "りません。 :keyword:`with` 文の :keyword:`!as` 節が存在するなら、その値は as " "節のターゲットへ束縛されることになります。" -#: ../../library/contextlib.rst:79 +#: ../../library/contextlib.rst:77 msgid "" "At the point where the generator yields, the block nested in the :keyword:" "`with` statement is executed. The generator is then resumed after the block " @@ -172,7 +151,7 @@ msgstr "" "に対して例外が処理されたことを示し、:keyword:`!with` 文の直後の文から実行を再" "開します。" -#: ../../library/contextlib.rst:91 +#: ../../library/contextlib.rst:89 msgid "" ":func:`contextmanager` uses :class:`ContextDecorator` so the context " "managers it creates can be used as decorators as well as in :keyword:`with` " @@ -191,11 +170,11 @@ msgstr "" "に呼び出されることをサポートする必要がある、という要件に合致させることが出来" "ます。)" -#: ../../library/contextlib.rst:98 +#: ../../library/contextlib.rst:96 msgid "Use of :class:`ContextDecorator`." msgstr ":class:`ContextDecorator` の使用。" -#: ../../library/contextlib.rst:104 +#: ../../library/contextlib.rst:102 msgid "" "Similar to :func:`~contextlib.contextmanager`, but creates an :ref:" "`asynchronous context manager `." @@ -204,90 +183,25 @@ msgstr "" "マネージャ (asynchronous context manager) ` を生成し" "ます。" -#: ../../library/contextlib.rst:107 +#: ../../library/contextlib.rst:105 msgid "" "This function is a :term:`decorator` that can be used to define a factory " "function for :keyword:`async with` statement asynchronous context managers, " -"without needing to create a class or separate :meth:`~object.__aenter__` " -"and :meth:`~object.__aexit__` methods. It must be applied to an :term:" -"`asynchronous generator` function." +"without needing to create a class or separate :meth:`__aenter__` and :meth:" +"`__aexit__` methods. It must be applied to an :term:`asynchronous generator` " +"function." msgstr "" "この関数は :keyword:`async with` 文のための非同期コンテキストマネージャのファ" "クトリ関数を定義するために利用できるデコレータ (:term:`decorator`) です。新し" -"いクラスや :meth:`~object.__aenter__` と :meth:`~object.__aexit__` メソッド" -"を個別に定義する必要はありません。このデコレータは非同期ジェネレータ (:term:" -"`asynchronous generator`) 関数に適用しなければなりません。" +"いクラスや :meth:`__aenter__` と :meth:`__aexit__` メソッドを個別に定義する" +"必要はありません。このデコレータは非同期ジェネレータ (:term:`asynchronous " +"generator`) 関数に適用しなければなりません。" -#: ../../library/contextlib.rst:113 +#: ../../library/contextlib.rst:111 msgid "A simple example::" msgstr "簡単な例::" -#: ../../library/contextlib.rst:115 -msgid "" -"from contextlib import asynccontextmanager\n" -"\n" -"@asynccontextmanager\n" -"async def get_connection():\n" -" conn = await acquire_db_connection()\n" -" try:\n" -" yield conn\n" -" finally:\n" -" await release_db_connection(conn)\n" -"\n" -"async def get_all_users():\n" -" async with get_connection() as conn:\n" -" return conn.query('SELECT ...')" -msgstr "" - -#: ../../library/contextlib.rst:131 -msgid "" -"Context managers defined with :func:`asynccontextmanager` can be used either " -"as decorators or with :keyword:`async with` statements::" -msgstr "" -":func:`asynccontextmanager` とともに定義されたコンテキストマネージャは、デコ" -"レータとして使うことも :keyword:`async with` 文と組み合わせて使うこともできま" -"す::" - -#: ../../library/contextlib.rst:134 -msgid "" -"import time\n" -"from contextlib import asynccontextmanager\n" -"\n" -"@asynccontextmanager\n" -"async def timeit():\n" -" now = time.monotonic()\n" -" try:\n" -" yield\n" -" finally:\n" -" print(f'it took {time.monotonic() - now}s to run')\n" -"\n" -"@timeit()\n" -"async def main():\n" -" # ... async code ..." -msgstr "" - -#: ../../library/contextlib.rst:149 -msgid "" -"When used as a decorator, a new generator instance is implicitly created on " -"each function call. This allows the otherwise \"one-shot\" context managers " -"created by :func:`asynccontextmanager` to meet the requirement that context " -"managers support multiple invocations in order to be used as decorators." -msgstr "" -"デコレータとして使われた場合は、各関数呼び出しに対して暗黙のうちに新しいジェ" -"ネレータインスタンスが生成されます。これにより、 :func:`asynccontextmanager` " -"で生成された単回使用のコンテキストマネージャが複数回呼び出し可能となり、コン" -"テキストマネージャをデコレータとして使うことができるための要件を満たすように" -"することができます。" - -#: ../../library/contextlib.rst:154 -msgid "" -"Async context managers created with :func:`asynccontextmanager` can be used " -"as decorators." -msgstr "" -":func:`asynccontextmanager` により生成された非同期コンテキストマネージャをデ" -"コレータとして使うことができるようになりました。" - -#: ../../library/contextlib.rst:161 +#: ../../library/contextlib.rst:132 msgid "" "Return a context manager that closes *thing* upon completion of the block. " "This is basically equivalent to::" @@ -295,35 +209,13 @@ msgstr "" "ブロックの完了時に *thing* を close するコンテキストマネージャを返します。こ" "れは基本的に以下と等価です::" -#: ../../library/contextlib.rst:164 -msgid "" -"from contextlib import contextmanager\n" -"\n" -"@contextmanager\n" -"def closing(thing):\n" -" try:\n" -" yield thing\n" -" finally:\n" -" thing.close()" -msgstr "" - -#: ../../library/contextlib.rst:173 +#: ../../library/contextlib.rst:144 msgid "And lets you write code like this::" msgstr "" "そして、明示的に ``page`` を close する必要なしに、次のように書くことができま" "す::" -#: ../../library/contextlib.rst:175 -msgid "" -"from contextlib import closing\n" -"from urllib.request import urlopen\n" -"\n" -"with closing(urlopen('https://www.python.org/')) as page:\n" -" for line in page:\n" -" print(line)" -msgstr "" - -#: ../../library/contextlib.rst:182 +#: ../../library/contextlib.rst:153 msgid "" "without needing to explicitly close ``page``. Even if an error occurs, " "``page.close()`` will be called when the :keyword:`with` block is exited." @@ -331,68 +223,7 @@ msgstr "" "``page`` を明示的に close する必要は無く、エラーが発生した場合でも、 :" "keyword:`with` ブロックを出るときに ``page.close()`` が呼ばれます。" -#: ../../library/contextlib.rst:187 -msgid "" -"Most types managing resources support the :term:`context manager` protocol, " -"which closes *thing* on leaving the :keyword:`with` statement. As such, :" -"func:`!closing` is most useful for third party types that don't support " -"context managers. This example is purely for illustration purposes, as :func:" -"`~urllib.request.urlopen` would normally be used in a context manager." -msgstr "" - -#: ../../library/contextlib.rst:196 -msgid "" -"Return an async context manager that calls the ``aclose()`` method of " -"*thing* upon completion of the block. This is basically equivalent to::" -msgstr "" -"ブロックの完了時に *thing* の ``aclose()`` メソッドを呼び出すような非同期コン" -"テキストマネージャを返します。これは基本的に以下と等価です::" - -#: ../../library/contextlib.rst:199 -msgid "" -"from contextlib import asynccontextmanager\n" -"\n" -"@asynccontextmanager\n" -"async def aclosing(thing):\n" -" try:\n" -" yield thing\n" -" finally:\n" -" await thing.aclose()" -msgstr "" - -#: ../../library/contextlib.rst:208 -msgid "" -"Significantly, ``aclosing()`` supports deterministic cleanup of async " -"generators when they happen to exit early by :keyword:`break` or an " -"exception. For example::" -msgstr "" -"重要なことは、たとえば次の例のように :keyword:`break` や例外によって早期にブ" -"ロックが終了した場合に、 ``aclosing()`` は非同期ジェネレータの決定論的なク" -"リーンアップをサポートすることです::" - -#: ../../library/contextlib.rst:212 -msgid "" -"from contextlib import aclosing\n" -"\n" -"async with aclosing(my_generator()) as values:\n" -" async for value in values:\n" -" if value == 42:\n" -" break" -msgstr "" - -#: ../../library/contextlib.rst:219 -msgid "" -"This pattern ensures that the generator's async exit code is executed in the " -"same context as its iterations (so that exceptions and context variables " -"work as expected, and the exit code isn't run after the lifetime of some " -"task it depends on)." -msgstr "" -"このパターンは、ジェネレータの非同期な終了のコードがイテレーション処理と同じ" -"コンテキストの中で実行されることを保証します (すなわち例外とコンテキスト変数" -"は期待通りに動作し、またジェネレータが依存するタスクの寿命が尽きたあとに終了" -"のコードが実行されることもありません)。" - -#: ../../library/contextlib.rst:231 +#: ../../library/contextlib.rst:161 msgid "" "Return a context manager that returns *enter_result* from ``__enter__``, but " "otherwise does nothing. It is intended to be used as a stand-in for an " @@ -403,66 +234,11 @@ msgstr "" "テキストマネージャに対する、選択可能な代役として使われることが意図されていま" "す::" -#: ../../library/contextlib.rst:235 -msgid "" -"def myfunction(arg, ignore_exceptions=False):\n" -" if ignore_exceptions:\n" -" # Use suppress to ignore all exceptions.\n" -" cm = contextlib.suppress(Exception)\n" -" else:\n" -" # Do not ignore any exceptions, cm has no effect.\n" -" cm = contextlib.nullcontext()\n" -" with cm:\n" -" # Do something" -msgstr "" - -#: ../../library/contextlib.rst:245 +#: ../../library/contextlib.rst:175 msgid "An example using *enter_result*::" msgstr "*enter_result* を使った例です::" -#: ../../library/contextlib.rst:247 -msgid "" -"def process_file(file_or_path):\n" -" if isinstance(file_or_path, str):\n" -" # If string, open file\n" -" cm = open(file_or_path)\n" -" else:\n" -" # Caller is responsible for closing file\n" -" cm = nullcontext(file_or_path)\n" -"\n" -" with cm as file:\n" -" # Perform processing on the file" -msgstr "" - -#: ../../library/contextlib.rst:258 -msgid "" -"It can also be used as a stand-in for :ref:`asynchronous context managers " -"`::" -msgstr "" -":ref:`非同期コンテキストマネージャ ` の代役として使う" -"こともできます::" - -#: ../../library/contextlib.rst:261 -msgid "" -"async def send_http(session=None):\n" -" if not session:\n" -" # If no http session, create it with aiohttp\n" -" cm = aiohttp.ClientSession()\n" -" else:\n" -" # Caller is responsible for closing the session\n" -" cm = nullcontext(session)\n" -"\n" -" async with cm as session:\n" -" # Send http requests with session" -msgstr "" - -#: ../../library/contextlib.rst:274 -msgid ":term:`asynchronous context manager` support was added." -msgstr "" -"非同期コンテキストマネージャ (:term:`asynchronous context manager`) のサポー" -"トが追加されました。" - -#: ../../library/contextlib.rst:281 +#: ../../library/contextlib.rst:193 msgid "" "Return a context manager that suppresses any of the specified exceptions if " "they occur in the body of a :keyword:`!with` statement and then resumes " @@ -472,7 +248,7 @@ msgstr "" ":keyword:`!with` 文の内部で指定された例外の発生を抑えるコンテキストマネージャ" "を返します。 :keyword:`!with` 文の後に続く最初の文から処理が再開されます。" -#: ../../library/contextlib.rst:286 +#: ../../library/contextlib.rst:198 msgid "" "As with any other mechanism that completely suppresses exceptions, this " "context manager should be used only to cover very specific errors where " @@ -483,61 +259,22 @@ msgstr "" "てプログラム実行を続けることが正しいことであるとわかっている、非常に限定的な" "エラーをカバーする以上の使い方はしてはいけません。" -#: ../../library/contextlib.rst:291 +#: ../../library/contextlib.rst:203 msgid "For example::" msgstr "例えば::" -#: ../../library/contextlib.rst:293 -msgid "" -"from contextlib import suppress\n" -"\n" -"with suppress(FileNotFoundError):\n" -" os.remove('somefile.tmp')\n" -"\n" -"with suppress(FileNotFoundError):\n" -" os.remove('someotherfile.tmp')" -msgstr "" - -#: ../../library/contextlib.rst:301 +#: ../../library/contextlib.rst:213 msgid "This code is equivalent to::" msgstr "これは以下と等価です::" -#: ../../library/contextlib.rst:303 -msgid "" -"try:\n" -" os.remove('somefile.tmp')\n" -"except FileNotFoundError:\n" -" pass\n" -"\n" -"try:\n" -" os.remove('someotherfile.tmp')\n" -"except FileNotFoundError:\n" -" pass" -msgstr "" - -#: ../../library/contextlib.rst:313 ../../library/contextlib.rst:362 -#: ../../library/contextlib.rst:372 ../../library/contextlib.rst:389 +#: ../../library/contextlib.rst:225 ../../library/contextlib.rst:265 +#: ../../library/contextlib.rst:275 msgid "This context manager is :ref:`reentrant `." msgstr "" "このコンテキストマネージャは :ref:`再入可能(リエントラント) ` " "です。" -#: ../../library/contextlib.rst:315 -msgid "" -"If the code within the :keyword:`!with` block raises a :exc:" -"`BaseExceptionGroup`, suppressed exceptions are removed from the group. Any " -"exceptions of the group which are not suppressed are re-raised in a new " -"group which is created using the original group's :meth:`~BaseExceptionGroup." -"derive` method." -msgstr "" - -#: ../../library/contextlib.rst:323 -msgid "" -"``suppress`` now supports suppressing exceptions raised as part of a :exc:" -"`BaseExceptionGroup`." -msgstr "" - -#: ../../library/contextlib.rst:329 +#: ../../library/contextlib.rst:232 msgid "" "Context manager for temporarily redirecting :data:`sys.stdout` to another " "file or file-like object." @@ -545,7 +282,7 @@ msgstr "" ":data:`sys.stdout` を一時的に別のファイルまたは file-like オブジェクトにリダ" "イレクトするコンテキストマネージャです。" -#: ../../library/contextlib.rst:332 +#: ../../library/contextlib.rst:235 msgid "" "This tool adds flexibility to existing functions or classes whose output is " "hardwired to stdout." @@ -553,7 +290,7 @@ msgstr "" "このツールは、出力先が標準出力 (stdout) に固定されている既存の関数やクラスに" "出力先の柔軟性を追加します。" -#: ../../library/contextlib.rst:335 +#: ../../library/contextlib.rst:238 msgid "" "For example, the output of :func:`help` normally is sent to *sys.stdout*. " "You can capture that output in a string by redirecting the output to an :" @@ -566,14 +303,7 @@ msgstr "" "よって捕捉することができます。代替の出力ストリームは ``__enter__`` メソッドに" "よって返されるので、 :keyword:`with` 文のターゲットとして利用可能です::" -#: ../../library/contextlib.rst:341 -msgid "" -"with redirect_stdout(io.StringIO()) as f:\n" -" help(pow)\n" -"s = f.getvalue()" -msgstr "" - -#: ../../library/contextlib.rst:345 +#: ../../library/contextlib.rst:248 msgid "" "To send the output of :func:`help` to a file on disk, redirect the output to " "a regular file::" @@ -581,26 +311,13 @@ msgstr "" ":func:`help` の出力をディスク上のファイルに送るためには、出力を通常のファイル" "にリダイレクトします::" -#: ../../library/contextlib.rst:348 -msgid "" -"with open('help.txt', 'w') as f:\n" -" with redirect_stdout(f):\n" -" help(pow)" -msgstr "" - -#: ../../library/contextlib.rst:352 +#: ../../library/contextlib.rst:255 msgid "To send the output of :func:`help` to *sys.stderr*::" msgstr "" ":func:`help` の出力を標準エラー出力 (*sys.stderr*) に送るには以下のようにしま" "す::" -#: ../../library/contextlib.rst:354 -msgid "" -"with redirect_stdout(sys.stderr):\n" -" help(pow)" -msgstr "" - -#: ../../library/contextlib.rst:357 +#: ../../library/contextlib.rst:260 msgid "" "Note that the global side effect on :data:`sys.stdout` means that this " "context manager is not suitable for use in library code and most threaded " @@ -613,7 +330,7 @@ msgstr "" "りますが、それでも多くのユーティリティスクリプトに対して有用なアプローチで" "す。" -#: ../../library/contextlib.rst:369 +#: ../../library/contextlib.rst:272 msgid "" "Similar to :func:`~contextlib.redirect_stdout` but redirecting :data:`sys." "stderr` to another file or file-like object." @@ -621,38 +338,14 @@ msgstr "" ":func:`~contextlib.redirect_stdout` と同じですが、標準エラー出力 (:data:`sys." "stderr`) を別のファイルや file-like オブジェクトにリダイレクトします。" -#: ../../library/contextlib.rst:379 -msgid "" -"Non parallel-safe context manager to change the current working directory. " -"As this changes a global state, the working directory, it is not suitable " -"for use in most threaded or async contexts. It is also not suitable for most " -"non-linear code execution, like generators, where the program execution is " -"temporarily relinquished -- unless explicitly desired, you should not yield " -"when this context manager is active." -msgstr "" -"現在の作業ディレクトリを変更するパラレル非安全なコンテキストマネージャです。" -"グローバルな状態である作業ディレクトリを変更するため、ほとんどのマルチスレッ" -"ドまたは非同期のコンテキストに対する利用は適切ではありません。また、プログラ" -"ムの実行権限を一時的に放棄するジェネレータのような、直線的でないコードを実行" -"する場合も適切ではありません -- 明確に必要でないかぎり、このコンテキストマ" -"ネージャがアクティブな状態で yield すべきではありません。" - -#: ../../library/contextlib.rst:386 -msgid "" -"This is a simple wrapper around :func:`~os.chdir`, it changes the current " -"working directory upon entering and restores the old one on exit." -msgstr "" -"これは :func:`~os.chdir` の単純なラッパーで、コンテキストに入るときに現在の作" -"業ディレクトリを変更し、終了時に元の作業ディレクトリを復元します。" - -#: ../../library/contextlib.rst:396 +#: ../../library/contextlib.rst:282 msgid "" "A base class that enables a context manager to also be used as a decorator." msgstr "" "コンテキストマネージャをデコレータとしても使用できるようにする基底クラスで" "す。" -#: ../../library/contextlib.rst:398 +#: ../../library/contextlib.rst:284 msgid "" "Context managers inheriting from ``ContextDecorator`` have to implement " "``__enter__`` and ``__exit__`` as normal. ``__exit__`` retains its optional " @@ -663,7 +356,7 @@ msgstr "" "す。``__exit__`` はデコレータとして使用された場合でも例外をオプションの引数と" "して受け取ります。" -#: ../../library/contextlib.rst:402 +#: ../../library/contextlib.rst:288 msgid "" "``ContextDecorator`` is used by :func:`contextmanager`, so you get this " "functionality automatically." @@ -671,71 +364,20 @@ msgstr "" ":func:`contextmanager` は ``ContextDecorator`` を利用しているので、自動的にデ" "コレーターとしても利用できるようになります。" -#: ../../library/contextlib.rst:405 +#: ../../library/contextlib.rst:291 msgid "Example of ``ContextDecorator``::" msgstr "``ContextDecorator`` の例::" -#: ../../library/contextlib.rst:407 -msgid "" -"from contextlib import ContextDecorator\n" -"\n" -"class mycontext(ContextDecorator):\n" -" def __enter__(self):\n" -" print('Starting')\n" -" return self\n" -"\n" -" def __exit__(self, *exc):\n" -" print('Finishing')\n" -" return False" -msgstr "" - -#: ../../library/contextlib.rst:418 ../../library/contextlib.rst:490 -msgid "The class can then be used like this::" -msgstr "このとき、クラスは次のように使うことができます::" - -#: ../../library/contextlib.rst:420 -msgid "" -">>> @mycontext()\n" -"... def function():\n" -"... print('The bit in the middle')\n" -"...\n" -">>> function()\n" -"Starting\n" -"The bit in the middle\n" -"Finishing\n" -"\n" -">>> with mycontext():\n" -"... print('The bit in the middle')\n" -"...\n" -"Starting\n" -"The bit in the middle\n" -"Finishing" -msgstr "" - -#: ../../library/contextlib.rst:436 +#: ../../library/contextlib.rst:320 msgid "" "This change is just syntactic sugar for any construct of the following form::" msgstr "これは次のような形のコードに対するシンタックスシュガーになります::" -#: ../../library/contextlib.rst:438 -msgid "" -"def f():\n" -" with cm():\n" -" # Do stuff" -msgstr "" - -#: ../../library/contextlib.rst:442 +#: ../../library/contextlib.rst:326 msgid "``ContextDecorator`` lets you instead write::" msgstr "``ContextDecorator`` を使うと代わりに次のように書けます::" -#: ../../library/contextlib.rst:444 -msgid "" -"@cm()\n" -"def f():\n" -" # Do stuff" -msgstr "" - -#: ../../library/contextlib.rst:448 +#: ../../library/contextlib.rst:332 msgid "" "It makes it clear that the ``cm`` applies to the whole function, rather than " "just a piece of it (and saving an indentation level is nice, too)." @@ -743,7 +385,7 @@ msgstr "" "デコレーターを使うと、``cm`` が関数の一部ではなく全体に適用されていることが明" "確になります (インデントレベルを1つ節約できるのもメリットです)。" -#: ../../library/contextlib.rst:451 +#: ../../library/contextlib.rst:335 msgid "" "Existing context managers that already have a base class can be extended by " "using ``ContextDecorator`` as a mixin class::" @@ -751,19 +393,7 @@ msgstr "" "すでに基底クラスを持っているコンテキストマネージャーも、``ContextDecorator`` " "を mixin クラスとして利用することで拡張できます::" -#: ../../library/contextlib.rst:454 -msgid "" -"from contextlib import ContextDecorator\n" -"\n" -"class mycontext(ContextBaseClass, ContextDecorator):\n" -" def __enter__(self):\n" -" return self\n" -"\n" -" def __exit__(self, *exc):\n" -" return False" -msgstr "" - -#: ../../library/contextlib.rst:464 +#: ../../library/contextlib.rst:348 msgid "" "As the decorated function must be able to be called multiple times, the " "underlying context manager must support use in multiple :keyword:`with` " @@ -774,52 +404,7 @@ msgstr "" "は複数の :keyword:`with` 文に対応する必要があります。そうでないなら、明示的" "な :keyword:`!with` 文を関数内で利用するべきです。" -#: ../../library/contextlib.rst:474 -msgid "" -"Similar to :class:`ContextDecorator` but only for asynchronous functions." -msgstr ":class:`ContextDecorator` と同じですが、非同期関数専用のクラスです。" - -#: ../../library/contextlib.rst:476 -msgid "Example of ``AsyncContextDecorator``::" -msgstr "``AsyncContextDecorator`` の使用例::" - -#: ../../library/contextlib.rst:478 -msgid "" -"from asyncio import run\n" -"from contextlib import AsyncContextDecorator\n" -"\n" -"class mycontext(AsyncContextDecorator):\n" -" async def __aenter__(self):\n" -" print('Starting')\n" -" return self\n" -"\n" -" async def __aexit__(self, *exc):\n" -" print('Finishing')\n" -" return False" -msgstr "" - -#: ../../library/contextlib.rst:492 -msgid "" -">>> @mycontext()\n" -"... async def function():\n" -"... print('The bit in the middle')\n" -"...\n" -">>> run(function())\n" -"Starting\n" -"The bit in the middle\n" -"Finishing\n" -"\n" -">>> async def function():\n" -"... async with mycontext():\n" -"... print('The bit in the middle')\n" -"...\n" -">>> run(function())\n" -"Starting\n" -"The bit in the middle\n" -"Finishing" -msgstr "" - -#: ../../library/contextlib.rst:515 +#: ../../library/contextlib.rst:358 msgid "" "A context manager that is designed to make it easy to programmatically " "combine other context managers and cleanup functions, especially those that " @@ -828,28 +413,13 @@ msgstr "" "他の、特にオプションであったり入力に依存するようなコンテキストマネージャーや" "クリーンアップ関数を動的に組み合わせるためのコンテキストマネージャーです。" -#: ../../library/contextlib.rst:519 +#: ../../library/contextlib.rst:362 msgid "" "For example, a set of files may easily be handled in a single with statement " "as follows::" msgstr "例えば、複数のファイルを1つの with 文で簡単に扱うことができます::" -#: ../../library/contextlib.rst:522 -msgid "" -"with ExitStack() as stack:\n" -" files = [stack.enter_context(open(fname)) for fname in filenames]\n" -" # All opened files will automatically be closed at the end of\n" -" # the with statement, even if attempts to open files later\n" -" # in the list raise an exception" -msgstr "" - -#: ../../library/contextlib.rst:528 -msgid "" -"The :meth:`~object.__enter__` method returns the :class:`ExitStack` " -"instance, and performs no additional operations." -msgstr "" - -#: ../../library/contextlib.rst:531 +#: ../../library/contextlib.rst:371 msgid "" "Each instance maintains a stack of registered callbacks that are called in " "reverse order when the instance is closed (either explicitly or implicitly " @@ -861,7 +431,7 @@ msgstr "" "順でそれを呼び出します。コンテキストスタックのインスタンスが暗黙的にガベージ" "コレクトされたときには callback は呼び出され **ません** 。" -#: ../../library/contextlib.rst:536 +#: ../../library/contextlib.rst:376 msgid "" "This stack model is used so that context managers that acquire their " "resources in their ``__init__`` method (such as file objects) can be handled " @@ -870,7 +440,7 @@ msgstr "" "このスタックモデルは、(file オブジェクトのように) ``__init__`` メソッドでリ" "ソースを確保するコンテキストマネージャーを正しく扱うためのものです。" -#: ../../library/contextlib.rst:540 +#: ../../library/contextlib.rst:380 msgid "" "Since registered callbacks are invoked in the reverse order of registration, " "this ends up behaving as if multiple nested :keyword:`with` statements had " @@ -884,7 +454,7 @@ msgstr "" "れます。内側のコールバックが例外を抑制したり置き換えたりした場合、外側のコー" "ルバックには更新された状態に応じた引数が渡されます。" -#: ../../library/contextlib.rst:547 +#: ../../library/contextlib.rst:387 msgid "" "This is a relatively low level API that takes care of the details of " "correctly unwinding the stack of exit callbacks. It provides a suitable " @@ -895,14 +465,17 @@ msgstr "" "す。アプリケーション独自のより高レベルなコンテキストマネージャーを作るための" "基板として使うのに適しています。" -#: ../../library/contextlib.rst:556 +#: ../../library/contextlib.rst:396 msgid "" -"Enters a new context manager and adds its :meth:`~object.__exit__` method to " -"the callback stack. The return value is the result of the context manager's " -"own :meth:`~object.__enter__` method." +"Enters a new context manager and adds its :meth:`__exit__` method to the " +"callback stack. The return value is the result of the context manager's own :" +"meth:`__enter__` method." msgstr "" +"新しいコンテキストマネージャーに enter し、その :meth:`__exit__` method を" +"コールバックスタックに追加します。渡されたコンテキストマネージャーの :meth:" +"`__enter__` メソッドの戻り値を返します。" -#: ../../library/contextlib.rst:560 +#: ../../library/contextlib.rst:400 msgid "" "These context managers may suppress exceptions just as they normally would " "if used directly as part of a :keyword:`with` statement." @@ -910,41 +483,42 @@ msgstr "" "コンテキストマネージャーは、普段 :keyword:`with` 文で利用された時と同じよう" "に、例外を抑制することができます。" -#: ../../library/contextlib.rst:563 -msgid "" -"Raises :exc:`TypeError` instead of :exc:`AttributeError` if *cm* is not a " -"context manager." -msgstr "" -"*cm* がコンテキストマネージャでなかった場合、 :exc:`AttributeError` の代わり" -"に :exc:`TypeError` 例外を送出します。" - -#: ../../library/contextlib.rst:569 -msgid "" -"Adds a context manager's :meth:`~object.__exit__` method to the callback " -"stack." +#: ../../library/contextlib.rst:405 +msgid "Adds a context manager's :meth:`__exit__` method to the callback stack." msgstr "" +"コンテキストマネージャーの :meth:`__exit__` メソッドをコールバックスタックに" +"追加します。" -#: ../../library/contextlib.rst:571 +#: ../../library/contextlib.rst:407 msgid "" "As ``__enter__`` is *not* invoked, this method can be used to cover part of " -"an :meth:`~object.__enter__` implementation with a context manager's own :" -"meth:`~object.__exit__` method." +"an :meth:`__enter__` implementation with a context manager's own :meth:" +"`__exit__` method." msgstr "" +"このメソッドは ``__enter__`` を **呼び出さない** ので、コンテキストマネー" +"ジャーを実装するときに、 :meth:`__enter__` の実装の一部を自身の :meth:" +"`__exit__` メソッドでカバーするために利用できます。" -#: ../../library/contextlib.rst:575 +#: ../../library/contextlib.rst:411 msgid "" "If passed an object that is not a context manager, this method assumes it is " -"a callback with the same signature as a context manager's :meth:`~object." -"__exit__` method and adds it directly to the callback stack." +"a callback with the same signature as a context manager's :meth:`__exit__` " +"method and adds it directly to the callback stack." msgstr "" +"コンテキストマネージャーではないオブジェクトが渡された場合、このメソッドはそ" +"のオブジェクトをコンテキストマネージャーの :meth:`__exit__` メソッドと同じシ" +"グネチャを持つコールバック関数だと仮定して、直接コールバックスタックに追加し" +"ます。" -#: ../../library/contextlib.rst:579 +#: ../../library/contextlib.rst:415 msgid "" "By returning true values, these callbacks can suppress exceptions the same " -"way context manager :meth:`~object.__exit__` methods can." +"way context manager :meth:`__exit__` methods can." msgstr "" +"それらのコールバック関数も、コンテキストマネージャーの :meth:`__exit__` と同" +"じく、 true 値を返すことで例外を抑制することができます。" -#: ../../library/contextlib.rst:582 +#: ../../library/contextlib.rst:418 msgid "" "The passed in object is returned from the function, allowing this method to " "be used as a function decorator." @@ -952,13 +526,13 @@ msgstr "" "この関数はデコレータとしても使えるように、受け取ったオブジェクトをそのまま返" "します。" -#: ../../library/contextlib.rst:587 +#: ../../library/contextlib.rst:423 msgid "" "Accepts an arbitrary callback function and arguments and adds it to the " "callback stack." msgstr "任意の関数と引数を受け取り、コールバックスタックに追加します。" -#: ../../library/contextlib.rst:590 +#: ../../library/contextlib.rst:426 msgid "" "Unlike the other methods, callbacks added this way cannot suppress " "exceptions (as they are never passed the exception details)." @@ -966,7 +540,7 @@ msgstr "" "他のメソッドと異なり、このメソッドで追加されたコールバックは例外を抑制しませ" "ん (例外の詳細も渡されません)。" -#: ../../library/contextlib.rst:593 +#: ../../library/contextlib.rst:429 msgid "" "The passed in callback is returned from the function, allowing this method " "to be used as a function decorator." @@ -974,7 +548,7 @@ msgstr "" "この関数はデコレータとしても使えるように、受け取った callback をそのまま返し" "ます。" -#: ../../library/contextlib.rst:598 +#: ../../library/contextlib.rst:434 msgid "" "Transfers the callback stack to a fresh :class:`ExitStack` instance and " "returns it. No callbacks are invoked by this operation - instead, they will " @@ -986,26 +560,14 @@ msgstr "" "(明示的に、あるいは :keyword:`with` 文の終わりに暗黙的に) close されるときに" "実行されます。" -#: ../../library/contextlib.rst:603 +#: ../../library/contextlib.rst:439 msgid "" "For example, a group of files can be opened as an \"all or nothing\" " "operation as follows::" msgstr "" "例えば、複数のファイルを \"all or nothing\" に開く処理を次のように書けます::" -#: ../../library/contextlib.rst:606 -msgid "" -"with ExitStack() as stack:\n" -" files = [stack.enter_context(open(fname)) for fname in filenames]\n" -" # Hold onto the close method, but don't call it yet.\n" -" close_files = stack.pop_all().close\n" -" # If opening any file fails, all previously opened files will be\n" -" # closed automatically. If all files are opened successfully,\n" -" # they will remain open even after the with statement ends.\n" -" # close_files() can then be invoked explicitly to close them all." -msgstr "" - -#: ../../library/contextlib.rst:617 +#: ../../library/contextlib.rst:453 msgid "" "Immediately unwinds the callback stack, invoking callbacks in the reverse " "order of registration. For any context managers and exit callbacks " @@ -1015,7 +577,7 @@ msgstr "" "ます。登録されたすべてのコンテキストマネージャーと終了 callback に、例外が起" "こらなかった場合の引数が渡されます。" -#: ../../library/contextlib.rst:624 +#: ../../library/contextlib.rst:460 msgid "" "An :ref:`asynchronous context manager `, similar to :" "class:`ExitStack`, that supports combining both synchronous and asynchronous " @@ -1025,59 +587,49 @@ msgstr "" "managers>` です。スタック上で同期と非同期の両方のコンテキストマネージャの組み" "合わせをサポートします。また、後処理のためのコルーチンも持っています。" -#: ../../library/contextlib.rst:629 +#: ../../library/contextlib.rst:465 msgid "" -"The :meth:`~ExitStack.close` method is not implemented; :meth:`aclose` must " -"be used instead." +"The :meth:`close` method is not implemented, :meth:`aclose` must be used " +"instead." msgstr "" +":meth:`close` メソッドは実装されていません。代わりに :meth:`aclose` を使って" +"ください。" -#: ../../library/contextlib.rst:635 +#: ../../library/contextlib.rst:470 msgid "" -"Similar to :meth:`ExitStack.enter_context` but expects an asynchronous " -"context manager." +"Similar to :meth:`enter_context` but expects an asynchronous context manager." msgstr "" +":meth:`enter_context` と同様のメソッドですが、非同期コンテキストマネージャを" +"受け取ります。" -#: ../../library/contextlib.rst:638 +#: ../../library/contextlib.rst:475 msgid "" -"Raises :exc:`TypeError` instead of :exc:`AttributeError` if *cm* is not an " -"asynchronous context manager." +"Similar to :meth:`push` but expects either an asynchronous context manager " +"or a coroutine function." msgstr "" -"*cm* が非同期コンテキストマネージャでなかった場合、 :exc:`AttributeError` の" -"代わりに :exc:`TypeError` 例外を送出します。" +":meth:`push` と同様のメソッドですが、非同期コンテキストマネージャかコルーチン" +"関数を受け取ります。" -#: ../../library/contextlib.rst:644 -msgid "" -"Similar to :meth:`ExitStack.push` but expects either an asynchronous context " -"manager or a coroutine function." +#: ../../library/contextlib.rst:480 +msgid "Similar to :meth:`callback` but expects a coroutine function." msgstr "" +":meth:`callback` と同様のメソッドですが、コルーチン関数を受け取ります。" -#: ../../library/contextlib.rst:649 -msgid "Similar to :meth:`ExitStack.callback` but expects a coroutine function." +#: ../../library/contextlib.rst:484 +msgid "Similar to :meth:`close` but properly handles awaitables." msgstr "" +":meth:`close` と同様のメソッドですが、待ち受け可能オブジェクト (awaitables) " +"を適切に処理します。" -#: ../../library/contextlib.rst:654 -msgid "Similar to :meth:`ExitStack.close` but properly handles awaitables." -msgstr "" - -#: ../../library/contextlib.rst:656 +#: ../../library/contextlib.rst:486 msgid "Continuing the example for :func:`asynccontextmanager`::" msgstr ":func:`asynccontextmanager` の使用例の続きです::" -#: ../../library/contextlib.rst:658 -msgid "" -"async with AsyncExitStack() as stack:\n" -" connections = [await stack.enter_async_context(get_connection())\n" -" for i in range(5)]\n" -" # All opened connections will automatically be released at the end of\n" -" # the async with statement, even if attempts to open a connection\n" -" # later in the list raise an exception." -msgstr "" - -#: ../../library/contextlib.rst:668 +#: ../../library/contextlib.rst:498 msgid "Examples and Recipes" msgstr "例とレシピ" -#: ../../library/contextlib.rst:670 +#: ../../library/contextlib.rst:500 msgid "" "This section describes some examples and recipes for making effective use of " "the tools provided by :mod:`contextlib`." @@ -1085,11 +637,11 @@ msgstr "" "このセクションでは、 :mod:`contextlib` が提供するツールの効果的な使い方を示す" "例とレシピを紹介します。" -#: ../../library/contextlib.rst:675 +#: ../../library/contextlib.rst:505 msgid "Supporting a variable number of context managers" msgstr "可変数個のコンテキストマネージャーをサポートする" -#: ../../library/contextlib.rst:677 +#: ../../library/contextlib.rst:507 msgid "" "The primary use case for :class:`ExitStack` is the one given in the class " "documentation: supporting a variable number of context managers and other " @@ -1105,18 +657,7 @@ msgstr "" "場合や、いくつかのコンテキストマネージャーがオプションとなる場合に、可変数個" "のコンテキストマネージャーが必要になります::" -#: ../../library/contextlib.rst:684 -msgid "" -"with ExitStack() as stack:\n" -" for resource in resources:\n" -" stack.enter_context(resource)\n" -" if need_special_resource():\n" -" special = acquire_special_resource()\n" -" stack.callback(release_special_resource, special)\n" -" # Perform operations that use the acquired resources" -msgstr "" - -#: ../../library/contextlib.rst:692 +#: ../../library/contextlib.rst:522 msgid "" "As shown, :class:`ExitStack` also makes it quite easy to use :keyword:`with` " "statements to manage arbitrary resources that don't natively support the " @@ -1126,11 +667,11 @@ msgstr "" "をサポートしていないリソースの管理を :keyword:`with` 文を使って簡単に行えるよ" "うにします。" -#: ../../library/contextlib.rst:698 +#: ../../library/contextlib.rst:528 msgid "Catching exceptions from ``__enter__`` methods" msgstr "``__enter__`` メソッドからの例外をキャッチする" -#: ../../library/contextlib.rst:700 +#: ../../library/contextlib.rst:530 msgid "" "It is occasionally desirable to catch exceptions from an ``__enter__`` " "method implementation, *without* inadvertently catching exceptions from the :" @@ -1143,19 +684,7 @@ msgstr "" "うに、 catch したい場合があります。 :class:`ExitStack` を使って、コンテキスト" "マネージャープロトコル内のステップを分離することができます::" -#: ../../library/contextlib.rst:706 -msgid "" -"stack = ExitStack()\n" -"try:\n" -" x = stack.enter_context(cm)\n" -"except Exception:\n" -" # handle __enter__ exception\n" -"else:\n" -" with stack:\n" -" # Handle normal case" -msgstr "" - -#: ../../library/contextlib.rst:715 +#: ../../library/contextlib.rst:545 msgid "" "Actually needing to do this is likely to indicate that the underlying API " "should be providing a direct resource management interface for use with :" @@ -1173,18 +702,21 @@ msgstr "" "文を使って処理することができない様々なシチュエーションの処理をすることができ" "ます。" -#: ../../library/contextlib.rst:725 +#: ../../library/contextlib.rst:555 msgid "Cleaning up in an ``__enter__`` implementation" msgstr "``__enter__`` 実装内のクリーンアップ" -#: ../../library/contextlib.rst:727 +#: ../../library/contextlib.rst:557 msgid "" "As noted in the documentation of :meth:`ExitStack.push`, this method can be " "useful in cleaning up an already allocated resource if later steps in the :" -"meth:`~object.__enter__` implementation fail." +"meth:`__enter__` implementation fail." msgstr "" +":meth:`ExitStack.push` のドキュメントで言及したとおり、このメソッドはすでに獲" +"得したリソースを、 :meth:`__enter__` メソッドの残りのステップが失敗した時にク" +"リーンアップするために利用することができます。" -#: ../../library/contextlib.rst:731 +#: ../../library/contextlib.rst:561 msgid "" "Here's an example of doing this for a context manager that accepts resource " "acquisition and release functions, along with an optional validation " @@ -1194,49 +726,11 @@ msgstr "" "数を受け取るコンテキストマネージャーで、この方法を使ってコンテキストマネー" "ジャープロトコルを提供しています::" -#: ../../library/contextlib.rst:735 -msgid "" -"from contextlib import contextmanager, AbstractContextManager, ExitStack\n" -"\n" -"class ResourceManager(AbstractContextManager):\n" -"\n" -" def __init__(self, acquire_resource, release_resource, " -"check_resource_ok=None):\n" -" self.acquire_resource = acquire_resource\n" -" self.release_resource = release_resource\n" -" if check_resource_ok is None:\n" -" def check_resource_ok(resource):\n" -" return True\n" -" self.check_resource_ok = check_resource_ok\n" -"\n" -" @contextmanager\n" -" def _cleanup_on_error(self):\n" -" with ExitStack() as stack:\n" -" stack.push(self)\n" -" yield\n" -" # The validation check passed and didn't raise an exception\n" -" # Accordingly, we want to keep the resource, and pass it\n" -" # back to our caller\n" -" stack.pop_all()\n" -"\n" -" def __enter__(self):\n" -" resource = self.acquire_resource()\n" -" with self._cleanup_on_error():\n" -" if not self.check_resource_ok(resource):\n" -" msg = \"Failed validation for {!r}\"\n" -" raise RuntimeError(msg.format(resource))\n" -" return resource\n" -"\n" -" def __exit__(self, *exc_details):\n" -" # We don't need to duplicate any of our resource release logic\n" -" self.release_resource()" -msgstr "" - -#: ../../library/contextlib.rst:771 +#: ../../library/contextlib.rst:601 msgid "Replacing any use of ``try-finally`` and flag variables" msgstr "``try-finally`` + flag 変数パターンを置き換える" -#: ../../library/contextlib.rst:773 +#: ../../library/contextlib.rst:603 msgid "" "A pattern you will sometimes see is a ``try-finally`` statement with a flag " "variable to indicate whether or not the body of the ``finally`` clause " @@ -1248,19 +742,7 @@ msgstr "" "に ``except`` 句を使うだけでは処理できない) ケースでは次のようなコードになり" "ます::" -#: ../../library/contextlib.rst:778 -msgid "" -"cleanup_needed = True\n" -"try:\n" -" result = perform_operation()\n" -" if result:\n" -" cleanup_needed = False\n" -"finally:\n" -" if cleanup_needed:\n" -" cleanup_resources()" -msgstr "" - -#: ../../library/contextlib.rst:787 +#: ../../library/contextlib.rst:617 msgid "" "As with any ``try`` statement based code, this can cause problems for " "development and review, because the setup code and the cleanup code can end " @@ -1269,7 +751,7 @@ msgstr "" "``try`` 文を使ったコードでは、セットアップとクリーンアップのコードが任意の長" "さのコードで分離してしまうので、開発者やレビューアにとって問題になりえます。" -#: ../../library/contextlib.rst:791 +#: ../../library/contextlib.rst:621 msgid "" ":class:`ExitStack` makes it possible to instead register a callback for " "execution at the end of a ``with`` statement, and then later decide to skip " @@ -1278,24 +760,15 @@ msgstr "" ":class:`ExitStack` を使えば、代わりに ``with`` 文の終わりに実行されるコール" "バックを登録し、後でそのコールバックをスキップするかどうかを決定できます::" -#: ../../library/contextlib.rst:795 -msgid "" -"from contextlib import ExitStack\n" -"\n" -"with ExitStack() as stack:\n" -" stack.callback(cleanup_resources)\n" -" result = perform_operation()\n" -" if result:\n" -" stack.pop_all()" -msgstr "" - -#: ../../library/contextlib.rst:803 +#: ../../library/contextlib.rst:633 msgid "" -"This allows the intended cleanup behaviour to be made explicit up front, " +"This allows the intended cleanup up behaviour to be made explicit up front, " "rather than requiring a separate flag variable." msgstr "" +"これにより、別のフラグ変数を使う代わりに、必要なクリーンアップ処理を手前に明" +"示しておくことができます。" -#: ../../library/contextlib.rst:806 +#: ../../library/contextlib.rst:636 msgid "" "If a particular application uses this pattern a lot, it can be simplified " "even further by means of a small helper class::" @@ -1303,25 +776,7 @@ msgstr "" "もしあるアプリケーションがこのパターンを多用するのであれば、小さいヘルパーク" "ラスを導入してよりシンプルにすることができます::" -#: ../../library/contextlib.rst:809 -msgid "" -"from contextlib import ExitStack\n" -"\n" -"class Callback(ExitStack):\n" -" def __init__(self, callback, /, *args, **kwds):\n" -" super().__init__()\n" -" self.callback(callback, *args, **kwds)\n" -"\n" -" def cancel(self):\n" -" self.pop_all()\n" -"\n" -"with Callback(cleanup_resources) as cb:\n" -" result = perform_operation()\n" -" if result:\n" -" cb.cancel()" -msgstr "" - -#: ../../library/contextlib.rst:824 +#: ../../library/contextlib.rst:654 msgid "" "If the resource cleanup isn't already neatly bundled into a standalone " "function, then it is still possible to use the decorator form of :meth:" @@ -1331,20 +786,7 @@ msgstr "" "`ExitStack.callback` のデコレーター形式を利用してリソース開放処理を宣言するこ" "とができます::" -#: ../../library/contextlib.rst:829 -msgid "" -"from contextlib import ExitStack\n" -"\n" -"with ExitStack() as stack:\n" -" @stack.callback\n" -" def cleanup_resources():\n" -" ...\n" -" result = perform_operation()\n" -" if result:\n" -" stack.pop_all()" -msgstr "" - -#: ../../library/contextlib.rst:839 +#: ../../library/contextlib.rst:669 msgid "" "Due to the way the decorator protocol works, a callback function declared " "this way cannot take any parameters. Instead, any resources to be released " @@ -1354,11 +796,11 @@ msgstr "" "取ることができません。その代わりに、リリースするリソースをクロージャー変数と" "してアクセスできる必要があります。" -#: ../../library/contextlib.rst:845 +#: ../../library/contextlib.rst:675 msgid "Using a context manager as a function decorator" msgstr "コンテキストマネージャーを関数デコレーターとして使う" -#: ../../library/contextlib.rst:847 +#: ../../library/contextlib.rst:677 msgid "" ":class:`ContextDecorator` makes it possible to use a context manager in both " "an ordinary ``with`` statement and also as a function decorator." @@ -1366,7 +808,7 @@ msgstr "" ":class:`ContextDecorator` はコンテキストマネージャーを通常の ``with`` 文に加" "えて関数デコレーターとしても利用できるようにします。" -#: ../../library/contextlib.rst:850 +#: ../../library/contextlib.rst:680 msgid "" "For example, it is sometimes useful to wrap functions or groups of " "statements with a logger that can track the time of entry and time of exit. " @@ -1379,70 +821,40 @@ msgstr "" "ネージャーを別々に書く代わりに、 :class:`ContextDecorator` を継承すると1つの" "定義で両方の機能を提供できます::" -#: ../../library/contextlib.rst:856 -msgid "" -"from contextlib import ContextDecorator\n" -"import logging\n" -"\n" -"logging.basicConfig(level=logging.INFO)\n" -"\n" -"class track_entry_and_exit(ContextDecorator):\n" -" def __init__(self, name):\n" -" self.name = name\n" -"\n" -" def __enter__(self):\n" -" logging.info('Entering: %s', self.name)\n" -"\n" -" def __exit__(self, exc_type, exc, exc_tb):\n" -" logging.info('Exiting: %s', self.name)" -msgstr "" - -#: ../../library/contextlib.rst:871 +#: ../../library/contextlib.rst:701 msgid "Instances of this class can be used as both a context manager::" msgstr "このクラスのインスタンスはコンテキストマネージャーとしても利用でき::" -#: ../../library/contextlib.rst:873 -msgid "" -"with track_entry_and_exit('widget loader'):\n" -" print('Some time consuming activity goes here')\n" -" load_widget()" -msgstr "" - -#: ../../library/contextlib.rst:877 +#: ../../library/contextlib.rst:707 msgid "And also as a function decorator::" msgstr "また関数デコレーターとしても利用できます::" -#: ../../library/contextlib.rst:879 -msgid "" -"@track_entry_and_exit('widget loader')\n" -"def activity():\n" -" print('Some time consuming activity goes here')\n" -" load_widget()" -msgstr "" - -#: ../../library/contextlib.rst:884 +#: ../../library/contextlib.rst:714 msgid "" "Note that there is one additional limitation when using context managers as " "function decorators: there's no way to access the return value of :meth:" -"`~object.__enter__`. If that value is needed, then it is still necessary to " -"use an explicit ``with`` statement." +"`__enter__`. If that value is needed, then it is still necessary to use an " +"explicit ``with`` statement." msgstr "" +"コンテキストマネージャーを関数デコレーターとして使う場合、 :meth:`__enter__` " +"メソッドの戻り値にアクセスする手段がないという制限があることに注意してくださ" +"い。もしその値が必要であれば、明示的な ``with`` 文を使う必要があります。" -#: ../../library/contextlib.rst:891 +#: ../../library/contextlib.rst:722 msgid ":pep:`343` - The \"with\" statement" msgstr ":pep:`343` - \"with\" ステートメント" -#: ../../library/contextlib.rst:892 +#: ../../library/contextlib.rst:722 msgid "" "The specification, background, and examples for the Python :keyword:`with` " "statement." msgstr "Python の :keyword:`with` 文の仕様、背景、および例が記載されています。" -#: ../../library/contextlib.rst:898 +#: ../../library/contextlib.rst:728 msgid "Single use, reusable and reentrant context managers" msgstr "単回使用、再利用可能、およびリエントラントなコンテキストマネージャ" -#: ../../library/contextlib.rst:900 +#: ../../library/contextlib.rst:730 msgid "" "Most context managers are written in a way that means they can only be used " "effectively in a :keyword:`with` statement once. These single use context " @@ -1454,7 +866,7 @@ msgstr "" "ネージャは毎回新規に生成されなければなりません - それらを再利用しようとする" "と、例外を引き起こすか、正しく動作しません。" -#: ../../library/contextlib.rst:906 +#: ../../library/contextlib.rst:736 msgid "" "This common limitation means that it is generally advisable to create " "context managers directly in the header of the :keyword:`with` statement " @@ -1464,7 +876,7 @@ msgstr "" "に示すとおり) 一般に :keyword:`with` 文のヘッダ部分で直接生成することが推奨さ" "れるということです。" -#: ../../library/contextlib.rst:910 +#: ../../library/contextlib.rst:740 msgid "" "Files are an example of effectively single use context managers, since the " "first :keyword:`with` statement will close the file, preventing any further " @@ -1474,7 +886,7 @@ msgstr "" "最初の :keyword:`with` 文によりファイルがクローズされ、それ以降そのファイルオ" "ブジェクトに対するすべての IO 操作を防止します。" -#: ../../library/contextlib.rst:914 +#: ../../library/contextlib.rst:744 msgid "" "Context managers created using :func:`contextmanager` are also single use " "context managers, and will complain about the underlying generator failing " @@ -1484,34 +896,11 @@ msgstr "" "テキスト マネージャです。二回目に使おうとした場合、内部にあるジェネレータが" "値の生成に失敗したと訴えるでしょう::" -#: ../../library/contextlib.rst:918 -msgid "" -">>> from contextlib import contextmanager\n" -">>> @contextmanager\n" -"... def singleuse():\n" -"... print(\"Before\")\n" -"... yield\n" -"... print(\"After\")\n" -"...\n" -">>> cm = singleuse()\n" -">>> with cm:\n" -"... pass\n" -"...\n" -"Before\n" -"After\n" -">>> with cm:\n" -"... pass\n" -"...\n" -"Traceback (most recent call last):\n" -" ...\n" -"RuntimeError: generator didn't yield" -msgstr "" - -#: ../../library/contextlib.rst:942 +#: ../../library/contextlib.rst:772 msgid "Reentrant context managers" msgstr "リエントラントなコンテキストマネージャ" -#: ../../library/contextlib.rst:944 +#: ../../library/contextlib.rst:774 msgid "" "More sophisticated context managers may be \"reentrant\". These context " "managers can not only be used in multiple :keyword:`with` statements, but " @@ -1523,35 +912,14 @@ msgstr "" "く、同じコンテキストマネージャをすでに使っている :keyword:`!with` 文の *内部" "* でも使うことができます。" -#: ../../library/contextlib.rst:949 +#: ../../library/contextlib.rst:779 msgid "" ":class:`threading.RLock` is an example of a reentrant context manager, as " -"are :func:`suppress`, :func:`redirect_stdout`, and :func:`chdir`. Here's a " -"very simple example of reentrant use::" +"are :func:`suppress` and :func:`redirect_stdout`. Here's a very simple " +"example of reentrant use::" msgstr "" -":class:`threading.RLock` はリエントラントなコンテキストマネージャの例であり、" -"また :func:`suppress`, :func:`redirect_stdout`, そして :func:`chdir` もリエン" -"トラントです。以下はリエントラントな利用法の非常に単純な例です::" -#: ../../library/contextlib.rst:953 -msgid "" -">>> from contextlib import redirect_stdout\n" -">>> from io import StringIO\n" -">>> stream = StringIO()\n" -">>> write_to_stream = redirect_stdout(stream)\n" -">>> with write_to_stream:\n" -"... print(\"This is written to the stream rather than stdout\")\n" -"... with write_to_stream:\n" -"... print(\"This is also written to the stream\")\n" -"...\n" -">>> print(\"This is written directly to stdout\")\n" -"This is written directly to stdout\n" -">>> print(stream.getvalue())\n" -"This is written to the stream rather than stdout\n" -"This is also written to the stream" -msgstr "" - -#: ../../library/contextlib.rst:968 +#: ../../library/contextlib.rst:798 msgid "" "Real world examples of reentrancy are more likely to involve multiple " "functions calling each other and hence be far more complicated than this " @@ -1560,7 +928,7 @@ msgstr "" "リエントラントな性質の実例はお互いを呼び出しあう複数の関数を含んでいる可能性" "が高く、したがってこの例よりもはるかに複雑です。" -#: ../../library/contextlib.rst:972 +#: ../../library/contextlib.rst:802 msgid "" "Note also that being reentrant is *not* the same thing as being thread " "safe. :func:`redirect_stdout`, for example, is definitely not thread safe, " @@ -1572,11 +940,11 @@ msgstr "" "なるストリームに束縛することによりシステムの状態に対してグローバルな変更を行" "うことから、明らかにスレッドセーフではありません。" -#: ../../library/contextlib.rst:981 +#: ../../library/contextlib.rst:811 msgid "Reusable context managers" msgstr "再利用可能なコンテキストマネージャ" -#: ../../library/contextlib.rst:983 +#: ../../library/contextlib.rst:813 msgid "" "Distinct from both single use and reentrant context managers are " "\"reusable\" context managers (or, to be completely explicit, \"reusable, " @@ -1593,7 +961,7 @@ msgstr "" "ンテキストマネージャのインスタンスがすでに with 文で使われている場合には失敗" "します (もしくは正しく動作しません)。" -#: ../../library/contextlib.rst:990 +#: ../../library/contextlib.rst:820 msgid "" ":class:`threading.Lock` is an example of a reusable, but not reentrant, " "context manager (for a reentrant lock, it is necessary to use :class:" @@ -1603,7 +971,7 @@ msgstr "" "ネージャの例です (リエントラントなロックのためには :class:`threading.RLock` " "を代わりに使う必要があります)。" -#: ../../library/contextlib.rst:994 +#: ../../library/contextlib.rst:824 msgid "" "Another example of a reusable, but not reentrant, context manager is :class:" "`ExitStack`, as it invokes *all* currently registered callbacks when leaving " @@ -1613,36 +981,7 @@ msgstr "" "class:`ExitStack` です。これは現在登録されている *全ての* コールバック関数" "を、どこで登録されたかにかかわらず、呼び出します::" -#: ../../library/contextlib.rst:999 -msgid "" -">>> from contextlib import ExitStack\n" -">>> stack = ExitStack()\n" -">>> with stack:\n" -"... stack.callback(print, \"Callback: from first context\")\n" -"... print(\"Leaving first context\")\n" -"...\n" -"Leaving first context\n" -"Callback: from first context\n" -">>> with stack:\n" -"... stack.callback(print, \"Callback: from second context\")\n" -"... print(\"Leaving second context\")\n" -"...\n" -"Leaving second context\n" -"Callback: from second context\n" -">>> with stack:\n" -"... stack.callback(print, \"Callback: from outer context\")\n" -"... with stack:\n" -"... stack.callback(print, \"Callback: from inner context\")\n" -"... print(\"Leaving inner context\")\n" -"... print(\"Leaving outer context\")\n" -"...\n" -"Leaving inner context\n" -"Callback: from inner context\n" -"Callback: from outer context\n" -"Leaving outer context" -msgstr "" - -#: ../../library/contextlib.rst:1025 +#: ../../library/contextlib.rst:855 msgid "" "As the output from the example shows, reusing a single stack object across " "multiple with statements works correctly, but attempting to nest them will " @@ -1653,26 +992,10 @@ msgstr "" "利用しても正しく動作します。しかし入れ子にして使った場合は、一番内側の with " "文を抜ける際にスタックが空になります。これは望ましい動作とは思えません。" -#: ../../library/contextlib.rst:1030 +#: ../../library/contextlib.rst:860 msgid "" "Using separate :class:`ExitStack` instances instead of reusing a single " "instance avoids that problem::" msgstr "" "ひとつの :class:`ExitStack` インスタンスを再利用する代わりに複数のインスタン" "スを使うことにより、この問題は回避することができます::" - -#: ../../library/contextlib.rst:1033 -msgid "" -">>> from contextlib import ExitStack\n" -">>> with ExitStack() as outer_stack:\n" -"... outer_stack.callback(print, \"Callback: from outer context\")\n" -"... with ExitStack() as inner_stack:\n" -"... inner_stack.callback(print, \"Callback: from inner context\")\n" -"... print(\"Leaving inner context\")\n" -"... print(\"Leaving outer context\")\n" -"...\n" -"Leaving inner context\n" -"Callback: from inner context\n" -"Leaving outer context\n" -"Callback: from outer context" -msgstr "" diff --git a/library/contextvars.po b/library/contextvars.po index 30bf1e903..f0b9afef2 100644 --- a/library/contextvars.po +++ b/library/contextvars.po @@ -1,33 +1,31 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: +# tomo, 2020 # Osamu NAKAMURA, 2021 -# Arihiro TAKASE, 2023 -# 石井明久, 2024 -# tomo, 2024 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 00:57+0000\n" -"Last-Translator: tomo, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2018-06-29 21:06+0000\n" +"Last-Translator: Osamu NAKAMURA, 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/contextvars.rst:2 -msgid ":mod:`!contextvars` --- Context Variables" -msgstr ":mod:`!contextvars` --- コンテキスト変数" +msgid ":mod:`contextvars` --- Context Variables" +msgstr ":mod:`contextvars` --- コンテキスト変数" #: ../../library/contextvars.rst:11 msgid "" @@ -48,9 +46,12 @@ msgstr "" #: ../../library/contextvars.rst:17 msgid "" "Context managers that have state should use Context Variables instead of :" -"func:`threading.local` to prevent their state from bleeding to other code " +"func:`threading.local()` to prevent their state from bleeding to other code " "unexpectedly, when used in concurrent code." msgstr "" +"状態を持っているコンテキストマネージャは :func:`threading.local()` ではなくコ" +"ンテキスト変数を使い、並行処理のコードから状態が意図せず他のコードへ漏れ出す" +"のを避けるべきです。" #: ../../library/contextvars.rst:21 msgid "See also :pep:`567` for additional details." @@ -66,10 +67,6 @@ msgstr "" "このクラスは新しいコンテキスト変数を宣言するのに使われます。例えば、次の通り" "です:" -#: ../../library/contextvars.rst:33 -msgid "var: ContextVar[int] = ContextVar('var', default=42)" -msgstr "" - #: ../../library/contextvars.rst:35 msgid "" "The required *name* parameter is used for introspection and debug purposes." @@ -159,18 +156,6 @@ msgstr "" msgid "For example::" msgstr "例えば::" -#: ../../library/contextvars.rst:87 -msgid "" -"var = ContextVar('var')\n" -"\n" -"token = var.set('new value')\n" -"# code that uses 'var'; var.get() returns 'new value'.\n" -"var.reset(token)\n" -"\n" -"# After the reset call the var has no value again, so\n" -"# var.get() would raise a LookupError." -msgstr "" - #: ../../library/contextvars.rst:99 msgid "" "*Token* objects are returned by the :meth:`ContextVar.set` method. They can " @@ -181,28 +166,7 @@ msgstr "" "ジェクトです。このオブジェクトを :meth:`ContextVar.reset` メソッドに渡すこと" "で、対応する *set* を呼び出す前のコンテキスト変数の値に戻せます。" -#: ../../library/contextvars.rst:104 -msgid "" -"The token supports :ref:`context manager protocol ` to " -"restore the corresponding context variable value at the exit from :keyword:" -"`with` block::" -msgstr "" - -#: ../../library/contextvars.rst:108 -msgid "" -"var = ContextVar('var', default='default value')\n" -"\n" -"with var.set('new value'):\n" -" assert var.get() == 'new value'\n" -"\n" -"assert var.get() == 'default value'" -msgstr "" - -#: ../../library/contextvars.rst:117 -msgid "Added support for usage as a context manager." -msgstr "" - -#: ../../library/contextvars.rst:121 +#: ../../library/contextvars.rst:106 msgid "" "A read-only property. Points to the :class:`ContextVar` object that created " "the token." @@ -210,29 +174,29 @@ msgstr "" "読み出し専用のプロパティです。トークンを生成した :class:`ContextVar` オブジェ" "クトを指します。" -#: ../../library/contextvars.rst:126 +#: ../../library/contextvars.rst:111 msgid "" "A read-only property. Set to the value the variable had before the :meth:" "`ContextVar.set` method call that created the token. It points to :attr:" -"`Token.MISSING` if the variable was not set before the call." +"`Token.MISSING` is the variable was not set before the call." msgstr "" -"読み出し専用のプロパティです。このトークンを作成した :meth:`ContextVar.set` " -"メソッドの呼び出しの前に持っていた値に設定されています。もし呼び出しの前に値" -"が設定されていなければ :attr:`Token.MISSING` を指します。" +"読み出し専用のプロパティです。このトークンを返した :meth:`ContextVar.set` メ" +"ソッドの呼び出し前に設定されていた値を返します。もし呼び出しの前に値が設定さ" +"れていなければ :attr:`Token.MISSING` を返します。" -#: ../../library/contextvars.rst:133 +#: ../../library/contextvars.rst:118 msgid "A marker object used by :attr:`Token.old_value`." msgstr ":attr:`Token.old_value` で利用されるマーカーオブジェクトです。" -#: ../../library/contextvars.rst:137 +#: ../../library/contextvars.rst:122 msgid "Manual Context Management" msgstr "マニュアルでのコンテキスト管理" -#: ../../library/contextvars.rst:141 +#: ../../library/contextvars.rst:126 msgid "Returns a copy of the current :class:`~contextvars.Context` object." msgstr "現在の :class:`~contextvars.Context` オブジェクトのコピーを返します。" -#: ../../library/contextvars.rst:143 +#: ../../library/contextvars.rst:128 msgid "" "The following snippet gets a copy of the current context and prints all " "variables and their values that are set in it::" @@ -240,26 +204,19 @@ msgstr "" "次のスニペットは、現在のコンテキストのコピーを取得し、コンテキストに設定され" "ているすべての変数とその値を表示します::" -#: ../../library/contextvars.rst:146 +#: ../../library/contextvars.rst:134 msgid "" -"ctx: Context = copy_context()\n" -"print(list(ctx.items()))" +"The function has an O(1) complexity, i.e. works equally fast for contexts " +"with a few context variables and for contexts that have a lot of them." msgstr "" +"この関数の複雑性はO(1) です。つまり、少数のコンテキスト変数を持つコンテキスト" +"と多くの変数を持つコンテキストで同程度の速度で動作します。" -#: ../../library/contextvars.rst:149 -msgid "" -"The function has an *O*\\ (1) complexity, i.e. works equally fast for " -"contexts with a few context variables and for contexts that have a lot of " -"them." -msgstr "" -"この関数の複雑性は *O*\\ (1) です。つまり、少数のコンテキスト変数を持つコンテ" -"キストと多くの変数を持つコンテキストで同程度の速度で動作します。" - -#: ../../library/contextvars.rst:156 +#: ../../library/contextvars.rst:141 msgid "A mapping of :class:`ContextVars ` to their values." msgstr ":class:`ContextVars` とその値の対応付け。" -#: ../../library/contextvars.rst:158 +#: ../../library/contextvars.rst:143 msgid "" "``Context()`` creates an empty context with no values in it. To get a copy " "of the current context use the :func:`~contextvars.copy_context` function." @@ -267,111 +224,42 @@ msgstr "" "``Context()`` は、値を持たない空のコンテキストを生成します。現在のコンテキス" "トのコピーを得るには、:func:`~contextvars.copy_context` 関数を利用します。" -#: ../../library/contextvars.rst:162 -msgid "" -"Each thread has its own effective stack of :class:`!Context` objects. The :" -"term:`current context` is the :class:`!Context` object at the top of the " -"current thread's stack. All :class:`!Context` objects in the stacks are " -"considered to be *entered*." -msgstr "" - -#: ../../library/contextvars.rst:167 -msgid "" -"*Entering* a context, which can be done by calling its :meth:`~Context.run` " -"method, makes the context the current context by pushing it onto the top of " -"the current thread's context stack." -msgstr "" - -#: ../../library/contextvars.rst:171 -msgid "" -"*Exiting* from the current context, which can be done by returning from the " -"callback passed to the :meth:`~Context.run` method, restores the current " -"context to what it was before the context was entered by popping the context " -"off the top of the context stack." -msgstr "" - -#: ../../library/contextvars.rst:176 -msgid "" -"Since each thread has its own context stack, :class:`ContextVar` objects " -"behave in a similar fashion to :func:`threading.local` when values are " -"assigned in different threads." -msgstr "" - -#: ../../library/contextvars.rst:180 -msgid "" -"Attempting to enter an already entered context, including contexts entered " -"in other threads, raises a :exc:`RuntimeError`." -msgstr "" - -#: ../../library/contextvars.rst:183 -msgid "After exiting a context, it can later be re-entered (from any thread)." -msgstr "" - -#: ../../library/contextvars.rst:185 -msgid "" -"Any changes to :class:`ContextVar` values via the :meth:`ContextVar.set` " -"method are recorded in the current context. The :meth:`ContextVar.get` " -"method returns the value associated with the current context. Exiting a " -"context effectively reverts any changes made to context variables while the " -"context was entered (if needed, the values can be restored by re-entering " -"the context)." -msgstr "" - -#: ../../library/contextvars.rst:192 +#: ../../library/contextvars.rst:147 msgid "Context implements the :class:`collections.abc.Mapping` interface." msgstr "" "Context は、 :class:`collections.abc.Mapping` インターフェースを実装します。" -#: ../../library/contextvars.rst:196 +#: ../../library/contextvars.rst:151 msgid "" -"Enters the Context, executes ``callable(*args, **kwargs)``, then exits the " -"Context. Returns *callable*'s return value, or propagates an exception if " -"one occurred." +"Execute ``callable(*args, **kwargs)`` code in the context object the *run* " +"method is called on. Return the result of the execution or propagate an " +"exception if one occurred." msgstr "" +"``callable(*args, **kwargs)`` を *run* メソッドが呼ばれたコンテキストオブジェ" +"クトの中で実行します。実行した結果を返すか、例外が発生した場合はその例外を伝" +"播します。" -#: ../../library/contextvars.rst:200 -msgid "Example:" -msgstr "例:" +#: ../../library/contextvars.rst:155 +msgid "" +"Any changes to any context variables that *callable* makes will be contained " +"in the context object::" +msgstr "" +"*callable* が行ったコンテキスト変数へのいかなる変更も、コンテキストオブジェク" +"トに格納されます::" -#: ../../library/contextvars.rst:202 +#: ../../library/contextvars.rst:184 msgid "" -"import contextvars\n" -"\n" -"var = contextvars.ContextVar('var')\n" -"var.set('spam')\n" -"print(var.get()) # 'spam'\n" -"\n" -"ctx = contextvars.copy_context()\n" -"\n" -"def main():\n" -" # 'var' was set to 'spam' before\n" -" # calling 'copy_context()' and 'ctx.run(main)', so:\n" -" print(var.get()) # 'spam'\n" -" print(ctx[var]) # 'spam'\n" -"\n" -" var.set('ham')\n" -"\n" -" # Now, after setting 'var' to 'ham':\n" -" print(var.get()) # 'ham'\n" -" print(ctx[var]) # 'ham'\n" -"\n" -"# Any changes that the 'main' function makes to 'var'\n" -"# will be contained in 'ctx'.\n" -"ctx.run(main)\n" -"\n" -"# The 'main()' function was run in the 'ctx' context,\n" -"# so changes to 'var' are contained in it:\n" -"print(ctx[var]) # 'ham'\n" -"\n" -"# However, outside of 'ctx', 'var' is still set to 'spam':\n" -"print(var.get()) # 'spam'" +"The method raises a :exc:`RuntimeError` when called on the same context " +"object from more than one OS thread, or when called recursively." msgstr "" +"2つ以上の OS スレッドから同一のコンテキストオブジェクトを呼び出すか、再帰的に" +"呼び出したとき、メソッドは :exc:`RuntimeError` を送出します。" -#: ../../library/contextvars.rst:248 +#: ../../library/contextvars.rst:190 msgid "Return a shallow copy of the context object." msgstr "コンテキストオブジェクトの浅いコピーを返します。" -#: ../../library/contextvars.rst:252 +#: ../../library/contextvars.rst:194 msgid "" "Return ``True`` if the *context* has a value for *var* set; return ``False`` " "otherwise." @@ -379,7 +267,7 @@ msgstr "" "*context* に *var* の値が設定されていた場合 ``True`` を返します; そうでない場" "合は ``False`` を返します。" -#: ../../library/contextvars.rst:257 +#: ../../library/contextvars.rst:199 msgid "" "Return the value of the *var* :class:`ContextVar` variable. If the variable " "is not set in the context object, a :exc:`KeyError` is raised." @@ -387,7 +275,7 @@ msgstr "" ":class:`ContextVar` *var* の値を返します。コンテキストオブジェクト内で変数が" "設定されていない場合は、:exc:`KeyError` を送出します。" -#: ../../library/contextvars.rst:263 +#: ../../library/contextvars.rst:205 msgid "" "Return the value for *var* if *var* has the value in the context object. " "Return *default* otherwise. If *default* is not given, return ``None``." @@ -396,23 +284,23 @@ msgstr "" "れば、*default* を返します。*default* を指定していなければ、``None`` を返しま" "す。" -#: ../../library/contextvars.rst:269 +#: ../../library/contextvars.rst:211 msgid "Return an iterator over the variables stored in the context object." msgstr "コンテキストオブジェクトに格納されている変数群のイテレータを返します。" -#: ../../library/contextvars.rst:274 +#: ../../library/contextvars.rst:216 msgid "Return the number of variables set in the context object." msgstr "コンテキストオブジェクトに格納されている変数の数を返します。" -#: ../../library/contextvars.rst:278 +#: ../../library/contextvars.rst:220 msgid "Return a list of all variables in the context object." msgstr "コンテキストオブジェクト中のすべての変数のリストを返します。" -#: ../../library/contextvars.rst:282 +#: ../../library/contextvars.rst:224 msgid "Return a list of all variables' values in the context object." msgstr "コンテキストオブジェクト中のすべての変数の値のリストを返します。" -#: ../../library/contextvars.rst:287 +#: ../../library/contextvars.rst:229 msgid "" "Return a list of 2-tuples containing all variables and their values in the " "context object." @@ -420,11 +308,11 @@ msgstr "" "コンテキストオブジェクト中のすべての変数について、変数とその値からなる2要素の" "タプルのリストを返します。" -#: ../../library/contextvars.rst:292 +#: ../../library/contextvars.rst:234 msgid "asyncio support" msgstr "asyncio サポート" -#: ../../library/contextvars.rst:294 +#: ../../library/contextvars.rst:236 msgid "" "Context variables are natively supported in :mod:`asyncio` and are ready to " "be used without any extra configuration. For example, here is a simple echo " @@ -434,49 +322,3 @@ msgstr "" "コンテキスト変数は、追加の設定なしに :mod:`asyncio` をサポートします。例え" "ば、次の単純なechoサーバーは、クライアントを扱う Task の中でリモートクライア" "ントのアドレスが利用できるように、コンテキスト変数を利用します::" - -#: ../../library/contextvars.rst:300 -msgid "" -"import asyncio\n" -"import contextvars\n" -"\n" -"client_addr_var = contextvars.ContextVar('client_addr')\n" -"\n" -"def render_goodbye():\n" -" # The address of the currently handled client can be accessed\n" -" # without passing it explicitly to this function.\n" -"\n" -" client_addr = client_addr_var.get()\n" -" return f'Good bye, client @ {client_addr}\\r\\n'.encode()\n" -"\n" -"async def handle_request(reader, writer):\n" -" addr = writer.transport.get_extra_info('socket').getpeername()\n" -" client_addr_var.set(addr)\n" -"\n" -" # In any code that we call is now possible to get\n" -" # client's address by calling 'client_addr_var.get()'.\n" -"\n" -" while True:\n" -" line = await reader.readline()\n" -" print(line)\n" -" if not line.strip():\n" -" break\n" -"\n" -" writer.write(b'HTTP/1.1 200 OK\\r\\n') # status line\n" -" writer.write(b'\\r\\n') # headers\n" -" writer.write(render_goodbye()) # body\n" -" writer.close()\n" -"\n" -"async def main():\n" -" srv = await asyncio.start_server(\n" -" handle_request, '127.0.0.1', 8081)\n" -"\n" -" async with srv:\n" -" await srv.serve_forever()\n" -"\n" -"asyncio.run(main())\n" -"\n" -"# To test it you can use telnet or curl:\n" -"# telnet 127.0.0.1 8081\n" -"# curl 127.0.0.1:8081" -msgstr "" diff --git a/library/copy.po b/library/copy.po index 6720162f9..c78aa9319 100644 --- a/library/copy.po +++ b/library/copy.po @@ -1,35 +1,35 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Yusuke Miyazaki , 2021 -# mollinaca, 2021 -# Arihiro TAKASE, 2023 -# Masato HASHIMOTO , 2023 -# tomo, 2023 -# 石井明久, 2024 +# Arihiro TAKASE, 2017 +# Nozomu Kaneko , 2017 +# Osamu NAKAMURA, 2017 +# tomo, 2019 +# mollinaca, 2020 +# Yusuke Miyazaki , 2020 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-30 14:22+0000\n" -"PO-Revision-Date: 2021-06-28 01:03+0000\n" -"Last-Translator: 石井明久, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 23:04+0000\n" +"Last-Translator: Yusuke Miyazaki , 2020\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/copy.rst:2 -msgid ":mod:`!copy` --- Shallow and deep copy operations" -msgstr ":mod:`!copy` --- 浅いコピーおよび深いコピー操作" +msgid ":mod:`copy` --- Shallow and deep copy operations" +msgstr ":mod:`copy` --- 浅いコピーおよび深いコピー操作" #: ../../library/copy.rst:7 msgid "**Source code:** :source:`Lib/copy.py`" @@ -55,24 +55,18 @@ msgid "Interface summary:" msgstr "以下にインターフェースをまとめます:" #: ../../library/copy.rst:22 -msgid "Return a shallow copy of *obj*." -msgstr "" +msgid "Return a shallow copy of *x*." +msgstr "*x* の浅い (shallow) コピーを返します。" #: ../../library/copy.rst:27 -msgid "Return a deep copy of *obj*." -msgstr "" +msgid "Return a deep copy of *x*." +msgstr "*x* の深い (deep) コピーを返します。" #: ../../library/copy.rst:32 -msgid "" -"Creates a new object of the same type as *obj*, replacing fields with values " -"from *changes*." -msgstr "" - -#: ../../library/copy.rst:40 msgid "Raised for module specific errors." msgstr "モジュール特有のエラーを送出します。" -#: ../../library/copy.rst:44 +#: ../../library/copy.rst:36 msgid "" "The difference between shallow and deep copying is only relevant for " "compound objects (objects that contain other objects, like lists or class " @@ -82,7 +76,7 @@ msgstr "" "ト (リストやクラスインスタンスのような他のオブジェクトを含むオブジェクト) だ" "けです:" -#: ../../library/copy.rst:47 +#: ../../library/copy.rst:39 msgid "" "A *shallow copy* constructs a new compound object and then (to the extent " "possible) inserts *references* into it to the objects found in the original." @@ -91,7 +85,7 @@ msgstr "" "限り) 元のオブジェクト中に見つかったオブジェクトに対する *参照* を挿入しま" "す。" -#: ../../library/copy.rst:50 +#: ../../library/copy.rst:42 msgid "" "A *deep copy* constructs a new compound object and then, recursively, " "inserts *copies* into it of the objects found in the original." @@ -99,7 +93,7 @@ msgstr "" "*深いコピー (deep copy)* は新たな複合オブジェクトを作成し、その後元のオブジェ" "クト中に見つかったオブジェクトの *コピー* を挿入します。" -#: ../../library/copy.rst:53 +#: ../../library/copy.rst:45 msgid "" "Two problems often exist with deep copy operations that don't exist with " "shallow copy operations:" @@ -107,7 +101,7 @@ msgstr "" "深いコピー操作には、しばしば浅いコピー操作の時には存在しない 2 つの問題がつい" "てまわります:" -#: ../../library/copy.rst:56 +#: ../../library/copy.rst:48 msgid "" "Recursive objects (compound objects that, directly or indirectly, contain a " "reference to themselves) may cause a recursive loop." @@ -115,7 +109,7 @@ msgstr "" "再帰的なオブジェクト (直接、間接に関わらず、自分自身に対する参照を持つ複合オ" "ブジェクト) は再帰ループを引き起こします。" -#: ../../library/copy.rst:59 +#: ../../library/copy.rst:51 msgid "" "Because deep copy copies everything it may copy too much, such as data which " "is intended to be shared between copies." @@ -123,12 +117,12 @@ msgstr "" "深いコピーは何もかもコピーしてしまうため、例えば複数のコピー間で共有するつも" "りだったデータも余分にコピーしてしまいます。" -#: ../../library/copy.rst:62 +#: ../../library/copy.rst:54 msgid "The :func:`deepcopy` function avoids these problems by:" msgstr "" ":func:`deepcopy` 関数では、これらの問題を以下のようにして回避しています:" -#: ../../library/copy.rst:64 +#: ../../library/copy.rst:56 msgid "" "keeping a ``memo`` dictionary of objects already copied during the current " "copying pass; and" @@ -136,7 +130,7 @@ msgstr "" "現時点でのコピー過程ですでにコピーされたオブジェクトの ``memo`` 辞書を保持す" "る。" -#: ../../library/copy.rst:67 +#: ../../library/copy.rst:59 msgid "" "letting user-defined classes override the copying operation or the set of " "components copied." @@ -144,21 +138,21 @@ msgstr "" "ユーザ定義のクラスでコピー操作やコピーされる内容の集合を上書きできるようにす" "る。" -#: ../../library/copy.rst:70 +#: ../../library/copy.rst:62 msgid "" "This module does not copy types like module, method, stack trace, stack " -"frame, file, socket, window, or any similar types. It does \"copy\" " +"frame, file, socket, window, array, or any similar types. It does \"copy\" " "functions and classes (shallow and deeply), by returning the original object " "unchanged; this is compatible with the way these are treated by the :mod:" "`pickle` module." msgstr "" "このモジュールでは、モジュール、メソッド、スタックトレース、スタックフレー" -"ム、ファイル、ソケット、ウィンドウ、その他これらに類似の型をコピーしません。" -"このモジュールでは元のオブジェクトを変更せずに返すことで関数とクラスを (浅く" -"または深く)「コピー」します。これは :mod:`pickle` モジュールでの扱われかたと" -"同じです。" +"ム、ファイル、ソケット、ウィンドウ、アレイ、その他これらに類似の型をコピーし" +"ません。このモジュールでは元のオブジェクトを変更せずに返すことで関数とクラス" +"を (浅くまたは深く)「コピー」します。これは :mod:`pickle` モジュールでの扱わ" +"れかたと同じです。" -#: ../../library/copy.rst:75 +#: ../../library/copy.rst:67 msgid "" "Shallow copies of dictionaries can be made using :meth:`dict.copy`, and of " "lists by assigning a slice of the entire list, for example, ``copied_list = " @@ -167,7 +161,7 @@ msgstr "" "辞書型の浅いコピーは :meth:`dict.copy` で、リストの浅いコピーはリスト全体を指" "すスライス (例えば ``copied_list = original_list[:]``) でできます。" -#: ../../library/copy.rst:81 +#: ../../library/copy.rst:73 msgid "" "Classes can use the same interfaces to control copying that they use to " "control pickling. See the description of module :mod:`pickle` for " @@ -179,69 +173,33 @@ msgstr "" "ル :mod:`pickle` の説明を参照してください。実際、 :mod:`copy` モジュール" "は、 :mod:`copyreg` モジュールによって登録された pickle 関数を使用します。" -#: ../../library/copy.rst:92 +#: ../../library/copy.rst:82 msgid "" "In order for a class to define its own copy implementation, it can define " -"special methods :meth:`~object.__copy__` and :meth:`~object.__deepcopy__`." -msgstr "" - -#: ../../library/copy.rst:98 -msgid "" -"Called to implement the shallow copy operation; no additional arguments are " -"passed." -msgstr "" - -#: ../../library/copy.rst:104 -msgid "" -"Called to implement the deep copy operation; it is passed one argument, the " -"*memo* dictionary. If the ``__deepcopy__`` implementation needs to make a " -"deep copy of a component, it should call the :func:`~copy.deepcopy` function " -"with the component as first argument and the *memo* dictionary as second " -"argument. The *memo* dictionary should be treated as an opaque object." -msgstr "" - -#: ../../library/copy.rst:114 -msgid "" -"Function :func:`!copy.replace` is more limited than :func:`~copy.copy` and :" -"func:`~copy.deepcopy`, and only supports named tuples created by :func:" -"`~collections.namedtuple`, :mod:`dataclasses`, and other classes which " -"define method :meth:`~object.__replace__`." -msgstr "" - -#: ../../library/copy.rst:122 -msgid "" -"This method should create a new object of the same type, replacing fields " -"with values from *changes*." -msgstr "" - -#: ../../library/copy.rst:130 +"special methods :meth:`__copy__` and :meth:`__deepcopy__`. The former is " +"called to implement the shallow copy operation; no additional arguments are " +"passed. The latter is called to implement the deep copy operation; it is " +"passed one argument, the ``memo`` dictionary. If the :meth:`__deepcopy__` " +"implementation needs to make a deep copy of a component, it should call the :" +"func:`deepcopy` function with the component as first argument and the memo " +"dictionary as second argument." +msgstr "" +"クラス独自のコピー実装を定義するために、特殊メソッド :meth:`__copy__` およ" +"び :meth:`__deepcopy__` を定義することができます。前者は浅いコピー操作を実装" +"するために使われます; 追加の引数はありません。後者は深いコピー操作を実現する" +"ために呼び出されます; この関数には単一の引数として ``memo`` 辞書が渡されま" +"す。 :meth:`__deepcopy__` の実装で、内容のオブジェクトに対して深いコピーを生" +"成する必要がある場合、 :func:`deepcopy` を呼び出し、最初の引数にそのオブジェ" +"クトを、メモ辞書を二つ目の引数に与えなければなりません。" + +#: ../../library/copy.rst:94 msgid "Module :mod:`pickle`" msgstr ":mod:`pickle` モジュール" -#: ../../library/copy.rst:131 +#: ../../library/copy.rst:94 msgid "" "Discussion of the special methods used to support object state retrieval and " "restoration." msgstr "" "オブジェクト状態の取得と復元をサポートするために使われる特殊メソッドについて" "議論されています。" - -#: ../../library/copy.rst:79 -msgid "module" -msgstr "module" - -#: ../../library/copy.rst:79 -msgid "pickle" -msgstr "pickle" - -#: ../../library/copy.rst:86 -msgid "__copy__() (copy protocol)" -msgstr "__copy__() (コピープロトコル)" - -#: ../../library/copy.rst:86 -msgid "__deepcopy__() (copy protocol)" -msgstr "__deepcopy__() (コピープロトコル)" - -#: ../../library/copy.rst:111 -msgid "__replace__() (replace protocol)" -msgstr "" diff --git a/library/copyreg.po b/library/copyreg.po index 747000b60..e06df1fdc 100644 --- a/library/copyreg.po +++ b/library/copyreg.po @@ -1,33 +1,33 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Arihiro TAKASE, 2023 -# Inada Naoki , 2023 -# tomo, 2023 -# 石井明久, 2024 +# Nozomu Kaneko , 2017 +# 秘湯 , 2017 +# Arihiro TAKASE, 2017 +# Osamu NAKAMURA, 2021 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-13 14:21+0000\n" -"PO-Revision-Date: 2021-06-28 01:03+0000\n" -"Last-Translator: 石井明久, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 23:04+0000\n" +"Last-Translator: Osamu NAKAMURA, 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/copyreg.rst:2 -msgid ":mod:`!copyreg` --- Register :mod:`!pickle` support functions" -msgstr ":mod:`!copyreg` --- :mod:`!pickle` サポート関数を登録する" +msgid ":mod:`copyreg` --- Register :mod:`pickle` support functions" +msgstr ":mod:`copyreg` --- :mod:`pickle` サポート関数を登録する" #: ../../library/copyreg.rst:7 msgid "**Source code:** :source:`Lib/copyreg.py`" @@ -60,53 +60,46 @@ msgstr "" #: ../../library/copyreg.rst:30 msgid "" "Declares that *function* should be used as a \"reduction\" function for " -"objects of type *type*. *function* must return either a string or a tuple " -"containing between two and six elements. See the :attr:`~pickle.Pickler." -"dispatch_table` for more details on the interface of *function*." +"objects of type *type*. *function* should return either a string or a tuple " +"containing two or three elements." msgstr "" "*function* が型 *type* のオブジェクトに対する\"リダクション\"関数として使われ" -"るように宣言します。 *function* は文字列か、2要素から6要素を含んだタプルを返" -"さなければなりません。 *function* のインターフェースについての詳細は :attr:" -"`~pickle.Pickler.dispatch_table` を参照してください。" +"るように宣言します。*function* は文字列か、2要素または3要素を含んだタプルを返" +"さなければなりません。" -#: ../../library/copyreg.rst:35 +#: ../../library/copyreg.rst:34 msgid "" -"The *constructor_ob* parameter is a legacy feature and is now ignored, but " -"if passed it must be a callable." +"The optional *constructor* parameter, if provided, is a callable object " +"which can be used to reconstruct the object when called with the tuple of " +"arguments returned by *function* at pickling time. :exc:`TypeError` will be " +"raised if *object* is a class or *constructor* is not callable." msgstr "" -"*constructor_ob* は古い機能で、現在は無視されますが、値を渡す場合は呼び出し可" -"能 (callable) でなければなりません。" +"オプションの *constructor* パラメータが与えられた場合、それは呼び出し可能オブ" +"ジェクトで、 *function* が返した引数のタプルとともに pickle 化時に呼ばれてオ" +"ブジェクトを再構築するために使われます。 *object* がクラスの場合、または " +"*constructor* が呼び出し可能でない場合には :exc:`TypeError` が発生します。" -#: ../../library/copyreg.rst:38 +#: ../../library/copyreg.rst:39 msgid "" -"Note that the :attr:`~pickle.Pickler.dispatch_table` attribute of a pickler " -"object or subclass of :class:`pickle.Pickler` can also be used for declaring " -"reduction functions." +"See the :mod:`pickle` module for more details on the interface expected of " +"*function* and *constructor*. Note that the :attr:`~pickle.Pickler." +"dispatch_table` attribute of a pickler object or subclass of :class:`pickle." +"Pickler` can also be used for declaring reduction functions." msgstr "" -"pickler オブジェクトまたは :class:`pickle.Pickler` のサブクラスの :attr:" -"`~pickle.Pickler.dispatch_table` 属性を、リダクション関数の宣言のために使うこ" -"ともできるということは覚えておいてください。" +"*function* と *constructor* に期待されるインターフェースについての詳細につい" +"ては :mod:`pickle` モジュールを参照してください。 pickler オブジェクトまた" +"は :class:`pickle.Pickler` のサブクラスの :attr:`~pickle.Pickler." +"dispatch_table` 属性を、リダクション関数の宣言のために使うこともできるという" +"ことは覚えておいてください。" -#: ../../library/copyreg.rst:43 +#: ../../library/copyreg.rst:46 msgid "Example" msgstr "使用例" -#: ../../library/copyreg.rst:45 +#: ../../library/copyreg.rst:48 msgid "" "The example below would like to show how to register a pickle function and " "how it will be used:" msgstr "" "下記の例は、pickle 関数を登録する方法と、それがどのように使用されるかを示そう" "としています:" - -#: ../../library/copyreg.rst:9 -msgid "module" -msgstr "module" - -#: ../../library/copyreg.rst:9 -msgid "pickle" -msgstr "pickle" - -#: ../../library/copyreg.rst:9 -msgid "copy" -msgstr "copy" diff --git a/library/crypt.po b/library/crypt.po index 0822a29e4..9bbc8bac6 100644 --- a/library/crypt.po +++ b/library/crypt.po @@ -1,44 +1,235 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # +# Translators: +# 秘湯 , 2017 +# Arihiro TAKASE, 2017 +# Nozomu Kaneko , 2017 +# Yusuke Miyazaki , 2017 +# Osamu NAKAMURA, 2017 +# tomo, 2021 +# #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-13 14:21+0000\n" -"PO-Revision-Date: 2024-11-19 01:02+0000\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 23:04+0000\n" +"Last-Translator: tomo, 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/crypt.rst:2 -msgid ":mod:`!crypt` --- Function to check Unix passwords" +msgid ":mod:`crypt` --- Function to check Unix passwords" +msgstr ":mod:`crypt` --- Unix パスワードをチェックするための関数" + +#: ../../library/crypt.rst:12 +msgid "**Source code:** :source:`Lib/crypt.py`" +msgstr "**ソースコード:** :source:`Lib/crypt.py`" + +#: ../../library/crypt.rst:20 +msgid "" +"This module implements an interface to the :manpage:`crypt(3)` routine, " +"which is a one-way hash function based upon a modified DES algorithm; see " +"the Unix man page for further details. Possible uses include storing hashed " +"passwords so you can check passwords without storing the actual password, or " +"attempting to crack Unix passwords with a dictionary." +msgstr "" +"このモジュールは修正 DES アルゴリズムに基づいた一方向ハッシュ関数である :" +"manpage:`crypt(3)` ルーチンを実装しています。詳細については Unix マニュアル" +"ページを参照してください。このモジュールは、実際に入力されたパスワードを記録" +"することなくチェック出来るようにするためのハッシュ化パスワードを記録したり、" +"Unix パスワードに (脆弱性検査のための) 辞書攻撃を試みるのに使えます。" + +#: ../../library/crypt.rst:28 +msgid "" +"Notice that the behavior of this module depends on the actual " +"implementation of the :manpage:`crypt(3)` routine in the running system. " +"Therefore, any extensions available on the current implementation will also " +"be available on this module." +msgstr "" +"このモジュールは実行環境の :manpage:`crypt(3)` の実装に依存しています。そのた" +"め、現在の実装で利用可能な拡張を、このモジュールでもそのまま利用できます。" + +#: ../../library/crypt.rst:34 +msgid ":ref:`Availability `: Unix. Not available on VxWorks." +msgstr ":ref:`利用可能環境 `: Unix。VxWorksでは使えません。" + +#: ../../library/crypt.rst:36 +msgid "Hashing Methods" +msgstr "ハッシュ化方式" + +#: ../../library/crypt.rst:40 +msgid "" +"The :mod:`crypt` module defines the list of hashing methods (not all methods " +"are available on all platforms):" msgstr "" +":mod:`crypt` モジュールはハッシュ化方式の一覧を定義しています (すべての方式が" +"すべてのプラットフォームで使えるわけではありません):" -#: ../../library/crypt.rst:10 +#: ../../library/crypt.rst:45 msgid "" -"This module is no longer part of the Python standard library. It was :ref:" -"`removed in Python 3.13 ` after being deprecated in " -"Python 3.11. The removal was decided in :pep:`594`." +"A Modular Crypt Format method with 16 character salt and 86 character hash " +"based on the SHA-512 hash function. This is the strongest method." msgstr "" -#: ../../library/crypt.rst:14 +#: ../../library/crypt.rst:50 +msgid "" +"Another Modular Crypt Format method with 16 character salt and 43 character " +"hash based on the SHA-256 hash function." +msgstr "" + +#: ../../library/crypt.rst:55 +msgid "" +"Another Modular Crypt Format method with 22 character salt and 31 character " +"hash based on the Blowfish cipher." +msgstr "" + +#: ../../library/crypt.rst:62 +msgid "" +"Another Modular Crypt Format method with 8 character salt and 22 character " +"hash based on the MD5 hash function." +msgstr "" + +#: ../../library/crypt.rst:67 +msgid "" +"The traditional method with a 2 character salt and 13 characters of hash. " +"This is the weakest method." +msgstr "" +"2文字のソルトと13文字のハッシュ値を持つモジュラー暗号形式です。これが最も弱い" +"方式です。" + +#: ../../library/crypt.rst:72 +msgid "Module Attributes" +msgstr "モジュール属性" + +#: ../../library/crypt.rst:78 +msgid "" +"A list of available password hashing algorithms, as ``crypt.METHOD_*`` " +"objects. This list is sorted from strongest to weakest." +msgstr "" +"利用可能なパスワードのハッシュアルゴリズムのリストを、``crypt.METHOD_*`` オブ" +"ジェクトとして返します。\n" +"このリストは最も強いものから弱いものの順で並べられています。" + +#: ../../library/crypt.rst:84 +msgid "Module Functions" +msgstr "モジュール関数" + +#: ../../library/crypt.rst:86 +msgid "The :mod:`crypt` module defines the following functions:" +msgstr ":mod:`crypt` モジュールは以下の関数を定義しています:" + +#: ../../library/crypt.rst:90 +msgid "" +"*word* will usually be a user's password as typed at a prompt or in a " +"graphical interface. The optional *salt* is either a string as returned " +"from :func:`mksalt`, one of the ``crypt.METHOD_*`` values (though not all " +"may be available on all platforms), or a full encrypted password including " +"salt, as returned by this function. If *salt* is not provided, the " +"strongest method will be used (as returned by :func:`methods`)." +msgstr "" + +#: ../../library/crypt.rst:98 +msgid "" +"Checking a password is usually done by passing the plain-text password as " +"*word* and the full results of a previous :func:`crypt` call, which should " +"be the same as the results of this call." +msgstr "" +"通常は、生の文字列のパスワードを *word* として渡し、前回の :func:`crypt` を呼" +"び出した結果と今回の呼び出しの結果が同じになることで、パスワードの確認を行い" +"ます。" + +#: ../../library/crypt.rst:102 +msgid "" +"*salt* (either a random 2 or 16 character string, possibly prefixed with " +"``$digit$`` to indicate the method) which will be used to perturb the " +"encryption algorithm. The characters in *salt* must be in the set ``[./a-zA-" +"Z0-9]``, with the exception of Modular Crypt Format which prefixes a " +"``$digit$``." +msgstr "" +"*salt* (2文字から16文字のランダムな文字列で、方式を示す ``$digit$`` が先頭に" +"付いているかもしれません) は、暗号化アルゴリズムにぶれを生じさせるために使わ" +"れます。 *salt* に含まれる文字は、モジュラー暗号形式の先頭にある ``$digit$`` " +"を除いて、集合 ``[./a-zA-Z0-9]`` に含まれていなければいけません。" + +#: ../../library/crypt.rst:108 +msgid "" +"Returns the hashed password as a string, which will be composed of " +"characters from the same alphabet as the salt." +msgstr "" +"ハッシュ化されたパスワードを文字列として返します。それは salt と同じアルファ" +"ベット文字から構成されます。" + +#: ../../library/crypt.rst:113 +msgid "" +"Since a few :manpage:`crypt(3)` extensions allow different values, with " +"different sizes in the *salt*, it is recommended to use the full crypted " +"password as salt when checking for a password." +msgstr "" +"いくつかの拡張された :manpage:`crypt(3)` は異なる値と *salt* の長さを許してい" +"るので、パスワードをチェックする際には crypt されたパスワード文字列全体を " +"*salt* として渡すよう勧めます。" + +#: ../../library/crypt.rst:117 +msgid "Accept ``crypt.METHOD_*`` values in addition to strings for *salt*." +msgstr "" +"文字列に加え、 *salt* が ``crypt.METHOD_*`` 値も受け取るようになりました。" + +#: ../../library/crypt.rst:123 +msgid "" +"Return a randomly generated salt of the specified method. If no *method* is " +"given, the strongest method available as returned by :func:`methods` is used." +msgstr "" +"指定された方式のランダムに生成されたソルトを返します。 *method* が与えられな" +"かった場合は、 :func:`methods` で返される方式のうち最も強いものが使われます。" + +#: ../../library/crypt.rst:127 +msgid "" +"The return value is a string suitable for passing as the *salt* argument to :" +"func:`crypt`." +msgstr "" + +#: ../../library/crypt.rst:130 +msgid "" +"*rounds* specifies the number of rounds for ``METHOD_SHA256``, " +"``METHOD_SHA512`` and ``METHOD_BLOWFISH``. For ``METHOD_SHA256`` and " +"``METHOD_SHA512`` it must be an integer between ``1000`` and " +"``999_999_999``, the default is ``5000``. For ``METHOD_BLOWFISH`` it must " +"be a power of two between ``16`` (2\\ :sup:`4`) and ``2_147_483_648`` (2\\ :" +"sup:`31`), the default is ``4096`` (2\\ :sup:`12`)." +msgstr "" + +#: ../../library/crypt.rst:140 +msgid "Added the *rounds* parameter." +msgstr "" + +#: ../../library/crypt.rst:145 +msgid "Examples" +msgstr "使用例" + +#: ../../library/crypt.rst:147 msgid "" -"Applications can use the :mod:`hashlib` module from the standard library. " -"Other possible replacements are third-party libraries from PyPI: :pypi:" -"`legacycrypt`, :pypi:`bcrypt`, :pypi:`argon2-cffi`, or :pypi:`passlib`. " -"These are not supported or maintained by the Python core team." +"A simple example illustrating typical use (a constant-time comparison " +"operation is needed to limit exposure to timing attacks. :func:`hmac." +"compare_digest` is suitable for this purpose)::" msgstr "" +"典型的な使い方を簡単な例で示します (タイミング攻撃に晒されないように、一定時" +"間の比較演算子を使う必要があり、 :func:`hmac.compare_digest` がこの目的にちょ" +"うど良いです)::" -#: ../../library/crypt.rst:19 +#: ../../library/crypt.rst:167 msgid "" -"The last version of Python that provided the :mod:`!crypt` module was " -"`Python 3.12 `_." +"To generate a hash of a password using the strongest available method and " +"check it against the original::" msgstr "" +"利用可能な方式のうち最も強い方式を使いパスワードのハッシュ値を生成し、元のパ" +"スワードと比較してチェックします::" diff --git a/library/crypto.po b/library/crypto.po index 1a2e123bf..d6b23b04b 100644 --- a/library/crypto.po +++ b/library/crypto.po @@ -1,27 +1,26 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 -# Inada Naoki , 2023 -# 石井明久, 2024 +# 秘湯 , 2017 +# Nozomu Kaneko , 2017 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-13 14:21+0000\n" -"PO-Revision-Date: 2021-06-28 01:03+0000\n" -"Last-Translator: 石井明久, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 23:04+0000\n" +"Last-Translator: Nozomu Kaneko , 2017\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/crypto.rst:5 @@ -32,12 +31,10 @@ msgstr "暗号関連のサービス" msgid "" "The modules described in this chapter implement various algorithms of a " "cryptographic nature. They are available at the discretion of the " -"installation. Here's an overview:" +"installation. On Unix systems, the :mod:`crypt` module may also be " +"available. Here's an overview:" msgstr "" -"この章で記述されているモジュールでは、暗号の本質に関わる様々なアルゴリズムを" -"実装しています。 これらは必要に応じてインストールすることで使用できます。概要" -"を以下に示します:" - -#: ../../library/crypto.rst:7 -msgid "cryptography" -msgstr "cryptography" +"この章で説明しているモジュールは、暗号的な性質の様々なアルゴリズムを実装して" +"います。これらはインストールする際の選択によって利用可能です。 Unix システム" +"においては、さらに :mod:`crypt` モジュールが利用可能な場合があります。これは" +"概観です:" diff --git a/library/csv.po b/library/csv.po index 1408be633..75af9e9e1 100644 --- a/library/csv.po +++ b/library/csv.po @@ -1,35 +1,36 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: +# 秘湯 , 2017 +# Hano, 2017 +# Arihiro TAKASE, 2017 +# Nozomu Kaneko , 2017 +# tomo, 2020 +# Takanori Suzuki , 2021 # mollinaca, 2021 -# tomo, 2023 -# Nozomu Kaneko , 2023 -# souma987, 2023 -# Takanori Suzuki , 2024 -# 石井明久, 2024 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-13 14:21+0000\n" -"PO-Revision-Date: 2021-06-28 01:03+0000\n" -"Last-Translator: 石井明久, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-08-07 07:09+0000\n" +"PO-Revision-Date: 2017-02-16 23:04+0000\n" +"Last-Translator: mollinaca, 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/csv.rst:2 -msgid ":mod:`!csv` --- CSV File Reading and Writing" -msgstr ":mod:`!csv` --- CSV ファイルの読み書き" +msgid ":mod:`csv` --- CSV File Reading and Writing" +msgstr ":mod:`csv` --- CSV ファイルの読み書き" #: ../../library/csv.rst:9 msgid "**Source code:** :source:`Lib/csv.py`" @@ -108,90 +109,86 @@ msgstr ":mod:`csv` モジュールでは以下の関数を定義しています: #: ../../library/csv.rst:58 msgid "" -"Return a :ref:`reader object ` that will process lines from " -"the given *csvfile*. A csvfile must be an iterable of strings, each in the " -"reader's defined csv format. A csvfile is most commonly a file-like object " -"or list. If *csvfile* is a file object, it should be opened with " -"``newline=''``. [1]_ An optional *dialect* parameter can be given which is " -"used to define a set of parameters specific to a particular CSV dialect. It " -"may be an instance of a subclass of the :class:`Dialect` class or one of the " -"strings returned by the :func:`list_dialects` function. The other optional " -"*fmtparams* keyword arguments can be given to override individual formatting " -"parameters in the current dialect. For full details about the dialect and " -"formatting parameters, see section :ref:`csv-fmt-params`." +"Return a reader object which will iterate over lines in the given *csvfile*. " +"*csvfile* can be any object which supports the :term:`iterator` protocol and " +"returns a string each time its :meth:`!__next__` method is called --- :term:" +"`file objects ` and list objects are both suitable. If " +"*csvfile* is a file object, it should be opened with ``newline=''``. [1]_ " +"An optional *dialect* parameter can be given which is used to define a set " +"of parameters specific to a particular CSV dialect. It may be an instance " +"of a subclass of the :class:`Dialect` class or one of the strings returned " +"by the :func:`list_dialects` function. The other optional *fmtparams* " +"keyword arguments can be given to override individual formatting parameters " +"in the current dialect. For full details about the dialect and formatting " +"parameters, see section :ref:`csv-fmt-params`." msgstr "" - -#: ../../library/csv.rst:72 +"与えられた *csvfile* 内の行を反復処理するような reader オブジェクトを返しま" +"す。 *csvfile* は :term:`イテレータ ` プロトコルをサポートし、 :" +"meth:`!__next__` メソッドが呼ばれた際に常に文字列を返すような任意のオブジェク" +"トにすることができます --- :term:`ファイルオブジェクト ` でもリ" +"ストでも構いません。 *csvfile* がファイルオブジェクトの場合、 ``newline=''`` " +"として開くべきです。 [1]_ オプションとして *dialect* パラメータを与えることが" +"でき、特定の CSV 表現形式 (dialect) 特有のパラメータの集合を定義するために使" +"われます。 *dialect* 引数は :class:`Dialect` クラスのサブクラスのインスタンス" +"か、 :func:`list_dialects` 関数が返す文字列の一つにすることができます。別のオ" +"プションである *fmtparams* キーワード引数は、現在の表現形式における個々の書式" +"パラメータを上書きするために与えることができます。表現形式および書式化パラ" +"メータの詳細については、 :ref:`csv-fmt-params` 節を参照してください。" + +#: ../../library/csv.rst:71 msgid "" "Each row read from the csv file is returned as a list of strings. No " -"automatic data type conversion is performed unless the :data:" -"`QUOTE_NONNUMERIC` format option is specified (in which case unquoted fields " -"are transformed into floats)." +"automatic data type conversion is performed unless the ``QUOTE_NONNUMERIC`` " +"format option is specified (in which case unquoted fields are transformed " +"into floats)." msgstr "" +"csv ファイルから読み込まれた各行は、文字列のリストとして返されます。" +"``QUOTE_NONNUMERIC`` フォーマットオプションが指定された場合を除き、データ型の" +"変換が自動的に行われることはありません (このオプションが指定された場合、" +"クォートされていないフィールドは浮動小数点数に変換されます)。" -#: ../../library/csv.rst:76 ../../library/csv.rst:106 ../../library/csv.rst:181 -#: ../../library/csv.rst:219 +#: ../../library/csv.rst:75 ../../library/csv.rst:105 ../../library/csv.rst:176 +#: ../../library/csv.rst:212 msgid "A short usage example::" msgstr "短い利用例::" -#: ../../library/csv.rst:78 -msgid "" -">>> import csv\n" -">>> with open('eggs.csv', newline='') as csvfile:\n" -"... spamreader = csv.reader(csvfile, delimiter=' ', quotechar='|')\n" -"... for row in spamreader:\n" -"... print(', '.join(row))\n" -"Spam, Spam, Spam, Spam, Spam, Baked Beans\n" -"Spam, Lovely Spam, Wonderful Spam" -msgstr "" - -#: ../../library/csv.rst:89 +#: ../../library/csv.rst:88 msgid "" "Return a writer object responsible for converting the user's data into " "delimited strings on the given file-like object. *csvfile* can be any " -"object with a :meth:`~io.TextIOBase.write` method. If *csvfile* is a file " -"object, it should be opened with ``newline=''`` [1]_. An optional *dialect* " -"parameter can be given which is used to define a set of parameters specific " -"to a particular CSV dialect. It may be an instance of a subclass of the :" -"class:`Dialect` class or one of the strings returned by the :func:" -"`list_dialects` function. The other optional *fmtparams* keyword arguments " -"can be given to override individual formatting parameters in the current " -"dialect. For full details about dialects and formatting parameters, see " -"the :ref:`csv-fmt-params` section. To make it as easy as possible to " -"interface with modules which implement the DB API, the value :const:`None` " -"is written as the empty string. While this isn't a reversible " -"transformation, it makes it easier to dump SQL NULL data values to CSV files " -"without preprocessing the data returned from a ``cursor.fetch*`` call. All " -"other non-string data are stringified with :func:`str` before being written." +"object with a :func:`write` method. If *csvfile* is a file object, it " +"should be opened with ``newline=''`` [1]_. An optional *dialect* parameter " +"can be given which is used to define a set of parameters specific to a " +"particular CSV dialect. It may be an instance of a subclass of the :class:" +"`Dialect` class or one of the strings returned by the :func:`list_dialects` " +"function. The other optional *fmtparams* keyword arguments can be given to " +"override individual formatting parameters in the current dialect. For full " +"details about dialects and formatting parameters, see the :ref:`csv-fmt-" +"params` section. To make it as easy as possible to interface with modules " +"which implement the DB API, the value :const:`None` is written as the empty " +"string. While this isn't a reversible transformation, it makes it easier to " +"dump SQL NULL data values to CSV files without preprocessing the data " +"returned from a ``cursor.fetch*`` call. All other non-string data are " +"stringified with :func:`str` before being written." msgstr "" "ユーザが与えたデータをデリミタで区切られた文字列に変換し、与えられたファイル" "オブジェクトに書き込むための writer オブジェクトを返します。 *csvfile* は :" -"meth:`~io.TextIOBase.write` メソッドを持つ任意のオブジェクトです。 *csvfile* " -"がファイルオブジェクトの場合、 ``newline=''`` として開くべきです [1]_ 。オプ" -"ションとして *dialect* 引数を与えることができ、利用するCSV表現形式(dialect)を" -"指定することができます。 *dialect* パラメータは :class:`Dialect` クラスのサブ" -"クラスのインスタンスか、 :func:`list_dialects` 関数が返す文字列の1つにするこ" -"とができます。別のオプション引数である *fmtparams* キーワード引数は、現在の表" -"現形式における個々の書式パラメータを上書きするために与えることができます。" -"dialect と書式パラメータについての詳細は、 :ref:`csv-fmt-params` 節を参照して" -"ください。 DB API を実装するモジュールとのインターフェースを可能な限り容易に" -"するために、 :const:`None` は空文字列として書き込まれます。この処理は可逆な変" -"換ではありませんが、SQL で NULL データ値を CSV にダンプする処理を、 ``cursor." +"func:`write` メソッドを持つ任意のオブジェクトです。 *csvfile* がファイルオブ" +"ジェクトの場合、 ``newline=''`` として開くべきです [1]_ 。オプションとして " +"*dialect* 引数を与えることができ、利用するCSV表現形式(dialect)を指定すること" +"ができます。 *dialect* パラメータは :class:`Dialect` クラスのサブクラスのイン" +"スタンスか、 :func:`list_dialects` 関数が返す文字列の1つにすることができま" +"す。別のオプション引数である *fmtparams* キーワード引数は、現在の表現形式にお" +"ける個々の書式パラメータを上書きするために与えることができます。dialect と書" +"式パラメータについての詳細は、 :ref:`csv-fmt-params` 節を参照してください。 " +"DB API を実装するモジュールとのインターフェースを可能な限り容易にするため" +"に、 :const:`None` は空文字列として書き込まれます。この処理は可逆な変換ではあ" +"りませんが、SQL で NULL データ値を CSV にダンプする処理を、 ``cursor." "fetch*`` 呼び出しによって返されたデータを前処理することなく簡単に行うことがで" "きます。他の非文字列データは、書き出される前に :func:`str` を使って文字列に変" "換されます。" -#: ../../library/csv.rst:108 -msgid "" -"import csv\n" -"with open('eggs.csv', 'w', newline='') as csvfile:\n" -" spamwriter = csv.writer(csvfile, delimiter=' ',\n" -" quotechar='|', quoting=csv.QUOTE_MINIMAL)\n" -" spamwriter.writerow(['Spam'] * 5 + ['Baked Beans'])\n" -" spamwriter.writerow(['Spam', 'Lovely Spam', 'Wonderful Spam'])" -msgstr "" - -#: ../../library/csv.rst:118 +#: ../../library/csv.rst:117 msgid "" "Associate *dialect* with *name*. *name* must be a string. The dialect can " "be specified either by passing a sub-class of :class:`Dialect`, or by " @@ -205,7 +202,7 @@ msgstr "" "す。表現形式と書式化パラメータについての詳細は、 :ref:`csv-fmt-params` 節を参" "照してください。" -#: ../../library/csv.rst:127 +#: ../../library/csv.rst:126 msgid "" "Delete the dialect associated with *name* from the dialect registry. An :" "exc:`Error` is raised if *name* is not a registered dialect name." @@ -213,7 +210,7 @@ msgstr "" "*name* に関連づけられた表現形式を表現形式レジストリから削除します。 *name* が" "表現形式名でない場合には :exc:`Error` を送出します。" -#: ../../library/csv.rst:133 +#: ../../library/csv.rst:132 msgid "" "Return the dialect associated with *name*. An :exc:`Error` is raised if " "*name* is not a registered dialect name. This function returns an " @@ -222,11 +219,11 @@ msgstr "" "*name* に関連づけられた表現形式を返します。 *name* が表現形式名でない場合に" "は :exc:`Error` を送出します。この関数は不変の :class:`Dialect` を返します。" -#: ../../library/csv.rst:139 +#: ../../library/csv.rst:138 msgid "Return the names of all registered dialects." msgstr "登録されている全ての表現形式を返します。" -#: ../../library/csv.rst:144 +#: ../../library/csv.rst:143 msgid "" "Returns the current maximum field size allowed by the parser. If *new_limit* " "is given, this becomes the new limit." @@ -234,31 +231,33 @@ msgstr "" "パーサが許容する現在の最大フィールドサイズを返します。 *new_limit* が渡された" "ときは、その値が新しい上限になります。" -#: ../../library/csv.rst:148 +#: ../../library/csv.rst:147 msgid "The :mod:`csv` module defines the following classes:" msgstr ":mod:`csv` モジュールでは以下のクラスを定義しています:" -#: ../../library/csv.rst:153 +#: ../../library/csv.rst:152 msgid "" "Create an object that operates like a regular reader but maps the " "information in each row to a :class:`dict` whose keys are given by the " "optional *fieldnames* parameter." msgstr "" -"通常の reader のように動作しますが、個々の行の情報を :class:`dict` にマップす" +"通常の reader のように動作しますが、個々の列の情報を :class:`dict` にマップす" "るオブジェクトを生成します。マップのキーは省略可能な *fieldnames* パラメータ" "で与えられます。" -#: ../../library/csv.rst:157 +#: ../../library/csv.rst:156 msgid "" "The *fieldnames* parameter is a :term:`sequence`. If *fieldnames* is " "omitted, the values in the first row of file *f* will be used as the " -"fieldnames and will be omitted from the results. If *fieldnames* is " -"provided, they will be used and the first row will be included in the " -"results. Regardless of how the fieldnames are determined, the dictionary " +"fieldnames. Regardless of how the fieldnames are determined, the dictionary " "preserves their original ordering." msgstr "" +"*fieldnames* パラメータは :term:`sequence` です。 *fieldnames* が省略された場" +"合、ファイル *f* の最初の列の値が fieldnames として使われます。 *fieldnames* " +"がどのように決定されるかに関わらず、辞書はそれらのオリジナルの順番を維持しま" +"す。" -#: ../../library/csv.rst:164 +#: ../../library/csv.rst:161 msgid "" "If a row has more fields than fieldnames, the remaining data is put in a " "list and stored with the fieldname specified by *restkey* (which defaults to " @@ -266,13 +265,13 @@ msgid "" "values are filled-in with the value of *restval* (which defaults to " "``None``)." msgstr "" -"行がフィールド名より多くのフィールドを持っていた場合、残りのデータはリストに" +"列が fieldnames より多くのフィールドを持っていた場合、残りのデータはリストに" "入れられて、 *restkey* により指定されたフィールド名 (デフォルトでは " -"``None``) で保存されます。空白でない行がフィールド名よりも少ないフィールドし" -"か持たない場合、足りない値は *restval* の値 (デフォルトは ``None`` ) によって" +"``None``) で保存されます。非ブランクの列が fieldnames よりも少ないフィールド" +"しか持たない場合、不明の値は *restval* の値 (デフォルトは ``None`` ) によって" "埋められます。" -#: ../../library/csv.rst:170 +#: ../../library/csv.rst:167 msgid "" "All other optional or keyword arguments are passed to the underlying :class:" "`reader` instance." @@ -280,64 +279,41 @@ msgstr "" "その他の省略可能またはキーワード形式のパラメータは、ベースになっている :" "class:`reader` インスタンスに渡されます。" -#: ../../library/csv.rst:173 ../../library/csv.rst:217 -msgid "" -"If the argument passed to *fieldnames* is an iterator, it will be coerced to " -"a :class:`list`." -msgstr "" -"*fieldnames* に渡された引数がイテレータの場合、 :class:`list` に変換されま" -"す。" - -#: ../../library/csv.rst:175 +#: ../../library/csv.rst:170 msgid "Returned rows are now of type :class:`OrderedDict`." -msgstr "返される行の型は :class:`OrderedDict` になりました。" +msgstr "返される列の型は :class:`OrderedDict` になりました。" -#: ../../library/csv.rst:178 +#: ../../library/csv.rst:173 msgid "Returned rows are now of type :class:`dict`." -msgstr "返される行の型は :class:`dict` になりました。" +msgstr "返される列の型は :class:`dict` になりました。" -#: ../../library/csv.rst:183 -msgid "" -">>> import csv\n" -">>> with open('names.csv', newline='') as csvfile:\n" -"... reader = csv.DictReader(csvfile)\n" -"... for row in reader:\n" -"... print(row['first_name'], row['last_name'])\n" -"...\n" -"Eric Idle\n" -"John Cleese\n" -"\n" -">>> print(row)\n" -"{'first_name': 'John', 'last_name': 'Cleese'}" -msgstr "" - -#: ../../library/csv.rst:199 +#: ../../library/csv.rst:194 msgid "" "Create an object which operates like a regular writer but maps dictionaries " "onto output rows. The *fieldnames* parameter is a :mod:`sequence " "` of keys that identify the order in which values in the " -"dictionary passed to the :meth:`~csvwriter.writerow` method are written to " -"file *f*. The optional *restval* parameter specifies the value to be " -"written if the dictionary is missing a key in *fieldnames*. If the " -"dictionary passed to the :meth:`~csvwriter.writerow` method contains a key " -"not found in *fieldnames*, the optional *extrasaction* parameter indicates " -"what action to take. If it is set to ``'raise'``, the default value, a :exc:" -"`ValueError` is raised. If it is set to ``'ignore'``, extra values in the " -"dictionary are ignored. Any other optional or keyword arguments are passed " -"to the underlying :class:`writer` instance." +"dictionary passed to the :meth:`writerow` method are written to file *f*. " +"The optional *restval* parameter specifies the value to be written if the " +"dictionary is missing a key in *fieldnames*. If the dictionary passed to " +"the :meth:`writerow` method contains a key not found in *fieldnames*, the " +"optional *extrasaction* parameter indicates what action to take. If it is " +"set to ``'raise'``, the default value, a :exc:`ValueError` is raised. If it " +"is set to ``'ignore'``, extra values in the dictionary are ignored. Any " +"other optional or keyword arguments are passed to the underlying :class:" +"`writer` instance." msgstr "" "通常の writer のように動作しますが、辞書を出力行にマップするオブジェクトを生" -"成します。 *fieldnames* パラメータは、:meth:`~csvwriter.writerow` メソッドに" -"渡された辞書の値がどのような順番でファイル *f* に書かれるかを指定するキーの :" -"mod:`sequence ` です。 :meth:`~csvwriter.writerow` メソッド" -"に渡された辞書に *fieldnames* には存在しないキーが含まれている場合、オプショ" -"ンの *extrasaction* パラメータによってどんな動作を行うかが指定されます。この" -"値がデフォルト値である ``'raise'`` に設定されている場合、 :exc:`ValueError` " -"が送出されます。 ``'ignore'`` に設定されている場合、辞書の余分な値は無視され" -"ます。その他のパラメータはベースになっている :class:`writer` インスタンスに渡" -"されます。" - -#: ../../library/csv.rst:214 +"成します。 *fieldnames* パラメータは、:meth:`writerow` メソッドに渡された辞書" +"の値がどのような順番でファイル *f* に書かれるかを指定するキーの :mod:" +"`sequence ` です。 :meth:`writerow` メソッドに渡された辞書" +"に *fieldnames* には存在しないキーが含まれている場合、オプションの " +"*extrasaction* パラメータによってどんな動作を行うかが指定されます。この値がデ" +"フォルト値である ``'raise'`` に設定されている場合、 :exc:`ValueError` が送出" +"されます。 ``'ignore'`` に設定されている場合、辞書の余分な値は無視されます。" +"その他のパラメータはベースになっている :class:`writer` インスタンスに渡されま" +"す。" + +#: ../../library/csv.rst:209 msgid "" "Note that unlike the :class:`DictReader` class, the *fieldnames* parameter " "of the :class:`DictWriter` class is not optional." @@ -345,21 +321,7 @@ msgstr "" ":class:`DictReader` クラスとは異なり、 :class:`DictWriter` の *fieldnames* パ" "ラメータは省略可能ではありません。" -#: ../../library/csv.rst:221 -msgid "" -"import csv\n" -"\n" -"with open('names.csv', 'w', newline='') as csvfile:\n" -" fieldnames = ['first_name', 'last_name']\n" -" writer = csv.DictWriter(csvfile, fieldnames=fieldnames)\n" -"\n" -" writer.writeheader()\n" -" writer.writerow({'first_name': 'Baked', 'last_name': 'Beans'})\n" -" writer.writerow({'first_name': 'Lovely', 'last_name': 'Spam'})\n" -" writer.writerow({'first_name': 'Wonderful', 'last_name': 'Spam'})" -msgstr "" - -#: ../../library/csv.rst:235 +#: ../../library/csv.rst:228 msgid "" "The :class:`Dialect` class is a container class whose attributes contain " "information for how to handle doublequotes, whitespace, delimiters, etc. Due " @@ -373,22 +335,14 @@ msgstr "" "す。 :class:`Dialect` クラスのインスタンスは :class:`reader` と :class:" "`writer` のインスタンスの挙動を定義します。" -#: ../../library/csv.rst:241 +#: ../../library/csv.rst:234 msgid "" "All available :class:`Dialect` names are returned by :func:`list_dialects`, " "and they can be registered with specific :class:`reader` and :class:`writer` " "classes through their initializer (``__init__``) functions like this::" msgstr "" -#: ../../library/csv.rst:245 -msgid "" -"import csv\n" -"\n" -"with open('students.csv', 'w', newline='') as csvfile:\n" -" writer = csv.writer(csvfile, dialect='unix')" -msgstr "" - -#: ../../library/csv.rst:253 +#: ../../library/csv.rst:247 msgid "" "The :class:`excel` class defines the usual properties of an Excel-generated " "CSV file. It is registered with the dialect name ``'excel'``." @@ -396,7 +350,7 @@ msgstr "" ":class:`excel` クラスは Excel で生成される CSV ファイルの通常のプロパティを定" "義します。これは ``'excel'`` という名前の dialect として登録されています。" -#: ../../library/csv.rst:259 +#: ../../library/csv.rst:253 msgid "" "The :class:`excel_tab` class defines the usual properties of an Excel-" "generated TAB-delimited file. It is registered with the dialect name " @@ -406,7 +360,7 @@ msgstr "" "ティを定義します。これは ``'excel-tab'`` という名前の dialect として登録され" "ています。" -#: ../../library/csv.rst:265 +#: ../../library/csv.rst:259 msgid "" "The :class:`unix_dialect` class defines the usual properties of a CSV file " "generated on UNIX systems, i.e. using ``'\\n'`` as line terminator and " @@ -417,17 +371,17 @@ msgstr "" "の) を定義します。これは ``'unix'`` という名前の dialect として登録されていま" "す。" -#: ../../library/csv.rst:274 +#: ../../library/csv.rst:268 msgid "The :class:`Sniffer` class is used to deduce the format of a CSV file." msgstr "" ":class:`Sniffer` クラスは CSV ファイルの書式を推理するために用いられるクラス" "です。" -#: ../../library/csv.rst:276 +#: ../../library/csv.rst:270 msgid "The :class:`Sniffer` class provides two methods:" msgstr ":class:`Sniffer` クラスではメソッドを二つ提供しています:" -#: ../../library/csv.rst:280 +#: ../../library/csv.rst:274 msgid "" "Analyze the given *sample* and return a :class:`Dialect` subclass reflecting " "the parameters found. If the optional *delimiters* parameter is given, it " @@ -437,64 +391,29 @@ msgstr "" "`Dialect` サブクラスを返します。オプションの *delimiters* パラメータを与えた" "場合、有効なデリミタ文字を含んでいるはずの文字列として解釈されます。" -#: ../../library/csv.rst:288 +#: ../../library/csv.rst:282 msgid "" "Analyze the sample text (presumed to be in CSV format) and return :const:" -"`True` if the first row appears to be a series of column headers. Inspecting " -"each column, one of two key criteria will be considered to estimate if the " -"sample contains a header:" -msgstr "" - -#: ../../library/csv.rst:293 -msgid "the second through n-th rows contain numeric values" -msgstr "2番目からn番目の行は数値を含みます。" - -#: ../../library/csv.rst:294 -msgid "" -"the second through n-th rows contain strings where at least one value's " -"length differs from that of the putative header of that column." -msgstr "" - -#: ../../library/csv.rst:297 -msgid "" -"Twenty rows after the first row are sampled; if more than half of columns + " -"rows meet the criteria, :const:`True` is returned." +"`True` if the first row appears to be a series of column headers." msgstr "" -"1 行目の後の 20 行がサンプリングされます。半分以上の行 + 列が条件を満たす場" -"合、 :const:`True` が返されます。" +"(CSV 形式と仮定される) サンプルテキストを解析して、最初の行がカラムヘッダの羅" +"列のように推察される場合 :const:`True` を返します。" -#: ../../library/csv.rst:302 -msgid "" -"This method is a rough heuristic and may produce both false positives and " -"negatives." -msgstr "" -"このメソッドは大雑把なヒューリスティックであり、結果が偽陽性や偽陰性である可" -"能性があります。" - -#: ../../library/csv.rst:305 +#: ../../library/csv.rst:285 msgid "An example for :class:`Sniffer` use::" msgstr ":class:`Sniffer` の利用例::" -#: ../../library/csv.rst:307 -msgid "" -"with open('example.csv', newline='') as csvfile:\n" -" dialect = csv.Sniffer().sniff(csvfile.read(1024))\n" -" csvfile.seek(0)\n" -" reader = csv.reader(csvfile, dialect)\n" -" # ... process CSV file contents here ..." -msgstr "" - -#: ../../library/csv.rst:316 +#: ../../library/csv.rst:294 msgid "The :mod:`csv` module defines the following constants:" msgstr ":mod:`csv` モジュールでは以下の定数を定義しています:" -#: ../../library/csv.rst:320 +#: ../../library/csv.rst:298 msgid "Instructs :class:`writer` objects to quote all fields." msgstr "" ":class:`writer` オブジェクトに対し、全てのフィールドをクオートするように指示" "します。" -#: ../../library/csv.rst:325 +#: ../../library/csv.rst:303 msgid "" "Instructs :class:`writer` objects to only quote those fields which contain " "special characters such as *delimiter*, *quotechar* or any of the characters " @@ -504,27 +423,19 @@ msgstr "" "*lineterminator* に含まれる任意の文字のような特別な文字を含むフィールドだけを" "クオートするように指示します。" -#: ../../library/csv.rst:332 +#: ../../library/csv.rst:310 msgid "Instructs :class:`writer` objects to quote all non-numeric fields." msgstr "" ":class:`writer` オブジェクトに対し、全ての非数値フィールドをクオートするよう" "に指示します。" -#: ../../library/csv.rst:334 -msgid "" -"Instructs :class:`reader` objects to convert all non-quoted fields to type :" -"class:`float`." -msgstr "" - -#: ../../library/csv.rst:337 -msgid "" -"Some numeric types, such as :class:`bool`, :class:`~fractions.Fraction`, or :" -"class:`~enum.IntEnum`, have a string representation that cannot be converted " -"to :class:`float`. They cannot be read in the :data:`QUOTE_NONNUMERIC` and :" -"data:`QUOTE_STRINGS` modes." +#: ../../library/csv.rst:312 +msgid "Instructs the reader to convert all non-quoted fields to type *float*." msgstr "" +":class:`reader` に対しては、クオートされていない全てのフィールドを *float* 型" +"に変換するよう指示します。" -#: ../../library/csv.rst:345 +#: ../../library/csv.rst:317 msgid "" "Instructs :class:`writer` objects to never quote fields. When the current " "*delimiter* occurs in output data it is preceded by the current *escapechar* " @@ -536,77 +447,59 @@ msgstr "" "*escapechar* 文字が前に付けられます。 *escapechar* がセットされていない場合、" "エスケープが必要な文字に遭遇した writer は :exc:`Error` を送出します。" -#: ../../library/csv.rst:350 +#: ../../library/csv.rst:322 msgid "" -"Instructs :class:`reader` objects to perform no special processing of quote " +"Instructs :class:`reader` to perform no special processing of quote " "characters." msgstr "" -":class:`reader` オブジェクトに、クオート文字に対する特殊処理を行わないよう指" -"示します。" - -#: ../../library/csv.rst:354 -msgid "" -"Instructs :class:`writer` objects to quote all fields which are not " -"``None``. This is similar to :data:`QUOTE_ALL`, except that if a field " -"value is ``None`` an empty (unquoted) string is written." -msgstr "" - -#: ../../library/csv.rst:358 -msgid "" -"Instructs :class:`reader` objects to interpret an empty (unquoted) field as " -"``None`` and to otherwise behave as :data:`QUOTE_ALL`." -msgstr "" - -#: ../../library/csv.rst:365 -msgid "" -"Instructs :class:`writer` objects to always place quotes around fields which " -"are strings. This is similar to :data:`QUOTE_NONNUMERIC`, except that if a " -"field value is ``None`` an empty (unquoted) string is written." -msgstr "" - -#: ../../library/csv.rst:369 -msgid "" -"Instructs :class:`reader` objects to interpret an empty (unquoted) string as " -"``None`` and to otherwise behave as :data:`QUOTE_NONNUMERIC`." -msgstr "" +":class:`reader` に対しては、クオート文字の特別扱いをしないように指示します。" -#: ../../library/csv.rst:374 +#: ../../library/csv.rst:324 msgid "The :mod:`csv` module defines the following exception:" msgstr ":mod:`csv` モジュールでは以下の例外を定義しています:" -#: ../../library/csv.rst:379 +#: ../../library/csv.rst:329 msgid "Raised by any of the functions when an error is detected." msgstr "全ての関数において、エラーが検出された際に送出される例外です。" -#: ../../library/csv.rst:384 +#: ../../library/csv.rst:334 msgid "Dialects and Formatting Parameters" msgstr "Dialect クラスと書式化パラメータ" -#: ../../library/csv.rst:386 +#: ../../library/csv.rst:336 msgid "" "To make it easier to specify the format of input and output records, " "specific formatting parameters are grouped together into dialects. A " -"dialect is a subclass of the :class:`Dialect` class containing various " -"attributes describing the format of the CSV file. When creating :class:" -"`reader` or :class:`writer` objects, the programmer can specify a string or " -"a subclass of the :class:`Dialect` class as the dialect parameter. In " +"dialect is a subclass of the :class:`Dialect` class having a set of specific " +"methods and a single :meth:`validate` method. When creating :class:`reader` " +"or :class:`writer` objects, the programmer can specify a string or a " +"subclass of the :class:`Dialect` class as the dialect parameter. In " "addition to, or instead of, the *dialect* parameter, the programmer can also " "specify individual formatting parameters, which have the same names as the " "attributes defined below for the :class:`Dialect` class." msgstr "" - -#: ../../library/csv.rst:396 +"レコードに対する入出力形式の指定をより簡単にするために、特定の書式化パラメー" +"タは表現形式 (dialect) にまとめてグループ化されます。表現形式は :class:" +"`Dialect` クラスのサブクラスで、様々なクラス特有のメソッドと、 :meth:" +"`validate` メソッドを一つ持っています。 :class:`reader` または :class:" +"`writer` オブジェクトを生成するとき、プログラマは文字列または :class:" +"`Dialect` クラスのサブクラスを表現形式パラメータとして渡さなければなりませ" +"ん。さらに、 *dialect* パラメータの代りに、プログラマは上で定義されている属性" +"と同じ名前を持つ個々の書式化パラメータを :class:`Dialect` クラスに指定するこ" +"とができます。" + +#: ../../library/csv.rst:346 msgid "Dialects support the following attributes:" msgstr "Dialect は以下の属性をサポートしています:" -#: ../../library/csv.rst:401 +#: ../../library/csv.rst:351 msgid "" "A one-character string used to separate fields. It defaults to ``','``." msgstr "" "フィールド間を分割するのに用いられる 1 文字からなる文字列です。デフォルトで" "は ``','`` です。" -#: ../../library/csv.rst:406 +#: ../../library/csv.rst:356 msgid "" "Controls how instances of *quotechar* appearing inside a field should " "themselves be quoted. When :const:`True`, the character is doubled. When :" @@ -619,7 +512,7 @@ msgstr "" "*escapechar* は *quotechar* の前に置かれます。デフォルトでは :const:`True` で" "す。" -#: ../../library/csv.rst:411 +#: ../../library/csv.rst:361 msgid "" "On output, if *doublequote* is :const:`False` and no *escapechar* is set, :" "exc:`Error` is raised if a *quotechar* is found in a field." @@ -628,7 +521,7 @@ msgstr "" "ていない場合、フィールド内に *quotechar* が現れると :exc:`Error` が送出されま" "す。" -#: ../../library/csv.rst:417 +#: ../../library/csv.rst:367 msgid "" "A one-character string used by the writer to escape the *delimiter* if " "*quoting* is set to :const:`QUOTE_NONE` and the *quotechar* if *doublequote* " @@ -642,11 +535,7 @@ msgstr "" "す。読み込み時には *escapechar* はそれに引き続く文字の特別な意味を取り除きま" "す。デフォルトでは :const:`None` で、エスケープを行ないません。" -#: ../../library/csv.rst:422 -msgid "An empty *escapechar* is not allowed." -msgstr "空の *escapechar* は許可されていません。" - -#: ../../library/csv.rst:427 +#: ../../library/csv.rst:375 msgid "" "The string used to terminate lines produced by the :class:`writer`. It " "defaults to ``'\\r\\n'``." @@ -654,7 +543,7 @@ msgstr "" ":class:`writer` が作り出す各行を終端する際に用いられる文字列です。デフォルト" "では ``'\\r\\n'`` です。" -#: ../../library/csv.rst:432 +#: ../../library/csv.rst:380 msgid "" "The :class:`reader` is hard-coded to recognise either ``'\\r'`` or ``'\\n'`` " "as end-of-line, and ignores *lineterminator*. This behavior may change in " @@ -664,7 +553,7 @@ msgstr "" "にハードコードされており、 *lineterminator* を無視します。この振る舞いは将来" "変更されるかもしれません。" -#: ../../library/csv.rst:439 +#: ../../library/csv.rst:387 msgid "" "A one-character string used to quote fields containing special characters, " "such as the *delimiter* or *quotechar*, or which contain new-line " @@ -674,29 +563,25 @@ msgstr "" "をクオートする際に用いられる 1 文字からなる文字列です。デフォルトでは " "``'\"'`` です。" -#: ../../library/csv.rst:443 -msgid "An empty *quotechar* is not allowed." -msgstr "空の *quotechar* は許可されていません。" - -#: ../../library/csv.rst:448 +#: ../../library/csv.rst:394 msgid "" "Controls when quotes should be generated by the writer and recognised by the " -"reader. It can take on any of the :ref:`QUOTE_\\* constants ` and defaults to :const:`QUOTE_MINIMAL`." +"reader. It can take on any of the :const:`QUOTE_\\*` constants (see " +"section :ref:`csv-contents`) and defaults to :const:`QUOTE_MINIMAL`." msgstr "" "クオートがいつ writer によって生成されるか、また reader によって認識されるか" -"を制御します。:ref:`QUOTE_\\* constants ` のいずれかをとるこ" -"とができ、デフォルトでは :const:`QUOTE_MINIMAL` です。" +"を制御します。 :const:`QUOTE_\\*` 定数のいずれか (:ref:`csv-contents` 節参" +"照) をとることができ、デフォルトでは :const:`QUOTE_MINIMAL` です。" -#: ../../library/csv.rst:455 +#: ../../library/csv.rst:401 msgid "" -"When :const:`True`, spaces immediately following the *delimiter* are " +"When :const:`True`, whitespace immediately following the *delimiter* is " "ignored. The default is :const:`False`." msgstr "" ":const:`True` の場合、 *delimiter* の直後に続く空白は無視されます。デフォルト" "では :const:`False` です。" -#: ../../library/csv.rst:461 +#: ../../library/csv.rst:407 msgid "" "When ``True``, raise exception :exc:`Error` on bad CSV input. The default is " "``False``." @@ -704,11 +589,11 @@ msgstr "" "``True`` の場合、 不正な CSV 入力に対して :exc:`Error` を送出します。デフォル" "トでは ``False`` です。" -#: ../../library/csv.rst:467 +#: ../../library/csv.rst:411 msgid "Reader Objects" msgstr "reader オブジェクト" -#: ../../library/csv.rst:469 +#: ../../library/csv.rst:413 msgid "" "Reader objects (:class:`DictReader` instances and objects returned by the :" "func:`reader` function) have the following public methods:" @@ -716,7 +601,7 @@ msgstr "" "reader オブジェクト(:class:`DictReader` インスタンス、および :func:`reader` " "関数によって返されたオブジェクト) は、以下の public なメソッドを持っています:" -#: ../../library/csv.rst:474 +#: ../../library/csv.rst:418 msgid "" "Return the next row of the reader's iterable object as a list (if the object " "was returned from :func:`reader`) or a dict (if it is a :class:`DictReader` " @@ -728,15 +613,15 @@ msgstr "" "または辞書 ( :class:`DictReader` のインスタンスの場合)として返します。通常" "は ``next(reader)`` のようにして呼び出すことになります。" -#: ../../library/csv.rst:480 +#: ../../library/csv.rst:424 msgid "Reader objects have the following public attributes:" msgstr "reader オブジェクトには以下の公開属性があります:" -#: ../../library/csv.rst:484 +#: ../../library/csv.rst:428 msgid "A read-only description of the dialect in use by the parser." msgstr "パーサで使われる表現形式の読み出し専用の記述です。" -#: ../../library/csv.rst:489 +#: ../../library/csv.rst:433 msgid "" "The number of lines read from the source iterator. This is not the same as " "the number of records returned, as records can span multiple lines." @@ -744,11 +629,11 @@ msgstr "" "ソースイテレータから読んだ行数です。この数は返されるレコードの数とは、レコー" "ドが複数行に亘ることがあるので、一致しません。" -#: ../../library/csv.rst:493 +#: ../../library/csv.rst:437 msgid "DictReader objects have the following public attribute:" msgstr "DictReader オブジェクトは、以下の public な属性を持っています:" -#: ../../library/csv.rst:497 +#: ../../library/csv.rst:441 msgid "" "If not passed as a parameter when creating the object, this attribute is " "initialized upon first access or when the first record is read from the file." @@ -756,31 +641,31 @@ msgstr "" "オブジェクトを生成するときに渡されなかった場合、この属性は最初のアクセス時" "か、ファイルから最初のレコードを読み出したときに初期化されます。" -#: ../../library/csv.rst:504 +#: ../../library/csv.rst:448 msgid "Writer Objects" msgstr "writer オブジェクト" -#: ../../library/csv.rst:506 +#: ../../library/csv.rst:450 msgid "" -":class:`writer` objects (:class:`DictWriter` instances and objects returned " +":class:`Writer` objects (:class:`DictWriter` instances and objects returned " "by the :func:`writer` function) have the following public methods. A *row* " -"must be an iterable of strings or numbers for :class:`writer` objects and a " +"must be an iterable of strings or numbers for :class:`Writer` objects and a " "dictionary mapping fieldnames to strings or numbers (by passing them " "through :func:`str` first) for :class:`DictWriter` objects. Note that " "complex numbers are written out surrounded by parens. This may cause some " "problems for other programs which read CSV files (assuming they support " "complex numbers at all)." msgstr "" -":class:`writer` オブジェクト(:class:`DictWriter` インスタンス、および :func:" +":class:`Writer` オブジェクト(:class:`DictWriter` インスタンス、および :func:" "`writer` 関数によって返されたオブジェクト) は、以下の public なメソッドを持っ" -"ています: *row* には、 :class:`writer` オブジェクトの場合には文字列か数値のイ" +"ています: *row* には、 :class:`Writer` オブジェクトの場合には文字列か数値のイ" "テラブルを指定し、 :class:`DictWriter` オブジェクトの場合はフィールド名をキー" "として対応する文字列か数値を格納した辞書オブジェクトを指定します(数値は :" "func:`str` で変換されます)。複素数を出力する場合、値をかっこで囲んで出力しま" "す。このため、CSV ファイルを読み込むアプリケーションで(そのアプリケーション" "が複素数をサポートしていたとしても)問題が発生する場合があります。" -#: ../../library/csv.rst:517 +#: ../../library/csv.rst:461 msgid "" "Write the *row* parameter to the writer's file object, formatted according " "to the current :class:`Dialect`. Return the return value of the call to the " @@ -790,11 +675,11 @@ msgstr "" "を writer のファイルオブジェクトに書き込みます。ファイルオブジェクトの " "*write* メソッドを呼び出した際の戻り値を返します。" -#: ../../library/csv.rst:521 +#: ../../library/csv.rst:465 msgid "Added support of arbitrary iterables." msgstr "任意のイテラブルのサポートの追加。" -#: ../../library/csv.rst:526 +#: ../../library/csv.rst:470 msgid "" "Write all elements in *rows* (an iterable of *row* objects as described " "above) to the writer's file object, formatted according to the current " @@ -803,26 +688,26 @@ msgstr "" "*rows* 引数 (上で解説した *row* オブジェクトのイテラブル) の全ての要素を現在" "の表現形式に基づいて書式化し、writer のファイルオブジェクトに書き込みます。" -#: ../../library/csv.rst:530 +#: ../../library/csv.rst:474 msgid "Writer objects have the following public attribute:" msgstr "writer オブジェクトには以下の公開属性があります:" -#: ../../library/csv.rst:535 +#: ../../library/csv.rst:479 msgid "A read-only description of the dialect in use by the writer." msgstr "writer で使われる表現形式の読み出し専用の記述です。" -#: ../../library/csv.rst:538 +#: ../../library/csv.rst:482 msgid "DictWriter objects have the following public method:" msgstr "DictWriter のオブジェクトは以下の public メソッドを持っています:" -#: ../../library/csv.rst:543 +#: ../../library/csv.rst:487 msgid "" "Write a row with the field names (as specified in the constructor) to the " "writer's file object, formatted according to the current dialect. Return the " "return value of the :meth:`csvwriter.writerow` call used internally." msgstr "" -#: ../../library/csv.rst:548 +#: ../../library/csv.rst:492 msgid "" ":meth:`writeheader` now also returns the value returned by the :meth:" "`csvwriter.writerow` method it uses internally." @@ -830,70 +715,35 @@ msgstr "" ":meth:`writeheader` は内部的に利用している :meth:`csvwriter.writerow` メソッ" "ドの返り値を返すようになりました。" -#: ../../library/csv.rst:556 +#: ../../library/csv.rst:500 msgid "Examples" msgstr "使用例" -#: ../../library/csv.rst:558 +#: ../../library/csv.rst:502 msgid "The simplest example of reading a CSV file::" msgstr "最も簡単な CSV ファイル読み込みの例です::" -#: ../../library/csv.rst:560 -msgid "" -"import csv\n" -"with open('some.csv', newline='') as f:\n" -" reader = csv.reader(f)\n" -" for row in reader:\n" -" print(row)" -msgstr "" - -#: ../../library/csv.rst:566 +#: ../../library/csv.rst:510 msgid "Reading a file with an alternate format::" msgstr "別の書式での読み込み::" -#: ../../library/csv.rst:568 -msgid "" -"import csv\n" -"with open('passwd', newline='') as f:\n" -" reader = csv.reader(f, delimiter=':', quoting=csv.QUOTE_NONE)\n" -" for row in reader:\n" -" print(row)" -msgstr "" - -#: ../../library/csv.rst:574 +#: ../../library/csv.rst:518 msgid "The corresponding simplest possible writing example is::" msgstr "上に対して、単純な書き込みのプログラム例は以下のようになります。 ::" -#: ../../library/csv.rst:576 -msgid "" -"import csv\n" -"with open('some.csv', 'w', newline='') as f:\n" -" writer = csv.writer(f)\n" -" writer.writerows(someiterable)" -msgstr "" - -#: ../../library/csv.rst:581 +#: ../../library/csv.rst:525 msgid "" "Since :func:`open` is used to open a CSV file for reading, the file will by " "default be decoded into unicode using the system default encoding (see :func:" -"`locale.getencoding`). To decode a file using a different encoding, use the " -"``encoding`` argument of open::" +"`locale.getpreferredencoding`). To decode a file using a different " +"encoding, use the ``encoding`` argument of open::" msgstr "" ":func:`open` が CSV ファイルの読み込みに使われるため、ファイルはデフォルトで" "はシステムのデフォルトエンコーディングでユニコード文字列にデコードされます (:" -"func:`locale.getencoding` を参照)。他のエンコーディングを用いてデコードするに" -"は、open の引数 ``encoding`` を設定して、以下のようにします::" - -#: ../../library/csv.rst:586 -msgid "" -"import csv\n" -"with open('some.csv', newline='', encoding='utf-8') as f:\n" -" reader = csv.reader(f)\n" -" for row in reader:\n" -" print(row)" -msgstr "" +"func:`locale.getpreferredencoding` を参照)。他のエンコーディングを用いてデ" +"コードするには、open の引数 ``encoding`` を設定して、以下のようにします::" -#: ../../library/csv.rst:592 +#: ../../library/csv.rst:536 msgid "" "The same applies to writing in something other than the system default " "encoding: specify the encoding argument when opening the output file." @@ -901,57 +751,29 @@ msgstr "" "システムのデフォルトエンコーディング以外で書き込む場合も同様です。出力ファイ" "ルを開く際に引数 ``encoding`` を明示してください。" -#: ../../library/csv.rst:595 +#: ../../library/csv.rst:539 msgid "Registering a new dialect::" msgstr "新しい表現形式の登録::" -#: ../../library/csv.rst:597 -msgid "" -"import csv\n" -"csv.register_dialect('unixpwd', delimiter=':', quoting=csv.QUOTE_NONE)\n" -"with open('passwd', newline='') as f:\n" -" reader = csv.reader(f, 'unixpwd')" -msgstr "" - -#: ../../library/csv.rst:602 +#: ../../library/csv.rst:546 msgid "" "A slightly more advanced use of the reader --- catching and reporting " "errors::" msgstr "" "もう少し手の込んだ reader の使い方 --- エラーを捉えてレポートします。 ::" -#: ../../library/csv.rst:604 -msgid "" -"import csv, sys\n" -"filename = 'some.csv'\n" -"with open(filename, newline='') as f:\n" -" reader = csv.reader(f)\n" -" try:\n" -" for row in reader:\n" -" print(row)\n" -" except csv.Error as e:\n" -" sys.exit(f'file {filename}, line {reader.line_num}: {e}')" -msgstr "" - -#: ../../library/csv.rst:614 +#: ../../library/csv.rst:558 msgid "" "And while the module doesn't directly support parsing strings, it can easily " "be done::" msgstr "" "このモジュールは文字列の解析は直接サポートしませんが、簡単にできます。 ::" -#: ../../library/csv.rst:617 -msgid "" -"import csv\n" -"for row in csv.reader(['one,two,three']):\n" -" print(row)" -msgstr "" - -#: ../../library/csv.rst:623 +#: ../../library/csv.rst:567 msgid "Footnotes" msgstr "脚注" -#: ../../library/csv.rst:624 +#: ../../library/csv.rst:568 msgid "" "If ``newline=''`` is not specified, newlines embedded inside quoted fields " "will not be interpreted correctly, and on platforms that use ``\\r\\n`` " @@ -964,23 +786,3 @@ msgstr "" "加されてしまいます。csv モジュールは独自 (:term:`universal `) の改行処理を行うため、``newline=''`` を指定することは常に安全で" "す。" - -#: ../../library/csv.rst:11 -msgid "csv" -msgstr "csv" - -#: ../../library/csv.rst:11 -msgid "data" -msgstr "データ" - -#: ../../library/csv.rst:11 -msgid "tabular" -msgstr "表形式" - -#: ../../library/csv.rst:53 -msgid "universal newlines" -msgstr "universal newlines" - -#: ../../library/csv.rst:53 -msgid "csv.reader function" -msgstr "csv.reader 関数" diff --git a/library/ctypes.po b/library/ctypes.po index 02d9ac9d7..23ebedbc5 100644 --- a/library/ctypes.po +++ b/library/ctypes.po @@ -1,40 +1,41 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Arihiro TAKASE, 2023 -# 石井明久, 2024 -# Takanori Suzuki , 2024 -# Nozomu Kaneko , 2025 -# tomo, 2025 +# Ryuichi Takano , 2017 +# Nozomu Kaneko , 2017 +# ごはんですよ , 2017 +# Shun Sakurai, 2017 +# 秘湯 , 2017 +# Arihiro TAKASE, 2017 +# Osamu NAKAMURA, 2017 +# Inada Naoki , 2017 +# tomo, 2020 +# Takanori Suzuki , 2021 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-13 14:21+0000\n" -"PO-Revision-Date: 2021-06-28 01:03+0000\n" -"Last-Translator: tomo, 2025\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-03-02 05:36+0000\n" +"PO-Revision-Date: 2017-02-16 23:05+0000\n" +"Last-Translator: Takanori Suzuki , 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/ctypes.rst:2 -msgid ":mod:`!ctypes` --- A foreign function library for Python" -msgstr ":mod:`!ctypes` --- Python 用の外部関数ライブラリ" +msgid ":mod:`ctypes` --- A foreign function library for Python" +msgstr ":mod:`ctypes` --- Pythonのための外部関数ライブラリ" -#: ../../library/ctypes.rst:9 -msgid "**Source code:** :source:`Lib/ctypes`" -msgstr "**ソースコード:** :source:`Lib/ctypes`" - -#: ../../library/ctypes.rst:13 +#: ../../library/ctypes.rst:11 msgid "" ":mod:`ctypes` is a foreign function library for Python. It provides C " "compatible data types, and allows calling functions in DLLs or shared " @@ -45,21 +46,22 @@ msgstr "" "にします。動的リンク/共有ライブラリを純粋な Python でラップするために使うこと" "ができます。" -#: ../../library/ctypes.rst:21 +#: ../../library/ctypes.rst:19 msgid "ctypes tutorial" -msgstr "ctypes チュートリアル" +msgstr "ctypesチュートリアル" -#: ../../library/ctypes.rst:23 +#: ../../library/ctypes.rst:21 msgid "" "Note: The code samples in this tutorial use :mod:`doctest` to make sure that " "they actually work. Since some code samples behave differently under Linux, " -"Windows, or macOS, they contain doctest directives in comments." +"Windows, or Mac OS X, they contain doctest directives in comments." msgstr "" "注意: このチュートリアルのコードサンプルは動作確認のために :mod:`doctest` を" -"使います。コードサンプルの中には Linux、 Windows、あるいは macOS 上で異なる動" -"作をするものがあるため、サンプルのコメントに doctest 命令を入れてあります。" +"使います。コードサンプルの中には Linux、 Windows、あるいは Mac OS X 上で異な" +"る動作をするものがあるため、サンプルのコメントに doctest 命令を入れてありま" +"す。" -#: ../../library/ctypes.rst:27 +#: ../../library/ctypes.rst:25 msgid "" "Note: Some code samples reference the ctypes :class:`c_int` type. On " "platforms where ``sizeof(long) == sizeof(int)`` it is an alias to :class:" @@ -72,11 +74,11 @@ msgstr "" "るときに :class:`c_long` が表示されたとしても、混乱しないようにしてください " "--- 実際には同じ型なのです。" -#: ../../library/ctypes.rst:35 +#: ../../library/ctypes.rst:33 msgid "Loading dynamic link libraries" msgstr "動的リンクライブラリをロードする" -#: ../../library/ctypes.rst:37 +#: ../../library/ctypes.rst:35 msgid "" ":mod:`ctypes` exports the *cdll*, and on Windows *windll* and *oledll* " "objects, for loading dynamic link libraries." @@ -85,18 +87,25 @@ msgstr "" "トします。 Windows では *windll* と *oledll* オブジェクトをエクスポートしま" "す。" -#: ../../library/ctypes.rst:40 +#: ../../library/ctypes.rst:38 msgid "" "You load libraries by accessing them as attributes of these objects. *cdll* " "loads libraries which export functions using the standard ``cdecl`` calling " "convention, while *windll* libraries call functions using the ``stdcall`` " "calling convention. *oledll* also uses the ``stdcall`` calling convention, " -"and assumes the functions return a Windows :c:type:`!HRESULT` error code. " -"The error code is used to automatically raise an :class:`OSError` exception " -"when the function call fails." +"and assumes the functions return a Windows :c:type:`HRESULT` error code. The " +"error code is used to automatically raise an :class:`OSError` exception when " +"the function call fails." msgstr "" +"これらのオブジェクトの属性としてライブラリにアクセスすることでライブラリを" +"ロードします。 *cdll* は、標準 ``cdecl`` 呼び出し規約を用いて関数をエクスポー" +"トしているライブラリをロードします。それに対して、 *windll* ライブラリは " +"``stdcall`` 呼び出し規約を用いる関数を呼び出します。 *oledll* も ``stdcall`` " +"呼び出し規約を使いますが、関数が Windows :c:type:`HRESULT` エラーコードを返す" +"ことを想定しています。このエラーコードは関数呼び出しが失敗したとき、 :class:" +"`OSError` 例外を自動的に送出させるために使われます。" -#: ../../library/ctypes.rst:48 +#: ../../library/ctypes.rst:46 msgid "" "Windows errors used to raise :exc:`WindowsError`, which is now an alias of :" "exc:`OSError`." @@ -104,29 +113,20 @@ msgstr "" "Windows エラーは以前は :exc:`WindowsError` を送出していましたが、これは現在で" "は :exc:`OSError` の別名になっています。" -#: ../../library/ctypes.rst:53 +#: ../../library/ctypes.rst:51 msgid "" "Here are some examples for Windows. Note that ``msvcrt`` is the MS standard " -"C library containing most standard C functions, and uses the ``cdecl`` " -"calling convention::" -msgstr "" - -#: ../../library/ctypes.rst:57 -msgid "" -">>> from ctypes import *\n" -">>> print(windll.kernel32)\n" -"\n" -">>> print(cdll.msvcrt)\n" -"\n" -">>> libc = cdll.msvcrt\n" -">>>" +"C library containing most standard C functions, and uses the cdecl calling " +"convention::" msgstr "" +"Windows用の例ですが、 ``msvcrt`` はほとんどの標準 C 関数が含まれている MS 標" +"準 C ライブラリであり、 cdecl 呼び出し規約を使うことに注意してください::" -#: ../../library/ctypes.rst:65 +#: ../../library/ctypes.rst:63 msgid "Windows appends the usual ``.dll`` file suffix automatically." msgstr "Windows では通常の ``.dll`` ファイル拡張子を自動的に追加します。" -#: ../../library/ctypes.rst:68 +#: ../../library/ctypes.rst:66 msgid "" "Accessing the standard C library through ``cdll.msvcrt`` will use an " "outdated version of the library that may be incompatible with the one being " @@ -138,68 +138,48 @@ msgstr "" "れます。可能な場合には、ネイティブ Python の機能を使用するか、``msvcrt`` モ" "ジュールをインポートして使用してください。" -#: ../../library/ctypes.rst:73 +#: ../../library/ctypes.rst:71 msgid "" "On Linux, it is required to specify the filename *including* the extension " "to load a library, so attribute access can not be used to load libraries. " -"Either the :meth:`~LibraryLoader.LoadLibrary` method of the dll loaders " -"should be used, or you should load the library by creating an instance of " -"CDLL by calling the constructor::" -msgstr "" - -#: ../../library/ctypes.rst:79 -msgid "" -">>> cdll.LoadLibrary(\"libc.so.6\")\n" -"\n" -">>> libc = CDLL(\"libc.so.6\")\n" -">>> libc\n" -"\n" -">>>" +"Either the :meth:`LoadLibrary` method of the dll loaders should be used, or " +"you should load the library by creating an instance of CDLL by calling the " +"constructor::" msgstr "" +"Linux ではライブラリをロードするために拡張子を *含む* ファイル名を指定する必" +"要があるので、ロードしたライブラリに対する属性アクセスはできません。 dll ロー" +"ダーの :meth:`LoadLibrary` メソッドを使うか、コンストラクタを呼び出して CDLL " +"のインスタンスを作ることでライブラリをロードするかのどちらかを行わなければな" +"りません::" -#: ../../library/ctypes.rst:92 +#: ../../library/ctypes.rst:89 msgid "Accessing functions from loaded dlls" msgstr "ロードしたdllから関数にアクセスする" -#: ../../library/ctypes.rst:94 +#: ../../library/ctypes.rst:91 msgid "Functions are accessed as attributes of dll objects::" msgstr "dll オブジェクトの属性として関数にアクセスします::" -#: ../../library/ctypes.rst:96 -msgid "" -">>> libc.printf\n" -"<_FuncPtr object at 0x...>\n" -">>> print(windll.kernel32.GetModuleHandleA)\n" -"<_FuncPtr object at 0x...>\n" -">>> print(windll.kernel32.MyOwnFunction)\n" -"Traceback (most recent call last):\n" -" File \"\", line 1, in \n" -" File \"ctypes.py\", line 239, in __getattr__\n" -" func = _StdcallFuncPtr(name, self)\n" -"AttributeError: function 'MyOwnFunction' not found\n" -">>>" -msgstr "" - -#: ../../library/ctypes.rst:108 +#: ../../library/ctypes.rst:106 msgid "" "Note that win32 system dlls like ``kernel32`` and ``user32`` often export " "ANSI as well as UNICODE versions of a function. The UNICODE version is " -"exported with a ``W`` appended to the name, while the ANSI version is " +"exported with an ``W`` appended to the name, while the ANSI version is " "exported with an ``A`` appended to the name. The win32 ``GetModuleHandle`` " "function, which returns a *module handle* for a given module name, has the " "following C prototype, and a macro is used to expose one of them as " "``GetModuleHandle`` depending on whether UNICODE is defined or not::" msgstr "" +"``kernel32`` や ``user32`` のような win32 システム dll は、多くの場合関数の " +"UNICODE バージョンに加えて ANSI バージョンもエクスポートすることに注意してく" +"ださい。 UNICODE バージョンは後ろに ``W`` が付いた名前でエクスポートされ、 " +"ANSI バージョンは ``A`` が付いた名前でエクスポートされます。与えられたモ" +"ジュールの *モジュールハンドル* を返す win32 ``GetModuleHandle`` 関数は次のよ" +"うな C プロトタイプを持ちます。 UNICODE バージョンが定義されているかどうかに" +"より ``GetModuleHandle`` としてどちらか一つを公開するためにマクロが使われま" +"す::" -#: ../../library/ctypes.rst:116 -msgid "" -"/* ANSI version */\n" -"HMODULE GetModuleHandleA(LPCSTR lpModuleName);\n" -"/* UNICODE version */\n" -"HMODULE GetModuleHandleW(LPCWSTR lpModuleName);" -msgstr "" - -#: ../../library/ctypes.rst:121 +#: ../../library/ctypes.rst:119 msgid "" "*windll* does not try to select one of them by magic, you must access the " "version you need by specifying ``GetModuleHandleA`` or ``GetModuleHandleW`` " @@ -210,7 +190,7 @@ msgstr "" "るバージョンにアクセスし、バイト列か文字列を使ってそれぞれ呼び出さなければな" "りません。" -#: ../../library/ctypes.rst:125 +#: ../../library/ctypes.rst:123 msgid "" "Sometimes, dlls export functions with names which aren't valid Python " "identifiers, like ``\"??2@YAPAXI@Z\"``. In this case you have to use :func:" @@ -220,14 +200,7 @@ msgstr "" "ない名前でエクスポートすることがあります。このような場合に関数を取り出すに" "は、 :func:`getattr` を使わなければなりません。::" -#: ../../library/ctypes.rst:129 -msgid "" -">>> getattr(cdll.msvcrt, \"??2@YAPAXI@Z\")\n" -"<_FuncPtr object at 0x...>\n" -">>>" -msgstr "" - -#: ../../library/ctypes.rst:133 +#: ../../library/ctypes.rst:131 msgid "" "On Windows, some dlls export functions not by name but by ordinal. These " "functions can be accessed by indexing the dll object with the ordinal " @@ -237,51 +210,31 @@ msgstr "" "こうした関数には序数を使って dll オブジェクトにインデックス指定することでアク" "セスします::" -#: ../../library/ctypes.rst:136 -msgid "" -">>> cdll.kernel32[1]\n" -"<_FuncPtr object at 0x...>\n" -">>> cdll.kernel32[0]\n" -"Traceback (most recent call last):\n" -" File \"\", line 1, in \n" -" File \"ctypes.py\", line 310, in __getitem__\n" -" func = _StdcallFuncPtr(name, self)\n" -"AttributeError: function ordinal 0 not found\n" -">>>" -msgstr "" - -#: ../../library/ctypes.rst:150 +#: ../../library/ctypes.rst:148 msgid "Calling functions" msgstr "関数を呼び出す" -#: ../../library/ctypes.rst:152 +#: ../../library/ctypes.rst:150 msgid "" "You can call these functions like any other Python callable. This example " -"uses the ``rand()`` function, which takes no arguments and returns a pseudo-" -"random integer::" +"uses the ``time()`` function, which returns system time in seconds since the " +"Unix epoch, and the ``GetModuleHandleA()`` function, which returns a win32 " +"module handle." msgstr "" +"これらの関数は他の Python 呼び出し可能オブジェクトと同じように呼び出すことが" +"できます。この例では ``time()`` 関数 (Unixエポックからのシステム時間を秒単位" +"で返す) と、 ``GetModuleHandleA()`` 関数 (win32モジュールハンドルを返す) を使" +"います。" #: ../../library/ctypes.rst:155 msgid "" -">>> print(libc.rand())\n" -"1804289383" -msgstr "" - -#: ../../library/ctypes.rst:158 -msgid "" -"On Windows, you can call the ``GetModuleHandleA()`` function, which returns " -"a win32 module handle (passing ``None`` as single argument to call it with a " -"``NULL`` pointer)::" +"This example calls both functions with a ``NULL`` pointer (``None`` should " +"be used as the ``NULL`` pointer)::" msgstr "" +"この例は両方の関数を ``NULL`` ポインタとともに呼び出します (``None`` を " +"``NULL`` ポインタとして使う必要があります)::" -#: ../../library/ctypes.rst:161 -msgid "" -">>> print(hex(windll.kernel32.GetModuleHandleA(None)))\n" -"0x1d000000\n" -">>>" -msgstr "" - -#: ../../library/ctypes.rst:165 +#: ../../library/ctypes.rst:164 msgid "" ":exc:`ValueError` is raised when you call an ``stdcall`` function with the " "``cdecl`` calling convention, or vice versa::" @@ -289,24 +242,7 @@ msgstr "" "``cdecl`` 呼び出し規約を使って ``stdcall`` 関数を呼び出したときには、 :exc:" "`ValueError` が送出されます。逆の場合も同様です::" -#: ../../library/ctypes.rst:168 -msgid "" -">>> cdll.kernel32.GetModuleHandleA(None)\n" -"Traceback (most recent call last):\n" -" File \"\", line 1, in \n" -"ValueError: Procedure probably called with not enough arguments (4 bytes " -"missing)\n" -">>>\n" -"\n" -">>> windll.msvcrt.printf(b\"spam\")\n" -"Traceback (most recent call last):\n" -" File \"\", line 1, in \n" -"ValueError: Procedure probably called with too many arguments (4 bytes in " -"excess)\n" -">>>" -msgstr "" - -#: ../../library/ctypes.rst:180 +#: ../../library/ctypes.rst:179 msgid "" "To find out the correct calling convention you have to look into the C " "header file or the documentation for the function you want to call." @@ -314,7 +250,7 @@ msgstr "" "正しい呼び出し規約を知るためには、呼び出したい関数についての C ヘッダファイル" "もしくはドキュメントを見なければなりません。" -#: ../../library/ctypes.rst:183 +#: ../../library/ctypes.rst:182 msgid "" "On Windows, :mod:`ctypes` uses win32 structured exception handling to " "prevent crashes from general protection faults when functions are called " @@ -323,16 +259,7 @@ msgstr "" "Windows では、関数が無効な引数とともに呼び出された場合の一般保護例外によるク" "ラッシュを防ぐために、 :mod:`ctypes` は win32 構造化例外処理を使います::" -#: ../../library/ctypes.rst:187 -msgid "" -">>> windll.kernel32.GetModuleHandleA(32)\n" -"Traceback (most recent call last):\n" -" File \"\", line 1, in \n" -"OSError: exception: access violation reading 0x00000020\n" -">>>" -msgstr "" - -#: ../../library/ctypes.rst:193 +#: ../../library/ctypes.rst:192 msgid "" "There are, however, enough ways to crash Python with :mod:`ctypes`, so you " "should be careful anyway. The :mod:`faulthandler` module can be helpful in " @@ -344,18 +271,25 @@ msgstr "" "ジュールが役に立つ場合があります (例えば、誤った C ライブラリ呼び出しによって" "引き起こされたセグメンテーション違反) 。" -#: ../../library/ctypes.rst:198 +#: ../../library/ctypes.rst:197 msgid "" "``None``, integers, bytes objects and (unicode) strings are the only native " "Python objects that can directly be used as parameters in these function " "calls. ``None`` is passed as a C ``NULL`` pointer, bytes objects and strings " -"are passed as pointer to the memory block that contains their data (:c:expr:" -"`char *` or :c:expr:`wchar_t *`). Python integers are passed as the " -"platform's default C :c:expr:`int` type, their value is masked to fit into " +"are passed as pointer to the memory block that contains their data (:c:type:" +"`char *` or :c:type:`wchar_t *`). Python integers are passed as the " +"platforms default C :c:type:`int` type, their value is masked to fit into " "the C type." msgstr "" +"``None`` 、整数、バイト列オブジェクトおよび (Unicode) 文字列だけが、こうした" +"関数呼び出しにおいてパラメータとして直接使えるネイティブの Python オブジェク" +"トです。 ``None`` は C の ``NULL`` ポインタとして渡され、バイト文字列とユニ" +"コード文字列はそのデータを含むメモリブロックへのポインタ (:c:type:`char *` ま" +"たは :c:type:`wchar_t *`) として渡されます。 Python 整数はプラットホームのデ" +"フォルトの C :c:type:`int` 型として渡され、その値は C :c:type:`int` 型に合う" +"ようにマスクされます。" -#: ../../library/ctypes.rst:205 +#: ../../library/ctypes.rst:204 msgid "" "Before we move on calling functions with other parameter types, we have to " "learn more about :mod:`ctypes` data types." @@ -363,279 +297,234 @@ msgstr "" "他のパラメータ型をもつ関数呼び出しに移る前に、 :mod:`ctypes` データ型について" "さらに学ぶ必要があります。" -#: ../../library/ctypes.rst:212 ../../library/ctypes.rst:2414 +#: ../../library/ctypes.rst:211 ../../library/ctypes.rst:2143 msgid "Fundamental data types" msgstr "基本データ型" -#: ../../library/ctypes.rst:214 +#: ../../library/ctypes.rst:213 msgid ":mod:`ctypes` defines a number of primitive C compatible data types:" msgstr "" ":mod:`ctypes` ではいくつもの C 互換のプリミティブなデータ型を定義しています:" -#: ../../library/ctypes.rst:217 ../../library/ctypes.rst:273 +#: ../../library/ctypes.rst:216 msgid "ctypes type" msgstr "ctypes の型" -#: ../../library/ctypes.rst:217 ../../library/ctypes.rst:273 +#: ../../library/ctypes.rst:216 msgid "C type" msgstr "C の型" -#: ../../library/ctypes.rst:217 ../../library/ctypes.rst:273 +#: ../../library/ctypes.rst:216 msgid "Python type" msgstr "Python の型" -#: ../../library/ctypes.rst:219 +#: ../../library/ctypes.rst:218 msgid ":class:`c_bool`" msgstr ":class:`c_bool`" -#: ../../library/ctypes.rst:219 -msgid ":c:expr:`_Bool`" -msgstr "" +#: ../../library/ctypes.rst:218 +msgid ":c:type:`_Bool`" +msgstr ":c:type:`_Bool`" -#: ../../library/ctypes.rst:219 +#: ../../library/ctypes.rst:218 msgid "bool (1)" msgstr "bool (1)" -#: ../../library/ctypes.rst:221 +#: ../../library/ctypes.rst:220 msgid ":class:`c_char`" msgstr ":class:`c_char`" -#: ../../library/ctypes.rst:221 ../../library/ctypes.rst:225 -msgid ":c:expr:`char`" -msgstr ":c:expr:`char`" +#: ../../library/ctypes.rst:220 ../../library/ctypes.rst:224 +msgid ":c:type:`char`" +msgstr ":c:type:`char`" -#: ../../library/ctypes.rst:221 +#: ../../library/ctypes.rst:220 msgid "1-character bytes object" msgstr "1文字のバイト列オブジェクト" -#: ../../library/ctypes.rst:223 +#: ../../library/ctypes.rst:222 msgid ":class:`c_wchar`" msgstr ":class:`c_wchar`" -#: ../../library/ctypes.rst:223 +#: ../../library/ctypes.rst:222 msgid ":c:type:`wchar_t`" msgstr ":c:type:`wchar_t`" -#: ../../library/ctypes.rst:223 +#: ../../library/ctypes.rst:222 msgid "1-character string" msgstr "1文字の文字列" -#: ../../library/ctypes.rst:225 +#: ../../library/ctypes.rst:224 msgid ":class:`c_byte`" msgstr ":class:`c_byte`" -#: ../../library/ctypes.rst:225 ../../library/ctypes.rst:227 -#: ../../library/ctypes.rst:229 ../../library/ctypes.rst:231 -#: ../../library/ctypes.rst:233 ../../library/ctypes.rst:235 -#: ../../library/ctypes.rst:237 ../../library/ctypes.rst:239 -#: ../../library/ctypes.rst:241 ../../library/ctypes.rst:243 -#: ../../library/ctypes.rst:246 ../../library/ctypes.rst:248 -#: ../../library/ctypes.rst:251 +#: ../../library/ctypes.rst:224 ../../library/ctypes.rst:226 +#: ../../library/ctypes.rst:228 ../../library/ctypes.rst:230 +#: ../../library/ctypes.rst:232 ../../library/ctypes.rst:234 +#: ../../library/ctypes.rst:236 ../../library/ctypes.rst:238 +#: ../../library/ctypes.rst:240 ../../library/ctypes.rst:242 +#: ../../library/ctypes.rst:245 ../../library/ctypes.rst:247 msgid "int" msgstr "int" -#: ../../library/ctypes.rst:227 +#: ../../library/ctypes.rst:226 msgid ":class:`c_ubyte`" msgstr ":class:`c_ubyte`" -#: ../../library/ctypes.rst:227 -msgid ":c:expr:`unsigned char`" -msgstr ":c:expr:`unsigned char`" +#: ../../library/ctypes.rst:226 +msgid ":c:type:`unsigned char`" +msgstr ":c:type:`unsigned char`" -#: ../../library/ctypes.rst:229 +#: ../../library/ctypes.rst:228 msgid ":class:`c_short`" msgstr ":class:`c_short`" -#: ../../library/ctypes.rst:229 -msgid ":c:expr:`short`" -msgstr ":c:expr:`short`" +#: ../../library/ctypes.rst:228 +msgid ":c:type:`short`" +msgstr ":c:type:`short`" -#: ../../library/ctypes.rst:231 +#: ../../library/ctypes.rst:230 msgid ":class:`c_ushort`" msgstr ":class:`c_ushort`" -#: ../../library/ctypes.rst:231 -msgid ":c:expr:`unsigned short`" -msgstr ":c:expr:`unsigned short`" +#: ../../library/ctypes.rst:230 +msgid ":c:type:`unsigned short`" +msgstr ":c:type:`unsigned short`" -#: ../../library/ctypes.rst:233 +#: ../../library/ctypes.rst:232 msgid ":class:`c_int`" msgstr ":class:`c_int`" -#: ../../library/ctypes.rst:233 -msgid ":c:expr:`int`" -msgstr ":c:expr:`int`" +#: ../../library/ctypes.rst:232 +msgid ":c:type:`int`" +msgstr ":c:type:`int`" -#: ../../library/ctypes.rst:235 +#: ../../library/ctypes.rst:234 msgid ":class:`c_uint`" msgstr ":class:`c_uint`" -#: ../../library/ctypes.rst:235 -msgid ":c:expr:`unsigned int`" -msgstr ":c:expr:`unsigned int`" +#: ../../library/ctypes.rst:234 +msgid ":c:type:`unsigned int`" +msgstr ":c:type:`unsigned int`" -#: ../../library/ctypes.rst:237 +#: ../../library/ctypes.rst:236 msgid ":class:`c_long`" msgstr ":class:`c_long`" -#: ../../library/ctypes.rst:237 -msgid ":c:expr:`long`" -msgstr ":c:expr:`long`" +#: ../../library/ctypes.rst:236 +msgid ":c:type:`long`" +msgstr ":c:type:`long`" -#: ../../library/ctypes.rst:239 +#: ../../library/ctypes.rst:238 msgid ":class:`c_ulong`" msgstr ":class:`c_ulong`" -#: ../../library/ctypes.rst:239 -msgid ":c:expr:`unsigned long`" -msgstr ":c:expr:`unsigned long`" +#: ../../library/ctypes.rst:238 +msgid ":c:type:`unsigned long`" +msgstr ":c:type:`unsigned long`" -#: ../../library/ctypes.rst:241 +#: ../../library/ctypes.rst:240 msgid ":class:`c_longlong`" msgstr ":class:`c_longlong`" -#: ../../library/ctypes.rst:241 -msgid ":c:expr:`__int64` or :c:expr:`long long`" -msgstr ":c:expr:`__int64` または :c:expr:`long long`" +#: ../../library/ctypes.rst:240 +msgid ":c:type:`__int64` or :c:type:`long long`" +msgstr ":c:type:`__int64` または :c:type:`long long`" -#: ../../library/ctypes.rst:243 +#: ../../library/ctypes.rst:242 msgid ":class:`c_ulonglong`" msgstr ":class:`c_ulonglong`" -#: ../../library/ctypes.rst:243 -msgid ":c:expr:`unsigned __int64` or :c:expr:`unsigned long long`" -msgstr ":c:expr:`unsigned __int64` または :c:expr:`unsigned long long`" +#: ../../library/ctypes.rst:242 +msgid ":c:type:`unsigned __int64` or :c:type:`unsigned long long`" +msgstr ":c:type:`unsigned __int64` または :c:type:`unsigned long long`" -#: ../../library/ctypes.rst:246 +#: ../../library/ctypes.rst:245 msgid ":class:`c_size_t`" msgstr ":class:`c_size_t`" -#: ../../library/ctypes.rst:246 +#: ../../library/ctypes.rst:245 msgid ":c:type:`size_t`" msgstr ":c:type:`size_t`" -#: ../../library/ctypes.rst:248 +#: ../../library/ctypes.rst:247 msgid ":class:`c_ssize_t`" msgstr ":class:`c_ssize_t`" -#: ../../library/ctypes.rst:248 -msgid ":c:type:`ssize_t` or :c:expr:`Py_ssize_t`" -msgstr "" - -#: ../../library/ctypes.rst:251 -msgid ":class:`c_time_t`" -msgstr "" +#: ../../library/ctypes.rst:247 +msgid ":c:type:`ssize_t` or :c:type:`Py_ssize_t`" +msgstr ":c:type:`ssize_t` または :c:type:`Py_ssize_t`" -#: ../../library/ctypes.rst:251 -msgid ":c:type:`time_t`" -msgstr "" - -#: ../../library/ctypes.rst:253 +#: ../../library/ctypes.rst:250 msgid ":class:`c_float`" msgstr ":class:`c_float`" -#: ../../library/ctypes.rst:253 -msgid ":c:expr:`float`" -msgstr ":c:expr:`float`" +#: ../../library/ctypes.rst:250 +msgid ":c:type:`float`" +msgstr ":c:type:`float`" -#: ../../library/ctypes.rst:253 ../../library/ctypes.rst:255 -#: ../../library/ctypes.rst:257 +#: ../../library/ctypes.rst:250 ../../library/ctypes.rst:252 +#: ../../library/ctypes.rst:254 msgid "float" msgstr "浮動小数点数" -#: ../../library/ctypes.rst:255 +#: ../../library/ctypes.rst:252 msgid ":class:`c_double`" msgstr ":class:`c_double`" -#: ../../library/ctypes.rst:255 -msgid ":c:expr:`double`" -msgstr ":c:expr:`double`" +#: ../../library/ctypes.rst:252 +msgid ":c:type:`double`" +msgstr ":c:type:`double`" -#: ../../library/ctypes.rst:257 +#: ../../library/ctypes.rst:254 msgid ":class:`c_longdouble`" msgstr ":class:`c_longdouble`" -#: ../../library/ctypes.rst:257 -msgid ":c:expr:`long double`" -msgstr ":c:expr:`long double`" +#: ../../library/ctypes.rst:254 +msgid ":c:type:`long double`" +msgstr ":c:type:`long double`" -#: ../../library/ctypes.rst:259 +#: ../../library/ctypes.rst:256 msgid ":class:`c_char_p`" msgstr ":class:`c_char_p`" -#: ../../library/ctypes.rst:259 -msgid ":c:expr:`char *` (NUL terminated)" -msgstr ":c:expr:`char *` (NUL 終端)" +#: ../../library/ctypes.rst:256 +msgid ":c:type:`char *` (NUL terminated)" +msgstr ":c:type:`char *` (NUL 終端)" -#: ../../library/ctypes.rst:259 +#: ../../library/ctypes.rst:256 msgid "bytes object or ``None``" msgstr "バイト列オブジェクトまたは ``None``" -#: ../../library/ctypes.rst:261 +#: ../../library/ctypes.rst:258 msgid ":class:`c_wchar_p`" msgstr ":class:`c_wchar_p`" -#: ../../library/ctypes.rst:261 -msgid ":c:expr:`wchar_t *` (NUL terminated)" -msgstr ":c:expr:`wchar_t *` (NUL 終端)" +#: ../../library/ctypes.rst:258 +msgid ":c:type:`wchar_t *` (NUL terminated)" +msgstr ":c:type:`wchar_t *` (NUL 終端)" -#: ../../library/ctypes.rst:261 +#: ../../library/ctypes.rst:258 msgid "string or ``None``" msgstr "文字列または ``None``" -#: ../../library/ctypes.rst:263 +#: ../../library/ctypes.rst:260 msgid ":class:`c_void_p`" msgstr ":class:`c_void_p`" -#: ../../library/ctypes.rst:263 -msgid ":c:expr:`void *`" -msgstr ":c:expr:`void *`" +#: ../../library/ctypes.rst:260 +msgid ":c:type:`void *`" +msgstr ":c:type:`void *`" -#: ../../library/ctypes.rst:263 +#: ../../library/ctypes.rst:260 msgid "int or ``None``" msgstr "整数または ``None``" -#: ../../library/ctypes.rst:267 +#: ../../library/ctypes.rst:264 msgid "The constructor accepts any object with a truth value." msgstr "コンストラクタは任意のオブジェクトをその真偽値として受け取ります。" -#: ../../library/ctypes.rst:269 -msgid "" -"Additionally, if IEC 60559 compatible complex arithmetic (Annex G) is " -"supported in both C and ``libffi``, the following complex types are " -"available:" -msgstr "" - -#: ../../library/ctypes.rst:275 -msgid ":class:`c_float_complex`" -msgstr "" - -#: ../../library/ctypes.rst:275 -msgid ":c:expr:`float complex`" -msgstr "" - -#: ../../library/ctypes.rst:275 ../../library/ctypes.rst:277 -#: ../../library/ctypes.rst:279 -msgid "complex" -msgstr "複素数" - -#: ../../library/ctypes.rst:277 -msgid ":class:`c_double_complex`" -msgstr "" - -#: ../../library/ctypes.rst:277 -msgid ":c:expr:`double complex`" -msgstr "" - -#: ../../library/ctypes.rst:279 -msgid ":class:`c_longdouble_complex`" -msgstr "" - -#: ../../library/ctypes.rst:279 -msgid ":c:expr:`long double complex`" -msgstr "" - -#: ../../library/ctypes.rst:283 +#: ../../library/ctypes.rst:266 msgid "" "All these types can be created by calling them with an optional initializer " "of the correct type and value::" @@ -643,62 +532,24 @@ msgstr "" "これら全ての型はその型を呼び出すことによって作成でき、オプションとして型と値" "が合っている初期化子を指定することができます::" -#: ../../library/ctypes.rst:286 -msgid "" -">>> c_int()\n" -"c_long(0)\n" -">>> c_wchar_p(\"Hello, World\")\n" -"c_wchar_p(140018365411392)\n" -">>> c_ushort(-3)\n" -"c_ushort(65533)\n" -">>>" -msgstr "" - -#: ../../library/ctypes.rst:294 +#: ../../library/ctypes.rst:277 msgid "" "Since these types are mutable, their value can also be changed afterwards::" msgstr "これらの型は変更可能であり、値を後で変更することもできます::" -#: ../../library/ctypes.rst:296 -msgid "" -">>> i = c_int(42)\n" -">>> print(i)\n" -"c_long(42)\n" -">>> print(i.value)\n" -"42\n" -">>> i.value = -99\n" -">>> print(i.value)\n" -"-99\n" -">>>" -msgstr "" - -#: ../../library/ctypes.rst:306 +#: ../../library/ctypes.rst:289 msgid "" "Assigning a new value to instances of the pointer types :class:`c_char_p`, :" "class:`c_wchar_p`, and :class:`c_void_p` changes the *memory location* they " "point to, *not the contents* of the memory block (of course not, because " -"Python string objects are immutable)::" -msgstr "" - -#: ../../library/ctypes.rst:311 -msgid "" -">>> s = \"Hello, World\"\n" -">>> c_s = c_wchar_p(s)\n" -">>> print(c_s)\n" -"c_wchar_p(139966785747344)\n" -">>> print(c_s.value)\n" -"Hello World\n" -">>> c_s.value = \"Hi, there\"\n" -">>> print(c_s) # the memory location has changed\n" -"c_wchar_p(139966783348904)\n" -">>> print(c_s.value)\n" -"Hi, there\n" -">>> print(s) # first object is unchanged\n" -"Hello, World\n" -">>>" +"Python bytes objects are immutable)::" msgstr "" +"新しい値をポインタ型 :class:`c_char_p`, :class:`c_wchar_p` および :class:" +"`c_void_p` のインスタンスへ代入すると、変わるのは指している *メモリ位置* で" +"あって、メモリブロックの *内容ではありません* (これは当然で、なぜなら、 " +"Python バイト列オブジェクトは変更不可能だからです)::" -#: ../../library/ctypes.rst:326 +#: ../../library/ctypes.rst:309 msgid "" "You should be careful, however, not to pass them to functions expecting " "pointers to mutable memory. If you need mutable memory blocks, ctypes has a :" @@ -716,39 +567,23 @@ msgstr "" #: ../../library/ctypes.rst:333 msgid "" -">>> from ctypes import *\n" -">>> p = create_string_buffer(3) # create a 3 byte buffer, " -"initialized to NUL bytes\n" -">>> print(sizeof(p), repr(p.raw))\n" -"3 b'\\x00\\x00\\x00'\n" -">>> p = create_string_buffer(b\"Hello\") # create a buffer containing a " -"NUL terminated string\n" -">>> print(sizeof(p), repr(p.raw))\n" -"6 b'Hello\\x00'\n" -">>> print(repr(p.value))\n" -"b'Hello'\n" -">>> p = create_string_buffer(b\"Hello\", 10) # create a 10 byte buffer\n" -">>> print(sizeof(p), repr(p.raw))\n" -"10 b'Hello\\x00\\x00\\x00\\x00\\x00'\n" -">>> p.value = b\"Hi\"\n" -">>> print(sizeof(p), repr(p.raw))\n" -"10 b'Hi\\x00lo\\x00\\x00\\x00\\x00\\x00'\n" -">>>" -msgstr "" - -#: ../../library/ctypes.rst:350 -msgid "" -"The :func:`create_string_buffer` function replaces the old :func:`!c_buffer` " -"function (which is still available as an alias). To create a mutable memory " -"block containing unicode characters of the C type :c:type:`wchar_t`, use " -"the :func:`create_unicode_buffer` function." -msgstr "" - -#: ../../library/ctypes.rst:359 +"The :func:`create_string_buffer` function replaces the :func:`c_buffer` " +"function (which is still available as an alias), as well as the :func:" +"`c_string` function from earlier ctypes releases. To create a mutable " +"memory block containing unicode characters of the C type :c:type:`wchar_t` " +"use the :func:`create_unicode_buffer` function." +msgstr "" +":func:`create_string_buffer` 関数は初期の ctypes リリースにあった :func:" +"`c_string` 関数だけでなく、 (エイリアスとしてはまだ利用できる) :func:" +"`c_buffer` 関数をも置き換えるものです。 C の型 :c:type:`wchar_t` の Unicode " +"文字を含む変更可能なメモリブロックを作成するには、 :func:" +"`create_unicode_buffer` 関数を使ってください。" + +#: ../../library/ctypes.rst:343 msgid "Calling functions, continued" msgstr "続・関数を呼び出す" -#: ../../library/ctypes.rst:361 +#: ../../library/ctypes.rst:345 msgid "" "Note that printf prints to the real standard output channel, *not* to :data:" "`sys.stdout`, so these examples will only work at the console prompt, not " @@ -760,26 +595,6 @@ msgstr "" #: ../../library/ctypes.rst:365 msgid "" -">>> printf = libc.printf\n" -">>> printf(b\"Hello, %s\\n\", b\"World!\")\n" -"Hello, World!\n" -"14\n" -">>> printf(b\"Hello, %S\\n\", \"World!\")\n" -"Hello, World!\n" -"14\n" -">>> printf(b\"%d bottles of beer\\n\", 42)\n" -"42 bottles of beer\n" -"19\n" -">>> printf(b\"%f bottles of beer\\n\", 42.5)\n" -"Traceback (most recent call last):\n" -" File \"\", line 1, in \n" -"ctypes.ArgumentError: argument 2: TypeError: Don't know how to convert " -"parameter 2\n" -">>>" -msgstr "" - -#: ../../library/ctypes.rst:381 -msgid "" "As has been mentioned before, all Python types except integers, strings, and " "bytes objects have to be wrapped in their corresponding :mod:`ctypes` type, " "so that they can be converted to the required C data type::" @@ -788,105 +603,57 @@ msgstr "" "字列およびバイト列オブジェクトを除くすべての Python 型を対応する :mod:" "`ctypes` 型でラップしなければなりません::" -#: ../../library/ctypes.rst:385 -msgid "" -">>> printf(b\"An int %d, a double %f\\n\", 1234, c_double(3.14))\n" -"An int 1234, a double 3.140000\n" -"31\n" -">>>" -msgstr "" - -#: ../../library/ctypes.rst:393 -msgid "Calling variadic functions" -msgstr "" - -#: ../../library/ctypes.rst:395 -msgid "" -"On a lot of platforms calling variadic functions through ctypes is exactly " -"the same as calling functions with a fixed number of parameters. On some " -"platforms, and in particular ARM64 for Apple Platforms, the calling " -"convention for variadic functions is different than that for regular " -"functions." -msgstr "" - -#: ../../library/ctypes.rst:400 -msgid "" -"On those platforms it is required to specify the :attr:`~_CFuncPtr.argtypes` " -"attribute for the regular, non-variadic, function arguments:" -msgstr "" - -#: ../../library/ctypes.rst:403 -msgid "libc.printf.argtypes = [ctypes.c_char_p]" -msgstr "" - -#: ../../library/ctypes.rst:407 -msgid "" -"Because specifying the attribute does not inhibit portability it is advised " -"to always specify :attr:`~_CFuncPtr.argtypes` for all variadic functions." -msgstr "" - -#: ../../library/ctypes.rst:414 +#: ../../library/ctypes.rst:378 msgid "Calling functions with your own custom data types" msgstr "自作のデータ型とともに関数を呼び出す" -#: ../../library/ctypes.rst:416 +#: ../../library/ctypes.rst:380 msgid "" "You can also customize :mod:`ctypes` argument conversion to allow instances " -"of your own classes be used as function arguments. :mod:`ctypes` looks for " -"an :attr:`!_as_parameter_` attribute and uses this as the function argument. " -"The attribute must be an integer, string, bytes, a :mod:`ctypes` instance, " -"or an object with an :attr:`!_as_parameter_` attribute::" +"of your own classes be used as function arguments. :mod:`ctypes` looks for " +"an :attr:`_as_parameter_` attribute and uses this as the function argument. " +"Of course, it must be one of integer, string, or bytes::" msgstr "" +"自作のクラスのインスタンスを関数引数として使えるように、 :mod:`ctypes` 引数変" +"換をカスタマイズすることもできます。 :mod:`ctypes` は :attr:`_as_parameter_` " +"属性を探し出し、関数引数として使います。もちろん、整数、文字列もしくはバイト" +"列オブジェクトの中の一つでなければなりません::" -#: ../../library/ctypes.rst:422 -msgid "" -">>> class Bottles:\n" -"... def __init__(self, number):\n" -"... self._as_parameter_ = number\n" -"...\n" -">>> bottles = Bottles(42)\n" -">>> printf(b\"%d bottles of beer\\n\", bottles)\n" -"42 bottles of beer\n" -"19\n" -">>>" -msgstr "" - -#: ../../library/ctypes.rst:432 +#: ../../library/ctypes.rst:395 msgid "" -"If you don't want to store the instance's data in the :attr:`!" -"_as_parameter_` instance variable, you could define a :class:`property` " -"which makes the attribute available on request." +"If you don't want to store the instance's data in the :attr:`_as_parameter_` " +"instance variable, you could define a :class:`property` which makes the " +"attribute available on request." msgstr "" +":attr:`_as_parameter_` インスタンス変数にインスタンスのデータを保持したくない" +"場合は、必要に応じて利用できる属性を作る :class:`property` を定義しても構いま" +"せん。" -#: ../../library/ctypes.rst:440 +#: ../../library/ctypes.rst:403 msgid "Specifying the required argument types (function prototypes)" msgstr "要求される引数の型を指定する (関数プロトタイプ)" -#: ../../library/ctypes.rst:442 +#: ../../library/ctypes.rst:405 msgid "" "It is possible to specify the required argument types of functions exported " -"from DLLs by setting the :attr:`~_CFuncPtr.argtypes` attribute." +"from DLLs by setting the :attr:`argtypes` attribute." msgstr "" +":attr:`argtypes` 属性を設定することによって、 DLL からエクスポートされている" +"関数に要求される引数の型を指定することができます。" -#: ../../library/ctypes.rst:445 -msgid "" -":attr:`~_CFuncPtr.argtypes` must be a sequence of C data types (the :func:`!" -"printf` function is probably not a good example here, because it takes a " -"variable number and different types of parameters depending on the format " -"string, on the other hand this is quite handy to experiment with this " -"feature)::" -msgstr "" - -#: ../../library/ctypes.rst:450 +#: ../../library/ctypes.rst:408 msgid "" -">>> printf.argtypes = [c_char_p, c_char_p, c_int, c_double]\n" -">>> printf(b\"String '%s', Int %d, Double %f\\n\", b\"Hi\", 10, 2.2)\n" -"String 'Hi', Int 10, Double 2.200000\n" -"37\n" -">>>" +":attr:`argtypes` must be a sequence of C data types (the ``printf`` function " +"is probably not a good example here, because it takes a variable number and " +"different types of parameters depending on the format string, on the other " +"hand this is quite handy to experiment with this feature)::" msgstr "" +":attr:`argtypes` は C データ型のシーケンスでなければなりません (この場合 " +"``printf`` 関数はおそらく良い例ではありません。なぜなら、引数の数が可変であ" +"り、フォーマット文字列に依存した異なる型のパラメータを取るからです。一方で" +"は、この機能の実験にはとても便利です)。::" -#: ../../library/ctypes.rst:456 +#: ../../library/ctypes.rst:419 msgid "" "Specifying a format protects against incompatible argument types (just as a " "prototype for a C function), and tries to convert the arguments to valid " @@ -895,149 +662,75 @@ msgstr "" "(C の関数のプロトタイプのように) 書式を指定すると互換性のない引数型になるのを" "防ぎ、引数を有効な型へ変換しようとします。::" -#: ../../library/ctypes.rst:459 -msgid "" -">>> printf(b\"%d %d %d\", 1, 2, 3)\n" -"Traceback (most recent call last):\n" -" File \"\", line 1, in \n" -"ctypes.ArgumentError: argument 2: TypeError: 'int' object cannot be " -"interpreted as ctypes.c_char_p\n" -">>> printf(b\"%s %d %f\\n\", b\"X\", 2, 3)\n" -"X 2 3.000000\n" -"13\n" -">>>" -msgstr "" - -#: ../../library/ctypes.rst:468 +#: ../../library/ctypes.rst:431 msgid "" "If you have defined your own classes which you pass to function calls, you " -"have to implement a :meth:`~_CData.from_param` class method for them to be " -"able to use them in the :attr:`~_CFuncPtr.argtypes` sequence. The :meth:" -"`~_CData.from_param` class method receives the Python object passed to the " -"function call, it should do a typecheck or whatever is needed to make sure " -"this object is acceptable, and then return the object itself, its :attr:`!" -"_as_parameter_` attribute, or whatever you want to pass as the C function " -"argument in this case. Again, the result should be an integer, string, " -"bytes, a :mod:`ctypes` instance, or an object with an :attr:`!" -"_as_parameter_` attribute." -msgstr "" +"have to implement a :meth:`from_param` class method for them to be able to " +"use them in the :attr:`argtypes` sequence. The :meth:`from_param` class " +"method receives the Python object passed to the function call, it should do " +"a typecheck or whatever is needed to make sure this object is acceptable, " +"and then return the object itself, its :attr:`_as_parameter_` attribute, or " +"whatever you want to pass as the C function argument in this case. Again, " +"the result should be an integer, string, bytes, a :mod:`ctypes` instance, or " +"an object with an :attr:`_as_parameter_` attribute." +msgstr "" +"関数呼び出しへ渡す自作のクラスを定義した場合には、 :attr:`argtypes` シーケン" +"スの中で使えるようにするために、そのクラスに :meth:`from_param` クラスメソッ" +"ドを実装しなければなりません。 :meth:`from_param` クラスメソッドは関数呼び出" +"しへ渡された Python オブジェクトを受け取り、型チェックもしくはこのオブジェク" +"トが受け入れ可能であると確かめるために必要なことはすべて行ってから、オブジェ" +"クト自身、 :attr:`_as_parameter_` 属性、あるいは、この場合に C 関数引数として" +"渡したい何かの値を返さなければなりません。繰り返しになりますが、その返される" +"結果は整数、文字列、バイト列、 :mod:`ctypes` インスタンス、あるいは :attr:" +"`_as_parameter_` 属性をもつオブジェクトであるべきです。" -#: ../../library/ctypes.rst:482 +#: ../../library/ctypes.rst:445 msgid "Return types" msgstr "戻り値の型" -#: ../../library/ctypes.rst:492 -msgid "" -"By default functions are assumed to return the C :c:expr:`int` type. Other " -"return types can be specified by setting the :attr:`~_CFuncPtr.restype` " -"attribute of the function object." -msgstr "" - -#: ../../library/ctypes.rst:496 +#: ../../library/ctypes.rst:447 msgid "" -"The C prototype of :c:func:`time` is ``time_t time(time_t *)``. Because :c:" -"type:`time_t` might be of a different type than the default return type :c:" -"expr:`int`, you should specify the :attr:`!restype` attribute::" +"By default functions are assumed to return the C :c:type:`int` type. Other " +"return types can be specified by setting the :attr:`restype` attribute of " +"the function object." msgstr "" +"デフォルトでは、関数は C :c:type:`int` を返すと仮定されます。他の戻り値の型を" +"指定するには、関数オブジェクトの :attr:`restype` 属性に設定します。" -#: ../../library/ctypes.rst:500 -msgid ">>> libc.time.restype = c_time_t" -msgstr "" - -#: ../../library/ctypes.rst:502 -msgid "The argument types can be specified using :attr:`~_CFuncPtr.argtypes`::" -msgstr "" - -#: ../../library/ctypes.rst:504 -msgid ">>> libc.time.argtypes = (POINTER(c_time_t),)" -msgstr "" - -#: ../../library/ctypes.rst:506 +#: ../../library/ctypes.rst:451 msgid "" -"To call the function with a ``NULL`` pointer as first argument, use " -"``None``::" -msgstr "" - -#: ../../library/ctypes.rst:508 -msgid "" -">>> print(libc.time(None))\n" -"1150640792" -msgstr "" - -#: ../../library/ctypes.rst:511 -msgid "" -"Here is a more advanced example, it uses the :func:`!strchr` function, which " +"Here is a more advanced example, it uses the ``strchr`` function, which " "expects a string pointer and a char, and returns a pointer to a string::" msgstr "" +"さらに高度な例として、 ``strchr`` 関数を使います。この関数は文字列ポインタと " +"char を受け取り、文字列へのポインタを返します。::" -#: ../../library/ctypes.rst:514 +#: ../../library/ctypes.rst:464 msgid "" -">>> strchr = libc.strchr\n" -">>> strchr(b\"abcdef\", ord(\"d\"))\n" -"8059983\n" -">>> strchr.restype = c_char_p # c_char_p is a pointer to a string\n" -">>> strchr(b\"abcdef\", ord(\"d\"))\n" -"b'def'\n" -">>> print(strchr(b\"abcdef\", ord(\"x\")))\n" -"None\n" -">>>" +"If you want to avoid the ``ord(\"x\")`` calls above, you can set the :attr:" +"`argtypes` attribute, and the second argument will be converted from a " +"single character Python bytes object into a C char::" msgstr "" +"上の ``ord(\"x\")`` 呼び出しを避けたいなら、 :attr:`argtypes` 属性を設定する" +"ことができます。二番目の引数が一文字の Python バイト列オブジェクトから C の " +"char へ変換されます::" -#: ../../library/ctypes.rst:524 -msgid "" -"If you want to avoid the :func:`ord(\"x\") ` calls above, you can set " -"the :attr:`~_CFuncPtr.argtypes` attribute, and the second argument will be " -"converted from a single character Python bytes object into a C char:" -msgstr "" - -#: ../../library/ctypes.rst:528 +#: ../../library/ctypes.rst:482 msgid "" -">>> strchr.restype = c_char_p\n" -">>> strchr.argtypes = [c_char_p, c_char]\n" -">>> strchr(b\"abcdef\", b\"d\")\n" -"b'def'\n" -">>> strchr(b\"abcdef\", b\"def\")\n" -"Traceback (most recent call last):\n" -"ctypes.ArgumentError: argument 2: TypeError: one character bytes, bytearray " -"or integer expected\n" -">>> print(strchr(b\"abcdef\", b\"x\"))\n" -"None\n" -">>> strchr(b\"abcdef\", b\"d\")\n" -"b'def'\n" -">>>" +"You can also use a callable Python object (a function or a class for " +"example) as the :attr:`restype` attribute, if the foreign function returns " +"an integer. The callable will be called with the *integer* the C function " +"returns, and the result of this call will be used as the result of your " +"function call. This is useful to check for error return values and " +"automatically raise an exception::" msgstr "" +"外部関数が整数を返す場合は、 :attr:`restype` 属性として呼び出し可能な Python " +"オブジェクト (例えば、関数またはクラス) を使うこともできます。呼び出し可能オ" +"ブジェクトは C 関数が返す *整数* とともに呼び出され、この呼び出しの結果は関数" +"呼び出しの結果として使われるでしょう。これはエラーの戻り値をチェックして自動" +"的に例外を送出させるために役に立ちます。::" -#: ../../library/ctypes.rst:543 -msgid "" -"You can also use a callable Python object (a function or a class for " -"example) as the :attr:`~_CFuncPtr.restype` attribute, if the foreign " -"function returns an integer. The callable will be called with the *integer* " -"the C function returns, and the result of this call will be used as the " -"result of your function call. This is useful to check for error return " -"values and automatically raise an exception::" -msgstr "" - -#: ../../library/ctypes.rst:549 -msgid "" -">>> GetModuleHandle = windll.kernel32.GetModuleHandleA\n" -">>> def ValidHandle(value):\n" -"... if value == 0:\n" -"... raise WinError()\n" -"... return value\n" -"...\n" -">>>\n" -">>> GetModuleHandle.restype = ValidHandle\n" -">>> GetModuleHandle(None)\n" -"486539264\n" -">>> GetModuleHandle(\"something silly\")\n" -"Traceback (most recent call last):\n" -" File \"\", line 1, in \n" -" File \"\", line 3, in ValidHandle\n" -"OSError: [Errno 126] The specified module could not be found.\n" -">>>" -msgstr "" - -#: ../../library/ctypes.rst:566 +#: ../../library/ctypes.rst:505 msgid "" "``WinError`` is a function which will call Windows ``FormatMessage()`` api " "to get the string representation of an error code, and *returns* an " @@ -1049,18 +742,19 @@ msgstr "" "オプションでエラーコードパラメータを取ります。このパラメータが使われない場合" "は、エラーコードを取り出すために :func:`GetLastError` を呼び出します。" -#: ../../library/ctypes.rst:571 +#: ../../library/ctypes.rst:510 msgid "" "Please note that a much more powerful error checking mechanism is available " -"through the :attr:`~_CFuncPtr.errcheck` attribute; see the reference manual " -"for details." +"through the :attr:`errcheck` attribute; see the reference manual for details." msgstr "" +":attr:`errcheck` 属性によってもっと強力なエラーチェック機構を利用できることに" +"注意してください。詳細はリファレンスマニュアルを参照してください。" -#: ../../library/ctypes.rst:579 +#: ../../library/ctypes.rst:517 msgid "Passing pointers (or: passing parameters by reference)" msgstr "ポインタを渡す(または、パラメータの参照渡し)" -#: ../../library/ctypes.rst:581 +#: ../../library/ctypes.rst:519 msgid "" "Sometimes a C api function expects a *pointer* to a data type as parameter, " "probably to write into the corresponding location, or if the data is too " @@ -1072,7 +766,7 @@ msgstr "" "タが大きすぎて値渡しできない場合です。これは *パラメータの参照渡し* としても" "知られています。" -#: ../../library/ctypes.rst:585 +#: ../../library/ctypes.rst:523 msgid "" ":mod:`ctypes` exports the :func:`byref` function which is used to pass " "parameters by reference. The same effect can be achieved with the :func:" @@ -1086,35 +780,24 @@ msgstr "" "処理を行うことから、 Python 側でポインタオブジェクト自体を必要としないなら" "ば :func:`byref` を使う方がより高速です。::" -#: ../../library/ctypes.rst:591 -msgid "" -">>> i = c_int()\n" -">>> f = c_float()\n" -">>> s = create_string_buffer(b'\\000' * 32)\n" -">>> print(i.value, f.value, repr(s.value))\n" -"0 0.0 b''\n" -">>> libc.sscanf(b\"1 3.14 Hello\", b\"%d %f %s\",\n" -"... byref(i), byref(f), s)\n" -"3\n" -">>> print(i.value, f.value, repr(s.value))\n" -"1 3.1400001049 b'Hello'\n" -">>>" -msgstr "" - -#: ../../library/ctypes.rst:607 +#: ../../library/ctypes.rst:545 msgid "Structures and unions" msgstr "構造体と共用体" -#: ../../library/ctypes.rst:609 +#: ../../library/ctypes.rst:547 msgid "" "Structures and unions must derive from the :class:`Structure` and :class:" "`Union` base classes which are defined in the :mod:`ctypes` module. Each " -"subclass must define a :attr:`~Structure._fields_` attribute. :attr:`!" -"_fields_` must be a list of *2-tuples*, containing a *field name* and a " -"*field type*." +"subclass must define a :attr:`_fields_` attribute. :attr:`_fields_` must be " +"a list of *2-tuples*, containing a *field name* and a *field type*." msgstr "" +"構造体と共用体は :mod:`ctypes` モジュールに定義されている :class:`Structure` " +"および :class:`Union` ベースクラスからの派生クラスでなければなりません。それ" +"ぞれのサブクラスは :attr:`_fields_` 属性を定義する必要があります。 :attr:" +"`_fields_` は *フィールド名* と *フィールド型* を持つ *2要素タプル* のリスト" +"でなければなりません。" -#: ../../library/ctypes.rst:614 +#: ../../library/ctypes.rst:552 msgid "" "The field type must be a :mod:`ctypes` type like :class:`c_int`, or any " "other derived :mod:`ctypes` type: structure, union, array, pointer." @@ -1122,7 +805,7 @@ msgstr "" "フィールド型は :class:`c_int` か他の :mod:`ctypes` 型 (構造体、共用体、配列、" "ポインタ) から派生した :mod:`ctypes` 型である必要があります。" -#: ../../library/ctypes.rst:617 +#: ../../library/ctypes.rst:555 msgid "" "Here is a simple example of a POINT structure, which contains two integers " "named *x* and *y*, and also shows how to initialize a structure in the " @@ -1131,27 +814,7 @@ msgstr "" "以下は、 *x* と *y* という名前の二つの整数からなる簡単な POINT 構造体の例で" "す。コンストラクタで構造体を初期化する方法も説明しています::" -#: ../../library/ctypes.rst:620 -msgid "" -">>> from ctypes import *\n" -">>> class POINT(Structure):\n" -"... _fields_ = [(\"x\", c_int),\n" -"... (\"y\", c_int)]\n" -"...\n" -">>> point = POINT(10, 20)\n" -">>> print(point.x, point.y)\n" -"10 20\n" -">>> point = POINT(y=5)\n" -">>> print(point.x, point.y)\n" -"0 5\n" -">>> POINT(1, 2, 3)\n" -"Traceback (most recent call last):\n" -" File \"\", line 1, in \n" -"TypeError: too many initializers\n" -">>>" -msgstr "" - -#: ../../library/ctypes.rst:637 +#: ../../library/ctypes.rst:575 msgid "" "You can, however, build much more complicated structures. A structure can " "itself contain other structures by using a structure as a field type." @@ -1159,7 +822,7 @@ msgstr "" "しかし、もっと複雑な構造体を構築することもできます。ある構造体は、他の構造体" "をフィールド型として使うことで、他の構造体を含むことができます。" -#: ../../library/ctypes.rst:640 +#: ../../library/ctypes.rst:578 msgid "" "Here is a RECT structure which contains two POINTs named *upperleft* and " "*lowerright*::" @@ -1167,21 +830,7 @@ msgstr "" "*upperleft* と *lowerright* という名前の二つの POINT を持つ RECT 構造体で" "す。::" -#: ../../library/ctypes.rst:643 -msgid "" -">>> class RECT(Structure):\n" -"... _fields_ = [(\"upperleft\", POINT),\n" -"... (\"lowerright\", POINT)]\n" -"...\n" -">>> rc = RECT(point)\n" -">>> print(rc.upperleft.x, rc.upperleft.y)\n" -"0 5\n" -">>> print(rc.lowerright.x, rc.lowerright.y)\n" -"0 0\n" -">>>" -msgstr "" - -#: ../../library/ctypes.rst:654 +#: ../../library/ctypes.rst:592 msgid "" "Nested structures can also be initialized in the constructor in several " "ways::" @@ -1189,29 +838,15 @@ msgstr "" "入れ子になった構造体はいくつかの方法を用いてコンストラクタで初期化することが" "できます。::" -#: ../../library/ctypes.rst:656 -msgid "" -">>> r = RECT(POINT(1, 2), POINT(3, 4))\n" -">>> r = RECT((1, 2), (3, 4))" -msgstr "" - -#: ../../library/ctypes.rst:659 +#: ../../library/ctypes.rst:597 msgid "" "Field :term:`descriptor`\\s can be retrieved from the *class*, they are " -"useful for debugging because they can provide useful information. See :class:" -"`CField`::" -msgstr "" - -#: ../../library/ctypes.rst:663 -msgid "" -">>> POINT.x\n" -"\n" -">>> POINT.y\n" -"\n" -">>>" +"useful for debugging because they can provide useful information::" msgstr "" +"フィールド :term:`descriptor` (記述子)は *クラス* から取り出せます。デバッグ" +"するときに役に立つ情報を得ることができます::" -#: ../../library/ctypes.rst:674 +#: ../../library/ctypes.rst:611 msgid "" ":mod:`ctypes` does not support passing unions or structures with bit-fields " "to functions by value. While this may work on 32-bit x86, it's not " @@ -1222,34 +857,25 @@ msgstr "" "ポートしていません。これは 32-bit の x86 環境では動くかもしれませんが、このラ" "イブラリでは一般の場合に動作することは保証していません。" -#: ../../library/ctypes.rst:680 -msgid "Structure/union layout, alignment and byte order" -msgstr "" - -#: ../../library/ctypes.rst:682 -msgid "" -"By default, Structure and Union fields are laid out in the same way the C " -"compiler does it. It is possible to override this behavior entirely by " -"specifying a :attr:`~Structure._layout_` class attribute in the subclass " -"definition; see the attribute documentation for details." -msgstr "" - -#: ../../library/ctypes.rst:687 -msgid "" -"It is possible to specify the maximum alignment for the fields by setting " -"the :attr:`~Structure._pack_` class attribute to a positive integer. This " -"matches what ``#pragma pack(n)`` does in MSVC." -msgstr "" +#: ../../library/ctypes.rst:617 +msgid "Structure/union alignment and byte order" +msgstr "構造体/共用体アライメントとバイトオーダー" -#: ../../library/ctypes.rst:691 +#: ../../library/ctypes.rst:619 msgid "" -"It is also possible to set a minimum alignment for how the subclass itself " -"is packed in the same way ``#pragma align(n)`` works in MSVC. This can be " -"achieved by specifying a :attr:`~Structure._align_` class attribute in the " -"subclass definition." +"By default, Structure and Union fields are aligned in the same way the C " +"compiler does it. It is possible to override this behavior by specifying a :" +"attr:`_pack_` class attribute in the subclass definition. This must be set " +"to a positive integer and specifies the maximum alignment for the fields. " +"This is what ``#pragma pack(n)`` also does in MSVC." msgstr "" +"デフォルトでは、構造体 (Structure) と共用体(Union) のフィールドは C コンパイ" +"ラが行うのと同じ方法でアライメントされています。サブクラスを定義するときに :" +"attr:`_pack_` クラス属性を指定することでこの動作を変えることは可能です。この" +"クラス属性には正の整数を設定する必要があり、フィールドの最大アライメントを指" +"定します。これは MSVC で ``#pragma pack(n)`` が行っていること同じです。" -#: ../../library/ctypes.rst:696 +#: ../../library/ctypes.rst:625 msgid "" ":mod:`ctypes` uses the native byte order for Structures and Unions. To " "build structures with non-native byte order, you can use one of the :class:" @@ -1263,60 +889,38 @@ msgstr "" "`BigEndianUnion` および :class:`LittleEndianUnion` ベースクラスの中の一つを使" "います。これらのクラスにポインタフィールドを持たせることはできません。" -#: ../../library/ctypes.rst:706 +#: ../../library/ctypes.rst:635 msgid "Bit fields in structures and unions" msgstr "構造体と共用体におけるビットフィールド" -#: ../../library/ctypes.rst:708 +#: ../../library/ctypes.rst:637 msgid "" "It is possible to create structures and unions containing bit fields. Bit " "fields are only possible for integer fields, the bit width is specified as " -"the third item in the :attr:`~Structure._fields_` tuples::" -msgstr "" - -#: ../../library/ctypes.rst:712 -msgid "" -">>> class Int(Structure):\n" -"... _fields_ = [(\"first_16\", c_int, 16),\n" -"... (\"second_16\", c_int, 16)]\n" -"...\n" -">>> print(Int.first_16)\n" -"\n" -">>> print(Int.second_16)\n" -"" -msgstr "" - -#: ../../library/ctypes.rst:721 -msgid "" -"It is important to note that bit field allocation and layout in memory are " -"not defined as a C standard; their implementation is compiler-specific. By " -"default, Python will attempt to match the behavior of a \"native\" compiler " -"for the current platform. See the :attr:`~Structure._layout_` attribute for " -"details on the default behavior and how to change it." +"the third item in the :attr:`_fields_` tuples::" msgstr "" +"ビットフィールドを含む構造体と共用体を作ることができます。ビットフィールドは" +"整数フィールドに対してのみ作ることができ、ビット幅は :attr:`_fields_` タプル" +"の第三要素で指定します。::" -#: ../../library/ctypes.rst:732 +#: ../../library/ctypes.rst:655 msgid "Arrays" msgstr "配列" -#: ../../library/ctypes.rst:734 +#: ../../library/ctypes.rst:657 msgid "" "Arrays are sequences, containing a fixed number of instances of the same " "type." msgstr "" "配列 (Array) はシーケンスであり、決まった数の同じ型のインスタンスを持ちます。" -#: ../../library/ctypes.rst:736 +#: ../../library/ctypes.rst:659 msgid "" "The recommended way to create array types is by multiplying a data type with " "a positive integer::" msgstr "推奨されている配列の作成方法はデータ型に正の整数を掛けることです。::" -#: ../../library/ctypes.rst:739 -msgid "TenPointsArrayType = POINT * 10" -msgstr "" - -#: ../../library/ctypes.rst:741 +#: ../../library/ctypes.rst:664 msgid "" "Here is an example of a somewhat artificial data type, a structure " "containing 4 POINTs among other stuff::" @@ -1324,34 +928,11 @@ msgstr "" "ややわざとらしいデータ型の例になりますが、他のものに混ざって 4 個の POINT が" "ある構造体です::" -#: ../../library/ctypes.rst:744 -msgid "" -">>> from ctypes import *\n" -">>> class POINT(Structure):\n" -"... _fields_ = (\"x\", c_int), (\"y\", c_int)\n" -"...\n" -">>> class MyStruct(Structure):\n" -"... _fields_ = [(\"a\", c_int),\n" -"... (\"b\", c_float),\n" -"... (\"point_array\", POINT * 4)]\n" -">>>\n" -">>> print(len(MyStruct().point_array))\n" -"4\n" -">>>" -msgstr "" - -#: ../../library/ctypes.rst:757 +#: ../../library/ctypes.rst:680 msgid "Instances are created in the usual way, by calling the class::" msgstr "インスタンスはクラスを呼び出す通常の方法で作成します。::" -#: ../../library/ctypes.rst:759 -msgid "" -"arr = TenPointsArrayType()\n" -"for pt in arr:\n" -" print(pt.x, pt.y)" -msgstr "" - -#: ../../library/ctypes.rst:763 +#: ../../library/ctypes.rst:686 msgid "" "The above code print a series of ``0 0`` lines, because the array contents " "is initialized to zeros." @@ -1359,28 +940,15 @@ msgstr "" "上記のコードは ``0 0`` という行が並んだものを表示します。配列の要素がゼロで初" "期化されているためです。" -#: ../../library/ctypes.rst:766 +#: ../../library/ctypes.rst:689 msgid "Initializers of the correct type can also be specified::" msgstr "正しい型の初期化子を指定することもできます。::" -#: ../../library/ctypes.rst:768 -msgid "" -">>> from ctypes import *\n" -">>> TenIntegers = c_int * 10\n" -">>> ii = TenIntegers(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)\n" -">>> print(ii)\n" -"\n" -">>> for i in ii: print(i, end=\" \")\n" -"...\n" -"1 2 3 4 5 6 7 8 9 10\n" -">>>" -msgstr "" - -#: ../../library/ctypes.rst:782 +#: ../../library/ctypes.rst:705 msgid "Pointers" msgstr "ポインタ" -#: ../../library/ctypes.rst:784 +#: ../../library/ctypes.rst:707 msgid "" "Pointer instances are created by calling the :func:`pointer` function on a :" "mod:`ctypes` type::" @@ -1388,15 +956,7 @@ msgstr "" "ポインタのインスタンスは :mod:`ctypes` 型に対して :func:`pointer` 関数を呼び" "出して作成します。::" -#: ../../library/ctypes.rst:787 -msgid "" -">>> from ctypes import *\n" -">>> i = c_int(42)\n" -">>> pi = pointer(i)\n" -">>>" -msgstr "" - -#: ../../library/ctypes.rst:792 +#: ../../library/ctypes.rst:715 msgid "" "Pointer instances have a :attr:`~_Pointer.contents` attribute which returns " "the object to which the pointer points, the ``i`` object above::" @@ -1404,14 +964,7 @@ msgstr "" "次のように、ポインタインスタンスは、ポインタが指すオブジェクト (上の例では " "``i``) を返す :attr:`~_Pointer.contents` 属性を持ちます::" -#: ../../library/ctypes.rst:795 -msgid "" -">>> pi.contents\n" -"c_long(42)\n" -">>>" -msgstr "" - -#: ../../library/ctypes.rst:799 +#: ../../library/ctypes.rst:722 msgid "" "Note that :mod:`ctypes` does not have OOR (original object return), it " "constructs a new, equivalent object each time you retrieve an attribute::" @@ -1420,16 +973,7 @@ msgstr "" "はないことに注意してください。属性を取り出す度に、新しい同等のオブジェクトを" "作成しているのです。::" -#: ../../library/ctypes.rst:802 -msgid "" -">>> pi.contents is i\n" -"False\n" -">>> pi.contents is pi.contents\n" -"False\n" -">>>" -msgstr "" - -#: ../../library/ctypes.rst:808 +#: ../../library/ctypes.rst:731 msgid "" "Assigning another :class:`c_int` instance to the pointer's contents " "attribute would cause the pointer to point to the memory location where this " @@ -1438,41 +982,15 @@ msgstr "" "別の :class:`c_int` インスタンスがポインタの contents 属性に代入されると、こ" "れが記憶されているメモリ位置を指すポインタに変化します。::" -#: ../../library/ctypes.rst:811 -msgid "" -">>> i = c_int(99)\n" -">>> pi.contents = i\n" -">>> pi.contents\n" -"c_long(99)\n" -">>>" -msgstr "" - -#: ../../library/ctypes.rst:820 +#: ../../library/ctypes.rst:743 msgid "Pointer instances can also be indexed with integers::" msgstr "ポインタインスタンスは整数でインデックス指定することもできます。::" -#: ../../library/ctypes.rst:822 -msgid "" -">>> pi[0]\n" -"99\n" -">>>" -msgstr "" - -#: ../../library/ctypes.rst:826 +#: ../../library/ctypes.rst:749 msgid "Assigning to an integer index changes the pointed to value::" msgstr "整数インデックスへ代入するとポインタが指す値が変更されます。::" -#: ../../library/ctypes.rst:828 -msgid "" -">>> print(i)\n" -"c_long(99)\n" -">>> pi[0] = 22\n" -">>> print(i)\n" -"c_long(22)\n" -">>>" -msgstr "" - -#: ../../library/ctypes.rst:835 +#: ../../library/ctypes.rst:758 msgid "" "It is also possible to use indexes different from 0, but you must know what " "you're doing, just as in C: You can access or change arbitrary memory " @@ -1486,7 +1004,7 @@ msgstr "" "のポインタが単一の要素ではなく実際に配列を指していると *分かっている* 場合だ" "けです。" -#: ../../library/ctypes.rst:841 +#: ../../library/ctypes.rst:764 msgid "" "Behind the scenes, the :func:`pointer` function does more than simply create " "pointer instances, it has to create pointer *types* first. This is done with " @@ -1498,21 +1016,7 @@ msgstr "" "は任意の :mod:`ctypes` 型を受け取る :func:`POINTER` 関数を使って行われ、新し" "い型を返します::" -#: ../../library/ctypes.rst:846 -msgid "" -">>> PI = POINTER(c_int)\n" -">>> PI\n" -"\n" -">>> PI(42)\n" -"Traceback (most recent call last):\n" -" File \"\", line 1, in \n" -"TypeError: expected c_long instead of int\n" -">>> PI(c_int(42))\n" -"\n" -">>>" -msgstr "" - -#: ../../library/ctypes.rst:857 +#: ../../library/ctypes.rst:780 msgid "" "Calling the pointer type without an argument creates a ``NULL`` pointer. " "``NULL`` pointers have a ``False`` boolean value::" @@ -1520,15 +1024,7 @@ msgstr "" "ポインタ型を引数なしで呼び出すと ``NULL`` ポインタを作成します。 ``NULL`` ポ" "インタは ``False`` ブール値を持っています。::" -#: ../../library/ctypes.rst:860 -msgid "" -">>> null_ptr = POINTER(c_int)()\n" -">>> print(bool(null_ptr))\n" -"False\n" -">>>" -msgstr "" - -#: ../../library/ctypes.rst:865 +#: ../../library/ctypes.rst:788 msgid "" ":mod:`ctypes` checks for ``NULL`` when dereferencing pointers (but " "dereferencing invalid non-\\ ``NULL`` pointers would crash Python)::" @@ -1537,114 +1033,47 @@ msgstr "" "(しかし、 ``NULL`` でない不正なポインタの指す値の取り出す行為は Python をク" "ラッシュさせるでしょう)。::" -#: ../../library/ctypes.rst:868 -msgid "" -">>> null_ptr[0]\n" -"Traceback (most recent call last):\n" -" ....\n" -"ValueError: NULL pointer access\n" -">>>\n" -"\n" -">>> null_ptr[0] = 1234\n" -"Traceback (most recent call last):\n" -" ....\n" -"ValueError: NULL pointer access\n" -">>>" -msgstr "" - -#: ../../library/ctypes.rst:883 -msgid "Thread safety without the GIL" -msgstr "" - -#: ../../library/ctypes.rst:885 -msgid "" -"In Python 3.13, the :term:`GIL` may be disabled on :term:`experimental free " -"threaded ` builds. In ctypes, reads and writes to a single " -"object concurrently is safe, but not across multiple objects:" -msgstr "" - -#: ../../library/ctypes.rst:888 -msgid "" -">>> number = c_int(42)\n" -">>> pointer_a = pointer(number)\n" -">>> pointer_b = pointer(number)" -msgstr "" - -#: ../../library/ctypes.rst:894 -msgid "" -"In the above, it's only safe for one object to read and write to the address " -"at once if the GIL is disabled. So, ``pointer_a`` can be shared and written " -"to across multiple threads, but only if ``pointer_b`` is not also attempting " -"to do the same. If this is an issue, consider using a :class:`threading." -"Lock` to synchronize access to memory:" -msgstr "" - -#: ../../library/ctypes.rst:899 -msgid "" -">>> import threading\n" -">>> lock = threading.Lock()\n" -">>> # Thread 1\n" -">>> with lock:\n" -"... pointer_a.contents = 24\n" -">>> # Thread 2\n" -">>> with lock:\n" -"... pointer_b.contents = 42" -msgstr "" - -#: ../../library/ctypes.rst:914 +#: ../../library/ctypes.rst:807 msgid "Type conversions" msgstr "型変換" -#: ../../library/ctypes.rst:916 +#: ../../library/ctypes.rst:809 msgid "" "Usually, ctypes does strict type checking. This means, if you have " -"``POINTER(c_int)`` in the :attr:`~_CFuncPtr.argtypes` list of a function or " -"as the type of a member field in a structure definition, only instances of " -"exactly the same type are accepted. There are some exceptions to this rule, " -"where ctypes accepts other objects. For example, you can pass compatible " -"array instances instead of pointer types. So, for ``POINTER(c_int)``, " -"ctypes accepts an array of c_int::" -msgstr "" - -#: ../../library/ctypes.rst:923 -msgid "" -">>> class Bar(Structure):\n" -"... _fields_ = [(\"count\", c_int), (\"values\", POINTER(c_int))]\n" -"...\n" -">>> bar = Bar()\n" -">>> bar.values = (c_int * 3)(1, 2, 3)\n" -">>> bar.count = 3\n" -">>> for i in range(bar.count):\n" -"... print(bar.values[i])\n" -"...\n" -"1\n" -"2\n" -"3\n" -">>>" -msgstr "" - -#: ../../library/ctypes.rst:937 +"``POINTER(c_int)`` in the :attr:`argtypes` list of a function or as the type " +"of a member field in a structure definition, only instances of exactly the " +"same type are accepted. There are some exceptions to this rule, where " +"ctypes accepts other objects. For example, you can pass compatible array " +"instances instead of pointer types. So, for ``POINTER(c_int)``, ctypes " +"accepts an array of c_int::" +msgstr "" +"たいていの場合、 ctypes は厳密な型チェックを行います。これが意味するのは、関" +"数の :attr:`argtypes` リスト内に、もしくは、構造体定義におけるメンバーフィー" +"ルドの型として ``POINTER(c_int)`` がある場合、厳密に同じ型のインスタンスだけ" +"を受け取るということです。このルールには ctypes が他のオブジェクトを受け取る" +"場合に例外がいくつかあります。例えば、ポインタ型の代わりに互換性のある配列イ" +"ンスタンスを渡すことができます。このように、 ``POINTER(c_int)`` に対して、 " +"ctypes は c_int の配列を受け取ります。::" + +#: ../../library/ctypes.rst:830 msgid "" "In addition, if a function argument is explicitly declared to be a pointer " -"type (such as ``POINTER(c_int)``) in :attr:`~_CFuncPtr.argtypes`, an object " -"of the pointed type (``c_int`` in this case) can be passed to the function. " -"ctypes will apply the required :func:`byref` conversion in this case " -"automatically." +"type (such as ``POINTER(c_int)``) in :attr:`argtypes`, an object of the " +"pointed type (``c_int`` in this case) can be passed to the function. ctypes " +"will apply the required :func:`byref` conversion in this case automatically." msgstr "" +"それに加えて、 :attr:`argtypes` で関数の引数が明示的に (``POINTER(c_int)`` な" +"どの) ポインタ型であると宣言されていた場合、ポインタ型が指し示している型のオ" +"ブジェクト (この場合では ``c_int``) を関数に渡すことができます。この場合 " +"ctypes は、必要となる :func:`byref` での変換を自動的に適用します。" -#: ../../library/ctypes.rst:942 +#: ../../library/ctypes.rst:835 msgid "To set a POINTER type field to ``NULL``, you can assign ``None``::" msgstr "" "POINTER型フィールドを ``NULL`` に設定するために、 ``None`` を代入してもかまい" "ません。::" -#: ../../library/ctypes.rst:944 -msgid "" -">>> bar.values = None\n" -">>>" -msgstr "" - -#: ../../library/ctypes.rst:949 +#: ../../library/ctypes.rst:842 msgid "" "Sometimes you have instances of incompatible types. In C, you can cast one " "type into another type. :mod:`ctypes` provides a :func:`cast` function " @@ -1658,21 +1087,11 @@ msgstr "" "``POINTER(c_int)`` ポインタまたは :class:`c_int` 配列を ``values`` フィールド" "に対して受け取り、他の型のインスタンスは受け取りません::" -#: ../../library/ctypes.rst:955 -msgid "" -">>> bar.values = (c_byte * 4)()\n" -"Traceback (most recent call last):\n" -" File \"\", line 1, in \n" -"TypeError: incompatible types, c_byte_Array_4 instance instead of LP_c_long " -"instance\n" -">>>" -msgstr "" - -#: ../../library/ctypes.rst:961 +#: ../../library/ctypes.rst:854 msgid "For these cases, the :func:`cast` function is handy." msgstr "このような場合には、 :func:`cast` 関数が便利です。" -#: ../../library/ctypes.rst:963 +#: ../../library/ctypes.rst:856 msgid "" "The :func:`cast` function can be used to cast a ctypes instance into a " "pointer to a different ctypes data type. :func:`cast` takes two parameters, " @@ -1686,15 +1105,7 @@ msgstr "" "ります。そして、第二引数のインスタンスを返します。このインスタンスは第一引数" "と同じメモリブロックを参照しています::" -#: ../../library/ctypes.rst:969 -msgid "" -">>> a = (c_byte * 4)()\n" -">>> cast(a, POINTER(c_int))\n" -"\n" -">>>" -msgstr "" - -#: ../../library/ctypes.rst:974 +#: ../../library/ctypes.rst:867 msgid "" "So, :func:`cast` can be used to assign to the ``values`` field of ``Bar`` " "the structure::" @@ -1702,20 +1113,11 @@ msgstr "" "したがって、 :func:`cast` を ``Bar`` 構造体の ``values`` フィールドへ代入する" "ために使うことができます::" -#: ../../library/ctypes.rst:977 -msgid "" -">>> bar = Bar()\n" -">>> bar.values = cast((c_byte * 4)(), POINTER(c_int))\n" -">>> print(bar.values[0])\n" -"0\n" -">>>" -msgstr "" - -#: ../../library/ctypes.rst:987 +#: ../../library/ctypes.rst:880 msgid "Incomplete Types" msgstr "不完全型" -#: ../../library/ctypes.rst:989 +#: ../../library/ctypes.rst:882 msgid "" "*Incomplete Types* are structures, unions or arrays whose members are not " "yet specified. In C, they are specified by forward declarations, which are " @@ -1724,55 +1126,24 @@ msgstr "" "*不完全型* はメンバーがまだ指定されていない構造体、共用体もしくは配列です。 " "C では、前方宣言により指定され、後で定義されます。::" -#: ../../library/ctypes.rst:993 -msgid "" -"struct cell; /* forward declaration */\n" -"\n" -"struct cell {\n" -" char *name;\n" -" struct cell *next;\n" -"};" -msgstr "" - -#: ../../library/ctypes.rst:1000 +#: ../../library/ctypes.rst:893 msgid "" "The straightforward translation into ctypes code would be this, but it does " "not work::" msgstr "" "ctypes コードへの直接的な変換ではこうなるでしょう。しかし、動作しません::" -#: ../../library/ctypes.rst:1003 -msgid "" -">>> class cell(Structure):\n" -"... _fields_ = [(\"name\", c_char_p),\n" -"... (\"next\", POINTER(cell))]\n" -"...\n" -"Traceback (most recent call last):\n" -" File \"\", line 1, in \n" -" File \"\", line 2, in cell\n" -"NameError: name 'cell' is not defined\n" -">>>" -msgstr "" - -#: ../../library/ctypes.rst:1013 +#: ../../library/ctypes.rst:906 msgid "" "because the new ``class cell`` is not available in the class statement " "itself. In :mod:`ctypes`, we can define the ``cell`` class and set the :attr:" -"`~Structure._fields_` attribute later, after the class statement::" -msgstr "" - -#: ../../library/ctypes.rst:1017 -msgid "" -">>> from ctypes import *\n" -">>> class cell(Structure):\n" -"... pass\n" -"...\n" -">>> cell._fields_ = [(\"name\", c_char_p),\n" -"... (\"next\", POINTER(cell))]\n" -">>>" +"`_fields_` attribute later, after the class statement::" msgstr "" +"なぜなら、新しい ``class cell`` はクラス文自体の中では利用できないからで" +"す。 :mod:`ctypes` では、 ``cell`` クラスを定義して、 :attr:`_fields_` 属性を" +"クラス文の後で設定することができます。::" -#: ../../library/ctypes.rst:1025 +#: ../../library/ctypes.rst:918 msgid "" "Let's try it. We create two instances of ``cell``, and let them point to " "each other, and finally follow the pointer chain a few times::" @@ -1780,28 +1151,11 @@ msgstr "" "試してみましょう。 ``cell`` のインスタンスを二つ作り、互いに参照し合うように" "します。最後に、つながったポインタを何度かたどります。::" -#: ../../library/ctypes.rst:1028 -msgid "" -">>> c1 = cell()\n" -">>> c1.name = b\"foo\"\n" -">>> c2 = cell()\n" -">>> c2.name = b\"bar\"\n" -">>> c1.next = pointer(c2)\n" -">>> c2.next = pointer(c1)\n" -">>> p = c1\n" -">>> for i in range(8):\n" -"... print(p.name, end=\" \")\n" -"... p = p.next[0]\n" -"...\n" -"foo bar foo bar foo bar foo bar\n" -">>>" -msgstr "" - -#: ../../library/ctypes.rst:1046 +#: ../../library/ctypes.rst:939 msgid "Callback functions" msgstr "コールバック関数" -#: ../../library/ctypes.rst:1048 +#: ../../library/ctypes.rst:941 msgid "" ":mod:`ctypes` allows creating C callable function pointers from Python " "callables. These are sometimes called *callback functions*." @@ -1810,7 +1164,7 @@ msgstr "" "クトから作成できるようにします。これらは *コールバック関数* と呼ばれることが" "あります。" -#: ../../library/ctypes.rst:1051 +#: ../../library/ctypes.rst:944 msgid "" "First, you must create a class for the callback function. The class knows " "the calling convention, the return type, and the number and types of " @@ -1820,7 +1174,7 @@ msgstr "" "び出し規約、戻り値の型およびこの関数が受け取る引数の数と型についての情報があ" "ります。" -#: ../../library/ctypes.rst:1055 +#: ../../library/ctypes.rst:948 msgid "" "The :func:`CFUNCTYPE` factory function creates types for callback functions " "using the ``cdecl`` calling convention. On Windows, the :func:`WINFUNCTYPE` " @@ -1831,7 +1185,7 @@ msgstr "" "バック関数のための型を作成します。 Windows では、 :func:`WINFUNCTYPE` ファク" "トリ関数が ``stdcall`` 呼び出し規約を用いてコールバック関数の型を作成します。" -#: ../../library/ctypes.rst:1060 +#: ../../library/ctypes.rst:953 msgid "" "Both of these factory functions are called with the result type as first " "argument, and the callback functions expected argument types as the " @@ -1840,33 +1194,32 @@ msgstr "" "これらのファクトリ関数はともに最初の引数に戻り値の型、残りの引数としてコール" "バック関数が想定する引数の型を渡して呼び出されます。" -#: ../../library/ctypes.rst:1064 +#: ../../library/ctypes.rst:957 msgid "" -"I will present an example here which uses the standard C library's :c:func:`!" -"qsort` function, that is used to sort items with the help of a callback " -"function. :c:func:`!qsort` will be used to sort an array of integers::" +"I will present an example here which uses the standard C library's :c:func:" +"`qsort` function, that is used to sort items with the help of a callback " +"function. :c:func:`qsort` will be used to sort an array of integers::" msgstr "" +"標準 C ライブラリの :c:func:`qsort` 関数を使う例を示します。これはコールバッ" +"ク関数の助けをかりて要素をソートするために使われます。 :c:func:`qsort` は整数" +"の配列をソートするために使われます::" -#: ../../library/ctypes.rst:1068 +#: ../../library/ctypes.rst:967 msgid "" -">>> IntArray5 = c_int * 5\n" -">>> ia = IntArray5(5, 1, 7, 33, 99)\n" -">>> qsort = libc.qsort\n" -">>> qsort.restype = None\n" -">>>" -msgstr "" - -#: ../../library/ctypes.rst:1074 -msgid "" -":func:`!qsort` must be called with a pointer to the data to sort, the number " +":func:`qsort` must be called with a pointer to the data to sort, the number " "of items in the data array, the size of one item, and a pointer to the " "comparison function, the callback. The callback will then be called with two " "pointers to items, and it must return a negative integer if the first item " "is smaller than the second, a zero if they are equal, and a positive integer " "otherwise." msgstr "" +":func:`qsort` はソートするデータを指すポインタ、データ配列の要素の数、要素の" +"一つの大きさ、およびコールバック関数である比較関数へのポインタを引数に渡して" +"呼び出さなければなりません。そして、コールバック関数は要素を指す二つのポイン" +"タを渡されて呼び出され、一番目が二番目より小さいなら負の数を、等しいならゼロ" +"を、それ以外なら正の数を返さなければなりません。" -#: ../../library/ctypes.rst:1080 +#: ../../library/ctypes.rst:973 msgid "" "So our callback function receives pointers to integers, and must return an " "integer. First we create the ``type`` for the callback function::" @@ -1874,77 +1227,26 @@ msgstr "" "コールバック関数は整数へのポインタを受け取り、整数を返す必要があります。ま" "ず、コールバック関数のための ``type`` を作成します。::" -#: ../../library/ctypes.rst:1083 -msgid "" -">>> CMPFUNC = CFUNCTYPE(c_int, POINTER(c_int), POINTER(c_int))\n" -">>>" -msgstr "" - -#: ../../library/ctypes.rst:1086 +#: ../../library/ctypes.rst:979 msgid "" "To get started, here is a simple callback that shows the values it gets " "passed::" msgstr "" "まず初めに、これが受け取った変数を表示するだけのシンプルなコールバックです::" -#: ../../library/ctypes.rst:1089 -msgid "" -">>> def py_cmp_func(a, b):\n" -"... print(\"py_cmp_func\", a[0], b[0])\n" -"... return 0\n" -"...\n" -">>> cmp_func = CMPFUNC(py_cmp_func)\n" -">>>" -msgstr "" - -#: ../../library/ctypes.rst:1096 +#: ../../library/ctypes.rst:989 msgid "The result::" msgstr "結果は以下の通りです::" -#: ../../library/ctypes.rst:1098 -msgid "" -">>> qsort(ia, len(ia), sizeof(c_int), cmp_func)\n" -"py_cmp_func 5 1\n" -"py_cmp_func 33 99\n" -"py_cmp_func 7 33\n" -"py_cmp_func 5 7\n" -"py_cmp_func 1 7\n" -">>>" -msgstr "" - -#: ../../library/ctypes.rst:1106 +#: ../../library/ctypes.rst:999 msgid "Now we can actually compare the two items and return a useful result::" msgstr "ここで 2 つの要素を実際に比較し、役に立つ結果を返します::" -#: ../../library/ctypes.rst:1108 -msgid "" -">>> def py_cmp_func(a, b):\n" -"... print(\"py_cmp_func\", a[0], b[0])\n" -"... return a[0] - b[0]\n" -"...\n" -">>>\n" -">>> qsort(ia, len(ia), sizeof(c_int), CMPFUNC(py_cmp_func))\n" -"py_cmp_func 5 1\n" -"py_cmp_func 33 99\n" -"py_cmp_func 7 33\n" -"py_cmp_func 1 7\n" -"py_cmp_func 5 7\n" -">>>" -msgstr "" - -#: ../../library/ctypes.rst:1121 +#: ../../library/ctypes.rst:1014 msgid "As we can easily check, our array is sorted now::" msgstr "簡単に確認できるように、配列を次のようにソートしました::" -#: ../../library/ctypes.rst:1123 -msgid "" -">>> for i in ia: print(i, end=\" \")\n" -"...\n" -"1 5 7 33 99\n" -">>>" -msgstr "" - -#: ../../library/ctypes.rst:1128 +#: ../../library/ctypes.rst:1021 msgid "" "The function factories can be used as decorator factories, so we may as well " "write::" @@ -1952,23 +1254,7 @@ msgstr "" "関数ファクトリはデコレータファクトリとしても使えるので、次のようにも書けま" "す::" -#: ../../library/ctypes.rst:1131 -msgid "" -">>> @CFUNCTYPE(c_int, POINTER(c_int), POINTER(c_int))\n" -"... def py_cmp_func(a, b):\n" -"... print(\"py_cmp_func\", a[0], b[0])\n" -"... return a[0] - b[0]\n" -"...\n" -">>> qsort(ia, len(ia), sizeof(c_int), py_cmp_func)\n" -"py_cmp_func 5 1\n" -"py_cmp_func 33 99\n" -"py_cmp_func 7 33\n" -"py_cmp_func 1 7\n" -"py_cmp_func 5 7\n" -">>>" -msgstr "" - -#: ../../library/ctypes.rst:1146 +#: ../../library/ctypes.rst:1039 msgid "" "Make sure you keep references to :func:`CFUNCTYPE` objects as long as they " "are used from C code. :mod:`ctypes` doesn't, and if you don't, they may be " @@ -1979,7 +1265,7 @@ msgstr "" "たが参照を保持しないと、オブジェクトはガベージコレクションの対象となり、コー" "ルバックが行われたときにプログラムをクラッシュさせる場合があります。" -#: ../../library/ctypes.rst:1150 +#: ../../library/ctypes.rst:1043 msgid "" "Also, note that if the callback function is called in a thread created " "outside of Python's control (e.g. by the foreign code that calls the " @@ -1995,32 +1281,43 @@ msgstr "" "としても、 :class:`threading.local` で格納された値は異なるコールバックをまた" "いで生存は *しません* 。" -#: ../../library/ctypes.rst:1160 +#: ../../library/ctypes.rst:1053 msgid "Accessing values exported from dlls" msgstr "dllからエクスポートされた値へアクセスする" -#: ../../library/ctypes.rst:1162 +#: ../../library/ctypes.rst:1055 msgid "" "Some shared libraries not only export functions, they also export variables. " -"An example in the Python library itself is the :c:data:`Py_Version`, Python " -"runtime version number encoded in a single constant integer." +"An example in the Python library itself is the :c:data:`Py_OptimizeFlag`, an " +"integer set to 0, 1, or 2, depending on the :option:`-O` or :option:`-OO` " +"flag given on startup." msgstr "" +"共有ライブラリの一部は関数だけでなく変数もエクスポートしています。 Python ラ" +"イブラリにある例としては :c:data:`Py_OptimizeFlag` 、起動時の :option:`-O` ま" +"たは :option:`-OO` フラグに依存して、 0 , 1 または 2 が設定される整数がありま" +"す。" -#: ../../library/ctypes.rst:1166 +#: ../../library/ctypes.rst:1060 msgid "" -":mod:`ctypes` can access values like this with the :meth:`~_CData.in_dll` " -"class methods of the type. *pythonapi* is a predefined symbol giving access " -"to the Python C api::" +":mod:`ctypes` can access values like this with the :meth:`in_dll` class " +"methods of the type. *pythonapi* is a predefined symbol giving access to " +"the Python C api::" msgstr "" +":mod:`ctypes` は型の :meth:`in_dll` クラスメソッドを使ってこのように値にアク" +"セスできます。 *pythonapi* はPython C api へアクセスできるようにするための予" +"め定義されたシンボルです。::" -#: ../../library/ctypes.rst:1170 +#: ../../library/ctypes.rst:1069 msgid "" -">>> version = ctypes.c_int.in_dll(ctypes.pythonapi, \"Py_Version\")\n" -">>> print(hex(version.value))\n" -"0x30c00a0" +"If the interpreter would have been started with :option:`-O`, the sample " +"would have printed ``c_long(1)``, or ``c_long(2)`` if :option:`-OO` would " +"have been specified." msgstr "" +"インタープリタが :option:`-O` を指定されて動き始めた場合、サンプルは " +"``c_long(1)`` を表示するでしょうし、 :option:`-OO` が指定されたならば " +"``c_long(2)`` を表示するでしょう。" -#: ../../library/ctypes.rst:1174 +#: ../../library/ctypes.rst:1073 msgid "" "An extended example which also demonstrates the use of pointers accesses " "the :c:data:`PyImport_FrozenModules` pointer exported by Python." @@ -2028,25 +1325,25 @@ msgstr "" "ポインタの使い方を説明する拡張例では、 Python がエクスポートする :c:data:" "`PyImport_FrozenModules` ポインタにアクセスします。" -#: ../../library/ctypes.rst:1177 +#: ../../library/ctypes.rst:1076 msgid "Quoting the docs for that value:" msgstr "この値のドキュメントから引用すると:" -#: ../../library/ctypes.rst:1179 +#: ../../library/ctypes.rst:1078 msgid "" -"This pointer is initialized to point to an array of :c:struct:`_frozen` " +"This pointer is initialized to point to an array of :c:type:`struct _frozen` " "records, terminated by one whose members are all ``NULL`` or zero. When a " "frozen module is imported, it is searched in this table. Third-party code " "could play tricks with this to provide a dynamically created collection of " "frozen modules." msgstr "" -"このポインタは :c:struct:`_frozen` のレコードからなり、終端の要素のメンバが " -"``NULL`` かゼロになっているような配列を指すよう初期化されます。\n" +"このポインタは :c:type:`struct _frozen` のレコードからなり、終端の要素のメン" +"バが ``NULL`` かゼロになっているような配列を指すよう初期化されます。\n" "フリーズされたモジュールをインポートするとき、このテーブルを検索します。\n" "サードパーティ製のコードからこのポインタに仕掛けを講じて、動的に生成されたフ" "リーズ化モジュールの集合を提供するようにできます。" -#: ../../library/ctypes.rst:1184 +#: ../../library/ctypes.rst:1083 msgid "" "So manipulating this pointer could even prove useful. To restrict the " "example size, we show only how this table can be read with :mod:`ctypes`::" @@ -2055,36 +1352,15 @@ msgstr "" "きさを制限するために、このテーブルを :mod:`ctypes` を使って読む方法だけを示し" "ます。::" -#: ../../library/ctypes.rst:1187 +#: ../../library/ctypes.rst:1095 msgid "" -">>> from ctypes import *\n" -">>>\n" -">>> class struct_frozen(Structure):\n" -"... _fields_ = [(\"name\", c_char_p),\n" -"... (\"code\", POINTER(c_ubyte)),\n" -"... (\"size\", c_int),\n" -"... (\"get_code\", POINTER(c_ubyte)), # Function pointer\n" -"... ]\n" -"...\n" -">>>" +"We have defined the :c:type:`struct _frozen` data type, so we can get the " +"pointer to the table::" msgstr "" +"私たちは :c:type:`struct _frozen` データ型を定義済みなので、このテーブルを指" +"すポインタを得ることができます::" -#: ../../library/ctypes.rst:1198 -msgid "" -"We have defined the :c:struct:`_frozen` data type, so we can get the pointer " -"to the table::" -msgstr "" -"私たちは :c:struct:`_frozen` データ型を定義済みなので、このテーブルを指すポイ" -"ンタを得ることができます。::" - -#: ../../library/ctypes.rst:1201 -msgid "" -">>> FrozenTable = POINTER(struct_frozen)\n" -">>> table = FrozenTable.in_dll(pythonapi, \"_PyImport_FrozenBootstrap\")\n" -">>>" -msgstr "" - -#: ../../library/ctypes.rst:1205 +#: ../../library/ctypes.rst:1102 msgid "" "Since ``table`` is a ``pointer`` to the array of ``struct_frozen`` records, " "we can iterate over it, but we just have to make sure that our loop " @@ -2098,20 +1374,7 @@ msgstr "" "セス違反か何かでクラッシュすることになるでしょう。 ``NULL`` エントリに達した" "ときはループを抜ける方が良いです::" -#: ../../library/ctypes.rst:1211 -msgid "" -">>> for item in table:\n" -"... if item.name is None:\n" -"... break\n" -"... print(item.name.decode(\"ascii\"), item.size)\n" -"...\n" -"_frozen_importlib 31764\n" -"_frozen_importlib_external 41499\n" -"zipimport 12345\n" -">>>" -msgstr "" - -#: ../../library/ctypes.rst:1221 +#: ../../library/ctypes.rst:1120 msgid "" "The fact that standard Python has a frozen module and a frozen package " "(indicated by the negative ``size`` member) is not well known, it is only " @@ -2121,11 +1384,11 @@ msgstr "" "バーで表されています) を持っているという事実はあまり知られておらず、テストに" "だけ使われています。例えば、 ``import __hello__`` を試してみてください。" -#: ../../library/ctypes.rst:1229 +#: ../../library/ctypes.rst:1128 msgid "Surprises" msgstr "びっくり仰天" -#: ../../library/ctypes.rst:1231 +#: ../../library/ctypes.rst:1130 msgid "" "There are some edges in :mod:`ctypes` where you might expect something other " "than what actually happens." @@ -2133,32 +1396,11 @@ msgstr "" " :mod:`ctypes` には、期待する動作と実際に起こる動作が異なるような奇妙な箇所" "があります。" -#: ../../library/ctypes.rst:1234 +#: ../../library/ctypes.rst:1133 msgid "Consider the following example::" msgstr "次に示す例について考えてみてください。::" -#: ../../library/ctypes.rst:1236 -msgid "" -">>> from ctypes import *\n" -">>> class POINT(Structure):\n" -"... _fields_ = (\"x\", c_int), (\"y\", c_int)\n" -"...\n" -">>> class RECT(Structure):\n" -"... _fields_ = (\"a\", POINT), (\"b\", POINT)\n" -"...\n" -">>> p1 = POINT(1, 2)\n" -">>> p2 = POINT(3, 4)\n" -">>> rc = RECT(p1, p2)\n" -">>> print(rc.a.x, rc.a.y, rc.b.x, rc.b.y)\n" -"1 2 3 4\n" -">>> # now swap the two points\n" -">>> rc.a, rc.b = rc.b, rc.a\n" -">>> print(rc.a.x, rc.a.y, rc.b.x, rc.b.y)\n" -"3 4 3 4\n" -">>>" -msgstr "" - -#: ../../library/ctypes.rst:1254 +#: ../../library/ctypes.rst:1153 msgid "" "Hm. We certainly expected the last statement to print ``3 4 1 2``. What " "happened? Here are the steps of the ``rc.a, rc.b = rc.b, rc.a`` line above::" @@ -2167,15 +1409,7 @@ msgstr "" "きたのでしょうか? 上の行の ``rc.a, rc.b = rc.b, rc.a`` の各段階はこのようにな" "ります。::" -#: ../../library/ctypes.rst:1257 -msgid "" -">>> temp0, temp1 = rc.b, rc.a\n" -">>> rc.a = temp0\n" -">>> rc.b = temp1\n" -">>>" -msgstr "" - -#: ../../library/ctypes.rst:1262 +#: ../../library/ctypes.rst:1161 msgid "" "Note that ``temp0`` and ``temp1`` are objects still using the internal " "buffer of the ``rc`` object above. So executing ``rc.a = temp0`` copies the " @@ -2189,7 +1423,7 @@ msgstr "" "の内容を変更します。そのため、最後の代入 ``rc.b = temp1`` は、期待する結果に" "はならないのです。" -#: ../../library/ctypes.rst:1268 +#: ../../library/ctypes.rst:1167 msgid "" "Keep in mind that retrieving sub-objects from Structure, Unions, and Arrays " "doesn't *copy* the sub-object, instead it retrieves a wrapper object " @@ -2199,24 +1433,13 @@ msgstr "" "ブジェクトが *コピー* されるわけではなく、ルートオブジェクトの内部バッファに" "アクセスするラッパーオブジェクトを取り出すことを覚えておいてください。" -#: ../../library/ctypes.rst:1272 +#: ../../library/ctypes.rst:1171 msgid "" "Another example that may behave differently from what one would expect is " "this::" msgstr "期待とは違う振る舞いをする別の例はこれです::" -#: ../../library/ctypes.rst:1274 -msgid "" -">>> s = c_char_p()\n" -">>> s.value = b\"abc def ghi\"\n" -">>> s.value\n" -"b'abc def ghi'\n" -">>> s.value is s.value\n" -"False\n" -">>>" -msgstr "" - -#: ../../library/ctypes.rst:1284 +#: ../../library/ctypes.rst:1183 msgid "" "Objects instantiated from :class:`c_char_p` can only have their value set to " "bytes or integers." @@ -2224,7 +1447,7 @@ msgstr "" ":class:`c_char_p` からインスタンス化されたオブジェクトは、bytes または整数に" "設定された値しか持てません。" -#: ../../library/ctypes.rst:1287 +#: ../../library/ctypes.rst:1186 msgid "" "Why is it printing ``False``? ctypes instances are objects containing a " "memory block plus some :term:`descriptor`\\s accessing the contents of the " @@ -2238,16 +1461,16 @@ msgstr "" "存される訳ではなく、オブジェクトの ``contents`` が保存されます。その " "contents に再アクセスすると新しい Python オブジェクトがその度に作られます。" -#: ../../library/ctypes.rst:1297 +#: ../../library/ctypes.rst:1196 msgid "Variable-sized data types" msgstr "可変サイズのデータ型" -#: ../../library/ctypes.rst:1299 +#: ../../library/ctypes.rst:1198 msgid "" ":mod:`ctypes` provides some support for variable-sized arrays and structures." msgstr ":mod:`ctypes` は可変サイズの配列と構造体をサポートしています。" -#: ../../library/ctypes.rst:1301 +#: ../../library/ctypes.rst:1200 msgid "" "The :func:`resize` function can be used to resize the memory buffer of an " "existing ctypes object. The function takes the object as first argument, " @@ -2261,24 +1484,7 @@ msgstr "" "常のメモリブロックより小さくすることはできません。これをやろうとすると、 :" "exc:`ValueError` が送出されます。::" -#: ../../library/ctypes.rst:1307 -msgid "" -">>> short_array = (c_short * 4)()\n" -">>> print(sizeof(short_array))\n" -"8\n" -">>> resize(short_array, 4)\n" -"Traceback (most recent call last):\n" -" ...\n" -"ValueError: minimum size is 8\n" -">>> resize(short_array, 32)\n" -">>> sizeof(short_array)\n" -"32\n" -">>> sizeof(type(short_array))\n" -"8\n" -">>>" -msgstr "" - -#: ../../library/ctypes.rst:1321 +#: ../../library/ctypes.rst:1220 msgid "" "This is nice and fine, but how would one access the additional elements " "contained in this array? Since the type still only knows about 4 elements, " @@ -2288,18 +1494,7 @@ msgstr "" "するのでしょうか? この型は要素の数が 4 個であるとまだ認識しているので、他の要" "素にアクセスするとエラーになります。::" -#: ../../library/ctypes.rst:1325 -msgid "" -">>> short_array[:]\n" -"[0, 0, 0, 0]\n" -">>> short_array[7]\n" -"Traceback (most recent call last):\n" -" ...\n" -"IndexError: invalid index\n" -">>>" -msgstr "" - -#: ../../library/ctypes.rst:1333 +#: ../../library/ctypes.rst:1232 msgid "" "Another way to use variable-sized data types with :mod:`ctypes` is to use " "the dynamic nature of Python, and (re-)define the data type after the " @@ -2308,15 +1503,15 @@ msgstr "" ":mod:`ctypes` で可変サイズのデータ型を使うもう一つの方法は、必要なサイズが分" "かった後に Python の動的性質を使って一つ一つデータ型を(再)定義することです。" -#: ../../library/ctypes.rst:1341 +#: ../../library/ctypes.rst:1240 msgid "ctypes reference" msgstr "ctypesリファレンス" -#: ../../library/ctypes.rst:1347 +#: ../../library/ctypes.rst:1246 msgid "Finding shared libraries" msgstr "共有ライブラリを見つける" -#: ../../library/ctypes.rst:1349 +#: ../../library/ctypes.rst:1248 msgid "" "When programming in a compiled language, shared libraries are accessed when " "compiling/linking a program, and when the program is run." @@ -2325,22 +1520,29 @@ msgstr "" "をコンパイル/リンクしているときと、そのプログラムが動作しているときにアクセス" "されます。" -#: ../../library/ctypes.rst:1352 +#: ../../library/ctypes.rst:1251 msgid "" -"The purpose of the :func:`~ctypes.util.find_library` function is to locate a " -"library in a way similar to what the compiler or runtime loader does (on " -"platforms with several versions of a shared library the most recent should " -"be loaded), while the ctypes library loaders act like when a program is run, " -"and call the runtime loader directly." +"The purpose of the :func:`find_library` function is to locate a library in a " +"way similar to what the compiler or runtime loader does (on platforms with " +"several versions of a shared library the most recent should be loaded), " +"while the ctypes library loaders act like when a program is run, and call " +"the runtime loader directly." msgstr "" +"ctypes ライブラリローダーはプログラムが動作しているときのように振る舞い、ラン" +"タイムローダーを直接呼び出すのに対し、 :func:`find_library` 関数の目的はコン" +"パイラまたはランタイムローダーが行うのと似た方法でライブラリを探し出すことで" +"す。 (複数のバージョンの共有ライブラリがあるプラットホームでは、一番最近に見" +"つかったものがロードされます)。" -#: ../../library/ctypes.rst:1358 +#: ../../library/ctypes.rst:1257 msgid "" -"The :mod:`!ctypes.util` module provides a function which can help to " +"The :mod:`ctypes.util` module provides a function which can help to " "determine the library to load." msgstr "" +":mod:`ctypes.util` モジュールはロードするライブラリを決めるのに役立つ関数を提" +"供します。" -#: ../../library/ctypes.rst:1366 +#: ../../library/ctypes.rst:1265 msgid "" "Try to find a library and return a pathname. *name* is the library name " "without any prefix like *lib*, suffix like ``.so``, ``.dylib`` or version " @@ -2353,18 +1555,21 @@ msgstr "" "使われている形式です)。\n" "ライブラリが見つからないときは ``None`` を返します。" -#: ../../library/ctypes.rst:1371 ../../library/ctypes.rst:2119 +#: ../../library/ctypes.rst:1270 ../../library/ctypes.rst:1918 msgid "The exact functionality is system dependent." msgstr "厳密な機能はシステムに依存します。" -#: ../../library/ctypes.rst:1373 +#: ../../library/ctypes.rst:1272 msgid "" -"On Linux, :func:`~ctypes.util.find_library` tries to run external programs " -"(``/sbin/ldconfig``, ``gcc``, ``objdump`` and ``ld``) to find the library " -"file. It returns the filename of the library file." +"On Linux, :func:`find_library` tries to run external programs (``/sbin/" +"ldconfig``, ``gcc``, ``objdump`` and ``ld``) to find the library file. It " +"returns the filename of the library file." msgstr "" +"Linux では、 :func:`find_library` はライブラリファイルを見つけるために外部プ" +"ログラム (``/sbin/ldconfig``, ``gcc``, ``objdump`` と ``ld``) を実行しようと" +"します。ライブラリファイルのファイル名を返します。" -#: ../../library/ctypes.rst:1377 +#: ../../library/ctypes.rst:1276 msgid "" "On Linux, the value of the environment variable ``LD_LIBRARY_PATH`` is used " "when searching for libraries, if a library cannot be found by any other " @@ -2373,99 +1578,45 @@ msgstr "" "Linux では、ライブラリを検索する際に、他の方法でライブラリが見つけられない場" "合は、 ``LD_LIBRARY_PATH`` 環境変数の値が使われます" -#: ../../library/ctypes.rst:1381 +#: ../../library/ctypes.rst:1280 msgid "Here are some examples::" msgstr "ここに例があります::" -#: ../../library/ctypes.rst:1383 -msgid "" -">>> from ctypes.util import find_library\n" -">>> find_library(\"m\")\n" -"'libm.so.6'\n" -">>> find_library(\"c\")\n" -"'libc.so.6'\n" -">>> find_library(\"bz2\")\n" -"'libbz2.so.1.0'\n" -">>>" -msgstr "" - -#: ../../library/ctypes.rst:1392 -msgid "" -"On macOS and Android, :func:`~ctypes.util.find_library` uses the system's " -"standard naming schemes and paths to locate the library, and returns a full " -"pathname if successful::" -msgstr "" - -#: ../../library/ctypes.rst:1396 +#: ../../library/ctypes.rst:1291 msgid "" -">>> from ctypes.util import find_library\n" -">>> find_library(\"c\")\n" -"'/usr/lib/libc.dylib'\n" -">>> find_library(\"m\")\n" -"'/usr/lib/libm.dylib'\n" -">>> find_library(\"bz2\")\n" -"'/usr/lib/libbz2.dylib'\n" -">>> find_library(\"AGL\")\n" -"'/System/Library/Frameworks/AGL.framework/AGL'\n" -">>>" +"On OS X, :func:`find_library` tries several predefined naming schemes and " +"paths to locate the library, and returns a full pathname if successful::" msgstr "" +"OS X では、 :func:`find_library` はライブラリの位置を探すために、予め定義され" +"た複数の命名方法とパスを試し、成功すればフルパスを返します。::" -#: ../../library/ctypes.rst:1407 +#: ../../library/ctypes.rst:1305 msgid "" -"On Windows, :func:`~ctypes.util.find_library` searches along the system " -"search path, and returns the full pathname, but since there is no predefined " -"naming scheme a call like ``find_library(\"c\")`` will fail and return " -"``None``." +"On Windows, :func:`find_library` searches along the system search path, and " +"returns the full pathname, but since there is no predefined naming scheme a " +"call like ``find_library(\"c\")`` will fail and return ``None``." msgstr "" +"Windows では、 :func:`find_library` はシステムの探索パスに沿って探し、フルパ" +"スを返します。しかし、予め定義された命名方法がないため、 " +"``find_library(\"c\")`` のような呼び出しは失敗し、 ``None`` を返します。" -#: ../../library/ctypes.rst:1411 +#: ../../library/ctypes.rst:1309 msgid "" "If wrapping a shared library with :mod:`ctypes`, it *may* be better to " "determine the shared library name at development time, and hardcode that " -"into the wrapper module instead of using :func:`~ctypes.util.find_library` " -"to locate the library at runtime." +"into the wrapper module instead of using :func:`find_library` to locate the " +"library at runtime." msgstr "" +":mod:`ctypes` で共有ライブラリをラップする場合、 :func:`find_library` を使っ" +"て実行時にライブラリの場所を特定するのではなく、共有ライブラリの名前を開発時" +"に決めておいて、ラッパーモジュールにハードコードする方が良い *かもしれません" +"* 。" -#: ../../library/ctypes.rst:1419 -msgid "Listing loaded shared libraries" -msgstr "" - -#: ../../library/ctypes.rst:1421 -msgid "" -"When writing code that relies on code loaded from shared libraries, it can " -"be useful to know which shared libraries have already been loaded into the " -"current process." -msgstr "" - -#: ../../library/ctypes.rst:1425 -msgid "" -"The :mod:`!ctypes.util` module provides the :func:`~ctypes.util.dllist` " -"function, which calls the different APIs provided by the various platforms " -"to help determine which shared libraries have already been loaded into the " -"current process." -msgstr "" - -#: ../../library/ctypes.rst:1429 -msgid "" -"The exact output of this function will be system dependent. On most " -"platforms, the first entry of this list represents the current process " -"itself, which may be an empty string. For example, on glibc-based Linux, the " -"return may look like::" -msgstr "" - -#: ../../library/ctypes.rst:1434 -msgid "" -">>> from ctypes.util import dllist\n" -">>> dllist()\n" -"['', 'linux-vdso.so.1', '/lib/x86_64-linux-gnu/libm.so.6', '/lib/x86_64-" -"linux-gnu/libc.so.6', ... ]" -msgstr "" - -#: ../../library/ctypes.rst:1441 +#: ../../library/ctypes.rst:1317 msgid "Loading shared libraries" msgstr "共有ライブラリをロードする" -#: ../../library/ctypes.rst:1443 +#: ../../library/ctypes.rst:1319 msgid "" "There are several ways to load shared libraries into the Python process. " "One way is to instantiate one of the following classes:" @@ -2473,17 +1624,17 @@ msgstr "" "共有ライブラリを Python プロセスへロードする方法はいくつかあります。一つの方" "法は下記のクラスの一つをインスタンス化することです:" -#: ../../library/ctypes.rst:1449 +#: ../../library/ctypes.rst:1325 msgid "" "Instances of this class represent loaded shared libraries. Functions in " "these libraries use the standard C calling convention, and are assumed to " -"return :c:expr:`int`." +"return :c:type:`int`." msgstr "" "このクラスのインスタンスはロードされた共有ライブラリをあらわします。これらの" -"ライブラリの関数は標準 C 呼び出し規約を使用し、 :c:expr:`int` を返すと仮定さ" +"ライブラリの関数は標準 C 呼び出し規約を使用し、 :c:type:`int` を返すと仮定さ" "れます。" -#: ../../library/ctypes.rst:1453 +#: ../../library/ctypes.rst:1329 msgid "" "On Windows creating a :class:`CDLL` instance may fail even if the DLL name " "exists. When a dependent DLL of the loaded DLL is not found, a :exc:" @@ -2495,53 +1646,52 @@ msgid "" "determine which one is not found using Windows debugging and tracing tools." msgstr "" -#: ../../library/ctypes.rst:1465 ../../library/ctypes.rst:1490 -#: ../../library/ctypes.rst:1503 ../../library/ctypes.rst:1521 -msgid "The *name* parameter can now be a :term:`path-like object`." -msgstr "" - -#: ../../library/ctypes.rst:1469 +#: ../../library/ctypes.rst:1341 msgid "" "`Microsoft DUMPBIN tool `_ -- A tool to find DLL dependents." msgstr "" -#: ../../library/ctypes.rst:1475 +#: ../../library/ctypes.rst:1347 msgid "" -"Instances of this class represent loaded shared libraries, functions in " -"these libraries use the ``stdcall`` calling convention, and are assumed to " -"return the windows specific :class:`HRESULT` code. :class:`HRESULT` values " -"contain information specifying whether the function call failed or " -"succeeded, together with additional error code. If the return value signals " -"a failure, an :class:`OSError` is automatically raised." +"Windows only: Instances of this class represent loaded shared libraries, " +"functions in these libraries use the ``stdcall`` calling convention, and are " +"assumed to return the windows specific :class:`HRESULT` code. :class:" +"`HRESULT` values contain information specifying whether the function call " +"failed or succeeded, together with additional error code. If the return " +"value signals a failure, an :class:`OSError` is automatically raised." msgstr "" +"Windows 用: このクラスのインスタンスはロードされた共有ライブラリをあらわしま" +"す。これらのライブラリの関数は ``stdcall`` 呼び出し規約を使用し、 windows 固" +"有の :class:`HRESULT` コードを返すと仮定されます。 :class:`HRESULT` 値には関" +"数呼び出しが失敗したのか成功したのかを特定する情報とともに、補足のエラーコー" +"ドが含まれます。戻り値が失敗を知らせたならば、 :class:`OSError` が自動的に送" +"出されます。" -#: ../../library/ctypes.rst:1482 ../../library/ctypes.rst:1499 -#: ../../library/ctypes.rst:1643 ../../library/ctypes.rst:1651 -#: ../../library/ctypes.rst:1823 ../../library/ctypes.rst:1875 -#: ../../library/ctypes.rst:2027 ../../library/ctypes.rst:2099 -#: ../../library/ctypes.rst:2108 ../../library/ctypes.rst:2133 -#: ../../library/ctypes.rst:2147 ../../library/ctypes.rst:2156 -#: ../../library/ctypes.rst:2165 ../../library/ctypes.rst:2180 -#: ../../library/ctypes.rst:2247 ../../library/ctypes.rst:2274 -#: ../../library/ctypes.rst:2674 ../../library/ctypes.rst:3072 -msgid "Availability" -msgstr "" +#: ../../library/ctypes.rst:1354 +msgid ":exc:`WindowsError` used to be raised." +msgstr "以前は :exc:`WindowsError` を送出していました。" -#: ../../library/ctypes.rst:1484 +#: ../../library/ctypes.rst:1360 msgid "" -":exc:`WindowsError` used to be raised, which is now an alias of :exc:" -"`OSError`." +"Windows only: Instances of this class represent loaded shared libraries, " +"functions in these libraries use the ``stdcall`` calling convention, and are " +"assumed to return :c:type:`int` by default." msgstr "" +"Windows 用: このクラスのインスタンスはロードされた共有ライブラリをあらわしま" +"す。これらのライブラリの関数は ``stdcall`` 呼び出し規約を使用し、デフォルトで" +"は :c:type:`int` を返すと仮定されます。" -#: ../../library/ctypes.rst:1495 +#: ../../library/ctypes.rst:1364 msgid "" -"Instances of this class represent loaded shared libraries, functions in " -"these libraries use the ``stdcall`` calling convention, and are assumed to " -"return :c:expr:`int` by default." +"On Windows CE only the standard calling convention is used, for convenience " +"the :class:`WinDLL` and :class:`OleDLL` use the standard calling convention " +"on this platform." msgstr "" +"Windows CE では標準呼び出し規約だけが使われます。便宜上、このプラットフォーム" +"では、 :class:`WinDLL` と :class:`OleDLL` が標準呼び出し規約を使用します。" -#: ../../library/ctypes.rst:1506 +#: ../../library/ctypes.rst:1368 msgid "" "The Python :term:`global interpreter lock` is released before calling any " "function exported by these libraries, and reacquired afterwards." @@ -2549,7 +1699,7 @@ msgstr "" "これらのライブラリがエクスポートするどの関数でも呼び出す前に Python :term:" "`global interpreter lock` は解放され、後でまた獲得されます。" -#: ../../library/ctypes.rst:1512 +#: ../../library/ctypes.rst:1374 msgid "" "Instances of this class behave like :class:`CDLL` instances, except that the " "Python GIL is *not* released during the function call, and after the " @@ -2561,22 +1711,28 @@ msgstr "" "`CDLL` インスタンスのように振る舞います。エラーフラグがセットされた場合、 " "Python 例外が送出されます。" -#: ../../library/ctypes.rst:1517 +#: ../../library/ctypes.rst:1379 msgid "Thus, this is only useful to call Python C api functions directly." msgstr "" "要するに、これは Python C api 関数を直接呼び出すのに便利だというだけです。" -#: ../../library/ctypes.rst:1523 +#: ../../library/ctypes.rst:1381 msgid "" "All these classes can be instantiated by calling them with at least one " "argument, the pathname of the shared library. If you have an existing " "handle to an already loaded shared library, it can be passed as the " -"``handle`` named parameter, otherwise the underlying platform's :c:func:`!" -"dlopen` or :c:func:`!LoadLibrary` function is used to load the library into " -"the process, and to get a handle to it." +"``handle`` named parameter, otherwise the underlying platforms ``dlopen`` or " +"``LoadLibrary`` function is used to load the library into the process, and " +"to get a handle to it." msgstr "" +"これらすべてのクラスは少なくとも一つの引数、すなわちロードする共有ライブラリ" +"のパスを渡して呼び出すことでインスタンス化されます。すでにロード済みの共有ラ" +"イブラリへのハンドルがあるなら、 ``handle`` 名前付き引数として渡すことができ" +"ます。土台となっているプラットフォームの ``dlopen`` または ``LoadLibrary`` 関" +"数がプロセスへライブラリをロードするために使われ、そのライブラリに対するハン" +"ドルを得ます。" -#: ../../library/ctypes.rst:1530 +#: ../../library/ctypes.rst:1388 msgid "" "The *mode* parameter can be used to specify how the library is loaded. For " "details, consult the :manpage:`dlopen(3)` manpage. On Windows, *mode* is " @@ -2589,17 +1745,23 @@ msgstr "" "Windows では *mode* は無視されます。\n" "POSIX システムでは RTLD_NOW が常に追加され、設定変更はできません。" -#: ../../library/ctypes.rst:1535 +#: ../../library/ctypes.rst:1393 msgid "" "The *use_errno* parameter, when set to true, enables a ctypes mechanism that " "allows accessing the system :data:`errno` error number in a safe way. :mod:" -"`ctypes` maintains a thread-local copy of the system's :data:`errno` " +"`ctypes` maintains a thread-local copy of the systems :data:`errno` " "variable; if you call foreign functions created with ``use_errno=True`` then " "the :data:`errno` value before the function call is swapped with the ctypes " "private copy, the same happens immediately after the function call." msgstr "" +"*use_errno* 変数が真に設定されたとき、システムの :data:`errno` エラーナンバー" +"に安全にアクセスする ctypes の仕組みが有効化されます。 :mod:`ctypes` はシステ" +"ムの :data:`errno` 変数のスレッド限定のコピーを管理します。もし、 " +"``use_errno=True`` の状態で作られた外部関数を呼び出したなら、関数呼び出し前" +"の :data:`errno` 変数は ctypes のプライベートコピーと置き換えられ、同じことが" +"関数呼び出しの直後にも発生します。" -#: ../../library/ctypes.rst:1542 +#: ../../library/ctypes.rst:1400 msgid "" "The function :func:`ctypes.get_errno` returns the value of the ctypes " "private copy, and the function :func:`ctypes.set_errno` changes the ctypes " @@ -2609,30 +1771,35 @@ msgstr "" "して、 :func:`ctypes.set_errno` 関数は ctypes のプライベートコピーを置き換" "え、以前の値を返します。" -#: ../../library/ctypes.rst:1546 +#: ../../library/ctypes.rst:1404 msgid "" "The *use_last_error* parameter, when set to true, enables the same mechanism " "for the Windows error code which is managed by the :func:`GetLastError` and :" -"func:`!SetLastError` Windows API functions; :func:`ctypes.get_last_error` " +"func:`SetLastError` Windows API functions; :func:`ctypes.get_last_error` " "and :func:`ctypes.set_last_error` are used to request and change the ctypes " "private copy of the windows error code." msgstr "" +"*use_last_error* パラメータは、真に設定されたとき、 :func:`GetLastError` と :" +"func:`SetLastError` Windows API によって管理される Windows エラーコードに対す" +"るのと同じ仕組みが有効化されます。 :func:`ctypes.get_last_error` と :func:" +"`ctypes.set_last_error` は Windows エラーコードの ctypes プライベートコピーを" +"変更したり要求したりするのに使われます。" -#: ../../library/ctypes.rst:1552 +#: ../../library/ctypes.rst:1410 msgid "" "The *winmode* parameter is used on Windows to specify how the library is " "loaded (since *mode* is ignored). It takes any value that is valid for the " "Win32 API ``LoadLibraryEx`` flags parameter. When omitted, the default is to " -"use the flags that result in the most secure DLL load, which avoids issues " +"use the flags that result in the most secure DLL load to avoiding issues " "such as DLL hijacking. Passing the full path to the DLL is the safest way to " "ensure the correct library and dependencies are loaded." msgstr "" -#: ../../library/ctypes.rst:1559 +#: ../../library/ctypes.rst:1417 msgid "Added *winmode* parameter." msgstr "*winmode* 引数が追加されました。" -#: ../../library/ctypes.rst:1566 +#: ../../library/ctypes.rst:1424 msgid "" "Flag to use as *mode* parameter. On platforms where this flag is not " "available, it is defined as the integer zero." @@ -2640,7 +1807,7 @@ msgstr "" "*mode* パラメータとして使うフラグ。このフラグが利用できないプラットフォームで" "は、整数のゼロと定義されています。" -#: ../../library/ctypes.rst:1573 +#: ../../library/ctypes.rst:1431 msgid "" "Flag to use as *mode* parameter. On platforms where this is not available, " "it is the same as *RTLD_GLOBAL*." @@ -2648,7 +1815,7 @@ msgstr "" "*mode* パラメータとして使うフラグ。これが利用できないプラットフォームでは、 " "*RTLD_GLOBAL* と同様です。" -#: ../../library/ctypes.rst:1580 +#: ../../library/ctypes.rst:1438 msgid "" "The default mode which is used to load shared libraries. On OSX 10.3, this " "is *RTLD_GLOBAL*, otherwise it is the same as *RTLD_LOCAL*." @@ -2656,7 +1823,7 @@ msgstr "" "共有ライブラリをロードするために使われるデフォルトモード。 OSX 10.3 では " "*RTLD_GLOBAL* であり、そうでなければ *RTLD_LOCAL* と同じです。" -#: ../../library/ctypes.rst:1583 +#: ../../library/ctypes.rst:1441 msgid "" "Instances of these classes have no public methods. Functions exported by " "the shared library can be accessed as attributes or by index. Please note " @@ -2671,17 +1838,7 @@ msgstr "" "れると毎回同じオブジェクトを返すことに注意してください。\n" "それとは反対に、添字を通したアクセスは毎回新しいオブジェクトを返します::" -#: ../../library/ctypes.rst:1589 -msgid "" -">>> from ctypes import CDLL\n" -">>> libc = CDLL(\"libc.so.6\") # On Linux\n" -">>> libc.time == libc.time\n" -"True\n" -">>> libc['time'] == libc['time']\n" -"False" -msgstr "" - -#: ../../library/ctypes.rst:1596 +#: ../../library/ctypes.rst:1454 msgid "" "The following public attributes are available, their name starts with an " "underscore to not clash with exported function names:" @@ -2689,23 +1846,27 @@ msgstr "" "次に述べる公開属性が利用できます。それらの名前はエクスポートされた関数名に衝" "突しないように下線で始まります。:" -#: ../../library/ctypes.rst:1602 +#: ../../library/ctypes.rst:1460 msgid "The system handle used to access the library." msgstr "ライブラリへのアクセスに用いられるシステムハンドル。" -#: ../../library/ctypes.rst:1607 +#: ../../library/ctypes.rst:1465 msgid "The name of the library passed in the constructor." msgstr "コンストラクタに渡されたライブラリの名前。" -#: ../../library/ctypes.rst:1609 +#: ../../library/ctypes.rst:1467 msgid "" "Shared libraries can also be loaded by using one of the prefabricated " "objects, which are instances of the :class:`LibraryLoader` class, either by " -"calling the :meth:`~LibraryLoader.LoadLibrary` method, or by retrieving the " -"library as attribute of the loader instance." +"calling the :meth:`LoadLibrary` method, or by retrieving the library as " +"attribute of the loader instance." msgstr "" +"共有ライブラリは (:class:`LibraryLoader` クラスのインスタンスである) 前もって" +"作られたオブジェクトの一つを使うことによってロードすることもできます。それら" +"の :meth:`LoadLibrary` メソッドを呼び出すか、ローダーインスタンスの属性として" +"ライブラリを取り出すかのどちらかによりロードします。" -#: ../../library/ctypes.rst:1617 +#: ../../library/ctypes.rst:1475 msgid "" "Class which loads shared libraries. *dlltype* should be one of the :class:" "`CDLL`, :class:`PyDLL`, :class:`WinDLL`, or :class:`OleDLL` types." @@ -2713,15 +1874,18 @@ msgstr "" "共有ライブラリをロードするクラス。 *dlltype* は :class:`CDLL` 、 :class:" "`PyDLL` 、 :class:`WinDLL` もしくは :class:`OleDLL` 型の一つであるべきです。" -#: ../../library/ctypes.rst:1620 +#: ../../library/ctypes.rst:1478 msgid "" -":meth:`!__getattr__` has special behavior: It allows loading a shared " -"library by accessing it as attribute of a library loader instance. The " -"result is cached, so repeated attribute accesses return the same library " -"each time." +":meth:`__getattr__` has special behavior: It allows loading a shared library " +"by accessing it as attribute of a library loader instance. The result is " +"cached, so repeated attribute accesses return the same library each time." msgstr "" +":meth:`__getattr__` は次のような特別なはたらきをします。ライブラリローダーイ" +"ンスタンスの属性として共有ライブラリにアクセスするとそれがロードされるという" +"ことを可能にします。結果はキャッシュされます。そのため、繰り返し属性アクセス" +"を行うといつも同じライブラリが返されます。" -#: ../../library/ctypes.rst:1626 +#: ../../library/ctypes.rst:1484 msgid "" "Load a shared library into the process and return it. This method always " "returns a new instance of the library." @@ -2729,27 +1893,27 @@ msgstr "" "共有ライブラリをプロセスへロードし、それを返します。このメソッドはライブラリ" "の新しいインスタンスを常に返します。" -#: ../../library/ctypes.rst:1630 +#: ../../library/ctypes.rst:1488 msgid "These prefabricated library loaders are available:" msgstr "これらの前もって作られたライブラリローダーを利用することができます。:" -#: ../../library/ctypes.rst:1635 +#: ../../library/ctypes.rst:1493 msgid "Creates :class:`CDLL` instances." msgstr ":class:`CDLL` インスタンスを作ります。" -#: ../../library/ctypes.rst:1641 -msgid "Creates :class:`WinDLL` instances." -msgstr "" +#: ../../library/ctypes.rst:1499 +msgid "Windows only: Creates :class:`WinDLL` instances." +msgstr "Windows 用: :class:`WinDLL` インスタンスを作ります。" -#: ../../library/ctypes.rst:1649 -msgid "Creates :class:`OleDLL` instances." -msgstr "" +#: ../../library/ctypes.rst:1505 +msgid "Windows only: Creates :class:`OleDLL` instances." +msgstr "Windows 用: :class:`OleDLL` インスタンスを作ります。" -#: ../../library/ctypes.rst:1657 +#: ../../library/ctypes.rst:1511 msgid "Creates :class:`PyDLL` instances." msgstr ":class:`PyDLL` インスタンスを作ります。" -#: ../../library/ctypes.rst:1660 +#: ../../library/ctypes.rst:1514 msgid "" "For accessing the C Python api directly, a ready-to-use Python shared " "library object is available:" @@ -2757,69 +1921,86 @@ msgstr "" "C Python api に直接アクセスするために、すぐに使用できる Python 共有ライブラリ" "オブジェクトが次のように用意されています。" -#: ../../library/ctypes.rst:1666 +#: ../../library/ctypes.rst:1520 msgid "" "An instance of :class:`PyDLL` that exposes Python C API functions as " -"attributes. Note that all these functions are assumed to return C :c:expr:" +"attributes. Note that all these functions are assumed to return C :c:type:" "`int`, which is of course not always the truth, so you have to assign the " -"correct :attr:`!restype` attribute to use these functions." +"correct :attr:`restype` attribute to use these functions." +msgstr "" +"属性として Python C api 関数を公開する :class:`PyDLL` のインスタンス。これら" +"すべての関数は C :c:type:`int` を返すと仮定されますが、もちろん常に正しいとは" +"限りません。そのため、これらの関数を使うためには正しい :attr:`restype` 属性を" +"代入しなければなりません。" + +#: ../../library/ctypes.rst:1525 +msgid "" +"Raises an :ref:`auditing event ` ``ctypes.dlopen`` with argument " +"``name``." msgstr "" +"引数 ``name`` を指定して :ref:`監査イベント ` ``ctypes.dlopen`` を" +"送出します。" -#: ../../library/ctypes.rst:1671 ../../library/ctypes.rst:1673 +#: ../../library/ctypes.rst:1527 msgid "" "Loading a library through any of these objects raises an :ref:`auditing " "event ` ``ctypes.dlopen`` with string argument ``name``, the name " "used to load the library." msgstr "" -#: ../../library/ctypes.rst:1677 ../../library/ctypes.rst:1679 +#: ../../library/ctypes.rst:1531 +msgid "" +"Raises an :ref:`auditing event ` ``ctypes.dlsym`` with arguments " +"``library``, ``name``." +msgstr "" +"引数 ``library``, ``name`` を指定して :ref:`監査イベント ` " +"``ctypes.dlsym`` を送出します。" + +#: ../../library/ctypes.rst:1533 msgid "" "Accessing a function on a loaded library raises an auditing event ``ctypes." "dlsym`` with arguments ``library`` (the library object) and ``name`` (the " "symbol's name as a string or integer)." msgstr "" -#: ../../library/ctypes.rst:1683 ../../library/ctypes.rst:1685 +#: ../../library/ctypes.rst:1537 +msgid "" +"Raises an :ref:`auditing event ` ``ctypes.dlsym/handle`` with " +"arguments ``handle``, ``name``." +msgstr "" +"引数 ``handle``, ``name`` を指定して :ref:`監査イベント ` ``ctypes." +"dlsym/handle`` を送出します。" + +#: ../../library/ctypes.rst:1539 msgid "" "In cases when only the library handle is available rather than the object, " "accessing a function raises an auditing event ``ctypes.dlsym/handle`` with " "arguments ``handle`` (the raw library handle) and ``name``." msgstr "" -#: ../../library/ctypes.rst:1692 +#: ../../library/ctypes.rst:1546 msgid "Foreign functions" msgstr "外部関数" -#: ../../library/ctypes.rst:1694 +#: ../../library/ctypes.rst:1548 msgid "" "As explained in the previous section, foreign functions can be accessed as " "attributes of loaded shared libraries. The function objects created in this " "way by default accept any number of arguments, accept any ctypes data " "instances as arguments, and return the default result type specified by the " -"library loader." +"library loader. They are instances of a private class:" msgstr "" +"前節で説明した通り、外部関数はロードされた共有ライブラリの属性としてアクセス" +"できます。デフォルトではこの方法で作成された関数オブジェクトはどんな数の引数" +"でも受け取り、引数としてどんな ctypes データのインスタンスをも受け取り、そし" +"て、ライブラリローダーが指定したデフォルトの結果の値の型を返します。関数オブ" +"ジェクトはプライベートクラスのインスタンスです。:" -#: ../../library/ctypes.rst:1699 -msgid "" -"They are instances of a private local class :class:`!_FuncPtr` (not exposed " -"in :mod:`!ctypes`) which inherits from the private :class:`_CFuncPtr` class:" -msgstr "" - -#: ../../library/ctypes.rst:1702 -msgid "" -">>> import ctypes\n" -">>> lib = ctypes.CDLL(None)\n" -">>> issubclass(lib._FuncPtr, ctypes._CFuncPtr)\n" -"True\n" -">>> lib._FuncPtr is ctypes._CFuncPtr\n" -"False" -msgstr "" - -#: ../../library/ctypes.rst:1713 +#: ../../library/ctypes.rst:1557 msgid "Base class for C callable foreign functions." msgstr "C の呼び出し可能外部関数のためのベースクラス。" -#: ../../library/ctypes.rst:1715 +#: ../../library/ctypes.rst:1559 msgid "" "Instances of foreign functions are also C compatible data types; they " "represent C function pointers." @@ -2827,7 +2008,7 @@ msgstr "" "外部関数のインスタンスも C 互換データ型です。それらは C の関数ポインタを表し" "ています。" -#: ../../library/ctypes.rst:1718 +#: ../../library/ctypes.rst:1562 msgid "" "This behavior can be customized by assigning to special attributes of the " "foreign function object." @@ -2835,25 +2016,31 @@ msgstr "" "この振る舞いは外部関数オブジェクトの特別な属性に代入することによって、カスタ" "マイズすることができます。" -#: ../../library/ctypes.rst:1723 +#: ../../library/ctypes.rst:1567 msgid "" "Assign a ctypes type to specify the result type of the foreign function. Use " -"``None`` for :c:expr:`void`, a function not returning anything." +"``None`` for :c:type:`void`, a function not returning anything." msgstr "" "外部関数の結果の型を指定するために ctypes 型を代入する。何も返さない関数を表" -"す :c:expr:`void` に対しては ``None`` を使います。" +"す :c:type:`void` に対しては ``None`` を使います。" -#: ../../library/ctypes.rst:1726 +#: ../../library/ctypes.rst:1570 msgid "" "It is possible to assign a callable Python object that is not a ctypes type, " -"in this case the function is assumed to return a C :c:expr:`int`, and the " +"in this case the function is assumed to return a C :c:type:`int`, and the " "callable will be called with this integer, allowing further processing or " "error checking. Using this is deprecated, for more flexible post processing " -"or error checking use a ctypes data type as :attr:`!restype` and assign a " +"or error checking use a ctypes data type as :attr:`restype` and assign a " "callable to the :attr:`errcheck` attribute." msgstr "" +"ctypes 型ではない呼び出し可能な Python オブジェクトを代入することは可能です。" +"このような場合、関数が C :c:type:`int` を返すと仮定され、呼び出し可能オブジェ" +"クトはこの整数を引数に呼び出されます。さらに処理を行ったり、エラーチェックを" +"したりできるようにするためです。これの使用は推奨されません。より柔軟な後処理" +"やエラーチェックのためには :attr:`restype` として ctypes 型を使い、 :attr:" +"`errcheck` 属性へ呼び出し可能オブジェクトを代入してください。" -#: ../../library/ctypes.rst:1735 +#: ../../library/ctypes.rst:1579 msgid "" "Assign a tuple of ctypes types to specify the argument types that the " "function accepts. Functions using the ``stdcall`` calling convention can " @@ -2865,25 +2052,35 @@ msgstr "" "``stdcall`` 呼び出し規約を使う関数はこのタプルの長さと同じ数の引数で呼び出さ" "れます。C 呼び出し規約を使う関数は、追加の不特定の引数も取ります。" -#: ../../library/ctypes.rst:1741 +#: ../../library/ctypes.rst:1585 msgid "" "When a foreign function is called, each actual argument is passed to the :" -"meth:`~_CData.from_param` class method of the items in the :attr:`argtypes` " -"tuple, this method allows adapting the actual argument to an object that the " +"meth:`from_param` class method of the items in the :attr:`argtypes` tuple, " +"this method allows adapting the actual argument to an object that the " "foreign function accepts. For example, a :class:`c_char_p` item in the :" "attr:`argtypes` tuple will convert a string passed as argument into a bytes " "object using ctypes conversion rules." msgstr "" +"外部関数が呼ばれたとき、それぞれの実引数は :attr:`argtypes` タプルの要素の :" +"meth:`from_param` クラスメソッドへ渡されます。このメソッドは実引数を外部関数" +"が受け取るオブジェクトに合わせて変えられるようにします。例えば、 :attr:" +"`argtypes` タプルの :class:`c_char_p` 要素は、 ctypes 変換規則にしたがって引" +"数として渡された文字列をバイト列オブジェクトへ変換するでしょう。" -#: ../../library/ctypes.rst:1748 +#: ../../library/ctypes.rst:1592 msgid "" "New: It is now possible to put items in argtypes which are not ctypes types, " -"but each item must have a :meth:`~_CData.from_param` method which returns a " -"value usable as argument (integer, string, ctypes instance). This allows " -"defining adapters that can adapt custom objects as function parameters." -msgstr "" +"but each item must have a :meth:`from_param` method which returns a value " +"usable as argument (integer, string, ctypes instance). This allows defining " +"adapters that can adapt custom objects as function parameters." +msgstr "" +"新: ctypes 型でない要素を argtypes に入れることができますが、個々の要素は引数" +"として使える値 (整数、文字列、 ctypes インスタンス) を返す :meth:" +"`from_param` メソッドを持っていなければなりません。これにより関数パラメータと" +"してカスタムオブジェクトを適合するように変更できるアダプタが定義可能となりま" +"す。" -#: ../../library/ctypes.rst:1755 +#: ../../library/ctypes.rst:1599 msgid "" "Assign a Python function or another callable to this attribute. The callable " "will be called with three or more arguments:" @@ -2891,13 +2088,13 @@ msgstr "" "Python 関数または他の呼び出し可能オブジェクトをこの属性に代入します。呼び出し" "可能オブジェクトは三つ以上の引数とともに呼び出されます。" -#: ../../library/ctypes.rst:1762 +#: ../../library/ctypes.rst:1606 msgid "" -"*result* is what the foreign function returns, as specified by the :attr:`!" -"restype` attribute." -msgstr "" +"*result* is what the foreign function returns, as specified by the :attr:" +"`restype` attribute." +msgstr "*result* は外部関数が返すもので、 :attr:`restype` 属性で指定されます。" -#: ../../library/ctypes.rst:1765 +#: ../../library/ctypes.rst:1609 msgid "" "*func* is the foreign function object itself, this allows reusing the same " "callable object to check or post process the results of several functions." @@ -2906,7 +2103,7 @@ msgstr "" "または後処理するために、同じ呼び出し可能オブジェクトを再利用できるようになり" "ます。" -#: ../../library/ctypes.rst:1769 +#: ../../library/ctypes.rst:1613 msgid "" "*arguments* is a tuple containing the parameters originally passed to the " "function call, this allows specializing the behavior on the arguments used." @@ -2915,7 +2112,7 @@ msgstr "" "により使われた引数に基づいた特別な振る舞いをさせることができるようになりま" "す。" -#: ../../library/ctypes.rst:1773 +#: ../../library/ctypes.rst:1617 msgid "" "The object that this function returns will be returned from the foreign " "function call, but it can also check the result value and raise an exception " @@ -2925,27 +2122,51 @@ msgstr "" "戻り値をチェックして、外部関数呼び出しが失敗しているなら例外を送出させること" "もできます。" -#: ../../library/ctypes.rst:1778 ../../library/ctypes.rst:1780 +#: ../../library/ctypes.rst:1624 +msgid "" +"This exception is raised when a foreign function call cannot convert one of " +"the passed arguments." +msgstr "" +"この例外は外部関数呼び出しが渡された引数を変換できなかったときに送出されま" +"す。" + +#: ../../library/ctypes.rst:1628 +msgid "" +"Raises an :ref:`auditing event ` ``ctypes.seh_exception`` with " +"argument ``code``." +msgstr "" +"引数 ``code`` を指定して :ref:`監査イベント ` ``ctypes." +"seh_exception`` を送出します。 " + +#: ../../library/ctypes.rst:1630 msgid "" "On Windows, when a foreign function call raises a system exception (for " "example, due to an access violation), it will be captured and replaced with " "a suitable Python exception. Further, an auditing event ``ctypes." -"set_exception`` with argument ``code`` will be raised, allowing an audit " +"seh_exception`` with argument ``code`` will be raised, allowing an audit " "hook to replace the exception with its own." msgstr "" -#: ../../library/ctypes.rst:1786 ../../library/ctypes.rst:1788 +#: ../../library/ctypes.rst:1636 +msgid "" +"Raises an :ref:`auditing event ` ``ctypes.call_function`` with " +"arguments ``func_pointer``, ``arguments``." +msgstr "" +"引数 ``func_pointer``, ``arguments`` を指定して :ref:`監査イベント " +"` ``ctypes.call_function`` を送出します。 " + +#: ../../library/ctypes.rst:1638 msgid "" -"Some ways to invoke foreign function calls as well as some of the functions " -"in this module may raise an auditing event ``ctypes.call_function`` with " -"arguments ``function pointer`` and ``arguments``." +"Some ways to invoke foreign function calls may raise an auditing event " +"``ctypes.call_function`` with arguments ``function pointer`` and " +"``arguments``." msgstr "" -#: ../../library/ctypes.rst:1795 +#: ../../library/ctypes.rst:1644 msgid "Function prototypes" msgstr "関数プロトタイプ" -#: ../../library/ctypes.rst:1797 +#: ../../library/ctypes.rst:1646 msgid "" "Foreign functions can also be created by instantiating function prototypes. " "Function prototypes are similar to function prototypes in C; they describe a " @@ -2963,7 +2184,7 @@ msgstr "" "他の関数に適用できます。\n" "例については :ref:`ctypes-callback-functions` を参照してください。" -#: ../../library/ctypes.rst:1808 +#: ../../library/ctypes.rst:1657 msgid "" "The returned function prototype creates functions that use the standard C " "calling convention. The function will release the GIL during the call. If " @@ -2977,14 +2198,20 @@ msgstr "" "data:`errno` の値と交換されます。 *use_last_error* も Windows エラーコードに" "対するのと同様です。" -#: ../../library/ctypes.rst:1818 +#: ../../library/ctypes.rst:1667 msgid "" -"The returned function prototype creates functions that use the ``stdcall`` " -"calling convention. The function will release the GIL during the call. " -"*use_errno* and *use_last_error* have the same meaning as above." +"Windows only: The returned function prototype creates functions that use the " +"``stdcall`` calling convention, except on Windows CE where :func:" +"`WINFUNCTYPE` is the same as :func:`CFUNCTYPE`. The function will release " +"the GIL during the call. *use_errno* and *use_last_error* have the same " +"meaning as above." msgstr "" +"Windows のみ: 返された関数プロトタイプは ``stdcall`` 呼び出し規約を使う関数を" +"作成します。ただし、 :func:`WINFUNCTYPE` が :func:`CFUNCTYPE` と同じである " +"Windows CE を除きます。関数は呼び出されている間 GIL を解放します。 " +"*use_errno* と *use_last_error* は前述と同じ意味を持ちます。" -#: ../../library/ctypes.rst:1828 +#: ../../library/ctypes.rst:1676 msgid "" "The returned function prototype creates functions that use the Python " "calling convention. The function will *not* release the GIL during the call." @@ -2992,7 +2219,7 @@ msgstr "" "返された関数プロトタイプは Python 呼び出し規約を使う関数を作成します。関数は" "呼び出されている間 GIL を解放 *しません*。" -#: ../../library/ctypes.rst:1831 +#: ../../library/ctypes.rst:1679 msgid "" "Function prototypes created by these factory functions can be instantiated " "in different ways, depending on the type and number of the parameters in the " @@ -3001,19 +2228,19 @@ msgstr "" "ファクトリ関数によって作られた関数プロトタイプは呼び出しのパラメータの型と数" "に依存した別の方法でインスタンス化することができます。 :" -#: ../../library/ctypes.rst:1838 +#: ../../library/ctypes.rst:1687 msgid "" "Returns a foreign function at the specified address which must be an integer." msgstr "指定されたアドレス(整数でなくてはなりません)の外部関数を返します。" -#: ../../library/ctypes.rst:1845 +#: ../../library/ctypes.rst:1694 msgid "" "Create a C callable function (a callback function) from a Python *callable*." msgstr "" "Python の *callable* から C の呼び出し可能関数(コールバック関数) を作成しま" "す。" -#: ../../library/ctypes.rst:1852 +#: ../../library/ctypes.rst:1701 msgid "" "Returns a foreign function exported by a shared library. *func_spec* must be " "a 2-tuple ``(name_or_ordinal, library)``. The first item is the name of the " @@ -3025,7 +2252,7 @@ msgstr "" "スポートされた関数の名前である文字列、またはエクスポートされた関数の序数であ" "る小さい整数です。第二要素は共有ライブラリインスタンスです。" -#: ../../library/ctypes.rst:1862 +#: ../../library/ctypes.rst:1711 msgid "" "Returns a foreign function that will call a COM method. *vtbl_index* is the " "index into the virtual function table, a small non-negative integer. *name* " @@ -3037,21 +2264,17 @@ msgstr "" "*iid* はオプションのインターフェイス識別子へのポインタで、拡張されたエラー情" "報の提供のために使われます。" -#: ../../library/ctypes.rst:1867 -msgid "" -"If *iid* is not specified, an :exc:`OSError` is raised if the COM method " -"call fails. If *iid* is specified, a :exc:`~ctypes.COMError` is raised " -"instead." -msgstr "" - -#: ../../library/ctypes.rst:1871 +#: ../../library/ctypes.rst:1716 msgid "" "COM methods use a special calling convention: They require a pointer to the " "COM interface as first argument, in addition to those parameters that are " -"specified in the :attr:`!argtypes` tuple." +"specified in the :attr:`argtypes` tuple." msgstr "" +"COM メソッドは特殊な呼び出し規約を用います。このメソッドは :attr:`argtypes` " +"タプルに指定されたパラメータに加えて、第一引数として COM インターフェイスへの" +"ポインタを必要とします。" -#: ../../library/ctypes.rst:1878 +#: ../../library/ctypes.rst:1720 msgid "" "The optional *paramflags* parameter creates foreign function wrappers with " "much more functionality than the features described above." @@ -3059,13 +2282,12 @@ msgstr "" "オプションの *paramflags* パラメータは上述した機能より多機能な外部関数ラッ" "パーを作成します。" -#: ../../library/ctypes.rst:1881 -msgid "" -"*paramflags* must be a tuple of the same length as :attr:`~_CFuncPtr." -"argtypes`." +#: ../../library/ctypes.rst:1723 +msgid "*paramflags* must be a tuple of the same length as :attr:`argtypes`." msgstr "" +"*paramflags* は :attr:`argtypes` と同じ長さのタプルでなければなりません。" -#: ../../library/ctypes.rst:1883 +#: ../../library/ctypes.rst:1725 msgid "" "Each item in this tuple contains further information about a parameter, it " "must be a tuple containing one, two, or three items." @@ -3073,37 +2295,37 @@ msgstr "" "このタプルの個々の要素はパラメータについてのより詳細な情報を持ち、 1 、 2 も" "しくは 3 要素を含むタプルでなければなりません。" -#: ../../library/ctypes.rst:1886 +#: ../../library/ctypes.rst:1728 msgid "" "The first item is an integer containing a combination of direction flags for " "the parameter:" msgstr "第一要素はパラメータについてのフラグの組み合わせを含んだ整数です。" -#: ../../library/ctypes.rst:1889 +#: ../../library/ctypes.rst:1732 msgid "1" msgstr "1" -#: ../../library/ctypes.rst:1890 +#: ../../library/ctypes.rst:1732 msgid "Specifies an input parameter to the function." msgstr "入力パラメータを関数に指定します。" -#: ../../library/ctypes.rst:1892 +#: ../../library/ctypes.rst:1735 msgid "2" msgstr "2" -#: ../../library/ctypes.rst:1893 +#: ../../library/ctypes.rst:1735 msgid "Output parameter. The foreign function fills in a value." msgstr "出力パラメータ。外部関数が値を書き込みます。" -#: ../../library/ctypes.rst:1895 +#: ../../library/ctypes.rst:1738 msgid "4" msgstr "4" -#: ../../library/ctypes.rst:1896 +#: ../../library/ctypes.rst:1738 msgid "Input parameter which defaults to the integer zero." msgstr "デフォルトで整数ゼロになる入力パラメータ。" -#: ../../library/ctypes.rst:1898 +#: ../../library/ctypes.rst:1740 msgid "" "The optional second item is the parameter name as string. If this is " "specified, the foreign function can be called with named parameters." @@ -3111,55 +2333,31 @@ msgstr "" "オプションの第二要素はパラメータ名の文字列です。これが指定された場合は、外部" "関数を名前付きパラメータで呼び出すことができます。" -#: ../../library/ctypes.rst:1901 +#: ../../library/ctypes.rst:1743 msgid "The optional third item is the default value for this parameter." msgstr "オプションの第三要素はこのパラメータのデフォルト値です。" -#: ../../library/ctypes.rst:1904 +#: ../../library/ctypes.rst:1745 msgid "" -"The following example demonstrates how to wrap the Windows ``MessageBoxW`` " -"function so that it supports default parameters and named arguments. The C " +"This example demonstrates how to wrap the Windows ``MessageBoxW`` function " +"so that it supports default parameters and named arguments. The C " "declaration from the windows header file is this::" msgstr "" +"この例では、デフォルトパラメータと名前付き引数をサポートするために Windows " +"の ``MessageBoxW`` 関数をラップする方法を示します。\n" +"windows のヘッダファイルの C の宣言は次の通りです::" -#: ../../library/ctypes.rst:1908 -msgid "" -"WINUSERAPI int WINAPI\n" -"MessageBoxW(\n" -" HWND hWnd,\n" -" LPCWSTR lpText,\n" -" LPCWSTR lpCaption,\n" -" UINT uType);" -msgstr "" - -#: ../../library/ctypes.rst:1915 ../../library/ctypes.rst:1938 +#: ../../library/ctypes.rst:1756 ../../library/ctypes.rst:1779 msgid "Here is the wrapping with :mod:`ctypes`::" msgstr ":mod:`ctypes` を使ってラップします。::" -#: ../../library/ctypes.rst:1917 -msgid "" -">>> from ctypes import c_int, WINFUNCTYPE, windll\n" -">>> from ctypes.wintypes import HWND, LPCWSTR, UINT\n" -">>> prototype = WINFUNCTYPE(c_int, HWND, LPCWSTR, LPCWSTR, UINT)\n" -">>> paramflags = (1, \"hwnd\", 0), (1, \"text\", \"Hi\"), (1, \"caption\", " -"\"Hello from ctypes\"), (1, \"flags\", 0)\n" -">>> MessageBox = prototype((\"MessageBoxW\", windll.user32), paramflags)" -msgstr "" - -#: ../../library/ctypes.rst:1923 +#: ../../library/ctypes.rst:1764 msgid "The ``MessageBox`` foreign function can now be called in these ways::" msgstr "" "これで外部関数の ``MessageBox`` を次のような方法で呼び出すことができるように" "なりました::" -#: ../../library/ctypes.rst:1925 -msgid "" -">>> MessageBox()\n" -">>> MessageBox(text=\"Spam, spam, spam\")\n" -">>> MessageBox(flags=2, text=\"foo bar\")" -msgstr "" - -#: ../../library/ctypes.rst:1929 +#: ../../library/ctypes.rst:1770 msgid "" "A second example demonstrates output parameters. The win32 " "``GetWindowRect`` function retrieves the dimensions of a specified window by " @@ -3170,26 +2368,7 @@ msgstr "" "数は、指定されたウィンドウの大きさを呼び出し側が与える ``RECT`` 構造体へコ" "ピーすることで取り出します。 C の宣言はこうです。::" -#: ../../library/ctypes.rst:1933 -msgid "" -"WINUSERAPI BOOL WINAPI\n" -"GetWindowRect(\n" -" HWND hWnd,\n" -" LPRECT lpRect);" -msgstr "" - -#: ../../library/ctypes.rst:1940 -msgid "" -">>> from ctypes import POINTER, WINFUNCTYPE, windll, WinError\n" -">>> from ctypes.wintypes import BOOL, HWND, RECT\n" -">>> prototype = WINFUNCTYPE(BOOL, HWND, POINTER(RECT))\n" -">>> paramflags = (1, \"hwnd\"), (2, \"lprect\")\n" -">>> GetWindowRect = prototype((\"GetWindowRect\", windll.user32), " -"paramflags)\n" -">>>" -msgstr "" - -#: ../../library/ctypes.rst:1947 +#: ../../library/ctypes.rst:1788 msgid "" "Functions with output parameters will automatically return the output " "parameter value if there is a single one, or a tuple containing the output " @@ -3201,52 +2380,38 @@ msgstr "" "れ自動的に返します。そのため、GetWindowRect 関数は呼び出されると RECT インス" "タンスを返します。" -#: ../../library/ctypes.rst:1952 +#: ../../library/ctypes.rst:1793 msgid "" -"Output parameters can be combined with the :attr:`~_CFuncPtr.errcheck` " -"protocol to do further output processing and error checking. The win32 " -"``GetWindowRect`` api function returns a ``BOOL`` to signal success or " -"failure, so this function could do the error checking, and raises an " -"exception when the api call failed::" +"Output parameters can be combined with the :attr:`errcheck` protocol to do " +"further output processing and error checking. The win32 ``GetWindowRect`` " +"api function returns a ``BOOL`` to signal success or failure, so this " +"function could do the error checking, and raises an exception when the api " +"call failed::" msgstr "" +"さらに出力処理やエラーチェックを行うために、出力パラメータを :attr:" +"`errcheck` プロトコルと組み合わせることができます。 win32 ``GetWindowRect`` " +"api 関数は成功したか失敗したかを知らせるために ``BOOL`` を返します。そのた" +"め、この関数はエラーチェックを行って、 api 呼び出しが失敗した場合に例外を送出" +"させることができます。::" -#: ../../library/ctypes.rst:1957 +#: ../../library/ctypes.rst:1806 msgid "" -">>> def errcheck(result, func, args):\n" -"... if not result:\n" -"... raise WinError()\n" -"... return args\n" -"...\n" -">>> GetWindowRect.errcheck = errcheck\n" -">>>" -msgstr "" - -#: ../../library/ctypes.rst:1965 -msgid "" -"If the :attr:`~_CFuncPtr.errcheck` function returns the argument tuple it " -"receives unchanged, :mod:`ctypes` continues the normal processing it does on " -"the output parameters. If you want to return a tuple of window coordinates " +"If the :attr:`errcheck` function returns the argument tuple it receives " +"unchanged, :mod:`ctypes` continues the normal processing it does on the " +"output parameters. If you want to return a tuple of window coordinates " "instead of a ``RECT`` instance, you can retrieve the fields in the function " "and return them instead, the normal processing will no longer take place::" msgstr "" +":attr:`errcheck` 関数が受け取った引数タプルを変更なしに返した場合、 :mod:" +"`ctypes` は出力パラメータに対する通常の処理を続けます。 ``RECT`` インスタンス" +"の代わりに window 座標のタプルを返すには、関数のフィールドを取り出し、代わり" +"にそれらを返すことができます。この場合、通常処理は行われなくなります::" -#: ../../library/ctypes.rst:1971 -msgid "" -">>> def errcheck(result, func, args):\n" -"... if not result:\n" -"... raise WinError()\n" -"... rc = args[1]\n" -"... return rc.left, rc.top, rc.bottom, rc.right\n" -"...\n" -">>> GetWindowRect.errcheck = errcheck\n" -">>>" -msgstr "" - -#: ../../library/ctypes.rst:1984 +#: ../../library/ctypes.rst:1825 msgid "Utility functions" msgstr "ユーティリティー関数" -#: ../../library/ctypes.rst:1988 +#: ../../library/ctypes.rst:1829 msgid "" "Returns the address of the memory buffer as integer. *obj* must be an " "instance of a ctypes type." @@ -3254,7 +2419,7 @@ msgstr "" "メモリバッファのアドレスを示す整数を返します。 *obj* は ctypes 型のインスタン" "スでなければなりません。" -#: ../../library/ctypes.rst:1991 +#: ../../library/ctypes.rst:1832 msgid "" "Raises an :ref:`auditing event ` ``ctypes.addressof`` with " "argument ``obj``." @@ -3262,7 +2427,7 @@ msgstr "" "引数 ``obj`` を指定して :ref:`監査イベント ` ``ctypes.addressof`` " "を送出します。 " -#: ../../library/ctypes.rst:1996 +#: ../../library/ctypes.rst:1837 msgid "" "Returns the alignment requirements of a ctypes type. *obj_or_type* must be a " "ctypes type or instance." @@ -3270,7 +2435,7 @@ msgstr "" "ctypes 型のアライメントの必要条件を返します。 *obj_or_type* は ctypes 型また" "はインスタンスでなければなりません。" -#: ../../library/ctypes.rst:2002 +#: ../../library/ctypes.rst:1843 msgid "" "Returns a light-weight pointer to *obj*, which must be an instance of a " "ctypes type. *offset* defaults to zero, and must be an integer that will be " @@ -3279,16 +2444,12 @@ msgstr "" "*obj* (ctypes 型のインスタンスでなければならない) への軽量ポインタを返しま" "す。 *offset* はデフォルトでは 0 で、内部ポインターへ加算される整数です。" -#: ../../library/ctypes.rst:2006 +#: ../../library/ctypes.rst:1847 msgid "``byref(obj, offset)`` corresponds to this C code::" msgstr "" "``byref(obj, offset)`` は、 C コードとしては、以下のようにみなされます。::" -#: ../../library/ctypes.rst:2008 -msgid "(((char *)&obj) + offset)" -msgstr "" - -#: ../../library/ctypes.rst:2010 +#: ../../library/ctypes.rst:1851 msgid "" "The returned object can only be used as a foreign function call parameter. " "It behaves similar to ``pointer(obj)``, but the construction is a lot faster." @@ -3296,27 +2457,7 @@ msgstr "" "返されるオブジェクトは外部関数呼び出しのパラメータとしてのみ使用できます。" "``pointer(obj)`` と似たふるまいをしますが、作成が非常に速く行えます。" -#: ../../library/ctypes.rst:2016 -msgid "" -"Copies a COM pointer from *src* to *dst* and returns the Windows specific :c:" -"type:`!HRESULT` value." -msgstr "" - -#: ../../library/ctypes.rst:2019 -msgid "" -"If *src* is not ``NULL``, its ``AddRef`` method is called, incrementing the " -"reference count." -msgstr "" - -#: ../../library/ctypes.rst:2022 -msgid "" -"In contrast, the reference count of *dst* will not be decremented before " -"assigning the new value. Unless *dst* is ``NULL``, the caller is responsible " -"for decrementing the reference count by calling its ``Release`` method when " -"necessary." -msgstr "" - -#: ../../library/ctypes.rst:2034 +#: ../../library/ctypes.rst:1857 msgid "" "This function is similar to the cast operator in C. It returns a new " "instance of *type* which points to the same memory block as *obj*. *type* " @@ -3327,7 +2468,7 @@ msgstr "" "いる *type* の新しいインスタンスを返します。*type* はポインタ型でなければなら" "ず、*obj* はポインタとして解釈できるオブジェクトでなければなりません。" -#: ../../library/ctypes.rst:2043 +#: ../../library/ctypes.rst:1865 msgid "" "This function creates a mutable character buffer. The returned object is a " "ctypes array of :class:`c_char`." @@ -3335,57 +2476,28 @@ msgstr "" "この関数は変更可能な文字バッファを作成します。返されるオブジェクトは :class:" "`c_char` の ctypes 配列です。" -#: ../../library/ctypes.rst:2046 -msgid "" -"If *size* is given (and not ``None``), it must be an :class:`int`. It " -"specifies the size of the returned array." -msgstr "" - -#: ../../library/ctypes.rst:2049 -msgid "" -"If the *init* argument is given, it must be :class:`bytes`. It is used to " -"initialize the array items. Bytes not initialized this way are set to zero " -"(NUL)." -msgstr "" - -#: ../../library/ctypes.rst:2053 -msgid "" -"If *size* is not given (or if it is ``None``), the buffer is made one " -"element larger than *init*, effectively adding a NUL terminator." -msgstr "" - -#: ../../library/ctypes.rst:2056 +#: ../../library/ctypes.rst:1868 msgid "" -"If both arguments are given, *size* must not be less than ``len(init)``." +"*init_or_size* must be an integer which specifies the size of the array, or " +"a bytes object which will be used to initialize the array items." msgstr "" +"*init_or_size* は配列のサイズを指定する整数もしくは配列要素を初期化するために" +"使われるバイト列オブジェクトである必要があります。" -#: ../../library/ctypes.rst:2060 -msgid "" -"If *size* is equal to ``len(init)``, a NUL terminator is not added. Do not " -"treat such a buffer as a C string." -msgstr "" - -#: ../../library/ctypes.rst:2063 -msgid "For example::" -msgstr "例えば::" - -#: ../../library/ctypes.rst:2065 +#: ../../library/ctypes.rst:1871 msgid "" -">>> bytes(create_string_buffer(2))\n" -"b'\\x00\\x00'\n" -">>> bytes(create_string_buffer(b'ab'))\n" -"b'ab\\x00'\n" -">>> bytes(create_string_buffer(b'ab', 2))\n" -"b'ab'\n" -">>> bytes(create_string_buffer(b'ab', 4))\n" -"b'ab\\x00\\x00'\n" -">>> bytes(create_string_buffer(b'abcdef', 2))\n" -"Traceback (most recent call last):\n" -" ...\n" -"ValueError: byte string too long" +"If a bytes object is specified as first argument, the buffer is made one " +"item larger than its length so that the last element in the array is a NUL " +"termination character. An integer can be passed as second argument which " +"allows specifying the size of the array if the length of the bytes should " +"not be used." msgstr "" +"バイト列オブジェクトが第一引数として指定されていた場合、配列の最後の要素が " +"NUL 終端文字となるように、バイト列オブジェクトの長さより 1 つ長いバッファを作" +"成します。バイト列の長さを使うべきではない場合は、第二引数として整数を渡し" +"て、配列の長さを指定することができます。" -#: ../../library/ctypes.rst:2078 +#: ../../library/ctypes.rst:1876 msgid "" "Raises an :ref:`auditing event ` ``ctypes.create_string_buffer`` " "with arguments ``init``, ``size``." @@ -3393,7 +2505,7 @@ msgstr "" "引数 ``init``, ``size`` を指定して :ref:`監査イベント ` ``ctypes." "create_string_buffer`` を送出します。 " -#: ../../library/ctypes.rst:2084 +#: ../../library/ctypes.rst:1881 msgid "" "This function creates a mutable unicode character buffer. The returned " "object is a ctypes array of :class:`c_wchar`." @@ -3401,13 +2513,28 @@ msgstr "" "この関数は変更可能な Unicode 文字バッファを作成します。返されるオブジェクト" "は :class:`c_wchar` の ctypes 配列です。" -#: ../../library/ctypes.rst:2087 +#: ../../library/ctypes.rst:1884 +msgid "" +"*init_or_size* must be an integer which specifies the size of the array, or " +"a string which will be used to initialize the array items." +msgstr "" +"*init_or_size* は配列のサイズを指定する整数もしくは配列要素を初期化するために" +"使われる文字列である必要があります。" + +#: ../../library/ctypes.rst:1887 msgid "" -"The function takes the same arguments as :func:`~create_string_buffer` " -"except *init* must be a string and *size* counts :class:`c_wchar`." +"If a string is specified as first argument, the buffer is made one item " +"larger than the length of the string so that the last element in the array " +"is a NUL termination character. An integer can be passed as second argument " +"which allows specifying the size of the array if the length of the string " +"should not be used." msgstr "" +"第一引数として文字列が指定された場合は、バッファが文字列の長さより一要素分大" +"きく作られます。配列の最後の要素が NUL 終端文字であるためです。文字列の長さを" +"使うべきでない場合は、配列のサイズを指定するために整数を第二引数として渡すこ" +"とができます。" -#: ../../library/ctypes.rst:2090 +#: ../../library/ctypes.rst:1893 msgid "" "Raises an :ref:`auditing event ` ``ctypes.create_unicode_buffer`` " "with arguments ``init``, ``size``." @@ -3415,21 +2542,27 @@ msgstr "" "引数 ``init``, ``size`` を指定して :ref:`監査イベント ` ``ctypes." "create_unicode_buffer`` を送出します。 " -#: ../../library/ctypes.rst:2095 +#: ../../library/ctypes.rst:1898 msgid "" -"This function is a hook which allows implementing in-process COM servers " -"with ctypes. It is called from the DllCanUnloadNow function that the " -"_ctypes extension dll exports." +"Windows only: This function is a hook which allows implementing in-process " +"COM servers with ctypes. It is called from the DllCanUnloadNow function " +"that the _ctypes extension dll exports." msgstr "" +"Windows 用: この関数は ctypes をつかってインプロセス COM サーバーを実装できる" +"ようにするためのフックです。_ctypes 拡張 dll がエクスポートしている " +"DllCanUnloadNow 関数から呼び出されます。" -#: ../../library/ctypes.rst:2104 +#: ../../library/ctypes.rst:1905 msgid "" -"This function is a hook which allows implementing in-process COM servers " -"with ctypes. It is called from the DllGetClassObject function that the " -"``_ctypes`` extension dll exports." +"Windows only: This function is a hook which allows implementing in-process " +"COM servers with ctypes. It is called from the DllGetClassObject function " +"that the ``_ctypes`` extension dll exports." msgstr "" +"Windows 用: この関数は ctypes をつかってインプロセス COM サーバーを実装できる" +"ようにするためのフックです。``_ctypes`` 拡張 dll がエクスポートしている " +"DllGetClassObject 関数から呼び出されます。" -#: ../../library/ctypes.rst:2114 +#: ../../library/ctypes.rst:1913 msgid "" "Try to find a library and return a pathname. *name* is the library name " "without any prefix like ``lib``, suffix like ``.so``, ``.dylib`` or version " @@ -3441,14 +2574,16 @@ msgstr "" "名です (これは posix のリンカーオプション :option:`!-l` で使われる書式で" "す) 。もしライブラリが見つからなければ、 ``None`` を返します。" -#: ../../library/ctypes.rst:2125 +#: ../../library/ctypes.rst:1924 msgid "" -"Returns the filename of the VC runtime library used by Python, and by the " -"extension modules. If the name of the library cannot be determined, " -"``None`` is returned." +"Windows only: return the filename of the VC runtime library used by Python, " +"and by the extension modules. If the name of the library cannot be " +"determined, ``None`` is returned." msgstr "" +"Windows 用: Python と拡張モジュールで使われる VC ランタイムライブラリのファイ" +"ル名を返します。もしライブラリ名が同定できなければ、 ``None`` を返します。" -#: ../../library/ctypes.rst:2129 +#: ../../library/ctypes.rst:1928 msgid "" "If you need to free memory, for example, allocated by an extension module " "with a call to the ``free(void *)``, it is important that you use the " @@ -3458,35 +2593,27 @@ msgstr "" "放する必要があるなら、メモリ割り付けを行ったのと同じライブラリの関数を使うこ" "とが重要です。" -#: ../../library/ctypes.rst:2139 -msgid "" -"Try to provide a list of paths of the shared libraries loaded into the " -"current process. These paths are not normalized or processed in any way. " -"The function can raise :exc:`OSError` if the underlying platform APIs fail. " -"The exact functionality is system dependent." -msgstr "" - -#: ../../library/ctypes.rst:2144 -msgid "" -"On most platforms, the first element of the list represents the current " -"executable file. It may be an empty string." -msgstr "" - -#: ../../library/ctypes.rst:2152 +#: ../../library/ctypes.rst:1935 msgid "" -"Returns a textual description of the error code *code*. If no error code is " -"specified, the last error code is used by calling the Windows API function :" -"func:`GetLastError`." +"Windows only: Returns a textual description of the error code *code*. If no " +"error code is specified, the last error code is used by calling the Windows " +"api function GetLastError." msgstr "" +"Windows 用: エラーコード *code* の説明文を返します。エラーコードが指定されな" +"い場合は、 Windows api 関数 GetLastError を呼び出して、もっとも新しいエラー" +"コードが使われます。" -#: ../../library/ctypes.rst:2161 +#: ../../library/ctypes.rst:1942 msgid "" -"Returns the last error code set by Windows in the calling thread. This " -"function calls the Windows ``GetLastError()`` function directly, it does not " -"return the ctypes-private copy of the error code." +"Windows only: Returns the last error code set by Windows in the calling " +"thread. This function calls the Windows `GetLastError()` function directly, " +"it does not return the ctypes-private copy of the error code." msgstr "" +"Windows 用: 呼び出し側のスレッド内で Windows によって設定された最新のエラー" +"コードを返します。この関数は Windows の `GetLastError()` 関数を直接実行しま" +"す。 ctypes のプライベートなエラーコードのコピーを返したりはしません。" -#: ../../library/ctypes.rst:2170 +#: ../../library/ctypes.rst:1948 msgid "" "Returns the current value of the ctypes-private copy of the system :data:" "`errno` variable in the calling thread." @@ -3494,7 +2621,7 @@ msgstr "" "システムの :data:`errno` 変数の、スレッドローカルなプライベートコピーを返しま" "す。" -#: ../../library/ctypes.rst:2173 +#: ../../library/ctypes.rst:1951 msgid "" "Raises an :ref:`auditing event ` ``ctypes.get_errno`` with no " "arguments." @@ -3502,13 +2629,15 @@ msgstr "" "引数無しで :ref:`監査イベント ` ``ctypes.get_errno`` を送出しま" "す。 " -#: ../../library/ctypes.rst:2177 +#: ../../library/ctypes.rst:1955 msgid "" -"Returns the current value of the ctypes-private copy of the system :data:`!" -"LastError` variable in the calling thread." +"Windows only: returns the current value of the ctypes-private copy of the " +"system :data:`LastError` variable in the calling thread." msgstr "" +"Windows 用: システムの :data:`LastError` 変数の、スレッドローカルなプライベー" +"トコピーを返します。" -#: ../../library/ctypes.rst:2182 +#: ../../library/ctypes.rst:1958 msgid "" "Raises an :ref:`auditing event ` ``ctypes.get_last_error`` with no " "arguments." @@ -3516,7 +2645,7 @@ msgstr "" "引数無しで :ref:`監査イベント ` ``ctypes.get_last_error`` を送出し" "ます。 " -#: ../../library/ctypes.rst:2187 +#: ../../library/ctypes.rst:1962 msgid "" "Same as the standard C memmove library function: copies *count* bytes from " "*src* to *dst*. *dst* and *src* must be integers or ctypes instances that " @@ -3526,7 +2655,7 @@ msgstr "" "ら *dst* へコピーします。 *dst* と *src* はポインタへ変換可能な整数または " "ctypes インスタンスでなければなりません。" -#: ../../library/ctypes.rst:2194 +#: ../../library/ctypes.rst:1969 msgid "" "Same as the standard C memset library function: fills the memory block at " "address *dst* with *count* bytes of value *c*. *dst* must be an integer " @@ -3536,29 +2665,25 @@ msgstr "" "ロックを値 *c* を *count* バイト分書き込みます。 *dst* はアドレスを指定する整" "数または ctypes インスタンスである必要があります。" -#: ../../library/ctypes.rst:2201 -msgid "" -"Create or return a ctypes pointer type. Pointer types are cached and reused " -"internally, so calling this function repeatedly is cheap. *type* must be a " -"ctypes type." -msgstr "" - -#: ../../library/ctypes.rst:2207 +#: ../../library/ctypes.rst:1976 msgid "" -"The resulting pointer type is cached in the ``__pointer_type__`` attribute " -"of *type*. It is possible to set this attribute before the first call to " -"``POINTER`` in order to set a custom pointer type. However, doing this is " -"discouraged: manually creating a suitable pointer type is difficult without " -"relying on implementation details that may change in future Python versions." +"This factory function creates and returns a new ctypes pointer type. Pointer " +"types are cached and reused internally, so calling this function repeatedly " +"is cheap. *type* must be a ctypes type." msgstr "" +"このファクトリ関数は新しい ctypes ポインタ型を作成して返します。ポインタ型は" +"キャッシュされ、内部で再利用されます。したがって、この関数を繰り返し呼び出し" +"てもコストは小さいです。*type* は ctypes 型でなければなりません。" -#: ../../library/ctypes.rst:2218 +#: ../../library/ctypes.rst:1983 msgid "" -"Create a new pointer instance, pointing to *obj*. The returned object is of " -"the type ``POINTER(type(obj))``." +"This function creates a new pointer instance, pointing to *obj*. The " +"returned object is of the type ``POINTER(type(obj))``." msgstr "" +"この関数は *obj* を指す新しいポインタインスタンスを作成します。戻り値は " +"``POINTER(type(obj))`` 型のオブジェクトです。" -#: ../../library/ctypes.rst:2221 +#: ../../library/ctypes.rst:1986 msgid "" "Note: If you just want to pass a pointer to an object to a foreign function " "call, you should use ``byref(obj)`` which is much faster." @@ -3566,7 +2691,7 @@ msgstr "" "注意: 外部関数呼び出しへオブジェクトへのポインタを渡したいだけなら、はるかに" "高速な ``byref(obj)`` を使うべきです。" -#: ../../library/ctypes.rst:2227 +#: ../../library/ctypes.rst:1992 msgid "" "This function resizes the internal memory buffer of *obj*, which must be an " "instance of a ctypes type. It is not possible to make the buffer smaller " @@ -3578,7 +2703,7 @@ msgstr "" "られるオブジェクト型の本来のサイズより小さくすることはできませんが、バッファ" "を拡大することはできます。" -#: ../../library/ctypes.rst:2235 +#: ../../library/ctypes.rst:2000 msgid "" "Set the current value of the ctypes-private copy of the system :data:`errno` " "variable in the calling thread to *value* and return the previous value." @@ -3586,7 +2711,7 @@ msgstr "" "システム変数 :data:`errno` の、呼び出し元スレッドでの ctypes のプライベートコ" "ピーの現在値を *value* に設定し、前の値を返します。" -#: ../../library/ctypes.rst:2238 +#: ../../library/ctypes.rst:2003 msgid "" "Raises an :ref:`auditing event ` ``ctypes.set_errno`` with " "argument ``errno``." @@ -3594,14 +2719,16 @@ msgstr "" "引数 ``errno`` を指定して :ref:`監査イベント ` ``ctypes." "set_errno`` を送出します。 " -#: ../../library/ctypes.rst:2243 +#: ../../library/ctypes.rst:2008 msgid "" -"Sets the current value of the ctypes-private copy of the system :data:`!" -"LastError` variable in the calling thread to *value* and return the previous " -"value." +"Windows only: set the current value of the ctypes-private copy of the " +"system :data:`LastError` variable in the calling thread to *value* and " +"return the previous value." msgstr "" +"Windows 用: システム変数 :data:`LastError` の、呼び出し元スレッドでの ctypes " +"のプライベートコピーの現在値を *value* に設定し、前の値を返します。" -#: ../../library/ctypes.rst:2249 +#: ../../library/ctypes.rst:2012 msgid "" "Raises an :ref:`auditing event ` ``ctypes.set_last_error`` with " "argument ``error``." @@ -3609,7 +2736,7 @@ msgstr "" "引数 ``error`` を指定して :ref:`監査イベント ` ``ctypes." "set_last_error`` を送出します。 " -#: ../../library/ctypes.rst:2254 +#: ../../library/ctypes.rst:2017 msgid "" "Returns the size in bytes of a ctypes type or instance memory buffer. Does " "the same as the C ``sizeof`` operator." @@ -3617,79 +2744,66 @@ msgstr "" "ctypes の型やインスタンスのメモリバッファのサイズをバイト数で返します。C の " "``sizeof`` 演算子と同様の動きをします。" -#: ../../library/ctypes.rst:2260 +#: ../../library/ctypes.rst:2023 msgid "" -"Return the byte string at *void \\*ptr*. If *size* is specified, it is used " -"as size, otherwise the string is assumed to be zero-terminated." +"This function returns the C string starting at memory address *address* as a " +"bytes object. If size is specified, it is used as size, otherwise the string " +"is assumed to be zero-terminated." msgstr "" +"この関数はメモリアドレス *address* から始まる C 文字列を返します。size が指定" +"された場合はサイズとして使われます。指定されなければ、文字列がゼロ終端されて" +"いると仮定します。" -#: ../../library/ctypes.rst:2264 +#: ../../library/ctypes.rst:2027 msgid "" "Raises an :ref:`auditing event ` ``ctypes.string_at`` with " -"arguments ``ptr``, ``size``." +"arguments ``address``, ``size``." msgstr "" +"引数 ``address``, ``size`` を指定して :ref:`監査イベント ` " +"``ctypes.string_at`` を送出します。 " -#: ../../library/ctypes.rst:2269 +#: ../../library/ctypes.rst:2032 msgid "" -"Creates an instance of :exc:`OSError`. If *code* is not specified, :func:" -"`GetLastError` is called to determine the error code. If *descr* is not " +"Windows only: this function is probably the worst-named thing in ctypes. It " +"creates an instance of OSError. If *code* is not specified, " +"``GetLastError`` is called to determine the error code. If *descr* is not " "specified, :func:`FormatError` is called to get a textual description of the " "error." msgstr "" +"Windows 用: この関数はおそらく ctypes の中で最悪の名前でしょう。これは " +"OSError のインスタンスを作成します。 *code* が指定されていなかった場合、エ" +"ラーコードを判別するために ``GetLastError`` が呼び出されます。 *descr* が指定" +"されていなかった場合、エラーの説明文を得るために :func:`FormatError` が呼び出" +"されます。" -#: ../../library/ctypes.rst:2276 -msgid "" -"An instance of :exc:`WindowsError` used to be created, which is now an alias " -"of :exc:`OSError`." -msgstr "" +#: ../../library/ctypes.rst:2038 +msgid "An instance of :exc:`WindowsError` used to be created." +msgstr "以前は :exc:`WindowsError` インスタンスが作成されていました。" -#: ../../library/ctypes.rst:2283 +#: ../../library/ctypes.rst:2044 msgid "" -"Return the wide-character string at *void \\*ptr*. If *size* is specified, " -"it is used as the number of characters of the string, otherwise the string " -"is assumed to be zero-terminated." +"This function returns the wide character string starting at memory address " +"*address* as a string. If *size* is specified, it is used as the number of " +"characters of the string, otherwise the string is assumed to be zero-" +"terminated." msgstr "" +"この関数は文字列としてメモリアドレス *address* から始まるワイドキャラクタ文字" +"列を返します。*size* が指定されたならば、文字列の文字数として使われます。指定" +"されなければ、文字列がゼロ終端されていると仮定します。" -#: ../../library/ctypes.rst:2288 +#: ../../library/ctypes.rst:2049 msgid "" "Raises an :ref:`auditing event ` ``ctypes.wstring_at`` with " -"arguments ``ptr``, ``size``." -msgstr "" - -#: ../../library/ctypes.rst:2293 -msgid "" -"Return a :class:`memoryview` object of length *size* that references memory " -"starting at *void \\*ptr*." -msgstr "" - -#: ../../library/ctypes.rst:2296 -msgid "" -"If *readonly* is true, the returned :class:`!memoryview` object can not be " -"used to modify the underlying memory. (Changes made by other means will " -"still be reflected in the returned object.)" +"arguments ``address``, ``size``." msgstr "" +"引数 ``address``, ``size`` を指定して :ref:`監査イベント ` " +"``ctypes.wstring_at`` を送出します。 " -#: ../../library/ctypes.rst:2301 -msgid "" -"This function is similar to :func:`string_at` with the key difference of not " -"making a copy of the specified memory. It is a semantically equivalent (but " -"more efficient) alternative to ``memoryview((c_byte * size)." -"from_address(ptr))``. (While :meth:`~_CData.from_address` only takes " -"integers, *ptr* can also be given as a :class:`ctypes.POINTER` or a :func:" -"`~ctypes.byref` object.)" -msgstr "" - -#: ../../library/ctypes.rst:2308 -msgid "" -"Raises an :ref:`auditing event ` ``ctypes.memoryview_at`` with " -"arguments ``address``, ``size``, ``readonly``." -msgstr "" - -#: ../../library/ctypes.rst:2316 +#: ../../library/ctypes.rst:2055 msgid "Data types" msgstr "データ型" -#: ../../library/ctypes.rst:2321 +#: ../../library/ctypes.rst:2060 msgid "" "This non-public class is the common base class of all ctypes data types. " "Among other things, all ctypes type instances contain a memory block that " @@ -3705,7 +2819,7 @@ msgstr "" "す。これはメモリブロックがポインタを含む場合に存続し続ける必要のある他の " "Python オブジェクトを含んでいます。" -#: ../../library/ctypes.rst:2328 +#: ../../library/ctypes.rst:2067 msgid "" "Common methods of ctypes data types, these are all class methods (to be " "exact, they are methods of the :term:`metaclass`):" @@ -3713,7 +2827,7 @@ msgstr "" "ctypes データ型の共通メソッド、すべてのクラスメソッドが存在します (正確に" "は、 :term:`メタクラス ` のメソッドです):" -#: ../../library/ctypes.rst:2333 +#: ../../library/ctypes.rst:2072 msgid "" "This method returns a ctypes instance that shares the buffer of the *source* " "object. The *source* object must support the writeable buffer interface. " @@ -3727,7 +2841,7 @@ msgstr "" "ファのオフセットをバイト単位で指定します。デフォルトではゼロです。もし " "*source* バッファが十分に大きくなければ、 :exc:`ValueError` が送出されます。" -#: ../../library/ctypes.rst:2339 ../../library/ctypes.rst:2349 +#: ../../library/ctypes.rst:2078 ../../library/ctypes.rst:2088 msgid "" "Raises an :ref:`auditing event ` ``ctypes.cdata/buffer`` with " "arguments ``pointer``, ``size``, ``offset``." @@ -3735,7 +2849,7 @@ msgstr "" "引数 ``pointer``, ``size``, ``offset`` を指定して :ref:`監査イベント " "` ``ctypes.cdata/buffer`` を送出します。 " -#: ../../library/ctypes.rst:2343 +#: ../../library/ctypes.rst:2082 msgid "" "This method creates a ctypes instance, copying the buffer from the *source* " "object buffer which must be readable. The optional *offset* parameter " @@ -3748,7 +2862,7 @@ msgstr "" "す。もし *source* バッファが十分に大きくなければ、 :exc:`ValueError` が送出さ" "れます。" -#: ../../library/ctypes.rst:2353 +#: ../../library/ctypes.rst:2092 msgid "" "This method returns a ctypes type instance using the memory specified by " "*address* which must be an integer." @@ -3756,21 +2870,32 @@ msgstr "" "このメソッドは *address* で指定されたメモリを使って ctypes 型のインスタンスを" "返します。 *address* は整数でなければなりません。" -#: ../../library/ctypes.rst:2356 ../../library/ctypes.rst:2358 +#: ../../library/ctypes.rst:2095 +msgid "" +"Raises an :ref:`auditing event ` ``ctypes.cdata`` with argument " +"``address``." +msgstr "" +"引数 ``address`` を指定して :ref:`監査イベント ` ``ctypes.cdata`` " +"を送出します。 " + +#: ../../library/ctypes.rst:2097 msgid "" "This method, and others that indirectly call this method, raises an :ref:" "`auditing event ` ``ctypes.cdata`` with argument ``address``." msgstr "" -#: ../../library/ctypes.rst:2364 +#: ../../library/ctypes.rst:2103 msgid "" "This method adapts *obj* to a ctypes type. It is called with the actual " "object used in a foreign function call when the type is present in the " -"foreign function's :attr:`~_CFuncPtr.argtypes` tuple; it must return an " -"object that can be used as a function call parameter." +"foreign function's :attr:`argtypes` tuple; it must return an object that can " +"be used as a function call parameter." msgstr "" +"このメソッドは *obj* を ctypes 型に適合させます。外部関数の :attr:`argtypes` " +"タプルに、その型があるとき、外部関数呼び出しで実際に使われるオブジェクトと共" +"に呼び出されます。" -#: ../../library/ctypes.rst:2369 +#: ../../library/ctypes.rst:2108 msgid "" "All ctypes data types have a default implementation of this classmethod that " "normally returns *obj* if that is an instance of the type. Some types " @@ -3780,7 +2905,7 @@ msgstr "" "のクラスメソッドのデフォルトの実装を持ちます。いくつかの型は、別のオブジェク" "トも受け付けます。" -#: ../../library/ctypes.rst:2375 +#: ../../library/ctypes.rst:2114 msgid "" "This method returns a ctypes type instance exported by a shared library. " "*name* is the name of the symbol that exports the data, *library* is the " @@ -3790,22 +2915,11 @@ msgstr "" "ンスを返します。 *name* はエクスポートされたデータの名前で、 *library* はロー" "ドされた共有ライブラリです。" -#: ../../library/ctypes.rst:2379 -msgid "Common class variables of ctypes data types:" -msgstr "" - -#: ../../library/ctypes.rst:2383 -msgid "" -"The pointer type that was created by calling :func:`POINTER` for " -"corresponding ctypes data type. If a pointer type was not yet created, the " -"attribute is missing." -msgstr "" - -#: ../../library/ctypes.rst:2389 +#: ../../library/ctypes.rst:2118 msgid "Common instance variables of ctypes data types:" msgstr "ctypes データ型共通のインスタンス変数:" -#: ../../library/ctypes.rst:2393 +#: ../../library/ctypes.rst:2122 msgid "" "Sometimes ctypes data instances do not own the memory block they contain, " "instead they share part of the memory block of a base object. The :attr:" @@ -3816,7 +2930,7 @@ msgstr "" "ジェクトのメモリブロックの一部を共有することがあります。 :attr:`_b_base_` 読" "み出し専用属性は、メモリブロックを保持する ctypes の基底オブジェクトです。" -#: ../../library/ctypes.rst:2400 +#: ../../library/ctypes.rst:2129 msgid "" "This read-only variable is true when the ctypes data instance has allocated " "the memory block itself, false otherwise." @@ -3825,7 +2939,7 @@ msgstr "" "れたメモリブロックを持つとき true になります。それ以外の場合は false になりま" "す。" -#: ../../library/ctypes.rst:2405 +#: ../../library/ctypes.rst:2134 msgid "" "This member is either ``None`` or a dictionary containing Python objects " "that need to be kept alive so that the memory block contents is kept valid. " @@ -3837,7 +2951,7 @@ msgstr "" "オブジェクトはデバッグでのみ使われます。決してディクショナリの内容を変更しな" "いで下さい。" -#: ../../library/ctypes.rst:2418 +#: ../../library/ctypes.rst:2147 msgid "" "This non-public class is the base class of all fundamental ctypes data " "types. It is mentioned here because it contains the common attributes of the " @@ -3851,11 +2965,11 @@ msgstr "" "を継承しています。ポインタでないかポインタを含まない ctypes データ型は、現在" "は pickle 化できます。" -#: ../../library/ctypes.rst:2424 +#: ../../library/ctypes.rst:2153 msgid "Instances have a single attribute:" msgstr "インスタンスは一つだけ属性を持ちます:" -#: ../../library/ctypes.rst:2428 +#: ../../library/ctypes.rst:2157 msgid "" "This attribute contains the actual value of the instance. For integer and " "pointer types, it is an integer, for character types, it is a single " @@ -3866,7 +2980,7 @@ msgstr "" "数型、文字型に対しては一文字のバイト列オブジェクト、文字へのポインタに対して" "は Python のバイト列オブジェクトもしくは文字列となります。" -#: ../../library/ctypes.rst:2433 +#: ../../library/ctypes.rst:2162 msgid "" "When the ``value`` attribute is retrieved from a ctypes instance, usually a " "new object is returned each time. :mod:`ctypes` does *not* implement " @@ -3878,268 +2992,254 @@ msgstr "" "を返す実装にはなって *おらず* 新しいオブジェクトを構築します。同じことが他の " "ctypes オブジェクトインスタンスに対しても言えます。" -#: ../../library/ctypes.rst:2439 +#: ../../library/ctypes.rst:2168 msgid "" "Fundamental data types, when returned as foreign function call results, or, " "for example, by retrieving structure field members or array items, are " "transparently converted to native Python types. In other words, if a " -"foreign function has a :attr:`~_CFuncPtr.restype` of :class:`c_char_p`, you " -"will always receive a Python bytes object, *not* a :class:`c_char_p` " -"instance." +"foreign function has a :attr:`restype` of :class:`c_char_p`, you will always " +"receive a Python bytes object, *not* a :class:`c_char_p` instance." msgstr "" +"基本データ型は、外部関数呼び出しの結果として返されたときや、例えば構造体の" +"フィールドメンバーや配列要素を取り出すときに、ネイティブの Python 型へ透過的" +"に変換されます。言い換えると、外部関数が :class:`c_char_p` の :attr:" +"`restype` を持つ場合は、 :class:`c_char_p` インスタンスでは *なく* 常に " +"Python バイト列オブジェクトを受け取ることでしょう。" -#: ../../library/ctypes.rst:2447 +#: ../../library/ctypes.rst:2176 msgid "" "Subclasses of fundamental data types do *not* inherit this behavior. So, if " -"a foreign functions :attr:`!restype` is a subclass of :class:`c_void_p`, you " +"a foreign functions :attr:`restype` is a subclass of :class:`c_void_p`, you " "will receive an instance of this subclass from the function call. Of course, " "you can get the value of the pointer by accessing the ``value`` attribute." msgstr "" +"基本データ型のサブクラスはこの振る舞いを継承 *しません* 。したがって、外部関" +"数の :attr:`restype` が :class:`c_void_p` のサブクラスならば、関数呼び出しか" +"らこのサブクラスのインスタンスを受け取ります。もちろん、 ``value`` 属性にアク" +"セスしてポインタの値を得ることができます。" -#: ../../library/ctypes.rst:2452 +#: ../../library/ctypes.rst:2181 msgid "These are the fundamental ctypes data types:" msgstr "これらが基本 ctypes データ型です:" -#: ../../library/ctypes.rst:2456 +#: ../../library/ctypes.rst:2185 msgid "" -"Represents the C :c:expr:`signed char` datatype, and interprets the value as " +"Represents the C :c:type:`signed char` datatype, and interprets the value as " "small integer. The constructor accepts an optional integer initializer; no " "overflow checking is done." msgstr "" -"C の :c:expr:`signed char` データ型を表し、小整数として値を解釈します。コンス" +"C の :c:type:`signed char` データ型を表し、小整数として値を解釈します。コンス" "トラクタはオプションの整数初期化子を受け取ります。オーバーフローのチェックは" "行われません。" -#: ../../library/ctypes.rst:2463 +#: ../../library/ctypes.rst:2192 msgid "" -"Represents the C :c:expr:`char` datatype, and interprets the value as a " +"Represents the C :c:type:`char` datatype, and interprets the value as a " "single character. The constructor accepts an optional string initializer, " "the length of the string must be exactly one character." msgstr "" -"C :c:expr:`char` データ型を表し、単一の文字として値を解釈します。コンストラク" +"C :c:type:`char` データ型を表し、単一の文字として値を解釈します。コンストラク" "タはオプションの文字列初期化子を受け取り、その文字列の長さちょうど一文字であ" "る必要があります。" -#: ../../library/ctypes.rst:2470 +#: ../../library/ctypes.rst:2199 msgid "" -"Represents the C :c:expr:`char *` datatype when it points to a zero-" +"Represents the C :c:type:`char *` datatype when it points to a zero-" "terminated string. For a general character pointer that may also point to " "binary data, ``POINTER(c_char)`` must be used. The constructor accepts an " "integer address, or a bytes object." msgstr "" -"C :c:expr:`char *` データ型を表し、ゼロ終端文字列へのポインタでなければなりま" +"C :c:type:`char *` データ型を表し、ゼロ終端文字列へのポインタでなければなりま" "せん。バイナリデータを指す可能性のある一般的なポインタに対しては " "``POINTER(c_char)`` を使わなければなりません。コンストラクタは整数のアドレス" "もしくはバイト列オブジェクトを受け取ります。" -#: ../../library/ctypes.rst:2478 +#: ../../library/ctypes.rst:2207 msgid "" -"Represents the C :c:expr:`double` datatype. The constructor accepts an " +"Represents the C :c:type:`double` datatype. The constructor accepts an " "optional float initializer." msgstr "" -"C :c:expr:`double` データ型を表します。コンストラクタはオプションの浮動小数点" +"C :c:type:`double` データ型を表します。コンストラクタはオプションの浮動小数点" "数初期化子を受け取ります。" -#: ../../library/ctypes.rst:2484 +#: ../../library/ctypes.rst:2213 msgid "" -"Represents the C :c:expr:`long double` datatype. The constructor accepts an " +"Represents the C :c:type:`long double` datatype. The constructor accepts an " "optional float initializer. On platforms where ``sizeof(long double) == " "sizeof(double)`` it is an alias to :class:`c_double`." msgstr "" -"C :c:expr:`long double` データ型を表します。コンストラクタはオプションで浮動" +"C :c:type:`long double` データ型を表します。コンストラクタはオプションで浮動" "小数点数初期化子を受け取ります。 ``sizeof(long double) == sizeof(double)`` で" "あるプラットフォームでは :class:`c_double` の別名です。" -#: ../../library/ctypes.rst:2490 +#: ../../library/ctypes.rst:2219 msgid "" -"Represents the C :c:expr:`float` datatype. The constructor accepts an " +"Represents the C :c:type:`float` datatype. The constructor accepts an " "optional float initializer." msgstr "" -"C :c:expr:`float` データ型を表します。コンストラクタはオプションの浮動小数点" +"C :c:type:`float` データ型を表します。コンストラクタはオプションの浮動小数点" "数初期化子を受け取ります。" -#: ../../library/ctypes.rst:2496 +#: ../../library/ctypes.rst:2225 msgid "" -"Represents the C :c:expr:`double complex` datatype, if available. The " -"constructor accepts an optional :class:`complex` initializer." -msgstr "" - -#: ../../library/ctypes.rst:2504 -msgid "" -"Represents the C :c:expr:`float complex` datatype, if available. The " -"constructor accepts an optional :class:`complex` initializer." -msgstr "" - -#: ../../library/ctypes.rst:2512 -msgid "" -"Represents the C :c:expr:`long double complex` datatype, if available. The " -"constructor accepts an optional :class:`complex` initializer." -msgstr "" - -#: ../../library/ctypes.rst:2520 -msgid "" -"Represents the C :c:expr:`signed int` datatype. The constructor accepts an " +"Represents the C :c:type:`signed int` datatype. The constructor accepts an " "optional integer initializer; no overflow checking is done. On platforms " "where ``sizeof(int) == sizeof(long)`` it is an alias to :class:`c_long`." msgstr "" -"C :c:expr:`signed int` データ型を表します。コンストラクタはオプションの整数初" +"C :c:type:`signed int` データ型を表します。コンストラクタはオプションの整数初" "期化子を受け取ります。オーバーフローのチェックは行われません。 ``sizeof(int) " "== sizeof(long)`` であるプラットフォームでは、 :class:`c_long` の別名です。" -#: ../../library/ctypes.rst:2527 +#: ../../library/ctypes.rst:2232 msgid "" -"Represents the C 8-bit :c:expr:`signed int` datatype. Usually an alias for :" +"Represents the C 8-bit :c:type:`signed int` datatype. Usually an alias for :" "class:`c_byte`." msgstr "" -"C 8-bit :c:expr:`signed int` データ型を表します。たいていは、 :class:" +"C 8-bit :c:type:`signed int` データ型を表します。たいていは、 :class:" "`c_byte` の別名です。" -#: ../../library/ctypes.rst:2533 +#: ../../library/ctypes.rst:2238 msgid "" -"Represents the C 16-bit :c:expr:`signed int` datatype. Usually an alias " +"Represents the C 16-bit :c:type:`signed int` datatype. Usually an alias " "for :class:`c_short`." msgstr "" -"C 16-bit :c:expr:`signed int` データ型を表します。たいていは、 :class:" +"C 16-bit :c:type:`signed int` データ型を表します。たいていは、 :class:" "`c_short` の別名です。" -#: ../../library/ctypes.rst:2539 +#: ../../library/ctypes.rst:2244 msgid "" -"Represents the C 32-bit :c:expr:`signed int` datatype. Usually an alias " +"Represents the C 32-bit :c:type:`signed int` datatype. Usually an alias " "for :class:`c_int`." msgstr "" -"C 32-bit :c:expr:`signed int` データ型を表します。たいていは、 :class:" +"C 32-bit :c:type:`signed int` データ型を表します。たいていは、 :class:" "`c_int` の別名です。" -#: ../../library/ctypes.rst:2545 +#: ../../library/ctypes.rst:2250 msgid "" -"Represents the C 64-bit :c:expr:`signed int` datatype. Usually an alias " +"Represents the C 64-bit :c:type:`signed int` datatype. Usually an alias " "for :class:`c_longlong`." msgstr "" -"C 64-bit :c:expr:`signed int` データ型を表します。たいていは、 :class:" +"C 64-bit :c:type:`signed int` データ型を表します。たいていは、 :class:" "`c_longlong` の別名です。" -#: ../../library/ctypes.rst:2551 +#: ../../library/ctypes.rst:2256 msgid "" -"Represents the C :c:expr:`signed long` datatype. The constructor accepts an " +"Represents the C :c:type:`signed long` datatype. The constructor accepts an " "optional integer initializer; no overflow checking is done." msgstr "" -"C :c:expr:`signed long` データ型を表します。コンストラクタはオプションの整数" +"C :c:type:`signed long` データ型を表します。コンストラクタはオプションの整数" "初期化子を受け取ります。オーバーフローのチェックは行われません。" -#: ../../library/ctypes.rst:2557 +#: ../../library/ctypes.rst:2262 msgid "" -"Represents the C :c:expr:`signed long long` datatype. The constructor " +"Represents the C :c:type:`signed long long` datatype. The constructor " "accepts an optional integer initializer; no overflow checking is done." msgstr "" -"C :c:expr:`signed long long` データ型を表します。コンストラクタはオプションの" +"C :c:type:`signed long long` データ型を表します。コンストラクタはオプションの" "整数初期化子を受け取ります。オーバーフローのチェックは行われません。" -#: ../../library/ctypes.rst:2563 +#: ../../library/ctypes.rst:2268 msgid "" -"Represents the C :c:expr:`signed short` datatype. The constructor accepts " +"Represents the C :c:type:`signed short` datatype. The constructor accepts " "an optional integer initializer; no overflow checking is done." msgstr "" -"C :c:expr:`signed short` データ型を表します。コンストラクタはオプションの整数" +"C :c:type:`signed short` データ型を表します。コンストラクタはオプションの整数" "初期化子を受け取ります。オーバーフローのチェックは行われません。" -#: ../../library/ctypes.rst:2569 +#: ../../library/ctypes.rst:2274 msgid "Represents the C :c:type:`size_t` datatype." msgstr "C :c:type:`size_t` データ型を表します。" -#: ../../library/ctypes.rst:2574 +#: ../../library/ctypes.rst:2279 msgid "Represents the C :c:type:`ssize_t` datatype." msgstr "C :c:type:`ssize_t` データ型を表します。" -#: ../../library/ctypes.rst:2581 -msgid "Represents the C :c:type:`time_t` datatype." -msgstr "" - -#: ../../library/ctypes.rst:2588 +#: ../../library/ctypes.rst:2286 msgid "" -"Represents the C :c:expr:`unsigned char` datatype, it interprets the value " +"Represents the C :c:type:`unsigned char` datatype, it interprets the value " "as small integer. The constructor accepts an optional integer initializer; " "no overflow checking is done." msgstr "" -"C の :c:expr:`unsigned char` データ型を表し、小さな整数として値を解釈します。" +"C の :c:type:`unsigned char` データ型を表し、小さな整数として値を解釈します。" "コンストラクタはオプションの整数初期化子を受け取ります; オーバーフローの" "チェックは行われません。" -#: ../../library/ctypes.rst:2595 +#: ../../library/ctypes.rst:2293 msgid "" -"Represents the C :c:expr:`unsigned int` datatype. The constructor accepts " +"Represents the C :c:type:`unsigned int` datatype. The constructor accepts " "an optional integer initializer; no overflow checking is done. On platforms " "where ``sizeof(int) == sizeof(long)`` it is an alias for :class:`c_ulong`." msgstr "" -"C の :c:expr:`unsigned int` データ型を表します。コンストラクタはオプションの" +"C の :c:type:`unsigned int` データ型を表します。コンストラクタはオプションの" "整数初期化子を受け取ります; オーバーフローのチェックは行われません。これは、 " "``sizeof(int) == sizeof(long)`` であるプラットフォームでは :class:`c_ulong` " "の別名です。" -#: ../../library/ctypes.rst:2602 +#: ../../library/ctypes.rst:2300 msgid "" -"Represents the C 8-bit :c:expr:`unsigned int` datatype. Usually an alias " +"Represents the C 8-bit :c:type:`unsigned int` datatype. Usually an alias " "for :class:`c_ubyte`." msgstr "" -"C 8-bit :c:expr:`unsigned int` データ型を表します。たいていは、 :class:" +"C 8-bit :c:type:`unsigned int` データ型を表します。たいていは、 :class:" "`c_ubyte` の別名です。" -#: ../../library/ctypes.rst:2608 +#: ../../library/ctypes.rst:2306 msgid "" -"Represents the C 16-bit :c:expr:`unsigned int` datatype. Usually an alias " +"Represents the C 16-bit :c:type:`unsigned int` datatype. Usually an alias " "for :class:`c_ushort`." msgstr "" -"C 16-bit :c:expr:`unsigned int` データ型を表します。たいていは、 :class:" +"C 16-bit :c:type:`unsigned int` データ型を表します。たいていは、 :class:" "`c_ushort` の別名です。" -#: ../../library/ctypes.rst:2614 +#: ../../library/ctypes.rst:2312 msgid "" -"Represents the C 32-bit :c:expr:`unsigned int` datatype. Usually an alias " +"Represents the C 32-bit :c:type:`unsigned int` datatype. Usually an alias " "for :class:`c_uint`." msgstr "" -"C 32-bit :c:expr:`unsigned int` データ型を表します。たいていは、 :class:" +"C 32-bit :c:type:`unsigned int` データ型を表します。たいていは、 :class:" "`c_uint` の別名です。" -#: ../../library/ctypes.rst:2620 +#: ../../library/ctypes.rst:2318 msgid "" -"Represents the C 64-bit :c:expr:`unsigned int` datatype. Usually an alias " +"Represents the C 64-bit :c:type:`unsigned int` datatype. Usually an alias " "for :class:`c_ulonglong`." msgstr "" -"C 64-bit :c:expr:`unsigned int` データ型を表します。たいていは、 :class:" +"C 64-bit :c:type:`unsigned int` データ型を表します。たいていは、 :class:" "`c_ulonglong` の別名です。" -#: ../../library/ctypes.rst:2626 +#: ../../library/ctypes.rst:2324 msgid "" -"Represents the C :c:expr:`unsigned long` datatype. The constructor accepts " +"Represents the C :c:type:`unsigned long` datatype. The constructor accepts " "an optional integer initializer; no overflow checking is done." msgstr "" -"C :c:expr:`unsigned long` データ型を表します。コンストラクタはオプションの整" +"C :c:type:`unsigned long` データ型を表します。コンストラクタはオプションの整" "数初期化子を受け取ります。オーバーフローのチェックは行われません。" -#: ../../library/ctypes.rst:2632 +#: ../../library/ctypes.rst:2330 msgid "" -"Represents the C :c:expr:`unsigned long long` datatype. The constructor " +"Represents the C :c:type:`unsigned long long` datatype. The constructor " "accepts an optional integer initializer; no overflow checking is done." msgstr "" -"C :c:expr:`unsigned long long` データ型を表します。コンストラクタはオプション" +"C :c:type:`unsigned long long` データ型を表します。コンストラクタはオプション" "の整数初期化子を受け取ります。オーバーフローのチェックは行われません。" -#: ../../library/ctypes.rst:2638 +#: ../../library/ctypes.rst:2336 msgid "" -"Represents the C :c:expr:`unsigned short` datatype. The constructor accepts " +"Represents the C :c:type:`unsigned short` datatype. The constructor accepts " "an optional integer initializer; no overflow checking is done." msgstr "" -"C :c:expr:`unsigned short` データ型を表します。コンストラクタはオプションの整" +"C :c:type:`unsigned short` データ型を表します。コンストラクタはオプションの整" "数初期化子を受け取ります。オーバーフローのチェックは行われません。" -#: ../../library/ctypes.rst:2644 +#: ../../library/ctypes.rst:2342 msgid "" -"Represents the C :c:expr:`void *` type. The value is represented as " +"Represents the C :c:type:`void *` type. The value is represented as " "integer. The constructor accepts an optional integer initializer." msgstr "" -"C :c:expr:`void *` データ型を表します。値は整数として表されます。コンストラク" +"C :c:type:`void *` データ型を表します。値は整数として表されます。コンストラク" "タはオプションの整数初期化子を受け取ります。" -#: ../../library/ctypes.rst:2650 +#: ../../library/ctypes.rst:2348 msgid "" "Represents the C :c:type:`wchar_t` datatype, and interprets the value as a " "single character unicode string. The constructor accepts an optional string " @@ -4149,99 +3249,83 @@ msgstr "" "されます。コンストラクタはオプションの文字列初期化子を受け取り、その文字列の" "長さはちょうど一文字である必要があります。" -#: ../../library/ctypes.rst:2657 +#: ../../library/ctypes.rst:2355 msgid "" -"Represents the C :c:expr:`wchar_t *` datatype, which must be a pointer to a " +"Represents the C :c:type:`wchar_t *` datatype, which must be a pointer to a " "zero-terminated wide character string. The constructor accepts an integer " "address, or a string." msgstr "" -"C :c:expr:`wchar_t *` データ型を表し、ゼロ終端ワイド文字列へのポインタでなけ" +"C :c:type:`wchar_t *` データ型を表し、ゼロ終端ワイド文字列へのポインタでなけ" "ればなりません。コンストラクタは整数のアドレスもしくは文字列を受け取ります。" -#: ../../library/ctypes.rst:2664 +#: ../../library/ctypes.rst:2362 msgid "" -"Represent the C :c:expr:`bool` datatype (more accurately, :c:expr:`_Bool` " +"Represent the C :c:type:`bool` datatype (more accurately, :c:type:`_Bool` " "from C99). Its value can be ``True`` or ``False``, and the constructor " "accepts any object that has a truth value." msgstr "" -"C の :c:expr:`bool` データ型 (より正確には、 C99 以降の :c:expr:`_Bool`) を" +"C の :c:type:`bool` データ型 (より正確には、 C99 以降の :c:type:`_Bool`) を" "表します。 ``True`` または ``False`` の値を持ち、コンストラクタは真偽値と解釈" "できるオブジェクトを受け取ります。" -#: ../../library/ctypes.rst:2671 +#: ../../library/ctypes.rst:2369 msgid "" -"Represents a :c:type:`!HRESULT` value, which contains success or error " -"information for a function or method call." +"Windows only: Represents a :c:type:`HRESULT` value, which contains success " +"or error information for a function or method call." msgstr "" +"Windows用: :c:type:`HRESULT` 値を表し、関数またはメソッド呼び出しに対する成功" +"またはエラーの情報を含んでいます。" -#: ../../library/ctypes.rst:2679 +#: ../../library/ctypes.rst:2375 msgid "" -"Represents the C :c:expr:`PyObject *` datatype. Calling this without an " -"argument creates a ``NULL`` :c:expr:`PyObject *` pointer." +"Represents the C :c:type:`PyObject *` datatype. Calling this without an " +"argument creates a ``NULL`` :c:type:`PyObject *` pointer." msgstr "" -"C :c:expr:`PyObject *` データ型を表します。引数なしでこれを呼び出すと " -"``NULL`` :c:expr:`PyObject *` ポインタを作成します。" +"C :c:type:`PyObject *` データ型を表します。引数なしでこれを呼び出すと " +"``NULL`` :c:type:`PyObject *` ポインタを作成します。" -#: ../../library/ctypes.rst:2682 -msgid ":class:`!py_object` is now a :term:`generic type`." -msgstr "" - -#: ../../library/ctypes.rst:2685 +#: ../../library/ctypes.rst:2378 msgid "" -"The :mod:`!ctypes.wintypes` module provides quite some other Windows " -"specific data types, for example :c:type:`!HWND`, :c:type:`!WPARAM`, or :c:" -"type:`!DWORD`. Some useful structures like :c:type:`!MSG` or :c:type:`!RECT` " -"are also defined." +"The :mod:`ctypes.wintypes` module provides quite some other Windows specific " +"data types, for example :c:type:`HWND`, :c:type:`WPARAM`, or :c:type:" +"`DWORD`. Some useful structures like :c:type:`MSG` or :c:type:`RECT` are " +"also defined." msgstr "" +":mod:`ctypes.wintypes` モジュールは他の Windows 固有のデータ型を提供します。" +"例えば、 :c:type:`HWND`, :c:type:`WPARAM`, :c:type:`DWORD` です。 :c:type:" +"`MSG` や :c:type:`RECT` のような有用な構造体も定義されています。" -#: ../../library/ctypes.rst:2693 +#: ../../library/ctypes.rst:2386 msgid "Structured data types" msgstr "構造化データ型" -#: ../../library/ctypes.rst:2698 +#: ../../library/ctypes.rst:2391 msgid "Abstract base class for unions in native byte order." msgstr "ネイティブのバイトオーダーでの共用体のための抽象ベースクラス。" -#: ../../library/ctypes.rst:2700 -msgid "" -"Unions share common attributes and behavior with structures; see :class:" -"`Structure` documentation for details." -msgstr "" - -#: ../../library/ctypes.rst:2705 -msgid "Abstract base class for unions in *big endian* byte order." -msgstr "" -"*ビックエンディアン* バイトオーダーでの共用体のための抽象ベースクラス。" - -#: ../../library/ctypes.rst:2711 -msgid "Abstract base class for unions in *little endian* byte order." -msgstr "" -"*リトルエンディアン* バイトオーダーでの共用体のための抽象ベースクラス。" - -#: ../../library/ctypes.rst:2717 +#: ../../library/ctypes.rst:2396 msgid "Abstract base class for structures in *big endian* byte order." msgstr "" "*ビックエンディアン* バイトオーダーでの構造体のための抽象ベースクラス。" -#: ../../library/ctypes.rst:2722 +#: ../../library/ctypes.rst:2401 msgid "Abstract base class for structures in *little endian* byte order." msgstr "" "*リトルエンディアン* バイトオーダーでの構造体のための抽象ベースクラス。" -#: ../../library/ctypes.rst:2724 +#: ../../library/ctypes.rst:2403 msgid "" -"Structures and unions with non-native byte order cannot contain pointer type " -"fields, or any other data types containing pointer type fields." +"Structures with non-native byte order cannot contain pointer type fields, or " +"any other data types containing pointer type fields." msgstr "" -"ネイティブではないバイトオーダーを持つ構造体および共用体にポインタ型フィール" -"ドあるいはポインタ型フィールドを含む他のどんなデータ型をも入れることはできま" -"せん。" +"ネイティブではないバイトオーダーを持つ構造体にポインタ型フィールドあるいはポ" +"インタ型フィールドを含む他のどんなデータ型をも入れることはできません。" -#: ../../library/ctypes.rst:2730 +#: ../../library/ctypes.rst:2409 msgid "Abstract base class for structures in *native* byte order." msgstr "*ネイティブ* のバイトオーダーでの構造体のための抽象ベースクラス。" -#: ../../library/ctypes.rst:2732 +#: ../../library/ctypes.rst:2411 msgid "" "Concrete structure and union types must be created by subclassing one of " "these types, and at least define a :attr:`_fields_` class variable. :mod:" @@ -4253,7 +3337,7 @@ msgstr "" "ます。 :mod:`ctypes` は、属性に直接アクセスしてフィールドを読み書きできるよう" "にする :term:`デスクリプタ ` を作成するでしょう。これらは、" -#: ../../library/ctypes.rst:2740 +#: ../../library/ctypes.rst:2419 msgid "" "A sequence defining the structure fields. The items must be 2-tuples or 3-" "tuples. The first item is the name of the field, the second item specifies " @@ -4263,7 +3347,7 @@ msgstr "" "ればなりません。第一要素はフィールドの名前です。第二要素はフィールドの型を指" "定します。それはどんな ctypes データ型でも構いません。" -#: ../../library/ctypes.rst:2744 +#: ../../library/ctypes.rst:2423 msgid "" "For integer type fields like :class:`c_int`, a third optional item can be " "given. It must be a small positive integer defining the bit width of the " @@ -4272,7 +3356,7 @@ msgstr "" ":class:`c_int` のような整数型のために、オプションの第三要素を与えることができ" "ます。フィールドのビット幅を定義する正の小整数である必要があります。" -#: ../../library/ctypes.rst:2748 +#: ../../library/ctypes.rst:2427 msgid "" "Field names must be unique within one structure or union. This is not " "checked, only one field can be accessed when names are repeated." @@ -4281,7 +3365,7 @@ msgstr "" "はチェックされません。名前が繰り返しでてきたときにアクセスできるのは一つの" "フィールドだけです。" -#: ../../library/ctypes.rst:2751 +#: ../../library/ctypes.rst:2430 msgid "" "It is possible to define the :attr:`_fields_` class variable *after* the " "class statement that defines the Structure subclass, this allows creating " @@ -4291,112 +3375,39 @@ msgstr "" "数を定義することができます。これにより、次のように自身を直接または間接的に参" "照するデータ型を作成できるようになります::" -#: ../../library/ctypes.rst:2755 -msgid "" -"class List(Structure):\n" -" pass\n" -"List._fields_ = [(\"pnext\", POINTER(List)),\n" -" ...\n" -" ]" -msgstr "" - -#: ../../library/ctypes.rst:2761 -msgid "" -"The :attr:`!_fields_` class variable can only be set once. Later assignments " -"will raise an :exc:`AttributeError`." -msgstr "" - -#: ../../library/ctypes.rst:2764 +#: ../../library/ctypes.rst:2440 msgid "" -"Additionally, the :attr:`!_fields_` class variable must be defined before " -"the structure or union type is first used: an instance or subclass is " -"created, :func:`sizeof` is called on it, and so on. Later assignments to :" -"attr:`!_fields_` will raise an :exc:`AttributeError`. If :attr:`!_fields_` " -"has not been set before such use, the structure or union will have no own " -"fields, as if :attr:`!_fields_` was empty." +"The :attr:`_fields_` class variable must, however, be defined before the " +"type is first used (an instance is created, :func:`sizeof` is called on it, " +"and so on). Later assignments to the :attr:`_fields_` class variable will " +"raise an AttributeError." msgstr "" +"しかし、 :attr:`_fields_` クラス変数はその型が最初に使われる (インスタンスが" +"作成される、それに対して :func:`sizeof` が呼び出されるなど) より前に定義され" +"ていなければなりません。その後 :attr:`_fields_` クラス変数へ代入すると " +"AttributeError が送出されます。" -#: ../../library/ctypes.rst:2772 +#: ../../library/ctypes.rst:2445 msgid "" -"Sub-subclasses of structure types inherit the fields of the base class plus " -"the :attr:`_fields_` defined in the sub-subclass, if any." +"It is possible to define sub-subclasses of structure types, they inherit the " +"fields of the base class plus the :attr:`_fields_` defined in the sub-" +"subclass, if any." msgstr "" +"構造体型のサブクラスのサブクラスを定義することもでき、もしあるならサブクラス" +"のサブクラス内で定義された :attr:`_fields_` に加えて、基底クラスのフィールド" +"も継承します。" -#: ../../library/ctypes.rst:2778 +#: ../../library/ctypes.rst:2452 msgid "" "An optional small integer that allows overriding the alignment of structure " "fields in the instance. :attr:`_pack_` must already be defined when :attr:" -"`_fields_` is assigned, otherwise it will have no effect. Setting this " -"attribute to 0 is the same as not setting it at all." -msgstr "" - -#: ../../library/ctypes.rst:2783 -msgid "This is only implemented for the MSVC-compatible memory layout." -msgstr "" - -#: ../../library/ctypes.rst:2787 -msgid "" -"For historical reasons, if :attr:`!_pack_` is non-zero, the MSVC-compatible " -"layout will be used by default. On non-Windows platforms, this default is " -"deprecated and is slated to become an error in Python 3.19. If it is " -"intended, set :attr:`~Structure._layout_` to ``'ms'`` explicitly." -msgstr "" - -#: ../../library/ctypes.rst:2796 -msgid "" -"An optional small integer that allows overriding the alignment of the " -"structure when being packed or unpacked to/from memory. Setting this " -"attribute to 0 is the same as not setting it at all." -msgstr "" - -#: ../../library/ctypes.rst:2804 -msgid "" -"An optional string naming the struct/union layout. It can currently be set " -"to:" -msgstr "" - -#: ../../library/ctypes.rst:2807 -msgid "" -"``\"ms\"``: the layout used by the Microsoft compiler (MSVC). On GCC and " -"Clang, this layout can be selected with ``__attribute__((ms_struct))``." -msgstr "" - -#: ../../library/ctypes.rst:2810 -msgid "" -"``\"gcc-sysv\"``: the layout used by GCC with the System V or “SysV-like” " -"data model, as used on Linux and macOS. With this layout, :attr:`~Structure." -"_pack_` must be unset or zero." -msgstr "" - -#: ../../library/ctypes.rst:2814 -msgid "" -"If not set explicitly, ``ctypes`` will use a default that matches the " -"platform conventions. This default may change in future Python releases (for " -"example, when a new platform gains official support, or when a difference " -"between similar platforms is found). Currently the default will be:" -msgstr "" - -#: ../../library/ctypes.rst:2820 -msgid "On Windows: ``\"ms\"``" -msgstr "" - -#: ../../library/ctypes.rst:2821 -msgid "" -"When :attr:`~Structure._pack_` is specified: ``\"ms\"``. (This is " -"deprecated; see :attr:`~Structure._pack_` documentation.)" -msgstr "" - -#: ../../library/ctypes.rst:2823 -msgid "Otherwise: ``\"gcc-sysv\"``" +"`_fields_` is assigned, otherwise it will have no effect." msgstr "" +"インスタンスの構造体フィールドのアライメントを上書きできるようにするオブショ" +"ンの小整数。 :attr:`_pack_` は :attr:`_fields_` が代入されたときすでに定義さ" +"れていなければなりません。そうでなければ、何の効果もありません。" -#: ../../library/ctypes.rst:2825 -msgid "" -":attr:`!_layout_` must already be defined when :attr:`~Structure._fields_` " -"is assigned, otherwise it will have no effect." -msgstr "" - -#: ../../library/ctypes.rst:2832 +#: ../../library/ctypes.rst:2459 msgid "" "An optional sequence that lists the names of unnamed (anonymous) fields. :" "attr:`_anonymous_` must be already defined when :attr:`_fields_` is " @@ -4406,7 +3417,7 @@ msgstr "" "`_fields_` が代入されたとき、 :attr:`_anonymous_` がすでに定義されていなけれ" "ばなりません。そうでなければ、何ら影響はありません。" -#: ../../library/ctypes.rst:2836 +#: ../../library/ctypes.rst:2463 msgid "" "The fields listed in this variable must be structure or union type fields. :" "mod:`ctypes` will create descriptors in the structure type that allows " @@ -4418,24 +3429,11 @@ msgstr "" "になったフィールドに直接アクセスできるようにするために、 :mod:`ctypes` は構造" "体型の中に記述子を作成します。" -#: ../../library/ctypes.rst:2841 +#: ../../library/ctypes.rst:2468 msgid "Here is an example type (Windows)::" msgstr "型の例です (Windows)::" -#: ../../library/ctypes.rst:2843 -msgid "" -"class _U(Union):\n" -" _fields_ = [(\"lptdesc\", POINTER(TYPEDESC)),\n" -" (\"lpadesc\", POINTER(ARRAYDESC)),\n" -" (\"hreftype\", HREFTYPE)]\n" -"\n" -"class TYPEDESC(Structure):\n" -" _anonymous_ = (\"u\",)\n" -" _fields_ = [(\"u\", _U),\n" -" (\"vt\", VARTYPE)]" -msgstr "" - -#: ../../library/ctypes.rst:2854 +#: ../../library/ctypes.rst:2481 msgid "" "The ``TYPEDESC`` structure describes a COM data type, the ``vt`` field " "specifies which one of the union fields is valid. Since the ``u`` field is " @@ -4451,15 +3449,7 @@ msgstr "" "者がより高速です。なぜなら一時的な共用体インスタンスを作る必要がないためで" "す。::" -#: ../../library/ctypes.rst:2861 -msgid "" -"td = TYPEDESC()\n" -"td.vt = VT_PTR\n" -"td.lptdesc = POINTER(some_type)\n" -"td.u.lptdesc = POINTER(some_type)" -msgstr "" - -#: ../../library/ctypes.rst:2866 +#: ../../library/ctypes.rst:2493 msgid "" "It is possible to define sub-subclasses of structures, they inherit the " "fields of the base class. If the subclass definition has a separate :attr:" @@ -4471,7 +3461,7 @@ msgstr "" "サブクラス定義に別の :attr:`_fields_` 変数がある場合は、この中で指定された" "フィールドは基底クラスのフィールドへ追加されます。" -#: ../../library/ctypes.rst:2871 +#: ../../library/ctypes.rst:2498 msgid "" "Structure and union constructors accept both positional and keyword " "arguments. Positional arguments are used to initialize member fields in the " @@ -4486,145 +3476,31 @@ msgstr "" "解釈され、そのため、同じ名前をもつ :attr:`_fields_` を初期化するか、 :attr:" "`_fields_` に存在しない名前に対しては新しい属性を作ります。" -#: ../../library/ctypes.rst:2881 -msgid "" -"Descriptor for fields of a :class:`Structure` and :class:`Union`. For " -"example::" -msgstr "" - -#: ../../library/ctypes.rst:2884 -msgid "" -">>> class Color(Structure):\n" -"... _fields_ = (\n" -"... ('red', c_uint8),\n" -"... ('green', c_uint8),\n" -"... ('blue', c_uint8),\n" -"... ('intense', c_bool, 1),\n" -"... ('blinking', c_bool, 1),\n" -"... )\n" -"...\n" -">>> Color.red\n" -"\n" -">>> Color.green.type\n" -"\n" -">>> Color.blue.byte_offset\n" -"2\n" -">>> Color.intense\n" -"\n" -">>> Color.blinking.bit_offset\n" -"1" -msgstr "" - -#: ../../library/ctypes.rst:2904 -msgid "All attributes are read-only." -msgstr "" - -#: ../../library/ctypes.rst:2906 -msgid "" -":class:`!CField` objects are created via :attr:`~Structure._fields_`; do not " -"instantiate the class directly." -msgstr "" - -#: ../../library/ctypes.rst:2911 -msgid "" -"Previously, descriptors only had ``offset`` and ``size`` attributes and a " -"readable string representation; the :class:`!CField` class was not available " -"directly." -msgstr "" - -#: ../../library/ctypes.rst:2917 -msgid "Name of the field, as a string." -msgstr "" - -#: ../../library/ctypes.rst:2921 -msgid "Type of the field, as a :ref:`ctypes class `." -msgstr "" - -#: ../../library/ctypes.rst:2926 -msgid "Offset of the field, in bytes." -msgstr "" - -#: ../../library/ctypes.rst:2928 -msgid "" -"For bitfields, this is the offset of the underlying byte-aligned *storage " -"unit*; see :attr:`~CField.bit_offset`." -msgstr "" - -#: ../../library/ctypes.rst:2933 -msgid "Size of the field, in bytes." -msgstr "" - -#: ../../library/ctypes.rst:2935 -msgid "" -"For bitfields, this is the size of the underlying *storage unit*. Typically, " -"it has the same size as the bitfield's type." -msgstr "" - -#: ../../library/ctypes.rst:2940 -msgid "For non-bitfields, equivalent to :attr:`~CField.byte_size`." -msgstr "" - -#: ../../library/ctypes.rst:2942 -msgid "" -"For bitfields, this contains a backwards-compatible bit-packed value that " -"combines :attr:`~CField.bit_size` and :attr:`~CField.bit_offset`. Prefer " -"using the explicit attributes instead." -msgstr "" - -#: ../../library/ctypes.rst:2949 -msgid "True if this is a bitfield." -msgstr "" - -#: ../../library/ctypes.rst:2954 -msgid "" -"The location of a bitfield within its *storage unit*, that is, within :attr:" -"`~CField.byte_size` bytes of memory starting at :attr:`~CField.byte_offset`." -msgstr "" - -#: ../../library/ctypes.rst:2958 -msgid "" -"To get the field's value, read the storage unit as an integer, :ref:`shift " -"left ` by :attr:`!bit_offset` and take the :attr:`!bit_size` least " -"significant bits." -msgstr "" - -#: ../../library/ctypes.rst:2962 -msgid "" -"For non-bitfields, :attr:`!bit_offset` is zero and :attr:`!bit_size` is " -"equal to ``byte_size * 8``." -msgstr "" - -#: ../../library/ctypes.rst:2967 -msgid "" -"True if this field is anonymous, that is, it contains nested sub-fields that " -"should be be merged into a containing structure or union." -msgstr "" - -#: ../../library/ctypes.rst:2974 +#: ../../library/ctypes.rst:2509 msgid "Arrays and pointers" msgstr "配列とポインタ" -#: ../../library/ctypes.rst:2978 +#: ../../library/ctypes.rst:2513 msgid "Abstract base class for arrays." msgstr "配列のための抽象基底クラスです。" -#: ../../library/ctypes.rst:2980 +#: ../../library/ctypes.rst:2515 msgid "" "The recommended way to create concrete array types is by multiplying any :" -"mod:`ctypes` data type with a non-negative integer. Alternatively, you can " +"mod:`ctypes` data type with a positive integer. Alternatively, you can " "subclass this type and define :attr:`_length_` and :attr:`_type_` class " "variables. Array elements can be read and written using standard subscript " "and slice accesses; for slice reads, the resulting object is *not* itself " "an :class:`Array`." msgstr "" -"具象配列型を作成するための推奨される方法は、任意の :mod:`ctypes` データ型に非" -"負の整数を乗算することです。代わりに、この型のサブクラスを作成し、 :attr:" +"具象配列型を作成するための推奨される方法は、任意の :mod:`ctypes` データ型に正" +"の整数を乗算することです。代わりに、この型のサブクラスを作成し、 :attr:" "`_length_` と :attr:`_type_` のクラス変数を定義することもできます。配列の要素" "は、標準の添え字とスライスによるアクセスを使用して読み書きを行うことができま" "す。スライスの読み込みでは、結果のオブジェクト自体は :class:`Array` ではあり" "ません。" -#: ../../library/ctypes.rst:2990 +#: ../../library/ctypes.rst:2525 msgid "" "A positive integer specifying the number of elements in the array. Out-of-" "range subscripts result in an :exc:`IndexError`. Will be returned by :func:" @@ -4633,11 +3509,11 @@ msgstr "" "配列の要素数を指定する正の整数。範囲外の添え字を指定すると、 :exc:" "`IndexError` が送出されます。:func:`len` がこの整数を返します。" -#: ../../library/ctypes.rst:2997 +#: ../../library/ctypes.rst:2532 msgid "Specifies the type of each element in the array." msgstr "配列内の各要素の型を指定します。" -#: ../../library/ctypes.rst:3000 +#: ../../library/ctypes.rst:2535 msgid "" "Array subclass constructors accept positional arguments, used to initialize " "the elements in order." @@ -4645,23 +3521,11 @@ msgstr "" "配列のサブクラスのコンストラクタは、位置引数を受け付けて、配列を順番に初期化" "するために使用します。" -#: ../../library/ctypes.rst:3005 -msgid "" -"Create an array. Equivalent to ``type * length``, where *type* is a :mod:" -"`ctypes` data type and *length* an integer." -msgstr "" - -#: ../../library/ctypes.rst:3009 -msgid "" -"This function is :term:`soft deprecated` in favor of multiplication. There " -"are no plans to remove it." -msgstr "" - -#: ../../library/ctypes.rst:3015 +#: ../../library/ctypes.rst:2541 msgid "Private, abstract base class for pointers." msgstr "ポインタのためのプライベートな抽象基底クラスです。" -#: ../../library/ctypes.rst:3017 +#: ../../library/ctypes.rst:2543 msgid "" "Concrete pointer types are created by calling :func:`POINTER` with the type " "that will be pointed to; this is done automatically by :func:`pointer`." @@ -4669,7 +3533,7 @@ msgstr "" "具象ポインタ型は、ポイント先の型を持つ :func:`POINTER` を呼び出すことで、作成" "できます。これは、 :func:`pointer` により自動的に行われます。" -#: ../../library/ctypes.rst:3021 +#: ../../library/ctypes.rst:2547 msgid "" "If a pointer points to an array, its elements can be read and written using " "standard subscript and slice accesses. Pointer objects have no size, so :" @@ -4683,51 +3547,14 @@ msgstr "" "様に) ポインタの *前* のメモリから読み込み、範囲外の添え字はおそらく (幸運な" "場合でも) アクセス違反によりクラッシュを起こします。" -#: ../../library/ctypes.rst:3031 +#: ../../library/ctypes.rst:2557 msgid "Specifies the type pointed to." msgstr "ポイント先の型を指定します。" -#: ../../library/ctypes.rst:3035 +#: ../../library/ctypes.rst:2561 msgid "" "Returns the object to which to pointer points. Assigning to this attribute " "changes the pointer to point to the assigned object." msgstr "" "ポインタが指すオブジェクトを返します。この属性に割り当てると、ポインタが割り" "当てられたオブジェクトを指すようになります。" - -#: ../../library/ctypes.rst:3042 -msgid "Exceptions" -msgstr "例外" - -#: ../../library/ctypes.rst:3046 -msgid "" -"This exception is raised when a foreign function call cannot convert one of " -"the passed arguments." -msgstr "" -"この例外は外部関数呼び出しが渡された引数を変換できなかったときに送出されま" -"す。" - -#: ../../library/ctypes.rst:3052 -msgid "This exception is raised when a COM method call failed." -msgstr "" - -#: ../../library/ctypes.rst:3056 -msgid "The integer value representing the error code." -msgstr "" - -#: ../../library/ctypes.rst:3060 -msgid "The error message." -msgstr "" - -#: ../../library/ctypes.rst:3064 -msgid "The 5-tuple ``(descr, source, helpfile, helpcontext, progid)``." -msgstr "" - -#: ../../library/ctypes.rst:3066 -msgid "" -"*descr* is the textual description. *source* is the language-dependent " -"``ProgID`` for the class or application that raised the error. *helpfile* " -"is the path of the help file. *helpcontext* is the help context " -"identifier. *progid* is the ``ProgID`` of the interface that defined the " -"error." -msgstr "" diff --git a/library/curses.ascii.po b/library/curses.ascii.po index 54a63e3d1..ba6d762aa 100644 --- a/library/curses.ascii.po +++ b/library/curses.ascii.po @@ -1,39 +1,35 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 -# Arihiro TAKASE, 2023 -# Takeshi Nakazato, 2024 -# 石井明久, 2024 +# 秘湯 , 2017 +# Nozomu Kaneko , 2017 +# Arihiro TAKASE, 2017 +# tomo, 2019 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-13 14:21+0000\n" -"PO-Revision-Date: 2021-06-28 01:03+0000\n" -"Last-Translator: 石井明久, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 23:05+0000\n" +"Last-Translator: tomo, 2019\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/curses.ascii.rst:2 -msgid ":mod:`!curses.ascii` --- Utilities for ASCII characters" -msgstr ":mod:`!curses.ascii` --- ASCII 文字のユーティリティー" - -#: ../../library/curses.ascii.rst:10 -msgid "**Source code:** :source:`Lib/curses/ascii.py`" -msgstr "**ソースコード:** :source:`Lib/curses/ascii.py`" +msgid ":mod:`curses.ascii` --- Utilities for ASCII characters" +msgstr ":mod:`curses.ascii` --- ASCII 文字に関するユーティリティ" -#: ../../library/curses.ascii.rst:14 +#: ../../library/curses.ascii.rst:12 msgid "" "The :mod:`curses.ascii` module supplies name constants for ASCII characters " "and functions to test membership in various ASCII character classes. The " @@ -43,155 +39,299 @@ msgstr "" "ASCII 文字区分についてある文字が帰属するかどうかを調べる関数を提供します。こ" "のモジュールで提供されている定数は以下の制御文字の名前です:" -#: ../../library/curses.ascii.rst:19 +#: ../../library/curses.ascii.rst:17 msgid "Name" msgstr "名前" -#: ../../library/curses.ascii.rst:19 +#: ../../library/curses.ascii.rst:17 msgid "Meaning" msgstr "意味" -#: ../../library/curses.ascii.rst:23 +#: ../../library/curses.ascii.rst:19 +msgid ":const:`NUL`" +msgstr ":const:`NUL`" + +#: ../../library/curses.ascii.rst:21 +msgid ":const:`SOH`" +msgstr ":const:`SOH`" + +#: ../../library/curses.ascii.rst:21 msgid "Start of heading, console interrupt" msgstr "ヘディング開始、コンソール割り込み" -#: ../../library/curses.ascii.rst:25 +#: ../../library/curses.ascii.rst:23 +msgid ":const:`STX`" +msgstr ":const:`STX`" + +#: ../../library/curses.ascii.rst:23 msgid "Start of text" msgstr "テキスト開始" -#: ../../library/curses.ascii.rst:27 +#: ../../library/curses.ascii.rst:25 +msgid ":const:`ETX`" +msgstr ":const:`ETX`" + +#: ../../library/curses.ascii.rst:25 msgid "End of text" msgstr "テキスト終了" -#: ../../library/curses.ascii.rst:29 +#: ../../library/curses.ascii.rst:27 +msgid ":const:`EOT`" +msgstr ":const:`EOT`" + +#: ../../library/curses.ascii.rst:27 msgid "End of transmission" msgstr "テキスト伝送終了" -#: ../../library/curses.ascii.rst:31 +#: ../../library/curses.ascii.rst:29 +msgid ":const:`ENQ`" +msgstr ":const:`ENQ`" + +#: ../../library/curses.ascii.rst:29 msgid "Enquiry, goes with :const:`ACK` flow control" msgstr "問い合わせ、 :const:`ACK` フロー制御時に使用" -#: ../../library/curses.ascii.rst:33 +#: ../../library/curses.ascii.rst:31 +msgid ":const:`ACK`" +msgstr ":const:`ACK`" + +#: ../../library/curses.ascii.rst:31 msgid "Acknowledgement" msgstr "肯定応答" -#: ../../library/curses.ascii.rst:35 +#: ../../library/curses.ascii.rst:33 +msgid ":const:`BEL`" +msgstr ":const:`BEL`" + +#: ../../library/curses.ascii.rst:33 msgid "Bell" msgstr "ベル" -#: ../../library/curses.ascii.rst:37 +#: ../../library/curses.ascii.rst:35 +msgid ":const:`BS`" +msgstr ":const:`BS`" + +#: ../../library/curses.ascii.rst:35 msgid "Backspace" msgstr "一文字後退" -#: ../../library/curses.ascii.rst:39 +#: ../../library/curses.ascii.rst:37 +msgid ":const:`TAB`" +msgstr ":const:`TAB`" + +#: ../../library/curses.ascii.rst:37 msgid "Tab" msgstr "タブ" -#: ../../library/curses.ascii.rst:41 +#: ../../library/curses.ascii.rst:39 +msgid ":const:`HT`" +msgstr ":const:`HT`" + +#: ../../library/curses.ascii.rst:39 msgid "Alias for :const:`TAB`: \"Horizontal tab\"" msgstr ":const:`TAB` の別名: \"水平タブ\"" -#: ../../library/curses.ascii.rst:43 +#: ../../library/curses.ascii.rst:41 +msgid ":const:`LF`" +msgstr ":const:`LF`" + +#: ../../library/curses.ascii.rst:41 msgid "Line feed" msgstr "改行" -#: ../../library/curses.ascii.rst:45 +#: ../../library/curses.ascii.rst:43 +msgid ":const:`NL`" +msgstr ":const:`NL`" + +#: ../../library/curses.ascii.rst:43 msgid "Alias for :const:`LF`: \"New line\"" msgstr ":const:`LF` の別名: \"改行\"" -#: ../../library/curses.ascii.rst:47 +#: ../../library/curses.ascii.rst:45 +msgid ":const:`VT`" +msgstr ":const:`VT`" + +#: ../../library/curses.ascii.rst:45 msgid "Vertical tab" msgstr "垂直タブ" -#: ../../library/curses.ascii.rst:49 +#: ../../library/curses.ascii.rst:47 +msgid ":const:`FF`" +msgstr ":const:`FF`" + +#: ../../library/curses.ascii.rst:47 msgid "Form feed" msgstr "改頁" -#: ../../library/curses.ascii.rst:51 +#: ../../library/curses.ascii.rst:49 +msgid ":const:`CR`" +msgstr ":const:`CR`" + +#: ../../library/curses.ascii.rst:49 msgid "Carriage return" msgstr "復帰" -#: ../../library/curses.ascii.rst:53 +#: ../../library/curses.ascii.rst:51 +msgid ":const:`SO`" +msgstr ":const:`SO`" + +#: ../../library/curses.ascii.rst:51 msgid "Shift-out, begin alternate character set" msgstr "シフトアウト、他の文字セットの開始" -#: ../../library/curses.ascii.rst:55 +#: ../../library/curses.ascii.rst:53 +msgid ":const:`SI`" +msgstr ":const:`SI`" + +#: ../../library/curses.ascii.rst:53 msgid "Shift-in, resume default character set" msgstr "シフトイン、標準の文字セットに復帰" -#: ../../library/curses.ascii.rst:57 +#: ../../library/curses.ascii.rst:55 +msgid ":const:`DLE`" +msgstr ":const:`DLE`" + +#: ../../library/curses.ascii.rst:55 msgid "Data-link escape" msgstr "データリンクでのエスケープ" -#: ../../library/curses.ascii.rst:59 +#: ../../library/curses.ascii.rst:57 +msgid ":const:`DC1`" +msgstr ":const:`DC1`" + +#: ../../library/curses.ascii.rst:57 msgid "XON, for flow control" msgstr "装置制御 1、フロー制御のための XON" -#: ../../library/curses.ascii.rst:61 +#: ../../library/curses.ascii.rst:59 +msgid ":const:`DC2`" +msgstr ":const:`DC2`" + +#: ../../library/curses.ascii.rst:59 msgid "Device control 2, block-mode flow control" msgstr "装置制御 2、ブロックモードフロー制御" -#: ../../library/curses.ascii.rst:63 +#: ../../library/curses.ascii.rst:61 +msgid ":const:`DC3`" +msgstr ":const:`DC3`" + +#: ../../library/curses.ascii.rst:61 msgid "XOFF, for flow control" msgstr "装置制御 3、フロー制御のための XOFF" -#: ../../library/curses.ascii.rst:65 +#: ../../library/curses.ascii.rst:63 +msgid ":const:`DC4`" +msgstr ":const:`DC4`" + +#: ../../library/curses.ascii.rst:63 msgid "Device control 4" msgstr "装置制御 4" -#: ../../library/curses.ascii.rst:67 +#: ../../library/curses.ascii.rst:65 +msgid ":const:`NAK`" +msgstr ":const:`NAK`" + +#: ../../library/curses.ascii.rst:65 msgid "Negative acknowledgement" msgstr "否定応答" -#: ../../library/curses.ascii.rst:69 +#: ../../library/curses.ascii.rst:67 +msgid ":const:`SYN`" +msgstr ":const:`SYN`" + +#: ../../library/curses.ascii.rst:67 msgid "Synchronous idle" msgstr "同期信号" -#: ../../library/curses.ascii.rst:71 +#: ../../library/curses.ascii.rst:69 +msgid ":const:`ETB`" +msgstr ":const:`ETB`" + +#: ../../library/curses.ascii.rst:69 msgid "End transmission block" msgstr "ブロック転送終了" -#: ../../library/curses.ascii.rst:73 +#: ../../library/curses.ascii.rst:71 +msgid ":const:`CAN`" +msgstr ":const:`CAN`" + +#: ../../library/curses.ascii.rst:71 msgid "Cancel" msgstr "キャンセル (Cancel)" -#: ../../library/curses.ascii.rst:75 +#: ../../library/curses.ascii.rst:73 +msgid ":const:`EM`" +msgstr ":const:`EM`" + +#: ../../library/curses.ascii.rst:73 msgid "End of medium" msgstr "媒体終端" -#: ../../library/curses.ascii.rst:77 +#: ../../library/curses.ascii.rst:75 +msgid ":const:`SUB`" +msgstr ":const:`SUB`" + +#: ../../library/curses.ascii.rst:75 msgid "Substitute" msgstr "代入文字" -#: ../../library/curses.ascii.rst:79 +#: ../../library/curses.ascii.rst:77 +msgid ":const:`ESC`" +msgstr ":const:`ESC`" + +#: ../../library/curses.ascii.rst:77 msgid "Escape" msgstr "エスケープ文字" -#: ../../library/curses.ascii.rst:81 +#: ../../library/curses.ascii.rst:79 +msgid ":const:`FS`" +msgstr ":const:`FS`" + +#: ../../library/curses.ascii.rst:79 msgid "File separator" msgstr "ファイル区切り文字" -#: ../../library/curses.ascii.rst:83 +#: ../../library/curses.ascii.rst:81 +msgid ":const:`GS`" +msgstr ":const:`GS`" + +#: ../../library/curses.ascii.rst:81 msgid "Group separator" msgstr "グループ区切り文字" -#: ../../library/curses.ascii.rst:85 +#: ../../library/curses.ascii.rst:83 +msgid ":const:`RS`" +msgstr ":const:`RS`" + +#: ../../library/curses.ascii.rst:83 msgid "Record separator, block-mode terminator" msgstr "レコード区切り文字、ブロックモード終了子" -#: ../../library/curses.ascii.rst:87 +#: ../../library/curses.ascii.rst:85 +msgid ":const:`US`" +msgstr ":const:`US`" + +#: ../../library/curses.ascii.rst:85 msgid "Unit separator" msgstr "単位区切り文字" -#: ../../library/curses.ascii.rst:89 +#: ../../library/curses.ascii.rst:87 +msgid ":const:`SP`" +msgstr ":const:`SP`" + +#: ../../library/curses.ascii.rst:87 msgid "Space" msgstr "空白文字" -#: ../../library/curses.ascii.rst:91 +#: ../../library/curses.ascii.rst:89 +msgid ":const:`DEL`" +msgstr ":const:`DEL`" + +#: ../../library/curses.ascii.rst:89 msgid "Delete" msgstr "削除" -#: ../../library/curses.ascii.rst:94 +#: ../../library/curses.ascii.rst:92 msgid "" "Note that many of these have little practical significance in modern usage. " "The mnemonics derive from teleprinter conventions that predate digital " @@ -201,7 +341,7 @@ msgstr "" "注意してください。これらのニーモニック符号はデジタル計算機より前のテレプリン" "タにおける慣習から付けられたものです。" -#: ../../library/curses.ascii.rst:97 +#: ../../library/curses.ascii.rst:95 msgid "" "The module supplies the following functions, patterned on those in the " "standard C library:" @@ -209,14 +349,14 @@ msgstr "" "このモジュールでは、標準 C ライブラリの関数を雛型とする以下の関数をサポートし" "ています:" -#: ../../library/curses.ascii.rst:103 +#: ../../library/curses.ascii.rst:101 msgid "" "Checks for an ASCII alphanumeric character; it is equivalent to ``isalpha(c) " "or isdigit(c)``." msgstr "" "ASCII 英数文字かどうかを調べます; ``isalpha(c) or isdigit(c)`` と等価です。" -#: ../../library/curses.ascii.rst:109 +#: ../../library/curses.ascii.rst:107 msgid "" "Checks for an ASCII alphabetic character; it is equivalent to ``isupper(c) " "or islower(c)``." @@ -224,20 +364,20 @@ msgstr "" "ASCII アルファベット文字かどうかを調べます; ``isupper(c) or islower(c)`` と等" "価です。" -#: ../../library/curses.ascii.rst:115 +#: ../../library/curses.ascii.rst:113 msgid "Checks for a character value that fits in the 7-bit ASCII set." msgstr "文字が 7 ビット ASCII 文字に合致するかどうかを調べます。" -#: ../../library/curses.ascii.rst:120 +#: ../../library/curses.ascii.rst:118 msgid "Checks for an ASCII whitespace character; space or horizontal tab." msgstr "ASCII 余白文字、すなわち空白または水平タブかどうかを調べます。" -#: ../../library/curses.ascii.rst:125 +#: ../../library/curses.ascii.rst:123 msgid "" "Checks for an ASCII control character (in the range 0x00 to 0x1f or 0x7f)." msgstr "ASCII 制御文字 (0x00 から 0x1f の範囲または 0x7f) かどうかを調べます。" -#: ../../library/curses.ascii.rst:130 +#: ../../library/curses.ascii.rst:128 msgid "" "Checks for an ASCII decimal digit, ``'0'`` through ``'9'``. This is " "equivalent to ``c in string.digits``." @@ -245,25 +385,25 @@ msgstr "" "ASCII 10 進数字、すなわち ``'0'`` から ``'9'`` までの文字かどうかを調べます。" "``c in string.digits`` と等価です。" -#: ../../library/curses.ascii.rst:136 +#: ../../library/curses.ascii.rst:134 msgid "Checks for ASCII any printable character except space." msgstr "空白以外の ASCII 印字可能文字かどうかを調べます。" -#: ../../library/curses.ascii.rst:141 +#: ../../library/curses.ascii.rst:139 msgid "Checks for an ASCII lower-case character." msgstr "ASCII 小文字かどうかを調べます。" -#: ../../library/curses.ascii.rst:146 +#: ../../library/curses.ascii.rst:144 msgid "Checks for any ASCII printable character including space." msgstr "空白文字を含め、ASCII 印字可能文字かどうかを調べます。" -#: ../../library/curses.ascii.rst:151 +#: ../../library/curses.ascii.rst:149 msgid "" "Checks for any printable ASCII character which is not a space or an " "alphanumeric character." msgstr "空白または英数字以外の ASCII 印字可能文字かどうかを調べます。" -#: ../../library/curses.ascii.rst:157 +#: ../../library/curses.ascii.rst:155 msgid "" "Checks for ASCII white-space characters; space, line feed, carriage return, " "form feed, horizontal tab, vertical tab." @@ -271,26 +411,26 @@ msgstr "" "ASCII 余白文字、すなわち空白、改行、復帰、改頁、水平タブ、垂直タブかどうかを" "調べます。" -#: ../../library/curses.ascii.rst:163 +#: ../../library/curses.ascii.rst:161 msgid "Checks for an ASCII uppercase letter." msgstr "ASCII 大文字かどうかを調べます。" -#: ../../library/curses.ascii.rst:168 +#: ../../library/curses.ascii.rst:166 msgid "" "Checks for an ASCII hexadecimal digit. This is equivalent to ``c in string." "hexdigits``." msgstr "" "ASCII 16 進数字かどうかを調べます。``c in string.hexdigits`` と等価です。" -#: ../../library/curses.ascii.rst:174 +#: ../../library/curses.ascii.rst:172 msgid "Checks for an ASCII control character (ordinal values 0 to 31)." msgstr "ASCII 制御文字 (0 から 31 までの値) かどうかを調べます。" -#: ../../library/curses.ascii.rst:179 +#: ../../library/curses.ascii.rst:177 msgid "Checks for a non-ASCII character (ordinal values 0x80 and above)." msgstr "非 ASCII 文字 (0x80 またはそれ以上の値) かどうかを調べます。" -#: ../../library/curses.ascii.rst:181 +#: ../../library/curses.ascii.rst:179 msgid "" "These functions accept either integers or single-character strings; when the " "argument is a string, it is first converted using the built-in function :" @@ -299,7 +439,7 @@ msgstr "" "これらの関数は数字も 1 文字の文字列も使えます; 引数を文字列にした場合、組み込" "み関数 :func:`ord` を使って変換されます。" -#: ../../library/curses.ascii.rst:184 +#: ../../library/curses.ascii.rst:182 msgid "" "Note that all these functions check ordinal bit values derived from the " "character of the string you pass in; they do not actually know anything " @@ -309,7 +449,7 @@ msgstr "" "注意してください; 関数はホスト計算機で使われている文字列エンコーディングにつ" "いて何ら関知しません。" -#: ../../library/curses.ascii.rst:188 +#: ../../library/curses.ascii.rst:186 msgid "" "The following two functions take either a single-character string or integer " "byte value; they return a value of the same type." @@ -317,11 +457,11 @@ msgstr "" "以下の 2 つの関数は、引数として 1 文字の文字列または整数で表したバイト値のど" "ちらでもとり得ます; これらの関数は引数と同じ型で値を返します。" -#: ../../library/curses.ascii.rst:194 +#: ../../library/curses.ascii.rst:192 msgid "Return the ASCII value corresponding to the low 7 bits of *c*." msgstr "ASCII 値を返します。*c* の下位 7 ビットに対応します。" -#: ../../library/curses.ascii.rst:199 +#: ../../library/curses.ascii.rst:197 msgid "" "Return the control character corresponding to the given character (the " "character bit value is bitwise-anded with 0x1f)." @@ -329,7 +469,7 @@ msgstr "" "与えた文字に対応する制御文字を返します (0x1f とビット単位で論理積を取りま" "す)。" -#: ../../library/curses.ascii.rst:205 +#: ../../library/curses.ascii.rst:203 msgid "" "Return the 8-bit character corresponding to the given ASCII character (the " "character bit value is bitwise-ored with 0x80)." @@ -337,7 +477,7 @@ msgstr "" "与えた文字に対応する 8 ビット文字を返します (0x80 とビット単位で論理和を取り" "ます)。" -#: ../../library/curses.ascii.rst:208 +#: ../../library/curses.ascii.rst:206 msgid "" "The following function takes either a single-character string or integer " "value; it returns a string." @@ -345,7 +485,7 @@ msgstr "" "以下の関数は 1 文字からなる文字列値または整数値を引数に取り、文字列を返しま" "す。" -#: ../../library/curses.ascii.rst:218 +#: ../../library/curses.ascii.rst:216 msgid "" "Return a string representation of the ASCII character *c*. If *c* is " "printable, this string is the character itself. If the character is a " @@ -363,7 +503,7 @@ msgstr "" "*c* のメタビット (0x80) がセットされていれば、メタビットは取り去られ、前述の" "ルールが適用され、``'!'`` が前につけられます。" -#: ../../library/curses.ascii.rst:228 +#: ../../library/curses.ascii.rst:226 msgid "" "A 33-element string array that contains the ASCII mnemonics for the thirty-" "two ASCII control characters from 0 (NUL) to 0x1f (US), in order, plus the " @@ -371,15 +511,3 @@ msgid "" msgstr "" "0 (NUL) から 0x1f (US) までの 32 の ASCII 制御文字と、空白文字 ``SP`` のニー" "モニック符号名からなる 33 要素の文字列によるシーケンスです。" - -#: ../../library/curses.ascii.rst:212 -msgid "^ (caret)" -msgstr "^ (キャレット)" - -#: ../../library/curses.ascii.rst:212 -msgid "in curses module" -msgstr "curses モジュール内" - -#: ../../library/curses.ascii.rst:212 -msgid "! (exclamation)" -msgstr "! (エクスクラメーション)" diff --git a/library/curses.panel.po b/library/curses.panel.po index 2a6d9996e..a091add04 100644 --- a/library/curses.panel.po +++ b/library/curses.panel.po @@ -1,31 +1,31 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 -# 石井明久, 2024 +# Arihiro TAKASE, 2017 +# tomo, 2019 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-13 14:21+0000\n" -"PO-Revision-Date: 2021-06-28 01:03+0000\n" -"Last-Translator: 石井明久, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 23:05+0000\n" +"Last-Translator: tomo, 2019\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/curses.panel.rst:2 -msgid ":mod:`!curses.panel` --- A panel stack extension for curses" -msgstr ":mod:`!curses.panel` --- curses のためのパネルスタック拡張" +msgid ":mod:`curses.panel` --- A panel stack extension for curses" +msgstr ":mod:`curses.panel` --- curses のためのパネルスタック拡張" #: ../../library/curses.panel.rst:11 msgid "" diff --git a/library/curses.po b/library/curses.po index ad7f4782d..04d3a0345 100644 --- a/library/curses.po +++ b/library/curses.po @@ -1,40 +1,40 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Osamu NAKAMURA, 2021 +# Ryuichi Takano , 2017 +# Inada Naoki , 2017 +# Shun Sakurai, 2017 +# 秘湯 , 2017 +# Masato HASHIMOTO , 2017 +# Arihiro TAKASE, 2017 +# tomo, 2017 # Takanori Suzuki , 2021 -# tomo, 2021 -# Arihiro TAKASE, 2023 -# 石井明久, 2024 +# Osamu NAKAMURA, 2021 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-06 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 01:03+0000\n" -"Last-Translator: 石井明久, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-04 05:03+0000\n" +"PO-Revision-Date: 2017-02-16 23:05+0000\n" +"Last-Translator: Osamu NAKAMURA, 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/curses.rst:2 -msgid ":mod:`!curses` --- Terminal handling for character-cell displays" -msgstr ":mod:`!curses` --- 文字セル表示のターミナル処理" +msgid ":mod:`curses` --- Terminal handling for character-cell displays" +msgstr ":mod:`curses` --- 文字セル表示を扱うための端末操作" -#: ../../library/curses.rst:12 -msgid "**Source code:** :source:`Lib/curses`" -msgstr "**ソースコード:** :source:`Lib/curses`" - -#: ../../library/curses.rst:16 +#: ../../library/curses.rst:14 msgid "" "The :mod:`curses` module provides an interface to the curses library, the de-" "facto standard for portable advanced terminal handling." @@ -42,7 +42,7 @@ msgstr "" ":mod:`curses` モジュールは、可搬性のある高度な端末操作のデファクトスタンダー" "ドである、curses ライブラリへのインターフェースを提供します。" -#: ../../library/curses.rst:19 +#: ../../library/curses.rst:17 msgid "" "While curses is most widely used in the Unix environment, versions are " "available for Windows, DOS, and possibly other systems as well. This " @@ -54,51 +54,59 @@ msgstr "" "の拡張モジュールは Linux および BSD 系の Unixで動作するオープンソースの " "curses ライブラリである ncurses の API に合致するように設計されています。" -#: ../../includes/wasm-mobile-notavail.rst:3 -msgid "Availability" -msgstr "" - -#: ../../includes/wasm-mobile-notavail.rst:5 -msgid "" -"This module is not supported on :ref:`mobile platforms ` or :ref:`WebAssembly platforms `." -msgstr "" - -#: ../../library/curses.rst:28 +#: ../../library/curses.rst:24 msgid "" "Whenever the documentation mentions a *character* it can be specified as an " "integer, a one-character Unicode string or a one-byte byte string." msgstr "" -#: ../../library/curses.rst:31 +#: ../../library/curses.rst:27 msgid "" "Whenever the documentation mentions a *character string* it can be specified " "as a Unicode string or a byte string." msgstr "" -#: ../../library/curses.rst:36 +#: ../../library/curses.rst:32 +msgid "" +"Since version 5.4, the ncurses library decides how to interpret non-ASCII " +"data using the ``nl_langinfo`` function. That means that you have to call :" +"func:`locale.setlocale` in the application and encode Unicode strings using " +"one of the system's available encodings. This example uses the system's " +"default encoding::" +msgstr "" +"version 5.4 から、ncurses ライブラリは ``nl_langinfo`` 関数を利用して非 " +"ASCII データをどう解釈するかを決定するようになりました。これは、アプリケー" +"ションは :func:`locale.setlocale` 関数を呼び出して、Unicode 文字列をシステム" +"の利用可能なエンコーディングのどれかでエンコードする必要があることを意味しま" +"す。この例では、システムのデフォルトエンコーディングを利用しています::" + +#: ../../library/curses.rst:42 +msgid "Then use *code* as the encoding for :meth:`str.encode` calls." +msgstr "この後、:meth:`str.encode` を呼び出すときに *code* を利用します。" + +#: ../../library/curses.rst:47 msgid "Module :mod:`curses.ascii`" msgstr ":mod:`curses.ascii` モジュール" -#: ../../library/curses.rst:37 +#: ../../library/curses.rst:47 msgid "" "Utilities for working with ASCII characters, regardless of your locale " "settings." msgstr "ロケール設定に関わらず ASCII 文字を扱うためのユーティリティ。" -#: ../../library/curses.rst:39 +#: ../../library/curses.rst:50 msgid "Module :mod:`curses.panel`" msgstr ":mod:`curses.panel` モジュール" -#: ../../library/curses.rst:40 +#: ../../library/curses.rst:50 msgid "A panel stack extension that adds depth to curses windows." msgstr "curses ウィンドウにデプス機能を追加するパネルスタック拡張。" -#: ../../library/curses.rst:42 +#: ../../library/curses.rst:53 msgid "Module :mod:`curses.textpad`" msgstr ":mod:`curses.textpad` モジュール" -#: ../../library/curses.rst:43 +#: ../../library/curses.rst:53 msgid "" "Editable text widget for curses supporting :program:`Emacs`\\ -like " "bindings." @@ -106,11 +114,11 @@ msgstr "" ":program:`Emacs` ライクなキーバインディングをサポートする編集可能な curses 用" "テキストウィジェット。" -#: ../../library/curses.rst:45 +#: ../../library/curses.rst:57 msgid ":ref:`curses-howto`" msgstr ":ref:`curses-howto`" -#: ../../library/curses.rst:46 +#: ../../library/curses.rst:56 msgid "" "Tutorial material on using curses with Python, by Andrew Kuchling and Eric " "Raymond." @@ -118,19 +126,29 @@ msgstr "" "Andrew Kuchling および Eric Raymond によって書かれた、curses を Python で使う" "ためのチュートリアルです。" -#: ../../library/curses.rst:53 +#: ../../library/curses.rst:59 +msgid "" +"The :source:`Tools/demo/` directory in the Python source distribution " +"contains some example programs using the curses bindings provided by this " +"module." +msgstr "" +"Python ソースコードの :source:`Tools/demo/` ディレクトリには、このモジュール" +"で提供されている curses バインディングを使ったプログラム例がいくつか収められ" +"ています。" + +#: ../../library/curses.rst:66 msgid "Functions" msgstr "関数" -#: ../../library/curses.rst:55 +#: ../../library/curses.rst:68 msgid "The module :mod:`curses` defines the following exception:" msgstr ":mod:`curses` モジュールでは以下の例外を定義しています:" -#: ../../library/curses.rst:60 +#: ../../library/curses.rst:73 msgid "Exception raised when a curses library function returns an error." msgstr "curses ライブラリ関数がエラーを返した際に送出される例外です。" -#: ../../library/curses.rst:64 +#: ../../library/curses.rst:77 msgid "" "Whenever *x* or *y* arguments to a function or a method are optional, they " "default to the current cursor location. Whenever *attr* is optional, it " @@ -140,29 +158,11 @@ msgstr "" "値は常に現在のカーソルになります。オプションの *attr* がある場合、デフォルト" "値は :const:`A_NORMAL` です。" -#: ../../library/curses.rst:68 +#: ../../library/curses.rst:81 msgid "The module :mod:`curses` defines the following functions:" msgstr ":mod:`curses` では以下の関数を定義しています:" -#: ../../library/curses.rst:73 -msgid "" -"Allow use of default values for colors on terminals supporting this feature. " -"Use this to support transparency in your application." -msgstr "" - -#: ../../library/curses.rst:76 -msgid "" -"Assign terminal default foreground/background colors to color number ``-1``. " -"So ``init_pair(x, COLOR_RED, -1)`` will initialize pair *x* as red on " -"default background and ``init_pair(x, -1, COLOR_BLUE)`` will initialize pair " -"*x* as default foreground on blue." -msgstr "" - -#: ../../library/curses.rst:81 -msgid "Change the definition of the color-pair ``0`` to ``(fg, bg)``." -msgstr "" - -#: ../../library/curses.rst:88 +#: ../../library/curses.rst:86 msgid "" "Return the output speed of the terminal in bits per second. On software " "terminal emulators it will have a fixed high value. Included for historical " @@ -175,11 +175,11 @@ msgstr "" "れたり、行速度に応じてインターフェースを切り替えたりするために用いられたりし" "ていました。" -#: ../../library/curses.rst:96 +#: ../../library/curses.rst:94 msgid "Emit a short attention sound." msgstr "注意を促す短い音を鳴らします。" -#: ../../library/curses.rst:101 +#: ../../library/curses.rst:99 msgid "" "Return ``True`` or ``False``, depending on whether the programmer can change " "the colors displayed by the terminal." @@ -187,7 +187,7 @@ msgstr "" "端末に表示される色をプログラマが変更できるか否かによって、``True`` または " "``False`` を返します。" -#: ../../library/curses.rst:107 +#: ../../library/curses.rst:105 msgid "" "Enter cbreak mode. In cbreak mode (sometimes called \"rare\" mode) normal " "tty line buffering is turned off and characters are available to be read one " @@ -203,7 +203,7 @@ msgstr "" "出し側のプログラムに対する通常の効果をもっています。まず :func:`raw` を呼び出" "し、次いで :func:`cbreak` を呼び出すと、端末を cbreak モードにします。" -#: ../../library/curses.rst:116 +#: ../../library/curses.rst:114 msgid "" "Return the intensity of the red, green, and blue (RGB) components in the " "color *color_number*, which must be between ``0`` and ``COLORS - 1``. " @@ -216,16 +216,15 @@ msgstr "" "れた色の R、G、B、の値からなる三要素のタプルが返されます。この値は ``0`` (そ" "の成分はない) から ``1000`` (その成分の最大強度) の範囲をとります。" -#: ../../library/curses.rst:124 +#: ../../library/curses.rst:122 msgid "" "Return the attribute value for displaying text in the specified color pair. " "Only the first 256 color pairs are supported. This attribute value can be " "combined with :const:`A_STANDOUT`, :const:`A_REVERSE`, and the other :const:" -"`!A_\\*` attributes. :func:`pair_number` is the counterpart to this " -"function." +"`A_\\*` attributes. :func:`pair_number` is the counterpart to this function." msgstr "" -#: ../../library/curses.rst:133 +#: ../../library/curses.rst:131 msgid "" "Set the cursor state. *visibility* can be set to ``0``, ``1``, or ``2``, " "for invisible, normal, or very visible. If the terminal supports the " @@ -239,7 +238,7 @@ msgstr "" "ば例外が送出されます。多くの端末では、\"可視 (通常)\" モードは下線カーソル" "で、\"非常に可視\" モードはブロックカーソルです。" -#: ../../library/curses.rst:142 +#: ../../library/curses.rst:140 msgid "" "Save the current terminal mode as the \"program\" mode, the mode when the " "running program is using curses. (Its counterpart is the \"shell\" mode, " @@ -251,7 +250,7 @@ msgstr "" "わない \"シェル\" モードです。) その後 :func:`reset_prog_mode` を呼ぶとこの" "モードを復旧します。" -#: ../../library/curses.rst:150 +#: ../../library/curses.rst:148 msgid "" "Save the current terminal mode as the \"shell\" mode, the mode when the " "running program is not using curses. (Its counterpart is the \"program\" " @@ -263,11 +262,11 @@ msgstr "" "curses 機能を利用している \"プログラム\" モードです。) その後 :func:" "`reset_shell_mode` を呼ぶとこのモードを復旧します。" -#: ../../library/curses.rst:158 +#: ../../library/curses.rst:156 msgid "Insert an *ms* millisecond pause in output." msgstr "出力に *ms* ミリ秒の一時停止を入れます。" -#: ../../library/curses.rst:163 +#: ../../library/curses.rst:161 msgid "" "Update the physical screen. The curses library keeps two data structures, " "one representing the current physical screen contents and a virtual screen " @@ -279,7 +278,7 @@ msgstr "" "造を保持しています。:func:`doupdate` は更新を適用し、物理スクリーンを仮想スク" "リーンに一致させます。" -#: ../../library/curses.rst:168 +#: ../../library/curses.rst:166 msgid "" "The virtual screen may be updated by a :meth:`~window.noutrefresh` call " "after write operations such as :meth:`~window.addstr` have been performed on " @@ -297,7 +296,7 @@ msgstr "" "け :func:`!doupdate` を呼ぶことで、パフォーマンスを向上させることができ、おそ" "らくスクリーンのちらつきも押さえることができます。" -#: ../../library/curses.rst:178 +#: ../../library/curses.rst:176 msgid "" "Enter echo mode. In echo mode, each character input is echoed to the screen " "as it is entered." @@ -305,11 +304,11 @@ msgstr "" "echo モードに入ります。echo モードでは、各文字入力はスクリーン上に入力された" "通りにエコーバックされます。" -#: ../../library/curses.rst:184 +#: ../../library/curses.rst:182 msgid "De-initialize the library, and return terminal to normal status." msgstr "ライブラリの非初期化を行い、端末を通常の状態に戻します。" -#: ../../library/curses.rst:189 +#: ../../library/curses.rst:187 msgid "" "Return the user's current erase character as a one-byte bytes object. Under " "Unix operating systems this is a property of the controlling tty of the " @@ -319,7 +318,7 @@ msgstr "" "ます。Unix オペレーティングシステムでは、この値は curses プログラムが制御して" "いる端末の属性であり、curses ライブラリ自体では設定されません。" -#: ../../library/curses.rst:196 +#: ../../library/curses.rst:194 msgid "" "The :func:`.filter` routine, if used, must be called before :func:`initscr` " "is called. The effect is that, during those calls, :envvar:`LINES` is set " @@ -337,7 +336,7 @@ msgstr "" "で、スクリーンの更新も同様に制限されます。この関数は、スクリーンの他の部分に" "影響を及ぼさずに文字単位の行編集を行う場合に利用できます。" -#: ../../library/curses.rst:206 +#: ../../library/curses.rst:204 msgid "" "Flash the screen. That is, change it to reverse-video and then change it " "back in a short interval. Some people prefer such as 'visible bell' to the " @@ -347,7 +346,7 @@ msgstr "" "す。人によっては、:func:`beep` で生成される注意音よりも、このような \"目に見" "えるベル\" を好みます。" -#: ../../library/curses.rst:213 +#: ../../library/curses.rst:211 msgid "" "Flush all input buffers. This throws away any typeahead that has been " "typed by the user and has not yet been processed by the program." @@ -356,7 +355,7 @@ msgstr "" "されているが、まだプログラムによって処理されていないすべての先行入力文字を破" "棄します。" -#: ../../library/curses.rst:219 +#: ../../library/curses.rst:217 msgid "" "After :meth:`~window.getch` returns :const:`KEY_MOUSE` to signal a mouse " "event, this method should be called to retrieve the queued mouse event, " @@ -365,7 +364,7 @@ msgid "" "coordinates. (*z* is currently unused.) *bstate* is an integer value whose " "bits will be set to indicate the type of event, and will be the bitwise OR " "of one or more of the following constants, where *n* is the button number " -"from 1 to 5: :const:`BUTTONn_PRESSED`, :const:`BUTTONn_RELEASED`, :const:" +"from 1 to 4: :const:`BUTTONn_PRESSED`, :const:`BUTTONn_RELEASED`, :const:" "`BUTTONn_CLICKED`, :const:`BUTTONn_DOUBLE_CLICKED`, :const:" "`BUTTONn_TRIPLE_CLICKED`, :const:`BUTTON_SHIFT`, :const:`BUTTON_CTRL`, :" "const:`BUTTON_ALT`." @@ -377,18 +376,12 @@ msgstr "" "トの座標値です。(現在 *z* は使われていません) *bstate* は整数値で、その各ビッ" "トはイベントのタイプを示す値に設定されています。この値は以下に示す定数のうち" "一つまたはそれ以上のビット単位 OR になっています。以下の定数の *n* は 1 か" -"ら 5 のボタン番号を示します: :const:`BUTTONn_PRESSED`, :const:" +"ら 4 のボタン番号を示します: :const:`BUTTONn_PRESSED`, :const:" "`BUTTONn_RELEASED`, :const:`BUTTONn_CLICKED`, :const:" "`BUTTONn_DOUBLE_CLICKED`, :const:`BUTTONn_TRIPLE_CLICKED`, :const:" "`BUTTON_SHIFT`, :const:`BUTTON_CTRL`, :const:`BUTTON_ALT`。" -#: ../../library/curses.rst:230 ../../library/curses.rst:1797 -msgid "" -"The ``BUTTON5_*`` constants are now exposed if they are provided by the " -"underlying curses library." -msgstr "" - -#: ../../library/curses.rst:237 +#: ../../library/curses.rst:231 msgid "" "Return the current coordinates of the virtual screen cursor as a tuple ``(y, " "x)``. If :meth:`leaveok ` is currently ``True``, then " @@ -397,14 +390,17 @@ msgstr "" "仮想スクリーンにおける現在のカーソル位置をタプル ``(y, x)`` で返します。 :" "meth:`leaveok` が ``True`` に設定されていれば、 ``(-1, -1)`` が返されます。" -#: ../../library/curses.rst:243 +#: ../../library/curses.rst:237 msgid "" -"Read window related data stored in the file by an earlier :func:`window." -"putwin` call. The routine then creates and initializes a new window using " -"that data, returning the new window object." +"Read window related data stored in the file by an earlier :func:`putwin` " +"call. The routine then creates and initializes a new window using that data, " +"returning the new window object." msgstr "" +"以前の :func:`putwin` 呼び出しでファイルに保存されている、ウィンドウ関連デー" +"タを読み出します。次に、このルーチンはそのデータを使って新たなウィンドウを生" +"成し初期化して、その新規ウィンドウオブジェクトを返します。" -#: ../../library/curses.rst:250 +#: ../../library/curses.rst:244 msgid "" "Return ``True`` if the terminal can display colors; otherwise, return " "``False``." @@ -412,18 +408,7 @@ msgstr "" "端末が色表示を行える場合には ``True`` を返します。そうでない場合には " "``False`` を返します。" -#: ../../library/curses.rst:254 -msgid "" -"Return ``True`` if the module supports extended colors; otherwise, return " -"``False``. Extended color support allows more than 256 color pairs for " -"terminals that support more than 16 colors (e.g. xterm-256color)." -msgstr "" - -#: ../../library/curses.rst:258 -msgid "Extended color support requires ncurses version 6.1 or later." -msgstr "" - -#: ../../library/curses.rst:264 +#: ../../library/curses.rst:249 msgid "" "Return ``True`` if the terminal has insert- and delete-character " "capabilities. This function is included for historical reasons only, as all " @@ -433,7 +418,7 @@ msgstr "" "レータはどれもこの機能を持っており、この関数は歴史的な理由のためだけに存在し" "ています。" -#: ../../library/curses.rst:271 +#: ../../library/curses.rst:256 msgid "" "Return ``True`` if the terminal has insert- and delete-line capabilities, or " "can simulate them using scrolling regions. This function is included for " @@ -444,7 +429,7 @@ msgstr "" "タはどれもこの機能を持っていて、この関数は歴史的な理由のためだけに存在してい" "ます。" -#: ../../library/curses.rst:279 +#: ../../library/curses.rst:264 msgid "" "Take a key value *ch*, and return ``True`` if the current terminal type " "recognizes a key with that value." @@ -452,7 +437,7 @@ msgstr "" "キー値 *ch* をとり、現在の端末タイプがその値のキーを認識できる場合に " "``True`` を返します。" -#: ../../library/curses.rst:285 +#: ../../library/curses.rst:270 msgid "" "Used for half-delay mode, which is similar to cbreak mode in that characters " "typed by the user are immediately available to the program. However, after " @@ -466,40 +451,46 @@ msgstr "" "から ``255`` の間でなければなりません。半遅延モードから抜けるには :func:" "`nocbreak` を使います。" -#: ../../library/curses.rst:294 +#: ../../library/curses.rst:279 msgid "" "Change the definition of a color, taking the number of the color to be " "changed followed by three RGB values (for the amounts of red, green, and " "blue components). The value of *color_number* must be between ``0`` and " -"``COLORS - 1``. Each of *r*, *g*, *b*, must be a value between ``0`` and " +"`COLORS - 1`. Each of *r*, *g*, *b*, must be a value between ``0`` and " "``1000``. When :func:`init_color` is used, all occurrences of that color on " "the screen immediately change to the new definition. This function is a no-" "op on most terminals; it is active only if :func:`can_change_color` returns " "``True``." msgstr "" "色の定義を変更します。変更したい色番号と、その後に 3 つ組みの RGB 値 (赤、" -"緑、青の成分の大きさ) をとります。*color_number* の値は ``0`` から ``COLORS " -"- 1`` の間でなければなりません。*r*, *g*, *b* の値は ``0`` から ``1000`` の間" -"でなければなりません。:func:`init_color` を使うと、スクリーン上でカラーが使用" -"されている部分はすべて新しい設定に即時変更されます。この関数はほとんどの端末" -"で何も行いません; :func:`can_change_color` が ``True`` を返す場合にのみ動作し" -"ます。" +"緑、青の成分の大きさ) をとります。*color_number* の値は ``0`` から `COLORS - " +"1` の間でなければなりません。*r*, *g*, *b* の値は ``0`` から ``1000`` の間で" +"なければなりません。:func:`init_color` を使うと、スクリーン上でカラーが使用さ" +"れている部分はすべて新しい設定に即時変更されます。この関数はほとんどの端末で" +"何も行いません; :func:`can_change_color` が ``True`` を返す場合にのみ動作しま" +"す。" -#: ../../library/curses.rst:305 +#: ../../library/curses.rst:290 msgid "" "Change the definition of a color-pair. It takes three arguments: the number " "of the color-pair to be changed, the foreground color number, and the " "background color number. The value of *pair_number* must be between ``1`` " -"and ``COLOR_PAIRS - 1`` (the ``0`` color pair can only be changed by :func:" -"`use_default_colors` and :func:`assume_default_colors`). The value of *fg* " -"and *bg* arguments must be between ``0`` and ``COLORS - 1``, or, after " -"calling :func:`!use_default_colors` or :func:`!assume_default_colors`, " +"and ``COLOR_PAIRS - 1`` (the ``0`` color pair is wired to white on black and " +"cannot be changed). The value of *fg* and *bg* arguments must be between " +"``0`` and ``COLORS - 1``, or, after calling :func:`use_default_colors`, " "``-1``. If the color-pair was previously initialized, the screen is " "refreshed and all occurrences of that color-pair are changed to the new " "definition." msgstr "" +"色ペアの定義を変更します。3 つの引数: 変更したい色ペア、前景色の色番号、背景" +"色の色番号、をとります。*pair_number* は ``1`` から ``COLOR_PAIRS - 1`` の間" +"でなければなりません (``0`` 色ペアは黒色背景に白色前景となるように設定されて" +"おり、変更することができません)。*fg* および *bg* 引数は ``0`` と ``COLORS - " +"1`` の間、または、:func:`use_default_colors` を呼び出した後では ``-1`` でなけ" +"ればなりません。色ペアが以前に初期化されていれば、スクリーンを更新して、指定" +"された色ペアの部分を新たな設定に変更します。" -#: ../../library/curses.rst:320 +#: ../../library/curses.rst:303 msgid "" "Initialize the library. Return a :ref:`window ` " "object which represents the whole screen." @@ -507,7 +498,7 @@ msgstr "" "ライブラリを初期化します。スクリーン全体をあらわす :ref:`ウィンドウ ` オブジェクトを返します。" -#: ../../library/curses.rst:325 +#: ../../library/curses.rst:308 msgid "" "If there is an error opening the terminal, the underlying curses library may " "cause the interpreter to exit." @@ -515,7 +506,7 @@ msgstr "" "端末のオープン時にエラーが発生した場合、curses ライブラリによってインタープリ" "タが終了される場合があります。" -#: ../../library/curses.rst:331 +#: ../../library/curses.rst:314 msgid "" "Return ``True`` if :func:`resize_term` would modify the window structure, " "``False`` otherwise." @@ -523,7 +514,7 @@ msgstr "" ":func:`resize_term` によってウィンドウ構造が変更されている場合に ``True`` " "を、そうでない場合は ``False`` を返します。" -#: ../../library/curses.rst:337 +#: ../../library/curses.rst:320 msgid "" "Return ``True`` if :func:`endwin` has been called (that is, the curses " "library has been deinitialized)." @@ -531,7 +522,7 @@ msgstr "" ":func:`endwin` がすでに呼び出されている (すなわち、curses ライブラリが非初期" "化されてしまっている) 場合に ``True`` を返します。" -#: ../../library/curses.rst:343 +#: ../../library/curses.rst:326 msgid "" "Return the name of the key numbered *k* as a bytes object. The name of a " "key generating printable ASCII character is the key's character. The name " @@ -548,14 +539,14 @@ msgstr "" "Alt キーと組み合わせたキー (128--255) の名前は、先頭に ``b'M-'`` が付き、その" "後に対応する ASCII 文字が続く bytes オブジェクトになります。" -#: ../../library/curses.rst:353 +#: ../../library/curses.rst:336 msgid "" "Return the user's current line kill character as a one-byte bytes object. " "Under Unix operating systems this is a property of the controlling tty of " "the curses program, and is not set by the curses library itself." msgstr "" -#: ../../library/curses.rst:360 +#: ../../library/curses.rst:343 msgid "" "Return a bytes object containing the terminfo long name field describing the " "current terminal. The maximum length of a verbose description is 128 " @@ -565,7 +556,7 @@ msgstr "" "bytes オブジェクトを返します。verbose 形式記述の最大長は 128 文字です。この値" "は :func:`initscr` 呼び出しの後でのみ定義されています。" -#: ../../library/curses.rst:367 +#: ../../library/curses.rst:350 msgid "" "If *flag* is ``True``, allow 8-bit characters to be input. If *flag* is " "``False``, allow only 7-bit chars." @@ -573,18 +564,18 @@ msgstr "" "*flag* が ``True`` の場合、8 ビット文字の入力を許可します。*flag* が " "``False`` の場合、7 ビット文字だけを許可します。" -#: ../../library/curses.rst:373 +#: ../../library/curses.rst:356 msgid "" "Set the maximum time in milliseconds that can elapse between press and " "release events in order for them to be recognized as a click, and return the " -"previous interval value. The default value is 200 milliseconds, or one " -"fifth of a second." +"previous interval value. The default value is 200 msec, or one fifth of a " +"second." msgstr "" "ボタンが押されてから離されるまでの時間をマウスクリック一回として認識する最大" "の時間間隔をミリ秒で設定します。返り値は以前の内部設定値になります。デフォル" "トは 200 ミリ秒 (5 分の 1 秒) です。" -#: ../../library/curses.rst:380 +#: ../../library/curses.rst:363 msgid "" "Set the mouse events to be reported, and return a tuple ``(availmask, " "oldmask)``. *availmask* indicates which of the specified mouse events can " @@ -598,11 +589,11 @@ msgstr "" "*oldmask* は与えられたウィンドウの以前のマウスイベントマスクです。この関数が" "呼ばれない限り、マウスイベントは何も報告されません。" -#: ../../library/curses.rst:389 +#: ../../library/curses.rst:372 msgid "Sleep for *ms* milliseconds." msgstr "*ms* ミリ秒間スリープします。" -#: ../../library/curses.rst:394 +#: ../../library/curses.rst:377 msgid "" "Create and return a pointer to a new pad data structure with the given " "number of lines and columns. Return a pad as a window object." @@ -610,7 +601,7 @@ msgstr "" "与えられた行とカラム数を持つパッド (pad) データ構造を生成し、そのポインタを返" "します。パッドはウィンドウオブジェクトとして返されます。" -#: ../../library/curses.rst:397 +#: ../../library/curses.rst:380 msgid "" "A pad is like a window, except that it is not restricted by the screen size, " "and is not necessarily associated with a particular part of the screen. " @@ -630,13 +621,13 @@ msgstr "" "ンドウが必要であり、スクリーンにはそのウィンドウの一部しか一度に表示しない場" "合に使えます。(スクロールや入力エコーなどによる) パッドに対する再描画は起こり" "ません。パッドに対する :meth:`~window.refresh` および :meth:`~window." -"noutrefresh` メソッドは、パッド中の表示する部分と表示するために利用するスク" +"noutrefresh`メソッドは、パッド中の表示する部分と表示するために利用するスク" "リーン上の位置を指定する 6 つの引数が必要です。これらの引数は *pminrow*、" "*pmincol*、*sminrow*、*smincol*、*smaxrow*、*smaxcol* です; *p* で始まる引数" "はパッド中の表示領域の左上位置で、*s* で始まる引数はパッド領域を表示するスク" "リーン上のクリップ矩形を指定します。" -#: ../../library/curses.rst:413 +#: ../../library/curses.rst:396 msgid "" "Return a new :ref:`window `, whose left-upper corner " "is at ``(begin_y, begin_x)``, and whose height/width is *nlines*/*ncols*." @@ -644,7 +635,7 @@ msgstr "" "左上の角が ``(begin_y, begin_x)`` で、高さ/幅が *nlines* / *ncols* の新規 :" "ref:`ウィンドウ ` を返します。" -#: ../../library/curses.rst:416 +#: ../../library/curses.rst:399 msgid "" "By default, the window will extend from the specified position to the lower " "right corner of the screen." @@ -652,7 +643,7 @@ msgstr "" "デフォルトでは、ウィンドウは指定された位置からスクリーンの右下まで広がりま" "す。" -#: ../../library/curses.rst:422 +#: ../../library/curses.rst:405 msgid "" "Enter newline mode. This mode translates the return key into newline on " "input, and translates newline into return and line-feed on output. Newline " @@ -662,18 +653,18 @@ msgstr "" "し、出力時に改行文字を復帰 (return) と改行 (line-feed) に変換します。newline " "モードは初期化時にはオンになっています。" -#: ../../library/curses.rst:429 +#: ../../library/curses.rst:412 msgid "" "Leave cbreak mode. Return to normal \"cooked\" mode with line buffering." msgstr "" "cbreak モードを終了します。行バッファリングを行う通常の \"cooked\" モードに" "戻ります。" -#: ../../library/curses.rst:434 +#: ../../library/curses.rst:417 msgid "Leave echo mode. Echoing of input characters is turned off." msgstr "echo モードを終了します。入力のエコーバックはオフにされます。" -#: ../../library/curses.rst:439 +#: ../../library/curses.rst:422 msgid "" "Leave newline mode. Disable translation of return into newline on input, " "and disable low-level translation of newline into newline/return on output " @@ -689,7 +680,7 @@ msgstr "" "化できることがあります; また、入力中のリターンキーの検出ができるようになりま" "す。" -#: ../../library/curses.rst:449 +#: ../../library/curses.rst:432 msgid "" "When the :func:`!noqiflush` routine is used, normal flush of input and " "output queues associated with the ``INTR``, ``QUIT`` and ``SUSP`` characters " @@ -700,15 +691,15 @@ msgstr "" ":func:`!noqiflush` ルーチンを使うと、通常行われている ``INTR`` 、 ``QUIT`` お" "よび ``SUSP`` 文字による入力および出力キューのフラッシュが行われなくなりま" "す。シグナルハンドラが終了した際、割り込みが発生しなかったかのように出力を続" -"たい場合、ハンドラ中で :func:`!noqiflush` を呼び出すことができます。" +"たい場合、ハンドラ中で :func:`noqiflush` を呼び出すことができます。" -#: ../../library/curses.rst:457 +#: ../../library/curses.rst:440 msgid "Leave raw mode. Return to normal \"cooked\" mode with line buffering." msgstr "" "raw モードから離れます。行バッファリングを行う通常の \"cooked\" モードに戻り" "ます。" -#: ../../library/curses.rst:462 +#: ../../library/curses.rst:445 msgid "" "Return a tuple ``(fg, bg)`` containing the colors for the requested color " "pair. The value of *pair_number* must be between ``0`` and ``COLOR_PAIRS - " @@ -717,7 +708,7 @@ msgstr "" "要求された色ペアの色を含むタプル ``(fg, bg)`` を返します。*pair_number* は " "``0`` から ``COLOR_PAIRS - 1`` の間でなければなりません。" -#: ../../library/curses.rst:468 +#: ../../library/curses.rst:451 msgid "" "Return the number of the color-pair set by the attribute value *attr*. :func:" "`color_pair` is the counterpart to this function." @@ -725,7 +716,7 @@ msgstr "" "*attr* に対する色ペアセットの番号を返します。:func:`color_pair` はこの関数の" "逆に相当します。" -#: ../../library/curses.rst:474 +#: ../../library/curses.rst:457 msgid "" "Equivalent to ``tputs(str, 1, putchar)``; emit the value of a specified " "terminfo capability for the current terminal. Note that the output of :func:" @@ -735,7 +726,7 @@ msgstr "" "terminfo 機能の値を出力します。:func:`putp` の出力は常に標準出力に送られるの" "で注意して下さい。" -#: ../../library/curses.rst:481 +#: ../../library/curses.rst:464 msgid "" "If *flag* is ``False``, the effect is the same as calling :func:`noqiflush`. " "If *flag* is ``True``, or no argument is provided, the queues will be " @@ -745,7 +736,7 @@ msgstr "" "が ``True`` か、引数が与えられていない場合、制御文字が読み出された最にキュー" "はフラッシュされます。" -#: ../../library/curses.rst:488 +#: ../../library/curses.rst:471 msgid "" "Enter raw mode. In raw mode, normal line buffering and processing of " "interrupt, quit, suspend, and flow control keys are turned off; characters " @@ -755,7 +746,7 @@ msgstr "" "(interrupt)、終了 (quit)、一時停止 (suspend)、およびフロー制御キーはオフにな" "ります; 文字は curses 入力関数に一文字づつ渡されます。" -#: ../../library/curses.rst:495 +#: ../../library/curses.rst:478 msgid "" "Restore the terminal to \"program\" mode, as previously saved by :func:" "`def_prog_mode`." @@ -763,7 +754,7 @@ msgstr "" "端末を \"program\" モードに復旧し、あらかじめ :func:`def_prog_mode` で保存し" "た内容に戻します。" -#: ../../library/curses.rst:501 +#: ../../library/curses.rst:484 msgid "" "Restore the terminal to \"shell\" mode, as previously saved by :func:" "`def_shell_mode`." @@ -771,14 +762,14 @@ msgstr "" "端末を \"shell\" モードに復旧し、あらかじめ :func:`def_shell_mode` で保存した" "内容に戻します。" -#: ../../library/curses.rst:507 +#: ../../library/curses.rst:490 msgid "" "Restore the state of the terminal modes to what it was at the last call to :" "func:`savetty`." msgstr "" "端末モードの状態を最後に :func:`savetty` を呼び出した時の状態に戻します。" -#: ../../library/curses.rst:513 +#: ../../library/curses.rst:496 msgid "" "Backend function used by :func:`resizeterm`, performing most of the work; " "when resizing the windows, :func:`resize_term` blank-fills the areas that " @@ -793,7 +784,7 @@ msgstr "" "関数はすべてのウィンドウのサイズ変更を試みます。ただし、パッド呼び出しの慣例" "により、アプリケーションとの追加のやり取りを行わないサイズ変更は行えません。" -#: ../../library/curses.rst:523 +#: ../../library/curses.rst:506 msgid "" "Resize the standard and current windows to the specified dimensions, and " "adjusts other bookkeeping data used by the curses library that record the " @@ -803,7 +794,7 @@ msgstr "" "する、その他のウィンドウサイズを記憶しているデータ (特に SIGWINCH ハンドラ) " "を調整します。" -#: ../../library/curses.rst:530 +#: ../../library/curses.rst:513 msgid "" "Save the current state of the terminal modes in a buffer, usable by :func:" "`resetty`." @@ -811,36 +802,36 @@ msgstr "" ":func:`resetty` で使用される、バッファ内の端末モードの現在の状態を保存しま" "す。" -#: ../../library/curses.rst:535 +#: ../../library/curses.rst:518 msgid "Retrieves the value set by :func:`set_escdelay`." msgstr "" -#: ../../library/curses.rst:541 +#: ../../library/curses.rst:524 msgid "" "Sets the number of milliseconds to wait after reading an escape character, " "to distinguish between an individual escape character entered on the " "keyboard from escape sequences sent by cursor and function keys." msgstr "" -#: ../../library/curses.rst:549 +#: ../../library/curses.rst:532 msgid "Retrieves the value set by :func:`set_tabsize`." msgstr "" -#: ../../library/curses.rst:555 +#: ../../library/curses.rst:538 msgid "" "Sets the number of columns used by the curses library when converting a tab " "character to spaces as it adds the tab to a window." msgstr "" -#: ../../library/curses.rst:562 +#: ../../library/curses.rst:545 msgid "" "Set the virtual screen cursor to *y*, *x*. If *y* and *x* are both ``-1``, " "then :meth:`leaveok ` is set ``True``." msgstr "" "仮想スクリーンのカーソルを *y*, *x* に設定します。*y* および *x* がどちらも " -"``-1`` の場合、 :meth:`leaveok` が に``True``に設定されます。" +"``-1`` の場合、 :meth:`leaveok ` が に``True``に設定されます。" -#: ../../library/curses.rst:568 +#: ../../library/curses.rst:551 msgid "" "Initialize the terminal. *term* is a string giving the terminal name, or " "``None``; if omitted or ``None``, the value of the :envvar:`TERM` " @@ -853,7 +844,7 @@ msgstr "" "れる初期化シーケンスへのファイル記述子です。指定されないまたは ``-1`` の場" "合、``sys.stdout`` のファイル記述子が使用されます。" -#: ../../library/curses.rst:577 +#: ../../library/curses.rst:560 msgid "" "Must be called if the programmer wants to use colors, and before any other " "color manipulation routine is called. It is good practice to call this " @@ -863,7 +854,7 @@ msgstr "" "び出す前に呼び出さなくてはなりません。この関数は :func:`initscr` を呼んだ直後" "に呼ぶようにしておくとよいでしょう。" -#: ../../library/curses.rst:581 +#: ../../library/curses.rst:564 msgid "" ":func:`start_color` initializes eight basic colors (black, red, green, " "yellow, blue, magenta, cyan, and white), and two global variables in the :" @@ -878,7 +869,7 @@ msgstr "" "const:`COLOR_PAIRS` を初期化します。この関数はまた、色設定を端末のスイッチが" "入れられたときの状態に戻します。" -#: ../../library/curses.rst:590 +#: ../../library/curses.rst:573 msgid "" "Return a logical OR of all video attributes supported by the terminal. This " "information is useful when a curses program needs complete control over the " @@ -888,7 +879,7 @@ msgstr "" "curses プログラムがスクリーンの見え方を完全に制御する必要がある場合に便利で" "す。" -#: ../../library/curses.rst:597 +#: ../../library/curses.rst:580 msgid "" "Return the value of the environment variable :envvar:`TERM`, as a bytes " "object, truncated to 14 characters." @@ -896,7 +887,7 @@ msgstr "" "14 文字以下になるように切り詰められた環境変数 :envvar:`TERM` の値を bytes オ" "ブジェクトで返します。" -#: ../../library/curses.rst:603 +#: ../../library/curses.rst:586 msgid "" "Return the value of the Boolean capability corresponding to the terminfo " "capability name *capname* as an integer. Return the value ``-1`` if " @@ -907,7 +898,7 @@ msgstr "" "*capname* が真偽値で表せる機能値でない場合 ``-1`` を返し、機能がキャンセルさ" "れているか、端末記述上に見つからない場合 ``0`` を返します。" -#: ../../library/curses.rst:611 +#: ../../library/curses.rst:594 msgid "" "Return the value of the numeric capability corresponding to the terminfo " "capability name *capname* as an integer. Return the value ``-2`` if " @@ -918,7 +909,7 @@ msgstr "" "が数値で表せる機能値でない場合 ``-2`` を返し、機能がキャンセルされているか、" "端末記述上に見つからない場合 ``-1`` を返します。" -#: ../../library/curses.rst:619 +#: ../../library/curses.rst:602 msgid "" "Return the value of the string capability corresponding to the terminfo " "capability name *capname* as a bytes object. Return ``None`` if *capname* " @@ -926,7 +917,7 @@ msgid "" "terminal description." msgstr "" -#: ../../library/curses.rst:627 +#: ../../library/curses.rst:610 msgid "" "Instantiate the bytes object *str* with the supplied parameters, where *str* " "should be a parameterized string obtained from the terminfo database. E.g. " @@ -938,7 +929,7 @@ msgstr "" "ません。例えば、``tparm(tigetstr(\"cup\"), 5, 3)`` は ``b'\\033[6;4H'`` のよ" "うになります。厳密には端末の形式によって異なる結果となります。" -#: ../../library/curses.rst:635 +#: ../../library/curses.rst:618 msgid "" "Specify that the file descriptor *fd* be used for typeahead checking. If " "*fd* is ``-1``, then no typeahead checking is done." @@ -946,7 +937,7 @@ msgstr "" "先読みチェックに使うためのファイル記述子 *fd* を指定します。*fd* が ``-1`` の" "場合、先読みチェックは行われません。" -#: ../../library/curses.rst:638 +#: ../../library/curses.rst:621 msgid "" "The curses library does \"line-breakout optimization\" by looking for " "typeahead periodically while updating the screen. If input is found, and it " @@ -961,7 +952,7 @@ msgstr "" "や doupdate を再度呼び出すまで先送りにします。この関数は異なるファイル記述子" "で先読みチェックを行うように指定することができます。" -#: ../../library/curses.rst:647 +#: ../../library/curses.rst:630 msgid "" "Return a bytes object which is a printable representation of the character " "*ch*. Control characters are represented as a caret followed by the " @@ -969,33 +960,35 @@ msgid "" "are." msgstr "" -#: ../../library/curses.rst:654 +#: ../../library/curses.rst:637 msgid "Push *ch* so the next :meth:`~window.getch` will return it." msgstr "" "*ch* をプッシュし、次に :meth:`~window.getch` を呼び出した時にその値が返るよ" "うにします。" -#: ../../library/curses.rst:658 +#: ../../library/curses.rst:641 msgid "Only one *ch* can be pushed before :meth:`!getch` is called." msgstr ":meth:`!getch` を呼び出すまでは *ch* は一つしかプッシュできません。" -#: ../../library/curses.rst:663 +#: ../../library/curses.rst:646 msgid "" -"Update the :const:`LINES` and :const:`COLS` module variables. Useful for " -"detecting manual screen resize." +"Update :envvar:`LINES` and :envvar:`COLS`. Useful for detecting manual " +"screen resize." msgstr "" +":envvar:`LINES` と :envvar:`COLS` についての更新。マニュアルでスクリーンのサ" +"イズを変更したことを検知するために有用です。" -#: ../../library/curses.rst:671 +#: ../../library/curses.rst:653 msgid "Push *ch* so the next :meth:`~window.get_wch` will return it." msgstr "" "*ch* をプッシュし、次に :meth:`~window.get_wch` を呼び出した時にその値が返る" "ようにします。" -#: ../../library/curses.rst:675 +#: ../../library/curses.rst:657 msgid "Only one *ch* can be pushed before :meth:`!get_wch` is called." msgstr ":meth:`!get_wch` を呼び出すまでは *ch* は一つしかプッシュできません。" -#: ../../library/curses.rst:682 +#: ../../library/curses.rst:664 msgid "" "Push a :const:`KEY_MOUSE` event onto the input queue, associating the given " "state data with it." @@ -1003,7 +996,7 @@ msgstr "" "与えられた状態データが関連付けられた :const:`KEY_MOUSE` イベントを入力キュー" "にプッシュします。" -#: ../../library/curses.rst:688 +#: ../../library/curses.rst:670 msgid "" "If used, this function should be called before :func:`initscr` or newterm " "are called. When *flag* is ``False``, the values of lines and columns " @@ -1019,11 +1012,21 @@ msgstr "" "`COLUMNS` が設定されていないとウィンドウのサイズを使います) いても、" "terminfo データベースに指定された lines および columns の値を使います。" -#: ../../library/curses.rst:698 -msgid "Equivalent to ``assume_default_colors(-1, -1)``." +#: ../../library/curses.rst:680 +msgid "" +"Allow use of default values for colors on terminals supporting this feature. " +"Use this to support transparency in your application. The default color is " +"assigned to the color number ``-1``. After calling this function, " +"``init_pair(x, curses.COLOR_RED, -1)`` initializes, for instance, color pair " +"*x* to a red foreground color on the default background." msgstr "" +"この機能をサポートしている端末上で、色の値としてデフォルト値を使う設定をしま" +"す。あなたのアプリケーションで透過性とサポートするためにこの関数を使ってくだ" +"さい。デフォルトの色は色番号 ``-1`` に割り当てられます。この関数を呼んだ後、" +"たとえば ``init_pair(x, curses.COLOR_RED, -1)`` は色ペア *x* を赤い前景色とデ" +"フォルトの背景色に初期化します。" -#: ../../library/curses.rst:703 +#: ../../library/curses.rst:689 msgid "" "Initialize curses and call another callable object, *func*, which should be " "the rest of your curses-using application. If the application raises an " @@ -1046,11 +1049,11 @@ msgstr "" "期化します。終了時 (通常終了、例外による終了のどちらでも)、cooked モードに戻" "し、エコーをオンにし、端末キーパッドを無効にします。" -#: ../../library/curses.rst:717 +#: ../../library/curses.rst:703 msgid "Window Objects" msgstr "Window オブジェクト" -#: ../../library/curses.rst:719 +#: ../../library/curses.rst:705 msgid "" "Window objects, as returned by :func:`initscr` and :func:`newwin` above, " "have the following methods and attributes:" @@ -1058,7 +1061,7 @@ msgstr "" "上記の :func:`initscr` や :func:`newwin` が返すウィンドウは、以下のメソッドと" "属性を持ちます:" -#: ../../library/curses.rst:726 +#: ../../library/curses.rst:712 msgid "" "Paint character *ch* at ``(y, x)`` with attributes *attr*, overwriting any " "character previously painted at that location. By default, the character " @@ -1068,14 +1071,14 @@ msgstr "" "描画された文字は上書きされます。デフォルトでは、文字の位置および属性はウィン" "ドウオブジェクトにおける現在の設定になります。" -#: ../../library/curses.rst:732 +#: ../../library/curses.rst:718 msgid "" "Writing outside the window, subwindow, or pad raises a :exc:`curses.error`. " "Attempting to write to the lower right corner of a window, subwindow, or pad " "will cause an exception to be raised after the character is printed." msgstr "" -#: ../../library/curses.rst:740 +#: ../../library/curses.rst:726 msgid "" "Paint at most *n* characters of the character string *str* at ``(y, x)`` " "with attributes *attr*, overwriting anything previously on the display." @@ -1083,7 +1086,7 @@ msgstr "" "文字列 *str* から最大で *n* 文字を ``(y, x)`` に属性 *attr* で描画します。以" "前ディスプレイにあった内容はすべて上書きされます。" -#: ../../library/curses.rst:748 +#: ../../library/curses.rst:734 msgid "" "Paint the character string *str* at ``(y, x)`` with attributes *attr*, " "overwriting anything previously on the display." @@ -1091,14 +1094,14 @@ msgstr "" "``(y, x)`` に文字列 *str* を属性 *attr* で描画します。以前ディスプレイにあっ" "た内容はすべて上書きされます。" -#: ../../library/curses.rst:753 +#: ../../library/curses.rst:739 msgid "" "Writing outside the window, subwindow, or pad raises :exc:`curses.error`. " "Attempting to write to the lower right corner of a window, subwindow, or pad " "will cause an exception to be raised after the string is printed." msgstr "" -#: ../../library/curses.rst:757 +#: ../../library/curses.rst:743 msgid "" "A `bug in ncurses `_, the backend for " "this Python module, can cause SegFaults when resizing windows. This is fixed " @@ -1108,7 +1111,7 @@ msgid "" "line." msgstr "" -#: ../../library/curses.rst:767 +#: ../../library/curses.rst:753 msgid "" "Remove attribute *attr* from the \"background\" set applied to all writes to " "the current window." @@ -1116,7 +1119,7 @@ msgstr "" "現在のウィンドウに書き込まれたすべての内容に対し \"バックグラウンド\" に設定" "された属性 *attr* を除去します。" -#: ../../library/curses.rst:773 +#: ../../library/curses.rst:759 msgid "" "Add attribute *attr* from the \"background\" set applied to all writes to " "the current window." @@ -1124,7 +1127,7 @@ msgstr "" "現在のウィンドウに書き込まれたすべての内容に対し \"バックグラウンド\" に属性 " "*attr* を追加します。" -#: ../../library/curses.rst:779 +#: ../../library/curses.rst:765 msgid "" "Set the \"background\" set of attributes to *attr*. This set is initially " "``0`` (no attributes)." @@ -1132,7 +1135,7 @@ msgstr "" "\"バックグラウンド\" の属性セットを *attr* に設定します。初期値は ``0`` (属性" "なし) です。" -#: ../../library/curses.rst:785 +#: ../../library/curses.rst:771 msgid "" "Set the background property of the window to the character *ch*, with " "attributes *attr*. The change is then applied to every character position " @@ -1141,19 +1144,19 @@ msgstr "" "ウィンドウ上の背景プロパティを、*attr* を属性とする文字 *ch* に設定します。変" "更はそのウィンドウ中のすべての文字に以下のようにして適用されます:" -#: ../../library/curses.rst:789 +#: ../../library/curses.rst:775 msgid "" "The attribute of every character in the window is changed to the new " "background attribute." msgstr "ウィンドウ中のすべての文字の属性が新たな背景属性に変更されます。" -#: ../../library/curses.rst:792 +#: ../../library/curses.rst:778 msgid "" "Wherever the former background character appears, it is changed to the new " "background character." msgstr "以前の背景文字が出現すると、常に新たな背景文字に変更されます。" -#: ../../library/curses.rst:798 +#: ../../library/curses.rst:784 msgid "" "Set the window's background. A window's background consists of a character " "and any combination of attributes. The attribute part of the background is " @@ -1169,7 +1172,7 @@ msgstr "" "部分の両方が組み合わされます。背景は文字のプロパティとなり、スクロールや行/文" "字の挿入/削除操作の際には文字と一緒に移動します。" -#: ../../library/curses.rst:808 +#: ../../library/curses.rst:794 msgid "" "Draw a border around the edges of the window. Each parameter specifies the " "character to use for a specific part of the border; see the table below for " @@ -1178,7 +1181,7 @@ msgstr "" "ウィンドウの縁に境界線を描画します。各引数には境界の特定部分を表現するために" "使われる文字を指定します; 詳細は以下のテーブルを参照してください。" -#: ../../library/curses.rst:814 +#: ../../library/curses.rst:800 msgid "" "A ``0`` value for any parameter will cause the default character to be used " "for that parameter. Keyword parameters can *not* be used. The defaults are " @@ -1188,107 +1191,107 @@ msgstr "" "キーワード引数は使うことが *できません*。デフォルトはテーブル内で示していま" "す:" -#: ../../library/curses.rst:819 +#: ../../library/curses.rst:805 msgid "Parameter" msgstr "引数" -#: ../../library/curses.rst:819 +#: ../../library/curses.rst:805 msgid "Description" msgstr "説明" -#: ../../library/curses.rst:819 +#: ../../library/curses.rst:805 msgid "Default value" msgstr "デフォルト値" -#: ../../library/curses.rst:821 +#: ../../library/curses.rst:807 msgid "*ls*" msgstr "*ls*" -#: ../../library/curses.rst:821 +#: ../../library/curses.rst:807 msgid "Left side" msgstr "左側" -#: ../../library/curses.rst:821 ../../library/curses.rst:823 +#: ../../library/curses.rst:807 ../../library/curses.rst:809 msgid ":const:`ACS_VLINE`" msgstr ":const:`ACS_VLINE`" -#: ../../library/curses.rst:823 +#: ../../library/curses.rst:809 msgid "*rs*" msgstr "*rs*" -#: ../../library/curses.rst:823 +#: ../../library/curses.rst:809 msgid "Right side" msgstr "右側" -#: ../../library/curses.rst:825 +#: ../../library/curses.rst:811 msgid "*ts*" msgstr "*ts*" -#: ../../library/curses.rst:825 +#: ../../library/curses.rst:811 msgid "Top" msgstr "上側" -#: ../../library/curses.rst:825 ../../library/curses.rst:827 +#: ../../library/curses.rst:811 ../../library/curses.rst:813 msgid ":const:`ACS_HLINE`" msgstr ":const:`ACS_HLINE`" -#: ../../library/curses.rst:827 +#: ../../library/curses.rst:813 msgid "*bs*" msgstr "*bs*" -#: ../../library/curses.rst:827 +#: ../../library/curses.rst:813 msgid "Bottom" msgstr "下側" -#: ../../library/curses.rst:829 +#: ../../library/curses.rst:815 msgid "*tl*" msgstr "*tl*" -#: ../../library/curses.rst:829 +#: ../../library/curses.rst:815 msgid "Upper-left corner" msgstr "左上の角" -#: ../../library/curses.rst:829 +#: ../../library/curses.rst:815 msgid ":const:`ACS_ULCORNER`" msgstr ":const:`ACS_ULCORNER`" -#: ../../library/curses.rst:831 +#: ../../library/curses.rst:817 msgid "*tr*" msgstr "*tr*" -#: ../../library/curses.rst:831 +#: ../../library/curses.rst:817 msgid "Upper-right corner" msgstr "右上の角" -#: ../../library/curses.rst:831 +#: ../../library/curses.rst:817 msgid ":const:`ACS_URCORNER`" msgstr ":const:`ACS_URCORNER`" -#: ../../library/curses.rst:833 +#: ../../library/curses.rst:819 msgid "*bl*" msgstr "*bl*" -#: ../../library/curses.rst:833 +#: ../../library/curses.rst:819 msgid "Bottom-left corner" msgstr "左下の角" -#: ../../library/curses.rst:833 +#: ../../library/curses.rst:819 msgid ":const:`ACS_LLCORNER`" msgstr ":const:`ACS_LLCORNER`" -#: ../../library/curses.rst:835 +#: ../../library/curses.rst:821 msgid "*br*" msgstr "*br*" -#: ../../library/curses.rst:835 +#: ../../library/curses.rst:821 msgid "Bottom-right corner" msgstr "右下の角" -#: ../../library/curses.rst:835 +#: ../../library/curses.rst:821 msgid ":const:`ACS_LRCORNER`" msgstr ":const:`ACS_LRCORNER`" -#: ../../library/curses.rst:841 +#: ../../library/curses.rst:827 msgid "" "Similar to :meth:`border`, but both *ls* and *rs* are *vertch* and both *ts* " "and *bs* are *horch*. The default corner characters are always used by this " @@ -1298,7 +1301,7 @@ msgstr "" "び *bs* は共に *horch* です。この関数では、角に使われるデフォルト文字が常に使" "用されます。" -#: ../../library/curses.rst:850 +#: ../../library/curses.rst:836 msgid "" "Set the attributes of *num* characters at the current cursor position, or at " "position ``(y, x)`` if supplied. If *num* is not given or is ``-1``, the " @@ -1308,7 +1311,7 @@ msgid "" "be redisplayed by the next window refresh." msgstr "" -#: ../../library/curses.rst:860 +#: ../../library/curses.rst:846 msgid "" "Like :meth:`erase`, but also cause the whole window to be repainted upon " "next call to :meth:`refresh`." @@ -1316,7 +1319,7 @@ msgstr "" ":meth:`erase` に似ていますが、次に :meth:`refresh` が呼び出された際にすべての" "ウィンドウを再描画するようにします。" -#: ../../library/curses.rst:866 +#: ../../library/curses.rst:852 msgid "" "If *flag* is ``True``, the next call to :meth:`refresh` will clear the " "window completely." @@ -1324,7 +1327,7 @@ msgstr "" "*flag* が ``True`` ならば、次の :meth:`refresh` はウィンドウを完全に消去しま" "す。" -#: ../../library/curses.rst:872 +#: ../../library/curses.rst:858 msgid "" "Erase from cursor to the end of the window: all lines below the cursor are " "deleted, and then the equivalent of :meth:`clrtoeol` is performed." @@ -1332,11 +1335,11 @@ msgstr "" "カーソルの位置からウィンドウの端までを消去します: カーソル以降のすべての行が" "削除されるため、:meth:`clrtoeol` と等価です。" -#: ../../library/curses.rst:878 +#: ../../library/curses.rst:864 msgid "Erase from cursor to the end of the line." msgstr "カーソル位置から行末までを消去します。" -#: ../../library/curses.rst:883 +#: ../../library/curses.rst:869 msgid "" "Update the current cursor position of all the ancestors of the window to " "reflect the current cursor position of the window." @@ -1344,18 +1347,18 @@ msgstr "" "ウィンドウのすべての親ウィンドウについて、現在のカーソル位置を反映するよう更" "新します。" -#: ../../library/curses.rst:889 +#: ../../library/curses.rst:875 msgid "Delete any character at ``(y, x)``." msgstr "``(y, x)`` にある文字を削除します。" -#: ../../library/curses.rst:894 +#: ../../library/curses.rst:880 msgid "" "Delete the line under the cursor. All following lines are moved up by one " "line." msgstr "" "カーソルの下にある行を削除します。後続の行はすべて 1 行上に移動します。" -#: ../../library/curses.rst:900 +#: ../../library/curses.rst:886 msgid "" "An abbreviation for \"derive window\", :meth:`derwin` is the same as " "calling :meth:`subwin`, except that *begin_y* and *begin_x* are relative to " @@ -1367,7 +1370,7 @@ msgstr "" "ではなく、ウィンドウの原点からの相対位置です。派生したウィンドウオブジェクト" "が返されます。" -#: ../../library/curses.rst:908 +#: ../../library/curses.rst:894 msgid "" "Add character *ch* with attribute *attr*, and immediately call :meth:" "`refresh` on the window." @@ -1375,7 +1378,7 @@ msgstr "" "文字 *ch* に属性 *attr* を付与し、即座に :meth:`refresh` をウィンドウに対して" "呼び出します。" -#: ../../library/curses.rst:914 +#: ../../library/curses.rst:900 msgid "" "Test whether the given pair of screen-relative character-cell coordinates " "are enclosed by the given window, returning ``True`` or ``False``. It is " @@ -1386,35 +1389,31 @@ msgstr "" "含まれるかを調べて、``True`` または ``False`` を返します。スクリーン上のウィ" "ンドウの一部がマウスイベントの発生場所を含むかどうかを調べる上で便利です。" -#: ../../library/curses.rst:919 -msgid "Previously it returned ``1`` or ``0`` instead of ``True`` or ``False``." -msgstr "" - -#: ../../library/curses.rst:925 +#: ../../library/curses.rst:908 msgid "" "Encoding used to encode method arguments (Unicode strings and characters). " "The encoding attribute is inherited from the parent window when a subwindow " -"is created, for example with :meth:`window.subwin`. By default, current " -"locale encoding is used (see :func:`locale.getencoding`)." +"is created, for example with :meth:`window.subwin`. By default, the locale " +"encoding is used (see :func:`locale.getpreferredencoding`)." msgstr "" "encode メソッドの引数 (Unicode 文字列および文字) で使用されるエンコーディング" "です。例えば :meth:`window.subwin` などでサブウィンドウを生成した時、エンコー" -"ディング属性は親ウィンドウから継承します。デフォルトでは、現在のロケールのエ" -"ンコーディングが使用されます (:func:`locale.getencoding` 参照)。" +"ディング属性は親ウィンドウから継承します。デフォルトでは、そのロケールのエン" +"コーディングが使用されます (:func:`locale.getpreferredencoding` 参照)。" -#: ../../library/curses.rst:935 +#: ../../library/curses.rst:918 msgid "Clear the window." msgstr "ウィンドウをクリアします。" -#: ../../library/curses.rst:940 -msgid "Return a tuple ``(y, x)`` of coordinates of upper-left corner." -msgstr "" +#: ../../library/curses.rst:923 +msgid "Return a tuple ``(y, x)`` of co-ordinates of upper-left corner." +msgstr "左上の角の座標をあらわすタプル ``(y, x)`` を返します。" -#: ../../library/curses.rst:945 +#: ../../library/curses.rst:928 msgid "Return the given window's current background character/attribute pair." msgstr "与えられたウィンドウの現在の背景文字と属性のペアを返します。" -#: ../../library/curses.rst:950 +#: ../../library/curses.rst:933 msgid "" "Get a character. Note that the integer returned does *not* have to be in " "ASCII range: function keys, keypad keys and so on are represented by numbers " @@ -1426,7 +1425,7 @@ msgstr "" "な数字で表されます。無遅延 (no-delay) モードでは、入力がない場合 -1 を返し、" "そうでなければキーが押されるまで待ちます。" -#: ../../library/curses.rst:958 +#: ../../library/curses.rst:941 msgid "" "Get a wide character. Return a character for most keys, or an integer for " "function keys, keypad keys, and other special keys. In no-delay mode, raise " @@ -1436,7 +1435,7 @@ msgstr "" "パッドのキー、およびその他の特殊キーの文字を返します。無遅延モードでは、入力" "がない場合例外を送出します。" -#: ../../library/curses.rst:967 +#: ../../library/curses.rst:950 msgid "" "Get a character, returning a string instead of an integer, as :meth:`getch` " "does. Function keys, keypad keys and other special keys return a multibyte " @@ -1447,11 +1446,11 @@ msgstr "" "ファンクションキー、キーパッドのキー、およびその他特殊キーはキー名を含む複数" "文字を返します。無遅延モードでは、入力がない場合例外を送出します。" -#: ../../library/curses.rst:975 +#: ../../library/curses.rst:958 msgid "Return a tuple ``(y, x)`` of the height and width of the window." msgstr "ウィンドウの高さおよび幅を表すタプル ``(y, x)`` を返します。" -#: ../../library/curses.rst:980 +#: ../../library/curses.rst:963 msgid "" "Return the beginning coordinates of this window relative to its parent " "window as a tuple ``(y, x)``. Return ``(-1, -1)`` if this window has no " @@ -1460,17 +1459,13 @@ msgstr "" "親ウィンドウ中におけるウィンドウの開始位置をタプル ``(y, x)`` で返します。" "ウィンドウに親ウィンドウがない場合 ``(-1, -1)`` を返します。" -#: ../../library/curses.rst:990 +#: ../../library/curses.rst:973 msgid "" -"Read a bytes object from the user, with primitive line editing capacity. The " -"maximum value for *n* is 2047." -msgstr "" - -#: ../../library/curses.rst:993 ../../library/curses.rst:1088 -msgid "The maximum value for *n* was increased from 1023 to 2047." +"Read a bytes object from the user, with primitive line editing capacity." msgstr "" +"原始的な文字編集機能つきで、ユーザの入力した byte オブヘクトを読み取ります。" -#: ../../library/curses.rst:999 +#: ../../library/curses.rst:978 msgid "" "Return a tuple ``(y, x)`` of current cursor position relative to the " "window's upper-left corner." @@ -1478,7 +1473,7 @@ msgstr "" "ウィンドウの左上角からの相対で表した現在のカーソル位置をタプル ``(y, x)`` で" "返します。" -#: ../../library/curses.rst:1006 +#: ../../library/curses.rst:985 msgid "" "Display a horizontal line starting at ``(y, x)`` with length *n* consisting " "of the character *ch*." @@ -1486,7 +1481,7 @@ msgstr "" "``(y, x)`` から始まり、*n* の長さを持つ、文字 *ch* で作られる水平線を表示しま" "す。" -#: ../../library/curses.rst:1012 +#: ../../library/curses.rst:991 msgid "" "If *flag* is ``False``, curses no longer considers using the hardware insert/" "delete character feature of the terminal; if *flag* is ``True``, use of " @@ -1498,7 +1493,7 @@ msgstr "" "されます。curses が最初に初期化された際には文字挿入/削除はデフォルトで有効に" "なっています。" -#: ../../library/curses.rst:1020 +#: ../../library/curses.rst:999 msgid "" "If *flag* is ``True``, :mod:`curses` will try and use hardware line editing " "facilities. Otherwise, line insertion/deletion are disabled." @@ -1506,7 +1501,7 @@ msgstr "" "*flag* が ``True`` であれば、:mod:`curses` はハードウェアの行編集機能の利用を" "試みます。行挿入/削除は無効化されます。" -#: ../../library/curses.rst:1026 +#: ../../library/curses.rst:1005 msgid "" "If *flag* is ``True``, any change in the window image automatically causes " "the window to be refreshed; you no longer have to call :meth:`refresh` " @@ -1518,7 +1513,7 @@ msgstr "" "くても良くなります。とはいえ、wrefresh を繰り返し呼び出すことになるため、この" "操作はかなりパフォーマンスを低下させます。デフォルトでは無効になっています。" -#: ../../library/curses.rst:1034 +#: ../../library/curses.rst:1013 msgid "" "Return the character at the given position in the window. The bottom 8 bits " "are the character proper, and upper bits are the attributes." @@ -1526,7 +1521,7 @@ msgstr "" "ウィンドウの指定の位置の文字を返します。下位 8 ビットが本来の文字で、それより" "上のビットは属性です。" -#: ../../library/curses.rst:1041 +#: ../../library/curses.rst:1020 msgid "" "Paint character *ch* at ``(y, x)`` with attributes *attr*, moving the line " "from position *x* right by one character." @@ -1534,7 +1529,7 @@ msgstr "" "``(y, x)`` に文字 *ch* を属性 *attr* で描画し、行の *x* からの内容を 1 文字分" "右にずらします。" -#: ../../library/curses.rst:1047 +#: ../../library/curses.rst:1026 msgid "" "Insert *nlines* lines into the specified window above the current line. The " "*nlines* bottom lines are lost. For negative *nlines*, delete *nlines* " @@ -1547,14 +1542,14 @@ msgstr "" "*nlines* を削除し、削除された行の後ろに続く内容が上に来ます。その下にある " "*nlines* は消去されます。現在のカーソル位置はそのままです。" -#: ../../library/curses.rst:1056 +#: ../../library/curses.rst:1035 msgid "" "Insert a blank line under the cursor. All following lines are moved down by " "one line." msgstr "" "カーソルの下に空行を 1 行入れます。それ以降の行は 1 行づつ下に移動します。" -#: ../../library/curses.rst:1063 +#: ../../library/curses.rst:1042 msgid "" "Insert a character string (as many characters as will fit on the line) " "before the character under the cursor, up to *n* characters. If *n* is " @@ -1568,7 +1563,7 @@ msgstr "" "るすべての文字は右に移動し、行の左端にある文字は失われます。カーソル位置は " "(*y*, *x* が指定されていた場合はそこに移動しますが、その後は) 変化しません。" -#: ../../library/curses.rst:1073 +#: ../../library/curses.rst:1052 msgid "" "Insert a character string (as many characters as will fit on the line) " "before the character under the cursor. All characters to the right of the " @@ -1580,16 +1575,19 @@ msgstr "" "側にある文字はすべて右にシフトし、行の右端の文字は失われます。カーソル位置は " "(*y*, *x* が指定されていた場合はそこに移動しますが、その後は) 変化しません。" -#: ../../library/curses.rst:1082 +#: ../../library/curses.rst:1061 msgid "" "Return a bytes object of characters, extracted from the window starting at " "the current cursor position, or at *y*, *x* if specified. Attributes are " "stripped from the characters. If *n* is specified, :meth:`instr` returns a " -"string at most *n* characters long (exclusive of the trailing NUL). The " -"maximum value for *n* is 2047." +"string at most *n* characters long (exclusive of the trailing NUL)." msgstr "" +"現在のカーソル位置、または *y*, *x* が指定されている場合にはその場所から始ま" +"るキャラクタの bytes オブジェクトをウィンドウから抽出して返します。属性は文字" +"から剥ぎ取られます。*n* が指定された場合、:meth:`instr` は (末尾の NUL 文字を" +"除いて) 最大で *n* 文字までの長さからなる文字列を返します。" -#: ../../library/curses.rst:1094 +#: ../../library/curses.rst:1069 msgid "" "Return ``True`` if the specified line was modified since the last call to :" "meth:`refresh`; otherwise return ``False``. Raise a :exc:`curses.error` " @@ -1599,7 +1597,7 @@ msgstr "" "``True`` を返します; そうでない場合には ``False`` を返します。*line* が現在の" "ウィンドウ上の有効な行でない場合、:exc:`curses.error` 例外を送出します。" -#: ../../library/curses.rst:1101 +#: ../../library/curses.rst:1076 msgid "" "Return ``True`` if the specified window was modified since the last call to :" "meth:`refresh`; otherwise return ``False``." @@ -1607,7 +1605,7 @@ msgstr "" "指定したウィンドウが、最後に :meth:`refresh` を呼んだ時から変更されている場合" "に ``True`` を返します; そうでない場合には ``False`` を返します。" -#: ../../library/curses.rst:1107 +#: ../../library/curses.rst:1082 msgid "" "If *flag* is ``True``, escape sequences generated by some keys (keypad, " "function keys) will be interpreted by :mod:`curses`. If *flag* is ``False``, " @@ -1618,7 +1616,7 @@ msgstr "" "が ``False`` の場合、エスケープシーケンスは入力ストリームにそのままの状態で残" "されます。" -#: ../../library/curses.rst:1114 +#: ../../library/curses.rst:1089 msgid "" "If *flag* is ``True``, cursor is left where it is on update, instead of " "being at \"cursor position.\" This reduces cursor movement where possible. " @@ -1628,7 +1626,7 @@ msgstr "" "とどめます。これにより、カーソルの移動を減らせる可能性があります。この場合、" "カーソルは不可視にされます。" -#: ../../library/curses.rst:1118 +#: ../../library/curses.rst:1093 msgid "" "If *flag* is ``False``, cursor will always be at \"cursor position\" after " "an update." @@ -1636,11 +1634,11 @@ msgstr "" "*flag* が ``False`` の場合、カーソルは更新の際に常に \"カーソル位置\" に移動" "します。" -#: ../../library/curses.rst:1123 +#: ../../library/curses.rst:1098 msgid "Move cursor to ``(new_y, new_x)``." msgstr "カーソルを ``(new_y, new_x)`` に移動します。" -#: ../../library/curses.rst:1128 +#: ../../library/curses.rst:1103 msgid "" "Move the window inside its parent window. The screen-relative parameters of " "the window are not changed. This routine is used to display different parts " @@ -1650,20 +1648,20 @@ msgstr "" "ラメタ群は変化しません。このルーチンは親ウィンドウの一部をスクリーン上の同じ" "物理位置に表示する際に用いられます。" -#: ../../library/curses.rst:1135 +#: ../../library/curses.rst:1110 msgid "Move the window so its upper-left corner is at ``(new_y, new_x)``." msgstr "ウィンドウの左上角が ``(new_y, new_x)`` になるように移動します。" -#: ../../library/curses.rst:1140 +#: ../../library/curses.rst:1115 msgid "If *flag* is ``True``, :meth:`getch` will be non-blocking." msgstr "*flag* が ``True`` の場合、:meth:`getch` は非ブロックで動作します。" -#: ../../library/curses.rst:1145 +#: ../../library/curses.rst:1120 msgid "If *flag* is ``True``, escape sequences will not be timed out." msgstr "" "*flag* が ``True`` の場合、エスケープシーケンスはタイムアウトしなくなります。" -#: ../../library/curses.rst:1147 +#: ../../library/curses.rst:1122 msgid "" "If *flag* is ``False``, after a few milliseconds, an escape sequence will " "not be interpreted, and will be left in the input stream as is." @@ -1671,7 +1669,7 @@ msgstr "" "*flag* が ``False`` の場合、数ミリ秒間の間エスケープシーケンスは解釈されず、" "入力ストリーム中にそのままの状態で残されます。" -#: ../../library/curses.rst:1153 +#: ../../library/curses.rst:1128 msgid "" "Mark for refresh but wait. This function updates the data structure " "representing the desired state of the window, but does not force an update " @@ -1681,7 +1679,7 @@ msgstr "" "い内容を反映するように更新しますが、物理スクリーン上に反映させるための強制更" "新を行いません。更新を行うためには :func:`doupdate` を呼び出します。" -#: ../../library/curses.rst:1160 +#: ../../library/curses.rst:1135 msgid "" "Overlay the window on top of *destwin*. The windows need not be the same " "size, only the overlapping region is copied. This copy is non-destructive, " @@ -1692,7 +1690,7 @@ msgstr "" "ズである必要はなく、重なっている領域だけが複写されます。この複写は非破壊的で" "す。これは現在の背景文字が *destwin* の内容を上書きしないことを意味します。" -#: ../../library/curses.rst:1165 +#: ../../library/curses.rst:1140 msgid "" "To get fine-grained control over the copied region, the second form of :meth:" "`overlay` can be used. *sminrow* and *smincol* are the upper-left " @@ -1703,7 +1701,7 @@ msgstr "" "きます。*sminrow* および *smincol* は元のウィンドウの左上の座標で、他の変数" "は *destwin* 内の矩形を表します。" -#: ../../library/curses.rst:1173 +#: ../../library/curses.rst:1148 msgid "" "Overwrite the window on top of *destwin*. The windows need not be the same " "size, in which case only the overlapping region is copied. This copy is " @@ -1714,7 +1712,7 @@ msgstr "" "サイズである必要はなく、重なっている領域だけが複写されます。この複写は破壊的" "です。これは現在の背景文字が *destwin* の内容を上書きすることを意味します。" -#: ../../library/curses.rst:1178 +#: ../../library/curses.rst:1153 msgid "" "To get fine-grained control over the copied region, the second form of :meth:" "`overwrite` can be used. *sminrow* and *smincol* are the upper-left " @@ -1725,7 +1723,7 @@ msgstr "" "できます。*sminrow* および *smincol* は元のウィンドウの左上の座標で、他の変数" "は *destwin* 内の矩形を表します。" -#: ../../library/curses.rst:1186 +#: ../../library/curses.rst:1161 msgid "" "Write all data associated with the window into the provided file object. " "This information can be later retrieved using the :func:`getwin` function." @@ -1734,7 +1732,7 @@ msgstr "" "に書き込みます。この情報は後に :func:`getwin` 関数を使って取得することができ" "ます。" -#: ../../library/curses.rst:1192 +#: ../../library/curses.rst:1167 msgid "" "Indicate that the *num* screen lines, starting at line *beg*, are corrupted " "and should be completely redrawn on the next :meth:`refresh` call." @@ -1742,7 +1740,7 @@ msgstr "" "*beg* 行から始まる *num* スクリーン行の表示内容が壊れており、次の :meth:" "`refresh` 呼び出しで完全に再描画されなければならないことを通知します。" -#: ../../library/curses.rst:1198 +#: ../../library/curses.rst:1173 msgid "" "Touch the entire window, causing it to be completely redrawn on the next :" "meth:`refresh` call." @@ -1750,7 +1748,7 @@ msgstr "" "ウィンドウ全体を更新 (touch) し、次の :meth:`refresh` 呼び出しで完全に再描画" "されるようにします。" -#: ../../library/curses.rst:1204 +#: ../../library/curses.rst:1179 msgid "" "Update the display immediately (sync actual screen with previous drawing/" "deleting methods)." @@ -1758,7 +1756,7 @@ msgstr "" "ディスプレイを即時更新し (実際のウィンドウとこれまでの描画/削除メソッドの内容" "とを同期し) ます。" -#: ../../library/curses.rst:1207 +#: ../../library/curses.rst:1182 msgid "" "The 6 optional arguments can only be specified when the window is a pad " "created with :func:`newpad`. The additional parameters are needed to " @@ -1782,7 +1780,7 @@ msgstr "" "ません。*pminrow*, *pmincol*, *sminrow*, または *smincol* に負の値を指定する" "と、ゼロを指定したものとして扱われます。" -#: ../../library/curses.rst:1221 +#: ../../library/curses.rst:1196 msgid "" "Reallocate storage for a curses window to adjust its dimensions to the " "specified values. If either dimension is larger than the current values, " @@ -1793,11 +1791,11 @@ msgstr "" "ズが現在の値より大きい場合、ウィンドウのデータは現在の背景設定 (:meth:" "`bkgdset` で設定) で埋められマージされます。" -#: ../../library/curses.rst:1229 +#: ../../library/curses.rst:1204 msgid "Scroll the screen or scrolling region upward by *lines* lines." msgstr "スクリーンまたはスクロール領域を上に *lines* 行スクロールします。" -#: ../../library/curses.rst:1234 +#: ../../library/curses.rst:1209 msgid "" "Control what happens when the cursor of a window is moved off the edge of " "the window or scrolling region, either as a result of a newline action on " @@ -1813,7 +1811,7 @@ msgstr "" "スクロール効果を得るためには :meth:`idlok` も呼び出す必要があるので注意してく" "ださい。" -#: ../../library/curses.rst:1244 +#: ../../library/curses.rst:1219 msgid "" "Set the scrolling region from line *top* to line *bottom*. All scrolling " "actions will take place in this region." @@ -1821,7 +1819,7 @@ msgstr "" "スクロール領域を *top* から *bottom* に設定します。スクロール動作はすべてこの" "領域で行われます。" -#: ../../library/curses.rst:1250 +#: ../../library/curses.rst:1225 msgid "" "Turn off the standout attribute. On some terminals this has the side effect " "of turning off all attributes." @@ -1829,11 +1827,11 @@ msgstr "" "*A_STANDOUT* 属性をオフにします。端末によっては、この操作ですべての属性をオフ" "にする副作用が発生します。" -#: ../../library/curses.rst:1256 +#: ../../library/curses.rst:1231 msgid "Turn on attribute *A_STANDOUT*." msgstr "*A_STANDOUT* 属性をオンにします。" -#: ../../library/curses.rst:1262 ../../library/curses.rst:1269 +#: ../../library/curses.rst:1237 ../../library/curses.rst:1244 msgid "" "Return a sub-window, whose upper-left corner is at ``(begin_y, begin_x)``, " "and whose width/height is *ncols*/*nlines*." @@ -1841,7 +1839,7 @@ msgstr "" "左上の角が ``(begin_y, begin_x)`` にあり、幅/高さがそれぞれ *ncols* / " "*nlines* であるようなサブウィンドウを返します。" -#: ../../library/curses.rst:1272 +#: ../../library/curses.rst:1247 msgid "" "By default, the sub-window will extend from the specified position to the " "lower right corner of the window." @@ -1849,7 +1847,7 @@ msgstr "" "デフォルトでは、サブウィンドウは指定された場所からウィンドウの右下角まで広が" "ります。" -#: ../../library/curses.rst:1278 +#: ../../library/curses.rst:1253 msgid "" "Touch each location in the window that has been touched in any of its " "ancestor windows. This routine is called by :meth:`refresh`, so it should " @@ -1859,7 +1857,7 @@ msgstr "" "ンドウ内でも更新します。このルーチンは :meth:`refresh` から呼び出されるので、" "手動で呼び出す必要はほとんどないはずです。" -#: ../../library/curses.rst:1285 +#: ../../library/curses.rst:1260 msgid "" "If *flag* is ``True``, then :meth:`syncup` is called automatically whenever " "there is a change in the window." @@ -1867,7 +1865,7 @@ msgstr "" "*flag* が ``True`` の場合、ウィンドウが変更された際は常に :meth:`syncup` を自" "動的に呼ぶようになります。" -#: ../../library/curses.rst:1291 +#: ../../library/curses.rst:1266 msgid "" "Touch all locations in ancestors of the window that have been changed in " "the window." @@ -1875,7 +1873,7 @@ msgstr "" "ウィンドウ内で更新 (touch) した場所を、上位のすべてのウィンドウ内でも更新しま" "す。" -#: ../../library/curses.rst:1297 +#: ../../library/curses.rst:1272 msgid "" "Set blocking or non-blocking read behavior for the window. If *delay* is " "negative, blocking read is used (which will wait indefinitely for input). " @@ -1890,7 +1888,7 @@ msgstr "" "``-1`` を返します。*delay* が正の値であれば、:meth:`getch` は *delay* ミリ秒" "間ブロックし、ブロック後の時点で入力がない場合には ``-1`` を返します。" -#: ../../library/curses.rst:1307 +#: ../../library/curses.rst:1282 msgid "" "Pretend *count* lines have been changed, starting with line *start*. If " "*changed* is supplied, it specifies whether the affected lines are marked as " @@ -1901,7 +1899,7 @@ msgstr "" "*changed* が与えられた場合、その引数は指定された行が変更された(*changed*\\ " "``=True``)か、変更されていないか(*changed*\\ )を指定します。" -#: ../../library/curses.rst:1314 +#: ../../library/curses.rst:1289 msgid "" "Pretend the whole window has been changed, for purposes of drawing " "optimizations." @@ -1909,7 +1907,7 @@ msgstr "" "描画を最適化するために、すべてのウィンドウが変更されたかのように振舞わせま" "す。" -#: ../../library/curses.rst:1320 +#: ../../library/curses.rst:1295 msgid "" "Mark all lines in the window as unchanged since the last call to :meth:" "`refresh`." @@ -1917,21 +1915,23 @@ msgstr "" "ウィンドウ内のすべての行を、最後に :meth:`refresh` を呼んだ際から変更されてい" "ないものとしてマークします。" -#: ../../library/curses.rst:1327 +#: ../../library/curses.rst:1302 msgid "" "Display a vertical line starting at ``(y, x)`` with length *n* consisting of " -"the character *ch* with attributes *attr*." +"the character *ch*." msgstr "" +"``(y, x)`` から始まり、*n* の長さを持つ、文字 *ch* で作られる垂直線を表示しま" +"す。" -#: ../../library/curses.rst:1332 +#: ../../library/curses.rst:1307 msgid "Constants" msgstr "定数" -#: ../../library/curses.rst:1334 +#: ../../library/curses.rst:1309 msgid "The :mod:`curses` module defines the following data members:" msgstr ":mod:`curses` モジュールでは以下のデータメンバを定義しています:" -#: ../../library/curses.rst:1339 +#: ../../library/curses.rst:1314 msgid "" "Some curses routines that return an integer, such as :meth:`~window." "getch`, return :const:`ERR` upon failure." @@ -1939,7 +1939,7 @@ msgstr "" ":meth:`~window.getch` のような整数を返す curses ルーチンのいくつかは、失敗し" "た際に :const:`ERR` を返します。" -#: ../../library/curses.rst:1345 +#: ../../library/curses.rst:1320 msgid "" "Some curses routines that return an integer, such as :func:`napms`, " "return :const:`OK` upon success." @@ -1947,11 +1947,15 @@ msgstr "" ":func:`napms` のような整数を返す curses ルーチンのいくつかは、成功した際に :" "const:`OK` を返します。" -#: ../../library/curses.rst:1352 -msgid "A bytes object representing the current version of the module." +#: ../../library/curses.rst:1326 +msgid "" +"A bytes object representing the current version of the module. Also " +"available as :const:`__version__`." msgstr "" +"モジュールの現在のバージョンを表現する bytes オブジェクトです。:const:" +"`__version__` でも取得できます。" -#: ../../library/curses.rst:1357 +#: ../../library/curses.rst:1332 msgid "" "A named tuple containing the three components of the ncurses library " "version: *major*, *minor*, and *patch*. All values are integers. The " @@ -1959,146 +1963,200 @@ msgid "" "is equivalent to ``curses.ncurses_version.major`` and so on." msgstr "" -#: ../../library/curses.rst:1362 +#: ../../library/curses.rst:1337 msgid "Availability: if the ncurses library is used." msgstr "" -#: ../../library/curses.rst:1368 -msgid "" -"The maximum number of colors the terminal can support. It is defined only " -"after the call to :func:`start_color`." -msgstr "" - -#: ../../library/curses.rst:1373 -msgid "" -"The maximum number of color pairs the terminal can support. It is defined " -"only after the call to :func:`start_color`." -msgstr "" - -#: ../../library/curses.rst:1378 -msgid "" -"The width of the screen, i.e., the number of columns. It is defined only " -"after the call to :func:`initscr`. Updated by :func:`update_lines_cols`, :" -"func:`resizeterm` and :func:`resize_term`." -msgstr "" - -#: ../../library/curses.rst:1385 -msgid "" -"The height of the screen, i.e., the number of lines. It is defined only " -"after the call to :func:`initscr`. Updated by :func:`update_lines_cols`, :" -"func:`resizeterm` and :func:`resize_term`." -msgstr "" - -#: ../../library/curses.rst:1391 +#: ../../library/curses.rst:1342 msgid "" "Some constants are available to specify character cell attributes. The exact " "constants available are system dependent." msgstr "" -#: ../../library/curses.rst:1395 +#: ../../library/curses.rst:1346 msgid "Attribute" msgstr "属性" -#: ../../library/curses.rst:1395 ../../library/curses.rst:1440 -#: ../../library/curses.rst:1686 ../../library/curses.rst:1778 +#: ../../library/curses.rst:1346 ../../library/curses.rst:1394 +#: ../../library/curses.rst:1638 msgid "Meaning" msgstr "意味" -#: ../../library/curses.rst:1397 +#: ../../library/curses.rst:1348 +msgid "``A_ALTCHARSET``" +msgstr "``A_ALTCHARSET``" + +#: ../../library/curses.rst:1348 msgid "Alternate character set mode" msgstr "代替文字セットモード" -#: ../../library/curses.rst:1399 +#: ../../library/curses.rst:1350 +msgid "``A_BLINK``" +msgstr "``A_BLINK``" + +#: ../../library/curses.rst:1350 msgid "Blink mode" msgstr "点滅モード" -#: ../../library/curses.rst:1401 +#: ../../library/curses.rst:1352 +msgid "``A_BOLD``" +msgstr "``A_BOLD``" + +#: ../../library/curses.rst:1352 msgid "Bold mode" msgstr "太字モード" -#: ../../library/curses.rst:1403 +#: ../../library/curses.rst:1354 +msgid "``A_DIM``" +msgstr "``A_DIM``" + +#: ../../library/curses.rst:1354 msgid "Dim mode" msgstr "低輝度モード" -#: ../../library/curses.rst:1405 +#: ../../library/curses.rst:1356 +msgid "``A_INVIS``" +msgstr "``A_INVIS``" + +#: ../../library/curses.rst:1356 msgid "Invisible or blank mode" msgstr "" -#: ../../library/curses.rst:1407 +#: ../../library/curses.rst:1358 +msgid "``A_ITALIC``" +msgstr "``A_ITALIC``" + +#: ../../library/curses.rst:1358 msgid "Italic mode" msgstr "イタリックモード" -#: ../../library/curses.rst:1409 +#: ../../library/curses.rst:1360 +msgid "``A_NORMAL``" +msgstr "``A_NORMAL``" + +#: ../../library/curses.rst:1360 msgid "Normal attribute" msgstr "通常の属性" -#: ../../library/curses.rst:1411 +#: ../../library/curses.rst:1362 +msgid "``A_PROTECT``" +msgstr "``A_PROTECT``" + +#: ../../library/curses.rst:1362 msgid "Protected mode" msgstr "" -#: ../../library/curses.rst:1413 +#: ../../library/curses.rst:1364 +msgid "``A_REVERSE``" +msgstr "``A_REVERSE``" + +#: ../../library/curses.rst:1364 msgid "Reverse background and foreground colors" msgstr "" -#: ../../library/curses.rst:1416 +#: ../../library/curses.rst:1367 +msgid "``A_STANDOUT``" +msgstr "``A_STANDOUT``" + +#: ../../library/curses.rst:1367 msgid "Standout mode" msgstr "強調モード" -#: ../../library/curses.rst:1418 +#: ../../library/curses.rst:1369 +msgid "``A_UNDERLINE``" +msgstr "``A_UNDERLINE``" + +#: ../../library/curses.rst:1369 msgid "Underline mode" msgstr "下線モード" -#: ../../library/curses.rst:1420 +#: ../../library/curses.rst:1371 +msgid "``A_HORIZONTAL``" +msgstr "``A_HORIZONTAL``" + +#: ../../library/curses.rst:1371 msgid "Horizontal highlight" msgstr "" -#: ../../library/curses.rst:1422 +#: ../../library/curses.rst:1373 +msgid "``A_LEFT``" +msgstr "``A_LEFT``" + +#: ../../library/curses.rst:1373 msgid "Left highlight" msgstr "" -#: ../../library/curses.rst:1424 +#: ../../library/curses.rst:1375 +msgid "``A_LOW``" +msgstr "``A_LOW``" + +#: ../../library/curses.rst:1375 msgid "Low highlight" msgstr "" -#: ../../library/curses.rst:1426 +#: ../../library/curses.rst:1377 +msgid "``A_RIGHT``" +msgstr "``A_RIGHT``" + +#: ../../library/curses.rst:1377 msgid "Right highlight" msgstr "" -#: ../../library/curses.rst:1428 +#: ../../library/curses.rst:1379 +msgid "``A_TOP``" +msgstr "``A_TOP``" + +#: ../../library/curses.rst:1379 msgid "Top highlight" msgstr "" -#: ../../library/curses.rst:1430 +#: ../../library/curses.rst:1381 +msgid "``A_VERTICAL``" +msgstr "``A_VERTICAL``" + +#: ../../library/curses.rst:1381 msgid "Vertical highlight" msgstr "" -#: ../../library/curses.rst:1433 +#: ../../library/curses.rst:1383 ../../library/curses.rst:1399 +msgid "``A_CHARTEXT``" +msgstr "``A_CHARTEXT``" + +#: ../../library/curses.rst:1383 ../../library/curses.rst:1399 +msgid "Bit-mask to extract a character" +msgstr "" + +#: ../../library/curses.rst:1387 msgid "``A_ITALIC`` was added." msgstr "``A_ITALIC`` が追加されました。" -#: ../../library/curses.rst:1436 +#: ../../library/curses.rst:1390 msgid "" "Several constants are available to extract corresponding attributes returned " "by some methods." msgstr "" -#: ../../library/curses.rst:1440 +#: ../../library/curses.rst:1394 msgid "Bit-mask" msgstr "" -#: ../../library/curses.rst:1442 +#: ../../library/curses.rst:1396 +msgid "``A_ATTRIBUTES``" +msgstr "``A_ATTRIBUTES``" + +#: ../../library/curses.rst:1396 msgid "Bit-mask to extract attributes" msgstr "" -#: ../../library/curses.rst:1445 -msgid "Bit-mask to extract a character" -msgstr "" +#: ../../library/curses.rst:1402 +msgid "``A_COLOR``" +msgstr "``A_COLOR``" -#: ../../library/curses.rst:1448 +#: ../../library/curses.rst:1402 msgid "Bit-mask to extract color-pair field information" msgstr "" -#: ../../library/curses.rst:1452 +#: ../../library/curses.rst:1406 msgid "" "Keys are referred to by integer constants with names starting with " "``KEY_``. The exact keycaps available are system dependent." @@ -2106,460 +2164,843 @@ msgstr "" "キーは ``KEY_`` で始まる名前をもつ整数定数です。利用可能なキーキャップはシス" "テムに依存します。" -#: ../../library/curses.rst:1458 +#: ../../library/curses.rst:1412 msgid "Key constant" msgstr "キー定数" -#: ../../library/curses.rst:1458 +#: ../../library/curses.rst:1412 msgid "Key" msgstr "キー" -#: ../../library/curses.rst:1460 +#: ../../library/curses.rst:1414 +msgid "``KEY_MIN``" +msgstr "``KEY_MIN``" + +#: ../../library/curses.rst:1414 msgid "Minimum key value" msgstr "最小のキー値" -#: ../../library/curses.rst:1462 +#: ../../library/curses.rst:1416 +msgid "``KEY_BREAK``" +msgstr "``KEY_BREAK``" + +#: ../../library/curses.rst:1416 msgid "Break key (unreliable)" msgstr "ブレークキー (Break, 信頼できません)" -#: ../../library/curses.rst:1464 +#: ../../library/curses.rst:1418 +msgid "``KEY_DOWN``" +msgstr "``KEY_DOWN``" + +#: ../../library/curses.rst:1418 msgid "Down-arrow" msgstr "下矢印" -#: ../../library/curses.rst:1466 +#: ../../library/curses.rst:1420 +msgid "``KEY_UP``" +msgstr "``KEY_UP``" + +#: ../../library/curses.rst:1420 msgid "Up-arrow" msgstr "上矢印" -#: ../../library/curses.rst:1468 +#: ../../library/curses.rst:1422 +msgid "``KEY_LEFT``" +msgstr "``KEY_LEFT``" + +#: ../../library/curses.rst:1422 msgid "Left-arrow" msgstr "左矢印" -#: ../../library/curses.rst:1470 +#: ../../library/curses.rst:1424 +msgid "``KEY_RIGHT``" +msgstr "``KEY_RIGHT``" + +#: ../../library/curses.rst:1424 msgid "Right-arrow" msgstr "右矢印" -#: ../../library/curses.rst:1472 +#: ../../library/curses.rst:1426 +msgid "``KEY_HOME``" +msgstr "``KEY_HOME``" + +#: ../../library/curses.rst:1426 msgid "Home key (upward+left arrow)" msgstr "ホームキー (Home, または上左矢印)" -#: ../../library/curses.rst:1474 +#: ../../library/curses.rst:1428 +msgid "``KEY_BACKSPACE``" +msgstr "``KEY_BACKSPACE``" + +#: ../../library/curses.rst:1428 msgid "Backspace (unreliable)" msgstr "バックスペース (Backspace, 信頼できません)" -#: ../../library/curses.rst:1476 +#: ../../library/curses.rst:1430 +msgid "``KEY_F0``" +msgstr "``KEY_F0``" + +#: ../../library/curses.rst:1430 msgid "Function keys. Up to 64 function keys are supported." msgstr "ファンクションキー。64 個までサポートされています。" -#: ../../library/curses.rst:1479 +#: ../../library/curses.rst:1433 +msgid "``KEY_Fn``" +msgstr "``KEY_Fn``" + +#: ../../library/curses.rst:1433 msgid "Value of function key *n*" msgstr "ファンクションキー *n* の値" -#: ../../library/curses.rst:1481 +#: ../../library/curses.rst:1435 +msgid "``KEY_DL``" +msgstr "``KEY_DL``" + +#: ../../library/curses.rst:1435 msgid "Delete line" msgstr "行削除 (Delete line)" -#: ../../library/curses.rst:1483 +#: ../../library/curses.rst:1437 +msgid "``KEY_IL``" +msgstr "``KEY_IL``" + +#: ../../library/curses.rst:1437 msgid "Insert line" msgstr "行挿入 (Insert line)" -#: ../../library/curses.rst:1485 +#: ../../library/curses.rst:1439 +msgid "``KEY_DC``" +msgstr "``KEY_DC``" + +#: ../../library/curses.rst:1439 msgid "Delete character" msgstr "文字削除 (Delete char)" -#: ../../library/curses.rst:1487 +#: ../../library/curses.rst:1441 +msgid "``KEY_IC``" +msgstr "``KEY_IC``" + +#: ../../library/curses.rst:1441 msgid "Insert char or enter insert mode" msgstr "文字挿入、または文字挿入モードへ入る" -#: ../../library/curses.rst:1489 +#: ../../library/curses.rst:1443 +msgid "``KEY_EIC``" +msgstr "``KEY_EIC``" + +#: ../../library/curses.rst:1443 msgid "Exit insert char mode" msgstr "文字挿入モードから抜ける" -#: ../../library/curses.rst:1491 +#: ../../library/curses.rst:1445 +msgid "``KEY_CLEAR``" +msgstr "``KEY_CLEAR``" + +#: ../../library/curses.rst:1445 msgid "Clear screen" msgstr "画面消去" -#: ../../library/curses.rst:1493 +#: ../../library/curses.rst:1447 +msgid "``KEY_EOS``" +msgstr "``KEY_EOS``" + +#: ../../library/curses.rst:1447 msgid "Clear to end of screen" msgstr "画面の末端まで消去" -#: ../../library/curses.rst:1495 +#: ../../library/curses.rst:1449 +msgid "``KEY_EOL``" +msgstr "``KEY_EOL``" + +#: ../../library/curses.rst:1449 msgid "Clear to end of line" msgstr "行末端まで消去" -#: ../../library/curses.rst:1497 +#: ../../library/curses.rst:1451 +msgid "``KEY_SF``" +msgstr "``KEY_SF``" + +#: ../../library/curses.rst:1451 msgid "Scroll 1 line forward" msgstr "前に 1 行スクロール" -#: ../../library/curses.rst:1499 +#: ../../library/curses.rst:1453 +msgid "``KEY_SR``" +msgstr "``KEY_SR``" + +#: ../../library/curses.rst:1453 msgid "Scroll 1 line backward (reverse)" msgstr "後ろ (逆方向) に 1 行スクロール" -#: ../../library/curses.rst:1501 +#: ../../library/curses.rst:1455 +msgid "``KEY_NPAGE``" +msgstr "``KEY_NPAGE``" + +#: ../../library/curses.rst:1455 msgid "Next page" msgstr "次のページ (Page Next)" -#: ../../library/curses.rst:1503 +#: ../../library/curses.rst:1457 +msgid "``KEY_PPAGE``" +msgstr "``KEY_PPAGE``" + +#: ../../library/curses.rst:1457 msgid "Previous page" msgstr "前のページ (Page Prev)" -#: ../../library/curses.rst:1505 +#: ../../library/curses.rst:1459 +msgid "``KEY_STAB``" +msgstr "``KEY_STAB``" + +#: ../../library/curses.rst:1459 msgid "Set tab" msgstr "タブ設定" -#: ../../library/curses.rst:1507 +#: ../../library/curses.rst:1461 +msgid "``KEY_CTAB``" +msgstr "``KEY_CTAB``" + +#: ../../library/curses.rst:1461 msgid "Clear tab" msgstr "タブリセット" -#: ../../library/curses.rst:1509 +#: ../../library/curses.rst:1463 +msgid "``KEY_CATAB``" +msgstr "``KEY_CATAB``" + +#: ../../library/curses.rst:1463 msgid "Clear all tabs" msgstr "すべてのタブをリセット" -#: ../../library/curses.rst:1511 +#: ../../library/curses.rst:1465 +msgid "``KEY_ENTER``" +msgstr "``KEY_ENTER``" + +#: ../../library/curses.rst:1465 msgid "Enter or send (unreliable)" msgstr "入力または送信 (信頼できません)" -#: ../../library/curses.rst:1513 +#: ../../library/curses.rst:1467 +msgid "``KEY_SRESET``" +msgstr "``KEY_SRESET``" + +#: ../../library/curses.rst:1467 msgid "Soft (partial) reset (unreliable)" msgstr "ソフトウェア (部分的) リセット (信頼できません)" -#: ../../library/curses.rst:1515 +#: ../../library/curses.rst:1469 +msgid "``KEY_RESET``" +msgstr "``KEY_RESET``" + +#: ../../library/curses.rst:1469 msgid "Reset or hard reset (unreliable)" msgstr "リセットまたはハードリセット (信頼できません)" -#: ../../library/curses.rst:1517 +#: ../../library/curses.rst:1471 +msgid "``KEY_PRINT``" +msgstr "``KEY_PRINT``" + +#: ../../library/curses.rst:1471 msgid "Print" msgstr "印刷 (Print)" -#: ../../library/curses.rst:1519 +#: ../../library/curses.rst:1473 +msgid "``KEY_LL``" +msgstr "``KEY_LL``" + +#: ../../library/curses.rst:1473 msgid "Home down or bottom (lower left)" msgstr "下ホーム (Home down) または最下行 (左下)" -#: ../../library/curses.rst:1521 +#: ../../library/curses.rst:1475 +msgid "``KEY_A1``" +msgstr "``KEY_A1``" + +#: ../../library/curses.rst:1475 msgid "Upper left of keypad" msgstr "キーパッドの左上キー" -#: ../../library/curses.rst:1523 +#: ../../library/curses.rst:1477 +msgid "``KEY_A3``" +msgstr "``KEY_A3``" + +#: ../../library/curses.rst:1477 msgid "Upper right of keypad" msgstr "キーパッドの右上キー" -#: ../../library/curses.rst:1525 +#: ../../library/curses.rst:1479 +msgid "``KEY_B2``" +msgstr "``KEY_B2``" + +#: ../../library/curses.rst:1479 msgid "Center of keypad" msgstr "キーパッドの中央キー" -#: ../../library/curses.rst:1527 +#: ../../library/curses.rst:1481 +msgid "``KEY_C1``" +msgstr "``KEY_C1``" + +#: ../../library/curses.rst:1481 msgid "Lower left of keypad" msgstr "キーパッドの左下キー" -#: ../../library/curses.rst:1529 +#: ../../library/curses.rst:1483 +msgid "``KEY_C3``" +msgstr "``KEY_C3``" + +#: ../../library/curses.rst:1483 msgid "Lower right of keypad" msgstr "キーパッドの右下キー" -#: ../../library/curses.rst:1531 +#: ../../library/curses.rst:1485 +msgid "``KEY_BTAB``" +msgstr "``KEY_BTAB``" + +#: ../../library/curses.rst:1485 msgid "Back tab" msgstr "Back tab" -#: ../../library/curses.rst:1533 +#: ../../library/curses.rst:1487 +msgid "``KEY_BEG``" +msgstr "``KEY_BEG``" + +#: ../../library/curses.rst:1487 msgid "Beg (beginning)" msgstr "開始 (Beg)" -#: ../../library/curses.rst:1535 +#: ../../library/curses.rst:1489 +msgid "``KEY_CANCEL``" +msgstr "``KEY_CANCEL``" + +#: ../../library/curses.rst:1489 msgid "Cancel" msgstr "キャンセル (Cancel)" -#: ../../library/curses.rst:1537 +#: ../../library/curses.rst:1491 +msgid "``KEY_CLOSE``" +msgstr "``KEY_CLOSE``" + +#: ../../library/curses.rst:1491 msgid "Close" msgstr "Close [閉じる]" -#: ../../library/curses.rst:1539 +#: ../../library/curses.rst:1493 +msgid "``KEY_COMMAND``" +msgstr "``KEY_COMMAND``" + +#: ../../library/curses.rst:1493 msgid "Cmd (command)" msgstr "コマンド (Cmd)" -#: ../../library/curses.rst:1541 +#: ../../library/curses.rst:1495 +msgid "``KEY_COPY``" +msgstr "``KEY_COPY``" + +#: ../../library/curses.rst:1495 msgid "Copy" msgstr "Copy [コピー]" -#: ../../library/curses.rst:1543 +#: ../../library/curses.rst:1497 +msgid "``KEY_CREATE``" +msgstr "``KEY_CREATE``" + +#: ../../library/curses.rst:1497 msgid "Create" msgstr "生成 (Create)" -#: ../../library/curses.rst:1545 +#: ../../library/curses.rst:1499 +msgid "``KEY_END``" +msgstr "``KEY_END``" + +#: ../../library/curses.rst:1499 msgid "End" msgstr "終了 (End)" -#: ../../library/curses.rst:1547 +#: ../../library/curses.rst:1501 +msgid "``KEY_EXIT``" +msgstr "``KEY_EXIT``" + +#: ../../library/curses.rst:1501 msgid "Exit" msgstr "Exit [終了]" -#: ../../library/curses.rst:1549 +#: ../../library/curses.rst:1503 +msgid "``KEY_FIND``" +msgstr "``KEY_FIND``" + +#: ../../library/curses.rst:1503 msgid "Find" msgstr "検索 (Find)" -#: ../../library/curses.rst:1551 +#: ../../library/curses.rst:1505 +msgid "``KEY_HELP``" +msgstr "``KEY_HELP``" + +#: ../../library/curses.rst:1505 msgid "Help" msgstr "ヘルプ (Help)" -#: ../../library/curses.rst:1553 +#: ../../library/curses.rst:1507 +msgid "``KEY_MARK``" +msgstr "``KEY_MARK``" + +#: ../../library/curses.rst:1507 msgid "Mark" msgstr "マーク (Mark)" -#: ../../library/curses.rst:1555 +#: ../../library/curses.rst:1509 +msgid "``KEY_MESSAGE``" +msgstr "``KEY_MESSAGE``" + +#: ../../library/curses.rst:1509 msgid "Message" msgstr "メッセージ (Message)" -#: ../../library/curses.rst:1557 +#: ../../library/curses.rst:1511 +msgid "``KEY_MOVE``" +msgstr "``KEY_MOVE``" + +#: ../../library/curses.rst:1511 msgid "Move" msgstr "移動 (Move)" -#: ../../library/curses.rst:1559 +#: ../../library/curses.rst:1513 +msgid "``KEY_NEXT``" +msgstr "``KEY_NEXT``" + +#: ../../library/curses.rst:1513 msgid "Next" msgstr "次へ (Next)" -#: ../../library/curses.rst:1561 +#: ../../library/curses.rst:1515 +msgid "``KEY_OPEN``" +msgstr "``KEY_OPEN``" + +#: ../../library/curses.rst:1515 msgid "Open" msgstr "開く (Open)" -#: ../../library/curses.rst:1563 +#: ../../library/curses.rst:1517 +msgid "``KEY_OPTIONS``" +msgstr "``KEY_OPTIONS``" + +#: ../../library/curses.rst:1517 msgid "Options" msgstr "オプション" -#: ../../library/curses.rst:1565 +#: ../../library/curses.rst:1519 +msgid "``KEY_PREVIOUS``" +msgstr "``KEY_PREVIOUS``" + +#: ../../library/curses.rst:1519 msgid "Prev (previous)" msgstr "前へ (Prev)" -#: ../../library/curses.rst:1567 +#: ../../library/curses.rst:1521 +msgid "``KEY_REDO``" +msgstr "``KEY_REDO``" + +#: ../../library/curses.rst:1521 msgid "Redo" msgstr "Redo [やり直し]" -#: ../../library/curses.rst:1569 +#: ../../library/curses.rst:1523 +msgid "``KEY_REFERENCE``" +msgstr "``KEY_REFERENCE``" + +#: ../../library/curses.rst:1523 msgid "Ref (reference)" msgstr "参照 (Ref)" -#: ../../library/curses.rst:1571 +#: ../../library/curses.rst:1525 +msgid "``KEY_REFRESH``" +msgstr "``KEY_REFRESH``" + +#: ../../library/curses.rst:1525 msgid "Refresh" msgstr "更新 (Refresh)" -#: ../../library/curses.rst:1573 +#: ../../library/curses.rst:1527 +msgid "``KEY_REPLACE``" +msgstr "``KEY_REPLACE``" + +#: ../../library/curses.rst:1527 msgid "Replace" msgstr "置換 (Replace)" -#: ../../library/curses.rst:1575 +#: ../../library/curses.rst:1529 +msgid "``KEY_RESTART``" +msgstr "``KEY_RESTART``" + +#: ../../library/curses.rst:1529 msgid "Restart" msgstr "再起動 (Restart)" -#: ../../library/curses.rst:1577 +#: ../../library/curses.rst:1531 +msgid "``KEY_RESUME``" +msgstr "``KEY_RESUME``" + +#: ../../library/curses.rst:1531 msgid "Resume" msgstr "再開 (Resume)" -#: ../../library/curses.rst:1579 +#: ../../library/curses.rst:1533 +msgid "``KEY_SAVE``" +msgstr "``KEY_SAVE``" + +#: ../../library/curses.rst:1533 msgid "Save" msgstr "Save [保存]" -#: ../../library/curses.rst:1581 +#: ../../library/curses.rst:1535 +msgid "``KEY_SBEG``" +msgstr "``KEY_SBEG``" + +#: ../../library/curses.rst:1535 msgid "Shifted Beg (beginning)" msgstr "シフト付き Beg" -#: ../../library/curses.rst:1583 +#: ../../library/curses.rst:1537 +msgid "``KEY_SCANCEL``" +msgstr "``KEY_SCANCEL``" + +#: ../../library/curses.rst:1537 msgid "Shifted Cancel" msgstr "シフト付き Cancel" -#: ../../library/curses.rst:1585 +#: ../../library/curses.rst:1539 +msgid "``KEY_SCOMMAND``" +msgstr "``KEY_SCOMMAND``" + +#: ../../library/curses.rst:1539 msgid "Shifted Command" msgstr "シフト付き Command" -#: ../../library/curses.rst:1587 +#: ../../library/curses.rst:1541 +msgid "``KEY_SCOPY``" +msgstr "``KEY_SCOPY``" + +#: ../../library/curses.rst:1541 msgid "Shifted Copy" msgstr "シフト付き Copy" -#: ../../library/curses.rst:1589 +#: ../../library/curses.rst:1543 +msgid "``KEY_SCREATE``" +msgstr "``KEY_SCREATE``" + +#: ../../library/curses.rst:1543 msgid "Shifted Create" msgstr "シフト付き Create" -#: ../../library/curses.rst:1591 +#: ../../library/curses.rst:1545 +msgid "``KEY_SDC``" +msgstr "``KEY_SDC``" + +#: ../../library/curses.rst:1545 msgid "Shifted Delete char" msgstr "シフト付き Delete char" -#: ../../library/curses.rst:1593 +#: ../../library/curses.rst:1547 +msgid "``KEY_SDL``" +msgstr "``KEY_SDL``" + +#: ../../library/curses.rst:1547 msgid "Shifted Delete line" msgstr "シフト付き Delete line" -#: ../../library/curses.rst:1595 +#: ../../library/curses.rst:1549 +msgid "``KEY_SELECT``" +msgstr "``KEY_SELECT``" + +#: ../../library/curses.rst:1549 msgid "Select" msgstr "選択 (Select)" -#: ../../library/curses.rst:1597 +#: ../../library/curses.rst:1551 +msgid "``KEY_SEND``" +msgstr "``KEY_SEND``" + +#: ../../library/curses.rst:1551 msgid "Shifted End" msgstr "シフト付き End" -#: ../../library/curses.rst:1599 +#: ../../library/curses.rst:1553 +msgid "``KEY_SEOL``" +msgstr "``KEY_SEOL``" + +#: ../../library/curses.rst:1553 msgid "Shifted Clear line" msgstr "シフト付き Clear line" -#: ../../library/curses.rst:1601 +#: ../../library/curses.rst:1555 +msgid "``KEY_SEXIT``" +msgstr "``KEY_SEXIT``" + +#: ../../library/curses.rst:1555 msgid "Shifted Exit" msgstr "シフト付き Exit" -#: ../../library/curses.rst:1603 +#: ../../library/curses.rst:1557 +msgid "``KEY_SFIND``" +msgstr "``KEY_SFIND``" + +#: ../../library/curses.rst:1557 msgid "Shifted Find" msgstr "シフト付き Find" -#: ../../library/curses.rst:1605 +#: ../../library/curses.rst:1559 +msgid "``KEY_SHELP``" +msgstr "``KEY_SHELP``" + +#: ../../library/curses.rst:1559 msgid "Shifted Help" msgstr "シフト付き Help" -#: ../../library/curses.rst:1607 +#: ../../library/curses.rst:1561 +msgid "``KEY_SHOME``" +msgstr "``KEY_SHOME``" + +#: ../../library/curses.rst:1561 msgid "Shifted Home" msgstr "シフト付き Home" -#: ../../library/curses.rst:1609 +#: ../../library/curses.rst:1563 +msgid "``KEY_SIC``" +msgstr "``KEY_SIC``" + +#: ../../library/curses.rst:1563 msgid "Shifted Input" msgstr "シフト付き Input" -#: ../../library/curses.rst:1611 +#: ../../library/curses.rst:1565 +msgid "``KEY_SLEFT``" +msgstr "``KEY_SLEFT``" + +#: ../../library/curses.rst:1565 msgid "Shifted Left arrow" msgstr "シフト付き Left arrow" -#: ../../library/curses.rst:1613 +#: ../../library/curses.rst:1567 +msgid "``KEY_SMESSAGE``" +msgstr "``KEY_SMESSAGE``" + +#: ../../library/curses.rst:1567 msgid "Shifted Message" msgstr "シフト付き Message" -#: ../../library/curses.rst:1615 +#: ../../library/curses.rst:1569 +msgid "``KEY_SMOVE``" +msgstr "``KEY_SMOVE``" + +#: ../../library/curses.rst:1569 msgid "Shifted Move" msgstr "シフト付き Move" -#: ../../library/curses.rst:1617 +#: ../../library/curses.rst:1571 +msgid "``KEY_SNEXT``" +msgstr "``KEY_SNEXT``" + +#: ../../library/curses.rst:1571 msgid "Shifted Next" msgstr "シフト付き Next" -#: ../../library/curses.rst:1619 +#: ../../library/curses.rst:1573 +msgid "``KEY_SOPTIONS``" +msgstr "``KEY_SOPTIONS``" + +#: ../../library/curses.rst:1573 msgid "Shifted Options" msgstr "シフト付き Options" -#: ../../library/curses.rst:1621 +#: ../../library/curses.rst:1575 +msgid "``KEY_SPREVIOUS``" +msgstr "``KEY_SPREVIOUS``" + +#: ../../library/curses.rst:1575 msgid "Shifted Prev" msgstr "シフト付き Prev" -#: ../../library/curses.rst:1623 +#: ../../library/curses.rst:1577 +msgid "``KEY_SPRINT``" +msgstr "``KEY_SPRINT``" + +#: ../../library/curses.rst:1577 msgid "Shifted Print" msgstr "シフト付き Print" -#: ../../library/curses.rst:1625 +#: ../../library/curses.rst:1579 +msgid "``KEY_SREDO``" +msgstr "``KEY_SREDO``" + +#: ../../library/curses.rst:1579 msgid "Shifted Redo" msgstr "シフト付き Redo" -#: ../../library/curses.rst:1627 +#: ../../library/curses.rst:1581 +msgid "``KEY_SREPLACE``" +msgstr "``KEY_SREPLACE``" + +#: ../../library/curses.rst:1581 msgid "Shifted Replace" msgstr "シフト付き Replace" -#: ../../library/curses.rst:1629 +#: ../../library/curses.rst:1583 +msgid "``KEY_SRIGHT``" +msgstr "``KEY_SRIGHT``" + +#: ../../library/curses.rst:1583 msgid "Shifted Right arrow" msgstr "シフト付き Right arrow" -#: ../../library/curses.rst:1631 +#: ../../library/curses.rst:1585 +msgid "``KEY_SRSUME``" +msgstr "``KEY_SRSUME``" + +#: ../../library/curses.rst:1585 msgid "Shifted Resume" msgstr "シフト付き Resume" -#: ../../library/curses.rst:1633 +#: ../../library/curses.rst:1587 +msgid "``KEY_SSAVE``" +msgstr "``KEY_SSAVE``" + +#: ../../library/curses.rst:1587 msgid "Shifted Save" msgstr "シフト付き Save" -#: ../../library/curses.rst:1635 +#: ../../library/curses.rst:1589 +msgid "``KEY_SSUSPEND``" +msgstr "``KEY_SSUSPEND``" + +#: ../../library/curses.rst:1589 msgid "Shifted Suspend" msgstr "シフト付き Suspend" -#: ../../library/curses.rst:1637 +#: ../../library/curses.rst:1591 +msgid "``KEY_SUNDO``" +msgstr "``KEY_SUNDO``" + +#: ../../library/curses.rst:1591 msgid "Shifted Undo" msgstr "シフト付き Undo" -#: ../../library/curses.rst:1639 +#: ../../library/curses.rst:1593 +msgid "``KEY_SUSPEND``" +msgstr "``KEY_SUSPEND``" + +#: ../../library/curses.rst:1593 msgid "Suspend" msgstr "一時停止 (Suspend)" -#: ../../library/curses.rst:1641 +#: ../../library/curses.rst:1595 +msgid "``KEY_UNDO``" +msgstr "``KEY_UNDO``" + +#: ../../library/curses.rst:1595 msgid "Undo" msgstr "Undo [元に戻す]" -#: ../../library/curses.rst:1643 +#: ../../library/curses.rst:1597 +msgid "``KEY_MOUSE``" +msgstr "``KEY_MOUSE``" + +#: ../../library/curses.rst:1597 msgid "Mouse event has occurred" msgstr "マウスイベント通知" -#: ../../library/curses.rst:1645 +#: ../../library/curses.rst:1599 +msgid "``KEY_RESIZE``" +msgstr "``KEY_RESIZE``" + +#: ../../library/curses.rst:1599 msgid "Terminal resize event" msgstr "端末リサイズイベント" -#: ../../library/curses.rst:1647 +#: ../../library/curses.rst:1601 +msgid "``KEY_MAX``" +msgstr "``KEY_MAX``" + +#: ../../library/curses.rst:1601 msgid "Maximum key value" msgstr "最大キー値" -#: ../../library/curses.rst:1650 +#: ../../library/curses.rst:1604 msgid "" "On VT100s and their software emulations, such as X terminal emulators, there " -"are normally at least four function keys (:const:`KEY_F1 `, :const:" -"`KEY_F2 `, :const:`KEY_F3 `, :const:`KEY_F4 `) " -"available, and the arrow keys mapped to :const:`KEY_UP`, :const:`KEY_DOWN`, :" -"const:`KEY_LEFT` and :const:`KEY_RIGHT` in the obvious way. If your machine " -"has a PC keyboard, it is safe to expect arrow keys and twelve function keys " -"(older PC keyboards may have only ten function keys); also, the following " -"keypad mappings are standard:" -msgstr "" +"are normally at least four function keys (:const:`KEY_F1`, :const:`KEY_F2`, :" +"const:`KEY_F3`, :const:`KEY_F4`) available, and the arrow keys mapped to :" +"const:`KEY_UP`, :const:`KEY_DOWN`, :const:`KEY_LEFT` and :const:`KEY_RIGHT` " +"in the obvious way. If your machine has a PC keyboard, it is safe to expect " +"arrow keys and twelve function keys (older PC keyboards may have only ten " +"function keys); also, the following keypad mappings are standard:" +msgstr "" +"VT100 や、X 端末エミュレータのようなソフトウェアエミュレーションでは、通常少" +"なくとも 4 つのファンクションキー (:const:`KEY_F1`, :const:`KEY_F2`, :const:" +"`KEY_F3`, :const:`KEY_F4`) が利用可能で、矢印キーは :const:`KEY_UP`, :const:" +"`KEY_DOWN`, :const:`KEY_LEFT` および :const:`KEY_RIGHT` が対応付けられていま" +"す。計算機に PC キーボードが付属している場合、矢印キーと 12 個のファンクショ" +"ンキー (古い PC キーボードには 10 個しかファンクションキーがないかもしれませ" +"ん) が利用できると考えてよいでしょう; また、以下のキーパッド対応付けは標準的" +"なものです:" -#: ../../library/curses.rst:1659 +#: ../../library/curses.rst:1613 msgid "Keycap" msgstr "キーキャップ" -#: ../../library/curses.rst:1659 ../../library/curses.rst:1804 -#: ../../library/curses.rst:1928 +#: ../../library/curses.rst:1613 ../../library/curses.rst:1730 +#: ../../library/curses.rst:1854 msgid "Constant" msgstr "定数" -#: ../../library/curses.rst:1661 +#: ../../library/curses.rst:1615 msgid ":kbd:`Insert`" msgstr ":kbd:`Insert`" -#: ../../library/curses.rst:1661 +#: ../../library/curses.rst:1615 msgid "KEY_IC" msgstr "KEY_IC" -#: ../../library/curses.rst:1663 +#: ../../library/curses.rst:1617 msgid ":kbd:`Delete`" msgstr ":kbd:`Delete`" -#: ../../library/curses.rst:1663 +#: ../../library/curses.rst:1617 msgid "KEY_DC" msgstr "KEY_DC" -#: ../../library/curses.rst:1665 +#: ../../library/curses.rst:1619 msgid ":kbd:`Home`" msgstr ":kbd:`Home`" -#: ../../library/curses.rst:1665 +#: ../../library/curses.rst:1619 msgid "KEY_HOME" msgstr "KEY_HOME" -#: ../../library/curses.rst:1667 +#: ../../library/curses.rst:1621 msgid ":kbd:`End`" msgstr ":kbd:`End`" -#: ../../library/curses.rst:1667 +#: ../../library/curses.rst:1621 msgid "KEY_END" msgstr "KEY_END" -#: ../../library/curses.rst:1669 +#: ../../library/curses.rst:1623 msgid ":kbd:`Page Up`" msgstr ":kbd:`Page Up`" -#: ../../library/curses.rst:1669 +#: ../../library/curses.rst:1623 msgid "KEY_PPAGE" msgstr "KEY_PPAGE" -#: ../../library/curses.rst:1671 +#: ../../library/curses.rst:1625 msgid ":kbd:`Page Down`" msgstr ":kbd:`Page Down`" -#: ../../library/curses.rst:1671 +#: ../../library/curses.rst:1625 msgid "KEY_NPAGE" msgstr "KEY_NPAGE" -#: ../../library/curses.rst:1676 +#: ../../library/curses.rst:1628 msgid "" "The following table lists characters from the alternate character set. These " "are inherited from the VT100 terminal, and will generally be available on " @@ -2571,269 +3012,436 @@ msgstr "" "グラフィックが利用できない場合、curses は印字可能 ASCII文字による粗雑な近似出" "力を行います。" -#: ../../library/curses.rst:1683 +#: ../../library/curses.rst:1635 msgid "These are available only after :func:`initscr` has been called." msgstr "これらは :func:`initscr` が呼び出された後でしか利用できません。" -#: ../../library/curses.rst:1686 +#: ../../library/curses.rst:1638 msgid "ACS code" msgstr "ACS コード" -#: ../../library/curses.rst:1688 +#: ../../library/curses.rst:1640 +msgid "``ACS_BBSS``" +msgstr "``ACS_BBSS``" + +#: ../../library/curses.rst:1640 msgid "alternate name for upper right corner" msgstr "右上角の別名" -#: ../../library/curses.rst:1690 +#: ../../library/curses.rst:1642 +msgid "``ACS_BLOCK``" +msgstr "``ACS_BLOCK``" + +#: ../../library/curses.rst:1642 msgid "solid square block" msgstr "黒四角ブロック" -#: ../../library/curses.rst:1692 +#: ../../library/curses.rst:1644 +msgid "``ACS_BOARD``" +msgstr "``ACS_BOARD``" + +#: ../../library/curses.rst:1644 msgid "board of squares" msgstr "白四角ブロック" -#: ../../library/curses.rst:1694 +#: ../../library/curses.rst:1646 +msgid "``ACS_BSBS``" +msgstr "``ACS_BSBS``" + +#: ../../library/curses.rst:1646 msgid "alternate name for horizontal line" msgstr "水平線の別名" -#: ../../library/curses.rst:1696 +#: ../../library/curses.rst:1648 +msgid "``ACS_BSSB``" +msgstr "``ACS_BSSB``" + +#: ../../library/curses.rst:1648 msgid "alternate name for upper left corner" msgstr "左上角の別名" -#: ../../library/curses.rst:1698 +#: ../../library/curses.rst:1650 +msgid "``ACS_BSSS``" +msgstr "``ACS_BSSS``" + +#: ../../library/curses.rst:1650 msgid "alternate name for top tee" msgstr "上向き T 字罫線の別名" -#: ../../library/curses.rst:1700 +#: ../../library/curses.rst:1652 +msgid "``ACS_BTEE``" +msgstr "``ACS_BTEE``" + +#: ../../library/curses.rst:1652 msgid "bottom tee" msgstr "下向き T 字罫線" -#: ../../library/curses.rst:1702 +#: ../../library/curses.rst:1654 +msgid "``ACS_BULLET``" +msgstr "``ACS_BULLET``" + +#: ../../library/curses.rst:1654 msgid "bullet" msgstr "黒丸(bullet)" -#: ../../library/curses.rst:1704 +#: ../../library/curses.rst:1656 +msgid "``ACS_CKBOARD``" +msgstr "``ACS_CKBOARD``" + +#: ../../library/curses.rst:1656 msgid "checker board (stipple)" msgstr "チェッカーボードパタン (点描)" -#: ../../library/curses.rst:1706 +#: ../../library/curses.rst:1658 +msgid "``ACS_DARROW``" +msgstr "``ACS_DARROW``" + +#: ../../library/curses.rst:1658 msgid "arrow pointing down" msgstr "下向き矢印" -#: ../../library/curses.rst:1708 +#: ../../library/curses.rst:1660 +msgid "``ACS_DEGREE``" +msgstr "``ACS_DEGREE``" + +#: ../../library/curses.rst:1660 msgid "degree symbol" msgstr "度記号" -#: ../../library/curses.rst:1710 +#: ../../library/curses.rst:1662 +msgid "``ACS_DIAMOND``" +msgstr "``ACS_DIAMOND``" + +#: ../../library/curses.rst:1662 msgid "diamond" msgstr "ダイアモンド" -#: ../../library/curses.rst:1712 +#: ../../library/curses.rst:1664 +msgid "``ACS_GEQUAL``" +msgstr "``ACS_GEQUAL``" + +#: ../../library/curses.rst:1664 msgid "greater-than-or-equal-to" msgstr "大なりイコール" -#: ../../library/curses.rst:1714 +#: ../../library/curses.rst:1666 +msgid "``ACS_HLINE``" +msgstr "``ACS_HLINE``" + +#: ../../library/curses.rst:1666 msgid "horizontal line" msgstr "水平線" -#: ../../library/curses.rst:1716 +#: ../../library/curses.rst:1668 +msgid "``ACS_LANTERN``" +msgstr "``ACS_LANTERN``" + +#: ../../library/curses.rst:1668 msgid "lantern symbol" msgstr "ランタン(lantern) シンボル" -#: ../../library/curses.rst:1718 +#: ../../library/curses.rst:1670 +msgid "``ACS_LARROW``" +msgstr "``ACS_LARROW``" + +#: ../../library/curses.rst:1670 msgid "left arrow" msgstr "左向き矢印" -#: ../../library/curses.rst:1720 +#: ../../library/curses.rst:1672 +msgid "``ACS_LEQUAL``" +msgstr "``ACS_LEQUAL``" + +#: ../../library/curses.rst:1672 msgid "less-than-or-equal-to" msgstr "小なりイコール" -#: ../../library/curses.rst:1722 +#: ../../library/curses.rst:1674 +msgid "``ACS_LLCORNER``" +msgstr "``ACS_LLCORNER``" + +#: ../../library/curses.rst:1674 msgid "lower left-hand corner" msgstr "左下角" -#: ../../library/curses.rst:1724 +#: ../../library/curses.rst:1676 +msgid "``ACS_LRCORNER``" +msgstr "``ACS_LRCORNER``" + +#: ../../library/curses.rst:1676 msgid "lower right-hand corner" msgstr "右下角" -#: ../../library/curses.rst:1726 +#: ../../library/curses.rst:1678 +msgid "``ACS_LTEE``" +msgstr "``ACS_LTEE``" + +#: ../../library/curses.rst:1678 msgid "left tee" msgstr "左向き T 字罫線" -#: ../../library/curses.rst:1728 +#: ../../library/curses.rst:1680 +msgid "``ACS_NEQUAL``" +msgstr "``ACS_NEQUAL``" + +#: ../../library/curses.rst:1680 msgid "not-equal sign" msgstr "不等号" -#: ../../library/curses.rst:1730 +#: ../../library/curses.rst:1682 +msgid "``ACS_PI``" +msgstr "``ACS_PI``" + +#: ../../library/curses.rst:1682 msgid "letter pi" msgstr "パイ記号" -#: ../../library/curses.rst:1732 +#: ../../library/curses.rst:1684 +msgid "``ACS_PLMINUS``" +msgstr "``ACS_PLMINUS``" + +#: ../../library/curses.rst:1684 msgid "plus-or-minus sign" msgstr "プラスマイナス記号" -#: ../../library/curses.rst:1734 +#: ../../library/curses.rst:1686 +msgid "``ACS_PLUS``" +msgstr "``ACS_PLUS``" + +#: ../../library/curses.rst:1686 msgid "big plus sign" msgstr "大プラス記号" -#: ../../library/curses.rst:1736 +#: ../../library/curses.rst:1688 +msgid "``ACS_RARROW``" +msgstr "``ACS_RARROW``" + +#: ../../library/curses.rst:1688 msgid "right arrow" msgstr "右向き矢印" -#: ../../library/curses.rst:1738 +#: ../../library/curses.rst:1690 +msgid "``ACS_RTEE``" +msgstr "``ACS_RTEE``" + +#: ../../library/curses.rst:1690 msgid "right tee" msgstr "右向き T 字罫線" -#: ../../library/curses.rst:1740 +#: ../../library/curses.rst:1692 +msgid "``ACS_S1``" +msgstr "``ACS_S1``" + +#: ../../library/curses.rst:1692 msgid "scan line 1" msgstr "スキャンライン 1" -#: ../../library/curses.rst:1742 +#: ../../library/curses.rst:1694 +msgid "``ACS_S3``" +msgstr "``ACS_S3``" + +#: ../../library/curses.rst:1694 msgid "scan line 3" msgstr "スキャンライン 3" -#: ../../library/curses.rst:1744 +#: ../../library/curses.rst:1696 +msgid "``ACS_S7``" +msgstr "``ACS_S7``" + +#: ../../library/curses.rst:1696 msgid "scan line 7" msgstr "スキャンライン 7" -#: ../../library/curses.rst:1746 +#: ../../library/curses.rst:1698 +msgid "``ACS_S9``" +msgstr "``ACS_S9``" + +#: ../../library/curses.rst:1698 msgid "scan line 9" msgstr "スキャンライン 9" -#: ../../library/curses.rst:1748 +#: ../../library/curses.rst:1700 +msgid "``ACS_SBBS``" +msgstr "``ACS_SBBS``" + +#: ../../library/curses.rst:1700 msgid "alternate name for lower right corner" msgstr "右下角の別名" -#: ../../library/curses.rst:1750 +#: ../../library/curses.rst:1702 +msgid "``ACS_SBSB``" +msgstr "``ACS_SBSB``" + +#: ../../library/curses.rst:1702 msgid "alternate name for vertical line" msgstr "垂直線の別名" -#: ../../library/curses.rst:1752 +#: ../../library/curses.rst:1704 +msgid "``ACS_SBSS``" +msgstr "``ACS_SBSS``" + +#: ../../library/curses.rst:1704 msgid "alternate name for right tee" msgstr "右向き T 字罫線の別名" -#: ../../library/curses.rst:1754 +#: ../../library/curses.rst:1706 +msgid "``ACS_SSBB``" +msgstr "``ACS_SSBB``" + +#: ../../library/curses.rst:1706 msgid "alternate name for lower left corner" msgstr "左下角の別名" -#: ../../library/curses.rst:1756 +#: ../../library/curses.rst:1708 +msgid "``ACS_SSBS``" +msgstr "``ACS_SSBS``" + +#: ../../library/curses.rst:1708 msgid "alternate name for bottom tee" msgstr "下向き T 字罫線の別名" -#: ../../library/curses.rst:1758 +#: ../../library/curses.rst:1710 +msgid "``ACS_SSSB``" +msgstr "``ACS_SSSB``" + +#: ../../library/curses.rst:1710 msgid "alternate name for left tee" msgstr "左向き T 字罫線の別名" -#: ../../library/curses.rst:1760 +#: ../../library/curses.rst:1712 +msgid "``ACS_SSSS``" +msgstr "``ACS_SSSS``" + +#: ../../library/curses.rst:1712 msgid "alternate name for crossover or big plus" msgstr "交差罫線または大プラス記号の別名" -#: ../../library/curses.rst:1762 +#: ../../library/curses.rst:1714 +msgid "``ACS_STERLING``" +msgstr "``ACS_STERLING``" + +#: ../../library/curses.rst:1714 msgid "pound sterling" msgstr "ポンドスターリング記号" -#: ../../library/curses.rst:1764 +#: ../../library/curses.rst:1716 +msgid "``ACS_TTEE``" +msgstr "``ACS_TTEE``" + +#: ../../library/curses.rst:1716 msgid "top tee" msgstr "上向き T 字罫線" -#: ../../library/curses.rst:1766 +#: ../../library/curses.rst:1718 +msgid "``ACS_UARROW``" +msgstr "``ACS_UARROW``" + +#: ../../library/curses.rst:1718 msgid "up arrow" msgstr "上向き矢印" -#: ../../library/curses.rst:1768 +#: ../../library/curses.rst:1720 +msgid "``ACS_ULCORNER``" +msgstr "``ACS_ULCORNER``" + +#: ../../library/curses.rst:1720 msgid "upper left corner" msgstr "左上角" -#: ../../library/curses.rst:1770 +#: ../../library/curses.rst:1722 +msgid "``ACS_URCORNER``" +msgstr "``ACS_URCORNER``" + +#: ../../library/curses.rst:1722 msgid "upper right corner" msgstr "右上角" -#: ../../library/curses.rst:1772 +#: ../../library/curses.rst:1724 +msgid "``ACS_VLINE``" +msgstr "``ACS_VLINE``" + +#: ../../library/curses.rst:1724 msgid "vertical line" msgstr "垂直線" -#: ../../library/curses.rst:1775 -msgid "" -"The following table lists mouse button constants used by :meth:`getmouse`:" -msgstr "" - -#: ../../library/curses.rst:1778 -msgid "Mouse button constant" -msgstr "" - -#: ../../library/curses.rst:1780 -msgid "Mouse button *n* pressed" -msgstr "" - -#: ../../library/curses.rst:1782 -msgid "Mouse button *n* released" -msgstr "" - -#: ../../library/curses.rst:1784 -msgid "Mouse button *n* clicked" -msgstr "" - -#: ../../library/curses.rst:1786 -msgid "Mouse button *n* double clicked" -msgstr "" - -#: ../../library/curses.rst:1788 -msgid "Mouse button *n* triple clicked" -msgstr "" - -#: ../../library/curses.rst:1790 -msgid "Shift was down during button state change" -msgstr "" - -#: ../../library/curses.rst:1792 ../../library/curses.rst:1794 -msgid "Control was down during button state change" -msgstr "" - -#: ../../library/curses.rst:1801 +#: ../../library/curses.rst:1727 msgid "The following table lists the predefined colors:" msgstr "以下のテーブルは定義済みの色を列挙したものです:" -#: ../../library/curses.rst:1804 +#: ../../library/curses.rst:1730 msgid "Color" msgstr "色" -#: ../../library/curses.rst:1806 +#: ../../library/curses.rst:1732 +msgid "``COLOR_BLACK``" +msgstr "``COLOR_BLACK``" + +#: ../../library/curses.rst:1732 msgid "Black" msgstr "黒" -#: ../../library/curses.rst:1808 +#: ../../library/curses.rst:1734 +msgid "``COLOR_BLUE``" +msgstr "``COLOR_BLUE``" + +#: ../../library/curses.rst:1734 msgid "Blue" msgstr "青" -#: ../../library/curses.rst:1810 +#: ../../library/curses.rst:1736 +msgid "``COLOR_CYAN``" +msgstr "``COLOR_CYAN``" + +#: ../../library/curses.rst:1736 msgid "Cyan (light greenish blue)" msgstr "シアン (薄く緑がかった青)" -#: ../../library/curses.rst:1812 +#: ../../library/curses.rst:1738 +msgid "``COLOR_GREEN``" +msgstr "``COLOR_GREEN``" + +#: ../../library/curses.rst:1738 msgid "Green" msgstr "緑" -#: ../../library/curses.rst:1814 +#: ../../library/curses.rst:1740 +msgid "``COLOR_MAGENTA``" +msgstr "``COLOR_MAGENTA``" + +#: ../../library/curses.rst:1740 msgid "Magenta (purplish red)" msgstr "マゼンタ (紫がかった赤)" -#: ../../library/curses.rst:1816 +#: ../../library/curses.rst:1742 +msgid "``COLOR_RED``" +msgstr "``COLOR_RED``" + +#: ../../library/curses.rst:1742 msgid "Red" msgstr "赤" -#: ../../library/curses.rst:1818 +#: ../../library/curses.rst:1744 +msgid "``COLOR_WHITE``" +msgstr "``COLOR_WHITE``" + +#: ../../library/curses.rst:1744 msgid "White" msgstr "白" -#: ../../library/curses.rst:1820 +#: ../../library/curses.rst:1746 +msgid "``COLOR_YELLOW``" +msgstr "``COLOR_YELLOW``" + +#: ../../library/curses.rst:1746 msgid "Yellow" msgstr "黄色" -#: ../../library/curses.rst:1825 +#: ../../library/curses.rst:1751 msgid ":mod:`curses.textpad` --- Text input widget for curses programs" msgstr "" ":mod:`curses.textpad` --- curses プログラムのためのテキスト入力ウィジェット" -#: ../../library/curses.rst:1833 +#: ../../library/curses.rst:1759 msgid "" "The :mod:`curses.textpad` module provides a :class:`Textbox` class that " "handles elementary text editing in a curses window, supporting a set of " @@ -2848,11 +3456,11 @@ msgstr "" "class:`Textbox` クラスを提供します。このモジュールではまた、テキストボックス" "を枠で囲むなどの目的のために有用な、矩形描画関数を提供しています。" -#: ../../library/curses.rst:1839 +#: ../../library/curses.rst:1765 msgid "The module :mod:`curses.textpad` defines the following function:" msgstr ":mod:`curses.textpad` モジュールでは以下の関数を定義しています:" -#: ../../library/curses.rst:1844 +#: ../../library/curses.rst:1770 msgid "" "Draw a rectangle. The first argument must be a window object; the remaining " "arguments are coordinates relative to that window. The second and third " @@ -2871,17 +3479,17 @@ msgstr "" "れを使って描画されます。そうでなければ ASCII 文字のダッシュ、垂直バー、および" "プラス記号で描画されます。" -#: ../../library/curses.rst:1857 +#: ../../library/curses.rst:1783 msgid "Textbox objects" msgstr "Textbox オブジェクト" -#: ../../library/curses.rst:1859 +#: ../../library/curses.rst:1785 msgid "You can instantiate a :class:`Textbox` object as follows:" msgstr "" "以下のような :class:`Textbox` オブジェクトをインスタンス生成することができま" "す:" -#: ../../library/curses.rst:1864 +#: ../../library/curses.rst:1790 msgid "" "Return a textbox widget object. The *win* argument should be a curses :ref:" "`window ` object in which the textbox is to be " @@ -2895,11 +3503,11 @@ msgstr "" "スが入っているウィンドウの左上角に配置され、その座標は ``(0, 0)`` です。イン" "スタンスの :attr:`stripspaces` フラグの初期値はオンに設定されます。" -#: ../../library/curses.rst:1870 +#: ../../library/curses.rst:1796 msgid ":class:`Textbox` objects have the following methods:" msgstr ":class:`Textbox` オブジェクトは以下のメソッドを持ちます:" -#: ../../library/curses.rst:1875 +#: ../../library/curses.rst:1801 msgid "" "This is the entry point you will normally use. It accepts editing " "keystrokes until one of the termination keystrokes is entered. If " @@ -2917,7 +3525,7 @@ msgstr "" "ウィンドウ内の空白が含められるかどうかは :attr:`stripspaces` 属性で決められま" "す。" -#: ../../library/curses.rst:1886 +#: ../../library/curses.rst:1812 msgid "" "Process a single command keystroke. Here are the supported special " "keystrokes:" @@ -2925,123 +3533,123 @@ msgstr "" "単一のコマンドキーストロークを処理します。以下にサポートされている特殊キース" "トロークを示します:" -#: ../../library/curses.rst:1890 ../../library/curses.rst:1928 +#: ../../library/curses.rst:1816 ../../library/curses.rst:1854 msgid "Keystroke" msgstr "キーストローク" -#: ../../library/curses.rst:1890 +#: ../../library/curses.rst:1816 msgid "Action" msgstr "動作" -#: ../../library/curses.rst:1892 +#: ../../library/curses.rst:1818 msgid ":kbd:`Control-A`" msgstr ":kbd:`Control-A`" -#: ../../library/curses.rst:1892 +#: ../../library/curses.rst:1818 msgid "Go to left edge of window." msgstr "ウィンドウの左端に移動します。" -#: ../../library/curses.rst:1894 ../../library/curses.rst:1930 +#: ../../library/curses.rst:1820 ../../library/curses.rst:1856 msgid ":kbd:`Control-B`" msgstr ":kbd:`Control-B`" -#: ../../library/curses.rst:1894 +#: ../../library/curses.rst:1820 msgid "Cursor left, wrapping to previous line if appropriate." msgstr "カーソルを左へ移動し、必要なら前の行に折り返します。" -#: ../../library/curses.rst:1897 +#: ../../library/curses.rst:1823 msgid ":kbd:`Control-D`" msgstr ":kbd:`Control-D`" -#: ../../library/curses.rst:1897 +#: ../../library/curses.rst:1823 msgid "Delete character under cursor." msgstr "カーソル下の文字を削除します。" -#: ../../library/curses.rst:1899 +#: ../../library/curses.rst:1825 msgid ":kbd:`Control-E`" msgstr ":kbd:`Control-E`" -#: ../../library/curses.rst:1899 +#: ../../library/curses.rst:1825 msgid "Go to right edge (stripspaces off) or end of line (stripspaces on)." msgstr "" "右端 (stripspaces がオフのとき) または行末 (stripspaces がオンのとき) に移動" "します。" -#: ../../library/curses.rst:1902 ../../library/curses.rst:1932 +#: ../../library/curses.rst:1828 ../../library/curses.rst:1858 msgid ":kbd:`Control-F`" msgstr ":kbd:`Control-F`" -#: ../../library/curses.rst:1902 +#: ../../library/curses.rst:1828 msgid "Cursor right, wrapping to next line when appropriate." msgstr "カーソルを右に移動し、必要なら次の行に折り返します。" -#: ../../library/curses.rst:1905 +#: ../../library/curses.rst:1831 msgid ":kbd:`Control-G`" msgstr ":kbd:`Control-G`" -#: ../../library/curses.rst:1905 +#: ../../library/curses.rst:1831 msgid "Terminate, returning the window contents." msgstr "ウィンドウを終了し、その内容を返します。" -#: ../../library/curses.rst:1907 +#: ../../library/curses.rst:1833 msgid ":kbd:`Control-H`" msgstr ":kbd:`Control-H`" -#: ../../library/curses.rst:1907 +#: ../../library/curses.rst:1833 msgid "Delete character backward." msgstr "逆方向に文字を削除します。" -#: ../../library/curses.rst:1909 +#: ../../library/curses.rst:1835 msgid ":kbd:`Control-J`" msgstr ":kbd:`Control-J`" -#: ../../library/curses.rst:1909 +#: ../../library/curses.rst:1835 msgid "Terminate if the window is 1 line, otherwise insert newline." msgstr "ウィンドウが 1 行であれば終了し、そうでなければ新しい行を挿入します。" -#: ../../library/curses.rst:1912 +#: ../../library/curses.rst:1838 msgid ":kbd:`Control-K`" msgstr ":kbd:`Control-K`" -#: ../../library/curses.rst:1912 +#: ../../library/curses.rst:1838 msgid "If line is blank, delete it, otherwise clear to end of line." msgstr "" "行が空白行ならその行全体を削除し、そうでなければカーソル以降行末までを消去し" "ます。" -#: ../../library/curses.rst:1915 +#: ../../library/curses.rst:1841 msgid ":kbd:`Control-L`" msgstr ":kbd:`Control-L`" -#: ../../library/curses.rst:1915 +#: ../../library/curses.rst:1841 msgid "Refresh screen." msgstr "スクリーンを更新します。" -#: ../../library/curses.rst:1917 ../../library/curses.rst:1936 +#: ../../library/curses.rst:1843 ../../library/curses.rst:1862 msgid ":kbd:`Control-N`" msgstr ":kbd:`Control-N`" -#: ../../library/curses.rst:1917 +#: ../../library/curses.rst:1843 msgid "Cursor down; move down one line." msgstr "カーソルを下に移動します; 1 行下に移動します。" -#: ../../library/curses.rst:1919 +#: ../../library/curses.rst:1845 msgid ":kbd:`Control-O`" msgstr ":kbd:`Control-O`" -#: ../../library/curses.rst:1919 +#: ../../library/curses.rst:1845 msgid "Insert a blank line at cursor location." msgstr "カーソルの場所に空行を 1 行挿入します。" -#: ../../library/curses.rst:1921 ../../library/curses.rst:1934 +#: ../../library/curses.rst:1847 ../../library/curses.rst:1860 msgid ":kbd:`Control-P`" msgstr ":kbd:`Control-P`" -#: ../../library/curses.rst:1921 +#: ../../library/curses.rst:1847 msgid "Cursor up; move up one line." msgstr "カーソルを上に移動します; 1 行上に移動します。" -#: ../../library/curses.rst:1924 +#: ../../library/curses.rst:1850 msgid "" "Move operations do nothing if the cursor is at an edge where the movement is " "not possible. The following synonyms are supported where possible:" @@ -3049,31 +3657,31 @@ msgstr "" "移動操作は、カーソルがウィンドウの縁にあって移動ができない場合には何も行いま" "せん。場合によっては、以下のような同義のキーストロークがサポートされています:" -#: ../../library/curses.rst:1930 -msgid ":const:`~curses.KEY_LEFT`" -msgstr "" +#: ../../library/curses.rst:1856 +msgid ":const:`KEY_LEFT`" +msgstr ":const:`KEY_LEFT`" -#: ../../library/curses.rst:1932 -msgid ":const:`~curses.KEY_RIGHT`" -msgstr "" +#: ../../library/curses.rst:1858 +msgid ":const:`KEY_RIGHT`" +msgstr ":const:`KEY_RIGHT`" -#: ../../library/curses.rst:1934 -msgid ":const:`~curses.KEY_UP`" -msgstr "" +#: ../../library/curses.rst:1860 +msgid ":const:`KEY_UP`" +msgstr ":const:`KEY_UP`" -#: ../../library/curses.rst:1936 -msgid ":const:`~curses.KEY_DOWN`" -msgstr "" +#: ../../library/curses.rst:1862 +msgid ":const:`KEY_DOWN`" +msgstr ":const:`KEY_DOWN`" -#: ../../library/curses.rst:1938 -msgid ":const:`~curses.KEY_BACKSPACE`" -msgstr "" +#: ../../library/curses.rst:1864 +msgid ":const:`KEY_BACKSPACE`" +msgstr ":const:`KEY_BACKSPACE`" -#: ../../library/curses.rst:1938 +#: ../../library/curses.rst:1864 msgid ":kbd:`Control-h`" msgstr ":kbd:`Control-h`" -#: ../../library/curses.rst:1941 +#: ../../library/curses.rst:1867 msgid "" "All other keystrokes are treated as a command to insert the given character " "and move right (with line wrapping)." @@ -3081,7 +3689,7 @@ msgstr "" "他のキーストロークは、与えられた文字を挿入し、(行折り返し付きで) 右に移動する" "コマンドとして扱われます。" -#: ../../library/curses.rst:1947 +#: ../../library/curses.rst:1873 msgid "" "Return the window contents as a string; whether blanks in the window are " "included is affected by the :attr:`stripspaces` member." @@ -3089,7 +3697,7 @@ msgstr "" "ウィンドウの内容を文字列として返します; ウィンドウ内の空白が含められるかどう" "かは :attr:`stripspaces` メンバ変数で決められます。" -#: ../../library/curses.rst:1953 +#: ../../library/curses.rst:1879 msgid "" "This attribute is a flag which controls the interpretation of blanks in the " "window. When it is on, trailing blanks on each line are ignored; any cursor " diff --git a/library/custominterp.po b/library/custominterp.po index 83edcf0c4..9438e4691 100644 --- a/library/custominterp.po +++ b/library/custominterp.po @@ -1,26 +1,26 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 -# 石井明久, 2024 +# Arihiro TAKASE, 2017 +# Osamu NAKAMURA, 2021 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-13 14:21+0000\n" -"PO-Revision-Date: 2021-06-28 01:03+0000\n" -"Last-Translator: 石井明久, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 23:05+0000\n" +"Last-Translator: Osamu NAKAMURA, 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/custominterp.rst:5 @@ -33,13 +33,13 @@ msgid "" "Python's interactive interpreter. If you want a Python interpreter that " "supports some special feature in addition to the Python language, you should " "look at the :mod:`code` module. (The :mod:`codeop` module is lower-level, " -"used to support compiling a possibly incomplete chunk of Python code.)" +"used to support compiling a possibly-incomplete chunk of Python code.)" msgstr "" -"この章で解説されるモジュールで Python の対話型インタープリターに似たインター" -"フェースを書くことができます。もし Python そのもの以外に何か特殊な機能をサ" -"ポートした Python インタープリターを作りたければ、 :mod:`code` モジュールを参" -"照してください。 (:mod:`codeop` モジュールはより低レベルで、不完全かもしれな" -"い Python コード断片のコンパイルをサポートするために使われます。)" +"この章で解説されるモジュールで Python の対話インタプリタに似たインターフェー" +"スを書くことができます。もし Python そのもの以外に何か特殊な機能をサポートし" +"た Python インタプリタを作りたければ、 :mod:`code` モジュールを参照してくださ" +"い。 (:mod:`codeop` モジュールはより低レベルで、不完全(かもしれない) Python " +"コード断片のコンパイルをサポートするために使われます。)" #: ../../library/custominterp.rst:13 msgid "The full list of modules described in this chapter is:" diff --git a/library/dataclasses.po b/library/dataclasses.po index c1cb6f63e..2fb168e63 100644 --- a/library/dataclasses.po +++ b/library/dataclasses.po @@ -1,34 +1,32 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: +# Osamu NAKAMURA, 2018 +# tomo, 2020 # Takanori Suzuki , 2021 -# tomo, 2021 -# 渋川よしき , 2021 -# Arihiro TAKASE, 2024 -# 石井明久, 2024 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-13 14:21+0000\n" -"PO-Revision-Date: 2021-06-28 01:03+0000\n" -"Last-Translator: 石井明久, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-05-11 06:18+0000\n" +"PO-Revision-Date: 2018-06-29 21:06+0000\n" +"Last-Translator: Takanori Suzuki , 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/dataclasses.rst:2 -msgid ":mod:`!dataclasses` --- Data Classes" -msgstr ":mod:`!dataclasses` --- データクラス" +msgid ":mod:`dataclasses` --- Data Classes" +msgstr ":mod:`dataclasses` --- データクラス" #: ../../library/dataclasses.rst:10 msgid "**Source code:** :source:`Lib/dataclasses.py`" @@ -37,14 +35,13 @@ msgstr "**ソースコード:** :source:`Lib/dataclasses.py`" #: ../../library/dataclasses.rst:14 msgid "" "This module provides a decorator and functions for automatically adding " -"generated :term:`special methods ` such as :meth:`~object." -"__init__` and :meth:`~object.__repr__` to user-defined classes. It was " -"originally described in :pep:`557`." +"generated :term:`special method`\\s such as :meth:`__init__` and :meth:" +"`__repr__` to user-defined classes. It was originally described in :pep:" +"`557`." msgstr "" -"このモジュールは、:meth:`~object.__init__` や :meth:`~object.__repr__` のよう" -"な :term:`特殊メソッド ` を生成し、ユーザー定義のクラスに自動" -"的に追加するデコレーターや関数を提供します。このモジュールは元々、 :pep:" -"`557` で説明されていました。" +"このモジュールは、:meth:`__init__` や :meth:`__repr__` のような :term:" +"`special method` を生成し、ユーザー定義のクラスに自動的に追加するデコレータや" +"関数を提供します。このモジュールは :pep:`557` に記載されました。" #: ../../library/dataclasses.rst:19 msgid "" @@ -54,66 +51,44 @@ msgstr "" "これらの生成されたメソッドで利用されるメンバー変数は :pep:`526` 型アノテー" "ションを用いて定義されます。例えば、このコードでは::" -#: ../../library/dataclasses.rst:22 -msgid "" -"from dataclasses import dataclass\n" -"\n" -"@dataclass\n" -"class InventoryItem:\n" -" \"\"\"Class for keeping track of an item in inventory.\"\"\"\n" -" name: str\n" -" unit_price: float\n" -" quantity_on_hand: int = 0\n" -"\n" -" def total_cost(self) -> float:\n" -" return self.unit_price * self.quantity_on_hand" -msgstr "" - #: ../../library/dataclasses.rst:34 -msgid "will add, among other things, a :meth:`!__init__` that looks like::" -msgstr "とりわけ、以下のような :meth:`!__init__` が追加されます::" - -#: ../../library/dataclasses.rst:36 -msgid "" -"def __init__(self, name: str, unit_price: float, quantity_on_hand: int = " -"0):\n" -" self.name = name\n" -" self.unit_price = unit_price\n" -" self.quantity_on_hand = quantity_on_hand" -msgstr "" +msgid "will add, among other things, a :meth:`__init__` that looks like::" +msgstr "とりわけ、以下のような :meth:`__init__` が追加されます::" #: ../../library/dataclasses.rst:41 msgid "" "Note that this method is automatically added to the class: it is not " -"directly specified in the :class:`!InventoryItem` definition shown above." +"directly specified in the ``InventoryItem`` definition shown above." msgstr "" -"このメソッドは自動的にクラスに追加される点に留意して下さい。上記の :class:`!" -"InventoryItem` クラスの定義中にこのメソッドが直接明記されるわけではありませ" -"ん。" +"このメソッドは自動的にクラスに追加される点に留意して下さい。上記の " +"``InventoryItem`` クラスの定義中にこのメソッドが直接明記されるわけではありま" +"せん。" #: ../../library/dataclasses.rst:47 -msgid "Module contents" -msgstr "モジュールの内容" +msgid "Module-level decorators, classes, and functions" +msgstr "モジュールレベルのデコレータ、クラス、関数" #: ../../library/dataclasses.rst:51 msgid "" "This function is a :term:`decorator` that is used to add generated :term:" -"`special methods ` to classes, as described below." +"`special method`\\s to classes, as described below." msgstr "" -"この関数は、後述する :term:`特殊メソッド ` を生成し、クラスに" -"追加する :term:`decorator` です。" +"この関数は、後述する :term:`special method` を生成し、クラスに追加する :term:" +"`decorator` です。" #: ../../library/dataclasses.rst:54 msgid "" -"The ``@dataclass`` decorator examines the class to find ``field``\\s. A " +"The :func:`dataclass` decorator examines the class to find ``field``\\s. A " "``field`` is defined as a class variable that has a :term:`type annotation " -"`. With two exceptions described below, nothing in " -"``@dataclass`` examines the type specified in the variable annotation." +"`. With two exceptions described below, nothing in :" +"func:`dataclass` examines the type specified in the variable annotation." msgstr "" -"``@dataclass`` デコレータは、``field`` を探すためにクラスを検査します。" -"``field`` は :term:`型アノテーション ` を持つクラス変数" -"として定義されます。後述する2つの例外を除き、 ``@dataclass`` は変数アノテー" -"ションで指定した型を検査しません。" +":func:`dataclass` デコレータは、``フィールド`` を探すためにクラスを検査しま" +"す。\n" +"``フィールド`` は :term:`型アノテーション ` を持つクラス" +"変数として定義されます。\n" +"後述する2つの例外を除き、 :func:`dataclass` は変数アノテーションで指定した型" +"を検査しません。" #: ../../library/dataclasses.rst:60 msgid "" @@ -125,13 +100,13 @@ msgstr "" #: ../../library/dataclasses.rst:63 msgid "" -"The ``@dataclass`` decorator will add various \"dunder\" methods to the " +"The :func:`dataclass` decorator will add various \"dunder\" methods to the " "class, described below. If any of the added methods already exist in the " "class, the behavior depends on the parameter, as documented below. The " "decorator returns the same class that it is called on; no new class is " "created." msgstr "" -"``@dataclass`` デコレータは、後述する様々な \"ダンダー\" メソッド (訳注:" +":func:`dataclass` デコレータは、後述する様々な \"ダンダー\" メソッド (訳注:" "dunderはdouble underscoreの略で、メソッド名の前後にアンダースコアが2つ付いて" "いるメソッド) をクラスに追加します。クラスに既にこれらのメソッドが存在する場" "合の動作は、後述する引数によって異なります。デコレータは呼び出した際に指定し" @@ -139,234 +114,215 @@ msgstr "" #: ../../library/dataclasses.rst:69 msgid "" -"If ``@dataclass`` is used just as a simple decorator with no parameters, it " -"acts as if it has the default values documented in this signature. That is, " -"these three uses of ``@dataclass`` are equivalent::" +"If :func:`dataclass` is used just as a simple decorator with no parameters, " +"it acts as if it has the default values documented in this signature. That " +"is, these three uses of :func:`dataclass` are equivalent::" msgstr "" +":func:`dataclass` が引数を指定しない単純なデコレータとして使用された場合、ド" +"キュメントに記載されているシグネチャのデフォルト値のとおりに動作します。つま" +"り、以下の3つの :func:`dataclass` の用例は同等です::" -#: ../../library/dataclasses.rst:74 -msgid "" -"@dataclass\n" -"class C:\n" -" ...\n" -"\n" -"@dataclass()\n" -"class C:\n" -" ...\n" -"\n" -"@dataclass(init=True, repr=True, eq=True, order=False, unsafe_hash=False, " -"frozen=False,\n" -" match_args=True, kw_only=False, slots=False, weakref_slot=False)\n" -"class C:\n" -" ..." -msgstr "" - -#: ../../library/dataclasses.rst:87 -msgid "The parameters to ``@dataclass`` are:" -msgstr "" +#: ../../library/dataclasses.rst:86 +msgid "The parameters to :func:`dataclass` are:" +msgstr ":func:`dataclass` の引数は以下の通りです::" -#: ../../library/dataclasses.rst:89 +#: ../../library/dataclasses.rst:88 msgid "" -"*init*: If true (the default), a :meth:`~object.__init__` method will be " -"generated." +"``init``: If true (the default), a :meth:`__init__` method will be generated." msgstr "" +"``init``: (デフォルトの)真の場合、 :meth:`__init__` メソッドが生成されます。" -#: ../../library/dataclasses.rst:92 +#: ../../library/dataclasses.rst:91 msgid "" -"If the class already defines :meth:`!__init__`, this parameter is ignored." +"If the class already defines :meth:`__init__`, this parameter is ignored." msgstr "" +"もしクラスに :meth:`__init__` が既に定義されていた場合は、この引数は無視され" +"ます。" -#: ../../library/dataclasses.rst:95 +#: ../../library/dataclasses.rst:94 msgid "" -"*repr*: If true (the default), a :meth:`~object.__repr__` method will be " +"``repr``: If true (the default), a :meth:`__repr__` method will be " "generated. The generated repr string will have the class name and the name " "and repr of each field, in the order they are defined in the class. Fields " "that are marked as being excluded from the repr are not included. For " "example: ``InventoryItem(name='widget', unit_price=3.0, " "quantity_on_hand=10)``." msgstr "" +"``repr``: (デフォルトの)真の場合、 :meth:`__repr__` メソッドが生成されま" +"す。\n" +"生成された repr 文字列には、クラス名、各フィールドの名前および repr 文字列" +"が、クラス上での定義された順序で並びます。\n" +"repr から除外するように印が付けられたフィールドは、 repr 文字列には含まれませ" +"ん。\n" +"例えば、このようになります: ``InventoryItem(name='widget', unit_price=3.0, " +"quantity_on_hand=10)`` 。" -#: ../../library/dataclasses.rst:102 +#: ../../library/dataclasses.rst:101 msgid "" -"If the class already defines :meth:`!__repr__`, this parameter is ignored." +"If the class already defines :meth:`__repr__`, this parameter is ignored." msgstr "" +"もしクラスに :meth:`__repr__` が既に定義されていた場合は、この引数は無視され" +"ます。" -#: ../../library/dataclasses.rst:105 +#: ../../library/dataclasses.rst:104 msgid "" -"*eq*: If true (the default), an :meth:`~object.__eq__` method will be " -"generated. This method compares the class as if it were a tuple of its " -"fields, in order. Both instances in the comparison must be of the identical " -"type." +"``eq``: If true (the default), an :meth:`__eq__` method will be generated. " +"This method compares the class as if it were a tuple of its fields, in " +"order. Both instances in the comparison must be of the identical type." msgstr "" +"``eq``: (デフォルトの)真の場合、 :meth:`__eq__` メソッドが生成されます。この" +"メソッドはクラスの比較を、そのクラスのフィールドからなるタプルを比較するよう" +"に行います。比較する2つのインスタンスのクラスは同一でなければなりません。" -#: ../../library/dataclasses.rst:110 -msgid "" -"If the class already defines :meth:`!__eq__`, this parameter is ignored." +#: ../../library/dataclasses.rst:109 +msgid "If the class already defines :meth:`__eq__`, this parameter is ignored." msgstr "" +"もしクラスに :meth:`__eq__` が既に定義されていた場合は、この引数は無視されま" +"す。" -#: ../../library/dataclasses.rst:113 +#: ../../library/dataclasses.rst:112 msgid "" -"*order*: If true (the default is ``False``), :meth:`~object.__lt__`, :meth:" -"`~object.__le__`, :meth:`~object.__gt__`, and :meth:`~object.__ge__` methods " -"will be generated. These compare the class as if it were a tuple of its " -"fields, in order. Both instances in the comparison must be of the identical " -"type. If *order* is true and *eq* is false, a :exc:`ValueError` is raised." +"``order``: If true (the default is ``False``), :meth:`__lt__`, :meth:" +"`__le__`, :meth:`__gt__`, and :meth:`__ge__` methods will be generated. " +"These compare the class as if it were a tuple of its fields, in order. Both " +"instances in the comparison must be of the identical type. If ``order`` is " +"true and ``eq`` is false, a :exc:`ValueError` is raised." msgstr "" +"``order``: 真 (デフォルト値は ``False``) の場合、 :meth:`__lt__`、:meth:" +"`__le__`、:meth:`__gt__`、:meth:`__ge__` メソッドが生成されます。これらの比較" +"は、クラスをそのフィールドからなるタプルであるかのように取り扱います。比較さ" +"れる2つのインスタンスは、同一の型でなければなりません。もし ``order`` が " +"true で、 ``eq`` に falseを指定すすると、:exc:`ValueError` が送出されます。" -#: ../../library/dataclasses.rst:120 +#: ../../library/dataclasses.rst:119 msgid "" -"If the class already defines any of :meth:`!__lt__`, :meth:`!__le__`, :meth:" -"`!__gt__`, or :meth:`!__ge__`, then :exc:`TypeError` is raised." +"If the class already defines any of :meth:`__lt__`, :meth:`__le__`, :meth:" +"`__gt__`, or :meth:`__ge__`, then :exc:`TypeError` is raised." msgstr "" +"もし、クラスで既に :meth:`__lt__`, :meth:`__le__`, :meth:`__gt__`, :meth:" +"`__ge__` のうちいずれかが定義されていると :exc:`TypeError` が送出されます。" -#: ../../library/dataclasses.rst:124 +#: ../../library/dataclasses.rst:123 msgid "" -"*unsafe_hash*: If true, force ``dataclasses`` to create a :meth:`~object." -"__hash__` method, even though it may not be safe to do so. Otherwise, " -"generate a :meth:`~object.__hash__` method according to how *eq* and " -"*frozen* are set. The default value is ``False``." +"``unsafe_hash``: If ``False`` (the default), a :meth:`__hash__` method is " +"generated according to how ``eq`` and ``frozen`` are set." msgstr "" +"``unsafe_hash``: (デフォルトの) ``False`` の場合、 ``eq`` と ``frozen`` がど" +"う設定されているかに従って :meth:`__hash__` メソッドが生成されます。" -#: ../../library/dataclasses.rst:130 +#: ../../library/dataclasses.rst:126 msgid "" -":meth:`!__hash__` is used by built-in :meth:`hash`, and when objects are " -"added to hashed collections such as dictionaries and sets. Having a :meth:`!" -"__hash__` implies that instances of the class are immutable. Mutability is a " -"complicated property that depends on the programmer's intent, the existence " -"and behavior of :meth:`!__eq__`, and the values of the *eq* and *frozen* " -"flags in the ``@dataclass`` decorator." +":meth:`__hash__` is used by built-in :meth:`hash()`, and when objects are " +"added to hashed collections such as dictionaries and sets. Having a :meth:" +"`__hash__` implies that instances of the class are immutable. Mutability is " +"a complicated property that depends on the programmer's intent, the " +"existence and behavior of :meth:`__eq__`, and the values of the ``eq`` and " +"``frozen`` flags in the :func:`dataclass` decorator." msgstr "" +":meth:`__hash__` は、組み込みの :meth:`hash()` から使われたり、 dict や set " +"のようなハッシュ化されたコレクションにオブジェクトを追加するときに使われま" +"す。\n" +":meth:`__hash__` があるということはそのクラスのインスタンスが不変 (イミュータ" +"ブル) であることを意味します。\n" +"可変性というのは複雑な性質で、プログラマの意図、 :meth:`__eq__` が存在してい" +"るかどうかとその振る舞い、 :func:`dataclass` デコレータの ``eq`` フラグと " +"``frozen`` フラグの値に依存します。" -#: ../../library/dataclasses.rst:137 +#: ../../library/dataclasses.rst:133 msgid "" -"By default, ``@dataclass`` will not implicitly add a :meth:`~object." -"__hash__` method unless it is safe to do so. Neither will it add or change " -"an existing explicitly defined :meth:`!__hash__` method. Setting the class " +"By default, :func:`dataclass` will not implicitly add a :meth:`__hash__` " +"method unless it is safe to do so. Neither will it add or change an " +"existing explicitly defined :meth:`__hash__` method. Setting the class " "attribute ``__hash__ = None`` has a specific meaning to Python, as described " -"in the :meth:`!__hash__` documentation." -msgstr "" - -#: ../../library/dataclasses.rst:143 -msgid "" -"If :meth:`!__hash__` is not explicitly defined, or if it is set to ``None``, " -"then ``@dataclass`` *may* add an implicit :meth:`!__hash__` method. Although " -"not recommended, you can force ``@dataclass`` to create a :meth:`!__hash__` " -"method with ``unsafe_hash=True``. This might be the case if your class is " -"logically immutable but can still be mutated. This is a specialized use case " -"and should be considered carefully." -msgstr "" - -#: ../../library/dataclasses.rst:150 -msgid "" -"Here are the rules governing implicit creation of a :meth:`!__hash__` " -"method. Note that you cannot both have an explicit :meth:`!__hash__` method " +"in the :meth:`__hash__` documentation." +msgstr "" +"デフォルトでは、 :func:`dataclass` は追加しても安全でない限り :meth:" +"`__hash__` メソッドを暗黙的には追加しません。\n" +"また、明示的に定義され存在している :meth:`__hash__` メソッドに追加したり変更" +"したりはしません。\n" +"クラスの属性の ``__hash__ = None`` という設定は、 Python にとって :meth:" +"`__hash__` のドキュメントにあるような特別な意味があります。" + +#: ../../library/dataclasses.rst:139 +msgid "" +"If :meth:`__hash__` is not explicitly defined, or if it is set to ``None``, " +"then :func:`dataclass` *may* add an implicit :meth:`__hash__` method. " +"Although not recommended, you can force :func:`dataclass` to create a :meth:" +"`__hash__` method with ``unsafe_hash=True``. This might be the case if your " +"class is logically immutable but can nonetheless be mutated. This is a " +"specialized use case and should be considered carefully." +msgstr "" +":meth:`__hash__` が明示的に定義されていなかったり、 ``None`` に設定されていた" +"場合は、 :func:`dataclass` は暗黙的に :meth:`__hash__` メソッドを追加する *か" +"もしれません* 。\n" +"推奨はできませんが、 ``unsafe_hash=True`` とすることで :func:`dataclass` に :" +"meth:`__hash__` メソッドを作成させられます。\n" +"こうしてしまうと、クラスが論理的には不変だがそれにもかかわらず変更できてしま" +"う場合、問題になり得ます。\n" +"こうするのは特別なユースケースで、慎重に検討するべきです。" + +#: ../../library/dataclasses.rst:146 +msgid "" +"Here are the rules governing implicit creation of a :meth:`__hash__` " +"method. Note that you cannot both have an explicit :meth:`__hash__` method " "in your dataclass and set ``unsafe_hash=True``; this will result in a :exc:" "`TypeError`." msgstr "" - -#: ../../library/dataclasses.rst:155 -msgid "" -"If *eq* and *frozen* are both true, by default ``@dataclass`` will generate " -"a :meth:`!__hash__` method for you. If *eq* is true and *frozen* is false, :" -"meth:`!__hash__` will be set to ``None``, marking it unhashable (which it " -"is, since it is mutable). If *eq* is false, :meth:`!__hash__` will be left " -"untouched meaning the :meth:`!__hash__` method of the superclass will be " -"used (if the superclass is :class:`object`, this means it will fall back to " -"id-based hashing)." -msgstr "" - -#: ../../library/dataclasses.rst:163 -msgid "" -"*frozen*: If true (the default is ``False``), assigning to fields will " +":meth:`__hash__` メソッドが暗黙的に作られるかどうかを決定する規則は次の通りで" +"す。\n" +"データクラスに明示的な :meth:`__hash__` メソッドを持たせた上で、 " +"``unsafe_hash=True`` と設定することはできません; こうすると :exc:`TypeError` " +"になります。" + +#: ../../library/dataclasses.rst:151 +msgid "" +"If ``eq`` and ``frozen`` are both true, by default :func:`dataclass` will " +"generate a :meth:`__hash__` method for you. If ``eq`` is true and " +"``frozen`` is false, :meth:`__hash__` will be set to ``None``, marking it " +"unhashable (which it is, since it is mutable). If ``eq`` is false, :meth:" +"`__hash__` will be left untouched meaning the :meth:`__hash__` method of the " +"superclass will be used (if the superclass is :class:`object`, this means it " +"will fall back to id-based hashing)." +msgstr "" +"``eq`` と ``frozen`` が両方とも真だった場合、デフォルトでは :func:" +"`dataclass` は :meth:`__hash__` メソッドを生成します。\n" +"``eq`` が真で ``frozen`` が偽の場合、:meth:`__hash__` は ``None`` に設定さ" +"れ、(可変なので) ハッシュ化不可能とされます。\n" +"``eq`` が偽の場合は、 :meth:`__hash__` は手を付けないまま、つまりスーパークラ" +"スの :meth:`__hash__` メソッドが使われることになります (スーパークラスが :" +"class:`object` だった場合は、 id に基づいたハッシュ化にフォールバックするとい" +"うことになります)。" + +#: ../../library/dataclasses.rst:159 +msgid "" +"``frozen``: If true (the default is ``False``), assigning to fields will " "generate an exception. This emulates read-only frozen instances. If :meth:" -"`~object.__setattr__` or :meth:`~object.__delattr__` is defined in the " -"class, then :exc:`TypeError` is raised. See the discussion below." -msgstr "" - -#: ../../library/dataclasses.rst:168 -msgid "" -"*match_args*: If true (the default is ``True``), the :attr:`~object." -"__match_args__` tuple will be created from the list of non keyword-only " -"parameters to the generated :meth:`~object.__init__` method (even if :meth:`!" -"__init__` is not generated, see above). If false, or if :attr:`!" -"__match_args__` is already defined in the class, then :attr:`!" -"__match_args__` will not be generated." -msgstr "" - -#: ../../library/dataclasses.rst:177 -msgid "" -"*kw_only*: If true (the default value is ``False``), then all fields will be " -"marked as keyword-only. If a field is marked as keyword-only, then the only " -"effect is that the :meth:`~object.__init__` parameter generated from a " -"keyword-only field must be specified with a keyword when :meth:`!__init__` " -"is called. See the :term:`parameter` glossary entry for details. Also see " -"the :const:`KW_ONLY` section." -msgstr "" - -#: ../../library/dataclasses.rst:185 -msgid "Keyword-only fields are not included in :attr:`!__match_args__`." -msgstr "" - -#: ../../library/dataclasses.rst:189 -msgid "" -"*slots*: If true (the default is ``False``), :attr:`~object.__slots__` " -"attribute will be generated and new class will be returned instead of the " -"original one. If :attr:`!__slots__` is already defined in the class, then :" -"exc:`TypeError` is raised." -msgstr "" - -#: ../../library/dataclasses.rst:195 -msgid "" -"Passing parameters to a base class :meth:`~object.__init_subclass__` when " -"using ``slots=True`` will result in a :exc:`TypeError`. Either use " -"``__init_subclass__`` with no parameters or use default values as a " -"workaround. See :gh:`91126` for full details." -msgstr "" - -#: ../../library/dataclasses.rst:203 -msgid "" -"If a field name is already included in the :attr:`!__slots__` of a base " -"class, it will not be included in the generated :attr:`!__slots__` to " -"prevent :ref:`overriding them `. Therefore, do not " -"use :attr:`!__slots__` to retrieve the field names of a dataclass. Use :func:" -"`fields` instead. To be able to determine inherited slots, base class :attr:" -"`!__slots__` may be any iterable, but *not* an iterator." -msgstr "" - -#: ../../library/dataclasses.rst:213 -msgid "" -"*weakref_slot*: If true (the default is ``False``), add a slot named " -"\"__weakref__\", which is required to make an instance :func:`weakref-able " -"`. It is an error to specify ``weakref_slot=True`` without also " -"specifying ``slots=True``." +"`__setattr__` or :meth:`__delattr__` is defined in the class, then :exc:" +"`TypeError` is raised. See the discussion below." msgstr "" +"``frozen``: 真 (デフォルト値は ``False``) の場合、フィールドへの代入は例外を" +"生成します。\n" +"これにより読み出し専用の凍結されたインスタンスを模倣します。\n" +":meth:`__setattr__` あるいは :meth:`__delattr__` がクラスに定義されていた場合" +"は、 :exc:`TypeError` が送出されます。\n" +"後にある議論を参照してください。" -#: ../../library/dataclasses.rst:221 +#: ../../library/dataclasses.rst:164 msgid "" "``field``\\s may optionally specify a default value, using normal Python " "syntax::" msgstr "" "``フィールド`` には、通常の Python の文法でデフォルト値を指定できます。" -#: ../../library/dataclasses.rst:224 -msgid "" -"@dataclass\n" -"class C:\n" -" a: int # 'a' has no default value\n" -" b: int = 0 # assign a default value for 'b'" -msgstr "" - -#: ../../library/dataclasses.rst:229 +#: ../../library/dataclasses.rst:172 msgid "" -"In this example, both :attr:`!a` and :attr:`!b` will be included in the " -"added :meth:`~object.__init__` method, which will be defined as::" +"In this example, both ``a`` and ``b`` will be included in the added :meth:" +"`__init__` method, which will be defined as::" msgstr "" +"この例では、生成された :meth:`__init__` メソッドには ``a`` と ``b`` の両方が" +"含まれ、以下のように定義されます::" -#: ../../library/dataclasses.rst:232 -msgid "def __init__(self, a: int, b: int = 0):" -msgstr "" - -#: ../../library/dataclasses.rst:234 +#: ../../library/dataclasses.rst:177 msgid "" ":exc:`TypeError` will be raised if a field without a default value follows a " "field with a default value. This is true whether this occurs in a single " @@ -376,77 +332,102 @@ msgstr "" "に定義すると、 :exc:`TypeError` が送出されます。これは、単一のクラスであって" "も、クラス継承の結果でも起きえます。" -#: ../../library/dataclasses.rst:240 +#: ../../library/dataclasses.rst:183 msgid "" "For common and simple use cases, no other functionality is required. There " "are, however, some dataclass features that require additional per-field " "information. To satisfy this need for additional information, you can " -"replace the default field value with a call to the provided :func:`!field` " +"replace the default field value with a call to the provided :func:`field` " "function. For example::" msgstr "" +"通常の単純なユースケースでは、この他の機能は必要ありません。\n" +"しかし、データクラスには、フィールドごとの情報を必要とする機能もあります。\n" +"追加の情報の必要性に応えるために、デフォルトのフィールドの値をモジュールから" +"提供されている :func:`field` 関数の呼び出しに置き換えられます。\n" +"例えば次のようになります::" -#: ../../library/dataclasses.rst:246 +#: ../../library/dataclasses.rst:196 msgid "" -"@dataclass\n" -"class C:\n" -" mylist: list[int] = field(default_factory=list)\n" -"\n" -"c = C()\n" -"c.mylist += [1, 2, 3]" +"As shown above, the ``MISSING`` value is a sentinel object used to detect if " +"the ``default`` and ``default_factory`` parameters are provided. This " +"sentinel is used because ``None`` is a valid value for ``default``. No code " +"should directly use the ``MISSING`` value." msgstr "" +"上にあるように、 ``MISSING`` 値は ``default`` パラメータと " +"``default_factory`` パラメータが提供されたかどうかを検出するのに使われる番兵" +"オブジェクトです。\n" +"この番兵が使われるのは、 ``None`` が ``default`` の有効な値だからです。\n" +"どんなコードでも ``MISSING`` 値を直接使うべきではありません。" -#: ../../library/dataclasses.rst:253 -msgid "" -"As shown above, the :const:`MISSING` value is a sentinel object used to " -"detect if some parameters are provided by the user. This sentinel is used " -"because ``None`` is a valid value for some parameters with a distinct " -"meaning. No code should directly use the :const:`MISSING` value." -msgstr "" - -#: ../../library/dataclasses.rst:258 -msgid "The parameters to :func:`!field` are:" -msgstr "" +#: ../../library/dataclasses.rst:202 +msgid "The parameters to :func:`field` are:" +msgstr ":func:`field` の引数は次の通りです:" -#: ../../library/dataclasses.rst:260 +#: ../../library/dataclasses.rst:204 msgid "" -"*default*: If provided, this will be the default value for this field. This " -"is needed because the :func:`!field` call itself replaces the normal " +"``default``: If provided, this will be the default value for this field. " +"This is needed because the :meth:`field` call itself replaces the normal " "position of the default value." msgstr "" +"``default``: 与えられた場合、このフィールドのデフォルト値になります。\n" +"これが必要なのは、 :meth:`field` の呼び出しそのものが通常ではデフォルト値がい" +"る位置を横取りしているからです。" -#: ../../library/dataclasses.rst:264 +#: ../../library/dataclasses.rst:208 msgid "" -"*default_factory*: If provided, it must be a zero-argument callable that " +"``default_factory``: If provided, it must be a zero-argument callable that " "will be called when a default value is needed for this field. Among other " "purposes, this can be used to specify fields with mutable default values, as " -"discussed below. It is an error to specify both *default* and " -"*default_factory*." +"discussed below. It is an error to specify both ``default`` and " +"``default_factory``." msgstr "" +"``default_factory``: 提供されていた場合、0 引数の呼び出し可能オブジェクトでな" +"ければならず、このフィールドの初期値が必要になったときに呼び出されます。\n" +"他の目的も含めて、下で議論されているように、フィールドに可変なデフォルト値を" +"指定するのに使えます。\n" +"``default`` と ``default_factory`` の両方を指定するとエラーになります。" -#: ../../library/dataclasses.rst:270 +#: ../../library/dataclasses.rst:214 msgid "" -"*init*: If true (the default), this field is included as a parameter to the " -"generated :meth:`~object.__init__` method." +"``init``: If true (the default), this field is included as a parameter to " +"the generated :meth:`__init__` method." msgstr "" +"``init``: (デフォルトの)真の場合、 生成される :meth:`__init__` メソッドの引数" +"にこのフィールドを含めます。" -#: ../../library/dataclasses.rst:273 +#: ../../library/dataclasses.rst:217 msgid "" -"*repr*: If true (the default), this field is included in the string returned " -"by the generated :meth:`~object.__repr__` method." +"``repr``: If true (the default), this field is included in the string " +"returned by the generated :meth:`__repr__` method." msgstr "" +"``repr``: (デフォルトの)真の場合、生成される :meth:`__repr__` メソッドによっ" +"て返される文字列に、このフィールドを含めます。" -#: ../../library/dataclasses.rst:276 +#: ../../library/dataclasses.rst:220 msgid "" -"*hash*: This can be a bool or ``None``. If true, this field is included in " -"the generated :meth:`~object.__hash__` method. If false, this field is " -"excluded from the generated :meth:`~object.__hash__`. If ``None`` (the " -"default), use the value of *compare*: this would normally be the expected " -"behavior, since a field should be included in the hash if it's used for " -"comparisons. Setting this value to anything other than ``None`` is " -"discouraged." +"``compare``: If true (the default), this field is included in the generated " +"equality and comparison methods (:meth:`__eq__`, :meth:`__gt__`, et al.)." msgstr "" +"``compare``: (デフォルトの) 真の場合、生成される等価関数と比較関数( :meth:" +"`__eq__` 、:meth:`__gt__` など)にこのフィールドを含めます。" -#: ../../library/dataclasses.rst:284 +#: ../../library/dataclasses.rst:224 +msgid "" +"``hash``: This can be a bool or ``None``. If true, this field is included " +"in the generated :meth:`__hash__` method. If ``None`` (the default), use " +"the value of ``compare``: this would normally be the expected behavior. A " +"field should be considered in the hash if it's used for comparisons. " +"Setting this value to anything other than ``None`` is discouraged." +msgstr "" +"``hash``: これは真偽値あるいは ``None`` に設定できます。\n" +"真の場合、このフィールドは、生成された :meth:`__hash__` メソッドに含まれま" +"す。\n" +"(デフォルトの) ``None`` の場合、 ``compare`` の値を使います: こうすることは普" +"通は期待通りの振る舞いになります。\n" +"比較で使われるフィールドはハッシュに含まれるものと考えるべきです。\n" +"この値を ``None`` 以外に設定することは推奨されません。" + +#: ../../library/dataclasses.rst:231 msgid "" "One possible reason to set ``hash=False`` but ``compare=True`` would be if a " "field is expensive to compute a hash value for, that field is needed for " @@ -459,89 +440,83 @@ msgstr "" "要かつ、その型のハッシュ値を計算するのに他のフィールドも使われることです。\n" "フィールドがハッシュから除外されていたとしても、比較には使えます。" -#: ../../library/dataclasses.rst:290 -msgid "" -"*compare*: If true (the default), this field is included in the generated " -"equality and comparison methods (:meth:`~object.__eq__`, :meth:`~object." -"__gt__`, et al.)." -msgstr "" - -#: ../../library/dataclasses.rst:294 +#: ../../library/dataclasses.rst:237 msgid "" -"*metadata*: This can be a mapping or ``None``. ``None`` is treated as an " -"empty dict. This value is wrapped in :func:`~types.MappingProxyType` to " -"make it read-only, and exposed on the :class:`Field` object. It is not used " -"at all by Data Classes, and is provided as a third-party extension " -"mechanism. Multiple third-parties can each have their own key, to use as a " -"namespace in the metadata." +"``metadata``: This can be a mapping or None. None is treated as an empty " +"dict. This value is wrapped in :func:`~types.MappingProxyType` to make it " +"read-only, and exposed on the :class:`Field` object. It is not used at all " +"by Data Classes, and is provided as a third-party extension mechanism. " +"Multiple third-parties can each have their own key, to use as a namespace in " +"the metadata." msgstr "" +"``metadata``: これはマッピングあるいは ``None`` に設定できます。\n" +"``None`` は空の辞書として扱われます。\n" +"この値は :func:`~types.MappingProxyType` でラップされ、読み出し専用になり、 :" +"class:`Field` オブジェクトに公開されます。\n" +"これはデータクラスから使われることはなく、サードパーティーの拡張機構として提" +"供されます。\n" +"複数のサードパーティーが各々のキーを持て、メタデータの名前空間として使えま" +"す。" -#: ../../library/dataclasses.rst:302 +#: ../../library/dataclasses.rst:245 msgid "" -"*kw_only*: If true, this field will be marked as keyword-only. This is used " -"when the generated :meth:`~object.__init__` method's parameters are computed." -msgstr "" - -#: ../../library/dataclasses.rst:306 -msgid "Keyword-only fields are also not included in :attr:`!__match_args__`." -msgstr "" - -#: ../../library/dataclasses.rst:310 -msgid "*doc*: optional docstring for this field." -msgstr "" - -#: ../../library/dataclasses.rst:314 -msgid "" -"If the default value of a field is specified by a call to :func:`!field`, " +"If the default value of a field is specified by a call to :func:`field()`, " "then the class attribute for this field will be replaced by the specified " -"*default* value. If *default* is not provided, then the class attribute " -"will be deleted. The intent is that after the :func:`@dataclass " -"` decorator runs, the class attributes will all contain the " -"default values for the fields, just as if the default value itself were " -"specified. For example, after::" +"``default`` value. If no ``default`` is provided, then the class attribute " +"will be deleted. The intent is that after the :func:`dataclass` decorator " +"runs, the class attributes will all contain the default values for the " +"fields, just as if the default value itself were specified. For example, " +"after::" msgstr "" +":func:`field()` の呼び出しでフィールドのデフォルト値が指定されている場合は、" +"このフィールドのクラス属性は、その指定された ``default`` 値で置き換えられま" +"す。\n" +"``default`` が提供されていない場合は、そのクラス属性は削除されます。\n" +"こうする意図は、 :func:`dataclass` デコレータが実行された後には、ちょうどデ" +"フォルト値そのものが指定されたかのように、クラス属性がデフォルト値を全て持っ" +"ているようにすることです。\n" +"例えば、次のような場合::" -#: ../../library/dataclasses.rst:323 -msgid "" -"@dataclass\n" -"class C:\n" -" x: int\n" -" y: int = field(repr=False)\n" -" z: int = field(repr=False, default=10)\n" -" t: int = 20" -msgstr "" - -#: ../../library/dataclasses.rst:330 +#: ../../library/dataclasses.rst:261 msgid "" -"The class attribute :attr:`!C.z` will be ``10``, the class attribute :attr:`!" -"C.t` will be ``20``, and the class attributes :attr:`!C.x` and :attr:`!C.y` " -"will not be set." +"The class attribute ``C.z`` will be ``10``, the class attribute ``C.t`` will " +"be ``20``, and the class attributes ``C.x`` and ``C.y`` will not be set." msgstr "" +"クラス属性 ``C.z`` は ``10`` 、クラス属性 ``C.t`` は ``20`` になり、クラス属" +"性 ``C.x`` と ``C.y`` には値が設定されません。" -#: ../../library/dataclasses.rst:336 +#: ../../library/dataclasses.rst:267 msgid "" -":class:`!Field` objects describe each defined field. These objects are " +":class:`Field` objects describe each defined field. These objects are " "created internally, and are returned by the :func:`fields` module-level " -"method (see below). Users should never instantiate a :class:`!Field` object " +"method (see below). Users should never instantiate a :class:`Field` object " "directly. Its documented attributes are:" msgstr "" +":class:`Field` オブジェクトはそれぞれの定義されたフィールドを記述します。\n" +"このオブジェクトは内部で作られ、モジュールレベル関数の :func:`fields` によっ" +"て返されます (下の解説を見てください)。\n" +"ユーザーは絶対に :class:`Field` オブジェクトを直接インスタンス化すべきではあ" +"りません。\n" +"ドキュメント化されている属性は次の通りです:" -#: ../../library/dataclasses.rst:341 -msgid ":attr:`!name`: The name of the field." -msgstr "" +#: ../../library/dataclasses.rst:272 +msgid "``name``: The name of the field." +msgstr "``name``: フィールド名" -#: ../../library/dataclasses.rst:342 -msgid ":attr:`!type`: The type of the field." -msgstr "" +#: ../../library/dataclasses.rst:274 +msgid "``type``: The type of the field." +msgstr "``type``: フィールドの型" -#: ../../library/dataclasses.rst:343 +#: ../../library/dataclasses.rst:276 msgid "" -":attr:`!default`, :attr:`!default_factory`, :attr:`!init`, :attr:`!repr`, :" -"attr:`!hash`, :attr:`!compare`, :attr:`!metadata`, and :attr:`!kw_only` have " -"the identical meaning and values as they do in the :func:`field` function." +"``default``, ``default_factory``, ``init``, ``repr``, ``hash``, ``compare``, " +"and ``metadata`` have the identical meaning and values as they do in the :" +"func:`field` declaration." msgstr "" +"``default``, ``default_factory``, ``init``, ``repr``, ``hash``, ``compare``, " +"``metadata`` は :func:`field` の宣言と同じ意味と値を持ちます。" -#: ../../library/dataclasses.rst:347 +#: ../../library/dataclasses.rst:280 msgid "" "Other attributes may exist, but they are private and must not be inspected " "or relied on." @@ -549,16 +524,7 @@ msgstr "" "他の属性があることもありますが、それらはプライベートであり、調べたり、依存し" "たりしてはなりません。" -#: ../../library/dataclasses.rst:352 -msgid "" -"``InitVar[T]`` type annotations describe variables that are :ref:`init-only " -"`. Fields annotated with :class:`!InitVar` " -"are considered pseudo-fields, and thus are neither returned by the :func:" -"`fields` function nor used in any way except adding them as parameters to :" -"meth:`~object.__init__` and an optional :meth:`__post_init__`." -msgstr "" - -#: ../../library/dataclasses.rst:361 +#: ../../library/dataclasses.rst:285 msgid "" "Returns a tuple of :class:`Field` objects that define the fields for this " "dataclass. Accepts either a dataclass, or an instance of a dataclass. " @@ -572,192 +538,152 @@ msgstr "" "`TypeError` を送出します。\n" "``ClassVar`` や ``InitVar`` といった疑似フィールドは返しません。" -#: ../../library/dataclasses.rst:368 +#: ../../library/dataclasses.rst:292 msgid "" -"Converts the dataclass *obj* to a dict (by using the factory function " -"*dict_factory*). Each dataclass is converted to a dict of its fields, as " +"Converts the dataclass ``instance`` to a dict (by using the factory function " +"``dict_factory``). Each dataclass is converted to a dict of its fields, as " "``name: value`` pairs. dataclasses, dicts, lists, and tuples are recursed " -"into. Other objects are copied with :func:`copy.deepcopy`." +"into. For example::" msgstr "" +"データクラスの ``instance`` を (ファクトリ関数 ``dict_factory`` を使い) 辞書" +"に変換します。\n" +"それぞれのデータクラスは、 ``name: value`` という組になっている、フィールドの" +"辞書に変換されます。\n" +"データクラス、辞書、リスト、タプルは再帰的に処理されます。\n" +"例えば、次のようになります::" -#: ../../library/dataclasses.rst:374 -msgid "Example of using :func:`!asdict` on nested dataclasses::" +#: ../../library/dataclasses.rst:312 ../../library/dataclasses.rst:326 +msgid "Raises :exc:`TypeError` if ``instance`` is not a dataclass instance." msgstr "" +"``instance`` がデータクラスのインスタンスでなかった場合、 :exc:`TypeError` を" +"送出します。" -#: ../../library/dataclasses.rst:376 +#: ../../library/dataclasses.rst:316 msgid "" -"@dataclass\n" -"class Point:\n" -" x: int\n" -" y: int\n" -"\n" -"@dataclass\n" -"class C:\n" -" mylist: list[Point]\n" -"\n" -"p = Point(10, 20)\n" -"assert asdict(p) == {'x': 10, 'y': 20}\n" -"\n" -"c = C([Point(0, 0), Point(10, 4)])\n" -"assert asdict(c) == {'mylist': [{'x': 0, 'y': 0}, {'x': 10, 'y': 4}]}" -msgstr "" - -#: ../../library/dataclasses.rst:391 ../../library/dataclasses.rst:411 -msgid "To create a shallow copy, the following workaround may be used::" +"Converts the dataclass ``instance`` to a tuple (by using the factory " +"function ``tuple_factory``). Each dataclass is converted to a tuple of its " +"field values. dataclasses, dicts, lists, and tuples are recursed into." msgstr "" +"データクラスの ``instance`` を (ファクトリ関数 ``tuple_factory`` を使い) タプ" +"ルに変換します。\n" +"それぞれのデータクラスは、フィールドの値のタプルに変換されます。\n" +"データクラス、辞書、リスト、タプルは再帰的に処理されます。" -#: ../../library/dataclasses.rst:393 -msgid "{field.name: getattr(obj, field.name) for field in fields(obj)}" -msgstr "" - -#: ../../library/dataclasses.rst:395 -msgid "" -":func:`!asdict` raises :exc:`TypeError` if *obj* is not a dataclass instance." -msgstr "" - -#: ../../library/dataclasses.rst:400 -msgid "" -"Converts the dataclass *obj* to a tuple (by using the factory function " -"*tuple_factory*). Each dataclass is converted to a tuple of its field " -"values. dataclasses, dicts, lists, and tuples are recursed into. Other " -"objects are copied with :func:`copy.deepcopy`." -msgstr "" - -#: ../../library/dataclasses.rst:406 +#: ../../library/dataclasses.rst:321 msgid "Continuing from the previous example::" msgstr "1つ前の例の続きです::" -#: ../../library/dataclasses.rst:408 -msgid "" -"assert astuple(p) == (10, 20)\n" -"assert astuple(c) == ([(0, 0), (10, 4)],)" -msgstr "" - -#: ../../library/dataclasses.rst:413 -msgid "tuple(getattr(obj, field.name) for field in dataclasses.fields(obj))" -msgstr "" - -#: ../../library/dataclasses.rst:415 -msgid "" -":func:`!astuple` raises :exc:`TypeError` if *obj* is not a dataclass " -"instance." -msgstr "" - -#: ../../library/dataclasses.rst:420 -msgid "" -"Creates a new dataclass with name *cls_name*, fields as defined in *fields*, " -"base classes as given in *bases*, and initialized with a namespace as given " -"in *namespace*. *fields* is an iterable whose elements are each either " -"``name``, ``(name, type)``, or ``(name, type, Field)``. If just ``name`` is " -"supplied, :data:`typing.Any` is used for ``type``. The values of *init*, " -"*repr*, *eq*, *order*, *unsafe_hash*, *frozen*, *match_args*, *kw_only*, " -"*slots*, and *weakref_slot* have the same meaning as they do in :func:" -"`@dataclass `." -msgstr "" - -#: ../../library/dataclasses.rst:430 -msgid "" -"If *module* is defined, the :attr:`!__module__` attribute of the dataclass " -"is set to that value. By default, it is set to the module name of the caller." -msgstr "" - -#: ../../library/dataclasses.rst:434 +#: ../../library/dataclasses.rst:330 msgid "" -"The *decorator* parameter is a callable that will be used to create the " -"dataclass. It should take the class object as a first argument and the same " -"keyword arguments as :func:`@dataclass `. By default, the :func:" -"`@dataclass ` function is used." -msgstr "" - -#: ../../library/dataclasses.rst:439 +"Creates a new dataclass with name ``cls_name``, fields as defined in " +"``fields``, base classes as given in ``bases``, and initialized with a " +"namespace as given in ``namespace``. ``fields`` is an iterable whose " +"elements are each either ``name``, ``(name, type)``, or ``(name, type, " +"Field)``. If just ``name`` is supplied, ``typing.Any`` is used for " +"``type``. The values of ``init``, ``repr``, ``eq``, ``order``, " +"``unsafe_hash``, and ``frozen`` have the same meaning as they do in :func:" +"`dataclass`." +msgstr "" +"``cls_name`` という名前、 ``fields`` で定義されるフィールド、 ``bases`` で与" +"えられた基底クラス、 ``namespace`` で与えられた名前空間付きで初期化されたデー" +"タクラスを作成します。\n" +"``fields`` はイテラブルで、要素が ``name``, ``(name, type)``, ``(name, type, " +"Field)`` のうちのどれかです。\n" +"単に ``name`` だけが与えられた場合は、 ``typing.Any`` が ``type`` として使わ" +"れます。\n" +"``init``, ``repr``, ``eq``, ``order``, ``unsafe_hash``, ``frozen`` の値は、 :" +"func:`dataclass` のときと同じ意味を持ちます。" + +#: ../../library/dataclasses.rst:339 msgid "" "This function is not strictly required, because any Python mechanism for " -"creating a new class with :attr:`!__annotations__` can then apply the :func:" -"`@dataclass ` function to convert that class to a dataclass. " -"This function is provided as a convenience. For example::" -msgstr "" - -#: ../../library/dataclasses.rst:445 -msgid "" -"C = make_dataclass('C',\n" -" [('x', int),\n" -" 'y',\n" -" ('z', int, field(default=5))],\n" -" namespace={'add_one': lambda self: self.x + 1})" +"creating a new class with ``__annotations__`` can then apply the :func:" +"`dataclass` function to convert that class to a dataclass. This function is " +"provided as a convenience. For example::" msgstr "" +"厳密にはこの関数は必須ではありません。というのは、 ``__annotations__`` 付きの" +"クラスを新しく作成するどの Python の機構でも、 :func:`dataclass` 関数を適用し" +"てそのクラスをデータクラスに変換できるからです。\n" +"この関数は便利さのために提供されています。\n" +"例えば次のように使います::" -#: ../../library/dataclasses.rst:451 +#: ../../library/dataclasses.rst:351 msgid "Is equivalent to::" msgstr "は、次のコードと等しいです::" -#: ../../library/dataclasses.rst:453 -msgid "" -"@dataclass\n" -"class C:\n" -" x: int\n" -" y: 'typing.Any'\n" -" z: int = 5\n" -"\n" -" def add_one(self):\n" -" return self.x + 1" -msgstr "" - -#: ../../library/dataclasses.rst:462 -msgid "Added the *decorator* parameter." -msgstr "" - -#: ../../library/dataclasses.rst:467 +#: ../../library/dataclasses.rst:364 msgid "" -"Creates a new object of the same type as *obj*, replacing fields with values " -"from *changes*. If *obj* is not a Data Class, raises :exc:`TypeError`. If " -"keys in *changes* are not field names of the given dataclass, raises :exc:" +"Creates a new object of the same type as ``instance``, replacing fields with " +"values from ``changes``. If ``instance`` is not a Data Class, raises :exc:" +"`TypeError`. If values in ``changes`` do not specify fields, raises :exc:" "`TypeError`." msgstr "" +"``instance`` と同じ型のオブジェクトを新しく作成し、フィールドを ``changes`` " +"にある値で置き換えます。\n" +"``instance`` がデータクラスではなかった場合、 :exc:`TypeError` を送出しま" +"す。\n" +"``changes`` にある値がフィールドを指定していなかった場合も、 :exc:" +"`TypeError` を送出します。" -#: ../../library/dataclasses.rst:472 +#: ../../library/dataclasses.rst:369 msgid "" -"The newly returned object is created by calling the :meth:`~object.__init__` " -"method of the dataclass. This ensures that :meth:`__post_init__`, if " -"present, is also called." +"The newly returned object is created by calling the :meth:`__init__` method " +"of the dataclass. This ensures that :meth:`__post_init__`, if present, is " +"also called." msgstr "" +"新しく返されるオブジェクトは、データクラスの :meth:`__init__` メソッドを呼び" +"出して作成されます。\n" +"これにより、もしあれば :meth:`__post_init__` も呼び出されることが保証されま" +"す。" -#: ../../library/dataclasses.rst:476 +#: ../../library/dataclasses.rst:373 msgid "" "Init-only variables without default values, if any exist, must be specified " -"on the call to :func:`!replace` so that they can be passed to :meth:`!" -"__init__` and :meth:`__post_init__`." +"on the call to :func:`replace` so that they can be passed to :meth:" +"`__init__` and :meth:`__post_init__`." msgstr "" +"初期化限定変数でデフォルト値を持たないものがもしあれば、 :func:`replace` の呼" +"び出し時に初期値が指定され、 :meth:`__init__` と :meth:`__post_init__` に渡せ" +"るようにしなければなりません。" -#: ../../library/dataclasses.rst:480 +#: ../../library/dataclasses.rst:377 msgid "" -"It is an error for *changes* to contain any fields that are defined as " +"It is an error for ``changes`` to contain any fields that are defined as " "having ``init=False``. A :exc:`ValueError` will be raised in this case." msgstr "" +"``changes`` に、 ``init=False`` と定義されたフィールドが含まれているとエラー" +"になります。\n" +"この場合 :exc:`ValueError` が送出されます。" -#: ../../library/dataclasses.rst:484 +#: ../../library/dataclasses.rst:381 msgid "" -"Be forewarned about how ``init=False`` fields work during a call to :func:`!" -"replace`. They are not copied from the source object, but rather are " +"Be forewarned about how ``init=False`` fields work during a call to :func:" +"`replace`. They are not copied from the source object, but rather are " "initialized in :meth:`__post_init__`, if they're initialized at all. It is " "expected that ``init=False`` fields will be rarely and judiciously used. If " "they are used, it might be wise to have alternate class constructors, or " -"perhaps a custom :func:`!replace` (or similarly named) method which handles " +"perhaps a custom ``replace()`` (or similarly named) method which handles " "instance copying." msgstr "" +":func:`replace` を呼び出しているときに ``init=False`` であるフィールドがどの" +"ように働くかに気を付けてください。\n" +"そのフィールドは元のオブジェクトからコピーされるのではなく、仮に初期化された" +"としても結局は :meth:`__post_init__` で初期化されます。\n" +"``init=False`` であるフィールドは滅多に使いませんし、使うとしたら注意深く使用" +"します。\n" +"そのようなフィールドが使われている場合は、代わりのクラスコンストラクタ、ある" +"いは、インスタンスのコピー処理をする独自実装の ``replace()`` (もしくは似た名" +"前の) メソッドを持たせるのが賢明でしょう。" -#: ../../library/dataclasses.rst:493 -msgid "" -"Dataclass instances are also supported by generic function :func:`copy." -"replace`." -msgstr "" - -#: ../../library/dataclasses.rst:497 +#: ../../library/dataclasses.rst:392 msgid "" -"Return ``True`` if its parameter is a dataclass (including subclasses of a " -"dataclass) or an instance of one, otherwise return ``False``." +"Return ``True`` if its parameter is a dataclass or an instance of one, " +"otherwise return ``False``." msgstr "" +"引数がデータクラスかデータクラスのインスタンスだった場合に ``True`` を返しま" +"す。それ以外の場合は ``False`` を返します。" -#: ../../library/dataclasses.rst:500 +#: ../../library/dataclasses.rst:395 msgid "" "If you need to know if a class is an instance of a dataclass (and not a " "dataclass itself), then add a further check for ``not isinstance(obj, " @@ -767,77 +693,28 @@ msgstr "" "い) かどうかを知る必要がある場合は、 ``not isinstance(obj, type)`` で追加の" "チェックをしてください::" -#: ../../library/dataclasses.rst:504 -msgid "" -"def is_dataclass_instance(obj):\n" -" return is_dataclass(obj) and not isinstance(obj, type)" -msgstr "" - -#: ../../library/dataclasses.rst:509 -msgid "A sentinel value signifying a missing default or default_factory." -msgstr "" -"デフォルト値やdefault_factoryが設定されてない場合の番兵の値を設定します。" - -#: ../../library/dataclasses.rst:513 -msgid "" -"A sentinel value used as a type annotation. Any fields after a pseudo-field " -"with the type of :const:`!KW_ONLY` are marked as keyword-only fields. Note " -"that a pseudo-field of type :const:`!KW_ONLY` is otherwise completely " -"ignored. This includes the name of such a field. By convention, a name of " -"``_`` is used for a :const:`!KW_ONLY` field. Keyword-only fields signify :" -"meth:`~object.__init__` parameters that must be specified as keywords when " -"the class is instantiated." -msgstr "" - -#: ../../library/dataclasses.rst:522 -msgid "" -"In this example, the fields ``y`` and ``z`` will be marked as keyword-only " -"fields::" -msgstr "このサンプルでは ``y`` と ``z`` がキーワード専用フィールドとなります::" - -#: ../../library/dataclasses.rst:524 -msgid "" -"@dataclass\n" -"class Point:\n" -" x: float\n" -" _: KW_ONLY\n" -" y: float\n" -" z: float\n" -"\n" -"p = Point(0, y=1.5, z=2.0)" -msgstr "" - -#: ../../library/dataclasses.rst:533 -msgid "" -"In a single dataclass, it is an error to specify more than one field whose " -"type is :const:`!KW_ONLY`." -msgstr "" - -#: ../../library/dataclasses.rst:540 -msgid "" -"Raised when an implicitly defined :meth:`~object.__setattr__` or :meth:" -"`~object.__delattr__` is called on a dataclass which was defined with " -"``frozen=True``. It is a subclass of :exc:`AttributeError`." -msgstr "" -"``frozen=True`` 付きで定義されたデータクラスで、暗黙的に定義された :meth:" -"`~object.__setattr__` または :meth:`~object.__delattr__` が呼び出されたときに" -"送出されます。これは :exc:`AttributeError` のサブクラスです。" - -#: ../../library/dataclasses.rst:547 +#: ../../library/dataclasses.rst:403 msgid "Post-init processing" msgstr "初期化後の処理" -#: ../../library/dataclasses.rst:551 +#: ../../library/dataclasses.rst:405 msgid "" -"When defined on the class, it will be called by the generated :meth:`~object." -"__init__`, normally as :meth:`!self.__post_init__`. However, if any " -"``InitVar`` fields are defined, they will also be passed to :meth:`!" -"__post_init__` in the order they were defined in the class. If no :meth:`!" -"__init__` method is generated, then :meth:`!__post_init__` will not " -"automatically be called." +"The generated :meth:`__init__` code will call a method named :meth:" +"`__post_init__`, if :meth:`__post_init__` is defined on the class. It will " +"normally be called as ``self.__post_init__()``. However, if any ``InitVar`` " +"fields are defined, they will also be passed to :meth:`__post_init__` in the " +"order they were defined in the class. If no :meth:`__init__` method is " +"generated, then :meth:`__post_init__` will not automatically be called." msgstr "" +"生成された :meth:`__init__` のコードは、 :meth:`__post_init__` という名前のメ" +"ソッドがクラスに定義されていたら、それを呼び出します。\n" +"通常は ``self.__post_init__()`` のように呼び出されます。\n" +"しかし ``InitVar`` フィールドが定義されていた場合、それらもクラスに定義された" +"順序で :meth:`__post_init__` に渡されます。\n" +":meth:`__init__` メソッドが生成されなかった場合は、 :meth:`__post_init__` は" +"自動的には呼び出されません。" -#: ../../library/dataclasses.rst:558 +#: ../../library/dataclasses.rst:413 msgid "" "Among other uses, this allows for initializing field values that depend on " "one or more other fields. For example::" @@ -846,92 +723,88 @@ msgstr "" "ドが初期化できます。\n" "例えば次のようにできます::" -#: ../../library/dataclasses.rst:561 -msgid "" -"@dataclass\n" -"class C:\n" -" a: float\n" -" b: float\n" -" c: float = field(init=False)\n" -"\n" -" def __post_init__(self):\n" -" self.c = self.a + self.b" -msgstr "" - -#: ../../library/dataclasses.rst:570 -msgid "" -"The :meth:`~object.__init__` method generated by :func:`@dataclass " -"` does not call base class :meth:`!__init__` methods. If the base " -"class has an :meth:`!__init__` method that has to be called, it is common to " -"call this method in a :meth:`__post_init__` method::" -msgstr "" - -#: ../../library/dataclasses.rst:575 +#: ../../library/dataclasses.rst:425 msgid "" -"class Rectangle:\n" -" def __init__(self, height, width):\n" -" self.height = height\n" -" self.width = width\n" -"\n" -"@dataclass\n" -"class Square(Rectangle):\n" -" side: float\n" -"\n" -" def __post_init__(self):\n" -" super().__init__(self.side, self.side)" +"The :meth:`__init__` method generated by :func:`dataclass` does not call " +"base class :meth:`__init__` methods. If the base class has an :meth:" +"`__init__` method that has to be called, it is common to call this method in " +"a :meth:`__post_init__` method::" msgstr "" +":func:`dataclass` によって生成された :meth:`__init__` メソッドは、ベースクラ" +"スの :meth:`__init__` メソッドを呼びません。もし、ベースクラスが :meth: " +"`__init__` メソッドを持ち、それを呼ぶ必要があれば、 :meth:`__post_init__` メ" +"ソッドの中から呼び出します::" -#: ../../library/dataclasses.rst:587 +#: ../../library/dataclasses.rst:442 msgid "" -"Note, however, that in general the dataclass-generated :meth:`!__init__` " +"Note, however, that in general the dataclass-generated :meth:`__init__` " "methods don't need to be called, since the derived dataclass will take care " "of initializing all fields of any base class that is a dataclass itself." msgstr "" +"派生データクラスが、データクラス自体である基本クラスのすべてのフィールドの初" +"期化を処理するため、データクラスで生成された :meth:`__init__` メソッドを呼び" +"出す必要はありません。" -#: ../../library/dataclasses.rst:591 +#: ../../library/dataclasses.rst:446 msgid "" "See the section below on init-only variables for ways to pass parameters to :" -"meth:`!__post_init__`. Also see the warning about how :func:`replace` " +"meth:`__post_init__`. Also see the warning about how :func:`replace` " "handles ``init=False`` fields." msgstr "" -"下にある初期化限定変数についての節で、 :meth:`!__post_init__` にパラメータを" -"渡す方法を参照してください。\n" +"下にある初期化限定変数についての節で、 :meth:`__post_init__` にパラメータを渡" +"す方法を参照してください。\n" ":func:`replace` が ``init=False`` であるフィールドをどう取り扱うかについての" "警告も参照してください。" -#: ../../library/dataclasses.rst:598 +#: ../../library/dataclasses.rst:451 msgid "Class variables" msgstr "クラス変数" -#: ../../library/dataclasses.rst:600 +#: ../../library/dataclasses.rst:453 msgid "" -"One of the few places where :func:`@dataclass ` actually inspects " -"the type of a field is to determine if a field is a class variable as " -"defined in :pep:`526`. It does this by checking if the type of the field " -"is :data:`typing.ClassVar`. If a field is a ``ClassVar``, it is excluded " -"from consideration as a field and is ignored by the dataclass mechanisms. " -"Such ``ClassVar`` pseudo-fields are not returned by the module-level :func:" -"`fields` function." -msgstr "" +"One of two places where :func:`dataclass` actually inspects the type of a " +"field is to determine if a field is a class variable as defined in :pep:" +"`526`. It does this by checking if the type of the field is ``typing." +"ClassVar``. If a field is a ``ClassVar``, it is excluded from consideration " +"as a field and is ignored by the dataclass mechanisms. Such ``ClassVar`` " +"pseudo-fields are not returned by the module-level :func:`fields` function." +msgstr "" +":func:`dataclass` が実際にフィールドの型の検査を行う 2 箇所のうち 1 つは、" +"フィールドが :pep:`526` で定義されたクラス変数かどうかの判定です。\n" +"その判定はフィールドの型が ``typing.ClassVar`` かどうかで行います。\n" +"フィールドが ``ClassVar`` の場合、フィールドとは見なされなくなり、データクラ" +"スの機構からは無視されます。\n" +"そのような ``ClassVar`` 疑似フィールドは、モジュールレベル関数 :func:" +"`fields` の返り値には含まれません。" -#: ../../library/dataclasses.rst:611 +#: ../../library/dataclasses.rst:462 msgid "Init-only variables" msgstr "初期化限定変数" -#: ../../library/dataclasses.rst:613 -msgid "" -"Another place where :func:`@dataclass ` inspects a type " -"annotation is to determine if a field is an init-only variable. It does " -"this by seeing if the type of a field is of type :class:`InitVar`. If a " -"field is an :class:`InitVar`, it is considered a pseudo-field called an init-" -"only field. As it is not a true field, it is not returned by the module-" -"level :func:`fields` function. Init-only fields are added as parameters to " -"the generated :meth:`~object.__init__` method, and are passed to the " -"optional :meth:`__post_init__` method. They are not otherwise used by " -"dataclasses." -msgstr "" - -#: ../../library/dataclasses.rst:623 +#: ../../library/dataclasses.rst:464 +msgid "" +"The other place where :func:`dataclass` inspects a type annotation is to " +"determine if a field is an init-only variable. It does this by seeing if " +"the type of a field is of type ``dataclasses.InitVar``. If a field is an " +"``InitVar``, it is considered a pseudo-field called an init-only field. As " +"it is not a true field, it is not returned by the module-level :func:" +"`fields` function. Init-only fields are added as parameters to the " +"generated :meth:`__init__` method, and are passed to the optional :meth:" +"`__post_init__` method. They are not otherwise used by dataclasses." +msgstr "" +":func:`dataclass` が型アノテーションの検査を行うもう 1 つの箇所は、フィールド" +"が初期化限定変数かどうかの判定です。\n" +"その判定はフィールドの型が ``dataclasses.InitVar`` 型であるかどうかで行いま" +"す。\n" +"フィールドが ``InitVar`` の場合、初期化限定フィールドと呼ばれる疑似フィールド" +"と見なされます。\n" +"これは本物のフィールドではないので、モジュールレベル関数 :func:`fields` の返" +"り値には含まれません。\n" +"初期化限定フィールドは生成された :meth:`__init__` メソッドに引数として追加さ" +"れ、オプションの :meth:`__post_init__` メソッドにも渡されます。\n" +"初期化限定フィールドは、データクラスからはそれ以外では使われません。" + +#: ../../library/dataclasses.rst:474 msgid "" "For example, suppose a field will be initialized from a database, if a value " "is not provided when creating the class::" @@ -939,186 +812,114 @@ msgstr "" "例えば、あるフィールドがデータベースから初期化されると仮定して、クラスを作成" "するときには値が与えられない次の場合を考えます::" -#: ../../library/dataclasses.rst:626 -msgid "" -"@dataclass\n" -"class C:\n" -" i: int\n" -" j: int | None = None\n" -" database: InitVar[DatabaseType | None] = None\n" -"\n" -" def __post_init__(self, database):\n" -" if self.j is None and database is not None:\n" -" self.j = database.lookup('j')\n" -"\n" -"c = C(10, database=my_database)" -msgstr "" - -#: ../../library/dataclasses.rst:638 +#: ../../library/dataclasses.rst:489 msgid "" -"In this case, :func:`fields` will return :class:`Field` objects for :attr:`!" -"i` and :attr:`!j`, but not for :attr:`!database`." +"In this case, :func:`fields` will return :class:`Field` objects for ``i`` " +"and ``j``, but not for ``database``." msgstr "" +"このケースでは、 :func:`fields` は ``i`` と ``j`` の :class:`Field` オブジェ" +"クトは返しますが、 ``database`` の :class:`Field` オブジェクトは返しません。" -#: ../../library/dataclasses.rst:644 +#: ../../library/dataclasses.rst:493 msgid "Frozen instances" msgstr "凍結されたインスタンス" -#: ../../library/dataclasses.rst:646 +#: ../../library/dataclasses.rst:495 msgid "" "It is not possible to create truly immutable Python objects. However, by " -"passing ``frozen=True`` to the :func:`@dataclass ` decorator you " -"can emulate immutability. In that case, dataclasses will add :meth:`~object." -"__setattr__` and :meth:`~object.__delattr__` methods to the class. These " -"methods will raise a :exc:`FrozenInstanceError` when invoked." +"passing ``frozen=True`` to the :meth:`dataclass` decorator you can emulate " +"immutability. In that case, dataclasses will add :meth:`__setattr__` and :" +"meth:`__delattr__` methods to the class. These methods will raise a :exc:" +"`FrozenInstanceError` when invoked." msgstr "" +"真に不変な Python のオブジェクトを作成するのは不可能です。\n" +"しかし、 ``frozen=True`` を :meth:`dataclass` デコレータに渡すことで、不変性" +"の模倣はできます。\n" +"このケースでは、データクラスは :meth:`__setattr__` メソッドと :meth:" +"`__delattr__` メソッドをクラスに追加します。\n" +"これらのメソッドは起動すると :exc:`FrozenInstanceError` を送出します。" -#: ../../library/dataclasses.rst:652 +#: ../../library/dataclasses.rst:501 msgid "" "There is a tiny performance penalty when using ``frozen=True``: :meth:" -"`~object.__init__` cannot use simple assignment to initialize fields, and " -"must use :meth:`!object.__setattr__`." +"`__init__` cannot use simple assignment to initialize fields, and must use :" +"meth:`object.__setattr__`." msgstr "" +"``frozen=True`` を使うとき、実行する上でのわずかな代償があります: :meth:" +"`__init__` でフィールドを初期化するのに単純に割り当てることはできず、 :meth:" +"`object.__setattr__` を使わなくてはなりません。" -#: ../../library/dataclasses.rst:661 +#: ../../library/dataclasses.rst:506 msgid "Inheritance" msgstr "継承" -#: ../../library/dataclasses.rst:663 -msgid "" -"When the dataclass is being created by the :func:`@dataclass ` " -"decorator, it looks through all of the class's base classes in reverse MRO " -"(that is, starting at :class:`object`) and, for each dataclass that it " -"finds, adds the fields from that base class to an ordered mapping of fields. " -"After all of the base class fields are added, it adds its own fields to the " -"ordered mapping. All of the generated methods will use this combined, " -"calculated ordered mapping of fields. Because the fields are in insertion " -"order, derived classes override base classes. An example::" -msgstr "" - -#: ../../library/dataclasses.rst:673 -msgid "" -"@dataclass\n" -"class Base:\n" -" x: Any = 15.0\n" -" y: int = 0\n" -"\n" -"@dataclass\n" -"class C(Base):\n" -" z: int = 10\n" -" x: int = 15" -msgstr "" - -#: ../../library/dataclasses.rst:683 -msgid "" -"The final list of fields is, in order, :attr:`!x`, :attr:`!y`, :attr:`!z`. " -"The final type of :attr:`!x` is :class:`int`, as specified in class :class:`!" -"C`." -msgstr "" - -#: ../../library/dataclasses.rst:686 -msgid "" -"The generated :meth:`~object.__init__` method for :class:`!C` will look " -"like::" -msgstr "" - -#: ../../library/dataclasses.rst:688 -msgid "def __init__(self, x: int = 15, y: int = 0, z: int = 10):" -msgstr "" - -#: ../../library/dataclasses.rst:691 -msgid "Re-ordering of keyword-only parameters in :meth:`!__init__`" -msgstr "" - -#: ../../library/dataclasses.rst:693 -msgid "" -"After the parameters needed for :meth:`~object.__init__` are computed, any " -"keyword-only parameters are moved to come after all regular (non-keyword-" -"only) parameters. This is a requirement of how keyword-only parameters are " -"implemented in Python: they must come after non-keyword-only parameters." -msgstr "" -":meth:`~object.__init__` で必要なパラメータが算出されると、キーワード専用引数" -"は他の一般的な(非キーワード専用)パラメータの後に移動します。これは、すべて" -"のキーワード専用引数は、非キーワード専用パラメータの末尾にこなければならない" -"という、キーワード専用パラメータのPythonの実装の都合で必要なことです。" - -#: ../../library/dataclasses.rst:699 -msgid "" -"In this example, :attr:`!Base.y`, :attr:`!Base.w`, and :attr:`!D.t` are " -"keyword-only fields, and :attr:`!Base.x` and :attr:`!D.z` are regular " -"fields::" -msgstr "" - -#: ../../library/dataclasses.rst:702 -msgid "" -"@dataclass\n" -"class Base:\n" -" x: Any = 15.0\n" -" _: KW_ONLY\n" -" y: int = 0\n" -" w: int = 1\n" -"\n" -"@dataclass\n" -"class D(Base):\n" -" z: int = 10\n" -" t: int = field(kw_only=True, default=0)" -msgstr "" - -#: ../../library/dataclasses.rst:714 -msgid "The generated :meth:`!__init__` method for :class:`!D` will look like::" -msgstr "" - -#: ../../library/dataclasses.rst:716 -msgid "" -"def __init__(self, x: Any = 15.0, z: int = 10, *, y: int = 0, w: int = 1, t: " -"int = 0):" -msgstr "" - -#: ../../library/dataclasses.rst:718 -msgid "" -"Note that the parameters have been re-ordered from how they appear in the " -"list of fields: parameters derived from regular fields are followed by " -"parameters derived from keyword-only fields." -msgstr "" -"パラメータは、フィールドのリストの表示方法によって並べ替えられます。通常の" -"フィールドから派生したパラメータの後に、キーワードのみのフィールドから派生し" -"たパラメータが続きます。" - -#: ../../library/dataclasses.rst:722 -msgid "" -"The relative ordering of keyword-only parameters is maintained in the re-" -"ordered :meth:`!__init__` parameter list." -msgstr "" - -#: ../../library/dataclasses.rst:727 +#: ../../library/dataclasses.rst:508 +msgid "" +"When the dataclass is being created by the :meth:`dataclass` decorator, it " +"looks through all of the class's base classes in reverse MRO (that is, " +"starting at :class:`object`) and, for each dataclass that it finds, adds the " +"fields from that base class to an ordered mapping of fields. After all of " +"the base class fields are added, it adds its own fields to the ordered " +"mapping. All of the generated methods will use this combined, calculated " +"ordered mapping of fields. Because the fields are in insertion order, " +"derived classes override base classes. An example::" +msgstr "" +"データクラスが :meth:`dataclass` デコレータで作成されるとき、 MRO を逆向きに " +"(すなわち、 :class:`object` を出発点として) 全ての基底クラスを調べていき、見" +"付かったデータクラスそれぞれについて、その基底クラスが持っているフィールドを" +"順序付きマッピングオブジェクトに追加します。\n" +"全ての基底クラスのフィールドが追加し終わったら、自分自身のフィールドを順序付" +"きマッピングオブジェクトに追加します。\n" +"生成された全てのメソッドは、このフィールドが集められ整列された順序付きのマッ" +"ピングオブジェクトを利用します。\n" +"フィールドは挿入順序で並んでいるので、派生クラスは基底クラスをオーバーライド" +"します。\n" +"例えば次のようになります::" + +#: ../../library/dataclasses.rst:528 +msgid "" +"The final list of fields is, in order, ``x``, ``y``, ``z``. The final type " +"of ``x`` is ``int``, as specified in class ``C``." +msgstr "" +"最終的に出来上がるフィールドのリストは ``x``, ``y``, ``z`` の順番になりま" +"す。\n" +"最終的な ``x`` の型は、 クラス ``C`` で指定されている通り ``int`` です。" + +#: ../../library/dataclasses.rst:531 +msgid "The generated :meth:`__init__` method for ``C`` will look like::" +msgstr "``C`` の生成された :meth:`__init__` メソッドは次のようになります::" + +#: ../../library/dataclasses.rst:536 msgid "Default factory functions" msgstr "デフォルトファクトリ関数" -#: ../../library/dataclasses.rst:729 +#: ../../library/dataclasses.rst:538 msgid "" -"If a :func:`field` specifies a *default_factory*, it is called with zero " +"If a :func:`field` specifies a ``default_factory``, it is called with zero " "arguments when a default value for the field is needed. For example, to " "create a new instance of a list, use::" msgstr "" +":func:`field` に ``default_factory`` を指定した場合、そのフィールドのデフォル" +"ト値が必要とされたときに、引数無しで呼び出されます。\n" +"これは例えば、リストの新しいインスタンスを作成するために使います::" -#: ../../library/dataclasses.rst:733 -msgid "mylist: list = field(default_factory=list)" -msgstr "" - -#: ../../library/dataclasses.rst:735 +#: ../../library/dataclasses.rst:544 msgid "" -"If a field is excluded from :meth:`~object.__init__` (using ``init=False``) " -"and the field also specifies *default_factory*, then the default factory " -"function will always be called from the generated :meth:`!__init__` " -"function. This happens because there is no other way to give the field an " -"initial value." +"If a field is excluded from :meth:`__init__` (using ``init=False``) and the " +"field also specifies ``default_factory``, then the default factory function " +"will always be called from the generated :meth:`__init__` function. This " +"happens because there is no other way to give the field an initial value." msgstr "" +"あるフィールドが (``init=False`` を使って) :meth:`__init__` から除外され、か" +"つ、 ``default_factory`` が指定されていた場合、デフォルトファクトリ関数は生成" +"された :meth:`__init__` 関数から常に呼び出されます。\n" +"フィールドに初期値を与える方法が他に無いので、このような動きになります。" -#: ../../library/dataclasses.rst:742 +#: ../../library/dataclasses.rst:551 msgid "Mutable default values" msgstr "可変なデフォルト値" -#: ../../library/dataclasses.rst:744 +#: ../../library/dataclasses.rst:553 msgid "" "Python stores default member variable values in class attributes. Consider " "this example, not using dataclasses::" @@ -1126,70 +927,45 @@ msgstr "" "Python はメンバ変数のデフォルト値をクラス属性に保持します。\n" "データクラスを使っていない、この例を考えてみましょう::" -#: ../../library/dataclasses.rst:747 +#: ../../library/dataclasses.rst:568 msgid "" -"class C:\n" -" x = []\n" -" def add(self, element):\n" -" self.x.append(element)\n" -"\n" -"o1 = C()\n" -"o2 = C()\n" -"o1.add(1)\n" -"o2.add(2)\n" -"assert o1.x == [1, 2]\n" -"assert o1.x is o2.x" +"Note that the two instances of class ``C`` share the same class variable " +"``x``, as expected." msgstr "" +"クラス ``C`` の 2 つのインスタンスが、予想通り同じクラス変数 ``x`` を共有して" +"いることに注意してください。" -#: ../../library/dataclasses.rst:759 -msgid "" -"Note that the two instances of class :class:`!C` share the same class " -"variable :attr:`!x`, as expected." -msgstr "" - -#: ../../library/dataclasses.rst:762 +#: ../../library/dataclasses.rst:571 msgid "Using dataclasses, *if* this code was valid::" msgstr "データクラスを使っているこのコードが *もし仮に* 有効なものだとしたら::" -#: ../../library/dataclasses.rst:764 -msgid "" -"@dataclass\n" -"class D:\n" -" x: list = [] # This code raises ValueError\n" -" def add(self, element):\n" -" self.x.append(element)" -msgstr "" - -#: ../../library/dataclasses.rst:770 +#: ../../library/dataclasses.rst:579 msgid "it would generate code similar to::" msgstr "データクラスは次のようなコードを生成するでしょう::" -#: ../../library/dataclasses.rst:772 -msgid "" -"class D:\n" -" x = []\n" -" def __init__(self, x=x):\n" -" self.x = x\n" -" def add(self, element):\n" -" self.x.append(element)\n" -"\n" -"assert D().x is D().x" -msgstr "" - -#: ../../library/dataclasses.rst:781 +#: ../../library/dataclasses.rst:590 msgid "" -"This has the same issue as the original example using class :class:`!C`. " -"That is, two instances of class :class:`!D` that do not specify a value for :" -"attr:`!x` when creating a class instance will share the same copy of :attr:`!" -"x`. Because dataclasses just use normal Python class creation they also " -"share this behavior. There is no general way for Data Classes to detect " -"this condition. Instead, the :func:`@dataclass ` decorator will " -"raise a :exc:`ValueError` if it detects an unhashable default parameter. " -"The assumption is that if a value is unhashable, it is mutable. This is a " +"This has the same issue as the original example using class ``C``. That is, " +"two instances of class ``D`` that do not specify a value for ``x`` when " +"creating a class instance will share the same copy of ``x``. Because " +"dataclasses just use normal Python class creation they also share this " +"behavior. There is no general way for Data Classes to detect this " +"condition. Instead, dataclasses will raise a :exc:`TypeError` if it detects " +"a default parameter of type ``list``, ``dict``, or ``set``. This is a " "partial solution, but it does protect against many common errors." msgstr "" +"これには、クラス ``C`` を使ったさっきの例と同じ問題があります。\n" +"すなわち、クラス ``D`` の 2 つのインスタンスは、クラスインスタンスを作成する" +"ときに ``x`` の具体的な値を指定しておらず、同じ ``x`` のコピーを共有しま" +"す。\n" +"データクラスは Python の通常のクラス作成の仕組みを使っているだけなので、この" +"同じ問題を抱えています。\n" +"データクラスがこの問題を検出する一般的な方法を持たない代わりに、データクラス" +"は型が ``list`` や ``dict`` や ``set`` のデフォルトパラメーターを検出した場" +"合、 :exc:`TypeError` を送出します。\n" +"これは完全ではない解決法ですが、よくあるエラーの多くを防げます。" -#: ../../library/dataclasses.rst:792 +#: ../../library/dataclasses.rst:600 msgid "" "Using default factory functions is a way to create new instances of mutable " "types as default values for fields::" @@ -1197,88 +973,16 @@ msgstr "" "デフォルトファクトリ関数を使うのが、フィールドのデフォルト値として可変な型の" "新しいインスタンスを作成する手段です::" -#: ../../library/dataclasses.rst:795 -msgid "" -"@dataclass\n" -"class D:\n" -" x: list = field(default_factory=list)\n" -"\n" -"assert D().x is not D().x" -msgstr "" +#: ../../library/dataclasses.rst:610 +msgid "Exceptions" +msgstr "例外" -#: ../../library/dataclasses.rst:801 +#: ../../library/dataclasses.rst:614 msgid "" -"Instead of looking for and disallowing objects of type :class:`list`, :class:" -"`dict`, or :class:`set`, unhashable objects are now not allowed as default " -"values. Unhashability is used to approximate mutability." -msgstr "" - -#: ../../library/dataclasses.rst:808 -msgid "Descriptor-typed fields" -msgstr "" - -#: ../../library/dataclasses.rst:810 -msgid "" -"Fields that are assigned :ref:`descriptor objects ` as their " -"default value have the following special behaviors:" -msgstr "" - -#: ../../library/dataclasses.rst:813 -msgid "" -"The value for the field passed to the dataclass's :meth:`~object.__init__` " -"method is passed to the descriptor's :meth:`~object.__set__` method rather " -"than overwriting the descriptor object." -msgstr "" - -#: ../../library/dataclasses.rst:817 -msgid "" -"Similarly, when getting or setting the field, the descriptor's :meth:" -"`~object.__get__` or :meth:`!__set__` method is called rather than returning " -"or overwriting the descriptor object." -msgstr "" - -#: ../../library/dataclasses.rst:821 -msgid "" -"To determine whether a field contains a default value, :func:`@dataclass " -"` will call the descriptor's :meth:`!__get__` method using its " -"class access form: ``descriptor.__get__(obj=None, type=cls)``. If the " -"descriptor returns a value in this case, it will be used as the field's " -"default. On the other hand, if the descriptor raises :exc:`AttributeError` " -"in this situation, no default value will be provided for the field." -msgstr "" - -#: ../../library/dataclasses.rst:831 -msgid "" -"class IntConversionDescriptor:\n" -" def __init__(self, *, default):\n" -" self._default = default\n" -"\n" -" def __set_name__(self, owner, name):\n" -" self._name = \"_\" + name\n" -"\n" -" def __get__(self, obj, type):\n" -" if obj is None:\n" -" return self._default\n" -"\n" -" return getattr(obj, self._name, self._default)\n" -"\n" -" def __set__(self, obj, value):\n" -" setattr(obj, self._name, int(value))\n" -"\n" -"@dataclass\n" -"class InventoryItem:\n" -" quantity_on_hand: IntConversionDescriptor = " -"IntConversionDescriptor(default=100)\n" -"\n" -"i = InventoryItem()\n" -"print(i.quantity_on_hand) # 100\n" -"i.quantity_on_hand = 2.5 # calls __set__ with 2.5\n" -"print(i.quantity_on_hand) # 2" -msgstr "" - -#: ../../library/dataclasses.rst:856 -msgid "" -"Note that if a field is annotated with a descriptor type, but is not " -"assigned a descriptor object as its default value, the field will act like a " -"normal field." +"Raised when an implicitly defined :meth:`__setattr__` or :meth:`__delattr__` " +"is called on a dataclass which was defined with ``frozen=True``. It is a " +"subclass of :exc:`AttributeError`." msgstr "" +"``frozen=True`` 付きで定義されたデータクラスで、暗黙的に定義された :meth:" +"`__setattr__` または :meth:`__delattr__` が呼び出されたときに送出されます。こ" +"れは :exc:`AttributeError` のサブクラスです。" diff --git a/library/datatypes.po b/library/datatypes.po index c028bbb56..df9ed66eb 100644 --- a/library/datatypes.po +++ b/library/datatypes.po @@ -1,25 +1,26 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 +# Nozomu Kaneko , 2017 +# Osamu NAKAMURA, 2019 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-30 14:22+0000\n" -"PO-Revision-Date: 2021-06-28 01:04+0000\n" -"Last-Translator: tomo, 2021\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 23:05+0000\n" +"Last-Translator: Osamu NAKAMURA, 2019\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/datatypes.rst:5 diff --git a/library/datetime.po b/library/datetime.po index 2e945972d..a67ed23b7 100644 --- a/library/datetime.po +++ b/library/datetime.po @@ -1,35 +1,42 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: +# Shun Sakurai, 2017 +# E. Kawashima, 2017 +# Masato HASHIMOTO , 2017 +# ごはんですよ , 2017 +# Nozomu Kaneko , 2017 +# Arihiro TAKASE, 2017 +# 永田 大和 , 2019 +# 秘湯 , 2019 +# Yusuke Miyazaki , 2019 +# SHIMIZU Taku , 2020 +# tomo, 2020 # mollinaca, 2021 -# tomo, 2024 -# Takeshi Nakazato, 2024 -# 石井明久, 2024 -# Arihiro TAKASE, 2024 -# Takanori Suzuki , 2025 +# Takanori Suzuki , 2021 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-30 14:22+0000\n" -"PO-Revision-Date: 2021-06-28 01:04+0000\n" -"Last-Translator: Takanori Suzuki , 2025\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 23:06+0000\n" +"Last-Translator: Takanori Suzuki , 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/datetime.rst:2 -msgid ":mod:`!datetime` --- Basic date and time types" -msgstr ":mod:`!datetime` --- 基本的な日付と時間の型" +msgid ":mod:`datetime` --- Basic date and time types" +msgstr ":mod:`datetime` --- 基本的な日付型および時間型" #: ../../library/datetime.rst:11 msgid "**Source code:** :source:`Lib/datetime.py`" @@ -37,10 +44,9 @@ msgstr "**ソースコード:** :source:`Lib/datetime.py`" #: ../../library/datetime.rst:17 msgid "" -"The :mod:`!datetime` module supplies classes for manipulating dates and " -"times." +"The :mod:`datetime` module supplies classes for manipulating dates and times." msgstr "" -":mod:`!datetime` モジュールは、日付や時刻を操作するためのクラスを提供していま" +":mod:`datetime` モジュールは、日付や時刻を操作するためのクラスを提供していま" "す。" #: ../../library/datetime.rst:19 @@ -51,66 +57,43 @@ msgstr "" "日付や時刻に対する算術がサポートされている一方、実装では出力のフォーマットや" "操作のための効率的な属性の抽出に重点を置いています。" -#: ../../library/datetime.rst:24 -msgid "Skip to :ref:`the format codes `." -msgstr ":ref:`書式コード ` に飛ぶ。" - -#: ../../library/datetime.rst:28 +#: ../../library/datetime.rst:25 msgid "Module :mod:`calendar`" msgstr ":mod:`calendar` モジュール" -#: ../../library/datetime.rst:29 +#: ../../library/datetime.rst:25 msgid "General calendar related functions." msgstr "汎用のカレンダー関連関数。" -#: ../../library/datetime.rst:31 +#: ../../library/datetime.rst:28 msgid "Module :mod:`time`" msgstr ":mod:`time` モジュール" -#: ../../library/datetime.rst:32 +#: ../../library/datetime.rst:28 msgid "Time access and conversions." msgstr "時刻へのアクセスと変換。" -#: ../../library/datetime.rst:34 -msgid "Module :mod:`zoneinfo`" -msgstr ":mod:`zoneinfo` モジュール" - -#: ../../library/datetime.rst:35 -msgid "Concrete time zones representing the IANA time zone database." -msgstr "IANAタイムゾーンデータベースを表す具体的なタイムゾーン。" - -#: ../../library/datetime.rst:37 +#: ../../library/datetime.rst:30 msgid "Package `dateutil `_" msgstr "`dateutil `_ パッケージ" -#: ../../library/datetime.rst:38 +#: ../../library/datetime.rst:31 msgid "Third-party library with expanded time zone and parsing support." msgstr "拡張タイムゾーンと構文解析サポートのあるサードパーティーライブラリ。" -#: ../../library/datetime.rst:40 -msgid "Package :pypi:`DateType`" -msgstr ":pypi:`DateType` パッケージ" - -#: ../../library/datetime.rst:41 -msgid "" -"Third-party library that introduces distinct static types to e.g. allow :" -"term:`static type checkers ` to differentiate between " -"naive and aware datetimes." -msgstr "" - -#: ../../library/datetime.rst:48 +#: ../../library/datetime.rst:36 msgid "Aware and Naive Objects" msgstr "Aware オブジェクトと Naive オブジェクト" -#: ../../library/datetime.rst:50 +#: ../../library/datetime.rst:38 msgid "" "Date and time objects may be categorized as \"aware\" or \"naive\" depending " -"on whether or not they include time zone information." +"on whether or not they include timezone information." msgstr "" "日時のオブジェクトは、それらがタイムゾーンの情報を含んでいるかどうかによって " "\"aware\" あるいは \"naive\" に分類されます。" -#: ../../library/datetime.rst:53 +#: ../../library/datetime.rst:41 msgid "" "With sufficient knowledge of applicable algorithmic and political time " "adjustments, such as time zone and daylight saving time information, an " @@ -123,12 +106,12 @@ msgstr "" "クトとの相対関係を特定できます。\n" "aware オブジェクトは解釈の余地のない特定の実時刻を表現します。 [#]_" -#: ../../library/datetime.rst:59 +#: ../../library/datetime.rst:47 msgid "" "A **naive** object does not contain enough information to unambiguously " "locate itself relative to other date/time objects. Whether a naive object " "represents Coordinated Universal Time (UTC), local time, or time in some " -"other time zone is purely up to the program, just like it is up to the " +"other timezone is purely up to the program, just like it is up to the " "program whether a particular number represents metres, miles, or mass. Naive " "objects are easy to understand and to work with, at the cost of ignoring " "some aspects of reality." @@ -141,7 +124,7 @@ msgstr "" "を無視してしまうというコストを無視すれば、簡単に理解でき、うまく利用すること" "ができます。" -#: ../../library/datetime.rst:66 +#: ../../library/datetime.rst:54 msgid "" "For applications requiring aware objects, :class:`.datetime` and :class:`." "time` objects have an optional time zone information attribute, :attr:`!" @@ -158,58 +141,54 @@ msgstr "" "これらの :class:`tzinfo` オブジェクトは UTC 時間からのオフセットやタイムゾー" "ンの名前、夏時間が実施されるかどうかの情報を保持しています。" -#: ../../library/datetime.rst:72 +#: ../../library/datetime.rst:60 msgid "" "Only one concrete :class:`tzinfo` class, the :class:`timezone` class, is " -"supplied by the :mod:`!datetime` module. The :class:`!timezone` class can " -"represent simple time zones with fixed offsets from UTC, such as UTC itself " -"or North American EST and EDT time zones. Supporting time zones at deeper " +"supplied by the :mod:`datetime` module. The :class:`timezone` class can " +"represent simple timezones with fixed offsets from UTC, such as UTC itself " +"or North American EST and EDT timezones. Supporting timezones at deeper " "levels of detail is up to the application. The rules for time adjustment " "across the world are more political than rational, change frequently, and " "there is no standard suitable for every application aside from UTC." msgstr "" "ただ一つの具象 :class:`tzinfo` クラスである :class:`timezone` クラスが :mod:" -"`!datetime` モジュールで提供されています。 :class:`!timezone` クラスは、UTCか" -"らのオフセットが固定である単純なタイムゾーン(例えばUTCそれ自体)、および北ア" -"メリカにおける東部標準時(EST)/東部夏時間(EDT)のような単純ではないタイム" +"`datetime` モジュールで提供されています。 :class:`timezone` クラスは、UTCから" +"のオフセットが固定である単純なタイムゾーン(例えばUTCそれ自体)、および北アメ" +"リカにおける東部標準時(EST)/東部夏時間(EDT)のような単純ではないタイム" "ゾーンの両方を表現できます。より深く詳細までタイムゾーンをサポートするかはア" "プリケーションに依存します。世界中の時刻の調整を決めるルールは合理的というよ" "りかは政治的なもので、頻繁に変わり、UTC を除くと都合のよい基準というものはあ" "りません。" -#: ../../library/datetime.rst:81 +#: ../../library/datetime.rst:69 msgid "Constants" msgstr "定数" -#: ../../library/datetime.rst:83 -msgid "The :mod:`!datetime` module exports the following constants:" -msgstr ":mod:`!datetime` モジュールでは以下の定数を公開しています:" +#: ../../library/datetime.rst:71 +msgid "The :mod:`datetime` module exports the following constants:" +msgstr ":mod:`datetime` モジュールでは以下の定数を公開しています:" -#: ../../library/datetime.rst:87 +#: ../../library/datetime.rst:75 msgid "" "The smallest year number allowed in a :class:`date` or :class:`.datetime` " -"object. :const:`MINYEAR` is 1." +"object. :const:`MINYEAR` is ``1``." msgstr "" ":class:`date` や :class:`.datetime` オブジェクトで許されている、年を表現する" -"最小の数字です。 :const:`MINYEAR` は1です。" +"最小の数字です。 :const:`MINYEAR` は ``1`` です。" -#: ../../library/datetime.rst:93 +#: ../../library/datetime.rst:81 msgid "" "The largest year number allowed in a :class:`date` or :class:`.datetime` " -"object. :const:`MAXYEAR` is 9999." +"object. :const:`MAXYEAR` is ``9999``." msgstr "" ":class:`date` や :class:`.datetime` オブジェクトで許されている、年を表現する" -"最大の数字です。 :const:`MAXYEAR` は9999です。" +"最大の数字です。 :const:`MAXYEAR` は ``9999`` です。" -#: ../../library/datetime.rst:98 -msgid "Alias for the UTC time zone singleton :attr:`datetime.timezone.utc`." -msgstr "UTCタイムゾーンシングルトン :attr:`datetime.timezone.utc` の別名。" - -#: ../../library/datetime.rst:103 +#: ../../library/datetime.rst:85 msgid "Available Types" msgstr "利用可能なデータ型" -#: ../../library/datetime.rst:108 +#: ../../library/datetime.rst:90 msgid "" "An idealized naive date, assuming the current Gregorian calendar always was, " "and always will be, in effect. Attributes: :attr:`year`, :attr:`month`, and :" @@ -219,7 +198,7 @@ msgstr "" "calender) が有効であることを仮定しています。\n" "属性は :attr:`year`, :attr:`month`,および :attr:`day` です。" -#: ../../library/datetime.rst:116 +#: ../../library/datetime.rst:98 msgid "" "An idealized time, independent of any particular day, assuming that every " "day has exactly 24\\*60\\*60 seconds. (There is no notion of \"leap " @@ -231,7 +210,7 @@ msgstr "" "属性は :attr:`hour`, :attr:`minute`, :attr:`second`, :attr:`microsecond`, お" "よび :attr:`tzinfo` です。" -#: ../../library/datetime.rst:125 +#: ../../library/datetime.rst:107 msgid "" "A combination of a date and a time. Attributes: :attr:`year`, :attr:" "`month`, :attr:`day`, :attr:`hour`, :attr:`minute`, :attr:`second`, :attr:" @@ -241,15 +220,15 @@ msgstr "" "属性は :attr:`year`, :attr:`month`, :attr:`day`, :attr:`hour`, :attr:" "`minute`, :attr:`second`, :attr:`microsecond`, および :attr:`tzinfo` です。" -#: ../../library/datetime.rst:133 +#: ../../library/datetime.rst:115 msgid "" -"A duration expressing the difference between two :class:`.datetime` or :" -"class:`date` instances to microsecond resolution." +"A duration expressing the difference between two :class:`date`, :class:`." +"time`, or :class:`.datetime` instances to microsecond resolution." msgstr "" -":class:`.datetime` あるいは :class:`date` クラスの二つのインスタンス間の時間" -"差をマイクロ秒精度で表す経過時間値です。" +":class:`date`, :class:`.time`, あるいは :class:`.datetime` クラスの二つのイン" +"スタンス間の時間差をマイクロ秒精度で表す経過時間値です。" -#: ../../library/datetime.rst:140 +#: ../../library/datetime.rst:122 msgid "" "An abstract base class for time zone information objects. These are used by " "the :class:`.datetime` and :class:`.time` classes to provide a customizable " @@ -260,7 +239,7 @@ msgstr "" ":class:`.datetime` および :class:`.time` クラスで用いられ、カスタマイズ可能な" "時刻修正の概念 (たとえばタイムゾーンや夏時間の計算) を提供します。" -#: ../../library/datetime.rst:148 +#: ../../library/datetime.rst:130 msgid "" "A class that implements the :class:`tzinfo` abstract base class as a fixed " "offset from the UTC." @@ -268,30 +247,19 @@ msgstr "" ":class:`tzinfo` 抽象基底クラスを UTC からの固定オフセットとして実装するクラス" "です。" -#: ../../library/datetime.rst:153 ../../library/datetime.rst:171 +#: ../../library/datetime.rst:135 ../../library/datetime.rst:153 msgid "Objects of these types are immutable." msgstr "これらの型のオブジェクトは変更不可能 (immutable) です。" -#: ../../library/datetime.rst:155 +#: ../../library/datetime.rst:137 msgid "Subclass relationships::" msgstr "サブクラスの関係は以下のようになります::" -#: ../../library/datetime.rst:157 -msgid "" -"object\n" -" timedelta\n" -" tzinfo\n" -" timezone\n" -" time\n" -" date\n" -" datetime" -msgstr "" - -#: ../../library/datetime.rst:166 +#: ../../library/datetime.rst:148 msgid "Common Properties" msgstr "共通の特徴" -#: ../../library/datetime.rst:168 +#: ../../library/datetime.rst:150 msgid "" "The :class:`date`, :class:`.datetime`, :class:`.time`, and :class:`timezone` " "types share these common features:" @@ -299,15 +267,15 @@ msgstr "" ":class:`date` 型、:class:`.datetime` 型、:class:`.time` 型、:class:" "`timezone` 型には共通する特徴があります:" -#: ../../library/datetime.rst:172 +#: ../../library/datetime.rst:154 msgid "" -"Objects of these types are :term:`hashable`, meaning that they can be used " -"as dictionary keys." +"Objects of these types are hashable, meaning that they can be used as " +"dictionary keys." msgstr "" -"これらの型のオブジェクトは :term:`ハッシュ可能 ` であり、辞書のキー" -"として使えることになります。" +"これらの型のオブジェクトはハッシュ可能であり、辞書のキーとして使えることにな" +"ります。" -#: ../../library/datetime.rst:174 +#: ../../library/datetime.rst:156 msgid "" "Objects of these types support efficient pickling via the :mod:`pickle` " "module." @@ -315,55 +283,57 @@ msgstr "" "これらの型のオブジェクトは :mod:`pickle` モジュールを利用して効率的な pickle " "化をサポートしています。" -#: ../../library/datetime.rst:177 +#: ../../library/datetime.rst:159 msgid "Determining if an Object is Aware or Naive" msgstr "オブジェクトが Aware なのか Naive なのかの判断" -#: ../../library/datetime.rst:179 +#: ../../library/datetime.rst:161 msgid "Objects of the :class:`date` type are always naive." msgstr ":class:`date` 型のオブジェクトは常に naive です。" -#: ../../library/datetime.rst:181 +#: ../../library/datetime.rst:163 msgid "" "An object of type :class:`.time` or :class:`.datetime` may be aware or naive." msgstr "" ":class:`.time` 型あるいは :class:`.datetime` 型のオブジェクトは aware か " "naive のどちらかです。" -#: ../../library/datetime.rst:183 -msgid "" -"A :class:`.datetime` object ``d`` is aware if both of the following hold:" +#: ../../library/datetime.rst:165 +msgid "A :class:`.datetime` object *d* is aware if both of the following hold:" msgstr "" +"次の条件を両方とも満たす場合、 :class:`.datetime` オブジェクト *d* は aware " +"です:" -#: ../../library/datetime.rst:185 +#: ../../library/datetime.rst:167 msgid "``d.tzinfo`` is not ``None``" msgstr "``d.tzinfo`` が ``None`` でない" -#: ../../library/datetime.rst:186 +#: ../../library/datetime.rst:168 msgid "``d.tzinfo.utcoffset(d)`` does not return ``None``" msgstr "``d.tzinfo.utcoffset(d)`` が ``None`` を返さない" -#: ../../library/datetime.rst:188 -msgid "Otherwise, ``d`` is naive." -msgstr "" +#: ../../library/datetime.rst:170 +msgid "Otherwise, *d* is naive." +msgstr "どちらかを満たさない場合は、 *d* は naive です。" -#: ../../library/datetime.rst:190 -msgid "A :class:`.time` object ``t`` is aware if both of the following hold:" +#: ../../library/datetime.rst:172 +msgid "A :class:`.time` object *t* is aware if both of the following hold:" msgstr "" +"次の条件を両方とも満たす場合、 :class:`.time` オブジェクト *t* は aware です:" -#: ../../library/datetime.rst:192 +#: ../../library/datetime.rst:174 msgid "``t.tzinfo`` is not ``None``" msgstr "``t.tzinfo`` が ``None`` でない" -#: ../../library/datetime.rst:193 +#: ../../library/datetime.rst:175 msgid "``t.tzinfo.utcoffset(None)`` does not return ``None``." msgstr "``t.tzinfo.utcoffset(None)`` が ``None`` を返さない" -#: ../../library/datetime.rst:195 -msgid "Otherwise, ``t`` is naive." -msgstr "" +#: ../../library/datetime.rst:177 +msgid "Otherwise, *t* is naive." +msgstr "どちらかを満たさない場合は、 *t* は naive です。" -#: ../../library/datetime.rst:197 +#: ../../library/datetime.rst:179 msgid "" "The distinction between aware and naive doesn't apply to :class:`timedelta` " "objects." @@ -371,27 +341,27 @@ msgstr "" "aware なオブジェクトと naive なオブジェクトの区別は :class:`timedelta` オブ" "ジェクトにはあてはまりません。" -#: ../../library/datetime.rst:203 +#: ../../library/datetime.rst:185 msgid ":class:`timedelta` Objects" msgstr ":class:`timedelta` オブジェクト" -#: ../../library/datetime.rst:205 +#: ../../library/datetime.rst:187 msgid "" "A :class:`timedelta` object represents a duration, the difference between " -"two :class:`.datetime` or :class:`date` instances." +"two dates or times." msgstr "" -":class:`timedelta` オブジェクトは経過時間、すなわち二つの :class:`.datetime` " -"または :class:`date` のインスタンスの差を表します。" +":class:`timedelta` オブジェクトは経過時間、すなわち二つの日付や時刻間の差を表" +"します。" -#: ../../library/datetime.rst:210 +#: ../../library/datetime.rst:192 msgid "" -"All arguments are optional and default to 0. Arguments may be integers or " -"floats, and may be positive or negative." +"All arguments are optional and default to ``0``. Arguments may be integers " +"or floats, and may be positive or negative." msgstr "" -"全ての引数がオプションで、デフォルト値は0です。\n" +"全ての引数がオプションで、デフォルト値は ``0`` です。\n" "引数は整数、浮動小数点数でもよく、正でも負でもかまいません。" -#: ../../library/datetime.rst:213 +#: ../../library/datetime.rst:195 msgid "" "Only *days*, *seconds* and *microseconds* are stored internally. Arguments " "are converted to those units:" @@ -399,23 +369,23 @@ msgstr "" "*days*, *seconds*, *microseconds* だけが内部的に保持されます。\n" "引数は以下のようにして変換されます:" -#: ../../library/datetime.rst:216 +#: ../../library/datetime.rst:198 msgid "A millisecond is converted to 1000 microseconds." msgstr "1 ミリ秒は 1000 マイクロ秒に変換されます。" -#: ../../library/datetime.rst:217 +#: ../../library/datetime.rst:199 msgid "A minute is converted to 60 seconds." msgstr "1 分は 60 秒に変換されます。" -#: ../../library/datetime.rst:218 +#: ../../library/datetime.rst:200 msgid "An hour is converted to 3600 seconds." msgstr "1 時間は 3600 秒に変換されます。" -#: ../../library/datetime.rst:219 +#: ../../library/datetime.rst:201 msgid "A week is converted to 7 days." msgstr "1 週間は 7 日に変換されます。" -#: ../../library/datetime.rst:221 +#: ../../library/datetime.rst:203 msgid "" "and days, seconds and microseconds are then normalized so that the " "representation is unique, with" @@ -423,19 +393,19 @@ msgstr "" "さらに、値が一意に表されるように days, seconds, microseconds が以下のように正" "規化されます" -#: ../../library/datetime.rst:224 +#: ../../library/datetime.rst:206 msgid "``0 <= microseconds < 1000000``" msgstr "``0 <= microseconds < 1000000``" -#: ../../library/datetime.rst:225 +#: ../../library/datetime.rst:207 msgid "``0 <= seconds < 3600*24`` (the number of seconds in one day)" msgstr "``0 <= seconds < 3600*24`` (一日中の秒数)" -#: ../../library/datetime.rst:226 +#: ../../library/datetime.rst:208 msgid "``-999999999 <= days <= 999999999``" msgstr "``-999999999 <= days <= 999999999``" -#: ../../library/datetime.rst:228 +#: ../../library/datetime.rst:210 msgid "" "The following example illustrates how any arguments besides *days*, " "*seconds* and *microseconds* are \"merged\" and normalized into those three " @@ -444,24 +414,7 @@ msgstr "" "次の例は、 *days*, *seconds*, *microseconds* に加えて任意の引数がどう \"集約" "\" され、最終的に3つの属性に正規化されるかの説明をしています::" -#: ../../library/datetime.rst:232 -msgid "" -">>> from datetime import timedelta\n" -">>> delta = timedelta(\n" -"... days=50,\n" -"... seconds=27,\n" -"... microseconds=10,\n" -"... milliseconds=29000,\n" -"... minutes=5,\n" -"... hours=8,\n" -"... weeks=2\n" -"... )\n" -">>> # Only days, seconds, and microseconds remain\n" -">>> delta\n" -"datetime.timedelta(days=64, seconds=29156, microseconds=10)" -msgstr "" - -#: ../../library/datetime.rst:246 +#: ../../library/datetime.rst:228 msgid "" "If any argument is a float and there are fractional microseconds, the " "fractional microseconds left over from all arguments are combined and their " @@ -474,7 +427,7 @@ msgstr "" "められます。浮動小数点の引数がない場合、値の変換と正規化の過程は厳密な (失わ" "れる情報がない) ものとなります。" -#: ../../library/datetime.rst:253 +#: ../../library/datetime.rst:235 msgid "" "If the normalized value of days lies outside the indicated range, :exc:" "`OverflowError` is raised." @@ -482,53 +435,25 @@ msgstr "" "日の値を正規化した結果、指定された範囲の外側になった場合には、 :exc:" "`OverflowError` が送出されます。" -#: ../../library/datetime.rst:256 +#: ../../library/datetime.rst:238 msgid "" "Note that normalization of negative values may be surprising at first. For " "example::" msgstr "負の値を正規化すると、最初は混乱するような値になります。例えば::" -#: ../../library/datetime.rst:259 -msgid "" -">>> from datetime import timedelta\n" -">>> d = timedelta(microseconds=-1)\n" -">>> (d.days, d.seconds, d.microseconds)\n" -"(-1, 86399, 999999)" -msgstr "" - -#: ../../library/datetime.rst:264 -msgid "" -"Since the string representation of :class:`!timedelta` objects can be " -"confusing, use the following recipe to produce a more readable format:" -msgstr "" - -#: ../../library/datetime.rst:267 -msgid "" -">>> def pretty_timedelta(td):\n" -"... if td.days >= 0:\n" -"... return str(td)\n" -"... return f'-({-td!s})'\n" -"...\n" -">>> d = timedelta(hours=-1)\n" -">>> str(d) # not human-friendly\n" -"'-1 day, 23:00:00'\n" -">>> pretty_timedelta(d)\n" -"'-(1:00:00)'" -msgstr "" - -#: ../../library/datetime.rst:281 ../../library/datetime.rst:615 -#: ../../library/datetime.rst:1175 ../../library/datetime.rst:1813 -#: ../../library/datetime.rst:2434 +#: ../../library/datetime.rst:247 ../../library/datetime.rst:541 +#: ../../library/datetime.rst:1048 ../../library/datetime.rst:1666 +#: ../../library/datetime.rst:2260 msgid "Class attributes:" msgstr "以下にクラス属性を示します:" -#: ../../library/datetime.rst:285 +#: ../../library/datetime.rst:251 msgid "The most negative :class:`timedelta` object, ``timedelta(-999999999)``." msgstr "" "最小の値を表す :class:`timedelta` オブジェクトで、 ``timedelta(-999999999)`` " "です。" -#: ../../library/datetime.rst:290 +#: ../../library/datetime.rst:256 msgid "" "The most positive :class:`timedelta` object, ``timedelta(days=999999999, " "hours=23, minutes=59, seconds=59, microseconds=999999)``." @@ -537,7 +462,7 @@ msgstr "" "``timedelta(days=999999999, hours=23, minutes=59, seconds=59, " "microseconds=999999)`` です。" -#: ../../library/datetime.rst:296 +#: ../../library/datetime.rst:262 msgid "" "The smallest possible difference between non-equal :class:`timedelta` " "objects, ``timedelta(microseconds=1)``." @@ -545,110 +470,112 @@ msgstr "" ":class:`timedelta` オブジェクトが等しくならない最小の時間差で、 " "``timedelta(microseconds=1)`` です。" -#: ../../library/datetime.rst:299 +#: ../../library/datetime.rst:265 msgid "" -"Note that, because of normalization, ``timedelta.max`` is greater than ``-" -"timedelta.min``. ``-timedelta.max`` is not representable as a :class:" -"`timedelta` object." +"Note that, because of normalization, ``timedelta.max`` > ``-timedelta.min``. " +"``-timedelta.max`` is not representable as a :class:`timedelta` object." msgstr "" -"正規化のために、 ``timedelta.max`` は ``-timedelta.min`` より大きいことに注意" -"してください。 ``-timedelta.max`` は :class:`timedelta` オブジェクトとして表" -"現することができません。" +"正規化のために、 ``timedelta.max`` > ``-timedelta.min`` となるので注意してく" +"ださい。 ``-timedelta.max`` は :class:`timedelta` オブジェクトとして表現する" +"ことができません。" -#: ../../library/datetime.rst:303 ../../library/datetime.rst:633 -#: ../../library/datetime.rst:1195 ../../library/datetime.rst:1833 +#: ../../library/datetime.rst:268 ../../library/datetime.rst:559 +#: ../../library/datetime.rst:1068 ../../library/datetime.rst:1686 msgid "Instance attributes (read-only):" msgstr "インスタンスの属性 (読み出しのみ):" -#: ../../library/datetime.rst:307 -msgid "Between -999,999,999 and 999,999,999 inclusive." -msgstr "" +#: ../../library/datetime.rst:271 +msgid "Attribute" +msgstr "属性" -#: ../../library/datetime.rst:312 -msgid "Between 0 and 86,399 inclusive." -msgstr "" +#: ../../library/datetime.rst:271 +msgid "Value" +msgstr "値" -#: ../../library/datetime.rst:316 -msgid "" -"It is a somewhat common bug for code to unintentionally use this attribute " -"when it is actually intended to get a :meth:`~timedelta.total_seconds` value " -"instead:" -msgstr "" +#: ../../library/datetime.rst:273 +msgid "``days``" +msgstr "``days``" -#: ../../library/datetime.rst:320 -msgid "" -">>> from datetime import timedelta\n" -">>> duration = timedelta(seconds=11235813)\n" -">>> duration.days, duration.seconds\n" -"(130, 3813)\n" -">>> duration.total_seconds()\n" -"11235813.0" -msgstr "" +#: ../../library/datetime.rst:273 +msgid "Between -999999999 and 999999999 inclusive" +msgstr "両端値を含む -999999999 から 999999999 の間" -#: ../../library/datetime.rst:331 -msgid "Between 0 and 999,999 inclusive." -msgstr "" +#: ../../library/datetime.rst:275 +msgid "``seconds``" +msgstr "``seconds``" -#: ../../library/datetime.rst:334 ../../library/datetime.rst:650 -#: ../../library/datetime.rst:1248 +#: ../../library/datetime.rst:275 +msgid "Between 0 and 86399 inclusive" +msgstr "両端値を含む 0 から 86399 の間" + +#: ../../library/datetime.rst:277 +msgid "``microseconds``" +msgstr "``microseconds``" + +#: ../../library/datetime.rst:277 +msgid "Between 0 and 999999 inclusive" +msgstr "両端値を含む 0 から 999999 の間" + +#: ../../library/datetime.rst:280 ../../library/datetime.rst:576 +#: ../../library/datetime.rst:1121 msgid "Supported operations:" msgstr "サポートされている演算を以下に示します:" -#: ../../library/datetime.rst:339 ../../library/datetime.rst:653 -#: ../../library/datetime.rst:1251 +#: ../../library/datetime.rst:285 ../../library/datetime.rst:579 +#: ../../library/datetime.rst:1124 msgid "Operation" msgstr "演算" -#: ../../library/datetime.rst:339 ../../library/datetime.rst:653 -#: ../../library/datetime.rst:1251 +#: ../../library/datetime.rst:285 ../../library/datetime.rst:579 +#: ../../library/datetime.rst:1124 msgid "Result" msgstr "結果" -#: ../../library/datetime.rst:341 +#: ../../library/datetime.rst:287 msgid "``t1 = t2 + t3``" msgstr "``t1 = t2 + t3``" -#: ../../library/datetime.rst:341 +#: ../../library/datetime.rst:287 msgid "" -"Sum of ``t2`` and ``t3``. Afterwards ``t1 - t2 == t3`` and ``t1 - t3 == t2`` " -"are true. (1)" +"Sum of *t2* and *t3*. Afterwards *t1*-*t2* == *t3* and *t1*-*t3* == *t2* are " +"true. (1)" msgstr "" -"``t2`` と ``t3`` の和。演算後、``t1 - t2 == t3`` および ``t1 - t3 == t2`` は" -"真になります。(1)" +"*t2* と *t3* の和。演算後、*t1*-*t2* == *t3* および *t1*-*t3* == *t2* は真に" +"なります。(1)" -#: ../../library/datetime.rst:345 +#: ../../library/datetime.rst:290 msgid "``t1 = t2 - t3``" msgstr "``t1 = t2 - t3``" -#: ../../library/datetime.rst:345 +#: ../../library/datetime.rst:290 msgid "" -"Difference of ``t2`` and ``t3``. Afterwards ``t1 == t2 - t3`` and ``t2 == " -"t1 + t3`` are true. (1)(6)" +"Difference of *t2* and *t3*. Afterwards *t1* == *t2* - *t3* and *t2* == *t1* " +"+ *t3* are true. (1)(6)" msgstr "" -"``t2`` と ``t3`` の差。演算後、``t1 == t2 - t3`` および ``t2 == t1 + t3`` は" -"真になります。 (1)(6)" +"*t2* と *t3* の差分です。演算後、 *t1* == *t2* - *t3* および *t2* == *t1* + " +"*t3* は真になります。 (1)(6)" -#: ../../library/datetime.rst:349 +#: ../../library/datetime.rst:294 msgid "``t1 = t2 * i or t1 = i * t2``" msgstr "``t1 = t2 * i または t1 = i * t2``" -#: ../../library/datetime.rst:349 +#: ../../library/datetime.rst:294 msgid "" -"Delta multiplied by an integer. Afterwards ``t1 // i == t2`` is true, " +"Delta multiplied by an integer. Afterwards *t1* // i == *t2* is true, " "provided ``i != 0``." msgstr "" -"時間差と整数の積。演算後、``t1 // i == t2`` は ``i != 0`` であれば真となりま" +"時間差と整数の積。演算後、*t1* // i == *t2* は ``i != 0`` であれば真となりま" "す。" -#: ../../library/datetime.rst:353 -msgid "In general, ``t1 * i == t1 * (i-1) + t1`` is true. (1)" -msgstr "一般的に、``t1 * i == t1 * (i-1) + t1`` は真となります。(1)" +#: ../../library/datetime.rst:298 +msgid "In general, *t1* \\* i == *t1* \\* (i-1) + *t1* is true. (1)" +msgstr "一般的に、*t1* \\* i == *t1* \\* (i-1) + *t1* は真となります。(1)" -#: ../../library/datetime.rst:356 +#: ../../library/datetime.rst:301 msgid "``t1 = t2 * f or t1 = f * t2``" msgstr "``t1 = t2 * f`` または ``t1 = f * t2``" -#: ../../library/datetime.rst:356 +#: ../../library/datetime.rst:301 msgid "" "Delta multiplied by a float. The result is rounded to the nearest multiple " "of timedelta.resolution using round-half-to-even." @@ -656,22 +583,22 @@ msgstr "" "時間差と浮動小数点の積。結果は最近接偶数への丸めを利用して最も近い timedelta." "resolution の倍数に丸められます。" -#: ../../library/datetime.rst:360 +#: ../../library/datetime.rst:305 msgid "``f = t2 / t3``" msgstr "``f = t2 / t3``" -#: ../../library/datetime.rst:360 +#: ../../library/datetime.rst:305 msgid "" -"Division (3) of overall duration ``t2`` by interval unit ``t3``. Returns a :" +"Division (3) of overall duration *t2* by interval unit *t3*. Returns a :" "class:`float` object." msgstr "" -"``t2`` を ``t3`` で除算 (3) したもの。:class:`float` オブジェクトを返します。" +"*t2* を *t3* で除算 (3) したもの。:class:`float` オブジェクトを返します。" -#: ../../library/datetime.rst:364 +#: ../../library/datetime.rst:309 msgid "``t1 = t2 / f or t1 = t2 / i``" msgstr "``t1 = t2 / f`` または ``t1 = t2 / i``" -#: ../../library/datetime.rst:364 +#: ../../library/datetime.rst:309 msgid "" "Delta divided by a float or an int. The result is rounded to the nearest " "multiple of timedelta.resolution using round-half-to-even." @@ -679,11 +606,11 @@ msgstr "" "時間差を浮動小数点や整数で除したもの。結果は最近接偶数への丸めを利用して最も" "近い timedelta.resolution の倍数に丸められます。" -#: ../../library/datetime.rst:368 +#: ../../library/datetime.rst:313 msgid "``t1 = t2 // i`` or ``t1 = t2 // t3``" msgstr "``t1 = t2 // i`` または ``t1 = t2 // t3``" -#: ../../library/datetime.rst:368 +#: ../../library/datetime.rst:313 msgid "" "The floor is computed and the remainder (if any) is thrown away. In the " "second case, an integer is returned. (3)" @@ -691,59 +618,63 @@ msgstr "" "floor が計算され、余りは (もしあれば) 捨てられます。後者の場合、整数が返され" "ます。(3)" -#: ../../library/datetime.rst:372 +#: ../../library/datetime.rst:317 msgid "``t1 = t2 % t3``" msgstr "``t1 = t2 % t3``" -#: ../../library/datetime.rst:372 +#: ../../library/datetime.rst:317 msgid "The remainder is computed as a :class:`timedelta` object. (3)" msgstr "剰余が :class:`timedelta` オブジェクトとして計算されます。(3)" -#: ../../library/datetime.rst:375 +#: ../../library/datetime.rst:320 msgid "``q, r = divmod(t1, t2)``" msgstr "``q, r = divmod(t1, t2)``" -#: ../../library/datetime.rst:375 +#: ../../library/datetime.rst:320 msgid "" "Computes the quotient and the remainder: ``q = t1 // t2`` (3) and ``r = t1 % " -"t2``. ``q`` is an integer and ``r`` is a :class:`timedelta` object." +"t2``. q is an integer and r is a :class:`timedelta` object." msgstr "" +"商と剰余が計算されます: ``q = t1 // t2`` (3) と ``r = t1 % t2`` 。q は整数で " +"r は :class:`timedelta` オブジェクトです。" -#: ../../library/datetime.rst:380 +#: ../../library/datetime.rst:325 msgid "``+t1``" msgstr "``+t1``" -#: ../../library/datetime.rst:380 +#: ../../library/datetime.rst:325 msgid "Returns a :class:`timedelta` object with the same value. (2)" msgstr "同じ値を持つ :class:`timedelta` オブジェクトを返します。(2)" -#: ../../library/datetime.rst:383 +#: ../../library/datetime.rst:328 msgid "``-t1``" msgstr "``-t1``" -#: ../../library/datetime.rst:383 +#: ../../library/datetime.rst:328 msgid "" -"Equivalent to ``timedelta(-t1.days, -t1.seconds, -t1.microseconds)``, and to " -"``t1 * -1``. (1)(4)" +"equivalent to :class:`timedelta`\\ (-*t1.days*, -*t1.seconds*, -*t1." +"microseconds*), and to *t1*\\* -1. (1)(4)" msgstr "" +":class:`timedelta`\\ (-*t1.days*, -*t1.seconds*, -*t1.microseconds*)、および " +"*t1*\\* -1 と同じです。 (1)(4)" -#: ../../library/datetime.rst:387 +#: ../../library/datetime.rst:333 msgid "``abs(t)``" msgstr "``abs(t)``" -#: ../../library/datetime.rst:387 +#: ../../library/datetime.rst:333 msgid "" -"Equivalent to ``+t`` when ``t.days >= 0``, and to ``-t`` when ``t.days < " -"0``. (2)" +"equivalent to +\\ *t* when ``t.days >= 0``, and to -*t* when ``t.days < 0``. " +"(2)" msgstr "" -"``t.days >= 0`` のときには ``+t``, ``t.days < 0`` のときには ``-t`` となりま" +"``t.days >= 0`` のときには +\\ *t*, ``t.days < 0`` のときには -*t* となりま" "す。(2)" -#: ../../library/datetime.rst:390 +#: ../../library/datetime.rst:336 msgid "``str(t)``" msgstr "``str(t)``" -#: ../../library/datetime.rst:390 +#: ../../library/datetime.rst:336 msgid "" "Returns a string in the form ``[D day[s], ][H]H:MM:SS[.UUUUUU]``, where D is " "negative for negative ``t``. (5)" @@ -751,11 +682,11 @@ msgstr "" "``[D day[s], ][H]H:MM:SS[.UUUUUU]`` という形式の文字列を返します。``t`` が負" "の値の場合は ``D`` は負の値となります。(5)" -#: ../../library/datetime.rst:394 +#: ../../library/datetime.rst:340 msgid "``repr(t)``" msgstr "``repr(t)``" -#: ../../library/datetime.rst:394 +#: ../../library/datetime.rst:340 msgid "" "Returns a string representation of the :class:`timedelta` object as a " "constructor call with canonical attribute values." @@ -763,30 +694,30 @@ msgstr "" ":class:`timedelta` オブジェクトの文字列表現を返します。その文字列は、正規の属" "性値を持つコンストラクタ呼び出しのコードになっています。" -#: ../../library/datetime.rst:400 ../../library/datetime.rst:672 -#: ../../library/datetime.rst:2663 +#: ../../library/datetime.rst:346 ../../library/datetime.rst:593 +#: ../../library/datetime.rst:2472 msgid "Notes:" msgstr "注釈:" -#: ../../library/datetime.rst:403 +#: ../../library/datetime.rst:349 msgid "This is exact but may overflow." msgstr "この演算は正確ですが、オーバフローするかもしれません。" -#: ../../library/datetime.rst:406 +#: ../../library/datetime.rst:352 msgid "This is exact and cannot overflow." msgstr "この演算は正確であり、オーバフローし得ません。" -#: ../../library/datetime.rst:409 -msgid "Division by zero raises :exc:`ZeroDivisionError`." +#: ../../library/datetime.rst:355 +msgid "Division by 0 raises :exc:`ZeroDivisionError`." msgstr "0 による除算は :exc:`ZeroDivisionError` を送出します。" -#: ../../library/datetime.rst:412 -msgid "``-timedelta.max`` is not representable as a :class:`timedelta` object." +#: ../../library/datetime.rst:358 +msgid "-*timedelta.max* is not representable as a :class:`timedelta` object." msgstr "" -"``-timedelta.max`` は :class:`timedelta` オブジェクトで表現することができませ" +"-*timedelta.max* は :class:`timedelta` オブジェクトで表現することができませ" "ん。" -#: ../../library/datetime.rst:415 +#: ../../library/datetime.rst:361 msgid "" "String representations of :class:`timedelta` objects are normalized " "similarly to their internal representation. This leads to somewhat unusual " @@ -795,15 +726,7 @@ msgstr "" ":class:`timedelta` オブジェクトの文字列表現は内部表現に類似した形に正規化され" "ます。そのため負の timedelta は少し変な結果になります。例えば::" -#: ../../library/datetime.rst:419 -msgid "" -">>> timedelta(hours=-5)\n" -"datetime.timedelta(days=-1, seconds=68400)\n" -">>> print(_)\n" -"-1 day, 19:00:00" -msgstr "" - -#: ../../library/datetime.rst:425 +#: ../../library/datetime.rst:371 msgid "" "The expression ``t2 - t3`` will always be equal to the expression ``t2 + (-" "t3)`` except when t3 is equal to ``timedelta.max``; in that case the former " @@ -813,7 +736,7 @@ msgstr "" "t3)`` と同等です。t3 が ``timedelta.max`` の場合、前者の式は結果の値が出ます" "が、後者はオーバーフローを起こします。" -#: ../../library/datetime.rst:429 +#: ../../library/datetime.rst:375 msgid "" "In addition to the operations listed above, :class:`timedelta` objects " "support certain additions and subtractions with :class:`date` and :class:`." @@ -823,7 +746,7 @@ msgstr "" "び :class:`.datetime` オブジェクトとの間で加減算をサポートしています (下を参" "照してください)。" -#: ../../library/datetime.rst:433 +#: ../../library/datetime.rst:379 msgid "" "Floor division and true division of a :class:`timedelta` object by another :" "class:`timedelta` object are now supported, as are remainder operations and " @@ -835,11 +758,32 @@ msgstr "" "ようになりました。 :class:`timedelta` オブジェクトと :class:`float` オブジェ" "クトの真の除算と掛け算がサポートされるようになりました。" -#: ../../library/datetime.rst:439 -msgid ":class:`timedelta` objects support equality and order comparisons." -msgstr ":class:`timedelta` オブジェクトは等価性と順序の比較をサポートします。" +#: ../../library/datetime.rst:386 +msgid "" +"Comparisons of :class:`timedelta` objects are supported, with some caveats." +msgstr "" +":class:`timedelta` オブジェクトどうしの比較が、注意書き付きでサポートされまし" +"た。" + +#: ../../library/datetime.rst:388 +msgid "" +"The comparisons ``==`` or ``!=`` *always* return a :class:`bool`, no matter " +"the type of the compared object::" +msgstr "" +"``==`` および ``!=`` の比較は、比較されているオブジェクトの型が何であれ、 *常" +"に* :class:`bool` を返します::" + +#: ../../library/datetime.rst:399 +msgid "" +"For all other comparisons (such as ``<`` and ``>``), when a :class:" +"`timedelta` object is compared to an object of a different type, :exc:" +"`TypeError` is raised::" +msgstr "" +"(``<`` and ``>`` などの) それ以外の全ての比較で、 :class:`timedelta` オブジェ" +"クトを異なる型のオブジェクトと比較したときは :exc:`TypeError` が送出されま" +"す::" -#: ../../library/datetime.rst:441 +#: ../../library/datetime.rst:410 msgid "" "In Boolean contexts, a :class:`timedelta` object is considered to be true if " "and only if it isn't equal to ``timedelta(0)``." @@ -847,12 +791,12 @@ msgstr "" "ブール演算コンテキストでは、 :class:`timedelta` オブジェクトは " "``timedelta(0)`` に等しくない場合かつそのときに限り真となります。" -#: ../../library/datetime.rst:444 ../../library/datetime.rst:714 -#: ../../library/datetime.rst:1338 ../../library/datetime.rst:1956 +#: ../../library/datetime.rst:413 ../../library/datetime.rst:622 +#: ../../library/datetime.rst:1195 ../../library/datetime.rst:1783 msgid "Instance methods:" msgstr "インスタンスメソッド:" -#: ../../library/datetime.rst:448 +#: ../../library/datetime.rst:417 msgid "" "Return the total number of seconds contained in the duration. Equivalent to " "``td / timedelta(seconds=1)``. For interval units other than seconds, use " @@ -863,7 +807,7 @@ msgstr "" "秒以外の期間の単位では、直接に除算する形式 (例えば ``td / " "timedelta(microseconds=1)``) が使われます。" -#: ../../library/datetime.rst:452 +#: ../../library/datetime.rst:421 msgid "" "Note that for very large time intervals (greater than 270 years on most " "platforms) this method will lose microsecond accuracy." @@ -871,53 +815,23 @@ msgstr "" "非常に長い期間 (多くのプラットフォームでは270年以上) については、このメソッド" "はマイクロ秒の精度を失うことがあることに注意してください。" -#: ../../library/datetime.rst:458 +#: ../../library/datetime.rst:427 msgid "Examples of usage: :class:`timedelta`" msgstr "使用例: :class:`timedelta`" -#: ../../library/datetime.rst:460 +#: ../../library/datetime.rst:429 msgid "An additional example of normalization::" msgstr "正規化の追加の例です::" -#: ../../library/datetime.rst:462 -msgid "" -">>> # Components of another_year add up to exactly 365 days\n" -">>> from datetime import timedelta\n" -">>> year = timedelta(days=365)\n" -">>> another_year = timedelta(weeks=40, days=84, hours=23,\n" -"... minutes=50, seconds=600)\n" -">>> year == another_year\n" -"True\n" -">>> year.total_seconds()\n" -"31536000.0" -msgstr "" - -#: ../../library/datetime.rst:472 +#: ../../library/datetime.rst:441 msgid "Examples of :class:`timedelta` arithmetic::" msgstr ":class:`timedelta` の計算の例です::" -#: ../../library/datetime.rst:474 -msgid "" -">>> from datetime import timedelta\n" -">>> year = timedelta(days=365)\n" -">>> ten_years = 10 * year\n" -">>> ten_years\n" -"datetime.timedelta(days=3650)\n" -">>> ten_years.days // 365\n" -"10\n" -">>> nine_years = ten_years - year\n" -">>> nine_years\n" -"datetime.timedelta(days=3285)\n" -">>> three_years = nine_years // 3\n" -">>> three_years, three_years.days // 365\n" -"(datetime.timedelta(days=1095), 3)" -msgstr "" - -#: ../../library/datetime.rst:491 +#: ../../library/datetime.rst:460 msgid ":class:`date` Objects" msgstr ":class:`date` オブジェクト" -#: ../../library/datetime.rst:493 +#: ../../library/datetime.rst:462 msgid "" "A :class:`date` object represents a date (year, month and day) in an " "idealized calendar, the current Gregorian calendar indefinitely extended in " @@ -926,7 +840,7 @@ msgstr "" ":class:`date` オブジェクトは、両方向に無期限に拡張された現在のグレゴリオ暦と" "いう理想化された暦の日付 (年月日) を表します。" -#: ../../library/datetime.rst:497 +#: ../../library/datetime.rst:466 msgid "" "January 1 of year 1 is called day number 1, January 2 of year 1 is called " "day number 2, and so on. [#]_" @@ -934,7 +848,7 @@ msgstr "" "1 年 1 月 1 日は日番号 1、1 年 1 月 2 日は日番号 2 と呼ばれ、他も同様です。 " "[#]_" -#: ../../library/datetime.rst:502 +#: ../../library/datetime.rst:471 msgid "" "All arguments are required. Arguments must be integers, in the following " "ranges:" @@ -942,36 +856,36 @@ msgstr "" "全ての引数が必須です。\n" "引数は整数で、次の範囲に収まっていなければなりません:" -#: ../../library/datetime.rst:505 +#: ../../library/datetime.rst:474 msgid "``MINYEAR <= year <= MAXYEAR``" msgstr "``MINYEAR <= year <= MAXYEAR``" -#: ../../library/datetime.rst:506 +#: ../../library/datetime.rst:475 msgid "``1 <= month <= 12``" msgstr "``1 <= month <= 12``" -#: ../../library/datetime.rst:507 +#: ../../library/datetime.rst:476 msgid "``1 <= day <= number of days in the given month and year``" msgstr "``1 <= day <= 指定された月と年における日数``" -#: ../../library/datetime.rst:509 ../../library/datetime.rst:932 +#: ../../library/datetime.rst:478 ../../library/datetime.rst:840 msgid "" "If an argument outside those ranges is given, :exc:`ValueError` is raised." msgstr "範囲を超えた引数を与えた場合、 :exc:`ValueError` が送出されます。" -#: ../../library/datetime.rst:512 ../../library/datetime.rst:937 +#: ../../library/datetime.rst:481 ../../library/datetime.rst:845 msgid "Other constructors, all class methods:" msgstr "他のコンストラクタ、および全てのクラスメソッドを以下に示します:" -#: ../../library/datetime.rst:516 +#: ../../library/datetime.rst:485 msgid "Return the current local date." msgstr "現在のローカルな日付を返します。" -#: ../../library/datetime.rst:518 +#: ../../library/datetime.rst:487 msgid "This is equivalent to ``date.fromtimestamp(time.time())``." msgstr "``date.fromtimestamp(time.time())`` と等価です。" -#: ../../library/datetime.rst:522 +#: ../../library/datetime.rst:491 msgid "" "Return the local date corresponding to the POSIX timestamp, such as is " "returned by :func:`time.time`." @@ -979,7 +893,7 @@ msgstr "" ":func:`time.time` で返されるような POSIX タイムスタンプに対応するローカルな日" "付を返します。" -#: ../../library/datetime.rst:525 +#: ../../library/datetime.rst:494 msgid "" "This may raise :exc:`OverflowError`, if the timestamp is out of the range of " "values supported by the platform C :c:func:`localtime` function, and :exc:" @@ -995,7 +909,7 @@ msgstr "" "イムスタンプの表記にうるう秒を含める非 POSIX なシステムでは、うるう秒は :" "meth:`fromtimestamp` では無視されます。" -#: ../../library/datetime.rst:532 +#: ../../library/datetime.rst:501 msgid "" "Raise :exc:`OverflowError` instead of :exc:`ValueError` if the timestamp is " "out of the range of values supported by the platform C :c:func:`localtime` " @@ -1007,7 +921,7 @@ msgstr "" "出するようになりました。 :c:func:`localtime` の呼び出し失敗で :exc:" "`ValueError` ではなく :exc:`OSError` を送出するようになりました。" -#: ../../library/datetime.rst:541 +#: ../../library/datetime.rst:510 msgid "" "Return the date corresponding to the proleptic Gregorian ordinal, where " "January 1 of year 1 has ordinal 1." @@ -1015,57 +929,32 @@ msgstr "" "先発グレゴリオ暦による序数に対応する日付を返します。\n" "1 年 1 月 1 日が序数 1 となります。" -#: ../../library/datetime.rst:544 +#: ../../library/datetime.rst:513 msgid "" ":exc:`ValueError` is raised unless ``1 <= ordinal <= date.max.toordinal()``. " -"For any date ``d``, ``date.fromordinal(d.toordinal()) == d``." +"For any date *d*, ``date.fromordinal(d.toordinal()) == d``." msgstr "" +"``1 <= ordinal <= date.max.toordinal()`` でない場合、 :exc:`ValueError` が送" +"出されます。\n" +"任意の日付 *d* に対し、 ``date.fromordinal(d.toordinal()) == d`` となります。" -#: ../../library/datetime.rst:551 +#: ../../library/datetime.rst:520 msgid "" -"Return a :class:`date` corresponding to a *date_string* given in any valid " -"ISO 8601 format, with the following exceptions:" +"Return a :class:`date` corresponding to a *date_string* given in the format " +"``YYYY-MM-DD``::" msgstr "" -"以下の例外を除く、有効な ISO 8601 フォーマットで与えられた *date_string* に対" -"応する :class:`date` を返します :" - -#: ../../library/datetime.rst:554 ../../library/datetime.rst:1097 -msgid "" -"Reduced precision dates are not currently supported (``YYYY-MM``, ``YYYY``)." -msgstr "精度の低い日付は現在サポートされていません(``YYYY-MM``, ``YYYY``)。" - -#: ../../library/datetime.rst:556 ../../library/datetime.rst:1099 -msgid "" -"Extended date representations are not currently supported (``±YYYYYY-MM-" -"DD``)." -msgstr "拡張された日付表現は現在サポートされていません(``±YYYYYY-MM-DD``)。" - -#: ../../library/datetime.rst:558 ../../library/datetime.rst:1101 -msgid "Ordinal dates are not currently supported (``YYYY-OOO``)." -msgstr "序数の日付は現在サポートされていません(``YYYY-OOO``)。" - -#: ../../library/datetime.rst:560 ../../library/datetime.rst:1103 -#: ../../library/datetime.rst:1569 -msgid "Examples::" -msgstr "例::" +"``YYYY-MM-DD`` という書式で与えられた *date_string* に対応する :class:`date` " +"を返します ::" -#: ../../library/datetime.rst:562 +#: ../../library/datetime.rst:527 msgid "" -">>> from datetime import date\n" -">>> date.fromisoformat('2019-12-04')\n" -"datetime.date(2019, 12, 4)\n" -">>> date.fromisoformat('20191204')\n" -"datetime.date(2019, 12, 4)\n" -">>> date.fromisoformat('2021-W01-1')\n" -"datetime.date(2021, 1, 4)" +"This is the inverse of :meth:`date.isoformat`. It only supports the format " +"``YYYY-MM-DD``." msgstr "" +"この関数は :meth:`date.isoformat` の逆関数です。\n" +"``YYYY-MM-DD`` という書式のみをサポートしています。" -#: ../../library/datetime.rst:571 -msgid "Previously, this method only supported the format ``YYYY-MM-DD``." -msgstr "" -"以前はこのメソッドは ``YYYY-MM-DD`` フォーマットのみをサポートしていました。" - -#: ../../library/datetime.rst:576 +#: ../../library/datetime.rst:535 msgid "" "Return a :class:`date` corresponding to the ISO calendar date specified by " "year, week and day. This is the inverse of the function :meth:`date." @@ -1074,128 +963,70 @@ msgstr "" "年月日で指定された ISO 暦の日付に対応する :class:`date` を返します。\n" "この関数は :meth:`date.isocalendar` 関数の逆関数です。" -#: ../../library/datetime.rst:583 -msgid "" -"Return a :class:`.date` corresponding to *date_string*, parsed according to " -"*format*. This is equivalent to::" -msgstr "" - -#: ../../library/datetime.rst:586 -msgid "date(*(time.strptime(date_string, format)[0:3]))" -msgstr "" - -#: ../../library/datetime.rst:588 -msgid "" -":exc:`ValueError` is raised if the date_string and format can't be parsed " -"by :func:`time.strptime` or if it returns a value which isn't a time tuple. " -"See also :ref:`strftime-strptime-behavior` and :meth:`date.fromisoformat`." -msgstr "" - -#: ../../library/datetime.rst:595 -msgid "" -"If *format* specifies a day of month without a year a :exc:" -"`DeprecationWarning` is emitted. This is to avoid a quadrennial leap year " -"bug in code seeking to parse only a month and day as the default year used " -"in absence of one in the format is not a leap year. Such *format* values may " -"raise an error as of Python 3.15. The workaround is to always include a " -"year in your *format*. If parsing *date_string* values that do not have a " -"year, explicitly add a year that is a leap year before parsing:" -msgstr "" - -#: ../../library/datetime.rst:604 -msgid "" -">>> from datetime import date\n" -">>> date_string = \"02/29\"\n" -">>> when = date.strptime(f\"{date_string};1984\", \"%m/%d;%Y\") # Avoids " -"leap year bug.\n" -">>> when.strftime(\"%B %d\")\n" -"'February 29'" -msgstr "" - -#: ../../library/datetime.rst:619 +#: ../../library/datetime.rst:545 msgid "The earliest representable date, ``date(MINYEAR, 1, 1)``." msgstr "表現できる最も古い日付で、``date(MINYEAR, 1, 1)`` です。" -#: ../../library/datetime.rst:624 +#: ../../library/datetime.rst:550 msgid "The latest representable date, ``date(MAXYEAR, 12, 31)``." msgstr "表現できる最も新しい日付で、``date(MAXYEAR, 12, 31)`` です。" -#: ../../library/datetime.rst:629 +#: ../../library/datetime.rst:555 msgid "" "The smallest possible difference between non-equal date objects, " "``timedelta(days=1)``." msgstr "等しくない日付オブジェクト間の最小の差で、``timedelta(days=1)`` です。" -#: ../../library/datetime.rst:637 ../../library/datetime.rst:1199 +#: ../../library/datetime.rst:563 ../../library/datetime.rst:1072 msgid "Between :const:`MINYEAR` and :const:`MAXYEAR` inclusive." msgstr "両端値を含む :const:`MINYEAR` から :const:`MAXYEAR` までの値です。" -#: ../../library/datetime.rst:642 ../../library/datetime.rst:1204 +#: ../../library/datetime.rst:568 ../../library/datetime.rst:1077 msgid "Between 1 and 12 inclusive." msgstr "両端値を含む 1 から 12 までの値です。" -#: ../../library/datetime.rst:647 ../../library/datetime.rst:1209 +#: ../../library/datetime.rst:573 ../../library/datetime.rst:1082 msgid "Between 1 and the number of days in the given month of the given year." msgstr "1 から与えられた月と年における日数までの値です。" -#: ../../library/datetime.rst:655 +#: ../../library/datetime.rst:581 msgid "``date2 = date1 + timedelta``" msgstr "``date2 = date1 + timedelta``" -#: ../../library/datetime.rst:655 -msgid "``date2`` will be ``timedelta.days`` days after ``date1``. (1)" -msgstr "``date2`` は ``date1`` の ``timedelta.days`` 日後になります。(1)" +#: ../../library/datetime.rst:581 +msgid "*date2* is ``timedelta.days`` days removed from *date1*. (1)" +msgstr "*date2* は *date1* から ``timedelta.days`` 日だけ移動した日付です。(1)" -#: ../../library/datetime.rst:658 +#: ../../library/datetime.rst:584 msgid "``date2 = date1 - timedelta``" msgstr "``date2 = date1 - timedelta``" -#: ../../library/datetime.rst:658 -msgid "Computes ``date2`` such that ``date2 + timedelta == date1``. (2)" +#: ../../library/datetime.rst:584 +msgid "Computes *date2* such that ``date2 + timedelta == date1``. (2)" msgstr "" -"``date2 + timedelta == date1`` であるような日付 ``date2`` を計算します。(2)" +"``date2 + timedelta == date1`` であるような日付 *date2* を計算します。(2)" -#: ../../library/datetime.rst:661 +#: ../../library/datetime.rst:587 msgid "``timedelta = date1 - date2``" msgstr "``timedelta = date1 - date2``" -#: ../../library/datetime.rst:661 ../../library/datetime.rst:1257 +#: ../../library/datetime.rst:587 ../../library/datetime.rst:1130 msgid "\\(3)" msgstr "\\(3)" -#: ../../library/datetime.rst:0 -msgid "``date1 == date2``" -msgstr "``date1 == date2``" - -#: ../../library/datetime.rst:0 -msgid "``date1 != date2``" -msgstr "``date1 != date2``" - -#: ../../library/datetime.rst:663 ../../library/datetime.rst:1259 -msgid "Equality comparison. (4)" -msgstr "等価性の比較。(4)" - -#: ../../library/datetime.rst:0 +#: ../../library/datetime.rst:589 msgid "``date1 < date2``" msgstr "``date1 < date2``" -#: ../../library/datetime.rst:0 -msgid "``date1 > date2``" -msgstr "``date1 > date2``" - -#: ../../library/datetime.rst:0 -msgid "``date1 <= date2``" -msgstr "``date1 <= date2``" - -#: ../../library/datetime.rst:0 -msgid "``date1 >= date2``" -msgstr "``date1 >= date2``" - -#: ../../library/datetime.rst:666 ../../library/datetime.rst:1262 -msgid "Order comparison. (5)" -msgstr "順序の比較。(5)" +#: ../../library/datetime.rst:589 +msgid "" +"*date1* is considered less than *date2* when *date1* precedes *date2* in " +"time. (4)" +msgstr "" +"*date1* が時刻として *date2* よりも前を表す場合に、*date1* は *date2* よりも" +"小さいと見なされます。(4)" -#: ../../library/datetime.rst:675 +#: ../../library/datetime.rst:596 msgid "" "*date2* is moved forward in time if ``timedelta.days > 0``, or backward if " "``timedelta.days < 0``. Afterward ``date2 - date1 == timedelta.days``. " @@ -1210,122 +1041,96 @@ msgstr "" "``date2.year`` が :const:`MINYEAR` になってしまったり、 :const:`MAXYEAR` より" "大きくなってしまう場合には :exc:`OverflowError` が送出されます。" -#: ../../library/datetime.rst:682 +#: ../../library/datetime.rst:603 msgid "``timedelta.seconds`` and ``timedelta.microseconds`` are ignored." msgstr "``timedelta.seconds`` と ``timedelta.microseconds`` は無視されます。" -#: ../../library/datetime.rst:685 -msgid "" -"This is exact, and cannot overflow. ``timedelta.seconds`` and ``timedelta." -"microseconds`` are 0, and ``date2 + timedelta == date1`` after." -msgstr "" -"この演算は厳密で、オーバフローしません。``timedelta.seconds`` および " -"``timedelta.microseconds`` は 0 で、演算後には ``date2 + timedelta == " -"date1`` となります。" - -#: ../../library/datetime.rst:689 -msgid ":class:`date` objects are equal if they represent the same date." -msgstr "同じ日を表す :class:`date` オブジェクトは等しいです。" - -#: ../../library/datetime.rst:691 -msgid "" -":class:`!date` objects that are not also :class:`.datetime` instances are " -"never equal to :class:`!datetime` objects, even if they represent the same " -"date." -msgstr "" -":class:`.datetime` のインスタンスではない :class:`!date` オブジェクトは、同じ" -"日を表していても、:class:`!datetime` オブジェクトとは決して等価にはなりませ" -"ん。" - -#: ../../library/datetime.rst:696 -msgid "" -"*date1* is considered less than *date2* when *date1* precedes *date2* in " -"time. In other words, ``date1 < date2`` if and only if ``date1.toordinal() < " -"date2.toordinal()``." -msgstr "" - -#: ../../library/datetime.rst:700 -msgid "" -"Order comparison between a :class:`!date` object that is not also a :class:`." -"datetime` instance and a :class:`!datetime` object raises :exc:`TypeError`." -msgstr "" - -#: ../../library/datetime.rst:704 ../../library/datetime.rst:1330 -msgid "" -"Comparison between :class:`.datetime` object and an instance of the :class:" -"`date` subclass that is not a :class:`!datetime` subclass no longer converts " -"the latter to :class:`!date`, ignoring the time part and the time zone. The " -"default behavior can be changed by overriding the special comparison methods " -"in subclasses." -msgstr "" - -#: ../../library/datetime.rst:712 +#: ../../library/datetime.rst:606 +msgid "" +"This is exact, and cannot overflow. timedelta.seconds and timedelta." +"microseconds are 0, and date2 + timedelta == date1 after." +msgstr "" +"この演算は厳密で、オーバフローしません。timedelta.seconds および timedelta." +"microseconds は 0 で、演算後には date2 + timedelta == date1 となります。" + +#: ../../library/datetime.rst:610 +msgid "" +"In other words, ``date1 < date2`` if and only if ``date1.toordinal() < date2." +"toordinal()``. Date comparison raises :exc:`TypeError` if the other " +"comparand isn't also a :class:`date` object. However, ``NotImplemented`` is " +"returned instead if the other comparand has a :meth:`timetuple` attribute. " +"This hook gives other kinds of date objects a chance at implementing mixed-" +"type comparison. If not, when a :class:`date` object is compared to an " +"object of a different type, :exc:`TypeError` is raised unless the comparison " +"is ``==`` or ``!=``. The latter cases return :const:`False` or :const:" +"`True`, respectively." +msgstr "" +"言い換えると、 ``date1 < date2`` は ``date1.toordinal() < date2." +"toordinal()`` と同等です。\n" +"日付の比較は、比較相手が :class:`date` オブジェクトでない場合には、 :exc:" +"`TypeError` を送出します。\n" +"ただし、 比較相手に :meth:`timetuple` 属性がある場合は、 ``NotImplemented`` " +"が代わりに送出されます。\n" +"このフックによって、他の種類の日付オブジェクトに、違う型どうしの比較処理を実" +"装できる可能性が生まれます。\n" +"相手が :meth:`timetuple` 属性を持っていない場合に :class:`date` と違う型のオ" +"ブジェクトと比較すると、 ``==`` または ``!=`` の比較でない限り :exc:" +"`TypeError` が送出されます。\n" +"後者の場合では、それぞれ :const:`False` および :const:`True` が返されます。" + +#: ../../library/datetime.rst:620 msgid "" "In Boolean contexts, all :class:`date` objects are considered to be true." msgstr "" "ブール演算コンテキストでは、全ての :class:`.time` オブジェクトは真とみなされ" "ます。" -#: ../../library/datetime.rst:718 +#: ../../library/datetime.rst:626 msgid "" -"Return a new :class:`date` object with the same values, but with specified " -"parameters updated." +"Return a date with the same value, except for those parameters given new " +"values by whichever keyword arguments are specified." msgstr "" +"キーワード引数で指定されたパラメータが置き換えられることを除き、同じ値を持" +"つ :class:`date` オブジェクトを返します。" -#: ../../library/datetime.rst:721 ../../library/datetime.rst:2002 +#: ../../library/datetime.rst:629 ../../library/datetime.rst:1826 msgid "Example::" msgstr "以下はプログラム例です::" -#: ../../library/datetime.rst:723 -msgid "" -">>> from datetime import date\n" -">>> d = date(2002, 12, 31)\n" -">>> d.replace(day=26)\n" -"datetime.date(2002, 12, 26)" -msgstr "" - -#: ../../library/datetime.rst:728 -msgid "" -"The generic function :func:`copy.replace` also supports :class:`date` " -"objects." -msgstr "" - -#: ../../library/datetime.rst:734 ../../library/datetime.rst:1454 +#: ../../library/datetime.rst:639 ../../library/datetime.rst:1308 msgid "" "Return a :class:`time.struct_time` such as returned by :func:`time." "localtime`." msgstr "" ":func:`time.localtime` が返すような :class:`time.struct_time` を返します。" -#: ../../library/datetime.rst:736 +#: ../../library/datetime.rst:641 msgid "The hours, minutes and seconds are 0, and the DST flag is -1." msgstr "時分秒が 0 で、 DST フラグが -1 です。" -#: ../../library/datetime.rst:738 ../../library/datetime.rst:1456 +#: ../../library/datetime.rst:643 ../../library/datetime.rst:1310 msgid "``d.timetuple()`` is equivalent to::" msgstr "``d.timetuple()`` は次の式と等価です::" -#: ../../library/datetime.rst:740 -msgid "" -"time.struct_time((d.year, d.month, d.day, 0, 0, 0, d.weekday(), yday, -1))" -msgstr "" - -#: ../../library/datetime.rst:742 +#: ../../library/datetime.rst:647 msgid "" "where ``yday = d.toordinal() - date(d.year, 1, 1).toordinal() + 1`` is the " -"day number within the current year starting with 1 for January 1st." +"day number within the current year starting with ``1`` for January 1st." msgstr "" "ここで、 ``yday = d.toordinal() - date(d.year, 1, 1).toordinal() + 1`` は本年" -"の 1 月 1 日を 1 としたときの日付番号です。" +"の 1 月 1 日を ``1`` としたときの日付番号です。" -#: ../../library/datetime.rst:748 +#: ../../library/datetime.rst:653 msgid "" "Return the proleptic Gregorian ordinal of the date, where January 1 of year " -"1 has ordinal 1. For any :class:`date` object ``d``, ``date.fromordinal(d." +"1 has ordinal 1. For any :class:`date` object *d*, ``date.fromordinal(d." "toordinal()) == d``." msgstr "" +"先発グレゴリオ暦における日付序数を返します。 1 年の 1 月 1 日が序数 1 となり" +"ます。任意の :class:`date` オブジェクト *d* について、 ``date.fromordinal(d." +"toordinal()) == d`` となります。" -#: ../../library/datetime.rst:755 +#: ../../library/datetime.rst:660 msgid "" "Return the day of the week as an integer, where Monday is 0 and Sunday is 6. " "For example, ``date(2002, 12, 4).weekday() == 2``, a Wednesday. See also :" @@ -1335,7 +1140,7 @@ msgstr "" "12, 4).weekday() == 2`` であり、水曜日を示します。 :meth:`isoweekday` も参照" "してください。" -#: ../../library/datetime.rst:762 +#: ../../library/datetime.rst:667 msgid "" "Return the day of the week as an integer, where Monday is 1 and Sunday is 7. " "For example, ``date(2002, 12, 4).isoweekday() == 3``, a Wednesday. See also :" @@ -1345,7 +1150,7 @@ msgstr "" "12, 4).isoweekday() == 3`` であり、水曜日を示します。 :meth:`weekday`, :meth:" "`isocalendar` も参照してください。" -#: ../../library/datetime.rst:769 +#: ../../library/datetime.rst:674 msgid "" "Return a :term:`named tuple` object with three components: ``year``, " "``week`` and ``weekday``." @@ -1353,12 +1158,12 @@ msgstr "" "``year``、``week``、``weekday`` の3つで構成された :term:`named tuple` を返し" "ます。" -#: ../../library/datetime.rst:772 +#: ../../library/datetime.rst:677 msgid "" "The ISO calendar is a widely used variant of the Gregorian calendar. [#]_" msgstr "ISO 暦はグレゴリオ暦の変種として広く用いられています。 [#]_" -#: ../../library/datetime.rst:774 +#: ../../library/datetime.rst:679 msgid "" "The ISO year consists of 52 or 53 full weeks, and where a week starts on a " "Monday and ends on a Sunday. The first week of an ISO year is the first " @@ -1371,7 +1176,7 @@ msgstr "" "オ暦での) 週となります。この週は週番号 1 と呼ばれ、この木曜日での ISO 年はグ" "レゴリオ暦における年と等しくなります。" -#: ../../library/datetime.rst:779 +#: ../../library/datetime.rst:684 msgid "" "For example, 2004 begins on a Thursday, so the first week of ISO year 2004 " "begins on Monday, 29 Dec 2003 and ends on Sunday, 4 Jan 2004::" @@ -1379,55 +1184,34 @@ msgstr "" "例えば、2004 年は木曜日から始まるため、ISO 年の最初の週は 2003 年 12 月 29 " "日、月曜日から始まり、2004 年 1 月 4 日、日曜日に終わります ::" -#: ../../library/datetime.rst:782 -msgid "" -">>> from datetime import date\n" -">>> date(2003, 12, 29).isocalendar()\n" -"datetime.IsoCalendarDate(year=2004, week=1, weekday=1)\n" -">>> date(2004, 1, 4).isocalendar()\n" -"datetime.IsoCalendarDate(year=2004, week=1, weekday=7)" -msgstr "" - -#: ../../library/datetime.rst:788 +#: ../../library/datetime.rst:693 msgid "Result changed from a tuple to a :term:`named tuple`." msgstr "結果が タプル から :term:`named tuple` へ変更されました。" -#: ../../library/datetime.rst:793 +#: ../../library/datetime.rst:698 msgid "" "Return a string representing the date in ISO 8601 format, ``YYYY-MM-DD``::" msgstr "日付を ISO 8601 書式の ``YYYY-MM-DD`` で表した文字列を返します::" -#: ../../library/datetime.rst:795 -msgid "" -">>> from datetime import date\n" -">>> date(2002, 12, 4).isoformat()\n" -"'2002-12-04'" -msgstr "" +#: ../../library/datetime.rst:704 +msgid "This is the inverse of :meth:`date.fromisoformat`." +msgstr "この関数は :meth:`date.fromisoformat` の逆関数です。" -#: ../../library/datetime.rst:801 -msgid "For a date ``d``, ``str(d)`` is equivalent to ``d.isoformat()``." +#: ../../library/datetime.rst:708 +msgid "For a date *d*, ``str(d)`` is equivalent to ``d.isoformat()``." msgstr "" +":class:`date` オブジェクト *d* において、``str(d)`` は ``d.isoformat()`` と等" +"価です。" -#: ../../library/datetime.rst:806 +#: ../../library/datetime.rst:713 msgid "Return a string representing the date::" msgstr "日付を表す文字列を返します::" -#: ../../library/datetime.rst:808 -msgid "" -">>> from datetime import date\n" -">>> date(2002, 12, 4).ctime()\n" -"'Wed Dec 4 00:00:00 2002'" -msgstr "" - -#: ../../library/datetime.rst:812 ../../library/datetime.rst:1640 +#: ../../library/datetime.rst:719 ../../library/datetime.rst:1494 msgid "``d.ctime()`` is equivalent to::" msgstr "``d.ctime()`` は次の式と等価です::" -#: ../../library/datetime.rst:814 ../../library/datetime.rst:1642 -msgid "time.ctime(time.mktime(d.timetuple()))" -msgstr "" - -#: ../../library/datetime.rst:816 +#: ../../library/datetime.rst:723 msgid "" "on platforms where the native C :c:func:`ctime` function (which :func:`time." "ctime` invokes, but which :meth:`date.ctime` does not invoke) conforms to " @@ -1437,113 +1221,49 @@ msgstr "" "に呼び出されない) ネイティブの C 関数 :c:func:`ctime` が C 標準に準拠している" "プラットフォーム上でです。" -#: ../../library/datetime.rst:823 +#: ../../library/datetime.rst:730 msgid "" "Return a string representing the date, controlled by an explicit format " "string. Format codes referring to hours, minutes or seconds will see 0 " -"values. See also :ref:`strftime-strptime-behavior` and :meth:`date." -"isoformat`." +"values. For a complete list of formatting directives, see :ref:`strftime-" +"strptime-behavior`." msgstr "" "明示的な書式文字列で制御された、日付を表現する文字列を返します。\n" "時間、分、秒を表す書式コードは値 0 になります。\n" -":ref:`strftime-strptime-behavior` および :meth:`date.isoformat` も参照してく" -"ださい。" +"完全な書式化指定子のリストについては :ref:`strftime-strptime-behavior` を参照" +"してください。" -#: ../../library/datetime.rst:830 +#: ../../library/datetime.rst:738 msgid "" "Same as :meth:`.date.strftime`. This makes it possible to specify a format " "string for a :class:`.date` object in :ref:`formatted string literals ` and when using :meth:`str.format`. See also :ref:`strftime-" -"strptime-behavior` and :meth:`date.isoformat`." +"strings>` and when using :meth:`str.format`. For a complete list of " +"formatting directives, see :ref:`strftime-strptime-behavior`." msgstr "" ":meth:`date.strftime` と等価です。\n" "これにより、 :ref:`フォーマット済み文字列リテラル ` の中や :meth:" "`str.format` を使っているときに :class:`.date` オブジェクトの書式文字列を指定" "できます。\n" -":ref:`strftime-strptime-behavior` および :meth:`date.isoformat` も参照してく" -"ださい。" +"書式化コードの完全なリストについては :ref:`strftime-strptime-behavior` を参照" +"してください。" -#: ../../library/datetime.rst:836 +#: ../../library/datetime.rst:745 msgid "Examples of Usage: :class:`date`" msgstr "使用例: :class:`date`" -#: ../../library/datetime.rst:838 +#: ../../library/datetime.rst:747 msgid "Example of counting days to an event::" msgstr "イベントまでの日数を数える例を示します::" -#: ../../library/datetime.rst:840 -msgid "" -">>> import time\n" -">>> from datetime import date\n" -">>> today = date.today()\n" -">>> today\n" -"datetime.date(2007, 12, 5)\n" -">>> today == date.fromtimestamp(time.time())\n" -"True\n" -">>> my_birthday = date(today.year, 6, 24)\n" -">>> if my_birthday < today:\n" -"... my_birthday = my_birthday.replace(year=today.year + 1)\n" -"...\n" -">>> my_birthday\n" -"datetime.date(2008, 6, 24)\n" -">>> time_to_birthday = abs(my_birthday - today)\n" -">>> time_to_birthday.days\n" -"202" -msgstr "" - -#: ../../library/datetime.rst:857 +#: ../../library/datetime.rst:765 msgid "More examples of working with :class:`date`:" msgstr "さらなる :class:`date` を使う例:" -#: ../../library/datetime.rst:859 -msgid "" -">>> from datetime import date\n" -">>> d = date.fromordinal(730920) # 730920th day after 1. 1. 0001\n" -">>> d\n" -"datetime.date(2002, 3, 11)\n" -"\n" -">>> # Methods related to formatting string output\n" -">>> d.isoformat()\n" -"'2002-03-11'\n" -">>> d.strftime(\"%d/%m/%y\")\n" -"'11/03/02'\n" -">>> d.strftime(\"%A %d. %B %Y\")\n" -"'Monday 11. March 2002'\n" -">>> d.ctime()\n" -"'Mon Mar 11 00:00:00 2002'\n" -">>> 'The {1} is {0:%d}, the {2} is {0:%B}.'.format(d, \"day\", \"month\")\n" -"'The day is 11, the month is March.'\n" -"\n" -">>> # Methods for to extracting 'components' under different calendars\n" -">>> t = d.timetuple()\n" -">>> for i in t:\n" -"... print(i)\n" -"2002 # year\n" -"3 # month\n" -"11 # day\n" -"0\n" -"0\n" -"0\n" -"0 # weekday (0 = Monday)\n" -"70 # 70th day in the year\n" -"-1\n" -">>> ic = d.isocalendar()\n" -">>> for i in ic:\n" -"... print(i)\n" -"2002 # ISO year\n" -"11 # ISO week number\n" -"1 # ISO day number ( 1 = Monday )\n" -"\n" -">>> # A date object is immutable; all operations produce a new object\n" -">>> d.replace(year=2005)\n" -"datetime.date(2005, 3, 11)" -msgstr "" - -#: ../../library/datetime.rst:906 +#: ../../library/datetime.rst:814 msgid ":class:`.datetime` Objects" msgstr ":class:`.datetime` オブジェクト" -#: ../../library/datetime.rst:908 +#: ../../library/datetime.rst:816 msgid "" "A :class:`.datetime` object is a single object containing all the " "information from a :class:`date` object and a :class:`.time` object." @@ -1551,7 +1271,7 @@ msgstr "" ":class:`.datetime` オブジェクトは :class:`date` オブジェクトおよび :class:`." "time` オブジェクトの全ての情報が入っている単一のオブジェクトです。" -#: ../../library/datetime.rst:911 +#: ../../library/datetime.rst:819 msgid "" "Like a :class:`date` object, :class:`.datetime` assumes the current " "Gregorian calendar extended in both directions; like a :class:`.time` " @@ -1562,11 +1282,11 @@ msgstr "" "が両方向に延長されているものと仮定します。また、 :class:`.time` オブジェクト" "と同様に、 :class:`.datetime` は毎日が厳密に 3600\\*24 秒であると仮定します。" -#: ../../library/datetime.rst:915 +#: ../../library/datetime.rst:823 msgid "Constructor:" msgstr "以下にコンストラクタを示します:" -#: ../../library/datetime.rst:919 +#: ../../library/datetime.rst:827 msgid "" "The *year*, *month* and *day* arguments are required. *tzinfo* may be " "``None``, or an instance of a :class:`tzinfo` subclass. The remaining " @@ -1576,72 +1296,67 @@ msgstr "" "*tzinfo* は ``None`` または :class:`tzinfo` サブクラスのインスタンスです。\n" "残りの引数は次の範囲の整数でなければなりません:" -#: ../../library/datetime.rst:923 +#: ../../library/datetime.rst:831 msgid "``MINYEAR <= year <= MAXYEAR``," msgstr "``MINYEAR <= year <= MAXYEAR``," -#: ../../library/datetime.rst:924 +#: ../../library/datetime.rst:832 msgid "``1 <= month <= 12``," msgstr "``1 <= month <= 12``," -#: ../../library/datetime.rst:925 +#: ../../library/datetime.rst:833 msgid "``1 <= day <= number of days in the given month and year``," msgstr "``1 <= day <= 指定された月と年における日数``," -#: ../../library/datetime.rst:926 ../../library/datetime.rst:1804 +#: ../../library/datetime.rst:834 ../../library/datetime.rst:1657 msgid "``0 <= hour < 24``," msgstr "``0 <= hour < 24``," -#: ../../library/datetime.rst:927 ../../library/datetime.rst:1805 +#: ../../library/datetime.rst:835 ../../library/datetime.rst:1658 msgid "``0 <= minute < 60``," msgstr "``0 <= minute < 60``," -#: ../../library/datetime.rst:928 ../../library/datetime.rst:1806 +#: ../../library/datetime.rst:836 ../../library/datetime.rst:1659 msgid "``0 <= second < 60``," msgstr "``0 <= second < 60``," -#: ../../library/datetime.rst:929 ../../library/datetime.rst:1807 +#: ../../library/datetime.rst:837 ../../library/datetime.rst:1660 msgid "``0 <= microsecond < 1000000``," msgstr "``0 <= microsecond < 1000000``," -#: ../../library/datetime.rst:930 ../../library/datetime.rst:1808 +#: ../../library/datetime.rst:838 ../../library/datetime.rst:1661 msgid "``fold in [0, 1]``." msgstr "``fold in [0, 1]``." -#: ../../library/datetime.rst:934 ../../library/datetime.rst:1375 -#: ../../library/datetime.rst:1969 -msgid "Added the *fold* parameter." -msgstr "*fold* パラメータが追加されました。" +#: ../../library/datetime.rst:842 ../../library/datetime.rst:1229 +#: ../../library/datetime.rst:1793 +msgid "Added the ``fold`` argument." +msgstr "``fold`` 引数が追加されました。" -#: ../../library/datetime.rst:941 -msgid "Return the current local date and time, with :attr:`.tzinfo` ``None``." -msgstr "" -":attr:`tzinfo` が ``None`` である現在のローカルの日付および時刻を返します。" +#: ../../library/datetime.rst:849 +msgid "Return the current local datetime, with :attr:`.tzinfo` ``None``." +msgstr ":attr:`.tzinfo` を ``None`` にして、現在のローカルな日時を返します。" -#: ../../library/datetime.rst:943 +#: ../../library/datetime.rst:851 msgid "Equivalent to::" msgstr "次と等価です::" -#: ../../library/datetime.rst:945 -msgid "datetime.fromtimestamp(time.time())" -msgstr "" - -#: ../../library/datetime.rst:947 +#: ../../library/datetime.rst:855 msgid "See also :meth:`now`, :meth:`fromtimestamp`." msgstr ":meth:`now`, :meth:`fromtimestamp` も参照してください。" -#: ../../library/datetime.rst:949 +#: ../../library/datetime.rst:857 msgid "" "This method is functionally equivalent to :meth:`now`, but without a ``tz`` " "parameter." msgstr "" "このメソッドの機能は :meth:`now` と等価ですが、 ``tz`` 引数はありません。" -#: ../../library/datetime.rst:954 +#: ../../library/datetime.rst:862 msgid "Return the current local date and time." msgstr "現在のローカルな日時を返します。" -#: ../../library/datetime.rst:956 +#: ../../library/datetime.rst:864 msgid "" "If optional argument *tz* is ``None`` or not specified, this is like :meth:" "`today`, but, if possible, supplies more precision than can be gotten from " @@ -1654,7 +1369,7 @@ msgstr "" "フォームが C 関数 :c:func:`gettimeofday` をサポートする場合には可能なことが" "あります)。" -#: ../../library/datetime.rst:962 +#: ../../library/datetime.rst:870 msgid "" "If *tz* is not ``None``, it must be an instance of a :class:`tzinfo` " "subclass, and the current date and time are converted to *tz*’s time zone." @@ -1663,23 +1378,17 @@ msgstr "" "ンスでなければならず、現在の日付および時刻は *tz* のタイムゾーンに変換されま" "す。" -#: ../../library/datetime.rst:965 +#: ../../library/datetime.rst:873 msgid "This function is preferred over :meth:`today` and :meth:`utcnow`." msgstr "" ":meth:`today` および :meth:`utcnow` よりもこの関数を使う方が好ましいです。" -#: ../../library/datetime.rst:969 -msgid "" -"Subsequent calls to :meth:`!datetime.now` may return the same instant " -"depending on the precision of the underlying clock." -msgstr "" - -#: ../../library/datetime.rst:974 +#: ../../library/datetime.rst:878 msgid "Return the current UTC date and time, with :attr:`.tzinfo` ``None``." msgstr "" ":attr:`tzinfo` が ``None`` である現在の UTC の日付および時刻を返します。" -#: ../../library/datetime.rst:976 +#: ../../library/datetime.rst:880 msgid "" "This is like :meth:`now`, but returns the current UTC date and time, as a " "naive :class:`.datetime` object. An aware current UTC datetime can be " @@ -1691,7 +1400,7 @@ msgstr "" "で取得できます。\n" ":meth:`now` も参照してください。" -#: ../../library/datetime.rst:982 +#: ../../library/datetime.rst:886 msgid "" "Because naive ``datetime`` objects are treated by many ``datetime`` methods " "as local times, it is preferred to use aware datetimes to represent times in " @@ -1704,11 +1413,7 @@ msgstr "" "そのため、 UTC での現在の時刻を表すオブジェクトの作成では ``datetime." "now(timezone.utc)`` を呼び出す方法が推奨されます。" -#: ../../library/datetime.rst:989 -msgid "Use :meth:`datetime.now` with :const:`UTC` instead." -msgstr "" - -#: ../../library/datetime.rst:994 +#: ../../library/datetime.rst:894 msgid "" "Return the local date and time corresponding to the POSIX timestamp, such as " "is returned by :func:`time.time`. If optional argument *tz* is ``None`` or " @@ -1720,7 +1425,7 @@ msgstr "" "い場合、タイムスタンプはプラットフォームのローカルな日付および時刻に変換さ" "れ、返される :class:`.datetime` オブジェクトは naive なものになります。" -#: ../../library/datetime.rst:999 +#: ../../library/datetime.rst:899 msgid "" "If *tz* is not ``None``, it must be an instance of a :class:`tzinfo` " "subclass, and the timestamp is converted to *tz*’s time zone." @@ -1728,7 +1433,7 @@ msgstr "" "*tz* が ``None`` でない場合、 *tz* は :class:`tzinfo` のサブクラスのインスタ" "ンスでなければならず、タイムスタンプは *tz* のタイムゾーンに変換されます。" -#: ../../library/datetime.rst:1002 +#: ../../library/datetime.rst:902 msgid "" ":meth:`fromtimestamp` may raise :exc:`OverflowError`, if the timestamp is " "out of the range of values supported by the platform C :c:func:`localtime` " @@ -1752,7 +1457,7 @@ msgstr "" "クトとなることが起こり得ます。\n" ":meth:`utcfromtimestamp` よりも、このメソッドの方が好ましいです。" -#: ../../library/datetime.rst:1013 +#: ../../library/datetime.rst:913 msgid "" "Raise :exc:`OverflowError` instead of :exc:`ValueError` if the timestamp is " "out of the range of values supported by the platform C :c:func:`localtime` " @@ -1765,12 +1470,12 @@ msgstr "" "くは :c:func:`gmtime` の呼び出し失敗で :exc:`ValueError` ではなく :exc:" "`OSError` を送出するようになりました。" -#: ../../library/datetime.rst:1020 +#: ../../library/datetime.rst:920 msgid ":meth:`fromtimestamp` may return instances with :attr:`.fold` set to 1." msgstr "" ":meth:`fromtimestamp` は :attr:`.fold` を1にしてインスタンスを返します。" -#: ../../library/datetime.rst:1025 +#: ../../library/datetime.rst:925 msgid "" "Return the UTC :class:`.datetime` corresponding to the POSIX timestamp, " "with :attr:`.tzinfo` ``None``. (The resulting object is naive.)" @@ -1778,7 +1483,7 @@ msgstr "" "POSIX タイムスタンプに対応する、:attr:`tzinfo` が ``None`` の UTC での :" "class:`.datetime` を返します。(返されるオブジェクトは naive です。)" -#: ../../library/datetime.rst:1028 +#: ../../library/datetime.rst:928 msgid "" "This may raise :exc:`OverflowError`, if the timestamp is out of the range of " "values supported by the platform C :c:func:`gmtime` function, and :exc:" @@ -1790,28 +1495,19 @@ msgstr "" "`gmtime` が失敗した場合には :exc:`OSError` を送出します。\n" "これはたいてい 1970 年から 2038 年に制限されています。" -#: ../../library/datetime.rst:1033 +#: ../../library/datetime.rst:933 msgid "To get an aware :class:`.datetime` object, call :meth:`fromtimestamp`::" msgstr "" "aware な :class:`.datetime` オブジェクトを得るには :meth:`fromtimestamp` を呼" "んでください::" -#: ../../library/datetime.rst:1035 -msgid "datetime.fromtimestamp(timestamp, timezone.utc)" -msgstr "" - -#: ../../library/datetime.rst:1037 +#: ../../library/datetime.rst:937 msgid "" "On the POSIX compliant platforms, it is equivalent to the following " "expression::" msgstr "POSIX 互換プラットフォームでは、これは以下の表現と等価です::" -#: ../../library/datetime.rst:1040 -msgid "" -"datetime(1970, 1, 1, tzinfo=timezone.utc) + timedelta(seconds=timestamp)" -msgstr "" - -#: ../../library/datetime.rst:1042 +#: ../../library/datetime.rst:942 msgid "" "except the latter formula always supports the full years range: between :" "const:`MINYEAR` and :const:`MAXYEAR` inclusive." @@ -1819,7 +1515,7 @@ msgstr "" "後者を除き、式は常に年の全範囲 (:const:`MINYEAR` から :const:`MAXYEAR` を含み" "ます) をサポートします。" -#: ../../library/datetime.rst:1047 +#: ../../library/datetime.rst:947 msgid "" "Because naive ``datetime`` objects are treated by many ``datetime`` methods " "as local times, it is preferred to use aware datetimes to represent times in " @@ -1834,7 +1530,7 @@ msgstr "" "``datetime.fromtimestamp(timestamp, tz=timezone.utc)`` を呼び出す方法が推奨さ" "れます。" -#: ../../library/datetime.rst:1053 +#: ../../library/datetime.rst:953 msgid "" "Raise :exc:`OverflowError` instead of :exc:`ValueError` if the timestamp is " "out of the range of values supported by the platform C :c:func:`gmtime` " @@ -1846,11 +1542,7 @@ msgstr "" "るようになりました。 :c:func:`gmtime` の呼び出し失敗で :exc:`ValueError` では" "なく :exc:`OSError` を送出するようになりました。" -#: ../../library/datetime.rst:1061 -msgid "Use :meth:`datetime.fromtimestamp` with :const:`UTC` instead." -msgstr "" - -#: ../../library/datetime.rst:1066 +#: ../../library/datetime.rst:962 msgid "" "Return the :class:`.datetime` corresponding to the proleptic Gregorian " "ordinal, where January 1 of year 1 has ordinal 1. :exc:`ValueError` is " @@ -1865,86 +1557,72 @@ msgstr "" "返されるオブジェクトの時間、分、秒、およびマイクロ秒はすべて 0 で、 :attr:" "`tzinfo` は ``None`` となっています。" -#: ../../library/datetime.rst:1074 +#: ../../library/datetime.rst:970 msgid "" "Return a new :class:`.datetime` object whose date components are equal to " "the given :class:`date` object's, and whose time components are equal to the " "given :class:`.time` object's. If the *tzinfo* argument is provided, its " "value is used to set the :attr:`.tzinfo` attribute of the result, otherwise " -"the :attr:`~.time.tzinfo` attribute of the *time* argument is used. If the " -"*date* argument is a :class:`.datetime` object, its time components and :" -"attr:`.tzinfo` attributes are ignored." +"the :attr:`~.time.tzinfo` attribute of the *time* argument is used." msgstr "" "日付部分と与えられた :class:`date` オブジェクトとが等しく、時刻部分と与えられ" "た :class:`.time` オブジェクトとが等しい、新しい :class:`.datetime` オブジェ" "クトを返します。\n" "*tzinfo* 引数が与えられた場合、その値は返り値の :attr:`.tzinfo` 属性に設定す" "るのに使われます。そうでない場合、 *time* 引数の :attr:`~.time.tzinfo` 属性が" -"使われます。*date* 引数に :class:`.datetime` オブジェクトが与えられた場合、そ" -"の時刻部分と :attr:`.tzinfo` 属性は無視されます。" +"使われます。" -#: ../../library/datetime.rst:1082 +#: ../../library/datetime.rst:977 msgid "" -"For any :class:`.datetime` object ``d``, ``d == datetime.combine(d.date(), d." -"time(), d.tzinfo)``." +"For any :class:`.datetime` object *d*, ``d == datetime.combine(d.date(), d." +"time(), d.tzinfo)``. If date is a :class:`.datetime` object, its time " +"components and :attr:`.tzinfo` attributes are ignored." msgstr "" +"任意の :class:`.datetime` オブジェクト *d* で ``d == datetime.combine(d." +"date(), d.time(), d.tzinfo)`` が成立します。\n" +"date が :class:`.datetime` オブジェクトだった場合、その :class:`.datetime` オ" +"ブジェクトの時刻部分と :attr:`.tzinfo` 属性は無視されます。" -#: ../../library/datetime.rst:1085 +#: ../../library/datetime.rst:982 msgid "Added the *tzinfo* argument." msgstr "*tzinfo* 引数が追加されました。" -#: ../../library/datetime.rst:1091 +#: ../../library/datetime.rst:988 msgid "" -"Return a :class:`.datetime` corresponding to a *date_string* in any valid " -"ISO 8601 format, with the following exceptions:" +"Return a :class:`.datetime` corresponding to a *date_string* in one of the " +"formats emitted by :meth:`date.isoformat` and :meth:`datetime.isoformat`." msgstr "" -"以下の例外を除く、有効な ISO 8601 フォーマットで与えられた *date_string* に対" -"応する :class:`.datetime` を返します :" +":meth:`date.isoformat` および :meth:`datetime.isoformat` の出力書式で、 " +"*date_string* に対応する :class:`datetime` を返します。" -#: ../../library/datetime.rst:1094 ../../library/datetime.rst:1904 -msgid "Time zone offsets may have fractional seconds." -msgstr "小数の秒があるタイムゾーンオフセット。" +#: ../../library/datetime.rst:991 +msgid "Specifically, this function supports strings in the format:" +msgstr "具体的には、この関数は次の書式の文字列をサポートしています:" -#: ../../library/datetime.rst:1095 -msgid "The ``T`` separator may be replaced by any single unicode character." -msgstr "``T`` セパレーターを他の1文字のユニコードに置き換えたもの。" +#: ../../library/datetime.rst:997 +msgid "where ``*`` can match any single character." +msgstr "ここで ``*`` は任意の一文字にマッチします。" -#: ../../library/datetime.rst:1096 ../../library/datetime.rst:1909 -msgid "Fractional hours and minutes are not supported." -msgstr "少数の時と分はサポートされていません。" - -#: ../../library/datetime.rst:1105 +#: ../../library/datetime.rst:1001 msgid "" -">>> from datetime import datetime\n" -">>> datetime.fromisoformat('2011-11-04')\n" -"datetime.datetime(2011, 11, 4, 0, 0)\n" -">>> datetime.fromisoformat('20111104')\n" -"datetime.datetime(2011, 11, 4, 0, 0)\n" -">>> datetime.fromisoformat('2011-11-04T00:05:23')\n" -"datetime.datetime(2011, 11, 4, 0, 5, 23)\n" -">>> datetime.fromisoformat('2011-11-04T00:05:23Z')\n" -"datetime.datetime(2011, 11, 4, 0, 5, 23, tzinfo=datetime.timezone.utc)\n" -">>> datetime.fromisoformat('20111104T000523')\n" -"datetime.datetime(2011, 11, 4, 0, 5, 23)\n" -">>> datetime.fromisoformat('2011-W01-2T00:05:23.283')\n" -"datetime.datetime(2011, 1, 4, 0, 5, 23, 283000)\n" -">>> datetime.fromisoformat('2011-11-04 00:05:23.283')\n" -"datetime.datetime(2011, 11, 4, 0, 5, 23, 283000)\n" -">>> datetime.fromisoformat('2011-11-04 00:05:23.283+00:00')\n" -"datetime.datetime(2011, 11, 4, 0, 5, 23, 283000, tzinfo=datetime.timezone." -"utc)\n" -">>> datetime.fromisoformat('2011-11-04T00:05:23+04:00')\n" -"datetime.datetime(2011, 11, 4, 0, 5, 23,\n" -" tzinfo=datetime.timezone(datetime.timedelta(seconds=14400)))" +"This does *not* support parsing arbitrary ISO 8601 strings - it is only " +"intended as the inverse operation of :meth:`datetime.isoformat`. A more full-" +"featured ISO 8601 parser, ``dateutil.parser.isoparse`` is available in the " +"third-party package `dateutil `__." msgstr "" +"このメソッドは任意の ISO 8601 文字列の構文解析をサポートしてはいません - この" +"メソッドは :meth:`datetime.isoformat` の逆操作をするためだけのものです。\n" +"より高機能な ISO 8601 構文解析器である ``dateutil.parser.isoparse`` が、サー" +"ドパーティーパッケージの `dateutil `__ から利用可能です。" -#: ../../library/datetime.rst:1127 -msgid "" -"Previously, this method only supported formats that could be emitted by :" -"meth:`date.isoformat` or :meth:`datetime.isoformat`." -msgstr "" +#: ../../library/datetime.rst:1006 ../../library/datetime.rst:1423 +#: ../../library/datetime.rst:1770 +msgid "Examples::" +msgstr "例::" -#: ../../library/datetime.rst:1134 +#: ../../library/datetime.rst:1025 msgid "" "Return a :class:`.datetime` corresponding to the ISO calendar date specified " "by year, week and day. The non-date components of the datetime are populated " @@ -1955,7 +1633,7 @@ msgstr "" "datetime の日付でない部分は、標準のデフォルト値で埋められます。\n" "この関数は :meth:`datetime.isocalendar` の逆関数です。" -#: ../../library/datetime.rst:1143 +#: ../../library/datetime.rst:1034 msgid "" "Return a :class:`.datetime` corresponding to *date_string*, parsed according " "to *format*." @@ -1963,51 +1641,23 @@ msgstr "" "*date_string* に対応した :class:`.datetime` を返します。 *format* にしたがっ" "て構文解析されます。" -#: ../../library/datetime.rst:1146 -msgid "" -"If *format* does not contain microseconds or time zone information, this is " -"equivalent to::" -msgstr "" -"*format* がマイクロ秒やタイムゾーン情報を含まない場合は、以下と等価です::" - -#: ../../library/datetime.rst:1148 ../../library/datetime.rst:2643 -msgid "datetime(*(time.strptime(date_string, format)[0:6]))" -msgstr "" +#: ../../library/datetime.rst:1037 +msgid "This is equivalent to::" +msgstr "これは次と等価です::" -#: ../../library/datetime.rst:1150 +#: ../../library/datetime.rst:1041 msgid "" ":exc:`ValueError` is raised if the date_string and format can't be parsed " -"by :func:`time.strptime` or if it returns a value which isn't a time tuple. " -"See also :ref:`strftime-strptime-behavior` and :meth:`datetime." -"fromisoformat`." +"by :func:`time.strptime` or if it returns a value which isn't a time tuple. " +"For a complete list of formatting directives, see :ref:`strftime-strptime-" +"behavior`." msgstr "" "date_string と format が :func:`time.strptime` で構文解析できない場合や、この" -"関数が時刻タプルを返してこない場合には :exc:`ValueError` を送出します。:ref:" -"`strftime-strptime-behavior` および :meth:`datetime.fromisoformat` も参照して" -"ください。" - -#: ../../library/datetime.rst:1157 -msgid "" -"If *format* specifies a day of month without a year a :exc:" -"`DeprecationWarning` is now emitted. This is to avoid a quadrennial leap " -"year bug in code seeking to parse only a month and day as the default year " -"used in absence of one in the format is not a leap year. Such *format* " -"values may raise an error as of Python 3.15. The workaround is to always " -"include a year in your *format*. If parsing *date_string* values that do " -"not have a year, explicitly add a year that is a leap year before parsing:" -msgstr "" - -#: ../../library/datetime.rst:1166 -msgid "" -">>> from datetime import datetime\n" -">>> date_string = \"02/29\"\n" -">>> when = datetime.strptime(f\"{date_string};1984\", \"%m/%d;%Y\") # " -"Avoids leap year bug.\n" -">>> when.strftime(\"%B %d\")\n" -"'February 29'" -msgstr "" +"関数が時刻タプルを返してこない場合には :exc:`ValueError` を送出します。完全な" +"書式化指定子のリストについては :ref:`strftime-strptime-behavior` を参照してく" +"ださい。" -#: ../../library/datetime.rst:1179 +#: ../../library/datetime.rst:1052 msgid "" "The earliest representable :class:`.datetime`, ``datetime(MINYEAR, 1, 1, " "tzinfo=None)``." @@ -2015,7 +1665,7 @@ msgstr "" "表現できる最も古い :class:`.datetime` で、 ``datetime(MINYEAR, 1, 1, " "tzinfo=None)`` です。" -#: ../../library/datetime.rst:1185 +#: ../../library/datetime.rst:1058 msgid "" "The latest representable :class:`.datetime`, ``datetime(MAXYEAR, 12, 31, 23, " "59, 59, 999999, tzinfo=None)``." @@ -2023,7 +1673,7 @@ msgstr "" "表現できる最も新しい :class:`.datetime` で、 ``datetime(MAXYEAR, 12, 31, 23, " "59, 59, 999999, tzinfo=None)`` です。" -#: ../../library/datetime.rst:1191 +#: ../../library/datetime.rst:1064 msgid "" "The smallest possible difference between non-equal :class:`.datetime` " "objects, ``timedelta(microseconds=1)``." @@ -2031,20 +1681,20 @@ msgstr "" "等しくない :class:`.datetime` オブジェクト間の最小の差で、 " "``timedelta(microseconds=1)`` です。" -#: ../../library/datetime.rst:1214 ../../library/datetime.rst:1837 +#: ../../library/datetime.rst:1087 ../../library/datetime.rst:1690 msgid "In ``range(24)``." msgstr "in ``range(24)`` を満たします。" -#: ../../library/datetime.rst:1219 ../../library/datetime.rst:1224 -#: ../../library/datetime.rst:1842 ../../library/datetime.rst:1847 +#: ../../library/datetime.rst:1092 ../../library/datetime.rst:1097 +#: ../../library/datetime.rst:1695 ../../library/datetime.rst:1700 msgid "In ``range(60)``." msgstr "in ``range(60)`` を満たします。" -#: ../../library/datetime.rst:1229 ../../library/datetime.rst:1852 +#: ../../library/datetime.rst:1102 ../../library/datetime.rst:1705 msgid "In ``range(1000000)``." msgstr "in ``range(1000000)`` を満たします。" -#: ../../library/datetime.rst:1234 +#: ../../library/datetime.rst:1107 msgid "" "The object passed as the *tzinfo* argument to the :class:`.datetime` " "constructor, or ``None`` if none was passed." @@ -2052,101 +1702,85 @@ msgstr "" ":class:`.datetime` コンストラクタに *tzinfo* 引数として与えられたオブジェクト" "になり、何も渡されなかった場合には ``None`` になります。" -#: ../../library/datetime.rst:1240 ../../library/datetime.rst:1863 +#: ../../library/datetime.rst:1113 ../../library/datetime.rst:1716 msgid "" "In ``[0, 1]``. Used to disambiguate wall times during a repeated interval. " "(A repeated interval occurs when clocks are rolled back at the end of " "daylight saving time or when the UTC offset for the current zone is " -"decreased for political reasons.) The values 0 and 1 represent, " -"respectively, the earlier and later of the two moments with the same wall " -"time representation." +"decreased for political reasons.) The value 0 (1) represents the earlier " +"(later) of the two moments with the same wall time representation." msgstr "" "``[0, 1]`` のどちらかです。\n" "繰り返し期間中の実時間の曖昧さ除去に使われます。\n" "(繰り返し期間は、夏時間の終わりに時計が巻き戻るときや、現在のゾーンの UTC オ" "フセットが政治的な理由で減少するときに発生します。)\n" -"0または1という値は、同じ実時間で表現される 2 つの時刻のうちのそれぞれ早い方ま" -"たは遅い方を表します。" +"0 (1) という値は、同じ実時間で表現される 2 つの時刻のうちの早い方 (遅い方) を" +"表します。" -#: ../../library/datetime.rst:1253 +#: ../../library/datetime.rst:1126 msgid "``datetime2 = datetime1 + timedelta``" msgstr "``datetime2 = datetime1 + timedelta``" -#: ../../library/datetime.rst:1253 ../../library/datetime.rst:2490 -#: ../../library/datetime.rst:2495 ../../library/datetime.rst:2507 -#: ../../library/datetime.rst:2512 ../../library/datetime.rst:2572 -#: ../../library/datetime.rst:2577 ../../library/datetime.rst:2581 +#: ../../library/datetime.rst:1126 ../../library/datetime.rst:2308 +#: ../../library/datetime.rst:2313 ../../library/datetime.rst:2325 +#: ../../library/datetime.rst:2330 ../../library/datetime.rst:2390 +#: ../../library/datetime.rst:2395 ../../library/datetime.rst:2399 msgid "\\(1)" msgstr "\\(1)" -#: ../../library/datetime.rst:1255 +#: ../../library/datetime.rst:1128 msgid "``datetime2 = datetime1 - timedelta``" msgstr "``datetime2 = datetime1 - timedelta``" -#: ../../library/datetime.rst:1255 ../../library/datetime.rst:2523 +#: ../../library/datetime.rst:1128 ../../library/datetime.rst:2341 msgid "\\(2)" msgstr "\\(2)" -#: ../../library/datetime.rst:1257 +#: ../../library/datetime.rst:1130 msgid "``timedelta = datetime1 - datetime2``" msgstr "``timedelta = datetime1 - datetime2``" -#: ../../library/datetime.rst:0 -msgid "``datetime1 == datetime2``" -msgstr "``datetime1 == datetime2``" - -#: ../../library/datetime.rst:0 -msgid "``datetime1 != datetime2``" -msgstr "``datetime1 != datetime2``" - -#: ../../library/datetime.rst:0 +#: ../../library/datetime.rst:1132 msgid "``datetime1 < datetime2``" msgstr "``datetime1 < datetime2``" -#: ../../library/datetime.rst:0 -msgid "``datetime1 > datetime2``" -msgstr "``datetime1 > datetime2``" - -#: ../../library/datetime.rst:0 -msgid "``datetime1 <= datetime2``" -msgstr "``datetime1 <= datetime2``" +#: ../../library/datetime.rst:1132 +msgid "Compares :class:`.datetime` to :class:`.datetime`. (4)" +msgstr ":class:`.datetime` を :class:`.datetime` と比較します。 (4)" -#: ../../library/datetime.rst:0 -msgid "``datetime1 >= datetime2``" -msgstr "``datetime1 >= datetime2``" - -#: ../../library/datetime.rst:1269 -msgid "" -"``datetime2`` is a duration of ``timedelta`` removed from ``datetime1``, " -"moving forward in time if ``timedelta.days > 0``, or backward if ``timedelta." -"days < 0``. The result has the same :attr:`~.datetime.tzinfo` attribute as " -"the input datetime, and ``datetime2 - datetime1 == timedelta`` after. :exc:" -"`OverflowError` is raised if ``datetime2.year`` would be smaller than :const:" -"`MINYEAR` or larger than :const:`MAXYEAR`. Note that no time zone " -"adjustments are done even if the input is an aware object." -msgstr "" -"``datetime2`` は ``datetime1`` から時間 ``timedelta`` 移動したもので、" -"``timedelta.days > 0`` の場合未来へ、``timedelta.days < 0`` の場合過去へ移動" -"します。\n" +#: ../../library/datetime.rst:1137 +msgid "" +"datetime2 is a duration of timedelta removed from datetime1, moving forward " +"in time if ``timedelta.days`` > 0, or backward if ``timedelta.days`` < 0. " +"The result has the same :attr:`~.datetime.tzinfo` attribute as the input " +"datetime, and datetime2 - datetime1 == timedelta after. :exc:`OverflowError` " +"is raised if datetime2.year would be smaller than :const:`MINYEAR` or larger " +"than :const:`MAXYEAR`. Note that no time zone adjustments are done even if " +"the input is an aware object." +msgstr "" +"datetime2 は datetime1 から時間 timedelta 移動したもので、 ``timedelta." +"days`` > 0 の場合未来へ、 ``timedelta.days`` < 0 の場合過去へ移動します。\n" "結果は入力の datetime と同じ :attr:`~.datetime.tzinfo` 属性を持ち、演算後に" -"は ``datetime2 - datetime1 == timedelta`` となります。\n" -"``datetime2.year`` が :const:`MINYEAR` よりも小さいか、 :const:`MAXYEAR` より" -"大きい場合には :exc:`OverflowError` が送出されます。\n" +"は datetime2 - datetime1 == timedelta となります。\n" +"datetime2.year が :const:`MINYEAR` よりも小さいか、 :const:`MAXYEAR` より大き" +"い場合には :exc:`OverflowError` が送出されます。\n" "入力が aware なオブジェクトの場合でもタイムゾーン修正は全く行われません。" -#: ../../library/datetime.rst:1278 +#: ../../library/datetime.rst:1146 msgid "" -"Computes the ``datetime2`` such that ``datetime2 + timedelta == datetime1``. " -"As for addition, the result has the same :attr:`~.datetime.tzinfo` attribute " -"as the input datetime, and no time zone adjustments are done even if the " -"input is aware." +"Computes the datetime2 such that datetime2 + timedelta == datetime1. As for " +"addition, the result has the same :attr:`~.datetime.tzinfo` attribute as the " +"input datetime, and no time zone adjustments are done even if the input is " +"aware." msgstr "" -"``datetime2 + timedelta == datetime1`` となるような ``datetime2`` を計算しま" -"す。\n" +"datetime2 + timedelta == datetime1 となるような datetime2 を計算します。\n" "ちなみに、結果は入力の datetime と同じ :attr:`~.datetime.tzinfo` 属性を持ち、" -"入力が aware だとしてもタイムゾーン修正は全く行われません。" +"入力が aware だとしてもタイムゾーン修正は全く行われません。\n" +"この操作は date1 + (-timedelta) と等価ではありません。\n" +"なぜならば、 date1 - timedelta がオーバフローしない場合でも、-timedelta 単体" +"がオーバフローする可能性があるからです。" -#: ../../library/datetime.rst:1283 +#: ../../library/datetime.rst:1151 msgid "" "Subtraction of a :class:`.datetime` from a :class:`.datetime` is defined " "only if both operands are naive, or if both are aware. If one is aware and " @@ -2156,71 +1790,67 @@ msgstr "" "あるか、両方とも aware である場合にのみ定義されています。片方が aware でもう" "一方が naive の場合、 :exc:`TypeError` が送出されます。" -#: ../../library/datetime.rst:1287 +#: ../../library/datetime.rst:1155 msgid "" "If both are naive, or both are aware and have the same :attr:`~.datetime." "tzinfo` attribute, the :attr:`~.datetime.tzinfo` attributes are ignored, and " -"the result is a :class:`timedelta` object ``t`` such that ``datetime2 + t == " +"the result is a :class:`timedelta` object *t* such that ``datetime2 + t == " "datetime1``. No time zone adjustments are done in this case." msgstr "" +"両方とも naive か、両方とも aware で同じ :attr:`~.datetime.tzinfo` 属性を持つ" +"場合、 :attr:`~.datetime.tzinfo` 属性は無視され、結果は ``datetime2 + t == " +"datetime1`` であるような :class:`timedelta` オブジェクト *t* となります。\n" +"この場合タイムゾーン修正は全く行われません。" -#: ../../library/datetime.rst:1292 +#: ../../library/datetime.rst:1160 msgid "" "If both are aware and have different :attr:`~.datetime.tzinfo` attributes, " -"``a-b`` acts as if ``a`` and ``b`` were first converted to naive UTC " -"datetimes. The result is ``(a.replace(tzinfo=None) - a.utcoffset()) - (b." +"``a-b`` acts as if *a* and *b* were first converted to naive UTC datetimes " +"first. The result is ``(a.replace(tzinfo=None) - a.utcoffset()) - (b." "replace(tzinfo=None) - b.utcoffset())`` except that the implementation never " "overflows." msgstr "" +"両方が aware で異なる :attr:`~.datetime.tzinfo` 属性を持つ場合、 ``a-b`` は " +"*a* および *b* をまず naive な UTC datetime オブジェクトに変換したかのように" +"して行います。\n" +"演算結果は決してオーバフローを起こさないことを除き、 ``(a." +"replace(tzinfo=None) - a.utcoffset()) - (b.replace(tzinfo=None) - b." +"utcoffset())`` と同じになります。" -#: ../../library/datetime.rst:1298 -msgid "" -":class:`.datetime` objects are equal if they represent the same date and " -"time, taking into account the time zone." -msgstr "" -":class:`.datetime` オブジェクトはタイムゾーンを考慮して同じ日付と時刻を表す場" -"合、等しいです。" - -#: ../../library/datetime.rst:1301 -msgid "Naive and aware :class:`!datetime` objects are never equal." -msgstr "" - -#: ../../library/datetime.rst:1303 -msgid "" -"If both comparands are aware, and have the same :attr:`!tzinfo` attribute, " -"the :attr:`!tzinfo` and :attr:`~.datetime.fold` attributes are ignored and " -"the base datetimes are compared. If both comparands are aware and have " -"different :attr:`~.datetime.tzinfo` attributes, the comparison acts as " -"comparands were first converted to UTC datetimes except that the " -"implementation never overflows. :class:`!datetime` instances in a repeated " -"interval are never equal to :class:`!datetime` instances in other time zone." -msgstr "" - -#: ../../library/datetime.rst:1313 +#: ../../library/datetime.rst:1166 msgid "" "*datetime1* is considered less than *datetime2* when *datetime1* precedes " -"*datetime2* in time, taking into account the time zone." +"*datetime2* in time." msgstr "" -"タイムゾーンを考慮して、*datetime1* が時刻として *datetime2* よりも前を表す場" -"合に、*datetime1* は *datetime2* よりも小さいと見なされます。" +"*datetime1* が時刻として *datetime2* よりも前を表す場合に、*datetime1* は " +"*datetime2* よりも小さいと見なされます。" -#: ../../library/datetime.rst:1316 +#: ../../library/datetime.rst:1169 msgid "" -"Order comparison between naive and aware :class:`.datetime` objects raises :" -"exc:`TypeError`." +"If one comparand is naive and the other is aware, :exc:`TypeError` is raised " +"if an order comparison is attempted. For equality comparisons, naive " +"instances are never equal to aware instances." msgstr "" +"比較の一方が naive であり、もう一方が aware の場合に、順序比較が行われると :" +"exc:`TypeError` が送出されます。等価比較では、 naive インスタンスと aware イ" +"ンスタンスは等価になることはありません。" -#: ../../library/datetime.rst:1319 +#: ../../library/datetime.rst:1173 msgid "" -"If both comparands are aware, and have the same :attr:`!tzinfo` attribute, " -"the :attr:`!tzinfo` and :attr:`~.datetime.fold` attributes are ignored and " -"the base datetimes are compared. If both comparands are aware and have " -"different :attr:`~.datetime.tzinfo` attributes, the comparison acts as " -"comparands were first converted to UTC datetimes except that the " -"implementation never overflows." +"If both comparands are aware, and have the same :attr:`~.datetime.tzinfo` " +"attribute, the common :attr:`~.datetime.tzinfo` attribute is ignored and the " +"base datetimes are compared. If both comparands are aware and have " +"different :attr:`~.datetime.tzinfo` attributes, the comparands are first " +"adjusted by subtracting their UTC offsets (obtained from ``self." +"utcoffset()``)." msgstr "" +"比較対象が両方とも aware で、同じ :attr:`~.datetime.tzinfo` 属性を持つ場" +"合、 :attr:`~.datetime.tzinfo` は無視され datetime だけで比較が行われます。\n" +"比較対象が両方とも aware であり、異なる :attr:`~.datetime.tzinfo` 属性を持つ" +"場合、まず最初に (``self.utcoffset()`` で取得できる) それぞれの UTC オフセッ" +"トを引いて調整します。" -#: ../../library/datetime.rst:1326 +#: ../../library/datetime.rst:1179 msgid "" "Equality comparisons between aware and naive :class:`.datetime` instances " "don't raise :exc:`TypeError`." @@ -2228,11 +1858,33 @@ msgstr "" "aware な :class:`datetime` インスタンスと naive な :class:`datetime` インスタ" "ンスの等価比較では :exc:`TypeError` は送出されません。" -#: ../../library/datetime.rst:1342 +#: ../../library/datetime.rst:1185 +msgid "" +"In order to stop comparison from falling back to the default scheme of " +"comparing object addresses, datetime comparison normally raises :exc:" +"`TypeError` if the other comparand isn't also a :class:`.datetime` object. " +"However, ``NotImplemented`` is returned instead if the other comparand has " +"a :meth:`timetuple` attribute. This hook gives other kinds of date objects a " +"chance at implementing mixed-type comparison. If not, when a :class:`." +"datetime` object is compared to an object of a different type, :exc:" +"`TypeError` is raised unless the comparison is ``==`` or ``!=``. The latter " +"cases return :const:`False` or :const:`True`, respectively." +msgstr "" +"型混合の比較がデフォルトのオブジェクトアドレス比較となってしまうのを抑止する" +"ために、被演算子のもう一方が :class:`.datetime` オブジェクトと異なる型のオブ" +"ジェクトの場合には :exc:`TypeError` が送出されます。しかしながら、被比較演算" +"子のもう一方が :meth:`timetuple` 属性を持つ場合には ``NotImplemented`` が返さ" +"れます。このフックにより、他種の日付オブジェクトに型混合比較を実装するチャン" +"スを与えています。そうでない場合, :class:`.datetime` オブジェクトと異なる型の" +"オブジェクトが比較されると、比較演算子が ``==`` または ``!=`` でないかぎり :" +"exc:`TypeError` が送出されます。後者の場合、それぞれ :const:`False` または :" +"const:`True` を返します。" + +#: ../../library/datetime.rst:1199 msgid "Return :class:`date` object with same year, month and day." msgstr "同じ年、月、日の :class:`date` オブジェクトを返します。" -#: ../../library/datetime.rst:1347 +#: ../../library/datetime.rst:1204 msgid "" "Return :class:`.time` object with same hour, minute, second, microsecond and " "fold. :attr:`.tzinfo` is ``None``. See also method :meth:`timetz`." @@ -2241,11 +1893,11 @@ msgstr "" "クトを返します。 :attr:`.tzinfo` は ``None`` です。 :meth:`timetz` も参照して" "ください。" -#: ../../library/datetime.rst:1350 ../../library/datetime.rst:1359 +#: ../../library/datetime.rst:1207 ../../library/datetime.rst:1216 msgid "The fold value is copied to the returned :class:`.time` object." msgstr "値 foldは返される :class:`.time` オブジェクトにコピーされます。" -#: ../../library/datetime.rst:1356 +#: ../../library/datetime.rst:1213 msgid "" "Return :class:`.time` object with same hour, minute, second, microsecond, " "fold, and tzinfo attributes. See also method :meth:`time`." @@ -2253,23 +1905,19 @@ msgstr "" "同じhour、minute、second、microsecond、fold および tzinfo 属性を持つ :class:" "`.time` オブジェクトを返します。 :meth:`time` メソッドも参照してください。" -#: ../../library/datetime.rst:1367 -msgid "" -"Return a new :class:`datetime` object with the same attributes, but with " -"specified parameters updated. Note that ``tzinfo=None`` can be specified to " -"create a naive datetime from an aware datetime with no conversion of date " -"and time data." -msgstr "" - -#: ../../library/datetime.rst:1372 +#: ../../library/datetime.rst:1224 msgid "" -":class:`.datetime` objects are also supported by generic function :func:" -"`copy.replace`." +"Return a datetime with the same attributes, except for those attributes " +"given new values by whichever keyword arguments are specified. Note that " +"``tzinfo=None`` can be specified to create a naive datetime from an aware " +"datetime with no conversion of date and time data." msgstr "" -":class:`.datetime` オブジェクトは汎用的な関数 :func:`copy.replace` にもサポー" -"トされています。" +"キーワード引数で指定した属性の値を除き、同じ属性をもつ datetime オブジェクト" +"を返します。メンバに対する変換を行わずに aware な datetime オブジェクトから " +"naive な datetime オブジェクトを生成するために、``tzinfo=None`` を指定するこ" +"ともできます。" -#: ../../library/datetime.rst:1381 +#: ../../library/datetime.rst:1235 msgid "" "Return a :class:`.datetime` object with new :attr:`.tzinfo` attribute *tz*, " "adjusting the date and time data so the result is the same UTC time as " @@ -2280,21 +1928,21 @@ msgstr "" "日付および時刻データを調整して、返り値が *self* と同じ UTC 時刻を持ち、 *tz* " "におけるローカルな時刻を表すようにします。" -#: ../../library/datetime.rst:1385 +#: ../../library/datetime.rst:1239 msgid "" "If provided, *tz* must be an instance of a :class:`tzinfo` subclass, and " "its :meth:`utcoffset` and :meth:`dst` methods must not return ``None``. If " -"*self* is naive, it is presumed to represent time in the system time zone." +"*self* is naive, it is presumed to represent time in the system timezone." msgstr "" "もし与えられた場合、 *tz* は :class:`tzinfo` のサブクラスのインスタンスでなけ" "ればならず、 インスタンスの :meth:`utcoffset` および :meth:`dst` メソッドは " "``None`` を返してはなりません。もし *self* が naive ならば、おそらくシステム" "のタイムゾーンで時間を表現します。" -#: ../../library/datetime.rst:1389 +#: ../../library/datetime.rst:1243 msgid "" -"If called without arguments (or with ``tz=None``) the system local time zone " -"is assumed for the target time zone. The ``.tzinfo`` attribute of the " +"If called without arguments (or with ``tz=None``) the system local timezone " +"is assumed for the target timezone. The ``.tzinfo`` attribute of the " "converted datetime instance will be set to an instance of :class:`timezone` " "with the zone name and offset obtained from the OS." msgstr "" @@ -2303,11 +1951,11 @@ msgstr "" "変換後の datetime インスタンスの ``.tzinfo`` 属性には、 OS から取得したゾーン" "名とオフセットを持つ :class:`timezone` インスタンスが設定されます。" -#: ../../library/datetime.rst:1394 +#: ../../library/datetime.rst:1248 msgid "" "If ``self.tzinfo`` is *tz*, ``self.astimezone(tz)`` is equal to *self*: no " "adjustment of date or time data is performed. Else the result is local time " -"in the time zone *tz*, representing the same UTC time as *self*: after " +"in the timezone *tz*, representing the same UTC time as *self*: after " "``astz = dt.astimezone(tz)``, ``astz - astz.utcoffset()`` will have the same " "date and time data as ``dt - dt.utcoffset()``." msgstr "" @@ -2318,22 +1966,20 @@ msgstr "" "astz.utcoffset()`` は通常 ``dt - dt.utcoffset()`` と同じ date および time を" "持つことを示します。" -#: ../../library/datetime.rst:1400 +#: ../../library/datetime.rst:1254 msgid "" -"If you merely want to attach a :class:`timezone` object *tz* to a datetime " -"*dt* without adjustment of date and time data, use ``dt." -"replace(tzinfo=tz)``. If you merely want to remove the :class:`!timezone` " -"object from an aware datetime *dt* without conversion of date and time data, " -"use ``dt.replace(tzinfo=None)``." +"If you merely want to attach a time zone object *tz* to a datetime *dt* " +"without adjustment of date and time data, use ``dt.replace(tzinfo=tz)``. If " +"you merely want to remove the time zone object from an aware datetime *dt* " +"without conversion of date and time data, use ``dt.replace(tzinfo=None)``." msgstr "" -"単に :class:`timezone` オブジェクト *tz* を :class:`datetime` オブジェクト " -"*dt* に追加したいだけで、日付や時刻データへの調整を行わないのなら、``dt." +"単にタイムゾーンオブジェクト *tz* を :class:`datetime` オブジェクト *dt* に追" +"加したいだけで、日付や時刻データへの調整を行わないのなら、``dt." "replace(tzinfo=tz)`` を使ってください。単に aware な :class:`datetime` オブ" -"ジェクト *dt* から :class:`!timezone` オブジェクトを除去したいだけで、日付や" -"時刻データの変換を行わないのなら、``dt.replace(tzinfo=None)`` を使ってくださ" -"い。" +"ジェクト *dt* からタイムゾーンオブジェクトを除去したいだけで、日付や時刻デー" +"タの変換を行わないのなら、``dt.replace(tzinfo=None)`` を使ってください。" -#: ../../library/datetime.rst:1405 +#: ../../library/datetime.rst:1259 msgid "" "Note that the default :meth:`tzinfo.fromutc` method can be overridden in a :" "class:`tzinfo` subclass to affect the result returned by :meth:`astimezone`. " @@ -2343,22 +1989,11 @@ msgstr "" "上書きして, :meth:`astimezone` が返す結果に影響を及ぼすことができます。エラー" "の場合を無視すると、 :meth:`astimezone` は以下のように動作します::" -#: ../../library/datetime.rst:1409 -msgid "" -"def astimezone(self, tz):\n" -" if self.tzinfo is tz:\n" -" return self\n" -" # Convert self to UTC, and attach the new timezone object.\n" -" utc = (self - self.utcoffset()).replace(tzinfo=tz)\n" -" # Convert from UTC to tz's local time.\n" -" return tz.fromutc(utc)" -msgstr "" - -#: ../../library/datetime.rst:1417 +#: ../../library/datetime.rst:1271 msgid "*tz* now can be omitted." msgstr "*tz* が省略可能になりました。" -#: ../../library/datetime.rst:1420 +#: ../../library/datetime.rst:1274 msgid "" "The :meth:`astimezone` method can now be called on naive instances that are " "presumed to represent system local time." @@ -2367,7 +2002,7 @@ msgstr "" "呼び出せるようになりました。これは、システムのローカルな時間を表現していると" "想定されます。" -#: ../../library/datetime.rst:1427 +#: ../../library/datetime.rst:1281 msgid "" "If :attr:`.tzinfo` is ``None``, returns ``None``, else returns ``self.tzinfo." "utcoffset(self)``, and raises an exception if the latter doesn't return " @@ -2378,13 +2013,13 @@ msgstr "" "後者の式が ``None`` あるいは 1 日以下の大きさを持つ :class:`timedelta` オブ" "ジェクトのいずれかを返さない場合には例外を送出します。" -#: ../../library/datetime.rst:1431 ../../library/datetime.rst:2042 -#: ../../library/datetime.rst:2149 ../../library/datetime.rst:2394 -#: ../../library/datetime.rst:2406 ../../library/datetime.rst:2716 +#: ../../library/datetime.rst:1285 ../../library/datetime.rst:1868 +#: ../../library/datetime.rst:1974 ../../library/datetime.rst:2220 +#: ../../library/datetime.rst:2232 ../../library/datetime.rst:2528 msgid "The UTC offset is not restricted to a whole number of minutes." msgstr "UTC オフセットが分単位でなければならない制限が無くなりました。" -#: ../../library/datetime.rst:1437 +#: ../../library/datetime.rst:1291 msgid "" "If :attr:`.tzinfo` is ``None``, returns ``None``, else returns ``self.tzinfo." "dst(self)``, and raises an exception if the latter doesn't return ``None`` " @@ -2395,12 +2030,12 @@ msgstr "" "後者の式が ``None`` もしくは、1 日未満の大きさを持つ :class:`timedelta` オブ" "ジェクトのいずれかを返さない場合には例外を送出します。" -#: ../../library/datetime.rst:1441 ../../library/datetime.rst:2052 -#: ../../library/datetime.rst:2203 +#: ../../library/datetime.rst:1295 ../../library/datetime.rst:1878 +#: ../../library/datetime.rst:2028 msgid "The DST offset is not restricted to a whole number of minutes." msgstr "DST オフセットが分単位でなければならない制限が無くなりました。" -#: ../../library/datetime.rst:1447 +#: ../../library/datetime.rst:1301 msgid "" "If :attr:`.tzinfo` is ``None``, returns ``None``, else returns ``self.tzinfo." "tzname(self)``, raises an exception if the latter doesn't return ``None`` or " @@ -2411,66 +2046,66 @@ msgstr "" "後者の式が ``None`` か文字列オブジェクトのいずれかを返さない場合には例外を送" "出します。" -#: ../../library/datetime.rst:1458 -msgid "" -"time.struct_time((d.year, d.month, d.day,\n" -" d.hour, d.minute, d.second,\n" -" d.weekday(), yday, dst))" -msgstr "" - -#: ../../library/datetime.rst:1462 +#: ../../library/datetime.rst:1316 msgid "" "where ``yday = d.toordinal() - date(d.year, 1, 1).toordinal() + 1`` is the " -"day number within the current year starting with 1 for January 1st. The :" -"attr:`~time.struct_time.tm_isdst` flag of the result is set according to " -"the :meth:`dst` method: :attr:`.tzinfo` is ``None`` or :meth:`dst` returns " -"``None``, :attr:`!tm_isdst` is set to ``-1``; else if :meth:`dst` returns a " -"non-zero value, :attr:`!tm_isdst` is set to 1; else :attr:`!tm_isdst` is set " -"to 0." +"day number within the current year starting with ``1`` for January 1st. The :" +"attr:`tm_isdst` flag of the result is set according to the :meth:`dst` " +"method: :attr:`.tzinfo` is ``None`` or :meth:`dst` returns ``None``, :attr:" +"`tm_isdst` is set to ``-1``; else if :meth:`dst` returns a non-zero value, :" +"attr:`tm_isdst` is set to ``1``; else :attr:`tm_isdst` is set to ``0``." msgstr "" "ここで ``yday = d.toordinal() - date(d.year, 1, 1).toordinal() + 1`` はその年" -"の1月1日を 1 としたときのその日の位置です。\n" -"返されるタプルの :attr:`~time.struct_time.tm_isdst` フラグは :meth:`dst` メ" -"ソッドに従って設定されます: :attr:`.tzinfo` が ``None`` か :meth:`dst` が " -"``None`` を返す場合、 :attr:`!tm_isdst` は ``-1`` に設定されます; そうでない" -"場合、 :meth:`dst` がゼロでない値を返すと :attr:`!tm_isdst` は1となります; そ" -"れ以外の場合には :attr:`!tm_isdst` は0に設定されます。" +"の1月1日を ``1`` としたときのその日の位置です。\n" +"返されるタプルの :attr:`tm_isdst` フラグは :meth:`dst` メソッドに従って設定さ" +"れます: :attr:`.tzinfo` が ``None`` か :meth:`dst` が ``None`` を返す場合、 :" +"attr:`tm_isdst` は ``-1`` に設定されます; そうでない場合、 :meth:`dst` がゼロ" +"でない値を返すと :attr:`tm_isdst` は ``1`` となります; それ以外の場合には :" +"attr:`tm_isdst` は ``0`` に設定されます。" -#: ../../library/datetime.rst:1473 +#: ../../library/datetime.rst:1327 msgid "" -"If :class:`.datetime` instance ``d`` is naive, this is the same as ``d." -"timetuple()`` except that :attr:`~.time.struct_time.tm_isdst` is forced to 0 " -"regardless of what ``d.dst()`` returns. DST is never in effect for a UTC " -"time." +"If :class:`.datetime` instance *d* is naive, this is the same as ``d." +"timetuple()`` except that :attr:`tm_isdst` is forced to 0 regardless of what " +"``d.dst()`` returns. DST is never in effect for a UTC time." msgstr "" +":class:`.datetime` インスタンス *d* が naive の場合、このメソッドは ``d." +"timetuple()`` と同じであり、 ``d.dst()`` の返す内容にかかわらず :attr:" +"`tm_isdst` が 0 に強制される点だけが異なります。 DST が UTC 時刻に影響を及ぼ" +"すことは決してありません。" -#: ../../library/datetime.rst:1477 +#: ../../library/datetime.rst:1331 msgid "" -"If ``d`` is aware, ``d`` is normalized to UTC time, by subtracting ``d." +"If *d* is aware, *d* is normalized to UTC time, by subtracting ``d." "utcoffset()``, and a :class:`time.struct_time` for the normalized time is " -"returned. :attr:`!tm_isdst` is forced to 0. Note that an :exc:" -"`OverflowError` may be raised if ``d.year`` was ``MINYEAR`` or ``MAXYEAR`` " -"and UTC adjustment spills over a year boundary." +"returned. :attr:`tm_isdst` is forced to 0. Note that an :exc:`OverflowError` " +"may be raised if *d*.year was ``MINYEAR`` or ``MAXYEAR`` and UTC adjustment " +"spills over a year boundary." msgstr "" +"*d* が aware だった場合、 *d* は ``d.utcoffset()`` を引いて UTC 時刻に正規化" +"され、その時刻が :class:`time.struct_time` として返されます。 :attr:" +"`tm_isdst` は 0 に強制されます。 *d*.year が ``MINYEAR`` もしくは " +"``MAXYEAR`` であり、 UTC 時刻への調整により適切な年の範囲を越えた場合、 :exc:" +"`OverflowError` が送出される可能性があることに注意してください。" -#: ../../library/datetime.rst:1486 +#: ../../library/datetime.rst:1340 msgid "" "Because naive ``datetime`` objects are treated by many ``datetime`` methods " "as local times, it is preferred to use aware datetimes to represent times in " -"UTC; as a result, using :meth:`datetime.utctimetuple` may give misleading " -"results. If you have a naive ``datetime`` representing UTC, use ``datetime." +"UTC; as a result, using ``utcfromtimetuple`` may give misleading results. If " +"you have a naive ``datetime`` representing UTC, use ``datetime." "replace(tzinfo=timezone.utc)`` to make it aware, at which point you can use :" "meth:`.datetime.timetuple`." msgstr "" "naive な ``datetime`` オブジェクトは多くの ``datetime`` メソッドでローカルな" "時間として扱われるため、 aware な datetime を使って UTC の時刻を表すのが好ま" -"しいです。結果として、 :meth:`datetime.utctimetuple` は誤解を招きやすい返り値" -"を返すかもしれません。\n" +"しいです。結果として、 ``utcfromtimetuple`` は誤解を招きやすい返り値を返すか" +"もしれません。\n" "UTC を表す naive な ``datetime`` があった場合、 :meth:`.datetime.timetuple` " "が使えるところでは ``datetime.replace(tzinfo=timezone.utc)`` で aware にしま" "す。" -#: ../../library/datetime.rst:1495 +#: ../../library/datetime.rst:1349 msgid "" "Return the proleptic Gregorian ordinal of the date. The same as ``self." "date().toordinal()``." @@ -2478,7 +2113,7 @@ msgstr "" "先発グレゴリオ暦における日付序数を返します。``self.date().toordinal()`` と同" "じです。" -#: ../../library/datetime.rst:1500 +#: ../../library/datetime.rst:1354 msgid "" "Return POSIX timestamp corresponding to the :class:`.datetime` instance. The " "return value is a :class:`float` similar to that returned by :func:`time." @@ -2487,33 +2122,28 @@ msgstr "" ":class:`.datetime` インスタンスに対応する POSIX タイムスタンプを返します。\n" "返り値は :func:`time.time` で返される値に近い :class:`float` です。" -#: ../../library/datetime.rst:1504 +#: ../../library/datetime.rst:1358 msgid "" "Naive :class:`.datetime` instances are assumed to represent local time and " "this method relies on the platform C :c:func:`mktime` function to perform " "the conversion. Since :class:`.datetime` supports wider range of values " "than :c:func:`mktime` on many platforms, this method may raise :exc:" -"`OverflowError` or :exc:`OSError` for times far in the past or far in the " -"future." +"`OverflowError` for times far in the past or far in the future." msgstr "" "このメソッドでは naive な :class:`.datetime` インスタンスはローカル時刻とし、" "プラットフォームの C 関数 :c:func:`mktime` に頼って変換を行います。\n" ":class:`.datetime` は多くのプラットフォームの :c:func:`mktime` より広い範囲の" "値をサポートしているので、遥か過去の時刻や遥か未来の時刻に対し、このメソッド" -"は :exc:`OverflowError` または :exc:`OSError` を送出するかもしれません。" +"は :exc:`OverflowError` を送出するかもしれません。" -#: ../../library/datetime.rst:1511 +#: ../../library/datetime.rst:1365 msgid "" "For aware :class:`.datetime` instances, the return value is computed as::" msgstr "" "aware な :class:`.datetime` インスタンスに対しては以下のように返り値が計算さ" "れます::" -#: ../../library/datetime.rst:1514 -msgid "(dt - datetime(1970, 1, 1, tzinfo=timezone.utc)).total_seconds()" -msgstr "" - -#: ../../library/datetime.rst:1518 +#: ../../library/datetime.rst:1372 msgid "" "The :meth:`timestamp` method uses the :attr:`.fold` attribute to " "disambiguate the times during a repeated interval." @@ -2521,11 +2151,11 @@ msgstr "" " :meth:`timestamp` メソッドは :attr:`.fold` 属性を繰り返し時間での曖昧さ回避" "に使用します。" -#: ../../library/datetime.rst:1524 +#: ../../library/datetime.rst:1378 msgid "" "There is no method to obtain the POSIX timestamp directly from a naive :" "class:`.datetime` instance representing UTC time. If your application uses " -"this convention and your system time zone is not set to UTC, you can obtain " +"this convention and your system timezone is not set to UTC, you can obtain " "the POSIX timestamp by supplying ``tzinfo=timezone.utc``::" msgstr "" "UTC 時刻を表す naive な :class:`.datetime` インスタンスから直接 POSIX タイム" @@ -2534,19 +2164,11 @@ msgstr "" "れていなかった場合、 ``tzinfo=timezone.utc`` を引数に与えることで POSIX タイ" "ムスタンプを取得できます::" -#: ../../library/datetime.rst:1530 -msgid "timestamp = dt.replace(tzinfo=timezone.utc).timestamp()" -msgstr "" - -#: ../../library/datetime.rst:1532 +#: ../../library/datetime.rst:1386 msgid "or by calculating the timestamp directly::" msgstr "もしくは直接タイムスタンプを計算することもできます::" -#: ../../library/datetime.rst:1534 -msgid "timestamp = (dt - datetime(1970, 1, 1)) / timedelta(seconds=1)" -msgstr "" - -#: ../../library/datetime.rst:1538 +#: ../../library/datetime.rst:1392 msgid "" "Return the day of the week as an integer, where Monday is 0 and Sunday is 6. " "The same as ``self.date().weekday()``. See also :meth:`isoweekday`." @@ -2554,7 +2176,7 @@ msgstr "" "月曜日を 0、日曜日を 6 として、曜日を整数で返します。 ``self.date()." "weekday()`` と同じです。 :meth:`isoweekday` も参照してください。" -#: ../../library/datetime.rst:1544 +#: ../../library/datetime.rst:1398 msgid "" "Return the day of the week as an integer, where Monday is 1 and Sunday is 7. " "The same as ``self.date().isoweekday()``. See also :meth:`weekday`, :meth:" @@ -2564,7 +2186,7 @@ msgstr "" "isoweekday()`` と等価です。 :meth:`weekday` 、 :meth:`isocalendar` も参照して" "ください。" -#: ../../library/datetime.rst:1551 +#: ../../library/datetime.rst:1405 msgid "" "Return a :term:`named tuple` with three components: ``year``, ``week`` and " "``weekday``. The same as ``self.date().isocalendar()``." @@ -2572,19 +2194,19 @@ msgstr "" "``year``、``week``、``weekday`` の3つで構成された :term:`named tuple` を返し" "ます。 ``self.date().isocalendar()`` と等価です。" -#: ../../library/datetime.rst:1557 +#: ../../library/datetime.rst:1411 msgid "Return a string representing the date and time in ISO 8601 format:" msgstr "日時を ISO 8601 書式で表した文字列で返します::" -#: ../../library/datetime.rst:1559 +#: ../../library/datetime.rst:1413 msgid "``YYYY-MM-DDTHH:MM:SS.ffffff``, if :attr:`microsecond` is not 0" msgstr ":attr:`microsecond` が 0 でない場合は ``YYYY-MM-DDTHH:MM:SS.ffffff``" -#: ../../library/datetime.rst:1560 +#: ../../library/datetime.rst:1414 msgid "``YYYY-MM-DDTHH:MM:SS``, if :attr:`microsecond` is 0" msgstr ":attr:`microsecond` が 0 の場合は ``YYYY-MM-DDTHH:MM:SS``" -#: ../../library/datetime.rst:1562 +#: ../../library/datetime.rst:1416 msgid "" "If :meth:`utcoffset` does not return ``None``, a string is appended, giving " "the UTC offset:" @@ -2592,7 +2214,7 @@ msgstr "" ":meth:`utcoffset` が ``None`` を返さない場合は、文字列の後ろに UTC オフセット" "が追記されます:" -#: ../../library/datetime.rst:1565 +#: ../../library/datetime.rst:1419 msgid "" "``YYYY-MM-DDTHH:MM:SS.ffffff+HH:MM[:SS[.ffffff]]``, if :attr:`microsecond` " "is not 0" @@ -2600,22 +2222,13 @@ msgstr "" ":attr:`microsecond` が 0 でない場合は ``YYYY-MM-DDTHH:MM:SS.ffffff+HH:MM[:" "SS[.ffffff]]``" -#: ../../library/datetime.rst:1567 +#: ../../library/datetime.rst:1421 msgid "" "``YYYY-MM-DDTHH:MM:SS+HH:MM[:SS[.ffffff]]``, if :attr:`microsecond` is 0" msgstr "" ":attr:`microsecond` が 0 の場合は ``YYYY-MM-DDTHH:MM:SS+HH:MM[:SS[.ffffff]]``" -#: ../../library/datetime.rst:1571 -msgid "" -">>> from datetime import datetime, timezone\n" -">>> datetime(2019, 5, 18, 15, 17, 8, 132263).isoformat()\n" -"'2019-05-18T15:17:08.132263'\n" -">>> datetime(2019, 5, 18, 15, 17, tzinfo=timezone.utc).isoformat()\n" -"'2019-05-18T15:17:00+00:00'" -msgstr "" - -#: ../../library/datetime.rst:1577 +#: ../../library/datetime.rst:1431 msgid "" "The optional argument *sep* (default ``'T'``) is a one-character separator, " "placed between the date and time portions of the result. For example::" @@ -2623,21 +2236,7 @@ msgstr "" "オプションの引数 *sep* (デフォルトでは ``'T'`` です) は 1 文字のセパレータ" "で、結果の文字列の日付と時刻の間に置かれます。例えば::" -#: ../../library/datetime.rst:1580 -msgid "" -">>> from datetime import tzinfo, timedelta, datetime\n" -">>> class TZ(tzinfo):\n" -"... \"\"\"A time zone with an arbitrary, constant -06:39 offset.\"\"\"\n" -"... def utcoffset(self, dt):\n" -"... return timedelta(hours=-6, minutes=-39)\n" -"...\n" -">>> datetime(2002, 12, 25, tzinfo=TZ()).isoformat(' ')\n" -"'2002-12-25 00:00:00-06:39'\n" -">>> datetime(2009, 11, 27, microsecond=100, tzinfo=TZ()).isoformat()\n" -"'2009-11-27T00:00:00.000100-06:39'" -msgstr "" - -#: ../../library/datetime.rst:1591 ../../library/datetime.rst:1982 +#: ../../library/datetime.rst:1445 ../../library/datetime.rst:1806 msgid "" "The optional argument *timespec* specifies the number of additional " "components of the time to include (the default is ``'auto'``). It can be one " @@ -2646,7 +2245,7 @@ msgstr "" "オプション引数 *timespec* は、含める追加の時間の要素の数を指定します(デフォル" "トでは ``'auto'`` です)。以下の内一つを指定してください。" -#: ../../library/datetime.rst:1595 ../../library/datetime.rst:1986 +#: ../../library/datetime.rst:1449 ../../library/datetime.rst:1810 msgid "" "``'auto'``: Same as ``'seconds'`` if :attr:`microsecond` is 0, same as " "``'microseconds'`` otherwise." @@ -2654,18 +2253,18 @@ msgstr "" "``'auto'``: :attr:`microsecond` が0である場合 ``'seconds'`` と等しく、そうで" "ない場合は ``'microseconds'`` と等しくなります。" -#: ../../library/datetime.rst:1597 ../../library/datetime.rst:1988 +#: ../../library/datetime.rst:1451 ../../library/datetime.rst:1812 msgid "``'hours'``: Include the :attr:`hour` in the two-digit ``HH`` format." msgstr "``'hours'``: :attr:`hour` を2桁の ``HH`` 書式で含めます。" -#: ../../library/datetime.rst:1598 ../../library/datetime.rst:1989 +#: ../../library/datetime.rst:1452 ../../library/datetime.rst:1813 msgid "" "``'minutes'``: Include :attr:`hour` and :attr:`minute` in ``HH:MM`` format." msgstr "" "``'minutes'``: :attr:`hour` および :attr:`minute` を ``HH:MM`` の書式で含めま" "す。" -#: ../../library/datetime.rst:1599 ../../library/datetime.rst:1990 +#: ../../library/datetime.rst:1453 ../../library/datetime.rst:1814 msgid "" "``'seconds'``: Include :attr:`hour`, :attr:`minute`, and :attr:`second` in " "``HH:MM:SS`` format." @@ -2673,7 +2272,7 @@ msgstr "" "``'seconds'``: :attr:`hour` 、 :attr:`minute` 、 :attr:`second` を ``HH:MM:" "SS`` の書式で含めます。" -#: ../../library/datetime.rst:1601 ../../library/datetime.rst:1992 +#: ../../library/datetime.rst:1455 ../../library/datetime.rst:1816 msgid "" "``'milliseconds'``: Include full time, but truncate fractional second part " "to milliseconds. ``HH:MM:SS.sss`` format." @@ -2682,51 +2281,36 @@ msgstr "" "す。\n" "``HH:MM:SS.sss`` の書式で表現します。" -#: ../../library/datetime.rst:1603 ../../library/datetime.rst:1994 +#: ../../library/datetime.rst:1457 ../../library/datetime.rst:1818 msgid "``'microseconds'``: Include full time in ``HH:MM:SS.ffffff`` format." msgstr "" "``'microseconds'``: 全ての時刻を ``HH:MM:SS.mmmmmm`` の書式で含めます。" -#: ../../library/datetime.rst:1607 ../../library/datetime.rst:1998 +#: ../../library/datetime.rst:1461 ../../library/datetime.rst:1822 msgid "Excluded time components are truncated, not rounded." msgstr "除外された要素は丸め込みではなく、切り捨てされます。" -#: ../../library/datetime.rst:1609 +#: ../../library/datetime.rst:1463 msgid ":exc:`ValueError` will be raised on an invalid *timespec* argument::" msgstr "不正な *timespec* 引数には :exc:`ValueError` があげられます::" -#: ../../library/datetime.rst:1612 -msgid "" -">>> from datetime import datetime\n" -">>> datetime.now().isoformat(timespec='minutes')\n" -"'2002-12-25T00:00'\n" -">>> dt = datetime(2015, 1, 1, 12, 30, 59, 0)\n" -">>> dt.isoformat(timespec='microseconds')\n" -"'2015-01-01T12:30:59.000000'" -msgstr "" - -#: ../../library/datetime.rst:1619 ../../library/datetime.rst:2013 -msgid "Added the *timespec* parameter." -msgstr "*timespec* パラメータを追加しました." +#: ../../library/datetime.rst:1473 ../../library/datetime.rst:1837 +msgid "Added the *timespec* argument." +msgstr "*timespec* 引数が追加されました。" -#: ../../library/datetime.rst:1625 +#: ../../library/datetime.rst:1479 msgid "" -"For a :class:`.datetime` instance ``d``, ``str(d)`` is equivalent to ``d." +"For a :class:`.datetime` instance *d*, ``str(d)`` is equivalent to ``d." "isoformat(' ')``." msgstr "" +":class:`.datetime` オブジェクト *d* において、 ``str(d)`` は ``d.isoformat(' " +"')`` と等価です。" -#: ../../library/datetime.rst:1631 +#: ../../library/datetime.rst:1485 msgid "Return a string representing the date and time::" msgstr "日付および時刻を表す文字列を返します::" -#: ../../library/datetime.rst:1633 -msgid "" -">>> from datetime import datetime\n" -">>> datetime(2002, 12, 4, 20, 30, 40).ctime()\n" -"'Wed Dec 4 20:30:40 2002'" -msgstr "" - -#: ../../library/datetime.rst:1637 +#: ../../library/datetime.rst:1491 msgid "" "The output string will *not* include time zone information, regardless of " "whether the input is aware or naive." @@ -2734,7 +2318,7 @@ msgstr "" "出力文字列は入力が aware であれ naive であれ、タイムゾーン情報を含み *ません" "*。" -#: ../../library/datetime.rst:1644 +#: ../../library/datetime.rst:1498 msgid "" "on platforms where the native C :c:func:`ctime` function (which :func:`time." "ctime` invokes, but which :meth:`datetime.ctime` does not invoke) conforms " @@ -2744,93 +2328,39 @@ msgstr "" "ctime` に呼び出されない) ネイティブの C 関数 :c:func:`ctime` が C 標準に準拠" "しているプラットフォーム上でです。" -#: ../../library/datetime.rst:1651 +#: ../../library/datetime.rst:1504 msgid "" "Return a string representing the date and time, controlled by an explicit " -"format string. See also :ref:`strftime-strptime-behavior` and :meth:" -"`datetime.isoformat`." +"format string. For a complete list of formatting directives, see :ref:" +"`strftime-strptime-behavior`." msgstr "" -"明示的な書式文字列で制御された、日付および時刻を表現する文字列を返します。:" -"ref:`strftime-strptime-behavior` および :meth:`datetime.isoformat` も参照して" -"ください。" +"明示的な書式文字列で制御された、日付および時刻を表現する文字列を返します。完" +"全な書式化指定子のリストについては :ref:`strftime-strptime-behavior` を参照し" +"てください。" -#: ../../library/datetime.rst:1658 +#: ../../library/datetime.rst:1511 msgid "" "Same as :meth:`.datetime.strftime`. This makes it possible to specify a " "format string for a :class:`.datetime` object in :ref:`formatted string " -"literals ` and when using :meth:`str.format`. See also :ref:" -"`strftime-strptime-behavior` and :meth:`datetime.isoformat`." +"literals ` and when using :meth:`str.format`. For a complete list " +"of formatting directives, see :ref:`strftime-strptime-behavior`." msgstr "" -":meth:`.datetime.strftime` と等価です。\n" +":meth:`datetime.strftime` と等価です。\n" "これにより、 :ref:`フォーマット済み文字列リテラル ` の中や :meth:" "`str.format` を使っているときに :class:`.datetime` オブジェクトの書式文字列を" "指定できます。\n" -":ref:`strftime-strptime-behavior` および :meth:`datetime.isoformat` も参照し" -"てください。" +"書式化指定子の完全なリストについては :ref:`strftime-strptime-behavior` を参照" +"してください。" -#: ../../library/datetime.rst:1665 +#: ../../library/datetime.rst:1518 msgid "Examples of Usage: :class:`.datetime`" msgstr "使用例: :class:`.datetime`" -#: ../../library/datetime.rst:1667 -msgid "Examples of working with :class:`.datetime` objects:" -msgstr ":class:`.datetime` オブジェクトを使う例::" - -#: ../../library/datetime.rst:1669 -msgid "" -">>> from datetime import datetime, date, time, timezone\n" -"\n" -">>> # Using datetime.combine()\n" -">>> d = date(2005, 7, 14)\n" -">>> t = time(12, 30)\n" -">>> datetime.combine(d, t)\n" -"datetime.datetime(2005, 7, 14, 12, 30)\n" -"\n" -">>> # Using datetime.now()\n" -">>> datetime.now()\n" -"datetime.datetime(2007, 12, 6, 16, 29, 43, 79043) # GMT +1\n" -">>> datetime.now(timezone.utc)\n" -"datetime.datetime(2007, 12, 6, 15, 29, 43, 79060, tzinfo=datetime.timezone." -"utc)\n" -"\n" -">>> # Using datetime.strptime()\n" -">>> dt = datetime.strptime(\"21/11/06 16:30\", \"%d/%m/%y %H:%M\")\n" -">>> dt\n" -"datetime.datetime(2006, 11, 21, 16, 30)\n" -"\n" -">>> # Using datetime.timetuple() to get tuple of all attributes\n" -">>> tt = dt.timetuple()\n" -">>> for it in tt:\n" -"... print(it)\n" -"...\n" -"2006 # year\n" -"11 # month\n" -"21 # day\n" -"16 # hour\n" -"30 # minute\n" -"0 # second\n" -"1 # weekday (0 = Monday)\n" -"325 # number of days since 1st January\n" -"-1 # dst - method tzinfo.dst() returned None\n" -"\n" -">>> # Date in ISO format\n" -">>> ic = dt.isocalendar()\n" -">>> for it in ic:\n" -"... print(it)\n" -"...\n" -"2006 # ISO year\n" -"47 # ISO week\n" -"2 # ISO weekday\n" -"\n" -">>> # Formatting a datetime\n" -">>> dt.strftime(\"%A, %d. %B %Y %I:%M%p\")\n" -"'Tuesday, 21. November 2006 04:30PM'\n" -">>> 'The {1} is {0:%d}, the {2} is {0:%B}, the {3} is {0:%I:%M%p}.'." -"format(dt, \"day\", \"month\", \"time\")\n" -"'The day is 21, the month is November, the time is 04:30PM.'" -msgstr "" - -#: ../../library/datetime.rst:1720 +#: ../../library/datetime.rst:1520 +msgid "Examples of working with :class:`~datetime.datetime` objects:" +msgstr ":class:`~datetime.datetime` オブジェクトを使う例:" + +#: ../../library/datetime.rst:1573 msgid "" "The example below defines a :class:`tzinfo` subclass capturing time zone " "information for Kabul, Afghanistan, which used +4 UTC until 1945 and then " @@ -2840,95 +2370,24 @@ msgstr "" "ガニスタンのカブールのタイムゾーン情報を表現する :class:`tzinfo` のサブクラス" "を定義しています::" -#: ../../library/datetime.rst:1724 -msgid "" -"from datetime import timedelta, datetime, tzinfo, timezone\n" -"\n" -"class KabulTz(tzinfo):\n" -" # Kabul used +4 until 1945, when they moved to +4:30\n" -" UTC_MOVE_DATE = datetime(1944, 12, 31, 20, tzinfo=timezone.utc)\n" -"\n" -" def utcoffset(self, dt):\n" -" if dt.year < 1945:\n" -" return timedelta(hours=4)\n" -" elif (1945, 1, 1, 0, 0) <= dt.timetuple()[:5] < (1945, 1, 1, 0, " -"30):\n" -" # An ambiguous (\"imaginary\") half-hour range representing\n" -" # a 'fold' in time due to the shift from +4 to +4:30.\n" -" # If dt falls in the imaginary range, use fold to decide how\n" -" # to resolve. See PEP495.\n" -" return timedelta(hours=4, minutes=(30 if dt.fold else 0))\n" -" else:\n" -" return timedelta(hours=4, minutes=30)\n" -"\n" -" def fromutc(self, dt):\n" -" # Follow same validations as in datetime.tzinfo\n" -" if not isinstance(dt, datetime):\n" -" raise TypeError(\"fromutc() requires a datetime argument\")\n" -" if dt.tzinfo is not self:\n" -" raise ValueError(\"dt.tzinfo is not self\")\n" -"\n" -" # A custom implementation is required for fromutc as\n" -" # the input to this function is a datetime with utc values\n" -" # but with a tzinfo set to self.\n" -" # See datetime.astimezone or fromtimestamp.\n" -" if dt.replace(tzinfo=timezone.utc) >= self.UTC_MOVE_DATE:\n" -" return dt + timedelta(hours=4, minutes=30)\n" -" else:\n" -" return dt + timedelta(hours=4)\n" -"\n" -" def dst(self, dt):\n" -" # Kabul does not observe daylight saving time.\n" -" return timedelta(0)\n" -"\n" -" def tzname(self, dt):\n" -" if dt >= self.UTC_MOVE_DATE:\n" -" return \"+04:30\"\n" -" return \"+04\"" -msgstr "" - -#: ../../library/datetime.rst:1767 +#: ../../library/datetime.rst:1620 msgid "Usage of ``KabulTz`` from above::" msgstr "上に出てきた ``KabulTz`` の使い方::" -#: ../../library/datetime.rst:1769 -msgid "" -">>> tz1 = KabulTz()\n" -"\n" -">>> # Datetime before the change\n" -">>> dt1 = datetime(1900, 11, 21, 16, 30, tzinfo=tz1)\n" -">>> print(dt1.utcoffset())\n" -"4:00:00\n" -"\n" -">>> # Datetime after the change\n" -">>> dt2 = datetime(2006, 6, 14, 13, 0, tzinfo=tz1)\n" -">>> print(dt2.utcoffset())\n" -"4:30:00\n" -"\n" -">>> # Convert datetime to another time zone\n" -">>> dt3 = dt2.astimezone(timezone.utc)\n" -">>> dt3\n" -"datetime.datetime(2006, 6, 14, 8, 30, tzinfo=datetime.timezone.utc)\n" -">>> dt2\n" -"datetime.datetime(2006, 6, 14, 13, 0, tzinfo=KabulTz())\n" -">>> dt2 == dt3\n" -"True" -msgstr "" - -#: ../../library/datetime.rst:1793 +#: ../../library/datetime.rst:1646 msgid ":class:`.time` Objects" msgstr ":class:`.time` オブジェクト" -#: ../../library/datetime.rst:1795 +#: ../../library/datetime.rst:1648 msgid "" -"A :class:`.time` object represents a (local) time of day, independent of any " +"A :class:`time` object represents a (local) time of day, independent of any " "particular day, and subject to adjustment via a :class:`tzinfo` object." msgstr "" -":class:`.time` オブジェクトは (ローカルの) 日中時刻を表現します。\n" +":class:`time` オブジェクトは (ローカルの) 日中時刻を表現します。\n" "この時刻表現は特定の日の影響を受けず、 :class:`tzinfo` オブジェクトを介した修" "正の対象となります。" -#: ../../library/datetime.rst:1800 +#: ../../library/datetime.rst:1653 msgid "" "All arguments are optional. *tzinfo* may be ``None``, or an instance of a :" "class:`tzinfo` subclass. The remaining arguments must be integers in the " @@ -2938,24 +2397,24 @@ msgstr "" "スのサブクラスのインスタンスにすることができます。残りの引数は整数で、以下の" "ような範囲に入らなければなりません:" -#: ../../library/datetime.rst:1810 +#: ../../library/datetime.rst:1663 msgid "" "If an argument outside those ranges is given, :exc:`ValueError` is raised. " -"All default to 0 except *tzinfo*, which defaults to ``None``." +"All default to ``0`` except *tzinfo*, which defaults to :const:`None`." msgstr "" "引数がこれらの範囲外にある場合、 :exc:`ValueError` が送出されます。 *tzinfo* " -"のデフォルト値が ``None`` である以外のデフォルト値は0です。" +"のデフォルト値が :const:`None` である以外のデフォルト値は ``0`` です。" -#: ../../library/datetime.rst:1818 +#: ../../library/datetime.rst:1671 msgid "The earliest representable :class:`.time`, ``time(0, 0, 0, 0)``." msgstr "表現できる最も古い :class:`.time` で、 ``time(0, 0, 0, 0)`` です。" -#: ../../library/datetime.rst:1823 +#: ../../library/datetime.rst:1676 msgid "The latest representable :class:`.time`, ``time(23, 59, 59, 999999)``." msgstr "" "表現できる最も新しい :class:`.time` で、 ``time(23, 59, 59, 999999)`` です。" -#: ../../library/datetime.rst:1828 +#: ../../library/datetime.rst:1681 msgid "" "The smallest possible difference between non-equal :class:`.time` objects, " "``timedelta(microseconds=1)``, although note that arithmetic on :class:`." @@ -2965,7 +2424,7 @@ msgstr "" "``timedelta(microseconds=1)`` ですが, :class:`.time` オブジェクト間の四則演算" "はサポートされていないので注意してください。" -#: ../../library/datetime.rst:1857 +#: ../../library/datetime.rst:1710 msgid "" "The object passed as the tzinfo argument to the :class:`.time` constructor, " "or ``None`` if none was passed." @@ -2973,47 +2432,61 @@ msgstr "" ":class:`.time` コンストラクタに *tzinfo* 引数として与えられたオブジェクトにな" "り、何も渡されなかった場合には ``None`` になります。" -#: ../../library/datetime.rst:1871 -msgid "" -":class:`.time` objects support equality and order comparisons, where ``a`` " -"is considered less than ``b`` when ``a`` precedes ``b`` in time." -msgstr "" - -#: ../../library/datetime.rst:1874 -msgid "" -"Naive and aware :class:`!time` objects are never equal. Order comparison " -"between naive and aware :class:`!time` objects raises :exc:`TypeError`." -msgstr "" - -#: ../../library/datetime.rst:1878 +#: ../../library/datetime.rst:1724 msgid "" -"If both comparands are aware, and have the same :attr:`~.time.tzinfo` " -"attribute, the :attr:`!tzinfo` and :attr:`!fold` attributes are ignored and " -"the base times are compared. If both comparands are aware and have " -"different :attr:`!tzinfo` attributes, the comparands are first adjusted by " -"subtracting their UTC offsets (obtained from ``self.utcoffset()``)." -msgstr "" -"比較対象が両方とも aware であり、同じ :attr:`~.time.tzinfo` 属性を持つ場" -"合、 :attr:`!tzinfo` と :attr:`!fold` 属性は無視され時間だけで比較が行われま" -"す。比較対象が両方とも aware であり、異なる :attr:`!tzinfo` 属性を持つ場合、" +":class:`.time` objects support comparison of :class:`.time` to :class:`." +"time`, where *a* is considered less than *b* when *a* precedes *b* in time. " +"If one comparand is naive and the other is aware, :exc:`TypeError` is raised " +"if an order comparison is attempted. For equality comparisons, naive " +"instances are never equal to aware instances." +msgstr "" +":class:`.time` オブジェクトは :class:`.time` どうしの比較をサポートしてい" +"て、 *a* が *b* より前の時刻だった場合 *a* が *b* より小さいとされます。\n" +"比較対象の片方が naive であり、もう片方が aware の場合に、順序比較が行われる" +"と :exc:`TypeError` が送出されます。\n" +"等価比較では、 naive インスタンスと aware インスタンスは等価になることはあり" +"ません。" + +#: ../../library/datetime.rst:1730 +msgid "" +"If both comparands are aware, and have the same :attr:`~time.tzinfo` " +"attribute, the common :attr:`~time.tzinfo` attribute is ignored and the base " +"times are compared. If both comparands are aware and have different :attr:" +"`~time.tzinfo` attributes, the comparands are first adjusted by subtracting " +"their UTC offsets (obtained from ``self.utcoffset()``). In order to stop " +"mixed-type comparisons from falling back to the default comparison by object " +"address, when a :class:`.time` object is compared to an object of a " +"different type, :exc:`TypeError` is raised unless the comparison is ``==`` " +"or ``!=``. The latter cases return :const:`False` or :const:`True`, " +"respectively." +msgstr "" +"比較対象が両方とも aware であり、同じ :attr:`~time.tzinfo` 属性を持つ場合、 :" +"attr:`~time.tzinfo` は無視され datetime だけで比較が行われます。\n" +"比較対象が両方とも aware であり、異なる :attr:`~time.tzinfo` 属性を持つ場合、" "まず最初に (``self.utcoffset()`` で取得できる) それぞれの UTC オフセットを引" -"く調整が行われます。" +"いて調整します。\n" +"異なる型どうしの比較がデフォルトのオブジェクトアドレス比較となってしまうのを" +"防ぐために、 :class:`.time` オブジェクトを異なる型のオブジェクトと比較する" +"と、比較演算子が ``==`` または ``!=`` でないかぎり :exc:`TypeError` が送出さ" +"れます。\n" +"比較演算子が ``==`` または ``!=`` である場合、それぞれ :const:`False` また" +"は :const:`True` を返します。" -#: ../../library/datetime.rst:1884 +#: ../../library/datetime.rst:1740 msgid "" -"Equality comparisons between aware and naive :class:`.time` instances don't " -"raise :exc:`TypeError`." +"Equality comparisons between aware and naive :class:`~datetime.time` " +"instances don't raise :exc:`TypeError`." msgstr "" -"aware な インスタンスと naive な :class:`.time` インスタンスの等価比較では :" -"exc:`TypeError` は送出されません。" +"aware な :class:`datetime` インスタンスと naive な :class:`~datetime.time` イ" +"ンスタンスの等価比較では :exc:`TypeError` は送出されません。" -#: ../../library/datetime.rst:1888 +#: ../../library/datetime.rst:1744 msgid "" "In Boolean contexts, a :class:`.time` object is always considered to be true." msgstr "" "ブール値の文脈では、 :class:`.time` オブジェクトは常に真とみなされます。" -#: ../../library/datetime.rst:1890 +#: ../../library/datetime.rst:1746 msgid "" "Before Python 3.5, a :class:`.time` object was considered to be false if it " "represented midnight in UTC. This behavior was considered obscure and error-" @@ -3026,116 +2499,53 @@ msgstr "" "た。\n" "全詳細については :issue:`13936` を参照してください。" -#: ../../library/datetime.rst:1897 -msgid "Other constructors:" -msgstr "" - -#: ../../library/datetime.rst:1901 -msgid "" -"Return a :class:`.time` corresponding to a *time_string* in any valid ISO " -"8601 format, with the following exceptions:" -msgstr "" -"以下の例外を除く、有効な ISO 8601 フォーマットで与えられた *time_string* に対" -"応する :class:`.time` を返します :" - -#: ../../library/datetime.rst:1905 -msgid "" -"The leading ``T``, normally required in cases where there may be ambiguity " -"between a date and a time, is not required." -msgstr "" - -#: ../../library/datetime.rst:1907 -msgid "" -"Fractional seconds may have any number of digits (anything beyond 6 will be " -"truncated)." -msgstr "" - -#: ../../library/datetime.rst:1911 -msgid "Examples:" -msgstr "例:" +#: ../../library/datetime.rst:1753 +msgid "Other constructor:" +msgstr "その他のコンストラクタ:" -#: ../../library/datetime.rst:1913 +#: ../../library/datetime.rst:1757 msgid "" -">>> from datetime import time\n" -">>> time.fromisoformat('04:23:01')\n" -"datetime.time(4, 23, 1)\n" -">>> time.fromisoformat('T04:23:01')\n" -"datetime.time(4, 23, 1)\n" -">>> time.fromisoformat('T042301')\n" -"datetime.time(4, 23, 1)\n" -">>> time.fromisoformat('04:23:01.000384')\n" -"datetime.time(4, 23, 1, 384)\n" -">>> time.fromisoformat('04:23:01,000384')\n" -"datetime.time(4, 23, 1, 384)\n" -">>> time.fromisoformat('04:23:01+04:00')\n" -"datetime.time(4, 23, 1, tzinfo=datetime.timezone(datetime." -"timedelta(seconds=14400)))\n" -">>> time.fromisoformat('04:23:01Z')\n" -"datetime.time(4, 23, 1, tzinfo=datetime.timezone.utc)\n" -">>> time.fromisoformat('04:23:01+00:00')\n" -"datetime.time(4, 23, 1, tzinfo=datetime.timezone.utc)" +"Return a :class:`.time` corresponding to a *time_string* in one of the " +"formats emitted by :meth:`time.isoformat`. Specifically, this function " +"supports strings in the format:" msgstr "" +":meth:`time.isoformat` の出力書式のうちの1つの書式で、 *time_string* に対応す" +"る :class:`time` を返します。\n" +"具体的には、この関数は次の書式の文字列をサポートしています:" -#: ../../library/datetime.rst:1935 -msgid "" -"Previously, this method only supported formats that could be emitted by :" -"meth:`time.isoformat`." -msgstr "" - -#: ../../library/datetime.rst:1941 -msgid "" -"Return a :class:`.time` corresponding to *date_string*, parsed according to " -"*format*." -msgstr "" - -#: ../../library/datetime.rst:1944 -msgid "" -"If *format* does not contain microseconds or timezone information, this is " -"equivalent to::" -msgstr "" -"*format* がマイクロ秒やタイムゾーン情報を含まない場合は、以下と等価です::" - -#: ../../library/datetime.rst:1946 -msgid "time(*(time.strptime(date_string, format)[3:6]))" -msgstr "" - -#: ../../library/datetime.rst:1948 -msgid "" -":exc:`ValueError` is raised if the *date_string* and *format* cannot be " -"parsed by :func:`time.strptime` or if it returns a value which is not a time " -"tuple. See also :ref:`strftime-strptime-behavior` and :meth:`time." -"fromisoformat`." -msgstr "" - -#: ../../library/datetime.rst:1961 +#: ../../library/datetime.rst:1767 msgid "" -"Return a new :class:`.time` with the same values, but with specified " -"parameters updated. Note that ``tzinfo=None`` can be specified to create a " -"naive :class:`.time` from an aware :class:`.time`, without conversion of the " -"time data." +"This does *not* support parsing arbitrary ISO 8601 strings. It is only " +"intended as the inverse operation of :meth:`time.isoformat`." msgstr "" +"この関数は、任意の ISO 8601 文字列の構文解析をサポートしているわけでは *あり" +"ません* これは :meth:`time.isoformat` の逆演算を意図して実装されています。" -#: ../../library/datetime.rst:1966 +#: ../../library/datetime.rst:1788 msgid "" -":class:`.time` objects are also supported by generic function :func:`copy." -"replace`." +"Return a :class:`.time` with the same value, except for those attributes " +"given new values by whichever keyword arguments are specified. Note that " +"``tzinfo=None`` can be specified to create a naive :class:`.time` from an " +"aware :class:`.time`, without conversion of the time data." msgstr "" -":class:`.time` オブジェクトは汎用的な関数 :func:`copy.replace` にもサポートさ" -"れています。" +"キーワード引数で指定したメンバの値を除き、同じ値をもつ :class:`.time` オブ" +"ジェクトを返します。データに対する変換を行わずに aware な :class:`.time` オブ" +"ジェクトから naive な :class:`.time` オブジェクトを生成するために、 " +"``tzinfo=None`` を指定することもできます。" -#: ../../library/datetime.rst:1975 +#: ../../library/datetime.rst:1799 msgid "Return a string representing the time in ISO 8601 format, one of:" msgstr "時刻を ISO 8601 書式で表した次の文字列のうち1つを返します::" -#: ../../library/datetime.rst:1977 +#: ../../library/datetime.rst:1801 msgid "``HH:MM:SS.ffffff``, if :attr:`microsecond` is not 0" msgstr ":attr:`microsecond` が 0 でない場合は ``HH:MM:SS.ffffff``" -#: ../../library/datetime.rst:1978 +#: ../../library/datetime.rst:1802 msgid "``HH:MM:SS``, if :attr:`microsecond` is 0" msgstr ":attr:`microsecond` が 0 の場合は ``HH:MM:SS``" -#: ../../library/datetime.rst:1979 +#: ../../library/datetime.rst:1803 msgid "" "``HH:MM:SS.ffffff+HH:MM[:SS[.ffffff]]``, if :meth:`utcoffset` does not " "return ``None``" @@ -3143,7 +2553,7 @@ msgstr "" ":meth:`utcoffset` が ``None`` を返さない場合、 ``HH:MM:SS.ffffff+HH:MM[:SS[." "ffffff]]``" -#: ../../library/datetime.rst:1980 +#: ../../library/datetime.rst:1804 msgid "" "``HH:MM:SS+HH:MM[:SS[.ffffff]]``, if :attr:`microsecond` is 0 and :meth:" "`utcoffset` does not return ``None``" @@ -3151,52 +2561,41 @@ msgstr "" ":attr:`microsecond` が 0 で :meth:`utcoffset` が ``None`` を返さない場合、 " "``HH:MM:SS+HH:MM[:SS[.ffffff]]``" -#: ../../library/datetime.rst:2000 +#: ../../library/datetime.rst:1824 msgid ":exc:`ValueError` will be raised on an invalid *timespec* argument." msgstr "不正な *timespec* 引数には :exc:`ValueError` があげられます。" -#: ../../library/datetime.rst:2004 -msgid "" -">>> from datetime import time\n" -">>> time(hour=12, minute=34, second=56, microsecond=123456)." -"isoformat(timespec='minutes')\n" -"'12:34'\n" -">>> dt = time(hour=12, minute=34, second=56, microsecond=0)\n" -">>> dt.isoformat(timespec='microseconds')\n" -"'12:34:56.000000'\n" -">>> dt.isoformat(timespec='auto')\n" -"'12:34:56'" -msgstr "" - -#: ../../library/datetime.rst:2019 -msgid "For a time ``t``, ``str(t)`` is equivalent to ``t.isoformat()``." +#: ../../library/datetime.rst:1843 +msgid "For a time *t*, ``str(t)`` is equivalent to ``t.isoformat()``." msgstr "" +":class:`time` オブジェクト *t* において、``str(t)`` は ``t.isoformat()`` と等" +"価です。" -#: ../../library/datetime.rst:2024 +#: ../../library/datetime.rst:1848 msgid "" "Return a string representing the time, controlled by an explicit format " -"string. See also :ref:`strftime-strptime-behavior` and :meth:`time." -"isoformat`." +"string. For a complete list of formatting directives, see :ref:`strftime-" +"strptime-behavior`." msgstr "" -"明示的な書式文字列で制御された、時刻を表現する文字列を返します。:ref:" -"`strftime-strptime-behavior` および :meth:`time.isoformat` も参照してくださ" +"明示的な書式文字列で制御された、時刻を表現する文字列を返します。完全な書式化" +"指定子のリストについては :ref:`strftime-strptime-behavior` を参照してくださ" "い。" -#: ../../library/datetime.rst:2030 +#: ../../library/datetime.rst:1855 msgid "" "Same as :meth:`.time.strftime`. This makes it possible to specify a format " "string for a :class:`.time` object in :ref:`formatted string literals ` and when using :meth:`str.format`. See also :ref:`strftime-" -"strptime-behavior` and :meth:`time.isoformat`." +"strings>` and when using :meth:`str.format`. For a complete list of " +"formatting directives, see :ref:`strftime-strptime-behavior`." msgstr "" -":meth:`.time.strftime` と等価です。\n" +":meth:`time.strftime` と等価です。\n" "これにより、 :ref:`フォーマット済み文字列リテラル ` の中や :meth:" "`str.format` を使っているときに :class:`.time` オブジェクトの書式文字列を指定" "できます。\n" -":ref:`strftime-strptime-behavior` および :meth:`time.isoformat` も参照してく" -"ださい。" +"書式化指定子の完全なリストについては :ref:`strftime-strptime-behavior` を参照" +"してください。" -#: ../../library/datetime.rst:2038 +#: ../../library/datetime.rst:1864 msgid "" "If :attr:`.tzinfo` is ``None``, returns ``None``, else returns ``self.tzinfo." "utcoffset(None)``, and raises an exception if the latter doesn't return " @@ -3207,7 +2606,7 @@ msgstr "" "後者の式が ``None`` あるいは 1 日以下の大きさを持つ :class:`timedelta` オブ" "ジェクトのいずれかを返さない場合には例外を送出します。" -#: ../../library/datetime.rst:2048 +#: ../../library/datetime.rst:1874 msgid "" "If :attr:`.tzinfo` is ``None``, returns ``None``, else returns ``self.tzinfo." "dst(None)``, and raises an exception if the latter doesn't return ``None``, " @@ -3218,7 +2617,7 @@ msgstr "" "後者の式が ``None`` もしくは、1 日未満の大きさを持つ :class:`timedelta` オブ" "ジェクトのいずれかを返さない場合には例外を送出します。" -#: ../../library/datetime.rst:2057 +#: ../../library/datetime.rst:1883 msgid "" "If :attr:`.tzinfo` is ``None``, returns ``None``, else returns ``self.tzinfo." "tzname(None)``, or raises an exception if the latter doesn't return ``None`` " @@ -3229,47 +2628,19 @@ msgstr "" "後者の式が ``None`` か文字列オブジェクトのいずれかを返さない場合には例外を送" "出します。" -#: ../../library/datetime.rst:2062 +#: ../../library/datetime.rst:1888 msgid "Examples of Usage: :class:`.time`" msgstr "使用例: :class:`.time`" -#: ../../library/datetime.rst:2064 +#: ../../library/datetime.rst:1890 msgid "Examples of working with a :class:`.time` object::" msgstr ":class:`.time` オブジェクトを使う例::" -#: ../../library/datetime.rst:2066 -msgid "" -">>> from datetime import time, tzinfo, timedelta\n" -">>> class TZ1(tzinfo):\n" -"... def utcoffset(self, dt):\n" -"... return timedelta(hours=1)\n" -"... def dst(self, dt):\n" -"... return timedelta(0)\n" -"... def tzname(self,dt):\n" -"... return \"+01:00\"\n" -"... def __repr__(self):\n" -"... return f\"{self.__class__.__name__}()\"\n" -"...\n" -">>> t = time(12, 10, 30, tzinfo=TZ1())\n" -">>> t\n" -"datetime.time(12, 10, 30, tzinfo=TZ1())\n" -">>> t.isoformat()\n" -"'12:10:30+01:00'\n" -">>> t.dst()\n" -"datetime.timedelta(0)\n" -">>> t.tzname()\n" -"'+01:00'\n" -">>> t.strftime(\"%H:%M:%S %Z\")\n" -"'12:10:30 +01:00'\n" -">>> 'The {} is {:%H:%M}.'.format(\"time\", t)\n" -"'The time is 12:10.'" -msgstr "" - -#: ../../library/datetime.rst:2095 +#: ../../library/datetime.rst:1921 msgid ":class:`tzinfo` Objects" msgstr ":class:`tzinfo` オブジェクト" -#: ../../library/datetime.rst:2099 +#: ../../library/datetime.rst:1925 msgid "" "This is an abstract base class, meaning that this class should not be " "instantiated directly. Define a subclass of :class:`tzinfo` to capture " @@ -3280,7 +2651,7 @@ msgstr "" ":class:`tzinfo` のサブクラスを定義し、ある特定のタイムゾーンに関する情報を保" "持するようにしてください。" -#: ../../library/datetime.rst:2103 +#: ../../library/datetime.rst:1929 msgid "" "An instance of (a concrete subclass of) :class:`tzinfo` can be passed to the " "constructors for :class:`.datetime` and :class:`.time` objects. The latter " @@ -3296,56 +2667,55 @@ msgstr "" "ンの名前、 DST オフセットを、渡された日付および時刻オブジェクトからの相対で示" "すためのメソッドを提供します。" -#: ../../library/datetime.rst:2109 +#: ../../library/datetime.rst:1935 msgid "" "You need to derive a concrete subclass, and (at least) supply " "implementations of the standard :class:`tzinfo` methods needed by the :class:" -"`.datetime` methods you use. The :mod:`!datetime` module provides :class:" +"`.datetime` methods you use. The :mod:`datetime` module provides :class:" "`timezone`, a simple concrete subclass of :class:`tzinfo` which can " -"represent time zones with fixed offset from UTC such as UTC itself or North " +"represent timezones with fixed offset from UTC such as UTC itself or North " "American EST and EDT." msgstr "" "具象サブクラスを作成し、(少なくとも) 使いたい :class:`.datetime` のメソッドが" "必要とする :class:`tzinfo` のメソッドを実装する必要があります。\n" -":mod:`!datetime` モジュールは :class:`tzinfo` のシンプルな具象サブクラス :" +":mod:`datetime` モジュールは :class:`tzinfo` のシンプルな具象サブクラス :" "class:`timezone` を提供します。\n" "これは UTC そのものか北アメリカの EST と EDT のような UTC からの固定されたオ" "フセットを持つタイムゾーンを表せます。" -#: ../../library/datetime.rst:2116 +#: ../../library/datetime.rst:1942 msgid "" "Special requirement for pickling: A :class:`tzinfo` subclass must have an :" -"meth:`~object.__init__` method that can be called with no arguments, " -"otherwise it can be pickled but possibly not unpickled again. This is a " -"technical requirement that may be relaxed in the future." +"meth:`__init__` method that can be called with no arguments, otherwise it " +"can be pickled but possibly not unpickled again. This is a technical " +"requirement that may be relaxed in the future." msgstr "" "pickle 化についての特殊な要求事項: :class:`tzinfo` のサブクラスは引数なしで呼" -"び出すことのできる :meth:`~object.__init__` メソッドを持たなければなりませ" -"ん。そうでなければ、 pickle 化することはできますがおそらく unpickle 化するこ" -"とはできないでしょう。これは技術的な側面からの要求であり、将来緩和されるかも" -"しれません。" +"び出すことのできる :meth:`__init__` メソッドを持たなければなりません。そうで" +"なければ、 pickle 化することはできますがおそらく unpickle 化することはできな" +"いでしょう。これは技術的な側面からの要求であり、将来緩和されるかもしれませ" +"ん。" -#: ../../library/datetime.rst:2122 +#: ../../library/datetime.rst:1947 msgid "" "A concrete subclass of :class:`tzinfo` may need to implement the following " "methods. Exactly which methods are needed depends on the uses made of aware :" -"mod:`!datetime` objects. If in doubt, simply implement all of them." +"mod:`datetime` objects. If in doubt, simply implement all of them." msgstr "" ":class:`tzinfo` の具体的なサブクラスでは、以下のメソッドを実装する必要があり" -"ます。厳密にどのメソッドが必要なのかは、 aware な :mod:`!datetime` オブジェク" +"ます。厳密にどのメソッドが必要なのかは、 aware な :mod:`datetime` オブジェク" "トがこのサブクラスのインスタンスをどのように使うかに依存します。不確かなら" "ば、単に全てを実装してください。" -#: ../../library/datetime.rst:2129 +#: ../../library/datetime.rst:1954 msgid "" "Return offset of local time from UTC, as a :class:`timedelta` object that is " "positive east of UTC. If local time is west of UTC, this should be negative." msgstr "" -"ローカル時間の UTC からのオフセットを、 UTC から東向きを正とした :class:" -"`timedelta` オブジェクトで返します。ローカル時間が UTC の西側にある場合、この" -"値は負になります。" +"ローカル時間の UTC からのオフセットを、 UTC から東向きを正とした分で返しま" +"す。ローカル時間が UTC の西側にある場合、この値は負になります。" -#: ../../library/datetime.rst:2132 +#: ../../library/datetime.rst:1957 msgid "" "This represents the *total* offset from UTC; for example, if a :class:" "`tzinfo` object represents both time zone and DST adjustments, :meth:" @@ -3366,13 +2736,7 @@ msgstr "" "ほとんどの :meth:`utcoffset` 実装は、おそらく以下の二つのうちの一つに似たもの" "になるでしょう::" -#: ../../library/datetime.rst:2140 -msgid "" -"return CONSTANT # fixed-offset class\n" -"return CONSTANT + self.dst(dt) # daylight-aware class" -msgstr "" - -#: ../../library/datetime.rst:2143 +#: ../../library/datetime.rst:1968 msgid "" "If :meth:`utcoffset` does not return ``None``, :meth:`dst` should not return " "``None`` either." @@ -3380,7 +2744,7 @@ msgstr "" ":meth:`utcoffset` が ``None`` を返さない場合、 :meth:`dst` も ``None`` を返し" "てはなりません。" -#: ../../library/datetime.rst:2146 +#: ../../library/datetime.rst:1971 msgid "" "The default implementation of :meth:`utcoffset` raises :exc:" "`NotImplementedError`." @@ -3388,15 +2752,15 @@ msgstr "" ":meth:`utcoffset` のデフォルトの実装は :exc:`NotImplementedError` を送出しま" "す。" -#: ../../library/datetime.rst:2155 +#: ../../library/datetime.rst:1980 msgid "" "Return the daylight saving time (DST) adjustment, as a :class:`timedelta` " "object or ``None`` if DST information isn't known." msgstr "" -"夏時間 (DST) 修正を、 :class:`timedelta` オブジェクトで返します。\n" +"夏時間 (DST) 修正を、 UTC から東向きを正とした分で返します。\n" "DST 情報が未知の場合、 ``None`` が返されます。" -#: ../../library/datetime.rst:2159 +#: ../../library/datetime.rst:1984 msgid "" "Return ``timedelta(0)`` if DST is not in effect. If DST is in effect, return " "the offset as a :class:`timedelta` object (see :meth:`utcoffset` for " @@ -3404,9 +2768,9 @@ msgid "" "UTC offset returned by :meth:`utcoffset`, so there's no need to consult :" "meth:`dst` unless you're interested in obtaining DST info separately. For " "example, :meth:`datetime.timetuple` calls its :attr:`~.datetime.tzinfo` " -"attribute's :meth:`dst` method to determine how the :attr:`~time.struct_time." -"tm_isdst` flag should be set, and :meth:`tzinfo.fromutc` calls :meth:`dst` " -"to account for DST changes when crossing time zones." +"attribute's :meth:`dst` method to determine how the :attr:`tm_isdst` flag " +"should be set, and :meth:`tzinfo.fromutc` calls :meth:`dst` to account for " +"DST changes when crossing time zones." msgstr "" "DST が有効でない場合には ``timedelta(0)`` を返します。\n" "DST が有効の場合、オフセットは :class:`timedelta` オブジェクトで返します (詳" @@ -3415,11 +2779,11 @@ msgstr "" "オフセットには既に加算されているため、 DST を個別に取得する必要がない限り :" "meth:`dst` を使って問い合わせる必要はないので注意してください。\n" "例えば、 :meth:`datetime.timetuple` は :attr:`~.datetime.tzinfo` 属性の :" -"meth:`dst` メソッドを呼んで :attr:`~time.struct_time.tm_isdst` フラグがセット" -"されているかどうか判断し、 :meth:`tzinfo.fromutc` は :meth:`dst` タイムゾーン" -"を移動する際に DST による変更があるかどうかを調べます。" +"meth:`dst` メソッドを呼んで :attr:`tm_isdst` フラグがセットされているかどうか" +"判断し、 :meth:`tzinfo.fromutc` は :meth:`dst` タイムゾーンを移動する際に " +"DST による変更があるかどうかを調べます。" -#: ../../library/datetime.rst:2169 +#: ../../library/datetime.rst:1994 msgid "" "An instance *tz* of a :class:`tzinfo` subclass that models both standard and " "daylight times must be consistent in this sense:" @@ -3427,21 +2791,21 @@ msgstr "" "標準および夏時間の両方をモデル化している :class:`tzinfo` サブクラスのインスタ" "ンス *tz* は以下の式:" -#: ../../library/datetime.rst:2172 +#: ../../library/datetime.rst:1997 msgid "``tz.utcoffset(dt) - tz.dst(dt)``" msgstr "``tz.utcoffset(dt) - tz.dst(dt)``" -#: ../../library/datetime.rst:2174 +#: ../../library/datetime.rst:1999 msgid "" "must return the same result for every :class:`.datetime` *dt* with ``dt." -"tzinfo == tz``. For sane :class:`tzinfo` subclasses, this expression yields " +"tzinfo == tz`` For sane :class:`tzinfo` subclasses, this expression yields " "the time zone's \"standard offset\", which should not depend on the date or " "the time, but only on geographic location. The implementation of :meth:" "`datetime.astimezone` relies on this, but cannot detect violations; it's the " "programmer's responsibility to ensure it. If a :class:`tzinfo` subclass " "cannot guarantee this, it may be able to override the default implementation " -"of :meth:`tzinfo.fromutc` to work correctly with :meth:`~.datetime." -"astimezone` regardless." +"of :meth:`tzinfo.fromutc` to work correctly with :meth:`astimezone` " +"regardless." msgstr "" "が、 ``dt.tzinfo == tz`` 全ての :class:`.datetime` オブジェクト *dt* について" "常に同じ結果を返さなければならないという点で、一貫性を持っていなければなりま" @@ -3453,7 +2817,7 @@ msgstr "" "れを保証することができない場合、 :meth:`tzinfo.fromutc` の実装をオーバライド" "して、 :meth:`astimezone` に関わらず正しく動作するようにしてもかまいません。" -#: ../../library/datetime.rst:2183 +#: ../../library/datetime.rst:2008 msgid "" "Most implementations of :meth:`dst` will probably look like one of these " "two::" @@ -3461,67 +2825,46 @@ msgstr "" "ほとんどの :meth:`dst` 実装は、おそらく以下の二つのうちの一つに似たものになる" "でしょう::" -#: ../../library/datetime.rst:2185 -msgid "" -"def dst(self, dt):\n" -" # a fixed-offset class: doesn't account for DST\n" -" return timedelta(0)" -msgstr "" - -#: ../../library/datetime.rst:2189 +#: ../../library/datetime.rst:2014 msgid "or::" msgstr "もしくは::" -#: ../../library/datetime.rst:2191 -msgid "" -"def dst(self, dt):\n" -" # Code to set dston and dstoff to the time zone's DST\n" -" # transition times based on the input dt.year, and expressed\n" -" # in standard local time.\n" -"\n" -" if dston <= dt.replace(tzinfo=None) < dstoff:\n" -" return timedelta(hours=1)\n" -" else:\n" -" return timedelta(0)" -msgstr "" - -#: ../../library/datetime.rst:2201 +#: ../../library/datetime.rst:2026 msgid "" "The default implementation of :meth:`dst` raises :exc:`NotImplementedError`." msgstr "" "デフォルトの :meth:`dst` 実装は :exc:`NotImplementedError` を送出します。" -#: ../../library/datetime.rst:2209 +#: ../../library/datetime.rst:2034 msgid "" "Return the time zone name corresponding to the :class:`.datetime` object " -"*dt*, as a string. Nothing about string names is defined by the :mod:`!" -"datetime` module, and there's no requirement that it mean anything in " -"particular. For example, ``\"GMT\"``, ``\"UTC\"``, ``\"-500\"``, " -"``\"-5:00\"``, ``\"EDT\"``, ``\"US/Eastern\"``, ``\"America/New York\"`` are " -"all valid replies. Return ``None`` if a string name isn't known. Note that " -"this is a method rather than a fixed string primarily because some :class:" -"`tzinfo` subclasses will wish to return different names depending on the " -"specific value of *dt* passed, especially if the :class:`tzinfo` class is " -"accounting for daylight time." +"*dt*, as a string. Nothing about string names is defined by the :mod:" +"`datetime` module, and there's no requirement that it mean anything in " +"particular. For example, \"GMT\", \"UTC\", \"-500\", \"-5:00\", \"EDT\", " +"\"US/Eastern\", \"America/New York\" are all valid replies. Return ``None`` " +"if a string name isn't known. Note that this is a method rather than a fixed " +"string primarily because some :class:`tzinfo` subclasses will wish to return " +"different names depending on the specific value of *dt* passed, especially " +"if the :class:`tzinfo` class is accounting for daylight time." msgstr "" ":class:`.datetime` オブジェクト *dt* に対応するタイムゾーン名を文字列で返しま" -"す。 :mod:`!datetime` モジュールでは文字列名について何も定義しておらず、特に" -"何かを意味するといった要求仕様もまったくありません。例えば、``\"GMT\"``, " -"``\"UTC\"``, ``\"-500\"``, ``\"-5:00\"``, ``\"EDT\"``, ``\"US/Eastern\"``, " -"``\"America/New York\"`` は全て有効な応答となります。文字列名が未知の場合に" -"は ``None`` を返してください。 :class:`tzinfo` のサブクラスでは、特に, :" -"class:`tzinfo` クラスが夏時間について記述している場合のように、渡された *dt* " -"の特定の値によって異なった名前を返したい場合があるため、文字列値ではなくメ" -"ソッドとなっていることに注意してください。" +"す。 :mod:`datetime` モジュールでは文字列名について何も定義しておらず、特に何" +"かを意味するといった要求仕様もまったくありません。例えば、 \"GMT\", \"UTC\", " +"\"-500\", \"-5:00\", \"EDT\", \"US/Eastern\", \"America/New York\" は全て有効" +"な応答となります。文字列名が未知の場合には ``None`` を返してください。 :" +"class:`tzinfo` のサブクラスでは、特に, :class:`tzinfo` クラスが夏時間について" +"記述している場合のように、渡された *dt* の特定の値によって異なった名前を返し" +"たい場合があるため、文字列値ではなくメソッドとなっていることに注意してくださ" +"い。" -#: ../../library/datetime.rst:2219 +#: ../../library/datetime.rst:2044 msgid "" "The default implementation of :meth:`tzname` raises :exc:" "`NotImplementedError`." msgstr "" "デフォルトの :meth:`tzname` 実装は :exc:`NotImplementedError` を送出します。" -#: ../../library/datetime.rst:2222 +#: ../../library/datetime.rst:2047 msgid "" "These methods are called by a :class:`.datetime` or :class:`.time` object, " "in response to their methods of the same names. A :class:`.datetime` object " @@ -3537,7 +2880,7 @@ msgstr "" "におけるメソッドは引数 *dt* が ``None`` の場合と、 :class:`.datetime` の場合" "を受理するように用意しなければなりません。" -#: ../../library/datetime.rst:2228 +#: ../../library/datetime.rst:2053 msgid "" "When ``None`` is passed, it's up to the class designer to decide the best " "response. For example, returning ``None`` is appropriate if the class wishes " @@ -3551,14 +2894,14 @@ msgstr "" "場合には、標準 UTC オフセットを返すために ``utcoffset(None)`` を使うともっと" "便利かもしれません。" -#: ../../library/datetime.rst:2234 +#: ../../library/datetime.rst:2059 msgid "" "When a :class:`.datetime` object is passed in response to a :class:`." "datetime` method, ``dt.tzinfo`` is the same object as *self*. :class:" "`tzinfo` methods can rely on this, unless user code calls :class:`tzinfo` " "methods directly. The intent is that the :class:`tzinfo` methods interpret " -"*dt* as being in local time, and not need worry about objects in other time " -"zones." +"*dt* as being in local time, and not need worry about objects in other " +"timezones." msgstr "" ":class:`.datetime` オブジェクトが :meth:`.datetime` メソッドの応答として返さ" "れた場合、 ``dt.tzinfo`` は *self* と同じオブジェクトになります。ユーザが直" @@ -3567,7 +2910,7 @@ msgstr "" "`tzinfo` メソッドは *dt* がローカル時間であると解釈するので、他のタイムゾーン" "でのオブジェクトの振る舞いについて心配する必要がありません。" -#: ../../library/datetime.rst:2240 +#: ../../library/datetime.rst:2065 msgid "" "There is one more :class:`tzinfo` method that a subclass may wish to " "override:" @@ -3575,21 +2918,21 @@ msgstr "" "サブクラスでオーバーライドすると良い、もう 1 つの :class:`tzinfo` のメソッド" "があります:" -#: ../../library/datetime.rst:2245 +#: ../../library/datetime.rst:2070 msgid "" -"This is called from the default :meth:`datetime.astimezone` implementation. " -"When called from that, ``dt.tzinfo`` is *self*, and *dt*'s date and time " -"data are to be viewed as expressing a UTC time. The purpose of :meth:" -"`fromutc` is to adjust the date and time data, returning an equivalent " -"datetime in *self*'s local time." +"This is called from the default :class:`datetime.astimezone()` " +"implementation. When called from that, ``dt.tzinfo`` is *self*, and *dt*'s " +"date and time data are to be viewed as expressing a UTC time. The purpose " +"of :meth:`fromutc` is to adjust the date and time data, returning an " +"equivalent datetime in *self*'s local time." msgstr "" -"デフォルトの 実装で呼び出されます。 :meth:`datetime.astimezone` から呼ばれた" -"場合、 ``dt.tzinfo`` は *self* であり、 *dt* の日付および時刻データは UTC 時" -"刻を表しているものとして見えます。 :meth:`fromutc` の目的は、 *self* のローカ" -"ル時刻に等しい :class:`datetime` オブジェクトを返すことにより日付と時刻データ" -"メンバを修正することにあります。" +"デフォルトの :class:`datetime.astimezone()` 実装で呼び出されます。 :class:" +"`datetime.astimezone()` から呼ばれた場合、 ``dt.tzinfo`` は *self* であり、 " +"*dt* の日付および時刻データは UTC 時刻を表しているものとして見えます。 :meth:" +"`fromutc` の目的は、 *self* のローカル時刻に等しい :class:`datetime` オブジェ" +"クトを返すことにより日付と時刻データメンバを修正することにあります。" -#: ../../library/datetime.rst:2251 +#: ../../library/datetime.rst:2076 msgid "" "Most :class:`tzinfo` subclasses should be able to inherit the default :meth:" "`fromutc` implementation without problems. It's strong enough to handle " @@ -3599,9 +2942,8 @@ msgid "" "implementation may not handle correctly in all cases is one where the " "standard offset (from UTC) depends on the specific date and time passed, " "which can happen for political reasons. The default implementations of :meth:" -"`~.datetime.astimezone` and :meth:`fromutc` may not produce the result you " -"want if the result is one of the hours straddling the moment the standard " -"offset changes." +"`astimezone` and :meth:`fromutc` may not produce the result you want if the " +"result is one of the hours straddling the moment the standard offset changes." msgstr "" "ほとんどの :class:`tzinfo` サブクラスではデフォルトの :meth:`fromutc` 実装を" "問題なく継承できます。デフォルトの実装は、固定オフセットのタイムゾーンや、標" @@ -3609,12 +2951,11 @@ msgstr "" "よって異なる場合でさえ、扱えるくらい強力なものです。デフォルトの :meth:" "`fromutc` 実装が全ての場合に対して正しく扱うことができないような例は、標準時" "の (UTCからの) オフセットが引数として渡された特定の日や時刻に依存するもので、" -"これは政治的な理由によって起きることがあります。デフォルトの :meth:`~." -"datetime.astimezone` や :meth:`fromutc` の実装は、結果が標準時オフセットの変" -"化にまたがる何時間かの中にある場合、期待通りの結果を生成しないかもしれませ" -"ん。" +"これは政治的な理由によって起きることがあります。デフォルトの :meth:" +"`astimezone` や :meth:`fromutc` の実装は、結果が標準時オフセットの変化にまた" +"がる何時間かの中にある場合、期待通りの結果を生成しないかもしれません。" -#: ../../library/datetime.rst:2262 +#: ../../library/datetime.rst:2087 msgid "" "Skipping code for error cases, the default :meth:`fromutc` implementation " "acts like::" @@ -3622,25 +2963,7 @@ msgstr "" "エラーの場合のためのコードを除き、デフォルトの :meth:`fromutc` の実装は以下の" "ように動作します::" -#: ../../library/datetime.rst:2265 -msgid "" -"def fromutc(self, dt):\n" -" # raise ValueError error if dt.tzinfo is not self\n" -" dtoff = dt.utcoffset()\n" -" dtdst = dt.dst()\n" -" # raise ValueError if dtoff is None or dtdst is None\n" -" delta = dtoff - dtdst # this is self's standard offset\n" -" if delta:\n" -" dt += delta # convert to standard local time\n" -" dtdst = dt.dst()\n" -" # raise ValueError if dtdst is None\n" -" if dtdst:\n" -" return dt + dtdst\n" -" else:\n" -" return dt" -msgstr "" - -#: ../../library/datetime.rst:2280 +#: ../../library/datetime.rst:2105 msgid "" "In the following :download:`tzinfo_examples.py <../includes/tzinfo_examples." "py>` file there are some examples of :class:`tzinfo` classes:" @@ -3648,187 +2971,7 @@ msgstr "" "次の :download:`tzinfo_examples.py <../includes/tzinfo_examples.py>` ファイル" "には、 :class:`tzinfo` クラスの例がいくつか載っています:" -#: ../../library/datetime.rst:2284 -msgid "" -"from datetime import tzinfo, timedelta, datetime\n" -"\n" -"ZERO = timedelta(0)\n" -"HOUR = timedelta(hours=1)\n" -"SECOND = timedelta(seconds=1)\n" -"\n" -"# A class capturing the platform's idea of local time.\n" -"# (May result in wrong values on historical times in\n" -"# timezones where UTC offset and/or the DST rules had\n" -"# changed in the past.)\n" -"import time as _time\n" -"\n" -"STDOFFSET = timedelta(seconds = -_time.timezone)\n" -"if _time.daylight:\n" -" DSTOFFSET = timedelta(seconds = -_time.altzone)\n" -"else:\n" -" DSTOFFSET = STDOFFSET\n" -"\n" -"DSTDIFF = DSTOFFSET - STDOFFSET\n" -"\n" -"class LocalTimezone(tzinfo):\n" -"\n" -" def fromutc(self, dt):\n" -" assert dt.tzinfo is self\n" -" stamp = (dt - datetime(1970, 1, 1, tzinfo=self)) // SECOND\n" -" args = _time.localtime(stamp)[:6]\n" -" dst_diff = DSTDIFF // SECOND\n" -" # Detect fold\n" -" fold = (args == _time.localtime(stamp - dst_diff))\n" -" return datetime(*args, microsecond=dt.microsecond,\n" -" tzinfo=self, fold=fold)\n" -"\n" -" def utcoffset(self, dt):\n" -" if self._isdst(dt):\n" -" return DSTOFFSET\n" -" else:\n" -" return STDOFFSET\n" -"\n" -" def dst(self, dt):\n" -" if self._isdst(dt):\n" -" return DSTDIFF\n" -" else:\n" -" return ZERO\n" -"\n" -" def tzname(self, dt):\n" -" return _time.tzname[self._isdst(dt)]\n" -"\n" -" def _isdst(self, dt):\n" -" tt = (dt.year, dt.month, dt.day,\n" -" dt.hour, dt.minute, dt.second,\n" -" dt.weekday(), 0, 0)\n" -" stamp = _time.mktime(tt)\n" -" tt = _time.localtime(stamp)\n" -" return tt.tm_isdst > 0\n" -"\n" -"Local = LocalTimezone()\n" -"\n" -"\n" -"# A complete implementation of current DST rules for major US time zones.\n" -"\n" -"def first_sunday_on_or_after(dt):\n" -" days_to_go = 6 - dt.weekday()\n" -" if days_to_go:\n" -" dt += timedelta(days_to_go)\n" -" return dt\n" -"\n" -"\n" -"# US DST Rules\n" -"#\n" -"# This is a simplified (i.e., wrong for a few cases) set of rules for US\n" -"# DST start and end times. For a complete and up-to-date set of DST rules\n" -"# and timezone definitions, visit the Olson Database (or try pytz):\n" -"# http://www.twinsun.com/tz/tz-link.htm\n" -"# https://sourceforge.net/projects/pytz/ (might not be up-to-date)\n" -"#\n" -"# In the US, since 2007, DST starts at 2am (standard time) on the second\n" -"# Sunday in March, which is the first Sunday on or after Mar 8.\n" -"DSTSTART_2007 = datetime(1, 3, 8, 2)\n" -"# and ends at 2am (DST time) on the first Sunday of Nov.\n" -"DSTEND_2007 = datetime(1, 11, 1, 2)\n" -"# From 1987 to 2006, DST used to start at 2am (standard time) on the first\n" -"# Sunday in April and to end at 2am (DST time) on the last\n" -"# Sunday of October, which is the first Sunday on or after Oct 25.\n" -"DSTSTART_1987_2006 = datetime(1, 4, 1, 2)\n" -"DSTEND_1987_2006 = datetime(1, 10, 25, 2)\n" -"# From 1967 to 1986, DST used to start at 2am (standard time) on the last\n" -"# Sunday in April (the one on or after April 24) and to end at 2am (DST " -"time)\n" -"# on the last Sunday of October, which is the first Sunday\n" -"# on or after Oct 25.\n" -"DSTSTART_1967_1986 = datetime(1, 4, 24, 2)\n" -"DSTEND_1967_1986 = DSTEND_1987_2006\n" -"\n" -"def us_dst_range(year):\n" -" # Find start and end times for US DST. For years before 1967, return\n" -" # start = end for no DST.\n" -" if 2006 < year:\n" -" dststart, dstend = DSTSTART_2007, DSTEND_2007\n" -" elif 1986 < year < 2007:\n" -" dststart, dstend = DSTSTART_1987_2006, DSTEND_1987_2006\n" -" elif 1966 < year < 1987:\n" -" dststart, dstend = DSTSTART_1967_1986, DSTEND_1967_1986\n" -" else:\n" -" return (datetime(year, 1, 1), ) * 2\n" -"\n" -" start = first_sunday_on_or_after(dststart.replace(year=year))\n" -" end = first_sunday_on_or_after(dstend.replace(year=year))\n" -" return start, end\n" -"\n" -"\n" -"class USTimeZone(tzinfo):\n" -"\n" -" def __init__(self, hours, reprname, stdname, dstname):\n" -" self.stdoffset = timedelta(hours=hours)\n" -" self.reprname = reprname\n" -" self.stdname = stdname\n" -" self.dstname = dstname\n" -"\n" -" def __repr__(self):\n" -" return self.reprname\n" -"\n" -" def tzname(self, dt):\n" -" if self.dst(dt):\n" -" return self.dstname\n" -" else:\n" -" return self.stdname\n" -"\n" -" def utcoffset(self, dt):\n" -" return self.stdoffset + self.dst(dt)\n" -"\n" -" def dst(self, dt):\n" -" if dt is None or dt.tzinfo is None:\n" -" # An exception may be sensible here, in one or both cases.\n" -" # It depends on how you want to treat them. The default\n" -" # fromutc() implementation (called by the default astimezone()\n" -" # implementation) passes a datetime with dt.tzinfo is self.\n" -" return ZERO\n" -" assert dt.tzinfo is self\n" -" start, end = us_dst_range(dt.year)\n" -" # Can't compare naive to aware objects, so strip the timezone from\n" -" # dt first.\n" -" dt = dt.replace(tzinfo=None)\n" -" if start + HOUR <= dt < end - HOUR:\n" -" # DST is in effect.\n" -" return HOUR\n" -" if end - HOUR <= dt < end:\n" -" # Fold (an ambiguous hour): use dt.fold to disambiguate.\n" -" return ZERO if dt.fold else HOUR\n" -" if start <= dt < start + HOUR:\n" -" # Gap (a non-existent hour): reverse the fold rule.\n" -" return HOUR if dt.fold else ZERO\n" -" # DST is off.\n" -" return ZERO\n" -"\n" -" def fromutc(self, dt):\n" -" assert dt.tzinfo is self\n" -" start, end = us_dst_range(dt.year)\n" -" start = start.replace(tzinfo=self)\n" -" end = end.replace(tzinfo=self)\n" -" std_time = dt + self.stdoffset\n" -" dst_time = std_time + HOUR\n" -" if end <= dst_time < end + HOUR:\n" -" # Repeated hour\n" -" return std_time.replace(fold=1)\n" -" if std_time < start or dst_time >= end:\n" -" # Standard time\n" -" return std_time\n" -" if start <= std_time < end - HOUR:\n" -" # Daylight saving time\n" -" return dst_time\n" -"\n" -"\n" -"Eastern = USTimeZone(-5, \"Eastern\", \"EST\", \"EDT\")\n" -"Central = USTimeZone(-6, \"Central\", \"CST\", \"CDT\")\n" -"Mountain = USTimeZone(-7, \"Mountain\", \"MST\", \"MDT\")\n" -"Pacific = USTimeZone(-8, \"Pacific\", \"PST\", \"PDT\")\n" -msgstr "" - -#: ../../library/datetime.rst:2286 +#: ../../library/datetime.rst:2111 msgid "" "Note that there are unavoidable subtleties twice per year in a :class:" "`tzinfo` subclass accounting for both standard and daylight time, at the DST " @@ -3842,18 +2985,7 @@ msgstr "" "EDT は 3 月の第二日曜日の 1:59 (EST) の 1 分後に開始し、11 月の最初の日曜日" "の (EDTの) 1:59 に終了します::" -#: ../../library/datetime.rst:2292 -msgid "" -" UTC 3:MM 4:MM 5:MM 6:MM 7:MM 8:MM\n" -" EST 22:MM 23:MM 0:MM 1:MM 2:MM 3:MM\n" -" EDT 23:MM 0:MM 1:MM 2:MM 3:MM 4:MM\n" -"\n" -"start 22:MM 23:MM 0:MM 1:MM 3:MM 4:MM\n" -"\n" -" end 23:MM 0:MM 1:MM 1:MM 2:MM 3:MM" -msgstr "" - -#: ../../library/datetime.rst:2300 +#: ../../library/datetime.rst:2125 msgid "" "When DST starts (the \"start\" line), the local wall clock leaps from 1:59 " "to 3:00. A wall time of the form 2:MM doesn't really make sense on that day, " @@ -3864,39 +2996,23 @@ msgstr "" "DSTの開始 (\"start\" ライン) で、ローカルの実時間は 1:59 から 3:00 に飛びま" "す。\n" "この日には、 2:MM という形式の実時間は意味をなさないので、 DST が始まった日" -"に ``astimezone(Eastern)`` は ``hour == 2`` となる結果を返すことはありませ" +"に ``astimezone(Eastern)`` は ``hour == 2``となる結果を返すことはありませ" "ん。\n" "例として、 2016 年の春方向の移行では、次のような結果になります::" -#: ../../library/datetime.rst:2305 -msgid "" -">>> from datetime import datetime, timezone\n" -">>> from tzinfo_examples import HOUR, Eastern\n" -">>> u0 = datetime(2016, 3, 13, 5, tzinfo=timezone.utc)\n" -">>> for i in range(4):\n" -"... u = u0 + i*HOUR\n" -"... t = u.astimezone(Eastern)\n" -"... print(u.time(), 'UTC =', t.time(), t.tzname())\n" -"...\n" -"05:00:00 UTC = 00:00:00 EST\n" -"06:00:00 UTC = 01:00:00 EST\n" -"07:00:00 UTC = 03:00:00 EDT\n" -"08:00:00 UTC = 04:00:00 EDT" -msgstr "" - -#: ../../library/datetime.rst:2319 +#: ../../library/datetime.rst:2144 msgid "" "When DST ends (the \"end\" line), there's a potentially worse problem: " "there's an hour that can't be spelled unambiguously in local wall time: the " "last hour of daylight time. In Eastern, that's times of the form 5:MM UTC on " "the day daylight time ends. The local wall clock leaps from 1:59 (daylight " "time) back to 1:00 (standard time) again. Local times of the form 1:MM are " -"ambiguous. :meth:`~.datetime.astimezone` mimics the local clock's behavior " -"by mapping two adjacent UTC hours into the same local hour then. In the " -"Eastern example, UTC times of the form 5:MM and 6:MM both map to 1:MM when " -"converted to Eastern, but earlier times have the :attr:`~.datetime.fold` " -"attribute set to 0 and the later times have it set to 1. For example, at the " -"Fall back transition of 2016, we get::" +"ambiguous. :meth:`astimezone` mimics the local clock's behavior by mapping " +"two adjacent UTC hours into the same local hour then. In the Eastern " +"example, UTC times of the form 5:MM and 6:MM both map to 1:MM when converted " +"to Eastern, but earlier times have the :attr:`~datetime.fold` attribute set " +"to 0 and the later times have it set to 1. For example, at the Fall back " +"transition of 2016, we get::" msgstr "" "DST が終了 (\"end\" ライン) で、更なる問題が潜んでいます: ローカルの実時間" "で、曖昧さ無しに時を綴れない 1 時間が存在します: それは夏時間の最後の 1 時間" @@ -3905,45 +3021,31 @@ msgstr "" "ローカルの実時間は (夏時間の) 1:59 から (標準時の) 1:00 に再び巻き戻されま" "す。\n" "ローカルの時刻における 1:MM は曖昧です。\n" -"そして :meth:`~.datetime.astimezone` は 2 つの隣り合う UTC 時間を同じローカル" -"の時間に対応付けて、ローカルの時計の振る舞いを真似ます。\n" +"そして :meth:`astimezone` は 2 つの隣り合う UTC 時間を同じローカルの時間に対" +"応付けて、ローカルの時計の振る舞いを真似ます。\n" "東部の例では、 5:MM および 6:MM という形式の UTC 時刻は両方とも東部時刻に変換" -"された際に 1:MM に対応付けられますが、それ以前の時間は :attr:`~.datetime." +"された際に 1:MM に対応付けられますが、それ以前の時間は :attr:`~datetime." "fold` 属性を 0 にし、以降の時間では 1 にします。例えば、 2016 年での秋方向の" "移行では、次のような結果になります::" -#: ../../library/datetime.rst:2330 -msgid "" -">>> u0 = datetime(2016, 11, 6, 4, tzinfo=timezone.utc)\n" -">>> for i in range(4):\n" -"... u = u0 + i*HOUR\n" -"... t = u.astimezone(Eastern)\n" -"... print(u.time(), 'UTC =', t.time(), t.tzname(), t.fold)\n" -"...\n" -"04:00:00 UTC = 00:00:00 EDT 0\n" -"05:00:00 UTC = 01:00:00 EDT 0\n" -"06:00:00 UTC = 01:00:00 EST 1\n" -"07:00:00 UTC = 02:00:00 EST 0" -msgstr "" - -#: ../../library/datetime.rst:2341 +#: ../../library/datetime.rst:2166 msgid "" "Note that the :class:`.datetime` instances that differ only by the value of " -"the :attr:`~.datetime.fold` attribute are considered equal in comparisons." +"the :attr:`~datetime.fold` attribute are considered equal in comparisons." msgstr "" -":attr:`~.datetime.fold` 属性が異なるだけの :class:`.datetime` インスタンスは" -"比較において等しいとみなされることに注意してください。" +":attr:`~datetime.fold` 属性が異なるだけの :class:`.datetime` インスタンスは比" +"較において等しいとみなされることに注意してください。" -#: ../../library/datetime.rst:2344 +#: ../../library/datetime.rst:2169 msgid "" "Applications that can't bear wall-time ambiguities should explicitly check " -"the value of the :attr:`~.datetime.fold` attribute or avoid using hybrid :" +"the value of the :attr:`~datetime.fold` attribute or avoid using hybrid :" "class:`tzinfo` subclasses; there are no ambiguities when using :class:" "`timezone`, or any other fixed-offset :class:`tzinfo` subclass (such as a " "class representing only EST (fixed offset -5 hours), or only EDT (fixed " "offset -4 hours))." msgstr "" -"壁時間に関する曖昧さは、明示的に :attr:`~.datetime.fold` 属性を検証するか、 :" +"壁時間に関する曖昧さは、明示的に :attr:`~datetime.fold` 属性を検証するか、 :" "class:`timezone` が使用されたハイブリッドな :class:`tzinfo` サブクラスか、そ" "のほかの絶対時間差を示す :class:`tzinfo` サブクラス(EST (-5 時間の絶対時間" "差) のみを表すクラスや、 EDT (-4 時間の絶対時間差) のみを表すクラス)を使用す" @@ -3951,34 +3053,34 @@ msgstr "" "このような曖昧さを許容できないアプリケーションは、このような手法によって回避" "すべきです。" -#: ../../library/datetime.rst:2352 -msgid ":mod:`zoneinfo`" -msgstr ":mod:`zoneinfo`" +#: ../../library/datetime.rst:2184 +msgid "`dateutil.tz `_" +msgstr "`dateutil.tz `_" -#: ../../library/datetime.rst:2353 +#: ../../library/datetime.rst:2178 msgid "" -"The :mod:`!datetime` module has a basic :class:`timezone` class (for " -"handling arbitrary fixed offsets from UTC) and its :attr:`timezone.utc` " -"attribute (a UTC :class:`!timezone` instance)." +"The :mod:`datetime` module has a basic :class:`timezone` class (for handling " +"arbitrary fixed offsets from UTC) and its :attr:`timezone.utc` attribute (a " +"UTC timezone instance)." msgstr "" -":mod:`!datetime` モジュールには (UTC からの任意の固定オフセットを扱う) 基本的" -"な :class:`timezone` クラスと、(UTC :class:`!timezone` のインスタンスであ" -"る) :attr:`timezone.utc` 属性があります。" +":mod:`datetime` モジュールには (UTC からの任意の固定オフセットを扱う) 基本的" +"な :class:`timezone` クラスと、(UTC タイムゾーンのインスタンスである) :attr:" +"`timezone.utc` 属性があります。" -#: ../../library/datetime.rst:2357 +#: ../../library/datetime.rst:2182 msgid "" -"``zoneinfo`` brings the *IANA time zone database* (also known as the Olson " -"database) to Python, and its usage is recommended." +"*dateutil.tz* library brings the *IANA timezone database* (also known as the " +"Olson database) to Python, and its usage is recommended." msgstr "" -"``zoneinfo`` は Python に *IANA タイムゾーンデータベース* (オルソンデータベー" -"スとしても知られています) を導入するもので、これを使うことが推奨されていま" -"す。" +"*dateutil.tz* ライブラリは Python に *IANA タイムゾーンデータベース* (オルソ" +"ンデータベースとしても知られています) を導入するもので、これを使うことが推奨" +"されています。" -#: ../../library/datetime.rst:2360 -msgid "`IANA time zone database `_" +#: ../../library/datetime.rst:2190 +msgid "`IANA timezone database `_" msgstr "`IANA タイムゾーンデータベース `_" -#: ../../library/datetime.rst:2361 +#: ../../library/datetime.rst:2187 msgid "" "The Time Zone Database (often called tz, tzdata or zoneinfo) contains code " "and data that represent the history of local time for many representative " @@ -3991,21 +3093,21 @@ msgstr "" "時刻の履歴を表しています。政治団体によるタイムゾーンの境界、UTC オフセット、" "夏時間のルールの変更を反映するため、定期的にデータベースが更新されます。" -#: ../../library/datetime.rst:2371 +#: ../../library/datetime.rst:2197 msgid ":class:`timezone` Objects" msgstr ":class:`timezone` オブジェクト" -#: ../../library/datetime.rst:2373 +#: ../../library/datetime.rst:2199 msgid "" "The :class:`timezone` class is a subclass of :class:`tzinfo`, each instance " -"of which represents a time zone defined by a fixed offset from UTC." +"of which represents a timezone defined by a fixed offset from UTC." msgstr "" ":class:`timezone` クラスは :class:`tzinfo` のサブクラスで、各インスタンスは " "UTC からの固定されたオフセットで定義されたタイムゾーンを表しています。" -#: ../../library/datetime.rst:2377 +#: ../../library/datetime.rst:2203 msgid "" -"Objects of this class cannot be used to represent time zone information in " +"Objects of this class cannot be used to represent timezone information in " "the locations where different offsets are used in different days of the year " "or where historical changes have been made to civil time." msgstr "" @@ -4013,7 +3115,7 @@ msgstr "" "たり、常用時 (civil time) に歴史的な変化が起きた場所のタイムゾーン情報を表す" "のには使えないので注意してください。" -#: ../../library/datetime.rst:2384 +#: ../../library/datetime.rst:2210 msgid "" "The *offset* argument must be specified as a :class:`timedelta` object " "representing the difference between the local time and UTC. It must be " @@ -4025,22 +3127,23 @@ msgstr "" "``timedelta(hours=24)`` までの両端を含まない範囲に収まっていなくてはなりませ" "ん。そうでない場合 :exc:`ValueError` が送出されます。" -#: ../../library/datetime.rst:2389 +#: ../../library/datetime.rst:2215 msgid "" "The *name* argument is optional. If specified it must be a string that will " "be used as the value returned by the :meth:`datetime.tzname` method." msgstr "" -"*name* 引数は必須ではありません。もし指定された場合、その値は :meth:" -"`datetime.tzname` メソッドの返り値として使われる文字列でなければなりません。" +" *name* 引数は必須ではありません。\n" +"もし指定された場合、その値は :meth:`datetime.tzname` メソッドの返り値として使" +"われる文字列でなければなりません。" -#: ../../library/datetime.rst:2400 ../../library/datetime.rst:2411 +#: ../../library/datetime.rst:2226 ../../library/datetime.rst:2237 msgid "" "Return the fixed value specified when the :class:`timezone` instance is " "constructed." msgstr "" ":class:`timezone` インスタンスが構築されたときに指定された固定値を返します。" -#: ../../library/datetime.rst:2403 +#: ../../library/datetime.rst:2229 msgid "" "The *dt* argument is ignored. The return value is a :class:`timedelta` " "instance equal to the difference between the local time and UTC." @@ -4049,7 +3152,7 @@ msgstr "" "返り値は、ローカル時刻と UTC の差分に等しい :class:`timedelta` インスタンスで" "す。" -#: ../../library/datetime.rst:2414 +#: ../../library/datetime.rst:2240 msgid "" "If *name* is not provided in the constructor, the name returned by " "``tzname(dt)`` is generated from the value of the ``offset`` as follows. If " @@ -4064,19 +3167,19 @@ msgstr "" "HH と MM はそれぞれ二桁の ``offset.hours`` と ``offset.minutes`` を表現しま" "す。" -#: ../../library/datetime.rst:2420 +#: ../../library/datetime.rst:2246 msgid "" -"Name generated from ``offset=timedelta(0)`` is now plain ``'UTC'``, not " +"Name generated from ``offset=timedelta(0)`` is now plain `'UTC'`, not " "``'UTC+00:00'``." msgstr "" "``offset=timedelta(0)`` によって生成される名前はプレーンな `'UTC'` であり " "``'UTC+00:00'`` ではありません。" -#: ../../library/datetime.rst:2427 +#: ../../library/datetime.rst:2253 msgid "Always returns ``None``." msgstr "常に ``None`` を返します。" -#: ../../library/datetime.rst:2431 +#: ../../library/datetime.rst:2257 msgid "" "Return ``dt + offset``. The *dt* argument must be an aware :class:`." "datetime` instance, with ``tzinfo`` set to ``self``." @@ -4084,15 +3187,15 @@ msgstr "" "``dt + offset`` を返します。 *dt* 引数は ``tzinfo`` が ``self`` になっている " "aware な :class:`.datetime` インスタンスでなければなりません。" -#: ../../library/datetime.rst:2438 -msgid "The UTC time zone, ``timezone(timedelta(0))``." +#: ../../library/datetime.rst:2264 +msgid "The UTC timezone, ``timezone(timedelta(0))``." msgstr "UTC タイムゾーン ``timezone(timedelta(0))`` です。" -#: ../../library/datetime.rst:2447 -msgid ":meth:`~.datetime.strftime` and :meth:`~.datetime.strptime` Behavior" -msgstr ":meth:`~.datetime.strftime` と :meth:`~.datetime.strptime` の振る舞い" +#: ../../library/datetime.rst:2273 +msgid ":meth:`strftime` and :meth:`strptime` Behavior" +msgstr ":meth:`strftime` と :meth:`strptime` の振る舞い" -#: ../../library/datetime.rst:2449 +#: ../../library/datetime.rst:2275 msgid "" ":class:`date`, :class:`.datetime`, and :class:`.time` objects all support a " "``strftime(format)`` method, to create a string representing the time under " @@ -4102,87 +3205,87 @@ msgstr "" "``strftime(format)`` メソッドをサポートし、時刻を表現する文字列を明示的な書式" "文字列で統制して作成しています。" -#: ../../library/datetime.rst:2453 +#: ../../library/datetime.rst:2279 msgid "" -"Conversely, the :meth:`date.strptime`, :meth:`datetime.strptime` and :meth:" -"`time.strptime` class methods create an object from a string representing " -"the time and a corresponding format string." +"Conversely, the :meth:`datetime.strptime` class method creates a :class:`." +"datetime` object from a string representing a date and time and a " +"corresponding format string." msgstr "" +"逆に :meth:`datetime.strptime` クラスメソッドは日付や時刻に対応する書式文字列" +"から :class:`.datetime` オブジェクトを生成します。" -#: ../../library/datetime.rst:2457 +#: ../../library/datetime.rst:2283 msgid "" -"The table below provides a high-level comparison of :meth:`~.datetime." -"strftime` versus :meth:`~.datetime.strptime`:" +"The table below provides a high-level comparison of :meth:`strftime` versus :" +"meth:`strptime`:" msgstr "" -"下の表は :meth:`~.datetime.strftime` と :meth:`~.datetime.strptime` との高レ" -"ベルの対比を表しています。" +"下の表は :meth:`strftime` と :meth:`strptime` との高レベルの対比を表していま" +"す。" -#: ../../library/datetime.rst:2461 +#: ../../library/datetime.rst:2287 msgid "``strftime``" msgstr "``strftime``" -#: ../../library/datetime.rst:2461 +#: ../../library/datetime.rst:2287 msgid "``strptime``" msgstr "``strptime``" -#: ../../library/datetime.rst:2463 +#: ../../library/datetime.rst:2289 msgid "Usage" msgstr "使用法" -#: ../../library/datetime.rst:2463 +#: ../../library/datetime.rst:2289 msgid "Convert object to a string according to a given format" msgstr "オブジェクトを与えられた書式に従って文字列に変換する" -#: ../../library/datetime.rst:2463 -msgid "Parse a string into an object given a corresponding format" +#: ../../library/datetime.rst:2289 +msgid "" +"Parse a string into a :class:`.datetime` object given a corresponding format" msgstr "" +"指定された対応する書式で文字列を構文解析して :class:`.datetime` オブジェクト" +"にする" -#: ../../library/datetime.rst:2465 +#: ../../library/datetime.rst:2291 msgid "Type of method" msgstr "メソッドの種類" -#: ../../library/datetime.rst:2465 +#: ../../library/datetime.rst:2291 msgid "Instance method" msgstr "インスタンスメソッド" -#: ../../library/datetime.rst:2465 +#: ../../library/datetime.rst:2291 msgid "Class method" msgstr "クラスメソッド" -#: ../../library/datetime.rst:2467 +#: ../../library/datetime.rst:2293 +msgid "Method of" +msgstr "メソッドを持つクラス" + +#: ../../library/datetime.rst:2293 +msgid ":class:`date`; :class:`.datetime`; :class:`.time`" +msgstr ":class:`date`; :class:`.datetime`; :class:`.time`" + +#: ../../library/datetime.rst:2293 +msgid ":class:`.datetime`" +msgstr ":class:`.datetime`" + +#: ../../library/datetime.rst:2295 msgid "Signature" msgstr "シグネチャ" -#: ../../library/datetime.rst:2467 +#: ../../library/datetime.rst:2295 msgid "``strftime(format)``" msgstr "``strftime(format)``" -#: ../../library/datetime.rst:2467 +#: ../../library/datetime.rst:2295 msgid "``strptime(date_string, format)``" msgstr "``strptime(date_string, format)``" -#: ../../library/datetime.rst:2474 -msgid "" -":meth:`~.datetime.strftime` and :meth:`~.datetime.strptime` Format Codes" -msgstr "" -":meth:`~.datetime.strftime` と :meth:`~.datetime.strptime` の書式コード" - -#: ../../library/datetime.rst:2476 -msgid "" -"These methods accept format codes that can be used to parse and format " -"dates::" -msgstr "" - -#: ../../library/datetime.rst:2478 -msgid "" -">>> datetime.strptime('31/01/22 23:59:59.999999',\n" -"... '%d/%m/%y %H:%M:%S.%f')\n" -"datetime.datetime(2022, 1, 31, 23, 59, 59, 999999)\n" -">>> _.strftime('%a %d %b %Y, %I:%M%p')\n" -"'Mon 31 Jan 2022, 11:59PM'" -msgstr "" +#: ../../library/datetime.rst:2300 +msgid ":meth:`strftime` and :meth:`strptime` Format Codes" +msgstr ":meth:`strftime` と :meth:`strptime` の書式コード" -#: ../../library/datetime.rst:2484 +#: ../../library/datetime.rst:2302 msgid "" "The following is a list of all the format codes that the 1989 C standard " "requires, and these work on all platforms with a standard C implementation." @@ -4190,27 +3293,27 @@ msgstr "" "以下のリストは 1989 C 標準が要求する全ての書式コードで、標準 C 実装があれば全" "ての環境で動作します。" -#: ../../library/datetime.rst:2488 ../../library/datetime.rst:2591 +#: ../../library/datetime.rst:2306 ../../library/datetime.rst:2409 msgid "Directive" msgstr "ディレクティブ" -#: ../../library/datetime.rst:2488 ../../library/datetime.rst:2591 +#: ../../library/datetime.rst:2306 ../../library/datetime.rst:2409 msgid "Meaning" msgstr "意味" -#: ../../library/datetime.rst:2488 ../../library/datetime.rst:2591 +#: ../../library/datetime.rst:2306 ../../library/datetime.rst:2409 msgid "Example" msgstr "使用例" -#: ../../library/datetime.rst:2488 ../../library/datetime.rst:2591 +#: ../../library/datetime.rst:2306 ../../library/datetime.rst:2409 msgid "Notes" msgstr "注釈" -#: ../../library/datetime.rst:2490 +#: ../../library/datetime.rst:2308 msgid "``%a``" msgstr "``%a``" -#: ../../library/datetime.rst:2490 +#: ../../library/datetime.rst:2308 msgid "Weekday as locale's abbreviated name." msgstr "ロケールの曜日名を短縮形で表示します。" @@ -4222,11 +3325,11 @@ msgstr "Sun, Mon, ..., Sat (en_US);" msgid "So, Mo, ..., Sa (de_DE)" msgstr "So, Mo, ..., Sa (de_DE)" -#: ../../library/datetime.rst:2495 +#: ../../library/datetime.rst:2313 msgid "``%A``" msgstr "``%A``" -#: ../../library/datetime.rst:2495 +#: ../../library/datetime.rst:2313 msgid "Weekday as locale's full name." msgstr "ロケールの曜日名を表示します。" @@ -4238,43 +3341,43 @@ msgstr "Sunday, Monday, ..., Saturday (en_US);" msgid "Sonntag, Montag, ..., Samstag (de_DE)" msgstr "Sonntag, Montag, ..., Samstag (de_DE)" -#: ../../library/datetime.rst:2500 +#: ../../library/datetime.rst:2318 msgid "``%w``" msgstr "``%w``" -#: ../../library/datetime.rst:2500 +#: ../../library/datetime.rst:2318 msgid "Weekday as a decimal number, where 0 is Sunday and 6 is Saturday." msgstr "" "曜日を10進表記した文字列を表示します。0 が日曜日で、6 が土曜日を表します。" -#: ../../library/datetime.rst:2500 +#: ../../library/datetime.rst:2318 msgid "0, 1, ..., 6" msgstr "0, 1, ..., 6" -#: ../../library/datetime.rst:2504 +#: ../../library/datetime.rst:2322 msgid "``%d``" msgstr "``%d``" -#: ../../library/datetime.rst:2504 +#: ../../library/datetime.rst:2322 msgid "Day of the month as a zero-padded decimal number." msgstr "0埋めした10進数で表記した月中の日にち。" -#: ../../library/datetime.rst:2504 +#: ../../library/datetime.rst:2322 msgid "01, 02, ..., 31" msgstr "01, 02, ..., 31" -#: ../../library/datetime.rst:2504 ../../library/datetime.rst:2517 -#: ../../library/datetime.rst:2520 ../../library/datetime.rst:2526 -#: ../../library/datetime.rst:2529 ../../library/datetime.rst:2535 -#: ../../library/datetime.rst:2553 +#: ../../library/datetime.rst:2322 ../../library/datetime.rst:2335 +#: ../../library/datetime.rst:2338 ../../library/datetime.rst:2344 +#: ../../library/datetime.rst:2347 ../../library/datetime.rst:2353 +#: ../../library/datetime.rst:2371 msgid "\\(9)" msgstr "\\(9)" -#: ../../library/datetime.rst:2507 +#: ../../library/datetime.rst:2325 msgid "``%b``" msgstr "``%b``" -#: ../../library/datetime.rst:2507 +#: ../../library/datetime.rst:2325 msgid "Month as locale's abbreviated name." msgstr "ロケールの月名を短縮形で表示します。" @@ -4286,11 +3389,11 @@ msgstr "Jan, Feb, ..., Dec (en_US);" msgid "Jan, Feb, ..., Dez (de_DE)" msgstr "Jan, Feb, ..., Dez (de_DE)" -#: ../../library/datetime.rst:2512 +#: ../../library/datetime.rst:2330 msgid "``%B``" msgstr "``%B``" -#: ../../library/datetime.rst:2512 +#: ../../library/datetime.rst:2330 msgid "Month as locale's full name." msgstr "ロケールの月名を表示します。" @@ -4302,67 +3405,67 @@ msgstr "January, February, ..., December (en_US);" msgid "Januar, Februar, ..., Dezember (de_DE)" msgstr "Januar, Februar, ..., Dezember (de_DE)" -#: ../../library/datetime.rst:2517 +#: ../../library/datetime.rst:2335 msgid "``%m``" msgstr "``%m``" -#: ../../library/datetime.rst:2517 +#: ../../library/datetime.rst:2335 msgid "Month as a zero-padded decimal number." msgstr "0埋めした10進数で表記した月。" -#: ../../library/datetime.rst:2517 ../../library/datetime.rst:2529 +#: ../../library/datetime.rst:2335 ../../library/datetime.rst:2347 msgid "01, 02, ..., 12" msgstr "01, 02, ..., 12" -#: ../../library/datetime.rst:2520 +#: ../../library/datetime.rst:2338 msgid "``%y``" msgstr "``%y``" -#: ../../library/datetime.rst:2520 +#: ../../library/datetime.rst:2338 msgid "Year without century as a zero-padded decimal number." msgstr "0埋めした10進数で表記した世紀無しの年。" -#: ../../library/datetime.rst:2520 +#: ../../library/datetime.rst:2338 msgid "00, 01, ..., 99" msgstr "00, 01, ..., 99" -#: ../../library/datetime.rst:2523 +#: ../../library/datetime.rst:2341 msgid "``%Y``" msgstr "``%Y``" -#: ../../library/datetime.rst:2523 +#: ../../library/datetime.rst:2341 msgid "Year with century as a decimal number." msgstr "西暦 ( 4桁) の 10 進表記を表します。" -#: ../../library/datetime.rst:2523 ../../library/datetime.rst:2593 +#: ../../library/datetime.rst:2341 ../../library/datetime.rst:2411 msgid "0001, 0002, ..., 2013, 2014, ..., 9998, 9999" msgstr "0001, 0002, ..., 2013, 2014, ..., 9998, 9999" -#: ../../library/datetime.rst:2526 +#: ../../library/datetime.rst:2344 msgid "``%H``" msgstr "``%H``" -#: ../../library/datetime.rst:2526 +#: ../../library/datetime.rst:2344 msgid "Hour (24-hour clock) as a zero-padded decimal number." msgstr "0埋めした10進数で表記した時 (24時間表記)。" -#: ../../library/datetime.rst:2526 +#: ../../library/datetime.rst:2344 msgid "00, 01, ..., 23" msgstr "00, 01, ..., 23" -#: ../../library/datetime.rst:2529 +#: ../../library/datetime.rst:2347 msgid "``%I``" msgstr "``%I``" -#: ../../library/datetime.rst:2529 +#: ../../library/datetime.rst:2347 msgid "Hour (12-hour clock) as a zero-padded decimal number." msgstr "0埋めした10進数で表記した時 (12時間表記)。" -#: ../../library/datetime.rst:2532 +#: ../../library/datetime.rst:2350 msgid "``%p``" msgstr "``%p``" -#: ../../library/datetime.rst:2532 +#: ../../library/datetime.rst:2350 msgid "Locale's equivalent of either AM or PM." msgstr "ロケールの AM もしくは PM と等価な文字列になります。" @@ -4374,55 +3477,55 @@ msgstr "AM, PM (en_US);" msgid "am, pm (de_DE)" msgstr "am, pm (de_DE)" -#: ../../library/datetime.rst:2532 +#: ../../library/datetime.rst:2350 msgid "\\(1), \\(3)" msgstr "\\(1), \\(3)" -#: ../../library/datetime.rst:2535 +#: ../../library/datetime.rst:2353 msgid "``%M``" msgstr "``%M``" -#: ../../library/datetime.rst:2535 +#: ../../library/datetime.rst:2353 msgid "Minute as a zero-padded decimal number." msgstr "0埋めした10進数で表記した分。" -#: ../../library/datetime.rst:2535 ../../library/datetime.rst:2538 +#: ../../library/datetime.rst:2353 ../../library/datetime.rst:2356 msgid "00, 01, ..., 59" msgstr "00, 01, ..., 59" -#: ../../library/datetime.rst:2538 +#: ../../library/datetime.rst:2356 msgid "``%S``" msgstr "``%S``" -#: ../../library/datetime.rst:2538 +#: ../../library/datetime.rst:2356 msgid "Second as a zero-padded decimal number." msgstr "0埋めした10進数で表記した秒。" -#: ../../library/datetime.rst:2538 +#: ../../library/datetime.rst:2356 msgid "\\(4), \\(9)" msgstr "\\(4), \\(9)" -#: ../../library/datetime.rst:2541 +#: ../../library/datetime.rst:2359 msgid "``%f``" msgstr "``%f``" -#: ../../library/datetime.rst:2541 -msgid "Microsecond as a decimal number, zero-padded to 6 digits." -msgstr "10進数で表記したマイクロ秒 (6桁に0埋めされます)。" +#: ../../library/datetime.rst:2359 +msgid "Microsecond as a decimal number, zero-padded on the left." +msgstr "10進数で表記したマイクロ秒 (左側から0埋めされます)。" -#: ../../library/datetime.rst:2541 +#: ../../library/datetime.rst:2359 msgid "000000, 000001, ..., 999999" msgstr "000000, 000001, ..., 999999" -#: ../../library/datetime.rst:2541 +#: ../../library/datetime.rst:2359 msgid "\\(5)" msgstr "\\(5)" -#: ../../library/datetime.rst:2545 ../../library/datetime.rst:2704 +#: ../../library/datetime.rst:2363 ../../library/datetime.rst:2526 msgid "``%z``" msgstr "``%z``" -#: ../../library/datetime.rst:2545 +#: ../../library/datetime.rst:2363 msgid "" "UTC offset in the form ``±HHMM[SS[.ffffff]]`` (empty string if the object is " "naive)." @@ -4430,78 +3533,77 @@ msgstr "" "UTCオフセットを ``±HHMM[SS[.ffffff]]`` の形式で表示します (オブジェクトが" "naiveであれば空文字列)。" -#: ../../library/datetime.rst:2545 +#: ../../library/datetime.rst:2363 msgid "(empty), +0000, -0400, +1030, +063415, -030712.345216" msgstr "(空文字列), +0000, -0400, +1030, +063415, -030712.345216" -#: ../../library/datetime.rst:2545 ../../library/datetime.rst:2550 -#: ../../library/datetime.rst:2607 +#: ../../library/datetime.rst:2363 ../../library/datetime.rst:2368 msgid "\\(6)" msgstr "\\(6)" -#: ../../library/datetime.rst:2550 ../../library/datetime.rst:2730 +#: ../../library/datetime.rst:2368 ../../library/datetime.rst:2550 msgid "``%Z``" msgstr "``%Z``" -#: ../../library/datetime.rst:2550 +#: ../../library/datetime.rst:2368 msgid "Time zone name (empty string if the object is naive)." msgstr "タイムゾーンの名前を表示します (オブジェクトがnaiveであれば空文字列)。" -#: ../../library/datetime.rst:2550 +#: ../../library/datetime.rst:2368 msgid "(empty), UTC, GMT" msgstr "(空文字列), UTC, GMT" -#: ../../library/datetime.rst:2553 +#: ../../library/datetime.rst:2371 msgid "``%j``" msgstr "``%j``" -#: ../../library/datetime.rst:2553 +#: ../../library/datetime.rst:2371 msgid "Day of the year as a zero-padded decimal number." msgstr "0埋めした10進数で表記した年中の日にち。" -#: ../../library/datetime.rst:2553 +#: ../../library/datetime.rst:2371 msgid "001, 002, ..., 366" msgstr "001, 002, ..., 366" -#: ../../library/datetime.rst:2556 +#: ../../library/datetime.rst:2374 msgid "``%U``" msgstr "``%U``" -#: ../../library/datetime.rst:2556 +#: ../../library/datetime.rst:2374 msgid "" -"Week number of the year (Sunday as the first day of the week) as a zero-" +"Week number of the year (Sunday as the first day of the week) as a zero " "padded decimal number. All days in a new year preceding the first Sunday are " "considered to be in week 0." msgstr "" "0埋めした10進数で表記した年中の週番号 (週の始まりは日曜日とする)。新年の最初" "の日曜日に先立つ日は 0週に属するとします。" -#: ../../library/datetime.rst:2556 ../../library/datetime.rst:2564 +#: ../../library/datetime.rst:2374 ../../library/datetime.rst:2382 msgid "00, 01, ..., 53" msgstr "00, 01, ..., 53" -#: ../../library/datetime.rst:2556 ../../library/datetime.rst:2564 +#: ../../library/datetime.rst:2374 ../../library/datetime.rst:2382 msgid "\\(7), \\(9)" msgstr "\\(7), \\(9)" -#: ../../library/datetime.rst:2564 +#: ../../library/datetime.rst:2382 msgid "``%W``" msgstr "``%W``" -#: ../../library/datetime.rst:2564 +#: ../../library/datetime.rst:2382 msgid "" -"Week number of the year (Monday as the first day of the week) as a zero-" -"padded decimal number. All days in a new year preceding the first Monday are " -"considered to be in week 0." +"Week number of the year (Monday as the first day of the week) as a decimal " +"number. All days in a new year preceding the first Monday are considered to " +"be in week 0." msgstr "" "0埋めした10進数で表記した年中の週番号 (週の始まりは月曜日とする)。新年の最初" "の月曜日に先立つ日は 0週に属するとします。" -#: ../../library/datetime.rst:2572 +#: ../../library/datetime.rst:2390 msgid "``%c``" msgstr "``%c``" -#: ../../library/datetime.rst:2572 +#: ../../library/datetime.rst:2390 msgid "Locale's appropriate date and time representation." msgstr "ロケールの日時を適切な形式で表します。" @@ -4513,11 +3615,11 @@ msgstr "Tue Aug 16 21:30:00 1988 (en_US);" msgid "Di 16 Aug 21:30:00 1988 (de_DE)" msgstr "Di 16 Aug 21:30:00 1988 (de_DE)" -#: ../../library/datetime.rst:2577 +#: ../../library/datetime.rst:2395 msgid "``%x``" msgstr "``%x``" -#: ../../library/datetime.rst:2577 +#: ../../library/datetime.rst:2395 msgid "Locale's appropriate date representation." msgstr "ロケールの日付を適切な形式で表します。" @@ -4533,11 +3635,11 @@ msgstr "08/16/1988 (en_US);" msgid "16.08.1988 (de_DE)" msgstr "16.08.1988 (de_DE)" -#: ../../library/datetime.rst:2581 +#: ../../library/datetime.rst:2399 msgid "``%X``" msgstr "``%X``" -#: ../../library/datetime.rst:2581 +#: ../../library/datetime.rst:2399 msgid "Locale's appropriate time representation." msgstr "ロケールの時間を適切な形式で表します。" @@ -4549,19 +3651,19 @@ msgstr "21:30:00 (en_US);" msgid "21:30:00 (de_DE)" msgstr "21:30:00 (de_DE)" -#: ../../library/datetime.rst:2584 +#: ../../library/datetime.rst:2402 msgid "``%%``" msgstr "``%%``" -#: ../../library/datetime.rst:2584 +#: ../../library/datetime.rst:2402 msgid "A literal ``'%'`` character." msgstr "文字 ``'%'`` を表します。" -#: ../../library/datetime.rst:2584 +#: ../../library/datetime.rst:2402 msgid "%" msgstr "%" -#: ../../library/datetime.rst:2587 +#: ../../library/datetime.rst:2405 msgid "" "Several additional directives not required by the C89 standard are included " "for convenience. These parameters all correspond to ISO 8601 date values." @@ -4569,37 +3671,37 @@ msgstr "" "C89規格により要求されない幾つかの追加のコードが便宜上含まれています。これらの" "パラメータはすべてISO 8601の日付値に対応しています。" -#: ../../library/datetime.rst:2593 +#: ../../library/datetime.rst:2411 msgid "``%G``" msgstr "``%G``" -#: ../../library/datetime.rst:2593 +#: ../../library/datetime.rst:2411 msgid "" "ISO 8601 year with century representing the year that contains the greater " "part of the ISO week (``%V``)." msgstr "ISO week(``%V``)の内過半数を含む西暦表記の ISO 8601 year です。" -#: ../../library/datetime.rst:2593 +#: ../../library/datetime.rst:2411 msgid "\\(8)" msgstr "\\(8)" -#: ../../library/datetime.rst:2598 +#: ../../library/datetime.rst:2416 msgid "``%u``" msgstr "``%u``" -#: ../../library/datetime.rst:2598 +#: ../../library/datetime.rst:2416 msgid "ISO 8601 weekday as a decimal number where 1 is Monday." msgstr "1 を月曜日を表す 10進数表記の ISO 8601 weekday です。" -#: ../../library/datetime.rst:2598 +#: ../../library/datetime.rst:2416 msgid "1, 2, ..., 7" msgstr "1, 2, ..., 7" -#: ../../library/datetime.rst:2601 +#: ../../library/datetime.rst:2419 msgid "``%V``" msgstr "``%V``" -#: ../../library/datetime.rst:2601 +#: ../../library/datetime.rst:2419 msgid "" "ISO 8601 week as a decimal number with Monday as the first day of the week. " "Week 01 is the week containing Jan 4." @@ -4607,100 +3709,76 @@ msgstr "" "週で最初の月曜日を始めとする ISO 8601 week です。Week 01 は 1月4日を含みま" "す。" -#: ../../library/datetime.rst:2601 +#: ../../library/datetime.rst:2419 msgid "01, 02, ..., 53" msgstr "01, 02, ..., 53" -#: ../../library/datetime.rst:2601 +#: ../../library/datetime.rst:2419 msgid "\\(8), \\(9)" msgstr "\\(8), \\(9)" -#: ../../library/datetime.rst:2607 ../../library/datetime.rst:2726 -msgid "``%:z``" -msgstr "``%:z``" - -#: ../../library/datetime.rst:2607 -msgid "" -"UTC offset in the form ``±HH:MM[:SS[.ffffff]]`` (empty string if the object " -"is naive)." -msgstr "" -"UTCオフセットを ``±HH:MM[:SS[.ffffff]]`` の形式で表示します (オブジェクトが" -"naiveであれば空文字列)。" - -#: ../../library/datetime.rst:2607 -msgid "(empty), +00:00, -04:00, +10:30, +06:34:15, -03:07:12.345216" -msgstr "(空文字列), +00:00, -04:00, +10:30, +06:34:15, -03:07:12.345216" - -#: ../../library/datetime.rst:2613 +#: ../../library/datetime.rst:2426 msgid "" -"These may not be available on all platforms when used with the :meth:`~." -"datetime.strftime` method. The ISO 8601 year and ISO 8601 week directives " -"are not interchangeable with the year and week number directives above. " -"Calling :meth:`~.datetime.strptime` with incomplete or ambiguous ISO 8601 " -"directives will raise a :exc:`ValueError`." +"These may not be available on all platforms when used with the :meth:" +"`strftime` method. The ISO 8601 year and ISO 8601 week directives are not " +"interchangeable with the year and week number directives above. Calling :" +"meth:`strptime` with incomplete or ambiguous ISO 8601 directives will raise " +"a :exc:`ValueError`." msgstr "" -"これらが :meth:`~.datetime.strftime` メソッドと一緒に使用された場合、すべての" -"プラットフォームで利用できるわけではありません。 ISO 8601 year 指定子および" -"ISO 8601 week 指定子は、上記のyear および week number 指定子と互換性がありま" -"せん。不完全またはあいまいなISO 8601 指定子で :meth:`~.datetime.strptime` を" -"呼び出すと、 :exc:`ValueError` が送出されます。" +"これらが :meth:`strftime` メソッドと一緒に使用された場合、すべてのプラット" +"フォームで利用できるわけではありません。 ISO 8601 year 指定子およびISO 8601 " +"week 指定子は、上記のyear および week number 指定子と互換性がありません。不完" +"全またはあいまいなISO 8601 指定子で :meth:`strptime` を呼び出すと、 :exc:" +"`ValueError` が送出されます。" -#: ../../library/datetime.rst:2618 +#: ../../library/datetime.rst:2431 msgid "" "The full set of format codes supported varies across platforms, because " -"Python calls the platform C library's :c:func:`strftime` function, and " +"Python calls the platform C library's :func:`strftime` function, and " "platform variations are common. To see the full set of format codes " -"supported on your platform, consult the :manpage:`strftime(3)` " -"documentation. There are also differences between platforms in handling of " -"unsupported format specifiers." +"supported on your platform, consult the :manpage:`strftime(3)` documentation." msgstr "" -"Python はプラットフォームの C ライブラリの :c:func:`strftime` 関数を呼び出し" -"ていて、プラットフォームごとにその実装が異なるのはよくあることなので、サポー" -"トされる書式コード全体はプラットフォームごとに様々です。\n" +"Python はプラットフォームの C ライブラリの :func:`strftime` 関数を呼び出して" +"いて、プラットフォームごとにその実装が異なるのはよくあることなので、サポート" +"される書式コード全体はプラットフォームごとに様々です。\n" "手元のプラットフォームでサポートされているフォーマット記号全体を見るには、 :" -"manpage:`strftime(3)` のドキュメントを参照してください。\n" -"サポートされていないフォーマット指定子の扱いもプラットフォーム間で差異があり" -"ます。" +"manpage:`strftime(3)` のドキュメントを参照してください。" -#: ../../library/datetime.rst:2624 +#: ../../library/datetime.rst:2436 msgid "``%G``, ``%u`` and ``%V`` were added." msgstr "``%G``, ``%u`` および ``%V`` が追加されました。" -#: ../../library/datetime.rst:2627 -msgid "``%:z`` was added." -msgstr "``%:z`` が追加されました。" - -#: ../../library/datetime.rst:2631 +#: ../../library/datetime.rst:2440 msgid "Technical Detail" msgstr "技術詳細" -#: ../../library/datetime.rst:2633 +#: ../../library/datetime.rst:2442 msgid "" "Broadly speaking, ``d.strftime(fmt)`` acts like the :mod:`time` module's " "``time.strftime(fmt, d.timetuple())`` although not all objects support a :" -"meth:`~date.timetuple` method." +"meth:`timetuple` method." msgstr "" "大雑把にいうと、 ``d.strftime(fmt)`` は :mod:`time` モジュールの ``time." "strftime(fmt, d.timetuple())`` のように動作します。ただし全てのオブジェクト" -"が :meth:`~date.timetuple` メソッドをサポートしているわけではありません。" +"が :meth:`timetuple` メソッドをサポートしているわけではありません。" -#: ../../library/datetime.rst:2637 +#: ../../library/datetime.rst:2446 msgid "" -"For the :meth:`.datetime.strptime` class method, the default value is " +"For the :meth:`datetime.strptime` class method, the default value is " "``1900-01-01T00:00:00.000``: any components not specified in the format " "string will be pulled from the default value. [#]_" msgstr "" -":meth:`.datetime.strptime` クラスメソッドでは、デフォルト値は " +":meth:`datetime.strptime` クラスメソッドでは、デフォルト値は " "``1900-01-01T00:00:00.000`` です。書式文字列で指定されなかった部分はデフォル" "ト値から引っ張ってきます。 [#]_" -#: ../../library/datetime.rst:2641 +#: ../../library/datetime.rst:2450 msgid "Using ``datetime.strptime(date_string, format)`` is equivalent to::" msgstr "``datetime.strptime(date_string, format)`` は次の式と等価です::" -#: ../../library/datetime.rst:2645 +#: ../../library/datetime.rst:2454 msgid "" -"except when the format includes sub-second components or time zone offset " +"except when the format includes sub-second components or timezone offset " "information, which are supported in ``datetime.strptime`` but are discarded " "by ``time.strptime``." msgstr "" @@ -4708,27 +3786,29 @@ msgstr "" "い、秒未満の単位やタイムゾーンオフセットの情報が format に 含まれているときは" "除きます。" -#: ../../library/datetime.rst:2649 +#: ../../library/datetime.rst:2458 msgid "" "For :class:`.time` objects, the format codes for year, month, and day should " -"not be used, as :class:`!time` objects have no such values. If they're used " -"anyway, 1900 is substituted for the year, and 1 for the month and day." +"not be used, as :class:`time` objects have no such values. If they're used " +"anyway, ``1900`` is substituted for the year, and ``1`` for the month and " +"day." msgstr "" ":class:`.time` オブジェクトには、年、月、日の値がないため、それらを書式コード" "を使うことができません。\n" -"無理矢理使った場合、年は1900に置き換えられ、月と日は1に置き換えられます。" +"無理矢理使った場合、年は ``1900`` に置き換えられ、月と日は ``1`` に置き換えら" +"れます。" -#: ../../library/datetime.rst:2653 +#: ../../library/datetime.rst:2462 msgid "" "For :class:`date` objects, the format codes for hours, minutes, seconds, and " "microseconds should not be used, as :class:`date` objects have no such " -"values. If they're used anyway, 0 is substituted for them." +"values. If they're used anyway, ``0`` is substituted for them." msgstr "" ":class:`date` オブジェクトには、時、分、秒、マイクロ秒の値がないため、それら" "の書式コードを使うことができません。\n" -"無理矢理使った場合、これらの値は0に置き換えられます。" +"無理矢理使った場合、これらの値は ``0`` に置き換えられます。" -#: ../../library/datetime.rst:2657 +#: ../../library/datetime.rst:2466 msgid "" "For the same reason, handling of format strings containing Unicode code " "points that can't be represented in the charset of the current locale is " @@ -4742,231 +3822,205 @@ msgstr "" "方、他のプラットフォームでは ``strftime`` が :exc:`UnicodeError` を送出した" "り、その代わりに空文字列を返したりするかもしれません。" -#: ../../library/datetime.rst:2666 +#: ../../library/datetime.rst:2475 msgid "" "Because the format depends on the current locale, care should be taken when " "making assumptions about the output value. Field orderings will vary (for " "example, \"month/day/year\" versus \"day/month/year\"), and the output may " -"contain non-ASCII characters." -msgstr "" +"contain Unicode characters encoded using the locale's default encoding (for " +"example, if the current locale is ``ja_JP``, the default encoding could be " +"any one of ``eucJP``, ``SJIS``, or ``utf-8``; use :meth:`locale.getlocale` " +"to determine the current locale's encoding)." +msgstr "" +"書式は現在のロケールに依存するので、出力値について何か仮定するときは注意すべ" +"きです。フィールドの順序は様々で (例えば、\"月/日/年\" と \"日/月/年\") 、出" +"力はロケールのデフォルトエンコーディングでエンコードされた Unicode 文字列を含" +"むかもしれません (例えば、現在のロケールが ``ja_JP`` だった場合、デフォルトエ" +"ンコーディングは ``eucJP`` 、 ``SJIS`` 、 ``utf-8`` のいずれかになりえま" +"す。 :meth:`locale.getlocale` を使って現在のロケールのエンコーディングを確認" +"します) 。" -#: ../../library/datetime.rst:2672 +#: ../../library/datetime.rst:2484 msgid "" -"The :meth:`~.datetime.strptime` method can parse years in the full [1, 9999] " -"range, but years < 1000 must be zero-filled to 4-digit width." +"The :meth:`strptime` method can parse years in the full [1, 9999] range, but " +"years < 1000 must be zero-filled to 4-digit width." msgstr "" -":meth:`~.datetime.strptime` メソッドは [1, 9999] の範囲の年数全てを構文解析で" -"きますが、 year < 1000 の範囲の年数は 0 埋めされた 4 桁の数字でなければなりま" -"せん。" +":meth:`strptime` メソッドは [1, 9999] の範囲の年数全てを構文解析できますが、 " +"year < 1000 の範囲の年数は 0 埋めされた 4 桁の数字でなければなりません。" -#: ../../library/datetime.rst:2675 +#: ../../library/datetime.rst:2487 msgid "" -"In previous versions, :meth:`~.datetime.strftime` method was restricted to " -"years >= 1900." +"In previous versions, :meth:`strftime` method was restricted to years >= " +"1900." msgstr "" -"以前のバージョンでは、 :meth:`~.datetime.strftime` メソッドは years >= 1900 " -"の範囲の年数しか扱えませんでした。" +"以前のバージョンでは、 :meth:`strftime` メソッドは years >= 1900 の範囲の年数" +"しか扱えませんでした。" -#: ../../library/datetime.rst:2679 +#: ../../library/datetime.rst:2491 msgid "" -"In version 3.2, :meth:`~.datetime.strftime` method was restricted to years " -">= 1000." +"In version 3.2, :meth:`strftime` method was restricted to years >= 1000." msgstr "" -"バージョン 3.2 では、 :meth:`~.datetime.strftime` メソッドは years >= 1000 の" -"範囲の年数しか扱えませんでした。" +"バージョン 3.2 では、 :meth:`strftime` メソッドは years >= 1000 の範囲の年数" +"しか扱えませんでした。" -#: ../../library/datetime.rst:2684 +#: ../../library/datetime.rst:2496 msgid "" -"When used with the :meth:`~.datetime.strptime` method, the ``%p`` directive " -"only affects the output hour field if the ``%I`` directive is used to parse " -"the hour." +"When used with the :meth:`strptime` method, the ``%p`` directive only " +"affects the output hour field if the ``%I`` directive is used to parse the " +"hour." msgstr "" -":meth:`~.datetime.strptime` メソッドと共に使われた場合、 ``%p`` 指定子は出力" -"の時間フィールドのみに影響し、 ``%I`` 指定子が使われたかのように振る舞いま" -"す。" +":meth:`strptime` メソッドと共に使われた場合、 ``%p`` 指定子は出力の時間フィー" +"ルドのみに影響し、 ``%I`` 指定子が使われたかのように振る舞います。" -#: ../../library/datetime.rst:2688 +#: ../../library/datetime.rst:2500 msgid "" -"Unlike the :mod:`time` module, the :mod:`!datetime` module does not support " +"Unlike the :mod:`time` module, the :mod:`datetime` module does not support " "leap seconds." msgstr "" -":mod:`time` モジュールと違い、 :mod:`!datetime` モジュールはうるう秒をサポー" -"トしていません。" +":mod:`time` モジュールと違い、 :mod:`datetime` モジュールはうるう秒をサポート" +"していません。" -#: ../../library/datetime.rst:2692 +#: ../../library/datetime.rst:2504 msgid "" -"When used with the :meth:`~.datetime.strptime` method, the ``%f`` directive " -"accepts from one to six digits and zero pads on the right. ``%f`` is an " -"extension to the set of format characters in the C standard (but implemented " -"separately in datetime objects, and therefore always available)." +"When used with the :meth:`strptime` method, the ``%f`` directive accepts " +"from one to six digits and zero pads on the right. ``%f`` is an extension to " +"the set of format characters in the C standard (but implemented separately " +"in datetime objects, and therefore always available)." msgstr "" -":meth:`~.datetime.strptime` メソッドと共に使われた場合、 ``%f`` 指定子は 1 桁" -"から 6 桁の数字を受け付け、右側から0埋めされます。\n" +":meth:`strptime` メソッドと共に使われた場合、 ``%f`` 指定子は 1 桁から 6 桁の" +"数字を受け付け、右側から0埋めされます。\n" "``%f`` は C 標準規格の書式文字セットの拡張です (とは言え、 datetime モジュー" "ルのオブジェクトそれぞれに実装されているので、どれででも使えます)。" -#: ../../library/datetime.rst:2699 +#: ../../library/datetime.rst:2511 msgid "" -"For a naive object, the ``%z``, ``%:z`` and ``%Z`` format codes are replaced " -"by empty strings." +"For a naive object, the ``%z`` and ``%Z`` format codes are replaced by empty " +"strings." msgstr "" -"naive オブジェクトでは、書式コード ``%z``、``%:z`` および ``%Z`` は空文字列に" -"置き換えられます。" +"naive オブジェクトでは、書式コード ``%z`` および ``%Z`` は空文字列に置き換え" +"られます。" -#: ../../library/datetime.rst:2702 +#: ../../library/datetime.rst:2514 msgid "For an aware object:" msgstr "aware オブジェクトでは次のようになります:" -#: ../../library/datetime.rst:2705 -msgid "" -":meth:`~.datetime.utcoffset` is transformed into a string of the form " -"``±HHMM[SS[.ffffff]]``, where ``HH`` is a 2-digit string giving the number " -"of UTC offset hours, ``MM`` is a 2-digit string giving the number of UTC " -"offset minutes, ``SS`` is a 2-digit string giving the number of UTC offset " -"seconds and ``ffffff`` is a 6-digit string giving the number of UTC offset " -"microseconds. The ``ffffff`` part is omitted when the offset is a whole " -"number of seconds and both the ``ffffff`` and the ``SS`` part is omitted " -"when the offset is a whole number of minutes. For example, if :meth:`~." -"datetime.utcoffset` returns ``timedelta(hours=-3, minutes=-30)``, ``%z`` is " -"replaced with the string ``'-0330'``." -msgstr "" -":meth:`~.datetime.utcoffset` は ``±HHMM[SS[.ffffff]]`` 形式の文字列に変換され" -"ます。ここで、 ``HH`` は UTC オフセットの時間を表す 2 桁の文字列、 ``MM`` は " -"UTC オフセットの分数を表す 2 桁の文字列、 ``SS`` は UTC オフセットの秒数を表" -"す 2 桁の文字列、 ``ffffff`` は UTC オフセットのマイクロ秒数を表す 6 桁の文字" -"列です。\n" +#: ../../library/datetime.rst:2517 +msgid "" +":meth:`utcoffset` is transformed into a string of the form ``±HHMM[SS[." +"ffffff]]``, where ``HH`` is a 2-digit string giving the number of UTC offset " +"hours, ``MM`` is a 2-digit string giving the number of UTC offset minutes, " +"``SS`` is a 2-digit string giving the number of UTC offset seconds and " +"``ffffff`` is a 6-digit string giving the number of UTC offset microseconds. " +"The ``ffffff`` part is omitted when the offset is a whole number of seconds " +"and both the ``ffffff`` and the ``SS`` part is omitted when the offset is a " +"whole number of minutes. For example, if :meth:`utcoffset` returns " +"``timedelta(hours=-3, minutes=-30)``, ``%z`` is replaced with the string " +"``'-0330'``." +msgstr "" +":meth:`utcoffset` は ``±HHMM[SS[.ffffff]]`` 形式の文字列に変換されます。ここ" +"で、 ``HH`` は UTC オフセットの時間を表す 2 桁の文字列、 ``MM`` は UTC オフ" +"セットの分数を表す 2 桁の文字列、 ``SS`` は UTC オフセットの秒数を表す 2 桁の" +"文字列、 ``ffffff`` は UTC オフセットのマイクロ秒数を表す 6 桁の文字列で" +"す。\n" "オフセットに秒未満の端数が無いときは ``ffffff`` 部分は省略され、オフセットに" "分未満の端数が無いときは ``ffffff`` 部分も ``SS`` 部分も省略されます。\n" -"例えば、 :meth:`~.datetime.utcoffset` が ``timedelta(hours=-3, " -"minutes=-30)`` を返す場合、 ``%z`` は文字列 ``'-0330'`` に置き換えられます。" +"例えば、 :meth:`utcoffset` が ``timedelta(hours=-3, minutes=-30)`` を返す場" +"合、 ``%z`` は文字列 ``'-0330'`` に置き換えられます。" -#: ../../library/datetime.rst:2719 +#: ../../library/datetime.rst:2531 msgid "" -"When the ``%z`` directive is provided to the :meth:`~.datetime.strptime` " -"method, the UTC offsets can have a colon as a separator between hours, " -"minutes and seconds. For example, ``'+01:00:00'`` will be parsed as an " -"offset of one hour. In addition, providing ``'Z'`` is identical to " -"``'+00:00'``." +"When the ``%z`` directive is provided to the :meth:`strptime` method, the " +"UTC offsets can have a colon as a separator between hours, minutes and " +"seconds. For example, ``'+01:00:00'`` will be parsed as an offset of one " +"hour. In addition, providing ``'Z'`` is identical to ``'+00:00'``." msgstr "" -"``%z`` 指定子が :meth:`~.datetime.strptime` メソッドに渡されたときは、時分秒" -"のセパレータとしてコロンが UTC オフセットで使えます。\n" +"``%z`` 指定子が :meth:`strptime` メソッドに渡されたときは、時分秒のセパレータ" +"としてコロンが UTC オフセットで使えます。\n" "例えば、 ``'+01:00:00'`` は 1 時間のオフセットだと構文解析されます。\n" "加えて、 ``'Z'`` を渡すことは ``'+00:00'`` を渡すことと同等です。" -#: ../../library/datetime.rst:2727 -msgid "" -"Behaves exactly as ``%z``, but has a colon separator added between hours, " -"minutes and seconds." -msgstr "" - -#: ../../library/datetime.rst:2731 +#: ../../library/datetime.rst:2539 msgid "" -"In :meth:`~.datetime.strftime`, ``%Z`` is replaced by an empty string if :" -"meth:`~.datetime.tzname` returns ``None``; otherwise ``%Z`` is replaced by " -"the returned value, which must be a string." +"In :meth:`strftime`, ``%Z`` is replaced by an empty string if :meth:`tzname` " +"returns ``None``; otherwise ``%Z`` is replaced by the returned value, which " +"must be a string." msgstr "" -" :meth:`~.datetime.strftime` では、 :meth:`~.datetime.tzname` が ``None`` を" -"返した場合、 ``%Z`` は空文字列に置き換わります。そうでない場合、 ``%Z`` は返" -"された値に置き換わりますが、 これは文字列でなければなりません。" +" :meth:`strftime` では、 :meth:`tzname` が ``None`` を返した場合、 ``%Z`` は" +"空文字列に置き換わります。そうでない場合、 ``%Z`` は返された値に置き換わりま" +"すが、 これは文字列でなければなりません。" -#: ../../library/datetime.rst:2735 -msgid ":meth:`~.datetime.strptime` only accepts certain values for ``%Z``:" -msgstr ":meth:`~.datetime.strptime` は ``%Z`` に特定の値のみを受け入れます:" +#: ../../library/datetime.rst:2543 +msgid ":meth:`strptime` only accepts certain values for ``%Z``:" +msgstr ":meth:`strptime` は ``%Z``に特定の値のみを受け入れます:" -#: ../../library/datetime.rst:2737 +#: ../../library/datetime.rst:2545 msgid "any value in ``time.tzname`` for your machine's locale" -msgstr "使用しているマシンのロケールによる ``time.tzname`` の任意の値" +msgstr "使用しているマシンのロケールによる ``time.tzname``の任意の値" -#: ../../library/datetime.rst:2738 +#: ../../library/datetime.rst:2546 msgid "the hard-coded values ``UTC`` and ``GMT``" -msgstr "ハードコードされた値 ``UTC`` または ``GMT``" +msgstr "ハードコードされた値 ``UTC``または``GMT``" -#: ../../library/datetime.rst:2740 +#: ../../library/datetime.rst:2548 msgid "" "So someone living in Japan may have ``JST``, ``UTC``, and ``GMT`` as valid " "values, but probably not ``EST``. It will raise ``ValueError`` for invalid " "values." msgstr "" -"つまり、日本に住んでいる場合は ``JST``, ``UTC`` と ``GMT`` が有効な値であ" -"り、 ``EST`` はおそらく無効な値となります。無効な値の場合は ``ValueError`` を" -"送出します。" +"つまり、日本に住んでいる場合は ``JST``, ``UTC``と``GMT``が有効な値であり、 " +"``EST``はおそらく無効な値となります。無効な値の場合は ``ValueError``を送出し" +"ます。" -#: ../../library/datetime.rst:2744 +#: ../../library/datetime.rst:2552 msgid "" -"When the ``%z`` directive is provided to the :meth:`~.datetime.strptime` " -"method, an aware :class:`.datetime` object will be produced. The ``tzinfo`` " -"of the result will be set to a :class:`timezone` instance." +"When the ``%z`` directive is provided to the :meth:`strptime` method, an " +"aware :class:`.datetime` object will be produced. The ``tzinfo`` of the " +"result will be set to a :class:`timezone` instance." msgstr "" -"``%z`` 指定子が :meth:`~.datetime.strptime` メソッドに与えられた場合、 aware " -"な :class:`.datetime` オブジェクトが作成されます。返り値の ``tzinfo`` は :" -"class:`timezone` インスタンスになっています。" +"``%z`` 指定子が :meth:`strptime` メソッドに与えられた場合、 aware な :class:" +"`.datetime` オブジェクトが作成されます。返り値の ``tzinfo`` は :class:" +"`timezone` インスタンスになっています。" -#: ../../library/datetime.rst:2750 +#: ../../library/datetime.rst:2558 msgid "" -"When used with the :meth:`~.datetime.strptime` method, ``%U`` and ``%W`` are " -"only used in calculations when the day of the week and the calendar year " -"(``%Y``) are specified." +"When used with the :meth:`strptime` method, ``%U`` and ``%W`` are only used " +"in calculations when the day of the week and the calendar year (``%Y``) are " +"specified." msgstr "" -":meth:`~.datetime.strptime` メソッドと共に使われた場合、 ``%U`` と ``%W`` 指" -"定子は、曜日と年(``%Y``)が指定された場合の計算でのみ使われます。" +":meth:`strptime` メソッドと共に使われた場合、 ``%U`` と ``%W`` 指定子は、曜日" +"と年(``%Y``)が指定された場合の計算でのみ使われます。" -#: ../../library/datetime.rst:2755 +#: ../../library/datetime.rst:2563 msgid "" "Similar to ``%U`` and ``%W``, ``%V`` is only used in calculations when the " -"day of the week and the ISO year (``%G``) are specified in a :meth:`~." -"datetime.strptime` format string. Also note that ``%G`` and ``%Y`` are not " +"day of the week and the ISO year (``%G``) are specified in a :meth:" +"`strptime` format string. Also note that ``%G`` and ``%Y`` are not " "interchangeable." msgstr "" -"``%U`` および ``%W`` と同様に、 ``%V`` は曜日と ISO 年 (``%G``) が :meth:`~." -"datetime.strptime` の書式文字列の中で指定された場合に計算でのみ使われます。\n" +"``%U`` および ``%W`` と同様に、 ``%V`` は曜日と ISO 年 (``%G``) が :meth:" +"`strptime` の書式文字列の中で指定された場合に計算でのみ使われます。\n" "``%G`` と ``%Y`` は互いに完全な互換性を持たないことにも注意してください。" -#: ../../library/datetime.rst:2761 +#: ../../library/datetime.rst:2569 msgid "" -"When used with the :meth:`~.datetime.strptime` method, the leading zero is " -"optional for formats ``%d``, ``%m``, ``%H``, ``%I``, ``%M``, ``%S``, " -"``%j``, ``%U``, ``%W``, and ``%V``. Format ``%y`` does require a leading " -"zero." +"When used with the :meth:`strptime` method, the leading zero is optional " +"for formats ``%d``, ``%m``, ``%H``, ``%I``, ``%M``, ``%S``, ``%J``, ``%U``, " +"``%W``, and ``%V``. Format ``%y`` does require a leading zero." msgstr "" -":meth:`~.datetime.strptime` メソッドと共に使われるとき、書式 ``%d``, ``%m``, " -"``%H``, ``%I``, ``%M``, ``%S``, ``%j``, ``%U``, ``%W``, ``%V`` では先行ゼロは" -"任意です。\n" -"書式 ``%y`` では先行ゼロは必須です。" +":meth:`strptime` メソッドと共に使われたときは、書式 ``%d``, ``%m``, ``%H``, " +"``%I``, ``%M``, ``%S``, ``%J``, ``%U``, ``%W``, ``%V`` の後ろに続ける 0 は任" +"意です。\n" +"書式 ``%y`` では後ろに続ける 0 は必須です。" -#: ../../library/datetime.rst:2766 -msgid "" -"When parsing a month and day using :meth:`~.datetime.strptime`, always " -"include a year in the format. If the value you need to parse lacks a year, " -"append an explicit dummy leap year. Otherwise your code will raise an " -"exception when it encounters leap day because the default year used by the " -"parser is not a leap year. Users run into this bug every four years..." -msgstr "" - -#: ../../library/datetime.rst:2772 -msgid "" -">>> month_day = \"02/29\"\n" -">>> datetime.strptime(f\"{month_day};1984\", \"%m/%d;%Y\") # No leap year " -"bug.\n" -"datetime.datetime(1984, 2, 29, 0, 0)" -msgstr "" - -#: ../../library/datetime.rst:2778 -msgid "" -":meth:`~.datetime.strptime` calls using a format string containing a day of " -"month without a year now emit a :exc:`DeprecationWarning`. In 3.15 or later " -"we may change this into an error or change the default year to a leap year. " -"See :gh:`70647`." -msgstr "" - -#: ../../library/datetime.rst:2785 +#: ../../library/datetime.rst:2574 msgid "Footnotes" msgstr "脚注" -#: ../../library/datetime.rst:2786 +#: ../../library/datetime.rst:2575 msgid "If, that is, we ignore the effects of Relativity" msgstr "もし相対性理論の効果を無視するならば、ですが" -#: ../../library/datetime.rst:2788 +#: ../../library/datetime.rst:2577 msgid "" "This matches the definition of the \"proleptic Gregorian\" calendar in " "Dershowitz and Reingold's book *Calendrical Calculations*, where it's the " @@ -4980,28 +4034,20 @@ msgstr "" "先発グレゴリオ暦の序数とその他多くの暦法どうしの変換アルゴリズムについては、" "この書籍を参照してください。" -#: ../../library/datetime.rst:2794 +#: ../../library/datetime.rst:2583 msgid "" "See R. H. van Gent's `guide to the mathematics of the ISO 8601 calendar " -"`_ for a good explanation." +"`_ for a " +"good explanation." msgstr "" "優れた説明は R. H. van Gent の `guide to the mathematics of the ISO 8601 " -"calendar `_ を参照してください。" +"calendar `_ を参照してください。" -#: ../../library/datetime.rst:2798 +#: ../../library/datetime.rst:2587 msgid "" -"Passing ``datetime.strptime('Feb 29', '%b %d')`` will fail since 1900 is not " -"a leap year." -msgstr "" -"1900は閏年ではないので ``datetime.strptime('Feb 29', '%b %d')`` を渡すと失敗" -"します。" - -#: ../../library/datetime.rst:2441 -msgid "% (percent)" -msgstr "% (パーセント)" - -#: ../../library/datetime.rst:2441 -msgid "datetime format" +"Passing ``datetime.strptime('Feb 29', '%b %d')`` will fail since ``1900`` is " +"not a leap year." msgstr "" +"``1900`` は閏年ではないので ``datetime.strptime('Feb 29', '%b %d')`` を渡すと" +"失敗します。" diff --git a/library/dbm.po b/library/dbm.po index d5d6e3124..b7b4bd98f 100644 --- a/library/dbm.po +++ b/library/dbm.po @@ -1,61 +1,55 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Masato HASHIMOTO , 2023 -# tomo, 2024 -# 石井明久, 2024 +# Shun Sakurai, 2017 +# 秘湯 , 2017 +# Arihiro TAKASE, 2017 +# Nozomu Kaneko , 2017 +# tomo, 2019 +# Osamu NAKAMURA, 2021 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-30 14:22+0000\n" -"PO-Revision-Date: 2021-06-28 01:04+0000\n" -"Last-Translator: 石井明久, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 23:06+0000\n" +"Last-Translator: Osamu NAKAMURA, 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/dbm.rst:2 -msgid ":mod:`!dbm` --- Interfaces to Unix \"databases\"" -msgstr ":mod:`!dbm` --- Unix \"データベース\" へのインターフェース" +msgid ":mod:`dbm` --- Interfaces to Unix \"databases\"" +msgstr ":mod:`dbm` --- Unix \"データベース\" へのインターフェース" #: ../../library/dbm.rst:7 msgid "**Source code:** :source:`Lib/dbm/__init__.py`" msgstr "**ソースコード:** :source:`Lib/dbm/__init__.py`" #: ../../library/dbm.rst:11 -msgid ":mod:`dbm` is a generic interface to variants of the DBM database:" -msgstr "" - -#: ../../library/dbm.rst:13 -msgid ":mod:`dbm.sqlite3`" -msgstr "" - -#: ../../library/dbm.rst:14 -msgid ":mod:`dbm.gnu`" -msgstr "" - -#: ../../library/dbm.rst:15 -msgid ":mod:`dbm.ndbm`" -msgstr "" - -#: ../../library/dbm.rst:17 msgid "" -"If none of these modules are installed, the slow-but-simple implementation " -"in module :mod:`dbm.dumb` will be used. There is a `third party interface " -"`_ to the Oracle Berkeley DB." +":mod:`dbm` is a generic interface to variants of the DBM database --- :mod:" +"`dbm.gnu` or :mod:`dbm.ndbm`. If none of these modules is installed, the " +"slow-but-simple implementation in module :mod:`dbm.dumb` will be used. " +"There is a `third party interface `_ to the Oracle Berkeley DB." msgstr "" +":mod:`dbm` は DBM データベースのいくつかの種類 ( :mod:`dbm.gnu` または :mod:" +"`dbm.ndbm` ) に対する汎用的なインターフェースです。これらのモジュールのどれも" +"インストールされていなければ、モジュール :mod:`dbm.dumb` に含まれる低速だが単" +"純な実装が使用されます。Oracle Berkeley DB に対する `サードパーティのインター" +"フェース `_ があります。" -#: ../../library/dbm.rst:24 +#: ../../library/dbm.rst:20 msgid "" "A tuple containing the exceptions that can be raised by each of the " "supported modules, with a unique exception also named :exc:`dbm.error` as " @@ -66,115 +60,145 @@ msgstr "" "error` という名前の例外が含まれます --- :exc:`dbm.error` が送出される場合、後" "者(訳注:タプルの ``dbm.error`` ではなく例外 :exc:`dbm.error`)が使用されます。" -#: ../../library/dbm.rst:31 +#: ../../library/dbm.rst:27 msgid "" "This function attempts to guess which of the several simple database modules " -"available --- :mod:`dbm.sqlite3`, :mod:`dbm.gnu`, :mod:`dbm.ndbm`, or :mod:" -"`dbm.dumb` --- should be used to open a given file." +"available --- :mod:`dbm.gnu`, :mod:`dbm.ndbm` or :mod:`dbm.dumb` --- should " +"be used to open a given file." msgstr "" +"この関数は、与えられたファイルを開くために、利用可能ないくつかの単純なデータ" +"ベースモジュール --- :mod:`dbm.gnu`, :mod:`dbm.ndbm`, :mod:`dbm.dumb` --- の" +"どれを使用すべきか推測を試みます。" -#: ../../library/dbm.rst:35 -msgid "Return one of the following values:" -msgstr "" - -#: ../../library/dbm.rst:37 +#: ../../library/dbm.rst:31 msgid "" -"``None`` if the file can't be opened because it's unreadable or doesn't exist" -msgstr "" - -#: ../../library/dbm.rst:38 -msgid "the empty string (``''``) if the file's format can't be guessed" +"Returns one of the following values: ``None`` if the file can't be opened " +"because it's unreadable or doesn't exist; the empty string (``''``) if the " +"file's format can't be guessed; or a string containing the required module " +"name, such as ``'dbm.ndbm'`` or ``'dbm.gnu'``." msgstr "" +"次の値のうち1つを返します: ファイルが読み取れないか存在しないために開くこと" +"ができない場合は ``None``; ファイルのフォーマットを推測することができない場合" +"は空文字列 (``''``); それ以外は ``'dbm.ndbm'`` や ``'dbm.gnu'`` のような、必" +"要なモジュール名を含む文字列。" #: ../../library/dbm.rst:39 -msgid "" -"a string containing the required module name, such as ``'dbm.ndbm'`` or " -"``'dbm.gnu'``" -msgstr "" +msgid "Open the database file *file* and return a corresponding object." +msgstr "データベースファイル *file* を開いて対応するオブジェクトを返します。" -#: ../../library/dbm.rst:41 ../../library/dbm.rst:250 ../../library/dbm.rst:448 -msgid "*filename* accepts a :term:`path-like object`." +#: ../../library/dbm.rst:41 +msgid "" +"If the database file already exists, the :func:`whichdb` function is used to " +"determine its type and the appropriate module is used; if it does not exist, " +"the first module listed above that can be imported is used." msgstr "" +"データベースファイルが既に存在する場合、その種類を決定するために :func:" +"`whichdb` 関数が使用され、適切なモジュールが使用されます; データベースファイ" +"ルが存在しない場合、上記のリストの中でインポート可能な最初のモジュールが使用" +"されます。" -#: ../../library/dbm.rst:65 -msgid "Open a database and return the corresponding database object." -msgstr "" +#: ../../library/dbm.rst:45 ../../library/dbm.rst:161 ../../library/dbm.rst:346 +msgid "The optional *flag* argument can be:" +msgstr "オプションの *flag* は:" -#: ../../library/dbm.rst:0 -msgid "Parameters" -msgstr "パラメーター" +#: ../../library/dbm.rst:48 ../../library/dbm.rst:164 ../../library/dbm.rst:183 +#: ../../library/dbm.rst:279 ../../library/dbm.rst:349 +msgid "Value" +msgstr "値" -#: ../../library/dbm.rst:67 -msgid "" -"The database file to open. If the database file already exists, the :func:" -"`whichdb` function is used to determine its type and the appropriate module " -"is used; if it does not exist, the first submodule listed above that can be " -"imported is used." -msgstr "" +#: ../../library/dbm.rst:48 ../../library/dbm.rst:164 ../../library/dbm.rst:183 +#: ../../library/dbm.rst:279 ../../library/dbm.rst:349 +msgid "Meaning" +msgstr "意味" -#: ../../library/dbm.rst:68 ../../library/dbm.rst:222 -msgid "The database file to open." -msgstr "" +#: ../../library/dbm.rst:50 ../../library/dbm.rst:166 ../../library/dbm.rst:281 +#: ../../library/dbm.rst:351 +msgid "``'r'``" +msgstr "``'r'``" -#: ../../library/dbm.rst:70 -msgid "" -"If the database file already exists, the :func:`whichdb` function is used to " -"determine its type and the appropriate module is used; if it does not exist, " -"the first submodule listed above that can be imported is used." -msgstr "" +#: ../../library/dbm.rst:50 ../../library/dbm.rst:166 ../../library/dbm.rst:281 +#: ../../library/dbm.rst:351 +msgid "Open existing database for reading only (default)" +msgstr "既存のデータベースを読み込み専用で開く (デフォルト)" -#: ../../library/dbm.rst:75 ../../library/dbm.rst:178 ../../library/dbm.rst:353 -msgid "" -"* ``'r'`` (default): |flag_r| * ``'w'``: |flag_w| * ``'c'``: |flag_c| * " -"``'n'``: |flag_n|" -msgstr "" +#: ../../library/dbm.rst:53 ../../library/dbm.rst:169 ../../library/dbm.rst:284 +#: ../../library/dbm.rst:354 +msgid "``'w'``" +msgstr "``'w'``" -#: ../../library/dbm.rst:76 ../../library/dbm.rst:180 ../../library/dbm.rst:227 +#: ../../library/dbm.rst:53 ../../library/dbm.rst:169 ../../library/dbm.rst:284 #: ../../library/dbm.rst:354 -msgid "``'r'`` (default): |flag_r|" -msgstr "" +msgid "Open existing database for reading and writing" +msgstr "既存のデータベースを読み書き用に開く" -#: ../../library/dbm.rst:77 ../../library/dbm.rst:181 ../../library/dbm.rst:228 -#: ../../library/dbm.rst:355 ../../library/dbm.rst:429 -msgid "``'w'``: |flag_w|" -msgstr "" +#: ../../library/dbm.rst:56 ../../library/dbm.rst:172 ../../library/dbm.rst:287 +#: ../../library/dbm.rst:357 +msgid "``'c'``" +msgstr "``'c'``" -#: ../../library/dbm.rst:78 ../../library/dbm.rst:182 ../../library/dbm.rst:229 -#: ../../library/dbm.rst:356 -msgid "``'c'``: |flag_c|" -msgstr "" +#: ../../library/dbm.rst:56 ../../library/dbm.rst:172 ../../library/dbm.rst:287 +#: ../../library/dbm.rst:357 +msgid "Open database for reading and writing, creating it if it doesn't exist" +msgstr "データベースを読み書き用に開く。ただし存在しない場合には新たに作成する" -#: ../../library/dbm.rst:79 ../../library/dbm.rst:183 ../../library/dbm.rst:230 -#: ../../library/dbm.rst:357 ../../library/dbm.rst:431 -msgid "``'n'``: |flag_n|" +#: ../../library/dbm.rst:59 ../../library/dbm.rst:175 ../../library/dbm.rst:290 +#: ../../library/dbm.rst:360 +msgid "``'n'``" +msgstr "``'n'``" + +#: ../../library/dbm.rst:59 ../../library/dbm.rst:175 ../../library/dbm.rst:290 +#: ../../library/dbm.rst:360 +msgid "Always create a new, empty database, open for reading and writing" +msgstr "常に新たに読み書き用の新規のデータベースを作成する" + +#: ../../library/dbm.rst:63 ../../library/dbm.rst:294 ../../library/dbm.rst:364 +msgid "" +"The optional *mode* argument is the Unix mode of the file, used only when " +"the database has to be created. It defaults to octal ``0o666`` (and will be " +"modified by the prevailing umask)." msgstr "" +"オプションの *mode* 引数は、新たにデータベースを作成しなければならない場合に" +"使われる Unix のファイルモードです。標準の値は 8 進数の ``0o666`` です (この" +"値は現在有効な umask で修飾されます)。" -#: ../../library/dbm.rst:81 ../../library/dbm.rst:244 ../../library/dbm.rst:359 -#: ../../library/dbm.rst:433 -msgid "|mode_param_doc|" +#: ../../library/dbm.rst:68 +msgid "" +"The object returned by :func:`.open` supports the same basic functionality " +"as dictionaries; keys and their corresponding values can be stored, " +"retrieved, and deleted, and the :keyword:`in` operator and the :meth:`keys` " +"method are available, as well as :meth:`get` and :meth:`setdefault`." msgstr "" +":func:`.open` によって返されたオブジェクトは辞書とほとんど同じ機能をサポート" +"します; キーとそれに対応付けられた値を記憶し、取り出し、削除することがで" +"き、 :keyword:`in` 演算子や :meth:`keys` メソッド、また :meth:`get` や :meth:" +"`setdefault` を使うことができます。" -#: ../../library/dbm.rst:84 -msgid "*file* accepts a :term:`path-like object`." +#: ../../library/dbm.rst:73 +msgid "" +":meth:`get` and :meth:`setdefault` are now available in all database modules." msgstr "" +":meth:`get` と :meth:`setdefault` がすべてのデータベースモジュールで利用でき" +"るようになりました。" -#: ../../library/dbm.rst:87 +#: ../../library/dbm.rst:76 msgid "" -"The object returned by :func:`~dbm.open` supports the same basic " -"functionality as a :class:`dict`; keys and their corresponding values can be " -"stored, retrieved, and deleted, and the :keyword:`in` operator and the :meth:" -"`!keys` method are available, as well as :meth:`!get` and :meth:`!" -"setdefault` methods." +"Deleting a key from a read-only database raises database module specific " +"error instead of :exc:`KeyError`." msgstr "" +"読み出し専用のデータベースからキーを削除しようとすると、 :exc:`KeyError` では" +"なくデータベースモジュール専用のエラーが送出されるようになりました。" -#: ../../library/dbm.rst:92 +#: ../../library/dbm.rst:80 msgid "" -"Key and values are always stored as :class:`bytes`. This means that when " -"strings are used they are implicitly converted to the default encoding " -"before being stored." +"Key and values are always stored as bytes. This means that when strings are " +"used they are implicitly converted to the default encoding before being " +"stored." msgstr "" +"キーと値は常に byte 列として格納されます。これは、文字列が使用された場合は格" +"納される前に暗黙的にデフォルトエンコーディングに変換されるということを意味し" +"ます。" -#: ../../library/dbm.rst:96 +#: ../../library/dbm.rst:84 msgid "" "These objects also support being used in a :keyword:`with` statement, which " "will automatically close them when done." @@ -182,25 +206,15 @@ msgstr "" "これらのオブジェクトは、 :keyword:`with` 文での使用にも対応しています。with " "文を使用した場合、終了時に自動的に閉じられます。" -#: ../../library/dbm.rst:99 -msgid "" -":meth:`!get` and :meth:`!setdefault` methods are now available for all :mod:" -"`dbm` backends." -msgstr "" - -#: ../../library/dbm.rst:103 +#: ../../library/dbm.rst:87 msgid "" "Added native support for the context management protocol to the objects " -"returned by :func:`~dbm.open`." +"returned by :func:`.open`." msgstr "" +":func:`.open` が返すオブジェクトに対するコンテキスト管理のプロトコルがネイ" +"ティブにサポートされました。" -#: ../../library/dbm.rst:107 -msgid "" -"Deleting a key from a read-only database raises a database module specific " -"exception instead of :exc:`KeyError`." -msgstr "" - -#: ../../library/dbm.rst:111 +#: ../../library/dbm.rst:91 msgid "" "The following example records some hostnames and a corresponding title, and " "then prints out the contents of the database::" @@ -208,118 +222,52 @@ msgstr "" "以下の例ではホスト名と対応するタイトルをいくつか記録し、データベースの内容を" "出力します::" -#: ../../library/dbm.rst:114 -msgid "" -"import dbm\n" -"\n" -"# Open database, creating it if necessary.\n" -"with dbm.open('cache', 'c') as db:\n" -"\n" -" # Record some values\n" -" db[b'hello'] = b'there'\n" -" db['www.python.org'] = 'Python Website'\n" -" db['www.cnn.com'] = 'Cable News Network'\n" -"\n" -" # Note that the keys are considered bytes now.\n" -" assert db[b'www.python.org'] == b'Python Website'\n" -" # Notice how the value is now in bytes.\n" -" assert db['www.cnn.com'] == b'Cable News Network'\n" -"\n" -" # Often-used methods of the dict interface work too.\n" -" print(db.get('python.org', b'not present'))\n" -"\n" -" # Storing a non-string key or value will raise an exception (most\n" -" # likely a TypeError).\n" -" db['www.yahoo.com'] = 4\n" -"\n" -"# db is automatically closed when leaving the with statement." -msgstr "" - -#: ../../library/dbm.rst:141 +#: ../../library/dbm.rst:121 msgid "Module :mod:`shelve`" msgstr ":mod:`shelve` モジュール" -#: ../../library/dbm.rst:142 +#: ../../library/dbm.rst:122 msgid "Persistence module which stores non-string data." msgstr "非文字列データを記録する永続化モジュール。" -#: ../../library/dbm.rst:145 +#: ../../library/dbm.rst:125 msgid "The individual submodules are described in the following sections." msgstr "個々のサブモジュールは以降の節で説明されます。" -#: ../../library/dbm.rst:148 -msgid ":mod:`dbm.sqlite3` --- SQLite backend for dbm" -msgstr "" - -#: ../../library/dbm.rst:156 -msgid "**Source code:** :source:`Lib/dbm/sqlite3.py`" -msgstr "" - -#: ../../library/dbm.rst:160 -msgid "" -"This module uses the standard library :mod:`sqlite3` module to provide an " -"SQLite backend for the :mod:`dbm` module. The files created by :mod:`dbm." -"sqlite3` can thus be opened by :mod:`sqlite3`, or any other SQLite browser, " -"including the SQLite CLI." -msgstr "" - -#: ../../includes/wasm-mobile-notavail.rst:3 ../../includes/wasm-notavail.rst:3 -msgid "Availability" -msgstr "" - -#: ../../includes/wasm-notavail.rst:5 -msgid "" -"This module does not work or is not available on WebAssembly. See :ref:`wasm-" -"availability` for more information." -msgstr "" -"このモジュールは WebAssembly では動作しないか、利用不可です。詳しくは、:ref:" -"`wasm-availability` を見てください。" - -#: ../../library/dbm.rst:169 -msgid "" -"Open an SQLite database. The returned object behaves like a :term:`mapping`, " -"implements a :meth:`!close` method, and supports a \"closing\" context " -"manager via the :keyword:`with` keyword." -msgstr "" - -#: ../../library/dbm.rst:174 -msgid "The path to the database to be opened." -msgstr "" - -#: ../../library/dbm.rst:185 -msgid "" -"The Unix file access mode of the file (default: octal ``0o666``), used only " -"when the database has to be created." -msgstr "" +#: ../../library/dbm.rst:129 +msgid ":mod:`dbm.gnu` --- GNU's reinterpretation of dbm" +msgstr ":mod:`dbm.gnu` --- GNU による dbm 拡張" -#: ../../library/dbm.rst:191 -msgid ":mod:`dbm.gnu` --- GNU database manager" -msgstr "" - -#: ../../library/dbm.rst:197 +#: ../../library/dbm.rst:135 msgid "**Source code:** :source:`Lib/dbm/gnu.py`" msgstr "**ソースコード:** :source:`Lib/dbm/gnu.py`" -#: ../../library/dbm.rst:201 +#: ../../library/dbm.rst:139 msgid "" -"The :mod:`dbm.gnu` module provides an interface to the :abbr:`GDBM (GNU " -"dbm)` library, similar to the :mod:`dbm.ndbm` module, but with additional " -"functionality like crash tolerance." +"This module is quite similar to the :mod:`dbm` module, but uses the GNU " +"library ``gdbm`` instead to provide some additional functionality. Please " +"note that the file formats created by :mod:`dbm.gnu` and :mod:`dbm.ndbm` are " +"incompatible." msgstr "" +"このモジュールは :mod:`dbm` モジュールによく似ていますが、GNU ライブラリ " +"``gdbm`` を使っていくつかの追加機能を提供しています。 :mod:`dbm.gnu` と :mod:" +"`dbm.ndbm` では生成されるファイル形式に互換性がないので注意してください。" -#: ../../library/dbm.rst:207 ../../library/dbm.rst:321 +#: ../../library/dbm.rst:143 msgid "" -"The file formats created by :mod:`dbm.gnu` and :mod:`dbm.ndbm` are " -"incompatible and can not be used interchangeably." +"The :mod:`dbm.gnu` module provides an interface to the GNU DBM library. " +"``dbm.gnu.gdbm`` objects behave like mappings (dictionaries), except that " +"keys and values are always converted to bytes before storing. Printing a " +"``gdbm`` object doesn't print the keys and values, and the :meth:`items` " +"and :meth:`values` methods are not supported." msgstr "" +":mod:`dbm.gnu` モジュールでは GNU DBM ライブラリへのインターフェースを提供し" +"ます。 ``dbm.gnu.gdbm`` オブジェクトはキーと値が必ず保存の前にバイト列に変換" +"されることを除き、マップ型 (辞書型) と同じように動作します。 ``gdbm`` オブ" +"ジェクトに対して :func:`print` を適用してもキーや値を印字することはなく、 :" +"meth:`items` 及び :meth:`values` メソッドはサポートされていません。" -#: ../../includes/wasm-mobile-notavail.rst:5 -msgid "" -"This module is not supported on :ref:`mobile platforms ` or :ref:`WebAssembly platforms `." -msgstr "" - -#: ../../library/dbm.rst:214 +#: ../../library/dbm.rst:152 msgid "" "Raised on :mod:`dbm.gnu`-specific errors, such as I/O errors. :exc:" "`KeyError` is raised for general mapping errors like specifying an incorrect " @@ -329,80 +277,89 @@ msgstr "" "定のように、一般的なマップ型のエラーに対しては :exc:`KeyError` が送出されま" "す。" -#: ../../library/dbm.rst:220 -msgid "Open a GDBM database and return a :class:`!gdbm` object." -msgstr "" - -#: ../../library/dbm.rst:226 +#: ../../library/dbm.rst:158 msgid "" -"* ``'r'`` (default): |flag_r| * ``'w'``: |flag_w| * ``'c'``: |flag_c| * " -"``'n'``: |flag_n| The following additional characters may be appended to " -"control how the database is opened: * ``'f'``: Open the database in fast " -"mode. Writes to the database will not be synchronized. * ``'s'``: " -"Synchronized mode. Changes to the database will be written immediately to " -"the file. * ``'u'``: Do not lock database. Not all flags are valid for all " -"versions of GDBM. See the :data:`open_flags` member for a list of supported " -"flag characters." +"Open a ``gdbm`` database and return a :class:`gdbm` object. The *filename* " +"argument is the name of the database file." msgstr "" +"``gdbm`` データベースを開いて :class:`gdbm` オブジェクトを返します。 " +"*filename* 引数はデータベースファイルの名前です。" -#: ../../library/dbm.rst:232 +#: ../../library/dbm.rst:179 msgid "" -"The following additional characters may be appended to control how the " -"database is opened:" +"The following additional characters may be appended to the flag to control " +"how the database is opened:" msgstr "" +"以下の追加の文字を flag に追加して、データベースの開きかたを制御することがで" +"きます:" -#: ../../library/dbm.rst:235 -msgid "" -"``'f'``: Open the database in fast mode. Writes to the database will not be " -"synchronized." -msgstr "" +#: ../../library/dbm.rst:185 +msgid "``'f'``" +msgstr "``'f'``" -#: ../../library/dbm.rst:237 +#: ../../library/dbm.rst:185 msgid "" -"``'s'``: Synchronized mode. Changes to the database will be written " -"immediately to the file." -msgstr "" +"Open the database in fast mode. Writes to the database will not be " +"synchronized." +msgstr "データベースを高速モードで開きます。書き込みが同期されません。" -#: ../../library/dbm.rst:239 -msgid "``'u'``: Do not lock database." -msgstr "" +#: ../../library/dbm.rst:188 +msgid "``'s'``" +msgstr "``'s'``" -#: ../../library/dbm.rst:241 +#: ../../library/dbm.rst:188 msgid "" -"Not all flags are valid for all versions of GDBM. See the :data:`open_flags` " -"member for a list of supported flag characters." -msgstr "" +"Synchronized mode. This will cause changes to the database to be immediately " +"written to the file." +msgstr "同期モード。データベースへの変更がすぐにファイルに書き込まれます。" -#: ../../library/dbm.rst:0 -msgid "Raises" -msgstr "" +#: ../../library/dbm.rst:192 +msgid "``'u'``" +msgstr "``'u'``" -#: ../../library/dbm.rst:247 -msgid "If an invalid *flag* argument is passed." +#: ../../library/dbm.rst:192 +msgid "Do not lock database." +msgstr "データベースをロックしません。" + +#: ../../library/dbm.rst:195 +msgid "" +"Not all flags are valid for all versions of ``gdbm``. The module constant :" +"const:`open_flags` is a string of supported flag characters. The exception :" +"exc:`error` is raised if an invalid flag is specified." msgstr "" +"全てのバージョンの ``gdbm`` で全てのフラグが有効とは限りません。モジュール定" +"数 :const:`open_flags` はサポートされているフラグ文字からなる文字列です。無効" +"なフラグが指定された場合、例外 :exc:`error` が送出されます。" -#: ../../library/dbm.rst:255 +#: ../../library/dbm.rst:199 msgid "" -"A string of characters the *flag* parameter of :meth:`~dbm.gnu.open` " -"supports." +"The optional *mode* argument is the Unix mode of the file, used only when " +"the database has to be created. It defaults to octal ``0o666``." msgstr "" +"オプションの *mode* 引数は、新たにデータベースを作成しなければならない場合に" +"使われる Unix のファイルモードです。標準の値は 8 進数の ``0o666`` です。" -#: ../../library/dbm.rst:257 +#: ../../library/dbm.rst:202 msgid "" -":class:`!gdbm` objects behave similar to :term:`mappings `, but :" -"meth:`!items` and :meth:`!values` methods are not supported. The following " -"methods are also provided:" +"In addition to the dictionary-like methods, ``gdbm`` objects have the " +"following methods:" msgstr "" +"辞書型形式のメソッドに加えて、``gdbm`` オブジェクトには以下のメソッドがありま" +"す:" -#: ../../library/dbm.rst:263 +#: ../../library/dbm.rst:207 msgid "" "It's possible to loop over every key in the database using this method and " -"the :meth:`nextkey` method. The traversal is ordered by GDBM's internal " +"the :meth:`nextkey` method. The traversal is ordered by ``gdbm``'s internal " "hash values, and won't be sorted by the key values. This method returns the " "starting key." msgstr "" +"このメソッドと :meth:`nextkey` メソッドを使って、データベースの全てのキーにわ" +"たってループ処理を行うことができます。探索は ``gdbm`` の内部ハッシュ値の順番" +"に行われ、キーの値に順に並んでいるとは限りません。このメソッドは最初のキーを" +"返します。" -#: ../../library/dbm.rst:270 +#: ../../library/dbm.rst:214 msgid "" "Returns the key that follows *key* in the traversal. The following code " "prints every key in the database ``db``, without having to create a list in " @@ -412,24 +369,21 @@ msgstr "" "コードはデータベース ``db`` について、キー全てを含むリストをメモリ上に生成す" "ることなく全てのキーを出力します::" -#: ../../library/dbm.rst:274 -msgid "" -"k = db.firstkey()\n" -"while k is not None:\n" -" print(k)\n" -" k = db.nextkey(k)" -msgstr "" - -#: ../../library/dbm.rst:281 +#: ../../library/dbm.rst:225 msgid "" "If you have carried out a lot of deletions and would like to shrink the " -"space used by the GDBM file, this routine will reorganize the database. :" -"class:`!gdbm` objects will not shorten the length of a database file except " -"by using this reorganization; otherwise, deleted file space will be kept and " +"space used by the ``gdbm`` file, this routine will reorganize the database. " +"``gdbm`` objects will not shorten the length of a database file except by " +"using this reorganization; otherwise, deleted file space will be kept and " "reused as new (key, value) pairs are added." msgstr "" +"大量の削除を実行した後、``gdbm`` ファイルの占めるスペースを削減したい場合、こ" +"のルーチンはデータベースを再組織化します。この再組織化を使用する方法以外に " +"``gdbm`` オブジェクトがデータベースファイルの大きさを短くすることはありませ" +"ん。サイズを縮小しない場合、削除された部分のファイルスペースは保持され、新た" +"な (キー、値の) ペアが追加される際に再利用されます。" -#: ../../library/dbm.rst:289 +#: ../../library/dbm.rst:233 msgid "" "When the database has been opened in fast mode, this method forces any " "unwritten data to be written to the disk." @@ -437,38 +391,44 @@ msgstr "" "データベースが高速モードで開かれていた場合、このメソッドはディスクにまだ書き" "込まれていないデータを全て書き込ませます。" -#: ../../library/dbm.rst:294 -msgid "Close the GDBM database." -msgstr "" +#: ../../library/dbm.rst:238 +msgid "Close the ``gdbm`` database." +msgstr "``gdbm`` データベースをクローズします。" -#: ../../library/dbm.rst:298 -msgid "Remove all items from the GDBM database." -msgstr "" - -#: ../../library/dbm.rst:304 -msgid ":mod:`dbm.ndbm` --- New Database Manager" -msgstr "" +#: ../../library/dbm.rst:241 +msgid ":mod:`dbm.ndbm` --- Interface based on ndbm" +msgstr ":mod:`dbm.ndbm` --- ndbm に基づくインターフェース" -#: ../../library/dbm.rst:310 +#: ../../library/dbm.rst:247 msgid "**Source code:** :source:`Lib/dbm/ndbm.py`" msgstr "**ソースコード:** :source:`Lib/dbm/ndbm.py`" -#: ../../library/dbm.rst:314 +#: ../../library/dbm.rst:251 msgid "" -"The :mod:`dbm.ndbm` module provides an interface to the :abbr:`NDBM (New " -"Database Manager)` library. This module can be used with the \"classic\" " -"NDBM interface or the :abbr:`GDBM (GNU dbm)` compatibility interface." +"The :mod:`dbm.ndbm` module provides an interface to the Unix \"(n)dbm\" " +"library. Dbm objects behave like mappings (dictionaries), except that keys " +"and values are always stored as bytes. Printing a ``dbm`` object doesn't " +"print the keys and values, and the :meth:`items` and :meth:`values` methods " +"are not supported." msgstr "" +":mod:`dbm.ndbm` モジュールはUnixの\"(n)dbm\"ライブラリのインターフェースを提" +"供します。 dbmオブジェクトは、キーと値が必ずバイト列である以外は辞書オブジェ" +"クトのようなふるまいをします。 print関数などで ``dbm`` オブジェクトを出力して" +"もキーと値は出力されません。また、 :meth:`items` と :meth:`values` メソッドは" +"サポートされません。" -#: ../../library/dbm.rst:326 +#: ../../library/dbm.rst:256 msgid "" -"The NDBM library shipped as part of macOS has an undocumented limitation on " -"the size of values, which can result in corrupted database files when " -"storing values larger than this limit. Reading such corrupted files can " -"result in a hard crash (segmentation fault)." +"This module can be used with the \"classic\" ndbm interface or the GNU GDBM " +"compatibility interface. On Unix, the :program:`configure` script will " +"attempt to locate the appropriate header file to simplify building this " +"module." msgstr "" +"このモジュールは、GNU GDBM互換インターフェースを持った \"クラシックな\" ndbm" +"インターフェースを使うことができます。 Unix上のビルド時に :program:" +"`configure` スクリプトで適切なヘッダファイルが割り当られます。" -#: ../../library/dbm.rst:335 +#: ../../library/dbm.rst:262 msgid "" "Raised on :mod:`dbm.ndbm`-specific errors, such as I/O errors. :exc:" "`KeyError` is raised for general mapping errors like specifying an incorrect " @@ -478,48 +438,45 @@ msgstr "" "定のように、一般的なマップ型のエラーに対しては :exc:`KeyError` が送出されま" "す。" -#: ../../library/dbm.rst:341 -msgid "Name of the NDBM implementation library used." -msgstr "" - -#: ../../library/dbm.rst:346 -msgid "Open an NDBM database and return an :class:`!ndbm` object." -msgstr "" +#: ../../library/dbm.rst:268 +msgid "Name of the ``ndbm`` implementation library used." +msgstr "``ndbm`` が使用している実装ライブラリ名です。" -#: ../../library/dbm.rst:348 +#: ../../library/dbm.rst:273 msgid "" -"The basename of the database file (without the :file:`.dir` or :file:`.pag` " +"Open a dbm database and return a ``ndbm`` object. The *filename* argument " +"is the name of the database file (without the :file:`.dir` or :file:`.pag` " "extensions)." msgstr "" +"dbmデータベースを開いて ``ndbm`` オブジェクトを返します。引数 *filename* は" +"データベースのファイル名を指定します。 (拡張子 :file:`.dir` や :file:`.pag` " +"は付けません)。" -#: ../../library/dbm.rst:362 -msgid "" -":class:`!ndbm` objects behave similar to :term:`mappings `, but :" -"meth:`!items` and :meth:`!values` methods are not supported. The following " -"methods are also provided:" -msgstr "" +#: ../../library/dbm.rst:276 +msgid "The optional *flag* argument must be one of these values:" +msgstr "オプションの *flag* は以下の値のいずれかです:" -#: ../../library/dbm.rst:366 -msgid "Accepts :term:`path-like object` for filename." -msgstr "" - -#: ../../library/dbm.rst:371 -msgid "Close the NDBM database." +#: ../../library/dbm.rst:298 +msgid "" +"In addition to the dictionary-like methods, ``ndbm`` objects provide the " +"following method:" msgstr "" +"辞書型様のメソッドに加えて、``ndbm`` オブジェクトには以下のメソッドがありま" +"す。" -#: ../../library/dbm.rst:375 -msgid "Remove all items from the NDBM database." -msgstr "" +#: ../../library/dbm.rst:303 +msgid "Close the ``ndbm`` database." +msgstr "``ndbm`` データベースをクローズします。" -#: ../../library/dbm.rst:381 +#: ../../library/dbm.rst:307 msgid ":mod:`dbm.dumb` --- Portable DBM implementation" msgstr ":mod:`dbm.dumb` --- 可搬性のある DBM 実装" -#: ../../library/dbm.rst:386 +#: ../../library/dbm.rst:312 msgid "**Source code:** :source:`Lib/dbm/dumb.py`" msgstr "**ソースコード:** :source:`Lib/dbm/dumb.py`" -#: ../../library/dbm.rst:392 +#: ../../library/dbm.rst:318 msgid "" "The :mod:`dbm.dumb` module is intended as a last resort fallback for the :" "mod:`dbm` module when a more robust module is not available. The :mod:`dbm." @@ -531,18 +488,23 @@ msgstr "" "度を重視して書かれているわけではなく、他のデータベースモジュールのように重い" "使い方をするためのものではありません。" -#: ../../library/dbm.rst:399 +#: ../../library/dbm.rst:325 msgid "" -"The :mod:`dbm.dumb` module provides a persistent :class:`dict`-like " -"interface which is written entirely in Python. Unlike other :mod:`dbm` " -"backends, such as :mod:`dbm.gnu`, no external library is required." +"The :mod:`dbm.dumb` module provides a persistent dictionary-like interface " +"which is written entirely in Python. Unlike other modules such as :mod:`dbm." +"gnu` no external library is required. As with other persistent mappings, " +"the keys and values are always stored as bytes." msgstr "" +":mod:`dbm.dumb` モジュールは永続性辞書に類似したインターフェースを提供し、全" +"て Python で書かれています。 :mod:`dbm.gnu` のようなモジュールと異なり、外部" +"ライブラリは必要ありません。他の永続性マップ型のように、キーおよび値は常にバ" +"イト列として保存されます。" -#: ../../library/dbm.rst:404 -msgid "The :mod:`!dbm.dumb` module defines the following:" -msgstr "" +#: ../../library/dbm.rst:330 +msgid "The module defines the following:" +msgstr "このモジュールは以下を定義します:" -#: ../../library/dbm.rst:408 +#: ../../library/dbm.rst:335 msgid "" "Raised on :mod:`dbm.dumb`-specific errors, such as I/O errors. :exc:" "`KeyError` is raised for general mapping errors like specifying an incorrect " @@ -552,49 +514,19 @@ msgstr "" "を指定したときのような、一般的な対応付けエラーの際には :exc:`KeyError` が送出" "されます。" -#: ../../library/dbm.rst:414 -msgid "" -"Open a :mod:`!dbm.dumb` database. The returned database object behaves " -"similar to a :term:`mapping`, in addition to providing :meth:`~dumbdbm.sync` " -"and :meth:`~dumbdbm.close` methods." -msgstr "" - -#: ../../library/dbm.rst:419 -msgid "" -"The basename of the database file (without extensions). A new database " -"creates the following files: - :file:`{filename}.dat` - :file:`{filename}." -"dir`" -msgstr "" - -#: ../../library/dbm.rst:420 +#: ../../library/dbm.rst:341 msgid "" -"The basename of the database file (without extensions). A new database " -"creates the following files:" +"Open a ``dumbdbm`` database and return a dumbdbm object. The *filename* " +"argument is the basename of the database file (without any specific " +"extensions). When a dumbdbm database is created, files with :file:`.dat` " +"and :file:`.dir` extensions are created." msgstr "" +"``dumbdbm`` データベースを開き、 dubmdbm オブジェクトを返します。 *filename* " +"引数はデータベースファイル名の雛型 (特定の拡張子をもたないもの) です。" +"dumbdbm データベースが生成される際、 :file:`.dat` および :file:`.dir` の拡張" +"子を持ったファイルが生成されます。" -#: ../../library/dbm.rst:423 -msgid ":file:`{filename}.dat`" -msgstr "" - -#: ../../library/dbm.rst:424 -msgid ":file:`{filename}.dir`" -msgstr "" - -#: ../../library/dbm.rst:427 -msgid "" -"* ``'r'``: |flag_r| * ``'w'``: |flag_w| * ``'c'`` (default): |flag_c| * " -"``'n'``: |flag_n|" -msgstr "" - -#: ../../library/dbm.rst:428 -msgid "``'r'``: |flag_r|" -msgstr "" - -#: ../../library/dbm.rst:430 -msgid "``'c'`` (default): |flag_c|" -msgstr "" - -#: ../../library/dbm.rst:437 +#: ../../library/dbm.rst:369 msgid "" "It is possible to crash the Python interpreter when loading a database with " "a sufficiently large/complex entry due to stack depth limitations in " @@ -604,33 +536,40 @@ msgstr "" "るときに、 Python の抽象構文木コンパイラのスタックの深さの限界を越えるせい" "で、 Python インタプリタをクラッシュさせることができます。" -#: ../../library/dbm.rst:441 +#: ../../library/dbm.rst:373 msgid "" -":func:`~dbm.dumb.open` always creates a new database when *flag* is ``'n'``." +":func:`.open` always creates a new database when the flag has the value " +"``'n'``." msgstr "" +"フラグに値 ``'n'`` を与えると、 :func:`.open` が常に新しいデータベースを作成" +"するようになりました。" -#: ../../library/dbm.rst:444 +#: ../../library/dbm.rst:377 msgid "" -"A database opened read-only if *flag* is ``'r'``. A database is not created " -"if it does not exist if *flag* is ``'r'`` or ``'w'``." +"A database opened with flags ``'r'`` is now read-only. Opening with flags " +"``'r'`` and ``'w'`` no longer creates a database if it does not exist." msgstr "" +"フラグ ``'r'`` で開いたデータベースは読み出し専用となりました。\n" +"データベースが存在していない場合にフラグ ``'r'`` と ``'w'`` で開いても、デー" +"タベースを作成しなくなりました。" -#: ../../library/dbm.rst:451 +#: ../../library/dbm.rst:382 msgid "" "In addition to the methods provided by the :class:`collections.abc." -"MutableMapping` class, the following methods are provided:" +"MutableMapping` class, :class:`dumbdbm` objects provide the following " +"methods:" msgstr "" +":class:`collections.abc.MutableMapping` クラスによって提供されるメソッドに加" +"えて、 :class:`dumbdbm` オブジェクトは以下のメソッドを提供します:" -#: ../../library/dbm.rst:457 +#: ../../library/dbm.rst:388 msgid "" "Synchronize the on-disk directory and data files. This method is called by " -"the :meth:`shelve.Shelf.sync` method." -msgstr "" - -#: ../../library/dbm.rst:462 -msgid "Close the database." +"the :meth:`Shelve.sync` method." msgstr "" +"ディスク上の辞書とデータファイルを同期します。このメソッドは :meth:`Shelve." +"sync` メソッドから呼び出されます。" -#: ../../library/dbm.rst:388 -msgid "databases" -msgstr "データベース" +#: ../../library/dbm.rst:393 +msgid "Close the ``dumbdbm`` database." +msgstr "``dumbdbm`` データベースをクローズします。" diff --git a/library/debug.po b/library/debug.po index f736ed9bb..6d6e87653 100644 --- a/library/debug.po +++ b/library/debug.po @@ -1,25 +1,26 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 +# Arihiro TAKASE, 2017 +# tomo, 2019 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-30 14:22+0000\n" -"PO-Revision-Date: 2021-06-28 01:04+0000\n" -"Last-Translator: tomo, 2021\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 23:06+0000\n" +"Last-Translator: tomo, 2019\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/debug.rst:3 diff --git a/library/decimal.po b/library/decimal.po index 642cbea0a..5f958ce5b 100644 --- a/library/decimal.po +++ b/library/decimal.po @@ -1,33 +1,39 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: +# 秘湯 , 2017 +# Shun Sakurai, 2017 +# Ryuichi Takano , 2017 +# Nozomu Kaneko , 2017 +# E. Kawashima, 2017 +# Arihiro TAKASE, 2017 +# mnamihdk, 2017 +# Osamu NAKAMURA, 2017 +# tomo, 2020 # Takanori Suzuki , 2021 -# Arihiro TAKASE, 2023 -# tomo, 2024 -# 石井明久, 2024 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-06 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 01:04+0000\n" -"Last-Translator: 石井明久, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 23:06+0000\n" +"Last-Translator: Takanori Suzuki , 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/decimal.rst:2 -msgid ":mod:`!decimal` --- Decimal fixed-point and floating-point arithmetic" -msgstr ":mod:`!decimal` --- 10進固定小数点と浮動小数点の演算" +msgid ":mod:`decimal` --- Decimal fixed point and floating point arithmetic" +msgstr ":mod:`decimal` --- 十進固定及び浮動小数点数の算術演算" #: ../../library/decimal.rst:15 msgid "**Source code:** :source:`Lib/decimal.py`" @@ -35,13 +41,13 @@ msgstr "**ソースコード:** :source:`Lib/decimal.py`" #: ../../library/decimal.rst:33 msgid "" -"The :mod:`decimal` module provides support for fast correctly rounded " -"decimal floating-point arithmetic. It offers several advantages over the :" +"The :mod:`decimal` module provides support for fast correctly-rounded " +"decimal floating point arithmetic. It offers several advantages over the :" "class:`float` datatype:" msgstr "" -":mod:`decimal` モジュールは、高速で正確に丸められた10進浮動小数点演算のサポー" -"トを提供します。これには、 :class:`float` データ型よりも優れたいくつかの利点" -"があります。" +":mod:`decimal` モジュールは正確に丸められた十進浮動小数点算術をサポートしま" +"す。 :mod:`decimal` には、 :class:`float` データ型に比べて、以下のような利点" +"があります:" #: ../../library/decimal.rst:37 msgid "" @@ -57,48 +63,48 @@ msgstr "" #: ../../library/decimal.rst:42 msgid "" -"Decimal numbers can be represented exactly. In contrast, numbers like " -"``1.1`` and ``2.2`` do not have exact representations in binary floating " -"point. End users typically would not expect ``1.1 + 2.2`` to display as " -"``3.3000000000000003`` as it does with binary floating point." +"Decimal numbers can be represented exactly. In contrast, numbers like :" +"const:`1.1` and :const:`2.2` do not have exact representations in binary " +"floating point. End users typically would not expect ``1.1 + 2.2`` to " +"display as :const:`3.3000000000000003` as it does with binary floating point." msgstr "" -"十進数を正確に表現できます。 ``1.1`` や ``2.2`` のような数は、二進数の浮動小" -"数点型では正しく表現できません。エンドユーザは普通、 二進数における ``1.1 + " -"2.2`` の近似値が ``3.3000000000000003`` だからといって、そのように表示してほ" -"しいとは考えないものです。" +"十進数を正確に表現できます。 :const:`1.1` や :const:`2.2` のような数は、二進" +"数の浮動小数点型では正しく表現できません。エンドユーザは普通、 二進数におけ" +"る ``1.1 + 2.2`` の近似値が :const:`3.3000000000000003` だからといって、その" +"ように表示してほしいとは考えないものです。" #: ../../library/decimal.rst:47 msgid "" "The exactness carries over into arithmetic. In decimal floating point, " "``0.1 + 0.1 + 0.1 - 0.3`` is exactly equal to zero. In binary floating " -"point, the result is ``5.5511151231257827e-017``. While near to zero, the " -"differences prevent reliable equality testing and differences can " +"point, the result is :const:`5.5511151231257827e-017`. While near to zero, " +"the differences prevent reliable equality testing and differences can " "accumulate. For this reason, decimal is preferred in accounting applications " "which have strict equality invariants." msgstr "" "値の正確さは算術にも及びます。十進の浮動小数点による計算では、 ``0.1 + 0.1 + " -"0.1 - 0.3`` は厳密にゼロに等しくなります。 二進浮動小数点では " -"``5.5511151231257827e-017`` になってしまいます。ゼロに近い値とはいえ、この誤" -"差は数値間の等価性テストの信頼性を阻害します。また、誤差が蓄積されることもあ" -"ります。こうした理由から、数値間の等価性を厳しく保たなければならないようなア" -"プリケーションを考えるなら、十進数による数値表現が望ましいということになりま" +"0.1 - 0.3`` は厳密にゼロに等しくなります。 二進浮動小数点では :const:" +"`5.5511151231257827e-017` になってしまいます。ゼロに近い値とはいえ、この誤差" +"は数値間の等価性テストの信頼性を阻害します。また、誤差が蓄積されることもあり" +"ます。こうした理由から、数値間の等価性を厳しく保たなければならないようなアプ" +"リケーションを考えるなら、十進数による数値表現が望ましいということになりま" "す。" #: ../../library/decimal.rst:54 msgid "" "The decimal module incorporates a notion of significant places so that " -"``1.30 + 1.20`` is ``2.50``. The trailing zero is kept to indicate " +"``1.30 + 1.20`` is :const:`2.50`. The trailing zero is kept to indicate " "significance. This is the customary presentation for monetary applications. " "For multiplication, the \"schoolbook\" approach uses all the figures in the " -"multiplicands. For instance, ``1.3 * 1.2`` gives ``1.56`` while ``1.30 * " -"1.20`` gives ``1.5600``." +"multiplicands. For instance, ``1.3 * 1.2`` gives :const:`1.56` while ``1.30 " +"* 1.20`` gives :const:`1.5600`." msgstr "" ":mod:`decimal` モジュールでは、有効桁数の表記が取り入れられており、例えば " -"``1.30 + 1.20`` は ``2.50`` になります。すなわち、末尾のゼロは有効数字を示す" -"ために残されます。こうした仕様は通貨計算を行うアプリケーションでは慣例です。" -"乗算の場合、「教科書的な」アプローチでは、乗算の被演算子すべての桁数を使いま" -"す。例えば、 ``1.3 * 1.2`` は ``1.56`` になり、 ``1.30 * 1.20`` は " -"``1.5600`` になります。" +"``1.30 + 1.20`` は :const:`2.50` になります。すなわち、末尾のゼロは有効数字を" +"示すために残されます。こうした仕様は通貨計算を行うアプリケーションでは慣例で" +"す。乗算の場合、「教科書的な」アプローチでは、乗算の被演算子すべての桁数を使" +"います。例えば、 ``1.3 * 1.2`` は :const:`1.56` になり、 ``1.30 * 1.20`` は :" +"const:`1.5600` になります。" #: ../../library/decimal.rst:61 msgid "" @@ -149,14 +155,15 @@ msgstr "" msgid "" "A decimal number is immutable. It has a sign, coefficient digits, and an " "exponent. To preserve significance, the coefficient digits do not truncate " -"trailing zeros. Decimals also include special values such as ``Infinity``, " -"``-Infinity``, and ``NaN``. The standard also differentiates ``-0`` from " -"``+0``." +"trailing zeros. Decimals also include special values such as :const:" +"`Infinity`, :const:`-Infinity`, and :const:`NaN`. The standard also " +"differentiates :const:`-0` from :const:`+0`." msgstr "" "十進数型は変更不能です。これは符号、係数部、そして指数を持ちます。有効桁数を" "残すために、仮数部の末尾にあるゼロは切り詰められません。 :mod:`decimal` で" -"は、 ``Infinity``, ``-Infinity``, および ``NaN`` といった特殊な値も定義されて" -"います。標準仕様では ``-0`` と ``+0`` も区別します。" +"は、 :const:`Infinity`, :const:`-Infinity`, および :const:`NaN` といった特殊" +"な値も定義されています。標準仕様では :const:`-0` と :const:`+0` も区別しま" +"す。" #: ../../library/decimal.rst:94 msgid "" @@ -207,14 +214,14 @@ msgstr "" #: ../../library/decimal.rst:116 msgid "" "IBM's General Decimal Arithmetic Specification, `The General Decimal " -"Arithmetic Specification `_." +"Arithmetic Specification `_." msgstr "" "IBM による汎用十進演算仕様、`The General Decimal Arithmetic Specification " -"`_。" +"`_。" #: ../../library/decimal.rst:125 -msgid "Quick-start tutorial" -msgstr "" +msgid "Quick-start Tutorial" +msgstr "クイックスタートチュートリアル" #: ../../library/decimal.rst:127 msgid "" @@ -226,50 +233,19 @@ msgstr "" "ンテキストを :func:`getcontext` で調べ、必要なら、精度、丸め、有効なトラップ" "を設定します::" -#: ../../library/decimal.rst:131 -msgid "" -">>> from decimal import *\n" -">>> getcontext()\n" -"Context(prec=28, rounding=ROUND_HALF_EVEN, Emin=-999999, Emax=999999,\n" -" capitals=1, clamp=0, flags=[], traps=[Overflow, DivisionByZero,\n" -" InvalidOperation])\n" -"\n" -">>> getcontext().prec = 7 # Set a new precision" -msgstr "" - #: ../../library/decimal.rst:139 msgid "" "Decimal instances can be constructed from integers, strings, floats, or " "tuples. Construction from an integer or a float performs an exact conversion " "of the value of that integer or float. Decimal numbers include special " -"values such as ``NaN`` which stands for \"Not a number\", positive and " -"negative ``Infinity``, and ``-0``::" +"values such as :const:`NaN` which stands for \"Not a number\", positive and " +"negative :const:`Infinity`, and :const:`-0`::" msgstr "" ":class:`Decimal` インスタンスは、整数、文字列、浮動小数点数、またはタプルから" "構成できます。整数や浮動小数点数からの構成は、整数や浮動小数点数の値を正確に" -"変換します。 :class:`Decimal` は \"非数 (Not a Number)\" を表す ``NaN`` や正" -"負の ``Infinity`` (無限大)、 ``-0`` といった特殊な値も表現できます::" - -#: ../../library/decimal.rst:145 -msgid "" -">>> getcontext().prec = 28\n" -">>> Decimal(10)\n" -"Decimal('10')\n" -">>> Decimal('3.14')\n" -"Decimal('3.14')\n" -">>> Decimal(3.14)\n" -"Decimal('3.140000000000000124344978758017532527446746826171875')\n" -">>> Decimal((0, (3, 1, 4), -2))\n" -"Decimal('3.14')\n" -">>> Decimal(str(2.0 ** 0.5))\n" -"Decimal('1.4142135623730951')\n" -">>> Decimal(2) ** Decimal('0.5')\n" -"Decimal('1.414213562373095048801688724')\n" -">>> Decimal('NaN')\n" -"Decimal('NaN')\n" -">>> Decimal('-Infinity')\n" -"Decimal('-Infinity')" -msgstr "" +"変換します。 :class:`Decimal` は \"非数 (Not a Number)\" を表す :const:`NaN` " +"や正負の :const:`Infinity` (無限大)、 :const:`-0` といった特殊な値も表現でき" +"ます::" #: ../../library/decimal.rst:163 msgid "" @@ -280,22 +256,6 @@ msgstr "" ":exc:`FloatOperation` シグナルがトラップされる場合、コンストラクタや順序比較" "において誤って decimal と float が混ざると、例外が送出されます::" -#: ../../library/decimal.rst:167 -msgid "" -">>> c = getcontext()\n" -">>> c.traps[FloatOperation] = True\n" -">>> Decimal(3.14)\n" -"Traceback (most recent call last):\n" -" File \"\", line 1, in \n" -"decimal.FloatOperation: []\n" -">>> Decimal('3.5') < 3.7\n" -"Traceback (most recent call last):\n" -" File \"\", line 1, in \n" -"decimal.FloatOperation: []\n" -">>> Decimal('3.5') == 3.5\n" -"True" -msgstr "" - #: ../../library/decimal.rst:182 msgid "" "The significance of a new Decimal is determined solely by the number of " @@ -305,20 +265,6 @@ msgstr "" "新たな :class:`Decimal` の有効桁数は入力の桁数だけで決まります。演算コンテキ" "ストにおける精度や値丸めの設定が影響するのは算術演算の間だけです。" -#: ../../library/decimal.rst:186 -msgid "" -">>> getcontext().prec = 6\n" -">>> Decimal('3.0')\n" -"Decimal('3.0')\n" -">>> Decimal('3.1415926535')\n" -"Decimal('3.1415926535')\n" -">>> Decimal('3.1415926535') + Decimal('2.7182818285')\n" -"Decimal('5.85987')\n" -">>> getcontext().rounding = ROUND_UP\n" -">>> Decimal('3.1415926535') + Decimal('2.7182818285')\n" -"Decimal('5.85988')" -msgstr "" - #: ../../library/decimal.rst:199 msgid "" "If the internal limits of the C version are exceeded, constructing a decimal " @@ -327,48 +273,13 @@ msgstr "" "C バージョンの内部制限を超えた場合、decimal の構成は :class:" "`InvalidOperation` を送出します::" -#: ../../library/decimal.rst:202 -msgid "" -">>> Decimal(\"1e9999999999999999999\")\n" -"Traceback (most recent call last):\n" -" File \"\", line 1, in \n" -"decimal.InvalidOperation: []" -msgstr "" - #: ../../library/decimal.rst:209 msgid "" "Decimals interact well with much of the rest of Python. Here is a small " -"decimal floating-point flying circus:" -msgstr "" - -#: ../../library/decimal.rst:212 -msgid "" -">>> data = list(map(Decimal, '1.34 1.87 3.45 2.35 1.00 0.03 9.25'.split()))\n" -">>> max(data)\n" -"Decimal('9.25')\n" -">>> min(data)\n" -"Decimal('0.03')\n" -">>> sorted(data)\n" -"[Decimal('0.03'), Decimal('1.00'), Decimal('1.34'), Decimal('1.87'),\n" -" Decimal('2.35'), Decimal('3.45'), Decimal('9.25')]\n" -">>> sum(data)\n" -"Decimal('19.29')\n" -">>> a,b,c = data[:3]\n" -">>> str(a)\n" -"'1.34'\n" -">>> float(a)\n" -"1.34\n" -">>> round(a, 1)\n" -"Decimal('1.3')\n" -">>> int(a)\n" -"1\n" -">>> a * 5\n" -"Decimal('6.70')\n" -">>> a * b\n" -"Decimal('2.5058')\n" -">>> c % a\n" -"Decimal('0.77')" +"decimal floating point flying circus:" msgstr "" +"decimal はほとんどの場面で Python の他の機能とうまくやりとりできます。" +"decimal 浮動小数点の空飛ぶサーカス (flying circus) をお見せしましょう:" #: ../../library/decimal.rst:241 msgid "And some mathematical functions are also available to Decimal:" @@ -376,12 +287,12 @@ msgstr "いくつかの数学的関数も Decimal には用意されています #: ../../library/decimal.rst:253 msgid "" -"The :meth:`~Decimal.quantize` method rounds a number to a fixed exponent. " -"This method is useful for monetary applications that often round results to " -"a fixed number of places:" +"The :meth:`quantize` method rounds a number to a fixed exponent. This " +"method is useful for monetary applications that often round results to a " +"fixed number of places:" msgstr "" -":meth:`~Decimal.quantize` メソッドは位を固定して数値を丸めます。このメソッド" -"は、結果を固定の桁数で丸めることがよくある、金融アプリケーションで便利です:" +":meth:`quantize` メソッドは位を固定して数値を丸めます。このメソッドは、結果を" +"固定の桁数で丸めることがよくある、金融アプリケーションで便利です:" #: ../../library/decimal.rst:262 msgid "" @@ -415,83 +326,35 @@ msgstr "" "ます。前者はほとんどのトラップが有効になっており、とりわけデバッグの際に便利" "です:" -#: ../../library/decimal.rst:275 -msgid "" -">>> myothercontext = Context(prec=60, rounding=ROUND_HALF_DOWN)\n" -">>> setcontext(myothercontext)\n" -">>> Decimal(1) / Decimal(7)\n" -"Decimal('0.142857142857142857142857142857142857142857142857142857142857')\n" -"\n" -">>> ExtendedContext\n" -"Context(prec=9, rounding=ROUND_HALF_EVEN, Emin=-999999, Emax=999999,\n" -" capitals=1, clamp=0, flags=[], traps=[])\n" -">>> setcontext(ExtendedContext)\n" -">>> Decimal(1) / Decimal(7)\n" -"Decimal('0.142857143')\n" -">>> Decimal(42) / Decimal(0)\n" -"Decimal('Infinity')\n" -"\n" -">>> setcontext(BasicContext)\n" -">>> Decimal(42) / Decimal(0)\n" -"Traceback (most recent call last):\n" -" File \"\", line 1, in -toplevel-\n" -" Decimal(42) / Decimal(0)\n" -"DivisionByZero: x / 0" -msgstr "" - #: ../../library/decimal.rst:299 msgid "" "Contexts also have signal flags for monitoring exceptional conditions " "encountered during computations. The flags remain set until explicitly " "cleared, so it is best to clear the flags before each set of monitored " -"computations by using the :meth:`~Context.clear_flags` method. ::" +"computations by using the :meth:`clear_flags` method. ::" msgstr "" "演算コンテキストには、演算中に遭遇した例外的状況をモニタするためのシグナルフ" "ラグがあります。フラグが一度セットされると、明示的にクリアするまで残り続けま" -"す。そのため、フラグのモニタを行いたいような演算の前には :meth:`~Context." -"clear_flags` メソッドでフラグをクリアしておくのがベストです。 ::" - -#: ../../library/decimal.rst:304 -msgid "" -">>> setcontext(ExtendedContext)\n" -">>> getcontext().clear_flags()\n" -">>> Decimal(355) / Decimal(113)\n" -"Decimal('3.14159292')\n" -">>> getcontext()\n" -"Context(prec=9, rounding=ROUND_HALF_EVEN, Emin=-999999, Emax=999999,\n" -" capitals=1, clamp=0, flags=[Inexact, Rounded], traps=[])" -msgstr "" +"す。そのため、フラグのモニタを行いたいような演算の前には :meth:`clear_flags` " +"メソッドでフラグをクリアしておくのがベストです。 ::" #: ../../library/decimal.rst:312 msgid "" -"The *flags* entry shows that the rational approximation to pi was rounded " -"(digits beyond the context precision were thrown away) and that the result " -"is inexact (some of the discarded digits were non-zero)." +"The *flags* entry shows that the rational approximation to :const:`Pi` was " +"rounded (digits beyond the context precision were thrown away) and that the " +"result is inexact (some of the discarded digits were non-zero)." msgstr "" -"*flags* エントリから、pi の有理数による近似値が丸められた (コンテキスト内で決" -"められた精度を超えた桁数が捨てられた) ことと、計算結果が厳密でない (無視され" -"た桁の値に非ゼロのものがあった) ことがわかります。" +"*flags* エントリから、 :const:`Pi` の有理数による近似値が丸められた (コンテキ" +"スト内で決められた精度を超えた桁数が捨てられた) ことと、計算結果が厳密でない " +"(無視された桁の値に非ゼロのものがあった) ことがわかります。" #: ../../library/decimal.rst:316 msgid "" -"Individual traps are set using the dictionary in the :attr:`~Context.traps` " -"attribute of a context:" -msgstr "" -"コンテキストの :attr:`~Context.traps` 属性に入っている辞書を使うと、個々のト" -"ラップをセットできます:" - -#: ../../library/decimal.rst:319 -msgid "" -">>> setcontext(ExtendedContext)\n" -">>> Decimal(1) / Decimal(0)\n" -"Decimal('Infinity')\n" -">>> getcontext().traps[DivisionByZero] = 1\n" -">>> Decimal(1) / Decimal(0)\n" -"Traceback (most recent call last):\n" -" File \"\", line 1, in -toplevel-\n" -" Decimal(1) / Decimal(0)\n" -"DivisionByZero: x / 0" +"Individual traps are set using the dictionary in the :attr:`traps` field of " +"a context:" msgstr "" +"コンテキストの :attr:`traps` フィールドに入っている辞書を使うと、個々のトラッ" +"プをセットできます:" #: ../../library/decimal.rst:331 msgid "" @@ -528,53 +391,44 @@ msgstr "" "す。 *value* が文字列の場合、先頭と末尾の空白および全てのアンダースコアを取り" "除いた後には以下の 10進数文字列の文法に従わなければなりません::" -#: ../../library/decimal.rst:355 -msgid "" -"sign ::= '+' | '-'\n" -"digit ::= '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | " -"'9'\n" -"indicator ::= 'e' | 'E'\n" -"digits ::= digit [digit]...\n" -"decimal-part ::= digits '.' [digits] | ['.'] digits\n" -"exponent-part ::= indicator [sign] digits\n" -"infinity ::= 'Infinity' | 'Inf'\n" -"nan ::= 'NaN' [digits] | 'sNaN' [digits]\n" -"numeric-value ::= decimal-part [exponent-part] | infinity\n" -"numeric-string ::= [sign] numeric-value | [sign] nan" -msgstr "" - #: ../../library/decimal.rst:366 msgid "" "Other Unicode decimal digits are also permitted where ``digit`` appears " "above. These include decimal digits from various other alphabets (for " "example, Arabic-Indic and Devanāgarī digits) along with the fullwidth digits " -"``'\\uff10'`` through ``'\\uff19'``. Case is not significant, so, for " -"example, ``inf``, ``Inf``, ``INFINITY``, and ``iNfINity`` are all acceptable " -"spellings for positive infinity." +"``'\\uff10'`` through ``'\\uff19'``." msgstr "" +"他の Unicode 数字も上の ``digit`` の場所に使うことができます。つまり各書記体" +"系における(アラビア-インド系やデーヴァナーガリーなど)の数字や、全角数字0" +"(``'\\uff10'``)から9(``'\\uff19'``)までなどです。" -#: ../../library/decimal.rst:373 +#: ../../library/decimal.rst:371 msgid "" -"If *value* is a :class:`tuple`, it should have three components, a sign " -"(``0`` for positive or ``1`` for negative), a :class:`tuple` of digits, and " -"an integer exponent. For example, ``Decimal((0, (1, 4, 1, 4), -3))`` returns " -"``Decimal('1.414')``." +"If *value* is a :class:`tuple`, it should have three components, a sign (:" +"const:`0` for positive or :const:`1` for negative), a :class:`tuple` of " +"digits, and an integer exponent. For example, ``Decimal((0, (1, 4, 1, 4), " +"-3))`` returns ``Decimal('1.414')``." msgstr "" "*value* を :class:`tuple` にする場合、タプルは三つの要素を持ち、それぞれ符号 " -"(正なら ``0`` 、負なら ``1``)、仮数部を表す数字の :class:`tuple` 、そして指数" -"を表す整数でなければなりません。例えば、 ``Decimal((0, (1, 4, 1, 4), -3))`` " -"は ``Decimal('1.414')`` を返します。" +"(正なら :const:`0` 、負なら :const:`1`)、仮数部を表す数字の :class:`tuple` 、" +"そして指数を表す整数でなければなりません。例えば、 ``Decimal((0, (1, 4, 1, " +"4), -3))`` は ``Decimal('1.414')`` を返します。" -#: ../../library/decimal.rst:378 +#: ../../library/decimal.rst:376 msgid "" -"If *value* is a :class:`float`, the binary floating-point value is " +"If *value* is a :class:`float`, the binary floating point value is " "losslessly converted to its exact decimal equivalent. This conversion can " "often require 53 or more digits of precision. For example, " "``Decimal(float('1.1'))`` converts to " "``Decimal('1.100000000000000088817841970012523233890533447265625')``." msgstr "" +"*value* を :class:`float` にする場合、二進浮動小数点数値が損失なく正確に等価" +"な Decimal に変換されます。この変換はしばしば 53 桁以上の精度を要求します。例" +"えば、 ``Decimal(float('1.1'))`` は " +"``Decimal('1.100000000000000088817841970012523233890533447265625')`` に変換さ" +"れます。" -#: ../../library/decimal.rst:384 +#: ../../library/decimal.rst:382 msgid "" "The *context* precision does not affect how many digits are stored. That is " "determined exclusively by the number of digits in *value*. For example, " @@ -586,25 +440,25 @@ msgstr "" "れた精度が 3 桁しかなくても、``Decimal('3.00000')`` は 5 つのゼロを全て記憶し" "ます。" -#: ../../library/decimal.rst:389 +#: ../../library/decimal.rst:387 msgid "" "The purpose of the *context* argument is determining what to do if *value* " "is a malformed string. If the context traps :const:`InvalidOperation`, an " "exception is raised; otherwise, the constructor returns a new Decimal with " -"the value of ``NaN``." +"the value of :const:`NaN`." msgstr "" "*context* 引数の目的は、 *value* が正しくない形式の文字列であった場合に行う処" "理を決めることにあります; 演算コンテキストが :const:`InvalidOperation` をト" "ラップするようになっていれば、例外を送出します。それ以外の場合には、コンスト" -"ラクタは値が ``NaN`` の :class:`Decimal` を返します。" +"ラクタは値が :const:`NaN` の :class:`Decimal` を返します。" -#: ../../library/decimal.rst:394 +#: ../../library/decimal.rst:392 msgid "Once constructed, :class:`Decimal` objects are immutable." msgstr "" "一度生成すると、 :class:`Decimal` オブジェクトは変更不能 (immutable) になりま" "す。" -#: ../../library/decimal.rst:396 +#: ../../library/decimal.rst:394 msgid "" "The argument to the constructor is now permitted to be a :class:`float` " "instance." @@ -612,7 +466,7 @@ msgstr "" "コンストラクタに対する引数に :class:`float` インスタンスも許されるようになり" "ました。" -#: ../../library/decimal.rst:400 +#: ../../library/decimal.rst:398 msgid "" ":class:`float` arguments raise an exception if the :exc:`FloatOperation` " "trap is set. By default the trap is off." @@ -620,7 +474,7 @@ msgstr "" ":exc:`FloatOperation` トラップがセットされていた場合 :class:`float` 引数は例" "外を送出します。デフォルトでトラップはオフです。" -#: ../../library/decimal.rst:404 +#: ../../library/decimal.rst:402 msgid "" "Underscores are allowed for grouping, as with integral and floating-point " "literals in code." @@ -628,17 +482,22 @@ msgstr "" "コード中の整数リテラルや浮動小数点リテラルと同様に、アンダースコアを用いて桁" "をグルーピングできます。" -#: ../../library/decimal.rst:408 +#: ../../library/decimal.rst:406 msgid "" -"Decimal floating-point objects share many properties with the other built-in " +"Decimal floating point objects share many properties with the other built-in " "numeric types such as :class:`float` and :class:`int`. All of the usual " "math operations and special methods apply. Likewise, decimal objects can be " "copied, pickled, printed, used as dictionary keys, used as set elements, " "compared, sorted, and coerced to another type (such as :class:`float` or :" "class:`int`)." msgstr "" +"十進浮動小数点オブジェクトは、 :class:`float` や :class:`int` のような他の組" +"み込み型と多くの点で似ています。通常の数学演算や特殊メソッドを適用できます。" +"また、 :class:`Decimal` オブジェクトはコピーでき、pickle 化でき、print で出力" +"でき、辞書のキーにでき、集合の要素にでき、比較、保存、他の型 (:class:`float` " +"や :class:`int`) への型強制を行えます。" -#: ../../library/decimal.rst:415 +#: ../../library/decimal.rst:413 msgid "" "There are some small differences between arithmetic on Decimal objects and " "arithmetic on integers and floats. When the remainder operator ``%`` is " @@ -649,15 +508,7 @@ msgstr "" "す。十進オブジェクトに対して剰余演算を適用すると、計算結果の符号は除数の符号" "ではなく *被除数* の符号と一致します::" -#: ../../library/decimal.rst:420 -msgid "" -">>> (-7) % 4\n" -"1\n" -">>> Decimal(-7) % Decimal(4)\n" -"Decimal('-3')" -msgstr "" - -#: ../../library/decimal.rst:425 +#: ../../library/decimal.rst:423 msgid "" "The integer division operator ``//`` behaves analogously, returning the " "integer part of the true quotient (truncating towards zero) rather than its " @@ -667,15 +518,7 @@ msgstr "" "めた) 整数部分を返します。そのため通常の恒等式 ``x == (x // y) * y + x % y`` " "が維持されます::" -#: ../../library/decimal.rst:429 -msgid "" -">>> -7 // 4\n" -"-2\n" -">>> Decimal(-7) // Decimal(4)\n" -"Decimal('-1')" -msgstr "" - -#: ../../library/decimal.rst:434 +#: ../../library/decimal.rst:432 msgid "" "The ``%`` and ``//`` operators implement the ``remainder`` and ``divide-" "integer`` operations (respectively) as described in the specification." @@ -683,7 +526,7 @@ msgstr "" "演算子 ``%`` と演算子 ``//`` は (それぞれ) 仕様にあるような ``剰余`` 操作と " "``整数除算`` 操作を実装しています。" -#: ../../library/decimal.rst:438 +#: ../../library/decimal.rst:436 msgid "" "Decimal objects cannot generally be combined with floats or instances of :" "class:`fractions.Fraction` in arithmetic operations: an attempt to add a :" @@ -700,7 +543,7 @@ msgstr "" "と別の数 ``y`` を比較することができます。これにより、異なる型の数間の等価比較" "の際に、紛らわしい結果を避けます。" -#: ../../library/decimal.rst:446 +#: ../../library/decimal.rst:444 msgid "" "Mixed-type comparisons between :class:`Decimal` instances and other numeric " "types are now fully supported." @@ -708,13 +551,15 @@ msgstr "" ":class:`Decimal` インスタンスと他の数値型が混在する比較が完全にサポートされる" "ようになりました。" -#: ../../library/decimal.rst:450 +#: ../../library/decimal.rst:448 msgid "" -"In addition to the standard numeric properties, decimal floating-point " +"In addition to the standard numeric properties, decimal floating point " "objects also have a number of specialized methods:" msgstr "" +"こうした標準的な数値型の特性の他に、十進浮動小数点オブジェクトには様々な特殊" +"メソッドがあります:" -#: ../../library/decimal.rst:456 +#: ../../library/decimal.rst:454 msgid "" "Return the adjusted exponent after shifting out the coefficient's rightmost " "digits until only the lead digit remains: ``Decimal('321e+5').adjusted()`` " @@ -725,7 +570,7 @@ msgstr "" "の指数部を返します: ``Decimal('321e+5').adjusted()`` は 7 を返します。最上桁" "の小数点からの相対位置を調べる際に使います。" -#: ../../library/decimal.rst:463 +#: ../../library/decimal.rst:461 msgid "" "Return a pair ``(n, d)`` of integers that represent the given :class:" "`Decimal` instance as a fraction, in lowest terms and with a positive " @@ -734,13 +579,7 @@ msgstr "" "与えられた :class:`Decimal` インスタンスを、既約分数で分母が正数の分数として" "表現した整数のペア ``(n, d)`` を返します。" -#: ../../library/decimal.rst:467 -msgid "" -">>> Decimal('-3.14').as_integer_ratio()\n" -"(-157, 50)" -msgstr "" - -#: ../../library/decimal.rst:470 +#: ../../library/decimal.rst:468 msgid "" "The conversion is exact. Raise OverflowError on infinities and ValueError " "on NaNs." @@ -748,7 +587,7 @@ msgstr "" "変換は正確に行われます。無限大に対してはOverflowErrorを、NaNに対しては" "ValueError を送出します。" -#: ../../library/decimal.rst:477 +#: ../../library/decimal.rst:475 msgid "" "Return a :term:`named tuple` representation of the number: " "``DecimalTuple(sign, digits, exponent)``." @@ -756,7 +595,7 @@ msgstr "" "数値を表現するための :term:`名前付きタプル `: " "``DecimalTuple(sign, digittuple, exponent)`` を返します。" -#: ../../library/decimal.rst:483 +#: ../../library/decimal.rst:481 msgid "" "Return the canonical encoding of the argument. Currently, the encoding of " "a :class:`Decimal` instance is always canonical, so this operation returns " @@ -766,7 +605,7 @@ msgstr "" "`Decimal` インスタンスのエンコーディングは常に標準的なので、この操作は引数に" "手を加えずに返します。" -#: ../../library/decimal.rst:489 +#: ../../library/decimal.rst:487 msgid "" "Compare the values of two Decimal instances. :meth:`compare` returns a " "Decimal instance, and if either operand is a NaN then the result is a NaN::" @@ -774,15 +613,7 @@ msgstr "" "二つの Decimal インスタンスの値を比較します。 :meth:`compare` は Decimal イン" "スタンスを返し、被演算子のどちらかが NaN ならば結果は NaN です::" -#: ../../library/decimal.rst:493 -msgid "" -"a or b is a NaN ==> Decimal('NaN')\n" -"a < b ==> Decimal('-1')\n" -"a == b ==> Decimal('0')\n" -"a > b ==> Decimal('1')" -msgstr "" - -#: ../../library/decimal.rst:500 +#: ../../library/decimal.rst:498 msgid "" "This operation is identical to the :meth:`compare` method, except that all " "NaNs signal. That is, if neither operand is a signaling NaN then any quiet " @@ -793,7 +624,7 @@ msgstr "" "らば無言 (quiet) NaN である比較対象があたかも発信 NaN であるかのように扱われ" "ます。" -#: ../../library/decimal.rst:506 +#: ../../library/decimal.rst:504 msgid "" "Compare two operands using their abstract representation rather than their " "numerical value. Similar to the :meth:`compare` method, but the result " @@ -806,7 +637,7 @@ msgstr "" "値的に等しくても異なった表現を持つ二つの :class:`Decimal` インスタンスの比較" "は等しくなりません:" -#: ../../library/decimal.rst:515 +#: ../../library/decimal.rst:513 msgid "" "Quiet and signaling NaNs are also included in the total ordering. The " "result of this function is ``Decimal('0')`` if both operands have the same " @@ -820,8 +651,8 @@ msgstr "" "めより下位にあれば ``Decimal('-1')``、上位にあれば ``Decimal('1')`` です。全" "順序の詳細については仕様を参照してください。" -#: ../../library/decimal.rst:522 ../../library/decimal.rst:533 -#: ../../library/decimal.rst:561 ../../library/decimal.rst:865 +#: ../../library/decimal.rst:520 ../../library/decimal.rst:531 +#: ../../library/decimal.rst:559 ../../library/decimal.rst:834 msgid "" "This operation is unaffected by context and is quiet: no flags are changed " "and no rounding is performed. As an exception, the C version may raise " @@ -831,7 +662,7 @@ msgstr "" "丸めは行われません。例外として、2番目の比較対象の厳密な変換ができない場合、C " "バージョンのライブラリでは InvalidOperation 例外を送出するかもしれません。" -#: ../../library/decimal.rst:528 +#: ../../library/decimal.rst:526 msgid "" "Compare two operands using their abstract representation rather than their " "value as in :meth:`compare_total`, but ignoring the sign of each operand. " @@ -842,14 +673,14 @@ msgstr "" "ますが、両者の符号を無視します。 ``x.compare_total_mag(y)`` は ``x." "copy_abs().compare_total(y.copy_abs())`` と等価です。" -#: ../../library/decimal.rst:539 +#: ../../library/decimal.rst:537 msgid "" "Just returns self, this method is only to comply with the Decimal " "Specification." msgstr "" "self を返すだけです。このメソッドは十進演算仕様に適合するためだけのものです。" -#: ../../library/decimal.rst:544 +#: ../../library/decimal.rst:542 msgid "" "Return the absolute value of the argument. This operation is unaffected by " "the context and is quiet: no flags are changed and no rounding is performed." @@ -857,7 +688,7 @@ msgstr "" "引数の絶対値を返します。この演算はコンテキストに影響されず、静かです。すなわ" "ち、フラグは変更されず、丸めは行われません。" -#: ../../library/decimal.rst:550 +#: ../../library/decimal.rst:548 msgid "" "Return the negation of the argument. This operation is unaffected by the " "context and is quiet: no flags are changed and no rounding is performed." @@ -865,13 +696,13 @@ msgstr "" "引数の符号を変えて返します。この演算はコンテキストに影響されず、静かです。す" "なわち、フラグは変更されず、丸めは行われません。" -#: ../../library/decimal.rst:555 +#: ../../library/decimal.rst:553 msgid "" "Return a copy of the first operand with the sign set to be the same as the " "sign of the second operand. For example:" msgstr "最初の演算対象のコピーに二つめと同じ符号を付けて返します。たとえば:" -#: ../../library/decimal.rst:567 +#: ../../library/decimal.rst:565 msgid "" "Return the value of the (natural) exponential function ``e**x`` at the given " "number. The result is correctly rounded using the :const:`ROUND_HALF_EVEN` " @@ -880,26 +711,24 @@ msgstr "" "与えられた数での(自然)指数関数 ``e**x`` の値を返します。結果は :const:" "`ROUND_HALF_EVEN` 丸めモードで正しく丸められます。" -#: ../../library/decimal.rst:578 -msgid "" -"Alternative constructor that only accepts instances of :class:`float` or :" -"class:`int`." -msgstr "" +#: ../../library/decimal.rst:576 +msgid "Classmethod that converts a float to a decimal number, exactly." +msgstr "浮動小数点数を正確に小数に変換するクラスメソッドです。" -#: ../../library/decimal.rst:581 +#: ../../library/decimal.rst:578 msgid "" -"Note ``Decimal.from_float(0.1)`` is not the same as ``Decimal('0.1')``. " -"Since 0.1 is not exactly representable in binary floating point, the value " -"is stored as the nearest representable value which is " -"``0x1.999999999999ap-4``. That equivalent value in decimal is " -"``0.1000000000000000055511151231257827021181583404541015625``." +"Note `Decimal.from_float(0.1)` is not the same as `Decimal('0.1')`. Since " +"0.1 is not exactly representable in binary floating point, the value is " +"stored as the nearest representable value which is `0x1.999999999999ap-4`. " +"That equivalent value in decimal is " +"`0.1000000000000000055511151231257827021181583404541015625`." msgstr "" -"なお、``Decimal.from_float(0.1)`` は ``Decimal('0.1')`` と同じではありませ" -"ん。0.1 は二進浮動小数点数で正確に表せないので、その値は表現できる最も近い" -"値、``0x1.999999999999ap-4`` として記憶されます。浮動小数点数での等価な値は " -"``0.1000000000000000055511151231257827021181583404541015625`` です。" +"なお、`Decimal.from_float(0.1)` は `Decimal('0.1')` と同じではありません。" +"0.1 は二進浮動小数点数で正確に表せないので、その値は表現できる最も近い値、" +"`0x1.999999999999ap-4` として記憶されます。浮動小数点数での等価な値は " +"`0.1000000000000000055511151231257827021181583404541015625` です。" -#: ../../library/decimal.rst:587 +#: ../../library/decimal.rst:584 msgid "" "From Python 3.2 onwards, a :class:`Decimal` instance can also be constructed " "directly from a :class:`float`." @@ -907,35 +736,7 @@ msgstr "" "Python 3.2 以降では、 :class:`Decimal` インスタンスは :class:`float` から直接" "構成できるようになりました。" -#: ../../library/decimal.rst:590 -msgid "" -">>> Decimal.from_float(0.1)\n" -"Decimal('0.1000000000000000055511151231257827021181583404541015625')\n" -">>> Decimal.from_float(float('nan'))\n" -"Decimal('NaN')\n" -">>> Decimal.from_float(float('inf'))\n" -"Decimal('Infinity')\n" -">>> Decimal.from_float(float('-inf'))\n" -"Decimal('-Infinity')" -msgstr "" - -#: ../../library/decimal.rst:605 -msgid "" -"Alternative constructor that only accepts instances of :class:`float`, :" -"class:`int` or :class:`Decimal`, but not strings or tuples." -msgstr "" - -#: ../../library/decimal.rst:609 -msgid "" -">>> Decimal.from_number(314)\n" -"Decimal('314')\n" -">>> Decimal.from_number(0.1)\n" -"Decimal('0.1000000000000000055511151231257827021181583404541015625')\n" -">>> Decimal.from_number(Decimal('3.14'))\n" -"Decimal('3.14')" -msgstr "" - -#: ../../library/decimal.rst:622 +#: ../../library/decimal.rst:602 msgid "" "Fused multiply-add. Return self*other+third with no rounding of the " "intermediate product self*other." @@ -943,7 +744,7 @@ msgstr "" "融合積和(fused multiply-add)です。self*other+third を途中結果の積 self*other " "で丸めを行わずに計算して返します。" -#: ../../library/decimal.rst:630 +#: ../../library/decimal.rst:610 msgid "" "Return :const:`True` if the argument is canonical and :const:`False` " "otherwise. Currently, a :class:`Decimal` instance is always canonical, so " @@ -953,7 +754,7 @@ msgstr "" "`False` を返します。現在のところ、 :class:`Decimal` のインスタンスは常に標準" "的なのでこのメソッドの結果はいつでも :const:`True` です。" -#: ../../library/decimal.rst:636 +#: ../../library/decimal.rst:616 msgid "" "Return :const:`True` if the argument is a finite number, and :const:`False` " "if the argument is an infinity or a NaN." @@ -961,7 +762,7 @@ msgstr "" "引数が有限の数値ならば :const:`True` を、無限大か NaN ならば :const:`False` " "を返します。" -#: ../../library/decimal.rst:641 +#: ../../library/decimal.rst:621 msgid "" "Return :const:`True` if the argument is either positive or negative infinity " "and :const:`False` otherwise." @@ -969,7 +770,7 @@ msgstr "" "引数が正または負の無限大ならば :const:`True` を、そうでなければ :const:" "`False` を返します。" -#: ../../library/decimal.rst:646 +#: ../../library/decimal.rst:626 msgid "" "Return :const:`True` if the argument is a (quiet or signaling) NaN and :" "const:`False` otherwise." @@ -977,7 +778,7 @@ msgstr "" "引数が (無言か発信かは問わず) NaN であれば :const:`True` を、そうでなければ :" "const:`False` を返します。" -#: ../../library/decimal.rst:651 +#: ../../library/decimal.rst:631 msgid "" "Return :const:`True` if the argument is a *normal* finite number. Return :" "const:`False` if the argument is zero, subnormal, infinite or a NaN." @@ -985,7 +786,7 @@ msgstr "" "引数が *正規(normal)* の有限数値ならば :const:`True` を返します。引数がゼロ、" "非正規(subnormal)、無限大または NaN であれば :const:`False` を返します。" -#: ../../library/decimal.rst:656 +#: ../../library/decimal.rst:636 msgid "" "Return :const:`True` if the argument is a quiet NaN, and :const:`False` " "otherwise." @@ -993,7 +794,7 @@ msgstr "" "引数が無言 NaN であれば :const:`True` を、そうでなければ :const:`False` を返" "します。" -#: ../../library/decimal.rst:661 +#: ../../library/decimal.rst:641 msgid "" "Return :const:`True` if the argument has a negative sign and :const:`False` " "otherwise. Note that zeros and NaNs can both carry signs." @@ -1001,7 +802,7 @@ msgstr "" "引数に負の符号がついていれば :const:`True` を、そうでなければ :const:`False` " "を返します。注意すべきはゼロや NaN なども符号を持ち得ることです。" -#: ../../library/decimal.rst:666 +#: ../../library/decimal.rst:646 msgid "" "Return :const:`True` if the argument is a signaling NaN and :const:`False` " "otherwise." @@ -1009,7 +810,7 @@ msgstr "" "引数が発信 NaN であれば :const:`True` を、そうでなければ :const:`False` を返" "します。" -#: ../../library/decimal.rst:671 +#: ../../library/decimal.rst:651 msgid "" "Return :const:`True` if the argument is subnormal, and :const:`False` " "otherwise." @@ -1017,7 +818,7 @@ msgstr "" "引数が非正規数(subnormal)であれば :const:`True` を、そうでなければ :const:" "`False` を返します。" -#: ../../library/decimal.rst:676 +#: ../../library/decimal.rst:656 msgid "" "Return :const:`True` if the argument is a (positive or negative) zero and :" "const:`False` otherwise." @@ -1025,7 +826,7 @@ msgstr "" "引数が(正または負の)ゼロであれば :const:`True` を、そうでなければ :const:" "`False` を返します。" -#: ../../library/decimal.rst:681 +#: ../../library/decimal.rst:661 msgid "" "Return the natural (base e) logarithm of the operand. The result is " "correctly rounded using the :const:`ROUND_HALF_EVEN` rounding mode." @@ -1033,7 +834,7 @@ msgstr "" "演算対象の自然対数(底 e の対数)を返します。結果は :const:`ROUND_HALF_EVEN` 丸" "めモードで正しく丸められます。" -#: ../../library/decimal.rst:686 +#: ../../library/decimal.rst:666 msgid "" "Return the base ten logarithm of the operand. The result is correctly " "rounded using the :const:`ROUND_HALF_EVEN` rounding mode." @@ -1041,7 +842,7 @@ msgstr "" "演算対象の底 10 の対数を返します。結果は :const:`ROUND_HALF_EVEN` 丸めモード" "で正しく丸められます。" -#: ../../library/decimal.rst:691 +#: ../../library/decimal.rst:671 msgid "" "For a nonzero number, return the adjusted exponent of its operand as a :" "class:`Decimal` instance. If the operand is a zero then ``Decimal('-" @@ -1053,7 +854,7 @@ msgstr "" "`DivisionByZero` フラグが送出されます。演算対象が無限大だった場合、 " "``Decimal('Infinity')`` が返されます。" -#: ../../library/decimal.rst:699 +#: ../../library/decimal.rst:679 msgid "" ":meth:`logical_and` is a logical operation which takes two *logical " "operands* (see :ref:`logical_operands_label`). The result is the digit-wise " @@ -1062,14 +863,14 @@ msgstr "" ":meth:`logical_and` は二つの *論理引数* (:ref:`logical_operands_label` 参照)" "を取る論理演算です。結果は二つの引数の数字ごとの ``and`` です。" -#: ../../library/decimal.rst:705 +#: ../../library/decimal.rst:685 msgid "" ":meth:`logical_invert` is a logical operation. The result is the digit-wise " "inversion of the operand." msgstr "" ":meth:`logical_invert` は論理演算です。結果は引数の数字ごとの反転です。" -#: ../../library/decimal.rst:710 +#: ../../library/decimal.rst:690 msgid "" ":meth:`logical_or` is a logical operation which takes two *logical operands* " "(see :ref:`logical_operands_label`). The result is the digit-wise ``or`` of " @@ -1078,7 +879,7 @@ msgstr "" ":meth:`logical_or` は二つの *論理引数* (:ref:`logical_operands_label` 参照)を" "取る論理演算です。結果は二つの引数の数字ごとの ``or`` です。" -#: ../../library/decimal.rst:716 +#: ../../library/decimal.rst:696 msgid "" ":meth:`logical_xor` is a logical operation which takes two *logical " "operands* (see :ref:`logical_operands_label`). The result is the digit-wise " @@ -1087,39 +888,39 @@ msgstr "" ":meth:`logical_xor` は二つの *論理引数* (:ref:`logical_operands_label` 参照)" "を取る論理演算です。結果は二つの引数の数字ごとの排他的論理和です。" -#: ../../library/decimal.rst:722 +#: ../../library/decimal.rst:702 msgid "" "Like ``max(self, other)`` except that the context rounding rule is applied " -"before returning and that ``NaN`` values are either signaled or ignored " +"before returning and that :const:`NaN` values are either signaled or ignored " "(depending on the context and whether they are signaling or quiet)." msgstr "" "``max(self, other)`` と同じですが、値を返す前に現在のコンテキストに即した丸め" -"規則を適用します。また、 ``NaN`` に対して、(コンテキストの設定と、発信か無言" -"どちらのタイプであるかに応じて) シグナルを発行するか無視します。" +"規則を適用します。また、 :const:`NaN` に対して、(コンテキストの設定と、発信か" +"無言どちらのタイプであるかに応じて) シグナルを発行するか無視します。" -#: ../../library/decimal.rst:729 +#: ../../library/decimal.rst:709 msgid "" "Similar to the :meth:`.max` method, but the comparison is done using the " "absolute values of the operands." msgstr ":meth:`.max` メソッドに似ていますが、比較は絶対値で行われます。" -#: ../../library/decimal.rst:734 +#: ../../library/decimal.rst:714 msgid "" "Like ``min(self, other)`` except that the context rounding rule is applied " -"before returning and that ``NaN`` values are either signaled or ignored " +"before returning and that :const:`NaN` values are either signaled or ignored " "(depending on the context and whether they are signaling or quiet)." msgstr "" "``min(self, other)`` と同じですが、値を返す前に現在のコンテキストに即した丸め" -"規則を適用します。また、 ``NaN`` に対して、(コンテキストの設定と、発信か無言" -"どちらのタイプであるかに応じて) シグナルを発行するか無視します。" +"規則を適用します。また、 :const:`NaN` に対して、(コンテキストの設定と、発信か" +"無言どちらのタイプであるかに応じて) シグナルを発行するか無視します。" -#: ../../library/decimal.rst:741 +#: ../../library/decimal.rst:721 msgid "" "Similar to the :meth:`.min` method, but the comparison is done using the " "absolute values of the operands." msgstr ":meth:`.min` メソッドに似ていますが、比較は絶対値で行われます。" -#: ../../library/decimal.rst:746 +#: ../../library/decimal.rst:726 msgid "" "Return the largest number representable in the given context (or in the " "current thread's context if no context is given) that is smaller than the " @@ -1128,7 +929,7 @@ msgstr "" "与えられたコンテキスト(またはコンテキストが渡されなければ現スレッドのコンテキ" "スト)において表現可能な、操作対象より小さい最大の数を返します。" -#: ../../library/decimal.rst:752 +#: ../../library/decimal.rst:732 msgid "" "Return the smallest number representable in the given context (or in the " "current thread's context if no context is given) that is larger than the " @@ -1137,7 +938,7 @@ msgstr "" "与えられたコンテキスト(またはコンテキストが渡されなければ現スレッドのコンテキ" "スト)において表現可能な、操作対象より大きい最小の数を返します。" -#: ../../library/decimal.rst:758 +#: ../../library/decimal.rst:738 msgid "" "If the two operands are unequal, return the number closest to the first " "operand in the direction of the second operand. If both operands are " @@ -1148,39 +949,22 @@ msgstr "" "向の数を返します。もし両者が数値的に等しければ、二つめの対象の符号を採った一" "つめの対象のコピーを返します。" -#: ../../library/decimal.rst:765 -msgid "" -"Used for producing canonical values of an equivalence class within either " -"the current context or the specified context." -msgstr "" - -#: ../../library/decimal.rst:768 -msgid "" -"This has the same semantics as the unary plus operation, except that if the " -"final result is finite it is reduced to its simplest form, with all trailing " -"zeros removed and its sign preserved. That is, while the coefficient is non-" -"zero and a multiple of ten the coefficient is divided by ten and the " -"exponent is incremented by 1. Otherwise (the coefficient is zero) the " -"exponent is set to 0. In all cases the sign is unchanged." -msgstr "" - -#: ../../library/decimal.rst:775 -msgid "" -"For example, ``Decimal('32.100')`` and ``Decimal('0.321000e+2')`` both " -"normalize to the equivalent value ``Decimal('32.1')``." -msgstr "" - -#: ../../library/decimal.rst:778 -msgid "Note that rounding is applied *before* reducing to simplest form." -msgstr "" - -#: ../../library/decimal.rst:780 +#: ../../library/decimal.rst:745 msgid "" -"In the latest versions of the specification, this operation is also known as " -"``reduce``." +"Normalize the number by stripping the rightmost trailing zeros and " +"converting any result equal to :const:`Decimal('0')` to :const:" +"`Decimal('0e0')`. Used for producing canonical values for attributes of an " +"equivalence class. For example, ``Decimal('32.100')`` and " +"``Decimal('0.321000e+2')`` both normalize to the equivalent value " +"``Decimal('32.1')``." msgstr "" +"数値を正規化 (normalize) して、右端に連続しているゼロを除去し、 :const:" +"`Decimal('0')` と同じ結果はすべて :const:`Decimal('0e0')` に変換します。等価" +"クラスの属性から基準表現を生成する際に用います。たとえば、 " +"``Decimal('32.100')`` と ``Decimal('0.321000e+2')`` の正規化は、いずれも同じ" +"値 ``Decimal('32.1')`` になります。" -#: ../../library/decimal.rst:785 +#: ../../library/decimal.rst:754 msgid "" "Return a string describing the *class* of the operand. The returned value " "is one of the following ten strings." @@ -1188,51 +972,51 @@ msgstr "" "操作対象の *クラス* を表す文字列を返します。返されるのは以下の10種類のいずれ" "かです。" -#: ../../library/decimal.rst:788 +#: ../../library/decimal.rst:757 msgid "``\"-Infinity\"``, indicating that the operand is negative infinity." msgstr "``\"-Infinity\"``, 負の無限大であることを示します。" -#: ../../library/decimal.rst:789 +#: ../../library/decimal.rst:758 msgid "" "``\"-Normal\"``, indicating that the operand is a negative normal number." msgstr "``\"-Normal\"``, 負の通常数であることを示します。" -#: ../../library/decimal.rst:790 +#: ../../library/decimal.rst:759 msgid "" "``\"-Subnormal\"``, indicating that the operand is negative and subnormal." msgstr "``\"-Subnormal\"``, 負の非正規数であることを示します。" -#: ../../library/decimal.rst:791 +#: ../../library/decimal.rst:760 msgid "``\"-Zero\"``, indicating that the operand is a negative zero." msgstr "``\"-Zero\"``, 負のゼロであることを示します。" -#: ../../library/decimal.rst:792 +#: ../../library/decimal.rst:761 msgid "``\"+Zero\"``, indicating that the operand is a positive zero." msgstr "``\"+Zero\"``, 正のゼロであることを示します。" -#: ../../library/decimal.rst:793 +#: ../../library/decimal.rst:762 msgid "" "``\"+Subnormal\"``, indicating that the operand is positive and subnormal." msgstr "``\"+Subnormal\"``, 正の非正規数であることを示します。" -#: ../../library/decimal.rst:794 +#: ../../library/decimal.rst:763 msgid "" "``\"+Normal\"``, indicating that the operand is a positive normal number." msgstr "``\"+Normal\"``, 正の通常数であることを示します。" -#: ../../library/decimal.rst:795 +#: ../../library/decimal.rst:764 msgid "``\"+Infinity\"``, indicating that the operand is positive infinity." msgstr "``\"+Infinity\"``, 正の無限大であることを示します。" -#: ../../library/decimal.rst:796 +#: ../../library/decimal.rst:765 msgid "``\"NaN\"``, indicating that the operand is a quiet NaN (Not a Number)." msgstr "``\"NaN\"``, 無言 (quiet) NaN (Not a Number) であることを示します。" -#: ../../library/decimal.rst:797 +#: ../../library/decimal.rst:766 msgid "``\"sNaN\"``, indicating that the operand is a signaling NaN." msgstr "``\"sNaN\"``, 発信(signaling) NaN であることを示します。" -#: ../../library/decimal.rst:801 +#: ../../library/decimal.rst:770 msgid "" "Return a value equal to the first operand after rounding and having the " "exponent of the second operand." @@ -1240,7 +1024,7 @@ msgstr "" "二つ目の操作対象と同じ指数を持つように丸めを行った、一つめの操作対象と等しい" "値を返します。" -#: ../../library/decimal.rst:807 +#: ../../library/decimal.rst:776 msgid "" "Unlike other operations, if the length of the coefficient after the quantize " "operation would be greater than precision, then an :const:`InvalidOperation` " @@ -1251,7 +1035,7 @@ msgstr "" "は、 :const:`InvalidOperation` がシグナルされます。これによりエラー条件がない" "限り打ち切られた指数が常に右側の引数と同じになることが保証されます。" -#: ../../library/decimal.rst:813 +#: ../../library/decimal.rst:782 msgid "" "Also unlike other operations, quantize never signals Underflow, even if the " "result is subnormal and inexact." @@ -1259,7 +1043,7 @@ msgstr "" "同様に、他の操作と違い、quantize は Underflow を、たとえ結果が非正規になった" "り不正確になったとしても、シグナルしません。" -#: ../../library/decimal.rst:816 +#: ../../library/decimal.rst:785 msgid "" "If the exponent of the second operand is larger than that of the first then " "rounding may be necessary. In this case, the rounding mode is determined by " @@ -1273,15 +1057,15 @@ msgstr "" "らの引数も渡されなければ現在のスレッドのコンテキストの丸めモードが使われま" "す。" -#: ../../library/decimal.rst:822 +#: ../../library/decimal.rst:791 msgid "" "An error is returned whenever the resulting exponent is greater than :attr:" -"`~Context.Emax` or less than :meth:`~Context.Etiny`." +"`Emax` or less than :attr:`Etiny`." msgstr "" -"処理結果の指数が :attr:`~Context.Emax` よりも大きい場合や :meth:`~Context." -"Etiny` よりも小さい場合にエラーが返されます。" +"処理結果の指数が :attr:`Emax` よりも大きい場合や :attr:`Etiny` よりも小さい場" +"合にエラーが返されます。" -#: ../../library/decimal.rst:827 +#: ../../library/decimal.rst:796 msgid "" "Return ``Decimal(10)``, the radix (base) in which the :class:`Decimal` class " "does all its arithmetic. Included for compatibility with the specification." @@ -1289,7 +1073,7 @@ msgstr "" "``Decimal(10)`` つまり :class:`Decimal` クラスがその全ての算術を実行する基数" "を返します。仕様との互換性のために取り入れられています。" -#: ../../library/decimal.rst:833 +#: ../../library/decimal.rst:802 msgid "" "Return the remainder from dividing *self* by *other*. This differs from " "``self % other`` in that the sign of the remainder is chosen so as to " @@ -1303,11 +1087,11 @@ msgstr "" "other`` が返り値になります。最も近い整数が2つある場合には偶数のものが選ばれま" "す。" -#: ../../library/decimal.rst:840 +#: ../../library/decimal.rst:809 msgid "If the result is zero then its sign will be the sign of *self*." msgstr "結果が0になる場合の符号は *self* の符号と同じになります。" -#: ../../library/decimal.rst:851 +#: ../../library/decimal.rst:820 msgid "" "Return the result of rotating the digits of the first operand by an amount " "specified by the second operand. The second operand must be an integer in " @@ -1325,15 +1109,15 @@ msgstr "" "数部は必要ならば精度いっぱいまでゼロで埋められます。符号と指数は変えられませ" "ん。" -#: ../../library/decimal.rst:862 +#: ../../library/decimal.rst:831 msgid "" -"Test whether self and other have the same exponent or whether both are " -"``NaN``." +"Test whether self and other have the same exponent or whether both are :" +"const:`NaN`." msgstr "" -"*self* と *other* が同じ指数を持っているか、あるいは双方とも ``NaN`` である場" -"合に真を返します。" +"*self* と *other* が同じ指数を持っているか、あるいは双方とも :const:`NaN` で" +"ある場合に真を返します。" -#: ../../library/decimal.rst:871 +#: ../../library/decimal.rst:840 msgid "" "Return the first operand with exponent adjusted by the second. Equivalently, " "return the first operand multiplied by ``10**other``. The second operand " @@ -1343,7 +1127,7 @@ msgstr "" "が、一つめの演算対象を ``10**other`` 倍したものを返します。二つ目の演算対象は" "整数でなければなりません。" -#: ../../library/decimal.rst:877 +#: ../../library/decimal.rst:846 msgid "" "Return the result of shifting the digits of the first operand by an amount " "specified by the second operand. The second operand must be an integer in " @@ -1359,16 +1143,16 @@ msgstr "" "らばシフトの方向は左に、そうでなければ右になります。一つ目の演算対象の係数は" "必要ならば精度いっぱいまでゼロで埋められます。符号と指数は変えられません。" -#: ../../library/decimal.rst:887 +#: ../../library/decimal.rst:856 msgid "Return the square root of the argument to full precision." msgstr "引数の平方根を最大精度で求めます。" -#: ../../library/decimal.rst:892 ../../library/decimal.rst:1549 +#: ../../library/decimal.rst:861 ../../library/decimal.rst:1440 msgid "" "Convert to a string, using engineering notation if an exponent is needed." msgstr "文字列に変換します。指数が必要なら工学表記が使われます。" -#: ../../library/decimal.rst:894 ../../library/decimal.rst:1551 +#: ../../library/decimal.rst:863 ../../library/decimal.rst:1442 msgid "" "Engineering notation has an exponent which is a multiple of 3. This can " "leave up to 3 digits to the left of the decimal place and may require the " @@ -1378,13 +1162,13 @@ msgstr "" "3 桁までの数字が残されるとともに、末尾に 1 つまたは 2 つの 0 の付加が必要とさ" "れるかもしれません。" -#: ../../library/decimal.rst:898 +#: ../../library/decimal.rst:867 msgid "" "For example, this converts ``Decimal('123E+1')`` to ``Decimal('1.23E+3')``." msgstr "" "たとえば、``Decimal('123E+1')`` は ``Decimal('1.23E+3')`` に変換されます。" -#: ../../library/decimal.rst:902 +#: ../../library/decimal.rst:871 msgid "" "Identical to the :meth:`to_integral_value` method. The ``to_integral`` name " "has been kept for compatibility with older versions." @@ -1392,7 +1176,7 @@ msgstr "" ":meth:`to_integral_value` メソッドと同じです。``to_integral`` の名前は古い" "バージョンとの互換性のために残されています。" -#: ../../library/decimal.rst:907 +#: ../../library/decimal.rst:876 msgid "" "Round to the nearest integer, signaling :const:`Inexact` or :const:`Rounded` " "as appropriate if rounding occurs. The rounding mode is determined by the " @@ -1405,7 +1189,7 @@ msgstr "" "``context`` 引数で決まります。どちらの引数も渡されなければ現在のスレッドのコ" "ンテキストの丸めモードが使われます。" -#: ../../library/decimal.rst:915 +#: ../../library/decimal.rst:884 msgid "" "Round to the nearest integer without signaling :const:`Inexact` or :const:" "`Rounded`. If given, applies *rounding*; otherwise, uses the rounding " @@ -1415,89 +1199,27 @@ msgstr "" "値を丸めます。 *rounding* が指定されていれば適用されます; それ以外の場合、値" "丸めの方法は *context* の設定か現在のコンテキストの設定になります。" -#: ../../library/decimal.rst:919 -msgid "Decimal numbers can be rounded using the :func:`.round` function:" -msgstr "" - -#: ../../library/decimal.rst:924 -msgid "" -"If *ndigits* is not given or ``None``, returns the nearest :class:`int` to " -"*number*, rounding ties to even, and ignoring the rounding mode of the :" -"class:`Decimal` context. Raises :exc:`OverflowError` if *number* is an " -"infinity or :exc:`ValueError` if it is a (quiet or signaling) NaN." -msgstr "" - -#: ../../library/decimal.rst:930 -msgid "" -"If *ndigits* is an :class:`int`, the context's rounding mode is respected " -"and a :class:`Decimal` representing *number* rounded to the nearest multiple " -"of ``Decimal('1E-ndigits')`` is returned; in this case, ``round(number, " -"ndigits)`` is equivalent to ``self.quantize(Decimal('1E-ndigits'))``. " -"Returns ``Decimal('NaN')`` if *number* is a quiet NaN. Raises :class:" -"`InvalidOperation` if *number* is an infinity, a signaling NaN, or if the " -"length of the coefficient after the quantize operation would be greater than " -"the current context's precision. In other words, for the non-corner cases:" -msgstr "" - -#: ../../library/decimal.rst:940 -msgid "" -"if *ndigits* is positive, return *number* rounded to *ndigits* decimal " -"places;" -msgstr "" - -#: ../../library/decimal.rst:942 -msgid "if *ndigits* is zero, return *number* rounded to the nearest integer;" -msgstr "" - -#: ../../library/decimal.rst:943 -msgid "" -"if *ndigits* is negative, return *number* rounded to the nearest multiple of " -"``10**abs(ndigits)``." -msgstr "" - -#: ../../library/decimal.rst:946 -msgid "For example::" -msgstr "例えば::" - -#: ../../library/decimal.rst:948 -msgid "" -">>> from decimal import Decimal, getcontext, ROUND_DOWN\n" -">>> getcontext().rounding = ROUND_DOWN\n" -">>> round(Decimal('3.75')) # context rounding ignored\n" -"4\n" -">>> round(Decimal('3.5')) # round-ties-to-even\n" -"4\n" -">>> round(Decimal('3.75'), 0) # uses the context rounding\n" -"Decimal('3')\n" -">>> round(Decimal('3.75'), 1)\n" -"Decimal('3.7')\n" -">>> round(Decimal('3.75'), -1)\n" -"Decimal('0E+1')" -msgstr "" - -#: ../../library/decimal.rst:965 +#: ../../library/decimal.rst:892 msgid "Logical operands" msgstr "論理引数" -#: ../../library/decimal.rst:967 +#: ../../library/decimal.rst:894 msgid "" -"The :meth:`~Decimal.logical_and`, :meth:`~Decimal.logical_invert`, :meth:" -"`~Decimal.logical_or`, and :meth:`~Decimal.logical_xor` methods expect their " -"arguments to be *logical operands*. A *logical operand* is a :class:" -"`Decimal` instance whose exponent and sign are both zero, and whose digits " -"are all either ``0`` or ``1``." +"The :meth:`logical_and`, :meth:`logical_invert`, :meth:`logical_or`, and :" +"meth:`logical_xor` methods expect their arguments to be *logical operands*. " +"A *logical operand* is a :class:`Decimal` instance whose exponent and sign " +"are both zero, and whose digits are all either :const:`0` or :const:`1`." msgstr "" -":meth:`~Decimal.logical_and`, :meth:`~Decimal.logical_invert`, :meth:" -"`~Decimal.logical_or`, および :meth:`~Decimal.logical_xor` メソッドはその引数" -"が *論理引数* であると想定しています。 *論理引数* とは :class:`Decimal` イン" -"スタンスで指数と符号は共にゼロであり、各桁の数字が ``0`` か ``1`` であるもの" -"です。" +":meth:`logical_and`, :meth:`logical_invert`, :meth:`logical_or`, および :" +"meth:`logical_xor` メソッドはその引数が *論理引数* であると想定しています。 *" +"論理引数* とは :class:`Decimal` インスタンスで指数と符号は共にゼロであり、各" +"桁の数字が :const:`0` か :const:`1` であるものです。" -#: ../../library/decimal.rst:979 +#: ../../library/decimal.rst:906 msgid "Context objects" msgstr "Context オブジェクト" -#: ../../library/decimal.rst:981 +#: ../../library/decimal.rst:908 msgid "" "Contexts are environments for arithmetic operations. They govern precision, " "set rules for rounding, determine which signals are treated as exceptions, " @@ -1507,7 +1229,7 @@ msgstr "" "精度を決定し、値丸めの方法を設定し、シグナルのどれが例外になるかを決め、指数" "の範囲を制限しています。" -#: ../../library/decimal.rst:985 +#: ../../library/decimal.rst:912 msgid "" "Each thread has its own current context which is accessed or changed using " "the :func:`getcontext` and :func:`setcontext` functions:" @@ -1516,15 +1238,15 @@ msgstr "" "func:`getcontext` や :func:`setcontext` といった関数でアクセスしたり設定変更" "できます:" -#: ../../library/decimal.rst:991 +#: ../../library/decimal.rst:918 msgid "Return the current context for the active thread." msgstr "アクティブなスレッドの現在のコンテキストを返します。" -#: ../../library/decimal.rst:996 +#: ../../library/decimal.rst:923 msgid "Set the current context for the active thread to *c*." msgstr "アクティブなスレッドのコンテキストを *c* に設定します。" -#: ../../library/decimal.rst:998 +#: ../../library/decimal.rst:925 msgid "" "You can also use the :keyword:`with` statement and the :func:`localcontext` " "function to temporarily change the active context." @@ -1532,20 +1254,18 @@ msgstr "" ":keyword:`with` 文と :func:`localcontext` 関数を使って実行するコンテキストを" "一時的に変更することもできます。" -#: ../../library/decimal.rst:1003 +#: ../../library/decimal.rst:930 msgid "" "Return a context manager that will set the current context for the active " "thread to a copy of *ctx* on entry to the with-statement and restore the " "previous context when exiting the with-statement. If no context is " -"specified, a copy of the current context is used. The *kwargs* argument is " -"used to set the attributes of the new context." +"specified, a copy of the current context is used." msgstr "" "with 文の入口でアクティブなスレッドのコンテキストを *ctx* のコピーに設定し、" "with 文を抜ける時に元のコンテキストに復旧する、コンテキストマネージャを返しま" "す。コンテキストが指定されなければ、現在のコンテキストのコピーが使われます。" -"*kwargs* 引数は新しいコンテキストの属性を設定するのに使われます。" -#: ../../library/decimal.rst:1009 +#: ../../library/decimal.rst:935 msgid "" "For example, the following code sets the current decimal precision to 42 " "places, performs a calculation, and then automatically restores the previous " @@ -1554,50 +1274,7 @@ msgstr "" "たとえば、以下のコードでは精度を42桁に設定し、計算を実行し、そして元のコンテ" "キストに復帰します::" -#: ../../library/decimal.rst:1012 -msgid "" -"from decimal import localcontext\n" -"\n" -"with localcontext() as ctx:\n" -" ctx.prec = 42 # Perform a high precision calculation\n" -" s = calculate_something()\n" -"s = +s # Round the final result back to the default precision" -msgstr "" - -#: ../../library/decimal.rst:1019 -msgid "Using keyword arguments, the code would be the following::" -msgstr "" - -#: ../../library/decimal.rst:1021 -msgid "" -"from decimal import localcontext\n" -"\n" -"with localcontext(prec=42) as ctx:\n" -" s = calculate_something()\n" -"s = +s" -msgstr "" - -#: ../../library/decimal.rst:1027 -msgid "" -"Raises :exc:`TypeError` if *kwargs* supplies an attribute that :class:" -"`Context` doesn't support. Raises either :exc:`TypeError` or :exc:" -"`ValueError` if *kwargs* supplies an invalid value for an attribute." -msgstr "" - -#: ../../library/decimal.rst:1031 -msgid "" -":meth:`localcontext` now supports setting context attributes through the use " -"of keyword arguments." -msgstr "" - -#: ../../library/decimal.rst:1036 -msgid "" -"Return a context object initialized to the proper values for one of the IEEE " -"interchange formats. The argument must be a multiple of 32 and less than :" -"const:`IEEE_CONTEXT_MAX_BITS`." -msgstr "" - -#: ../../library/decimal.rst:1042 +#: ../../library/decimal.rst:945 msgid "" "New contexts can also be created using the :class:`Context` constructor " "described below. In addition, the module provides three pre-made contexts:" @@ -1606,7 +1283,7 @@ msgstr "" "生成できます。その他にも、 :mod:`decimal` モジュールでは作成済みのコンテキス" "トを提供しています:" -#: ../../library/decimal.rst:1048 +#: ../../library/decimal.rst:951 msgid "" "This is a standard context defined by the General Decimal Arithmetic " "Specification. Precision is set to nine. Rounding is set to :const:" @@ -1620,13 +1297,13 @@ msgstr "" "`Subnormal` を除く全ての演算エラートラップが有効 (例外として扱う) になってい" "ます。" -#: ../../library/decimal.rst:1054 +#: ../../library/decimal.rst:957 msgid "" "Because many of the traps are enabled, this context is useful for debugging." msgstr "" "多くのトラップが有効になっているので、デバッグの際に便利なコンテキストです。" -#: ../../library/decimal.rst:1059 +#: ../../library/decimal.rst:962 msgid "" "This is a standard context defined by the General Decimal Arithmetic " "Specification. Precision is set to nine. Rounding is set to :const:" @@ -1638,19 +1315,19 @@ msgstr "" "グはクリアされています。トラップは全て無効(演算中に一切例外を送出しない) に" "なっています。" -#: ../../library/decimal.rst:1064 +#: ../../library/decimal.rst:967 msgid "" "Because the traps are disabled, this context is useful for applications that " -"prefer to have result value of ``NaN`` or ``Infinity`` instead of raising " -"exceptions. This allows an application to complete a run in the presence of " -"conditions that would otherwise halt the program." +"prefer to have result value of :const:`NaN` or :const:`Infinity` instead of " +"raising exceptions. This allows an application to complete a run in the " +"presence of conditions that would otherwise halt the program." msgstr "" -"トラップが無効になっているので、エラーの伴う演算結果を ``NaN`` や " -"``Infinity`` にし、例外を送出しないようにしたいアプリケーションに向いたコンテ" -"キストです。このコンテキストを使うと、他の場合にはプログラムが停止してしまう" -"ような状況があっても実行を完了させられます。" +"トラップが無効になっているので、エラーの伴う演算結果を :const:`NaN` や :" +"const:`Infinity` にし、例外を送出しないようにしたいアプリケーションに向いたコ" +"ンテキストです。このコンテキストを使うと、他の場合にはプログラムが停止してし" +"まうような状況があっても実行を完了させられます。" -#: ../../library/decimal.rst:1072 +#: ../../library/decimal.rst:975 msgid "" "This context is used by the :class:`Context` constructor as a prototype for " "new contexts. Changing a field (such a precision) has the effect of " @@ -1662,7 +1339,7 @@ msgstr "" "と、 :class:`Context` コンストラクタが生成する新たなコンテキストに影響を及ぼ" "します。" -#: ../../library/decimal.rst:1076 +#: ../../library/decimal.rst:979 msgid "" "This context is most useful in multi-threaded environments. Changing one of " "the fields before threads are started has the effect of setting system-wide " @@ -1674,7 +1351,7 @@ msgstr "" "ことができます。スレッドを開始した後にフィールドを変更すると、競合条件を抑制" "するためにスレッドを同期化しなければならないので、推奨しません。" -#: ../../library/decimal.rst:1081 +#: ../../library/decimal.rst:984 msgid "" "In single threaded environments, it is preferable to not use this context at " "all. Instead, simply create contexts explicitly as described below." @@ -1682,18 +1359,17 @@ msgstr "" "単一スレッドの環境では、このコンテキストを使わないよう薦めます。下で述べるよ" "うに明示的にコンテキストを作成してください。" -#: ../../library/decimal.rst:1084 +#: ../../library/decimal.rst:987 msgid "" -"The default values are :attr:`Context.prec`\\ =\\ ``28``, :attr:`Context." -"rounding`\\ =\\ :const:`ROUND_HALF_EVEN`, and enabled traps for :class:" -"`Overflow`, :class:`InvalidOperation`, and :class:`DivisionByZero`." +"The default values are :attr:`prec`\\ =\\ :const:`28`, :attr:`rounding`\\ " +"=\\ :const:`ROUND_HALF_EVEN`, and enabled traps for :class:`Overflow`, :" +"class:`InvalidOperation`, and :class:`DivisionByZero`." msgstr "" -"デフォルトの値は、 :attr:`Context.prec`\\ =\\ ``28``, :attr:`Context." -"rounding`\\ =\\ :const:`ROUND_HALF_EVEN` で、トラップ :class:`Overflow`, :" -"class:`InvalidOperation`, および :class:`DivisionByZero` が有効になっていま" -"す。" +"デフォルトの値は、 :attr:`prec`\\ =\\ :const:`28`, :attr:`rounding`\\ =\\ :" +"const:`ROUND_HALF_EVEN` で、トラップ :class:`Overflow`, :class:" +"`InvalidOperation`, および :class:`DivisionByZero` が有効になっています。" -#: ../../library/decimal.rst:1089 +#: ../../library/decimal.rst:992 msgid "" "In addition to the three supplied contexts, new contexts can be created with " "the :class:`Context` constructor." @@ -1701,7 +1377,7 @@ msgstr "" "上に挙げた三つのコンテキストに加え、 :class:`Context` コンストラクタを使って" "新たなコンテキストを生成できます。" -#: ../../library/decimal.rst:1095 +#: ../../library/decimal.rst:998 msgid "" "Creates a new context. If a field is not specified or is :const:`None`, the " "default values are copied from the :const:`DefaultContext`. If the *flags* " @@ -1712,102 +1388,117 @@ msgstr "" "*flags* フィールドが設定されていいか :const:`None` の場合には、全てのフラグが" "クリアされます。" -#: ../../library/decimal.rst:1101 +#: ../../library/decimal.rst:1002 msgid "" -"An integer in the range [``1``, :const:`MAX_PREC`] that sets the precision " -"for arithmetic operations in the context." +"*prec* is an integer in the range [:const:`1`, :const:`MAX_PREC`] that sets " +"the precision for arithmetic operations in the context." msgstr "" +"*prec* フィールドは範囲 [:const:`1`, :const:`MAX_PREC`] 内の整数で、コンテキ" +"ストにおける算術演算の計算精度を設定します。" -#: ../../library/decimal.rst:1106 -msgid "One of the constants listed in the section `Rounding Modes`_." -msgstr "" - -#: ../../library/decimal.rst:1111 +#: ../../library/decimal.rst:1005 msgid "" -"Lists of any signals to be set. Generally, new contexts should only set " -"traps and leave the flags clear." -msgstr "" +"The *rounding* option is one of the constants listed in the section " +"`Rounding Modes`_." +msgstr "*rounding* オプションは、節 `丸めモード`_ で挙げられる定数の一つです。" -#: ../../library/decimal.rst:1117 +#: ../../library/decimal.rst:1008 msgid "" -"Integers specifying the outer limits allowable for exponents. *Emin* must be " -"in the range [:const:`MIN_EMIN`, ``0``], *Emax* in the range [``0``, :const:" -"`MAX_EMAX`]." +"The *traps* and *flags* fields list any signals to be set. Generally, new " +"contexts should only set traps and leave the flags clear." msgstr "" +"*traps* および *flags* フィールドには、セットしたいシグナルを列挙します。一般" +"的に、新たなコンテキストを作成するときにはトラップだけを設定し、フラグはクリ" +"アしておきます。" -#: ../../library/decimal.rst:1123 +#: ../../library/decimal.rst:1011 msgid "" -"Either ``0`` or ``1`` (the default). If set to ``1``, exponents are printed " -"with a capital ``E``; otherwise, a lowercase ``e`` is used: " -"``Decimal('6.02e+23')``." +"The *Emin* and *Emax* fields are integers specifying the outer limits " +"allowable for exponents. *Emin* must be in the range [:const:`MIN_EMIN`, :" +"const:`0`], *Emax* in the range [:const:`0`, :const:`MAX_EMAX`]." msgstr "" +"*Emin* および *Emax* フィールドは、許容する指数の外限を指定する整数です。 " +"*Emin* は範囲 [:const:`MIN_EMIN`, :const:`0`] 内で、 *Emax* は範囲 [:const:" +"`0`, :const:`MAX_EMAX`] 内でなければなりません。" -#: ../../library/decimal.rst:1129 +#: ../../library/decimal.rst:1015 msgid "" -"Either ``0`` (the default) or ``1``. If set to ``1``, the exponent ``e`` of " -"a :class:`Decimal` instance representable in this context is strictly " -"limited to the range ``Emin - prec + 1 <= e <= Emax - prec + 1``. If *clamp* " -"is ``0`` then a weaker condition holds: the adjusted exponent of the :class:" -"`Decimal` instance is at most :attr:`~Context.Emax`. When *clamp* is ``1``, " -"a large normal number will, where possible, have its exponent reduced and a " -"corresponding number of zeros added to its coefficient, in order to fit the " -"exponent constraints; this preserves the value of the number but loses " -"information about significant trailing zeros. For example::" +"The *capitals* field is either :const:`0` or :const:`1` (the default). If " +"set to :const:`1`, exponents are printed with a capital :const:`E`; " +"otherwise, a lowercase :const:`e` is used: :const:`Decimal('6.02e+23')`." msgstr "" +"*capitals* フィールドは :const:`0` または :const:`1` (デフォルト) にしま" +"す。 :const:`1` に設定すると、指数記号を大文字 :const:`E` で出力します。それ" +"以外の場合には :const:`Decimal('6.02e+23')` のように :const:`e` を使います。" -#: ../../library/decimal.rst:1140 +#: ../../library/decimal.rst:1019 msgid "" -">>> Context(prec=6, Emax=999, clamp=1).create_decimal('1.23e999')\n" -"Decimal('1.23000E+999')" +"The *clamp* field is either :const:`0` (the default) or :const:`1`. If set " +"to :const:`1`, the exponent ``e`` of a :class:`Decimal` instance " +"representable in this context is strictly limited to the range ``Emin - prec " +"+ 1 <= e <= Emax - prec + 1``. If *clamp* is :const:`0` then a weaker " +"condition holds: the adjusted exponent of the :class:`Decimal` instance is " +"at most ``Emax``. When *clamp* is :const:`1`, a large normal number will, " +"where possible, have its exponent reduced and a corresponding number of " +"zeros added to its coefficient, in order to fit the exponent constraints; " +"this preserves the value of the number but loses information about " +"significant trailing zeros. For example::" msgstr "" +"*clamp* フィールドは、 :const:`0` (デフォルト) または :const:`1` です。 :" +"const:`1` に設定されると、このコンテキストにおける :class:`Decimal` インスタ" +"ンスの指数 ``e`` は厳密に範囲 ``Emin - prec + 1 <= e <= Emax - prec + 1`` に" +"制限されます。 *clamp* が :const:`0` なら、それより弱い条件が支配します: 調整" +"された :class:`Decimal` インスタンスの指数は最大で ``Emax`` です。 *clamp* " +"が :const:`1` なら、大きな正規数は、可能なら、指数が減らされ、対応する数の 0 " +"が係数に加えられ、指数の制約に合わせられます; これは数の値を保存しますが、有" +"効な末尾の 0 に関する情報を失います。例えば::" -#: ../../library/decimal.rst:1143 +#: ../../library/decimal.rst:1034 msgid "" -"A *clamp* value of ``1`` allows compatibility with the fixed-width decimal " -"interchange formats specified in IEEE 754." +"A *clamp* value of :const:`1` allows compatibility with the fixed-width " +"decimal interchange formats specified in IEEE 754." msgstr "" -"*clamp* の値 ``1`` は、IEEE 754 で規定された固定幅十進交換形式と互換にできま" -"す。" +"*clamp* の値 :const:`1` は、IEEE 754 で規定された固定幅十進交換形式と互換にで" +"きます。" -#: ../../library/decimal.rst:1146 +#: ../../library/decimal.rst:1037 msgid "" "The :class:`Context` class defines several general purpose methods as well " "as a large number of methods for doing arithmetic directly in a given " "context. In addition, for each of the :class:`Decimal` methods described " -"above (with the exception of the :meth:`~Decimal.adjusted` and :meth:" -"`~Decimal.as_tuple` methods) there is a corresponding :class:`Context` " -"method. For example, for a :class:`Context` instance ``C`` and :class:" -"`Decimal` instance ``x``, ``C.exp(x)`` is equivalent to ``x." -"exp(context=C)``. Each :class:`Context` method accepts a Python integer (an " -"instance of :class:`int`) anywhere that a Decimal instance is accepted." +"above (with the exception of the :meth:`adjusted` and :meth:`as_tuple` " +"methods) there is a corresponding :class:`Context` method. For example, for " +"a :class:`Context` instance ``C`` and :class:`Decimal` instance ``x``, ``C." +"exp(x)`` is equivalent to ``x.exp(context=C)``. Each :class:`Context` " +"method accepts a Python integer (an instance of :class:`int`) anywhere that " +"a Decimal instance is accepted." msgstr "" ":class:`Context` クラスでは、いくつかの汎用のメソッドの他、現在のコンテキスト" "で算術演算を直接行うためのメソッドを数多く定義しています。加えて、 :class:" -"`Decimal` の各メソッドについて(:meth:`~Decimal.adjusted` および :meth:" -"`~Decimal.as_tuple` メソッドを例外として)対応する :class:`Context` のメソッド" -"が存在します。たとえば、 :class:`Context` インスタンス ``C`` と :class:" -"`Decimal` インスタンス ``x`` に対して、 ``C.exp(x)`` は ``x.exp(context=C)`` " -"と等価です。それぞれの :class:`Context` メソッドは、Decimal インスタンスが受" -"け付けられるところならどこでも、Python の整数 (:class:`int` のインスタンス) " -"を受け付けます。" - -#: ../../library/decimal.rst:1159 -msgid "Resets all of the flags to ``0``." -msgstr "フラグを全て ``0`` にリセットします。" - -#: ../../library/decimal.rst:1163 -msgid "Resets all of the traps to ``0``." -msgstr "トラップを全て ``0`` にリセットします。" - -#: ../../library/decimal.rst:1169 +"`Decimal` の各メソッドについて(:meth:`adjusted` および :meth:`as_tuple` メ" +"ソッドを例外として)対応する :class:`Context` のメソッドが存在します。たとえ" +"ば、 :class:`Context` インスタンス ``C`` と :class:`Decimal` インスタンス " +"``x`` に対して、 ``C.exp(x)`` は ``x.exp(context=C)`` と等価です。それぞれ" +"の :class:`Context` メソッドは、Decimal インスタンスが受け付けられるところな" +"らどこでも、Python の整数 (:class:`int` のインスタンス) を受け付けます。" + +#: ../../library/decimal.rst:1050 +msgid "Resets all of the flags to :const:`0`." +msgstr "フラグを全て :const:`0` にリセットします。" + +#: ../../library/decimal.rst:1054 +msgid "Resets all of the traps to :const:`0`." +msgstr "トラップを全て :const:`0` にリセットします。" + +#: ../../library/decimal.rst:1060 msgid "Return a duplicate of the context." msgstr "コンテキストの複製を返します。" -#: ../../library/decimal.rst:1173 +#: ../../library/decimal.rst:1064 msgid "Return a copy of the Decimal instance num." msgstr "Decimal インスタンス num のコピーを返します。" -#: ../../library/decimal.rst:1177 +#: ../../library/decimal.rst:1068 msgid "" "Creates a new Decimal instance from *num* but using *self* as context. " "Unlike the :class:`Decimal` constructor, the context precision, rounding " @@ -1817,7 +1508,7 @@ msgstr "" "す。 :class:`Decimal` コンストラクタと違い、数値を変換する際にコンテキストの" "精度、値丸め方法、フラグ、トラップを適用します。" -#: ../../library/decimal.rst:1181 +#: ../../library/decimal.rst:1072 msgid "" "This is useful because constants are often given to a greater precision than " "is needed by the application. Another benefit is that rounding immediately " @@ -1832,16 +1523,7 @@ msgstr "" "もあります。以下の例は、丸められていない入力を使うということは和にゼロを加え" "ると結果が変わり得るという見本です:" -#: ../../library/decimal.rst:1187 -msgid "" -">>> getcontext().prec = 3\n" -">>> Decimal('3.4445') + Decimal('1.0023')\n" -"Decimal('4.45')\n" -">>> Decimal('3.4445') + Decimal(0) + Decimal('1.0023')\n" -"Decimal('4.44')" -msgstr "" - -#: ../../library/decimal.rst:1195 +#: ../../library/decimal.rst:1086 msgid "" "This method implements the to-number operation of the IBM specification. If " "the argument is a string, no leading or trailing whitespace or underscores " @@ -1851,7 +1533,7 @@ msgstr "" "合、前や後ろに余計な空白を付けたり、アンダースコアを含めたりすることは許され" "ません。" -#: ../../library/decimal.rst:1201 +#: ../../library/decimal.rst:1092 msgid "" "Creates a new Decimal instance from a float *f* but rounding using *self* as " "the context. Unlike the :meth:`Decimal.from_float` class method, the " @@ -1863,19 +1545,7 @@ msgstr "" "い、変換にコンテキストの精度、丸めメソッド、フラグ、そしてトラップが適用され" "ます。" -#: ../../library/decimal.rst:1206 -msgid "" -">>> context = Context(prec=5, rounding=ROUND_DOWN)\n" -">>> context.create_decimal_from_float(math.pi)\n" -"Decimal('3.1415')\n" -">>> context = Context(prec=5, traps=[Inexact])\n" -">>> context.create_decimal_from_float(math.pi)\n" -"Traceback (most recent call last):\n" -" ...\n" -"decimal.Inexact: None" -msgstr "" - -#: ../../library/decimal.rst:1221 +#: ../../library/decimal.rst:1112 msgid "" "Returns a value equal to ``Emin - prec + 1`` which is the minimum exponent " "value for subnormal results. When underflow occurs, the exponent is set to :" @@ -1884,11 +1554,11 @@ msgstr "" "``Emin - prec + 1`` に等しい値を返します。演算結果の劣化が起こる桁の最小値で" "す。アンダーフローが起きた場合、指数は :const:`Etiny` に設定されます。" -#: ../../library/decimal.rst:1227 +#: ../../library/decimal.rst:1118 msgid "Returns a value equal to ``Emax - prec + 1``." msgstr "``Emax - prec + 1`` に等しい値を返します。" -#: ../../library/decimal.rst:1229 +#: ../../library/decimal.rst:1120 msgid "" "The usual approach to working with decimals is to create :class:`Decimal` " "instances and then apply arithmetic operations which take place within the " @@ -1904,188 +1574,188 @@ msgstr "" "のメソッドは :class:`Decimal` クラスのメソッドに似ているので、ここでは簡単な" "説明にとどめます。" -#: ../../library/decimal.rst:1239 +#: ../../library/decimal.rst:1130 msgid "Returns the absolute value of *x*." msgstr "*x* の絶対値を返します。" -#: ../../library/decimal.rst:1244 +#: ../../library/decimal.rst:1135 msgid "Return the sum of *x* and *y*." msgstr "*x* と *y* の和を返します。" -#: ../../library/decimal.rst:1249 +#: ../../library/decimal.rst:1140 msgid "Returns the same Decimal object *x*." msgstr "同じ Decimal オブジェクト *x* を返します。" -#: ../../library/decimal.rst:1254 +#: ../../library/decimal.rst:1145 msgid "Compares *x* and *y* numerically." msgstr "*x* と *y* を数値として比較します。" -#: ../../library/decimal.rst:1259 +#: ../../library/decimal.rst:1150 msgid "Compares the values of the two operands numerically." msgstr "二つの演算対象の値を数値として比較します。" -#: ../../library/decimal.rst:1264 +#: ../../library/decimal.rst:1155 msgid "Compares two operands using their abstract representation." msgstr "二つの演算対象を抽象的な表現を使って比較します。" -#: ../../library/decimal.rst:1269 +#: ../../library/decimal.rst:1160 msgid "" "Compares two operands using their abstract representation, ignoring sign." msgstr "二つの演算対象を抽象的な表現を使い符号を無視して比較します。" -#: ../../library/decimal.rst:1274 +#: ../../library/decimal.rst:1165 msgid "Returns a copy of *x* with the sign set to 0." msgstr "*x* のコピーの符号を 0 にセットして返します。" -#: ../../library/decimal.rst:1279 +#: ../../library/decimal.rst:1170 msgid "Returns a copy of *x* with the sign inverted." msgstr "*x* のコピーの符号を反転して返します。" -#: ../../library/decimal.rst:1284 +#: ../../library/decimal.rst:1175 msgid "Copies the sign from *y* to *x*." msgstr "*y* から *x* に符号をコピーします。" -#: ../../library/decimal.rst:1289 +#: ../../library/decimal.rst:1180 msgid "Return *x* divided by *y*." msgstr "*x* を *y* で除算した値を返します。" -#: ../../library/decimal.rst:1294 +#: ../../library/decimal.rst:1185 msgid "Return *x* divided by *y*, truncated to an integer." msgstr "*x* を *y* で除算した値を整数に切り捨てて返します。" -#: ../../library/decimal.rst:1299 +#: ../../library/decimal.rst:1190 msgid "Divides two numbers and returns the integer part of the result." msgstr "二つの数値間の除算を行い、結果の整数部を返します。" -#: ../../library/decimal.rst:1304 -msgid "Returns ``e ** x``." -msgstr "``e ** x`` を返します。" +#: ../../library/decimal.rst:1195 +msgid "Returns `e ** x`." +msgstr "`e ** x` を返します。" -#: ../../library/decimal.rst:1309 +#: ../../library/decimal.rst:1200 msgid "Returns *x* multiplied by *y*, plus *z*." msgstr "*x* を *y* 倍したものに *z* を加えて返します。" -#: ../../library/decimal.rst:1314 +#: ../../library/decimal.rst:1205 msgid "Returns ``True`` if *x* is canonical; otherwise returns ``False``." msgstr "" "*x* が標準的(canonical)ならば ``True`` を返します。そうでなければ ``False`` " "です。" -#: ../../library/decimal.rst:1319 +#: ../../library/decimal.rst:1210 msgid "Returns ``True`` if *x* is finite; otherwise returns ``False``." msgstr "*x* が有限ならば ``True`` を返します。そうでなければ ``False`` です。" -#: ../../library/decimal.rst:1324 +#: ../../library/decimal.rst:1215 msgid "Returns ``True`` if *x* is infinite; otherwise returns ``False``." msgstr "*x* が無限ならば ``True`` を返します。そうでなければ ``False`` です。" -#: ../../library/decimal.rst:1329 +#: ../../library/decimal.rst:1220 msgid "Returns ``True`` if *x* is a qNaN or sNaN; otherwise returns ``False``." msgstr "" "*x* が qNaN か sNaN であれば ``True`` を返します。そうでなければ ``False`` で" "す。" -#: ../../library/decimal.rst:1334 +#: ../../library/decimal.rst:1225 msgid "" "Returns ``True`` if *x* is a normal number; otherwise returns ``False``." msgstr "" "*x* が通常の数ならば ``True`` を返します。そうでなければ ``False`` です。" -#: ../../library/decimal.rst:1339 +#: ../../library/decimal.rst:1230 msgid "Returns ``True`` if *x* is a quiet NaN; otherwise returns ``False``." msgstr "" "*x* が無言 NaN であれば ``True`` を返します。そうでなければ ``False`` です。" -#: ../../library/decimal.rst:1344 +#: ../../library/decimal.rst:1235 msgid "Returns ``True`` if *x* is negative; otherwise returns ``False``." msgstr "" "*x* が負の数であれば ``True`` を返します。そうでなければ ``False`` です。" -#: ../../library/decimal.rst:1349 +#: ../../library/decimal.rst:1240 msgid "" "Returns ``True`` if *x* is a signaling NaN; otherwise returns ``False``." msgstr "" "*x* が発信 NaN であれば ``True`` を返します。そうでなければ ``False`` です。" -#: ../../library/decimal.rst:1354 +#: ../../library/decimal.rst:1245 msgid "Returns ``True`` if *x* is subnormal; otherwise returns ``False``." msgstr "" "*x* が非正規数であれば ``True`` を返します。そうでなければ ``False`` です。" -#: ../../library/decimal.rst:1359 +#: ../../library/decimal.rst:1250 msgid "Returns ``True`` if *x* is a zero; otherwise returns ``False``." msgstr "" "*x* がゼロであれば ``True`` を返します。そうでなければ ``False`` です。" -#: ../../library/decimal.rst:1364 +#: ../../library/decimal.rst:1255 msgid "Returns the natural (base e) logarithm of *x*." msgstr "*x* の自然対数(底 e の対数)を返します。" -#: ../../library/decimal.rst:1369 +#: ../../library/decimal.rst:1260 msgid "Returns the base 10 logarithm of *x*." msgstr "*x* の底 10 の対数を返します。" -#: ../../library/decimal.rst:1374 +#: ../../library/decimal.rst:1265 msgid "Returns the exponent of the magnitude of the operand's MSD." msgstr "演算対象の MSD の大きさの指数部を返します。" -#: ../../library/decimal.rst:1379 +#: ../../library/decimal.rst:1270 msgid "Applies the logical operation *and* between each operand's digits." msgstr "それぞれの桁に論理演算 *and* を当てはめます。" -#: ../../library/decimal.rst:1384 +#: ../../library/decimal.rst:1275 msgid "Invert all the digits in *x*." msgstr "*x* の全ての桁を反転させます。" -#: ../../library/decimal.rst:1389 +#: ../../library/decimal.rst:1280 msgid "Applies the logical operation *or* between each operand's digits." msgstr "それぞれの桁に論理演算 *or* を当てはめます。" -#: ../../library/decimal.rst:1394 +#: ../../library/decimal.rst:1285 msgid "Applies the logical operation *xor* between each operand's digits." msgstr "それぞれの桁に論理演算 *xor* を当てはめます。" -#: ../../library/decimal.rst:1399 +#: ../../library/decimal.rst:1290 msgid "Compares two values numerically and returns the maximum." msgstr "二つの値を数値として比較し、大きいほうを返します。" -#: ../../library/decimal.rst:1404 ../../library/decimal.rst:1414 +#: ../../library/decimal.rst:1295 ../../library/decimal.rst:1305 msgid "Compares the values numerically with their sign ignored." msgstr "値を符号を無視して数値として比較します。" -#: ../../library/decimal.rst:1409 +#: ../../library/decimal.rst:1300 msgid "Compares two values numerically and returns the minimum." msgstr "二つの値を数値として比較し、小さいほうを返します。" -#: ../../library/decimal.rst:1419 +#: ../../library/decimal.rst:1310 msgid "Minus corresponds to the unary prefix minus operator in Python." msgstr "Python における単項マイナス演算子に対応する演算です。" -#: ../../library/decimal.rst:1424 +#: ../../library/decimal.rst:1315 msgid "Return the product of *x* and *y*." msgstr "*x* と *y* の積を返します。" -#: ../../library/decimal.rst:1429 +#: ../../library/decimal.rst:1320 msgid "Returns the largest representable number smaller than *x*." msgstr "*x* より小さい最大の表現可能な数を返します。" -#: ../../library/decimal.rst:1434 +#: ../../library/decimal.rst:1325 msgid "Returns the smallest representable number larger than *x*." msgstr "*x* より大きい最小の表現可能な数を返します。" -#: ../../library/decimal.rst:1439 +#: ../../library/decimal.rst:1330 msgid "Returns the number closest to *x*, in direction towards *y*." msgstr "*x* に *y* の方向に向かって最も近い数を返します。" -#: ../../library/decimal.rst:1444 +#: ../../library/decimal.rst:1335 msgid "Reduces *x* to its simplest form." msgstr "*x* をもっとも単純な形にします。" -#: ../../library/decimal.rst:1449 +#: ../../library/decimal.rst:1340 msgid "Returns an indication of the class of *x*." msgstr "*x* のクラスを指し示すものを返します。" -#: ../../library/decimal.rst:1454 +#: ../../library/decimal.rst:1345 msgid "" "Plus corresponds to the unary prefix plus operator in Python. This " "operation applies the context precision and rounding, so it is *not* an " @@ -2094,18 +1764,18 @@ msgstr "" "Python における単項のプラス演算子に対応する演算です。コンテキストにおける精度" "や値丸めを適用するので、等値 (identity) 演算とは *違います*。" -#: ../../library/decimal.rst:1461 +#: ../../library/decimal.rst:1352 msgid "Return ``x`` to the power of ``y``, reduced modulo ``modulo`` if given." msgstr "" "``x`` の ``y`` 乗を計算します。``modulo`` が指定されていればモジュロを取りま" "す。" -#: ../../library/decimal.rst:1463 +#: ../../library/decimal.rst:1354 msgid "" "With two arguments, compute ``x**y``. If ``x`` is negative then ``y`` must " "be integral. The result will be inexact unless ``y`` is integral and the " "result is finite and can be expressed exactly in 'precision' digits. The " -"rounding mode of the context is used. Results are always correctly rounded " +"rounding mode of the context is used. Results are always correctly-rounded " "in the Python version." msgstr "" "引数が 2 つの場合、 ``x**y`` を計算します。``x`` が負の場合、 ``y`` は整数で" @@ -2114,23 +1784,23 @@ msgstr "" "ンテキストの丸めモードを使って丸められます。結果は常に、Python バージョンにお" "いて正しく丸められます。" -#: ../../library/decimal.rst:1469 +#: ../../library/decimal.rst:1360 msgid "" "``Decimal(0) ** Decimal(0)`` results in ``InvalidOperation``, and if " "``InvalidOperation`` is not trapped, then results in ``Decimal('NaN')``." msgstr "" -#: ../../library/decimal.rst:1472 +#: ../../library/decimal.rst:1363 msgid "" -"The C module computes :meth:`power` in terms of the correctly rounded :meth:" +"The C module computes :meth:`power` in terms of the correctly-rounded :meth:" "`exp` and :meth:`ln` functions. The result is well-defined but only \"almost " -"always correctly rounded\"." +"always correctly-rounded\"." msgstr "" "C モジュールは :meth:`power` を適切に丸められた :meth:`exp` および :meth:" "`ln` 関数によって計算します。結果は well-defined ですが、「ほとんどの場合には" "適切に丸められる」だけです。" -#: ../../library/decimal.rst:1477 +#: ../../library/decimal.rst:1368 msgid "" "With three arguments, compute ``(x**y) % modulo``. For the three argument " "form, the following restrictions on the arguments hold:" @@ -2138,23 +1808,23 @@ msgstr "" "引数が 3 つの場合、 ``(x**y) % modulo`` を計算します。この 3 引数の形式の場" "合、引数には以下の制限が課せられます。" -#: ../../library/decimal.rst:1480 +#: ../../library/decimal.rst:1371 msgid "all three arguments must be integral" msgstr "全ての引数は整数" -#: ../../library/decimal.rst:1481 +#: ../../library/decimal.rst:1372 msgid "``y`` must be nonnegative" msgstr "``y`` は非負でなければならない" -#: ../../library/decimal.rst:1482 +#: ../../library/decimal.rst:1373 msgid "at least one of ``x`` or ``y`` must be nonzero" msgstr "``x`` と ``y`` の少なくともどちらかはゼロでない" -#: ../../library/decimal.rst:1483 +#: ../../library/decimal.rst:1374 msgid "``modulo`` must be nonzero and have at most 'precision' digits" msgstr "``modulo`` は非零で大きくても 'precision' 桁" -#: ../../library/decimal.rst:1485 +#: ../../library/decimal.rst:1376 msgid "" "The value resulting from ``Context.power(x, y, modulo)`` is equal to the " "value that would be obtained by computing ``(x**y) % modulo`` with unbounded " @@ -2167,25 +1837,25 @@ msgstr "" "は ``x``, ``y``, ``modulo`` の指数に関係なくゼロです。この計算は常に正確で" "す。" -#: ../../library/decimal.rst:1495 +#: ../../library/decimal.rst:1386 msgid "Returns a value equal to *x* (rounded), having the exponent of *y*." msgstr "*x* に値丸めを適用し、指数を *y* にした値を返します。" -#: ../../library/decimal.rst:1500 +#: ../../library/decimal.rst:1391 msgid "Just returns 10, as this is Decimal, :)" msgstr "単に 10 を返します。何せ十進ですから :)" -#: ../../library/decimal.rst:1505 +#: ../../library/decimal.rst:1396 msgid "Returns the remainder from integer division." msgstr "整数除算の剰余を返します。" -#: ../../library/decimal.rst:1507 +#: ../../library/decimal.rst:1398 msgid "" "The sign of the result, if non-zero, is the same as that of the original " "dividend." msgstr "剰余がゼロでない場合、符号は割られる数の符号と同じになります。" -#: ../../library/decimal.rst:1513 +#: ../../library/decimal.rst:1404 msgid "" "Returns ``x - y * n``, where *n* is the integer nearest the exact value of " "``x / y`` (if the result is 0 then its sign will be the sign of *x*)." @@ -2193,43 +1863,43 @@ msgstr "" "``x - y * n`` を返します。ここで *n* は ``x / y`` の正確な値に一番近い整数で" "す (この結果が 0 ならばその符号は *x* の符号と同じです)。" -#: ../../library/decimal.rst:1519 +#: ../../library/decimal.rst:1410 msgid "Returns a rotated copy of *x*, *y* times." msgstr "*x* の *y* 回巡回したコピーを返します。" -#: ../../library/decimal.rst:1524 +#: ../../library/decimal.rst:1415 msgid "Returns ``True`` if the two operands have the same exponent." msgstr "2つの演算対象が同じ指数を持っている場合に ``True`` を返します。" -#: ../../library/decimal.rst:1529 +#: ../../library/decimal.rst:1420 msgid "Returns the first operand after adding the second value its exp." msgstr "一つめの演算対象の指数部に二つめの値を加えたものを返します。" -#: ../../library/decimal.rst:1534 +#: ../../library/decimal.rst:1425 msgid "Returns a shifted copy of *x*, *y* times." msgstr "*x* を *y* 回シフトしたコピーを返します。" -#: ../../library/decimal.rst:1539 +#: ../../library/decimal.rst:1430 msgid "Square root of a non-negative number to context precision." msgstr "*x* の平方根を精度いっぱいまで求めます。" -#: ../../library/decimal.rst:1544 +#: ../../library/decimal.rst:1435 msgid "Return the difference between *x* and *y*." msgstr "*x* と *y* の間の差を返します。" -#: ../../library/decimal.rst:1558 +#: ../../library/decimal.rst:1449 msgid "Rounds to an integer." msgstr "最近傍の整数に値を丸めます。" -#: ../../library/decimal.rst:1563 +#: ../../library/decimal.rst:1454 msgid "Converts a number to a string using scientific notation." msgstr "数値を科学表記で文字列に変換します。" -#: ../../library/decimal.rst:1570 +#: ../../library/decimal.rst:1461 msgid "Constants" msgstr "定数" -#: ../../library/decimal.rst:1572 +#: ../../library/decimal.rst:1463 msgid "" "The constants in this section are only relevant for the C module. They are " "also included in the pure Python version for compatibility." @@ -2237,95 +1907,90 @@ msgstr "" "この節の定数は C モジュールにのみ意味があります。互換性のために、pure Python " "版も含まれます。" -#: ../../library/decimal.rst:1576 +#: ../../library/decimal.rst:1467 msgid "32-bit" msgstr "32-bit" -#: ../../library/decimal.rst:1576 +#: ../../library/decimal.rst:1467 msgid "64-bit" msgstr "64-bit" -#: ../../library/decimal.rst:1578 ../../library/decimal.rst:1580 -msgid "``425000000``" -msgstr "``425000000``" +#: ../../library/decimal.rst:1469 ../../library/decimal.rst:1471 +msgid ":const:`425000000`" +msgstr ":const:`425000000`" -#: ../../library/decimal.rst:1578 ../../library/decimal.rst:1580 -msgid "``999999999999999999``" -msgstr "``999999999999999999``" +#: ../../library/decimal.rst:1469 ../../library/decimal.rst:1471 +msgid ":const:`999999999999999999`" +msgstr ":const:`999999999999999999`" -#: ../../library/decimal.rst:1582 -msgid "``-425000000``" -msgstr "``-425000000``" +#: ../../library/decimal.rst:1473 +msgid ":const:`-425000000`" +msgstr ":const:`-425000000`" -#: ../../library/decimal.rst:1582 -msgid "``-999999999999999999``" -msgstr "``-999999999999999999``" +#: ../../library/decimal.rst:1473 +msgid ":const:`-999999999999999999`" +msgstr ":const:`-999999999999999999`" -#: ../../library/decimal.rst:1584 -msgid "``-849999999``" -msgstr "``-849999999``" +#: ../../library/decimal.rst:1475 +msgid ":const:`-849999999`" +msgstr ":const:`-849999999`" -#: ../../library/decimal.rst:1584 -msgid "``-1999999999999999997``" -msgstr "``-1999999999999999997``" +#: ../../library/decimal.rst:1475 +msgid ":const:`-1999999999999999997`" +msgstr ":const:`-1999999999999999997`" -#: ../../library/decimal.rst:1586 -msgid "``256``" -msgstr "" - -#: ../../library/decimal.rst:1586 -msgid "``512``" -msgstr "" - -#: ../../library/decimal.rst:1591 +#: ../../library/decimal.rst:1481 msgid "" "The value is ``True``. Deprecated, because Python now always has threads." msgstr "" "値は ``True`` です。現在のPythonは常にスレッドを持っているので、非推奨になり" "ました。" -#: ../../library/decimal.rst:1597 +#: ../../library/decimal.rst:1487 msgid "" -"The default value is ``True``. If Python is :option:`configured using the --" -"without-decimal-contextvar option <--without-decimal-contextvar>`, the C " -"version uses a thread-local rather than a coroutine-local context and the " -"value is ``False``. This is slightly faster in some nested context " -"scenarios." +"The default value is ``True``. If Python is compiled ``--without-decimal-" +"contextvar``, the C version uses a thread-local rather than a coroutine-" +"local context and the value is ``False``. This is slightly faster in some " +"nested context scenarios." msgstr "" -#: ../../library/decimal.rst:1606 +#: ../../library/decimal.rst:1491 +msgid "backported to 3.7 and 3.8." +msgstr "3.7 と 3.8 にバックポートされました。" + +#: ../../library/decimal.rst:1495 msgid "Rounding modes" msgstr "丸めモード" -#: ../../library/decimal.rst:1610 -msgid "Round towards ``Infinity``." -msgstr "``Infinity`` 方向に丸めます。" +#: ../../library/decimal.rst:1499 +msgid "Round towards :const:`Infinity`." +msgstr ":const:`Infinity` 方向に丸めます。" -#: ../../library/decimal.rst:1614 +#: ../../library/decimal.rst:1503 msgid "Round towards zero." msgstr "ゼロ方向に丸めます。" -#: ../../library/decimal.rst:1618 -msgid "Round towards ``-Infinity``." -msgstr "``-Infinity`` 方向に丸めます。" +#: ../../library/decimal.rst:1507 +msgid "Round towards :const:`-Infinity`." +msgstr ":const:`-Infinity` 方向に丸めます。" -#: ../../library/decimal.rst:1622 +#: ../../library/decimal.rst:1511 msgid "Round to nearest with ties going towards zero." msgstr "近い方に、引き分けはゼロ方向に向けて丸めます。" -#: ../../library/decimal.rst:1626 +#: ../../library/decimal.rst:1515 msgid "Round to nearest with ties going to nearest even integer." msgstr "近い方に、引き分けは偶数整数方向に向けて丸めます。" -#: ../../library/decimal.rst:1630 +#: ../../library/decimal.rst:1519 msgid "Round to nearest with ties going away from zero." msgstr "近い方に、引き分けはゼロから遠い方向に向けて丸めます。" -#: ../../library/decimal.rst:1634 +#: ../../library/decimal.rst:1523 msgid "Round away from zero." msgstr "ゼロから遠い方向に丸めます。" -#: ../../library/decimal.rst:1638 +#: ../../library/decimal.rst:1527 msgid "" "Round away from zero if last digit after rounding towards zero would have " "been 0 or 5; otherwise round towards zero." @@ -2333,11 +1998,11 @@ msgstr "" "ゼロ方向に丸めた後の最後の桁が 0 または 5 ならばゼロから遠い方向に、そうでな" "ければゼロ方向に丸めます。" -#: ../../library/decimal.rst:1645 +#: ../../library/decimal.rst:1534 msgid "Signals" msgstr "シグナル" -#: ../../library/decimal.rst:1647 +#: ../../library/decimal.rst:1536 msgid "" "Signals represent conditions that arise during computation. Each corresponds " "to one context flag and one context trap enabler." @@ -2345,7 +2010,7 @@ msgstr "" "シグナルは、計算中に生じた様々なエラー条件を表現します。各々のシグナルは一つ" "のコンテキストフラグと一つのトラップイネーブラに対応しています。" -#: ../../library/decimal.rst:1650 +#: ../../library/decimal.rst:1539 msgid "" "The context flag is set whenever the condition is encountered. After the " "computation, flags may be checked for informational purposes (for instance, " @@ -2357,7 +2022,7 @@ msgstr "" "かります。フラグを調べたら、次の計算を始める前にフラグを全てクリアするように" "してください。" -#: ../../library/decimal.rst:1655 +#: ../../library/decimal.rst:1544 msgid "" "If the context's trap enabler is set for the signal, then the condition " "causes a Python exception to be raised. For example, if the :class:" @@ -2369,43 +2034,44 @@ msgstr "" "`DivisionByZero` が設定されていると、エラー条件が生じた際に :exc:" "`DivisionByZero` 例外を送出します。" -#: ../../library/decimal.rst:1663 +#: ../../library/decimal.rst:1552 msgid "Altered an exponent to fit representation constraints." msgstr "値の表現上の制限に沿わせるために指数部が変更されたことを通知します。" -#: ../../library/decimal.rst:1665 +#: ../../library/decimal.rst:1554 msgid "" "Typically, clamping occurs when an exponent falls outside the context's :" -"attr:`~Context.Emin` and :attr:`~Context.Emax` limits. If possible, the " -"exponent is reduced to fit by adding zeros to the coefficient." +"attr:`Emin` and :attr:`Emax` limits. If possible, the exponent is reduced " +"to fit by adding zeros to the coefficient." msgstr "" "通常、クランプ (clamp) は、指数部がコンテキストにおける指数桁の制限値 :attr:" -"`~Context.Emin` および :attr:`~Context.Emax` を越えた場合に発生します。可能な" -"場合には、係数部にゼロを加えた表現に合わせて指数部を減らします。" +"`Emin` および :attr:`Emax` を越えた場合に発生します。可能な場合には、係数部に" +"ゼロを加えた表現に合わせて指数部を減らします。" -#: ../../library/decimal.rst:1672 +#: ../../library/decimal.rst:1561 msgid "Base class for other signals and a subclass of :exc:`ArithmeticError`." msgstr "他のシグナルの基底クラスで、 :exc:`ArithmeticError` のサブクラスです。" -#: ../../library/decimal.rst:1677 +#: ../../library/decimal.rst:1566 msgid "Signals the division of a non-infinite number by zero." msgstr "有限値をゼロで除算したときのシグナルです。" -#: ../../library/decimal.rst:1679 +#: ../../library/decimal.rst:1568 msgid "" "Can occur with division, modulo division, or when raising a number to a " -"negative power. If this signal is not trapped, returns ``Infinity`` or ``-" -"Infinity`` with the sign determined by the inputs to the calculation." +"negative power. If this signal is not trapped, returns :const:`Infinity` " +"or :const:`-Infinity` with the sign determined by the inputs to the " +"calculation." msgstr "" "除算やモジュロ除算、数を負の値で累乗した場合に起きることがあります。このシグ" -"ナルをトラップしない場合、演算結果は ``Infinity`` または ``-Infinity`` にな" -"り、その符号は演算に使った入力に基づいて決まります。" +"ナルをトラップしない場合、演算結果は :const:`Infinity` または :const:`-" +"Infinity` になり、その符号は演算に使った入力に基づいて決まります。" -#: ../../library/decimal.rst:1686 +#: ../../library/decimal.rst:1575 msgid "Indicates that rounding occurred and the result is not exact." msgstr "値の丸めによって演算結果から厳密さが失われたことを通知します。" -#: ../../library/decimal.rst:1688 +#: ../../library/decimal.rst:1577 msgid "" "Signals when non-zero digits were discarded during rounding. The rounded " "result is returned. The signal flag or trap is used to detect when results " @@ -2415,72 +2081,59 @@ msgstr "" "丸め後の値です。シグナルのフラグやトラップは、演算結果の厳密さが失われたこと" "を検出するために使えるだけです。" -#: ../../library/decimal.rst:1695 +#: ../../library/decimal.rst:1584 msgid "An invalid operation was performed." msgstr "無効な演算が実行されたことを通知します。" -#: ../../library/decimal.rst:1697 +#: ../../library/decimal.rst:1586 msgid "" "Indicates that an operation was requested that does not make sense. If not " -"trapped, returns ``NaN``. Possible causes include::" +"trapped, returns :const:`NaN`. Possible causes include::" msgstr "" "ユーザが有意な演算結果にならないような操作を要求したことを示します。このシグ" -"ナルをトラップしない場合、 ``NaN`` を返します。このシグナルの発生原因として考" -"えられるのは、以下のような状況です::" - -#: ../../library/decimal.rst:1700 -msgid "" -"Infinity - Infinity\n" -"0 * Infinity\n" -"Infinity / Infinity\n" -"x % 0\n" -"Infinity % x\n" -"sqrt(-x) and x > 0\n" -"0 ** 0\n" -"x ** (non-integer)\n" -"x ** Infinity" -msgstr "" +"ナルをトラップしない場合、 :const:`NaN` を返します。このシグナルの発生原因と" +"して考えられるのは、以下のような状況です::" -#: ../../library/decimal.rst:1713 +#: ../../library/decimal.rst:1602 msgid "Numerical overflow." msgstr "数値オーバフローを示すシグナルです。" -#: ../../library/decimal.rst:1715 +#: ../../library/decimal.rst:1604 msgid "" -"Indicates the exponent is larger than :attr:`Context.Emax` after rounding " -"has occurred. If not trapped, the result depends on the rounding mode, " -"either pulling inward to the largest representable finite number or rounding " -"outward to ``Infinity``. In either case, :class:`Inexact` and :class:" +"Indicates the exponent is larger than :attr:`Emax` after rounding has " +"occurred. If not trapped, the result depends on the rounding mode, either " +"pulling inward to the largest representable finite number or rounding " +"outward to :const:`Infinity`. In either case, :class:`Inexact` and :class:" "`Rounded` are also signaled." msgstr "" -"このシグナルは、値丸めを行った後の指数部が :attr:`Context.Emax` より大きいこ" -"とを示します。シグナルをトラップしない場合、演算結果は値丸めのモードにより、" -"表現可能な最大の数値になるように内側へ引き込んで丸めを行った値か、 " -"``Infinity`` になるように外側に丸めた値のいずれかになります。いずれの場合" -"も、 :class:`Inexact` および :class:`Rounded` が同時にシグナルされます。" +"このシグナルは、値丸めを行った後の指数部が :attr:`Emax` より大きいことを示し" +"ます。シグナルをトラップしない場合、演算結果は値丸めのモードにより、表現可能" +"な最大の数値になるように内側へ引き込んで丸めを行った値か、 :const:`Infinity` " +"になるように外側に丸めた値のいずれかになります。いずれの場合も、 :class:" +"`Inexact` および :class:`Rounded` が同時にシグナルされます。" -#: ../../library/decimal.rst:1724 +#: ../../library/decimal.rst:1613 msgid "Rounding occurred though possibly no information was lost." msgstr "情報が全く失われていない場合も含み、値丸めが起きたときのシグナルです。" -#: ../../library/decimal.rst:1726 +#: ../../library/decimal.rst:1615 msgid "" "Signaled whenever rounding discards digits; even if those digits are zero " -"(such as rounding ``5.00`` to ``5.0``). If not trapped, returns the result " -"unchanged. This signal is used to detect loss of significant digits." +"(such as rounding :const:`5.00` to :const:`5.0`). If not trapped, returns " +"the result unchanged. This signal is used to detect loss of significant " +"digits." msgstr "" "このシグナルは、値丸めによって桁がなくなると常に発生します。なくなった桁がゼ" -"ロ (例えば ``5.00`` を丸めて ``5.0`` になった場合) であってもです。このシグナ" -"ルをトラップしなければ、演算結果をそのまま返します。このシグナルは有効桁数の" -"減少を検出する際に使います。" +"ロ (例えば :const:`5.00` を丸めて :const:`5.0` になった場合) であってもです。" +"このシグナルをトラップしなければ、演算結果をそのまま返します。このシグナルは" +"有効桁数の減少を検出する際に使います。" -#: ../../library/decimal.rst:1734 -msgid "Exponent was lower than :attr:`~Context.Emin` prior to rounding." +#: ../../library/decimal.rst:1623 +msgid "Exponent was lower than :attr:`Emin` prior to rounding." msgstr "" -"値丸めを行う前に指数部が :attr:`~Context.Emin` より小さかったことを示すシグナ" -"ルです。" +"値丸めを行う前に指数部が :attr:`Emin` より小さかったことを示すシグナルです。" -#: ../../library/decimal.rst:1736 +#: ../../library/decimal.rst:1625 msgid "" "Occurs when an operation result is subnormal (the exponent is too small). If " "not trapped, returns the result unchanged." @@ -2488,11 +2141,11 @@ msgstr "" "演算結果が微小である場合 (指数が小さすぎる場合) に発生します。このシグナルを" "トラップしなければ、演算結果をそのまま返します。" -#: ../../library/decimal.rst:1742 +#: ../../library/decimal.rst:1631 msgid "Numerical underflow with result rounded to zero." msgstr "演算結果が値丸めによってゼロになった場合に生じる数値アンダフローです。" -#: ../../library/decimal.rst:1744 +#: ../../library/decimal.rst:1633 msgid "" "Occurs when a subnormal result is pushed to zero by rounding. :class:" "`Inexact` and :class:`Subnormal` are also signaled." @@ -2500,11 +2153,11 @@ msgstr "" "演算結果が微小なため、値丸めによってゼロになった場合に発生します。 :class:" "`Inexact` および :class:`Subnormal` シグナルも同時に発生します。" -#: ../../library/decimal.rst:1750 +#: ../../library/decimal.rst:1639 msgid "Enable stricter semantics for mixing floats and Decimals." msgstr "float と Decimal の混合の厳密なセマンティクスを有効にします。" -#: ../../library/decimal.rst:1752 +#: ../../library/decimal.rst:1641 msgid "" "If the signal is not trapped (default), mixing floats and Decimals is " "permitted in the :class:`~decimal.Decimal` constructor, :meth:`~decimal." @@ -2522,7 +2175,7 @@ msgstr "" "`~decimal.Context.create_decimal_from_float` による明示的な変換はフラグを設定" "しません。" -#: ../../library/decimal.rst:1760 +#: ../../library/decimal.rst:1649 msgid "" "Otherwise (the signal is trapped), only equality comparisons and explicit " "conversions are silent. All other mixed operations raise :exc:" @@ -2531,73 +2184,43 @@ msgstr "" "そうでなければ (シグナルがトラップされれば)、等価性比較および明示的な変換のみ" "が静かにに行われ、その他の混合演算は :exc:`FloatOperation` を送出します。" -#: ../../library/decimal.rst:1764 +#: ../../library/decimal.rst:1653 msgid "The following table summarizes the hierarchy of signals::" msgstr "これらのシグナルの階層構造をまとめると、以下の表のようになります::" -#: ../../library/decimal.rst:1766 -msgid "" -"exceptions.ArithmeticError(exceptions.Exception)\n" -" DecimalException\n" -" Clamped\n" -" DivisionByZero(DecimalException, exceptions.ZeroDivisionError)\n" -" Inexact\n" -" Overflow(Inexact, Rounded)\n" -" Underflow(Inexact, Rounded, Subnormal)\n" -" InvalidOperation\n" -" Rounded\n" -" Subnormal\n" -" FloatOperation(DecimalException, exceptions.TypeError)" -msgstr "" - -#: ../../library/decimal.rst:1785 -msgid "Floating-point notes" -msgstr "" +#: ../../library/decimal.rst:1674 +msgid "Floating Point Notes" +msgstr "浮動小数点数に関する注意" -#: ../../library/decimal.rst:1789 +#: ../../library/decimal.rst:1678 msgid "Mitigating round-off error with increased precision" msgstr "精度を上げて丸め誤差を抑制する" -#: ../../library/decimal.rst:1791 +#: ../../library/decimal.rst:1680 msgid "" "The use of decimal floating point eliminates decimal representation error " -"(making it possible to represent ``0.1`` exactly); however, some operations " -"can still incur round-off error when non-zero digits exceed the fixed " -"precision." +"(making it possible to represent :const:`0.1` exactly); however, some " +"operations can still incur round-off error when non-zero digits exceed the " +"fixed precision." msgstr "" -"十進浮動小数点数を使うと、十進数表現による誤差を抑制できます (``0.1`` を正確" -"に表現できるようになります); しかし、ゼロでない桁が一定の精度を越えている場合" -"には、演算によっては依然として値丸めによる誤差を引き起こします。" +"十進浮動小数点数を使うと、十進数表現による誤差を抑制できます (:const:`0.1` を" +"正確に表現できるようになります); しかし、ゼロでない桁が一定の精度を越えている" +"場合には、演算によっては依然として値丸めによる誤差を引き起こします。" -#: ../../library/decimal.rst:1795 +#: ../../library/decimal.rst:1684 msgid "" "The effects of round-off error can be amplified by the addition or " "subtraction of nearly offsetting quantities resulting in loss of " "significance. Knuth provides two instructive examples where rounded " -"floating-point arithmetic with insufficient precision causes the breakdown " +"floating point arithmetic with insufficient precision causes the breakdown " "of the associative and distributive properties of addition:" msgstr "" +"値丸めによる誤差の影響は、桁落ちを生じるような、ほとんど相殺される量での加算" +"や減算によって増幅されます。Knuth は、十分でない計算精度の下で値丸めを伴う浮" +"動小数点演算を行った結果、加算の結合則や分配則における恒等性が崩れてしまう例" +"を二つ示しています:" -#: ../../library/decimal.rst:1801 -msgid "" -"# Examples from Seminumerical Algorithms, Section 4.2.2.\n" -">>> from decimal import Decimal, getcontext\n" -">>> getcontext().prec = 8\n" -"\n" -">>> u, v, w = Decimal(11111113), Decimal(-11111111), Decimal('7.51111111')\n" -">>> (u + v) + w\n" -"Decimal('9.5111111')\n" -">>> u + (v + w)\n" -"Decimal('10')\n" -"\n" -">>> u, v, w = Decimal(20000), Decimal(-6), Decimal('6.0000003')\n" -">>> (u*v) + (u*w)\n" -"Decimal('0.01')\n" -">>> u * (v+w)\n" -"Decimal('0.0060000')" -msgstr "" - -#: ../../library/decimal.rst:1819 +#: ../../library/decimal.rst:1708 msgid "" "The :mod:`decimal` module makes it possible to restore the identities by " "expanding the precision sufficiently to avoid loss of significance:" @@ -2605,37 +2228,21 @@ msgstr "" ":mod:`decimal` モジュールでは、最下桁を失わないように十分に計算精度を広げるこ" "とで、上で問題にしたような恒等性をとりもどせます:" -#: ../../library/decimal.rst:1822 -msgid "" -">>> getcontext().prec = 20\n" -">>> u, v, w = Decimal(11111113), Decimal(-11111111), Decimal('7.51111111')\n" -">>> (u + v) + w\n" -"Decimal('9.51111111')\n" -">>> u + (v + w)\n" -"Decimal('9.51111111')\n" -">>>\n" -">>> u, v, w = Decimal(20000), Decimal(-6), Decimal('6.0000003')\n" -">>> (u*v) + (u*w)\n" -"Decimal('0.0060000')\n" -">>> u * (v+w)\n" -"Decimal('0.0060000')" -msgstr "" - -#: ../../library/decimal.rst:1839 +#: ../../library/decimal.rst:1728 msgid "Special values" msgstr "特殊値" -#: ../../library/decimal.rst:1841 +#: ../../library/decimal.rst:1730 msgid "" "The number system for the :mod:`decimal` module provides special values " -"including ``NaN``, ``sNaN``, ``-Infinity``, ``Infinity``, and two zeros, " -"``+0`` and ``-0``." +"including :const:`NaN`, :const:`sNaN`, :const:`-Infinity`, :const:" +"`Infinity`, and two zeros, :const:`+0` and :const:`-0`." msgstr "" -":mod:`decimal` モジュールの数体系では、 ``NaN``, ``sNaN``, ``-Infinity`` " -"``Infinity``, および二つのゼロ、 ``+0`` と ``-0`` といった特殊な値を提供して" -"います。" +":mod:`decimal` モジュールの数体系では、 :const:`NaN`, :const:`sNaN`, :const:" +"`-Infinity`, :const:`Infinity`, および二つのゼロ、 :const:`+0` と :const:" +"`-0` といった特殊な値を提供しています。" -#: ../../library/decimal.rst:1845 +#: ../../library/decimal.rst:1734 msgid "" "Infinities can be constructed directly with: ``Decimal('Infinity')``. Also, " "they can arise from dividing by zero when the :exc:`DivisionByZero` signal " @@ -2648,7 +2255,7 @@ msgstr "" "に、 :exc:`Overflow` シグナルをトラップしなければ、表現可能な最大の数値の制限" "を越えた値を丸めたときに出てきます。" -#: ../../library/decimal.rst:1850 +#: ../../library/decimal.rst:1739 msgid "" "The infinities are signed (affine) and can be used in arithmetic operations " "where they get treated as very large, indeterminate numbers. For instance, " @@ -2658,64 +2265,64 @@ msgstr "" "大で不確定の(indeterminate)値として扱われます。例えば、無限大に何らかの定数を" "加算すると、演算結果は別の無限大になります。" -#: ../../library/decimal.rst:1854 +#: ../../library/decimal.rst:1743 msgid "" -"Some operations are indeterminate and return ``NaN``, or if the :exc:" +"Some operations are indeterminate and return :const:`NaN`, or if the :exc:" "`InvalidOperation` signal is trapped, raise an exception. For example, " -"``0/0`` returns ``NaN`` which means \"not a number\". This variety of " -"``NaN`` is quiet and, once created, will flow through other computations " -"always resulting in another ``NaN``. This behavior can be useful for a " +"``0/0`` returns :const:`NaN` which means \"not a number\". This variety of :" +"const:`NaN` is quiet and, once created, will flow through other computations " +"always resulting in another :const:`NaN`. This behavior can be useful for a " "series of computations that occasionally have missing inputs --- it allows " "the calculation to proceed while flagging specific results as invalid." msgstr "" -"演算によっては結果が不確定になるものがあり、 ``NaN`` を返します。ただし、 :" -"exc:`InvalidOperation` シグナルをトラップするようになっていれば例外を送出しま" -"す。例えば、 ``0/0`` は ``NaN`` を返します。 ``NaN`` は「非数値 (not a " -"number)」を表します。このような ``NaN`` は暗黙のうちに生成され、一度生成され" -"るとそれを他の計算にも流れてゆき、関係する個々の演算全てが個別の ``NaN`` を返" -"すようになります。この挙動は、たまに入力値が欠けるような状況で一連の計算を行" -"う際に便利です --- 特定の計算に対しては無効な結果を示すフラグを立てつつ計算を" -"進められるからです。" +"演算によっては結果が不確定になるものがあり、 :const:`NaN` を返します。ただ" +"し、 :exc:`InvalidOperation` シグナルをトラップするようになっていれば例外を送" +"出します。例えば、 ``0/0`` は :const:`NaN` を返します。 :const:`NaN` は「非数" +"値 (not a number)」を表します。このような :const:`NaN` は暗黙のうちに生成さ" +"れ、一度生成されるとそれを他の計算にも流れてゆき、関係する個々の演算全てが個" +"別の :const:`NaN` を返すようになります。この挙動は、たまに入力値が欠けるよう" +"な状況で一連の計算を行う際に便利です --- 特定の計算に対しては無効な結果を示す" +"フラグを立てつつ計算を進められるからです。" -#: ../../library/decimal.rst:1862 +#: ../../library/decimal.rst:1751 msgid "" -"A variant is ``sNaN`` which signals rather than remaining quiet after every " -"operation. This is a useful return value when an invalid result needs to " -"interrupt a calculation for special handling." +"A variant is :const:`sNaN` which signals rather than remaining quiet after " +"every operation. This is a useful return value when an invalid result needs " +"to interrupt a calculation for special handling." msgstr "" -"一方、 ``NaN`` の変種である ``sNaN`` は関係する全ての演算で演算後にシグナルを" -"送出します。 ``sNaN`` は、無効な演算結果に対して特別な処理を行うために計算を" -"停止する必要がある場合に便利です。" +"一方、 :const:`NaN` の変種である :const:`sNaN` は関係する全ての演算で演算後に" +"シグナルを送出します。 :const:`sNaN` は、無効な演算結果に対して特別な処理を行" +"うために計算を停止する必要がある場合に便利です。" -#: ../../library/decimal.rst:1866 +#: ../../library/decimal.rst:1755 msgid "" "The behavior of Python's comparison operators can be a little surprising " -"where a ``NaN`` is involved. A test for equality where one of the operands " -"is a quiet or signaling ``NaN`` always returns :const:`False` (even when " -"doing ``Decimal('NaN')==Decimal('NaN')``), while a test for inequality " -"always returns :const:`True`. An attempt to compare two Decimals using any " -"of the ``<``, ``<=``, ``>`` or ``>=`` operators will raise the :exc:" -"`InvalidOperation` signal if either operand is a ``NaN``, and return :const:" -"`False` if this signal is not trapped. Note that the General Decimal " -"Arithmetic specification does not specify the behavior of direct " -"comparisons; these rules for comparisons involving a ``NaN`` were taken from " -"the IEEE 854 standard (see Table 3 in section 5.7). To ensure strict " -"standards-compliance, use the :meth:`~Decimal.compare` and :meth:`~Decimal." -"compare_signal` methods instead." -msgstr "" -"Python の比較演算は ``NaN`` が関わってくると少し驚くようなことがあります。等" -"価性のテストの一方の対象が無言または発信 ``NaN`` である場合いつでも :const:" -"`False` を返し(たとえ ``Decimal('NaN')==Decimal('NaN')`` でも)、一方で不等価" -"をテストするといつでも :const:`True` を返します。二つの Decimal を ``<``, " -"``<=``, ``>`` または ``>=`` を使って比較する試みは一方が ``NaN`` である場合に" -"は :exc:`InvalidOperation` シグナルを送出し、このシグナルをトラップしなければ" -"結果は :const:`False` に終わります。汎用十進演算仕様は直接の比較の振る舞いに" -"ついて定めていないことに注意しておきましょう。ここでの ``NaN`` が関係する比較" -"ルールは IEEE 854 標準から持ってきました (section 5.7 の Table 3 を見て下さ" -"い)。厳格に標準遵守を貫くなら、 :meth:`~Decimal.compare` および :meth:" -"`~Decimal.compare_signal` メソッドを代わりに使いましょう。" - -#: ../../library/decimal.rst:1879 +"where a :const:`NaN` is involved. A test for equality where one of the " +"operands is a quiet or signaling :const:`NaN` always returns :const:`False` " +"(even when doing ``Decimal('NaN')==Decimal('NaN')``), while a test for " +"inequality always returns :const:`True`. An attempt to compare two Decimals " +"using any of the ``<``, ``<=``, ``>`` or ``>=`` operators will raise the :" +"exc:`InvalidOperation` signal if either operand is a :const:`NaN`, and " +"return :const:`False` if this signal is not trapped. Note that the General " +"Decimal Arithmetic specification does not specify the behavior of direct " +"comparisons; these rules for comparisons involving a :const:`NaN` were taken " +"from the IEEE 854 standard (see Table 3 in section 5.7). To ensure strict " +"standards-compliance, use the :meth:`compare` and :meth:`compare-signal` " +"methods instead." +msgstr "" +"Python の比較演算は :const:`NaN` が関わってくると少し驚くようなことがありま" +"す。等価性のテストの一方の対象が無言または発信 :const:`NaN` である場合いつで" +"も :const:`False` を返し(たとえ ``Decimal('NaN')==Decimal('NaN')`` でも)、一" +"方で不等価をテストするといつでも :const:`True` を返します。二つの Decimal を " +"``<``, ``<=``, ``>`` または ``>=`` を使って比較する試みは一方が :const:`NaN` " +"である場合には :exc:`InvalidOperation` シグナルを送出し、このシグナルをトラッ" +"プしなければ結果は :const:`False` に終わります。汎用十進演算仕様は直接の比較" +"の振る舞いについて定めていないことに注意しておきましょう。ここでの :const:" +"`NaN` が関係する比較ルールは IEEE 854 標準から持ってきました (section 5.7 の " +"Table 3 を見て下さい)。厳格に標準遵守を貫くなら、 :meth:`compare` および :" +"meth:`compare-signal` メソッドを代わりに使いましょう。" + +#: ../../library/decimal.rst:1768 msgid "" "The signed zeros can result from calculations that underflow. They keep the " "sign that would have resulted if the calculation had been carried out to " @@ -2727,20 +2334,24 @@ msgstr "" "ロの大きさはやはりゼロなので、正のゼロと負のゼロは等しいとみなされ、符号は単" "なる参考にすぎません。" -#: ../../library/decimal.rst:1884 +#: ../../library/decimal.rst:1773 msgid "" "In addition to the two signed zeros which are distinct yet equal, there are " "various representations of zero with differing precisions yet equivalent in " "value. This takes a bit of getting used to. For an eye accustomed to " -"normalized floating-point representations, it is not immediately obvious " +"normalized floating point representations, it is not immediately obvious " "that the following calculation returns a value equal to zero:" msgstr "" +"二つの符号付きゼロが区別されているのに等価であることに加えて、異なる精度にお" +"けるゼロの表現はまちまちなのに、値は等価とみなされるということがあります。こ" +"れに慣れるには多少時間がかかります。正規化浮動小数点表現に目が慣れてしまう" +"と、以下の計算でゼロに等しい値が返っているとは即座に分かりません:" -#: ../../library/decimal.rst:1899 +#: ../../library/decimal.rst:1788 msgid "Working with threads" msgstr "スレッドを使った処理" -#: ../../library/decimal.rst:1901 +#: ../../library/decimal.rst:1790 msgid "" "The :func:`getcontext` function accesses a different :class:`Context` object " "for each thread. Having separate thread contexts means that threads may " @@ -2752,7 +2363,7 @@ msgstr "" "が互いに影響を及ぼさずに (``getcontext().prec=10`` のような) 変更を適用できる" "ということです。" -#: ../../library/decimal.rst:1905 +#: ../../library/decimal.rst:1794 msgid "" "Likewise, the :func:`setcontext` function automatically assigns its target " "to the current thread." @@ -2760,53 +2371,36 @@ msgstr "" "同様に、:func:`setcontext` 関数は自動的に引数のコンテキストを現在のスレッドの" "コンテキストに設定します。" -#: ../../library/decimal.rst:1908 +#: ../../library/decimal.rst:1797 msgid "" "If :func:`setcontext` has not been called before :func:`getcontext`, then :" "func:`getcontext` will automatically create a new context for use in the " -"current thread. New context objects have default values set from the :data:" -"`decimal.DefaultContext` object." -msgstr "" - -#: ../../library/decimal.rst:1913 -msgid "" -"The :data:`sys.flags.thread_inherit_context` flag affects the context for " -"new threads. If the flag is false, new threads will start with an empty " -"context. In this case, :func:`getcontext` will create a new context object " -"when called and use the default values from *DefaultContext*. If the flag " -"is true, new threads will start with a copy of context from the caller of :" -"meth:`threading.Thread.start`." +"current thread." msgstr "" +":func:`getcontext` を呼び出す前に :func:`setcontext` が呼び出されていなけれ" +"ば、現在のスレッドで使うための新たなコンテキストを生成するために :func:" +"`getcontext` が自動的に呼び出されます。" -#: ../../library/decimal.rst:1920 +#: ../../library/decimal.rst:1801 msgid "" +"The new context is copied from a prototype context called *DefaultContext*. " "To control the defaults so that each thread will use the same values " "throughout the application, directly modify the *DefaultContext* object. " "This should be done *before* any threads are started so that there won't be " "a race condition between threads calling :func:`getcontext`. For example::" msgstr "" +"新たなコンテキストは、*DefaultContext* と呼ばれる雛形からコピーされます。アプ" +"リケーションを通じて全てのスレッドに同じ値を使うようにデフォルトを設定したけ" +"れば、*DefaultContext* オブジェクトを直接変更します。 :func:`getcontext` を呼" +"び出すスレッド間で競合条件が生じないようにするため、*DefaultContext* への変更" +"はいかなるスレッドを開始するよりも *前に* 行わなければなりません。以下に例を" +"示します::" -#: ../../library/decimal.rst:1925 -msgid "" -"# Set applicationwide defaults for all threads about to be launched\n" -"DefaultContext.prec = 12\n" -"DefaultContext.rounding = ROUND_DOWN\n" -"DefaultContext.traps = ExtendedContext.traps.copy()\n" -"DefaultContext.traps[InvalidOperation] = 1\n" -"setcontext(DefaultContext)\n" -"\n" -"# Afterwards, the threads can be started\n" -"t1.start()\n" -"t2.start()\n" -"t3.start()\n" -" . . ." -msgstr "" - -#: ../../library/decimal.rst:1944 +#: ../../library/decimal.rst:1826 msgid "Recipes" msgstr "レシピ" -#: ../../library/decimal.rst:1946 +#: ../../library/decimal.rst:1828 msgid "" "Here are a few recipes that serve as utility functions and that demonstrate " "ways to work with the :class:`Decimal` class::" @@ -2814,160 +2408,11 @@ msgstr "" ":class:`Decimal` クラスの利用を実演している例をいくつか示します。これらはユー" "ティリティ関数としても利用できます::" -#: ../../library/decimal.rst:1949 -msgid "" -"def moneyfmt(value, places=2, curr='', sep=',', dp='.',\n" -" pos='', neg='-', trailneg=''):\n" -" \"\"\"Convert Decimal to a money formatted string.\n" -"\n" -" places: required number of places after the decimal point\n" -" curr: optional currency symbol before the sign (may be blank)\n" -" sep: optional grouping separator (comma, period, space, or blank)\n" -" dp: decimal point indicator (comma or period)\n" -" only specify as blank when places is zero\n" -" pos: optional sign for positive numbers: '+', space or blank\n" -" neg: optional sign for negative numbers: '-', '(', space or blank\n" -" trailneg:optional trailing minus indicator: '-', ')', space or blank\n" -"\n" -" >>> d = Decimal('-1234567.8901')\n" -" >>> moneyfmt(d, curr='$')\n" -" '-$1,234,567.89'\n" -" >>> moneyfmt(d, places=0, sep='.', dp='', neg='', trailneg='-')\n" -" '1.234.568-'\n" -" >>> moneyfmt(d, curr='$', neg='(', trailneg=')')\n" -" '($1,234,567.89)'\n" -" >>> moneyfmt(Decimal(123456789), sep=' ')\n" -" '123 456 789.00'\n" -" >>> moneyfmt(Decimal('-0.02'), neg='<', trailneg='>')\n" -" '<0.02>'\n" -"\n" -" \"\"\"\n" -" q = Decimal(10) ** -places # 2 places --> '0.01'\n" -" sign, digits, exp = value.quantize(q).as_tuple()\n" -" result = []\n" -" digits = list(map(str, digits))\n" -" build, next = result.append, digits.pop\n" -" if sign:\n" -" build(trailneg)\n" -" for i in range(places):\n" -" build(next() if digits else '0')\n" -" if places:\n" -" build(dp)\n" -" if not digits:\n" -" build('0')\n" -" i = 0\n" -" while digits:\n" -" build(next())\n" -" i += 1\n" -" if i == 3 and digits:\n" -" i = 0\n" -" build(sep)\n" -" build(curr)\n" -" build(neg if sign else pos)\n" -" return ''.join(reversed(result))\n" -"\n" -"def pi():\n" -" \"\"\"Compute Pi to the current precision.\n" -"\n" -" >>> print(pi())\n" -" 3.141592653589793238462643383\n" -"\n" -" \"\"\"\n" -" getcontext().prec += 2 # extra digits for intermediate steps\n" -" three = Decimal(3) # substitute \"three=3.0\" for regular floats\n" -" lasts, t, s, n, na, d, da = 0, three, 3, 1, 0, 0, 24\n" -" while s != lasts:\n" -" lasts = s\n" -" n, na = n+na, na+8\n" -" d, da = d+da, da+32\n" -" t = (t * n) / d\n" -" s += t\n" -" getcontext().prec -= 2\n" -" return +s # unary plus applies the new precision\n" -"\n" -"def exp(x):\n" -" \"\"\"Return e raised to the power of x. Result type matches input " -"type.\n" -"\n" -" >>> print(exp(Decimal(1)))\n" -" 2.718281828459045235360287471\n" -" >>> print(exp(Decimal(2)))\n" -" 7.389056098930650227230427461\n" -" >>> print(exp(2.0))\n" -" 7.38905609893\n" -" >>> print(exp(2+0j))\n" -" (7.38905609893+0j)\n" -"\n" -" \"\"\"\n" -" getcontext().prec += 2\n" -" i, lasts, s, fact, num = 0, 0, 1, 1, 1\n" -" while s != lasts:\n" -" lasts = s\n" -" i += 1\n" -" fact *= i\n" -" num *= x\n" -" s += num / fact\n" -" getcontext().prec -= 2\n" -" return +s\n" -"\n" -"def cos(x):\n" -" \"\"\"Return the cosine of x as measured in radians.\n" -"\n" -" The Taylor series approximation works best for a small value of x.\n" -" For larger values, first compute x = x % (2 * pi).\n" -"\n" -" >>> print(cos(Decimal('0.5')))\n" -" 0.8775825618903727161162815826\n" -" >>> print(cos(0.5))\n" -" 0.87758256189\n" -" >>> print(cos(0.5+0j))\n" -" (0.87758256189+0j)\n" -"\n" -" \"\"\"\n" -" getcontext().prec += 2\n" -" i, lasts, s, fact, num, sign = 0, 0, 1, 1, 1, 1\n" -" while s != lasts:\n" -" lasts = s\n" -" i += 2\n" -" fact *= i * (i-1)\n" -" num *= x * x\n" -" sign *= -1\n" -" s += num / fact * sign\n" -" getcontext().prec -= 2\n" -" return +s\n" -"\n" -"def sin(x):\n" -" \"\"\"Return the sine of x as measured in radians.\n" -"\n" -" The Taylor series approximation works best for a small value of x.\n" -" For larger values, first compute x = x % (2 * pi).\n" -"\n" -" >>> print(sin(Decimal('0.5')))\n" -" 0.4794255386042030002732879352\n" -" >>> print(sin(0.5))\n" -" 0.479425538604\n" -" >>> print(sin(0.5+0j))\n" -" (0.479425538604+0j)\n" -"\n" -" \"\"\"\n" -" getcontext().prec += 2\n" -" i, lasts, s, fact, num, sign = 1, 0, x, 1, x, 1\n" -" while s != lasts:\n" -" lasts = s\n" -" i += 2\n" -" fact *= i * (i-1)\n" -" num *= x * x\n" -" sign *= -1\n" -" s += num / fact * sign\n" -" getcontext().prec -= 2\n" -" return +s" -msgstr "" - -#: ../../library/decimal.rst:2101 +#: ../../library/decimal.rst:1983 msgid "Decimal FAQ" msgstr "Decimal FAQ" -#: ../../library/decimal.rst:2103 +#: ../../library/decimal.rst:1985 msgid "" "Q. It is cumbersome to type ``decimal.Decimal('1234.5')``. Is there a way " "to minimize typing when using the interactive interpreter?" @@ -2975,11 +2420,11 @@ msgstr "" "Q. ``decimal.Decimal('1234.5')`` などと打ち込むのは煩わしいのですが、対話式イ" "ンタプリタを使う際にタイプ量を少なくする方法はありませんか?" -#: ../../library/decimal.rst:2106 +#: ../../library/decimal.rst:1988 msgid "A. Some users abbreviate the constructor to just a single letter:" msgstr "A. コンストラクタを1文字に縮める人もいるようです:" -#: ../../library/decimal.rst:2112 +#: ../../library/decimal.rst:1994 msgid "" "Q. In a fixed-point application with two decimal places, some inputs have " "many places and need to be rounded. Others are not supposed to have excess " @@ -2989,16 +2434,15 @@ msgstr "" "な桁を保持しているのでこれを丸めなければなりません。その他のものに余計な桁は" "なくそのまま使えます。どのメソッドを使うのがいいでしょうか?" -#: ../../library/decimal.rst:2116 +#: ../../library/decimal.rst:1998 msgid "" -"A. The :meth:`~Decimal.quantize` method rounds to a fixed number of decimal " -"places. If the :const:`Inexact` trap is set, it is also useful for " -"validation:" +"A. The :meth:`quantize` method rounds to a fixed number of decimal places. " +"If the :const:`Inexact` trap is set, it is also useful for validation:" msgstr "" -"A. :meth:`~Decimal.quantize` メソッドで固定した桁に丸められます。 :const:" -"`Inexact` トラップを設定しておけば、確認にも有用です:" +"A. :meth:`quantize` メソッドで固定した桁に丸められます。 :const:`Inexact` ト" +"ラップを設定しておけば、確認にも有用です:" -#: ../../library/decimal.rst:2134 +#: ../../library/decimal.rst:2016 msgid "" "Q. Once I have valid two place inputs, how do I maintain that invariant " "throughout an application?" @@ -3006,73 +2450,44 @@ msgstr "" "Q. 正当な2桁の入力が得られたとして、その正当性をアプリケーション実行中も変わ" "らず保ち続けるにはどうすればいいでしょうか?" -#: ../../library/decimal.rst:2137 +#: ../../library/decimal.rst:2019 msgid "" "A. Some operations like addition, subtraction, and multiplication by an " "integer will automatically preserve fixed point. Others operations, like " "division and non-integer multiplication, will change the number of decimal " -"places and need to be followed-up with a :meth:`~Decimal.quantize` step:" +"places and need to be followed-up with a :meth:`quantize` step:" msgstr "" "A. 加減算あるいは整数との乗算のような演算は自動的に固定小数点を守ります。その" "他の除算や整数以外の乗算などは小数点以下の桁を変えてしまいますので実行後は :" -"meth:`~Decimal.quantize` ステップが必要です:" +"meth:`quantize` ステップが必要です:" -#: ../../library/decimal.rst:2155 +#: ../../library/decimal.rst:2037 msgid "" "In developing fixed-point applications, it is convenient to define functions " -"to handle the :meth:`~Decimal.quantize` step:" -msgstr "" -"固定小数点のアプリケーションを開発する際は、 :meth:`~Decimal.quantize` の段階" -"を扱う関数を定義しておくと便利です:" - -#: ../../library/decimal.rst:2169 -msgid "" -"Q. There are many ways to express the same value. The numbers ``200``, " -"``200.000``, ``2E2``, and ``.02E+4`` all have the same value at various " -"precisions. Is there a way to transform them to a single recognizable " -"canonical value?" -msgstr "" -"Q. 一つの値に対して多くの表現方法があります。 ``200`` と ``200.000`` と " -"``2E2`` と ``.02E+4`` は全て同じ値で違った精度の数です。これらをただ一つの正" -"規化された値に変換することはできますか?" - -#: ../../library/decimal.rst:2174 -msgid "" -"A. The :meth:`~Decimal.normalize` method maps all equivalent values to a " -"single representative:" +"to handle the :meth:`quantize` step:" msgstr "" -"A. :meth:`~Decimal.normalize` メソッドは全ての等しい値をただ一つの表現に直し" -"ます:" +"固定小数点のアプリケーションを開発する際は、 :meth:`quantize` の段階を扱う関" +"数を定義しておくと便利です:" -#: ../../library/decimal.rst:2181 -msgid "Q. When does rounding occur in a computation?" -msgstr "" - -#: ../../library/decimal.rst:2183 +#: ../../library/decimal.rst:2050 msgid "" -"A. It occurs *after* the computation. The philosophy of the decimal " -"specification is that numbers are considered exact and are created " -"independent of the current context. They can even have greater precision " -"than current context. Computations process with those exact inputs and then " -"rounding (or other context operations) is applied to the *result* of the " -"computation::" +"Q. There are many ways to express the same value. The numbers :const:" +"`200`, :const:`200.000`, :const:`2E2`, and :const:`.02E+4` all have the same " +"value at various precisions. Is there a way to transform them to a single " +"recognizable canonical value?" msgstr "" +"Q. 一つの値に対して多くの表現方法があります。 :const:`200` と :const:" +"`200.000` と :const:`2E2` と :const:`.02E+4` は全て同じ値で違った精度の数で" +"す。これらをただ一つの正規化された値に変換することはできますか?" -#: ../../library/decimal.rst:2190 +#: ../../library/decimal.rst:2055 msgid "" -">>> getcontext().prec = 5\n" -">>> pi = Decimal('3.1415926535') # More than 5 digits\n" -">>> pi # All digits are retained\n" -"Decimal('3.1415926535')\n" -">>> pi + 0 # Rounded after an addition\n" -"Decimal('3.1416')\n" -">>> pi - Decimal('0.00005') # Subtract unrounded numbers, then round\n" -"Decimal('3.1415')\n" -">>> pi + 0 - Decimal('0.00005'). # Intermediate values are rounded\n" -"Decimal('3.1416')" +"A. The :meth:`normalize` method maps all equivalent values to a single " +"representative:" msgstr "" +"A. :meth:`normalize` メソッドは全ての等しい値をただ一つの表現に直します:" -#: ../../library/decimal.rst:2201 +#: ../../library/decimal.rst:2062 msgid "" "Q. Some decimal values always print with exponential notation. Is there a " "way to get a non-exponential representation?" @@ -3080,18 +2495,18 @@ msgstr "" "Q. ある種の十進数値はいつも指数表記で表示されます。指数表記以外の表示にする方" "法はありますか?" -#: ../../library/decimal.rst:2204 +#: ../../library/decimal.rst:2065 msgid "" "A. For some values, exponential notation is the only way to express the " -"number of significant places in the coefficient. For example, expressing " -"``5.0E+3`` as ``5000`` keeps the value constant but cannot show the " +"number of significant places in the coefficient. For example, expressing :" +"const:`5.0E+3` as :const:`5000` keeps the value constant but cannot show the " "original's two-place significance." msgstr "" -"A. 値によっては、指数表記だけが有効桁数を表せる表記法なのです。たとえば、 " -"``5.0E+3`` を ``5000`` と表してしまうと、値は変わりませんが元々の2桁という有" -"効数字が反映されません。" +"A. 値によっては、指数表記だけが有効桁数を表せる表記法なのです。たとえば、 :" +"const:`5.0E+3` を :const:`5000` と表してしまうと、値は変わりませんが元々の2桁" +"という有効数字が反映されません。" -#: ../../library/decimal.rst:2209 +#: ../../library/decimal.rst:2070 msgid "" "If an application does not care about tracking significance, it is easy to " "remove the exponent and trailing zeroes, losing significance, but keeping " @@ -3100,24 +2515,20 @@ msgstr "" "もしアプリケーションが有効数字の追跡を等閑視するならば、指数部や末尾のゼロを" "取り除き、有効数字を忘れ、しかし値を変えずにおくことは容易です:" -#: ../../library/decimal.rst:2219 +#: ../../library/decimal.rst:2080 msgid "Q. Is there a way to convert a regular float to a :class:`Decimal`?" msgstr "Q. 普通の float を :class:`Decimal` に変換できますか?" -#: ../../library/decimal.rst:2221 +#: ../../library/decimal.rst:2082 msgid "" -"A. Yes, any binary floating-point number can be exactly expressed as a " +"A. Yes, any binary floating point number can be exactly expressed as a " "Decimal though an exact conversion may take more precision than intuition " "would suggest:" msgstr "" +"A. はい。どんな 2 進浮動小数点数も Decimal として正確に表現できます。ただし、" +"正確な変換は直感的に考えたよりも多い桁になることがあります:" -#: ../../library/decimal.rst:2225 -msgid "" -">>> Decimal(math.pi)\n" -"Decimal('3.141592653589793115997963468544185161590576171875')" -msgstr "" - -#: ../../library/decimal.rst:2230 +#: ../../library/decimal.rst:2091 msgid "" "Q. Within a complex calculation, how can I make sure that I haven't gotten a " "spurious result because of insufficient precision or rounding anomalies." @@ -3125,7 +2536,7 @@ msgstr "" "Q. 複雑な計算の中で、精度不足や丸めの異常で間違った結果になっていないことをど" "うやって保証すれば良いでしょうか。" -#: ../../library/decimal.rst:2233 +#: ../../library/decimal.rst:2094 msgid "" "A. The decimal module makes it easy to test results. A best practice is to " "re-run calculations using greater precision and with various rounding modes. " @@ -3137,7 +2548,7 @@ msgstr "" "や丸めの問題や悪条件の入力、または数値計算的に不安定なアルゴリズムを示唆して" "います。" -#: ../../library/decimal.rst:2238 +#: ../../library/decimal.rst:2099 msgid "" "Q. I noticed that context precision is applied to the results of operations " "but not to the inputs. Is there anything to watch out for when mixing " @@ -3147,7 +2558,7 @@ msgstr "" "ようです。様々に異なる精度の入力値を混ぜて計算する時に注意すべきことはありま" "すか?" -#: ../../library/decimal.rst:2242 +#: ../../library/decimal.rst:2103 msgid "" "A. Yes. The principle is that all values are considered to be exact and so " "is the arithmetic on those values. Only the results are rounded. The " @@ -3160,16 +2571,7 @@ msgstr "" "get\" (打ち込んだ値が得られる値)という点にあります。入力が丸められないという" "ことを忘れていると結果が奇妙に見えるというのは弱点です:" -#: ../../library/decimal.rst:2247 -msgid "" -">>> getcontext().prec = 3\n" -">>> Decimal('3.104') + Decimal('2.104')\n" -"Decimal('5.21')\n" -">>> Decimal('3.104') + Decimal('0.000') + Decimal('2.104')\n" -"Decimal('5.20')" -msgstr "" - -#: ../../library/decimal.rst:2255 +#: ../../library/decimal.rst:2116 msgid "" "The solution is either to increase precision or to force rounding of inputs " "using the unary plus operation:" @@ -3177,14 +2579,7 @@ msgstr "" "解決策は、精度を増やすか、単項プラス演算子を使って入力の丸めを強制することで" "す:" -#: ../../library/decimal.rst:2258 -msgid "" -">>> getcontext().prec = 3\n" -">>> +Decimal('1.23456789') # unary plus triggers rounding\n" -"Decimal('1.23')" -msgstr "" - -#: ../../library/decimal.rst:2264 +#: ../../library/decimal.rst:2125 msgid "" "Alternatively, inputs can be rounded upon creation using the :meth:`Context." "create_decimal` method:" @@ -3192,99 +2587,64 @@ msgstr "" "もしくは、入力を :meth:`Context.create_decimal` を使って生成時に丸めてしまう" "こともできます:" -#: ../../library/decimal.rst:2270 +#: ../../library/decimal.rst:2131 msgid "Q. Is the CPython implementation fast for large numbers?" msgstr "Q. CPython 実装は大きな数に対しても速いでしょうか?" -#: ../../library/decimal.rst:2272 +#: ../../library/decimal.rst:2133 msgid "" "A. Yes. In the CPython and PyPy3 implementations, the C/CFFI versions of " "the decimal module integrate the high speed `libmpdec `_ library for arbitrary precision " -"correctly rounded decimal floating-point arithmetic [#]_. ``libmpdec`` uses " +"correctly-rounded decimal floating point arithmetic [#]_. ``libmpdec`` uses " "`Karatsuba multiplication `_ for medium-sized numbers and the `Number Theoretic " "Transform `_ for very " "large numbers." msgstr "" +"A. はい。CPython 実装と PyPy3 実装では、 C/CFFI 版の decimal モジュールは、任" +"意精度の正しい丸めを行う 10 進浮動小数点演算のための高速な `libmpdec `_ ライ" +"ブラリを統合しています。``libmpdec`` は `Karatsuba multiplication `_ を中程度" +"のサイズの数に対して使い、 `Number Theoretic Transform `_ を非常に大きな数に" +"対して使います。" -#: ../../library/decimal.rst:2282 +#: ../../library/decimal.rst:2143 msgid "" "The context must be adapted for exact arbitrary precision arithmetic. :attr:" -"`~Context.Emin` and :attr:`~Context.Emax` should always be set to the " -"maximum values, :attr:`~Context.clamp` should always be 0 (the default). " -"Setting :attr:`~Context.prec` requires some care." +"`Emin` and :attr:`Emax` should always be set to the maximum values, :attr:" +"`clamp` should always be 0 (the default). Setting :attr:`prec` requires " +"some care." msgstr "" -#: ../../library/decimal.rst:2286 +#: ../../library/decimal.rst:2147 msgid "" "The easiest approach for trying out bignum arithmetic is to use the maximum " -"value for :attr:`~Context.prec` as well [#]_::" -msgstr "" - -#: ../../library/decimal.rst:2289 -msgid "" -">>> setcontext(Context(prec=MAX_PREC, Emax=MAX_EMAX, Emin=MIN_EMIN))\n" -">>> x = Decimal(2) ** 256\n" -">>> x / 128\n" -"Decimal('904625697166532776746648320380374280103671755200316906558262375061821325312')" +"value for :attr:`prec` as well [#]_::" msgstr "" -#: ../../library/decimal.rst:2295 +#: ../../library/decimal.rst:2156 msgid "" -"For inexact results, :const:`MAX_PREC` is far too large on 64-bit platforms " +"For inexact results, :attr:`MAX_PREC` is far too large on 64-bit platforms " "and the available memory will be insufficient::" msgstr "" -#: ../../library/decimal.rst:2298 +#: ../../library/decimal.rst:2164 msgid "" -">>> Decimal(1) / 3\n" -"Traceback (most recent call last):\n" -" File \"\", line 1, in \n" -"MemoryError" +"On systems with overallocation (e.g. Linux), a more sophisticated approach " +"is to adjust :attr:`prec` to the amount of available RAM. Suppose that you " +"have 8GB of RAM and expect 10 simultaneous operands using a maximum of 500MB " +"each::" msgstr "" -#: ../../library/decimal.rst:2303 -msgid "" -"On systems with overallocation (e.g. Linux), a more sophisticated approach " -"is to adjust :attr:`~Context.prec` to the amount of available RAM. Suppose " -"that you have 8GB of RAM and expect 10 simultaneous operands using a maximum " -"of 500MB each::" -msgstr "" - -#: ../../library/decimal.rst:2307 -msgid "" -">>> import sys\n" -">>>\n" -">>> # Maximum number of digits for a single operand using 500MB in 8-byte " -"words\n" -">>> # with 19 digits per word (4-byte and 9 digits for the 32-bit build):\n" -">>> maxdigits = 19 * ((500 * 1024**2) // 8)\n" -">>>\n" -">>> # Check that this works:\n" -">>> c = Context(prec=maxdigits, Emax=MAX_EMAX, Emin=MIN_EMIN)\n" -">>> c.traps[Inexact] = True\n" -">>> setcontext(c)\n" -">>>\n" -">>> # Fill the available precision with nines:\n" -">>> x = Decimal(0).logical_invert() * 9\n" -">>> sys.getsizeof(x)\n" -"524288112\n" -">>> x + 2\n" -"Traceback (most recent call last):\n" -" File \"\", line 1, in \n" -" decimal.Inexact: []" -msgstr "" - -#: ../../library/decimal.rst:2327 +#: ../../library/decimal.rst:2188 msgid "" "In general (and especially on systems without overallocation), it is " "recommended to estimate even tighter bounds and set the :attr:`Inexact` trap " "if all calculations are expected to be exact." msgstr "" -#: ../../library/decimal.rst:2336 +#: ../../library/decimal.rst:2197 msgid "" "This approach now works for all exact results except for non-integer powers." msgstr "" diff --git a/library/development.po b/library/development.po index e9213b358..42056b07f 100644 --- a/library/development.po +++ b/library/development.po @@ -1,26 +1,26 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 -# 石井明久, 2024 +# Nozomu Kaneko , 2017 +# Arihiro TAKASE, 2017 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-13 14:21+0000\n" -"PO-Revision-Date: 2021-06-28 01:04+0000\n" -"Last-Translator: 石井明久, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 23:06+0000\n" +"Last-Translator: Arihiro TAKASE, 2017\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/development.rst:5 @@ -33,13 +33,16 @@ msgid "" "the :mod:`pydoc` module takes a module and generates documentation based on " "the module's contents. The :mod:`doctest` and :mod:`unittest` modules " "contains frameworks for writing unit tests that automatically exercise code " -"and verify that the expected output is produced." +"and verify that the expected output is produced. :program:`2to3` can " +"translate Python 2.x source code into valid Python 3.x code." msgstr "" "この章で紹介されるモジュールはソフトウェアを書くことを支援します。たとえ" "ば、 :mod:`pydoc` モジュールはモジュールの内容からドキュメントを生成しま" "す。 :mod:`doctest` と :mod:`unittest` モジュールでは、自動的に実行して予想通" -"りの出力が生成されるか確認するユニットテストを書くことができます。" +"りの出力が生成されるか確認するユニットテストを書くことができます。 :program:" +"`2to3` は Python2.x 用のソースコードを正当な Python 3.x コードに翻訳できま" +"す。" -#: ../../library/development.rst:13 +#: ../../library/development.rst:14 msgid "The list of modules described in this chapter is:" msgstr "この章で解説されるモジュールのリスト:" diff --git a/library/devmode.po b/library/devmode.po index c9c4058db..9fb0d781a 100644 --- a/library/devmode.po +++ b/library/devmode.po @@ -1,26 +1,26 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 -# Yusuke Miyazaki , 2021 +# tomo, 2020 +# Yusuke Miyazaki , 2020 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-13 14:21+0000\n" -"PO-Revision-Date: 2021-06-28 01:04+0000\n" -"Last-Translator: Yusuke Miyazaki , 2021\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2020-05-31 09:29+0000\n" +"Last-Translator: Yusuke Miyazaki , 2020\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/devmode.rst:4 @@ -41,158 +41,148 @@ msgid "" "setting the :envvar:`PYTHONDEVMODE` environment variable to ``1``." msgstr "" -#: ../../library/devmode.rst:16 -msgid "See also :ref:`Python debug build `." -msgstr "" - -#: ../../library/devmode.rst:19 +#: ../../library/devmode.rst:17 msgid "Effects of the Python Development Mode" msgstr "" -#: ../../library/devmode.rst:21 +#: ../../library/devmode.rst:19 msgid "" "Enabling the Python Development Mode is similar to the following command, " "but with additional effects described below::" msgstr "" #: ../../library/devmode.rst:24 -msgid "" -"PYTHONMALLOC=debug PYTHONASYNCIODEBUG=1 python -W default -X faulthandler" -msgstr "" - -#: ../../library/devmode.rst:26 msgid "Effects of the Python Development Mode:" msgstr "" -#: ../../library/devmode.rst:28 +#: ../../library/devmode.rst:26 msgid "" "Add ``default`` :ref:`warning filter `. The " "following warnings are shown:" msgstr "" -#: ../../library/devmode.rst:31 +#: ../../library/devmode.rst:29 msgid ":exc:`DeprecationWarning`" msgstr ":exc:`DeprecationWarning`" -#: ../../library/devmode.rst:32 +#: ../../library/devmode.rst:30 msgid ":exc:`ImportWarning`" msgstr ":exc:`ImportWarning`" -#: ../../library/devmode.rst:33 +#: ../../library/devmode.rst:31 msgid ":exc:`PendingDeprecationWarning`" msgstr ":exc:`PendingDeprecationWarning`" -#: ../../library/devmode.rst:34 +#: ../../library/devmode.rst:32 msgid ":exc:`ResourceWarning`" msgstr ":exc:`ResourceWarning`" -#: ../../library/devmode.rst:36 +#: ../../library/devmode.rst:34 msgid "" "Normally, the above warnings are filtered by the default :ref:`warning " "filters `." msgstr "" -#: ../../library/devmode.rst:39 +#: ../../library/devmode.rst:37 msgid "" "It behaves as if the :option:`-W default <-W>` command line option is used." msgstr "" -#: ../../library/devmode.rst:41 +#: ../../library/devmode.rst:39 msgid "" "Use the :option:`-W error <-W>` command line option or set the :envvar:" "`PYTHONWARNINGS` environment variable to ``error`` to treat warnings as " "errors." msgstr "" -#: ../../library/devmode.rst:45 +#: ../../library/devmode.rst:43 msgid "Install debug hooks on memory allocators to check for:" msgstr "" -#: ../../library/devmode.rst:47 +#: ../../library/devmode.rst:45 msgid "Buffer underflow" msgstr "" -#: ../../library/devmode.rst:48 +#: ../../library/devmode.rst:46 msgid "Buffer overflow" msgstr "" -#: ../../library/devmode.rst:49 +#: ../../library/devmode.rst:47 msgid "Memory allocator API violation" msgstr "" -#: ../../library/devmode.rst:50 +#: ../../library/devmode.rst:48 msgid "Unsafe usage of the GIL" msgstr "" -#: ../../library/devmode.rst:52 +#: ../../library/devmode.rst:50 msgid "See the :c:func:`PyMem_SetupDebugHooks` C function." msgstr "" -#: ../../library/devmode.rst:54 +#: ../../library/devmode.rst:52 msgid "" "It behaves as if the :envvar:`PYTHONMALLOC` environment variable is set to " "``debug``." msgstr "" -#: ../../library/devmode.rst:57 +#: ../../library/devmode.rst:55 msgid "" "To enable the Python Development Mode without installing debug hooks on " "memory allocators, set the :envvar:`PYTHONMALLOC` environment variable to " "``default``." msgstr "" -#: ../../library/devmode.rst:61 +#: ../../library/devmode.rst:59 msgid "" "Call :func:`faulthandler.enable` at Python startup to install handlers for " -"the :const:`~signal.SIGSEGV`, :const:`~signal.SIGFPE`, :const:`~signal." -"SIGABRT`, :const:`~signal.SIGBUS` and :const:`~signal.SIGILL` signals to " -"dump the Python traceback on a crash." +"the :const:`SIGSEGV`, :const:`SIGFPE`, :const:`SIGABRT`, :const:`SIGBUS` " +"and :const:`SIGILL` signals to dump the Python traceback on a crash." msgstr "" -#: ../../library/devmode.rst:66 +#: ../../library/devmode.rst:63 msgid "" "It behaves as if the :option:`-X faulthandler <-X>` command line option is " "used or if the :envvar:`PYTHONFAULTHANDLER` environment variable is set to " "``1``." msgstr "" -#: ../../library/devmode.rst:70 +#: ../../library/devmode.rst:67 msgid "" "Enable :ref:`asyncio debug mode `. For example, :mod:" "`asyncio` checks for coroutines that were not awaited and logs them." msgstr "" -#: ../../library/devmode.rst:73 +#: ../../library/devmode.rst:70 msgid "" "It behaves as if the :envvar:`PYTHONASYNCIODEBUG` environment variable is " "set to ``1``." msgstr "" -#: ../../library/devmode.rst:76 +#: ../../library/devmode.rst:73 msgid "" "Check the *encoding* and *errors* arguments for string encoding and decoding " "operations. Examples: :func:`open`, :meth:`str.encode` and :meth:`bytes." "decode`." msgstr "" -#: ../../library/devmode.rst:80 +#: ../../library/devmode.rst:77 msgid "" "By default, for best performance, the *errors* argument is only checked at " "the first encoding/decoding error and the *encoding* argument is sometimes " "ignored for empty strings." msgstr "" -#: ../../library/devmode.rst:84 +#: ../../library/devmode.rst:81 msgid "The :class:`io.IOBase` destructor logs ``close()`` exceptions." msgstr "" -#: ../../library/devmode.rst:85 +#: ../../library/devmode.rst:82 msgid "" -"Set the :attr:`~sys.flags.dev_mode` attribute of :data:`sys.flags` to " +"Set the :attr:`~sys.flags.dev_mode` attribute of :attr:`sys.flags` to " "``True``." msgstr "" -#: ../../library/devmode.rst:88 +#: ../../library/devmode.rst:85 msgid "" "The Python Development Mode does not enable the :mod:`tracemalloc` module by " "default, because the overhead cost (to performance and memory) would be too " @@ -203,178 +193,83 @@ msgid "" "allocated." msgstr "" -#: ../../library/devmode.rst:95 +#: ../../library/devmode.rst:92 msgid "" "The Python Development Mode does not prevent the :option:`-O` command line " "option from removing :keyword:`assert` statements nor from setting :const:" "`__debug__` to ``False``." msgstr "" -#: ../../library/devmode.rst:99 -msgid "" -"The Python Development Mode can only be enabled at the Python startup. Its " -"value can be read from :data:`sys.flags.dev_mode `." -msgstr "" - -#: ../../library/devmode.rst:102 +#: ../../library/devmode.rst:96 msgid "The :class:`io.IOBase` destructor now logs ``close()`` exceptions." msgstr "" -#: ../../library/devmode.rst:105 +#: ../../library/devmode.rst:99 msgid "" "The *encoding* and *errors* arguments are now checked for string encoding " "and decoding operations." msgstr "" -#: ../../library/devmode.rst:111 +#: ../../library/devmode.rst:105 msgid "ResourceWarning Example" msgstr "" -#: ../../library/devmode.rst:113 +#: ../../library/devmode.rst:107 msgid "" "Example of a script counting the number of lines of the text file specified " "in the command line::" msgstr "" -#: ../../library/devmode.rst:116 -msgid "" -"import sys\n" -"\n" -"def main():\n" -" fp = open(sys.argv[1])\n" -" nlines = len(fp.readlines())\n" -" print(nlines)\n" -" # The file is closed implicitly\n" -"\n" -"if __name__ == \"__main__\":\n" -" main()" -msgstr "" - -#: ../../library/devmode.rst:127 +#: ../../library/devmode.rst:121 msgid "" "The script does not close the file explicitly. By default, Python does not " "emit any warning. Example using README.txt, which has 269 lines:" msgstr "" -#: ../../library/devmode.rst:130 -msgid "" -"$ python script.py README.txt\n" -"269" -msgstr "" - -#: ../../library/devmode.rst:135 +#: ../../library/devmode.rst:129 msgid "" "Enabling the Python Development Mode displays a :exc:`ResourceWarning` " "warning:" msgstr "" -#: ../../library/devmode.rst:137 -msgid "" -"$ python -X dev script.py README.txt\n" -"269\n" -"script.py:10: ResourceWarning: unclosed file <_io.TextIOWrapper name='README." -"rst' mode='r' encoding='UTF-8'>\n" -" main()\n" -"ResourceWarning: Enable tracemalloc to get the object allocation traceback" -msgstr "" - -#: ../../library/devmode.rst:145 +#: ../../library/devmode.rst:139 msgid "" "In addition, enabling :mod:`tracemalloc` shows the line where the file was " "opened:" msgstr "" -#: ../../library/devmode.rst:148 -msgid "" -"$ python -X dev -X tracemalloc=5 script.py README.rst\n" -"269\n" -"script.py:10: ResourceWarning: unclosed file <_io.TextIOWrapper name='README." -"rst' mode='r' encoding='UTF-8'>\n" -" main()\n" -"Object allocated at (most recent call last):\n" -" File \"script.py\", lineno 10\n" -" main()\n" -" File \"script.py\", lineno 4\n" -" fp = open(sys.argv[1])" -msgstr "" - -#: ../../library/devmode.rst:160 +#: ../../library/devmode.rst:154 msgid "" "The fix is to close explicitly the file. Example using a context manager::" msgstr "" #: ../../library/devmode.rst:162 msgid "" -"def main():\n" -" # Close the file explicitly when exiting the with block\n" -" with open(sys.argv[1]) as fp:\n" -" nlines = len(fp.readlines())\n" -" print(nlines)" -msgstr "" - -#: ../../library/devmode.rst:168 -msgid "" "Not closing a resource explicitly can leave a resource open for way longer " "than expected; it can cause severe issues upon exiting Python. It is bad in " "CPython, but it is even worse in PyPy. Closing resources explicitly makes an " "application more deterministic and more reliable." msgstr "" -#: ../../library/devmode.rst:175 +#: ../../library/devmode.rst:169 msgid "Bad file descriptor error example" msgstr "" -#: ../../library/devmode.rst:177 +#: ../../library/devmode.rst:171 msgid "Script displaying the first line of itself::" msgstr "" -#: ../../library/devmode.rst:179 -msgid "" -"import os\n" -"\n" -"def main():\n" -" fp = open(__file__)\n" -" firstline = fp.readline()\n" -" print(firstline.rstrip())\n" -" os.close(fp.fileno())\n" -" # The file is closed implicitly\n" -"\n" -"main()" -msgstr "" - -#: ../../library/devmode.rst:190 +#: ../../library/devmode.rst:184 msgid "By default, Python does not emit any warning:" msgstr "" -#: ../../library/devmode.rst:192 -msgid "" -"$ python script.py\n" -"import os" -msgstr "" - -#: ../../library/devmode.rst:197 +#: ../../library/devmode.rst:191 msgid "" "The Python Development Mode shows a :exc:`ResourceWarning` and logs a \"Bad " "file descriptor\" error when finalizing the file object:" msgstr "" -#: ../../library/devmode.rst:200 -msgid "" -"$ python -X dev script.py\n" -"import os\n" -"script.py:10: ResourceWarning: unclosed file <_io.TextIOWrapper name='script." -"py' mode='r' encoding='UTF-8'>\n" -" main()\n" -"ResourceWarning: Enable tracemalloc to get the object allocation traceback\n" -"Exception ignored in: <_io.TextIOWrapper name='script.py' mode='r' " -"encoding='UTF-8'>\n" -"Traceback (most recent call last):\n" -" File \"script.py\", line 10, in \n" -" main()\n" -"OSError: [Errno 9] Bad file descriptor" -msgstr "" - -#: ../../library/devmode.rst:213 +#: ../../library/devmode.rst:207 msgid "" "``os.close(fp.fileno())`` closes the file descriptor. When the file object " "finalizer tries to close the file descriptor again, it fails with the ``Bad " @@ -383,7 +278,7 @@ msgid "" "`18748` for an example)." msgstr "" -#: ../../library/devmode.rst:219 +#: ../../library/devmode.rst:213 msgid "" "The fix is to remove the ``os.close(fp.fileno())`` line, or open the file " "with ``closefd=False``." diff --git a/library/dialog.po b/library/dialog.po index 0a3938ad2..c6b73171b 100644 --- a/library/dialog.po +++ b/library/dialog.po @@ -1,5 +1,5 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # @@ -9,17 +9,17 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-30 14:22+0000\n" -"PO-Revision-Date: 2021-06-28 01:04+0000\n" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2020-05-31 09:29+0000\n" "Last-Translator: Osamu NAKAMURA, 2021\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/dialog.rst:2 diff --git a/library/difflib.po b/library/difflib.po index d2836f130..efd6322eb 100644 --- a/library/difflib.po +++ b/library/difflib.po @@ -1,34 +1,37 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: +# ごはんですよ , 2017 +# Nozomu Kaneko , 2017 +# 秘湯 , 2017 +# Shun Sakurai, 2017 +# Arihiro TAKASE, 2017 +# Tetsuo Koyama , 2020 # tomo, 2021 # Osamu NAKAMURA, 2021 -# Tetsuo Koyama , 2021 -# Arihiro TAKASE, 2023 -# 石井明久, 2024 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-13 14:21+0000\n" -"PO-Revision-Date: 2021-06-28 01:04+0000\n" -"Last-Translator: 石井明久, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 23:06+0000\n" +"Last-Translator: Osamu NAKAMURA, 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/difflib.rst:2 -msgid ":mod:`!difflib` --- Helpers for computing deltas" -msgstr ":mod:`!difflib` --- 差分の計算の補助" +msgid ":mod:`difflib` --- Helpers for computing deltas" +msgstr ":mod:`difflib` --- 差分の計算を助ける" #: ../../library/difflib.rst:11 msgid "**Source code:** :source:`Lib/difflib.py`" @@ -108,9 +111,9 @@ msgstr "" "スティックは、 :class:`SequenceMatcher` の作成時に ``autojunk`` パラメタを " "``False`` に設定することで無効化できます。" -#: ../../library/difflib.rst:55 ../../library/difflib.rst:386 -msgid "Added the *autojunk* parameter." -msgstr "" +#: ../../library/difflib.rst:55 ../../library/difflib.rst:388 +msgid "The *autojunk* parameter." +msgstr "*autojunk* パラメータ。" #: ../../library/difflib.rst:61 msgid "" @@ -131,7 +134,7 @@ msgstr ":class:`Differ` クラスによる差分の各行は、2文字のコー msgid "Code" msgstr "コード" -#: ../../library/difflib.rst:69 ../../library/difflib.rst:496 +#: ../../library/difflib.rst:69 ../../library/difflib.rst:498 msgid "Meaning" msgstr "意味" @@ -171,9 +174,11 @@ msgstr "行は入力シーケンスのどちらにも存在しない" msgid "" "Lines beginning with '``?``' attempt to guide the eye to intraline " "differences, and were not present in either input sequence. These lines can " -"be confusing if the sequences contain whitespace characters, such as spaces, " -"tabs or line breaks." +"be confusing if the sequences contain tab characters." msgstr "" +"'``?``' で始まる行は、行内のどこに差異が存在するかに注意を向けようとします。" +"その行は、入力されたシーケンスのどちらにも存在しません。シーケンスがタブ文字" +"を含むとき、これらの行は判別しづらいものになることがあります。" #: ../../library/difflib.rst:87 msgid "" @@ -298,7 +303,15 @@ msgid "" "`make_file` method." msgstr "このメソッドの引数は、 :meth:`make_file` メソッドの引数と同じです。" -#: ../../library/difflib.rst:152 +#: ../../library/difflib.rst:148 +msgid "" +":file:`Tools/scripts/diff.py` is a command-line front-end to this class and " +"contains a good example of its use." +msgstr "" +":file:`Tools/scripts/diff.py` はこのクラスへのコマンドラインフロントエンド" +"で、使い方を学ぶ上で格好の例題が入っています。" + +#: ../../library/difflib.rst:154 msgid "" "Compare *a* and *b* (lists of strings); return a delta (a :term:`generator` " "generating the delta lines) in context diff format." @@ -307,7 +320,7 @@ msgstr "" "ジェネレータ `) を、 context diff のフォーマット(以下「コンテキス" "ト形式」)で返します。" -#: ../../library/difflib.rst:155 +#: ../../library/difflib.rst:157 msgid "" "Context diffs are a compact way of showing just the lines that have changed " "plus a few lines of context. The changes are shown in a before/after " @@ -317,7 +330,7 @@ msgstr "" "法です。変更箇所は、変更前/変更後に分けて表します。コンテキスト (変更箇所前後" "の行) の行数は *n* で指定し、デフォルト値は 3 です。" -#: ../../library/difflib.rst:159 +#: ../../library/difflib.rst:161 msgid "" "By default, the diff control lines (those with ``***`` or ``---``) are " "created with a trailing newline. This is helpful so that inputs created " @@ -330,7 +343,7 @@ msgstr "" "writelines` で扱うのに適した diff になるので (なぜなら入力と出力の両方が改行" "付きのため) 、これは有用です。" -#: ../../library/difflib.rst:165 ../../library/difflib.rst:297 +#: ../../library/difflib.rst:167 ../../library/difflib.rst:298 msgid "" "For inputs that do not have trailing newlines, set the *lineterm* argument " "to ``\"\"`` so that the output will be uniformly newline free." @@ -338,7 +351,7 @@ msgstr "" "行末に改行文字を持たない入力に対しては、出力でも改行文字を付加しないように " "*lineterm* 引数に ``\"\"`` を渡してください。" -#: ../../library/difflib.rst:168 +#: ../../library/difflib.rst:170 ../../library/difflib.rst:301 msgid "" "The context diff format normally has a header for filenames and modification " "times. Any or all of these may be specified using strings for *fromfile*, " @@ -351,11 +364,11 @@ msgstr "" "す。変更時刻の書式は、通常、ISO 8601 フォーマットで表されます。指定しなかった" "場合のデフォルト値は、空文字列です。" -#: ../../library/difflib.rst:194 ../../library/difflib.rst:320 +#: ../../library/difflib.rst:193 ../../library/difflib.rst:322 msgid "See :ref:`difflib-interface` for a more detailed example." msgstr "より詳細な例は、 :ref:`difflib-interface` を参照してください。" -#: ../../library/difflib.rst:199 +#: ../../library/difflib.rst:198 msgid "" "Return a list of the best \"good enough\" matches. *word* is a sequence for " "which close matches are desired (typically a string), and *possibilities* is " @@ -366,7 +379,7 @@ msgstr "" "(大概は文字列) です。*possibilities* は *word* にマッチさせるシーケンスのリス" "ト (大概は文字列のリスト) です。" -#: ../../library/difflib.rst:203 +#: ../../library/difflib.rst:202 msgid "" "Optional argument *n* (default ``3``) is the maximum number of close matches " "to return; *n* must be greater than ``0``." @@ -374,7 +387,7 @@ msgstr "" "オプションの引数 *n* (デフォルトでは ``3``)はメソッドの返すマッチの最大数で" "す。*n* は ``0`` より大きくなければなりません。" -#: ../../library/difflib.rst:206 +#: ../../library/difflib.rst:205 msgid "" "Optional argument *cutoff* (default ``0.6``) is a float in the range [0, 1]. " "Possibilities that don't score at least that similar to *word* are ignored." @@ -383,7 +396,7 @@ msgstr "" "の値です。*word* との一致率がそれ未満の *possibilities* の要素は無視されま" "す。" -#: ../../library/difflib.rst:209 +#: ../../library/difflib.rst:208 msgid "" "The best (no more than *n*) matches among the possibilities are returned in " "a list, sorted by similarity score, most similar first." @@ -391,7 +404,7 @@ msgstr "" "*possibilities* の要素でマッチした上位(多くても *n* 個)は、類似度のスコアに応" "じて(一番似たものを先頭に)ソートされたリストとして返されます。" -#: ../../library/difflib.rst:225 +#: ../../library/difflib.rst:224 msgid "" "Compare *a* and *b* (lists of strings); return a :class:`Differ`\\ -style " "delta (a :term:`generator` generating the delta lines)." @@ -399,7 +412,7 @@ msgstr "" "*a* と *b* (文字列のリスト) を比較し、差分 (差分形式の行を生成する :term:`" "ジェネレータ `) を、 :class:`Differ` のスタイルで返します。" -#: ../../library/difflib.rst:228 +#: ../../library/difflib.rst:227 msgid "" "Optional keyword parameters *linejunk* and *charjunk* are filtering " "functions (or ``None``):" @@ -407,7 +420,7 @@ msgstr "" "オプションのキーワード引数 *linejunk* と *charjunk* には、フィルタ関数 (また" "は ``None``) を渡します。" -#: ../../library/difflib.rst:231 +#: ../../library/difflib.rst:230 msgid "" "*linejunk*: A function that accepts a single string argument, and returns " "true if the string is junk, or false if not. The default is ``None``. There " @@ -425,7 +438,7 @@ msgstr "" "的に分析します。このクラスによる分析は、この関数を使用するよりも通常うまく動" "作します。" -#: ../../library/difflib.rst:239 +#: ../../library/difflib.rst:238 msgid "" "*charjunk*: A function that accepts a character (a string of length 1), and " "returns if the character is junk, or false if not. The default is module-" @@ -437,11 +450,18 @@ msgstr "" "func:`IS_CHARACTER_JUNK` であり、これは空白文字類 (空白またはタブ、改行文字を" "これに含めてはいけません) をフィルタして排除します。" -#: ../../library/difflib.rst:260 +#: ../../library/difflib.rst:243 +msgid "" +":file:`Tools/scripts/ndiff.py` is a command-line front-end to this function." +msgstr "" +":file:`Tools/scripts/ndiff.py` は、この関数のコマンドラインのフロントエンド" +"(インターフェイス)です。" + +#: ../../library/difflib.rst:261 msgid "Return one of the two sequences that generated a delta." msgstr "差分を生成した元の二つのシーケンスのうち一つを返します。" -#: ../../library/difflib.rst:262 +#: ../../library/difflib.rst:263 msgid "" "Given a *sequence* produced by :meth:`Differ.compare` or :func:`ndiff`, " "extract lines originating from file 1 or 2 (parameter *which*), stripping " @@ -451,11 +471,11 @@ msgstr "" "与えられると、行頭のプレフィクスを取りのぞいてファイル 1 または 2 (引数 " "*which* で指定される) に由来する行を復元します。" -#: ../../library/difflib.rst:266 +#: ../../library/difflib.rst:267 msgid "Example:" msgstr "例:" -#: ../../library/difflib.rst:283 +#: ../../library/difflib.rst:284 msgid "" "Compare *a* and *b* (lists of strings); return a delta (a :term:`generator` " "generating the delta lines) in unified diff format." @@ -464,7 +484,7 @@ msgstr "" "ジェネレータ `) を、 unified diff フォーマット(以下「ユニファイド" "形式」)で返します。" -#: ../../library/difflib.rst:286 +#: ../../library/difflib.rst:287 msgid "" "Unified diffs are a compact way of showing just the lines that have changed " "plus a few lines of context. The changes are shown in an inline style " @@ -476,7 +496,7 @@ msgstr "" "ラインスタイルで表されます。コンテキストの行数は、*n* で指定し、デフォルト値" "は 3 です。" -#: ../../library/difflib.rst:291 +#: ../../library/difflib.rst:292 msgid "" "By default, the diff control lines (those with ``---``, ``+++``, or ``@@``) " "are created with a trailing newline. This is helpful so that inputs created " @@ -489,16 +509,7 @@ msgstr "" "writelines` で扱うのに適した diff になるので (なぜなら入力と出力の両方が改行" "付きのため) 、これは有用です。" -#: ../../library/difflib.rst:300 -msgid "" -"The unified diff format normally has a header for filenames and modification " -"times. Any or all of these may be specified using strings for *fromfile*, " -"*tofile*, *fromfiledate*, and *tofiledate*. The modification times are " -"normally expressed in the ISO 8601 format. If not specified, the strings " -"default to blanks." -msgstr "" - -#: ../../library/difflib.rst:324 +#: ../../library/difflib.rst:326 msgid "" "Compare *a* and *b* (lists of bytes objects) using *dfunc*; yield a sequence " "of delta lines (also bytes) in the format returned by *dfunc*. *dfunc* must " @@ -509,7 +520,7 @@ msgstr "" "*dfunc* は、呼び出し可能である必要があります。一般に、これは :func:" "`unified_diff` または :func:`context_diff` です。" -#: ../../library/difflib.rst:329 +#: ../../library/difflib.rst:331 msgid "" "Allows you to compare data with unknown or inconsistent encoding. All inputs " "except *n* must be bytes objects, not str. Works by losslessly converting " @@ -526,7 +537,7 @@ msgstr "" "行のエンコーディングは、*a* と *b* の未知または一貫性のないエンコーディングと" "同一になります。" -#: ../../library/difflib.rst:340 +#: ../../library/difflib.rst:342 msgid "" "Return ``True`` for ignorable lines. The line *line* is ignorable if *line* " "is blank or contains a single ``'#'``, otherwise it is not ignorable. Used " @@ -536,7 +547,7 @@ msgstr "" "とつのときに無視できます。それ以外のときには無視できません。古いバージョンで" "は :func:`ndiff` の引数 *linejunk* にデフォルトで使用されました。" -#: ../../library/difflib.rst:347 +#: ../../library/difflib.rst:349 msgid "" "Return ``True`` for ignorable characters. The character *ch* is ignorable " "if *ch* is a space or tab, otherwise it is not ignorable. Used as a default " @@ -546,33 +557,33 @@ msgstr "" "ときには無視できます。それ以外の時には無視できません。 :func:`ndiff` の引数 " "*charjunk* としてデフォルトで使用されます。" -#: ../../library/difflib.rst:354 +#: ../../library/difflib.rst:357 msgid "" -"`Pattern Matching: The Gestalt Approach `_" msgstr "" -"`Pattern Matching: The Gestalt Approach `_" -#: ../../library/difflib.rst:355 +#: ../../library/difflib.rst:357 msgid "" "Discussion of a similar algorithm by John W. Ratcliff and D. E. Metzener. " -"This was published in `Dr. Dobb's Journal `_ in " +"This was published in `Dr. Dobb's Journal `_ in " "July, 1988." msgstr "" "John W. Ratcliff と D. E. Metzener による類似のアルゴリズムに関する議論。" -"`Dr. Dobb's Journal `_ 1988年7月号掲載。" +"`Dr. Dobb's Journal `_ 1988年7月号掲載。" -#: ../../library/difflib.rst:362 +#: ../../library/difflib.rst:364 msgid "SequenceMatcher Objects" msgstr "SequenceMatcherオブジェクト" -#: ../../library/difflib.rst:364 +#: ../../library/difflib.rst:366 msgid "The :class:`SequenceMatcher` class has this constructor:" msgstr "" ":class:`SequenceMatcher` クラスには、以下のようなコンストラクタがあります:" -#: ../../library/difflib.rst:369 +#: ../../library/difflib.rst:371 msgid "" "Optional argument *isjunk* must be ``None`` (the default) or a one-argument " "function that takes a sequence element and returns true if and only if the " @@ -587,17 +598,13 @@ msgstr "" "じになります; すなわち、いかなる要素も無視しなくなります。例えば以下のような" "引数を渡すと::" -#: ../../library/difflib.rst:375 -msgid "lambda x: x in \" \\t\"" -msgstr "" - -#: ../../library/difflib.rst:377 +#: ../../library/difflib.rst:379 msgid "" "if you're comparing lines as sequences of characters, and don't want to " "synch up on blanks or hard tabs." msgstr "空白とタブ文字を無視して文字のシーケンスを比較します。" -#: ../../library/difflib.rst:380 +#: ../../library/difflib.rst:382 msgid "" "The optional arguments *a* and *b* are sequences to be compared; both " "default to empty strings. The elements of both sequences must be :term:" @@ -607,7 +614,7 @@ msgstr "" "です。両方のシーケンスの要素は、 :term:`ハッシュ可能 ` である必要が" "あります。" -#: ../../library/difflib.rst:383 +#: ../../library/difflib.rst:385 msgid "" "The optional argument *autojunk* can be used to disable the automatic junk " "heuristic." @@ -615,7 +622,7 @@ msgstr "" "オプションの引数 *autojunk* は、自動 junk ヒューリスティックを無効にするため" "に使えます。" -#: ../../library/difflib.rst:389 +#: ../../library/difflib.rst:391 msgid "" "SequenceMatcher objects get three data attributes: *bjunk* is the set of " "elements of *b* for which *isjunk* is ``True``; *bpopular* is the set of non-" @@ -631,19 +638,19 @@ msgstr "" "る dict です。この 3 つは :meth:`set_seqs` または :meth:`set_seq2` で *b* が" "リセットされる場合は常にリセットされます。" -#: ../../library/difflib.rst:396 +#: ../../library/difflib.rst:398 msgid "The *bjunk* and *bpopular* attributes." msgstr "*bjunk* および *bpopular* 属性。" -#: ../../library/difflib.rst:399 +#: ../../library/difflib.rst:401 msgid ":class:`SequenceMatcher` objects have the following methods:" msgstr ":class:`SequenceMatcher` オブジェクトは以下のメソッドを持ちます:" -#: ../../library/difflib.rst:403 +#: ../../library/difflib.rst:405 msgid "Set the two sequences to be compared." msgstr "比較される2つの文字列を設定します。" -#: ../../library/difflib.rst:405 +#: ../../library/difflib.rst:407 msgid "" ":class:`SequenceMatcher` computes and caches detailed information about the " "second sequence, so if you want to compare one sequence against many " @@ -655,7 +662,7 @@ msgstr "" "る場合、まず :meth:`set_seq2` を使って文字列を設定しておき、別の文字列を1つず" "つ比較するために、繰り返し :meth:`set_seq1` を呼び出します。" -#: ../../library/difflib.rst:413 +#: ../../library/difflib.rst:415 msgid "" "Set the first sequence to be compared. The second sequence to be compared " "is not changed." @@ -663,7 +670,7 @@ msgstr "" "比較を行う1つ目のシーケンスを設定します。比較される2つ目のシーケンスは変更さ" "れません。" -#: ../../library/difflib.rst:419 +#: ../../library/difflib.rst:421 msgid "" "Set the second sequence to be compared. The first sequence to be compared " "is not changed." @@ -671,11 +678,11 @@ msgstr "" "比較を行う2つ目のシーケンスを設定します。比較される1つ目のシーケンスは変更さ" "れません。" -#: ../../library/difflib.rst:425 +#: ../../library/difflib.rst:427 msgid "Find longest matching block in ``a[alo:ahi]`` and ``b[blo:bhi]``." msgstr "``a[alo:ahi]`` と ``b[blo:bhi]`` の中から、最長のマッチ列を探します。" -#: ../../library/difflib.rst:427 +#: ../../library/difflib.rst:429 msgid "" "If *isjunk* was omitted or ``None``, :meth:`find_longest_match` returns " "``(i, j, k)`` such that ``a[i:i+k]`` is equal to ``b[j:j+k]``, where ``alo " @@ -694,7 +701,7 @@ msgstr "" "べてのうち、 *a* 内で最初に始まるものを返します。そしてその *a* 内で最初の" "マッチ列すべてのうち *b* 内で最初に始まるものを返します。" -#: ../../library/difflib.rst:440 +#: ../../library/difflib.rst:442 msgid "" "If *isjunk* was provided, first the longest matching block is determined as " "above, but with the additional restriction that no junk element appears in " @@ -708,7 +715,7 @@ msgstr "" "広げていきます。そのため結果となる列は、探している列のたまたま直前にあった同" "一の junk 以外の junk にはマッチしません。" -#: ../../library/difflib.rst:447 +#: ../../library/difflib.rst:449 msgid "" "Here's the same example as before, but considering blanks to be junk. That " "prevents ``' abcd'`` from matching the ``' abcd'`` at the tail end of the " @@ -720,19 +727,19 @@ msgstr "" "代わりに ``'abcd'`` にはマッチします。そして 2つ目の文字列中、一番左の " "``'abcd'`` にマッチします:" -#: ../../library/difflib.rst:456 +#: ../../library/difflib.rst:458 msgid "If no blocks match, this returns ``(alo, blo, 0)``." msgstr "どんな列にもマッチしない時は、``(alo, blo, 0)`` を返します。" -#: ../../library/difflib.rst:458 +#: ../../library/difflib.rst:460 msgid "This method returns a :term:`named tuple` ``Match(a, b, size)``." msgstr "このメソッドは :term:`named tuple` ``Match(a, b, size)`` を返します。" -#: ../../library/difflib.rst:460 +#: ../../library/difflib.rst:462 msgid "Added default arguments." msgstr "デフォルト引数が追加されました。" -#: ../../library/difflib.rst:466 +#: ../../library/difflib.rst:468 msgid "" "Return list of triples describing non-overlapping matching subsequences. " "Each triple is of the form ``(i, j, n)``, and means that ``a[i:i+n] == b[j:" @@ -742,7 +749,7 @@ msgstr "" "それぞれの値は ``(i, j, n)`` という形式で表され、``a[i:i+n] == b[j:j+n]`` と" "いう関係を意味します。3つの値は *i* と *j* の間で単調に増加します。" -#: ../../library/difflib.rst:471 +#: ../../library/difflib.rst:473 msgid "" "The last triple is a dummy, and has the value ``(len(a), len(b), 0)``. It " "is the only triple with ``n == 0``. If ``(i, j, n)`` and ``(i', j', n')`` " @@ -756,14 +763,7 @@ msgstr "" "``j+n < j'`` です。言い換えると並んでいる3つ組は常に隣接していない同じブロッ" "クを表しています。" -#: ../../library/difflib.rst:479 -msgid "" -">>> s = SequenceMatcher(None, \"abxcd\", \"abcd\")\n" -">>> s.get_matching_blocks()\n" -"[Match(a=0, b=0, size=2), Match(a=3, b=2, size=2), Match(a=5, b=4, size=0)]" -msgstr "" - -#: ../../library/difflib.rst:488 +#: ../../library/difflib.rst:490 msgid "" "Return list of 5-tuples describing how to turn *a* into *b*. Each tuple is " "of the form ``(tag, i1, i2, j1, j2)``. The first tuple has ``i1 == j1 == " @@ -775,75 +775,60 @@ msgstr "" "== j1 == 0`` であり、*i1* はその前にあるタプルの *i2* と同じ値です。同様に " "*j1* は前の *j2* と同じ値になります。" -#: ../../library/difflib.rst:493 +#: ../../library/difflib.rst:495 msgid "The *tag* values are strings, with these meanings:" msgstr "*tag* の値は文字列であり、次のような意味です:" -#: ../../library/difflib.rst:496 +#: ../../library/difflib.rst:498 msgid "Value" msgstr "値" -#: ../../library/difflib.rst:498 +#: ../../library/difflib.rst:500 msgid "``'replace'``" msgstr "``'replace'``" -#: ../../library/difflib.rst:498 +#: ../../library/difflib.rst:500 msgid "``a[i1:i2]`` should be replaced by ``b[j1:j2]``." msgstr "``a[i1:i2]`` は ``b[j1:j2]`` に置き換えられる。" -#: ../../library/difflib.rst:501 +#: ../../library/difflib.rst:503 msgid "``'delete'``" msgstr "``'delete'``" -#: ../../library/difflib.rst:501 +#: ../../library/difflib.rst:503 msgid "``a[i1:i2]`` should be deleted. Note that ``j1 == j2`` in this case." msgstr "``a[i1:i2]`` は削除される。この時、``j1 == j2`` である。" -#: ../../library/difflib.rst:504 +#: ../../library/difflib.rst:506 msgid "``'insert'``" msgstr "``'insert'``" -#: ../../library/difflib.rst:504 +#: ../../library/difflib.rst:506 msgid "" "``b[j1:j2]`` should be inserted at ``a[i1:i1]``. Note that ``i1 == i2`` in " "this case." msgstr "" "``b[j1:j2]`` が ``a[i1:i1]`` に挿入される。この時 ``i1 == i2`` である。" -#: ../../library/difflib.rst:508 +#: ../../library/difflib.rst:510 msgid "``'equal'``" msgstr "``'equal'``" -#: ../../library/difflib.rst:508 +#: ../../library/difflib.rst:510 msgid "``a[i1:i2] == b[j1:j2]`` (the sub-sequences are equal)." msgstr "``a[i1:i2] == b[j1:j2]`` (サブシーケンスは等しい)." -#: ../../library/difflib.rst:512 +#: ../../library/difflib.rst:514 msgid "For example::" msgstr "例えば::" -#: ../../library/difflib.rst:514 -msgid "" -">>> a = \"qabxcd\"\n" -">>> b = \"abycdf\"\n" -">>> s = SequenceMatcher(None, a, b)\n" -">>> for tag, i1, i2, j1, j2 in s.get_opcodes():\n" -"... print('{:7} a[{}:{}] --> b[{}:{}] {!r:>8} --> {!r}'.format(\n" -"... tag, i1, i2, j1, j2, a[i1:i2], b[j1:j2]))\n" -"delete a[0:1] --> b[0:0] 'q' --> ''\n" -"equal a[1:3] --> b[0:2] 'ab' --> 'ab'\n" -"replace a[3:4] --> b[2:3] 'x' --> 'y'\n" -"equal a[4:6] --> b[3:5] 'cd' --> 'cd'\n" -"insert a[6:6] --> b[5:6] '' --> 'f'" -msgstr "" - -#: ../../library/difflib.rst:529 +#: ../../library/difflib.rst:531 msgid "Return a :term:`generator` of groups with up to *n* lines of context." msgstr "" "最大 *n* 行までのコンテキストを含むグループを生成するような、 :term:`ジェネ" "レータ ` を返します。" -#: ../../library/difflib.rst:531 +#: ../../library/difflib.rst:533 msgid "" "Starting with the groups returned by :meth:`get_opcodes`, this method splits " "out smaller change clusters and eliminates intervening ranges which have no " @@ -852,16 +837,16 @@ msgstr "" "このメソッドは、 :meth:`get_opcodes` で返されるグループの中から、似たような差" "異のかたまりに分け、間に挟まっている変更の無い部分を省きます。" -#: ../../library/difflib.rst:535 +#: ../../library/difflib.rst:537 msgid "The groups are returned in the same format as :meth:`get_opcodes`." msgstr "グループは :meth:`get_opcodes` と同じ書式で返されます。" -#: ../../library/difflib.rst:540 +#: ../../library/difflib.rst:542 msgid "" "Return a measure of the sequences' similarity as a float in the range [0, 1]." msgstr "[0, 1] の範囲の浮動小数点数で、シーケンスの類似度を測る値を返します。" -#: ../../library/difflib.rst:543 +#: ../../library/difflib.rst:545 msgid "" "Where T is the total number of elements in both sequences, and M is the " "number of matches, this is 2.0\\*M / T. Note that this is ``1.0`` if the " @@ -871,7 +856,7 @@ msgstr "" "は 2.0\\*M / T であらわされます。もしシーケンスがまったく同じ場合、値は " "``1.0`` となり、まったく異なる場合には ``0.0`` となります。" -#: ../../library/difflib.rst:547 +#: ../../library/difflib.rst:549 msgid "" "This is expensive to compute if :meth:`get_matching_blocks` or :meth:" "`get_opcodes` hasn't already been called, in which case you may want to try :" @@ -882,7 +867,7 @@ msgstr "" "するために、 :meth:`quick_ratio` もしくは :meth:`real_quick_ratio` を最初に試" "してみる方がいいかもしれません。" -#: ../../library/difflib.rst:554 +#: ../../library/difflib.rst:556 msgid "" "Caution: The result of a :meth:`ratio` call may depend on the order of the " "arguments. For instance::" @@ -890,67 +875,70 @@ msgstr "" "注意: :meth:`ratio` の呼び出しの結果は引数の順序に依存します。例えば次の通り" "です::" -#: ../../library/difflib.rst:557 -msgid "" -">>> SequenceMatcher(None, 'tide', 'diet').ratio()\n" -"0.25\n" -">>> SequenceMatcher(None, 'diet', 'tide').ratio()\n" -"0.5" -msgstr "" - -#: ../../library/difflib.rst:565 +#: ../../library/difflib.rst:567 msgid "Return an upper bound on :meth:`ratio` relatively quickly." msgstr ":meth:`ratio` の上界を、より高速に計算します。" -#: ../../library/difflib.rst:570 +#: ../../library/difflib.rst:572 msgid "Return an upper bound on :meth:`ratio` very quickly." msgstr ":meth:`ratio` の上界を、非常に高速に計算します。" -#: ../../library/difflib.rst:573 +#: ../../library/difflib.rst:575 msgid "" "The three methods that return the ratio of matching to total characters can " "give different results due to differing levels of approximation, although :" -"meth:`~SequenceMatcher.quick_ratio` and :meth:`~SequenceMatcher." -"real_quick_ratio` are always at least as large as :meth:`~SequenceMatcher." -"ratio`:" +"meth:`quick_ratio` and :meth:`real_quick_ratio` are always at least as large " +"as :meth:`ratio`:" msgstr "" +"この文字列全体のマッチ率を返す3つのメソッドは、精度の異なる近似値を返しま" +"す。 :meth:`quick_ratio` と :meth:`real_quick_ratio` は、常に :meth:`ratio` " +"以上の値を返します:" -#: ../../library/difflib.rst:590 +#: ../../library/difflib.rst:592 msgid "SequenceMatcher Examples" msgstr "SequenceMatcher の例" -#: ../../library/difflib.rst:592 +#: ../../library/difflib.rst:594 msgid "This example compares two strings, considering blanks to be \"junk\":" msgstr "この例は2つの文字列を比較します。空白を \"junk\" とします:" -#: ../../library/difflib.rst:598 +#: ../../library/difflib.rst:600 msgid "" -":meth:`~SequenceMatcher.ratio` returns a float in [0, 1], measuring the " -"similarity of the sequences. As a rule of thumb, a :meth:`~SequenceMatcher." -"ratio` value over 0.6 means the sequences are close matches:" +":meth:`ratio` returns a float in [0, 1], measuring the similarity of the " +"sequences. As a rule of thumb, a :meth:`ratio` value over 0.6 means the " +"sequences are close matches:" msgstr "" +":meth:`ratio` は、[0, 1] の範囲の値を返し、シーケンスの類似度を測ります。経験" +"によると、 :meth:`ratio` の値が0.6を超えると、シーケンスがよく似ていることを" +"示します:" -#: ../../library/difflib.rst:605 +#: ../../library/difflib.rst:607 msgid "" "If you're only interested in where the sequences match, :meth:" -"`~SequenceMatcher.get_matching_blocks` is handy:" +"`get_matching_blocks` is handy:" msgstr "" +"シーケンスのどこがマッチしているかにだけ興味のある時には :meth:" +"`get_matching_blocks` が手軽でしょう:" -#: ../../library/difflib.rst:614 +#: ../../library/difflib.rst:616 msgid "" -"Note that the last tuple returned by :meth:`~SequenceMatcher." -"get_matching_blocks` is always a dummy, ``(len(a), len(b), 0)``, and this is " -"the only case in which the last tuple element (number of elements matched) " -"is ``0``." +"Note that the last tuple returned by :meth:`get_matching_blocks` is always a " +"dummy, ``(len(a), len(b), 0)``, and this is the only case in which the last " +"tuple element (number of elements matched) is ``0``." msgstr "" +":meth:`get_matching_blocks` が返す最後のタプルが常にダミーであることに注目し" +"てください。このダミーは ``(len(a), len(b), 0)`` であり、これはタプルの最後の" +"要素(マッチする要素の数)が ``0`` となる唯一のケースです。" -#: ../../library/difflib.rst:618 +#: ../../library/difflib.rst:620 msgid "" "If you want to know how to change the first sequence into the second, use :" -"meth:`~SequenceMatcher.get_opcodes`:" +"meth:`get_opcodes`:" msgstr "" +"はじめのシーケンスがどのようにして2番目のものになるのかを知るには、 :meth:" +"`get_opcodes` を使います:" -#: ../../library/difflib.rst:629 +#: ../../library/difflib.rst:631 msgid "" "The :func:`get_close_matches` function in this module which shows how simple " "code building on :class:`SequenceMatcher` can be used to do useful work." @@ -958,18 +946,19 @@ msgstr "" ":class:`SequenceMatcher` を使った、シンプルで使えるコードを知るには、このモ" "ジュールの関数 :func:`get_close_matches` を参照してください。" -#: ../../library/difflib.rst:633 +#: ../../library/difflib.rst:635 msgid "" -"`Simple version control recipe `_ for a small application built with :class:" -"`SequenceMatcher`." +"`Simple version control recipe `_ for a small application built with :class:`SequenceMatcher`." msgstr "" +"`Simple version control recipe `_ :class:`SequenceMatcher` で作った小規模アプリケーション。" -#: ../../library/difflib.rst:641 +#: ../../library/difflib.rst:643 msgid "Differ Objects" msgstr "Differ オブジェクト" -#: ../../library/difflib.rst:643 +#: ../../library/difflib.rst:645 msgid "" "Note that :class:`Differ`\\ -generated deltas make no claim to be " "**minimal** diffs. To the contrary, minimal diffs are often counter-" @@ -985,11 +974,11 @@ msgstr "" "とで、場合によって長めの差分を出力するというコストを掛けることにはなっても、" "ある種の局所性を保つことができるのです。" -#: ../../library/difflib.rst:649 +#: ../../library/difflib.rst:651 msgid "The :class:`Differ` class has this constructor:" msgstr ":class:`Differ` は、以下のようなコンストラクタを持ちます:" -#: ../../library/difflib.rst:655 +#: ../../library/difflib.rst:657 msgid "" "Optional keyword parameters *linejunk* and *charjunk* are for filter " "functions (or ``None``):" @@ -997,7 +986,7 @@ msgstr "" "オプションのキーワードパラメータ *linejunk* と *charjunk* は、フィルタ関数を" "渡します (使わないときは ``None``):" -#: ../../library/difflib.rst:658 +#: ../../library/difflib.rst:660 msgid "" "*linejunk*: A function that accepts a single string argument, and returns " "true if the string is junk. The default is ``None``, meaning that no line " @@ -1007,7 +996,7 @@ msgstr "" "返します。デフォルトでは、``None`` であり、どんな行であっても junk とは見なさ" "れません。" -#: ../../library/difflib.rst:662 +#: ../../library/difflib.rst:664 msgid "" "*charjunk*: A function that accepts a single character argument (a string of " "length 1), and returns true if the character is junk. The default is " @@ -1017,7 +1006,7 @@ msgstr "" "あるときに真を返します。デフォルトは ``None`` であり、どんな文字も junk とは" "見なされません。" -#: ../../library/difflib.rst:666 +#: ../../library/difflib.rst:668 msgid "" "These junk-filtering functions speed up matching to find differences and do " "not cause any differing lines or characters to be ignored. Read the " @@ -1029,21 +1018,21 @@ msgstr "" "`~SequenceMatcher.find_longest_match` メソッドの *isjunk* 引数の説明をご覧く" "ださい。" -#: ../../library/difflib.rst:672 +#: ../../library/difflib.rst:674 msgid "" ":class:`Differ` objects are used (deltas generated) via a single method:" msgstr "" ":class:`Differ` オブジェクトは、以下の1つのメソッドを通して利用されます。(差" "分を生成します):" -#: ../../library/difflib.rst:677 +#: ../../library/difflib.rst:679 msgid "" "Compare two sequences of lines, and generate the delta (a sequence of lines)." msgstr "" "文字列からなる2つのシーケンスを比較し、差分(を表す文字列からなるシーケンス)" "を生成します。" -#: ../../library/difflib.rst:679 +#: ../../library/difflib.rst:681 msgid "" "Each sequence must contain individual single-line strings ending with " "newlines. Such sequences can be obtained from the :meth:`~io.IOBase." @@ -1057,23 +1046,26 @@ msgstr "" "了する文字列のシーケンスとして得られ、ファイル風オブジェクトの :meth:`~io." "IOBase.writelines` メソッドによって出力できる形になっています。" -#: ../../library/difflib.rst:690 +#: ../../library/difflib.rst:692 msgid "Differ Example" msgstr "Differ の例" -#: ../../library/difflib.rst:692 +#: ../../library/difflib.rst:694 msgid "" "This example compares two texts. First we set up the texts, sequences of " "individual single-line strings ending with newlines (such sequences can also " -"be obtained from the :meth:`~io.IOBase.readlines` method of file-like " +"be obtained from the :meth:`~io.BaseIO.readlines` method of file-like " "objects):" msgstr "" +"以下の例は2つのテキストを比較しています。最初に、テキストを行毎に改行で終わる" +"文字列のシーケンスにセットアップします (そのようなシーケンスは、ファイル風オ" +"ブジェクトの :meth:`~io.BaseIO.readlines` メソッドからも得ることができます):" -#: ../../library/difflib.rst:711 +#: ../../library/difflib.rst:713 msgid "Next we instantiate a Differ object:" msgstr "次に Differ オブジェクトをインスタンス化します:" -#: ../../library/difflib.rst:715 +#: ../../library/difflib.rst:717 msgid "" "Note that when instantiating a :class:`Differ` object we may pass functions " "to filter out line and character \"junk.\" See the :meth:`Differ` " @@ -1083,215 +1075,28 @@ msgstr "" "junk をフィルタリングする関数を渡すことができます。詳細は :meth:`Differ` コン" "ストラクタを参照してください。" -#: ../../library/difflib.rst:719 +#: ../../library/difflib.rst:721 msgid "Finally, we compare the two:" msgstr "最後に、2つを比較します:" -#: ../../library/difflib.rst:723 +#: ../../library/difflib.rst:725 msgid "``result`` is a list of strings, so let's pretty-print it:" msgstr "``result`` は文字列のリストなので、pretty-printしてみましょう:" -#: ../../library/difflib.rst:738 +#: ../../library/difflib.rst:740 msgid "As a single multi-line string it looks like this:" msgstr "これは、複数行の文字列として、次のように出力されます:" -#: ../../library/difflib.rst:757 +#: ../../library/difflib.rst:759 msgid "A command-line interface to difflib" msgstr "difflib のコマンドラインインターフェース" -#: ../../library/difflib.rst:759 -msgid "" -"This example shows how to use difflib to create a ``diff``-like utility." -msgstr "" - #: ../../library/difflib.rst:761 msgid "" -"\"\"\" Command line interface to difflib.py providing diffs in four " -"formats:\n" -"\n" -"* ndiff: lists every line and highlights interline changes.\n" -"* context: highlights clusters of changes in a before/after format.\n" -"* unified: highlights clusters of changes in an inline format.\n" -"* html: generates side by side comparison with change highlights.\n" -"\n" -"\"\"\"\n" -"\n" -"import sys, os, difflib, argparse\n" -"from datetime import datetime, timezone\n" -"\n" -"def file_mtime(path):\n" -" t = datetime.fromtimestamp(os.stat(path).st_mtime,\n" -" timezone.utc)\n" -" return t.astimezone().isoformat()\n" -"\n" -"def main():\n" -"\n" -" parser = argparse.ArgumentParser()\n" -" parser.add_argument('-c', action='http://github.com/store_true', default=False,\n" -" help='Produce a context format diff (default)')\n" -" parser.add_argument('-u', action='http://github.com/store_true', default=False,\n" -" help='Produce a unified format diff')\n" -" parser.add_argument('-m', action='http://github.com/store_true', default=False,\n" -" help='Produce HTML side by side diff '\n" -" '(can use -c and -l in conjunction)')\n" -" parser.add_argument('-n', action='http://github.com/store_true', default=False,\n" -" help='Produce a ndiff format diff')\n" -" parser.add_argument('-l', '--lines', type=int, default=3,\n" -" help='Set number of context lines (default 3)')\n" -" parser.add_argument('fromfile')\n" -" parser.add_argument('tofile')\n" -" options = parser.parse_args()\n" -"\n" -" n = options.lines\n" -" fromfile = options.fromfile\n" -" tofile = options.tofile\n" -"\n" -" fromdate = file_mtime(fromfile)\n" -" todate = file_mtime(tofile)\n" -" with open(fromfile) as ff:\n" -" fromlines = ff.readlines()\n" -" with open(tofile) as tf:\n" -" tolines = tf.readlines()\n" -"\n" -" if options.u:\n" -" diff = difflib.unified_diff(fromlines, tolines, fromfile, tofile, " -"fromdate, todate, n=n)\n" -" elif options.n:\n" -" diff = difflib.ndiff(fromlines, tolines)\n" -" elif options.m:\n" -" diff = difflib.HtmlDiff().make_file(fromlines,tolines,fromfile," -"tofile,context=options.c,numlines=n)\n" -" else:\n" -" diff = difflib.context_diff(fromlines, tolines, fromfile, tofile, " -"fromdate, todate, n=n)\n" -"\n" -" sys.stdout.writelines(diff)\n" -"\n" -"if __name__ == '__main__':\n" -" main()\n" -msgstr "" - -#: ../../library/difflib.rst:764 -msgid "ndiff example" -msgstr "" - -#: ../../library/difflib.rst:766 -msgid "This example shows how to use :func:`difflib.ndiff`." -msgstr "" - -#: ../../library/difflib.rst:768 -msgid "" -"\"\"\"ndiff [-q] file1 file2\n" -" or\n" -"ndiff (-r1 | -r2) < ndiff_output > file1_or_file2\n" -"\n" -"Print a human-friendly file difference report to stdout. Both inter-\n" -"and intra-line differences are noted. In the second form, recreate file1\n" -"(-r1) or file2 (-r2) on stdout, from an ndiff report on stdin.\n" -"\n" -"In the first form, if -q (\"quiet\") is not specified, the first two lines\n" -"of output are\n" -"\n" -"-: file1\n" -"+: file2\n" -"\n" -"Each remaining line begins with a two-letter code:\n" -"\n" -" \"- \" line unique to file1\n" -" \"+ \" line unique to file2\n" -" \" \" line common to both files\n" -" \"? \" line not present in either input file\n" -"\n" -"Lines beginning with \"? \" attempt to guide the eye to intraline\n" -"differences, and were not present in either input file. These lines can be\n" -"confusing if the source files contain tab characters.\n" -"\n" -"The first file can be recovered by retaining only lines that begin with\n" -"\" \" or \"- \", and deleting those 2-character prefixes; use ndiff with -" -"r1.\n" -"\n" -"The second file can be recovered similarly, but by retaining only \" \" " -"and\n" -"\"+ \" lines; use ndiff with -r2; or, on Unix, the second file can be\n" -"recovered by piping the output through\n" -"\n" -" sed -n '/^[+ ] /s/^..//p'\n" -"\"\"\"\n" -"\n" -"__version__ = 1, 7, 0\n" -"\n" -"import difflib, sys\n" -"\n" -"def fail(msg):\n" -" out = sys.stderr.write\n" -" out(msg + \"\\n\\n\")\n" -" out(__doc__)\n" -" return 0\n" -"\n" -"# open a file & return the file object; gripe and return 0 if it\n" -"# couldn't be opened\n" -"def fopen(fname):\n" -" try:\n" -" return open(fname)\n" -" except IOError as detail:\n" -" return fail(\"couldn't open \" + fname + \": \" + str(detail))\n" -"\n" -"# open two files & spray the diff to stdout; return false iff a problem\n" -"def fcompare(f1name, f2name):\n" -" f1 = fopen(f1name)\n" -" f2 = fopen(f2name)\n" -" if not f1 or not f2:\n" -" return 0\n" -"\n" -" a = f1.readlines(); f1.close()\n" -" b = f2.readlines(); f2.close()\n" -" for line in difflib.ndiff(a, b):\n" -" print(line, end=' ')\n" -"\n" -" return 1\n" -"\n" -"# crack args (sys.argv[1:] is normal) & compare;\n" -"# return false iff a problem\n" -"\n" -"def main(args):\n" -" import getopt\n" -" try:\n" -" opts, args = getopt.getopt(args, \"qr:\")\n" -" except getopt.error as detail:\n" -" return fail(str(detail))\n" -" noisy = 1\n" -" qseen = rseen = 0\n" -" for opt, val in opts:\n" -" if opt == \"-q\":\n" -" qseen = 1\n" -" noisy = 0\n" -" elif opt == \"-r\":\n" -" rseen = 1\n" -" whichfile = val\n" -" if qseen and rseen:\n" -" return fail(\"can't specify both -q and -r\")\n" -" if rseen:\n" -" if args:\n" -" return fail(\"no args allowed with -r option\")\n" -" if whichfile in (\"1\", \"2\"):\n" -" restore(whichfile)\n" -" return 1\n" -" return fail(\"-r value must be 1 or 2\")\n" -" if len(args) != 2:\n" -" return fail(\"need 2 filename args\")\n" -" f1name, f2name = args\n" -" if noisy:\n" -" print('-:', f1name)\n" -" print('+:', f2name)\n" -" return fcompare(f1name, f2name)\n" -"\n" -"# read ndiff output from stdin, and print file1 (which=='1') or\n" -"# file2 (which=='2') to stdout\n" -"\n" -"def restore(which):\n" -" restored = difflib.restore(sys.stdin.readlines(), which)\n" -" sys.stdout.writelines(restored)\n" -"\n" -"if __name__ == '__main__':\n" -" main(sys.argv[1:])\n" +"This example shows how to use difflib to create a ``diff``-like utility. It " +"is also contained in the Python source distribution, as :file:`Tools/scripts/" +"diff.py`." msgstr "" +"この例は、 difflib を使って ``diff`` に似たユーティリティーを作成する方法を示" +"します。これは、 Python のソース配布物にも、 :file:`Tools/scripts/diff.py` と" +"して含まれています。" diff --git a/library/dis.po b/library/dis.po index f4ac642f8..157665dc6 100644 --- a/library/dis.po +++ b/library/dis.po @@ -1,52 +1,53 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Nozomu Kaneko , 2023 -# Arihiro TAKASE, 2023 -# HIdeo Haga, 2023 -# tomo, 2023 -# 石井明久, 2024 +# E. Kawashima, 2017 +# Inada Naoki , 2017 +# 秘湯 , 2017 +# Arihiro TAKASE, 2017 +# 吉田 達矢 , 2018 +# tomo, 2019 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 01:04+0000\n" -"Last-Translator: 石井明久, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-07-29 07:05+0000\n" +"PO-Revision-Date: 2017-02-16 23:06+0000\n" +"Last-Translator: tomo, 2019\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/dis.rst:2 -msgid ":mod:`!dis` --- Disassembler for Python bytecode" -msgstr ":mod:`!dis` --- Python バイトコードの逆アセンブラー" +msgid ":mod:`dis` --- Disassembler for Python bytecode" +msgstr ":mod:`dis` --- Python バイトコードの逆アセンブラ" #: ../../library/dis.rst:7 msgid "**Source code:** :source:`Lib/dis.py`" msgstr "**ソースコード:** :source:`Lib/dis.py`" -#: ../../library/dis.rst:17 +#: ../../library/dis.rst:11 msgid "" "The :mod:`dis` module supports the analysis of CPython :term:`bytecode` by " "disassembling it. The CPython bytecode which this module takes as an input " "is defined in the file :file:`Include/opcode.h` and used by the compiler and " "the interpreter." msgstr "" -":mod:`dis` モジュールは CPython :term:`バイトコード ` を逆アセンブ" -"ルすることでバイトコードの解析をサポートします。このモジュールが入力として受" -"け取る CPython バイトコードはファイル :file:`Include/opcode.h` に定義されてお" +":mod:`dis` モジュールは CPython :term:`バイトコード bytecode` を逆アセンブル" +"することでバイトコードの解析をサポートします。 このモジュールが入力として受け" +"取る CPython バイトコードはファイル :file:`Include/opcode.h` に定義されてお" "り、 コンパイラとインタプリタが使用しています。" -#: ../../library/dis.rst:24 +#: ../../library/dis.rst:18 msgid "" "Bytecode is an implementation detail of the CPython interpreter. No " "guarantees are made that bytecode will not be added, removed, or changed " @@ -58,7 +59,7 @@ msgstr "" "使用することによって Python の異なる VM または異なるリリースの間で動作すると" "考えるべきではありません。" -#: ../../library/dis.rst:29 +#: ../../library/dis.rst:23 msgid "" "Use 2 bytes for each instruction. Previously the number of bytes varied by " "instruction." @@ -66,132 +67,27 @@ msgstr "" "従来は使用されるバイト数は命令ごとに異なりましたが、このモジュールでは各々一" "つの命令につき2バイト使用することとなっています。" -#: ../../library/dis.rst:33 -msgid "" -"The argument of jump, exception handling and loop instructions is now the " -"instruction offset rather than the byte offset." -msgstr "" - -#: ../../library/dis.rst:37 -msgid "" -"Some instructions are accompanied by one or more inline cache entries, which " -"take the form of :opcode:`CACHE` instructions. These instructions are hidden " -"by default, but can be shown by passing ``show_caches=True`` to any :mod:" -"`dis` utility. Furthermore, the interpreter now adapts the bytecode to " -"specialize it for different runtime conditions. The adaptive bytecode can be " -"shown by passing ``adaptive=True``." -msgstr "" - -#: ../../library/dis.rst:45 -msgid "" -"The argument of a jump is the offset of the target instruction relative to " -"the instruction that appears immediately after the jump instruction's :" -"opcode:`CACHE` entries." -msgstr "" - -#: ../../library/dis.rst:50 -msgid "" -"As a consequence, the presence of the :opcode:`CACHE` instructions is " -"transparent for forward jumps but needs to be taken into account when " -"reasoning about backward jumps." -msgstr "" - -#: ../../library/dis.rst:54 -msgid "" -"The output shows logical labels rather than instruction offsets for jump " -"targets and exception handlers. The ``-O`` command line option and the " -"``show_offsets`` argument were added." -msgstr "" - -#: ../../library/dis.rst:59 -msgid "" -"The :option:`-P ` command-line option and the " -"``show_positions`` argument were added." -msgstr "" - -#: ../../library/dis.rst:63 -msgid "The :option:`-S ` command-line option is added." -msgstr "" - -#: ../../library/dis.rst:65 -msgid "Example: Given the function :func:`!myfunc`::" -msgstr "" - -#: ../../library/dis.rst:67 -msgid "" -"def myfunc(alist):\n" -" return len(alist)" -msgstr "" +#: ../../library/dis.rst:28 +msgid "Example: Given the function :func:`myfunc`::" +msgstr "例: 以下の関数 :func:`myfunc` を考えると" -#: ../../library/dis.rst:70 -msgid "" -"the following command can be used to display the disassembly of :func:`!" -"myfunc`:" -msgstr "" - -#: ../../library/dis.rst:73 +#: ../../library/dis.rst:33 msgid "" -">>> dis.dis(myfunc)\n" -" 2 RESUME 0\n" -"\n" -" 3 LOAD_GLOBAL 1 (len + NULL)\n" -" LOAD_FAST_BORROW 0 (alist)\n" -" CALL 1\n" -" RETURN_VALUE" +"the following command can be used to display the disassembly of :func:" +"`myfunc`::" msgstr "" +":func:`myfunc` の逆アセンブル結果を表示するために次のコマンドを使うことができ" +"ます::" -#: ../../library/dis.rst:83 +#: ../../library/dis.rst:42 msgid "(The \"2\" is a line number)." msgstr "(\"2\" は行番号です)。" -#: ../../library/dis.rst:88 -msgid "Command-line interface" -msgstr "コマンドライン・インターフェース" - -#: ../../library/dis.rst:90 -msgid "The :mod:`dis` module can be invoked as a script from the command line:" -msgstr "" - -#: ../../library/dis.rst:92 -msgid "python -m dis [-h] [-C] [-O] [-P] [-S] [infile]" -msgstr "" - -#: ../../library/dis.rst:96 -msgid "The following options are accepted:" -msgstr "以下のオプションが使用できます:" - -#: ../../library/dis.rst:102 -msgid "Display usage and exit." -msgstr "使い方を表示して終了します。" - -#: ../../library/dis.rst:106 -msgid "Show inline caches." -msgstr "" - -#: ../../library/dis.rst:112 -msgid "Show offsets of instructions." -msgstr "" - -#: ../../library/dis.rst:118 -msgid "Show positions of instructions in the source code." -msgstr "" - -#: ../../library/dis.rst:124 -msgid "Show specialized bytecode." -msgstr "" - -#: ../../library/dis.rst:128 -msgid "" -"If :file:`infile` is specified, its disassembled code will be written to " -"stdout. Otherwise, disassembly is performed on compiled source code received " -"from stdin." -msgstr "" - -#: ../../library/dis.rst:132 +#: ../../library/dis.rst:45 msgid "Bytecode analysis" msgstr "バイトコード解析" -#: ../../library/dis.rst:136 +#: ../../library/dis.rst:49 msgid "" "The bytecode analysis API allows pieces of Python code to be wrapped in a :" "class:`Bytecode` object that provides easy access to details of the compiled " @@ -201,7 +97,7 @@ msgstr "" "ジェクトでラップでき、コンパイルされたコードの細かいところに簡単にアクセスで" "きます。" -#: ../../library/dis.rst:144 +#: ../../library/dis.rst:56 msgid "" "Analyse the bytecode corresponding to a function, generator, asynchronous " "generator, coroutine, method, string of source code, or a code object (as " @@ -211,7 +107,7 @@ msgstr "" "字列、(:func:`compile` が返すような) コードオブジェクトに対応するバイトコード" "を解析します。" -#: ../../library/dis.rst:148 +#: ../../library/dis.rst:60 msgid "" "This is a convenience wrapper around many of the functions listed below, " "most notably :func:`get_instructions`, as iterating over a :class:`Bytecode` " @@ -222,7 +118,7 @@ msgstr "" "スに対し反復処理をしながら、バイトコード命令を :class:`Instruction` インスタ" "ンスとして返します。" -#: ../../library/dis.rst:152 ../../library/dis.rst:373 +#: ../../library/dis.rst:64 ../../library/dis.rst:225 msgid "" "If *first_line* is not ``None``, it indicates the line number that should be " "reported for the first source line in the disassembled code. Otherwise, the " @@ -234,7 +130,7 @@ msgstr "" "そうでない場合は、ソースの行の情報 (もしあれば) を逆アセンブルされたコードオ" "ブジェクトから直接取得します。" -#: ../../library/dis.rst:157 +#: ../../library/dis.rst:69 msgid "" "If *current_offset* is not ``None``, it refers to an instruction offset in " "the disassembled code. Setting this means :meth:`.dis` will display a " @@ -245,31 +141,7 @@ msgstr "" "これを設定すると、 :meth:`.dis` の出力において、指定された命令コード " "(opcode) に \"現在の命令 (instruction)\" を表す印が表示されます。" -#: ../../library/dis.rst:161 -msgid "" -"If *show_caches* is ``True``, :meth:`.dis` will display inline cache entries " -"used by the interpreter to specialize the bytecode." -msgstr "" - -#: ../../library/dis.rst:164 -msgid "" -"If *adaptive* is ``True``, :meth:`.dis` will display specialized bytecode " -"that may be different from the original bytecode." -msgstr "" - -#: ../../library/dis.rst:167 -msgid "" -"If *show_offsets* is ``True``, :meth:`.dis` will include instruction offsets " -"in the output." -msgstr "" - -#: ../../library/dis.rst:170 -msgid "" -"If *show_positions* is ``True``, :meth:`.dis` will include instruction " -"source code positions in the output." -msgstr "" - -#: ../../library/dis.rst:175 +#: ../../library/dis.rst:75 msgid "" "Construct a :class:`Bytecode` instance from the given traceback, setting " "*current_offset* to the instruction responsible for the exception." @@ -277,15 +149,15 @@ msgstr "" "与えられたトレースバックから :class:`Bytecode` インスタンスを構築し、 " "*current_offset* がその例外の原因となった命令となるよう設定します。" -#: ../../library/dis.rst:180 +#: ../../library/dis.rst:80 msgid "The compiled code object." msgstr "コンパイルされたコードオブジェクト。" -#: ../../library/dis.rst:184 +#: ../../library/dis.rst:84 msgid "The first source line of the code object (if available)" msgstr "コードオブジェクトのソースの最初の行 (利用可能であれば)" -#: ../../library/dis.rst:188 +#: ../../library/dis.rst:88 msgid "" "Return a formatted view of the bytecode operations (the same as printed by :" "func:`dis.dis`, but returned as a multi-line string)." @@ -293,7 +165,7 @@ msgstr "" "バイトコード命令の整形された表示を返します (:func:`dis.dis` と同じ出力になり" "ますが、複数行文字列として返されます)。" -#: ../../library/dis.rst:193 +#: ../../library/dis.rst:93 msgid "" "Return a formatted multi-line string with detailed information about the " "code object, like :func:`code_info`." @@ -301,48 +173,19 @@ msgstr "" ":func:`code_info` のようなコードオブジェクトの詳細を含んだ整形された複数行文" "字列を返します。" -#: ../../library/dis.rst:196 ../../library/dis.rst:242 -#: ../../library/dis.rst:295 +#: ../../library/dis.rst:96 ../../library/dis.rst:130 ../../library/dis.rst:176 msgid "This can now handle coroutine and asynchronous generator objects." msgstr "" -#: ../../library/dis.rst:199 ../../library/dis.rst:298 -#: ../../library/dis.rst:320 ../../library/dis.rst:356 -#: ../../library/dis.rst:382 -msgid "Added the *show_caches* and *adaptive* parameters." -msgstr "" - -#: ../../library/dis.rst:202 -msgid "Added the *show_offsets* parameter" -msgstr "" - -#: ../../library/dis.rst:205 ../../library/dis.rst:304 -#: ../../library/dis.rst:326 ../../library/dis.rst:362 -msgid "Added the *show_positions* parameter." -msgstr "" - -#: ../../library/dis.rst:208 -msgid "Example:" -msgstr "例:" - -#: ../../library/dis.rst:210 -msgid "" -">>> bytecode = dis.Bytecode(myfunc)\n" -">>> for instr in bytecode:\n" -"... print(instr.opname)\n" -"...\n" -"RESUME\n" -"LOAD_GLOBAL\n" -"LOAD_FAST_BORROW\n" -"CALL\n" -"RETURN_VALUE" -msgstr "" +#: ../../library/dis.rst:99 +msgid "Example::" +msgstr "以下はプログラム例です::" -#: ../../library/dis.rst:224 +#: ../../library/dis.rst:112 msgid "Analysis functions" msgstr "解析関数" -#: ../../library/dis.rst:226 +#: ../../library/dis.rst:114 msgid "" "The :mod:`dis` module also defines the following analysis functions that " "convert the input directly to the desired output. They can be useful if only " @@ -354,7 +197,7 @@ msgstr "" "1つの命令だけが実行されている場合は、解析オブジェクトをいったん作るよりはこち" "らの方が便利です:" -#: ../../library/dis.rst:232 +#: ../../library/dis.rst:120 msgid "" "Return a formatted multi-line string with detailed code object information " "for the supplied function, generator, asynchronous generator, coroutine, " @@ -364,7 +207,7 @@ msgstr "" "コード文字列、コードオブジェクトに対する、詳細なコードオブジェクトの情報を、" "整形された複数行の文字列として返します。" -#: ../../library/dis.rst:236 +#: ../../library/dis.rst:124 msgid "" "Note that the exact contents of code info strings are highly implementation " "dependent and they may change arbitrarily across Python VMs or Python " @@ -373,7 +216,7 @@ msgstr "" "この結果は実装に強く依存しており、Python VM や Python のバージョンによって異" "なることがあります。" -#: ../../library/dis.rst:248 +#: ../../library/dis.rst:136 msgid "" "Print detailed code object information for the supplied function, method, " "source code string or code object to *file* (or ``sys.stdout`` if *file* is " @@ -383,7 +226,7 @@ msgstr "" "なコードオブジェクトの情報を、*file* (または *file* が指定されていなければ " "``sys.stdout``) に表示します。" -#: ../../library/dis.rst:252 +#: ../../library/dis.rst:140 msgid "" "This is a convenient shorthand for ``print(code_info(x), file=file)``, " "intended for interactive exploration at the interpreter prompt." @@ -391,12 +234,12 @@ msgstr "" "これは、インタラクティブシェル上で使うことを想定した、``print(code_info(x), " "file=file)`` の便利なショートカットです。" -#: ../../library/dis.rst:257 ../../library/dis.rst:289 -#: ../../library/dis.rst:317 ../../library/dis.rst:353 +#: ../../library/dis.rst:145 ../../library/dis.rst:170 +#: ../../library/dis.rst:189 ../../library/dis.rst:213 msgid "Added *file* parameter." msgstr "*file* 引数が追加されました。" -#: ../../library/dis.rst:264 +#: ../../library/dis.rst:151 msgid "" "Disassemble the *x* object. *x* can denote either a module, a class, a " "method, a function, a generator, an asynchronous generator, a coroutine, a " @@ -404,16 +247,15 @@ msgid "" "a module, it disassembles all functions. For a class, it disassembles all " "methods (including class and static methods). For a code object or sequence " "of raw bytecode, it prints one line per bytecode instruction. It also " -"recursively disassembles nested code objects. These can include generator " -"expressions, nested functions, the bodies of nested classes, and the code " -"objects used for :ref:`annotation scopes `. Strings are " -"first compiled to code objects with the :func:`compile` built-in function " -"before being disassembled. If no object is provided, this function " -"disassembles the last traceback." +"recursively disassembles nested code objects (the code of comprehensions, " +"generator expressions and nested functions, and the code used for building " +"nested classes). Strings are first compiled to code objects with the :func:" +"`compile` built-in function before being disassembled. If no object is " +"provided, this function disassembles the last traceback." msgstr "" -#: ../../library/dis.rst:277 ../../library/dis.rst:314 -#: ../../library/dis.rst:350 +#: ../../library/dis.rst:164 ../../library/dis.rst:186 +#: ../../library/dis.rst:210 msgid "" "The disassembly is written as text to the supplied *file* argument if " "provided and to ``sys.stdout`` otherwise." @@ -421,34 +263,17 @@ msgstr "" "*file* 引数が渡された場合は、アセンブリをそこに書き込みます。\n" "そうでない場合は ``sys.stdout`` に出力します。" -#: ../../library/dis.rst:280 +#: ../../library/dis.rst:167 msgid "" "The maximal depth of recursion is limited by *depth* unless it is ``None``. " "``depth=0`` means no recursion." msgstr "" -#: ../../library/dis.rst:283 -msgid "" -"If *show_caches* is ``True``, this function will display inline cache " -"entries used by the interpreter to specialize the bytecode." -msgstr "" - -#: ../../library/dis.rst:286 -msgid "" -"If *adaptive* is ``True``, this function will display specialized bytecode " -"that may be different from the original bytecode." -msgstr "" - -#: ../../library/dis.rst:292 +#: ../../library/dis.rst:173 msgid "Implemented recursive disassembling and added *depth* parameter." msgstr "" -#: ../../library/dis.rst:301 ../../library/dis.rst:323 -#: ../../library/dis.rst:359 -msgid "Added the *show_offsets* parameter." -msgstr "" - -#: ../../library/dis.rst:310 +#: ../../library/dis.rst:182 msgid "" "Disassemble the top-of-stack function of a traceback, using the last " "traceback if none was passed. The instruction causing the exception is " @@ -457,7 +282,7 @@ msgstr "" "トレースバックのスタックの先頭の関数を逆アセンブルします。Noneが渡された場合" "は最後のトレースバックを使います。例外を引き起こした命令が表示されます。" -#: ../../library/dis.rst:334 +#: ../../library/dis.rst:196 msgid "" "Disassemble a code object, indicating the last instruction if *lasti* was " "provided. The output is divided in the following columns:" @@ -465,38 +290,35 @@ msgstr "" "コードオブジェクトを逆アセンブルします。*lasti* が与えられた場合は、最後の命" "令を示します。出力は次のようなカラムに分割されます:" -#: ../../library/dis.rst:337 -msgid "" -"the source code location of the instruction. Complete location information " -"is shown if *show_positions* is true. Otherwise (the default) only the line " -"number is displayed." -msgstr "" +#: ../../library/dis.rst:199 +msgid "the line number, for the first instruction of each line" +msgstr "各行の最初の命令に対する行番号。" -#: ../../library/dis.rst:340 +#: ../../library/dis.rst:200 msgid "the current instruction, indicated as ``-->``," msgstr "現在の命令。 ``-->`` として示されます。" -#: ../../library/dis.rst:341 +#: ../../library/dis.rst:201 msgid "a labelled instruction, indicated with ``>>``," msgstr "ラベル付けされた命令。 ``>>`` とともに表示されます。" -#: ../../library/dis.rst:342 +#: ../../library/dis.rst:202 msgid "the address of the instruction," msgstr "命令のアドレス。" -#: ../../library/dis.rst:343 +#: ../../library/dis.rst:203 msgid "the operation code name," msgstr "命令コード名。" -#: ../../library/dis.rst:344 +#: ../../library/dis.rst:204 msgid "operation parameters, and" msgstr "命令パラメタ。" -#: ../../library/dis.rst:345 +#: ../../library/dis.rst:205 msgid "interpretation of the parameters in parentheses." msgstr "パラメタの解釈を括弧で囲んだもの。" -#: ../../library/dis.rst:347 +#: ../../library/dis.rst:207 msgid "" "The parameter interpretation recognizes local and global variable names, " "constant values, branch targets, and compare operators." @@ -504,7 +326,7 @@ msgstr "" "パラメタの解釈は、ローカル変数とグローバル変数の名前、定数の値、 分岐先、比較" "命令を認識します。" -#: ../../library/dis.rst:367 +#: ../../library/dis.rst:219 msgid "" "Return an iterator over the instructions in the supplied function, method, " "source code string or code object." @@ -512,7 +334,7 @@ msgstr "" "渡された関数、メソッド、ソースコード文字列、コードオブジェクトにある命令のイ" "テレータを返します。" -#: ../../library/dis.rst:370 +#: ../../library/dis.rst:222 msgid "" "The iterator generates a series of :class:`Instruction` named tuples giving " "the details of each operation in the supplied code." @@ -520,53 +342,30 @@ msgstr "" "イテレータは、与えられたコードの各命令の詳細情報を保持する名前付きタプル :" "class:`Instruction` からなる列を生成します。" -#: ../../library/dis.rst:378 -msgid "The *adaptive* parameter works as it does in :func:`dis`." -msgstr "" - -#: ../../library/dis.rst:385 -msgid "" -"The *show_caches* parameter is deprecated and has no effect. The iterator " -"generates the :class:`Instruction` instances with the *cache_info* field " -"populated (regardless of the value of *show_caches*) and it no longer " -"generates separate items for the cache entries." -msgstr "" - -#: ../../library/dis.rst:393 +#: ../../library/dis.rst:235 msgid "" -"This generator function uses the :meth:`~codeobject.co_lines` method of the :" -"ref:`code object ` *code* to find the offsets which are starts " -"of lines in the source code. They are generated as ``(offset, lineno)`` " -"pairs." +"This generator function uses the ``co_firstlineno`` and ``co_lnotab`` " +"attributes of the code object *code* to find the offsets which are starts of " +"lines in the source code. They are generated as ``(offset, lineno)`` pairs. " +"See :source:`Objects/lnotab_notes.txt` for the ``co_lnotab`` format and how " +"to decode it." msgstr "" -#: ../../library/dis.rst:398 +#: ../../library/dis.rst:241 msgid "Line numbers can be decreasing. Before, they were always increasing." msgstr "" -#: ../../library/dis.rst:401 -msgid "" -"The :pep:`626` :meth:`~codeobject.co_lines` method is used instead of the :" -"attr:`~codeobject.co_firstlineno` and :attr:`~codeobject.co_lnotab` " -"attributes of the :ref:`code object `." -msgstr "" - -#: ../../library/dis.rst:406 -msgid "" -"Line numbers can be ``None`` for bytecode that does not map to source lines." -msgstr "" - -#: ../../library/dis.rst:412 +#: ../../library/dis.rst:247 msgid "" "Detect all offsets in the raw compiled bytecode string *code* which are jump " "targets, and return a list of these offsets." msgstr "" -#: ../../library/dis.rst:418 +#: ../../library/dis.rst:253 msgid "Compute the stack effect of *opcode* with argument *oparg*." msgstr "*opcode* と引数 *oparg* がスタックに与える影響を計算します。" -#: ../../library/dis.rst:420 +#: ../../library/dis.rst:255 msgid "" "If the code has a jump target and *jump* is ``True``, :func:`~stack_effect` " "will return the stack effect of jumping. If *jump* is ``False``, it will " @@ -574,23 +373,15 @@ msgid "" "it will return the maximal stack effect of both cases." msgstr "" -#: ../../library/dis.rst:427 +#: ../../library/dis.rst:262 msgid "Added *jump* parameter." msgstr "" -#: ../../library/dis.rst:430 -msgid "" -"If ``oparg`` is omitted (or ``None``), the stack effect is now returned for " -"``oparg=0``. Previously this was an error for opcodes that use their arg. It " -"is also no longer an error to pass an integer ``oparg`` when the ``opcode`` " -"does not use it; the ``oparg`` in this case is ignored." -msgstr "" - -#: ../../library/dis.rst:440 +#: ../../library/dis.rst:269 msgid "Python Bytecode Instructions" msgstr "Python バイトコード命令" -#: ../../library/dis.rst:442 +#: ../../library/dis.rst:271 msgid "" "The :func:`get_instructions` function and :class:`Bytecode` class provide " "details of bytecode instructions as :class:`Instruction` instances:" @@ -598,11 +389,11 @@ msgstr "" ":func:`get_instructions` 関数と :class:`Bytecode` クラスはバイトコード命令の" "詳細を :class:`Instruction` インスタンスの形で提供します:" -#: ../../library/dis.rst:447 +#: ../../library/dis.rst:276 msgid "Details for a bytecode operation" msgstr "バイトコード命令の詳細" -#: ../../library/dis.rst:451 +#: ../../library/dis.rst:280 msgid "" "numeric code for operation, corresponding to the opcode values listed below " "and the bytecode values in the :ref:`opcode_collections`." @@ -610,423 +401,356 @@ msgstr "" "以下の命令コードの値と :ref:`opcode_collections` のバイトコードの値に対応す" "る、命令の数値コードです。" -#: ../../library/dis.rst:457 +#: ../../library/dis.rst:286 msgid "human readable name for operation" msgstr "人間が読むための命令名" -#: ../../library/dis.rst:462 -msgid "" -"numeric code for the base operation if operation is specialized; otherwise " -"equal to :data:`opcode`" -msgstr "" - -#: ../../library/dis.rst:468 -msgid "" -"human readable name for the base operation if operation is specialized; " -"otherwise equal to :data:`opname`" -msgstr "" - -#: ../../library/dis.rst:474 +#: ../../library/dis.rst:291 msgid "numeric argument to operation (if any), otherwise ``None``" msgstr "(ある場合は) 命令の数値引数、無ければ ``None``" -#: ../../library/dis.rst:478 -msgid "alias for :data:`arg`" -msgstr "" - -#: ../../library/dis.rst:482 -msgid "resolved arg value (if any), otherwise ``None``" +#: ../../library/dis.rst:296 +msgid "resolved arg value (if known), otherwise same as arg" msgstr "" +"(もし分かっていれば) 解決された引数の値、そうでない場合は arg と同じもの" -#: ../../library/dis.rst:487 -msgid "" -"human readable description of operation argument (if any), otherwise an " -"empty string." -msgstr "" +#: ../../library/dis.rst:301 +msgid "human readable description of operation argument" +msgstr "人間が読むための命令引数の説明" -#: ../../library/dis.rst:493 +#: ../../library/dis.rst:306 msgid "start index of operation within bytecode sequence" msgstr "バイトコード列の中での命令の開始位置" -#: ../../library/dis.rst:498 -msgid "" -"start index of operation within bytecode sequence, including prefixed " -"``EXTENDED_ARG`` operations if present; otherwise equal to :data:`offset`" -msgstr "" - -#: ../../library/dis.rst:504 -msgid "start index of the cache entries following the operation" -msgstr "" - -#: ../../library/dis.rst:509 -msgid "end index of the cache entries following the operation" -msgstr "" - -#: ../../library/dis.rst:514 -msgid "``True`` if this opcode starts a source line, otherwise ``False``" -msgstr "" - -#: ../../library/dis.rst:519 -msgid "" -"source line number associated with this opcode (if any), otherwise ``None``" -msgstr "" +#: ../../library/dis.rst:311 +msgid "line started by this opcode (if any), otherwise ``None``" +msgstr "(ある場合は) この命令コードが始まる行、無ければ ``None``" -#: ../../library/dis.rst:524 +#: ../../library/dis.rst:316 msgid "``True`` if other code jumps to here, otherwise ``False``" msgstr "" "他のコードからここへジャンプする場合は ``True`` 、そうでない場合は ``False``" -#: ../../library/dis.rst:529 +#: ../../library/dis.rst:321 msgid "" -"bytecode index of the jump target if this is a jump operation, otherwise " -"``None``" -msgstr "" +"The Python compiler currently generates the following bytecode instructions." +msgstr "現在 Python コンパイラは次のバイトコード命令を生成します。" -#: ../../library/dis.rst:535 -msgid "" -":class:`dis.Positions` object holding the start and end locations that are " -"covered by this instruction." -msgstr "" +#: ../../library/dis.rst:324 +msgid "**General instructions**" +msgstr "**一般的な命令**" -#: ../../library/dis.rst:540 -msgid "" -"Information about the cache entries of this instruction, as triplets of the " -"form ``(name, size, data)``, where the ``name`` and ``size`` describe the " -"cache format and data is the contents of the cache. ``cache_info`` is " -"``None`` if the instruction does not have caches." +#: ../../library/dis.rst:328 +msgid "Do nothing code. Used as a placeholder by the bytecode optimizer." msgstr "" +"なにもしないコード。バイトコードオプティマイザでプレースホルダとして使われま" +"す。" -#: ../../library/dis.rst:550 -msgid "Field ``positions`` is added." -msgstr "" +#: ../../library/dis.rst:333 +msgid "Removes the top-of-stack (TOS) item." +msgstr "スタックの先頭 (TOS) の要素を取り除きます。" -#: ../../library/dis.rst:554 -msgid "Changed field ``starts_line``." -msgstr "" +#: ../../library/dis.rst:338 +msgid "Swaps the two top-most stack items." +msgstr "スタックの先頭の 2 つの要素を入れ替えます。" -#: ../../library/dis.rst:556 +#: ../../library/dis.rst:343 msgid "" -"Added fields ``start_offset``, ``cache_offset``, ``end_offset``, " -"``baseopname``, ``baseopcode``, ``jump_target``, ``oparg``, ``line_number`` " -"and ``cache_info``." +"Lifts second and third stack item one position up, moves top down to " +"position three." msgstr "" +"スタックの二番目と三番目の要素の位置を 1 つ上げ、先頭を三番目へ下げます。" -#: ../../library/dis.rst:563 +#: ../../library/dis.rst:349 msgid "" -"In case the information is not available, some fields might be ``None``." +"Lifts second, third and fourth stack items one position up, moves top down " +"to position four." msgstr "" -#: ../../library/dis.rst:573 +#: ../../library/dis.rst:357 +msgid "Duplicates the reference on top of the stack." +msgstr "スタックの先頭にある参照の複製を作ります。" + +#: ../../library/dis.rst:364 msgid "" -"The Python compiler currently generates the following bytecode instructions." -msgstr "現在 Python コンパイラは次のバイトコード命令を生成します。" +"Duplicates the two references on top of the stack, leaving them in the same " +"order." +msgstr "スタックの先頭の2つの参照を、そのままの順番で複製します。" -#: ../../library/dis.rst:576 -msgid "**General instructions**" -msgstr "**一般的な命令**" +#: ../../library/dis.rst:370 +msgid "**Unary operations**" +msgstr "**1オペランド命令**" -#: ../../library/dis.rst:578 +#: ../../library/dis.rst:372 msgid "" -"In the following, We will refer to the interpreter stack as ``STACK`` and " -"describe operations on it as if it was a Python list. The top of the stack " -"corresponds to ``STACK[-1]`` in this language." +"Unary operations take the top of the stack, apply the operation, and push " +"the result back on the stack." msgstr "" +"1オペランド命令はスタックの先頭を取り出して操作を適用し、結果をスタックへプッ" +"シュし戻します。" -#: ../../library/dis.rst:584 -msgid "" -"Do nothing code. Used as a placeholder by the bytecode optimizer, and to " -"generate line tracing events." -msgstr "" +#: ../../library/dis.rst:377 +msgid "Implements ``TOS = +TOS``." +msgstr "``TOS = +TOS`` を実行します。" -#: ../../library/dis.rst:590 -msgid "Removes the top-of-stack item::" -msgstr "" +#: ../../library/dis.rst:382 +msgid "Implements ``TOS = -TOS``." +msgstr "``TOS = -TOS`` を実行します。" -#: ../../library/dis.rst:592 -msgid "STACK.pop()" -msgstr "" +#: ../../library/dis.rst:387 +msgid "Implements ``TOS = not TOS``." +msgstr "``TOS = not TOS`` を実行します。" -#: ../../library/dis.rst:597 -msgid "" -"Removes the top-of-stack item. Equivalent to ``POP_TOP``. Used to clean up " -"at the end of loops, hence the name." -msgstr "" +#: ../../library/dis.rst:392 +msgid "Implements ``TOS = ~TOS``." +msgstr "``TOS = ~TOS`` を実行します。" -#: ../../library/dis.rst:606 -msgid "Implements ``del STACK[-2]``. Used to clean up when a generator exits." -msgstr "" +#: ../../library/dis.rst:397 +msgid "Implements ``TOS = iter(TOS)``." +msgstr "``TOS = iter(TOS)`` を実行します。" -#: ../../library/dis.rst:614 +#: ../../library/dis.rst:402 msgid "" -"Push the i-th item to the top of the stack without removing it from its " -"original location::" +"If ``TOS`` is a :term:`generator iterator` or :term:`coroutine` object it is " +"left as is. Otherwise, implements ``TOS = iter(TOS)``." msgstr "" +"``TOS`` が :term:`generator iterator` もしくは :term:`coroutine` オブジェクト" +"の場合は、そのままにしておきます。\n" +"そうでない場合は ``TOS = iter(TOS)`` を実行します。" + +#: ../../library/dis.rst:408 +msgid "**Binary operations**" +msgstr "**2オペランド命令**" -#: ../../library/dis.rst:617 +#: ../../library/dis.rst:410 msgid "" -"assert i > 0\n" -"STACK.append(STACK[-i])" +"Binary operations remove the top of the stack (TOS) and the second top-most " +"stack item (TOS1) from the stack. They perform the operation, and put the " +"result back on the stack." msgstr "" +"二項命令はスタックの先頭 (TOS) と先頭から二番目の要素をスタックから取り除きま" +"す。 命令を実行し、スタックへ結果をプッシュし戻します。" -#: ../../library/dis.rst:625 -msgid "Swap the top of the stack with the i-th element::" -msgstr "" +#: ../../library/dis.rst:416 +msgid "Implements ``TOS = TOS1 ** TOS``." +msgstr "``TOS = TOS1 ** TOS`` を実行します。" -#: ../../library/dis.rst:627 -msgid "STACK[-i], STACK[-1] = STACK[-1], STACK[-i]" -msgstr "" +#: ../../library/dis.rst:421 +msgid "Implements ``TOS = TOS1 * TOS``." +msgstr "``TOS = TOS1 * TOS`` を実行します。" -#: ../../library/dis.rst:634 -msgid "" -"Rather than being an actual instruction, this opcode is used to mark extra " -"space for the interpreter to cache useful data directly in the bytecode " -"itself. It is automatically hidden by all ``dis`` utilities, but can be " -"viewed with ``show_caches=True``." -msgstr "" +#: ../../library/dis.rst:426 +msgid "Implements ``TOS = TOS1 @ TOS``." +msgstr "``TOS = TOS1 @ TOS`` を実行します。" -#: ../../library/dis.rst:639 -msgid "" -"Logically, this space is part of the preceding instruction. Many opcodes " -"expect to be followed by an exact number of caches, and will instruct the " -"interpreter to skip over them at runtime." -msgstr "" +#: ../../library/dis.rst:433 +msgid "Implements ``TOS = TOS1 // TOS``." +msgstr "``TOS = TOS1 // TOS`` を実行します。" -#: ../../library/dis.rst:643 -msgid "" -"Populated caches can look like arbitrary instructions, so great care should " -"be taken when reading or modifying raw, adaptive bytecode containing " -"quickened data." -msgstr "" +#: ../../library/dis.rst:438 +msgid "Implements ``TOS = TOS1 / TOS``." +msgstr "``TOS = TOS1 / TOS`` を実行します。" -#: ../../library/dis.rst:650 -msgid "**Unary operations**" -msgstr "**1オペランド命令**" +#: ../../library/dis.rst:443 +msgid "Implements ``TOS = TOS1 % TOS``." +msgstr "``TOS = TOS1 % TOS`` を実行します。" -#: ../../library/dis.rst:652 -msgid "" -"Unary operations take the top of the stack, apply the operation, and push " -"the result back on the stack." -msgstr "" -"1オペランド命令はスタックの先頭を取り出して操作を適用し、結果をスタックへプッ" -"シュし戻します。" +#: ../../library/dis.rst:448 +msgid "Implements ``TOS = TOS1 + TOS``." +msgstr "``TOS = TOS1 + TOS`` を実行します。" -#: ../../library/dis.rst:658 -msgid "Implements ``STACK[-1] = -STACK[-1]``." -msgstr "" +#: ../../library/dis.rst:453 +msgid "Implements ``TOS = TOS1 - TOS``." +msgstr "``TOS = TOS1 - TOS`` を実行します。" -#: ../../library/dis.rst:663 -msgid "Implements ``STACK[-1] = not STACK[-1]``." -msgstr "" +#: ../../library/dis.rst:458 +msgid "Implements ``TOS = TOS1[TOS]``." +msgstr "``TOS = TOS1[TOS]`` を実行します。" -#: ../../library/dis.rst:665 ../../library/dis.rst:1333 -#: ../../library/dis.rst:1349 -msgid "This instruction now requires an exact :class:`bool` operand." -msgstr "" +#: ../../library/dis.rst:463 +msgid "Implements ``TOS = TOS1 << TOS``." +msgstr "``TOS = TOS1 << TOS`` を実行します。" -#: ../../library/dis.rst:671 -msgid "Implements ``STACK[-1] = ~STACK[-1]``." -msgstr "" +#: ../../library/dis.rst:468 +msgid "Implements ``TOS = TOS1 >> TOS``." +msgstr "``TOS = TOS1 >> TOS`` を実行します。" -#: ../../library/dis.rst:676 -msgid "Implements ``STACK[-1] = iter(STACK[-1])``." -msgstr "" +#: ../../library/dis.rst:473 +msgid "Implements ``TOS = TOS1 & TOS``." +msgstr "``TOS = TOS1 & TOS`` を実行します。" -#: ../../library/dis.rst:681 -msgid "" -"If ``STACK[-1]`` is a :term:`generator iterator` or :term:`coroutine` object " -"it is left as is. Otherwise, implements ``STACK[-1] = iter(STACK[-1])``." -msgstr "" +#: ../../library/dis.rst:478 +msgid "Implements ``TOS = TOS1 ^ TOS``." +msgstr "``TOS = TOS1 ^ TOS`` を実行します。" -#: ../../library/dis.rst:689 -msgid "Implements ``STACK[-1] = bool(STACK[-1])``." -msgstr "" +#: ../../library/dis.rst:483 +msgid "Implements ``TOS = TOS1 | TOS``." +msgstr "``TOS = TOS1 | TOS`` を実行します。" -#: ../../library/dis.rst:694 -msgid "**Binary and in-place operations**" -msgstr "" +#: ../../library/dis.rst:486 +msgid "**In-place operations**" +msgstr "**インプレース (in-place) 命令**" -#: ../../library/dis.rst:696 +#: ../../library/dis.rst:488 msgid "" -"Binary operations remove the top two items from the stack (``STACK[-1]`` and " -"``STACK[-2]``). They perform the operation, then put the result back on the " -"stack." +"In-place operations are like binary operations, in that they remove TOS and " +"TOS1, and push the result back on the stack, but the operation is done in-" +"place when TOS1 supports it, and the resulting TOS may be (but does not have " +"to be) the original TOS1." msgstr "" +"インプレース命令は TOS と TOS1 を取り除いて結果をスタックへプッシュするという" +"点で二項命令と似ています。 しかし、TOS1 がインプレース命令をサポートしている" +"場合には操作が直接 TOS1 に行われます。 また、操作結果の TOS は (常に同じとい" +"うわけではありませんが) 元の TOS1 と同じオブジェクトになることが多いです。" -#: ../../library/dis.rst:699 -msgid "" -"In-place operations are like binary operations, but the operation is done in-" -"place when ``STACK[-2]`` supports it, and the resulting ``STACK[-1]`` may be " -"(but does not have to be) the original ``STACK[-2]``." -msgstr "" +#: ../../library/dis.rst:495 +msgid "Implements in-place ``TOS = TOS1 ** TOS``." +msgstr "インプレースの ``TOS = TOS1 ** TOS`` を実行します。" -#: ../../library/dis.rst:706 -msgid "" -"Implements the binary and in-place operators (depending on the value of " -"*op*)::" -msgstr "" +#: ../../library/dis.rst:500 +msgid "Implements in-place ``TOS = TOS1 * TOS``." +msgstr "インプレースの ``TOS = TOS1 * TOS`` を実行します。" -#: ../../library/dis.rst:709 -msgid "" -"rhs = STACK.pop()\n" -"lhs = STACK.pop()\n" -"STACK.append(lhs op rhs)" -msgstr "" +#: ../../library/dis.rst:505 +msgid "Implements in-place ``TOS = TOS1 @ TOS``." +msgstr "インプレースの ``TOS = TOS1 @ TOS`` を実行します。" -#: ../../library/dis.rst:714 -msgid "" -"With oparg :``NB_SUBSCR``, implements binary subscript (replaces opcode " -"``BINARY_SUBSCR``)" -msgstr "" +#: ../../library/dis.rst:512 +msgid "Implements in-place ``TOS = TOS1 // TOS``." +msgstr "インプレースの ``TOS = TOS1 // TOS`` を実行します。" -#: ../../library/dis.rst:720 ../../library/dis.rst:730 -#: ../../library/dis.rst:738 ../../library/dis.rst:750 -#: ../../library/dis.rst:828 ../../library/dis.rst:838 -#: ../../library/dis.rst:848 ../../library/dis.rst:1054 -#: ../../library/dis.rst:1065 ../../library/dis.rst:1176 -#: ../../library/dis.rst:1188 ../../library/dis.rst:1200 -msgid "Implements::" -msgstr "" +#: ../../library/dis.rst:517 +msgid "Implements in-place ``TOS = TOS1 / TOS``." +msgstr "インプレースの ``TOS = TOS1 / TOS`` を実行します。" -#: ../../library/dis.rst:722 -msgid "" -"key = STACK.pop()\n" -"container = STACK.pop()\n" -"value = STACK.pop()\n" -"container[key] = value" -msgstr "" +#: ../../library/dis.rst:522 +msgid "Implements in-place ``TOS = TOS1 % TOS``." +msgstr "インプレースの ``TOS = TOS1 % TOS`` を実行します。" -#: ../../library/dis.rst:732 -msgid "" -"key = STACK.pop()\n" -"container = STACK.pop()\n" -"del container[key]" -msgstr "" +#: ../../library/dis.rst:527 +msgid "Implements in-place ``TOS = TOS1 + TOS``." +msgstr "インプレースの ``TOS = TOS1 + TOS`` を実行します。" -#: ../../library/dis.rst:740 -msgid "" -"end = STACK.pop()\n" -"start = STACK.pop()\n" -"container = STACK.pop()\n" -"STACK.append(container[start:end])" -msgstr "" +#: ../../library/dis.rst:532 +msgid "Implements in-place ``TOS = TOS1 - TOS``." +msgstr "インプレースの ``TOS = TOS1 - TOS`` を実行します。" -#: ../../library/dis.rst:752 -msgid "" -"end = STACK.pop()\n" -"start = STACK.pop()\n" -"container = STACK.pop()\n" -"values = STACK.pop()\n" -"container[start:end] = value" -msgstr "" +#: ../../library/dis.rst:537 +msgid "Implements in-place ``TOS = TOS1 << TOS``." +msgstr "インプレースの ``TOS = TOS1 << TOS`` を実行します。" -#: ../../library/dis.rst:761 -msgid "**Coroutine opcodes**" -msgstr "**コルーチン命令コード**" +#: ../../library/dis.rst:542 +msgid "Implements in-place ``TOS = TOS1 >> TOS``." +msgstr "インプレースの ``TOS = TOS1 >> TOS`` を実行します。" -#: ../../library/dis.rst:765 -msgid "" -"Implements ``STACK[-1] = get_awaitable(STACK[-1])``, where " -"``get_awaitable(o)`` returns ``o`` if ``o`` is a coroutine object or a " -"generator object with the :data:`~inspect.CO_ITERABLE_COROUTINE` flag, or " -"resolves ``o.__await__``." -msgstr "" +#: ../../library/dis.rst:547 +msgid "Implements in-place ``TOS = TOS1 & TOS``." +msgstr "インプレースの ``TOS = TOS1 & TOS`` を実行します。" -#: ../../library/dis.rst:770 -msgid "" -"If the ``where`` operand is nonzero, it indicates where the instruction " -"occurs:" -msgstr "" +#: ../../library/dis.rst:552 +msgid "Implements in-place ``TOS = TOS1 ^ TOS``." +msgstr "インプレースの ``TOS = TOS1 ^ TOS`` を実行します。" -#: ../../library/dis.rst:773 -msgid "``1``: After a call to ``__aenter__``" -msgstr "" +#: ../../library/dis.rst:557 +msgid "Implements in-place ``TOS = TOS1 | TOS``." +msgstr "インプレースの ``TOS = TOS1 | TOS`` を実行します。" -#: ../../library/dis.rst:774 -msgid "``2``: After a call to ``__aexit__``" -msgstr "" +#: ../../library/dis.rst:562 +msgid "Implements ``TOS1[TOS] = TOS2``." +msgstr "``TOS1[TOS] = TOS2`` を実行します。" + +#: ../../library/dis.rst:567 +msgid "Implements ``del TOS1[TOS]``." +msgstr "``del TOS1[TOS]`` を実行します。" -#: ../../library/dis.rst:778 -msgid "Previously, this instruction did not have an oparg." +#: ../../library/dis.rst:570 +msgid "**Coroutine opcodes**" +msgstr "**コルーチン命令コード**" + +#: ../../library/dis.rst:574 +msgid "" +"Implements ``TOS = get_awaitable(TOS)``, where ``get_awaitable(o)`` returns " +"``o`` if ``o`` is a coroutine object or a generator object with the " +"CO_ITERABLE_COROUTINE flag, or resolves ``o.__await__``." msgstr "" +"``TOS = get_awaitable(TOS)`` を実行します。\n" +"``get_awaitable(o)`` は、 ``o`` がコルーチンオブジェクトもしくは " +"CO_ITERABLE_COROUTINE フラグの付いたジェネレータオブジェクトの場合に ``o`` を" +"返し、そうでない場合は ``o.__await__`` を解決します。" -#: ../../library/dis.rst:784 -msgid "Implements ``STACK[-1] = STACK[-1].__aiter__()``." +#: ../../library/dis.rst:584 +msgid "Implements ``TOS = TOS.__aiter__()``." msgstr "" -#: ../../library/dis.rst:787 +#: ../../library/dis.rst:587 msgid "Returning awaitable objects from ``__aiter__`` is no longer supported." msgstr "" -#: ../../library/dis.rst:794 +#: ../../library/dis.rst:594 msgid "" -"Implement ``STACK.append(get_awaitable(STACK[-1].__anext__()))`` to the " -"stack. See ``GET_AWAITABLE`` for details about ``get_awaitable``." +"Implements ``PUSH(get_awaitable(TOS.__anext__()))``. See ``GET_AWAITABLE`` " +"for details about ``get_awaitable``" msgstr "" +"``PUSH(get_awaitable(TOS.__anext__()))`` を実行します。\n" +"``get_awaitable`` の詳細については ``GET_AWAITABLE`` を参照してください。" -#: ../../library/dis.rst:802 +#: ../../library/dis.rst:602 msgid "" "Terminates an :keyword:`async for` loop. Handles an exception raised when " -"awaiting a next item. The stack contains the async iterable in ``STACK[-2]`` " -"and the raised exception in ``STACK[-1]``. Both are popped. If the exception " -"is not :exc:`StopAsyncIteration`, it is re-raised." +"awaiting a next item. If TOS is :exc:`StopAsyncIteration` pop 7 values from " +"the stack and restore the exception state using the second three of them. " +"Otherwise re-raise the exception using the three values from the stack. An " +"exception handler block is removed from the block stack." msgstr "" -#: ../../library/dis.rst:809 ../../library/dis.rst:900 -#: ../../library/dis.rst:911 +#: ../../library/dis.rst:613 msgid "" -"Exception representation on the stack now consist of one, not three, items." +"Resolves ``__aenter__`` and ``__aexit__`` from the object on top of the " +"stack. Pushes ``__aexit__`` and result of ``__aenter__()`` to the stack." msgstr "" +"スタックの先頭にあるオブジェクトの ``__aenter__`` と ``__aexit__`` を解決しま" +"す。\n" +"``__aexit__`` と ``__aenter__()`` の結果をスタックに積みます。" -#: ../../library/dis.rst:815 -msgid "" -"Handles an exception raised during a :meth:`~generator.throw` or :meth:" -"`~generator.close` call through the current frame. If ``STACK[-1]`` is an " -"instance of :exc:`StopIteration`, pop three values from the stack and push " -"its ``value`` member. Otherwise, re-raise ``STACK[-1]``." -msgstr "" +#: ../../library/dis.rst:621 +msgid "Creates a new frame object." +msgstr "新たなフレームオブジェクトを作成します。" -#: ../../library/dis.rst:824 +#: ../../library/dis.rst:627 msgid "**Miscellaneous opcodes**" msgstr "**その他の命令コード**" -#: ../../library/dis.rst:830 +#: ../../library/dis.rst:631 msgid "" -"item = STACK.pop()\n" -"set.add(STACK[-i], item)" -msgstr "" - -#: ../../library/dis.rst:833 -msgid "Used to implement set comprehensions." +"Implements the expression statement for the interactive mode. TOS is " +"removed from the stack and printed. In non-interactive mode, an expression " +"statement is terminated with :opcode:`POP_TOP`." msgstr "" +"対話モードのための式文を実行します。TOS はスタックから取り除かれ表示されま" +"す。 非対話モードにおいては、式文は :opcode:`POP_TOP` で終了しています。" -#: ../../library/dis.rst:840 +#: ../../library/dis.rst:638 msgid "" -"item = STACK.pop()\n" -"list.append(STACK[-i], item)" +"Calls ``set.add(TOS1[-i], TOS)``. Used to implement set comprehensions." msgstr "" +"``set.add(TOS1[-i], TOS)`` を呼び出します。集合内包表記の実装に使われます。" -#: ../../library/dis.rst:843 -msgid "Used to implement list comprehensions." -msgstr "" - -#: ../../library/dis.rst:850 +#: ../../library/dis.rst:643 msgid "" -"value = STACK.pop()\n" -"key = STACK.pop()\n" -"dict.__setitem__(STACK[-i], key, value)" +"Calls ``list.append(TOS1[-i], TOS)``. Used to implement list comprehensions." msgstr "" -#: ../../library/dis.rst:854 -msgid "Used to implement dict comprehensions." +#: ../../library/dis.rst:648 +msgid "" +"Calls ``dict.__setitem__(TOS1[-i], TOS1, TOS)``. Used to implement dict " +"comprehensions." msgstr "" -#: ../../library/dis.rst:857 -msgid "" -"Map value is ``STACK[-1]`` and map key is ``STACK[-2]``. Before, those were " -"reversed." +#: ../../library/dis.rst:652 +msgid "Map value is TOS and map key is TOS1. Before, those were reversed." msgstr "" -#: ../../library/dis.rst:861 +#: ../../library/dis.rst:655 msgid "" "For all of the :opcode:`SET_ADD`, :opcode:`LIST_APPEND` and :opcode:" "`MAP_ADD` instructions, while the added value or key/value pair is popped " @@ -1037,724 +761,468 @@ msgstr "" "たは key/value ペアをスタックから取り除きますが、コンテナオブジェクトはループ" "の次のイテレーションで利用できるようにスタックに残しておきます。" -#: ../../library/dis.rst:869 -msgid "Returns with ``STACK[-1]`` to the caller of the function." -msgstr "" +#: ../../library/dis.rst:663 +msgid "Returns with TOS to the caller of the function." +msgstr "関数の呼び出し元へ TOS を返します。" -#: ../../library/dis.rst:874 -msgid "Yields ``STACK.pop()`` from a :term:`generator`." +#: ../../library/dis.rst:668 +msgid "Pops TOS and yields it from a :term:`generator`." msgstr "" +"TOS をポップし、それを :term:`ジェネレータ ` から yield します。" -#: ../../library/dis.rst:876 -msgid "oparg set to be the stack depth." +#: ../../library/dis.rst:673 +msgid "Pops TOS and delegates to it as a subiterator from a :term:`generator`." msgstr "" +"TOS をポップし、それを :term:`generator` から取得したサブイテレーターとして " +"delegate します。" -#: ../../library/dis.rst:879 +#: ../../library/dis.rst:680 msgid "" -"oparg set to be the exception block depth, for efficient closing of " -"generators." +"Checks whether ``__annotations__`` is defined in ``locals()``, if not it is " +"set up to an empty ``dict``. This opcode is only emitted if a class or " +"module body contains :term:`variable annotations ` " +"statically." msgstr "" -#: ../../library/dis.rst:882 +#: ../../library/dis.rst:690 msgid "" -"oparg is ``1`` if this instruction is part of a yield-from or await, and " -"``0`` otherwise." +"Loads all symbols not starting with ``'_'`` directly from the module TOS to " +"the local namespace. The module is popped after loading all names. This " +"opcode implements ``from module import *``." msgstr "" +"``'_'`` で始まっていないすべてのシンボルをモジュール TOS から直接ローカル名前" +"空間へロードします。\n" +"モジュールはすべての名前をロードした後にポップされます。\n" +"この命令コードは ``from module import *`` を実行します。" -#: ../../library/dis.rst:888 +#: ../../library/dis.rst:697 msgid "" -"Checks whether ``__annotations__`` is defined in ``locals()``, if not it is " -"set up to an empty ``dict``. This opcode is only emitted if a class or " -"module body contains :term:`variable annotations ` " -"statically." -msgstr "" - -#: ../../library/dis.rst:898 -msgid "" -"Pops a value from the stack, which is used to restore the exception state." -msgstr "" - -#: ../../library/dis.rst:905 -msgid "" -"Re-raises the exception currently on top of the stack. If oparg is non-zero, " -"pops an additional value from the stack which is used to set :attr:`~frame." -"f_lasti` of the current frame." -msgstr "" - -#: ../../library/dis.rst:916 -msgid "" -"Pops a value from the stack. Pushes the current exception to the top of the " -"stack. Pushes the value originally popped back to the stack. Used in " -"exception handlers." -msgstr "" - -#: ../../library/dis.rst:924 -msgid "" -"Performs exception matching for ``except``. Tests whether the ``STACK[-2]`` " -"is an exception matching ``STACK[-1]``. Pops ``STACK[-1]`` and pushes the " -"boolean result of the test." -msgstr "" - -#: ../../library/dis.rst:932 -msgid "" -"Performs exception matching for ``except*``. Applies ``split(STACK[-1])`` on " -"the exception group representing ``STACK[-2]``." -msgstr "" - -#: ../../library/dis.rst:935 -msgid "" -"In case of a match, pops two items from the stack and pushes the non-" -"matching subgroup (``None`` in case of full match) followed by the matching " -"subgroup. When there is no match, pops one item (the match type) and pushes " -"``None``." -msgstr "" - -#: ../../library/dis.rst:944 -msgid "" -"Calls the function in position 4 on the stack with arguments (type, val, tb) " -"representing the exception at the top of the stack. Used to implement the " -"call ``context_manager.__exit__(*exc_info())`` when an exception has " -"occurred in a :keyword:`with` statement." +"Removes one block from the block stack. Per frame, there is a stack of " +"blocks, denoting :keyword:`try` statements, and such." msgstr "" -#: ../../library/dis.rst:951 +#: ../../library/dis.rst:703 msgid "" -"The ``__exit__`` function is in position 4 of the stack rather than 7. " -"Exception representation on the stack now consist of one, not three, items." +"Removes one block from the block stack. The popped block must be an " +"exception handler block, as implicitly created when entering an except " +"handler. In addition to popping extraneous values from the frame stack, the " +"last three popped values are used to restore the exception state." msgstr "" +"ブロックスタックからブロックを1つ取り除きます。\n" +"ポップされたブロックは、例外ハンドラに入ったときに暗黙的に生成された例外ハン" +"ドラのブロックでなければなりません。\n" +"フレームスタックから本質的でない値をポップするのに加えて、直前にポップした3つ" +"の値が例外状態を回復するのに使われます。" -#: ../../library/dis.rst:958 -msgid "" -"Pushes a common constant onto the stack. The interpreter contains a " -"hardcoded list of constants supported by this instruction. Used by the :" -"keyword:`assert` statement to load :exc:`AssertionError`." +#: ../../library/dis.rst:711 +msgid "Re-raises the exception currently on top of the stack." msgstr "" -#: ../../library/dis.rst:967 +#: ../../library/dis.rst:718 msgid "" -"Pushes :func:`!builtins.__build_class__` onto the stack. It is later called " -"to construct a class." +"Calls the function in position 7 on the stack with the top three items on " +"the stack as arguments. Used to implement the call ``context_manager." +"__exit__(*exc_info())`` when an exception has occurred in a :keyword:`with` " +"statement." msgstr "" -#: ../../library/dis.rst:972 +#: ../../library/dis.rst:728 msgid "" -"Perform ``STACK.append(len(STACK[-1]))``. Used in :keyword:`match` " -"statements where comparison with structure of pattern is needed." +"Pushes :exc:`AssertionError` onto the stack. Used by the :keyword:`assert` " +"statement." msgstr "" -#: ../../library/dis.rst:980 +#: ../../library/dis.rst:736 msgid "" -"If ``STACK[-1]`` is an instance of :class:`collections.abc.Mapping` (or, " -"more technically: if it has the :c:macro:`Py_TPFLAGS_MAPPING` flag set in " -"its :c:member:`~PyTypeObject.tp_flags`), push ``True`` onto the stack. " -"Otherwise, push ``False``." +"Pushes :func:`builtins.__build_class__` onto the stack. It is later called " +"by :opcode:`CALL_FUNCTION` to construct a class." msgstr "" +":func:`builtins.__build_class__` をスタックにプッシュします。\n" +"これはクラスを構築するために、後で :opcode:`CALL_FUNCTION` に呼ばれます。" -#: ../../library/dis.rst:990 +#: ../../library/dis.rst:742 msgid "" -"If ``STACK[-1]`` is an instance of :class:`collections.abc.Sequence` and is " -"*not* an instance of :class:`str`/:class:`bytes`/:class:`bytearray` (or, " -"more technically: if it has the :c:macro:`Py_TPFLAGS_SEQUENCE` flag set in " -"its :c:member:`~PyTypeObject.tp_flags`), push ``True`` onto the stack. " -"Otherwise, push ``False``." +"This opcode performs several operations before a with block starts. First, " +"it loads :meth:`~object.__exit__` from the context manager and pushes it " +"onto the stack for later use by :opcode:`WITH_EXCEPT_START`. Then, :meth:" +"`~object.__enter__` is called, and a finally block pointing to *delta* is " +"pushed. Finally, the result of calling the ``__enter__()`` method is pushed " +"onto the stack. The next opcode will either ignore it (:opcode:`POP_TOP`), " +"or store it in (a) variable(s) (:opcode:`STORE_FAST`, :opcode:`STORE_NAME`, " +"or :opcode:`UNPACK_SEQUENCE`)." msgstr "" -#: ../../library/dis.rst:1000 -msgid "" -"``STACK[-1]`` is a tuple of mapping keys, and ``STACK[-2]`` is the match " -"subject. If ``STACK[-2]`` contains all of the keys in ``STACK[-1]``, push a :" -"class:`tuple` containing the corresponding values. Otherwise, push ``None``." +#: ../../library/dis.rst:754 +msgid "All of the following opcodes use their arguments." msgstr "" -#: ../../library/dis.rst:1006 ../../library/dis.rst:1714 +#: ../../library/dis.rst:758 msgid "" -"Previously, this instruction also pushed a boolean value indicating success " -"(``True``) or failure (``False``)." +"Implements ``name = TOS``. *namei* is the index of *name* in the attribute :" +"attr:`co_names` of the code object. The compiler tries to use :opcode:" +"`STORE_FAST` or :opcode:`STORE_GLOBAL` if possible." msgstr "" +"``name = TOS`` を実行します。\n" +"*namei* はコードオブジェクトの属性 :attr:`co_names` における *name* のイン" +"デックスです。\n" +"コンパイラは可能ならば :opcode:`STORE_FAST` または :opcode:`STORE_GLOBAL` を" +"使おうとします。" -#: ../../library/dis.rst:1013 -msgid "" -"Implements ``name = STACK.pop()``. *namei* is the index of *name* in the " -"attribute :attr:`~codeobject.co_names` of the :ref:`code object `. The compiler tries to use :opcode:`STORE_FAST` or :opcode:" -"`STORE_GLOBAL` if possible." -msgstr "" - -#: ../../library/dis.rst:1020 -msgid "" -"Implements ``del name``, where *namei* is the index into :attr:`~codeobject." -"co_names` attribute of the :ref:`code object `." -msgstr "" - -#: ../../library/dis.rst:1026 -msgid "" -"Unpacks ``STACK[-1]`` into *count* individual values, which are put onto the " -"stack right-to-left. Require there to be exactly *count* values.::" -msgstr "" - -#: ../../library/dis.rst:1029 -msgid "" -"assert(len(STACK[-1]) == count)\n" -"STACK.extend(STACK.pop()[:-count-1:-1])" -msgstr "" - -#: ../../library/dis.rst:1035 -msgid "" -"Implements assignment with a starred target: Unpacks an iterable in " -"``STACK[-1]`` into individual values, where the total number of values can " -"be smaller than the number of items in the iterable: one of the new values " -"will be a list of all leftover items." -msgstr "" - -#: ../../library/dis.rst:1040 -msgid "The number of values before and after the list value is limited to 255." -msgstr "" - -#: ../../library/dis.rst:1042 +#: ../../library/dis.rst:765 msgid "" -"The number of values before the list value is encoded in the argument of the " -"opcode. The number of values after the list if any is encoded using an " -"``EXTENDED_ARG``. As a consequence, the argument can be seen as a two bytes " -"values where the low byte of *counts* is the number of values before the " -"list value, the high byte of *counts* the number of values after it." +"Implements ``del name``, where *namei* is the index into :attr:`co_names` " +"attribute of the code object." msgstr "" +"``del name`` を実行します。 *namei* はコードオブジェクトの :attr:`co_names` " +"属性へのインデックスです。" -#: ../../library/dis.rst:1048 +#: ../../library/dis.rst:771 msgid "" -"The extracted values are put onto the stack right-to-left, i.e. ``a, *b, c = " -"d`` will be stored after execution as ``STACK.extend((a, b, c))``." +"Unpacks TOS into *count* individual values, which are put onto the stack " +"right-to-left." msgstr "" +"TOS を *count* 個の個別の値にアンパックして、右から左の順にスタックに積みま" +"す。" -#: ../../library/dis.rst:1056 +#: ../../library/dis.rst:777 msgid "" -"obj = STACK.pop()\n" -"value = STACK.pop()\n" -"obj.name = value" +"Implements assignment with a starred target: Unpacks an iterable in TOS into " +"individual values, where the total number of values can be smaller than the " +"number of items in the iterable: one of the new values will be a list of all " +"leftover items." msgstr "" +"星付きの対象ありの代入を実行します:\n" +"TOS にあるイテラブルを個別の値にばらしますが、ばらした値の総数はイテラブルの" +"要素数より小さくなることがあります:\n" +"そのときは、値の1つはばらされずに残った要素からなるリストです。" -#: ../../library/dis.rst:1060 +#: ../../library/dis.rst:782 msgid "" -"where *namei* is the index of name in :attr:`~codeobject.co_names` of the :" -"ref:`code object `." +"The low byte of *counts* is the number of values before the list value, the " +"high byte of *counts* the number of values after it. The resulting values " +"are put onto the stack right-to-left." msgstr "" +"*counts* の下位バイトはそのリスト値より前にある値の個数で、 *counts* の上位バ" +"イトはそれより後ろにある値の個数です。\n" +"そうしてできた値は右から左の順でスタックに積まれます。" -#: ../../library/dis.rst:1067 +#: ../../library/dis.rst:789 msgid "" -"obj = STACK.pop()\n" -"del obj.name" +"Implements ``TOS.name = TOS1``, where *namei* is the index of name in :attr:" +"`co_names`." msgstr "" +"``TOS.name = TOS1`` を実行します。\n" +"*namei* は :attr:`co_names` における名前のインデックスです。" -#: ../../library/dis.rst:1070 +#: ../../library/dis.rst:795 msgid "" -"where *namei* is the index of name into :attr:`~codeobject.co_names` of the :" -"ref:`code object `." +"Implements ``del TOS.name``, using *namei* as index into :attr:`co_names`." msgstr "" +"``del TOS.name`` を実行します。\n" +":attr:`co_names` へのインデックスとして *namei* を使います。" -#: ../../library/dis.rst:1076 +#: ../../library/dis.rst:800 msgid "Works as :opcode:`STORE_NAME`, but stores the name as a global." msgstr "" ":opcode:`STORE_NAME` と同じように動作しますが、 name をグローバルとして保存し" "ます。" -#: ../../library/dis.rst:1081 +#: ../../library/dis.rst:805 msgid "Works as :opcode:`DELETE_NAME`, but deletes a global name." msgstr "" ":opcode:`DELETE_NAME` と同じように動作しますが、グローバルの name を削除しま" "す。" -#: ../../library/dis.rst:1086 +#: ../../library/dis.rst:810 msgid "Pushes ``co_consts[consti]`` onto the stack." msgstr "``co_consts[consti]`` をスタックにプッシュします。" -#: ../../library/dis.rst:1091 -msgid "" -"Pushes the integer ``i`` onto the stack. ``i`` must be in ``range(256)``" -msgstr "" - -#: ../../library/dis.rst:1099 -msgid "" -"Pushes ``co_consts[consti]`` onto the stack. Can be used when the constant " -"value is known to be immortal." -msgstr "" - -#: ../../library/dis.rst:1107 -msgid "" -"Pushes the value associated with ``co_names[namei]`` onto the stack. The " -"name is looked up within the locals, then the globals, then the builtins." -msgstr "" - -#: ../../library/dis.rst:1113 -msgid "" -"Pushes a reference to the locals dictionary onto the stack. This is used to " -"prepare namespace dictionaries for :opcode:`LOAD_FROM_DICT_OR_DEREF` and :" -"opcode:`LOAD_FROM_DICT_OR_GLOBALS`." -msgstr "" - -#: ../../library/dis.rst:1122 -msgid "" -"Pops a mapping off the stack and looks up the value for ``co_names[namei]``. " -"If the name is not found there, looks it up in the globals and then the " -"builtins, similar to :opcode:`LOAD_GLOBAL`. This is used for loading global " -"variables in :ref:`annotation scopes ` within class " -"bodies." -msgstr "" +#: ../../library/dis.rst:815 +msgid "Pushes the value associated with ``co_names[namei]`` onto the stack." +msgstr "``co_names[namei]`` に関連付けられた値をスタックにプッシュします。" -#: ../../library/dis.rst:1133 +#: ../../library/dis.rst:820 msgid "" "Creates a tuple consuming *count* items from the stack, and pushes the " -"resulting tuple onto the stack::" -msgstr "" - -#: ../../library/dis.rst:1136 -msgid "" -"if count == 0:\n" -" value = ()\n" -"else:\n" -" value = tuple(STACK[-count:])\n" -" STACK = STACK[:-count]\n" -"\n" -"STACK.append(value)" +"resulting tuple onto the stack." msgstr "" +"スタックから *count* 個の要素を消費してタプルを作り出し、できたタプルをスタッ" +"クにプッシュします。" -#: ../../library/dis.rst:1147 +#: ../../library/dis.rst:826 msgid "Works as :opcode:`BUILD_TUPLE`, but creates a list." msgstr "" ":opcode:`BUILD_TUPLE` と同じように動作しますが、この命令はリストを作り出しま" "す。" -#: ../../library/dis.rst:1152 +#: ../../library/dis.rst:831 msgid "Works as :opcode:`BUILD_TUPLE`, but creates a set." msgstr "" ":opcode:`BUILD_TUPLE` と同じように動作しますが、この命令は set を作り出しま" "す。" -#: ../../library/dis.rst:1157 +#: ../../library/dis.rst:836 msgid "" "Pushes a new dictionary object onto the stack. Pops ``2 * count`` items so " -"that the dictionary holds *count* entries: ``{..., STACK[-4]: STACK[-3], " -"STACK[-2]: STACK[-1]}``." +"that the dictionary holds *count* entries: ``{..., TOS3: TOS2, TOS1: TOS}``." msgstr "" -#: ../../library/dis.rst:1161 +#: ../../library/dis.rst:840 msgid "" "The dictionary is created from stack items instead of creating an empty " "dictionary pre-sized to hold *count* items." msgstr "" -#: ../../library/dis.rst:1168 +#: ../../library/dis.rst:847 msgid "" -"Concatenates *count* strings from the stack and pushes the resulting string " -"onto the stack." +"The version of :opcode:`BUILD_MAP` specialized for constant keys. Pops the " +"top element on the stack which contains a tuple of keys, then starting from " +"``TOS1``, pops *count* values to form values in the built dictionary." msgstr "" -#: ../../library/dis.rst:1178 +#: ../../library/dis.rst:856 msgid "" -"seq = STACK.pop()\n" -"list.extend(STACK[-i], seq)" -msgstr "" - -#: ../../library/dis.rst:1181 -msgid "Used to build lists." +"Concatenates *count* strings from the stack and pushes the resulting string " +"onto the stack." msgstr "" -#: ../../library/dis.rst:1190 +#: ../../library/dis.rst:864 msgid "" -"seq = STACK.pop()\n" -"set.update(STACK[-i], seq)" +"Pops a list from the stack and pushes a tuple containing the same values." msgstr "" -#: ../../library/dis.rst:1193 -msgid "Used to build sets." +#: ../../library/dis.rst:871 +msgid "Calls ``list.extend(TOS1[-i], TOS)``. Used to build lists." msgstr "" -#: ../../library/dis.rst:1202 -msgid "" -"map = STACK.pop()\n" -"dict.update(STACK[-i], map)" +#: ../../library/dis.rst:878 +msgid "Calls ``set.update(TOS1[-i], TOS)``. Used to build sets." msgstr "" -#: ../../library/dis.rst:1205 -msgid "Used to build dicts." +#: ../../library/dis.rst:885 +msgid "Calls ``dict.update(TOS1[-i], TOS)``. Used to build dicts." msgstr "" -#: ../../library/dis.rst:1212 +#: ../../library/dis.rst:892 msgid "Like :opcode:`DICT_UPDATE` but raises an exception for duplicate keys." msgstr "" -#: ../../library/dis.rst:1219 -msgid "" -"If the low bit of ``namei`` is not set, this replaces ``STACK[-1]`` with " -"``getattr(STACK[-1], co_names[namei>>1])``." -msgstr "" - -#: ../../library/dis.rst:1222 -msgid "" -"If the low bit of ``namei`` is set, this will attempt to load a method named " -"``co_names[namei>>1]`` from the ``STACK[-1]`` object. ``STACK[-1]`` is " -"popped. This bytecode distinguishes two cases: if ``STACK[-1]`` has a method " -"with the correct name, the bytecode pushes the unbound method and " -"``STACK[-1]``. ``STACK[-1]`` will be used as the first argument (``self``) " -"by :opcode:`CALL` or :opcode:`CALL_KW` when calling the unbound method. " -"Otherwise, ``NULL`` and the object returned by the attribute lookup are " -"pushed." -msgstr "" +#: ../../library/dis.rst:899 +msgid "Replaces TOS with ``getattr(TOS, co_names[namei])``." +msgstr "TOS を ``getattr(TOS, co_names[namei])`` と入れ替えます。" -#: ../../library/dis.rst:1231 -msgid "" -"If the low bit of ``namei`` is set, then a ``NULL`` or ``self`` is pushed to " -"the stack before the attribute or unbound method respectively." -msgstr "" - -#: ../../library/dis.rst:1238 -msgid "" -"This opcode implements :func:`super`, both in its zero-argument and two-" -"argument forms (e.g. ``super().method()``, ``super().attr`` and ``super(cls, " -"self).method()``, ``super(cls, self).attr``)." -msgstr "" - -#: ../../library/dis.rst:1242 -msgid "It pops three values from the stack (from top of stack down):" -msgstr "" - -#: ../../library/dis.rst:1244 -msgid "``self``: the first argument to the current method" -msgstr "" - -#: ../../library/dis.rst:1245 -msgid "``cls``: the class within which the current method was defined" -msgstr "" - -#: ../../library/dis.rst:1246 -msgid "the global ``super``" -msgstr "" - -#: ../../library/dis.rst:1248 -msgid "" -"With respect to its argument, it works similarly to :opcode:`LOAD_ATTR`, " -"except that ``namei`` is shifted left by 2 bits instead of 1." -msgstr "" - -#: ../../library/dis.rst:1251 -msgid "" -"The low bit of ``namei`` signals to attempt a method load, as with :opcode:" -"`LOAD_ATTR`, which results in pushing ``NULL`` and the loaded method. When " -"it is unset a single value is pushed to the stack." -msgstr "" - -#: ../../library/dis.rst:1255 -msgid "" -"The second-low bit of ``namei``, if set, means that this was a two-argument " -"call to :func:`super` (unset means zero-argument)." -msgstr "" - -#: ../../library/dis.rst:1263 +#: ../../library/dis.rst:904 msgid "" "Performs a Boolean operation. The operation name can be found in " -"``cmp_op[opname >> 5]``. If the fifth-lowest bit of ``opname`` is set " -"(``opname & 16``), the result should be coerced to ``bool``." -msgstr "" +"``cmp_op[opname]``." +msgstr "ブール命令を実行します。命令名は ``cmp_op[opname]`` にあります。" -#: ../../library/dis.rst:1267 -msgid "" -"The fifth-lowest bit of the oparg now indicates a forced conversion to :" -"class:`bool`." -msgstr "" - -#: ../../library/dis.rst:1274 +#: ../../library/dis.rst:910 msgid "Performs ``is`` comparison, or ``is not`` if ``invert`` is 1." msgstr "" -#: ../../library/dis.rst:1281 +#: ../../library/dis.rst:917 msgid "Performs ``in`` comparison, or ``not in`` if ``invert`` is 1." msgstr "" -#: ../../library/dis.rst:1288 +#: ../../library/dis.rst:924 msgid "" -"Imports the module ``co_names[namei]``. ``STACK[-1]`` and ``STACK[-2]`` are " -"popped and provide the *fromlist* and *level* arguments of :func:" -"`__import__`. The module object is pushed onto the stack. The current " -"namespace is not affected: for a proper import statement, a subsequent :" -"opcode:`STORE_FAST` instruction modifies the namespace." +"Imports the module ``co_names[namei]``. TOS and TOS1 are popped and provide " +"the *fromlist* and *level* arguments of :func:`__import__`. The module " +"object is pushed onto the stack. The current namespace is not affected: for " +"a proper import statement, a subsequent :opcode:`STORE_FAST` instruction " +"modifies the namespace." msgstr "" +"モジュール ``co_names[namei]`` をインポートします。 TOS と TOS1 がポップさ" +"れ、 :func:`__import__` の *fromlist* と *level* 引数になります。モジュールオ" +"ブジェクトはスタックへプッシュされます。現在の名前空間は影響されません: 適切" +"な import 文のためには、後続の :opcode:`STORE_FAST` 命令が名前空間を変更しま" +"す。" -#: ../../library/dis.rst:1296 +#: ../../library/dis.rst:933 msgid "" -"Loads the attribute ``co_names[namei]`` from the module found in " -"``STACK[-1]``. The resulting object is pushed onto the stack, to be " -"subsequently stored by a :opcode:`STORE_FAST` instruction." +"Loads the attribute ``co_names[namei]`` from the module found in TOS. The " +"resulting object is pushed onto the stack, to be subsequently stored by a :" +"opcode:`STORE_FAST` instruction." msgstr "" +"TOS にあるモジュールから属性 ``co_names[namei]`` をロードします。作成されたオ" +"ブジェクトはスタックにプッシュされ、後続の :opcode:`STORE_FAST` 命令によって" +"保存されます。" -#: ../../library/dis.rst:1303 +#: ../../library/dis.rst:940 msgid "Increments bytecode counter by *delta*." msgstr "バイトコードカウンタを *delta* だけ増加させます。" -#: ../../library/dis.rst:1308 -msgid "Decrements bytecode counter by *delta*. Checks for interrupts." -msgstr "" - -#: ../../library/dis.rst:1315 -msgid "Decrements bytecode counter by *delta*. Does not check for interrupts." +#: ../../library/dis.rst:945 +msgid "If TOS is true, sets the bytecode counter to *target*. TOS is popped." msgstr "" +"TOS が真ならば、バイトコードカウンタを *target* に設定します。 TOS はポップさ" +"れます。" -#: ../../library/dis.rst:1322 -msgid "" -"If ``STACK[-1]`` is true, increments the bytecode counter by *delta*. " -"``STACK[-1]`` is popped." +#: ../../library/dis.rst:952 +msgid "If TOS is false, sets the bytecode counter to *target*. TOS is popped." msgstr "" +"TOS が偽ならば、バイトコードカウンタを *target* に設定します。 TOS はポップさ" +"れます。" -#: ../../library/dis.rst:1325 ../../library/dis.rst:1341 +#: ../../library/dis.rst:958 msgid "" -"The oparg is now a relative delta rather than an absolute target. This " -"opcode is a pseudo-instruction, replaced in final bytecode by the directed " -"versions (forward/backward)." -msgstr "" - -#: ../../library/dis.rst:1330 ../../library/dis.rst:1346 -#: ../../library/dis.rst:1359 ../../library/dis.rst:1370 -msgid "This is no longer a pseudo-instruction." +"Tests whether the second value on the stack is an exception matching TOS, " +"and jumps if it is not. Pops two values from the stack." msgstr "" -#: ../../library/dis.rst:1338 +#: ../../library/dis.rst:966 msgid "" -"If ``STACK[-1]`` is false, increments the bytecode counter by *delta*. " -"``STACK[-1]`` is popped." +"If TOS is true, sets the bytecode counter to *target* and leaves TOS on the " +"stack. Otherwise (TOS is false), TOS is popped." msgstr "" +"TOS が真ならば、バイトコードカウンタを *target* に設定し、TOS は スタックに残" +"されます。そうでない (TOS が偽) なら、TOS はポップされます。" -#: ../../library/dis.rst:1354 +#: ../../library/dis.rst:974 msgid "" -"If ``STACK[-1]`` is not ``None``, increments the bytecode counter by " -"*delta*. ``STACK[-1]`` is popped." +"If TOS is false, sets the bytecode counter to *target* and leaves TOS on the " +"stack. Otherwise (TOS is true), TOS is popped." msgstr "" +"TOS が偽ならば、バイトコードカウンタを *target* に設定し、TOS は スタックに残" +"されます。そうでない (TOS が真) なら、TOS はポップされます。" -#: ../../library/dis.rst:1365 -msgid "" -"If ``STACK[-1]`` is ``None``, increments the bytecode counter by *delta*. " -"``STACK[-1]`` is popped." -msgstr "" +#: ../../library/dis.rst:982 +msgid "Set bytecode counter to *target*." +msgstr "バイトコードカウンタを *target* に設定します。" -#: ../../library/dis.rst:1375 +#: ../../library/dis.rst:987 msgid "" -"``STACK[-1]`` is an :term:`iterator`. Call its :meth:`~iterator.__next__` " -"method. If this yields a new value, push it on the stack (leaving the " -"iterator below it). If the iterator indicates it is exhausted then the byte " +"TOS is an :term:`iterator`. Call its :meth:`~iterator.__next__` method. If " +"this yields a new value, push it on the stack (leaving the iterator below " +"it). If the iterator indicates it is exhausted, TOS is popped, and the byte " "code counter is incremented by *delta*." msgstr "" -#: ../../library/dis.rst:1380 -msgid "Up until 3.11 the iterator was popped when it was exhausted." -msgstr "" - -#: ../../library/dis.rst:1385 -msgid "Loads the global named ``co_names[namei>>1]`` onto the stack." -msgstr "" -"``co_names[namei>>1]`` という名前のグローバルをスタック上にロードします。" +#: ../../library/dis.rst:995 +msgid "Loads the global named ``co_names[namei]`` onto the stack." +msgstr "``co_names[namei]`` という名前のグローバルをスタック上にロードします。" -#: ../../library/dis.rst:1387 +#: ../../library/dis.rst:1000 msgid "" -"If the low bit of ``namei`` is set, then a ``NULL`` is pushed to the stack " -"before the global variable." +"Pushes a try block from a try-finally or try-except clause onto the block " +"stack. *delta* points to the finally block or the first except block." msgstr "" -#: ../../library/dis.rst:1393 +#: ../../library/dis.rst:1006 msgid "" "Pushes a reference to the local ``co_varnames[var_num]`` onto the stack." msgstr "" "ローカルな ``co_varnames[var_num]`` への参照をスタックにプッシュします。" -#: ../../library/dis.rst:1395 -msgid "" -"This opcode is now only used in situations where the local variable is " -"guaranteed to be initialized. It cannot raise :exc:`UnboundLocalError`." -msgstr "" +#: ../../library/dis.rst:1011 +msgid "Stores TOS into the local ``co_varnames[var_num]``." +msgstr "TOS をローカルな ``co_varnames[var_num]`` の中に保存します。" -#: ../../library/dis.rst:1401 -msgid "" -"Pushes a borrowed reference to the local ``co_varnames[var_num]`` onto the " -"stack." -msgstr "" - -#: ../../library/dis.rst:1408 -msgid "" -"Pushes references to ``co_varnames[var_nums >> 4]`` and " -"``co_varnames[var_nums & 15]`` onto the stack." -msgstr "" - -#: ../../library/dis.rst:1416 -msgid "" -"Pushes borrowed references to ``co_varnames[var_nums >> 4]`` and " -"``co_varnames[var_nums & 15]`` onto the stack." -msgstr "" - -#: ../../library/dis.rst:1423 -msgid "" -"Pushes a reference to the local ``co_varnames[var_num]`` onto the stack, " -"raising an :exc:`UnboundLocalError` if the local variable has not been " -"initialized." -msgstr "" - -#: ../../library/dis.rst:1431 -msgid "" -"Pushes a reference to the local ``co_varnames[var_num]`` onto the stack (or " -"pushes ``NULL`` onto the stack if the local variable has not been " -"initialized) and sets ``co_varnames[var_num]`` to ``NULL``." -msgstr "" - -#: ../../library/dis.rst:1439 -msgid "Stores ``STACK.pop()`` into the local ``co_varnames[var_num]``." -msgstr "" - -#: ../../library/dis.rst:1443 -msgid "" -"Stores ``STACK[-1]`` into ``co_varnames[var_nums >> 4]`` and ``STACK[-2]`` " -"into ``co_varnames[var_nums & 15]``." -msgstr "" - -#: ../../library/dis.rst:1450 -msgid "" -"Stores ``STACK.pop()`` into the local ``co_varnames[var_nums >> 4]`` and " -"pushes a reference to the local ``co_varnames[var_nums & 15]`` onto the " -"stack." -msgstr "" - -#: ../../library/dis.rst:1458 +#: ../../library/dis.rst:1016 msgid "Deletes local ``co_varnames[var_num]``." msgstr "ローカルな ``co_varnames[var_num]`` を削除します。" -#: ../../library/dis.rst:1463 +#: ../../library/dis.rst:1021 msgid "" -"Creates a new cell in slot ``i``. If that slot is nonempty then that value " -"is stored into the new cell." +"Pushes a reference to the cell contained in slot *i* of the cell and free " +"variable storage. The name of the variable is ``co_cellvars[i]`` if *i* is " +"less than the length of *co_cellvars*. Otherwise it is ``co_freevars[i - " +"len(co_cellvars)]``." msgstr "" +"セルと自由変数の記憶領域のスロット *i* に含まれるセルへの参照をプッシュしま" +"す。 *i* が *co_cellvars* の長さより小さければ、変数の名前は " +"``co_cellvars[i]`` です。 そうでなければ ``co_freevars[i - " +"len(co_cellvars)]`` です。" -#: ../../library/dis.rst:1471 +#: ../../library/dis.rst:1029 msgid "" -"Loads the cell contained in slot ``i`` of the \"fast locals\" storage. " +"Loads the cell contained in slot *i* of the cell and free variable storage. " "Pushes a reference to the object the cell contains on the stack." msgstr "" +"セルと自由変数の記憶領域のスロット *i* に含まれるセルをロードします。 セルが" +"持つオブジェクトへの参照をスタックにプッシュします。" -#: ../../library/dis.rst:1474 ../../library/dis.rst:1496 -#: ../../library/dis.rst:1507 -msgid "" -"``i`` is no longer offset by the length of :attr:`~codeobject.co_varnames`." -msgstr "" - -#: ../../library/dis.rst:1480 -msgid "" -"Pops a mapping off the stack and looks up the name associated with slot " -"``i`` of the \"fast locals\" storage in this mapping. If the name is not " -"found there, loads it from the cell contained in slot ``i``, similar to :" -"opcode:`LOAD_DEREF`. This is used for loading :term:`closure variables " -"` in class bodies (which previously used :opcode:`!" -"LOAD_CLASSDEREF`) and in :ref:`annotation scopes ` within " -"class bodies." -msgstr "" - -#: ../../library/dis.rst:1493 +#: ../../library/dis.rst:1035 msgid "" -"Stores ``STACK.pop()`` into the cell contained in slot ``i`` of the \"fast " -"locals\" storage." +"Much like :opcode:`LOAD_DEREF` but first checks the locals dictionary before " +"consulting the cell. This is used for loading free variables in class " +"bodies." msgstr "" +":opcode:`LOAD_DEREF` とほぼ同じですが、セルを調べる前にまずローカルの辞書を確" +"認します。\n" +"これはクラス本体に自由変数を読み込むために使います。" -#: ../../library/dis.rst:1502 +#: ../../library/dis.rst:1044 msgid "" -"Empties the cell contained in slot ``i`` of the \"fast locals\" storage. " -"Used by the :keyword:`del` statement." +"Stores TOS into the cell contained in slot *i* of the cell and free variable " +"storage." msgstr "" +"セルと自由変数の記憶領域のスロット *i* に含まれるセルへTOSを保存します。" -#: ../../library/dis.rst:1513 +#: ../../library/dis.rst:1050 msgid "" -"Copies the ``n`` :term:`free (closure) variables ` from " -"the closure into the frame. Removes the need for special code on the " -"caller's side when calling closures." +"Empties the cell contained in slot *i* of the cell and free variable " +"storage. Used by the :keyword:`del` statement." msgstr "" +"セルと自由変数の記憶領域のスロット *i* にあるセルを空にします。\n" +":keyword:`del` 文で使われます。" -#: ../../library/dis.rst:1522 +#: ../../library/dis.rst:1058 msgid "" "Raises an exception using one of the 3 forms of the ``raise`` statement, " "depending on the value of *argc*:" msgstr "" -#: ../../library/dis.rst:1525 +#: ../../library/dis.rst:1061 msgid "0: ``raise`` (re-raise previous exception)" msgstr "" -#: ../../library/dis.rst:1526 -msgid "" -"1: ``raise STACK[-1]`` (raise exception instance or type at ``STACK[-1]``)" -msgstr "" - -#: ../../library/dis.rst:1527 -msgid "" -"2: ``raise STACK[-2] from STACK[-1]`` (raise exception instance or type at " -"``STACK[-2]`` with ``__cause__`` set to ``STACK[-1]``)" +#: ../../library/dis.rst:1062 +msgid "1: ``raise TOS`` (raise exception instance or type at ``TOS``)" msgstr "" -#: ../../library/dis.rst:1533 +#: ../../library/dis.rst:1063 msgid "" -"Calls a callable object with the number of arguments specified by ``argc``. " -"On the stack are (in ascending order):" -msgstr "" - -#: ../../library/dis.rst:1536 ../../library/dis.rst:1560 -msgid "The callable" -msgstr "" - -#: ../../library/dis.rst:1537 ../../library/dis.rst:1561 -msgid "``self`` or ``NULL``" -msgstr "" - -#: ../../library/dis.rst:1538 ../../library/dis.rst:1562 -msgid "The remaining positional arguments" -msgstr "" - -#: ../../library/dis.rst:1540 -msgid "``argc`` is the total of the positional arguments, excluding ``self``." +"2: ``raise TOS1 from TOS`` (raise exception instance or type at ``TOS1`` " +"with ``__cause__`` set to ``TOS``)" msgstr "" -#: ../../library/dis.rst:1542 +#: ../../library/dis.rst:1069 msgid "" -"``CALL`` pops all arguments and the callable object off the stack, calls the " -"callable object with those arguments, and pushes the return value returned " -"by the callable object." -msgstr "" - -#: ../../library/dis.rst:1548 -msgid "The callable now always appears at the same position on the stack." -msgstr "" - -#: ../../library/dis.rst:1551 -msgid "Calls with keyword arguments are now handled by :opcode:`CALL_KW`." -msgstr "" - -#: ../../library/dis.rst:1557 -msgid "" -"Calls a callable object with the number of arguments specified by ``argc``, " -"including one or more named arguments. On the stack are (in ascending order):" -msgstr "" - -#: ../../library/dis.rst:1563 -msgid "The named arguments" +"Calls a callable object with positional arguments. *argc* indicates the " +"number of positional arguments. The top of the stack contains positional " +"arguments, with the right-most argument on top. Below the arguments is a " +"callable object to call. ``CALL_FUNCTION`` pops all arguments and the " +"callable object off the stack, calls the callable object with those " +"arguments, and pushes the return value returned by the callable object." msgstr "" -#: ../../library/dis.rst:1564 -msgid "A :class:`tuple` of keyword argument names" +#: ../../library/dis.rst:1077 +msgid "This opcode is used only for calls with positional arguments." msgstr "" -#: ../../library/dis.rst:1566 +#: ../../library/dis.rst:1083 msgid "" -"``argc`` is the total of the positional and named arguments, excluding " -"``self``. The length of the tuple of keyword argument names is the number of " -"named arguments." +"Calls a callable object with positional (if any) and keyword arguments. " +"*argc* indicates the total number of positional and keyword arguments. The " +"top element on the stack contains a tuple with the names of the keyword " +"arguments, which must be strings. Below that are the values for the keyword " +"arguments, in the order corresponding to the tuple. Below that are " +"positional arguments, with the right-most parameter on top. Below the " +"arguments is a callable object to call. ``CALL_FUNCTION_KW`` pops all " +"arguments and the callable object off the stack, calls the callable object " +"with those arguments, and pushes the return value returned by the callable " +"object." msgstr "" -#: ../../library/dis.rst:1569 +#: ../../library/dis.rst:1095 msgid "" -"``CALL_KW`` pops all arguments, the keyword names, and the callable object " -"off the stack, calls the callable object with those arguments, and pushes " -"the return value returned by the callable object." +"Keyword arguments are packed in a tuple instead of a dictionary, *argc* " +"indicates the total number of arguments." msgstr "" -#: ../../library/dis.rst:1578 +#: ../../library/dis.rst:1102 msgid "" "Calls a callable object with variable set of positional and keyword " "arguments. If the lowest bit of *flags* is set, the top of the stack " @@ -1766,88 +1234,70 @@ msgid "" "arguments, and pushes the return value returned by the callable object." msgstr "" -#: ../../library/dis.rst:1593 -msgid "" -"Pushes a ``NULL`` to the stack. Used in the call sequence to match the " -"``NULL`` pushed by :opcode:`LOAD_METHOD` for non-method calls." -msgstr "" - -#: ../../library/dis.rst:1602 +#: ../../library/dis.rst:1117 msgid "" -"Pushes a new function object on the stack built from the code object at " -"``STACK[-1]``." -msgstr "" - -#: ../../library/dis.rst:1604 -msgid "Flag value ``0x04`` is a tuple of strings instead of dictionary" -msgstr "" - -#: ../../library/dis.rst:1607 -msgid "Qualified name at ``STACK[-1]`` was removed." +"Loads a method named ``co_names[namei]`` from the TOS object. TOS is popped. " +"This bytecode distinguishes two cases: if TOS has a method with the correct " +"name, the bytecode pushes the unbound method and TOS. TOS will be used as " +"the first argument (``self``) by :opcode:`CALL_METHOD` when calling the " +"unbound method. Otherwise, ``NULL`` and the object return by the attribute " +"lookup are pushed." msgstr "" -#: ../../library/dis.rst:1610 +#: ../../library/dis.rst:1129 msgid "" -"Extra function attributes on the stack, signaled by oparg flags, were " -"removed. They now use :opcode:`SET_FUNCTION_ATTRIBUTE`." +"Calls a method. *argc* is the number of positional arguments. Keyword " +"arguments are not supported. This opcode is designed to be used with :" +"opcode:`LOAD_METHOD`. Positional arguments are on top of the stack. Below " +"them, the two items described in :opcode:`LOAD_METHOD` are on the stack " +"(either ``self`` and an unbound method object or ``NULL`` and an arbitrary " +"callable). All of them are popped and the return value is pushed." msgstr "" -#: ../../library/dis.rst:1617 +#: ../../library/dis.rst:1141 msgid "" -"Sets an attribute on a function object. Expects the function at " -"``STACK[-1]`` and the attribute value to set at ``STACK[-2]``; consumes both " -"and leaves the function at ``STACK[-1]``. The flag determines which " -"attribute to set:" +"Pushes a new function object on the stack. From bottom to top, the consumed " +"stack must consist of values if the argument carries a specified flag value" msgstr "" -#: ../../library/dis.rst:1621 +#: ../../library/dis.rst:1144 msgid "" "``0x01`` a tuple of default values for positional-only and positional-or-" "keyword parameters in positional order" msgstr "" -#: ../../library/dis.rst:1623 +#: ../../library/dis.rst:1146 msgid "``0x02`` a dictionary of keyword-only parameters' default values" msgstr "" -#: ../../library/dis.rst:1624 -msgid "``0x04`` a tuple of strings containing parameters' annotations" +#: ../../library/dis.rst:1147 +msgid "``0x04`` an annotation dictionary" msgstr "" -#: ../../library/dis.rst:1625 +#: ../../library/dis.rst:1148 msgid "``0x08`` a tuple containing cells for free variables, making a closure" msgstr "" -#: ../../library/dis.rst:1634 -msgid "" -"Pushes a slice object on the stack. *argc* must be 2 or 3. If it is 2, " -"implements::" -msgstr "" +#: ../../library/dis.rst:1149 +msgid "the code associated with the function (at TOS1)" +msgstr "関数に関連付けられたコード (TOS1の位置)" -#: ../../library/dis.rst:1636 -msgid "" -"end = STACK.pop()\n" -"start = STACK.pop()\n" -"STACK.append(slice(start, end))" -msgstr "" +#: ../../library/dis.rst:1150 +msgid "the :term:`qualified name` of the function (at TOS)" +msgstr "関数の :term:`qualified name` (TOSの位置)" -#: ../../library/dis.rst:1640 -msgid "if it is 3, implements::" -msgstr "" - -#: ../../library/dis.rst:1642 +#: ../../library/dis.rst:1157 msgid "" -"step = STACK.pop()\n" -"end = STACK.pop()\n" -"start = STACK.pop()\n" -"STACK.append(slice(start, end, step))" -msgstr "" - -#: ../../library/dis.rst:1647 -msgid "See the :func:`slice` built-in function for more information." +"Pushes a slice object on the stack. *argc* must be 2 or 3. If it is 2, " +"``slice(TOS1, TOS)`` is pushed; if it is 3, ``slice(TOS2, TOS1, TOS)`` is " +"pushed. See the :func:`slice` built-in function for more information." msgstr "" +"スライスオブジェクトをスタックにプッシュします。 *argc* は2あるいは3でなけれ" +"ばなりません。 2 ならば ``slice(TOS1, TOS)`` がプッシュされます。 3 ならば " +"``slice(TOS2, TOS1, TOS)`` がプッシュされます。 これ以上の情報については、 :" +"func:`slice()` 組み込み関数を参照してください。" -#: ../../library/dis.rst:1652 +#: ../../library/dis.rst:1164 msgid "" "Prefixes any opcode which has an argument too big to fit into the default " "one byte. *ext* holds an additional byte which act as higher bits in the " @@ -1855,421 +1305,64 @@ msgid "" "allowed, forming an argument from two-byte to four-byte." msgstr "" -#: ../../library/dis.rst:1660 -msgid "Convert value to a string, depending on ``oparg``::" -msgstr "" - -#: ../../library/dis.rst:1662 -msgid "" -"value = STACK.pop()\n" -"result = func(value)\n" -"STACK.append(result)" -msgstr "" - -#: ../../library/dis.rst:1666 -msgid "``oparg == 1``: call :func:`str` on *value*" -msgstr "" - -#: ../../library/dis.rst:1667 -msgid "``oparg == 2``: call :func:`repr` on *value*" -msgstr "" - -#: ../../library/dis.rst:1668 -msgid "``oparg == 3``: call :func:`ascii` on *value*" -msgstr "" - -#: ../../library/dis.rst:1670 ../../library/dis.rst:1683 -#: ../../library/dis.rst:1696 -msgid "Used for implementing formatted string literals (f-strings)." -msgstr "" - -#: ../../library/dis.rst:1677 -msgid "Formats the value on top of stack::" -msgstr "" - -#: ../../library/dis.rst:1679 -msgid "" -"value = STACK.pop()\n" -"result = value.__format__(\"\")\n" -"STACK.append(result)" -msgstr "" - -#: ../../library/dis.rst:1689 -msgid "Formats the given value with the given format spec::" -msgstr "" - -#: ../../library/dis.rst:1691 -msgid "" -"spec = STACK.pop()\n" -"value = STACK.pop()\n" -"result = value.__format__(spec)\n" -"STACK.append(result)" -msgstr "" - -#: ../../library/dis.rst:1703 -msgid "" -"``STACK[-1]`` is a tuple of keyword attribute names, ``STACK[-2]`` is the " -"class being matched against, and ``STACK[-3]`` is the match subject. " -"*count* is the number of positional sub-patterns." -msgstr "" - -#: ../../library/dis.rst:1707 +#: ../../library/dis.rst:1172 msgid "" -"Pop ``STACK[-1]``, ``STACK[-2]``, and ``STACK[-3]``. If ``STACK[-3]`` is an " -"instance of ``STACK[-2]`` and has the positional and keyword attributes " -"required by *count* and ``STACK[-1]``, push a tuple of extracted attributes. " -"Otherwise, push ``None``." +"Used for implementing formatted literal strings (f-strings). Pops an " +"optional *fmt_spec* from the stack, then a required *value*. *flags* is " +"interpreted as follows:" msgstr "" -#: ../../library/dis.rst:1721 -msgid "A no-op. Performs internal tracing, debugging and optimization checks." +#: ../../library/dis.rst:1176 +msgid "``(flags & 0x03) == 0x00``: *value* is formatted as-is." msgstr "" -#: ../../library/dis.rst:1723 +#: ../../library/dis.rst:1177 msgid "" -"The ``context`` operand consists of two parts. The lowest two bits indicate " -"where the ``RESUME`` occurs:" +"``(flags & 0x03) == 0x01``: call :func:`str` on *value* before formatting it." msgstr "" -#: ../../library/dis.rst:1726 +#: ../../library/dis.rst:1179 msgid "" -"``0`` The start of a function, which is neither a generator, coroutine nor " -"an async generator" -msgstr "" - -#: ../../library/dis.rst:1728 -msgid "``1`` After a ``yield`` expression" -msgstr "" - -#: ../../library/dis.rst:1729 -msgid "``2`` After a ``yield from`` expression" -msgstr "" - -#: ../../library/dis.rst:1730 -msgid "``3`` After an ``await`` expression" +"``(flags & 0x03) == 0x02``: call :func:`repr` on *value* before formatting " +"it." msgstr "" -#: ../../library/dis.rst:1732 -msgid "" -"The next bit is ``1`` if the RESUME is at except-depth ``1``, and ``0`` " -"otherwise." -msgstr "" - -#: ../../library/dis.rst:1737 -msgid "The oparg value changed to include information about except-depth" -msgstr "" - -#: ../../library/dis.rst:1743 +#: ../../library/dis.rst:1181 msgid "" -"Create a generator, coroutine, or async generator from the current frame. " -"Used as first opcode of in code object for the above mentioned callables. " -"Clear the current frame and return the newly created generator." +"``(flags & 0x03) == 0x03``: call :func:`ascii` on *value* before formatting " +"it." msgstr "" -#: ../../library/dis.rst:1752 +#: ../../library/dis.rst:1183 msgid "" -"Equivalent to ``STACK[-1] = STACK[-2].send(STACK[-1])``. Used in ``yield " -"from`` and ``await`` statements." +"``(flags & 0x04) == 0x04``: pop *fmt_spec* from the stack and use it, else " +"use an empty *fmt_spec*." msgstr "" -#: ../../library/dis.rst:1755 +#: ../../library/dis.rst:1186 msgid "" -"If the call raises :exc:`StopIteration`, pop the top value from the stack, " -"push the exception's ``value`` attribute, and increment the bytecode counter " -"by *delta*." +"Formatting is performed using :c:func:`PyObject_Format`. The result is " +"pushed on the stack." msgstr "" -#: ../../library/dis.rst:1764 +#: ../../library/dis.rst:1194 msgid "" "This is not really an opcode. It identifies the dividing line between " -"opcodes in the range [0,255] which don't use their argument and those that " -"do (``< HAVE_ARGUMENT`` and ``>= HAVE_ARGUMENT``, respectively)." +"opcodes which don't use their argument and those that do (``< " +"HAVE_ARGUMENT`` and ``>= HAVE_ARGUMENT``, respectively)." msgstr "" -#: ../../library/dis.rst:1768 -msgid "" -"If your application uses pseudo instructions or specialized instructions, " -"use the :data:`hasarg` collection instead." -msgstr "" - -#: ../../library/dis.rst:1771 +#: ../../library/dis.rst:1198 msgid "" "Now every instruction has an argument, but opcodes ``< HAVE_ARGUMENT`` " "ignore it. Before, only opcodes ``>= HAVE_ARGUMENT`` had an argument." msgstr "" -#: ../../library/dis.rst:1775 -msgid "" -"Pseudo instructions were added to the :mod:`dis` module, and for them it is " -"not true that comparison with ``HAVE_ARGUMENT`` indicates whether they use " -"their arg." -msgstr "" - -#: ../../library/dis.rst:1780 -msgid "Use :data:`hasarg` instead." -msgstr "" - -#: ../../library/dis.rst:1785 -msgid "" -"Calls an intrinsic function with one argument. Passes ``STACK[-1]`` as the " -"argument and sets ``STACK[-1]`` to the result. Used to implement " -"functionality that is not performance critical." -msgstr "" - -#: ../../library/dis.rst:1789 ../../library/dis.rst:1843 -msgid "The operand determines which intrinsic function is called:" -msgstr "" - -#: ../../library/dis.rst:1792 ../../library/dis.rst:1846 -msgid "Operand" -msgstr "" - -#: ../../library/dis.rst:1792 ../../library/dis.rst:1846 -msgid "Description" -msgstr "説明" - -#: ../../library/dis.rst:1794 -msgid "``INTRINSIC_1_INVALID``" -msgstr "" - -#: ../../library/dis.rst:1794 ../../library/dis.rst:1848 -msgid "Not valid" -msgstr "" - -#: ../../library/dis.rst:1796 -msgid "``INTRINSIC_PRINT``" -msgstr "" - -#: ../../library/dis.rst:1796 -msgid "Prints the argument to standard out. Used in the REPL." -msgstr "" - -#: ../../library/dis.rst:1799 -msgid "``INTRINSIC_IMPORT_STAR``" -msgstr "" - -#: ../../library/dis.rst:1799 -msgid "Performs ``import *`` for the named module." -msgstr "" - -#: ../../library/dis.rst:1802 -msgid "``INTRINSIC_STOPITERATION_ERROR``" -msgstr "" - -#: ../../library/dis.rst:1802 -msgid "Extracts the return value from a ``StopIteration`` exception." -msgstr "" - -#: ../../library/dis.rst:1805 -msgid "``INTRINSIC_ASYNC_GEN_WRAP``" -msgstr "" - -#: ../../library/dis.rst:1805 -msgid "Wraps an async generator value" -msgstr "" - -#: ../../library/dis.rst:1807 -msgid "``INTRINSIC_UNARY_POSITIVE``" -msgstr "" - -#: ../../library/dis.rst:1807 -msgid "Performs the unary ``+`` operation" -msgstr "" - -#: ../../library/dis.rst:1810 -msgid "``INTRINSIC_LIST_TO_TUPLE``" -msgstr "" - -#: ../../library/dis.rst:1810 -msgid "Converts a list to a tuple" -msgstr "" - -#: ../../library/dis.rst:1812 -msgid "``INTRINSIC_TYPEVAR``" -msgstr "" - -#: ../../library/dis.rst:1812 -msgid "Creates a :class:`typing.TypeVar`" -msgstr "" - -#: ../../library/dis.rst:1814 -msgid "``INTRINSIC_PARAMSPEC``" -msgstr "" - -#: ../../library/dis.rst:1814 -msgid "Creates a :class:`typing.ParamSpec`" -msgstr "" - -#: ../../library/dis.rst:1817 -msgid "``INTRINSIC_TYPEVARTUPLE``" -msgstr "" - -#: ../../library/dis.rst:1817 -msgid "Creates a :class:`typing.TypeVarTuple`" -msgstr "" - -#: ../../library/dis.rst:1820 -msgid "``INTRINSIC_SUBSCRIPT_GENERIC``" -msgstr "" - -#: ../../library/dis.rst:1820 -msgid "Returns :class:`typing.Generic` subscripted with the argument" -msgstr "" - -#: ../../library/dis.rst:1823 -msgid "``INTRINSIC_TYPEALIAS``" -msgstr "" - -#: ../../library/dis.rst:1823 -msgid "" -"Creates a :class:`typing.TypeAliasType`; used in the :keyword:`type` " -"statement. The argument is a tuple of the type alias's name, type " -"parameters, and value." -msgstr "" - -#: ../../library/dis.rst:1835 -msgid "" -"Calls an intrinsic function with two arguments. Used to implement " -"functionality that is not performance critical::" -msgstr "" - -#: ../../library/dis.rst:1838 -msgid "" -"arg2 = STACK.pop()\n" -"arg1 = STACK.pop()\n" -"result = intrinsic2(arg1, arg2)\n" -"STACK.append(result)" -msgstr "" - -#: ../../library/dis.rst:1848 -msgid "``INTRINSIC_2_INVALID``" -msgstr "" - -#: ../../library/dis.rst:1850 -msgid "``INTRINSIC_PREP_RERAISE_STAR``" -msgstr "" - -#: ../../library/dis.rst:1850 -msgid "Calculates the :exc:`ExceptionGroup` to raise from a ``try-except*``." -msgstr "" - -#: ../../library/dis.rst:1854 -msgid "``INTRINSIC_TYPEVAR_WITH_BOUND``" -msgstr "" - -#: ../../library/dis.rst:1854 -msgid "Creates a :class:`typing.TypeVar` with a bound." -msgstr "" - -#: ../../library/dis.rst:1857 -msgid "``INTRINSIC_TYPEVAR_WITH_CONSTRAINTS``" -msgstr "" - -#: ../../library/dis.rst:1857 -msgid "Creates a :class:`typing.TypeVar` with constraints." -msgstr "" - -#: ../../library/dis.rst:1861 -msgid "``INTRINSIC_SET_FUNCTION_TYPE_PARAMS``" -msgstr "" - -#: ../../library/dis.rst:1861 -msgid "Sets the ``__type_params__`` attribute of a function." -msgstr "" - -#: ../../library/dis.rst:1870 -msgid "" -"Performs special method lookup on ``STACK[-1]``. If ``type(STACK[-1])." -"__xxx__`` is a method, leave ``type(STACK[-1]).__xxx__; STACK[-1]`` on the " -"stack. If ``type(STACK[-1]).__xxx__`` is not a method, leave ``STACK[-1]." -"__xxx__; NULL`` on the stack." -msgstr "" - -#: ../../library/dis.rst:1879 -msgid "**Pseudo-instructions**" -msgstr "" - -#: ../../library/dis.rst:1881 -msgid "" -"These opcodes do not appear in Python bytecode. They are used by the " -"compiler but are replaced by real opcodes or removed before bytecode is " -"generated." -msgstr "" - -#: ../../library/dis.rst:1886 -msgid "" -"Set up an exception handler for the following code block. If an exception " -"occurs, the value stack level is restored to its current state and control " -"is transferred to the exception handler at ``target``." -msgstr "" - -#: ../../library/dis.rst:1893 -msgid "" -"Like ``SETUP_FINALLY``, but in case of an exception also pushes the last " -"instruction (``lasti``) to the stack so that ``RERAISE`` can restore it. If " -"an exception occurs, the value stack level and the last instruction on the " -"frame are restored to their current state, and control is transferred to the " -"exception handler at ``target``." -msgstr "" - -#: ../../library/dis.rst:1902 -msgid "" -"Like ``SETUP_CLEANUP``, but in case of an exception one more item is popped " -"from the stack before control is transferred to the exception handler at " -"``target``." -msgstr "" - -#: ../../library/dis.rst:1906 -msgid "" -"This variant is used in :keyword:`with` and :keyword:`async with` " -"constructs, which push the return value of the context manager's :meth:" -"`~object.__enter__` or :meth:`~object.__aenter__` to the stack." -msgstr "" - -#: ../../library/dis.rst:1913 -msgid "" -"Marks the end of the code block associated with the last ``SETUP_FINALLY``, " -"``SETUP_CLEANUP`` or ``SETUP_WITH``." -msgstr "" - -#: ../../library/dis.rst:1919 -msgid "" -"Undirected relative jump instructions which are replaced by their directed " -"(forward/backward) counterparts by the assembler." -msgstr "" - -#: ../../library/dis.rst:1925 -msgid "" -"Conditional jumps which do not impact the stack. Replaced by the sequence " -"``COPY 1``, ``TO_BOOL``, ``POP_JUMP_IF_TRUE/FALSE``." -msgstr "" - -#: ../../library/dis.rst:1930 -msgid "" -"Pushes a reference to the cell contained in slot ``i`` of the \"fast " -"locals\" storage." -msgstr "" - -#: ../../library/dis.rst:1933 -msgid "" -"Note that ``LOAD_CLOSURE`` is replaced with ``LOAD_FAST`` in the assembler." -msgstr "" - -#: ../../library/dis.rst:1935 -msgid "This opcode is now a pseudo-instruction." -msgstr "" - -#: ../../library/dis.rst:1941 -msgid "" -"Optimized unbound method lookup. Emitted as a ``LOAD_ATTR`` opcode with a " -"flag set in the arg." -msgstr "" - -#: ../../library/dis.rst:1948 +#: ../../library/dis.rst:1206 msgid "Opcode collections" msgstr "命令コードコレクション" -#: ../../library/dis.rst:1950 +#: ../../library/dis.rst:1208 msgid "" "These collections are provided for automatic introspection of bytecode " "instructions:" @@ -2277,84 +1370,52 @@ msgstr "" "これらのコレクションは、自動でバイトコード命令を解析するために提供されていま" "す:" -#: ../../library/dis.rst:1953 -msgid "" -"The collections now contain pseudo instructions and instrumented " -"instructions as well. These are opcodes with values ``>= MIN_PSEUDO_OPCODE`` " -"and ``>= MIN_INSTRUMENTED_OPCODE``." -msgstr "" - -#: ../../library/dis.rst:1960 +#: ../../library/dis.rst:1213 msgid "Sequence of operation names, indexable using the bytecode." msgstr "" "命令コード名のリスト。\n" "バイトコードをインデックスに使って参照できます。" -#: ../../library/dis.rst:1965 +#: ../../library/dis.rst:1218 msgid "Dictionary mapping operation names to bytecodes." msgstr "命令コード名をバイトコードに対応づける辞書。" -#: ../../library/dis.rst:1970 +#: ../../library/dis.rst:1223 msgid "Sequence of all compare operation names." msgstr "すべての比較命令の名前のリスト。" -#: ../../library/dis.rst:1975 -msgid "Sequence of bytecodes that use their argument." -msgstr "" - -#: ../../library/dis.rst:1982 +#: ../../library/dis.rst:1228 msgid "Sequence of bytecodes that access a constant." msgstr "定数にアクセスするバイトコードのリスト。" -#: ../../library/dis.rst:1987 +#: ../../library/dis.rst:1233 msgid "" -"Sequence of bytecodes that access a :term:`free (closure) variable `. 'free' in this context refers to names in the current scope that " -"are referenced by inner scopes or names in outer scopes that are referenced " -"from this scope. It does *not* include references to global or builtin " -"scopes." +"Sequence of bytecodes that access a free variable (note that 'free' in this " +"context refers to names in the current scope that are referenced by inner " +"scopes or names in outer scopes that are referenced from this scope. It " +"does *not* include references to global or builtin scopes)." msgstr "" +"自由変数にアクセスするバイトコードのリスト (この文脈での '自由' とは、現在の" +"スコープにある名前で内側のスコープから参照されているもの、もしくは外側のス" +"コープにある名前で現在のスコープから参照しているものを指します。グローバルス" +"コープや組み込みのスコープへの参照は含み *ません*)。" -#: ../../library/dis.rst:1995 +#: ../../library/dis.rst:1241 msgid "Sequence of bytecodes that access an attribute by name." msgstr "名前によって属性にアクセスするバイトコードのリスト。" -#: ../../library/dis.rst:2000 -msgid "Sequence of bytecodes that have a jump target. All jumps are relative." -msgstr "" - -#: ../../library/dis.rst:2007 -msgid "Sequence of bytecodes that access a local variable." -msgstr "ローカル変数にアクセスするバイトコードのリスト。" - -#: ../../library/dis.rst:2012 -msgid "Sequence of bytecodes of Boolean operations." -msgstr "ブール命令のバイトコードのリスト。" - -#: ../../library/dis.rst:2016 -msgid "Sequence of bytecodes that set an exception handler." -msgstr "" - -#: ../../library/dis.rst:2023 +#: ../../library/dis.rst:1246 msgid "Sequence of bytecodes that have a relative jump target." msgstr "相対ジャンプ先を持つバイトコードのリスト。" -#: ../../library/dis.rst:2025 -msgid "All jumps are now relative. Use :data:`hasjump`." -msgstr "" - -#: ../../library/dis.rst:2031 +#: ../../library/dis.rst:1251 msgid "Sequence of bytecodes that have an absolute jump target." msgstr "絶対ジャンプ先を持つバイトコードのリスト。" -#: ../../library/dis.rst:2033 -msgid "All jumps are now relative. This list is empty." -msgstr "" - -#: ../../library/dis.rst:1632 -msgid "built-in function" -msgstr "組み込み関数" +#: ../../library/dis.rst:1256 +msgid "Sequence of bytecodes that access a local variable." +msgstr "ローカル変数にアクセスするバイトコードのリスト。" -#: ../../library/dis.rst:1632 -msgid "slice" -msgstr "slice" +#: ../../library/dis.rst:1261 +msgid "Sequence of bytecodes of Boolean operations." +msgstr "ブール命令のバイトコードのリスト。" diff --git a/library/distribution.po b/library/distribution.po index c933e5425..e5d195046 100644 --- a/library/distribution.po +++ b/library/distribution.po @@ -1,26 +1,26 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 -# 石井明久, 2024 +# Inada Naoki , 2017 +# tomo, 2018 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-13 14:21+0000\n" -"PO-Revision-Date: 2021-06-28 01:04+0000\n" -"Last-Translator: 石井明久, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 23:07+0000\n" +"Last-Translator: tomo, 2018\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/distribution.rst:3 @@ -35,6 +35,7 @@ msgid "" "index server, or without any index server at all." msgstr "" "以下のライブラリは Python で書かれたソフトウェアを配布、インストールするため" -"のものです。これらのモジュールは `Python Package Index `__ " -"に対して動作するように設計されていますが、ローカルのインデックスサーバーや、" -"インデックスサーバーなしに使うこともできます。" +"のものです。\n" +"これらは `Python Package Index `__ に対して動作するように設" +"計されていますが、ローカルのインデックスサーバーや、インデックスサーバーなし" +"に使うこともできます。" diff --git a/library/distutils.po b/library/distutils.po index 548776e81..17a085a61 100644 --- a/library/distutils.po +++ b/library/distutils.po @@ -1,37 +1,119 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # +# Translators: +# Nozomu Kaneko , 2017 +# tomo, 2017 +# Arihiro TAKASE, 2017 +# E. Kawashima, 2017 +# #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-13 14:21+0000\n" -"PO-Revision-Date: 2024-11-19 01:02+0000\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 23:07+0000\n" +"Last-Translator: E. Kawashima, 2017\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/distutils.rst:2 -msgid ":mod:`!distutils` --- Building and installing Python modules" +msgid ":mod:`distutils` --- Building and installing Python modules" +msgstr ":mod:`distutils` --- Python モジュールの構築とインストール" + +#: ../../library/distutils.rst:12 +msgid "" +"The :mod:`distutils` package provides support for building and installing " +"additional modules into a Python installation. The new modules may be " +"either 100%-pure Python, or may be extension modules written in C, or may be " +"collections of Python packages which include modules coded in both Python " +"and C." msgstr "" +":mod:`distutils` パッケージは、現在インストールされている Python に追加するた" +"めのモジュール構築、および実際のインストールを支援します。新規のモジュールは " +"100%-pure Python でも、C で書かれた拡張モジュールでも、あるいは Python と C " +"両方のコードが入っているモジュールからなる Python パッケージでもかまいませ" +"ん。" -#: ../../library/distutils.rst:10 +#: ../../library/distutils.rst:17 msgid "" -"This module is no longer part of the Python standard library. It was :ref:" -"`removed in Python 3.12 ` after being " -"deprecated in Python 3.10. The removal was decided in :pep:`632`, which has " -"`migration advice `_." +"Most Python users will *not* want to use this module directly, but instead " +"use the cross-version tools maintained by the Python Packaging Authority. In " +"particular, `setuptools `__ is " +"an enhanced alternative to :mod:`distutils` that provides:" msgstr "" +"Python ユーザの大半はこのパッケージを直接使い *たくはない* でしょうが、代わり" +"に Python Packaging Authority が保守しているクロスバージョンツールを使うで" +"しょう。特に、`setuptools `__ " +"は :mod:`distutils` の改良された代替品で、以下を提供しています:" + +#: ../../library/distutils.rst:23 +msgid "support for declaring project dependencies" +msgstr "プロジェクトの依存性の宣言のサポート" -#: ../../library/distutils.rst:16 +#: ../../library/distutils.rst:24 msgid "" -"The last version of Python that provided the :mod:`!distutils` module was " -"`Python 3.11 `_." +"additional mechanisms for configuring which files to include in source " +"releases (including plugins for integration with version control systems)" msgstr "" +"ソースのリリースの際どのファイルを含めるか指定する追加の機構 (バージョン管理" +"システムとの統合のためのプラグインも含む)" + +#: ../../library/distutils.rst:26 +msgid "" +"the ability to declare project \"entry points\", which can be used as the " +"basis for application plugin systems" +msgstr "" +"プロジェクトの \"エントリーポイント\" を宣言する機能、アプリケーションプラグ" +"インシステムとして使うことができます" + +#: ../../library/distutils.rst:28 +msgid "" +"the ability to automatically generate Windows command line executables at " +"installation time rather than needing to prebuild them" +msgstr "" +"インストール時に事前にビルドすることなく、Windows コマンドライン実行ファイル" +"を自動的に生成する機能" + +#: ../../library/distutils.rst:30 +msgid "consistent behaviour across all supported Python versions" +msgstr "サポートしている Python の全バージョンで一貫性のある挙動" + +#: ../../library/distutils.rst:32 +msgid "" +"The recommended `pip `__ installer runs all ``setup." +"py`` scripts with ``setuptools``, even if the script itself only imports " +"``distutils``. Refer to the `Python Packaging User Guide `_ for more information." +msgstr "" +"たとえスクリプト自身が ``distutils`` のみをインポートしていても、推奨される " +"`pip `__ インストーラは ``setuptools`` で全 ``setup." +"py`` スクリプトを実行します。詳細は `Python Packaging User Guide `_ を参照してください。" + +#: ../../library/distutils.rst:38 +msgid "" +"For the benefits of packaging tool authors and users seeking a deeper " +"understanding of the details of the current packaging and distribution " +"system, the legacy :mod:`distutils` based user documentation and API " +"reference remain available:" +msgstr "" +"現在のパッケージと配布システムへの理解を深めようとしている著者やユーザのため" +"に、レガシーな :mod:`distutils` に基づくユーザドキュメントと API のリファレン" +"スは利用可能なままになっています。" + +#: ../../library/distutils.rst:43 +msgid ":ref:`install-index`" +msgstr ":ref:`install-index`" + +#: ../../library/distutils.rst:44 +msgid ":ref:`distutils-index`" +msgstr ":ref:`distutils-index`" diff --git a/library/doctest.po b/library/doctest.po index ae4d731dc..a95dbb2ba 100644 --- a/library/doctest.po +++ b/library/doctest.po @@ -1,37 +1,38 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 +# Arjun Bareja , 2017 +# Nozomu Kaneko , 2017 +# Ryuichi Takano , 2017 +# Yoshinari Takaoka , 2017 +# 秘湯 , 2017 +# Arihiro TAKASE, 2017 +# tomo, 2019 # Yusuke Miyazaki , 2021 -# Takanori Suzuki , 2023 -# Arihiro TAKASE, 2023 -# Osamu NAKAMURA, 2023 -# TENMYO Masakazu, 2023 -# Takeshi Nakazato, 2024 -# 石井明久, 2024 +# Osamu NAKAMURA, 2021 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-06 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 01:04+0000\n" -"Last-Translator: 石井明久, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 23:07+0000\n" +"Last-Translator: Osamu NAKAMURA, 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/doctest.rst:2 -msgid ":mod:`!doctest` --- Test interactive Python examples" -msgstr ":mod:`!doctest` --- 対話型の Python の例をテストする" +msgid ":mod:`doctest` --- Test interactive Python examples" +msgstr ":mod:`doctest` --- 対話的な実行例をテストする" #: ../../library/doctest.rst:12 msgid "**Source code:** :source:`Lib/doctest.py`" @@ -79,64 +80,6 @@ msgstr "" msgid "Here's a complete but small example module::" msgstr "以下に完全かつ短い実行例を示します::" -#: ../../library/doctest.rst:33 -msgid "" -"\"\"\"\n" -"This is the \"example\" module.\n" -"\n" -"The example module supplies one function, factorial(). For example,\n" -"\n" -">>> factorial(5)\n" -"120\n" -"\"\"\"\n" -"\n" -"def factorial(n):\n" -" \"\"\"Return the factorial of n, an exact integer >= 0.\n" -"\n" -" >>> [factorial(n) for n in range(6)]\n" -" [1, 1, 2, 6, 24, 120]\n" -" >>> factorial(30)\n" -" 265252859812191058636308480000000\n" -" >>> factorial(-1)\n" -" Traceback (most recent call last):\n" -" ...\n" -" ValueError: n must be >= 0\n" -"\n" -" Factorials of floats are OK, but the float must be an exact integer:\n" -" >>> factorial(30.1)\n" -" Traceback (most recent call last):\n" -" ...\n" -" ValueError: n must be exact integer\n" -" >>> factorial(30.0)\n" -" 265252859812191058636308480000000\n" -"\n" -" It must also not be ridiculously large:\n" -" >>> factorial(1e100)\n" -" Traceback (most recent call last):\n" -" ...\n" -" OverflowError: n too large\n" -" \"\"\"\n" -"\n" -" import math\n" -" if not n >= 0:\n" -" raise ValueError(\"n must be >= 0\")\n" -" if math.floor(n) != n:\n" -" raise ValueError(\"n must be exact integer\")\n" -" if n+1 == n: # catch a value like 1e300\n" -" raise OverflowError(\"n too large\")\n" -" result = 1\n" -" factor = 2\n" -" while factor <= n:\n" -" result *= factor\n" -" factor += 1\n" -" return result\n" -"\n" -"\n" -"if __name__ == \"__main__\":\n" -" import doctest\n" -" doctest.testmod()" -msgstr "" - #: ../../library/doctest.rst:88 msgid "" "If you run :file:`example.py` directly from the command line, :mod:`doctest` " @@ -145,12 +88,6 @@ msgstr "" ":file:`example.py` をコマンドラインから直接実行すると、 :mod:`doctest` はその" "魔法を働かせます:" -#: ../../library/doctest.rst:91 -msgid "" -"$ python example.py\n" -"$" -msgstr "" - #: ../../library/doctest.rst:96 msgid "" "There's no output! That's normal, and it means all the examples worked. " @@ -161,80 +98,40 @@ msgstr "" "を意味しています。スクリプトに ``-v`` を与えると、 :mod:`doctest` は何を行お" "うとしているのかを記録した詳細なログを出力し、最後にまとめを出力します:" -#: ../../library/doctest.rst:100 -msgid "" -"$ python example.py -v\n" -"Trying:\n" -" factorial(5)\n" -"Expecting:\n" -" 120\n" -"ok\n" -"Trying:\n" -" [factorial(n) for n in range(6)]\n" -"Expecting:\n" -" [1, 1, 2, 6, 24, 120]\n" -"ok" -msgstr "" - #: ../../library/doctest.rst:114 msgid "And so on, eventually ending with:" msgstr "といった具合で、最後には:" -#: ../../library/doctest.rst:116 -msgid "" -"Trying:\n" -" factorial(1e100)\n" -"Expecting:\n" -" Traceback (most recent call last):\n" -" ...\n" -" OverflowError: n too large\n" -"ok\n" -"2 items passed all tests:\n" -" 1 test in __main__\n" -" 6 tests in __main__.factorial\n" -"7 tests in 2 items.\n" -"7 passed.\n" -"Test passed.\n" -"$" -msgstr "" - #: ../../library/doctest.rst:133 msgid "" "That's all you need to know to start making productive use of :mod:" "`doctest`! Jump in. The following sections provide full details. Note that " "there are many examples of doctests in the standard Python test suite and " "libraries. Especially useful examples can be found in the standard test " -"file :file:`Lib/test/test_doctest/test_doctest.py`." -msgstr "" - -#: ../../library/doctest.rst:139 -msgid "" -"Output is colorized by default and can be :ref:`controlled using environment " -"variables `." +"file :file:`Lib/test/test_doctest.py`." msgstr "" +":mod:`doctest` の生産的な利用を始めるために知る必要があるのはこれだけです!さ" +"あやってみましょう。詳細な事柄は後続の各節ですべて説明しています。 doctest の" +"例は、標準の Python テストスイートやライブラリ中に沢山あります。標準のテスト" +"ファイル :file:`Lib/test/test_doctest.py` には、特に役に立つ例があります。" -#: ../../library/doctest.rst:147 +#: ../../library/doctest.rst:143 msgid "Simple Usage: Checking Examples in Docstrings" msgstr "簡単な利用法: docstring 中の実行例をチェックする" -#: ../../library/doctest.rst:149 +#: ../../library/doctest.rst:145 msgid "" "The simplest way to start using doctest (but not necessarily the way you'll " -"continue to do it) is to end each module :mod:`!M` with::" +"continue to do it) is to end each module :mod:`M` with::" msgstr "" +"doctest を試す簡単な方法 (とはいえ、いつもそうする必要はないのですが) は、各" +"モジュール :mod:`M` の最後を、以下のようにして締めくくることです::" #: ../../library/doctest.rst:152 -msgid "" -"if __name__ == \"__main__\":\n" -" import doctest\n" -" doctest.testmod()" -msgstr "" +msgid ":mod:`doctest` then examines docstrings in module :mod:`M`." +msgstr "こうすると、 :mod:`doctest` は :mod:`M` 中の docstring を検査します。" -#: ../../library/doctest.rst:156 -msgid ":mod:`!doctest` then examines docstrings in module :mod:`!M`." -msgstr "" - -#: ../../library/doctest.rst:158 +#: ../../library/doctest.rst:154 msgid "" "Running the module as a script causes the examples in the docstrings to get " "executed and verified::" @@ -242,11 +139,7 @@ msgstr "" "モジュールをスクリプトとして実行すると、docstring 中の実行例が実行され、検証" "されます::" -#: ../../library/doctest.rst:161 -msgid "python M.py" -msgstr "" - -#: ../../library/doctest.rst:163 +#: ../../library/doctest.rst:159 msgid "" "This won't display anything unless an example fails, in which case the " "failing example(s) and the cause(s) of the failure(s) are printed to stdout, " @@ -258,15 +151,11 @@ msgstr "" "最後に ``***Test Failed*** N failures.`` という行を出力します。ここで、*N* は" "失敗した実行例の数です。" -#: ../../library/doctest.rst:168 +#: ../../library/doctest.rst:164 msgid "Run it with the ``-v`` switch instead::" msgstr "一方、``-v`` スイッチをつけて走らせると::" -#: ../../library/doctest.rst:170 -msgid "python M.py -v" -msgstr "" - -#: ../../library/doctest.rst:172 +#: ../../library/doctest.rst:168 msgid "" "and a detailed report of all examples tried is printed to standard output, " "along with assorted summaries at the end." @@ -274,21 +163,40 @@ msgstr "" "実行を試みたすべての実行例について詳細に報告し、最後に各種まとめを行った内容" "が標準出力に印字されます。" -#: ../../library/doctest.rst:175 +#: ../../library/doctest.rst:171 msgid "" "You can force verbose mode by passing ``verbose=True`` to :func:`testmod`, " -"or prohibit it by passing ``verbose=False``. In either of those cases, :" -"data:`sys.argv` is not examined by :func:`testmod` (so passing ``-v`` or not " +"or prohibit it by passing ``verbose=False``. In either of those cases, " +"``sys.argv`` is not examined by :func:`testmod` (so passing ``-v`` or not " "has no effect)." msgstr "" +"``verbose=True`` を :func:`testmod` に渡せば、詳細報告 (verbose) モードを強制" +"できます。また、 ``verbose=False`` にすれば禁止できます。どちらの場合にも、 :" +"func:`testmod` は ``sys.argv`` 上のスイッチを調べません。(したがって、 ``-" +"v`` をつけても効果はありません)。" -#: ../../library/doctest.rst:180 +#: ../../library/doctest.rst:176 msgid "" -"There is also a command line shortcut for running :func:`testmod`, see " -"section :ref:`doctest-cli`." +"There is also a command line shortcut for running :func:`testmod`. You can " +"instruct the Python interpreter to run the doctest module directly from the " +"standard library and pass the module name(s) on the command line::" +msgstr "" +":func:`testmod` を実行するコマンドラインショートカットもあります。 Python イ" +"ンタプリタに doctest モジュールを標準ライブラリから直接実行して、テストするモ" +"ジュール名をコマンドライン引数に与えます::" + +#: ../../library/doctest.rst:182 +msgid "" +"This will import :file:`example.py` as a standalone module and run :func:" +"`testmod` on it. Note that this may not work correctly if the file is part " +"of a package and imports other submodules from that package." msgstr "" +"こうすると :file:`example.py` を単体モジュールとしてインポートして、それに対" +"して :func:`testmod` を実行します。このファイルがパッケージの一部で他のサブモ" +"ジュールをそのパッケージからインポートしている場合はうまく動かないことに注意" +"してください。" -#: ../../library/doctest.rst:183 +#: ../../library/doctest.rst:186 msgid "" "For more information on :func:`testmod`, see section :ref:`doctest-basic-" "api`." @@ -296,11 +204,11 @@ msgstr "" ":func:`testmod` の詳しい情報は :ref:`doctest-basic-api` 節を参照してくださ" "い。" -#: ../../library/doctest.rst:189 +#: ../../library/doctest.rst:192 msgid "Simple Usage: Checking Examples in a Text File" msgstr "簡単な利用法: テキストファイル中の実行例をチェックする" -#: ../../library/doctest.rst:191 +#: ../../library/doctest.rst:194 msgid "" "Another simple application of doctest is testing interactive examples in a " "text file. This can be done with the :func:`testfile` function::" @@ -308,13 +216,7 @@ msgstr "" "doctest のもう一つの簡単な用途は、テキストファイル中にある対話実行例に対する" "テストです。これには :func:`testfile` 関数を使います::" -#: ../../library/doctest.rst:194 -msgid "" -"import doctest\n" -"doctest.testfile(\"example.txt\")" -msgstr "" - -#: ../../library/doctest.rst:197 +#: ../../library/doctest.rst:200 msgid "" "That short script executes and verifies any interactive Python examples " "contained in the file :file:`example.txt`. The file content is treated as " @@ -327,26 +229,7 @@ msgstr "" "ラムである必要はありません!例えば、 :file:`example.txt` には以下のような内容" "が入っているとします:" -#: ../../library/doctest.rst:202 -msgid "" -"The ``example`` module\n" -"======================\n" -"\n" -"Using ``factorial``\n" -"-------------------\n" -"\n" -"This is an example text file in reStructuredText format. First import\n" -"``factorial`` from the ``example`` module:\n" -"\n" -" >>> from example import factorial\n" -"\n" -"Now use it:\n" -"\n" -" >>> factorial(6)\n" -" 120" -msgstr "" - -#: ../../library/doctest.rst:220 +#: ../../library/doctest.rst:223 msgid "" "Running ``doctest.testfile(\"example.txt\")`` then finds the error in this " "documentation::" @@ -354,26 +237,18 @@ msgstr "" "``doctest.testfile(\"example.txt\")`` を実行すると、このドキュメント内のエ" "ラーを見つけ出します::" -#: ../../library/doctest.rst:223 -msgid "" -"File \"./example.txt\", line 14, in example.txt\n" -"Failed example:\n" -" factorial(6)\n" -"Expected:\n" -" 120\n" -"Got:\n" -" 720" -msgstr "" - -#: ../../library/doctest.rst:231 +#: ../../library/doctest.rst:234 msgid "" "As with :func:`testmod`, :func:`testfile` won't display anything unless an " "example fails. If an example does fail, then the failing example(s) and the " "cause(s) of the failure(s) are printed to stdout, using the same format as :" -"func:`!testmod`." +"func:`testmod`." msgstr "" +":func:`testmod` と同じく、 :func:`testfile` は実行例が失敗しない限り何も表示" +"しません。実行例が失敗すると、失敗した実行例とその原因が (場合によっては複" +"数) :func:`testmod` と同じ書式で標準出力に書き出されます。" -#: ../../library/doctest.rst:236 +#: ../../library/doctest.rst:239 msgid "" "By default, :func:`testfile` looks for files in the calling module's " "directory. See section :ref:`doctest-basic-api` for a description of the " @@ -385,7 +260,7 @@ msgstr "" "`testfile` に指示するためのオプション引数についての説明は :ref:`doctest-" "basic-api` 節を参照してください。" -#: ../../library/doctest.rst:240 +#: ../../library/doctest.rst:243 msgid "" "Like :func:`testmod`, :func:`testfile`'s verbosity can be set with the ``-" "v`` command-line switch or with the optional keyword argument *verbose*." @@ -394,74 +269,36 @@ msgstr "" "ンスイッチ ``-v`` またはオプションのキーワード引数 *verbose* によって指定でき" "ます。" -#: ../../library/doctest.rst:244 -msgid "" -"There is also a command line shortcut for running :func:`testfile`, see " -"section :ref:`doctest-cli`." -msgstr "" - #: ../../library/doctest.rst:247 msgid "" -"For more information on :func:`testfile`, see section :ref:`doctest-basic-" -"api`." +"There is also a command line shortcut for running :func:`testfile`. You can " +"instruct the Python interpreter to run the doctest module directly from the " +"standard library and pass the file name(s) on the command line::" msgstr "" -":func:`testfile` の詳細は :ref:`doctest-basic-api` 節を参照してください。" +":func:`testfile` を実行するコマンドラインショートカットもあります。 Python イ" +"ンタプリタに doctest モジュールを標準ライブラリから直接実行して、テストするモ" +"ジュール名をコマンドライン引数に与えます::" #: ../../library/doctest.rst:253 -msgid "Command-line Usage" -msgstr "" - -#: ../../library/doctest.rst:255 -msgid "" -"The :mod:`doctest` module can be invoked as a script from the command line:" -msgstr "" - -#: ../../library/doctest.rst:257 -msgid "python -m doctest [-v] [-o OPTION] [-f] file [file ...]" -msgstr "" - -#: ../../library/doctest.rst:265 msgid "" -"Detailed report of all examples tried is printed to standard output, along " -"with assorted summaries at the end::" -msgstr "" - -#: ../../library/doctest.rst:268 -msgid "python -m doctest -v example.py" +"Because the file name does not end with :file:`.py`, :mod:`doctest` infers " +"that it must be run with :func:`testfile`, not :func:`testmod`." msgstr "" +"ファイル名が :file:`.py` で終っていないので、 :mod:`doctest` は :func:" +"`testmod` ではなく :func:`testfile` を使って実行するのだと判断します。" -#: ../../library/doctest.rst:270 +#: ../../library/doctest.rst:256 msgid "" -"This will import :file:`example.py` as a standalone module and run :func:" -"`testmod` on it. Note that this may not work correctly if the file is part " -"of a package and imports other submodules from that package." -msgstr "" - -#: ../../library/doctest.rst:274 -msgid "" -"If the file name does not end with :file:`.py`, :mod:`!doctest` infers that " -"it must be run with :func:`testfile` instead::" -msgstr "" - -#: ../../library/doctest.rst:277 -msgid "python -m doctest -v example.txt" -msgstr "" - -#: ../../library/doctest.rst:281 -msgid "" -"Option flags control various aspects of doctest's behavior, see section :ref:" -"`doctest-options`." -msgstr "" - -#: ../../library/doctest.rst:288 -msgid "This is shorthand for ``-o FAIL_FAST``." +"For more information on :func:`testfile`, see section :ref:`doctest-basic-" +"api`." msgstr "" +":func:`testfile` の詳細は :ref:`doctest-basic-api` 節を参照してください。" -#: ../../library/doctest.rst:296 +#: ../../library/doctest.rst:262 msgid "How It Works" msgstr "doctest のからくり" -#: ../../library/doctest.rst:298 +#: ../../library/doctest.rst:264 msgid "" "This section examines in detail how doctest works: which docstrings it looks " "at, how it finds interactive examples, what execution context it uses, how " @@ -477,11 +314,11 @@ msgstr "" "識です; 書いた実行例に対して実際に doctest を実行する上で必要な情報については" "後続の節を参照してください。" -#: ../../library/doctest.rst:309 +#: ../../library/doctest.rst:275 msgid "Which Docstrings Are Examined?" msgstr "どの docstring が検証されるのか?" -#: ../../library/doctest.rst:311 +#: ../../library/doctest.rst:277 msgid "" "The module docstring, and all function, class and method docstrings are " "searched. Objects imported into the module are not searched." @@ -489,46 +326,22 @@ msgstr "" "モジュールの docstring と、すべての関数、クラスおよびメソッドの docstring が" "検索されます。モジュールに import されたオブジェクトは検索されません。" -#: ../../library/doctest.rst:317 +#: ../../library/doctest.rst:280 msgid "" -"In addition, there are cases when you want tests to be part of a module but " -"not part of the help text, which requires that the tests not be included in " -"the docstring. Doctest looks for a module-level variable called ``__test__`` " -"and uses it to locate other tests. If ``M.__test__`` exists, it must be a " -"dict, and each entry maps a (string) name to a function object, class " -"object, or string. Function and class object docstrings found from ``M." -"__test__`` are searched, and strings are treated as if they were " -"docstrings. In output, a key ``K`` in ``M.__test__`` appears with name ``M." -"__test__.K``." +"In addition, if ``M.__test__`` exists and \"is true\", it must be a dict, " +"and each entry maps a (string) name to a function object, class object, or " +"string. Function and class object docstrings found from ``M.__test__`` are " +"searched, and strings are treated as if they were docstrings. In output, a " +"key ``K`` in ``M.__test__`` appears with name ::" msgstr "" +"加えて、``M.__test__`` が存在し、\"真の値を持つ\" 場合、この値は辞書でなけれ" +"ばならず、辞書の各エントリは (文字列の) 名前を関数オブジェクト、クラスオブ" +"ジェクト、または文字列へとマップします。``M.__test__`` から得られた関数および" +"クラスオブジェクトの docstring は、その名前がプライベートなものでも検索され、" +"文字列の場合にはそれが docstring であるかのように扱われます。出力においては、" +"``M.__test__`` におけるキー ``K`` は、以下の名前で表示されます ::" -#: ../../library/doctest.rst:326 -msgid "For example, place this block of code at the top of :file:`example.py`:" -msgstr "" - -#: ../../library/doctest.rst:328 -msgid "" -"__test__ = {\n" -" 'numbers': \"\"\"\n" -">>> factorial(6)\n" -"720\n" -"\n" -">>> [factorial(n) for n in range(6)]\n" -"[1, 1, 2, 6, 24, 120]\n" -"\"\"\"\n" -"}" -msgstr "" - -#: ../../library/doctest.rst:340 -msgid "" -"The value of ``example.__test__[\"numbers\"]`` will be treated as a " -"docstring and all the tests inside it will be run. It is important to note " -"that the value can be mapped to a function, class object, or module; if so, :" -"mod:`!doctest` searches them recursively for docstrings, which are then " -"scanned for tests." -msgstr "" - -#: ../../library/doctest.rst:346 +#: ../../library/doctest.rst:288 msgid "" "Any classes found are recursively searched similarly, to test docstrings in " "their contained methods and nested classes." @@ -536,11 +349,11 @@ msgstr "" "検索中に見つかったクラスも同様に再帰的に検索が行われ、クラスに含まれているメ" "ソッドおよびネストされたクラスについて docstring のテストが行われます。" -#: ../../library/doctest.rst:353 +#: ../../library/doctest.rst:299 msgid "How are Docstring Examples Recognized?" msgstr "docstring 内の実行例をどのように認識するのか?" -#: ../../library/doctest.rst:355 +#: ../../library/doctest.rst:301 msgid "" "In most cases a copy-and-paste of an interactive console session works fine, " "but doctest isn't trying to do an exact emulation of any specific Python " @@ -550,26 +363,7 @@ msgstr "" "ます。とはいえ、:mod:`doctest` は特定の Python シェルの振る舞いを正確にエミュ" "レーションしようとするわけではありません。" -#: ../../library/doctest.rst:360 -msgid "" -">>> # comments are ignored\n" -">>> x = 12\n" -">>> x\n" -"12\n" -">>> if x == 13:\n" -"... print(\"yes\")\n" -"... else:\n" -"... print(\"no\")\n" -"... print(\"NO\")\n" -"... print(\"NO!!!\")\n" -"...\n" -"no\n" -"NO\n" -"NO!!!\n" -">>>" -msgstr "" - -#: ../../library/doctest.rst:380 +#: ../../library/doctest.rst:326 msgid "" "Any expected output must immediately follow the final ``'>>> '`` or ``'... " "'`` line containing the code, and the expected output (if any) extends to " @@ -579,11 +373,11 @@ msgstr "" "置かれます。(出力結果がもしあれば) それは次の ``'>>> '`` 行か、すべて空白文字" "の行まで続きます。" -#: ../../library/doctest.rst:384 +#: ../../library/doctest.rst:330 msgid "The fine print:" msgstr "詳細事項:" -#: ../../library/doctest.rst:386 +#: ../../library/doctest.rst:332 msgid "" "Expected output cannot contain an all-whitespace line, since such a line is " "taken to signal the end of expected output. If expected output does contain " @@ -595,7 +389,7 @@ msgstr "" "空白行が入っている場合には、空白行が入るべき場所すべてに ```` を入" "れてください。" -#: ../../library/doctest.rst:391 +#: ../../library/doctest.rst:337 msgid "" "All hard tab characters are expanded to spaces, using 8-column tab stops. " "Tabs in output generated by the tested code are not modified. Because any " @@ -620,7 +414,7 @@ msgstr "" "は、独自の :class:`DocTestParser` クラスを実装して、別のアルゴリズムを使うこ" "ともできます。" -#: ../../library/doctest.rst:403 +#: ../../library/doctest.rst:349 msgid "" "Output to stdout is captured, but not output to stderr (exception tracebacks " "are captured via a different means)." @@ -628,7 +422,7 @@ msgstr "" "標準出力への出力は取り込まれますが、標準エラーは取り込まれません (例外発生時" "のトレースバックは別の方法で取り込まれます)。" -#: ../../library/doctest.rst:406 +#: ../../library/doctest.rst:352 msgid "" "If you continue a line via backslashing in an interactive session, or for " "any other reason use a backslash, you should use a raw docstring, which will " @@ -638,16 +432,7 @@ msgstr "" "の理由でバックスラッシュを用いる場合、raw docstring を使ってバックスラッシュ" "を入力どおりに扱わせるようにしなければなりません::" -#: ../../library/doctest.rst:410 -msgid "" -">>> def f(x):\n" -"... r'''Backslashes in a raw docstring: m\\n'''\n" -"...\n" -">>> print(f.__doc__)\n" -"Backslashes in a raw docstring: m\\n" -msgstr "" - -#: ../../library/doctest.rst:416 +#: ../../library/doctest.rst:361 msgid "" "Otherwise, the backslash will be interpreted as part of the string. For " "example, the ``\\n`` above would be interpreted as a newline character. " @@ -659,28 +444,11 @@ msgstr "" "doctest にあるバックスラッシュを二重にする (そして raw string を使わない) と" "いう方法もあります::" -#: ../../library/doctest.rst:420 -msgid "" -">>> def f(x):\n" -"... '''Backslashes in a raw docstring: m\\\\n'''\n" -"...\n" -">>> print(f.__doc__)\n" -"Backslashes in a raw docstring: m\\n" -msgstr "" - -#: ../../library/doctest.rst:426 +#: ../../library/doctest.rst:370 msgid "The starting column doesn't matter::" msgstr "開始カラムはどこでもかまいません::" -#: ../../library/doctest.rst:428 -msgid "" -">>> assert \"Easy!\"\n" -" >>> import math\n" -" >>> math.floor(1.9)\n" -" 1" -msgstr "" - -#: ../../library/doctest.rst:433 +#: ../../library/doctest.rst:377 msgid "" "and as many leading whitespace characters are stripped from the expected " "output as appeared in the initial ``'>>> '`` line that started the example." @@ -688,22 +456,29 @@ msgstr "" "期待する出力結果の先頭部にある空白文字列は、実行例の開始部分にあたる ``'>>> " "'`` 行の先頭にある空白文字列と同じだけ取り除かれます。" -#: ../../library/doctest.rst:440 +#: ../../library/doctest.rst:384 msgid "What's the Execution Context?" msgstr "実行コンテキストとは何か?" -#: ../../library/doctest.rst:442 +#: ../../library/doctest.rst:386 msgid "" "By default, each time :mod:`doctest` finds a docstring to test, it uses a " -"*shallow copy* of :mod:`!M`'s globals, so that running tests doesn't change " -"the module's real globals, and so that one test in :mod:`!M` can't leave " +"*shallow copy* of :mod:`M`'s globals, so that running tests doesn't change " +"the module's real globals, and so that one test in :mod:`M` can't leave " "behind crumbs that accidentally allow another test to work. This means " -"examples can freely use any names defined at top-level in :mod:`!M`, and " +"examples can freely use any names defined at top-level in :mod:`M`, and " "names defined earlier in the docstring being run. Examples cannot see names " "defined in other docstrings." msgstr "" +"デフォルトでは、 :mod:`doctest` はテストを行うべき docstring を見つけるたび" +"に :mod:`M` のグローバル名前空間の *浅いコピー* を使い、テストの実行によって" +"モジュールの実際のグローバル名前空間を変更しないようにし、かつ :mod:`M` 内で" +"行ったテストが痕跡を残して偶発的に別のテストを誤って動作させないようにしてい" +"ます。したがって、実行例中では :mod:`M` 内のトップレベルで定義されたすべての" +"名前と、 docstring が動作する以前に定義された名前を自由に使えます。個々の実行" +"例は他の docstring 中で定義された名前を参照できません。" -#: ../../library/doctest.rst:450 +#: ../../library/doctest.rst:394 msgid "" "You can force use of your own dict as the execution context by passing " "``globs=your_dict`` to :func:`testmod` or :func:`testfile` instead." @@ -711,11 +486,11 @@ msgstr "" ":func:`testmod` や :func:`testfile` に ``globs=your_dict`` を渡し、自前の辞書" "を実行コンテキストとして使うこともできます。" -#: ../../library/doctest.rst:457 +#: ../../library/doctest.rst:401 msgid "What About Exceptions?" msgstr "例外はどう扱えばよいか?" -#: ../../library/doctest.rst:459 +#: ../../library/doctest.rst:403 msgid "" "No problem, provided that the traceback is the only output produced by the " "example: just paste in the traceback. [#]_ Since tracebacks contain details " @@ -728,19 +503,11 @@ msgstr "" "な情報 (例えばファイルパスや行番号など) が入っているものなので、これは受け入" "れるテスト結果に柔軟性を持たせようと doctest が苦労している部分の一つです。" -#: ../../library/doctest.rst:465 +#: ../../library/doctest.rst:409 msgid "Simple example::" msgstr "簡単な例を示しましょう::" -#: ../../library/doctest.rst:467 -msgid "" -">>> [1, 2, 3].remove(42)\n" -"Traceback (most recent call last):\n" -" File \"\", line 1, in \n" -"ValueError: list.remove(x): x not in list" -msgstr "" - -#: ../../library/doctest.rst:472 +#: ../../library/doctest.rst:416 msgid "" "That doctest succeeds if :exc:`ValueError` is raised, with the ``list." "remove(x): x not in list`` detail as shown." @@ -748,7 +515,7 @@ msgstr "" "この doctest は、 :exc:`ValueError` が送出され、その詳細情報が ``list." "remove(x): x not in list`` である場合に成功します。" -#: ../../library/doctest.rst:475 +#: ../../library/doctest.rst:419 msgid "" "The expected output for an exception must start with a traceback header, " "which may be either of the following two lines, indented the same as the " @@ -758,13 +525,7 @@ msgstr "" "なりません。トレースバックの形式は以下の二通りの行のいずれかで、実行例の最初" "の行と同じインデントでなければりません::" -#: ../../library/doctest.rst:479 -msgid "" -"Traceback (most recent call last):\n" -"Traceback (innermost last):" -msgstr "" - -#: ../../library/doctest.rst:482 +#: ../../library/doctest.rst:426 msgid "" "The traceback header is followed by an optional traceback stack, whose " "contents are ignored by doctest. The traceback stack is typically omitted, " @@ -774,7 +535,7 @@ msgstr "" "doctest はその内容を無視します。普通はトレースバックスタックを省略するか、対" "話セッションからそのままコピーしてきます。" -#: ../../library/doctest.rst:486 +#: ../../library/doctest.rst:430 msgid "" "The traceback stack is followed by the most interesting part: the line(s) " "containing the exception type and detail. This is usually the last line of " @@ -785,17 +546,7 @@ msgstr "" "入った行があります。これは通常トレースバックの最後の行ですが、例外が複数行の" "詳細情報を持っている場合、複数の行にわたることもあります::" -#: ../../library/doctest.rst:491 -msgid "" -">>> raise ValueError('multi\\n line\\ndetail')\n" -"Traceback (most recent call last):\n" -" File \"\", line 1, in \n" -"ValueError: multi\n" -" line\n" -"detail" -msgstr "" - -#: ../../library/doctest.rst:498 +#: ../../library/doctest.rst:442 msgid "" "The last three lines (starting with :exc:`ValueError`) are compared against " "the exception's type and detail, and the rest are ignored." @@ -803,7 +554,7 @@ msgstr "" "上の例では、最後の 3 行 (:exc:`ValueError` から始まる行) における例外の型と詳" "細情報だけが比較され、それ以外の部分は無視されます。" -#: ../../library/doctest.rst:501 +#: ../../library/doctest.rst:445 msgid "" "Best practice is to omit the traceback stack, unless it adds significant " "documentation value to the example. So the last example is probably better " @@ -813,17 +564,7 @@ msgstr "" "ない限り、トレースバックスタックは省略する、ということです。したがって、先ほ" "どの例は以下のように書くべきでしょう::" -#: ../../library/doctest.rst:504 -msgid "" -">>> raise ValueError('multi\\n line\\ndetail')\n" -"Traceback (most recent call last):\n" -" ...\n" -"ValueError: multi\n" -" line\n" -"detail" -msgstr "" - -#: ../../library/doctest.rst:511 +#: ../../library/doctest.rst:455 msgid "" "Note that tracebacks are treated very specially. In particular, in the " "rewritten example, the use of ``...`` is independent of doctest's :const:" @@ -837,12 +578,12 @@ msgstr "" "マや数字が 3 個 (または 300 個) かもしれませんし、 Monty Python のスキットを" "インデントして書き写したものかもしれません。" -#: ../../library/doctest.rst:517 +#: ../../library/doctest.rst:461 msgid "Some details you should read once, but won't need to remember:" msgstr "" "以下の詳細はずっと覚えておく必要はないのですが、一度目を通しておいてください:" -#: ../../library/doctest.rst:519 +#: ../../library/doctest.rst:463 msgid "" "Doctest can't guess whether your expected output came from an exception " "traceback or from ordinary printing. So, e.g., an example that expects " @@ -857,7 +598,7 @@ msgstr "" "列を print した場合の両方で成功してしまいます。現実的には、通常の出力がトレー" "スバックヘッダから始まることはないので、実際に問題になることはないでしょう。" -#: ../../library/doctest.rst:526 +#: ../../library/doctest.rst:470 msgid "" "Each line of the traceback stack (if present) must be indented further than " "the first line of the example, *or* start with a non-alphanumeric character. " @@ -871,7 +612,7 @@ msgstr "" "初の行は例外の詳細情報が書かれた行とみなされるからです。もちろん、本物のト" "レースバックでは正しく動作します。" -#: ../../library/doctest.rst:532 +#: ../../library/doctest.rst:476 msgid "" "When the :const:`IGNORE_EXCEPTION_DETAIL` doctest option is specified, " "everything following the leftmost colon and any module information in the " @@ -881,31 +622,29 @@ msgstr "" "端のコロン以後の全ての内容と、例外名の中の全てのモジュール情報が無視されま" "す。" -#: ../../library/doctest.rst:536 +#: ../../library/doctest.rst:480 msgid "" "The interactive shell omits the traceback header line for some :exc:" "`SyntaxError`\\ s. But doctest uses the traceback header line to " "distinguish exceptions from non-exceptions. So in the rare case where you " -"need to test a :exc:`!SyntaxError` that omits the traceback header, you will " +"need to test a :exc:`SyntaxError` that omits the traceback header, you will " "need to manually add the traceback header line to your test example." msgstr "" +"対話シェルでは、 :exc:`SyntaxError` の場合にトレースバックヘッダが省略される" +"ことがあります。しかし doctest にとっては、例外を例外でないものと区別するため" +"にトレースバックヘッダが必要です。そこで、トレースバックヘッダを省略するよう" +"な :exc:`SyntaxError` をテストする必要があるというごく稀なケースでは、実行例" +"にトレースバックヘッダを手作業で追加する必要があるでしょう。" -#: ../../library/doctest.rst:544 -msgid "" -"For some exceptions, Python displays the position of the error using ``^`` " -"markers and tildes::" -msgstr "" - -#: ../../library/doctest.rst:547 +#: ../../library/doctest.rst:488 msgid "" -">>> 1 + None\n" -" File \"\", line 1\n" -" 1 + None\n" -" ~~^~~~~~\n" -"TypeError: unsupported operand type(s) for +: 'int' and 'NoneType'" +"For some :exc:`SyntaxError`\\ s, Python displays the character position of " +"the syntax error, using a ``^`` marker::" msgstr "" +":exc:`SyntaxError` の場合、 Python は構文エラーの起きた場所を ``^`` マーカで" +"表示します::" -#: ../../library/doctest.rst:553 +#: ../../library/doctest.rst:497 msgid "" "Since the lines showing the position of the error come before the exception " "type and detail, they are not checked by doctest. For example, the " @@ -916,20 +655,11 @@ msgstr "" "ません。例えば、以下の例では、間違った場所に ``^`` マーカを入れても成功してし" "まいます::" -#: ../../library/doctest.rst:557 -msgid "" -">>> 1 + None\n" -" File \"\", line 1\n" -" 1 + None\n" -" ^~~~~~~~\n" -"TypeError: unsupported operand type(s) for +: 'int' and 'NoneType'" -msgstr "" - -#: ../../library/doctest.rst:568 +#: ../../library/doctest.rst:513 msgid "Option Flags" msgstr "オプションフラグ" -#: ../../library/doctest.rst:570 +#: ../../library/doctest.rst:515 msgid "" "A number of option flags control various aspects of doctest's behavior. " "Symbolic names for the flags are supplied as module constants, which can be :" @@ -944,7 +674,11 @@ msgstr "" "ref:`doctest directives ` でも使用でき、doctest コマンド" "ラインインターフェースに ``-o`` を通して与えることができます。" -#: ../../library/doctest.rst:576 +#: ../../library/doctest.rst:521 +msgid "The ``-o`` command line option." +msgstr "``-o`` コマンドラインオプション" + +#: ../../library/doctest.rst:524 msgid "" "The first group of options define test semantics, controlling aspects of how " "doctest decides whether actual output matches an example's expected output:" @@ -953,7 +687,7 @@ msgstr "" "際にテストを実行したときの出力と実行例中の期待する出力とが一致しているかどう" "かを doctest がどのように判断するかを制御します:" -#: ../../library/doctest.rst:582 +#: ../../library/doctest.rst:530 msgid "" "By default, if an expected output block contains just ``1``, an actual " "output block containing just ``1`` or just ``True`` is considered to be a " @@ -973,7 +707,7 @@ msgstr "" "常の整数\" の出力を期待する出力とするような doctest も動作します。このオプ" "ションはそのうちなくなるでしょうが、ここ数年はそのままでしょう。" -#: ../../library/doctest.rst:594 +#: ../../library/doctest.rst:542 msgid "" "By default, if an expected output block contains a line containing only the " "string ````, then that line will match a blank line in the actual " @@ -988,7 +722,7 @@ msgstr "" "`DONT_ACCEPT_BLANKLINE` を指定すると、 ```` の読み替えを行わなくな" "ります。" -#: ../../library/doctest.rst:603 +#: ../../library/doctest.rst:551 msgid "" "When specified, all sequences of whitespace (blanks and newlines) are " "treated as equal. Any sequence of whitespace within the expected output " @@ -1003,7 +737,7 @@ msgstr "" "`NORMALIZE_WHITESPACE` は、期待する出力の内容が非常に長いために、ソースコード" "中でその内容を複数行に折り返して書きたい場合に特に便利です。" -#: ../../library/doctest.rst:614 +#: ../../library/doctest.rst:562 msgid "" "When specified, an ellipsis marker (``...``) in the expected output can " "match any substring in the actual output. This includes substrings that " @@ -1018,46 +752,61 @@ msgstr "" "ように \"しまった、マッチしすぎた! (match too much!)\" と驚くことになりかね" "ません。" -#: ../../library/doctest.rst:623 +#: ../../library/doctest.rst:571 msgid "" -"When specified, doctests expecting exceptions pass so long as an exception " -"of the expected type is raised, even if the details (message and fully " -"qualified exception name) don't match." +"When specified, an example that expects an exception passes if an exception " +"of the expected type is raised, even if the exception detail does not " +"match. For example, an example expecting ``ValueError: 42`` will pass if " +"the actual exception raised is ``ValueError: 3*14``, but will fail, e.g., " +"if :exc:`TypeError` is raised." msgstr "" +"このフラグを指定すると、期待する実行結果に例外が入るような実行例で、期待通り" +"の型の例外が送出された場合に、例外の詳細情報が一致していなくてもテストが成功" +"します。例えば、期待する出力が ``ValueError: 42`` であるような実行例は、実際" +"に送出された例外が ``ValueError: 3*14`` でも成功しますが、 :exc:`TypeError` " +"が送出されるといった場合には成功しません。" -#: ../../library/doctest.rst:627 +#: ../../library/doctest.rst:577 msgid "" -"For example, an example expecting ``ValueError: 42`` will pass if the actual " -"exception raised is ``ValueError: 3*14``, but will fail if, say, a :exc:" -"`TypeError` is raised instead. It will also ignore any fully qualified name " -"included before the exception class, which can vary between implementations " -"and versions of Python and the code/libraries in use. Hence, all three of " -"these variations will work with the flag specified:" +"It will also ignore the module name used in Python 3 doctest reports. Hence " +"both of these variations will work with the flag specified, regardless of " +"whether the test is run under Python 2.7 or Python 3.2 (or later versions)::" msgstr "" +"また Python 3 の doctest レポートにあるモジュール名も無視します。従ってこのフ" +"ラグを指定すると、テストを Python 2.7 と Python 3.2 (もしくはそれ以降) のどち" +"らで行ったかに関係無く、どちらに対しても正しく動作します::" -#: ../../library/doctest.rst:635 +#: ../../library/doctest.rst:589 msgid "" -">>> raise Exception('message')\n" -"Traceback (most recent call last):\n" -"Exception: message\n" -"\n" -">>> raise Exception('message')\n" -"Traceback (most recent call last):\n" -"builtins.Exception: message\n" -"\n" -">>> raise Exception('message')\n" -"Traceback (most recent call last):\n" -"__main__.Exception: message" -msgstr "" +"Note that :const:`ELLIPSIS` can also be used to ignore the details of the " +"exception message, but such a test may still fail based on whether or not " +"the module details are printed as part of the exception name. Using :const:" +"`IGNORE_EXCEPTION_DETAIL` and the details from Python 2.3 is also the only " +"clear way to write a doctest that doesn't care about the exception detail " +"yet continues to pass under Python 2.3 or earlier (those releases do not " +"support :ref:`doctest directives ` and ignore them as " +"irrelevant comments). For example::" +msgstr "" +"なお、 :const:`ELLIPSIS` を使っても例外メッセージの詳細を無視することができま" +"すが、モジュールの詳細が例外名の一部として表示されるかどうかに依存するような" +"テストは、やはり失敗します。また、 :const:`IGNORE_EXCEPTION_DETAIL` と " +"Python 2.3 の詳細情報を使うことが、例外の詳細に影響されず、なおかつ Python " +"2.3 以前の Python (これらのリリースは :ref:`doctest ディレクティブ ` をサポートせず、これらを無関係なコメントとして無視します) で成功" +"する doctest を書くための、唯一の明確な方法です。例えば、例外の詳細情報は " +"2.4 で変更され、 \"doesn't\" の代わりに \"does not\" と書くようになりました" +"が::" -#: ../../library/doctest.rst:649 +#: ../../library/doctest.rst:603 msgid "" -"Note that :const:`ELLIPSIS` can also be used to ignore the details of the " -"exception message, but such a test may still fail based on whether the " -"module name is present or matches exactly." +"passes under Python 2.3 and later Python versions with the flag specified, " +"even though the detail changed in Python 2.4 to say \"does not\" instead of " +"\"doesn't\"." msgstr "" +"とすると、Python 2.3 やPython 2.4以降の Python バージョンでテストを成功させる" +"ことができます。" -#: ../../library/doctest.rst:653 +#: ../../library/doctest.rst:607 msgid "" ":const:`IGNORE_EXCEPTION_DETAIL` now also ignores any information relating " "to the module containing the exception under test." @@ -1065,7 +814,7 @@ msgstr "" ":mod:`doctest` モジュールの :const:`IGNORE_EXCEPTION_DETAIL` フラグが、 テス" "トされている例外を含むモジュールの名前を無視するようになりました。" -#: ../../library/doctest.rst:660 +#: ../../library/doctest.rst:614 msgid "" "When specified, do not run the example at all. This can be useful in " "contexts where doctest examples serve as both documentation and test cases, " @@ -1079,20 +828,20 @@ msgstr "" "す。例えば、実行例の出力がランダムであるとか、テストドライバーには利用できな" "いリソースに依存している場合などです。" -#: ../../library/doctest.rst:666 +#: ../../library/doctest.rst:620 msgid "" "The SKIP flag can also be used for temporarily \"commenting out\" examples." msgstr "SKIP フラグは一時的に実行例を\"コメントアウト\"するのにも使えます。" -#: ../../library/doctest.rst:671 +#: ../../library/doctest.rst:625 msgid "A bitmask or'ing together all the comparison flags above." msgstr "上記の比較フラグすべての論理和をとったビットマスクです。" -#: ../../library/doctest.rst:673 +#: ../../library/doctest.rst:627 msgid "The second group of options controls how test failures are reported:" msgstr "二つ目のオプション群は、テストの失敗を報告する方法を制御します:" -#: ../../library/doctest.rst:678 +#: ../../library/doctest.rst:632 msgid "" "When specified, failures that involve multi-line expected and actual outputs " "are displayed using a unified diff." @@ -1100,7 +849,7 @@ msgstr "" "このオプションを指定すると、期待する出力および実際の出力が複数行になるときに" "テストの失敗結果を unified diff 形式を使って表示します。" -#: ../../library/doctest.rst:684 +#: ../../library/doctest.rst:638 msgid "" "When specified, failures that involve multi-line expected and actual outputs " "will be displayed using a context diff." @@ -1108,7 +857,7 @@ msgstr "" "このオプションを指定すると、期待する出力および実際の出力が複数行になるときに" "テストの失敗結果を context diff 形式を使って表示します。" -#: ../../library/doctest.rst:690 +#: ../../library/doctest.rst:644 msgid "" "When specified, differences are computed by ``difflib.Differ``, using the " "same algorithm as the popular :file:`ndiff.py` utility. This is the only " @@ -1124,7 +873,7 @@ msgstr "" "字の ``1`` が入っていて、実際の出力には ``l`` が入っている場合、不一致の起き" "ているカラム位置を示すキャレットの入った行が一行挿入されます。" -#: ../../library/doctest.rst:699 +#: ../../library/doctest.rst:653 msgid "" "When specified, display the first failing example in each doctest, but " "suppress output for all remaining examples. This will prevent doctest from " @@ -1143,7 +892,7 @@ msgstr "" "以後の実行例を続けて実行し、失敗したテストの総数を報告します; 出力が抑制され" "るだけです。" -#: ../../library/doctest.rst:710 +#: ../../library/doctest.rst:664 msgid "" "When specified, exit after the first failing example and don't attempt to " "run the remaining examples. Thus, the number of failures reported will be at " @@ -1155,11 +904,19 @@ msgstr "" "敗より後の例はデバッグ出力を生成しないため、このフラグはデバッグの際に有用で" "しょう。" -#: ../../library/doctest.rst:718 +#: ../../library/doctest.rst:669 +msgid "" +"The doctest command line accepts the option ``-f`` as a shorthand for ``-o " +"FAIL_FAST``." +msgstr "" +"doctest コマンドラインは ``-f`` を ``-o FAIL_FAST`` の短縮形として受け付けま" +"す。" + +#: ../../library/doctest.rst:677 msgid "A bitmask or'ing together all the reporting flags above." msgstr "上記のエラー報告に関するフラグすべての論理和をとったビットマスクです。" -#: ../../library/doctest.rst:721 +#: ../../library/doctest.rst:680 msgid "" "There is also a way to register new option flag names, though this isn't " "useful unless you intend to extend :mod:`doctest` internals via subclassing:" @@ -1167,7 +924,7 @@ msgstr "" "サブクラス化で :mod:`doctest` 内部を拡張するつもりがなければ役に立ちません" "が、別の新しいオプションフラグ名を登録する方法もあります:" -#: ../../library/doctest.rst:727 +#: ../../library/doctest.rst:686 msgid "" "Create a new option flag with a given name, and return the new flag's " "integer value. :func:`register_optionflag` can be used when subclassing :" @@ -1181,15 +938,11 @@ msgstr "" "トさせる際に使います。 :func:`register_optionflag` は以下のような定形文で呼び" "出さなければなりません::" -#: ../../library/doctest.rst:733 -msgid "MY_FLAG = register_optionflag('MY_FLAG')" -msgstr "" - -#: ../../library/doctest.rst:743 +#: ../../library/doctest.rst:702 msgid "Directives" msgstr "ディレクティブ (Directives)" -#: ../../library/doctest.rst:745 +#: ../../library/doctest.rst:704 msgid "" "Doctest directives may be used to modify the :ref:`option flags ` for an individual example. Doctest directives are special Python " @@ -1199,7 +952,7 @@ msgstr "" "options>` を操作するために使われます。 doctest ディレクティブは後のソースコー" "ド例にあるような特殊な Python コメントです:" -#: ../../library/doctest.rst:756 +#: ../../library/doctest.rst:715 msgid "" "Whitespace is not allowed between the ``+`` or ``-`` and the directive " "option name. The directive option name can be any of the option flag names " @@ -1208,7 +961,7 @@ msgstr "" "``+`` や ``-`` とディレクティブオプション名の間に空白を入れてはなりません。" "ディレクティブオプション名は上で説明したオプションフラグ名のいずれかです。" -#: ../../library/doctest.rst:760 +#: ../../library/doctest.rst:719 msgid "" "An example's doctest directives modify doctest's behavior for that single " "example. Use ``+`` to enable the named behavior, or ``-`` to disable it." @@ -1217,80 +970,47 @@ msgstr "" "変えます。ある特定の挙動を有効にしたければ ``+`` を、無効にしたければ ``-`` " "を使います。" -#: ../../library/doctest.rst:763 -msgid "For example, this test passes:" -msgstr "例えば、以下のテストは成功します:" - -#: ../../library/doctest.rst:765 -msgid "" -">>> print(list(range(20))) # doctest: +NORMALIZE_WHITESPACE\n" -"[0, 1, 2, 3, 4, 5, 6, 7, 8, 9,\n" -"10, 11, 12, 13, 14, 15, 16, 17, 18, 19]" -msgstr "" +#: ../../library/doctest.rst:722 +msgid "For example, this test passes::" +msgstr "例えば、以下のテストは成功します::" -#: ../../library/doctest.rst:772 +#: ../../library/doctest.rst:728 msgid "" "Without the directive it would fail, both because the actual output doesn't " "have two blanks before the single-digit list elements, and because the " "actual output is on a single line. This test also passes, and also requires " -"a directive to do so:" +"a directive to do so::" msgstr "" "ディレクティブがない場合、実際の出力には一桁の数字の間に二つスペースが入って" "いないこと、実際の出力は 1 行になることから、テストは成功しないはずです。別の" -"ディレクティブを使って、このテストを成功させることもできます:" +"ディレクティブを使って、このテストを成功させることもできます::" -#: ../../library/doctest.rst:777 -msgid "" -">>> print(list(range(20))) # doctest: +ELLIPSIS\n" -"[0, 1, ..., 18, 19]" -msgstr "" - -#: ../../library/doctest.rst:783 +#: ../../library/doctest.rst:736 msgid "" "Multiple directives can be used on a single physical line, separated by " -"commas:" +"commas::" msgstr "" -"複数のディレクティブは、一つの物理行の中にコンマで区切って指定できます:" +"複数のディレクティブは、一つの物理行の中にコンマで区切って指定できます::" -#: ../../library/doctest.rst:786 -msgid "" -">>> print(list(range(20))) # doctest: +ELLIPSIS, +NORMALIZE_WHITESPACE\n" -"[0, 1, ..., 18, 19]" -msgstr "" - -#: ../../library/doctest.rst:792 +#: ../../library/doctest.rst:742 msgid "" "If multiple directive comments are used for a single example, then they are " -"combined:" +"combined::" msgstr "" "一つの実行例中で複数のディレクティブコメントを使った場合、それらは組み合わさ" -"れます:" - -#: ../../library/doctest.rst:795 -msgid "" -">>> print(list(range(20))) # doctest: +ELLIPSIS\n" -"... # doctest: +NORMALIZE_WHITESPACE\n" -"[0, 1, ..., 18, 19]" -msgstr "" +"れます::" -#: ../../library/doctest.rst:802 +#: ../../library/doctest.rst:749 msgid "" "As the previous example shows, you can add ``...`` lines to your example " "containing only directives. This can be useful when an example is too long " -"for a directive to comfortably fit on the same line:" +"for a directive to comfortably fit on the same line::" msgstr "" "この実行例で分かるように、実行例にはディレクティブだけを含む ``...`` 行を追加" "することができます。この書きかたは、実行例が長すぎるためにディレクティブを同" -"じ行に入れると収まりが悪い場合に便利です:" - -#: ../../library/doctest.rst:806 -msgid "" -">>> print(list(range(5)) + list(range(10, 20)) + list(range(30, 40)))\n" -"... # doctest: +ELLIPSIS\n" -"[0, ..., 4, 10, ..., 19, 30, ..., 39]" -msgstr "" +"じ行に入れると収まりが悪い場合に便利です::" -#: ../../library/doctest.rst:813 +#: ../../library/doctest.rst:757 msgid "" "Note that since all options are disabled by default, and directives apply " "only to the example they appear in, enabling options (via ``+`` in a " @@ -1305,11 +1025,11 @@ msgstr "" "プションフラグを指定してデフォルトとは異なった挙動を実現できるので、そのよう" "な場合には ``-`` を使った無効化オプションも意味を持ちます。" -#: ../../library/doctest.rst:823 +#: ../../library/doctest.rst:767 msgid "Warnings" msgstr "警告" -#: ../../library/doctest.rst:825 +#: ../../library/doctest.rst:769 msgid "" ":mod:`doctest` is serious about requiring exact matches in expected output. " "If even a single character doesn't match, the test fails. This will " @@ -1325,82 +1045,51 @@ msgstr "" "例えば、集合を出力する際、 Python は要素がある特定の順番で並ぶよう保証しては" "いません。したがって、以下のようなテスト ::" -#: ../../library/doctest.rst:831 -msgid "" -">>> foo()\n" -"{\"spam\", \"eggs\"}" -msgstr "" - -#: ../../library/doctest.rst:834 +#: ../../library/doctest.rst:778 msgid "is vulnerable! One workaround is to do ::" msgstr "は失敗するかもしれないのです! 回避するには ::" -#: ../../library/doctest.rst:836 -msgid "" -">>> foo() == {\"spam\", \"eggs\"}\n" -"True" -msgstr "" - -#: ../../library/doctest.rst:839 +#: ../../library/doctest.rst:783 msgid "instead. Another is to do ::" msgstr "とするのが一つのやり方です。別のやり方は ::" -#: ../../library/doctest.rst:841 +#: ../../library/doctest.rst:791 msgid "" -">>> d = sorted(foo())\n" -">>> d\n" -"['eggs', 'spam']" +"Before Python 3.6, when printing a dict, Python did not guarantee that the " +"key-value pairs was printed in any particular order." msgstr "" +"Python 3.6 以前では、辞書を表示するときに、 Python はキーと値のペアはある特定" +"の順序で並ぶよう保証はされていませんでした。" -#: ../../library/doctest.rst:845 +#: ../../library/doctest.rst:794 msgid "There are others, but you get the idea." msgstr "他のやり方もありますが、あとは自分で考えてみてください。" -#: ../../library/doctest.rst:847 -msgid "Another bad idea is to print things that embed an object address, like" -msgstr "" -"以下のように、オブジェクトアドレスを埋め込むような結果を print するのもよくあ" -"りません :" - -#: ../../library/doctest.rst:849 -msgid "" -">>> id(1.0) # certain to fail some of the time\n" -"7948648\n" -">>> class C: pass\n" -">>> C() # the default repr() for instances embeds an address\n" -"" -msgstr "" - -#: ../../library/doctest.rst:857 +#: ../../library/doctest.rst:796 msgid "" -"The :const:`ELLIPSIS` directive gives a nice approach for the last example:" +"Another bad idea is to print things that embed an object address, like ::" msgstr "" -":const:`ELLIPSIS` ディレクティブを使うと、上のような例をうまく解決できます:" +"以下のように、オブジェクトアドレスを埋め込むような結果を print するのもよくあ" +"りません ::" -#: ../../library/doctest.rst:859 +#: ../../library/doctest.rst:804 msgid "" -">>> C() # doctest: +ELLIPSIS\n" -"" +"The :const:`ELLIPSIS` directive gives a nice approach for the last example::" msgstr "" +":const:`ELLIPSIS` ディレクティブを使うと、上のような例をうまく解決できます::" -#: ../../library/doctest.rst:865 +#: ../../library/doctest.rst:809 msgid "" "Floating-point numbers are also subject to small output variations across " -"platforms, because Python defers to the platform C library for some floating-" -"point calculations, and C libraries vary widely in quality here. ::" +"platforms, because Python defers to the platform C library for float " +"formatting, and C libraries vary widely in quality here. ::" msgstr "" +"浮動小数点数もまた、プラットフォーム間での微妙な出力の違いの原因となります。" +"というのも、Python は浮動小数点の書式化をプラットフォームの C ライブラリに委" +"ねており、この点では、C ライブラリはプラットフォーム間で非常に大きく異なって" +"いるからです。 ::" -#: ../../library/doctest.rst:869 -msgid "" -">>> 1000**0.1 # risky\n" -"1.9952623149688797\n" -">>> round(1000**0.1, 9) # safer\n" -"1.995262315\n" -">>> print(f'{1000**0.1:.4f}') # much safer\n" -"1.9953" -msgstr "" - -#: ../../library/doctest.rst:876 +#: ../../library/doctest.rst:820 msgid "" "Numbers of the form ``I/2.**J`` are safe across all platforms, and I often " "contrive doctest examples to produce numbers of that form::" @@ -1408,13 +1097,7 @@ msgstr "" "``I/2.**J`` の形式になる数値はどのプラットフォームでもうまく動作するので、私" "はこの形式の数値を生成するように doctest の実行例を工夫しています::" -#: ../../library/doctest.rst:879 -msgid "" -">>> 3./4 # utterly safe\n" -"0.75" -msgstr "" - -#: ../../library/doctest.rst:882 +#: ../../library/doctest.rst:826 msgid "" "Simple fractions are also easier for people to understand, and that makes " "for better documentation." @@ -1422,11 +1105,11 @@ msgstr "" "単純な分数は人間にとっても理解しやすく、良いドキュメントを書くために役に立ち" "ます。" -#: ../../library/doctest.rst:889 +#: ../../library/doctest.rst:833 msgid "Basic API" msgstr "基本 API" -#: ../../library/doctest.rst:891 +#: ../../library/doctest.rst:835 msgid "" "The functions :func:`testmod` and :func:`testfile` provide a simple " "interface to doctest that should be sufficient for most basic uses. For a " @@ -1438,7 +1121,7 @@ msgstr "" "的でない入門が読みたければ、 :ref:`doctest-simple-testmod` 節や :ref:" "`doctest-simple-testfile` 節を参照してください。" -#: ../../library/doctest.rst:899 +#: ../../library/doctest.rst:843 msgid "" "All arguments except *filename* are optional, and should be specified in " "keyword form." @@ -1446,7 +1129,7 @@ msgstr "" "*filename* 以外の引数はすべてオプションで、キーワード引数形式で指定しなければ" "なりません。" -#: ../../library/doctest.rst:902 +#: ../../library/doctest.rst:846 msgid "" "Test examples in the file named *filename*. Return ``(failure_count, " "test_count)``." @@ -1454,7 +1137,7 @@ msgstr "" "*filename* に指定したファイル内にある実行例をテストします。``(failure_count, " "test_count)`` を返します。" -#: ../../library/doctest.rst:905 +#: ../../library/doctest.rst:849 msgid "" "Optional argument *module_relative* specifies how the filename should be " "interpreted:" @@ -1462,7 +1145,7 @@ msgstr "" "オプション引数の *module_relative* は、ファイル名をどのように解釈するかを指定" "します:" -#: ../../library/doctest.rst:908 +#: ../../library/doctest.rst:852 msgid "" "If *module_relative* is ``True`` (the default), then *filename* specifies an " "OS-independent module-relative path. By default, this path is relative to " @@ -1478,7 +1161,7 @@ msgstr "" "性を除くため、*filename* ではパスを分割する文字に ``/`` を使わなければなら" "ず、絶対パスにしてはなりません (パス文字列を ``/`` で始めてはなりません)。" -#: ../../library/doctest.rst:915 +#: ../../library/doctest.rst:859 msgid "" "If *module_relative* is ``False``, then *filename* specifies an OS-specific " "path. The path may be absolute or relative; relative paths are resolved " @@ -1488,7 +1171,7 @@ msgstr "" "す。パスは絶対パスでも相対パスでもかまいません; 相対パスにした場合、現在の作" "業ディレクトリを基準に解決します。" -#: ../../library/doctest.rst:919 +#: ../../library/doctest.rst:863 msgid "" "Optional argument *name* gives the name of the test; by default, or if " "``None``, ``os.path.basename(filename)`` is used." @@ -1496,7 +1179,7 @@ msgstr "" "オプション引数 *name* には、テストの名前を指定します; デフォルトの場合や " "``None`` を指定した場合、``os.path.basename(filename)`` になります。" -#: ../../library/doctest.rst:922 +#: ../../library/doctest.rst:866 msgid "" "Optional argument *package* is a Python package or the name of a Python " "package whose directory should be used as the base directory for a module-" @@ -1510,7 +1193,7 @@ msgstr "" "レクトリを相対の基準ディレクトリとして使います。*module_relative* を " "``False`` に指定している場合、*package* を指定するとエラーになります。" -#: ../../library/doctest.rst:928 +#: ../../library/doctest.rst:872 msgid "" "Optional argument *globs* gives a dict to be used as the globals when " "executing examples. A new shallow copy of this dict is created for the " @@ -1522,7 +1205,7 @@ msgstr "" "で、実行例は白紙の状態からスタートします。デフォルトの場合や ``None`` を指定" "した場合、新たな空の辞書になります。" -#: ../../library/doctest.rst:933 +#: ../../library/doctest.rst:877 msgid "" "Optional argument *extraglobs* gives a dict merged into the globals used to " "execute examples. This works like :meth:`dict.update`: if *globs* and " @@ -1544,14 +1227,17 @@ msgstr "" "いサブクラスへの対応付けを行う辞書を *extraglobs* に渡して、様々なサブクラス" "をテストできます。" -#: ../../library/doctest.rst:942 +#: ../../library/doctest.rst:886 msgid "" "Optional argument *verbose* prints lots of stuff if true, and prints only " "failures if false; by default, or if ``None``, it's true if and only if ``'-" -"v'`` is in :data:`sys.argv`." +"v'`` is in ``sys.argv``." msgstr "" +"オプション引数 *verbose* が真の場合、様々な情報を出力します。偽の場合にはテス" +"トの失敗だけを報告します。デフォルトの場合や ``None`` を指定した場合、``sys." +"argv`` に ``'-v'`` を指定しない限りこの値は真になりません。" -#: ../../library/doctest.rst:946 +#: ../../library/doctest.rst:890 msgid "" "Optional argument *report* prints a summary at the end when true, else " "prints nothing at the end. In verbose mode, the summary is detailed, else " @@ -1562,13 +1248,16 @@ msgstr "" "力しますが、そうでない場合にはサマリはとても簡潔になります (実際には、すべて" "のテストが成功した場合には何も出力しません)。" -#: ../../library/doctest.rst:950 +#: ../../library/doctest.rst:894 msgid "" -"Optional argument *optionflags* (default value ``0``) takes the :ref:" -"`bitwise OR ` of option flags. See section :ref:`doctest-options`." +"Optional argument *optionflags* (default value 0) takes the :ref:`bitwise OR " +"` of option flags. See section :ref:`doctest-options`." msgstr "" +"オプション引数 *optionflags* (デフォルト値 0) は、各オプションフラグの :ref:`" +"ビット単位論理和 ` を取ります。 :ref:`doctest-options` 節を参照して" +"ください。" -#: ../../library/doctest.rst:954 +#: ../../library/doctest.rst:898 msgid "" "Optional argument *raise_on_error* defaults to false. If true, an exception " "is raised upon the first failure or unexpected exception in an example. " @@ -1580,7 +1269,7 @@ msgstr "" "使うと、失敗の原因を検死デバッグ (post-mortem debug) できます。デフォルトの動" "作では、実行例の実行を継続します。" -#: ../../library/doctest.rst:959 ../../library/doctest.rst:1102 +#: ../../library/doctest.rst:903 ../../library/doctest.rst:1043 msgid "" "Optional argument *parser* specifies a :class:`DocTestParser` (or subclass) " "that should be used to extract tests from the files. It defaults to a " @@ -1590,7 +1279,7 @@ msgstr "" "を指定します。このクラスはファイルから実行例を抽出するために使われます。デ" "フォルトでは通常のパーザ (``DocTestParser()``) です。" -#: ../../library/doctest.rst:963 ../../library/doctest.rst:1106 +#: ../../library/doctest.rst:907 ../../library/doctest.rst:1047 msgid "" "Optional argument *encoding* specifies an encoding that should be used to " "convert the file to unicode." @@ -1598,7 +1287,7 @@ msgstr "" "オプション引数 *encoding* にはファイルをユニコードに変換する際に使われるエン" "コーディングを指定します。" -#: ../../library/doctest.rst:969 +#: ../../library/doctest.rst:913 msgid "" "All arguments are optional, and all except for *m* should be specified in " "keyword form." @@ -1606,7 +1295,7 @@ msgstr "" "引数はすべてオプションで、*m* 以外の引数はキーワード引数として指定しなければ" "なりません。" -#: ../../library/doctest.rst:972 +#: ../../library/doctest.rst:916 msgid "" "Test examples in docstrings in functions and classes reachable from module " "*m* (or module :mod:`__main__` if *m* is not supplied or is ``None``), " @@ -1616,25 +1305,30 @@ msgstr "" "から到達可能な関数およびクラスの docstring 内にある実行例をテストします。 " "``m.__doc__`` 内の実行例からテストを開始します。" -#: ../../library/doctest.rst:976 +#: ../../library/doctest.rst:920 msgid "" -"Also test examples reachable from dict ``m.__test__``, if it exists. ``m." -"__test__`` maps names (strings) to functions, classes and strings; function " -"and class docstrings are searched for examples; strings are searched " -"directly, as if they were docstrings." +"Also test examples reachable from dict ``m.__test__``, if it exists and is " +"not ``None``. ``m.__test__`` maps names (strings) to functions, classes and " +"strings; function and class docstrings are searched for examples; strings " +"are searched directly, as if they were docstrings." msgstr "" +"また、辞書 ``m.__test__`` が存在し、``None`` でない場合、この辞書から到達でき" +"る実行例もテストします。``m.__test__`` は、(文字列の) 名前から関数、クラスお" +"よび文字列への対応付けを行っています。関数およびクラスの場合には、その " +"docstring 内から実行例を検索します。文字列の場合には、docstring と同じように" +"して実行例の検索を直接実行します。" -#: ../../library/doctest.rst:981 +#: ../../library/doctest.rst:925 msgid "" "Only docstrings attached to objects belonging to module *m* are searched." msgstr "" "モジュール *m* に属するオブジェクトにつけられた docstring のみを検索します。" -#: ../../library/doctest.rst:983 +#: ../../library/doctest.rst:927 msgid "Return ``(failure_count, test_count)``." msgstr "``(failure_count, test_count)`` を返します。" -#: ../../library/doctest.rst:985 +#: ../../library/doctest.rst:929 msgid "" "Optional argument *name* gives the name of the module; by default, or if " "``None``, ``m.__name__`` is used." @@ -1642,18 +1336,24 @@ msgstr "" "オプション引数 *name* には、モジュールの名前を指定します。デフォルトの場合や " "``None`` を指定した場合には、``m.__name__`` を使います。" -#: ../../library/doctest.rst:988 +#: ../../library/doctest.rst:932 msgid "" "Optional argument *exclude_empty* defaults to false. If true, objects for " "which no doctests are found are excluded from consideration. The default is " "a backward compatibility hack, so that code still using :meth:`doctest." -"master.summarize ` in conjunction with :func:" -"`testmod` continues to get output for objects with no tests. The " -"*exclude_empty* argument to the newer :class:`DocTestFinder` constructor " -"defaults to true." -msgstr "" +"master.summarize` in conjunction with :func:`testmod` continues to get " +"output for objects with no tests. The *exclude_empty* argument to the newer :" +"class:`DocTestFinder` constructor defaults to true." +msgstr "" +"オプション引数 *exclude_empty* はデフォルトでは偽になっています。この値を真に" +"すると、doctest を持たないオブジェクトを考慮から外します。デフォルトの設定は" +"依存のバージョンとの互換性を考えたハックであり、 :meth:`doctest.master." +"summarize` と :func:`testmod` を合わせて利用しているようなコードでも、テスト" +"実行例を持たないオブジェクトから出力を得るようにしています。新たに追加され" +"た :class:`DocTestFinder` のコンストラクタの *exclude_empty* はデフォルトで真" +"になります。" -#: ../../library/doctest.rst:996 +#: ../../library/doctest.rst:939 msgid "" "Optional arguments *extraglobs*, *verbose*, *report*, *optionflags*, " "*raise_on_error*, and *globs* are the same as for function :func:`testfile` " @@ -1663,7 +1363,7 @@ msgstr "" "*raise_on_error*, および *globs* は上で説明した :func:`testfile` の引数と同じ" "です。ただし、 *globs* のデフォルト値は ``m.__dict__`` になります。" -#: ../../library/doctest.rst:1003 +#: ../../library/doctest.rst:946 msgid "" "Test examples associated with object *f*; for example, *f* may be a string, " "a module, a function, or a class object." @@ -1671,14 +1371,14 @@ msgstr "" "オブジェクト *f* に関連付けられた実行例をテストします。 *f* は文字列、モ" "ジュール、関数、またはクラスオブジェクトです。" -#: ../../library/doctest.rst:1006 +#: ../../library/doctest.rst:949 msgid "" "A shallow copy of dictionary argument *globs* is used for the execution " "context." msgstr "" "引数 *globs* に辞書を指定すると、その浅いコピーを実行コンテキストに使います。" -#: ../../library/doctest.rst:1008 +#: ../../library/doctest.rst:951 msgid "" "Optional argument *name* is used in failure messages, and defaults to " "``\"NoName\"``." @@ -1686,7 +1386,7 @@ msgstr "" "オプション引数 *name* はテスト失敗時のメッセージに使われます。デフォルトの値" "は ``'NoName'`` です。" -#: ../../library/doctest.rst:1011 +#: ../../library/doctest.rst:954 msgid "" "If optional argument *verbose* is true, output is generated even if there " "are no failures. By default, output is generated only in case of an example " @@ -1695,7 +1395,7 @@ msgstr "" "オプション引数 *verbose* の値を真にすると、テストが失敗しなくても出力を生成し" "ます。デフォルトでは、実行例のテストに失敗したときのみ出力を生成します。" -#: ../../library/doctest.rst:1014 +#: ../../library/doctest.rst:957 msgid "" "Optional argument *compileflags* gives the set of flags that should be used " "by the Python compiler when running the examples. By default, or if " @@ -1706,39 +1406,32 @@ msgstr "" "ドコンパイラが使うフラグを指定します。デフォルトの場合や ``None`` を指定した" "場合、フラグは *globs* 内にある future 機能セットに対応したものになります。" -#: ../../library/doctest.rst:1018 +#: ../../library/doctest.rst:961 msgid "" "Optional argument *optionflags* works as for function :func:`testfile` above." msgstr "" "オプション引数 *optionflags* は、上で述べた :func:`testfile` と同様の働きをし" "ます。" -#: ../../library/doctest.rst:1024 +#: ../../library/doctest.rst:967 msgid "Unittest API" msgstr "単体テスト API" -#: ../../library/doctest.rst:1026 +#: ../../library/doctest.rst:969 msgid "" "As your collection of doctest'ed modules grows, you'll want a way to run all " "their doctests systematically. :mod:`doctest` provides two functions that " "can be used to create :mod:`unittest` test suites from modules and text " "files containing doctests. To integrate with :mod:`unittest` test " -"discovery, include a :ref:`load_tests ` function in " -"your test module::" -msgstr "" - -#: ../../library/doctest.rst:1032 -msgid "" -"import unittest\n" -"import doctest\n" -"import my_module_with_doctests\n" -"\n" -"def load_tests(loader, tests, ignore):\n" -" tests.addTests(doctest.DocTestSuite(my_module_with_doctests))\n" -" return tests" +"discovery, include a :func:`load_tests` function in your test module::" msgstr "" +"doctest が付けられたモジュールが大きくなるにつれ、全ての doctest を組織的に実" +"行したくなるでしょう。 :mod:`doctest` モジュールは 2 つの関数を提供してい" +"て、 :mod:`unittest` のテストスイートを作り、 doctest を含んだテキストファイ" +"ルを作成するのに使えます。 :mod:`unittest` のテストディスカバリと組み合わせる" +"には、テストモジュールに :func:`load_tests` 関数を書いておいてください::" -#: ../../library/doctest.rst:1040 +#: ../../library/doctest.rst:983 msgid "" "There are two main functions for creating :class:`unittest.TestSuite` " "instances from text files and modules with doctests:" @@ -1746,7 +1439,7 @@ msgstr "" "doctest の入ったテキストファイルやモジュールから :class:`unittest.TestSuite` " "インスタンスを生成するための主な関数は二つあります:" -#: ../../library/doctest.rst:1046 +#: ../../library/doctest.rst:989 msgid "" "Convert doctest tests from one or more text files to a :class:`unittest." "TestSuite`." @@ -1754,28 +1447,31 @@ msgstr "" "単一または複数のテキストファイルに入っている doctest 形式のテストを、 :class:" "`unittest.TestSuite` インスタンスに変換します。" -#: ../../library/doctest.rst:1049 +#: ../../library/doctest.rst:992 msgid "" "The returned :class:`unittest.TestSuite` is to be run by the unittest " "framework and runs the interactive examples in each file. If an example in " -"any file fails, then the synthesized unit test fails, and a :exc:`~unittest." -"TestCase.failureException` exception is raised showing the name of the file " -"containing the test and a (sometimes approximate) line number. If all the " -"examples in a file are skipped, then the synthesized unit test is also " -"marked as skipped." +"any file fails, then the synthesized unit test fails, and a :exc:" +"`failureException` exception is raised showing the name of the file " +"containing the test and a (sometimes approximate) line number." msgstr "" +"この関数の返す :class:`unittest.TestSuite` インスタンスは、 unittest フレーム" +"ワークで動作させ、各ファイルの実行例を対話的に実行するためのものです。ファイ" +"ル内の何らかの実行例の実行に失敗すると、この関数で生成した単体テストは失敗" +"し、該当するテストの入っているファイルの名前と、 (場合によりだいたいの) 行番" +"号の入った :exc:`failureException` 例外を送出します。" -#: ../../library/doctest.rst:1056 +#: ../../library/doctest.rst:998 msgid "Pass one or more paths (as strings) to text files to be examined." msgstr "" "関数には、テストを行いたい一つまたは複数のファイルへのパスを (文字列で) 渡し" "ます。" -#: ../../library/doctest.rst:1058 +#: ../../library/doctest.rst:1000 msgid "Options may be provided as keyword arguments:" msgstr ":func:`DocFileSuite` には、キーワード引数でオプションを指定できます:" -#: ../../library/doctest.rst:1060 +#: ../../library/doctest.rst:1002 msgid "" "Optional argument *module_relative* specifies how the filenames in *paths* " "should be interpreted:" @@ -1783,7 +1479,7 @@ msgstr "" "オプション引数 *module_relative* は *paths* に指定したファイル名をどのように" "解釈するかを指定します:" -#: ../../library/doctest.rst:1063 +#: ../../library/doctest.rst:1005 msgid "" "If *module_relative* is ``True`` (the default), then each filename in " "*paths* specifies an OS-independent module-relative path. By default, this " @@ -1800,7 +1496,7 @@ msgstr "" "め、各ファイル名はパスを分割するのに ``/`` 文字を使わなければならず、絶対パス" "にしてはなりません (パス文字列を ``/`` で始めてはなりません)。" -#: ../../library/doctest.rst:1071 +#: ../../library/doctest.rst:1013 msgid "" "If *module_relative* is ``False``, then each filename in *paths* specifies " "an OS-specific path. The path may be absolute or relative; relative paths " @@ -1810,7 +1506,7 @@ msgstr "" "す。パスは絶対パスでも相対パスでもかまいません; 相対パスにした場合、現在の作" "業ディレクトリを基準に解決します。" -#: ../../library/doctest.rst:1075 +#: ../../library/doctest.rst:1017 msgid "" "Optional argument *package* is a Python package or the name of a Python " "package whose directory should be used as the base directory for module-" @@ -1825,24 +1521,31 @@ msgstr "" "レクトリを相対の基準ディレクトリとして使います。*module_relative* を " "``False`` に指定している場合、*package* を指定するとエラーになります。" -#: ../../library/doctest.rst:1082 +#: ../../library/doctest.rst:1024 msgid "" "Optional argument *setUp* specifies a set-up function for the test suite. " "This is called before running the tests in each file. The *setUp* function " -"will be passed a :class:`DocTest` object. The *setUp* function can access " -"the test globals as the :attr:`~DocTest.globs` attribute of the test passed." +"will be passed a :class:`DocTest` object. The setUp function can access the " +"test globals as the *globs* attribute of the test passed." msgstr "" +"オプション引数 *setUp* には、テストスイートのセットアップに使う関数を指定しま" +"す。この関数は、各ファイルのテストを実行する前に呼び出されます。 *setUp* 関数" +"は :class:`DocTest` オブジェクトに引き渡されます。 *setUp* は *globs* 属性を" +"介してテストのグローバル変数にアクセスできます。" -#: ../../library/doctest.rst:1087 +#: ../../library/doctest.rst:1029 msgid "" "Optional argument *tearDown* specifies a tear-down function for the test " "suite. This is called after running the tests in each file. The *tearDown* " -"function will be passed a :class:`DocTest` object. The *tearDown* function " -"can access the test globals as the :attr:`~DocTest.globs` attribute of the " -"test passed." +"function will be passed a :class:`DocTest` object. The setUp function can " +"access the test globals as the *globs* attribute of the test passed." msgstr "" +"オプション引数 *tearDown* には、テストを解体 (tear-down) するための関数を指定" +"します。この関数は、各ファイルのテストの実行を終了するたびに呼び出されます。 " +"*tearDown* 関数は :class:`DocTest` オブジェクトに引き渡されます。 " +"*tearDown* は *globs* 属性を介してテストのグローバル変数にアクセスできます。" -#: ../../library/doctest.rst:1093 +#: ../../library/doctest.rst:1034 ../../library/doctest.rst:1068 msgid "" "Optional argument *globs* is a dictionary containing the initial global " "variables for the tests. A new copy of this dictionary is created for each " @@ -1852,7 +1555,7 @@ msgstr "" "の辞書は各テストごとに新たにコピーして使われます。デフォルトでは *globs* は空" "の新たな辞書です。" -#: ../../library/doctest.rst:1097 +#: ../../library/doctest.rst:1038 msgid "" "Optional argument *optionflags* specifies the default doctest options for " "the tests, created by or-ing together individual option flags. See section :" @@ -1864,7 +1567,7 @@ msgstr "" "参照してください。結果レポートに関するオプションを指定するより適切な方法は下" "記の :func:`set_unittest_reportflags` の説明を参照してください。" -#: ../../library/doctest.rst:1109 +#: ../../library/doctest.rst:1050 msgid "" "The global ``__file__`` is added to the globals provided to doctests loaded " "from a text file using :func:`DocFileSuite`." @@ -1872,22 +1575,25 @@ msgstr "" ":func:`DocFileSuite` を使用してテキストファイルからロードされた doctests に提" "供される globals に、グローバル変数 ``__file__`` が追加されます。" -#: ../../library/doctest.rst:1115 +#: ../../library/doctest.rst:1056 msgid "Convert doctest tests for a module to a :class:`unittest.TestSuite`." msgstr "doctest のテストを :class:`unittest.TestSuite` に変換します。" -#: ../../library/doctest.rst:1117 +#: ../../library/doctest.rst:1058 msgid "" "The returned :class:`unittest.TestSuite` is to be run by the unittest " -"framework and runs each doctest in the module. Each docstring is run as a " -"separate unit test. If any of the doctests fail, then the synthesized unit " -"test fails, and a :exc:`unittest.TestCase.failureException` exception is " -"raised showing the name of the file containing the test and a (sometimes " -"approximate) line number. If all the examples in a docstring are skipped, " -"then the" +"framework and runs each doctest in the module. If any of the doctests fail, " +"then the synthesized unit test fails, and a :exc:`failureException` " +"exception is raised showing the name of the file containing the test and a " +"(sometimes approximate) line number." msgstr "" +"この関数の返す :class:`unittest.TestSuite` インスタンスは、 unittest フレーム" +"ワークで動作させ、モジュール内の各 doctest を実行するためのものです。何らか" +"の doctest の実行に失敗すると、この関数で生成した単体テストは失敗し、該当する" +"テストの入っているファイルの名前と、 (場合によりだいたいの) 行番号の入った :" +"exc:`failureException` 例外を送出します。" -#: ../../library/doctest.rst:1125 +#: ../../library/doctest.rst:1064 msgid "" "Optional argument *module* provides the module to be tested. It can be a " "module object or a (possibly dotted) module name. If not specified, the " @@ -1898,14 +1604,7 @@ msgstr "" "きます。*module* を指定しない場合、この関数を呼び出しているモジュールになりま" "す。" -#: ../../library/doctest.rst:1129 -msgid "" -"Optional argument *globs* is a dictionary containing the initial global " -"variables for the tests. A new copy of this dictionary is created for each " -"test. By default, *globs* is the module's :attr:`~module.__dict__`." -msgstr "" - -#: ../../library/doctest.rst:1133 +#: ../../library/doctest.rst:1072 msgid "" "Optional argument *extraglobs* specifies an extra set of global variables, " "which is merged into *globs*. By default, no extra globals are used." @@ -1914,7 +1613,7 @@ msgstr "" "変数セットは *globs* に統合されます。デフォルトでは、追加のグローバル変数はあ" "りません。" -#: ../../library/doctest.rst:1136 +#: ../../library/doctest.rst:1075 msgid "" "Optional argument *test_finder* is the :class:`DocTestFinder` object (or a " "drop-in replacement) that is used to extract doctests from the module." @@ -1922,18 +1621,19 @@ msgstr "" "オプション引数 *test_finder* は、モジュールから doctest を抽出するための :" "class:`DocTestFinder` オブジェクト (またはその代替となるオブジェクト) です。" -#: ../../library/doctest.rst:1139 +#: ../../library/doctest.rst:1078 msgid "" "Optional arguments *setUp*, *tearDown*, and *optionflags* are the same as " -"for function :func:`DocFileSuite` above, but they are called for each " -"docstring." +"for function :func:`DocFileSuite` above." msgstr "" +"オプション引数 *setUp* 、 *tearDown* 、および *optionflags* は上の :func:" +"`DocFileSuite` と同じです。" -#: ../../library/doctest.rst:1142 +#: ../../library/doctest.rst:1081 msgid "This function uses the same search technique as :func:`testmod`." msgstr "この関数は :func:`testmod` と同じ検索方法を使います。" -#: ../../library/doctest.rst:1144 +#: ../../library/doctest.rst:1083 msgid "" ":func:`DocTestSuite` returns an empty :class:`unittest.TestSuite` if " "*module* contains no docstrings instead of raising :exc:`ValueError`." @@ -1942,46 +1642,67 @@ msgstr "" "`DocTestSuite` は :exc:`ValueError` を送出するのではなく空の :class:" "`unittest.TestSuite` を返します。" -#: ../../library/doctest.rst:1148 +#: ../../library/doctest.rst:1088 msgid "" "Under the covers, :func:`DocTestSuite` creates a :class:`unittest.TestSuite` " -"out of :class:`!doctest.DocTestCase` instances, and :class:`!DocTestCase` is " -"a subclass of :class:`unittest.TestCase`. :class:`!DocTestCase` isn't " +"out of :class:`doctest.DocTestCase` instances, and :class:`DocTestCase` is a " +"subclass of :class:`unittest.TestCase`. :class:`DocTestCase` isn't " "documented here (it's an internal detail), but studying its code can answer " "questions about the exact details of :mod:`unittest` integration." msgstr "" +"裏側では :func:`DocTestSuite` は :class:`doctest.DocTestCase` インスタンスか" +"ら :class:`unittest.TestSuite` を作成しており、 :class:`DocTestCase` は :" +"class:`unittest.TestCase` のサブクラスになっています。 :class:`DocTestCase` " +"についてはここでは説明しません (これは内部実装上の詳細だからです) が、その" +"コードを調べてみれば、 :mod:`unittest` の組み込みの詳細に関する疑問を解決でき" +"るはずです。" -#: ../../library/doctest.rst:1154 +#: ../../library/doctest.rst:1094 msgid "" "Similarly, :func:`DocFileSuite` creates a :class:`unittest.TestSuite` out " -"of :class:`!doctest.DocFileCase` instances, and :class:`!DocFileCase` is a " -"subclass of :class:`!DocTestCase`." +"of :class:`doctest.DocFileCase` instances, and :class:`DocFileCase` is a " +"subclass of :class:`DocTestCase`." msgstr "" +"同様に、 :func:`DocFileSuite` は :class:`doctest.DocFileCase` インスタンスか" +"ら :class:`unittest.TestSuite` を作成し、 :class:`DocFileCase` は :class:" +"`DocTestCase` のサブクラスになっています。" -#: ../../library/doctest.rst:1158 +#: ../../library/doctest.rst:1098 msgid "" "So both ways of creating a :class:`unittest.TestSuite` run instances of :" -"class:`!DocTestCase`. This is important for a subtle reason: when you run :" -"mod:`doctest` functions yourself, you can control the :mod:`!doctest` " -"options in use directly, by passing option flags to :mod:`!doctest` " -"functions. However, if you're writing a :mod:`unittest` framework, :mod:`!" -"unittest` ultimately controls when and how tests get run. The framework " -"author typically wants to control :mod:`!doctest` reporting options " -"(perhaps, e.g., specified by command line options), but there's no way to " -"pass options through :mod:`!unittest` to :mod:`!doctest` test runners." -msgstr "" +"class:`DocTestCase`. This is important for a subtle reason: when you run :" +"mod:`doctest` functions yourself, you can control the :mod:`doctest` options " +"in use directly, by passing option flags to :mod:`doctest` functions. " +"However, if you're writing a :mod:`unittest` framework, :mod:`unittest` " +"ultimately controls when and how tests get run. The framework author " +"typically wants to control :mod:`doctest` reporting options (perhaps, e.g., " +"specified by command line options), but there's no way to pass options " +"through :mod:`unittest` to :mod:`doctest` test runners." +msgstr "" +"そのため、 :class:`unittest.TestSuite` クラスを生成するどちらの方法も :class:" +"`DocTestCase` のインスタンスを実行します。これは次のような微妙な理由で重要で" +"す: :mod:`doctest` 関数を自分で実行する場合、オプションフラグを :mod:" +"`doctest` 関数に渡すことで、 :mod:`doctest` のオプションを直接操作できます。" +"しかしながら、 :mod:`unittest` フレームワークを書いている場合には、いつどのよ" +"うにテストを動作させるかを :mod:`unittest` が完全に制御してしまいます。フレー" +"ムワークの作者はたいてい、 :mod:`doctest` のレポートオプションを (コマンドラ" +"インオプションで指定するなどして) 操作したいと考えますが、 :mod:`unittest` を" +"介して :mod:`doctest` のテストランナーにオプションを渡す方法は存在しないので" +"す。" -#: ../../library/doctest.rst:1168 +#: ../../library/doctest.rst:1108 msgid "" -"For this reason, :mod:`doctest` also supports a notion of :mod:`!doctest` " +"For this reason, :mod:`doctest` also supports a notion of :mod:`doctest` " "reporting flags specific to :mod:`unittest` support, via this function:" msgstr "" +"このため、 :mod:`doctest` では、以下の関数を使って、 :mod:`unittest` サポート" +"に特化したレポートフラグ表記方法もサポートしています:" -#: ../../library/doctest.rst:1174 +#: ../../library/doctest.rst:1114 msgid "Set the :mod:`doctest` reporting flags to use." msgstr ":mod:`doctest` のレポートフラグをセットします。" -#: ../../library/doctest.rst:1176 +#: ../../library/doctest.rst:1116 msgid "" "Argument *flags* takes the :ref:`bitwise OR ` of option flags. See " "section :ref:`doctest-options`. Only \"reporting flags\" can be used." @@ -1990,21 +1711,31 @@ msgstr "" "す。 :ref:`doctest-options` 節を参照してください。「レポートフラグ」しか使え" "ません。" -#: ../../library/doctest.rst:1179 +#: ../../library/doctest.rst:1119 msgid "" "This is a module-global setting, and affects all future doctests run by " -"module :mod:`unittest`: the :meth:`!runTest` method of :class:`!" -"DocTestCase` looks at the option flags specified for the test case when the :" -"class:`!DocTestCase` instance was constructed. If no reporting flags were " -"specified (which is the typical and expected case), :mod:`!doctest`'s :mod:`!" -"unittest` reporting flags are :ref:`bitwise ORed ` into the option " +"module :mod:`unittest`: the :meth:`runTest` method of :class:`DocTestCase` " +"looks at the option flags specified for the test case when the :class:" +"`DocTestCase` instance was constructed. If no reporting flags were " +"specified (which is the typical and expected case), :mod:`doctest`'s :mod:" +"`unittest` reporting flags are :ref:`bitwise ORed ` into the option " "flags, and the option flags so augmented are passed to the :class:" "`DocTestRunner` instance created to run the doctest. If any reporting flags " -"were specified when the :class:`!DocTestCase` instance was constructed, :mod:" -"`!doctest`'s :mod:`!unittest` reporting flags are ignored." -msgstr "" - -#: ../../library/doctest.rst:1190 +"were specified when the :class:`DocTestCase` instance was constructed, :mod:" +"`doctest`'s :mod:`unittest` reporting flags are ignored." +msgstr "" +"この関数で設定した内容はモジュール全体にわたるものであり、関数呼び出し以後" +"に :mod:`unittest` モジュールから実行されるすべての doctest に影響します: :" +"class:`DocTestCase` の :meth:`runTest` メソッドは、 :class:`DocTestCase` イン" +"スタンスが作成された際に、現在のテストケースに指定されたオプションフラグを見" +"に行きます。レポートフラグが指定されていない場合 (通常の場合で、望ましいケー" +"スです)、 :mod:`doctest` の :mod:`unittest` レポートフラグが :ref:`bit ごと" +"の OR ` で結合され、doctest を実行するために作成される :class:" +"`DocTestRunner` インスタンスに渡されます。 :class:`DocTestCase` インスタンス" +"を構築する際に何らかのレポートフラグが指定されていた場合、 :mod:`doctest` " +"の :mod:`unittest` レポートフラグは無視されます。" + +#: ../../library/doctest.rst:1130 msgid "" "The value of the :mod:`unittest` reporting flags in effect before the " "function was called is returned by the function." @@ -2012,11 +1743,11 @@ msgstr "" "この関数は、関数を呼び出す前に有効になっていた :mod:`unittest` レポートフラグ" "の値を返します。" -#: ../../library/doctest.rst:1197 +#: ../../library/doctest.rst:1137 msgid "Advanced API" msgstr "拡張 API" -#: ../../library/doctest.rst:1199 +#: ../../library/doctest.rst:1139 msgid "" "The basic API is a simple wrapper that's intended to make doctest easy to " "use. It is fairly flexible, and should meet most users' needs; however, if " @@ -2028,7 +1759,7 @@ msgstr "" "御したい場合や、doctest の機能を拡張したい場合、拡張 API (advanced API) を使" "わなければなりません。" -#: ../../library/doctest.rst:1204 +#: ../../library/doctest.rst:1144 msgid "" "The advanced API revolves around two container classes, which are used to " "store the interactive examples extracted from doctest cases:" @@ -2036,7 +1767,7 @@ msgstr "" "拡張 API は、doctest ケースから抽出した対話モードでの実行例を記憶するための二" "つのコンテナクラスを中心に構成されています:" -#: ../../library/doctest.rst:1207 +#: ../../library/doctest.rst:1147 msgid "" ":class:`Example`: A single Python :term:`statement`, paired with its " "expected output." @@ -2044,7 +1775,7 @@ msgstr "" ":class:`Example`: 1つの Python :term:`文 ` と、その期待する出力を" "ペアにしたもの。" -#: ../../library/doctest.rst:1210 +#: ../../library/doctest.rst:1150 msgid "" ":class:`DocTest`: A collection of :class:`Example`\\ s, typically extracted " "from a single docstring or text file." @@ -2052,7 +1783,7 @@ msgstr "" ":class:`DocTest`: :class:`Example` の集まり。通常一つの docstring やテキスト" "ファイルから抽出されます。" -#: ../../library/doctest.rst:1213 +#: ../../library/doctest.rst:1153 msgid "" "Additional processing classes are defined to find, parse, and run, and check " "doctest examples:" @@ -2060,7 +1791,7 @@ msgstr "" "その他に、doctest の実行例を検索、構文解析、実行、チェックするための処理クラ" "スが以下のように定義されています:" -#: ../../library/doctest.rst:1216 +#: ../../library/doctest.rst:1156 msgid "" ":class:`DocTestFinder`: Finds all docstrings in a given module, and uses a :" "class:`DocTestParser` to create a :class:`DocTest` from every docstring that " @@ -2070,7 +1801,7 @@ msgstr "" "し、 :class:`DocTestParser` を使って対話モードでの実行例が入ったすべての " "docstring から :class:`DocTest` を生成します。" -#: ../../library/doctest.rst:1220 +#: ../../library/doctest.rst:1160 msgid "" ":class:`DocTestParser`: Creates a :class:`DocTest` object from a string " "(such as an object's docstring)." @@ -2078,7 +1809,7 @@ msgstr "" ":class:`DocTestParser`: (オブジェクトの docstring 等の) 文字列から :class:" "`DocTest` オブジェクトを生成します。" -#: ../../library/doctest.rst:1223 +#: ../../library/doctest.rst:1163 msgid "" ":class:`DocTestRunner`: Executes the examples in a :class:`DocTest`, and " "uses an :class:`OutputChecker` to verify their output." @@ -2086,7 +1817,7 @@ msgstr "" ":class:`DocTestRunner`: :class:`DocTest` 内の実行例を実行し、 :class:" "`OutputChecker` を使って出力を検証します。" -#: ../../library/doctest.rst:1226 +#: ../../library/doctest.rst:1166 msgid "" ":class:`OutputChecker`: Compares the actual output from a doctest example " "with the expected output, and decides whether they match." @@ -2094,29 +1825,17 @@ msgstr "" ":class:`OutputChecker`: doctest 実行例から実際に出力された結果を期待する出力" "と比較し、両者が一致するか判別します。" -#: ../../library/doctest.rst:1229 +#: ../../library/doctest.rst:1169 msgid "" "The relationships among these processing classes are summarized in the " "following diagram::" msgstr "これらの処理クラスの関係を図にまとめると、以下のようになります::" -#: ../../library/doctest.rst:1232 -msgid "" -" list of:\n" -"+------+ +---------+\n" -"|module| --DocTestFinder-> | DocTest | --DocTestRunner-> results\n" -"+------+ | ^ +---------+ | ^ (printed)\n" -" | | | Example | | |\n" -" v | | ... | v |\n" -" DocTestParser | Example | OutputChecker\n" -" +---------+" -msgstr "" - -#: ../../library/doctest.rst:1245 +#: ../../library/doctest.rst:1185 msgid "DocTest Objects" msgstr "DocTest オブジェクト" -#: ../../library/doctest.rst:1250 +#: ../../library/doctest.rst:1190 msgid "" "A collection of doctest examples that should be run in a single namespace. " "The constructor arguments are used to initialize the attributes of the same " @@ -2125,7 +1844,7 @@ msgstr "" "単一の名前空間内で実行される doctest 実行例の集まりです。コンストラクタの引数" "は :class:`DocTest` インスタンス中の同名の属性の初期化に使われます。" -#: ../../library/doctest.rst:1254 +#: ../../library/doctest.rst:1194 msgid "" ":class:`DocTest` defines the following attributes. They are initialized by " "the constructor, and should not be modified directly." @@ -2133,7 +1852,7 @@ msgstr "" ":class:`DocTest` では、以下の属性を定義しています。これらの変数はコンストラク" "タで初期化されます。直接変更してはなりません。" -#: ../../library/doctest.rst:1260 +#: ../../library/doctest.rst:1200 msgid "" "A list of :class:`Example` objects encoding the individual interactive " "Python examples that should be run by this test." @@ -2141,7 +1860,7 @@ msgstr "" "対話モードにおける実行例それぞれをエンコードしていて、テストで実行される、 :" "class:`Example` オブジェクトからなるリストです。" -#: ../../library/doctest.rst:1266 +#: ../../library/doctest.rst:1206 msgid "" "The namespace (aka globals) that the examples should be run in. This is a " "dictionary mapping names to values. Any changes to the namespace made by " @@ -2153,7 +1872,7 @@ msgstr "" "束縛するなど) 何らかの変更を行った場合、 :attr:`globs` への反映はテストの実行" "後に起こります。" -#: ../../library/doctest.rst:1274 +#: ../../library/doctest.rst:1214 msgid "" "A string name identifying the :class:`DocTest`. Typically, this is the name " "of the object or file that the test was extracted from." @@ -2161,14 +1880,17 @@ msgstr "" ":class:`DocTest` を識別する名前の文字列です。通常、この値はテストを取り出した" "オブジェクトかファイルの名前になります。" -#: ../../library/doctest.rst:1280 +#: ../../library/doctest.rst:1220 msgid "" "The name of the file that this :class:`DocTest` was extracted from; or " -"``None`` if the filename is unknown, or if the :class:`!DocTest` was not " +"``None`` if the filename is unknown, or if the :class:`DocTest` was not " "extracted from a file." msgstr "" +":class:`DocTest` を取り出したファイルの名前です; ファイル名が未知の場合や :" +"class:`DocTest` をファイルから取り出したのでない場合には ``None`` になりま" +"す。" -#: ../../library/doctest.rst:1287 +#: ../../library/doctest.rst:1227 msgid "" "The line number within :attr:`filename` where this :class:`DocTest` begins, " "or ``None`` if the line number is unavailable. This line number is zero-" @@ -2178,7 +1900,7 @@ msgstr "" "で、行番号が利用できなければ ``None`` です。行番号は、ファイルの先頭を 0 とし" "て数えます。" -#: ../../library/doctest.rst:1294 +#: ../../library/doctest.rst:1234 msgid "" "The string that the test was extracted from, or ``None`` if the string is " "unavailable, or if the test was not extracted from a string." @@ -2187,11 +1909,11 @@ msgstr "" "い場合や、文字列からテスト実行例を取り出したのでない場合には ``None`` になり" "ます。" -#: ../../library/doctest.rst:1301 +#: ../../library/doctest.rst:1241 msgid "Example Objects" msgstr "Example オブジェクト" -#: ../../library/doctest.rst:1306 +#: ../../library/doctest.rst:1246 msgid "" "A single interactive example, consisting of a Python statement and its " "expected output. The constructor arguments are used to initialize the " @@ -2201,7 +1923,7 @@ msgstr "" "実行例です。コンストラクタの引数は :class:`Example` インスタンス中の同名の属" "性の初期化に使われます。" -#: ../../library/doctest.rst:1311 +#: ../../library/doctest.rst:1251 msgid "" ":class:`Example` defines the following attributes. They are initialized by " "the constructor, and should not be modified directly." @@ -2209,7 +1931,7 @@ msgstr "" ":class:`Example` では、以下の属性を定義しています。これらの変数はコンストラク" "タで初期化されます。直接変更してはなりません。" -#: ../../library/doctest.rst:1317 +#: ../../library/doctest.rst:1257 msgid "" "A string containing the example's source code. This source code consists of " "a single Python statement, and always ends with a newline; the constructor " @@ -2218,7 +1940,7 @@ msgstr "" "実行例のソースコードが入った文字列です。ソースコードは単一の Python で、末尾" "は常に改行です。コンストラクタは必要に応じて改行を追加します。" -#: ../../library/doctest.rst:1324 +#: ../../library/doctest.rst:1264 msgid "" "The expected output from running the example's source code (either from " "stdout, or a traceback in case of exception). :attr:`want` ends with a " @@ -2230,7 +1952,7 @@ msgstr "" "場合を除いて常に改行になります。期待する出力がない場合には空文字列になりま" "す。コンストラクタは必要に応じて改行を追加します。" -#: ../../library/doctest.rst:1332 +#: ../../library/doctest.rst:1272 msgid "" "The exception message generated by the example, if the example is expected " "to generate an exception; or ``None`` if it is not expected to generate an " @@ -2244,7 +1966,7 @@ msgstr "" "attr:`exc_msg` は改行で終わっていなければなりません; コンストラクタは必要に応" "じて改行を追加します。" -#: ../../library/doctest.rst:1341 +#: ../../library/doctest.rst:1281 msgid "" "The line number within the string containing this example where the example " "begins. This line number is zero-based with respect to the beginning of the " @@ -2253,7 +1975,7 @@ msgstr "" "この実行例を含む文字列における実行例が始まる行番号です。行番号は文字列の先頭" "を 0 として数えます。" -#: ../../library/doctest.rst:1348 +#: ../../library/doctest.rst:1288 msgid "" "The example's indentation in the containing string, i.e., the number of " "space characters that precede the example's first prompt." @@ -2261,20 +1983,24 @@ msgstr "" "実行例の入っている文字列のインデント、すなわち実行例の最初のプロンプトより前" "にある空白文字の数です。" -#: ../../library/doctest.rst:1354 +#: ../../library/doctest.rst:1294 msgid "" "A dictionary mapping from option flags to ``True`` or ``False``, which is " "used to override default options for this example. Any option flags not " "contained in this dictionary are left at their default value (as specified " -"by the :class:`DocTestRunner`'s :ref:`optionflags `). By " -"default, no options are set." +"by the :class:`DocTestRunner`'s :attr:`optionflags`). By default, no options " +"are set." msgstr "" +"オプションフラグを ``True`` または ``False`` に対応付けている辞書です。実行例" +"に対するデフォルトオプションを上書きするために用いられます。この辞書に入って" +"いないオプションフラグはデフォルトの状態 (:class:`DocTestRunner` の :attr:" +"`optionflags` の内容) のままになります。" -#: ../../library/doctest.rst:1364 +#: ../../library/doctest.rst:1303 msgid "DocTestFinder objects" msgstr "DocTestFinder オブジェクト" -#: ../../library/doctest.rst:1369 +#: ../../library/doctest.rst:1308 msgid "" "A processing class used to extract the :class:`DocTest`\\ s that are " "relevant to a given object, from its docstring and the docstrings of its " @@ -2286,7 +2012,7 @@ msgstr "" "理クラスです。モジュール、クラス、関数、メソッド、静的メソッド、クラスメソッ" "ド、プロパティから :class:`DocTest` を抽出できます。" -#: ../../library/doctest.rst:1374 +#: ../../library/doctest.rst:1313 msgid "" "The optional argument *verbose* can be used to display the objects searched " "by the finder. It defaults to ``False`` (no output)." @@ -2294,7 +2020,7 @@ msgstr "" "オプション引数 *verbose* を使うと、抽出処理の対象となるオブジェクトを表示でき" "ます。デフォルトは ``False`` (出力を行わない) です。" -#: ../../library/doctest.rst:1377 +#: ../../library/doctest.rst:1316 msgid "" "The optional argument *parser* specifies the :class:`DocTestParser` object " "(or a drop-in replacement) that is used to extract doctests from docstrings." @@ -2303,7 +2029,7 @@ msgstr "" "使う :class:`DocTestParser` オブジェクト (またはその代替となるオブジェクト) " "を指定します。" -#: ../../library/doctest.rst:1380 +#: ../../library/doctest.rst:1319 msgid "" "If the optional argument *recurse* is false, then :meth:`DocTestFinder.find` " "will only examine the given object, and not any contained objects." @@ -2312,7 +2038,7 @@ msgstr "" "オブジェクトだけを調べ、そのオブジェクトに含まれる他のオブジェクトを調べませ" "ん。" -#: ../../library/doctest.rst:1383 +#: ../../library/doctest.rst:1322 msgid "" "If the optional argument *exclude_empty* is false, then :meth:`DocTestFinder." "find` will include tests for objects with empty docstrings." @@ -2320,11 +2046,11 @@ msgstr "" "オプション引数 *exclude_empty* が偽の場合、 :meth:`DocTestFinder.find` は空" "の docstring を持つオブジェクトもテスト対象に含めます。" -#: ../../library/doctest.rst:1387 +#: ../../library/doctest.rst:1326 msgid ":class:`DocTestFinder` defines the following method:" msgstr ":class:`DocTestFinder` では以下のメソッドを定義しています:" -#: ../../library/doctest.rst:1392 +#: ../../library/doctest.rst:1331 msgid "" "Return a list of the :class:`DocTest`\\ s that are defined by *obj*'s " "docstring, or by any of its contained objects' docstrings." @@ -2332,7 +2058,7 @@ msgstr "" "*obj* または *obj* 内に入っているオブジェクトの docstring 中で定義されてい" "る :class:`DocTest` のリストを返します。" -#: ../../library/doctest.rst:1395 +#: ../../library/doctest.rst:1334 msgid "" "The optional argument *name* specifies the object's name; this name will be " "used to construct names for the returned :class:`DocTest`\\ s. If *name* is " @@ -2342,7 +2068,7 @@ msgstr "" "が返す :class:`DocTest` の名前になります。 *name* を指定しない場合、 ``obj." "__name__`` を使います。" -#: ../../library/doctest.rst:1399 +#: ../../library/doctest.rst:1338 msgid "" "The optional parameter *module* is the module that contains the given " "object. If the module is not specified or is ``None``, then the test finder " @@ -2355,13 +2081,13 @@ msgstr "" "的に決定しようと試みます。\n" "オブジェクトのモジュールは以下のような役割を果たします:" -#: ../../library/doctest.rst:1403 +#: ../../library/doctest.rst:1342 msgid "As a default namespace, if *globs* is not specified." msgstr "" "*globs* を指定していない場合、オブジェクトのモジュールはデフォルトの名前空間" "になります。" -#: ../../library/doctest.rst:1405 +#: ../../library/doctest.rst:1344 msgid "" "To prevent the DocTestFinder from extracting DocTests from objects that are " "imported from other modules. (Contained objects with modules other than " @@ -2371,15 +2097,15 @@ msgstr "" "が :class:`DocTest` を抽出するのを避けるために使います。 (*module* 由来でない" "オブジェクトを無視します。)" -#: ../../library/doctest.rst:1409 +#: ../../library/doctest.rst:1348 msgid "To find the name of the file containing the object." msgstr "オブジェクトの入っているファイル名を調べるために使います。" -#: ../../library/doctest.rst:1411 +#: ../../library/doctest.rst:1350 msgid "To help find the line number of the object within its file." msgstr "オブジェクトがファイル内の何行目にあるかを調べる手助けにします。" -#: ../../library/doctest.rst:1413 +#: ../../library/doctest.rst:1352 msgid "" "If *module* is ``False``, no attempt to find the module will be made. This " "is obscure, of use mostly in testing doctest itself: if *module* is " @@ -2394,21 +2120,28 @@ msgstr "" "属するとみなされ、そのオブジェクト内のすべてのオブジェクトに対して (再帰的" "に) doctest の検索を行います。" -#: ../../library/doctest.rst:1419 +#: ../../library/doctest.rst:1358 msgid "" "The globals for each :class:`DocTest` is formed by combining *globs* and " "*extraglobs* (bindings in *extraglobs* override bindings in *globs*). A new " -"shallow copy of the globals dictionary is created for each :class:`!" -"DocTest`. If *globs* is not specified, then it defaults to the module's :" -"attr:`~module.__dict__`, if specified, or ``{}`` otherwise. If *extraglobs* " -"is not specified, then it defaults to ``{}``." -msgstr "" +"shallow copy of the globals dictionary is created for each :class:`DocTest`. " +"If *globs* is not specified, then it defaults to the module's *__dict__*, if " +"specified, or ``{}`` otherwise. If *extraglobs* is not specified, then it " +"defaults to ``{}``." +msgstr "" +"各 :class:`DocTest` のグローバル変数は、 *globs* と *extraglobs* を合わせたも" +"の (*extraglobs* 内の束縛が *globs* 内の束縛を上書きする) になります。各々" +"の :class:`DocTest` に対して、グローバル変数を表す辞書の新たな浅いコピーを生" +"成します。 *globs* を指定しない場合に使われるのデフォルト値は、モジュールを指" +"定していればそのモジュールの *__dict__* になり、指定していなければ ``{}`` に" +"なります。 *extraglobs* を指定しない場合、デフォルトの値は ``{}`` になりま" +"す。" -#: ../../library/doctest.rst:1430 +#: ../../library/doctest.rst:1369 msgid "DocTestParser objects" msgstr "DocTestParser オブジェクト" -#: ../../library/doctest.rst:1435 +#: ../../library/doctest.rst:1374 msgid "" "A processing class used to extract interactive examples from a string, and " "use them to create a :class:`DocTest` object." @@ -2416,11 +2149,11 @@ msgstr "" "対話モードの実行例を文字列から抽出し、それを使って :class:`DocTest` オブジェ" "クトを生成するために使われる処理クラスです。" -#: ../../library/doctest.rst:1439 +#: ../../library/doctest.rst:1378 ../../library/doctest.rst:1446 msgid ":class:`DocTestParser` defines the following methods:" msgstr ":class:`DocTestParser` では以下のメソッドを定義しています:" -#: ../../library/doctest.rst:1444 +#: ../../library/doctest.rst:1383 msgid "" "Extract all doctest examples from the given string, and collect them into a :" "class:`DocTest` object." @@ -2428,14 +2161,17 @@ msgstr "" "指定した文字列からすべての doctest 実行例を抽出し、 :class:`DocTest` オブジェ" "クト内に集めます。" -#: ../../library/doctest.rst:1447 +#: ../../library/doctest.rst:1386 msgid "" "*globs*, *name*, *filename*, and *lineno* are attributes for the new :class:" -"`!DocTest` object. See the documentation for :class:`DocTest` for more " +"`DocTest` object. See the documentation for :class:`DocTest` for more " "information." msgstr "" +"*globs*, *name*, *filename*, および *lineno* は新たに作成される :class:" +"`DocTest` オブジェクトの属性になります。詳しくは :class:`DocTest` のドキュメ" +"ントを参照してください。" -#: ../../library/doctest.rst:1454 +#: ../../library/doctest.rst:1393 msgid "" "Extract all doctest examples from the given string, and return them as a " "list of :class:`Example` objects. Line numbers are 0-based. The optional " @@ -2447,35 +2183,23 @@ msgstr "" "す。オプション引数 *name* はこの文字列につける名前で、エラーメッセージにしか" "使われません。" -#: ../../library/doctest.rst:1461 +#: ../../library/doctest.rst:1400 msgid "" "Divide the given string into examples and intervening text, and return them " "as a list of alternating :class:`Example`\\ s and strings. Line numbers for " -"the :class:`!Example`\\ s are 0-based. The optional argument *name* is a " +"the :class:`Example`\\ s are 0-based. The optional argument *name* is a " "name identifying this string, and is only used for error messages." msgstr "" +"指定した文字列を、実行例とその間のテキストに分割し、実行例を :class:" +"`Example` オブジェクトに変換し、 :class:`Example` と文字列からなるリストにし" +"て返します。各 :class:`Example` の行番号は 0から数えます。オプション引数 " +"*name* はこの文字列につける名前で、エラーメッセージにしか使われません。" -#: ../../library/doctest.rst:1468 -msgid "TestResults objects" -msgstr "" - -#: ../../library/doctest.rst:1475 -msgid "Number of failed tests." -msgstr "" - -#: ../../library/doctest.rst:1479 -msgid "Number of attempted tests." -msgstr "" - -#: ../../library/doctest.rst:1483 -msgid "Number of skipped tests." -msgstr "" - -#: ../../library/doctest.rst:1491 +#: ../../library/doctest.rst:1409 msgid "DocTestRunner objects" msgstr "DocTestRunner オブジェクト" -#: ../../library/doctest.rst:1496 +#: ../../library/doctest.rst:1414 msgid "" "A processing class used to execute and verify the interactive examples in a :" "class:`DocTest`." @@ -2483,28 +2207,40 @@ msgstr "" ":class:`DocTest` 内の対話モード実行例を実行し、検証する際に用いられる処理クラ" "スです。" -#: ../../library/doctest.rst:1499 +#: ../../library/doctest.rst:1417 msgid "" "The comparison between expected outputs and actual outputs is done by an :" "class:`OutputChecker`. This comparison may be customized with a number of " "option flags; see section :ref:`doctest-options` for more information. If " "the option flags are insufficient, then the comparison may also be " -"customized by passing a subclass of :class:`!OutputChecker` to the " +"customized by passing a subclass of :class:`OutputChecker` to the " "constructor." msgstr "" +"期待する出力と実際の出力との比較は :class:`OutputChecker` で行います。比較は" +"様々なオプションフラグを使ってカスタマイズできます; 詳しくは :ref:`doctest-" +"options` を参照してください。オプションフラグでは不十分な場合、コンストラクタ" +"に :class:`OutputChecker` のサブクラスを渡して比較方法をカスタマイズできま" +"す。" -#: ../../library/doctest.rst:1505 +#: ../../library/doctest.rst:1423 msgid "" "The test runner's display output can be controlled in two ways. First, an " -"output function can be passed to :meth:`run`; this function will be called " -"with strings that should be displayed. It defaults to ``sys.stdout." -"write``. If capturing the output is not sufficient, then the display output " -"can be also customized by subclassing DocTestRunner, and overriding the " -"methods :meth:`report_start`, :meth:`report_success`, :meth:" +"output function can be passed to :meth:`TestRunner.run`; this function will " +"be called with strings that should be displayed. It defaults to ``sys." +"stdout.write``. If capturing the output is not sufficient, then the display " +"output can be also customized by subclassing DocTestRunner, and overriding " +"the methods :meth:`report_start`, :meth:`report_success`, :meth:" "`report_unexpected_exception`, and :meth:`report_failure`." msgstr "" +"テストランナーの表示出力の制御には二つの方法があります。一つ目は、 :meth:" +"`TestRunner.run` に出力用の関数を渡すというものです。この関数は、表示すべき文" +"字列を引数にして呼び出されます。デフォルトは ``sys.stdout.write`` です。出力" +"を取り込んで処理するだけでは不十分な場合、 :class:`DocTestRunner` をサブクラ" +"ス化し、 :meth:`report_start`, :meth:`report_success`, :meth:" +"`report_unexpected_exception`, および :meth:`report_failure` をオーバライドす" +"ればカスタマイズできます。" -#: ../../library/doctest.rst:1513 +#: ../../library/doctest.rst:1431 msgid "" "The optional keyword argument *checker* specifies the :class:`OutputChecker` " "object (or drop-in replacement) that should be used to compare the expected " @@ -2514,7 +2250,7 @@ msgstr "" "ト (またはその代替となるオブジェクト) を指定します。このオブジェクトは " "doctest 実行例の期待する出力と実際の出力との比較を行う際に使われます。" -#: ../../library/doctest.rst:1517 +#: ../../library/doctest.rst:1435 msgid "" "The optional keyword argument *verbose* controls the :class:" "`DocTestRunner`'s verbosity. If *verbose* is ``True``, then information is " @@ -2529,7 +2265,7 @@ msgstr "" "た場合、コマンドラインスイッチ ``-v`` を使った場合にのみ *verbose* 出力を適用" "します。" -#: ../../library/doctest.rst:1523 +#: ../../library/doctest.rst:1441 msgid "" "The optional keyword argument *optionflags* can be used to control how the " "test runner compares expected output to actual output, and how it displays " @@ -2539,19 +2275,7 @@ msgstr "" "出力と実際の出力を比較する方法や、テストの失敗を表示する方法を制御できます。" "詳しくは :ref:`doctest-options` 節を参照してください。" -#: ../../library/doctest.rst:1527 -msgid "" -"The test runner accumulates statistics. The aggregated number of attempted, " -"failed and skipped examples is also available via the :attr:`tries`, :attr:" -"`failures` and :attr:`skips` attributes. The :meth:`run` and :meth:" -"`summarize` methods return a :class:`TestResults` instance." -msgstr "" - -#: ../../library/doctest.rst:1532 -msgid ":class:`DocTestRunner` defines the following methods:" -msgstr "" - -#: ../../library/doctest.rst:1537 +#: ../../library/doctest.rst:1451 msgid "" "Report that the test runner is about to process the given example. This " "method is provided to allow subclasses of :class:`DocTestRunner` to " @@ -2561,14 +2285,16 @@ msgstr "" "class:`DocTestRunner` の出力をサブクラスでカスタマイズできるようにするための" "メソッドです。直接呼び出してはなりません。" -#: ../../library/doctest.rst:1541 +#: ../../library/doctest.rst:1455 msgid "" "*example* is the example about to be processed. *test* is the test " -"containing *example*. *out* is the output function that was passed to :meth:" +"*containing example*. *out* is the output function that was passed to :meth:" "`DocTestRunner.run`." msgstr "" +"*example* は処理する実行例です。 *test* は *example* の入っているテストで" +"す。 *out* は出力用の関数で、 :meth:`DocTestRunner.run` に渡されます。" -#: ../../library/doctest.rst:1548 +#: ../../library/doctest.rst:1462 msgid "" "Report that the given example ran successfully. This method is provided to " "allow subclasses of :class:`DocTestRunner` to customize their output; it " @@ -2578,7 +2304,7 @@ msgstr "" "`DocTestRunner` のサブクラスで出力をカスタマイズできるようにするために提供さ" "れています; 直接呼び出してはなりません。" -#: ../../library/doctest.rst:1552 ../../library/doctest.rst:1563 +#: ../../library/doctest.rst:1466 ../../library/doctest.rst:1477 msgid "" "*example* is the example about to be processed. *got* is the actual output " "from the example. *test* is the test containing *example*. *out* is the " @@ -2588,7 +2314,7 @@ msgstr "" "*test* は *example* の入っているテストです。 *out* は出力用の関数で、 :meth:" "`DocTestRunner.run` に渡されます。" -#: ../../library/doctest.rst:1559 +#: ../../library/doctest.rst:1473 msgid "" "Report that the given example failed. This method is provided to allow " "subclasses of :class:`DocTestRunner` to customize their output; it should " @@ -2598,7 +2324,7 @@ msgstr "" "class:`DocTestRunner` のサブクラスで出力をカスタマイズできるようにするために" "提供されています; 直接呼び出してはなりません。" -#: ../../library/doctest.rst:1570 +#: ../../library/doctest.rst:1484 msgid "" "Report that the given example raised an unexpected exception. This method is " "provided to allow subclasses of :class:`DocTestRunner` to customize their " @@ -2608,7 +2334,7 @@ msgstr "" "は :class:`DocTestRunner` のサブクラスで出力をカスタマイズできるようにするた" "めに提供されています; 直接呼び出してはなりません。" -#: ../../library/doctest.rst:1574 +#: ../../library/doctest.rst:1488 msgid "" "*example* is the example about to be processed. *exc_info* is a tuple " "containing information about the unexpected exception (as returned by :func:" @@ -2620,14 +2346,15 @@ msgstr "" "*example* の入っているテストです。 *out* は出力用の関数で、 :meth:" "`DocTestRunner.run` に渡されます。" -#: ../../library/doctest.rst:1582 +#: ../../library/doctest.rst:1496 msgid "" "Run the examples in *test* (a :class:`DocTest` object), and display the " -"results using the writer function *out*. Return a :class:`TestResults` " -"instance." +"results using the writer function *out*." msgstr "" +"*test* 内の実行例 (:class:`DocTest` オブジェクト) を実行し、その結果を出力用" +"の関数 *out* を使って表示します。" -#: ../../library/doctest.rst:1586 +#: ../../library/doctest.rst:1499 msgid "" "The examples are run in the namespace ``test.globs``. If *clear_globs* is " "true (the default), then this namespace will be cleared after the test runs, " @@ -2639,7 +2366,7 @@ msgstr "" "促します。テストの実行完了後にその内容を調べたければ、*clear_globs=False* と" "してください。" -#: ../../library/doctest.rst:1591 +#: ../../library/doctest.rst:1504 msgid "" "*compileflags* gives the set of flags that should be used by the Python " "compiler when running the examples. If not specified, then it will default " @@ -2649,20 +2376,25 @@ msgstr "" "セットを指定します。*compileflags* を指定しない場合、デフォルト値は *globs* " "で適用されている future-import フラグセットになります。" -#: ../../library/doctest.rst:1595 +#: ../../library/doctest.rst:1508 msgid "" "The output of each example is checked using the :class:`DocTestRunner`'s " -"output checker, and the results are formatted by the :meth:`!DocTestRunner." +"output checker, and the results are formatted by the :meth:`DocTestRunner." "report_\\*` methods." msgstr "" +"各実行例の出力は :class:`DocTestRunner` の出力チェッカで検査され、その結果" +"は :meth:`DocTestRunner.report_\\*` メソッドで書式化されます。" -#: ../../library/doctest.rst:1602 +#: ../../library/doctest.rst:1515 msgid "" "Print a summary of all the test cases that have been run by this " -"DocTestRunner, and return a :class:`TestResults` instance." +"DocTestRunner, and return a :term:`named tuple` ``TestResults(failed, " +"attempted)``." msgstr "" +"この DocTestRunner が実行したすべてのテストケースのサマリを出力し、 :term:`名" +"前付きタプル ` ``TestResults(failed, attempted)`` を返します。" -#: ../../library/doctest.rst:1605 +#: ../../library/doctest.rst:1518 msgid "" "The optional *verbose* argument controls how detailed the summary is. If " "the verbosity is not specified, then the :class:`DocTestRunner`'s verbosity " @@ -2672,27 +2404,11 @@ msgstr "" "ます。冗長度を指定しない場合、 :class:`DocTestRunner` 自体の冗長度を使いま" "す。" -#: ../../library/doctest.rst:1609 -msgid ":class:`DocTestParser` has the following attributes:" -msgstr "" - -#: ../../library/doctest.rst:1613 -msgid "Number of attempted examples." -msgstr "" - -#: ../../library/doctest.rst:1617 -msgid "Number of failed examples." -msgstr "" - -#: ../../library/doctest.rst:1621 -msgid "Number of skipped examples." -msgstr "" - -#: ../../library/doctest.rst:1629 +#: ../../library/doctest.rst:1525 msgid "OutputChecker objects" msgstr "OutputChecker オブジェクト" -#: ../../library/doctest.rst:1634 +#: ../../library/doctest.rst:1530 msgid "" "A class used to check the whether the actual output from a doctest example " "matches the expected output. :class:`OutputChecker` defines two methods: :" @@ -2706,11 +2422,11 @@ msgstr "" "は ``True`` を返す :meth:`check_output` と、二つの出力間の違いを説明する文字" "列を返す :meth:`output_difference` の、二つのメソッドがあります。" -#: ../../library/doctest.rst:1641 +#: ../../library/doctest.rst:1537 msgid ":class:`OutputChecker` defines the following methods:" msgstr ":class:`OutputChecker` では以下のメソッドを定義しています:" -#: ../../library/doctest.rst:1645 +#: ../../library/doctest.rst:1541 msgid "" "Return ``True`` iff the actual output from an example (*got*) matches the " "expected output (*want*). These strings are always considered to match if " @@ -2724,7 +2440,7 @@ msgstr "" "じ内容になっていなくても一致するとみなす場合もあります。オプションフラグにつ" "いての詳しい情報は :ref:`doctest-options` 節を参照してください。" -#: ../../library/doctest.rst:1654 +#: ../../library/doctest.rst:1550 msgid "" "Return a string describing the differences between the expected output for a " "given example (*example*) and the actual output (*got*). *optionflags* is " @@ -2734,17 +2450,17 @@ msgstr "" "間の差異を解説している文字列を返します。*optionflags* は *want* と *got* を比" "較する際に使われるオプションフラグのセットです。" -#: ../../library/doctest.rst:1662 +#: ../../library/doctest.rst:1558 msgid "Debugging" msgstr "デバッグ" -#: ../../library/doctest.rst:1664 +#: ../../library/doctest.rst:1560 msgid "Doctest provides several mechanisms for debugging doctest examples:" msgstr "" ":mod:`doctest` では、doctest 実行例をデバッグするメカニズムをいくつか提供して" "います:" -#: ../../library/doctest.rst:1666 +#: ../../library/doctest.rst:1562 msgid "" "Several functions convert doctests to executable Python programs, which can " "be run under the Python debugger, :mod:`pdb`." @@ -2752,7 +2468,7 @@ msgstr "" "doctest を実行可能な Python プログラムに変換し、 Python デバッガ :mod:`pdb` " "で実行できるようにするための関数がいくつかあります。" -#: ../../library/doctest.rst:1669 +#: ../../library/doctest.rst:1565 msgid "" "The :class:`DebugRunner` class is a subclass of :class:`DocTestRunner` that " "raises an exception for the first failing example, containing information " @@ -2763,7 +2479,7 @@ msgstr "" "のクラスは、最初に失敗した実行例に対して例外を送出します。例外には実行例に関" "する情報が入っています。この情報は実行例の検死デバッグに利用できます。" -#: ../../library/doctest.rst:1674 +#: ../../library/doctest.rst:1570 msgid "" "The :mod:`unittest` cases generated by :func:`DocTestSuite` support the :" "meth:`debug` method defined by :class:`unittest.TestCase`." @@ -2772,7 +2488,7 @@ msgstr "" "`debug` メソッドをサポートしています。 :meth:`debug` は :class:`unittest." "TestCase` で定義されています。" -#: ../../library/doctest.rst:1677 +#: ../../library/doctest.rst:1573 msgid "" "You can add a call to :func:`pdb.set_trace` in a doctest example, and you'll " "drop into the Python debugger when that line is executed. Then you can " @@ -2784,57 +2500,11 @@ msgstr "" "の現在の値などを調べられます。たとえば、以下のようなモジュールレベルの " "docstring の入ったファイル :file:`a.py` があるとします::" -#: ../../library/doctest.rst:1682 -msgid "" -"\"\"\"\n" -">>> def f(x):\n" -"... g(x*2)\n" -">>> def g(x):\n" -"... print(x+3)\n" -"... import pdb; pdb.set_trace()\n" -">>> f(3)\n" -"9\n" -"\"\"\"" -msgstr "" - -#: ../../library/doctest.rst:1692 +#: ../../library/doctest.rst:1588 msgid "Then an interactive Python session may look like this::" msgstr "対話セッションは以下のようになるでしょう::" -#: ../../library/doctest.rst:1694 -msgid "" -">>> import a, doctest\n" -">>> doctest.testmod(a)\n" -"--Return--\n" -"> (3)g()->None\n" -"-> import pdb; pdb.set_trace()\n" -"(Pdb) list\n" -" 1 def g(x):\n" -" 2 print(x+3)\n" -" 3 -> import pdb; pdb.set_trace()\n" -"[EOF]\n" -"(Pdb) p x\n" -"6\n" -"(Pdb) step\n" -"--Return--\n" -"> (2)f()->None\n" -"-> g(x*2)\n" -"(Pdb) list\n" -" 1 def f(x):\n" -" 2 -> g(x*2)\n" -"[EOF]\n" -"(Pdb) p x\n" -"3\n" -"(Pdb) step\n" -"--Return--\n" -"> (1)?()->None\n" -"-> f(3)\n" -"(Pdb) cont\n" -"(0, 3)\n" -">>>" -msgstr "" - -#: ../../library/doctest.rst:1725 +#: ../../library/doctest.rst:1621 msgid "" "Functions that convert doctests to Python code, and possibly run the " "synthesized code under the debugger:" @@ -2842,11 +2512,11 @@ msgstr "" "以下は、doctest を Python コードに変換して、できたコードをデバッガ下で実行で" "きるようにするための関数です:" -#: ../../library/doctest.rst:1731 +#: ../../library/doctest.rst:1627 msgid "Convert text with examples to a script." msgstr "実行例の入ったテキストをスクリプトに変換します。" -#: ../../library/doctest.rst:1733 +#: ../../library/doctest.rst:1629 msgid "" "Argument *s* is a string containing doctest examples. The string is " "converted to a Python script, where doctest examples in *s* are converted to " @@ -2858,35 +2528,11 @@ msgstr "" "Python のコメント文になります。生成したスクリプトを文字列で返します。例え" "ば、 ::" -#: ../../library/doctest.rst:1738 -msgid "" -"import doctest\n" -"print(doctest.script_from_examples(r\"\"\"\n" -" Set x and y to 1 and 2.\n" -" >>> x, y = 1, 2\n" -"\n" -" Print their sum:\n" -" >>> print(x+y)\n" -" 3\n" -"\"\"\"))" -msgstr "" - -#: ../../library/doctest.rst:1748 +#: ../../library/doctest.rst:1644 msgid "displays::" msgstr "は::" -#: ../../library/doctest.rst:1750 -msgid "" -"# Set x and y to 1 and 2.\n" -"x, y = 1, 2\n" -"#\n" -"# Print their sum:\n" -"print(x+y)\n" -"# Expected:\n" -"## 3" -msgstr "" - -#: ../../library/doctest.rst:1758 +#: ../../library/doctest.rst:1654 msgid "" "This function is used internally by other functions (see below), but can " "also be useful when you want to transform an interactive Python session into " @@ -2895,37 +2541,39 @@ msgstr "" "この関数は内部的に他の関数から使われていますが (下記参照)、対話セッションを " "Python スクリプトに変換したいような場合にも便利でしょう。" -#: ../../library/doctest.rst:1765 +#: ../../library/doctest.rst:1661 msgid "Convert the doctest for an object to a script." msgstr "あるオブジェクトの doctest をスクリプトに変換します。" -#: ../../library/doctest.rst:1767 +#: ../../library/doctest.rst:1663 msgid "" "Argument *module* is a module object, or dotted name of a module, containing " "the object whose doctests are of interest. Argument *name* is the name " "(within the module) of the object with the doctests of interest. The result " "is a string, containing the object's docstring converted to a Python script, " "as described for :func:`script_from_examples` above. For example, if " -"module :file:`a.py` contains a top-level function :func:`!f`, then ::" +"module :file:`a.py` contains a top-level function :func:`f`, then ::" msgstr "" +"引数 *module* はモジュールオブジェクトか、対象の doctest を持つオブジェクトの" +"入ったモジュールのドット表記名です。引数 *name* は対象の doctest を持つオブ" +"ジェクトの (モジュール内の) 名前です。対象オブジェクトの docstring を上記の :" +"func:`script_from_examples` で説明した方法で Python スクリプトに変換してでき" +"た文字列を返します。例えば、 :file:`a.py` モジュールのトップレベルに関数 :" +"func:`f` がある場合、以下のコード ::" -#: ../../library/doctest.rst:1774 +#: ../../library/doctest.rst:1673 msgid "" -"import a, doctest\n" -"print(doctest.testsource(a, \"a.f\"))" -msgstr "" - -#: ../../library/doctest.rst:1777 -msgid "" -"prints a script version of function :func:`!f`'s docstring, with doctests " +"prints a script version of function :func:`f`'s docstring, with doctests " "converted to code, and the rest placed in comments." msgstr "" +"を実行すると、 :func:`f` の docstring から doctest をコードに変換し、それ以外" +"をコメントにしたスクリプトを出力します。" -#: ../../library/doctest.rst:1783 +#: ../../library/doctest.rst:1679 msgid "Debug the doctests for an object." msgstr "オブジェクトの持つ doctest をデバッグします。" -#: ../../library/doctest.rst:1785 +#: ../../library/doctest.rst:1681 msgid "" "The *module* and *name* arguments are the same as for function :func:" "`testsource` above. The synthesized Python script for the named object's " @@ -2936,7 +2584,7 @@ msgstr "" "ジェクトの docstring から合成された Python スクリプトは一時ファイルに書き出さ" "れ、その後 Python デバッガ :mod:`pdb` の制御下で実行されます。" -#: ../../library/doctest.rst:1790 +#: ../../library/doctest.rst:1686 msgid "" "A shallow copy of ``module.__dict__`` is used for both local and global " "execution context." @@ -2944,7 +2592,7 @@ msgstr "" "ローカルおよびグローバルの実行コンテキストには、``module.__dict__`` の浅いコ" "ピーが使われます。" -#: ../../library/doctest.rst:1793 +#: ../../library/doctest.rst:1689 msgid "" "Optional argument *pm* controls whether post-mortem debugging is used. If " "*pm* has a true value, the script file is run directly, and the debugger " @@ -2963,11 +2611,11 @@ msgstr "" "func:`pdb.run` に適切な :func:`exec` 呼び出しを渡して、最初からデバッガの下で" "スクリプトを実行します。" -#: ../../library/doctest.rst:1804 +#: ../../library/doctest.rst:1700 msgid "Debug the doctests in a string." msgstr "文字列中の doctest をデバッグします。" -#: ../../library/doctest.rst:1806 +#: ../../library/doctest.rst:1702 msgid "" "This is like function :func:`debug` above, except that a string containing " "doctest examples is specified directly, via the *src* argument." @@ -2975,13 +2623,13 @@ msgstr "" "上の :func:`debug` に似ていますが、doctest の入った文字列は *src* 引数で直接" "指定します。" -#: ../../library/doctest.rst:1809 +#: ../../library/doctest.rst:1705 msgid "" "Optional argument *pm* has the same meaning as in function :func:`debug` " "above." msgstr "オプション引数 *pm* は上の :func:`debug` と同じ意味です。" -#: ../../library/doctest.rst:1811 +#: ../../library/doctest.rst:1707 msgid "" "Optional argument *globs* gives a dictionary to use as both local and global " "execution context. If not specified, or ``None``, an empty dictionary is " @@ -2992,7 +2640,7 @@ msgstr "" "空の辞書を使います。辞書を指定した場合、実際の実行コンテキストには浅いコピー" "が使われます。" -#: ../../library/doctest.rst:1816 +#: ../../library/doctest.rst:1712 msgid "" "The :class:`DebugRunner` class, and the special exceptions it may raise, are " "of most interest to testing framework authors, and will only be sketched " @@ -3004,7 +2652,7 @@ msgstr "" "では概要しか述べられません。詳しくはソースコード、とりわけ :class:" "`DebugRunner` の docstring (それ自体 doctest です!) を参照してください:" -#: ../../library/doctest.rst:1824 +#: ../../library/doctest.rst:1720 msgid "" "A subclass of :class:`DocTestRunner` that raises an exception as soon as a " "failure is encountered. If an unexpected exception occurs, an :exc:" @@ -3020,7 +2668,7 @@ msgstr "" "敗した場合には、 :exc:`DocTestFailure` 例外を送出します。この例外には、テス" "ト、実行例、実際の出力が入っています。" -#: ../../library/doctest.rst:1831 +#: ../../library/doctest.rst:1727 msgid "" "For information about the constructor parameters and methods, see the " "documentation for :class:`DocTestRunner` in section :ref:`doctest-advanced-" @@ -3029,14 +2677,14 @@ msgstr "" "コンストラクタのパラメータやメソッドについては、 :ref:`doctest-advanced-api` " "節の :class:`DocTestRunner` のドキュメントを参照してください。" -#: ../../library/doctest.rst:1834 +#: ../../library/doctest.rst:1730 msgid "" "There are two exceptions that may be raised by :class:`DebugRunner` " "instances:" msgstr "" ":class:`DebugRunner` インスタンスの送出する例外には以下の二つがあります:" -#: ../../library/doctest.rst:1839 +#: ../../library/doctest.rst:1735 msgid "" "An exception raised by :class:`DocTestRunner` to signal that a doctest " "example's actual output did not match its expected output. The constructor " @@ -3046,23 +2694,23 @@ msgstr "" "class:`DocTestRunner` が送出する例外です。コンストラクタの引数は、インスタン" "スの同名の属性を初期化するために使われます。" -#: ../../library/doctest.rst:1843 +#: ../../library/doctest.rst:1739 msgid ":exc:`DocTestFailure` defines the following attributes:" msgstr ":exc:`DocTestFailure` では以下の属性を定義しています:" -#: ../../library/doctest.rst:1848 ../../library/doctest.rst:1872 +#: ../../library/doctest.rst:1744 ../../library/doctest.rst:1768 msgid "The :class:`DocTest` object that was being run when the example failed." msgstr "実行例が失敗した時に実行されていた :class:`DocTest` オブジェクトです。" -#: ../../library/doctest.rst:1853 ../../library/doctest.rst:1877 +#: ../../library/doctest.rst:1749 ../../library/doctest.rst:1773 msgid "The :class:`Example` that failed." msgstr "失敗した :class:`Example` オブジェクトです。" -#: ../../library/doctest.rst:1858 +#: ../../library/doctest.rst:1754 msgid "The example's actual output." msgstr "実行例の実際の出力です。" -#: ../../library/doctest.rst:1863 +#: ../../library/doctest.rst:1759 msgid "" "An exception raised by :class:`DocTestRunner` to signal that a doctest " "example raised an unexpected exception. The constructor arguments are used " @@ -3072,11 +2720,11 @@ msgstr "" "`DocTestRunner` が送出する例外です。コンストラクタの引数は、インスタンスの同" "名の属性を初期化するために使われます。" -#: ../../library/doctest.rst:1867 +#: ../../library/doctest.rst:1763 msgid ":exc:`UnexpectedException` defines the following attributes:" msgstr ":exc:`UnexpectedException` では以下の属性を定義しています:" -#: ../../library/doctest.rst:1882 +#: ../../library/doctest.rst:1778 msgid "" "A tuple containing information about the unexpected exception, as returned " "by :func:`sys.exc_info`." @@ -3084,11 +2732,11 @@ msgstr "" "予期しない例外についての情報の入ったタプルで、 :func:`sys.exc_info` が返すの" "と同じものです。" -#: ../../library/doctest.rst:1889 +#: ../../library/doctest.rst:1785 msgid "Soapbox" msgstr "アドバイス" -#: ../../library/doctest.rst:1891 +#: ../../library/doctest.rst:1787 msgid "" "As mentioned in the introduction, :mod:`doctest` has grown to have three " "primary uses:" @@ -3096,19 +2744,19 @@ msgstr "" "冒頭でも触れたように、 :mod:`doctest` は、以下の三つの主な用途を持つようにな" "りました:" -#: ../../library/doctest.rst:1894 +#: ../../library/doctest.rst:1790 msgid "Checking examples in docstrings." msgstr "docstring 内の実行例をチェックする。" -#: ../../library/doctest.rst:1896 +#: ../../library/doctest.rst:1792 msgid "Regression testing." msgstr "回帰テストを行う。" -#: ../../library/doctest.rst:1898 +#: ../../library/doctest.rst:1794 msgid "Executable documentation / literate testing." msgstr "実行可能なドキュメント/読めるテストの実現。" -#: ../../library/doctest.rst:1900 +#: ../../library/doctest.rst:1796 msgid "" "These uses have different requirements, and it is important to distinguish " "them. In particular, filling your docstrings with obscure test cases makes " @@ -3118,7 +2766,7 @@ msgstr "" "に、docstring を曖昧なテストケースに埋もれさせてしまうとドキュメントとしては" "最悪です。" -#: ../../library/doctest.rst:1904 +#: ../../library/doctest.rst:1800 msgid "" "When writing a docstring, choose docstring examples with care. There's an " "art to this that needs to be learned---it may not be natural at first. " @@ -3137,7 +2785,7 @@ msgstr "" "という形で、きっと見返りを得るでしょう。私は今でも、自分の :mod:`doctest` 実" "行例が \"無害な\" 変更を行った際にうまく動作しなくなることに驚いています。" -#: ../../library/doctest.rst:1912 +#: ../../library/doctest.rst:1808 msgid "" "Doctest also makes an excellent tool for regression testing, especially if " "you don't skimp on explanatory text. By interleaving prose and examples, it " @@ -3173,7 +2821,7 @@ msgstr "" "まったく別の取り組み方であり、テストと説明の区別をなくして、まったく違う結果" "を生み出すのです。" -#: ../../library/doctest.rst:1930 +#: ../../library/doctest.rst:1826 msgid "" "Regression testing is best confined to dedicated objects or files. There " "are several options for organizing tests:" @@ -3181,7 +2829,7 @@ msgstr "" "回帰テストは特定のオブジェクトやファイルにまとめておくのがよいでしょう。回帰" "テストの組み方にはいくつか選択肢があります:" -#: ../../library/doctest.rst:1933 +#: ../../library/doctest.rst:1829 msgid "" "Write text files containing test cases as interactive examples, and test the " "files using :func:`testfile` or :func:`DocFileSuite`. This is recommended, " @@ -3193,7 +2841,7 @@ msgstr "" "法をお勧めします。最初から doctest を使うようにしている新たなプロジェクトで" "は、この方法が一番簡単です。" -#: ../../library/doctest.rst:1938 +#: ../../library/doctest.rst:1834 msgid "" "Define functions named ``_regrtest_topic`` that consist of single " "docstrings, containing test cases for the named topics. These functions can " @@ -3205,13 +2853,15 @@ msgstr "" "ジュールと同じファイルの中にも置けますし、別のテストファイルに分けてもかまい" "ません。" -#: ../../library/doctest.rst:1942 +#: ../../library/doctest.rst:1838 msgid "" -"Define a :attr:`~module.__test__` dictionary mapping from regression test " -"topics to docstrings containing test cases." +"Define a ``__test__`` dictionary mapping from regression test topics to " +"docstrings containing test cases." msgstr "" +"回帰テストのトピックをテストケースの入った docstring に対応付けた辞書 " +"``__test__`` 辞書を定義します。" -#: ../../library/doctest.rst:1945 +#: ../../library/doctest.rst:1841 msgid "" "When you have placed your tests in a module, the module can itself be the " "test runner. When a test fails, you can arrange for your test runner to re-" @@ -3224,29 +2874,11 @@ msgstr "" "ナーを修正することができます。これがこのようなテストランナーの最小例となりま" "す。" -#: ../../library/doctest.rst:1950 -msgid "" -"if __name__ == '__main__':\n" -" import doctest\n" -" flags = doctest.REPORT_NDIFF|doctest.FAIL_FAST\n" -" if len(sys.argv) > 1:\n" -" name = sys.argv[1]\n" -" if name in globals():\n" -" obj = globals()[name]\n" -" else:\n" -" obj = __test__[name]\n" -" doctest.run_docstring_examples(obj, globals(), name=name,\n" -" optionflags=flags)\n" -" else:\n" -" fail, total = doctest.testmod(optionflags=flags)\n" -" print(f\"{fail} failures out of {total} tests\")" -msgstr "" - -#: ../../library/doctest.rst:1967 +#: ../../library/doctest.rst:1863 msgid "Footnotes" msgstr "脚注" -#: ../../library/doctest.rst:1968 +#: ../../library/doctest.rst:1864 msgid "" "Examples containing both expected output and an exception are not supported. " "Trying to guess where one ends and the other begins is too error-prone, and " @@ -3255,43 +2887,3 @@ msgstr "" "期待する出力結果と例外の両方を含んだ例はサポートされていません。一方の終わり" "と他方の始まりを見分けようとするのはエラーの元になりがちですし、解りにくいテ" "ストになってしまいます。" - -#: ../../library/doctest.rst:376 -msgid ">>>" -msgstr ">>>" - -#: ../../library/doctest.rst:376 -msgid "interpreter prompt" -msgstr "" - -#: ../../library/doctest.rst:376 ../../library/doctest.rst:611 -msgid "..." -msgstr "..." - -#: ../../library/doctest.rst:542 -msgid "^ (caret)" -msgstr "^ (キャレット)" - -#: ../../library/doctest.rst:542 -msgid "marker" -msgstr "" - -#: ../../library/doctest.rst:591 -msgid "" -msgstr "" - -#: ../../library/doctest.rst:611 ../../library/doctest.rst:736 -msgid "in doctests" -msgstr "" - -#: ../../library/doctest.rst:736 -msgid "# (hash)" -msgstr "# (hash)" - -#: ../../library/doctest.rst:736 -msgid "+ (plus)" -msgstr "+ (プラス記号)" - -#: ../../library/doctest.rst:736 -msgid "- (minus)" -msgstr "- (負符号)" diff --git a/library/email.charset.po b/library/email.charset.po index 638d4f7cb..834923599 100644 --- a/library/email.charset.po +++ b/library/email.charset.po @@ -1,32 +1,34 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 -# Taichi Haradaguchi, 2024 -# 石井明久, 2024 +# Nozomu Kaneko , 2017 +# 秘湯 , 2017 +# Arihiro TAKASE, 2017 +# E. Kawashima, 2017 +# tomo, 2019 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-13 14:21+0000\n" -"PO-Revision-Date: 2021-06-28 01:04+0000\n" -"Last-Translator: 石井明久, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 23:07+0000\n" +"Last-Translator: tomo, 2019\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/email.charset.rst:2 -msgid ":mod:`!email.charset`: Representing character sets" -msgstr ":mod:`!email.charset`: 文字集合の表現" +msgid ":mod:`email.charset`: Representing character sets" +msgstr ":mod:`email.charset`: 文字集合の表現" #: ../../library/email.charset.rst:7 msgid "**Source code:** :source:`Lib/email/charset.py`" @@ -134,25 +136,25 @@ msgstr "" #: ../../library/email.charset.rst:60 msgid "" "If the character set must be encoded before it can be used in an email " -"header, this attribute will be set to ``charset.QP`` (for quoted-printable), " -"``charset.BASE64`` (for base64 encoding), or ``charset.SHORTEST`` for the " +"header, this attribute will be set to ``Charset.QP`` (for quoted-printable), " +"``Charset.BASE64`` (for base64 encoding), or ``Charset.SHORTEST`` for the " "shortest of QP or BASE64 encoding. Otherwise, it will be ``None``." msgstr "" "この文字集合が電子メールヘッダに使われる前にエンコードされなければならない場" -"合、この属性は ``charset.QP`` (quoted-printable エンコーディング)、``charset." +"合、この属性は ``Charset.QP`` (quoted-printable エンコーディング)、``Charset." "BASE64`` (base64 エンコーディング)、あるいは最短の QP または BASE64 エンコー" -"ディングである ``charset.SHORTEST`` に設定されます。そうでない場合、この値は " +"ディングである ``Charset.SHORTEST`` に設定されます。そうでない場合、この値は " "``None`` になります。" #: ../../library/email.charset.rst:69 msgid "" "Same as *header_encoding*, but describes the encoding for the mail message's " -"body, which indeed may be different than the header encoding. ``charset." +"body, which indeed may be different than the header encoding. ``Charset." "SHORTEST`` is not allowed for *body_encoding*." msgstr "" "*header_encoding* と同じですが、この値はメッセージ本体のためのエンコーディン" "グを記述します。これはヘッダ用のエンコーディングとは違うかもしれません。" -"*body_encoding* では、``charset.SHORTEST`` を使うことはできません。" +"*body_encoding* では、``Charset.SHORTEST`` を使うことはできません。" #: ../../library/email.charset.rst:76 msgid "" @@ -281,11 +283,11 @@ msgstr "" #: ../../library/email.charset.rst:152 msgid "" -"Returns *input_charset* as a string coerced to lower case. :meth:`!__repr__` " -"is an alias for :meth:`!__str__`." +"Returns *input_charset* as a string coerced to lower case. :meth:`__repr__` " +"is an alias for :meth:`__str__`." msgstr "" -"*input_charset* を小文字に変換された文字列型として返します。 :meth:`!" -"__repr__` は、 :meth:`!__str__` の別名となっています。" +"*input_charset* を小文字に変換された文字列型として返します。 :meth:" +"`__repr__` は、 :meth:`__str__` の別名となっています。" #: ../../library/email.charset.rst:158 msgid "" @@ -326,16 +328,16 @@ msgstr "" #: ../../library/email.charset.rst:178 msgid "" -"Optional *header_enc* and *body_enc* is either ``charset.QP`` for quoted-" -"printable, ``charset.BASE64`` for base64 encoding, ``charset.SHORTEST`` for " +"Optional *header_enc* and *body_enc* is either ``Charset.QP`` for quoted-" +"printable, ``Charset.BASE64`` for base64 encoding, ``Charset.SHORTEST`` for " "the shortest of quoted-printable or base64 encoding, or ``None`` for no " "encoding. ``SHORTEST`` is only valid for *header_enc*. The default is " "``None`` for no encoding." msgstr "" "オプション引数 *header_enc* および *body_enc* は quoted-printable エンコー" -"ディングを表す ``charset.QP`` か、base64 エンコーディングを表す ``charset." +"ディングを表す ``Charset.QP`` か、base64 エンコーディングを表す ``Charset." "BASE64``、最短の quoted-printable または base64 エンコーディングを表す " -"``charset.SHORTEST``、あるいはエンコーディングなしの ``None`` のいずれかにな" +"``Charset.SHORTEST``、あるいはエンコーディングなしの ``None`` のいずれかにな" "ります。``SHORTEST`` が使えるのは *header_enc* だけです。デフォルトの値はエン" "コーディングなしの ``None`` になっています。" diff --git a/library/email.compat32-message.po b/library/email.compat32-message.po index b8a0f57fb..f79a7086d 100644 --- a/library/email.compat32-message.po +++ b/library/email.compat32-message.po @@ -1,26 +1,29 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: +# Nozomu Kaneko , 2017 +# 秘湯 , 2017 +# E. Kawashima, 2017 +# Arihiro TAKASE, 2017 # Takanori Suzuki , 2021 -# tomo, 2021 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-30 14:22+0000\n" -"PO-Revision-Date: 2021-06-28 01:04+0000\n" -"Last-Translator: tomo, 2021\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-04-26 06:10+0000\n" +"PO-Revision-Date: 2017-02-16 23:07+0000\n" +"Last-Translator: Takanori Suzuki , 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/email.compat32-message.rst:4 @@ -31,7 +34,7 @@ msgstr "" ":mod:`email.message.Message`: :data:`~email.policy.compat32` API を使用した電" "子メールメッセージの表現" -#: ../../library/email.compat32-message.rst:13 +#: ../../library/email.compat32-message.rst:12 msgid "" "The :class:`Message` class is very similar to the :class:`~email.message." "EmailMessage` class, without the methods added by that class, and with the " @@ -41,11 +44,11 @@ msgid "" "legacy code." msgstr "" -#: ../../library/email.compat32-message.rst:20 +#: ../../library/email.compat32-message.rst:19 msgid "The philosophy and structure of the two classes is otherwise the same." msgstr "" -#: ../../library/email.compat32-message.rst:22 +#: ../../library/email.compat32-message.rst:21 msgid "" "This document describes the behavior under the default (for :class:" "`Message`) policy :attr:`~email.policy.Compat32`. If you are going to use " @@ -53,7 +56,7 @@ msgid "" "class instead." msgstr "" -#: ../../library/email.compat32-message.rst:26 +#: ../../library/email.compat32-message.rst:25 msgid "" "An email message consists of *headers* and a *payload*. Headers must be :" "rfc:`5322` style names and values, where the field name and value are " @@ -65,7 +68,7 @@ msgid "" "`message/rfc822`." msgstr "" -#: ../../library/email.compat32-message.rst:35 +#: ../../library/email.compat32-message.rst:34 msgid "" "The conceptual model provided by a :class:`Message` object is that of an " "ordered dictionary of headers with additional methods for accessing both " @@ -75,7 +78,7 @@ msgid "" "methods must be used to access them." msgstr "" -#: ../../library/email.compat32-message.rst:42 +#: ../../library/email.compat32-message.rst:41 msgid "" "The :class:`Message` pseudo-dictionary is indexed by the header names, which " "must be ASCII values. The values of the dictionary are strings that are " @@ -89,11 +92,11 @@ msgid "" "mimetype:`multipart/\\*` and :mimetype:`message/rfc822`)." msgstr "" -#: ../../library/email.compat32-message.rst:53 +#: ../../library/email.compat32-message.rst:52 msgid "Here are the methods of the :class:`Message` class:" msgstr ":class:`Message` クラスのメソッドは以下のとおりです:" -#: ../../library/email.compat32-message.rst:58 +#: ../../library/email.compat32-message.rst:57 msgid "" "If *policy* is specified (it must be an instance of a :mod:`~email.policy` " "class) use the rules it specifies to update and serialize the representation " @@ -103,11 +106,11 @@ msgid "" "`~email.policy` documentation." msgstr "" -#: ../../library/email.compat32-message.rst:65 +#: ../../library/email.compat32-message.rst:64 msgid "The *policy* keyword argument was added." msgstr "キーワード引数 *policy* が追加されました。" -#: ../../library/email.compat32-message.rst:70 +#: ../../library/email.compat32-message.rst:69 msgid "" "Return the entire message flattened as a string. When optional *unixfrom* " "is true, the envelope header is included in the returned string. *unixfrom* " @@ -120,8 +123,8 @@ msgid "" "*policy* will be passed to the ``Generator``." msgstr "" -#: ../../library/email.compat32-message.rst:80 -#: ../../library/email.compat32-message.rst:122 +#: ../../library/email.compat32-message.rst:79 +#: ../../library/email.compat32-message.rst:121 msgid "" "Flattening the message may trigger changes to the :class:`Message` if " "defaults need to be filled in to complete the transformation to a string " @@ -131,27 +134,17 @@ msgstr "" "メッセージのフラット化は :class:`Message` の変更を引き起こす可能性があります " "(例えば、MIME の境界が生成される、変更される等)。" -#: ../../library/email.compat32-message.rst:84 +#: ../../library/email.compat32-message.rst:83 msgid "" "Note that this method is provided as a convenience and may not always format " "the message the way you want. For example, by default it does not do the " -"mangling of lines that begin with ``From`` that is required by the Unix mbox " +"mangling of lines that begin with ``From`` that is required by the unix mbox " "format. For more flexibility, instantiate a :class:`~email.generator." "Generator` instance and use its :meth:`~email.generator.Generator.flatten` " "method directly. For example::" msgstr "" -#: ../../library/email.compat32-message.rst:91 -msgid "" -"from io import StringIO\n" -"from email.generator import Generator\n" -"fp = StringIO()\n" -"g = Generator(fp, mangle_from_=True, maxheaderlen=60)\n" -"g.flatten(msg)\n" -"text = fp.getvalue()" -msgstr "" - -#: ../../library/email.compat32-message.rst:98 +#: ../../library/email.compat32-message.rst:97 msgid "" "If the message object contains binary data that is not encoded according to " "RFC standards, the non-compliant data will be replaced by unicode \"unknown " @@ -159,17 +152,19 @@ msgid "" "generator.BytesGenerator`.)" msgstr "" -#: ../../library/email.compat32-message.rst:103 +#: ../../library/email.compat32-message.rst:102 msgid "the *policy* keyword argument was added." msgstr "*policy* キーワード引数が追加されました。" -#: ../../library/email.compat32-message.rst:108 +#: ../../library/email.compat32-message.rst:107 msgid "" -"Equivalent to :meth:`.as_string`. Allows ``str(msg)`` to produce a string " +"Equivalent to :meth:`.as_string()`. Allows ``str(msg)`` to produce a string " "containing the formatted message." msgstr "" +":meth:`.as_string()` と等価です。これにより ``str(msg)`` は書式化されたメッ" +"セージの文字列を作ります。" -#: ../../library/email.compat32-message.rst:114 +#: ../../library/email.compat32-message.rst:113 msgid "" "Return the entire message flattened as a bytes object. When optional " "*unixfrom* is true, the envelope header is included in the returned string. " @@ -179,33 +174,25 @@ msgid "" "specified *policy* will be passed to the ``BytesGenerator``." msgstr "" -#: ../../library/email.compat32-message.rst:126 +#: ../../library/email.compat32-message.rst:125 msgid "" "Note that this method is provided as a convenience and may not always format " "the message the way you want. For example, by default it does not do the " -"mangling of lines that begin with ``From`` that is required by the Unix mbox " +"mangling of lines that begin with ``From`` that is required by the unix mbox " "format. For more flexibility, instantiate a :class:`~email.generator." "BytesGenerator` instance and use its :meth:`~email.generator.BytesGenerator." "flatten` method directly. For example::" msgstr "" -#: ../../library/email.compat32-message.rst:134 +#: ../../library/email.compat32-message.rst:145 msgid "" -"from io import BytesIO\n" -"from email.generator import BytesGenerator\n" -"fp = BytesIO()\n" -"g = BytesGenerator(fp, mangle_from_=True, maxheaderlen=60)\n" -"g.flatten(msg)\n" -"text = fp.getvalue()" -msgstr "" - -#: ../../library/email.compat32-message.rst:146 -msgid "" -"Equivalent to :meth:`.as_bytes`. Allows ``bytes(msg)`` to produce a bytes " +"Equivalent to :meth:`.as_bytes()`. Allows ``bytes(msg)`` to produce a bytes " "object containing the formatted message." msgstr "" +":meth:`.as_bytes()` と等価です。これにより ``bytes(msg)`` は書式化されたメッ" +"セージの bytes オブジェクトを作ります。" -#: ../../library/email.compat32-message.rst:154 +#: ../../library/email.compat32-message.rst:153 msgid "" "Return ``True`` if the message's payload is a list of sub-\\ :class:" "`Message` objects, otherwise return ``False``. When :meth:`is_multipart` " @@ -216,14 +203,14 @@ msgid "" "return ``True`` when the :class:`Message` is of type ``message/rfc822``.)" msgstr "" -#: ../../library/email.compat32-message.rst:166 +#: ../../library/email.compat32-message.rst:165 msgid "" "Set the message's envelope header to *unixfrom*, which should be a string." msgstr "" "メッセージのエンベロープヘッダを *unixfrom* に設定します。これは文字列でなけ" "ればなりません。" -#: ../../library/email.compat32-message.rst:171 +#: ../../library/email.compat32-message.rst:170 msgid "" "Return the message's envelope header. Defaults to ``None`` if the envelope " "header was never set." @@ -231,7 +218,7 @@ msgstr "" "メッセージのエンベロープヘッダを返します。エンベロープヘッダが設定されていな" "い場合は ``None`` が返されます。" -#: ../../library/email.compat32-message.rst:177 +#: ../../library/email.compat32-message.rst:176 msgid "" "Add the given *payload* to the current payload, which must be ``None`` or a " "list of :class:`Message` objects before the call. After the call, the " @@ -245,14 +232,14 @@ msgstr "" "のリストになります。ペイロードにスカラーオブジェクト (文字列など) を格納した" "い場合は、かわりに :meth:`set_payload` を使ってください。" -#: ../../library/email.compat32-message.rst:183 +#: ../../library/email.compat32-message.rst:182 msgid "" "This is a legacy method. On the :class:`~email.emailmessage.EmailMessage` " "class its functionality is replaced by :meth:`~email.message.EmailMessage." "set_content` and the related ``make`` and ``add`` methods." msgstr "" -#: ../../library/email.compat32-message.rst:191 +#: ../../library/email.compat32-message.rst:190 msgid "" "Return the current payload, which will be a list of :class:`Message` objects " "when :meth:`is_multipart` is ``True``, or a string when :meth:`is_multipart` " @@ -264,7 +251,7 @@ msgstr "" "``False`` の場合は文字列になります。ペイロードがリストの場合、リストを変更す" "ることはそのメッセージのペイロードを変更することになります。" -#: ../../library/email.compat32-message.rst:196 +#: ../../library/email.compat32-message.rst:195 msgid "" "With optional argument *i*, :meth:`get_payload` will return the *i*-th " "element of the payload, counting from zero, if :meth:`is_multipart` is " @@ -280,7 +267,7 @@ msgstr "" "が ``False``) にもかかわらず *i* が与えられたときは :exc:`TypeError` が発生し" "ます。" -#: ../../library/email.compat32-message.rst:203 +#: ../../library/email.compat32-message.rst:202 msgid "" "Optional *decode* is a flag indicating whether the payload should be decoded " "or not, according to the :mailheader:`Content-Transfer-Encoding` header. " @@ -296,7 +283,7 @@ msgid "" "or :class:`~email.errors.InvalidBase64CharactersDefect`, respectively)." msgstr "" -#: ../../library/email.compat32-message.rst:217 +#: ../../library/email.compat32-message.rst:216 msgid "" "When *decode* is ``False`` (the default) the body is returned as a string " "without decoding the :mailheader:`Content-Transfer-Encoding`. However, for " @@ -307,14 +294,14 @@ msgid "" "the email package, the body is decoded using the default ASCII charset." msgstr "" -#: ../../library/email.compat32-message.rst:226 +#: ../../library/email.compat32-message.rst:225 msgid "" "This is a legacy method. On the :class:`~email.emailmessage.EmailMessage` " "class its functionality is replaced by :meth:`~email.message.EmailMessage." "get_content` and :meth:`~email.message.EmailMessage.iter_parts`." msgstr "" -#: ../../library/email.compat32-message.rst:234 +#: ../../library/email.compat32-message.rst:233 msgid "" "Set the entire message object's payload to *payload*. It is the client's " "responsibility to ensure the payload invariants. Optional *charset* sets " @@ -325,14 +312,14 @@ msgstr "" "フォルト文字セットを設定します。詳しくは :meth:`set_charset` を参照してくださ" "い。" -#: ../../library/email.compat32-message.rst:238 +#: ../../library/email.compat32-message.rst:237 msgid "" "This is a legacy method. On the :class:`~email.emailmessage.EmailMessage` " "class its functionality is replaced by :meth:`~email.message.EmailMessage." "set_content`." msgstr "" -#: ../../library/email.compat32-message.rst:245 +#: ../../library/email.compat32-message.rst:244 msgid "" "Set the character set of the payload to *charset*, which can either be a :" "class:`~email.charset.Charset` instance (see :mod:`email.charset`), a string " @@ -350,7 +337,7 @@ msgstr "" "す (それ以外にメッセージは変更されません)。これら以外のものを文字セットとして" "指定した場合、 :exc:`TypeError` を送出します。" -#: ../../library/email.compat32-message.rst:253 +#: ../../library/email.compat32-message.rst:252 msgid "" "If there is no existing :mailheader:`MIME-Version` header one will be " "added. If there is no existing :mailheader:`Content-Type` header, one will " @@ -378,14 +365,14 @@ msgstr "" "ば、ペイロードはすでにその :mailheader:`Content-Transfer-Encoding` によって正" "しくエンコードされたものと見なされ、変形されません。" -#: ../../library/email.compat32-message.rst:267 +#: ../../library/email.compat32-message.rst:266 msgid "" "This is a legacy method. On the :class:`~email.emailmessage.EmailMessage` " "class its functionality is replaced by the *charset* parameter of the :meth:" "`email.emailmessage.EmailMessage.set_content` method." msgstr "" -#: ../../library/email.compat32-message.rst:275 +#: ../../library/email.compat32-message.rst:274 msgid "" "Return the :class:`~email.charset.Charset` instance associated with the " "message's payload." @@ -393,13 +380,13 @@ msgstr "" "そのメッセージ中のペイロードの :class:`~email.charset.Charset` インスタンスを" "返します。" -#: ../../library/email.compat32-message.rst:278 +#: ../../library/email.compat32-message.rst:277 msgid "" "This is a legacy method. On the :class:`~email.emailmessage.EmailMessage` " "class it always returns ``None``." msgstr "" -#: ../../library/email.compat32-message.rst:283 +#: ../../library/email.compat32-message.rst:282 msgid "" "The following methods implement a mapping-like interface for accessing the " "message's :rfc:`2822` headers. Note that there are some semantic " @@ -421,7 +408,7 @@ msgstr "" "れます。削除され、その後ふたたび追加されたヘッダはリストの一番最後に現れま" "す。" -#: ../../library/email.compat32-message.rst:293 +#: ../../library/email.compat32-message.rst:292 msgid "" "These semantic differences are intentional and are biased toward maximal " "convenience." @@ -429,7 +416,7 @@ msgstr "" "こういった意味のちがいは意図的なもので、最大の利便性をもつようにつくられてい" "ます。" -#: ../../library/email.compat32-message.rst:296 +#: ../../library/email.compat32-message.rst:295 msgid "" "Note that in all cases, any envelope header present in the message is not " "included in the mapping interface." @@ -437,19 +424,19 @@ msgstr "" "注意: どんな場合も、メッセージ中のエンベロープヘッダはこのマップ形式のインタ" "フェイスには含まれません。" -#: ../../library/email.compat32-message.rst:299 +#: ../../library/email.compat32-message.rst:298 msgid "" "In a model generated from bytes, any header values that (in contravention of " "the RFCs) contain non-ASCII bytes will, when retrieved through this " "interface, be represented as :class:`~email.header.Header` objects with a " -"charset of ``unknown-8bit``." +"charset of `unknown-8bit`." msgstr "" -#: ../../library/email.compat32-message.rst:307 +#: ../../library/email.compat32-message.rst:306 msgid "Return the total number of headers, including duplicates." msgstr "複製されたものもふくめてヘッダ数の合計を返します。" -#: ../../library/email.compat32-message.rst:312 +#: ../../library/email.compat32-message.rst:311 msgid "" "Return ``True`` if the message object has a field named *name*. Matching is " "done case-insensitively and *name* should not include the trailing colon. " @@ -460,13 +447,7 @@ msgstr "" "は最後にコロンをふくんでいてはいけません。このメソッドは以下のように ``in`` " "演算子で使われます::" -#: ../../library/email.compat32-message.rst:316 -msgid "" -"if 'message-id' in myMessage:\n" -" print('Message-ID:', myMessage['message-id'])" -msgstr "" - -#: ../../library/email.compat32-message.rst:322 +#: ../../library/email.compat32-message.rst:321 msgid "" "Return the value of the named header field. *name* should not include the " "colon field separator. If the header is missing, ``None`` is returned; a :" @@ -476,7 +457,7 @@ msgstr "" "んでいてはいけません。そのヘッダがない場合は ``None`` が返され、 :exc:" "`KeyError` 例外は発生しません。" -#: ../../library/email.compat32-message.rst:326 +#: ../../library/email.compat32-message.rst:325 msgid "" "Note that if the named field appears more than once in the message's " "headers, exactly which of those field values will be returned is undefined. " @@ -487,7 +468,7 @@ msgstr "" "どちらの値が返されるかは未定義です。ヘッダに存在するフィールドの値をすべて取" "り出したい場合は :meth:`get_all` メソッドを使ってください。" -#: ../../library/email.compat32-message.rst:334 +#: ../../library/email.compat32-message.rst:333 msgid "" "Add a header to the message with field name *name* and value *val*. The " "field is appended to the end of the message's existing fields." @@ -496,7 +477,7 @@ msgstr "" "に追加します。このフィールドは現在メッセージに存在するフィールドのいちばん後" "に追加されます。" -#: ../../library/email.compat32-message.rst:337 +#: ../../library/email.compat32-message.rst:336 msgid "" "Note that this does *not* overwrite or delete any existing header with the " "same name. If you want to ensure that the new header is the only one " @@ -506,13 +487,7 @@ msgstr "" "せん*。もしメッセージが名前 *name* をもつフィールドをひとつしか持たないように" "したければ、最初にそれを除去してください。たとえば::" -#: ../../library/email.compat32-message.rst:341 -msgid "" -"del msg['subject']\n" -"msg['subject'] = 'Python roolz!'" -msgstr "" - -#: ../../library/email.compat32-message.rst:347 +#: ../../library/email.compat32-message.rst:346 msgid "" "Delete all occurrences of the field with name *name* from the message's " "headers. No exception is raised if the named field isn't present in the " @@ -521,15 +496,15 @@ msgstr "" "メッセージのヘッダから、*name* という名前をもつフィールドをすべて除去します。" "たとえこの名前をもつヘッダが存在していなくても例外は発生しません。" -#: ../../library/email.compat32-message.rst:354 +#: ../../library/email.compat32-message.rst:353 msgid "Return a list of all the message's header field names." msgstr "メッセージ中にあるすべてのヘッダのフィールド名のリストを返します。" -#: ../../library/email.compat32-message.rst:359 +#: ../../library/email.compat32-message.rst:358 msgid "Return a list of all the message's field values." msgstr "メッセージ中にあるすべてのフィールドの値のリストを返します。" -#: ../../library/email.compat32-message.rst:364 +#: ../../library/email.compat32-message.rst:363 msgid "" "Return a list of 2-tuples containing all the message's field headers and " "values." @@ -537,18 +512,21 @@ msgstr "" "メッセージ中にあるすべてのヘッダのフィールド名とその値を 2-タプルのリストとし" "て返します。" -#: ../../library/email.compat32-message.rst:370 +#: ../../library/email.compat32-message.rst:369 msgid "" "Return the value of the named header field. This is identical to :meth:" -"`~object.__getitem__` except that optional *failobj* is returned if the " -"named header is missing (defaults to ``None``)." +"`__getitem__` except that optional *failobj* is returned if the named header " +"is missing (defaults to ``None``)." msgstr "" +"指定された名前をもつフィールドの値を返します。これは指定された名前がないとき" +"にオプション引数の *failobj* (デフォルトでは ``None``) を返すことをのぞけ" +"ば、 :meth:`__getitem__` と同じです。" -#: ../../library/email.compat32-message.rst:374 +#: ../../library/email.compat32-message.rst:373 msgid "Here are some additional useful methods:" msgstr "さらに、役に立つメソッドをいくつか紹介します:" -#: ../../library/email.compat32-message.rst:379 +#: ../../library/email.compat32-message.rst:378 msgid "" "Return a list of all the values for the field named *name*. If there are no " "such named headers in the message, *failobj* is returned (defaults to " @@ -558,7 +536,7 @@ msgstr "" "前のヘッダがメッセージ中に含まれていない場合は *failobj* (デフォルトでは " "``None``) が返されます。" -#: ../../library/email.compat32-message.rst:386 +#: ../../library/email.compat32-message.rst:385 msgid "" "Extended header setting. This method is similar to :meth:`__setitem__` " "except that additional header parameters can be provided as keyword " @@ -569,7 +547,7 @@ msgstr "" "ダ・パラメータをキーワード引数で指定できるところが違っています。 *_name* に追" "加するヘッダフィールドを、 *_value* にそのヘッダの *最初の* 値を渡します。" -#: ../../library/email.compat32-message.rst:391 +#: ../../library/email.compat32-message.rst:390 msgid "" "For each item in the keyword argument dictionary *_params*, the key is taken " "as the parameter name, with underscores converted to dashes (since dashes " @@ -598,42 +576,23 @@ msgstr "" "が渡された場合は、 ``CHARSET`` に ``utf-8`` 、 ``LANGUAGE`` に ``None`` を" "使って :rfc:`2231` 形式に自動的にエンコードされます。" -#: ../../library/email.compat32-message.rst:405 +#: ../../library/email.compat32-message.rst:404 msgid "Here's an example::" msgstr "以下はこの使用例です::" -#: ../../library/email.compat32-message.rst:407 -msgid "msg.add_header('Content-Disposition', 'attachment', filename='bud.gif')" -msgstr "" - -#: ../../library/email.compat32-message.rst:409 +#: ../../library/email.compat32-message.rst:408 msgid "This will add a header that looks like ::" msgstr "こうするとヘッダには以下のように追加されます ::" -#: ../../library/email.compat32-message.rst:411 -msgid "Content-Disposition: attachment; filename=\"bud.gif\"" -msgstr "" - -#: ../../library/email.compat32-message.rst:413 +#: ../../library/email.compat32-message.rst:412 msgid "An example with non-ASCII characters::" msgstr "非 ASCII 文字を使った例::" -#: ../../library/email.compat32-message.rst:415 -msgid "" -"msg.add_header('Content-Disposition', 'attachment',\n" -" filename=('iso-8859-1', '', 'Fußballer.ppt'))" -msgstr "" - -#: ../../library/email.compat32-message.rst:418 +#: ../../library/email.compat32-message.rst:417 msgid "Which produces ::" msgstr "は、以下のようになります ::" -#: ../../library/email.compat32-message.rst:420 -msgid "" -"Content-Disposition: attachment; filename*=\"iso-8859-1''Fu%DFballer.ppt\"" -msgstr "" - -#: ../../library/email.compat32-message.rst:425 +#: ../../library/email.compat32-message.rst:424 msgid "" "Replace a header. Replace the first header found in the message that " "matches *_name*, retaining header order and field name case. If no matching " @@ -643,7 +602,7 @@ msgstr "" "このときヘッダの順序とフィールド名の大文字小文字は保存されます。一致するヘッ" "ダがない場合、 :exc:`KeyError` が発生します。" -#: ../../library/email.compat32-message.rst:432 +#: ../../library/email.compat32-message.rst:431 msgid "" "Return the message's content type. The returned string is coerced to lower " "case of the form :mimetype:`maintype/subtype`. If there was no :mailheader:" @@ -659,7 +618,7 @@ msgstr "" "セージはつねにデフォルトの content-type をもっているので、 :meth:" "`get_content_type` はつねになんらかの値を返すはずです。" -#: ../../library/email.compat32-message.rst:439 +#: ../../library/email.compat32-message.rst:438 msgid "" ":rfc:`2045` defines a message's default type to be :mimetype:`text/plain` " "unless it appears inside a :mimetype:`multipart/digest` container, in which " @@ -675,7 +634,7 @@ msgstr "" "rfc:`2045` はそれのデフォルトを :mimetype:`text/plain` として扱うよう定めてい" "ます。" -#: ../../library/email.compat32-message.rst:448 +#: ../../library/email.compat32-message.rst:447 msgid "" "Return the message's main content type. This is the :mimetype:`maintype` " "part of the string returned by :meth:`get_content_type`." @@ -683,7 +642,7 @@ msgstr "" "そのメッセージの主 content-type を返します。これは :meth:`get_content_type` " "によって返される文字列の :mimetype:`maintype` 部分です。" -#: ../../library/email.compat32-message.rst:454 +#: ../../library/email.compat32-message.rst:453 msgid "" "Return the message's sub-content type. This is the :mimetype:`subtype` part " "of the string returned by :meth:`get_content_type`." @@ -692,7 +651,7 @@ msgstr "" "は :meth:`get_content_type` によって返される文字列の :mimetype:`subtype` 部分" "です。" -#: ../../library/email.compat32-message.rst:460 +#: ../../library/email.compat32-message.rst:459 msgid "" "Return the default content type. Most messages have a default content type " "of :mimetype:`text/plain`, except for messages that are subparts of :" @@ -704,7 +663,7 @@ msgstr "" "`multipart/digest` コンテナに含まれているときだけ例外的に :mimetype:`message/" "rfc822` になります。" -#: ../../library/email.compat32-message.rst:468 +#: ../../library/email.compat32-message.rst:467 msgid "" "Set the default content type. *ctype* should either be :mimetype:`text/" "plain` or :mimetype:`message/rfc822`, although this is not enforced. The " @@ -715,7 +674,7 @@ msgstr "" "ん。デフォルトの content-type はヘッダの :mailheader:`Content-Type` には格納" "されません。" -#: ../../library/email.compat32-message.rst:476 +#: ../../library/email.compat32-message.rst:475 msgid "" "Return the message's :mailheader:`Content-Type` parameters, as a list. The " "elements of the returned list are 2-tuples of key/value pairs, as split on " @@ -732,7 +691,7 @@ msgstr "" "ション引数 *unquote* が ``True`` (デフォルト) である場合、この値は unquote さ" "れます。" -#: ../../library/email.compat32-message.rst:484 +#: ../../library/email.compat32-message.rst:483 msgid "" "Optional *failobj* is the object to return if there is no :mailheader:" "`Content-Type` header. Optional *header* is the header to search instead " @@ -742,15 +701,15 @@ msgstr "" "た場合に返すオブジェクトです。オプション引数 *header* には :mailheader:" "`Content-Type` のかわりに検索すべきヘッダを指定します。" -#: ../../library/email.compat32-message.rst:488 -#: ../../library/email.compat32-message.rst:526 +#: ../../library/email.compat32-message.rst:487 +#: ../../library/email.compat32-message.rst:525 msgid "" "This is a legacy method. On the :class:`~email.emailmessage.EmailMessage` " "class its functionality is replaced by the *params* property of the " "individual header objects returned by the header access methods." msgstr "" -#: ../../library/email.compat32-message.rst:496 +#: ../../library/email.compat32-message.rst:495 msgid "" "Return the value of the :mailheader:`Content-Type` header's parameter " "*param* as a string. If the message has no :mailheader:`Content-Type` " @@ -761,7 +720,7 @@ msgstr "" "として返します。そのメッセージ中に :mailheader:`Content-Type` ヘッダが存在し" "なかった場合、 *failobj* (デフォルトは ``None``) が返されます。" -#: ../../library/email.compat32-message.rst:501 +#: ../../library/email.compat32-message.rst:500 msgid "" "Optional *header* if given, specifies the message header to use instead of :" "mailheader:`Content-Type`." @@ -769,7 +728,7 @@ msgstr "" "オプション引数 *header* が与えられた場合、 :mailheader:`Content-Type` のかわ" "りにそのヘッダが使用されます。" -#: ../../library/email.compat32-message.rst:504 +#: ../../library/email.compat32-message.rst:503 msgid "" "Parameter keys are always compared case insensitively. The return value can " "either be a string, or a 3-tuple if the parameter was :rfc:`2231` encoded. " @@ -785,7 +744,7 @@ msgstr "" "の場合 ``VALUE`` は ``us-ascii`` 文字セットでエンコードされているとみなさなけ" "ればならないので注意してください。普段は ``LANGUAGE`` を無視できます。" -#: ../../library/email.compat32-message.rst:512 +#: ../../library/email.compat32-message.rst:511 msgid "" "If your application doesn't care whether the parameter was encoded as in :" "rfc:`2231`, you can collapse the parameter value by calling :func:`email." @@ -800,13 +759,7 @@ msgstr "" "は適切にデコードされた Unicode 文字列を返し、そうでない場合は unquote された" "元の文字列を返します。たとえば::" -#: ../../library/email.compat32-message.rst:519 -msgid "" -"rawparam = msg.get_param('foo')\n" -"param = email.utils.collapse_rfc2231_value(rawparam)" -msgstr "" - -#: ../../library/email.compat32-message.rst:522 +#: ../../library/email.compat32-message.rst:521 msgid "" "In any case, the parameter value (either the returned string, or the " "``VALUE`` item in the 3-tuple) is always unquoted, unless *unquote* is set " @@ -816,7 +769,7 @@ msgstr "" "れ) つねに unquote されます。ただし、*unquote* が ``False`` に指定されている" "場合は unquote されません。" -#: ../../library/email.compat32-message.rst:535 +#: ../../library/email.compat32-message.rst:534 msgid "" "Set a parameter in the :mailheader:`Content-Type` header. If the parameter " "already exists in the header, its value will be replaced with *value*. If " @@ -830,7 +783,7 @@ msgstr "" "合、 :rfc:`2045` にしたがいこの値には :mimetype:`text/plain` が設定され、新し" "いパラメータ値が末尾に追加されます。" -#: ../../library/email.compat32-message.rst:541 +#: ../../library/email.compat32-message.rst:540 msgid "" "Optional *header* specifies an alternative header to :mailheader:`Content-" "Type`, and all parameters will be quoted as necessary unless optional " @@ -840,7 +793,7 @@ msgstr "" "りにそのヘッダが使用されます。オプション引数 *requote* が ``False`` でない限" "り、この値は quote されます (デフォルトは ``True``)。" -#: ../../library/email.compat32-message.rst:545 +#: ../../library/email.compat32-message.rst:544 msgid "" "If optional *charset* is specified, the parameter will be encoded according " "to :rfc:`2231`. Optional *language* specifies the RFC 2231 language, " @@ -852,18 +805,18 @@ msgstr "" "すが、デフォルトではこれは空文字列となります。 *charset* と *language* はどち" "らも文字列である必要があります。" -#: ../../library/email.compat32-message.rst:550 +#: ../../library/email.compat32-message.rst:549 msgid "" "If *replace* is ``False`` (the default) the header is moved to the end of " "the list of headers. If *replace* is ``True``, the header will be updated " "in place." msgstr "" -#: ../../library/email.compat32-message.rst:554 +#: ../../library/email.compat32-message.rst:553 msgid "``replace`` keyword was added." msgstr "``replace`` キーワードが追加されました。" -#: ../../library/email.compat32-message.rst:559 +#: ../../library/email.compat32-message.rst:558 msgid "" "Remove the given parameter completely from the :mailheader:`Content-Type` " "header. The header will be re-written in place without the parameter or its " @@ -877,7 +830,7 @@ msgstr "" "じて quote されます。オプション変数 *header* が与えられた場合、 :mailheader:" "`Content-Type` のかわりにそのヘッダが使用されます。" -#: ../../library/email.compat32-message.rst:568 +#: ../../library/email.compat32-message.rst:567 msgid "" "Set the main type and subtype for the :mailheader:`Content-Type` header. " "*type* must be a string in the form :mimetype:`maintype/subtype`, otherwise " @@ -887,7 +840,7 @@ msgstr "" "*type* は :mimetype:`maintype/subtype` という形の文字列でなければなりません。" "それ以外の場合は :exc:`ValueError` が発生します。" -#: ../../library/email.compat32-message.rst:572 +#: ../../library/email.compat32-message.rst:571 msgid "" "This method replaces the :mailheader:`Content-Type` header, keeping all the " "parameters in place. If *requote* is ``False``, this leaves the existing " @@ -899,7 +852,7 @@ msgstr "" "するヘッダを quote せず放置しますが、そうでない場合は自動的に quote します " "(デフォルト動作)。" -#: ../../library/email.compat32-message.rst:577 +#: ../../library/email.compat32-message.rst:576 msgid "" "An alternative header can be specified in the *header* argument. When the :" "mailheader:`Content-Type` header is set a :mailheader:`MIME-Version` header " @@ -909,13 +862,13 @@ msgstr "" "りにそのヘッダが使用されます。 :mailheader:`Content-Type` ヘッダが設定される" "場合には、 :mailheader:`MIME-Version` ヘッダも同時に付加されます。" -#: ../../library/email.compat32-message.rst:581 +#: ../../library/email.compat32-message.rst:580 msgid "" "This is a legacy method. On the :class:`~email.emailmessage.EmailMessage` " "class its functionality is replaced by the ``make_`` and ``add_`` methods." msgstr "" -#: ../../library/email.compat32-message.rst:588 +#: ../../library/email.compat32-message.rst:587 msgid "" "Return the value of the ``filename`` parameter of the :mailheader:`Content-" "Disposition` header of the message. If the header does not have a " @@ -930,7 +883,7 @@ msgstr "" "探します。それも無い場合またはヘッダが無い場合には *failobj* が返されます。返" "される文字列はつねに :func:`email.utils.unquote` によって unquote されます。" -#: ../../library/email.compat32-message.rst:599 +#: ../../library/email.compat32-message.rst:598 msgid "" "Return the value of the ``boundary`` parameter of the :mailheader:`Content-" "Type` header of the message, or *failobj* if either the header is missing, " @@ -942,7 +895,7 @@ msgstr "" "がない場合には *failobj* が返されます。返される文字列はつねに :func:`email." "utils.unquote` によって unquote されます。" -#: ../../library/email.compat32-message.rst:607 +#: ../../library/email.compat32-message.rst:606 msgid "" "Set the ``boundary`` parameter of the :mailheader:`Content-Type` header to " "*boundary*. :meth:`set_boundary` will always quote *boundary* if " @@ -954,7 +907,7 @@ msgstr "" "quote します。そのメッセージが :mailheader:`Content-Type` ヘッダを含んでいな" "い場合、 :exc:`~email.errors.HeaderParseError` が発生します。" -#: ../../library/email.compat32-message.rst:612 +#: ../../library/email.compat32-message.rst:611 msgid "" "Note that using this method is subtly different than deleting the old :" "mailheader:`Content-Type` header and adding a new one with the new boundary " @@ -969,7 +922,7 @@ msgstr "" "ヘッダの位置を保つからです。しかし、これは元の :mailheader:`Content-Type` " "ヘッダ中に存在していた連続する行の順番までは *保ちません* 。" -#: ../../library/email.compat32-message.rst:622 +#: ../../library/email.compat32-message.rst:621 msgid "" "Return the ``charset`` parameter of the :mailheader:`Content-Type` header, " "coerced to lower case. If there is no :mailheader:`Content-Type` header, or " @@ -980,7 +933,7 @@ msgstr "" "mailheader:`Content-Type` がなかったり、このヘッダ中に ``charaset`` パラメー" "タがない場合には *failobj* が返されます。" -#: ../../library/email.compat32-message.rst:626 +#: ../../library/email.compat32-message.rst:625 msgid "" "Note that this method differs from :meth:`get_charset` which returns the :" "class:`~email.charset.Charset` instance for the default encoding of the " @@ -990,7 +943,7 @@ msgstr "" "のかわりに、そのメッセージボディのデフォルトエンコーディングの :class:" "`~email.charset.Charset` インスタンスを返します。" -#: ../../library/email.compat32-message.rst:632 +#: ../../library/email.compat32-message.rst:631 msgid "" "Return a list containing the character set names in the message. If the " "message is a :mimetype:`multipart`, then the list will contain one element " @@ -1001,7 +954,7 @@ msgstr "" "の subpart のペイロードに対応します。それ以外の場合、これは長さ 1 のリストを" "返します。" -#: ../../library/email.compat32-message.rst:636 +#: ../../library/email.compat32-message.rst:635 msgid "" "Each item in the list will be a string which is the value of the ``charset`` " "parameter in the :mailheader:`Content-Type` header for the represented " @@ -1015,7 +968,7 @@ msgstr "" "あるいは MIME maintype が :mimetype:`text` でないいずれかの場合には、リストの" "要素として *failobj* が返されます。" -#: ../../library/email.compat32-message.rst:646 +#: ../../library/email.compat32-message.rst:645 msgid "" "Return the lowercased value (without parameters) of the message's :" "mailheader:`Content-Disposition` header if it has one, or ``None``. The " @@ -1023,7 +976,7 @@ msgid "" "the message follows :rfc:`2183`." msgstr "" -#: ../../library/email.compat32-message.rst:655 +#: ../../library/email.compat32-message.rst:654 msgid "" "The :meth:`walk` method is an all-purpose generator which can be used to " "iterate over all the parts and subparts of a message object tree, in depth-" @@ -1036,7 +989,7 @@ msgstr "" "レータとして使うことでしょう。ループを一回まわるごとに、次の subpart が返され" "るのです。" -#: ../../library/email.compat32-message.rst:660 +#: ../../library/email.compat32-message.rst:659 msgid "" "Here's an example that prints the MIME type of every part of a multipart " "message structure:" @@ -1044,20 +997,7 @@ msgstr "" "以下の例は、 multipart メッセージのすべての part において、その MIME タイプを" "表示していくものです。 :" -#: ../../library/email.compat32-message.rst:674 -msgid "" -">>> for part in msg.walk():\n" -"... print(part.get_content_type())\n" -"multipart/report\n" -"text/plain\n" -"message/delivery-status\n" -"text/plain\n" -"text/plain\n" -"message/rfc822\n" -"text/plain" -msgstr "" - -#: ../../library/email.compat32-message.rst:686 +#: ../../library/email.compat32-message.rst:685 msgid "" "``walk`` iterates over the subparts of any part where :meth:`is_multipart` " "returns ``True``, even though ``msg.get_content_maintype() == 'multipart'`` " @@ -1065,36 +1005,14 @@ msgid "" "``_structure`` debug helper function:" msgstr "" -#: ../../library/email.compat32-message.rst:692 -msgid "" -">>> for part in msg.walk():\n" -"... print(part.get_content_maintype() == 'multipart',\n" -"... part.is_multipart())\n" -"True True\n" -"False False\n" -"False True\n" -"False False\n" -"False False\n" -"False True\n" -"False False\n" -">>> _structure(msg)\n" -"multipart/report\n" -" text/plain\n" -" message/delivery-status\n" -" text/plain\n" -" text/plain\n" -" message/rfc822\n" -" text/plain" -msgstr "" - -#: ../../library/email.compat32-message.rst:713 +#: ../../library/email.compat32-message.rst:712 msgid "" "Here the ``message`` parts are not ``multiparts``, but they do contain " "subparts. ``is_multipart()`` returns ``True`` and ``walk`` descends into the " "subparts." msgstr "" -#: ../../library/email.compat32-message.rst:718 +#: ../../library/email.compat32-message.rst:717 msgid "" ":class:`Message` objects can also optionally contain two instance " "attributes, which can be used when generating the plain text of a MIME " @@ -1104,7 +1022,7 @@ msgstr "" "とができます。これはある MIME メッセージからプレーンテキストを生成するのに使" "うことができます。" -#: ../../library/email.compat32-message.rst:724 +#: ../../library/email.compat32-message.rst:723 msgid "" "The format of a MIME document allows for some text between the blank line " "following the headers, and the first multipart boundary string. Normally, " @@ -1120,7 +1038,7 @@ msgstr "" "セージのテキストを生で見る場合、あるいはメッセージを MIME 対応していないメー" "ルソフトで見る場合、このテキストは目に見えることになります。" -#: ../../library/email.compat32-message.rst:731 +#: ../../library/email.compat32-message.rst:730 msgid "" "The *preamble* attribute contains this leading extra-armor text for MIME " "documents. When the :class:`~email.parser.Parser` discovers some text after " @@ -1140,7 +1058,7 @@ msgstr "" "と最初の MIME 境界の間に挿入します。詳細は :mod:`email.parser` および :mod:" "`email.generator` を参照してください。" -#: ../../library/email.compat32-message.rst:741 +#: ../../library/email.compat32-message.rst:740 msgid "" "Note that if the message object has no preamble, the *preamble* attribute " "will be ``None``." @@ -1148,7 +1066,7 @@ msgstr "" "注意: そのメッセージに preamble がない場合、*preamble* 属性には ``None`` が格" "納されます。" -#: ../../library/email.compat32-message.rst:747 +#: ../../library/email.compat32-message.rst:746 msgid "" "The *epilogue* attribute acts the same way as the *preamble* attribute, " "except that it contains text that appears between the last boundary and the " @@ -1157,7 +1075,7 @@ msgstr "" "*epilogue* 属性はメッセージの最後の MIME 境界文字列からメッセージ末尾までのテ" "キストを含むもので、それ以外は *preamble* 属性と同じです。" -#: ../../library/email.compat32-message.rst:751 +#: ../../library/email.compat32-message.rst:750 msgid "" "You do not need to set the epilogue to the empty string in order for the :" "class:`~email.generator.Generator` to print a newline at the end of the file." @@ -1165,7 +1083,7 @@ msgstr "" ":class:`~email.generator.Generator` でファイル終端に改行を出力するため、 " "epilogue に空文字列を設定する必要はなくなりました。" -#: ../../library/email.compat32-message.rst:758 +#: ../../library/email.compat32-message.rst:757 msgid "" "The *defects* attribute contains a list of all the problems found when " "parsing this message. See :mod:`email.errors` for a detailed description of " diff --git a/library/email.contentmanager.po b/library/email.contentmanager.po index 77f3da096..681977393 100644 --- a/library/email.contentmanager.po +++ b/library/email.contentmanager.po @@ -1,31 +1,32 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 -# Tetsuo Koyama , 2021 +# 秘湯 , 2017 +# E. Kawashima, 2017 +# Tetsuo Koyama , 2020 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 01:04+0000\n" -"Last-Translator: Tetsuo Koyama , 2021\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 23:07+0000\n" +"Last-Translator: Tetsuo Koyama , 2020\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/email.contentmanager.rst:2 -msgid ":mod:`!email.contentmanager`: Managing MIME Content" -msgstr "" +msgid ":mod:`email.contentmanager`: Managing MIME Content" +msgstr ":mod:`email.contentmanager`: MIME 内容の管理" #: ../../library/email.contentmanager.rst:10 msgid "**Source code:** :source:`Lib/email/contentmanager.py`" @@ -103,46 +104,46 @@ msgid "" msgstr "型の完全修飾名 (``typ.__module__ + '.' + typ.__qualname__``)." #: ../../library/email.contentmanager.rst:61 -msgid "the type's :attr:`qualname ` (``typ.__qualname__``)" -msgstr "" +msgid "the type's qualname (``typ.__qualname__``)" +msgstr "型の qualname (``typ.__qualname__``)" #: ../../library/email.contentmanager.rst:62 -msgid "the type's :attr:`name ` (``typ.__name__``)." -msgstr "" +msgid "the type's name (``typ.__name__``)." +msgstr "型の name (``typ.__name__``)." #: ../../library/email.contentmanager.rst:64 msgid "" "If none of the above match, repeat all of the checks above for each of the " -"types in the :term:`MRO` (:attr:`typ.__mro__ `). Finally, if " -"no other key yields a handler, check for a handler for the key ``None``. If " -"there is no handler for ``None``, raise a :exc:`KeyError` for the fully " -"qualified name of the type." +"types in the :term:`MRO` (``typ.__mro__``). Finally, if no other key yields " +"a handler, check for a handler for the key ``None``. If there is no handler " +"for ``None``, raise a :exc:`KeyError` for the fully qualified name of the " +"type." msgstr "" -#: ../../library/email.contentmanager.rst:71 +#: ../../library/email.contentmanager.rst:70 msgid "" "Also add a :mailheader:`MIME-Version` header if one is not present (see " "also :class:`.MIMEPart`)." msgstr "" -#: ../../library/email.contentmanager.rst:77 +#: ../../library/email.contentmanager.rst:76 msgid "" "Record the function *handler* as the handler for *key*. For the possible " "values of *key*, see :meth:`get_content`." msgstr "" -#: ../../library/email.contentmanager.rst:83 +#: ../../library/email.contentmanager.rst:82 msgid "" "Record *handler* as the function to call when an object of a type matching " "*typekey* is passed to :meth:`set_content`. For the possible values of " "*typekey*, see :meth:`set_content`." msgstr "" -#: ../../library/email.contentmanager.rst:89 +#: ../../library/email.contentmanager.rst:88 msgid "Content Manager Instances" msgstr "" -#: ../../library/email.contentmanager.rst:91 +#: ../../library/email.contentmanager.rst:90 msgid "" "Currently the email package provides only one concrete content manager, :" "data:`raw_data_manager`, although more may be added in the future. :data:" @@ -150,7 +151,7 @@ msgid "" "provided by :attr:`~email.policy.EmailPolicy` and its derivatives." msgstr "" -#: ../../library/email.contentmanager.rst:100 +#: ../../library/email.contentmanager.rst:99 msgid "" "This content manager provides only a minimum interface beyond that provided " "by :class:`~email.message.Message` itself: it deals only with text, raw " @@ -163,7 +164,7 @@ msgid "" "simplifying the creation of multipart messages." msgstr "" -#: ../../library/email.contentmanager.rst:112 +#: ../../library/email.contentmanager.rst:111 msgid "" "Return the payload of the part as either a string (for ``text`` parts), an :" "class:`~email.message.EmailMessage` object (for ``message/rfc822`` parts), " @@ -173,28 +174,28 @@ msgid "" "to unicode. The default error handler is ``replace``." msgstr "" -#: ../../library/email.contentmanager.rst:131 +#: ../../library/email.contentmanager.rst:130 msgid "Add headers and payload to *msg*:" msgstr "" -#: ../../library/email.contentmanager.rst:133 +#: ../../library/email.contentmanager.rst:132 msgid "" "Add a :mailheader:`Content-Type` header with a ``maintype/subtype`` value." msgstr "" -#: ../../library/email.contentmanager.rst:136 +#: ../../library/email.contentmanager.rst:135 msgid "" "For ``str``, set the MIME ``maintype`` to ``text``, and set the subtype to " "*subtype* if it is specified, or ``plain`` if it is not." msgstr "" -#: ../../library/email.contentmanager.rst:138 +#: ../../library/email.contentmanager.rst:137 msgid "" "For ``bytes``, use the specified *maintype* and *subtype*, or raise a :exc:" "`TypeError` if they are not specified." msgstr "" -#: ../../library/email.contentmanager.rst:140 +#: ../../library/email.contentmanager.rst:139 msgid "" "For :class:`~email.message.EmailMessage` objects, set the maintype to " "``message``, and set the subtype to *subtype* if it is specified or " @@ -202,7 +203,7 @@ msgid "" "(``bytes`` objects must be used to construct ``message/partial`` parts)." msgstr "" -#: ../../library/email.contentmanager.rst:146 +#: ../../library/email.contentmanager.rst:145 msgid "" "If *charset* is provided (which is valid only for ``str``), encode the " "string to bytes using the specified character set. The default is " @@ -210,7 +211,7 @@ msgid "" "charset name, use the standard charset instead." msgstr "" -#: ../../library/email.contentmanager.rst:151 +#: ../../library/email.contentmanager.rst:150 msgid "" "If *cte* is set, encode the payload using the specified content transfer " "encoding, and set the :mailheader:`Content-Transfer-Encoding` header to that " @@ -220,22 +221,13 @@ msgid "" "that contains non-ASCII values), raise a :exc:`ValueError`." msgstr "" -#: ../../library/email.contentmanager.rst:159 +#: ../../library/email.contentmanager.rst:158 msgid "" "For ``str`` objects, if *cte* is not set use heuristics to determine the " -"most compact encoding. Prior to encoding, :meth:`str.splitlines` is used to " -"normalize all line boundaries, ensuring that each line of the payload is " -"terminated by the current policy's :data:`~email.policy.Policy.linesep` " -"property (even if the original string did not end with one)." -msgstr "" - -#: ../../library/email.contentmanager.rst:165 -msgid "" -"For ``bytes`` objects, *cte* is taken to be base64 if not set, and the " -"aforementioned newline translation is not performed." +"most compact encoding." msgstr "" -#: ../../library/email.contentmanager.rst:167 +#: ../../library/email.contentmanager.rst:160 msgid "" "For :class:`~email.message.EmailMessage`, per :rfc:`2046`, raise an error if " "a *cte* of ``quoted-printable`` or ``base64`` is requested for *subtype* " @@ -244,14 +236,14 @@ msgid "" "For all other values of *subtype*, use ``7bit``." msgstr "" -#: ../../library/email.contentmanager.rst:174 +#: ../../library/email.contentmanager.rst:167 msgid "" "A *cte* of ``binary`` does not actually work correctly yet. The " "``EmailMessage`` object as modified by ``set_content`` is correct, but :" "class:`~email.generator.BytesGenerator` does not serialize it correctly." msgstr "" -#: ../../library/email.contentmanager.rst:179 +#: ../../library/email.contentmanager.rst:172 msgid "" "If *disposition* is set, use it as the value of the :mailheader:`Content-" "Disposition` header. If not specified, and *filename* is specified, add the " @@ -260,37 +252,37 @@ msgid "" "values for *disposition* are ``attachment`` and ``inline``." msgstr "" -#: ../../library/email.contentmanager.rst:186 +#: ../../library/email.contentmanager.rst:179 msgid "" "If *filename* is specified, use it as the value of the ``filename`` " "parameter of the :mailheader:`Content-Disposition` header." msgstr "" -#: ../../library/email.contentmanager.rst:189 +#: ../../library/email.contentmanager.rst:182 msgid "" "If *cid* is specified, add a :mailheader:`Content-ID` header with *cid* as " "its value." msgstr "" -#: ../../library/email.contentmanager.rst:192 +#: ../../library/email.contentmanager.rst:185 msgid "" "If *params* is specified, iterate its ``items`` method and use the resulting " "``(key, value)`` pairs to set additional parameters on the :mailheader:" "`Content-Type` header." msgstr "" -#: ../../library/email.contentmanager.rst:196 +#: ../../library/email.contentmanager.rst:189 msgid "" "If *headers* is specified and is a list of strings of the form ``headername: " "headervalue`` or a list of ``header`` objects (distinguished from strings by " "having a ``name`` attribute), add the headers to *msg*." msgstr "" -#: ../../library/email.contentmanager.rst:203 +#: ../../library/email.contentmanager.rst:196 msgid "Footnotes" msgstr "脚注" -#: ../../library/email.contentmanager.rst:204 +#: ../../library/email.contentmanager.rst:197 msgid "" "Originally added in 3.4 as a :term:`provisional module `" msgstr "" diff --git a/library/email.encoders.po b/library/email.encoders.po index 5a0f545e6..e405cfa64 100644 --- a/library/email.encoders.po +++ b/library/email.encoders.po @@ -1,32 +1,34 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 -# Tetsuo Koyama , 2021 -# 石井明久, 2024 +# Nozomu Kaneko , 2017 +# 秘湯 , 2017 +# Arihiro TAKASE, 2017 +# tomo, 2019 +# Tetsuo Koyama , 2020 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-13 14:21+0000\n" -"PO-Revision-Date: 2021-06-28 01:04+0000\n" -"Last-Translator: 石井明久, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 23:08+0000\n" +"Last-Translator: Tetsuo Koyama , 2020\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/email.encoders.rst:2 -msgid ":mod:`!email.encoders`: Encoders" -msgstr ":mod:`!email.encoders`: エンコーダー" +msgid ":mod:`email.encoders`: Encoders" +msgstr ":mod:`email.encoders`: エンコーダ" #: ../../library/email.encoders.rst:7 msgid "**Source code:** :source:`Lib/email/encoders.py`" @@ -75,22 +77,22 @@ msgstr "" #: ../../library/email.encoders.rst:27 msgid "" "The :mod:`email` package provides some convenient encoders in its :mod:" -"`~email.encoders` module. These encoders are actually used by the :class:" -"`~email.mime.audio.MIMEAudio` and :class:`~email.mime.image.MIMEImage` class " +"`encoders` module. These encoders are actually used by the :class:`~email." +"mime.audio.MIMEAudio` and :class:`~email.mime.image.MIMEImage` class " "constructors to provide default encodings. All encoder functions take " "exactly one argument, the message object to encode. They usually extract " "the payload, encode it, and reset the payload to this newly encoded value. " "They should also set the :mailheader:`Content-Transfer-Encoding` header as " "appropriate." msgstr "" -":mod:`email` パッケージでは、 :mod:`~email.encoders` モジュールにおいていくか" -"の便宜的なエンコーダをサポートしています。実際にはこれらのエンコーダは :" -"class:`~email.mime.audio.MIMEAudio` および :class:`~email.mime.image." -"MIMEImage` クラスのコンストラクタでデフォルトエンコーダとして使われています。" -"すべてのエンコーディング関数は、エンコードするメッセージオブジェクトひとつだ" -"けを引数にとります。これらはふつうペイロードを取りだし、それをエンコードし" -"て、ペイロードをエンコードされたものにセットしなおします。これらはまた :" -"mailheader:`Content-Transfer-Encoding` ヘッダを適切な値に設定します。" +":mod:`email` パッケージでは、 :mod:`encoders` モジュールにおいていくかの便宜" +"的なエンコーダをサポートしています。実際にはこれらのエンコーダは :class:" +"`~email.mime.audio.MIMEAudio` および :class:`~email.mime.image.MIMEImage` ク" +"ラスのコンストラクタでデフォルトエンコーダとして使われています。すべてのエン" +"コーディング関数は、エンコードするメッセージオブジェクトひとつだけを引数にと" +"ります。これらはふつうペイロードを取りだし、それをエンコードして、ペイロード" +"をエンコードされたものにセットしなおします。これらはまた :mailheader:" +"`Content-Transfer-Encoding` ヘッダを適切な値に設定します。" #: ../../library/email.encoders.rst:35 msgid "" diff --git a/library/email.errors.po b/library/email.errors.po index f1f958bfb..7479775ae 100644 --- a/library/email.errors.po +++ b/library/email.errors.po @@ -1,31 +1,34 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: +# Ikuru K , 2017 +# Arihiro TAKASE, 2017 +# E. Kawashima, 2017 +# Nozomu Kaneko , 2017 # Takanori Suzuki , 2021 -# tomo, 2021 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 01:05+0000\n" -"Last-Translator: tomo, 2021\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 23:08+0000\n" +"Last-Translator: Takanori Suzuki , 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/email.errors.rst:2 -msgid ":mod:`!email.errors`: Exception and Defect classes" -msgstr "" +msgid ":mod:`email.errors`: Exception and Defect classes" +msgstr ":mod:`email.errors`: 例外及び欠陥クラス" #: ../../library/email.errors.rst:7 msgid "**Source code:** :source:`Lib/email/errors.py`" @@ -73,31 +76,35 @@ msgstr "" #: ../../library/email.errors.rst:48 msgid "" -"Raised if the :meth:`~email.message.Message.attach` method is called on an " -"instance of a class derived from :class:`~email.mime.nonmultipart." -"MIMENonMultipart` (e.g. :class:`~email.mime.image.MIMEImage`). :exc:" -"`MultipartConversionError` multiply inherits from :exc:`MessageError` and " -"the built-in :exc:`TypeError`." -msgstr "" - -#: ../../library/email.errors.rst:58 -msgid "" -"Raised when an error occurs when the :mod:`~email.generator` outputs headers." -msgstr "" - -#: ../../library/email.errors.rst:64 -msgid "" -"This is the base class for all defects found when parsing email messages. It " -"is derived from :exc:`ValueError`." +"Raised when a payload is added to a :class:`~email.message.Message` object " +"using :meth:`add_payload`, but the payload is already a scalar and the " +"message's :mailheader:`Content-Type` main type is not either :mimetype:" +"`multipart` or missing. :exc:`MultipartConversionError` multiply inherits " +"from :exc:`MessageError` and the built-in :exc:`TypeError`." msgstr "" +"この例外は、 :class:`~email.message.Message` オブジェクトに :meth:" +"`add_payload` メソッドでペイロードを追加したが、そのペイロードがすでにスカ" +"ラー値で、メッセージの :mailheader:`Content-Type` メインタイプが :mimetype:" +"`multipart` でないか見付からない場合に送出されます。\n" +":exc:`MultipartConversionError` は :exc:`MessageError` と組み込みの :exc:" +"`TypeError` を多重継承しています。" -#: ../../library/email.errors.rst:69 +#: ../../library/email.errors.rst:54 msgid "" -"This is the base class for all defects found when parsing email headers. It " -"is derived from :exc:`MessageDefect`." +"Since :meth:`Message.add_payload` is deprecated, this exception is rarely " +"raised in practice. However the exception may also be raised if the :meth:" +"`~email.message.Message.attach` method is called on an instance of a class " +"derived from :class:`~email.mime.nonmultipart.MIMENonMultipart` (e.g. :class:" +"`~email.mime.image.MIMEImage`)." msgstr "" +":meth:`Message.add_payload` は非推奨なので、実際のところこの例外が送出される" +"ことはほとんどありません。\n" +"しかしながら、 :meth:`~email.message.Message.attach` メソッドを :class:" +"`~email.mime.nonmultipart.MIMENonMultipart` から派生したインスタンス (たとえ" +"ば :class:`~email.mime.image.MIMEImage`) に対して呼んだ場合にも送出されること" +"があります。" -#: ../../library/email.errors.rst:72 +#: ../../library/email.errors.rst:62 msgid "" "Here is the list of the defects that the :class:`~email.parser.FeedParser` " "can find while parsing messages. Note that the defects are added to the " @@ -112,85 +119,112 @@ msgstr "" "異常なヘッダをもっていた場合には、そのネストしたメッセージが障害を持っている" "が、その親メッセージには障害はないとみなされることに注意してください。" -#: ../../library/email.errors.rst:78 +#: ../../library/email.errors.rst:68 msgid "" "All defect classes are subclassed from :class:`email.errors.MessageDefect`." msgstr "" "すべての障害クラスは :class:`email.errors.MessageDefect` のサブクラスです。" -#: ../../library/email.errors.rst:82 +#: ../../library/email.errors.rst:70 msgid "" -"A message claimed to be a multipart, but had no :mimetype:`boundary` " -"parameter." +":class:`NoBoundaryInMultipartDefect` -- A message claimed to be a multipart, " +"but had no :mimetype:`boundary` parameter." msgstr "" +":class:`NoBoundaryInMultipartDefect` -- メッセージが multipart だと宣言されて" +"いるのに、 :mimetype:`boundary` パラメータがありません。" -#: ../../library/email.errors.rst:87 +#: ../../library/email.errors.rst:73 msgid "" -"The start boundary claimed in the :mailheader:`Content-Type` header was " -"never found." +":class:`StartBoundaryNotFoundDefect` -- The start boundary claimed in the :" +"mailheader:`Content-Type` header was never found." msgstr "" +":class:`StartBoundaryNotFoundDefect` -- :mailheader:`Content-Type` ヘッダで宣" +"言された開始境界がありません。" -#: ../../library/email.errors.rst:92 +#: ../../library/email.errors.rst:76 msgid "" -"A start boundary was found, but no corresponding close boundary was ever " -"found." +":class:`CloseBoundaryNotFoundDefect` -- A start boundary was found, but no " +"corresponding close boundary was ever found." msgstr "" +":class:`CloseBoundaryNotFoundDefect` -- 開始境界はあるが対応する終了境界があ" +"りません。" -#: ../../library/email.errors.rst:99 -msgid "The message had a continuation line as its first header line." +#: ../../library/email.errors.rst:81 +msgid "" +":class:`FirstHeaderLineIsContinuationDefect` -- The message had a " +"continuation line as its first header line." msgstr "" +":class:`FirstHeaderLineIsContinuationDefect` -- メッセージの最初のヘッダ行が" +"継続行です。" -#: ../../library/email.errors.rst:103 -msgid "A \"Unix From\" header was found in the middle of a header block." +#: ../../library/email.errors.rst:84 +msgid "" +":class:`MisplacedEnvelopeHeaderDefect` - A \"Unix From\" header was found in " +"the middle of a header block." msgstr "" +":class:`MisplacedEnvelopeHeaderDefect` -- ヘッダブロックの途中に \"Unix " +"From\" ヘッダがあります。" -#: ../../library/email.errors.rst:107 +#: ../../library/email.errors.rst:87 msgid "" -"A line was found while parsing headers that had no leading white space but " -"contained no ':'. Parsing continues assuming that the line represents the " -"first line of the body." +":class:`MissingHeaderBodySeparatorDefect` - A line was found while parsing " +"headers that had no leading white space but contained no ':'. Parsing " +"continues assuming that the line represents the first line of the body." msgstr "" +":class:`MissingHeaderBodySeparatorDefect` - 先頭に空白はないが ':' がないヘッ" +"ダの解析中に行が見付かりました。その行を本体の最初の行とみなして解析を続けま" +"す。" -#: ../../library/email.errors.rst:115 +#: ../../library/email.errors.rst:93 msgid "" -"A header was found that was missing a colon, or was otherwise malformed." +":class:`MalformedHeaderDefect` -- A header was found that was missing a " +"colon, or was otherwise malformed." msgstr "" +":class:`MalformedHeaderDefect` -- ヘッダにコロンがありません、あるいはそれ以" +"外の不正な形式です。" -#: ../../library/email.errors.rst:117 +#: ../../library/email.errors.rst:96 msgid "This defect has not been used for several Python versions." msgstr "この欠陥が使われていないPythonバージョンがいくつかあります。" -#: ../../library/email.errors.rst:122 -msgid "" -"A message claimed to be a :mimetype:`multipart`, but no subparts were found. " -"Note that when a message has this defect, its :meth:`~email.message.Message." -"is_multipart` method may return ``False`` even though its content type " -"claims to be :mimetype:`multipart`." -msgstr "" - -#: ../../library/email.errors.rst:129 +#: ../../library/email.errors.rst:99 msgid "" -"When decoding a block of base64 encoded bytes, the padding was not correct. " -"Enough padding is added to perform the decode, but the resulting decoded " -"bytes may be invalid." +":class:`MultipartInvariantViolationDefect` -- A message claimed to be a :" +"mimetype:`multipart`, but no subparts were found. Note that when a message " +"has this defect, its :meth:`~email.message.Message.is_multipart` method may " +"return ``False`` even though its content type claims to be :mimetype:" +"`multipart`." msgstr "" +":class:`MultipartInvariantViolationDefect` -- メッセージが :mimetype:" +"`multipart` だと宣言されているのに、サブパートが存在しません。\n" +"メッセージがこの欠陥を持つ場合、内容の型が :mimetype:`multipart` と宣言されて" +"いても :meth:`~email.message.Message.is_multipart` メソッドは ``False`` を返" +"すことがあるので注意してください。" -#: ../../library/email.errors.rst:135 +#: ../../library/email.errors.rst:104 msgid "" -"When decoding a block of base64 encoded bytes, characters outside the base64 " -"alphabet were encountered. The characters are ignored, but the resulting " -"decoded bytes may be invalid." +":class:`InvalidBase64PaddingDefect` -- When decoding a block of base64 " +"encoded bytes, the padding was not correct. Enough padding is added to " +"perform the decode, but the resulting decoded bytes may be invalid." msgstr "" +":class:`InvalidBase64PaddingDefect` -- 一連の base64 でエンコードされた " +"bytes をデコードしているときにパディングが誤っていました。\n" +"デコードするのに十分なパディングがなされますが、デコードされた bytes は不正か" +"もしれません。" -#: ../../library/email.errors.rst:141 +#: ../../library/email.errors.rst:108 msgid "" -"When decoding a block of base64 encoded bytes, the number of non-padding " -"base64 characters was invalid (1 more than a multiple of 4). The encoded " -"block was kept as-is." +":class:`InvalidBase64CharactersDefect` -- When decoding a block of base64 " +"encoded bytes, characters outside the base64 alphabet were encountered. The " +"characters are ignored, but the resulting decoded bytes may be invalid." msgstr "" +":class:`InvalidBase64CharactersDefect` -- 一連の base64 でエンコードされた " +"bytes をデコードしているときに base64 アルファベット外の文字がありました。\n" +"その文字は無視されますが、デコードされた bytes は不正かもしれません。" -#: ../../library/email.errors.rst:147 +#: ../../library/email.errors.rst:112 msgid "" -"When decoding an invalid or unparsable date field. The original value is " -"kept as-is." +":class:`InvalidBase64LengthDefect` -- When decoding a block of base64 " +"encoded bytes, the number of non-padding base64 characters was invalid (1 " +"more than a multiple of 4). The encoded block was kept as-is." msgstr "" diff --git a/library/email.examples.po b/library/email.examples.po index 28be7da46..62301439e 100644 --- a/library/email.examples.po +++ b/library/email.examples.po @@ -1,26 +1,26 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 -# 石井明久, 2024 +# 秘湯 , 2017 +# Arihiro TAKASE, 2017 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-06 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 01:05+0000\n" -"Last-Translator: 石井明久, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 23:08+0000\n" +"Last-Translator: Arihiro TAKASE, 2017\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/email.examples.rst:4 @@ -44,32 +44,6 @@ msgstr "" "最初に、シンプルなテキストメッセージ (テキストコンテンツとアドレスの両方がユ" "ニコード文字を含み得る) を作成・送信する方法を見てみましょう:" -#: ../../library/email.examples.rst:12 -msgid "" -"# Import smtplib for the actual sending function\n" -"import smtplib\n" -"\n" -"# Import the email modules we'll need\n" -"from email.message import EmailMessage\n" -"\n" -"# Open the plain text file whose name is in textfile for reading.\n" -"with open(textfile) as fp:\n" -" # Create a text/plain message\n" -" msg = EmailMessage()\n" -" msg.set_content(fp.read())\n" -"\n" -"# me == the sender's email address\n" -"# you == the recipient's email address\n" -"msg['Subject'] = f'The contents of {textfile}'\n" -"msg['From'] = me\n" -"msg['To'] = you\n" -"\n" -"# Send the message via our own SMTP server.\n" -"s = smtplib.SMTP('localhost')\n" -"s.send_message(msg)\n" -"s.quit()\n" -msgstr "" - #: ../../library/email.examples.rst:15 msgid "" "Parsing :rfc:`822` headers can easily be done by the using the classes from " @@ -78,35 +52,6 @@ msgstr "" ":rfc:`822` ヘッダーの解析は、 :mod:`~email.parser` モジュールにあるクラスを使" "用することにより、簡単に実現できます:" -#: ../../library/email.examples.rst:18 -msgid "" -"# Import the email modules we'll need\n" -"#from email.parser import BytesParser\n" -"from email.parser import Parser\n" -"from email.policy import default\n" -"\n" -"# If the e-mail headers are in a file, uncomment these two lines:\n" -"# with open(messagefile, 'rb') as fp:\n" -"# headers = BytesParser(policy=default).parse(fp)\n" -"\n" -"# Or for parsing headers in a string (this is an uncommon operation), use:\n" -"headers = Parser(policy=default).parsestr(\n" -" 'From: Foo Bar \\n'\n" -" 'To: \\n'\n" -" 'Subject: Test message\\n'\n" -" '\\n'\n" -" 'Body would go here\\n')\n" -"\n" -"# Now the header items can be accessed as a dictionary:\n" -"print('To: {}'.format(headers['to']))\n" -"print('From: {}'.format(headers['from']))\n" -"print('Subject: {}'.format(headers['subject']))\n" -"\n" -"# You can also access the parts of the addresses:\n" -"print('Recipient username: {}'.format(headers['to'].addresses[0].username))\n" -"print('Sender name: {}'.format(headers['from'].addresses[0].display_name))\n" -msgstr "" - #: ../../library/email.examples.rst:21 msgid "" "Here's an example of how to send a MIME message containing a bunch of family " @@ -115,36 +60,6 @@ msgstr "" "つぎに、あるディレクトリ内にある何枚かの家族写真をひとつの MIME メッセージに" "収めて送信する例です:" -#: ../../library/email.examples.rst:24 -msgid "" -"# Import smtplib for the actual sending function.\n" -"import smtplib\n" -"\n" -"# Here are the email package modules we'll need.\n" -"from email.message import EmailMessage\n" -"\n" -"# Create the container email message.\n" -"msg = EmailMessage()\n" -"msg['Subject'] = 'Our family reunion'\n" -"# me == the sender's email address\n" -"# family = the list of all recipients' email addresses\n" -"msg['From'] = me\n" -"msg['To'] = ', '.join(family)\n" -"msg.preamble = 'You will not see this in a MIME-aware mail reader.\\n'\n" -"\n" -"# Open the files in binary mode. You can also omit the subtype\n" -"# if you want MIMEImage to guess it.\n" -"for file in pngfiles:\n" -" with open(file, 'rb') as fp:\n" -" img_data = fp.read()\n" -" msg.add_attachment(img_data, maintype='image',\n" -" subtype='png')\n" -"\n" -"# Send the email via our own SMTP server.\n" -"with smtplib.SMTP('localhost') as s:\n" -" s.send_message(msg)\n" -msgstr "" - #: ../../library/email.examples.rst:27 msgid "" "Here's an example of how to send the entire contents of a directory as an " @@ -153,94 +68,6 @@ msgstr "" "つぎはあるディレクトリに含まれている内容全体をひとつの電子メールメッセージと" "して送信するやり方です: [1]_" -#: ../../library/email.examples.rst:30 -msgid "" -"#!/usr/bin/env python3\n" -"\n" -"\"\"\"Send the contents of a directory as a MIME message.\"\"\"\n" -"\n" -"import os\n" -"import smtplib\n" -"# For guessing MIME type based on file name extension\n" -"import mimetypes\n" -"\n" -"from argparse import ArgumentParser\n" -"\n" -"from email.message import EmailMessage\n" -"from email.policy import SMTP\n" -"\n" -"\n" -"def main():\n" -" parser = ArgumentParser(description=\"\"\"\\\n" -"Send the contents of a directory as a MIME message.\n" -"Unless the -o option is given, the email is sent by forwarding to your " -"local\n" -"SMTP server, which then does the normal delivery process. Your local " -"machine\n" -"must be running an SMTP server.\n" -"\"\"\")\n" -" parser.add_argument('-d', '--directory',\n" -" help=\"\"\"Mail the contents of the specified " -"directory,\n" -" otherwise use the current directory. Only the " -"regular\n" -" files in the directory are sent, and we don't " -"recurse to\n" -" subdirectories.\"\"\")\n" -" parser.add_argument('-o', '--output',\n" -" metavar='FILE',\n" -" help=\"\"\"Print the composed message to FILE " -"instead of\n" -" sending the message to the SMTP server.\"\"\")\n" -" parser.add_argument('-s', '--sender', required=True,\n" -" help='The value of the From: header (required)')\n" -" parser.add_argument('-r', '--recipient', required=True,\n" -" action='http://github.com/append', metavar='RECIPIENT',\n" -" default=[], dest='recipients',\n" -" help='A To: header value (at least one required)')\n" -" args = parser.parse_args()\n" -" directory = args.directory\n" -" if not directory:\n" -" directory = '.'\n" -" # Create the message\n" -" msg = EmailMessage()\n" -" msg['Subject'] = f'Contents of directory {os.path.abspath(directory)}'\n" -" msg['To'] = ', '.join(args.recipients)\n" -" msg['From'] = args.sender\n" -" msg.preamble = 'You will not see this in a MIME-aware mail reader.\\n'\n" -"\n" -" for filename in os.listdir(directory):\n" -" path = os.path.join(directory, filename)\n" -" if not os.path.isfile(path):\n" -" continue\n" -" # Guess the content type based on the file's extension. Encoding\n" -" # will be ignored, although we should check for simple things like\n" -" # gzip'd or compressed files.\n" -" ctype, encoding = mimetypes.guess_file_type(path)\n" -" if ctype is None or encoding is not None:\n" -" # No guess could be made, or the file is encoded (compressed), " -"so\n" -" # use a generic bag-of-bits type.\n" -" ctype = 'application/octet-stream'\n" -" maintype, subtype = ctype.split('/', 1)\n" -" with open(path, 'rb') as fp:\n" -" msg.add_attachment(fp.read(),\n" -" maintype=maintype,\n" -" subtype=subtype,\n" -" filename=filename)\n" -" # Now send or store the message\n" -" if args.output:\n" -" with open(args.output, 'wb') as fp:\n" -" fp.write(msg.as_bytes(policy=SMTP))\n" -" else:\n" -" with smtplib.SMTP('localhost') as s:\n" -" s.send_message(msg)\n" -"\n" -"\n" -"if __name__ == '__main__':\n" -" main()\n" -msgstr "" - #: ../../library/email.examples.rst:33 msgid "" "Here's an example of how to unpack a MIME message like the one above, into a " @@ -249,64 +76,6 @@ msgstr "" "つぎに、上のような MIME メッセージをどうやって展開してひとつのディレクトリ上" "の複数ファイルにするかを示します:" -#: ../../library/email.examples.rst:36 -msgid "" -"#!/usr/bin/env python3\n" -"\n" -"\"\"\"Unpack a MIME message into a directory of files.\"\"\"\n" -"\n" -"import os\n" -"import email\n" -"import mimetypes\n" -"\n" -"from email.policy import default\n" -"\n" -"from argparse import ArgumentParser\n" -"\n" -"\n" -"def main():\n" -" parser = ArgumentParser(description=\"\"\"\\\n" -"Unpack a MIME message into a directory of files.\n" -"\"\"\")\n" -" parser.add_argument('-d', '--directory', required=True,\n" -" help=\"\"\"Unpack the MIME message into the named\n" -" directory, which will be created if it doesn't " -"already\n" -" exist.\"\"\")\n" -" parser.add_argument('msgfile')\n" -" args = parser.parse_args()\n" -"\n" -" with open(args.msgfile, 'rb') as fp:\n" -" msg = email.message_from_binary_file(fp, policy=default)\n" -"\n" -" try:\n" -" os.mkdir(args.directory)\n" -" except FileExistsError:\n" -" pass\n" -"\n" -" counter = 1\n" -" for part in msg.walk():\n" -" # multipart/* are just containers\n" -" if part.get_content_maintype() == 'multipart':\n" -" continue\n" -" # Applications should really sanitize the given filename so that an\n" -" # email message can't be used to overwrite important files\n" -" filename = part.get_filename()\n" -" if not filename:\n" -" ext = mimetypes.guess_extension(part.get_content_type())\n" -" if not ext:\n" -" # Use a generic bag-of-bits extension\n" -" ext = '.bin'\n" -" filename = f'part-{counter:03d}{ext}'\n" -" counter += 1\n" -" with open(os.path.join(args.directory, filename), 'wb') as fp:\n" -" fp.write(part.get_payload(decode=True))\n" -"\n" -"\n" -"if __name__ == '__main__':\n" -" main()\n" -msgstr "" - #: ../../library/email.examples.rst:39 msgid "" "Here's an example of how to create an HTML message with an alternative plain " @@ -318,69 +87,6 @@ msgstr "" "す。もう少し面白くするために、 HTML 部分に関連する画像を追加し、さらに送信だ" "けでなく、送信しようとしているもののコピーをディスクにも保存してみます。" -#: ../../library/email.examples.rst:44 -msgid "" -"#!/usr/bin/env python3\n" -"\n" -"import smtplib\n" -"\n" -"from email.message import EmailMessage\n" -"from email.headerregistry import Address\n" -"from email.utils import make_msgid\n" -"\n" -"# Create the base text message.\n" -"msg = EmailMessage()\n" -"msg['Subject'] = \"Pourquoi pas des asperges pour ce midi ?\"\n" -"msg['From'] = Address(\"Pepé Le Pew\", \"pepe\", \"example.com\")\n" -"msg['To'] = (Address(\"Penelope Pussycat\", \"penelope\", \"example.com\"),\n" -" Address(\"Fabrette Pussycat\", \"fabrette\", \"example.com\"))\n" -"msg.set_content(\"\"\"\\\n" -"Salut!\n" -"\n" -"Cette recette [1] sera sûrement un très bon repas.\n" -"\n" -"[1] http://www.yummly.com/recipe/Roasted-Asparagus-Epicurious-203718\n" -"\n" -"--Pepé\n" -"\"\"\")\n" -"\n" -"# Add the html version. This converts the message into a multipart/" -"alternative\n" -"# container, with the original text message as the first part and the new " -"html\n" -"# message as the second part.\n" -"asparagus_cid = make_msgid()\n" -"msg.add_alternative(\"\"\"\\\n" -"\n" -" \n" -" \n" -"

Salut!

\n" -"

Cette\n" -" \n" -" recette\n" -" sera sûrement un très bon repas.\n" -"

\n" -" \n" -" \n" -"\n" -"\"\"\".format(asparagus_cid=asparagus_cid[1:-1]), subtype='html')\n" -"# note that we needed to peel the <> off the msgid for use in the html.\n" -"\n" -"# Now add the related image to the html part.\n" -"with open(\"roasted-asparagus.jpg\", 'rb') as img:\n" -" msg.get_payload()[1].add_related(img.read(), 'image', 'jpeg',\n" -" cid=asparagus_cid)\n" -"\n" -"# Make a local copy of what we are going to send.\n" -"with open('outgoing.msg', 'wb') as f:\n" -" f.write(bytes(msg))\n" -"\n" -"# Send the message via local SMTP server.\n" -"with smtplib.SMTP('localhost') as s:\n" -" s.send_message(msg)\n" -msgstr "" - #: ../../library/email.examples.rst:47 msgid "" "If we were sent the message from the last example, here is one way we could " @@ -389,113 +95,10 @@ msgstr "" "前の例のメッセージが送信されてきたら、これを処理する方法の一つは次のようなも" "のです:" -#: ../../library/email.examples.rst:50 -msgid "" -"import os\n" -"import sys\n" -"import tempfile\n" -"import mimetypes\n" -"import webbrowser\n" -"\n" -"# Import the email modules we'll need\n" -"from email import policy\n" -"from email.parser import BytesParser\n" -"\n" -"\n" -"def magic_html_parser(html_text, partfiles):\n" -" \"\"\"Return safety-sanitized html linked to partfiles.\n" -"\n" -" Rewrite the href=\"cid:....\" attributes to point to the filenames in " -"partfiles.\n" -" Though not trivial, this should be possible using html.parser.\n" -" \"\"\"\n" -" raise NotImplementedError(\"Add the magic needed\")\n" -"\n" -"\n" -"# In a real program you'd get the filename from the arguments.\n" -"with open('outgoing.msg', 'rb') as fp:\n" -" msg = BytesParser(policy=policy.default).parse(fp)\n" -"\n" -"# Now the header items can be accessed as a dictionary, and any non-ASCII " -"will\n" -"# be converted to unicode:\n" -"print('To:', msg['to'])\n" -"print('From:', msg['from'])\n" -"print('Subject:', msg['subject'])\n" -"\n" -"# If we want to print a preview of the message content, we can extract " -"whatever\n" -"# the least formatted payload is and print the first three lines. Of " -"course,\n" -"# if the message has no plain text part printing the first three lines of " -"html\n" -"# is probably useless, but this is just a conceptual example.\n" -"simplest = msg.get_body(preferencelist=('plain', 'html'))\n" -"print()\n" -"print(''.join(simplest.get_content().splitlines(keepends=True)[:3]))\n" -"\n" -"ans = input(\"View full message?\")\n" -"if ans.lower()[0] == 'n':\n" -" sys.exit()\n" -"\n" -"# We can extract the richest alternative in order to display it:\n" -"richest = msg.get_body()\n" -"partfiles = {}\n" -"if richest['content-type'].maintype == 'text':\n" -" if richest['content-type'].subtype == 'plain':\n" -" for line in richest.get_content().splitlines():\n" -" print(line)\n" -" sys.exit()\n" -" elif richest['content-type'].subtype == 'html':\n" -" body = richest\n" -" else:\n" -" print(\"Don't know how to display {}\".format(richest." -"get_content_type()))\n" -" sys.exit()\n" -"elif richest['content-type'].content_type == 'multipart/related':\n" -" body = richest.get_body(preferencelist=('html'))\n" -" for part in richest.iter_attachments():\n" -" fn = part.get_filename()\n" -" if fn:\n" -" extension = os.path.splitext(part.get_filename())[1]\n" -" else:\n" -" extension = mimetypes.guess_extension(part.get_content_type())\n" -" with tempfile.NamedTemporaryFile(suffix=extension, delete=False) as " -"f:\n" -" f.write(part.get_content())\n" -" # again strip the <> to go from email form of cid to html form.\n" -" partfiles[part['content-id'][1:-1]] = f.name\n" -"else:\n" -" print(\"Don't know how to display {}\".format(richest." -"get_content_type()))\n" -" sys.exit()\n" -"with tempfile.NamedTemporaryFile(mode='w', delete=False) as f:\n" -" f.write(magic_html_parser(body.get_content(), partfiles))\n" -"webbrowser.open(f.name)\n" -"os.remove(f.name)\n" -"for fn in partfiles.values():\n" -" os.remove(fn)\n" -"\n" -"# Of course, there are lots of email messages that could break this simple\n" -"# minded program, but it will handle the most common ones.\n" -msgstr "" - #: ../../library/email.examples.rst:52 msgid "Up to the prompt, the output from the above is:" msgstr "プロンプトまでの、上記のプログラムの出力はこうなります:" -#: ../../library/email.examples.rst:54 -msgid "" -"To: Penelope Pussycat , Fabrette Pussycat " -"\n" -"From: Pepé Le Pew \n" -"Subject: Pourquoi pas des asperges pour ce midi ?\n" -"\n" -"Salut!\n" -"\n" -"Cette recette [1] sera sûrement un très bon repas." -msgstr "" - #: ../../library/email.examples.rst:66 msgid "Footnotes" msgstr "脚注" diff --git a/library/email.generator.po b/library/email.generator.po index e4f80a808..65ec05fa7 100644 --- a/library/email.generator.po +++ b/library/email.generator.po @@ -1,31 +1,34 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: +# ごはんですよ , 2017 +# 秘湯 , 2017 +# E. Kawashima, 2017 +# Arihiro TAKASE, 2017 # Takanori Suzuki , 2021 -# tomo, 2021 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-30 14:22+0000\n" -"PO-Revision-Date: 2021-06-28 01:05+0000\n" -"Last-Translator: tomo, 2021\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 23:08+0000\n" +"Last-Translator: Takanori Suzuki , 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/email.generator.rst:2 -msgid ":mod:`!email.generator`: Generating MIME documents" -msgstr "" +msgid ":mod:`email.generator`: Generating MIME documents" +msgstr ":mod:`email.generator`: MIME 文書の生成" #: ../../library/email.generator.rst:7 msgid "**Source code:** :source:`Lib/email/generator.py`" @@ -36,9 +39,9 @@ msgid "" "One of the most common tasks is to generate the flat (serialized) version of " "the email message represented by a message object structure. You will need " "to do this if you want to send your message via :meth:`smtplib.SMTP." -"sendmail`, or print the message on the console. Taking a message object " -"structure and producing a serialized representation is the job of the " -"generator classes." +"sendmail` or the :mod:`nntplib` module, or print the message on the " +"console. Taking a message object structure and producing a serialized " +"representation is the job of the generator classes." msgstr "" #: ../../library/email.generator.rst:18 @@ -91,7 +94,7 @@ msgid "" "defaults to the value of the :attr:`~email.policy.Policy.mangle_from_` " "setting of the *policy* (which is ``True`` for the :data:`~email.policy." "compat32` policy and ``False`` for all others). *mangle_from_* is intended " -"for use when messages are stored in Unix mbox format (see :mod:`mailbox` and " +"for use when messages are stored in unix mbox format (see :mod:`mailbox` and " "`WHY THE CONTENT-LENGTH FORMAT IS BAD `_)." msgstr "" @@ -336,8 +339,8 @@ msgstr "脚注" #: ../../library/email.generator.rst:276 msgid "" "This statement assumes that you use the appropriate setting for " -"``unixfrom``, and that there are no :mod:`email.policy` settings calling for " -"automatic adjustments (for example, :attr:`~email.policy.EmailPolicy." +"``unixfrom``, and that there are no :mod:`policy` settings calling for " +"automatic adjustments (for example, :attr:`~email.policy.Policy." "refold_source` must be ``none``, which is *not* the default). It is also " "not 100% true, since if the message does not conform to the RFC standards " "occasionally information about the exact original text is lost during " diff --git a/library/email.header.po b/library/email.header.po index c5d26113b..0b300467e 100644 --- a/library/email.header.po +++ b/library/email.header.po @@ -1,31 +1,35 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 -# 石井明久, 2024 +# Nozomu Kaneko , 2017 +# Arihiro TAKASE, 2017 +# E. Kawashima, 2017 +# 秘湯 , 2017 +# yuji takesue , 2018 +# tomo, 2019 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-13 14:21+0000\n" -"PO-Revision-Date: 2021-06-28 01:05+0000\n" -"Last-Translator: 石井明久, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 23:08+0000\n" +"Last-Translator: tomo, 2019\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/email.header.rst:2 -msgid ":mod:`!email.header`: Internationalized headers" -msgstr ":mod:`!email.header`: 国際化されたヘッダー" +msgid ":mod:`email.header`: Internationalized headers" +msgstr ":mod:`email.header`: 国際化されたヘッダ" #: ../../library/email.header.rst:7 msgid "**Source code:** :source:`Lib/email/header.py`" @@ -100,17 +104,6 @@ msgstr "" "文字列ではなく、 :class:`Header` インスタンスを使うのです。 :class:`Header` " "クラスは :mod:`email.header` モジュールからインポートしてください。たとえば::" -#: ../../library/email.header.rst:40 -msgid "" -">>> from email.message import Message\n" -">>> from email.header import Header\n" -">>> msg = Message()\n" -">>> h = Header('p\\xf6stal', 'iso-8859-1')\n" -">>> msg['Subject'] = h\n" -">>> msg.as_string()\n" -"'Subject: =?iso-8859-1?q?p=F6stal?=\\n\\n'" -msgstr "" - #: ../../library/email.header.rst:50 msgid "" "Notice here how we wanted the :mailheader:`Subject` field to contain a non-" @@ -172,14 +165,14 @@ msgid "" "The maximum line length can be specified explicitly via *maxlinelen*. For " "splitting the first line to a shorter value (to account for the field header " "which isn't included in *s*, e.g. :mailheader:`Subject`) pass in the name of " -"the field in *header_name*. The default *maxlinelen* is 78, and the default " +"the field in *header_name*. The default *maxlinelen* is 76, and the default " "value for *header_name* is ``None``, meaning it is not taken into account " "for the first line of a long, split header." msgstr "" "行の最大長は *maxlinelen* によって明示的に指定できます。最初の行を (:" "mailheader:`Subject` などの *s* に含まれないフィールドヘッダの責任をとるた" "め) 短く切りとる場合、 *header_name* にそのフィールド名を指定してください。 " -"*maxlinelen* のデフォルト値は 78 であり、 *header_name* のデフォルト値は " +"*maxlinelen* のデフォルト値は 76 であり、 *header_name* のデフォルト値は " "``None`` です。これはその最初の行を長い、切りとられたヘッダとして扱わないこと" "を意味します。" @@ -384,13 +377,6 @@ msgstr "" msgid "Here's an example::" msgstr "以下はこの使用例です::" -#: ../../library/email.header.rst:188 -msgid "" -">>> from email.header import decode_header\n" -">>> decode_header('=?iso-8859-1?q?p=F6stal?=')\n" -"[(b'p\\xf6stal', 'iso-8859-1')]" -msgstr "" - #: ../../library/email.header.rst:195 msgid "" "Create a :class:`Header` instance from a sequence of pairs as returned by :" diff --git a/library/email.headerregistry.po b/library/email.headerregistry.po index e0dbf8cc3..e527f5499 100644 --- a/library/email.headerregistry.po +++ b/library/email.headerregistry.po @@ -1,33 +1,36 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 -# Tetsuo Koyama , 2021 -# yaakiyu, 2022 -# Arihiro TAKASE, 2023 +# 秘湯 , 2017 +# Inada Naoki , 2017 +# E. Kawashima, 2017 +# Yusuke Miyazaki , 2017 +# Nozomu Kaneko , 2017 +# tomo, 2017 +# Tetsuo Koyama , 2020 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-30 14:22+0000\n" -"PO-Revision-Date: 2021-06-28 01:05+0000\n" -"Last-Translator: Arihiro TAKASE, 2023\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 23:08+0000\n" +"Last-Translator: Tetsuo Koyama , 2020\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/email.headerregistry.rst:2 -msgid ":mod:`!email.headerregistry`: Custom Header Objects" -msgstr "" +msgid ":mod:`email.headerregistry`: Custom Header Objects" +msgstr ":mod:`email.headerregistry`: カスタムヘッダーオブジェクト" #: ../../library/email.headerregistry.rst:10 msgid "**Source code:** :source:`Lib/email/headerregistry.py`" @@ -48,7 +51,7 @@ msgid "" "for various header types, but also provides an extension mechanism for " "applications to add their own custom header types." msgstr "" -"ヘッダーは :class:`str` のカスタマイズされたサブクラスで表現されます。 与えら" +"ヘッダーは:class:`str` のカスタマイズされたサブクラスで表現されます。 与えら" "れたヘッダーを表現するために使用される特定のクラスは、ヘッダーが作成されると" "きに有効な :mod:`~email.policy` の :attr:`~email.policy.EmailPolicy." "header_factory` で決定されます。 このセクションでは、email ライブラリが :RFC:" @@ -181,10 +184,6 @@ msgstr "" "``parse`` という名前の :func:`classmethod` を特殊化されたクラスが提供すること" "を要求しています。このメソッドは以下のように呼び出されます::" -#: ../../library/email.headerregistry.rst:94 -msgid "parse(string, kwds)" -msgstr "" - #: ../../library/email.headerregistry.rst:96 msgid "" "``kwds`` is a dictionary containing one pre-initialized key, ``defects``. " @@ -218,13 +217,6 @@ msgstr "" "属性を設定したい場合にのみ ``init`` メソッドを提供する必要があります。 このよ" "うな``init`` メソッドは以下のようなものです:" -#: ../../library/email.headerregistry.rst:110 -msgid "" -"def init(self, /, *args, **kw):\n" -" self._myattr = kw.pop('myattr')\n" -" super().init(*args, **kw)" -msgstr "" - #: ../../library/email.headerregistry.rst:114 msgid "" "That is, anything extra that the specialized class puts in to the ``kwds`` " @@ -296,7 +288,7 @@ msgid "" "representing that date. If the timezone of the input date is specified as " "``-0000`` (indicating it is in UTC but contains no information about the " "source timezone), then :attr:`.datetime` will be a naive :class:`~datetime." -"datetime`. If a specific timezone offset is found (including ``+0000``), " +"datetime`. If a specific timezone offset is found (including `+0000`), " "then :attr:`.datetime` will contain an aware ``datetime`` that uses :class:" "`datetime.timezone` to record the timezone offset." msgstr "" @@ -309,10 +301,6 @@ msgstr "" "ヘッダーの ``decoded`` 値は、 ``datetime`` を :rfc:`5322` のルールに従って" "フォーマットすることで決定されます。" -#: ../../library/email.headerregistry.rst:163 -msgid "email.utils.format_datetime(self.datetime)" -msgstr "" - #: ../../library/email.headerregistry.rst:165 msgid "" "When creating a ``DateHeader``, *value* may be :class:`~datetime.datetime` " @@ -323,10 +311,6 @@ msgstr "" "タンスである可能性があります。 これは、例えば、次のようなコードは有効であり、" "期待通りの動作をすることを意味します::" -#: ../../library/email.headerregistry.rst:169 -msgid "msg['Date'] = datetime(2011, 7, 15, 21)" -msgstr "" - #: ../../library/email.headerregistry.rst:171 msgid "" "Because this is a naive ``datetime`` it will be interpreted as a UTC " @@ -339,10 +323,6 @@ msgstr "" "mod:`~email.utils` モジュールの :func:`~email.utils.localtime` 関数を使用する" "ことです::" -#: ../../library/email.headerregistry.rst:176 -msgid "msg['Date'] = utils.localtime()" -msgstr "" - #: ../../library/email.headerregistry.rst:178 msgid "" "This example sets the date header to the current time and date using the " @@ -388,9 +368,8 @@ msgstr "" msgid "" "The ``decoded`` value of the header will have all encoded words decoded to " "unicode. :class:`~encodings.idna` encoded domain names are also decoded to " -"unicode. The ``decoded`` value is set by :ref:`joining ` " -"the :class:`str` value of the elements of the ``groups`` attribute with ``', " -"'``." +"unicode. The ``decoded`` value is set by :attr:`~str.join`\\ ing the :class:" +"`str` value of the elements of the ``groups`` attribute with ``', '``." msgstr "" #: ../../library/email.headerregistry.rst:213 @@ -502,7 +481,7 @@ msgid "" "class. When *use_default_map* is ``True`` (the default), the standard " "mapping of header names to classes is copied in to the registry during " "initialization. *base_class* is always the last class in the generated " -"class's :class:`~type.__bases__` list." +"class's ``__bases__`` list." msgstr "" #: ../../library/email.headerregistry.rst:322 @@ -685,18 +664,10 @@ msgstr "" "このクラスは電子メールのアドレスを表すのに使われます。アドレスの一般的な形式" "は::" -#: ../../library/email.headerregistry.rst:380 -msgid "[display_name] " -msgstr "" - #: ../../library/email.headerregistry.rst:382 msgid "or::" msgstr "もしくは::" -#: ../../library/email.headerregistry.rst:384 -msgid "username@domain" -msgstr "" - #: ../../library/email.headerregistry.rst:386 msgid "" "where each part must conform to specific syntax rules spelled out in :rfc:" @@ -756,10 +727,6 @@ msgstr "" "このクラスはアドレスグループを表すのに使われます。アドレスグループの一般的な" "形式は::" -#: ../../library/email.headerregistry.rst:432 -msgid "display_name: [address-list];" -msgstr "" - #: ../../library/email.headerregistry.rst:434 msgid "" "As a convenience for processing lists of addresses that consist of a mixture " diff --git a/library/email.iterators.po b/library/email.iterators.po index 86de1b705..3423b9342 100644 --- a/library/email.iterators.po +++ b/library/email.iterators.po @@ -1,31 +1,33 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 -# 石井明久, 2024 +# E. Kawashima, 2017 +# 秘湯 , 2017 +# Arihiro TAKASE, 2017 +# tomo, 2019 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-13 14:21+0000\n" -"PO-Revision-Date: 2021-06-28 01:05+0000\n" -"Last-Translator: 石井明久, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 23:08+0000\n" +"Last-Translator: tomo, 2019\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/email.iterators.rst:2 -msgid ":mod:`!email.iterators`: Iterators" -msgstr ":mod:`!email.iterators`: イテレータ" +msgid ":mod:`email.iterators`: Iterators" +msgstr ":mod:`email.iterators`: イテレータ" #: ../../library/email.iterators.rst:7 msgid "**Source code:** :source:`Lib/email/iterators.py`" @@ -109,27 +111,6 @@ msgstr "" "そのメッセージオブジェクト構造の content-type をインデントつきで表示します。" "例えば:" -#: ../../library/email.iterators.rst:57 -msgid "" -">>> msg = email.message_from_file(somefile)\n" -">>> _structure(msg)\n" -"multipart/mixed\n" -" text/plain\n" -" text/plain\n" -" multipart/digest\n" -" message/rfc822\n" -" text/plain\n" -" message/rfc822\n" -" text/plain\n" -" message/rfc822\n" -" text/plain\n" -" message/rfc822\n" -" text/plain\n" -" message/rfc822\n" -" text/plain\n" -" text/plain" -msgstr "" - #: ../../library/email.iterators.rst:81 msgid "" "Optional *fp* is a file-like object to print the output to. It must be " diff --git a/library/email.message.po b/library/email.message.po index 6c4e091ad..cd4dc24f3 100644 --- a/library/email.message.po +++ b/library/email.message.po @@ -1,32 +1,35 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: +# 秘湯 , 2017 +# Arihiro TAKASE, 2017 +# E. Kawashima, 2017 +# Nozomu Kaneko , 2017 +# Tetsuo Koyama , 2020 # Takanori Suzuki , 2021 -# tomo, 2021 -# Tetsuo Koyama , 2021 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 01:05+0000\n" -"Last-Translator: Tetsuo Koyama , 2021\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 23:08+0000\n" +"Last-Translator: Takanori Suzuki , 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/email.message.rst:2 -msgid ":mod:`!email.message`: Representing an email message" -msgstr "" +msgid ":mod:`email.message`: Representing an email message" +msgstr ":mod:`email.message`: 電子メールメッセージの表現" #: ../../library/email.message.rst:10 msgid "**Source code:** :source:`Lib/email/message.py`" @@ -75,9 +78,10 @@ msgid "" "The :class:`EmailMessage` dictionary-like interface is indexed by the header " "names, which must be ASCII values. The values of the dictionary are strings " "with some extra methods. Headers are stored and returned in case-preserving " -"form, but field names are matched case-insensitively. The keys are ordered, " -"but unlike a real dict, there can be duplicates. Additional methods are " -"provided for working with headers that have duplicate keys." +"form, but field names are matched case-insensitively. Unlike a real dict, " +"there is an ordering to the keys, and there can be duplicate keys. " +"Additional methods are provided for working with headers that have duplicate " +"keys." msgstr "" #: ../../library/email.message.rst:47 @@ -105,9 +109,9 @@ msgid "" "defaults to ``False``. For backward compatibility with the base :class:" "`~email.message.Message` class *maxheaderlen* is accepted, but defaults to " "``None``, which means that by default the line length is controlled by the :" -"attr:`~email.policy.Policy.max_line_length` of the policy. The *policy* " -"argument may be used to override the default policy obtained from the " -"message instance. This can be used to control some of the formatting " +"attr:`~email.policy.EmailPolicy.max_line_length` of the policy. The " +"*policy* argument may be used to override the default policy obtained from " +"the message instance. This can be used to control some of the formatting " "produced by the method, since the specified *policy* will be passed to the :" "class:`~email.generator.Generator`." msgstr "" @@ -174,7 +178,7 @@ msgstr "" #: ../../library/email.message.rst:127 msgid "" -"Equivalent to :meth:`.as_bytes`. Allows ``bytes(msg)`` to produce a bytes " +"Equivalent to :meth:`.as_bytes()`. Allows ``bytes(msg)`` to produce a bytes " "object containing the serialized message." msgstr "" @@ -243,12 +247,6 @@ msgid "" "Used for the ``in`` operator. For example::" msgstr "" -#: ../../library/email.message.rst:185 -msgid "" -"if 'message-id' in myMessage:\n" -" print('Message-ID:', myMessage['message-id'])" -msgstr "" - #: ../../library/email.message.rst:191 msgid "" "Return the value of the named header field. *name* does not include the " @@ -289,19 +287,13 @@ msgstr "" "せん*。もしメッセージが名前 *name* をもつフィールドをひとつしか持たないように" "したければ、最初にそれを除去してください。たとえば::" -#: ../../library/email.message.rst:213 -msgid "" -"del msg['subject']\n" -"msg['subject'] = 'Python roolz!'" -msgstr "" - #: ../../library/email.message.rst:216 msgid "" -"If the :mod:`policy ` defines certain headers to be unique (as " -"the standard policies do), this method may raise a :exc:`ValueError` when an " -"attempt is made to assign a value to such a header when one already exists. " -"This behavior is intentional for consistency's sake, but do not depend on it " -"as we may choose to make such assignments do an automatic deletion of the " +"If the :mod:`policy` defines certain headers to be unique (as the standard " +"policies do), this method may raise a :exc:`ValueError` when an attempt is " +"made to assign a value to such a header when one already exists. This " +"behavior is intentional for consistency's sake, but do not depend on it as " +"we may choose to make such assignments do an automatic deletion of the " "existing header in the future." msgstr "" @@ -333,9 +325,12 @@ msgstr "" #: ../../library/email.message.rst:249 msgid "" "Return the value of the named header field. This is identical to :meth:" -"`~object.__getitem__` except that optional *failobj* is returned if the " -"named header is missing (*failobj* defaults to ``None``)." +"`__getitem__` except that optional *failobj* is returned if the named header " +"is missing (*failobj* defaults to ``None``)." msgstr "" +"指定された名前をもつフィールドの値を返します。これは指定された名前がないとき" +"にオプション引数の *failobj* (*failobj* のデフォルトは ``None``) を返すことを" +"のぞけば、 :meth:`__getitem__` と同じです。" #: ../../library/email.message.rst:254 msgid "Here are some additional useful header related methods:" @@ -388,28 +383,14 @@ msgstr "" msgid "Here is an example::" msgstr "以下に例を示します。::" -#: ../../library/email.message.rst:289 -msgid "msg.add_header('Content-Disposition', 'attachment', filename='bud.gif')" -msgstr "" - #: ../../library/email.message.rst:291 msgid "This will add a header that looks like ::" msgstr "こうするとヘッダには以下のように追加されます ::" -#: ../../library/email.message.rst:293 -msgid "Content-Disposition: attachment; filename=\"bud.gif\"" -msgstr "" - #: ../../library/email.message.rst:295 msgid "An example of the extended interface with non-ASCII characters::" msgstr "" -#: ../../library/email.message.rst:297 -msgid "" -"msg.add_header('Content-Disposition', 'attachment',\n" -" filename=('iso-8859-1', '', 'Fußballer.ppt'))" -msgstr "" - #: ../../library/email.message.rst:303 msgid "" "Replace a header. Replace the first header found in the message that " @@ -511,8 +492,8 @@ msgstr "" #: ../../library/email.message.rst:380 msgid "" "Note that existing parameter values of headers may be accessed through the :" -"attr:`~email.headerregistry.ParameterizedMIMEHeader.params` attribute of the " -"header value (for example, ``msg['Content-Type'].params['charset']``)." +"attr:`~email.headerregistry.BaseHeader.params` attribute of the header value " +"(for example, ``msg['Content-Type'].params['charset']``)." msgstr "" #: ../../library/email.message.rst:384 @@ -666,19 +647,6 @@ msgstr "" "以下の例は、 multipart メッセージのすべての part において、その MIME タイプを" "表示していくものです。 :" -#: ../../library/email.message.rst:491 -msgid "" -">>> for part in msg.walk():\n" -"... print(part.get_content_type())\n" -"multipart/report\n" -"text/plain\n" -"message/delivery-status\n" -"text/plain\n" -"text/plain\n" -"message/rfc822\n" -"text/plain" -msgstr "" - #: ../../library/email.message.rst:503 msgid "" "``walk`` iterates over the subparts of any part where :meth:`is_multipart` " @@ -687,29 +655,6 @@ msgid "" "``_structure`` debug helper function:" msgstr "" -#: ../../library/email.message.rst:509 -msgid "" -">>> from email.iterators import _structure\n" -">>> for part in msg.walk():\n" -"... print(part.get_content_maintype() == 'multipart',\n" -"... part.is_multipart())\n" -"True True\n" -"False False\n" -"False True\n" -"False False\n" -"False False\n" -"False True\n" -"False False\n" -">>> _structure(msg)\n" -"multipart/report\n" -" text/plain\n" -" message/delivery-status\n" -" text/plain\n" -" text/plain\n" -" message/rfc822\n" -" text/plain" -msgstr "" - #: ../../library/email.message.rst:531 msgid "" "Here the ``message`` parts are not ``multiparts``, but they do contain " @@ -891,8 +836,8 @@ msgstr "ペイロードとヘッダの全てを削除します。" #: ../../library/email.message.rst:694 msgid "" -"Remove the payload and all of the :mailheader:`!Content-` headers, leaving " -"all other headers intact and in their original order." +"Remove the payload and all of the :exc:`Content-` headers, leaving all other " +"headers intact and in their original order." msgstr "" #: ../../library/email.message.rst:698 diff --git a/library/email.mime.po b/library/email.mime.po index 3d5b5adde..cf89a6780 100644 --- a/library/email.mime.po +++ b/library/email.mime.po @@ -1,31 +1,34 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: +# E. Kawashima, 2017 +# Nozomu Kaneko , 2017 +# 秘湯 , 2017 +# Arihiro TAKASE, 2017 # Takanori Suzuki , 2021 -# tomo, 2021 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-06 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 01:05+0000\n" -"Last-Translator: tomo, 2021\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 23:09+0000\n" +"Last-Translator: Takanori Suzuki , 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/email.mime.rst:2 -msgid ":mod:`!email.mime`: Creating email and MIME objects from scratch" -msgstr "" +msgid ":mod:`email.mime`: Creating email and MIME objects from scratch" +msgstr ":mod:`email.mime`: メールと MIME オブジェクトを一から作成" #: ../../library/email.mime.rst:7 msgid "**Source code:** :source:`Lib/email/mime/`" @@ -125,8 +128,8 @@ msgstr "" #: ../../library/email.mime.rst:57 ../../library/email.mime.rst:104 #: ../../library/email.mime.rst:135 ../../library/email.mime.rst:169 -#: ../../library/email.mime.rst:205 ../../library/email.mime.rst:225 -#: ../../library/email.mime.rst:259 +#: ../../library/email.mime.rst:204 ../../library/email.mime.rst:224 +#: ../../library/email.mime.rst:258 msgid "Added *policy* keyword-only parameter." msgstr "キーワード専用引数 *policy* が追加されました。" @@ -194,8 +197,8 @@ msgstr "" "てそのメッセージに追加できるようになっています。" #: ../../library/email.mime.rst:98 ../../library/email.mime.rst:131 -#: ../../library/email.mime.rst:165 ../../library/email.mime.rst:200 -#: ../../library/email.mime.rst:223 ../../library/email.mime.rst:254 +#: ../../library/email.mime.rst:165 ../../library/email.mime.rst:199 +#: ../../library/email.mime.rst:222 ../../library/email.mime.rst:253 msgid "" "Optional *policy* argument defaults to :class:`compat32 `." @@ -219,10 +222,15 @@ msgstr "モジュール: :mod:`email.mime.application`" msgid "" "A subclass of :class:`~email.mime.nonmultipart.MIMENonMultipart`, the :class:" "`MIMEApplication` class is used to represent MIME message objects of major " -"type :mimetype:`application`. *_data* contains the bytes for the raw " -"application data. Optional *_subtype* specifies the MIME subtype and " -"defaults to :mimetype:`octet-stream`." +"type :mimetype:`application`. *_data* is a string containing the raw byte " +"data. Optional *_subtype* specifies the MIME subtype and defaults to :" +"mimetype:`octet-stream`." msgstr "" +":class:`~email.mime.nonmultipart.MIMENonMultipart` のサブクラスである :class:" +"`MIMEApplication` クラスは MIME メッセージオブジェクトのメジャータイプ :" +"mimetype:`application` を表します。 *_data* は生のバイト列が入った文字列で" +"す。オプション引数 *_subtype* は MIME のサブタイプを設定します。サブタイプの" +"デフォルトは :mimetype:`octet-stream` です。" #: ../../library/email.mime.rst:121 msgid "" @@ -256,13 +264,21 @@ msgstr "モジュール: :mod:`email.mime.audio`" msgid "" "A subclass of :class:`~email.mime.nonmultipart.MIMENonMultipart`, the :class:" "`MIMEAudio` class is used to create MIME message objects of major type :" -"mimetype:`audio`. *_audiodata* contains the bytes for the raw audio data. " -"If this data can be decoded as au, wav, aiff, or aifc, then the subtype will " -"be automatically included in the :mailheader:`Content-Type` header. " -"Otherwise you can explicitly specify the audio subtype via the *_subtype* " -"argument. If the minor type could not be guessed and *_subtype* was not " -"given, then :exc:`TypeError` is raised." +"mimetype:`audio`. *_audiodata* is a string containing the raw audio data. " +"If this data can be decoded by the standard Python module :mod:`sndhdr`, " +"then the subtype will be automatically included in the :mailheader:`Content-" +"Type` header. Otherwise you can explicitly specify the audio subtype via the " +"*_subtype* argument. If the minor type could not be guessed and *_subtype* " +"was not given, then :exc:`TypeError` is raised." msgstr "" +":class:`MIMEAudio` クラスは :class:`~email.mime.nonmultipart." +"MIMENonMultipart` のサブクラスで、主形式 (maintype) が :mimetype:`audio` の " +"MIME オブジェクトを作成するのに使われます。 *_audiodata* は実際の音声データを" +"格納した文字列です。もしこのデータが標準の Python モジュール :mod:`sndhdr` に" +"よって認識できるものであれば、 :mailheader:`Content-Type` ヘッダの副形式 " +"(subtype) は自動的に決定されます。そうでない場合はその画像の形式 (subtype) " +"を *_subtype* で明示的に指定する必要があります。副形式が自動的に決定できず、 " +"*_subtype* の指定もない場合は、 :exc:`TypeError` が発生します。" #: ../../library/email.mime.rst:155 msgid "" @@ -292,16 +308,23 @@ msgstr "モジュール: :mod:`email.mime.image`" msgid "" "A subclass of :class:`~email.mime.nonmultipart.MIMENonMultipart`, the :class:" "`MIMEImage` class is used to create MIME message objects of major type :" -"mimetype:`image`. *_imagedata* contains the bytes for the raw image data. " -"If this data type can be detected (jpeg, png, gif, tiff, rgb, pbm, pgm, ppm, " -"rast, xbm, bmp, webp, and exr attempted), then the subtype will be " -"automatically included in the :mailheader:`Content-Type` header. Otherwise " -"you can explicitly specify the image subtype via the *_subtype* argument. If " -"the minor type could not be guessed and *_subtype* was not given, then :exc:" -"`TypeError` is raised." +"mimetype:`image`. *_imagedata* is a string containing the raw image data. " +"If this data can be decoded by the standard Python module :mod:`imghdr`, " +"then the subtype will be automatically included in the :mailheader:`Content-" +"Type` header. Otherwise you can explicitly specify the image subtype via the " +"*_subtype* argument. If the minor type could not be guessed and *_subtype* " +"was not given, then :exc:`TypeError` is raised." msgstr "" - -#: ../../library/email.mime.rst:190 +":class:`MIMEImage` クラスは :class:`~email.mime.nonmultipart." +"MIMENonMultipart` のサブクラスで、主形式 (maintype) が :mimetype:`image` の " +"MIME オブジェクトを作成するのに使われます。 *_imagedata* は実際の画像データを" +"格納した文字列です。もしこのデータが標準の Python モジュール :mod:`imghdr` に" +"よって認識できるものであれば、 :mailheader:`Content-Type` ヘッダの副形式 " +"(subtype) は自動的に決定されます。そうでない場合はその画像の形式 (subtype) " +"を *_subtype* で明示的に指定する必要があります。副形式が自動的に決定できず、 " +"*_subtype* の指定もない場合は、 :exc:`TypeError` が発生します。" + +#: ../../library/email.mime.rst:189 msgid "" "Optional *_encoder* is a callable (i.e. function) which will perform the " "actual encoding of the image data for transport. This callable takes one " @@ -321,7 +344,7 @@ msgstr "" "ジェクトに追加するべきです。デフォルトのエンコードは base64 です。組み込みの" "エンコーダの一覧は :mod:`email.encoders` モジュールを見てください。" -#: ../../library/email.mime.rst:202 +#: ../../library/email.mime.rst:201 msgid "" "*_params* are passed straight through to the :class:`~email.mime.base." "MIMEBase` constructor." @@ -329,11 +352,11 @@ msgstr "" "*_params* は :class:`~email.mime.base.MIMEBase` コンストラクタに直接渡されま" "す。" -#: ../../library/email.mime.rst:212 +#: ../../library/email.mime.rst:211 msgid "Module: :mod:`email.mime.message`" msgstr "モジュール: :mod:`email.mime.message`" -#: ../../library/email.mime.rst:214 +#: ../../library/email.mime.rst:213 msgid "" "A subclass of :class:`~email.mime.nonmultipart.MIMENonMultipart`, the :class:" "`MIMEMessage` class is used to create MIME objects of main type :mimetype:" @@ -348,7 +371,7 @@ msgstr "" "るいはそのサブクラス) のインスタンスでなければいけません。そうでない場合、こ" "の関数は :exc:`TypeError` を発生します。" -#: ../../library/email.mime.rst:220 +#: ../../library/email.mime.rst:219 msgid "" "Optional *_subtype* sets the subtype of the message; it defaults to :" "mimetype:`rfc822`." @@ -356,11 +379,11 @@ msgstr "" "オプション引数 *_subtype* はそのメッセージの副形式 (subtype) を設定します。デ" "フォルトではこれは :mimetype:`rfc822` になっています。" -#: ../../library/email.mime.rst:232 +#: ../../library/email.mime.rst:231 msgid "Module: :mod:`email.mime.text`" msgstr "モジュール: :mod:`email.mime.text`" -#: ../../library/email.mime.rst:234 +#: ../../library/email.mime.rst:233 msgid "" "A subclass of :class:`~email.mime.nonmultipart.MIMENonMultipart`, the :class:" "`MIMEText` class is used to create MIME objects of major type :mimetype:" @@ -382,7 +405,7 @@ msgstr "" "は ``utf-8`` がデフォルトになっています。 *_charset* パラメータは、文字列と :" "class:`~email.charset.Charset` インスタンスの両方を受け付けます。" -#: ../../library/email.mime.rst:244 +#: ../../library/email.mime.rst:243 msgid "" "Unless the *_charset* argument is explicitly set to ``None``, the MIMEText " "object created will have both a :mailheader:`Content-Type` header with a " @@ -404,7 +427,7 @@ msgstr "" "ド (そして新たな :mailheader:`Content-Transfer-Encoding` ヘッダを追加) しま" "す。" -#: ../../library/email.mime.rst:256 +#: ../../library/email.mime.rst:255 msgid "*_charset* also accepts :class:`~email.charset.Charset` instances." msgstr "" "*_charset* は :class:`~email.charset.Charset` インスタンスも受け取ります。" diff --git a/library/email.parser.po b/library/email.parser.po index 9b15559ae..89149bb1e 100644 --- a/library/email.parser.po +++ b/library/email.parser.po @@ -1,31 +1,35 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: +# ごはんですよ , 2017 +# Nozomu Kaneko , 2017 +# 秘湯 , 2017 +# E. Kawashima, 2017 +# Arihiro TAKASE, 2017 # Takanori Suzuki , 2021 -# tomo, 2021 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-30 14:22+0000\n" -"PO-Revision-Date: 2021-06-28 01:05+0000\n" -"Last-Translator: tomo, 2021\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 23:09+0000\n" +"Last-Translator: Takanori Suzuki , 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/email.parser.rst:2 -msgid ":mod:`!email.parser`: Parsing email messages" -msgstr "" +msgid ":mod:`email.parser`: Parsing email messages" +msgstr ":mod:`email.parser`: 電子メールメッセージのパース" #: ../../library/email.parser.rst:7 msgid "**Source code:** :source:`Lib/email/parser.py`" @@ -74,10 +78,9 @@ msgid "" "Note that the parser can be extended in limited ways, and of course you can " "implement your own parser completely from scratch. All of the logic that " "connects the :mod:`email` package's bundled parser and the :class:`~email." -"message.EmailMessage` class is embodied in the :class:`~email.policy.Policy` " -"class, so a custom parser can create message object trees any way it finds " -"necessary by implementing custom versions of the appropriate :class:`!" -"Policy` methods." +"message.EmailMessage` class is embodied in the :mod:`policy` class, so a " +"custom parser can create message object trees any way it finds necessary by " +"implementing custom versions of the appropriate :mod:`policy` methods." msgstr "" #: ../../library/email.parser.rst:49 @@ -377,12 +380,6 @@ msgstr "" "対話的な Python プロンプトで :func:`message_from_bytes` を使用するとすれば、" "このようになります::" -#: ../../library/email.parser.rst:286 -msgid "" -">>> import email\n" -">>> msg = email.message_from_bytes(myBytes)" -msgstr "" - #: ../../library/email.parser.rst:291 msgid "Additional notes" msgstr "追記事項" diff --git a/library/email.po b/library/email.po index e886db080..05266971b 100644 --- a/library/email.po +++ b/library/email.po @@ -1,32 +1,36 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: +# Takeshi Mizumoto , 2017 +# Arihiro TAKASE, 2017 +# Yusuke Miyazaki , 2017 +# E. Kawashima, 2017 +# tomo, 2017 +# Ohashi Hideka , 2018 # Takanori Suzuki , 2021 -# tomo, 2021 -# 石井明久, 2024 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-13 14:21+0000\n" -"PO-Revision-Date: 2021-06-28 01:05+0000\n" -"Last-Translator: 石井明久, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-04-26 06:10+0000\n" +"PO-Revision-Date: 2017-02-16 23:09+0000\n" +"Last-Translator: Takanori Suzuki , 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/email.rst:2 -msgid ":mod:`!email` --- An email and MIME handling package" -msgstr ":mod:`!email` --- 電子メールと MIME 処理のためのパッケージ" +msgid ":mod:`email` --- An email and MIME handling package" +msgstr ":mod:`email` --- 電子メールと MIME 処理のためのパッケージ" #: ../../library/email.rst:11 msgid "**Source code:** :source:`Lib/email/__init__.py`" @@ -37,17 +41,18 @@ msgid "" "The :mod:`email` package is a library for managing email messages. It is " "specifically *not* designed to do any sending of email messages to SMTP (:" "rfc:`2821`), NNTP, or other servers; those are functions of modules such as :" -"mod:`smtplib`. The :mod:`email` package attempts to be as RFC-compliant as " -"possible, supporting :rfc:`5322` and :rfc:`6532`, as well as such MIME-" -"related RFCs as :rfc:`2045`, :rfc:`2046`, :rfc:`2047`, :rfc:`2183`, and :rfc:" -"`2231`." +"mod:`smtplib` and :mod:`nntplib`. The :mod:`email` package attempts to be " +"as RFC-compliant as possible, supporting :rfc:`5322` and :rfc:`6532`, as " +"well as such MIME-related RFCs as :rfc:`2045`, :rfc:`2046`, :rfc:`2047`, :" +"rfc:`2183`, and :rfc:`2231`." msgstr "" ":mod:`email` パッケージは、電子メールメッセージを管理するライブラリです。 特" -"に、SMTP(:rfc:`2821`)、NNTP、またはその他のサーバーに電子メールメッセージを" -"送信するようには設計されていません。これらは、:mod:`smtplib` などのモジュール" -"の関数群です。 :mod:`email` パッケージは、可能な限りRFCに準拠するよう試みてい" -"ます。 :rfc:`5322` や :rfc:`6532` のほか、:rfc:`2045`、:rfc:`2046`、:rfc:" -"`2047`、:rfc:`2183`、:rfc:`2231` などのMIME関連のRFCに対応しています。" +"に、SMTP(:rfc:`2821)、NNTP、またはその他のサーバーに電子メールメッセージを" +"送信するようには設計されていません。これらは、:mod:`smtplib` や、 :mod:" +"`nntplib` などのモジュールの関数群です。 :mod:`email` パッケージは、可能な限" +"りRFCに準拠するよう試みています。 :rfc:`5322`や :rfc:`6532` のほか、:rfc:" +"`2045`、:rfc:`2046`、:rfc:`2047`、:rfc:`2183`、:rfc:`2231` などのMIME関連の" +"RFCに対応しています。" #: ../../library/email.rst:23 msgid "" @@ -168,7 +173,7 @@ msgstr ":mod:`email` パッケージ文書の内容" msgid "Legacy API:" msgstr "レガシーAPI:" -#: ../../library/email.rst:135 +#: ../../library/email.rst:136 msgid "Module :mod:`smtplib`" msgstr ":mod:`smtplib` モジュール" @@ -176,7 +181,7 @@ msgstr ":mod:`smtplib` モジュール" msgid "SMTP (Simple Mail Transport Protocol) client" msgstr "SMTP(簡易メール転送プロトコル)クライアント" -#: ../../library/email.rst:138 +#: ../../library/email.rst:139 msgid "Module :mod:`poplib`" msgstr ":mod:`poplib` モジュール" @@ -184,7 +189,7 @@ msgstr ":mod:`poplib` モジュール" msgid "POP (Post Office Protocol) client" msgstr "POP (Post Office Protocol) クライアント" -#: ../../library/email.rst:141 +#: ../../library/email.rst:142 msgid "Module :mod:`imaplib`" msgstr "モジュール :mod:`imaplib`" @@ -192,12 +197,28 @@ msgstr "モジュール :mod:`imaplib`" msgid "IMAP (Internet Message Access Protocol) client" msgstr "IMAP (Internet Message Access Protocol) クライアント" -#: ../../library/email.rst:144 +#: ../../library/email.rst:145 +msgid "Module :mod:`nntplib`" +msgstr ":mod:`nntplib` モジュール" + +#: ../../library/email.rst:145 +msgid "NNTP (Net News Transport Protocol) client" +msgstr "NNTP (Net News Transport Protocol) クライアント" + +#: ../../library/email.rst:149 msgid "Module :mod:`mailbox`" msgstr ":mod:`mailbox` モジュール" -#: ../../library/email.rst:145 +#: ../../library/email.rst:148 msgid "" "Tools for creating, reading, and managing collections of messages on disk " "using a variety standard formats." msgstr "" + +#: ../../library/email.rst:151 +msgid "Module :mod:`smtpd`" +msgstr ":mod:`smtpd` モジュール" + +#: ../../library/email.rst:152 +msgid "SMTP server framework (primarily useful for testing)" +msgstr "" diff --git a/library/email.policy.po b/library/email.policy.po index 672e66620..a4013e384 100644 --- a/library/email.policy.po +++ b/library/email.policy.po @@ -1,32 +1,37 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 -# Tetsuo Koyama , 2021 -# Arihiro TAKASE, 2023 +# 秘湯 , 2017 +# Takeshi Fujiwara <1.800.takeshi@gmail.com>, 2017 +# Nozomu Kaneko , 2017 +# Yusuke Miyazaki , 2017 +# E. Kawashima, 2017 +# yuji takesue , 2018 +# sanohitomi , 2019 +# Tetsuo Koyama , 2020 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-30 14:22+0000\n" -"PO-Revision-Date: 2021-06-28 01:05+0000\n" -"Last-Translator: Arihiro TAKASE, 2023\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 23:09+0000\n" +"Last-Translator: Tetsuo Koyama , 2020\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/email.policy.rst:2 -msgid ":mod:`!email.policy`: Policy Objects" -msgstr "" +msgid ":mod:`email.policy`: Policy Objects" +msgstr ":mod:`email.policy`: ポリシーオブジェクト" #: ../../library/email.policy.rst:12 msgid "**Source code:** :source:`Lib/email/policy.py`" @@ -139,23 +144,7 @@ msgid "" "system:" msgstr "" -#: ../../library/email.policy.rst:92 -msgid "" -">>> from email import message_from_binary_file\n" -">>> from email.generator import BytesGenerator\n" -">>> from email import policy\n" -">>> from subprocess import Popen, PIPE\n" -">>> with open('mymsg.txt', 'rb') as f:\n" -"... msg = message_from_binary_file(f, policy=policy.default)\n" -"...\n" -">>> p = Popen(['sendmail', msg['To'].addresses[0]], stdin=PIPE)\n" -">>> g = BytesGenerator(p.stdin, policy=msg.policy.clone(linesep='\\r\\n'))\n" -">>> g.flatten(msg)\n" -">>> p.stdin.close()\n" -">>> rc = p.wait()" -msgstr "" - -#: ../../library/email.policy.rst:114 +#: ../../library/email.policy.rst:113 msgid "" "Here we are telling :class:`~email.generator.BytesGenerator` to use the RFC " "correct line separator characters when creating the binary string to feed " @@ -163,7 +152,7 @@ msgid "" "line separators." msgstr "" -#: ../../library/email.policy.rst:119 +#: ../../library/email.policy.rst:118 msgid "" "Some email package methods accept a *policy* keyword argument, allowing the " "policy to be overridden for that method. For example, the following code " @@ -172,15 +161,7 @@ msgid "" "line separators for the platform on which it is running::" msgstr "" -#: ../../library/email.policy.rst:125 -msgid "" -">>> import os\n" -">>> with open('converted.txt', 'wb') as f:\n" -"... f.write(msg.as_bytes(policy=msg.policy.clone(linesep=os.linesep)))\n" -"17" -msgstr "" - -#: ../../library/email.policy.rst:130 +#: ../../library/email.policy.rst:129 msgid "" "Policy objects can also be combined using the addition operator, producing a " "policy object whose settings are a combination of the non-default values of " @@ -190,14 +171,7 @@ msgstr "" "のオブジェクトの非デフォルト値を組み合わせた設定を持つPolicyオブジェクトを生" "成します::" -#: ../../library/email.policy.rst:134 -msgid "" -">>> compat_SMTP = policy.compat32.clone(linesep='\\r\\n')\n" -">>> compat_strict = policy.compat32.clone(raise_on_defect=True)\n" -">>> compat_strict_SMTP = compat_SMTP + compat_strict" -msgstr "" - -#: ../../library/email.policy.rst:138 +#: ../../library/email.policy.rst:137 msgid "" "This operation is not commutative; that is, the order in which the objects " "are added matters. To illustrate::" @@ -205,19 +179,7 @@ msgstr "" "この操作には交換法則が成り立ちません。つまり、オブジェクトを加える順番に結果" "が依存します。次のように説明できます::" -#: ../../library/email.policy.rst:141 -msgid "" -">>> policy100 = policy.compat32.clone(max_line_length=100)\n" -">>> policy80 = policy.compat32.clone(max_line_length=80)\n" -">>> apolicy = policy100 + policy80\n" -">>> apolicy.max_line_length\n" -"80\n" -">>> apolicy = policy80 + policy100\n" -">>> apolicy.max_line_length\n" -"100" -msgstr "" - -#: ../../library/email.policy.rst:153 +#: ../../library/email.policy.rst:152 msgid "" "This is the :term:`abstract base class` for all policy classes. It provides " "default implementations for a couple of trivial methods, as well as the " @@ -225,7 +187,7 @@ msgid "" "the constructor semantics." msgstr "" -#: ../../library/email.policy.rst:158 +#: ../../library/email.policy.rst:157 msgid "" "The constructor of a policy class can be passed various keyword arguments. " "The arguments that may be specified are any non-method properties on this " @@ -234,13 +196,13 @@ msgid "" "corresponding attribute." msgstr "" -#: ../../library/email.policy.rst:164 +#: ../../library/email.policy.rst:163 msgid "" "This class defines the following properties, and thus values for the " "following may be passed in the constructor of any policy class:" msgstr "" -#: ../../library/email.policy.rst:170 +#: ../../library/email.policy.rst:169 msgid "" "The maximum length of any line in the serialized output, not counting the " "end of line character(s). Default is 78, per :rfc:`5322`. A value of ``0`` " @@ -250,35 +212,35 @@ msgstr "" "トは :rfc:`5322` に従い78となっています。値が ``0`` または :const:`None` の場" "合は行の折り返しを全くしないべきであるということを示します。" -#: ../../library/email.policy.rst:178 +#: ../../library/email.policy.rst:177 msgid "" "The string to be used to terminate lines in serialized output. The default " "is ``\\n`` because that's the internal end-of-line discipline used by " "Python, though ``\\r\\n`` is required by the RFCs." msgstr "" -#: ../../library/email.policy.rst:185 +#: ../../library/email.policy.rst:184 msgid "" "Controls the type of Content Transfer Encodings that may be or are required " "to be used. The possible values are:" msgstr "" -#: ../../library/email.policy.rst:191 +#: ../../library/email.policy.rst:190 msgid "``7bit``" msgstr "``7bit``" -#: ../../library/email.policy.rst:191 +#: ../../library/email.policy.rst:190 msgid "" "all data must be \"7 bit clean\" (ASCII-only). This means that where " "necessary data will be encoded using either quoted-printable or base64 " "encoding." msgstr "" -#: ../../library/email.policy.rst:195 +#: ../../library/email.policy.rst:194 msgid "``8bit``" msgstr "``8bit``" -#: ../../library/email.policy.rst:195 +#: ../../library/email.policy.rst:194 msgid "" "data is not constrained to be 7 bit clean. Data in headers is still " "required to be ASCII-only and so will be encoded (see :meth:`fold_binary` " @@ -286,7 +248,7 @@ msgid "" "the ``8bit`` CTE." msgstr "" -#: ../../library/email.policy.rst:201 +#: ../../library/email.policy.rst:200 msgid "" "A ``cte_type`` value of ``8bit`` only works with ``BytesGenerator``, not " "``Generator``, because strings cannot contain binary data. If a " @@ -294,20 +256,24 @@ msgid "" "it will act as if ``cte_type`` is ``7bit``." msgstr "" -#: ../../library/email.policy.rst:209 +#: ../../library/email.policy.rst:208 msgid "" "If :const:`True`, any defects encountered will be raised as errors. If :" "const:`False` (the default), defects will be passed to the :meth:" "`register_defect` method." msgstr "" -#: ../../library/email.policy.rst:216 +#: ../../library/email.policy.rst:215 msgid "" "If :const:`True`, lines starting with *\"From \"* in the body are escaped by " "putting a ``>`` in front of them. This parameter is used when the message is " "being serialized by a generator. Default: :const:`False`." msgstr "" +#: ../../library/email.policy.rst:220 +msgid "The *mangle_from_* parameter." +msgstr "*mangle_from_* 引数。" + #: ../../library/email.policy.rst:226 msgid "" "A factory function for constructing a new empty message object. Used by the " @@ -315,62 +281,48 @@ msgid "" "`~email.message.Message` is used." msgstr "" -#: ../../library/email.policy.rst:235 -msgid "" -"If ``True`` (the default), the generator will raise :exc:`~email.errors." -"HeaderWriteError` instead of writing a header that is improperly folded or " -"delimited, such that it would be parsed as multiple headers or joined with " -"adjacent data. Such headers can be generated by custom header classes or " -"bugs in the ``email`` module." -msgstr "" - -#: ../../library/email.policy.rst:242 -msgid "" -"As it's a security feature, this defaults to ``True`` even in the :class:" -"`~email.policy.Compat32` policy. For backwards compatible, but unsafe, " -"behavior, it must be set to ``False`` explicitly." -msgstr "" - -#: ../../library/email.policy.rst:250 +#: ../../library/email.policy.rst:232 msgid "" "The following :class:`Policy` method is intended to be called by code using " "the email library to create policy instances with custom settings:" msgstr "" -#: ../../library/email.policy.rst:256 +#: ../../library/email.policy.rst:238 msgid "" "Return a new :class:`Policy` instance whose attributes have the same values " "as the current instance, except where those attributes are given new values " "by the keyword arguments." msgstr "" -#: ../../library/email.policy.rst:261 +#: ../../library/email.policy.rst:243 msgid "" "The remaining :class:`Policy` methods are called by the email package code, " "and are not intended to be called by an application using the email package. " "A custom policy must implement all of these methods." msgstr "" -#: ../../library/email.policy.rst:268 +#: ../../library/email.policy.rst:250 msgid "" "Handle a *defect* found on *obj*. When the email package calls this method, " -"*defect* will always be a subclass of :class:`~email.errors.MessageDefect`." +"*defect* will always be a subclass of :class:`~email.errors.Defect`." msgstr "" -#: ../../library/email.policy.rst:272 +#: ../../library/email.policy.rst:254 msgid "" "The default implementation checks the :attr:`raise_on_defect` flag. If it " "is ``True``, *defect* is raised as an exception. If it is ``False`` (the " "default), *obj* and *defect* are passed to :meth:`register_defect`." msgstr "" -#: ../../library/email.policy.rst:279 +#: ../../library/email.policy.rst:261 msgid "" "Register a *defect* on *obj*. In the email package, *defect* will always be " -"a subclass of :class:`~email.errors.MessageDefect`." +"a subclass of :class:`~email.errors.Defect`." msgstr "" +"*defect* を *obj* に登録します。email パッケージでは、*defect* は常に :class:" +"`~email.errors.Defect` の派生クラスです。" -#: ../../library/email.policy.rst:282 +#: ../../library/email.policy.rst:264 msgid "" "The default implementation calls the ``append`` method of the ``defects`` " "attribute of *obj*. When the email package calls :attr:`handle_defect`, " @@ -380,11 +332,11 @@ msgid "" "defects in parsed messages will raise unexpected errors." msgstr "" -#: ../../library/email.policy.rst:292 +#: ../../library/email.policy.rst:274 msgid "Return the maximum allowed number of headers named *name*." msgstr "*name* というヘッダに許される最大の数を返します。" -#: ../../library/email.policy.rst:294 +#: ../../library/email.policy.rst:276 msgid "" "Called when a header is added to an :class:`~email.message.EmailMessage` or :" "class:`~email.message.Message` object. If the returned value is not ``0`` " @@ -392,7 +344,7 @@ msgid "" "greater than or equal to the value returned, a :exc:`ValueError` is raised." msgstr "" -#: ../../library/email.policy.rst:300 +#: ../../library/email.policy.rst:282 msgid "" "Because the default behavior of ``Message.__setitem__`` is to append the " "value to the list of headers, it is easy to create duplicate headers without " @@ -402,11 +354,11 @@ msgid "" "faithfully produce as many headers as exist in the message being parsed.)" msgstr "" -#: ../../library/email.policy.rst:308 +#: ../../library/email.policy.rst:290 msgid "The default implementation returns ``None`` for all header names." msgstr "デフォルトの実装は全てのヘッダ名に ``None`` を返します。" -#: ../../library/email.policy.rst:313 +#: ../../library/email.policy.rst:295 msgid "" "The email package calls this method with a list of strings, each string " "ending with the line separation characters found in the source being " @@ -416,7 +368,7 @@ msgid "" "the parsed header." msgstr "" -#: ../../library/email.policy.rst:320 +#: ../../library/email.policy.rst:302 msgid "" "If an implementation wishes to retain compatibility with the existing email " "package policies, *name* should be the case preserved name (all characters " @@ -425,18 +377,18 @@ msgid "" "stripped of leading whitespace." msgstr "" -#: ../../library/email.policy.rst:326 +#: ../../library/email.policy.rst:308 msgid "*sourcelines* may contain surrogateescaped binary data." msgstr "" "*sourcelines* はサロゲートエスケープされたバイナリーデータを持つことがありま" "す。" -#: ../../library/email.policy.rst:328 ../../library/email.policy.rst:344 -#: ../../library/email.policy.rst:360 +#: ../../library/email.policy.rst:310 ../../library/email.policy.rst:326 +#: ../../library/email.policy.rst:342 msgid "There is no default implementation" msgstr "デフォルトの実装はありません。" -#: ../../library/email.policy.rst:333 +#: ../../library/email.policy.rst:315 msgid "" "The email package calls this method with the name and value provided by the " "application program when the application program is modifying a ``Message`` " @@ -445,14 +397,14 @@ msgid "" "``Message`` to represent the header." msgstr "" -#: ../../library/email.policy.rst:339 +#: ../../library/email.policy.rst:321 msgid "" "If an implementation wishes to retain compatibility with the existing email " "package policies, the *name* and *value* should be strings or string " "subclasses that do not change the content of the passed in arguments." msgstr "" -#: ../../library/email.policy.rst:349 +#: ../../library/email.policy.rst:331 msgid "" "The email package calls this method with the *name* and *value* currently " "stored in the ``Message`` when that header is requested by the application " @@ -463,7 +415,7 @@ msgid "" "returned to the application." msgstr "" -#: ../../library/email.policy.rst:357 +#: ../../library/email.policy.rst:339 msgid "" "*value* may contain surrogateescaped binary data. There should be no " "surrogateescaped binary data in the value returned by the method." @@ -472,7 +424,7 @@ msgstr "" "のメソッドの返り値にはサロゲートエスケープされたバイナリーデータはありませ" "ん。" -#: ../../library/email.policy.rst:365 +#: ../../library/email.policy.rst:347 msgid "" "The email package calls this method with the *name* and *value* currently " "stored in the ``Message`` for a given header. The method should return a " @@ -482,7 +434,7 @@ msgid "" "discussion of the rules for folding email headers." msgstr "" -#: ../../library/email.policy.rst:372 +#: ../../library/email.policy.rst:354 msgid "" "*value* may contain surrogateescaped binary data. There should be no " "surrogateescaped binary data in the string returned by the method." @@ -491,7 +443,7 @@ msgstr "" "のメソッドが返す文字列にはサロゲートエスケープされたバイナリーデータはありま" "せん。" -#: ../../library/email.policy.rst:378 +#: ../../library/email.policy.rst:360 msgid "" "The same as :meth:`fold`, except that the returned value should be a bytes " "object rather than a string." @@ -499,22 +451,22 @@ msgstr "" "返り値が文字列でなく bytes オブジェクトである点を除けば、:meth:`fold` と同じ" "です。" -#: ../../library/email.policy.rst:381 +#: ../../library/email.policy.rst:363 msgid "" "*value* may contain surrogateescaped binary data. These could be converted " "back into binary data in the returned bytes object." msgstr "" -"*value* はサロゲートエスケープされたバイナリデータを持つことがあります。これ" -"らは返されたbytesオブジェクト内でバイナリデータに変換されることがあります。" +"*value*はサロゲートエスケープされたバイナリデータを持つことがあります。これら" +"は返されたbytesオブジェクト内でバイナリデータに変換されることがあります。" -#: ../../library/email.policy.rst:388 +#: ../../library/email.policy.rst:370 msgid "" "This concrete :class:`Policy` provides behavior that is intended to be fully " "compliant with the current email RFCs. These include (but are not limited " "to) :rfc:`5322`, :rfc:`2047`, and the current MIME RFCs." msgstr "" -#: ../../library/email.policy.rst:392 +#: ../../library/email.policy.rst:374 msgid "" "This policy adds new header parsing and folding algorithms. Instead of " "simple strings, headers are ``str`` subclasses with attributes that depend " @@ -522,23 +474,23 @@ msgid "" "implement :rfc:`2047` and :rfc:`5322`." msgstr "" -#: ../../library/email.policy.rst:397 +#: ../../library/email.policy.rst:379 msgid "" "The default value for the :attr:`~email.policy.Policy.message_factory` " "attribute is :class:`~email.message.EmailMessage`." msgstr "" -#: ../../library/email.policy.rst:400 +#: ../../library/email.policy.rst:382 msgid "" "In addition to the settable attributes listed above that apply to all " "policies, this policy adds the following additional attributes:" msgstr "" -#: ../../library/email.policy.rst:403 +#: ../../library/email.policy.rst:385 msgid "[1]_" msgstr "[1]_" -#: ../../library/email.policy.rst:408 +#: ../../library/email.policy.rst:390 msgid "" "If ``False``, follow :rfc:`5322`, supporting non-ASCII characters in headers " "by encoding them as \"encoded words\". If ``True``, follow :rfc:`6532` and " @@ -546,7 +498,7 @@ msgid "" "passed to SMTP servers that support the ``SMTPUTF8`` extension (:rfc:`6531`)." msgstr "" -#: ../../library/email.policy.rst:417 +#: ../../library/email.policy.rst:399 msgid "" "If the value for a header in the ``Message`` object originated from a :mod:" "`~email.parser` (as opposed to being set by a program), this attribute " @@ -554,37 +506,37 @@ msgid "" "transforming the message back into serialized form. The possible values are:" msgstr "" -#: ../../library/email.policy.rst:424 +#: ../../library/email.policy.rst:406 msgid "``none``" msgstr "``none``" -#: ../../library/email.policy.rst:424 +#: ../../library/email.policy.rst:406 msgid "all source values use original folding" msgstr "" -#: ../../library/email.policy.rst:426 +#: ../../library/email.policy.rst:408 msgid "``long``" msgstr "``long``" -#: ../../library/email.policy.rst:426 +#: ../../library/email.policy.rst:408 msgid "" "source values that have any line that is longer than ``max_line_length`` " "will be refolded" msgstr "" -#: ../../library/email.policy.rst:429 +#: ../../library/email.policy.rst:411 msgid "``all``" msgstr "``all``" -#: ../../library/email.policy.rst:429 +#: ../../library/email.policy.rst:411 msgid "all values are refolded." msgstr "" -#: ../../library/email.policy.rst:432 +#: ../../library/email.policy.rst:414 msgid "The default is ``long``." msgstr "デフォルトは ``long`` です。" -#: ../../library/email.policy.rst:437 +#: ../../library/email.policy.rst:419 msgid "" "A callable that takes two arguments, ``name`` and ``value``, where ``name`` " "is a header field name and ``value`` is an unfolded header field value, and " @@ -595,7 +547,7 @@ msgid "" "custom parsing will be added in the future." msgstr "" -#: ../../library/email.policy.rst:448 +#: ../../library/email.policy.rst:430 msgid "" "An object with at least two methods: get_content and set_content. When the :" "meth:`~email.message.EmailMessage.get_content` or :meth:`~email.message." @@ -606,20 +558,20 @@ msgid "" "``content_manager`` is set to :data:`~email.contentmanager.raw_data_manager`." msgstr "" -#: ../../library/email.policy.rst:460 ../../library/email.policy.rst:618 +#: ../../library/email.policy.rst:442 ../../library/email.policy.rst:600 msgid "" "The class provides the following concrete implementations of the abstract " "methods of :class:`Policy`:" msgstr "このクラスは :class:`Policy` の抽象メソッドの具象実装を提供します:" -#: ../../library/email.policy.rst:466 +#: ../../library/email.policy.rst:448 msgid "" "Returns the value of the :attr:`~email.headerregistry.BaseHeader.max_count` " "attribute of the specialized class used to represent the header with the " "given name." msgstr "" -#: ../../library/email.policy.rst:474 ../../library/email.policy.rst:624 +#: ../../library/email.policy.rst:456 ../../library/email.policy.rst:606 msgid "" "The name is parsed as everything up to the '``:``' and returned unmodified. " "The value is determined by stripping leading whitespace off the remainder of " @@ -627,7 +579,7 @@ msgid "" "trailing carriage return or linefeed characters." msgstr "" -#: ../../library/email.policy.rst:482 +#: ../../library/email.policy.rst:464 msgid "" "The name is returned unchanged. If the input value has a ``name`` attribute " "and it matches *name* ignoring case, the value is returned unchanged. " @@ -636,7 +588,7 @@ msgid "" "``ValueError`` is raised if the input value contains CR or LF characters." msgstr "" -#: ../../library/email.policy.rst:492 +#: ../../library/email.policy.rst:474 msgid "" "If the value has a ``name`` attribute, it is returned to unmodified. " "Otherwise the *name*, and the *value* with any CR or LF characters removed, " @@ -645,7 +597,7 @@ msgid "" "character glyph." msgstr "" -#: ../../library/email.policy.rst:501 +#: ../../library/email.policy.rst:483 msgid "" "Header folding is controlled by the :attr:`refold_source` policy setting. A " "value is considered to be a 'source value' if and only if it does not have a " @@ -657,7 +609,7 @@ msgid "" "current policy." msgstr "" -#: ../../library/email.policy.rst:510 +#: ../../library/email.policy.rst:492 msgid "" "Source values are split into lines using :meth:`~str.splitlines`. If the " "value is not to be refolded, the lines are rejoined using the ``linesep`` " @@ -667,7 +619,7 @@ msgid "" "using the ``unknown-8bit`` charset." msgstr "" -#: ../../library/email.policy.rst:520 +#: ../../library/email.policy.rst:502 msgid "" "The same as :meth:`fold` if :attr:`~Policy.cte_type` is ``7bit``, except " "that the returned value is bytes." @@ -675,7 +627,7 @@ msgstr "" "返り値が bytes である点を除いて、:attr:`~Policy.cte_type` が ``7bit`` の場合" "は :meth:`fold` と同じです。" -#: ../../library/email.policy.rst:523 +#: ../../library/email.policy.rst:505 msgid "" "If :attr:`~Policy.cte_type` is ``8bit``, non-ASCII binary data is converted " "back into bytes. Headers with binary data are not refolded, regardless of " @@ -683,7 +635,7 @@ msgid "" "binary data consists of single byte characters or multibyte characters." msgstr "" -#: ../../library/email.policy.rst:530 +#: ../../library/email.policy.rst:512 msgid "" "The following instances of :class:`EmailPolicy` provide defaults suitable " "for specific application domains. Note that in the future the behavior of " @@ -691,7 +643,7 @@ msgid "" "conform even more closely to the RFCs relevant to their domains." msgstr "" -#: ../../library/email.policy.rst:538 +#: ../../library/email.policy.rst:520 msgid "" "An instance of ``EmailPolicy`` with all defaults unchanged. This policy " "uses the standard Python ``\\n`` line endings rather than the RFC-correct " @@ -700,13 +652,13 @@ msgstr "" "デフォルト値を変更していない ``EmailPolicy`` のインスタンスです。このポリシー" "の行末は、 RFC で正しい ``\\r\\n`` ではなく Python の標準の ``\\n`` です。" -#: ../../library/email.policy.rst:545 +#: ../../library/email.policy.rst:527 msgid "" "Suitable for serializing messages in conformance with the email RFCs. Like " "``default``, but with ``linesep`` set to ``\\r\\n``, which is RFC compliant." msgstr "" -#: ../../library/email.policy.rst:552 +#: ../../library/email.policy.rst:534 msgid "" "The same as ``SMTP`` except that :attr:`~EmailPolicy.utf8` is ``True``. " "Useful for serializing messages to a message store without using encoded " @@ -715,50 +667,46 @@ msgid "" "SMTP.send_message` method handles this automatically)." msgstr "" -#: ../../library/email.policy.rst:561 +#: ../../library/email.policy.rst:543 msgid "" "Suitable for serializing headers with for use in HTTP traffic. Like " "``SMTP`` except that ``max_line_length`` is set to ``None`` (unlimited)." msgstr "" -#: ../../library/email.policy.rst:567 +#: ../../library/email.policy.rst:549 msgid "" "Convenience instance. The same as ``default`` except that " "``raise_on_defect`` is set to ``True``. This allows any policy to be made " "strict by writing::" msgstr "" -#: ../../library/email.policy.rst:571 -msgid "somepolicy + policy.strict" -msgstr "" - -#: ../../library/email.policy.rst:574 +#: ../../library/email.policy.rst:556 msgid "" "With all of these :class:`EmailPolicies <.EmailPolicy>`, the effective API " "of the email package is changed from the Python 3.2 API in the following " "ways:" msgstr "" -#: ../../library/email.policy.rst:577 +#: ../../library/email.policy.rst:559 msgid "" "Setting a header on a :class:`~email.message.Message` results in that header " "being parsed and a header object created." msgstr "" -#: ../../library/email.policy.rst:580 +#: ../../library/email.policy.rst:562 msgid "" "Fetching a header value from a :class:`~email.message.Message` results in " "that header being parsed and a header object created and returned." msgstr "" -#: ../../library/email.policy.rst:584 +#: ../../library/email.policy.rst:566 msgid "" "Any header object, or any header that is refolded due to the policy " "settings, is folded using an algorithm that fully implements the RFC folding " "algorithms, including knowing where encoded words are required and allowed." msgstr "" -#: ../../library/email.policy.rst:589 +#: ../../library/email.policy.rst:571 msgid "" "From the application view, this means that any header obtained through the :" "class:`~email.message.EmailMessage` is a header object with extra " @@ -768,7 +716,7 @@ msgid "" "the unicode string into the correct RFC encoded form." msgstr "" -#: ../../library/email.policy.rst:596 +#: ../../library/email.policy.rst:578 msgid "" "The header objects and their attributes are described in :mod:`~email." "headerregistry`." @@ -776,7 +724,7 @@ msgstr "" "ヘッダオブジェクトとその属性は :mod:`~email.headerregistry` で述べられていま" "す。" -#: ../../library/email.policy.rst:603 +#: ../../library/email.policy.rst:585 msgid "" "This concrete :class:`Policy` is the backward compatibility policy. It " "replicates the behavior of the email package in Python 3.2. The :mod:" @@ -785,28 +733,28 @@ msgid "" "of the email package is to maintain compatibility with Python 3.2." msgstr "" -#: ../../library/email.policy.rst:609 +#: ../../library/email.policy.rst:591 msgid "" "The following attributes have values that are different from the :class:" "`Policy` default:" msgstr "以下の属性は :class:`Policy` デフォルトとは異なる値を持ちます:" -#: ../../library/email.policy.rst:615 +#: ../../library/email.policy.rst:597 msgid "The default is ``True``." msgstr "デフォルトは ``True`` です。" -#: ../../library/email.policy.rst:632 +#: ../../library/email.policy.rst:614 msgid "The name and value are returned unmodified." msgstr "名前と値は変更されずに返されます。" -#: ../../library/email.policy.rst:637 +#: ../../library/email.policy.rst:619 msgid "" "If the value contains binary data, it is converted into a :class:`~email." "header.Header` object using the ``unknown-8bit`` charset. Otherwise it is " "returned unmodified." msgstr "" -#: ../../library/email.policy.rst:644 +#: ../../library/email.policy.rst:626 msgid "" "Headers are folded using the :class:`~email.header.Header` folding " "algorithm, which preserves existing line breaks in the value, and wraps each " @@ -814,7 +762,7 @@ msgid "" "encoded using the ``unknown-8bit`` charset." msgstr "" -#: ../../library/email.policy.rst:652 +#: ../../library/email.policy.rst:634 msgid "" "Headers are folded using the :class:`~email.header.Header` folding " "algorithm, which preserves existing line breaks in the value, and wraps each " @@ -824,7 +772,7 @@ msgid "" "and any (RFC invalid) binary data it may contain." msgstr "" -#: ../../library/email.policy.rst:662 +#: ../../library/email.policy.rst:644 msgid "" "An instance of :class:`Compat32`, providing backward compatibility with the " "behavior of the email package in Python 3.2." @@ -832,11 +780,11 @@ msgstr "" ":class:`Compat32` のインスタンスで、Python 3.2 の email パッケージの挙動との" "後方互換性を提供します。" -#: ../../library/email.policy.rst:667 +#: ../../library/email.policy.rst:649 msgid "Footnotes" msgstr "脚注" -#: ../../library/email.policy.rst:668 +#: ../../library/email.policy.rst:650 msgid "" "Originally added in 3.3 as a :term:`provisional feature `." diff --git a/library/email.utils.po b/library/email.utils.po index eb20c8589..bd04612fb 100644 --- a/library/email.utils.po +++ b/library/email.utils.po @@ -1,31 +1,31 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: +# tomo, 2018 # Takanori Suzuki , 2021 -# tomo, 2021 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 01:05+0000\n" -"Last-Translator: tomo, 2021\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2018-11-22 01:00+0000\n" +"Last-Translator: Takanori Suzuki , 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/email.utils.rst:2 -msgid ":mod:`!email.utils`: Miscellaneous utilities" -msgstr "" +msgid ":mod:`email.utils`: Miscellaneous utilities" +msgstr ":mod:`email.utils`: 多方面のユーティリティ" #: ../../library/email.utils.rst:7 msgid "**Source code:** :source:`Lib/email/utils.py`" @@ -45,14 +45,15 @@ msgid "" "return current time. Otherwise *dt* argument should be a :class:`~datetime." "datetime` instance, and it is converted to the local time zone according to " "the system time zone database. If *dt* is naive (that is, ``dt.tzinfo`` is " -"``None``), it is assumed to be in local time." -msgstr "" - -#: ../../library/email.utils.rst:24 -msgid "The *isdst* parameter." +"``None``), it is assumed to be in local time. In this case, a positive or " +"zero value for *isdst* causes ``localtime`` to presume initially that summer " +"time (for example, Daylight Saving Time) is or is not (respectively) in " +"effect for the specified time. A negative value for *isdst* causes the " +"``localtime`` to attempt to divine whether summer time is in effect for the " +"specified time." msgstr "" -#: ../../library/email.utils.rst:29 +#: ../../library/email.utils.rst:32 msgid "" "Returns a string suitable for an :rfc:`2822`\\ -compliant :mailheader:" "`Message-ID` header. Optional *idstring* if given, is a string used to " @@ -63,11 +64,11 @@ msgid "" "consistent domain name across multiple hosts." msgstr "" -#: ../../library/email.utils.rst:37 +#: ../../library/email.utils.rst:40 msgid "Added the *domain* keyword." msgstr "*domain* キーワードが追加されました。" -#: ../../library/email.utils.rst:41 +#: ../../library/email.utils.rst:44 msgid "" "The remaining functions are part of the legacy (``Compat32``) email API. " "There is no need to directly use these with the new API, since the parsing " @@ -75,7 +76,7 @@ msgid "" "machinery of the new API." msgstr "" -#: ../../library/email.utils.rst:49 +#: ../../library/email.utils.rst:52 msgid "" "Return a new string with backslashes in *str* replaced by two backslashes, " "and double quotes replaced by backslash-double quote." @@ -84,7 +85,7 @@ msgstr "" "を返します。また、ダブルクォートはバックスラッシュ + ダブルクォートに置換され" "ます。" -#: ../../library/email.utils.rst:55 +#: ../../library/email.utils.rst:58 msgid "" "Return a new string which is an *unquoted* version of *str*. If *str* ends " "and begins with double quotes, they are stripped off. Likewise if *str* " @@ -94,7 +95,7 @@ msgstr "" "がダブルクォートだった場合、それらは取り除かれます。同様に *str* の先頭と末尾" "が角ブラケット (<、>) だった場合もそれらは取り除かれます。" -#: ../../library/email.utils.rst:62 +#: ../../library/email.utils.rst:65 msgid "" "Parse address -- which should be the value of some address-containing field " "such as :mailheader:`To` or :mailheader:`Cc` -- into its constituent " @@ -106,16 +107,7 @@ msgstr "" "した場合、これらの情報持つタプルを返します。失敗した場合は 2 要素のタプル " "``('', '')`` を返します。" -#: ../../library/email.utils.rst:67 ../../library/email.utils.rst:95 -msgid "" -"If *strict* is true, use a strict parser which rejects malformed inputs." -msgstr "" - -#: ../../library/email.utils.rst:69 ../../library/email.utils.rst:107 -msgid "Add *strict* optional parameter and reject malformed inputs by default." -msgstr "" - -#: ../../library/email.utils.rst:75 +#: ../../library/email.utils.rst:73 msgid "" "The inverse of :meth:`parseaddr`, this takes a 2-tuple of the form " "``(realname, email_address)`` and returns the string value suitable for a :" @@ -126,7 +118,7 @@ msgstr "" "て :mailheader:`To` や :mailheader:`Cc` ヘッダに適した文字列を返します。タプ" "ル *pair* の第1要素が偽である場合、第2要素の値をそのまま返します。" -#: ../../library/email.utils.rst:80 +#: ../../library/email.utils.rst:78 msgid "" "Optional *charset* is the character set that will be used in the :rfc:`2047` " "encoding of the ``realname`` if the ``realname`` contains non-ASCII " @@ -137,33 +129,24 @@ msgstr "" "rfc:`2047` エンコーディングに使われる文字集合です。:class:`str` か :class:" "`~email.charset.Charset` のインスタンスで、デフォルトは ``utf-8`` です。" -#: ../../library/email.utils.rst:85 +#: ../../library/email.utils.rst:83 msgid "Added the *charset* option." msgstr "*charset* オプションが追加されました。" -#: ../../library/email.utils.rst:91 +#: ../../library/email.utils.rst:89 msgid "" "This method returns a list of 2-tuples of the form returned by " "``parseaddr()``. *fieldvalues* is a sequence of header field values as might " -"be returned by :meth:`Message.get_all `." -msgstr "" - -#: ../../library/email.utils.rst:97 -msgid "Here's a simple example that gets all the recipients of a message::" +"be returned by :meth:`Message.get_all `. " +"Here's a simple example that gets all the recipients of a message::" msgstr "" +"このメソッドは ``parseaddr()`` が返す形式の 2 要素タプルのリストを返しま" +"す。\n" +"*fieldvalues* は :meth:`Message.get_all ` が返" +"すような一連のヘッダフィールドです。\n" +"以下はメッセージの全ての受信者を得る簡単な例です::" -#: ../../library/email.utils.rst:99 -msgid "" -"from email.utils import getaddresses\n" -"\n" -"tos = msg.get_all('to', [])\n" -"ccs = msg.get_all('cc', [])\n" -"resent_tos = msg.get_all('resent-to', [])\n" -"resent_ccs = msg.get_all('resent-cc', [])\n" -"all_recipients = getaddresses(tos + ccs + resent_tos + resent_ccs)" -msgstr "" - -#: ../../library/email.utils.rst:113 +#: ../../library/email.utils.rst:105 msgid "" "Attempts to parse a date according to the rules in :rfc:`2822`. however, " "some mailers don't follow that format as specified, so :func:`parsedate` " @@ -183,7 +166,7 @@ msgstr "" "失敗した場合は ``None`` を返します。\n" "返されるタプルの 6、7、8番目の添字は使用不可なので注意してください。" -#: ../../library/email.utils.rst:124 +#: ../../library/email.utils.rst:116 msgid "" "Performs the same function as :func:`parsedate`, but returns either ``None`` " "or a 10-tuple; the first 9 elements make up a tuple that can be passed " @@ -194,12 +177,10 @@ msgid "" "the result tuple are not usable." msgstr "" -#: ../../library/email.utils.rst:134 +#: ../../library/email.utils.rst:126 msgid "" "The inverse of :func:`format_datetime`. Performs the same function as :func:" -"`parsedate`, but on success returns a :mod:`~datetime.datetime`; otherwise " -"``ValueError`` is raised if *date* contains an invalid value such as an hour " -"greater than 23 or a timezone offset not between -24 and 24 hours. If the " +"`parsedate`, but on success returns a :mod:`~datetime.datetime`. If the " "input date has a timezone of ``-0000``, the ``datetime`` will be a naive " "``datetime``, and if the date is conforming to the RFCs it will represent a " "time in UTC but with no indication of the actual source timezone of the " @@ -207,8 +188,18 @@ msgid "" "offset, the ``datetime`` will be an aware ``datetime`` with the " "corresponding a :class:`~datetime.timezone` :class:`~datetime.tzinfo`." msgstr "" - -#: ../../library/email.utils.rst:150 +":func:`format_datetime` の逆です。\n" +":func:`parsedate` と同様に機能しますが、成功時に :mod:`~datetime.datetime` を" +"返します。\n" +"入力文字列がタイムゾーン ``-0000`` を持つ場合、``datetime`` はナイーブな " +"``datetime`` です。\n" +"日付が RFC に従っている場合、``datetime`` は UTC での時間を表しますが、日付の" +"元になったメッセージの実際のタイムゾーンについての情報を持ちません。\n" +"入力データにその他の有効なタイムゾーンの差がある場合、\n" +"``datetime`` は対応する :class:`~datetime.timezone` :class:`~datetime." +"tzinfo` のあるそつのない ``datetime`` です。" + +#: ../../library/email.utils.rst:140 msgid "" "Turn a 10-tuple as returned by :func:`parsedate_tz` into a UTC timestamp " "(seconds since the Epoch). If the timezone item in the tuple is ``None``, " @@ -218,22 +209,21 @@ msgstr "" "からの秒数) に変換します。与えられた時間帯が ``None`` である場合、時間帯とし" "て現地時間 (localtime) が仮定されます。" -#: ../../library/email.utils.rst:157 +#: ../../library/email.utils.rst:147 msgid "Returns a date string as per :rfc:`2822`, e.g.::" msgstr "日付を :rfc:`2822` 形式の文字列で返します。例::" -#: ../../library/email.utils.rst:159 -msgid "Fri, 09 Nov 2001 01:08:47 -0000" -msgstr "" - -#: ../../library/email.utils.rst:161 +#: ../../library/email.utils.rst:151 msgid "" -"Optional *timeval* if given is a floating-point time value as accepted by :" +"Optional *timeval* if given is a floating point time value as accepted by :" "func:`time.gmtime` and :func:`time.localtime`, otherwise the current time is " "used." msgstr "" +"与えられた場合、オプションの *timeval* は :func:`time.gmtime` や :func:`time." +"localtime` に渡すことの出来る浮動小数の時刻です。\n" +"それ以外の場合、現在時刻が使われます。" -#: ../../library/email.utils.rst:165 +#: ../../library/email.utils.rst:155 msgid "" "Optional *localtime* is a flag that when ``True``, interprets *timeval*, and " "returns a date relative to the local timezone instead of UTC, properly " @@ -245,7 +235,7 @@ msgstr "" "おそらく夏時間も考慮するでしょう。デフォルトは ``False`` で、UTC が使われま" "す。" -#: ../../library/email.utils.rst:170 +#: ../../library/email.utils.rst:160 msgid "" "Optional *usegmt* is a flag that when ``True``, outputs a date string with " "the timezone as an ascii string ``GMT``, rather than a numeric ``-0000``. " @@ -257,7 +247,7 @@ msgstr "" "はプロトコルによっては (例えば HTTP) 必要です。これは *localtime* が " "``False`` のときのみ適用されます。デフォルトは ``False`` です。" -#: ../../library/email.utils.rst:178 +#: ../../library/email.utils.rst:168 msgid "" "Like ``formatdate``, but the input is a :mod:`datetime` instance. If it is " "a naive datetime, it is assumed to be \"UTC with no information about the " @@ -269,11 +259,11 @@ msgid "" "date headers." msgstr "" -#: ../../library/email.utils.rst:192 +#: ../../library/email.utils.rst:182 msgid "Decode the string *s* according to :rfc:`2231`." msgstr ":rfc:`2231` に従って文字列 *s* をデコードします。" -#: ../../library/email.utils.rst:197 +#: ../../library/email.utils.rst:187 msgid "" "Encode the string *s* according to :rfc:`2231`. Optional *charset* and " "*language*, if given is the character set name and language name to use. If " @@ -287,7 +277,7 @@ msgstr "" "*charset* は与えられているが *language* が与えられていない場合、文字列 *s* " "は *language* の空文字列を使ってエンコードされます。" -#: ../../library/email.utils.rst:205 +#: ../../library/email.utils.rst:195 msgid "" "When a header parameter is encoded in :rfc:`2231` format, :meth:`Message." "get_param ` may return a 3-tuple containing " @@ -309,7 +299,7 @@ msgstr "" "た場合の非常用文字セットとして使われます。デフォルトでは、この値は ``'us-" "ascii'`` です。" -#: ../../library/email.utils.rst:214 +#: ../../library/email.utils.rst:204 msgid "" "For convenience, if the *value* passed to :func:`collapse_rfc2231_value` is " "not a tuple, it should be a string and it is returned unquoted." @@ -318,7 +308,7 @@ msgstr "" "場合には、これは文字列でなければなりません。その場合にはクォートを除いた文字" "列を返します。" -#: ../../library/email.utils.rst:220 +#: ../../library/email.utils.rst:210 msgid "" "Decode parameters list according to :rfc:`2231`. *params* is a sequence of " "2-tuples containing elements of the form ``(content-type, string-value)``." @@ -326,11 +316,11 @@ msgstr "" ":rfc:`2231` に従って引数のリストをデコードします。 *params* は ``(content-" "type, string-value)`` のような形式の 2 要素タプルです。" -#: ../../library/email.utils.rst:225 +#: ../../library/email.utils.rst:215 msgid "Footnotes" msgstr "脚注" -#: ../../library/email.utils.rst:226 +#: ../../library/email.utils.rst:216 msgid "" "Note that the sign of the timezone offset is the opposite of the sign of the " "``time.timezone`` variable for the same timezone; the latter variable " diff --git a/library/ensurepip.po b/library/ensurepip.po index 2a8ba6378..aa79678ae 100644 --- a/library/ensurepip.po +++ b/library/ensurepip.po @@ -1,38 +1,36 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Arihiro TAKASE, 2023 -# 石井明久, 2024 -# tomo, 2024 +# Arihiro TAKASE, 2017 +# Yoshikazu KARASAWA , 2017 +# 秘湯 , 2017 +# tomo, 2019 +# Tetsuo Koyama , 2020 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-30 14:22+0000\n" -"PO-Revision-Date: 2021-06-28 01:05+0000\n" -"Last-Translator: tomo, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-03-02 05:36+0000\n" +"PO-Revision-Date: 2017-02-16 23:09+0000\n" +"Last-Translator: Tetsuo Koyama , 2020\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/ensurepip.rst:2 -msgid ":mod:`!ensurepip` --- Bootstrapping the ``pip`` installer" -msgstr ":mod:`!ensurepip` --- ``pip`` インストーラーのブートストラップ" +msgid ":mod:`ensurepip` --- Bootstrapping the ``pip`` installer" +msgstr ":mod:`ensurepip` --- ``pip`` インストーラのブートストラップ" -#: ../../library/ensurepip.rst:10 -msgid "**Source code:** :source:`Lib/ensurepip`" -msgstr "**ソースコード:** :source:`Lib/ensurepip`" - -#: ../../library/ensurepip.rst:14 +#: ../../library/ensurepip.rst:12 msgid "" "The :mod:`ensurepip` package provides support for bootstrapping the ``pip`` " "installer into an existing Python installation or virtual environment. This " @@ -47,7 +45,7 @@ msgstr "" "な安定版が CPython リファレンスインタープリタのメンテナンスリリースや " "feature リリースにバンドルされていることを反映しています。" -#: ../../library/ensurepip.rst:21 +#: ../../library/ensurepip.rst:19 msgid "" "In most cases, end users of Python shouldn't need to invoke this module " "directly (as ``pip`` should be bootstrapped by default), but it may be " @@ -60,7 +58,7 @@ msgstr "" "を構築したり、明示的に ``pip`` をアンインストールした場合、直接呼び出す必要が" "あるかもしれません。" -#: ../../library/ensurepip.rst:29 +#: ../../library/ensurepip.rst:27 msgid "" "This module *does not* access the internet. All of the components needed to " "bootstrap ``pip`` are included as internal parts of the package." @@ -68,68 +66,50 @@ msgstr "" "このモジュールはインターネットに *アクセスしません*。``pip`` のブートストラッ" "プに必要な全てはこのパッケージの一部として含まれています。" -#: ../../library/ensurepip.rst:35 +#: ../../library/ensurepip.rst:34 msgid ":ref:`installing-index`" msgstr ":ref:`installing-index`" -#: ../../library/ensurepip.rst:36 +#: ../../library/ensurepip.rst:34 msgid "The end user guide for installing Python packages" msgstr "エンドユーザーが Python パッケージをインストールする際のガイドです。" -#: ../../library/ensurepip.rst:38 +#: ../../library/ensurepip.rst:36 msgid ":pep:`453`: Explicit bootstrapping of pip in Python installations" msgstr ":pep:`453`: Python インストールの際の明示的なpipのブートストラッピング" -#: ../../library/ensurepip.rst:39 +#: ../../library/ensurepip.rst:37 msgid "The original rationale and specification for this module." msgstr "このモジュールのもともとの論拠と仕様。" -#: ../../includes/wasm-mobile-notavail.rst:3 -msgid "Availability" -msgstr "" - -#: ../../includes/wasm-mobile-notavail.rst:5 -msgid "" -"This module is not supported on :ref:`mobile platforms ` or :ref:`WebAssembly platforms `." -msgstr "" - -#: ../../library/ensurepip.rst:44 +#: ../../library/ensurepip.rst:41 msgid "Command line interface" msgstr "コマンドラインインターフェイス" -#: ../../library/ensurepip.rst:48 +#: ../../library/ensurepip.rst:43 msgid "" "The command line interface is invoked using the interpreter's ``-m`` switch." msgstr "" "コマンドラインインターフェースを起動するには ``-m`` スイッチをつけてインター" "プリターを使用します。" -#: ../../library/ensurepip.rst:50 +#: ../../library/ensurepip.rst:45 msgid "The simplest possible invocation is::" msgstr "最も簡単な起動方法は::" -#: ../../library/ensurepip.rst:52 -msgid "python -m ensurepip" -msgstr "" - -#: ../../library/ensurepip.rst:54 +#: ../../library/ensurepip.rst:49 msgid "" "This invocation will install ``pip`` if it is not already installed, but " "otherwise does nothing. To ensure the installed version of ``pip`` is at " -"least as recent as the one available in ``ensurepip``, pass the ``--" +"least as recent as the one bundled with ``ensurepip``, pass the ``--" "upgrade`` option::" msgstr "" "この起動方法は ``pip`` をインストールします。既にインストールされていた場合は" -"何もしません。インストールされた ``pip`` のバージョンを ``ensurepip`` で利用" -"できるもののうち、できるだけ新しいものにするためには、``--upgrade`` オプショ" -"ンを追加して::" +"何もしません。インストールされた ``pip`` のバージョンを ``ensurepip`` にバン" +"ドルされているもののうち、できるだけ新しいものにするためには、``--upgrade`` " +"オプションを追加して::" -#: ../../library/ensurepip.rst:59 -msgid "python -m ensurepip --upgrade" -msgstr "" - -#: ../../library/ensurepip.rst:61 +#: ../../library/ensurepip.rst:56 msgid "" "By default, ``pip`` is installed into the current virtual environment (if " "one is active) or into the system site packages (if there is no active " @@ -140,21 +120,27 @@ msgstr "" "イトパッケージ(もしアクティブな仮想環境がなければ)にインストールされます。イ" "ンストール先は2つの追加コマンドラインオプションで制御できます:" -#: ../../library/ensurepip.rst:68 +#: ../../library/ensurepip.rst:61 msgid "" -"Installs ``pip`` relative to the given root directory rather than the root " -"of the currently active virtual environment (if any) or the default root for " -"the current Python installation." +"``--root ``: Installs ``pip`` relative to the given root directory " +"rather than the root of the currently active virtual environment (if any) or " +"the default root for the current Python installation." msgstr "" +"``--root ``: 現在のアクティブな仮想環境(もしあれば)の root や現在インス" +"トールされている Python の root ディレクトリに入れる代わりに、与えられたディ" +"レクトリを root として ``pip`` をインストールします。" -#: ../../library/ensurepip.rst:74 +#: ../../library/ensurepip.rst:64 msgid "" -"Installs ``pip`` into the user site packages directory rather than globally " -"for the current Python installation (this option is not permitted inside an " -"active virtual environment)." +"``--user``: Installs ``pip`` into the user site packages directory rather " +"than globally for the current Python installation (this option is not " +"permitted inside an active virtual environment)." msgstr "" +"``--user``: は、現在インストールされている Python にグローバルにインストール" +"される代わりに、ユーザーの site packages ディレクトリに ``pip`` をインストー" +"ルします(このオプションはアクティブな仮想環境のもとでは許可されません)。" -#: ../../library/ensurepip.rst:78 +#: ../../library/ensurepip.rst:68 msgid "" "By default, the scripts ``pipX`` and ``pipX.Y`` will be installed (where X.Y " "stands for the version of Python used to invoke ``ensurepip``). The scripts " @@ -164,45 +150,49 @@ msgstr "" "``ensurepip`` を起動したPythonのバージョン)。インストールされるスクリプトは2" "つの追加コマンドラインオプションで制御できます:" -#: ../../library/ensurepip.rst:85 +#: ../../library/ensurepip.rst:73 msgid "" -"If an alternate installation is requested, the ``pipX`` script will *not* be " -"installed." +"``--altinstall``: if an alternate installation is requested, the ``pipX`` " +"script will *not* be installed." msgstr "" +"``--altinstall``: alternate インストール。X.Y でバージョン付けされたものだけ" +"がインストールされます。" -#: ../../library/ensurepip.rst:90 +#: ../../library/ensurepip.rst:76 msgid "" -"If a \"default pip\" installation is requested, the ``pip`` script will be " -"installed in addition to the two regular scripts." +"``--default-pip``: if a \"default pip\" installation is requested, the " +"``pip`` script will be installed in addition to the two regular scripts." msgstr "" +"``--default-pip``: \"default pip\" のインストールが要求されると、通常の二つ" +"のスクリプトに加えて ``pip`` スクリプトがインストールされます。" -#: ../../library/ensurepip.rst:93 +#: ../../library/ensurepip.rst:79 msgid "" "Providing both of the script selection options will trigger an exception." msgstr "2つのスクリプト選択オプションを指定すると例外が発生します。" -#: ../../library/ensurepip.rst:96 +#: ../../library/ensurepip.rst:83 msgid "Module API" msgstr "モジュール API" -#: ../../library/ensurepip.rst:98 +#: ../../library/ensurepip.rst:85 msgid ":mod:`ensurepip` exposes two functions for programmatic use:" msgstr "" ":mod:`ensurepip` はプログラムから利用出来る 2 つの関数を公開しています:" -#: ../../library/ensurepip.rst:102 +#: ../../library/ensurepip.rst:89 msgid "" -"Returns a string specifying the available version of pip that will be " +"Returns a string specifying the bundled version of pip that will be " "installed when bootstrapping an environment." msgstr "" -"環境にブートストラップする際にインストールされることになる利用可能な pip の" -"バージョンを示す文字列を返します。" +"環境にブートストラップする際にインストールされることになる pip のバンドルバー" +"ジョンを示す文字列を返します。" -#: ../../library/ensurepip.rst:109 +#: ../../library/ensurepip.rst:96 msgid "Bootstraps ``pip`` into the current or designated environment." msgstr "現在の環境あるいは指示された環境へ ``pip`` をブートストラップします。" -#: ../../library/ensurepip.rst:111 +#: ../../library/ensurepip.rst:98 msgid "" "*root* specifies an alternative root directory to install relative to. If " "*root* is ``None``, then installation uses the default install location for " @@ -211,15 +201,15 @@ msgstr "" "*root* で、インストールの root ディレクトリを変更します。 *root* が ``None`` " "の場合は、インストールは現在の環境でのデフォルトの場所を使います。" -#: ../../library/ensurepip.rst:115 +#: ../../library/ensurepip.rst:102 msgid "" "*upgrade* indicates whether or not to upgrade an existing installation of an " -"earlier version of ``pip`` to the available version." +"earlier version of ``pip`` to the bundled version." msgstr "" -"*upgrade* で、 ``pip`` の利用可能なバージョンとして、インストール済みの以前の" +"*upgrade* で、 ``pip`` のバンドルのバージョンとして、インストール済みの以前の" "バージョンをアップグレードするかどうかを指定します。" -#: ../../library/ensurepip.rst:118 +#: ../../library/ensurepip.rst:105 msgid "" "*user* indicates whether to use the user scheme rather than installing " "globally." @@ -227,7 +217,7 @@ msgstr "" "*user* で、グローバルなインストールではなく user スキームを使うかどうかを指定" "します。" -#: ../../library/ensurepip.rst:121 +#: ../../library/ensurepip.rst:108 msgid "" "By default, the scripts ``pipX`` and ``pipX.Y`` will be installed (where X.Y " "stands for the current version of Python)." @@ -235,12 +225,12 @@ msgstr "" "デフォルトではスクリプト ``pipX`` と ``pipX.Y`` はインストールされます(X.Yは" "Pythonの現在のバージョンです)。" -#: ../../library/ensurepip.rst:124 +#: ../../library/ensurepip.rst:111 msgid "If *altinstall* is set, then ``pipX`` will *not* be installed." msgstr "" "*altinstall* が設定されていた場合は ``pipX`` はインストール *されません*。" -#: ../../library/ensurepip.rst:126 +#: ../../library/ensurepip.rst:113 msgid "" "If *default_pip* is set, then ``pip`` will be installed in addition to the " "two regular scripts." @@ -248,14 +238,14 @@ msgstr "" "*default_pip* がセットされていれば、 ``pip`` スクリプトが2つの標準スクリプト" "と共にインストールされます。" -#: ../../library/ensurepip.rst:129 +#: ../../library/ensurepip.rst:116 msgid "" "Setting both *altinstall* and *default_pip* will trigger :exc:`ValueError`." msgstr "" "*altinstall* と *default_pip* の両方を指定すると、 :exc:`ValueError` を起こし" "ます。" -#: ../../library/ensurepip.rst:132 +#: ../../library/ensurepip.rst:119 msgid "" "*verbosity* controls the level of output to :data:`sys.stdout` from the " "bootstrapping operation." @@ -263,7 +253,7 @@ msgstr "" "*verbosity* でブートストラップ操作からの :data:`sys.stdout` への出力の冗長レ" "ベルをコントロールします。" -#: ../../library/ensurepip.rst:135 +#: ../../library/ensurepip.rst:122 msgid "" "Raises an :ref:`auditing event ` ``ensurepip.bootstrap`` with " "argument ``root``." @@ -271,7 +261,7 @@ msgstr "" "引数 ``root`` 付きで :ref:`監査イベント ` ``ensurepip.bootstrap`` " "を送出します。" -#: ../../library/ensurepip.rst:139 +#: ../../library/ensurepip.rst:126 msgid "" "The bootstrapping process has side effects on both ``sys.path`` and ``os." "environ``. Invoking the command line interface in a subprocess instead " @@ -281,7 +271,7 @@ msgstr "" "ちます。代わりに、サブプロセスとしてコマンドラインインターフェイスを使うこと" "で、これら副作用を避けることが出来ます。" -#: ../../library/ensurepip.rst:145 +#: ../../library/ensurepip.rst:132 msgid "" "The bootstrapping process may install additional modules required by " "``pip``, but other software should not assume those dependencies will always " diff --git a/library/enum.po b/library/enum.po index e60c3db0f..165b4a308 100644 --- a/library/enum.po +++ b/library/enum.po @@ -1,34 +1,39 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: +# Masato HASHIMOTO , 2017 +# Arihiro TAKASE, 2017 +# 秘湯 , 2017 +# tomo, 2017 +# E. Kawashima, 2017 +# Shun Sakurai, 2017 +# Inada Naoki , 2017 +# Nozomu Kaneko , 2017 +# Naoki Nakamura , 2020 # Takanori Suzuki , 2021 -# tomo, 2022 -# Yosuke Miyashita, 2024 -# 石井明久, 2024 -# Arihiro TAKASE, 2024 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 01:05+0000\n" -"Last-Translator: Arihiro TAKASE, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-03-02 05:36+0000\n" +"PO-Revision-Date: 2017-02-16 23:09+0000\n" +"Last-Translator: Takanori Suzuki , 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/enum.rst:2 -msgid ":mod:`!enum` --- Support for enumerations" -msgstr ":mod:`!enum` --- 列挙型のサポート" +msgid ":mod:`enum` --- Support for enumerations" +msgstr ":mod:`enum` --- 列挙型のサポート" #: ../../library/enum.rst:14 msgid "**Source code:** :source:`Lib/enum.py`" @@ -36,1603 +41,1286 @@ msgstr "**ソースコード:** :source:`Lib/enum.py`" #: ../../library/enum.rst:18 msgid "" -"This page contains the API reference information. For tutorial information " -"and discussion of more advanced topics, see" +"An enumeration is a set of symbolic names (members) bound to unique, " +"constant values. Within an enumeration, the members can be compared by " +"identity, and the enumeration itself can be iterated over." msgstr "" -"このページには、リファレンス情報だけが含まれています。チュートリアルは、以下" -"のページを参照してください" - -#: ../../library/enum.rst:21 -msgid ":ref:`Basic Tutorial `" -msgstr ":ref:`基本チュートリアル `" +"列挙型は、一意の定数値に束縛された識別名 (メンバー) の集合です。列挙型の中で" +"メンバーの同一性を比較でき、列挙型自身でイテレートが可能です。" #: ../../library/enum.rst:22 -msgid ":ref:`Advanced Tutorial `" -msgstr ":ref:`上級チュートリアル `" - -#: ../../library/enum.rst:23 -msgid ":ref:`Enum Cookbook `" -msgstr ":ref:`Enum クックブック `" - -#: ../../library/enum.rst:27 -msgid "An enumeration:" -msgstr "列挙型とは:" - -#: ../../library/enum.rst:29 -msgid "is a set of symbolic names (members) bound to unique values" -msgstr "一意の値に紐付けられたシンボリックな名前の集合です" +msgid "Case of Enum Members" +msgstr "Enumメンバーは大文字/小文字?" -#: ../../library/enum.rst:30 +#: ../../library/enum.rst:24 msgid "" -"can be iterated over to return its canonical (i.e. non-alias) members in " -"definition order" +"Because Enums are used to represent constants we recommend using UPPER_CASE " +"names for enum members, and will be using that style in our examples." msgstr "" -"反復可能であり、定義順にその正規の(エイリアスでない)メンバーを返します" - -#: ../../library/enum.rst:32 -msgid "uses *call* syntax to return members by value" -msgstr "値を渡してメンバーを返すために、 *呼び出し* 構文を使用します" +"Enumクラス群は定数を表現するために使われるため、列挙型のメンバーの名前には" +"UPPER_CASEを使うことを推奨します。本ページのドキュメントのサンプルでもそのス" +"タイルを採用します。" -#: ../../library/enum.rst:33 -msgid "uses *index* syntax to return members by name" -msgstr "名前を受け取ってメンバーを返すために、 *インデックス* 構文を使用します" +#: ../../library/enum.rst:30 +msgid "Module Contents" +msgstr "モジュールコンテンツ" -#: ../../library/enum.rst:35 +#: ../../library/enum.rst:32 msgid "" -"Enumerations are created either by using :keyword:`class` syntax, or by " -"using function-call syntax::" +"This module defines four enumeration classes that can be used to define " +"unique sets of names and values: :class:`Enum`, :class:`IntEnum`, :class:" +"`Flag`, and :class:`IntFlag`. It also defines one decorator, :func:" +"`unique`, and one helper, :class:`auto`." msgstr "" -"列挙型は、:keyword:`class` 構文を使用するか、関数呼び出し構文を使用して作成さ" -"れます::" +"このモジュールでは一意の名前と値の集合を定義するのに使用できる 4 つの列挙型ク" +"ラス :class:`Enum`, :class:`IntEnum`, :class:`Flag`, :class:`IntFlag` を定義" +"しています。\n" +"このモジュールはデコレータの :func:`unique` とヘルパークラスの :class:`auto` " +"も定義しています。" -#: ../../library/enum.rst:38 +#: ../../library/enum.rst:39 msgid "" -">>> from enum import Enum\n" -"\n" -">>> # class syntax\n" -">>> class Color(Enum):\n" -"... RED = 1\n" -"... GREEN = 2\n" -"... BLUE = 3\n" -"\n" -">>> # functional syntax\n" -">>> Color = Enum('Color', [('RED', 1), ('GREEN', 2), ('BLUE', 3)])" +"Base class for creating enumerated constants. See section `Functional API`_ " +"for an alternate construction syntax." msgstr "" +"列挙型定数を作成する基底クラスです。もうひとつの構築構文については `機能 " +"API`_ を参照してください。" + +#: ../../library/enum.rst:44 +msgid "" +"Base class for creating enumerated constants that are also subclasses of :" +"class:`int`." +msgstr ":class:`int` のサブクラスでもある列挙型定数を作成する基底クラスです。" #: ../../library/enum.rst:49 msgid "" -"Even though we can use :keyword:`class` syntax to create Enums, Enums are " -"not normal Python classes. See :ref:`How are Enums different? ` for more details." +"Base class for creating enumerated constants that can be combined using the " +"bitwise operators without losing their :class:`IntFlag` membership. :class:" +"`IntFlag` members are also subclasses of :class:`int`." msgstr "" -"Enum の作成に :keyword:`class` 文を使用できるものの、Enum は通常の Python ク" -"ラスではありません。詳細は :ref:`Enum はどう違うのか? ` を参照してください。" - -#: ../../library/enum.rst:53 -msgid "Nomenclature" -msgstr "用語" +"列挙型定数を作成する基底クラスで、ビット演算子を使って組み合わせられ、その結" +"果も :class:`IntFlag` メンバーになります。\n" +":class:`IntFlag` は :class:`int` のサブクラスでもあります。" #: ../../library/enum.rst:55 -msgid "The class :class:`!Color` is an *enumeration* (or *enum*)" -msgstr "クラス :class:`!Color` は *列挙型* (または *Enum*) です" - -#: ../../library/enum.rst:56 msgid "" -"The attributes :attr:`!Color.RED`, :attr:`!Color.GREEN`, etc., are " -"*enumeration members* (or *members*) and are functionally constants." +"Base class for creating enumerated constants that can be combined using the " +"bitwise operations without losing their :class:`Flag` membership." msgstr "" -"属性 :attr:`!Color.RED`, :attr:`!Color.GREEN` などは *列挙型のメンバー* (また" -"は *メンバー*) で、機能的には定数です。" +"列挙型定数を作成する基底クラスで、ビット演算を使って組み合わせられ、その結果" +"も :class:`IntFlag` メンバーになります。" -#: ../../library/enum.rst:58 +#: ../../library/enum.rst:61 msgid "" -"The enum members have *names* and *values* (the name of :attr:`!Color.RED` " -"is ``RED``, the value of :attr:`!Color.BLUE` is ``3``, etc.)" +"Enum class decorator that ensures only one name is bound to any one value." msgstr "" -"列挙型のメンバーは *名前* と *値* を持ちます (:attr:`!Color.RED` の名前は " -"``RED`` 、 :attr:`!Color.BLUE` の値は ``3`` など。)" +"一つの名前だけがひとつの値に束縛されていることを保証する Enum クラスのデコ" +"レーターです。" #: ../../library/enum.rst:65 -msgid "Module Contents" -msgstr "モジュールコンテンツ" +msgid "" +"Instances are replaced with an appropriate value for Enum members. By " +"default, the initial value starts at 1." +msgstr "" +"インスタンスはそれぞれ、適切な値で置き換えられます。デフォルトでは、値は1から" +"はじまります。" #: ../../library/enum.rst:67 -msgid ":class:`EnumType`" -msgstr ":class:`EnumType`" - -#: ../../library/enum.rst:69 -msgid "The ``type`` for Enum and its subclasses." -msgstr "Enumおよびそのサブクラスのための ``type`` です。" +msgid "``Flag``, ``IntFlag``, ``auto``" +msgstr "``Flag``, ``IntFlag``, ``auto``" #: ../../library/enum.rst:71 -msgid ":class:`Enum`" -msgstr ":class:`Enum`" +msgid "Creating an Enum" +msgstr "Enum の作成" #: ../../library/enum.rst:73 -msgid "Base class for creating enumerated constants." -msgstr "列挙型定数を作成する基底クラスです。" - -#: ../../library/enum.rst:75 -msgid ":class:`IntEnum`" -msgstr ":class:`IntEnum`" - -#: ../../library/enum.rst:77 msgid "" -"Base class for creating enumerated constants that are also subclasses of :" -"class:`int`. (`Notes`_)" +"Enumerations are created using the :keyword:`class` syntax, which makes them " +"easy to read and write. An alternative creation method is described in " +"`Functional API`_. To define an enumeration, subclass :class:`Enum` as " +"follows::" msgstr "" -":class:`int` のサブクラスでもある列挙型定数を作成する基底クラスです。" -"(`Notes`_)" - -#: ../../library/enum.rst:80 -msgid ":class:`StrEnum`" -msgstr ":class:`StrEnum`" - -#: ../../library/enum.rst:82 -msgid "" -"Base class for creating enumerated constants that are also subclasses of :" -"class:`str`. (`Notes`_)" -msgstr "" -":class:`str` のサブクラスでもある列挙型定数を作成する基底クラスです。" -"(`Notes`_)" +"列挙型は読み書きが容易になるよう :keyword:`class` 文を使って作成します。もう" +"ひとつの作成方法は `機能 API`_ で説明しています。列挙型は以下のように :class:" +"`Enum` のサブクラスとして定義します::" #: ../../library/enum.rst:85 -msgid ":class:`Flag`" -msgstr ":class:`Flag`" +msgid "Enum member values" +msgstr "列挙型のメンバー値" #: ../../library/enum.rst:87 msgid "" -"Base class for creating enumerated constants that can be combined using the " -"bitwise operations without losing their :class:`Flag` membership." +"Member values can be anything: :class:`int`, :class:`str`, etc.. If the " +"exact value is unimportant you may use :class:`auto` instances and an " +"appropriate value will be chosen for you. Care must be taken if you mix :" +"class:`auto` with other values." msgstr "" -"列挙型定数を作成する基底クラスで、ビット演算を使って組み合わせられ、その結果" -"も :class:`IntFlag` メンバーになります。" - -#: ../../library/enum.rst:90 -msgid ":class:`IntFlag`" -msgstr ":class:`IntFlag`" +"メンバー値は何であっても構いません: :class:`int`, :class:`str` などなど。\n" +"正確な値が重要でない場合は、 :class:`auto` インスタンスを使っておくと、適切な" +"値が選ばれます。\n" +":class:`auto` とそれ以外の値を混ぜて使う場合は注意する必要があります。" #: ../../library/enum.rst:92 -msgid "" -"Base class for creating enumerated constants that can be combined using the " -"bitwise operators without losing their :class:`IntFlag` membership. :class:" -"`IntFlag` members are also subclasses of :class:`int`. (`Notes`_)" -msgstr "" -"列挙型定数を作成する基底クラスで、ビット演算子を使って組み合わせられ、その結" -"果も :class:`IntFlag` メンバーになります。\n" -":class:`IntFlag` は :class:`int` のサブクラスでもあります。(`Notes`_)" +msgid "Nomenclature" +msgstr "用語" -#: ../../library/enum.rst:96 -msgid ":class:`ReprEnum`" -msgstr ":class:`ReprEnum`" +#: ../../library/enum.rst:94 +msgid "The class :class:`Color` is an *enumeration* (or *enum*)" +msgstr "クラス :class:`Color` は *列挙型* (または *Enum*) です" -#: ../../library/enum.rst:98 +#: ../../library/enum.rst:95 msgid "" -"Used by :class:`IntEnum`, :class:`StrEnum`, and :class:`IntFlag` to keep " -"the :class:`str() ` of the mixed-in type." +"The attributes :attr:`Color.RED`, :attr:`Color.GREEN`, etc., are " +"*enumeration members* (or *enum members*) and are functionally constants." msgstr "" -":class:`IntEnum`、:class:`StrEnum`、および :class:`IntFlag` によって使用さ" -"れ、mix-inされた型の :class:`str() ` を保持します。" - -#: ../../library/enum.rst:101 -msgid ":class:`EnumCheck`" -msgstr ":class:`EnumCheck`" +"属性 :attr:`Color.RED`, :attr:`Color.GREEN` などは *列挙型のメンバー* (また" +"は *Enum メンバー*) で、機能的には定数です。" -#: ../../library/enum.rst:103 +#: ../../library/enum.rst:97 msgid "" -"An enumeration with the values ``CONTINUOUS``, ``NAMED_FLAGS``, and " -"``UNIQUE``, for use with :func:`verify` to ensure various constraints are " -"met by a given enumeration." +"The enum members have *names* and *values* (the name of :attr:`Color.RED` is " +"``RED``, the value of :attr:`Color.BLUE` is ``3``, etc.)" msgstr "" -"``CONTINUOUS``、``NAMED_FLAGS``、``UNIQUE`` の値を持つ列挙型です。 :func:" -"`verify` と共に使用して、指定された列挙型がさまざまな制約を満たしていることを" -"確認します。" - -#: ../../library/enum.rst:107 -msgid ":class:`FlagBoundary`" -msgstr ":class:`FlagBoundary`" +"列挙型のメンバーは *名前* と *値* を持ちます (:attr:`Color.RED` の名前は " +"``RED`` 、 :attr:`Color.BLUE` の値は ``3`` など。)" -#: ../../library/enum.rst:109 +#: ../../library/enum.rst:103 msgid "" -"An enumeration with the values ``STRICT``, ``CONFORM``, ``EJECT``, and " -"``KEEP`` which allows for more fine-grained control over how invalid values " -"are dealt with in an enumeration." +"Even though we use the :keyword:`class` syntax to create Enums, Enums are " +"not normal Python classes. See `How are Enums different?`_ for more details." msgstr "" -" ``STRICT``、``CONFORM``、``EJECT``、``KEEP`` の値を持つ列挙型です。列挙型で" -"の無効な値の扱いについて、より細かい制御が可能です。" +"Enum の作成に :keyword:`class` 文を使用するものの、Enum は通常の Python クラ" +"スではありません。詳細は `Enum はどう違うのか?`_ を参照してください。" -#: ../../library/enum.rst:113 -msgid ":class:`EnumDict`" -msgstr "" +#: ../../library/enum.rst:107 +msgid "Enumeration members have human readable string representations::" +msgstr "列挙型のメンバーは人が読める文字列表現を持ちます::" -#: ../../library/enum.rst:115 -msgid "A subclass of :class:`dict` for use when subclassing :class:`EnumType`." -msgstr "" +#: ../../library/enum.rst:112 +msgid "...while their ``repr`` has more information::" +msgstr "...その一方でそれらの ``repr`` はより多くの情報を持っています::" #: ../../library/enum.rst:117 -msgid ":class:`auto`" -msgstr ":class:`auto`" - -#: ../../library/enum.rst:119 -msgid "" -"Instances are replaced with an appropriate value for Enum members. :class:" -"`StrEnum` defaults to the lower-cased version of the member name, while " -"other Enums default to 1 and increase from there." -msgstr "" -"インスタンスは列挙型のメンバーに適切な値で置き換えられます。:class:`StrEnum` " -"ではデフォルトの値がメンバー名を小文字にしたものですが、その他の列挙型のデ" -"フォルトは1から連番で増加する値となります。" - -#: ../../library/enum.rst:123 -msgid ":func:`~enum.property`" -msgstr ":func:`~enum.property`" +msgid "The *type* of an enumeration member is the enumeration it belongs to::" +msgstr "列挙型メンバーの *データ型* はそれが所属する列挙型になります::" #: ../../library/enum.rst:125 -msgid "" -"Allows :class:`Enum` members to have attributes without conflicting with " -"member names. The ``value`` and ``name`` attributes are implemented this " -"way." -msgstr "" -"メンバー名との競合を避けながら :class:`Enum` メンバーに属性を持たせます。" -"``value`` 属性と ``name`` 属性はこの方法で実装されます。" +msgid "Enum members also have a property that contains just their item name::" +msgstr "Enum メンバーは自身の名前を持つだけのプロパティも持っています::" -#: ../../library/enum.rst:129 -msgid ":func:`unique`" -msgstr ":func:`unique`" +#: ../../library/enum.rst:130 +msgid "Enumerations support iteration, in definition order::" +msgstr "列挙型は定義順でのイテレーションをサポートしています::" -#: ../../library/enum.rst:131 +#: ../../library/enum.rst:146 msgid "" -"Enum class decorator that ensures only one name is bound to any one value." -msgstr "" -"一つの名前だけがひとつの値に束縛されていることを保証する Enum クラスのデコ" -"レーターです。" +"Enumeration members are hashable, so they can be used in dictionaries and " +"sets::" +msgstr "列挙型のメンバーはハッシュ化可能なため、辞書や集合で使用できます::" -#: ../../library/enum.rst:133 -msgid ":func:`verify`" -msgstr ":func:`verify`" +#: ../../library/enum.rst:156 +msgid "Programmatic access to enumeration members and their attributes" +msgstr "列挙型メンバーおよびそれらの属性へのプログラム的アクセス" -#: ../../library/enum.rst:135 +#: ../../library/enum.rst:158 msgid "" -"Enum class decorator that checks user-selectable constraints on an " -"enumeration." +"Sometimes it's useful to access members in enumerations programmatically (i." +"e. situations where ``Color.RED`` won't do because the exact color is not " +"known at program-writing time). ``Enum`` allows such access::" msgstr "" +"プログラム的にメンバーに番号でアクセスしたほうが便利な場合があります (すなわ" +"ち、プログラムを書いている時点で正確な色がまだわからなく、``Color.RED`` と書" +"くのが無理な場合など)。 ``Enum`` ではそのようなアクセスも可能です::" -#: ../../library/enum.rst:138 -msgid ":func:`member`" -msgstr ":func:`member`" - -#: ../../library/enum.rst:140 -msgid "Make ``obj`` a member. Can be used as a decorator." -msgstr "``obj`` をメンバーにします。デコレータとして使用できます。" - -#: ../../library/enum.rst:142 -msgid ":func:`nonmember`" -msgstr ":func:`nonmember`" - -#: ../../library/enum.rst:144 -msgid "Do not make ``obj`` a member. Can be used as a decorator." -msgstr "``obj`` をメンバーにしません。デコレータとして使用できます。" - -#: ../../library/enum.rst:146 -msgid ":func:`global_enum`" -msgstr ":func:`global_enum`" - -#: ../../library/enum.rst:148 -msgid "" -"Modify the :class:`str() ` and :func:`repr` of an enum to show its " -"members as belonging to the module instead of its class, and export the enum " -"members to the global namespace." +#: ../../library/enum.rst:167 +msgid "If you want to access enum members by *name*, use item access::" msgstr "" +"列挙型メンバーに *名前* でアクセスしたい場合はアイテムとしてアクセスできま" +"す::" -#: ../../library/enum.rst:152 -msgid ":func:`show_flag_values`" -msgstr ":func:`show_flag_values`" +#: ../../library/enum.rst:174 +msgid "If you have an enum member and need its :attr:`name` or :attr:`value`::" +msgstr "列挙型メンバーの :attr:`name` か :attr:`value` が必要な場合::" -#: ../../library/enum.rst:154 -msgid "Return a list of all power-of-two integers contained in a flag." -msgstr "フラグに含まれる、全ての2の累乗の整数のリストを返します。" +#: ../../library/enum.rst:184 +msgid "Duplicating enum members and values" +msgstr "列挙型メンバーと値の重複" -#: ../../library/enum.rst:157 -msgid "``Flag``, ``IntFlag``, ``auto``" -msgstr "``Flag``, ``IntFlag``, ``auto``" +#: ../../library/enum.rst:186 +msgid "Having two enum members with the same name is invalid::" +msgstr "同じ名前の列挙型メンバーを複数持つことはできません::" -#: ../../library/enum.rst:158 +#: ../../library/enum.rst:196 msgid "" -"``StrEnum``, ``EnumCheck``, ``ReprEnum``, ``FlagBoundary``, ``property``, " -"``member``, ``nonmember``, ``global_enum``, ``show_flag_values``" +"However, two enum members are allowed to have the same value. Given two " +"members A and B with the same value (and A defined first), B is an alias to " +"A. By-value lookup of the value of A and B will return A. By-name lookup " +"of B will also return A::" msgstr "" -"``StrEnum``, ``EnumCheck``, ``ReprEnum``, ``FlagBoundary``, ``property``, " -"``member``, ``nonmember``, ``global_enum``, ``show_flag_values``" +"ただし、複数の列挙型メンバーが同じ値を持つことはできます。同じ値を持つ 2 つの" +"メンバー A および B (先に定義したのは A) が与えられたとき、B は A の別名にな" +"ります。A および B を値で調べたとき、A が返されます。B を名前で調べたとき、A " +"が返されます::" -#: ../../library/enum.rst:159 -msgid "``EnumDict``" +#: ../../library/enum.rst:216 +msgid "" +"Attempting to create a member with the same name as an already defined " +"attribute (another member, a method, etc.) or attempting to create an " +"attribute with the same name as a member is not allowed." msgstr "" +"すでに定義されている属性と同じ名前のメンバー (一方がメンバーでもう一方がメ" +"ソッド、など) の作成、あるいはメンバーと同じ名前の属性の作成はできません。" -#: ../../library/enum.rst:164 -msgid "Data Types" -msgstr "データ型" +#: ../../library/enum.rst:222 +msgid "Ensuring unique enumeration values" +msgstr "番号付けの値が同一であることの確認" -#: ../../library/enum.rst:169 +#: ../../library/enum.rst:224 msgid "" -"*EnumType* is the :term:`metaclass` for *enum* enumerations. It is possible " -"to subclass *EnumType* -- see :ref:`Subclassing EnumType ` for details." +"By default, enumerations allow multiple names as aliases for the same value. " +"When this behavior isn't desired, the following decorator can be used to " +"ensure each value is used only once in the enumeration:" msgstr "" -"*EnumType* は *enum* 列挙型の :term:`メタクラス ` です。 " -"*EnumType* のサブクラスを作成することが可能です -- 詳細は :ref:`EnumTypeのサ" -"ブクラスを作る ` を参照してください。" +"デフォルトでは、前述のように複数の名前への同じ値の定義は別名とすることで許さ" +"れています。この挙動を望まない場合、以下のデコレーターを使用することで各値が" +"列挙型内で一意かどうか確認できます:" -#: ../../library/enum.rst:173 +#: ../../library/enum.rst:230 msgid "" -"``EnumType`` is responsible for setting the correct :meth:`!__repr__`, :meth:" -"`!__str__`, :meth:`!__format__`, and :meth:`!__reduce__` methods on the " -"final *enum*, as well as creating the enum members, properly handling " -"duplicates, providing iteration over the enum class, etc." +"A :keyword:`class` decorator specifically for enumerations. It searches an " +"enumeration's :attr:`__members__` gathering any aliases it finds; if any are " +"found :exc:`ValueError` is raised with the details::" msgstr "" +"列挙型専用の :keyword:`class` デコレーターです。列挙型の :attr:`__members__` " +"に別名がないかどうか検索します; 見つかった場合、:exc:`ValueError` が詳細情報" +"とともに送出されます::" -#: ../../library/enum.rst:180 -msgid "This method is called in two different ways:" -msgstr "このメソッドは2つの異なる方法で呼び出されます。" - -#: ../../library/enum.rst:182 -msgid "to look up an existing member:" -msgstr "既存のメンバーを検索する:" +#: ../../library/enum.rst:248 +msgid "Using automatic values" +msgstr "値の自動設定を使う" -#: ../../library/enum.rst:0 -msgid "cls" -msgstr "cls" - -#: ../../library/enum.rst:184 ../../library/enum.rst:190 -msgid "The enum class being called." -msgstr "呼び出されるenumクラス。" +#: ../../library/enum.rst:250 +msgid "If the exact value is unimportant you can use :class:`auto`::" +msgstr "正確な値が重要でない場合、 :class:`auto` が使えます::" -#: ../../library/enum.rst:0 -msgid "value" -msgstr "value" - -#: ../../library/enum.rst:185 -msgid "The value to lookup." -msgstr "検索する値。" - -#: ../../library/enum.rst:187 +#: ../../library/enum.rst:261 msgid "" -"to use the ``cls`` enum to create a new enum (only if the existing enum does " -"not have any members):" +"The values are chosen by :func:`_generate_next_value_`, which can be " +"overridden::" msgstr "" -"``cls`` を使って新しい列挙型を作成する(既存の列挙型がメンバーを持たない場合" -"のみ):" +"その値は :func:`_generate_next_value_` によって選ばれ、この関数はオーバーライ" +"ドできます::" -#: ../../library/enum.rst:191 -msgid "The name of the new Enum to create." -msgstr "新しく作成するEnumの名前。" - -#: ../../library/enum.rst:0 -msgid "names" -msgstr "names" - -#: ../../library/enum.rst:192 -msgid "The names/values of the members for the new Enum." -msgstr "新しく作成するEnumのメンバーの名前/値のリスト。" - -#: ../../library/enum.rst:0 -msgid "module" -msgstr "module" - -#: ../../library/enum.rst:193 -msgid "The name of the module the new Enum is created in." -msgstr "新しく作成するEnumの属するモジュール名。" - -#: ../../library/enum.rst:0 -msgid "qualname" -msgstr "qualname" - -#: ../../library/enum.rst:194 -msgid "The actual location in the module where this Enum can be found." +#: ../../library/enum.rst:279 +msgid "" +"The goal of the default :meth:`_generate_next_value_` method is to provide " +"the next :class:`int` in sequence with the last :class:`int` provided, but " +"the way it does this is an implementation detail and may change." msgstr "" +"デフォルトの :meth:`_generate_next_value_` メソッドの目的は、最後に提供した :" +"class:`int` の次から順々に :class:`int` を提供することですが、この動作は実装" +"詳細であり変更される可能性があります。" -#: ../../library/enum.rst:0 -msgid "type" -msgstr "type" - -#: ../../library/enum.rst:195 -msgid "A mix-in type for the new Enum." -msgstr "新しく作成するEnumのmix-in型。" - -#: ../../library/enum.rst:0 -msgid "start" -msgstr "start" - -#: ../../library/enum.rst:196 -msgid "The first integer value for the Enum (used by :class:`auto`)." -msgstr "Enumの最初の整数値(:class:`auto` で使用されます)。" - -#: ../../library/enum.rst:0 -msgid "boundary" -msgstr "boundary" - -#: ../../library/enum.rst:197 +#: ../../library/enum.rst:285 msgid "" -"How to handle out-of-range values from bit operations (:class:`Flag` only)." -msgstr "bit演算での範囲外の値の扱い方(:class:`Flag` のみ)。" +"The :meth:`_generate_next_value_` method must be defined before any members." +msgstr "" +":meth:`_generate_next_value_` メソッドは他のメンバーよりも前に定義される必要" +"があります。" + +#: ../../library/enum.rst:288 +msgid "Iteration" +msgstr "イテレーション" -#: ../../library/enum.rst:201 -msgid "Returns ``True`` if member belongs to the ``cls``::" -msgstr "メンバーが ``cls`` に属している場合は ``True`` を返します::" +#: ../../library/enum.rst:290 +msgid "Iterating over the members of an enum does not provide the aliases::" +msgstr "列挙型のメンバーのイテレートは別名をサポートしていません::" -#: ../../library/enum.rst:203 +#: ../../library/enum.rst:295 msgid "" -">>> some_var = Color.RED\n" -">>> some_var in Color\n" -"True\n" -">>> Color.RED.value in Color\n" -"True" +"The special attribute ``__members__`` is a read-only ordered mapping of " +"names to members. It includes all names defined in the enumeration, " +"including the aliases::" msgstr "" +"特殊属性 ``__members__`` は読み出し専用で、順序を保持した、対応する名前と列挙" +"型メンバーのマッピングです。これには別名も含め、列挙されたすべての名前が入っ" +"ています。" -#: ../../library/enum.rst:211 +#: ../../library/enum.rst:307 msgid "" -"Before Python 3.12, a ``TypeError`` is raised if a non-Enum-member is used " -"in a containment check." +"The ``__members__`` attribute can be used for detailed programmatic access " +"to the enumeration members. For example, finding all the aliases::" msgstr "" -"Python 3.12 以前では、非Enumメンバーの包含判定が行われた場合、``TypeError`` " -"が送出されます。" +"属性 ``__members__`` は列挙型メンバーへの詳細なアクセスに使用できます。以下は" +"すべての別名を探す例です::" -#: ../../library/enum.rst:216 +#: ../../library/enum.rst:315 +msgid "Comparisons" +msgstr "比較" + +#: ../../library/enum.rst:317 +msgid "Enumeration members are compared by identity::" +msgstr "列挙型メンバーは同一性を比較できます::" + +#: ../../library/enum.rst:326 msgid "" -"Returns ``['__class__', '__doc__', '__members__', '__module__']`` and the " -"names of the members in *cls*::" +"Ordered comparisons between enumeration values are *not* supported. Enum " +"members are not integers (but see `IntEnum`_ below)::" msgstr "" -"``['__class__', '__doc__', '__members__', '__module__']`` と、 *cls* に属する" -"メンバー名を返します::" +"列挙型の値の順序の比較はサポートされて *いません*。Enum メンバーは整数ではあ" +"りません (`IntEnum`_ を参照してください)::" -#: ../../library/enum.rst:219 +#: ../../library/enum.rst:334 +msgid "Equality comparisons are defined though::" +msgstr "ただし等価の比較は定義されています::" + +#: ../../library/enum.rst:343 msgid "" -">>> dir(Color)\n" -"['BLUE', 'GREEN', 'RED', '__class__', '__contains__', '__doc__', " -"'__getitem__', '__init_subclass__', '__iter__', '__len__', '__members__', " -"'__module__', '__name__', '__qualname__']" +"Comparisons against non-enumeration values will always compare not equal " +"(again, :class:`IntEnum` was explicitly designed to behave differently, see " +"below)::" msgstr "" +"非列挙型の値との比較は常に不等となります (繰り返しになりますが、:class:" +"`IntEnum` はこれと異なる挙動になるよう設計されています)::" -#: ../../library/enum.rst:224 -msgid "" -"Returns the Enum member in *cls* matching *name*, or raises a :exc:" -"`KeyError`::" -msgstr "*cls* 内の一致するメンバーを返すか、:exc:`KeyError` を送出します::" +#: ../../library/enum.rst:352 +msgid "Allowed members and attributes of enumerations" +msgstr "列挙型で許されるメンバーと属性" -#: ../../library/enum.rst:226 +#: ../../library/enum.rst:354 msgid "" -">>> Color['BLUE']\n" -"" +"The examples above use integers for enumeration values. Using integers is " +"short and handy (and provided by default by the `Functional API`_), but not " +"strictly enforced. In the vast majority of use-cases, one doesn't care what " +"the actual value of an enumeration is. But if the value *is* important, " +"enumerations can have arbitrary values." msgstr "" +"上述の例では列挙型の値に整数を使用しています。整数の使用は短くて使いやすい " +"(そして `機能 API`_ でデフォルトで提供されています) のですが、厳密には強制で" +"はありません。ほとんどの事例では列挙型の実際の値が何かを気にしていません。し" +"かし、値が重要で *ある* 場合、列挙型は任意の値を持つことができます。" -#: ../../library/enum.rst:231 -msgid "Returns each member in *cls* in definition order::" -msgstr " *cls* 内の各メンバー を定義順に返します::" - -#: ../../library/enum.rst:233 +#: ../../library/enum.rst:360 msgid "" -">>> list(Color)\n" -"[, , ]" +"Enumerations are Python classes, and can have methods and special methods as " +"usual. If we have this enumeration::" msgstr "" +"列挙型は Python のクラスであり、通常どおりメソッドや特殊メソッドを持つことが" +"できます::" -#: ../../library/enum.rst:238 -msgid "Returns the number of member in *cls*::" -msgstr "*cls* 内のメンバーの数を返します。::" +#: ../../library/enum.rst:380 +msgid "Then::" +msgstr "上記の結果が以下のようになります::" -#: ../../library/enum.rst:240 +#: ../../library/enum.rst:389 msgid "" -">>> len(Color)\n" -"3" +"The rules for what is allowed are as follows: names that start and end with " +"a single underscore are reserved by enum and cannot be used; all other " +"attributes defined within an enumeration will become members of this " +"enumeration, with the exception of special methods (:meth:`__str__`, :meth:" +"`__add__`, etc.), descriptors (methods are also descriptors), and variable " +"names listed in :attr:`_ignore_`." msgstr "" +"何が許されているかのルールは次のとおりです。先頭と末尾が 1 個のアンダースコア" +"の名前は列挙型により予約されているため、使用できません。列挙型内で定義された" +"その他すべての名前は、その列挙型のメンバーとして使用できます。特殊メソッド (:" +"meth:`__str__`, :meth:`__add__` など) と、メソッドを含むデスクリプタ(記述" +"子)、 :attr:`_ignore_` に記載されている変数名は例外です。" -#: ../../library/enum.rst:245 -msgid "Returns a mapping of every enum name to its member, including aliases" +#: ../../library/enum.rst:396 +msgid "" +"Note: if your enumeration defines :meth:`__new__` and/or :meth:`__init__` " +"then any value(s) given to the enum member will be passed into those " +"methods. See `Planet`_ for an example." msgstr "" +"注意: 列挙型で :meth:`__new__` および/または :meth:`__init__` を定義した場" +"合、列挙型メンバーに与えられた値はすべてこれらのメソッドに渡されます。例 " +"`Planet`_ を参照してください。" -#: ../../library/enum.rst:249 -msgid "Returns each member in *cls* in reverse definition order::" -msgstr "*cls* 内の各メンバー を定義順の逆順で返します::" +#: ../../library/enum.rst:402 +msgid "Restricted Enum subclassing" +msgstr "Enumのサブクラス化の制限" -#: ../../library/enum.rst:251 +#: ../../library/enum.rst:404 msgid "" -">>> list(reversed(Color))\n" -"[, , ]" +"A new :class:`Enum` class must have one base Enum class, up to one concrete " +"data type, and as many :class:`object`-based mixin classes as needed. The " +"order of these base classes is::" msgstr "" +"新しい :class:`Enum` クラスは、ベースのEnumクラスを1つ、具象データ型を1つ、複" +"数の :class:`object` ベースのミックスインクラスが許容されます。これらのベース" +"クラスの順序は次の通りです::" -#: ../../library/enum.rst:256 +#: ../../library/enum.rst:411 msgid "" -"Adds a new name as an alias to an existing member. Raises a :exc:" -"`NameError` if the name is already assigned to a different member." +"Also, subclassing an enumeration is allowed only if the enumeration does not " +"define any members. So this is forbidden::" msgstr "" +"列挙型のサブクラスの作成はその列挙型にメンバーが一つも定義されていない場合の" +"み行なえます。従って以下は許されません::" -#: ../../library/enum.rst:261 -msgid "" -"Adds a new value as an alias to an existing member. Raises a :exc:" -"`ValueError` if the value is already linked with a different member." -msgstr "" +#: ../../library/enum.rst:421 +msgid "But this is allowed::" +msgstr "以下のような場合は許されます::" -#: ../../library/enum.rst:266 +#: ../../library/enum.rst:432 msgid "" -"Before 3.11 ``EnumType`` was called ``EnumMeta``, which is still available " -"as an alias." +"Allowing subclassing of enums that define members would lead to a violation " +"of some important invariants of types and instances. On the other hand, it " +"makes sense to allow sharing some common behavior between a group of " +"enumerations. (See `OrderedEnum`_ for an example.)" msgstr "" +"メンバーが定義された列挙型のサブクラス化を許可すると、いくつかのデータ型およ" +"びインスタンスの重要な不変条件の違反を引き起こします。とはいえ、それが許可さ" +"れると、列挙型のグループ間での共通の挙動を共有するという利点もあります。 " +"(`OrderedEnum`_ の例を参照してください。)" -#: ../../library/enum.rst:271 -msgid "*Enum* is the base class for all *enum* enumerations." -msgstr "*Enum* は全ての *enum* 列挙型の基底クラスです。" +#: ../../library/enum.rst:439 +msgid "Pickling" +msgstr "Pickle 化" -#: ../../library/enum.rst:275 -msgid "The name used to define the ``Enum`` member::" -msgstr "``Enum`` メンバーを定義するために使用される名前::" +#: ../../library/enum.rst:441 +msgid "Enumerations can be pickled and unpickled::" +msgstr "列挙型は pickle 化と unpickle 化が行えます::" -#: ../../library/enum.rst:277 +#: ../../library/enum.rst:448 msgid "" -">>> Color.BLUE.name\n" -"'BLUE'" +"The usual restrictions for pickling apply: picklable enums must be defined " +"in the top level of a module, since unpickling requires them to be " +"importable from that module." msgstr "" +"通常の pickle 化の制限事項が適用されます: pickle 可能な列挙型はモジュールの" +"トップレベルで定義されていなくてはならず、unpickle 化はモジュールからインポー" +"ト可能でなければなりません。" -#: ../../library/enum.rst:282 -msgid "The value given to the ``Enum`` member::" -msgstr "``Enum`` メンバーに与えられた値::" - -#: ../../library/enum.rst:284 +#: ../../library/enum.rst:454 msgid "" -">>> Color.RED.value\n" -"1" +"With pickle protocol version 4 it is possible to easily pickle enums nested " +"in other classes." msgstr "" +"pickle プロトコルバージョン 4 では他のクラスで入れ子になった列挙型の pickle " +"化も容易です。" -#: ../../library/enum.rst:287 ../../library/enum.rst:307 -msgid "Value of the member, can be set in :meth:`~Enum.__new__`." +#: ../../library/enum.rst:457 +msgid "" +"It is possible to modify how Enum members are pickled/unpickled by defining :" +"meth:`__reduce_ex__` in the enumeration class." msgstr "" +"Enum メンバーをどう pickle 化/unpickle 化するかは、列挙型クラス内の :meth:" +"`__reduce_ex__` で定義することで変更できます。" -#: ../../library/enum.rst:289 -msgid "Enum member values" -msgstr "列挙型のメンバー値" +#: ../../library/enum.rst:462 +msgid "Functional API" +msgstr "機能 API" -#: ../../library/enum.rst:291 +#: ../../library/enum.rst:464 msgid "" -"Member values can be anything: :class:`int`, :class:`str`, etc. If the " -"exact value is unimportant you may use :class:`auto` instances and an " -"appropriate value will be chosen for you. See :class:`auto` for the details." +"The :class:`Enum` class is callable, providing the following functional API::" msgstr "" -"メンバー値は何であっても構いません: :class:`int`, :class:`str` などなど。\n" -"正確な値が重要でない場合は、 :class:`auto` インスタンスを使っておくと、適切な" -"値が選ばれます。\n" -"詳細は :class:`auto` を参照してください。" +":class:`Enum` クラスは呼び出し可能で、以下の機能 API を提供しています::" -#: ../../library/enum.rst:296 +#: ../../library/enum.rst:476 msgid "" -"While mutable/unhashable values, such as :class:`dict`, :class:`list` or a " -"mutable :class:`~dataclasses.dataclass`, can be used, they will have a " -"quadratic performance impact during creation relative to the total number of " -"mutable/unhashable values in the enum." +"The semantics of this API resemble :class:`~collections.namedtuple`. The " +"first argument of the call to :class:`Enum` is the name of the enumeration." msgstr "" +"この API の動作は :class:`~collections.namedtuple` と似ています。:class:" +"`Enum` 呼び出しの第 1 引数は列挙型の名前です。" -#: ../../library/enum.rst:303 -msgid "Name of the member." +#: ../../library/enum.rst:479 +msgid "" +"The second argument is the *source* of enumeration member names. It can be " +"a whitespace-separated string of names, a sequence of names, a sequence of 2-" +"tuples with key/value pairs, or a mapping (e.g. dictionary) of names to " +"values. The last two options enable assigning arbitrary values to " +"enumerations; the others auto-assign increasing integers starting with 1 " +"(use the ``start`` parameter to specify a different starting value). A new " +"class derived from :class:`Enum` is returned. In other words, the above " +"assignment to :class:`Animal` is equivalent to::" msgstr "" +"第 2 引数は列挙型メンバー名の *ソース* です。空白で区切った名前の文字列、名前" +"のシーケンス、キー/値のペアの 2 要素タプルのシーケンス、あるいは名前と値の" +"マッピング (例: 辞書) を指定できます。最後の 2 個のオプションでは、列挙型へ任" +"意の値を割り当てることができます。前の 2 つのオプションでは、1 から始まり増加" +"していく整数を自動的に割り当てます (別の開始値を指定するには、``start`` 引数" +"を使用します)。:class:`Enum` から派生した新しいクラスが返されます。言い換えれ" +"ば、上記の :class:`Animal` への割り当ては以下と等価です::" -#: ../../library/enum.rst:311 +#: ../../library/enum.rst:495 msgid "" -"No longer used, kept for backward compatibility. (class attribute, removed " -"during class creation)." +"The reason for defaulting to ``1`` as the starting number and not ``0`` is " +"that ``0`` is ``False`` in a boolean sense, but enum members all evaluate to " +"``True``." msgstr "" +"デフォルトの開始番号が ``0`` ではなく ``1`` である理由は、``0`` がブール演算" +"子では ``False`` になりますが、すべての列挙型メンバーの評価は ``True`` でなけ" +"ればならないためです。" -#: ../../library/enum.rst:316 +#: ../../library/enum.rst:499 msgid "" -"``_ignore_`` is only used during creation and is removed from the " -"enumeration once creation is complete." +"Pickling enums created with the functional API can be tricky as frame stack " +"implementation details are used to try and figure out which module the " +"enumeration is being created in (e.g. it will fail if you use a utility " +"function in separate module, and also may not work on IronPython or Jython). " +"The solution is to specify the module name explicitly as follows::" msgstr "" -"``_ignore_`` は列挙の作成中にのみ使用され、作成が完了すると削除されます。" +"機能 API による Enum の pickle 化は、その列挙型がどのモジュールで作成されたか" +"を見つけ出すためにフレームスタックの実装の詳細が使われるので、トリッキーにな" +"ることがあります (例えば別のモジュールのユーティリティ関数を使うと失敗します" +"し、IronPython や Jython ではうまくいきません)。解決策は、以下のようにモ" +"ジュール名を明示的に指定することです::" -#: ../../library/enum.rst:319 +#: ../../library/enum.rst:509 msgid "" -"``_ignore_`` is a list of names that will not become members, and whose " -"names will also be removed from the completed enumeration. See :ref:" -"`TimePeriod ` for an example." +"If ``module`` is not supplied, and Enum cannot determine what it is, the new " +"Enum members will not be unpicklable; to keep errors closer to the source, " +"pickling will be disabled." msgstr "" -"``_ignore_`` は、メンバーにならず、作成された列挙から削除される名前のリストで" -"す。例については、:ref:`TimePeriod ` を参照してください。" +"``module`` が与えられない場合、Enum はそれがなにか決定できないため、新しい " +"Enum メンバーは unpickle 化できなくなります; エラーをソースの近いところで発生" +"させるため、pickle 化は無効になります。" -#: ../../library/enum.rst:325 +#: ../../library/enum.rst:513 msgid "" -"Returns ``['__class__', '__doc__', '__module__', 'name', 'value']`` and any " -"public methods defined on *self.__class__*::" +"The new pickle protocol 4 also, in some circumstances, relies on :attr:" +"`~definition.__qualname__` being set to the location where pickle will be " +"able to find the class. For example, if the class was made available in " +"class SomeData in the global scope::" msgstr "" -" ``['__class__', '__doc__', '__module__', 'name', 'value']`` と *self." -"__class__* に定義されたpublicなメソッドを返します::" +"新しい pickle プロトコルバージョン 4 では、一部の状況において、pickle がクラ" +"スを発見するための場所の設定に :attr:`~definition.__qualname__` を参照しま" +"す。例えば、そのクラスがグローバルスコープ内のクラス SomeData 内で利用可能と" +"するには以下のように指定します::" + +#: ../../library/enum.rst:520 +msgid "The complete signature is::" +msgstr "完全な構文は以下のようになります::" + +#: ../../library/enum.rst:0 +msgid "value" +msgstr "value" + +#: ../../library/enum.rst:524 +msgid "What the new Enum class will record as its name." +msgstr "新しい Enum クラスに記録されるそれ自身の名前です。" + +#: ../../library/enum.rst:0 +msgid "names" +msgstr "名前" -#: ../../library/enum.rst:328 +#: ../../library/enum.rst:526 msgid "" -">>> from datetime import date\n" -">>> class Weekday(Enum):\n" -"... MONDAY = 1\n" -"... TUESDAY = 2\n" -"... WEDNESDAY = 3\n" -"... THURSDAY = 4\n" -"... FRIDAY = 5\n" -"... SATURDAY = 6\n" -"... SUNDAY = 7\n" -"... @classmethod\n" -"... def today(cls):\n" -"... print('today is %s' % cls(date.today().isoweekday()).name)\n" -"...\n" -">>> dir(Weekday.SATURDAY)\n" -"['__class__', '__doc__', '__eq__', '__hash__', '__module__', 'name', " -"'today', 'value']" +"The Enum members. This can be a whitespace or comma separated string " +"(values will start at 1 unless otherwise specified)::" msgstr "" +"Enum のメンバーです。\n" +"空白またはカンマで区切った文字列でも構いません (特に指定がない限り、値は 1 か" +"ら始まります)::" -#: ../../library/enum.rst:0 -msgid "name" -msgstr "name" +#: ../../library/enum.rst:531 +msgid "or an iterator of names::" +msgstr "または名前のイテレータで指定もできます::" -#: ../../library/enum.rst:346 -msgid "The name of the member being defined (e.g. 'RED')." -msgstr "定義されているメンバーの名前(例:'RED')。" +#: ../../library/enum.rst:535 +msgid "or an iterator of (name, value) pairs::" +msgstr "または (名前, 値) のペアのイテレータでも指定できます::" -#: ../../library/enum.rst:347 -msgid "The start value for the Enum; the default is 1." -msgstr "Enumの開始値。デフォルトは1です。" +#: ../../library/enum.rst:539 +msgid "or a mapping::" +msgstr "またはマッピングでも指定できます::" #: ../../library/enum.rst:0 -msgid "count" -msgstr "count" +msgid "module" +msgstr "module" -#: ../../library/enum.rst:348 -msgid "The number of members currently defined, not including this one." -msgstr "定義済みのメンバーの数。現在のメンバーを含めない。" +#: ../../library/enum.rst:543 +msgid "name of module where new Enum class can be found." +msgstr "新しい Enum クラスが属するモジュールの名前です。" #: ../../library/enum.rst:0 -msgid "last_values" -msgstr "last_values" - -#: ../../library/enum.rst:349 -msgid "A list of the previous values." -msgstr "定義済みの値のリスト。" +msgid "qualname" +msgstr "qualname" -#: ../../library/enum.rst:351 -msgid "" -"A *staticmethod* that is used to determine the next value returned by :class:" -"`auto`::" -msgstr "" -":class:`auto` によって返される次の値を決定するために使用される " -"*staticmethod* です::" +#: ../../library/enum.rst:545 +msgid "where in module new Enum class can be found." +msgstr "新しい Enum クラスが属するモジュールの場所です。" -#: ../../library/enum.rst:354 -msgid "" -">>> from enum import auto\n" -">>> class PowersOfThree(Enum):\n" -"... @staticmethod\n" -"... def _generate_next_value_(name, start, count, last_values):\n" -"... return 3 ** (count + 1)\n" -"... FIRST = auto()\n" -"... SECOND = auto()\n" -"...\n" -">>> PowersOfThree.SECOND.value\n" -"9" -msgstr "" +#: ../../library/enum.rst:0 +msgid "type" +msgstr "type" -#: ../../library/enum.rst:367 -msgid "" -"By default, does nothing. If multiple values are given in the member " -"assignment, those values become separate arguments to ``__init__``; e.g." -msgstr "" -"デフォルトでは何もしません。メンバーに複数の値が指定されている場合、それらの" -"値は ``__init__`` の別々の引数となります。例えば、" +#: ../../library/enum.rst:547 +msgid "type to mix in to new Enum class." +msgstr "新しい Enum クラスに複合されるデータ型です。" -#: ../../library/enum.rst:374 -msgid "" -"``Weekday.__init__()`` would be called as ``Weekday.__init__(self, 1, " -"'Mon')``" -msgstr "" -"``Weekday.__init__()`` は ``Weekday.__init__(self, 1, 'Mon')`` として呼び出さ" -"れます。" +#: ../../library/enum.rst:0 +msgid "start" +msgstr "start" -#: ../../library/enum.rst:378 -msgid "" -"A *classmethod* that is used to further configure subsequent subclasses. By " -"default, does nothing." -msgstr "" -"サブクラスを更に設定するために使用される *classmethod* です。デフォルトでは何" -"も行いません。" +#: ../../library/enum.rst:549 +msgid "number to start counting at if only names are passed in." +msgstr "names のみが渡されたときにカウントを開始する数です。" -#: ../../library/enum.rst:383 -msgid "" -"A *classmethod* for looking up values not found in *cls*. By default it " -"does nothing, but can be overridden to implement custom search behavior::" -msgstr "" -"*cls* で見つからない値を検索するための *classmethod* です。デフォルトでは何も" -"しませんが、カスタムの検索の振る舞いを実装するためにオーバーライドすることが" -"できます::" +#: ../../library/enum.rst:551 +msgid "The *start* parameter was added." +msgstr "*start* 引数が追加されました。" -#: ../../library/enum.rst:386 -msgid "" -">>> from enum import StrEnum\n" -">>> class Build(StrEnum):\n" -"... DEBUG = auto()\n" -"... OPTIMIZED = auto()\n" -"... @classmethod\n" -"... def _missing_(cls, value):\n" -"... value = value.lower()\n" -"... for member in cls:\n" -"... if member.value == value:\n" -"... return member\n" -"... return None\n" -"...\n" -">>> Build.DEBUG.value\n" -"'debug'\n" -">>> Build('deBUG')\n" -"" -msgstr "" +#: ../../library/enum.rst:556 +msgid "Derived Enumerations" +msgstr "派生列挙型" -#: ../../library/enum.rst:405 -msgid "" -"By default, doesn't exist. If specified, either in the enum class " -"definition or in a mixin class (such as ``int``), all values given in the " -"member assignment will be passed; e.g." -msgstr "" -"デフォルトでは存在しません。指定された場合、列挙型のクラス定義またはmix-inク" -"ラス(例えば ``int`` など)のいずれかで、メンバーに代入されたすべての値が渡さ" -"れます。例::" +#: ../../library/enum.rst:559 +msgid "IntEnum" +msgstr "IntEnum" -#: ../../library/enum.rst:413 +#: ../../library/enum.rst:561 msgid "" -"results in the call ``int('1a', 16)`` and a value of ``26`` for the member." +"The first variation of :class:`Enum` that is provided is also a subclass of :" +"class:`int`. Members of an :class:`IntEnum` can be compared to integers; by " +"extension, integer enumerations of different types can also be compared to " +"each other::" msgstr "" +"提供されている 1 つ目の :class:`Enum` の派生型であり、 :class:`int` のサブク" +"ラスでもあります。\n" +":class:`IntEnum` のメンバーは整数と比較できます;\n" +"さらに言うと、異なる整数列挙型どうしでも比較できます::" -#: ../../library/enum.rst:417 +#: ../../library/enum.rst:582 msgid "" -"When writing a custom ``__new__``, do not use ``super().__new__`` -- call " -"the appropriate ``__new__`` instead." -msgstr "" +"However, they still can't be compared to standard :class:`Enum` " +"enumerations::" +msgstr "ただし、これらも標準の :class:`Enum` 列挙型とは比較できません::" -#: ../../library/enum.rst:422 +#: ../../library/enum.rst:595 msgid "" -"Returns the string used for *repr()* calls. By default, returns the *Enum* " -"name, member name, and value, but can be overridden::" -msgstr "" -"*repr()* の呼び出しに使用される文字列を返します。デフォルトでは、 *Enum* 名、" -"メンバー名、および値を返しますが、オーバーライドすることもできます::" +":class:`IntEnum` values behave like integers in other ways you'd expect::" +msgstr ":class:`IntEnum` の値は他の用途では整数のように振る舞います::" -#: ../../library/enum.rst:425 -msgid "" -">>> class OtherStyle(Enum):\n" -"... ALTERNATE = auto()\n" -"... OTHER = auto()\n" -"... SOMETHING_ELSE = auto()\n" -"... def __repr__(self):\n" -"... cls_name = self.__class__.__name__\n" -"... return f'{cls_name}.{self.name}'\n" -"...\n" -">>> OtherStyle.ALTERNATE, str(OtherStyle.ALTERNATE), f\"{OtherStyle." -"ALTERNATE}\"\n" -"(OtherStyle.ALTERNATE, 'OtherStyle.ALTERNATE', 'OtherStyle.ALTERNATE')" -msgstr "" +#: ../../library/enum.rst:606 +msgid "IntFlag" +msgstr "IntFlag" -#: ../../library/enum.rst:438 +#: ../../library/enum.rst:608 msgid "" -"Returns the string used for *str()* calls. By default, returns the *Enum* " -"name and member name, but can be overridden::" +"The next variation of :class:`Enum` provided, :class:`IntFlag`, is also " +"based on :class:`int`. The difference being :class:`IntFlag` members can be " +"combined using the bitwise operators (&, \\|, ^, ~) and the result is still " +"an :class:`IntFlag` member. However, as the name implies, :class:`IntFlag` " +"members also subclass :class:`int` and can be used wherever an :class:`int` " +"is used. Any operation on an :class:`IntFlag` member besides the bit-wise " +"operations will lose the :class:`IntFlag` membership." msgstr "" -"*str()* の呼び出しに使用される文字列を返します。デフォルトでは、 *Enum* の名" -"前とメンバーの名前を返しますが、オーバーライドすることもできます::" +"提供されている 2 つ目の :class:`Enum` の派生型 :class:`IntFlag` も :class:" +"`int` を基底クラスとしています。\n" +":class:`IntFlag` メンバーが :class:`Enum` メンバーと異なるのは、ビット演算" +"子 (&, \\|, ^, ~) を使って組み合わせられ、その結果も :class:`IntFlag` メン" +"バーになることです。\n" +"しかし、名前が示すように、 :class:`IntFlag` は :class:`int` のサブクラスでも" +"あり、 :class:`int` が使われるところでもどこでも使えます。\n" +":class:`IntFlag` メンバーに対してビット演算以外のどんな演算をしても、その結果" +"は :class:`IntFlag` メンバーではなくなります。" -#: ../../library/enum.rst:441 -msgid "" -">>> class OtherStyle(Enum):\n" -"... ALTERNATE = auto()\n" -"... OTHER = auto()\n" -"... SOMETHING_ELSE = auto()\n" -"... def __str__(self):\n" -"... return f'{self.name}'\n" -"...\n" -">>> OtherStyle.ALTERNATE, str(OtherStyle.ALTERNATE), f\"{OtherStyle." -"ALTERNATE}\"\n" -"(, 'ALTERNATE', 'ALTERNATE')" -msgstr "" +#: ../../library/enum.rst:618 +msgid "Sample :class:`IntFlag` class::" +msgstr ":class:`IntFlag` クラスの例::" -#: ../../library/enum.rst:453 -msgid "" -"Returns the string used for *format()* and *f-string* calls. By default, " -"returns :meth:`__str__` return value, but can be overridden::" -msgstr "" -"*format()* および *f-string* の呼び出しに使用される文字列を返します。デフォル" -"トでは、:meth:`__str__` の戻り値を返しますが、オーバーライドすることもできま" -"す。::" +#: ../../library/enum.rst:634 +msgid "It is also possible to name the combinations::" +msgstr "組み合わせにも名前を付けられます::" -#: ../../library/enum.rst:456 +#: ../../library/enum.rst:646 msgid "" -">>> class OtherStyle(Enum):\n" -"... ALTERNATE = auto()\n" -"... OTHER = auto()\n" -"... SOMETHING_ELSE = auto()\n" -"... def __format__(self, spec):\n" -"... return f'{self.name}'\n" -"...\n" -">>> OtherStyle.ALTERNATE, str(OtherStyle.ALTERNATE), f\"{OtherStyle." -"ALTERNATE}\"\n" -"(, 'OtherStyle.ALTERNATE', 'ALTERNATE')" +"Another important difference between :class:`IntFlag` and :class:`Enum` is " +"that if no flags are set (the value is 0), its boolean evaluation is :data:" +"`False`::" msgstr "" +":class:`IntFlag` と :class:`Enum` のもう 1 つの重要な違いは、フラグが設定され" +"ていない (値が0である) 場合、その真偽値としての評価は :data:`False` になるこ" +"とです::" -#: ../../library/enum.rst:468 +#: ../../library/enum.rst:654 msgid "" -"Using :class:`auto` with :class:`Enum` results in integers of increasing " -"value, starting with ``1``." +"Because :class:`IntFlag` members are also subclasses of :class:`int` they " +"can be combined with them::" msgstr "" -":class:`Enum` で :class:`auto` を使用すると、 ``1`` から始まりインクリメント" -"する整数が値となります。" +":class:`IntFlag` は :class:`int` のサブクラスでもあるので、その両者を組み合わ" +"せられます::" -#: ../../library/enum.rst:471 -msgid "Added :ref:`enum-dataclass-support`" -msgstr ":ref:`enum-dataclass-support` の追加" +#: ../../library/enum.rst:662 +msgid "Flag" +msgstr "Flag" -#: ../../library/enum.rst:476 +#: ../../library/enum.rst:664 msgid "" -"*IntEnum* is the same as :class:`Enum`, but its members are also integers " -"and can be used anywhere that an integer can be used. If any integer " -"operation is performed with an *IntEnum* member, the resulting value loses " -"its enumeration status." +"The last variation is :class:`Flag`. Like :class:`IntFlag`, :class:`Flag` " +"members can be combined using the bitwise operators (&, \\|, ^, ~). Unlike :" +"class:`IntFlag`, they cannot be combined with, nor compared against, any " +"other :class:`Flag` enumeration, nor :class:`int`. While it is possible to " +"specify the values directly it is recommended to use :class:`auto` as the " +"value and let :class:`Flag` select an appropriate value." msgstr "" +"最後の派生型は :class:`Flag` です。\n" +":class:`IntFlag` と同様に、 :class:`Flag` メンバーもビット演算子 (&, \\|, ^, " +"~) を使って組み合わせられます。\n" +"しかし :class:`IntFlag` とは違い、他のどの :class:`Flag` 列挙型とも :class:" +"`int` とも組み合わせたり、比較したりできません。\n" +"値を直接指定することも可能ですが、値として :class:`auto` を使い、 :class:" +"`Flag` に適切な値を選ばせることが推奨されています。" -#: ../../library/enum.rst:497 +#: ../../library/enum.rst:673 msgid "" -"Using :class:`auto` with :class:`IntEnum` results in integers of increasing " -"value, starting with ``1``." +"Like :class:`IntFlag`, if a combination of :class:`Flag` members results in " +"no flags being set, the boolean evaluation is :data:`False`::" msgstr "" -":class:`IntEnum` で :class:`auto` を使用すると、 ``1`` から始まりインクリメン" -"トする整数が値となります。" +":class:`IntFlag` と同様に、 :class:`Flag` メンバーの組み合わせがどのフラグも" +"設定されていない状態になった場合、その真偽値としての評価は :data:`False` とな" +"ります::" -#: ../../library/enum.rst:500 +#: ../../library/enum.rst:687 msgid "" -":meth:`~object.__str__` is now :meth:`!int.__str__` to better support the " -"*replacement of existing constants* use-case. :meth:`~object.__format__` was " -"already :meth:`!int.__format__` for that same reason." +"Individual flags should have values that are powers of two (1, 2, 4, " +"8, ...), while combinations of flags won't::" msgstr "" -":meth:`~object.__str__` は、既存の定数を置き換えるユースケースをより良くサ" -"ポートするために :meth:`!int.__str__` に変更されました。同じ理由で、:meth:" -"`~object.__format__` は既に :meth:`!int.__format__` に変更されています。" +"個別のフラグは 2 のべき乗 (1, 2, 4, 8, ...) の値を持つべきですが、フラグの組" +"み合わせはそうはなりません::" -#: ../../library/enum.rst:507 +#: ../../library/enum.rst:699 msgid "" -"``StrEnum`` is the same as :class:`Enum`, but its members are also strings " -"and can be used in most of the same places that a string can be used. The " -"result of any string operation performed on or with a *StrEnum* member is " -"not part of the enumeration." +"Giving a name to the \"no flags set\" condition does not change its boolean " +"value::" msgstr "" +"\"フラグが設定されていない\" 状態に名前を付けても、その真偽値は変わりません::" -#: ../../library/enum.rst:513 +#: ../../library/enum.rst:715 msgid "" -"There are places in the stdlib that check for an exact :class:`str` instead " -"of a :class:`str` subclass (i.e. ``type(unknown) == str`` instead of " -"``isinstance(unknown, str)``), and in those locations you will need to use " -"``str(StrEnum.member)``." +"For the majority of new code, :class:`Enum` and :class:`Flag` are strongly " +"recommended, since :class:`IntEnum` and :class:`IntFlag` break some semantic " +"promises of an enumeration (by being comparable to integers, and thus by " +"transitivity to other unrelated enumerations). :class:`IntEnum` and :class:" +"`IntFlag` should be used only in cases where :class:`Enum` and :class:`Flag` " +"will not do; for example, when integer constants are replaced with " +"enumerations, or for interoperability with other systems." msgstr "" -"標準ライブラリの中には、 :class:`str` の代わりに :class:`str` のサブクラス" -"(つまり、 ``type(unknown) == str`` の代わりに ``isinstance(unknown, " -"str)`` )を厳密にチェックする場所があります。そのような場所では、 " -"``str(StrEnum.member)`` を使用する必要があります。" +"ほとんどの新しいコードでは、 :class:`Enum` と :class:`Flag` が強く推奨されま" +"す。\n" +"というのは、 :class:`IntEnum` と :class:`IntFlag` は (整数と比較でき、従って" +"推移的に他の無関係な列挙型と比較できてしまうことにより) 列挙型の意味論的な約" +"束に反するからです。\n" +":class:`IntEnum` と :class:`IntFlag` は、 :class:`Enum` や :class:`Flag` では" +"上手くいかない場合のみに使うべきです;\n" +"例えば、整数定数を列挙型で置き換えるときや、他のシステムとの相互運用性を持た" +"せたいときです。" -#: ../../library/enum.rst:520 -msgid "" -"Using :class:`auto` with :class:`StrEnum` results in the lower-cased member " -"name as the value." -msgstr "" -":class:`StrEnum` で :class:`auto` を使用すると、メンバー名を小文字に変換した" -"ものが値となります。" +#: ../../library/enum.rst:725 +msgid "Others" +msgstr "その他" -#: ../../library/enum.rst:525 +#: ../../library/enum.rst:727 msgid "" -":meth:`~object.__str__` is :meth:`!str.__str__` to better support the " -"*replacement of existing constants* use-case. :meth:`~object.__format__` is " -"likewise :meth:`!str.__format__` for that same reason." +"While :class:`IntEnum` is part of the :mod:`enum` module, it would be very " +"simple to implement independently::" msgstr "" -":meth:`~object.__str__` は *既存の定数の置換* ユースケースをより良くサポート" -"するために :meth:`!str.__str__` となりました。 :meth:`~object.__format__` も" -"同様に、同じ理由で :meth:`!str.__format__` となりました。" +":class:`IntEnum` は :mod:`enum` モジュールの一部ですが、単独での実装もとても" +"簡単に行なえます::" -#: ../../library/enum.rst:533 +#: ../../library/enum.rst:733 msgid "" -"``Flag`` is the same as :class:`Enum`, but its members support the bitwise " -"operators ``&`` (*AND*), ``|`` (*OR*), ``^`` (*XOR*), and ``~`` (*INVERT*); " -"the results of those operations are (aliases of) members of the enumeration." +"This demonstrates how similar derived enumerations can be defined; for " +"example a :class:`StrEnum` that mixes in :class:`str` instead of :class:" +"`int`." msgstr "" +"ここでは似たような列挙型の派生を定義する方法を紹介します; 例えば、:class:" +"`StrEnum` は :class:`int` ではなく :class:`str` で複合させたものです。" -#: ../../library/enum.rst:539 -msgid "Returns *True* if value is in self::" -msgstr "値を含む場合に *True* を返します::" +#: ../../library/enum.rst:736 +msgid "Some rules:" +msgstr "いくつかのルール:" -#: ../../library/enum.rst:541 +#: ../../library/enum.rst:738 msgid "" -">>> from enum import Flag, auto\n" -">>> class Color(Flag):\n" -"... RED = auto()\n" -"... GREEN = auto()\n" -"... BLUE = auto()\n" -"...\n" -">>> purple = Color.RED | Color.BLUE\n" -">>> white = Color.RED | Color.GREEN | Color.BLUE\n" -">>> Color.GREEN in purple\n" -"False\n" -">>> Color.GREEN in white\n" -"True\n" -">>> purple in white\n" -"True\n" -">>> white in purple\n" -"False" +"When subclassing :class:`Enum`, mix-in types must appear before :class:" +"`Enum` itself in the sequence of bases, as in the :class:`IntEnum` example " +"above." msgstr "" +":class:`Enum` のサブクラスを作成するとき、複合させるデータ型は、基底クラスの" +"並びで :class:`Enum` 自身より先に記述しなければなりません (上記 :class:" +"`IntEnum` の例を参照)。" -#: ../../library/enum.rst:560 -msgid "Returns all contained non-alias members::" -msgstr "エイリアスでない、全てのメンバーを返します::" - -#: ../../library/enum.rst:562 +#: ../../library/enum.rst:741 msgid "" -">>> list(Color.RED)\n" -"[]\n" -">>> list(purple)\n" -"[, ]" +"While :class:`Enum` can have members of any type, once you mix in an " +"additional type, all the members must have values of that type, e.g. :class:" +"`int` above. This restriction does not apply to mix-ins which only add " +"methods and don't specify another type." msgstr "" +":class:`Enum` のメンバーはどんなデータ型でも構いませんが、追加のデータ型 (例" +"えば、上の例の :class:`int`) と複合させてしまうと、すべてのメンバーの値はその" +"データ型でなければならなくなります。この制限は、メソッドの追加するだけの、他" +"のデータ型を指定しない複合には適用されません。" -#: ../../library/enum.rst:571 -msgid "Returns number of members in flag::" -msgstr "flag 内のメンバーの数を返します::" - -#: ../../library/enum.rst:573 +#: ../../library/enum.rst:745 msgid "" -">>> len(Color.GREEN)\n" -"1\n" -">>> len(white)\n" -"3" +"When another data type is mixed in, the :attr:`value` attribute is *not the " +"same* as the enum member itself, although it is equivalent and will compare " +"equal." msgstr "" +"他のデータ型と複合された場合、 :attr:`value` 属性は、たとえ等価であり等価であ" +"ると比較が行えても、列挙型メンバー自身としては *同じではありません* 。" -#: ../../library/enum.rst:582 -msgid "Returns *True* if any members in flag, *False* otherwise::" -msgstr "" -"メンバーがflagに含まれている場合は *True* を返し、それ以外の場合は *False* を" -"返します::" - -#: ../../library/enum.rst:584 +#: ../../library/enum.rst:748 msgid "" -">>> bool(Color.GREEN)\n" -"True\n" -">>> bool(white)\n" -"True\n" -">>> black = Color(0)\n" -">>> bool(black)\n" -"False" +"%-style formatting: `%s` and `%r` call the :class:`Enum` class's :meth:" +"`__str__` and :meth:`__repr__` respectively; other codes (such as `%i` or " +"`%h` for IntEnum) treat the enum member as its mixed-in type." msgstr "" +"%-方式の書式: `%s` および `%r` はそれぞれ :class:`Enum` クラスの :meth:" +"`__str__` および :meth:`__repr__` を呼び出します;\n" +"その他のコード (IntEnum の `%i` や `%h` など) は列挙型のメンバーを複合された" +"データ型として扱います。" -#: ../../library/enum.rst:594 -msgid "Returns current flag binary or'ed with other::" -msgstr "現在のフラグと他のフラグの論理和となるフラグを返します::" - -#: ../../library/enum.rst:596 +#: ../../library/enum.rst:751 msgid "" -">>> Color.RED | Color.GREEN\n" -"" +":ref:`Formatted string literals `, :meth:`str.format`, and :func:" +"`format` will use the mixed-in type's :meth:`__format__` unless :meth:" +"`__str__` or :meth:`__format__` is overridden in the subclass, in which case " +"the overridden methods or :class:`Enum` methods will be used. Use the !s " +"and !r format codes to force usage of the :class:`Enum` class's :meth:" +"`__str__` and :meth:`__repr__` methods." msgstr "" +":ref:`フォーマット済み文字列リテラル ` 、 :meth:`str.format` 、 :" +"func:`format` は、 :meth:`__str__` やサブクラスでオーバーライドされた :meth:" +"`__format__` よりもミックスイン型の :meth:`__format__` を優先して使います。!s" +"や!rフォーマットコードを使うと、 :class:`Enum` クラスの :meth:`__str__` や :" +"meth:`__repr__` メソッドが強制的に使われます。" -#: ../../library/enum.rst:601 -msgid "Returns current flag binary and'ed with other::" -msgstr "現在のフラグと他のフラグの論理積となるフラグを返します::" +#: ../../library/enum.rst:759 +msgid "When to use :meth:`__new__` vs. :meth:`__init__`" +msgstr ":meth:`__init__` と :meth:`__init__` のどちらを使うべきか" -#: ../../library/enum.rst:603 +#: ../../library/enum.rst:761 msgid "" -">>> purple & white\n" -"\n" -">>> purple & Color.GREEN\n" -"" +":meth:`__new__` must be used whenever you want to customize the actual value " +"of the :class:`Enum` member. Any other modifications may go in either :meth:" +"`__new__` or :meth:`__init__`, with :meth:`__init__` being preferred." msgstr "" +":meth:`__new__` は :class:`Enum` メンバーの実際の値をカスタマイズしたいときに" +"利用します。他の変更を加える場合、 :meth:`__new__` と :meth:`__init__` のどち" +"らを利用するかは、:meth:`__init__` の方が望ましいでしょう。" -#: ../../library/enum.rst:610 -msgid "Returns current flag binary xor'ed with other::" -msgstr "現在のフラグと他のフラグの排他的論理和となるフラグを返します::" - -#: ../../library/enum.rst:612 +#: ../../library/enum.rst:765 msgid "" -">>> purple ^ white\n" -"\n" -">>> purple ^ Color.GREEN\n" -"" +"For example, if you want to pass several items to the constructor, but only " +"want one of them to be the value::" msgstr "" +"例えば、複数の値をコンストラクタに渡すが、その中の1つだけを値として使いたい場" +"合は次のようにします:" -#: ../../library/enum.rst:619 -msgid "Returns all the flags in *type(self)* that are not in *self*::" -msgstr "" +#: ../../library/enum.rst:791 +msgid "Interesting examples" +msgstr "興味深い例" -#: ../../library/enum.rst:621 +#: ../../library/enum.rst:793 msgid "" -">>> ~white\n" -"\n" -">>> ~purple\n" -"\n" -">>> ~Color.RED\n" -"" +"While :class:`Enum`, :class:`IntEnum`, :class:`IntFlag`, and :class:`Flag` " +"are expected to cover the majority of use-cases, they cannot cover them " +"all. Here are recipes for some different types of enumerations that can be " +"used directly, or as examples for creating one's own." msgstr "" +":class:`Enum`, :class:`IntEnum`, :class:`IntFlag`, :class:`Flag` は用途の大部" +"分をカバーすると予想されますが、そのすべてをカバーできているわけではありませ" +"ん。\n" +"ここでは、そのまま、あるいは独自の列挙型を作る例として使える、様々なタイプの" +"列挙型を紹介します。" -#: ../../library/enum.rst:630 -msgid "" -"Function used to format any remaining unnamed numeric values. Default is " -"the value's repr; common choices are :func:`hex` and :func:`oct`." -msgstr "" +#: ../../library/enum.rst:800 +msgid "Omitting values" +msgstr "値の省略" -#: ../../library/enum.rst:635 +#: ../../library/enum.rst:802 msgid "" -"Using :class:`auto` with :class:`Flag` results in integers that are powers " -"of two, starting with ``1``." +"In many use-cases one doesn't care what the actual value of an enumeration " +"is. There are several ways to define this type of simple enumeration:" msgstr "" -":class:`auto` と :class:`Flag` を一緒に使うと、``1`` から始まる2の累乗の整数" -"になります。" +"多くの用途では、列挙型の実際の値が何かは気にされません。\n" +"このタイプの単純な列挙型を定義する方法はいくつかあります:" -#: ../../library/enum.rst:638 -msgid "The *repr()* of zero-valued flags has changed. It is now:" -msgstr "" +#: ../../library/enum.rst:805 +msgid "use instances of :class:`auto` for the value" +msgstr "値に :class:`auto` インスタンスを使用する" -#: ../../library/enum.rst:646 -msgid "" -"``IntFlag`` is the same as :class:`Flag`, but its members are also integers " -"and can be used anywhere that an integer can be used." -msgstr "" +#: ../../library/enum.rst:806 +msgid "use instances of :class:`object` as the value" +msgstr "値として :class:`object` インスタンスを使用する" -#: ../../library/enum.rst:660 -msgid "" -"If any integer operation is performed with an *IntFlag* member, the result " -"is not an *IntFlag*::" -msgstr "" -"*IntFlag* のメンバーと整数の演算が行われた場合、結果は *IntFlag* ではありませ" -"ん::" +#: ../../library/enum.rst:807 +msgid "use a descriptive string as the value" +msgstr "値として解説文字列を使用する" -#: ../../library/enum.rst:663 +#: ../../library/enum.rst:808 msgid "" -">>> Color.RED + 2\n" -"3" +"use a tuple as the value and a custom :meth:`__new__` to replace the tuple " +"with an :class:`int` value" msgstr "" +"値としてタプルを使用し、独自の :meth:`__new__` を使用してタプルを :class:" +"`int` 値で置き換える" -#: ../../library/enum.rst:666 -msgid "If a :class:`Flag` operation is performed with an *IntFlag* member and:" +#: ../../library/enum.rst:811 +msgid "" +"Using any of these methods signifies to the user that these values are not " +"important, and also enables one to add, remove, or reorder members without " +"having to renumber the remaining members." msgstr "" +"これらのどの方法を使ってもユーザーに対して、値は重要ではなく、他のメンバーの" +"番号の振り直しをする必要無しに、メンバーの追加、削除、並べ替えが行えるという" +"ことを示せます。" -#: ../../library/enum.rst:668 -msgid "the result is a valid *IntFlag*: an *IntFlag* is returned" -msgstr "結果が有効な *IntFlag*: *IntFlag* が返されます" - -#: ../../library/enum.rst:669 +#: ../../library/enum.rst:815 msgid "" -"the result is not a valid *IntFlag*: the result depends on the :class:" -"`FlagBoundary` setting" +"Whichever method you choose, you should provide a :meth:`repr` that also " +"hides the (unimportant) value::" msgstr "" +"どの方法を選んでも、(重要でない) 値を隠す :meth:`repr` を提供すべきです::" -#: ../../library/enum.rst:671 -msgid "The :func:`repr` of unnamed zero-valued flags has changed. It is now::" -msgstr "" +#: ../../library/enum.rst:825 +msgid "Using :class:`auto`" +msgstr ":class:`auto` を使う" -#: ../../library/enum.rst:673 -msgid "" -">>> Color(0)\n" -"" -msgstr "" +#: ../../library/enum.rst:827 +msgid "Using :class:`auto` would look like::" +msgstr ":class:`auto` を使うと次のようになります::" -#: ../../library/enum.rst:678 -msgid "" -"Using :class:`auto` with :class:`IntFlag` results in integers that are " -"powers of two, starting with ``1``." -msgstr "" -":class:`auto` と :class:`IntFlag` を一緒に使うと、``1`` から始まる2の累乗の整" -"数になります。" +#: ../../library/enum.rst:839 +msgid "Using :class:`object`" +msgstr ":class:`object` を使う" -#: ../../library/enum.rst:683 -msgid "" -":meth:`~object.__str__` is now :meth:`!int.__str__` to better support the " -"*replacement of existing constants* use-case. :meth:`~object.__format__` " -"was already :meth:`!int.__format__` for that same reason." -msgstr "" -":meth:`~object.__str__` は、既存の定数を置き換えるユースケースをより良くサ" -"ポートするために :meth:`!int.__str__` に変更されました。同じ理由で、:meth:" -"`~object.__format__` は既に :meth:`!int.__format__` に変更されています。" +#: ../../library/enum.rst:841 +msgid "Using :class:`object` would look like::" +msgstr ":class:`object` を使うと次のようになります::" -#: ../../library/enum.rst:687 -msgid "" -"Inversion of an :class:`!IntFlag` now returns a positive value that is the " -"union of all flags not in the given flag, rather than a negative value. This " -"matches the existing :class:`Flag` behavior." -msgstr "" -":class:`!IntFlag` の反転は、与えられたフラグ以外のすべてのフラグの結合となる" -"正の値を返すようになりました。これは既存の :class:`Flag` の振る舞いに一致しま" -"す。" +#: ../../library/enum.rst:853 +msgid "Using a descriptive string" +msgstr "解説文字列を使う" -#: ../../library/enum.rst:693 -msgid "" -":class:`!ReprEnum` uses the :meth:`repr() ` of :class:`Enum`, " -"but the :class:`str() ` of the mixed-in data type:" -msgstr "" +#: ../../library/enum.rst:855 +msgid "Using a string as the value would look like::" +msgstr "値として文字列を使うと次のようになります::" -#: ../../library/enum.rst:696 -msgid ":meth:`!int.__str__` for :class:`IntEnum` and :class:`IntFlag`" -msgstr "" +#: ../../library/enum.rst:869 +msgid "Using a custom :meth:`__new__`" +msgstr "独自の :meth:`__new__` を使う" -#: ../../library/enum.rst:697 -msgid ":meth:`!str.__str__` for :class:`StrEnum`" -msgstr "" +#: ../../library/enum.rst:871 +msgid "Using an auto-numbering :meth:`__new__` would look like::" +msgstr "自動で番号を振る :meth:`__new__` を使うと次のようになります::" -#: ../../library/enum.rst:699 +#: ../../library/enum.rst:890 msgid "" -"Inherit from :class:`!ReprEnum` to keep the :class:`str() ` / :func:" -"`format` of the mixed-in data type instead of using the :class:`Enum`-" -"default :meth:`str() `." +"To make a more general purpose ``AutoNumber``, add ``*args`` to the " +"signature::" msgstr "" -":class:`!ReprEnum` を継承することで、:class:`Enum` デフォルトの :meth:`str() " -"` を使用する代わりに、mix-inされたデータ型の :class:`str() " -"` / :func:`format` を使用します。" +"``AutoNumber`` をより広い用途で使うには、シグニチャに ``*args`` を追加しま" +"す::" -#: ../../library/enum.rst:708 +#: ../../library/enum.rst:900 msgid "" -"*EnumCheck* contains the options used by the :func:`verify` decorator to " -"ensure various constraints; failed constraints result in a :exc:`ValueError`." +"Then when you inherit from ``AutoNumber`` you can write your own " +"``__init__`` to handle any extra arguments::" msgstr "" -"*EnumCheck* には :func:`verify` デコレータやさまざまな制約を保証するために使" -"用されるオプションが含まれています。制約に違反すると :exc:`ValueError` が発生" -"します。" - -#: ../../library/enum.rst:713 -msgid "Ensure that each value has only one name::" -msgstr "それぞれの値が1つの名前しか持たないことを確認します::" +"``AutoNumber`` を継承すると、追加の引数を取り扱える独自の ``__init__`` が書け" +"ます。" -#: ../../library/enum.rst:715 +#: ../../library/enum.rst:919 msgid "" -">>> from enum import Enum, verify, UNIQUE\n" -">>> @verify(UNIQUE)\n" -"... class Color(Enum):\n" -"... RED = 1\n" -"... GREEN = 2\n" -"... BLUE = 3\n" -"... CRIMSON = 1\n" -"Traceback (most recent call last):\n" -"...\n" -"ValueError: aliases found in : CRIMSON -> RED" +"The :meth:`__new__` method, if defined, is used during creation of the Enum " +"members; it is then replaced by Enum's :meth:`__new__` which is used after " +"class creation for lookup of existing members." msgstr "" +":meth:`__new__` メソッドが定義されていれば、Enum 番号の作成時に使用されます; " +"これは Enum の :meth:`__new__` と置き換えられ、クラスが作成された後の既存の番" +"号を取得に使用されます。" -#: ../../library/enum.rst:729 -msgid "" -"Ensure that there are no missing values between the lowest-valued member and " -"the highest-valued member::" -msgstr "最小値のメンバーと最大値のメンバーの間に欠損値がないことを確認します::" +#: ../../library/enum.rst:925 +msgid "OrderedEnum" +msgstr "OrderedEnum" -#: ../../library/enum.rst:732 +#: ../../library/enum.rst:927 msgid "" -">>> from enum import Enum, verify, CONTINUOUS\n" -">>> @verify(CONTINUOUS)\n" -"... class Color(Enum):\n" -"... RED = 1\n" -"... GREEN = 2\n" -"... BLUE = 5\n" -"Traceback (most recent call last):\n" -"...\n" -"ValueError: invalid enum 'Color': missing values 3, 4" +"An ordered enumeration that is not based on :class:`IntEnum` and so " +"maintains the normal :class:`Enum` invariants (such as not being comparable " +"to other enumerations)::" msgstr "" +":class:`IntEnum` をベースとしないため、通常の :class:`Enum` の不変条件 (他の" +"列挙型と比較できないなど) のままで、メンバーを順序付けできる列挙型です::" -#: ../../library/enum.rst:744 -msgid "" -"Ensure that any flag groups/masks contain only named flags -- useful when " -"values are specified instead of being generated by :func:`auto`::" -msgstr "" -"任意のフラググループ/マスクが、名前付きフラグのみを含むことを確認します -- 値" -"を指定するのではなく、:func:`auto` によって生成される場合に便利です::" +#: ../../library/enum.rst:961 +msgid "DuplicateFreeEnum" +msgstr "DuplicateFreeEnum" -#: ../../library/enum.rst:747 +#: ../../library/enum.rst:963 msgid "" -">>> from enum import Flag, verify, NAMED_FLAGS\n" -">>> @verify(NAMED_FLAGS)\n" -"... class Color(Flag):\n" -"... RED = 1\n" -"... GREEN = 2\n" -"... BLUE = 4\n" -"... WHITE = 15\n" -"... NEON = 31\n" -"Traceback (most recent call last):\n" -"...\n" -"ValueError: invalid Flag 'Color': aliases WHITE and NEON are missing " -"combined values of 0x18 [use enum.show_flag_values(value) for details]" +"Raises an error if a duplicate member name is found instead of creating an " +"alias::" msgstr "" +"値が同じメンバーが見つかった場合、別名を作るのではなく、エラーを送出します::" -#: ../../library/enum.rst:761 +#: ../../library/enum.rst:988 msgid "" -"CONTINUOUS and NAMED_FLAGS are designed to work with integer-valued members." +"This is a useful example for subclassing Enum to add or change other " +"behaviors as well as disallowing aliases. If the only desired change is " +"disallowing aliases, the :func:`unique` decorator can be used instead." msgstr "" -"CONTINUOUSとNAMED_FLAGSは整数値のメンバーとともに動作するように設計されていま" -"す。" +"これは Enum に別名を無効にするのと同様な振る舞いの追加や変更をおこなうための" +"サブクラス化に役立つ例です。単に別名を無効にしたいだけなら、 :func:`unique` " +"デコレーターを使用して行えます。" -#: ../../library/enum.rst:767 -msgid "" -"``FlagBoundary`` controls how out-of-range values are handled in :class:" -"`Flag` and its subclasses." -msgstr "" +#: ../../library/enum.rst:994 +msgid "Planet" +msgstr "Planet" -#: ../../library/enum.rst:772 +#: ../../library/enum.rst:996 msgid "" -"Out-of-range values cause a :exc:`ValueError` to be raised. This is the " -"default for :class:`Flag`::" +"If :meth:`__new__` or :meth:`__init__` is defined the value of the enum " +"member will be passed to those methods::" msgstr "" -"範囲外の値は :exc:`ValueError` を送出します。これは :class:`Flag` のデフォル" -"トです::" +":meth:`__new__` や :meth:`__init__` が定義されている場合、列挙型メンバーの値" +"はこれらのメソッドに渡されます::" -#: ../../library/enum.rst:775 -msgid "" -">>> from enum import Flag, STRICT, auto\n" -">>> class StrictFlag(Flag, boundary=STRICT):\n" -"... RED = auto()\n" -"... GREEN = auto()\n" -"... BLUE = auto()\n" -"...\n" -">>> StrictFlag(2**2 + 2**4)\n" -"Traceback (most recent call last):\n" -"...\n" -"ValueError: invalid value 20\n" -" given 0b0 10100\n" -" allowed 0b0 00111" -msgstr "" +#: ../../library/enum.rst:1024 +msgid "TimePeriod" +msgstr "TimePeriod" -#: ../../library/enum.rst:790 -msgid "" -"Out-of-range values have invalid values removed, leaving a valid :class:" -"`Flag` value::" -msgstr "" +#: ../../library/enum.rst:1026 +msgid "An example to show the :attr:`_ignore_` attribute in use::" +msgstr ":attr:`_ignore_` 属性の使用方法のサンプルです::" -#: ../../library/enum.rst:793 -msgid "" -">>> from enum import Flag, CONFORM, auto\n" -">>> class ConformFlag(Flag, boundary=CONFORM):\n" -"... RED = auto()\n" -"... GREEN = auto()\n" -"... BLUE = auto()\n" -"...\n" -">>> ConformFlag(2**2 + 2**4)\n" -"" -msgstr "" +#: ../../library/enum.rst:1043 +msgid "How are Enums different?" +msgstr "Enum はどう違うのか?" -#: ../../library/enum.rst:804 +#: ../../library/enum.rst:1045 msgid "" -"Out-of-range values lose their :class:`Flag` membership and revert to :class:" -"`int`." +"Enums have a custom metaclass that affects many aspects of both derived Enum " +"classes and their instances (members)." msgstr "" +"Enum は Enum 派生クラスやそれらのインスタンス (メンバー) 双方の多くの側面に影" +"響を及ぼすカスタムメタクラスを持っています。" -#: ../../library/enum.rst:817 -msgid "" -"Out-of-range values are kept, and the :class:`Flag` membership is kept. This " -"is the default for :class:`IntFlag`::" -msgstr "" +#: ../../library/enum.rst:1050 +msgid "Enum Classes" +msgstr "Enum クラス" -#: ../../library/enum.rst:820 +#: ../../library/enum.rst:1052 msgid "" -">>> from enum import Flag, KEEP, auto\n" -">>> class KeepFlag(Flag, boundary=KEEP):\n" -"... RED = auto()\n" -"... GREEN = auto()\n" -"... BLUE = auto()\n" -"...\n" -">>> KeepFlag(2**2 + 2**4)\n" -"" +"The :class:`EnumMeta` metaclass is responsible for providing the :meth:" +"`__contains__`, :meth:`__dir__`, :meth:`__iter__` and other methods that " +"allow one to do things with an :class:`Enum` class that fail on a typical " +"class, such as `list(Color)` or `some_enum_var in Color`. :class:`EnumMeta` " +"is responsible for ensuring that various other methods on the final :class:" +"`Enum` class are correct (such as :meth:`__new__`, :meth:`__getnewargs__`, :" +"meth:`__str__` and :meth:`__repr__`)." msgstr "" +":class:`EnumMeta` メタクラスは、:meth:`__contains__`、:meth:`__dir__`、:meth:" +"`__iter__` および標準的なクラスでは失敗するが :class:`Enum` クラスでは動作す" +"るその他のメソッド (`list(Color)` や `some_enum_var in Color` など) を責任を" +"持って提供します。:class:`EnumMeta` は最終的な :class:`Enum` クラスのさまざま" +"なメソッド (:meth:`__new__`、:meth:`__getnewargs__`、:meth:`__str__` および :" +"meth:`__repr__`) が正しいことを責任を持って保証します。" -#: ../../library/enum.rst:833 -msgid "" -"*EnumDict* is a subclass of :class:`dict` that is used as the namespace for " -"defining enum classes (see :ref:`prepare`). It is exposed to allow " -"subclasses of :class:`EnumType` with advanced behavior like having multiple " -"values per member. It should be called with the name of the enum class being " -"created, otherwise private names and internal classes will not be handled " -"correctly." -msgstr "" +#: ../../library/enum.rst:1062 +msgid "Enum Members (aka instances)" +msgstr "Enum メンバー (インスタンス)" -#: ../../library/enum.rst:840 +#: ../../library/enum.rst:1064 msgid "" -"Note that only the :class:`~collections.abc.MutableMapping` interface (:meth:" -"`~object.__setitem__` and :meth:`~dict.update`) is overridden. It may be " -"possible to bypass the checks using other :class:`!dict` operations like :" -"meth:`|= `." +"The most interesting thing about Enum members is that they are singletons. :" +"class:`EnumMeta` creates them all while it is creating the :class:`Enum` " +"class itself, and then puts a custom :meth:`__new__` in place to ensure that " +"no new ones are ever instantiated by returning only the existing member " +"instances." msgstr "" +"Enum メンバーについて最も興味深いのは、それらがシングルトンであるということで" +"す。:class:`EnumMeta` は :class:`Enum` 自身を作成し、メンバーを作成し、新しい" +"インスタンスが作成されていないかどうかを確認するために既存のメンバーインスタ" +"ンスだけを返すカスタム :meth:`__new__` を追加します。" -#: ../../library/enum.rst:847 -msgid "A list of member names." -msgstr "" +#: ../../library/enum.rst:1072 +msgid "Finer Points" +msgstr "細かい点" -#: ../../library/enum.rst:854 +#: ../../library/enum.rst:1075 msgid "Supported ``__dunder__`` names" msgstr "``__dunder__`` 名のサポート" -#: ../../library/enum.rst:856 +#: ../../library/enum.rst:1077 msgid "" -":attr:`~EnumType.__members__` is a read-only ordered mapping of " -"``member_name``:``member`` items. It is only available on the class." +":attr:`__members__` is a read-only ordered mapping of ``member_name``:" +"``member`` items. It is only available on the class." msgstr "" -":attr:`~EnumType.__members__` は読み込み専用の、 ``member_name``:``member`` " -"を要素とする順序付きマッピングです。これはクラスでのみ利用可能です。" +":attr:`__members__` は読み込み専用の、 ``member_name``:``member`` を要素とす" +"る順序付きマッピングです。これはクラスでのみ利用可能です。" -#: ../../library/enum.rst:859 +#: ../../library/enum.rst:1080 msgid "" -":meth:`~Enum.__new__`, if specified, must create and return the enum " -"members; it is also a very good idea to set the member's :attr:`!_value_` " -"appropriately. Once all the members are created it is no longer used." +":meth:`__new__`, if specified, must create and return the enum members; it " +"is also a very good idea to set the member's :attr:`_value_` appropriately. " +"Once all the members are created it is no longer used." msgstr "" +":meth:`__new__` が、もし指定されていた場合、列挙型のメンバーを作成し、返しま" +"す;\n" +"そのメンバー の :attr:`_value_` を適切に設定するのも非常によい考えです。\n" +"いったん全てのメンバーが作成されると、それ以降 :meth:`__new__` は使われませ" +"ん。" -#: ../../library/enum.rst:865 +#: ../../library/enum.rst:1086 msgid "Supported ``_sunder_`` names" msgstr "``_sunder_`` 名のサポート" -#: ../../library/enum.rst:867 -msgid "" -":meth:`~EnumType._add_alias_` -- adds a new name as an alias to an existing " -"member." -msgstr "" +#: ../../library/enum.rst:1088 +msgid "``_name_`` -- name of the member" +msgstr "``_name_`` -- メンバー名" -#: ../../library/enum.rst:869 +#: ../../library/enum.rst:1089 msgid "" -":meth:`~EnumType._add_value_alias_` -- adds a new value as an alias to an " -"existing member." +"``_value_`` -- value of the member; can be set / modified in ``__new__``" msgstr "" +"``_value_`` -- メンバーの値; ``__new__`` で設定したり、変更したりできます" -#: ../../library/enum.rst:871 -msgid ":attr:`~Enum._name_` -- name of the member" -msgstr ":attr:`~Enum._name_` -- メンバー名" - -#: ../../library/enum.rst:872 -msgid ":attr:`~Enum._value_` -- value of the member; can be set in ``__new__``" -msgstr ":attr:`~Enum._value_` -- メンバーの値; ``__new__`` で設定できます" - -#: ../../library/enum.rst:873 +#: ../../library/enum.rst:1091 msgid "" -":meth:`~Enum._missing_` -- a lookup function used when a value is not found; " -"may be overridden" +"``_missing_`` -- a lookup function used when a value is not found; may be " +"overridden" msgstr "" -":meth:`~Enum._missing_` -- 値が見付からなかったときに使われる検索関数; オー" -"バーライドされていることがあります" +"``_missing_`` -- 値が見付からなかったときに使われる検索関数; オーバーライドさ" +"れていることがあります" -#: ../../library/enum.rst:875 +#: ../../library/enum.rst:1093 msgid "" -":attr:`~Enum._ignore_` -- a list of names, either as a :class:`list` or a :" -"class:`str`, that will not be transformed into members, and will be removed " -"from the final class" +"``_ignore_`` -- a list of names, either as a :class:`list` or a :class:" +"`str`, that will not be transformed into members, and will be removed from " +"the final class" msgstr "" -":attr:`~Enum._ignore_` -- 名前のリストで、 :class:`list` もしくは :class:" -"`str` です。この名前の要素はメンバーへの変換が行われず、最終的なクラスから削" -"除されます。" +"``_ignore_`` -- 名前のリストで、 :class:`list` もしくは :class:`str` です。こ" +"の名前の要素はメンバーへの変換が行われず、最終的なクラスから削除されます" -#: ../../library/enum.rst:878 +#: ../../library/enum.rst:1096 msgid "" -":attr:`~Enum._order_` -- no longer used, kept for backward compatibility " +"``_order_`` -- used in Python 2/3 code to ensure member order is consistent " "(class attribute, removed during class creation)" msgstr "" +"``_order_`` -- Python 2/3のコードでメンバーの順序を固定化するのに利用されます" +"(クラス属性で、クラス作成時に削除されます)" -#: ../../library/enum.rst:880 -msgid "" -":meth:`~Enum._generate_next_value_` -- used to get an appropriate value for " -"an enum member; may be overridden" -msgstr "" -":meth:`~Enum._generate_next_value_` -- 列挙型のメンバーの適切な値を取得するの" -"に使われます。オーバーライドされます。" - -#: ../../library/enum.rst:885 +#: ../../library/enum.rst:1098 msgid "" -"For standard :class:`Enum` classes the next value chosen is the highest " -"value seen incremented by one." -msgstr "" -"標準の :class:`Enum` クラスの場合、次の値として選択されるのは、定義された最大" -"の値に1を加えたものです。" - -#: ../../library/enum.rst:888 -msgid "" -"For :class:`Flag` classes the next value chosen will be the next highest " -"power-of-two." -msgstr "" -":class:`Flag` クラスでは、次に選ばれる値は、次の最大の2のべき乗となります。" - -#: ../../library/enum.rst:891 -msgid "" -"While ``_sunder_`` names are generally reserved for the further development " -"of the :class:`Enum` class and can not be used, some are explicitly allowed:" -msgstr "" - -#: ../../library/enum.rst:894 -msgid "" -"``_repr_*`` (e.g. ``_repr_html_``), as used in `IPython's rich display`_" +"``_generate_next_value_`` -- used by the `Functional API`_ and by :class:" +"`auto` to get an appropriate value for an enum member; may be overridden" msgstr "" +"``_generate_next_value_`` -- `Functional API`_ から利用され、 :class:`auto` " +"が列挙型のメンバーの適切な値を取得するのに使われます。オーバーライドされま" +"す。" -#: ../../library/enum.rst:896 +#: ../../library/enum.rst:1102 msgid "``_missing_``, ``_order_``, ``_generate_next_value_``" msgstr "``_missing_``, ``_order_``, ``_generate_next_value_``" -#: ../../library/enum.rst:897 +#: ../../library/enum.rst:1103 msgid "``_ignore_``" msgstr "``_ignore_``" -#: ../../library/enum.rst:898 -msgid "``_add_alias_``, ``_add_value_alias_``, ``_repr_*``" -msgstr "" - -#: ../../library/enum.rst:904 -msgid "Utilities and Decorators" -msgstr "ユーティリティとデコレータ" - -#: ../../library/enum.rst:908 +#: ../../library/enum.rst:1105 msgid "" -"*auto* can be used in place of a value. If used, the *Enum* machinery will " -"call an :class:`Enum`'s :meth:`~Enum._generate_next_value_` to get an " -"appropriate value. For :class:`Enum` and :class:`IntEnum` that appropriate " -"value will be the last value plus one; for :class:`Flag` and :class:" -"`IntFlag` it will be the first power-of-two greater than the highest value; " -"for :class:`StrEnum` it will be the lower-cased version of the member's " -"name. Care must be taken if mixing *auto()* with manually specified values." +"To help keep Python 2 / Python 3 code in sync an :attr:`_order_` attribute " +"can be provided. It will be checked against the actual order of the " +"enumeration and raise an error if the two do not match::" msgstr "" +"Pythono 2 / Python 3のコードの同期を取りやすくするために :attr:`_order_` 属性" +"を提供できます。実際の列挙値の順序と比較して一致してなければエラーを送出しま" +"す::" -#: ../../library/enum.rst:916 +#: ../../library/enum.rst:1121 msgid "" -"*auto* instances are only resolved when at the top level of an assignment:" -msgstr "*auto* インスタンスは、代入のトップレベルでのみ解決されます。" - -#: ../../library/enum.rst:918 -msgid "``FIRST = auto()`` will work (auto() is replaced with ``1``);" -msgstr "``FIRST = auto()`` は動作します(auto() は ``1`` に置き換えられます)" - -#: ../../library/enum.rst:919 -msgid "" -"``SECOND = auto(), -2`` will work (auto is replaced with ``2``, so ``2, -2`` " -"is used to create the ``SECOND`` enum member;" +"In Python 2 code the :attr:`_order_` attribute is necessary as definition " +"order is lost before it can be recorded." msgstr "" -"``SECOND = auto(), -2`` は動作します(auto は ``2`` に置き換えられるため、 " -"``SECOND`` 列挙型のメンバーには ``2, -2`` が使用されます)" +"Python 2のコードでは :attr:`_order_` 属性は定義順が記録される前消えてしまうた" +"め、重要です。" -#: ../../library/enum.rst:921 -msgid "" -"``THREE = [auto(), -3]`` will *not* work (``, -3`` is used to " -"create the ``THREE`` enum member)" -msgstr "" -"``THREE = [auto(), -3]`` は動作 *しません* (enumメンバー ``THREE`` の作成に " -"``, -3`` が使用されます)" +#: ../../library/enum.rst:1126 +msgid "_Private__names" +msgstr "_Private__names" -#: ../../library/enum.rst:926 +#: ../../library/enum.rst:1128 msgid "" -"In prior versions, ``auto()`` had to be the only thing on the assignment " -"line to work properly." +"Private names will be normal attributes in Python 3.10 instead of either an " +"error or a member (depending on if the name ends with an underscore). Using " +"these names in 3.9 will issue a :exc:`DeprecationWarning`." msgstr "" -"以前のバージョンでは、 ``auto()`` は、代入行に他のものがあると正しく動作しま" -"せんでした。" -#: ../../library/enum.rst:929 -msgid "" -"``_generate_next_value_`` can be overridden to customize the values used by " -"*auto*." -msgstr "" -"``_generate_next_value_`` は、 *auto* が使用する値をカスタマイズするために" -"オーバーライドすることができる。" +#: ../../library/enum.rst:1134 +msgid "``Enum`` member type" +msgstr "``Enum`` メンバー型" -#: ../../library/enum.rst:932 +#: ../../library/enum.rst:1136 msgid "" -"in 3.13 the default ``_generate_next_value_`` will always return the highest " -"member value incremented by 1, and will fail if any member is an " -"incompatible type." +":class:`Enum` members are instances of their :class:`Enum` class, and are " +"normally accessed as ``EnumClass.member``. Under certain circumstances they " +"can also be accessed as ``EnumClass.member.member``, but you should never do " +"this as that lookup may fail or, worse, return something besides the :class:" +"`Enum` member you are looking for (this is another good reason to use all-" +"uppercase names for members)::" msgstr "" -"3.13では、デフォルトの ``_generate_next_value_`` は常に最も高いメンバーの値に" -"1を加えたものを返し、メンバーのいずれかが比較できない型である場合には失敗しま" -"す。" +":class:`Enum` メンバーは、それらの :class:`Enum` クラスのインスタンスで、通常" +"は ``EnumClass.member`` のようにアクセスします。\n" +"ある状況下では、 ``EnumClass.member.member`` としてもアクセスできますが、この" +"方法は絶対に使うべきではありません。\n" +"というのは、この検索は失敗するか、さらに悪い場合には、探している :class:" +"`Enum` メンバー以外のものを返す場合もあるからです (これがメンバーの名前に大文" +"字のみを使うのが良い理由の 1 つでもあります)::" -#: ../../library/enum.rst:938 -msgid "" -"A decorator similar to the built-in *property*, but specifically for " -"enumerations. It allows member attributes to have the same names as members " -"themselves." -msgstr "" +#: ../../library/enum.rst:1157 +msgid "Boolean value of ``Enum`` classes and members" +msgstr "``Enum`` クラスとメンバーの真偽値" -#: ../../library/enum.rst:942 +#: ../../library/enum.rst:1159 msgid "" -"the *property* and the member must be defined in separate classes; for " -"example, the *value* and *name* attributes are defined in the *Enum* class, " -"and *Enum* subclasses can define members with the names ``value`` and " -"``name``." +":class:`Enum` members that are mixed with non-:class:`Enum` types (such as :" +"class:`int`, :class:`str`, etc.) are evaluated according to the mixed-in " +"type's rules; otherwise, all members evaluate as :data:`True`. To make your " +"own Enum's boolean evaluation depend on the member's value add the following " +"to your class::" msgstr "" +"(:class:`int`, :class:`str` などのような) 非 :class:`Enum` 型と複合させた :" +"class:`Enum` のメンバーは、その複合された型の規則に従って評価されます;\n" +"そうでない場合は、全てのメンバーは :data:`True` と評価されます。\n" +"メンバーの値に依存する独自の Enum の真偽値評価を行うには、クラスに次のコード" +"を追加してください::" -#: ../../library/enum.rst:951 -msgid "" -"A :keyword:`class` decorator specifically for enumerations. It searches an " -"enumeration's :attr:`~EnumType.__members__`, gathering any aliases it finds; " -"if any are found :exc:`ValueError` is raised with the details::" -msgstr "" -"列挙型専用の :keyword:`class` デコレーターです。列挙型の :attr:`~EnumType." -"__members__` に別名がないかどうか検索します; 見つかった場合、:exc:" -"`ValueError` が詳細情報とともに送出されます::" +#: ../../library/enum.rst:1168 +msgid ":class:`Enum` classes always evaluate as :data:`True`." +msgstr ":class:`Enum` クラスは常に :data:`True` と評価されます。" -#: ../../library/enum.rst:955 -msgid "" -">>> from enum import Enum, unique\n" -">>> @unique\n" -"... class Mistake(Enum):\n" -"... ONE = 1\n" -"... TWO = 2\n" -"... THREE = 3\n" -"... FOUR = 3\n" -"...\n" -"Traceback (most recent call last):\n" -"...\n" -"ValueError: duplicate values found in : FOUR -> THREE" -msgstr "" - -#: ../../library/enum.rst:969 -msgid "" -"A :keyword:`class` decorator specifically for enumerations. Members from :" -"class:`EnumCheck` are used to specify which constraints should be checked on " -"the decorated enumeration." -msgstr "" -"列挙型専用の :keyword:`class` デコレーターです。対象の列挙型に対してチェック" -"を行う制約の指定には :class:`EnumCheck` のメンバーが使用されます。" - -#: ../../library/enum.rst:977 -msgid "A decorator for use in enums: its target will become a member." -msgstr "列挙型で使用するデコレータ: 対象は列挙型のメンバー になります。" - -#: ../../library/enum.rst:983 -msgid "A decorator for use in enums: its target will not become a member." -msgstr "列挙型で使用するデコレータ: 対象は列挙型のメンバー になりません。" - -#: ../../library/enum.rst:989 -msgid "" -"A decorator to change the :class:`str() ` and :func:`repr` of an enum " -"to show its members as belonging to the module instead of its class. Should " -"only be used when the enum members are exported to the module global " -"namespace (see :class:`re.RegexFlag` for an example)." -msgstr "" - -#: ../../library/enum.rst:999 -msgid "Return a list of all power-of-two integers contained in a flag *value*." -msgstr "フラグの *value* に含まれる全ての2の累乗の整数のリストを返します。" - -#: ../../library/enum.rst:1006 -msgid "Notes" -msgstr "注釈" - -#: ../../library/enum.rst:1008 -msgid ":class:`IntEnum`, :class:`StrEnum`, and :class:`IntFlag`" -msgstr ":class:`IntEnum` 、 :class:`StrEnum` 、 :class:`IntFlag`" - -#: ../../library/enum.rst:1010 -msgid "" -"These three enum types are designed to be drop-in replacements for existing " -"integer- and string-based values; as such, they have extra limitations:" -msgstr "" -"これらの3つの列挙型は、既存の整数ベースおよび文字列ベースの値の代替として設計" -"されています。そのため、追加の制限があります:" - -#: ../../library/enum.rst:1013 -msgid "``__str__`` uses the value and not the name of the enum member" -msgstr "``__str__`` は、列挙型のメンバーの名前ではなく値を使用します" - -#: ../../library/enum.rst:1015 -msgid "" -"``__format__``, because it uses ``__str__``, will also use the value of the " -"enum member instead of its name" -msgstr "" -"``__format__`` は ``__str__`` を使用するため、列挙型のメンバーの名前ではなく" -"値を使用します" - -#: ../../library/enum.rst:1018 -msgid "" -"If you do not need/want those limitations, you can either create your own " -"base class by mixing in the ``int`` or ``str`` type yourself::" -msgstr "" -"もし、そのような制限が必要でない/望まない場合は、``int`` または ``str`` タイ" -"プを継承して、カスタムの基底クラスを作成することができます::" +#: ../../library/enum.rst:1172 +msgid "``Enum`` classes with methods" +msgstr "メソッド付きの ``Enum`` クラス" -#: ../../library/enum.rst:1021 +#: ../../library/enum.rst:1174 msgid "" -">>> from enum import Enum\n" -">>> class MyIntEnum(int, Enum):\n" -"... pass" +"If you give your :class:`Enum` subclass extra methods, like the `Planet`_ " +"class above, those methods will show up in a :func:`dir` of the member, but " +"not of the class::" msgstr "" +":class:`Enum` サブクラスに追加のメソッドを与えた場合、上述の `Planet`_ クラス" +"のように、そのメソッドはメンバーの :func:`dir` に表示されますが、クラスの :" +"func:`dir` には表示されません::" -#: ../../library/enum.rst:1025 -msgid "or you can reassign the appropriate :meth:`str`, etc., in your enum::" -msgstr "または列挙型の中で適切な :meth:`str` などを再代入することもできます::" +#: ../../library/enum.rst:1185 +msgid "Combining members of ``Flag``" +msgstr "``Flag`` のメンバーの組み合わせ" -#: ../../library/enum.rst:1027 +#: ../../library/enum.rst:1187 msgid "" -">>> from enum import Enum, IntEnum\n" -">>> class MyIntEnum(IntEnum):\n" -"... __str__ = Enum.__str__" +"If a combination of Flag members is not named, the :func:`repr` will include " +"all named flags and all named combinations of flags that are in the value::" msgstr "" +"Flag メンバーの組み合わせに名前が無い場合、 :func:`repr` の出力には、その値に" +"ある全ての名前を持つフラグと全ての名前を持つ組み合わせが含まれます::" diff --git a/library/errno.po b/library/errno.po index 3724f71e3..828011955 100644 --- a/library/errno.po +++ b/library/errno.po @@ -1,43 +1,45 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 -# Arihiro TAKASE, 2023 -# 石井明久, 2024 +# tomo, 2017 +# Nozomu Kaneko , 2017 +# E. Kawashima, 2017 +# Arihiro TAKASE, 2017 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 01:05+0000\n" -"Last-Translator: 石井明久, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 23:09+0000\n" +"Last-Translator: Arihiro TAKASE, 2017\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/errno.rst:2 -msgid ":mod:`!errno` --- Standard errno system symbols" -msgstr ":mod:`!errno` --- 標準の errno システムシンボル" +msgid ":mod:`errno` --- Standard errno system symbols" +msgstr ":mod:`errno` --- 標準の errno システムシンボル" #: ../../library/errno.rst:9 msgid "" "This module makes available standard ``errno`` system symbols. The value of " "each symbol is the corresponding integer value. The names and descriptions " -"are borrowed from :file:`linux/include/errno.h`, which should be all-" +"are borrowed from :file:`linux/include/errno.h`, which should be pretty all-" "inclusive." msgstr "" "このモジュールから標準の ``errno`` システムシンボルを取得することができます。" "個々のシンボルの値は ``errno`` に対応する整数値です。これらのシンボルの名前" -"は、 :file:`linux/include/errno.h` から借用されており、網羅的なはずです。" +"は、 :file:`linux/include/errno.h` から借用されており、かなり網羅的なはずで" +"す。" #: ../../library/errno.rst:17 msgid "" @@ -68,690 +70,526 @@ msgstr "" "ようなものがあります:" #: ../../library/errno.rst:30 -msgid "" -"Operation not permitted. This error is mapped to the exception :exc:" -"`PermissionError`." -msgstr "" +msgid "Operation not permitted" +msgstr "許可されていない操作です (Operation not permitted)" -#: ../../library/errno.rst:36 -msgid "" -"No such file or directory. This error is mapped to the exception :exc:" -"`FileNotFoundError`." +#: ../../library/errno.rst:35 +msgid "No such file or directory" msgstr "" +"そのようなファイルまたはディレクトリは存在しません (No such file or " +"directory)" -#: ../../library/errno.rst:42 -msgid "" -"No such process. This error is mapped to the exception :exc:" -"`ProcessLookupError`." -msgstr "" +#: ../../library/errno.rst:40 +msgid "No such process" +msgstr "指定したプロセスは存在しません (No such process)" + +#: ../../library/errno.rst:45 +msgid "Interrupted system call." +msgstr "システムコールが中断されました (Interrupted system call)" #: ../../library/errno.rst:48 -msgid "" -"Interrupted system call. This error is mapped to the exception :exc:" -"`InterruptedError`." -msgstr "" +msgid "This error is mapped to the exception :exc:`InterruptedError`." +msgstr "このエラーは例外 :exc:`InterruptedError` にマップされます。" -#: ../../library/errno.rst:54 +#: ../../library/errno.rst:53 msgid "I/O error" msgstr "I/O エラーです (I/O error)" -#: ../../library/errno.rst:59 +#: ../../library/errno.rst:58 msgid "No such device or address" msgstr "" "そのようなデバイスまたはアドレスは存在しません (No such device or address)" -#: ../../library/errno.rst:64 +#: ../../library/errno.rst:63 msgid "Arg list too long" msgstr "引数リストが長すぎます (Arg list too long)" -#: ../../library/errno.rst:69 +#: ../../library/errno.rst:68 msgid "Exec format error" msgstr "実行形式にエラーがあります (Exec format error)" -#: ../../library/errno.rst:74 +#: ../../library/errno.rst:73 msgid "Bad file number" msgstr "ファイル番号が間違っています (Bad file number)" -#: ../../library/errno.rst:79 -msgid "" -"No child processes. This error is mapped to the exception :exc:" -"`ChildProcessError`." -msgstr "" +#: ../../library/errno.rst:78 +msgid "No child processes" +msgstr "子プロセスがありません (No child processes)" -#: ../../library/errno.rst:85 -msgid "" -"Try again. This error is mapped to the exception :exc:`BlockingIOError`." -msgstr "" +#: ../../library/errno.rst:83 +msgid "Try again" +msgstr "再試行してください (Try again)" -#: ../../library/errno.rst:90 +#: ../../library/errno.rst:88 msgid "Out of memory" msgstr "空きメモリがありません (Out of memory)" -#: ../../library/errno.rst:95 -msgid "" -"Permission denied. This error is mapped to the exception :exc:" -"`PermissionError`." -msgstr "" +#: ../../library/errno.rst:93 +msgid "Permission denied" +msgstr "許可がありません (Permission denied)" -#: ../../library/errno.rst:101 +#: ../../library/errno.rst:98 msgid "Bad address" msgstr "不正なアドレスです (Bad address)" -#: ../../library/errno.rst:106 +#: ../../library/errno.rst:103 msgid "Block device required" msgstr "ブロックデバイスが必要です (Block device required)" -#: ../../library/errno.rst:111 +#: ../../library/errno.rst:108 msgid "Device or resource busy" msgstr "そのデバイスまたはリソースは使用中です (Device or resource busy)" -#: ../../library/errno.rst:116 -msgid "" -"File exists. This error is mapped to the exception :exc:`FileExistsError`." -msgstr "" +#: ../../library/errno.rst:113 +msgid "File exists" +msgstr "ファイルがすでに存在します (File exists)" -#: ../../library/errno.rst:122 +#: ../../library/errno.rst:118 msgid "Cross-device link" msgstr "デバイスをまたいだリンクです (Cross-device link)" -#: ../../library/errno.rst:127 +#: ../../library/errno.rst:123 msgid "No such device" msgstr "そのようなデバイスはありません (No such device)" -#: ../../library/errno.rst:132 -msgid "" -"Not a directory. This error is mapped to the exception :exc:" -"`NotADirectoryError`." -msgstr "" +#: ../../library/errno.rst:128 +msgid "Not a directory" +msgstr "ディレクトリではありません (Not a directory)" -#: ../../library/errno.rst:138 -msgid "" -"Is a directory. This error is mapped to the exception :exc:" -"`IsADirectoryError`." -msgstr "" +#: ../../library/errno.rst:133 +msgid "Is a directory" +msgstr "ディレクトリです (Is a directory)" -#: ../../library/errno.rst:144 +#: ../../library/errno.rst:138 msgid "Invalid argument" msgstr "無効な引数です (Invalid argument)" -#: ../../library/errno.rst:149 +#: ../../library/errno.rst:143 msgid "File table overflow" msgstr "ファイルテーブルがオーバフローしています (File table overflow)" -#: ../../library/errno.rst:154 +#: ../../library/errno.rst:148 msgid "Too many open files" msgstr "開かれたファイルが多すぎます (Too many open files)" -#: ../../library/errno.rst:159 +#: ../../library/errno.rst:153 msgid "Not a typewriter" msgstr "タイプライタではありません (Not a typewriter)" -#: ../../library/errno.rst:164 +#: ../../library/errno.rst:158 msgid "Text file busy" msgstr "テキストファイルが使用中です (Text file busy)" -#: ../../library/errno.rst:169 +#: ../../library/errno.rst:163 msgid "File too large" msgstr "ファイルが大きすぎます (File too large)" -#: ../../library/errno.rst:174 +#: ../../library/errno.rst:168 msgid "No space left on device" msgstr "デバイス上に空きがありません (No space left on device)" -#: ../../library/errno.rst:179 +#: ../../library/errno.rst:173 msgid "Illegal seek" msgstr "不正なシークです (Illegal seek)" -#: ../../library/errno.rst:184 +#: ../../library/errno.rst:178 msgid "Read-only file system" msgstr "リードオンリーのファイルシステムです (Read-only file system)" -#: ../../library/errno.rst:189 +#: ../../library/errno.rst:183 msgid "Too many links" msgstr "リンクが多すぎます (Too many links)" -#: ../../library/errno.rst:194 -msgid "" -"Broken pipe. This error is mapped to the exception :exc:`BrokenPipeError`." -msgstr "" +#: ../../library/errno.rst:188 +msgid "Broken pipe" +msgstr "壊れたパイプです (Broken pipe)" -#: ../../library/errno.rst:200 +#: ../../library/errno.rst:193 msgid "Math argument out of domain of func" msgstr "" "数学引数が関数の定義域を越えています (Math argument out of domain of func)" -#: ../../library/errno.rst:205 +#: ../../library/errno.rst:198 msgid "Math result not representable" msgstr "表現できない数学演算結果になりました (Math result not representable)" -#: ../../library/errno.rst:210 +#: ../../library/errno.rst:203 msgid "Resource deadlock would occur" msgstr "リソースのデッドロックが起きます (Resource deadlock would occur)" -#: ../../library/errno.rst:215 +#: ../../library/errno.rst:208 msgid "File name too long" msgstr "ファイル名が長すぎます (File name too long)" -#: ../../library/errno.rst:220 +#: ../../library/errno.rst:213 msgid "No record locks available" msgstr "レコードロッキングが利用できません (No record locks available)" -#: ../../library/errno.rst:225 +#: ../../library/errno.rst:218 msgid "Function not implemented" msgstr "実装されていない機能です (Function not implemented)" -#: ../../library/errno.rst:230 +#: ../../library/errno.rst:223 msgid "Directory not empty" msgstr "ディレクトリが空ではありません (Directory not empty)" -#: ../../library/errno.rst:235 +#: ../../library/errno.rst:228 msgid "Too many symbolic links encountered" msgstr "" "これ以上シンボリックリンクを追跡できません (Too many symbolic links " "encountered)" -#: ../../library/errno.rst:240 -msgid "" -"Operation would block. This error is mapped to the exception :exc:" -"`BlockingIOError`." -msgstr "" +#: ../../library/errno.rst:233 +msgid "Operation would block" +msgstr "操作がブロックします (Operation would block)" -#: ../../library/errno.rst:246 +#: ../../library/errno.rst:238 msgid "No message of desired type" msgstr "指定された型のメッセージはありません (No message of desired type)" -#: ../../library/errno.rst:251 +#: ../../library/errno.rst:243 msgid "Identifier removed" msgstr "識別子が除去されました (Identifier removed)" -#: ../../library/errno.rst:256 +#: ../../library/errno.rst:248 msgid "Channel number out of range" msgstr "チャネル番号が範囲を超えました (Channel number out of range)" -#: ../../library/errno.rst:261 +#: ../../library/errno.rst:253 msgid "Level 2 not synchronized" msgstr "レベル 2 で同期がとれていません (Level 2 not synchronized)" -#: ../../library/errno.rst:266 +#: ../../library/errno.rst:258 msgid "Level 3 halted" msgstr "レベル 3 で終了しました (Level 3 halted)" -#: ../../library/errno.rst:271 +#: ../../library/errno.rst:263 msgid "Level 3 reset" msgstr "レベル 3 でリセットしました (Level 3 reset)" -#: ../../library/errno.rst:276 +#: ../../library/errno.rst:268 msgid "Link number out of range" msgstr "リンク番号が範囲を超えています (Link number out of range)" -#: ../../library/errno.rst:281 +#: ../../library/errno.rst:273 msgid "Protocol driver not attached" msgstr "プロトコルドライバが接続されていません (Protocol driver not attached)" -#: ../../library/errno.rst:286 +#: ../../library/errno.rst:278 msgid "No CSI structure available" msgstr "CSI 構造体がありません (No CSI structure available)" -#: ../../library/errno.rst:291 +#: ../../library/errno.rst:283 msgid "Level 2 halted" msgstr "レベル 2 で終了しました (Level 2 halted)" -#: ../../library/errno.rst:296 +#: ../../library/errno.rst:288 msgid "Invalid exchange" msgstr "無効な変換です (Invalid exchange)" -#: ../../library/errno.rst:301 +#: ../../library/errno.rst:293 msgid "Invalid request descriptor" msgstr "無効な要求記述子です (Invalid request descriptor)" -#: ../../library/errno.rst:306 +#: ../../library/errno.rst:298 msgid "Exchange full" msgstr "変換テーブルが一杯です (Exchange full)" -#: ../../library/errno.rst:311 +#: ../../library/errno.rst:303 msgid "No anode" msgstr "陰極がありません (No anode)" -#: ../../library/errno.rst:316 +#: ../../library/errno.rst:308 msgid "Invalid request code" msgstr "無効なリクエストコードです (Invalid request code)" -#: ../../library/errno.rst:321 +#: ../../library/errno.rst:313 msgid "Invalid slot" msgstr "無効なスロットです (Invalid slot)" -#: ../../library/errno.rst:326 +#: ../../library/errno.rst:318 msgid "File locking deadlock error" msgstr "" "ファイルロックにおけるデッドロックエラーです (File locking deadlock error)" -#: ../../library/errno.rst:331 +#: ../../library/errno.rst:323 msgid "Bad font file format" msgstr "フォントファイル形式が間違っています (Bad font file format)" -#: ../../library/errno.rst:336 +#: ../../library/errno.rst:328 msgid "Device not a stream" msgstr "ストリーム型でないデバイスです (Device not a stream)" -#: ../../library/errno.rst:341 +#: ../../library/errno.rst:333 msgid "No data available" msgstr "利用可能なデータがありません (No data available)" -#: ../../library/errno.rst:346 +#: ../../library/errno.rst:338 msgid "Timer expired" msgstr "時間切れです (Timer expired)" -#: ../../library/errno.rst:351 +#: ../../library/errno.rst:343 msgid "Out of streams resources" msgstr "ストリームリソースを使い切りました (Out of streams resources)" -#: ../../library/errno.rst:356 +#: ../../library/errno.rst:348 msgid "Machine is not on the network" msgstr "計算機はネットワーク上にありません (Machine is not on the network)" -#: ../../library/errno.rst:361 +#: ../../library/errno.rst:353 msgid "Package not installed" msgstr "パッケージがインストールされていません (Package not installed)" -#: ../../library/errno.rst:366 +#: ../../library/errno.rst:358 msgid "Object is remote" msgstr "対象物は遠隔にあります (Object is remote)" -#: ../../library/errno.rst:371 +#: ../../library/errno.rst:363 msgid "Link has been severed" msgstr "リンクが切られました (Link has been severed)" -#: ../../library/errno.rst:376 +#: ../../library/errno.rst:368 msgid "Advertise error" msgstr "Advertise エラーです (Advertise error)" -#: ../../library/errno.rst:381 +#: ../../library/errno.rst:373 msgid "Srmount error" msgstr "Srmount エラーです (Srmount error)" -#: ../../library/errno.rst:386 +#: ../../library/errno.rst:378 msgid "Communication error on send" msgstr "送信時の通信エラーです (Communication error on send)" -#: ../../library/errno.rst:391 +#: ../../library/errno.rst:383 msgid "Protocol error" msgstr "プロトコルエラーです (Protocol error)" -#: ../../library/errno.rst:396 +#: ../../library/errno.rst:388 msgid "Multihop attempted" msgstr "多重ホップを試みました (Multihop attempted)" -#: ../../library/errno.rst:401 +#: ../../library/errno.rst:393 msgid "RFS specific error" msgstr "RFS 特有のエラーです (RFS specific error)" -#: ../../library/errno.rst:406 +#: ../../library/errno.rst:398 msgid "Not a data message" msgstr "データメッセージではありません (Not a data message)" -#: ../../library/errno.rst:411 +#: ../../library/errno.rst:403 msgid "Value too large for defined data type" msgstr "" "定義されたデータ型にとって大きすぎる値です (Value too large for defined data " "type)" -#: ../../library/errno.rst:416 +#: ../../library/errno.rst:408 msgid "Name not unique on network" msgstr "名前がネットワーク上で一意でありません (Name not unique on network)" -#: ../../library/errno.rst:421 +#: ../../library/errno.rst:413 msgid "File descriptor in bad state" msgstr "ファイル記述子の状態が不正です (File descriptor in bad state)" -#: ../../library/errno.rst:426 +#: ../../library/errno.rst:418 msgid "Remote address changed" msgstr "遠隔のアドレスが変更されました (Remote address changed)" -#: ../../library/errno.rst:431 +#: ../../library/errno.rst:423 msgid "Can not access a needed shared library" msgstr "" "必要な共有ライブラリにアクセスできません (Can not access a needed shared " "library)" -#: ../../library/errno.rst:436 +#: ../../library/errno.rst:428 msgid "Accessing a corrupted shared library" msgstr "" "壊れた共有ライブラリにアクセスしています (Accessing a corrupted shared " "library)" -#: ../../library/errno.rst:441 +#: ../../library/errno.rst:433 msgid ".lib section in a.out corrupted" msgstr "" "a.out の .lib セクションが壊れています (.lib section in a.out corrupted)" -#: ../../library/errno.rst:446 +#: ../../library/errno.rst:438 msgid "Attempting to link in too many shared libraries" msgstr "" "リンクを試みる共有ライブラリが多すぎます (Attempting to link in too many " "shared libraries)" -#: ../../library/errno.rst:451 +#: ../../library/errno.rst:443 msgid "Cannot exec a shared library directly" msgstr "" "共有ライブラリを直接実行することができません (Cannot exec a shared library " "directly)" -#: ../../library/errno.rst:456 +#: ../../library/errno.rst:448 msgid "Illegal byte sequence" msgstr "不正なバイト列です (Illegal byte sequence)" -#: ../../library/errno.rst:461 +#: ../../library/errno.rst:453 msgid "Interrupted system call should be restarted" msgstr "" "割り込みシステムコールを復帰しなければなりません (Interrupted system call " "should be restarted)" -#: ../../library/errno.rst:466 +#: ../../library/errno.rst:458 msgid "Streams pipe error" msgstr "ストリームパイプのエラーです (Streams pipe error)" -#: ../../library/errno.rst:471 +#: ../../library/errno.rst:463 msgid "Too many users" msgstr "ユーザが多すぎます (Too many users)" -#: ../../library/errno.rst:476 +#: ../../library/errno.rst:468 msgid "Socket operation on non-socket" msgstr "非ソケットに対するソケット操作です (Socket operation on non-socket)" -#: ../../library/errno.rst:481 +#: ../../library/errno.rst:473 msgid "Destination address required" msgstr "目的アドレスが必要です (Destination address required)" -#: ../../library/errno.rst:486 +#: ../../library/errno.rst:478 msgid "Message too long" msgstr "メッセージが長すぎます (Message too long)" -#: ../../library/errno.rst:491 +#: ../../library/errno.rst:483 msgid "Protocol wrong type for socket" msgstr "" "ソケットに対して不正なプロトコル型です (Protocol wrong type for socket)" -#: ../../library/errno.rst:496 +#: ../../library/errno.rst:488 msgid "Protocol not available" msgstr "利用できないプロトコルです (Protocol not available)" -#: ../../library/errno.rst:501 +#: ../../library/errno.rst:493 msgid "Protocol not supported" msgstr "サポートされていないプロトコルです (Protocol not supported)" -#: ../../library/errno.rst:506 +#: ../../library/errno.rst:498 msgid "Socket type not supported" msgstr "サポートされていないソケット型です (Socket type not supported)" -#: ../../library/errno.rst:511 +#: ../../library/errno.rst:503 msgid "Operation not supported on transport endpoint" msgstr "" "通信端点に対してサポートされていない操作です (Operation not supported on " "transport endpoint)" -#: ../../library/errno.rst:516 -msgid "Operation not supported" -msgstr "" - -#: ../../library/errno.rst:523 +#: ../../library/errno.rst:508 msgid "Protocol family not supported" msgstr "" "サポートされていないプロトコルファミリです (Protocol family not supported)" -#: ../../library/errno.rst:528 +#: ../../library/errno.rst:513 msgid "Address family not supported by protocol" msgstr "" "プロトコルでサポートされていないアドレスファミリです (Address family not " "supported by protocol)" -#: ../../library/errno.rst:533 +#: ../../library/errno.rst:518 msgid "Address already in use" msgstr "アドレスは使用中です (Address already in use)" -#: ../../library/errno.rst:538 +#: ../../library/errno.rst:523 msgid "Cannot assign requested address" msgstr "" "要求されたアドレスを割り当てできません (Cannot assign requested address)" -#: ../../library/errno.rst:543 +#: ../../library/errno.rst:528 msgid "Network is down" msgstr "ネットワークがダウンしています (Network is down)" -#: ../../library/errno.rst:548 +#: ../../library/errno.rst:533 msgid "Network is unreachable" msgstr "ネットワークに到達できません (Network is unreachable)" -#: ../../library/errno.rst:553 +#: ../../library/errno.rst:538 msgid "Network dropped connection because of reset" msgstr "" "リセットによってネットワーク接続が切られました (Network dropped connection " "because of reset)" -#: ../../library/errno.rst:558 -msgid "" -"Software caused connection abort. This error is mapped to the exception :exc:" -"`ConnectionAbortedError`." +#: ../../library/errno.rst:543 +msgid "Software caused connection abort" msgstr "" +"ソフトウェアによって接続が終了されました (Software caused connection abort)" -#: ../../library/errno.rst:564 -msgid "" -"Connection reset by peer. This error is mapped to the exception :exc:" -"`ConnectionResetError`." -msgstr "" +#: ../../library/errno.rst:548 +msgid "Connection reset by peer" +msgstr "接続がピアによってリセットされました (Connection reset by peer)" -#: ../../library/errno.rst:570 +#: ../../library/errno.rst:553 msgid "No buffer space available" msgstr "バッファに空きがありません (No buffer space available)" -#: ../../library/errno.rst:575 +#: ../../library/errno.rst:558 msgid "Transport endpoint is already connected" msgstr "" "通信端点がすでに接続されています (Transport endpoint is already connected)" -#: ../../library/errno.rst:580 +#: ../../library/errno.rst:563 msgid "Transport endpoint is not connected" msgstr "通信端点が接続されていません (Transport endpoint is not connected)" -#: ../../library/errno.rst:585 -msgid "" -"Cannot send after transport endpoint shutdown. This error is mapped to the " -"exception :exc:`BrokenPipeError`." +#: ../../library/errno.rst:568 +msgid "Cannot send after transport endpoint shutdown" msgstr "" +"通信端点のシャットダウン後は送信できません (Cannot send after transport " +"endpoint shutdown)" -#: ../../library/errno.rst:591 +#: ../../library/errno.rst:573 msgid "Too many references: cannot splice" msgstr "参照が多すぎます: 接続できません (Too many references: cannot splice)" -#: ../../library/errno.rst:596 -msgid "" -"Connection timed out. This error is mapped to the exception :exc:" -"`TimeoutError`." -msgstr "" +#: ../../library/errno.rst:578 +msgid "Connection timed out" +msgstr "接続がタイムアウトしました (Connection timed out)" -#: ../../library/errno.rst:602 -msgid "" -"Connection refused. This error is mapped to the exception :exc:" -"`ConnectionRefusedError`." -msgstr "" +#: ../../library/errno.rst:583 +msgid "Connection refused" +msgstr "接続を拒否されました (Connection refused)" -#: ../../library/errno.rst:608 +#: ../../library/errno.rst:588 msgid "Host is down" msgstr "ホストはシステムダウンしています (Host is down)" -#: ../../library/errno.rst:613 +#: ../../library/errno.rst:593 msgid "No route to host" msgstr "ホストへの経路がありません (No route to host)" -#: ../../library/errno.rst:618 -msgid "Memory page has hardware error." -msgstr "" - -#: ../../library/errno.rst:625 -msgid "" -"Operation already in progress. This error is mapped to the exception :exc:" -"`BlockingIOError`." -msgstr "" +#: ../../library/errno.rst:598 +msgid "Operation already in progress" +msgstr "すでに処理中です (Operation already in progress)" -#: ../../library/errno.rst:631 -msgid "" -"Operation now in progress. This error is mapped to the exception :exc:" -"`BlockingIOError`." -msgstr "" +#: ../../library/errno.rst:603 +msgid "Operation now in progress" +msgstr "現在処理中です (Operation now in progress)" -#: ../../library/errno.rst:637 +#: ../../library/errno.rst:608 msgid "Stale NFS file handle" msgstr "無効な NFS ファイルハンドルです (Stale NFS file handle)" -#: ../../library/errno.rst:642 +#: ../../library/errno.rst:613 msgid "Structure needs cleaning" msgstr "構造のクリーニングが必要です (Structure needs cleaning)" -#: ../../library/errno.rst:647 +#: ../../library/errno.rst:618 msgid "Not a XENIX named type file" msgstr "XENIX 名前付きファイルではありません (Not a XENIX named type file)" -#: ../../library/errno.rst:652 +#: ../../library/errno.rst:623 msgid "No XENIX semaphores available" msgstr "XENIX セマフォは利用できません (No XENIX semaphores available)" -#: ../../library/errno.rst:657 +#: ../../library/errno.rst:628 msgid "Is a named type file" msgstr "名前付きファイルです (Is a named type file)" -#: ../../library/errno.rst:662 +#: ../../library/errno.rst:633 msgid "Remote I/O error" msgstr "遠隔側の I/O エラーです (Remote I/O error)" -#: ../../library/errno.rst:667 +#: ../../library/errno.rst:638 msgid "Quota exceeded" msgstr "ディスククオータを超えました (Quota exceeded)" - -#: ../../library/errno.rst:671 -msgid "Interface output queue is full" -msgstr "" - -#: ../../library/errno.rst:678 -msgid "No medium found" -msgstr "" - -#: ../../library/errno.rst:683 -msgid "Wrong medium type" -msgstr "" - -#: ../../library/errno.rst:688 -msgid "Required key not available" -msgstr "" - -#: ../../library/errno.rst:693 -msgid "Key has expired" -msgstr "" - -#: ../../library/errno.rst:698 -msgid "Key has been revoked" -msgstr "" - -#: ../../library/errno.rst:703 -msgid "Key was rejected by service" -msgstr "" - -#: ../../library/errno.rst:708 -msgid "Operation not possible due to RF-kill" -msgstr "" - -#: ../../library/errno.rst:713 -msgid "Locked lock was unmapped" -msgstr "" - -#: ../../library/errno.rst:718 -msgid "Facility is not active" -msgstr "" - -#: ../../library/errno.rst:723 -msgid "Authentication error" -msgstr "" - -#: ../../library/errno.rst:730 -msgid "Bad CPU type in executable" -msgstr "" - -#: ../../library/errno.rst:737 -msgid "Bad executable (or shared library)" -msgstr "" - -#: ../../library/errno.rst:744 -msgid "Malformed Mach-o file" -msgstr "" - -#: ../../library/errno.rst:751 -msgid "Device error" -msgstr "" - -#: ../../library/errno.rst:758 -msgid "Inappropriate file type or format" -msgstr "" - -#: ../../library/errno.rst:765 -msgid "Need authenticator" -msgstr "" - -#: ../../library/errno.rst:772 -msgid "Attribute not found" -msgstr "" - -#: ../../library/errno.rst:779 -msgid "Policy not found" -msgstr "" - -#: ../../library/errno.rst:786 -msgid "Too many processes" -msgstr "" - -#: ../../library/errno.rst:793 -msgid "Bad procedure for program" -msgstr "" - -#: ../../library/errno.rst:800 -msgid "Program version wrong" -msgstr "" - -#: ../../library/errno.rst:807 -msgid "RPC prog. not avail" -msgstr "" - -#: ../../library/errno.rst:814 -msgid "Device power is off" -msgstr "" - -#: ../../library/errno.rst:821 -msgid "RPC struct is bad" -msgstr "" - -#: ../../library/errno.rst:828 -msgid "RPC version wrong" -msgstr "" - -#: ../../library/errno.rst:835 -msgid "Shared library version mismatch" -msgstr "" - -#: ../../library/errno.rst:842 -msgid "" -"Capabilities insufficient. This error is mapped to the exception :exc:" -"`PermissionError`." -msgstr "" - -#: ../../library/errno.rst:845 -msgid "Availability" -msgstr "" - -#: ../../library/errno.rst:852 -msgid "Operation canceled" -msgstr "" - -#: ../../library/errno.rst:859 -msgid "Owner died" -msgstr "" - -#: ../../library/errno.rst:866 -msgid "State not recoverable" -msgstr "" diff --git a/library/exceptions.po b/library/exceptions.po index 75a841fdc..3f38891a2 100644 --- a/library/exceptions.po +++ b/library/exceptions.po @@ -1,29 +1,34 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Arihiro TAKASE, 2023 -# Masato HASHIMOTO , 2023 -# Nozomu Kaneko , 2023 -# tomo, 2023 -# Takanori Suzuki , 2024 +# 秘湯 , 2017 +# Hano, 2017 +# E. Kawashima, 2017 +# Shun Sakurai, 2017 +# Nozomu Kaneko , 2017 +# Arihiro TAKASE, 2017 +# Osamu NAKAMURA, 2017 +# tomo, 2020 +# Shuuji Mihara , 2021 +# Takanori Suzuki , 2021 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 01:05+0000\n" -"Last-Translator: Takanori Suzuki , 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-08-04 07:08+0000\n" +"PO-Revision-Date: 2017-02-16 23:10+0000\n" +"Last-Translator: Takanori Suzuki , 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/exceptions.rst:4 @@ -48,18 +53,18 @@ msgstr "" #: ../../library/exceptions.rst:19 msgid "" -"The built-in exceptions listed in this chapter can be generated by the " -"interpreter or built-in functions. Except where mentioned, they have an " -"\"associated value\" indicating the detailed cause of the error. This may " -"be a string or a tuple of several items of information (e.g., an error code " -"and a string explaining the code). The associated value is usually passed " -"as arguments to the exception class's constructor." +"The built-in exceptions listed below can be generated by the interpreter or " +"built-in functions. Except where mentioned, they have an \"associated " +"value\" indicating the detailed cause of the error. This may be a string or " +"a tuple of several items of information (e.g., an error code and a string " +"explaining the code). The associated value is usually passed as arguments " +"to the exception class's constructor." msgstr "" -"この章で挙げる組み込み例外は、インタプリタや組み込み関数によって生成されま" -"す。特に注記しないかぎり、これらはエラーの詳しい原因を示す \"関連値 " -"(associated value)\" を持ちます。この値は、複数の情報 (エラーコードや、その" -"コードを説明する文字列など) の文字列かタプルです。関連値は通常、例外クラスの" -"コンストラクタに引数として渡されます。" +"以下に挙げる組み込み例外は、インタプリタや組み込み関数によって生成されます。" +"特に注記しないかぎり、これらはエラーの詳しい原因を示す \"関連値 (associated " +"value)\" を持ちます。この値は、複数の情報 (エラーコードや、そのコードを説明す" +"る文字列など) の文字列かタプルです。関連値は通常、例外クラスのコンストラクタ" +"に引数として渡されます。" #: ../../library/exceptions.rst:26 msgid "" @@ -88,70 +93,64 @@ msgstr "" "する上での詳しい情報は、 Python チュートリアルの :ref:`tut-userexceptions` の" "項目にあります。" -#: ../../library/exceptions.rst:39 -msgid "Exception context" -msgstr "例外コンテキスト" - -#: ../../library/exceptions.rst:46 +#: ../../library/exceptions.rst:37 msgid "" -"Three attributes on exception objects provide information about the context " -"in which the exception was raised:" +"When raising (or re-raising) an exception in an :keyword:`except` or :" +"keyword:`finally` clause :attr:`__context__` is automatically set to the " +"last exception caught; if the new exception is not handled the traceback " +"that is eventually displayed will include the originating exception(s) and " +"the final exception." msgstr "" -"例外オブジェクトの3つの属性は、例外が送出された常用に関する情報を提供します:" +":keyword:`except` または :keyword:`finally` 節内で例外を送出 (または再送出) " +"するとき、:attr:`__context__` は自動的に最後に捕まった例外に設定されます。新" +"しい例外が処理されなければ、最終的に表示されるトレースバックは先に起きた例外" +"も最後の例外も含みます。" -#: ../../library/exceptions.rst:53 +#: ../../library/exceptions.rst:43 msgid "" -"When raising a new exception while another exception is already being " -"handled, the new exception's :attr:`!__context__` attribute is automatically " -"set to the handled exception. An exception may be handled when an :keyword:" -"`except` or :keyword:`finally` clause, or a :keyword:`with` statement, is " -"used." +"When raising a new exception (rather than using a bare ``raise`` to re-raise " +"the exception currently being handled), the implicit exception context can " +"be supplemented with an explicit cause by using :keyword:`from` with :" +"keyword:`raise`::" msgstr "" +"(現在処理中の例外を ``raise`` を使って再送出するのではなく, )新規に例外を送出" +"する場合、:keyword:`raise` と一緒に :keyword:`from` を使うことで暗黙の例外コ" +"ンテキストを明示的に捕捉することができます::" -#: ../../library/exceptions.rst:59 -msgid "" -"This implicit exception context can be supplemented with an explicit cause " -"by using :keyword:`!from` with :keyword:`raise`::" -msgstr "" - -#: ../../library/exceptions.rst:63 -msgid "raise new_exc from original_exc" -msgstr "" - -#: ../../library/exceptions.rst:65 +#: ../../library/exceptions.rst:50 msgid "" "The expression following :keyword:`from` must be an exception or " -"``None``. It will be set as :attr:`!__cause__` on the raised exception. " -"Setting :attr:`!__cause__` also implicitly sets the :attr:`!" -"__suppress_context__` attribute to ``True``, so that using ``raise new_exc " +"``None``. It will be set as :attr:`__cause__` on the raised exception. " +"Setting :attr:`__cause__` also implicitly sets the :attr:" +"`__suppress_context__` attribute to ``True``, so that using ``raise new_exc " "from None`` effectively replaces the old exception with the new one for " "display purposes (e.g. converting :exc:`KeyError` to :exc:`AttributeError`), " -"while leaving the old exception available in :attr:`!__context__` for " +"while leaving the old exception available in :attr:`__context__` for " "introspection when debugging." msgstr "" ":keyword:`from ` に続く式は例外か ``None`` でなくてはなりません。\n" -"式は送出される例外の :attr:`!__cause__` として設定されます。\n" -":attr:`!__cause__` を設定することは、 :attr:`!__suppress_context__` 属性を暗" -"黙的に ``True`` に設定することにもなるので、 ``raise new_exc from None`` を使" -"うことで効率的に古い例外を新しいもので置き換えて表示する (例えば、 :exc:" +"式は送出される例外の :attr:`__cause__` として設定されます。\n" +":attr:`__cause__` を設定することは、 :attr:`__suppress_context__` 属性を暗黙" +"的に ``True`` に設定することにもなるので、 ``raise new_exc from None`` を使う" +"ことで効率的に古い例外を新しいもので置き換えて表示する (例えば、 :exc:" "`KeyError` を :exc:`AttributeError` に置き換え)、古い例外はデバッグ時の調査で" -"使えるよう :attr:`!__context__` に残すことができます。" +"使えるよう :attr:`__context__` に残すことができます。" -#: ../../library/exceptions.rst:74 +#: ../../library/exceptions.rst:59 msgid "" "The default traceback display code shows these chained exceptions in " "addition to the traceback for the exception itself. An explicitly chained " -"exception in :attr:`!__cause__` is always shown when present. An implicitly " -"chained exception in :attr:`!__context__` is shown only if :attr:`!" -"__cause__` is :const:`None` and :attr:`!__suppress_context__` is false." +"exception in :attr:`__cause__` is always shown when present. An implicitly " +"chained exception in :attr:`__context__` is shown only if :attr:`__cause__` " +"is :const:`None` and :attr:`__suppress_context__` is false." msgstr "" "デフォルトの traceback 表示コードは、例外自体の traceback に加え、これらの連" -"鎖された例外を表示します。:attr:`!__cause__` で明示的に連鎖させた例外は、存在" -"するならば常に表示されます。:attr:`!__context__` で暗黙に連鎖させた例外は、:" -"attr:`!__cause__` が :const:`None` かつ :attr:`!__suppress_context__` が " -"false の場合にのみ表示されます。" +"鎖された例外を表示します。:attr:`__cause__` で明示的に連鎖させた例外は、存在" +"するならば常に表示されます。:attr:`__context__` で暗黙に連鎖させた例外は、:" +"attr:`__cause__` が :const:`None` かつ :attr:`__suppress_context__` が false " +"の場合にのみ表示されます。" -#: ../../library/exceptions.rst:80 +#: ../../library/exceptions.rst:65 msgid "" "In either case, the exception itself is always shown after any chained " "exceptions so that the final line of the traceback always shows the last " @@ -160,39 +159,17 @@ msgstr "" "いずれにせよ、連鎖された例外に続いて、その例外自体は常に表示されます。そのた" "め、traceback の最終行には、常に送出された最後の例外が表示されます。" -#: ../../library/exceptions.rst:86 -msgid "Inheriting from built-in exceptions" -msgstr "組み込み例外から継承する" - -#: ../../library/exceptions.rst:88 -msgid "" -"User code can create subclasses that inherit from an exception type. It's " -"recommended to only subclass one exception type at a time to avoid any " -"possible conflicts between how the bases handle the ``args`` attribute, as " -"well as due to possible memory layout incompatibilities." -msgstr "" - -#: ../../library/exceptions.rst:95 -msgid "" -"Most built-in exceptions are implemented in C for efficiency, see: :source:" -"`Objects/exceptions.c`. Some have custom memory layouts which makes it " -"impossible to create a subclass that inherits from multiple exception types. " -"The memory layout of a type is an implementation detail and might change " -"between Python versions, leading to new conflicts in the future. Therefore, " -"it's recommended to avoid subclassing multiple exception types altogether." -msgstr "" - -#: ../../library/exceptions.rst:105 +#: ../../library/exceptions.rst:71 msgid "Base classes" msgstr "基底クラス" -#: ../../library/exceptions.rst:107 +#: ../../library/exceptions.rst:73 msgid "" "The following exceptions are used mostly as base classes for other " "exceptions." msgstr "以下の例外は、主に他の例外の基底クラスとして使われます。" -#: ../../library/exceptions.rst:111 +#: ../../library/exceptions.rst:77 msgid "" "The base class for all built-in exceptions. It is not meant to be directly " "inherited by user-defined classes (for that, use :exc:`Exception`). If :" @@ -205,7 +182,7 @@ msgstr "" "ンスタンスに :func:`str` が呼ばれた場合、インスタンスへの引数の表現か、引数が" "無い場合には空文字列が返されます。" -#: ../../library/exceptions.rst:119 +#: ../../library/exceptions.rst:85 msgid "" "The tuple of arguments given to the exception constructor. Some built-in " "exceptions (like :exc:`OSError`) expect a certain number of arguments and " @@ -217,52 +194,15 @@ msgstr "" "`OSError` など) いくつかの引数を必要とし、このタプルの要素に特別な意味を込め" "るものもあります。" -#: ../../library/exceptions.rst:126 +#: ../../library/exceptions.rst:92 msgid "" "This method sets *tb* as the new traceback for the exception and returns the " -"exception object. It was more commonly used before the exception chaining " -"features of :pep:`3134` became available. The following example shows how " -"we can convert an instance of ``SomeException`` into an instance of " -"``OtherException`` while preserving the traceback. Once raised, the current " -"frame is pushed onto the traceback of the ``OtherException``, as would have " -"happened to the traceback of the original ``SomeException`` had we allowed " -"it to propagate to the caller. ::" +"exception object. It is usually used in exception handling code like this::" msgstr "" +"このメソッドは *tb* を例外の新しいトレースバックとして設定し、例外オブジェク" +"トを返します。これは通常次のような例外処理コードに使われます::" -#: ../../library/exceptions.rst:135 -msgid "" -"try:\n" -" ...\n" -"except SomeException:\n" -" tb = sys.exception().__traceback__\n" -" raise OtherException(...).with_traceback(tb)" -msgstr "" - -#: ../../library/exceptions.rst:143 -msgid "" -"A writable field that holds the :ref:`traceback object ` " -"associated with this exception. See also: :ref:`raise`." -msgstr "" - -#: ../../library/exceptions.rst:149 -msgid "" -"Add the string ``note`` to the exception's notes which appear in the " -"standard traceback after the exception string. A :exc:`TypeError` is raised " -"if ``note`` is not a string." -msgstr "" -"例外のノートとして文字列 ``note`` を追加します。ノートは標準のトレースバック" -"で例外文字列の後に表示されます。``note`` が文字列以外の場合 :exc:`TypeError` " -"が送出されます。" - -#: ../../library/exceptions.rst:157 -msgid "" -"A list of the notes of this exception, which were added with :meth:" -"`add_note`. This attribute is created when :meth:`add_note` is called." -msgstr "" -":meth:`add_note` で追加された例外のノートのリスト。この属性は :meth:" -"`add_note` を呼び出すと生成されます。" - -#: ../../library/exceptions.rst:165 +#: ../../library/exceptions.rst:105 msgid "" "All built-in, non-system-exiting exceptions are derived from this class. " "All user-defined exceptions should also be derived from this class." @@ -270,7 +210,7 @@ msgstr "" "システム終了以外の全ての組み込み例外はこのクラスから派生しています。全ての" "ユーザ定義例外もこのクラスから派生させるべきです。" -#: ../../library/exceptions.rst:171 +#: ../../library/exceptions.rst:111 msgid "" "The base class for those built-in exceptions that are raised for various " "arithmetic errors: :exc:`OverflowError`, :exc:`ZeroDivisionError`, :exc:" @@ -279,7 +219,7 @@ msgstr "" "算術上の様々なエラーに対して送出される組み込み例外 :exc:`OverflowError`, :" "exc:`ZeroDivisionError`, :exc:`FloatingPointError` の基底クラスです。" -#: ../../library/exceptions.rst:178 +#: ../../library/exceptions.rst:118 msgid "" "Raised when a :ref:`buffer ` related operation cannot be " "performed." @@ -287,7 +227,7 @@ msgstr "" ":ref:`バッファ ` に関連する操作が行えなかったときに送出されま" "す。" -#: ../../library/exceptions.rst:184 +#: ../../library/exceptions.rst:124 msgid "" "The base class for the exceptions that are raised when a key or index used " "on a mapping or sequence is invalid: :exc:`IndexError`, :exc:`KeyError`. " @@ -297,19 +237,19 @@ msgstr "" "例外 :exc:`IndexError` および :exc:`KeyError` の基底クラスです。 :func:" "`codecs.lookup` によって直接送出されることもあります。" -#: ../../library/exceptions.rst:190 +#: ../../library/exceptions.rst:130 msgid "Concrete exceptions" msgstr "具象例外" -#: ../../library/exceptions.rst:192 +#: ../../library/exceptions.rst:132 msgid "The following exceptions are the exceptions that are usually raised." msgstr "以下の例外は、通常送出される例外です。" -#: ../../library/exceptions.rst:198 +#: ../../library/exceptions.rst:138 msgid "Raised when an :keyword:`assert` statement fails." msgstr ":keyword:`assert` 文が失敗した場合に送出されます。" -#: ../../library/exceptions.rst:203 +#: ../../library/exceptions.rst:143 msgid "" "Raised when an attribute reference (see :ref:`attribute-references`) or " "assignment fails. (When an object does not support attribute references or " @@ -319,22 +259,7 @@ msgstr "" "ます (オブジェクトが属性の参照や属性の代入をまったくサポートしていない場合に" "は :exc:`TypeError` が送出されます)。" -#: ../../library/exceptions.rst:207 -msgid "" -"The :attr:`name` and :attr:`obj` attributes can be set using keyword-only " -"arguments to the constructor. When set they represent the name of the " -"attribute that was attempted to be accessed and the object that was accessed " -"for said attribute, respectively." -msgstr "" -"コンストラクタのキーワード専用引数を使って :attr:`name` および :attr:`obj` 属" -"性を設定できます。設定された場合、アクセスが試みられた属性の名前と、その属性" -"にアクセスしたオブジェクトを、それぞれ表します。" - -#: ../../library/exceptions.rst:212 -msgid "Added the :attr:`name` and :attr:`obj` attributes." -msgstr ":attr:`name` および :attr:`obj` 属性が追加されました。" - -#: ../../library/exceptions.rst:217 +#: ../../library/exceptions.rst:150 msgid "" "Raised when the :func:`input` function hits an end-of-file condition (EOF) " "without reading any data. (N.B.: the :meth:`io.IOBase.read` and :meth:`io." @@ -344,11 +269,11 @@ msgstr "" "ます。(注意: :meth:`io.IOBase.read` と :meth:`io.IOBase.readline` メソッド" "は、EOF に達すると空文字列を返します。)" -#: ../../library/exceptions.rst:224 +#: ../../library/exceptions.rst:157 msgid "Not currently used." msgstr "現在は使われていません。" -#: ../../library/exceptions.rst:229 +#: ../../library/exceptions.rst:162 msgid "" "Raised when a :term:`generator` or :term:`coroutine` is closed; see :meth:" "`generator.close` and :meth:`coroutine.close`. It directly inherits from :" @@ -360,7 +285,7 @@ msgstr "" "参照してください。この例外は厳密に言えばエラーではないので、 :exc:" "`Exception` ではなく :exc:`BaseException` を直接継承しています。" -#: ../../library/exceptions.rst:237 +#: ../../library/exceptions.rst:170 msgid "" "Raised when the :keyword:`import` statement has troubles trying to load a " "module. Also raised when the \"from list\" in ``from ... import`` has a " @@ -371,27 +296,22 @@ msgstr "" "``from ... import`` の中の\"from list\" (訳注:``...`` の部分)の名前が見つか" "らないときにも送出されます。" -#: ../../library/exceptions.rst:241 +#: ../../library/exceptions.rst:174 msgid "" -"The optional *name* and *path* keyword-only arguments set the corresponding " -"attributes:" +"The :attr:`name` and :attr:`path` attributes can be set using keyword-only " +"arguments to the constructor. When set they represent the name of the module " +"that was attempted to be imported and the path to any file which triggered " +"the exception, respectively." msgstr "" -"オブションのキーワード専用引数 *name* と *path* は、対応する属性に設定されま" -"す:" - -#: ../../library/exceptions.rst:246 -msgid "The name of the module that was attempted to be imported." -msgstr "インポートを試みたモジュールの名前。" - -#: ../../library/exceptions.rst:250 -msgid "The path to any file which triggered the exception." -msgstr "例外を引き起こしたファイルのパス。" +"コンストラクタのキーワード専用引数を使って :attr:`name` および :attr:`path` " +"属性を設定できます。設定された場合、インポートを試みられたモジュールの名前" +"と、例外を引き起こしたファイルへのパスとを、それぞれ表します。" -#: ../../library/exceptions.rst:252 +#: ../../library/exceptions.rst:179 msgid "Added the :attr:`name` and :attr:`path` attributes." msgstr ":attr:`name` および :attr:`path` 属性が追加されました。" -#: ../../library/exceptions.rst:257 +#: ../../library/exceptions.rst:184 msgid "" "A subclass of :exc:`ImportError` which is raised by :keyword:`import` when a " "module could not be located. It is also raised when ``None`` is found in :" @@ -401,7 +321,7 @@ msgstr "" "ない場合に送出されます。また、 :data:`sys.modules` に ``None`` が含まれる場合" "にも送出されます。" -#: ../../library/exceptions.rst:266 +#: ../../library/exceptions.rst:193 msgid "" "Raised when a sequence subscript is out of range. (Slice indices are " "silently truncated to fall in the allowed range; if an index is not an " @@ -411,7 +331,7 @@ msgstr "" "ンスの範囲に収まるように暗黙のうちに調整されます; インデクスが整数でない場" "合、 :exc:`TypeError` が送出されます。)" -#: ../../library/exceptions.rst:275 +#: ../../library/exceptions.rst:202 msgid "" "Raised when a mapping (dictionary) key is not found in the set of existing " "keys." @@ -419,7 +339,7 @@ msgstr "" "マッピング (辞書) のキーが、既存のキーの集合内に見つからなかった場合に送出さ" "れます。" -#: ../../library/exceptions.rst:282 +#: ../../library/exceptions.rst:209 msgid "" "Raised when the user hits the interrupt key (normally :kbd:`Control-C` or :" "kbd:`Delete`). During execution, a check for interrupts is made regularly. " @@ -432,16 +352,7 @@ msgstr "" "を捕捉するコードに誤って捕捉されてインタプリタの終了が阻害されないように、こ" "の例外は :exc:`BaseException` を継承しています。" -#: ../../library/exceptions.rst:290 -msgid "" -"Catching a :exc:`KeyboardInterrupt` requires special consideration. Because " -"it can be raised at unpredictable points, it may, in some circumstances, " -"leave the running program in an inconsistent state. It is generally best to " -"allow :exc:`KeyboardInterrupt` to end the program as quickly as possible or " -"avoid raising it entirely. (See :ref:`handlers-and-exceptions`.)" -msgstr "" - -#: ../../library/exceptions.rst:300 +#: ../../library/exceptions.rst:218 msgid "" "Raised when an operation runs out of memory but the situation may still be " "rescued (by deleting some objects). The associated value is a string " @@ -459,7 +370,7 @@ msgstr "" "場合に備えて実行スタックのトレースバックを出力できるように、例外が送出されま" "す。" -#: ../../library/exceptions.rst:311 +#: ../../library/exceptions.rst:229 msgid "" "Raised when a local or global name is not found. This applies only to " "unqualified names. The associated value is an error message that includes " @@ -469,20 +380,7 @@ msgstr "" "修飾の (訳注: ``spam.egg`` ではなく単に ``egg`` のような) 名前のみに適用され" "ます。関連値は見つからなかった名前を含むエラーメッセージです。" -#: ../../library/exceptions.rst:315 -msgid "" -"The :attr:`name` attribute can be set using a keyword-only argument to the " -"constructor. When set it represent the name of the variable that was " -"attempted to be accessed." -msgstr "" -"コンストラクタのキーワード専用引数を使って :attr:`name` 属性を設定できます。" -"設定された場合、アクセスが試みられた変数の名前を表します。" - -#: ../../library/exceptions.rst:319 -msgid "Added the :attr:`name` attribute." -msgstr ":attr:`name` 属性が追加されました。" - -#: ../../library/exceptions.rst:325 +#: ../../library/exceptions.rst:236 msgid "" "This exception is derived from :exc:`RuntimeError`. In user defined base " "classes, abstract methods should raise this exception when they require " @@ -494,7 +392,7 @@ msgstr "" "外を送出しなくてはなりません。またはクラスは実装中であり本来の実装を追加する" "必要があることを示します。" -#: ../../library/exceptions.rst:332 +#: ../../library/exceptions.rst:243 msgid "" "It should not be used to indicate that an operator or method is not meant to " "be supported at all -- in that case either leave the operator / method " @@ -504,14 +402,17 @@ msgstr "" "ではありません。そのようなケースではオペレータやメソッドを未定義のままとする" "か、サブクラスの場合は :data:`None` を設定してください。" -#: ../../library/exceptions.rst:338 +#: ../../library/exceptions.rst:249 msgid "" -":exc:`!NotImplementedError` and :data:`!NotImplemented` are not " -"interchangeable. This exception should only be used as described above; see :" -"data:`NotImplemented` for details on correct usage of the built-in constant." +"``NotImplementedError`` and ``NotImplemented`` are not interchangeable, even " +"though they have similar names and purposes. See :data:`NotImplemented` for " +"details on when to use it." msgstr "" +"``NotImplementedError`` と ``NotImplemented`` は、似たような名前と目的を持っ" +"ていますが、相互に変換できません。 利用する際には、 :data:`NotImplemented` を" +"参照してください。" -#: ../../library/exceptions.rst:349 +#: ../../library/exceptions.rst:258 msgid "" "This exception is raised when a system function returns a system-related " "error, including I/O failures such as \"file not found\" or \"disk " @@ -521,7 +422,7 @@ msgstr "" "ば \"file not found\" や \"disk full\" のような I/O の失敗が発生したときです " "(引数の型が不正な場合や、他の偶発的なエラーは除きます)。" -#: ../../library/exceptions.rst:353 +#: ../../library/exceptions.rst:262 msgid "" "The second form of the constructor sets the corresponding attributes, " "described below. The attributes default to :const:`None` if not specified. " @@ -534,7 +435,7 @@ msgstr "" "れた場合、:attr:`~BaseException.args` 属性は最初の2つの要素のみからなるタプル" "を持ちます。" -#: ../../library/exceptions.rst:359 +#: ../../library/exceptions.rst:268 msgid "" "The constructor often actually returns a subclass of :exc:`OSError`, as " "described in `OS exceptions`_ below. The particular subclass depends on the " @@ -547,11 +448,11 @@ msgstr "" "errno` 値によります。この挙動は :exc:`OSError` を直接またはエイリアスで構築" "し、サブクラス化時に継承されなかった場合にのみ発生します。" -#: ../../library/exceptions.rst:367 +#: ../../library/exceptions.rst:276 msgid "A numeric error code from the C variable :c:data:`errno`." msgstr "C 変数 :c:data:`errno` に由来する数値エラーコードです。" -#: ../../library/exceptions.rst:371 +#: ../../library/exceptions.rst:280 msgid "" "Under Windows, this gives you the native Windows error code. The :attr:`." "errno` attribute is then an approximate translation, in POSIX terms, of that " @@ -560,7 +461,7 @@ msgstr "" "Windows において、ネイティブ Windows エラーコードを与えます。そして :attr:" "`errno` 属性は POSIX でいうネイティブエラーコードへのおよその翻訳です。" -#: ../../library/exceptions.rst:375 +#: ../../library/exceptions.rst:284 msgid "" "Under Windows, if the *winerror* constructor argument is an integer, the :" "attr:`.errno` attribute is determined from the Windows error code, and the " @@ -572,7 +473,7 @@ msgstr "" "フォームでは *winerror* 引数は無視され、 :attr:`winerror` 属性は存在しませ" "ん。" -#: ../../library/exceptions.rst:383 +#: ../../library/exceptions.rst:292 msgid "" "The corresponding error message, as provided by the operating system. It is " "formatted by the C functions :c:func:`perror` under POSIX, and :c:func:" @@ -582,7 +483,7 @@ msgstr "" "POSIX では :c:func:`perror` で、Windows では :c:func:`FormatMessage` で体裁化" "されます。" -#: ../../library/exceptions.rst:391 +#: ../../library/exceptions.rst:300 msgid "" "For exceptions that involve a file system path (such as :func:`open` or :" "func:`os.unlink`), :attr:`filename` is the file name passed to the function. " @@ -595,7 +496,7 @@ msgstr "" "ファイルシステムパスが2つ関与する関数 (例えば :func:`os.rename`) の場合、:" "attr:`filename2` は関数に渡された2つ目のファイル名です。" -#: ../../library/exceptions.rst:398 +#: ../../library/exceptions.rst:307 msgid "" ":exc:`EnvironmentError`, :exc:`IOError`, :exc:`WindowsError`, :exc:`socket." "error`, :exc:`select.error` and :exc:`mmap.error` have been merged into :exc:" @@ -605,26 +506,25 @@ msgstr "" "error`, :exc:`select.error`, :exc:`mmap.error` が :exc:`OSError` に統合されま" "した。コンストラクタはサブクラスを返すかもしれません。" -#: ../../library/exceptions.rst:404 +#: ../../library/exceptions.rst:313 msgid "" "The :attr:`filename` attribute is now the original file name passed to the " -"function, instead of the name encoded to or decoded from the :term:" -"`filesystem encoding and error handler`. Also, the *filename2* constructor " -"argument and attribute was added." +"function, instead of the name encoded to or decoded from the filesystem " +"encoding. Also, the *filename2* constructor argument and attribute was " +"added." msgstr "" -":attr:`filename` 属性が :term:`filesystem encoding and error handler` のエン" -"コーディングでエンコードやデコードされた名前から、関数に渡された元々のファイ" -"ル名になりました。\n" +":attr:`filename` 属性がファイルシステムのエンコーディングでエンコードやデコー" +"ドされた名前から、関数に渡された元々のファイル名になりました。\n" "また、*filename2* コンストラクタ引数が追加されました。" -#: ../../library/exceptions.rst:413 +#: ../../library/exceptions.rst:322 msgid "" "Raised when the result of an arithmetic operation is too large to be " "represented. This cannot occur for integers (which would rather raise :exc:" "`MemoryError` than give up). However, for historical reasons, OverflowError " "is sometimes raised for integers that are outside a required range. " -"Because of the lack of standardization of floating-point exception handling " -"in C, most floating-point operations are not checked." +"Because of the lack of standardization of floating point exception handling " +"in C, most floating point operations are not checked." msgstr "" "算術演算の結果が表現できない大きな値になった場合に送出されます。これは整数で" "は起こりません (むしろ :exc:`MemoryError` が送出されることになるでしょう)。し" @@ -632,44 +532,7 @@ msgstr "" "出されることがあります。C の浮動小数点演算の例外処理は標準化されていないの" "で、ほとんどの浮動小数点演算もチェックされません。" -#: ../../library/exceptions.rst:423 -msgid "" -"This exception is derived from :exc:`RuntimeError`. It is raised when an " -"operation is blocked during interpreter shutdown also known as :term:`Python " -"finalization `." -msgstr "" - -#: ../../library/exceptions.rst:427 -msgid "" -"Examples of operations which can be blocked with a :exc:" -"`PythonFinalizationError` during the Python finalization:" -msgstr "" - -#: ../../library/exceptions.rst:430 -msgid "Creating a new Python thread." -msgstr "" - -#: ../../library/exceptions.rst:431 -msgid ":meth:`Joining ` a running daemon thread." -msgstr "" - -#: ../../library/exceptions.rst:432 -msgid ":func:`os.fork`." -msgstr ":func:`os.fork`" - -#: ../../library/exceptions.rst:434 -msgid "See also the :func:`sys.is_finalizing` function." -msgstr ":func:`sys.is_finalizing` 関数も参照してください。" - -#: ../../library/exceptions.rst:436 ../../library/exceptions.rst:449 -msgid "Previously, a plain :exc:`RuntimeError` was raised." -msgstr "以前は :exc:`RuntimeError` をそのまま送出していました。" - -#: ../../library/exceptions.rst:441 -msgid ":meth:`threading.Thread.join` can now raise this exception." -msgstr "" - -#: ../../library/exceptions.rst:445 +#: ../../library/exceptions.rst:332 msgid "" "This exception is derived from :exc:`RuntimeError`. It is raised when the " "interpreter detects that the maximum recursion depth (see :func:`sys." @@ -678,7 +541,11 @@ msgstr "" "この例外は :exc:`RuntimeError` を継承しています。インタープリタが最大再帰深" "度 (:func:`sys.getrecursionlimit` を参照) の超過を検出すると送出されます。" -#: ../../library/exceptions.rst:455 +#: ../../library/exceptions.rst:336 +msgid "Previously, a plain :exc:`RuntimeError` was raised." +msgstr "以前は :exc:`RuntimeError` をそのまま送出していました。" + +#: ../../library/exceptions.rst:342 msgid "" "This exception is raised when a weak reference proxy, created by the :func:" "`weakref.proxy` function, is used to access an attribute of the referent " @@ -690,7 +557,7 @@ msgstr "" "にアクセスした場合に送出されます。弱参照については :mod:`weakref` モジュール" "を参照してください。" -#: ../../library/exceptions.rst:463 +#: ../../library/exceptions.rst:350 msgid "" "Raised when an error is detected that doesn't fall in any of the other " "categories. The associated value is a string indicating what precisely went " @@ -699,7 +566,7 @@ msgstr "" "他のカテゴリに分類できないエラーが検出された場合に送出されます。関連値は、何" "が問題だったのかをより詳細に示す文字列です。" -#: ../../library/exceptions.rst:470 +#: ../../library/exceptions.rst:357 msgid "" "Raised by built-in function :func:`next` and an :term:`iterator`\\'s :meth:" "`~iterator.__next__` method to signal that there are no further items " @@ -709,16 +576,15 @@ msgstr "" "ソッドによって、そのイテレータが生成するアイテムがこれ以上ないことを伝えるた" "めに送出されます。" -#: ../../library/exceptions.rst:476 +#: ../../library/exceptions.rst:361 msgid "" -"The exception object has a single attribute :attr:`!value`, which is given " -"as an argument when constructing the exception, and defaults to :const:" -"`None`." +"The exception object has a single attribute :attr:`value`, which is given as " +"an argument when constructing the exception, and defaults to :const:`None`." msgstr "" -"この例外オブジェクトには一つの属性 :attr:`!value` があり、例外を構成する際に" -"引数として与えられ、デフォルトは :const:`None` です。" +"この例外オブジェクトには一つの属性 :attr:`value` があり、例外を構成する際に引" +"数として与えられ、デフォルトは :const:`None` です。" -#: ../../library/exceptions.rst:480 +#: ../../library/exceptions.rst:365 msgid "" "When a :term:`generator` or :term:`coroutine` function returns, a new :exc:" "`StopIteration` instance is raised, and the value returned by the function " @@ -728,7 +594,7 @@ msgstr "" "`StopIteration` インスタンスが送出されます。\n" "関数の返り値は例外のコンストラクタの :attr:`value` 引数として使われます。" -#: ../../library/exceptions.rst:485 +#: ../../library/exceptions.rst:370 msgid "" "If a generator code directly or indirectly raises :exc:`StopIteration`, it " "is converted into a :exc:`RuntimeError` (retaining the :exc:`StopIteration` " @@ -738,7 +604,7 @@ msgstr "" "場合は、 :exc:`RuntimeError` に変換されます (:exc:`StopIteration` は変換後の" "例外の原因として保持されます)。" -#: ../../library/exceptions.rst:489 +#: ../../library/exceptions.rst:374 msgid "" "Added ``value`` attribute and the ability for generator functions to use it " "to return a value." @@ -746,7 +612,7 @@ msgstr "" "``value`` 属性とジェネレータ関数が値を返すためにそれを使う機能が追加されまし" "た。" -#: ../../library/exceptions.rst:493 +#: ../../library/exceptions.rst:378 msgid "" "Introduced the RuntimeError transformation via ``from __future__ import " "generator_stop``, see :pep:`479`." @@ -754,7 +620,7 @@ msgstr "" "``from __future__ import generator_stop`` による RuntimeError への変換が導入" "されました。 :pep:`479` を参照してください。" -#: ../../library/exceptions.rst:497 +#: ../../library/exceptions.rst:382 msgid "" "Enable :pep:`479` for all code by default: a :exc:`StopIteration` error " "raised in a generator is transformed into a :exc:`RuntimeError`." @@ -762,15 +628,15 @@ msgstr "" ":pep:`479` が全てのコードでデフォルトで有効化されました: ジェネレータから送出" "された :exc:`StopIteration` は :exc:`RuntimeError` に変換されます。" -#: ../../library/exceptions.rst:503 +#: ../../library/exceptions.rst:388 msgid "" -"Must be raised by :meth:`~object.__anext__` method of an :term:`asynchronous " +"Must be raised by :meth:`__anext__` method of an :term:`asynchronous " "iterator` object to stop the iteration." msgstr "" "イテレーションを停止するために、 :term:`asynchronous iterator` オブジェクト" -"の :meth:`~object.__anext__` メソッドによって返される必要があります。" +"の :meth:`__anext__` メソッドによって返される必要があります。" -#: ../../library/exceptions.rst:510 +#: ../../library/exceptions.rst:395 msgid "" "Raised when the parser encounters a syntax error. This may occur in an :" "keyword:`import` statement, in a call to the built-in functions :func:" @@ -781,7 +647,7 @@ msgstr "" "文、組み込み関数 :func:`compile`、:func:`exec` や :func:`eval` 、初期化スクリ" "プトの読み込みや標準入力で (対話的な実行時にも) 起こる可能性があります。" -#: ../../library/exceptions.rst:516 +#: ../../library/exceptions.rst:401 msgid "" "The :func:`str` of the exception instance returns only the error message. " "Details is a tuple whose members are also available as separate attributes." @@ -789,11 +655,11 @@ msgstr "" "例外インスタンスの :func:`str` はエラーメッセージのみを返します。詳細はタプル" "で、個々の属性としても利用できます。" -#: ../../library/exceptions.rst:521 +#: ../../library/exceptions.rst:406 msgid "The name of the file the syntax error occurred in." msgstr "構文エラーが発生したファイルの名前。" -#: ../../library/exceptions.rst:525 +#: ../../library/exceptions.rst:410 msgid "" "Which line number in the file the error occurred in. This is 1-indexed: the " "first line in the file has a ``lineno`` of 1." @@ -801,7 +667,7 @@ msgstr "" "ファイルのエラーが発生した行番号。1から数えはじめるため、ファイルの最初の行" "の ``lineno`` は1です。" -#: ../../library/exceptions.rst:530 +#: ../../library/exceptions.rst:415 msgid "" "The column in the line where the error occurred. This is 1-indexed: the " "first character in the line has an ``offset`` of 1." @@ -809,39 +675,19 @@ msgstr "" "行のエラーが発生した列番号。1から数えはじめるため、行の最初の文字の " "``offset`` は1です。" -#: ../../library/exceptions.rst:535 +#: ../../library/exceptions.rst:420 msgid "The source code text involved in the error." msgstr "エラーを含むソースコードのテキスト。" -#: ../../library/exceptions.rst:539 -msgid "" -"Which line number in the file the error occurred ends in. This is 1-indexed: " -"the first line in the file has a ``lineno`` of 1." -msgstr "" -"ファイルのエラーが発生した最後の行番号。1から数えはじめるため、ファイルの最初" -"の行の ``lineno`` は1です。" - -#: ../../library/exceptions.rst:544 -msgid "" -"The column in the end line where the error occurred finishes. This is 1-" -"indexed: the first character in the line has an ``offset`` of 1." -msgstr "" -"行のエラーが発生した最後の列番号。1から数えはじめるため、行の最初の文字の " -"``offset`` は1です。" - -#: ../../library/exceptions.rst:547 +#: ../../library/exceptions.rst:422 msgid "" "For errors in f-string fields, the message is prefixed by \"f-string: \" and " "the offsets are offsets in a text constructed from the replacement " "expression. For example, compiling f'Bad {a b} field' results in this args " -"attribute: ('f-string: ...', ('', 1, 2, '(a b)\\n', 1, 5))." +"attribute: ('f-string: ...', ('', 1, 4, '(a b)\\n'))." msgstr "" -#: ../../library/exceptions.rst:552 -msgid "Added the :attr:`end_lineno` and :attr:`end_offset` attributes." -msgstr ":attr:`end_lineno` および :attr:`end_offset` 属性が追加されました。" - -#: ../../library/exceptions.rst:557 +#: ../../library/exceptions.rst:430 msgid "" "Base class for syntax errors related to incorrect indentation. This is a " "subclass of :exc:`SyntaxError`." @@ -849,7 +695,7 @@ msgstr "" "正しくないインデントに関する構文エラーの基底クラスです。これは :exc:" "`SyntaxError` のサブクラスです。" -#: ../../library/exceptions.rst:563 +#: ../../library/exceptions.rst:436 msgid "" "Raised when indentation contains an inconsistent use of tabs and spaces. " "This is a subclass of :exc:`IndentationError`." @@ -857,27 +703,31 @@ msgstr "" "タブとスペースを一貫しない方法でインデントに使っているときに送出されます。こ" "れは :exc:`IndentationError` のサブクラスです。" -#: ../../library/exceptions.rst:569 +#: ../../library/exceptions.rst:442 msgid "" "Raised when the interpreter finds an internal error, but the situation does " "not look so serious to cause it to abandon all hope. The associated value is " -"a string indicating what went wrong (in low-level terms). In :term:" -"`CPython`, this could be raised by incorrectly using Python's C API, such as " -"returning a ``NULL`` value without an exception set." +"a string indicating what went wrong (in low-level terms)." msgstr "" +"インタプリタが内部エラーを発見したが、状況は全ての望みを棄てさせるほど深刻で" +"はないと思われる場合に送出されます。関連値は (下位層で) どの動作が失敗したか" +"を示す文字列です。" -#: ../../library/exceptions.rst:575 +#: ../../library/exceptions.rst:446 msgid "" -"If you're confident that this exception wasn't your fault, or the fault of a " -"package you're using, you should report this to the author or maintainer of " -"your Python interpreter. Be sure to report the version of the Python " -"interpreter (``sys.version``; it is also printed at the start of an " -"interactive Python session), the exact error message (the exception's " -"associated value) and if possible the source of the program that triggered " -"the error." +"You should report this to the author or maintainer of your Python " +"interpreter. Be sure to report the version of the Python interpreter (``sys." +"version``; it is also printed at the start of an interactive Python " +"session), the exact error message (the exception's associated value) and if " +"possible the source of the program that triggered the error." msgstr "" +"使用中の Python インタプリタの作者または保守担当者にこのエラーを報告してくだ" +"さい。このとき、Python インタプリタのバージョン (``sys.version`` 。Python の" +"対話的セッションを開始した際にも出力されます)、正確なエラーメッセージ (例外の" +"関連値) を忘れずに報告してください。可能な場合にはエラーを引き起こしたプログ" +"ラムのソースコードも報告してください。" -#: ../../library/exceptions.rst:586 +#: ../../library/exceptions.rst:455 msgid "" "This exception is raised by the :func:`sys.exit` function. It inherits " "from :exc:`BaseException` instead of :exc:`Exception` so that it is not " @@ -900,7 +750,7 @@ msgstr "" "します。値が ``None`` の場合、終了ステータスは 0 です。それ以外の型の場合 (例" "えば str)、 オブジェクトの値が表示され、終了ステータスは 1 です。" -#: ../../library/exceptions.rst:597 +#: ../../library/exceptions.rst:466 msgid "" "A call to :func:`sys.exit` is translated into an exception so that clean-up " "handlers (:keyword:`finally` clauses of :keyword:`try` statements) can be " @@ -915,7 +765,7 @@ msgstr "" "即座に終了することが真に強く必要であるとき (例えば、:func:`os.fork` を呼んだ" "後の子プロセス内) には :func:`os._exit` 関数を使うことができます。" -#: ../../library/exceptions.rst:606 +#: ../../library/exceptions.rst:475 msgid "" "The exit status or error message that is passed to the constructor. " "(Defaults to ``None``.)" @@ -923,7 +773,7 @@ msgstr "" "コンストラクタに渡された終了ステータス又はエラーメッセージ。(デフォルトは " "``None``)" -#: ../../library/exceptions.rst:612 +#: ../../library/exceptions.rst:481 msgid "" "Raised when an operation or function is applied to an object of " "inappropriate type. The associated value is a string giving details about " @@ -932,7 +782,7 @@ msgstr "" "組み込み演算または関数が適切でない型のオブジェクトに対して適用された際に送出" "されます。関連値は型の不整合に関して詳細を述べた文字列です。" -#: ../../library/exceptions.rst:615 +#: ../../library/exceptions.rst:484 msgid "" "This exception may be raised by user code to indicate that an attempted " "operation on an object is not supported, and is not meant to be. If an " @@ -944,7 +794,7 @@ msgstr "" "その操作をサポートするつもりだが、まだ実装を提供していないのであれば、送出す" "る適切な例外は :exc:`NotImplementedError` です。" -#: ../../library/exceptions.rst:620 +#: ../../library/exceptions.rst:489 msgid "" "Passing arguments of the wrong type (e.g. passing a :class:`list` when an :" "class:`int` is expected) should result in a :exc:`TypeError`, but passing " @@ -956,7 +806,7 @@ msgstr "" "えば、期待する範囲外の数)が引数として渡された場合は、 :exc:`ValueError` とな" "るべきです。" -#: ../../library/exceptions.rst:627 +#: ../../library/exceptions.rst:496 msgid "" "Raised when a reference is made to a local variable in a function or method, " "but no value has been bound to that variable. This is a subclass of :exc:" @@ -965,7 +815,7 @@ msgstr "" "関数やメソッド内のローカルな変数に対して参照を行ったが、その変数には値が代入" "されていなかった場合に送出されます。 :exc:`NameError` のサブクラスです。" -#: ../../library/exceptions.rst:634 +#: ../../library/exceptions.rst:503 msgid "" "Raised when a Unicode-related encoding or decoding error occurs. It is a " "subclass of :exc:`ValueError`." @@ -973,7 +823,7 @@ msgstr "" "Unicode に関するエンコードまたはデコードのエラーが発生した際に送出されま" "す。 :exc:`ValueError` のサブクラスです。" -#: ../../library/exceptions.rst:637 +#: ../../library/exceptions.rst:506 msgid "" ":exc:`UnicodeError` has attributes that describe the encoding or decoding " "error. For example, ``err.object[err.start:err.end]`` gives the particular " @@ -983,33 +833,27 @@ msgstr "" "ています。例えば、 ``err.object[err.start:err.end]`` は、無効な入力のうちコー" "デックが処理に失敗した箇所を表します。" -#: ../../library/exceptions.rst:643 +#: ../../library/exceptions.rst:512 msgid "The name of the encoding that raised the error." msgstr "エラーを送出したエンコーディングの名前です。" -#: ../../library/exceptions.rst:647 +#: ../../library/exceptions.rst:516 msgid "A string describing the specific codec error." msgstr "そのコーデックエラーを説明する文字列です。" -#: ../../library/exceptions.rst:651 +#: ../../library/exceptions.rst:520 msgid "The object the codec was attempting to encode or decode." msgstr "コーデックがエンコードまたはデコードしようとしたオブジェクトです。" -#: ../../library/exceptions.rst:655 +#: ../../library/exceptions.rst:524 msgid "The first index of invalid data in :attr:`object`." msgstr ":attr:`object` の最初の無効なデータのインデクスです。" -#: ../../library/exceptions.rst:657 ../../library/exceptions.rst:664 -msgid "" -"This value should not be negative as it is interpreted as an absolute offset " -"but this constraint is not enforced at runtime." -msgstr "" - -#: ../../library/exceptions.rst:662 +#: ../../library/exceptions.rst:528 msgid "The index after the last invalid data in :attr:`object`." msgstr ":attr:`object` の最後の無効なデータの次のインデクスです。" -#: ../../library/exceptions.rst:670 +#: ../../library/exceptions.rst:533 msgid "" "Raised when a Unicode-related error occurs during encoding. It is a " "subclass of :exc:`UnicodeError`." @@ -1017,7 +861,7 @@ msgstr "" "Unicode 関連のエラーがエンコード中に発生した際に送出されます。 :exc:" "`UnicodeError` のサブクラスです。" -#: ../../library/exceptions.rst:676 +#: ../../library/exceptions.rst:539 msgid "" "Raised when a Unicode-related error occurs during decoding. It is a " "subclass of :exc:`UnicodeError`." @@ -1025,7 +869,7 @@ msgstr "" "Unicode 関連のエラーがデコード中に発生した際に送出されます。 :exc:" "`UnicodeError` のサブクラスです。" -#: ../../library/exceptions.rst:682 +#: ../../library/exceptions.rst:545 msgid "" "Raised when a Unicode-related error occurs during translating. It is a " "subclass of :exc:`UnicodeError`." @@ -1033,7 +877,7 @@ msgstr "" "Unicode 関連のエラーが変換中に発生した際に送出されます。 :exc:`UnicodeError` " "のサブクラスです。" -#: ../../library/exceptions.rst:688 +#: ../../library/exceptions.rst:551 msgid "" "Raised when an operation or function receives an argument that has the right " "type but an inappropriate value, and the situation is not described by a " @@ -1042,7 +886,7 @@ msgstr "" "演算子や関数が、正しい型だが適切でない値を持つ引数を受け取ったときや、 :exc:" "`IndexError` のようなより詳細な例外では記述できない状況で送出されます。" -#: ../../library/exceptions.rst:695 +#: ../../library/exceptions.rst:558 msgid "" "Raised when the second argument of a division or modulo operation is zero. " "The associated value is a string indicating the type of the operands and the " @@ -1051,7 +895,7 @@ msgstr "" "除算や剰余演算の第二引数が 0 であった場合に送出されます。関連値は文字列で、そ" "の演算における被演算子と演算子の型を示します。" -#: ../../library/exceptions.rst:700 +#: ../../library/exceptions.rst:563 msgid "" "The following exceptions are kept for compatibility with previous versions; " "starting from Python 3.3, they are aliases of :exc:`OSError`." @@ -1059,15 +903,15 @@ msgstr "" "以下の例外は、過去のバージョンとの後方互換性のために残されています; Python " "3.3 より、これらは :exc:`OSError` のエイリアスです。" -#: ../../library/exceptions.rst:709 +#: ../../library/exceptions.rst:572 msgid "Only available on Windows." msgstr "Windows でのみ利用できます。" -#: ../../library/exceptions.rst:713 +#: ../../library/exceptions.rst:576 msgid "OS exceptions" msgstr "OS 例外" -#: ../../library/exceptions.rst:715 +#: ../../library/exceptions.rst:578 msgid "" "The following exceptions are subclasses of :exc:`OSError`, they get raised " "depending on the system error code." @@ -1075,19 +919,17 @@ msgstr "" "以下の例外は :exc:`OSError` のサブクラスで、システムエラーコードに依存して送" "出されます。" -#: ../../library/exceptions.rst:720 +#: ../../library/exceptions.rst:583 msgid "" "Raised when an operation would block on an object (e.g. socket) set for non-" -"blocking operation. Corresponds to :c:data:`errno` :py:const:`~errno." -"EAGAIN`, :py:const:`~errno.EALREADY`, :py:const:`~errno.EWOULDBLOCK` and :py:" -"const:`~errno.EINPROGRESS`." +"blocking operation. Corresponds to :c:data:`errno` ``EAGAIN``, ``EALREADY``, " +"``EWOULDBLOCK`` and ``EINPROGRESS``." msgstr "" "ある操作が、ノンブロッキング操作に設定されたオブジェクト (例えばソケット) を" -"ブロックしそうになった場合に送出されます。:c:data:`errno` :py:const:`~errno." -"EAGAIN`, :py:const:`~errno.EALREADY`, :py:const:`~errno.EWOULDBLOCK` および :" -"py:const:`~errno.EINPROGRESS` に対応します。" +"ブロックしそうになった場合に送出されます。:c:data:`errno` ``EAGAIN``, " +"``EALREADY``, ``EWOULDBLOCK`` および ``EINPROGRESS`` に対応します。" -#: ../../library/exceptions.rst:725 +#: ../../library/exceptions.rst:588 msgid "" "In addition to those of :exc:`OSError`, :exc:`BlockingIOError` can have one " "more attribute:" @@ -1095,7 +937,7 @@ msgstr "" ":exc:`BlockingIOError` は、 :exc:`OSError` の属性に加えて一つの属性を持ちま" "す:" -#: ../../library/exceptions.rst:730 +#: ../../library/exceptions.rst:593 msgid "" "An integer containing the number of characters written to the stream before " "it blocked. This attribute is available when using the buffered I/O classes " @@ -1104,19 +946,19 @@ msgstr "" "ストリームがブロックされるまでに書き込まれた文字数を含む整数です。この属性" "は :mod:`io` からのバッファ I/O クラスを使っているときに利用できます。" -#: ../../library/exceptions.rst:736 +#: ../../library/exceptions.rst:599 msgid "" "Raised when an operation on a child process failed. Corresponds to :c:data:" -"`errno` :py:const:`~errno.ECHILD`." +"`errno` ``ECHILD``." msgstr "" -"子プロセスの操作が失敗した場合に送出されます。:c:data:`errno` :py:const:" -"`~errno.ECHILD` に対応します。" +"子プロセスの操作が失敗した場合に送出されます。:c:data:`errno` ``ECHILD`` に対" +"応します。" -#: ../../library/exceptions.rst:741 +#: ../../library/exceptions.rst:604 msgid "A base class for connection-related issues." msgstr "コネクション関係の問題の基底クラス。" -#: ../../library/exceptions.rst:743 +#: ../../library/exceptions.rst:606 msgid "" "Subclasses are :exc:`BrokenPipeError`, :exc:`ConnectionAbortedError`, :exc:" "`ConnectionRefusedError` and :exc:`ConnectionResetError`." @@ -1124,71 +966,67 @@ msgstr "" "サブクラスは :exc:`BrokenPipeError`, :exc:`ConnectionAbortedError`, :exc:" "`ConnectionRefusedError`, :exc:`ConnectionResetError` です。" -#: ../../library/exceptions.rst:748 +#: ../../library/exceptions.rst:611 msgid "" "A subclass of :exc:`ConnectionError`, raised when trying to write on a pipe " "while the other end has been closed, or trying to write on a socket which " -"has been shutdown for writing. Corresponds to :c:data:`errno` :py:const:" -"`~errno.EPIPE` and :py:const:`~errno.ESHUTDOWN`." +"has been shutdown for writing. Corresponds to :c:data:`errno` ``EPIPE`` and " +"``ESHUTDOWN``." msgstr "" ":exc:`ConnectionError` のサブクラスで、もう一方の端が閉じられたパイプに書き込" "こもうとするか、書き込みのためにシャットダウンされたソケットに書き込こもうと" -"した場合に発生します。 :c:data:`errno` :py:const:`~errno.EPIPE` と :py:" -"const:`~errno.ESHUTDOWN` に対応します。" +"した場合に発生します。 :c:data:`errno` ``EPIPE`` と ``ESHUTDOWN`` に対応しま" +"す。" -#: ../../library/exceptions.rst:755 +#: ../../library/exceptions.rst:618 msgid "" "A subclass of :exc:`ConnectionError`, raised when a connection attempt is " -"aborted by the peer. Corresponds to :c:data:`errno` :py:const:`~errno." -"ECONNABORTED`." +"aborted by the peer. Corresponds to :c:data:`errno` ``ECONNABORTED``." msgstr "" ":exc:`ConnectionError` のサブクラスで、接続の試行が通信相手によって中断された" -"場合に発生します。 :c:data:`errno` :py:const:`~errno.ECONNABORTED` に対応しま" -"す。" +"場合に発生します。 :c:data:`errno` ``ECONNABORTED`` に対応します。" -#: ../../library/exceptions.rst:761 +#: ../../library/exceptions.rst:624 msgid "" "A subclass of :exc:`ConnectionError`, raised when a connection attempt is " -"refused by the peer. Corresponds to :c:data:`errno` :py:const:`~errno." -"ECONNREFUSED`." +"refused by the peer. Corresponds to :c:data:`errno` ``ECONNREFUSED``." msgstr "" ":exc:`ConnectionError` のサブクラスで、接続の試行が通信相手によって拒否された" -"場合に発生します。 :c:data:`errno` :py:const:`~errno.ECONNREFUSED` に対応しま" -"す。" +"場合に発生します。 :c:data:`errno` ``ECONNREFUSED`` に対応します。" -#: ../../library/exceptions.rst:767 +#: ../../library/exceptions.rst:630 msgid "" "A subclass of :exc:`ConnectionError`, raised when a connection is reset by " -"the peer. Corresponds to :c:data:`errno` :py:const:`~errno.ECONNRESET`." +"the peer. Corresponds to :c:data:`errno` ``ECONNRESET``." msgstr "" ":exc:`ConnectionError` のサブクラスで、接続が通信相手によってリセットされた場" -"合に発生します。 :c:data:`errno` :py:const:`~errno.ECONNRESET` に対応します。" +"合に発生します。 :c:data:`errno` ``ECONNRESET`` に対応します。" -#: ../../library/exceptions.rst:773 +#: ../../library/exceptions.rst:636 msgid "" "Raised when trying to create a file or directory which already exists. " -"Corresponds to :c:data:`errno` :py:const:`~errno.EEXIST`." +"Corresponds to :c:data:`errno` ``EEXIST``." msgstr "" "すでに存在するファイルやディレクトリを作成しようとした場合に送出されます。:c:" -"data:`errno` :py:const:`~errno.EEXIST` に対応します。" +"data:`errno` ``EEXIST`` に対応します。" -#: ../../library/exceptions.rst:778 +#: ../../library/exceptions.rst:641 msgid "" "Raised when a file or directory is requested but doesn't exist. Corresponds " -"to :c:data:`errno` :py:const:`~errno.ENOENT`." +"to :c:data:`errno` ``ENOENT``." msgstr "" "要求されたファイルやディレクトリが存在しない場合に送出されます。:c:data:" -"`errno` :py:const:`~errno.ENOENT` に対応します。" +"`errno` ``ENOENT`` に対応します。" -#: ../../library/exceptions.rst:783 +#: ../../library/exceptions.rst:646 msgid "" "Raised when a system call is interrupted by an incoming signal. Corresponds " -"to :c:data:`errno` :py:const:`~errno.EINTR`." +"to :c:data:`errno` :py:data:`~errno.EINTR`." msgstr "" "システムコールが入力信号によって中断された場合に送出されます。:c:data:" -"`errno` :py:const:`~errno.EINTR` に対応します。" +"`errno` :py:data:`~errno.EINTR` に対応します。" -#: ../../library/exceptions.rst:786 +#: ../../library/exceptions.rst:649 msgid "" "Python now retries system calls when a syscall is interrupted by a signal, " "except if the signal handler raises an exception (see :pep:`475` for the " @@ -1198,75 +1036,60 @@ msgstr "" "Python は :exc:`InterruptedError` を送出する代わりにシステムコールを再試行す" "るようになりました (論拠については :pep:`475` を参照してください) 。" -#: ../../library/exceptions.rst:793 +#: ../../library/exceptions.rst:656 msgid "" "Raised when a file operation (such as :func:`os.remove`) is requested on a " -"directory. Corresponds to :c:data:`errno` :py:const:`~errno.EISDIR`." +"directory. Corresponds to :c:data:`errno` ``EISDIR``." msgstr "" "ディレクトリに (:func:`os.remove` などの) ファイル操作が要求された場合に送出" -"されます。:c:data:`errno` :py:const:`~errno.EISDIR` に対応します。" +"されます。:c:data:`errno` ``EISDIR`` に対応します。" -#: ../../library/exceptions.rst:799 +#: ../../library/exceptions.rst:662 msgid "" "Raised when a directory operation (such as :func:`os.listdir`) is requested " "on something which is not a directory. On most POSIX platforms, it may also " "be raised if an operation attempts to open or traverse a non-directory file " -"as if it were a directory. Corresponds to :c:data:`errno` :py:const:`~errno." -"ENOTDIR`." +"as if it were a directory. Corresponds to :c:data:`errno` ``ENOTDIR``." msgstr "" -"ディレクトリへの操作(たとえば :func:`os.listdir`)をディレクトリ以外に対して要" -"求された場合に送出されます。多くのPOSIXプラットフォームではディレクトリではな" -"いファイルをディレクトリとして開いたり移動するときにも発生する場合がありま" -"す。:c:data:`errno` :py:const:`~errno.ENOTDIR` に対応します。" -#: ../../library/exceptions.rst:807 +#: ../../library/exceptions.rst:670 msgid "" "Raised when trying to run an operation without the adequate access rights - " -"for example filesystem permissions. Corresponds to :c:data:`errno` :py:const:" -"`~errno.EACCES`, :py:const:`~errno.EPERM`, and :py:const:`~errno." -"ENOTCAPABLE`." +"for example filesystem permissions. Corresponds to :c:data:`errno` " +"``EACCES`` and ``EPERM``." msgstr "" "十分なアクセス権、例えばファイルシステム権限のない操作が試みられた場合に送出" -"されます。:c:data:`errno` :py:const:`~errno.EACCES`、:py:const:`~errno." -"EPERM` および :py:const:`~errno.ENOTCAPABLE` に対応します。" - -#: ../../library/exceptions.rst:812 -msgid "" -"WASI's :py:const:`~errno.ENOTCAPABLE` is now mapped to :exc:" -"`PermissionError`." -msgstr "" -"WASIの :py:const:`~errno.ENOTCAPABLE` は :exc:`PermissionError` にマップされ" -"ました。" +"されます。:c:data:`errno` ``EACCES`` および ``EPERM`` に対応します。" -#: ../../library/exceptions.rst:818 +#: ../../library/exceptions.rst:676 msgid "" -"Raised when a given process doesn't exist. Corresponds to :c:data:`errno` :" -"py:const:`~errno.ESRCH`." +"Raised when a given process doesn't exist. Corresponds to :c:data:`errno` " +"``ESRCH``." msgstr "" -"与えられたプロセスが存在しない場合に送出されます。:c:data:`errno` :py:const:" -"`~errno.ESRCH` に対応します。" +"与えられたプロセスが存在しない場合に送出されます。:c:data:`errno` ``ESRCH`` " +"に対応します。" -#: ../../library/exceptions.rst:823 +#: ../../library/exceptions.rst:681 msgid "" "Raised when a system function timed out at the system level. Corresponds to :" -"c:data:`errno` :py:const:`~errno.ETIMEDOUT`." +"c:data:`errno` ``ETIMEDOUT``." msgstr "" "システム関数がシステムレベルでタイムアウトした場合に送出されます。:c:data:" -"`errno` :py:const:`~errno.ETIMEDOUT` に対応します。" +"`errno` ``ETIMEDOUT`` に対応します。" -#: ../../library/exceptions.rst:826 +#: ../../library/exceptions.rst:684 msgid "All the above :exc:`OSError` subclasses were added." msgstr "上記のすべての :exc:`OSError` サブクラスが追加されました。" -#: ../../library/exceptions.rst:832 +#: ../../library/exceptions.rst:690 msgid ":pep:`3151` - Reworking the OS and IO exception hierarchy" msgstr ":pep:`3151` - OS および IO 例外階層の手直し" -#: ../../library/exceptions.rst:838 +#: ../../library/exceptions.rst:696 msgid "Warnings" msgstr "警告" -#: ../../library/exceptions.rst:840 +#: ../../library/exceptions.rst:698 msgid "" "The following exceptions are used as warning categories; see the :ref:" "`warning-categories` documentation for more details." @@ -1274,15 +1097,15 @@ msgstr "" "次の例外は警告カテゴリとして使われます。詳細については :ref:`warning-" "categories` のドキュメントを参照してください。" -#: ../../library/exceptions.rst:845 +#: ../../library/exceptions.rst:703 msgid "Base class for warning categories." msgstr "警告カテゴリの基底クラスです。" -#: ../../library/exceptions.rst:850 +#: ../../library/exceptions.rst:708 msgid "Base class for warnings generated by user code." msgstr "ユーザコードによって生成される警告の基底クラスです。" -#: ../../library/exceptions.rst:855 +#: ../../library/exceptions.rst:713 msgid "" "Base class for warnings about deprecated features when those warnings are " "intended for other Python developers." @@ -1290,7 +1113,7 @@ msgstr "" "他の Python 開発者へ向けて警告を発するときの、廃止予定の機能についての警告の" "基底クラスです。" -#: ../../library/exceptions.rst:858 +#: ../../library/exceptions.rst:716 msgid "" "Ignored by the default warning filters, except in the ``__main__`` module (:" "pep:`565`). Enabling the :ref:`Python Development Mode ` shows this " @@ -1300,11 +1123,7 @@ msgstr "" "化されています。:ref:`Python Development Mode ` を有効にするとこの警" "告が表示されます。" -#: ../../library/exceptions.rst:862 ../../library/exceptions.rst:878 -msgid "The deprecation policy is described in :pep:`387`." -msgstr "" - -#: ../../library/exceptions.rst:867 +#: ../../library/exceptions.rst:723 msgid "" "Base class for warnings about features which are obsolete and expected to be " "deprecated in the future, but are not deprecated at the moment." @@ -1312,7 +1131,7 @@ msgstr "" "古くなって将来的に廃止される予定だが、今のところは廃止されていない機能につい" "ての警告の基底クラスです。" -#: ../../library/exceptions.rst:871 +#: ../../library/exceptions.rst:727 msgid "" "This class is rarely used as emitting a warning about a possible upcoming " "deprecation is unusual, and :exc:`DeprecationWarning` is preferred for " @@ -1322,8 +1141,8 @@ msgstr "" "スはめったに使われず、既に決まっている廃止については :exc:" "`DeprecationWarning` が望ましいです。" -#: ../../library/exceptions.rst:875 ../../library/exceptions.rst:901 -#: ../../library/exceptions.rst:928 +#: ../../library/exceptions.rst:731 ../../library/exceptions.rst:755 +#: ../../library/exceptions.rst:773 msgid "" "Ignored by the default warning filters. Enabling the :ref:`Python " "Development Mode ` shows this warning." @@ -1331,15 +1150,15 @@ msgstr "" "デフォルトの警告フィルターで無効化されています。:ref:`Python Development " "Mode ` を有効にするとこの警告が表示されます。" -#: ../../library/exceptions.rst:883 +#: ../../library/exceptions.rst:737 msgid "Base class for warnings about dubious syntax." msgstr "曖昧な構文に対する警告の基底クラスです。" -#: ../../library/exceptions.rst:888 +#: ../../library/exceptions.rst:742 msgid "Base class for warnings about dubious runtime behavior." msgstr "あいまいなランタイム挙動に対する警告の基底クラスです。" -#: ../../library/exceptions.rst:893 +#: ../../library/exceptions.rst:747 msgid "" "Base class for warnings about deprecated features when those warnings are " "intended for end users of applications that are written in Python." @@ -1347,350 +1166,27 @@ msgstr "" "Python で書かれたアプリケーションのエンドユーザーへ向けて警告を発するときの、" "廃止予定の機能についての警告の基底クラスです。" -#: ../../library/exceptions.rst:899 +#: ../../library/exceptions.rst:753 msgid "Base class for warnings about probable mistakes in module imports." msgstr "モジュールインポートの誤りと思われるものに対する警告の基底クラスです。" -#: ../../library/exceptions.rst:907 +#: ../../library/exceptions.rst:761 msgid "Base class for warnings related to Unicode." msgstr "Unicode に関連した警告の基底クラスです。" -#: ../../library/exceptions.rst:912 -msgid "Base class for warnings related to encodings." -msgstr "エンコーディングに関連した警告の基底クラスです。" - -#: ../../library/exceptions.rst:914 -msgid "See :ref:`io-encoding-warning` for details." -msgstr "詳細は :ref:`io-encoding-warning` を参照してください。" - -#: ../../library/exceptions.rst:921 +#: ../../library/exceptions.rst:766 msgid "" "Base class for warnings related to :class:`bytes` and :class:`bytearray`." msgstr ":class:`bytes` や :class:`bytearray` に関連した警告の基底クラスです。" -#: ../../library/exceptions.rst:926 +#: ../../library/exceptions.rst:771 msgid "Base class for warnings related to resource usage." msgstr "リソースの使用に関連した警告の基底クラスです。" -#: ../../library/exceptions.rst:937 -msgid "Exception groups" -msgstr "例外グループ" - -#: ../../library/exceptions.rst:939 -msgid "" -"The following are used when it is necessary to raise multiple unrelated " -"exceptions. They are part of the exception hierarchy so they can be handled " -"with :keyword:`except` like all other exceptions. In addition, they are " -"recognised by :keyword:`except*`, which matches their subgroups " -"based on the types of the contained exceptions." -msgstr "" -"以下は関係がない複数の例外を送出する必要があるときに使用します。例外グループ" -"は例外の階層構造の一部のため、他の例外と同様 :keyword:`except` で処理できま" -"す。また、:keyword:`except*` によって判別でき、例外グループに含" -"まれている例外の型に基づいてサブグループにマッチします。" - -#: ../../library/exceptions.rst:948 -msgid "" -"Both of these exception types wrap the exceptions in the sequence ``excs``. " -"The ``msg`` parameter must be a string. The difference between the two " -"classes is that :exc:`BaseExceptionGroup` extends :exc:`BaseException` and " -"it can wrap any exception, while :exc:`ExceptionGroup` extends :exc:" -"`Exception` and it can only wrap subclasses of :exc:`Exception`. This design " -"is so that ``except Exception`` catches an :exc:`ExceptionGroup` but not :" -"exc:`BaseExceptionGroup`." -msgstr "" -"この2つの例外型は一連の例外 ``excs`` を包含します。``msg`` 引数は文字列の必要" -"があります。2つのクラスの異なる点は、:exc:`BaseException` は :exc:" -"`BaseExceptionGroup` を拡張して任意の例外を含められますが、:exc:" -"`ExceptionGroup` は :exc:`Exception` を拡張して :exc:`Exception` のサブクラス" -"のみを含められます。この設計により ``except Exception`` は :exc:" -"`ExceptionGroup` をキャッチしますが、:exc:`BaseExceptionGroup` はキャッチしま" -"せん。" - -#: ../../library/exceptions.rst:956 -msgid "" -"The :exc:`BaseExceptionGroup` constructor returns an :exc:`ExceptionGroup` " -"rather than a :exc:`BaseExceptionGroup` if all contained exceptions are :exc:" -"`Exception` instances, so it can be used to make the selection automatic. " -"The :exc:`ExceptionGroup` constructor, on the other hand, raises a :exc:" -"`TypeError` if any contained exception is not an :exc:`Exception` subclass." -msgstr "" -":exc:`BaseExceptionGroup` のコンストラクターは含まれる例外がすべて :exc:" -"`Exception` の場合は :exc:`BaseExceptionGroup` ではなく :exc:" -"`ExceptionGroup` を返すように自動的に選択されます。一方 :exc:" -"`ExceptionGroup` コンストラクタは、:exc:`Exception` サブクラス以外の例外を含" -"む場合は :exc:`TypeError` を送出します。" - -#: ../../library/exceptions.rst:965 -msgid "The ``msg`` argument to the constructor. This is a read-only attribute." -msgstr "コンストラクタの ``msg`` 引数。この属性は読み込み専用です。" - -#: ../../library/exceptions.rst:969 -msgid "" -"A tuple of the exceptions in the ``excs`` sequence given to the constructor. " -"This is a read-only attribute." -msgstr "" -"コンストラクタに渡された一連の ``excs`` に含まれる例外のタプルです。この属性" -"は読み込み専用です。" - -#: ../../library/exceptions.rst:974 -msgid "" -"Returns an exception group that contains only the exceptions from the " -"current group that match *condition*, or ``None`` if the result is empty." -msgstr "" -"現在のグループで *条件* にマッチする礼儀のみを含む例外グループを返します。結" -"果が空の場合は ``None`` を返します。" - -#: ../../library/exceptions.rst:977 -msgid "" -"The condition can be an exception type or tuple of exception types, in which " -"case each exception is checked for a match using the same check that is used " -"in an ``except`` clause. The condition can also be a callable (other than a " -"type object) that accepts an exception as its single argument and returns " -"true for the exceptions that should be in the subgroup." -msgstr "" - -#: ../../library/exceptions.rst:983 -msgid "" -"The nesting structure of the current exception is preserved in the result, " -"as are the values of its :attr:`message`, :attr:`~BaseException." -"__traceback__`, :attr:`~BaseException.__cause__`, :attr:`~BaseException." -"__context__` and :attr:`~BaseException.__notes__` fields. Empty nested " -"groups are omitted from the result." -msgstr "" - -#: ../../library/exceptions.rst:990 -msgid "" -"The condition is checked for all exceptions in the nested exception group, " -"including the top-level and any nested exception groups. If the condition is " -"true for such an exception group, it is included in the result in full." -msgstr "" - -#: ../../library/exceptions.rst:994 -msgid "``condition`` can be any callable which is not a type object." -msgstr "" - -#: ../../library/exceptions.rst:999 -msgid "" -"Like :meth:`subgroup`, but returns the pair ``(match, rest)`` where " -"``match`` is ``subgroup(condition)`` and ``rest`` is the remaining non-" -"matching part." -msgstr "" -":meth:`subgroup` と似てますが ``(match, rest)`` のペアを返します。``match`` " -"は ``subgroup(condition)`` で ``rest`` は残りのマッチしない部分です。" - -#: ../../library/exceptions.rst:1005 -msgid "" -"Returns an exception group with the same :attr:`message`, but which wraps " -"the exceptions in ``excs``." -msgstr "" -"同じ :attr:`message` の例外グループを返しますが、``excs`` の例外を含んでいま" -"す。" - -#: ../../library/exceptions.rst:1008 -msgid "" -"This method is used by :meth:`subgroup` and :meth:`split`, which are used in " -"various contexts to break up an exception group. A subclass needs to " -"override it in order to make :meth:`subgroup` and :meth:`split` return " -"instances of the subclass rather than :exc:`ExceptionGroup`." -msgstr "" - -#: ../../library/exceptions.rst:1014 -msgid "" -":meth:`subgroup` and :meth:`split` copy the :attr:`~BaseException." -"__traceback__`, :attr:`~BaseException.__cause__`, :attr:`~BaseException." -"__context__` and :attr:`~BaseException.__notes__` fields from the original " -"exception group to the one returned by :meth:`derive`, so these fields do " -"not need to be updated by :meth:`derive`." -msgstr "" -":meth:`subgroup` と :meth:`split` は :attr:`~BaseException.__traceback__`、:" -"attr:`~BaseException.__cause__`、:attr:`~BaseException.__context__` と :attr:" -"`~BaseException.__notes__` フィールドを元の例外グループから :meth:`derive` が" -"返す例外グループにコピーするため、:meth:`derive` ではこれらのフィールドを更新" -"する必要がありません。" - -#: ../../library/exceptions.rst:1021 -msgid "" -">>> class MyGroup(ExceptionGroup):\n" -"... def derive(self, excs):\n" -"... return MyGroup(self.message, excs)\n" -"...\n" -">>> e = MyGroup(\"eg\", [ValueError(1), TypeError(2)])\n" -">>> e.add_note(\"a note\")\n" -">>> e.__context__ = Exception(\"context\")\n" -">>> e.__cause__ = Exception(\"cause\")\n" -">>> try:\n" -"... raise e\n" -"... except Exception as e:\n" -"... exc = e\n" -"...\n" -">>> match, rest = exc.split(ValueError)\n" -">>> exc, exc.__context__, exc.__cause__, exc.__notes__\n" -"(MyGroup('eg', [ValueError(1), TypeError(2)]), Exception('context'), " -"Exception('cause'), ['a note'])\n" -">>> match, match.__context__, match.__cause__, match.__notes__\n" -"(MyGroup('eg', [ValueError(1)]), Exception('context'), Exception('cause'), " -"['a note'])\n" -">>> rest, rest.__context__, rest.__cause__, rest.__notes__\n" -"(MyGroup('eg', [TypeError(2)]), Exception('context'), Exception('cause'), " -"['a note'])\n" -">>> exc.__traceback__ is match.__traceback__ is rest.__traceback__\n" -"True" -msgstr "" - -#: ../../library/exceptions.rst:1047 -msgid "" -"Note that :exc:`BaseExceptionGroup` defines :meth:`~object.__new__`, so " -"subclasses that need a different constructor signature need to override that " -"rather than :meth:`~object.__init__`. For example, the following defines an " -"exception group subclass which accepts an exit_code and and constructs the " -"group's message from it. ::" -msgstr "" - -#: ../../library/exceptions.rst:1053 -msgid "" -"class Errors(ExceptionGroup):\n" -" def __new__(cls, errors, exit_code):\n" -" self = super().__new__(Errors, f\"exit code: {exit_code}\", errors)\n" -" self.exit_code = exit_code\n" -" return self\n" -"\n" -" def derive(self, excs):\n" -" return Errors(excs, self.exit_code)" -msgstr "" - -#: ../../library/exceptions.rst:1062 -msgid "" -"Like :exc:`ExceptionGroup`, any subclass of :exc:`BaseExceptionGroup` which " -"is also a subclass of :exc:`Exception` can only wrap instances of :exc:" -"`Exception`." -msgstr "" - -#: ../../library/exceptions.rst:1070 +#: ../../library/exceptions.rst:781 msgid "Exception hierarchy" msgstr "例外のクラス階層" -#: ../../library/exceptions.rst:1072 +#: ../../library/exceptions.rst:783 msgid "The class hierarchy for built-in exceptions is:" msgstr "組み込み例外のクラス階層は以下のとおりです:" - -#: ../../library/exceptions.rst:1074 -msgid "" -"BaseException\n" -" ├── BaseExceptionGroup\n" -" ├── GeneratorExit\n" -" ├── KeyboardInterrupt\n" -" ├── SystemExit\n" -" └── Exception\n" -" ├── ArithmeticError\n" -" │ ├── FloatingPointError\n" -" │ ├── OverflowError\n" -" │ └── ZeroDivisionError\n" -" ├── AssertionError\n" -" ├── AttributeError\n" -" ├── BufferError\n" -" ├── EOFError\n" -" ├── ExceptionGroup [BaseExceptionGroup]\n" -" ├── ImportError\n" -" │ └── ModuleNotFoundError\n" -" ├── LookupError\n" -" │ ├── IndexError\n" -" │ └── KeyError\n" -" ├── MemoryError\n" -" ├── NameError\n" -" │ └── UnboundLocalError\n" -" ├── OSError\n" -" │ ├── BlockingIOError\n" -" │ ├── ChildProcessError\n" -" │ ├── ConnectionError\n" -" │ │ ├── BrokenPipeError\n" -" │ │ ├── ConnectionAbortedError\n" -" │ │ ├── ConnectionRefusedError\n" -" │ │ └── ConnectionResetError\n" -" │ ├── FileExistsError\n" -" │ ├── FileNotFoundError\n" -" │ ├── InterruptedError\n" -" │ ├── IsADirectoryError\n" -" │ ├── NotADirectoryError\n" -" │ ├── PermissionError\n" -" │ ├── ProcessLookupError\n" -" │ └── TimeoutError\n" -" ├── ReferenceError\n" -" ├── RuntimeError\n" -" │ ├── NotImplementedError\n" -" │ ├── PythonFinalizationError\n" -" │ └── RecursionError\n" -" ├── StopAsyncIteration\n" -" ├── StopIteration\n" -" ├── SyntaxError\n" -" │ └── IndentationError\n" -" │ └── TabError\n" -" ├── SystemError\n" -" ├── TypeError\n" -" ├── ValueError\n" -" │ └── UnicodeError\n" -" │ ├── UnicodeDecodeError\n" -" │ ├── UnicodeEncodeError\n" -" │ └── UnicodeTranslateError\n" -" └── Warning\n" -" ├── BytesWarning\n" -" ├── DeprecationWarning\n" -" ├── EncodingWarning\n" -" ├── FutureWarning\n" -" ├── ImportWarning\n" -" ├── PendingDeprecationWarning\n" -" ├── ResourceWarning\n" -" ├── RuntimeWarning\n" -" ├── SyntaxWarning\n" -" ├── UnicodeWarning\n" -" └── UserWarning\n" -msgstr "" - -#: ../../library/exceptions.rst:6 ../../library/exceptions.rst:17 -#: ../../library/exceptions.rst:196 -msgid "statement" -msgstr "statement" - -#: ../../library/exceptions.rst:6 -msgid "try" -msgstr "try" - -#: ../../library/exceptions.rst:6 -msgid "except" -msgstr "except" - -#: ../../library/exceptions.rst:17 -msgid "raise" -msgstr "raise" - -#: ../../library/exceptions.rst:41 -msgid "exception" -msgstr "例外" - -#: ../../library/exceptions.rst:41 -msgid "chaining" -msgstr "連鎖" - -#: ../../library/exceptions.rst:41 -msgid "__cause__ (exception attribute)" -msgstr "__cause__ (exception の属性)" - -#: ../../library/exceptions.rst:41 -msgid "__context__ (exception attribute)" -msgstr "__context__ (exception の属性)" - -#: ../../library/exceptions.rst:41 -msgid "__suppress_context__ (exception attribute)" -msgstr "__suppress_context__ (exception の属性)" - -#: ../../library/exceptions.rst:196 -msgid "assert" -msgstr "assert" - -#: ../../library/exceptions.rst:347 -msgid "module" -msgstr "module" - -#: ../../library/exceptions.rst:347 -msgid "errno" -msgstr "errno" diff --git a/library/faulthandler.po b/library/faulthandler.po index 161196d2c..f6c98515d 100644 --- a/library/faulthandler.po +++ b/library/faulthandler.po @@ -1,67 +1,67 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 -# Arihiro TAKASE, 2023 -# Takanori Suzuki , 2024 -# 石井明久, 2024 +# 秘湯 , 2017 +# Nozomu Kaneko , 2017 +# ryosuke.mondo , 2017 +# Arihiro TAKASE, 2017 +# E. Kawashima, 2017 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 01:05+0000\n" -"Last-Translator: 石井明久, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 23:10+0000\n" +"Last-Translator: E. Kawashima, 2017\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/faulthandler.rst:2 -msgid ":mod:`!faulthandler` --- Dump the Python traceback" -msgstr ":mod:`!faulthandler` --- Python トレースバックをダンプする" +msgid ":mod:`faulthandler` --- Dump the Python traceback" +msgstr ":mod:`faulthandler` --- Python tracebackのダンプ" #: ../../library/faulthandler.rst:11 msgid "" "This module contains functions to dump Python tracebacks explicitly, on a " "fault, after a timeout, or on a user signal. Call :func:`faulthandler." -"enable` to install fault handlers for the :const:`~signal.SIGSEGV`, :const:" -"`~signal.SIGFPE`, :const:`~signal.SIGABRT`, :const:`~signal.SIGBUS`, and :" -"const:`~signal.SIGILL` signals. You can also enable them at startup by " -"setting the :envvar:`PYTHONFAULTHANDLER` environment variable or by using " -"the :option:`-X` ``faulthandler`` command line option." +"enable` to install fault handlers for the :const:`SIGSEGV`, :const:" +"`SIGFPE`, :const:`SIGABRT`, :const:`SIGBUS`, and :const:`SIGILL` signals. " +"You can also enable them at startup by setting the :envvar:" +"`PYTHONFAULTHANDLER` environment variable or by using the :option:`-X` " +"``faulthandler`` command line option." msgstr "" "このモジュールは、例外発生時、タイムアウト時、ユーザシグナルの発生時などのタ" "イミングでpython tracebackを明示的にダンプするための関数を含んでいます。これ" -"らのシグナル、:const:`~signal.SIGSEGV`、:const:`~signal.SIGFPE`、:const:" -"`~signal.SIGABRT`、:const:`~signal.SIGBUS`、:const:`~signal.SIGILL` に対する" -"フォールトハンドラをインストールするには :func:`faulthandler.enable` を実行し" -"てください。python起動時に有効にするには環境変数 :envvar:" -"`PYTHONFAULTHANDLER` を設定するか、コマンドライン引数に :option:`-X` " -"``faulthandler`` を指定してください。" - -#: ../../library/faulthandler.rst:19 +"らのシグナル、:const:`SIGSEGV`、:const:`SIGFPE`、:const:`SIGABRT`、:const:" +"`SIGBUS`、:const:`SIGILL` に対するフォールトハンドラをインストールするには :" +"func:`faulthandler.enable` を実行してください。python起動時に有効にするには環" +"境変数 :envvar:`PYTHONFAULTHANDLER` を設定するか、コマンドライン引数に :" +"option:`-X` ``faulthandler`` を指定してください。" + +#: ../../library/faulthandler.rst:18 msgid "" "The fault handler is compatible with system fault handlers like Apport or " "the Windows fault handler. The module uses an alternative stack for signal " -"handlers if the :c:func:`!sigaltstack` function is available. This allows it " +"handlers if the :c:func:`sigaltstack` function is available. This allows it " "to dump the traceback even on a stack overflow." msgstr "" "Pythonのフォールトハンドラは、apportやWindowsのフォールトハンドラのようなシス" -"テムフォールトハンドラと互換性があります。このモジュールは :c:func:`!" -"sigaltstack` 関数が使用可能であればシグナルハンドラ用に代替スタックを利用しま" -"す。これによってスタックオーバーフロー時にもトレースバックを出力することがで" -"きます。" +"テムフォールトハンドラと互換性があります。このモジュールは :c:func:" +"`sigaltstack` 関数が使用可能であればシグナルハンドラ用に代替スタックを利用し" +"ます。これによってスタックオーバーフロー時にもスタックトレースを出力すること" +"ができます。" -#: ../../library/faulthandler.rst:24 +#: ../../library/faulthandler.rst:23 msgid "" "The fault handler is called on catastrophic cases and therefore can only use " "signal-safe functions (e.g. it cannot allocate memory on the heap). Because " @@ -73,7 +73,7 @@ msgstr "" "の制限により、tracebackのダンプ機能は通常のPythonのtracebackと比べてごく僅か" "なものです:" -#: ../../library/faulthandler.rst:29 +#: ../../library/faulthandler.rst:28 msgid "" "Only ASCII is supported. The ``backslashreplace`` error handler is used on " "encoding." @@ -81,26 +81,26 @@ msgstr "" "ASCIIのみサポートされます。エンコード時には ``backslashreplace`` エラーハンド" "ラを使用します。" -#: ../../library/faulthandler.rst:31 +#: ../../library/faulthandler.rst:30 msgid "Each string is limited to 500 characters." msgstr "すべての文字列は500文字以内に制限されています。" -#: ../../library/faulthandler.rst:32 +#: ../../library/faulthandler.rst:31 msgid "" "Only the filename, the function name and the line number are displayed. (no " "source code)" msgstr "" "ファイル名、関数名、行数のみ表示します。(ソースコードの表示はありません)" -#: ../../library/faulthandler.rst:34 +#: ../../library/faulthandler.rst:33 msgid "It is limited to 100 frames and 100 threads." msgstr "100フレーム、100スレッドに制限されています。" -#: ../../library/faulthandler.rst:35 +#: ../../library/faulthandler.rst:34 msgid "The order is reversed: the most recent call is shown first." msgstr "順番は保持されます: 最新の呼び出しが最初に表示されます。" -#: ../../library/faulthandler.rst:37 +#: ../../library/faulthandler.rst:36 msgid "" "By default, the Python traceback is written to :data:`sys.stderr`. To see " "tracebacks, applications must be run in the terminal. A log file can " @@ -111,7 +111,7 @@ msgstr "" "せん。 :func:`faulthandler.enable` に渡す引数によってログファイルを指定するこ" "とができます。" -#: ../../library/faulthandler.rst:41 +#: ../../library/faulthandler.rst:40 msgid "" "The module is implemented in C, so tracebacks can be dumped on a crash or " "when Python is deadlocked." @@ -119,35 +119,17 @@ msgstr "" "モジュールはC言語で実装されているので、アプリのクラッシュ時でもPythonがデッド" "ロックした場合でもダンプができます。" -#: ../../library/faulthandler.rst:44 +#: ../../library/faulthandler.rst:43 msgid "" "The :ref:`Python Development Mode ` calls :func:`faulthandler." "enable` at Python startup." msgstr "" -#: ../../library/faulthandler.rst:49 -msgid "Module :mod:`pdb`" -msgstr "" - -#: ../../library/faulthandler.rst:50 -msgid "Interactive source code debugger for Python programs." -msgstr "" - -#: ../../library/faulthandler.rst:52 -msgid "Module :mod:`traceback`" -msgstr ":mod:`traceback` モジュール" - -#: ../../library/faulthandler.rst:53 -msgid "" -"Standard interface to extract, format and print stack traces of Python " -"programs." -msgstr "" - -#: ../../library/faulthandler.rst:56 +#: ../../library/faulthandler.rst:48 msgid "Dumping the traceback" msgstr "tracebackのダンプ" -#: ../../library/faulthandler.rst:60 +#: ../../library/faulthandler.rst:52 msgid "" "Dump the tracebacks of all threads into *file*. If *all_threads* is " "``False``, dump only the current thread." @@ -155,103 +137,39 @@ msgstr "" "全スレッドのtracebackを *file* へダンプします。もし *all_threads* が " "``False`` であれば、現在のスレッドのみダンプします。" -#: ../../library/faulthandler.rst:63 -msgid "" -":func:`traceback.print_tb`, which can be used to print a traceback object." -msgstr "" - -#: ../../library/faulthandler.rst:65 ../../library/faulthandler.rst:119 -#: ../../library/faulthandler.rst:165 ../../library/faulthandler.rst:190 +#: ../../library/faulthandler.rst:55 ../../library/faulthandler.rst:73 +#: ../../library/faulthandler.rst:111 ../../library/faulthandler.rst:133 msgid "Added support for passing file descriptor to this function." msgstr "" -#: ../../library/faulthandler.rst:70 -msgid "Dumping the C stack" -msgstr "" - -#: ../../library/faulthandler.rst:76 -msgid "Dump the C stack trace of the current thread into *file*." -msgstr "" - -#: ../../library/faulthandler.rst:78 -msgid "" -"If the Python build does not support it or the operating system does not " -"provide a stack trace, then this prints an error in place of a dumped C " -"stack." -msgstr "" - -#: ../../library/faulthandler.rst:85 -msgid "C Stack Compatibility" -msgstr "" - -#: ../../library/faulthandler.rst:87 -msgid "" -"If the system does not support the C-level :manpage:`backtrace(3)` or :" -"manpage:`dladdr1(3)`, then C stack dumps will not work. An error will be " -"printed instead of the stack." -msgstr "" - -#: ../../library/faulthandler.rst:91 -msgid "" -"Additionally, some compilers do not support :term:`CPython's ` " -"implementation of C stack dumps. As a result, a different error may be " -"printed instead of the stack, even if the the operating system supports " -"dumping stacks." -msgstr "" - -#: ../../library/faulthandler.rst:97 -msgid "" -"Dumping C stacks can be arbitrarily slow, depending on the DWARF level of " -"the binaries in the call stack." -msgstr "" - -#: ../../library/faulthandler.rst:101 +#: ../../library/faulthandler.rst:60 msgid "Fault handler state" msgstr "フォールトハンドラの状態" -#: ../../library/faulthandler.rst:105 +#: ../../library/faulthandler.rst:64 msgid "" -"Enable the fault handler: install handlers for the :const:`~signal." -"SIGSEGV`, :const:`~signal.SIGFPE`, :const:`~signal.SIGABRT`, :const:`~signal." -"SIGBUS` and :const:`~signal.SIGILL` signals to dump the Python traceback. If " -"*all_threads* is ``True``, produce tracebacks for every running thread. " -"Otherwise, dump only the current thread." +"Enable the fault handler: install handlers for the :const:`SIGSEGV`, :const:" +"`SIGFPE`, :const:`SIGABRT`, :const:`SIGBUS` and :const:`SIGILL` signals to " +"dump the Python traceback. If *all_threads* is ``True``, produce tracebacks " +"for every running thread. Otherwise, dump only the current thread." msgstr "" +"フォールトハンドラを有効にします。 :const:`SIGSEGV`、 :const:`SIGFPE`、 :" +"const:`SIGABRT`、 :const:`SIGBUS`、:const:`SIGILL` シグナルに対して Pythonの" +"tracebackをダンプするハンドラをインストールします。もし *all_threads* が " +"``True`` であれば、すべての実行中のスレッドについてtracebackをダンプします。" +"そうでなければ現在のスレッドのみダンプします。" -#: ../../library/faulthandler.rst:112 +#: ../../library/faulthandler.rst:70 msgid "" "The *file* must be kept open until the fault handler is disabled: see :ref:" "`issue with file descriptors `." msgstr "" -#: ../../library/faulthandler.rst:115 -msgid "" -"If *c_stack* is ``True``, then the C stack trace is printed after the Python " -"traceback, unless the system does not support it. See :func:`dump_c_stack` " -"for more information on compatibility." -msgstr "" - -#: ../../library/faulthandler.rst:122 +#: ../../library/faulthandler.rst:76 msgid "On Windows, a handler for Windows exception is also installed." msgstr "" -#: ../../library/faulthandler.rst:125 -msgid "" -"The dump now mentions if a garbage collector collection is running if " -"*all_threads* is true." -msgstr "" - -#: ../../library/faulthandler.rst:129 -msgid "" -"Only the current thread is dumped if the :term:`GIL` is disabled to prevent " -"the risk of data races." -msgstr "" - -#: ../../library/faulthandler.rst:133 -msgid "The dump now displays the C stack trace if *c_stack* is true." -msgstr "" - -#: ../../library/faulthandler.rst:138 +#: ../../library/faulthandler.rst:81 msgid "" "Disable the fault handler: uninstall the signal handlers installed by :func:" "`enable`." @@ -259,49 +177,56 @@ msgstr "" "フォールトハンドラを無効にします: :func:`enable` によってインストールされたシ" "グナルハンドラをアンインストールします。" -#: ../../library/faulthandler.rst:143 +#: ../../library/faulthandler.rst:86 msgid "Check if the fault handler is enabled." msgstr "フォールトハンドラが有効かどうかチェックします。" -#: ../../library/faulthandler.rst:147 +#: ../../library/faulthandler.rst:90 msgid "Dumping the tracebacks after a timeout" msgstr "タイムアウト後にtracebackをダンプする" -#: ../../library/faulthandler.rst:151 +#: ../../library/faulthandler.rst:94 msgid "" "Dump the tracebacks of all threads, after a timeout of *timeout* seconds, or " "every *timeout* seconds if *repeat* is ``True``. If *exit* is ``True``, " -"call :c:func:`!_exit` with status=1 after dumping the tracebacks. (Note :c:" -"func:`!_exit` exits the process immediately, which means it doesn't do any " +"call :c:func:`_exit` with status=1 after dumping the tracebacks. (Note :c:" +"func:`_exit` exits the process immediately, which means it doesn't do any " "cleanup like flushing file buffers.) If the function is called twice, the " "new call replaces previous parameters and resets the timeout. The timer has " "a sub-second resolution." msgstr "" +"*timeout* 秒経過後か、*repeat* が ``True`` の場合は *timeout* 秒おきに全ス" +"レッドの traceback をダンプします。もし *exit* が ``True`` であればtraceback" +"をダンプした後、status=1で :c:func:`_exit` を呼び出します。(注: :c:func:" +"`_exit` を呼び出すとプロセスを即座に終了します。つまりファイルバッファのクリ" +"アといった終了処理を行いません。)関数が2回呼ばれた場合、最新の呼び出しが前回" +"の呼び出しパラメータを引き継いでタイムアウト時間をリセットします。タイマーの" +"分解能は1秒未満です。" -#: ../../library/faulthandler.rst:159 +#: ../../library/faulthandler.rst:102 msgid "" "The *file* must be kept open until the traceback is dumped or :func:" "`cancel_dump_traceback_later` is called: see :ref:`issue with file " "descriptors `." msgstr "" -#: ../../library/faulthandler.rst:163 +#: ../../library/faulthandler.rst:106 msgid "This function is implemented using a watchdog thread." msgstr "" -#: ../../library/faulthandler.rst:168 +#: ../../library/faulthandler.rst:108 msgid "This function is now always available." msgstr "" -#: ../../library/faulthandler.rst:173 +#: ../../library/faulthandler.rst:116 msgid "Cancel the last call to :func:`dump_traceback_later`." msgstr ":func:`dump_traceback_later` の最新の呼び出しをキャンセルします。" -#: ../../library/faulthandler.rst:177 +#: ../../library/faulthandler.rst:120 msgid "Dumping the traceback on a user signal" msgstr "ユーザシグナルに対してtracebackをダンプする" -#: ../../library/faulthandler.rst:181 +#: ../../library/faulthandler.rst:124 msgid "" "Register a user signal: install a handler for the *signum* signal to dump " "the traceback of all threads, or of the current thread if *all_threads* is " @@ -312,17 +237,17 @@ msgstr "" "れば現在のスレッドのみ *file* にダンプします。もし chain が ``True`` であれば" "以前のハンドラも呼び出します。" -#: ../../library/faulthandler.rst:185 +#: ../../library/faulthandler.rst:128 msgid "" "The *file* must be kept open until the signal is unregistered by :func:" "`unregister`: see :ref:`issue with file descriptors `." msgstr "" -#: ../../library/faulthandler.rst:188 ../../library/faulthandler.rst:199 +#: ../../library/faulthandler.rst:131 ../../library/faulthandler.rst:142 msgid "Not available on Windows." msgstr "Windowsでは利用不可です。" -#: ../../library/faulthandler.rst:195 +#: ../../library/faulthandler.rst:138 msgid "" "Unregister a user signal: uninstall the handler of the *signum* signal " "installed by :func:`register`. Return ``True`` if the signal was registered, " @@ -332,11 +257,11 @@ msgstr "" "シグナルハンドラをアンインストールします。シグナルが登録された場合は " "``True`` を返し、そうでなければ ``False`` を返します。" -#: ../../library/faulthandler.rst:205 +#: ../../library/faulthandler.rst:148 msgid "Issue with file descriptors" msgstr "ファイル記述子の問題" -#: ../../library/faulthandler.rst:207 +#: ../../library/faulthandler.rst:150 msgid "" ":func:`enable`, :func:`dump_traceback_later` and :func:`register` keep the " "file descriptor of their *file* argument. If the file is closed and its file " @@ -350,31 +275,14 @@ msgstr "" "述子が置き換えた場合、 traceback の結果は別のファイルへ書き込まれます。ファイ" "ルが置き換えられた場合は、毎回これらの関数を呼び出しなおしてください。" -#: ../../library/faulthandler.rst:215 +#: ../../library/faulthandler.rst:158 msgid "Example" msgstr "使用例" -#: ../../library/faulthandler.rst:217 +#: ../../library/faulthandler.rst:160 msgid "" "Example of a segmentation fault on Linux with and without enabling the fault " "handler:" msgstr "" "フォールトハンドラを有効化・無効化したときの Linuxでのセグメンテーション" "フォールトの例:" - -#: ../../library/faulthandler.rst:220 -msgid "" -"$ python -c \"import ctypes; ctypes.string_at(0)\"\n" -"Segmentation fault\n" -"\n" -"$ python -q -X faulthandler\n" -">>> import ctypes\n" -">>> ctypes.string_at(0)\n" -"Fatal Python error: Segmentation fault\n" -"\n" -"Current thread 0x00007fb899f39700 (most recent call first):\n" -" File \"/home/python/cpython/Lib/ctypes/__init__.py\", line 486 in " -"string_at\n" -" File \"\", line 1 in \n" -"Segmentation fault" -msgstr "" diff --git a/library/fcntl.po b/library/fcntl.po index 6ea18fc82..200eaf721 100644 --- a/library/fcntl.po +++ b/library/fcntl.po @@ -1,47 +1,50 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2023 -# Yusuke Miyazaki , 2023 -# 石井明久, 2024 -# Arihiro TAKASE, 2024 +# E. Kawashima, 2017 +# Arihiro TAKASE, 2017 +# 秘湯 , 2017 +# tomo, 2017 +# Osamu NAKAMURA, 2021 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 01:06+0000\n" -"Last-Translator: Arihiro TAKASE, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 23:10+0000\n" +"Last-Translator: Osamu NAKAMURA, 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/fcntl.rst:2 -msgid ":mod:`!fcntl` --- The ``fcntl`` and ``ioctl`` system calls" -msgstr ":mod:`!fcntl` --- ``fcntl`` および ``ioctl`` システムコール" +msgid ":mod:`fcntl` --- The ``fcntl`` and ``ioctl`` system calls" +msgstr ":mod:`fcntl` --- ``fcntl`` および ``ioctl`` システムコール" #: ../../library/fcntl.rst:16 msgid "" -"This module performs file and I/O control on file descriptors. It is an " -"interface to the :c:func:`fcntl` and :c:func:`ioctl` Unix routines. See the :" -"manpage:`fcntl(2)` and :manpage:`ioctl(2)` Unix manual pages for full " -"details." +"This module performs file control and I/O control on file descriptors. It is " +"an interface to the :c:func:`fcntl` and :c:func:`ioctl` Unix routines. For " +"a complete description of these calls, see :manpage:`fcntl(2)` and :manpage:" +"`ioctl(2)` Unix manual pages." msgstr "" +"このモジュールでは、ファイル記述子 (file descriptor) に基づいたファイル制御お" +"よび I/O 制御を実現します。\n" +"このモジュールは、 Unix のルーチンである :c:func:`fcntl` および :c:func:" +"`ioctl` へのインターフェースです。\n" +"これらのシステムコールの完全な説明は、 :manpage:`fcntl(2)` と :manpage:" +"`ioctl(2)` のUnix マニュアルページを参照してください。" #: ../../library/fcntl.rst:21 -msgid "Availability" -msgstr "" - -#: ../../library/fcntl.rst:23 msgid "" "All functions in this module take a file descriptor *fd* as their first " "argument. This can be an integer file descriptor, such as returned by ``sys." @@ -55,7 +58,7 @@ msgstr "" "fileno` メソッドを提供している :class:`io.IOBase` オブジェクトでもかまいませ" "ん。" -#: ../../library/fcntl.rst:29 +#: ../../library/fcntl.rst:27 msgid "" "Operations in this module used to raise an :exc:`IOError` where they now " "raise an :exc:`OSError`." @@ -63,118 +66,63 @@ msgstr "" "以前は :exc:`IOError` を送出していたこのモジュールの操作が、 :exc:`OSError` " "を送出するようになりました。" -#: ../../library/fcntl.rst:33 +#: ../../library/fcntl.rst:31 msgid "" -"The :mod:`!fcntl` module now contains ``F_ADD_SEALS``, ``F_GET_SEALS``, and " +"The fcntl module now contains ``F_ADD_SEALS``, ``F_GET_SEALS``, and " "``F_SEAL_*`` constants for sealing of :func:`os.memfd_create` file " "descriptors." msgstr "" -#: ../../library/fcntl.rst:38 -msgid "" -"On macOS, the :mod:`!fcntl` module exposes the ``F_GETPATH`` constant, which " -"obtains the path of a file from a file descriptor. On Linux(>=3.15), the :" -"mod:`!fcntl` module exposes the ``F_OFD_GETLK``, ``F_OFD_SETLK`` and " -"``F_OFD_SETLKW`` constants, which are used when working with open file " -"description locks." -msgstr "" - -#: ../../library/fcntl.rst:45 -msgid "" -"On Linux >= 2.6.11, the :mod:`!fcntl` module exposes the ``F_GETPIPE_SZ`` " -"and ``F_SETPIPE_SZ`` constants, which allow to check and modify a pipe's " -"size respectively." -msgstr "" - -#: ../../library/fcntl.rst:50 -msgid "" -"On FreeBSD, the :mod:`!fcntl` module exposes the ``F_DUP2FD`` and " -"``F_DUP2FD_CLOEXEC`` constants, which allow to duplicate a file descriptor, " -"the latter setting ``FD_CLOEXEC`` flag in addition." -msgstr "" - -#: ../../library/fcntl.rst:55 -msgid "" -"On Linux >= 4.5, the :mod:`fcntl` module exposes the ``FICLONE`` and " -"``FICLONERANGE`` constants, which allow to share some data of one file with " -"another file by reflinking on some filesystems (e.g., btrfs, OCFS2, and " -"XFS). This behavior is commonly referred to as \"copy-on-write\"." -msgstr "" - -#: ../../library/fcntl.rst:61 -msgid "" -"On Linux >= 2.6.32, the :mod:`!fcntl` module exposes the ``F_GETOWN_EX``, " -"``F_SETOWN_EX``, ``F_OWNER_TID``, ``F_OWNER_PID``, ``F_OWNER_PGRP`` " -"constants, which allow to direct I/O availability signals to a specific " -"thread, process, or process group. On Linux >= 4.13, the :mod:`!fcntl` " -"module exposes the ``F_GET_RW_HINT``, ``F_SET_RW_HINT``, " -"``F_GET_FILE_RW_HINT``, ``F_SET_FILE_RW_HINT``, and ``RWH_WRITE_LIFE_*`` " -"constants, which allow to inform the kernel about the relative expected " -"lifetime of writes on a given inode or via a particular open file " -"description. On Linux >= 5.1 and NetBSD, the :mod:`!fcntl` module exposes " -"the ``F_SEAL_FUTURE_WRITE`` constant for use with ``F_ADD_SEALS`` and " -"``F_GET_SEALS`` operations. On FreeBSD, the :mod:`!fcntl` module exposes the " -"``F_READAHEAD``, ``F_ISUNIONSTACK``, and ``F_KINFO`` constants. On macOS and " -"FreeBSD, the :mod:`!fcntl` module exposes the ``F_RDAHEAD`` constant. On " -"NetBSD and AIX, the :mod:`!fcntl` module exposes the ``F_CLOSEM`` constant. " -"On NetBSD, the :mod:`!fcntl` module exposes the ``F_MAXFD`` constant. On " -"macOS and NetBSD, the :mod:`!fcntl` module exposes the ``F_GETNOSIGPIPE`` " -"and ``F_SETNOSIGPIPE`` constant." -msgstr "" - -#: ../../library/fcntl.rst:82 +#: ../../library/fcntl.rst:36 msgid "" -"On Linux >= 6.1, the :mod:`!fcntl` module exposes the ``F_DUPFD_QUERY`` to " -"query a file descriptor pointing to the same file." +"On macOS, the fcntl module exposes the ``F_GETPATH`` constant, which obtains " +"the path of a file from a file descriptor. On Linux(>=3.15), the fcntl " +"module exposes the ``F_OFD_GETLK``, ``F_OFD_SETLK`` and ``F_OFD_SETLKW`` " +"constants, which working with open file description locks." msgstr "" -#: ../../library/fcntl.rst:86 +#: ../../library/fcntl.rst:42 msgid "The module defines the following functions:" msgstr "このモジュールには、以下の関数が定義されています:" -#: ../../library/fcntl.rst:91 +#: ../../library/fcntl.rst:47 msgid "" "Perform the operation *cmd* on file descriptor *fd* (file objects providing " "a :meth:`~io.IOBase.fileno` method are accepted as well). The values used " "for *cmd* are operating system dependent, and are available as constants in " "the :mod:`fcntl` module, using the same names as used in the relevant C " -"header files. The argument *arg* can either be an integer value, a :term:" -"`bytes-like object`, or a string. The type and size of *arg* must match the " -"type and size of the argument of the operation as specified in the relevant " -"C documentation." -msgstr "" - -#: ../../library/fcntl.rst:100 -msgid "" -"When *arg* is an integer, the function returns the integer return value of " -"the C :c:func:`fcntl` call." -msgstr "" - -#: ../../library/fcntl.rst:103 -msgid "" -"When the argument is bytes-like object, it represents a binary structure, " -"for example, created by :func:`struct.pack`. A string value is encoded to " -"binary using the UTF-8 encoding. The binary data is copied to a buffer whose " -"address is passed to the C :c:func:`fcntl` call. The return value after a " -"successful call is the contents of the buffer, converted to a :class:`bytes` " -"object. The length of the returned object will be the same as the length of " -"the *arg* argument. This is limited to 1024 bytes." -msgstr "" - -#: ../../library/fcntl.rst:112 -msgid "If the :c:func:`fcntl` call fails, an :exc:`OSError` is raised." -msgstr "" - -#: ../../library/fcntl.rst:115 -msgid "" -"If the type or the size of *arg* does not match the type or size of the " -"argument of the operation (for example, if an integer is passed when a " -"pointer is expected, or the information returned in the buffer by the " -"operating system is larger than 1024 bytes), this is most likely to result " -"in a segmentation violation or a more subtle data corruption." -msgstr "" - -#: ../../library/fcntl.rst:122 +"header files. The argument *arg* can either be an integer value, or a :class:" +"`bytes` object. With an integer value, the return value of this function is " +"the integer return value of the C :c:func:`fcntl` call. When the argument " +"is bytes it represents a binary structure, e.g. created by :func:`struct." +"pack`. The binary data is copied to a buffer whose address is passed to the " +"C :c:func:`fcntl` call. The return value after a successful call is the " +"contents of the buffer, converted to a :class:`bytes` object. The length of " +"the returned object will be the same as the length of the *arg* argument. " +"This is limited to 1024 bytes. If the information returned in the buffer by " +"the operating system is larger than 1024 bytes, this is most likely to " +"result in a segmentation violation or a more subtle data corruption." +msgstr "" +"操作 *cmd* をファイル記述子 *fd* (または :meth:`~io.IOBase.fileno` メソッドを" +"提供しているファイルオブジェクト) に対して実行します。 *cmd* として用いられる" +"値はオペレーティングシステム依存で、 :mod:`fcntl` モジュール内に関連する C " +"ヘッダファイルと同じ名前が使われている定数の形で利用出来ます。引数 *arg* は整" +"数値か :class:`bytes` オブジェクトをとります。引数が整数値の場合、この関数の" +"戻り値は C 言語の :c:func:`fcntl` を呼び出した際の整数の戻り値になります。引" +"数が bytes の場合には、 :func:`struct.pack` で作られるようなバイナリの構造体" +"を表します。バイナリデータはバッファにコピーされ、そのアドレスが C 言語の :c:" +"func:`fcntl` 呼び出しに渡されます。 呼び出しが成功した後に戻される値はバッ" +"ファの内容で、 :class:`bytes` オブジェクトに変換されています。 返されるオブ" +"ジェクトは *arg* 引数と同じ長さになります。 この値は 1024 バイトに制限されて" +"います。 オペレーティングシステムからバッファに返される情報の長さが 1024 バイ" +"トよりも大きい場合、大抵はセグメンテーション違反となるか、より不可思議なデー" +"タの破損を引き起こします。" + +#: ../../library/fcntl.rst:64 +msgid "If the :c:func:`fcntl` fails, an :exc:`OSError` is raised." +msgstr ":c:func:`fcntl` が失敗した場合、 :exc:`OSError` が送出されます。" + +#: ../../library/fcntl.rst:66 msgid "" "Raises an :ref:`auditing event ` ``fcntl.fcntl`` with arguments " "``fd``, ``cmd``, ``arg``." @@ -182,13 +130,7 @@ msgstr "" "引数 ``fd``, ``cmd``, ``arg`` を指定して :ref:`監査イベント ` " "``fcntl.fcntl`` を送出します。 " -#: ../../library/fcntl.rst:124 -msgid "" -"Add support of arbitrary :term:`bytes-like objects `, not " -"only :class:`bytes`." -msgstr "" - -#: ../../library/fcntl.rst:131 +#: ../../library/fcntl.rst:71 msgid "" "This function is identical to the :func:`~fcntl.fcntl` function, except that " "the argument handling is even more complicated." @@ -196,73 +138,78 @@ msgstr "" "この関数は :func:`~fcntl.fcntl` 関数と同じですが、引数の扱いがより複雑である" "ところが異なります。" -#: ../../library/fcntl.rst:134 +#: ../../library/fcntl.rst:74 msgid "" -"The *request* parameter is limited to values that can fit in 32-bits or 64-" -"bits, depending on the platform. Additional constants of interest for use as " -"the *request* argument can be found in the :mod:`termios` module, under the " -"same names as used in the relevant C header files." +"The *request* parameter is limited to values that can fit in 32-bits. " +"Additional constants of interest for use as the *request* argument can be " +"found in the :mod:`termios` module, under the same names as used in the " +"relevant C header files." msgstr "" +"パラメータ *request* は32ビットに収まる値に制限されます。 *request* 引数とし" +"て使うのに関係のある追加の定数は :mod:`termios` モジュールにあり、関連する C " +"ヘッダファイルで使われているのと同じ名前が付けられています。" -#: ../../library/fcntl.rst:140 +#: ../../library/fcntl.rst:79 msgid "" -"The parameter *arg* can be an integer, a :term:`bytes-like object`, or a " -"string. The type and size of *arg* must match the type and size of the " -"argument of the operation as specified in the relevant C documentation." +"The parameter *arg* can be one of an integer, an object supporting the read-" +"only buffer interface (like :class:`bytes`) or an object supporting the read-" +"write buffer interface (like :class:`bytearray`)." msgstr "" +"パラメタ *arg* は、整数、 (:class:`bytes` のような) 読み出し専用のバッファイ" +"ンターフェースをサポートするオブジェクト、読み書きバッファインターフェースを" +"サポートするオブジェクトのどれかです。" -#: ../../library/fcntl.rst:145 +#: ../../library/fcntl.rst:83 msgid "" -"If *arg* does not support the read-write buffer interface or the " -"*mutate_flag* is false, behavior is as for the :func:`~fcntl.fcntl` function." +"In all but the last case, behaviour is as for the :func:`~fcntl.fcntl` " +"function." msgstr "" +"最後の型のオブジェクトを除き、動作は :func:`~fcntl.fcntl` 関数と同じです。" -#: ../../library/fcntl.rst:149 +#: ../../library/fcntl.rst:86 msgid "" -"If *arg* supports the read-write buffer interface (like :class:`bytearray`) " -"and *mutate_flag* is true (the default), then the buffer is (in effect) " -"passed to the underlying :c:func:`!ioctl` system call, the latter's return " -"code is passed back to the calling Python, and the buffer's new contents " -"reflect the action of the :c:func:`ioctl`. This is a slight simplification, " -"because if the supplied buffer is less than 1024 bytes long it is first " -"copied into a static buffer 1024 bytes long which is then passed to :func:" -"`ioctl` and copied back into the supplied buffer." +"If a mutable buffer is passed, then the behaviour is determined by the value " +"of the *mutate_flag* parameter." msgstr "" +"可変なバッファが渡された場合、動作は *mutate_flag* 引数の値で決定されます。" -#: ../../library/fcntl.rst:158 +#: ../../library/fcntl.rst:89 msgid "" -"If the :c:func:`ioctl` call fails, an :exc:`OSError` exception is raised." +"If it is false, the buffer's mutability is ignored and behaviour is as for a " +"read-only buffer, except that the 1024 byte limit mentioned above is avoided " +"-- so long as the buffer you pass is at least as long as what the operating " +"system wants to put there, things should work." msgstr "" +"この値が偽の場合、バッファの可変性は無視され、読み出し専用バッファの場合と同" +"じ動作になりますが、上で述べた 1024 バイトの制限は回避されます -- 従って、オ" +"ペレーティングシステムが希望するバッファ長までであれば正しく動作します。" -#: ../../library/fcntl.rst:161 +#: ../../library/fcntl.rst:94 msgid "" -"If the type or size of *arg* does not match the type or size of the " -"operation's argument (for example, if an integer is passed when a pointer is " -"expected, or the information returned in the buffer by the operating system " -"is larger than 1024 bytes, or the size of the mutable bytes-like object is " -"too small), this is most likely to result in a segmentation violation or a " -"more subtle data corruption." +"If *mutate_flag* is true (the default), then the buffer is (in effect) " +"passed to the underlying :func:`ioctl` system call, the latter's return code " +"is passed back to the calling Python, and the buffer's new contents reflect " +"the action of the :func:`ioctl`. This is a slight simplification, because " +"if the supplied buffer is less than 1024 bytes long it is first copied into " +"a static buffer 1024 bytes long which is then passed to :func:`ioctl` and " +"copied back into the supplied buffer." msgstr "" +"*mutate_flag* が真 (デフォルト) の場合、バッファは (実際には) 根底にある :" +"func:`ioctl` システムコールに渡され、後者の戻り値が呼び出し側の Python に引き" +"渡され、バッファの新たな内容は :func:`ioctl` の動作を反映します。この説明は" +"やや単純化されています。というのは、与えられたバッファが 1024 バイト長よりも" +"短い場合、バッファはまず 1024 バイト長の静的なバッファにコピーされてから :" +"func:`ioctl` に渡され、その後引数で与えたバッファに戻しコピーされるからです。" -#: ../../library/fcntl.rst:169 +#: ../../library/fcntl.rst:102 +msgid "If the :c:func:`ioctl` fails, an :exc:`OSError` exception is raised." +msgstr ":c:func:`ioctl` が失敗すると、 :exc:`OSError` 例外が送出されます。" + +#: ../../library/fcntl.rst:104 msgid "An example::" msgstr "以下に例を示します::" -#: ../../library/fcntl.rst:171 -msgid "" -">>> import array, fcntl, struct, termios, os\n" -">>> os.getpgrp()\n" -"13341\n" -">>> struct.unpack('h', fcntl.ioctl(0, termios.TIOCGPGRP, \" \"))[0]\n" -"13341\n" -">>> buf = array.array('h', [0])\n" -">>> fcntl.ioctl(0, termios.TIOCGPGRP, buf, 1)\n" -"0\n" -">>> buf\n" -"array('h', [13341])" -msgstr "" - -#: ../../library/fcntl.rst:182 +#: ../../library/fcntl.rst:117 msgid "" "Raises an :ref:`auditing event ` ``fcntl.ioctl`` with arguments " "``fd``, ``request``, ``arg``." @@ -270,13 +217,7 @@ msgstr "" "引数 ``fd``, ``request``, ``arg`` を指定して :ref:`監査イベント ` " "``fcntl.ioctl`` を送出します。 " -#: ../../library/fcntl.rst:184 -msgid "" -"The GIL is always released during a system call. System calls failing with " -"EINTR are automatically retried." -msgstr "" - -#: ../../library/fcntl.rst:190 +#: ../../library/fcntl.rst:122 msgid "" "Perform the lock operation *operation* on file descriptor *fd* (file objects " "providing a :meth:`~io.IOBase.fileno` method are accepted as well). See the " @@ -288,12 +229,11 @@ msgstr "" "Unix マニュアルの :manpage:`flock(2)` を参照してください (システムによって" "は、この関数は :c:func:`fcntl` を使ってエミュレーションされています)。" -#: ../../library/fcntl.rst:195 -msgid "" -"If the :c:func:`flock` call fails, an :exc:`OSError` exception is raised." -msgstr "" +#: ../../library/fcntl.rst:127 +msgid "If the :c:func:`flock` fails, an :exc:`OSError` exception is raised." +msgstr ":c:func:`flock` が失敗すると、 :exc:`OSError` 例外が送出されます。" -#: ../../library/fcntl.rst:197 +#: ../../library/fcntl.rst:129 msgid "" "Raises an :ref:`auditing event ` ``fcntl.flock`` with arguments " "``fd``, ``operation``." @@ -301,7 +241,7 @@ msgstr "" "引数 ``fd``, ``operation`` を指定して :ref:`監査イベント ` ``fcntl." "flock`` を送出します。 " -#: ../../library/fcntl.rst:202 +#: ../../library/fcntl.rst:134 msgid "" "This is essentially a wrapper around the :func:`~fcntl.fcntl` locking calls. " "*fd* is the file descriptor (file objects providing a :meth:`~io.IOBase." @@ -313,35 +253,39 @@ msgstr "" "IOBase.fileno` メソッドを提供するファイルオブジェクトも受け付けられます) " "で、 *cmd* は以下の値のうちいずれかになります:" -#: ../../library/fcntl.rst:209 -msgid "Release an existing lock." -msgstr "" - -#: ../../library/fcntl.rst:213 -msgid "Acquire a shared lock." -msgstr "" - -#: ../../library/fcntl.rst:217 -msgid "Acquire an exclusive lock." -msgstr "" - -#: ../../library/fcntl.rst:221 -msgid "" -"Bitwise OR with any of the other three ``LOCK_*`` constants to make the " -"request non-blocking." -msgstr "" - -#: ../../library/fcntl.rst:224 -msgid "" -"If :const:`!LOCK_NB` is used and the lock cannot be acquired, an :exc:" -"`OSError` will be raised and the exception will have an *errno* attribute " -"set to :const:`~errno.EACCES` or :const:`~errno.EAGAIN` (depending on the " -"operating system; for portability, check for both values). On at least some " -"systems, :const:`!LOCK_EX` can only be used if the file descriptor refers to " -"a file opened for writing." -msgstr "" +#: ../../library/fcntl.rst:139 +msgid ":const:`LOCK_UN` -- unlock" +msgstr ":const:`LOCK_UN` -- アンロック" -#: ../../library/fcntl.rst:231 +#: ../../library/fcntl.rst:140 +msgid ":const:`LOCK_SH` -- acquire a shared lock" +msgstr ":const:`LOCK_SH` -- 共有ロックを取得" + +#: ../../library/fcntl.rst:141 +msgid ":const:`LOCK_EX` -- acquire an exclusive lock" +msgstr ":const:`LOCK_EX` -- 排他的ロックを取得" + +#: ../../library/fcntl.rst:143 +msgid "" +"When *cmd* is :const:`LOCK_SH` or :const:`LOCK_EX`, it can also be bitwise " +"ORed with :const:`LOCK_NB` to avoid blocking on lock acquisition. If :const:" +"`LOCK_NB` is used and the lock cannot be acquired, an :exc:`OSError` will be " +"raised and the exception will have an *errno* attribute set to :const:" +"`EACCES` or :const:`EAGAIN` (depending on the operating system; for " +"portability, check for both values). On at least some systems, :const:" +"`LOCK_EX` can only be used if the file descriptor refers to a file opened " +"for writing." +msgstr "" +"*cmd* が :const:`LOCK_SH` または :const:`LOCK_EX` の場合、 :const:`LOCK_NB` " +"とビット OR にすることでロック取得時にブロックしないようにすることができま" +"す。 :const:`LOCK_NB` が使われ、ロックが取得できなかった場合、 :exc:" +"`OSError` が送出され、例外は *errno* 属性を持ち、その値は :const:`EACCES` ま" +"たは :const:`EAGAIN` になります (オペレーティングシステムに依存します; 可搬性" +"のため、両方の値をチェックしてください)。少なくともいくつかのシステムでは、" +"ファイル記述子が参照しているファイルが書き込みのために開かれている場合、 :" +"const:`LOCK_EX` だけしか使うことができません。" + +#: ../../library/fcntl.rst:152 msgid "" "*len* is the number of bytes to lock, *start* is the byte offset at which " "the lock starts, relative to *whence*, and *whence* is as with :func:`io." @@ -351,19 +295,20 @@ msgstr "" "相対的なバイトオフセット、 *whence* は :func:`io.IOBase.seek` と同じで、具体" "的には:" -#: ../../library/fcntl.rst:235 -msgid "``0`` -- relative to the start of the file (:const:`os.SEEK_SET`)" -msgstr "" +#: ../../library/fcntl.rst:156 +msgid ":const:`0` -- relative to the start of the file (:data:`os.SEEK_SET`)" +msgstr ":const:`0` -- ファイル先頭からの相対位置 (:data:`os.SEEK_SET`)" -#: ../../library/fcntl.rst:236 -msgid "``1`` -- relative to the current buffer position (:const:`os.SEEK_CUR`)" -msgstr "" +#: ../../library/fcntl.rst:157 +msgid "" +":const:`1` -- relative to the current buffer position (:data:`os.SEEK_CUR`)" +msgstr ":const:`1` -- 現在のバッファ位置からの相対位置 (:data:`os.SEEK_CUR`)" -#: ../../library/fcntl.rst:237 -msgid "``2`` -- relative to the end of the file (:const:`os.SEEK_END`)" -msgstr "" +#: ../../library/fcntl.rst:158 +msgid ":const:`2` -- relative to the end of the file (:data:`os.SEEK_END`)" +msgstr ":const:`2` -- ファイルの末尾からの相対位置 (:data:`os.SEEK_END`)" -#: ../../library/fcntl.rst:239 +#: ../../library/fcntl.rst:160 msgid "" "The default for *start* is 0, which means to start at the beginning of the " "file. The default for *len* is 0 which means to lock to the end of the " @@ -373,7 +318,7 @@ msgstr "" "の標準の値は 0 で、ファイルの終了までロックすることを表します。*whence* の標" "準の値も 0 です。" -#: ../../library/fcntl.rst:243 +#: ../../library/fcntl.rst:164 msgid "" "Raises an :ref:`auditing event ` ``fcntl.lockf`` with arguments " "``fd``, ``cmd``, ``len``, ``start``, ``whence``." @@ -381,22 +326,11 @@ msgstr "" "引数 ``fd``, ``cmd``, ``len``, ``start``, ``whence`` を指定して :ref:`監査イ" "ベント ` ``fcntl.lockf`` を送出します。 " -#: ../../library/fcntl.rst:245 +#: ../../library/fcntl.rst:166 msgid "Examples (all on a SVR4 compliant system)::" msgstr "以下に (全ての SVR4 互換システムでの) 例を示します::" -#: ../../library/fcntl.rst:247 -msgid "" -"import struct, fcntl, os\n" -"\n" -"f = open(...)\n" -"rv = fcntl.fcntl(f, fcntl.F_SETFL, os.O_NDELAY)\n" -"\n" -"lockdata = struct.pack('hhllhh', fcntl.F_WRLCK, 0, 0, 0, 0, 0)\n" -"rv = fcntl.fcntl(f, fcntl.F_SETLKW, lockdata)" -msgstr "" - -#: ../../library/fcntl.rst:255 +#: ../../library/fcntl.rst:176 msgid "" "Note that in the first example the return value variable *rv* will hold an " "integer value; in the second example it will hold a :class:`bytes` object. " @@ -407,25 +341,16 @@ msgstr "" "`bytes` オブジェクトを保持しています。 *lockdata* 変数の構造体レイアウトはシ" "ステム依存です --- 従って :func:`flock` を呼ぶ方が良いでしょう。" -#: ../../library/fcntl.rst:263 +#: ../../library/fcntl.rst:187 msgid "Module :mod:`os`" msgstr ":mod:`os` モジュール" -#: ../../library/fcntl.rst:264 +#: ../../library/fcntl.rst:185 msgid "" -"If the locking flags :const:`~os.O_SHLOCK` and :const:`~os.O_EXLOCK` are " +"If the locking flags :data:`~os.O_SHLOCK` and :data:`~os.O_EXLOCK` are " "present in the :mod:`os` module (on BSD only), the :func:`os.open` function " "provides an alternative to the :func:`lockf` and :func:`flock` functions." msgstr "" - -#: ../../library/fcntl.rst:10 -msgid "UNIX" -msgstr "UNIX" - -#: ../../library/fcntl.rst:10 -msgid "file control" -msgstr "" - -#: ../../library/fcntl.rst:10 -msgid "I/O control" -msgstr "I/O control" +"もし :mod:`os` モジュールに :data:`os.O_SHLOCK` と :data:`os.O_EXLOCK` が 存" +"在する場合 (BSD のみ)、 :func:`os.open` 関数は :func:`lockf` や :func:" +"`flock` 関数を代替できます。" diff --git a/library/filecmp.po b/library/filecmp.po index ea79eed3e..0863d6b80 100644 --- a/library/filecmp.po +++ b/library/filecmp.po @@ -1,31 +1,35 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 -# 石井明久, 2024 +# Shun Sakurai, 2017 +# 秘湯 , 2017 +# tomo, 2017 +# E. Kawashima, 2017 +# Arihiro TAKASE, 2017 +# Nozomu Kaneko , 2017 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-30 14:22+0000\n" -"PO-Revision-Date: 2021-06-28 01:06+0000\n" -"Last-Translator: 石井明久, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-08-05 07:09+0000\n" +"PO-Revision-Date: 2017-02-16 23:10+0000\n" +"Last-Translator: Nozomu Kaneko , 2017\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/filecmp.rst:2 -msgid ":mod:`!filecmp` --- File and Directory Comparisons" -msgstr ":mod:`!filecmp` --- ファイルとディレクトリの比較" +msgid ":mod:`filecmp` --- File and Directory Comparisons" +msgstr ":mod:`filecmp` --- ファイルおよびディレクトリの比較" #: ../../library/filecmp.rst:9 msgid "**Source code:** :source:`Lib/filecmp.py`" @@ -141,37 +145,39 @@ msgstr ":class:`dircmp` クラス" #: ../../library/filecmp.rst:75 msgid "" "Construct a new directory comparison object, to compare the directories *a* " -"and *b*. *ignore* is a list of names to ignore, and defaults to :const:" +"and *b*. *ignore* is a list of names to ignore, and defaults to :attr:" "`filecmp.DEFAULT_IGNORES`. *hide* is a list of names to hide, and defaults " "to ``[os.curdir, os.pardir]``." msgstr "" +"ディレクトリ *a* および *b* を比較するための新しいディレクトリ比較オブジェク" +"トを生成します。 *ignore* は比較の際に無視するファイル名のリストで、標準の設" +"定では :attr:`filecmp.DEFAULT_IGNORES` です。 *hide* は表示しない名前のリスト" +"で、標準の設定では ``[os.curdir, os.pardir]`` です。" #: ../../library/filecmp.rst:80 msgid "" "The :class:`dircmp` class compares files by doing *shallow* comparisons as " -"described for :func:`filecmp.cmp` by default using the *shallow* parameter." -msgstr "" - -#: ../../library/filecmp.rst:86 -msgid "Added the *shallow* parameter." +"described for :func:`filecmp.cmp`." msgstr "" +":class:`dircmp` クラスは、 :func:`filecmp.cmp` で説明されているような *浅い* " +"比較を行うことによりファイルを比較します。" -#: ../../library/filecmp.rst:88 +#: ../../library/filecmp.rst:83 msgid "The :class:`dircmp` class provides the following methods:" msgstr ":class:`dircmp` クラスは以下のメソッドを提供しています:" -#: ../../library/filecmp.rst:92 +#: ../../library/filecmp.rst:87 msgid "Print (to :data:`sys.stdout`) a comparison between *a* and *b*." msgstr "*a* と *b* の比較を (:data:`sys.stdout` に) 表示します。" -#: ../../library/filecmp.rst:96 +#: ../../library/filecmp.rst:91 msgid "" "Print a comparison between *a* and *b* and common immediate subdirectories." msgstr "" "*a* および *b* およびそれらの直下にある共通のサブディレクトリ間での比較結果を" "出力します。" -#: ../../library/filecmp.rst:101 +#: ../../library/filecmp.rst:96 msgid "" "Print a comparison between *a* and *b* and common subdirectories " "(recursively)." @@ -179,7 +185,7 @@ msgstr "" "*a* および *b* およびそれらの共通のサブディレクトリ間での比較結果を (再帰的に" "比較して) 出力します。" -#: ../../library/filecmp.rst:104 +#: ../../library/filecmp.rst:99 msgid "" "The :class:`dircmp` class offers a number of interesting attributes that may " "be used to get various bits of information about the directory trees being " @@ -188,54 +194,56 @@ msgstr "" ":class:`dircmp` クラスは、比較されているディレクトリ階層に関する様々な情報の" "ビットを得るために使用することのできる、興味深い属性を数多く提供しています。" -#: ../../library/filecmp.rst:108 +#: ../../library/filecmp.rst:103 msgid "" -"Note that via :meth:`~object.__getattr__` hooks, all attributes are computed " -"lazily, so there is no speed penalty if only those attributes which are " -"lightweight to compute are used." +"Note that via :meth:`__getattr__` hooks, all attributes are computed lazily, " +"so there is no speed penalty if only those attributes which are lightweight " +"to compute are used." msgstr "" +"すべての属性は :meth:`__getattr__` フックによって遅延評価されるので、計算が軽" +"い属性のみを使用した場合は、属性の計算による速度の低下は起こりません。" -#: ../../library/filecmp.rst:115 +#: ../../library/filecmp.rst:110 msgid "The directory *a*." msgstr "ディレクトリ *a* です。" -#: ../../library/filecmp.rst:120 +#: ../../library/filecmp.rst:115 msgid "The directory *b*." msgstr "ディレクトリ *b* です。" -#: ../../library/filecmp.rst:125 +#: ../../library/filecmp.rst:120 msgid "Files and subdirectories in *a*, filtered by *hide* and *ignore*." msgstr "" "*a* にあるファイルおよびサブディレクトリです。*hide* および *ignore* でフィル" "タされています。" -#: ../../library/filecmp.rst:130 +#: ../../library/filecmp.rst:125 msgid "Files and subdirectories in *b*, filtered by *hide* and *ignore*." msgstr "" "*b* にあるファイルおよびサブディレクトリです。*hide* および *ignore* でフィル" "タされています。" -#: ../../library/filecmp.rst:135 +#: ../../library/filecmp.rst:130 msgid "Files and subdirectories in both *a* and *b*." msgstr "*a* および *b* の両方にあるファイルおよびサブディレクトリです。" -#: ../../library/filecmp.rst:140 +#: ../../library/filecmp.rst:135 msgid "Files and subdirectories only in *a*." msgstr "*a* だけにあるファイルおよびサブディレクトリです。" -#: ../../library/filecmp.rst:145 +#: ../../library/filecmp.rst:140 msgid "Files and subdirectories only in *b*." msgstr "*b* だけにあるファイルおよびサブディレクトリです。" -#: ../../library/filecmp.rst:150 +#: ../../library/filecmp.rst:145 msgid "Subdirectories in both *a* and *b*." msgstr "*a* および *b* の両方にあるサブディレクトリです。" -#: ../../library/filecmp.rst:155 +#: ../../library/filecmp.rst:150 msgid "Files in both *a* and *b*." msgstr "*a* および *b* の両方にあるファイルです。" -#: ../../library/filecmp.rst:160 +#: ../../library/filecmp.rst:155 msgid "" "Names in both *a* and *b*, such that the type differs between the " "directories, or names for which :func:`os.stat` reports an error." @@ -243,7 +251,7 @@ msgstr "" "*a* および *b* の両方にあり、ディレクトリ間でタイプが異なるか、 :func:`os." "stat` がエラーを報告するような名前です。" -#: ../../library/filecmp.rst:166 +#: ../../library/filecmp.rst:161 msgid "" "Files which are identical in both *a* and *b*, using the class's file " "comparison operator." @@ -251,7 +259,7 @@ msgstr "" "クラスのファイル比較オペレータを用いて *a* と *b* の両方において同一のファイ" "ルです。" -#: ../../library/filecmp.rst:172 +#: ../../library/filecmp.rst:167 msgid "" "Files which are in both *a* and *b*, whose contents differ according to the " "class's file comparison operator." @@ -259,45 +267,25 @@ msgstr "" "*a* と *b* の両方に存在し、クラスのファイル比較オペレータに基づいて内容が異な" "るファイルです。" -#: ../../library/filecmp.rst:178 +#: ../../library/filecmp.rst:173 msgid "Files which are in both *a* and *b*, but could not be compared." msgstr "*a* および *b* 両方にあるが、比較されなかったファイルです。" -#: ../../library/filecmp.rst:183 -msgid "" -"A dictionary mapping names in :attr:`common_dirs` to :class:`dircmp` " -"instances (or MyDirCmp instances if this instance is of type MyDirCmp, a " -"subclass of :class:`dircmp`)." -msgstr "" - -#: ../../library/filecmp.rst:187 +#: ../../library/filecmp.rst:178 msgid "" -"Previously entries were always :class:`dircmp` instances. Now entries are " -"the same type as *self*, if *self* is a subclass of :class:`dircmp`." +"A dictionary mapping names in :attr:`common_dirs` to :class:`dircmp` objects." msgstr "" +":attr:`common_dirs` のファイル名を :class:`dircmp` オブジェクトに対応付けた辞" +"書です。" -#: ../../library/filecmp.rst:196 +#: ../../library/filecmp.rst:185 msgid "List of directories ignored by :class:`dircmp` by default." msgstr "デフォルトで :class:`dircmp` に無視されるディレクトリのリストです。" -#: ../../library/filecmp.rst:199 +#: ../../library/filecmp.rst:188 msgid "" "Here is a simplified example of using the ``subdirs`` attribute to search " "recursively through two directories to show common different files::" msgstr "" "これは ``subdirs`` 属性を使用して 2 つのディレクトリを再帰的に探索して、共通" "の異なるファイルを示すための単純化された例です::" - -#: ../../library/filecmp.rst:202 -msgid "" -">>> from filecmp import dircmp\n" -">>> def print_diff_files(dcmp):\n" -"... for name in dcmp.diff_files:\n" -"... print(\"diff_file %s found in %s and %s\" % (name, dcmp.left,\n" -"... dcmp.right))\n" -"... for sub_dcmp in dcmp.subdirs.values():\n" -"... print_diff_files(sub_dcmp)\n" -"...\n" -">>> dcmp = dircmp('dir1', 'dir2')\n" -">>> print_diff_files(dcmp)" -msgstr "" diff --git a/library/fileformats.po b/library/fileformats.po index c38a6bef3..a66c6f745 100644 --- a/library/fileformats.po +++ b/library/fileformats.po @@ -1,25 +1,25 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 +# Arihiro TAKASE, 2017 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-30 14:22+0000\n" -"PO-Revision-Date: 2021-06-28 01:06+0000\n" -"Last-Translator: tomo, 2021\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 23:10+0000\n" +"Last-Translator: Arihiro TAKASE, 2017\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/fileformats.rst:5 diff --git a/library/fileinput.po b/library/fileinput.po index 6bf4cda49..966afce93 100644 --- a/library/fileinput.po +++ b/library/fileinput.po @@ -1,34 +1,39 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: +# Nozomu Kaneko , 2017 +# E. Kawashima, 2017 +# 秘湯 , 2017 +# Arihiro TAKASE, 2017 +# tomo, 2019 +# Tetsuo Koyama , 2020 # Takanori Suzuki , 2021 -# tomo, 2021 # Osamu NAKAMURA, 2021 -# Arihiro TAKASE, 2023 -# 石井明久, 2024 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-13 14:21+0000\n" -"PO-Revision-Date: 2021-06-28 01:06+0000\n" -"Last-Translator: 石井明久, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 23:10+0000\n" +"Last-Translator: Osamu NAKAMURA, 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/fileinput.rst:2 -msgid ":mod:`!fileinput` --- Iterate over lines from multiple input streams" -msgstr ":mod:`!fileinput` --- 複数の入力ストリームをまたいだ行を反復する" +msgid ":mod:`fileinput` --- Iterate over lines from multiple input streams" +msgstr "" +":mod:`fileinput` --- 複数の入力ストリームをまたいだ行の繰り返し処理をサポート" +"する" #: ../../library/fileinput.rst:10 msgid "**Source code:** :source:`Lib/fileinput.py`" @@ -48,13 +53,6 @@ msgstr "" msgid "The typical use is::" msgstr "典型的な使い方は以下の通りです::" -#: ../../library/fileinput.rst:20 -msgid "" -"import fileinput\n" -"for line in fileinput.input(encoding=\"utf-8\"):\n" -" process(line)" -msgstr "" - #: ../../library/fileinput.rst:24 msgid "" "This iterates over the lines of all files listed in ``sys.argv[1:]``, " @@ -121,19 +119,22 @@ msgstr "" #: ../../library/fileinput.rst:49 msgid "" "You can control how files are opened by providing an opening hook via the " -"*openhook* parameter to :func:`fileinput.input` or :func:`FileInput`. The " +"*openhook* parameter to :func:`fileinput.input` or :class:`FileInput()`. The " "hook must be a function that takes two arguments, *filename* and *mode*, and " -"returns an accordingly opened file-like object. If *encoding* and/or " -"*errors* are specified, they will be passed to the hook as additional " -"keyword arguments. This module provides a :func:`hook_compressed` to support " -"compressed files." +"returns an accordingly opened file-like object. Two useful hooks are already " +"provided by this module." msgstr "" +"ファイルのオープン方法を制御するためのオープン時フックは、 :func:`fileinput." +"input` あるいは :class:`FileInput()` の *openhook* パラメータで設定します。こ" +"のフックは、ふたつの引数 *filename* と *mode* をとる関数でなければなりませ" +"ん。そしてその関数の返り値はオープンしたファイルオブジェクトとなります。この" +"モジュールには、便利なフックが既に用意されています。" -#: ../../library/fileinput.rst:56 +#: ../../library/fileinput.rst:55 msgid "The following function is the primary interface of this module:" msgstr "以下の関数がこのモジュールの基本的なインターフェースです:" -#: ../../library/fileinput.rst:61 +#: ../../library/fileinput.rst:60 msgid "" "Create an instance of the :class:`FileInput` class. The instance will be " "used as global state for the functions of this module, and is also returned " @@ -144,7 +145,7 @@ msgstr "" "このモジュールの関数群が利用するグローバルな状態として利用されます。この関数" "への引数は :class:`FileInput` クラスのコンストラクタへ渡されます。" -#: ../../library/fileinput.rst:66 +#: ../../library/fileinput.rst:65 msgid "" "The :class:`FileInput` instance can be used as a context manager in the :" "keyword:`with` statement. In this example, *input* is closed after the :" @@ -155,29 +156,16 @@ msgstr "" "次の例では、仮に例外が生じたとしても :keyword:`!with` 文から抜けた後で " "*input* は閉じられます::" -#: ../../library/fileinput.rst:70 -msgid "" -"with fileinput.input(files=('spam.txt', 'eggs.txt'), encoding=\"utf-8\") as " -"f:\n" -" for line in f:\n" -" process(line)" -msgstr "" - -#: ../../library/fileinput.rst:74 ../../library/fileinput.rst:170 +#: ../../library/fileinput.rst:73 ../../library/fileinput.rst:166 msgid "Can be used as a context manager." msgstr "コンテキストマネージャとして使うことができるようになりました。" -#: ../../library/fileinput.rst:77 +#: ../../library/fileinput.rst:76 msgid "The keyword parameters *mode* and *openhook* are now keyword-only." msgstr "" "キーワード引数 *mode* と *openhook* は、キーワード専用引数になりました。" -#: ../../library/fileinput.rst:80 ../../library/fileinput.rst:176 -#: ../../library/fileinput.rst:210 -msgid "The keyword-only parameter *encoding* and *errors* are added." -msgstr "" - -#: ../../library/fileinput.rst:84 +#: ../../library/fileinput.rst:80 msgid "" "The following functions use the global state created by :func:`fileinput." "input`; if there is no active state, :exc:`RuntimeError` is raised." @@ -185,7 +173,7 @@ msgstr "" "以下の関数は :func:`fileinput.input` 関数によって作られたグローバルな状態を利" "用します。アクティブな状態が無い場合には、 :exc:`RuntimeError` が発生します。" -#: ../../library/fileinput.rst:90 +#: ../../library/fileinput.rst:86 msgid "" "Return the name of the file currently being read. Before the first line has " "been read, returns ``None``." @@ -193,7 +181,7 @@ msgstr "" "現在読み込み中のファイル名を返します。一行目が読み込まれる前は ``None`` を返" "します。" -#: ../../library/fileinput.rst:96 +#: ../../library/fileinput.rst:92 msgid "" "Return the integer \"file descriptor\" for the current file. When no file is " "opened (before the first line and between files), returns ``-1``." @@ -201,7 +189,7 @@ msgstr "" "現在のファイルの \"ファイル記述子\" を整数値で返します。ファイルがオープンさ" "れていない場合 (最初の行の前、ファイルとファイルの間) は ``-1`` を返します。" -#: ../../library/fileinput.rst:102 +#: ../../library/fileinput.rst:98 msgid "" "Return the cumulative line number of the line that has just been read. " "Before the first line has been read, returns ``0``. After the last line of " @@ -211,7 +199,7 @@ msgstr "" "``0`` を返します。最後のファイルの最終行が読み込まれた後には、その行の行番号" "を返します。" -#: ../../library/fileinput.rst:109 +#: ../../library/fileinput.rst:105 msgid "" "Return the line number in the current file. Before the first line has been " "read, returns ``0``. After the last line of the last file has been read, " @@ -221,7 +209,7 @@ msgstr "" "す。最後のファイルの最終行が読み込まれた後には、その行のファイル中での行番号" "を返します。" -#: ../../library/fileinput.rst:116 +#: ../../library/fileinput.rst:112 msgid "" "Return ``True`` if the line just read is the first line of its file, " "otherwise return ``False``." @@ -229,7 +217,7 @@ msgstr "" "最後に読み込まれた行がファイルの1行目なら ``True`` 、そうでなければ " "``False`` を返します。" -#: ../../library/fileinput.rst:122 +#: ../../library/fileinput.rst:118 msgid "" "Return ``True`` if the last line was read from ``sys.stdin``, otherwise " "return ``False``." @@ -237,7 +225,7 @@ msgstr "" "最後に読み込まれた行が ``sys.stdin`` から読み込まれていれば ``True`` 、そうで" "なければ ``False`` を返します。" -#: ../../library/fileinput.rst:128 +#: ../../library/fileinput.rst:124 msgid "" "Close the current file so that the next iteration will read the first line " "from the next file (if any); lines not read from the file will not count " @@ -254,11 +242,11 @@ msgstr "" "んので、最初のファイルをスキップするために利用することはできません。最後の" "ファイルの最終行が読み込まれた後にも、この関数は呼び出されても何もしません。" -#: ../../library/fileinput.rst:138 +#: ../../library/fileinput.rst:134 msgid "Close the sequence." msgstr "シーケンスを閉じます。" -#: ../../library/fileinput.rst:140 +#: ../../library/fileinput.rst:136 msgid "" "The class which implements the sequence behavior provided by the module is " "available for subclassing as well:" @@ -266,34 +254,36 @@ msgstr "" "このモジュールのシーケンスの振舞いを実装しているクラスのサブクラスを作ること" "もできます:" -#: ../../library/fileinput.rst:146 +#: ../../library/fileinput.rst:142 msgid "" "Class :class:`FileInput` is the implementation; its methods :meth:" "`filename`, :meth:`fileno`, :meth:`lineno`, :meth:`filelineno`, :meth:" "`isfirstline`, :meth:`isstdin`, :meth:`nextfile` and :meth:`close` " "correspond to the functions of the same name in the module. In addition it " -"is :term:`iterable` and has a :meth:`~io.TextIOBase.readline` method which " -"returns the next input line. The sequence must be accessed in strictly " -"sequential order; random access and :meth:`~io.TextIOBase.readline` cannot " -"be mixed." +"has a :meth:`~io.TextIOBase.readline` method which returns the next input " +"line, and a :meth:`__getitem__` method which implements the sequence " +"behavior. The sequence must be accessed in strictly sequential order; random " +"access and :meth:`~io.TextIOBase.readline` cannot be mixed." msgstr "" ":class:`FileInput` クラスはモジュールの関数に対応するメソッド :meth:" "`filename` 、 :meth:`fileno` 、 :meth:`lineno` 、 :meth:`filelineno` 、 :" "meth:`isfirstline` 、 :meth:`isstdin` 、 :meth:`nextfile` および :meth:" -"`close` を実装しています。:term:`イテラブル ` であることに加えて、" -"次の入力行を返す :meth:`~io.TextIOBase.readline` メソッドがあります。シーケン" -"スはシーケンシャルに読み込むことしかできません。つまりランダムアクセスと :" -"meth:`~io.TextIOBase.readline` を混在させることはできません。" +"`close` を実装しています。それに加えて、次の入力行を返す :meth:`~io." +"TextIOBase.readline` メソッドと、シーケンスの振舞いの実装をしている :meth:" +"`__getitem__` メソッドがあります。シーケンスはシーケンシャルに読み込むことし" +"かできません。つまりランダムアクセスと :meth:`~io.TextIOBase.readline` を混在" +"させることはできません。" -#: ../../library/fileinput.rst:154 +#: ../../library/fileinput.rst:151 msgid "" "With *mode* you can specify which file mode will be passed to :func:`open`. " -"It must be one of ``'r'`` and ``'rb'``." +"It must be one of ``'r'``, ``'rU'``, ``'U'`` and ``'rb'``." msgstr "" "*mode* を使用すると、 :func:`open` に渡すファイルモードを指定することができま" -"す。これは ``'r'`` および ``'rb'`` のうちのいずれかとなります。" +"す。これは ``'r'`` 、 ``'rU'`` 、 ``'U'`` および ``'rb'`` のうちのいずれかと" +"なります。" -#: ../../library/fileinput.rst:157 +#: ../../library/fileinput.rst:154 msgid "" "The *openhook*, when given, must be a function that takes two arguments, " "*filename* and *mode*, and returns an accordingly opened file-like object. " @@ -303,13 +293,7 @@ msgstr "" "ければなりません。この関数の返り値は、オープンしたファイルオブジェクトとなり" "ます。*inplace* と *openhook* を同時に使うことはできません。" -#: ../../library/fileinput.rst:161 -msgid "" -"You can specify *encoding* and *errors* that is passed to :func:`open` or " -"*openhook*." -msgstr "" - -#: ../../library/fileinput.rst:163 +#: ../../library/fileinput.rst:158 msgid "" "A :class:`FileInput` instance can be used as a context manager in the :" "keyword:`with` statement. In this example, *input* is closed after the :" @@ -320,24 +304,20 @@ msgstr "" "次の例では、仮に例外が生じたとしても :keyword:`!with` 文から抜けた後で " "*input* は閉じられます::" -#: ../../library/fileinput.rst:167 -msgid "" -"with FileInput(files=('spam.txt', 'eggs.txt')) as input:\n" -" process(input)" -msgstr "" +#: ../../library/fileinput.rst:169 +msgid "The ``'rU'`` and ``'U'`` modes." +msgstr "``'rU'`` および ``'U'`` モード。" + +#: ../../library/fileinput.rst:172 +msgid "Support for :meth:`__getitem__` method is deprecated." +msgstr "meth:`__getitem__` メソッドのサポートは非推奨になりました。" -#: ../../library/fileinput.rst:173 +#: ../../library/fileinput.rst:175 msgid "The keyword parameter *mode* and *openhook* are now keyword-only." msgstr "" "キーワード引数 *mode* と *openhook* は、キーワード専用引数になりました。" -#: ../../library/fileinput.rst:179 -msgid "" -"The ``'rU'`` and ``'U'`` modes and the :meth:`!__getitem__` method have been " -"removed." -msgstr "" - -#: ../../library/fileinput.rst:184 +#: ../../library/fileinput.rst:180 msgid "" "**Optional in-place filtering:** if the keyword argument ``inplace=True`` is " "passed to :func:`fileinput.input` or to the :class:`FileInput` constructor, " @@ -362,11 +342,11 @@ msgstr "" "ファイルが閉じられればバックアップファイルも消されます。インプレースフィルタ" "機能は、標準入力を読み込んでいる間は無効にされます。" -#: ../../library/fileinput.rst:196 +#: ../../library/fileinput.rst:192 msgid "The two following opening hooks are provided by this module:" msgstr "このモジュールには、次のふたつのオープン時フックが用意されています:" -#: ../../library/fileinput.rst:200 +#: ../../library/fileinput.rst:196 msgid "" "Transparently opens files compressed with gzip and bzip2 (recognized by the " "extensions ``'.gz'`` and ``'.bz2'``) using the :mod:`gzip` and :mod:`bz2` " @@ -378,21 +358,14 @@ msgstr "" "ます。ファイルの拡張子が ``'.gz'`` や ``'.bz2'`` でない場合は、通常通りファイ" "ルをオープンします (つまり、 :func:`open` をコールする際に伸長を行いません)。" -#: ../../library/fileinput.rst:205 -msgid "" -"The *encoding* and *errors* values are passed to :class:`io.TextIOWrapper` " -"for compressed files and open for normal files." -msgstr "" - -#: ../../library/fileinput.rst:208 +#: ../../library/fileinput.rst:201 msgid "" "Usage example: ``fi = fileinput.FileInput(openhook=fileinput." -"hook_compressed, encoding=\"utf-8\")``" +"hook_compressed)``" msgstr "" -"使用例: ``fi = fileinput.FileInput(openhook=fileinput.hook_compressed, " -"encoding=\"utf-8\")``" +"使用例: ``fi = fileinput.FileInput(openhook=fileinput.hook_compressed)``" -#: ../../library/fileinput.rst:216 +#: ../../library/fileinput.rst:206 msgid "" "Returns a hook which opens each file with :func:`open`, using the given " "*encoding* and *errors* to read the file." @@ -400,7 +373,7 @@ msgstr "" "各ファイルを :func:`open` でオープンするフックを返します。指定した " "*encoding* および *errors* でファイルを読み込みます。" -#: ../../library/fileinput.rst:219 +#: ../../library/fileinput.rst:209 msgid "" "Usage example: ``fi = fileinput.FileInput(openhook=fileinput." "hook_encoded(\"utf-8\", \"surrogateescape\"))``" @@ -408,12 +381,6 @@ msgstr "" "使用例: ``fi = fileinput.FileInput(openhook=fileinput." "hook_encoded(\"utf-8\", \"surrogateescape\"))``" -#: ../../library/fileinput.rst:223 +#: ../../library/fileinput.rst:213 msgid "Added the optional *errors* parameter." msgstr "オプションの *errors* 引数が追加されました。" - -#: ../../library/fileinput.rst:226 -msgid "" -"This function is deprecated since :func:`fileinput.input` and :class:" -"`FileInput` now have *encoding* and *errors* parameters." -msgstr "" diff --git a/library/filesys.po b/library/filesys.po index eaa64299e..95b4ac947 100644 --- a/library/filesys.po +++ b/library/filesys.po @@ -1,27 +1,29 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 +# 秘湯 , 2017 +# Inada Naoki , 2017 +# Arihiro TAKASE, 2017 +# Nozomu Kaneko , 2017 # Osamu NAKAMURA, 2021 -# 石井明久, 2024 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-06 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 01:06+0000\n" -"Last-Translator: 石井明久, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 23:10+0000\n" +"Last-Translator: Osamu NAKAMURA, 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/filesys.rst:5 @@ -40,11 +42,11 @@ msgstr "" "操作する、テンポラリファイルを作成するためのモジュールです。この章の完全な一" "覧は:" -#: ../../library/filesys.rst:28 +#: ../../library/filesys.rst:31 msgid "Module :mod:`os`" msgstr ":mod:`os` モジュール" -#: ../../library/filesys.rst:29 +#: ../../library/filesys.rst:30 msgid "" "Operating system interfaces, including functions to work with files at a " "lower level than Python :term:`file objects `." @@ -52,11 +54,11 @@ msgstr "" "オペレーティングシステムのインターフェース、Python の :term:`ファイルオブジェ" "クト ` より低レベルでのファイル操作を含みます。" -#: ../../library/filesys.rst:32 +#: ../../library/filesys.rst:35 msgid "Module :mod:`io`" msgstr ":mod:`io` モジュール" -#: ../../library/filesys.rst:33 +#: ../../library/filesys.rst:34 msgid "" "Python's built-in I/O library, including both abstract classes and some " "concrete classes such as file I/O." @@ -64,10 +66,10 @@ msgstr "" "Python 組み込みの I/O ライブラリで、抽象クラスとファイル I/O のようないくつか" "の具象クラスを含みます。" -#: ../../library/filesys.rst:36 +#: ../../library/filesys.rst:37 msgid "Built-in function :func:`open`" -msgstr ":func:`open` 組み込み関数" +msgstr ":func:`open` 組込み関数" -#: ../../library/filesys.rst:37 +#: ../../library/filesys.rst:38 msgid "The standard way to open files for reading and writing with Python." msgstr "Python で読み書きのためにファイルを開く標準的な方法です。" diff --git a/library/fnmatch.po b/library/fnmatch.po index a06414842..29fed7d0c 100644 --- a/library/fnmatch.po +++ b/library/fnmatch.po @@ -1,35 +1,37 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2023 -# Nozomu Kaneko , 2023 -# Inada Naoki , 2023 -# Arihiro TAKASE, 2023 -# Takeshi Nakazato, 2023 -# 石井明久, 2024 +# Shun Sakurai, 2017 +# ごはんですよ , 2017 +# Yusuke Miyazaki , 2017 +# Nozomu Kaneko , 2017 +# E. Kawashima, 2017 +# Arihiro TAKASE, 2017 +# 秘湯 , 2017 +# tomo, 2021 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 01:06+0000\n" -"Last-Translator: 石井明久, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 23:10+0000\n" +"Last-Translator: tomo, 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/fnmatch.rst:2 -msgid ":mod:`!fnmatch` --- Unix filename pattern matching" -msgstr ":mod:`!fnmatch` --- Unix のファイル名パターンマッチ" +msgid ":mod:`fnmatch` --- Unix filename pattern matching" +msgstr ":mod:`fnmatch` --- Unix ファイル名のパターンマッチ" #: ../../library/fnmatch.rst:7 msgid "**Source code:** :source:`Lib/fnmatch.py`" @@ -107,36 +109,22 @@ msgstr "" "filter` を使っています)。同様に、ピリオドで始まるファイル名はこのモジュールに" "固有ではなくて、 ``*`` と ``?`` のパターンでマッチします。" -#: ../../library/fnmatch.rst:49 -msgid "" -"Unless stated otherwise, \"filename string\" and \"pattern string\" either " -"refer to :class:`str` or ``ISO-8859-1`` encoded :class:`bytes` objects. Note " -"that the functions documented below do not allow to mix a :class:`!bytes` " -"pattern with a :class:`!str` filename, and vice-versa." -msgstr "" - -#: ../../library/fnmatch.rst:54 -msgid "" -"Finally, note that :func:`functools.lru_cache` with a *maxsize* of 32768 is " -"used to cache the (typed) compiled regex patterns in the following " -"functions: :func:`fnmatch`, :func:`fnmatchcase`, :func:`.filter`." -msgstr "" - -#: ../../library/fnmatch.rst:61 +#: ../../library/fnmatch.rst:52 msgid "" -"Test whether the filename string *name* matches the pattern string *pat*, " -"returning ``True`` or ``False``. Both parameters are case-normalized using :" +"Test whether the *filename* string matches the *pattern* string, returning :" +"const:`True` or :const:`False`. Both parameters are case-normalized using :" "func:`os.path.normcase`. :func:`fnmatchcase` can be used to perform a case-" "sensitive comparison, regardless of whether that's standard for the " "operating system." msgstr "" -"ファイルの文字列 *name* がパターン文字列 *pat* にマッチするかテストして、 " -"``True`` または ``False`` のいずれかを返します。どちらの引数とも :func:`os." -"path.normcase` を使って、大文字、小文字が正規化されます。オペレーティングシス" -"テムが標準でどうなっているかに関係なく、大文字、小文字を区別して比較する場合" -"には、 :func:`fnmatchcase` が使用できます。" - -#: ../../library/fnmatch.rst:67 +"*filename* の文字列が *pattern* の文字列にマッチするかテストして、 :const:" +"`True` 、 :const:`False` のいずれかを返します。\n" +"どちらの引数とも :func:`os.path.normcase` を使って、大文字、小文字が正規化さ" +"れます。\n" +"オペレーティングシステムが標準でどうなっているかに関係なく、大文字、小文字を" +"区別して比較する場合には、 :func:`fnmatchcase` が使えます。" + +#: ../../library/fnmatch.rst:58 msgid "" "This example will print all file names in the current directory with the " "extension ``.txt``::" @@ -144,99 +132,42 @@ msgstr "" "次の例では、カレントディレクトリにある、拡張子が ``.txt`` である全てのファイ" "ルを表示しています::" -#: ../../library/fnmatch.rst:70 -msgid "" -"import fnmatch\n" -"import os\n" -"\n" -"for file in os.listdir('.'):\n" -" if fnmatch.fnmatch(file, '*.txt'):\n" -" print(file)" -msgstr "" - -#: ../../library/fnmatch.rst:80 -msgid "" -"Test whether the filename string *name* matches the pattern string *pat*, " -"returning ``True`` or ``False``; the comparison is case-sensitive and does " -"not apply :func:`os.path.normcase`." -msgstr "" -"ファイル名の文字列 *name* がパターン文字列 *pat* にマッチするかテストして、 " -"``True`` または ``False`` を返します。比較は大文字、小文字を区別し、 :func:" -"`os.path.normcase` は適用しません。" - -#: ../../library/fnmatch.rst:87 +#: ../../library/fnmatch.rst:71 msgid "" -"Construct a list from those elements of the :term:`iterable` of filename " -"strings *names* that match the pattern string *pat*. It is the same as ``[n " -"for n in names if fnmatch(n, pat)]``, but implemented more efficiently." +"Test whether *filename* matches *pattern*, returning :const:`True` or :const:" +"`False`; the comparison is case-sensitive and does not apply :func:`os.path." +"normcase`." msgstr "" +"*filename* が *pattern* にマッチするかテストして、 :const:`True` 、 :const:" +"`False` を返します。比較は大文字、小文字を区別し、 :func:`os.path.normcase` " +"は適用しません。" -#: ../../library/fnmatch.rst:95 +#: ../../library/fnmatch.rst:78 msgid "" -"Construct a list from those elements of the :term:`iterable` of filename " -"strings *names* that do not match the pattern string *pat*. It is the same " -"as ``[n for n in names if not fnmatch(n, pat)]``, but implemented more " -"efficiently." +"Construct a list from those elements of the iterable *names* that match " +"*pattern*. It is the same as ``[n for n in names if fnmatch(n, pattern)]``, " +"but implemented more efficiently." msgstr "" +"*pattern* にマッチするイテラブルの *names* を要素とするリストを構築します。\n" +"``[n for n in names if fnmatch(n, pattern)]`` と同じですが、もっと効率よく実" +"装されています。" -#: ../../library/fnmatch.rst:105 +#: ../../library/fnmatch.rst:84 msgid "" -"Return the shell-style pattern *pat* converted to a regular expression for " -"using with :func:`re.match`. The pattern is expected to be a :class:`str`." +"Return the shell-style *pattern* converted to a regular expression for using " +"with :func:`re.match`." msgstr "" +"シェルスタイルの *pattern* を、:func:`re.match` で使用するための正規表現に変" +"換して返します。" -#: ../../library/fnmatch.rst:108 +#: ../../library/fnmatch.rst:87 msgid "Example:" msgstr "例:" -#: ../../library/fnmatch.rst:122 +#: ../../library/fnmatch.rst:101 msgid "Module :mod:`glob`" msgstr ":mod:`glob` モジュール" -#: ../../library/fnmatch.rst:123 +#: ../../library/fnmatch.rst:102 msgid "Unix shell-style path expansion." msgstr "Unix シェル形式のパス展開。" - -#: ../../library/fnmatch.rst:9 -msgid "filenames" -msgstr "filenames" - -#: ../../library/fnmatch.rst:9 -msgid "wildcard expansion" -msgstr "ワイルドカード展開" - -#: ../../library/fnmatch.rst:11 ../../library/fnmatch.rst:41 -msgid "module" -msgstr "module" - -#: ../../library/fnmatch.rst:11 -msgid "re" -msgstr "re" - -#: ../../library/fnmatch.rst:19 -msgid "* (asterisk)" -msgstr "* (アスタリスク)" - -#: ../../library/fnmatch.rst:19 -msgid "in glob-style wildcards" -msgstr "glob 形式のワイルドカード" - -#: ../../library/fnmatch.rst:19 -msgid "? (question mark)" -msgstr "? (クエスチョンマーク)" - -#: ../../library/fnmatch.rst:19 -msgid "[] (square brackets)" -msgstr "[] (角カッコ)" - -#: ../../library/fnmatch.rst:19 -msgid "! (exclamation)" -msgstr "! (エクスクラメーション)" - -#: ../../library/fnmatch.rst:19 -msgid "- (minus)" -msgstr "- (負符号)" - -#: ../../library/fnmatch.rst:41 -msgid "glob" -msgstr "glob" diff --git a/library/formatter.po b/library/formatter.po new file mode 100644 index 000000000..697bb86cb --- /dev/null +++ b/library/formatter.po @@ -0,0 +1,536 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2001-2021, Python Software Foundation +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +# Translators: +# E. Kawashima, 2017 +# Arihiro TAKASE, 2017 +# Osamu NAKAMURA, 2021 +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python 3.9\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 23:11+0000\n" +"Last-Translator: Osamu NAKAMURA, 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" +"ja/)\n" +"Language: ja\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" + +#: ../../library/formatter.rst:2 +msgid ":mod:`formatter` --- Generic output formatting" +msgstr ":mod:`formatter` --- 汎用の出力書式化機構" + +#: ../../library/formatter.rst:8 +msgid "Due to lack of usage, the formatter module has been deprecated." +msgstr "使用法がないため formatter モジュールは非推奨になりました。" + +#: ../../library/formatter.rst:13 +msgid "" +"This module supports two interface definitions, each with multiple " +"implementations: The *formatter* interface, and the *writer* interface which " +"is required by the formatter interface." +msgstr "" +"このモジュールでは、二つのインターフェース定義を提供しており、それらの各イン" +"ターフェースについて複数の実装を提供しています。*formatter* インターフェース" +"と、formatter インターフェースに必要なされる *writer* インターフェースです。" + +#: ../../library/formatter.rst:17 +msgid "" +"Formatter objects transform an abstract flow of formatting events into " +"specific output events on writer objects. Formatters manage several stack " +"structures to allow various properties of a writer object to be changed and " +"restored; writers need not be able to handle relative changes nor any sort " +"of \"change back\" operation. Specific writer properties which may be " +"controlled via formatter objects are horizontal alignment, font, and left " +"margin indentations. A mechanism is provided which supports providing " +"arbitrary, non-exclusive style settings to a writer as well. Additional " +"interfaces facilitate formatting events which are not reversible, such as " +"paragraph separation." +msgstr "" +"formatter オブジェクトはある抽象化された書式イベントの流れを writer オブジェ" +"クト上の特定の出力イベントに変換します。formatter はいくつかのスタック構造を" +"管理することで、writer オブジェクトの様々な属性を変更したり復元したりできる" +"ようにしています; このため、writer は相対的な変更や \"元に戻す\" 操作を処理で" +"きなくてもかまいません。writer の特定のプロパティのうち、formatter オブジェク" +"トを介して制御できるのは、水平方向の字揃え、フォント、そして左マージンの字下" +"げです。任意の、非排他的なスタイル設定を writer に提供するためのメカニズムも" +"提供されています。さらに、段落分割のように、可逆でない書式化イベントの機能を" +"提供するインターフェースもあります。" + +#: ../../library/formatter.rst:27 +msgid "" +"Writer objects encapsulate device interfaces. Abstract devices, such as " +"file formats, are supported as well as physical devices. The provided " +"implementations all work with abstract devices. The interface makes " +"available mechanisms for setting the properties which formatter objects " +"manage and inserting data into the output." +msgstr "" +"writer オブジェクトはデバイスインターフェースをカプセル化します。ファイル形式" +"のような抽象デバイスも物理デバイス同様にサポートされています。ここで提供され" +"ている実装内容はすべて抽象デバイス上で動作します。デバイスインターフェースは " +"formatter オブジェクトが管理しているプロパティを設定し、データを出力端に書き" +"込めるようにします。" + +#: ../../library/formatter.rst:37 +msgid "The Formatter Interface" +msgstr "formatter インターフェース" + +#: ../../library/formatter.rst:39 +msgid "" +"Interfaces to create formatters are dependent on the specific formatter " +"class being instantiated. The interfaces described below are the required " +"interfaces which all formatters must support once initialized." +msgstr "" +"formatter を作成するためのインターフェースは、インスタンス化しようとする個々" +"の formatter クラスに依存します。以下で解説するのは、インスタンス化された全て" +"の formatter がサポートしなければならないインターフェースです。" + +#: ../../library/formatter.rst:43 +msgid "One data element is defined at the module level:" +msgstr "モジュールレベルではデータ要素を一つ定義しています:" + +#: ../../library/formatter.rst:48 +msgid "" +"Value which can be used in the font specification passed to the " +"``push_font()`` method described below, or as the new value to any other " +"``push_property()`` method. Pushing the ``AS_IS`` value allows the " +"corresponding ``pop_property()`` method to be called without having to track " +"whether the property was changed." +msgstr "" +"後に述べる ``push_font()`` メソッドでフォント指定をする時に使える値です。ま" +"た、その他の ``push_property()`` メソッドの新しい値として使うことができます。" +"``AS_IS`` の値をスタックに置くと、どのプロパティが変更されたかの追跡を行わず" +"に、対応する ``pop_property()`` メソッドが呼び出されるようになります。" + +#: ../../library/formatter.rst:53 +msgid "The following attributes are defined for formatter instance objects:" +msgstr "formatter インスタンスオブジェクトには以下の属性が定義されています:" + +#: ../../library/formatter.rst:58 +msgid "The writer instance with which the formatter interacts." +msgstr "formatter とやり取りを行う writer インスタンスです。" + +#: ../../library/formatter.rst:63 +msgid "" +"Close any open paragraphs and insert at least *blanklines* before the next " +"paragraph." +msgstr "" +"開かれている段落があれば閉じ、次の段落との間に少なくとも *blanklines* が挿入" +"されるようにします。" + +#: ../../library/formatter.rst:69 +msgid "" +"Add a hard line break if one does not already exist. This does not break " +"the logical paragraph." +msgstr "" +"強制改行挿入します。既に強制改行がある場合は挿入しません。論理的な段落は中断" +"しません。" + +#: ../../library/formatter.rst:75 +msgid "" +"Insert a horizontal rule in the output. A hard break is inserted if there " +"is data in the current paragraph, but the logical paragraph is not broken. " +"The arguments and keywords are passed on to the writer's :meth:" +"`send_line_break` method." +msgstr "" +"出力に水平罫線を挿入します。現在の段落に何らかのデータがある場合、強制改行が" +"挿入されますが、論理的な段落は中断しません。引数とキーワードは writer の :" +"meth:`send_line_break` メソッドに渡されます。" + +#: ../../library/formatter.rst:83 +msgid "" +"Provide data which should be formatted with collapsed whitespace. Whitespace " +"from preceding and successive calls to :meth:`add_flowing_data` is " +"considered as well when the whitespace collapse is performed. The data " +"which is passed to this method is expected to be word-wrapped by the output " +"device. Note that any word-wrapping still must be performed by the writer " +"object due to the need to rely on device and font information." +msgstr "" +"空白を折りたたんで書式化しなければならないデータを提供します。空白の折りたた" +"みでは、直前や直後の :meth:`add_flowing_data` 呼び出しに入っている空白も考慮" +"されます。このメソッドに渡されたデータは出力デバイスで行末の折り返し (word-" +"wrap) されるものと想定されています。出力デバイスでの要求やフォント情報に応じ" +"て、writer オブジェクトでも何らかの行末折り返しが行われなければならないので注" +"意してください。" + +#: ../../library/formatter.rst:93 +msgid "" +"Provide data which should be passed to the writer unchanged. Whitespace, " +"including newline and tab characters, are considered legal in the value of " +"*data*." +msgstr "" +"変更を加えずに writer に渡さなければならないデータを提供します。改行およびタ" +"ブを含む空白を *data* の値にしても問題ありません。" + +#: ../../library/formatter.rst:100 +msgid "" +"Insert a label which should be placed to the left of the current left " +"margin. This should be used for constructing bulleted or numbered lists. If " +"the *format* value is a string, it is interpreted as a format specification " +"for *counter*, which should be an integer. The result of this formatting " +"becomes the value of the label; if *format* is not a string it is used as " +"the label value directly. The label value is passed as the only argument to " +"the writer's :meth:`send_label_data` method. Interpretation of non-string " +"label values is dependent on the associated writer." +msgstr "" +"現在の左マージン位置の左側に配置されるラベルを挿入します。このラベルは箇条書" +"き、数字つき箇条書きの書式を構築する際に使われます。 *format* の値が文字列の" +"場合、整数の値 *counter* の書式指定として解釈されます。 *format* の値が文字列" +"の場合、整数の値をとる *counter* の書式化指定として解釈されます。書式化された" +"文字列はラベルの値になります; *format* が文字列でない場合、ラベルの値として直" +"接使われます。ラベルの値は writer の :meth:`send_label_data` メソッドの唯一の" +"引数として渡されます。非文字列のラベル値をどう解釈するかは関連付けられた " +"writer に依存します。" + +#: ../../library/formatter.rst:109 +msgid "" +"Format specifications are strings which, in combination with a counter " +"value, are used to compute label values. Each character in the format " +"string is copied to the label value, with some characters recognized to " +"indicate a transform on the counter value. Specifically, the character " +"``'1'`` represents the counter value formatter as an Arabic number, the " +"characters ``'A'`` and ``'a'`` represent alphabetic representations of the " +"counter value in upper and lower case, respectively, and ``'I'`` and ``'i'`` " +"represent the counter value in Roman numerals, in upper and lower case. " +"Note that the alphabetic and roman transforms require that the counter value " +"be greater than zero." +msgstr "" +"書式化指定は文字列からなり、counter の値と合わせてラベルの値を算出するために" +"使われます。書式文字列の各文字はラベル値にコピーされます。このときいくつかの" +"文字は counter 値を変換を指すものとして認識されます。特に、文字 ``'1'`` はア" +"ラビア数字の counter 値を表し、``'A'`` と ``'a'`` はそれぞれ大文字および小文" +"字のアルファベットによる counter 値を表し、``'I'`` と ``'i'`` はそれぞれ大文" +"字および小文字のローマ数字による counter 値を表します。アルファベットおよび" +"ローマ字数字への変換の際には、counter の値はゼロ以上である必要があるので注意" +"してください。" + +#: ../../library/formatter.rst:122 +msgid "" +"Send any pending whitespace buffered from a previous call to :meth:" +"`add_flowing_data` to the associated writer object. This should be called " +"before any direct manipulation of the writer object." +msgstr "" +"以前の :meth:`add_flowing_data` 呼び出しでバッファされている出力待ちの空白" +"を、関連付けられている writer オブジェクトに送信します。このメソッドは " +"writer オブジェクトに対するあらゆる直接操作の前に呼び出さなければなりません。" + +#: ../../library/formatter.rst:129 +msgid "" +"Push a new alignment setting onto the alignment stack. This may be :const:" +"`AS_IS` if no change is desired. If the alignment value is changed from the " +"previous setting, the writer's :meth:`new_alignment` method is called with " +"the *align* value." +msgstr "" +"新たな字揃え (alignment) 設定を字揃えスタックの上にプッシュします。変更を行い" +"たくない場合には :const:`AS_IS` にすることができます。字揃え設定値が以前の設" +"定から変更された場合、writer の :meth:`new_alignment` メソッドが *align* の" +"値と共に呼び出されます。" + +#: ../../library/formatter.rst:137 +msgid "Restore the previous alignment." +msgstr "以前の字揃え設定を復元します。" + +#: ../../library/formatter.rst:142 +msgid "" +"Change some or all font properties of the writer object. Properties which " +"are not set to :const:`AS_IS` are set to the values passed in while others " +"are maintained at their current settings. The writer's :meth:`new_font` " +"method is called with the fully resolved font specification." +msgstr "" +"writer オブジェクトのフォントプロパティのうち、一部または全てを変更します。 :" +"const:`AS_IS` に設定されていないプロパティは引数で渡された値に設定され、その" +"他の値は現在の設定を維持します。writer の :meth:`new_font` メソッドは完全に設" +"定解決されたフォント指定で呼び出されます。" + +#: ../../library/formatter.rst:150 +msgid "Restore the previous font." +msgstr "以前のフォント設定を復元します。" + +#: ../../library/formatter.rst:155 +msgid "" +"Increase the number of left margin indentations by one, associating the " +"logical tag *margin* with the new indentation. The initial margin level is " +"``0``. Changed values of the logical tag must be true values; false values " +"other than :const:`AS_IS` are not sufficient to change the margin." +msgstr "" +"左マージンのインデント数を一つ増やし、論理タグ *margin* を新たなインデントに" +"関連付けます。マージンレベルの初期値は ``0`` です。変更された論理タグの値は真" +"値とならなければなりません; :const:`AS_IS` 以外の偽の値はマージンの変更とし" +"ては不適切です。" + +#: ../../library/formatter.rst:163 +msgid "Restore the previous margin." +msgstr "以前のマージン設定を復元します。" + +#: ../../library/formatter.rst:168 +msgid "" +"Push any number of arbitrary style specifications. All styles are pushed " +"onto the styles stack in order. A tuple representing the entire stack, " +"including :const:`AS_IS` values, is passed to the writer's :meth:" +"`new_styles` method." +msgstr "" +"任意のスタイル指定をスタックにプッシュします。全てのスタイルはスタイルスタッ" +"クに順番にプッシュされます。 :const:`AS_IS` 値を含み、スタック全体を表すタプ" +"ルは writer の :meth:`new_styles` メソッドに渡されます。" + +#: ../../library/formatter.rst:175 +msgid "" +"Pop the last *n* style specifications passed to :meth:`push_style`. A tuple " +"representing the revised stack, including :const:`AS_IS` values, is passed " +"to the writer's :meth:`new_styles` method." +msgstr "" +":meth:`push_style` に渡された最新 *n* 個のスタイル指定をポップします。 :" +"const:`AS_IS` 値を含み、変更されたスタックを表すタプルは writer の :meth:" +"`new_styles` メソッドに渡されます。" + +#: ../../library/formatter.rst:182 +msgid "Set the spacing style for the writer." +msgstr "writer の割り付けスタイル (spacing style) を設定します。" + +#: ../../library/formatter.rst:187 +msgid "" +"Inform the formatter that data has been added to the current paragraph out-" +"of-band. This should be used when the writer has been manipulated " +"directly. The optional *flag* argument can be set to false if the writer " +"manipulations produced a hard line break at the end of the output." +msgstr "" +"現在の段落にデータが予期せず追加されたことを formatter に知らせます。このメ" +"ソッドは writer を直接操作した際に使わなければなりません。writer 操作の結果、" +"出力の末尾が強制改行となった場合、オプションの *flag* 引数を偽に設定すること" +"ができます。" + +#: ../../library/formatter.rst:196 +msgid "Formatter Implementations" +msgstr "formatter 実装" + +#: ../../library/formatter.rst:198 +msgid "" +"Two implementations of formatter objects are provided by this module. Most " +"applications may use one of these classes without modification or " +"subclassing." +msgstr "" +"このモジュールでは、formatter オブジェクトに関して二つの実装を提供していま" +"す。ほとんどのアプリケーションではこれらのクラスを変更したりサブクラス化する" +"ことなく使うことができます。" + +#: ../../library/formatter.rst:204 +msgid "" +"A formatter which does nothing. If *writer* is omitted, a :class:" +"`NullWriter` instance is created. No methods of the writer are called by :" +"class:`NullFormatter` instances. Implementations should inherit from this " +"class if implementing a writer interface but don't need to inherit any " +"implementation." +msgstr "" +"何も行わない formatter です。 *writer* を省略すると、 :class:`NullWriter` イ" +"ンスタンスが生成されます。 :class:`NullFormatter` インスタンスは、writer のメ" +"ソッドを全く呼び出しません。writer へのインターフェースを実装する場合にはこの" +"クラスのインターフェースを継承する必要がありますが、実装を継承する必要は全く" +"ありません。" + +#: ../../library/formatter.rst:213 +msgid "" +"The standard formatter. This implementation has demonstrated wide " +"applicability to many writers, and may be used directly in most " +"circumstances. It has been used to implement a full-featured World Wide Web " +"browser." +msgstr "" +"標準の formatter です。この formatter 実装は広範な writer で適用できることが" +"実証されており、ほとんどの状況で直接使うことができます。高機能の WWW ブラウザ" +"を実装するために使われたこともあります。" + +#: ../../library/formatter.rst:221 +msgid "The Writer Interface" +msgstr "writer インターフェース" + +#: ../../library/formatter.rst:223 +msgid "" +"Interfaces to create writers are dependent on the specific writer class " +"being instantiated. The interfaces described below are the required " +"interfaces which all writers must support once initialized. Note that while " +"most applications can use the :class:`AbstractFormatter` class as a " +"formatter, the writer must typically be provided by the application." +msgstr "" +"writer を作成するためのインターフェースは、インスタンス化しようとする個々の " +"writer クラスに依存します。以下で解説するのは、インスタンス化された全ての " +"writer がサポートしなければならないインターフェースです。ほとんどのアプリケー" +"ションでは :class:`AbstractFormatter` クラスを formatter として使うことができ" +"ますが、通常 writer はアプリケーション側で与えなければならないので注意してく" +"ださい。" + +#: ../../library/formatter.rst:232 +msgid "Flush any buffered output or device control events." +msgstr "" +"バッファに蓄積されている出力データやデバイス制御イベントをフラッシュします。" + +#: ../../library/formatter.rst:237 +msgid "" +"Set the alignment style. The *align* value can be any object, but by " +"convention is a string or ``None``, where ``None`` indicates that the " +"writer's \"preferred\" alignment should be used. Conventional *align* values " +"are ``'left'``, ``'center'``, ``'right'``, and ``'justify'``." +msgstr "" +"字揃えのスタイルを設定します。*align* の値は任意のオブジェクトを取りえます" +"が、慣習的な値は文字列または ``None`` で、``None`` は writer の \"好む\" 字揃" +"えを使うことを表します。慣習的な *align* の値は ``'left'``、``'center'``、" +"``'right'``、および ``'justify'`` です。" + +#: ../../library/formatter.rst:245 +msgid "" +"Set the font style. The value of *font* will be ``None``, indicating that " +"the device's default font should be used, or a tuple of the form ``(size, " +"italic, bold, teletype)``. Size will be a string indicating the size of " +"font that should be used; specific strings and their interpretation must be " +"defined by the application. The *italic*, *bold*, and *teletype* values are " +"Boolean values specifying which of those font attributes should be used." +msgstr "" +"フォントスタイルを設定します。*font* は、デバイスの標準のフォントが使われるこ" +"とを示す ``None`` か、``(size, italic, bold, teletype)`` の形式をとるタプルに" +"なります。size はフォントサイズを示す文字列になります; 特定の文字列やその解釈" +"はアプリケーション側で定義します。*italic*、*bold*、および *teletype* といっ" +"た値はブール値で、それらの属性を使うかどうかを指定します。" + +#: ../../library/formatter.rst:255 +msgid "" +"Set the margin level to the integer *level* and the logical tag to *margin*. " +"Interpretation of the logical tag is at the writer's discretion; the only " +"restriction on the value of the logical tag is that it not be a false value " +"for non-zero values of *level*." +msgstr "" +"マージンレベルを整数値 *level* に設定し、論理タグ (logical tag) を *margin* " +"に設定します。論理タグの解釈は writer の判断に任されます; 論理タグの値に対す" +"る唯一の制限は *level* が非ゼロの値の際に偽であってはならないということです。" + +#: ../../library/formatter.rst:263 +msgid "Set the spacing style to *spacing*." +msgstr "割り付けスタイル (spacing style) を *spacing* に設定します。" + +#: ../../library/formatter.rst:268 +msgid "" +"Set additional styles. The *styles* value is a tuple of arbitrary values; " +"the value :const:`AS_IS` should be ignored. The *styles* tuple may be " +"interpreted either as a set or as a stack depending on the requirements of " +"the application and writer implementation." +msgstr "" +"追加のスタイルを設定します。 *styles* の値は任意の値からなるタプルです; :" +"const:`AS_IS` 値は無視されます。 *styles* タプルはアプリケーションや writer " +"の実装上の都合により、集合としても、スタックとしても解釈され得ます。" + +#: ../../library/formatter.rst:276 +msgid "Break the current line." +msgstr "現在の行を改行します。" + +#: ../../library/formatter.rst:281 +msgid "" +"Produce a paragraph separation of at least *blankline* blank lines, or the " +"equivalent. The *blankline* value will be an integer. Note that the " +"implementation will receive a call to :meth:`send_line_break` before this " +"call if a line break is needed; this method should not include ending the " +"last line of the paragraph. It is only responsible for vertical spacing " +"between paragraphs." +msgstr "" +"少なくとも *blankline* 空行分の間隔か、空行そのもので段落を分割します。 " +"*blankline* の値は整数になります。 writer の実装では、改行を行う必要がある場" +"合、このメソッドの呼び出しに先立って :meth:`send_line_break` の呼び出しを受け" +"る必要あります; このメソッドには段落の最後の行を閉じる機能は含まれておらず、" +"段落間に垂直スペースを空ける役割しかありません。" + +#: ../../library/formatter.rst:291 +msgid "" +"Display a horizontal rule on the output device. The arguments to this " +"method are entirely application- and writer-specific, and should be " +"interpreted with care. The method implementation may assume that a line " +"break has already been issued via :meth:`send_line_break`." +msgstr "" +"水平罫線を出力デバイスに表示します。このメソッドへの引数は全てアプリケーショ" +"ンおよび writer 特有のものなので、注意して解釈する必要があります。このメソッ" +"ドの実装では、すでに改行が :meth:`send_line_break` によってなされているものと" +"仮定しています。" + +#: ../../library/formatter.rst:299 +msgid "" +"Output character data which may be word-wrapped and re-flowed as needed. " +"Within any sequence of calls to this method, the writer may assume that " +"spans of multiple whitespace characters have been collapsed to single space " +"characters." +msgstr "" +"行端が折り返され、必要に応じて再割り付け解析を行った (re-flowed) 文字データ" +"を出力します。このメソッドを連続して呼び出す上では、writer は複数の空白文字は" +"単一のスペース文字に縮約されていると仮定することがあります。" + +#: ../../library/formatter.rst:306 +msgid "" +"Output character data which has already been formatted for display. " +"Generally, this should be interpreted to mean that line breaks indicated by " +"newline characters should be preserved and no new line breaks should be " +"introduced. The data may contain embedded newline and tab characters, " +"unlike data provided to the :meth:`send_formatted_data` interface." +msgstr "" +"すでに表示用に書式化された文字データを出力します。これは通常、改行文字で表さ" +"れた改行を保存し、新たに改行を持ち込まないことを意味します。 :meth:" +"`send_formatted_data` インターフェースと違って、データには改行やタブ文字が埋" +"め込まれていてもかまいません。" + +#: ../../library/formatter.rst:315 +msgid "" +"Set *data* to the left of the current left margin, if possible. The value of " +"*data* is not restricted; treatment of non-string values is entirely " +"application- and writer-dependent. This method will only be called at the " +"beginning of a line." +msgstr "" +"可能ならば、*data* を現在の左マージンの左側に設定します。*data* の値には制限" +"がありません; 文字列でない値の扱い方はアプリケーションや writer に完全に依存" +"します。このメソッドは行の先頭でのみ呼び出されます。" + +#: ../../library/formatter.rst:324 +msgid "Writer Implementations" +msgstr "writer 実装" + +#: ../../library/formatter.rst:326 +msgid "" +"Three implementations of the writer object interface are provided as " +"examples by this module. Most applications will need to derive new writer " +"classes from the :class:`NullWriter` class." +msgstr "" +"このモジュールでは、3 種類の writer オブジェクトインターフェース実装を提供し" +"ています。ほとんどのアプリケーションでは、 :class:`NullWriter` から新しい " +"writer クラスを派生する必要があるでしょう。" + +#: ../../library/formatter.rst:333 +msgid "" +"A writer which only provides the interface definition; no actions are taken " +"on any methods. This should be the base class for all writers which do not " +"need to inherit any implementation methods." +msgstr "" +"インターフェース定義だけを提供する writer クラスです; どのメソッドも何ら処理" +"を行いません。このクラスは、メソッド実装をまったく継承する必要のない writer " +"全ての基底クラスになります。" + +#: ../../library/formatter.rst:340 +msgid "" +"A writer which can be used in debugging formatters, but not much else. Each " +"method simply announces itself by printing its name and arguments on " +"standard output." +msgstr "" +"この writer は formatter をデバッグするのに利用できますが、それ以外に利用でき" +"るほどのものではありません。各メソッドを呼び出すと、メソッド名と引数を標準出" +"力に印字して呼び出されたことを示します。" + +#: ../../library/formatter.rst:347 +msgid "" +"Simple writer class which writes output on the :term:`file object` passed in " +"as *file* or, if *file* is omitted, on standard output. The output is " +"simply word-wrapped to the number of columns specified by *maxcol*. This " +"class is suitable for reflowing a sequence of paragraphs." +msgstr "" +"単純な writer クラスで *file* に渡された :term:`ファイルオブジェクト ` か *file* が省略された場合には標準出力に出力を書き込みます。出力は " +"*maxcol* で指定されたカラム数で単純な行端折り返しが行われます。このクラスは連" +"続した段落を再割り付けするのに適しています。" diff --git a/library/fractions.po b/library/fractions.po index ae8b74eee..e55ebcc1e 100644 --- a/library/fractions.po +++ b/library/fractions.po @@ -1,32 +1,34 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Arihiro TAKASE, 2023 -# tomo, 2023 -# 石井明久, 2024 +# E. Kawashima, 2017 +# Shun Sakurai, 2017 +# Nozomu Kaneko , 2017 +# Arihiro TAKASE, 2017 +# tomo, 2021 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 01:06+0000\n" -"Last-Translator: 石井明久, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 23:11+0000\n" +"Last-Translator: tomo, 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/fractions.rst:2 -msgid ":mod:`!fractions` --- Rational numbers" -msgstr ":mod:`!fractions` --- 有理数" +msgid ":mod:`fractions` --- Rational numbers" +msgstr ":mod:`fractions` --- 有理数" #: ../../library/fractions.rst:10 msgid "**Source code:** :source:`Lib/fractions.py`" @@ -48,39 +50,38 @@ msgstr "" msgid "" "The first version requires that *numerator* and *denominator* are instances " "of :class:`numbers.Rational` and returns a new :class:`Fraction` instance " -"with value ``numerator/denominator``. If *denominator* is ``0``, it raises " -"a :exc:`ZeroDivisionError`." -msgstr "" - -#: ../../library/fractions.rst:31 -msgid "" -"The second version requires that *number* is an instance of :class:`numbers." -"Rational` or has the :meth:`!as_integer_ratio` method (this includes :class:" -"`float` and :class:`decimal.Decimal`). It returns a :class:`Fraction` " -"instance with exactly the same value. Assumed, that the :meth:`!" -"as_integer_ratio` method returns a pair of coprime integers and last one is " -"positive. Note that due to the usual issues with binary point (see :ref:`tut-" -"fp-issues`), the argument to ``Fraction(1.1)`` is not exactly equal to " -"11/10, and so ``Fraction(1.1)`` does *not* return ``Fraction(11, 10)`` as " -"one might expect. (But see the documentation for the :meth:" -"`limit_denominator` method below.)" -msgstr "" +"with value ``numerator/denominator``. If *denominator* is :const:`0`, it " +"raises a :exc:`ZeroDivisionError`. The second version requires that " +"*other_fraction* is an instance of :class:`numbers.Rational` and returns a :" +"class:`Fraction` instance with the same value. The next two versions accept " +"either a :class:`float` or a :class:`decimal.Decimal` instance, and return " +"a :class:`Fraction` instance with exactly the same value. Note that due to " +"the usual issues with binary floating-point (see :ref:`tut-fp-issues`), the " +"argument to ``Fraction(1.1)`` is not exactly equal to 11/10, and so " +"``Fraction(1.1)`` does *not* return ``Fraction(11, 10)`` as one might " +"expect. (But see the documentation for the :meth:`limit_denominator` method " +"below.) The last version of the constructor expects a string or unicode " +"instance. The usual form for this instance is::" +msgstr "" +"最初のバージョンは *numerator* と *denominator* が :class:`numbers.Rational` " +"のインスタンスであることを要求し、 ``numerator/denominator`` の値を持つ新し" +"い :class:`Fraction` インスタンスを返します。 *denominator* が :const:`0` な" +"らば、 :exc:`ZeroDivisionError` を送出します。二番目のバージョンは " +"*other_fraction* が :class:`numbers.Rational` のインスタンスであることを要求" +"し、同じ値を持つ新しい :class:`Fraction` インスタンスを返します。その次の二つ" +"のバージョンは、 :class:`float` と :class:`decimal.Decimal` インスタンスを受" +"け付け、それとちょうど同じ値を持つ :class:`Fraction` インスタンスを返します。" +"なお、二進浮動小数点数にお決まりの問題 (:ref:`tut-fp-issues` 参照) のため、 " +"``Fraction(1.1)`` の引数は 11/10 と正確に等しいとは言えないので、 " +"``Fraction(1.1)`` は予期した通りの ``Fraction(11, 10)`` を返し *ません* 。(た" +"だし、以下の :meth:`limit_denominator` メソッドのドキュメントを参照してくださ" +"い。) 最後のバージョンは、文字列またはユニコードのインスタンスを渡されること" +"を想定します。このインスタンスは、通常、次のような形式です::" #: ../../library/fractions.rst:43 msgid "" -"The last version of the constructor expects a string. The usual form for " -"this instance is::" -msgstr "" - -#: ../../library/fractions.rst:46 -msgid "[sign] numerator ['/' denominator]" -msgstr "" - -#: ../../library/fractions.rst:48 -msgid "" "where the optional ``sign`` may be either '+' or '-' and ``numerator`` and " -"``denominator`` (if present) are strings of decimal digits (underscores may " -"be used to delimit digits as with integral literals in code). In addition, " +"``denominator`` (if present) are strings of decimal digits. In addition, " "any string that represents a finite value and is accepted by the :class:" "`float` constructor is also accepted by the :class:`Fraction` constructor. " "In either form the input string may also have leading and/or trailing " @@ -88,53 +89,25 @@ msgid "" msgstr "" "ここで、オプションの ``sign`` は '+' か '-' のどちらかであり、\\ " "``numerator`` および (存在する場合) ``denominator`` は十進数の数字の文字列で" -"す (コード中の整数リテラルと同様、アンダースコアを使って桁を区切れます)。さら" -"に、 :class:`float` コンストラクタで受け付けられる有限の値を表す文字列は、:" -"class:`Fraction` コンストラクタでも受け付けられます。どちらの形式でも、入力さ" -"れる文字列は前後に空白があって構いません。以下に、いくつかの例を示します::" +"す。さらに、 :class:`float` コンストラクタで受け付けられる有限の値を表す文字" +"列は、:class:`Fraction` コンストラクタでも受け付けられます。どちらの形式で" +"も、入力される文字列は前後に空白があって構いません。以下に、いくつかの例を示" +"します::" -#: ../../library/fractions.rst:57 -msgid "" -">>> from fractions import Fraction\n" -">>> Fraction(16, -10)\n" -"Fraction(-8, 5)\n" -">>> Fraction(123)\n" -"Fraction(123, 1)\n" -">>> Fraction()\n" -"Fraction(0, 1)\n" -">>> Fraction('3/7')\n" -"Fraction(3, 7)\n" -">>> Fraction(' -3/7 ')\n" -"Fraction(-3, 7)\n" -">>> Fraction('1.414213 \\t\\n')\n" -"Fraction(1414213, 1000000)\n" -">>> Fraction('-.125')\n" -"Fraction(-1, 8)\n" -">>> Fraction('7e-6')\n" -"Fraction(7, 1000000)\n" -">>> Fraction(2.25)\n" -"Fraction(9, 4)\n" -">>> Fraction(1.1)\n" -"Fraction(2476979795053773, 2251799813685248)\n" -">>> from decimal import Decimal\n" -">>> Fraction(Decimal('1.1'))\n" -"Fraction(11, 10)" -msgstr "" - -#: ../../library/fractions.rst:83 +#: ../../library/fractions.rst:77 msgid "" "The :class:`Fraction` class inherits from the abstract base class :class:" "`numbers.Rational`, and implements all of the methods and operations from " -"that class. :class:`Fraction` instances are :term:`hashable`, and should be " -"treated as immutable. In addition, :class:`Fraction` has the following " -"properties and methods:" +"that class. :class:`Fraction` instances are hashable, and should be treated " +"as immutable. In addition, :class:`Fraction` has the following properties " +"and methods:" msgstr "" ":class:`Fraction` クラスは抽象基底クラス :class:`numbers.Rational` を継承し、" -"その全てのメソッドと演算を実装します。 :class:`Fraction` インスタンスは :" -"term:`ハッシュ可能 ` で、不変 (immutable) であるものとして扱われま" -"す。加えて、 :class:`Fraction` には以下のプロパティとメソッドがあります:" +"その全てのメソッドと演算を実装します。 :class:`Fraction` インスタンスはハッ" +"シュ可能で、不変 (immutable) であるものとして扱われます。加えて、 :class:" +"`Fraction` には以下のプロパティとメソッドがあります:" -#: ../../library/fractions.rst:89 +#: ../../library/fractions.rst:83 msgid "" "The :class:`Fraction` constructor now accepts :class:`float` and :class:" "`decimal.Decimal` instances." @@ -142,75 +115,45 @@ msgstr "" ":class:`Fraction` のコンストラクタが :class:`float` および :class:`decimal." "Decimal` インスタンスを受け付けるようになりました。" -#: ../../library/fractions.rst:93 +#: ../../library/fractions.rst:87 msgid "" "The :func:`math.gcd` function is now used to normalize the *numerator* and " -"*denominator*. :func:`math.gcd` always returns an :class:`int` type. " +"*denominator*. :func:`math.gcd` always return a :class:`int` type. " "Previously, the GCD type depended on *numerator* and *denominator*." msgstr "" +"今は :func:`math.gcd` 関数が *分子* (numerator) と *分母* (denominator) の約" +"分で使われています。\n" +":func:`math.gcd` は常に :class:`int` 型の値を返します。\n" +"以前は、GCDの型は分子と分母に依存していました。" -#: ../../library/fractions.rst:98 -msgid "" -"Underscores are now permitted when creating a :class:`Fraction` instance " -"from a string, following :PEP:`515` rules." -msgstr "" - -#: ../../library/fractions.rst:102 -msgid "" -":class:`Fraction` implements ``__int__`` now to satisfy ``typing." -"SupportsInt`` instance checks." -msgstr "" - -#: ../../library/fractions.rst:106 -msgid "" -"Space is allowed around the slash for string inputs: ``Fraction('2 / 3')``." -msgstr "" - -#: ../../library/fractions.rst:109 -msgid "" -":class:`Fraction` instances now support float-style formatting, with " -"presentation types ``\"e\"``, ``\"E\"``, ``\"f\"``, ``\"F\"``, ``\"g\"``, " -"``\"G\"`` and ``\"%\"\"``." -msgstr "" - -#: ../../library/fractions.rst:114 -msgid "" -"Formatting of :class:`Fraction` instances without a presentation type now " -"supports fill, alignment, sign handling, minimum width and grouping." -msgstr "" - -#: ../../library/fractions.rst:118 -msgid "" -"The :class:`Fraction` constructor now accepts any objects with the :meth:`!" -"as_integer_ratio` method." -msgstr "" - -#: ../../library/fractions.rst:124 +#: ../../library/fractions.rst:94 msgid "Numerator of the Fraction in lowest term." msgstr "有理数を既約分数で表したときの分子。" -#: ../../library/fractions.rst:128 +#: ../../library/fractions.rst:98 msgid "Denominator of the Fraction in lowest term." msgstr "有理数を既約分数で表したときの分母。" -#: ../../library/fractions.rst:133 +#: ../../library/fractions.rst:103 msgid "" -"Return a tuple of two integers, whose ratio is equal to the original " -"Fraction. The ratio is in lowest terms and has a positive denominator." +"Return a tuple of two integers, whose ratio is equal to the Fraction and " +"with a positive denominator." msgstr "" +"2 つの整数からなるタプルで、比が Fraction インスタンスと等しく、分母が正にな" +"るものを返します。" -#: ../../library/fractions.rst:141 -msgid "Return ``True`` if the Fraction is an integer." -msgstr "" - -#: ../../library/fractions.rst:147 +#: ../../library/fractions.rst:110 msgid "" -"Alternative constructor which only accepts instances of :class:`float` or :" -"class:`numbers.Integral`. Beware that ``Fraction.from_float(0.3)`` is not " -"the same value as ``Fraction(3, 10)``." +"This class method constructs a :class:`Fraction` representing the exact " +"value of *flt*, which must be a :class:`float`. Beware that ``Fraction." +"from_float(0.3)`` is not the same value as ``Fraction(3, 10)``." msgstr "" +"このクラスメソッドは :class:`float` である *flt* の正確な値を表す :class:" +"`Fraction` を構築します。\n" +"``Fraction.from_float(0.3)`` と ``Fraction(3, 10)`` の値は同じでないことに注" +"意してください 。" -#: ../../library/fractions.rst:153 +#: ../../library/fractions.rst:116 msgid "" "From Python 3.2 onwards, you can also construct a :class:`Fraction` instance " "directly from a :class:`float`." @@ -218,13 +161,15 @@ msgstr "" "Python 3.2 以降では、 :class:`float` から直接 :class:`Fraction` インスタンス" "を構築できるようになりました。" -#: ../../library/fractions.rst:159 +#: ../../library/fractions.rst:122 msgid "" -"Alternative constructor which only accepts instances of :class:`decimal." -"Decimal` or :class:`numbers.Integral`." +"This class method constructs a :class:`Fraction` representing the exact " +"value of *dec*, which must be a :class:`decimal.Decimal` instance." msgstr "" +"このクラスメソッドは :class:`decimal.Decimal` インスタンスである *dec* の正確" +"な値を表す :class:`Fraction` を構築します。" -#: ../../library/fractions.rst:164 +#: ../../library/fractions.rst:127 msgid "" "From Python 3.2 onwards, you can also construct a :class:`Fraction` instance " "directly from a :class:`decimal.Decimal` instance." @@ -232,15 +177,7 @@ msgstr "" "Python 3.2 以降では、 :class:`decimal.Decimal` インスタンスから直接 :class:" "`Fraction` インスタンスを構築できるようになりました。" -#: ../../library/fractions.rst:171 -msgid "" -"Alternative constructor which only accepts instances of :class:`numbers." -"Integral`, :class:`numbers.Rational`, :class:`float` or :class:`decimal." -"Decimal`, and objects with the :meth:`!as_integer_ratio` method, but not " -"strings." -msgstr "" - -#: ../../library/fractions.rst:181 +#: ../../library/fractions.rst:134 msgid "" "Finds and returns the closest :class:`Fraction` to ``self`` that has " "denominator at most max_denominator. This method is useful for finding " @@ -250,11 +187,11 @@ msgstr "" "見付けて返します。このメソッドは与えられた浮動小数点数の有理数近似を見つける" "のに役立ちます:" -#: ../../library/fractions.rst:189 +#: ../../library/fractions.rst:142 msgid "or for recovering a rational number that's represented as a float:" msgstr "あるいは float で表された有理数を元に戻すのにも使えます:" -#: ../../library/fractions.rst:202 +#: ../../library/fractions.rst:155 msgid "" "Returns the greatest :class:`int` ``<= self``. This method can also be " "accessed through the :func:`math.floor` function:" @@ -262,7 +199,7 @@ msgstr "" "最大の :class:`int` ``<= self`` を返します。このメソッドは :func:`math." "floor` 関数からでもアクセスできます:" -#: ../../library/fractions.rst:212 +#: ../../library/fractions.rst:165 msgid "" "Returns the least :class:`int` ``>= self``. This method can also be " "accessed through the :func:`math.ceil` function." @@ -270,7 +207,7 @@ msgstr "" "最小の :class:`int` ``>= self`` を返します。このメソッドは :func:`math.ceil` " "関数からでもアクセスできます。" -#: ../../library/fractions.rst:219 +#: ../../library/fractions.rst:172 msgid "" "The first version returns the nearest :class:`int` to ``self``, rounding " "half to even. The second version rounds ``self`` to the nearest multiple of " @@ -283,67 +220,10 @@ msgstr "" "10**ndigits)`` の倍数 (論理的に、 ``ndigits`` が負なら) を、これも偶数丸めで" "丸めます。 :func:`round` 関数からでもアクセスできます。" -#: ../../library/fractions.rst:227 -msgid "" -"Provides support for formatting of :class:`Fraction` instances via the :meth:" -"`str.format` method, the :func:`format` built-in function, or :ref:" -"`Formatted string literals `." -msgstr "" - -#: ../../library/fractions.rst:231 -msgid "" -"If the ``format_spec`` format specification string does not end with one of " -"the presentation types ``'e'``, ``'E'``, ``'f'``, ``'F'``, ``'g'``, ``'G'`` " -"or ``'%'`` then formatting follows the general rules for fill, alignment, " -"sign handling, minimum width, and grouping as described in the :ref:`format " -"specification mini-language `. The \"alternate form\" flag " -"``'#'`` is supported: if present, it forces the output string to always " -"include an explicit denominator, even when the value being formatted is an " -"exact integer. The zero-fill flag ``'0'`` is not supported." -msgstr "" - -#: ../../library/fractions.rst:241 -msgid "" -"If the ``format_spec`` format specification string ends with one of the " -"presentation types ``'e'``, ``'E'``, ``'f'``, ``'F'``, ``'g'``, ``'G'`` or " -"``'%'`` then formatting follows the rules outlined for the :class:`float` " -"type in the :ref:`formatspec` section." -msgstr "" - -#: ../../library/fractions.rst:246 -msgid "Here are some examples::" -msgstr "ここに例があります::" - -#: ../../library/fractions.rst:248 -msgid "" -">>> from fractions import Fraction\n" -">>> format(Fraction(103993, 33102), '_')\n" -"'103_993/33_102'\n" -">>> format(Fraction(1, 7), '.^+10')\n" -"'...+1/7...'\n" -">>> format(Fraction(3, 1), '')\n" -"'3'\n" -">>> format(Fraction(3, 1), '#')\n" -"'3/1'\n" -">>> format(Fraction(1, 7), '.40g')\n" -"'0.1428571428571428571428571428571428571429'\n" -">>> format(Fraction('1234567.855'), '_.2f')\n" -"'1_234_567.86'\n" -">>> f\"{Fraction(355, 113):*>20.6e}\"\n" -"'********3.141593e+00'\n" -">>> old_price, new_price = 499, 672\n" -">>> \"{:.2%} price increase\".format(Fraction(new_price, old_price) - 1)\n" -"'34.67% price increase'" -msgstr "" - -#: ../../library/fractions.rst:270 +#: ../../library/fractions.rst:181 msgid "Module :mod:`numbers`" msgstr ":mod:`numbers` モジュール" -#: ../../library/fractions.rst:271 +#: ../../library/fractions.rst:182 msgid "The abstract base classes making up the numeric tower." msgstr "数値の塔を作り上げる抽象基底クラス。" - -#: ../../library/fractions.rst:20 -msgid "as_integer_ratio()" -msgstr "" diff --git a/library/frameworks.po b/library/frameworks.po index 4d33607ba..2a0555d74 100644 --- a/library/frameworks.po +++ b/library/frameworks.po @@ -1,26 +1,26 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 +# Arihiro TAKASE, 2017 # Osamu NAKAMURA, 2021 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-30 14:22+0000\n" -"PO-Revision-Date: 2021-06-28 01:06+0000\n" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 23:11+0000\n" "Last-Translator: Osamu NAKAMURA, 2021\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/frameworks.rst:5 diff --git a/library/ftplib.po b/library/ftplib.po index 710d239e6..f02ed8fa6 100644 --- a/library/ftplib.po +++ b/library/ftplib.po @@ -1,35 +1,35 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Masato HASHIMOTO , 2023 -# Arihiro TAKASE, 2023 -# tomo, 2024 -# Taichi Haradaguchi, 2024 -# 石井明久, 2024 -# Takanori Suzuki , 2024 +# Yusuke Miyazaki , 2017 +# E. Kawashima, 2017 +# 秘湯 , 2017 +# Arihiro TAKASE, 2017 +# tomo, 2019 +# Takanori Suzuki , 2021 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-13 14:21+0000\n" -"PO-Revision-Date: 2021-06-28 01:06+0000\n" -"Last-Translator: Takanori Suzuki , 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-05-08 06:17+0000\n" +"PO-Revision-Date: 2017-02-16 23:11+0000\n" +"Last-Translator: Takanori Suzuki , 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/ftplib.rst:2 -msgid ":mod:`!ftplib` --- FTP protocol client" -msgstr ":mod:`!ftplib` --- FTP プロトコルクライアント" +msgid ":mod:`ftplib` --- FTP protocol client" +msgstr ":mod:`ftplib` --- FTPプロトコルクライアント" #: ../../library/ftplib.rst:7 msgid "**Source code:** :source:`Lib/ftplib.py`" @@ -42,124 +42,55 @@ msgid "" "use this to write Python programs that perform a variety of automated FTP " "jobs, such as mirroring other FTP servers. It is also used by the module :" "mod:`urllib.request` to handle URLs that use FTP. For more information on " -"FTP (File Transfer Protocol), see internet :rfc:`959`." +"FTP (File Transfer Protocol), see Internet :rfc:`959`." msgstr "" "このモジュールでは :class:`FTP` クラスと、それに関連するいくつかの項目を定義" "しています。 :class:`FTP` クラスは、FTPプロトコルのクライアント側の機能を備え" "ています。このクラスを使うとFTPのいろいろな機能の自動化、例えば他のFTPサーバ" "のミラーリングといったことを実行するPythonプログラムを書くことができます。ま" "た、 :mod:`urllib.request` モジュールもFTPを使うURLを操作するのにこのクラスを" -"使っています。 FTP (File Transfer Protocol)についての詳しい情報はinternet :" +"使っています。 FTP (File Transfer Protocol)についての詳しい情報はInternet :" "rfc:`959` を参照して下さい。" #: ../../library/ftplib.rst:22 msgid "The default encoding is UTF-8, following :rfc:`2640`." msgstr "" -#: ../../includes/wasm-notavail.rst:3 -msgid "Availability" -msgstr "" - -#: ../../includes/wasm-notavail.rst:5 -msgid "" -"This module does not work or is not available on WebAssembly. See :ref:`wasm-" -"availability` for more information." -msgstr "" -"このモジュールは WebAssembly では動作しないか、利用不可です。詳しくは、:ref:" -"`wasm-availability` を見てください。" - -#: ../../library/ftplib.rst:26 +#: ../../library/ftplib.rst:24 msgid "Here's a sample session using the :mod:`ftplib` module::" msgstr ":mod:`ftplib` モジュールを使ったサンプルを以下に示します::" -#: ../../library/ftplib.rst:28 -msgid "" -">>> from ftplib import FTP\n" -">>> ftp = FTP('ftp.us.debian.org') # connect to host, default port\n" -">>> ftp.login() # user anonymous, passwd anonymous@\n" -"'230 Login successful.'\n" -">>> ftp.cwd('debian') # change into \"debian\" directory\n" -"'250 Directory successfully changed.'\n" -">>> ftp.retrlines('LIST') # list directory contents\n" -"-rw-rw-r-- 1 1176 1176 1063 Jun 15 10:18 README\n" -"...\n" -"drwxr-sr-x 5 1176 1176 4096 Dec 19 2000 pool\n" -"drwxr-sr-x 4 1176 1176 4096 Nov 17 2008 project\n" -"drwxr-xr-x 3 1176 1176 4096 Oct 10 2012 tools\n" -"'226 Directory send OK.'\n" -">>> with open('README', 'wb') as fp:\n" -">>> ftp.retrbinary('RETR README', fp.write)\n" -"'226 Transfer complete.'\n" -">>> ftp.quit()\n" -"'221 Goodbye.'" -msgstr "" - -#: ../../library/ftplib.rst:51 -msgid "Reference" -msgstr "リファレンス" - -#: ../../library/ftplib.rst:56 -msgid "FTP objects" -msgstr "FTP オブジェクト" - -#: ../../library/ftplib.rst:87 -msgid "Return a new instance of the :class:`FTP` class." -msgstr "" - -#: ../../library/ftplib.rst:0 -msgid "Parameters" -msgstr "パラメーター" - -#: ../../library/ftplib.rst:89 ../../library/ftplib.rst:461 -msgid "" -"The hostname to connect to. If given, :code:`connect(host)` is implicitly " -"called by the constructor." -msgstr "" - -#: ../../library/ftplib.rst:93 ../../library/ftplib.rst:465 -msgid "" -"|param_doc_user| If given, :code:`login(host, passwd, acct)` is implicitly " -"called by the constructor." -msgstr "" +#: ../../library/ftplib.rst:46 +msgid "The module defines the following items:" +msgstr "このモジュールは以下の項目を定義しています:" -#: ../../library/ftplib.rst:98 ../../library/ftplib.rst:212 -#: ../../library/ftplib.rst:470 -msgid "|param_doc_passwd|" -msgstr "" - -#: ../../library/ftplib.rst:101 ../../library/ftplib.rst:215 -#: ../../library/ftplib.rst:473 -msgid "|param_doc_acct|" -msgstr "" - -#: ../../library/ftplib.rst:104 +#: ../../library/ftplib.rst:50 msgid "" -"A timeout in seconds for blocking operations like :meth:`connect` (default: " -"the global default timeout setting)." -msgstr "" - -#: ../../library/ftplib.rst:109 ../../library/ftplib.rst:183 -#: ../../library/ftplib.rst:488 -msgid "|param_doc_source_address|" +"Return a new instance of the :class:`FTP` class. When *host* is given, the " +"method call ``connect(host)`` is made. When *user* is given, additionally " +"the method call ``login(user, passwd, acct)`` is made (where *passwd* and " +"*acct* default to the empty string when not given). The optional *timeout* " +"parameter specifies a timeout in seconds for blocking operations like the " +"connection attempt (if is not specified, the global default timeout setting " +"will be used). *source_address* is a 2-tuple ``(host, port)`` for the socket " +"to bind to as its source address before connecting. The *encoding* parameter " +"specifies the encoding for directories and filenames." msgstr "" -#: ../../library/ftplib.rst:113 ../../library/ftplib.rst:492 -msgid "|param_doc_encoding|" -msgstr "" - -#: ../../library/ftplib.rst:116 +#: ../../library/ftplib.rst:60 msgid "The :class:`FTP` class supports the :keyword:`with` statement, e.g.:" msgstr ":class:`FTP` クラスは :keyword:`with` 文をサポートしています。例えば:" -#: ../../library/ftplib.rst:130 +#: ../../library/ftplib.rst:74 msgid "Support for the :keyword:`with` statement was added." msgstr ":keyword:`with` 構文のサポートが追加されました。" -#: ../../library/ftplib.rst:133 ../../library/ftplib.rst:189 +#: ../../library/ftplib.rst:77 ../../library/ftplib.rst:103 +#: ../../library/ftplib.rst:212 msgid "*source_address* parameter was added." msgstr "*source_address* 引数が追加されました。" -#: ../../library/ftplib.rst:136 ../../library/ftplib.rst:505 +#: ../../library/ftplib.rst:80 ../../library/ftplib.rst:118 msgid "" "If the *timeout* parameter is set to be zero, it will raise a :class:" "`ValueError` to prevent the creation of a non-blocking socket. The " @@ -167,66 +98,164 @@ msgid "" "UTF-8 to follow :rfc:`2640`." msgstr "" -#: ../../library/ftplib.rst:142 +#: ../../library/ftplib.rst:88 msgid "" -"Several :class:`!FTP` methods are available in two flavors: one for handling " -"text files and another for binary files. The methods are named for the " -"command which is used followed by ``lines`` for the text version or " -"``binary`` for the binary version." +"A :class:`FTP` subclass which adds TLS support to FTP as described in :rfc:" +"`4217`. Connect as usual to port 21 implicitly securing the FTP control " +"connection before authenticating. Securing the data connection requires the " +"user to explicitly ask for it by calling the :meth:`prot_p` method. " +"*context* is a :class:`ssl.SSLContext` object which allows bundling SSL " +"configuration options, certificates and private keys into a single " +"(potentially long-lived) structure. Please read :ref:`ssl-security` for " +"best practices." msgstr "" +":rfc:`4217` に記述されている TLS サポートを FTP に加えた :class:`FTP` のサブ" +"クラスです。認証の前に FTP コントロール接続を暗黙にセキュアにし、通常通りに " +"port 21 に接続します。データ接続をセキュアにするには、ユーザが :meth:" +"`prot_p` メソッドを呼び出してそれを明示的に要求しなければなりません。 " +"*context* は SSL 設定オプション、証明書、秘密鍵を一つの(潜在的に長生きの)構造" +"にまとめた :class:`ssl.SSLContext` オブジェクトです。ベストプラクティスについ" +"ての :ref:`ssl-security` をお読みください。" -#: ../../library/ftplib.rst:147 -msgid ":class:`FTP` instances have the following methods:" -msgstr ":class:`FTP` インスタンスには以下のメソッドがあります:" +#: ../../library/ftplib.rst:97 +msgid "" +"*keyfile* and *certfile* are a legacy alternative to *context* -- they can " +"point to PEM-formatted private key and certificate chain files " +"(respectively) for the SSL connection." +msgstr "" +"*keyfile* と *certfile* は *context* のレガシー版です -- これらは、SSL 接続の" +"ための、 PEM フォーマットの秘密鍵と証明書チェーンファイル名(前者が " +"*keyfile* 、後者が *certfile* )を含むことができます。" -#: ../../library/ftplib.rst:151 +#: ../../library/ftplib.rst:106 msgid "" -"Set the instance's debugging level as an :class:`int`. This controls the " -"amount of debugging output printed. The debug levels are:" +"The class now supports hostname check with :attr:`ssl.SSLContext." +"check_hostname` and *Server Name Indication* (see :data:`ssl.HAS_SNI`)." msgstr "" +"このクラスは :attr:`ssl.SSLContext.check_hostname` と *Server Name " +"Indication* でホスト名のチェックをサポートしました。(:data:`ssl.HAS_SNI` を参" +"照してください)。" -#: ../../library/ftplib.rst:155 -msgid "``0`` (default): No debug output." +#: ../../library/ftplib.rst:113 +msgid "" +"*keyfile* and *certfile* are deprecated in favor of *context*. Please use :" +"meth:`ssl.SSLContext.load_cert_chain` instead, or let :func:`ssl." +"create_default_context` select the system's trusted CA certificates for you." msgstr "" +"*keyfile* および *certfile* は非推奨となったので、 *context* を使ってくださ" +"い。\n" +"代わりに :meth:`ssl.SSLContext.load_cert_chain` を使うか、または :func:`ssl." +"create_default_context` にシステムが信頼する CA 証明書を選んでもらうかしてく" +"ださい。" + +#: ../../library/ftplib.rst:124 +msgid "Here's a sample session using the :class:`FTP_TLS` class::" +msgstr ":class:`FTP_TLS` クラスを使ったサンプルセッションはこちらです:" + +#: ../../library/ftplib.rst:137 +msgid "Exception raised when an unexpected reply is received from the server." +msgstr "サーバから想定外の応答があったときに送出される例外。" -#: ../../library/ftplib.rst:156 +#: ../../library/ftplib.rst:142 msgid "" -"``1``: Produce a moderate amount of debug output, generally a single line " -"per request." +"Exception raised when an error code signifying a temporary error (response " +"codes in the range 400--499) is received." msgstr "" +"一時的エラーを表すエラーコード(400--499の範囲の応答コード)を受け取った時に発" +"生する例外。" -#: ../../library/ftplib.rst:158 +#: ../../library/ftplib.rst:148 msgid "" -"``2`` or higher: Produce the maximum amount of debugging output, logging " -"each line sent and received on the control connection." +"Exception raised when an error code signifying a permanent error (response " +"codes in the range 500--599) is received." msgstr "" +"永久エラーを表すエラーコード(500--599の範囲の応答コード)を受け取った時に発生" +"する例外。" -#: ../../library/ftplib.rst:163 +#: ../../library/ftplib.rst:154 msgid "" -"Connect to the given host and port. This function should be called only once " -"for each instance; it should not be called if a *host* argument was given " -"when the :class:`FTP` instance was created. All other :class:`!FTP` methods " -"can only be called after a connection has successfully been made." +"Exception raised when a reply is received from the server that does not fit " +"the response specifications of the File Transfer Protocol, i.e. begin with a " +"digit in the range 1--5." msgstr "" +"File Transfer Protocol の応答仕様に適合しない、すなわち1--5の数字で始まらない" +"応答コードをサーバから受け取った時に発生する例外。" -#: ../../library/ftplib.rst:170 -msgid "The host to connect to." +#: ../../library/ftplib.rst:161 +msgid "" +"The set of all exceptions (as a tuple) that methods of :class:`FTP` " +"instances may raise as a result of problems with the FTP connection (as " +"opposed to programming errors made by the caller). This set includes the " +"four exceptions listed above as well as :exc:`OSError` and :exc:`EOFError`." msgstr "" +":class:`FTP` インスタンスのメソッド実行時、FTP接続で (プログラミングのエラー" +"と考えられるメソッドの実行によって) 発生する全ての例外 (タプル形式)。この例外" +"には以上の4つのエラーはもちろん、 :exc:`OSError` と :exc:`EOFError` も含まれ" +"ます。" -#: ../../library/ftplib.rst:173 +#: ../../library/ftplib.rst:171 +msgid "Module :mod:`netrc`" +msgstr ":mod:`netrc` モジュール" + +#: ../../library/ftplib.rst:170 msgid "" -"The TCP port to connect to (default: ``21``, as specified by the FTP " -"protocol specification). It is rarely needed to specify a different port " -"number." +"Parser for the :file:`.netrc` file format. The file :file:`.netrc` is " +"typically used by FTP clients to load user authentication information before " +"prompting the user." msgstr "" +":file:`.netrc` ファイルフォーマットのパーザ。 :file:`.netrc` ファイルは、 FTP" +"クライアントがユーザにプロンプトを出す前に、ユーザ認証情報をロードするのによ" +"く使われます。" #: ../../library/ftplib.rst:178 +msgid "FTP Objects" +msgstr "FTP オブジェクト" + +#: ../../library/ftplib.rst:180 +msgid "" +"Several methods are available in two flavors: one for handling text files " +"and another for binary files. These are named for the command which is used " +"followed by ``lines`` for the text version or ``binary`` for the binary " +"version." +msgstr "" +"いくつかのコマンドは2つのタイプについて実行します:1つはテキストファイル" +"で、もう1つはバイナリファイルを扱います。これらのメソッドのテキストバージョ" +"ンでは ``lines`` 、バイナリバージョンでは ``binary`` の語がメソッド名の終わり" +"についています。" + +#: ../../library/ftplib.rst:184 +msgid ":class:`FTP` instances have the following methods:" +msgstr ":class:`FTP` インスタンスには以下のメソッドがあります:" + +#: ../../library/ftplib.rst:189 msgid "" -"A timeout in seconds for the connection attempt (default: the global default " -"timeout setting)." +"Set the instance's debugging level. This controls the amount of debugging " +"output printed. The default, ``0``, produces no debugging output. A value " +"of ``1`` produces a moderate amount of debugging output, generally a single " +"line per request. A value of ``2`` or higher produces the maximum amount of " +"debugging output, logging each line sent and received on the control " +"connection." msgstr "" +"インスタンスのデバッグレベルを設定します。この設定によってデバッグ時に出力さ" +"れる量を調節します。デフォルトは ``0`` で、何も出力されません。 ``1`` なら、" +"一般的に1つのコマンドあたり1行の適当な量のデバッグ出力を行います。 ``2`` 以" +"上なら、コントロール接続で受信した各行を出力して、最大のデバッグ出力をしま" +"す。" -#: ../../library/ftplib.rst:187 +#: ../../library/ftplib.rst:198 +msgid "" +"Connect to the given host and port. The default port number is ``21``, as " +"specified by the FTP protocol specification. It is rarely needed to specify " +"a different port number. This function should be called only once for each " +"instance; it should not be called at all if a host was given when the " +"instance was created. All other methods can only be used after a connection " +"has been made. The optional *timeout* parameter specifies a timeout in " +"seconds for the connection attempt. If no *timeout* is passed, the global " +"default timeout setting will be used. *source_address* is a 2-tuple ``(host, " +"port)`` for the socket to bind to as its source address before connecting." +msgstr "" + +#: ../../library/ftplib.rst:210 msgid "" "Raises an :ref:`auditing event ` ``ftplib.connect`` with arguments " "``self``, ``host``, ``port``." @@ -234,7 +263,7 @@ msgstr "" "引数 ``self``, ``host``, ``port`` を指定して :ref:`監査イベント ` " "``ftplib.connect`` を送出します。 " -#: ../../library/ftplib.rst:195 +#: ../../library/ftplib.rst:218 msgid "" "Return the welcome message sent by the server in reply to the initial " "connection. (This message sometimes contains disclaimers or help " @@ -244,20 +273,28 @@ msgstr "" "(このメッセージには時に、ユーザにとって重要な免責事項や ヘルプ情報が入ってい" "ます。)" -#: ../../library/ftplib.rst:202 -msgid "" -"Log on to the connected FTP server. This function should be called only once " -"for each instance, after a connection has been established; it should not be " -"called if the *host* and *user* arguments were given when the :class:`FTP` " -"instance was created. Most FTP commands are only allowed after the client " -"has logged in." -msgstr "" - -#: ../../library/ftplib.rst:209 -msgid "|param_doc_user|" -msgstr "" - -#: ../../library/ftplib.rst:221 +#: ../../library/ftplib.rst:225 +msgid "" +"Log in as the given *user*. The *passwd* and *acct* parameters are optional " +"and default to the empty string. If no *user* is specified, it defaults to " +"``'anonymous'``. If *user* is ``'anonymous'``, the default *passwd* is " +"``'anonymous@'``. This function should be called only once for each " +"instance, after a connection has been established; it should not be called " +"at all if a host and user were given when the instance was created. Most " +"FTP commands are only allowed after the client has logged in. The *acct* " +"parameter supplies \"accounting information\"; few systems implement this." +msgstr "" +"与えられた *user* でログインします。 *passwd* と *acct* のパラメータは省略可" +"能で、デフォルトでは空文字列です。もし *user* が指定されないなら、デフォルト" +"で ``'anonymous'`` になります。もし *user* が ``'anonymous'`` なら、デフォル" +"トの *passwd* は ``'anonymous@'`` になります。この関数は各インスタンスについ" +"て一度だけ、接続が確立した後に呼び出さなければなりません。インスタンスが作ら" +"れた時にホスト名とユーザ名が与えられていたら、このメソッドを実行すべきではあ" +"りません。ほとんどのFTPコマンドはクライアントがログインした後に実行可能になり" +"ます。 *acct* 引数は \"accounting information\" を提供します。ほとんどのシス" +"テムはこれを実装していません。" + +#: ../../library/ftplib.rst:237 msgid "" "Abort a file transfer that is in progress. Using this does not always work, " "but it's worth a try." @@ -265,12 +302,12 @@ msgstr "" "実行中のファイル転送を中止します。これはいつも機能するわけではありませんが、" "やってみる価値はあります。" -#: ../../library/ftplib.rst:227 +#: ../../library/ftplib.rst:243 msgid "" "Send a simple command string to the server and return the response string." msgstr "シンプルなコマンド文字列をサーバに送信して、受信した文字列を返します。" -#: ../../library/ftplib.rst:229 ../../library/ftplib.rst:238 +#: ../../library/ftplib.rst:245 ../../library/ftplib.rst:254 msgid "" "Raises an :ref:`auditing event ` ``ftplib.sendcmd`` with arguments " "``self``, ``cmd``." @@ -278,41 +315,37 @@ msgstr "" "引数 ``self``, ``cmd`` を指定して :ref:`監査イベント ` ``ftplib." "sendcmd`` を送出します。 " -#: ../../library/ftplib.rst:234 +#: ../../library/ftplib.rst:250 msgid "" "Send a simple command string to the server and handle the response. Return " -"the response string if the response code corresponds to success (codes in " -"the range 200--299). Raise :exc:`error_reply` otherwise." -msgstr "" - -#: ../../library/ftplib.rst:243 -msgid "Retrieve a file in binary transfer mode." -msgstr "" - -#: ../../library/ftplib.rst:245 -msgid "An appropriate ``RETR`` command: :samp:`\"RETR {filename}\"`." -msgstr "" - -#: ../../library/ftplib.rst:248 -msgid "" -"A single parameter callable that is called for each block of data received, " -"with its single argument being the data as :class:`bytes`." -msgstr "" - -#: ../../library/ftplib.rst:254 -msgid "" -"The maximum chunk size to read on the low-level :class:`~socket.socket` " -"object created to do the actual transfer. This also corresponds to the " -"largest size of data that will be passed to *callback*. Defaults to ``8192``." -msgstr "" - -#: ../../library/ftplib.rst:261 ../../library/ftplib.rst:308 -msgid "" -"A ``REST`` command to be sent to the server. See the documentation for the " -"*rest* parameter of the :meth:`transfercmd` method." -msgstr "" - -#: ../../library/ftplib.rst:268 +"nothing if a response code corresponding to success (codes in the range " +"200--299) is received. Raise :exc:`error_reply` otherwise." +msgstr "" +"シンプルなコマンド文字列をサーバに送信して、その応答を扱います。応答コードが" +"成功に関係するもの(200--299の範囲にあるコード)なら何も返しません。それ以外" +"は :exc:`error_reply` を発生します。" + +#: ../../library/ftplib.rst:259 +msgid "" +"Retrieve a file in binary transfer mode. *cmd* should be an appropriate " +"``RETR`` command: ``'RETR filename'``. The *callback* function is called for " +"each block of data received, with a single bytes argument giving the data " +"block. The optional *blocksize* argument specifies the maximum chunk size to " +"read on the low-level socket object created to do the actual transfer (which " +"will also be the largest size of the data blocks passed to *callback*). A " +"reasonable default is chosen. *rest* means the same thing as in the :meth:" +"`transfercmd` method." +msgstr "" +"バイナリ転送モードでファイルを受信します。 *cmd* は適切な ``RETR`` コマン" +"ド: ``'RETR filename'`` でなければなりません。関数 *callback* は、受信した" +"データブロックのそれぞれに対して、データブロックを1つの bytes の引数として呼" +"び出されます。省略可能な引数 *blocksize* は、実際の転送を行うのに作られた低レ" +"ベルのソケットオブジェクトから読み込む最大のチャンクサイズを指定します(これ" +"は *callback* に与えられるデータブロックの最大サイズにもなります)。妥当なデ" +"フォルト値が設定されます。 *rest* は、 :meth:`transfercmd` メソッドと同じもの" +"です。" + +#: ../../library/ftplib.rst:271 msgid "" "Retrieve a file or directory listing in the encoding specified by the " "*encoding* parameter at initialization. *cmd* should be an appropriate " @@ -321,10 +354,10 @@ msgid "" "files and information about those files. ``NLST`` retrieves a list of file " "names. The *callback* function is called for each line with a string " "argument containing the line with the trailing CRLF stripped. The default " -"*callback* prints the line to :data:`sys.stdout`." +"*callback* prints the line to ``sys.stdout``." msgstr "" -#: ../../library/ftplib.rst:281 +#: ../../library/ftplib.rst:284 msgid "" "Enable \"passive\" mode if *val* is true, otherwise disable passive mode. " "Passive mode is on by default." @@ -332,36 +365,30 @@ msgstr "" "*val* が真の場合 \"パッシブ\" モードを有効化し、偽の場合は無効化します。 デ" "フォルトではパッシブモードです。" -#: ../../library/ftplib.rst:287 -msgid "Store a file in binary transfer mode." -msgstr "" - -#: ../../library/ftplib.rst:289 -msgid "An appropriate ``STOR`` command: :samp:`\"STOR {filename}\"`." -msgstr "" - -#: ../../library/ftplib.rst:292 -msgid "" -"A file object (opened in binary mode) which is read until EOF, using its :" -"meth:`~io.RawIOBase.read` method in blocks of size *blocksize* to provide " -"the data to be stored." -msgstr "" +#: ../../library/ftplib.rst:290 +msgid "" +"Store a file in binary transfer mode. *cmd* should be an appropriate " +"``STOR`` command: ``\"STOR filename\"``. *fp* is a :term:`file object` " +"(opened in binary mode) which is read until EOF using its :meth:`~io.IOBase." +"read` method in blocks of size *blocksize* to provide the data to be stored. " +"The *blocksize* argument defaults to 8192. *callback* is an optional single " +"parameter callable that is called on each block of data after it is sent. " +"*rest* means the same thing as in the :meth:`transfercmd` method." +msgstr "" +"バイナリ転送モードでファイルを転送します。 *cmd* は適切な ``STOR`` コマン" +"ド: ``\"STOR filename\"`` でなければなりません。 *fp* は (バイナリモードで開" +"かれた) :term:`ファイルオブジェクト ` で、 :meth:`~io.IOBase." +"read` メソッドで EOFまで読み込まれ、ブロックサイズ *blocksize* でデータが転送" +"されます。引数 *blocksize* のデフォルト値は8192です。 *callback* はオプション" +"の引数で、引数を1つとる呼び出し可能オブジェクトを渡します。各データブロックが" +"送信された後に、そのブロックを引数にして呼び出されます。 *rest* は、 :meth:" +"`transfercmd` メソッドにあるものと同じ意味です。" #: ../../library/ftplib.rst:298 -msgid "The read block size. Defaults to ``8192``." -msgstr "" +msgid "*rest* parameter added." +msgstr "*rest* パラメタが追加されました。" -#: ../../library/ftplib.rst:302 -msgid "" -"A single parameter callable that is called for each block of data sent, with " -"its single argument being the data as :class:`bytes`." -msgstr "" - -#: ../../library/ftplib.rst:312 -msgid "The *rest* parameter was added." -msgstr "" - -#: ../../library/ftplib.rst:318 +#: ../../library/ftplib.rst:304 msgid "" "Store a file in line mode. *cmd* should be an appropriate ``STOR`` command " "(see :meth:`storbinary`). Lines are read until EOF from the :term:`file " @@ -370,7 +397,7 @@ msgid "" "parameter callable that is called on each line after it is sent." msgstr "" -#: ../../library/ftplib.rst:327 +#: ../../library/ftplib.rst:313 msgid "" "Initiate a transfer over the data connection. If the transfer is active, " "send an ``EPRT`` or ``PORT`` command and the transfer command specified by " @@ -383,7 +410,7 @@ msgstr "" "ブなら、``EPSV`` あるいは ``PASV`` コマンドを送信して接続し、転送コマンドを開" "始します。どちらの場合も、接続のためのソケットを返します。" -#: ../../library/ftplib.rst:333 +#: ../../library/ftplib.rst:319 msgid "" "If optional *rest* is given, a ``REST`` command is sent to the server, " "passing *rest* as an argument. *rest* is usually a byte offset into the " @@ -396,7 +423,7 @@ msgid "" "simply call :meth:`transfercmd` without a *rest* argument." msgstr "" -#: ../../library/ftplib.rst:346 +#: ../../library/ftplib.rst:332 msgid "" "Like :meth:`transfercmd`, but returns a tuple of the data connection and the " "expected size of the data. If the expected size could not be computed, " @@ -407,7 +434,7 @@ msgstr "" "す。もしサイズが計算できないなら、サイズの代わりに ``None`` が返されます。 " "*cmd* と *rest* は :meth:`transfercmd` のものと同じです。" -#: ../../library/ftplib.rst:354 +#: ../../library/ftplib.rst:340 msgid "" "List a directory in a standardized format by using ``MLSD`` command (:rfc:" "`3659`). If *path* is omitted the current directory is assumed. *facts* is " @@ -419,7 +446,7 @@ msgid "" "but server is not guaranteed to return all requested facts." msgstr "" -#: ../../library/ftplib.rst:368 +#: ../../library/ftplib.rst:354 msgid "" "Return a list of file names as returned by the ``NLST`` command. The " "optional *argument* is a directory to list (default is the current server " @@ -431,25 +458,31 @@ msgstr "" "トディレクトリです)。 ``NLST`` コマンドに非標準である複数の引数を渡すことが" "できます。" -#: ../../library/ftplib.rst:373 ../../library/ftplib.rst:385 +#: ../../library/ftplib.rst:359 ../../library/ftplib.rst:371 msgid "If your server supports the command, :meth:`mlsd` offers a better API." msgstr "" -#: ../../library/ftplib.rst:378 +#: ../../library/ftplib.rst:364 msgid "" "Produce a directory listing as returned by the ``LIST`` command, printing it " "to standard output. The optional *argument* is a directory to list (default " "is the current server directory). Multiple arguments can be used to pass " "non-standard options to the ``LIST`` command. If the last argument is a " "function, it is used as a *callback* function as for :meth:`retrlines`; the " -"default prints to :data:`sys.stdout`. This method returns ``None``." +"default prints to ``sys.stdout``. This method returns ``None``." msgstr "" +"``LIST`` コマンドで返されるディレクトリ内のリストを作り、標準出力へ出力しま" +"す。省略可能な *argument* は、リストアップするディレクトリです(デフォルトで" +"はサーバのカレントディレクトリです)。 ``LIST`` コマンドに非標準である複数の" +"引数を渡すことができます。もし最後の引数が関数なら、 :meth:`retrlines` のよう" +"に *callback* として使われます; デフォルトでは ``sys.stdout`` に印字します。" +"このメソッドは ``None`` を返します。" -#: ../../library/ftplib.rst:390 +#: ../../library/ftplib.rst:376 msgid "Rename file *fromname* on the server to *toname*." msgstr "サーバ上のファイルのファイル名 *fromname* を *toname* へ変更します。" -#: ../../library/ftplib.rst:395 +#: ../../library/ftplib.rst:381 msgid "" "Remove the file named *filename* from the server. If successful, returns " "the text of the response, otherwise raises :exc:`error_perm` on permission " @@ -459,23 +492,23 @@ msgstr "" "そうでないならパーミッションエラーでは :exc:`error_perm` を、他のエラーでは :" "exc:`error_reply` を返します。" -#: ../../library/ftplib.rst:402 +#: ../../library/ftplib.rst:388 msgid "Set the current directory on the server." msgstr "サーバのカレントディレクトリを設定します。" -#: ../../library/ftplib.rst:407 +#: ../../library/ftplib.rst:393 msgid "Create a new directory on the server." msgstr "サーバ上に新たにディレクトリを作ります。" -#: ../../library/ftplib.rst:412 +#: ../../library/ftplib.rst:398 msgid "Return the pathname of the current directory on the server." msgstr "サーバ上のカレントディレクトリのパスを返します。" -#: ../../library/ftplib.rst:417 +#: ../../library/ftplib.rst:403 msgid "Remove the directory named *dirname* on the server." msgstr "サーバ上のディレクトリ *dirname* を削除します。" -#: ../../library/ftplib.rst:422 +#: ../../library/ftplib.rst:408 msgid "" "Request the size of the file named *filename* on the server. On success, " "the size of the file is returned as an integer, otherwise ``None`` is " @@ -486,7 +519,7 @@ msgstr "" "整数で返され、そうでないなら ``None`` が返されます。 ``SIZE`` コマンドは標準" "化されていませんが、多くの普通のサーバで実装されていることに注意して下さい。" -#: ../../library/ftplib.rst:430 +#: ../../library/ftplib.rst:416 msgid "" "Send a ``QUIT`` command to the server and close the connection. This is the " "\"polite\" way to close a connection, but it may raise an exception if the " @@ -500,7 +533,7 @@ msgstr "" "スタンスに対するその後のコマンド使用が不可になっていることを示しています(下" "記参照)。" -#: ../../library/ftplib.rst:439 +#: ../../library/ftplib.rst:425 msgid "" "Close the connection unilaterally. This should not be applied to an already " "closed connection such as after a successful call to :meth:`~FTP.quit`. " @@ -514,85 +547,24 @@ msgstr "" "meth:`~FTP.quit` を呼び出した後で、 :meth:`login` メソッドをもう一度実行して" "再び接続を開くことはできません)。" -#: ../../library/ftplib.rst:447 -msgid "FTP_TLS objects" +#: ../../library/ftplib.rst:433 +msgid "FTP_TLS Objects" msgstr "FTP_TLS オブジェクト" -#: ../../library/ftplib.rst:452 -msgid "" -"An :class:`FTP` subclass which adds TLS support to FTP as described in :rfc:" -"`4217`. Connect to port 21 implicitly securing the FTP control connection " -"before authenticating." -msgstr "" - -#: ../../library/ftplib.rst:458 -msgid "" -"The user must explicitly secure the data connection by calling the :meth:" -"`prot_p` method." -msgstr "" - -#: ../../library/ftplib.rst:476 -msgid "" -"An SSL context object which allows bundling SSL configuration options, " -"certificates and private keys into a single, potentially long-lived, " -"structure. Please read :ref:`ssl-security` for best practices." -msgstr "" - -#: ../../library/ftplib.rst:483 +#: ../../library/ftplib.rst:435 msgid "" -"A timeout in seconds for blocking operations like :meth:`~FTP.connect` " -"(default: the global default timeout setting)." +":class:`FTP_TLS` class inherits from :class:`FTP`, defining these additional " +"objects:" msgstr "" +":class:`FTP_TLS` クラスは :class:`FTP` を継承し、さらにオブジェクトを定義しま" +"す:" -#: ../../library/ftplib.rst:497 -msgid "Added the *source_address* parameter." -msgstr "" - -#: ../../library/ftplib.rst:500 -msgid "" -"The class now supports hostname check with :attr:`ssl.SSLContext." -"check_hostname` and *Server Name Indication* (see :const:`ssl.HAS_SNI`)." -msgstr "" -"このクラスは :attr:`ssl.SSLContext.check_hostname` と *Server Name " -"Indication* でホスト名のチェックをサポートしました。(:const:`ssl.HAS_SNI` を" -"参照してください)。" - -#: ../../library/ftplib.rst:511 -msgid "The deprecated *keyfile* and *certfile* parameters have been removed." -msgstr "非推奨の *keyfile* と *certfile* 引数を削除しました。" - -#: ../../library/ftplib.rst:514 -msgid "Here's a sample session using the :class:`FTP_TLS` class::" -msgstr ":class:`FTP_TLS` クラスを使ったサンプルセッションはこちらです:" - -#: ../../library/ftplib.rst:516 -msgid "" -">>> ftps = FTP_TLS('ftp.pureftpd.org')\n" -">>> ftps.login()\n" -"'230 Anonymous user logged in'\n" -">>> ftps.prot_p()\n" -"'200 Data protection level set to \"private\"'\n" -">>> ftps.nlst()\n" -"['6jack', 'OpenBSD', 'antilink', 'blogbench', 'bsdcam', 'clockspeed', " -"'djbdns-jedi', 'docs', 'eaccelerator-jedi', 'favicon.ico', 'francotone', " -"'fugu', 'ignore', 'libpuzzle', 'metalog', 'minidentd', 'misc', 'mysql-udf-" -"global-user-variables', 'php-jenkins-hash', 'php-skein-hash', 'php-webdav', " -"'phpaudit', 'phpbench', 'pincaster', 'ping', 'posto', 'pub', 'public', " -"'public_keys', 'pure-ftpd', 'qscan', 'qtc', 'sharedance', 'skycache', " -"'sound', 'tmp', 'ucarp']" -msgstr "" - -#: ../../library/ftplib.rst:524 -msgid "" -":class:`!FTP_TLS` class inherits from :class:`FTP`, defining these " -"additional methods and attributes:" -msgstr "" - -#: ../../library/ftplib.rst:529 -msgid "The SSL version to use (defaults to :data:`ssl.PROTOCOL_SSLv23`)." +#: ../../library/ftplib.rst:439 +msgid "The SSL version to use (defaults to :attr:`ssl.PROTOCOL_SSLv23`)." msgstr "" +"使用する SSL のバージョン (デフォルトは :attr:`ssl.PROTOCOL_SSLv23`) です。" -#: ../../library/ftplib.rst:533 +#: ../../library/ftplib.rst:443 msgid "" "Set up a secure control connection by using TLS or SSL, depending on what is " "specified in the :attr:`ssl_version` attribute." @@ -600,94 +572,26 @@ msgstr "" ":attr:`ssl_version` 属性で指定されたものに従って、 TLS または SSL を使い、セ" "キュアコントロール接続をセットアップします。" -#: ../../library/ftplib.rst:536 +#: ../../library/ftplib.rst:446 msgid "" "The method now supports hostname check with :attr:`ssl.SSLContext." -"check_hostname` and *Server Name Indication* (see :const:`ssl.HAS_SNI`)." +"check_hostname` and *Server Name Indication* (see :data:`ssl.HAS_SNI`)." msgstr "" +"このメソッドは :attr:`ssl.SSLContext.check_hostname` と *Server Name " +"Indication* でホスト名のチェックをサポートしました。(:data:`ssl.HAS_SNI` を参" +"照してください)。" -#: ../../library/ftplib.rst:543 +#: ../../library/ftplib.rst:453 msgid "" "Revert control channel back to plaintext. This can be useful to take " "advantage of firewalls that know how to handle NAT with non-secure FTP " "without opening fixed ports." msgstr "" -#: ../../library/ftplib.rst:551 +#: ../../library/ftplib.rst:461 msgid "Set up secure data connection." msgstr "セキュアデータ接続をセットアップします。" -#: ../../library/ftplib.rst:555 +#: ../../library/ftplib.rst:465 msgid "Set up clear text data connection." msgstr "平文データ接続をセットアップします。" - -#: ../../library/ftplib.rst:559 -msgid "Module variables" -msgstr "モジュール変数" - -#: ../../library/ftplib.rst:563 -msgid "Exception raised when an unexpected reply is received from the server." -msgstr "サーバから想定外の応答があったときに送出される例外。" - -#: ../../library/ftplib.rst:568 -msgid "" -"Exception raised when an error code signifying a temporary error (response " -"codes in the range 400--499) is received." -msgstr "" -"一時的エラーを表すエラーコード(400--499の範囲の応答コード)を受け取った時に発" -"生する例外。" - -#: ../../library/ftplib.rst:574 -msgid "" -"Exception raised when an error code signifying a permanent error (response " -"codes in the range 500--599) is received." -msgstr "" -"永久エラーを表すエラーコード(500--599の範囲の応答コード)を受け取った時に発生" -"する例外。" - -#: ../../library/ftplib.rst:580 -msgid "" -"Exception raised when a reply is received from the server that does not fit " -"the response specifications of the File Transfer Protocol, i.e. begin with a " -"digit in the range 1--5." -msgstr "" -"File Transfer Protocol の応答仕様に適合しない、すなわち1--5の数字で始まらない" -"応答コードをサーバから受け取った時に発生する例外。" - -#: ../../library/ftplib.rst:587 -msgid "" -"The set of all exceptions (as a tuple) that methods of :class:`FTP` " -"instances may raise as a result of problems with the FTP connection (as " -"opposed to programming errors made by the caller). This set includes the " -"four exceptions listed above as well as :exc:`OSError` and :exc:`EOFError`." -msgstr "" -":class:`FTP` インスタンスのメソッド実行時、FTP接続で (プログラミングのエラー" -"と考えられるメソッドの実行によって) 発生する全ての例外 (タプル形式)。この例外" -"には以上の4つのエラーはもちろん、 :exc:`OSError` と :exc:`EOFError` も含まれ" -"ます。" - -#: ../../library/ftplib.rst:595 -msgid "Module :mod:`netrc`" -msgstr ":mod:`netrc` モジュール" - -#: ../../library/ftplib.rst:596 -msgid "" -"Parser for the :file:`.netrc` file format. The file :file:`.netrc` is " -"typically used by FTP clients to load user authentication information before " -"prompting the user." -msgstr "" -":file:`.netrc` ファイルフォーマットのパーザ。 :file:`.netrc` ファイルは、 FTP" -"クライアントがユーザにプロンプトを出す前に、ユーザ認証情報をロードするのによ" -"く使われます。" - -#: ../../library/ftplib.rst:9 -msgid "FTP" -msgstr "FTP" - -#: ../../library/ftplib.rst:9 -msgid "protocol" -msgstr "プロトコル" - -#: ../../library/ftplib.rst:9 -msgid "ftplib (standard module)" -msgstr "" diff --git a/library/functional.po b/library/functional.po index a8ded1fd2..85dfacaa7 100644 --- a/library/functional.po +++ b/library/functional.po @@ -1,25 +1,27 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 +# Arihiro TAKASE, 2017 +# ryosuke.mondo , 2017 +# tomo, 2017 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-30 14:22+0000\n" -"PO-Revision-Date: 2021-06-28 01:06+0000\n" -"Last-Translator: tomo, 2021\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 23:11+0000\n" +"Last-Translator: tomo, 2017\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/functional.rst:3 diff --git a/library/functions.po b/library/functions.po index 559f1cc52..47972f0ce 100644 --- a/library/functions.po +++ b/library/functions.po @@ -1,42 +1,39 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Keigo Fushio , 2021 +# Inada Naoki , 2017 +# E. Kawashima, 2017 +# Hano, 2017 +# 秘湯 , 2017 +# Shun Sakurai, 2017 +# Nozomu Kaneko , 2017 +# Arihiro TAKASE, 2017 +# yudetamago , 2018 +# Naoki Nakamura , 2020 +# Keigo Fushio , 2020 +# tomo, 2020 # mollinaca, 2021 +# Takanori Suzuki , 2021 +# Osamu NAKAMURA, 2021 # Yusuke Miyazaki , 2021 -# yuta100101 , 2021 -# Masaaki Kobashi , 2022 -# Takeshi Nakazato, 2023 -# 菊池 健志, 2023 -# Arihiro TAKASE, 2023 -# souma987, 2023 -# Osamu NAKAMURA, 2023 -# Nozomu Kaneko , 2023 -# Masato HASHIMOTO , 2023 -# digdugdog, 2023 -# Skydelta, 2024 -# Takanori Suzuki , 2024 -# tomo, 2024 -# tommy, 2024 -# TENMYO Masakazu, 2024 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 01:06+0000\n" -"Last-Translator: TENMYO Masakazu, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-08-10 07:12+0000\n" +"PO-Revision-Date: 2017-02-16 23:11+0000\n" +"Last-Translator: Yusuke Miyazaki , 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/functions.rst:5 ../../library/functions.rst:11 @@ -51,394 +48,292 @@ msgstr "" "Python インタプリタには数多くの関数と型が組み込まれており、いつでも利用できま" "す。それらをここにアルファベット順に挙げます。" -#: ../../library/functions.rst:0 -msgid "**A**" -msgstr "**A**" - -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:13 msgid ":func:`abs`" msgstr ":func:`abs`" -#: ../../library/functions.rst:0 -msgid ":func:`aiter`" -msgstr ":func:`aiter`" - -#: ../../library/functions.rst:0 -msgid ":func:`all`" -msgstr ":func:`all`" - -#: ../../library/functions.rst:0 -msgid ":func:`anext`" -msgstr ":func:`anext`" - -#: ../../library/functions.rst:0 -msgid ":func:`any`" -msgstr ":func:`any`" - -#: ../../library/functions.rst:0 -msgid ":func:`ascii`" -msgstr ":func:`ascii`" - -#: ../../library/functions.rst:0 -msgid "**B**" -msgstr "**B**" - -#: ../../library/functions.rst:0 -msgid ":func:`bin`" -msgstr ":func:`bin`" - -#: ../../library/functions.rst:0 -msgid ":func:`bool`" -msgstr ":func:`bool`" - -#: ../../library/functions.rst:0 -msgid ":func:`breakpoint`" -msgstr ":func:`breakpoint`" - -#: ../../library/functions.rst:0 -msgid "|func-bytearray|_" -msgstr "|func-bytearray|_" - -#: ../../library/functions.rst:0 -msgid "|func-bytes|_" -msgstr "|func-bytes|_" - -#: ../../library/functions.rst:0 -msgid "**C**" -msgstr "**C**" - -#: ../../library/functions.rst:0 -msgid ":func:`callable`" -msgstr ":func:`callable`" - -#: ../../library/functions.rst:0 -msgid ":func:`chr`" -msgstr ":func:`chr`" - -#: ../../library/functions.rst:0 -msgid ":func:`classmethod`" -msgstr ":func:`classmethod`" +#: ../../library/functions.rst:13 +msgid ":func:`delattr`" +msgstr ":func:`delattr`" -#: ../../library/functions.rst:0 -msgid ":func:`compile`" -msgstr ":func:`compile`" +#: ../../library/functions.rst:13 +msgid ":func:`hash`" +msgstr ":func:`hash`" -#: ../../library/functions.rst:0 -msgid ":func:`complex`" -msgstr ":func:`complex`" +#: ../../library/functions.rst:13 +msgid "|func-memoryview|_" +msgstr "|func-memoryview|_" -#: ../../library/functions.rst:0 -msgid "**D**" -msgstr "**D**" +#: ../../library/functions.rst:13 +msgid "|func-set|_" +msgstr "|func-set|_" -#: ../../library/functions.rst:0 -msgid ":func:`delattr`" -msgstr ":func:`delattr`" +#: ../../library/functions.rst:14 +msgid ":func:`all`" +msgstr ":func:`all`" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:14 msgid "|func-dict|_" msgstr "|func-dict|_" -#: ../../library/functions.rst:0 -msgid ":func:`dir`" -msgstr ":func:`dir`" - -#: ../../library/functions.rst:0 -msgid ":func:`divmod`" -msgstr ":func:`divmod`" - -#: ../../library/functions.rst:0 -msgid "**E**" -msgstr "**E**" +#: ../../library/functions.rst:14 +msgid ":func:`help`" +msgstr ":func:`help`" -#: ../../library/functions.rst:0 -msgid ":func:`enumerate`" -msgstr ":func:`enumerate`" +#: ../../library/functions.rst:14 +msgid ":func:`min`" +msgstr ":func:`min`" -#: ../../library/functions.rst:0 -msgid ":func:`eval`" -msgstr ":func:`eval`" +#: ../../library/functions.rst:14 +msgid ":func:`setattr`" +msgstr ":func:`setattr`" -#: ../../library/functions.rst:0 -msgid ":func:`exec`" -msgstr ":func:`exec`" +#: ../../library/functions.rst:15 +msgid ":func:`any`" +msgstr ":func:`any`" -#: ../../library/functions.rst:0 -msgid "**F**" -msgstr "**F**" +#: ../../library/functions.rst:15 +msgid ":func:`dir`" +msgstr ":func:`dir`" -#: ../../library/functions.rst:0 -msgid ":func:`filter`" -msgstr ":func:`filter`" +#: ../../library/functions.rst:15 +msgid ":func:`hex`" +msgstr ":func:`hex`" -#: ../../library/functions.rst:0 -msgid ":func:`float`" -msgstr ":func:`float`" +#: ../../library/functions.rst:15 +msgid ":func:`next`" +msgstr ":func:`next`" -#: ../../library/functions.rst:0 -msgid ":func:`format`" -msgstr ":func:`format`" +#: ../../library/functions.rst:15 +msgid ":func:`slice`" +msgstr ":func:`slice`" -#: ../../library/functions.rst:0 -msgid "|func-frozenset|_" -msgstr "|func-frozenset|_" +#: ../../library/functions.rst:16 +msgid ":func:`ascii`" +msgstr ":func:`ascii`" -#: ../../library/functions.rst:0 -msgid "**G**" -msgstr "**G**" +#: ../../library/functions.rst:16 +msgid ":func:`divmod`" +msgstr ":func:`divmod`" -#: ../../library/functions.rst:0 -msgid ":func:`getattr`" -msgstr ":func:`getattr`" +#: ../../library/functions.rst:16 +msgid ":func:`id`" +msgstr ":func:`id`" -#: ../../library/functions.rst:0 -msgid ":func:`globals`" -msgstr ":func:`globals`" +#: ../../library/functions.rst:16 +msgid ":func:`object`" +msgstr ":func:`object`" -#: ../../library/functions.rst:0 -msgid "**H**" -msgstr "**H**" +#: ../../library/functions.rst:16 +msgid ":func:`sorted`" +msgstr ":func:`sorted`" -#: ../../library/functions.rst:0 -msgid ":func:`hasattr`" -msgstr ":func:`hasattr`" +#: ../../library/functions.rst:17 +msgid ":func:`bin`" +msgstr ":func:`bin`" -#: ../../library/functions.rst:0 -msgid ":func:`hash`" -msgstr ":func:`hash`" +#: ../../library/functions.rst:17 +msgid ":func:`enumerate`" +msgstr ":func:`enumerate`" -#: ../../library/functions.rst:0 -msgid ":func:`help`" -msgstr ":func:`help`" +#: ../../library/functions.rst:17 +msgid ":func:`input`" +msgstr ":func:`input`" -#: ../../library/functions.rst:0 -msgid ":func:`hex`" -msgstr ":func:`hex`" +#: ../../library/functions.rst:17 +msgid ":func:`oct`" +msgstr ":func:`oct`" -#: ../../library/functions.rst:0 -msgid "**I**" -msgstr "**I**" +#: ../../library/functions.rst:17 +msgid ":func:`staticmethod`" +msgstr ":func:`staticmethod`" -#: ../../library/functions.rst:0 -msgid ":func:`id`" -msgstr ":func:`id`" +#: ../../library/functions.rst:18 +msgid ":func:`bool`" +msgstr ":func:`bool`" -#: ../../library/functions.rst:0 -msgid ":func:`input`" -msgstr ":func:`input`" +#: ../../library/functions.rst:18 +msgid ":func:`eval`" +msgstr ":func:`eval`" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:18 msgid ":func:`int`" msgstr ":func:`int`" -#: ../../library/functions.rst:0 -msgid ":func:`isinstance`" -msgstr ":func:`isinstance`" - -#: ../../library/functions.rst:0 -msgid ":func:`issubclass`" -msgstr ":func:`issubclass`" - -#: ../../library/functions.rst:0 -msgid ":func:`iter`" -msgstr ":func:`iter`" +#: ../../library/functions.rst:18 +msgid ":func:`open`" +msgstr ":func:`open`" -#: ../../library/functions.rst:0 -msgid "**L**" -msgstr "**L**" +#: ../../library/functions.rst:18 +msgid "|func-str|_" +msgstr "|func-str|_" -#: ../../library/functions.rst:0 -msgid ":func:`len`" -msgstr ":func:`len`" +#: ../../library/functions.rst:19 +msgid ":func:`breakpoint`" +msgstr ":func:`breakpoint`" -#: ../../library/functions.rst:0 -msgid "|func-list|_" -msgstr "|func-list|_" +#: ../../library/functions.rst:19 +msgid ":func:`exec`" +msgstr ":func:`exec`" -#: ../../library/functions.rst:0 -msgid ":func:`locals`" -msgstr ":func:`locals`" +#: ../../library/functions.rst:19 +msgid ":func:`isinstance`" +msgstr ":func:`isinstance`" -#: ../../library/functions.rst:0 -msgid "**M**" -msgstr "**M**" +#: ../../library/functions.rst:19 +msgid ":func:`ord`" +msgstr ":func:`ord`" -#: ../../library/functions.rst:0 -msgid ":func:`map`" -msgstr ":func:`map`" +#: ../../library/functions.rst:19 +msgid ":func:`sum`" +msgstr ":func:`sum`" -#: ../../library/functions.rst:0 -msgid ":func:`max`" -msgstr ":func:`max`" +#: ../../library/functions.rst:20 +msgid "|func-bytearray|_" +msgstr "|func-bytearray|_" -#: ../../library/functions.rst:0 -msgid "|func-memoryview|_" -msgstr "|func-memoryview|_" +#: ../../library/functions.rst:20 +msgid ":func:`filter`" +msgstr ":func:`filter`" -#: ../../library/functions.rst:0 -msgid ":func:`min`" -msgstr ":func:`min`" +#: ../../library/functions.rst:20 +msgid ":func:`issubclass`" +msgstr ":func:`issubclass`" -#: ../../library/functions.rst:0 -msgid "**N**" -msgstr "**N**" +#: ../../library/functions.rst:20 +msgid ":func:`pow`" +msgstr ":func:`pow`" -#: ../../library/functions.rst:0 -msgid ":func:`next`" -msgstr ":func:`next`" +#: ../../library/functions.rst:20 +msgid ":func:`super`" +msgstr ":func:`super`" -#: ../../library/functions.rst:0 -msgid "**O**" -msgstr "**O**" +#: ../../library/functions.rst:21 +msgid "|func-bytes|_" +msgstr "|func-bytes|_" -#: ../../library/functions.rst:0 -msgid ":func:`object`" -msgstr ":func:`object`" +#: ../../library/functions.rst:21 +msgid ":func:`float`" +msgstr ":func:`float`" -#: ../../library/functions.rst:0 -msgid ":func:`oct`" -msgstr ":func:`oct`" +#: ../../library/functions.rst:21 +msgid ":func:`iter`" +msgstr ":func:`iter`" -#: ../../library/functions.rst:0 -msgid ":func:`open`" -msgstr ":func:`open`" +#: ../../library/functions.rst:21 +msgid ":func:`print`" +msgstr ":func:`print`" -#: ../../library/functions.rst:0 -msgid ":func:`ord`" -msgstr ":func:`ord`" +#: ../../library/functions.rst:21 +msgid "|func-tuple|_" +msgstr "|func-tuple|_" -#: ../../library/functions.rst:0 -msgid "**P**" -msgstr "**P**" +#: ../../library/functions.rst:22 +msgid ":func:`callable`" +msgstr ":func:`callable`" -#: ../../library/functions.rst:0 -msgid ":func:`pow`" -msgstr ":func:`pow`" +#: ../../library/functions.rst:22 +msgid ":func:`format`" +msgstr ":func:`format`" -#: ../../library/functions.rst:0 -msgid ":func:`print`" -msgstr ":func:`print`" +#: ../../library/functions.rst:22 +msgid ":func:`len`" +msgstr ":func:`len`" -#: ../../library/functions.rst:0 +#: ../../library/functions.rst:22 msgid ":func:`property`" msgstr ":func:`property`" -#: ../../library/functions.rst:0 -msgid "**R**" -msgstr "**R**" - -#: ../../library/functions.rst:0 -msgid "|func-range|_" -msgstr "|func-range|_" - -#: ../../library/functions.rst:0 -msgid ":func:`repr`" -msgstr ":func:`repr`" - -#: ../../library/functions.rst:0 -msgid ":func:`reversed`" -msgstr ":func:`reversed`" +#: ../../library/functions.rst:22 +msgid ":func:`type`" +msgstr ":func:`type`" -#: ../../library/functions.rst:0 -msgid ":func:`round`" -msgstr ":func:`round`" +#: ../../library/functions.rst:23 +msgid ":func:`chr`" +msgstr ":func:`chr`" -#: ../../library/functions.rst:0 -msgid "**S**" -msgstr "**S**" +#: ../../library/functions.rst:23 +msgid "|func-frozenset|_" +msgstr "|func-frozenset|_" -#: ../../library/functions.rst:0 -msgid "|func-set|_" -msgstr "|func-set|_" +#: ../../library/functions.rst:23 +msgid "|func-list|_" +msgstr "|func-list|_" -#: ../../library/functions.rst:0 -msgid ":func:`setattr`" -msgstr ":func:`setattr`" +#: ../../library/functions.rst:23 +msgid "|func-range|_" +msgstr "|func-range|_" -#: ../../library/functions.rst:0 -msgid ":func:`slice`" -msgstr ":func:`slice`" +#: ../../library/functions.rst:23 +msgid ":func:`vars`" +msgstr ":func:`vars`" -#: ../../library/functions.rst:0 -msgid ":func:`sorted`" -msgstr ":func:`sorted`" +#: ../../library/functions.rst:24 +msgid ":func:`classmethod`" +msgstr ":func:`classmethod`" -#: ../../library/functions.rst:0 -msgid ":func:`staticmethod`" -msgstr ":func:`staticmethod`" +#: ../../library/functions.rst:24 +msgid ":func:`getattr`" +msgstr ":func:`getattr`" -#: ../../library/functions.rst:0 -msgid "|func-str|_" -msgstr "|func-str|_" +#: ../../library/functions.rst:24 +msgid ":func:`locals`" +msgstr ":func:`locals`" -#: ../../library/functions.rst:0 -msgid ":func:`sum`" -msgstr ":func:`sum`" +#: ../../library/functions.rst:24 +msgid ":func:`repr`" +msgstr ":func:`repr`" -#: ../../library/functions.rst:0 -msgid ":func:`super`" -msgstr ":func:`super`" +#: ../../library/functions.rst:24 +msgid ":func:`zip`" +msgstr ":func:`zip`" -#: ../../library/functions.rst:0 -msgid "**T**" -msgstr "**T**" +#: ../../library/functions.rst:25 +msgid ":func:`compile`" +msgstr ":func:`compile`" -#: ../../library/functions.rst:0 -msgid "|func-tuple|_" -msgstr "|func-tuple|_" +#: ../../library/functions.rst:25 +msgid ":func:`globals`" +msgstr ":func:`globals`" -#: ../../library/functions.rst:0 -msgid ":func:`type`" -msgstr ":func:`type`" +#: ../../library/functions.rst:25 +msgid ":func:`map`" +msgstr ":func:`map`" -#: ../../library/functions.rst:0 -msgid "**V**" -msgstr "**V**" +#: ../../library/functions.rst:25 +msgid ":func:`reversed`" +msgstr ":func:`reversed`" -#: ../../library/functions.rst:0 -msgid ":func:`vars`" -msgstr ":func:`vars`" +#: ../../library/functions.rst:25 +msgid ":func:`__import__`" +msgstr ":func:`__import__`" -#: ../../library/functions.rst:0 -msgid "**Z**" -msgstr "**Z**" +#: ../../library/functions.rst:26 +msgid ":func:`complex`" +msgstr ":func:`complex`" -#: ../../library/functions.rst:0 -msgid ":func:`zip`" -msgstr ":func:`zip`" +#: ../../library/functions.rst:26 +msgid ":func:`hasattr`" +msgstr ":func:`hasattr`" -#: ../../library/functions.rst:0 -msgid "**_**" -msgstr "**_**" +#: ../../library/functions.rst:26 +msgid ":func:`max`" +msgstr ":func:`max`" -#: ../../library/functions.rst:0 -msgid ":func:`__import__`" -msgstr ":func:`__import__`" +#: ../../library/functions.rst:26 +msgid ":func:`round`" +msgstr ":func:`round`" -#: ../../library/functions.rst:59 +#: ../../library/functions.rst:45 msgid "" "Return the absolute value of a number. The argument may be an integer, a " -"floating-point number, or an object implementing :meth:`~object.__abs__`. If " -"the argument is a complex number, its magnitude is returned." +"floating point number, or an object implementing :meth:`__abs__`. If the " +"argument is a complex number, its magnitude is returned." msgstr "" -"数の絶対値を返します。引数は整数、浮動小数点数または :meth:`~object.__abs__` " -"が実装されたオブジェクトです。引数が複素数なら、その絶対値 (magnitude) が返さ" -"れます。" +"数の絶対値を返します。引数は整数、浮動小数点数または :meth:`__abs__` が実装さ" +"れたオブジェクトです。引数が複素数なら、その絶対値 (magnitude) が返されます。" -#: ../../library/functions.rst:67 -msgid "" -"Return an :term:`asynchronous iterator` for an :term:`asynchronous " -"iterable`. Equivalent to calling ``x.__aiter__()``." -msgstr "" -":term:`asynchronous iterable` から :term:`asynchronous iterator` を返しま" -"す。 ``x.__aiter__()`` を呼び出すのと等価です。" - -#: ../../library/functions.rst:70 -msgid "Note: Unlike :func:`iter`, :func:`aiter` has no 2-argument variant." -msgstr "" -"なお、 :func:`iter` とは異なり、 :func:`aiter` は第二引数を持ちません。" - -#: ../../library/functions.rst:76 +#: ../../library/functions.rst:52 msgid "" "Return ``True`` if all elements of the *iterable* are true (or if the " "iterable is empty). Equivalent to::" @@ -446,49 +341,7 @@ msgstr "" "*iterable* の全ての要素が真ならば (もしくは *iterable* が空ならば) ``True`` " "を返します。以下のコードと等価です::" -#: ../../library/functions.rst:79 -msgid "" -"def all(iterable):\n" -" for element in iterable:\n" -" if not element:\n" -" return False\n" -" return True" -msgstr "" -"def all(iterable):\n" -" for element in iterable:\n" -" if not element:\n" -" return False\n" -" return True" - -#: ../../library/functions.rst:89 -msgid "" -"When awaited, return the next item from the given :term:`asynchronous " -"iterator`, or *default* if given and the iterator is exhausted." -msgstr "" -"待ち受け中に、与えられた非同期イテレータ (:term:`asynchronous iterator`) を返" -"します。イテレータが枯渇した場合、 *default* が与えられていれば *default* を" -"返します。" - -#: ../../library/functions.rst:92 -msgid "" -"This is the async variant of the :func:`next` builtin, and behaves similarly." -msgstr "" -"これは組み込みの :func:`next` 関数の非同期版であり、同じように動作します。" - -#: ../../library/functions.rst:95 -msgid "" -"This calls the :meth:`~object.__anext__` method of *async_iterator*, " -"returning an :term:`awaitable`. Awaiting this returns the next value of the " -"iterator. If *default* is given, it is returned if the iterator is " -"exhausted, otherwise :exc:`StopAsyncIteration` is raised." -msgstr "" -"これは *async_iterator* の :meth:`~object.__anext__` メソッドを呼び出し、待ち" -"受け可能オブジェクト (:term:`awaitable`) を返します。待ち受けることによりイテ" -"レータの次の値を返します。 *default* が与えられた場合、イテレータが枯渇したと" -"きにその値が返されます。 *default* が与えられない場合は :exc:" -"`StopAsyncIteration` が送出されます。" - -#: ../../library/functions.rst:104 +#: ../../library/functions.rst:64 msgid "" "Return ``True`` if any element of the *iterable* is true. If the iterable " "is empty, return ``False``. Equivalent to::" @@ -496,25 +349,11 @@ msgstr "" "*iterable* のいずれかの要素が真ならば ``True`` を返します。*iterable* が空な" "ら ``False`` を返します。以下のコードと等価です::" -#: ../../library/functions.rst:107 -msgid "" -"def any(iterable):\n" -" for element in iterable:\n" -" if element:\n" -" return True\n" -" return False" -msgstr "" -"def any(iterable):\n" -" for element in iterable:\n" -" if element:\n" -" return True\n" -" return False" - -#: ../../library/functions.rst:116 +#: ../../library/functions.rst:76 msgid "" "As :func:`repr`, return a string containing a printable representation of an " "object, but escape the non-ASCII characters in the string returned by :func:" -"`repr` using ``\\x``, ``\\u``, or ``\\U`` escapes. This generates a string " +"`repr` using ``\\x``, ``\\u`` or ``\\U`` escapes. This generates a string " "similar to that returned by :func:`repr` in Python 2." msgstr "" ":func:`repr` と同様、オブジェクトの印字可能な表現を含む文字列を返しますが、:" @@ -522,94 +361,77 @@ msgstr "" "``\\U`` エスケープを使ってエスケープされます。これは Python 2 の :func:" "`repr` によって返されるのと同じ文字列を作ります。" -#: ../../library/functions.rst:124 +#: ../../library/functions.rst:84 msgid "" "Convert an integer number to a binary string prefixed with \"0b\". The " "result is a valid Python expression. If *x* is not a Python :class:`int` " -"object, it has to define an :meth:`~object.__index__` method that returns an " +"object, it has to define an :meth:`__index__` method that returns an " "integer. Some examples:" msgstr "" "整数を先頭に \"0b\" が付いた 2 進文字列に変換します。\n" "結果は Python の式としても使える形式になります。\n" -"*x* が Python の :class:`int` オブジェクトでない場合、整数を返す :meth:" -"`~object.__index__` メソッドが定義されていなければなりません。\n" +" *x* が Python の :class:`int` オブジェクトでない場合、整数を返す :meth:" +"`__index__` メソッドが定義されていなければなりません。\n" "いくつかの例を示します:" -#: ../../library/functions.rst:134 +#: ../../library/functions.rst:94 msgid "" -"If the prefix \"0b\" is desired or not, you can use either of the following " -"ways." +"If prefix \"0b\" is desired or not, you can use either of the following ways." msgstr "" "先頭に \"0b\" が付いて欲しい、もしくは付いて欲しくない場合には、次の方法のど" "ちらでも使えます。" -#: ../../library/functions.rst:141 ../../library/functions.rst:950 -#: ../../library/functions.rst:1335 +#: ../../library/functions.rst:101 ../../library/functions.rst:757 +#: ../../library/functions.rst:1044 msgid "See also :func:`format` for more information." msgstr "より詳しいことは :func:`format` も参照してください。" -#: ../../library/functions.rst:146 +#: ../../library/functions.rst:106 msgid "" -"Return a Boolean value, i.e. one of ``True`` or ``False``. The argument is " -"converted using the standard :ref:`truth testing procedure `. If the " -"argument is false or omitted, this returns ``False``; otherwise, it returns " -"``True``. The :class:`bool` class is a subclass of :class:`int` (see :ref:" -"`typesnumeric`). It cannot be subclassed further. Its only instances are " -"``False`` and ``True`` (see :ref:`typebool`)." -msgstr "" -"真偽値、すなわち ``True`` か ``False`` のいずれかを返します。引数は標準の :" -"ref:`真偽値判定手続き ` を用いて変換されます。引数が偽かまたは省略され" -"た場合、この関数は ``False`` を返します。それ以外の場合は ``True`` を返しま" -"す。 :class:`bool` クラスは :class:`int` クラスの派生クラスです (:ref:" +"Return a Boolean value, i.e. one of ``True`` or ``False``. *x* is converted " +"using the standard :ref:`truth testing procedure `. If *x* is false " +"or omitted, this returns ``False``; otherwise it returns ``True``. The :" +"class:`bool` class is a subclass of :class:`int` (see :ref:`typesnumeric`). " +"It cannot be subclassed further. Its only instances are ``False`` and " +"``True`` (see :ref:`bltin-boolean-values`)." +msgstr "" +"ブール値、即ち ``True`` または ``False`` のどちらかを返します。*x* は標準の :" +"ref:`真理値判定手続き` を用いて変換されます。*x* が偽または省略されて" +"いる場合、この関数は ``False`` を返します。それ以外の場合、``True`` を返しま" +"す。:class:`bool` クラスは :class:`int` クラスの派生クラスです(:ref:" "`typesnumeric` を参照してください)。このクラスからさらに派生することはできま" -"せん。このクラスのインスタンスは ``False`` と ``True`` のみです (:ref:" -"`typebool` を参照してください)。" +"せん。ブール値のインスタンスは ``False`` と ``True`` のみです(:ref:`bltin-" +"boolean-values` を参照してください)。" -#: ../../library/functions.rst:156 ../../library/functions.rst:815 -msgid "The parameter is now positional-only." -msgstr "引数は位置専用になりました。" +#: ../../library/functions.rst:115 ../../library/functions.rst:625 +#: ../../library/functions.rst:841 +msgid "*x* is now a positional-only parameter." +msgstr "*x* は位置専用引数になりました。" -#: ../../library/functions.rst:161 +#: ../../library/functions.rst:120 msgid "" "This function drops you into the debugger at the call site. Specifically, " "it calls :func:`sys.breakpointhook`, passing ``args`` and ``kws`` straight " -"through. By default, ``sys.breakpointhook()`` calls :func:`pdb.set_trace` " +"through. By default, ``sys.breakpointhook()`` calls :func:`pdb.set_trace()` " "expecting no arguments. In this case, it is purely a convenience function " "so you don't have to explicitly import :mod:`pdb` or type as much code to " "enter the debugger. However, :func:`sys.breakpointhook` can be set to some " "other function and :func:`breakpoint` will automatically call that, allowing " -"you to drop into the debugger of choice. If :func:`sys.breakpointhook` is " -"not accessible, this function will raise :exc:`RuntimeError`." -msgstr "" -"この関数は、呼び出された箇所にて処理をデバッガに移行します。具体的には、 :" -"func:`sys.breakpointhook` を呼び出し、 ``args`` と ``kws`` をそのまま渡しま" -"す。デフォルトでは、 ``sys.breakpointhook()`` は引数なしで :func:`pdb." -"set_trace` を呼び出すだけです。その場合、これは単なる便利関数でデバッガに入る" -"ために :mod:`pdb` を明示的にインポートしたり多くのコードを書いたりせずに済む" -"だけです。ですが、 :func:`sys.breakpointhook` は別の関数に設定でき、 :func:" -"`breakpoint` はそれを自動で呼び出すため、自分好みのデバッガに処理を移行させる" -"ことができます。 :func:`sys.breakpointhook` にアクセスできない場合、この関数" -"は :exc:`RuntimeError` を送出します。" - -#: ../../library/functions.rst:173 -msgid "" -"By default, the behavior of :func:`breakpoint` can be changed with the :" -"envvar:`PYTHONBREAKPOINT` environment variable. See :func:`sys." -"breakpointhook` for usage details." -msgstr "" -"デフォルトでは、環境変数 :envvar:`PYTHONBREAKPOINT` をセットすることで :func:" -"`breakpoint` の動作を変えることができます。\n" -"使い方の詳細は :func:`sys.breakpointhook` を参照してください。" - -#: ../../library/functions.rst:177 -msgid "" -"Note that this is not guaranteed if :func:`sys.breakpointhook` has been " -"replaced." -msgstr "" -"ただし、 :func:`sys.breakpointhook` が別の関数で置き換えられている場合、上記" -"の環境変数によって必ずしも動作を変えることができないことに注意してください。" - -#: ../../library/functions.rst:180 +"you to drop into the debugger of choice." +msgstr "" +"この関数により、呼び出された箇所からデバッガへ移行します。\n" +"特に、この関数は ``args`` および ``kws`` をそのまま :func:`sys." +"breakpointhook` に渡して呼び出します。\n" +"デフォルトでは、 ``sys.breakpointhook()`` は引数無しで :func:`pdb." +"set_trace()` を呼び出します。\n" +"このケースでは、 :func:`pdb.set_trace()` は単なる便利な関数なので、明示的に :" +"mod:`pdb` をインポートしたり、デバッガに入るためにキーをたくさん打ち込む必要" +"はありません。\n" +"ただし、 :func:`sys.breakpointhook` は他の関数を設定することもでき、 :func:" +"`breakpoint` は自動的にその関数を呼び出します。これにより、最適なデバッガに移" +"行できます。" + +#: ../../library/functions.rst:130 msgid "" "Raises an :ref:`auditing event ` ``builtins.breakpoint`` with " "argument ``breakpointhook``." @@ -617,7 +439,7 @@ msgstr "" "引数 ``breakpointhook`` 付きで :ref:`監査イベント ` ``builtins." "breakpoint`` を送出します。" -#: ../../library/functions.rst:190 +#: ../../library/functions.rst:138 msgid "" "Return a new array of bytes. The :class:`bytearray` class is a mutable " "sequence of integers in the range 0 <= x < 256. It has most of the usual " @@ -629,14 +451,14 @@ msgstr "" "能な配列に対する普通のメソッドの大半を備えています。また、:class:`bytes` 型が" "持つメソッドの大半も備えています(see :ref:`bytes-methods`)。" -#: ../../library/functions.rst:195 +#: ../../library/functions.rst:143 msgid "" "The optional *source* parameter can be used to initialize the array in a few " "different ways:" msgstr "" "オプションの *source* 引数は、配列を異なる方法で初期化するのに使われます:" -#: ../../library/functions.rst:198 +#: ../../library/functions.rst:146 msgid "" "If it is a *string*, you must also give the *encoding* (and optionally, " "*errors*) parameters; :func:`bytearray` then converts the string to bytes " @@ -646,13 +468,13 @@ msgstr "" "りません。このとき :func:`bytearray` は文字列を :meth:`str.encode` でバイトに" "変換して返します。" -#: ../../library/functions.rst:202 +#: ../../library/functions.rst:150 msgid "" "If it is an *integer*, the array will have that size and will be initialized " "with null bytes." msgstr "*整数* の場合、配列はそのサイズになり、null バイトで初期化されます。" -#: ../../library/functions.rst:205 +#: ../../library/functions.rst:153 msgid "" "If it is an object conforming to the :ref:`buffer interface " "`, a read-only buffer of the object will be used to " @@ -661,7 +483,7 @@ msgstr "" ":ref:`バッファインターフェース ` に適合するオブジェクトの場" "合、そのオブジェクトの読み出し専用バッファがバイト配列の初期化に使われます。" -#: ../../library/functions.rst:208 +#: ../../library/functions.rst:156 msgid "" "If it is an *iterable*, it must be an iterable of integers in the range ``0 " "<= x < 256``, which are used as the initial contents of the array." @@ -669,66 +491,66 @@ msgstr "" "*イテラブル* の場合、範囲 ``0 <= x < 256`` 内の整数のイテラブルでなければなら" "ず、それらが配列の初期の内容として使われます。" -#: ../../library/functions.rst:211 +#: ../../library/functions.rst:159 msgid "Without an argument, an array of size 0 is created." msgstr "引数がなければ、長さ 0 の配列が生成されます。" -#: ../../library/functions.rst:213 +#: ../../library/functions.rst:161 msgid "See also :ref:`binaryseq` and :ref:`typebytearray`." msgstr ":ref:`binaryseq` と :ref:`typebytearray` も参照してください。" -#: ../../library/functions.rst:222 +#: ../../library/functions.rst:168 msgid "" -"Return a new \"bytes\" object which is an immutable sequence of integers in " +"Return a new \"bytes\" object, which is an immutable sequence of integers in " "the range ``0 <= x < 256``. :class:`bytes` is an immutable version of :" "class:`bytearray` -- it has the same non-mutating methods and the same " "indexing and slicing behavior." msgstr "" "範囲 ``0 <= x < 256`` の整数のイミュータブルなシーケンスである \"bytes\" オブ" "ジェクトを返します。 :class:`bytes` は :class:`bytearray` のイミュータブル版" -"であり、オブジェクトを変化させないメソッドや、インデックス指定、オブジェクト" -"のスライスについてのふるまいは同じです。" +"です。オブジェクトを変化させないようなメソッドや、インデクシングやスライシン" +"グのふるまいは、これと同様のものです。" -#: ../../library/functions.rst:227 +#: ../../library/functions.rst:173 msgid "" "Accordingly, constructor arguments are interpreted as for :func:`bytearray`." msgstr "" "従って、コンストラクタ引数は :func:`bytearray` のものと同様に解釈されます。" -#: ../../library/functions.rst:229 +#: ../../library/functions.rst:175 msgid "Bytes objects can also be created with literals, see :ref:`strings`." msgstr "" "バイト列オブジェクトはリテラルでも生成できます。 :ref:`strings` を参照してく" "ださい。" -#: ../../library/functions.rst:231 +#: ../../library/functions.rst:177 msgid "See also :ref:`binaryseq`, :ref:`typebytes`, and :ref:`bytes-methods`." msgstr "" ":ref:`binaryseq`, :ref:`typebytes`, :ref:`bytes-methods` も参照してください。" -#: ../../library/functions.rst:236 +#: ../../library/functions.rst:182 msgid "" "Return :const:`True` if the *object* argument appears callable, :const:" "`False` if not. If this returns ``True``, it is still possible that a call " "fails, but if it is ``False``, calling *object* will never succeed. Note " "that classes are callable (calling a class returns a new instance); " -"instances are callable if their class has a :meth:`~object.__call__` method." +"instances are callable if their class has a :meth:`__call__` method." msgstr "" "*object* 引数が呼び出し可能オブジェクトであれば :const:`True` を、そうでなけ" "れば :const:`False` を返します。この関数が ``True`` を返しても、呼び出しは失" "敗する可能性がありますが、``False`` であれば、 *object* の呼び出しは決して成" "功しません。なお、クラスは呼び出し可能 (クラスを呼び出すと新しいインスタンス" -"を返します) です。また、インスタンスはクラスが :meth:`~object.__call__` メ" -"ソッドを持つなら呼び出し可能です。" +"を返します) です。また、インスタンスはクラスが :meth:`__call__` メソッドを持" +"つなら呼び出し可能です。" -#: ../../library/functions.rst:242 +#: ../../library/functions.rst:188 msgid "" "This function was first removed in Python 3.0 and then brought back in " "Python 3.2." msgstr "" "この関数は Python 3.0 で一度取り除かれましたが、Python 3.2 で復活しました。" -#: ../../library/functions.rst:249 +#: ../../library/functions.rst:195 msgid "" "Return the string representing a character whose Unicode code point is the " "integer *i*. For example, ``chr(97)`` returns the string ``'a'``, while " @@ -738,7 +560,7 @@ msgstr "" "``chr(97)`` は文字列 ``'a'`` を、 ``chr(8364)`` は文字列 ``'€'`` を返しま" "す。 :func:`ord` の逆です。" -#: ../../library/functions.rst:253 +#: ../../library/functions.rst:199 msgid "" "The valid range for the argument is from 0 through 1,114,111 (0x10FFFF in " "base 16). :exc:`ValueError` will be raised if *i* is outside that range." @@ -746,31 +568,21 @@ msgstr "" "引数の有効な範囲は 0 から 1,114,111 (16 進数で 0x10FFFF) です。 *i* が範囲外" "の場合 :exc:`ValueError` が送出されます。" -#: ../../library/functions.rst:259 +#: ../../library/functions.rst:205 msgid "Transform a method into a class method." msgstr "メソッドをクラスメソッドへ変換します。" -#: ../../library/functions.rst:261 +#: ../../library/functions.rst:207 msgid "" -"A class method receives the class as an implicit first argument, just like " -"an instance method receives the instance. To declare a class method, use " -"this idiom::" +"A class method receives the class as implicit first argument, just like an " +"instance method receives the instance. To declare a class method, use this " +"idiom::" msgstr "" "クラスメソッドは、インスタンスメソッドが暗黙の第一引数としてインスタンスをと" "るように、第一引数としてクラスをとります。クラスメソッドを宣言するには、以下" "のイディオムを使います::" -#: ../../library/functions.rst:265 -msgid "" -"class C:\n" -" @classmethod\n" -" def f(cls, arg1, arg2): ..." -msgstr "" -"class C:\n" -" @classmethod\n" -" def f(cls, arg1, arg2): ..." - -#: ../../library/functions.rst:269 +#: ../../library/functions.rst:215 msgid "" "The ``@classmethod`` form is a function :term:`decorator` -- see :ref:" "`function` for details." @@ -778,7 +590,7 @@ msgstr "" "``@classmethod`` 形式は関数 :term:`デコレータ ` です。詳しくは :" "ref:`function` を参照してください。" -#: ../../library/functions.rst:272 +#: ../../library/functions.rst:218 msgid "" "A class method can be called either on the class (such as ``C.f()``) or on " "an instance (such as ``C().f()``). The instance is ignored except for its " @@ -791,7 +603,7 @@ msgstr "" "クラスメソッドが派生クラスから呼び出される場合は、その派生クラスオブジェクト" "が暗黙の第一引数として渡されます。" -#: ../../library/functions.rst:277 +#: ../../library/functions.rst:223 msgid "" "Class methods are different than C++ or Java static methods. If you want " "those, see :func:`staticmethod` in this section. For more information on " @@ -801,7 +613,7 @@ msgstr "" "の節の :func:`staticmethod` を参照してください。クラスメソッドについてより詳" "しいことは :ref:`types` を参照してください。" -#: ../../library/functions.rst:281 +#: ../../library/functions.rst:227 msgid "" "Class methods can now wrap other :term:`descriptors ` such as :" "func:`property`." @@ -809,27 +621,7 @@ msgstr "" "クラスメソッドは :func:`property` など、他の :term:`デスクリプタ " "` をラップすることができるようになりました。" -#: ../../library/functions.rst:285 -msgid "" -"Class methods now inherit the method attributes (:attr:`~function." -"__module__`, :attr:`~function.__name__`, :attr:`~function.__qualname__`, :" -"attr:`~function.__doc__` and :attr:`~function.__annotations__`) and have a " -"new ``__wrapped__`` attribute." -msgstr "" -"クラスメソッドはメソッド属性 (:attr:`~function.__module__`, :attr:`~function." -"__name__`, :attr:`~function.__qualname__`, :attr:`~function.__doc__` と :" -"attr:`~function.__annotations__`) を継承するようになりました。また、新たに " -"``__wrapped__`` 属性を持つようになりました。" - -#: ../../library/functions.rst:292 -msgid "" -"Class methods can no longer wrap other :term:`descriptors ` such " -"as :func:`property`." -msgstr "" -"クラスメソッドは :func:`property` など、他の :term:`デスクリプタ " -"` をラップすることができなくなりました。" - -#: ../../library/functions.rst:299 +#: ../../library/functions.rst:233 msgid "" "Compile the *source* into a code or AST object. Code objects can be " "executed by :func:`exec` or :func:`eval`. *source* can either be a normal " @@ -842,7 +634,7 @@ msgstr "" "れでもかまいません。 AST オブジェクトへの、また、 AST オブジェクトからのコン" "パイルの方法は、 :mod:`ast` モジュールのドキュメントを参照してください。" -#: ../../library/functions.rst:304 +#: ../../library/functions.rst:238 msgid "" "The *filename* argument should give the file from which the code was read; " "pass some recognizable value if it wasn't read from a file (``''`` " @@ -852,7 +644,7 @@ msgstr "" "ファイルから読み出されるのでなければ、認識可能な値を渡して下さい " "(``''`` が一般的に使われます)。" -#: ../../library/functions.rst:308 +#: ../../library/functions.rst:242 msgid "" "The *mode* argument specifies what kind of code must be compiled; it can be " "``'exec'`` if *source* consists of a sequence of statements, ``'eval'`` if " @@ -865,7 +657,7 @@ msgstr "" "場合 ``'single'`` です。(後者の場合、評価が ``None`` 以外である式文が印字され" "ます)。" -#: ../../library/functions.rst:314 +#: ../../library/functions.rst:248 msgid "" "The optional arguments *flags* and *dont_inherit* control which :ref:" "`compiler options ` should be activated and which :ref:" @@ -888,7 +680,7 @@ msgstr "" "で指定されたオプションだけが有効です -- 呼び出し元コードに適用されたフラグ " "(将来の機能とコンパイラオプション) は無視されます。" -#: ../../library/functions.rst:325 +#: ../../library/functions.rst:259 msgid "" "Compiler options and future statements are specified by bits which can be " "bitwise ORed together to specify multiple options. The bitfield required to " @@ -905,7 +697,7 @@ msgstr "" "ref:`コンパイラフラグ ` の情報は :mod:`ast` モジュールの " "``PyCF_`` で始まるフラグで得ることができます。" -#: ../../library/functions.rst:333 +#: ../../library/functions.rst:267 msgid "" "The argument *optimize* specifies the optimization level of the compiler; " "the default value of ``-1`` selects the optimization level of the " @@ -919,7 +711,7 @@ msgstr "" "``1`` (assert は取り除かれ、 ``__debug__`` は偽)、 ``2`` (docstring も取り除" "かれる) です。" -#: ../../library/functions.rst:339 +#: ../../library/functions.rst:273 msgid "" "This function raises :exc:`SyntaxError` if the compiled source is invalid, " "and :exc:`ValueError` if the source contains null bytes." @@ -927,7 +719,7 @@ msgstr "" "この関数は、コンパイルされたソースが不正である場合 :exc:`SyntaxError` を、" "ソースがヌルバイトを含む場合 :exc:`ValueError` を送出します。" -#: ../../library/functions.rst:342 +#: ../../library/functions.rst:276 msgid "" "If you want to parse Python code into its AST representation, see :func:`ast." "parse`." @@ -935,7 +727,15 @@ msgstr "" "Python コードをパースしてその AST 表現を得たいのであれば、 :func:`ast.parse` " "を参照してください。" -#: ../../library/functions.rst:345 ../../library/functions.rst:347 +#: ../../library/functions.rst:279 +msgid "" +"Raises an :ref:`auditing event ` ``compile`` with arguments " +"``source``, ``filename``." +msgstr "" +"引数 ``source``, ``filename`` を指定して :ref:`監査イベント ` " +"``compile`` を送出します。 " + +#: ../../library/functions.rst:281 msgid "" "Raises an :ref:`auditing event ` ``compile`` with arguments " "``source`` and ``filename``. This event may also be raised by implicit " @@ -945,7 +745,7 @@ msgstr "" "``compile`` を送出します。これは、暗黙に行われるコンパイルでも送出される可能" "性があります。" -#: ../../library/functions.rst:353 +#: ../../library/functions.rst:287 msgid "" "When compiling a string with multi-line code in ``'single'`` or ``'eval'`` " "mode, input must be terminated by at least one newline character. This is " @@ -956,7 +756,7 @@ msgstr "" "るとき、入力は一つ以上の改行文字で終端されなければなりません。これは、 :mod:" "`code` モジュールで不完全な文と完全な文を検知しやすくするためです。" -#: ../../library/functions.rst:360 +#: ../../library/functions.rst:294 msgid "" "It is possible to crash the Python interpreter with a sufficiently large/" "complex string when compiling to an AST object due to stack depth " @@ -966,15 +766,15 @@ msgstr "" "によって Python の抽象構文木コンパイラのスタックが深さの限界を越えることで、 " "Python インタプリタをクラッシュさせられます。" -#: ../../library/functions.rst:364 +#: ../../library/functions.rst:298 msgid "" -"Allowed use of Windows and Mac newlines. Also, input in ``'exec'`` mode " -"does not have to end in a newline anymore. Added the *optimize* parameter." +"Allowed use of Windows and Mac newlines. Also input in ``'exec'`` mode does " +"not have to end in a newline anymore. Added the *optimize* parameter." msgstr "" "Windows や Mac の改行も受け付けます。また ``'exec'`` モードでの入力が改行で終" "わっている必要もありません。*optimize* 引数が追加されました。" -#: ../../library/functions.rst:368 +#: ../../library/functions.rst:302 msgid "" "Previously, :exc:`TypeError` was raised when null bytes were encountered in " "*source*." @@ -982,7 +782,7 @@ msgstr "" "以前は *source* にヌルバイトがあったときに :exc:`TypeError` を送出していまし" "た。" -#: ../../library/functions.rst:372 +#: ../../library/functions.rst:306 msgid "" "``ast.PyCF_ALLOW_TOP_LEVEL_AWAIT`` can now be passed in flags to enable " "support for top-level ``await``, ``async for``, and ``async with``." @@ -991,159 +791,76 @@ msgstr "" "``async for``, および ``async with`` のサポートを有効化することができるように" "なりました。" -#: ../../library/functions.rst:381 +#: ../../library/functions.rst:313 msgid "" -"Convert a single string or number to a complex number, or create a complex " -"number from real and imaginary parts." +"Return a complex number with the value *real* + *imag*\\*1j or convert a " +"string or number to a complex number. If the first parameter is a string, " +"it will be interpreted as a complex number and the function must be called " +"without a second parameter. The second parameter can never be a string. " +"Each argument may be any numeric type (including complex). If *imag* is " +"omitted, it defaults to zero and the constructor serves as a numeric " +"conversion like :class:`int` and :class:`float`. If both arguments are " +"omitted, returns ``0j``." msgstr "" -"単一の文字列や数値を複素数に変換する、あるいは実部と虚部から複素数を作成しま" -"す。" +"値 *real* + *imag*\\*1j の複素数を返すか、文字列や数を複素数に変換します。第" +"一引数が文字列なら、それが複素数と解釈され、この関数は第二引数無しで呼び出さ" +"れなければなりません。第二引数は文字列であってはなりません。それぞれの引数は " +"(複素数を含む) 任意の数値型です。 *imag* が省略された場合、標準の値はゼロで、" +"このコンストラクタは :class:`int` や :class:`float` のような数値変換としては" +"たらきます。両方の引数が省略された場合、 ``0j`` を返します。" -#: ../../library/functions.rst:384 ../../library/functions.rst:758 -#: ../../library/functions.rst:1006 -msgid "Examples:" -msgstr "例:" - -#: ../../library/functions.rst:386 -msgid "" -">>> complex('+1.23')\n" -"(1.23+0j)\n" -">>> complex('-4.5j')\n" -"-4.5j\n" -">>> complex('-1.23+4.5j')\n" -"(-1.23+4.5j)\n" -">>> complex('\\t( -1.23+4.5J )\\n')\n" -"(-1.23+4.5j)\n" -">>> complex('-Infinity+NaNj')\n" -"(-inf+nanj)\n" -">>> complex(1.23)\n" -"(1.23+0j)\n" -">>> complex(imag=-4.5)\n" -"-4.5j\n" -">>> complex(-1.23, 4.5)\n" -"(-1.23+4.5j)" -msgstr "" -">>> complex('+1.23')\n" -"(1.23+0j)\n" -">>> complex('-4.5j')\n" -"-4.5j\n" -">>> complex('-1.23+4.5j')\n" -"(-1.23+4.5j)\n" -">>> complex('\\t( -1.23+4.5J )\\n')\n" -"(-1.23+4.5j)\n" -">>> complex('-Infinity+NaNj')\n" -"(-inf+nanj)\n" -">>> complex(1.23)\n" -"(1.23+0j)\n" -">>> complex(imag=-4.5)\n" -"-4.5j\n" -">>> complex(-1.23, 4.5)\n" -"(-1.23+4.5j)" - -#: ../../library/functions.rst:405 -msgid "" -"If the argument is a string, it must contain either a real part (in the same " -"format as for :func:`float`) or an imaginary part (in the same format but " -"with a ``'j'`` or ``'J'`` suffix), or both real and imaginary parts (the " -"sign of the imaginary part is mandatory in this case). The string can " -"optionally be surrounded by whitespaces and the round parentheses ``'('`` " -"and ``')'``, which are ignored. The string must not contain whitespace " -"between ``'+'``, ``'-'``, the ``'j'`` or ``'J'`` suffix, and the decimal " -"number. For example, ``complex('1+2j')`` is fine, but ``complex('1 + 2j')`` " -"raises :exc:`ValueError`. More precisely, the input must conform to the :" -"token:`~float:complexvalue` production rule in the following grammar, after " -"parentheses and leading and trailing whitespace characters are removed:" -msgstr "" -"引数が文字列の場合、実数部( :func:`float` と同じ形式)、虚数部(同様の形式" -"で ``'j'`` または ``'J'`` 接尾辞)どちらか、あるいは両方(この場合、虚数部の" -"符号は必須)を含まなければなりません。文字列 は空白や括弧 ``'('`` と``')'`` " -"で囲むこともできますが、無視されます。文字列は、 ``'+'`` 、``'-'`` 、 " -"``'j'`` または ``'J'`` 接尾辞 、そして10進数の間に空白を含んではなりません。" -"たとえば ``complex('1+2j')`` はよいですが、 ``complex('1 + 2j')`` は :exc:" -"`ValueError` を送出します。より正確には、入力は括弧および先頭と末尾の空白文字" -"を除去した後、以下の文法における :token:`~float:complexvalue` の生成規則を満" -"たす必要があります:" - -#: ../../library/functions.rst:424 -msgid "" -"If the argument is a number, the constructor serves as a numeric conversion " -"like :class:`int` and :class:`float`. For a general Python object ``x``, " -"``complex(x)`` delegates to ``x.__complex__()``. If :meth:`~object." -"__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 "" -"引数が数値の場合、コンストラクタは :class:`int` や :class:`float` のように数" -"値変換します。一般的な Python オブジェクト ``x`` では、 ``complex(x)`` は " -"``x.__complex__()`` に委譲します。 :meth:`~object.__complex__` が定義されてい" -"ない場合は :meth:`~object.__float__` にフォールバックします。 :meth:`!" -"__float__` も定義されていない場合には、 :meth:`~object.__index__` にフォール" -"バックします。" - -#: ../../library/functions.rst:433 -msgid "" -"If two arguments are provided or keyword arguments are used, each argument " -"may be any numeric type (including complex). If both arguments are real " -"numbers, return a complex number with the real component *real* and the " -"imaginary component *imag*. If both arguments are complex numbers, return a " -"complex number with the real component ``real.real-imag.imag`` and the " -"imaginary component ``real.imag+imag.real``. If one of arguments is a real " -"number, only its real component is used in the above expressions." -msgstr "" -"2引数が指定されるかキーワード引数が使われている場合、各引数は任意の数値型" -"(複素数を含む)となります。両方の引数が実数の場合には、実数成分 *real* と虚" -"数成分 *imag* を持つ複素数を返します。引数が両方とも複素数の場合、実数成分 " -"``real.real-imag.imag`` と虚数成分 ``real.imag+imag.real`` を持つ複素数を返し" -"ます。引数の片方が実数の場合、前述の式ではその実数成分のみ使われます。" - -#: ../../library/functions.rst:443 -msgid "" -"See also :meth:`complex.from_number` which only accepts a single numeric " -"argument." -msgstr "" - -#: ../../library/functions.rst:445 -msgid "If all arguments are omitted, returns ``0j``." -msgstr "引数がすべて省略された場合は、 ``0j`` を返します。" +#: ../../library/functions.rst:322 +msgid "" +"For a general Python object ``x``, ``complex(x)`` delegates to ``x." +"__complex__()``. If ``__complex__()`` is not defined then it falls back to :" +"meth:`__float__`. If ``__float__()`` is not defined then it falls back to :" +"meth:`__index__`." +msgstr "" +"一般的な Python オブジェクト ``x`` に対して、 ``complex(x)`` は ``x." +"__complex__()`` に処理を委譲します。 ``__complex__()`` が定義されていない場合" +"は :meth:`__float__` にフォールバックします。 ``__float__()`` も定義されてい" +"ない場合は :meth:`__index__` にフォールバックします。" -#: ../../library/functions.rst:447 +#: ../../library/functions.rst:329 +msgid "" +"When converting from a string, the string must not contain whitespace around " +"the central ``+`` or ``-`` operator. For example, ``complex('1+2j')`` is " +"fine, but ``complex('1 + 2j')`` raises :exc:`ValueError`." +msgstr "" +"文字列から変換するとき、その文字列は中央の ``+`` や ``-`` 演算子の周りに空白" +"を含んではなりません。例えば、``complex('1+2j')`` はいいですが、``complex('1 " +"+ 2j')`` は :exc:`ValueError` を送出します。" + +#: ../../library/functions.rst:334 msgid "The complex type is described in :ref:`typesnumeric`." msgstr "複素数型については :ref:`typesnumeric` に説明があります。" -#: ../../library/functions.rst:449 ../../library/functions.rst:812 -#: ../../library/functions.rst:1054 +#: ../../library/functions.rst:336 ../../library/functions.rst:622 +#: ../../library/functions.rst:838 msgid "Grouping digits with underscores as in code literals is allowed." msgstr "コードリテラル中で桁をグループ化するのにアンダースコアを利用できます。" -#: ../../library/functions.rst:452 -msgid "" -"Falls back to :meth:`~object.__index__` if :meth:`~object.__complex__` and :" -"meth:`~object.__float__` are not defined." -msgstr "" -":meth:`~object.__complex__` と :meth:`~object.__float__` が定義されていない場" -"合、 :meth:`~object.__index__` へフォールバックします。" - -#: ../../library/functions.rst:456 +#: ../../library/functions.rst:339 msgid "" -"Passing a complex number as the *real* or *imag* argument is now deprecated; " -"it should only be passed as a single positional argument." +"Falls back to :meth:`__index__` if :meth:`__complex__` and :meth:`__float__` " +"are not defined." msgstr "" +":meth:`__complex__` と :meth:`__float__` が定義されていない場合、:meth:" +"`__index__` へフォールバックします。" -#: ../../library/functions.rst:463 +#: ../../library/functions.rst:346 msgid "" "This is a relative of :func:`setattr`. The arguments are an object and a " "string. The string must be the name of one of the object's attributes. The " "function deletes the named attribute, provided the object allows it. For " -"example, ``delattr(x, 'foobar')`` is equivalent to ``del x.foobar``. *name* " -"need not be a Python identifier (see :func:`setattr`)." +"example, ``delattr(x, 'foobar')`` is equivalent to ``del x.foobar``." msgstr "" ":func:`setattr` の親戚です。引数はオブジェクトと文字列です。文字列はオブジェ" -"クトの属性名のいずれかでなければなりません。対象のオブジェクトが許可する場合" -"に限り、この関数は指定された名前の属性を削除します。たとえば、 ``delattr(x, " -"'foobar')`` は ``del x.foobar`` と等価です。 *name* は Python の識別子である" -"必要はありません (:func:`setattr` を参照してください)。" +"クトの属性のうち一つの名前でなければなりません。この関数は、オブジェクトが許" +"すなら、指名された属性を削除します。例えば、 ``delattr(x, 'foobar')`` は " +"``del x.foobar`` と等価です。" -#: ../../library/functions.rst:476 +#: ../../library/functions.rst:358 msgid "" "Create a new dictionary. The :class:`dict` object is the dictionary class. " "See :class:`dict` and :ref:`typesmapping` for documentation about this class." @@ -1152,7 +869,7 @@ msgstr "" "スに関するドキュメンテーションは :class:`dict` と :ref:`typesmapping` を参照" "してください。" -#: ../../library/functions.rst:479 +#: ../../library/functions.rst:361 msgid "" "For other containers see the built-in :class:`list`, :class:`set`, and :" "class:`tuple` classes, as well as the :mod:`collections` module." @@ -1160,7 +877,7 @@ msgstr "" "他のコンテナについては、 ビルトインの :class:`list`, :class:`set`, :class:" "`tuple` クラスおよび :mod:`collections` モジュールを参照してください。" -#: ../../library/functions.rst:486 +#: ../../library/functions.rst:367 msgid "" "Without arguments, return the list of names in the current local scope. " "With an argument, attempt to return a list of valid attributes for that " @@ -1169,34 +886,32 @@ msgstr "" "引数がない場合、現在のローカルスコープにある名前のリストを返します。引数があ" "る場合、そのオブジェクトの有効な属性のリストを返そうと試みます。" -#: ../../library/functions.rst:489 +#: ../../library/functions.rst:370 msgid "" -"If the object has a method named :meth:`~object.__dir__`, this method will " -"be called and must return the list of attributes. This allows objects that " -"implement a custom :func:`~object.__getattr__` or :func:`~object." -"__getattribute__` function to customize the way :func:`dir` reports their " -"attributes." +"If the object has a method named :meth:`__dir__`, this method will be called " +"and must return the list of attributes. This allows objects that implement a " +"custom :func:`__getattr__` or :func:`__getattribute__` function to customize " +"the way :func:`dir` reports their attributes." msgstr "" -"オブジェクトが :meth:`~object.__dir__` という名のメソッドを持つなら、そのメ" -"ソッドが呼び出され、属性のリストを返さなければなりません。これにより、カスタ" -"ムの :func:`~object.__getattr__` や :func:`~object.__getattribute__` 関数を実" -"装するオブジェクトは、:func:`dir` が属性を報告するやり方をカスタマイズできま" -"す。" +"オブジェクトが :meth:`__dir__` という名のメソッドを持つなら、そのメソッドが呼" +"び出され、属性のリストを返さなければなりません。これにより、カスタムの :func:" +"`__getattr__` や :func:`__getattribute__` 関数を実装するオブジェクトは、:" +"func:`dir` が属性を報告するやり方をカスタマイズできます。" -#: ../../library/functions.rst:496 +#: ../../library/functions.rst:375 msgid "" -"If the object does not provide :meth:`~object.__dir__`, the function tries " -"its best to gather information from the object's :attr:`~object.__dict__` " -"attribute, if defined, and from its type object. The resulting list is not " -"necessarily complete and may be inaccurate when the object has a custom :" -"func:`~object.__getattr__`." +"If the object does not provide :meth:`__dir__`, the function tries its best " +"to gather information from the object's :attr:`~object.__dict__` attribute, " +"if defined, and from its type object. The resulting list is not necessarily " +"complete, and may be inaccurate when the object has a custom :func:" +"`__getattr__`." msgstr "" -"オブジェクトが :meth:`~object.__dir__` を提供しない場合、その型オブジェクト" -"と、定義されていればオブジェクトの :attr:`~object.__dict__` 属性から、できる" -"だけ情報を集めようとします。結果のリストは必ずしも完全ではなく、カスタムの :" -"func:`~object.__getattr__` を持つ場合は不正確かもしれません。" +"オブジェクトが :meth:`__dir__` を提供していない場合、定義されていればオブジェ" +"クトの :attr:`~object.__dict__` 属性から、そして型オブジェクトから、情報を収" +"集しようと試みます。結果のリストは完全であるとは限らず、また、カスタムの :" +"func:`__getattr__` を持つ場合、不正確になるかもしれません。" -#: ../../library/functions.rst:502 +#: ../../library/functions.rst:380 msgid "" "The default :func:`dir` mechanism behaves differently with different types " "of objects, as it attempts to produce the most relevant, rather than " @@ -1205,7 +920,7 @@ msgstr "" "デフォルトの :func:`dir` メカニズムは、完全というより最重要な情報を作成しよう" "とするため、異なる型のオブジェクトでは異なって振る舞います:" -#: ../../library/functions.rst:506 +#: ../../library/functions.rst:384 msgid "" "If the object is a module object, the list contains the names of the " "module's attributes." @@ -1213,7 +928,7 @@ msgstr "" "オブジェクトがモジュールオブジェクトの場合、リストにはモジュールの属性の名前" "が含まれます。" -#: ../../library/functions.rst:509 +#: ../../library/functions.rst:387 msgid "" "If the object is a type or class object, the list contains the names of its " "attributes, and recursively of the attributes of its bases." @@ -1221,7 +936,7 @@ msgstr "" "オブジェクトが型オブジェクトやクラスオブジェクトの場合、リストにはその属性の" "名前と、再帰的にたどったその基底クラスの属性が含まれます。" -#: ../../library/functions.rst:512 +#: ../../library/functions.rst:390 msgid "" "Otherwise, the list contains the object's attributes' names, the names of " "its class's attributes, and recursively of the attributes of its class's " @@ -1230,11 +945,11 @@ msgstr "" "それ以外の場合には、リストにはオブジェクトの属性名、クラス属性名、再帰的にた" "どった基底クラスの属性名が含まれます。" -#: ../../library/functions.rst:516 +#: ../../library/functions.rst:394 msgid "The resulting list is sorted alphabetically. For example:" msgstr "返されるリストはアルファベット順に並べられています。例えば:" -#: ../../library/functions.rst:536 +#: ../../library/functions.rst:413 msgid "" "Because :func:`dir` is supplied primarily as a convenience for use at an " "interactive prompt, it tries to supply an interesting set of names more than " @@ -1248,26 +963,26 @@ msgstr "" "わる可能性があります。例えば、引数がクラスであるとき、メタクラス属性は結果の" "リストに含まれません。" -#: ../../library/functions.rst:546 +#: ../../library/functions.rst:423 msgid "" -"Take two (non-complex) numbers as arguments and return a pair of numbers " +"Take two (non complex) numbers as arguments and return a pair of numbers " "consisting of their quotient and remainder when using integer division. " "With mixed operand types, the rules for binary arithmetic operators apply. " -"For integers, the result is the same as ``(a // b, a % b)``. For floating-" +"For integers, the result is the same as ``(a // b, a % b)``. For floating " "point numbers the result is ``(q, a % b)``, where *q* is usually ``math." "floor(a / b)`` but may be 1 less than that. In any case ``q * b + a % b`` " "is very close to *a*, if ``a % b`` is non-zero it has the same sign as *b*, " "and ``0 <= abs(a % b) < abs(b)``." msgstr "" -"2つの (複素数でない) 数を引数としてとり、整数の除法を行ったときの商と剰余から" -"なる2つの数のペアを返します。被演算子の型が異なる場合、二項算術演算子での規則" -"が適用されます。整数に対する結果は ``(a // b, a % b)`` と同じです。浮動小数点" -"数では、結果は ``(q, a % b)`` とあらわされます。 *q* は通常 ``math.floor(a / " -"b)`` ですが、それより 1 少ないこともあります。いずれにせよ ``q * b + a % b`` " -"は *a* に非常に近い値になります。もし ``a % b`` がゼロでないときは、その符号" -"は *b* と同じであり、かつ ``0 <= abs(a % b) < abs(b)`` を満たします。" +"2 つの (複素数でない) 数を引数として取り、整数の除法を行ったときの商と剰余か" +"らなる対を返します。混合した被演算子型では、二項算術演算子での規則が適用され" +"ます。整数では、結果は ``(a // b, a % b)`` と同じです。浮動小数点数では、結" +"果は ``(q, a % b)`` で、ここで *q* は通常 ``math.floor(a / b)`` ですが、それ" +"より 1 小さくなることもあります。いずれにせよ、``q * b + a % b`` は *a* に非" +"常に近く、``a % b`` がゼロでなければその符号は *b* と同じで、``0 <= abs(a % " +"b) < abs(b)`` です。" -#: ../../library/functions.rst:558 +#: ../../library/functions.rst:435 msgid "" "Return an enumerate object. *iterable* must be a sequence, an :term:" "`iterator`, or some other object which supports iteration. The :meth:" @@ -1282,117 +997,75 @@ msgstr "" "ウントと、 *iterable* 上のイテレーションによって得られた値を含むタプルを返し" "ます。" -#: ../../library/functions.rst:570 +#: ../../library/functions.rst:447 msgid "Equivalent to::" msgstr "次と等価です::" -#: ../../library/functions.rst:572 +#: ../../library/functions.rst:458 msgid "" -"def enumerate(iterable, start=0):\n" -" n = start\n" -" for elem in iterable:\n" -" yield n, elem\n" -" n += 1" -msgstr "" -"def enumerate(iterable, start=0):\n" -" n = start\n" -" for elem in iterable:\n" -" yield n, elem\n" -" n += 1" - -#: ../../library/functions.rst:0 -msgid "Parameters" -msgstr "パラメーター" - -#: ../../library/functions.rst:582 -msgid "A Python expression." -msgstr "Python 式。" - -#: ../../library/functions.rst:586 -msgid "The global namespace (default: ``None``)." -msgstr "グローバル名前空間 (default: ``None``) 。" - -#: ../../library/functions.rst:590 -msgid "The local namespace (default: ``None``)." -msgstr "ローカル名前空間 (default: ``None``) 。" - -#: ../../library/functions.rst:0 -msgid "Returns" -msgstr "返り値" - -#: ../../library/functions.rst:594 -msgid "The result of the evaluated expression." -msgstr "評価された式の結果。" - -#: ../../library/functions.rst:0 -msgid "raises" -msgstr "例外" - -#: ../../library/functions.rst:595 -msgid "Syntax errors are reported as exceptions." -msgstr "構文エラーは例外として報告されます。" - -#: ../../library/functions.rst:599 ../../library/functions.rst:660 -msgid "" -"This function executes arbitrary code. Calling it with user-supplied input " -"may lead to security vulnerabilities." +"The arguments are a string and optional globals and locals. If provided, " +"*globals* must be a dictionary. If provided, *locals* can be any mapping " +"object." msgstr "" -"この関数は任意のコードを実行します。ユーザが入力した文字列を引数としてこの関" -"数を呼び出すと、セキュリティの脆弱性につながる可能性があります。" +"文字列とオプションの引数 *globals*、*locals* をとります。*globals* を与える場" +"合は辞書でなくてはなりません。*locals* を与える場合は任意のマッピングオブジェ" +"クトにできます。" -#: ../../library/functions.rst:602 +#: ../../library/functions.rst:462 msgid "" "The *expression* argument is parsed and evaluated as a Python expression " "(technically speaking, a condition list) using the *globals* and *locals* " -"mappings as global and local namespace. If the *globals* dictionary is " +"dictionaries as global and local namespace. If the *globals* dictionary is " "present and does not contain a value for the key ``__builtins__``, a " "reference to the dictionary of the built-in module :mod:`builtins` is " -"inserted under that key before *expression* is parsed. That way you can " -"control what builtins are available to the executed code by inserting your " -"own ``__builtins__`` dictionary into *globals* before passing it to :func:" -"`eval`. If the *locals* mapping is omitted it defaults to the *globals* " -"dictionary. If both mappings are omitted, the expression is executed with " -"the *globals* and *locals* in the environment where :func:`eval` is called. " -"Note, *eval()* will only have access to the :term:`nested scopes ` (non-locals) in the enclosing environment if they are already " -"referenced in the scope that is calling :func:`eval` (e.g. via a :keyword:" -"`nonlocal` statement)." -msgstr "" -"*expression* 引数のパースと評価は、 *globals* / *locals* のマッピング(訳注:" -"dict相当)をグローバル / ローカルの名前空間とした Python 式 (技術的な言葉では" -"式のリスト -- 訳注:詳細は言語リファレンス6章参照) として行われます。 " -"*globals* 辞書が渡され それが ``__builtins__`` をキーとして持たない場合は、そ" -"のキーの下に組み込みモジュール :mod:`builtins` の辞書への参照が挿入されてか" -"ら、*expression* が解析されます。 つまり、 *globals* に独自の " -"``__builtins__`` 辞書を含めて :func:`eval` に渡すことで、実行されるコードで有" -"効となる組み込み関数を統制できます。 *locals* マッピングが省略された場合、 " -"*globals* 辞書がデフォルトとして使われます。どちらのマッピングも省略された場" -"合、 :func:`eval` が呼び出された環境における *globals* と *locals* のもとで式" -"が評価されます。 注意点として、*eval()* は、 :func:`eval` を呼び出したスコー" -"プからすでに参照されている場合(例: :keyword:`nonlocal` 文より)のみ :term:`" -"ネストされたスコープ ` (ローカルでないオブジェクト) へのアクセ" -"スを持ちます。" - -#: ../../library/functions.rst:618 -msgid "Example:" -msgstr "例:" - -#: ../../library/functions.rst:624 +"inserted under that key before *expression* is parsed. This means that " +"*expression* normally has full access to the standard :mod:`builtins` module " +"and restricted environments are propagated. If the *locals* dictionary is " +"omitted it defaults to the *globals* dictionary. If both dictionaries are " +"omitted, the expression is executed with the *globals* and *locals* in the " +"environment where :func:`eval` is called. Note, *eval()* does not have " +"access to the :term:`nested scopes ` (non-locals) in the " +"enclosing environment." +msgstr "" +"*expression* 引数は Python 式 (技術的な言い方では、条件のリスト) として構文解" +"析され評価されます。\n" +"このとき辞書 *globals* および *locals* はそれぞれグローバルおよびローカルな名" +"前空間として使われます。\n" +"*globals* 辞書が与えられ、 ``__builtins__`` をキーとする値が含まれていない場" +"合、 *expression* が構文解析される前に、組み込みモジュール :mod:`builtins` の" +"辞書への参照がキー ``__builtins__`` の値として挿入されます。\n" +"よって、 *expression* は通常、標準の :mod:`builtins` モジュールへの完全なアク" +"セスを有し、制限された環境は伝播します。\n" +"*locals* 辞書が省略された場合、デフォルトは *globals* 辞書です。\n" +"辞書が両方とも省略された場合、表現式は :func:`eval` が呼び出されている環境の " +"*globals* 辞書と *locals* 辞書の下で実行されます。\n" +"*eval()* は、それが実行される環境の :term:`ネストされたスコープ ` (非ローカルのオブジェクト) を参照できないことに注意してください。" + +#: ../../library/functions.rst:476 +msgid "" +"The return value is the result of the evaluated expression. Syntax errors " +"are reported as exceptions. Example:" +msgstr "" +"返される値は、式が評価された結果になります。構文エラーは例外として報告されま" +"す。例:" + +#: ../../library/functions.rst:483 msgid "" "This function can also be used to execute arbitrary code objects (such as " -"those created by :func:`compile`). In this case, pass a code object instead " +"those created by :func:`compile`). In this case pass a code object instead " "of a string. If the code object has been compiled with ``'exec'`` as the " "*mode* argument, :func:`eval`\\'s return value will be ``None``." msgstr "" "この関数は (:func:`compile` で生成されるような) 任意のコードオブジェクトを実" "行するのにも利用できます。この場合、文字列の代わりにコードオブジェクトを渡し" -"てください。このコードオブジェクトが、引数 *mode* を ``'exec'`` としてコンパ" -"イルされている場合、 :func:`eval` の戻り値は ``None`` になります。" +"ます。このコードオブジェクトが、引数 *mode* を ``'exec'`` としてコンパイルさ" +"れている場合、 :func:`eval` が返す値は ``None`` になります。" -#: ../../library/functions.rst:629 +#: ../../library/functions.rst:488 msgid "" "Hints: dynamic execution of statements is supported by the :func:`exec` " -"function. The :func:`globals` and :func:`locals` functions return the " +"function. The :func:`globals` and :func:`locals` functions returns the " "current global and local dictionary, respectively, which may be useful to " "pass around for use by :func:`eval` or :func:`exec`." msgstr "" @@ -1401,15 +1074,7 @@ msgstr "" "ルな辞書を返すので、それらを :func:`eval` や :func:`exec` に渡して使うことが" "できます。" -#: ../../library/functions.rst:634 -msgid "" -"If the given source is a string, then leading and trailing spaces and tabs " -"are stripped." -msgstr "" -"ソースコードとして文字列が与えられた場合、先頭と末尾の空白文字およびタブは取" -"り去られます。" - -#: ../../library/functions.rst:637 +#: ../../library/functions.rst:493 msgid "" "See :func:`ast.literal_eval` for a function that can safely evaluate strings " "with expressions containing only literals." @@ -1417,8 +1082,15 @@ msgstr "" "リテラルだけを含む式の文字列を安全に評価できる関数、 :func:`ast." "literal_eval` も参照してください。" -#: ../../library/functions.rst:640 ../../library/functions.rst:642 -#: ../../library/functions.rst:702 ../../library/functions.rst:704 +#: ../../library/functions.rst:496 ../../library/functions.rst:532 +msgid "" +"Raises an :ref:`auditing event ` ``exec`` with argument " +"``code_object``." +msgstr "" +"引数 ``code_object`` を指定して :ref:`監査イベント ` ``exec`` を送" +"出します。 " + +#: ../../library/functions.rst:498 ../../library/functions.rst:534 msgid "" "Raises an :ref:`auditing event ` ``exec`` with the code object as " "the argument. Code compilation events may also be raised." @@ -1426,73 +1098,49 @@ msgstr "" "コードオブジェクトを引数として :ref:`監査イベント ` ``exec`` を送出" "します。コードコンパイルのイベントも送出されることがあります。" -#: ../../library/functions.rst:647 ../../library/functions.rst:724 -msgid "The *globals* and *locals* arguments can now be passed as keywords." -msgstr "*globals* と *locals* 引数 はキーワードとして渡せるようになった。" - -#: ../../library/functions.rst:651 ../../library/functions.rst:728 -msgid "" -"The semantics of the default *locals* namespace have been adjusted as " -"described for the :func:`locals` builtin." -msgstr "" -"デフォルトの *locals* 名前空間のセマンティクスは、 組み込み :func:`locals` の" -"説明のように調整された。" - -#: ../../library/functions.rst:663 +#: ../../library/functions.rst:505 msgid "" -"This function supports dynamic execution of Python code. *source* must be " +"This function supports dynamic execution of Python code. *object* must be " "either a string or a code object. If it is a string, the string is parsed " "as a suite of Python statements which is then executed (unless a syntax " "error occurs). [#]_ If it is a code object, it is simply executed. In all " "cases, the code that's executed is expected to be valid as file input (see " -"the section :ref:`file-input` in the Reference Manual). Be aware that the :" +"the section \"File input\" in the Reference Manual). Be aware that the :" "keyword:`nonlocal`, :keyword:`yield`, and :keyword:`return` statements may " "not be used outside of function definitions even within the context of code " "passed to the :func:`exec` function. The return value is ``None``." msgstr "" -"この関数は Python コードの動的な実行をサポートします。 *source* は文字列か" -"コードオブジェクトでなければなりません。文字列の場合、その文字列は一連の " -"Python 文として解析され、そして (構文エラーにならない限り) 実行されます。 " -"[#]_ コードオブジェクトの場合は、単純に実行されます。どの場合でも、実行される" -"コードはファイル入力形式として有効であることが期待されます (リファレンスマ" -"ニュアルの :ref:`file-input` 節を参照してください)。 :keyword:`nonlocal`, :" -"keyword:`yield`, および :keyword:`return` 文は、 :func:`exec` 関数に渡された" -"コードの文脈中でさえ、関数定義の外側で使うことはできません。戻り値は " -"``None`` です。" +"この関数は Python コードの動的な実行をサポートします。 *object* は文字列か" +"コードオブジェクトでなければなりません。文字列なら、その文字列は一連の " +"Python 文として解析され、そして (構文エラーが生じない限り) 実行されます。 " +"[#]_ コードオブジェクトなら、それは単純に実行されます。どの場合でも、実行され" +"るコードはファイル入力として有効であることが期待されます (リファレンスマニュ" +"アルの節 \"file-input\" を参照)。なお、 :keyword:`nonlocal`, :keyword:" +"`yield` および :keyword:`return` 文は、 :func:`exec` 関数に渡されたコードの文" +"脈中においてさえ、関数定義の外では使えません。返り値は ``None`` です。" -#: ../../library/functions.rst:674 +#: ../../library/functions.rst:516 msgid "" "In all cases, if the optional parts are omitted, the code is executed in the " "current scope. If only *globals* is provided, it must be a dictionary (and " "not a subclass of dictionary), which will be used for both the global and " "the local variables. If *globals* and *locals* are given, they are used for " "the global and local variables, respectively. If provided, *locals* can be " -"any mapping object. Remember that at the module level, globals and locals " -"are the same dictionary." -msgstr "" -"どの場合でも、オプションの部分が省略されると、コードは現在のスコープ内で実行" -"されます。 *globals* だけが与えられた場合、その値は辞書でなければならず (かつ" -"辞書のサブクラスであってはならず)、グローバル変数とローカル変数の両方に使われ" -"ます。 *globals* と *locals* の両方が与えられた場合、それぞれグローバル変数と" -"ローカル変数に使われます。 *locals* を指定する場合、その値はマップ型オブジェ" -"クトでなければなりません。モジュールレベルでは globals と locals は同じ辞書で" -"あることに留意してください。" - -#: ../../library/functions.rst:684 -msgid "" -"When ``exec`` gets two separate objects as *globals* and *locals*, the code " -"will be executed as if it were embedded in a class definition. This means " -"functions and classes defined in the executed code will not be able to " -"access variables assigned at the top level (as the \"top level\" variables " -"are treated as class variables in a class definition)." -msgstr "" -"``exec`` が *globals* と *locals* 2つ別々のオブジェクトを取る場合、コードはク" -"ラス定義に埋め込まれたかのように実行されます。これは、実行されたコードで定義" -"された関数とクラスが、トップレベルで割り当てられた変数にアクセスできないこと" -"を意味します(「トップレベル」変数はクラス定義にてクラス変数として扱われるた" -"め)。" - -#: ../../library/functions.rst:690 +"any mapping object. Remember that at module level, globals and locals are " +"the same dictionary. If exec gets two separate objects as *globals* and " +"*locals*, the code will be executed as if it were embedded in a class " +"definition." +msgstr "" +"いずれの場合でも、オプションの部分が省略されると、コードは現在のスコープ内で" +"実行されます。*globals* だけが与えられたなら、辞書でなくてはならず(辞書のサブ" +"クラスではない)、グローバル変数とローカル変数の両方に使われます。*globals* " +"と *locals* が与えられたなら、それぞれグローバル変数とローカル変数として使わ" +"れます。*locals* を指定する場合は何らかのマップ型オブジェクトでなければなりま" +"せん。モジュールレベルでは、グローバルとローカルは同じ辞書です。exec が " +"*globals* と *locals* として別のオブジェクトを取った場合、コードはクラス定義" +"に埋め込まれたかのように実行されます。" + +#: ../../library/functions.rst:526 msgid "" "If the *globals* dictionary does not contain a value for the key " "``__builtins__``, a reference to the dictionary of the built-in module :mod:" @@ -1506,51 +1154,42 @@ msgstr "" "``__builtins__`` 辞書を挿入することで、コードがどの組み込みを利用できるか制御" "できます。" -#: ../../library/functions.rst:696 -msgid "" -"The *closure* argument specifies a closure--a tuple of cellvars. It's only " -"valid when the *object* is a code object containing :term:`free (closure) " -"variables `. The length of the tuple must exactly match " -"the length of the code object's :attr:`~codeobject.co_freevars` attribute." -msgstr "" - -#: ../../library/functions.rst:709 +#: ../../library/functions.rst:539 msgid "" "The built-in functions :func:`globals` and :func:`locals` return the current " -"global and local namespace, respectively, which may be useful to pass around " -"for use as the second and third argument to :func:`exec`." +"global and local dictionary, respectively, which may be useful to pass " +"around for use as the second and third argument to :func:`exec`." msgstr "" "組み込み関数 :func:`globals` および :func:`locals` は、それぞれ現在のグローバ" -"ルおよびローカルの名前空間を返すので、それらを :func:`exec` の第二、第三引数" -"にそのまま渡して使うと便利なことがあります。" +"ルおよびローカルの辞書を返すので、それらを :func:`exec` の第二、第三引数にそ" +"のまま渡して使うと便利なことがあります。" -#: ../../library/functions.rst:715 +#: ../../library/functions.rst:545 msgid "" -"The default *locals* act as described for function :func:`locals` below. " +"The default *locals* act as described for function :func:`locals` below: " +"modifications to the default *locals* dictionary should not be attempted. " "Pass an explicit *locals* dictionary if you need to see effects of the code " "on *locals* after function :func:`exec` returns." msgstr "" -"標準では *locals* は後に述べる関数 :func:`locals` のように動作します。 :func:" -"`exec` の呼び出しが返る時にコードが *locals* に与える影響を知りたいなら、明示" -"的に *locals* 辞書を渡してください。" - -#: ../../library/functions.rst:719 -msgid "Added the *closure* parameter." -msgstr "*closure* パラメータが追加されました。" +"標準では *locals* は後に述べる関数 :func:`locals` のように動作します: 標準の " +"*locals* 辞書に対する変更を試みてはいけません。 :func:`exec` の呼び出しが返る" +"時にコードが *locals* に与える影響を知りたいなら、明示的に *locals* 辞書を渡" +"してください。" -#: ../../library/functions.rst:734 +#: ../../library/functions.rst:553 msgid "" "Construct an iterator from those elements of *iterable* for which *function* " -"is true. *iterable* may be either a sequence, a container which supports " -"iteration, or an iterator. If *function* is ``None``, the identity function " -"is assumed, that is, all elements of *iterable* that are false are removed." +"returns true. *iterable* may be either a sequence, a container which " +"supports iteration, or an iterator. If *function* is ``None``, the identity " +"function is assumed, that is, all elements of *iterable* that are false are " +"removed." msgstr "" -"*iterable* の要素のうち、 *function* が真であるものからイテレータを構築しま" -"す。 *iterable* にはシーケンスか、イテレーションをサポートするコンテナか、イ" -"テレータを渡せます。 *function* が ``None`` のときは恒等関数が指定されたもの" -"として扱われ、 *iterable* のうち偽であるものがすべて取り除かれます。" +"*iterable* の要素のうち *function* が真を返すものでイテレータを構築します。" +"*iterable* はシーケンスか、反復をサポートするコンテナか、イテレータです。" +"*function* が ``None`` なら、恒等関数を仮定します。すなわち、*iterable* の偽" +"である要素がすべて除去されます。" -#: ../../library/functions.rst:740 +#: ../../library/functions.rst:559 msgid "" "Note that ``filter(function, iterable)`` is equivalent to the generator " "expression ``(item for item in iterable if function(item))`` if function is " @@ -1561,121 +1200,96 @@ msgstr "" "タ式 ``(item for item in iterable if function(item))`` と同等で、関数が " "``None`` なら ``(item for item in iterable if item)`` と同等です。" -#: ../../library/functions.rst:745 +#: ../../library/functions.rst:564 msgid "" "See :func:`itertools.filterfalse` for the complementary function that " -"returns elements of *iterable* for which *function* is false." -msgstr "" -"逆の働きをする関数については、 :func:`itertools.filterfalse` を参照してくださ" -"い。 *iterable* の要素のうち、 *function* が偽であるものを返します。" - -#: ../../library/functions.rst:756 -msgid "Return a floating-point number constructed from a number or a string." -msgstr "数または文字列から生成された浮動小数点数を返します。" - -#: ../../library/functions.rst:760 -msgid "" -">>> float('+1.23')\n" -"1.23\n" -">>> float(' -12345\\n')\n" -"-12345.0\n" -">>> float('1e-003')\n" -"0.001\n" -">>> float('+1E6')\n" -"1000000.0\n" -">>> float('-Infinity')\n" -"-inf" -msgstr "" -">>> float('+1.23')\n" -"1.23\n" -">>> float(' -12345\\n')\n" -"-12345.0\n" -">>> float('1e-003')\n" -"0.001\n" -">>> float('+1E6')\n" -"1000000.0\n" -">>> float('-Infinity')\n" -"-inf" - -#: ../../library/functions.rst:773 +"returns elements of *iterable* for which *function* returns false." +msgstr "" +"*function* が偽を返すような *iterable* の各要素を返す補完的関数は、 :func:" +"`itertools.filterfalse` を参照してください。" + +#: ../../library/functions.rst:574 +msgid "Return a floating point number constructed from a number or string *x*." +msgstr "数または文字列 *x* から生成された浮動小数点数を返します。" + +#: ../../library/functions.rst:576 msgid "" "If the argument is a string, it should contain a decimal number, optionally " "preceded by a sign, and optionally embedded in whitespace. The optional " "sign may be ``'+'`` or ``'-'``; a ``'+'`` sign has no effect on the value " "produced. The argument may also be a string representing a NaN (not-a-" -"number), or positive or negative infinity. More precisely, the input must " -"conform to the :token:`~float:floatvalue` production rule in the following " -"grammar, after leading and trailing whitespace characters are removed:" +"number), or a positive or negative infinity. More precisely, the input must " +"conform to the following grammar after leading and trailing whitespace " +"characters are removed:" msgstr "" -"引数が文字列の場合、10進数でなければなりません。先頭に符号または空白を含んで" -"もかまいません。符号は ``'+'`` か ``'-'`` のいずれかです。正符号 ``'+'`` は生" -"成される値に対して何の効果もありません。引数は NaN (not-a-number) や正または" -"負の無限大をあらわす文字列でもかまいません。より正確にいうと、入力は先頭と末" -"尾の空白文字を除き、以下に示す :token:`~float:floatvalue` の生成規則に従う必" -"要があります:" +"引数が文字列の場合、10進数を含んだ文字列にしてください。先頭に符号が付いてい" +"たり、空白中に埋め込まれていてもかまいません。符号として ``'+'`` か ``'-'`` " +"を追加できます。``'+'`` は、作られる値に何の影響も与えません。引数は NaN " +"(not-a-number) や正負の無限大を表す文字列でもかまいません。正確には、入力は、" +"前後の空白を取り除いた後に以下の文法に従う必要があります:" -#: ../../library/functions.rst:794 +#: ../../library/functions.rst:591 msgid "" -"Case is not significant, so, for example, \"inf\", \"Inf\", \"INFINITY\", " -"and \"iNfINity\" are all acceptable spellings for positive infinity." +"Here ``floatnumber`` is the form of a Python floating-point literal, " +"described in :ref:`floating`. Case is not significant, so, for example, " +"\"inf\", \"Inf\", \"INFINITY\" and \"iNfINity\" are all acceptable spellings " +"for positive infinity." msgstr "" -"大文字と小文字は重要ではないので、例えば、 \"inf\", \"Inf\", \"INFINITY\", " -"\"iNfINity\" はすべて正の無限大を表す綴りとして受け入れられます。" +"ここで ``floatnumber`` は :ref:`floating` で記述されている Python の浮動小数" +"点数リテラルです。大文字か小文字かは関係なく、例えば \"inf\"、 \"Inf\"、 " +"\"INFINITY\" 、 \"iNfINity\" は全て正の無限大として使える綴りです。" -#: ../../library/functions.rst:797 +#: ../../library/functions.rst:596 msgid "" -"Otherwise, if the argument is an integer or a floating-point number, a " -"floating-point number with the same value (within Python's floating-point " +"Otherwise, if the argument is an integer or a floating point number, a " +"floating point number with the same value (within Python's floating point " "precision) is returned. If the argument is outside the range of a Python " "float, an :exc:`OverflowError` will be raised." msgstr "" -"また、引数が整数または浮動小数点数なら、 (Python の浮動小数点数の精度で) 同じ" -"値の浮動小数点数が返されます。 引数が Python の浮動小数点数の範囲外なら、 :" +"一方で、引数が整数または浮動小数点数なら、(Python の浮動小数点数の精度で) 同" +"じ値の浮動小数点数が返されます。引数が Python の浮動小数点数の範囲外なら、 :" "exc:`OverflowError` が送出されます。" -#: ../../library/functions.rst:802 +#: ../../library/functions.rst:601 msgid "" "For a general Python object ``x``, ``float(x)`` delegates to ``x." -"__float__()``. If :meth:`~object.__float__` is not defined then it falls " -"back to :meth:`~object.__index__`." +"__float__()``. If ``__float__()`` is not defined then it falls back to :" +"meth:`__index__`." msgstr "" "一般の Python オブジェクト ``x`` に対して、``float(x)`` は ``x.__float__()`` " -"に委譲します。 :meth:`~object.__float__()` が定義されていない場合、:meth:" -"`~object.__index__` へフォールバックします。" - -#: ../../library/functions.rst:806 -msgid "" -"See also :meth:`float.from_number` which only accepts a numeric argument." -msgstr "" +"に委譲します。 :meth:`__float__()` が定義されていない場合、:meth:`__index__` " +"へフォールバックします。" -#: ../../library/functions.rst:808 +#: ../../library/functions.rst:605 msgid "If no argument is given, ``0.0`` is returned." msgstr "引数が与えられなければ、``0.0`` が返されます。" -#: ../../library/functions.rst:810 +#: ../../library/functions.rst:607 +msgid "Examples::" +msgstr "例::" + +#: ../../library/functions.rst:620 msgid "The float type is described in :ref:`typesnumeric`." msgstr "浮動小数点数型については、 :ref:`typesnumeric` も参照してください。" -#: ../../library/functions.rst:818 -msgid "" -"Falls back to :meth:`~object.__index__` if :meth:`~object.__float__` is not " -"defined." +#: ../../library/functions.rst:628 +msgid "Falls back to :meth:`__index__` if :meth:`__float__` is not defined." msgstr "" -":meth:`~object.__float__` が定義されていない場合、 :meth:`~object.__index__` " -"へフォールバックします。" +":meth:`__float__` が定義されていない場合、:meth:`__index__` へフォールバック" +"します。" -#: ../../library/functions.rst:828 +#: ../../library/functions.rst:638 msgid "" "Convert a *value* to a \"formatted\" representation, as controlled by " "*format_spec*. The interpretation of *format_spec* will depend on the type " -"of the *value* argument; however, there is a standard formatting syntax that " +"of the *value* argument, however there is a standard formatting syntax that " "is used by most built-in types: :ref:`formatspec`." msgstr "" -"*value* を *format_spec* で指示された通りに \"整形\" した文字列表現に変換しま" -"す。 *format_spec* の解釈は *value* 引数の型に依存しますが、ほとんどの組み込" -"み型で使われる標準的な構文が存在します: :ref:`formatspec`。" +"*value* を *format_spec* で制御される \"書式化された\" 表現に変換します。 " +"*format_spec* の解釈は *value* 引数の型に依存しますが、ほとんどの組み込み型で" +"使われる標準的な構文が存在します: :ref:`formatspec` 。" -#: ../../library/functions.rst:833 +#: ../../library/functions.rst:643 msgid "" "The default *format_spec* is an empty string which usually gives the same " "effect as calling :func:`str(value) `." @@ -1683,23 +1297,23 @@ msgstr "" "デフォルトの *format_spec* は空の文字列です。それは通常 :func:`str(value) " "` の呼び出しと同じ結果になります。" -#: ../../library/functions.rst:836 +#: ../../library/functions.rst:646 msgid "" "A call to ``format(value, format_spec)`` is translated to ``type(value)." "__format__(value, format_spec)`` which bypasses the instance dictionary when " -"searching for the value's :meth:`~object.__format__` method. A :exc:" -"`TypeError` exception is raised if the method search reaches :mod:`object` " -"and the *format_spec* is non-empty, or if either the *format_spec* or the " -"return value are not strings." +"searching for the value's :meth:`__format__` method. A :exc:`TypeError` " +"exception is raised if the method search reaches :mod:`object` and the " +"*format_spec* is non-empty, or if either the *format_spec* or the return " +"value are not strings." msgstr "" "``format(value, format_spec)`` の呼び出しは、 ``type(value)." -"__format__(value, format_spec)`` に翻訳され、これは value の :meth:`~object." -"__format__` メソッドの検索をするとき、インスタンス辞書を回避します。このメ" +"__format__(value, format_spec)`` に翻訳され、これは value の :meth:" +"`__format__` メソッドの検索をするとき、インスタンス辞書を回避します。このメ" "ソッドの探索が :mod:`object` に到達しても *format_spec* が空にならなかった" "り、 *format_spec* や返り値が文字列でなかったりした場合、 :exc:`TypeError` が" "送出されます。" -#: ../../library/functions.rst:843 +#: ../../library/functions.rst:653 msgid "" "``object().__format__(format_spec)`` raises :exc:`TypeError` if " "*format_spec* is not an empty string." @@ -1707,7 +1321,7 @@ msgstr "" "*format_spec* が空の文字列でない場合 ``object().__format__(format_spec)`` " "は :exc:`TypeError` を送出します。" -#: ../../library/functions.rst:852 +#: ../../library/functions.rst:662 msgid "" "Return a new :class:`frozenset` object, optionally with elements taken from " "*iterable*. ``frozenset`` is a built-in class. See :class:`frozenset` and :" @@ -1718,7 +1332,7 @@ msgstr "" "関するドキュメントは :class:`frozenset` と :ref:`types-set` を参照してくださ" "い。" -#: ../../library/functions.rst:856 +#: ../../library/functions.rst:666 msgid "" "For other containers see the built-in :class:`set`, :class:`list`, :class:" "`tuple`, and :class:`dict` classes, as well as the :mod:`collections` module." @@ -1726,24 +1340,22 @@ msgstr "" "他のコンテナについては、ビルトインクラス :class:`set`, :class:`list`, :class:" "`tuple`, :class:`dict` や :mod:`collections` モジュールを見てください。" -#: ../../library/functions.rst:864 +#: ../../library/functions.rst:673 msgid "" "Return the value of the named attribute of *object*. *name* must be a " "string. If the string is the name of one of the object's attributes, the " "result is the value of that attribute. For example, ``getattr(x, " "'foobar')`` is equivalent to ``x.foobar``. If the named attribute does not " "exist, *default* is returned if provided, otherwise :exc:`AttributeError` is " -"raised. *name* need not be a Python identifier (see :func:`setattr`)." +"raised." msgstr "" -"*object* の指定された属性の値を返します。 *name* は文字列でなければなりませ" -"ん。与えられた文字列がオブジェクトの属性名のうちいずれかに一致すれば、戻り値" -"はその属性の値になります。たとえば、 ``getattr(x, 'foobar')`` は ``x." -"foobar`` と等価です。もし指定された属性が存在しない場合、 *default* が指定さ" -"れていればその値が返されます。そうでない場合は :exc:`AttributeError` が送出さ" -"れます。 *name* は Python 識別子である必要はありません (:func:`setattr` を参" -"照してください)。" +"*object* の指名された属性の値を返します。 *name* は文字列でなくてはなりませ" +"ん。文字列がオブジェクトの属性の一つの名前であった場合、戻り値はその属性の値" +"になります。例えば、 ``getattr(x, 'foobar')`` は ``x.foobar`` と等価です。指" +"名された属性が存在しない場合、 *default* が与えられていればそれが返され、そう" +"でない場合には :exc:`AttributeError` が送出されます。" -#: ../../library/functions.rst:873 +#: ../../library/functions.rst:681 msgid "" "Since :ref:`private name mangling ` happens at " "compilation time, one must manually mangle a private attribute's (attributes " @@ -1755,17 +1367,18 @@ msgstr "" "名前を持つ属性) の値を :func:`getattr` で取り出すためには、属性名を手動でマン" "グリングする必要があります。" -#: ../../library/functions.rst:881 +#: ../../library/functions.rst:689 msgid "" -"Return the dictionary implementing the current module namespace. For code " -"within functions, this is set when the function is defined and remains the " -"same regardless of where the function is called." +"Return a dictionary representing the current global symbol table. This is " +"always the dictionary of the current module (inside a function or method, " +"this is the module where it is defined, not the module from which it is " +"called)." msgstr "" -"現在のモジュールの名前空間を実装した辞書を返します。関数内のコードに対して" -"は、関数が定義されるときに辞書が設定され、その関数がどこから呼ばれたかにかか" -"わらず同じ内容になります。" +"現在のグローバルシンボルテーブルを表す辞書を返します。これは常に現在のモ" +"ジュール (関数やメソッドの中では、それを呼び出したモジュールではなく、それを" +"定義しているモジュール) の辞書です。" -#: ../../library/functions.rst:888 +#: ../../library/functions.rst:696 msgid "" "The arguments are an object and a string. The result is ``True`` if the " "string is the name of one of the object's attributes, ``False`` if not. " @@ -1777,7 +1390,7 @@ msgstr "" "``getattr(object, name)`` を呼び出して :exc:`AttributeError` を送出するかどう" "かを見ることで実装されています。)" -#: ../../library/functions.rst:896 +#: ../../library/functions.rst:704 msgid "" "Return the hash value of the object (if it has one). Hash values are " "integers. They are used to quickly compare dictionary keys during a " @@ -1789,16 +1402,17 @@ msgstr "" "なる数値は等しいハッシュ値を持ちます (1 と 1.0 のように型が異なっていてもで" "す)。" -#: ../../library/functions.rst:903 +#: ../../library/functions.rst:711 msgid "" -"For objects with custom :meth:`~object.__hash__` methods, note that :func:" -"`hash` truncates the return value based on the bit width of the host machine." +"For objects with custom :meth:`__hash__` methods, note that :func:`hash` " +"truncates the return value based on the bit width of the host machine. See :" +"meth:`__hash__` for details." msgstr "" -"独自の :meth:`~object.__hash__` メソッドを実装したオブジェクトを使う場合、:" -"func:`hash` が実行するマシンのビット幅に合わせて戻り値を切り捨てることに注意" -"してください。" +"独自の :meth:`__hash__` メソッドを実装したオブジェクトを使う場合、:func:" +"`hash` が実行するマシンのビット幅に合わせて戻り値を切り捨てることに注意してく" +"ださい。詳しくは :meth:`__hash__` を参照してください。" -#: ../../library/functions.rst:910 +#: ../../library/functions.rst:717 msgid "" "Invoke the built-in help system. (This function is intended for interactive " "use.) If no argument is given, the interactive help system starts on the " @@ -1814,25 +1428,26 @@ msgstr "" "コンソール上に印字されます。引数がその他のオブジェクトの場合、そのオブジェク" "トに関するヘルプページが生成されます。" -#: ../../library/functions.rst:917 +#: ../../library/functions.rst:724 msgid "" -"Note that if a slash(/) appears in the parameter list of a function when " +"Note that if a slash(/) appears in the parameter list of a function, when " "invoking :func:`help`, it means that the parameters prior to the slash are " "positional-only. For more info, see :ref:`the FAQ entry on positional-only " "parameters `." msgstr "" ":func:`help` を呼び出したときに関数の引数リストにスラッシュ (/) が現れた場合" "は、スラッシュより前の引数が位置専用引数だという意味であることに注意してくだ" -"さい。より詳しい情報は、 :ref:`位置専用引数についての FAQ の項目 ` を参照してください。" +"さい。\n" +"より詳しいことは、 :ref:`位置専用引数についての FAQ の記事 ` を参照してください。" -#: ../../library/functions.rst:922 +#: ../../library/functions.rst:729 msgid "" "This function is added to the built-in namespace by the :mod:`site` module." msgstr "" "この関数は、 :mod:`site` モジュールから、組み込みの名前空間に移されました。" -#: ../../library/functions.rst:924 +#: ../../library/functions.rst:731 msgid "" "Changes to :mod:`pydoc` and :mod:`inspect` mean that the reported signatures " "for callables are now more comprehensive and consistent." @@ -1840,18 +1455,18 @@ msgstr "" ":mod:`pydoc` と :mod:`inspect` への変更により、呼び出し可能オブジェクトの報告" "されたシグニチャがより包括的で一貫性のあるものになりました。" -#: ../../library/functions.rst:931 +#: ../../library/functions.rst:738 msgid "" "Convert an integer number to a lowercase hexadecimal string prefixed with " "\"0x\". If *x* is not a Python :class:`int` object, it has to define an :" -"meth:`~object.__index__` method that returns an integer. Some examples:" +"meth:`__index__` method that returns an integer. Some examples:" msgstr "" "整数を先頭に \"0x\" が付いた小文字の 16 進文字列に変換します。\n" -"*x* が Python の :class:`int` オブジェクトでない場合、整数を返す :meth:" -"`~object.__index__` メソッドが定義されていなければなりません。\n" +" *x* が Python の :class:`int` オブジェクトでない場合、整数を返す :meth:" +"`__index__` メソッドが定義されていなければなりません。\n" "いくつかの例を示します:" -#: ../../library/functions.rst:940 +#: ../../library/functions.rst:747 msgid "" "If you want to convert an integer number to an uppercase or lower " "hexadecimal string with prefix or not, you can use either of the following " @@ -1860,14 +1475,14 @@ msgstr "" "整数を大文字の 16 進文字列や小文字の 16 進文字列、先頭の \"0x\" 付きや " "\"0x\" 無しに変換したい場合は、次に挙げる方法が使えます:" -#: ../../library/functions.rst:952 +#: ../../library/functions.rst:759 msgid "" "See also :func:`int` for converting a hexadecimal string to an integer using " "a base of 16." msgstr "" "16を底として16進数文字列を整数に変換するには :func:`int` も参照してください。" -#: ../../library/functions.rst:957 +#: ../../library/functions.rst:764 msgid "" "To obtain a hexadecimal string representation for a float, use the :meth:" "`float.hex` method." @@ -1875,7 +1490,7 @@ msgstr "" "浮動小数点数の16進文字列表記を得たい場合には、 :meth:`float.hex` メソッドを" "使って下さい。" -#: ../../library/functions.rst:963 +#: ../../library/functions.rst:770 msgid "" "Return the \"identity\" of an object. This is an integer which is " "guaranteed to be unique and constant for this object during its lifetime. " @@ -1886,11 +1501,7 @@ msgstr "" "期間中は一意かつ定数であることが保証されています。有効期間が重ならない 2 つの" "オブジェクトは同じ :func:`id` 値を持つかもしれません。" -#: ../../library/functions.rst:968 -msgid "This is the address of the object in memory." -msgstr "これはオブジェクトのメモリアドレスです。" - -#: ../../library/functions.rst:970 +#: ../../library/functions.rst:777 msgid "" "Raises an :ref:`auditing event ` ``builtins.id`` with argument " "``id``." @@ -1898,7 +1509,7 @@ msgstr "" "引数 ``id`` を指定して :ref:`監査イベント ` ``builtins.id`` を送出" "します。 " -#: ../../library/functions.rst:976 +#: ../../library/functions.rst:782 msgid "" "If the *prompt* argument is present, it is written to standard output " "without a trailing newline. The function then reads a line from input, " @@ -1910,15 +1521,7 @@ msgstr "" "いて) 返します。 EOF が読み込まれたとき、 :exc:`EOFError` が送出されます。" "例::" -#: ../../library/functions.rst:981 -msgid "" -">>> s = input('--> ')\n" -"--> Monty Python's Flying Circus\n" -">>> s\n" -"\"Monty Python's Flying Circus\"" -msgstr "" - -#: ../../library/functions.rst:986 +#: ../../library/functions.rst:792 msgid "" "If the :mod:`readline` module was loaded, then :func:`input` will use it to " "provide elaborate line editing and history features." @@ -1926,7 +1529,15 @@ msgstr "" ":mod:`readline` モジュールが読み込まれていれば、 :func:`input` はそれを使って" "精緻な行編集やヒストリ機能を提供します。" -#: ../../library/functions.rst:989 ../../library/functions.rst:991 +#: ../../library/functions.rst:795 +msgid "" +"Raises an :ref:`auditing event ` ``builtins.input`` with argument " +"``prompt``." +msgstr "" +"引数 ``prompt`` 付きで :ref:`監査イベント ` ``builtins.input`` を送" +"出します。" + +#: ../../library/functions.rst:797 msgid "" "Raises an :ref:`auditing event ` ``builtins.input`` with argument " "``prompt`` before reading input" @@ -1934,102 +1545,78 @@ msgstr "" "入力を読み込む前に、引数 ``prompt`` 付きで :ref:`監査イベント ` " "``builtins.input`` を送出します。" -#: ../../library/functions.rst:994 ../../library/functions.rst:996 +#: ../../library/functions.rst:800 msgid "" "Raises an :ref:`auditing event ` ``builtins.input/result`` with " -"the result after successfully reading input." -msgstr "" -"入力の読み込みに成功した後に、その結果付きで :ref:`監査イベント ` " -"``builtins.input/result`` を送出します。" - -#: ../../library/functions.rst:1003 -msgid "" -"Return an integer object constructed from a number or a string, or return " -"``0`` if no arguments are given." -msgstr "" -"数または文字列から生成された整数オブジェクトを返します。引数が指定されない場" -"合は ``0`` を返します。" - -#: ../../library/functions.rst:1008 -msgid "" -">>> int(123.45)\n" -"123\n" -">>> int('123')\n" -"123\n" -">>> int(' -12_345\\n')\n" -"-12345\n" -">>> int('FACE', 16)\n" -"64206\n" -">>> int('0xface', 0)\n" -"64206\n" -">>> int('01110011', base=2)\n" -"115" -msgstr "" -">>> int(123.45)\n" -"123\n" -">>> int('123')\n" -"123\n" -">>> int(' -12_345\\n')\n" -"-12345\n" -">>> int('FACE', 16)\n" -"64206\n" -">>> int('0xface', 0)\n" -"64206\n" -">>> int('01110011', base=2)\n" -"115" - -#: ../../library/functions.rst:1023 -msgid "" -"If the argument defines :meth:`~object.__int__`, ``int(x)`` returns ``x." -"__int__()``. If the argument defines :meth:`~object.__index__`, it returns " -"``x.__index__()``. For floating-point numbers, this truncates towards zero." -msgstr "" - -#: ../../library/functions.rst:1028 -msgid "" -"If the argument is not a number or if *base* is given, then it must be a " -"string, :class:`bytes`, or :class:`bytearray` instance representing an " -"integer in radix *base*. Optionally, the string can be preceded by ``+`` or " -"``-`` (with no space in between), have leading zeros, be surrounded by " -"whitespace, and have single underscores interspersed between digits." -msgstr "" -"引数が数値でないか、または *base* が与えられた場合、引数は *base* を基数とし" -"た整数を表現する文字列、 :class:`bytes` インスタンス、または :class:" -"`bytearray` インスタンスのいずれかでなければなりません。文字列は先頭に ``+`` " -"または ``-`` を伴ったり (符号と数値の間に空白文字を入れてはいけません)、数値" -"の先頭に任意の数のゼロを付けたり、前後に空白文字を付けたり、各桁を単一の下線" -"で区切ったりしても有効です。" +"argument ``result``." +msgstr "" +"引数 ``result`` 付きで :ref:`監査イベント ` ``builtins.input/" +"result`` を送出します。" + +#: ../../library/functions.rst:802 +msgid "" +"Raises an auditing event ``builtins.input/result`` with the result after " +"successfully reading input." +msgstr "" +"入力の読み込みに成功した後に、その結果を監査イベント ``builtins.input/" +"result`` を送出します。" -#: ../../library/functions.rst:1034 +#: ../../library/functions.rst:809 msgid "" -"A base-n integer string contains digits, each representing a value from 0 to " -"n-1. The values 0--9 can be represented by any Unicode decimal digit. The " -"values 10--35 can be represented by ``a`` to ``z`` (or ``A`` to ``Z``). The " -"default *base* is 10. The allowed bases are 0 and 2--36. Base-2, -8, and -16 " -"strings can be optionally prefixed with ``0b``/``0B``, ``0o``/``0O``, or " -"``0x``/``0X``, as with integer literals in code. For base 0, the string is " -"interpreted in a similar way to an :ref:`integer literal in code " -"`, in that the actual base is 2, 8, 10, or 16 as determined by the " -"prefix. Base 0 also disallows leading zeros: ``int('010', 0)`` is not legal, " -"while ``int('010')`` and ``int('010', 8)`` are." -msgstr "" -"n-進数の整数文字列は、各桁が0から n-1 の数値で表されます。ユニコードの10進数" -"では、各桁は0から9のいずれかです。また10から35までの値は ``a`` から ``z`` (ま" -"たは ``A`` から ``Z``) で表されます。デフォルトの *base* は10です。基数に指定" -"可能な値は0および2から36までの整数です。2進数、8進数、16進数の文字列は、整数" -"リテラルと同様に、それぞれ ``0b``/``0B``, ``0o``/``0O``, または ``0x``/" -"``0X`` をプレフィックスとして追加することができます。基数を0に指定した場合、" -"文字列は :ref:`コードにおける整数リテラル ` と同じように解釈されま" -"す。すなわち、プレフィックスによって基数が2, 8, 10, または 16 のどれになるか" -"が決まります。基数を0にした場合先頭にゼロを追加することはできません: すなわ" -"ち ``int('010', 0)`` は基数を0に指定しているため不正ですが、 ``int('010')`` " -"や ``int('010', 8)`` は有効です。" - -#: ../../library/functions.rst:1045 +"Return an integer object constructed from a number or string *x*, or return " +"``0`` if no arguments are given. If *x* defines :meth:`__int__`, ``int(x)`` " +"returns ``x.__int__()``. If *x* defines :meth:`__index__`, it returns ``x." +"__index__()``. If *x* defines :meth:`__trunc__`, it returns ``x." +"__trunc__()``. For floating point numbers, this truncates towards zero." +msgstr "" +"数値または文字列 *x* から作成された整数オブジェクトを返します。引数が与えられ" +"ない場合には ``0`` を返します。\n" +"*x* に :meth:`__int__` が定義されている場合は、 ``int(x)`` は ``x." +"__int__()`` を返します。\n" +"*x* に :meth:`__index__` が定義されている場合は、 ```x.__index__()`` を返しま" +"す。\n" +"*x* に :meth:`__trunc__` が定義されている場合は、 ```x.__trunc__()`` を返しま" +"す。\n" +"浮動小数点数については、これは 0 に近い側へ切り捨てます。" + +#: ../../library/functions.rst:816 +msgid "" +"If *x* is not a number or if *base* is given, then *x* must be a string, :" +"class:`bytes`, or :class:`bytearray` instance representing an :ref:`integer " +"literal ` in radix *base*. Optionally, the literal can be " +"preceded by ``+`` or ``-`` (with no space in between) and surrounded by " +"whitespace. A base-n literal consists of the digits 0 to n-1, with ``a`` to " +"``z`` (or ``A`` to ``Z``) having values 10 to 35. The default *base* is 10. " +"The allowed values are 0 and 2--36. Base-2, -8, and -16 literals can be " +"optionally prefixed with ``0b``/``0B``, ``0o``/``0O``, or ``0x``/``0X``, as " +"with integer literals in code. Base 0 means to interpret exactly as a code " +"literal, so that the actual base is 2, 8, 10, or 16, and so that " +"``int('010', 0)`` is not legal, while ``int('010')`` is, as well as " +"``int('010', 8)``." +msgstr "" +"*x* が数値でない、あるいは *base* が与えられた場合、 *x* は文字列、 :class:" +"`bytes` インスタンス、 :class:`bytearray` インスタンスのいずれかで、基数 " +"*base* の :ref:`整数リテラル ` で表されたものでなければなりませ" +"ん。\n" +"オプションで、リテラルの前に ``+`` あるいは ``-`` を (中間のスペースなしで) " +"付けることができます。\n" +"また、リテラルは余白で囲むことができます。\n" +"基数 n のリテラルは、 0 から n-1 の数字に値 10-35 を持つ ``a`` から ``z`` (ま" +"たは ``A`` から ``Z``) を加えたもので構成されます。\n" +"デフォルトの *base* は 10 です。\n" +"許される値は 0 と 2--36 です。\n" +"基数 2, 8, 16 のリテラルは、別の記法としてコード中の整数リテラルのように " +"``0b``/``0B``, ``0o``/``0O``, ``0x``/``0X`` を前に付けることができます。\n" +"基数 0 はコードリテラルとして厳密に解釈することを意味します。\n" +"その結果、実際の基数は 2, 8, 10, 16 のどれかになります。\n" +"したがって ``int('010', 0)`` は有効ではありませんが、 ``int('010')`` や " +"``int('010', 8)`` は有効です。" + +#: ../../library/functions.rst:829 msgid "The integer type is described in :ref:`typesnumeric`." msgstr "整数型については、 :ref:`typesnumeric` も参照してください。" -#: ../../library/functions.rst:1047 +#: ../../library/functions.rst:831 msgid "" "If *base* is not an instance of :class:`int` and the *base* object has a :" "meth:`base.__index__ ` method, that method is called to " @@ -2042,114 +1629,76 @@ msgstr "" "__index__ ` ではなく :meth:`base.__int__ ` " "を使用していました。" -#: ../../library/functions.rst:1057 -msgid "The first parameter is now positional-only." -msgstr "第1引数は位置専用になりました。" - -#: ../../library/functions.rst:1060 -msgid "" -"Falls back to :meth:`~object.__index__` if :meth:`~object.__int__` is not " -"defined." -msgstr "" -":meth:`~object.__int__` が定義されていない場合、 :meth:`~object.__index__` へ" -"フォールバックします。" - -#: ../../library/functions.rst:1063 -msgid "" -":class:`int` string inputs and string representations can be limited to help " -"avoid denial of service attacks. A :exc:`ValueError` is raised when the " -"limit is exceeded while converting a string to an :class:`int` or when " -"converting an :class:`int` into a string would exceed the limit. See the :" -"ref:`integer string conversion length limitation ` " -"documentation." -msgstr "" -":class:`int` への文字列入力やその文字列表現は、サービス拒否攻撃 (DoS 攻撃) を" -"避けるために制限されることがあります。文字列を :class:`int` に変換したり :" -"class:`int` を文字列に変換したりする際にその制限を超えた場合、 :exc:" -"`ValueError` が送出されます。詳しくは :ref:`整数文字列の変換における長さ制限 " -"` を参照してください。" - -#: ../../library/functions.rst:1071 -msgid "" -":func:`int` no longer delegates to the :meth:`~object.__trunc__` method." +#: ../../library/functions.rst:844 +msgid "Falls back to :meth:`__index__` if :meth:`__int__` is not defined." msgstr "" +":meth:`__int__` が定義されていない場合、:meth:`__index__` へフォールバックし" +"ます。" -#: ../../library/functions.rst:1076 +#: ../../library/functions.rst:850 msgid "" "Return ``True`` if the *object* argument is an instance of the *classinfo* " -"argument, or of a (direct, indirect, or :term:`virtual `) subclass thereof. If *object* is not an object of the given type, " "the function always returns ``False``. If *classinfo* is a tuple of type " -"objects (or recursively, other such tuples) or a :ref:`types-union` of " -"multiple types, return ``True`` if *object* is an instance of any of the " -"types. If *classinfo* is not a type or tuple of types and such tuples, a :" -"exc:`TypeError` exception is raised. :exc:`TypeError` may not be raised for " -"an invalid type if an earlier check succeeds." -msgstr "" -"*object* 引数が *classinfo* 引数に指定した型、またはその (直接、間接、また" -"は :term:`仮想 ` の) サブクラスのインスタンスである場合" -"に ``True`` を返します。 *object* が与えられた型のオブジェクトでない場合、こ" -"の関数は常に ``False`` を返します。 *classinfo* が型オブジェクトのタプル (ま" -"たは再帰的にそのようなタプルを含むタプル) や複数の型の :ref:`types-union` で" -"ある場合、 *object* がそれらの型のいずれかのインスタンスであれば ``True`` を" -"返します。 *classinfo* が型や型からなるタプルまたは再帰的タプルのいずれでもな" -"い場合、 :exc:`TypeError` 例外が送出されます。タプルの中で先行する型に対する" -"チェックが成功した場合、後続の不正な型に対して :exc:`TypeError` が送出されな" -"いことがあります。" - -#: ../../library/functions.rst:1087 ../../library/functions.rst:1101 -msgid "*classinfo* can be a :ref:`types-union`." -msgstr "*classinfo* に :ref:`types-union` を指定できるようになりました。" +"objects (or recursively, other such tuples), return ``True`` if *object* is " +"an instance of any of the types. If *classinfo* is not a type or tuple of " +"types and such tuples, a :exc:`TypeError` exception is raised." +msgstr "" +"*object* 引数が *classinfo* 引数のインスタンスであるか、 (直接、間接、また" +"は :term:`仮想 `) サブクラスのインスタンスの場合に " +"``True`` を返します。\n" +"*object* が与えられた型のオブジェクトでない場合、この関数は常に ``False`` を" +"返します。\n" +"*classinfo* が型オブジェクトのタプル (あるいは再帰的に複数のタプル) の場合、 " +"*object* がそれらのいずれかのインスタンスであれば ``True`` を返します。\n" +"*classinfo* が型や型からなるタプル、あるいは複数のタプルのいずれでもない場" +"合、 :exc:`TypeError` 例外が送出されます。" -#: ../../library/functions.rst:1093 +#: ../../library/functions.rst:862 msgid "" -"Return ``True`` if *class* is a subclass (direct, indirect, or :term:" -"`virtual `) of *classinfo*. A class is considered a " -"subclass of itself. *classinfo* may be a tuple of class objects (or " -"recursively, other such tuples) or a :ref:`types-union`, in which case " -"return ``True`` if *class* is a subclass of any entry in *classinfo*. In " -"any other case, a :exc:`TypeError` exception is raised." +"Return ``True`` if *class* is a subclass (direct, indirect or :term:`virtual " +"`) of *classinfo*. A class is considered a subclass of " +"itself. *classinfo* may be a tuple of class objects, in which case every " +"entry in *classinfo* will be checked. In any other case, a :exc:`TypeError` " +"exception is raised." msgstr "" -"*class* が *classinfo* の (直接、間接、または :term:`仮想 ` の) サブクラスである場合に ``True`` を返します。クラスは自身のサブク" -"ラスとみなされます。 *classinfo* はクラスオブジェクトのタプル (または再帰的に" -"そのようなタプルを含むタプル) やクラスオブジェクトの :ref:`types-union` でも" -"よく、この場合は *class* が *classinfo* のいずれかのクラスのサブクラスであれ" -"ば ``True`` を返します。上記以外の値が指定された場合、 :exc:`TypeError` 例外" -"が送出されます。" +"*class* が *classinfo* の (直接または間接的な、あるいは :term:`virtual " +"`) サブクラスである場合に ``True`` を返します。クラスは" +"それ自身のサブクラスとみなされます。 *classinfo* はクラスオブジェクトからなる" +"タプルでもよく、この場合には *classinfo* のすべてのエントリが調べられます。そ" +"の他の場合では、例外 :exc:`TypeError` が送出されます。" -#: ../../library/functions.rst:1108 +#: ../../library/functions.rst:871 msgid "" "Return an :term:`iterator` object. The first argument is interpreted very " "differently depending on the presence of the second argument. Without a " -"second argument, *object* must be a collection object which supports the :" -"term:`iterable` protocol (the :meth:`~object.__iter__` method), or it must " -"support the sequence protocol (the :meth:`~object.__getitem__` method with " -"integer arguments starting at ``0``). If it does not support either of " -"those protocols, :exc:`TypeError` is raised. If the second argument, " -"*sentinel*, is given, then *object* must be a callable object. The iterator " -"created in this case will call *object* with no arguments for each call to " -"its :meth:`~iterator.__next__` method; if the value returned is equal to " -"*sentinel*, :exc:`StopIteration` will be raised, otherwise the value will be " -"returned." -msgstr "" -":term:`iterator` オブジェクトを返します。第二引数があるかどうかによって第一引" -"数の解釈は大きく異なります。第二引数がない場合、 *object* は :term:" -"`iterable` プロトコル (:meth:`~object.__iter__` メソッド) をサポートするコレ" -"クションオブジェクトか、またはシーケンスプロトコル (``0`` から始まる整数を引" -"数にとる :meth:`~object.__getitem__` メソッド) をサポートするオブジェクトでな" -"ければなりません。第一引数がどちらのプロトコルもサポートしない場合は :exc:" -"`TypeError` 例外が送出されます。第二引数 *sentinel* が与えられた場合、 " +"second argument, *object* must be a collection object which supports the " +"iteration protocol (the :meth:`__iter__` method), or it must support the " +"sequence protocol (the :meth:`__getitem__` method with integer arguments " +"starting at ``0``). If it does not support either of those protocols, :exc:" +"`TypeError` is raised. If the second argument, *sentinel*, is given, then " +"*object* must be a callable object. The iterator created in this case will " +"call *object* with no arguments for each call to its :meth:`~iterator." +"__next__` method; if the value returned is equal to *sentinel*, :exc:" +"`StopIteration` will be raised, otherwise the value will be returned." +msgstr "" +":term:`イテレータ ` オブジェクトを返します。 第二引数があるかどうか" +"で、第一引数の解釈は大きく異なります。 第二引数がない場合、 *object* は反復プ" +"ロトコル (:meth:`__iter__` メソッド) か、シーケンスプロトコル (引数が ``0`` " +"から開始する :meth:`__getitem__` メソッド) をサポートする集合オブジェクトでな" +"ければなりません。これらのプロトコルが両方ともサポートされていない場合、 :" +"exc:`TypeError` が送出されます。 第二引数 *sentinel* が与えられているなら、 " "*object* は呼び出し可能オブジェクトでなければなりません。この場合に生成される" -"イテレータは :meth:`~iterator.__next__` メソッドを呼び出すごとに引数なしで " -"*object* を呼び出します; 戻り値が *sentinel* と等しければ、 :exc:" -"`StopIteration` が送出されます。それ以外の場合は戻り値がそのまま返されます。" +"イテレータは、 :meth:`~iterator.__next__` を呼ぶ毎に *object* を引数無しで呼" +"び出します。返された値が *sentinel* と等しければ、 :exc:`StopIteration` が送" +"出され、そうでなければ、戻り値がそのまま返されます。" -#: ../../library/functions.rst:1122 +#: ../../library/functions.rst:884 msgid "See also :ref:`typeiter`." msgstr ":ref:`typeiter` も見てください。" -#: ../../library/functions.rst:1124 +#: ../../library/functions.rst:886 msgid "" "One useful application of the second form of :func:`iter` is to build a " "block-reader. For example, reading fixed-width blocks from a binary database " @@ -2160,19 +1709,7 @@ msgstr "" "例えば、バイナリのデータベースファイルから固定幅のブロックをファイルの終端に" "到達するまで読み出すには次のようにします::" -#: ../../library/functions.rst:1128 -msgid "" -"from functools import partial\n" -"with open('mydata.db', 'rb') as f:\n" -" for block in iter(partial(f.read, 64), b''):\n" -" process_block(block)" -msgstr "" -"from functools import partial\n" -"with open('mydata.db', 'rb') as f:\n" -" for block in iter(partial(f.read, 64), b''):\n" -" process_block(block)" - -#: ../../library/functions.rst:1136 +#: ../../library/functions.rst:898 msgid "" "Return the length (the number of items) of an object. The argument may be a " "sequence (such as a string, bytes, tuple, list, or range) or a collection " @@ -2181,7 +1718,7 @@ msgstr "" "オブジェクトの長さ (要素の数) を返します。引数はシーケンス (文字列、バイト" "列、タプル、リスト、range 等) かコレクション (辞書、集合、凍結集合等) です。" -#: ../../library/functions.rst:1142 +#: ../../library/functions.rst:904 msgid "" "``len`` raises :exc:`OverflowError` on lengths larger than :data:`sys." "maxsize`, such as :class:`range(2 ** 100) `." @@ -2189,7 +1726,7 @@ msgstr "" "``len`` は、例えば :class:`range(2 ** 100) ` のような、 :data:`sys." "maxsize` を超える長さに対して :exc:`OverflowError` を送出します。" -#: ../../library/functions.rst:1151 +#: ../../library/functions.rst:912 msgid "" "Rather than being a function, :class:`list` is actually a mutable sequence " "type, as documented in :ref:`typesseq-list` and :ref:`typesseq`." @@ -2197,138 +1734,51 @@ msgstr "" ":class:`list` は、実際には関数ではなくミュータブルなシーケンス型で、 :ref:" "`typesseq-list` と :ref:`typesseq` にドキュメント化されています。" -#: ../../library/functions.rst:1157 -msgid "" -"Return a mapping object representing the current local symbol table, with " -"variable names as the keys, and their currently bound references as the " -"values." -msgstr "" -"現在のローカル シンボル テーブルを表すマッピング オブジェクトを返します。これ" -"は変数名をキーとし、現在バインドされている参照を値とします。" - -#: ../../library/functions.rst:1161 -msgid "" -"At module scope, as well as when using :func:`exec` or :func:`eval` with a " -"single namespace, this function returns the same namespace as :func:" -"`globals`." -msgstr "" -"モジュール スコープでは、単一の名前空間で :func:`exec` や :func:`eval` を使う" -"場合と同じく、この関数は :func:`globals` と同じ名前空間を返します。" - -#: ../../library/functions.rst:1165 -msgid "" -"At class scope, it returns the namespace that will be passed to the " -"metaclass constructor." -msgstr "" -"クラス スコープでは、メタクラス コンストラクタに渡された名前空間を返します。" - -#: ../../library/functions.rst:1168 -msgid "" -"When using ``exec()`` or ``eval()`` with separate local and global " -"arguments, it returns the local namespace passed in to the function call." -msgstr "" -"``exec()`` や ``eval()`` が引数 local と global が分けて使われてる場合では、" -"関数の呼び出しで渡されたローカル名前空間を返します。" - -#: ../../library/functions.rst:1171 +#: ../../library/functions.rst:918 msgid "" -"In all of the above cases, each call to ``locals()`` in a given frame of " -"execution will return the *same* mapping object. Changes made through the " -"mapping object returned from ``locals()`` will be visible as assigned, " -"reassigned, or deleted local variables, and assigning, reassigning, or " -"deleting local variables will immediately affect the contents of the " -"returned mapping object." +"Update and return a dictionary representing the current local symbol table. " +"Free variables are returned by :func:`locals` when it is called in function " +"blocks, but not in class blocks. Note that at the module level, :func:" +"`locals` and :func:`globals` are the same dictionary." msgstr "" -"上記どの場合でも、特定の実行フレーム内での各 ``locals()`` は *同じ* マッピン" -"グ オブジェクトを返します。 ``locals()`` から返されたマッピング オブジェクト" -"を通じて行われた変更は、代入、再代入、または削除されたローカル変数として可視" -"化されます。そしてローカル変数の代入、再代入、または削除は、返されたマッピン" -"グ オブジェクトの内容へ直ちに反映されます。" +"現在のローカルシンボルテーブルを表す辞書を更新して返します。\n" +"関数ブロックで :func:`locals` を呼び出したときは自由変数が返されますが、クラ" +"スブロックでは返されません。\n" +"モジュールレベルでは、 :func:`locals` と :func:`globals` は同じ辞書であること" +"に注意してください。" -#: ../../library/functions.rst:1178 -msgid "" -"In an :term:`optimized scope` (including functions, generators, and " -"coroutines), each call to ``locals()`` instead returns a fresh dictionary " -"containing the current bindings of the function's local variables and any " -"nonlocal cell references. In this case, name binding changes made via the " -"returned dict are *not* written back to the corresponding local variables or " -"nonlocal cell references, and assigning, reassigning, or deleting local " -"variables and nonlocal cell references does *not* affect the contents of " -"previously returned dictionaries." -msgstr "" -":term:`optimized scope` (関数、ジェネレーター、コルーチンを含む)では、 " -"``locals()`` を呼び出すと、代わりに関数のローカル変数と非ローカル セル参照の" -"現在のバインディングを含んだ新しい辞書を返します。この場合、返された辞書を" -"使って行われた変更は、対応するローカル変数や非ローカル セル参照には *書き戻さ" -"れません* 。また、ローカル変数や非ローカル セル参照へ代入、再代入、削除を行っ" -"ても、以前に返された辞書の内容には *影響しません* 。" - -#: ../../library/functions.rst:1187 -msgid "" -"Calling ``locals()`` as part of a comprehension in a function, generator, or " -"coroutine is equivalent to calling it in the containing scope, except that " -"the comprehension's initialised iteration variables will be included. In " -"other scopes, it behaves as if the comprehension were running as a nested " -"function." -msgstr "" -"``locals()`` 呼び出しが関数、ジェネレータ、コルーチン内の内包表記内にあれば、" -"これはそれを含むスコープから呼び出すことと同等です。ただし内包表記の初期化さ" -"れた反復変数が含まれます。他のスコープでは、内包表記がネストされた関数として" -"実行されているかのように振舞います。" - -#: ../../library/functions.rst:1193 -msgid "" -"Calling ``locals()`` as part of a generator expression is equivalent to " -"calling it in a nested generator function." -msgstr "" -"``locals()`` 呼び出しがジェネレータ式の一部であれば、ネストされたジェネレータ" -"関数内の呼び出しと同等です。" - -#: ../../library/functions.rst:1196 -msgid "" -"The behaviour of ``locals()`` in a comprehension has been updated as " -"described in :pep:`709`." -msgstr "" -"内包表記における ``locals()`` の振る舞い は、 :pep:`709` で説明されているよう" -"に更新されました。" - -#: ../../library/functions.rst:1200 +#: ../../library/functions.rst:924 msgid "" -"As part of :pep:`667`, the semantics of mutating the mapping objects " -"returned from this function are now defined. The behavior in :term:" -"`optimized scopes ` is now as described above. Aside from " -"being defined, the behaviour in other scopes remains unchanged from previous " -"versions." +"The contents of this dictionary should not be modified; changes may not " +"affect the values of local and free variables used by the interpreter." msgstr "" -":pep:`667` の一部として、この関数から返されるマッピングオブジェクトを変更する" -"セマンティクスが定義されました。 :term:`optimized scopes ` " -"の振る舞いは上記のようになりました。定義されただけで、その他のスコープの振る" -"舞いは以前のバージョンのままです。" +"この辞書の内容は変更してはいけません; 変更しても、インタプリタが使うローカル" +"変数や自由変数の値には影響しません。" -#: ../../library/functions.rst:1210 +#: ../../library/functions.rst:929 msgid "" "Return an iterator that applies *function* to every item of *iterable*, " -"yielding the results. If additional *iterables* arguments are passed, " +"yielding the results. If additional *iterable* arguments are passed, " "*function* must take that many arguments and is applied to the items from " "all iterables in parallel. With multiple iterables, the iterator stops when " -"the shortest iterable is exhausted. If *strict* is ``True`` and one of the " -"iterables is exhausted before the others, a :exc:`ValueError` is raised. For " -"cases where the function inputs are already arranged into argument tuples, " -"see :func:`itertools.starmap`." -msgstr "" - -#: ../../library/functions.rst:1219 -msgid "Added the *strict* parameter." +"the shortest iterable is exhausted. For cases where the function inputs are " +"already arranged into argument tuples, see :func:`itertools.starmap`\\." msgstr "" +"*function* を、結果を返しながら *iterable* の全ての要素に適用するイテレータを" +"返します。追加の *iterable* 引数が渡されたなら、 *function* はその数だけの引" +"数を取らなければならず、全てのイテラブルから並行して取られた要素に適用されま" +"す。複数のイテラブルが与えられたら、このイテレータはその中の最短のイテラブル" +"が尽きた時点で止まります。関数の入力がすでに引数タプルに配置されている場合" +"は、 :func:`itertools.starmap` を参照してください。" -#: ../../library/functions.rst:1227 +#: ../../library/functions.rst:940 msgid "" "Return the largest item in an iterable or the largest of two or more " "arguments." msgstr "" "iterable の中で最大の要素、または2つ以上の引数の中で最大のものを返します。" -#: ../../library/functions.rst:1230 +#: ../../library/functions.rst:943 msgid "" "If one positional argument is provided, it should be an :term:`iterable`. " "The largest item in the iterable is returned. If two or more positional " @@ -2338,7 +1788,7 @@ msgstr "" "けません。その iterable の最大の要素が返されます。2 つ以上のキーワード無しの" "位置引数が与えられた場合、その位置引数の中で最大のものが返されます。" -#: ../../library/functions.rst:1235 ../../library/functions.rst:1273 +#: ../../library/functions.rst:948 ../../library/functions.rst:985 msgid "" "There are two optional keyword-only arguments. The *key* argument specifies " "a one-argument ordering function like that used for :meth:`list.sort`. The " @@ -2354,7 +1804,7 @@ msgstr "" "イテラブルが空で *default* が与えられていない場合 :exc:`ValueError` が送出さ" "れます。" -#: ../../library/functions.rst:1241 +#: ../../library/functions.rst:954 msgid "" "If multiple items are maximal, the function returns the first one " "encountered. This is consistent with other sort-stability preserving tools " @@ -2366,15 +1816,15 @@ msgstr "" "nlargest(1, iterable, key=keyfunc)`` のような、他のソート安定性を維持するツー" "ルと両立します。" -#: ../../library/functions.rst:1246 ../../library/functions.rst:1284 -msgid "Added the *default* keyword-only parameter." -msgstr "キーワード専用引数 *default* が追加されました。" +#: ../../library/functions.rst:959 ../../library/functions.rst:996 +msgid "The *default* keyword-only argument." +msgstr "*default* キーワード専用引数。" -#: ../../library/functions.rst:1249 ../../library/functions.rst:1287 +#: ../../library/functions.rst:962 ../../library/functions.rst:999 msgid "The *key* can be ``None``." msgstr "*key* 引数が ``None`` であることを許容します。" -#: ../../library/functions.rst:1257 +#: ../../library/functions.rst:970 msgid "" "Return a \"memory view\" object created from the given argument. See :ref:" "`typememoryview` for more information." @@ -2382,14 +1832,14 @@ msgstr "" "与えられたオブジェクトから作られた \"メモリビュー\" オブジェクトを返します。" "詳しくは :ref:`typememoryview` を参照してください。" -#: ../../library/functions.rst:1265 +#: ../../library/functions.rst:977 msgid "" "Return the smallest item in an iterable or the smallest of two or more " "arguments." msgstr "" "iterable の中で最小の要素、または2つ以上の引数の中で最小のものを返します。" -#: ../../library/functions.rst:1268 +#: ../../library/functions.rst:980 msgid "" "If one positional argument is provided, it should be an :term:`iterable`. " "The smallest item in the iterable is returned. If two or more positional " @@ -2399,7 +1849,7 @@ msgstr "" "けません。その iterable の最小の要素が返されます。2 つ以上のキーワード無しの" "位置引数が与えられた場合、その位置引数の中で最小のものが返されます。" -#: ../../library/functions.rst:1279 +#: ../../library/functions.rst:991 msgid "" "If multiple items are minimal, the function returns the first one " "encountered. This is consistent with other sort-stability preserving tools " @@ -2410,53 +1860,56 @@ msgstr "" "は、``sorted(iterable, key=keyfunc)[0]`` や ``heapq.nsmallest(1, iterable, " "key=keyfunc)`` のような、他のソート安定性を維持するツールと両立します。" -#: ../../library/functions.rst:1294 +#: ../../library/functions.rst:1005 msgid "" -"Retrieve the next item from the :term:`iterator` by calling its :meth:" -"`~iterator.__next__` method. If *default* is given, it is returned if the " -"iterator is exhausted, otherwise :exc:`StopIteration` is raised." +"Retrieve the next item from the *iterator* by calling its :meth:`~iterator." +"__next__` method. If *default* is given, it is returned if the iterator is " +"exhausted, otherwise :exc:`StopIteration` is raised." msgstr "" -":term:`iterator` の :meth:`~iterator.__next__` メソッドを呼び出すことにより、" -"次の要素を取得します。イテレータが使い尽くされた場合、 *default* が与えられて" -"いればその値が返されます。そうでない場合は :exc:`StopIteration` が送出されま" -"す。" +"*iterator* の :meth:`~iterator.__next__` メソッドを呼び出すことにより、次の要" +"素を取得します。イテレータが尽きている場合、 *default* が与えられていればそれ" +"が返され、そうでなければ :exc:`StopIteration` が送出されます。" -#: ../../library/functions.rst:1301 +#: ../../library/functions.rst:1012 msgid "" -"This is the ultimate base class of all other classes. It has methods that " -"are common to all instances of Python classes. When the constructor is " -"called, it returns a new featureless object. The constructor does not accept " -"any arguments." +"Return a new featureless object. :class:`object` is a base for all classes. " +"It has the methods that are common to all instances of Python classes. This " +"function does not accept any arguments." msgstr "" +"特徴を持たない新しいオブジェクトを返します。 :class:`object` は全てのクラスの" +"基底クラスです。これは、 Python のクラスの全てのインスタンスに共通のメソッド" +"群を持ちます。この関数はいかなる引数も受け付けません。" -#: ../../library/functions.rst:1308 +#: ../../library/functions.rst:1018 msgid "" -":class:`object` instances do *not* have :attr:`~object.__dict__` attributes, " -"so you can't assign arbitrary attributes to an instance of :class:`object`." +":class:`object` does *not* have a :attr:`~object.__dict__`, so you can't " +"assign arbitrary attributes to an instance of the :class:`object` class." msgstr "" +":class:`object` は :attr:`~object.__dict__` を *持たない* ので、 :class:" +"`object` クラスのインスタンスに任意の属性を代入することはできません。" -#: ../../library/functions.rst:1315 +#: ../../library/functions.rst:1024 msgid "" "Convert an integer number to an octal string prefixed with \"0o\". The " "result is a valid Python expression. If *x* is not a Python :class:`int` " -"object, it has to define an :meth:`~object.__index__` method that returns an " +"object, it has to define an :meth:`__index__` method that returns an " "integer. For example:" msgstr "" "整数を先頭に \"0o\" が付いた 8 進文字列に変換します。\n" "結果は Python の式としても使える形式になります。\n" -"*x* が Python の :class:`int` オブジェクトでない場合、整数を返す :meth:" -"`~object.__index__` メソッドが定義されていなければなりません。\n" +" *x* が Python の :class:`int` オブジェクトでない場合、整数を返す :meth:" +"`__index__` メソッドが定義されていなければなりません。\n" "例えば、次のようになります:" -#: ../../library/functions.rst:1325 +#: ../../library/functions.rst:1034 msgid "" -"If you want to convert an integer number to an octal string either with the " -"prefix \"0o\" or not, you can use either of the following ways." +"If you want to convert an integer number to octal string either with prefix " +"\"0o\" or not, you can use either of the following ways." msgstr "" -"整数を接頭辞 \"0o\" 付きや \"0o\" 無しの 8 進文字列に変換したい場合は、次に挙" -"げる方法のいずれかを使ってください。" +"整数を接頭辞の \"0o\" 付きや \"0o\" 無しの 8 進文字列に変換したい場合は、次に" +"挙げる方法が使えます。" -#: ../../library/functions.rst:1342 +#: ../../library/functions.rst:1051 msgid "" "Open *file* and return a corresponding :term:`file object`. If the file " "cannot be opened, an :exc:`OSError` is raised. See :ref:`tut-files` for more " @@ -2466,119 +1919,119 @@ msgstr "" "す。ファイルを開くことができなければ、:exc:`OSError` が送出されます。\n" "この関数の利用例について、 :ref:`tut-files` を参照してください。" -#: ../../library/functions.rst:1346 +#: ../../library/functions.rst:1055 msgid "" "*file* is a :term:`path-like object` giving the pathname (absolute or " "relative to the current working directory) of the file to be opened or an " "integer file descriptor of the file to be wrapped. (If a file descriptor is " -"given, it is closed when the returned I/O object is closed unless *closefd* " +"given, it is closed when the returned I/O object is closed, unless *closefd* " "is set to ``False``.)" msgstr "" -"*file* は :term:`path-like object` で、開くファイルのパス名 (絶対パスまたは現" -"在の作業ディレクトリからの相対パス) あるいはラップするファイルの整数のファイ" -"ルデスクリプタを与えます。 (ファイルデスクリプタが与えられた場合、 *closefd* " -"が ``False`` に設定されていないかぎり、この関数が返す I/O オブジェクトがク" -"ローズされるときにファイルデスクリプタもクローズされます。)" +"*file* は :term:`path-like object` で、開くファイルの (絶対または現在のワーキ" +"ングディレクトリに対する相対) パス名を与えるものか、または、ラップするファイ" +"ルの整数のファイルディスクリプタです。(ファイルディスクリプタが与えられた場合" +"は、それは *closefd* が ``False`` に設定されていない限り、返された I/O オブ" +"ジェクトが閉じられるときに閉じられます。)" -#: ../../library/functions.rst:1352 +#: ../../library/functions.rst:1061 msgid "" "*mode* is an optional string that specifies the mode in which the file is " "opened. It defaults to ``'r'`` which means open for reading in text mode. " "Other common values are ``'w'`` for writing (truncating the file if it " -"already exists), ``'x'`` for exclusive creation, and ``'a'`` for appending " +"already exists), ``'x'`` for exclusive creation and ``'a'`` for appending " "(which on *some* Unix systems, means that *all* writes append to the end of " "the file regardless of the current seek position). In text mode, if " -"*encoding* is not specified the encoding used is platform-dependent: :func:" -"`locale.getencoding` is called to get the current locale encoding. (For " -"reading and writing raw bytes use binary mode and leave *encoding* " -"unspecified.) The available modes are:" -msgstr "" -"*mode* オプション文字列はファイルが開かれる際のモードを指定します。デフォルト" -"は ``'r'`` で、読み込み用にテキストモードで開くという意味です。その他によく使" -"われるモードとして、書き込み用の ``'w'`` (ファイルが既に存在する場合は上書き" -"します) 、排他的な生成をあらわす ``'x'`` 、そして追記用の ``'a'`` ( *いくつか" -"の* Unix システムでは、 *すべての* 書き込みは現在のシーク位置にかかわらずファ" -"イルの末尾に追記する、という意味です) です。テキストモードで *encoding* が指" -"定されない場合に使われるエンコーディングは、プラットフォーム依存です: 現在の" -"ロケールエンコーディングを取得するために :func:`locale.getencoding` が呼ばれ" -"ます。 (生のバイトデータを読み書きする際にはバイナリモードを使い、 " -"*encoding* は指定しません。) 指定できるモードは以下の通りです:" - -#: ../../library/functions.rst:1369 +"*encoding* is not specified the encoding used is platform dependent: " +"``locale.getpreferredencoding(False)`` is called to get the current locale " +"encoding. (For reading and writing raw bytes use binary mode and leave " +"*encoding* unspecified.) The available modes are:" +msgstr "" +"*mode* はオプションの文字列で、ファイルが開かれるモードを指定します。デフォル" +"トは ``'r'`` で、読み込み用にテキストモードで開くという意味です。その他のよく" +"使われる値は、書き込み (ファイルがすでに存在する場合はそのファイルを切り詰め" +"ます) 用の ``'w'``、排他的な生成用の ``'x'``、追記用の ``'a'`` です (*いくつ" +"かの* Unix システムでは、*全て* の書き込みが現在のファイルシーク位置に関係な" +"くファイルの末尾に追加されます)。テキストモードでは、*encoding* が指定されて" +"いない場合に使われるエンコーディングはプラットフォームに依存します:``locale." +"getpreferredencoding(False)`` を使って現在のロケールエンコーディングを取得し" +"ます。(rawバイト列の読み書きには、バイナリモードを使い、*encoding* は未指定の" +"ままとします) 指定可能なモードは次の表の通りです。" + +#: ../../library/functions.rst:1078 msgid "Character" msgstr "文字" -#: ../../library/functions.rst:1369 +#: ../../library/functions.rst:1078 msgid "Meaning" msgstr "意味" -#: ../../library/functions.rst:1371 +#: ../../library/functions.rst:1080 msgid "``'r'``" msgstr "``'r'``" -#: ../../library/functions.rst:1371 +#: ../../library/functions.rst:1080 msgid "open for reading (default)" msgstr "読み込み用に開く (デフォルト)" -#: ../../library/functions.rst:1372 +#: ../../library/functions.rst:1081 msgid "``'w'``" msgstr "``'w'``" -#: ../../library/functions.rst:1372 +#: ../../library/functions.rst:1081 msgid "open for writing, truncating the file first" msgstr "書き込み用に開き、まずファイルを切り詰める" -#: ../../library/functions.rst:1373 +#: ../../library/functions.rst:1082 msgid "``'x'``" msgstr "``'x'``" -#: ../../library/functions.rst:1373 +#: ../../library/functions.rst:1082 msgid "open for exclusive creation, failing if the file already exists" msgstr "排他的な生成に開き、ファイルが存在する場合は失敗する" -#: ../../library/functions.rst:1374 +#: ../../library/functions.rst:1083 msgid "``'a'``" msgstr "``'a'``" -#: ../../library/functions.rst:1374 -msgid "open for writing, appending to the end of file if it exists" -msgstr "書き込み用に開き、ファイルが存在する場合には末尾に追記する" +#: ../../library/functions.rst:1083 +msgid "open for writing, appending to the end of the file if it exists" +msgstr "書き込み用に開き、ファイルが存在する場合は末尾に追記する" -#: ../../library/functions.rst:1375 +#: ../../library/functions.rst:1084 msgid "``'b'``" msgstr "``'b'``" -#: ../../library/functions.rst:1375 ../../library/functions.rst:1519 +#: ../../library/functions.rst:1084 msgid "binary mode" msgstr "バイナリモード" -#: ../../library/functions.rst:1376 +#: ../../library/functions.rst:1085 msgid "``'t'``" msgstr "``'t'``" -#: ../../library/functions.rst:1376 +#: ../../library/functions.rst:1085 msgid "text mode (default)" msgstr "テキストモード (デフォルト)" -#: ../../library/functions.rst:1377 +#: ../../library/functions.rst:1086 msgid "``'+'``" msgstr "``'+'``" -#: ../../library/functions.rst:1377 +#: ../../library/functions.rst:1086 msgid "open for updating (reading and writing)" msgstr "更新用に開く (読み込み・書き込み用)" -#: ../../library/functions.rst:1380 +#: ../../library/functions.rst:1089 msgid "" -"The default mode is ``'r'`` (open for reading text, a synonym of ``'rt'``). " +"The default mode is ``'r'`` (open for reading text, synonym of ``'rt'``). " "Modes ``'w+'`` and ``'w+b'`` open and truncate the file. Modes ``'r+'`` and " "``'r+b'`` open the file with no truncation." msgstr "" -"デフォルトのモードは ``'r'`` (テキストの読み込み用に開く、 ``'rt'`` と同義) " -"です。 ``'w+'`` と ``'w+b'`` はファイルを開いて上書きします。 ``'r+'`` と " -"``'r+b'`` はファイルを上書きせずに開きます。" +"デフォルトのモードは ``'r'`` (開いてテキストの読み込み、``'rt'`` と同義) で" +"す。モード ``'w+'`` と ``'w+b'`` はファイルを開いて切り詰めます。モード " +"``'r+'`` と ``'r+b'`` はファイルを切り詰めずに開きます。" -#: ../../library/functions.rst:1384 +#: ../../library/functions.rst:1093 msgid "" "As mentioned in the :ref:`io-overview`, Python distinguishes between binary " "and text I/O. Files opened in binary mode (including ``'b'`` in the *mode* " @@ -2596,7 +2049,22 @@ msgstr "" "ラットフォーム依存のエンコーディングか、*encoding* が指定された場合は指定され" "たエンコーディングを使ってデコードされます。" -#: ../../library/functions.rst:1394 +#: ../../library/functions.rst:1101 +msgid "" +"There is an additional mode character permitted, ``'U'``, which no longer " +"has any effect, and is considered deprecated. It previously enabled :term:" +"`universal newlines` in text mode, which became the default behaviour in " +"Python 3.0. Refer to the documentation of the :ref:`newline ` parameter for further details." +msgstr "" +"さらに ``'U'`` という許可されているモード文字がありますが、これの効果は無く" +"なっていて非推奨とされています。\n" +"以前はこのモード文字は、テキストモードでの :term:`universal newlines` を有効" +"にしていましたが、 Python 3.0 ではそれがデフォルトの挙動となりました。\n" +"より詳細なことは :ref:`newline ` 引数のドキュメントを" +"参照してください。" + +#: ../../library/functions.rst:1109 msgid "" "Python doesn't depend on the underlying operating system's notion of text " "files; all the processing is done by Python itself, and is therefore " @@ -2606,40 +2074,34 @@ msgstr "" "は依存しません; すべての処理は Python 自身で行われ、よってプラットフォーム非" "依存です。" -#: ../../library/functions.rst:1398 +#: ../../library/functions.rst:1113 msgid "" "*buffering* is an optional integer used to set the buffering policy. Pass 0 " "to switch buffering off (only allowed in binary mode), 1 to select line " -"buffering (only usable when writing in text mode), and an integer > 1 to " -"indicate the size in bytes of a fixed-size chunk buffer. Note that " -"specifying a buffer size this way applies for binary buffered I/O, but " -"``TextIOWrapper`` (i.e., files opened with ``mode='r+'``) would have another " -"buffering. To disable buffering in ``TextIOWrapper``, consider using the " -"``write_through`` flag for :func:`io.TextIOWrapper.reconfigure`. When no " -"*buffering* argument is given, the default buffering policy works as follows:" -msgstr "" -"*buffering* はオプションの整数で、バッファリングのポリシーを設定するために使" -"われます。 バッファリングを無効化するためには0を渡してください (バイナリモー" -"ドでのみ設定可能です)。また行単位でのバッファリングには1を設定してください " -"(テキストモードでの書き込み時のみ有効です)。固定サイズのチャンクバッファに対" -"するサイズをバイト単位で指定したい場合は、1より大きい整数を渡してください。こ" -"の形式でバッファサイズを指定した場合、バイナリ形式でバッファリングをサポート" -"する I/O (buffered I/O) にはそのまま適用されますが、 ``TextIOWrapper`` (すな" -"わち ``mode='r+'`` のモードでオープンされたファイル) では別のバッファリングを" -"行うかもしれません。 ``TextIOWrapper`` でバッファリングを無効化するには、 :" -"func:`io.TextIOWrapper.reconfigure` で ``write_through`` フラグを使うことを検" -"討してください。 *buffering* 引数が与えられなかった場合、デフォルトのバッファ" -"リングポリシーは以下のように動作します:" - -#: ../../library/functions.rst:1408 +"buffering (only usable in text mode), and an integer > 1 to indicate the " +"size in bytes of a fixed-size chunk buffer. When no *buffering* argument is " +"given, the default buffering policy works as follows:" +msgstr "" +"*buffering* はオプションの整数で、バッファリングの方針を設定するのに使われま" +"す。バッファリングを無効にする (バイナリモードでのみ有効) には 0、行単位バッ" +"ファリング (テキストモードでのみ有効) には 1、固定値のチャンクバッファの大き" +"さをバイト単位で指定するには 1 以上の整数を渡してください。*buffering* 引数が" +"与えられていないとき、デフォルトのバッファリング方針は以下のように動作します:" + +#: ../../library/functions.rst:1119 msgid "" "Binary files are buffered in fixed-size chunks; the size of the buffer is " -"``max(min(blocksize, 8 MiB), DEFAULT_BUFFER_SIZE)`` when the device block " -"size is available. On most systems, the buffer will typically be 128 " -"kilobytes long." +"chosen using a heuristic trying to determine the underlying device's \"block " +"size\" and falling back on :attr:`io.DEFAULT_BUFFER_SIZE`. On many systems, " +"the buffer will typically be 4096 or 8192 bytes long." msgstr "" +"バイナリファイルは固定サイズのチャンクでバッファリングされます。バッファサイ" +"ズは、下層のデバイスの「ブロックサイズ」を決定するヒューリスティックを用いて" +"選択され、それが不可能な場合は代わりに :attr:`io.DEFAULT_BUFFER_SIZE` が使わ" +"れます。多くのシステムでは、典型的なバッファサイズは 4096 か 8192 バイト長に" +"なるでしょう。" -#: ../../library/functions.rst:1413 +#: ../../library/functions.rst:1124 msgid "" "\"Interactive\" text files (files for which :meth:`~io.IOBase.isatty` " "returns ``True``) use line buffering. Other text files use the policy " @@ -2649,22 +2111,22 @@ msgstr "" "ファイル) は行バッファリングを使用します。 その他のテキストファイルは、上で説" "明したバイナリファイル用の方針を使用します。" -#: ../../library/functions.rst:1417 +#: ../../library/functions.rst:1128 msgid "" "*encoding* is the name of the encoding used to decode or encode the file. " "This should only be used in text mode. The default encoding is platform " -"dependent (whatever :func:`locale.getencoding` returns), but any :term:`text " -"encoding` supported by Python can be used. See the :mod:`codecs` module for " -"the list of supported encodings." +"dependent (whatever :func:`locale.getpreferredencoding` returns), but any :" +"term:`text encoding` supported by Python can be used. See the :mod:`codecs` " +"module for the list of supported encodings." msgstr "" "*encoding* はファイルのエンコードやデコードに使われる :term:`text encoding` " "の名前です。このオプションはテキストモードでのみ使用してください。デフォルト" -"エンコーディングはプラットフォーム依存 (:func:`locale.getencoding` が返すも" -"の) ですが、Pythonでサポートされているエンコーディングはどれでも使えます。詳" -"しくは :mod:`codecs` モジュール内のサポートしているエンコーディングのリストを" -"参照してください。" +"エンコーディングはプラットフォーム依存 (:func:`locale.getpreferredencoding` " +"が返すもの) ですが、Pythonでサポートされているエンコーディングはどれでも使え" +"ます。詳しくは :mod:`codecs` モジュール内のサポートしているエンコーディングの" +"リストを参照してください。" -#: ../../library/functions.rst:1423 +#: ../../library/functions.rst:1135 msgid "" "*errors* is an optional string that specifies how encoding and decoding " "errors are to be handled—this cannot be used in binary mode. A variety of " @@ -2678,7 +2140,7 @@ msgstr "" "`codecs.register_error` に登録されているエラー処理の名前も使用可能です。標準" "のエラーハンドラの名前には、以下のようなものがあります:" -#: ../../library/functions.rst:1431 +#: ../../library/functions.rst:1143 msgid "" "``'strict'`` to raise a :exc:`ValueError` exception if there is an encoding " "error. The default value of ``None`` has the same effect." @@ -2686,7 +2148,7 @@ msgstr "" "``'strict'`` はエンコーディングエラーがあると例外 :exc:`ValueError` を発生さ" "せます。デフォルト値である ``None`` も同じ効果です。" -#: ../../library/functions.rst:1435 +#: ../../library/functions.rst:1147 msgid "" "``'ignore'`` ignores errors. Note that ignoring encoding errors can lead to " "data loss." @@ -2694,7 +2156,7 @@ msgstr "" "``'ignore'`` はエラーを無視します。エンコーディングエラーを無視することで、" "データが失われる可能性があることに注意してください。" -#: ../../library/functions.rst:1438 +#: ../../library/functions.rst:1150 msgid "" "``'replace'`` causes a replacement marker (such as ``'?'``) to be inserted " "where there is malformed data." @@ -2702,7 +2164,7 @@ msgstr "" "``'replace'`` は、不正な形式のデータが存在した場所に(``'?'`` のような) 置換" "マーカーを挿入します。" -#: ../../library/functions.rst:1441 +#: ../../library/functions.rst:1153 msgid "" "``'surrogateescape'`` will represent any incorrect bytes as low surrogate " "code units ranging from U+DC80 to U+DCFF. These surrogate code units will " @@ -2716,17 +2178,17 @@ msgstr "" "ドユニットは元と同じバイト列に変換されます。これはエンコーディングが不明な" "ファイルを処理するのに便利です。" -#: ../../library/functions.rst:1448 +#: ../../library/functions.rst:1160 msgid "" "``'xmlcharrefreplace'`` is only supported when writing to a file. Characters " "not supported by the encoding are replaced with the appropriate XML " -"character reference :samp:`&#{nnn};`." +"character reference ``&#nnn;``." msgstr "" "``'xmlcharrefreplace'`` はファイルへの書き込み時のみサポートされます。そのエ" -"ンコーディングでサポートされない文字は、:samp:`&#{nnn};` 形式の適切な XML 文" -"字参照で置換されます。" +"ンコーディングでサポートされない文字は、``&#nnn;`` 形式の適切な XML 文字参照" +"で置換されます。" -#: ../../library/functions.rst:1452 +#: ../../library/functions.rst:1164 msgid "" "``'backslashreplace'`` replaces malformed data by Python's backslashed " "escape sequences." @@ -2734,7 +2196,7 @@ msgstr "" "``'backslashreplace'`` は不正なデータを Python のバックスラッシュ付きのエス" "ケープシーケンスで置換します。" -#: ../../library/functions.rst:1455 +#: ../../library/functions.rst:1167 msgid "" "``'namereplace'`` (also only supported when writing) replaces unsupported " "characters with ``\\N{...}`` escape sequences." @@ -2742,17 +2204,17 @@ msgstr "" "``'namereplace'`` (書き込み時のみサポートされています) はサポートされていない" "文字を ``\\N{...}`` エスケープシーケンスで置換します。" -#: ../../library/functions.rst:1463 +#: ../../library/functions.rst:1175 msgid "" -"*newline* determines how to parse newline characters from the stream. It can " -"be ``None``, ``''``, ``'\\n'``, ``'\\r'``, and ``'\\r\\n'``. It works as " -"follows:" +"*newline* controls how :term:`universal newlines` mode works (it only " +"applies to text mode). It can be ``None``, ``''``, ``'\\n'``, ``'\\r'``, " +"and ``'\\r\\n'``. It works as follows:" msgstr "" -"*newline* はストリームから受け取った改行文字をどのようにパースするかを決定し" -"ます。 ``None``, ``''``, ``'\\n'``, ``'\\r'``, または ``'\\r\\n'`` のいずれか" -"を指定できます。これは以下のように動作します:" +"*newline* は :term:`universal newlines` モードの動作を制御します (テキスト" +"モードでのみ動作します)。``None``, ``''``, ``'\\n'``, ``'\\r'``, " +"``'\\r\\n'`` のいずれかです。これは以下のように動作します:" -#: ../../library/functions.rst:1467 +#: ../../library/functions.rst:1179 msgid "" "When reading input from the stream, if *newline* is ``None``, universal " "newlines mode is enabled. Lines in the input can end in ``'\\n'``, " @@ -2769,7 +2231,7 @@ msgstr "" "び出し元に返されます。その他の正当な値の場合、入力行は与えられた文字列でのみ" "終わり、行末は変換されずに呼び出し元に返されます。" -#: ../../library/functions.rst:1475 +#: ../../library/functions.rst:1187 msgid "" "When writing output to the stream, if *newline* is ``None``, any ``'\\n'`` " "characters written are translated to the system default line separator, :" @@ -2783,12 +2245,12 @@ msgstr "" "*newline* がその他の正当な値の場合、全ての ``'\\n'`` 文字は与えられた文字列に" "変換されます。" -#: ../../library/functions.rst:1481 +#: ../../library/functions.rst:1193 msgid "" "If *closefd* is ``False`` and a file descriptor rather than a filename was " "given, the underlying file descriptor will be kept open when the file is " -"closed. If a filename is given *closefd* must be ``True`` (the default); " -"otherwise, an error will be raised." +"closed. If a filename is given *closefd* must be ``True`` (the default) " +"otherwise an error will be raised." msgstr "" "*closefd* が ``False`` で、ファイル名ではなくてファイル記述子が与えられた場" "合、下層のファイル記述子はファイルが閉じられた後も開いたままとなります。\n" @@ -2796,7 +2258,7 @@ msgstr "" "りません。\n" "そうでない場合エラーが送出されます。" -#: ../../library/functions.rst:1486 +#: ../../library/functions.rst:1198 msgid "" "A custom opener can be used by passing a callable as *opener*. The " "underlying file descriptor for the file object is then obtained by calling " @@ -2810,11 +2272,11 @@ msgstr "" "さなければなりません。 (:mod:`os.open` を *opener* として渡すと、``None`` を" "渡したのと同様の機能になります)。" -#: ../../library/functions.rst:1492 +#: ../../library/functions.rst:1204 msgid "The newly created file is :ref:`non-inheritable `." msgstr "新たに作成されたファイルは :ref:`継承不可 ` です。" -#: ../../library/functions.rst:1494 +#: ../../library/functions.rst:1206 msgid "" "The following example uses the :ref:`dir_fd ` parameter of the :func:" "`os.open` function to open a file relative to a given directory::" @@ -2822,29 +2284,7 @@ msgstr "" "次の例は :func:`os.open` 関数の :ref:`dir_fd ` 引数を使い、与えられた" "ディレクトリからの相対パスで指定されたファイルを開きます::" -#: ../../library/functions.rst:1497 -msgid "" -">>> import os\n" -">>> dir_fd = os.open('somedir', os.O_RDONLY)\n" -">>> def opener(path, flags):\n" -"... return os.open(path, flags, dir_fd=dir_fd)\n" -"...\n" -">>> with open('spamspam.txt', 'w', opener=opener) as f:\n" -"... print('This will be written to somedir/spamspam.txt', file=f)\n" -"...\n" -">>> os.close(dir_fd) # don't leak a file descriptor" -msgstr "" -">>> import os\n" -">>> dir_fd = os.open('somedir', os.O_RDONLY)\n" -">>> def opener(path, flags):\n" -"... return os.open(path, flags, dir_fd=dir_fd)\n" -"...\n" -">>> with open('spamspam.txt', 'w', opener=opener) as f:\n" -"... print('This will be written to somedir/spamspam.txt', file=f)\n" -"...\n" -">>> os.close(dir_fd) # ファイル記述子の解放漏れがないように" - -#: ../../library/functions.rst:1507 +#: ../../library/functions.rst:1219 msgid "" "The type of :term:`file object` returned by the :func:`open` function " "depends on the mode. When :func:`open` is used to open a file in a text " @@ -2872,9 +2312,9 @@ msgstr "" "バッファリングが無効なときはrawストリーム、すなわち :class:`io.RawIOBase` の" "サブクラスである :class:`io.FileIO` を返します。" -#: ../../library/functions.rst:1528 +#: ../../library/functions.rst:1240 msgid "" -"See also the file handling modules, such as :mod:`fileinput`, :mod:`io` " +"See also the file handling modules, such as, :mod:`fileinput`, :mod:`io` " "(where :func:`open` is declared), :mod:`os`, :mod:`os.path`, :mod:" "`tempfile`, and :mod:`shutil`." msgstr "" @@ -2882,15 +2322,15 @@ msgstr "" "`os` 、 :mod:`os.path` 、 :mod:`tempfile` 、 :mod:`shutil` などの、ファイル操" "作モジュールも参照してください。" -#: ../../library/functions.rst:1532 +#: ../../library/functions.rst:1244 msgid "" -"Raises an :ref:`auditing event ` ``open`` with arguments ``path``, " +"Raises an :ref:`auditing event ` ``open`` with arguments ``file``, " "``mode``, ``flags``." msgstr "" -"引数 ``path``, ``mode``, ``flags`` を指定して :ref:`監査イベント ` " +"引数 ``file``, ``mode``, ``flags`` を指定して :ref:`監査イベント ` " "``open`` を送出します。 " -#: ../../library/functions.rst:1534 +#: ../../library/functions.rst:1246 msgid "" "The ``mode`` and ``flags`` arguments may have been modified or inferred from " "the original call." @@ -2898,21 +2338,21 @@ msgstr "" "``mode`` と ``flags`` の2つの引数は呼び出し時の値から修正されたり、推量により" "設定されたりする可能性があります。" -#: ../../library/functions.rst:1539 +#: ../../library/functions.rst:1252 msgid "The *opener* parameter was added." msgstr "*opener* 引数を追加しました。" -#: ../../library/functions.rst:1540 +#: ../../library/functions.rst:1253 msgid "The ``'x'`` mode was added." msgstr "``'x'`` モードを追加しました。" -#: ../../library/functions.rst:1541 +#: ../../library/functions.rst:1254 msgid ":exc:`IOError` used to be raised, it is now an alias of :exc:`OSError`." msgstr "" "以前は :exc:`IOError` が送出されました; それは現在 :exc:`OSError` のエイリア" "スです。" -#: ../../library/functions.rst:1542 +#: ../../library/functions.rst:1255 msgid "" ":exc:`FileExistsError` is now raised if the file opened in exclusive " "creation mode (``'x'``) already exists." @@ -2920,11 +2360,15 @@ msgstr "" "既存のファイルを 排他的生成モード(``'x'``)で開いた場合、 :exc:" "`FileExistsError` を送出するようになりました。" -#: ../../library/functions.rst:1547 +#: ../../library/functions.rst:1261 msgid "The file is now non-inheritable." msgstr "ファイルが継承不可になりました。" -#: ../../library/functions.rst:1551 +#: ../../library/functions.rst:1265 +msgid "The ``'U'`` mode." +msgstr "``'U'`` モード。" + +#: ../../library/functions.rst:1270 msgid "" "If the system call is interrupted and the signal handler does not raise an " "exception, the function now retries the system call instead of raising an :" @@ -2934,16 +2378,16 @@ msgstr "" "は :exc:`InterruptedError` 例外を送出する代わりにシステムコールを再試行するよ" "うになりました (論拠については :pep:`475` を参照してください)。" -#: ../../library/functions.rst:1554 +#: ../../library/functions.rst:1273 msgid "The ``'namereplace'`` error handler was added." msgstr "``'namereplace'`` エラーハンドラが追加されました。" -#: ../../library/functions.rst:1558 +#: ../../library/functions.rst:1278 msgid "Support added to accept objects implementing :class:`os.PathLike`." msgstr "" ":class:`os.PathLike` を実装したオブジェクトを受け入れるようになりました。" -#: ../../library/functions.rst:1559 +#: ../../library/functions.rst:1279 msgid "" "On Windows, opening a console buffer may return a subclass of :class:`io." "RawIOBase` other than :class:`io.FileIO`." @@ -2951,11 +2395,7 @@ msgstr "" "Windowsでは、コンソールバッファのオープンは、:class:`io.FileIO` ではなく、:" "class:`io.RawIOBase` のサブクラスを返すでしょう。" -#: ../../library/functions.rst:1562 -msgid "The ``'U'`` mode has been removed." -msgstr "``'U'`` モードは削除されました。" - -#: ../../library/functions.rst:1567 +#: ../../library/functions.rst:1284 msgid "" "Given a string representing one Unicode character, return an integer " "representing the Unicode code point of that character. For example, " @@ -2967,7 +2407,7 @@ msgstr "" "``ord('€')`` (ユーロ記号) は ``8364`` を返します。これは :func:`chr` の逆で" "す。" -#: ../../library/functions.rst:1575 +#: ../../library/functions.rst:1292 msgid "" "Return *base* to the power *exp*; if *mod* is present, return *base* to the " "power *exp*, modulo *mod* (computed more efficiently than ``pow(base, exp) % " @@ -2979,32 +2419,22 @@ msgstr "" "二引数の形式 ``pow(base, exp)`` は、冪乗演算子を使った ``base**exp`` と等価で" "す。" -#: ../../library/functions.rst:1580 +#: ../../library/functions.rst:1297 msgid "" "The arguments must have numeric types. With mixed operand types, the " "coercion rules for binary arithmetic operators apply. For :class:`int` " "operands, the result has the same type as the operands (after coercion) " "unless the second argument is negative; in that case, all arguments are " -"converted to float and a float result is delivered. For example, ``pow(10, " -"2)`` returns ``100``, but ``pow(10, -2)`` returns ``0.01``. For a negative " -"base of type :class:`int` or :class:`float` and a non-integral exponent, a " -"complex result is delivered. For example, ``pow(-9, 0.5)`` returns a value " -"close to ``3j``. Whereas, for a negative base of type :class:`int` or :class:" -"`float` with an integral exponent, a float result is delivered. For example, " -"``pow(-9, 2.0)`` returns ``81.0``." -msgstr "" -"引数は数値型でなければなりません。型混合の場合、二項算術演算における型強制規" -"則が適用されます。 :class:`int` オペランドの場合、第2引数が負でない限り、結果" -"は (型強制後の) オペランドと同じ型になります; 第2引数が負の場合、全ての引数は" -"浮動小数点数に変換され、浮動小数点数の結果が返されます。例えば、 ``pow(10, " -"2)`` は ``100`` を返しますが、 ``pow(10, -2)`` は ``0.01`` を返します。底が :" -"class:`int` 型または :class:`float` 型で負の値であり、かつ指数が整数でない場" -"合、複素数の結果が返されます。例えば、 ``pow(-9, 0.5)`` は ``3j`` に近い値を" -"返します。一方で底が :class:`int` 型または :class:`float` の負の数であり、指" -"数が整数の場合、浮動小数点数の結果が返されます。例えば、``pow(-9, 2.0)`` は " -"``81.0`` を返します。" - -#: ../../library/functions.rst:1592 +"converted to float and a float result is delivered. For example, ``10**2`` " +"returns ``100``, but ``10**-2`` returns ``0.01``." +msgstr "" +"引数は数値型でなくてはなりません。型混合の場合、二項算術演算における型強制規" +"則が適用されます。 :class:`int` 被演算子に対しては、第二引数が負でない限り、" +"結果は (型強制後の) 被演算子と同じ型になります; 負の場合、全ての引数は浮動小" +"数点に変換され、浮動小数点の結果が返されます。例えば、 ``10**2`` は ``100`` " +"を返しますが、 ``10**-2`` は ``0.01`` を返します。" + +#: ../../library/functions.rst:1304 msgid "" "For :class:`int` operands *base* and *exp*, if *mod* is present, *mod* must " "also be of integer type and *mod* must be nonzero. If *mod* is present and " @@ -3019,23 +2449,11 @@ msgstr "" "ラ逆数 (*base* と *inv_base* の積を *mod* で割った余りが1になるような数) とし" "て、 ``pow(inv_base, -exp, mod)`` が返されます。" -#: ../../library/functions.rst:1598 +#: ../../library/functions.rst:1310 msgid "Here's an example of computing an inverse for ``38`` modulo ``97``::" -msgstr "以下は ``97`` を法とする ``38`` のモジュラ逆数の計算例です::" +msgstr "以下は``97`` を法とする ``38`` のモジュラ逆数の計算例です::" -#: ../../library/functions.rst:1600 -msgid "" -">>> pow(38, -1, mod=97)\n" -"23\n" -">>> 23 * 38 % 97 == 1\n" -"True" -msgstr "" -">>> pow(38, -1, mod=97)\n" -"23\n" -">>> 23 * 38 % 97 == 1\n" -"True" - -#: ../../library/functions.rst:1605 +#: ../../library/functions.rst:1317 msgid "" "For :class:`int` operands, the three-argument form of ``pow`` now allows the " "second argument to be negative, permitting computation of modular inverses." @@ -3044,24 +2462,24 @@ msgstr "" "ることができるようになりました。これによりモジュラ逆数の計算が可能になりま" "す。" -#: ../../library/functions.rst:1610 +#: ../../library/functions.rst:1322 msgid "" "Allow keyword arguments. Formerly, only positional arguments were supported." msgstr "" "キーワード引数を取ることができるようになりました。以前は位置引数だけがサポー" "トされていました。" -#: ../../library/functions.rst:1617 +#: ../../library/functions.rst:1329 msgid "" "Print *objects* to the text stream *file*, separated by *sep* and followed " -"by *end*. *sep*, *end*, *file*, and *flush*, if present, must be given as " +"by *end*. *sep*, *end*, *file* and *flush*, if present, must be given as " "keyword arguments." msgstr "" "*objects* を *sep* で区切りながらテキストストリーム *file* に表示し、最後に " "*end* を表示します。*sep* 、 *end* 、 *file* 、 *flush* を与える場合、キー" "ワード引数として与える必要があります。" -#: ../../library/functions.rst:1621 +#: ../../library/functions.rst:1333 msgid "" "All non-keyword arguments are converted to strings like :func:`str` does and " "written to the stream, separated by *sep* and followed by *end*. Both *sep* " @@ -3075,7 +2493,7 @@ msgstr "" "ると、デフォルトの値が使われます。 *objects* が与えられなければ、 :func:" "`print` は *end* だけを書き出します。" -#: ../../library/functions.rst:1627 +#: ../../library/functions.rst:1339 msgid "" "The *file* argument must be an object with a ``write(string)`` method; if it " "is not present or ``None``, :data:`sys.stdout` will be used. Since printed " @@ -3088,23 +2506,23 @@ msgstr "" "イナリモードファイルオブジェクトには使用できません。代わりに ``file." "write(...)`` を使ってください。" -#: ../../library/functions.rst:1632 +#: ../../library/functions.rst:1344 msgid "" -"Output buffering is usually determined by *file*. However, if *flush* is " -"true, the stream is forcibly flushed." +"Whether output is buffered is usually determined by *file*, but if the " +"*flush* keyword argument is true, the stream is forcibly flushed." msgstr "" "出力がバッファ化されるかどうかは通常 *file* で決まりますが、*flush* キーワー" "ド引数が真ならストリームは強制的にフラッシュされます。" -#: ../../library/functions.rst:1636 +#: ../../library/functions.rst:1347 msgid "Added the *flush* keyword argument." msgstr "キーワード引数 *flush* が追加されました。" -#: ../../library/functions.rst:1642 +#: ../../library/functions.rst:1353 msgid "Return a property attribute." msgstr "property 属性を返します。" -#: ../../library/functions.rst:1644 +#: ../../library/functions.rst:1355 msgid "" "*fget* is a function for getting an attribute value. *fset* is a function " "for setting an attribute value. *fdel* is a function for deleting an " @@ -3114,51 +2532,19 @@ msgstr "" "です。*fdel* は属性値を削除するための関数です。*doc* は属性の docstring を作" "成します。" -#: ../../library/functions.rst:1648 +#: ../../library/functions.rst:1359 msgid "A typical use is to define a managed attribute ``x``::" msgstr "典型的な使用法は、属性 ``x`` の処理の定義です::" -#: ../../library/functions.rst:1650 -msgid "" -"class C:\n" -" def __init__(self):\n" -" self._x = None\n" -"\n" -" def getx(self):\n" -" return self._x\n" -"\n" -" def setx(self, value):\n" -" self._x = value\n" -"\n" -" def delx(self):\n" -" del self._x\n" -"\n" -" x = property(getx, setx, delx, \"I'm the 'x' property.\")" -msgstr "" -"class C:\n" -" def __init__(self):\n" -" self._x = None\n" -"\n" -" def getx(self):\n" -" return self._x\n" -"\n" -" def setx(self, value):\n" -" self._x = value\n" -"\n" -" def delx(self):\n" -" del self._x\n" -"\n" -" x = property(getx, setx, delx, \"I'm the 'x' property.\")" - -#: ../../library/functions.rst:1665 +#: ../../library/functions.rst:1376 msgid "" "If *c* is an instance of *C*, ``c.x`` will invoke the getter, ``c.x = " -"value`` will invoke the setter, and ``del c.x`` the deleter." +"value`` will invoke the setter and ``del c.x`` the deleter." msgstr "" "*c* が *C* のインスタンスならば、``c.x`` は getter を呼び出し、``c.x = " "value`` は setter を、``del c.x`` は deleter を呼び出します。" -#: ../../library/functions.rst:1668 +#: ../../library/functions.rst:1379 msgid "" "If given, *doc* will be the docstring of the property attribute. Otherwise, " "the property will copy *fget*'s docstring (if it exists). This makes it " @@ -3171,85 +2557,29 @@ msgstr "" "そのため :func:`property` を :term:`デコレータ ` として使えば、読" "み出し専用 property を作るのは容易です::" -#: ../../library/functions.rst:1672 -msgid "" -"class Parrot:\n" -" def __init__(self):\n" -" self._voltage = 100000\n" -"\n" -" @property\n" -" def voltage(self):\n" -" \"\"\"Get the current voltage.\"\"\"\n" -" return self._voltage" -msgstr "" -"class Parrot:\n" -" def __init__(self):\n" -" self._voltage = 100000\n" -"\n" -" @property\n" -" def voltage(self):\n" -" \"\"\"Get the current voltage.\"\"\"\n" -" return self._voltage" - -#: ../../library/functions.rst:1681 -msgid "" -"The ``@property`` decorator turns the :meth:`!voltage` method into a " +#: ../../library/functions.rst:1392 +msgid "" +"The ``@property`` decorator turns the :meth:`voltage` method into a " "\"getter\" for a read-only attribute with the same name, and it sets the " "docstring for *voltage* to \"Get the current voltage.\"" msgstr "" -"``@property`` デコレータは :meth:`!voltage` を同じ名前のまま 読み出し専用属性" +"``@property`` デコレータは :meth:`voltage` を同じ名前のまま 読み出し専用属性" "の \"getter\" にし、*voltage* のドキュメント文字列を \"Get the current " "voltage.\" に設定します。" -#: ../../library/functions.rst:1689 -msgid "" -"A property object has ``getter``, ``setter``, and ``deleter`` methods usable " -"as decorators that create a copy of the property with the corresponding " -"accessor function set to the decorated function. This is best explained " -"with an example:" -msgstr "" -"property オブジェクトは ``getter``, ``setter``, ``deleter`` メソッドを持って" -"います。これらのメソッドをデコレータとして使うと、対応するアクセサ関数がデコ" -"レートされた関数に設定された、 property のコピーを作成できます。 これを一番" -"分かりやすく説明する例があります:" - -#: ../../library/functions.rst:1694 -msgid "" -"class C:\n" -" def __init__(self):\n" -" self._x = None\n" -"\n" -" @property\n" -" def x(self):\n" -" \"\"\"I'm the 'x' property.\"\"\"\n" -" return self._x\n" -"\n" -" @x.setter\n" -" def x(self, value):\n" -" self._x = value\n" -"\n" -" @x.deleter\n" -" def x(self):\n" -" del self._x" -msgstr "" -"class C:\n" -" def __init__(self):\n" -" self._x = None\n" -"\n" -" @property\n" -" def x(self):\n" -" \"\"\"I'm the 'x' property.\"\"\"\n" -" return self._x\n" -"\n" -" @x.setter\n" -" def x(self, value):\n" -" self._x = value\n" -"\n" -" @x.deleter\n" -" def x(self):\n" -" del self._x" - -#: ../../library/functions.rst:1713 +#: ../../library/functions.rst:1396 +msgid "" +"A property object has :attr:`~property.getter`, :attr:`~property.setter`, " +"and :attr:`~property.deleter` methods usable as decorators that create a " +"copy of the property with the corresponding accessor function set to the " +"decorated function. This is best explained with an example::" +msgstr "" +"property オブジェクトは :attr:`~property.getter`, :attr:`~property.setter`, :" +"attr:`~property.deleter` メソッドを持っています。これらのメソッドをデコレータ" +"として使うと、対応するアクセサ関数がデコレートされた関数に設定された、 " +"property のコピーを作成できます。これを一番分かりやすく説明する例があります::" + +#: ../../library/functions.rst:1418 msgid "" "This code is exactly equivalent to the first example. Be sure to give the " "additional functions the same name as the original property (``x`` in this " @@ -3258,7 +2588,7 @@ msgstr "" "このコードは最初の例と等価です。追加の関数には、必ず元の property と同じ名前 " "(この例では ``x``) を与えて下さい。" -#: ../../library/functions.rst:1717 +#: ../../library/functions.rst:1422 msgid "" "The returned property object also has the attributes ``fget``, ``fset``, and " "``fdel`` corresponding to the constructor arguments." @@ -3266,17 +2596,11 @@ msgstr "" "返される property オブジェクトも、コンストラクタの引数に対応した ``fget``, " "``fset``, および ``fdel`` 属性を持ちます。" -#: ../../library/functions.rst:1720 +#: ../../library/functions.rst:1425 msgid "The docstrings of property objects are now writeable." msgstr "属性オブジェクトのドックストリングが書き込み可能になりました。" -#: ../../library/functions.rst:1725 -msgid "" -"Attribute holding the name of the property. The name of the property can be " -"changed at runtime." -msgstr "プロパティ名を保持する属性。プロパティ名は実行時に変更できます。" - -#: ../../library/functions.rst:1736 +#: ../../library/functions.rst:1434 msgid "" "Rather than being a function, :class:`range` is actually an immutable " "sequence type, as documented in :ref:`typesseq-range` and :ref:`typesseq`." @@ -3284,72 +2608,45 @@ msgstr "" ":class:`range` は、実際には関数ではなくイミュータブルなシーケンス型で、 :ref:" "`typesseq-range` と :ref:`typesseq` にドキュメント化されています。" -#: ../../library/functions.rst:1742 +#: ../../library/functions.rst:1440 msgid "" "Return a string containing a printable representation of an object. For " "many types, this function makes an attempt to return a string that would " -"yield an object with the same value when passed to :func:`eval`; otherwise, " +"yield an object with the same value when passed to :func:`eval`, otherwise " "the representation is a string enclosed in angle brackets that contains the " "name of the type of the object together with additional information often " "including the name and address of the object. A class can control what this " -"function returns for its instances by defining a :meth:`~object.__repr__` " -"method. If :func:`sys.displayhook` is not accessible, this function will " -"raise :exc:`RuntimeError`." +"function returns for its instances by defining a :meth:`__repr__` method." msgstr "" "オブジェクトの印字可能な表現を含む文字列を返します。この関数は多くの型につい" "て、 :func:`eval` に渡されたときと同じ値を持つようなオブジェクトを表す文字列" "を生成しようとします。そうでない場合は、山括弧に囲まれたオブジェクトの型の名" "前と追加の情報 (大抵の場合はオブジェクトの名前とアドレスを含みます) を返しま" -"す。クラスは、 :meth:`~object.__repr__` メソッドを定義することで、この関数に" -"よりそのクラスのインスタンスが返すものを制御することができます。:func:`sys." -"displayhook` にアクセスできない場合、この関数は :exc:`RuntimeError` を送出し" -"ます。" - -#: ../../library/functions.rst:1753 -msgid "This class has a custom representation that can be evaluated::" -msgstr "このクラスは、eval 評価可能な独自の representation を持ちます::" - -#: ../../library/functions.rst:1755 -msgid "" -"class Person:\n" -" def __init__(self, name, age):\n" -" self.name = name\n" -" self.age = age\n" -"\n" -" def __repr__(self):\n" -" return f\"Person('{self.name}', {self.age})\"" -msgstr "" -"class Person:\n" -" def __init__(self, name, age):\n" -" self.name = name\n" -" self.age = age\n" -"\n" -" def __repr__(self):\n" -" return f\"Person('{self.name}', {self.age})\"" +"す。クラスは、 :meth:`__repr__` メソッドを定義することで、この関数によりその" +"クラスのインスタンスが返すものを制御することができます。" -#: ../../library/functions.rst:1766 +#: ../../library/functions.rst:1451 msgid "" "Return a reverse :term:`iterator`. *seq* must be an object which has a :" -"meth:`~object.__reversed__` method or supports the sequence protocol (the :" -"meth:`~object.__len__` method and the :meth:`~object.__getitem__` method " -"with integer arguments starting at ``0``)." +"meth:`__reversed__` method or supports the sequence protocol (the :meth:" +"`__len__` method and the :meth:`__getitem__` method with integer arguments " +"starting at ``0``)." msgstr "" "要素を逆順に取り出すイテレータ (reverse :term:`iterator`) を返します。 *seq* " -"は :meth:`~object.__reversed__` メソッドを持つか、シーケンス型プロトコル ( :" -"meth:`~object.__len__` メソッド、および、 ``0`` 以上の整数を引数とする :meth:" -"`~object.__getitem__` メソッド) をサポートするオブジェクトでなければなりませ" -"ん。" +"は :meth:`__reversed__` メソッドを持つか、シーケンス型プロトコル (:meth:" +"`__len__` メソッド、および、 ``0`` 以上の整数を引数とする :meth:" +"`__getitem__` メソッド) をサポートするオブジェクトでなければなりません。" -#: ../../library/functions.rst:1774 +#: ../../library/functions.rst:1459 msgid "" "Return *number* rounded to *ndigits* precision after the decimal point. If " "*ndigits* is omitted or is ``None``, it returns the nearest integer to its " "input." msgstr "" -"*number* を小数点以下 *ndigits* 桁の精度で丸めた値を返します。*ndigits* が省" -"略されたり、``None`` だった場合、入力値に最も近い整数を返します。" +"*number* の小数部を *ndigists* 桁に丸めた値を返します。*ndigits* が省略された" +"り、``None`` だった場合、入力値に最も近い整数を返します。" -#: ../../library/functions.rst:1778 +#: ../../library/functions.rst:1463 msgid "" "For the built-in types supporting :func:`round`, values are rounded to the " "closest multiple of 10 to the power minus *ndigits*; if two multiples are " @@ -3357,7 +2654,7 @@ msgid "" "both ``round(0.5)`` and ``round(-0.5)`` are ``0``, and ``round(1.5)`` is " "``2``). Any integer value is valid for *ndigits* (positive, zero, or " "negative). The return value is an integer if *ndigits* is omitted or " -"``None``. Otherwise, the return value has the same type as *number*." +"``None``. Otherwise the return value has the same type as *number*." msgstr "" ":func:`round` をサポートする組み込み型では、値は 10 のマイナス *ndigits* 乗の" "倍数の中で最も近いものに丸められます; 二つの倍数が同じだけ近いなら、偶数を選" @@ -3367,7 +2664,7 @@ msgstr "" "返り値は *ndigits* が指定されていないか ``None`` の場合は整数、そうでなければ" "返り値は *number* と同じ型です。" -#: ../../library/functions.rst:1787 +#: ../../library/functions.rst:1472 msgid "" "For a general Python object ``number``, ``round`` delegates to ``number." "__round__``." @@ -3375,7 +2672,7 @@ msgstr "" "一般的な Python オブジェクト ``number`` に対して、``round`` は処理を `number." "__round__` に移譲します。" -#: ../../library/functions.rst:1792 +#: ../../library/functions.rst:1477 msgid "" "The behavior of :func:`round` for floats can be surprising: for example, " "``round(2.675, 2)`` gives ``2.67`` instead of the expected ``2.68``. This is " @@ -3388,7 +2685,7 @@ msgstr "" "これはバグではありません: これはほとんどの小数が浮動小数点数で正確に表せない" "ことの結果です。詳しくは :ref:`tut-fp-issues` を参照してください。" -#: ../../library/functions.rst:1804 +#: ../../library/functions.rst:1488 msgid "" "Return a new :class:`set` object, optionally with elements taken from " "*iterable*. ``set`` is a built-in class. See :class:`set` and :ref:`types-" @@ -3398,7 +2695,7 @@ msgstr "" "ます。 ``set`` は組み込みクラスです。このクラスについて詳しい情報は :class:" "`set` や :ref:`types-set` を参照してください。" -#: ../../library/functions.rst:1808 +#: ../../library/functions.rst:1492 msgid "" "For other containers see the built-in :class:`frozenset`, :class:`list`, :" "class:`tuple`, and :class:`dict` classes, as well as the :mod:`collections` " @@ -3408,34 +2705,20 @@ msgstr "" "`frozenset` 、 :class:`list` 、 :class:`tuple` 、 :class:`dict` クラスを参照" "してください。" -#: ../../library/functions.rst:1815 +#: ../../library/functions.rst:1499 msgid "" "This is the counterpart of :func:`getattr`. The arguments are an object, a " -"string, and an arbitrary value. The string may name an existing attribute " -"or a new attribute. The function assigns the value to the attribute, " -"provided the object allows it. For example, ``setattr(x, 'foobar', 123)`` " -"is equivalent to ``x.foobar = 123``." +"string and an arbitrary value. The string may name an existing attribute or " +"a new attribute. The function assigns the value to the attribute, provided " +"the object allows it. For example, ``setattr(x, 'foobar', 123)`` is " +"equivalent to ``x.foobar = 123``." msgstr "" ":func:`getattr` の相方です。引数はオブジェクト、文字列、それから任意の値で" "す。文字列は既存の属性または新たな属性の名前にできます。この関数は指定したオ" "ブジェクトが許せば、値を属性に関連付けます。例えば、 ``setattr(x, 'foobar', " "123)`` は ``x.foobar = 123`` と等価です。" -#: ../../library/functions.rst:1821 -msgid "" -"*name* need not be a Python identifier as defined in :ref:`identifiers` " -"unless the object chooses to enforce that, for example in a custom :meth:" -"`~object.__getattribute__` or via :attr:`~object.__slots__`. An attribute " -"whose name is not an identifier will not be accessible using the dot " -"notation, but is accessible through :func:`getattr` etc.." -msgstr "" -":meth:`~object.__getattribute__` のカスタマイズや :attr:`~object.__slots__` " -"を通じてオブジェクトが強制していない限り、 *name* は :ref:`identifiers` で定" -"義されている Python 識別子である必要はありません。属性名が識別子でない場合、" -"ドットを使った属性へのアクセスはできませんが、 :func:`getattr` などを通じてア" -"クセス可能です。" - -#: ../../library/functions.rst:1829 +#: ../../library/functions.rst:1507 msgid "" "Since :ref:`private name mangling ` happens at " "compilation time, one must manually mangle a private attribute's (attributes " @@ -3446,59 +2729,42 @@ msgstr "" "名前を持つ属性) の値を :func:`setattr` でセットするためには、属性名を手動でマ" "ングリングする必要があります。" -#: ../../library/functions.rst:1838 +#: ../../library/functions.rst:1518 msgid "" "Return a :term:`slice` object representing the set of indices specified by " "``range(start, stop, step)``. The *start* and *step* arguments default to " -"``None``." -msgstr "" -"``range(start, stop, step)`` で指定されたインデックスのセットを表す :term:" -"`slice` オブジェクトを返します。 引数 *start* と *step* のデフォルトは " -"``None`` です。" - -#: ../../library/functions.rst:1846 -msgid "" -"Slice objects have read-only data attributes :attr:`!start`, :attr:`!stop`, " -"and :attr:`!step` which merely return the argument values (or their " -"default). They have no other explicit functionality; however, they are used " -"by NumPy and other third-party packages." -msgstr "" -"スライスオブジェクトには読み出し専用のデータ属性 :attr:`!start` :attr:`!" -"stop` :attr:`!step` があり、これらは単に引数の値(またはそのデフォルト値)を" -"返します。 スライスオブジェクトは特に他の機能を持ちませんが、 NumPy や他の" -"サードパーティパッケージで使われています。" - -#: ../../library/functions.rst:1851 -msgid "" -"Slice objects are also generated when extended indexing syntax is used. For " -"example: ``a[start:stop:step]`` or ``a[start:stop, i]``. See :func:" -"`itertools.islice` for an alternate version that returns an :term:`iterator`." -msgstr "" -"スライスオブジェクトは、拡張インデックス構文が使われた場合にも作られます。 " -"例: ``a[start:stop:step]`` や ``a[start:stop, i]`` 。 :term:`iterator` を返" -"す代替バージョンについては :func:`itertools.islice` を参照して下さい。" - -#: ../../library/functions.rst:1856 -msgid "" -"Slice objects are now :term:`hashable` (provided :attr:`~slice.start`, :attr:" -"`~slice.stop`, and :attr:`~slice.step` are hashable)." -msgstr "" -"スライスオブジェクトが :term:`hashable` (ハッシュ可能) となりました (ただし、" -"属性 :attr:`~slice.start` 、 :attr:`~slice.stop` 、 :attr:`~slice.step` がす" -"べてハッシュ可能である場合に限ります)。" - -#: ../../library/functions.rst:1862 +"``None``. Slice objects have read-only data attributes :attr:`~slice." +"start`, :attr:`~slice.stop` and :attr:`~slice.step` which merely return the " +"argument values (or their default). They have no other explicit " +"functionality; however they are used by Numerical Python and other third " +"party extensions. Slice objects are also generated when extended indexing " +"syntax is used. For example: ``a[start:stop:step]`` or ``a[start:stop, " +"i]``. See :func:`itertools.islice` for an alternate version that returns an " +"iterator." +msgstr "" +"``range(start, stop, step)`` で指定されるインデクスの集合を表す、 :term:`スラ" +"イス ` オブジェクトを返します。引数 *start* および *step* はデフォルト" +"では ``None`` です。スライスオブジェクトは読み出し専用の属性 :attr:`~slice." +"start`、:attr:`~slice.stop` および :attr:`~slice.step` を持ち、これらは単に引" +"数で使われた 値 (またはデフォルト値) を返します。これらの値には、その他のはっ" +"きりと した機能はありません。しかしながら、これらの値は Numerical Python およ" +"び、その他のサードパーティによる拡張で利用されています。スライスオブジェクト" +"は拡張されたインデクス指定構文が使われる際にも生成されます。例えば ``a[start:" +"stop:step]`` や ``a[start:stop, i]`` です。この関数の代替となるイテレータを返" +"す関数、:func:`itertools.islice` も参照してください。" + +#: ../../library/functions.rst:1531 msgid "Return a new sorted list from the items in *iterable*." msgstr "*iterable* の要素を並べ替えた新たなリストを返します。" -#: ../../library/functions.rst:1864 +#: ../../library/functions.rst:1533 msgid "" "Has two optional arguments which must be specified as keyword arguments." msgstr "" "2 つのオプション引数があり、これらはキーワード引数として指定されなければなり" "ません。" -#: ../../library/functions.rst:1866 +#: ../../library/functions.rst:1535 msgid "" "*key* specifies a function of one argument that is used to extract a " "comparison key from each element in *iterable* (for example, ``key=str." @@ -3508,7 +2774,7 @@ msgstr "" "開するのに使われます (例えば、 ``key=str.lower`` のように指定します)。\n" "デフォルト値は ``None`` です (要素を直接比較します)。" -#: ../../library/functions.rst:1870 +#: ../../library/functions.rst:1539 msgid "" "*reverse* is a boolean value. If set to ``True``, then the list elements " "are sorted as if each comparison were reversed." @@ -3516,7 +2782,7 @@ msgstr "" "*reverse* は真偽値です。 ``True`` がセットされた場合、リストの要素は個々の比" "較が反転したものとして並び替えられます。" -#: ../../library/functions.rst:1873 +#: ../../library/functions.rst:1542 msgid "" "Use :func:`functools.cmp_to_key` to convert an old-style *cmp* function to a " "*key* function." @@ -3524,7 +2790,7 @@ msgstr "" "旧式の *cmp* 関数を *key* 関数に変換するには :func:`functools.cmp_to_key` を" "使用してください。" -#: ../../library/functions.rst:1876 +#: ../../library/functions.rst:1545 msgid "" "The built-in :func:`sorted` function is guaranteed to be stable. A sort is " "stable if it guarantees not to change the relative order of elements that " @@ -3536,37 +2802,17 @@ msgstr "" "でソートを行なうのに役立ちます(例えば部署でソートしてから給与の等級でソート" "する場合)。" -#: ../../library/functions.rst:1881 -msgid "" -"The sort algorithm uses only ``<`` comparisons between items. While " -"defining an :meth:`~object.__lt__` method will suffice for sorting, :PEP:`8` " -"recommends that all six :ref:`rich comparisons ` be " -"implemented. This will help avoid bugs when using the same data with other " -"ordering tools such as :func:`max` that rely on a different underlying " -"method. Implementing all six comparisons also helps avoid confusion for " -"mixed type comparisons which can call reflected the :meth:`~object.__gt__` " -"method." -msgstr "" -"ソートアルゴリズムは、要素間の比較に ``<`` 演算子だけを使います。したがって" -"ソートのためには :meth:`~object.__lt__` メソッドを定義すれば十分なはずです" -"が、 :PEP:`8` は6つの :ref:`比較演算子 ` を全て実装することを推" -"奨しています。これにより、異なるメソッドを必要とする :func:`max` のような他の" -"ソートツールを、同じデータに対して適用することによって起こりうるバグを避ける" -"助けになります。6つの比較演算子を全て実装することは、リフレクションによって :" -"meth:`~object.__gt__` メソッドを呼び出す可能性のある型混合の比較での混乱を避" -"けることにも役立ちます。 " - -#: ../../library/functions.rst:1890 +#: ../../library/functions.rst:1550 msgid "" "For sorting examples and a brief sorting tutorial, see :ref:`sortinghowto`." msgstr "" "ソートの例と簡単なチュートリアルは :ref:`sortinghowto` を参照して下さい。" -#: ../../library/functions.rst:1894 +#: ../../library/functions.rst:1554 msgid "Transform a method into a static method." msgstr "メソッドを静的メソッドへ変換します。" -#: ../../library/functions.rst:1896 +#: ../../library/functions.rst:1556 msgid "" "A static method does not receive an implicit first argument. To declare a " "static method, use this idiom::" @@ -3574,17 +2820,7 @@ msgstr "" "静的メソッドは暗黙の第一引数を受け取りません。静的メソッドを宣言するには、こ" "のイディオムを使ってください::" -#: ../../library/functions.rst:1899 -msgid "" -"class C:\n" -" @staticmethod\n" -" def f(arg1, arg2, argN): ..." -msgstr "" -"class C:\n" -" @staticmethod\n" -" def f(arg1, arg2, argN): ..." - -#: ../../library/functions.rst:1903 +#: ../../library/functions.rst:1563 msgid "" "The ``@staticmethod`` form is a function :term:`decorator` -- see :ref:" "`function` for details." @@ -3592,21 +2828,17 @@ msgstr "" "``@staticmethod`` 形式は関数 :term:`デコレータ ` です。詳しくは :" "ref:`function` を参照してください。" -#: ../../library/functions.rst:1906 +#: ../../library/functions.rst:1566 msgid "" "A static method can be called either on the class (such as ``C.f()``) or on " -"an instance (such as ``C().f()``). Moreover, the static method :term:" -"`descriptor` is also callable, so it can be used in the class definition " -"(such as ``f()``)." +"an instance (such as ``C().f()``)." msgstr "" -"静的メソッドは (``C.f()`` のように) クラスに対して呼び出すことも、 (``C()." -"f()`` のように) インスタンスに対して呼び出すこともできます。さらに、静的メ" -"ソッド :term:`descriptor` は呼び出し可能でもあるため、(``f()`` のように) クラ" -"ス定義の中でも使用できます。" +"静的メソッドは (``C.f()`` のよう) クラスから呼び出したり、 (``C().f()`` のよ" +"うに) インスタンスから呼び出したりできます。" -#: ../../library/functions.rst:1911 +#: ../../library/functions.rst:1569 msgid "" -"Static methods in Python are similar to those found in Java or C++. Also, " +"Static methods in Python are similar to those found in Java or C++. Also " "see :func:`classmethod` for a variant that is useful for creating alternate " "class constructors." msgstr "" @@ -3614,7 +2846,7 @@ msgstr "" "す。クラスコンストラクタの代替を生成するのに役立つ変種、 :func:`classmethod` " "も参照してください。" -#: ../../library/functions.rst:1915 +#: ../../library/functions.rst:1573 msgid "" "Like all decorators, it is also possible to call ``staticmethod`` as a " "regular function and do something with its result. This is needed in some " @@ -3628,40 +2860,18 @@ msgstr "" "ドに自動変換されるのを避けたいケースで必要になります。\n" "そのようなケースでは、このイディオムが使えます::" -#: ../../library/functions.rst:1921 -msgid "" -"def regular_function():\n" -" ...\n" -"\n" -"class C:\n" -" method = staticmethod(regular_function)" -msgstr "" -"def regular_function():\n" -" ...\n" -"\n" -"class C:\n" -" method = staticmethod(regular_function)" - -#: ../../library/functions.rst:1927 +#: ../../library/functions.rst:1582 msgid "For more information on static methods, see :ref:`types`." msgstr "静的メソッドについて詳しい情報は :ref:`types` を参照してください。" -#: ../../library/functions.rst:1929 -msgid "" -"Static methods now inherit the method attributes (:attr:`~function." -"__module__`, :attr:`~function.__name__`, :attr:`~function.__qualname__`, :" -"attr:`~function.__doc__` and :attr:`~function.__annotations__`), have a new " -"``__wrapped__`` attribute, and are now callable as regular functions." -msgstr "" - -#: ../../library/functions.rst:1945 +#: ../../library/functions.rst:1593 msgid "" "Return a :class:`str` version of *object*. See :func:`str` for details." msgstr "" "*object* の :class:`str` 版を返します。詳細は :func:`str` を参照してくださ" "い。" -#: ../../library/functions.rst:1947 +#: ../../library/functions.rst:1595 msgid "" "``str`` is the built-in string :term:`class`. For general information about " "strings, see :ref:`textseq`." @@ -3669,7 +2879,7 @@ msgstr "" "``str`` は組み込みの文字列 :term:`クラス` です。文字列に関する一般的な" "情報は、:ref:`textseq` を参照してください。" -#: ../../library/functions.rst:1953 +#: ../../library/functions.rst:1601 msgid "" "Sums *start* and the items of an *iterable* from left to right and returns " "the total. The *iterable*'s items are normally numbers, and the start value " @@ -3678,11 +2888,11 @@ msgstr "" "*start* と *iterable* の要素を左から右へ合計し、総和を返します。 *iterable* " "の要素は通常は数値で、start の値は文字列であってはなりません。" -#: ../../library/functions.rst:1957 +#: ../../library/functions.rst:1605 msgid "" "For some use cases, there are good alternatives to :func:`sum`. The " "preferred, fast way to concatenate a sequence of strings is by calling ``''." -"join(sequence)``. To add floating-point values with extended precision, " +"join(sequence)``. To add floating point values with extended precision, " "see :func:`math.fsum`\\. To concatenate a series of iterables, consider " "using :func:`itertools.chain`." msgstr "" @@ -3692,27 +2902,13 @@ msgstr "" "てください。一連のイテラブルを連結するには、 :func:`itertools.chain` の使用を" "考えてください。" -#: ../../library/functions.rst:1963 +#: ../../library/functions.rst:1611 msgid "The *start* parameter can be specified as a keyword argument." msgstr "" "*start* パラメータをキーワード引数として指定することができるようになりまし" "た。" -#: ../../library/functions.rst:1966 -msgid "" -"Summation of floats switched to an algorithm that gives higher accuracy and " -"better commutativity on most builds." -msgstr "" -"浮動小数点数の総和を計算するとき、ほとんどの環境でより高精度な結果とより良い" -"互換性が得られるアルゴリズムを使用するようになりました。" - -#: ../../library/functions.rst:1969 -msgid "" -"Added specialization for summation of complexes, using same algorithm as for " -"summation of floats." -msgstr "" - -#: ../../library/functions.rst:1977 +#: ../../library/functions.rst:1616 msgid "" "Return a proxy object that delegates method calls to a parent or sibling " "class of *type*. This is useful for accessing inherited methods that have " @@ -3722,30 +2918,31 @@ msgstr "" "トを返します。これはクラスの中でオーバーライドされた継承メソッドにアクセスす" "るのに便利です。" -#: ../../library/functions.rst:1981 +#: ../../library/functions.rst:1620 msgid "" -"The *object_or_type* determines the :term:`method resolution order` to be " +"The *object-or-type* determines the :term:`method resolution order` to be " "searched. The search starts from the class right after the *type*." msgstr "" -"*object_or_type* はメソッドの検索のための :term:`method resolution order` (メ" -"ソッド解決順序) を決定します。検索は *type* 直後のクラスから開始します。" -#: ../../library/functions.rst:1985 +#: ../../library/functions.rst:1624 msgid "" -"For example, if :attr:`~type.__mro__` of *object_or_type* is ``D -> B -> C -" +"For example, if :attr:`~class.__mro__` of *object-or-type* is ``D -> B -> C -" "> A -> object`` and the value of *type* is ``B``, then :func:`super` " "searches ``C -> A -> object``." msgstr "" -#: ../../library/functions.rst:1989 +#: ../../library/functions.rst:1628 msgid "" -"The :attr:`~type.__mro__` attribute of the class corresponding to " -"*object_or_type* lists the method resolution search order used by both :func:" -"`getattr` and :func:`super`. The attribute is dynamic and can change " -"whenever the inheritance hierarchy is updated." +"The :attr:`~class.__mro__` attribute of the *object-or-type* lists the " +"method resolution search order used by both :func:`getattr` and :func:" +"`super`. The attribute is dynamic and can change whenever the inheritance " +"hierarchy is updated." msgstr "" +"*object-or-type* の :attr:`~class.__mro__` 属性は、 :func:`getattr` と :func:" +"`super` の 両方で使われる、メソッド解決の探索順序を列記します。 この属性は動" +"的で、継承の階層構造が更新されれば、随時変化します。" -#: ../../library/functions.rst:1994 +#: ../../library/functions.rst:1633 msgid "" "If the second argument is omitted, the super object returned is unbound. If " "the second argument is an object, ``isinstance(obj, type)`` must be true. " @@ -3757,22 +2954,7 @@ msgstr "" "ん。第 2 引数が型であれば、 ``issubclass(type2, type)`` は真でなければなりま" "せん (これはクラスメソッドに役に立つでしょう)。" -#: ../../library/functions.rst:1999 -msgid "" -"When called directly within an ordinary method of a class, both arguments " -"may be omitted (\"zero-argument :func:`!super`\"). In this case, *type* will " -"be the enclosing class, and *obj* will be the first argument of the " -"immediately enclosing function (typically ``self``). (This means that zero-" -"argument :func:`!super` will not work as expected within nested functions, " -"including generator expressions, which implicitly create nested functions.)" -msgstr "" -"クラスの通常のメソッド中で直接呼び出される場合、どちらの引数も省けます (「ゼ" -"ロ引数 :func:`!super` 」) 。この場合、 *type* はその囲んでいるクラスとなり、 " -"*obj* は直接囲んでいる関数の第一引数 (通常は ``self`` ) となります。 (つま" -"り、ゼロ引数 :func:`!super` は、ネストされた関数では期待どおりに動作しませ" -"ん。これには 暗にネストされた関数を作るジェネレータ式も含まれます)" - -#: ../../library/functions.rst:2006 +#: ../../library/functions.rst:1638 msgid "" "There are two typical use cases for *super*. In a class hierarchy with " "single inheritance, *super* can be used to refer to parent classes without " @@ -3784,7 +2966,7 @@ msgstr "" "メンテナンスしやすくなります。この用途は他のプログラミング言語で見られる " "*super* の用途によく似ています。" -#: ../../library/functions.rst:2011 +#: ../../library/functions.rst:1643 msgid "" "The second use case is to support cooperative multiple inheritance in a " "dynamic execution environment. This use case is unique to Python and is not " @@ -3805,24 +2987,12 @@ msgstr "" "決定されること、呼び出し順序はクラス階層構造の変化に順応すること、そして呼び" "出し順序が実行時まで未知の兄弟クラスが含まれる場合があることです)。" -#: ../../library/functions.rst:2021 +#: ../../library/functions.rst:1653 msgid "For both use cases, a typical superclass call looks like this::" msgstr "" "両方の用途において、典型的なスーパークラスの呼び出しは次のようになります::" -#: ../../library/functions.rst:2023 -msgid "" -"class C(B):\n" -" def method(self, arg):\n" -" super().method(arg) # This does the same thing as:\n" -" # super(C, self).method(arg)" -msgstr "" -"class C(B):\n" -" def method(self, arg):\n" -" super().method(arg) # これは次と同じことを行います:\n" -" # super(C, self).method(arg)" - -#: ../../library/functions.rst:2028 +#: ../../library/functions.rst:1660 msgid "" "In addition to method lookups, :func:`super` also works for attribute " "lookups. One possible use case for this is calling :term:`descriptors " @@ -3832,23 +3002,23 @@ msgstr "" "同様に動作します。考えうる用途のひとつは親クラスや兄弟クラスの :term:" "`descriptors ` (デスクリプタ) を呼び出すことです。" -#: ../../library/functions.rst:2032 +#: ../../library/functions.rst:1664 msgid "" "Note that :func:`super` is implemented as part of the binding process for " "explicit dotted attribute lookups such as ``super().__getitem__(name)``. It " -"does so by implementing its own :meth:`~object.__getattribute__` method for " +"does so by implementing its own :meth:`__getattribute__` method for " "searching classes in a predictable order that supports cooperative multiple " "inheritance. Accordingly, :func:`super` is undefined for implicit lookups " "using statements or operators such as ``super()[name]``." msgstr "" "なお、:func:`super` は ``super().__getitem__(name)`` のような明示的なドット表" -"記属性探索の束縛処理の一部として実装されています。これは、 :meth:`~object." -"__getattribute__` メソッドを予測可能な順序でクラスを検索するように実装し、協" +"記属性探索の束縛処理の一部として実装されています。これは、 :meth:" +"`__getattribute__` メソッドを予測可能な順序でクラスを検索するように実装し、協" "調的な多重継承をサポートすることで実現されています。従って、 :func:`super` は" "文や ``super()[name]`` のような演算子を使った暗黙の探索向けには定義されていま" "せん。" -#: ../../library/functions.rst:2040 +#: ../../library/functions.rst:1671 msgid "" "Also note that, aside from the zero argument form, :func:`super` is not " "limited to use inside methods. The two argument form specifies the " @@ -3863,7 +3033,7 @@ msgstr "" "クラスを取り出すのに必要な詳細を、通常の方法で現在のインスタンスにアクセスす" "るようにコンパイラが埋めるのではたらきます。" -#: ../../library/functions.rst:2047 +#: ../../library/functions.rst:1678 msgid "" "For practical suggestions on how to design cooperative classes using :func:" "`super`, see `guide to using super() `_ を参照してください。" -#: ../../library/functions.rst:2051 -msgid "" -":class:`super` objects are now :mod:`pickleable ` and :mod:" -"`copyable `." -msgstr "" - -#: ../../library/functions.rst:2061 +#: ../../library/functions.rst:1687 msgid "" "Rather than being a function, :class:`tuple` is actually an immutable " "sequence type, as documented in :ref:`typesseq-tuple` and :ref:`typesseq`." @@ -3887,14 +3051,17 @@ msgstr "" ":class:`tuple` は、実際は関数ではなくイミュータブルなシーケンス型で、:ref:" "`typesseq-tuple` と :ref:`typesseq` にドキュメント化されています。" -#: ../../library/functions.rst:2070 +#: ../../library/functions.rst:1696 msgid "" "With one argument, return the type of an *object*. The return value is a " "type object and generally the same object as returned by :attr:`object." -"__class__`." +"__class__ `." msgstr "" +"引数が1つだけの場合、*object* の型を返します。返り値は型オブジェクトで、一般" +"に :attr:`object.__class__ ` によって返されるのと同じオブ" +"ジェクトです。" -#: ../../library/functions.rst:2074 +#: ../../library/functions.rst:1700 msgid "" "The :func:`isinstance` built-in function is recommended for testing the type " "of an object, because it takes subclasses into account." @@ -3902,36 +3069,32 @@ msgstr "" "オブジェクトの型の判定には、 :func:`isinstance` 組み込み関数を使うことが推奨" "されます。これはサブクラスを考慮するからです。" -#: ../../library/functions.rst:2077 +#: ../../library/functions.rst:1704 msgid "" "With three arguments, return a new type object. This is essentially a " "dynamic form of the :keyword:`class` statement. The *name* string is the " -"class name and becomes the :attr:`~type.__name__` attribute. The *bases* " -"tuple contains the base classes and becomes the :attr:`~type.__bases__` " -"attribute; if empty, :class:`object`, the ultimate base of all classes, is " -"added. The *dict* dictionary contains attribute and method definitions for " -"the class body; it may be copied or wrapped before becoming the :attr:`~type." -"__dict__` attribute. The following two statements create identical :class:`!" -"type` objects:" -msgstr "" - -#: ../../library/functions.rst:2092 -msgid "See also:" -msgstr "下記を参照してください。" - -#: ../../library/functions.rst:2094 -msgid "" -":ref:`Documentation on attributes and methods on classes `." -msgstr "" -":ref:`Documentation on attributes and methods on classes `." - -#: ../../library/functions.rst:2095 -msgid ":ref:`bltin-type-objects`" -msgstr ":ref:`bltin-type-objects`" - -#: ../../library/functions.rst:2097 +"class name and becomes the :attr:`~definition.__name__` attribute. The " +"*bases* tuple contains the base classes and becomes the :attr:`~class." +"__bases__` attribute; if empty, :class:`object`, the ultimate base of all " +"classes, is added. The *dict* dictionary contains attribute and method " +"definitions for the class body; it may be copied or wrapped before becoming " +"the :attr:`~object.__dict__` attribute. The following two statements create " +"identical :class:`type` objects:" +msgstr "" +"引数が3つの場合、新しい型オブジェクトを返します。これは本質的には :keyword:" +"`class` 文の動的な書式です。 *name* 文字列はクラス名で、 :attr:`~definition." +"__name__` 属性になります。 *bases* 基底クラスのタプルで、 :attr:`~class." +"__bases__` 属性になります; 空の場合は全てのクラスの基底クラスである :class:" +"`object` が追加されます。 *dict* は、クラス本体の属性とメソッドの定義を含む辞" +"書です; 辞書は :attr:`~object.__dict__` 属性になる前にコピーされたり、ラップ" +"されることがあります。以下の2つの文は同じ :class:`type` オブジェクトを生成し" +"ます:" + +#: ../../library/functions.rst:1719 +msgid "See also :ref:`bltin-type-objects`." +msgstr ":ref:`bltin-type-objects` も参照してください。" + +#: ../../library/functions.rst:1721 msgid "" "Keyword arguments provided to the three argument form are passed to the " "appropriate metaclass machinery (usually :meth:`~object.__init_subclass__`) " @@ -3942,35 +3105,51 @@ msgstr "" "定義におけるキーワード引数と同様に、適切なメタクラスの機構 (通常は :meth:" "`~object.__init_subclass__`) に渡されます。" -#: ../../library/functions.rst:2102 +#: ../../library/functions.rst:1726 msgid "See also :ref:`class-customization`." msgstr ":ref:`class-customization` も参照してください。" -#: ../../library/functions.rst:2104 +#: ../../library/functions.rst:1728 msgid "" -"Subclasses of :class:`!type` which don't override ``type.__new__`` may no " +"Subclasses of :class:`type` which don't override ``type.__new__`` may no " "longer use the one-argument form to get the type of an object." msgstr "" +"``type.__new__`` をオーバーライドしていない :class:`type` のサブクラスは、オ" +"ブジェクトの型を得るのに1引数形式を利用することができません。" -#: ../../library/functions.rst:2111 +#: ../../library/functions.rst:1734 msgid "" "Return the :attr:`~object.__dict__` attribute for a module, class, instance, " -"or any other object with a :attr:`!__dict__` attribute." +"or any other object with a :attr:`~object.__dict__` attribute." msgstr "" +"モジュール、クラス、インスタンス、あるいはそれ以外の :attr:`~object." +"__dict__` 属性を持つオブジェクトの、 :attr:`~object.__dict__` 属性を返しま" +"す。" -#: ../../library/functions.rst:2114 +#: ../../library/functions.rst:1737 msgid "" "Objects such as modules and instances have an updateable :attr:`~object." "__dict__` attribute; however, other objects may have write restrictions on " -"their :attr:`!__dict__` attributes (for example, classes use a :class:`types." -"MappingProxyType` to prevent direct dictionary updates)." +"their :attr:`~object.__dict__` attributes (for example, classes use a :class:" +"`types.MappingProxyType` to prevent direct dictionary updates)." msgstr "" +"モジュールやインスタンスのようなオブジェクトは、更新可能な :attr:`~object." +"__dict__` 属性を持っています。ただし、それ以外のオブジェクトでは :attr:" +"`~object.__dict__` 属性への書き込みが制限されている場合があります。書き込みに" +"制限がある例としては、辞書を直接更新されることを防ぐために :class:`types." +"MappingProxyType` を使っているクラスがあります。" -#: ../../library/functions.rst:2119 -msgid "Without an argument, :func:`vars` acts like :func:`locals`." -msgstr "引数がない場合 :func:`vars` は :func:`locals` のように動作します。" +#: ../../library/functions.rst:1742 +msgid "" +"Without an argument, :func:`vars` acts like :func:`locals`. Note, the " +"locals dictionary is only useful for reads since updates to the locals " +"dictionary are ignored." +msgstr "" +"引数がなければ、:func:`vars` は :func:`locals` のように振る舞います。ただし、" +"辞書 locals への更新は無視されるため、辞書 locals は読み出し時のみ有用である" +"ことに注意してください。" -#: ../../library/functions.rst:2121 +#: ../../library/functions.rst:1746 msgid "" "A :exc:`TypeError` exception is raised if an object is specified but it " "doesn't have a :attr:`~object.__dict__` attribute (for example, if its class " @@ -3980,202 +3159,56 @@ msgstr "" "のクラスが :attr:`~object.__slots__` 属性を定義している場合)、 :exc:" "`TypeError` 例外が送出されます。" -#: ../../library/functions.rst:2127 -msgid "" -"The result of calling this function without an argument has been updated as " -"described for the :func:`locals` builtin." -msgstr "" -"この関数を引数なしで呼び出したときの返り値は、 :func:`locals` 組み込み関数で" -"の説明に更新されました。" - -#: ../../library/functions.rst:2133 -msgid "" -"Iterate over several iterables in parallel, producing tuples with an item " -"from each one." -msgstr "" -"複数のイテラブルを並行に反復処理し、各イテラブルの要素からなるタプルを生成し" -"ます。" - -#: ../../library/functions.rst:2136 -msgid "Example::" -msgstr "以下はプログラム例です::" - -#: ../../library/functions.rst:2138 -msgid "" -">>> for item in zip([1, 2, 3], ['sugar', 'spice', 'everything nice']):\n" -"... print(item)\n" -"...\n" -"(1, 'sugar')\n" -"(2, 'spice')\n" -"(3, 'everything nice')" -msgstr "" -">>> for item in zip([1, 2, 3], ['sugar', 'spice', 'everything nice']):\n" -"... print(item)\n" -"...\n" -"(1, 'sugar')\n" -"(2, 'spice')\n" -"(3, 'everything nice')" - -#: ../../library/functions.rst:2145 -msgid "" -"More formally: :func:`zip` returns an iterator of tuples, where the *i*-th " -"tuple contains the *i*-th element from each of the argument iterables." -msgstr "" -"より正式な定義: :func:`zip` は、 *i* 番目のタプルが 引数に与えた各イテラブル" -"の *i* 番目の要素を含むような、タプルのイテレータを返します。" - -#: ../../library/functions.rst:2148 -msgid "" -"Another way to think of :func:`zip` is that it turns rows into columns, and " -"columns into rows. This is similar to `transposing a matrix `_." -msgstr "" -":func:`zip` に対する別の考え方は、この関数は行を列に、また列を行に変換すると" -"いうことです。これは `行列の転置 `_ " -"とよく似ています。" - -#: ../../library/functions.rst:2152 -msgid "" -":func:`zip` is lazy: The elements won't be processed until the iterable is " -"iterated on, e.g. by a :keyword:`!for` loop or by wrapping in a :class:" -"`list`." -msgstr "" -":func:`zip` は遅延評価です: イテラブルが :keyword:`!for` ループに渡された" -"り、 :class:`list` でラップされたりするなどして反復処理されるまで、要素が実際" -"に処理されることはありません。" - -#: ../../library/functions.rst:2156 -msgid "" -"One thing to consider is that the iterables passed to :func:`zip` could have " -"different lengths; sometimes by design, and sometimes because of a bug in " -"the code that prepared these iterables. Python offers three different " -"approaches to dealing with this issue:" -msgstr "" -"ここで考慮すべきことは、 :func:`zip` に渡されるイテラブルが異なる長さを持つこ" -"とがあるという点です; ときには意図的な場合もあり、またときにはイテラブルを準" -"備するコードにおけるバグのこともあるでしょう。 Python はこの問題に対して3つの" -"異なるアプローチを提供します:" - -#: ../../library/functions.rst:2161 -msgid "" -"By default, :func:`zip` stops when the shortest iterable is exhausted. It " -"will ignore the remaining items in the longer iterables, cutting off the " -"result to the length of the shortest iterable::" -msgstr "" -"デフォルトでは、 :func:`zip` は最も短いイテラブルが消費しきった時点で停止しま" -"す。より繰り返し数の長いイテラブルの残りの要素は無視して、結果を最も短いイテ" -"ラブルの長さに切り詰めます::" - -#: ../../library/functions.rst:2165 -msgid "" -">>> list(zip(range(3), ['fee', 'fi', 'fo', 'fum']))\n" -"[(0, 'fee'), (1, 'fi'), (2, 'fo')]" -msgstr "" -">>> list(zip(range(3), ['fee', 'fi', 'fo', 'fum']))\n" -"[(0, 'fee'), (1, 'fi'), (2, 'fo')]" - -#: ../../library/functions.rst:2168 -msgid "" -":func:`zip` is often used in cases where the iterables are assumed to be of " -"equal length. In such cases, it's recommended to use the ``strict=True`` " -"option. Its output is the same as regular :func:`zip`::" -msgstr "" -":func:`zip` は、しばしば受け取ったイテラブルが全て同じ長さであるという想定の" -"下で使われます。そのような場合、 ``strict=True`` オプションの利用が推奨されま" -"す。その出力は通常の :func:`zip` と同じです::" - -#: ../../library/functions.rst:2172 -msgid "" -">>> list(zip(('a', 'b', 'c'), (1, 2, 3), strict=True))\n" -"[('a', 1), ('b', 2), ('c', 3)]" -msgstr "" -">>> list(zip(('a', 'b', 'c'), (1, 2, 3), strict=True))\n" -"[('a', 1), ('b', 2), ('c', 3)]" - -#: ../../library/functions.rst:2175 -msgid "" -"Unlike the default behavior, it raises a :exc:`ValueError` if one iterable " -"is exhausted before the others:" -msgstr "" -"しかし、デフォルトの動作と異なり、あるイテラブルが他のイテラブルよりも先に消" -"費しきった場合に :exc:`ValueError` 例外を送出します:" - -#: ../../library/functions.rst:2193 -msgid "" -"Without the ``strict=True`` argument, any bug that results in iterables of " -"different lengths will be silenced, possibly manifesting as a hard-to-find " -"bug in another part of the program." -msgstr "" -"``strict=True`` 引数なしの場合、長さの異なるイテラブルを生じる原因となるいか" -"なるバグも、この時点では問題なく処理されます。そして代わりにプログラムの別の" -"場所で、原因を特定しにくいバグとして検出されることになるでしょう。" - -#: ../../library/functions.rst:2197 -msgid "" -"Shorter iterables can be padded with a constant value to make all the " -"iterables have the same length. This is done by :func:`itertools." -"zip_longest`." -msgstr "" -"短いイテラブルを一定の値でパディングして全てのイテラブルが同じ長さになるよう" -"にすることもできます。この機能は :func:`itertools.zip_longest` で提供されま" -"す。" +#: ../../library/functions.rst:1752 +msgid "Make an iterator that aggregates elements from each of the iterables." +msgstr "それぞれのイテラブルから要素を集めたイテレータを作ります。" -#: ../../library/functions.rst:2201 +#: ../../library/functions.rst:1754 msgid "" -"Edge cases: With a single iterable argument, :func:`zip` returns an iterator " -"of 1-tuples. With no arguments, it returns an empty iterator." +"Returns an iterator of tuples, where the *i*-th tuple contains the *i*-th " +"element from each of the argument sequences or iterables. The iterator " +"stops when the shortest input iterable is exhausted. With a single iterable " +"argument, it returns an iterator of 1-tuples. With no arguments, it returns " +"an empty iterator. Equivalent to::" msgstr "" -"エッジケース: 引数としてイテラブルをひとつだけ渡した場合、 :func:`zip` は 1 " -"タプルのイテレータを返します。引数なしの場合は空のイテレータを返します。" +"この関数はタプルのイテレータを返し、その *i* 番目のタプルは引数シーケンスまた" +"はイテラブルそれぞれの *i* 番目の要素を含みます。このイテレータは、入力イテラ" +"ブルの中で最短のものが尽きたときに止まります。単一のイテラブル引数が与えられ" +"たときは、1 要素のタプルからなるイテレータを返します。引数がなければ、空のイ" +"テレータを返します。次と等価です::" -#: ../../library/functions.rst:2204 -msgid "Tips and tricks:" -msgstr "ヒントとコツ:" - -#: ../../library/functions.rst:2206 +#: ../../library/functions.rst:1773 msgid "" "The left-to-right evaluation order of the iterables is guaranteed. This " "makes possible an idiom for clustering a data series into n-length groups " -"using ``zip(*[iter(s)]*n, strict=True)``. This repeats the *same* iterator " -"``n`` times so that each output tuple has the result of ``n`` calls to the " -"iterator. This has the effect of dividing the input into n-length chunks." +"using ``zip(*[iter(s)]*n)``. This repeats the *same* iterator ``n`` times " +"so that each output tuple has the result of ``n`` calls to the iterator. " +"This has the effect of dividing the input into n-length chunks." msgstr "" "イテラブルの左から右への評価順序は保証されています。そのため " -"``zip(*[iter(s)]*n, strict=True)`` を使ってデータ系列を長さ n のグループにク" -"ラスタリングするイディオムが使えます。これは、各出力タプルがイテレータを " -"``n`` 回呼び出した結果となるよう、 *同じ* イテレータを ``n`` 回繰り返します。" -"これは入力を長さ n のチャンクに分割する効果があります。" +"``zip(*[iter(s)]*n)`` を使ってデータ系列を長さ n のグループにクラスタリングす" +"るイディオムが使えます。これは、各出力タプルがイテレータを ``n`` 回呼び出した" +"結果となるよう、 *同じ* イテレータを ``n`` 回繰り返します。これは入力を長さ " +"n のチャンクに分割する効果があります。" -#: ../../library/functions.rst:2212 +#: ../../library/functions.rst:1779 msgid "" -":func:`zip` in conjunction with the ``*`` operator can be used to unzip a " -"list::" +":func:`zip` should only be used with unequal length inputs when you don't " +"care about trailing, unmatched values from the longer iterables. If those " +"values are important, use :func:`itertools.zip_longest` instead." msgstr "" -":func:`zip` に続けて ``*`` 演算子を使うと、zip したリストを元に戻せます::" +":func:`zip` は、長い方のイテラブルの終端にある対にならない値を考慮したい場合" +"は、等しくない長さの入力に対して使うべきではありません。そのような値が重要な" +"場合、代わりに :func:`itertools.zip_longest` を使ってください。" -#: ../../library/functions.rst:2215 +#: ../../library/functions.rst:1783 msgid "" -">>> x = [1, 2, 3]\n" -">>> y = [4, 5, 6]\n" -">>> list(zip(x, y))\n" -"[(1, 4), (2, 5), (3, 6)]\n" -">>> x2, y2 = zip(*zip(x, y))\n" -">>> x == list(x2) and y == list(y2)\n" -"True" +":func:`zip` in conjunction with the ``*`` operator can be used to unzip a " +"list::" msgstr "" -">>> x = [1, 2, 3]\n" -">>> y = [4, 5, 6]\n" -">>> list(zip(x, y))\n" -"[(1, 4), (2, 5), (3, 6)]\n" -">>> x2, y2 = zip(*zip(x, y))\n" -">>> x == list(x2) and y == list(y2)\n" -"True" - -#: ../../library/functions.rst:2223 -msgid "Added the ``strict`` argument." -msgstr "``strict`` 引数が追加されました。" +":func:`zip` に続けて ``*`` 演算子を使うと、zip したリストを元に戻せます::" -#: ../../library/functions.rst:2235 +#: ../../library/functions.rst:1804 msgid "" "This is an advanced function that is not needed in everyday Python " "programming, unlike :func:`importlib.import_module`." @@ -4183,7 +3216,7 @@ msgstr "" "これは :func:`importlib.import_module` とは違い、日常の Python プログラミング" "では必要ない高等な関数です。" -#: ../../library/functions.rst:2238 +#: ../../library/functions.rst:1807 msgid "" "This function is invoked by the :keyword:`import` statement. It can be " "replaced (by importing the :mod:`builtins` module and assigning to " @@ -4203,13 +3236,13 @@ msgstr "" "`__import__` を直接使用することも推奨されず、 :func:`importlib." "import_module` の方が好まれます。" -#: ../../library/functions.rst:2247 +#: ../../library/functions.rst:1816 msgid "" "The function imports the module *name*, potentially using the given " "*globals* and *locals* to determine how to interpret the name in a package " "context. The *fromlist* gives the names of objects or submodules that should " "be imported from the module given by *name*. The standard implementation " -"does not use its *locals* argument at all and uses its *globals* only to " +"does not use its *locals* argument at all, and uses its *globals* only to " "determine the package context of the :keyword:`import` statement." msgstr "" "この関数は、モジュール *name* をインポートし、 *globals* と *locals* が与えら" @@ -4219,7 +3252,7 @@ msgstr "" "使われず、 *globals* は :keyword:`import` 文のパッケージコンテキストを決定す" "るためにのみ使われます。" -#: ../../library/functions.rst:2254 +#: ../../library/functions.rst:1823 msgid "" "*level* specifies whether to use absolute or relative imports. ``0`` (the " "default) means only perform absolute imports. Positive values for *level* " @@ -4232,7 +3265,7 @@ msgstr "" "を呼び出したディレクトリから検索対象となる親ディレクトリの数を示します (詳細" "は :pep:`328` を参照してください)。" -#: ../../library/functions.rst:2260 +#: ../../library/functions.rst:1829 msgid "" "When the *name* variable is of the form ``package.module``, normally, the " "top-level package (the name up till the first dot) is returned, *not* the " @@ -4244,26 +3277,18 @@ msgstr "" "す。しかしながら、空でない *fromlist* 引数が与えられると、 *name* で指名され" "たモジュールが返されます。" -#: ../../library/functions.rst:2265 +#: ../../library/functions.rst:1834 msgid "" "For example, the statement ``import spam`` results in bytecode resembling " "the following code::" msgstr "" "例えば、文 ``import spam`` は、以下のコードのようなバイトコードに帰結します::" -#: ../../library/functions.rst:2268 -msgid "spam = __import__('spam', globals(), locals(), [], 0)" -msgstr "spam = __import__('spam', globals(), locals(), [], 0)" - -#: ../../library/functions.rst:2270 +#: ../../library/functions.rst:1839 msgid "The statement ``import spam.ham`` results in this call::" msgstr "文 ``import spam.ham`` は、この呼び出しになります::" -#: ../../library/functions.rst:2272 -msgid "spam = __import__('spam.ham', globals(), locals(), [], 0)" -msgstr "spam = __import__('spam.ham', globals(), locals(), [], 0)" - -#: ../../library/functions.rst:2274 +#: ../../library/functions.rst:1843 msgid "" "Note how :func:`__import__` returns the toplevel module here because this is " "the object that is bound to a name by the :keyword:`import` statement." @@ -4272,7 +3297,7 @@ msgstr "" "て下さい。 :keyword:`import` 文により名前が束縛されたオブジェクトになっていま" "す。" -#: ../../library/functions.rst:2277 +#: ../../library/functions.rst:1846 msgid "" "On the other hand, the statement ``from spam.ham import eggs, sausage as " "saus`` results in ::" @@ -4280,17 +3305,7 @@ msgstr "" "一方で、文 ``from spam.ham import eggs, sausage as saus`` は、以下となりま" "す ::" -#: ../../library/functions.rst:2280 -msgid "" -"_temp = __import__('spam.ham', globals(), locals(), ['eggs', 'sausage'], 0)\n" -"eggs = _temp.eggs\n" -"saus = _temp.sausage" -msgstr "" -"_temp = __import__('spam.ham', globals(), locals(), ['eggs', 'sausage'], 0)\n" -"eggs = _temp.eggs\n" -"saus = _temp.sausage" - -#: ../../library/functions.rst:2284 +#: ../../library/functions.rst:1853 msgid "" "Here, the ``spam.ham`` module is returned from :func:`__import__`. From " "this object, the names to import are retrieved and assigned to their " @@ -4300,7 +3315,7 @@ msgstr "" "ジェクトから、インポートされる名前が取り出され、それぞれの名前として代入され" "ます。" -#: ../../library/functions.rst:2288 +#: ../../library/functions.rst:1857 msgid "" "If you simply want to import a module (potentially within a package) by " "name, use :func:`importlib.import_module`." @@ -4308,7 +3323,7 @@ msgstr "" "単純に名前からモジュール (パッケージの範囲内であるかも知れません) をインポー" "トしたいなら、 :func:`importlib.import_module` を使ってください。" -#: ../../library/functions.rst:2291 +#: ../../library/functions.rst:1860 msgid "" "Negative values for *level* are no longer supported (which also changes the " "default value to 0)." @@ -4316,7 +3331,7 @@ msgstr "" "負の *level* の値はサポートされなくなりました (デフォルト値の 0 に変更されま" "す)。" -#: ../../library/functions.rst:2295 +#: ../../library/functions.rst:1864 msgid "" "When the command line options :option:`-E` or :option:`-I` are being used, " "the environment variable :envvar:`PYTHONCASEOK` is now ignored." @@ -4324,11 +3339,11 @@ msgstr "" "コマンドラインオプション :option:`-E` or :option:`-I` が指定された場合、環境" "変数 :envvar:`PYTHONCASEOK` は無視されるようになりました。" -#: ../../library/functions.rst:2300 +#: ../../library/functions.rst:1869 msgid "Footnotes" msgstr "脚注" -#: ../../library/functions.rst:2301 +#: ../../library/functions.rst:1870 msgid "" "Note that the parser only accepts the Unix-style end of line convention. If " "you are reading the code from a file, make sure to use newline conversion " @@ -4337,111 +3352,3 @@ msgstr "" "なお、パーサは Unix スタイルの行末の記法しか受け付けません。コードをファイル" "から読んでいるなら、必ず、改行変換モードで Windows や Mac スタイルの改行を変" "換してください。" - -#: ../../library/functions.rst:154 -msgid "Boolean" -msgstr "Boolean" - -#: ../../library/functions.rst:154 ../../library/functions.rst:2068 -msgid "type" -msgstr "type" - -#: ../../library/functions.rst:654 -msgid "built-in function" -msgstr "組み込み関数" - -#: ../../library/functions.rst:654 -msgid "exec" -msgstr "exec" - -#: ../../library/functions.rst:752 -msgid "NaN" -msgstr "NaN" - -#: ../../library/functions.rst:752 -msgid "Infinity" -msgstr "Infinity" - -#: ../../library/functions.rst:822 -msgid "__format__" -msgstr "__format__" - -#: ../../library/functions.rst:822 ../../library/functions.rst:1937 -msgid "string" -msgstr "string" - -#: ../../library/functions.rst:822 -msgid "format() (built-in function)" -msgstr "format() (組み込み関数)" - -#: ../../library/functions.rst:1337 -msgid "file object" -msgstr "file object" - -#: ../../library/functions.rst:1337 ../../library/functions.rst:1458 -msgid "open() built-in function" -msgstr "open() built-in function" - -#: ../../library/functions.rst:1365 -msgid "file" -msgstr "ファイル" - -#: ../../library/functions.rst:1365 -msgid "modes" -msgstr "modes" - -#: ../../library/functions.rst:1458 -msgid "universal newlines" -msgstr "universal newlines" - -#: ../../library/functions.rst:1519 -msgid "line-buffered I/O" -msgstr "line-buffered I/O" - -#: ../../library/functions.rst:1519 -msgid "unbuffered I/O" -msgstr "unbuffered I/O" - -#: ../../library/functions.rst:1519 -msgid "buffer size, I/O" -msgstr "buffer size, I/O" - -#: ../../library/functions.rst:1519 -msgid "I/O control" -msgstr "I/O control" - -#: ../../library/functions.rst:1519 -msgid "buffering" -msgstr "buffering" - -#: ../../library/functions.rst:1519 -msgid "text mode" -msgstr "text mode" - -#: ../../library/functions.rst:1519 ../../library/functions.rst:2229 -msgid "module" -msgstr "module" - -#: ../../library/functions.rst:1519 -msgid "sys" -msgstr "sys" - -#: ../../library/functions.rst:1937 -msgid "str() (built-in function)" -msgstr "str() (built-in function)" - -#: ../../library/functions.rst:2068 -msgid "object" -msgstr "object" - -#: ../../library/functions.rst:2229 -msgid "statement" -msgstr "statement" - -#: ../../library/functions.rst:2229 -msgid "import" -msgstr "import" - -#: ../../library/functions.rst:2229 -msgid "builtins" -msgstr "builtins" diff --git a/library/functools.po b/library/functools.po index 7f7a7d246..b4e538101 100644 --- a/library/functools.po +++ b/library/functools.po @@ -1,37 +1,38 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: +# 秘湯 , 2017 +# Nozomu Kaneko , 2017 +# Shun Sakurai, 2017 +# Arihiro TAKASE, 2017 +# E. Kawashima, 2017 +# tomo, 2018 # Takanori Suzuki , 2021 -# tomo, 2021 -# Takeshi Nakazato, 2022 -# Arihiro TAKASE, 2023 -# 石井明久, 2024 -# Atsuo Ishimoto , 2025 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 01:06+0000\n" -"Last-Translator: Atsuo Ishimoto , 2025\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 23:12+0000\n" +"Last-Translator: Takanori Suzuki , 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/functools.rst:2 msgid "" -":mod:`!functools` --- Higher-order functions and operations on callable " +":mod:`functools` --- Higher-order functions and operations on callable " "objects" -msgstr ":mod:`!functools` --- 高階関数と呼び出し可能オブジェクトの操作" +msgstr ":mod:`functools` --- 高階関数と呼び出し可能オブジェクトの操作" #: ../../library/functools.rst:14 msgid "**Source code:** :source:`Lib/functools.py`" @@ -63,45 +64,18 @@ msgstr "" msgid "" "Returns the same as ``lru_cache(maxsize=None)``, creating a thin wrapper " "around a dictionary lookup for the function arguments. Because it never " -"needs to evict old values, this is smaller and faster than :func:`lru_cache` " -"with a size limit." +"needs to evict old values, this is smaller and faster than :func:" +"`lru_cache()` with a size limit." msgstr "" +"``lru_cache(maxsize=None)`` と同じ関数を返し、関数の引数に対するルックアップ" +"辞書を含む薄いラッパーを生成します。キャッシュ上の古い値を追い出す必要がない" +"ため、キャッシュサイズに制限のある :func:`lru_cache()` よりも軽量で高速です。" -#: ../../library/functools.rst:39 ../../library/functools.rst:291 +#: ../../library/functools.rst:39 ../../library/functools.rst:255 msgid "For example::" msgstr "例えば::" -#: ../../library/functools.rst:41 -msgid "" -"@cache\n" -"def factorial(n):\n" -" return n * factorial(n-1) if n else 1\n" -"\n" -">>> factorial(10) # no previously cached result, makes 11 recursive " -"calls\n" -"3628800\n" -">>> factorial(5) # just looks up cached value result\n" -"120\n" -">>> factorial(12) # makes two new recursive calls, the other 10 are " -"cached\n" -"479001600" -msgstr "" - -#: ../../library/functools.rst:52 ../../library/functools.rst:158 -msgid "" -"The cache is threadsafe so that the wrapped function can be used in multiple " -"threads. This means that the underlying data structure will remain coherent " -"during concurrent updates." -msgstr "" - -#: ../../library/functools.rst:56 ../../library/functools.rst:162 -msgid "" -"It is possible for the wrapped function to be called more than once if " -"another thread makes an additional call before the initial call has been " -"completed and cached." -msgstr "" - -#: ../../library/functools.rst:65 +#: ../../library/functools.rst:57 msgid "" "Transform a method of a class into a property whose value is computed once " "and then cached as a normal attribute for the life of the instance. Similar " @@ -109,29 +83,16 @@ msgid "" "computed properties of instances that are otherwise effectively immutable." msgstr "" "クラスのメソッドを、値を一度だけ計算して通常の属性としてキャッシュするプロパ" -"ティに変換します。キャッシュはインスタンスの生存期間にわたって有効です。:" -"func:`property` に似ていて、さらにキャッシュを行います。計算コストが高く、一" -"度計算すればその後は不変であるようなインスタンスのプロパティに対して有用で" -"す。" +"ティに変換します。キャッシュはインスタンスの生存期間にわたって有効です。計算" +"コストが高く、一度計算すればその後は不変であるようなインスタンスのプロパティ" +"に対して有用です。" -#: ../../library/functools.rst:70 ../../library/functools.rst:142 -#: ../../library/functools.rst:432 +#: ../../library/functools.rst:62 ../../library/functools.rst:127 +#: ../../library/functools.rst:340 msgid "Example::" msgstr "以下はプログラム例です::" -#: ../../library/functools.rst:72 -msgid "" -"class DataSet:\n" -"\n" -" def __init__(self, sequence_of_numbers):\n" -" self._data = tuple(sequence_of_numbers)\n" -"\n" -" @cached_property\n" -" def stdev(self):\n" -" return statistics.stdev(self._data)" -msgstr "" - -#: ../../library/functools.rst:81 +#: ../../library/functools.rst:73 msgid "" "The mechanics of :func:`cached_property` are somewhat different from :func:" "`property`. A regular property blocks attribute writes unless a setter is " @@ -141,7 +102,7 @@ msgstr "" "プロパティは、セッター (setter) が定義されない限り書き込みを禁止します。対照" "的に、 *cached_property* は書き込みを許します。" -#: ../../library/functools.rst:85 +#: ../../library/functools.rst:77 msgid "" "The *cached_property* decorator only runs on lookups and only when an " "attribute of the same name doesn't exist. When it does run, the " @@ -154,7 +115,7 @@ msgstr "" "行います。その後の属性の読み込みと書き込みは *cached_property* メソッドより優" "先され、通常の属性のように働きます。" -#: ../../library/functools.rst:91 +#: ../../library/functools.rst:83 msgid "" "The cached value can be cleared by deleting the attribute. This allows the " "*cached_property* method to run again." @@ -162,18 +123,7 @@ msgstr "" "キャッシュされた値は属性を削除することで取り除くことができます。これにより " "*cached_property* メソッドを再度実行することが可能になります。" -#: ../../library/functools.rst:94 -msgid "" -"The *cached_property* does not prevent a possible race condition in multi-" -"threaded usage. The getter function could run more than once on the same " -"instance, with the latest run setting the cached value. If the cached " -"property is idempotent or otherwise not harmful to run more than once on an " -"instance, this is fine. If synchronization is needed, implement the " -"necessary locking inside the decorated getter function or around the cached " -"property access." -msgstr "" - -#: ../../library/functools.rst:102 +#: ../../library/functools.rst:86 msgid "" "Note, this decorator interferes with the operation of :pep:`412` key-sharing " "dictionaries. This means that instance dictionaries can take more space " @@ -182,7 +132,7 @@ msgstr "" "このデコレータは :pep:`412` のキー共有辞書のインターフェースを持ちます。これ" "は、インスタンス辞書がより多くのスペースを使う可能性があることを意味します。" -#: ../../library/functools.rst:106 +#: ../../library/functools.rst:90 msgid "" "Also, this decorator requires that the ``__dict__`` attribute on each " "instance be a mutable mapping. This means it will not work with some types, " @@ -198,25 +148,17 @@ msgstr "" "``__dict__`` を含まない型 (それ自体が ``__dict__`` 属性を提供しないため) に対" "しては動作しないことを意味します。" -#: ../../library/functools.rst:113 +#: ../../library/functools.rst:97 msgid "" "If a mutable mapping is not available or if space-efficient key sharing is " -"desired, an effect similar to :func:`cached_property` can also be achieved " -"by stacking :func:`property` on top of :func:`lru_cache`. See :ref:`faq-" -"cache-method-calls` for more details on how this differs from :func:" -"`cached_property`." +"desired, an effect similar to :func:`cached_property` can be achieved by a " +"stacking :func:`property` on top of :func:`cache`::" msgstr "" +"可変なマッピングを持たないか、またはスペース効率の良いキー共有が必要な場合" +"は、 :func:`cached_property` と似たような効果を :func:`cache` の上に :func:" +"`property` を重ねることで実現できます::" -#: ../../library/functools.rst:120 -msgid "" -"Prior to Python 3.12, ``cached_property`` included an undocumented lock to " -"ensure that in multi-threaded usage the getter function was guaranteed to " -"run only once per instance. However, the lock was per-property, not per-" -"instance, which could result in unacceptably high lock contention. In Python " -"3.12+ this locking is removed." -msgstr "" - -#: ../../library/functools.rst:130 +#: ../../library/functools.rst:115 msgid "" "Transform an old-style comparison function to a :term:`key function`. Used " "with tools that accept key functions (such as :func:`sorted`, :func:`min`, :" @@ -231,9 +173,9 @@ msgstr "" "の関数は、主に比較関数を使っていた Python 2 からプログラムの移行のための変換" "ツールとして使われます。" -#: ../../library/functools.rst:137 +#: ../../library/functools.rst:122 msgid "" -"A comparison function is any callable that accepts two arguments, compares " +"A comparison function is any callable that accept two arguments, compares " "them, and returns a negative number for less-than, zero for equality, or a " "positive number for greater-than. A key function is a callable that accepts " "one argument and returns another value to be used as the sort key." @@ -243,18 +185,13 @@ msgstr "" "し可能オブジェクトです。key 関数は呼び出し可能オブジェクトで、1つの引数を受け" "取り、ソートキーとして使われる値を返します。" -#: ../../library/functools.rst:144 -msgid "" -"sorted(iterable, key=cmp_to_key(locale.strcoll)) # locale-aware sort order" -msgstr "" - -#: ../../library/functools.rst:146 +#: ../../library/functools.rst:131 msgid "" "For sorting examples and a brief sorting tutorial, see :ref:`sortinghowto`." msgstr "" "ソートの例と簡単なチュートリアルは :ref:`sortinghowto` を参照して下さい。" -#: ../../library/functools.rst:154 +#: ../../library/functools.rst:139 msgid "" "Decorator to wrap a function with a memoizing callable that saves up to the " "*maxsize* most recent calls. It can save time when an expensive or I/O " @@ -264,27 +201,26 @@ msgstr "" "*maxsize* 回まで保存するするデコレータです。高価な関数や I/O に束縛されている" "関数を定期的に同じ引数で呼び出すときに、時間を節約できます。" -#: ../../library/functools.rst:166 +#: ../../library/functools.rst:143 msgid "" "Since a dictionary is used to cache results, the positional and keyword " -"arguments to the function must be :term:`hashable`." +"arguments to the function must be hashable." msgstr "" -"結果のキャッシュには辞書が使われるので、関数の位置引数およびキーワード引数" -"は :term:`ハッシュ可能 ` でなくてはなりません。" +"結果のキャッシュには辞書が使われるので、関数の位置引数およびキーワード引数は" +"ハッシュ可能でなくてはなりません。" -#: ../../library/functools.rst:169 +#: ../../library/functools.rst:146 msgid "" "Distinct argument patterns may be considered to be distinct calls with " -"separate cache entries. For example, ``f(a=1, b=2)`` and ``f(b=2, a=1)`` " -"differ in their keyword argument order and may have two separate cache " -"entries." +"separate cache entries. For example, `f(a=1, b=2)` and `f(b=2, a=1)` differ " +"in their keyword argument order and may have two separate cache entries." msgstr "" "引数のパターンが異なる場合は、異なる呼び出しと見なされ別々のキャッシュエント" "リーとなります。\n" -"例えば、 ``f(a=1, b=2)`` と ``f(b=2, a=1)`` はキーワード引数の順序が異なって" -"いるので、2つの別個のキャッシュエントリーになります。" +"例えば、 `f(a=1, b=2)` と `f(b=2, a=1)` はキーワード引数の順序が異なっている" +"ので、2つの別個のキャッシュエントリーになります。" -#: ../../library/functools.rst:174 +#: ../../library/functools.rst:151 msgid "" "If *user_function* is specified, it must be a callable. This allows the " "*lru_cache* decorator to be applied directly to a user function, leaving the " @@ -294,14 +230,7 @@ msgstr "" "れにより *lru_cache* デコレータがユーザー関数に直接適用できるようになります。" "このとき *maxsize* の値はデフォルトの 128 となります::" -#: ../../library/functools.rst:178 -msgid "" -"@lru_cache\n" -"def count_vowels(sentence):\n" -" return sum(sentence.count(vowel) for vowel in 'AEIOUaeiou')" -msgstr "" - -#: ../../library/functools.rst:182 +#: ../../library/functools.rst:160 msgid "" "If *maxsize* is set to ``None``, the LRU feature is disabled and the cache " "can grow without bound." @@ -309,43 +238,41 @@ msgstr "" "*maxsize* が ``None`` に設定された場合は、LRU 機能は無効化され、キャッシュは" "際限無く大きくなります。" -#: ../../library/functools.rst:185 +#: ../../library/functools.rst:163 msgid "" "If *typed* is set to true, function arguments of different types will be " -"cached separately. If *typed* is false, the implementation will usually " -"regard them as equivalent calls and only cache a single result. (Some types " -"such as *str* and *int* may be cached separately even when *typed* is false.)" +"cached separately. For example, ``f(3)`` and ``f(3.0)`` will be treated as " +"distinct calls with distinct results." msgstr "" +"*typed* が真に設定された場合は、関数の異なる型の引数が別々にキャッシュされま" +"す。例えば、``f(3)`` と ``f(3.0)`` は別の結果をもたらす別の呼び出しとして扱わ" +"れます。" -#: ../../library/functools.rst:191 +#: ../../library/functools.rst:167 msgid "" -"Note, type specificity applies only to the function's immediate arguments " -"rather than their contents. The scalar arguments, ``Decimal(42)`` and " -"``Fraction(42)`` are be treated as distinct calls with distinct results. In " -"contrast, the tuple arguments ``('answer', Decimal(42))`` and ``('answer', " -"Fraction(42))`` are treated as equivalent." -msgstr "" - -#: ../../library/functools.rst:197 -msgid "" -"The wrapped function is instrumented with a :func:`!cache_parameters` " +"The wrapped function is instrumented with a :func:`cache_parameters` " "function that returns a new :class:`dict` showing the values for *maxsize* " "and *typed*. This is for information purposes only. Mutating the values " "has no effect." msgstr "" +"ラップされた関数には :func:`cache_parameters` 関数が定義されます。この関数は " +"*maxsize* と *typed* の値を含む :class:`dict` を新規に生成して 返します。これ" +"は通知目的のみであり、戻り値の変更は何の効果もありません。" -#: ../../library/functools.rst:202 +#: ../../library/functools.rst:172 msgid "" "To help measure the effectiveness of the cache and tune the *maxsize* " "parameter, the wrapped function is instrumented with a :func:`cache_info` " "function that returns a :term:`named tuple` showing *hits*, *misses*, " -"*maxsize* and *currsize*." +"*maxsize* and *currsize*. In a multi-threaded environment, the hits and " +"misses are approximate." msgstr "" "キャッシュ効率の測定や *maxsize* パラメータの調整をしやすくするため、ラップさ" "れた関数には :func:`cache_info` 関数が追加されます。この関数は *hits*, " -"*misses*, *maxsize*, *currsize* を示す :term:`named tuple` を返します。" +"*misses*, *maxsize*, *currsize* を示す :term:`named tuple` を返します。マルチ" +"スレッド環境では、hits と misses は概算です。" -#: ../../library/functools.rst:207 +#: ../../library/functools.rst:178 msgid "" "The decorator also provides a :func:`cache_clear` function for clearing or " "invalidating the cache." @@ -353,7 +280,7 @@ msgstr "" "このデコレータは、キャッシュの削除と無効化のための :func:`cache_clear` 関数も" "提供します。" -#: ../../library/functools.rst:210 +#: ../../library/functools.rst:181 msgid "" "The original underlying function is accessible through the :attr:" "`__wrapped__` attribute. This is useful for introspection, for bypassing " @@ -363,62 +290,39 @@ msgstr "" "はキャッシュを回避して、または関数を別のキャッシュでラップして、内観するのに" "便利です。" -#: ../../library/functools.rst:214 -msgid "" -"The cache keeps references to the arguments and return values until they age " -"out of the cache or until the cache is cleared." -msgstr "" - -#: ../../library/functools.rst:217 -msgid "" -"If a method is cached, the ``self`` instance argument is included in the " -"cache. See :ref:`faq-cache-method-calls`" -msgstr "" - -#: ../../library/functools.rst:220 +#: ../../library/functools.rst:185 msgid "" "An `LRU (least recently used) cache `_ works best when the " +"Cache_replacement_policies#Least_recently_used_(LRU)>`_ works best when the " "most recent calls are the best predictors of upcoming calls (for example, " "the most popular articles on a news server tend to change each day). The " "cache's size limit assures that the cache does not grow without bound on " "long-running processes such as web servers." msgstr "" +"`LRU (least recently used) キャッシュ`_ は、最も新しい呼び出しが次の呼び出し" +"で最も現れやすいとき (例えば、最もニュースサーバの人気の記事が日ごとに変わる" +"傾向にある場合) に最も最も効率よくはたらきます。キャッシュのサイズ制限は、" +"キャッシュがウェブサーバの長期間に渡るプロセスにおける限界を超えては大きくな" +"らないことを保証します。" -#: ../../library/functools.rst:227 +#: ../../library/functools.rst:192 msgid "" "In general, the LRU cache should only be used when you want to reuse " "previously computed values. Accordingly, it doesn't make sense to cache " "functions with side-effects, functions that need to create distinct mutable " -"objects on each call (such as generators and async functions), or impure " -"functions such as time() or random()." +"objects on each call, or impure functions such as time() or random()." msgstr "" +"一般的には、 LRU キャッシュは前回計算した値を再利用したいときにのみ使うべきで" +"す。\n" +"そのため、副作用のある関数、呼び出すごとに個別の可変なオブジェクトを作成する" +"必要がある関数、 time() や random() のような純粋でない関数をキャッシュする意" +"味はありません。" -#: ../../library/functools.rst:233 +#: ../../library/functools.rst:197 msgid "Example of an LRU cache for static web content::" msgstr "静的 web コンテンツ の LRU キャッシュの例::" -#: ../../library/functools.rst:235 -msgid "" -"@lru_cache(maxsize=32)\n" -"def get_pep(num):\n" -" 'Retrieve text of a Python Enhancement Proposal'\n" -" resource = f'https://peps.python.org/pep-%7Bnum:04d%7D'\n" -" try:\n" -" with urllib.request.urlopen(resource) as s:\n" -" return s.read()\n" -" except urllib.error.HTTPError:\n" -" return 'Not Found'\n" -"\n" -">>> for n in 8, 290, 308, 320, 8, 218, 320, 279, 289, 320, 9991:\n" -"... pep = get_pep(n)\n" -"... print(n, len(pep))\n" -"\n" -">>> get_pep.cache_info()\n" -"CacheInfo(hits=3, misses=8, maxsize=32, currsize=8)" -msgstr "" - -#: ../../library/functools.rst:252 +#: ../../library/functools.rst:216 msgid "" "Example of efficiently computing `Fibonacci numbers `_ using a cache to implement a `dynamic " @@ -428,34 +332,19 @@ msgstr "" "の技法を実装し、`フィボナッチ数 `_ を効率よく計算する例::" -#: ../../library/functools.rst:258 -msgid "" -"@lru_cache(maxsize=None)\n" -"def fib(n):\n" -" if n < 2:\n" -" return n\n" -" return fib(n-1) + fib(n-2)\n" -"\n" -">>> [fib(n) for n in range(16)]\n" -"[0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610]\n" -"\n" -">>> fib.cache_info()\n" -"CacheInfo(hits=28, misses=16, maxsize=None, currsize=16)" -msgstr "" - -#: ../../library/functools.rst:272 +#: ../../library/functools.rst:236 msgid "Added the *typed* option." msgstr "*typed* オプションが追加されました。" -#: ../../library/functools.rst:275 +#: ../../library/functools.rst:239 msgid "Added the *user_function* option." msgstr "*user_function* オプションが追加されました。" -#: ../../library/functools.rst:278 -msgid "Added the function :func:`!cache_parameters`" -msgstr "" +#: ../../library/functools.rst:242 +msgid "Added the function :func:`cache_parameters`" +msgstr ":func:`cache_parameters` 関数が追加されました。" -#: ../../library/functools.rst:283 +#: ../../library/functools.rst:247 msgid "" "Given a class defining one or more rich comparison ordering methods, this " "class decorator supplies the rest. This simplifies the effort involved in " @@ -465,7 +354,7 @@ msgstr "" "たクラスを受け取り、残りを実装するクラスデコレータです。このデコレータは全て" "の拡張順序比較演算をサポートするための労力を軽減します:" -#: ../../library/functools.rst:287 +#: ../../library/functools.rst:251 msgid "" "The class must define one of :meth:`__lt__`, :meth:`__le__`, :meth:`__gt__`, " "or :meth:`__ge__`. In addition, the class should supply an :meth:`__eq__` " @@ -475,26 +364,7 @@ msgstr "" "`__ge__` の中からどれか1つと、 :meth:`__eq__` メソッドを定義する必要がありま" "す。" -#: ../../library/functools.rst:293 -msgid "" -"@total_ordering\n" -"class Student:\n" -" def _is_valid_operand(self, other):\n" -" return (hasattr(other, \"lastname\") and\n" -" hasattr(other, \"firstname\"))\n" -" def __eq__(self, other):\n" -" if not self._is_valid_operand(other):\n" -" return NotImplemented\n" -" return ((self.lastname.lower(), self.firstname.lower()) ==\n" -" (other.lastname.lower(), other.firstname.lower()))\n" -" def __lt__(self, other):\n" -" if not self._is_valid_operand(other):\n" -" return NotImplemented\n" -" return ((self.lastname.lower(), self.firstname.lower()) <\n" -" (other.lastname.lower(), other.firstname.lower()))" -msgstr "" - -#: ../../library/functools.rst:311 +#: ../../library/functools.rst:275 msgid "" "While this decorator makes it easy to create well behaved totally ordered " "types, it *does* come at the cost of slower execution and more complex stack " @@ -502,34 +372,21 @@ msgid "" "indicates this is a bottleneck for a given application, implementing all six " "rich comparison methods instead is likely to provide an easy speed boost." msgstr "" -"このデコレータにより、このデコレータにより、行儀の良い(well behaved)全順序" -"型を簡単に作ることができますが、その代償として実行速度は遅く、比較メソッドの" -"演繹によってのスタックトレースは複雑になります。性能ベンチマークにより、これ" -"がアプリケーションのボトルネックになっていることがわかった場合は、代わりに 6 " -"つの拡張比較メソッドをすべて実装すれば、簡単にスピードアップを図れるでしょ" -"う。" - -#: ../../library/functools.rst:320 -msgid "" -"This decorator makes no attempt to override methods that have been declared " -"in the class *or its superclasses*. Meaning that if a superclass defines a " -"comparison operator, *total_ordering* will not implement it again, even if " -"the original method is abstract." -msgstr "" +"このデコレータにより、完全に順序の付いた振る舞いの良い型を簡単に作ることがで" +"きますが、実行速度は遅くなり、派生した比較メソッドのスタックトレースは複雑に" +"なります。性能ベンチマークにより、これがアプリケーションのボトルネックになっ" +"ていることがわかった場合は、代わりに 6 つの拡張比較メソッドをすべて実装すれ" +"ば、簡単にスピードアップを図れるでしょう。" -#: ../../library/functools.rst:327 +#: ../../library/functools.rst:284 msgid "" -"Returning ``NotImplemented`` from the underlying comparison function for " +"Returning NotImplemented from the underlying comparison function for " "unrecognised types is now supported." msgstr "" +"認識できない型に対して下層の比較関数から NotImplemented を返すことがサポート" +"されるようになりました。" -#: ../../library/functools.rst:333 -msgid "" -"A singleton object used as a sentinel to reserve a place for positional " -"arguments when calling :func:`partial` and :func:`partialmethod`." -msgstr "" - -#: ../../library/functools.rst:341 +#: ../../library/functools.rst:290 msgid "" "Return a new :ref:`partial object` which when called will " "behave like *func* called with the positional arguments *args* and keyword " @@ -544,97 +401,20 @@ msgstr "" "は、それらで *keywords* を拡張または上書きします。おおよそ次のコードと等価で" "す::" -#: ../../library/functools.rst:348 -msgid "" -"def partial(func, /, *args, **keywords):\n" -" def newfunc(*more_args, **more_keywords):\n" -" return func(*args, *more_args, **(keywords | more_keywords))\n" -" newfunc.func = func\n" -" newfunc.args = args\n" -" newfunc.keywords = keywords\n" -" return newfunc" -msgstr "" - -#: ../../library/functools.rst:356 +#: ../../library/functools.rst:306 msgid "" -"The :func:`!partial` function is used for partial function application which " +"The :func:`partial` is used for partial function application which " "\"freezes\" some portion of a function's arguments and/or keywords resulting " "in a new object with a simplified signature. For example, :func:`partial` " "can be used to create a callable that behaves like the :func:`int` function " -"where the *base* argument defaults to ``2``:" -msgstr "" - -#: ../../library/functools.rst:362 -msgid "" -">>> basetwo = partial(int, base=2)\n" -">>> basetwo.__doc__ = 'Convert base 2 string to an int.'\n" -">>> basetwo('10010')\n" -"18" -msgstr "" - -#: ../../library/functools.rst:369 -msgid "" -"If :data:`Placeholder` sentinels are present in *args*, they will be filled " -"first when :func:`!partial` is called. This makes it possible to pre-fill " -"any positional argument with a call to :func:`!partial`; without :data:`!" -"Placeholder`, only the chosen number of leading positional arguments can be " -"pre-filled." -msgstr "" - -#: ../../library/functools.rst:374 -msgid "" -"If any :data:`!Placeholder` sentinels are present, all must be filled at " -"call time:" -msgstr "" - -#: ../../library/functools.rst:376 -msgid "" -">>> say_to_world = partial(print, Placeholder, Placeholder, \"world!\")\n" -">>> say_to_world('Hello', 'dear')\n" -"Hello dear world!" -msgstr "" - -#: ../../library/functools.rst:382 -msgid "" -"Calling ``say_to_world('Hello')`` raises a :exc:`TypeError`, because only " -"one positional argument is provided, but there are two placeholders that " -"must be filled in." -msgstr "" - -#: ../../library/functools.rst:386 -msgid "" -"If :func:`!partial` is applied to an existing :func:`!partial` object, :data:" -"`!Placeholder` sentinels of the input object are filled in with new " -"positional arguments. A placeholder can be retained by inserting a new :data:" -"`!Placeholder` sentinel to the place held by a previous :data:`!Placeholder`:" +"where the *base* argument defaults to two:" msgstr "" +"関数 :func:`partial` は、関数の位置引数・キーワード引数の一部を「凍結」した部" +"分適用として使われ、簡素化された引数形式をもった新たなオブジェクトを作り出し" +"ます。例えば、 :func:`partial` を使って *base* 引数のデフォルトが 2 である :" +"func:`int` 関数のように振る舞う呼び出し可能オブジェクトを作ることができます:" -#: ../../library/functools.rst:392 -msgid "" -">>> from functools import partial, Placeholder as _\n" -">>> remove = partial(str.replace, _, _, '')\n" -">>> message = 'Hello, dear dear world!'\n" -">>> remove(message, ' dear')\n" -"'Hello, world!'\n" -">>> remove_dear = partial(remove, _, ' dear')\n" -">>> remove_dear(message)\n" -"'Hello, world!'\n" -">>> remove_first_dear = partial(remove_dear, _, 1)\n" -">>> remove_first_dear(message)\n" -"'Hello, dear world!'" -msgstr "" - -#: ../../library/functools.rst:406 -msgid "" -":data:`!Placeholder` cannot be passed to :func:`!partial` as a keyword " -"argument." -msgstr "" - -#: ../../library/functools.rst:408 -msgid "Added support for :data:`Placeholder` in positional arguments." -msgstr "" - -#: ../../library/functools.rst:413 +#: ../../library/functools.rst:321 msgid "" "Return a new :class:`partialmethod` descriptor which behaves like :class:" "`partial` except that it is designed to be used as a method definition " @@ -644,7 +424,7 @@ msgstr "" "リプタ) を返します。直接呼び出しではなく、メソッド定義としての使用が目的であ" "ることのみが、partial とは異なります。" -#: ../../library/functools.rst:417 +#: ../../library/functools.rst:325 msgid "" "*func* must be a :term:`descriptor` or a callable (objects which are both, " "like normal functions, are handled as descriptors)." @@ -652,7 +432,7 @@ msgstr "" "*func* は、:term:`descriptor` または呼び出し可能オブジェクトである必要があり" "ます (通常の関数など、両方の性質を持つオブジェクトは記述子として扱われます。)" -#: ../../library/functools.rst:420 +#: ../../library/functools.rst:328 msgid "" "When *func* is a descriptor (such as a normal Python function, :func:" "`classmethod`, :func:`staticmethod`, :func:`abstractmethod` or another " @@ -665,7 +445,7 @@ msgstr "" "ンスタンスなど) の場合、 ``__get__`` への呼び出しは下層の記述子に委譲され、返" "り値として適切な :ref:`partial オブジェクト` が返されます。" -#: ../../library/functools.rst:426 +#: ../../library/functools.rst:334 msgid "" "When *func* is a non-descriptor callable, an appropriate bound method is " "created dynamically. This behaves like a normal Python function when used as " @@ -679,60 +459,32 @@ msgstr "" "*keywords* が渡されるよりも前に、 *self* 引数が最初の位置引数として挿入されま" "す。" -#: ../../library/functools.rst:434 -msgid "" -">>> class Cell:\n" -"... def __init__(self):\n" -"... self._alive = False\n" -"... @property\n" -"... def alive(self):\n" -"... return self._alive\n" -"... def set_state(self, state):\n" -"... self._alive = bool(state)\n" -"... set_alive = partialmethod(set_state, True)\n" -"... set_dead = partialmethod(set_state, False)\n" -"...\n" -">>> c = Cell()\n" -">>> c.alive\n" -"False\n" -">>> c.set_alive()\n" -">>> c.alive\n" -"True" -msgstr "" - -#: ../../library/functools.rst:457 +#: ../../library/functools.rst:365 msgid "" "Apply *function* of two arguments cumulatively to the items of *iterable*, " "from left to right, so as to reduce the iterable to a single value. For " "example, ``reduce(lambda x, y: x+y, [1, 2, 3, 4, 5])`` calculates " "``((((1+2)+3)+4)+5)``. The left argument, *x*, is the accumulated value and " "the right argument, *y*, is the update value from the *iterable*. If the " -"optional *initial* is present, it is placed before the items of the iterable " -"in the calculation, and serves as a default when the iterable is empty. If " -"*initial* is not given and *iterable* contains only one item, the first item " -"is returned." -msgstr "" +"optional *initializer* is present, it is placed before the items of the " +"iterable in the calculation, and serves as a default when the iterable is " +"empty. If *initializer* is not given and *iterable* contains only one item, " +"the first item is returned." +msgstr "" +"*iterable* の要素に対して、iterable を単一の値に短縮するような形で 2 つの引数" +"をもつ *function* を左から右に累積的に適用します。例えば、 ``reduce(lambda " +"x, y: x+y, [1, 2, 3, 4, 5])`` は ``((((1+2)+3)+4)+5)`` を計算します。左引数 " +"*x* は累計の値になり、右引数 *y* は ``iterable`` から取り出した更新値になりま" +"す。オプションの *initializer* が存在する場合、計算の際に iterable の先頭に置" +"かれます。また、 iterable が空の場合には標準の値になります。 *initializer* が" +"与えられておらず、 *iterable* が単一の要素しか持っていない場合、最初の要素が" +"返されます。" -#: ../../library/functools.rst:466 +#: ../../library/functools.rst:374 msgid "Roughly equivalent to::" msgstr "およそ次と等価です::" -#: ../../library/functools.rst:468 -msgid "" -"initial_missing = object()\n" -"\n" -"def reduce(function, iterable, /, initial=initial_missing):\n" -" it = iter(iterable)\n" -" if initial is initial_missing:\n" -" value = next(it)\n" -" else:\n" -" value = initial\n" -" for element in it:\n" -" value = function(value, element)\n" -" return value" -msgstr "" - -#: ../../library/functools.rst:480 +#: ../../library/functools.rst:386 msgid "" "See :func:`itertools.accumulate` for an iterator that yields all " "intermediate values." @@ -740,11 +492,7 @@ msgstr "" "全ての中間値を返すイテレータについては :func:`itertools.accumulate` を参照し" "てください。" -#: ../../library/functools.rst:483 -msgid "*initial* is now supported as a keyword argument." -msgstr "" - -#: ../../library/functools.rst:488 +#: ../../library/functools.rst:391 msgid "" "Transform a function into a :term:`single-dispatch ` :term:" "`generic function`." @@ -752,74 +500,30 @@ msgstr "" "関数を :term:`シングルディスパッチ ` :term:`ジェネリック関" "数 ` に変換します。" -#: ../../library/functools.rst:491 +#: ../../library/functools.rst:394 msgid "" "To define a generic function, decorate it with the ``@singledispatch`` " -"decorator. When defining a function using ``@singledispatch``, note that the " -"dispatch happens on the type of the first argument::" -msgstr "" - -#: ../../library/functools.rst:495 -msgid "" -">>> from functools import singledispatch\n" -">>> @singledispatch\n" -"... def fun(arg, verbose=False):\n" -"... if verbose:\n" -"... print(\"Let me just say,\", end=\" \")\n" -"... print(arg)" +"decorator. Note that the dispatch happens on the type of the first argument, " +"create your function accordingly::" msgstr "" +"ジェネリック関数を定義するには、 ``@singledispatch`` デコレータを付けます。" +"ディスパッチは 1 つ目の引数の型で行われることに注意して、関数を次のように作成" +"してください::" -#: ../../library/functools.rst:502 +#: ../../library/functools.rst:405 msgid "" "To add overloaded implementations to the function, use the :func:`register` " -"attribute of the generic function, which can be used as a decorator. For " -"functions annotated with types, the decorator will infer the type of the " -"first argument automatically::" +"attribute of the generic function. It is a decorator. For functions " +"annotated with types, the decorator will infer the type of the first " +"argument automatically::" msgstr "" -"関数にオーバーロード実装を追加するには、デコレータとして使用できる、ジェネ" -"リック関数の :func:`register` 属性を使用します。\n" +"関数にオーバーロード実装を追加するには、ジェネリック関数の :func:`register` " +"属性を使用します。\n" +"この属性はデコレータです。\n" "型アノテーションが付いている関数については、このデコレータは1つ目の引数の型を" "自動的に推測します。" -#: ../../library/functools.rst:507 -msgid "" -">>> @fun.register\n" -"... def _(arg: int, verbose=False):\n" -"... if verbose:\n" -"... print(\"Strength in numbers, eh?\", end=\" \")\n" -"... print(arg)\n" -"...\n" -">>> @fun.register\n" -"... def _(arg: list, verbose=False):\n" -"... if verbose:\n" -"... print(\"Enumerate this:\")\n" -"... for i, elem in enumerate(arg):\n" -"... print(i, elem)" -msgstr "" - -#: ../../library/functools.rst:520 -msgid ":class:`typing.Union` can also be used::" -msgstr "" - -#: ../../library/functools.rst:522 -msgid "" -">>> @fun.register\n" -"... def _(arg: int | float, verbose=False):\n" -"... if verbose:\n" -"... print(\"Strength in numbers, eh?\", end=\" \")\n" -"... print(arg)\n" -"...\n" -">>> from typing import Union\n" -">>> @fun.register\n" -"... def _(arg: Union[list, set], verbose=False):\n" -"... if verbose:\n" -"... print(\"Enumerate this:\")\n" -"... for i, elem in enumerate(arg):\n" -"... print(i, elem)\n" -"..." -msgstr "" - -#: ../../library/functools.rst:537 +#: ../../library/functools.rst:423 msgid "" "For code which doesn't use type annotations, the appropriate type argument " "can be passed explicitly to the decorator itself::" @@ -827,160 +531,57 @@ msgstr "" "型アノテーションを使っていないコードについては、デコレータに適切な型引数を明" "示的に渡せます::" -#: ../../library/functools.rst:540 -msgid "" -">>> @fun.register(complex)\n" -"... def _(arg, verbose=False):\n" -"... if verbose:\n" -"... print(\"Better than complicated.\", end=\" \")\n" -"... print(arg.real, arg.imag)\n" -"..." -msgstr "" - -#: ../../library/functools.rst:547 -msgid "" -"For code that dispatches on a collections type (e.g., ``list``), but wants " -"to typehint the items of the collection (e.g., ``list[int]``), the dispatch " -"type should be passed explicitly to the decorator itself with the typehint " -"going into the function definition::" -msgstr "" - -#: ../../library/functools.rst:552 -msgid "" -">>> @fun.register(list)\n" -"... def _(arg: list[int], verbose=False):\n" -"... if verbose:\n" -"... print(\"Enumerate this:\")\n" -"... for i, elem in enumerate(arg):\n" -"... print(i, elem)" -msgstr "" - -#: ../../library/functools.rst:561 -msgid "" -"At runtime the function will dispatch on an instance of a list regardless of " -"the type contained within the list i.e. ``[1,2,3]`` will be dispatched the " -"same as ``[\"foo\", \"bar\", \"baz\"]``. The annotation provided in this " -"example is for static type checkers only and has no runtime impact." -msgstr "" - -#: ../../library/functools.rst:567 -msgid "" -"To enable registering :term:`lambdas` and pre-existing functions, " -"the :func:`register` attribute can also be used in a functional form::" -msgstr "" -":func:`register` 属性を関数形式で使用すると、:term:`lambda` 関数と既存の関数" -"の登録を有効にできます::" - -#: ../../library/functools.rst:570 +#: ../../library/functools.rst:434 msgid "" -">>> def nothing(arg, verbose=False):\n" -"... print(\"Nothing.\")\n" -"...\n" -">>> fun.register(type(None), nothing)" +"To enable registering lambdas and pre-existing functions, the :func:" +"`register` attribute can be used in a functional form::" msgstr "" +":func:`register` 属性を関数形式で使用すると、lambda 関数と既存の関数の登録を" +"有効にできます::" -#: ../../library/functools.rst:575 +#: ../../library/functools.rst:442 msgid "" -"The :func:`register` attribute returns the undecorated function. This " -"enables decorator stacking, :mod:`pickling`, and the creation of " -"unit tests for each variant independently::" +"The :func:`register` attribute returns the undecorated function which " +"enables decorator stacking, pickling, as well as creating unit tests for " +"each variant independently::" msgstr "" " :func:`register` 属性は、デコレートされていない関数を返します。この関数によ" -"り、複層デコレータ、デコレータの :mod:`pickle 化 `、各変数の独立なユ" -"ニットテストの作成が可能です::" - -#: ../../library/functools.rst:579 -msgid "" -">>> @fun.register(float)\n" -"... @fun.register(Decimal)\n" -"... def fun_num(arg, verbose=False):\n" -"... if verbose:\n" -"... print(\"Half of your number:\", end=\" \")\n" -"... print(arg / 2)\n" -"...\n" -">>> fun_num is fun\n" -"False" -msgstr "" +"り、複層デコレータ、デコレータの pickle 化、各変数の独立なユニットテストの作" +"成が可能です::" -#: ../../library/functools.rst:589 +#: ../../library/functools.rst:456 msgid "" "When called, the generic function dispatches on the type of the first " "argument::" msgstr "汎用関数は、呼び出されると 1 つ目の引数の型でディスパッチします::" -#: ../../library/functools.rst:592 -msgid "" -">>> fun(\"Hello, world.\")\n" -"Hello, world.\n" -">>> fun(\"test.\", verbose=True)\n" -"Let me just say, test.\n" -">>> fun(42, verbose=True)\n" -"Strength in numbers, eh? 42\n" -">>> fun(['spam', 'spam', 'eggs', 'spam'], verbose=True)\n" -"Enumerate this:\n" -"0 spam\n" -"1 spam\n" -"2 eggs\n" -"3 spam\n" -">>> fun(None)\n" -"Nothing.\n" -">>> fun(1.23)\n" -"0.615" -msgstr "" - -#: ../../library/functools.rst:609 +#: ../../library/functools.rst:476 msgid "" "Where there is no registered implementation for a specific type, its method " "resolution order is used to find a more generic implementation. The original " -"function decorated with ``@singledispatch`` is registered for the base :" -"class:`object` type, which means it is used if no better implementation is " -"found." +"function decorated with ``@singledispatch`` is registered for the base " +"``object`` type, which means it is used if no better implementation is found." msgstr "" "特定の型について登録された実装が存在しない場合、その型のメソッド解決順序が、" "汎用の実装をさらに検索するために使用されます。``@singledispatch`` でデコレー" -"トされた元の関数は基底の :class:`object` 型に登録されます。これは、他によりよ" -"い実装が見つからないことを意味します。" +"トされた元の関数は基底の ``object`` 型に登録されます。これは、他によりよい実" +"装が見つからないことを意味します。" -#: ../../library/functools.rst:615 +#: ../../library/functools.rst:482 msgid "" -"If an implementation is registered to an :term:`abstract base class`, " -"virtual subclasses of the base class will be dispatched to that " -"implementation::" +"If an implementation registered to :term:`abstract base class`, virtual " +"subclasses will be dispatched to that implementation::" msgstr "" -"抽象基底クラス (:term:`abstract base class`) に対して実装が登録されると、基底" -"クラスの仮想サブクラスに対してもその実装がディスパッチされます::" -#: ../../library/functools.rst:619 +#: ../../library/functools.rst:496 msgid "" -">>> from collections.abc import Mapping\n" -">>> @fun.register\n" -"... def _(arg: Mapping, verbose=False):\n" -"... if verbose:\n" -"... print(\"Keys & Values\")\n" -"... for key, value in arg.items():\n" -"... print(key, \"=>\", value)\n" -"...\n" -">>> fun({\"a\": \"b\"})\n" -"a => b" -msgstr "" - -#: ../../library/functools.rst:630 -msgid "" -"To check which implementation the generic function will choose for a given " +"To check which implementation will the generic function choose for a given " "type, use the ``dispatch()`` attribute::" msgstr "" "指定された型に対して、汎用関数がどの実装を選択するかを確認するには、" -"``dispatch()`` 属性を使用します::" +"``dispatch()`` 属性を使用します::" -#: ../../library/functools.rst:633 -msgid "" -">>> fun.dispatch(float)\n" -"\n" -">>> fun.dispatch(dict) # note: default implementation\n" -"" -msgstr "" - -#: ../../library/functools.rst:638 +#: ../../library/functools.rst:504 msgid "" "To access all registered implementations, use the read-only ``registry`` " "attribute::" @@ -988,30 +589,12 @@ msgstr "" "登録されたすべての実装にアクセスするには、読み出し専用の ``registry`` 属性を" "使用します::" -#: ../../library/functools.rst:641 -msgid "" -">>> fun.registry.keys()\n" -"dict_keys([, , ,\n" -" , ,\n" -" ])\n" -">>> fun.registry[float]\n" -"\n" -">>> fun.registry[object]\n" -"" -msgstr "" - -#: ../../library/functools.rst:652 -msgid "The :func:`register` attribute now supports using type annotations." +#: ../../library/functools.rst:518 +msgid "The :func:`register` attribute supports using type annotations." msgstr "" ":func:`register` 属性が型アノテーションの使用をサポートするようになりました。" -#: ../../library/functools.rst:655 -msgid "" -"The :func:`register` attribute now supports :class:`typing.Union` as a type " -"annotation." -msgstr "" - -#: ../../library/functools.rst:662 +#: ../../library/functools.rst:524 msgid "" "Transform a method into a :term:`single-dispatch ` :term:" "`generic function`." @@ -1019,74 +602,31 @@ msgstr "" "メソッドを :term:`シングルディスパッチ ` :term:`ジェネリック" "関数 ` に変換します。" -#: ../../library/functools.rst:665 +#: ../../library/functools.rst:527 msgid "" "To define a generic method, decorate it with the ``@singledispatchmethod`` " -"decorator. When defining a function using ``@singledispatchmethod``, note " -"that the dispatch happens on the type of the first non-*self* or non-*cls* " -"argument::" -msgstr "" - -#: ../../library/functools.rst:670 -msgid "" -"class Negator:\n" -" @singledispatchmethod\n" -" def neg(self, arg):\n" -" raise NotImplementedError(\"Cannot negate a\")\n" -"\n" -" @neg.register\n" -" def _(self, arg: int):\n" -" return -arg\n" -"\n" -" @neg.register\n" -" def _(self, arg: bool):\n" -" return not arg" +"decorator. Note that the dispatch happens on the type of the first non-self " +"or non-cls argument, create your function accordingly::" msgstr "" +"ジェネリックメソッドを定義するには、 ``@singledispatchmethod`` デコレータを付" +"けます。ディスパッチは 1 つ目の引数の型で行われることに注意して、関数を次のよ" +"うに作成してください::" -#: ../../library/functools.rst:683 +#: ../../library/functools.rst:544 msgid "" -"``@singledispatchmethod`` supports nesting with other decorators such as :" -"func:`@classmethod`. Note that to allow for ``dispatcher." -"register``, ``singledispatchmethod`` must be the *outer most* decorator. " -"Here is the ``Negator`` class with the ``neg`` methods bound to the class, " -"rather than an instance of the class::" +"``@singledispatchmethod`` supports nesting with other decorators such as " +"``@classmethod``. Note that to allow for ``dispatcher.register``, " +"``singledispatchmethod`` must be the *outer most* decorator. Here is the " +"``Negator`` class with the ``neg`` methods being class bound::" msgstr "" -"``@singledispatchmethod`` は :func:`@classmethod` など他のデコ" -"レータとの入れ子構造をサポートします。 ``dispatcher.register`` を可能にするた" -"めには、 ``singledispatchmethod`` は入れ子構造の中で *最も外側* のデコレータ" -"でなければなりません。この ``Negator`` クラスの例では、クラスのインスタンスに" -"ではなく、クラスに ``neg`` メソッドが紐付きます::" -#: ../../library/functools.rst:689 +#: ../../library/functools.rst:565 msgid "" -"class Negator:\n" -" @singledispatchmethod\n" -" @classmethod\n" -" def neg(cls, arg):\n" -" raise NotImplementedError(\"Cannot negate a\")\n" -"\n" -" @neg.register\n" -" @classmethod\n" -" def _(cls, arg: int):\n" -" return -arg\n" -"\n" -" @neg.register\n" -" @classmethod\n" -" def _(cls, arg: bool):\n" -" return not arg" +"The same pattern can be used for other similar decorators: ``staticmethod``, " +"``abstractmethod``, and others." msgstr "" -#: ../../library/functools.rst:705 -msgid "" -"The same pattern can be used for other similar decorators: :func:" -"`@staticmethod`, :func:`@abstractmethod`, " -"and others." -msgstr "" -"同様のパターンが他の似たようなデコレータに対しても適用できます: :func:" -"`@staticmethod`, :func:`@abstractmethod` な" -"ど。" - -#: ../../library/functools.rst:714 +#: ../../library/functools.rst:573 msgid "" "Update a *wrapper* function to look like the *wrapped* function. The " "optional arguments are tuples to specify which attributes of the original " @@ -1094,15 +634,21 @@ msgid "" "function and which attributes of the wrapper function are updated with the " "corresponding attributes from the original function. The default values for " "these arguments are the module level constants ``WRAPPER_ASSIGNMENTS`` " -"(which assigns to the wrapper function's :attr:`~function.__module__`, :attr:" -"`~function.__name__`, :attr:`~function.__qualname__`, :attr:`~function." -"__annotations__`, :attr:`~function.__type_params__`, and :attr:`~function." -"__doc__`, the documentation string) and ``WRAPPER_UPDATES`` (which updates " -"the wrapper function's :attr:`~function.__dict__`, i.e. the instance " -"dictionary)." -msgstr "" - -#: ../../library/functools.rst:726 +"(which assigns to the wrapper function's ``__module__``, ``__name__``, " +"``__qualname__``, ``__annotations__`` and ``__doc__``, the documentation " +"string) and ``WRAPPER_UPDATES`` (which updates the wrapper function's " +"``__dict__``, i.e. the instance dictionary)." +msgstr "" +"*wrapper* 関数を *wrapped* 関数に見えるようにアップデートします。オプション引" +"数はタプルで、元の関数のどの属性がラッパー関数の対応する属性に直接代入される" +"か、またラッパー関数のどの属性が元の関数の対応する属性でアップデートされる" +"か、を指定します。これらの引数のデフォルト値は、モジュールレベル定数 " +"``WRAPPER_ASSIGNMENTS`` (これはラッパー関数の ``__module__``, ``__name__``, " +"``__qualname__``, ``__annotations__`` そしてドキュメンテーション文字列 " +"``__doc__`` に代入する) と ``WRAPPER_UPDATES`` (これはラッパー関数の " +"``__dict__`` すなわちインスタンス辞書をアップデートする) です。" + +#: ../../library/functools.rst:583 msgid "" "To allow access to the original function for introspection and other " "purposes (e.g. bypassing a caching decorator such as :func:`lru_cache`), " @@ -1113,7 +659,7 @@ msgstr "" "回避) のために元の関数にアクセスできるように、この関数はラップされている関数" "を参照するラッパーに自動的に ``__wrapped__`` 属性を追加します。" -#: ../../library/functools.rst:731 +#: ../../library/functools.rst:588 msgid "" "The main intended use for this function is in :term:`decorator` functions " "which wrap the decorated function and return the wrapper. If the wrapper " @@ -1126,7 +672,7 @@ msgstr "" "すると、返される関数のメタデータは元の関数の定義ではなくラッパー関数の定義を" "反映してしまい、これは通常あまり有益ではありません。" -#: ../../library/functools.rst:737 +#: ../../library/functools.rst:594 msgid "" ":func:`update_wrapper` may be used with callables other than functions. Any " "attributes named in *assigned* or *updated* that are missing from the object " @@ -1140,14 +686,19 @@ msgstr "" "とは試みられません)。しかし、 *updated* で指名された属性がラッパー関数自身に" "存在しないなら :exc:`AttributeError` が送出されます。" -#: ../../library/functools.rst:743 -msgid "" -"The ``__wrapped__`` attribute is now automatically added. The :attr:" -"`~function.__annotations__` attribute is now copied by default. Missing " -"attributes no longer trigger an :exc:`AttributeError`." -msgstr "" +#: ../../library/functools.rst:600 +msgid "Automatic addition of the ``__wrapped__`` attribute." +msgstr "``__wrapped__`` 属性の自動的な追加。" + +#: ../../library/functools.rst:603 +msgid "Copying of the ``__annotations__`` attribute by default." +msgstr "デフォルトで ``__annotations__`` 属性がコピーされます。" + +#: ../../library/functools.rst:606 +msgid "Missing attributes no longer trigger an :exc:`AttributeError`." +msgstr "存在しない属性によって :exc:`AttributeError` を発生しなくなりました。" -#: ../../library/functools.rst:748 +#: ../../library/functools.rst:609 msgid "" "The ``__wrapped__`` attribute now always refers to the wrapped function, " "even if that function defined a ``__wrapped__`` attribute. (see :issue:" @@ -1157,12 +708,7 @@ msgstr "" "``__wrapped__`` が常にラップされた関数を参照するようになりました。(:issue:" "`17482` を参照)" -#: ../../library/functools.rst:753 -msgid "" -"The :attr:`~function.__type_params__` attribute is now copied by default." -msgstr "" - -#: ../../library/functools.rst:759 +#: ../../library/functools.rst:617 msgid "" "This is a convenience function for invoking :func:`update_wrapper` as a " "function decorator when defining a wrapper function. It is equivalent to " @@ -1173,31 +719,7 @@ msgstr "" "して呼び出す便宜関数です。これは ``partial(update_wrapper, wrapped=wrapped, " "assigned=assigned, updated=updated)`` と等価です。例えば::" -#: ../../library/functools.rst:764 -msgid "" -">>> from functools import wraps\n" -">>> def my_decorator(f):\n" -"... @wraps(f)\n" -"... def wrapper(*args, **kwds):\n" -"... print('Calling decorated function')\n" -"... return f(*args, **kwds)\n" -"... return wrapper\n" -"...\n" -">>> @my_decorator\n" -"... def example():\n" -"... \"\"\"Docstring\"\"\"\n" -"... print('Called example function')\n" -"...\n" -">>> example()\n" -"Calling decorated function\n" -"Called example function\n" -">>> example.__name__\n" -"'example'\n" -">>> example.__doc__\n" -"'Docstring'" -msgstr "" - -#: ../../library/functools.rst:785 +#: ../../library/functools.rst:643 msgid "" "Without the use of this decorator factory, the name of the example function " "would have been ``'wrapper'``, and the docstring of the original :func:" @@ -1207,11 +729,11 @@ msgstr "" "``'wrapper'`` となり、元の :func:`example` のドキュメンテーション文字列は失わ" "れてしまいます。" -#: ../../library/functools.rst:793 +#: ../../library/functools.rst:651 msgid ":class:`partial` Objects" msgstr ":class:`partial` オブジェクト" -#: ../../library/functools.rst:795 +#: ../../library/functools.rst:653 msgid "" ":class:`partial` objects are callable objects created by :func:`partial`. " "They have three read-only attributes:" @@ -1219,7 +741,7 @@ msgstr "" ":class:`partial` オブジェクトは、 :func:`partial` 関数によって作られる呼び出" "し可能オブジェクトです。オブジェクトには読み出し専用の属性が三つあります:" -#: ../../library/functools.rst:801 +#: ../../library/functools.rst:659 msgid "" "A callable object or function. Calls to the :class:`partial` object will be " "forwarded to :attr:`func` with new arguments and keywords." @@ -1227,7 +749,7 @@ msgstr "" "呼び出し可能オブジェクトまたは関数です。 :class:`partial` オブジェクトの呼び" "出しは新しい引数とキーワードと共に :attr:`func` に転送されます。" -#: ../../library/functools.rst:807 +#: ../../library/functools.rst:665 msgid "" "The leftmost positional arguments that will be prepended to the positional " "arguments provided to a :class:`partial` object call." @@ -1235,18 +757,25 @@ msgstr "" "最左の位置引数で、 :class:`partial` オブジェクトの呼び出し時にその呼び出しの" "際の位置引数の前に追加されます。" -#: ../../library/functools.rst:813 +#: ../../library/functools.rst:671 msgid "" "The keyword arguments that will be supplied when the :class:`partial` object " "is called." msgstr "" ":class:`partial` オブジェクトの呼び出し時に渡されるキーワード引数です。" -#: ../../library/functools.rst:816 -msgid "" -":class:`partial` objects are like :ref:`function objects ` in that they are callable, weak referenceable, and can have " -"attributes. There are some important differences. For instance, the :attr:" -"`~definition.__name__` and :attr:`~definition.__doc__` attributes are not " -"created automatically." -msgstr "" +#: ../../library/functools.rst:674 +msgid "" +":class:`partial` objects are like :class:`function` objects in that they are " +"callable, weak referencable, and can have attributes. There are some " +"important differences. For instance, the :attr:`~definition.__name__` and :" +"attr:`__doc__` attributes are not created automatically. Also, :class:" +"`partial` objects defined in classes behave like static methods and do not " +"transform into bound methods during instance attribute look-up." +msgstr "" +":class:`partial` オブジェクトは :class:`function` オブジェクトのように呼び出" +"し可能で、弱参照可能で、属性を持つことができます。重要な相違点もあります。例" +"えば、 :attr:`~definition.__name__` と :attr:`__doc__` 両属性は自動では作られ" +"ません。また、クラス中で定義された :class:`partial` オブジェクトはスタティッ" +"クメソッドのように振る舞い、インスタンスの属性問い合わせの中で束縛メソッドに" +"変換されません。" diff --git a/library/gc.po b/library/gc.po index 5411906a6..a4f092f60 100644 --- a/library/gc.po +++ b/library/gc.po @@ -1,32 +1,35 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 -# 石井明久, 2024 -# Arihiro TAKASE, 2024 +# 秘湯 , 2017 +# Inada Naoki , 2017 +# Arihiro TAKASE, 2017 +# Osamu NAKAMURA, 2017 +# tomo, 2019 +# Tetsuo Koyama , 2020 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 01:06+0000\n" -"Last-Translator: Arihiro TAKASE, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-03-18 05:44+0000\n" +"PO-Revision-Date: 2017-02-16 23:12+0000\n" +"Last-Translator: Tetsuo Koyama , 2020\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/gc.rst:2 -msgid ":mod:`!gc` --- Garbage Collector interface" -msgstr ":mod:`!gc` --- ガベージコレクターインターフェース" +msgid ":mod:`gc` --- Garbage Collector interface" +msgstr ":mod:`gc` --- ガベージコレクタインターフェース" #: ../../library/gc.rst:12 msgid "" @@ -44,10 +47,10 @@ msgstr "" "このモジュールは、循環ガベージコレクタの無効化・検出頻度の調整・デバッグオブ" "ションの設定などを行うインターフェースを提供します。また、検出した到達不能オ" "ブジェクトのうち、解放する事ができないオブジェクトを参照する事もできます。循" -"環ガベージコレクタはPythonの参照カウントを補うためのものなので、もしプログラ" -"ム中で循環参照が発生しない事が明らかな場合には検出をする必要はありません。自" -"動検出は、 ``gc.disable()`` で停止する事ができます。メモリリークをデバッグす" -"るときには、 ``gc.set_debug(gc.DEBUG_LEAK)`` とします。これは ``gc." +"環ガベージコレクタはPyhonの参照カウントを補うためのものなので、もしプログラム" +"中で循環参照が発生しない事が明らかな場合には検出をする必要はありません。自動" +"検出は、 ``gc.disable()`` で停止する事ができます。メモリリークをデバッグする" +"ときには、 ``gc.set_debug(gc.DEBUG_LEAK)`` とします。これは ``gc." "DEBUG_SAVEALL`` を含んでいることに注意しましょう。ガベージとして検出されたオ" "ブジェクトは、インスペクション用に gc.garbage に保存されます。" @@ -69,31 +72,18 @@ msgstr "自動ガベージコレクションが有効なら ``True`` を返し #: ../../library/gc.rst:43 msgid "" -"Perform a collection. The optional argument *generation* may be an integer " -"specifying which generation to collect (from 0 to 2). A :exc:`ValueError` " -"is raised if the generation number is invalid. The sum of collected objects " -"and uncollectable objects is returned." +"With no arguments, run a full collection. The optional argument " +"*generation* may be an integer specifying which generation to collect (from " +"0 to 2). A :exc:`ValueError` is raised if the generation number is " +"invalid. The number of unreachable objects found is returned." msgstr "" +"引数を指定しない場合は、全ての検出を行います。オプション引数 *generation* " +"は、どの世代を検出するかを (0 から 2 までの) 整数値で指定します。無効な世代番" +"号を指定した場合は :exc:`ValueError` が発生します。検出した到達不可オブジェク" +"トの数を返します。" #: ../../library/gc.rst:48 msgid "" -"Calling ``gc.collect(0)`` will perform a GC collection on the young " -"generation." -msgstr "" - -#: ../../library/gc.rst:50 -msgid "" -"Calling ``gc.collect(1)`` will perform a GC collection on the young " -"generation and an increment of the old generation." -msgstr "" - -#: ../../library/gc.rst:53 -msgid "" -"Calling ``gc.collect(2)`` or ``gc.collect()`` performs a full collection" -msgstr "" - -#: ../../library/gc.rst:55 -msgid "" "The free lists maintained for a number of built-in types are cleared " "whenever a full collection or collection of the highest generation (2) is " "run. Not all items in some free lists may be freed due to the particular " @@ -103,17 +93,7 @@ msgstr "" "れます。 :class:`float` など、実装によって幾つかの free list では全ての要素が" "解放されるわけではありません。" -#: ../../library/gc.rst:60 -msgid "" -"The effect of calling ``gc.collect()`` while the interpreter is already " -"performing a collection is undefined." -msgstr "" - -#: ../../library/gc.rst:63 -msgid "``generation=1`` performs an increment of collection." -msgstr "" - -#: ../../library/gc.rst:69 +#: ../../library/gc.rst:56 msgid "" "Set the garbage collection debugging flags. Debugging information will be " "written to ``sys.stderr``. See below for a list of debugging flags which " @@ -123,38 +103,22 @@ msgstr "" "stderr`` に出力されます。デバッグフラグは、下の値の組み合わせを指定する事がで" "きます。" -#: ../../library/gc.rst:76 +#: ../../library/gc.rst:63 msgid "Return the debugging flags currently set." msgstr "現在のデバッグフラグを返します。" -#: ../../library/gc.rst:82 +#: ../../library/gc.rst:68 msgid "" "Returns a list of all objects tracked by the collector, excluding the list " -"returned. If *generation* is not ``None``, return only the objects as " -"follows:" +"returned. If *generation* is not None, return only the objects tracked by " +"the collector that are in that generation." msgstr "" -#: ../../library/gc.rst:85 -msgid "0: All objects in the young generation" -msgstr "" - -#: ../../library/gc.rst:86 -msgid "1: No objects, as there is no generation 1 (as of Python 3.13)" -msgstr "" - -#: ../../library/gc.rst:87 -msgid "2: All objects in the old generation" -msgstr "" - -#: ../../library/gc.rst:89 +#: ../../library/gc.rst:72 msgid "New *generation* parameter." msgstr "新しい *generation* パラメータ。" -#: ../../library/gc.rst:92 -msgid "Generation 1 is removed" -msgstr "" - -#: ../../library/gc.rst:95 +#: ../../library/gc.rst:75 msgid "" "Raises an :ref:`auditing event ` ``gc.get_objects`` with argument " "``generation``." @@ -162,7 +126,7 @@ msgstr "" "引数 ``generation`` で :ref:`監査イベント ` ``gc.get_objects`` を送" "出します。 " -#: ../../library/gc.rst:99 +#: ../../library/gc.rst:79 msgid "" "Return a list of three per-generation dictionaries containing collection " "statistics since interpreter start. The number of keys may change in the " @@ -172,17 +136,17 @@ msgstr "" "トを返します。キーの数は将来変わるかもしれませんが、現在のところそれぞれの辞" "書には以下の項目が含まれています:" -#: ../../library/gc.rst:104 +#: ../../library/gc.rst:84 msgid "``collections`` is the number of times this generation was collected;" msgstr "``collections`` は、この世代が検出を行った回数です;" -#: ../../library/gc.rst:106 +#: ../../library/gc.rst:86 msgid "" "``collected`` is the total number of objects collected inside this " "generation;" msgstr "``collected`` は、この世代内で回収されたオブジェクトの総数です;" -#: ../../library/gc.rst:109 +#: ../../library/gc.rst:89 msgid "" "``uncollectable`` is the total number of objects which were found to be " "uncollectable (and were therefore moved to the :data:`garbage` list) inside " @@ -191,7 +155,7 @@ msgstr "" "``uncollectable`` は、この世代内で回収不能であることがわかった (そしてそれゆ" "えに :data:`garbage` リストに移動した) オブジェクトの総数です。" -#: ../../library/gc.rst:118 +#: ../../library/gc.rst:98 msgid "" "Set the garbage collection thresholds (the collection frequency). Setting " "*threshold0* to zero disables collection." @@ -199,59 +163,32 @@ msgstr "" "ガベージコレクションの閾値(検出頻度)を指定します。 *threshold0* を 0 にする" "と、検出は行われません。" -#: ../../library/gc.rst:121 -msgid "" -"The GC classifies objects into two generations depending on whether they " -"have survived a collection. New objects are placed in the young generation. " -"If an object survives a collection it is moved into the old generation." -msgstr "" - -#: ../../library/gc.rst:125 -msgid "" -"In order to decide when to run, the collector keeps track of the number of " -"object allocations and deallocations since the last collection. When the " -"number of allocations minus the number of deallocations exceeds " -"*threshold0*, collection starts. For each collection, all the objects in the " -"young generation and some fraction of the old generation is collected." -msgstr "" - -#: ../../library/gc.rst:131 -msgid "" -"In the free-threaded build, the increase in process memory usage is also " -"checked before running the collector. If the memory usage has not increased " -"by 10% since the last collection and the net number of object allocations " -"has not exceeded 40 times *threshold0*, the collection is not run." -msgstr "" - -#: ../../library/gc.rst:136 -msgid "" -"The fraction of the old generation that is collected is **inversely** " -"proportional to *threshold1*. The larger *threshold1* is, the slower objects " -"in the old generation are collected. For the default value of 10, 1% of the " -"old generation is scanned during each collection." -msgstr "" - -#: ../../library/gc.rst:141 -msgid "*threshold2* is ignored." -msgstr "" - -#: ../../library/gc.rst:143 -msgid "" -"See `Garbage collector design `_ for more information." +#: ../../library/gc.rst:101 +msgid "" +"The GC classifies objects into three generations depending on how many " +"collection sweeps they have survived. New objects are placed in the " +"youngest generation (generation ``0``). If an object survives a collection " +"it is moved into the next older generation. Since generation ``2`` is the " +"oldest generation, objects in that generation remain there after a " +"collection. In order to decide when to run, the collector keeps track of " +"the number object allocations and deallocations since the last collection. " +"When the number of allocations minus the number of deallocations exceeds " +"*threshold0*, collection starts. Initially only generation ``0`` is " +"examined. If generation ``0`` has been examined more than *threshold1* " +"times since generation ``1`` has been examined, then generation ``1`` is " +"examined as well. With the third generation, things are a bit more " +"complicated, see `Collecting the oldest generation `_ for more " +"information." msgstr "" -#: ../../library/gc.rst:145 -msgid "*threshold2* is ignored" -msgstr "" - -#: ../../library/gc.rst:151 +#: ../../library/gc.rst:118 msgid "" "Return the current collection counts as a tuple of ``(count0, count1, " "count2)``." msgstr "現在の検出数を、 ``(count0, count1, count2)`` のタプルで返します。" -#: ../../library/gc.rst:157 +#: ../../library/gc.rst:124 msgid "" "Return the current collection thresholds as a tuple of ``(threshold0, " "threshold1, threshold2)``." @@ -259,7 +196,7 @@ msgstr "" "現在の検出閾値を、 ``(threshold0, threshold1, threshold2)`` のタプルで返しま" "す。" -#: ../../library/gc.rst:163 +#: ../../library/gc.rst:130 msgid "" "Return the list of objects that directly refer to any of objs. This function " "will only locate those containers which support garbage collection; " @@ -271,7 +208,7 @@ msgstr "" "ます。他のオブジェクトを参照していても、ガベージコレクションをサポートしてい" "ない拡張型は含まれません。" -#: ../../library/gc.rst:168 +#: ../../library/gc.rst:135 msgid "" "Note that objects which have already been dereferenced, but which live in " "cycles and have not yet been collected by the garbage collector can be " @@ -283,7 +220,7 @@ msgstr "" "す。有効なオブジェクトのみを取得する場合、 :func:`get_referrers` の前に :" "func:`collect` を呼び出してください。" -#: ../../library/gc.rst:174 +#: ../../library/gc.rst:141 msgid "" "Care must be taken when using objects returned by :func:`get_referrers` " "because some of them could still be under construction and hence in a " @@ -294,7 +231,7 @@ msgstr "" "ある場合があるので、利用する際には注意が必要です。 :func:`get_referrers` をデ" "バッグ以外の目的で利用するのは避けてください。" -#: ../../library/gc.rst:179 +#: ../../library/gc.rst:146 msgid "" "Raises an :ref:`auditing event ` ``gc.get_referrers`` with " "argument ``objs``." @@ -302,7 +239,7 @@ msgstr "" "引数 ``objs`` を指定して :ref:`監査イベント ` ``gc.get_referrers`` " "を送出します。 " -#: ../../library/gc.rst:184 +#: ../../library/gc.rst:151 msgid "" "Return a list of objects directly referred to by any of the arguments. The " "referents returned are those objects visited by the arguments' C-level :c:" @@ -322,7 +259,7 @@ msgstr "" "のあるオブジェクトのみです。従って、例えば整数オブジェクトが直接到達可能で" "あっても、このオブジェクトは戻り値には含まれません。" -#: ../../library/gc.rst:192 +#: ../../library/gc.rst:159 msgid "" "Raises an :ref:`auditing event ` ``gc.get_referents`` with " "argument ``objs``." @@ -330,7 +267,7 @@ msgstr "" "引数 ``objs`` を指定して :ref:`監査イベント ` ``gc.get_referents`` " "を送出します。 " -#: ../../library/gc.rst:196 +#: ../../library/gc.rst:163 msgid "" "Returns ``True`` if the object is currently tracked by the garbage " "collector, ``False`` otherwise. As a general rule, instances of atomic " @@ -348,61 +285,23 @@ msgstr "" "のオーバーヘッドを減らしています。\n" "(例: 全ての key と value がアトミック型の値である dict)" -#: ../../library/gc.rst:203 -msgid "" -">>> gc.is_tracked(0)\n" -"False\n" -">>> gc.is_tracked(\"a\")\n" -"False\n" -">>> gc.is_tracked([])\n" -"True\n" -">>> gc.is_tracked({})\n" -"False\n" -">>> gc.is_tracked({\"a\": 1})\n" -"True" -msgstr "" - -#: ../../library/gc.rst:219 +#: ../../library/gc.rst:188 msgid "" "Returns ``True`` if the given object has been finalized by the garbage " "collector, ``False`` otherwise. ::" msgstr "" -#: ../../library/gc.rst:222 -msgid "" -">>> x = None\n" -">>> class Lazarus:\n" -"... def __del__(self):\n" -"... global x\n" -"... x = self\n" -"...\n" -">>> lazarus = Lazarus()\n" -">>> gc.is_finalized(lazarus)\n" -"False\n" -">>> del lazarus\n" -">>> gc.is_finalized(x)\n" -"True" -msgstr "" - -#: ../../library/gc.rst:240 +#: ../../library/gc.rst:209 msgid "" -"Freeze all the objects tracked by the garbage collector; move them to a " -"permanent generation and ignore them in all the future collections." +"Freeze all the objects tracked by gc - move them to a permanent generation " +"and ignore all the future collections. This can be used before a POSIX " +"fork() call to make the gc copy-on-write friendly or to speed up collection. " +"Also collection before a POSIX fork() call may free pages for future " +"allocation which can cause copy-on-write too so it's advised to disable gc " +"in parent process and freeze before fork and enable gc in child process." msgstr "" -#: ../../library/gc.rst:243 -msgid "" -"If a process will ``fork()`` without ``exec()``, avoiding unnecessary copy-" -"on-write in child processes will maximize memory sharing and reduce overall " -"memory usage. This requires both avoiding creation of freed \"holes\" in " -"memory pages in the parent process and ensuring that GC collections in child " -"processes won't touch the ``gc_refs`` counter of long-lived objects " -"originating in the parent process. To accomplish both, call ``gc.disable()`` " -"early in the parent process, ``gc.freeze()`` right before ``fork()``, and " -"``gc.enable()`` early in child processes." -msgstr "" - -#: ../../library/gc.rst:257 +#: ../../library/gc.rst:221 msgid "" "Unfreeze the objects in the permanent generation, put them back into the " "oldest generation." @@ -410,11 +309,11 @@ msgstr "" "Permanent世代領域にあるオブジェクトを解凍します。つまり、最も古い世代へ戻しま" "す。" -#: ../../library/gc.rst:265 +#: ../../library/gc.rst:229 msgid "Return the number of objects in the permanent generation." msgstr "Permanent世代領域にあるオブジェクトの数を返します。" -#: ../../library/gc.rst:270 +#: ../../library/gc.rst:234 msgid "" "The following variables are provided for read-only access (you can mutate " "the values but should not rebind them):" @@ -422,7 +321,7 @@ msgstr "" "以下の変数は読み出し専用アクセスのために提供されています。(この変数を操作する" "ことはできますが、その値は記憶されません):" -#: ../../library/gc.rst:275 +#: ../../library/gc.rst:239 msgid "" "A list of objects which the collector found to be unreachable but could not " "be freed (uncollectable objects). Starting with Python 3.4, this list " @@ -434,7 +333,7 @@ msgstr "" "ロットを持つ C 拡張型のインスタンスを使っている場合を除き、このリストはほとん" "ど常に空であるはずです。" -#: ../../library/gc.rst:280 +#: ../../library/gc.rst:244 msgid "" "If :const:`DEBUG_SAVEALL` is set, then all unreachable objects will be added " "to this list rather than freed." @@ -442,7 +341,7 @@ msgstr "" ":const:`DEBUG_SAVEALL` が設定されている場合、全ての到達不能オブジェクトは解放" "されずにこのリストに格納されます。" -#: ../../library/gc.rst:283 +#: ../../library/gc.rst:247 msgid "" "If this list is non-empty at :term:`interpreter shutdown`, a :exc:" "`ResourceWarning` is emitted, which is silent by default. If :const:" @@ -454,13 +353,15 @@ msgstr "" "す。 :const:`DEBUG_UNCOLLECTABLE` がセットされていると、加えて回収不能オブ" "ジェクトを出力します。" -#: ../../library/gc.rst:289 +#: ../../library/gc.rst:253 msgid "" -"Following :pep:`442`, objects with a :meth:`~object.__del__` method don't " -"end up in :data:`gc.garbage` anymore." +"Following :pep:`442`, objects with a :meth:`__del__` method don't end up in :" +"attr:`gc.garbage` anymore." msgstr "" +":pep:`442` に従い、 :meth:`__del__` メソッドを持つオブジェクトはもう :attr:" +"`gc.garbage` に行き着くことはありません。" -#: ../../library/gc.rst:295 +#: ../../library/gc.rst:259 msgid "" "A list of callbacks that will be invoked by the garbage collector before and " "after collection. The callbacks will be called with two arguments, *phase* " @@ -469,19 +370,19 @@ msgstr "" "ガベージコレクタの起動前と終了後に呼び出されるコールバック関数のリスト。コー" "ルバックは *phase* と *info* の2つの引数で呼び出されます。" -#: ../../library/gc.rst:299 +#: ../../library/gc.rst:263 msgid "*phase* can be one of two values:" msgstr "*phase* は以下 2 つのいずれかです:" -#: ../../library/gc.rst:301 +#: ../../library/gc.rst:265 msgid "\"start\": The garbage collection is about to start." msgstr "\"start\": ガベージコレクションを始めます。" -#: ../../library/gc.rst:303 +#: ../../library/gc.rst:267 msgid "\"stop\": The garbage collection has finished." msgstr "\"stop\": ガベージコレクションが終了しました。" -#: ../../library/gc.rst:305 +#: ../../library/gc.rst:269 msgid "" "*info* is a dict providing more information for the callback. The following " "keys are currently defined:" @@ -489,18 +390,18 @@ msgstr "" "*info* はコールバックに付加情報を提供する辞書です。現在のところ以下のキーが定" "義されています:" -#: ../../library/gc.rst:308 +#: ../../library/gc.rst:272 msgid "\"generation\": The oldest generation being collected." msgstr "\"generation\": 回収される最も古い世代。" -#: ../../library/gc.rst:310 +#: ../../library/gc.rst:274 msgid "" "\"collected\": When *phase* is \"stop\", the number of objects successfully " "collected." msgstr "" "\"collected\": *phase* が \"stop\" のとき、正常に回収されたオブジェクトの数。" -#: ../../library/gc.rst:313 +#: ../../library/gc.rst:277 msgid "" "\"uncollectable\": When *phase* is \"stop\", the number of objects that " "could not be collected and were put in :data:`garbage`." @@ -508,7 +409,7 @@ msgstr "" "\"uncollectable\": *phase* が \"stop\" のとき、回収出来ずに :data:`garbage` " "リストに入れられたオブジェクトの数。" -#: ../../library/gc.rst:316 +#: ../../library/gc.rst:280 msgid "" "Applications can add their own callbacks to this list. The primary use " "cases are:" @@ -516,7 +417,7 @@ msgstr "" "アプリケーションは自身のコールバックをこのリストに追加出来ます。基本的なユー" "スケースは以下のようなものでしょう:" -#: ../../library/gc.rst:319 +#: ../../library/gc.rst:283 msgid "" "Gathering statistics about garbage collection, such as how often various " "generations are collected, and how long the collection takes." @@ -524,7 +425,7 @@ msgstr "" "世代が回収される頻度やガベージコレクションにかかった時間の長さといった、ガ" "ベージコレクションの統計情報を集めます。" -#: ../../library/gc.rst:323 +#: ../../library/gc.rst:287 msgid "" "Allowing applications to identify and clear their own uncollectable types " "when they appear in :data:`garbage`." @@ -532,22 +433,22 @@ msgstr "" ":data:`garbage` に回収できない独自の型のオブジェクトが現れたとき、アプリケー" "ションがそれらを特定し消去できるようにする。" -#: ../../library/gc.rst:329 +#: ../../library/gc.rst:293 msgid "The following constants are provided for use with :func:`set_debug`:" msgstr "以下は :func:`set_debug` に指定することのできる定数です:" -#: ../../library/gc.rst:334 +#: ../../library/gc.rst:298 msgid "" "Print statistics during collection. This information can be useful when " "tuning the collection frequency." msgstr "" "検出中に統計情報を出力します。この情報は、検出頻度を最適化する際に有益です。" -#: ../../library/gc.rst:340 +#: ../../library/gc.rst:304 msgid "Print information on collectable objects found." msgstr "見つかった回収可能オブジェクトの情報を出力します。" -#: ../../library/gc.rst:345 +#: ../../library/gc.rst:309 msgid "" "Print information of uncollectable objects found (objects which are not " "reachable but cannot be freed by the collector). These objects will be " @@ -557,7 +458,7 @@ msgstr "" "事ができないオブジェクト)の情報を出力します。回収不能オブジェクトは、 " "``garbage`` リストに追加されます。" -#: ../../library/gc.rst:349 +#: ../../library/gc.rst:313 msgid "" "Also print the contents of the :data:`garbage` list at :term:`interpreter " "shutdown`, if it isn't empty." @@ -565,7 +466,7 @@ msgstr "" ":term:`インタプリタシャットダウン ` 時に :data:" "`garbage` リストが空でない場合に、その中身の出力も行います。" -#: ../../library/gc.rst:355 +#: ../../library/gc.rst:319 msgid "" "When set, all unreachable objects found will be appended to *garbage* rather " "than being freed. This can be useful for debugging a leaking program." @@ -573,7 +474,7 @@ msgstr "" "設定されている場合、全ての到達不能オブジェクトは解放されずに *garbage* に追加" "されます。これはプログラムのメモリリークをデバッグするときに便利です。" -#: ../../library/gc.rst:361 +#: ../../library/gc.rst:325 msgid "" "The debugging flags necessary for the collector to print information about a " "leaking program (equal to ``DEBUG_COLLECTABLE | DEBUG_UNCOLLECTABLE | " diff --git a/library/getopt.po b/library/getopt.po index 6ad8d350a..3cd00df32 100644 --- a/library/getopt.po +++ b/library/getopt.po @@ -1,30 +1,32 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 +# Arihiro TAKASE, 2017 +# Masato HASHIMOTO , 2017 +# Osamu NAKAMURA, 2021 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 01:06+0000\n" -"Last-Translator: tomo, 2021\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 23:12+0000\n" +"Last-Translator: Osamu NAKAMURA, 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/getopt.rst:2 -msgid ":mod:`!getopt` --- C-style parser for command line options" -msgstr "" +msgid ":mod:`getopt` --- C-style parser for command line options" +msgstr ":mod:`getopt` --- C 言語スタイルのコマンドラインオプションパーサ" #: ../../library/getopt.rst:8 msgid "**Source code:** :source:`Lib/getopt.py`" @@ -32,70 +34,82 @@ msgstr "**ソースコード:** :source:`Lib/getopt.py`" #: ../../library/getopt.rst:12 msgid "" -"This module is considered feature complete. A more declarative and " -"extensible alternative to this API is provided in the :mod:`optparse` " -"module. Further functional enhancements for command line parameter " -"processing are provided either as third party modules on PyPI, or else as " -"features in the :mod:`argparse` module." +"The :mod:`getopt` module is a parser for command line options whose API is " +"designed to be familiar to users of the C :c:func:`getopt` function. Users " +"who are unfamiliar with the C :c:func:`getopt` function or who would like to " +"write less code and get better help and error messages should consider using " +"the :mod:`argparse` module instead." msgstr "" +":mod:`getopt` モジュールは、C 言語の :c:func:`getopt` 関数に慣れ親しんだ人た" +"めにデザインされた API を持つコマンドラインオプションのパーサです。:c:func:" +"`getopt` 関数に慣れ親しんでない人や、コードを少なくしてよりよいヘルプメッセー" +"ジを表示させたい場合は、:mod:`argparse` モジュールの使用を検討してください。" #: ../../library/getopt.rst:20 msgid "" "This module helps scripts to parse the command line arguments in ``sys." -"argv``. It supports the same conventions as the Unix :c:func:`!getopt` " +"argv``. It supports the same conventions as the Unix :c:func:`getopt` " "function (including the special meanings of arguments of the form '``-``' " "and '``--``'). Long options similar to those supported by GNU software may " "be used as well via an optional third argument." msgstr "" +"このモジュールは ``sys.argv`` に入っているコマンドラインオプションの構文解析" +"を支援します。'``-``' や '``--``' の特別扱いも含めて、Unix の :c:func:" +"`getopt` と同じ記法をサポートしています。3番目の引数 (省略可能) を設定するこ" +"とで、GNU のソフトウェアでサポートされているような長形式のオプションも利用で" +"きます。" #: ../../library/getopt.rst:26 -msgid "" -"Users who are unfamiliar with the Unix :c:func:`!getopt` function should " -"consider using the :mod:`argparse` module instead. Users who are familiar " -"with the Unix :c:func:`!getopt` function, but would like to get equivalent " -"behavior while writing less code and getting better help and error messages " -"should consider using the :mod:`optparse` module. See :ref:`choosing-an-" -"argument-parser` for additional details." -msgstr "" - -#: ../../library/getopt.rst:33 msgid "This module provides two functions and an exception:" msgstr "このモジュールは2つの関数と1つの例外を提供しています:" -#: ../../library/getopt.rst:39 +#: ../../library/getopt.rst:32 msgid "" "Parses command line options and parameter list. *args* is the argument list " "to be parsed, without the leading reference to the running program. " "Typically, this means ``sys.argv[1:]``. *shortopts* is the string of option " "letters that the script wants to recognize, with options that require an " -"argument followed by a colon (``':'``) and options that accept an optional " -"argument followed by two colons (``'::'``); i.e., the same format that Unix :" -"c:func:`!getopt` uses." +"argument followed by a colon (``':'``; i.e., the same format that Unix :c:" +"func:`getopt` uses)." msgstr "" +"コマンドラインオプションとパラメータのリストを構文解析します。*args* は構文解" +"析の対象になる引数のリストです。これは先頭のプログラム名を除いたもので、通常 " +"``sys.argv[1:]`` で与えられます。*shortopts* はスクリプトで認識させたいオプ" +"ション文字と、引数が必要な場合にはコロン (``':'``) をつけます。つまり Unix " +"の :c:func:`getopt` と同じフォーマットになります。" -#: ../../library/getopt.rst:48 +#: ../../library/getopt.rst:40 msgid "" -"Unlike GNU :c:func:`!getopt`, after a non-option argument, all further " +"Unlike GNU :c:func:`getopt`, after a non-option argument, all further " "arguments are considered also non-options. This is similar to the way non-" "GNU Unix systems work." msgstr "" +"GNU の :c:func:`getopt` とは違って、オプションでない引数の後は全てオプション" +"ではないと判断されます。これは GNUでない、Unix システムの挙動に近いものです。" -#: ../../library/getopt.rst:52 +#: ../../library/getopt.rst:44 msgid "" "*longopts*, if specified, must be a list of strings with the names of the " "long options which should be supported. The leading ``'--'`` characters " "should not be included in the option name. Long options which require an " -"argument should be followed by an equal sign (``'='``). Long options which " -"accept an optional argument should be followed by an equal sign and question " -"mark (``'=?'``). To accept only long options, *shortopts* should be an empty " -"string. Long options on the command line can be recognized so long as they " -"provide a prefix of the option name that matches exactly one of the accepted " -"options. For example, if *longopts* is ``['foo', 'frob']``, the option ``--" -"fo`` will match as ``--foo``, but ``--f`` will not match uniquely, so :exc:" -"`GetoptError` will be raised." -msgstr "" - -#: ../../library/getopt.rst:65 +"argument should be followed by an equal sign (``'='``). Optional arguments " +"are not supported. To accept only long options, *shortopts* should be an " +"empty string. Long options on the command line can be recognized so long as " +"they provide a prefix of the option name that matches exactly one of the " +"accepted options. For example, if *longopts* is ``['foo', 'frob']``, the " +"option ``--fo`` will match as ``--foo``, but ``--f`` will not match " +"uniquely, so :exc:`GetoptError` will be raised." +msgstr "" +"*longopts* は長形式のオプションの名前を示す文字列のリストです。名前には、先頭" +"の ``'--'`` は含めません。引数が必要な場合には名前の最後に等号 (``'='``) を入" +"れます。オプション引数はサポートしていません。長形式のオプションだけを受けつ" +"けるためには、*shortopts* は空文字列である必要があります。長形式のオプション" +"は、該当するオプションを一意に決定できる長さまで入力されていれば認識されま" +"す。たとえば、*longopts* が ``['foo', 'frob']`` の場合、``--fo`` は ``--" +"foo`` にマッチしますが、``--f`` では一意に決定できないので、:exc:" +"`GetoptError` が送出されます。" + +#: ../../library/getopt.rst:55 msgid "" "The return value consists of two elements: the first is a list of ``(option, " "value)`` pairs; the second is the list of program arguments left after the " @@ -116,11 +130,7 @@ msgstr "" "順に並んでいて、複数回同じオプションを指定できます。長形式と短形式のオプショ" "ンは混在できます。" -#: ../../library/getopt.rst:75 -msgid "Optional arguments are supported." -msgstr "" - -#: ../../library/getopt.rst:81 +#: ../../library/getopt.rst:68 msgid "" "This function works like :func:`getopt`, except that GNU style scanning mode " "is used by default. This means that option and non-option arguments may be " @@ -132,207 +142,64 @@ msgstr "" "混在させることができます。:func:`getopt` 関数はオプションでない引数を見つける" "と解析を停止します。" -#: ../../library/getopt.rst:86 +#: ../../library/getopt.rst:73 msgid "" "If the first character of the option string is ``'+'``, or if the " -"environment variable :envvar:`!POSIXLY_CORRECT` is set, then option " +"environment variable :envvar:`POSIXLY_CORRECT` is set, then option " "processing stops as soon as a non-option argument is encountered." msgstr "" +"オプション文字列の最初の文字を ``'+'`` にするか、環境変数 :envvar:" +"`POSIXLY_CORRECT` を設定することで、オプションでない引数を見つけると解析を停" +"止するように振舞いを変えることができます。" -#: ../../library/getopt.rst:90 -msgid "" -"If the first character of the option string is ``'-'``, non-option arguments " -"that are followed by options are added to the list of option-and-value pairs " -"as a pair that has ``None`` as its first element and the list of non-option " -"arguments as its second element. The second element of the :func:`!" -"gnu_getopt` result is a list of program arguments after the last option." -msgstr "" - -#: ../../library/getopt.rst:97 -msgid "" -"Support for returning intermixed options and non-option arguments in order." -msgstr "" - -#: ../../library/getopt.rst:103 +#: ../../library/getopt.rst:80 msgid "" "This is raised when an unrecognized option is found in the argument list or " "when an option requiring an argument is given none. The argument to the " "exception is a string indicating the cause of the error. For long options, " "an argument given to an option which does not require one will also cause " -"this exception to be raised. The attributes :attr:`!msg` and :attr:`!opt` " +"this exception to be raised. The attributes :attr:`msg` and :attr:`opt` " "give the error message and related option; if there is no specific option to " -"which the exception relates, :attr:`!opt` is an empty string." +"which the exception relates, :attr:`opt` is an empty string." msgstr "" +"引数リストの中に認識できないオプションがあった場合か、引数が必要なオプション" +"に引数が与えられなかった場合に発生します。例外の引数は原因を示す文字列です。" +"長形式のオプションについては、不要な引数が与えられた場合にもこの例外が発生し" +"ます。 :attr:`msg` 属性と :attr:`opt` 属性で、エラーメッセージと関連するオプ" +"ションを取得できます。特に関係するオプションが無い場合には :attr:`opt` は空文" +"字列となります。" -#: ../../library/getopt.rst:114 +#: ../../library/getopt.rst:91 msgid "Alias for :exc:`GetoptError`; for backward compatibility." msgstr "" ":exc:`GetoptError` へのエイリアスです。後方互換性のために残されています。" -#: ../../library/getopt.rst:116 +#: ../../library/getopt.rst:93 msgid "An example using only Unix style options:" msgstr "Unix スタイルのオプションを使った例です:" -#: ../../library/getopt.rst:118 -msgid "" -">>> import getopt\n" -">>> args = '-a -b -cfoo -d bar a1 a2'.split()\n" -">>> args\n" -"['-a', '-b', '-cfoo', '-d', 'bar', 'a1', 'a2']\n" -">>> optlist, args = getopt.getopt(args, 'abc:d:')\n" -">>> optlist\n" -"[('-a', ''), ('-b', ''), ('-c', 'foo'), ('-d', 'bar')]\n" -">>> args\n" -"['a1', 'a2']" -msgstr "" - -#: ../../library/getopt.rst:130 +#: ../../library/getopt.rst:105 msgid "Using long option names is equally easy:" msgstr "長形式のオプションを使っても同様です:" -#: ../../library/getopt.rst:132 -msgid "" -">>> s = '--condition=foo --testing --output-file abc.def -x a1 a2'\n" -">>> args = s.split()\n" -">>> args\n" -"['--condition=foo', '--testing', '--output-file', 'abc.def', '-x', 'a1', " -"'a2']\n" -">>> optlist, args = getopt.getopt(args, 'x', [\n" -"... 'condition=', 'output-file=', 'testing'])\n" -">>> optlist\n" -"[('--condition', 'foo'), ('--testing', ''), ('--output-file', 'abc.def'), ('-" -"x', '')]\n" -">>> args\n" -"['a1', 'a2']" -msgstr "" - -#: ../../library/getopt.rst:145 -msgid "Optional arguments should be specified explicitly:" -msgstr "" +#: ../../library/getopt.rst:118 +msgid "In a script, typical usage is something like this::" +msgstr "スクリプト中での典型的な使い方は以下のようになります::" #: ../../library/getopt.rst:147 msgid "" -">>> s = '-Con -C --color=off --color a1 a2'\n" -">>> args = s.split()\n" -">>> args\n" -"['-Con', '-C', '--color=off', '--color', 'a1', 'a2']\n" -">>> optlist, args = getopt.getopt(args, 'C::', ['color=?'])\n" -">>> optlist\n" -"[('-C', 'on'), ('-C', ''), ('--color', 'off'), ('--color', '')]\n" -">>> args\n" -"['a1', 'a2']" -msgstr "" - -#: ../../library/getopt.rst:159 -msgid "The order of options and non-option arguments can be preserved:" -msgstr "" - -#: ../../library/getopt.rst:161 -msgid "" -">>> s = 'a1 -x a2 a3 a4 --long a5 a6'\n" -">>> args = s.split()\n" -">>> args\n" -"['a1', '-x', 'a2', 'a3', 'a4', '--long', 'a5', 'a6']\n" -">>> optlist, args = getopt.gnu_getopt(args, '-x:', ['long='])\n" -">>> optlist\n" -"[(None, ['a1']), ('-x', 'a2'), (None, ['a3', 'a4']), ('--long', 'a5')]\n" -">>> args\n" -"['a6']" -msgstr "" - -#: ../../library/getopt.rst:173 -msgid "In a script, typical usage is something like this:" -msgstr "" - -#: ../../library/getopt.rst:175 -msgid "" -"import getopt, sys\n" -"\n" -"def main():\n" -" try:\n" -" opts, args = getopt.getopt(sys.argv[1:], \"ho:v\", [\"help\", " -"\"output=\"])\n" -" except getopt.GetoptError as err:\n" -" # print help information and exit:\n" -" print(err) # will print something like \"option -a not " -"recognized\"\n" -" usage()\n" -" sys.exit(2)\n" -" output = None\n" -" verbose = False\n" -" for o, a in opts:\n" -" if o == \"-v\":\n" -" verbose = True\n" -" elif o in (\"-h\", \"--help\"):\n" -" usage()\n" -" sys.exit()\n" -" elif o in (\"-o\", \"--output\"):\n" -" output = a\n" -" else:\n" -" assert False, \"unhandled option\"\n" -" process(args, output=output, verbose=verbose)\n" -"\n" -"if __name__ == \"__main__\":\n" -" main()" -msgstr "" - -#: ../../library/getopt.rst:204 -msgid "" "Note that an equivalent command line interface could be produced with less " "code and more informative help and error messages by using the :mod:" -"`optparse` module:" +"`argparse` module::" msgstr "" +":mod:`argparse` モジュールを使えば、より良いヘルプメッセージとエラーメッセー" +"ジを持った同じコマンドラインインターフェースをより少ないコードで実現できま" +"す::" -#: ../../library/getopt.rst:207 -msgid "" -"import optparse\n" -"\n" -"if __name__ == '__main__':\n" -" parser = optparse.OptionParser()\n" -" parser.add_option('-o', '--output')\n" -" parser.add_option('-v', dest='verbose', action='http://github.com/store_true')\n" -" opts, args = parser.parse_args()\n" -" process(args, output=opts.output, verbose=opts.verbose)" -msgstr "" - -#: ../../library/getopt.rst:218 -msgid "" -"A roughly equivalent command line interface for this case can also be " -"produced by using the :mod:`argparse` module:" -msgstr "" - -#: ../../library/getopt.rst:221 -msgid "" -"import argparse\n" -"\n" -"if __name__ == '__main__':\n" -" parser = argparse.ArgumentParser()\n" -" parser.add_argument('-o', '--output')\n" -" parser.add_argument('-v', dest='verbose', action='http://github.com/store_true')\n" -" parser.add_argument('rest', nargs='*')\n" -" args = parser.parse_args()\n" -" process(args.rest, output=args.output, verbose=args.verbose)" -msgstr "" - -#: ../../library/getopt.rst:233 -msgid "" -"See :ref:`choosing-an-argument-parser` for details on how the ``argparse`` " -"version of this code differs in behaviour from the ``optparse`` (and " -"``getopt``) version." -msgstr "" - -#: ../../library/getopt.rst:239 -msgid "Module :mod:`optparse`" -msgstr "" - -#: ../../library/getopt.rst:240 -msgid "Declarative command line option parsing." -msgstr "" - -#: ../../library/getopt.rst:242 +#: ../../library/getopt.rst:162 msgid "Module :mod:`argparse`" msgstr ":mod:`argparse` モジュール" -#: ../../library/getopt.rst:243 -msgid "More opinionated command line option and argument parsing library." -msgstr "" +#: ../../library/getopt.rst:163 +msgid "Alternative command line option and argument parsing library." +msgstr "別のコマンドラインオプションと引数の解析ライブラリ。" diff --git a/library/getpass.po b/library/getpass.po index 39b438dae..0bdf4bdf2 100644 --- a/library/getpass.po +++ b/library/getpass.po @@ -1,53 +1,42 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 -# 石井明久, 2024 +# Arihiro TAKASE, 2017 +# Nozomu Kaneko , 2017 +# Nakamura Masahito , 2018 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 01:06+0000\n" -"Last-Translator: 石井明久, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 23:12+0000\n" +"Last-Translator: Nakamura Masahito , 2018\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/getpass.rst:2 -msgid ":mod:`!getpass` --- Portable password input" -msgstr ":mod:`!getpass` --- 可搬性のあるパスワード入力機構" +msgid ":mod:`getpass` --- Portable password input" +msgstr ":mod:`getpass` --- 可搬性のあるパスワード入力機構" #: ../../library/getpass.rst:11 msgid "**Source code:** :source:`Lib/getpass.py`" msgstr "**ソースコード:** :source:`Lib/getpass.py`" -#: ../../includes/wasm-notavail.rst:3 -msgid "Availability" -msgstr "" - -#: ../../includes/wasm-notavail.rst:5 -msgid "" -"This module does not work or is not available on WebAssembly. See :ref:`wasm-" -"availability` for more information." -msgstr "" -"このモジュールは WebAssembly では動作しないか、利用不可です。詳しくは、:ref:" -"`wasm-availability` を見てください。" - -#: ../../library/getpass.rst:17 +#: ../../library/getpass.rst:15 msgid "The :mod:`getpass` module provides two functions:" msgstr ":mod:`getpass` モジュールは二つの関数を提供します:" -#: ../../library/getpass.rst:21 +#: ../../library/getpass.rst:20 msgid "" "Prompt the user for a password without echoing. The user is prompted using " "the string *prompt*, which defaults to ``'Password: '``. On Unix, the " @@ -63,16 +52,7 @@ msgstr "" "tty`)か、それが利用できない場合は ``sys.stderr`` です (この引数は Windowsでは" "無視されます)。" -#: ../../library/getpass.rst:28 -msgid "" -"The *echo_char* argument controls how user input is displayed while typing. " -"If *echo_char* is ``None`` (default), input remains hidden. Otherwise, " -"*echo_char* must be a printable ASCII string and each typed character is " -"replaced by it. For example, ``echo_char='*'`` will display asterisks " -"instead of the actual input." -msgstr "" - -#: ../../library/getpass.rst:34 +#: ../../library/getpass.rst:27 msgid "" "If echo free input is unavailable getpass() falls back to printing a warning " "message to *stream* and reading from ``sys.stdin`` and issuing a :exc:" @@ -82,7 +62,7 @@ msgstr "" "メッセージを出力し、 ``sys.stdin`` から読み込み、 :exc:`GetPassWarning` 警告" "を発生させます。" -#: ../../library/getpass.rst:39 +#: ../../library/getpass.rst:32 msgid "" "If you call getpass from within IDLE, the input may be done in the terminal " "you launched IDLE from rather than the idle window itself." @@ -90,38 +70,30 @@ msgstr "" "IDLE から getpass を呼び出した場合、入力はIDLEのウィンドウではなく、IDLE を起" "動したターミナルから行われます。" -#: ../../library/getpass.rst:42 -msgid "Added the *echo_char* parameter for keyboard feedback." -msgstr "" - -#: ../../library/getpass.rst:47 +#: ../../library/getpass.rst:37 msgid "A :exc:`UserWarning` subclass issued when password input may be echoed." msgstr "" ":exc:`UserWarning` のサブクラスで、入力がエコーされてしまった場合に発生しま" "す。" -#: ../../library/getpass.rst:52 +#: ../../library/getpass.rst:42 msgid "Return the \"login name\" of the user." msgstr "ユーザーの \"ログイン名\"を返します。" -#: ../../library/getpass.rst:54 +#: ../../library/getpass.rst:44 msgid "" "This function checks the environment variables :envvar:`LOGNAME`, :envvar:" -"`USER`, :envvar:`!LNAME` and :envvar:`USERNAME`, in order, and returns the " +"`USER`, :envvar:`LNAME` and :envvar:`USERNAME`, in order, and returns the " "value of the first one which is set to a non-empty string. If none are set, " "the login name from the password database is returned on systems which " -"support the :mod:`pwd` module, otherwise, an :exc:`OSError` is raised." +"support the :mod:`pwd` module, otherwise, an exception is raised." msgstr "" -"この関数は環境変数 :envvar:`LOGNAME` :envvar:`USER` :envvar:`!LNAME` :envvar:" +"この関数は環境変数 :envvar:`LOGNAME` :envvar:`USER` :envvar:`LNAME` :envvar:" "`USERNAME` の順序でチェックして、最初の空ではない文字列が設定された値を返しま" "す。もし、なにも設定されていない場合は :mod:`pwd` モジュールが提供するシステ" -"ム上のパスワードデータベースから返します。それ以外の場合は、 :exc:" -"`OSError` が送出されます。" - -#: ../../library/getpass.rst:61 -msgid "In general, this function should be preferred over :func:`os.getlogin`." -msgstr "" +"ム上のパスワードデータベースから返します。それ以外は、例外が上がります。" -#: ../../library/getpass.rst:63 -msgid "Previously, various exceptions beyond just :exc:`OSError` were raised." -msgstr "以前は :exc:`OSError` だけでなく、様々な例外が送出されていました。" +#: ../../library/getpass.rst:51 +msgid "" +"In general, this function should be preferred over :func:`os.getlogin()`." +msgstr "一般的に、この関数は :func:`os.getlogin()` よりも優先されるべきです。" diff --git a/library/gettext.po b/library/gettext.po index 527968ba7..0d0af33cb 100644 --- a/library/gettext.po +++ b/library/gettext.po @@ -1,37 +1,36 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: +# 秘湯 , 2017 +# E. Kawashima, 2017 +# Nozomu Kaneko , 2017 +# Arihiro TAKASE, 2017 +# tomo, 2018 # Takanori Suzuki , 2021 # Osamu NAKAMURA, 2021 -# tomo, 2023 -# Nozomu Kaneko , 2023 -# Arihiro TAKASE, 2023 -# Rafael Fontenelle , 2023 -# 石井明久, 2024 -# Takeshi Nakazato, 2024 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 01:06+0000\n" -"Last-Translator: Takeshi Nakazato, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 23:12+0000\n" +"Last-Translator: Osamu NAKAMURA, 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/gettext.rst:2 -msgid ":mod:`!gettext` --- Multilingual internationalization services" -msgstr ":mod:`!gettext` --- 多言語国際化サービス" +msgid ":mod:`gettext` --- Multilingual internationalization services" +msgstr ":mod:`gettext` --- 多言語対応に関する国際化サービス" #: ../../library/gettext.rst:10 msgid "**Source code:** :source:`Lib/gettext.py`" @@ -112,6 +111,19 @@ msgstr "" #: ../../library/gettext.rst:51 msgid "" +"Bind the *domain* to *codeset*, changing the encoding of byte strings " +"returned by the :func:`lgettext`, :func:`ldgettext`, :func:`lngettext` and :" +"func:`ldngettext` functions. If *codeset* is omitted, then the current " +"binding is returned." +msgstr "" +"*domain* を *codeset* に対応付け、 :func:`lgettext`, :func:`ldgettext`, :" +"func:`lngettext`, :func:`ldngettext` 関数が返すバイト文字列のエンコード方式を" +"変更します。\n" +"*codeset* が省略された場合は、現在 *domain* に対応付けられているコードセット" +"を返します。" + +#: ../../library/gettext.rst:61 +msgid "" "Change or query the current global domain. If *domain* is ``None``, then " "the current global domain is returned, otherwise the global domain is set to " "*domain*, which is returned." @@ -121,20 +133,24 @@ msgstr "" "場合には、グローバルドメインに *domain* を設定し、その設定されたグローバルド" "メインを返します。" -#: ../../library/gettext.rst:59 +#: ../../library/gettext.rst:69 msgid "" "Return the localized translation of *message*, based on the current global " "domain, language, and locale directory. This function is usually aliased " -"as :func:`!_` in the local namespace (see examples below)." +"as :func:`_` in the local namespace (see examples below)." msgstr "" +"現在のグローバルドメイン、言語、およびロケールディレクトリに基づいて、 " +"*message* の地域化された訳文を返します。\n" +"通常、この関数はローカルな名前空間にある :func:`_` という別名を持ちます (下の" +"例を参照してください)。" -#: ../../library/gettext.rst:66 +#: ../../library/gettext.rst:76 msgid "" "Like :func:`.gettext`, but look the message up in the specified *domain*." msgstr "" ":func:`.gettext` と同様ですが、指定された *domain* からメッセージを探します。" -#: ../../library/gettext.rst:71 +#: ../../library/gettext.rst:81 msgid "" "Like :func:`.gettext`, but consider plural forms. If a translation is found, " "apply the plural formula to *n*, and return the resulting message (some " @@ -147,7 +163,7 @@ msgstr "" "翻訳が見つからなかった場合、 *n* が 1 なら *singular* を返します; そうでない" "場合 *plural* を返します。" -#: ../../library/gettext.rst:76 +#: ../../library/gettext.rst:86 msgid "" "The Plural formula is taken from the catalog header. It is a C or Python " "expression that has a free variable *n*; the expression evaluates to the " @@ -163,44 +179,67 @@ msgstr "" "いては `GNU gettext ドキュメント `__ を参照してください。" -#: ../../library/gettext.rst:86 +#: ../../library/gettext.rst:96 msgid "" "Like :func:`ngettext`, but look the message up in the specified *domain*." msgstr "" ":func:`ngettext` と同様ですが、指定された *domain* からメッセージを探します。" -#: ../../library/gettext.rst:94 +#: ../../library/gettext.rst:104 msgid "" "Similar to the corresponding functions without the ``p`` in the prefix (that " "is, :func:`gettext`, :func:`dgettext`, :func:`ngettext`, :func:`dngettext`), " "but the translation is restricted to the given message *context*." msgstr "" -#: ../../library/gettext.rst:101 +#: ../../library/gettext.rst:116 msgid "" -"Note that GNU :program:`gettext` also defines a :func:`!dcgettext` method, " -"but this was deemed not useful and so it is currently unimplemented." +"Equivalent to the corresponding functions without the ``l`` prefix (:func:`." +"gettext`, :func:`dgettext`, :func:`ngettext` and :func:`dngettext`), but the " +"translation is returned as a byte string encoded in the preferred system " +"encoding if no other encoding was explicitly set with :func:" +"`bind_textdomain_codeset`." msgstr "" +"それぞれに対応する先頭の ``l`` が無い関数 (:func:`.gettext`, :func:" +"`dgettext`, :func:`ngettext`, :func:`dngettext`) と同じですが、エンコーディン" +"グが :func:`bind_textdomain_codeset` を使って明示的に設定されていない場合、翻" +"訳結果は優先システムエンコーディングでエンコードされたバイト文字列として返さ" +"れます。" -#: ../../library/gettext.rst:104 -msgid "Here's an example of typical usage for this API::" -msgstr "以下にこの API の典型的な使用法を示します::" +#: ../../library/gettext.rst:124 +msgid "" +"These functions should be avoided in Python 3, because they return encoded " +"bytes. It's much better to use alternatives which return Unicode strings " +"instead, since most Python applications will want to manipulate human " +"readable text as strings instead of bytes. Further, it's possible that you " +"may get unexpected Unicode-related exceptions if there are encoding problems " +"with the translated strings." +msgstr "" +"これらの関数はエンコードされたバイト列を返すため Python 3 で使うのは避けるべ" +"きです。\n" +"ほとんどの Python アプリケーションでは、人間が読むテキストをバイト列ではなく" +"文字列として扱いたいので、 Unicode 文字列を返す代わりの関数を使う方が良いで" +"す。\n" +"さらに言うと、翻訳文字列にエンコーディング上の問題があった場合、 Unicode 関連" +"の予期しない例外を受け取るかもしれません。" -#: ../../library/gettext.rst:106 +#: ../../library/gettext.rst:134 msgid "" -"import gettext\n" -"gettext.bindtextdomain('myapplication', '/path/to/my/language/directory')\n" -"gettext.textdomain('myapplication')\n" -"_ = gettext.gettext\n" -"# ...\n" -"print(_('This is a translatable string.'))" +"Note that GNU :program:`gettext` also defines a :func:`dcgettext` method, " +"but this was deemed not useful and so it is currently unimplemented." msgstr "" +"GNU :program:`gettext` では :func:`dcgettext` も定義していますが、このメソッ" +"ドはあまり有用ではないと思われるので、現在のところ実装されていません。" + +#: ../../library/gettext.rst:137 +msgid "Here's an example of typical usage for this API::" +msgstr "以下にこの API の典型的な使用法を示します::" -#: ../../library/gettext.rst:115 +#: ../../library/gettext.rst:148 msgid "Class-based API" msgstr "クラス形式の API" -#: ../../library/gettext.rst:117 +#: ../../library/gettext.rst:150 msgid "" "The class-based API of the :mod:`gettext` module gives you more flexibility " "and greater convenience than the GNU :program:`gettext` API. It is the " @@ -208,10 +247,19 @@ msgid "" "gettext` defines a :class:`GNUTranslations` class which implements the " "parsing of GNU :file:`.mo` format files, and has methods for returning " "strings. Instances of this class can also install themselves in the built-in " -"namespace as the function :func:`!_`." -msgstr "" +"namespace as the function :func:`_`." +msgstr "" +":mod:`gettext` モジュールのクラス形式の API は、 GNU :program:`gettext` API " +"よりも高い柔軟性と利便性を持っています。\n" +"Python のアプリケーションやモジュールを地域化するにはこちらを使うことをお勧め" +"します。\n" +":mod:`!gettext` には、GNU :file:`.mo` 形式のファイルを構文解析する処理の実装" +"と、文字列を返すメソッドを持つ :class:`GNUTranslations` クラスが定義されてい" +"ます。\n" +"このクラスのインスタンスも、自分自身を組み込み名前空間に関数 :func:`_` とし" +"て配置できます。" -#: ../../library/gettext.rst:127 +#: ../../library/gettext.rst:160 msgid "" "This function implements the standard :file:`.mo` file search algorithm. It " "takes a *domain*, identical to what :func:`textdomain` takes. Optional " @@ -223,7 +271,7 @@ msgstr "" "*localedir* は :func:`bindtextdomain` と同じです。またオプションの " "*languages* は文字列を列挙したリストで、各文字列は言語コードを表します。" -#: ../../library/gettext.rst:132 +#: ../../library/gettext.rst:165 msgid "" "If *localedir* is not given, then the default system locale directory is " "used. [#]_ If *languages* is not given, then the following environment " @@ -241,7 +289,7 @@ msgstr "" "ればなりません。 :func:`find` はこの文字列をコロンで分割し、言語コードの候補" "リストを生成します。" -#: ../../library/gettext.rst:140 +#: ../../library/gettext.rst:173 msgid "" ":func:`find` then expands and normalizes the languages, and then iterates " "through them, searching for an existing file built of these components:" @@ -249,11 +297,11 @@ msgstr "" ":func:`find` は次に言語コードを展開および正規化し、リストの各要素について、以" "下のパス構成:" -#: ../../library/gettext.rst:143 +#: ../../library/gettext.rst:176 msgid ":file:`{localedir}/{language}/LC_MESSAGES/{domain}.mo`" msgstr ":file:`{localedir}/{language}/LC_MESSAGES/{domain}.mo`" -#: ../../library/gettext.rst:145 +#: ../../library/gettext.rst:178 msgid "" "The first such file name that exists is returned by :func:`find`. If no such " "file is found, then ``None`` is returned. If *all* is given, it returns a " @@ -266,17 +314,31 @@ msgstr "" "名のリストが言語リストまたは環境変数で指定されている順番に並べられたものを返" "します。" -#: ../../library/gettext.rst:153 +#: ../../library/gettext.rst:186 msgid "" -"Return a ``*Translations`` instance based on the *domain*, *localedir*, and " -"*languages*, which are first passed to :func:`find` to get a list of the " +"Return a :class:`*Translations` instance based on the *domain*, *localedir*, " +"and *languages*, which are first passed to :func:`find` to get a list of the " "associated :file:`.mo` file paths. Instances with identical :file:`.mo` " "file names are cached. The actual class instantiated is *class_* if " "provided, otherwise :class:`GNUTranslations`. The class's constructor must " -"take a single :term:`file object` argument." -msgstr "" - -#: ../../library/gettext.rst:160 +"take a single :term:`file object` argument. If provided, *codeset* will " +"change the charset used to encode translated strings in the :meth:" +"`~NullTranslations.lgettext` and :meth:`~NullTranslations.lngettext` methods." +msgstr "" +"*domain* 、 *localedir* 、 *languages* に基づいて :class:`*Translations` イン" +"スタンスを返します。\n" +"*domain* 、 *localedir* 、 *languages* はまず :func:`find` に渡され、関連付け" +"られている :file:`.mo` ファイルパスのリストを取得します。\n" +"同一の :file:`.mo` ファイル名を持つインスタンスはキャッシュされます。\n" +"実際にインスタンス化されるクラスは、 *class_* が与えられていた場合はそのクラ" +"スで、そうでない場合には :class:`GNUTranslations` です。\n" +"クラスのコンストラクタは単一の引数として :term:`file object` を取らなければな" +"りません。\n" +"*codeset* が与えられた場合、 :meth:`~NullTranslations.lgettext` メソッドおよ" +"び :meth:`~NullTranslations.lngettext` メソッドで翻訳文字列のエンコードに使う" +"文字集合を変更します。" + +#: ../../library/gettext.rst:196 msgid "" "If multiple files are found, later files are used as fallbacks for earlier " "ones. To allow setting the fallback, :func:`copy.copy` is used to clone each " @@ -289,7 +351,7 @@ msgstr "" "ジェクトを複製します; こうすることで、実際のインスタンスデータはキャッシュの" "ものと共有されたままになります。" -#: ../../library/gettext.rst:165 +#: ../../library/gettext.rst:201 msgid "" "If no :file:`.mo` file is found, this function raises :exc:`OSError` if " "*fallback* is false (which is the default), and returns a :class:" @@ -299,24 +361,24 @@ msgstr "" "ならこの関数は :exc:`OSError` を送出し、 *fallback* が真なら :class:" "`NullTranslations` インスタンスが返されます。" -#: ../../library/gettext.rst:169 -msgid ":exc:`IOError` used to be raised, it is now an alias of :exc:`OSError`." -msgstr "" -"以前は :exc:`IOError` が送出されました; それは現在 :exc:`OSError` のエイリア" -"スです。" +#: ../../library/gettext.rst:205 +msgid ":exc:`IOError` used to be raised instead of :exc:`OSError`." +msgstr "以前は :exc:`OSError` の代わりに :exc:`IOError` が送出されていました。" -#: ../../library/gettext.rst:172 -msgid "*codeset* parameter is removed." -msgstr "" +#: ../../library/gettext.rst:209 ../../library/gettext.rst:232 +msgid "The *codeset* parameter." +msgstr "*codeset* 引数。" -#: ../../library/gettext.rst:177 +#: ../../library/gettext.rst:214 msgid "" -"This installs the function :func:`!_` in Python's builtins namespace, based " -"on *domain* and *localedir* which are passed to the function :func:" -"`translation`." +"This installs the function :func:`_` in Python's builtins namespace, based " +"on *domain*, *localedir*, and *codeset* which are passed to the function :" +"func:`translation`." msgstr "" +":func:`translation` に *domain* 、 *localedir* 、および *codeset* を渡してで" +"きる関数 :func:`_` を Python の組み込み名前空間に組み込みます。" -#: ../../library/gettext.rst:180 +#: ../../library/gettext.rst:218 msgid "" "For the *names* parameter, please see the description of the translation " "object's :meth:`~NullTranslations.install` method." @@ -324,33 +386,30 @@ msgstr "" "*names* パラメータについては、翻訳オブジェクトの :meth:`~NullTranslations." "install` メソッドの説明を参照ください。" -#: ../../library/gettext.rst:183 +#: ../../library/gettext.rst:221 msgid "" "As seen below, you usually mark the strings in your application that are " -"candidates for translation, by wrapping them in a call to the :func:`!_` " +"candidates for translation, by wrapping them in a call to the :func:`_` " "function, like this::" msgstr "" +"以下に示すように、通常はアプリケーション中の文字列を関数 :func:`_` の呼び出し" +"で包み込んで翻訳対象候補であることを示します::" -#: ../../library/gettext.rst:187 -msgid "print(_('This string will be translated.'))" -msgstr "" - -#: ../../library/gettext.rst:189 +#: ../../library/gettext.rst:227 msgid "" -"For convenience, you want the :func:`!_` function to be installed in " -"Python's builtins namespace, so it is easily accessible in all modules of " -"your application." +"For convenience, you want the :func:`_` function to be installed in Python's " +"builtins namespace, so it is easily accessible in all modules of your " +"application." msgstr "" +"利便性を高めるためには、 :func:`_` 関数を Python の組み込み名前空間に組み入れ" +"る必要があります。こうすることで、アプリケーション内の全てのモジュールからア" +"クセスできるようになります。" -#: ../../library/gettext.rst:193 -msgid "*names* is now a keyword-only parameter." -msgstr "" - -#: ../../library/gettext.rst:197 +#: ../../library/gettext.rst:236 msgid "The :class:`NullTranslations` class" msgstr ":class:`NullTranslations` クラス" -#: ../../library/gettext.rst:199 +#: ../../library/gettext.rst:238 msgid "" "Translation classes are what actually implement the translation of original " "source file message strings to translated message strings. The base class " @@ -365,7 +424,7 @@ msgstr "" "本的なインターフェースを提供しています。\n" "以下に :class:`!NullTranslations` のメソッドを示します:" -#: ../../library/gettext.rst:208 +#: ../../library/gettext.rst:247 msgid "" "Takes an optional :term:`file object` *fp*, which is ignored by the base " "class. Initializes \"protected\" instance variables *_info* and *_charset* " @@ -380,7 +439,7 @@ msgstr "" "の値は :meth:`add_fallback` で設定されます。その後、 *fp* が ``None`` でない" "場合 ``self._parse(fp)`` を呼び出します。" -#: ../../library/gettext.rst:216 +#: ../../library/gettext.rst:255 msgid "" "No-op in the base class, this method takes file object *fp*, and reads the " "data from the file, initializing its message catalog. If you have an " @@ -393,7 +452,7 @@ msgstr "" "使っている場合、その形式を解釈するためにはこのメソッドを上書きしなくてはなり" "ません。" -#: ../../library/gettext.rst:224 +#: ../../library/gettext.rst:263 msgid "" "Add *fallback* as the fallback object for the current translation object. A " "translation object should consult the fallback if it cannot provide a " @@ -403,7 +462,7 @@ msgstr "" "ブジェクトが与えられたメッセージに対して翻訳メッセージを提供できない場合、こ" "の代替オブジェクトに問い合わせることになります。" -#: ../../library/gettext.rst:231 +#: ../../library/gettext.rst:270 msgid "" "If a fallback has been set, forward :meth:`!gettext` to the fallback. " "Otherwise, return *message*. Overridden in derived classes." @@ -413,7 +472,7 @@ msgstr "" "そうでない場合、引数として受け取った *message* を返します。\n" "派生クラスで上書きするメソッドです。" -#: ../../library/gettext.rst:237 +#: ../../library/gettext.rst:276 msgid "" "If a fallback has been set, forward :meth:`!ngettext` to the fallback. " "Otherwise, return *singular* if *n* is 1; return *plural* otherwise. " @@ -425,7 +484,7 @@ msgstr "" "を返します。\n" "派生クラスで上書きするメソッドです。" -#: ../../library/gettext.rst:244 +#: ../../library/gettext.rst:283 msgid "" "If a fallback has been set, forward :meth:`pgettext` to the fallback. " "Otherwise, return the translated message. Overridden in derived classes." @@ -434,7 +493,7 @@ msgstr "" "転送します。そうでない場合、翻訳されたメッセージを返します。派生クラスで上書" "きするメソッドです。" -#: ../../library/gettext.rst:252 +#: ../../library/gettext.rst:291 msgid "" "If a fallback has been set, forward :meth:`npgettext` to the fallback. " "Otherwise, return the translated message. Overridden in derived classes." @@ -443,17 +502,49 @@ msgstr "" "転送します。そうでない場合、翻訳されたメッセージを返します。派生クラスで上書" "きするメソッドです。" -#: ../../library/gettext.rst:260 +#: ../../library/gettext.rst:300 +msgid "" +"Equivalent to :meth:`.gettext` and :meth:`.ngettext`, but the translation is " +"returned as a byte string encoded in the preferred system encoding if no " +"encoding was explicitly set with :meth:`set_output_charset`. Overridden in " +"derived classes." +msgstr "" +":meth:`.gettext` および :meth:`.ngettext` と同じですが、エンコーディングが :" +"meth:`set_output_charset` で明示的に設定されていない場合、翻訳結果は優先シス" +"テムエンコーディングでエンコードされたバイト文字列として返されます。\n" +"派生クラスで上書きするメソッドです。" + +#: ../../library/gettext.rst:307 ../../library/gettext.rst:463 +msgid "" +"These methods should be avoided in Python 3. See the warning for the :func:" +"`lgettext` function." +msgstr "" +"これらのメソッドは Python 3 で使うのは避けるべきです。\n" +":func:`lgettext` 関数に対する警告を参照してください。" + +#: ../../library/gettext.rst:315 msgid "" -"Return a dictionary containing the metadata found in the message catalog " -"file." +"Return the \"protected\" :attr:`_info` variable, a dictionary containing the " +"metadata found in the message catalog file." msgstr "" -#: ../../library/gettext.rst:266 +#: ../../library/gettext.rst:321 msgid "Return the encoding of the message catalog file." msgstr "メッセージカタログファイルのエンコーディングを返します。" -#: ../../library/gettext.rst:271 +#: ../../library/gettext.rst:326 +msgid "" +"Return the encoding used to return translated messages in :meth:`.lgettext` " +"and :meth:`.lngettext`." +msgstr "" +":meth:`lgettext` と :meth:`lngettext` の返り値となる翻訳メッセージで使われて" +"いるエンコーディングを返します。" + +#: ../../library/gettext.rst:334 +msgid "Change the encoding used to return translated messages." +msgstr "返り値の翻訳メッセージで使われるエンコーディングを変更します。" + +#: ../../library/gettext.rst:341 msgid "" "This method installs :meth:`.gettext` into the built-in namespace, binding " "it to ``_``." @@ -461,78 +552,102 @@ msgstr "" "このメソッドは :meth:`.gettext` を組み込み名前空間にインストールし、変数 " "``_`` に束縛します。" -#: ../../library/gettext.rst:274 +#: ../../library/gettext.rst:344 msgid "" "If the *names* parameter is given, it must be a sequence containing the " "names of functions you want to install in the builtins namespace in addition " -"to :func:`!_`. Supported names are ``'gettext'``, ``'ngettext'``, " -"``'pgettext'``, and ``'npgettext'``." +"to :func:`_`. Supported names are ``'gettext'``, ``'ngettext'``, " +"``'pgettext'``, ``'npgettext'``, ``'lgettext'``, and ``'lngettext'``." msgstr "" +"*names* パラメータを与える場合には、 :func:`_` 以外では組み込み名前空間に配置" +"したい関数名を列挙したシーケンスでなければなりません。\n" +"サポートされている名前は ``'gettext'``, ``'ngettext'``, ``'pgettext'``, " +"``'npgettext'``, ``'lgettext'``, ``'lngettext'`` です。" -#: ../../library/gettext.rst:279 +#: ../../library/gettext.rst:349 msgid "" "Note that this is only one way, albeit the most convenient way, to make the :" -"func:`!_` function available to your application. Because it affects the " +"func:`_` function available to your application. Because it affects the " "entire application globally, and specifically the built-in namespace, " -"localized modules should never install :func:`!_`. Instead, they should use " -"this code to make :func:`!_` available to their module::" +"localized modules should never install :func:`_`. Instead, they should use " +"this code to make :func:`_` available to their module::" msgstr "" +"この方法はアプリケーションで :func:`_` 関数を利用できるようにするための最も便" +"利な方法ですが、唯一の手段でもあるので注意してください。この関数はアプリケー" +"ション全体、とりわけ組み込み名前空間に影響するので、地域化されたモジュール" +"で :func:`_` を組み入れることができないのです。その代わりに、以下のコードを" +"使って :func:`_` を使えるようにしなければなりません。::" -#: ../../library/gettext.rst:285 +#: ../../library/gettext.rst:359 msgid "" -"import gettext\n" -"t = gettext.translation('mymodule', ...)\n" -"_ = t.gettext" -msgstr "" - -#: ../../library/gettext.rst:289 -msgid "" -"This puts :func:`!_` only in the module's global namespace and so only " +"This puts :func:`_` only in the module's global namespace and so only " "affects calls within this module." msgstr "" +"この操作は :func:`_` をモジュール内だけのグローバル名前空間に組み入れるので、" +"モジュール内の :func:`_` の呼び出しだけに影響します。" -#: ../../library/gettext.rst:292 +#: ../../library/gettext.rst:362 msgid "Added ``'pgettext'`` and ``'npgettext'``." msgstr "``'pgettext'`` と ``'npgettext'`` が追加されました。" -#: ../../library/gettext.rst:297 +#: ../../library/gettext.rst:367 msgid "The :class:`GNUTranslations` class" msgstr ":class:`GNUTranslations` クラス" -#: ../../library/gettext.rst:299 +#: ../../library/gettext.rst:369 msgid "" -"The :mod:`!gettext` module provides one additional class derived from :class:" -"`NullTranslations`: :class:`GNUTranslations`. This class overrides :meth:`!" -"_parse` to enable reading GNU :program:`gettext` format :file:`.mo` files in " -"both big-endian and little-endian format." +"The :mod:`gettext` module provides one additional class derived from :class:" +"`NullTranslations`: :class:`GNUTranslations`. This class overrides :meth:" +"`_parse` to enable reading GNU :program:`gettext` format :file:`.mo` files " +"in both big-endian and little-endian format." msgstr "" +":mod:`gettext` モジュールでは :class:`NullTranslations` から派生したもう一つ" +"のクラス: :class:`GNUTranslations` を提供しています。このクラスはビッグエン" +"ディアン、およびリトルエンディアン両方のバイナリ形式の GNU :program:" +"`gettext` :file:`.mo` ファイルを読み出せるように :meth:`_parse` を上書きして" +"います。" -#: ../../library/gettext.rst:304 +#: ../../library/gettext.rst:374 msgid "" ":class:`GNUTranslations` parses optional metadata out of the translation " "catalog. It is convention with GNU :program:`gettext` to include metadata as " "the translation for the empty string. This metadata is in :rfc:`822`\\ -" "style ``key: value`` pairs, and should contain the ``Project-Id-Version`` " "key. If the key ``Content-Type`` is found, then the ``charset`` property is " -"used to initialize the \"protected\" :attr:`!_charset` instance variable, " +"used to initialize the \"protected\" :attr:`_charset` instance variable, " "defaulting to ``None`` if not found. If the charset encoding is specified, " "then all message ids and message strings read from the catalog are converted " "to Unicode using this encoding, else ASCII is assumed." msgstr "" +":class:`GNUTranslations` はまた、翻訳カタログ以外に、オプションのメタデータを" +"読み込んで解釈します。GNU :program:`gettext` では、空の文字列に対する変換先と" +"してメタデータを取り込むことが慣習になっています。このメタデータは :rfc:" +"`822` 形式の ``key: value`` のペアになっており、 ``Project-Id-Version`` キー" +"を含んでいなければなりません。キー ``Content-Type`` があった場合、 " +"``charset`` の特性値 (property) は \"保護された\" :attr:`_charset` インスタン" +"ス変数を初期化するために用いられます。値がない場合には、デフォルトとして " +"``None`` が使われます。エンコードに用いられる文字セットが指定されている場合、" +"カタログから読み出された全てのメッセージ id とメッセージ文字列は、指定された" +"エンコードを用いて Unicode に変換され、そうでなければ ASCII とみなされます。" -#: ../../library/gettext.rst:314 +#: ../../library/gettext.rst:384 msgid "" -"Since message ids are read as Unicode strings too, all ``*gettext()`` " +"Since message ids are read as Unicode strings too, all :meth:`*gettext` " "methods will assume message ids as Unicode strings, not byte strings." msgstr "" +"メッセージ id もユニコード文字列として解釈されるので、すべての :meth:" +"`*gettext` メソッドはメッセージ id をバイト文字列ではなくユニコード文字列と仮" +"定するでしょう。" -#: ../../library/gettext.rst:317 +#: ../../library/gettext.rst:387 msgid "" "The entire set of key/value pairs are placed into a dictionary and set as " -"the \"protected\" :attr:`!_info` instance variable." +"the \"protected\" :attr:`_info` instance variable." msgstr "" +"key/value ペアの集合全体は辞書型データ中に配置され、\"保護された\" :attr:" +"`_info` インスタンス変数に設定されます。" -#: ../../library/gettext.rst:320 +#: ../../library/gettext.rst:390 msgid "" "If the :file:`.mo` file's magic number is invalid, the major version number " "is unexpected, or if other problems occur while reading the file, " @@ -543,12 +658,12 @@ msgstr "" "た場合、 :class:`GNUTranslations` クラスのインスタンス化で :exc:`OSError` が" "送出されることがあります。" -#: ../../library/gettext.rst:326 +#: ../../library/gettext.rst:396 msgid "" "The following methods are overridden from the base class implementation:" msgstr "以下のメソッドは基底クラスの実装からオーバライドされています:" -#: ../../library/gettext.rst:330 +#: ../../library/gettext.rst:400 msgid "" "Look up the *message* id in the catalog and return the corresponding message " "string, as a Unicode string. If there is no entry in the catalog for the " @@ -563,7 +678,7 @@ msgstr "" "ソッドに移譲します。\n" "それ以外の場合は、 *message* id 自体が返されます。" -#: ../../library/gettext.rst:339 +#: ../../library/gettext.rst:409 msgid "" "Do a plural-forms lookup of a message id. *singular* is used as the message " "id for purposes of lookup in the catalog, while *n* is used to determine " @@ -573,7 +688,7 @@ msgstr "" "*singular* がメッセージ id として用いられ、 *n* にはどの複数形を用いるかを指" "定します。返されるメッセージ文字列は Unicode 文字列です。" -#: ../../library/gettext.rst:343 +#: ../../library/gettext.rst:413 msgid "" "If the message id is not found in the catalog, and a fallback is specified, " "the request is forwarded to the fallback's :meth:`~NullTranslations." @@ -586,21 +701,11 @@ msgstr "" "それ以外の場合、 *n* が 1 ならば *singular* が返され、それ以外なら *plural* " "が返されます。" -#: ../../library/gettext.rst:348 +#: ../../library/gettext.rst:418 msgid "Here is an example::" msgstr "以下に例を示します。::" -#: ../../library/gettext.rst:350 -msgid "" -"n = len(os.listdir('.'))\n" -"cat = GNUTranslations(somefile)\n" -"message = cat.ngettext(\n" -" 'There is %(num)d file in this directory',\n" -" 'There are %(num)d files in this directory',\n" -" n) % {'num': n}" -msgstr "" - -#: ../../library/gettext.rst:360 +#: ../../library/gettext.rst:430 msgid "" "Look up the *context* and *message* id in the catalog and return the " "corresponding message string, as a Unicode string. If there is no entry in " @@ -614,7 +719,7 @@ msgstr "" "ク検索はオブジェクトの :meth:`pgettext` メソッドに転送されます。そうでない場" "合、 *message* id 自体が返されます。" -#: ../../library/gettext.rst:371 +#: ../../library/gettext.rst:441 msgid "" "Do a plural-forms lookup of a message id. *singular* is used as the message " "id for purposes of lookup in the catalog, while *n* is used to determine " @@ -624,7 +729,7 @@ msgstr "" "*singular* がメッセージ id として用いられ、 *n* にはどの複数形を用いるかを指" "定します。" -#: ../../library/gettext.rst:375 +#: ../../library/gettext.rst:445 msgid "" "If the message id for *context* is not found in the catalog, and a fallback " "is specified, the request is forwarded to the fallback's :meth:`npgettext` " @@ -636,11 +741,23 @@ msgstr "" "の :meth:`npgettext` メソッドに転送されます。そうでない場合、 *n* が 1 なら" "ば *singular* が返され、それ以外に対しては *plural* が返されます。" -#: ../../library/gettext.rst:384 +#: ../../library/gettext.rst:456 +msgid "" +"Equivalent to :meth:`.gettext` and :meth:`.ngettext`, but the translation is " +"returned as a byte string encoded in the preferred system encoding if no " +"encoding was explicitly set with :meth:`~NullTranslations." +"set_output_charset`." +msgstr "" +":meth:`.gettext` および :meth:`.ngettext` と同じですが、エンコーディングが :" +"meth:`~NullTranslations.set_output_charset` で明示的に設定されていない場合、" +"翻訳結果は優先システムエンコーディングでエンコードされたバイト文字列として返" +"されます。" + +#: ../../library/gettext.rst:470 msgid "Solaris message catalog support" msgstr "Solaris メッセージカタログ機構のサポート" -#: ../../library/gettext.rst:386 +#: ../../library/gettext.rst:472 msgid "" "The Solaris operating system defines its own binary :file:`.mo` file format, " "but since no documentation can be found on this format, it is not supported " @@ -650,11 +767,11 @@ msgstr "" "を定義していますが、この形式に関するドキュメントが手に入らないため、現時点で" "はサポートされていません。" -#: ../../library/gettext.rst:392 +#: ../../library/gettext.rst:478 msgid "The Catalog constructor" msgstr "Catalog コンストラクタ" -#: ../../library/gettext.rst:396 +#: ../../library/gettext.rst:482 msgid "" "GNOME uses a version of the :mod:`gettext` module by James Henstridge, but " "this version has a slightly different API. Its documented usage was::" @@ -663,21 +780,15 @@ msgstr "" "を使っていますが、このバージョンは少し異なった API を持っています。ドキュメン" "トに書かれている利用法は::" -#: ../../library/gettext.rst:399 -msgid "" -"import gettext\n" -"cat = gettext.Catalog(domain, localedir)\n" -"_ = cat.gettext\n" -"print(_('hello world'))" -msgstr "" - -#: ../../library/gettext.rst:404 +#: ../../library/gettext.rst:490 msgid "" -"For compatibility with this older module, the function :func:`!Catalog` is " -"an alias for the :func:`translation` function described above." +"For compatibility with this older module, the function :func:`Catalog` is an " +"alias for the :func:`translation` function described above." msgstr "" +"となっています。過去のモジュールとの互換性のために、 :func:`Catalog` は前述" +"の :func:`translation` 関数の別名になっています。" -#: ../../library/gettext.rst:407 +#: ../../library/gettext.rst:493 msgid "" "One difference between this module and Henstridge's: his catalog objects " "supported access through a mapping API, but this appears to be unused and so " @@ -687,11 +798,11 @@ msgstr "" "カタログオブジェクトはマップ型の API を介したアクセスがサポートされていました" "が、この API は使われていないらしく、現在はサポートされていません。" -#: ../../library/gettext.rst:414 +#: ../../library/gettext.rst:499 msgid "Internationalizing your programs and modules" msgstr "プログラムやモジュールを国際化する" -#: ../../library/gettext.rst:416 +#: ../../library/gettext.rst:501 msgid "" "Internationalization (I18N) refers to the operation by which a program is " "made aware of multiple languages. Localization (L10N) refers to the " @@ -704,46 +815,42 @@ msgstr "" "プログラムを特定地域の言語や文化的な事情に対応させることを指します。Python プ" "ログラムに多言語メッセージ機能を追加するには、以下の手順を踏む必要があります:" -#: ../../library/gettext.rst:422 +#: ../../library/gettext.rst:507 msgid "" "prepare your program or module by specially marking translatable strings" msgstr "" "プログラムやモジュールで翻訳対象とする文字列に特殊なマークをつけて準備します" -#: ../../library/gettext.rst:424 +#: ../../library/gettext.rst:509 msgid "" "run a suite of tools over your marked files to generate raw messages catalogs" msgstr "" "マークづけをしたファイルに一連のツールを走らせ、生のメッセージカタログを生成" "します" -#: ../../library/gettext.rst:426 +#: ../../library/gettext.rst:511 msgid "create language-specific translations of the message catalogs" msgstr "特定の言語へのメッセージカタログの翻訳を作成します" -#: ../../library/gettext.rst:428 +#: ../../library/gettext.rst:513 msgid "" "use the :mod:`gettext` module so that message strings are properly translated" msgstr "" "メッセージ文字列を適切に変換するために :mod:`gettext` モジュールを使います" -#: ../../library/gettext.rst:430 +#: ../../library/gettext.rst:515 msgid "" "In order to prepare your code for I18N, you need to look at all the strings " "in your files. Any string that needs to be translated should be marked by " -"wrapping it in ``_('...')`` --- that is, a call to the function :func:`_ " -"`. For example::" +"wrapping it in ``_('...')`` --- that is, a call to the function :func:`_`. " +"For example::" msgstr "" +"ソースコードを I18N 化する準備として、ファイル内の全ての文字列を探す必要があ" +"ります。翻訳を行う必要のある文字列はどれも ``_('...')`` --- すなわち関数 :" +"func:`_` の呼び出しで包むことでマーク付けしなくてはなりません。例えば以下のよ" +"うにします::" -#: ../../library/gettext.rst:434 -msgid "" -"filename = 'mylog.txt'\n" -"message = _('writing a log message')\n" -"with open(filename, 'w') as fp:\n" -" fp.write(message)" -msgstr "" - -#: ../../library/gettext.rst:439 +#: ../../library/gettext.rst:524 msgid "" "In this example, the string ``'writing a log message'`` is marked as a " "candidate for translation, while the strings ``'mylog.txt'`` and ``'w'`` are " @@ -752,30 +859,30 @@ msgstr "" "この例では、文字列 ``'writing a log message'`` が翻訳対象候補としてマーク付け" "されており、文字列 ``'mylog.txt'`` および ``'w'`` はされていません。" -#: ../../library/gettext.rst:442 +#: ../../library/gettext.rst:527 msgid "" "There are a few tools to extract the strings meant for translation. The " "original GNU :program:`gettext` only supported C or C++ source code but its " "extended version :program:`xgettext` scans code written in a number of " "languages, including Python, to find strings marked as translatable. `Babel " -"`__ is a Python internationalization library that " +"`__ is a Python internationalization library that " "includes a :file:`pybabel` script to extract and compile message catalogs. " "François Pinard's program called :program:`xpot` does a similar job and is " "available as part of his `po-utils package `__." msgstr "" -"翻訳対象の文字列を抽出するツールもあります。\n" +"飜訳対象の文字列を抽出するツールもあります。\n" "オリジナルの GNU :program:`gettext` は C と C++ のソースコードしかサポートし" "ませんが、拡張版の :program:`xgettext` は Python を含めた多くの言語で書かれた" -"コードを読み取り、翻訳できる文字列を発見します。\n" -"`Babel `__ は Python の国際化ライブラリで、翻訳文字" -"列の抽出とメッセージカタログのコンパイルを行う :file:`pybabel` スクリプトがあ" +"コードを読み取り、飜訳できる文字列を発見します。\n" +"`Babel `__ は Python の国際化ライブラリで、飜訳文字" +"列の抽出とメッセージカタログのコンパイルを行う file:`pybabel` スクリプトがあ" "ります。\n" "François Pinard が開発した :program:`xpot` と呼ばれるプログラムは同じような処" "理を行え、彼の `po-utils package `__ の一" "部として利用可能です。" -#: ../../library/gettext.rst:452 +#: ../../library/gettext.rst:537 msgid "" "(Python also includes pure-Python versions of these programs, called :" "program:`pygettext.py` and :program:`msgfmt.py`; some Python distributions " @@ -800,7 +907,7 @@ msgstr "" "この2つのプログラムがあれば、 GNU :program:`gettext` パッケージを使わずに " "Python アプリケーションを国際化できるでしょう。)" -#: ../../library/gettext.rst:464 +#: ../../library/gettext.rst:549 msgid "" ":program:`xgettext`, :program:`pygettext`, and similar tools generate :file:" "`.po` files that are message catalogs. They are structured human-readable " @@ -812,7 +919,7 @@ msgstr "" "このファイルは人間が判読可能な構造をしていて、ソースコード中のマークが着けら" "れた文字列と、その文字列の仮置きの訳文が一緒に書き込まれています。" -#: ../../library/gettext.rst:470 +#: ../../library/gettext.rst:555 msgid "" "Copies of these :file:`.po` files are then handed over to the individual " "human translators who write translations for every supported natural " @@ -830,7 +937,7 @@ msgstr "" "この :file:`.mo` が :mod:`gettext` モジュールによる実行時の実際の飜訳処理で使" "われます。" -#: ../../library/gettext.rst:479 +#: ../../library/gettext.rst:564 msgid "" "How you use the :mod:`gettext` module in your code depends on whether you " "are internationalizing a single module or your entire application. The next " @@ -840,11 +947,11 @@ msgstr "" "を国際化するのか、それともアプリケーション全体を国際化するのかによります。次" "のふたつのセクションで、それぞれについて説明します。" -#: ../../library/gettext.rst:485 +#: ../../library/gettext.rst:570 msgid "Localizing your module" msgstr "モジュールを地域化する" -#: ../../library/gettext.rst:487 +#: ../../library/gettext.rst:572 msgid "" "If you are localizing your module, you must take care not to make global " "changes, e.g. to the built-in namespace. You should not use the GNU :program:" @@ -854,7 +961,7 @@ msgstr "" "を行わないように注意しなければなりません。GNU :program:`gettext` API ではな" "く、クラス形式の API を使うべきです。" -#: ../../library/gettext.rst:491 +#: ../../library/gettext.rst:576 msgid "" "Let's say your module is called \"spam\" and the module's various natural " "language translation :file:`.mo` files reside in :file:`/usr/share/locale` " @@ -866,26 +973,24 @@ msgstr "" "`gettext` 形式で置かれているとします。この場合、モジュールの最初で以下のよう" "にします::" -#: ../../library/gettext.rst:496 -msgid "" -"import gettext\n" -"t = gettext.translation('spam', '/usr/share/locale')\n" -"_ = t.gettext" -msgstr "" - -#: ../../library/gettext.rst:502 +#: ../../library/gettext.rst:587 msgid "Localizing your application" msgstr "アプリケーションを地域化する" -#: ../../library/gettext.rst:504 +#: ../../library/gettext.rst:589 msgid "" -"If you are localizing your application, you can install the :func:`!_` " +"If you are localizing your application, you can install the :func:`_` " "function globally into the built-in namespace, usually in the main driver " "file of your application. This will let all your application-specific files " "just use ``_('...')`` without having to explicitly install it in each file." msgstr "" +"アプリケーションを地域化するのなら、関数 :func:`_` をグローバルな組み込み名前" +"空間に組み入れなければならず、これは通常アプリケーションの主ドライバ (main " +"driver) ファイルで行います。この操作によって、アプリケーション独自のファイル" +"は明示的に各ファイルで :func:`_` の組み入れを行わなくても単に ``_('...')`` を" +"使うだけで済むようになります。" -#: ../../library/gettext.rst:509 +#: ../../library/gettext.rst:594 msgid "" "In the simple case then, you need only add the following bit of code to the " "main driver file of your application::" @@ -893,13 +998,7 @@ msgstr "" "単純な場合では、単に以下の短いコードをアプリケーションの主ドライバファイルに" "追加するだけです::" -#: ../../library/gettext.rst:512 -msgid "" -"import gettext\n" -"gettext.install('myapplication')" -msgstr "" - -#: ../../library/gettext.rst:515 +#: ../../library/gettext.rst:600 msgid "" "If you need to set the locale directory, you can pass it into the :func:" "`install` function::" @@ -907,17 +1006,11 @@ msgstr "" "ロケールの辞書を設定する必要がある場合、:func:`install` 関数に渡すことが出来" "ます::" -#: ../../library/gettext.rst:518 -msgid "" -"import gettext\n" -"gettext.install('myapplication', '/usr/share/locale')" -msgstr "" - -#: ../../library/gettext.rst:523 +#: ../../library/gettext.rst:608 msgid "Changing languages on the fly" msgstr "動作中 (on the fly) に言語を切り替える" -#: ../../library/gettext.rst:525 +#: ../../library/gettext.rst:610 msgid "" "If your program needs to support many languages at the same time, you may " "want to create multiple translation instances and then switch between them " @@ -927,29 +1020,11 @@ msgstr "" "て、例えば以下のコードのように、インスタンスを明示的に切り替えてもかまいませ" "ん。::" -#: ../../library/gettext.rst:529 -msgid "" -"import gettext\n" -"\n" -"lang1 = gettext.translation('myapplication', languages=['en'])\n" -"lang2 = gettext.translation('myapplication', languages=['fr'])\n" -"lang3 = gettext.translation('myapplication', languages=['de'])\n" -"\n" -"# start by using language1\n" -"lang1.install()\n" -"\n" -"# ... time goes by, user selects language 2\n" -"lang2.install()\n" -"\n" -"# ... more time goes by, user selects language 3\n" -"lang3.install()" -msgstr "" - -#: ../../library/gettext.rst:546 +#: ../../library/gettext.rst:631 msgid "Deferred translations" msgstr "翻訳処理の遅延解決" -#: ../../library/gettext.rst:548 +#: ../../library/gettext.rst:633 msgid "" "In most coding situations, strings are translated where they are coded. " "Occasionally however, you need to mark strings for translation, but defer " @@ -960,19 +1035,7 @@ msgstr "" "が行われるように遅延させる必要が生じます。古典的な例は以下のようなコートで" "す::" -#: ../../library/gettext.rst:552 -msgid "" -"animals = ['mollusk',\n" -" 'albatross',\n" -" 'rat',\n" -" 'penguin',\n" -" 'python', ]\n" -"# ...\n" -"for a in animals:\n" -" print(a)" -msgstr "" - -#: ../../library/gettext.rst:561 +#: ../../library/gettext.rst:646 msgid "" "Here, you want to mark the strings in the ``animals`` list as being " "translatable, but you don't actually want to translate them until they are " @@ -981,79 +1044,64 @@ msgstr "" "ここで、リスト ``animals`` 内の文字列は翻訳対象としてマークはしたいが、文字列" "が出力されるまで実際に翻訳を行うのは避けたいとします。" -#: ../../library/gettext.rst:565 +#: ../../library/gettext.rst:650 msgid "Here is one way you can handle this situation::" msgstr "こうした状況を処理する一つの方法を以下に示します::" -#: ../../library/gettext.rst:567 +#: ../../library/gettext.rst:666 msgid "" -"def _(message): return message\n" -"\n" -"animals = [_('mollusk'),\n" -" _('albatross'),\n" -" _('rat'),\n" -" _('penguin'),\n" -" _('python'), ]\n" -"\n" -"del _\n" -"\n" -"# ...\n" -"for a in animals:\n" -" print(_(a))" -msgstr "" - -#: ../../library/gettext.rst:581 -msgid "" -"This works because the dummy definition of :func:`!_` simply returns the " +"This works because the dummy definition of :func:`_` simply returns the " "string unchanged. And this dummy definition will temporarily override any " -"definition of :func:`!_` in the built-in namespace (until the :keyword:`del` " -"command). Take care, though if you have a previous definition of :func:`!_` " +"definition of :func:`_` in the built-in namespace (until the :keyword:`del` " +"command). Take care, though if you have a previous definition of :func:`_` " "in the local namespace." msgstr "" +"ダミーの :func:`_` 定義が単に文字列をそのまま返すようになっているので、上の" +"コードはうまく動作します。かつ、このダミーの定義は、組み込み名前空間に置かれ" +"た :func:`_` の定義で (:keyword:`del` 命令を実行するまで) 一時的に上書きする" +"ことができます。もしそれまでに :func:`_` をローカルな名前空間に持っていたら注" +"意してください。" -#: ../../library/gettext.rst:587 +#: ../../library/gettext.rst:672 msgid "" -"Note that the second use of :func:`!_` will not identify \"a\" as being " +"Note that the second use of :func:`_` will not identify \"a\" as being " "translatable to the :program:`gettext` program, because the parameter is not " "a string literal." msgstr "" +"二つ目の例における :func:`_` の使い方では、パラメータが文字列リテラルではない" +"ので、 :program:`gettext` プログラムが翻訳可能だとは判定されないことに注意し" +"てください。" -#: ../../library/gettext.rst:591 +#: ../../library/gettext.rst:676 msgid "Another way to handle this is with the following example::" msgstr "もう一つの処理法は、以下の例のようなやり方です::" -#: ../../library/gettext.rst:593 -msgid "" -"def N_(message): return message\n" -"\n" -"animals = [N_('mollusk'),\n" -" N_('albatross'),\n" -" N_('rat'),\n" -" N_('penguin'),\n" -" N_('python'), ]\n" -"\n" -"# ...\n" -"for a in animals:\n" -" print(_(a))" -msgstr "" - -#: ../../library/gettext.rst:605 +#: ../../library/gettext.rst:690 msgid "" -"In this case, you are marking translatable strings with the function :func:`!" -"N_`, which won't conflict with any definition of :func:`!_`. However, you " +"In this case, you are marking translatable strings with the function :func:" +"`N_`, which won't conflict with any definition of :func:`_`. However, you " "will need to teach your message extraction program to look for translatable " -"strings marked with :func:`!N_`. :program:`xgettext`, :program:`pygettext`, " +"strings marked with :func:`N_`. :program:`xgettext`, :program:`pygettext`, " "``pybabel extract``, and :program:`xpot` all support this through the use of " -"the :option:`!-k` command-line switch. The choice of :func:`!N_` here is " -"totally arbitrary; it could have just as easily been :func:`!" -"MarkThisStringForTranslation`." -msgstr "" - -#: ../../library/gettext.rst:616 +"the :option:`!-k` command-line switch. The choice of :func:`N_` here is " +"totally arbitrary; it could have just as easily been :func:" +"`MarkThisStringForTranslation`." +msgstr "" +"この例では、飜訳可能な文字列に :func:`N_` でマークを付けているために、 :func:" +"`_` の定義と衝突しません。\n" +"しかし、これではメッセージを抽出するプログラムに対して :func:`N_` でマークさ" +"れている飜訳可能な文字列を見付けるように教える必要が出てきます。\n" +":program:`xgettext`, :program:`pygettext`, ``pybabel extract``, :program:" +"`xpot` は全て、コマンドラインスイッチ :option:`!-k` を使ってその機能をサポー" +"トしています。\n" +"この例の :func:`N_` という名前は好きに選べます;\n" +":func:`MarkThisStringForTranslation` という名前にしてしまっても構いません。" + +#: ../../library/gettext.rst:701 msgid "Acknowledgements" msgstr "謝辞" -#: ../../library/gettext.rst:618 +#: ../../library/gettext.rst:703 msgid "" "The following people contributed code, feedback, design suggestions, " "previous implementations, and valuable experience to the creation of this " @@ -1062,65 +1110,60 @@ msgstr "" "以下の人々が、このモジュールのコード、フィードバック、設計に関する助言、過去" "の実装、そして有益な経験談による貢献をしてくれました:" -#: ../../library/gettext.rst:621 +#: ../../library/gettext.rst:706 msgid "Peter Funk" msgstr "Peter Funk" -#: ../../library/gettext.rst:623 +#: ../../library/gettext.rst:708 msgid "James Henstridge" msgstr "James Henstridge" -#: ../../library/gettext.rst:625 +#: ../../library/gettext.rst:710 msgid "Juan David Ibáñez Palomar" msgstr "Juan David Ibáñez Palomar" -#: ../../library/gettext.rst:627 +#: ../../library/gettext.rst:712 msgid "Marc-André Lemburg" msgstr "Marc-André Lemburg" -#: ../../library/gettext.rst:629 +#: ../../library/gettext.rst:714 msgid "Martin von Löwis" msgstr "Martin von Löwis" -#: ../../library/gettext.rst:631 +#: ../../library/gettext.rst:716 msgid "François Pinard" msgstr "François Pinard" -#: ../../library/gettext.rst:633 +#: ../../library/gettext.rst:718 msgid "Barry Warsaw" msgstr "Barry Warsaw" -#: ../../library/gettext.rst:635 +#: ../../library/gettext.rst:720 msgid "Gustavo Niemeyer" msgstr "Gustavo Niemeyer" -#: ../../library/gettext.rst:638 +#: ../../library/gettext.rst:723 msgid "Footnotes" msgstr "脚注" -#: ../../library/gettext.rst:639 +#: ../../library/gettext.rst:724 msgid "" -"The default locale directory is system dependent; for example, on Red Hat " +"The default locale directory is system dependent; for example, on RedHat " "Linux it is :file:`/usr/share/locale`, but on Solaris it is :file:`/usr/lib/" -"locale`. The :mod:`!gettext` module does not try to support these system " +"locale`. The :mod:`gettext` module does not try to support these system " "dependent defaults; instead its default is :file:`{sys.base_prefix}/share/" "locale` (see :data:`sys.base_prefix`). For this reason, it is always best to " "call :func:`bindtextdomain` with an explicit absolute path at the start of " "your application." msgstr "" +"標準でロケールが収められているディレクトリはシステム依存です; 例えば、RedHat " +"Linux では :file:`/usr/share/locale` ですが、 Solaris では :file:`/usr/lib/" +"locale` です。 :mod:`gettext` モジュールはこうしたシステム依存の標準設定をサ" +"ポートしません; その代わりに :file:`{sys.base_prefix}/share/locale` を標準の" +"設定とします(:data:`sys.base_prefix` を参照してください)。この理由から、常に" +"アプリケーションの開始時に絶対パスで明示的に指定して :func:`bindtextdomain` " +"を呼び出すのが最良のやり方ということになります。" -#: ../../library/gettext.rst:647 +#: ../../library/gettext.rst:732 msgid "See the footnote for :func:`bindtextdomain` above." msgstr "上の :func:`bindtextdomain` に関する脚注を参照してください。" - -#: ../../library/gettext.rst:56 -msgid "_ (underscore)" -msgstr "_ (下線)" - -#: ../../library/gettext.rst:56 -msgid "gettext" -msgstr "gettext" - -#: ../../library/gettext.rst:394 -msgid "GNOME" -msgstr "GNOME" diff --git a/library/glob.po b/library/glob.po index efa6fb8ff..e173f76db 100644 --- a/library/glob.po +++ b/library/glob.po @@ -1,35 +1,37 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Inada Naoki , 2023 -# 石井明久, 2024 -# Takanori Suzuki , 2024 -# tomo, 2024 -# Arihiro TAKASE, 2024 -# Takeshi Nakazato, 2024 +# Nozomu Kaneko , 2017 +# Inada Naoki , 2017 +# Masato HASHIMOTO , 2017 +# E. Kawashima, 2017 +# Shun Sakurai, 2017 +# Arihiro TAKASE, 2017 +# Tetsuo Koyama , 2020 +# tomo, 2021 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-30 14:22+0000\n" -"PO-Revision-Date: 2021-06-28 01:06+0000\n" -"Last-Translator: Takeshi Nakazato, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-03-02 05:36+0000\n" +"PO-Revision-Date: 2017-02-16 23:12+0000\n" +"Last-Translator: tomo, 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/glob.rst:2 -msgid ":mod:`!glob` --- Unix style pathname pattern expansion" -msgstr ":mod:`!glob` --- Unix 形式のパス名のパターン展開" +msgid ":mod:`glob` --- Unix style pathname pattern expansion" +msgstr ":mod:`glob` --- Unix 形式のパス名のパターン展開" #: ../../library/glob.rst:7 msgid "**Source code:** :source:`Lib/glob.py`" @@ -42,28 +44,22 @@ msgid "" "in arbitrary order. No tilde expansion is done, but ``*``, ``?``, and " "character ranges expressed with ``[]`` will be correctly matched. This is " "done by using the :func:`os.scandir` and :func:`fnmatch.fnmatch` functions " -"in concert, and not by actually invoking a subshell." +"in concert, and not by actually invoking a subshell. Note that unlike :func:" +"`fnmatch.fnmatch`, :mod:`glob` treats filenames beginning with a dot (``.``) " +"as special cases. (For tilde and shell variable expansion, use :func:`os." +"path.expanduser` and :func:`os.path.expandvars`.)" msgstr "" ":mod:`glob` モジュールは Unix シェルで使われているルールに従い指定されたパ" "ターンに一致するすべてのパス名を見つけ出します。返される結果の順序は不定で" "す。チルダ展開は行われませんが、``*``, ``?``, および ``[]`` で表現される文字" "範囲については正しくマッチされます。これは、関数 :func:`os.scandir` および :" "func:`fnmatch.fnmatch` を使用して行われており、実際にサブシェルを呼び出してい" -"るわけではありません。" - -#: ../../library/glob.rst:28 -msgid "" -"Note that files beginning with a dot (``.``) can only be matched by patterns " -"that also start with a dot, unlike :func:`fnmatch.fnmatch` or :func:`pathlib." -"Path.glob`. (For tilde and shell variable expansion, use :func:`os.path." -"expanduser` and :func:`os.path.expandvars`.)" -msgstr "" -"ドット (``.``) で始まるファイルは、同じくドットで始まるパターンにのみマッチし" -"ます。この動作は :func:`fnmatch.fnmatch` や :func:`pathlib.Path.glob` とは異" -"なります。 (チルダやシェル変数の展開には、 :func:`os.path.expanduser` と :" -"func:`os.path.expandvars` を使ってください。)" +"るわけではありません。:func:`fnmatch.fnmatch` と異なり、:mod:`glob` はドット " +"(``.``) で始まるファイル名は特別扱いする点に注意してください。(チルダおよび" +"シェル変数の展開を利用したい場合は :func:`os.path.expanduser` および :func:" +"`os.path.expandvars` を使用してください。)" -#: ../../library/glob.rst:34 +#: ../../library/glob.rst:31 msgid "" "For a literal match, wrap the meta-characters in brackets. For example, " "``'[?]'`` matches the character ``'?'``." @@ -71,53 +67,31 @@ msgstr "" "リテラルにマッチさせるには、メタ文字を括弧に入れてください。例えば、" "``'[?]'`` は文字 ``'?'`` にマッチします。" -#: ../../library/glob.rst:37 -msgid "The :mod:`glob` module defines the following functions:" -msgstr ":mod:`glob` モジュールは以下の関数を定義しています:" +#: ../../library/glob.rst:36 +msgid "The :mod:`pathlib` module offers high-level path objects." +msgstr ":mod:`pathlib` モジュールは高水準のパスオブジェクトを提供します。" -#: ../../library/glob.rst:43 +#: ../../library/glob.rst:41 msgid "" -"Return a possibly empty list of path names that match *pathname*, which must " +"Return a possibly-empty list of path names that match *pathname*, which must " "be a string containing a path specification. *pathname* can be either " "absolute (like :file:`/usr/src/Python-1.5/Makefile`) or relative (like :file:" "`../../Tools/\\*/\\*.gif`), and can contain shell-style wildcards. Broken " "symlinks are included in the results (as in the shell). Whether or not the " "results are sorted depends on the file system. If a file that satisfies " "conditions is removed or added during the call of this function, whether a " -"path name for that file will be included is unspecified." -msgstr "" -"パスの仕様を含む文字列 *pathname* にマッチするパス名のリストを返します。戻り" -"値のリストは空になる可能性があります。 *pathname* は (:file:`/usr/src/" -"Python-1.5/Makefile` のような) 絶対パスも、 (:file:`../../Tools/\\*/\\*.gif` " -"のような) 相対パスもどちらも指定可能で、シェル形式のワイルドカードを含めるこ" -"ともできます。参照先が存在しない、壊れたシンボリックリンクも (シェルの場合と" -"同様に) 結果に含まれます。結果がソートされているかどうかはファイルシステムに" -"よります。条件を満たすファイルがこの関数の呼び出し中に追加または削除された場" -"合、それらのファイルに対するパス名が結果に含まれるかどうかはの動作は不定で" -"す。" - -#: ../../library/glob.rst:52 -msgid "" -"If *root_dir* is not ``None``, it should be a :term:`path-like object` " -"specifying the root directory for searching. It has the same effect on :" -"func:`glob` as changing the current directory before calling it. If " -"*pathname* is relative, the result will contain paths relative to *root_dir*." +"path name for that file be included is unspecified." msgstr "" -"*root_dir* が ``None`` でない場合、その値は検索のルートディレクトリを指定す" -"る :term:`path-like オブジェクト ` でなければなりません。こ" -"れは :func:`glob` を呼び出す前にカレントディレクトリを変更したのと同じ効果を" -"持ちます。 *pathname* が相対パスの場合、戻り値のリストは *root_dir* からの相" -"対パスを含むことになります。" +"*pathname* (パスの指定を含んだ文字列でなければいけません) にマッチする、空の" +"可能性のあるパス名のリストを返します。*pathname* は (:file:`/usr/src/" +"Python-1.5/Makefile` のように) 絶対パスでも、(:file:`../../Tools/\\*/\\*." +"gif` のように) 相対パスでもよく、シェル形式のワイルドカードを含んでいてもかま" +"いません。結果には (シェルと同じく) 壊れたシンボリックリンクも含まれます。結" +"果がソートされるかどうかは、ファイルシステムによって異なります。この関数の呼" +"び出し中に条件を満たすファイルが移動や追加された場合、そのファイルのパス名を" +"含むかどうかは指定されていません。" -#: ../../library/glob.rst:58 -msgid "" -"This function can support :ref:`paths relative to directory descriptors " -"` with the *dir_fd* parameter." -msgstr "" -"この関数は *dir_fd* パラメタで :ref:`ディレクトリ記述子への相対パス " -"` をサポートしています。" - -#: ../../library/glob.rst:64 +#: ../../library/glob.rst:53 msgid "" "If *recursive* is true, the pattern \"``**``\" will match any files and zero " "or more directories, subdirectories and symbolic links to directories. If " @@ -129,15 +103,7 @@ msgstr "" "ます。パターンの末尾が :data:`os.sep` または :data:`os.altsep` の場合、ファイ" "ルは一致しません。" -#: ../../library/glob.rst:69 -msgid "" -"If *include_hidden* is true, \"``**``\" pattern will match hidden " -"directories." -msgstr "" -"*include_hidden* が真の場合、パターン \"``**``\" は隠しディレクトリにマッチし" -"ます。" - -#: ../../library/glob.rst:71 ../../library/glob.rst:98 +#: ../../library/glob.rst:58 ../../library/glob.rst:73 msgid "" "Raises an :ref:`auditing event ` ``glob.glob`` with arguments " "``pathname``, ``recursive``." @@ -145,15 +111,7 @@ msgstr "" "引数 ``pathname``, ``recursive`` を指定して :ref:`監査イベント ` " "``glob.glob`` を送出します。 " -#: ../../library/glob.rst:72 ../../library/glob.rst:99 -msgid "" -"Raises an :ref:`auditing event ` ``glob.glob/2`` with arguments " -"``pathname``, ``recursive``, ``root_dir``, ``dir_fd``." -msgstr "" -"引数 ``pathname``, ``recursive``, ``root_dir``, ``dir_fd`` を指定して :ref:`" -"監査イベント ` ``glob.glob/2`` を送出します。 " - -#: ../../library/glob.rst:75 +#: ../../library/glob.rst:61 msgid "" "Using the \"``**``\" pattern in large directory trees may consume an " "inordinate amount of time." @@ -161,27 +119,11 @@ msgstr "" "パターン \"``**``\" を大きなディレクトリツリーで使用するととてつもなく時間が" "かかるかもしれません。" -#: ../../library/glob.rst:79 ../../library/glob.rst:102 -msgid "" -"This function may return duplicate path names if *pathname* contains " -"multiple \"``**``\" patterns and *recursive* is true." -msgstr "" -"*pathname* が複数の \"``**``\" パターンを含み、かつ *recursive* が真の場合、" -"この関数は同じパスを重複して返す可能性があります。" - -#: ../../library/glob.rst:82 ../../library/glob.rst:105 +#: ../../library/glob.rst:64 msgid "Support for recursive globs using \"``**``\"." msgstr "\"``**``\" を使った再帰的な glob がサポートされました。" -#: ../../library/glob.rst:85 ../../library/glob.rst:108 -msgid "Added the *root_dir* and *dir_fd* parameters." -msgstr "*root_dir* と *dir_fd* 引数が追加されました。" - -#: ../../library/glob.rst:88 ../../library/glob.rst:111 -msgid "Added the *include_hidden* parameter." -msgstr "*include_hidden* パラメータが追加されました。" - -#: ../../library/glob.rst:95 +#: ../../library/glob.rst:70 msgid "" "Return an :term:`iterator` which yields the same values as :func:`glob` " "without actually storing them all simultaneously." @@ -189,7 +131,7 @@ msgstr "" "実際には一度にすべてを格納せずに、:func:`glob` と同じ値を順に生成する :term:`" "イテレーター ` を返します。" -#: ../../library/glob.rst:117 +#: ../../library/glob.rst:78 msgid "" "Escape all special characters (``'?'``, ``'*'`` and ``'['``). This is useful " "if you want to match an arbitrary literal string that may have special " @@ -203,106 +145,20 @@ msgstr "" "は ``escape('//?/c:/Quo vadis?.txt')`` は ``'//?/c:/Quo vadis[?].txt'`` を返" "します。" -#: ../../library/glob.rst:128 -msgid "" -"Convert the given path specification to a regular expression for use with :" -"func:`re.match`. The path specification can contain shell-style wildcards." -msgstr "" -"与えられたパスの仕様を :func:`re.match` で利用するための正規表現に変換しま" -"す。シェル形式のワイルドカードを含めることもできます。" - -#: ../../library/glob.rst:131 -msgid "For example:" -msgstr "例えば:" - -#: ../../library/glob.rst:142 -msgid "" -"Path separators and segments are meaningful to this function, unlike :func:" -"`fnmatch.translate`. By default wildcards do not match path separators, and " -"``*`` pattern segments match precisely one path segment." -msgstr "" -":func:`fnmatch.translate` と違って、この関数ではパスの要素を区切るセパレータ" -"とセグメントには意味があります。デフォルトでは、ワイルドカードはパスのセパ" -"レータにはマッチしません。また ``*`` パターンのセグメントは厳密に単一のパスの" -"セグメントにマッチします。" - -#: ../../library/glob.rst:146 +#: ../../library/glob.rst:87 msgid "" -"If *recursive* is true, the pattern segment \"``**``\" will match any number " -"of path segments." +"For example, consider a directory containing the following files: :file:`1." +"gif`, :file:`2.txt`, :file:`card.gif` and a subdirectory :file:`sub` which " +"contains only the file :file:`3.txt`. :func:`glob` will produce the " +"following results. Notice how any leading components of the path are " +"preserved. ::" msgstr "" -"*recursive* が真の場合、パターンセグメント \"``**``\" は任意の数のパスセグメ" -"ントにマッチします。" +"たとえば、次の 3 個のファイル :file:`1.gif`, :file:`2.txt`, :file:`card.gif` " +"と、ファイル :file:`3.txt` だけを含んだサブディレクトリ :file:`sub` があった" +"場合、:func:`glob` は以下の結果を返します。パスに接頭する要素がどう維持される" +"かに注意してください。::" -#: ../../library/glob.rst:149 -msgid "" -"If *include_hidden* is true, wildcards can match path segments that start " -"with a dot (``.``)." -msgstr "" -"*include_hidden* が真の場合、ワイルドカードはドット (``.``) で始まるパスセグ" -"メントにもマッチします。" - -#: ../../library/glob.rst:152 -msgid "" -"A sequence of path separators may be supplied to the *seps* argument. If not " -"given, :data:`os.sep` and :data:`~os.altsep` (if available) are used." -msgstr "" -"パスの要素を区切るセパレータのシーケンスを *seps* 引数に渡すことができます。" -"渡さない場合は :data:`os.sep` と (もしあれば) :data:`~os.altsep` が使われま" -"す。" - -#: ../../library/glob.rst:157 -msgid "" -":meth:`pathlib.PurePath.full_match` and :meth:`pathlib.Path.glob` methods, " -"which call this function to implement pattern matching and globbing." -msgstr "" -":meth:`pathlib.PurePath.full_match` と :meth:`pathlib.Path.glob` の2つのメ" -"ソッドは、それぞれパターンマッチと glob 相当の操作を実装するためにこの関数を" -"呼んでいます。" - -#: ../../library/glob.rst:165 -msgid "Examples" -msgstr "使用例" - -#: ../../library/glob.rst:167 -msgid "" -"Consider a directory containing the following files: :file:`1.gif`, :file:`2." -"txt`, :file:`card.gif` and a subdirectory :file:`sub` which contains only " -"the file :file:`3.txt`. :func:`glob` will produce the following results. " -"Notice how any leading components of the path are preserved. ::" -msgstr "" -"次のファイルを含むディレクトリを考えます: :file:`1.gif`, :file:`2.txt`, :" -"file:`card.gif` および:file:`3.txt` だけを含む :file:`sub` サブディレクトリ。" -"このとき、 :func:`glob` は以下の結果を返します。パスにおける先頭の要素がどの" -"ように保持されるかに注意してください::" - -#: ../../library/glob.rst:173 -msgid "" -">>> import glob\n" -">>> glob.glob('./[0-9].*')\n" -"['./1.gif', './2.txt']\n" -">>> glob.glob('*.gif')\n" -"['1.gif', 'card.gif']\n" -">>> glob.glob('?.gif')\n" -"['1.gif']\n" -">>> glob.glob('**/*.txt', recursive=True)\n" -"['2.txt', 'sub/3.txt']\n" -">>> glob.glob('./**/', recursive=True)\n" -"['./', './sub/']" -msgstr "" -">>> import glob\n" -">>> glob.glob('./[0-9].*')\n" -"['./1.gif', './2.txt']\n" -">>> glob.glob('*.gif')\n" -"['1.gif', 'card.gif']\n" -">>> glob.glob('?.gif')\n" -"['1.gif']\n" -">>> glob.glob('**/*.txt', recursive=True)\n" -"['2.txt', 'sub/3.txt']\n" -">>> glob.glob('./**/', recursive=True)\n" -"['./', './sub/']" - -#: ../../library/glob.rst:185 +#: ../../library/glob.rst:105 msgid "" "If the directory contains files starting with ``.`` they won't be matched by " "default. For example, consider a directory containing :file:`card.gif` and :" @@ -312,67 +168,10 @@ msgstr "" "マッチしません。例えば、 :file:`card.gif` と :file:`.card.gif` を含むディレク" "トリを考えてください::" -#: ../../library/glob.rst:189 -msgid "" -">>> import glob\n" -">>> glob.glob('*.gif')\n" -"['card.gif']\n" -">>> glob.glob('.c*')\n" -"['.card.gif']" -msgstr "" -">>> import glob\n" -">>> glob.glob('*.gif')\n" -"['card.gif']\n" -">>> glob.glob('.c*')\n" -"['.card.gif']" - -#: ../../library/glob.rst:196 -msgid "" -"The :mod:`fnmatch` module offers shell-style filename (not path) expansion." -msgstr "" -":mod:`fnmatch` モジュールは、シェル形式の (パスではなく) ファイル名の展開機能" -"を提供します。" - -#: ../../library/glob.rst:199 -msgid "The :mod:`pathlib` module offers high-level path objects." -msgstr ":mod:`pathlib` モジュールは高水準のパスオブジェクトを提供します。" - -#: ../../library/glob.rst:9 -msgid "filenames" -msgstr "filenames" - -#: ../../library/glob.rst:9 -msgid "pathname expansion" -msgstr "pathname expansion" - -#: ../../library/glob.rst:13 -msgid "* (asterisk)" -msgstr "* (アスタリスク)" - -#: ../../library/glob.rst:13 ../../library/glob.rst:61 -msgid "in glob-style wildcards" -msgstr "glob 形式のワイルドカード" - -#: ../../library/glob.rst:13 -msgid "? (question mark)" -msgstr "? (クエスチョンマーク)" - -#: ../../library/glob.rst:13 -msgid "[] (square brackets)" -msgstr "[] (角カッコ)" - -#: ../../library/glob.rst:13 -msgid "! (exclamation)" -msgstr "! (エクスクラメーション)" - -#: ../../library/glob.rst:13 -msgid "- (minus)" -msgstr "- (負符号)" - -#: ../../library/glob.rst:13 -msgid ". (dot)" -msgstr ". (ドット)" +#: ../../library/glob.rst:117 +msgid "Module :mod:`fnmatch`" +msgstr ":mod:`fnmatch` モジュール" -#: ../../library/glob.rst:61 -msgid "**" -msgstr "**" +#: ../../library/glob.rst:118 +msgid "Shell-style filename (not path) expansion" +msgstr "シェル形式の (パスではない) ファイル名展開" diff --git a/library/graphlib.po b/library/graphlib.po index 7edeedd4c..088edd76a 100644 --- a/library/graphlib.po +++ b/library/graphlib.po @@ -1,47 +1,40 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 +# tomo, 2020 +# Tetsuo Koyama , 2020 # Osamu NAKAMURA, 2021 -# Tetsuo Koyama , 2021 -# Arihiro TAKASE, 2023 -# 石井明久, 2024 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 01:06+0000\n" -"Last-Translator: 石井明久, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-06-30 06:46+0000\n" +"PO-Revision-Date: 2020-06-01 03:18+0000\n" +"Last-Translator: Osamu NAKAMURA, 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/graphlib.rst:2 -msgid "" -":mod:`!graphlib` --- Functionality to operate with graph-like structures" -msgstr ":mod:`!graphlib` --- グラフ構造を操作する機能" +msgid ":mod:`graphlib` --- Functionality to operate with graph-like structures" +msgstr "" #: ../../library/graphlib.rst:8 msgid "**Source code:** :source:`Lib/graphlib.py`" msgstr "**ソースコード:** :source:`Lib/graphlib.py`" #: ../../library/graphlib.rst:20 -msgid "" -"Provides functionality to topologically sort a graph of :term:`hashable` " -"nodes." -msgstr "" -":term:`ハッシュ可能 ` な頂点のグラフをトポロジカルソートする機能を" -"提供します。" +msgid "Provides functionality to topologically sort a graph of hashable nodes." +msgstr "ハッシュ可能な頂点のグラフをトポロジカルソートする機能を提供します。" #: ../../library/graphlib.rst:22 msgid "" @@ -72,7 +65,7 @@ msgstr "" "もしオプションの *graph* 引数が与えられた場合、その値は有向非巡回グラフを表す" "辞書でなければならず、辞書はそのキーがノードで、その値はキーのノードの先行" "ノードのイテラブルとなります(言い換えると、辞書の値はそのキーのノードを指す" -"辺を持つノードのイテラブルです) 辺 :meth:`~TopologicalSorter.add` メソッドを" +"辺を持つノードのイテラブルです) 辺:meth:`~TopologicalSorter.add` メソッドを" "使うことで、さらにノードを追加することができます。" #: ../../library/graphlib.rst:37 @@ -119,14 +112,6 @@ msgstr "" "すぐにグラフのノードをソートした結果が必要で、並行性が不要な場合、便利なメ" "ソッド :meth:`TopologicalSorter.static_order` を直接呼び出すことができます:" -#: ../../library/graphlib.rst:53 -msgid "" -">>> graph = {\"D\": {\"B\", \"C\"}, \"C\": {\"A\"}, \"B\": {\"A\"}}\n" -">>> ts = TopologicalSorter(graph)\n" -">>> tuple(ts.static_order())\n" -"('A', 'C', 'B', 'D')" -msgstr "" - #: ../../library/graphlib.rst:60 msgid "" "The class is designed to easily support parallel processing of the nodes as " @@ -135,38 +120,13 @@ msgstr "" "このクラスは、簡単に準備が整ったノードの並列処理を行えるよう設計されていま" "す。例えば::" -#: ../../library/graphlib.rst:63 -msgid "" -"topological_sorter = TopologicalSorter()\n" -"\n" -"# Add nodes to 'topological_sorter'...\n" -"\n" -"topological_sorter.prepare()\n" -"while topological_sorter.is_active():\n" -" for node in topological_sorter.get_ready():\n" -" # Worker threads or processes take nodes to work on off the\n" -" # 'task_queue' queue.\n" -" task_queue.put(node)\n" -"\n" -" # When the work for a node is done, workers put the node in\n" -" # 'finalized_tasks_queue' so we can get more nodes to work on.\n" -" # The definition of 'is_active()' guarantees that, at this point, at\n" -" # least one node has been placed on 'task_queue' that hasn't yet\n" -" # been passed to 'done()', so this blocking 'get()' must (eventually)\n" -" # succeed. After calling 'done()', we loop back to call 'get_ready()'\n" -" # again, so put newly freed nodes on 'task_queue' as soon as\n" -" # logically possible.\n" -" node = finalized_tasks_queue.get()\n" -" topological_sorter.done(node)" -msgstr "" - #: ../../library/graphlib.rst:87 msgid "" "Add a new node and its predecessors to the graph. Both the *node* and all " -"elements in *predecessors* must be :term:`hashable`." +"elements in *predecessors* must be hashable." msgstr "" "新しいノードとその先行ノードをグラフに追加します。 *node* と *predecessors* " -"のすべての要素は :term:`ハッシュ可能 ` でなければなりません。" +"のすべての要素はハッシュ可能でなければなりません。" #: ../../library/graphlib.rst:90 msgid "" @@ -201,19 +161,7 @@ msgid "" "`~TopologicalSorter.add`." msgstr "" -#: ../../library/graphlib.rst:109 -msgid "" -"A :exc:`ValueError` will be raised if the sort has been started by :meth:`~." -"static_order` or :meth:`~.get_ready`." -msgstr "" - -#: ../../library/graphlib.rst:114 -msgid "" -"``prepare()`` can now be called more than once as long as the sort has not " -"started. Previously this raised :exc:`ValueError`." -msgstr "" - -#: ../../library/graphlib.rst:119 +#: ../../library/graphlib.rst:111 msgid "" "Returns ``True`` if more progress can be made and ``False`` otherwise. " "Progress can be made if cycles do not block the resolution and either there " @@ -223,29 +171,19 @@ msgid "" "meth:`TopologicalSorter.get_ready`." msgstr "" -#: ../../library/graphlib.rst:126 +#: ../../library/graphlib.rst:118 msgid "" -"The :meth:`~object.__bool__` method of this class defers to this function, " -"so instead of::" +"The :meth:`~TopologicalSorter.__bool__` method of this class defers to this " +"function, so instead of::" msgstr "" +"このクラスの :meth:`~TopologicalSorter.__bool__` メソッドはこの関数を呼び出す" +"ため、以下のようにする代わりに:" -#: ../../library/graphlib.rst:129 -msgid "" -"if ts.is_active():\n" -" ..." -msgstr "" - -#: ../../library/graphlib.rst:132 +#: ../../library/graphlib.rst:124 msgid "it is possible to simply do::" msgstr "このように簡単に記述できます:" -#: ../../library/graphlib.rst:134 -msgid "" -"if ts:\n" -" ..." -msgstr "" - -#: ../../library/graphlib.rst:137 ../../library/graphlib.rst:160 +#: ../../library/graphlib.rst:129 ../../library/graphlib.rst:152 msgid "" "Raises :exc:`ValueError` if called without calling :meth:`~TopologicalSorter." "prepare` previously." @@ -253,14 +191,14 @@ msgstr "" "前もって :meth:`~TopologicalSorter.prepare` を呼び出さずにこの関数を呼び出す" "と :exc:`ValueError` を送出します。" -#: ../../library/graphlib.rst:142 +#: ../../library/graphlib.rst:134 msgid "" "Marks a set of nodes returned by :meth:`TopologicalSorter.get_ready` as " "processed, unblocking any successor of each node in *nodes* for being " "returned in the future by a call to :meth:`TopologicalSorter.get_ready`." msgstr "" -#: ../../library/graphlib.rst:146 +#: ../../library/graphlib.rst:138 msgid "" "Raises :exc:`ValueError` if any node in *nodes* has already been marked as " "processed by a previous call to this method or if a node was not added to " @@ -269,7 +207,7 @@ msgid "" "meth:`~TopologicalSorter.get_ready`." msgstr "" -#: ../../library/graphlib.rst:154 +#: ../../library/graphlib.rst:146 msgid "" "Returns a ``tuple`` with all the nodes that are ready. Initially it returns " "all nodes with no predecessors, and once those are marked as processed by " @@ -278,7 +216,7 @@ msgid "" "progress can be made, empty tuples are returned." msgstr "" -#: ../../library/graphlib.rst:165 +#: ../../library/graphlib.rst:157 msgid "" "Returns an iterator object which will iterate over nodes in a topological " "order. When using this method, :meth:`~TopologicalSorter.prepare` and :meth:" @@ -286,38 +224,13 @@ msgid "" "to::" msgstr "" -#: ../../library/graphlib.rst:170 -msgid "" -"def static_order(self):\n" -" self.prepare()\n" -" while self.is_active():\n" -" node_group = self.get_ready()\n" -" yield from node_group\n" -" self.done(*node_group)" -msgstr "" - -#: ../../library/graphlib.rst:177 +#: ../../library/graphlib.rst:169 msgid "" "The particular order that is returned may depend on the specific order in " "which the items were inserted in the graph. For example:" msgstr "" -#: ../../library/graphlib.rst:180 -msgid "" -">>> ts = TopologicalSorter()\n" -">>> ts.add(3, 2, 1)\n" -">>> ts.add(1, 0)\n" -">>> print([*ts.static_order()])\n" -"[2, 0, 1, 3]\n" -"\n" -">>> ts2 = TopologicalSorter()\n" -">>> ts2.add(1, 0)\n" -">>> ts2.add(3, 2, 1)\n" -">>> print([*ts2.static_order()])\n" -"[0, 2, 1, 3]" -msgstr "" - -#: ../../library/graphlib.rst:194 +#: ../../library/graphlib.rst:186 msgid "" "This is due to the fact that \"0\" and \"2\" are in the same level in the " "graph (they would have been returned in the same call to :meth:" @@ -325,29 +238,29 @@ msgid "" "the order of insertion." msgstr "" -#: ../../library/graphlib.rst:200 +#: ../../library/graphlib.rst:192 msgid "If any cycle is detected, :exc:`CycleError` will be raised." msgstr "" -#: ../../library/graphlib.rst:206 +#: ../../library/graphlib.rst:198 msgid "Exceptions" msgstr "例外" -#: ../../library/graphlib.rst:207 +#: ../../library/graphlib.rst:199 msgid "The :mod:`graphlib` module defines the following exception classes:" msgstr ":mod:`graphlib` モジュールは以下の例外クラスを定義します:" -#: ../../library/graphlib.rst:211 +#: ../../library/graphlib.rst:203 msgid "" "Subclass of :exc:`ValueError` raised by :meth:`TopologicalSorter.prepare` if " "cycles exist in the working graph. If multiple cycles exist, only one " "undefined choice among them will be reported and included in the exception." msgstr "" -#: ../../library/graphlib.rst:215 +#: ../../library/graphlib.rst:207 msgid "" "The detected cycle can be accessed via the second element in the :attr:" -"`~BaseException.args` attribute of the exception instance and consists in a " +"`~CycleError.args` attribute of the exception instance and consists in a " "list of nodes, such that each node is, in the graph, an immediate " "predecessor of the next node in the list. In the reported list, the first " "and the last node will be the same, to make it clear that it is cyclic." diff --git a/library/grp.po b/library/grp.po index 58b46ea05..0191e5423 100644 --- a/library/grp.po +++ b/library/grp.po @@ -1,33 +1,34 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 +# Masato HASHIMOTO , 2017 +# tomo, 2017 +# 秘湯 , 2017 +# Arihiro TAKASE, 2017 # Osamu NAKAMURA, 2021 -# Arihiro TAKASE, 2023 -# 石井明久, 2024 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-13 14:21+0000\n" -"PO-Revision-Date: 2021-06-28 01:07+0000\n" -"Last-Translator: 石井明久, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 23:12+0000\n" +"Last-Translator: Osamu NAKAMURA, 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/grp.rst:2 -msgid ":mod:`!grp` --- The group database" -msgstr ":mod:`!grp` --- グループデータベース" +msgid ":mod:`grp` --- The group database" +msgstr ":mod:`grp` --- グループデータベースへのアクセス" #: ../../library/grp.rst:10 msgid "" @@ -38,80 +39,76 @@ msgstr "" "ます。全ての Unix バージョンで利用可能です。" #: ../../library/grp.rst:13 -msgid "Availability" -msgstr "" - -#: ../../library/grp.rst:15 msgid "" "Group database entries are reported as a tuple-like object, whose attributes " "correspond to the members of the ``group`` structure (Attribute field below, " -"see ````):" +"see ````):" msgstr "" "このモジュールはグループデータベースのエントリをタプルに似たオブジェクトとし" "て報告されます。このオブジェクトの属性は ``group`` 構造体の各メンバ (以下の属" -"性フィールド、```` を参照) に対応します:" +"性フィールド、```` を参照) に対応します:" -#: ../../library/grp.rst:20 +#: ../../library/grp.rst:18 msgid "Index" msgstr "インデックス" -#: ../../library/grp.rst:20 +#: ../../library/grp.rst:18 msgid "Attribute" msgstr "属性" -#: ../../library/grp.rst:20 +#: ../../library/grp.rst:18 msgid "Meaning" msgstr "意味" -#: ../../library/grp.rst:22 +#: ../../library/grp.rst:20 msgid "0" msgstr "0" -#: ../../library/grp.rst:22 +#: ../../library/grp.rst:20 msgid "gr_name" msgstr "gr_name" -#: ../../library/grp.rst:22 +#: ../../library/grp.rst:20 msgid "the name of the group" msgstr "グループ名" -#: ../../library/grp.rst:24 +#: ../../library/grp.rst:22 msgid "1" msgstr "1" -#: ../../library/grp.rst:24 +#: ../../library/grp.rst:22 msgid "gr_passwd" msgstr "gr_passwd" -#: ../../library/grp.rst:24 +#: ../../library/grp.rst:22 msgid "the (encrypted) group password; often empty" msgstr "(暗号化された) グループパスワード; しばしば空文字列になります" -#: ../../library/grp.rst:27 +#: ../../library/grp.rst:25 msgid "2" msgstr "2" -#: ../../library/grp.rst:27 +#: ../../library/grp.rst:25 msgid "gr_gid" msgstr "gr_gid" -#: ../../library/grp.rst:27 +#: ../../library/grp.rst:25 msgid "the numerical group ID" msgstr "数字のグループ ID" -#: ../../library/grp.rst:29 +#: ../../library/grp.rst:27 msgid "3" msgstr "3" -#: ../../library/grp.rst:29 +#: ../../library/grp.rst:27 msgid "gr_mem" msgstr "gr_mem" -#: ../../library/grp.rst:29 +#: ../../library/grp.rst:27 msgid "all the group member's user names" msgstr "グループメンバの全てのユーザ名" -#: ../../library/grp.rst:33 +#: ../../library/grp.rst:31 msgid "" "The gid is an integer, name and password are strings, and the member list is " "a list of strings. (Note that most users are not explicitly listed as " @@ -129,11 +126,11 @@ msgstr "" "性があり、 :func:`getgrnam` や :func:`getgrgid` でアクセスできないかもしれな" "いことにも注意してください。)" -#: ../../library/grp.rst:40 +#: ../../library/grp.rst:38 msgid "It defines the following items:" msgstr "このモジュールでは以下の内容を定義しています:" -#: ../../library/grp.rst:45 +#: ../../library/grp.rst:43 msgid "" "Return the group database entry for the given numeric group ID. :exc:" "`KeyError` is raised if the entry asked for cannot be found." @@ -141,14 +138,15 @@ msgstr "" "与えられたグループ ID に対するグループデータベースエントリを返します。要求し" "たエントリが見つからなかった場合、 :exc:`KeyError` が送出されます。" -#: ../../library/grp.rst:48 +#: ../../library/grp.rst:46 msgid "" -":exc:`TypeError` is raised for non-integer arguments like floats or strings." +"Since Python 3.6 the support of non-integer arguments like floats or strings " +"in :func:`getgrgid` is deprecated." msgstr "" -"浮動小数点数や文字列のような、整数でない引数には :exc:`TypeError` が送出され" -"ます。" +"Python 3.6から、浮動小数点数や文字列のような非整数値の引数のサポートが撤廃さ" +"れました。" -#: ../../library/grp.rst:53 +#: ../../library/grp.rst:52 msgid "" "Return the group database entry for the given group name. :exc:`KeyError` is " "raised if the entry asked for cannot be found." @@ -156,7 +154,7 @@ msgstr "" "与えられたグループ名に対するグループデータベースエントリを返します。要求した" "エントリが見つからなかった場合、 :exc:`KeyError` が送出されます。" -#: ../../library/grp.rst:59 +#: ../../library/grp.rst:58 msgid "Return a list of all available group entries, in arbitrary order." msgstr "全ての入手可能なグループエントリを返します。順番は決まっていません。" @@ -164,6 +162,15 @@ msgstr "全ての入手可能なグループエントリを返します。順番 msgid "Module :mod:`pwd`" msgstr ":mod:`pwd` モジュール" -#: ../../library/grp.rst:65 +#: ../../library/grp.rst:64 msgid "An interface to the user database, similar to this." msgstr "このモジュールと類似の、ユーザデータベースへのインターフェース。" + +#: ../../library/grp.rst:66 +msgid "Module :mod:`spwd`" +msgstr ":mod:`spwd` モジュール" + +#: ../../library/grp.rst:67 +msgid "An interface to the shadow password database, similar to this." +msgstr "" +"このモジュールと類似の、シャドウパスワードデータベースへのインターフェース。" diff --git a/library/gzip.po b/library/gzip.po index 1ad7cac37..df86a25b8 100644 --- a/library/gzip.po +++ b/library/gzip.po @@ -1,32 +1,36 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: +# Shun Sakurai, 2017 +# Masato HASHIMOTO , 2017 +# Arihiro TAKASE, 2017 +# E. Kawashima, 2017 +# Osamu NAKAMURA, 2017 +# tomo, 2019 # Takanori Suzuki , 2021 -# tomo, 2021 -# 石井明久, 2024 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 01:07+0000\n" -"Last-Translator: 石井明久, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 23:12+0000\n" +"Last-Translator: Takanori Suzuki , 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/gzip.rst:2 -msgid ":mod:`!gzip` --- Support for :program:`gzip` files" -msgstr ":mod:`!gzip` --- :program:`gzip` ファイルのサポート" +msgid ":mod:`gzip` --- Support for :program:`gzip` files" +msgstr ":mod:`gzip` --- :program:`gzip` ファイルのサポート" #: ../../library/gzip.rst:7 msgid "**Source code:** :source:`Lib/gzip.py`" @@ -138,24 +142,28 @@ msgstr "" msgid "Added support for the ``'x'``, ``'xb'`` and ``'xt'`` modes." msgstr " ``'x'``、``'xb'``、``'xt'`` モードのサポートが追加されました。" -#: ../../library/gzip.rst:59 ../../library/gzip.rst:173 +#: ../../library/gzip.rst:59 ../../library/gzip.rst:165 msgid "Accepts a :term:`path-like object`." msgstr ":term:`path-like object` を受け入れるようになりました。" #: ../../library/gzip.rst:64 msgid "" -"An exception raised for invalid gzip files. It inherits from :exc:" -"`OSError`. :exc:`EOFError` and :exc:`zlib.error` can also be raised for " -"invalid gzip files." +"An exception raised for invalid gzip files. It inherits :exc:`OSError`. :" +"exc:`EOFError` and :exc:`zlib.error` can also be raised for invalid gzip " +"files." msgstr "" #: ../../library/gzip.rst:72 msgid "" "Constructor for the :class:`GzipFile` class, which simulates most of the " -"methods of a :term:`file object`, with the exception of the :meth:`~io." -"IOBase.truncate` method. At least one of *fileobj* and *filename* must be " -"given a non-trivial value." +"methods of a :term:`file object`, with the exception of the :meth:`truncate` " +"method. At least one of *fileobj* and *filename* must be given a non-" +"trivial value." msgstr "" +":class:`GzipFile` クラスのコンストラクタです。:class:`GzipFile` オブジェクト" +"は :meth:`.truncate` メソッドを除くほとんどの :term:`ファイルオブジェクト " +"` のメソッドをシミュレートします。少なくとも *fileobj* および " +"*filename* は有効な値でなければなりません。" #: ../../library/gzip.rst:77 msgid "" @@ -216,42 +224,54 @@ msgstr "" #: ../../library/gzip.rst:103 msgid "" -"The optional *mtime* argument is the timestamp requested by gzip. The time " -"is in Unix format, i.e., seconds since 00:00:00 UTC, January 1, 1970. If " -"*mtime* is omitted or ``None``, the current time is used. Use *mtime* = 0 to " -"generate a compressed stream that does not depend on creation time." +"The *mtime* argument is an optional numeric timestamp to be written to the " +"last modification time field in the stream when compressing. It should only " +"be provided in compression mode. If omitted or ``None``, the current time " +"is used. See the :attr:`mtime` attribute for more details." msgstr "" +"*mtime* 引数は、圧縮時にストリームの最終更新日時フィールドに書き込まれるオプ" +"ションの数値のタイムスタンプです。これは、圧縮モードでのみ提供することができ" +"ます。省略された場合か ``None`` である場合、現在時刻が使用されます。詳細につ" +"いては、 :attr:`mtime` 属性を参照してください。" #: ../../library/gzip.rst:108 msgid "" -"See below for the :attr:`mtime` attribute that is set when decompressing." -msgstr "" - -#: ../../library/gzip.rst:110 -msgid "" -"Calling a :class:`GzipFile` object's :meth:`!close` method does not close " +"Calling a :class:`GzipFile` object's :meth:`close` method does not close " "*fileobj*, since you might wish to append more material after the compressed " "data. This also allows you to pass an :class:`io.BytesIO` object opened for " "writing as *fileobj*, and retrieve the resulting memory buffer using the :" "class:`io.BytesIO` object's :meth:`~io.BytesIO.getvalue` method." msgstr "" +"圧縮したデータの後ろにさらに何か追加したい場合もあるので、:class:`GzipFile` " +"オブジェクトの :meth:`close` メソッド呼び出しは *fileobj* を閉じません。\n" +"このため、書き込みのためにオープンした :class:`io.BytesIO` オブジェクトを " +"*fileobj* として渡し、(:class:`GzipFile` を :meth:`close` した後に) :class:" +"`io.BytesIO` オブジェクトの :meth:`~io.BytesIO.getvalue` メソッドを使って書き" +"込んだデータの入っているメモリバッファを取得することができます。" -#: ../../library/gzip.rst:116 +#: ../../library/gzip.rst:114 msgid "" ":class:`GzipFile` supports the :class:`io.BufferedIOBase` interface, " -"including iteration and the :keyword:`with` statement. Only the :meth:`~io." -"IOBase.truncate` method isn't implemented." +"including iteration and the :keyword:`with` statement. Only the :meth:" +"`truncate` method isn't implemented." msgstr "" +":class:`GzipFile` は、イテレーションと :keyword:`with` 文を含む :class:`io." +"BufferedIOBase` インターフェイスをサポートしています。:meth:`.truncate` メ" +"ソッドのみ実装されていません。" -#: ../../library/gzip.rst:120 +#: ../../library/gzip.rst:118 msgid ":class:`GzipFile` also provides the following method and attribute:" msgstr ":class:`GzipFile` は以下のメソッドと属性も提供しています:" -#: ../../library/gzip.rst:124 +#: ../../library/gzip.rst:122 msgid "" -"Read *n* uncompressed bytes without advancing the file position. The number " -"of bytes returned may be more or less than requested." +"Read *n* uncompressed bytes without advancing the file position. At most one " +"single read on the compressed stream is done to satisfy the call. The " +"number of bytes returned may be more or less than requested." msgstr "" +"ファイル内の位置を移動せずに展開した *n* バイトを読み込みます。呼び出し要求を" +"満たすために、圧縮ストリームに対して最大 1 回の単一読み込みが行われます。返さ" +"れるバイト数はほぼ要求した値になります。" #: ../../library/gzip.rst:127 msgid "" @@ -264,29 +284,29 @@ msgstr "" "`GzipFile` が *fileobj* 引数で作成された場合)" #: ../../library/gzip.rst:136 -msgid "``'rb'`` for reading and ``'wb'`` for writing." -msgstr "``'rb'`` は読み込み用、 ``'wb'`` は書き込み用です。" - -#: ../../library/gzip.rst:138 -msgid "In previous versions it was an integer ``1`` or ``2``." -msgstr "" - -#: ../../library/gzip.rst:143 msgid "" -"When decompressing, this attribute is set to the last timestamp in the most " -"recently read header. It is an integer, holding the number of seconds since " -"the Unix epoch (00:00:00 UTC, January 1, 1970). The initial value before " -"reading any headers is ``None``." +"When decompressing, the value of the last modification time field in the " +"most recently read header may be read from this attribute, as an integer. " +"The initial value before reading any headers is ``None``." msgstr "" +"展開時に、最後に読み取られたヘッダーの最終更新日時フィールドの値は、この属性" +"から整数として読み取ることができます。ヘッダーを読み取る前の初期値は " +"``None`` です。" -#: ../../library/gzip.rst:150 +#: ../../library/gzip.rst:140 msgid "" -"The path to the gzip file on disk, as a :class:`str` or :class:`bytes`. " -"Equivalent to the output of :func:`os.fspath` on the original input path, " -"with no other normalization, resolution or expansion." +"All :program:`gzip` compressed streams are required to contain this " +"timestamp field. Some programs, such as :program:`gunzip`\\ , make use of " +"the timestamp. The format is the same as the return value of :func:`time." +"time` and the :attr:`~os.stat_result.st_mtime` attribute of the object " +"returned by :func:`os.stat`." msgstr "" +":program:`gzip` で圧縮されたすべてのストリームは、このタイムスタンプフィール" +"ドを含む必要があります。:program:`gunzip` などの一部のプログラムがこのタイム" +"スタンプを使用します。形式は、 :func:`time.time` の返り値や、:func:`os.stat` " +"が返すオブジェクトの :attr:`~os.stat_result.st_mtime` 属性と同一です。" -#: ../../library/gzip.rst:154 +#: ../../library/gzip.rst:146 msgid "" "Support for the :keyword:`with` statement was added, along with the *mtime* " "constructor argument and :attr:`mtime` attribute." @@ -294,20 +314,20 @@ msgstr "" ":keyword:`with` 文がサポートされました。*mtime* コンストラクタ引数と :attr:" "`mtime` 属性が追加されました。" -#: ../../library/gzip.rst:158 +#: ../../library/gzip.rst:150 msgid "Support for zero-padded and unseekable files was added." msgstr "" "ゼロパディングされたファイルやシーク出来ないファイルがサポートされました。" -#: ../../library/gzip.rst:161 +#: ../../library/gzip.rst:153 msgid "The :meth:`io.BufferedIOBase.read1` method is now implemented." msgstr ":meth:`io.BufferedIOBase.read1` メソッドを実装しました。" -#: ../../library/gzip.rst:164 +#: ../../library/gzip.rst:156 msgid "Added support for the ``'x'`` and ``'xb'`` modes." msgstr "``'x'`` ならびに ``'xb'`` モードがサポートされました。" -#: ../../library/gzip.rst:167 +#: ../../library/gzip.rst:159 msgid "" "Added support for writing arbitrary :term:`bytes-like objects `. The :meth:`~io.BufferedIOBase.read` method now accepts an argument " @@ -317,122 +337,58 @@ msgstr "" "ポートされました。 :meth:`~io.BufferedIOBase.read` メソッドが ``None`` を引数" "として受け取るようになりました。" -#: ../../library/gzip.rst:176 +#: ../../library/gzip.rst:168 msgid "" "Opening :class:`GzipFile` for writing without specifying the *mode* argument " "is deprecated." msgstr "" -#: ../../library/gzip.rst:180 -msgid "" -"Remove the ``filename`` attribute, use the :attr:`~GzipFile.name` attribute " -"instead." -msgstr "" - -#: ../../library/gzip.rst:187 +#: ../../library/gzip.rst:175 msgid "" "Compress the *data*, returning a :class:`bytes` object containing the " "compressed data. *compresslevel* and *mtime* have the same meaning as in " -"the :class:`GzipFile` constructor above, but *mtime* defaults to 0 for " -"reproducible output." +"the :class:`GzipFile` constructor above." msgstr "" +"*data* を圧縮し、圧縮データを含む :class:`bytes` オブジェクトを返します。" +"*compresslevel* と *mtime* の意味は上記 :class:`GzipFile` コンストラクタと同" +"じです。" -#: ../../library/gzip.rst:193 +#: ../../library/gzip.rst:180 msgid "Added the *mtime* parameter for reproducible output." msgstr "" -#: ../../library/gzip.rst:195 -msgid "" -"Speed is improved by compressing all data at once instead of in a streamed " -"fashion. Calls with *mtime* set to ``0`` are delegated to :func:`zlib." -"compress` for better speed. In this situation the output may contain a gzip " -"header \"OS\" byte value other than 255 \"unknown\" as supplied by the " -"underlying zlib implementation." -msgstr "" - -#: ../../library/gzip.rst:202 -msgid "" -"The gzip header OS byte is guaranteed to be set to 255 when this function is " -"used as was the case in 3.10 and earlier." -msgstr "" - -#: ../../library/gzip.rst:205 -msgid "" -"The *mtime* parameter now defaults to 0 for reproducible output. For the " -"previous behaviour of using the current time, pass ``None`` to *mtime*." -msgstr "" - -#: ../../library/gzip.rst:212 +#: ../../library/gzip.rst:185 msgid "" "Decompress the *data*, returning a :class:`bytes` object containing the " -"uncompressed data. This function is capable of decompressing multi-member " -"gzip data (multiple gzip blocks concatenated together). When the data is " -"certain to contain only one member the :func:`zlib.decompress` function with " -"*wbits* set to 31 is faster." +"uncompressed data." msgstr "" +"*data* を展開し、展開データを含む :class:`bytes` オブジェクトを返します。" -#: ../../library/gzip.rst:219 -msgid "" -"Speed is improved by decompressing members at once in memory instead of in a " -"streamed fashion." -msgstr "" - -#: ../../library/gzip.rst:226 +#: ../../library/gzip.rst:194 msgid "Examples of usage" msgstr "使い方の例" -#: ../../library/gzip.rst:228 +#: ../../library/gzip.rst:196 msgid "Example of how to read a compressed file::" msgstr "圧縮されたファイルを読み込む例::" -#: ../../library/gzip.rst:230 -msgid "" -"import gzip\n" -"with gzip.open('/home/joe/file.txt.gz', 'rb') as f:\n" -" file_content = f.read()" -msgstr "" - -#: ../../library/gzip.rst:234 +#: ../../library/gzip.rst:202 msgid "Example of how to create a compressed GZIP file::" msgstr "GZIP 圧縮されたファイルを作成する例::" -#: ../../library/gzip.rst:236 -msgid "" -"import gzip\n" -"content = b\"Lots of content here\"\n" -"with gzip.open('/home/joe/file.txt.gz', 'wb') as f:\n" -" f.write(content)" -msgstr "" - -#: ../../library/gzip.rst:241 +#: ../../library/gzip.rst:209 msgid "Example of how to GZIP compress an existing file::" msgstr "既存のファイルを GZIP 圧縮する例::" -#: ../../library/gzip.rst:243 -msgid "" -"import gzip\n" -"import shutil\n" -"with open('/home/joe/file.txt', 'rb') as f_in:\n" -" with gzip.open('/home/joe/file.txt.gz', 'wb') as f_out:\n" -" shutil.copyfileobj(f_in, f_out)" -msgstr "" - -#: ../../library/gzip.rst:249 +#: ../../library/gzip.rst:217 msgid "Example of how to GZIP compress a binary string::" msgstr "バイナリ文字列を GZIP 圧縮する例::" -#: ../../library/gzip.rst:251 -msgid "" -"import gzip\n" -"s_in = b\"Lots of content here\"\n" -"s_out = gzip.compress(s_in)" -msgstr "" - -#: ../../library/gzip.rst:257 +#: ../../library/gzip.rst:226 msgid "Module :mod:`zlib`" msgstr ":mod:`zlib` モジュール" -#: ../../library/gzip.rst:258 +#: ../../library/gzip.rst:226 msgid "" "The basic data compression module needed to support the :program:`gzip` file " "format." @@ -440,17 +396,11 @@ msgstr "" ":program:`gzip` ファイル形式のサポートを行うために必要な基本ライブラリモ" "ジュール。" -#: ../../library/gzip.rst:261 -msgid "" -"In case gzip (de)compression is a bottleneck, the `python-isal`_ package " -"speeds up (de)compression with a mostly compatible API." -msgstr "" - -#: ../../library/gzip.rst:271 +#: ../../library/gzip.rst:233 msgid "Command Line Interface" msgstr "コマンドラインインターフェイス" -#: ../../library/gzip.rst:273 +#: ../../library/gzip.rst:235 msgid "" "The :mod:`gzip` module provides a simple command line interface to compress " "or decompress files." @@ -458,36 +408,36 @@ msgstr "" ":mod:`gzip` モジュールは、 ファイルを圧縮、展開するための簡単なコマンドライン" "インターフェースを提供しています。" -#: ../../library/gzip.rst:276 +#: ../../library/gzip.rst:238 msgid "Once executed the :mod:`gzip` module keeps the input file(s)." msgstr "" -#: ../../library/gzip.rst:280 +#: ../../library/gzip.rst:242 msgid "" "Add a new command line interface with a usage. By default, when you will " "execute the CLI, the default compression level is 6." msgstr "" -#: ../../library/gzip.rst:284 +#: ../../library/gzip.rst:246 msgid "Command line options" msgstr "コマンドラインオプション" -#: ../../library/gzip.rst:288 -msgid "If *file* is not specified, read from :data:`sys.stdin`." -msgstr "" +#: ../../library/gzip.rst:250 +msgid "If *file* is not specified, read from :attr:`sys.stdin`." +msgstr "*file* を指定しない場合、 :attr:`sys.stdin` から読み込みます。" -#: ../../library/gzip.rst:292 +#: ../../library/gzip.rst:254 msgid "Indicates the fastest compression method (less compression)." msgstr "" -#: ../../library/gzip.rst:296 +#: ../../library/gzip.rst:258 msgid "Indicates the slowest compression method (best compression)." msgstr "" -#: ../../library/gzip.rst:300 +#: ../../library/gzip.rst:262 msgid "Decompress the given file." msgstr "" -#: ../../library/gzip.rst:304 +#: ../../library/gzip.rst:266 msgid "Show the help message." msgstr "ヘルプメッセージを出力します" diff --git a/library/hashlib.po b/library/hashlib.po index 33e4388c9..28cc0e43b 100644 --- a/library/hashlib.po +++ b/library/hashlib.po @@ -1,32 +1,37 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# Arihiro TAKASE, 2023 -# tomo, 2023 -# 石井明久, 2024 +# Nozomu Kaneko , 2017 +# Yusuke Miyazaki , 2017 +# 秘湯 , 2017 +# Arihiro TAKASE, 2017 +# Shun Sakurai, 2017 +# E. Kawashima, 2017 +# tomo, 2017 +# Osamu NAKAMURA, 2019 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-30 14:22+0000\n" -"PO-Revision-Date: 2021-06-28 01:07+0000\n" -"Last-Translator: 石井明久, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-08-11 07:13+0000\n" +"PO-Revision-Date: 2017-02-16 23:12+0000\n" +"Last-Translator: Osamu NAKAMURA, 2019\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/hashlib.rst:2 -msgid ":mod:`!hashlib` --- Secure hashes and message digests" -msgstr ":mod:`!hashlib` --- セキュアハッシュとメッセージダイジェスト" +msgid ":mod:`hashlib` --- Secure hashes and message digests" +msgstr ":mod:`hashlib` --- セキュアハッシュおよびメッセージダイジェスト" #: ../../library/hashlib.rst:10 msgid "**Source code:** :source:`Lib/hashlib.py`" @@ -34,77 +39,102 @@ msgstr "**ソースコード:** :source:`Lib/hashlib.py`" #: ../../library/hashlib.rst:23 msgid "" -"This module implements a common interface to many different hash algorithms. " -"Included are the FIPS secure hash algorithms SHA224, SHA256, SHA384, SHA512, " -"(defined in `the FIPS 180-4 standard`_), the SHA-3 series (defined in `the " -"FIPS 202 standard`_) as well as the legacy algorithms SHA1 (`formerly part " -"of FIPS`_) and the MD5 algorithm (defined in internet :rfc:`1321`)." +"This module implements a common interface to many different secure hash and " +"message digest algorithms. Included are the FIPS secure hash algorithms " +"SHA1, SHA224, SHA256, SHA384, and SHA512 (defined in FIPS 180-2) as well as " +"RSA's MD5 algorithm (defined in Internet :rfc:`1321`). The terms \"secure " +"hash\" and \"message digest\" are interchangeable. Older algorithms were " +"called message digests. The modern term is secure hash." msgstr "" +"このモジュールは、セキュアハッシュやメッセージダイジェスト用のさまざまなアル" +"ゴリズムを実装したものです。FIPSのセキュアなハッシュアルゴリズムである SHA1、" +"SHA224、SHA256、SHA384およびSHA512 (FIPS 180-2 で定義されているもの) だけでな" +"くRSAのMD5アルゴリズム (Internet :rfc:`1321` で定義されています)も実装してい" +"ます。「セキュアなハッシュ」と「メッセージダイジェスト」はどちらも同じ意味で" +"す。古くからあるアルゴリズムは「メッセージダイジェスト」と呼ばれていますが、" +"最近は「セキュアハッシュ」という用語が用いられています。" -#: ../../library/hashlib.rst:31 +#: ../../library/hashlib.rst:32 msgid "" "If you want the adler32 or crc32 hash functions, they are available in the :" "mod:`zlib` module." msgstr "" "adler32 や crc32 ハッシュ関数は :mod:`zlib` モジュールで提供されています。" -#: ../../library/hashlib.rst:38 +#: ../../library/hashlib.rst:37 +msgid "" +"Some algorithms have known hash collision weaknesses, refer to the \"See " +"also\" section at the end." +msgstr "" +"幾つかのアルゴリズムはハッシュの衝突に弱いことが知られています。最後の \"参考" +"\" セクションを見てください。" + +#: ../../library/hashlib.rst:44 msgid "Hash algorithms" msgstr "ハッシュアルゴリズム" -#: ../../library/hashlib.rst:40 +#: ../../library/hashlib.rst:46 msgid "" "There is one constructor method named for each type of :dfn:`hash`. All " "return a hash object with the same simple interface. For example: use :func:" "`sha256` to create a SHA-256 hash object. You can now feed this object with :" "term:`bytes-like objects ` (normally :class:`bytes`) " -"using the :meth:`update` method. At any point you can ask it " -"for the :dfn:`digest` of the concatenation of the data fed to it so far " -"using the :meth:`digest()` or :meth:`hexdigest()` methods." +"using the :meth:`update` method. At any point you can ask it for the :dfn:" +"`digest` of the concatenation of the data fed to it so far using the :meth:" +"`digest` or :meth:`hexdigest` methods." msgstr "" +"各 :dfn:`hash` の名前が付いたコンストラクタがあります。いずれも同一で簡単なイ" +"ンターフェイスのあるハッシュオブジェクトを返します。例えば、SHA-256 ハッシュ" +"オブジェクトを作るには :func:`sha256` を使います。このオブジェクトには :meth:" +"`update` メソッドを用いて :term:`bytes-like オブジェクト ` (通常 :class:`bytes`) を渡すことができます。:meth:`digest` や :meth:" +"`hexdigest` メソッドを用いて、それまでに渡したデータを連結したものの :dfn:" +"`digest` をいつでも要求することができます。" -#: ../../library/hashlib.rst:48 +#: ../../library/hashlib.rst:56 msgid "" -"To allow multithreading, the Python :term:`GIL` is released while computing " -"a hash supplied more than 2047 bytes of data at once in its constructor or :" -"meth:`.update` method." -msgstr "" - -#: ../../library/hashlib.rst:55 -msgid "" -"Constructors for hash algorithms that are always present in this module are :" -"func:`sha1`, :func:`sha224`, :func:`sha256`, :func:`sha384`, :func:" -"`sha512`, :func:`sha3_224`, :func:`sha3_256`, :func:`sha3_384`, :func:" -"`sha3_512`, :func:`shake_128`, :func:`shake_256`, :func:`blake2b`, and :func:" -"`blake2s`. :func:`md5` is normally available as well, though it may be " -"missing or blocked if you are using a rare \"FIPS compliant\" build of " -"Python. These correspond to :data:`algorithms_guaranteed`." +"For better multithreading performance, the Python :term:`GIL` is released " +"for data larger than 2047 bytes at object creation or on update." msgstr "" +"マルチスレッドにおける良好なパフォーマンスを得るために、オブジェクトの生成時" +"または更新時に与えるデータが 2047 バイトを超えている場合、Python :term:`GIL` " +"が解除されます。" -#: ../../library/hashlib.rst:63 +#: ../../library/hashlib.rst:61 msgid "" -"Additional algorithms may also be available if your Python distribution's :" -"mod:`hashlib` was linked against a build of OpenSSL that provides others. " -"Others *are not guaranteed available* on all installations and will only be " -"accessible by name via :func:`new`. See :data:`algorithms_available`." +"Feeding string objects into :meth:`update` is not supported, as hashes work " +"on bytes, not on characters." msgstr "" +"文字列オブジェクトを :meth:`update` に渡すのはサポートされていません。ハッ" +"シュはバイトには機能しますが、文字には機能しないからです。" -#: ../../library/hashlib.rst:70 +#: ../../library/hashlib.rst:66 msgid "" -"Some algorithms have known hash collision weaknesses (including MD5 and " -"SHA1). Refer to `Attacks on cryptographic hash algorithms`_ and the `hashlib-" -"seealso`_ section at the end of this document." +"Constructors for hash algorithms that are always present in this module are :" +"func:`sha1`, :func:`sha224`, :func:`sha256`, :func:`sha384`, :func:" +"`sha512`, :func:`blake2b`, and :func:`blake2s`. :func:`md5` is normally " +"available as well, though it may be missing or blocked if you are using a " +"rare \"FIPS compliant\" build of Python. Additional algorithms may also be " +"available depending upon the OpenSSL library that Python uses on your " +"platform. On most platforms the :func:`sha3_224`, :func:`sha3_256`, :func:" +"`sha3_384`, :func:`sha3_512`, :func:`shake_128`, :func:`shake_256` are also " +"available." msgstr "" -#: ../../library/hashlib.rst:74 +#: ../../library/hashlib.rst:76 msgid "" "SHA3 (Keccak) and SHAKE constructors :func:`sha3_224`, :func:`sha3_256`, :" -"func:`sha3_384`, :func:`sha3_512`, :func:`shake_128`, :func:`shake_256` were " -"added. :func:`blake2b` and :func:`blake2s` were added." +"func:`sha3_384`, :func:`sha3_512`, :func:`shake_128`, :func:`shake_256`." msgstr "" +"SHA3 (Keccak) ならびに SHAKE コンストラクタ :func:`sha3_224`, :func:" +"`sha3_256`, :func:`sha3_384`, :func:`sha3_512`, :func:`shake_128`, :func:" +"`shake_256`。" + +#: ../../library/hashlib.rst:80 +msgid ":func:`blake2b` and :func:`blake2s` were added." +msgstr ":func:`blake2b` と :func:`blake2s` が追加されました。" -#: ../../library/hashlib.rst:82 +#: ../../library/hashlib.rst:85 msgid "" "All hashlib constructors take a keyword-only argument *usedforsecurity* with " "default value ``True``. A false value allows the use of insecure and blocked " @@ -113,76 +143,44 @@ msgid "" "cryptographic one-way compression function." msgstr "" -#: ../../library/hashlib.rst:89 -msgid "Hashlib now uses SHA3 and SHAKE from OpenSSL if it provides it." -msgstr "" - #: ../../library/hashlib.rst:92 -msgid "" -"For any of the MD5, SHA1, SHA2, or SHA3 algorithms that the linked OpenSSL " -"does not provide we fall back to a verified implementation from the `HACL\\* " -"project`_." -msgstr "" - -#: ../../library/hashlib.rst:98 -msgid "Usage" -msgstr "使用法" - -#: ../../library/hashlib.rst:100 -msgid "" -"To obtain the digest of the byte string ``b\"Nobody inspects the spammish " -"repetition\"``::" +msgid "Hashlib now uses SHA3 and SHAKE from OpenSSL 1.1.1 and newer." msgstr "" -#: ../../library/hashlib.rst:103 +#: ../../library/hashlib.rst:94 msgid "" -">>> import hashlib\n" -">>> m = hashlib.sha256()\n" -">>> m.update(b\"Nobody inspects\")\n" -">>> m.update(b\" the spammish repetition\")\n" -">>> m.digest()\n" -"b'\\x03\\x1e\\xdd}Ae\\x15\\x93\\xc5\\xfe\\\\" -"\\x00o\\xa5u+7\\xfd\\xdf\\xf7\\xbcN\\x84:" -"\\xa6\\xaf\\x0c\\x95\\x0fK\\x94\\x06'\n" -">>> m.hexdigest()\n" -"'031edd7d41651593c5fe5c006fa5752b37fddff7bc4e843aa6af0c950f4b9406'" +"For example, to obtain the digest of the byte string ``b'Nobody inspects the " +"spammish repetition'``::" msgstr "" +"たとえば、``b'Nobody inspects the spammish repetition'`` というバイト文字列の" +"ダイジェストを取得するには次のようにします::" -#: ../../library/hashlib.rst:112 +#: ../../library/hashlib.rst:108 msgid "More condensed:" msgstr "もっと簡潔に書くと、このようになります:" -#: ../../library/hashlib.rst:118 -msgid "Constructors" -msgstr "" - -#: ../../library/hashlib.rst:122 +#: ../../library/hashlib.rst:115 msgid "" "Is a generic constructor that takes the string *name* of the desired " "algorithm as its first parameter. It also exists to allow access to the " "above listed hashes as well as any other algorithms that your OpenSSL " -"library may offer." -msgstr "" - -#: ../../library/hashlib.rst:127 -msgid "Using :func:`new` with an algorithm name:" -msgstr "" - -#: ../../library/hashlib.rst:146 -msgid "" -"Named constructors such as these are faster than passing an algorithm name " -"to :func:`new`." +"library may offer. The named constructors are much faster than :func:`new` " +"and should be preferred." msgstr "" +"一般的なコンストラクタで、第一引数にアルゴリズム名を文字列 *name* で受け取り" +"ます。他にも、前述のハッシュアルゴリズムだけでなく OpenSSL ライブラリーが提供" +"するような他のアルゴリズムにアクセスすることができます。名前のあるコンストラ" +"クタの方が :func:`new` よりもずっと速いので望ましいです。" -#: ../../library/hashlib.rst:150 -msgid "Attributes" -msgstr "属性" +#: ../../library/hashlib.rst:121 +msgid "Using :func:`new` with an algorithm provided by OpenSSL:" +msgstr ":func:`new` にOpenSSLのアルゴリズムを指定する例です:" -#: ../../library/hashlib.rst:152 -msgid "Hashlib provides the following constant module attributes:" -msgstr "" +#: ../../library/hashlib.rst:128 +msgid "Hashlib provides the following constant attributes:" +msgstr "Hashlib は以下の定数属性を提供しています:" -#: ../../library/hashlib.rst:156 +#: ../../library/hashlib.rst:132 msgid "" "A set containing the names of the hash algorithms guaranteed to be supported " "by this module on all platforms. Note that 'md5' is in this list despite " @@ -194,7 +192,7 @@ msgstr "" "ダーが提供する奇妙な \"FIPS準拠の\" Pythonビルドではmd5のサポートを除外してい" "ますが、その場合であっても 'md5' がリストに含まれることに注意してください。" -#: ../../library/hashlib.rst:165 +#: ../../library/hashlib.rst:141 msgid "" "A set containing the names of the hash algorithms that are available in the " "running Python interpreter. These names will be recognized when passed to :" @@ -207,11 +205,7 @@ msgstr "" "`algorithms_guaranteed` は常にサブセットです。この set の中に同じアルゴリズム" "が違う名前で複数回現れることがあります (OpenSSL 由来)。" -#: ../../library/hashlib.rst:174 -msgid "Hash Objects" -msgstr "" - -#: ../../library/hashlib.rst:176 +#: ../../library/hashlib.rst:149 msgid "" "The following values are provided as constant attributes of the hash objects " "returned by the constructors:" @@ -219,19 +213,19 @@ msgstr "" "コンストラクタが返すハッシュオブジェクトには、次のような定数属性が用意されて" "います:" -#: ../../library/hashlib.rst:181 +#: ../../library/hashlib.rst:155 msgid "The size of the resulting hash in bytes." msgstr "生成されたハッシュのバイト数。" -#: ../../library/hashlib.rst:185 +#: ../../library/hashlib.rst:159 msgid "The internal block size of the hash algorithm in bytes." msgstr "内部で使われるハッシュアルゴリズムのブロックのバイト数。" -#: ../../library/hashlib.rst:187 +#: ../../library/hashlib.rst:161 msgid "A hash object has the following attributes:" msgstr "ハッシュオブジェクトには次のような属性があります:" -#: ../../library/hashlib.rst:191 +#: ../../library/hashlib.rst:165 msgid "" "The canonical name of this hash, always lowercase and always suitable as a " "parameter to :func:`new` to create another hash of this type." @@ -239,7 +233,7 @@ msgstr "" "このハッシュの正規名です。常に小文字で、:func:`new` の引数として渡してこのタ" "イプの別のハッシュを生成することができます。" -#: ../../library/hashlib.rst:194 +#: ../../library/hashlib.rst:168 msgid "" "The name attribute has been present in CPython since its inception, but " "until Python 3.4 was not formally specified, so may not exist on some " @@ -249,11 +243,11 @@ msgstr "" "ていませんでした。そのため、プラットフォームによっては存在しないかもしれませ" "ん。" -#: ../../library/hashlib.rst:199 +#: ../../library/hashlib.rst:173 msgid "A hash object has the following methods:" msgstr "ハッシュオブジェクトには次のようなメソッドがあります:" -#: ../../library/hashlib.rst:204 +#: ../../library/hashlib.rst:178 msgid "" "Update the hash object with the :term:`bytes-like object`. Repeated calls " "are equivalent to a single call with the concatenation of all the arguments: " @@ -264,7 +258,17 @@ msgstr "" "じになります。すなわち ``m.update(a); m.update(b)`` は ``m.update(a + b)`` " "と等価です。" -#: ../../library/hashlib.rst:212 +#: ../../library/hashlib.rst:183 +msgid "" +"The Python GIL is released to allow other threads to run while hash updates " +"on data larger than 2047 bytes is taking place when using hash algorithms " +"supplied by OpenSSL." +msgstr "" +"ハッシュアルゴリズムが OpenSSL によって提供されていて、データが 2047 バイトを" +"超えている場合には、ハッシュの更新が実行中でも他のスレッドが実行できるよう" +"に、Python :term:`GIL` が解放されます。" + +#: ../../library/hashlib.rst:191 msgid "" "Return the digest of the data passed to the :meth:`update` method so far. " "This is a bytes object of size :attr:`digest_size` which may contain bytes " @@ -274,7 +278,7 @@ msgstr "" "これは :attr:`digest_size` と同じ長さの、0 から 255 の範囲全てを含み得るバイ" "トの列です。" -#: ../../library/hashlib.rst:219 +#: ../../library/hashlib.rst:198 ../../library/hashlib.rst:226 msgid "" "Like :meth:`digest` except the digest is returned as a string object of " "double length, containing only hexadecimal digits. This may be used to " @@ -283,7 +287,7 @@ msgstr "" ":meth:`digest` と似ていますが、倍の長さの、16進形式文字列を返します。これは、" "電子メールなどの非バイナリ環境で値を交換する場合に便利です。" -#: ../../library/hashlib.rst:226 +#: ../../library/hashlib.rst:205 msgid "" "Return a copy (\"clone\") of the hash object. This can be used to " "efficiently compute the digests of data sharing a common initial substring." @@ -291,11 +295,11 @@ msgstr "" "ハッシュオブジェクトのコピー (\"クローン\") を返します。これは、最初の部分文" "字列が共通なデータのダイジェストを効率的に計算するために使用します。" -#: ../../library/hashlib.rst:231 +#: ../../library/hashlib.rst:210 msgid "SHAKE variable length digests" msgstr "SHAKE 可変長ダイジェスト" -#: ../../library/hashlib.rst:236 +#: ../../library/hashlib.rst:212 msgid "" "The :func:`shake_128` and :func:`shake_256` algorithms provide variable " "length digests with length_in_bits//2 up to 128 or 256 bits of security. As " @@ -303,77 +307,20 @@ msgid "" "by the SHAKE algorithm." msgstr "" -#: ../../library/hashlib.rst:243 -msgid "" -"Return the digest of the data passed to the :meth:`~hash.update` method so " -"far. This is a bytes object of size *length* which may contain bytes in the " -"whole range from 0 to 255." -msgstr "" - -#: ../../library/hashlib.rst:250 -msgid "" -"Like :meth:`digest` except the digest is returned as a string object of " -"double length, containing only hexadecimal digits. This may be used to " -"exchange the value in email or other non-binary environments." -msgstr "" - -#: ../../library/hashlib.rst:254 -msgid "Example use:" -msgstr "" - -#: ../../library/hashlib.rst:261 -msgid "File hashing" -msgstr "" - -#: ../../library/hashlib.rst:263 -msgid "" -"The hashlib module provides a helper function for efficient hashing of a " -"file or file-like object." -msgstr "" - -#: ../../library/hashlib.rst:268 -msgid "" -"Return a digest object that has been updated with contents of file object." -msgstr "" - -#: ../../library/hashlib.rst:270 -msgid "" -"*fileobj* must be a file-like object opened for reading in binary mode. It " -"accepts file objects from builtin :func:`open`, :class:`~io.BytesIO` " -"instances, SocketIO objects from :meth:`socket.socket.makefile`, and " -"similar. *fileobj* must be opened in blocking mode, otherwise a :exc:" -"`BlockingIOError` may be raised." -msgstr "" - -#: ../../library/hashlib.rst:276 -msgid "" -"The function may bypass Python's I/O and use the file descriptor from :meth:" -"`~io.IOBase.fileno` directly. *fileobj* must be assumed to be in an unknown " -"state after this function returns or raises. It is up to the caller to close " -"*fileobj*." -msgstr "" - -#: ../../library/hashlib.rst:281 -msgid "" -"*digest* must either be a hash algorithm name as a *str*, a hash " -"constructor, or a callable that returns a hash object." -msgstr "" - -#: ../../library/hashlib.rst:284 -msgid "Example:" -msgstr "例:" - -#: ../../library/hashlib.rst:305 +#: ../../library/hashlib.rst:219 msgid "" -"Now raises a :exc:`BlockingIOError` if the file is opened in blocking mode. " -"Previously, spurious null bytes were added to the digest." +"Return the digest of the data passed to the :meth:`update` method so far. " +"This is a bytes object of size *length* which may contain bytes in the whole " +"range from 0 to 255." msgstr "" +"これまで :meth:`update` メソッドに渡されたデータのダイジェスト値を返します。" +"これは *length* と同じ長さの、0 から 255 の範囲全てを含み得るバイトの列です。" -#: ../../library/hashlib.rst:311 +#: ../../library/hashlib.rst:232 msgid "Key derivation" msgstr "鍵導出" -#: ../../library/hashlib.rst:313 +#: ../../library/hashlib.rst:234 msgid "" "Key derivation and key stretching algorithms are designed for secure " "password hashing. Naive algorithms such as ``sha1(password)`` are not " @@ -387,7 +334,7 @@ msgstr "" "化は調節可能で、遅くて、 `salt `_ を含まなければなりません。" -#: ../../library/hashlib.rst:321 +#: ../../library/hashlib.rst:242 msgid "" "The function provides PKCS#5 password-based key derivation function 2. It " "uses HMAC as pseudorandom function." @@ -395,7 +342,7 @@ msgstr "" "この関数は PKCS#5 のパスワードに基づいた鍵導出関数 2 を提供しています。疑似乱" "数関数として HMAC を使用しています。" -#: ../../library/hashlib.rst:324 +#: ../../library/hashlib.rst:245 msgid "" "The string *hash_name* is the desired name of the hash digest algorithm for " "HMAC, e.g. 'sha1' or 'sha256'. *password* and *salt* are interpreted as " @@ -409,33 +356,35 @@ msgstr "" "長さ (例えば 1024) に制限すべきです。 *salt* は :func:`os.urandom` のような適" "切なソースからの、およそ 16 バイトかそれ以上のバイト列にするべきです。" -#: ../../library/hashlib.rst:330 +#: ../../library/hashlib.rst:251 msgid "" "The number of *iterations* should be chosen based on the hash algorithm and " -"computing power. As of 2022, hundreds of thousands of iterations of SHA-256 " -"are suggested. For rationale as to why and how to choose what is best for " -"your application, read *Appendix A.2.2* of NIST-SP-800-132_. The answers on " -"the `stackexchange pbkdf2 iterations question`_ explain in detail." +"computing power. As of 2013, at least 100,000 iterations of SHA-256 are " +"suggested." msgstr "" +"*iterations* 数はハッシュアルゴリズムと計算機の能力に基づいて決めるべきです。" +"2013 年現在の場合、 SHA-256 に対して最低でも 100,000 反復が推奨されています。" -#: ../../library/hashlib.rst:336 +#: ../../library/hashlib.rst:255 msgid "" -"*dklen* is the length of the derived key in bytes. If *dklen* is ``None`` " -"then the digest size of the hash algorithm *hash_name* is used, e.g. 64 for " -"SHA-512." +"*dklen* is the length of the derived key. If *dklen* is ``None`` then the " +"digest size of the hash algorithm *hash_name* is used, e.g. 64 for SHA-512." msgstr "" +"*dklen* は、導出された鍵の長さです。 *dklen* が ``None`` の場合、ハッシュアル" +"ゴリズム *hash_name* のダイジェストサイズが使われます。例えば SHA-512 では " +"64 です。" -#: ../../library/hashlib.rst:345 -msgid "Function only available when Python is compiled with OpenSSL." -msgstr "" - -#: ../../library/hashlib.rst:349 +#: ../../library/hashlib.rst:267 msgid "" -"Function now only available when Python is built with OpenSSL. The slow pure " -"Python implementation has been removed." +"A fast implementation of *pbkdf2_hmac* is available with OpenSSL. The " +"Python implementation uses an inline version of :mod:`hmac`. It is about " +"three times slower and doesn't release the GIL." msgstr "" +"*pbkdf2_hmac* の高速な実装は OpenSSL 使用版で利用可能です。Python 実装は :" +"mod:`hmac` のインラインバージョンを使います。それはおよそ 3 倍遅く、GIL を解" +"放しません。" -#: ../../library/hashlib.rst:355 +#: ../../library/hashlib.rst:273 msgid "" "The function provides scrypt password-based key derivation function as " "defined in :rfc:`7914`." @@ -443,54 +392,58 @@ msgstr "" "この関数は、 :rfc:`7914` で定義されるscrypt のパスワードに基づいた鍵導出関数" "を提供します。" -#: ../../library/hashlib.rst:358 +#: ../../library/hashlib.rst:276 msgid "" "*password* and *salt* must be :term:`bytes-like objects `. Applications and libraries should limit *password* to a sensible " "length (e.g. 1024). *salt* should be about 16 or more bytes from a proper " "source, e.g. :func:`os.urandom`." msgstr "" -"*password* と *salt* は :term:`bytes-like object` でなければなりません。アプ" +"*password* と *salt* は :term:`bytes-like objects` でなければなりません。アプ" "リケーションとライブラリは、 *password* を適切な長さ (例えば 1024) に制限すべ" "きです。 *salt* は :func:`os.urandom` のような適切なソースからの、およそ 16 " "バイトかそれ以上のバイト列にするべきです。" -#: ../../library/hashlib.rst:363 +#: ../../library/hashlib.rst:281 msgid "" "*n* is the CPU/Memory cost factor, *r* the block size, *p* parallelization " "factor and *maxmem* limits memory (OpenSSL 1.1.0 defaults to 32 MiB). " -"*dklen* is the length of the derived key in bytes." +"*dklen* is the length of the derived key." msgstr "" -#: ../../library/hashlib.rst:373 +#: ../../library/hashlib.rst:286 +msgid ":ref:`Availability `: OpenSSL 1.1+." +msgstr ":ref:`Availability `: OpenSSL 1.1+." + +#: ../../library/hashlib.rst:291 msgid "BLAKE2" msgstr "BLAKE2" -#: ../../library/hashlib.rst:380 +#: ../../library/hashlib.rst:298 msgid "" "BLAKE2_ is a cryptographic hash function defined in :rfc:`7693` that comes " "in two flavors:" msgstr "" -#: ../../library/hashlib.rst:383 +#: ../../library/hashlib.rst:301 msgid "" "**BLAKE2b**, optimized for 64-bit platforms and produces digests of any size " "between 1 and 64 bytes," msgstr "" -#: ../../library/hashlib.rst:386 +#: ../../library/hashlib.rst:304 msgid "" "**BLAKE2s**, optimized for 8- to 32-bit platforms and produces digests of " "any size between 1 and 32 bytes." msgstr "" -#: ../../library/hashlib.rst:389 +#: ../../library/hashlib.rst:307 msgid "" "BLAKE2 supports **keyed mode** (a faster and simpler replacement for HMAC_), " "**salted hashing**, **personalization**, and **tree hashing**." msgstr "" -#: ../../library/hashlib.rst:392 +#: ../../library/hashlib.rst:310 msgid "" "Hash objects from this module follow the API of standard library's :mod:" "`hashlib` objects." @@ -498,98 +451,98 @@ msgstr "" "このモジュールのハッシュオブジェクトは標準ライブラリーの :mod:`hashlib` オブ" "ジェクトの API に従います。" -#: ../../library/hashlib.rst:397 +#: ../../library/hashlib.rst:315 msgid "Creating hash objects" msgstr "ハッシュオブジェクトの作成" -#: ../../library/hashlib.rst:399 +#: ../../library/hashlib.rst:317 msgid "New hash objects are created by calling constructor functions:" msgstr "" "新しいハッシュオブジェクトは、コンストラクタ関数を呼び出すことで生成されます:" -#: ../../library/hashlib.rst:413 +#: ../../library/hashlib.rst:331 msgid "" "These functions return the corresponding hash objects for calculating " "BLAKE2b or BLAKE2s. They optionally take these general parameters:" msgstr "" -#: ../../library/hashlib.rst:416 +#: ../../library/hashlib.rst:334 msgid "" "*data*: initial chunk of data to hash, which must be :term:`bytes-like " "object`. It can be passed only as positional argument." msgstr "" -#: ../../library/hashlib.rst:419 +#: ../../library/hashlib.rst:337 msgid "*digest_size*: size of output digest in bytes." msgstr "*digest_size*: 出力するダイジェストのバイト数。" -#: ../../library/hashlib.rst:421 +#: ../../library/hashlib.rst:339 msgid "" "*key*: key for keyed hashing (up to 64 bytes for BLAKE2b, up to 32 bytes for " "BLAKE2s)." msgstr "" -#: ../../library/hashlib.rst:424 +#: ../../library/hashlib.rst:342 msgid "" "*salt*: salt for randomized hashing (up to 16 bytes for BLAKE2b, up to 8 " "bytes for BLAKE2s)." msgstr "" -#: ../../library/hashlib.rst:427 +#: ../../library/hashlib.rst:345 msgid "" "*person*: personalization string (up to 16 bytes for BLAKE2b, up to 8 bytes " "for BLAKE2s)." msgstr "" -#: ../../library/hashlib.rst:430 +#: ../../library/hashlib.rst:348 msgid "The following table shows limits for general parameters (in bytes):" msgstr "下の表は一般的なパラメータの上限 (バイト単位) です:" -#: ../../library/hashlib.rst:433 +#: ../../library/hashlib.rst:351 msgid "Hash" msgstr "Hash" -#: ../../library/hashlib.rst:433 +#: ../../library/hashlib.rst:351 msgid "digest_size" msgstr "digest_size" -#: ../../library/hashlib.rst:433 +#: ../../library/hashlib.rst:351 msgid "len(key)" msgstr "len(key)" -#: ../../library/hashlib.rst:433 +#: ../../library/hashlib.rst:351 msgid "len(salt)" msgstr "len(salt)" -#: ../../library/hashlib.rst:433 +#: ../../library/hashlib.rst:351 msgid "len(person)" msgstr "len(person)" -#: ../../library/hashlib.rst:435 +#: ../../library/hashlib.rst:353 msgid "BLAKE2b" msgstr "BLAKE2b" -#: ../../library/hashlib.rst:435 +#: ../../library/hashlib.rst:353 msgid "64" msgstr "64" -#: ../../library/hashlib.rst:435 +#: ../../library/hashlib.rst:353 msgid "16" msgstr "16" -#: ../../library/hashlib.rst:436 +#: ../../library/hashlib.rst:354 msgid "BLAKE2s" msgstr "BLAKE2s" -#: ../../library/hashlib.rst:436 +#: ../../library/hashlib.rst:354 msgid "32" msgstr "32" -#: ../../library/hashlib.rst:436 +#: ../../library/hashlib.rst:354 msgid "8" msgstr "8" -#: ../../library/hashlib.rst:441 +#: ../../library/hashlib.rst:359 msgid "" "BLAKE2 specification defines constant lengths for salt and personalization " "parameters, however, for convenience, this implementation accepts byte " @@ -599,20 +552,20 @@ msgid "" "the case for *key*.)" msgstr "" -#: ../../library/hashlib.rst:448 +#: ../../library/hashlib.rst:366 msgid "These sizes are available as module `constants`_ described below." msgstr "これらのサイズは以下に述べるモジュール `constants`_ で利用できます。" -#: ../../library/hashlib.rst:450 +#: ../../library/hashlib.rst:368 msgid "" "Constructor functions also accept the following tree hashing parameters:" msgstr "コンストラクタ関数は以下のツリーハッシングパラメタを受け付けます:" -#: ../../library/hashlib.rst:452 +#: ../../library/hashlib.rst:370 msgid "*fanout*: fanout (0 to 255, 0 if unlimited, 1 in sequential mode)." msgstr "" -#: ../../library/hashlib.rst:454 +#: ../../library/hashlib.rst:372 msgid "" "*depth*: maximal depth of tree (1 to 255, 255 if unlimited, 1 in sequential " "mode)." @@ -620,100 +573,100 @@ msgstr "" "*depth*: ツリーの深さの最大値(1から255までの値で、無制限であれば255、シーケ" "ンスモードでは1)。" -#: ../../library/hashlib.rst:457 +#: ../../library/hashlib.rst:375 msgid "" -"*leaf_size*: maximal byte length of leaf (0 to ``2**32-1``, 0 if unlimited " -"or in sequential mode)." +"*leaf_size*: maximal byte length of leaf (0 to 2**32-1, 0 if unlimited or in " +"sequential mode)." msgstr "" -#: ../../library/hashlib.rst:460 +#: ../../library/hashlib.rst:378 msgid "" -"*node_offset*: node offset (0 to ``2**64-1`` for BLAKE2b, 0 to ``2**48-1`` " -"for BLAKE2s, 0 for the first, leftmost, leaf, or in sequential mode)." +"*node_offset*: node offset (0 to 2**64-1 for BLAKE2b, 0 to 2**48-1 for " +"BLAKE2s, 0 for the first, leftmost, leaf, or in sequential mode)." msgstr "" -#: ../../library/hashlib.rst:463 +#: ../../library/hashlib.rst:381 msgid "" "*node_depth*: node depth (0 to 255, 0 for leaves, or in sequential mode)." msgstr "" -#: ../../library/hashlib.rst:465 +#: ../../library/hashlib.rst:383 msgid "" "*inner_size*: inner digest size (0 to 64 for BLAKE2b, 0 to 32 for BLAKE2s, 0 " "in sequential mode)." msgstr "" -#: ../../library/hashlib.rst:468 +#: ../../library/hashlib.rst:386 msgid "" "*last_node*: boolean indicating whether the processed node is the last one " -"(``False`` for sequential mode)." +"(`False` for sequential mode)." msgstr "" -#: ../../library/hashlib.rst:471 +#: ../../library/hashlib.rstNone msgid "Explanation of tree mode parameters." msgstr "" -#: ../../library/hashlib.rst:475 +#: ../../library/hashlib.rst:392 msgid "" -"See section 2.10 in `BLAKE2 specification `_ for comprehensive review of tree hashing." msgstr "" -#: ../../library/hashlib.rst:481 +#: ../../library/hashlib.rst:398 msgid "Constants" msgstr "定数" -#: ../../library/hashlib.rst:486 +#: ../../library/hashlib.rst:403 msgid "Salt length (maximum length accepted by constructors)." msgstr "ソルト長(コンストラクタが受け付けれる最大長)" -#: ../../library/hashlib.rst:492 +#: ../../library/hashlib.rst:409 msgid "" "Personalization string length (maximum length accepted by constructors)." msgstr "" -#: ../../library/hashlib.rst:498 +#: ../../library/hashlib.rst:415 msgid "Maximum key size." msgstr "最大キー長" -#: ../../library/hashlib.rst:504 +#: ../../library/hashlib.rst:421 msgid "Maximum digest size that the hash function can output." msgstr "ハッシュ関数が出力しうるダイジェストの最大長" -#: ../../library/hashlib.rst:508 +#: ../../library/hashlib.rst:425 msgid "Examples" msgstr "使用例" -#: ../../library/hashlib.rst:511 +#: ../../library/hashlib.rst:428 msgid "Simple hashing" msgstr "簡単なハッシュ化" -#: ../../library/hashlib.rst:513 +#: ../../library/hashlib.rst:430 msgid "" "To calculate hash of some data, you should first construct a hash object by " "calling the appropriate constructor function (:func:`blake2b` or :func:" -"`blake2s`), then update it with the data by calling :meth:`~hash.update` on " -"the object, and, finally, get the digest out of the object by calling :meth:" -"`~hash.digest` (or :meth:`~hash.hexdigest` for hex-encoded string)." +"`blake2s`), then update it with the data by calling :meth:`update` on the " +"object, and, finally, get the digest out of the object by calling :meth:" +"`digest` (or :meth:`hexdigest` for hex-encoded string)." msgstr "" -#: ../../library/hashlib.rst:526 +#: ../../library/hashlib.rst:443 msgid "" "As a shortcut, you can pass the first chunk of data to update directly to " "the constructor as the positional argument:" msgstr "" -#: ../../library/hashlib.rst:533 +#: ../../library/hashlib.rst:450 msgid "" "You can call :meth:`hash.update` as many times as you need to iteratively " "update the hash:" msgstr "" -#: ../../library/hashlib.rst:547 +#: ../../library/hashlib.rst:463 msgid "Using different digest sizes" msgstr "" -#: ../../library/hashlib.rst:549 +#: ../../library/hashlib.rst:465 msgid "" "BLAKE2 has configurable size of digests up to 64 bytes for BLAKE2b and up to " "32 bytes for BLAKE2s. For example, to replace SHA-1 with BLAKE2b without " @@ -724,102 +677,56 @@ msgstr "" "BLAKE2bで置き換えるには、BLAKE2bに20バイトのダイジェストを生成するように指示" "できます:" -#: ../../library/hashlib.rst:563 +#: ../../library/hashlib.rst:479 msgid "" "Hash objects with different digest sizes have completely different outputs " "(shorter hashes are *not* prefixes of longer hashes); BLAKE2b and BLAKE2s " "produce different outputs even if the output length is the same:" msgstr "" -#: ../../library/hashlib.rst:579 +#: ../../library/hashlib.rst:495 msgid "Keyed hashing" msgstr "" -#: ../../library/hashlib.rst:581 +#: ../../library/hashlib.rst:497 msgid "" "Keyed hashing can be used for authentication as a faster and simpler " "replacement for `Hash-based message authentication code `_ (HMAC). BLAKE2 can be securely used in prefix-MAC " -"mode thanks to the indifferentiability property inherited from BLAKE." +"wikipedia.org/wiki/Hash-based_message_authentication_code>`_ (HMAC). BLAKE2 " +"can be securely used in prefix-MAC mode thanks to the indifferentiability " +"property inherited from BLAKE." msgstr "" -#: ../../library/hashlib.rst:587 +#: ../../library/hashlib.rst:503 msgid "" "This example shows how to get a (hex-encoded) 128-bit authentication code " "for message ``b'message data'`` with key ``b'pseudorandom key'``::" msgstr "" -#: ../../library/hashlib.rst:590 -msgid "" -">>> from hashlib import blake2b\n" -">>> h = blake2b(key=b'pseudorandom key', digest_size=16)\n" -">>> h.update(b'message data')\n" -">>> h.hexdigest()\n" -"'3d363ff7401e02026f4a4687d4863ced'" -msgstr "" - -#: ../../library/hashlib.rst:597 +#: ../../library/hashlib.rst:513 msgid "" "As a practical example, a web application can symmetrically sign cookies " "sent to users and later verify them to make sure they weren't tampered with::" msgstr "" -#: ../../library/hashlib.rst:600 -msgid "" -">>> from hashlib import blake2b\n" -">>> from hmac import compare_digest\n" -">>>\n" -">>> SECRET_KEY = b'pseudorandomly generated server secret key'\n" -">>> AUTH_SIZE = 16\n" -">>>\n" -">>> def sign(cookie):\n" -"... h = blake2b(digest_size=AUTH_SIZE, key=SECRET_KEY)\n" -"... h.update(cookie)\n" -"... return h.hexdigest().encode('utf-8')\n" -">>>\n" -">>> def verify(cookie, sig):\n" -"... good_sig = sign(cookie)\n" -"... return compare_digest(good_sig, sig)\n" -">>>\n" -">>> cookie = b'user-alice'\n" -">>> sig = sign(cookie)\n" -">>> print(\"{0},{1}\".format(cookie.decode('utf-8'), sig))\n" -"user-alice,b'43b3c982cf697e0c5ab22172d1ca7421'\n" -">>> verify(cookie, sig)\n" -"True\n" -">>> verify(b'user-bob', sig)\n" -"False\n" -">>> verify(cookie, b'0102030405060708090a0b0c0d0e0f00')\n" -"False" -msgstr "" - -#: ../../library/hashlib.rst:626 +#: ../../library/hashlib.rst:542 msgid "" "Even though there's a native keyed hashing mode, BLAKE2 can, of course, be " "used in HMAC construction with :mod:`hmac` module::" msgstr "" -#: ../../library/hashlib.rst:629 -msgid "" -">>> import hmac, hashlib\n" -">>> m = hmac.new(b'secret key', digestmod=hashlib.blake2s)\n" -">>> m.update(b'message')\n" -">>> m.hexdigest()\n" -"'e3c8102868d28b5ff85fc35dda07329970d1a01e273c37481326fe0c861c8142'" -msgstr "" - -#: ../../library/hashlib.rst:637 +#: ../../library/hashlib.rst:553 msgid "Randomized hashing" msgstr "" -#: ../../library/hashlib.rst:639 +#: ../../library/hashlib.rst:555 msgid "" "By setting *salt* parameter users can introduce randomization to the hash " "function. Randomized hashing is useful for protecting against collision " "attacks on the hash function used in digital signatures." msgstr "" -#: ../../library/hashlib.rst:643 +#: ../../library/hashlib.rst:559 msgid "" "Randomized hashing is designed for situations where one party, the message " "preparer, generates all or part of a message to be signed by a second party, " @@ -840,38 +747,37 @@ msgid "" "when all portions of the message are prepared by the signer." msgstr "" -#: ../../library/hashlib.rst:662 +#: ../../library/hashlib.rst:578 msgid "" "(`NIST SP-800-106 \"Randomized Hashing for Digital Signatures\" `_)" +"csrc.nist.gov/publications/detail/sp/800-106/final>`_)" msgstr "" -#: ../../library/hashlib.rst:665 +#: ../../library/hashlib.rst:581 msgid "" "In BLAKE2 the salt is processed as a one-time input to the hash function " "during initialization, rather than as an input to each compression function." msgstr "" -#: ../../library/hashlib.rst:670 +#: ../../library/hashlib.rst:586 msgid "" "*Salted hashing* (or just hashing) with BLAKE2 or any other general-purpose " "cryptographic hash function, such as SHA-256, is not suitable for hashing " -"passwords. See `BLAKE2 FAQ `_ for more " -"information." +"passwords. See `BLAKE2 FAQ `_ for more information." msgstr "" -#: ../../library/hashlib.rst:693 +#: ../../library/hashlib.rst:609 msgid "Personalization" msgstr "" -#: ../../library/hashlib.rst:695 +#: ../../library/hashlib.rst:611 msgid "" "Sometimes it is useful to force hash function to produce different digests " "for the same input for different purposes. Quoting the authors of the Skein " "hash function:" msgstr "" -#: ../../library/hashlib.rst:699 +#: ../../library/hashlib.rst:615 msgid "" "We recommend that all application designers seriously consider doing this; " "we have seen many protocols where a hash that is computed in one part of the " @@ -881,53 +787,33 @@ msgid "" "hash function used in the protocol summarily stops this type of attack." msgstr "" -#: ../../library/hashlib.rst:706 +#: ../../library/hashlib.rst:622 msgid "" -"(`The Skein Hash Function Family `_, p. 21)" +"(`The Skein Hash Function Family `_, p. 21)" msgstr "" +"(`The Skein Hash Function Family `_, p. 21)" -#: ../../library/hashlib.rst:710 +#: ../../library/hashlib.rst:626 msgid "BLAKE2 can be personalized by passing bytes to the *person* argument::" msgstr "BLAKE2は *person* 引数にバイト列を渡すことでパーソナライズできます::" -#: ../../library/hashlib.rst:712 -msgid "" -">>> from hashlib import blake2b\n" -">>> FILES_HASH_PERSON = b'MyApp Files Hash'\n" -">>> BLOCK_HASH_PERSON = b'MyApp Block Hash'\n" -">>> h = blake2b(digest_size=32, person=FILES_HASH_PERSON)\n" -">>> h.update(b'the same content')\n" -">>> h.hexdigest()\n" -"'20d9cd024d4fb086aae819a1432dd2466de12947831b75c5a30cf2676095d3b4'\n" -">>> h = blake2b(digest_size=32, person=BLOCK_HASH_PERSON)\n" -">>> h.update(b'the same content')\n" -">>> h.hexdigest()\n" -"'cf68fb5761b9c44e7878bfb2c4c9aea52264a80b75005e65619778de59f383a3'" -msgstr "" - -#: ../../library/hashlib.rst:724 +#: ../../library/hashlib.rst:640 msgid "" "Personalization together with the keyed mode can also be used to derive " "different keys from a single one." msgstr "" -#: ../../library/hashlib.rst:738 +#: ../../library/hashlib.rst:654 msgid "Tree mode" msgstr "ツリーモード" -#: ../../library/hashlib.rst:740 +#: ../../library/hashlib.rst:656 msgid "Here's an example of hashing a minimal tree with two leaf nodes::" msgstr "これが二つの葉ノードからなる最小の木をハッシュする例です::" -#: ../../library/hashlib.rst:742 -msgid "" -" 10\n" -" / \\\n" -"00 01" -msgstr "" - -#: ../../library/hashlib.rst:746 +#: ../../library/hashlib.rst:662 msgid "" "This example uses 64-byte internal digests, and returns the 32-byte final " "digest::" @@ -935,40 +821,11 @@ msgstr "" "次の例では、64バイトの内部桁が使われ、32バイトの最終的なダイジェストを返して" "います::" -#: ../../library/hashlib.rst:749 -msgid "" -">>> from hashlib import blake2b\n" -">>>\n" -">>> FANOUT = 2\n" -">>> DEPTH = 2\n" -">>> LEAF_SIZE = 4096\n" -">>> INNER_SIZE = 64\n" -">>>\n" -">>> buf = bytearray(6000)\n" -">>>\n" -">>> # Left leaf\n" -"... h00 = blake2b(buf[0:LEAF_SIZE], fanout=FANOUT, depth=DEPTH,\n" -"... leaf_size=LEAF_SIZE, inner_size=INNER_SIZE,\n" -"... node_offset=0, node_depth=0, last_node=False)\n" -">>> # Right leaf\n" -"... h01 = blake2b(buf[LEAF_SIZE:], fanout=FANOUT, depth=DEPTH,\n" -"... leaf_size=LEAF_SIZE, inner_size=INNER_SIZE,\n" -"... node_offset=1, node_depth=0, last_node=True)\n" -">>> # Root node\n" -"... h10 = blake2b(digest_size=32, fanout=FANOUT, depth=DEPTH,\n" -"... leaf_size=LEAF_SIZE, inner_size=INNER_SIZE,\n" -"... node_offset=0, node_depth=1, last_node=True)\n" -">>> h10.update(h00.digest())\n" -">>> h10.update(h01.digest())\n" -">>> h10.hexdigest()\n" -"'3ad2a9b37c6070e374c7a8c508fe20ca86b6ed54e286e93a0318e95e881db5aa'" -msgstr "" - -#: ../../library/hashlib.rst:776 +#: ../../library/hashlib.rst:692 msgid "Credits" msgstr "クレジット::" -#: ../../library/hashlib.rst:778 +#: ../../library/hashlib.rst:694 msgid "" "BLAKE2_ was designed by *Jean-Philippe Aumasson*, *Samuel Neves*, *Zooko " "Wilcox-O'Hearn*, and *Christian Winnerlein* based on SHA-3_ finalist BLAKE_ " @@ -980,7 +837,7 @@ msgstr "" "に、*Jean-Philippe Aumasson*、 *Samuel Neves*、 *Zooko Wilcox-O'Hearn*, そし" "て *Christian Winnerlein* によって設計されました。" -#: ../../library/hashlib.rst:783 +#: ../../library/hashlib.rst:699 msgid "" "It uses core algorithm from ChaCha_ cipher designed by *Daniel J. " "Bernstein*." @@ -988,7 +845,7 @@ msgstr "" "それは、 *Daniel J. Bernstein* によって設計されたChaCha_ 暗号由来のアルゴリ" "ズムを用いています。" -#: ../../library/hashlib.rst:785 +#: ../../library/hashlib.rst:701 msgid "" "The stdlib implementation is based on pyblake2_ module. It was written by " "*Dmitry Chestnykh* based on C implementation written by *Samuel Neves*. The " @@ -1000,12 +857,12 @@ msgstr "" "このドキュメントは、pyblake2_ からコピーされ、*Dmitry Chestnykh* によって書か" "れました。" -#: ../../library/hashlib.rst:789 +#: ../../library/hashlib.rst:705 msgid "The C code was partly rewritten for Python by *Christian Heimes*." msgstr "" "*Christian Heimes* によって、一部のCコードがPython向けに書き直されました。" -#: ../../library/hashlib.rst:791 +#: ../../library/hashlib.rst:707 msgid "" "The following public domain dedication applies for both C hash function " "implementation, extension code, and this documentation:" @@ -1013,119 +870,87 @@ msgstr "" "以下の public domain dedicationが、Cのハッシュ関数実装と、拡張コードと、この" "ドキュメントに適用されます:" -#: ../../library/hashlib.rst:794 +#: ../../library/hashlib.rst:710 msgid "" "To the extent possible under law, the author(s) have dedicated all copyright " "and related and neighboring rights to this software to the public domain " "worldwide. This software is distributed without any warranty." msgstr "" -#: ../../library/hashlib.rst:798 +#: ../../library/hashlib.rst:714 msgid "" "You should have received a copy of the CC0 Public Domain Dedication along " "with this software. If not, see https://creativecommons.org/publicdomain/" "zero/1.0/." msgstr "" -#: ../../library/hashlib.rst:802 +#: ../../library/hashlib.rst:718 msgid "" "The following people have helped with development or contributed their " "changes to the project and the public domain according to the Creative " "Commons Public Domain Dedication 1.0 Universal:" msgstr "" -#: ../../library/hashlib.rst:806 +#: ../../library/hashlib.rst:722 msgid "*Alexandr Sokolovskiy*" msgstr "*Alexandr Sokolovskiy*" -#: ../../library/hashlib.rst:827 +#: ../../library/hashlib.rst:736 msgid "Module :mod:`hmac`" msgstr ":mod:`hmac` モジュール" -#: ../../library/hashlib.rst:828 +#: ../../library/hashlib.rst:736 msgid "A module to generate message authentication codes using hashes." msgstr "ハッシュを用いてメッセージ認証コードを生成するモジュールです。" -#: ../../library/hashlib.rst:830 +#: ../../library/hashlib.rst:739 msgid "Module :mod:`base64`" msgstr ":mod:`base64` モジュール" -#: ../../library/hashlib.rst:831 +#: ../../library/hashlib.rst:739 msgid "Another way to encode binary hashes for non-binary environments." msgstr "" "バイナリハッシュを非バイナリ環境用にエンコードするもうひとつの方法です。" -#: ../../library/hashlib.rst:833 -msgid "https://nvlpubs.nist.gov/nistpubs/fips/nist.fips.180-4.pdf" -msgstr "" - -#: ../../library/hashlib.rst:834 -msgid "The FIPS 180-4 publication on Secure Hash Algorithms." -msgstr "" - -#: ../../library/hashlib.rst:836 -msgid "https://csrc.nist.gov/pubs/fips/202/final" -msgstr "" - -#: ../../library/hashlib.rst:837 -msgid "The FIPS 202 publication on the SHA-3 Standard." -msgstr "" - -#: ../../library/hashlib.rst:839 -msgid "https://www.blake2.net/" -msgstr "" +#: ../../library/hashlib.rst:742 +msgid "https://blake2.net/" +msgstr "https://blake2.net/" -#: ../../library/hashlib.rst:840 +#: ../../library/hashlib.rst:742 msgid "Official BLAKE2 website." msgstr "BLAKE2 の公式ウェブサイト" -#: ../../library/hashlib.rst:842 -msgid "https://en.wikipedia.org/wiki/Cryptographic_hash_function" -msgstr "" - -#: ../../library/hashlib.rst:843 +#: ../../library/hashlib.rst:745 msgid "" -"Wikipedia article with information on which algorithms have known issues and " -"what that means regarding their use." -msgstr "" -"どのアルゴリズムにどんな既知の問題があって、それが実際に利用する際にどう影響" -"するかについての Wikipedia の記事。" - -#: ../../library/hashlib.rst:846 -msgid "https://www.ietf.org/rfc/rfc8018.txt" +"https://csrc.nist.gov/csrc/media/publications/fips/180/2/archive/2002-08-01/" +"documents/fips180-2.pdf" msgstr "" -#: ../../library/hashlib.rst:847 -msgid "PKCS #5: Password-Based Cryptography Specification Version 2.1" -msgstr "" +#: ../../library/hashlib.rst:745 +msgid "The FIPS 180-2 publication on Secure Hash Algorithms." +msgstr "FIPS 180-2 のセキュアハッシュアルゴリズムについての説明。" -#: ../../library/hashlib.rst:849 +#: ../../library/hashlib.rst:749 msgid "" -"https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf" -msgstr "" - -#: ../../library/hashlib.rst:850 -msgid "NIST Recommendation for Password-Based Key Derivation." +"https://en.wikipedia.org/wiki/" +"Cryptographic_hash_function#Cryptographic_hash_algorithms" msgstr "" +"https://en.wikipedia.org/wiki/" +"Cryptographic_hash_function#Cryptographic_hash_algorithms (日本語版: https://" +"暗号学的ハッシュ関数)" -#: ../../library/hashlib.rst:12 -msgid "message digest, MD5" -msgstr "" - -#: ../../library/hashlib.rst:12 +#: ../../library/hashlib.rst:748 msgid "" -"secure hash algorithm, SHA1, SHA2, SHA224, SHA256, SHA384, SHA512, SHA3, " -"Shake, Blake2" +"Wikipedia article with information on which algorithms have known issues and " +"what that means regarding their use." msgstr "" +"どのアルゴリズムにどんな既知の問題があって、それが実際に利用する際にどう影響" +"するかについての Wikipedia の記事。" -#: ../../library/hashlib.rst:53 -msgid "OpenSSL" -msgstr "OpenSSL" - -#: ../../library/hashlib.rst:53 -msgid "(use in module hashlib)" -msgstr "" +#: ../../library/hashlib.rst:751 +msgid "https://www.ietf.org/rfc/rfc2898.txt" +msgstr "https://www.ietf.org/rfc/rfc2898.txt" -#: ../../library/hashlib.rst:377 -msgid "blake2b, blake2s" -msgstr "" +#: ../../library/hashlib.rst:752 +msgid "PKCS #5: Password-Based Cryptography Specification Version 2.0" +msgstr "PKCS #5: Password-Based Cryptography Specification Version 2.0" diff --git a/library/heapq.po b/library/heapq.po index 880154e78..823727d1f 100644 --- a/library/heapq.po +++ b/library/heapq.po @@ -1,32 +1,34 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: +# Nozomu Kaneko , 2017 +# 秘湯 , 2017 +# Shun Sakurai, 2017 +# Arihiro TAKASE, 2017 # Takanori Suzuki , 2021 -# tomo, 2021 -# 石井明久, 2024 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 01:07+0000\n" -"Last-Translator: 石井明久, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 23:13+0000\n" +"Last-Translator: Takanori Suzuki , 2021\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/heapq.rst:2 -msgid ":mod:`!heapq` --- Heap queue algorithm" -msgstr ":mod:`!heapq` --- ヒープキューアルゴリズム" +msgid ":mod:`heapq` --- Heap queue algorithm" +msgstr ":mod:`heapq` --- ヒープキューアルゴリズム" #: ../../library/heapq.rst:12 msgid "**Source code:** :source:`Lib/heapq.py`" @@ -42,85 +44,74 @@ msgstr "" #: ../../library/heapq.rst:19 msgid "" -"Min-heaps are binary trees for which every parent node has a value less than " -"or equal to any of its children. We refer to this condition as the heap " -"invariant." +"Heaps are binary trees for which every parent node has a value less than or " +"equal to any of its children. This implementation uses arrays for which " +"``heap[k] <= heap[2*k+1]`` and ``heap[k] <= heap[2*k+2]`` for all *k*, " +"counting elements from zero. For the sake of comparison, non-existing " +"elements are considered to be infinite. The interesting property of a heap " +"is that its smallest element is always the root, ``heap[0]``." msgstr "" +"ヒープとは、全ての親ノードの値が、その全ての子の値以下であるようなバイナリツ" +"リーです。この実装は、全ての *k* に対して、ゼロから要素を数えていった際に、" +"``heap[k] <= heap[2*k+1]`` かつ ``heap[k] <= heap[2*k+2]`` となる配列を使って" +"います。比較のために、存在しない要素は無限大として扱われます。ヒープの興味深" +"い性質は、最小の要素が常にルート、つまり ``heap[0]`` になることです。" -#: ../../library/heapq.rst:23 +#: ../../library/heapq.rst:26 msgid "" -"For min-heaps, this implementation uses lists for which ``heap[k] <= " -"heap[2*k+1]`` and ``heap[k] <= heap[2*k+2]`` for all *k* for which the " -"compared elements exist. Elements are counted from zero. The interesting " -"property of a min-heap is that its smallest element is always the root, " -"``heap[0]``." +"The API below differs from textbook heap algorithms in two aspects: (a) We " +"use zero-based indexing. This makes the relationship between the index for " +"a node and the indexes for its children slightly less obvious, but is more " +"suitable since Python uses zero-based indexing. (b) Our pop method returns " +"the smallest item, not the largest (called a \"min heap\" in textbooks; a " +"\"max heap\" is more common in texts because of its suitability for in-place " +"sorting)." msgstr "" +"以下の API は教科書におけるヒープアルゴリズムとは 2 つの側面で異なっていま" +"す: (a) ゼロベースのインデクス化を行っています。これにより、ノードに対するイ" +"ンデクスとその子ノードのインデクスの関係がやや明瞭でなくなりますが、Python は" +"ゼロベースのインデクス化を使っているのでよりしっくりきます。(b) われわれの " +"pop メソッドは最大の要素ではなく最小の要素 (教科書では \"min heap:最小ヒープ" +"\" と呼ばれています; 教科書では並べ替えをインプレースで行うのに適した \"max " +"heap:最大ヒープ\" が一般的です)。" -#: ../../library/heapq.rst:29 +#: ../../library/heapq.rst:33 msgid "" -"Max-heaps satisfy the reverse invariant: every parent node has a value " -"*greater* than any of its children. These are implemented as lists for " -"which ``maxheap[2*k+1] <= maxheap[k]`` and ``maxheap[2*k+2] <= maxheap[k]`` " -"for all *k* for which the compared elements exist. The root, ``maxheap[0]``, " -"contains the *largest* element; ``heap.sort(reverse=True)`` maintains the " -"max-heap invariant." +"These two make it possible to view the heap as a regular Python list without " +"surprises: ``heap[0]`` is the smallest item, and ``heap.sort()`` maintains " +"the heap invariant!" msgstr "" +"これらの 2 点によって、ユーザに戸惑いを与えることなく、ヒープを通常の Python " +"リストとして見ることができます: ``heap[0]`` が最小の要素となり、``heap." +"sort()`` はヒープ不変式を保ちます!" -#: ../../library/heapq.rst:36 +#: ../../library/heapq.rst:37 msgid "" -"The :mod:`!heapq` API differs from textbook heap algorithms in two aspects: " -"(a) We use zero-based indexing. This makes the relationship between the " -"index for a node and the indexes for its children slightly less obvious, but " -"is more suitable since Python uses zero-based indexing. (b) Textbooks often " -"focus on max-heaps, due to their suitability for in-place sorting. Our " -"implementation favors min-heaps as they better correspond to Python :class:" -"`lists `." +"To create a heap, use a list initialized to ``[]``, or you can transform a " +"populated list into a heap via function :func:`heapify`." msgstr "" +"ヒープを作成するには、 ``[]`` に初期化されたリストを使うか、 :func:`heapify` " +"を用いて要素の入ったリストを変換します。" -#: ../../library/heapq.rst:43 -msgid "" -"These two aspects make it possible to view the heap as a regular Python list " -"without surprises: ``heap[0]`` is the smallest item, and ``heap.sort()`` " -"maintains the heap invariant!" -msgstr "" +#: ../../library/heapq.rst:40 +msgid "The following functions are provided:" +msgstr "次の関数が用意されています:" -#: ../../library/heapq.rst:47 -msgid "" -"Like :meth:`list.sort`, this implementation uses only the ``<`` operator for " -"comparisons, for both min-heaps and max-heaps." -msgstr "" +#: ../../library/heapq.rst:45 +msgid "Push the value *item* onto the *heap*, maintaining the heap invariant." +msgstr "*item* を *heap* に push します。ヒープ不変式を保ちます。" #: ../../library/heapq.rst:50 msgid "" -"In the API below, and in this documentation, the unqualified term *heap* " -"generally refers to a min-heap. The API for max-heaps is named using a " -"``_max`` suffix." -msgstr "" - -#: ../../library/heapq.rst:54 -msgid "" -"To create a heap, use a list initialized as ``[]``, or transform an existing " -"list into a min-heap or max-heap using the :func:`heapify` or :func:" -"`heapify_max` functions, respectively." -msgstr "" - -#: ../../library/heapq.rst:58 -msgid "The following functions are provided for min-heaps:" -msgstr "" - -#: ../../library/heapq.rst:63 -msgid "" -"Push the value *item* onto the *heap*, maintaining the min-heap invariant." -msgstr "" - -#: ../../library/heapq.rst:68 -msgid "" -"Pop and return the smallest item from the *heap*, maintaining the min-heap " +"Pop and return the smallest item from the *heap*, maintaining the heap " "invariant. If the heap is empty, :exc:`IndexError` is raised. To access " "the smallest item without popping it, use ``heap[0]``." msgstr "" +"pop を行い、 *heap* から最小の要素を返します。ヒープ不変式は保たれます。ヒー" +"プが空の場合、 :exc:`IndexError` が送出されます。pop せずに最小の要素にアクセ" +"スするには、 ``heap[0]`` を使ってください。" -#: ../../library/heapq.rst:75 +#: ../../library/heapq.rst:57 msgid "" "Push *item* on the heap, then pop and return the smallest item from the " "*heap*. The combined action runs more efficiently than :func:`heappush` " @@ -130,11 +121,11 @@ msgstr "" "す。この一続きの動作を :func:`heappush` に引き続いて :func:`heappop` を別々に" "呼び出すよりも効率的に実行します。" -#: ../../library/heapq.rst:82 -msgid "Transform list *x* into a min-heap, in-place, in linear time." -msgstr "" +#: ../../library/heapq.rst:64 +msgid "Transform list *x* into a heap, in-place, in linear time." +msgstr "リスト *x* をインプレース処理し、線形時間でヒープに変換します。" -#: ../../library/heapq.rst:87 +#: ../../library/heapq.rst:69 msgid "" "Pop and return the smallest item from the *heap*, and also push the new " "*item*. The heap size doesn't change. If the heap is empty, :exc:" @@ -143,7 +134,7 @@ msgstr "" "*heap* から最小の要素を pop して返し、新たに *item* を push します。ヒープの" "サイズは変更されません。ヒープが空の場合、 :exc:`IndexError` が送出されます。" -#: ../../library/heapq.rst:90 +#: ../../library/heapq.rst:72 msgid "" "This one step operation is more efficient than a :func:`heappop` followed " "by :func:`heappush` and can be more appropriate when using a fixed-size " @@ -154,7 +145,7 @@ msgstr "" "率的で、固定サイズのヒープを用いている場合にはより適しています。 pop/push の" "組み合わせは必ずヒープから要素を一つ返し、それを *item* と置き換えます。" -#: ../../library/heapq.rst:95 +#: ../../library/heapq.rst:77 msgid "" "The value returned may be larger than the *item* added. If that isn't " "desired, consider using :func:`heappushpop` instead. Its push/pop " @@ -165,52 +156,11 @@ msgstr "" "なら、代わりに :func:`heappushpop` を使うことを考えてください。この push/pop " "の組み合わせは二つの値の小さい方を返し、大きい方の値をヒープに残します。" -#: ../../library/heapq.rst:101 -msgid "For max-heaps, the following functions are provided:" -msgstr "" - -#: ../../library/heapq.rst:106 -msgid "Transform list *x* into a max-heap, in-place, in linear time." -msgstr "" - -#: ../../library/heapq.rst:113 -msgid "" -"Push the value *item* onto the max-heap *heap*, maintaining the max-heap " -"invariant." -msgstr "" - -#: ../../library/heapq.rst:121 -msgid "" -"Pop and return the largest item from the max-heap *heap*, maintaining the " -"max-heap invariant. If the max-heap is empty, :exc:`IndexError` is raised. " -"To access the largest item without popping it, use ``maxheap[0]``." -msgstr "" - -#: ../../library/heapq.rst:130 -msgid "" -"Push *item* on the max-heap *heap*, then pop and return the largest item " -"from *heap*. The combined action runs more efficiently than :func:" -"`heappush_max` followed by a separate call to :func:`heappop_max`." -msgstr "" - -#: ../../library/heapq.rst:140 -msgid "" -"Pop and return the largest item from the max-heap *heap* and also push the " -"new *item*. The max-heap size doesn't change. If the max-heap is empty, :exc:" -"`IndexError` is raised." -msgstr "" - -#: ../../library/heapq.rst:145 -msgid "" -"The value returned may be smaller than the *item* added. Refer to the " -"analogous function :func:`heapreplace` for detailed usage notes." -msgstr "" - -#: ../../library/heapq.rst:151 +#: ../../library/heapq.rst:83 msgid "The module also offers three general purpose functions based on heaps." msgstr "このモジュールではさらに3つのヒープに基く汎用関数を提供します。" -#: ../../library/heapq.rst:156 +#: ../../library/heapq.rst:88 msgid "" "Merge multiple sorted inputs into a single sorted output (for example, merge " "timestamped entries from multiple log files). Returns an :term:`iterator` " @@ -220,7 +170,7 @@ msgstr "" "えば、複数のログファイルの時刻の入ったエントリーをマージします)。ソートされた" "値にわたる :term:`iterator` を返します。" -#: ../../library/heapq.rst:160 +#: ../../library/heapq.rst:92 msgid "" "Similar to ``sorted(itertools.chain(*iterables))`` but returns an iterable, " "does not pull the data into memory all at once, and assumes that each of the " @@ -230,14 +180,14 @@ msgstr "" "度にはデータをメモリに読み込まず、それぞれの入力ストリームが予め(最小から最大" "へ)ソートされていることを仮定します。" -#: ../../library/heapq.rst:164 +#: ../../library/heapq.rst:96 msgid "" "Has two optional arguments which must be specified as keyword arguments." msgstr "" "2 つのオプション引数があり、これらはキーワード引数として指定されなければなり" "ません。" -#: ../../library/heapq.rst:166 +#: ../../library/heapq.rst:98 msgid "" "*key* specifies a :term:`key function` of one argument that is used to " "extract a comparison key from each input element. The default value is " @@ -247,7 +197,7 @@ msgstr "" "力の各要素から比較のキーを取り出すのに使われます。デフォルト値は ``None`` で" "す (要素を直接比較します)。" -#: ../../library/heapq.rst:170 +#: ../../library/heapq.rst:102 msgid "" "*reverse* is a boolean value. If set to ``True``, then the input elements " "are merged as if each comparison were reversed. To achieve behavior similar " @@ -259,11 +209,11 @@ msgstr "" "reverse=True)`` でこれに似た挙動を実現するには、全てのイテラブルは降順で並ん" "でいなければなりません。" -#: ../../library/heapq.rst:175 +#: ../../library/heapq.rst:107 msgid "Added the optional *key* and *reverse* parameters." msgstr "オプションの *key* 引数および *reverse* 引数を追加." -#: ../../library/heapq.rst:181 +#: ../../library/heapq.rst:113 msgid "" "Return a list with the *n* largest elements from the dataset defined by " "*iterable*. *key*, if provided, specifies a function of one argument that " @@ -276,7 +226,7 @@ msgstr "" "ぞれの要素から比較キーを生成する関数を指定します(例 ``key=str.lower``)。以下" "のコードと同等です: ``sorted(iterable, key=key, reverse=True)[:n]``" -#: ../../library/heapq.rst:190 +#: ../../library/heapq.rst:122 msgid "" "Return a list with the *n* smallest elements from the dataset defined by " "*iterable*. *key*, if provided, specifies a function of one argument that " @@ -289,7 +239,7 @@ msgstr "" "ぞれの要素から比較キーを生成する関数を指定します(例 ``key=str.lower``)。以下" "のコードと同等です: ``sorted(iterable, key=key)[:n]``" -#: ../../library/heapq.rst:196 +#: ../../library/heapq.rst:128 msgid "" "The latter two functions perform best for smaller values of *n*. For larger " "values, it is more efficient to use the :func:`sorted` function. Also, when " @@ -302,11 +252,11 @@ msgstr "" "よび :func:`max` 関数の方が効率的です。この関数を繰り返し使うことが必要なら、" "iterable を実際のヒープに変えることを考えてください。" -#: ../../library/heapq.rst:204 +#: ../../library/heapq.rst:136 msgid "Basic Examples" msgstr "基本的な例" -#: ../../library/heapq.rst:206 +#: ../../library/heapq.rst:138 msgid "" "A `heapsort `_ can be implemented by " "pushing all values onto a heap and then popping off the smallest values one " @@ -316,19 +266,7 @@ msgstr "" "ソート `_ を実装できます::" -#: ../../library/heapq.rst:210 -msgid "" -">>> def heapsort(iterable):\n" -"... h = []\n" -"... for value in iterable:\n" -"... heappush(h, value)\n" -"... return [heappop(h) for i in range(len(h))]\n" -"...\n" -">>> heapsort([1, 3, 5, 7, 9, 2, 4, 6, 8, 0])\n" -"[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]" -msgstr "" - -#: ../../library/heapq.rst:219 +#: ../../library/heapq.rst:151 msgid "" "This is similar to ``sorted(iterable)``, but unlike :func:`sorted`, this " "implementation is not stable." @@ -336,7 +274,7 @@ msgstr "" "これは ``sorted(iterable)`` に似ていますが、 :func:`sorted` とは異なり、この" "実装はステーブルソートではありません。" -#: ../../library/heapq.rst:222 +#: ../../library/heapq.rst:154 msgid "" "Heap elements can be tuples. This is useful for assigning comparison values " "(such as task priorities) alongside the main record being tracked::" @@ -344,22 +282,11 @@ msgstr "" "ヒープの要素はタプルに出来ます。これは、追跡される主レコードとは別に (タスク" "の優先度のような) 比較値を指定するときに便利です::" -#: ../../library/heapq.rst:225 -msgid "" -">>> h = []\n" -">>> heappush(h, (5, 'write code'))\n" -">>> heappush(h, (7, 'release product'))\n" -">>> heappush(h, (1, 'write spec'))\n" -">>> heappush(h, (3, 'create tests'))\n" -">>> heappop(h)\n" -"(1, 'write spec')" -msgstr "" - -#: ../../library/heapq.rst:235 +#: ../../library/heapq.rst:167 msgid "Priority Queue Implementation Notes" msgstr "優先度キュー実装の注釈" -#: ../../library/heapq.rst:237 +#: ../../library/heapq.rst:169 msgid "" "A `priority queue `_ is common " "use for a heap, and it presents several implementation challenges:" @@ -368,7 +295,7 @@ msgstr "" "%E5%84%AA%E5%85%88%E5%BA%A6%E3%81%A4%E3%81%8D%E3%82%AD%E3%83%A5%E3%83%BC>`_ " "は、ヒープの一般的な使い方で、実装にはいくつか困難な点があります:" -#: ../../library/heapq.rst:240 +#: ../../library/heapq.rst:172 msgid "" "Sort stability: how do you get two tasks with equal priorities to be " "returned in the order they were originally added?" @@ -376,7 +303,7 @@ msgstr "" "ソート安定性: 優先度が等しい二つのタスクが、もともと追加された順序で返される" "ためにはどうしたらいいでしょうか?" -#: ../../library/heapq.rst:243 +#: ../../library/heapq.rst:175 msgid "" "Tuple comparison breaks for (priority, task) pairs if the priorities are " "equal and the tasks do not have a default comparison order." @@ -384,7 +311,7 @@ msgstr "" "(priority, task) ペアに対するタプルの比較は、priority が同じで task がデフォ" "ルトの比較順を持たないときに破綻します。" -#: ../../library/heapq.rst:246 +#: ../../library/heapq.rst:178 msgid "" "If the priority of a task changes, how do you move it to a new position in " "the heap?" @@ -392,7 +319,7 @@ msgstr "" "あるタスクの優先度が変化したら、どうやってそれをヒープの新しい位置に移動させ" "るのでしょうか?" -#: ../../library/heapq.rst:249 +#: ../../library/heapq.rst:181 msgid "" "Or if a pending task needs to be deleted, how do you find it and remove it " "from the queue?" @@ -400,7 +327,7 @@ msgstr "" "未解決のタスクが削除される必要があるとき、どのようにそれをキューから探して削" "除するのでしょうか?" -#: ../../library/heapq.rst:252 +#: ../../library/heapq.rst:184 msgid "" "A solution to the first two challenges is to store entries as 3-element list " "including the priority, an entry count, and the task. The entry count " @@ -414,7 +341,7 @@ msgstr "" "の項目番号が等しくなることはありませんので、タプルの比較が二つのタスクを直接" "比べようとすることはありえません。" -#: ../../library/heapq.rst:258 +#: ../../library/heapq.rst:190 msgid "" "Another solution to the problem of non-comparable tasks is to create a " "wrapper class that ignores the task item and only compares the priority " @@ -423,18 +350,7 @@ msgstr "" "比較できないタスク問題のもう一つの解決法は、タスクアイテムを無視して優先順序" "フィールドだけで比較するラッパークラスです::" -#: ../../library/heapq.rst:261 -msgid "" -"from dataclasses import dataclass, field\n" -"from typing import Any\n" -"\n" -"@dataclass(order=True)\n" -"class PrioritizedItem:\n" -" priority: int\n" -" item: Any=field(compare=False)" -msgstr "" - -#: ../../library/heapq.rst:269 +#: ../../library/heapq.rst:201 msgid "" "The remaining challenges revolve around finding a pending task and making " "changes to its priority or removing it entirely. Finding a task can be done " @@ -444,7 +360,7 @@ msgstr "" "することです。タスクを探すことは、キュー内の項目を指し示す辞書によってなされ" "ます。" -#: ../../library/heapq.rst:273 +#: ../../library/heapq.rst:205 msgid "" "Removing the entry or changing its priority is more difficult because it " "would break the heap structure invariants. So, a possible solution is to " @@ -454,42 +370,11 @@ msgstr "" "るので、もっと難しいです。ですから、可能な解決策は、その項目が無効であるもの" "としてマークし、必要なら変更された優先度の項目を加えることです::" -#: ../../library/heapq.rst:277 -msgid "" -"pq = [] # list of entries arranged in a heap\n" -"entry_finder = {} # mapping of tasks to entries\n" -"REMOVED = '' # placeholder for a removed task\n" -"counter = itertools.count() # unique sequence count\n" -"\n" -"def add_task(task, priority=0):\n" -" 'Add a new task or update the priority of an existing task'\n" -" if task in entry_finder:\n" -" remove_task(task)\n" -" count = next(counter)\n" -" entry = [priority, count, task]\n" -" entry_finder[task] = entry\n" -" heappush(pq, entry)\n" -"\n" -"def remove_task(task):\n" -" 'Mark an existing task as REMOVED. Raise KeyError if not found.'\n" -" entry = entry_finder.pop(task)\n" -" entry[-1] = REMOVED\n" -"\n" -"def pop_task():\n" -" 'Remove and return the lowest priority task. Raise KeyError if empty.'\n" -" while pq:\n" -" priority, count, task = heappop(pq)\n" -" if task is not REMOVED:\n" -" del entry_finder[task]\n" -" return task\n" -" raise KeyError('pop from an empty priority queue')" -msgstr "" - -#: ../../library/heapq.rst:307 +#: ../../library/heapq.rst:239 msgid "Theory" msgstr "理論" -#: ../../library/heapq.rst:309 +#: ../../library/heapq.rst:241 msgid "" "Heaps are arrays for which ``a[k] <= a[2*k+1]`` and ``a[k] <= a[2*k+2]`` for " "all *k*, counting elements from 0. For the sake of comparison, non-existing " @@ -501,7 +386,7 @@ msgstr "" "い要素を無限大と考えます。ヒープの興味深い属性は ``a[0]`` が常に最小の要素に" "なることです。" -#: ../../library/heapq.rst:314 +#: ../../library/heapq.rst:246 msgid "" "The strange invariant above is meant to be an efficient memory " "representation for a tournament. The numbers below are *k*, not ``a[k]``::" @@ -509,20 +394,7 @@ msgstr "" "上記の奇妙な不変式は、勝ち抜き戦判定の際に効率的なメモリ表現を行うためのもの" "です。以下の番号は ``a[k]`` ではなく *k* とします::" -#: ../../library/heapq.rst:317 -msgid "" -" 0\n" -"\n" -" 1 2\n" -"\n" -" 3 4 5 6\n" -"\n" -" 7 8 9 10 11 12 13 14\n" -"\n" -"15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30" -msgstr "" - -#: ../../library/heapq.rst:327 +#: ../../library/heapq.rst:259 msgid "" "In the tree above, each cell *k* is topping ``2*k+1`` and ``2*k+2``. In a " "usual binary tournament we see in sports, each cell is the winner over the " @@ -543,7 +415,7 @@ msgstr "" "てきて置き換えることにすると、あるセルとその下位にある二つのセルは異なる三つ" "の要素を含み、かつ上位のセルは二つの下位のセルに対して \"勝者と\" なります。" -#: ../../library/heapq.rst:336 +#: ../../library/heapq.rst:268 msgid "" "If this heap invariant is protected at all time, index 0 is clearly the " "overall winner. The simplest algorithmic way to remove it and find the " @@ -551,17 +423,17 @@ msgid "" "above) into the 0 position, and then percolate this new 0 down the tree, " "exchanging values, until the invariant is re-established. This is clearly " "logarithmic on the total number of items in the tree. By iterating over all " -"items, you get an *O*\\ (*n* log *n*) sort." +"items, you get an O(n log n) sort." msgstr "" -"このヒープ不変式が常に守られれば、インデックス 0 は明らかに最勝者となります。" -"最勝者の要素を除去し、\"次の\" 勝者を見つけるための最も単純なアルゴリズム的手" -"法は、ある敗者要素 (ここでは上図のセル 30 とします) を 0 の場所に持っていき、" -"この新しい 0 を濾過するようにしてツリーを下らせて値を交換してゆきます。不変関" -"係が再構築されるまでこれを続けます。この操作は明らかに、ツリー内の全ての要素" -"数に対して対数的な計算量となります。全ての要素について繰り返すと、 *O*\\ " -"(*n* log *n*) のソートになります。" +"このヒープ不変式が常に守られれば、インデクス 0 は明らかに最勝者となります。最" +"勝者の要素を除去し、\"次の\" 勝者を見つけるための最も単純なアルゴリズム的手法" +"は、ある敗者要素 (ここでは上図のセル 30 とします) を 0 の場所に持っていき、こ" +"の新しい 0 を濾過するようにしてツリーを下らせて値を交換してゆきます。不変関係" +"が再構築されるまでこれを続けます。この操作は明らかに、ツリー内の全ての要素数" +"に対して対数的な計算量となります。全ての要素について繰り返すと、O(n log n) の" +"ソート(並べ替え)になります。" -#: ../../library/heapq.rst:343 +#: ../../library/heapq.rst:275 msgid "" "A nice feature of this sort is that you can efficiently insert new items " "while the sort is going on, provided that the inserted items are not " @@ -581,7 +453,7 @@ msgstr "" "プに積むことができます。すなわち、ヒープはスケジューラを実装する上で良いデー" "タ構造であるといえます (私はこれを MIDI シーケンサで使っています :-)。" -#: ../../library/heapq.rst:352 +#: ../../library/heapq.rst:284 msgid "" "Various structures for implementing schedulers have been extensively " "studied, and heaps are good for this, as they are reasonably speedy, the " @@ -595,7 +467,7 @@ msgstr "" "どい速度になるとしても、全体的にはより効率の高い他のデータ構造表現も存在しま" "す。" -#: ../../library/heapq.rst:358 +#: ../../library/heapq.rst:290 msgid "" "Heaps are also very useful in big disk sorts. You most probably all know " "that a big sort implies producing \"runs\" (which are pre-sorted sequences, " @@ -618,7 +490,7 @@ msgstr "" "ば、ランダムな入力に対してメモリの二倍のサイズのランを生成することになり、大" "体順序づけがなされている入力に対してはもっと高い効率になります。" -#: ../../library/heapq.rst:368 +#: ../../library/heapq.rst:300 msgid "" "Moreover, if you output the 0'th item on disk and get an input which may not " "fit in the current tournament (because the value \"wins\" over the last " @@ -635,7 +507,7 @@ msgstr "" "プが崩壊していくのと同じ速度で成長します。最初のヒープが完全に消滅したら、" "ヒープを切り替えて新たなランを開始します。なんと巧妙で効率的なのでしょう!" -#: ../../library/heapq.rst:376 +#: ../../library/heapq.rst:308 msgid "" "In a word, heaps are useful memory structures to know. I use them in a few " "applications, and I think it is good to keep a 'heap' module around. :-)" @@ -644,11 +516,11 @@ msgstr "" "ションでヒープを使っていて、'ヒープ' モジュールを常備するのはいい事だと考えて" "います。:-)" -#: ../../library/heapq.rst:380 +#: ../../library/heapq.rst:312 msgid "Footnotes" msgstr "脚注" -#: ../../library/heapq.rst:381 +#: ../../library/heapq.rst:313 msgid "" "The disk balancing algorithms which are current, nowadays, are more annoying " "than clever, and this is a consequence of the seeking capabilities of the " diff --git a/library/hmac.po b/library/hmac.po index d15725acb..7053d5f56 100644 --- a/library/hmac.po +++ b/library/hmac.po @@ -1,31 +1,35 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 -# 石井明久, 2024 +# E. Kawashima, 2017 +# Yusuke Miyazaki , 2017 +# 秘湯 , 2017 +# Arihiro TAKASE, 2017 +# Takuya N , 2018 +# Tetsuo Koyama , 2020 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-13 14:21+0000\n" -"PO-Revision-Date: 2021-06-28 01:07+0000\n" -"Last-Translator: 石井明久, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 23:13+0000\n" +"Last-Translator: Tetsuo Koyama , 2020\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/hmac.rst:2 -msgid ":mod:`!hmac` --- Keyed-Hashing for Message Authentication" -msgstr ":mod:`!hmac` --- メッセージ認証のための鍵付きハッシュ化" +msgid ":mod:`hmac` --- Keyed-Hashing for Message Authentication" +msgstr ":mod:`hmac` --- メッセージ認証のための鍵付きハッシュ化" #: ../../library/hmac.rst:10 msgid "**Source code:** :source:`Lib/hmac.py`" @@ -56,13 +60,14 @@ msgstr "" "数 *msg* に :mod:`hashlib` がサポートする全てのタイプを渡せるようになりまし" "た。引数 *digestmod* にハッシュアルゴリズム名を渡せるようになりました。" -#: ../../library/hmac.rst:30 +#: ../../library/hmac.rst:33 msgid "" -"The *digestmod* argument is now required. Pass it as a keyword argument to " -"avoid awkwardness when you do not have an initial *msg*." +"MD5 as implicit default digest for *digestmod* is deprecated. The digestmod " +"parameter is now required. Pass it as a keyword argument to avoid " +"awkwardness when you do not have an initial msg." msgstr "" -#: ../../library/hmac.rst:37 +#: ../../library/hmac.rst:38 msgid "" "Return digest of *msg* for given secret *key* and *digest*. The function is " "equivalent to ``HMAC(key, msg, digest).digest()``, but uses an optimized C " @@ -76,7 +81,7 @@ msgstr "" "メータ *key* 、 *msg* 、および *digest* は、 :func:`~hmac.new` と同じ意味を持" "ちます。" -#: ../../library/hmac.rst:43 +#: ../../library/hmac.rst:44 msgid "" "CPython implementation detail, the optimized C implementation is only used " "when *digest* is a string and name of a digest algorithm, which is supported " @@ -85,11 +90,11 @@ msgstr "" "CPython実装の詳細、最適化されたC実装は、OpenSSLがサポートするダイジェストアル" "ゴリズムの文字列と名前が *digest* の場合にのみ使用されます。" -#: ../../library/hmac.rst:50 +#: ../../library/hmac.rst:51 msgid "An HMAC object has the following methods:" msgstr "HMAC オブジェクトは以下のメソッドを持っています:" -#: ../../library/hmac.rst:54 +#: ../../library/hmac.rst:55 msgid "" "Update the hmac object with *msg*. Repeated calls are equivalent to a " "single call with the concatenation of all the arguments: ``m.update(a); m." @@ -99,12 +104,12 @@ msgstr "" "らの引数を全て結合した引数で単一の呼び出しをした際と同じになります。すなわち " "``m.update(a); m.update(b)`` は ``m.update(a + b)`` と等価です。" -#: ../../library/hmac.rst:58 +#: ../../library/hmac.rst:59 msgid "Parameter *msg* can be of any type supported by :mod:`hashlib`." msgstr "" "引数 *msg* は :mod:`hashlib` がサポートしているあらゆる型のいずれかです。" -#: ../../library/hmac.rst:64 +#: ../../library/hmac.rst:65 msgid "" "Return the digest of the bytes passed to the :meth:`update` method so far. " "This bytes object will be the same length as the *digest_size* of the digest " @@ -115,15 +120,18 @@ msgstr "" "す。これはコンストラクタに与えられた *digest_size* と同じ長さのバイト列で、 " "NUL バイトを含む非 ASCII 文字が含まれることがあります。" -#: ../../library/hmac.rst:71 +#: ../../library/hmac.rst:72 msgid "" -"When comparing the output of :meth:`digest` to an externally supplied digest " +"When comparing the output of :meth:`digest` to an externally-supplied digest " "during a verification routine, it is recommended to use the :func:" "`compare_digest` function instead of the ``==`` operator to reduce the " "vulnerability to timing attacks." msgstr "" +":meth:`digest` の出力結果と外部から供給されたダイジェストを検証ルーチン内で比" +"較しようとするのであれば、タイミング攻撃への脆弱性を減らすために、 ``==`` 演" +"算子ではなく :func:`compare_digest` を使うことをお奨めします。" -#: ../../library/hmac.rst:79 +#: ../../library/hmac.rst:80 msgid "" "Like :meth:`digest` except the digest is returned as a string twice the " "length containing only hexadecimal digits. This may be used to exchange the " @@ -132,15 +140,18 @@ msgstr "" ":meth:`digest` と似ていますが、返される文字列は倍の長さとなり、16進形式となり" "ます。これは、電子メールなどの非バイナリ環境で値を交換する場合に便利です。" -#: ../../library/hmac.rst:85 +#: ../../library/hmac.rst:86 msgid "" -"When comparing the output of :meth:`hexdigest` to an externally supplied " +"When comparing the output of :meth:`hexdigest` to an externally-supplied " "digest during a verification routine, it is recommended to use the :func:" "`compare_digest` function instead of the ``==`` operator to reduce the " "vulnerability to timing attacks." msgstr "" +":meth:`hexdigest` の出力結果と外部から供給されたダイジェストを検証ルーチン内" +"で比較しようとするのであれば、タイミング攻撃への脆弱性を減らすために、 " +"``==`` 演算子ではなく :func:`compare_digest` を使うことをお奨めします。" -#: ../../library/hmac.rst:93 +#: ../../library/hmac.rst:94 msgid "" "Return a copy (\"clone\") of the hmac object. This can be used to " "efficiently compute the digests of strings that share a common initial " @@ -150,33 +161,34 @@ msgstr "" "字列が共通になっている文字列のダイジェスト値を効率よく計算するために使うこと" "ができます。" -#: ../../library/hmac.rst:97 +#: ../../library/hmac.rst:98 msgid "A hash object has the following attributes:" msgstr "ハッシュオブジェクトには次のような属性があります:" -#: ../../library/hmac.rst:101 +#: ../../library/hmac.rst:102 msgid "The size of the resulting HMAC digest in bytes." msgstr "生成された HMAC ダイジェストのバイト数。" -#: ../../library/hmac.rst:105 +#: ../../library/hmac.rst:106 msgid "The internal block size of the hash algorithm in bytes." msgstr "内部で使われるハッシュアルゴリズムのブロックのバイト数。" -#: ../../library/hmac.rst:111 +#: ../../library/hmac.rst:112 msgid "The canonical name of this HMAC, always lowercase, e.g. ``hmac-md5``." msgstr "このHMAC の正規名で、例えば ``hmac-md5`` のように常に小文字です。" -#: ../../library/hmac.rst:116 +#: ../../library/hmac.rst:119 msgid "" -"Removed the undocumented attributes ``HMAC.digest_cons``, ``HMAC.inner``, " -"and ``HMAC.outer``." +"The undocumented attributes ``HMAC.digest_cons``, ``HMAC.inner``, and ``HMAC." +"outer`` are internal implementation details and will be removed in Python " +"3.10." msgstr "" -#: ../../library/hmac.rst:120 +#: ../../library/hmac.rst:123 msgid "This module also provides the following helper function:" msgstr "このモジュールは以下のヘルパ関数も提供しています:" -#: ../../library/hmac.rst:124 +#: ../../library/hmac.rst:127 msgid "" "Return ``a == b``. This function uses an approach designed to prevent " "timing analysis by avoiding content-based short circuiting behaviour, making " @@ -190,7 +202,7 @@ msgstr "" "えば :meth:`HMAC.hexdigest` が返したような ASCII のみの) :class:`str` また" "は :term:`bytes-like object` のどちらか一方。" -#: ../../library/hmac.rst:132 +#: ../../library/hmac.rst:135 msgid "" "If *a* and *b* are of different lengths, or if an error occurs, a timing " "attack could theoretically reveal information about the types and lengths of " @@ -200,15 +212,15 @@ msgstr "" "論上 *a* と *b* の型と長さについての情報が暴露されますが、その値は明らかにな" "りません。" -#: ../../library/hmac.rst:140 +#: ../../library/hmac.rst:143 msgid "" "The function uses OpenSSL's ``CRYPTO_memcmp()`` internally when available." msgstr "" -#: ../../library/hmac.rst:146 +#: ../../library/hmac.rst:149 msgid "Module :mod:`hashlib`" msgstr ":mod:`hashlib` モジュール" -#: ../../library/hmac.rst:147 +#: ../../library/hmac.rst:150 msgid "The Python module providing secure hash functions." msgstr "セキュアハッシュ関数を提供する Python モジュールです。" diff --git a/library/html.entities.po b/library/html.entities.po index 784ad7f09..6d027983c 100644 --- a/library/html.entities.po +++ b/library/html.entities.po @@ -1,31 +1,34 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 -# 石井明久, 2024 +# 秘湯 , 2017 +# Masato HASHIMOTO , 2017 +# Nozomu Kaneko , 2017 +# Arihiro TAKASE, 2017 +# Shun Sakurai, 2017 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-13 14:21+0000\n" -"PO-Revision-Date: 2021-06-28 01:07+0000\n" -"Last-Translator: 石井明久, 2024\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 23:13+0000\n" +"Last-Translator: Shun Sakurai, 2017\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/html.entities.rst:2 -msgid ":mod:`!html.entities` --- Definitions of HTML general entities" -msgstr ":mod:`!html.entities` --- HTML 一般実体の定義" +msgid ":mod:`html.entities` --- Definitions of HTML general entities" +msgstr ":mod:`html.entities` --- HTML 一般実体の定義" #: ../../library/html.entities.rst:9 msgid "**Source code:** :source:`Lib/html/entities.py`" @@ -63,21 +66,19 @@ msgstr "" "す。" #: ../../library/html.entities.rst:37 -msgid "A dictionary that maps HTML4 entity names to the Unicode code points." -msgstr "HTML4 実体名と Unicode コードポイントとを対応付ける辞書です。" +msgid "A dictionary that maps HTML entity names to the Unicode code points." +msgstr "HTML 実体名と Unicode コードポイントとを対応付ける辞書です。" #: ../../library/html.entities.rst:42 -msgid "A dictionary that maps Unicode code points to HTML4 entity names." -msgstr "Unicode コードポイントと HTML4 実体名とを対応付ける辞書です。" +msgid "A dictionary that maps Unicode code points to HTML entity names." +msgstr "Unicode コードポイントと HTML 実体名とを対応付ける辞書です。" #: ../../library/html.entities.rst:46 msgid "Footnotes" msgstr "脚注" #: ../../library/html.entities.rst:47 -msgid "" -"See https://html.spec.whatwg.org/multipage/named-characters.html#named-" -"character-references" +msgid "See https://www.w3.org/TR/html5/syntax.html#named-character-references" msgstr "" -"https://html.spec.whatwg.org/multipage/named-characters.html#named-character-" -"references を参照" +"https://www.w3.org/TR/html5/syntax.html#named-character-references%20%E3%82%92%E5%8F%82%E7%85%A7%E3%81%97%E3%81%A6" +"ください" diff --git a/library/html.parser.po b/library/html.parser.po index 17bf48553..643348030 100644 --- a/library/html.parser.po +++ b/library/html.parser.po @@ -1,34 +1,36 @@ # SOME DESCRIPTIVE TITLE. -# Copyright (C) 2001 Python Software Foundation +# Copyright (C) 2001-2021, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # # Translators: -# tomo, 2021 -# ごはんですよ , 2023 -# Arihiro TAKASE, 2023 -# 石井明久, 2024 -# Atsuo Ishimoto , 2025 +# 秘湯 , 2017 +# Arihiro TAKASE, 2017 +# Nozomu Kaneko , 2017 +# E. Kawashima, 2017 +# Masato HASHIMOTO , 2017 +# Shun Sakurai, 2017 +# tomo, 2018 # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: Python 3.14\n" +"Project-Id-Version: Python 3.9\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-23 14:20+0000\n" -"PO-Revision-Date: 2021-06-28 01:07+0000\n" -"Last-Translator: Atsuo Ishimoto , 2025\n" -"Language-Team: Japanese (https://app.transifex.com/python-doc/teams/5390/" +"POT-Creation-Date: 2021-01-01 05:02+0000\n" +"PO-Revision-Date: 2017-02-16 23:13+0000\n" +"Last-Translator: tomo, 2018\n" +"Language-Team: Japanese (https://www.transifex.com/python-doc/teams/5390/" "ja/)\n" +"Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: ja\n" "Plural-Forms: nplurals=1; plural=0;\n" #: ../../library/html.parser.rst:2 -msgid ":mod:`!html.parser` --- Simple HTML and XHTML parser" -msgstr ":mod:`!html.parser` --- HTML と XHTML のシンプルなパーサー" +msgid ":mod:`html.parser` --- Simple HTML and XHTML parser" +msgstr ":mod:`html.parser`--- HTML および XHTML のシンプルなパーサー" #: ../../library/html.parser.rst:7 msgid "**Source code:** :source:`Lib/html/parser.py`" @@ -96,57 +98,24 @@ msgstr "HTML パーサーアプリケーションの例" msgid "" "As a basic example, below is a simple HTML parser that uses the :class:" "`HTMLParser` class to print out start tags, end tags, and data as they are " -"encountered:" -msgstr "" - -#: ../../library/html.parser.rst:48 -msgid "" -"from html.parser import HTMLParser\n" -"\n" -"class MyHTMLParser(HTMLParser):\n" -" def handle_starttag(self, tag, attrs):\n" -" print(\"Encountered a start tag:\", tag)\n" -"\n" -" def handle_endtag(self, tag):\n" -" print(\"Encountered an end tag :\", tag)\n" -"\n" -" def handle_data(self, data):\n" -" print(\"Encountered some data :\", data)\n" -"\n" -"parser = MyHTMLParser()\n" -"parser.feed('Test'\n" -" '

Parse me!

')" +"encountered::" msgstr "" +"基礎的な例として、:class:`HTMLParser` クラスを使い、発見した開始タグ、終了タ" +"グ、およびデータを出力する、シンプルな HTML パーサーを以下に示します::" -#: ../../library/html.parser.rst:66 +#: ../../library/html.parser.rst:64 msgid "The output will then be:" msgstr "出力は以下のようになります:" -#: ../../library/html.parser.rst:68 -msgid "" -"Encountered a start tag: html\n" -"Encountered a start tag: head\n" -"Encountered a start tag: title\n" -"Encountered some data : Test\n" -"Encountered an end tag : title\n" -"Encountered an end tag : head\n" -"Encountered a start tag: body\n" -"Encountered a start tag: h1\n" -"Encountered some data : Parse me!\n" -"Encountered an end tag : h1\n" -"Encountered an end tag : body\n" -"Encountered an end tag : html" -msgstr "" - -#: ../../library/html.parser.rst:85 +#: ../../library/html.parser.rst:83 msgid ":class:`.HTMLParser` Methods" msgstr ":class:`.HTMLParser` メソッド" -#: ../../library/html.parser.rst:87 +#: ../../library/html.parser.rst:85 msgid ":class:`HTMLParser` instances have the following methods:" msgstr ":class:`HTMLParser` インスタンスは以下のメソッドを提供します:" -#: ../../library/html.parser.rst:92 +#: ../../library/html.parser.rst:90 msgid "" "Feed some text to the parser. It is processed insofar as it consists of " "complete elements; incomplete data is buffered until more data is fed or :" @@ -157,7 +126,7 @@ msgstr "" "meth:`close` が呼び出されるまでバッファーされます。 *data* は :class:`str` で" "なければなりません。" -#: ../../library/html.parser.rst:99 +#: ../../library/html.parser.rst:97 msgid "" "Force processing of all buffered data as if it were followed by an end-of-" "file mark. This method may be redefined by a derived class to define " @@ -170,7 +139,7 @@ msgstr "" "されたバージョンでは、常に :class:`HTMLParser` 基底クラスのメソッド :meth:" "`close` を呼び出さなくてはなりません。" -#: ../../library/html.parser.rst:107 +#: ../../library/html.parser.rst:105 msgid "" "Reset the instance. Loses all unprocessed data. This is called implicitly " "at instantiation time." @@ -178,11 +147,11 @@ msgstr "" "インスタンスをリセットします。未処理のデータはすべて失われます。インスタンス" "化の際に暗黙的に呼び出されます。" -#: ../../library/html.parser.rst:113 +#: ../../library/html.parser.rst:111 msgid "Return current line number and offset." msgstr "現在の行番号およびオフセット値を返します。" -#: ../../library/html.parser.rst:118 +#: ../../library/html.parser.rst:116 msgid "" "Return the text of the most recently opened start tag. This should not " "normally be needed for structured processing, but may be useful in dealing " @@ -194,7 +163,7 @@ msgstr "" "deployed)\" HTML を扱ったり、入力を最小限の変更で再生成 (属性間の空白をそのま" "まにする、など) したりする場合に便利なことがあります。" -#: ../../library/html.parser.rst:124 +#: ../../library/html.parser.rst:122 msgid "" "The following methods are called when data or markup elements are " "encountered and they are meant to be overridden in a subclass. The base " @@ -205,15 +174,15 @@ msgstr "" "れらはサブクラスで上書きされることを想定されています。基底クラスの実装は (:" "meth:`~HTMLParser.handle_startendtag` を除き) 何もしません:" -#: ../../library/html.parser.rst:131 +#: ../../library/html.parser.rst:129 msgid "" -"This method is called to handle the start tag of an element (e.g. ``
``)." msgstr "" -"このメソッドは要素の開始タグを扱うために呼び出されます (例: ``
``)。" -#: ../../library/html.parser.rst:133 +#: ../../library/html.parser.rst:131 msgid "" "The *tag* argument is the name of the tag converted to lower case. The " "*attrs* argument is a list of ``(name, value)`` pairs containing the " @@ -226,7 +195,7 @@ msgstr "" "ます。*name* は小文字に変換され、*value* 内の引用符は取り除かれ、文字参照と実" "態参照は置き換えられます。" -#: ../../library/html.parser.rst:139 +#: ../../library/html.parser.rst:137 msgid "" "For instance, for the tag ````, this method " "would be called as ``handle_starttag('a', [('href', 'https://www.cwi./" @@ -236,24 +205,24 @@ msgstr "" "ドは ``handle_starttag('a', [('href', 'https://www.cwi.nl/')])`` として呼び出" "されます。" -#: ../../library/html.parser.rst:142 +#: ../../library/html.parser.rst:140 msgid "" "All entity references from :mod:`html.entities` are replaced in the " "attribute values." msgstr "" ":mod:`html.entities` からのすべての実態参照は、属性値に置き換えられます。" -#: ../../library/html.parser.rst:148 +#: ../../library/html.parser.rst:146 msgid "" "This method is called to handle the end tag of an element (e.g. ``
``)." msgstr "" "このメソッドは要素の終了タグを扱うために呼び出されます (例: ``
``)。" -#: ../../library/html.parser.rst:150 +#: ../../library/html.parser.rst:148 msgid "The *tag* argument is the name of the tag converted to lower case." msgstr "引数 *tag* はタグの名前で、小文字に変換されます。" -#: ../../library/html.parser.rst:155 +#: ../../library/html.parser.rst:153 msgid "" "Similar to :meth:`handle_starttag`, but called when the parser encounters an " "XHTML-style empty tag (````). This method may be overridden by " @@ -266,15 +235,15 @@ msgstr "" "合にこのメソッドをサブクラスで上書きすることができます; 既定の実装では、単" "に :meth:`handle_starttag` および :meth:`handle_endtag` を呼び出します。" -#: ../../library/html.parser.rst:163 +#: ../../library/html.parser.rst:161 msgid "" "This method is called to process arbitrary data (e.g. text nodes and the " "content of ```` and ````)." msgstr "" "このメソッドは任意のデータを処理するために呼び出されます (例: テキストノード" -"および ```` や ```` の内容)。" +"および ```` aや ```` の内容)。" -#: ../../library/html.parser.rst:169 +#: ../../library/html.parser.rst:167 msgid "" "This method is called to process a named character reference of the form " "``&name;`` (e.g. ``>``), where *name* is a general entity reference (e.g. " @@ -284,21 +253,21 @@ msgstr "" "めに呼び出されます。*name* は一般実体参照になります (例: ``'gt'``)。このメ" "ソッドは *convert_charrefs* が ``True`` なら呼び出されることはありません。" -#: ../../library/html.parser.rst:177 +#: ../../library/html.parser.rst:175 msgid "" "This method is called to process decimal and hexadecimal numeric character " -"references of the form :samp:`&#{NNN};` and :samp:`&#x{NNN};`. For example, " -"the decimal equivalent for ``>`` is ``>``, whereas the hexadecimal is " -"``>``; in this case the method will receive ``'62'`` or ``'x3E'``. " -"This method is never called if *convert_charrefs* is ``True``." +"references of the form ``&#NNN;`` and ``&#xNNN;``. For example, the decimal " +"equivalent for ``>`` is ``>``, whereas the hexadecimal is ``>``; " +"in this case the method will receive ``'62'`` or ``'x3E'``. This method is " +"never called if *convert_charrefs* is ``True``." msgstr "" -"このメソッドは :samp:`&#{NNN};` あるいは :samp:`&#x{NNN};` 形式の 10進および " -"16 進数値文字参照を処理するために呼び出されます。例えば、``>`` と等価な " -"10 進数は ``>`` で、16進数は ``>`` になります。この場合、メソッドは " -"``'62'`` あるいは ``'x3E'`` を受け取ります。このメソッドは " -"*convert_charrefs* が ``True`` なら呼び出されることはありません。" +"このメソッドは ``&#NNN;`` あるいは ``&#xNNN;`` 形式の 10進および 16 進数値文" +"字参照を処理するために呼び出されます。例えば、``>`` と等価な 10 進数は " +"``>`` で、16進数は ``>`` になります。この場合、メソッドは ``'62'`` " +"あるいは ``'x3E'`` を受け取ります。このメソッドは *convert_charrefs* が " +"``True`` なら呼び出されることはありません。" -#: ../../library/html.parser.rst:186 +#: ../../library/html.parser.rst:184 msgid "" "This method is called when a comment is encountered (e.g. ```` will cause this method to be " "called with the argument ``' comment '``." @@ -314,7 +283,7 @@ msgstr "" "例えば、コメント ```` があると。このメソッドを引数 ``' " "comment '`` で呼び出されます。" -#: ../../library/html.parser.rst:191 +#: ../../library/html.parser.rst:189 msgid "" "The content of Internet Explorer conditional comments (condcoms) will also " "be sent to this method, so, for ```` の場合、こ" "のメソッドは ``'[if IE 9]>IE9-specific content``)." @@ -333,7 +302,7 @@ msgstr "" "このメソッドは HTML doctype 宣言を扱うために呼び出されます (例: ````)。" -#: ../../library/html.parser.rst:201 +#: ../../library/html.parser.rst:199 msgid "" "The *decl* parameter will be the entire contents of the declaration inside " "the ```` markup (e.g. ``'DOCTYPE html'``)." @@ -341,7 +310,7 @@ msgstr "" "引数 *decl* は ```` マークアップ内の宣言の内容全体になります (例: " "``'DOCTYPE html'``)。" -#: ../../library/html.parser.rst:207 +#: ../../library/html.parser.rst:205 msgid "" "Method called when a processing instruction is encountered. The *data* " "parameter will contain the entire processing instruction. For example, for " @@ -354,7 +323,7 @@ msgstr "" "color='red'\")`` のように呼び出されます。このメソッドは派生クラスで上書きする" "ためのメソッドです; 基底クラスの実装では何も行いません。" -#: ../../library/html.parser.rst:215 +#: ../../library/html.parser.rst:213 msgid "" "The :class:`HTMLParser` class uses the SGML syntactic rules for processing " "instructions. An XHTML processing instruction using the trailing ``'?'`` " @@ -364,12 +333,12 @@ msgstr "" "``'?'`` がある XHTML の処理指令では、 ``'?'`` が *data* に含まれることになり" "ます。" -#: ../../library/html.parser.rst:222 +#: ../../library/html.parser.rst:220 msgid "" "This method is called when an unrecognized declaration is read by the parser." msgstr "このメソッドはパーサーが未知の宣言を読み込んだ時に呼び出されます。" -#: ../../library/html.parser.rst:224 +#: ../../library/html.parser.rst:222 msgid "" "The *data* parameter will be the entire contents of the declaration inside " "the ```` markup. It is sometimes useful to be overridden by a " @@ -380,175 +349,55 @@ msgstr "" "これは派生クラスで上書きする時に役立つことがあります。\n" "基底クラスの実装では何もしません。" -#: ../../library/html.parser.rst:232 +#: ../../library/html.parser.rst:230 msgid "Examples" msgstr "使用例" -#: ../../library/html.parser.rst:234 +#: ../../library/html.parser.rst:232 msgid "" "The following class implements a parser that will be used to illustrate more " -"examples:" -msgstr "" - -#: ../../library/html.parser.rst:237 -msgid "" -"from html.parser import HTMLParser\n" -"from html.entities import name2codepoint\n" -"\n" -"class MyHTMLParser(HTMLParser):\n" -" def handle_starttag(self, tag, attrs):\n" -" print(\"Start tag:\", tag)\n" -" for attr in attrs:\n" -" print(\" attr:\", attr)\n" -"\n" -" def handle_endtag(self, tag):\n" -" print(\"End tag :\", tag)\n" -"\n" -" def handle_data(self, data):\n" -" print(\"Data :\", data)\n" -"\n" -" def handle_comment(self, data):\n" -" print(\"Comment :\", data)\n" -"\n" -" def handle_entityref(self, name):\n" -" c = chr(name2codepoint[name])\n" -" print(\"Named ent:\", c)\n" -"\n" -" def handle_charref(self, name):\n" -" if name.startswith('x'):\n" -" c = chr(int(name[1:], 16))\n" -" else:\n" -" c = chr(int(name))\n" -" print(\"Num ent :\", c)\n" -"\n" -" def handle_decl(self, data):\n" -" print(\"Decl :\", data)\n" -"\n" -"parser = MyHTMLParser()" -msgstr "" - -#: ../../library/html.parser.rst:273 -msgid "Parsing a doctype:" -msgstr "" +"examples::" +msgstr "以下のクラスは、より多くの例を示すのに用いられるパーサーの実装です::" -#: ../../library/html.parser.rst:275 -msgid "" -">>> parser.feed('')\n" -"Decl : DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3./" -"org/TR/html4/strict.dtd\"" -msgstr "" +#: ../../library/html.parser.rst:269 +msgid "Parsing a doctype::" +msgstr "doctype をパースします::" -#: ../../library/html.parser.rst:281 -msgid "Parsing an element with a few attributes and a title:" -msgstr "" - -#: ../../library/html.parser.rst:283 -msgid "" -">>> parser.feed('\"The')\n" -"Start tag: img\n" -" attr: ('src', 'python-logo.png')\n" -" attr: ('alt', 'The Python logo')\n" -">>>\n" -">>> parser.feed('

Python

')\n" -"Start tag: h1\n" -"Data : Python\n" -"End tag : h1" -msgstr "" +#: ../../library/html.parser.rst:275 +msgid "Parsing an element with a few attributes and a title::" +msgstr "要素のタイトルと一部属性をパースします::" -#: ../../library/html.parser.rst:295 +#: ../../library/html.parser.rst:287 msgid "" "The content of ``script`` and ``style`` elements is returned as is, without " -"further parsing:" -msgstr "" - -#: ../../library/html.parser.rst:298 -msgid "" -">>> parser.feed('